@oh-my-pi/pi-coding-agent 17.2.4 → 17.2.6
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 +69 -0
- package/dist/{CHANGELOG-bpmhv26t.md → CHANGELOG-gs76k6wc.md} +69 -0
- package/dist/cli.js +4438 -3962
- 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/gc-cli.d.ts +1 -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 +15 -4
- 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 +19 -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/btw-panel.d.ts +3 -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/btw-controller.d.ts +2 -0
- package/dist/types/modes/controllers/command-controller.d.ts +1 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +5 -1
- package/dist/types/modes/types.d.ts +4 -1
- 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/security/contracts/schemas.d.ts +405 -403
- package/dist/types/session/agent-session-types.d.ts +8 -1
- package/dist/types/session/agent-session.d.ts +26 -2
- package/dist/types/session/indexed-session-storage.d.ts +1 -0
- package/dist/types/session/launch-completion.d.ts +10 -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-entries.d.ts +15 -1
- package/dist/types/session/session-maintenance.d.ts +1 -0
- package/dist/types/session/session-manager.d.ts +23 -11
- package/dist/types/session/session-stats.d.ts +10 -0
- package/dist/types/session/session-storage.d.ts +15 -3
- package/dist/types/session/yield-queue.d.ts +6 -1
- 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/index.d.ts +9 -0
- 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/gc-cli.ts +641 -21
- 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 +44 -27
- package/src/config/model-registry.ts +19 -13
- 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/config/settings.ts +1 -1
- 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/index.ts +10 -3
- package/src/export/html/template.js +8 -26
- package/src/export/share.ts +4 -0
- 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 +223 -7
- package/src/launch/client.ts +192 -21
- package/src/launch/ensure.ts +73 -0
- package/src/launch/paths.ts +1 -1
- package/src/launch/protocol.ts +54 -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 +20 -8
- package/src/mcp/config-writer.ts +1 -1
- 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/btw-panel.ts +41 -4
- 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/btw-controller.ts +55 -7
- package/src/modes/controllers/command-controller.ts +31 -0
- package/src/modes/controllers/event-controller.ts +17 -0
- package/src/modes/controllers/input-controller.ts +63 -8
- 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 +18 -2
- package/src/modes/types.ts +9 -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/session/launch-completion.md +1 -0
- 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 +49 -6
- package/src/secrets/index.ts +1 -1
- package/src/security/contracts/schemas.ts +205 -183
- package/src/security/contracts/validation.ts +5 -1
- package/src/security/store.ts +2 -2
- package/src/session/agent-session-types.ts +9 -1
- package/src/session/agent-session.ts +204 -15
- package/src/session/indexed-session-storage.ts +9 -0
- package/src/session/launch-completion.ts +37 -0
- package/src/session/prewalk.ts +24 -2
- package/src/session/session-advisors.ts +2 -2
- package/src/session/session-context.ts +42 -12
- package/src/session/session-dump-format.ts +1 -1
- package/src/session/session-entries.ts +17 -1
- package/src/session/session-maintenance.ts +38 -4
- package/src/session/session-manager.ts +123 -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/session/yield-queue.ts +121 -16
- package/src/slash-commands/builtin-registry.ts +37 -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 +97 -14
- 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/hub/launch.ts +122 -6
- package/src/tools/index.ts +9 -0
- 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
- package/dist/types/config/file-lock.d.ts +0 -29
- package/src/config/file-lock.ts +0 -164
|
@@ -13,6 +13,8 @@ export declare const SERVICE_TIER_GOOGLE_VALUES: readonly ["none", "flex", "prio
|
|
|
13
13
|
export type ServiceTierOpenAISettingValue = (typeof SERVICE_TIER_OPENAI_VALUES)[number];
|
|
14
14
|
export type ServiceTierAnthropicSettingValue = (typeof SERVICE_TIER_ANTHROPIC_VALUES)[number];
|
|
15
15
|
export type ServiceTierGoogleSettingValue = (typeof SERVICE_TIER_GOOGLE_VALUES)[number];
|
|
16
|
+
/** Whether a runtime value is a supported OpenAI service-tier setting. */
|
|
17
|
+
export declare function isServiceTierOpenAISettingValue(value: string): value is ServiceTierOpenAISettingValue;
|
|
16
18
|
/** Whether a runtime value names a provider family with an independent service-tier knob. */
|
|
17
19
|
export declare function isServiceTierFamily(value: unknown): value is ServiceTierFamily;
|
|
18
20
|
/** Whether a runtime value is a supported service tier for one provider family. */
|
|
@@ -924,6 +924,16 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
924
924
|
readonly description: "Reveal assistant text and streamed tool input smoothly while chunks arrive";
|
|
925
925
|
};
|
|
926
926
|
};
|
|
927
|
+
readonly "display.hideToolActivity": {
|
|
928
|
+
readonly type: "boolean";
|
|
929
|
+
readonly default: false;
|
|
930
|
+
readonly ui: {
|
|
931
|
+
readonly tab: "appearance";
|
|
932
|
+
readonly group: "Display";
|
|
933
|
+
readonly label: "Hide Tool Activity";
|
|
934
|
+
readonly description: "Hide model-initiated tool calls and results from the transcript";
|
|
935
|
+
};
|
|
936
|
+
};
|
|
927
937
|
readonly "display.showTokenUsage": {
|
|
928
938
|
readonly type: "boolean";
|
|
929
939
|
readonly default: false;
|
|
@@ -3499,6 +3509,16 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
3499
3509
|
readonly description: "Start language servers on first use (lsp tool or editing a matching file type) instead of at session startup";
|
|
3500
3510
|
};
|
|
3501
3511
|
};
|
|
3512
|
+
readonly "lsp.shared": {
|
|
3513
|
+
readonly type: "boolean";
|
|
3514
|
+
readonly default: true;
|
|
3515
|
+
readonly ui: {
|
|
3516
|
+
readonly tab: "files";
|
|
3517
|
+
readonly group: "LSP";
|
|
3518
|
+
readonly label: "Shared Language Servers";
|
|
3519
|
+
readonly description: "Share one language server per project across omp instances via the daemon broker (falls back to private servers when unavailable)";
|
|
3520
|
+
};
|
|
3521
|
+
};
|
|
3502
3522
|
readonly "lsp.formatOnWrite": {
|
|
3503
3523
|
readonly type: "boolean";
|
|
3504
3524
|
readonly default: false;
|
|
@@ -3994,25 +4014,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
3994
4014
|
readonly tab: "tools";
|
|
3995
4015
|
readonly group: "Available Tools";
|
|
3996
4016
|
readonly label: "Computer";
|
|
3997
|
-
readonly description: "Enable
|
|
3998
|
-
};
|
|
3999
|
-
};
|
|
4000
|
-
readonly "computer.backend": {
|
|
4001
|
-
readonly type: "enum";
|
|
4002
|
-
readonly values: readonly ["auto", "native"];
|
|
4003
|
-
readonly default: "auto";
|
|
4004
|
-
readonly ui: {
|
|
4005
|
-
readonly tab: "tools";
|
|
4006
|
-
readonly group: "Computer";
|
|
4007
|
-
readonly label: "Computer Backend";
|
|
4008
|
-
readonly description: "Select automatic or explicit platform-native desktop capture and input";
|
|
4009
|
-
readonly options: readonly [{
|
|
4010
|
-
readonly value: "auto";
|
|
4011
|
-
readonly label: "Auto";
|
|
4012
|
-
}, {
|
|
4013
|
-
readonly value: "native";
|
|
4014
|
-
readonly label: "Native";
|
|
4015
|
-
}];
|
|
4017
|
+
readonly description: "Enable the scriptable host-desktop control tool (screenshots, input, accessibility)";
|
|
4016
4018
|
};
|
|
4017
4019
|
};
|
|
4018
4020
|
readonly "computer.display": {
|
|
@@ -4027,7 +4029,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4027
4029
|
};
|
|
4028
4030
|
readonly "computer.maxWidth": {
|
|
4029
4031
|
readonly type: "number";
|
|
4030
|
-
readonly default:
|
|
4032
|
+
readonly default: 3840;
|
|
4031
4033
|
readonly ui: {
|
|
4032
4034
|
readonly tab: "tools";
|
|
4033
4035
|
readonly group: "Computer";
|
|
@@ -4037,7 +4039,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4037
4039
|
};
|
|
4038
4040
|
readonly "computer.maxHeight": {
|
|
4039
4041
|
readonly type: "number";
|
|
4040
|
-
readonly default:
|
|
4042
|
+
readonly default: 2400;
|
|
4041
4043
|
readonly ui: {
|
|
4042
4044
|
readonly tab: "tools";
|
|
4043
4045
|
readonly group: "Computer";
|
|
@@ -4191,6 +4193,26 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4191
4193
|
readonly description: "Default HTTP CDP discovery endpoint (for example http://127.0.0.1:9222) to attach to instead of launching a browser. Explicit app.cdp_url or app.path on the tool call take precedence.";
|
|
4192
4194
|
};
|
|
4193
4195
|
};
|
|
4196
|
+
readonly "browser.relay": {
|
|
4197
|
+
readonly type: "boolean";
|
|
4198
|
+
readonly default: false;
|
|
4199
|
+
readonly ui: {
|
|
4200
|
+
readonly tab: "tools";
|
|
4201
|
+
readonly group: "Grep & Browser";
|
|
4202
|
+
readonly label: "Browser Relay";
|
|
4203
|
+
readonly description: "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.";
|
|
4204
|
+
};
|
|
4205
|
+
};
|
|
4206
|
+
readonly "browser.relayUrl": {
|
|
4207
|
+
readonly type: "string";
|
|
4208
|
+
readonly default: undefined;
|
|
4209
|
+
readonly ui: {
|
|
4210
|
+
readonly tab: "tools";
|
|
4211
|
+
readonly group: "Grep & Browser";
|
|
4212
|
+
readonly label: "Browser Relay URL";
|
|
4213
|
+
readonly description: "omp browser relay endpoint (default http://127.0.0.1:9224).";
|
|
4214
|
+
};
|
|
4215
|
+
};
|
|
4194
4216
|
readonly "browser.headless": {
|
|
4195
4217
|
readonly type: "boolean";
|
|
4196
4218
|
readonly default: true;
|
|
@@ -5186,6 +5208,32 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
5186
5208
|
})[];
|
|
5187
5209
|
};
|
|
5188
5210
|
};
|
|
5211
|
+
readonly "providers.webSearchTimeoutSeconds": {
|
|
5212
|
+
readonly type: "number";
|
|
5213
|
+
readonly default: 60;
|
|
5214
|
+
readonly ui: {
|
|
5215
|
+
readonly tab: "providers";
|
|
5216
|
+
readonly group: "Services";
|
|
5217
|
+
readonly label: "Web Search Timeout";
|
|
5218
|
+
readonly description: "Hard timeout for each provider's search transport before web_search advances to the next fallback, in seconds (maximum 300)";
|
|
5219
|
+
readonly options: readonly [{
|
|
5220
|
+
readonly value: "30";
|
|
5221
|
+
readonly label: "30 seconds";
|
|
5222
|
+
}, {
|
|
5223
|
+
readonly value: "60";
|
|
5224
|
+
readonly label: "1 minute";
|
|
5225
|
+
}, {
|
|
5226
|
+
readonly value: "120";
|
|
5227
|
+
readonly label: "2 minutes";
|
|
5228
|
+
}, {
|
|
5229
|
+
readonly value: "180";
|
|
5230
|
+
readonly label: "3 minutes";
|
|
5231
|
+
}, {
|
|
5232
|
+
readonly value: "300";
|
|
5233
|
+
readonly label: "5 minutes";
|
|
5234
|
+
}];
|
|
5235
|
+
};
|
|
5236
|
+
};
|
|
5189
5237
|
readonly "providers.webSearchGeminiModel": {
|
|
5190
5238
|
readonly type: "string";
|
|
5191
5239
|
readonly default: undefined;
|
|
@@ -25,7 +25,7 @@ export declare function createBridgeGrepFactory(session: ToolSession, extensionR
|
|
|
25
25
|
/**
|
|
26
26
|
* Build the `replace`-mode `edit` the bridge answers `pi_edit` with.
|
|
27
27
|
*
|
|
28
|
-
* `PiEditExecArgs` carries `
|
|
28
|
+
* `PiEditExecArgs` carries `old_string`/`new_string` replacements, which is exactly
|
|
29
29
|
* `replace`'s schema and nothing else's. The session's own instance follows the
|
|
30
30
|
* configured `edit.mode` — `hashline` by default, whose schema is a single
|
|
31
31
|
* `input` string — so a frame handed that instance fails validation instead of
|
package/dist/types/cursor.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ interface CursorExecBridgeOptions {
|
|
|
38
38
|
*
|
|
39
39
|
* `PiEditExecArgs` is that mode's schema verbatim, and the session's own
|
|
40
40
|
* `edit` may be in any mode — `hashline` by default — whose schema rejects
|
|
41
|
-
* `
|
|
41
|
+
* `old_string`/`new_string` outright. {@link tools} therefore cannot be trusted
|
|
42
42
|
* for this one frame: a session that starts on another provider keeps its
|
|
43
43
|
* configured instance in the map (only Cursor sessions move `edit` out), and
|
|
44
44
|
* switching to Cursor later does not rebuild the roster.
|
|
@@ -150,9 +150,12 @@ export declare class CursorExecHandlers implements ICursorExecHandlers {
|
|
|
150
150
|
piRead(call: Parameters<NonNullable<ICursorExecHandlers["piRead"]>>[0]): Promise<ToolResultMessage<unknown>>;
|
|
151
151
|
piBash(call: Parameters<NonNullable<ICursorExecHandlers["piBash"]>>[0]): Promise<ToolResultMessage<unknown>>;
|
|
152
152
|
/**
|
|
153
|
-
* `PiEditExecArgs`
|
|
154
|
-
*
|
|
155
|
-
*
|
|
153
|
+
* `PiEditExecArgs` carries a path plus `oldText`/`newText` replacement
|
|
154
|
+
* pairs. A single replacement maps onto the model-facing single-edit
|
|
155
|
+
* `replace` schema verbatim; a multi-replacement frame still runs as ONE
|
|
156
|
+
* tool lifecycle (one start/end event pair, one aggregate diff), so it is
|
|
157
|
+
* sent in the tool's internal `edits` batch form (`ReplaceBatchParams`),
|
|
158
|
+
* which only this bridge produces.
|
|
156
159
|
*
|
|
157
160
|
* The replace-mode instance is requested explicitly rather than resolved
|
|
158
161
|
* from {@link CursorExecBridgeOptions.tools}: the registry's `edit` is in
|
|
@@ -5,7 +5,7 @@ import { type EditMode } from "../utils/edit-mode.js";
|
|
|
5
5
|
import { hashlineEditParamsSchema } from "./hashline/index.js";
|
|
6
6
|
import { type ApplyPatchParams, applyPatchSchema } from "./modes/apply-patch.js";
|
|
7
7
|
import { type PatchParams, patchEditSchema } from "./modes/patch.js";
|
|
8
|
-
import { type ReplaceParams, replaceEditSchema } from "./modes/replace.js";
|
|
8
|
+
import { type ReplaceBatchParams, type ReplaceParams, replaceEditSchema } from "./modes/replace.js";
|
|
9
9
|
import { type EditToolDetails } from "./renderer.js";
|
|
10
10
|
export * from "@oh-my-pi/hashline";
|
|
11
11
|
export { DEFAULT_EDIT_MODE, type EditMode, normalizeEditMode } from "../utils/edit-mode.js";
|
|
@@ -22,7 +22,7 @@ export * from "./snapshot-details.js";
|
|
|
22
22
|
export * from "./streaming.js";
|
|
23
23
|
type TInput = typeof replaceEditSchema | typeof patchEditSchema | typeof hashlineEditParamsSchema | typeof applyPatchSchema;
|
|
24
24
|
type HashlineParams = typeof hashlineEditParamsSchema.infer;
|
|
25
|
-
type EditParams = ReplaceParams | PatchParams | HashlineParams | ApplyPatchParams;
|
|
25
|
+
type EditParams = ReplaceParams | ReplaceBatchParams | PatchParams | HashlineParams | ApplyPatchParams;
|
|
26
26
|
export declare class EditTool implements AgentTool<TInput> {
|
|
27
27
|
#private;
|
|
28
28
|
private readonly session;
|
|
@@ -36,7 +36,7 @@ export declare class EditTool implements AgentTool<TInput> {
|
|
|
36
36
|
/**
|
|
37
37
|
* `mode` pins the edit variant for this instance, for callers whose protocol
|
|
38
38
|
* fixes the shape of an edit. The Cursor `pi_edit` frame carries
|
|
39
|
-
* `
|
|
39
|
+
* `old_string`/`new_string` args, which only `replace` accepts — under the
|
|
40
40
|
* default `hashline` mode those args do not match the schema at all. Left
|
|
41
41
|
* unset, the env/settings resolution applies as before.
|
|
42
42
|
*/
|
|
@@ -67,11 +67,15 @@ export declare function levenshteinDistance(a: string, b: string): number;
|
|
|
67
67
|
export declare function similarity(a: string, b: string): number;
|
|
68
68
|
/**
|
|
69
69
|
* Find a match for target text within content.
|
|
70
|
-
* Used primarily for replace-mode edits.
|
|
70
|
+
* Used primarily for replace-mode edits; excluded ranges remain invisible to exact and fuzzy matching.
|
|
71
71
|
*/
|
|
72
72
|
export declare function findMatch(content: string, target: string, options: {
|
|
73
73
|
allowFuzzy: boolean;
|
|
74
74
|
threshold?: number;
|
|
75
|
+
excludedRanges?: readonly {
|
|
76
|
+
startIndex: number;
|
|
77
|
+
endIndex: number;
|
|
78
|
+
}[];
|
|
75
79
|
}): MatchOutcome;
|
|
76
80
|
/**
|
|
77
81
|
* Find a sequence of pattern lines within content lines.
|
|
@@ -112,25 +116,28 @@ export declare function findContextLine(lines: string[], context: string, startF
|
|
|
112
116
|
allowFuzzy?: boolean;
|
|
113
117
|
skipFunctionFallback?: boolean;
|
|
114
118
|
}): ContextLineResult;
|
|
115
|
-
export declare const replaceEditEntrySchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
116
|
-
old_text: string;
|
|
117
|
-
new_text: string;
|
|
118
|
-
all?: boolean | undefined;
|
|
119
|
-
}, {}>;
|
|
120
119
|
export declare const replaceEditSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
121
120
|
path: string;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
all?: boolean | undefined;
|
|
126
|
-
}[];
|
|
121
|
+
old_string: string;
|
|
122
|
+
new_string: string;
|
|
123
|
+
replace_all?: boolean | undefined;
|
|
127
124
|
}, {}>;
|
|
128
|
-
export type ReplaceEditEntry = typeof replaceEditEntrySchema.infer;
|
|
129
125
|
export type ReplaceParams = typeof replaceEditSchema.infer;
|
|
130
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Internal batch form of {@link ReplaceParams}, produced only by the Cursor
|
|
128
|
+
* exec bridge: a `pi_edit` frame carries several replacements against one
|
|
129
|
+
* path but must run as a single tool lifecycle with one aggregate result.
|
|
130
|
+
* Never advertised to the model — the agent loop validates model calls
|
|
131
|
+
* against {@link replaceEditSchema}, which has no `edits` field.
|
|
132
|
+
*/
|
|
133
|
+
export interface ReplaceBatchParams {
|
|
134
|
+
path: string;
|
|
135
|
+
edits: Omit<ReplaceParams, "path">[];
|
|
136
|
+
}
|
|
137
|
+
export interface ExecuteReplaceOptions {
|
|
131
138
|
session: ToolSession;
|
|
132
139
|
path: string;
|
|
133
|
-
params:
|
|
140
|
+
params: Omit<ReplaceParams, "path">;
|
|
134
141
|
signal?: AbortSignal;
|
|
135
142
|
batchRequest?: LspBatchRequest;
|
|
136
143
|
allowFuzzy: boolean;
|
|
@@ -138,4 +145,4 @@ export interface ExecuteReplaceSingleOptions {
|
|
|
138
145
|
writethrough: WritethroughCallback;
|
|
139
146
|
beginDeferredDiagnosticsForPath: (path: string) => WritethroughDeferredHandle;
|
|
140
147
|
}
|
|
141
|
-
export declare function
|
|
148
|
+
export declare function executeReplace(options: ExecuteReplaceOptions): Promise<AgentToolResult<EditToolDetails, ReplaceParams>>;
|
|
@@ -10,7 +10,9 @@ export interface PythonKernelAvailability {
|
|
|
10
10
|
/** The probed-working runtime, when one was found. */
|
|
11
11
|
runtime?: PythonRuntime;
|
|
12
12
|
}
|
|
13
|
-
export declare function checkPythonKernelAvailability(cwd: string, interpreter?: string
|
|
13
|
+
export declare function checkPythonKernelAvailability(cwd: string, interpreter?: string, options?: {
|
|
14
|
+
forceProbe?: boolean;
|
|
15
|
+
}): Promise<PythonKernelAvailability>;
|
|
14
16
|
export declare class PythonKernel extends BaseKernel {
|
|
15
17
|
private constructor();
|
|
16
18
|
static start(options: KernelStartOptions): Promise<PythonKernel>;
|
|
@@ -37,16 +37,16 @@ export declare function shouldHideKernelWindow(opts: {
|
|
|
37
37
|
*/
|
|
38
38
|
export declare function shouldDetachKernel(platform: NodeJS.Platform): boolean;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Combine native Win32 and stdio TTY evidence of an inheritable console.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* Win32 probe over this fallback whenever possible.
|
|
42
|
+
* `GetConsoleWindow()` detects classic consoles even when every stdio stream
|
|
43
|
+
* is redirected. TTY detection covers ConPTY-backed terminals, where compiled
|
|
44
|
+
* hosts can receive a null HWND despite being attached to Windows Terminal.
|
|
45
|
+
* Either signal must preserve console inheritance: `CREATE_NO_WINDOW` can
|
|
46
|
+
* deadlock NumPy native-extension loading in the Python child.
|
|
48
47
|
*/
|
|
49
|
-
export declare function
|
|
48
|
+
export declare function consoleAttached(opts: {
|
|
49
|
+
nativeConsole?: boolean | null;
|
|
50
50
|
stdinIsTTY: boolean;
|
|
51
51
|
stdoutIsTTY: boolean;
|
|
52
52
|
stderrIsTTY: boolean;
|
|
@@ -56,13 +56,9 @@ export declare function __resetWindowsConsoleProbeCache(): void;
|
|
|
56
56
|
/**
|
|
57
57
|
* Whether the host process owns a console its children can inherit.
|
|
58
58
|
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* correctly classified as console-attached and the kernel keeps its
|
|
64
|
-
* inheritable console.
|
|
65
|
-
* - On any other platform, or if the FFI probe fails, fall back to the
|
|
66
|
-
* TTY-OR heuristic. That still catches the common interactive cases.
|
|
59
|
+
* On Windows, `GetConsoleWindow()` detects classic consoles and all-stdio-
|
|
60
|
+
* redirected launches while stdio TTYs detect ConPTY-backed terminals. Either
|
|
61
|
+
* signal is sufficient. Other platforms use the same TTY evidence, although
|
|
62
|
+
* `windowsHide` is a no-op there.
|
|
67
63
|
*/
|
|
68
64
|
export declare function hostHasInheritableConsole(): boolean;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* `types.ts` via the `export *` below — pi-ai still exports both as types,
|
|
20
20
|
* only the runtime `Type` builder and `StringEnum()` helper were removed.
|
|
21
21
|
*/
|
|
22
|
-
import type
|
|
22
|
+
import { type Api, type AssistantMessage, type AssistantMessageEventStream, type Context, type Model, type SimpleStreamOptions } from "@oh-my-pi/pi-ai";
|
|
23
23
|
import type { Effort } from "@oh-my-pi/pi-catalog/effort";
|
|
24
24
|
import { calculateCost, getBundledModel, getBundledModels, getBundledProviders, modelsAreEqual } from "@oh-my-pi/pi-catalog/models";
|
|
25
25
|
import { type TSchema, Type } from "./typebox.js";
|
|
@@ -54,6 +54,13 @@ export * from "@oh-my-pi/pi-ai";
|
|
|
54
54
|
export { calculateCost, getBundledModel, getBundledModels, getBundledProviders, modelsAreEqual, Type };
|
|
55
55
|
export declare const getModel: typeof getBundledModel;
|
|
56
56
|
export declare const getModels: typeof getBundledModels;
|
|
57
|
+
/**
|
|
58
|
+
* Stream OpenAI Responses through the historical simple-options contract.
|
|
59
|
+
*
|
|
60
|
+
* Legacy `/compat` callers pass {@link SimpleStreamOptions}; routing through
|
|
61
|
+
* `streamSimple` preserves option normalization before provider dispatch.
|
|
62
|
+
*/
|
|
63
|
+
export declare function streamSimpleOpenAIResponses(model: Model<"openai-responses">, context: Context, options?: SimpleStreamOptions): AssistantMessageEventStream;
|
|
57
64
|
/**
|
|
58
65
|
* Compatibility re-exports for runtime helpers that upstream
|
|
59
66
|
* `@earendil-works/pi-ai` exposed from its package root but omp's
|
|
@@ -398,7 +398,7 @@ export { getProjectDir } from "@oh-my-pi/pi-utils";
|
|
|
398
398
|
* canonical helper.
|
|
399
399
|
*/
|
|
400
400
|
export declare function getPackageDir(): string;
|
|
401
|
-
export { compact, estimateTokens } from "@oh-my-pi/pi-agent-core/compaction";
|
|
401
|
+
export { compact, estimateTokens, serializeConversation } from "@oh-my-pi/pi-agent-core/compaction";
|
|
402
402
|
export { CONFIG_DIR_NAME } from "@oh-my-pi/pi-utils";
|
|
403
403
|
export { parseArgs } from "../cli/args.js";
|
|
404
404
|
export * from "../index.js";
|
|
@@ -71,6 +71,8 @@ export declare function __rewriteLegacyExtensionSourceForTests(source: string, i
|
|
|
71
71
|
* no-op.
|
|
72
72
|
*/
|
|
73
73
|
export declare function ensureGraphCommonJsRequireRegistered(): void;
|
|
74
|
+
/** Test seam for compiled-binary dependency graph discovery and rewriting. */
|
|
75
|
+
export declare function __collectLegacyPiExtensionSourcesForTests(entryPath: string): Promise<ReadonlyMap<string, string>>;
|
|
74
76
|
/**
|
|
75
77
|
* Load a legacy Pi extension module from its real on-disk location.
|
|
76
78
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Start the detached
|
|
1
|
+
/** Start the detached project or global daemon broker selected by the CLI worker host. */
|
|
2
2
|
export declare function startDaemonBrokerFromEnvironment(): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DaemonOperation, type DaemonRpcResult } from "./protocol.js";
|
|
1
|
+
import { type DaemonCompletionNotification, type DaemonOperation, type DaemonRpcResult } from "./protocol.js";
|
|
2
2
|
/** Broker location and lifecycle overrides used by smoke tests and isolated consumers. */
|
|
3
3
|
export interface DaemonBrokerClientOptions {
|
|
4
4
|
/** Runtime directory override; defaults to the project-scoped config path. */
|
|
@@ -6,17 +6,28 @@ export interface DaemonBrokerClientOptions {
|
|
|
6
6
|
/** Last-client shutdown grace override in milliseconds. */
|
|
7
7
|
idleGraceMs?: number;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
export interface DaemonCompletionUnregisterOptions {
|
|
10
|
+
/** Detach this process without deleting broker-persisted pending notifications. */
|
|
11
|
+
preservePending?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Persistent per-process connection to one project or global daemon broker. */
|
|
10
14
|
export interface DaemonBrokerClient {
|
|
15
|
+
onCompletion(owner: string, sink: (notification: DaemonCompletionNotification) => Promise<void> | void): (options?: DaemonCompletionUnregisterOptions) => void;
|
|
16
|
+
/** Canonical project directory or synthetic directory identifying a global scope. */
|
|
11
17
|
readonly projectDir: string;
|
|
12
18
|
request(operation: DaemonOperation, signal?: AbortSignal): Promise<DaemonRpcResult>;
|
|
13
19
|
close(): void;
|
|
14
20
|
}
|
|
15
|
-
/**
|
|
21
|
+
/** A request reached the broker and the broker rejected the operation. */
|
|
22
|
+
export declare class DaemonBrokerRejectedError extends Error {
|
|
23
|
+
}
|
|
24
|
+
/** Create an independent socket connection to one daemon broker scope. */
|
|
16
25
|
export declare function createDaemonBrokerClient(projectDir: string, options?: DaemonBrokerClientOptions): Promise<DaemonBrokerClient>;
|
|
17
26
|
/** Get the process-shared daemon broker client for one canonical project directory. */
|
|
18
27
|
export declare function daemonClientForProject(projectDir: string): Promise<DaemonBrokerClient>;
|
|
19
|
-
/**
|
|
28
|
+
/** Get the process-shared client that leases one profile-independent, machine-global daemon broker. */
|
|
29
|
+
export declare function daemonClientForGlobal(service: string): Promise<DaemonBrokerClient>;
|
|
30
|
+
/** Close every project and machine-global broker connection held by this omp process. */
|
|
20
31
|
export declare function closeDaemonClients(): Promise<void>;
|
|
21
32
|
/** Exercise worker-host broker startup and authenticated RPC for distribution smoke tests. */
|
|
22
33
|
export declare function smokeTestDaemonBroker(): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DaemonBrokerClient } from "./client.js";
|
|
2
|
+
import type { DaemonSnapshot } from "./protocol.js";
|
|
3
|
+
/** Snapshot a broker daemon, treating "unknown daemon" and broker errors as absent. */
|
|
4
|
+
export declare function describeQuietly(client: DaemonBrokerClient, name: string, label: string, signal?: AbortSignal): Promise<DaemonSnapshot | undefined>;
|
|
5
|
+
/** Block until the daemon reports ready; undefined on timeout or pre-ready exit. */
|
|
6
|
+
export declare function waitReady(client: DaemonBrokerClient, name: string, label: string, signal?: AbortSignal, timeoutMs?: number): Promise<DaemonSnapshot | undefined>;
|
|
7
|
+
/** Best-effort stop before replacing a wedged or endpoint-less daemon. */
|
|
8
|
+
export declare function stopQuietly(client: DaemonBrokerClient, name: string, label: string, signal?: AbortSignal): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDaemonRuntimeDir } from "@oh-my-pi/pi-utils";
|
|
2
2
|
/** Resolve the private runtime directory shared by omp processes in one project directory. */
|
|
3
3
|
export { getDaemonRuntimeDir as daemonRuntimeDir };
|
|
4
|
-
/** Resolve the Unix socket or Windows named pipe used by one
|
|
4
|
+
/** Resolve the Unix socket or Windows named pipe used by one daemon broker scope. */
|
|
5
5
|
export declare function daemonBrokerEndpoint(projectDir: string, runtimeDir: string): string;
|
|
@@ -6,7 +6,7 @@ export declare const DAEMON_BROKER_WORKER_ARG = "__omp_worker_daemon_broker";
|
|
|
6
6
|
/** Fixed dimensions negotiated with every supervised PTY. */
|
|
7
7
|
export declare const DAEMON_PTY_COLUMNS = 120;
|
|
8
8
|
export declare const DAEMON_PTY_ROWS = 40;
|
|
9
|
-
/** Environment key carrying the broker's canonical project directory. */
|
|
9
|
+
/** Environment key carrying the broker's canonical project or synthetic global scope directory. */
|
|
10
10
|
export declare const DAEMON_PROJECT_DIR_ENV = "OMP_DAEMON_PROJECT_DIR";
|
|
11
11
|
/** Environment key carrying the broker's private runtime directory. */
|
|
12
12
|
export declare const DAEMON_RUNTIME_DIR_ENV = "OMP_DAEMON_RUNTIME_DIR";
|
|
@@ -36,7 +36,7 @@ export interface DaemonSpec {
|
|
|
36
36
|
persist: boolean;
|
|
37
37
|
detached: boolean;
|
|
38
38
|
}
|
|
39
|
-
/** Serializable daemon state visible to every client in one
|
|
39
|
+
/** Serializable daemon state visible to every client in one broker scope. */
|
|
40
40
|
export interface DaemonSnapshot {
|
|
41
41
|
name: string;
|
|
42
42
|
id: string;
|
|
@@ -150,6 +150,13 @@ export type DaemonRpcResult = {
|
|
|
150
150
|
export interface DaemonWireRequest {
|
|
151
151
|
id: string;
|
|
152
152
|
token: string;
|
|
153
|
+
owners?: string[];
|
|
154
|
+
detachedOwners?: string[];
|
|
155
|
+
completionEvents?: boolean;
|
|
156
|
+
completionAcks?: string[];
|
|
157
|
+
completionUnsubscribes?: string[];
|
|
158
|
+
completionReplays?: string[];
|
|
159
|
+
completionSubscriptionId?: string;
|
|
153
160
|
operation: DaemonOperation;
|
|
154
161
|
}
|
|
155
162
|
/** Response envelope kept raw until matched with its pending operation. */
|
|
@@ -162,6 +169,14 @@ export type DaemonWireResponse = {
|
|
|
162
169
|
ok: false;
|
|
163
170
|
error: string;
|
|
164
171
|
};
|
|
172
|
+
/** Unsolicited terminal completion sent to the socket that owns a daemon. */
|
|
173
|
+
export interface DaemonCompletionNotification {
|
|
174
|
+
event: "daemon-completed";
|
|
175
|
+
completionId: string;
|
|
176
|
+
owner: string;
|
|
177
|
+
daemon: DaemonSnapshot;
|
|
178
|
+
}
|
|
179
|
+
export type DaemonWireMessage = DaemonWireResponse | DaemonCompletionNotification;
|
|
165
180
|
/** Decode and validate a daemon launch specification. */
|
|
166
181
|
export declare function parseDaemonSpec(value: unknown): DaemonSpec;
|
|
167
182
|
/** Decode and validate one daemon snapshot. */
|
|
@@ -170,5 +185,7 @@ export declare function parseDaemonSnapshot(value: unknown): DaemonSnapshot;
|
|
|
170
185
|
export declare function parseDaemonWireRequest(value: unknown): DaemonWireRequest;
|
|
171
186
|
/** Decode a socket response envelope before resolving a pending call. */
|
|
172
187
|
export declare function parseDaemonWireResponse(value: unknown): DaemonWireResponse;
|
|
188
|
+
/** Decode one broker response or unsolicited completion notification. */
|
|
189
|
+
export declare function parseDaemonWireMessage(value: unknown): DaemonWireMessage;
|
|
173
190
|
/** Decode a broker result using its pending operation as the discriminator. */
|
|
174
191
|
export declare function parseDaemonRpcResult(operation: DaemonOperation, value: unknown): DaemonRpcResult;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { LspClient, ServerConfig } from "./types.js";
|
|
2
|
+
/** Enable or disable attaching to broker-shared language servers. */
|
|
3
|
+
export declare function setSharedLspEnabled(enabled: boolean): void;
|
|
2
4
|
/**
|
|
3
5
|
* Configure the idle timeout for LSP clients.
|
|
4
6
|
* @param ms - Timeout in milliseconds, or null/undefined to disable
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LspTransport } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Open a broker-shared transport for one language server, ensuring the mux
|
|
4
|
+
* daemon first. Returns null (after a debug log) when the shared path is
|
|
5
|
+
* unavailable so the caller falls back to a process-local spawn.
|
|
6
|
+
*/
|
|
7
|
+
export declare function connectSharedLspTransport(opts: {
|
|
8
|
+
command: string;
|
|
9
|
+
args: string[];
|
|
10
|
+
cwd: string;
|
|
11
|
+
env?: Record<string, string>;
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
}): Promise<LspTransport | null>;
|
|
14
|
+
/** Exercise worker-host mux startup and the ping handshake for distribution smoke tests. */
|
|
15
|
+
export declare function smokeTestLspMux(): Promise<void>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** Hidden CLI selector used to re-enter the LSP mux worker. */
|
|
2
|
+
export declare const LSP_MUX_WORKER_ARG = "__omp_worker_lsp_mux";
|
|
3
|
+
/** Environment key carrying the socket endpoint the mux must listen on. */
|
|
4
|
+
export declare const LSP_MUX_SOCKET_ENV = "OMP_LSP_MUX_SOCKET";
|
|
5
|
+
/** Environment key carrying the canonical project directory the mux serves. */
|
|
6
|
+
export declare const LSP_MUX_PROJECT_DIR_ENV = "OMP_LSP_MUX_PROJECT_DIR";
|
|
7
|
+
/** Stable broker daemon name for the shared LSP mux. */
|
|
8
|
+
export declare const LSP_MUX_DAEMON_NAME = "omp.lsp.mux";
|
|
9
|
+
/** Broker readiness regex matched against the banner printed by the worker. */
|
|
10
|
+
export declare const LSP_MUX_READY_PATTERN: string;
|
|
11
|
+
/** Banner printed on stdout once the mux socket accepts connections. */
|
|
12
|
+
export declare function lspMuxReadyBanner(endpoint: string): string;
|
|
13
|
+
/** Resolve the Unix socket or Windows named pipe for one project scope. */
|
|
14
|
+
export declare function lspMuxEndpoint(projectDir: string, runtimeDir: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* First (and only pre-LSP) request on a fresh connection: binds the link to
|
|
17
|
+
* one shared server instance, spawning it on first use. Params:
|
|
18
|
+
* {@link MuxConnectParams}, result: {@link MuxConnectResult}. After the
|
|
19
|
+
* response the link carries ordinary LSP traffic for that server.
|
|
20
|
+
*/
|
|
21
|
+
export declare const MUX_CONNECT_METHOD = "omp/muxConnect";
|
|
22
|
+
/**
|
|
23
|
+
* Liveness probe answered with {@link MUX_PING_RESULT} without binding the
|
|
24
|
+
* link to a server. Used by the smoke probe and the ensure loop.
|
|
25
|
+
*/
|
|
26
|
+
export declare const MUX_PING_METHOD = "omp/muxPing";
|
|
27
|
+
export declare const MUX_PING_RESULT = "pong";
|
|
28
|
+
/**
|
|
29
|
+
* Notification on a bound link: kill the shared server process (all sessions
|
|
30
|
+
* on it are disconnected). Sent by `lsp reload` when the generic reload path
|
|
31
|
+
* decides the server is wedged — a plain per-session `shutdown`/`exit` is
|
|
32
|
+
* intercepted by the mux and would leave the wedged server running for
|
|
33
|
+
* every other instance.
|
|
34
|
+
*/
|
|
35
|
+
export declare const MUX_RESTART_METHOD = "omp/muxRestartServer";
|
|
36
|
+
/** Handshake parameters identifying (and if needed spawning) a shared server. */
|
|
37
|
+
export interface MuxConnectParams {
|
|
38
|
+
/** Executable to spawn (the client's `resolvedCommand ?? command`). */
|
|
39
|
+
command: string;
|
|
40
|
+
/** Arguments passed verbatim to the executable. */
|
|
41
|
+
args: string[];
|
|
42
|
+
/** Workspace root the server runs in; part of the server identity key. */
|
|
43
|
+
cwd: string;
|
|
44
|
+
/** Extra environment overlaid on the mux daemon's own env for the spawn. */
|
|
45
|
+
env?: Record<string, string>;
|
|
46
|
+
}
|
|
47
|
+
/** Handshake result. */
|
|
48
|
+
export interface MuxConnectResult {
|
|
49
|
+
/** Server identity key inside the mux (`${command}:${cwd}`). */
|
|
50
|
+
key: string;
|
|
51
|
+
/** True when this handshake spawned the server process. */
|
|
52
|
+
spawned: boolean;
|
|
53
|
+
/** Pid of the shared server process. */
|
|
54
|
+
pid?: number;
|
|
55
|
+
}
|
|
56
|
+
/** Server identity key used by the mux registry. */
|
|
57
|
+
export declare function muxServerKey(command: string, cwd: string): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Broker-owned, in-process-testable multiplexer for shared language-server children.
|
|
3
|
+
*/
|
|
4
|
+
export declare class LspMuxServer {
|
|
5
|
+
#private;
|
|
6
|
+
/** Called after the mux has had no connected sessions for its idle grace period. */
|
|
7
|
+
onIdle?: () => void;
|
|
8
|
+
/** Number of currently connected mux links, including unbound ping links. */
|
|
9
|
+
get sessionCount(): number;
|
|
10
|
+
/** Keys of currently live shared language-server children. */
|
|
11
|
+
get serverKeys(): string[];
|
|
12
|
+
/** Listen for Content-Length framed mux links at a Unix socket or named pipe. */
|
|
13
|
+
listen(endpoint: string): Promise<void>;
|
|
14
|
+
/** Gracefully close all children, links, and the listening endpoint. */
|
|
15
|
+
shutdown(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
/** Start the detached LSP mux selected by the CLI worker host environment. */
|
|
18
|
+
export declare function startLspMuxFromEnvironment(): Promise<void>;
|