@tomflow/chatloop-extension 0.4.23 → 0.4.24

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.
@@ -96,7 +96,18 @@ if (message?.type === "CHAT_LOOP_APPROVAL_EVIDENCE_V1") {
96
96
  return versions.length===1?versions[0]:null;
97
97
  };
98
98
  const lastUser=rows.findLastIndex(x=>x.role==="user");
99
- if(lastUser<3 || rows[lastUser-1].role!=="assistant") {
99
+ // ChatGPT can virtualize the initial R issuing assistant while keeping
100
+ // both original Form A user Turns and the issued P assistant mounted.
101
+ // Only an explicitly named current Chat plus the exact Form template
102
+ // may use this bounded partial-DOM proof. A Context Start lease must
103
+ // still independently authorize the R/P approvals and current Task.
104
+ const currentChatId=path.match(/\/c\/([0-9a-f-]{12,})$/i)?.[1].toLowerCase();
105
+ const explicitFormChat=typeof message.explicitChatId==='string'
106
+ &&message.explicitChatId.toLowerCase()===currentChatId;
107
+ const virtualizedR=lastUser===2&&explicitFormChat
108
+ &&rows[0]?.role==='user'&&!!formApprovalVersion(textOf(rows[0]),'R')
109
+ &&rows[1]?.role==='assistant'&&rows[2]?.role==='user';
110
+ if((lastUser<3&&!virtualizedR)||rows[lastUser-1]?.role!=="assistant") {
100
111
  fail("APPROVAL_SEQUENCE_UNVERIFIED");return false;
101
112
  }
102
113
  const pUser=rows[lastUser],pAssistant=rows[lastUser-1];
@@ -137,6 +148,7 @@ if (message?.type === "CHAT_LOOP_APPROVAL_EVIDENCE_V1") {
137
148
  ?nativeR[1].toUpperCase():null;
138
149
  const rAssistant=rIndex>0?rows[rIndex-1]:null;
139
150
  if(rIndex<0 || rIndex===0&&!nativeRVersion
151
+ &&!(virtualizedR&&rForm)
140
152
  ||rIndex>0&&rAssistant?.role!=="assistant"){
141
153
  fail("APPROVAL_REQUIREMENTS_MISSING");return false;
142
154
  }
@@ -169,7 +181,8 @@ if (message?.type === "CHAT_LOOP_APPROVAL_EVIDENCE_V1") {
169
181
  || !/\bR[1-9][0-9]*\b/i.test(textOf(rAssistant)))) {
170
182
  fail("APPROVAL_REQUIREMENTS_MISSING");return false;
171
183
  }
172
- const rVersion=rAssistant?versionOf(textOf(rAssistant),"R"):nativeRVersion;
184
+ const rVersion=rAssistant?versionOf(textOf(rAssistant),"R")
185
+ :nativeRVersion||virtualizedR&&rForm?.version;
173
186
  // A stage-02 plan can generate an immutable Rn synchronization SNAPSHOT
174
187
  // after its P approval. It is not a new R approval: Context retains the
175
188
  // original R/P approvals and exact P.requirementRef. Only a precisely
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Chat Loop Extension",
4
- "version": "0.4.23",
4
+ "version": "0.4.24",
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.4.23",
3
+ "version": "0.4.24",
4
4
  "type": "module",
5
5
  "description": "Chat Loop Extension: reviewed formal Action pages, including TEST_ONLY native App entry",
6
6
  "bin": {