@oh-my-pi/pi-coding-agent 17.2.4 → 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 +51 -0
- package/dist/{CHANGELOG-bpmhv26t.md → CHANGELOG-q2w43aw3.md} +51 -0
- package/dist/cli.js +4148 -3717
- package/dist/{template-8vdv6xb4.js → template-c2hyaytt.js} +8 -26
- 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/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 +5 -0
- 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 +69 -21
- package/dist/types/cursor-bridge-tools.d.ts +1 -1
- package/dist/types/cursor.d.ts +7 -4
- 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/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/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 +1 -1
- 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/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/read-tool-group.d.ts +2 -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 +1 -0
- package/dist/types/modes/workflow.d.ts +2 -1
- package/dist/types/sdk.d.ts +3 -1
- package/dist/types/secrets/index.d.ts +1 -1
- package/dist/types/session/agent-session-types.d.ts +3 -1
- package/dist/types/session/indexed-session-storage.d.ts +1 -0
- package/dist/types/session/session-advisors.d.ts +1 -1
- package/dist/types/session/session-context.d.ts +2 -1
- package/dist/types/session/session-maintenance.d.ts +1 -0
- package/dist/types/session/session-manager.d.ts +16 -11
- 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 +4 -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/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/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/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/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 +5 -0
- package/src/config/model-discovery.ts +30 -13
- package/src/config/model-registry.ts +9 -5
- 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 +72 -20
- package/src/cursor-bridge-tools.ts +1 -1
- package/src/cursor.ts +10 -14
- 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/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/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 +1 -1
- 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 +7 -2
- package/src/mcp/oauth-flow.ts +11 -1
- package/src/mnemopi/embed-client.ts +49 -2
- package/src/mnemopi/state.ts +57 -23
- 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 +9 -0
- package/src/modes/components/read-tool-group.ts +10 -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 +8 -0
- package/src/modes/components/tree-selector.ts +46 -48
- package/src/modes/controllers/event-controller.ts +17 -0
- 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 +20 -0
- package/src/modes/interactive-mode.ts +2 -0
- package/src/modes/types.ts +1 -0
- 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/sdk.ts +34 -6
- package/src/secrets/index.ts +1 -1
- package/src/session/agent-session-types.ts +3 -1
- package/src/session/agent-session.ts +13 -1
- package/src/session/indexed-session-storage.ts +9 -0
- package/src/session/prewalk.ts +24 -2
- package/src/session/session-advisors.ts +2 -2
- package/src/session/session-context.ts +16 -12
- package/src/session/session-dump-format.ts +1 -1
- package/src/session/session-maintenance.ts +38 -4
- package/src/session/session-manager.ts +102 -67
- 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/stream-guards.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +27 -24
- package/src/system-prompt.ts +8 -3
- package/src/task/index.ts +23 -8
- package/src/task/spawn-policy.ts +14 -0
- package/src/thinking.ts +2 -8
- 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/glob.ts +9 -2
- package/src/tools/grep.ts +12 -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 +4 -1
- 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
|
@@ -44,6 +44,7 @@ export declare function searchSearXNG(params: {
|
|
|
44
44
|
num_results?: number;
|
|
45
45
|
recency?: "day" | "week" | "month" | "year";
|
|
46
46
|
signal?: AbortSignal;
|
|
47
|
+
timeoutMs?: number;
|
|
47
48
|
fetch?: FetchImpl;
|
|
48
49
|
}): Promise<SearchResponse>;
|
|
49
50
|
/** Search provider for SearXNG web search. */
|
|
@@ -21,6 +21,7 @@ export interface TavilySearchParams {
|
|
|
21
21
|
/** `before:` upper bound, ISO `YYYY-MM-DD`, mapped to `end_date`. */
|
|
22
22
|
end_date?: string;
|
|
23
23
|
signal?: AbortSignal;
|
|
24
|
+
timeoutMs?: number;
|
|
24
25
|
fetch?: FetchImpl;
|
|
25
26
|
}
|
|
26
27
|
/** Find Tavily API key through AuthStorage's unified refresh pipeline. */
|
|
@@ -15,16 +15,13 @@ import { SearchProviderError, type SearchProviderId, type SearchSource } from ".
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function findCredential(storage: AgentStorage | null | undefined, envKey: string | null | undefined, ...storageProviders: string[]): string | null;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* Pure search APIs (brave, exa, jina, tavily, searxng, synthetic, zai)
|
|
24
|
-
* settle far faster in practice; reusing the same ceiling keeps the wiring
|
|
25
|
-
* uniform without compromising correctness.
|
|
18
|
+
* The 60-second default tolerates legitimate slow LLM-mediated responses
|
|
19
|
+
* (Anthropic web_search_20250305, Perplexity, Gemini, Codex) while bounding
|
|
20
|
+
* Windows stalls when Bun's `AbortSignal` fails to propagate. Callers may
|
|
21
|
+
* configure a longer provider deadline, capped at five minutes by the
|
|
22
|
+
* dispatcher; pure search APIs typically settle far faster.
|
|
26
23
|
*/
|
|
27
|
-
export declare const SEARCH_HARD_TIMEOUT_MS
|
|
24
|
+
export declare const SEARCH_HARD_TIMEOUT_MS: number;
|
|
28
25
|
/**
|
|
29
26
|
* Compose a caller-supplied {@link AbortSignal} with a hard timeout so an
|
|
30
27
|
* outbound `fetch()` is guaranteed to settle within `ms` even when the
|
|
@@ -100,6 +100,10 @@ export declare const SEARCH_PROVIDER_OPTIONS: readonly [{
|
|
|
100
100
|
readonly label: "Public Web";
|
|
101
101
|
readonly description: "Queries every credential-free engine in parallel and consolidates deduplicated results";
|
|
102
102
|
}];
|
|
103
|
+
/** Default hard timeout for each web-search provider transport. */
|
|
104
|
+
export declare const DEFAULT_WEB_SEARCH_TIMEOUT_SECONDS = 60;
|
|
105
|
+
/** Maximum configurable hard timeout for each web-search provider transport. */
|
|
106
|
+
export declare const MAX_WEB_SEARCH_TIMEOUT_SECONDS = 300;
|
|
103
107
|
/** Supported web search providers (every option except `auto`). */
|
|
104
108
|
export type SearchProviderId = Exclude<(typeof SEARCH_PROVIDER_OPTIONS)[number]["value"], "auto">;
|
|
105
109
|
/**
|
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": "17.2.
|
|
4
|
+
"version": "17.2.5",
|
|
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",
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
"@agentclientprotocol/sdk": "1.2.1",
|
|
53
53
|
"@babel/parser": "^7.29.7",
|
|
54
54
|
"@mozilla/readability": "^0.6.0",
|
|
55
|
-
"@oh-my-pi/hashline": "17.2.
|
|
56
|
-
"@oh-my-pi/omp-stats": "17.2.
|
|
57
|
-
"@oh-my-pi/pi-agent-core": "17.2.
|
|
58
|
-
"@oh-my-pi/pi-ai": "17.2.
|
|
59
|
-
"@oh-my-pi/pi-catalog": "17.2.
|
|
60
|
-
"@oh-my-pi/pi-mnemopi": "17.2.
|
|
61
|
-
"@oh-my-pi/pi-natives": "17.2.
|
|
62
|
-
"@oh-my-pi/pi-tui": "17.2.
|
|
63
|
-
"@oh-my-pi/pi-utils": "17.2.
|
|
64
|
-
"@oh-my-pi/pi-wire": "17.2.
|
|
65
|
-
"@oh-my-pi/snapcompact": "17.2.
|
|
55
|
+
"@oh-my-pi/hashline": "17.2.5",
|
|
56
|
+
"@oh-my-pi/omp-stats": "17.2.5",
|
|
57
|
+
"@oh-my-pi/pi-agent-core": "17.2.5",
|
|
58
|
+
"@oh-my-pi/pi-ai": "17.2.5",
|
|
59
|
+
"@oh-my-pi/pi-catalog": "17.2.5",
|
|
60
|
+
"@oh-my-pi/pi-mnemopi": "17.2.5",
|
|
61
|
+
"@oh-my-pi/pi-natives": "17.2.5",
|
|
62
|
+
"@oh-my-pi/pi-tui": "17.2.5",
|
|
63
|
+
"@oh-my-pi/pi-utils": "17.2.5",
|
|
64
|
+
"@oh-my-pi/pi-wire": "17.2.5",
|
|
65
|
+
"@oh-my-pi/snapcompact": "17.2.5",
|
|
66
66
|
"@opentelemetry/api": "^1.9.1",
|
|
67
67
|
"@opentelemetry/api-logs": "^0.220.0",
|
|
68
68
|
"@opentelemetry/context-async-hooks": "^2.9.0",
|
package/src/cli/args.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI argument parsing and help display
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { $env, APP_NAME, logger } from "@oh-my-pi/pi-utils";
|
|
5
5
|
import chalk from "chalk";
|
|
6
|
+
import type { ServiceTierOpenAISettingValue } from "../config/service-tier";
|
|
6
7
|
import { CLI_THINKING_LEVELS, type ConfiguredThinkingLevel, parseCliThinkingLevel } from "../thinking";
|
|
7
8
|
import { BUILTIN_TOOL_NAMES, HIDDEN_TOOL_NAMES, normalizeToolNames } from "../tools/builtin-names";
|
|
8
9
|
import {
|
|
@@ -13,8 +14,11 @@ import {
|
|
|
13
14
|
STRING_SETTERS,
|
|
14
15
|
STRING_VALUE_FLAGS,
|
|
15
16
|
} from "./flag-tables";
|
|
17
|
+
import { getExtraHelpText } from "./help-extra";
|
|
16
18
|
import { CliUsageError } from "./usage-error";
|
|
17
19
|
|
|
20
|
+
export { getExtraHelpText };
|
|
21
|
+
|
|
18
22
|
export type Mode = "text" | "json" | "rpc" | "acp" | "rpc-ui";
|
|
19
23
|
|
|
20
24
|
export interface Args {
|
|
@@ -40,6 +44,7 @@ export interface Args {
|
|
|
40
44
|
systemPrompt?: string;
|
|
41
45
|
appendSystemPrompt?: string;
|
|
42
46
|
thinking?: ConfiguredThinkingLevel;
|
|
47
|
+
serviceTier?: ServiceTierOpenAISettingValue;
|
|
43
48
|
hideThinking?: boolean;
|
|
44
49
|
advisor?: boolean;
|
|
45
50
|
continue?: boolean;
|
|
@@ -145,6 +150,7 @@ export function parseArgs(inputArgs: string[], extensionFlags?: Map<string, { ty
|
|
|
145
150
|
fileArgs: [],
|
|
146
151
|
unknownFlags: new Map(),
|
|
147
152
|
unrecognizedFlags: [],
|
|
153
|
+
sessionDir: $env.PI_CODING_AGENT_SESSION_DIR || undefined,
|
|
148
154
|
};
|
|
149
155
|
|
|
150
156
|
// `--` ends option parsing (POSIX end-of-options). Everything after it is
|
|
@@ -330,92 +336,6 @@ export function reportCliUsageError(
|
|
|
330
336
|
return true;
|
|
331
337
|
}
|
|
332
338
|
|
|
333
|
-
export function getExtraHelpText(): string {
|
|
334
|
-
return `${chalk.bold("Environment Variables:")}
|
|
335
|
-
${chalk.dim("# Core Providers")}
|
|
336
|
-
ANTHROPIC_API_KEY - Anthropic Claude models
|
|
337
|
-
ANTHROPIC_OAUTH_TOKEN - Anthropic OAuth (takes precedence over API key)
|
|
338
|
-
CLAUDE_CODE_USE_FOUNDRY - Enable Anthropic Foundry mode (uses Foundry endpoint + mTLS)
|
|
339
|
-
FOUNDRY_BASE_URL - Anthropic Foundry base URL (e.g., https://<foundry-host>)
|
|
340
|
-
ANTHROPIC_FOUNDRY_API_KEY - Anthropic token used as Authorization: Bearer <token> in Foundry mode
|
|
341
|
-
ANTHROPIC_CUSTOM_HEADERS - Extra headers for Foundry or any custom ANTHROPIC_BASE_URL gateway (e.g., "user-id: USERNAME")
|
|
342
|
-
CLAUDE_CODE_CLIENT_CERT - Client certificate (PEM path or inline PEM) for mTLS
|
|
343
|
-
CLAUDE_CODE_CLIENT_KEY - Client private key (PEM path or inline PEM) for mTLS
|
|
344
|
-
NODE_EXTRA_CA_CERTS - CA bundle path (or inline PEM) for server certificate validation
|
|
345
|
-
OPENAI_API_KEY - OpenAI GPT models
|
|
346
|
-
GEMINI_API_KEY - Google Gemini models
|
|
347
|
-
COPILOT_GITHUB_TOKEN - GitHub Copilot
|
|
348
|
-
|
|
349
|
-
${chalk.dim("# Additional LLM Providers")}
|
|
350
|
-
AZURE_OPENAI_API_KEY - Azure OpenAI models
|
|
351
|
-
GROQ_API_KEY - Groq models
|
|
352
|
-
CEREBRAS_API_KEY - Cerebras models
|
|
353
|
-
XAI_API_KEY - xAI Grok models
|
|
354
|
-
OPENROUTER_API_KEY - OpenRouter aggregated models
|
|
355
|
-
KILO_API_KEY - Kilo Gateway models
|
|
356
|
-
MISTRAL_API_KEY - Mistral models
|
|
357
|
-
ZAI_API_KEY - z.ai models (ZhipuAI/GLM)
|
|
358
|
-
UMANS_AI_CODING_PLAN_API_KEY - Umans AI Coding Plan models
|
|
359
|
-
UMANS_WEBSEARCH_PROVIDER - Umans gateway web search backend (native or exa)
|
|
360
|
-
MINIMAX_API_KEY - MiniMax models
|
|
361
|
-
OPENCODE_API_KEY - OpenCode Zen/OpenCode Go models
|
|
362
|
-
CURSOR_ACCESS_TOKEN - Cursor AI models
|
|
363
|
-
AI_GATEWAY_API_KEY - Vercel AI Gateway
|
|
364
|
-
WAFER_SERVERLESS_API_KEY - Wafer Serverless (pay-as-you-go)
|
|
365
|
-
|
|
366
|
-
${chalk.dim("# Cloud Providers")}
|
|
367
|
-
AWS_PROFILE - AWS Bedrock (or AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY)
|
|
368
|
-
GOOGLE_CLOUD_PROJECT - Google Vertex AI (requires GOOGLE_CLOUD_LOCATION)
|
|
369
|
-
GOOGLE_APPLICATION_CREDENTIALS - Service account for Vertex AI
|
|
370
|
-
|
|
371
|
-
${chalk.dim("# Search & Tools")}
|
|
372
|
-
EXA_API_KEY - Exa web search
|
|
373
|
-
BRAVE_API_KEY - Brave web search
|
|
374
|
-
PERPLEXITY_API_KEY - Perplexity web search API key (optional; anonymous fallback)
|
|
375
|
-
PERPLEXITY_COOKIES - Perplexity web search (session cookie)
|
|
376
|
-
TAVILY_API_KEY - Tavily web search
|
|
377
|
-
TINYFISH_API_KEY - TinyFish web search
|
|
378
|
-
FIRECRAWL_API_KEY - Firecrawl web search
|
|
379
|
-
ANTHROPIC_SEARCH_API_KEY - Anthropic web search (override; isolates search from main ANTHROPIC_API_KEY)
|
|
380
|
-
ANTHROPIC_SEARCH_BASE_URL - Anthropic web search base URL (override; pairs with ANTHROPIC_SEARCH_API_KEY)
|
|
381
|
-
|
|
382
|
-
${chalk.dim("# Configuration")}
|
|
383
|
-
OMP_PROFILE - Named profile for isolated agent state (same as --profile)
|
|
384
|
-
Use \`omp --profile <name> --alias <command>\` to create a shell shortcut for a profile
|
|
385
|
-
PI_CODING_AGENT_DIR - Session storage directory (default: ~/${CONFIG_DIR_NAME}/agent)
|
|
386
|
-
PI_PACKAGE_DIR - Override package directory (for Nix/Guix store paths)
|
|
387
|
-
PI_SMOL_MODEL - Override smol/fast model (see --smol)
|
|
388
|
-
PI_SLOW_MODEL - Override slow/reasoning model (see --slow)
|
|
389
|
-
PI_PLAN_MODEL - Override planning model (see --plan)
|
|
390
|
-
PI_NO_PTY - Disable PTY-based interactive bash execution
|
|
391
|
-
For complete environment variable reference, see:
|
|
392
|
-
${chalk.dim("docs/environment-variables.md")}
|
|
393
|
-
${chalk.bold("Available Tools (default-enabled unless noted):")}
|
|
394
|
-
read - Read file contents
|
|
395
|
-
bash - Execute bash commands
|
|
396
|
-
edit - Edit files with find/replace
|
|
397
|
-
write - Write files (creates/overwrites)
|
|
398
|
-
grep - Search file contents
|
|
399
|
-
glob - Find files by glob pattern
|
|
400
|
-
lsp - Language server protocol (code intelligence)
|
|
401
|
-
python - Execute Python code (requires: ${APP_NAME} setup python)
|
|
402
|
-
notebook - Edit Jupyter notebooks
|
|
403
|
-
inspect_image - Analyze images with a vision model
|
|
404
|
-
browser - Browser automation (Puppeteer)
|
|
405
|
-
computer - Native host desktop capture and input (disabled by default)
|
|
406
|
-
task - Launch sub-agents for parallel tasks
|
|
407
|
-
todo - Manage todo/task lists
|
|
408
|
-
web_search - Search the web
|
|
409
|
-
ask - Ask user questions (interactive mode only)
|
|
410
|
-
|
|
411
|
-
${chalk.bold("Plugin Options:")}
|
|
412
|
-
--plugin-dir <path> Load plugin from directory (repeatable)
|
|
413
|
-
|
|
414
|
-
${chalk.bold("Useful Commands:")}
|
|
415
|
-
omp agents unpack - Export bundled subagents to ~/.omp/agent/agents (default)
|
|
416
|
-
omp agents unpack --project - Export bundled subagents to ./.omp/agents`;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
339
|
export function printHelp(): void {
|
|
420
340
|
process.stdout.write(
|
|
421
341
|
`${chalk.bold(APP_NAME)} - AI coding assistant\n\n` +
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `omp browser-relay` implementation: serve the local CDP relay and install
|
|
3
|
+
* its Chrome extension. Standalone CLI command — console output here is
|
|
4
|
+
* intentional user-facing output.
|
|
5
|
+
*/
|
|
6
|
+
import * as path from "node:path";
|
|
7
|
+
import { getBrowserRelayDir } from "@oh-my-pi/pi-utils";
|
|
8
|
+
import { probeRelayServer } from "../tools/browser/relay/daemon";
|
|
9
|
+
import backgroundJs from "../tools/browser/relay/extension-assets/background.js.txt" with { type: "text" };
|
|
10
|
+
import manifestJson from "../tools/browser/relay/extension-assets/manifest.json.txt" with { type: "text" };
|
|
11
|
+
import optionsHtml from "../tools/browser/relay/extension-assets/options.html.txt" with { type: "text" };
|
|
12
|
+
import optionsJs from "../tools/browser/relay/extension-assets/options.js.txt" with { type: "text" };
|
|
13
|
+
import { DEFAULT_RELAY_URL } from "../tools/browser/relay/kind";
|
|
14
|
+
import { type RelayServer, startRelayServer } from "../tools/browser/relay/server";
|
|
15
|
+
|
|
16
|
+
export const BROWSER_RELAY_ACTIONS = ["serve", "install"] as const;
|
|
17
|
+
export type BrowserRelayAction = (typeof BROWSER_RELAY_ACTIONS)[number];
|
|
18
|
+
|
|
19
|
+
export interface BrowserRelayCommandArgs {
|
|
20
|
+
action: BrowserRelayAction;
|
|
21
|
+
port: number;
|
|
22
|
+
token?: string;
|
|
23
|
+
/** Install target directory; defaults to ~/.omp/browser-relay/extension. */
|
|
24
|
+
dir?: string;
|
|
25
|
+
/** Gather tabs the agent actively drives into an 'omp' Chrome tab group (default true). */
|
|
26
|
+
group?: boolean;
|
|
27
|
+
verbose?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const EXTENSION_FILES: Record<string, string> = {
|
|
31
|
+
"background.js": backgroundJs,
|
|
32
|
+
"manifest.json": manifestJson,
|
|
33
|
+
"options.html": optionsHtml,
|
|
34
|
+
"options.js": optionsJs,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Default port of the relay endpoint (kept in sync with DEFAULT_RELAY_URL). */
|
|
38
|
+
export const DEFAULT_RELAY_PORT = Number(new URL(DEFAULT_RELAY_URL).port);
|
|
39
|
+
|
|
40
|
+
export async function runBrowserRelayCommand(args: BrowserRelayCommandArgs): Promise<void> {
|
|
41
|
+
if (args.action === "install") {
|
|
42
|
+
await runInstall(args.dir);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
await runServe(args);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function runInstall(dirOverride: string | undefined): Promise<void> {
|
|
49
|
+
const dir = dirOverride ? path.resolve(dirOverride) : path.join(getBrowserRelayDir(), "extension");
|
|
50
|
+
for (const name in EXTENSION_FILES) {
|
|
51
|
+
await Bun.write(path.join(dir, name), EXTENSION_FILES[name]!);
|
|
52
|
+
}
|
|
53
|
+
console.log(`Installed the OMP Browser Relay extension to ${dir}`);
|
|
54
|
+
console.log("");
|
|
55
|
+
console.log("Finish setup in Chrome:");
|
|
56
|
+
console.log(" 1. Open chrome://extensions and enable Developer mode.");
|
|
57
|
+
console.log(` 2. Click "Load unpacked" and select: ${dir}`);
|
|
58
|
+
console.log(" 3. Enable the mode: omp config set browser.relay true");
|
|
59
|
+
console.log("");
|
|
60
|
+
console.log("omp starts the relay automatically when the browser tool needs it;");
|
|
61
|
+
console.log("run `omp browser-relay` yourself only for --token or --no-group.");
|
|
62
|
+
console.log("The extension badge shows 'on' once it reaches a relay.");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function runServe(args: BrowserRelayCommandArgs): Promise<void> {
|
|
66
|
+
const log = args.verbose
|
|
67
|
+
? (message: string, data?: Record<string, unknown>) => {
|
|
68
|
+
console.error(`[relay] ${message}${data ? ` ${JSON.stringify(data)}` : ""}`);
|
|
69
|
+
}
|
|
70
|
+
: undefined;
|
|
71
|
+
let relay: RelayServer;
|
|
72
|
+
try {
|
|
73
|
+
relay = startRelayServer({ port: args.port, token: args.token, group: args.group !== false, log });
|
|
74
|
+
} catch (err) {
|
|
75
|
+
// The port is machine-global while relays can be started by any project's
|
|
76
|
+
// broker (or by hand): losing the bind to a live relay is success.
|
|
77
|
+
if (err instanceof Error && "code" in err && err.code === "EADDRINUSE") {
|
|
78
|
+
if (await probeRelayServer(`http://127.0.0.1:${args.port}`)) {
|
|
79
|
+
console.log(`omp browser relay already running on http://127.0.0.1:${args.port}; nothing to do.`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
console.error(`Port ${args.port} is in use by something that is not an omp browser relay.`);
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
throw err;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
console.log(`omp browser relay listening on http://127.0.0.1:${args.port}`);
|
|
89
|
+
console.log(` extension endpoint ws://127.0.0.1:${args.port}/ext${args.token ? "?token=***" : ""}`);
|
|
90
|
+
if (args.port === DEFAULT_RELAY_PORT) {
|
|
91
|
+
console.log(" enable with omp config set browser.relay true");
|
|
92
|
+
} else {
|
|
93
|
+
console.log(
|
|
94
|
+
` enable with omp config set browser.relay true && omp config set browser.relayUrl http://127.0.0.1:${args.port}`,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
console.log("Waiting for the OMP Browser Relay extension to connect (omp browser-relay install)...");
|
|
98
|
+
|
|
99
|
+
let announced = false;
|
|
100
|
+
const readiness = setInterval(() => {
|
|
101
|
+
if (relay.bridge.ready && !announced) {
|
|
102
|
+
announced = true;
|
|
103
|
+
console.log("Extension connected. The omp browser tool can now drive your tabs.");
|
|
104
|
+
} else if (!relay.bridge.ready && announced) {
|
|
105
|
+
announced = false;
|
|
106
|
+
console.log("Extension disconnected; waiting for it to reconnect...");
|
|
107
|
+
}
|
|
108
|
+
}, 500);
|
|
109
|
+
|
|
110
|
+
const shutdown = () => {
|
|
111
|
+
clearInterval(readiness);
|
|
112
|
+
relay.stop();
|
|
113
|
+
process.exit(0);
|
|
114
|
+
};
|
|
115
|
+
process.on("SIGINT", shutdown);
|
|
116
|
+
process.on("SIGTERM", shutdown);
|
|
117
|
+
// Serve runs until SIGINT/SIGTERM; keep the process alive.
|
|
118
|
+
await new Promise<never>(() => {});
|
|
119
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { CommandMetadata } from "@oh-my-pi/pi-utils/cli";
|
|
2
|
+
|
|
3
|
+
export const acpHelp = {
|
|
4
|
+
description: "Run Oh My Pi as an ACP (Agent Client Protocol) server over stdio",
|
|
5
|
+
} satisfies CommandMetadata;
|
|
6
|
+
|
|
7
|
+
export const agentsHelp = { description: "Manage bundled task agents" } satisfies CommandMetadata;
|
|
8
|
+
|
|
9
|
+
export const authBrokerHelp = {
|
|
10
|
+
description: "Manage the omp auth-broker (credential vault)",
|
|
11
|
+
} satisfies CommandMetadata;
|
|
12
|
+
|
|
13
|
+
export const authGatewayHelp = {
|
|
14
|
+
description: "Run an auth-gateway forward proxy backed by the configured broker",
|
|
15
|
+
} satisfies CommandMetadata;
|
|
16
|
+
|
|
17
|
+
export const benchHelp = {
|
|
18
|
+
description: "Benchmark models with the same prompt: time-to-first-token and generation throughput (tokens/s)",
|
|
19
|
+
} satisfies CommandMetadata;
|
|
20
|
+
|
|
21
|
+
export const browserRelayHelp = {
|
|
22
|
+
description: "Run the local CDP relay that lets the browser tool drive your own Chrome tabs",
|
|
23
|
+
} satisfies CommandMetadata;
|
|
24
|
+
|
|
25
|
+
export const cleanseHelp = {
|
|
26
|
+
description: "Detect and fix project diagnostics with weighted parallel subagents",
|
|
27
|
+
} satisfies CommandMetadata;
|
|
28
|
+
|
|
29
|
+
export const commitHelp = { description: "Generate a commit message and update changelogs" } satisfies CommandMetadata;
|
|
30
|
+
|
|
31
|
+
export const completionsHelp = {
|
|
32
|
+
description: "Print a shell completion script (bash, zsh, or fish)",
|
|
33
|
+
} satisfies CommandMetadata;
|
|
34
|
+
|
|
35
|
+
export const completeHelp = { hidden: true } satisfies CommandMetadata;
|
|
36
|
+
|
|
37
|
+
export const configHelp = { description: "Manage configuration settings" } satisfies CommandMetadata;
|
|
38
|
+
|
|
39
|
+
export const dryBalanceHelp = {
|
|
40
|
+
description: "Dry-run OAuth account balancing across random session ids",
|
|
41
|
+
} satisfies CommandMetadata;
|
|
42
|
+
|
|
43
|
+
export const galleryHelp = {
|
|
44
|
+
description: "Preview tool renderers across streaming, in-progress, success, and failure states",
|
|
45
|
+
} satisfies CommandMetadata;
|
|
46
|
+
|
|
47
|
+
export const gcHelp = { description: "Run storage garbage collection" } satisfies CommandMetadata;
|
|
48
|
+
|
|
49
|
+
export const grepHelp = { description: "Test grep tool" } satisfies CommandMetadata;
|
|
50
|
+
|
|
51
|
+
export const grievancesHelp = {
|
|
52
|
+
description: "View, clean, or push reported tool issues (auto-QA grievances)",
|
|
53
|
+
} satisfies CommandMetadata;
|
|
54
|
+
|
|
55
|
+
export const installHelp = {
|
|
56
|
+
description: "Install or link an extension package (alias of `plugin install`/`plugin link`)",
|
|
57
|
+
} satisfies CommandMetadata;
|
|
58
|
+
|
|
59
|
+
export const joinHelp = { description: "Join a shared collab session (same as /join)" } satisfies CommandMetadata;
|
|
60
|
+
|
|
61
|
+
export const modelsHelp = { description: "List, search, and refresh available models" } satisfies CommandMetadata;
|
|
62
|
+
|
|
63
|
+
export const pluginHelp = { description: "Manage plugins (install, uninstall, list, etc.)" } satisfies CommandMetadata;
|
|
64
|
+
|
|
65
|
+
export const readHelp = {
|
|
66
|
+
description: "Show what the read tool will return for a path, URL, or internal URI",
|
|
67
|
+
} satisfies CommandMetadata;
|
|
68
|
+
|
|
69
|
+
export const sayHelp = {
|
|
70
|
+
description: "Synthesize text with the local TTS engine and play it through the speakers",
|
|
71
|
+
} satisfies CommandMetadata;
|
|
72
|
+
|
|
73
|
+
export const searchHelp = { description: "Test web search providers" } satisfies CommandMetadata;
|
|
74
|
+
|
|
75
|
+
export const setupHelp = {
|
|
76
|
+
description: "Run onboarding setup or install dependencies for optional features",
|
|
77
|
+
} satisfies CommandMetadata;
|
|
78
|
+
|
|
79
|
+
export const shellHelp = { description: "Interactive shell console" } satisfies CommandMetadata;
|
|
80
|
+
|
|
81
|
+
export const sshHelp = { description: "Manage SSH host configurations" } satisfies CommandMetadata;
|
|
82
|
+
|
|
83
|
+
export const statsHelp = { description: "View usage statistics" } satisfies CommandMetadata;
|
|
84
|
+
|
|
85
|
+
export const tinyModelsHelp = {
|
|
86
|
+
description: "Download tiny local models (session titles + memory)",
|
|
87
|
+
} satisfies CommandMetadata;
|
|
88
|
+
|
|
89
|
+
export const tokenHelp = { description: "Get the API key or OAuth token for a provider" } satisfies CommandMetadata;
|
|
90
|
+
|
|
91
|
+
export const ttsrHelp = {
|
|
92
|
+
description: "Inspect and test Time-Traveling Stream Rules (TTSR)",
|
|
93
|
+
} satisfies CommandMetadata;
|
|
94
|
+
|
|
95
|
+
export const updateHelp = { description: "Check for and install updates" } satisfies CommandMetadata;
|
|
96
|
+
|
|
97
|
+
export const usageHelp = {
|
|
98
|
+
description: "Show provider usage limits for every authenticated account",
|
|
99
|
+
} satisfies CommandMetadata;
|
|
100
|
+
|
|
101
|
+
export const worktreeHelp = {
|
|
102
|
+
description: "List or clear agent-managed git worktrees (~/.omp/wt)",
|
|
103
|
+
} satisfies CommandMetadata;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* — see `commands/complete.ts`. The flag→source mapping below is the only manual
|
|
15
15
|
* knob and is keyed by flag name so it stays stable as flags are added.
|
|
16
16
|
*/
|
|
17
|
-
import type { ArgDescriptor, CliConfig,
|
|
17
|
+
import type { ArgDescriptor, CliConfig, CommandMetadata, FlagDescriptor } from "@oh-my-pi/pi-utils/cli";
|
|
18
18
|
import { BUILTIN_TOOL_NAMES } from "../tools/builtin-names";
|
|
19
19
|
|
|
20
20
|
export type Shell = "bash" | "zsh" | "fish";
|
|
@@ -88,9 +88,9 @@ function argValue(desc: ArgDescriptor): ValueSource {
|
|
|
88
88
|
return { kind: "file" };
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
function buildFlags(
|
|
91
|
+
function buildFlags(command: CommandMetadata): CompletionFlag[] {
|
|
92
92
|
const out: CompletionFlag[] = [];
|
|
93
|
-
const flags =
|
|
93
|
+
const flags = command.flags ?? {};
|
|
94
94
|
for (const name in flags) {
|
|
95
95
|
const desc = flags[name];
|
|
96
96
|
out.push({
|
|
@@ -104,9 +104,9 @@ function buildFlags(Cmd: CommandCtor): CompletionFlag[] {
|
|
|
104
104
|
return out;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
function buildArgs(
|
|
107
|
+
function buildArgs(command: CommandMetadata): CompletionArg[] {
|
|
108
108
|
const out: CompletionArg[] = [];
|
|
109
|
-
const args =
|
|
109
|
+
const args = command.args ?? {};
|
|
110
110
|
for (const name in args) {
|
|
111
111
|
const desc = args[name];
|
|
112
112
|
out.push({ name, description: desc.description ?? "", value: argValue(desc) });
|
package/src/cli/flag-tables.ts
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
* real implementations at the dispatch site.
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
+
import { isServiceTierOpenAISettingValue, SERVICE_TIER_OPENAI_VALUES } from "../config/service-tier";
|
|
33
34
|
import type { ConfiguredThinkingLevel } from "../thinking";
|
|
34
35
|
import type { Args } from "./args";
|
|
35
36
|
import { CliUsageError } from "./usage-error";
|
|
@@ -152,6 +153,14 @@ export const STRING_SETTERS: Record<string, StringSetter> = {
|
|
|
152
153
|
"--max-time": (result, value) => {
|
|
153
154
|
result.maxTime = parseMaxTimeSeconds(value);
|
|
154
155
|
},
|
|
156
|
+
"--service-tier": (result, value) => {
|
|
157
|
+
if (!isServiceTierOpenAISettingValue(value)) {
|
|
158
|
+
throw new CliUsageError(
|
|
159
|
+
`Invalid --service-tier value: ${JSON.stringify(value)}. Expected one of: ${SERVICE_TIER_OPENAI_VALUES.join(", ")}.`,
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
result.serviceTier = value;
|
|
163
|
+
},
|
|
155
164
|
"--api-key": (result, value) => {
|
|
156
165
|
result.apiKey = value;
|
|
157
166
|
},
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import "@oh-my-pi/pi-utils/env";
|
|
2
|
+
import { APP_NAME, CONFIG_DIR_NAME } from "@oh-my-pi/pi-utils/dirs";
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
|
|
5
|
+
export function getExtraHelpText(): string {
|
|
6
|
+
return `${chalk.bold("Environment Variables:")}
|
|
7
|
+
${chalk.dim("# Core Providers")}
|
|
8
|
+
ANTHROPIC_API_KEY - Anthropic Claude models
|
|
9
|
+
ANTHROPIC_OAUTH_TOKEN - Anthropic OAuth (takes precedence over API key)
|
|
10
|
+
CLAUDE_CODE_USE_FOUNDRY - Enable Anthropic Foundry mode (uses Foundry endpoint + mTLS)
|
|
11
|
+
FOUNDRY_BASE_URL - Anthropic Foundry base URL (e.g., https://<foundry-host>)
|
|
12
|
+
ANTHROPIC_FOUNDRY_API_KEY - Anthropic token used as Authorization: Bearer <token> in Foundry mode
|
|
13
|
+
ANTHROPIC_CUSTOM_HEADERS - Extra headers for Foundry or any custom ANTHROPIC_BASE_URL gateway (e.g., "user-id: USERNAME")
|
|
14
|
+
CLAUDE_CODE_CLIENT_CERT - Client certificate (PEM path or inline PEM) for mTLS
|
|
15
|
+
CLAUDE_CODE_CLIENT_KEY - Client private key (PEM path or inline PEM) for mTLS
|
|
16
|
+
NODE_EXTRA_CA_CERTS - CA bundle path (or inline PEM) for server certificate validation
|
|
17
|
+
OPENAI_API_KEY - OpenAI GPT models
|
|
18
|
+
GEMINI_API_KEY - Google Gemini models
|
|
19
|
+
COPILOT_GITHUB_TOKEN - GitHub Copilot
|
|
20
|
+
|
|
21
|
+
${chalk.dim("# Additional LLM Providers")}
|
|
22
|
+
AZURE_OPENAI_API_KEY - Azure OpenAI models
|
|
23
|
+
GROQ_API_KEY - Groq models
|
|
24
|
+
CEREBRAS_API_KEY - Cerebras models
|
|
25
|
+
XAI_API_KEY - xAI Grok models
|
|
26
|
+
OPENROUTER_API_KEY - OpenRouter aggregated models
|
|
27
|
+
KILO_API_KEY - Kilo Gateway models
|
|
28
|
+
MISTRAL_API_KEY - Mistral models
|
|
29
|
+
ZAI_API_KEY - z.ai models (ZhipuAI/GLM)
|
|
30
|
+
UMANS_AI_CODING_PLAN_API_KEY - Umans AI Coding Plan models
|
|
31
|
+
UMANS_WEBSEARCH_PROVIDER - Umans gateway web search backend (native or exa)
|
|
32
|
+
MINIMAX_API_KEY - MiniMax models
|
|
33
|
+
OPENCODE_API_KEY - OpenCode Zen/OpenCode Go models
|
|
34
|
+
CURSOR_ACCESS_TOKEN - Cursor AI models
|
|
35
|
+
AI_GATEWAY_API_KEY - Vercel AI Gateway
|
|
36
|
+
WAFER_SERVERLESS_API_KEY - Wafer Serverless (pay-as-you-go)
|
|
37
|
+
|
|
38
|
+
${chalk.dim("# Cloud Providers")}
|
|
39
|
+
AWS_PROFILE - AWS Bedrock (or AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY)
|
|
40
|
+
GOOGLE_CLOUD_PROJECT - Google Vertex AI (requires GOOGLE_CLOUD_LOCATION)
|
|
41
|
+
GOOGLE_APPLICATION_CREDENTIALS - Service account for Vertex AI
|
|
42
|
+
|
|
43
|
+
${chalk.dim("# Search & Tools")}
|
|
44
|
+
EXA_API_KEY - Exa web search
|
|
45
|
+
BRAVE_API_KEY - Brave web search
|
|
46
|
+
PERPLEXITY_API_KEY - Perplexity web search API key (optional; anonymous fallback)
|
|
47
|
+
PERPLEXITY_COOKIES - Perplexity web search (session cookie)
|
|
48
|
+
TAVILY_API_KEY - Tavily web search
|
|
49
|
+
TINYFISH_API_KEY - TinyFish web search
|
|
50
|
+
FIRECRAWL_API_KEY - Firecrawl web search
|
|
51
|
+
ANTHROPIC_SEARCH_API_KEY - Anthropic web search (override; isolates search from main ANTHROPIC_API_KEY)
|
|
52
|
+
ANTHROPIC_SEARCH_BASE_URL - Anthropic web search base URL (override; pairs with ANTHROPIC_SEARCH_API_KEY)
|
|
53
|
+
|
|
54
|
+
${chalk.dim("# Configuration")}
|
|
55
|
+
OMP_PROFILE - Named profile for isolated agent state (same as --profile)
|
|
56
|
+
Use \`omp --profile <name> --alias <command>\` to create a shell shortcut for a profile
|
|
57
|
+
PI_CODING_AGENT_DIR - Session storage directory (default: ~/${CONFIG_DIR_NAME}/agent)
|
|
58
|
+
PI_PACKAGE_DIR - Override package directory (for Nix/Guix store paths)
|
|
59
|
+
PI_SMOL_MODEL - Override smol/fast model (see --smol)
|
|
60
|
+
PI_SLOW_MODEL - Override slow/reasoning model (see --slow)
|
|
61
|
+
PI_PLAN_MODEL - Override planning model (see --plan)
|
|
62
|
+
PI_NO_PTY - Disable PTY-based interactive bash execution
|
|
63
|
+
For complete environment variable reference, see:
|
|
64
|
+
${chalk.dim("docs/environment-variables.md")}
|
|
65
|
+
${chalk.bold("Available Tools (default-enabled unless noted):")}
|
|
66
|
+
read - Read file contents
|
|
67
|
+
bash - Execute bash commands
|
|
68
|
+
edit - Edit files with find/replace
|
|
69
|
+
write - Write files (creates/overwrites)
|
|
70
|
+
grep - Search file contents
|
|
71
|
+
glob - Find files by glob pattern
|
|
72
|
+
lsp - Language server protocol (code intelligence)
|
|
73
|
+
python - Execute Python code (requires: ${APP_NAME} setup python)
|
|
74
|
+
notebook - Edit Jupyter notebooks
|
|
75
|
+
inspect_image - Analyze images with a vision model
|
|
76
|
+
browser - Browser automation (Puppeteer)
|
|
77
|
+
computer - Native host desktop capture and input (disabled by default)
|
|
78
|
+
task - Launch sub-agents for parallel tasks
|
|
79
|
+
todo - Manage todo/task lists
|
|
80
|
+
web_search - Search the web
|
|
81
|
+
ask - Ask user questions (interactive mode only)
|
|
82
|
+
|
|
83
|
+
${chalk.bold("Plugin Options:")}
|
|
84
|
+
--plugin-dir <path> Load plugin from directory (repeatable)
|
|
85
|
+
|
|
86
|
+
${chalk.bold("Useful Commands:")}
|
|
87
|
+
omp agents unpack - Export bundled subagents to ~/.omp/agent/agents (default)
|
|
88
|
+
omp agents unpack --project - Export bundled subagents to ./.omp/agents`;
|
|
89
|
+
}
|