@tomflow/chatloop-tools 0.4.2 → 0.4.3
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 +4 -4
- package/lib/adapters/mcp-child.mjs +1 -1
- package/lib/control.mjs +1 -1
- package/lib/gateway.mjs +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @tomflow/chatloop-tools — Chat Loop 工具包
|
|
2
2
|
|
|
3
|
-
**v0.4.
|
|
3
|
+
**v0.4.3 · 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.
|
|
33
|
+
**正式 npm 安装**:在包发布到 npm registry 后,运行 `npm install -g @tomflow/chatloop-tools@0.4.3`,随后执行 `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/tomflow-chatloop-tools-0.4.
|
|
39
|
+
npm install /absolute/path/to/tomflow-chatloop-tools-0.4.3.tgz
|
|
40
40
|
./node_modules/.bin/chat-loop-local doctor
|
|
41
41
|
./node_modules/.bin/chat-loop-local status
|
|
42
42
|
```
|
|
@@ -105,7 +105,7 @@ npm install /absolute/path/to/tomflow-chatloop-tools-0.4.2.tgz
|
|
|
105
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
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
|
-
- `tools/list` 返回的 `result.tools[]` 有 `name`、`description`、`inputSchema`,它是**AI 调用工具时的实际参数合同**。固定快照 `lib/desktop-commander-tools.json` 随包发行,启动时校验子 MCP 返回 schema
|
|
108
|
+
- `tools/list` 返回的 `result.tools[]` 有 `name`、`description`、`inputSchema`,它是**AI 调用工具时的实际参数合同**。固定快照 `lib/desktop-commander-tools.json` 随包发行,启动时校验子 MCP 返回 schema 与快照相符。由于本版 Gateway **只支持工具,不提供 `resources/read`**,对外列表会移除 Desktop Commander 声明的 UI `_meta` 资源引用,防止 ChatGPT 尝试读取不存在的界面;原始工具名与输入参数不变。不要凭工具名推测参数。
|
|
109
109
|
- 命名规则:`<工具模块 ID 将 - 换成 _>__<原 MCP 工具名>`。例如 `desktop_commander__read_file`、`desktop_commander__start_process`、`desktop_commander__write_pdf`。
|
|
110
110
|
|
|
111
111
|
**初始化请求**:
|
|
@@ -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.
|
|
83
|
+
capabilities:{},clientInfo:{name:'chat-loop-local-tools',version:'0.4.3'}},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.
|
|
7
|
+
export const VERSION = '0.4.3';
|
|
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
|
@@ -8,8 +8,10 @@ const fixtureTool={name:'ping',description:'Inert lifecycle test health check',
|
|
|
8
8
|
inputSchema:{type:'object',properties:{},additionalProperties:false}};
|
|
9
9
|
const toolsFor=t=>t.kind==='mcp-child'?desktopTools:t.kind==='fixture'?[fixtureTool]:[];
|
|
10
10
|
const prefix=id=>id.replaceAll('-','_')+'__';
|
|
11
|
+
// The pinned child's UI metadata advertises resources this tools-only Gateway does not serve.
|
|
12
|
+
// Do not expose those references until resources/read is explicitly supported.
|
|
11
13
|
const published=()=>registry().filter(t=>t.enabled).flatMap(t=>
|
|
12
|
-
toolsFor(t).map(x=>({...x,name:prefix(t.id)+x.name})));
|
|
14
|
+
toolsFor(t).map(({_meta,...x})=>({...x,name:prefix(t.id)+x.name})));
|
|
13
15
|
function resolveTool(name){
|
|
14
16
|
for(const t of registry().filter(x=>x.enabled)){
|
|
15
17
|
const p=prefix(t.id);
|
|
@@ -34,7 +36,7 @@ export function runGateway(){
|
|
|
34
36
|
return reject(m.id,-32602,'UNSUPPORTED_MCP_VERSION');
|
|
35
37
|
connected=true;
|
|
36
38
|
return reply(m.id,{protocolVersion:m.params.protocolVersion,
|
|
37
|
-
capabilities:{tools:{}},serverInfo:{name:'chat-loop-local-tools',version:'0.4.
|
|
39
|
+
capabilities:{tools:{}},serverInfo:{name:'chat-loop-local-tools',version:'0.4.3'}});
|
|
38
40
|
}
|
|
39
41
|
// A modern MCP client probes discovery before falling back to legacy initialize.
|
|
40
42
|
// We only implement the legacy handshake era, so report unsupported method.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomflow/chatloop-tools",
|
|
3
3
|
"publishConfig": { "access": "public" },
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Chat Loop local tools: MCP gateway and unified tool lifecycle CLI",
|
|
7
7
|
"bin": { "chatloop-tools": "bin/cli.mjs", "chat-loop-local": "bin/cli.mjs" },
|