内容
# TNL 情报
[The Neural Ledger](https://theneuralledger.com) 情报 API 的开源开发者工具。
TNL 情报为 AI 代理和量化研究系统提供结构化、来源链接的全球事件情报。它是一个证据和研究层,而不是经纪人、订单路由器或交易级价格的来源。
## 软件包
| 软件包 | 目的 |
| ----------------------------- | ------------------------------------------------------------ |
| `@theneuralledger/sdk` | TNL `/v1` API 的类型化 TypeScript 客户端 |
| `@theneuralledger/mcp` | 基于 stdio 或可流式 HTTP 的只读 MCP 服务器 |
| `@theneuralledger/gateway` | 主持的 OAuth、租户策略、配额和审计 MCP 网关 |
| `@theneuralledger/onboarding` | 开发者凭证、静态示例 API 和资源 |
| `@theneuralledger/events` | Webhook 合同、签名交付和验证助手 |
| `@theneuralledger/research` | 以证据为优先的技能、编排、MCP 应用和网页 UI |
| `@theneuralledger/adapters` | 共享的 Cursor 和 OpenAI 工作流合同和渲染 |
| `@theneuralledger/connectors` | 共享的 n8n、Pipedream 和 Zapier 操作/触发器合同 |
| `@theneuralledger/cli` | `tnl` 命令行界面、监视命令、本地缓存和前台守护进程 |
| `tnl-intelligence` | Python SDK 和可选的逐点量化研究工具包 |
## 快速入门
在环境中设置成员 API 密钥:
```bash
export TNL_API_KEY="..."
```
通过 stdio 运行 MCP 服务器:
```bash
npx -y @theneuralledger/mcp
```
或运行其本地流式 HTTP 端点:
```bash
docker compose up --build
curl http://127.0.0.1:7317/healthz
```
使用命令行界面:
```bash
npx -y @theneuralledger/cli latest
npx -y @theneuralledger/cli search "Federal Reserve"
```
使用 TypeScript SDK:
```ts
import { TnlClient } from '@theneuralledger/sdk';
const client = new TnlClient({ apiKey: process.env.TNL_API_KEY! });
const page = await client.listNews({ sort: 'pipeline', pageSize: 20 });
```
使用 Python SDK:
```python
from tnl_intelligence import TnlClient
with TnlClient(api_key="...") as client:
page = client.list_news(sort="pipeline", page_size=20)
```
## 安全
- 绝不接受 API 密钥作为可见的命令行参数。
- MCP 工具是只读的,不会进行交易。
- 流式 HTTP 默认绑定到 `127.0.0.1`。
- 本地守护进程事件绝不包含 API 密钥。
- 主持的部署使用单独的网关、TLS 入口、OAuth 验证、租户策略、短时上游功能和分布式配额。
参见 [SECURITY.md](SECURITY.md) 和 [构建计划](docs/planning/tnl-intelligence-build-plan.md)。
研究部署边界和分阶段推出在 [研究运营](docs/research-operations.md) 中有文档记录。
## 开发
```bash
npm install
npm run openapi:sync
npm run validate
```
Python 开发使用 `python/tnl_intelligence` 下的项目。
## 文档
- [架构](docs/architecture.md)
- [配置和凭证处理](docs/configuration.md)
- [托管网关操作](docs/gateway-operations.md)
- [开发者入职](docs/developer/index.md)
- [Webhook 操作](docs/webhook-operations.md)
- [前台守护进程操作](docs/daemon.md)
- [发布手册](docs/publishing.md)
- [分发和产品扩展策略](docs/distribution-and-product-expansion.md)
- [AI 客户端适配器](docs/ai-client-adapters.md)
- [自动化连接器](docs/automation-connectors.md)
- [量化研究工具包](docs/quant-research-toolkit.md)
- [实施计划](docs/planning/tnl-intelligence-build-plan.md)
- [分发工具构建计划](docs/planning/tnl-distribution-tools-build-plan.md)
## 许可证
MIT