@narumitw/pi-goal 0.54.8 → 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-7FMBWODN.ts → chunk-VPBPDJDM.ts} +5 -18
- package/dist/chunks/{chunk-7FMBWODN.ts.map → chunk-VPBPDJDM.ts.map} +2 -2
- package/dist/chunks/{menu-7W5HGHFO.ts → menu-UUQNRFAG.ts} +2 -2
- package/dist/index.ts +3 -2
- package/dist/index.ts.map +2 -2
- package/package.json +4 -4
- package/src/goal-contract.ts +3 -19
- package/src/lifecycle.ts +1 -0
- package/src/wait.ts +6 -0
- /package/dist/chunks/{menu-7W5HGHFO.ts.map → menu-UUQNRFAG.ts.map} +0 -0
|
@@ -178,6 +178,10 @@ var GoalWaitTimer = class {
|
|
|
178
178
|
this.timer = setTimeout(() => {
|
|
179
179
|
if (generation !== this.generation) return;
|
|
180
180
|
this.timer = void 0;
|
|
181
|
+
if (Date.now() < resumeAt) {
|
|
182
|
+
this.schedule(resumeAt, onDue);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
181
185
|
onDue();
|
|
182
186
|
}, delay);
|
|
183
187
|
}
|
|
@@ -354,10 +358,6 @@ function isGoalContextContract(message) {
|
|
|
354
358
|
}
|
|
355
359
|
function reconcileContract(messages, expected) {
|
|
356
360
|
if (latestGoalContractContent(messages) === expected.content) return messages;
|
|
357
|
-
const summaryBoundary = leadingSummaryBoundary(messages);
|
|
358
|
-
if (!hasGoalContextContractHistory(messages) && hasLeadingSummary(messages, summaryBoundary)) {
|
|
359
|
-
return [...messages.slice(0, summaryBoundary), expected, ...messages.slice(summaryBoundary)];
|
|
360
|
-
}
|
|
361
361
|
return [...messages, expected];
|
|
362
362
|
}
|
|
363
363
|
function latestGoalContractContent(messages) {
|
|
@@ -367,19 +367,6 @@ function latestGoalContractContent(messages) {
|
|
|
367
367
|
}
|
|
368
368
|
return void 0;
|
|
369
369
|
}
|
|
370
|
-
function leadingSummaryBoundary(messages) {
|
|
371
|
-
let index = unwrapMessage(messages[0]).role === "system" ? 1 : 0;
|
|
372
|
-
while (index < messages.length) {
|
|
373
|
-
const role = unwrapMessage(messages[index]).role;
|
|
374
|
-
if (role !== "compactionSummary" && role !== "branchSummary") break;
|
|
375
|
-
index += 1;
|
|
376
|
-
}
|
|
377
|
-
return index;
|
|
378
|
-
}
|
|
379
|
-
function hasLeadingSummary(messages, boundary) {
|
|
380
|
-
const summaryStart = unwrapMessage(messages[0]).role === "system" ? 1 : 0;
|
|
381
|
-
return boundary > summaryStart;
|
|
382
|
-
}
|
|
383
370
|
function unwrapMessage(message) {
|
|
384
371
|
const entry = message;
|
|
385
372
|
if (entry?.type === "custom_message") return entry;
|
|
@@ -1884,4 +1871,4 @@ export {
|
|
|
1884
1871
|
isContradictoryCompletionSummary,
|
|
1885
1872
|
goalIdRejectionReason
|
|
1886
1873
|
};
|
|
1887
|
-
//# sourceMappingURL=chunk-
|
|
1874
|
+
//# sourceMappingURL=chunk-VPBPDJDM.ts.map
|