@tomflow/chatloop-extension 0.4.36 → 0.4.37

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.
@@ -188,7 +188,8 @@ async function run(){
188
188
  // Versioned task-first original Chat Adopt. There is NO composer write,
189
189
  // send click, new Chat or V1 global Run in this path.
190
190
  prepared=await chrome.runtime.sendMessage({
191
- type:'CHAT_LOOP_TASK_START_PREPARE_V2',requestId:id});
191
+ type:'CHAT_LOOP_TASK_START_PREPARE_V2',requestId:id,
192
+ ...(proof.traceParent?{traceParent:proof.traceParent}:{})});
192
193
  if(prepared?.status!=='PREPARED'
193
194
  ||prepared.scope!=='TASK_SCOPED_ADOPT_NO_SEND'
194
195
  ||!Number.isSafeInteger(prepared.tabId)
@@ -196,7 +197,8 @@ async function run(){
196
197
  throw Error(prepared?.code||'SCOPED_START_PREPARE_UNVERIFIED');
197
198
  await observerReady(prepared.tabId);
198
199
  committed=await chrome.runtime.sendMessage({
199
- type:'CHAT_LOOP_TASK_START_COMMIT_V2',requestId:id});
200
+ type:'CHAT_LOOP_TASK_START_COMMIT_V2',requestId:id,
201
+ ...(proof.traceParent?{traceParent:proof.traceParent}:{})});
200
202
  if(committed?.status!=='OK'
201
203
  ||committed.scope!=='TASK_SCOPED_ADOPTED_NO_SEND'
202
204
  ||committed.sessionId!==prepared.sessionId
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Chat Loop Extension",
4
- "version": "0.4.36",
4
+ "version": "0.4.37",
5
5
  "description": "Chat Loop browser companion: Eye actions, Turn observer, Continue and Handoff Actions",
6
6
  "permissions": [
7
7
  "activeTab",
@@ -185,8 +185,8 @@ chrome.runtime.onMessage.addListener((message,sender,reply)=>{
185
185
  }catch{/* Reply telemetry cannot change the browser callback. */}
186
186
  }
187
187
  };
188
- // Only the known, exact status Action may offer an AOP parent. The
189
- // existing sessionPage/Owner gate still independently checks the request.
188
+ // An exact privileged Action page may offer a soft AOP parent. This
189
+ // never grants task authority; native proof and Owner gates remain separate.
190
190
  const sourceId=message?.requestId||message?.id;
191
191
  const actionSource=/^[a-f0-9]{32}$/.test(sourceId||'')&&(
192
192
  type==='CHAT_LOOP_SESSION_STATUS_V1'&&
@@ -196,7 +196,8 @@ chrome.runtime.onMessage.addListener((message,sender,reply)=>{
196
196
  sender?.url===chrome.runtime.getURL(message.action.toLowerCase()+'.html')+
197
197
  '?requestId='+sourceId||
198
198
  ['CHAT_LOOP_SESSION_START_PREPARE_V1','CHAT_LOOP_SESSION_START_TAKE_V1',
199
- 'CHAT_LOOP_SESSION_START_RESULT_V1'].includes(type)&&
199
+ 'CHAT_LOOP_SESSION_START_RESULT_V1','CHAT_LOOP_TASK_START_PREPARE_V2',
200
+ 'CHAT_LOOP_TASK_START_COMMIT_V2'].includes(type)&&
200
201
  sender?.url===chrome.runtime.getURL('start.html')+'?requestId='+sourceId);
201
202
  return workerApi.audit.observe('browser.dispatch.'+type,
202
203
  // Read dispatchSpan only when the AOP invokes its target: onBegin has
@@ -211,7 +211,11 @@ const onScopedBrowserMessage=(message,sender,reply)=>{
211
211
  void (async()=>{
212
212
  if(!scopedTaskRuns||!scopedTaskScheduler)
213
213
  throw Error('TASK_SCOPED_ROUTER_NOT_READY');
214
- if(!message||Object.keys(message).length!==2
214
+ // A signed Start Action may carry its existing traceParent for soft
215
+ // correlation; it is not a Task identity, permit or business input.
216
+ if(!message||(Object.keys(message).length!==2
217
+ &&(Object.keys(message).length!==3
218
+ ||!Object.hasOwn(message,'traceParent')))
215
219
  ||!/^[a-f0-9]{32}$/.test(message.requestId||''))
216
220
  throw Error('SCOPED_START_MESSAGE_INVALID');
217
221
  const source=await scopedStartIntent(message,sender);
@@ -85,6 +85,9 @@ function ensureMarker(){
85
85
  export function withOwnerKernelLock(kind,args){
86
86
  if(!['legacy-write','scoped-write','scoped-retire'].includes(kind)
87
87
  ||!Array.isArray(args))throw fail('OWNER_LOCK_REQUEST_INVALID');
88
+ const executable=stat(lockExec);
89
+ if(!executable?.isFile()||executable.isSymbolicLink())
90
+ throw fail('OWNER_LOCK_EXEC_MISSING');
88
91
  const file=ensureMarker();
89
92
  const result=spawnSync('/usr/bin/python3',
90
93
  ['-B',lockExec,file,process.execPath,helper],{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/chatloop-extension",
3
- "version": "0.4.36",
3
+ "version": "0.4.37",
4
4
  "type": "module",
5
5
  "description": "Chat Loop Extension: reviewed formal Action pages, including TEST_ONLY native App entry",
6
6
  "bin": {
@@ -20,6 +20,7 @@
20
20
  "extension/",
21
21
  "bin/",
22
22
  "lib/",
23
+ "lib/owner-lock-exec.py",
23
24
  "README.md"
24
25
  ],
25
26
  "scripts": {
@@ -116,6 +116,11 @@ async function main(){
116
116
  const pkg=JSON.parse(readFileSync(join(root,'package.json'),'utf8'));
117
117
  if(manifest.version!==pkg.version||manifest.manifest_version!==3)
118
118
  throw fail('EXTENSION_PACKAGE_VERSION_MISMATCH');
119
+ // The Darwin Native lock executor must survive npm pack. A missing helper
120
+ // makes every V1/V2 Owner CAS fail before any Context or Chrome binding.
121
+ if(!pkg.files?.includes('lib/owner-lock-exec.py')
122
+ ||!existsSync(join(root,'lib','owner-lock-exec.py')))
123
+ throw fail('OWNER_LOCK_EXEC_PACKAGE_MISSING');
119
124
  const targets=[[join(root,'actions.generated.mjs'),expected.node],
120
125
  [join(ext,'loop','action-catalog.generated.js'),expected.browser],
121
126
  ...Object.entries(expected.aliases).map(([page,html])=>[join(ext,page),html])];