@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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
2
|
import type { CommitAgentState } from "../../../commit/agentic/state";
|
|
3
3
|
import { CHANGELOG_CATEGORIES, type ChangelogCategory } from "../../../commit/types";
|
|
4
4
|
import type { CustomTool } from "../../../extensibility/custom-tools/types";
|
|
@@ -2,7 +2,7 @@ import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
|
2
2
|
import type { Api, ApiKey, AssistantMessage, Model } from "@oh-my-pi/pi-ai";
|
|
3
3
|
import { completeSimple, validateToolCall } from "@oh-my-pi/pi-ai";
|
|
4
4
|
import { prompt } from "@oh-my-pi/pi-utils";
|
|
5
|
-
import
|
|
5
|
+
import { z } from "zod/v4";
|
|
6
6
|
import summarySystemPrompt from "../../commit/prompts/summary-system.md" with { type: "text" };
|
|
7
7
|
import summaryUserPrompt from "../../commit/prompts/summary-user.md" with { type: "text" };
|
|
8
8
|
import type { CommitSummary } from "../../commit/types";
|
|
@@ -2,7 +2,7 @@ import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
|
2
2
|
import type { Api, ApiKey, AssistantMessage, Model } from "@oh-my-pi/pi-ai";
|
|
3
3
|
import { completeSimple, validateToolCall } from "@oh-my-pi/pi-ai";
|
|
4
4
|
import { prompt } from "@oh-my-pi/pi-utils";
|
|
5
|
-
import
|
|
5
|
+
import { z } from "zod/v4";
|
|
6
6
|
import changelogSystemPrompt from "../../commit/prompts/changelog-system.md" with { type: "text" };
|
|
7
7
|
import changelogUserPrompt from "../../commit/prompts/changelog-user.md" with { type: "text" };
|
|
8
8
|
import { CHANGELOG_CATEGORIES, type ChangelogCategory, type ChangelogGenerationResult } from "../../commit/types";
|
package/src/commit/shared-llm.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AssistantMessage } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import { validateToolCall } from "@oh-my-pi/pi-ai";
|
|
3
|
-
import
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
4
|
import type { ChangelogCategory, ConventionalAnalysis } from "./types";
|
|
5
5
|
import { extractTextContent, extractToolCall, normalizeAnalysis, parseJsonPayload } from "./utils";
|
|
6
6
|
|
|
@@ -17,8 +17,6 @@ import {
|
|
|
17
17
|
googleGeminiCliModelManagerOptions,
|
|
18
18
|
openaiCodexModelManagerOptions,
|
|
19
19
|
PROVIDER_DESCRIPTORS,
|
|
20
|
-
UNK_CONTEXT_WINDOW,
|
|
21
|
-
UNK_MAX_TOKENS,
|
|
22
20
|
} from "@oh-my-pi/pi-catalog/provider-models";
|
|
23
21
|
import {
|
|
24
22
|
collapseBuiltModelVariants,
|
|
@@ -530,9 +528,8 @@ function finalizeCustomModel(model: CustomModelOverlay, options: CustomModelBuil
|
|
|
530
528
|
thinking: resolvedModel.thinking ?? reference?.thinking,
|
|
531
529
|
input: input as ("text" | "image")[],
|
|
532
530
|
cost,
|
|
533
|
-
contextWindow:
|
|
534
|
-
|
|
535
|
-
maxTokens: resolvedModel.maxTokens ?? reference?.maxTokens ?? (options.useDefaults ? 16384 : undefined),
|
|
531
|
+
contextWindow: resolvedModel.contextWindow ?? reference?.contextWindow ?? (options.useDefaults ? 128000 : null),
|
|
532
|
+
maxTokens: resolvedModel.maxTokens ?? reference?.maxTokens ?? (options.useDefaults ? 16384 : null),
|
|
536
533
|
headers: resolvedModel.headers,
|
|
537
534
|
omitMaxOutputTokens: resolvedModel.omitMaxOutputTokens ?? reference?.omitMaxOutputTokens,
|
|
538
535
|
compat: mergeCompat(reference?.compatConfig, resolvedModel.compat),
|
|
@@ -866,11 +863,8 @@ export class ModelRegistry {
|
|
|
866
863
|
if (!existing) return replacementModel;
|
|
867
864
|
return {
|
|
868
865
|
...replacementModel,
|
|
869
|
-
contextWindow:
|
|
870
|
-
|
|
871
|
-
? existing.contextWindow
|
|
872
|
-
: replacementModel.contextWindow,
|
|
873
|
-
maxTokens: replacementModel.maxTokens === UNK_MAX_TOKENS ? existing.maxTokens : replacementModel.maxTokens,
|
|
866
|
+
contextWindow: replacementModel.contextWindow ?? existing.contextWindow,
|
|
867
|
+
maxTokens: replacementModel.maxTokens ?? existing.maxTokens,
|
|
874
868
|
};
|
|
875
869
|
});
|
|
876
870
|
}
|
|
@@ -1739,11 +1733,20 @@ export class ModelRegistry {
|
|
|
1739
1733
|
* paths that pre-flight auth before model resolution) can probe a model
|
|
1740
1734
|
* without resolving an API key. Returns true for keyless providers as well
|
|
1741
1735
|
* as providers with stored credentials. See issue #993.
|
|
1736
|
+
*
|
|
1737
|
+
* Side-effect-free and synchronous: a command-backed key (`!cmd`) counts as
|
|
1738
|
+
* configured by its presence alone — the program is NOT executed — and OAuth
|
|
1739
|
+
* tokens are NOT refreshed (`authStorage.hasAuth`). This is what keeps the
|
|
1740
|
+
* model-switch pre-flight off the event loop's hot path; the real key
|
|
1741
|
+
* (command execution + OAuth refresh) is resolved lazily per request via
|
|
1742
|
+
* {@link ModelRegistry.resolver}.
|
|
1742
1743
|
*/
|
|
1743
1744
|
hasConfiguredAuth(model: Model<Api>): boolean {
|
|
1744
|
-
const
|
|
1745
|
+
const keyConfig = this.#customProviderApiKeys.get(model.provider);
|
|
1745
1746
|
return (
|
|
1746
|
-
|
|
1747
|
+
isCommandConfigValue(keyConfig) ||
|
|
1748
|
+
this.#keylessProviders.has(model.provider) ||
|
|
1749
|
+
this.authStorage.hasAuth(model.provider)
|
|
1747
1750
|
);
|
|
1748
1751
|
}
|
|
1749
1752
|
|
|
@@ -1247,7 +1247,7 @@ export function resolveCliModel(options: {
|
|
|
1247
1247
|
model: undefined,
|
|
1248
1248
|
selector: undefined,
|
|
1249
1249
|
warning: undefined,
|
|
1250
|
-
error: `Unknown provider "${cliProvider}".
|
|
1250
|
+
error: `Unknown provider "${cliProvider}". Run "omp models" to see available providers/models.`,
|
|
1251
1251
|
};
|
|
1252
1252
|
}
|
|
1253
1253
|
|
|
@@ -1337,7 +1337,7 @@ export function resolveCliModel(options: {
|
|
|
1337
1337
|
selector: undefined,
|
|
1338
1338
|
thinkingLevel: undefined,
|
|
1339
1339
|
warning,
|
|
1340
|
-
error: `Model "${display}" not found.
|
|
1340
|
+
error: `Model "${display}" not found. Run "omp models" to see available models.`,
|
|
1341
1341
|
};
|
|
1342
1342
|
}
|
|
1343
1343
|
|
|
@@ -3024,6 +3024,18 @@ export const SETTINGS_SCHEMA = {
|
|
|
3024
3024
|
description: "Launch browser in headless mode (disable to show browser UI)",
|
|
3025
3025
|
},
|
|
3026
3026
|
},
|
|
3027
|
+
|
|
3028
|
+
"browser.cmux": {
|
|
3029
|
+
type: "boolean",
|
|
3030
|
+
default: true,
|
|
3031
|
+
ui: {
|
|
3032
|
+
tab: "tools",
|
|
3033
|
+
group: "Search & Browser",
|
|
3034
|
+
label: "cmux Browser",
|
|
3035
|
+
description:
|
|
3036
|
+
"Use cmux WKWebView surfaces for browser automation when a cmux socket is available. Set PI_BROWSER_CMUX=0 or PI_BROWSER_CMUX=1 to override.",
|
|
3037
|
+
},
|
|
3038
|
+
},
|
|
3027
3039
|
"browser.screenshotDir": {
|
|
3028
3040
|
type: "string",
|
|
3029
3041
|
default: undefined,
|
|
@@ -3527,6 +3539,10 @@ export const SETTINGS_SCHEMA = {
|
|
|
3527
3539
|
|
|
3528
3540
|
"skills.enablePiProject": { type: "boolean", default: true },
|
|
3529
3541
|
|
|
3542
|
+
"skills.enableAgentsUser": { type: "boolean", default: true },
|
|
3543
|
+
|
|
3544
|
+
"skills.enableAgentsProject": { type: "boolean", default: true },
|
|
3545
|
+
|
|
3530
3546
|
"skills.customDirectories": { type: "array", default: [] as string[] },
|
|
3531
3547
|
|
|
3532
3548
|
"skills.ignoredSkills": { type: "array", default: [] as string[] },
|
|
@@ -4138,6 +4154,8 @@ export interface SkillsSettings {
|
|
|
4138
4154
|
enableClaudeProject?: boolean;
|
|
4139
4155
|
enablePiUser?: boolean;
|
|
4140
4156
|
enablePiProject?: boolean;
|
|
4157
|
+
enableAgentsUser?: boolean;
|
|
4158
|
+
enableAgentsProject?: boolean;
|
|
4141
4159
|
customDirectories?: string[];
|
|
4142
4160
|
ignoredSkills?: string[];
|
|
4143
4161
|
includeSkills?: string[];
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* keys without rejection; only `input` is required. `_input` is accepted as a
|
|
5
5
|
* provider-emitted alias for `input`.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import { z } from "zod/v4";
|
|
8
8
|
|
|
9
9
|
export const hashlineEditParamsSchema = z.preprocess(raw => {
|
|
10
10
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* the `patch` mode.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import { z } from "zod/v4";
|
|
12
12
|
import { parseApplyPatch, parseApplyPatchStreaming } from "../apply-patch/parser";
|
|
13
13
|
import { ApplyPatchError } from "../diff";
|
|
14
14
|
import type { PatchEditEntry } from "./patch";
|
package/src/edit/modes/patch.ts
CHANGED
|
@@ -9,7 +9,7 @@ import * as fs from "node:fs";
|
|
|
9
9
|
import * as path from "node:path";
|
|
10
10
|
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
11
11
|
import { isEnoent } from "@oh-my-pi/pi-utils";
|
|
12
|
-
import
|
|
12
|
+
import { z } from "zod/v4";
|
|
13
13
|
import {
|
|
14
14
|
type FileDiagnosticsResult,
|
|
15
15
|
flushLspWritethroughBatch,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* fallback strategies for finding text in files.
|
|
6
6
|
*/
|
|
7
7
|
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
8
|
-
import
|
|
8
|
+
import { z } from "zod/v4";
|
|
9
9
|
import type { WritethroughCallback, WritethroughDeferredHandle } from "../../lsp";
|
|
10
10
|
import type { ToolSession } from "../../tools";
|
|
11
11
|
import { invalidateFsScanAfterWrite } from "../../tools/fs-cache-invalidation";
|
package/src/eval/agent-bridge.ts
CHANGED
|
@@ -5,7 +5,7 @@ import * as fs from "node:fs/promises";
|
|
|
5
5
|
import * as os from "node:os";
|
|
6
6
|
import * as path from "node:path";
|
|
7
7
|
import { prompt, Snowflake } from "@oh-my-pi/pi-utils";
|
|
8
|
-
import
|
|
8
|
+
import { z } from "zod/v4";
|
|
9
9
|
import { resolveAgentModelPatterns } from "../config/model-resolver";
|
|
10
10
|
import type { LocalProtocolOptions } from "../internal-urls";
|
|
11
11
|
import { MCPManager } from "../mcp/manager";
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { instrumentedCompleteSimple, resolveTelemetry } from "@oh-my-pi/pi-agent-core";
|
|
15
15
|
import { type Api, Effort, type Model, type Tool } from "@oh-my-pi/pi-ai";
|
|
16
16
|
import { getSupportedEfforts } from "@oh-my-pi/pi-catalog/model-thinking";
|
|
17
|
-
import
|
|
17
|
+
import { z } from "zod/v4";
|
|
18
18
|
import { extractTextContent, extractToolCall, parseJsonPayload } from "../commit/utils";
|
|
19
19
|
|
|
20
20
|
import {
|
|
@@ -450,6 +450,26 @@
|
|
|
450
450
|
return div.innerHTML;
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
+
function isDotOnlyThinking(text) {
|
|
454
|
+
let sawDot = false;
|
|
455
|
+
for (let i = 0; i < text.length; i++) {
|
|
456
|
+
const code = text.charCodeAt(i);
|
|
457
|
+
if (code === 0x2e || code === 0x2026) {
|
|
458
|
+
sawDot = true;
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
if (code === 0x20 || code === 0x09 || code === 0x0a || code === 0x0d) continue;
|
|
462
|
+
return false;
|
|
463
|
+
}
|
|
464
|
+
return sawDot;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function visibleThinkingText(block) {
|
|
468
|
+
const text = block.thinking.trim();
|
|
469
|
+
if (!text) return '';
|
|
470
|
+
return isDotOnlyThinking(text) ? '' : text;
|
|
471
|
+
}
|
|
472
|
+
|
|
453
473
|
/**
|
|
454
474
|
* Truncate string to maxLen chars, append "..." if truncated.
|
|
455
475
|
*/
|
|
@@ -1056,9 +1076,11 @@
|
|
|
1056
1076
|
for (const block of msg.content) {
|
|
1057
1077
|
if (block.type === 'text' && block.text.trim()) {
|
|
1058
1078
|
html += `<div class="assistant-text markdown-content">${safeMarkedParse(block.text)}</div>`;
|
|
1059
|
-
} else if (block.type === 'thinking'
|
|
1079
|
+
} else if (block.type === 'thinking') {
|
|
1080
|
+
const thinking = visibleThinkingText(block);
|
|
1081
|
+
if (!thinking) continue;
|
|
1060
1082
|
html += `<div class="thinking-block">
|
|
1061
|
-
<div class="thinking-text">${escapeHtml(
|
|
1083
|
+
<div class="thinking-text">${escapeHtml(thinking)}</div>
|
|
1062
1084
|
<div class="thinking-collapsed">Thinking ...</div>
|
|
1063
1085
|
</div>`;
|
|
1064
1086
|
}
|