@oh-my-pi/pi-coding-agent 17.2.3 → 17.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +92 -0
- package/dist/{CHANGELOG-c5hpqt9r.md → CHANGELOG-q2w43aw3.md} +92 -0
- package/dist/cli.js +3979 -3548
- package/dist/{template-8vdv6xb4.js → template-c2hyaytt.js} +8 -26
- package/dist/types/advisor/advise-tool.d.ts +6 -0
- package/dist/types/advisor/runtime.d.ts +4 -4
- package/dist/types/capability/mcp.d.ts +9 -0
- package/dist/types/cli/args.d.ts +4 -1
- package/dist/types/cli/browser-relay-cli.d.ts +15 -0
- package/dist/types/cli/command-help.d.ts +99 -0
- package/dist/types/cli/help-extra.d.ts +2 -0
- package/dist/types/cli/models-cli.d.ts +1 -1
- package/dist/types/cli/thinking-levels.d.ts +5 -0
- package/dist/types/cli/update-cli.d.ts +13 -0
- package/dist/types/commands/browser-relay.d.ts +38 -0
- package/dist/types/commands/commit.d.ts +3 -0
- package/dist/types/commands/complete.d.ts +1 -1
- package/dist/types/commands/completions.d.ts +6 -0
- package/dist/types/commands/grep.d.ts +3 -0
- package/dist/types/commands/join.d.ts +4 -0
- package/dist/types/commands/launch-help.d.ts +171 -0
- package/dist/types/commands/launch.d.ts +5 -1
- package/dist/types/commands/models.d.ts +3 -0
- package/dist/types/commands/say.d.ts +10 -0
- package/dist/types/commands/worktree.d.ts +3 -0
- package/dist/types/config/keybindings.d.ts +6 -1
- package/dist/types/config/model-discovery.d.ts +2 -2
- package/dist/types/config/models-config-schema-bundle.d.ts +3 -0
- package/dist/types/config/models-config-schema.d.ts +2 -0
- package/dist/types/config/models-config.d.ts +1 -0
- package/dist/types/config/service-tier.d.ts +2 -0
- package/dist/types/config/settings-schema.d.ts +70 -22
- package/dist/types/cursor-bridge-tools.d.ts +1 -1
- package/dist/types/cursor.d.ts +7 -4
- package/dist/types/discovery/helpers.d.ts +6 -0
- package/dist/types/discovery/omp-extension-roots.d.ts +21 -2
- package/dist/types/edit/index.d.ts +3 -3
- package/dist/types/edit/modes/replace.d.ts +22 -15
- package/dist/types/edit/renderer.d.ts +1 -1
- package/dist/types/eval/py/kernel.d.ts +3 -1
- package/dist/types/eval/py/spawn-options.d.ts +12 -16
- package/dist/types/extensibility/extensions/loader.d.ts +6 -2
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +8 -1
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +1 -1
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +2 -0
- package/dist/types/extensibility/plugins/marketplace/registry.d.ts +2 -2
- package/dist/types/launch/broker.d.ts +1 -1
- package/dist/types/launch/client.d.ts +6 -3
- package/dist/types/launch/ensure.d.ts +8 -0
- package/dist/types/launch/paths.d.ts +3 -2
- package/dist/types/launch/protocol.d.ts +2 -2
- package/dist/types/lsp/client.d.ts +2 -0
- package/dist/types/lsp/mux/daemon.d.ts +15 -0
- package/dist/types/lsp/mux/protocol.d.ts +57 -0
- package/dist/types/lsp/mux/server.d.ts +18 -0
- package/dist/types/lsp/types.d.ts +22 -2
- package/dist/types/main.d.ts +2 -0
- package/dist/types/mcp/request-id.d.ts +19 -0
- package/dist/types/mcp/types.d.ts +14 -0
- package/dist/types/memory-backend/index.d.ts +1 -0
- package/dist/types/memory-backend/messages.d.ts +15 -0
- package/dist/types/mnemopi/embed-client.d.ts +1 -1
- package/dist/types/mnemopi/state.d.ts +0 -23
- package/dist/types/modes/components/assistant-message.d.ts +2 -0
- package/dist/types/modes/components/custom-editor.d.ts +2 -1
- package/dist/types/modes/components/model-browser.d.ts +7 -5
- package/dist/types/modes/components/model-picker.d.ts +9 -3
- package/dist/types/modes/components/read-tool-group.d.ts +11 -0
- package/dist/types/modes/components/stripped-tool-calls-placeholder.d.ts +12 -0
- package/dist/types/modes/components/tool-execution.d.ts +2 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/types.d.ts +2 -1
- package/dist/types/modes/workflow.d.ts +2 -1
- package/dist/types/registry/agent-lifecycle.d.ts +14 -5
- package/dist/types/registry/agent-registry.d.ts +4 -3
- package/dist/types/sdk.d.ts +4 -2
- package/dist/types/secrets/index.d.ts +7 -9
- package/dist/types/session/agent-session-types.d.ts +3 -1
- package/dist/types/session/agent-session.d.ts +6 -1
- package/dist/types/session/indexed-session-storage.d.ts +1 -0
- package/dist/types/session/model-controls.d.ts +0 -1
- package/dist/types/session/session-advisors.d.ts +8 -1
- package/dist/types/session/session-context.d.ts +2 -1
- package/dist/types/session/session-maintenance.d.ts +2 -0
- package/dist/types/session/session-manager.d.ts +16 -5
- package/dist/types/session/session-stats.d.ts +10 -0
- package/dist/types/session/session-storage.d.ts +15 -3
- package/dist/types/system-prompt.d.ts +6 -1
- package/dist/types/task/index.d.ts +2 -1
- package/dist/types/task/spawn-policy.d.ts +5 -0
- package/dist/types/thinking.d.ts +1 -7
- package/dist/types/tools/ast-grep.d.ts +1 -1
- package/dist/types/tools/browser/registry.d.ts +2 -1
- package/dist/types/tools/browser/relay/bridge.d.ts +35 -0
- package/dist/types/tools/browser/relay/daemon.d.ts +16 -0
- package/dist/types/tools/browser/relay/kind.d.ts +19 -0
- package/dist/types/tools/browser/relay/protocol.d.ts +97 -0
- package/dist/types/tools/browser/relay/server.d.ts +35 -0
- package/dist/types/tools/browser/render.d.ts +1 -0
- package/dist/types/tools/browser.d.ts +3 -0
- package/dist/types/tools/computer/exposure.d.ts +9 -7
- package/dist/types/tools/computer/protocol.d.ts +70 -17
- package/dist/types/tools/computer/supervisor.d.ts +23 -10
- package/dist/types/tools/computer/worker-entry.d.ts +1 -0
- package/dist/types/tools/computer/worker.d.ts +42 -7
- package/dist/types/tools/computer-renderer.d.ts +7 -5
- package/dist/types/tools/computer.d.ts +25 -44
- package/dist/types/tools/context.d.ts +3 -0
- package/dist/types/tools/default-renderer.d.ts +3 -0
- package/dist/types/tools/glob.d.ts +1 -1
- package/dist/types/tools/grep.d.ts +1 -1
- package/dist/types/tools/render-utils.d.ts +2 -0
- package/dist/types/tools/{browser/run-cancellation.d.ts → run-scope.d.ts} +8 -8
- package/dist/types/tools/tool-timeouts.d.ts +5 -0
- package/dist/types/tools/xdev.d.ts +8 -0
- package/dist/types/utils/clipboard.d.ts +2 -2
- package/dist/types/web/kagi.d.ts +1 -0
- package/dist/types/web/search/index.d.ts +1 -1
- package/dist/types/web/search/providers/anthropic.d.ts +1 -0
- package/dist/types/web/search/providers/base.d.ts +2 -0
- package/dist/types/web/search/providers/brave.d.ts +1 -0
- package/dist/types/web/search/providers/browser-page.d.ts +1 -0
- package/dist/types/web/search/providers/codex.d.ts +1 -0
- package/dist/types/web/search/providers/exa.d.ts +1 -0
- package/dist/types/web/search/providers/firecrawl.d.ts +1 -0
- package/dist/types/web/search/providers/gemini.d.ts +1 -0
- package/dist/types/web/search/providers/jina.d.ts +1 -0
- package/dist/types/web/search/providers/kagi.d.ts +1 -0
- package/dist/types/web/search/providers/kimi.d.ts +1 -0
- package/dist/types/web/search/providers/parallel.d.ts +1 -0
- package/dist/types/web/search/providers/perplexity.d.ts +1 -0
- package/dist/types/web/search/providers/searxng.d.ts +1 -0
- package/dist/types/web/search/providers/tavily.d.ts +1 -0
- package/dist/types/web/search/providers/tinyfish.d.ts +1 -0
- package/dist/types/web/search/providers/utils.d.ts +6 -9
- package/dist/types/web/search/providers/zai.d.ts +1 -0
- package/dist/types/web/search/types.d.ts +4 -0
- package/package.json +12 -12
- package/scripts/legacy-pi-virtual-module.ts +12 -2
- package/src/advisor/advise-tool.ts +18 -0
- package/src/advisor/runtime.ts +6 -6
- package/src/capability/mcp.ts +7 -0
- package/src/cli/args.ts +7 -87
- package/src/cli/browser-relay-cli.ts +119 -0
- package/src/cli/command-help.ts +103 -0
- package/src/cli/completion-gen.ts +5 -5
- package/src/cli/flag-tables.ts +9 -0
- package/src/cli/help-extra.ts +89 -0
- package/src/cli/models-cli.ts +13 -16
- package/src/cli/setup-cli.ts +13 -21
- package/src/cli/thinking-levels.ts +7 -0
- package/src/cli/update-cli.ts +26 -7
- package/src/cli-commands.ts +170 -33
- package/src/cli.ts +17 -5
- package/src/collab/host.ts +1 -1
- package/src/commands/acp.ts +3 -1
- package/src/commands/agents.ts +3 -2
- package/src/commands/auth-broker.ts +3 -2
- package/src/commands/auth-gateway.ts +3 -2
- package/src/commands/bench.ts +2 -3
- package/src/commands/browser-relay.ts +53 -0
- package/src/commands/cleanse.ts +2 -2
- package/src/commands/commit.ts +3 -2
- package/src/commands/complete.ts +2 -1
- package/src/commands/completions.ts +3 -2
- package/src/commands/config.ts +3 -2
- package/src/commands/dry-balance.ts +2 -2
- package/src/commands/gallery.ts +3 -2
- package/src/commands/gc.ts +3 -2
- package/src/commands/grep.ts +3 -2
- package/src/commands/grievances.ts +3 -2
- package/src/commands/install.ts +2 -2
- package/src/commands/join.ts +3 -2
- package/src/commands/launch-help.ts +116 -0
- package/src/commands/launch.ts +7 -191
- package/src/commands/models.ts +3 -2
- package/src/commands/plugin.ts +3 -2
- package/src/commands/read.ts +3 -2
- package/src/commands/say.ts +3 -2
- package/src/commands/setup.ts +3 -2
- package/src/commands/shell.ts +3 -2
- package/src/commands/ssh.ts +3 -2
- package/src/commands/stats.ts +3 -2
- package/src/commands/tiny-models.ts +2 -2
- package/src/commands/token.ts +2 -2
- package/src/commands/ttsr.ts +2 -2
- package/src/commands/update.ts +3 -2
- package/src/commands/usage.ts +3 -2
- package/src/commands/web-search.ts +3 -2
- package/src/commands/worktree.ts +3 -2
- package/src/config/keybindings.ts +19 -9
- package/src/config/mcp-schema.json +5 -0
- package/src/config/model-discovery.ts +30 -13
- package/src/config/model-registry.ts +16 -6
- package/src/config/models-config-schema-bundle.ts +9 -0
- package/src/config/resolve-config-value.ts +2 -1
- package/src/config/service-tier.ts +5 -0
- package/src/config/settings-schema.ts +73 -21
- package/src/cursor-bridge-tools.ts +1 -1
- package/src/cursor.ts +10 -14
- package/src/discovery/builtin.ts +10 -0
- package/src/discovery/helpers.ts +10 -0
- package/src/discovery/mcp-json.ts +11 -1
- package/src/discovery/omp-extension-roots.ts +79 -20
- package/src/discovery/omp-plugins.ts +10 -1
- package/src/edit/diff.ts +17 -8
- package/src/edit/index.ts +20 -7
- package/src/edit/modes/replace.ts +93 -40
- package/src/edit/renderer.ts +1 -1
- package/src/edit/streaming.ts +14 -17
- package/src/eval/py/kernel.ts +2 -1
- package/src/eval/py/spawn-options.ts +24 -29
- package/src/export/html/template.js +8 -26
- package/src/extensibility/extensions/loader.ts +66 -28
- package/src/extensibility/extensions/wrapper.ts +1 -0
- package/src/extensibility/legacy-pi-ai-shim.ts +22 -1
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +7 -6
- package/src/extensibility/plugins/legacy-pi-compat.ts +124 -57
- package/src/extensibility/plugins/marketplace/registry.ts +4 -8
- package/src/extensibility/skills.ts +11 -0
- package/src/extensibility/utils.ts +10 -2
- package/src/launch/broker.ts +1 -1
- package/src/launch/client.ts +32 -13
- package/src/launch/ensure.ts +73 -0
- package/src/launch/paths.ts +3 -6
- package/src/launch/protocol.ts +2 -2
- package/src/lsp/client.ts +23 -2
- package/src/lsp/index.ts +8 -0
- package/src/lsp/mux/daemon.ts +348 -0
- package/src/lsp/mux/protocol.ts +96 -0
- package/src/lsp/mux/server.ts +797 -0
- package/src/lsp/types.ts +28 -2
- package/src/main.ts +31 -24
- package/src/mcp/config.ts +1 -0
- package/src/mcp/oauth-flow.ts +11 -1
- package/src/mcp/request-id.ts +24 -0
- package/src/mcp/transports/http.ts +4 -2
- package/src/mcp/transports/sse.ts +4 -2
- package/src/mcp/transports/stdio.ts +4 -2
- package/src/mcp/types.ts +15 -0
- package/src/memory-backend/index.ts +1 -0
- package/src/memory-backend/messages.ts +19 -0
- package/src/mnemopi/embed-client.ts +49 -2
- package/src/mnemopi/state.ts +57 -23
- package/src/modes/components/agent-hub.ts +1 -1
- package/src/modes/components/assistant-message.ts +11 -0
- package/src/modes/components/chat-transcript-builder.ts +4 -0
- package/src/modes/components/custom-editor.ts +10 -1
- package/src/modes/components/model-browser.ts +25 -17
- package/src/modes/components/model-picker.ts +10 -6
- package/src/modes/components/read-tool-group.ts +36 -0
- package/src/modes/components/status-line/component.ts +1 -1
- package/src/modes/components/stripped-tool-calls-placeholder.ts +35 -0
- package/src/modes/components/tool-execution.ts +85 -20
- package/src/modes/components/tree-selector.ts +46 -48
- package/src/modes/controllers/command-controller.ts +2 -2
- package/src/modes/controllers/event-controller.ts +199 -10
- package/src/modes/controllers/input-controller.ts +39 -1
- package/src/modes/controllers/mcp-command-controller.ts +11 -5
- package/src/modes/controllers/selector-controller.ts +47 -6
- package/src/modes/interactive-mode.ts +2 -0
- package/src/modes/types.ts +6 -1
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/modes/utils/interactive-context-helpers.ts +1 -0
- package/src/modes/utils/ui-helpers.ts +6 -10
- package/src/modes/workflow.ts +8 -2
- package/src/prompts/agents/init.md +1 -1
- package/src/prompts/system/plan-mode-active.md +2 -2
- package/src/prompts/system/system-prompt.md +26 -52
- package/src/prompts/system/workflow-notice.md +3 -3
- package/src/prompts/tools/ast-grep.md +1 -1
- package/src/prompts/tools/bash.md +1 -1
- package/src/prompts/tools/browser.md +1 -0
- package/src/prompts/tools/computer.md +21 -21
- package/src/prompts/tools/glob.md +1 -1
- package/src/prompts/tools/grep.md +1 -1
- package/src/prompts/tools/replace.md +5 -4
- package/src/prompts/tools/task.md +4 -4
- package/src/registry/agent-lifecycle.ts +36 -11
- package/src/registry/agent-registry.ts +12 -5
- package/src/sdk.ts +102 -35
- package/src/secrets/index.ts +16 -18
- package/src/session/agent-session-types.ts +3 -1
- package/src/session/agent-session.ts +23 -2
- package/src/session/agent-storage.ts +6 -4
- package/src/session/history-storage.ts +4 -2
- package/src/session/indexed-session-storage.ts +9 -0
- package/src/session/messages.ts +31 -7
- package/src/session/model-controls.ts +0 -1
- package/src/session/prewalk.ts +24 -2
- package/src/session/session-advisors.ts +21 -3
- package/src/session/session-context.ts +16 -12
- package/src/session/session-dump-format.ts +1 -1
- package/src/session/session-maintenance.ts +41 -4
- package/src/session/session-manager.ts +181 -94
- package/src/session/session-paths.ts +118 -55
- package/src/session/session-stats.ts +48 -3
- package/src/session/session-storage.ts +30 -22
- package/src/session/session-tools.ts +25 -23
- package/src/session/stream-guards.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +29 -26
- package/src/system-prompt.ts +14 -4
- package/src/task/executor.ts +8 -1
- package/src/task/index.ts +23 -8
- package/src/task/spawn-policy.ts +14 -0
- package/src/thinking.ts +2 -8
- package/src/tiny/text.ts +12 -0
- package/src/tools/ast-grep.ts +10 -4
- package/src/tools/browser/cmux/cmux-tab.ts +5 -10
- package/src/tools/browser/cmux/rpc.ts +2 -8
- package/src/tools/browser/registry.ts +53 -2
- package/src/tools/browser/relay/bridge.ts +945 -0
- package/src/tools/browser/relay/daemon.ts +117 -0
- package/src/tools/browser/relay/extension-assets/background.js.txt +242 -0
- package/src/tools/browser/relay/extension-assets/manifest.json.txt +14 -0
- package/src/tools/browser/relay/extension-assets/options.html.txt +53 -0
- package/src/tools/browser/relay/extension-assets/options.js.txt +23 -0
- package/src/tools/browser/relay/kind.ts +41 -0
- package/src/tools/browser/relay/protocol.ts +54 -0
- package/src/tools/browser/relay/server.ts +141 -0
- package/src/tools/browser/render.ts +4 -1
- package/src/tools/browser/shared-daemon.ts +7 -58
- package/src/tools/browser/tab-supervisor.ts +5 -4
- package/src/tools/browser/tab-worker.ts +33 -12
- package/src/tools/browser.ts +26 -1
- package/src/tools/computer/exposure.ts +11 -35
- package/src/tools/computer/protocol.ts +51 -10
- package/src/tools/computer/supervisor.ts +227 -124
- package/src/tools/computer/worker-entry.ts +11 -6
- package/src/tools/computer/worker.ts +695 -81
- package/src/tools/computer-renderer.ts +104 -65
- package/src/tools/computer.ts +134 -428
- package/src/tools/context.ts +3 -0
- package/src/tools/default-renderer.ts +19 -4
- package/src/tools/glob.ts +9 -2
- package/src/tools/grep.ts +12 -6
- package/src/tools/index.ts +10 -6
- package/src/tools/inspect-image.ts +32 -6
- package/src/tools/render-utils.ts +2 -0
- package/src/tools/{browser/run-cancellation.ts → run-scope.ts} +11 -11
- package/src/tools/tool-timeouts.ts +1 -0
- package/src/tools/xdev.ts +29 -2
- package/src/utils/clipboard.ts +40 -14
- package/src/utils/command-args.ts +26 -28
- package/src/utils/tool-choice.ts +0 -13
- package/src/web/kagi.ts +2 -1
- package/src/web/search/index.ts +18 -2
- package/src/web/search/providers/anthropic.ts +7 -2
- package/src/web/search/providers/base.ts +2 -0
- package/src/web/search/providers/brave.ts +3 -1
- package/src/web/search/providers/browser-page.ts +6 -4
- package/src/web/search/providers/codex.ts +4 -1
- package/src/web/search/providers/duckduckgo.ts +2 -1
- package/src/web/search/providers/ecosia.ts +2 -1
- package/src/web/search/providers/exa.ts +4 -2
- package/src/web/search/providers/firecrawl.ts +3 -1
- package/src/web/search/providers/gemini.ts +8 -2
- package/src/web/search/providers/google.ts +2 -1
- package/src/web/search/providers/jina.ts +12 -2
- package/src/web/search/providers/kagi.ts +3 -0
- package/src/web/search/providers/kimi.ts +5 -1
- package/src/web/search/providers/mojeek.ts +2 -1
- package/src/web/search/providers/parallel.ts +5 -1
- package/src/web/search/providers/perplexity.ts +6 -3
- package/src/web/search/providers/public.ts +1 -1
- package/src/web/search/providers/searxng.ts +11 -5
- package/src/web/search/providers/startpage.ts +10 -4
- package/src/web/search/providers/synthetic.ts +11 -5
- package/src/web/search/providers/tavily.ts +3 -1
- package/src/web/search/providers/tinyfish.ts +3 -1
- package/src/web/search/providers/utils.ts +12 -10
- package/src/web/search/providers/xai.ts +2 -2
- package/src/web/search/providers/zai.ts +18 -3
- package/src/web/search/types.ts +6 -0
|
@@ -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;
|
|
@@ -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>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ptree } from "@oh-my-pi/pi-utils";
|
|
2
1
|
export declare const lspSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
2
|
action: "capabilities" | "code_actions" | "definition" | "diagnostics" | "hover" | "implementation" | "references" | "reload" | "rename" | "rename_file" | "request" | "status" | "symbols" | "type_definition";
|
|
4
3
|
file?: string | undefined;
|
|
@@ -229,6 +228,27 @@ export interface ServerConfig {
|
|
|
229
228
|
*/
|
|
230
229
|
createClient?: LinterClientFactory;
|
|
231
230
|
}
|
|
231
|
+
/** Minimal write sink for the server-bound byte stream (satisfied by `Bun.FileSink` and the mux socket adapter). */
|
|
232
|
+
export interface LspWriteSink {
|
|
233
|
+
write(data: string | Uint8Array): number | Promise<number>;
|
|
234
|
+
flush(): number | void | Promise<number | void>;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Byte transport carrying one LSP JSON-RPC link. Structurally satisfied by
|
|
238
|
+
* `ptree.ChildProcess<"pipe">` (local server spawn) and by the socket adapter
|
|
239
|
+
* in `mux/daemon.ts` (broker-shared server). `exited` may reject (ptree kill).
|
|
240
|
+
*/
|
|
241
|
+
export interface LspTransport {
|
|
242
|
+
readonly stdin: LspWriteSink;
|
|
243
|
+
readonly stdout: ReadableStream<Uint8Array>;
|
|
244
|
+
readonly exited: Promise<number>;
|
|
245
|
+
readonly exitCode: number | null;
|
|
246
|
+
readonly pid?: number;
|
|
247
|
+
/** Present and true on broker-shared mux links; `lsp reload` uses it to request a shared-server restart. */
|
|
248
|
+
readonly sharedMux?: boolean;
|
|
249
|
+
kill(): void;
|
|
250
|
+
peekStderr(): string;
|
|
251
|
+
}
|
|
232
252
|
export interface OpenFile {
|
|
233
253
|
version: number;
|
|
234
254
|
languageId: string;
|
|
@@ -257,7 +277,7 @@ export interface LspClient {
|
|
|
257
277
|
name: string;
|
|
258
278
|
cwd: string;
|
|
259
279
|
config: ServerConfig;
|
|
260
|
-
proc:
|
|
280
|
+
proc: LspTransport;
|
|
261
281
|
requestId: number;
|
|
262
282
|
diagnostics: Map<string, PublishedDiagnostics>;
|
|
263
283
|
diagnosticsVersion: number;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ import { type SessionInfo } from "./session/session-listing.js";
|
|
|
13
13
|
import { SessionManager } from "./session/session-manager.js";
|
|
14
14
|
type RunAcpMode = (createSession: AcpSessionFactory) => Promise<never>;
|
|
15
15
|
export declare function writeStartupNotice(parsedArgs: Pick<Args, "mode">, text: string): void;
|
|
16
|
+
/** Reads a non-TTY stdin stream as prompt text. */
|
|
17
|
+
export declare function readPipedInput(): Promise<string | undefined>;
|
|
16
18
|
export interface InteractiveModeNotify {
|
|
17
19
|
kind: "warn" | "error" | "info";
|
|
18
20
|
message: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MCPRequestIdFormat } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Per-transport allocator for outgoing JSON-RPC request ids.
|
|
4
|
+
*
|
|
5
|
+
* JSON-RPC 2.0 permits String and Number ids equally, but the wider MCP
|
|
6
|
+
* ecosystem (reference SDKs included) issues incrementing integers, so servers
|
|
7
|
+
* are best tested against numbers — Apple's `xcrun mcpbridge` even logs
|
|
8
|
+
* `mcpbridge.DecodeError Code=1` and never answers a string id. Integers are
|
|
9
|
+
* therefore the default. `"string"` opts a server back into collision-resistant
|
|
10
|
+
* snowflake ids.
|
|
11
|
+
*
|
|
12
|
+
* The counter is per instance and never reset, so ids stay unique for the life
|
|
13
|
+
* of the transport even though a reconnect rejects and clears every pending
|
|
14
|
+
* request.
|
|
15
|
+
*/
|
|
16
|
+
export declare class RequestIdAllocator {
|
|
17
|
+
#private;
|
|
18
|
+
next(format: MCPRequestIdFormat | undefined): string | number;
|
|
19
|
+
}
|
|
@@ -43,12 +43,26 @@ export interface MCPAuthConfig {
|
|
|
43
43
|
/** MCP resource URI — persisted for OAuth resource indicators during refresh */
|
|
44
44
|
resource?: string;
|
|
45
45
|
}
|
|
46
|
+
/** Encoding used for outgoing JSON-RPC request ids. */
|
|
47
|
+
export type MCPRequestIdFormat = "string" | "number";
|
|
46
48
|
/** Base server config with shared options */
|
|
47
49
|
interface MCPServerConfigBase {
|
|
48
50
|
/** Whether this server is enabled (default: true) */
|
|
49
51
|
enabled?: boolean;
|
|
50
52
|
/** MCP request timeout in milliseconds (default: 30000, 0 to disable) */
|
|
51
53
|
timeout?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Encoding for outgoing JSON-RPC request ids (default: `"number"`).
|
|
56
|
+
*
|
|
57
|
+
* Set `"string"` for servers that need collision-resistant snowflake string
|
|
58
|
+
* ids instead of per-transport integers. See `RequestIdAllocator` in
|
|
59
|
+
* `./request-id`.
|
|
60
|
+
*
|
|
61
|
+
* OMP-specific, so only the OMP-owned discovery providers parse it (native,
|
|
62
|
+
* standalone `mcp.json`, OMP plugins). Providers that translate another
|
|
63
|
+
* tool's config do not, since the key is not part of those formats.
|
|
64
|
+
*/
|
|
65
|
+
requestIdFormat?: MCPRequestIdFormat;
|
|
52
66
|
/** Authentication configuration (optional) */
|
|
53
67
|
auth?: MCPAuthConfig;
|
|
54
68
|
/** OAuth configuration for servers requiring explicit client credentials */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { MnemopiBackendConfig, MnemopiLlmMode, MnemopiProviderOptions, MnemopiScoping, } from "../mnemopi/config.js";
|
|
2
2
|
export type { MnemopiMemoryEditOperation, MnemopiMemoryEditOptions, MnemopiMemoryEditResult, MnemopiSessionState, MnemopiSessionStateOptions, } from "../mnemopi/state.js";
|
|
3
3
|
export * from "./local-backend.js";
|
|
4
|
+
export * from "./messages.js";
|
|
4
5
|
export * from "./off-backend.js";
|
|
5
6
|
export * from "./resolve.js";
|
|
6
7
|
export * from "./runtime.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MemoryBackendId } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Fallback text for `/memory stats` and `/memory diagnose` when the active
|
|
4
|
+
* backend's hook is missing or returns nothing.
|
|
5
|
+
*
|
|
6
|
+
* The `off` backend isn't a real backend a user picked among several
|
|
7
|
+
* stats-capable options — it's the no-op state memory falls back to by
|
|
8
|
+
* default — so it gets its own message instead of the generic
|
|
9
|
+
* "not available for the X backend" template, which would otherwise read as
|
|
10
|
+
* the self-contradictory "not available for the off backend".
|
|
11
|
+
*
|
|
12
|
+
* Shared by both the TUI (`CommandController.handleMemoryCommand`) and the
|
|
13
|
+
* ACP/RPC slash-command handler so the two surfaces stay consistent.
|
|
14
|
+
*/
|
|
15
|
+
export declare function memoryStatsUnavailableMessage(backendId: MemoryBackendId, action: "stats" | "diagnose"): string;
|
|
@@ -34,7 +34,7 @@ export interface MnemopiSubprocessEmbeddingModel {
|
|
|
34
34
|
}
|
|
35
35
|
export declare class MnemopiEmbedClient {
|
|
36
36
|
#private;
|
|
37
|
-
constructor(spawnWorker?: () => MnemopiEmbedWorkerHandle);
|
|
37
|
+
constructor(spawnWorker?: () => MnemopiEmbedWorkerHandle, requestTimeoutMs?: number);
|
|
38
38
|
/**
|
|
39
39
|
* Load the named fastembed model inside the subprocess. Resolves to a
|
|
40
40
|
* thin wrapper whose `embed()` round-trips through the same worker, or
|
|
@@ -162,29 +162,6 @@ export declare class MnemopiSessionState {
|
|
|
162
162
|
extract?: boolean;
|
|
163
163
|
sleep?: boolean;
|
|
164
164
|
}): Promise<void>;
|
|
165
|
-
/**
|
|
166
|
-
* Release the per-session resources. Defaults to running a lighter
|
|
167
|
-
* {@link consolidate} pass before closing handles: it retains the current
|
|
168
|
-
* transcript and flushes in-flight extractions, but skips the synchronous
|
|
169
|
-
* bank sleep so normal session shutdown returns promptly. Full promotion of
|
|
170
|
-
* working memory into long-term storage is still performed by the explicit
|
|
171
|
-
* `/memory enqueue` and backend enqueue paths. Callers that are about to
|
|
172
|
-
* delete the DB files — e.g. `mnemopiBackend.clear` — pass
|
|
173
|
-
* `{ consolidate: false }` to skip the retain/flush pass, since spending
|
|
174
|
-
* tokens on memories that will be wiped on the next line is wasted work
|
|
175
|
-
* (PR #2327 review).
|
|
176
|
-
*
|
|
177
|
-
* `timeoutMs` caps how long the consolidate await blocks the caller
|
|
178
|
-
* (the user-visible `/quit` / `/exit` shutdown path passes this so
|
|
179
|
-
* dispose returns within a UX budget — issue #3641). When the cap is
|
|
180
|
-
* hit, dispose returns immediately and detaches the still-in-flight
|
|
181
|
-
* consolidate; the SQLite handles are closed in the background once
|
|
182
|
-
* the consolidate settles so writes never race a closed handle, and
|
|
183
|
-
* any pending embeddings are SIGKILL'd along with the embed worker
|
|
184
|
-
* (a tolerable loss — working memory rows are durable; only the
|
|
185
|
-
* episodic promotion / embedding for the LAST few turns is skipped,
|
|
186
|
-
* and `maybeRetainOnAgentEnd` has already retained earlier turns).
|
|
187
|
-
*/
|
|
188
165
|
dispose(options?: {
|
|
189
166
|
consolidate?: boolean;
|
|
190
167
|
timeoutMs?: number;
|
|
@@ -63,6 +63,8 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
63
63
|
messagePersistenceKey(): string | undefined;
|
|
64
64
|
/** Toggle rendering for assistant-native and tool-result images. */
|
|
65
65
|
setImagesVisible(visible: boolean): void;
|
|
66
|
+
/** Toggle only images produced by tool results; assistant-native images remain governed by setImagesVisible. */
|
|
67
|
+
setToolResultImagesVisible(visible: boolean): void;
|
|
66
68
|
setToolResultImages(toolCallId: string, images: ImageContent[]): void;
|
|
67
69
|
updateContent(message: AssistantMessage, opts?: {
|
|
68
70
|
transient?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ImageContent } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import { Editor, type KeyId, TUI } from "@oh-my-pi/pi-tui";
|
|
3
3
|
import type { AppKeybinding } from "../../config/keybindings.js";
|
|
4
|
-
type ConfigurableEditorAction = Extract<AppKeybinding, "app.interrupt" | "app.clear" | "app.exit" | "app.suspend" | "app.display.reset" | "app.thinking.cycle" | "app.model.cycleForward" | "app.model.cycleBackward" | "app.model.select" | "app.model.selectTemporary" | "app.tools.expand" | "app.thinking.toggle" | "app.editor.external" | "app.history.search" | "app.message.dequeue" | "app.retry" | "app.clipboard.pasteImage" | "app.clipboard.pasteTextRaw" | "app.clipboard.copyPrompt">;
|
|
4
|
+
type ConfigurableEditorAction = Extract<AppKeybinding, "app.interrupt" | "app.clear" | "app.exit" | "app.suspend" | "app.display.reset" | "app.thinking.cycle" | "app.model.cycleForward" | "app.model.cycleBackward" | "app.model.select" | "app.model.selectTemporary" | "app.tools.expand" | "app.tools.toggleVisibility" | "app.thinking.toggle" | "app.editor.external" | "app.history.search" | "app.message.dequeue" | "app.retry" | "app.clipboard.pasteImage" | "app.clipboard.pasteTextRaw" | "app.clipboard.copyPrompt">;
|
|
5
5
|
/** Max gap (ms) between two spaces for the later one to count as OS key auto-repeat rather than a
|
|
6
6
|
* deliberate press. OS auto-repeat is fast; a deliberate tap (even a fast one) is slower. */
|
|
7
7
|
export declare const SPACE_REPEAT_MAX_GAP_MS = 120;
|
|
@@ -141,6 +141,7 @@ export declare class CustomEditor extends Editor {
|
|
|
141
141
|
onCycleModelBackward?: () => void;
|
|
142
142
|
onSelectModel?: () => void;
|
|
143
143
|
onExpandTools?: () => void;
|
|
144
|
+
onToggleToolActivity?: () => void;
|
|
144
145
|
onToggleThinking?: () => void;
|
|
145
146
|
onExternalEditor?: () => void;
|
|
146
147
|
onHistorySearch?: () => void;
|
|
@@ -58,10 +58,10 @@ export declare function formatRoleChip(role: string, assignment: RoleAssignment,
|
|
|
58
58
|
export interface ModelBrowserOptions {
|
|
59
59
|
/** Render the dim `provider/` prefix before model ids. Default true. */
|
|
60
60
|
showProvider?: boolean;
|
|
61
|
-
/** Session token count used to
|
|
61
|
+
/** Session token count used to flag models whose context window is exceeded. */
|
|
62
62
|
currentContextTokens?: number;
|
|
63
|
-
/** When true, rows
|
|
64
|
-
|
|
63
|
+
/** When true, over-context rows render grayed; picking one compacts first (session-switch mode). */
|
|
64
|
+
markOverContext?: boolean;
|
|
65
65
|
/** Host-provided empty-state text (e.g. provider discovery status). */
|
|
66
66
|
emptyText?: () => string | undefined;
|
|
67
67
|
}
|
|
@@ -91,8 +91,8 @@ export declare class ModelBrowser implements Component {
|
|
|
91
91
|
setShowProvider(show: boolean): void;
|
|
92
92
|
/** Keep the source order after fuzzy filtering instead of applying model-specific ranking. */
|
|
93
93
|
setPreserveQueryOrder(preserve: boolean): void;
|
|
94
|
-
/** Allow hosts to toggle context-window
|
|
95
|
-
|
|
94
|
+
/** Allow hosts to toggle context-window flagging between browser modes. */
|
|
95
|
+
setMarkOverContext(mark: boolean): void;
|
|
96
96
|
/** Focused: accent cursor + selected-row background band. Unfocused: dim cursor, no band. */
|
|
97
97
|
setFocused(focused: boolean): void;
|
|
98
98
|
/** Total rendered height for the current `maxVisible` (host layout budgeting). */
|
|
@@ -103,6 +103,8 @@ export declare class ModelBrowser implements Component {
|
|
|
103
103
|
get visibleCount(): number;
|
|
104
104
|
/** Move selection to `selector`; false when it is not in the current view. */
|
|
105
105
|
selectSelector(selector: string): boolean;
|
|
106
|
+
/** True when `item`'s context window is smaller than the live session token count (grayed row; hosts compact before switching). */
|
|
107
|
+
isOverContext(item: ModelBrowserItem): boolean;
|
|
106
108
|
/**
|
|
107
109
|
* Move the selection by `delta` rows, skipping disabled rows. Single steps
|
|
108
110
|
* wrap at the ends; `wrap: false` (page/home/end jumps) clamps instead.
|
|
@@ -11,15 +11,21 @@ import type { Settings } from "../../config/settings.js";
|
|
|
11
11
|
import type { ResolvedRoleModel } from "../../session/agent-session.js";
|
|
12
12
|
import type { ScopedModelItem } from "./model-hub.js";
|
|
13
13
|
export interface ModelPickerCallbacks {
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* A model was chosen for a session-only switch. `selector` is `provider/id`.
|
|
16
|
+
* `overContext` is true when the session transcript exceeds the model's
|
|
17
|
+
* context window — the host must compact before switching.
|
|
18
|
+
*/
|
|
19
|
+
onPick: (model: Model, selector: string, meta: {
|
|
20
|
+
overContext: boolean;
|
|
21
|
+
}) => void;
|
|
16
22
|
/** A configured ctrl+p quick role was chosen. */
|
|
17
23
|
onPickRole?: (entry: ResolvedRoleModel) => void;
|
|
18
24
|
/** The picker was dismissed. */
|
|
19
25
|
onCancel: () => void;
|
|
20
26
|
}
|
|
21
27
|
export interface ModelPickerOptions {
|
|
22
|
-
/** Session token count; models with smaller context windows are
|
|
28
|
+
/** Session token count; models with smaller context windows are grayed and compact-first on pick. */
|
|
23
29
|
currentContextTokens?: number;
|
|
24
30
|
/** `provider/id` of the session's active model; highlighted and preselected. */
|
|
25
31
|
currentSelector?: string;
|
|
@@ -27,6 +27,7 @@ type ReadToolGroupOptions = {
|
|
|
27
27
|
export declare class ReadToolGroupComponent extends Container implements ToolExecutionHandle {
|
|
28
28
|
#private;
|
|
29
29
|
constructor(options?: ReadToolGroupOptions);
|
|
30
|
+
render(width: number): readonly string[];
|
|
30
31
|
isTranscriptBlockFinalized(): boolean;
|
|
31
32
|
finalize(): void;
|
|
32
33
|
/**
|
|
@@ -36,6 +37,15 @@ export declare class ReadToolGroupComponent extends Container implements ToolExe
|
|
|
36
37
|
*/
|
|
37
38
|
seal(): void;
|
|
38
39
|
updateArgs(args: ReadRenderArgs, toolCallId?: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Re-key an entry whose streamed tool-call id changed mid-stream (a provider
|
|
42
|
+
* rewriting the id across deltas; see EventController's
|
|
43
|
+
* `#streamedToolCallIdByIndex`). Preserves row order so a sibling read run is
|
|
44
|
+
* not visibly reshuffled, and no-ops when the rename would collide.
|
|
45
|
+
*/
|
|
46
|
+
renameEntry(oldId: string, newId: string): void;
|
|
47
|
+
/** Remove one call without discarding successful siblings in the shared group. */
|
|
48
|
+
removeEntry(toolCallId: string): boolean;
|
|
39
49
|
updateResult(result: {
|
|
40
50
|
content: Array<{
|
|
41
51
|
type: string;
|
|
@@ -51,6 +61,7 @@ export declare class ReadToolGroupComponent extends Container implements ToolExe
|
|
|
51
61
|
attachUsage(toolCallIds: readonly string[], usage: Usage, durationMs?: number, ttftMs?: number, timestamp?: number): boolean;
|
|
52
62
|
setArgsComplete(_toolCallId?: string): void;
|
|
53
63
|
setExpanded(expanded: boolean): void;
|
|
64
|
+
setToolActivityVisible(visible: boolean): void;
|
|
54
65
|
getComponent(): Component;
|
|
55
66
|
}
|
|
56
67
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Text } from "@oh-my-pi/pi-tui";
|
|
2
|
+
/**
|
|
3
|
+
* Dim transcript marker for tool calls stripped from the resolved branch
|
|
4
|
+
* (failed/retried turns, results on sibling branches). It is tool activity,
|
|
5
|
+
* so it hides and reappears with the `display.hideToolActivity` toggle.
|
|
6
|
+
*/
|
|
7
|
+
export declare class StrippedToolCallsPlaceholder extends Text {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(strippedToolCalls: number, toolActivityVisible: boolean);
|
|
10
|
+
setToolActivityVisible(visible: boolean): void;
|
|
11
|
+
render(width: number): readonly string[];
|
|
12
|
+
}
|
|
@@ -48,6 +48,7 @@ export interface ToolExecutionHandle extends Component {
|
|
|
48
48
|
}, isPartial?: boolean, toolCallId?: string): void;
|
|
49
49
|
setArgsComplete(toolCallId?: string): void;
|
|
50
50
|
setExpanded(expanded: boolean): void;
|
|
51
|
+
setToolActivityVisible(visible: boolean): void;
|
|
51
52
|
/** Freeze the block as final history: stop spinners and let it commit to scrollback. */
|
|
52
53
|
seal(): void;
|
|
53
54
|
}
|
|
@@ -139,6 +140,7 @@ export declare class ToolExecutionComponent extends Container implements NativeS
|
|
|
139
140
|
*/
|
|
140
141
|
stopAnimation(): void;
|
|
141
142
|
setExpanded(expanded: boolean): void;
|
|
143
|
+
setToolActivityVisible(visible: boolean): void;
|
|
142
144
|
setShowImages(show: boolean): void;
|
|
143
145
|
invalidate(): void;
|
|
144
146
|
render(width: number): readonly string[];
|
|
@@ -66,6 +66,7 @@ export declare class InputController {
|
|
|
66
66
|
cycleThinkingLevel(): void;
|
|
67
67
|
cycleRoleModel(direction?: "forward" | "backward"): Promise<void>;
|
|
68
68
|
toggleToolOutputExpansion(): void;
|
|
69
|
+
toggleToolActivityVisibility(): void;
|
|
69
70
|
setToolsExpanded(expanded: boolean): void;
|
|
70
71
|
toggleThinkingBlockVisibility(): void;
|
|
71
72
|
openExternalEditor(): Promise<void>;
|
|
@@ -103,6 +103,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
103
103
|
initialChatRendered: boolean;
|
|
104
104
|
isBashMode: boolean;
|
|
105
105
|
toolOutputExpanded: boolean;
|
|
106
|
+
hideToolActivity: boolean;
|
|
106
107
|
todoExpanded: boolean;
|
|
107
108
|
planModeEnabled: boolean;
|
|
108
109
|
planModePaused: boolean;
|
|
@@ -141,6 +141,7 @@ export interface InteractiveModeContext {
|
|
|
141
141
|
initialChatRendered: boolean;
|
|
142
142
|
isBashMode: boolean;
|
|
143
143
|
toolOutputExpanded: boolean;
|
|
144
|
+
hideToolActivity: boolean;
|
|
144
145
|
todoExpanded: boolean;
|
|
145
146
|
planModeEnabled: boolean;
|
|
146
147
|
vibeModeEnabled: boolean;
|
|
@@ -331,7 +332,7 @@ export interface InteractiveModeContext {
|
|
|
331
332
|
handlePythonCommand(code: string, excludeFromContext?: boolean): Promise<void>;
|
|
332
333
|
handleMCPCommand(text: string): Promise<void>;
|
|
333
334
|
handleSSHCommand(text: string): Promise<void>;
|
|
334
|
-
handleCompactCommand(customInstructions?: string, mode?: CompactMode): Promise<CompactionOutcome>;
|
|
335
|
+
handleCompactCommand(customInstructions?: string, mode?: CompactMode, beforeFlush?: (outcome: CompactionOutcome) => void | Promise<void>): Promise<CompactionOutcome>;
|
|
335
336
|
handleHandoffCommand(customInstructions?: string): Promise<void>;
|
|
336
337
|
handleShakeCommand(mode: ShakeMode): Promise<void>;
|
|
337
338
|
handleMoveCommand(targetPath?: string): Promise<void>;
|
|
@@ -2,8 +2,9 @@ import { type KeywordHighlighter } from "./gradient-highlight.js";
|
|
|
2
2
|
/** WORKFLOW_NOTICE is the default hidden notice for sessions with batched task calls enabled. */
|
|
3
3
|
export declare const WORKFLOW_NOTICE: string;
|
|
4
4
|
/** renderWorkflowNotice renders the workflow notice for the active task schema. */
|
|
5
|
-
export declare function renderWorkflowNotice({ taskBatch }: {
|
|
5
|
+
export declare function renderWorkflowNotice({ taskBatch, scoutAvailable, }: {
|
|
6
6
|
taskBatch: boolean;
|
|
7
|
+
scoutAvailable?: boolean;
|
|
7
8
|
}): string;
|
|
8
9
|
/**
|
|
9
10
|
* Whether `text` contains the standalone keyword "workflowz"
|
|
@@ -92,12 +92,21 @@ export declare class AgentLifecycleManager {
|
|
|
92
92
|
*/
|
|
93
93
|
ensureLive(id: string): Promise<AgentSession>;
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
95
|
+
* Dispose if live and drop timers. When `expected` is given, only a ref
|
|
96
|
+
* matching it is released; a stale release can never take down a newer
|
|
97
|
+
* same-id ref. Returns true when a matching ref was released.
|
|
98
|
+
*
|
|
99
|
+
* By default the ref is unregistered (teardown / one-shot removal). Pass
|
|
100
|
+
* `tombstone: true` for an explicit kill: the ref is kept registered as a
|
|
101
|
+
* terminal `aborted` row (session detached) instead of being removed, so a
|
|
102
|
+
* later persisted-subagent scan (e.g. Agent Hub reopen) skips it via its
|
|
103
|
+
* `if (!registry.get(id))` guard rather than re-adopting the surviving
|
|
104
|
+
* on-disk transcript as a fresh `parked` row. Mirrors
|
|
105
|
+
* `finalizeSubagentLifecycle`'s genuine-kill path.
|
|
99
106
|
*/
|
|
100
|
-
release(id: string, expected?: AgentRefExpectation
|
|
107
|
+
release(id: string, expected?: AgentRefExpectation, options?: {
|
|
108
|
+
tombstone?: boolean;
|
|
109
|
+
}): Promise<boolean>;
|
|
101
110
|
/** Teardown everything (process exit / main session dispose). */
|
|
102
111
|
dispose(): Promise<void>;
|
|
103
112
|
}
|
|
@@ -67,9 +67,10 @@ export declare class AgentRegistry {
|
|
|
67
67
|
static resetGlobalForTests(): void;
|
|
68
68
|
register(input: RegisterInput): AgentRef;
|
|
69
69
|
/**
|
|
70
|
-
* Register a new id only when it is absent, or reuse the exact
|
|
71
|
-
* revival was authorized to revive. A missing
|
|
72
|
-
*
|
|
70
|
+
* Register a new id only when it is absent, or reuse the exact detached
|
|
71
|
+
* `parked` ref a revival was authorized to revive. A missing, replaced, or
|
|
72
|
+
* terminal expected ref is a failed CAS: delayed revivers must never claim an
|
|
73
|
+
* id after its prior generation disappeared or was hard-killed.
|
|
73
74
|
*/
|
|
74
75
|
registerIfAvailable(input: RegisterInput, expected: AgentRef | null): AgentRef | undefined;
|
|
75
76
|
setStatus(id: string, status: AgentStatus, expected?: AgentRefExpectation): boolean;
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Agent, type AgentOptions, type AgentTelemetryConfig, type AgentTool, type ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
2
|
-
import type { Effort, Model, SimpleStreamOptions } from "@oh-my-pi/pi-ai";
|
|
2
|
+
import type { Effort, Model, ServiceTier, SimpleStreamOptions } from "@oh-my-pi/pi-ai";
|
|
3
3
|
import type { Dialect } from "@oh-my-pi/pi-ai/dialect";
|
|
4
4
|
import { type Rule } from "./capability/rule.js";
|
|
5
5
|
import { ModelRegistry } from "./config/model-registry.js";
|
|
@@ -61,6 +61,8 @@ export interface CreateAgentSessionOptions {
|
|
|
61
61
|
thinkingLevel?: ConfiguredThinkingLevel;
|
|
62
62
|
/** Hard ceiling on the session's thinking effort (e.g. a task spawn's `task.maxEffort`-capped hint); retry-fallback recovery re-clamps to it. */
|
|
63
63
|
thinkingLevelCeiling?: Effort;
|
|
64
|
+
/** OpenAI service-tier override for this session. `null` omits `service_tier`. */
|
|
65
|
+
openAIServiceTier?: ServiceTier | null;
|
|
64
66
|
/** Models available for cycling (Ctrl+P in interactive mode) */
|
|
65
67
|
scopedModels?: Array<{
|
|
66
68
|
model: Model;
|
|
@@ -349,7 +351,7 @@ export declare function discoverSkills(cwd?: string, _agentDir?: string, setting
|
|
|
349
351
|
* Discover context files (AGENTS.md) walking up from cwd.
|
|
350
352
|
* Returns files sorted by depth (farther from cwd first, so closer files appear last/more prominent).
|
|
351
353
|
*/
|
|
352
|
-
export declare function discoverContextFiles(cwd?: string, _agentDir?: string): Promise<Array<{
|
|
354
|
+
export declare function discoverContextFiles(cwd?: string, _agentDir?: string, disabledExtensions?: string[]): Promise<Array<{
|
|
353
355
|
path: string;
|
|
354
356
|
content: string;
|
|
355
357
|
depth?: number;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { type SecretEntry } from "./obfuscator.js";
|
|
2
2
|
/**
|
|
3
|
-
* Per-install secret key for the placeholder digest. Persisted under
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* key file live sessions use, per `~/.omp/agent/secret-placeholder.key` in
|
|
10
|
-
* docs/secrets.md.
|
|
3
|
+
* Per-install secret key for the placeholder digest. Persisted under XDG state
|
|
4
|
+
* and never sent to a provider, so model-visible placeholders cannot be reversed
|
|
5
|
+
* by dictionary-hashing candidate secrets. Stable across sessions so persisted
|
|
6
|
+
* transcripts deobfuscate consistently. Defaults to `getSecretPlaceholderKeyPath()`
|
|
7
|
+
* — `$XDG_STATE_HOME/omp/secret-placeholder.key` (or `~/.omp/agent/secret-placeholder.key`
|
|
8
|
+
* without XDG), per docs/secrets.md.
|
|
11
9
|
*/
|
|
12
10
|
export declare function getSecretPlaceholderKey(keyDir?: string): Promise<string>;
|
|
13
11
|
/** Return an existing placeholder key for redaction without creating a new key file. */
|
|
@@ -33,7 +31,7 @@ export declare function collectEnvSecrets(): SecretEntry[];
|
|
|
33
31
|
* API keys) that are NOT configured via secrets.yml or the environment. Without
|
|
34
32
|
* these, such a token in a tool result falls through to pi-ai's irreversible
|
|
35
33
|
* provider-boundary redaction (`[openai_token_redacted]`); the model then echoes
|
|
36
|
-
* that placeholder into edit-tool `
|
|
34
|
+
* that placeholder into edit-tool `old_string`, which can never match the real
|
|
37
35
|
* bytes on disk (issue #6968). Routing the same shapes through the obfuscator
|
|
38
36
|
* mints reversible keyed placeholders that `deobfuscateToolArguments` restores
|
|
39
37
|
* before tool execution, keeping exact-match edits working while the credential
|
|
@@ -81,6 +81,8 @@ export interface AgentSessionConfig {
|
|
|
81
81
|
agent: Agent;
|
|
82
82
|
sessionManager: SessionManager;
|
|
83
83
|
settings: Settings;
|
|
84
|
+
/** Whether the session spawn policy permits the read-only `scout` subagent. Defaults to true. */
|
|
85
|
+
scoutAllowedBySpawnPolicy?: boolean;
|
|
84
86
|
/** Whether the caller explicitly requested yolo/auto-approve behavior for this session. */
|
|
85
87
|
autoApprove?: boolean;
|
|
86
88
|
/** Models to cycle through with Ctrl+P (from --models flag). */
|
|
@@ -213,7 +215,7 @@ export interface AgentSessionConfig {
|
|
|
213
215
|
/**
|
|
214
216
|
* Build the `replace`-mode `edit` a Cursor `pi_edit` frame needs, against the
|
|
215
217
|
* advisor-scoped tool session. The advisor's ordinary instance follows the
|
|
216
|
-
* configured `edit.mode` and rejects the frame's `
|
|
218
|
+
* configured `edit.mode` and rejects the frame's `old_string`/`new_string` args.
|
|
217
219
|
*/
|
|
218
220
|
advisorCreateEditTool?(): AgentTool | undefined;
|
|
219
221
|
/**
|
|
@@ -610,7 +610,6 @@ export declare class AgentSession {
|
|
|
610
610
|
selector?: string;
|
|
611
611
|
thinkingLevel?: ThinkingLevel;
|
|
612
612
|
persist?: boolean;
|
|
613
|
-
currentContextTokens?: number;
|
|
614
613
|
}): Promise<{
|
|
615
614
|
switched: boolean;
|
|
616
615
|
}>;
|
|
@@ -1009,6 +1008,12 @@ export declare class AgentSession {
|
|
|
1009
1008
|
* @returns the number of advisors active after the rebuild.
|
|
1010
1009
|
*/
|
|
1011
1010
|
applyAdvisorConfigs(advisors: AdvisorConfig[], sharedInstructions: string | undefined): number;
|
|
1011
|
+
/**
|
|
1012
|
+
* Refresh the project context prompt advisor sessions run against after
|
|
1013
|
+
* context files change on `/reload-plugins`. Rebuilds live advisor runtimes so
|
|
1014
|
+
* they stop evaluating turns against stale `AGENTS.md` instructions.
|
|
1015
|
+
*/
|
|
1016
|
+
setAdvisorContextPrompt(contextPrompt: string | undefined): void;
|
|
1012
1017
|
/**
|
|
1013
1018
|
* Whether the advisor setting is enabled for this session.
|
|
1014
1019
|
*/
|