@narumitw/pi-goal 0.54.9 → 0.54.10
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/dist/chunks/{chunk-HO5HL4CI.ts → chunk-VPBPDJDM.ts} +1 -18
- package/dist/chunks/{chunk-HO5HL4CI.ts.map → chunk-VPBPDJDM.ts.map} +2 -2
- package/dist/chunks/{menu-HLJAYYVI.ts → menu-UUQNRFAG.ts} +2 -2
- package/dist/index.ts +3 -2
- package/dist/index.ts.map +2 -2
- package/package.json +1 -1
- package/src/goal-contract.ts +3 -19
- package/src/lifecycle.ts +1 -0
- /package/dist/chunks/{menu-HLJAYYVI.ts.map → menu-UUQNRFAG.ts.map} +0 -0
|
@@ -358,10 +358,6 @@ function isGoalContextContract(message) {
|
|
|
358
358
|
}
|
|
359
359
|
function reconcileContract(messages, expected) {
|
|
360
360
|
if (latestGoalContractContent(messages) === expected.content) return messages;
|
|
361
|
-
const summaryBoundary = leadingSummaryBoundary(messages);
|
|
362
|
-
if (!hasGoalContextContractHistory(messages) && hasLeadingSummary(messages, summaryBoundary)) {
|
|
363
|
-
return [...messages.slice(0, summaryBoundary), expected, ...messages.slice(summaryBoundary)];
|
|
364
|
-
}
|
|
365
361
|
return [...messages, expected];
|
|
366
362
|
}
|
|
367
363
|
function latestGoalContractContent(messages) {
|
|
@@ -371,19 +367,6 @@ function latestGoalContractContent(messages) {
|
|
|
371
367
|
}
|
|
372
368
|
return void 0;
|
|
373
369
|
}
|
|
374
|
-
function leadingSummaryBoundary(messages) {
|
|
375
|
-
let index = unwrapMessage(messages[0]).role === "system" ? 1 : 0;
|
|
376
|
-
while (index < messages.length) {
|
|
377
|
-
const role = unwrapMessage(messages[index]).role;
|
|
378
|
-
if (role !== "compactionSummary" && role !== "branchSummary") break;
|
|
379
|
-
index += 1;
|
|
380
|
-
}
|
|
381
|
-
return index;
|
|
382
|
-
}
|
|
383
|
-
function hasLeadingSummary(messages, boundary) {
|
|
384
|
-
const summaryStart = unwrapMessage(messages[0]).role === "system" ? 1 : 0;
|
|
385
|
-
return boundary > summaryStart;
|
|
386
|
-
}
|
|
387
370
|
function unwrapMessage(message) {
|
|
388
371
|
const entry = message;
|
|
389
372
|
if (entry?.type === "custom_message") return entry;
|
|
@@ -1888,4 +1871,4 @@ export {
|
|
|
1888
1871
|
isContradictoryCompletionSummary,
|
|
1889
1872
|
goalIdRejectionReason
|
|
1890
1873
|
};
|
|
1891
|
-
//# sourceMappingURL=chunk-
|
|
1874
|
+
//# sourceMappingURL=chunk-VPBPDJDM.ts.map
|