@tomflow/chatloop-context 0.6.41 → 0.6.43
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.
|
@@ -57,7 +57,8 @@ export const capability={
|
|
|
57
57
|
"userTurn": {
|
|
58
58
|
"type": "string",
|
|
59
59
|
"minLength": 8,
|
|
60
|
-
"maxLength": 256
|
|
60
|
+
"maxLength": 256,
|
|
61
|
+
"description": "For a Form A without platform user message ID, store its exact real identifiers: user-turn:UNAVAILABLE; form:<actual formId>; trace:<actual traceRef>; approve. Reject generic current-chat placeholders; never invent user approval."
|
|
61
62
|
},
|
|
62
63
|
"presentedAssistantRef": {
|
|
63
64
|
"type": "string",
|
package/lib/approval-policy.mjs
CHANGED
|
@@ -41,7 +41,9 @@ const formReceipt=(text,kind,stored)=>{
|
|
|
41
41
|
||lines[5]!==FORM_NOTE)return null;
|
|
42
42
|
const id=lines[1].match(/^formId:\s*([a-z0-9][a-z0-9_-]{7,127})$/i);
|
|
43
43
|
const trace=lines[2].match(new RegExp('^traceRef:\\s*('+FORM_UUID+')$','i'));
|
|
44
|
-
|
|
44
|
+
// Some real R/P Forms label the version as “确认 P1 方案”, others as
|
|
45
|
+
// “确认当前 P1 方案”. Both carry an explicit, checkable document version.
|
|
46
|
+
const oldChoice=lines[4].match(/^选项标签:\s*A[||]\s*确认(?:当前\s*)?([RP][1-9][0-9]*)\s*(需求|技术与验证方案|技术方案|方案)$/i);
|
|
45
47
|
const modernChoice=lines[3]==='选项值: approve'
|
|
46
48
|
&&lines[4].match(/^选项标签:\s*A[||]\s*确认(需求|技术与验证方案|技术方案|方案)$/);
|
|
47
49
|
if(!id||!trace||!oldChoice&&!modernChoice)return null;
|
|
@@ -1553,7 +1553,8 @@
|
|
|
1553
1553
|
"userTurn": {
|
|
1554
1554
|
"type": "string",
|
|
1555
1555
|
"minLength": 8,
|
|
1556
|
-
"maxLength": 256
|
|
1556
|
+
"maxLength": 256,
|
|
1557
|
+
"description": "For a Form A without platform user message ID, store its exact real identifiers: user-turn:UNAVAILABLE; form:<actual formId>; trace:<actual traceRef>; approve. Reject generic current-chat placeholders; never invent user approval."
|
|
1557
1558
|
},
|
|
1558
1559
|
"presentedAssistantRef": {
|
|
1559
1560
|
"type": "string",
|
package/lib/core/review.mjs
CHANGED
|
@@ -134,6 +134,11 @@ export function createReviewMethods(values) {
|
|
|
134
134
|
.get(a.projectId,a.taskId,issue.document_id,issue.version);
|
|
135
135
|
assert(doc&&doc.content_hash===issue.content_hash,'DOCUMENT_CHANGED');
|
|
136
136
|
assert(['R','P'].includes(doc.kind),'ISSUE_DOCUMENT_KIND_INVALID');
|
|
137
|
+
if(a.decision==='APPROVE'&&a.userTurn.startsWith('user-turn:UNAVAILABLE')){
|
|
138
|
+
const source=a.userTurn.match(/^user-turn:UNAVAILABLE; form:([a-z0-9][a-z0-9_-]{7,127}); trace:([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}); approve$/i);
|
|
139
|
+
assert(source&&source[1].toLowerCase()!==source[2].toLowerCase(),
|
|
140
|
+
'APPROVAL_FORM_SOURCE_REF_REQUIRED');
|
|
141
|
+
}
|
|
137
142
|
if(a.decision!=='APPROVE'){
|
|
138
143
|
// The legacy CUSTOM decision has the same meaning as a change request.
|
|
139
144
|
const issueStatus=a.decision==='REJECT'?'REJECTED':'CHANGE_REQUESTED';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomflow/chatloop-context",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.43",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Independent local Context SDK and short-lived CLI for Chat Loop projects",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"ps-list": "9.0.0",
|
|
35
|
-
"@tomflow/chatloop-extension": "0.4.
|
|
35
|
+
"@tomflow/chatloop-extension": "0.4.45",
|
|
36
36
|
"@tomflow/chatloop-trace": "0.4.6"
|
|
37
37
|
}
|
|
38
38
|
}
|