@tomflow/chatloop-tools 0.9.62 → 0.9.63
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/lib/extension-proxy.mjs +14 -4
- package/node_modules/@tomflow/chatloop-context/package.json +2 -2
- package/node_modules/@tomflow/chatloop-extension/extension/manifest.json +1 -1
- package/node_modules/@tomflow/chatloop-extension/lib/bridge.mjs +1 -1
- package/node_modules/@tomflow/chatloop-extension/lib/browser-launch.mjs +8 -2
- package/node_modules/@tomflow/chatloop-extension/package.json +1 -1
- package/package.json +3 -3
package/lib/extension-proxy.mjs
CHANGED
|
@@ -18,12 +18,20 @@ export function configureExtensionProxy(ports){
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
// One official CLI provider and one public npm bin.
|
|
22
|
-
//
|
|
23
|
-
//
|
|
21
|
+
// One official CLI provider and one public npm bin. Ordinary actions resolve
|
|
22
|
+
// npm latest. The private Stage03 Session cancellation is pinned to the one
|
|
23
|
+
// Extension version declared by bundled Context, preventing old-latest CLI
|
|
24
|
+
// from silently missing that capability. Never duplicate the version here.
|
|
24
25
|
// Private environment variables cannot replace the official provider.
|
|
25
26
|
export {extensionTools};
|
|
26
27
|
const EXTENSION_PACKAGE='@tomflow/chatloop-extension@latest';
|
|
28
|
+
// One authoritative runtime pin, read from the already-bundled Context manifest.
|
|
29
|
+
// Never resolve a mutable Registry tag for the new private maintenance Action.
|
|
30
|
+
const sessionExtensionPin=JSON.parse(readFileSync(
|
|
31
|
+
new URL('../node_modules/@tomflow/chatloop-context/package.json',import.meta.url),'utf8')
|
|
32
|
+
).dependencies?.['@tomflow/chatloop-extension'];
|
|
33
|
+
if(typeof sessionExtensionPin!=='string'||!/^[0-9]+\.[0-9]+\.[0-9]+$/.test(sessionExtensionPin))
|
|
34
|
+
throw Object.assign(Error('Exact Extension pin unavailable'),{code:'EXTENSION_PIN_UNVERIFIED'});
|
|
27
35
|
const NPX_COMMAND=process.platform==='win32'?'npx.cmd':'npx';
|
|
28
36
|
const UUID=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
29
37
|
const CHAT_URL=/^https:\/\/chatgpt\.com\/(?:c\/[0-9a-f-]{12,}|g\/[^/]+\/c\/[0-9a-f-]{12,})$/i;
|
|
@@ -51,8 +59,10 @@ function childApiEnvironment(){
|
|
|
51
59
|
export const extensionInvocation=name=>{
|
|
52
60
|
const command=extensionCommand(name);
|
|
53
61
|
if(!command)return null;
|
|
62
|
+
const packageSpec=name==='session'
|
|
63
|
+
?'@tomflow/chatloop-extension@'+sessionExtensionPin:EXTENSION_PACKAGE;
|
|
54
64
|
return {executable:NPX_COMMAND,
|
|
55
|
-
args:['--yes','--package='+
|
|
65
|
+
args:['--yes','--package='+packageSpec,'chatloop-extension',...command]};
|
|
56
66
|
};
|
|
57
67
|
const fail=code=>({isError:true,content:[{type:'text',text:code}]});
|
|
58
68
|
// The mutable external CLI is not a file-read authority for the MCP Gateway.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomflow/chatloop-context",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Independent local Context SDK and short-lived CLI for Chat Loop projects",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"ps-list": "9.0.0",
|
|
37
|
-
"@tomflow/chatloop-extension": "0.4.
|
|
37
|
+
"@tomflow/chatloop-extension": "0.4.34",
|
|
38
38
|
"@tomflow/chatloop-trace": "0.4.6"
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -205,7 +205,7 @@ export function readRequest(id) {
|
|
|
205
205
|
const r=JSON.parse(readFileSync(p,'utf8'));
|
|
206
206
|
if(r.id!==id||!ACTIONS.includes(r.action)||Date.now()>r.expiresAt)
|
|
207
207
|
throw Object.assign(Error('Request expired or changed'),{code:'REQUEST_EXPIRED'});
|
|
208
|
-
if(['continue','handoff','clean','start','entry_test'].includes(r.action))validateIntent(r.action,r.intent);
|
|
208
|
+
if(['continue','handoff','clean','start','session','entry_test'].includes(r.action))validateIntent(r.action,r.intent);
|
|
209
209
|
if(r.traceParent!==undefined&&!validParent(r.traceParent))delete r.traceParent;
|
|
210
210
|
return r;
|
|
211
211
|
}
|
|
@@ -69,9 +69,15 @@ export function openExtensionActionPage(url,{platform=process.platform,spawn=spa
|
|
|
69
69
|
if(platform!=='darwin')
|
|
70
70
|
throw Object.assign(Error('Browser launcher not yet verified on this OS'),
|
|
71
71
|
{code:'BROWSER_LAUNCH_UNSUPPORTED'});
|
|
72
|
-
|
|
72
|
+
// The private session Action uses a fixed operation selector in addition to
|
|
73
|
+
// its request locator. No other Action may accept arbitrary URL arguments.
|
|
74
|
+
const ordinary=/^chrome-extension:\/\/[a-p]{32}\/(?!session\.html)[a-z_]+\.html\?requestId=[a-f0-9]{32}$/;
|
|
75
|
+
const cancel=/^chrome-extension:\/\/[a-p]{32}\/session\.html\?requestId=[a-f0-9]{32}&operation=cancel$/;
|
|
76
|
+
if(!ordinary.test(url)&&!cancel.test(url))
|
|
73
77
|
throw Object.assign(Error('Untrusted Extension Action URL'),{code:'INVALID_ACTION_URL'});
|
|
74
|
-
|
|
78
|
+
// An orphaned Owner may have no Chat tab at all. The existing verified
|
|
79
|
+
// extension-details window is the only supported fallback for that case.
|
|
80
|
+
const entry=url.match(/^chrome-extension:\/\/([a-p]{32})\/(?:entry_test|session)\.html\?requestId=[a-f0-9]{32}(?:&operation=cancel)?$/);
|
|
75
81
|
const launchArgs=entry
|
|
76
82
|
?['-e',OPEN_TEST_ENTRY_WINDOW,url,'chrome://extensions/?id='+entry[1]]
|
|
77
83
|
:['-e',OPEN_IN_CHAT_WINDOW,url];
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.9.
|
|
6
|
+
"version": "0.9.63",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"description": "Chat Loop local tools: MCP gateway, isolated bundled tunnel-client and unified CLI",
|
|
9
9
|
"bin": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"prepack": "node ./scripts/build-providers.mjs --check && node ./scripts/build-form-app.mjs --check && node ./scripts/build-document-app.mjs --check"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tomflow/chatloop-context": "0.6.
|
|
36
|
+
"@tomflow/chatloop-context": "0.6.26",
|
|
37
37
|
"@tomflow/chatloop-trace": "0.4.6",
|
|
38
38
|
"@wonderwhy-er/desktop-commander": "0.2.44",
|
|
39
39
|
"ps-list": "9.0.0",
|
|
40
|
-
"@tomflow/chatloop-extension": "0.4.
|
|
40
|
+
"@tomflow/chatloop-extension": "0.4.34"
|
|
41
41
|
},
|
|
42
42
|
"bundleDependencies": [
|
|
43
43
|
"@tomflow/chatloop-context",
|