@tomflow/chatloop-tools 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @tomflow/chatloop-tools — Chat Loop 工具包
2
2
 
3
- **v0.4.0 · npm 安装包 · Node.js >=20 · 当前验证平台 macOS**
3
+ **v0.4.2 · npm 安装包 · Node.js >=20 · 当前验证平台 macOS**
4
4
 
5
5
  本包是**本地 CLI + 统一 stdio MCP Gateway**:一套命令管理多个工具模块的启动、停止、重启、状态;一个 MCP 入口统一对外暴露各模块的工具 API。目前正式启用 **Desktop Commander 0.2.44**(26 个工具);Repomix 尚未接入。它**不是** ChatGPT Plugin、Secure MCP Tunnel、tunnel-client 或 Chrome 扩展,也不会替用户安装这些组件。
6
6
 
@@ -30,13 +30,13 @@ node packages/local-tools/bin/cli.mjs stop desktop-commander
30
30
 
31
31
  ### 独立 tarball:macOS 临时目录已通过实际验收
32
32
 
33
- **正式 npm 安装**:在包发布到 npm registry 后,运行 `npm install -g @tomflow/chatloop-tools@0.4.0`,随后执行 `chatloop-tools doctor`、`chatloop-tools status`、`chatloop-tools start desktop-commander`。也可在本地生成 tarball(不发布):
33
+ **正式 npm 安装**:在包发布到 npm registry 后,运行 `npm install -g @tomflow/chatloop-tools@0.4.2`,随后执行 `chatloop-tools doctor`、`chatloop-tools status`、`chatloop-tools start desktop-commander`。也可在本地生成 tarball(不发布):
34
34
 
35
35
  ```bash
36
36
  cd packages/local-tools
37
37
  npm pack
38
38
  # 在仓库外一个全新的目录:
39
- npm install /absolute/path/to/chat-loop-local-tools-0.4.0.tgz
39
+ npm install /absolute/path/to/tomflow-chatloop-tools-0.4.2.tgz
40
40
  ./node_modules/.bin/chat-loop-local doctor
41
41
  ./node_modules/.bin/chat-loop-local status
42
42
  ```
@@ -102,8 +102,8 @@ npm install /absolute/path/to/chat-loop-local-tools-0.4.0.tgz
102
102
 
103
103
  `chatloop-tools mcp` 是前台 stdio MCP Server(JSON-RPC 2.0,每行 JSON 报文)。由真实 MCP 客户端启动并连接,不是单行 CLI JSON 命令;stdout **仅允许协议响应**,诊断写 stderr。
104
104
 
105
- - 当前实测 `initialize` 使用 **`2025-03-26`**;代码也接受 `2024-11-05`。其他版本(包括 2026 版)目前会拒绝为 `UNSUPPORTED_MCP_VERSION`;**用户 Tunnel 的实际 SDK 兼容性待验收**。
106
- - `initialize` 后可发送 `notifications/initialized`,然后使用 `ping`、`tools/list`、`tools/call`。目前没有其他公开 MCP 方法。
105
+ - 当前已验证 `initialize` 接受 **`2025-11-25`**(ChatGPT Tunnel 实际握手)、`2025-06-18`、`2025-03-26` 和 `2024-11-05`;现代客户端的 `server/discover` 探测会返回 `METHOD_NOT_FOUND`,让客户端回退到兼容的 initialize 流程。尚未实现 2026 无状态 MCP 协议;真实 ChatGPT 工具调用须由端到端回执确认。
106
+ - `initialize` 后可发送 `notifications/initialized`,然后使用 `ping`、`tools/list`、`tools/call`。预初始化的 `server/discover` 返回 `METHOD_NOT_FOUND` 作为回退信号,不宣称实现现代无状态协议。
107
107
  - `tools/list` **总是列出已启用 Registry 的工具定义,即使工具未启动**;真实调用前仍必须在用户授权后执行 CLI `start desktop-commander`,否则 `TOOL_UNAVAILABLE`;MCP 不隐式启动、不重试。
108
108
  - `tools/list` 返回的 `result.tools[]` 有 `name`、`description`、`inputSchema`,它是**AI 调用工具时的实际参数合同**。固定快照 `lib/desktop-commander-tools.json` 随包发行,启动时校验子 MCP 返回 schema 与快照相符。不要凭工具名推测参数。
109
109
  - 命名规则:`<工具模块 ID 将 - 换成 _>__<原 MCP 工具名>`。例如 `desktop_commander__read_file`、`desktop_commander__start_process`、`desktop_commander__write_pdf`。
@@ -177,4 +177,4 @@ node --test packages/local-tools/test/gateway-integration.test.mjs
177
177
  cd packages/local-tools && npm pack --dry-run --json
178
178
  ```
179
179
 
180
- 源码测试与上面的仓库外 tarball 安装/调用,均**不证明真实 ChatGPT Tunnel E2E**。发布前仍需用户授权边界、MCP 协议兼容、完整安装引导、远端调用与依赖/许可审查(实际安装出现部分转移依赖的弃用警告)。npm 公开发布状态及当前版本请以 npm registry 中的 `@tomflow/chatloop-tools` 为准。
180
+ 源码测试与上面的仓库外 tarball 安装/调用,均**不证明真实 ChatGPT Tunnel E2E**。实际对外使用仍需核对真实 ChatGPT 远端调用与完整安装引导;跨平台、长任务取消和依赖维护可后续专项处理(实际安装出现部分转移依赖的弃用警告)。npm 公开发布状态及当前版本请以 npm registry 中的 `@tomflow/chatloop-tools` 为准。
package/bin/cli.mjs CHANGED
File without changes
@@ -80,7 +80,7 @@ export function createMcpChildAdapter({records,log}){
80
80
  const rec=setup(tool,child);
81
81
  try{
82
82
  const info=await request(rec,'initialize',{protocolVersion:'2025-03-26',
83
- capabilities:{},clientInfo:{name:'chat-loop-local-tools',version:'0.4.0'}},timeout(ctx));
83
+ capabilities:{},clientInfo:{name:'chat-loop-local-tools',version:'0.4.2'}},timeout(ctx));
84
84
  if(!info?.protocolVersion)throw Object.assign(Error('Handshake failed'),{code:'MCP_HANDSHAKE_FAILED'});
85
85
  child.stdin.write(JSON.stringify({jsonrpc:'2.0',method:'notifications/initialized'})+'\n');
86
86
  const listed=await request(rec,'tools/list',{},timeout(ctx));
package/lib/control.mjs CHANGED
@@ -4,7 +4,7 @@ import {homedir} from 'node:os';
4
4
  import {join} from 'node:path';
5
5
 
6
6
  export const CONTRACT = 'chat-loop.local-control.v1';
7
- export const VERSION = '0.4.0';
7
+ export const VERSION = '0.4.2';
8
8
  export const ACTIONS = new Set(['start','stop','restart','status']);
9
9
  export const directory = () => process.env.CHAT_LOOP_LOCAL_TOOLS_STATE_DIR || join(homedir(), '.chat-loop', 'local-tools');
10
10
  export const paths = () => ({dir: directory(), socket: join(directory(), 'control.sock'), lock: join(directory(), 'manager.lock'), log: join(directory(), 'events.jsonl')});
package/lib/gateway.mjs CHANGED
@@ -30,12 +30,15 @@ export function runGateway(){
30
30
  const processMessage=async m=>{
31
31
  if(!m||m.jsonrpc!=='2.0'||m.id===undefined)return;
32
32
  if(m.method==='initialize'){
33
- if(!['2025-03-26','2024-11-05'].includes(m.params?.protocolVersion))
33
+ if(!['2025-11-25','2025-06-18','2025-03-26','2024-11-05'].includes(m.params?.protocolVersion))
34
34
  return reject(m.id,-32602,'UNSUPPORTED_MCP_VERSION');
35
35
  connected=true;
36
36
  return reply(m.id,{protocolVersion:m.params.protocolVersion,
37
- capabilities:{tools:{}},serverInfo:{name:'chat-loop-local-tools',version:'0.4.0'}});
37
+ capabilities:{tools:{}},serverInfo:{name:'chat-loop-local-tools',version:'0.4.2'}});
38
38
  }
39
+ // A modern MCP client probes discovery before falling back to legacy initialize.
40
+ // We only implement the legacy handshake era, so report unsupported method.
41
+ if(m.method==='server/discover')return reject(m.id,-32601,'METHOD_NOT_FOUND');
39
42
  if(!connected)return reject(m.id,-32002,'NOT_INITIALIZED');
40
43
  if(m.method==='ping')return reply(m.id,{});
41
44
  if(m.method==='tools/list')return reply(m.id,{tools:published()});
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@tomflow/chatloop-tools",
3
3
  "publishConfig": { "access": "public" },
4
- "version": "0.4.0",
4
+ "version": "0.4.2",
5
5
  "type": "module",
6
6
  "description": "Chat Loop local tools: MCP gateway and unified tool lifecycle CLI",
7
- "bin": { "chatloop-tools": "./bin/cli.mjs", "chat-loop-local": "./bin/cli.mjs" },
7
+ "bin": { "chatloop-tools": "bin/cli.mjs", "chat-loop-local": "bin/cli.mjs" },
8
8
  "files": ["bin/", "lib/", "fixtures/", "README.md"],
9
9
  "scripts": {
10
10
  "doctor": "node ./bin/cli.mjs doctor",