Skip to content

Latest commit

 

History

History
239 lines (169 loc) · 6.11 KB

File metadata and controls

239 lines (169 loc) · 6.11 KB

ResourceX

AI 资源的包管理器

让 Claude 使用你的 prompts、tools、agents

Stars License npm

English | 简体中文


为什么选择 ResourceX?

你的 prompts、tools、agent 配置散落在各处——文件里、Notion 里、脑子里。ResourceX 提供:

  • 统一格式打包任何 AI 资源
  • 版本控制,像 npm 包一样管理
  • MCP 集成,让 Claude 直接使用你的资源

简单说,AI 资源的 npm


2 分钟开始

1. 配置 MCP

Claude Desktop (~/.claude/claude_desktop_config.json):

{
  "mcpServers": {
    "resourcex": {
      "command": "npx",
      "args": ["@resourcexjs/mcp-server"]
    }
  }
}

VS Code (Claude 扩展设置):

{
  "claude.mcpServers": {
    "resourcex": {
      "command": "npx",
      "args": ["@resourcexjs/mcp-server"]
    }
  }
}

2. 在 Claude 中使用

You: 搜索 code review 相关的资源
Claude: [调用 search("code review")] 找到以下资源...

You: 用 code-review:1.0.0 审查这段代码
Claude: [调用 use("code-review:1.0.0")] 好的,让我用这个 prompt 来审查...

就这样,Claude 现在可以访问和使用 ResourceX 资源了。


进阶用法

创建自己的资源
# 创建资源目录
mkdir my-prompt && cd my-prompt

# 创建元信息
cat > resource.json << 'EOF'
{
  "name": "my-prompt",
  "type": "text",
  "version": "1.0.0"
}
EOF

# 创建内容
echo "You are a helpful assistant specialized in..." > content

# 添加到本地
npx @resourcexjs/cli add .
使用 CLI 管理资源
# 安装
npm install -g @resourcexjs/cli

# 常用命令
rx add ./my-prompt      # 添加本地资源
rx list                 # 列出所有资源
rx use name:1.0.0       # 使用资源
rx search keyword       # 搜索资源
rx push name:1.0.0      # 发布到 registry
rx pull name:1.0.0      # 从 registry 拉取

详见 CLI 文档

在代码中使用 SDK
npm install resourcexjs
import { createResourceX } from "resourcexjs";

const rx = createResourceX();

// 添加资源
await rx.add("./my-prompt");

// 解析并执行
const result = await rx.resolve("my-prompt:1.0.0");
console.log(result.content);

// 搜索资源
const results = await rx.search("code review");

详见 SDK 文档

自托管 Registry
import { createRegistryServer } from "@resourcexjs/server";

const app = createRegistryServer({
  storagePath: "./data",
});

export default app; // 部署到任何支持 Hono 的平台

详见 Server 文档


文档

教程 - 入门指南

指南 - 特定任务

参考 - 技术文档

概念 - 原理解释


描述
@resourcexjs/cli rx 命令行工具
@resourcexjs/mcp-server MCP Server,用于 AI Agent 集成
resourcexjs SDK
@resourcexjs/server 自托管 Registry Server
内部包(开发者)
描述
@resourcexjs/core 核心原语 (RXI, RXL, RXM, RXA, RXR)
@resourcexjs/storage 存储后端
@resourcexjs/registry Registry 实现
@resourcexjs/loader 资源加载
@resourcexjs/type 类型系统
@resourcexjs/arp 底层 I/O 协议

生态系统

Deepractice AI 基础设施的一部分:

  • AgentX - AI Agent 框架
  • AgentVM - AI Agent 运行时
  • ResourceX - 资源管理(本项目)

许可证

Apache-2.0


Deepractice 用 ❤️ 构建