@tomflow/chatloop-extension 0.4.33 → 0.4.34

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Chat Loop Extension",
4
- "version": "0.4.33",
4
+ "version": "0.4.34",
5
5
  "description": "Chat Loop browser companion: Eye actions, Turn observer, Continue and Handoff Actions",
6
6
  "permissions": [
7
7
  "activeTab",
package/lib/bridge.mjs CHANGED
@@ -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
- if(!/^chrome-extension:\/\/[a-p]{32}\/[a-z_]+\.html\?requestId=[a-f0-9]{32}$/.test(url))
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
- const entry=url.match(/^chrome-extension:\/\/([a-p]{32})\/entry_test\.html\?requestId=[a-f0-9]{32}$/);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/chatloop-extension",
3
- "version": "0.4.33",
3
+ "version": "0.4.34",
4
4
  "type": "module",
5
5
  "description": "Chat Loop Extension: reviewed formal Action pages, including TEST_ONLY native App entry",
6
6
  "bin": {