项目摘要
面向Solana开发者与AI工作流的术语库SDK,提供1059个术语的检索、分类、关联查询与MCP工具访问。
SolanaGlossary将Solana生态中的1059个术语打包为npmSDK,支持按术语、类别、深度、标签和关联关系进行查询,并提供葡萄牙语和西班牙语本地化。它适合Solana开发者、文档与搜索工具构建者,以及希望在Claude、Cursor等MCP客户端中注入术语上下文的AI代理工作流。
项目详细信息
@stbr/solana-词汇表
有史以来最全面的 Solana 术语表 — 1059 个术语、14 个类别、完整的交叉引用和 i18n 支持。 打包为 SDK。
为什么会存在
最初的 Solana 术语表是生态系统中最受欢迎的资源之一 - 任何开发人员都可以在其中查找不熟悉的 Solana 概念并立即了解上下文。
随着时间的推移,它被吸收到通用的“术语”文档中并失去了它的身份。
Superteam Brazil 正在将其带回来 — 从约 200 个术语扩展到 1059 个,构建为适当的 npm 包,并旨在实际交付价值:
- 入职 — 新开发人员可以即时了解 1059 个 Solana 概念
- 深入 — 经验丰富的开发人员探索术语之间的交叉引用技术关系
- Vibe 编码员 — AI 辅助构建者可以理解抽象背后的内容
- 保存令牌 — 将术语表上下文提供给法学硕士,而不是销毁令牌,在每次提示时重新解释 Solana 概念
安装
npm i @stbr/solana-glossary
pnpm add @stbr/solana-glossary
yarn add @stbr/solana-glossary
```---
## MCP 服务器
该术语表附带内置 MCP 服务器 — 10 个可从 Claude、Cursor 或任何 MCP 客户端访问的 AI 工具。
### 设置(克劳德代码/克劳德桌面)
```json
{
"mcpServers": {
"solana-glossary": {
"command": "npx",
"args": ["@stbr/solana-glossary"]
}
}
}
可用工具
| 工具 | 描述 |
|---|---|
lookup_term | 按 ID 或别名查找术语 |
search_glossary | 跨术语全文搜索 |
browse_category | 列出类别中的所有术语 |
filter_by_depth | 按知识深度过滤 (1-5) |
filter_by_tag | 按标签过滤(例如“token-2022”、“jito”) |
get_related | 遍历知识图谱 |
inject_context | LLM 提示的令牌优化上下文块 |
glossary_stats | 词汇表元数据和统计数据 |
list_categories | 所有 14 个类别的计数 |
list_tags | 所有 16 个标签均包含计数 |
所有工具都支持可选的 locale 参数("pt" 或 "es")以获取本地化结果。
人工智能技能
该软件包包含一个 AI skill,其中包含有关 AI 代理何时以及如何使用词汇表工具的说明。
使用 skills-npm 安装它:
npm skill add @stbr/solana-glossary
或者将 skills/solana-glossary/SKILL.md 复制到项目的 .claude/skills/ 目录中。
快速入门
import { getTerm, searchTerms, getTermsByCategory, allTerms } from "@stbr/solana-glossary";
// Look up a term by ID
const poh = getTerm("proof-of-history");
console.log(poh?.definition);
// Look up by alias
const same = getTerm("PoH"); // Same result
// Search across names, definitions, and aliases
const results = searchTerms("account");
// Get all terms in a category
const defiTerms = getTermsByCategory("defi");
// Access everything
console.log(`${allTerms.length} terms loaded`); // 1059
```---
## API 参考
### `getTerm(idOrAlias: string): GlossaryTerm | undefined`
通过其确切 ID 或其任何别名(别名不区分大小写)查找术语。
```typescript
getTerm("pda"); // by ID
getTerm("PDA"); // by alias → same term
getTerm("nonexistent"); // undefined
searchTerms(query: string): GlossaryTerm[]
跨术语名称、定义、ID 和别名进行全文搜索。 不区分大小写。
searchTerms("proof of history"); // finds PoH and related terms
searchTerms("AMM"); // finds AMM-related terms
getTermsByCategory(category: Category): GlossaryTerm[]
获取属于特定类别的所有术语。
getTermsByCategory("defi"); // 135 terms
getTermsByCategory("core-protocol"); // 86 terms
getTermsByDepth(depth: Depth): GlossaryTerm[]
获取特定深度级别的所有术语。
getTermsByDepth(1); // 110 surface-level terms
getTermsByDepth(5); // 56 bottom-level terms
getTermsByMaxDepth(maxDepth: Depth): GlossaryTerm[]
获取给定深度级别或低于给定深度级别的所有术语。 对于渐进式披露很有用。
getTermsByMaxDepth(2); // 382 terms (surface + shallow)
getTermsByMaxDepth(5); // all 1059 terms
getTermsByTag(tag: string): GlossaryTerm[]
获取带有特定标签的所有术语。 标签是跨类别的交叉关注点。
getTermsByTag("token-2022"); // all Token-2022 extension terms
getTermsByTag("vulnerability"); // all known attack vectors
getTermsByTag("jito"); // Jito ecosystem terms
getAllTags(): string[]
返回跨术语使用的所有唯一标签,按字母顺序排序。
getCategories(): Category[]
返回所有 14 个类别标识符。
allTerms: GlossaryTerm[]
所有 1059 个术语的完整数组。 对于构建自定义索引或提供给法学硕士很有用。
类别
| 类别 | 条款 | 描述 |
|---|---|---|
core-protocol | 96 | 96 共识、PoH、验证器、插槽、纪元 |
programming-model | 82 | 82 帐户、指令、程序、PDA |
token-ecosystem | 70 | 70 SPL 代币、Token-2022、元数据、NFT |
defi | 144 | 144 AMM、流动性池、借贷协议 |
zk-compression | 37 | 37 ZK 证明、压缩账户、轻协议 |
infrastructure | 47 | 47 RPC、验证器、质押、快照 |
security | 56 | 56 攻击向量、审计实践、重入 |
dev-tools | 64 | 64 锚点、Solana CLI、浏览器、测试 |
network | 58 | 58 主网、开发网、测试网、集群配置 |
blockchain-general | 84 | 84 共享区块链概念 |
web3 | 80 | 钱包、dApp、签名、密钥管理 |
programming-fundamentals | 47 | 47 数据结构、序列化、Borsh |
ai-ml | 55 | 55 AI代理、链上推理、模型集成 |
solana-ecosystem | 139 | 139 项目、协议和工具 |
国际化
该术语表附带国际化支持。 翻译覆盖 term 和 definition,同时保留所有结构字段 (id、category、depth、related、 aliases) 英语。
import { getLocalizedTerms } from "@stbr/solana-glossary/i18n";
const ptTerms = getLocalizedTerms("pt"); // Portuguese
const esTerms = getLocalizedTerms("es"); // Spanish
可用区域设置:pt(葡萄牙语)、es(西班牙语)
没有翻译的术语会自动回退为英语。
翻译文件格式
data/i18n/<locale>.json:
{
"proof-of-history": {
"term": "Prova de História (PoH)",
"definition": "Um mecanismo de relogio que prova criptograficamente a passagem de tempo entre eventos..."
}
}
```---
## 术语架构
```typescript
type Depth = 1 | 2 | 3 | 4 | 5;
interface GlossaryTerm {
id: string; // URL-safe kebab-case identifier
term: string; // Display name
definition: string; // Plain-text definition (1-3 sentences)
category: Category; // One of 14 categories
depth: Depth; // Knowledge depth: 1 (surface) to 5 (bottom)
related?: string[]; // Cross-reference IDs
aliases?: string[]; // Abbreviations and alternate names
tags?: string[]; // Cross-cutting concerns (e.g. "token-2022", "jito", "deprecated")
}
```---
## 深度级别
每个术语都有一个 `depth` 评级,表明理解它所需的知识水平:
| 深度 | 标签| 观众| 示例 |
|--------|--------|----------|----------|
| 1 | 表面| 加密货币领域的任何人 | 钱包、NFT、SOL、交易 |
| 2 | 浅 | Solana 初学者 | 权益、验证器、RPC、SPL 代币 |
| 3 | 深 | 中级开发人员 | 海平面、湾流、涡轮机、锚|
| 4 | 深渊| 高级开发人员 | PoH 内部结构、BPF、CPI、PDA |
| 5 | 底部| 核心/研究人员| 运行时系统调用、ZK 压缩内部结构 |
---
## 用例
### 向法学硕士提供背景信息
```typescript
import { getTermsByCategory } from "@stbr/solana-glossary";
const context = getTermsByCategory("defi")
.map(t => `${t.term}: ${t.definition}`)
.join("\n");
// Add to your system prompt — no more wasting tokens explaining basics
建立搜索索引
import { allTerms } from "@stbr/solana-glossary";
// Feed into Algolia, MeiliSearch, or any search engine
const searchDocs = allTerms.map(t => ({
objectID: t.id,
title: t.term,
content: t.definition,
category: t.category,
tags: t.aliases ?? [],
}));
渐进式入职
import { getTermsByMaxDepth } from "@stbr/solana-glossary";
// Show only beginner-friendly terms
const beginnerTerms = getTermsByMaxDepth(2);
// Unlock more as the user progresses
const intermediateTerms = getTermsByMaxDepth(3);
入门工具提示
import { getTerm } from "@stbr/solana-glossary";
// In your UI component
const tooltip = getTerm("pda")?.definition;
```---
## 贡献
有关添加术语、翻译和提交 PR 的指南,请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
```bash
npm test # Run tests
npm run build # Build package
npm run lint # Type check
npm run validate # Check data integrity
```---
## 许可证
麻省理工学院。 请参阅[LICENSE](LICENSE)。
---
由 [Superteam Brazil](https://twitter.com/SuperteamBR) 精心打造。
