@oh-my-pi/pi-coding-agent 17.2.3 → 17.2.5
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 +92 -0
- package/dist/{CHANGELOG-c5hpqt9r.md → CHANGELOG-q2w43aw3.md} +92 -0
- package/dist/cli.js +3979 -3548
- package/dist/{template-8vdv6xb4.js → template-c2hyaytt.js} +8 -26
- package/dist/types/advisor/advise-tool.d.ts +6 -0
- package/dist/types/advisor/runtime.d.ts +4 -4
- package/dist/types/capability/mcp.d.ts +9 -0
- package/dist/types/cli/args.d.ts +4 -1
- package/dist/types/cli/browser-relay-cli.d.ts +15 -0
- package/dist/types/cli/command-help.d.ts +99 -0
- package/dist/types/cli/help-extra.d.ts +2 -0
- package/dist/types/cli/models-cli.d.ts +1 -1
- package/dist/types/cli/thinking-levels.d.ts +5 -0
- package/dist/types/cli/update-cli.d.ts +13 -0
- package/dist/types/commands/browser-relay.d.ts +38 -0
- package/dist/types/commands/commit.d.ts +3 -0
- package/dist/types/commands/complete.d.ts +1 -1
- package/dist/types/commands/completions.d.ts +6 -0
- package/dist/types/commands/grep.d.ts +3 -0
- package/dist/types/commands/join.d.ts +4 -0
- package/dist/types/commands/launch-help.d.ts +171 -0
- package/dist/types/commands/launch.d.ts +5 -1
- package/dist/types/commands/models.d.ts +3 -0
- package/dist/types/commands/say.d.ts +10 -0
- package/dist/types/commands/worktree.d.ts +3 -0
- package/dist/types/config/keybindings.d.ts +6 -1
- package/dist/types/config/model-discovery.d.ts +2 -2
- package/dist/types/config/models-config-schema-bundle.d.ts +3 -0
- package/dist/types/config/models-config-schema.d.ts +2 -0
- package/dist/types/config/models-config.d.ts +1 -0
- package/dist/types/config/service-tier.d.ts +2 -0
- package/dist/types/config/settings-schema.d.ts +70 -22
- package/dist/types/cursor-bridge-tools.d.ts +1 -1
- package/dist/types/cursor.d.ts +7 -4
- package/dist/types/discovery/helpers.d.ts +6 -0
- package/dist/types/discovery/omp-extension-roots.d.ts +21 -2
- package/dist/types/edit/index.d.ts +3 -3
- package/dist/types/edit/modes/replace.d.ts +22 -15
- package/dist/types/edit/renderer.d.ts +1 -1
- package/dist/types/eval/py/kernel.d.ts +3 -1
- package/dist/types/eval/py/spawn-options.d.ts +12 -16
- package/dist/types/extensibility/extensions/loader.d.ts +6 -2
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +8 -1
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +1 -1
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +2 -0
- package/dist/types/extensibility/plugins/marketplace/registry.d.ts +2 -2
- package/dist/types/launch/broker.d.ts +1 -1
- package/dist/types/launch/client.d.ts +6 -3
- package/dist/types/launch/ensure.d.ts +8 -0
- package/dist/types/launch/paths.d.ts +3 -2
- package/dist/types/launch/protocol.d.ts +2 -2
- package/dist/types/lsp/client.d.ts +2 -0
- package/dist/types/lsp/mux/daemon.d.ts +15 -0
- package/dist/types/lsp/mux/protocol.d.ts +57 -0
- package/dist/types/lsp/mux/server.d.ts +18 -0
- package/dist/types/lsp/types.d.ts +22 -2
- package/dist/types/main.d.ts +2 -0
- package/dist/types/mcp/request-id.d.ts +19 -0
- package/dist/types/mcp/types.d.ts +14 -0
- package/dist/types/memory-backend/index.d.ts +1 -0
- package/dist/types/memory-backend/messages.d.ts +15 -0
- package/dist/types/mnemopi/embed-client.d.ts +1 -1
- package/dist/types/mnemopi/state.d.ts +0 -23
- package/dist/types/modes/components/assistant-message.d.ts +2 -0
- package/dist/types/modes/components/custom-editor.d.ts +2 -1
- package/dist/types/modes/components/model-browser.d.ts +7 -5
- package/dist/types/modes/components/model-picker.d.ts +9 -3
- package/dist/types/modes/components/read-tool-group.d.ts +11 -0
- package/dist/types/modes/components/stripped-tool-calls-placeholder.d.ts +12 -0
- package/dist/types/modes/components/tool-execution.d.ts +2 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/types.d.ts +2 -1
- package/dist/types/modes/workflow.d.ts +2 -1
- package/dist/types/registry/agent-lifecycle.d.ts +14 -5
- package/dist/types/registry/agent-registry.d.ts +4 -3
- package/dist/types/sdk.d.ts +4 -2
- package/dist/types/secrets/index.d.ts +7 -9
- package/dist/types/session/agent-session-types.d.ts +3 -1
- package/dist/types/session/agent-session.d.ts +6 -1
- package/dist/types/session/indexed-session-storage.d.ts +1 -0
- package/dist/types/session/model-controls.d.ts +0 -1
- package/dist/types/session/session-advisors.d.ts +8 -1
- package/dist/types/session/session-context.d.ts +2 -1
- package/dist/types/session/session-maintenance.d.ts +2 -0
- package/dist/types/session/session-manager.d.ts +16 -5
- package/dist/types/session/session-stats.d.ts +10 -0
- package/dist/types/session/session-storage.d.ts +15 -3
- package/dist/types/system-prompt.d.ts +6 -1
- package/dist/types/task/index.d.ts +2 -1
- package/dist/types/task/spawn-policy.d.ts +5 -0
- package/dist/types/thinking.d.ts +1 -7
- package/dist/types/tools/ast-grep.d.ts +1 -1
- package/dist/types/tools/browser/registry.d.ts +2 -1
- package/dist/types/tools/browser/relay/bridge.d.ts +35 -0
- package/dist/types/tools/browser/relay/daemon.d.ts +16 -0
- package/dist/types/tools/browser/relay/kind.d.ts +19 -0
- package/dist/types/tools/browser/relay/protocol.d.ts +97 -0
- package/dist/types/tools/browser/relay/server.d.ts +35 -0
- package/dist/types/tools/browser/render.d.ts +1 -0
- package/dist/types/tools/browser.d.ts +3 -0
- package/dist/types/tools/computer/exposure.d.ts +9 -7
- package/dist/types/tools/computer/protocol.d.ts +70 -17
- package/dist/types/tools/computer/supervisor.d.ts +23 -10
- package/dist/types/tools/computer/worker-entry.d.ts +1 -0
- package/dist/types/tools/computer/worker.d.ts +42 -7
- package/dist/types/tools/computer-renderer.d.ts +7 -5
- package/dist/types/tools/computer.d.ts +25 -44
- package/dist/types/tools/context.d.ts +3 -0
- package/dist/types/tools/default-renderer.d.ts +3 -0
- package/dist/types/tools/glob.d.ts +1 -1
- package/dist/types/tools/grep.d.ts +1 -1
- package/dist/types/tools/render-utils.d.ts +2 -0
- package/dist/types/tools/{browser/run-cancellation.d.ts → run-scope.d.ts} +8 -8
- package/dist/types/tools/tool-timeouts.d.ts +5 -0
- package/dist/types/tools/xdev.d.ts +8 -0
- package/dist/types/utils/clipboard.d.ts +2 -2
- package/dist/types/web/kagi.d.ts +1 -0
- package/dist/types/web/search/index.d.ts +1 -1
- package/dist/types/web/search/providers/anthropic.d.ts +1 -0
- package/dist/types/web/search/providers/base.d.ts +2 -0
- package/dist/types/web/search/providers/brave.d.ts +1 -0
- package/dist/types/web/search/providers/browser-page.d.ts +1 -0
- package/dist/types/web/search/providers/codex.d.ts +1 -0
- package/dist/types/web/search/providers/exa.d.ts +1 -0
- package/dist/types/web/search/providers/firecrawl.d.ts +1 -0
- package/dist/types/web/search/providers/gemini.d.ts +1 -0
- package/dist/types/web/search/providers/jina.d.ts +1 -0
- package/dist/types/web/search/providers/kagi.d.ts +1 -0
- package/dist/types/web/search/providers/kimi.d.ts +1 -0
- package/dist/types/web/search/providers/parallel.d.ts +1 -0
- package/dist/types/web/search/providers/perplexity.d.ts +1 -0
- package/dist/types/web/search/providers/searxng.d.ts +1 -0
- package/dist/types/web/search/providers/tavily.d.ts +1 -0
- package/dist/types/web/search/providers/tinyfish.d.ts +1 -0
- package/dist/types/web/search/providers/utils.d.ts +6 -9
- package/dist/types/web/search/providers/zai.d.ts +1 -0
- package/dist/types/web/search/types.d.ts +4 -0
- package/package.json +12 -12
- package/scripts/legacy-pi-virtual-module.ts +12 -2
- package/src/advisor/advise-tool.ts +18 -0
- package/src/advisor/runtime.ts +6 -6
- package/src/capability/mcp.ts +7 -0
- package/src/cli/args.ts +7 -87
- package/src/cli/browser-relay-cli.ts +119 -0
- package/src/cli/command-help.ts +103 -0
- package/src/cli/completion-gen.ts +5 -5
- package/src/cli/flag-tables.ts +9 -0
- package/src/cli/help-extra.ts +89 -0
- package/src/cli/models-cli.ts +13 -16
- package/src/cli/setup-cli.ts +13 -21
- package/src/cli/thinking-levels.ts +7 -0
- package/src/cli/update-cli.ts +26 -7
- package/src/cli-commands.ts +170 -33
- package/src/cli.ts +17 -5
- package/src/collab/host.ts +1 -1
- package/src/commands/acp.ts +3 -1
- package/src/commands/agents.ts +3 -2
- package/src/commands/auth-broker.ts +3 -2
- package/src/commands/auth-gateway.ts +3 -2
- package/src/commands/bench.ts +2 -3
- package/src/commands/browser-relay.ts +53 -0
- package/src/commands/cleanse.ts +2 -2
- package/src/commands/commit.ts +3 -2
- package/src/commands/complete.ts +2 -1
- package/src/commands/completions.ts +3 -2
- package/src/commands/config.ts +3 -2
- package/src/commands/dry-balance.ts +2 -2
- package/src/commands/gallery.ts +3 -2
- package/src/commands/gc.ts +3 -2
- package/src/commands/grep.ts +3 -2
- package/src/commands/grievances.ts +3 -2
- package/src/commands/install.ts +2 -2
- package/src/commands/join.ts +3 -2
- package/src/commands/launch-help.ts +116 -0
- package/src/commands/launch.ts +7 -191
- package/src/commands/models.ts +3 -2
- package/src/commands/plugin.ts +3 -2
- package/src/commands/read.ts +3 -2
- package/src/commands/say.ts +3 -2
- package/src/commands/setup.ts +3 -2
- package/src/commands/shell.ts +3 -2
- package/src/commands/ssh.ts +3 -2
- package/src/commands/stats.ts +3 -2
- package/src/commands/tiny-models.ts +2 -2
- package/src/commands/token.ts +2 -2
- package/src/commands/ttsr.ts +2 -2
- package/src/commands/update.ts +3 -2
- package/src/commands/usage.ts +3 -2
- package/src/commands/web-search.ts +3 -2
- package/src/commands/worktree.ts +3 -2
- package/src/config/keybindings.ts +19 -9
- package/src/config/mcp-schema.json +5 -0
- package/src/config/model-discovery.ts +30 -13
- package/src/config/model-registry.ts +16 -6
- package/src/config/models-config-schema-bundle.ts +9 -0
- package/src/config/resolve-config-value.ts +2 -1
- package/src/config/service-tier.ts +5 -0
- package/src/config/settings-schema.ts +73 -21
- package/src/cursor-bridge-tools.ts +1 -1
- package/src/cursor.ts +10 -14
- package/src/discovery/builtin.ts +10 -0
- package/src/discovery/helpers.ts +10 -0
- package/src/discovery/mcp-json.ts +11 -1
- package/src/discovery/omp-extension-roots.ts +79 -20
- package/src/discovery/omp-plugins.ts +10 -1
- package/src/edit/diff.ts +17 -8
- package/src/edit/index.ts +20 -7
- package/src/edit/modes/replace.ts +93 -40
- package/src/edit/renderer.ts +1 -1
- package/src/edit/streaming.ts +14 -17
- package/src/eval/py/kernel.ts +2 -1
- package/src/eval/py/spawn-options.ts +24 -29
- package/src/export/html/template.js +8 -26
- package/src/extensibility/extensions/loader.ts +66 -28
- package/src/extensibility/extensions/wrapper.ts +1 -0
- package/src/extensibility/legacy-pi-ai-shim.ts +22 -1
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +7 -6
- package/src/extensibility/plugins/legacy-pi-compat.ts +124 -57
- package/src/extensibility/plugins/marketplace/registry.ts +4 -8
- package/src/extensibility/skills.ts +11 -0
- package/src/extensibility/utils.ts +10 -2
- package/src/launch/broker.ts +1 -1
- package/src/launch/client.ts +32 -13
- package/src/launch/ensure.ts +73 -0
- package/src/launch/paths.ts +3 -6
- package/src/launch/protocol.ts +2 -2
- package/src/lsp/client.ts +23 -2
- package/src/lsp/index.ts +8 -0
- package/src/lsp/mux/daemon.ts +348 -0
- package/src/lsp/mux/protocol.ts +96 -0
- package/src/lsp/mux/server.ts +797 -0
- package/src/lsp/types.ts +28 -2
- package/src/main.ts +31 -24
- package/src/mcp/config.ts +1 -0
- package/src/mcp/oauth-flow.ts +11 -1
- package/src/mcp/request-id.ts +24 -0
- package/src/mcp/transports/http.ts +4 -2
- package/src/mcp/transports/sse.ts +4 -2
- package/src/mcp/transports/stdio.ts +4 -2
- package/src/mcp/types.ts +15 -0
- package/src/memory-backend/index.ts +1 -0
- package/src/memory-backend/messages.ts +19 -0
- package/src/mnemopi/embed-client.ts +49 -2
- package/src/mnemopi/state.ts +57 -23
- package/src/modes/components/agent-hub.ts +1 -1
- package/src/modes/components/assistant-message.ts +11 -0
- package/src/modes/components/chat-transcript-builder.ts +4 -0
- package/src/modes/components/custom-editor.ts +10 -1
- package/src/modes/components/model-browser.ts +25 -17
- package/src/modes/components/model-picker.ts +10 -6
- package/src/modes/components/read-tool-group.ts +36 -0
- package/src/modes/components/status-line/component.ts +1 -1
- package/src/modes/components/stripped-tool-calls-placeholder.ts +35 -0
- package/src/modes/components/tool-execution.ts +85 -20
- package/src/modes/components/tree-selector.ts +46 -48
- package/src/modes/controllers/command-controller.ts +2 -2
- package/src/modes/controllers/event-controller.ts +199 -10
- package/src/modes/controllers/input-controller.ts +39 -1
- package/src/modes/controllers/mcp-command-controller.ts +11 -5
- package/src/modes/controllers/selector-controller.ts +47 -6
- package/src/modes/interactive-mode.ts +2 -0
- package/src/modes/types.ts +6 -1
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/modes/utils/interactive-context-helpers.ts +1 -0
- package/src/modes/utils/ui-helpers.ts +6 -10
- package/src/modes/workflow.ts +8 -2
- package/src/prompts/agents/init.md +1 -1
- package/src/prompts/system/plan-mode-active.md +2 -2
- package/src/prompts/system/system-prompt.md +26 -52
- package/src/prompts/system/workflow-notice.md +3 -3
- package/src/prompts/tools/ast-grep.md +1 -1
- package/src/prompts/tools/bash.md +1 -1
- package/src/prompts/tools/browser.md +1 -0
- package/src/prompts/tools/computer.md +21 -21
- package/src/prompts/tools/glob.md +1 -1
- package/src/prompts/tools/grep.md +1 -1
- package/src/prompts/tools/replace.md +5 -4
- package/src/prompts/tools/task.md +4 -4
- package/src/registry/agent-lifecycle.ts +36 -11
- package/src/registry/agent-registry.ts +12 -5
- package/src/sdk.ts +102 -35
- package/src/secrets/index.ts +16 -18
- package/src/session/agent-session-types.ts +3 -1
- package/src/session/agent-session.ts +23 -2
- package/src/session/agent-storage.ts +6 -4
- package/src/session/history-storage.ts +4 -2
- package/src/session/indexed-session-storage.ts +9 -0
- package/src/session/messages.ts +31 -7
- package/src/session/model-controls.ts +0 -1
- package/src/session/prewalk.ts +24 -2
- package/src/session/session-advisors.ts +21 -3
- package/src/session/session-context.ts +16 -12
- package/src/session/session-dump-format.ts +1 -1
- package/src/session/session-maintenance.ts +41 -4
- package/src/session/session-manager.ts +181 -94
- package/src/session/session-paths.ts +118 -55
- package/src/session/session-stats.ts +48 -3
- package/src/session/session-storage.ts +30 -22
- package/src/session/session-tools.ts +25 -23
- package/src/session/stream-guards.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +29 -26
- package/src/system-prompt.ts +14 -4
- package/src/task/executor.ts +8 -1
- package/src/task/index.ts +23 -8
- package/src/task/spawn-policy.ts +14 -0
- package/src/thinking.ts +2 -8
- package/src/tiny/text.ts +12 -0
- package/src/tools/ast-grep.ts +10 -4
- package/src/tools/browser/cmux/cmux-tab.ts +5 -10
- package/src/tools/browser/cmux/rpc.ts +2 -8
- package/src/tools/browser/registry.ts +53 -2
- package/src/tools/browser/relay/bridge.ts +945 -0
- package/src/tools/browser/relay/daemon.ts +117 -0
- package/src/tools/browser/relay/extension-assets/background.js.txt +242 -0
- package/src/tools/browser/relay/extension-assets/manifest.json.txt +14 -0
- package/src/tools/browser/relay/extension-assets/options.html.txt +53 -0
- package/src/tools/browser/relay/extension-assets/options.js.txt +23 -0
- package/src/tools/browser/relay/kind.ts +41 -0
- package/src/tools/browser/relay/protocol.ts +54 -0
- package/src/tools/browser/relay/server.ts +141 -0
- package/src/tools/browser/render.ts +4 -1
- package/src/tools/browser/shared-daemon.ts +7 -58
- package/src/tools/browser/tab-supervisor.ts +5 -4
- package/src/tools/browser/tab-worker.ts +33 -12
- package/src/tools/browser.ts +26 -1
- package/src/tools/computer/exposure.ts +11 -35
- package/src/tools/computer/protocol.ts +51 -10
- package/src/tools/computer/supervisor.ts +227 -124
- package/src/tools/computer/worker-entry.ts +11 -6
- package/src/tools/computer/worker.ts +695 -81
- package/src/tools/computer-renderer.ts +104 -65
- package/src/tools/computer.ts +134 -428
- package/src/tools/context.ts +3 -0
- package/src/tools/default-renderer.ts +19 -4
- package/src/tools/glob.ts +9 -2
- package/src/tools/grep.ts +12 -6
- package/src/tools/index.ts +10 -6
- package/src/tools/inspect-image.ts +32 -6
- package/src/tools/render-utils.ts +2 -0
- package/src/tools/{browser/run-cancellation.ts → run-scope.ts} +11 -11
- package/src/tools/tool-timeouts.ts +1 -0
- package/src/tools/xdev.ts +29 -2
- package/src/utils/clipboard.ts +40 -14
- package/src/utils/command-args.ts +26 -28
- package/src/utils/tool-choice.ts +0 -13
- package/src/web/kagi.ts +2 -1
- package/src/web/search/index.ts +18 -2
- package/src/web/search/providers/anthropic.ts +7 -2
- package/src/web/search/providers/base.ts +2 -0
- package/src/web/search/providers/brave.ts +3 -1
- package/src/web/search/providers/browser-page.ts +6 -4
- package/src/web/search/providers/codex.ts +4 -1
- package/src/web/search/providers/duckduckgo.ts +2 -1
- package/src/web/search/providers/ecosia.ts +2 -1
- package/src/web/search/providers/exa.ts +4 -2
- package/src/web/search/providers/firecrawl.ts +3 -1
- package/src/web/search/providers/gemini.ts +8 -2
- package/src/web/search/providers/google.ts +2 -1
- package/src/web/search/providers/jina.ts +12 -2
- package/src/web/search/providers/kagi.ts +3 -0
- package/src/web/search/providers/kimi.ts +5 -1
- package/src/web/search/providers/mojeek.ts +2 -1
- package/src/web/search/providers/parallel.ts +5 -1
- package/src/web/search/providers/perplexity.ts +6 -3
- package/src/web/search/providers/public.ts +1 -1
- package/src/web/search/providers/searxng.ts +11 -5
- package/src/web/search/providers/startpage.ts +10 -4
- package/src/web/search/providers/synthetic.ts +11 -5
- package/src/web/search/providers/tavily.ts +3 -1
- package/src/web/search/providers/tinyfish.ts +3 -1
- package/src/web/search/providers/utils.ts +12 -10
- package/src/web/search/providers/xai.ts +2 -2
- package/src/web/search/providers/zai.ts +18 -3
- package/src/web/search/types.ts +6 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Args, Command, Flags } from "@oh-my-pi/pi-utils/cli";
|
|
2
|
+
import { tinyModelsHelp as commandHelp } from "../cli/command-help";
|
|
2
3
|
import { runTinyModelsCommand, type TinyModelsAction, type TinyModelsCommandArgs } from "../cli/tiny-models-cli";
|
|
3
4
|
|
|
4
5
|
const ACTIONS: TinyModelsAction[] = ["download", "list"];
|
|
5
6
|
|
|
6
7
|
export default class TinyModels extends Command {
|
|
7
|
-
static description =
|
|
8
|
-
|
|
8
|
+
static description = commandHelp.description;
|
|
9
9
|
static args = {
|
|
10
10
|
action: Args.string({
|
|
11
11
|
description: "Action to perform",
|
package/src/commands/token.ts
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
import { PROVIDER_REGISTRY } from "@oh-my-pi/pi-ai";
|
|
6
6
|
import { Args, Command, Flags } from "@oh-my-pi/pi-utils/cli";
|
|
7
7
|
import chalk from "chalk";
|
|
8
|
+
import { tokenHelp as commandHelp } from "../cli/command-help";
|
|
8
9
|
import { isAuthenticated, ModelRegistry } from "../config/model-registry";
|
|
9
10
|
import { discoverAuthStorage } from "../sdk";
|
|
10
11
|
import { getAvailableAuthMethods } from "../web/search/providers/perplexity-auth";
|
|
11
12
|
|
|
12
13
|
export default class Token extends Command {
|
|
13
|
-
static description =
|
|
14
|
-
|
|
14
|
+
static description = commandHelp.description;
|
|
15
15
|
static args = {
|
|
16
16
|
provider: Args.string({
|
|
17
17
|
description: "Provider ID (e.g. anthropic, openai)",
|
package/src/commands/ttsr.ts
CHANGED
|
@@ -8,6 +8,7 @@ import * as path from "node:path";
|
|
|
8
8
|
* shows every TTSR-registered rule the current project/user config would load.
|
|
9
9
|
*/
|
|
10
10
|
import { Args, Command, Flags } from "@oh-my-pi/pi-utils/cli";
|
|
11
|
+
import { ttsrHelp as commandHelp } from "../cli/command-help";
|
|
11
12
|
import {
|
|
12
13
|
runTtsrCommand,
|
|
13
14
|
TTSR_ACTIONS,
|
|
@@ -19,8 +20,7 @@ import {
|
|
|
19
20
|
import type { TtsrMatchSource } from "../export/ttsr";
|
|
20
21
|
|
|
21
22
|
export default class Ttsr extends Command {
|
|
22
|
-
static description =
|
|
23
|
-
|
|
23
|
+
static description = commandHelp.description;
|
|
24
24
|
static args = {
|
|
25
25
|
action: Args.string({
|
|
26
26
|
description: "TTSR action",
|
package/src/commands/update.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Check for and install updates.
|
|
3
3
|
*/
|
|
4
|
+
|
|
4
5
|
import { Command, Flags } from "@oh-my-pi/pi-utils/cli";
|
|
6
|
+
import { updateHelp as commandHelp } from "../cli/command-help";
|
|
5
7
|
import * as pluginCli from "../cli/plugin-cli";
|
|
6
8
|
import * as updateCli from "../cli/update-cli";
|
|
7
9
|
import { initTheme } from "../modes/theme/theme";
|
|
8
10
|
|
|
9
11
|
export default class Update extends Command {
|
|
10
|
-
static description =
|
|
11
|
-
|
|
12
|
+
static description = commandHelp.description;
|
|
12
13
|
static flags = {
|
|
13
14
|
force: Flags.boolean({ char: "f", description: "Force update", default: false }),
|
|
14
15
|
check: Flags.boolean({ char: "c", description: "Check for updates without installing", default: false }),
|
package/src/commands/usage.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Show provider usage limits for every authenticated account.
|
|
3
3
|
*/
|
|
4
|
+
|
|
4
5
|
import { Args, Command, Flags } from "@oh-my-pi/pi-utils/cli";
|
|
6
|
+
import { usageHelp as commandHelp } from "../cli/command-help";
|
|
5
7
|
import { runUsageCommand } from "../cli/usage-cli";
|
|
6
8
|
|
|
7
9
|
export default class Usage extends Command {
|
|
8
|
-
static description =
|
|
9
|
-
|
|
10
|
+
static description = commandHelp.description;
|
|
10
11
|
static args = {
|
|
11
12
|
action: Args.string({
|
|
12
13
|
description: "Optional subcommand to execute",
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Test web search providers.
|
|
3
3
|
*/
|
|
4
|
+
|
|
4
5
|
import { Args, Command, Flags } from "@oh-my-pi/pi-utils/cli";
|
|
6
|
+
import { searchHelp as commandHelp } from "../cli/command-help";
|
|
5
7
|
import { runSearchCommand, type SearchCommandArgs } from "../cli/web-search-cli";
|
|
6
8
|
import { SEARCH_PROVIDER_ORDER } from "../web/search/provider";
|
|
7
9
|
|
|
@@ -10,8 +12,7 @@ const PROVIDERS: Array<string> = ["auto", ...SEARCH_PROVIDER_ORDER];
|
|
|
10
12
|
const RECENCY: NonNullable<SearchCommandArgs["recency"]>[] = ["day", "week", "month", "year"];
|
|
11
13
|
|
|
12
14
|
export default class Search extends Command {
|
|
13
|
-
static description =
|
|
14
|
-
|
|
15
|
+
static description = commandHelp.description;
|
|
15
16
|
static aliases = ["q"];
|
|
16
17
|
|
|
17
18
|
static args = {
|
package/src/commands/worktree.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* List and clean up agent-managed git worktrees under `~/.omp/wt`.
|
|
3
3
|
*/
|
|
4
|
+
|
|
4
5
|
import { getProjectDir } from "@oh-my-pi/pi-utils";
|
|
5
6
|
import { Args, Command, Flags } from "@oh-my-pi/pi-utils/cli";
|
|
7
|
+
import { worktreeHelp as commandHelp } from "../cli/command-help";
|
|
6
8
|
import { clearWorktrees, listWorktrees } from "../cli/worktree-cli";
|
|
7
9
|
import { Settings } from "../config/settings";
|
|
8
10
|
|
|
9
11
|
export default class Worktree extends Command {
|
|
10
|
-
static description =
|
|
11
|
-
|
|
12
|
+
static description = commandHelp.description;
|
|
12
13
|
static aliases = ["wt"];
|
|
13
14
|
|
|
14
15
|
static args = {
|
|
@@ -29,6 +29,7 @@ interface AppKeybindings {
|
|
|
29
29
|
"app.model.select": true;
|
|
30
30
|
"app.model.selectTemporary": true;
|
|
31
31
|
"app.tools.expand": true;
|
|
32
|
+
"app.tools.toggleVisibility": true;
|
|
32
33
|
"app.editor.external": true;
|
|
33
34
|
"app.message.followUp": true;
|
|
34
35
|
"app.retry": true;
|
|
@@ -124,6 +125,10 @@ export const KEYBINDINGS = {
|
|
|
124
125
|
defaultKeys: "ctrl+o",
|
|
125
126
|
description: "Expand tools",
|
|
126
127
|
},
|
|
128
|
+
"app.tools.toggleVisibility": {
|
|
129
|
+
defaultKeys: "ctrl+shift+o",
|
|
130
|
+
description: "Show or hide tool activity",
|
|
131
|
+
},
|
|
127
132
|
"app.editor.external": {
|
|
128
133
|
defaultKeys: "ctrl+g",
|
|
129
134
|
description: "Open external editor",
|
|
@@ -140,7 +145,9 @@ export const KEYBINDINGS = {
|
|
|
140
145
|
description: "Retry last failed assistant turn",
|
|
141
146
|
},
|
|
142
147
|
"app.message.dequeue": {
|
|
143
|
-
|
|
148
|
+
// Shift+Up is listed alongside Alt+Up because macOS Terminal.app consumes Option
|
|
149
|
+
// for character composition, leaving Alt+Up unreachable there.
|
|
150
|
+
defaultKeys: ["alt+up", "shift+up"],
|
|
144
151
|
description: "Dequeue message",
|
|
145
152
|
},
|
|
146
153
|
"app.clipboard.pasteImage": {
|
|
@@ -516,6 +523,13 @@ function migrateKeybindingsConfigFile(agentDir: string): void {
|
|
|
516
523
|
|
|
517
524
|
const FOLLOW_UP_KEYBINDING: AppKeybinding = "app.message.followUp";
|
|
518
525
|
const WINDOWS_FOLLOW_UP_FALLBACK_KEY: KeyId = "ctrl+q";
|
|
526
|
+
const DEQUEUE_KEYBINDING: AppKeybinding = "app.message.dequeue";
|
|
527
|
+
const MACOS_DEQUEUE_FALLBACK_KEY: KeyId = "shift+up";
|
|
528
|
+
function getFallbackKey(keybinding: Keybinding): KeyId | undefined {
|
|
529
|
+
if (keybinding === FOLLOW_UP_KEYBINDING) return WINDOWS_FOLLOW_UP_FALLBACK_KEY;
|
|
530
|
+
if (keybinding === DEQUEUE_KEYBINDING) return MACOS_DEQUEUE_FALLBACK_KEY;
|
|
531
|
+
return undefined;
|
|
532
|
+
}
|
|
519
533
|
function keyListIncludes(keys: KeyId | KeyId[] | undefined, target: KeyId): boolean {
|
|
520
534
|
if (keys === undefined) return false;
|
|
521
535
|
const keyList = Array.isArray(keys) ? keys : [keys];
|
|
@@ -600,14 +614,10 @@ export class KeybindingsManager extends TuiKeybindingsManager {
|
|
|
600
614
|
|
|
601
615
|
getKeys(keybinding: Keybinding): KeyId[] {
|
|
602
616
|
const keys = super.getKeys(keybinding);
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
return removeKey(keys, WINDOWS_FOLLOW_UP_FALLBACK_KEY);
|
|
609
|
-
}
|
|
610
|
-
return keys;
|
|
617
|
+
const fallbackKey = getFallbackKey(keybinding);
|
|
618
|
+
if (fallbackKey === undefined || this.#userBindings[keybinding] !== undefined) return keys;
|
|
619
|
+
if (!userBindingClaimsKey(this.#userBindings, fallbackKey, keybinding)) return keys;
|
|
620
|
+
return removeKey(keys, fallbackKey);
|
|
611
621
|
}
|
|
612
622
|
|
|
613
623
|
getResolvedBindings(): KeybindingsConfig {
|
|
@@ -118,6 +118,11 @@
|
|
|
118
118
|
"minimum": 0,
|
|
119
119
|
"description": "MCP request timeout in milliseconds. Set to 0 to disable client-side MCP timeouts."
|
|
120
120
|
},
|
|
121
|
+
"requestIdFormat": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"enum": ["string", "number"],
|
|
124
|
+
"description": "Encoding for outgoing JSON-RPC request ids (default: \"number\"). Use \"string\" for servers that need collision-resistant snowflake string ids instead of per-transport integers. OMP-specific: set it in an OMP-owned config (`.omp/mcp.json`, `~/.omp/agent/mcp.json`, a project `mcp.json`/`.mcp.json`, or an OMP plugin). Servers imported from another tool's config (Claude, Cursor, VS Code, Gemini, OpenCode, Windsurf) ignore it, since that key is not part of those formats."
|
|
125
|
+
},
|
|
121
126
|
"auth": {
|
|
122
127
|
"$ref": "#/$defs/authConfig"
|
|
123
128
|
},
|
|
@@ -76,7 +76,10 @@ const REMOTE_DISCOVERY_TIMEOUT_MS = 10_000;
|
|
|
76
76
|
* empty (issue #7087). Anything that is not strictly loopback therefore gets
|
|
77
77
|
* {@link REMOTE_DISCOVERY_TIMEOUT_MS}.
|
|
78
78
|
*/
|
|
79
|
-
export function discoveryProbeTimeoutMs(baseUrl: string, loopbackMs: number): number {
|
|
79
|
+
export function discoveryProbeTimeoutMs(baseUrl: string, loopbackMs: number, customTimeoutMs?: number): number {
|
|
80
|
+
if (typeof customTimeoutMs === "number" && customTimeoutMs > 0 && Number.isFinite(customTimeoutMs)) {
|
|
81
|
+
return customTimeoutMs;
|
|
82
|
+
}
|
|
80
83
|
let hostname: string;
|
|
81
84
|
try {
|
|
82
85
|
hostname = new URL(baseUrl).hostname;
|
|
@@ -415,10 +418,11 @@ async function discoverOllamaModelMetadata(
|
|
|
415
418
|
endpoint: string,
|
|
416
419
|
modelId: string,
|
|
417
420
|
headers: Record<string, string> | undefined,
|
|
421
|
+
customTimeoutMs?: number,
|
|
418
422
|
): Promise<OllamaDiscoveredModelMetadata | null> {
|
|
419
423
|
const showUrl = `${endpoint}/api/show`;
|
|
420
424
|
try {
|
|
421
|
-
const payload = await withTimeoutSignal(discoveryProbeTimeoutMs(endpoint, 150), async signal => {
|
|
425
|
+
const payload = await withTimeoutSignal(discoveryProbeTimeoutMs(endpoint, 150, customTimeoutMs), async signal => {
|
|
422
426
|
const response = await ctx.fetch(showUrl, {
|
|
423
427
|
method: "POST",
|
|
424
428
|
headers: { ...(headers ?? {}), "Content-Type": "application/json" },
|
|
@@ -471,7 +475,8 @@ export async function discoverOllamaModels(
|
|
|
471
475
|
const endpoint = normalizeOllamaBaseUrl(providerConfig.baseUrl);
|
|
472
476
|
const tagsUrl = `${endpoint}/api/tags`;
|
|
473
477
|
const headers = { ...(providerConfig.headers ?? {}) };
|
|
474
|
-
const
|
|
478
|
+
const customTimeoutMs = providerConfig.discovery.timeoutMs;
|
|
479
|
+
const payload = await withTimeoutSignal(discoveryProbeTimeoutMs(endpoint, 250, customTimeoutMs), async signal => {
|
|
475
480
|
const response = await ctx.fetch(tagsUrl, {
|
|
476
481
|
headers,
|
|
477
482
|
signal,
|
|
@@ -488,7 +493,11 @@ export async function discoverOllamaModels(
|
|
|
488
493
|
const metadataById = new Map(
|
|
489
494
|
await Promise.all(
|
|
490
495
|
entries.map(
|
|
491
|
-
async entry =>
|
|
496
|
+
async entry =>
|
|
497
|
+
[
|
|
498
|
+
entry.id,
|
|
499
|
+
await discoverOllamaModelMetadata(ctx, endpoint, entry.id, headers, customTimeoutMs),
|
|
500
|
+
] as const,
|
|
492
501
|
),
|
|
493
502
|
),
|
|
494
503
|
);
|
|
@@ -515,10 +524,11 @@ async function discoverLlamaCppServerMetadata(
|
|
|
515
524
|
ctx: DiscoveryContext,
|
|
516
525
|
baseUrl: string,
|
|
517
526
|
headers: Record<string, string> | undefined,
|
|
527
|
+
customTimeoutMs?: number,
|
|
518
528
|
): Promise<LlamaCppDiscoveredServerMetadata | null> {
|
|
519
529
|
const propsUrl = `${toLlamaCppNativeBaseUrl(baseUrl)}/props`;
|
|
520
530
|
try {
|
|
521
|
-
const payload = await withTimeoutSignal(discoveryProbeTimeoutMs(baseUrl, 150), async signal => {
|
|
531
|
+
const payload = await withTimeoutSignal(discoveryProbeTimeoutMs(baseUrl, 150, customTimeoutMs), async signal => {
|
|
522
532
|
const response = await ctx.fetch(propsUrl, {
|
|
523
533
|
headers,
|
|
524
534
|
signal,
|
|
@@ -592,9 +602,10 @@ export async function discoverLlamaCppModels(
|
|
|
592
602
|
|
|
593
603
|
const baseHeaders: Record<string, string> = { ...(providerConfig.headers ?? {}) };
|
|
594
604
|
let headers = baseHeaders;
|
|
605
|
+
const customTimeoutMs = providerConfig.discovery.timeoutMs;
|
|
595
606
|
const attempt = async (h: Record<string, string>) => {
|
|
596
607
|
const [payload, metadata] = await Promise.all([
|
|
597
|
-
withTimeoutSignal(discoveryProbeTimeoutMs(baseUrl, 250), async signal => {
|
|
608
|
+
withTimeoutSignal(discoveryProbeTimeoutMs(baseUrl, 250, customTimeoutMs), async signal => {
|
|
598
609
|
const response = await ctx.fetch(modelsUrl, {
|
|
599
610
|
headers: h,
|
|
600
611
|
signal,
|
|
@@ -605,7 +616,7 @@ export async function discoverLlamaCppModels(
|
|
|
605
616
|
headers = h;
|
|
606
617
|
return (await response.json()) as unknown;
|
|
607
618
|
}),
|
|
608
|
-
discoverLlamaCppServerMetadata(ctx, baseUrl, h),
|
|
619
|
+
discoverLlamaCppServerMetadata(ctx, baseUrl, h, customTimeoutMs),
|
|
609
620
|
]);
|
|
610
621
|
return [payload, metadata] as const;
|
|
611
622
|
};
|
|
@@ -657,6 +668,7 @@ export async function discoverLlamaCppModels(
|
|
|
657
668
|
export async function discoverLlamaCppModelRuntimeMetadata(
|
|
658
669
|
model: Pick<Model<Api>, "provider" | "id" | "baseUrl" | "headers">,
|
|
659
670
|
ctx: DiscoveryContext,
|
|
671
|
+
customTimeoutMs?: number,
|
|
660
672
|
): Promise<LlamaCppDiscoveredModelRuntimeMetadata | undefined> {
|
|
661
673
|
const baseUrl = normalizeLlamaCppBaseUrl(model.baseUrl);
|
|
662
674
|
// Probe the native `/models` endpoint (not the OpenAI-compatible `/v1/models`)
|
|
@@ -668,7 +680,7 @@ export async function discoverLlamaCppModelRuntimeMetadata(
|
|
|
668
680
|
const baseHeaders: Record<string, string> = { ...(model.headers ?? {}) };
|
|
669
681
|
const attempt = async (headers: Record<string, string>) => {
|
|
670
682
|
const [entries, serverMetadata] = await Promise.all([
|
|
671
|
-
withTimeoutSignal(discoveryProbeTimeoutMs(nativeBaseUrl, 250), async signal => {
|
|
683
|
+
withTimeoutSignal(discoveryProbeTimeoutMs(nativeBaseUrl, 250, customTimeoutMs), async signal => {
|
|
672
684
|
const response = await ctx.fetch(modelsUrl, {
|
|
673
685
|
headers,
|
|
674
686
|
signal,
|
|
@@ -678,7 +690,7 @@ export async function discoverLlamaCppModelRuntimeMetadata(
|
|
|
678
690
|
}
|
|
679
691
|
return parseLlamaCppModelList(await response.json());
|
|
680
692
|
}),
|
|
681
|
-
discoverLlamaCppServerMetadata(ctx, nativeBaseUrl, headers),
|
|
693
|
+
discoverLlamaCppServerMetadata(ctx, nativeBaseUrl, headers, customTimeoutMs),
|
|
682
694
|
]);
|
|
683
695
|
if (!entries) {
|
|
684
696
|
return undefined;
|
|
@@ -721,13 +733,16 @@ export async function discoverOpenAIModelsList(
|
|
|
721
733
|
|
|
722
734
|
const baseHeaders: Record<string, string> = { ...(providerConfig.headers ?? {}) };
|
|
723
735
|
let headers = baseHeaders;
|
|
736
|
+
const timeoutMs = providerConfig.discovery.timeoutMs ?? 10_000;
|
|
724
737
|
const attempt = async (h: Record<string, string>) => {
|
|
725
738
|
const nativeMetadataPromise =
|
|
726
739
|
providerConfig.discovery.type === "lm-studio"
|
|
727
|
-
?
|
|
740
|
+
? withTimeoutSignal(timeoutMs, signal =>
|
|
741
|
+
fetchLmStudioNativeModelMetadata(baseUrl, ctx.fetch, { headers: h, signal }),
|
|
742
|
+
)
|
|
728
743
|
: Promise.resolve(null);
|
|
729
744
|
const [payload, nativeMetadata] = await Promise.all([
|
|
730
|
-
withTimeoutSignal(
|
|
745
|
+
withTimeoutSignal(timeoutMs, async signal => {
|
|
731
746
|
const res = await ctx.fetch(modelsUrl, {
|
|
732
747
|
headers: h,
|
|
733
748
|
signal,
|
|
@@ -819,6 +834,7 @@ export async function discoverLiteLLMModels(
|
|
|
819
834
|
const resolveReference = (id: string) => resolveModelReference(id, references) as ModelSpec<Api> | undefined;
|
|
820
835
|
const baseHeaders: Record<string, string> = { ...(providerConfig.headers ?? {}) };
|
|
821
836
|
let headers = baseHeaders;
|
|
837
|
+
const timeoutMs = providerConfig.discovery.timeoutMs ?? 10_000;
|
|
822
838
|
const attempt = async (h: Record<string, string>) => {
|
|
823
839
|
headers = h;
|
|
824
840
|
let authError: (Error & { status: number }) | undefined;
|
|
@@ -830,7 +846,7 @@ export async function discoverLiteLLMModels(
|
|
|
830
846
|
}
|
|
831
847
|
return response;
|
|
832
848
|
};
|
|
833
|
-
const models = await withTimeoutSignal(
|
|
849
|
+
const models = await withTimeoutSignal(timeoutMs, signal =>
|
|
834
850
|
fetchLiteLLMRichModels({
|
|
835
851
|
api: providerConfig.api,
|
|
836
852
|
provider: providerConfig.provider,
|
|
@@ -889,8 +905,9 @@ export async function discoverProxyModels(
|
|
|
889
905
|
|
|
890
906
|
const baseHeaders: Record<string, string> = { ...(providerConfig.headers ?? {}) };
|
|
891
907
|
let headers = baseHeaders;
|
|
908
|
+
const timeoutMs = providerConfig.discovery.timeoutMs ?? 10_000;
|
|
892
909
|
const attempt = async (h: Record<string, string>) =>
|
|
893
|
-
withTimeoutSignal(
|
|
910
|
+
withTimeoutSignal(timeoutMs, async signal => {
|
|
894
911
|
const res = await ctx.fetch(modelsUrl, {
|
|
895
912
|
headers: h,
|
|
896
913
|
signal,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
inheritReferenceThinking,
|
|
74
74
|
resolveModelReference,
|
|
75
75
|
} from "@oh-my-pi/pi-catalog/identity";
|
|
76
|
-
import { isBunTestRuntime, isRecord, logger, wrapFetchForExtraCa } from "@oh-my-pi/pi-utils";
|
|
76
|
+
import { $envExact, isBunTestRuntime, isRecord, logger, wrapFetchForExtraCa } from "@oh-my-pi/pi-utils";
|
|
77
77
|
import { parseModelString, resolveProviderModelReference } from "../config/model-resolver";
|
|
78
78
|
import { generateCodexAttestation } from "../live/attestation";
|
|
79
79
|
import type { AuthStorage, OAuthCredential } from "../session/auth-storage";
|
|
@@ -329,7 +329,7 @@ interface CommandApiKeyResolution {
|
|
|
329
329
|
*/
|
|
330
330
|
function resolveConfigValue(valueConfig: string): string | undefined {
|
|
331
331
|
if (valueConfig.startsWith("!")) return resolveCommandConfig(valueConfig.slice(1).trim());
|
|
332
|
-
const envValue =
|
|
332
|
+
const envValue = $envExact(valueConfig);
|
|
333
333
|
if (envValue) return envValue;
|
|
334
334
|
return valueConfig;
|
|
335
335
|
}
|
|
@@ -580,7 +580,13 @@ function applyModelPatch(base: Model<Api>, patch: ModelPatch, transport: ModelTr
|
|
|
580
580
|
result.headers = patch.headers;
|
|
581
581
|
compat = patch.compat;
|
|
582
582
|
}
|
|
583
|
-
|
|
583
|
+
const built = buildModel({ ...result, compat } as ModelSpec<Api>);
|
|
584
|
+
if (patch.thinking !== undefined && built.thinking !== undefined) {
|
|
585
|
+
// Config-authored capability metadata owns the explicit surface; build
|
|
586
|
+
// first so non-reasoning and wire-disabled models still suppress it.
|
|
587
|
+
built.thinking = patch.thinking;
|
|
588
|
+
}
|
|
589
|
+
return built;
|
|
584
590
|
}
|
|
585
591
|
|
|
586
592
|
function applyModelOverride(model: Model<Api>, override: ModelOverride): Model<Api> {
|
|
@@ -966,14 +972,18 @@ export class ModelRegistry {
|
|
|
966
972
|
* Refresh dynamic metadata that can appear only after a local model loads.
|
|
967
973
|
*/
|
|
968
974
|
async refreshSelectedModelMetadata(model: Model<Api>): Promise<Model<Api>> {
|
|
969
|
-
const
|
|
975
|
+
const llamaCppDiscoveryConfig = this.#discoverableProviders.find(
|
|
970
976
|
providerConfig => providerConfig.provider === model.provider && providerConfig.discovery.type === "llama.cpp",
|
|
971
977
|
);
|
|
972
|
-
if (!
|
|
978
|
+
if (!llamaCppDiscoveryConfig) {
|
|
973
979
|
return model;
|
|
974
980
|
}
|
|
975
981
|
this.#ensureFullSnapshot();
|
|
976
|
-
const runtimeMetadata = await discoverLlamaCppModelRuntimeMetadata(
|
|
982
|
+
const runtimeMetadata = await discoverLlamaCppModelRuntimeMetadata(
|
|
983
|
+
model,
|
|
984
|
+
this.#nonResolvingDiscoveryContext(),
|
|
985
|
+
llamaCppDiscoveryConfig.discovery.timeoutMs,
|
|
986
|
+
);
|
|
977
987
|
if (runtimeMetadata === undefined) {
|
|
978
988
|
return this.find(model.provider, model.id) ?? model;
|
|
979
989
|
}
|
|
@@ -262,6 +262,15 @@ export const getModelsConfigSchemaBundle = once(() => {
|
|
|
262
262
|
|
|
263
263
|
const ProviderDiscoverySchema = type({
|
|
264
264
|
type: '"ollama" | "llama.cpp" | "lm-studio" | "openai-models-list" | "proxy" | "litellm"',
|
|
265
|
+
"timeoutMs?": "number",
|
|
266
|
+
}).narrow((value, ctx) => {
|
|
267
|
+
if (
|
|
268
|
+
value.timeoutMs !== undefined &&
|
|
269
|
+
(typeof value.timeoutMs !== "number" || value.timeoutMs <= 0 || !Number.isFinite(value.timeoutMs))
|
|
270
|
+
) {
|
|
271
|
+
return ctx.mustBe("timeoutMs a positive finite number");
|
|
272
|
+
}
|
|
273
|
+
return true;
|
|
265
274
|
});
|
|
266
275
|
|
|
267
276
|
const ProviderAuthSchema = type('"apiKey" | "none" | "oauth"');
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { executeShell } from "@oh-my-pi/pi-natives";
|
|
8
|
+
import { $envExact } from "@oh-my-pi/pi-utils";
|
|
8
9
|
|
|
9
10
|
/** Cache for successful shell command results (persists for process lifetime). */
|
|
10
11
|
const commandResultCache = new Map<string, string>();
|
|
@@ -21,7 +22,7 @@ export async function resolveConfigValue(config: string): Promise<string | undef
|
|
|
21
22
|
if (config.startsWith("!")) {
|
|
22
23
|
return await executeCommand(config);
|
|
23
24
|
}
|
|
24
|
-
const envValue =
|
|
25
|
+
const envValue = $envExact(config);
|
|
25
26
|
return envValue || config;
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -16,6 +16,11 @@ export type ServiceTierOpenAISettingValue = (typeof SERVICE_TIER_OPENAI_VALUES)[
|
|
|
16
16
|
export type ServiceTierAnthropicSettingValue = (typeof SERVICE_TIER_ANTHROPIC_VALUES)[number];
|
|
17
17
|
export type ServiceTierGoogleSettingValue = (typeof SERVICE_TIER_GOOGLE_VALUES)[number];
|
|
18
18
|
|
|
19
|
+
/** Whether a runtime value is a supported OpenAI service-tier setting. */
|
|
20
|
+
export function isServiceTierOpenAISettingValue(value: string): value is ServiceTierOpenAISettingValue {
|
|
21
|
+
return SERVICE_TIER_OPENAI_VALUES.some(tier => tier === value);
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
/** Whether a runtime value names a provider family with an independent service-tier knob. */
|
|
20
25
|
export function isServiceTierFamily(value: unknown): value is ServiceTierFamily {
|
|
21
26
|
return value === "openai" || value === "anthropic" || value === "google";
|
|
@@ -37,7 +37,12 @@ import {
|
|
|
37
37
|
TTS_LOCAL_VOICE_VALUES,
|
|
38
38
|
} from "../tts/models";
|
|
39
39
|
import { EDIT_MODES } from "../utils/edit-mode";
|
|
40
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
DEFAULT_WEB_SEARCH_TIMEOUT_SECONDS,
|
|
42
|
+
MAX_WEB_SEARCH_TIMEOUT_SECONDS,
|
|
43
|
+
SEARCH_PROVIDER_CHOICES,
|
|
44
|
+
type SearchProviderId,
|
|
45
|
+
} from "../web/search/types";
|
|
41
46
|
import {
|
|
42
47
|
SERVICE_TIER_ANTHROPIC_OPTIONS,
|
|
43
48
|
SERVICE_TIER_ANTHROPIC_VALUES,
|
|
@@ -1013,6 +1018,17 @@ export const SETTINGS_SCHEMA = {
|
|
|
1013
1018
|
},
|
|
1014
1019
|
},
|
|
1015
1020
|
|
|
1021
|
+
"display.hideToolActivity": {
|
|
1022
|
+
type: "boolean",
|
|
1023
|
+
default: false,
|
|
1024
|
+
ui: {
|
|
1025
|
+
tab: "appearance",
|
|
1026
|
+
group: "Display",
|
|
1027
|
+
label: "Hide Tool Activity",
|
|
1028
|
+
description: "Hide model-initiated tool calls and results from the transcript",
|
|
1029
|
+
},
|
|
1030
|
+
},
|
|
1031
|
+
|
|
1016
1032
|
"display.showTokenUsage": {
|
|
1017
1033
|
type: "boolean",
|
|
1018
1034
|
default: false,
|
|
@@ -3382,6 +3398,18 @@ export const SETTINGS_SCHEMA = {
|
|
|
3382
3398
|
},
|
|
3383
3399
|
},
|
|
3384
3400
|
|
|
3401
|
+
"lsp.shared": {
|
|
3402
|
+
type: "boolean",
|
|
3403
|
+
default: true,
|
|
3404
|
+
ui: {
|
|
3405
|
+
tab: "files",
|
|
3406
|
+
group: "LSP",
|
|
3407
|
+
label: "Shared Language Servers",
|
|
3408
|
+
description:
|
|
3409
|
+
"Share one language server per project across omp instances via the daemon broker (falls back to private servers when unavailable)",
|
|
3410
|
+
},
|
|
3411
|
+
},
|
|
3412
|
+
|
|
3385
3413
|
"lsp.formatOnWrite": {
|
|
3386
3414
|
type: "boolean",
|
|
3387
3415
|
default: false,
|
|
@@ -3897,23 +3925,7 @@ export const SETTINGS_SCHEMA = {
|
|
|
3897
3925
|
tab: "tools",
|
|
3898
3926
|
group: "Available Tools",
|
|
3899
3927
|
label: "Computer",
|
|
3900
|
-
description: "Enable
|
|
3901
|
-
},
|
|
3902
|
-
},
|
|
3903
|
-
|
|
3904
|
-
"computer.backend": {
|
|
3905
|
-
type: "enum",
|
|
3906
|
-
values: ["auto", "native"] as const,
|
|
3907
|
-
default: "auto",
|
|
3908
|
-
ui: {
|
|
3909
|
-
tab: "tools",
|
|
3910
|
-
group: "Computer",
|
|
3911
|
-
label: "Computer Backend",
|
|
3912
|
-
description: "Select automatic or explicit platform-native desktop capture and input",
|
|
3913
|
-
options: [
|
|
3914
|
-
{ value: "auto", label: "Auto" },
|
|
3915
|
-
{ value: "native", label: "Native" },
|
|
3916
|
-
],
|
|
3928
|
+
description: "Enable the scriptable host-desktop control tool (screenshots, input, accessibility)",
|
|
3917
3929
|
},
|
|
3918
3930
|
},
|
|
3919
3931
|
|
|
@@ -3930,7 +3942,7 @@ export const SETTINGS_SCHEMA = {
|
|
|
3930
3942
|
|
|
3931
3943
|
"computer.maxWidth": {
|
|
3932
3944
|
type: "number",
|
|
3933
|
-
default:
|
|
3945
|
+
default: 3840,
|
|
3934
3946
|
ui: {
|
|
3935
3947
|
tab: "tools",
|
|
3936
3948
|
group: "Computer",
|
|
@@ -3941,7 +3953,7 @@ export const SETTINGS_SCHEMA = {
|
|
|
3941
3953
|
|
|
3942
3954
|
"computer.maxHeight": {
|
|
3943
3955
|
type: "number",
|
|
3944
|
-
default:
|
|
3956
|
+
default: 2400,
|
|
3945
3957
|
ui: {
|
|
3946
3958
|
tab: "tools",
|
|
3947
3959
|
group: "Computer",
|
|
@@ -4108,6 +4120,29 @@ export const SETTINGS_SCHEMA = {
|
|
|
4108
4120
|
},
|
|
4109
4121
|
},
|
|
4110
4122
|
|
|
4123
|
+
"browser.relay": {
|
|
4124
|
+
type: "boolean",
|
|
4125
|
+
default: false,
|
|
4126
|
+
ui: {
|
|
4127
|
+
tab: "tools",
|
|
4128
|
+
group: "Grep & Browser",
|
|
4129
|
+
label: "Browser Relay",
|
|
4130
|
+
description:
|
|
4131
|
+
"Drive your own Chrome tabs through the omp browser relay. Install the extension once (`omp browser-relay install`); the relay server auto-starts when the browser tool needs it. Takes precedence over Browser CDP URL; set PI_BROWSER_RELAY=0 or PI_BROWSER_RELAY=1 to override.",
|
|
4132
|
+
},
|
|
4133
|
+
},
|
|
4134
|
+
|
|
4135
|
+
"browser.relayUrl": {
|
|
4136
|
+
type: "string",
|
|
4137
|
+
default: undefined,
|
|
4138
|
+
ui: {
|
|
4139
|
+
tab: "tools",
|
|
4140
|
+
group: "Grep & Browser",
|
|
4141
|
+
label: "Browser Relay URL",
|
|
4142
|
+
description: "omp browser relay endpoint (default http://127.0.0.1:9224).",
|
|
4143
|
+
},
|
|
4144
|
+
},
|
|
4145
|
+
|
|
4111
4146
|
"browser.headless": {
|
|
4112
4147
|
type: "boolean",
|
|
4113
4148
|
default: true,
|
|
@@ -4254,7 +4289,7 @@ export const SETTINGS_SCHEMA = {
|
|
|
4254
4289
|
group: "Discovery & MCP",
|
|
4255
4290
|
label: "xd:// Tools",
|
|
4256
4291
|
description:
|
|
4257
|
-
"Mount rarely-used (discoverable) tools under xd:// device URLs driven via read/write instead of shipping their schemas on every request. Disable to expose every enabled tool top-level.",
|
|
4292
|
+
"Mount rarely-used (discoverable) tools under xd:// device URLs driven via read/write instead of shipping their schemas on every request. Sessions without a granted write tool skip mounting and expose every tool top-level. Disable to expose every enabled tool top-level.",
|
|
4258
4293
|
},
|
|
4259
4294
|
},
|
|
4260
4295
|
|
|
@@ -4869,6 +4904,23 @@ export const SETTINGS_SCHEMA = {
|
|
|
4869
4904
|
options: SEARCH_PROVIDER_CHOICES,
|
|
4870
4905
|
},
|
|
4871
4906
|
},
|
|
4907
|
+
"providers.webSearchTimeoutSeconds": {
|
|
4908
|
+
type: "number",
|
|
4909
|
+
default: DEFAULT_WEB_SEARCH_TIMEOUT_SECONDS,
|
|
4910
|
+
ui: {
|
|
4911
|
+
tab: "providers",
|
|
4912
|
+
group: "Services",
|
|
4913
|
+
label: "Web Search Timeout",
|
|
4914
|
+
description: `Hard timeout for each provider's search transport before web_search advances to the next fallback, in seconds (maximum ${MAX_WEB_SEARCH_TIMEOUT_SECONDS})`,
|
|
4915
|
+
options: [
|
|
4916
|
+
{ value: "30", label: "30 seconds" },
|
|
4917
|
+
{ value: "60", label: "1 minute" },
|
|
4918
|
+
{ value: "120", label: "2 minutes" },
|
|
4919
|
+
{ value: "180", label: "3 minutes" },
|
|
4920
|
+
{ value: "300", label: "5 minutes" },
|
|
4921
|
+
],
|
|
4922
|
+
},
|
|
4923
|
+
},
|
|
4872
4924
|
"providers.webSearchGeminiModel": {
|
|
4873
4925
|
type: "string",
|
|
4874
4926
|
default: undefined,
|
|
@@ -39,7 +39,7 @@ export function createBridgeGrepFactory(
|
|
|
39
39
|
/**
|
|
40
40
|
* Build the `replace`-mode `edit` the bridge answers `pi_edit` with.
|
|
41
41
|
*
|
|
42
|
-
* `PiEditExecArgs` carries `
|
|
42
|
+
* `PiEditExecArgs` carries `old_string`/`new_string` replacements, which is exactly
|
|
43
43
|
* `replace`'s schema and nothing else's. The session's own instance follows the
|
|
44
44
|
* configured `edit.mode` — `hashline` by default, whose schema is a single
|
|
45
45
|
* `input` string — so a frame handed that instance fails validation instead of
|
package/src/cursor.ts
CHANGED
|
@@ -69,7 +69,7 @@ interface CursorExecBridgeOptions {
|
|
|
69
69
|
*
|
|
70
70
|
* `PiEditExecArgs` is that mode's schema verbatim, and the session's own
|
|
71
71
|
* `edit` may be in any mode — `hashline` by default — whose schema rejects
|
|
72
|
-
* `
|
|
72
|
+
* `old_string`/`new_string` outright. {@link tools} therefore cannot be trusted
|
|
73
73
|
* for this one frame: a session that starts on another provider keeps its
|
|
74
74
|
* configured instance in the map (only Cursor sessions move `edit` out), and
|
|
75
75
|
* switching to Cursor later does not rebuild the roster.
|
|
@@ -641,25 +641,21 @@ export class CursorExecHandlers implements ICursorExecHandlers {
|
|
|
641
641
|
}
|
|
642
642
|
|
|
643
643
|
/**
|
|
644
|
-
* `PiEditExecArgs`
|
|
645
|
-
*
|
|
646
|
-
*
|
|
644
|
+
* `PiEditExecArgs` carries a path plus `oldText`/`newText` replacement
|
|
645
|
+
* pairs. A single replacement maps onto the model-facing single-edit
|
|
646
|
+
* `replace` schema verbatim; a multi-replacement frame still runs as ONE
|
|
647
|
+
* tool lifecycle (one start/end event pair, one aggregate diff), so it is
|
|
648
|
+
* sent in the tool's internal `edits` batch form (`ReplaceBatchParams`),
|
|
649
|
+
* which only this bridge produces.
|
|
647
650
|
*
|
|
648
651
|
* The replace-mode instance is requested explicitly rather than resolved
|
|
649
652
|
* from {@link CursorExecBridgeOptions.tools}: the registry's `edit` is in
|
|
650
653
|
* the session's configured mode, whose schema rejects these arguments.
|
|
651
654
|
*/
|
|
652
655
|
async piEdit(call: Parameters<NonNullable<ICursorExecHandlers["piEdit"]>>[0]) {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
call.toolCallId,
|
|
657
|
-
{
|
|
658
|
-
path: call.args.path,
|
|
659
|
-
edits: call.args.edits.map(edit => ({ old_text: edit.oldText, new_text: edit.newText })),
|
|
660
|
-
},
|
|
661
|
-
this.options.getEditReplaceTool?.(),
|
|
662
|
-
);
|
|
656
|
+
const edits = call.args.edits.map(edit => ({ old_string: edit.oldText, new_string: edit.newText }));
|
|
657
|
+
const args = edits.length === 1 ? { path: call.args.path, ...edits[0] } : { path: call.args.path, edits };
|
|
658
|
+
return await executeTool(this.options, "edit", call.toolCallId, args, this.options.getEditReplaceTool?.());
|
|
663
659
|
}
|
|
664
660
|
|
|
665
661
|
async piWrite(call: Parameters<NonNullable<ICursorExecHandlers["piWrite"]>>[0]) {
|