@oh-my-pi/pi-coding-agent 15.12.3 → 15.12.4
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 +43 -1
- package/dist/cli.js +1120 -870
- package/dist/types/autoresearch/tools/init-experiment.d.ts +1 -1
- package/dist/types/autoresearch/tools/log-experiment.d.ts +1 -1
- package/dist/types/autoresearch/tools/run-experiment.d.ts +1 -1
- package/dist/types/autoresearch/tools/update-notes.d.ts +1 -1
- package/dist/types/cli/args.d.ts +0 -1
- package/dist/types/cli/models-cli.d.ts +49 -0
- package/dist/types/commands/launch.d.ts +0 -3
- package/dist/types/commands/models.d.ts +33 -0
- package/dist/types/commands/token.d.ts +25 -0
- package/dist/types/commit/agentic/tools/analyze-file.d.ts +1 -1
- package/dist/types/commit/agentic/tools/git-file-diff.d.ts +1 -1
- package/dist/types/commit/agentic/tools/git-hunk.d.ts +1 -1
- package/dist/types/commit/agentic/tools/git-overview.d.ts +1 -1
- package/dist/types/commit/agentic/tools/propose-changelog.d.ts +1 -1
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +1 -1
- package/dist/types/commit/agentic/tools/recent-commits.d.ts +1 -1
- package/dist/types/commit/agentic/tools/schemas.d.ts +1 -1
- package/dist/types/commit/agentic/tools/split-commit.d.ts +1 -1
- package/dist/types/commit/changelog/generate.d.ts +1 -1
- package/dist/types/commit/shared-llm.d.ts +1 -1
- package/dist/types/config/model-registry.d.ts +7 -0
- package/dist/types/config/models-config-schema.d.ts +1 -1
- package/dist/types/config/settings-schema.d.ts +20 -0
- package/dist/types/edit/hashline/params.d.ts +1 -1
- package/dist/types/edit/modes/apply-patch.d.ts +1 -1
- package/dist/types/edit/modes/patch.d.ts +1 -1
- package/dist/types/edit/modes/replace.d.ts +1 -1
- package/dist/types/extensibility/custom-commands/types.d.ts +2 -2
- package/dist/types/extensibility/custom-tools/types.d.ts +2 -2
- package/dist/types/extensibility/extensions/types.d.ts +2 -2
- package/dist/types/extensibility/hooks/types.d.ts +2 -2
- package/dist/types/goals/tools/goal-tool.d.ts +1 -1
- package/dist/types/lsp/types.d.ts +1 -1
- package/dist/types/mcp/manager.d.ts +8 -0
- package/dist/types/mnemopi/config.d.ts +28 -0
- package/dist/types/modes/acp/acp-agent.d.ts +1 -2
- package/dist/types/modes/components/index.d.ts +1 -0
- package/dist/types/modes/components/logout-account-selector.d.ts +8 -0
- package/dist/types/modes/components/status-line/component.d.ts +9 -5
- package/dist/types/modes/components/status-line/types.d.ts +2 -1
- package/dist/types/modes/controllers/event-controller.d.ts +0 -17
- package/dist/types/modes/interactive-mode.d.ts +0 -3
- package/dist/types/modes/types.d.ts +0 -5
- package/dist/types/session/agent-session.d.ts +14 -33
- package/dist/types/session/agent-storage.d.ts +2 -1
- package/dist/types/session/indexed-session-storage.d.ts +1 -0
- package/dist/types/session/messages.d.ts +8 -10
- package/dist/types/session/session-manager.d.ts +15 -0
- package/dist/types/session/session-storage.d.ts +5 -0
- package/dist/types/slash-commands/helpers/logout.d.ts +15 -0
- package/dist/types/task/types.d.ts +1 -1
- package/dist/types/tools/ask.d.ts +1 -1
- package/dist/types/tools/ast-edit.d.ts +1 -1
- package/dist/types/tools/ast-grep.d.ts +1 -1
- package/dist/types/tools/bash.d.ts +1 -1
- package/dist/types/tools/browser/cmux/cmux-tab.d.ts +202 -0
- package/dist/types/tools/browser/cmux/rpc.d.ts +70 -0
- package/dist/types/tools/browser/cmux/socket-client.d.ts +19 -0
- package/dist/types/tools/browser/registry.d.ts +16 -3
- package/dist/types/tools/browser/render.d.ts +2 -0
- package/dist/types/tools/browser/tab-protocol.d.ts +2 -0
- package/dist/types/tools/browser/tab-supervisor.d.ts +16 -4
- package/dist/types/tools/browser.d.ts +3 -1
- package/dist/types/tools/checkpoint.d.ts +1 -1
- package/dist/types/tools/debug.d.ts +1 -1
- package/dist/types/tools/eval.d.ts +1 -1
- package/dist/types/tools/find.d.ts +1 -1
- package/dist/types/tools/gh.d.ts +1 -1
- package/dist/types/tools/image-gen.d.ts +1 -1
- package/dist/types/tools/index.d.ts +3 -1
- package/dist/types/tools/inspect-image.d.ts +1 -1
- package/dist/types/tools/irc.d.ts +1 -1
- package/dist/types/tools/job.d.ts +1 -1
- package/dist/types/tools/memory-edit.d.ts +1 -1
- package/dist/types/tools/memory-recall.d.ts +1 -1
- package/dist/types/tools/memory-reflect.d.ts +1 -1
- package/dist/types/tools/memory-retain.d.ts +1 -1
- package/dist/types/tools/read.d.ts +1 -1
- package/dist/types/tools/render-mermaid.d.ts +1 -1
- package/dist/types/tools/resolve.d.ts +1 -1
- package/dist/types/tools/review.d.ts +1 -1
- package/dist/types/tools/search-tool-bm25.d.ts +1 -1
- package/dist/types/tools/search.d.ts +1 -1
- package/dist/types/tools/ssh.d.ts +1 -1
- package/dist/types/tools/todo.d.ts +1 -1
- package/dist/types/tools/tts.d.ts +1 -1
- package/dist/types/tools/write.d.ts +1 -1
- package/dist/types/utils/clipboard.d.ts +4 -3
- package/dist/types/utils/image-loading.d.ts +18 -1
- package/dist/types/utils/thinking-display.d.ts +17 -0
- package/dist/types/web/search/index.d.ts +1 -1
- package/package.json +14 -14
- package/src/autoresearch/storage.ts +2 -1
- package/src/autoresearch/tools/init-experiment.ts +1 -1
- package/src/autoresearch/tools/log-experiment.ts +1 -1
- package/src/autoresearch/tools/run-experiment.ts +1 -1
- package/src/autoresearch/tools/update-notes.ts +1 -1
- package/src/cli/args.ts +0 -8
- package/src/cli/auth-gateway-cli.ts +1 -1
- package/src/cli/bench-cli.ts +1 -1
- package/src/cli/dry-balance-cli.ts +1 -1
- package/src/cli/models-cli.ts +427 -0
- package/src/cli-commands.ts +2 -0
- package/src/collab/host.ts +9 -12
- package/src/commands/launch.ts +0 -3
- package/src/commands/models.ts +61 -0
- package/src/commands/token.ts +89 -0
- package/src/commit/agentic/tools/analyze-file.ts +1 -1
- package/src/commit/agentic/tools/git-file-diff.ts +1 -1
- package/src/commit/agentic/tools/git-hunk.ts +1 -1
- package/src/commit/agentic/tools/git-overview.ts +1 -1
- package/src/commit/agentic/tools/propose-changelog.ts +1 -1
- package/src/commit/agentic/tools/propose-commit.ts +1 -1
- package/src/commit/agentic/tools/recent-commits.ts +1 -1
- package/src/commit/agentic/tools/schemas.ts +1 -1
- package/src/commit/agentic/tools/split-commit.ts +1 -1
- package/src/commit/analysis/summary.ts +1 -1
- package/src/commit/changelog/generate.ts +1 -1
- package/src/commit/shared-llm.ts +1 -1
- package/src/config/model-registry.ts +15 -12
- package/src/config/model-resolver.ts +2 -2
- package/src/config/models-config-schema.ts +1 -1
- package/src/config/settings-schema.ts +18 -0
- package/src/edit/hashline/params.ts +1 -1
- package/src/edit/modes/apply-patch.ts +1 -1
- package/src/edit/modes/patch.ts +1 -1
- package/src/edit/modes/replace.ts +1 -1
- package/src/eval/agent-bridge.ts +1 -1
- package/src/eval/completion-bridge.ts +1 -1
- package/src/export/html/template.js +24 -2
- package/src/export/html/tool-views.generated.js +2 -2
- package/src/extensibility/custom-commands/loader.ts +1 -1
- package/src/extensibility/custom-commands/types.ts +2 -2
- package/src/extensibility/custom-tools/loader.ts +1 -1
- package/src/extensibility/custom-tools/types.ts +2 -2
- package/src/extensibility/extensions/loader.ts +2 -2
- package/src/extensibility/extensions/types.ts +2 -2
- package/src/extensibility/hooks/loader.ts +1 -1
- package/src/extensibility/hooks/types.ts +2 -2
- package/src/extensibility/skills.ts +18 -3
- package/src/goals/tools/goal-tool.ts +1 -1
- package/src/internal-urls/docs-index.generated.ts +5 -2
- package/src/lsp/types.ts +1 -1
- package/src/main.ts +0 -25
- package/src/mcp/config-writer.ts +7 -3
- package/src/mcp/manager.ts +11 -0
- package/src/memories/index.ts +3 -1
- package/src/memories/storage.ts +2 -1
- package/src/mnemopi/config.ts +95 -11
- package/src/modes/acp/acp-agent.ts +5 -48
- package/src/modes/acp/acp-event-mapper.ts +5 -1
- package/src/modes/components/agent-hub.ts +2 -1
- package/src/modes/components/assistant-message.ts +8 -7
- package/src/modes/components/index.ts +1 -0
- package/src/modes/components/logout-account-selector.ts +130 -0
- package/src/modes/components/mcp-add-wizard.ts +1 -1
- package/src/modes/components/model-selector.ts +2 -2
- package/src/modes/components/status-line/component.ts +54 -157
- package/src/modes/components/status-line/segments.ts +1 -1
- package/src/modes/components/status-line/types.ts +2 -1
- package/src/modes/controllers/command-controller.ts +0 -12
- package/src/modes/controllers/event-controller.ts +23 -62
- package/src/modes/controllers/input-controller.ts +53 -30
- package/src/modes/controllers/mcp-command-controller.ts +44 -3
- package/src/modes/controllers/selector-controller.ts +56 -10
- package/src/modes/controllers/streaming-reveal.ts +4 -3
- package/src/modes/interactive-mode.ts +2 -8
- package/src/modes/theme/theme.ts +1 -1
- package/src/modes/types.ts +0 -5
- package/src/modes/utils/ui-helpers.ts +2 -1
- package/src/prompts/system/empty-stop-retry.md +4 -6
- package/src/sdk.ts +15 -19
- package/src/session/agent-session.ts +125 -234
- package/src/session/agent-storage.ts +18 -9
- package/src/session/history-storage.ts +2 -1
- package/src/session/indexed-session-storage.ts +7 -0
- package/src/session/messages.ts +9 -11
- package/src/session/session-dump-format.ts +4 -2
- package/src/session/session-manager.ts +116 -0
- package/src/session/session-storage.ts +20 -0
- package/src/slash-commands/builtin-registry.ts +15 -1
- package/src/slash-commands/helpers/logout.ts +88 -0
- package/src/task/types.ts +1 -1
- package/src/tools/ask.ts +1 -1
- package/src/tools/ast-edit.ts +1 -1
- package/src/tools/ast-grep.ts +1 -1
- package/src/tools/bash.ts +1 -1
- package/src/tools/browser/cmux/cmux-tab.ts +1264 -0
- package/src/tools/browser/cmux/rpc.ts +156 -0
- package/src/tools/browser/cmux/socket-client.ts +309 -0
- package/src/tools/browser/registry.ts +37 -3
- package/src/tools/browser/render.ts +6 -1
- package/src/tools/browser/tab-protocol.ts +2 -0
- package/src/tools/browser/tab-supervisor.ts +189 -18
- package/src/tools/browser/tab-worker.ts +1 -1
- package/src/tools/browser.ts +16 -1
- package/src/tools/checkpoint.ts +1 -1
- package/src/tools/debug.ts +1 -1
- package/src/tools/eval.ts +11 -6
- package/src/tools/fetch.ts +13 -2
- package/src/tools/find.ts +1 -1
- package/src/tools/gh.ts +1 -1
- package/src/tools/github-cache.ts +2 -1
- package/src/tools/image-gen.ts +1 -1
- package/src/tools/index.ts +3 -1
- package/src/tools/inspect-image.ts +3 -1
- package/src/tools/irc.ts +1 -1
- package/src/tools/job.ts +1 -1
- package/src/tools/memory-edit.ts +1 -1
- package/src/tools/memory-recall.ts +1 -1
- package/src/tools/memory-reflect.ts +1 -1
- package/src/tools/memory-retain.ts +1 -1
- package/src/tools/read.ts +8 -2
- package/src/tools/render-mermaid.ts +1 -1
- package/src/tools/report-tool-issue.ts +3 -2
- package/src/tools/resolve.ts +1 -1
- package/src/tools/review.ts +1 -1
- package/src/tools/search-tool-bm25.ts +1 -1
- package/src/tools/search.ts +1 -1
- package/src/tools/ssh.ts +1 -1
- package/src/tools/todo.ts +1 -1
- package/src/tools/tts.ts +1 -1
- package/src/tools/write.ts +1 -1
- package/src/utils/clipboard.ts +35 -18
- package/src/utils/image-loading.ts +35 -4
- package/src/utils/thinking-display.ts +37 -0
- package/src/web/search/index.ts +1 -1
- package/dist/types/cli/list-models.d.ts +0 -30
- package/src/cli/list-models.ts +0 -194
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ToolSession } from "../../sdk";
|
|
2
|
-
import {
|
|
2
|
+
import { CmuxTab } from "./cmux/cmux-tab";
|
|
3
|
+
import { type BrowserHandle, type BrowserKindTag, type CmuxBrowserHandle, type PuppeteerBrowserHandle } from "./registry";
|
|
3
4
|
import type { ReadyInfo, RunResultOk, Transferable, WorkerInbound, WorkerInitPayload, WorkerOutbound } from "./tab-protocol";
|
|
4
5
|
interface WorkerHandle {
|
|
5
6
|
send(msg: WorkerInbound, transferList?: Transferable[]): void;
|
|
@@ -16,17 +17,27 @@ export interface PendingRun {
|
|
|
16
17
|
signal?: AbortSignal;
|
|
17
18
|
toolCalls: Map<string, AbortController>;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
interface TabSessionBase<TBrowser extends BrowserHandle = BrowserHandle> {
|
|
20
21
|
name: string;
|
|
21
|
-
browser:
|
|
22
|
+
browser: TBrowser;
|
|
22
23
|
targetId: string;
|
|
23
|
-
worker: WorkerHandle;
|
|
24
24
|
state: "alive" | "dead";
|
|
25
25
|
info: ReadyInfo;
|
|
26
26
|
pending: Map<string, PendingRun>;
|
|
27
27
|
dialogPolicy?: DialogPolicy;
|
|
28
28
|
kindTag: BrowserKindTag;
|
|
29
29
|
}
|
|
30
|
+
export interface WorkerTabSession extends TabSessionBase<PuppeteerBrowserHandle> {
|
|
31
|
+
backend: "worker";
|
|
32
|
+
worker: WorkerHandle;
|
|
33
|
+
}
|
|
34
|
+
export interface CmuxTabSession extends TabSessionBase<CmuxBrowserHandle> {
|
|
35
|
+
backend: "cmux";
|
|
36
|
+
cmuxTab: CmuxTab;
|
|
37
|
+
cmuxOwnsSurface: boolean;
|
|
38
|
+
cmuxAttachedSurface?: string;
|
|
39
|
+
}
|
|
40
|
+
export type TabSession = WorkerTabSession | CmuxTabSession;
|
|
30
41
|
export interface AcquireTabOptions {
|
|
31
42
|
url?: string;
|
|
32
43
|
waitUntil?: "load" | "domcontentloaded" | "networkidle0" | "networkidle2";
|
|
@@ -39,6 +50,7 @@ export interface AcquireTabOptions {
|
|
|
39
50
|
signal?: AbortSignal;
|
|
40
51
|
timeoutMs: number;
|
|
41
52
|
dialogs?: DialogPolicy;
|
|
53
|
+
cmuxSurface?: string;
|
|
42
54
|
}
|
|
43
55
|
export interface AcquireTabResult {
|
|
44
56
|
tab: TabSession;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
|
-
import
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
3
|
import type { ToolSession } from "../sdk";
|
|
4
4
|
import { type BrowserKindTag } from "./browser/registry";
|
|
5
5
|
import type { Observation, ScreenshotResult } from "./browser/tab-protocol";
|
|
6
6
|
import type { OutputMeta } from "./output-meta";
|
|
7
|
+
export { cmuxSnapshotToObservation, mapWaitUntil, resolveCmuxKind, serializeEval } from "./browser/cmux/rpc";
|
|
8
|
+
export { CmuxSocketClient } from "./browser/cmux/socket-client";
|
|
7
9
|
export { extractReadableFromHtml, type ReadableFormat, type ReadableResult } from "./browser/readable";
|
|
8
10
|
export type { Observation, ObservationEntry } from "./browser/tab-protocol";
|
|
9
11
|
declare const browserSchema: z.ZodObject<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
|
-
import
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
3
|
import type { ToolSession } from ".";
|
|
4
4
|
import type { OutputMeta } from "./output-meta";
|
|
5
5
|
export interface CheckpointState {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, RenderResultOptions, ToolApprovalDecision } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import { type Component } from "@oh-my-pi/pi-tui";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import { type DapBreakpointRecord, type DapContinueOutcome, type DapDataBreakpointInfoResponse, type DapDataBreakpointRecord, type DapDisassembledInstruction, type DapEvaluateResponse, type DapFunctionBreakpointRecord, type DapInstructionBreakpointRecord, type DapModule, type DapScope, type DapSessionSummary, type DapSource, type DapStackFrame, type DapThread, type DapVariable } from "../dap";
|
|
5
5
|
import type { Theme } from "../modes/theme/theme";
|
|
6
6
|
import type { ToolSession } from ".";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
|
-
import
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
3
|
import type { EvalToolDetails } from "../eval/types";
|
|
4
4
|
import type { ToolSession } from ".";
|
|
5
5
|
export { EVAL_DEFAULT_PREVIEW_LINES, evalToolRenderer } from "./eval-render";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import type { Theme } from "../modes/theme/theme";
|
|
6
6
|
import { type TruncationResult } from "../session/streaming-output";
|
package/dist/types/tools/gh.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolApprovalDecision } from "@oh-my-pi/pi-agent-core";
|
|
2
|
-
import
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
3
|
import type { Settings } from "../config/settings";
|
|
4
4
|
import * as git from "../utils/git";
|
|
5
5
|
import type { ToolSession } from ".";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Model } from "@oh-my-pi/pi-ai";
|
|
2
|
-
import
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
3
|
import { type ModelRegistry } from "../config/model-registry";
|
|
4
4
|
import type { CustomTool } from "../extensibility/custom-tools/types";
|
|
5
5
|
export type ImageProvider = "antigravity" | "gemini" | "openai" | "openai-codex" | "openrouter" | "xai";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InMemorySnapshotStore } from "@oh-my-pi/hashline";
|
|
2
2
|
import type { AgentTelemetryConfig, AgentTool } from "@oh-my-pi/pi-agent-core";
|
|
3
|
-
import type { FetchImpl, ToolChoice } from "@oh-my-pi/pi-ai";
|
|
3
|
+
import type { FetchImpl, Model, ToolChoice } from "@oh-my-pi/pi-ai";
|
|
4
4
|
import type { AsyncJobManager } from "../async/job-manager";
|
|
5
5
|
import type { Rule } from "../capability/rule";
|
|
6
6
|
import type { PromptTemplate } from "../config/prompt-templates";
|
|
@@ -173,6 +173,8 @@ export interface ToolSession {
|
|
|
173
173
|
getModelString?: () => string | undefined;
|
|
174
174
|
/** Get the current session model string, regardless of how it was chosen */
|
|
175
175
|
getActiveModelString?: () => string | undefined;
|
|
176
|
+
/** Get the current session model object (provider/api capabilities), regardless of how it was chosen. */
|
|
177
|
+
getActiveModel?: () => Model | undefined;
|
|
176
178
|
/** Auth storage for passing to subagents (avoids re-discovery) */
|
|
177
179
|
authStorage?: import("../session/auth-storage").AuthStorage;
|
|
178
180
|
/** Model registry for passing to subagents (avoids re-discovery) */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import { completeSimple } from "@oh-my-pi/pi-ai";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import type { ToolSession } from "./index";
|
|
5
5
|
declare const inspectImageSchema: z.ZodObject<{
|
|
6
6
|
path: z.ZodString;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
12
12
|
import { type Component } from "@oh-my-pi/pi-tui";
|
|
13
|
-
import
|
|
13
|
+
import { z } from "zod/v4";
|
|
14
14
|
import type { Settings } from "../config/settings";
|
|
15
15
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
16
16
|
import { type IrcDeliveryReceipt, type IrcMessage } from "../irc/bus";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import type { Theme } from "../modes/theme/theme";
|
|
6
6
|
import type { ToolSession } from "./index";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import { type Theme } from "../modes/theme/theme";
|
|
6
6
|
import type { ToolSession } from "../sdk";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
|
-
import
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
3
|
import type { ToolSession } from "./index";
|
|
4
4
|
declare const renderMermaidSchema: z.ZodObject<{
|
|
5
5
|
mermaid: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import type { Theme } from "../modes/theme/theme";
|
|
6
6
|
import type { ToolSession } from ".";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Reviewers finish via `yield` tool with SubmitReviewDetails schema.
|
|
7
7
|
*/
|
|
8
8
|
import type { AgentTool } from "@oh-my-pi/pi-agent-core";
|
|
9
|
-
import
|
|
9
|
+
import { z } from "zod/v4";
|
|
10
10
|
import type { Theme, ThemeColor } from "../modes/theme/theme";
|
|
11
11
|
import type { ReviewFinding } from "../task/types";
|
|
12
12
|
export type FindingPriority = "P0" | "P1" | "P2" | "P3";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import type { Theme } from "../modes/theme/theme";
|
|
6
6
|
import { type DiscoverableTool } from "../tool-discovery/tool-index";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import type { Theme } from "../modes/theme/theme";
|
|
6
6
|
import { type TruncationResult } from "../session/streaming-output";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import type { SSHHost } from "../capability/ssh";
|
|
5
5
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
6
6
|
import type { Theme } from "../modes/theme/theme";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import type { Theme } from "../modes/theme/theme";
|
|
6
6
|
import type { ToolSession } from "../sdk";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import { type FileDiagnosticsResult } from "../lsp";
|
|
6
6
|
import { type Theme } from "../modes/theme/theme";
|
|
@@ -13,9 +13,10 @@ export declare function copyToClipboard(text: string): Promise<void>;
|
|
|
13
13
|
* Read an image from the system clipboard.
|
|
14
14
|
*
|
|
15
15
|
* Returns null on Termux (no image clipboard support) or when no display
|
|
16
|
-
* server is available (headless/SSH without forwarding). Under
|
|
17
|
-
* Windows clipboard is reached through `powershell.exe
|
|
18
|
-
*
|
|
16
|
+
* server is available (headless/SSH without forwarding). Under native Windows
|
|
17
|
+
* and WSL, the Windows clipboard is also reached through `powershell.exe`
|
|
18
|
+
* because terminal clipboard paths can leave image payloads invisible to the
|
|
19
|
+
* native bridge.
|
|
19
20
|
*
|
|
20
21
|
* @returns PNG payload or null when no image is available.
|
|
21
22
|
*/
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
import type { ImageContent } from "@oh-my-pi/pi-ai";
|
|
1
|
+
import type { ImageContent, Model } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import { type ImageResizeOptions } from "./image-resize";
|
|
3
3
|
export declare const MAX_IMAGE_INPUT_BYTES: number;
|
|
4
4
|
export declare const SUPPORTED_INPUT_IMAGE_MIME_TYPES: Set<string>;
|
|
5
|
+
/**
|
|
6
|
+
* Ollama and its local-backend family decode image input through llama.cpp /
|
|
7
|
+
* `stb_image`, which is compiled without WebP support, so a WebP upload fails
|
|
8
|
+
* with an opaque HTTP 400. Detect those models so the resize pipeline encodes
|
|
9
|
+
* to PNG/JPEG instead — the automatic equivalent of `OMP_NO_WEBP=1`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function modelLacksWebpSupport(model: Pick<Model, "provider" | "api"> | undefined): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* `true` when `model` cannot decode WebP, otherwise `undefined` so the
|
|
14
|
+
* `OMP_NO_WEBP` env fallback in {@link resizeImage} still applies. Feed straight
|
|
15
|
+
* into {@link ImageResizeOptions.excludeWebP}.
|
|
16
|
+
*/
|
|
17
|
+
export declare function webpExclusionForModel(model: Pick<Model, "provider" | "api"> | undefined): true | undefined;
|
|
5
18
|
export interface LoadImageInputOptions {
|
|
6
19
|
path: string;
|
|
7
20
|
cwd: string;
|
|
@@ -9,6 +22,8 @@ export interface LoadImageInputOptions {
|
|
|
9
22
|
maxBytes?: number;
|
|
10
23
|
resolvedPath?: string;
|
|
11
24
|
detectedMimeType?: string;
|
|
25
|
+
/** Force non-WebP output (e.g. for Ollama). Leave unset to honor `OMP_NO_WEBP`. */
|
|
26
|
+
excludeWebP?: boolean;
|
|
12
27
|
}
|
|
13
28
|
export interface LoadedImageInput {
|
|
14
29
|
resolvedPath: string;
|
|
@@ -25,6 +40,8 @@ export declare class ImageInputTooLargeError extends Error {
|
|
|
25
40
|
}
|
|
26
41
|
export declare function ensureSupportedImageInput(image: ImageContent): Promise<ImageContent | null>;
|
|
27
42
|
export interface NormalizeModelContextImagesOptions {
|
|
43
|
+
/** Model the images are bound for; used to derive encoder constraints (WebP exclusion for Ollama). */
|
|
44
|
+
model?: Model;
|
|
28
45
|
resize?: ImageResizeOptions;
|
|
29
46
|
}
|
|
30
47
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AssistantMessage } from "@oh-my-pi/pi-ai";
|
|
2
|
+
type AssistantContentBlock = AssistantMessage["content"][number];
|
|
3
|
+
type ThinkingBlock = Extract<AssistantContentBlock, {
|
|
4
|
+
type: "thinking";
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the operator-visible thinking text for a block.
|
|
8
|
+
*
|
|
9
|
+
* Some OpenAI-compatible reasoning gateways require a non-empty
|
|
10
|
+
* `reasoning_content` field on historical assistant tool-call turns even when
|
|
11
|
+
* the model did not emit any reasoning. The provider adapter uses a single dot
|
|
12
|
+
* as the wire-only placeholder those gateways accept; if that value is later
|
|
13
|
+
* replayed or echoed as a thinking block, it should not render as model thought.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getVisibleThinkingText(block: ThinkingBlock): string;
|
|
16
|
+
export declare function hasVisibleThinking(block: ThinkingBlock): boolean;
|
|
17
|
+
export {};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
8
8
|
import type { AuthStorage } from "@oh-my-pi/pi-ai";
|
|
9
|
-
import
|
|
9
|
+
import { z } from "zod/v4";
|
|
10
10
|
import type { CustomTool } from "../../extensibility/custom-tools/types";
|
|
11
11
|
import type { ToolSession } from "../../tools";
|
|
12
12
|
import { type SearchRenderDetails } from "./render";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-coding-agent",
|
|
4
|
-
"version": "15.12.
|
|
4
|
+
"version": "15.12.4",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
"bench:guard": "bun scripts/bench-guard.ts"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@agentclientprotocol/sdk": "0.
|
|
47
|
+
"@agentclientprotocol/sdk": "0.25.0",
|
|
48
48
|
"@babel/parser": "^7.29.7",
|
|
49
49
|
"@mozilla/readability": "^0.6.0",
|
|
50
|
-
"@oh-my-pi/hashline": "15.12.
|
|
51
|
-
"@oh-my-pi/omp-stats": "15.12.
|
|
52
|
-
"@oh-my-pi/pi-agent-core": "15.12.
|
|
53
|
-
"@oh-my-pi/pi-ai": "15.12.
|
|
54
|
-
"@oh-my-pi/pi-catalog": "15.12.
|
|
55
|
-
"@oh-my-pi/pi-mnemopi": "15.12.
|
|
56
|
-
"@oh-my-pi/pi-natives": "15.12.
|
|
57
|
-
"@oh-my-pi/pi-tui": "15.12.
|
|
58
|
-
"@oh-my-pi/pi-utils": "15.12.
|
|
59
|
-
"@oh-my-pi/pi-wire": "15.12.
|
|
60
|
-
"@oh-my-pi/snapcompact": "15.12.
|
|
50
|
+
"@oh-my-pi/hashline": "15.12.4",
|
|
51
|
+
"@oh-my-pi/omp-stats": "15.12.4",
|
|
52
|
+
"@oh-my-pi/pi-agent-core": "15.12.4",
|
|
53
|
+
"@oh-my-pi/pi-ai": "15.12.4",
|
|
54
|
+
"@oh-my-pi/pi-catalog": "15.12.4",
|
|
55
|
+
"@oh-my-pi/pi-mnemopi": "15.12.4",
|
|
56
|
+
"@oh-my-pi/pi-natives": "15.12.4",
|
|
57
|
+
"@oh-my-pi/pi-tui": "15.12.4",
|
|
58
|
+
"@oh-my-pi/pi-utils": "15.12.4",
|
|
59
|
+
"@oh-my-pi/pi-wire": "15.12.4",
|
|
60
|
+
"@oh-my-pi/snapcompact": "15.12.4",
|
|
61
61
|
"@opentelemetry/api": "^1.9.1",
|
|
62
62
|
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
63
63
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"puppeteer-core": "^25.1.0",
|
|
78
78
|
"turndown": "7.2.4",
|
|
79
79
|
"turndown-plugin-gfm": "1.0.2",
|
|
80
|
-
"zod": "4
|
|
80
|
+
"zod": "^4"
|
|
81
81
|
},
|
|
82
82
|
"optionalDependencies": {
|
|
83
83
|
"@huggingface/transformers": "^4.2.0"
|
|
@@ -194,7 +194,6 @@ const SCHEMA_VERSION = 1;
|
|
|
194
194
|
const SCHEMA_SQL = `
|
|
195
195
|
PRAGMA journal_mode=WAL;
|
|
196
196
|
PRAGMA synchronous=NORMAL;
|
|
197
|
-
PRAGMA busy_timeout=5000;
|
|
198
197
|
PRAGMA foreign_keys=ON;
|
|
199
198
|
|
|
200
199
|
CREATE TABLE IF NOT EXISTS sessions (
|
|
@@ -263,6 +262,8 @@ export class AutoresearchStorage {
|
|
|
263
262
|
this.#projectDir = projectDir;
|
|
264
263
|
fs.mkdirSync(path.dirname(dbPath), { recursive: true });
|
|
265
264
|
this.#db = new Database(dbPath);
|
|
265
|
+
// Install the busy handler BEFORE any lock-taking statement. See #2421.
|
|
266
|
+
this.#db.run("PRAGMA busy_timeout = 5000");
|
|
266
267
|
this.#db.run(SCHEMA_SQL);
|
|
267
268
|
const versionRow = this.#db.query("PRAGMA user_version").get() as { user_version: number } | null;
|
|
268
269
|
const currentVersion = versionRow?.user_version ?? 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as path from "node:path";
|
|
2
2
|
|
|
3
3
|
import { Text } from "@oh-my-pi/pi-tui";
|
|
4
|
-
import
|
|
4
|
+
import { z } from "zod/v4";
|
|
5
5
|
import type { ToolDefinition } from "../../extensibility/extensions";
|
|
6
6
|
import type { Theme } from "../../modes/theme/theme";
|
|
7
7
|
import { replaceTabs, truncateToWidth } from "../../tools/render-utils";
|
|
@@ -2,7 +2,7 @@ import * as fs from "node:fs";
|
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
|
|
4
4
|
import { Text } from "@oh-my-pi/pi-tui";
|
|
5
|
-
import
|
|
5
|
+
import { z } from "zod/v4";
|
|
6
6
|
import type { ToolDefinition } from "../../extensibility/extensions";
|
|
7
7
|
import type { Theme } from "../../modes/theme/theme";
|
|
8
8
|
import { replaceTabs, truncateToWidth } from "../../tools/render-utils";
|
|
@@ -2,7 +2,7 @@ import * as fs from "node:fs";
|
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { Text } from "@oh-my-pi/pi-tui";
|
|
4
4
|
import { formatBytes } from "@oh-my-pi/pi-utils";
|
|
5
|
-
import
|
|
5
|
+
import { z } from "zod/v4";
|
|
6
6
|
import { executeBash } from "../../exec/bash-executor";
|
|
7
7
|
import type { ToolDefinition } from "../../extensibility/extensions";
|
|
8
8
|
import type { Theme } from "../../modes/theme/theme";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Text } from "@oh-my-pi/pi-tui";
|
|
2
|
-
import
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
3
|
import type { ToolDefinition } from "../../extensibility/extensions";
|
|
4
4
|
import type { Theme } from "../../modes/theme/theme";
|
|
5
5
|
import { replaceTabs, truncateToWidth } from "../../tools/render-utils";
|
package/src/cli/args.ts
CHANGED
|
@@ -48,7 +48,6 @@ export interface Args {
|
|
|
48
48
|
noSkills?: boolean;
|
|
49
49
|
skills?: string[];
|
|
50
50
|
noRules?: boolean;
|
|
51
|
-
listModels?: string | true;
|
|
52
51
|
noTitle?: boolean;
|
|
53
52
|
autoApprove?: boolean;
|
|
54
53
|
approvalMode?: "always-ask" | "write" | "yolo";
|
|
@@ -228,13 +227,6 @@ export function parseArgs(inputArgs: string[], extensionFlags?: Map<string, { ty
|
|
|
228
227
|
} else if (arg === "--skills" && i + 1 < args.length) {
|
|
229
228
|
// Comma-separated glob patterns for skill filtering
|
|
230
229
|
result.skills = args[++i].split(",").map(s => s.trim());
|
|
231
|
-
} else if (arg === "--list-models") {
|
|
232
|
-
// Check if next arg is a search pattern (not a flag or file arg)
|
|
233
|
-
if (i + 1 < args.length && !args[i + 1].startsWith("-") && !args[i + 1].startsWith("@")) {
|
|
234
|
-
result.listModels = args[++i];
|
|
235
|
-
} else {
|
|
236
|
-
result.listModels = true;
|
|
237
|
-
}
|
|
238
230
|
} else if (arg.startsWith("@")) {
|
|
239
231
|
result.fileArgs.push(arg.slice(1)); // Remove @ prefix
|
|
240
232
|
} else if (!arg.startsWith("-")) {
|
|
@@ -409,7 +409,7 @@ function pickProbeCandidates(provider: string): Model<Api>[] {
|
|
|
409
409
|
if (!model.input.includes("text")) return false;
|
|
410
410
|
const totalCost = (model.cost?.input ?? 0) + (model.cost?.output ?? 0);
|
|
411
411
|
if (!Number.isFinite(totalCost) || totalCost < 0) return false;
|
|
412
|
-
if (model.maxTokens <= 0) return false;
|
|
412
|
+
if (model.maxTokens !== null && model.maxTokens <= 0) return false;
|
|
413
413
|
return true;
|
|
414
414
|
});
|
|
415
415
|
candidates.sort((a, b) => a.cost.input + a.cost.output - (b.cost.input + b.cost.output) || a.id.localeCompare(b.id));
|
package/src/cli/bench-cli.ts
CHANGED
|
@@ -180,7 +180,7 @@ async function runBenchRequest(
|
|
|
180
180
|
apiKey: options.apiKey,
|
|
181
181
|
sessionId: options.sessionId,
|
|
182
182
|
maxTokens:
|
|
183
|
-
Number.isFinite(model.maxTokens) && model.maxTokens > 0
|
|
183
|
+
model.maxTokens !== null && Number.isFinite(model.maxTokens) && model.maxTokens > 0
|
|
184
184
|
? Math.min(options.maxTokens, model.maxTokens)
|
|
185
185
|
: options.maxTokens,
|
|
186
186
|
reasoning: options.reasoning,
|
|
@@ -279,7 +279,7 @@ function isBenchFirstTokenEvent(event: AssistantMessageEvent): boolean {
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
function resolveBenchMaxTokens(model: Model<Api>): number {
|
|
282
|
-
return Number.isFinite(model.maxTokens) && model.maxTokens > 0
|
|
282
|
+
return model.maxTokens !== null && Number.isFinite(model.maxTokens) && model.maxTokens > 0
|
|
283
283
|
? Math.min(BENCH_MAX_TOKENS, model.maxTokens)
|
|
284
284
|
: BENCH_MAX_TOKENS;
|
|
285
285
|
}
|