@tomflow/chatloop-extension 0.4.26 → 0.4.27
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 +1 -1
- package/extension/manifest.json +1 -1
- package/extension/worker/bootstrap.js +3 -0
- package/extension/worker/readiness.js +2 -1
- package/lib/bridge.mjs +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ Run: chatloop-extension extension <command> --help
|
|
|
78
78
|
|
|
79
79
|
For the installed command list, run `chatloop-extension extension --help`.
|
|
80
80
|
|
|
81
|
-
`extension start` requires the real approved intent; `mode=adopt` does not
|
|
81
|
+
`extension start` requires the real approved intent; `mode=adopt` requires an exact Context `start.reserve` lease, taskId, store epoch and revisions at the public CLI input boundary, with actual approval/lease validity independently checked by Native `permit.consume`. A browser-only R/P text pattern and `confirmed:true` cannot authorize a production Adopt; the prompt-based legacy Start has separate rules. `mode=adopt` does not
|
|
82
82
|
re-send. Continue/Handoff only register intents with one Turn token and never
|
|
83
83
|
silently send or repeat. Clean needs an exact verified tab ID, and Status
|
|
84
84
|
is read-only. A previously BLOCKED Session with a lost old Owner tab remains
|
package/extension/manifest.json
CHANGED
|
@@ -145,6 +145,9 @@ const SESSION_POINTER_KEYS=Object.freeze(['sessionId','projectId','taskId','phas
|
|
|
145
145
|
'generation','activeChatId','activeChatUrl']);
|
|
146
146
|
const matchesNativeProjection=(projected,native)=>Boolean(native
|
|
147
147
|
&&SESSION_POINTER_KEYS.every(key=>projected[key]===native[key]));
|
|
148
|
+
// Read-only status diagnosis: reveal field NAMES only, never Owner identities.
|
|
149
|
+
const sessionProjectionDrift=(projected,native)=>SESSION_POINTER_KEYS.filter(
|
|
150
|
+
key=>projected[key]!==native?.[key]);
|
|
148
151
|
const sessionPage=(sender,name,id)=> Number.isInteger(sender.tab?.id)
|
|
149
152
|
&& typeof id==='string'&&/^[a-f0-9]{32}$/.test(id)
|
|
150
153
|
&& sender.url===chrome.runtime.getURL(name+'.html')+'?requestId='+id;
|
|
@@ -155,7 +155,8 @@ async function sessionStatus(message,sender){
|
|
|
155
155
|
if(disk?.status!=='OK')return {status:'UNVERIFIED',code:'SESSION_STATE_UNVERIFIED'};
|
|
156
156
|
const projection=run?.sessionId?sessionProjection(run):null;
|
|
157
157
|
if(projection&&!matchesNativeProjection(projection,disk.session))
|
|
158
|
-
return {status:'UNVERIFIED',code:'SESSION_FILE_MISMATCH'
|
|
158
|
+
return {status:'UNVERIFIED',code:'SESSION_FILE_MISMATCH',
|
|
159
|
+
mismatchedFields:sessionProjectionDrift(projection,disk.session)};
|
|
159
160
|
if(!run?.sessionId&&disk.session&&disk.session.phase!=='DONE')
|
|
160
161
|
return {status:'UNVERIFIED',code:'SESSION_OWNER_MISMATCH'};
|
|
161
162
|
if(run&&run.phase!=='DONE'&&!run.sessionId)
|
package/lib/bridge.mjs
CHANGED
|
@@ -85,6 +85,8 @@ function validateIntent(action, intent) {
|
|
|
85
85
|
||typeof intent.contextStoreEpoch!=='string'||intent.contextStoreEpoch.length<10
|
|
86
86
|
||!Number.isSafeInteger(intent.contextTaskRevision)||intent.contextTaskRevision<1
|
|
87
87
|
||!Number.isSafeInteger(intent.contextApprovalRevision)||intent.contextApprovalRevision<1))
|
|
88
|
+
// Public Extension CLI must not bypass the managed Context Start lease.
|
|
89
|
+
||(intent.mode==='adopt'&&!Object.hasOwn(intent,'contextLeaseRef'))
|
|
88
90
|
||intent.confirmed!==true || (intent.mode!==undefined && intent.mode!=='adopt')
|
|
89
91
|
|| (intent.replaceBlockedSessionId!==undefined
|
|
90
92
|
&& !/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(intent.replaceBlockedSessionId))
|