@oh-my-pi/pi-coding-agent 17.0.7 → 17.0.9
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/CHANGELOG.md +91 -0
- package/dist/cli.js +5025 -4930
- package/dist/types/config/__tests__/model-registry.test.d.ts +1 -0
- package/dist/types/config/model-registry.d.ts +28 -1
- package/dist/types/config/model-resolver.d.ts +5 -1
- package/dist/types/config/settings-schema.d.ts +50 -3
- package/dist/types/dap/client.d.ts +19 -0
- package/dist/types/extensibility/extensions/runner.d.ts +4 -2
- package/dist/types/extensibility/extensions/types.d.ts +3 -0
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +1 -0
- package/dist/types/extensibility/legacy-pi-tui-shim.d.ts +10 -0
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +1 -1
- package/dist/types/extensibility/typebox.d.ts +4 -0
- package/dist/types/hindsight/client.d.ts +10 -0
- package/dist/types/hindsight/config.d.ts +8 -0
- package/dist/types/internal-urls/registry-helpers.d.ts +11 -0
- package/dist/types/lsp/client.d.ts +2 -0
- package/dist/types/mcp/manager.d.ts +6 -2
- package/dist/types/mcp/render.d.ts +2 -2
- package/dist/types/mcp/tool-bridge.d.ts +16 -3
- package/dist/types/mcp/types.d.ts +6 -0
- package/dist/types/mnemopi/state.d.ts +2 -0
- package/dist/types/modes/components/oauth-selector.d.ts +8 -0
- package/dist/types/modes/components/settings-defs.d.ts +1 -0
- package/dist/types/modes/components/user-message.d.ts +25 -1
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +8 -0
- package/dist/types/modes/controllers/mcp-command-controller.d.ts +3 -0
- package/dist/types/modes/interactive-mode.d.ts +7 -1
- package/dist/types/modes/rpc/rpc-client.d.ts +10 -1
- package/dist/types/modes/rpc/rpc-frame.d.ts +16 -0
- package/dist/types/modes/rpc/rpc-messages.d.ts +26 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +40 -0
- package/dist/types/modes/setup-wizard/scenes/sign-in.d.ts +1 -1
- package/dist/types/modes/setup-wizard/scenes/types.d.ts +9 -1
- package/dist/types/modes/setup-wizard/scenes/web-search.d.ts +1 -1
- package/dist/types/modes/types.d.ts +14 -1
- package/dist/types/modes/utils/ui-helpers.d.ts +12 -8
- package/dist/types/sdk.d.ts +1 -0
- package/dist/types/session/agent-session-error-log.test.d.ts +1 -0
- package/dist/types/session/agent-session.d.ts +86 -3
- package/dist/types/session/session-loader.d.ts +6 -4
- package/dist/types/task/executor.d.ts +10 -0
- package/dist/types/task/index.d.ts +1 -0
- package/dist/types/task/prewalk.d.ts +3 -0
- package/dist/types/task/types.d.ts +14 -0
- package/dist/types/tools/ask.d.ts +10 -0
- package/dist/types/tools/hub/jobs.d.ts +1 -1
- package/dist/types/tools/index.d.ts +3 -0
- package/dist/types/tools/report-tool-issue.d.ts +24 -9
- package/dist/types/tools/tool-timeouts.d.ts +8 -2
- package/dist/types/utils/changelog.d.ts +4 -6
- package/dist/types/web/search/providers/firecrawl.d.ts +9 -0
- package/dist/types/web/search/types.d.ts +1 -1
- package/package.json +13 -13
- package/scripts/legacy-pi-virtual-module.ts +1 -1
- package/src/cli/grievances-cli.ts +2 -2
- package/src/cli/models-cli.ts +37 -17
- package/src/cli/update-cli.ts +14 -1
- package/src/cli/usage-cli.ts +1 -1
- package/src/config/__tests__/model-registry.test.ts +147 -0
- package/src/config/model-registry.ts +87 -24
- package/src/config/model-resolver.ts +56 -32
- package/src/config/settings-schema.ts +46 -3
- package/src/config/settings.ts +68 -5
- package/src/dap/client.ts +86 -7
- package/src/edit/diff.ts +4 -4
- package/src/eval/py/prelude.py +5 -5
- package/src/export/html/template.js +23 -9
- package/src/extensibility/extensions/runner.ts +9 -4
- package/src/extensibility/extensions/types.ts +3 -0
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +1 -0
- package/src/extensibility/legacy-pi-tui-shim.ts +10 -0
- package/src/extensibility/plugins/legacy-pi-compat.ts +851 -310
- package/src/extensibility/typebox.ts +22 -9
- package/src/hindsight/client.test.ts +42 -0
- package/src/hindsight/client.ts +40 -3
- package/src/hindsight/config.ts +18 -0
- package/src/internal-urls/registry-helpers.ts +40 -0
- package/src/launch/broker.ts +31 -5
- package/src/lsp/client.ts +23 -0
- package/src/lsp/clients/biome-client.ts +3 -4
- package/src/lsp/index.ts +26 -8
- package/src/main.ts +16 -5
- package/src/mcp/manager.ts +39 -8
- package/src/mcp/render.ts +94 -35
- package/src/mcp/tool-bridge.ts +116 -11
- package/src/mcp/types.ts +7 -0
- package/src/mnemopi/state.ts +70 -3
- package/src/modes/components/agent-dashboard.ts +6 -2
- package/src/modes/components/agent-hub.ts +26 -9
- package/src/modes/components/chat-transcript-builder.ts +13 -2
- package/src/modes/components/diff.ts +2 -2
- package/src/modes/components/oauth-selector.ts +24 -7
- package/src/modes/components/plan-review-overlay.ts +20 -4
- package/src/modes/components/settings-defs.ts +5 -2
- package/src/modes/components/settings-selector.ts +9 -5
- package/src/modes/components/tool-execution.test.ts +63 -2
- package/src/modes/components/user-message.ts +100 -1
- package/src/modes/controllers/command-controller.ts +36 -12
- package/src/modes/controllers/event-controller.ts +4 -1
- package/src/modes/controllers/extension-ui-controller.ts +18 -0
- package/src/modes/controllers/input-controller.ts +47 -12
- package/src/modes/controllers/mcp-command-controller.ts +70 -40
- package/src/modes/controllers/selector-controller.ts +82 -6
- package/src/modes/interactive-mode.ts +39 -4
- package/src/modes/rpc/rpc-client.ts +94 -3
- package/src/modes/rpc/rpc-frame.ts +164 -4
- package/src/modes/rpc/rpc-messages.ts +127 -0
- package/src/modes/rpc/rpc-mode.ts +79 -7
- package/src/modes/rpc/rpc-types.ts +34 -2
- package/src/modes/setup-wizard/scenes/model.ts +5 -7
- package/src/modes/setup-wizard/scenes/providers.ts +3 -2
- package/src/modes/setup-wizard/scenes/sign-in.ts +8 -2
- package/src/modes/setup-wizard/scenes/theme.ts +13 -3
- package/src/modes/setup-wizard/scenes/types.ts +9 -1
- package/src/modes/setup-wizard/scenes/web-search.ts +6 -1
- package/src/modes/setup-wizard/wizard-overlay.ts +1 -1
- package/src/modes/types.ts +16 -3
- package/src/modes/utils/ui-helpers.ts +40 -20
- package/src/prompts/goals/guided-goal-system.md +24 -3
- package/src/prompts/system/workflow-notice.md +1 -1
- package/src/prompts/tools/task.md +12 -2
- package/src/sdk.ts +179 -51
- package/src/session/agent-session-error-log.test.ts +59 -0
- package/src/session/agent-session.ts +351 -46
- package/src/session/session-context.test.ts +224 -1
- package/src/session/session-context.ts +41 -2
- package/src/session/session-loader.ts +10 -5
- package/src/slash-commands/helpers/usage-report.ts +3 -1
- package/src/system-prompt.ts +1 -2
- package/src/task/executor.ts +44 -27
- package/src/task/index.ts +63 -8
- package/src/task/prewalk.ts +6 -0
- package/src/task/structured-subagent.ts +3 -1
- package/src/task/types.ts +16 -0
- package/src/task/worktree.ts +25 -11
- package/src/tools/ask.ts +15 -0
- package/src/tools/bash.ts +14 -6
- package/src/tools/browser.ts +1 -1
- package/src/tools/debug.ts +1 -1
- package/src/tools/eval.ts +4 -5
- package/src/tools/fetch.ts +1 -1
- package/src/tools/hub/index.ts +1 -1
- package/src/tools/hub/jobs.ts +67 -8
- package/src/tools/hub/launch.ts +7 -0
- package/src/tools/index.ts +3 -0
- package/src/tools/report-tool-issue.ts +79 -28
- package/src/tools/tool-timeouts.ts +10 -3
- package/src/tools/write.ts +31 -0
- package/src/utils/changelog.ts +54 -58
- package/src/utils/git.ts +57 -49
- package/src/web/search/providers/firecrawl.ts +46 -13
- package/src/web/search/types.ts +5 -1
|
@@ -102,14 +102,18 @@
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
// Sort children by timestamp
|
|
106
|
-
|
|
105
|
+
// Sort children by timestamp. Use an explicit stack so valid, deep
|
|
106
|
+
// conversation chains do not exhaust the browser call stack.
|
|
107
|
+
const sortStack = [...roots];
|
|
108
|
+
while (sortStack.length > 0) {
|
|
109
|
+
const node = sortStack.pop();
|
|
107
110
|
node.children.sort((a, b) =>
|
|
108
111
|
new Date(a.entry.timestamp).getTime() - new Date(b.entry.timestamp).getTime()
|
|
109
112
|
);
|
|
110
|
-
node.children.
|
|
113
|
+
for (let i = node.children.length - 1; i >= 0; i--) {
|
|
114
|
+
sortStack.push(node.children[i]);
|
|
115
|
+
}
|
|
111
116
|
}
|
|
112
|
-
roots.forEach(sortChildren);
|
|
113
117
|
|
|
114
118
|
return roots;
|
|
115
119
|
}
|
|
@@ -157,17 +161,27 @@
|
|
|
157
161
|
const result = [];
|
|
158
162
|
const multipleRoots = roots.length > 1;
|
|
159
163
|
|
|
160
|
-
// Mark which subtrees contain the active leaf
|
|
164
|
+
// Mark which subtrees contain the active leaf. Use iterative post-order
|
|
165
|
+
// traversal so valid, deep conversation chains do not exhaust the
|
|
166
|
+
// browser call stack.
|
|
161
167
|
const containsActive = new Map();
|
|
162
|
-
|
|
168
|
+
const allNodes = [];
|
|
169
|
+
const activeStack = [...roots];
|
|
170
|
+
while (activeStack.length > 0) {
|
|
171
|
+
const node = activeStack.pop();
|
|
172
|
+
allNodes.push(node);
|
|
173
|
+
for (let i = node.children.length - 1; i >= 0; i--) {
|
|
174
|
+
activeStack.push(node.children[i]);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
for (let i = allNodes.length - 1; i >= 0; i--) {
|
|
178
|
+
const node = allNodes[i];
|
|
163
179
|
let has = activePathIds.has(node.entry.id);
|
|
164
180
|
for (const child of node.children) {
|
|
165
|
-
if (
|
|
181
|
+
if (containsActive.get(child)) has = true;
|
|
166
182
|
}
|
|
167
183
|
containsActive.set(node, has);
|
|
168
|
-
return has;
|
|
169
184
|
}
|
|
170
|
-
roots.forEach(markActive);
|
|
171
185
|
|
|
172
186
|
// Stack: [node, indent, justBranched, showConnector, isLast, gutters, isVirtualRootChild]
|
|
173
187
|
const stack = [];
|
|
@@ -179,17 +179,22 @@ export type SwitchSessionHandler = (sessionPath: string) => Promise<{ cancelled:
|
|
|
179
179
|
export type ShutdownHandler = () => void;
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
182
|
+
* Emit `session_shutdown` and clear timers owned by an extension runner.
|
|
183
|
+
*
|
|
184
|
+
* Returns whether any shutdown handlers were present. Timer cleanup runs even
|
|
185
|
+
* when a handler fails so extension background work cannot outlive its host.
|
|
184
186
|
*/
|
|
185
187
|
export async function emitSessionShutdownEvent(extensionRunner: ExtensionRunner | undefined): Promise<boolean> {
|
|
186
|
-
if (extensionRunner
|
|
188
|
+
if (!extensionRunner) return false;
|
|
189
|
+
try {
|
|
190
|
+
if (!extensionRunner.hasHandlers("session_shutdown")) return false;
|
|
187
191
|
await extensionRunner.emit({
|
|
188
192
|
type: "session_shutdown",
|
|
189
193
|
});
|
|
190
194
|
return true;
|
|
195
|
+
} finally {
|
|
196
|
+
extensionRunner.clearManagedTimers();
|
|
191
197
|
}
|
|
192
|
-
return false;
|
|
193
198
|
}
|
|
194
199
|
|
|
195
200
|
const noOpUIContext: ExtensionUIContext = {
|
|
@@ -543,6 +543,9 @@ export interface ToolDefinition<TParams extends TSchema = TSchema, TDetails = un
|
|
|
543
543
|
/** Tool approval tier. Defaults to `"exec"` when omitted.
|
|
544
544
|
* `"read"`: read-only operations. `"write"`: mutations. `"exec"`: code execution. */
|
|
545
545
|
approval?: ToolApproval;
|
|
546
|
+
/** Structured-output strict grammar opt-in/out. `false` is meaningful: OpenAI-family
|
|
547
|
+
* serializers preserve an explicit `strict: false` on the wire (#4336/#4340). */
|
|
548
|
+
strict?: boolean;
|
|
546
549
|
/** MCP server name for discovery/search metadata when this tool fronts an MCP server. */
|
|
547
550
|
mcpServerName?: string;
|
|
548
551
|
/** Original MCP tool name for discovery/search metadata. */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility shim for legacy extensions importing the package root of
|
|
3
|
+
* `@earendil-works/pi-tui` or `@mariozechner/pi-tui`.
|
|
4
|
+
*
|
|
5
|
+
* The historical root exported `decodeKittyPrintable`; the canonical TUI now
|
|
6
|
+
* exposes the equivalent, broader `decodePrintableKey` helper. Keep the legacy
|
|
7
|
+
* name available without reintroducing it into the canonical package surface.
|
|
8
|
+
*/
|
|
9
|
+
export * from "@oh-my-pi/pi-tui";
|
|
10
|
+
export { decodePrintableKey as decodeKittyPrintable } from "@oh-my-pi/pi-tui";
|