@tomflow/chatloop-tools 0.4.15 → 0.4.17

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
@@ -21,6 +21,8 @@ Usage: chatloop-tools start [desktop-commander|tunnel]
21
21
  Start all enabled tools or one.
22
22
  ```
23
23
 
24
+ MCP `chat_loop_extension__start` 入参为 `{projectId, prompt, confirmed:true}`,可选 `replaceBlockedSessionId` 仅用于在双重核验旧 Session `BLOCKED` 且新 projectId 不同的情况下显式开启**新任务**;不提供 `force`,不重发旧任务。`status` 保持只读,未知回执不自动重试。
25
+
24
26
  Extension Actions 委托 `@tomflow/chatloop-extension` 公共 CLI,不复制浏览器操作。具体安全边界和协议见 [Local Tools 产品文档](../../docs/local-tools.md),实际部署与已验证状态见 [CURRENT](../../context/CURRENT.md)。
25
27
 
26
28
 
@@ -31,3 +33,5 @@ npx --yes --package=@tomflow/chatloop-tools@latest chatloop-tools upgrade
31
33
  ```
32
34
 
33
35
  升级先独立安装新版本、核实 Supervisor 所有权与运行状态,再通过原 Supervisor 停止旧版、将 Tunnel MCP 启动命令固定到新版本并启动;不在 Tunnel 正处理 MCP 调用时直接自我重启。若返回 `BLOCKED`,先核对原任务回执,不要盲重试。`start` 全量入口在正常用户安装环境检测到版本差异时复用此流程;带隔离状态目录的测试不触发升级。详情见 [Local Tools 主文档](../../docs/local-tools.md)。
36
+
37
+ **Start 长页面准备(0.4.17)**:私人 MCP `chat_loop_extension__start` 的 CLI 子调用等待窗口最多 330 秒,仅用于允许 Chrome 安全校验和 ChatGPT 编辑器自然就绪。超时仍返回不确定错误,不重新启动或重发,必须单独查询 Status。
@@ -19,7 +19,8 @@ export const extensionTools=[
19
19
  extensionTool('reload','Request reload of Chat Loop Extension; final health is unverified.',false),
20
20
  extensionTool('status','Read the unique current Mac Chrome Web Chat Owner; never starts or sends.',true),
21
21
  extensionTool('start','After confirmed intent and preflight, ask Extension to start one unique Web Chat; fails if any task owns it.',false,
22
- {projectId:{type:'string',minLength:1,maxLength:128},prompt:{type:'string',minLength:1,maxLength:4000},confirmed:{const:true}},
22
+ {projectId:{type:'string',minLength:1,maxLength:128},prompt:{type:'string',minLength:1,maxLength:4000},confirmed:{const:true},
23
+ replaceBlockedSessionId:{type:'string',pattern:'^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$'}},
23
24
  ['projectId','prompt','confirmed']),
24
25
  extensionTool('continue','Submit next-turn text with turnToken and nextPrompt; alternatively query its final status with turnToken and intentId. Only the Extension can send after Turn completion.',false,
25
26
  {turnToken:{type:'string'},nextPrompt:{type:'string',minLength:1,maxLength:4000},
@@ -61,10 +62,13 @@ export async function forwardExtensionAction(name,args={}) {
61
62
  invocation.args.push(String(args.tabId));
62
63
  }else if(!control && Object.keys(args).length)return fail('INVALID_ARGUMENT');
63
64
  if(name==='start'){
64
- if(Object.keys(args).some(k=>!['projectId','prompt','confirmed'].includes(k))
65
+ if(Object.keys(args).some(k=>!['projectId','prompt','confirmed','replaceBlockedSessionId'].includes(k))
65
66
  ||!(/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$/).test(args.projectId||'')
66
67
  ||typeof args.prompt!=='string'||!args.prompt.trim()||args.prompt.length>4000
67
- ||args.confirmed!==true)return fail('INVALID_ARGUMENT');
68
+ ||args.confirmed!==true
69
+ ||(args.replaceBlockedSessionId!==undefined
70
+ && !/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(args.replaceBlockedSessionId)))
71
+ return fail('INVALID_ARGUMENT');
68
72
  }
69
73
  if(control&&name!=='start'){
70
74
  const query=Object.hasOwn(args,'intentId')||args.lookup===true;
@@ -89,7 +93,7 @@ export async function forwardExtensionAction(name,args={}) {
89
93
  cwd:tmpdir(),windowsHide:true,env:process.env});
90
94
  let stdout='',finished=false;
91
95
  const settle=x=>{if(finished)return;finished=true;clearTimeout(timer);resolve(x);};
92
- const timer=setTimeout(()=>{child.kill('SIGTERM');settle(fail('RESULT_TIMEOUT'));},name==='start'?125000:90000);
96
+ const timer=setTimeout(()=>{child.kill('SIGTERM');settle(fail('RESULT_TIMEOUT'));},name==='start'?330000:90000);
93
97
  if(control)child.stdin.end(JSON.stringify(args));
94
98
  child.stdout.on('data',b=>{
95
99
  stdout+=b.toString();
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.4.15",
6
+ "version": "0.4.17",
7
7
  "type": "module",
8
8
  "description": "Chat Loop local tools: MCP gateway, isolated bundled tunnel-client and unified CLI",
9
9
  "bin": {