@tomflow/chatloop-extension 0.4.49 → 0.4.50

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.
@@ -36,6 +36,15 @@ if (message?.type === "CHAT_LOOP_APPROVAL_EVIDENCE_V1") {
36
36
  const oldLabel=lines[4].match(/^选项标签:\s*A[||]\s*确认(?:当前\s*)?([RP][1-9][0-9]*)\s*(需求|技术与验证方案|技术方案|方案)$/i);
37
37
  const modernLabel=lines[3]==='选项值: approve'
38
38
  &&/^选项标签:\s*A[||]\s*确认(需求|技术与验证方案|技术方案|方案)$/.exec(lines[4]);
39
+ // Actual six-line user Forms explicitly say R1 v1 or P1 v1.
40
+ // Bind BOTH document identity and physical version, never prose.
41
+ const physicalLabel=lines[4].match(
42
+ /^选项标签:\s*A[||]\s*确认(?:当前\s*)?([RP][1-9][0-9]*)\s*V([1-9][0-9]*)\s*(需求|技术与验证方案|技术方案|方案|技术方案与验证交付计划)$/i);
43
+ const physicalIndex=Number(physicalLabel?.[2]||0);
44
+ const explicitPhysical=physicalLabel
45
+ &&physicalLabel[1][0].toUpperCase()===type
46
+ &&(Number(physicalLabel[1].slice(1))===1
47
+ ||Number(physicalLabel[1].slice(1))===physicalIndex);
39
48
  // The visible "P2 final revision" is a semantic review cycle.
40
49
  // The stored document can be P1 V3 after a cancelled V2; only the
41
50
  // explicit physical V3 may become the trusted approval version P3.
@@ -49,13 +58,17 @@ if (message?.type === "CHAT_LOOP_APPROVAL_EVIDENCE_V1") {
49
58
  const versions=[...formId.matchAll(/(?:^|[-_])([rp][1-9][0-9]*)(?=[-_]|$)/gi)]
50
59
  .map(m=>m[1].toUpperCase());
51
60
  const version=oldLabel?.[1]?.toUpperCase()
61
+ ||(explicitPhysical?type+String(physicalIndex):null)
52
62
  ||(revised?type+String(physical):null)
53
63
  ||(modernLabel&&versions.length===1?versions[0]:null);
54
64
  const label=oldLabel?.[2]
55
- ||(revised?(type==='R'?'需求':'方案'):modernLabel?.[1]);
65
+ ||(explicitPhysical?physicalLabel[3]
66
+ :revised?(type==='R'?'需求':'方案'):modernLabel?.[1]);
56
67
  if(!version||version[0]!==type||!label
57
68
  ||(type==='R')!==(label==='需求')
58
69
  ||(oldLabel&&versions.some(v=>v!==version))
70
+ ||explicitPhysical&&versions.some(v=>v!==physicalLabel[1].toUpperCase()
71
+ &&v!==version)
59
72
  ||revised&&versions.some(v=>v!==type+'1'&&v!==version
60
73
  &&v!==revisionLabel[3].toUpperCase())
61
74
  ||formId===traceRef)return null;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Chat Loop Extension",
4
- "version": "0.4.49",
4
+ "version": "0.4.50",
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.49",
3
+ "version": "0.4.50",
4
4
  "type": "module",
5
5
  "description": "Chat Loop Extension: reviewed formal Action pages, including TEST_ONLY native App entry",
6
6
  "bin": {