@tomflow/chatloop-extension 0.3.83 → 0.3.84

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.
@@ -383,6 +383,20 @@ async function sessionStartPrepare(message,sender){
383
383
  if(matchingBlocked&&(!disk.session||disk.session.phase!=='BLOCKED'
384
384
  ||disk.session.sessionId!==replace||disk.session.projectId!==prior.projectId))
385
385
  return {status:'DENIED',code:'SESSION_REPLACEMENT_MISMATCH'};
386
+ // An abandoned Managed Context writer can outlive its Browser Owner.
387
+ // Replacing the Native session without first verifying its terminal fence
388
+ // would strand a live runRef (and an old write credential) in the Store.
389
+ // Never make that replacement based solely on BLOCKED or absent Owner.
390
+ if(matchingBlocked&&prior.contextManaged){
391
+ const terminal=await chrome.runtime.sendNativeMessage(SESSION_HOST,{
392
+ op:'context-control',command:'run.terminalStatus',args:{}}).catch(()=>null);
393
+ const state=terminal?.result;
394
+ if(terminal?.status!=='OK'||!state
395
+ ||state.projectId!==prior.projectId||state.taskId!==prior.taskId
396
+ ||state.runRef!==null||state.executionOutcome!=='DONE'
397
+ ||typeof state.deliveryRef!=='string'||!state.deliveryRef)
398
+ return {status:'DENIED',code:'CONTEXT_BLOCKED_RUN_UNFENCED'};
399
+ }
386
400
  if(disk.session&&disk.session.phase!=='DONE'&&!matchingBlocked)
387
401
  return {status:'DENIED',code:'SESSION_ALREADY_ACTIVE'};
388
402
  const capacity=await resources.admit(prior,{kind:intent.mode==='adopt'?'action':'chat'});
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Chat Loop Extension",
4
- "version": "0.3.83",
4
+ "version": "0.3.84",
5
5
  "description": "Chat Loop browser companion: Eye actions, Turn observer, Continue and Handoff Actions",
6
6
  "permissions": [
7
7
  "activeTab",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/chatloop-extension",
3
- "version": "0.3.83",
3
+ "version": "0.3.84",
4
4
  "type": "module",
5
5
  "description": "Chat Loop Extension package: nine formal Action pages and its own native CLI bridge",
6
6
  "bin": {