@narumitw/pi-goal 0.55.1 → 0.55.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-goal",
3
- "version": "0.55.1",
3
+ "version": "0.55.3",
4
4
  "description": "Pi extension for autonomous single-objective /goal completion.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/accounting.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Usage } from "@earendil-works/pi-ai";
2
+ import type { ExtensionContext, SessionEntry } from "@earendil-works/pi-coding-agent";
2
3
 
3
4
  export interface GoalAccountingState {
4
5
  status: string;
@@ -96,7 +97,51 @@ export function cumulativeAssistantTokens(entries: unknown[]) {
96
97
  return total;
97
98
  }
98
99
 
100
+ function entryAssistantTokens(entry: SessionEntry): number {
101
+ return entry.type === "message" && entry.message?.role === "assistant"
102
+ ? assistantUsageTokens(entry.message.usage)
103
+ : 0;
104
+ }
105
+
106
+ type UsageSessionManager = Partial<Pick<ExtensionContext["sessionManager"], "getBranch" | "getLeafId" | "getEntry">>;
107
+
108
+ // Pi entries are append-only: retain just the last leaf and its cumulative total.
109
+ // Object identity detects reloads with reused IDs; divergent branches recount.
110
+ // Weak manager keys release checkpoints when their sessions are discarded.
111
+ const tokenTotals = new WeakMap<UsageSessionManager, { entry: SessionEntry; total: number }>();
112
+
99
113
  export function currentTokenTotal(ctx: UsageContext): number {
100
- const sessionManager = ctx.sessionManager as { getBranch?: () => unknown[] } | undefined;
101
- return cumulativeAssistantTokens(sessionManager?.getBranch?.() ?? []);
114
+ const sessionManager = ctx.sessionManager as UsageSessionManager | undefined;
115
+ if (typeof sessionManager?.getLeafId !== "function" || typeof sessionManager.getEntry !== "function") {
116
+ // Compatibility with branch-only contexts; never cache their mutable arrays.
117
+ return cumulativeAssistantTokens(sessionManager?.getBranch?.() ?? []);
118
+ }
119
+
120
+ const id = sessionManager.getLeafId();
121
+ const leaf = id ? sessionManager.getEntry(id) : undefined;
122
+ if (!leaf) {
123
+ tokenTotals.delete(sessionManager);
124
+ return 0;
125
+ }
126
+ const checkpoint = tokenTotals.get(sessionManager);
127
+ if (leaf === checkpoint?.entry) return checkpoint.total;
128
+
129
+ const pending: SessionEntry[] = [];
130
+ let total = 0;
131
+ let entry: SessionEntry | undefined = leaf;
132
+ while (entry) {
133
+ if (entry === checkpoint?.entry) {
134
+ total = checkpoint.total;
135
+ break;
136
+ }
137
+ pending.push(entry);
138
+ entry = entry.parentId ? sessionManager.getEntry(entry.parentId) : undefined;
139
+ }
140
+
141
+ // Sum root-to-leaf to preserve full-recount rounding and saturation semantics.
142
+ for (let index = pending.length - 1; index >= 0; index--) {
143
+ total = Math.min(Number.MAX_SAFE_INTEGER, total + entryAssistantTokens(pending[index]));
144
+ }
145
+ tokenTotals.set(sessionManager, { entry: leaf, total });
146
+ return total;
102
147
  }
package/src/runtime.ts CHANGED
@@ -1626,7 +1626,7 @@ export function formatStatus(
1626
1626
  const automatic =
1627
1627
  automaticTurnLimit === null ? "automatic Unlimited" : `automatic ${goal.automaticModelTurns}/${automaticTurnLimit}`;
1628
1628
  if (goal.waiting) {
1629
- return `waiting ${safeGoalMenuText(goal.waiting.reason)} · ${automatic}`;
1629
+ return "waiting";
1630
1630
  }
1631
1631
  if (goal.status === "paused" && goal.safetyPauseCause === "continuation_limit") {
1632
1632
  if (automaticTurnLimit === null) {
package/src/tools.ts CHANGED
@@ -29,6 +29,7 @@ import {
29
29
  MIN_GOAL_WAIT_DELAY_MS,
30
30
  resolveGoalWaitDelay,
31
31
  } from "./wait.js";
32
+ import { renderGoalWaitCall, renderGoalWaitResult } from "./wait-renderer.js";
32
33
 
33
34
  interface GoalCompleteDetails {
34
35
  goal: string;
@@ -260,6 +261,8 @@ export function registerGoalTools(pi: ExtensionAPI, runtime: GoalRuntime) {
260
261
  const goalWaitTool = defineTool({
261
262
  name: GOAL_WAIT_TOOL,
262
263
  label: "Goal Wait",
264
+ renderCall: renderGoalWaitCall,
265
+ renderResult: renderGoalWaitResult,
263
266
  description: `Keep an active /goal quiet only when the latest effective Goal contract explicitly says Goal mode is active, supplies the matching current goal_id, and progress depends on an arranged external wake event or one safety deadline. Tool visibility alone does not activate Goal mode. Call goal_wait alone. Requests below ${MIN_GOAL_WAIT_DELAY_MS}ms are clamped to ${MIN_GOAL_WAIT_DELAY_MS}ms. Never call for ordinary unfinished work.`,
264
267
  parameters: Type.Object({
265
268
  goal_id: Type.String({
@@ -0,0 +1,106 @@
1
+ import type { Theme, ToolRenderers, ToolRenderResultOptions } from "@earendil-works/pi-coding-agent";
2
+ import { type Component, truncateToWidth } from "@earendil-works/pi-tui";
3
+ import { hardWrapTerminalDocument, sanitizeTerminalDocument } from "@narumitw/pi-tui-kit/terminal-document";
4
+
5
+ interface WaitRenderResult {
6
+ content: Array<{ type: string; text?: string }>;
7
+ details?: unknown;
8
+ }
9
+
10
+ interface WaitRenderDetails {
11
+ reason: string;
12
+ goal_id: string;
13
+ goal?: string;
14
+ resume_at?: number;
15
+ requested_resume_after_ms?: number;
16
+ resume_after_ms?: number;
17
+ }
18
+
19
+ type WaitRenderContext = Partial<
20
+ Pick<Parameters<NonNullable<ToolRenderers["renderResult"]>>[3], "keyText" | "keyHint" | "isError">
21
+ >;
22
+
23
+ export function renderGoalWaitCall(_args: unknown, theme: Theme): Component {
24
+ return {
25
+ render: (width) =>
26
+ Number.isFinite(width) && width >= 1
27
+ ? [truncateToWidth(theme.fg("toolTitle", theme.bold("Goal Wait")), Math.floor(width), "…")]
28
+ : [],
29
+ invalidate() {},
30
+ };
31
+ }
32
+
33
+ export function renderGoalWaitResult(
34
+ result: WaitRenderResult,
35
+ { expanded, isPartial }: ToolRenderResultOptions,
36
+ theme: Theme,
37
+ context: WaitRenderContext = {},
38
+ ): Component {
39
+ const textBlocks = result.content.filter((block) => block.type === "text" && typeof block.text === "string");
40
+ const text = textBlocks
41
+ .map((block) => block.text)
42
+ .join("\n")
43
+ .trim();
44
+ // Rejected calls also have wait details. Only a finalized accepted result can use them.
45
+ const details =
46
+ !isPartial && !context.isError && textBlocks.length === 1 && text.startsWith("Goal waiting:")
47
+ ? readWaitDetails(result.details)
48
+ : undefined;
49
+
50
+ return {
51
+ render(width) {
52
+ if (!Number.isFinite(width) || width < 1) return [];
53
+ const safeWidth = Math.floor(width);
54
+ const body = hardWrapTerminalDocument(details?.reason ?? text, safeWidth);
55
+ const clipped = !expanded && body.length > 2;
56
+ const shown = clipped ? body.slice(0, 2) : body;
57
+ if (clipped) shown[1] = `${truncateToWidth(shown[1] ?? "", safeWidth - 1, "")}…`;
58
+ const role = context.isError || text.startsWith("goal_wait rejected:") ? "warning" : "toolOutput";
59
+ const lines = shown.map((line) => theme.fg(role, line));
60
+ const secondary = (value: string) => {
61
+ lines.push(...hardWrapTerminalDocument(value, safeWidth).map((line) => theme.fg("muted", line)));
62
+ };
63
+
64
+ if (details) {
65
+ if (expanded) {
66
+ if (details.goal) secondary(`Goal: ${details.goal}`);
67
+ secondary(`Goal ID: ${details.goal_id}`);
68
+ }
69
+ if (details.resume_at !== undefined) secondary(`Safety wake: ${new Date(details.resume_at).toISOString()}`);
70
+ secondary("Resume: external input or /goal resume");
71
+ if (expanded && details.requested_resume_after_ms !== undefined) {
72
+ secondary(`Requested delay: ${details.requested_resume_after_ms} ms`);
73
+ if (details.resume_after_ms !== undefined) secondary(`Effective delay: ${details.resume_after_ms} ms`);
74
+ }
75
+ }
76
+
77
+ if (!expanded && (details || clipped) && context.keyText?.("app.tools.expand") && context.keyHint) {
78
+ secondary(context.keyHint("app.tools.expand", "to expand"));
79
+ }
80
+ return lines;
81
+ },
82
+ // Theme roles are evaluated on every render; there is no themed cache to clear.
83
+ invalidate() {},
84
+ };
85
+ }
86
+
87
+ function readWaitDetails(value: unknown): WaitRenderDetails | undefined {
88
+ if (!value || typeof value !== "object") return undefined;
89
+ const details = value as WaitRenderDetails;
90
+ if (typeof details.reason !== "string" || !details.reason.trim()) return undefined;
91
+ if (typeof details.goal_id !== "string" || !details.goal_id.trim()) return undefined;
92
+ if (details.goal !== undefined && typeof details.goal !== "string") return undefined;
93
+ if (
94
+ details.resume_at !== undefined &&
95
+ (!Number.isSafeInteger(details.resume_at) || details.resume_at < 0 || details.resume_at > 8_640_000_000_000_000)
96
+ ) {
97
+ return undefined;
98
+ }
99
+ for (const delay of [details.requested_resume_after_ms, details.resume_after_ms]) {
100
+ if (delay !== undefined && (!Number.isSafeInteger(delay) || delay < 1)) return undefined;
101
+ }
102
+ return {
103
+ ...details,
104
+ reason: sanitizeTerminalDocument(details.reason),
105
+ };
106
+ }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/accounting.ts", "../../src/errors.ts", "../../src/settings.ts"],
4
- "sourcesContent": ["import type { Usage } from \"@earendil-works/pi-ai\";\n\nexport interface GoalAccountingState {\n status: string;\n baselineTokens: number;\n tokensUsed: number;\n timeUsedSeconds: number;\n activeStartedAt?: number;\n updatedAt: number;\n}\n\ninterface AssistantUsageEntryLike {\n type?: unknown;\n message?: unknown;\n}\n\ninterface UsageContext {\n sessionManager?: unknown;\n}\n\nexport function checkpointGoalActiveTime(goal: GoalAccountingState, now: number, continueClock: boolean) {\n const accumulated = nonNegativeFiniteNumber(goal.timeUsedSeconds);\n const startedAt = goal.activeStartedAt;\n if (typeof startedAt === \"number\" && Number.isFinite(startedAt)) {\n goal.timeUsedSeconds = accumulated + Math.max(0, now - startedAt) / 1000;\n } else {\n goal.timeUsedSeconds = accumulated;\n }\n goal.activeStartedAt = continueClock ? now : undefined;\n}\n\nexport function updateGoalUsage(\n goal: GoalAccountingState,\n ctx: UsageContext,\n continueClock = goal.status === \"active\",\n) {\n const now = Date.now();\n const baselineTokens = nonNegativeFiniteNumber(goal.baselineTokens);\n goal.baselineTokens = baselineTokens;\n goal.tokensUsed = Math.max(0, currentTokenTotal(ctx) - baselineTokens);\n checkpointGoalActiveTime(goal, now, continueClock);\n goal.updatedAt = now;\n}\n\nexport function formatDuration(seconds: number) {\n const wholeSeconds = Math.max(0, Math.floor(nonNegativeFiniteNumber(seconds)));\n if (wholeSeconds < 60) return `${wholeSeconds}s`;\n const minutes = Math.floor(wholeSeconds / 60);\n if (minutes < 60) return `${minutes}m`;\n const hours = Math.floor(minutes / 60);\n return `${hours}h${minutes % 60}m`;\n}\n\nexport function formatTokenCount(value: number) {\n if (value < 1_000) return `${value}`;\n if (value < 1_000_000) {\n return `${Number.isInteger(value / 1_000) ? value / 1_000 : (value / 1_000).toFixed(1)}k`;\n }\n return `${Number.isInteger(value / 1_000_000) ? value / 1_000_000 : (value / 1_000_000).toFixed(1)}m`;\n}\n\nexport function isNonNegativeFiniteNumber(value: unknown): value is number {\n return typeof value === \"number\" && Number.isFinite(value) && value >= 0;\n}\n\nexport function nonNegativeFiniteNumber(value: unknown) {\n return isNonNegativeFiniteNumber(value) ? value : 0;\n}\n\nexport function normalizeTokenBudget(value: unknown) {\n return typeof value === \"number\" && Number.isSafeInteger(value) && value > 0 ? value : undefined;\n}\n\nexport function assistantUsageTokens(value: unknown) {\n if (!value || typeof value !== \"object\") return 0;\n const usage = value as Partial<Usage>;\n if (isNonNegativeFiniteNumber(usage.totalTokens)) return usage.totalTokens;\n return Math.min(\n Number.MAX_SAFE_INTEGER,\n nonNegativeFiniteNumber(usage.input) +\n nonNegativeFiniteNumber(usage.output) +\n nonNegativeFiniteNumber(usage.cacheRead) +\n nonNegativeFiniteNumber(usage.cacheWrite),\n );\n}\n\nexport function cumulativeAssistantTokens(entries: unknown[]) {\n let total = 0;\n for (const entry of entries) {\n const candidate = entry as AssistantUsageEntryLike;\n if (candidate?.type !== \"message\") continue;\n const message = candidate.message as { role?: unknown; usage?: unknown } | undefined;\n if (message?.role !== \"assistant\") continue;\n total = Math.min(Number.MAX_SAFE_INTEGER, total + assistantUsageTokens(message.usage));\n }\n return total;\n}\n\nexport function currentTokenTotal(ctx: UsageContext): number {\n const sessionManager = ctx.sessionManager as { getBranch?: () => unknown[] } | undefined;\n return cumulativeAssistantTokens(sessionManager?.getBranch?.() ?? []);\n}\n", "import {\n isContextOverflow,\n isRetryableAssistantError,\n type AssistantMessage as PiAssistantMessage,\n type Usage,\n} from \"@earendil-works/pi-ai\";\nimport { stripTerminalSequences } from \"@earendil-works/pi-tui\";\nimport { assistantUsageTokens, nonNegativeFiniteNumber } from \"./accounting.js\";\n\nexport type AgentStopReason = \"stop\" | \"length\" | \"toolUse\" | \"error\" | \"aborted\";\n\nexport interface AssistantMessageLike {\n role: \"assistant\";\n stopReason?: AgentStopReason;\n errorMessage?: string;\n content?: PiAssistantMessage[\"content\"];\n api?: PiAssistantMessage[\"api\"];\n provider?: PiAssistantMessage[\"provider\"];\n model?: string;\n usage?: Usage;\n timestamp?: number;\n}\n\nconst USAGE_LIMIT_GOAL_ERROR_PATTERNS = [\n /usage[_\\s-]*(?:limit|cap)|chatgpt.{0,32}usage/i,\n /quota.{0,32}(?:reached|exceeded|exhausted|depleted)|(?:reached|exceeded|exhausted|depleted).{0,32}quota/i,\n /insufficient[_\\s-]*(?:quota|credits?)|out of credits|out of budget|available balance|payment required/i,\n /(?:credit|balance).{0,32}(?:low|exhausted|depleted)|billing/i,\n] as const;\n\nexport function safeTerminalText(value: string) {\n return [...stripTerminalSequences(value)]\n .map((character) => {\n const codePoint = character.codePointAt(0) ?? 0;\n if (character === \"\\n\") return character;\n return codePoint <= 0x1f || (codePoint >= 0x7f && codePoint <= 0x9f) ? \" \" : character;\n })\n .join(\"\")\n .trim();\n}\n\nexport function safeGoalMenuText(value: string, maxCharacters = 120) {\n const sanitized = safeTerminalText(value).replace(/\\s+/gu, \" \").trim();\n const characters = [...sanitized];\n return characters.length <= maxCharacters ? sanitized : `${characters.slice(0, maxCharacters).join(\"\")}\u2026`;\n}\n\nexport function notifyTerminal(\n ui: { notify: (message: string, level?: \"info\" | \"warning\" | \"error\") => void },\n message: string,\n level?: \"info\" | \"warning\" | \"error\",\n) {\n ui.notify(safeTerminalText(message), level);\n}\n\n/**\n * True when an error came from an ExtensionContext invalidated by session\n * replacement or reload. Pi throws this from every ctx getter and pi method on\n * the stale runner, so deferred callbacks must treat it as cancellation.\n */\nexport function isStaleContextError(error: unknown): boolean {\n return (\n error instanceof Error && error.message.includes(\"This extension ctx is stale after session replacement or reload\")\n );\n}\n\nexport function formatError(error: unknown) {\n return truncateNotification(error instanceof Error ? error.message : String(error));\n}\n\nexport function truncateNotification(value: string) {\n const safe = [...safeTerminalText(value)];\n return safe.length > 160 ? `${safe.slice(0, 157).join(\"\")}...` : safe.join(\"\");\n}\n\nexport function isUsageLimitedGoalInterruption(assistant: AssistantMessageLike) {\n const errorMessage = assistant.errorMessage;\n return (\n assistant.stopReason === \"error\" &&\n typeof errorMessage === \"string\" &&\n USAGE_LIMIT_GOAL_ERROR_PATTERNS.some((pattern) => pattern.test(errorMessage))\n );\n}\n\nexport function isRetryableGoalInterruption(assistant: AssistantMessageLike) {\n if (assistant.stopReason !== \"error\" || !assistant.errorMessage) return false;\n // Pi owns eligibility and execution; Goal only tracks the recovery boundary.\n return isGoalContextOverflow(assistant) || isRetryableAssistantError(toPiAssistantMessage(assistant));\n}\n\nexport function isGoalContextOverflow(assistant: AssistantMessageLike) {\n return isContextOverflow(toPiAssistantMessage(assistant));\n}\n\nexport function findFinalAssistantMessage(messages: unknown[]): AssistantMessageLike | undefined {\n for (let index = messages.length - 1; index >= 0; index--) {\n const message = messages[index];\n if (!message || typeof message !== \"object\") continue;\n const candidate = message as Record<string, unknown>;\n if (candidate.role !== \"assistant\") continue;\n const assistant: AssistantMessageLike = {\n role: \"assistant\",\n stopReason: isAgentStopReason(candidate.stopReason) ? candidate.stopReason : undefined,\n errorMessage: typeof candidate.errorMessage === \"string\" ? candidate.errorMessage : undefined,\n };\n if (Array.isArray(candidate.content)) {\n assistant.content = candidate.content as PiAssistantMessage[\"content\"];\n }\n if (typeof candidate.api === \"string\") assistant.api = candidate.api;\n if (typeof candidate.provider === \"string\") assistant.provider = candidate.provider;\n if (typeof candidate.model === \"string\") assistant.model = candidate.model;\n if (typeof candidate.timestamp === \"number\") assistant.timestamp = candidate.timestamp;\n const usage = normalizeUsage(candidate.usage);\n if (usage) assistant.usage = usage;\n return assistant;\n }\n return undefined;\n}\n\nfunction toPiAssistantMessage(assistant: AssistantMessageLike): PiAssistantMessage {\n return {\n role: \"assistant\",\n content: assistant.content ?? [],\n api: assistant.api ?? \"openai-responses\",\n provider: assistant.provider ?? \"unknown\",\n model: assistant.model ?? \"unknown\",\n usage: assistant.usage ?? zeroUsage(),\n stopReason: assistant.stopReason ?? \"error\",\n errorMessage: assistant.errorMessage,\n timestamp: assistant.timestamp ?? Date.now(),\n };\n}\n\nfunction zeroUsage(): Usage {\n return {\n input: 0,\n output: 0,\n cacheRead: 0,\n cacheWrite: 0,\n totalTokens: 0,\n cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n };\n}\n\nfunction isAgentStopReason(value: unknown): value is AgentStopReason {\n return [\"stop\", \"length\", \"toolUse\", \"error\", \"aborted\"].includes(String(value));\n}\n\nfunction normalizeUsage(value: unknown): Usage | undefined {\n if (!value || typeof value !== \"object\") return undefined;\n const usage = value as Partial<Usage>;\n if (typeof usage.input !== \"number\" || typeof usage.output !== \"number\") return undefined;\n return {\n input: nonNegativeFiniteNumber(usage.input),\n output: nonNegativeFiniteNumber(usage.output),\n cacheRead: nonNegativeFiniteNumber(usage.cacheRead),\n cacheWrite: nonNegativeFiniteNumber(usage.cacheWrite),\n totalTokens: assistantUsageTokens(usage),\n cost: {\n input: usage.cost?.input ?? 0,\n output: usage.cost?.output ?? 0,\n cacheRead: usage.cost?.cacheRead ?? 0,\n cacheWrite: usage.cost?.cacheWrite ?? 0,\n total: usage.cost?.total ?? 0,\n },\n };\n}\n", "import { randomUUID } from \"node:crypto\";\nimport { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from \"node:fs\";\nimport { basename, dirname, join } from \"node:path\";\nimport { getAgentDir } from \"@earendil-works/pi-coding-agent\";\n\nexport const GOAL_SETTINGS_FILE = \"pi-goal.json\";\n\nexport type ContinuationLimit = number | null;\n\nexport interface GoalSettings {\n retryUsageLimits: boolean;\n rpc: {\n enabled: boolean;\n };\n continuationLimits: {\n automaticTurns: ContinuationLimit;\n noProgressTurns: ContinuationLimit;\n };\n}\n\nexport const DEFAULT_GOAL_SETTINGS: GoalSettings = {\n retryUsageLimits: false,\n rpc: { enabled: false },\n continuationLimits: { automaticTurns: 25, noProgressTurns: 3 },\n};\n\nexport type GoalSettingsLoadResult =\n | { kind: \"missing\"; legacyExperimentalGoals: false }\n | { kind: \"invalid\"; reason: string }\n | { kind: \"loaded\"; settings: GoalSettings; legacyExperimentalGoals: boolean };\n\nexport type GoalSettingsLoadIssue = Extract<GoalSettingsLoadResult, { kind: \"invalid\" }>;\n\ninterface GoalSettingsSaveFileSystem {\n mkdirSync: typeof mkdirSync;\n writeFileSync: typeof writeFileSync;\n renameSync: typeof renameSync;\n rmSync: typeof rmSync;\n}\n\nexport function normalizeGoalSettings(value: unknown): GoalSettings | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n\n const retryUsageLimits = Object.hasOwn(value, \"retryUsageLimits\")\n ? Reflect.get(value, \"retryUsageLimits\")\n : DEFAULT_GOAL_SETTINGS.retryUsageLimits;\n if (typeof retryUsageLimits !== \"boolean\") return undefined;\n\n const rpcValue = Object.hasOwn(value, \"rpc\") ? Reflect.get(value, \"rpc\") : undefined;\n if (rpcValue !== undefined && (typeof rpcValue !== \"object\" || rpcValue === null || Array.isArray(rpcValue))) {\n return undefined;\n }\n const rpcEnabled =\n rpcValue && Object.hasOwn(rpcValue, \"enabled\")\n ? Reflect.get(rpcValue, \"enabled\")\n : DEFAULT_GOAL_SETTINGS.rpc.enabled;\n if (typeof rpcEnabled !== \"boolean\") return undefined;\n\n const continuationLimitsValue = Object.hasOwn(value, \"continuationLimits\")\n ? Reflect.get(value, \"continuationLimits\")\n : undefined;\n if (\n continuationLimitsValue !== undefined &&\n (typeof continuationLimitsValue !== \"object\" ||\n continuationLimitsValue === null ||\n Array.isArray(continuationLimitsValue))\n ) {\n return undefined;\n }\n const automaticTurns = continuationLimitsValue\n ? normalizeContinuationLimit(\n Reflect.get(continuationLimitsValue, \"automaticTurns\"),\n DEFAULT_GOAL_SETTINGS.continuationLimits.automaticTurns,\n )\n : DEFAULT_GOAL_SETTINGS.continuationLimits.automaticTurns;\n const noProgressTurns = continuationLimitsValue\n ? normalizeContinuationLimit(\n Reflect.get(continuationLimitsValue, \"noProgressTurns\"),\n DEFAULT_GOAL_SETTINGS.continuationLimits.noProgressTurns,\n )\n : DEFAULT_GOAL_SETTINGS.continuationLimits.noProgressTurns;\n if (automaticTurns === undefined || noProgressTurns === undefined) return undefined;\n\n return {\n retryUsageLimits,\n rpc: { enabled: rpcEnabled },\n continuationLimits: { automaticTurns, noProgressTurns },\n };\n}\n\nfunction normalizeContinuationLimit(value: unknown, fallback: ContinuationLimit): ContinuationLimit | undefined {\n if (value === undefined) return fallback;\n if (value === null) return null;\n return typeof value === \"number\" && Number.isSafeInteger(value) && value > 0 ? value : undefined;\n}\n\nexport function saveGoalSettings(\n settings: GoalSettings,\n settingsPath = join(getAgentDir(), GOAL_SETTINGS_FILE),\n overrides: Partial<GoalSettingsSaveFileSystem> = {},\n) {\n const normalized = normalizeGoalSettings(settings);\n if (!normalized) throw new Error(\"Refusing to save invalid pi-goal settings.\");\n\n let raw: Record<string, unknown> = {};\n try {\n const contents = readFileSync(settingsPath, \"utf8\");\n const parsed = JSON.parse(contents) as unknown;\n if (!normalizeGoalSettings(parsed)) {\n throw new Error(`${settingsPath}: invalid settings shape`);\n }\n raw = ownRecord(parsed) ?? {};\n } catch (error) {\n if (!isNodeError(error) || error.code !== \"ENOENT\") {\n throw new Error(`Cannot save invalid settings file: ${formatError(error)}`);\n }\n }\n\n const rpc = ownRecord(raw.rpc) ?? {};\n const continuationLimits = ownRecord(raw.continuationLimits) ?? {};\n const document = `${JSON.stringify(\n {\n ...raw,\n retryUsageLimits: normalized.retryUsageLimits,\n rpc: { ...rpc, enabled: normalized.rpc.enabled },\n continuationLimits: {\n ...continuationLimits,\n automaticTurns: normalized.continuationLimits.automaticTurns,\n noProgressTurns: normalized.continuationLimits.noProgressTurns,\n },\n },\n null,\n 2,\n )}\\n`;\n const fs = { mkdirSync, writeFileSync, renameSync, rmSync, ...overrides };\n const temporaryPath = join(dirname(settingsPath), `.${basename(settingsPath)}.${randomUUID()}.tmp`);\n try {\n fs.mkdirSync(dirname(settingsPath), { recursive: true });\n fs.writeFileSync(temporaryPath, document, { encoding: \"utf8\", flag: \"wx\" });\n fs.renameSync(temporaryPath, settingsPath);\n } finally {\n try {\n fs.rmSync(temporaryPath, { force: true });\n } catch {\n // Best-effort cleanup must not replace the save result.\n }\n }\n}\n\nexport function readGoalSettings(settingsPath = join(getAgentDir(), GOAL_SETTINGS_FILE)): GoalSettingsLoadResult {\n let contents: string;\n try {\n contents = readFileSync(settingsPath, \"utf8\");\n } catch (error: unknown) {\n if (isNodeError(error) && error.code === \"ENOENT\") {\n return { kind: \"missing\", legacyExperimentalGoals: false };\n }\n return { kind: \"invalid\", reason: `${settingsPath}: ${formatError(error)}` };\n }\n\n try {\n const parsed = JSON.parse(contents) as unknown;\n const settings = normalizeGoalSettings(parsed);\n return settings\n ? { kind: \"loaded\", settings, legacyExperimentalGoals: hasLegacyExperimentalGoals(parsed) }\n : { kind: \"invalid\", reason: `${settingsPath}: invalid settings shape` };\n } catch (error: unknown) {\n return { kind: \"invalid\", reason: `${settingsPath}: ${formatError(error)}` };\n }\n}\n\nfunction hasLegacyExperimentalGoals(value: unknown) {\n const experimental = ownRecord(ownRecord(value)?.experimental);\n return experimental?.goals === true;\n}\n\nfunction ownRecord(value: unknown): Record<string, unknown> | undefined {\n return value && typeof value === \"object\" && !Array.isArray(value) ? (value as Record<string, unknown>) : undefined;\n}\n\nfunction isNodeError(error: unknown): error is NodeJS.ErrnoException {\n return error instanceof Error && \"code\" in error;\n}\n\nfunction formatError(error: unknown) {\n return error instanceof Error ? error.message : String(error);\n}\n"],
5
- "mappings": ";;;;AAoBO,SAAS,yBAAyB,MAA2B,KAAa,eAAwB;AACvG,QAAM,cAAc,wBAAwB,KAAK,eAAe;AAChE,QAAM,YAAY,KAAK;AACvB,MAAI,OAAO,cAAc,YAAY,OAAO,SAAS,SAAS,GAAG;AAC/D,SAAK,kBAAkB,cAAc,KAAK,IAAI,GAAG,MAAM,SAAS,IAAI;AAAA,EACtE,OAAO;AACL,SAAK,kBAAkB;AAAA,EACzB;AACA,OAAK,kBAAkB,gBAAgB,MAAM;AAC/C;AAEO,SAAS,gBACd,MACA,KACA,gBAAgB,KAAK,WAAW,UAChC;AACA,QAAM,MAAM,KAAK,IAAI;AACrB,QAAM,iBAAiB,wBAAwB,KAAK,cAAc;AAClE,OAAK,iBAAiB;AACtB,OAAK,aAAa,KAAK,IAAI,GAAG,kBAAkB,GAAG,IAAI,cAAc;AACrE,2BAAyB,MAAM,KAAK,aAAa;AACjD,OAAK,YAAY;AACnB;AAEO,SAAS,eAAe,SAAiB;AAC9C,QAAM,eAAe,KAAK,IAAI,GAAG,KAAK,MAAM,wBAAwB,OAAO,CAAC,CAAC;AAC7E,MAAI,eAAe,GAAI,QAAO,GAAG,YAAY;AAC7C,QAAM,UAAU,KAAK,MAAM,eAAe,EAAE;AAC5C,MAAI,UAAU,GAAI,QAAO,GAAG,OAAO;AACnC,QAAM,QAAQ,KAAK,MAAM,UAAU,EAAE;AACrC,SAAO,GAAG,KAAK,IAAI,UAAU,EAAE;AACjC;AAEO,SAAS,iBAAiB,OAAe;AAC9C,MAAI,QAAQ,IAAO,QAAO,GAAG,KAAK;AAClC,MAAI,QAAQ,KAAW;AACrB,WAAO,GAAG,OAAO,UAAU,QAAQ,GAAK,IAAI,QAAQ,OAAS,QAAQ,KAAO,QAAQ,CAAC,CAAC;AAAA,EACxF;AACA,SAAO,GAAG,OAAO,UAAU,QAAQ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