@oh-my-pi/pi-coding-agent 17.0.9 → 17.1.1
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 +78 -0
- package/README.md +1 -1
- package/dist/cli.js +4685 -4614
- package/dist/types/async/job-manager.d.ts +37 -1
- package/dist/types/cli/args.d.ts +2 -0
- package/dist/types/cli/bench-cli.d.ts +41 -0
- package/dist/types/commands/bench.d.ts +15 -3
- package/dist/types/commands/launch.d.ts +4 -0
- package/dist/types/config/model-registry.d.ts +3 -1
- package/dist/types/config/models-config-schema.d.ts +18 -6
- package/dist/types/config/models-config.d.ts +14 -5
- package/dist/types/config/provider-globals.d.ts +2 -2
- package/dist/types/config/service-tier.d.ts +5 -1
- package/dist/types/config/settings-schema.d.ts +374 -47
- package/dist/types/config/settings.d.ts +7 -0
- package/dist/types/dap/client.d.ts +20 -0
- package/dist/types/exec/bash-executor.d.ts +38 -0
- package/dist/types/exec/direnv.d.ts +33 -0
- package/dist/types/export/html/args.d.ts +15 -0
- package/dist/types/export/html/index.d.ts +11 -26
- package/dist/types/export/html/web-palette.d.ts +55 -116
- package/dist/types/extensibility/extensions/loader.d.ts +3 -0
- package/dist/types/extensibility/extensions/types.d.ts +17 -2
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +3 -0
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +13 -0
- package/dist/types/live/attestation.d.ts +2 -0
- package/dist/types/live/controller.d.ts +48 -0
- package/dist/types/live/protocol.d.ts +85 -0
- package/dist/types/live/protocol.test.d.ts +1 -0
- package/dist/types/live/transport.d.ts +35 -0
- package/dist/types/live/visualizer.d.ts +30 -0
- package/dist/types/lsp/client.d.ts +16 -1
- package/dist/types/mcp/config-writer.test.d.ts +1 -0
- package/dist/types/mcp/oauth-discovery.d.ts +2 -0
- package/dist/types/mcp/smithery-auth.d.ts +1 -1
- package/dist/types/mcp/smithery-auth.test.d.ts +1 -0
- package/dist/types/memory-backend/tool-names.d.ts +2 -0
- package/dist/types/modes/components/assistant-message.d.ts +1 -0
- package/dist/types/modes/components/custom-message.d.ts +1 -1
- package/dist/types/modes/components/login-dialog.d.ts +2 -2
- package/dist/types/modes/components/message-frame.d.ts +8 -4
- package/dist/types/modes/components/plan-review-overlay.d.ts +26 -0
- package/dist/types/modes/components/session-account-selector.d.ts +11 -0
- package/dist/types/modes/components/settings-defs.d.ts +7 -1
- package/dist/types/modes/components/status-line/component.jj-cache.test.d.ts +1 -0
- package/dist/types/modes/components/tool-execution.d.ts +9 -1
- package/dist/types/modes/controllers/command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/event-controller.d.ts +6 -1
- package/dist/types/modes/controllers/live-command-controller.d.ts +14 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +6 -0
- package/dist/types/modes/theme/theme.d.ts +1 -1
- package/dist/types/modes/types.d.ts +4 -1
- package/dist/types/modes/utils/context-usage.d.ts +12 -2
- package/dist/types/plan-mode/plan-files.d.ts +10 -0
- package/dist/types/registry/agent-lifecycle.d.ts +21 -9
- package/dist/types/registry/agent-registry.d.ts +11 -4
- package/dist/types/sdk.d.ts +15 -1
- package/dist/types/secrets/index.d.ts +15 -2
- package/dist/types/secrets/obfuscator.d.ts +113 -15
- package/dist/types/session/acp-permission-gate.d.ts +19 -0
- package/dist/types/session/agent-session-events.d.ts +84 -0
- package/dist/types/session/agent-session-types.d.ts +321 -0
- package/dist/types/session/agent-session.d.ts +135 -753
- package/dist/types/session/async-job-delivery.d.ts +28 -0
- package/dist/types/session/auth-storage.d.ts +1 -1
- package/dist/types/session/bash-runner.d.ts +75 -0
- package/dist/types/session/blob-store.d.ts +11 -1
- package/dist/types/session/blob-store.test.d.ts +1 -0
- package/dist/types/session/checkpoint-entries.d.ts +28 -0
- package/dist/types/session/eval-runner.d.ts +51 -0
- package/dist/types/session/irc-bridge.d.ts +46 -0
- package/dist/types/session/messages.d.ts +24 -0
- package/dist/types/session/model-controls.d.ts +180 -0
- package/dist/types/session/prewalk.d.ts +46 -0
- package/dist/types/session/queued-messages.d.ts +22 -0
- package/dist/types/session/redis-session-storage.d.ts +1 -0
- package/dist/types/session/retry-fallback-chains.d.ts +74 -0
- package/dist/types/session/role-models.d.ts +15 -0
- package/dist/types/session/session-advisors.d.ts +228 -0
- package/dist/types/session/session-entries.d.ts +8 -0
- package/dist/types/session/session-handoff.d.ts +70 -0
- package/dist/types/session/session-history-format.d.ts +6 -1
- package/dist/types/session/session-maintenance.d.ts +246 -0
- package/dist/types/session/session-manager.d.ts +41 -0
- package/dist/types/session/session-memory.d.ts +56 -0
- package/dist/types/session/session-provider-boundary.d.ts +62 -0
- package/dist/types/session/session-stats.d.ts +48 -0
- package/dist/types/session/session-tools.d.ts +158 -0
- package/dist/types/session/session-workspace.d.ts +32 -0
- package/dist/types/session/stream-guards.d.ts +44 -0
- package/dist/types/session/streaming-output.d.ts +8 -0
- package/dist/types/session/todo-tracker.d.ts +56 -0
- package/dist/types/session/ttsr-coordinator.d.ts +51 -0
- package/dist/types/session/turn-recovery.d.ts +225 -0
- package/dist/types/slash-commands/helpers/session-pin.d.ts +9 -0
- package/dist/types/stt/index.d.ts +0 -2
- package/dist/types/stt/stt-controller.d.ts +7 -0
- package/dist/types/system-prompt.d.ts +2 -0
- package/dist/types/task/executor.d.ts +4 -1
- package/dist/types/task/output-manager.d.ts +3 -1
- package/dist/types/tiny/title-client.d.ts +10 -0
- package/dist/types/tools/approval.d.ts +1 -0
- package/dist/types/tools/browser/launch.d.ts +5 -0
- package/dist/types/tools/builtin-names.d.ts +1 -1
- package/dist/types/tools/computer/protocol.d.ts +43 -0
- package/dist/types/tools/computer/supervisor.d.ts +32 -0
- package/dist/types/tools/computer/worker-entry.d.ts +1 -0
- package/dist/types/tools/computer/worker.d.ts +15 -0
- package/dist/types/tools/computer-renderer.d.ts +22 -0
- package/dist/types/tools/computer.d.ts +71 -0
- package/dist/types/tools/context.d.ts +2 -0
- package/dist/types/tools/default-renderer.d.ts +21 -0
- package/dist/types/tools/image-gen.d.ts +4 -4
- package/dist/types/tools/image-providers.d.ts +38 -0
- package/dist/types/tools/index.d.ts +7 -0
- package/dist/types/tools/path-utils.d.ts +8 -0
- package/dist/types/tools/todo.d.ts +10 -4
- package/dist/types/tools/xdev.d.ts +5 -1
- package/dist/types/tts/streaming-player.d.ts +10 -29
- package/dist/types/tts/vocalizer.d.ts +5 -0
- package/dist/types/utils/jj.d.ts +29 -0
- package/dist/types/utils/lang-from-path.d.ts +1 -0
- package/dist/types/utils/title-generator.d.ts +30 -0
- package/dist/types/utils/tools-manager.d.ts +1 -2
- package/dist/types/vibe/runtime.d.ts +36 -8
- package/dist/types/web/search/index.d.ts +1 -1
- package/dist/types/web/search/provider.d.ts +15 -5
- package/dist/types/web/search/types.d.ts +94 -0
- package/package.json +12 -12
- package/scripts/generate-share-viewer.ts +4 -6
- package/src/advisor/__tests__/advisor.test.ts +643 -0
- package/src/advisor/runtime.ts +144 -43
- package/src/async/job-manager.ts +90 -2
- package/src/cli/args.ts +3 -0
- package/src/cli/auth-gateway-cli.ts +18 -3
- package/src/cli/bench-cli.ts +395 -29
- package/src/cli/flag-tables.ts +3 -0
- package/src/cli/gc-cli.ts +2 -2
- package/src/cli/setup-cli.ts +2 -14
- package/src/cli/usage-cli.ts +10 -1
- package/src/cli.ts +8 -0
- package/src/collab/host.ts +3 -2
- package/src/commands/bench.ts +18 -4
- package/src/commands/launch.ts +4 -0
- package/src/config/model-registry.ts +16 -2
- package/src/config/models-config-schema.ts +15 -4
- package/src/config/provider-globals.ts +9 -9
- package/src/config/service-tier.ts +26 -1
- package/src/config/settings-schema.ts +270 -51
- package/src/config/settings.ts +81 -2
- package/src/dap/client.ts +37 -4
- package/src/edit/index.ts +49 -12
- package/src/eval/executor-base.ts +1 -0
- package/src/eval/js/executor.ts +2 -0
- package/src/eval/py/executor.ts +103 -33
- package/src/exec/bash-executor.ts +90 -6
- package/src/exec/direnv.ts +145 -0
- package/src/export/html/args.ts +20 -0
- package/src/export/html/index.ts +45 -47
- package/src/export/html/template.css +19 -1
- package/src/export/html/template.html +6 -0
- package/src/export/html/template.js +21 -0
- package/src/export/html/tool-views.generated.js +31 -31
- package/src/export/html/web-palette.ts +116 -132
- package/src/export/share.ts +249 -49
- package/src/extensibility/extensions/loader.ts +29 -1
- package/src/extensibility/extensions/runner.ts +6 -0
- package/src/extensibility/extensions/types.ts +33 -2
- package/src/extensibility/extensions/wrapper.ts +68 -12
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +7 -1
- package/src/extensibility/plugins/legacy-pi-compat.ts +19 -1
- package/src/hindsight/state.ts +64 -6
- package/src/internal-urls/local-protocol.ts +2 -1
- package/src/internal-urls/memory-protocol.ts +2 -2
- package/src/internal-urls/skill-protocol.ts +2 -2
- package/src/internal-urls/ssh-protocol.ts +2 -1
- package/src/internal-urls/vault-protocol.ts +2 -1
- package/src/live/attestation.ts +91 -0
- package/src/live/controller.ts +517 -0
- package/src/live/prompts/agent-final-message.md +3 -0
- package/src/live/prompts/live-instructions.md +23 -0
- package/src/live/protocol.test.ts +140 -0
- package/src/live/protocol.ts +233 -0
- package/src/live/transport.ts +422 -0
- package/src/live/visualizer.ts +214 -0
- package/src/lsp/client.ts +29 -9
- package/src/lsp/index.ts +19 -4
- package/src/main.ts +8 -1
- package/src/mcp/config-writer.test.ts +43 -0
- package/src/mcp/config-writer.ts +109 -82
- package/src/mcp/oauth-discovery.ts +10 -2
- package/src/mcp/smithery-auth.test.ts +29 -0
- package/src/mcp/smithery-auth.ts +3 -2
- package/src/memories/index.ts +40 -20
- package/src/memory-backend/tool-names.ts +2 -0
- package/src/mnemopi/backend.ts +24 -7
- package/src/modes/acp/acp-agent.ts +56 -10
- package/src/modes/acp/acp-event-mapper.ts +8 -1
- package/src/modes/components/agent-hub.ts +1 -1
- package/src/modes/components/assistant-message.ts +7 -2
- package/src/modes/components/custom-message.ts +4 -1
- package/src/modes/components/login-dialog.ts +14 -4
- package/src/modes/components/message-frame.ts +14 -8
- package/src/modes/components/plan-review-overlay.ts +350 -35
- package/src/modes/components/session-account-selector.ts +62 -0
- package/src/modes/components/settings-defs.ts +23 -1
- package/src/modes/components/settings-selector.ts +169 -1
- package/src/modes/components/status-line/component.jj-cache.test.ts +229 -0
- package/src/modes/components/status-line/component.ts +123 -2
- package/src/modes/components/tool-execution.ts +28 -112
- package/src/modes/controllers/command-controller.ts +56 -15
- package/src/modes/controllers/event-controller.ts +111 -16
- package/src/modes/controllers/extension-ui-controller.test.ts +1 -0
- package/src/modes/controllers/extension-ui-controller.ts +20 -4
- package/src/modes/controllers/input-controller.ts +47 -39
- package/src/modes/controllers/live-command-controller.ts +255 -0
- package/src/modes/controllers/mcp-command-controller.ts +10 -1
- package/src/modes/controllers/omfg-controller.ts +44 -40
- package/src/modes/controllers/selector-controller.ts +80 -10
- package/src/modes/controllers/session-focus-controller.ts +6 -1
- package/src/modes/interactive-mode.ts +176 -38
- package/src/modes/runtime-init.ts +2 -0
- package/src/modes/setup-wizard/scenes/web-search.ts +17 -9
- package/src/modes/theme/theme.ts +1 -1
- package/src/modes/types.ts +4 -1
- package/src/modes/utils/context-usage.ts +23 -7
- package/src/modes/utils/ui-helpers.ts +10 -5
- package/src/plan-mode/plan-files.ts +40 -0
- package/src/prompts/bench/cache-prefix-chunk.md +1 -0
- package/src/prompts/bench/cache-prefix.md +3 -0
- package/src/prompts/bench/cache-suffix.md +1 -0
- package/src/prompts/system/computer-safety.md +14 -0
- package/src/prompts/system/custom-system-prompt.md +1 -1
- package/src/prompts/system/project-prompt.md +8 -1
- package/src/prompts/system/subagent-async-pending.md +6 -0
- package/src/prompts/system/system-prompt.md +1 -1
- package/src/prompts/system/workflow-notice.md +48 -40
- package/src/prompts/system/xdev-mount-notice.md +4 -0
- package/src/prompts/tools/computer.md +26 -0
- package/src/prompts/tools/todo.md +3 -1
- package/src/registry/agent-lifecycle.ts +116 -46
- package/src/registry/agent-registry.ts +35 -8
- package/src/registry/persisted-agents.ts +26 -2
- package/src/sdk.ts +215 -136
- package/src/secrets/index.ts +127 -4
- package/src/secrets/obfuscator.ts +2328 -105
- package/src/session/acp-permission-gate.ts +165 -0
- package/src/session/agent-session-error-log.test.ts +1 -1
- package/src/session/agent-session-events.ts +66 -0
- package/src/session/agent-session-types.ts +343 -0
- package/src/session/agent-session.ts +1940 -12218
- package/src/session/artifacts.ts +6 -5
- package/src/session/async-job-delivery.ts +74 -0
- package/src/session/auth-storage.ts +1 -0
- package/src/session/bash-runner.ts +326 -0
- package/src/session/blob-store.test.ts +56 -0
- package/src/session/blob-store.ts +18 -2
- package/src/session/checkpoint-entries.ts +81 -0
- package/src/session/eval-runner.ts +217 -0
- package/src/session/indexed-session-storage.ts +9 -2
- package/src/session/irc-bridge.ts +203 -0
- package/src/session/messages.ts +266 -1
- package/src/session/model-controls.ts +714 -0
- package/src/session/prewalk.ts +252 -0
- package/src/session/queued-messages.ts +93 -0
- package/src/session/redis-session-storage.ts +51 -11
- package/src/session/retry-fallback-chains.ts +455 -0
- package/src/session/role-models.ts +85 -0
- package/src/session/session-advisors.ts +1679 -0
- package/src/session/session-context.ts +6 -3
- package/src/session/session-entries.ts +8 -0
- package/src/session/session-handoff.ts +308 -0
- package/src/session/session-history-format.ts +20 -9
- package/src/session/session-loader.ts +0 -46
- package/src/session/session-maintenance.ts +2983 -0
- package/src/session/session-manager.ts +390 -30
- package/src/session/session-memory.ts +222 -0
- package/src/session/session-provider-boundary.ts +307 -0
- package/src/session/session-stats.ts +293 -0
- package/src/session/session-tools.ts +980 -0
- package/src/session/session-workspace.ts +53 -0
- package/src/session/stream-guards.ts +417 -0
- package/src/session/streaming-output.ts +52 -5
- package/src/session/todo-tracker.ts +380 -0
- package/src/session/ttsr-coordinator.ts +496 -0
- package/src/session/turn-recovery.ts +1629 -0
- package/src/slash-commands/builtin-registry.ts +257 -20
- package/src/slash-commands/helpers/session-pin.ts +44 -0
- package/src/slash-commands/helpers/usage-report.ts +22 -3
- package/src/stt/downloader.ts +0 -2
- package/src/stt/index.ts +0 -2
- package/src/stt/stt-controller.ts +57 -146
- package/src/system-prompt.ts +45 -17
- package/src/task/executor.ts +285 -70
- package/src/task/index.ts +98 -105
- package/src/task/output-manager.ts +25 -3
- package/src/task/persisted-revive.ts +4 -3
- package/src/task/structured-subagent.ts +1 -0
- package/src/tiny/title-client.ts +22 -0
- package/src/tools/approval.ts +55 -10
- package/src/tools/bash-interactive.ts +116 -86
- package/src/tools/bash-skill-urls.ts +28 -2
- package/src/tools/bash.ts +339 -123
- package/src/tools/browser/launch.ts +9 -1
- package/src/tools/browser/tab-supervisor.ts +8 -5
- package/src/tools/browser.ts +94 -47
- package/src/tools/builtin-names.ts +1 -0
- package/src/tools/computer/protocol.ts +28 -0
- package/src/tools/computer/supervisor.ts +258 -0
- package/src/tools/computer/worker-entry.ts +25 -0
- package/src/tools/computer/worker.ts +135 -0
- package/src/tools/computer-renderer.ts +108 -0
- package/src/tools/computer.ts +433 -0
- package/src/tools/context.ts +2 -0
- package/src/tools/default-renderer.ts +139 -0
- package/src/tools/essential-tools.ts +1 -0
- package/src/tools/image-gen.ts +20 -28
- package/src/tools/image-providers.ts +50 -0
- package/src/tools/index.ts +14 -0
- package/src/tools/path-utils.ts +49 -2
- package/src/tools/read.ts +156 -88
- package/src/tools/renderers.ts +9 -1
- package/src/tools/todo.ts +101 -11
- package/src/tools/vibe.ts +1 -2
- package/src/tools/write.ts +51 -1
- package/src/tools/xdev.ts +121 -29
- package/src/tts/streaming-player.ts +82 -283
- package/src/tts/vocalizer.ts +18 -1
- package/src/utils/clipboard.ts +1 -30
- package/src/utils/jj.ts +125 -4
- package/src/utils/lang-from-path.ts +7 -0
- package/src/utils/mac-file-urls.applescript +37 -0
- package/src/utils/title-generator.ts +137 -1
- package/src/utils/tool-choice.ts +14 -0
- package/src/utils/tools-manager.ts +1 -19
- package/src/vibe/runtime.ts +852 -72
- package/src/web/search/index.ts +3 -6
- package/src/web/search/provider.ts +31 -16
- package/src/web/search/providers/xai.ts +7 -1
- package/src/web/search/types.ts +3 -0
- package/dist/types/stt/recorder.d.ts +0 -30
- package/dist/types/stt/transcriber.d.ts +0 -14
- package/dist/types/stt/wav.d.ts +0 -29
- package/dist/types/tts/player.d.ts +0 -32
- package/src/stt/recorder.ts +0 -551
- package/src/stt/transcriber.ts +0 -60
- package/src/stt/wav.ts +0 -173
- package/src/tts/player.ts +0 -137
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Component } from "@oh-my-pi/pi-tui";
|
|
2
|
+
/** Distinct states of a realtime call connection. */
|
|
3
|
+
export type LivePhase = "connecting" | "listening" | "working" | "speaking" | "muted" | "error";
|
|
4
|
+
/** Configuration callbacks for user interactions in the visualizer. */
|
|
5
|
+
export interface LiveVisualizerOptions {
|
|
6
|
+
onStop(): void;
|
|
7
|
+
onToggleMute(): void;
|
|
8
|
+
}
|
|
9
|
+
/** A compact, fixed-height terminal component for displaying a realtime call. */
|
|
10
|
+
export declare class LiveVisualizer implements Component {
|
|
11
|
+
#private;
|
|
12
|
+
readonly wantsKeyRelease = false;
|
|
13
|
+
constructor(options: LiveVisualizerOptions);
|
|
14
|
+
/** Updates the current call phase. */
|
|
15
|
+
setPhase(phase: LivePhase): void;
|
|
16
|
+
/** Updates the microphone volume level (0..1). */
|
|
17
|
+
setInputLevel(level: number): void;
|
|
18
|
+
/** Advances the spectrum animation and its peak decay. */
|
|
19
|
+
setFrame(frame: number): void;
|
|
20
|
+
/** Updates the user's streaming voice transcript. */
|
|
21
|
+
setTranscript(text: string): void;
|
|
22
|
+
/** Clears the user's voice transcript row. */
|
|
23
|
+
clearTranscript(): void;
|
|
24
|
+
/** Processes user keypresses. */
|
|
25
|
+
handleInput(data: string): void;
|
|
26
|
+
/** Clears the render cache. */
|
|
27
|
+
invalidate(): void;
|
|
28
|
+
/** Renders the microphone spectrum into a compact fixed-height panel. */
|
|
29
|
+
render(width: number): readonly string[];
|
|
30
|
+
}
|
|
@@ -69,10 +69,25 @@ export declare function notifyWorkspaceWatchedFiles(cwd: string, changes: readon
|
|
|
69
69
|
* Increments version, sends didChange and didSave notifications.
|
|
70
70
|
*/
|
|
71
71
|
export declare function refreshFile(client: LspClient, filePath: string, signal?: AbortSignal): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Tear down a specific client instance using the LSP shutdown/exit handshake.
|
|
74
|
+
*
|
|
75
|
+
* Removes the client from the registry by identity first (never evicting a
|
|
76
|
+
* newer client already republished under the same key), then performs a bounded
|
|
77
|
+
* graceful shutdown, force-killing and awaiting confirmed process exit.
|
|
78
|
+
*
|
|
79
|
+
* @returns `true` once the process is confirmed exited, `false` if it outlived
|
|
80
|
+
* the shutdown budget — callers reporting a restart must treat `false` as a
|
|
81
|
+
* failed teardown, not a completed restart.
|
|
82
|
+
*/
|
|
83
|
+
export declare function shutdownClientInstance(client: LspClient): Promise<boolean>;
|
|
72
84
|
/**
|
|
73
85
|
* Shutdown a specific client by key.
|
|
86
|
+
*
|
|
87
|
+
* @returns `true` when the client is gone (already absent or confirmed exited),
|
|
88
|
+
* `false` if a live process outlived the shutdown budget.
|
|
74
89
|
*/
|
|
75
|
-
export declare function shutdownClient(key: string): Promise<
|
|
90
|
+
export declare function shutdownClient(key: string): Promise<boolean>;
|
|
76
91
|
/**
|
|
77
92
|
* Send an LSP request and wait for response.
|
|
78
93
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -55,6 +55,7 @@ export declare function analyzeAuthError(error: Error, serverUrl?: string): Auth
|
|
|
55
55
|
*/
|
|
56
56
|
export declare function fetchResourceMetadataScopes(resourceMetadataUrl: string, opts?: {
|
|
57
57
|
fetch?: FetchImpl;
|
|
58
|
+
signal?: AbortSignal;
|
|
58
59
|
}): Promise<string | undefined>;
|
|
59
60
|
/**
|
|
60
61
|
* Try to discover OAuth endpoints by querying the server's well-known endpoints.
|
|
@@ -64,4 +65,5 @@ export declare function discoverOAuthEndpoints(serverUrl: string, authServerUrl?
|
|
|
64
65
|
fetch?: FetchImpl;
|
|
65
66
|
protectedResource?: string;
|
|
66
67
|
protectedScopes?: string;
|
|
68
|
+
signal?: AbortSignal;
|
|
67
69
|
}): Promise<OAuthEndpoints | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,6 +14,7 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
14
14
|
private readonly thinkingRenderers;
|
|
15
15
|
private readonly imageBudget?;
|
|
16
16
|
private proseOnlyThinking;
|
|
17
|
+
setTextColorTransform(transform?: (text: string) => string): void;
|
|
17
18
|
constructor(message?: AssistantMessage, hideThinkingBlock?: boolean, onImageUpdate?: (() => void) | undefined, thinkingRenderers?: readonly AssistantThinkingRenderer[], imageBudget?: ImageBudget | undefined, proseOnlyThinking?: boolean);
|
|
18
19
|
/**
|
|
19
20
|
* Show or clear the slim cache-invalidation divider above this turn. Set at
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Container } from "@oh-my-pi/pi-tui";
|
|
2
2
|
import type { MessageRenderer } from "../../extensibility/extensions/types.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type CustomMessage } from "../../session/messages.js";
|
|
4
4
|
/**
|
|
5
5
|
* Component that renders a custom message entry from extensions.
|
|
6
6
|
* Uses distinct styling to differentiate from user messages.
|
|
@@ -15,8 +15,8 @@ export declare class LoginDialogComponent extends Container {
|
|
|
15
15
|
* is offered as an additional local shortcut so narrow local terminals still
|
|
16
16
|
* have a truncation-safe copy target (viewport clipping on a long authorize
|
|
17
17
|
* URL silently drops trailing OAuth query parameters — e.g.
|
|
18
|
-
* `code_challenge_method=S256`).
|
|
19
|
-
*
|
|
18
|
+
* `code_challenge_method=S256`). Every physical URL row carries its own OSC 8
|
|
19
|
+
* link to the full URL, so clicking any wrapped fragment opens the same target.
|
|
20
20
|
*/
|
|
21
21
|
showAuth(url: string, instructions?: string, launchUrl?: string): void;
|
|
22
22
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { TextContent } from "@oh-my-pi/pi-ai";
|
|
11
11
|
import type { Box, Component } from "@oh-my-pi/pi-tui";
|
|
12
|
-
import { type Theme } from "../../modes/theme/theme.js";
|
|
12
|
+
import { type Theme, type ThemeColor } from "../../modes/theme/theme.js";
|
|
13
13
|
/** Message shape consumed by the shared frame. */
|
|
14
14
|
export interface FramedMessage {
|
|
15
15
|
customType: string;
|
|
@@ -31,14 +31,18 @@ export interface RebuildFrameOptions<M extends FramedMessage> {
|
|
|
31
31
|
expanded: boolean;
|
|
32
32
|
/** Icon glyph shown before the customType in the default header (e.g. a hook/extension icon). */
|
|
33
33
|
icon?: string;
|
|
34
|
+
/** Hide the default type header while retaining the message body. */
|
|
35
|
+
hideHeader?: boolean;
|
|
36
|
+
/** Semantic color for the outline, defaulting to the muted border. */
|
|
37
|
+
borderColor?: ThemeColor;
|
|
34
38
|
/** Collapse the markdown body to this many lines when `expanded` is false. Omit to never collapse. */
|
|
35
39
|
collapseAfterLines?: number;
|
|
36
40
|
customRenderer?: FramedRenderer<M>;
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
39
43
|
* Attempt the custom renderer; on failure or undefined return, populate `box`
|
|
40
|
-
* with the
|
|
41
|
-
*
|
|
42
|
-
*
|
|
44
|
+
* with the configured outline, optional type header, and markdown body. When
|
|
45
|
+
* the custom renderer succeeds, return its Component so the caller can mount
|
|
46
|
+
* it and skip the default box.
|
|
43
47
|
*/
|
|
44
48
|
export declare function renderFramedMessage<M extends FramedMessage>(opts: RebuildFrameOptions<M>): Component | undefined;
|
|
@@ -18,6 +18,28 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { type Component } from "@oh-my-pi/pi-tui";
|
|
20
20
|
import type { HookSelectorSlider } from "./hook-selector.js";
|
|
21
|
+
/** Serializable annotations retained by the plan-review owner between overlays. */
|
|
22
|
+
export interface PlanReviewAnnotationState {
|
|
23
|
+
annotations: Array<{
|
|
24
|
+
section: {
|
|
25
|
+
index: number;
|
|
26
|
+
title: string;
|
|
27
|
+
/** Heading ancestry from the document root, when emitted by this overlay. */
|
|
28
|
+
path?: string[];
|
|
29
|
+
/** Hash of the section source, used to reject ambiguous moved headings. */
|
|
30
|
+
contentHash?: string;
|
|
31
|
+
};
|
|
32
|
+
target: {
|
|
33
|
+
kind: "section";
|
|
34
|
+
} | {
|
|
35
|
+
kind: "line";
|
|
36
|
+
row: number;
|
|
37
|
+
context: string;
|
|
38
|
+
contextTruncated?: boolean;
|
|
39
|
+
};
|
|
40
|
+
note: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
21
43
|
export interface PlanReviewOverlayCallbacks {
|
|
22
44
|
/** Invoked with the chosen option label (never a disabled one). */
|
|
23
45
|
onPick: (label: string) => void;
|
|
@@ -33,6 +55,8 @@ export interface PlanReviewOverlayCallbacks {
|
|
|
33
55
|
onPlanEdited?: (content: string) => void;
|
|
34
56
|
/** Invoked with the Refine feedback markdown whenever annotations change. */
|
|
35
57
|
onFeedbackChange?: (feedback: string) => void;
|
|
58
|
+
/** Invoked with a serializable annotation snapshot whenever annotations change. */
|
|
59
|
+
onAnnotationStateChange?: (state: PlanReviewAnnotationState) => void;
|
|
36
60
|
}
|
|
37
61
|
export interface PlanReviewOverlayOptions {
|
|
38
62
|
/** Prompt rendered above the options (e.g. "Plan mode - next step"). */
|
|
@@ -48,6 +72,8 @@ export interface PlanReviewOverlayOptions {
|
|
|
48
72
|
slider?: HookSelectorSlider;
|
|
49
73
|
/** Display label for the external-editor key, surfaced in the footer help. */
|
|
50
74
|
externalEditorLabel?: string;
|
|
75
|
+
/** Serializable annotations restored into this overlay instance. */
|
|
76
|
+
annotationState?: PlanReviewAnnotationState;
|
|
51
77
|
}
|
|
52
78
|
export declare class PlanReviewOverlay implements Component {
|
|
53
79
|
#private;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Container, type SgrMouseEvent } from "@oh-my-pi/pi-tui";
|
|
2
|
+
import type { SessionPinAccount } from "../../slash-commands/helpers/session-pin.js";
|
|
3
|
+
/** Account picker opened by `/session pin` for the current model provider. */
|
|
4
|
+
export declare class SessionAccountSelectorComponent extends Container {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(providerName: string, accounts: readonly SessionPinAccount[], onSelect: (account: SessionPinAccount) => void, onCancel: () => void);
|
|
7
|
+
/** Forward keyboard navigation and cancellation when the wrapper owns focus. */
|
|
8
|
+
handleInput(keyData: string): void;
|
|
9
|
+
/** Route mouse selection through the title rows into the account list. */
|
|
10
|
+
routeMouse(event: SgrMouseEvent, line: number, col: number): void;
|
|
11
|
+
}
|
|
@@ -45,7 +45,13 @@ export interface TextInputSettingDef extends BaseSettingDef {
|
|
|
45
45
|
export interface ProviderLimitsSettingDef extends BaseSettingDef {
|
|
46
46
|
type: "providerLimits";
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
/** Array-of-enum setting edited as a toggle list; `ordered` lists render positions and support reordering. */
|
|
49
|
+
export interface MultiSelectSettingDef extends BaseSettingDef {
|
|
50
|
+
type: "multiselect";
|
|
51
|
+
options: OptionList;
|
|
52
|
+
ordered: boolean;
|
|
53
|
+
}
|
|
54
|
+
export type SettingDef = BooleanSettingDef | EnumSettingDef | SubmenuSettingDef | TextInputSettingDef | ProviderLimitsSettingDef | MultiSelectSettingDef;
|
|
49
55
|
/** Get all setting definitions with UI */
|
|
50
56
|
export declare function getAllSettingDefs(): SettingDef[];
|
|
51
57
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -92,7 +92,15 @@ export declare class ToolExecutionComponent extends Container implements NativeS
|
|
|
92
92
|
* immutable native scrollback before the result replaces them.
|
|
93
93
|
*/
|
|
94
94
|
getNativeScrollbackLiveRegionStart(): number | undefined;
|
|
95
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* Keeps in-flight TV-wall frames out of immutable native scrollback: the
|
|
97
|
+
* `vibe_wait` wall and displaceable snapshots (`hub` waiting polls, `todo`
|
|
98
|
+
* lists). Their frames replace each other rather than append, and their
|
|
99
|
+
* rows mutate every spinner tick — an unpinned commit records a per-tick
|
|
100
|
+
* frozen snapshot AND force-seals the block (see TranscriptContainer's
|
|
101
|
+
* committed-snapshot seal), so the next poll stacks a new frame instead of
|
|
102
|
+
* displacing this one.
|
|
103
|
+
*/
|
|
96
104
|
isNativeScrollbackLiveRegionPinned(): boolean;
|
|
97
105
|
/**
|
|
98
106
|
* Whether this block has reached a terminal state for transcript freezing.
|
|
@@ -60,4 +60,4 @@ export declare function renderProviderSection(details: ProviderDetails, uiTheme:
|
|
|
60
60
|
* Example output: `Quota: 7d window · 67% used · resets in 3.2d`
|
|
61
61
|
*/
|
|
62
62
|
export declare function formatCompactQuota(provider: string, reports: UsageReport[], nowMs: number, activeAccount?: OAuthAccountIdentity): string | null;
|
|
63
|
-
export declare function renderUsageReports(reports: UsageReport[], uiTheme: typeof theme, nowMs: number, availableWidth: number, resolveActiveAccount?: (provider: string) => OAuthAccountIdentity | undefined): string;
|
|
63
|
+
export declare function renderUsageReports(reports: UsageReport[], uiTheme: typeof theme, nowMs: number, availableWidth: number, resolveActiveAccount?: (provider: string) => OAuthAccountIdentity | undefined, usageModelSelectors?: readonly string[]): string;
|
|
@@ -24,5 +24,10 @@ export declare class EventController {
|
|
|
24
24
|
* Drops the candidate when it is no longer a displaceable todo.
|
|
25
25
|
*/
|
|
26
26
|
inheritDisplaceableTodo(component: ToolExecutionComponent | null | undefined): void;
|
|
27
|
-
|
|
27
|
+
sendErrorNotification(event: Extract<AgentSessionEvent, {
|
|
28
|
+
type: "agent_end";
|
|
29
|
+
}>): void;
|
|
30
|
+
sendCompletionNotification(event: Extract<AgentSessionEvent, {
|
|
31
|
+
type: "agent_end";
|
|
32
|
+
}>): void;
|
|
28
33
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { InteractiveModeContext } from "../types.js";
|
|
2
|
+
/** Owns the editor-replacing visualizer and realtime session lifecycle for `/live`. */
|
|
3
|
+
export declare class LiveCommandController {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(ctx: InteractiveModeContext);
|
|
6
|
+
/** Whether a live session is connected, connecting, or closing. */
|
|
7
|
+
get active(): boolean;
|
|
8
|
+
/** Start live mode, or stop the currently active session. */
|
|
9
|
+
handleCommand(): Promise<void>;
|
|
10
|
+
/** Stop the active live session and restore the editor. */
|
|
11
|
+
stop(): Promise<void>;
|
|
12
|
+
/** Release UI resources during synchronous InteractiveMode teardown. */
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
@@ -55,6 +55,7 @@ export declare class SelectorController {
|
|
|
55
55
|
}): Promise<boolean>;
|
|
56
56
|
handleSessionDeleteCommand(): Promise<void>;
|
|
57
57
|
showOAuthSelector(mode: "login" | "logout", providerId?: string): Promise<void>;
|
|
58
|
+
showSessionPinSelector(): Promise<void>;
|
|
58
59
|
showResetUsageSelector(): Promise<void>;
|
|
59
60
|
showDebugSelector(): Promise<void>;
|
|
60
61
|
showAgentHub(observers: SessionObserverRegistry, options?: {
|
|
@@ -27,6 +27,7 @@ import type { EvalExecutionComponent } from "./components/eval-execution.js";
|
|
|
27
27
|
import type { HookEditorComponent } from "./components/hook-editor.js";
|
|
28
28
|
import type { HookInputComponent } from "./components/hook-input.js";
|
|
29
29
|
import type { HookSelectorComponent, HookSelectorSlider } from "./components/hook-selector.js";
|
|
30
|
+
import { type PlanReviewAnnotationState } from "./components/plan-review-overlay.js";
|
|
30
31
|
import { StatusLineComponent } from "./components/status-line/index.js";
|
|
31
32
|
import type { ToolExecutionHandle } from "./components/tool-execution.js";
|
|
32
33
|
import { TranscriptContainer } from "./components/transcript-container.js";
|
|
@@ -247,6 +248,8 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
247
248
|
onExternalEditor?: () => void;
|
|
248
249
|
onPlanEdited?: (content: string) => void;
|
|
249
250
|
onFeedbackChange?: (feedback: string) => void;
|
|
251
|
+
annotationState?: PlanReviewAnnotationState;
|
|
252
|
+
onAnnotationStateChange?: (state: PlanReviewAnnotationState) => void;
|
|
250
253
|
initialIndex?: number;
|
|
251
254
|
}, extra?: {
|
|
252
255
|
slider?: HookSelectorSlider;
|
|
@@ -340,6 +343,8 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
340
343
|
handleRenameCommand(title: string): Promise<void>;
|
|
341
344
|
handleMemoryCommand(text: string): Promise<void>;
|
|
342
345
|
handleSTTToggle(): Promise<void>;
|
|
346
|
+
/** Start or stop the Codex-backed realtime voice surface. */
|
|
347
|
+
handleLiveCommand(): Promise<void>;
|
|
343
348
|
showDebugSelector(): Promise<void>;
|
|
344
349
|
showAgentHub(options?: {
|
|
345
350
|
requireContent?: boolean;
|
|
@@ -371,6 +376,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
371
376
|
handleResumeSession(sessionPath: string): Promise<void>;
|
|
372
377
|
handleSessionDeleteCommand(): Promise<void>;
|
|
373
378
|
showOAuthSelector(mode: "login" | "logout", providerId?: string): Promise<void>;
|
|
379
|
+
showSessionPinSelector(): Promise<void>;
|
|
374
380
|
showResetUsageSelector(): Promise<void>;
|
|
375
381
|
showProviderSetup(): Promise<void>;
|
|
376
382
|
showHookConfirm(title: string, message: string): Promise<boolean>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Effort } from "@oh-my-pi/pi-ai";
|
|
3
3
|
import type { EditorTheme, MarkdownTheme, SelectListTheme, SettingsListTheme, SymbolTheme } from "@oh-my-pi/pi-tui";
|
|
4
|
-
export { getLanguageFromPath } from "../../utils/lang-from-path.js";
|
|
4
|
+
export { getLanguageFromPath, isMarkdownPath } from "../../utils/lang-from-path.js";
|
|
5
5
|
export type SymbolPreset = "unicode" | "nerd" | "ascii";
|
|
6
6
|
/**
|
|
7
7
|
* All available symbol keys organized by category.
|
|
@@ -61,7 +61,7 @@ export type SubmittedUserInput = {
|
|
|
61
61
|
cancelled: boolean;
|
|
62
62
|
started: boolean;
|
|
63
63
|
};
|
|
64
|
-
export type TodoStatus = "pending" | "in_progress" | "completed" | "abandoned";
|
|
64
|
+
export type TodoStatus = "pending" | "in_progress" | "completed" | "abandoned" | "blocked";
|
|
65
65
|
export type TodoItem = {
|
|
66
66
|
content: string;
|
|
67
67
|
status: TodoStatus;
|
|
@@ -334,6 +334,8 @@ export interface InteractiveModeContext {
|
|
|
334
334
|
handleRenameCommand(title: string): Promise<void>;
|
|
335
335
|
handleMemoryCommand(text: string): Promise<void>;
|
|
336
336
|
handleSTTToggle(): Promise<void>;
|
|
337
|
+
/** Start or stop the Codex-backed realtime voice session. */
|
|
338
|
+
handleLiveCommand(): Promise<void>;
|
|
337
339
|
executeCompaction(customInstructionsOrOptions?: string | CompactOptions, isAuto?: boolean): Promise<CompactionOutcome>;
|
|
338
340
|
openInBrowser(urlOrPath: string): void;
|
|
339
341
|
refreshSlashCommandState(cwd?: string): Promise<void>;
|
|
@@ -356,6 +358,7 @@ export interface InteractiveModeContext {
|
|
|
356
358
|
handleResumeSession(sessionPath: string): Promise<void>;
|
|
357
359
|
handleSessionDeleteCommand(): Promise<void>;
|
|
358
360
|
showOAuthSelector(mode: "login" | "logout", providerId?: string): Promise<void>;
|
|
361
|
+
showSessionPinSelector(): Promise<void>;
|
|
359
362
|
showResetUsageSelector(): Promise<void>;
|
|
360
363
|
showProviderSetup(): Promise<void>;
|
|
361
364
|
showHookConfirm(title: string, message: string): Promise<boolean>;
|
|
@@ -22,16 +22,26 @@ export interface ContextBreakdown {
|
|
|
22
22
|
/** Estimated snapcompact wire savings; set when requested and a snapcompact.* setting is enabled. */
|
|
23
23
|
snapcompact?: SnapcompactSavingsEstimate;
|
|
24
24
|
}
|
|
25
|
+
/** Stable inputs used to cache non-message token estimates. */
|
|
26
|
+
export interface NonMessageTokenSource {
|
|
27
|
+
readonly systemPrompt?: string[];
|
|
28
|
+
readonly agent?: {
|
|
29
|
+
readonly state?: {
|
|
30
|
+
readonly tools?: ReadonlyArray<Pick<Tool, "name" | "description" | "parameters">>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readonly skills?: readonly Skill[];
|
|
34
|
+
}
|
|
25
35
|
export declare function estimateSkillsTokens(skills: readonly Skill[]): number;
|
|
26
36
|
export declare function estimateToolSchemaTokens(tools: ReadonlyArray<Pick<Tool, "name" | "description" | "parameters">>): number;
|
|
27
|
-
export declare function computeNonMessageTokens(session:
|
|
37
|
+
export declare function computeNonMessageTokens(session: NonMessageTokenSource): number;
|
|
28
38
|
/**
|
|
29
39
|
* Shared helper for the four non-message token totals used by
|
|
30
40
|
* `computeContextBreakdown` (/context panel). Keep this category split stable:
|
|
31
41
|
* the status-line fast path intentionally uses the equivalent collapsed total
|
|
32
42
|
* in `computeNonMessageTokens`.
|
|
33
43
|
*/
|
|
34
|
-
export declare function computeNonMessageBreakdown(session:
|
|
44
|
+
export declare function computeNonMessageBreakdown(session: NonMessageTokenSource): {
|
|
35
45
|
skillsTokens: number;
|
|
36
46
|
toolsTokens: number;
|
|
37
47
|
systemContextTokens: number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type LocalProtocolOptions } from "../internal-urls/index.js";
|
|
2
|
+
/** Reads a plan from a local URL or cwd-relative filesystem path. */
|
|
3
|
+
export declare function readPlanFile(planFilePath: string, options: {
|
|
4
|
+
localProtocolOptions: LocalProtocolOptions;
|
|
5
|
+
cwd: string;
|
|
6
|
+
}): Promise<string | null>;
|
|
7
|
+
/** Lists session-local plan files from newest to oldest. */
|
|
8
|
+
export declare function listPlanFiles(options: {
|
|
9
|
+
localProtocolOptions: LocalProtocolOptions;
|
|
10
|
+
}): Promise<string[]>;
|
|
@@ -14,10 +14,14 @@
|
|
|
14
14
|
* - ensureLive during an in-flight park either cancels the park (session still
|
|
15
15
|
* live) or waits for detach+park and then revives.
|
|
16
16
|
* - Concurrent ensureLive/park operations coalesce per id.
|
|
17
|
+
*
|
|
18
|
+
* Every adoption, park, and revival is bound to the exact {@link AgentRef} it
|
|
19
|
+
* started from, so stale async work (a late finalizer, a cancelled initializer,
|
|
20
|
+
* a superseded revive) can never clobber a newer same-id ref.
|
|
17
21
|
*/
|
|
18
22
|
import type { AgentSession } from "../session/agent-session.js";
|
|
19
|
-
import { type AgentRef, AgentRegistry } from "./agent-registry.js";
|
|
20
|
-
export type AgentReviver = () => Promise<AgentSession>;
|
|
23
|
+
import { type AgentRef, type AgentRefExpectation, AgentRegistry } from "./agent-registry.js";
|
|
24
|
+
export type AgentReviver = (expected: AgentRef) => Promise<AgentSession>;
|
|
21
25
|
/**
|
|
22
26
|
* Builds a reviver for a `parked` ref restored from disk (Agent Hub scan,
|
|
23
27
|
* collab mirror, resumed process) that carries a sessionFile but no in-memory
|
|
@@ -48,10 +52,12 @@ export declare class AgentLifecycleManager {
|
|
|
48
52
|
/**
|
|
49
53
|
* Take ownership of a finished subagent. Caller has already set registry
|
|
50
54
|
* status to "idle". Arms the TTL timer (idleTtlMs <= 0 adopts without one).
|
|
55
|
+
* When `expected` is given, the adoption is refused if the id no longer
|
|
56
|
+
* resolves to that ref (or that ref's session).
|
|
51
57
|
*/
|
|
52
|
-
adopt(id: string, opts: AdoptOptions): void;
|
|
53
|
-
/** True if the id is adopted (parked or live). */
|
|
54
|
-
has(id: string): boolean;
|
|
58
|
+
adopt(id: string, opts: AdoptOptions, expected?: AgentRefExpectation): void;
|
|
59
|
+
/** True if the id is adopted (parked or live) — and, when `expected` is given, still bound to that ref. */
|
|
60
|
+
has(id: string, expected?: AgentRefExpectation): boolean;
|
|
55
61
|
/**
|
|
56
62
|
* True when this manager owns `registry` — i.e. its adopt/park/revive state
|
|
57
63
|
* describes that registry's refs. Lets a caller holding a specific registry
|
|
@@ -62,9 +68,10 @@ export declare class AgentLifecycleManager {
|
|
|
62
68
|
/**
|
|
63
69
|
* True while {@link park} is disposing this agent's session (lets dispose
|
|
64
70
|
* hooks distinguish park from teardown). False once the park is cancelled
|
|
65
|
-
* by ensureLive or after detach+dispose completes.
|
|
71
|
+
* by ensureLive or after detach+dispose completes. When `expected` is
|
|
72
|
+
* given, only a park bound to that ref (or its session) counts.
|
|
66
73
|
*/
|
|
67
|
-
isParking(id: string): boolean;
|
|
74
|
+
isParking(id: string, expected?: AgentRefExpectation): boolean;
|
|
68
75
|
/**
|
|
69
76
|
* Dispose the live session, detach it from the registry, and mark the
|
|
70
77
|
* agent `parked`. No-op unless the id is adopted and live.
|
|
@@ -84,8 +91,13 @@ export declare class AgentLifecycleManager {
|
|
|
84
91
|
* cancelled (session still live) or awaited to completion before revive.
|
|
85
92
|
*/
|
|
86
93
|
ensureLive(id: string): Promise<AgentSession>;
|
|
87
|
-
/**
|
|
88
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Hard removal: dispose if live, unregister from registry, drop timers.
|
|
96
|
+
* When `expected` is given, only a ref matching it is released; a stale
|
|
97
|
+
* release can never take down a newer same-id ref. Returns true when a
|
|
98
|
+
* matching ref was released.
|
|
99
|
+
*/
|
|
100
|
+
release(id: string, expected?: AgentRefExpectation): Promise<boolean>;
|
|
89
101
|
/** Teardown everything (process exit / main session dispose). */
|
|
90
102
|
dispose(): Promise<void>;
|
|
91
103
|
}
|
|
@@ -39,6 +39,7 @@ export interface AgentRef {
|
|
|
39
39
|
/** Short gist of what the agent is currently doing (latest intent or tool), for the work-aware roster. Display-only. */
|
|
40
40
|
activity?: string;
|
|
41
41
|
}
|
|
42
|
+
export type AgentRefExpectation = AgentRef | AgentSession;
|
|
42
43
|
export type RegistryEvent = {
|
|
43
44
|
type: "registered";
|
|
44
45
|
ref: AgentRef;
|
|
@@ -65,7 +66,13 @@ export declare class AgentRegistry {
|
|
|
65
66
|
/** Reset the global registry. Test-only. */
|
|
66
67
|
static resetGlobalForTests(): void;
|
|
67
68
|
register(input: RegisterInput): AgentRef;
|
|
68
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Register a new id only when it is absent, or reuse the exact ref a parked
|
|
71
|
+
* revival was authorized to revive. A missing expected ref is a failed CAS:
|
|
72
|
+
* callers must never claim an id after its prior generation disappeared.
|
|
73
|
+
*/
|
|
74
|
+
registerIfAvailable(input: RegisterInput, expected: AgentRef | null): AgentRef | undefined;
|
|
75
|
+
setStatus(id: string, status: AgentStatus, expected?: AgentRefExpectation): boolean;
|
|
69
76
|
/**
|
|
70
77
|
* Record a short activity gist for the work-aware roster. Display-only and
|
|
71
78
|
* read on demand (`irc list`, peer roster), so it emits no event — keeping
|
|
@@ -81,9 +88,9 @@ export declare class AgentRegistry {
|
|
|
81
88
|
* every caller is safe without sanitizing at its own call site.
|
|
82
89
|
*/
|
|
83
90
|
setActivity(id: string, activity: string): void;
|
|
84
|
-
attachSession(id: string, session: AgentSession, sessionFile?: string | null):
|
|
85
|
-
detachSession(id: string):
|
|
86
|
-
unregister(id: string):
|
|
91
|
+
attachSession(id: string, session: AgentSession, sessionFile?: string | null, expected?: AgentRefExpectation): boolean;
|
|
92
|
+
detachSession(id: string, expected?: AgentRefExpectation): boolean;
|
|
93
|
+
unregister(id: string, expected?: AgentRefExpectation): boolean;
|
|
87
94
|
get(id: string): AgentRef | undefined;
|
|
88
95
|
list(): AgentRef[];
|
|
89
96
|
/**
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import type { HindsightSessionState } from "./hindsight/state.js";
|
|
|
16
16
|
import { type LocalProtocolOptions } from "./internal-urls/index.js";
|
|
17
17
|
import { MCPManager, type MCPToolsLoadResult } from "./mcp/index.js";
|
|
18
18
|
import type { MnemopiSessionState } from "./mnemopi/state.js";
|
|
19
|
-
import { AgentRegistry } from "./registry/agent-registry.js";
|
|
19
|
+
import { type AgentRef, AgentRegistry } from "./registry/agent-registry.js";
|
|
20
20
|
import { AgentSession, type PlanYolo, type Prewalk } from "./session/agent-session.js";
|
|
21
21
|
import type { AuthStorage } from "./session/auth-storage.js";
|
|
22
22
|
import { SessionManager } from "./session/session-manager.js";
|
|
@@ -29,6 +29,8 @@ import { type WorkspaceTree } from "./workspace-tree.js";
|
|
|
29
29
|
export interface CreateAgentSessionOptions {
|
|
30
30
|
/** Working directory for project-local discovery. Default: getProjectDir() */
|
|
31
31
|
cwd?: string;
|
|
32
|
+
/** Additional workspace directories beyond cwd (multi-root), absolute or cwd-relative. */
|
|
33
|
+
additionalDirectories?: string[];
|
|
32
34
|
/** Global config directory. Default: ~/.omp/agent */
|
|
33
35
|
agentDir?: string;
|
|
34
36
|
/** Spawns to allow. Default: "*" */
|
|
@@ -180,6 +182,13 @@ export interface CreateAgentSessionOptions {
|
|
|
180
182
|
agentDisplayName?: string;
|
|
181
183
|
/** Optional shared agent registry for IRC routing. Default: AgentRegistry.global(). */
|
|
182
184
|
agentRegistry?: AgentRegistry;
|
|
185
|
+
/**
|
|
186
|
+
* Registry generation authorized for this creation. `null` requires the id
|
|
187
|
+
* to be absent; an AgentRef allows a parked revival to reuse only that ref.
|
|
188
|
+
* Undefined preserves legacy unconditional registration for external SDK callers.
|
|
189
|
+
* @internal
|
|
190
|
+
*/
|
|
191
|
+
expectedAgentRef?: AgentRef | null;
|
|
183
192
|
/** Parent task ID prefix for nested artifact naming (e.g., "Extensions") */
|
|
184
193
|
parentTaskPrefix?: string;
|
|
185
194
|
/**
|
|
@@ -205,6 +214,11 @@ export interface CreateAgentSessionOptions {
|
|
|
205
214
|
settingsManager?: Settings | Promise<Settings>;
|
|
206
215
|
/** Whether UI is available (enables interactive tools like ask). Default: false */
|
|
207
216
|
hasUI?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Defer `confirm` reserve-policy fallback until AgentSession prompt-time UI is configured.
|
|
219
|
+
* ACP uses this while capabilities are negotiated without enabling UI-only tools.
|
|
220
|
+
*/
|
|
221
|
+
deferUsageReserveConfirmation?: boolean;
|
|
208
222
|
/**
|
|
209
223
|
* Opt-in OpenTelemetry instrumentation forwarded to the underlying Agent.
|
|
210
224
|
* Passing `{}` enables the loop's GenAI-semantic-convention spans. See
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import { type SecretEntry } from "./obfuscator.js";
|
|
2
|
+
/**
|
|
3
|
+
* Per-install secret key for the placeholder digest. Persisted under the agent
|
|
4
|
+
* config directory and never sent to a provider, so model-visible placeholders
|
|
5
|
+
* cannot be reversed by dictionary-hashing candidate secrets. Stable across
|
|
6
|
+
* sessions so persisted transcripts deobfuscate consistently. Defaults to
|
|
7
|
+
* `getAgentDir()` — the same directory `createAgentSession()` passes as
|
|
8
|
+
* `agentDir` — so a caller relying on the default reads/writes the identical
|
|
9
|
+
* key file live sessions use, per `~/.omp/agent/secret-placeholder.key` in
|
|
10
|
+
* docs/secrets.md.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getSecretPlaceholderKey(keyDir?: string): Promise<string>;
|
|
13
|
+
/** Return an existing placeholder key for redaction without creating a new key file. */
|
|
14
|
+
export declare function getExistingSecretPlaceholderKey(keyDir?: string): Promise<string | undefined>;
|
|
15
|
+
export { deobfuscateSessionContext, deobfuscateToolArguments, obfuscateMessages, obfuscateProviderContext, type SecretEntry, SecretObfuscator, secretEntriesNeedPlaceholderKey, secretEntryNeedsPlaceholderKey, } from "./obfuscator.js";
|
|
3
16
|
/**
|
|
4
17
|
* Load secrets from project-local and global secrets.yml files.
|
|
5
18
|
* Project-local entries override global entries with matching content.
|