@narumitw/pi-goal 0.54.0 → 0.54.1
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-XHEFHXTF.js → chunk-UC6U2RFG.js} +8 -2
- package/dist/chunks/{chunk-XHEFHXTF.js.map → chunk-UC6U2RFG.js.map} +2 -2
- package/dist/chunks/{menu-4GLAABLR.js → menu-R2B7UE3T.js} +2 -2
- package/dist/index.ts +6 -3
- package/dist/index.ts.map +2 -2
- package/package.json +2 -2
- package/src/lifecycle.ts +5 -0
- package/src/runtime.ts +9 -1
- package/src/tools.ts +1 -1
- /package/dist/chunks/{menu-4GLAABLR.js.map → menu-R2B7UE3T.js.map} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
goalSummary,
|
|
5
5
|
parseTokenBudget
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UC6U2RFG.js";
|
|
7
7
|
import {
|
|
8
8
|
formatDuration,
|
|
9
9
|
formatTokenCount,
|
|
@@ -562,4 +562,4 @@ export {
|
|
|
562
562
|
safeGoalMenuText,
|
|
563
563
|
showGoalManager
|
|
564
564
|
};
|
|
565
|
-
//# sourceMappingURL=menu-
|
|
565
|
+
//# sourceMappingURL=menu-R2B7UE3T.js.map
|
package/dist/index.ts
CHANGED
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
stoppedStatusLabel,
|
|
44
44
|
transitionGoal,
|
|
45
45
|
validateObjective
|
|
46
|
-
} from "./chunks/chunk-
|
|
46
|
+
} from "./chunks/chunk-UC6U2RFG.js";
|
|
47
47
|
import {
|
|
48
48
|
DEFAULT_GOAL_SETTINGS,
|
|
49
49
|
currentTokenTotal,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
// src/command-registration.ts
|
|
64
64
|
function registerGoalCommand(pi, runtime, commands, options = {}) {
|
|
65
65
|
const loadGoalManager = cachedModuleLoader(
|
|
66
|
-
options.loadGoalManager ?? (() => import("./chunks/menu-
|
|
66
|
+
options.loadGoalManager ?? (() => import("./chunks/menu-R2B7UE3T.js"))
|
|
67
67
|
);
|
|
68
68
|
const loadGoalSettings = cachedModuleLoader(
|
|
69
69
|
options.loadGoalSettings ?? (() => import("./chunks/settings-ui-MVYTTBHW.js"))
|
|
@@ -946,6 +946,9 @@ function registerGoalLifecycle(pi, runtime, runController, options = {}) {
|
|
|
946
946
|
});
|
|
947
947
|
pi.on("turn_end", (event, ctx) => {
|
|
948
948
|
runtime.recordAutomaticTurn(ctx, event.message);
|
|
949
|
+
if (runtime.activeGoal?.status !== "active") {
|
|
950
|
+
runtime.ensureInactiveGoalContextContract(ctx);
|
|
951
|
+
}
|
|
949
952
|
});
|
|
950
953
|
pi.on("agent_end", (event, ctx) => {
|
|
951
954
|
const run = runtime.finishAgentRun();
|
|
@@ -1458,7 +1461,7 @@ function registerGoalTools(pi, runtime) {
|
|
|
1458
1461
|
runtime.recordGoalUsage(runtime.activeGoal, ctx);
|
|
1459
1462
|
runtime.persistGoal(runtime.activeGoal);
|
|
1460
1463
|
ctx.ui.setStatus(STATUS_KEY, formatStatus(runtime.activeGoal));
|
|
1461
|
-
runtime.
|
|
1464
|
+
runtime.clearCompletedGoal(ctx);
|
|
1462
1465
|
runtime.showCompletionStatus(ctx);
|
|
1463
1466
|
notifyTerminal(ctx.ui, `Goal complete: ${goal2}`, "info");
|
|
1464
1467
|
return {
|