@oh-my-pi/pi-coding-agent 17.1.8 → 17.2.0
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-vt8ene9g.md → CHANGELOG-be1f2t8h.md} +92 -0
- package/dist/cli.js +9986 -9776
- package/dist/{template-dys3vk5b.js → template-8vdv6xb4.js} +1 -1
- package/dist/types/advisor/runtime.d.ts +8 -2
- package/dist/types/advisor/transcript-recorder.d.ts +15 -0
- package/dist/types/auto-thinking/classifier.d.ts +9 -2
- package/dist/types/cli/args.d.ts +2 -0
- package/dist/types/cli/session-picker.d.ts +14 -7
- package/dist/types/collab/guest.d.ts +21 -2
- package/dist/types/commands/launch.d.ts +6 -0
- package/dist/types/config/settings-schema.d.ts +63 -8
- package/dist/types/cursor-bridge-tools.d.ts +54 -0
- package/dist/types/cursor.d.ts +193 -8
- package/dist/types/edit/edit-clipboard.d.ts +19 -0
- package/dist/types/edit/hashline/diff.d.ts +9 -1
- package/dist/types/edit/index.d.ts +8 -1
- package/dist/types/edit/streaming.d.ts +8 -1
- package/dist/types/extensibility/extensions/runner.d.ts +19 -2
- package/dist/types/extensibility/extensions/types.d.ts +25 -1
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +2 -0
- package/dist/types/internal-urls/local-protocol.d.ts +3 -2
- package/dist/types/launch/terminal-output-worker-client.d.ts +5 -0
- package/dist/types/launch/terminal-output-worker-protocol.d.ts +14 -0
- package/dist/types/launch/terminal-output-worker.d.ts +1 -0
- package/dist/types/lsp/client.d.ts +2 -0
- package/dist/types/main.d.ts +2 -0
- package/dist/types/mcp/manager.d.ts +33 -4
- package/dist/types/modes/components/codex-reset-fireworks.d.ts +51 -0
- package/dist/types/modes/components/read-tool-group.d.ts +12 -0
- package/dist/types/modes/components/session-selector.d.ts +6 -0
- package/dist/types/modes/components/status-line/component.d.ts +23 -0
- package/dist/types/modes/components/tool-execution.d.ts +16 -7
- package/dist/types/modes/components/usage-row.d.ts +2 -0
- package/dist/types/modes/controllers/mcp-command-controller.d.ts +26 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +2 -1
- package/dist/types/modes/interactive-mode.d.ts +4 -2
- package/dist/types/modes/rpc/rpc-client.d.ts +7 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +16 -0
- package/dist/types/modes/theme/theme.d.ts +12 -1
- package/dist/types/modes/types.d.ts +2 -1
- package/dist/types/sdk.d.ts +1 -0
- package/dist/types/session/agent-session-events.d.ts +2 -0
- package/dist/types/session/agent-session-types.d.ts +36 -1
- package/dist/types/session/agent-session.d.ts +4 -2
- package/dist/types/session/claude-session-store.d.ts +13 -0
- package/dist/types/session/codex-session-store.d.ts +14 -0
- package/dist/types/session/credential-pin.d.ts +58 -0
- package/dist/types/session/foreign-session-import.d.ts +15 -0
- package/dist/types/session/foreign-session-jsonl.d.ts +9 -0
- package/dist/types/session/foreign-session-store.d.ts +23 -0
- package/dist/types/session/session-advisors.d.ts +47 -2
- package/dist/types/session/session-entries.d.ts +19 -1
- package/dist/types/session/session-handoff.d.ts +4 -1
- package/dist/types/session/session-loader.d.ts +2 -0
- package/dist/types/session/session-maintenance.d.ts +1 -1
- package/dist/types/session/session-manager.d.ts +21 -0
- package/dist/types/session/session-tools.d.ts +25 -1
- package/dist/types/session/turn-recovery.d.ts +10 -4
- package/dist/types/system-prompt.d.ts +2 -1
- package/dist/types/task/executor.d.ts +11 -2
- package/dist/types/task/render.d.ts +7 -0
- package/dist/types/thinking.d.ts +18 -6
- package/dist/types/tools/acp-bridge.d.ts +28 -5
- package/dist/types/tools/grep.d.ts +17 -1
- package/dist/types/tools/hub/launch.d.ts +5 -1
- package/dist/types/tools/index.d.ts +4 -1
- package/dist/types/tools/path-utils.d.ts +19 -0
- package/dist/types/tools/read.d.ts +2 -0
- package/dist/types/tools/xdev.d.ts +2 -1
- package/dist/types/utils/changelog.d.ts +19 -0
- package/dist/types/utils/git.d.ts +10 -0
- package/dist/types/utils/jj.d.ts +11 -4
- package/dist/types/web/search/types.d.ts +2 -2
- package/package.json +12 -12
- package/src/advisor/runtime.ts +138 -12
- package/src/advisor/transcript-recorder.ts +56 -0
- package/src/auto-thinking/classifier.ts +48 -10
- package/src/cli/args.ts +6 -0
- package/src/cli/flag-tables.ts +2 -0
- package/src/cli/gallery-fixtures/fs.ts +25 -0
- package/src/cli/session-picker.ts +34 -17
- package/src/cli/ttsr-cli.ts +19 -1
- package/src/cli.ts +9 -0
- package/src/collab/guest.ts +37 -4
- package/src/collab/host.ts +1 -0
- package/src/commands/launch.ts +6 -0
- package/src/config/model-registry.ts +103 -25
- package/src/config/settings-schema.ts +65 -6
- package/src/config/settings.ts +25 -0
- package/src/cursor-bridge-tools.ts +81 -0
- package/src/cursor.ts +463 -12
- package/src/edit/edit-clipboard.ts +23 -0
- package/src/edit/hashline/diff.ts +49 -10
- package/src/edit/hashline/execute.ts +38 -6
- package/src/edit/hashline/filesystem.ts +27 -3
- package/src/edit/index.ts +12 -2
- package/src/edit/renderer.ts +4 -4
- package/src/edit/streaming.ts +17 -2
- package/src/export/html/template.js +1 -1
- package/src/extensibility/extensions/runner.ts +70 -0
- package/src/extensibility/extensions/types.ts +30 -0
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +12 -13
- package/src/internal-urls/local-protocol.ts +3 -2
- package/src/internal-urls/mcp-protocol.ts +4 -1
- package/src/launch/terminal-output-worker-client.ts +53 -0
- package/src/launch/terminal-output-worker-protocol.ts +11 -0
- package/src/launch/terminal-output-worker.ts +23 -0
- package/src/lsp/client.ts +18 -3
- package/src/lsp/index.ts +4 -0
- package/src/lsp/render.ts +1 -1
- package/src/main.ts +127 -56
- package/src/mcp/manager.ts +120 -18
- package/src/modes/acp/acp-agent.ts +15 -9
- package/src/modes/components/chat-transcript-builder.ts +30 -11
- package/src/modes/components/codex-reset-fireworks.ts +369 -0
- package/src/modes/components/read-tool-group.ts +159 -17
- package/src/modes/components/session-selector.ts +19 -3
- package/src/modes/components/status-line/component.ts +381 -54
- package/src/modes/components/tool-execution.ts +78 -31
- package/src/modes/components/usage-row.ts +10 -5
- package/src/modes/controllers/event-controller.ts +26 -4
- package/src/modes/controllers/mcp-command-controller.ts +68 -3
- package/src/modes/controllers/selector-controller.ts +94 -36
- package/src/modes/controllers/tan-command-controller.ts +14 -0
- package/src/modes/interactive-mode.ts +31 -17
- package/src/modes/rpc/rpc-client.ts +18 -0
- package/src/modes/rpc/rpc-mode.ts +16 -1
- package/src/modes/rpc/rpc-types.ts +11 -0
- package/src/modes/theme/theme.ts +151 -6
- package/src/modes/types.ts +2 -1
- package/src/modes/utils/ui-helpers.ts +38 -21
- package/src/prompts/system/auto-thinking-difficulty.md +4 -2
- package/src/prompts/system/plan-mode-active.md +2 -2
- package/src/prompts/system/system-prompt.md +3 -0
- package/src/prompts/system/xdev-mount-notice.md +1 -1
- package/src/prompts/tools/bash.md +15 -17
- package/src/prompts/tools/checkpoint.md +1 -1
- package/src/prompts/tools/glob.md +7 -6
- package/src/prompts/tools/grep.md +7 -6
- package/src/sdk.ts +178 -15
- package/src/session/agent-session-events.ts +1 -0
- package/src/session/agent-session-types.ts +40 -1
- package/src/session/agent-session.ts +302 -175
- package/src/session/claude-session-store.ts +426 -0
- package/src/session/codex-session-store.ts +673 -0
- package/src/session/credential-pin.ts +93 -0
- package/src/session/foreign-session-import.ts +52 -0
- package/src/session/foreign-session-jsonl.ts +29 -0
- package/src/session/foreign-session-store.ts +26 -0
- package/src/session/model-controls.ts +11 -3
- package/src/session/session-advisors.ts +140 -16
- package/src/session/session-entries.ts +21 -1
- package/src/session/session-handoff.ts +20 -3
- package/src/session/session-loader.ts +25 -9
- package/src/session/session-maintenance.ts +59 -11
- package/src/session/session-manager.ts +61 -0
- package/src/session/session-tools.ts +107 -5
- package/src/session/settings-stream-fn.ts +1 -0
- package/src/session/turn-recovery.ts +97 -51
- package/src/slash-commands/builtin-registry.ts +131 -3
- package/src/system-prompt.ts +3 -2
- package/src/task/executor.ts +17 -4
- package/src/task/render.ts +20 -4
- package/src/thinking.ts +29 -10
- package/src/tools/acp-bridge.ts +52 -8
- package/src/tools/browser.ts +5 -0
- package/src/tools/checkpoint.ts +0 -13
- package/src/tools/grep.ts +64 -8
- package/src/tools/hub/launch.ts +10 -15
- package/src/tools/index.ts +28 -4
- package/src/tools/path-utils.ts +88 -0
- package/src/tools/read.ts +3 -0
- package/src/tools/write.ts +9 -3
- package/src/tools/xdev.ts +39 -14
- package/src/utils/changelog.ts +144 -4
- package/src/utils/git.ts +61 -14
- package/src/utils/jj.ts +19 -13
- package/src/web/search/providers/codex.ts +34 -0
- package/src/web/search/types.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PatchSection, type SnapshotStore } from "@oh-my-pi/hashline";
|
|
1
|
+
import { type Clipboard, type PatchSection, type SnapshotStore } from "@oh-my-pi/hashline";
|
|
2
2
|
export interface HashlineDiffOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Use the streaming-tolerant applier ({@link PatchSection.applyPartialTo})
|
|
@@ -12,6 +12,14 @@ export interface HashlineDiffOptions {
|
|
|
12
12
|
* authoring input; the final apply path still validates through Patcher.
|
|
13
13
|
*/
|
|
14
14
|
skipHashValidation?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Clipboard register shared across the sections of one patch preview.
|
|
17
|
+
* `CUT` in an earlier section feeds `PASTE` in a later one, so the preview
|
|
18
|
+
* matches apply. Multi-section previews MUST thread one register through
|
|
19
|
+
* sections in patch order; omitted, each section gets a
|
|
20
|
+
* private register (same-file cut/paste still previews correctly).
|
|
21
|
+
*/
|
|
22
|
+
clipboard?: Clipboard;
|
|
15
23
|
}
|
|
16
24
|
export declare function computeHashlineSectionDiff(section: PatchSection, cwd: string, snapshots: SnapshotStore, options?: HashlineDiffOptions): Promise<{
|
|
17
25
|
diff: string;
|
|
@@ -33,7 +33,14 @@ export declare class EditTool implements AgentTool<TInput> {
|
|
|
33
33
|
readonly loadMode = "essential";
|
|
34
34
|
readonly concurrency = "exclusive";
|
|
35
35
|
readonly strict = true;
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* `mode` pins the edit variant for this instance, for callers whose protocol
|
|
38
|
+
* fixes the shape of an edit. The Cursor `pi_edit` frame carries
|
|
39
|
+
* `old_text`/`new_text` pairs, which only `replace` accepts — under the
|
|
40
|
+
* default `hashline` mode those args do not match the schema at all. Left
|
|
41
|
+
* unset, the env/settings resolution applies as before.
|
|
42
|
+
*/
|
|
43
|
+
constructor(session: ToolSession, mode?: EditMode);
|
|
37
44
|
get mode(): EditMode;
|
|
38
45
|
get description(): string;
|
|
39
46
|
get parameters(): TInput;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* The shared renderer / `ToolExecutionComponent` consult the strategy via
|
|
13
13
|
* the injected `editMode` rather than probing argument shape.
|
|
14
14
|
*/
|
|
15
|
-
import { type SnapshotStore } from "@oh-my-pi/hashline";
|
|
15
|
+
import { type Clipboard, type SnapshotStore } from "@oh-my-pi/hashline";
|
|
16
16
|
import type { Theme } from "../modes/theme/theme.js";
|
|
17
17
|
import { type EditMode, resolveEditMode } from "../utils/edit-mode.js";
|
|
18
18
|
export interface PerFileDiffPreview {
|
|
@@ -34,6 +34,13 @@ export interface StreamingDiffContext {
|
|
|
34
34
|
* not flicker in the preview.
|
|
35
35
|
*/
|
|
36
36
|
isStreaming?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Session-persistent clipboard register (`CUT`/`PASTE`). Previews
|
|
39
|
+
* fork it per frame — never mutating it — so a `PASTE` of content cut in
|
|
40
|
+
* an earlier edit call (or an earlier section of this patch) renders the
|
|
41
|
+
* real rows.
|
|
42
|
+
*/
|
|
43
|
+
clipboard?: Clipboard;
|
|
37
44
|
}
|
|
38
45
|
/**
|
|
39
46
|
* Per-file projection of a streamed edit payload. Pairs one target file path
|
|
@@ -8,9 +8,10 @@ import type { ModelRegistry } from "../../config/model-registry.js";
|
|
|
8
8
|
import type { Settings } from "../../config/settings.js";
|
|
9
9
|
import type { LocalProtocolOptions } from "../../internal-urls/local-protocol.js";
|
|
10
10
|
import type { MemoryRuntimeContext } from "../../memory-backend/index.js";
|
|
11
|
+
import type { AsyncJobSnapshot } from "../../session/agent-session.js";
|
|
11
12
|
import type { SessionManager } from "../../session/session-manager.js";
|
|
12
13
|
import type { BranchHandler, NavigateTreeHandler, NewSessionHandler } from "../session-handler-types.js";
|
|
13
|
-
import type { AfterProviderResponseEvent, AssistantThinkingRenderer, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, ContextEvent, Extension, ExtensionActions, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFlag, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, InputEvent, InputEventResult, MessageRenderer, RegisteredCommand, RegisteredTool, ResourcesDiscoverEvent, SessionBeforeBranchResult, SessionBeforeCompactResult, SessionBeforeSwitchResult, SessionBeforeTreeResult, SessionCompactingResult, SessionStopEvent, SessionStopEventResult, ToolCallEvent, ToolCallEventResult, ToolResultEvent, ToolResultEventResult, UserBashEvent, UserBashEventResult, UserPythonEvent, UserPythonEventResult } from "./types.js";
|
|
14
|
+
import type { AfterProviderResponseEvent, AssistantThinkingRenderer, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, ContextEvent, Extension, ExtensionActions, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFlag, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, InputEvent, InputEventResult, McpNotificationEvent, MessageRenderer, RegisteredCommand, RegisteredTool, ResourcesDiscoverEvent, SessionBeforeBranchResult, SessionBeforeCompactResult, SessionBeforeSwitchResult, SessionBeforeTreeResult, SessionCompactingResult, SessionStopEvent, SessionStopEventResult, ToolCallEvent, ToolCallEventResult, ToolResultEvent, ToolResultEventResult, UserBashEvent, UserBashEventResult, UserPythonEvent, UserPythonEventResult } from "./types.js";
|
|
14
15
|
/** Combined result from all before_agent_start handlers */
|
|
15
16
|
interface BeforeAgentStartCombinedResult {
|
|
16
17
|
messages?: NonNullable<BeforeAgentStartEventResult["message"]>[];
|
|
@@ -73,7 +74,7 @@ export declare class ExtensionRunner {
|
|
|
73
74
|
markToolCallEmitted(toolCallId: string, toolName: string): void;
|
|
74
75
|
/** Consumes a {@link markToolCallEmitted} marker; true when the loop already emitted. */
|
|
75
76
|
consumeToolCallEmitted(toolCallId: string, toolName: string): boolean;
|
|
76
|
-
constructor(extensions: Extension[], runtime: ExtensionRuntime, cwd: string, sessionManager: SessionManager, modelRegistry: ModelRegistry, getMemory?: () => MemoryRuntimeContext | undefined, settings?: Settings | undefined, localProtocolOptions?: LocalProtocolOptions | undefined);
|
|
77
|
+
constructor(extensions: Extension[], runtime: ExtensionRuntime, cwd: string, sessionManager: SessionManager, modelRegistry: ModelRegistry, getMemory?: () => MemoryRuntimeContext | undefined, settings?: Settings | undefined, localProtocolOptions?: LocalProtocolOptions | undefined, getAsyncJobSnapshot?: () => AsyncJobSnapshot | null);
|
|
77
78
|
initialize(actions: ExtensionActions, contextActions: ExtensionContextActions, commandContextActions?: ExtensionCommandContextActions, uiContext?: ExtensionUIContext): void;
|
|
78
79
|
/**
|
|
79
80
|
* Forward a `credential_disabled` event from `AuthStorage` to extension handlers.
|
|
@@ -90,6 +91,22 @@ export declare class ExtensionRunner {
|
|
|
90
91
|
* {@link onError} via {@link emit}'s normal isolation.
|
|
91
92
|
*/
|
|
92
93
|
emitCredentialDisabled(event: CredentialDisabledEvent): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Forward an MCP server notification to extension handlers.
|
|
96
|
+
*
|
|
97
|
+
* If {@link initialize} has not yet run, the notification is buffered and replayed
|
|
98
|
+
* once initialize wires the runtime/UI context. Matches the credential-disabled
|
|
99
|
+
* deferral above: the sdk.ts bridge registers `MCPManager.addNotificationListener`
|
|
100
|
+
* inside `createAgentSession` — BEFORE the mode controller calls `initialize()` on
|
|
101
|
+
* this runner — so notification frames drained by the manager (either fresh
|
|
102
|
+
* arrivals or replay from its own startup buffer) can reach us pre-init. Without
|
|
103
|
+
* this buffer they would evaporate for a second time here.
|
|
104
|
+
*
|
|
105
|
+
* Bounded at {@link MAX_PENDING_MCP_NOTIFICATIONS}; oldest entries drop under
|
|
106
|
+
* pressure. Never throws; per-handler errors are routed through {@link onError}
|
|
107
|
+
* via {@link emit}'s normal isolation.
|
|
108
|
+
*/
|
|
109
|
+
emitMcpNotification(event: Omit<McpNotificationEvent, "type">): Promise<void>;
|
|
93
110
|
/** Emits a session stop pass that can be cancelled with the active settle signal. */
|
|
94
111
|
emitSessionStop(event: Omit<SessionStopEvent, "type">): Promise<SessionStopEventResult | undefined>;
|
|
95
112
|
getUIContext(): ExtensionUIContext;
|
|
@@ -26,6 +26,7 @@ import type { LocalProtocolOptions } from "../../internal-urls/local-protocol.js
|
|
|
26
26
|
import type { MemoryRuntimeContext } from "../../memory-backend/index.js";
|
|
27
27
|
import type { CustomEditor } from "../../modes/components/custom-editor.js";
|
|
28
28
|
import type { Theme } from "../../modes/theme/theme.js";
|
|
29
|
+
import type { AsyncJobSnapshot } from "../../session/agent-session.js";
|
|
29
30
|
import type { CompactMode } from "../../session/compact-modes.js";
|
|
30
31
|
import type { CustomMessage, CustomMessagePayload } from "../../session/messages.js";
|
|
31
32
|
import type { ReadonlySessionManager, SessionManager } from "../../session/session-manager.js";
|
|
@@ -276,6 +277,8 @@ export interface ExtensionContext {
|
|
|
276
277
|
ui: ExtensionUIContext;
|
|
277
278
|
/** Get current context usage for the active model. */
|
|
278
279
|
getContextUsage(): ContextUsage | undefined;
|
|
280
|
+
/** Get a read-only snapshot of async jobs owned by this session. */
|
|
281
|
+
getAsyncJobSnapshot(): AsyncJobSnapshot | null;
|
|
279
282
|
/** Compact the session context (interactive mode shows UI). */
|
|
280
283
|
compact(instructionsOrOptions?: string | CompactOptions): Promise<void>;
|
|
281
284
|
/** Whether UI is available (false in print/RPC mode) */
|
|
@@ -494,6 +497,26 @@ export interface CredentialDisabledEvent {
|
|
|
494
497
|
/** Verbatim error captured for forensics (truncated upstream). */
|
|
495
498
|
disabledCause: string;
|
|
496
499
|
}
|
|
500
|
+
/**
|
|
501
|
+
* Fired for every JSON-RPC notification received from a connected MCP server,
|
|
502
|
+
* AFTER the runtime's own handling of known list/update methods. Unknown or
|
|
503
|
+
* server-custom methods are delivered too — extensions can bridge them into
|
|
504
|
+
* session behavior by inspecting `method`/`params` and injecting a follow-up
|
|
505
|
+
* via `pi.sendMessage(..., { deliverAs })` or `pi.sendUserMessage(...)`.
|
|
506
|
+
*/
|
|
507
|
+
export interface McpNotificationEvent {
|
|
508
|
+
type: "mcp_notification";
|
|
509
|
+
/**
|
|
510
|
+
* Server name as declared in the MCP config (raw, unsanitized). Note this
|
|
511
|
+
* differs from the sanitized prefix used in `mcp__<sanitized_server>_<tool>`
|
|
512
|
+
* tool names — filter by this raw name, not by tool-name prefix matching.
|
|
513
|
+
*/
|
|
514
|
+
server: string;
|
|
515
|
+
/** JSON-RPC method (e.g. `notifications/tools/list_changed`, or server-custom). */
|
|
516
|
+
method: string;
|
|
517
|
+
/** JSON-RPC params, opaque to the runtime. */
|
|
518
|
+
params: unknown;
|
|
519
|
+
}
|
|
497
520
|
/** Fired when user executes a bash command via ! or !! prefix */
|
|
498
521
|
export interface UserBashEvent {
|
|
499
522
|
type: "user_bash";
|
|
@@ -639,7 +662,7 @@ export declare function isToolCallEventType<TName extends string, TInput extends
|
|
|
639
662
|
input: TInput;
|
|
640
663
|
};
|
|
641
664
|
/** Union of all event types */
|
|
642
|
-
export type ExtensionEvent = ResourcesDiscoverEvent | SessionEvent | ContextEvent | BeforeProviderRequestEvent | AfterProviderResponseEvent | BeforeAgentStartEvent | AgentStartEvent | AgentEndEvent | SessionStopEvent | TurnStartEvent | TurnEndEvent | MessageStartEvent | MessageUpdateEvent | MessageEndEvent | ToolExecutionStartEvent | ToolExecutionUpdateEvent | ToolExecutionEndEvent | AutoCompactionStartEvent | AutoCompactionEndEvent | AutoRetryStartEvent | AutoRetryEndEvent | TtsrTriggeredEvent | TodoReminderEvent | GoalUpdatedEvent | CredentialDisabledEvent | UserBashEvent | UserPythonEvent | InputEvent | ToolCallEvent | ToolResultEvent | ToolApprovalRequestedEvent | ToolApprovalResolvedEvent;
|
|
665
|
+
export type ExtensionEvent = ResourcesDiscoverEvent | SessionEvent | ContextEvent | BeforeProviderRequestEvent | AfterProviderResponseEvent | BeforeAgentStartEvent | AgentStartEvent | AgentEndEvent | SessionStopEvent | TurnStartEvent | TurnEndEvent | MessageStartEvent | MessageUpdateEvent | MessageEndEvent | ToolExecutionStartEvent | ToolExecutionUpdateEvent | ToolExecutionEndEvent | AutoCompactionStartEvent | AutoCompactionEndEvent | AutoRetryStartEvent | AutoRetryEndEvent | TtsrTriggeredEvent | TodoReminderEvent | GoalUpdatedEvent | CredentialDisabledEvent | McpNotificationEvent | UserBashEvent | UserPythonEvent | InputEvent | ToolCallEvent | ToolResultEvent | ToolApprovalRequestedEvent | ToolApprovalResolvedEvent;
|
|
643
666
|
export interface ContextEventResult {
|
|
644
667
|
messages?: AgentMessage[];
|
|
645
668
|
}
|
|
@@ -748,6 +771,7 @@ export interface ExtensionAPI {
|
|
|
748
771
|
on(event: "tool_result", handler: ExtensionHandler<ToolResultEvent, ToolResultEventResult>): void;
|
|
749
772
|
on(event: "user_bash", handler: ExtensionHandler<UserBashEvent, UserBashEventResult>): void;
|
|
750
773
|
on(event: "user_python", handler: ExtensionHandler<UserPythonEvent, UserPythonEventResult>): void;
|
|
774
|
+
on(event: "mcp_notification", handler: ExtensionHandler<McpNotificationEvent>): void;
|
|
751
775
|
/** Register a tool that the LLM can call. */
|
|
752
776
|
registerTool<TParams extends TSchema = TSchema, TDetails = unknown>(tool: ToolDefinition<TParams, TDetails>): void;
|
|
753
777
|
/** Register a custom command. */
|
|
@@ -376,6 +376,8 @@ export { getProjectDir } from "@oh-my-pi/pi-utils";
|
|
|
376
376
|
*/
|
|
377
377
|
export declare function getPackageDir(): string;
|
|
378
378
|
export { estimateTokens } from "@oh-my-pi/pi-agent-core/compaction";
|
|
379
|
+
export { CONFIG_DIR_NAME } from "@oh-my-pi/pi-utils";
|
|
380
|
+
export { parseArgs } from "../cli/args.js";
|
|
379
381
|
export * from "../index.js";
|
|
380
382
|
export { formatBytes as formatSize } from "../tools/render-utils.js";
|
|
381
383
|
export { copyToClipboard } from "../utils/clipboard.js";
|
|
@@ -47,8 +47,9 @@ export declare class LocalProtocolHandler implements ProtocolHandler {
|
|
|
47
47
|
readonly immutable = false;
|
|
48
48
|
/**
|
|
49
49
|
* Install a process-global override that wins over the AgentRegistry-based
|
|
50
|
-
* derivation. Used by SDK consumers that wire
|
|
51
|
-
* `
|
|
50
|
+
* derivation. Used by top-level SDK consumers that wire
|
|
51
|
+
* `localProtocolOptions` on `createAgentSession`; subagents keep their
|
|
52
|
+
* inherited mapping session-bound.
|
|
52
53
|
*/
|
|
53
54
|
static setOverride(value: LocalProtocolOptions | undefined): void;
|
|
54
55
|
/** Reset the process-global override. Test-only. */
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TerminalOutputOptions } from "./terminal-output.js";
|
|
2
|
+
/** Replay legacy broker PTY bytes without evaluating xterm in the client process. */
|
|
3
|
+
export declare function renderTerminalOutputIsolated(output: string, options: TerminalOutputOptions): Promise<string[] | undefined>;
|
|
4
|
+
/** Distribution smoke for source, npm-bundle, and compiled worker routing. */
|
|
5
|
+
export declare function smokeTestTerminalOutputWorker(): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TerminalOutputOptions } from "./terminal-output.js";
|
|
2
|
+
/** Hidden CLI selector for legacy PTY replay outside the client process. */
|
|
3
|
+
export declare const TERMINAL_OUTPUT_WORKER_ARG = "__omp_worker_terminal_output";
|
|
4
|
+
export interface TerminalOutputWorkerRequest {
|
|
5
|
+
output: string;
|
|
6
|
+
options: TerminalOutputOptions;
|
|
7
|
+
}
|
|
8
|
+
export type TerminalOutputWorkerResult = {
|
|
9
|
+
ok: true;
|
|
10
|
+
rows: string[] | undefined;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -19,6 +19,8 @@ export interface WatchedFileChange {
|
|
|
19
19
|
export declare function supportsDocumentDiagnostics(client: LspClient): boolean;
|
|
20
20
|
/** Timeout for warmup initialize requests (5 seconds) */
|
|
21
21
|
export declare const WARMUP_TIMEOUT_MS = 5000;
|
|
22
|
+
/** Allow an explicit user reload to retry a matching initialization failure immediately. */
|
|
23
|
+
export declare function clearInitializationFailure(config: ServerConfig, cwd: string): void;
|
|
22
24
|
/**
|
|
23
25
|
* Get or create an LSP client for the given server configuration and working directory.
|
|
24
26
|
* @param config - Server configuration
|
package/dist/types/main.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { SubmittedUserInput } from "./modes/types.js";
|
|
|
8
8
|
import { type CreateAgentSessionOptions, type CreateAgentSessionResult, createAgentSession, discoverAuthStorage } from "./sdk.js";
|
|
9
9
|
import type { AgentSession } from "./session/agent-session.js";
|
|
10
10
|
import type { AuthStorage } from "./session/auth-storage.js";
|
|
11
|
+
import type { ForeignSessionSource, ForeignSessionStore } from "./session/foreign-session-store.js";
|
|
11
12
|
import { type SessionInfo } from "./session/session-listing.js";
|
|
12
13
|
import { SessionManager } from "./session/session-manager.js";
|
|
13
14
|
type RunAcpMode = (createSession: AcpSessionFactory) => Promise<never>;
|
|
@@ -65,6 +66,7 @@ interface RunRootCommandDependencies {
|
|
|
65
66
|
discoverAuthStorage?: typeof discoverAuthStorage;
|
|
66
67
|
selectSession?: typeof selectSession;
|
|
67
68
|
runAcpMode?: RunAcpMode;
|
|
69
|
+
createForeignSessionStore?: (source: ForeignSessionSource) => ForeignSessionStore;
|
|
68
70
|
settings?: Settings;
|
|
69
71
|
forceSetupWizard?: boolean;
|
|
70
72
|
}
|
|
@@ -61,13 +61,42 @@ export declare class MCPManager {
|
|
|
61
61
|
static resetForTests(): void;
|
|
62
62
|
constructor(cwd: string, toolCache?: MCPToolCache | null);
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
64
|
+
* Register a listener for server-initiated MCP notifications.
|
|
65
|
+
*
|
|
66
|
+
* The listener is called for every JSON-RPC notification received from any
|
|
67
|
+
* connected server, AFTER the manager's own handling of known methods
|
|
68
|
+
* (`notifications/tools/list_changed`, `notifications/resources/list_changed`,
|
|
69
|
+
* `notifications/resources/updated`, `notifications/prompts/list_changed`).
|
|
70
|
+
* For list-change methods the internal refresh promise is awaited before
|
|
71
|
+
* fanout, so listeners observe up-to-date manager and tool state. Unknown
|
|
72
|
+
* or server-custom methods are also delivered, letting consumers bridge
|
|
73
|
+
* server-initiated events into session-level behavior (e.g. an extension
|
|
74
|
+
* injecting a steer via `pi.sendMessage`).
|
|
75
|
+
*
|
|
76
|
+
* Notifications received before any listener attached are buffered
|
|
77
|
+
* (bounded FIFO, cap {@link NOTIFICATION_BUFFER_CAP}, drop-oldest) and
|
|
78
|
+
* drained into the first subscriber — matches {@link setOnPromptsChanged}'s
|
|
79
|
+
* replay-on-attach and {@link IrcBus}'s mailbox semantics.
|
|
80
|
+
*
|
|
81
|
+
* Returns an unsubscribe function; call it to remove the listener.
|
|
82
|
+
*
|
|
83
|
+
* Multiple listeners are allowed; each is invoked with independent error
|
|
84
|
+
* isolation — a listener that throws does not prevent other listeners from
|
|
85
|
+
* firing.
|
|
65
86
|
*/
|
|
66
|
-
|
|
87
|
+
addNotificationListener(listener: (serverName: string, method: string, params: unknown) => void): () => void;
|
|
67
88
|
/**
|
|
68
89
|
* Set a callback to fire when any server's tools change.
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
*
|
|
91
|
+
* May return a Promise; if so, {@link refreshServerTools} awaits it so that
|
|
92
|
+
* downstream consumers (e.g. `mcp_notification` listeners for
|
|
93
|
+
* `notifications/tools/list_changed`) observe not just the manager's
|
|
94
|
+
* refreshed tool set but also any session-level rebind driven by the
|
|
95
|
+
* handler (`session.refreshMCPTools`). Other callsites (initial connect,
|
|
96
|
+
* disconnect, reconnect) invoke the handler synchronously — their downstream
|
|
97
|
+
* chains don't need to serialize on the rebind.
|
|
98
|
+
*/
|
|
99
|
+
setOnToolsChanged(handler: (tools: CustomTool<TSchema, MCPToolDetails>[]) => void | Promise<void>): void;
|
|
71
100
|
/**
|
|
72
101
|
* Set a callback to fire when any server's resources change.
|
|
73
102
|
*/
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type Component, type OverlayHandle, type OverlayOptions } from "@oh-my-pi/pi-tui";
|
|
2
|
+
/** The active Codex account fields retained between status refreshes. */
|
|
3
|
+
export interface CodexResetUsageSnapshot {
|
|
4
|
+
/** When this usage report was observed, if supplied by the provider. */
|
|
5
|
+
observedAt?: number;
|
|
6
|
+
/** Weekly usage, its quota identity, and its previously scheduled reset deadline. */
|
|
7
|
+
sevenDay?: {
|
|
8
|
+
percent: number;
|
|
9
|
+
resetsAt?: number;
|
|
10
|
+
tier?: string;
|
|
11
|
+
plan?: string;
|
|
12
|
+
};
|
|
13
|
+
savedResets?: number;
|
|
14
|
+
}
|
|
15
|
+
/** A detected Codex quota event that can trigger the fireworks presentation. */
|
|
16
|
+
export type CodexResetFireworksEvent = {
|
|
17
|
+
kind: "unscheduled-weekly-reset";
|
|
18
|
+
} | {
|
|
19
|
+
kind: "saved-reset-banked";
|
|
20
|
+
added: number;
|
|
21
|
+
available: number;
|
|
22
|
+
};
|
|
23
|
+
interface CodexResetFireworksHost {
|
|
24
|
+
ui: {
|
|
25
|
+
showOverlay(component: Component, options?: OverlayOptions): OverlayHandle;
|
|
26
|
+
setFocus(component: Component): void;
|
|
27
|
+
requestRender(): void;
|
|
28
|
+
readonly terminal: {
|
|
29
|
+
readonly rows: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Compare consecutive reports for one Codex account. A saved-reset grant takes
|
|
35
|
+
* precedence when both changes arrive in the same report. A verified decrease,
|
|
36
|
+
* or a prior positive balance becoming unavailable, suppresses the weekly event
|
|
37
|
+
* because the user may have redeemed a credit. Other weekly usage drops are
|
|
38
|
+
* celebrated only before the previously scheduled reset deadline.
|
|
39
|
+
*/
|
|
40
|
+
export declare function detectCodexResetFireworks(previous: CodexResetUsageSnapshot, current: CodexResetUsageSnapshot): CodexResetFireworksEvent | undefined;
|
|
41
|
+
/** Owns the at-most-one modal celebration lifecycle for an interactive session. */
|
|
42
|
+
export declare class CodexResetFireworksController {
|
|
43
|
+
#private;
|
|
44
|
+
private readonly host;
|
|
45
|
+
constructor(host: CodexResetFireworksHost);
|
|
46
|
+
/** Present a celebration unless another one already owns the modal overlay. */
|
|
47
|
+
show(event: CodexResetFireworksEvent): boolean;
|
|
48
|
+
/** Stop the active celebration and release its overlay, if present. */
|
|
49
|
+
dispose(): void;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AssistantMessage, Usage } from "@oh-my-pi/pi-ai";
|
|
1
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
2
3
|
import { Container } from "@oh-my-pi/pi-tui";
|
|
3
4
|
import type { ToolExecutionHandle } from "./tool-execution.js";
|
|
@@ -10,6 +11,12 @@ export declare function readArgsHaveTarget(args: unknown): boolean;
|
|
|
10
11
|
* they list devices/docs and read better in the compact grouped view.
|
|
11
12
|
*/
|
|
12
13
|
export declare function readArgsCollapseIntoGroup(args: unknown): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Return the collapsed read calls that can own a turn's usage row. Mixed-tool
|
|
16
|
+
* turns and visible content after a read keep the standalone row so request
|
|
17
|
+
* metrics retain their transcript ordering.
|
|
18
|
+
*/
|
|
19
|
+
export declare function groupedReadUsageCallIds(message: AssistantMessage): string[] | undefined;
|
|
13
20
|
type ReadRenderArgs = {
|
|
14
21
|
path?: string;
|
|
15
22
|
file_path?: string;
|
|
@@ -37,6 +44,11 @@ export declare class ReadToolGroupComponent extends Container implements ToolExe
|
|
|
37
44
|
details?: unknown;
|
|
38
45
|
isError?: boolean;
|
|
39
46
|
}, isPartial?: boolean, toolCallId?: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Nest one request's usage beneath the last visible read call from that
|
|
49
|
+
* request. Parallel reads share one row rather than duplicating request totals.
|
|
50
|
+
*/
|
|
51
|
+
attachUsage(toolCallIds: readonly string[], usage: Usage, durationMs?: number, ttftMs?: number, timestamp?: number): boolean;
|
|
40
52
|
setArgsComplete(_toolCallId?: string): void;
|
|
41
53
|
setExpanded(expanded: boolean): void;
|
|
42
54
|
getComponent(): Component;
|
|
@@ -63,6 +63,12 @@ export interface SessionSelectorOptions {
|
|
|
63
63
|
loadAllSessions?: () => Promise<SessionInfo[]>;
|
|
64
64
|
/** Preloaded all-projects list; cached so the first Tab toggle is instant. */
|
|
65
65
|
allSessions?: SessionInfo[];
|
|
66
|
+
/** Picker heading; defaults to "Resume Session". */
|
|
67
|
+
title?: string;
|
|
68
|
+
/** Fixed scope label, or false to omit the scope suffix. */
|
|
69
|
+
scopeLabel?: string | false;
|
|
70
|
+
/** Show each session's working directory in the list. */
|
|
71
|
+
showCwd?: boolean;
|
|
66
72
|
/**
|
|
67
73
|
* Reads the live terminal height so the visible window fits the viewport.
|
|
68
74
|
* Omitted only in tests; defaults to a conservative 24 rows.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Component } from "@oh-my-pi/pi-tui";
|
|
2
2
|
import type { AgentSession } from "../../../session/agent-session.js";
|
|
3
|
+
import { type CodexResetFireworksEvent } from "../codex-reset-fireworks.js";
|
|
3
4
|
import { type SegmentContext } from "./segments.js";
|
|
4
5
|
import type { CollabStatus, EffectiveStatusLineSettings, StatusLineSettings } from "./types.js";
|
|
5
6
|
export declare class StatusLineComponent implements Component {
|
|
@@ -73,10 +74,32 @@ export declare class StatusLineComponent implements Component {
|
|
|
73
74
|
*/
|
|
74
75
|
setVibeWorkerTokenRateProvider(provider: (() => number | null) | undefined): void;
|
|
75
76
|
setCollabStatus(status: CollabStatus | null): void;
|
|
77
|
+
/** Set the callback that presents detected Codex reset celebrations, or clear it with `undefined`. */
|
|
78
|
+
setCodexResetFireworksHandler(handler: ((event: CodexResetFireworksEvent) => void) | undefined): void;
|
|
76
79
|
setHookStatus(key: string, text: string | undefined): void;
|
|
77
80
|
watchBranch(onBranchChange: () => void): void;
|
|
78
81
|
dispose(): void;
|
|
79
82
|
invalidate(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Explicit Git/repository cache invalidation. Aborts any in-flight
|
|
85
|
+
* reftable HEAD/PR resolve, bumps the stale-result generation, and drops
|
|
86
|
+
* the branch/PR/jj caches so the next render refetches from disk. Called
|
|
87
|
+
* by the git watcher on a HEAD move and by {@link applyCwdChange} on a
|
|
88
|
+
* repo/cwd switch. Generic repaints use {@link invalidate} instead and
|
|
89
|
+
* must never reach this path.
|
|
90
|
+
*/
|
|
91
|
+
invalidateGitCaches(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Re-point the status line's VCS watcher and caches at a new cwd/repository.
|
|
94
|
+
* Atomically retires the old watcher/listeners, invalidates VCS caches and
|
|
95
|
+
* in-flight controllers, then runs watcher setup for the new cwd and requests
|
|
96
|
+
* a repaint. Called by {@link InteractiveMode.applyCwdChange} after the
|
|
97
|
+
* SessionManager's cwd has moved — the watcher ownership always follows the
|
|
98
|
+
* effective cwd/repo, so a stale watcher for the previous repo can never
|
|
99
|
+
* invalidate the new one. Generic repaints use {@link invalidate} and must
|
|
100
|
+
* never retire the watcher or abort a live resolve.
|
|
101
|
+
*/
|
|
102
|
+
applyCwdChange(): void;
|
|
80
103
|
/**
|
|
81
104
|
* Startup redraws only arm a short-delayed task; timeout releases the render
|
|
82
105
|
* cadence while a late successful fetch can still refresh the cached segment.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SnapshotStore } from "@oh-my-pi/hashline";
|
|
1
|
+
import type { Clipboard, SnapshotStore } from "@oh-my-pi/hashline";
|
|
2
2
|
import type { AgentTool } from "@oh-my-pi/pi-agent-core";
|
|
3
3
|
import { type Component, Container, type NativeScrollbackLiveRegion, type TUI } from "@oh-my-pi/pi-tui";
|
|
4
4
|
/**
|
|
@@ -8,6 +8,13 @@ import { type Component, Container, type NativeScrollbackLiveRegion, type TUI }
|
|
|
8
8
|
*/
|
|
9
9
|
export interface TranscriptLiveRegionProbe {
|
|
10
10
|
isBlockInLiveRegion(component: Component): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether none of the block's rows have entered native scrollback (see
|
|
13
|
+
* `TranscriptContainer.isBlockUncommitted`). Optional: standalone hosts
|
|
14
|
+
* without commit tracking omit it, and blocks treat their rows as
|
|
15
|
+
* uncommitted.
|
|
16
|
+
*/
|
|
17
|
+
isBlockUncommitted?(component: Component): boolean;
|
|
11
18
|
}
|
|
12
19
|
/** Minimal TUI surface ToolExecutionComponent uses to schedule repaints and share image budget. */
|
|
13
20
|
export interface ToolExecutionUi {
|
|
@@ -18,6 +25,8 @@ export interface ToolExecutionUi {
|
|
|
18
25
|
}
|
|
19
26
|
export interface ToolExecutionOptions {
|
|
20
27
|
snapshots?: SnapshotStore;
|
|
28
|
+
/** Session-persistent edit clipboard register, forked per preview frame. */
|
|
29
|
+
clipboard?: Clipboard;
|
|
21
30
|
showImages?: boolean;
|
|
22
31
|
editFuzzyThreshold?: number;
|
|
23
32
|
editAllowFuzzy?: boolean;
|
|
@@ -94,12 +103,12 @@ export declare class ToolExecutionComponent extends Container implements NativeS
|
|
|
94
103
|
getNativeScrollbackLiveRegionStart(): number | undefined;
|
|
95
104
|
/**
|
|
96
105
|
* Keeps in-flight TV-wall frames out of immutable native scrollback: the
|
|
97
|
-
* `vibe_wait` wall
|
|
98
|
-
* lists). Their frames replace each other rather
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
106
|
+
* `vibe_wait` wall, displaceable snapshots (`hub` waiting polls, `todo`
|
|
107
|
+
* lists), and live `task` calls. Their frames replace each other rather
|
|
108
|
+
* than append — task progress rows rewrite in place on every snapshot —
|
|
109
|
+
* so an unpinned commit records a per-tick frozen snapshot (and for
|
|
110
|
+
* displaceable blocks force-seals them, stacking the next poll below).
|
|
111
|
+
* The finalized frame commits exactly once when the pin lifts.
|
|
103
112
|
*/
|
|
104
113
|
isNativeScrollbackLiveRegionPinned(): boolean;
|
|
105
114
|
/**
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { Usage } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import { Container } from "@oh-my-pi/pi-tui";
|
|
3
|
+
/** Format the metrics shared by standalone usage blocks and compact tool groups. */
|
|
4
|
+
export declare function formatUsageRow(usage: Usage, durationMs?: number, ttftMs?: number, timestamp?: number): string;
|
|
3
5
|
export declare function createUsageRowBlock(usage: Usage, durationMs?: number, ttftMs?: number, timestamp?: number): Container;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component } from "@oh-my-pi/pi-tui";
|
|
2
|
-
import type { MCPAuthChallenge, MCPServerConfig } from "../../mcp/types.js";
|
|
2
|
+
import type { MCPAuthChallenge, MCPConfigFile, MCPServerConfig } from "../../mcp/types.js";
|
|
3
3
|
import type { InteractiveModeContext } from "../types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Renders the MCP OAuth fallback URL. Always shows the full authorization URL
|
|
@@ -34,6 +34,31 @@ export declare class MCPAuthorizationLinkPrompt implements Component {
|
|
|
34
34
|
export declare class MCPOAuthCancelledError extends Error {
|
|
35
35
|
constructor(message?: string);
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Collect the de-duplicated union of every MCP server name we know about:
|
|
39
|
+
* user config, project config, and any runtime-discovered servers not
|
|
40
|
+
* already present in either config (`ctx.mcpManager.getAllServerNames()`
|
|
41
|
+
* covers connections, pending connections, and discovered-but-not-yet-
|
|
42
|
+
* connected sources).
|
|
43
|
+
*
|
|
44
|
+
* `includeDisabledOnly` controls names found only in
|
|
45
|
+
* `userConfig.disabledServers`, while `includeDisabledConfigured` controls
|
|
46
|
+
* config entries whose `enabled` flag is false. Both default to true because
|
|
47
|
+
* callers such as `/mcp list` need the complete union. Autocomplete callers
|
|
48
|
+
* must disable the categories their target operation cannot accept.
|
|
49
|
+
*
|
|
50
|
+
* This is the single source of truth for "every known server name": both
|
|
51
|
+
* `MCPCommandController#handleList()` and the `/mcp` slash-command argument
|
|
52
|
+
* completer (server-name autocomplete for `enable`/`disable`/`test`/etc.)
|
|
53
|
+
* call this instead of re-deriving the union themselves.
|
|
54
|
+
*
|
|
55
|
+
* `preloaded` lets a caller that already read both config files (e.g.
|
|
56
|
+
* `#handleList()`) pass them in and skip the redundant re-read.
|
|
57
|
+
*/
|
|
58
|
+
export declare function collectMcpServerNames(ctx: InteractiveModeContext, preloaded?: {
|
|
59
|
+
userConfig: MCPConfigFile;
|
|
60
|
+
projectConfig: MCPConfigFile;
|
|
61
|
+
}, includeDisabledOnly?: boolean, includeDisabledConfigured?: boolean): Promise<string[]>;
|
|
37
62
|
export declare class MCPCommandController {
|
|
38
63
|
#private;
|
|
39
64
|
private ctx;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
2
2
|
import type { InteractiveModeContext } from "../../modes/types.js";
|
|
3
|
+
import type { ForeignSessionSource } from "../../session/foreign-session-store.js";
|
|
3
4
|
import type { SessionObserverRegistry } from "../session-observer-registry.js";
|
|
4
5
|
export declare class SelectorController {
|
|
5
6
|
#private;
|
|
@@ -49,7 +50,7 @@ export declare class SelectorController {
|
|
|
49
50
|
showUserMessageSelector(): void;
|
|
50
51
|
showCopySelector(): void;
|
|
51
52
|
showTreeSelector(): void;
|
|
52
|
-
showSessionSelector(): Promise<void>;
|
|
53
|
+
showSessionSelector(source?: ForeignSessionSource): Promise<void>;
|
|
53
54
|
handleResumeSession(sessionPath: string, options?: {
|
|
54
55
|
settingsFlushed?: boolean;
|
|
55
56
|
}): Promise<boolean>;
|
|
@@ -14,11 +14,13 @@ import type { MCPManager } from "../mcp/index.js";
|
|
|
14
14
|
import { type PlanApprovalDetails } from "../plan-mode/approved-plan.js";
|
|
15
15
|
import { type AgentSession } from "../session/agent-session.js";
|
|
16
16
|
import type { CompactMode } from "../session/compact-modes.js";
|
|
17
|
+
import type { ForeignSessionSource } from "../session/foreign-session-store.js";
|
|
17
18
|
import { HistoryStorage } from "../session/history-storage.js";
|
|
18
19
|
import type { SessionContext } from "../session/session-context.js";
|
|
19
20
|
import type { SessionManager } from "../session/session-manager.js";
|
|
20
21
|
import type { ShakeMode } from "../session/shake-types.js";
|
|
21
22
|
import type { LspStartupServerInfo } from "../tools/index.js";
|
|
23
|
+
import { type StartupChangelogSelection } from "../utils/changelog.js";
|
|
22
24
|
import type { EventBus } from "../utils/event-bus.js";
|
|
23
25
|
import type { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
24
26
|
import type { BashExecutionComponent } from "./components/bash-execution.js";
|
|
@@ -174,7 +176,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
174
176
|
focusParentSession(): Promise<void>;
|
|
175
177
|
unfocusSession(): Promise<void>;
|
|
176
178
|
clearTransientSessionUi(): void;
|
|
177
|
-
constructor(session: AgentSession, version: string,
|
|
179
|
+
constructor(session: AgentSession, version: string, startupChangelog?: StartupChangelogSelection | undefined, setToolUIContext?: (uiContext: ExtensionUIContext, hasUI: boolean) => void, lspServers?: LspStartupServerInfo[] | undefined, mcpManager?: MCPManager, eventBus?: EventBus);
|
|
178
180
|
playWelcomeIntro(): void;
|
|
179
181
|
init(options?: InteractiveModeInitOptions): Promise<void>;
|
|
180
182
|
/** Reload the title-generation system prompt override for the provided working
|
|
@@ -369,7 +371,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
369
371
|
showUserMessageSelector(): void;
|
|
370
372
|
showCopySelector(): void;
|
|
371
373
|
showTreeSelector(): void;
|
|
372
|
-
showSessionSelector(): void;
|
|
374
|
+
showSessionSelector(source?: ForeignSessionSource): void;
|
|
373
375
|
handleResumeSession(sessionPath: string): Promise<void>;
|
|
374
376
|
handleSessionDeleteCommand(): Promise<void>;
|
|
375
377
|
showOAuthSelector(mode: "login" | "logout", providerId?: string): Promise<void>;
|
|
@@ -135,6 +135,13 @@ export declare class RpcClient {
|
|
|
135
135
|
* Get current session state.
|
|
136
136
|
*/
|
|
137
137
|
getState(): Promise<RpcSessionState>;
|
|
138
|
+
/**
|
|
139
|
+
* Enable or disable fast mode for the active model family.
|
|
140
|
+
*/
|
|
141
|
+
setFastMode(enabled: boolean): Promise<{
|
|
142
|
+
enabled: boolean;
|
|
143
|
+
active: boolean;
|
|
144
|
+
}>;
|
|
138
145
|
/**
|
|
139
146
|
* Configure subagent frames emitted by the RPC server. Servers default to "off".
|
|
140
147
|
* "progress" emits lifecycle/progress frames; "events" additionally emits raw subagent session events.
|
|
@@ -50,6 +50,10 @@ export type RpcCommand = {
|
|
|
50
50
|
} | {
|
|
51
51
|
id?: string;
|
|
52
52
|
type: "get_state";
|
|
53
|
+
} | {
|
|
54
|
+
id?: string;
|
|
55
|
+
type: "set_fast_mode";
|
|
56
|
+
enabled: boolean;
|
|
53
57
|
} | {
|
|
54
58
|
id?: string;
|
|
55
59
|
type: "get_available_commands";
|
|
@@ -187,6 +191,9 @@ export interface RpcSessionState {
|
|
|
187
191
|
sessionId: string;
|
|
188
192
|
sessionName?: string;
|
|
189
193
|
autoCompactionEnabled: boolean;
|
|
194
|
+
fastModeEnabled: boolean;
|
|
195
|
+
fastModeActive: boolean;
|
|
196
|
+
tokensPerSecond: number | null;
|
|
190
197
|
messageCount: number;
|
|
191
198
|
queuedMessageCount: number;
|
|
192
199
|
todoPhases: TodoPhase[];
|
|
@@ -315,6 +322,15 @@ export type RpcResponse = {
|
|
|
315
322
|
command: "get_state";
|
|
316
323
|
success: true;
|
|
317
324
|
data: RpcSessionState;
|
|
325
|
+
} | {
|
|
326
|
+
id?: string;
|
|
327
|
+
type: "response";
|
|
328
|
+
command: "set_fast_mode";
|
|
329
|
+
success: true;
|
|
330
|
+
data: {
|
|
331
|
+
enabled: boolean;
|
|
332
|
+
active: boolean;
|
|
333
|
+
};
|
|
318
334
|
} | {
|
|
319
335
|
id?: string;
|
|
320
336
|
type: "response";
|