@oh-my-pi/pi-coding-agent 16.1.22 → 16.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 +99 -1
- package/dist/cli.js +4387 -4164
- package/dist/types/advisor/__tests__/emission-guard.test.d.ts +1 -0
- package/dist/types/advisor/emission-guard.d.ts +73 -0
- package/dist/types/advisor/index.d.ts +1 -0
- package/dist/types/advisor/runtime.d.ts +7 -0
- package/dist/types/advisor/watchdog.d.ts +2 -0
- package/dist/types/cli/flag-tables.d.ts +1 -0
- package/dist/types/cli/gallery-fixtures/search.d.ts +1 -1
- package/dist/types/cli/gc-cli.d.ts +58 -0
- package/dist/types/collab/display-name.d.ts +3 -0
- package/dist/types/collab/host.d.ts +0 -2
- package/dist/types/commands/gc.d.ts +37 -0
- package/dist/types/commands/worktree.d.ts +0 -3
- package/dist/types/config/inline-tool-descriptors-mode.d.ts +13 -0
- package/dist/types/config/model-discovery.d.ts +6 -1
- package/dist/types/config/model-registry.d.ts +6 -2
- package/dist/types/config/model-resolver.d.ts +12 -0
- package/dist/types/config/models-config-schema.d.ts +29 -2
- package/dist/types/config/models-config.d.ts +22 -1
- package/dist/types/config/settings-schema.d.ts +145 -21
- package/dist/types/config/settings.d.ts +13 -0
- package/dist/types/dap/config.d.ts +1 -1
- package/dist/types/edit/hashline/filesystem.d.ts +4 -2
- package/dist/types/edit/renderer.d.ts +4 -0
- package/dist/types/extensibility/extensions/types.d.ts +17 -17
- package/dist/types/extensibility/hooks/types.d.ts +10 -10
- package/dist/types/extensibility/plugins/marketplace/types.d.ts +1 -0
- package/dist/types/internal-urls/__tests__/ssh-protocol.test.d.ts +1 -0
- package/dist/types/internal-urls/index.d.ts +1 -0
- package/dist/types/internal-urls/registry-helpers.d.ts +2 -0
- package/dist/types/internal-urls/router.d.ts +1 -1
- package/dist/types/internal-urls/ssh-protocol.d.ts +10 -0
- package/dist/types/internal-urls/types.d.ts +19 -2
- package/dist/types/irc/bus.d.ts +6 -0
- package/dist/types/mcp/transports/stdio.d.ts +25 -1
- package/dist/types/modes/components/__tests__/move-overlay.test.d.ts +1 -0
- package/dist/types/modes/components/custom-editor.d.ts +7 -0
- package/dist/types/modes/components/move-overlay.d.ts +23 -0
- package/dist/types/modes/components/plugin-selector.d.ts +2 -1
- package/dist/types/modes/components/queue-mode-selector.d.ts +2 -1
- package/dist/types/modes/components/select-list-mouse-routing.d.ts +2 -0
- package/dist/types/modes/components/settings-defs.d.ts +4 -1
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/modes/components/show-images-selector.d.ts +2 -1
- package/dist/types/modes/components/status-line/component.d.ts +2 -0
- package/dist/types/modes/components/status-line/types.d.ts +2 -0
- package/dist/types/modes/components/theme-selector.d.ts +2 -1
- package/dist/types/modes/components/thinking-selector.d.ts +2 -1
- package/dist/types/modes/controllers/command-controller.d.ts +10 -1
- package/dist/types/modes/controllers/streaming-reveal.d.ts +6 -0
- package/dist/types/modes/interactive-mode.d.ts +10 -1
- package/dist/types/modes/internal-url-autocomplete.d.ts +1 -1
- package/dist/types/modes/running-subagent-badge.d.ts +6 -0
- package/dist/types/modes/theme/mermaid-rendering.test.d.ts +1 -0
- package/dist/types/modes/theme/theme.d.ts +2 -1
- package/dist/types/modes/types.d.ts +9 -1
- package/dist/types/sdk.d.ts +2 -2
- package/dist/types/session/agent-session.d.ts +2 -1
- package/dist/types/session/session-listing.d.ts +10 -1
- package/dist/types/session/session-manager.d.ts +13 -0
- package/dist/types/slash-commands/builtin-registry.d.ts +1 -1
- package/dist/types/ssh/__tests__/connection-manager-args.test.d.ts +1 -0
- package/dist/types/ssh/__tests__/file-transfer-posix-guard.test.d.ts +1 -0
- package/dist/types/ssh/connection-manager.d.ts +2 -0
- package/dist/types/ssh/file-transfer.d.ts +79 -0
- package/dist/types/ssh/utils.d.ts +6 -0
- package/dist/types/system-prompt.d.ts +5 -0
- package/dist/types/task/executor.d.ts +16 -0
- package/dist/types/tiny/text.d.ts +1 -1
- package/dist/types/tools/builtin-names.d.ts +5 -1
- package/dist/types/tools/{find.d.ts → glob.d.ts} +15 -15
- package/dist/types/tools/{search.d.ts → grep.d.ts} +14 -14
- package/dist/types/tools/index.d.ts +3 -3
- package/dist/types/tools/path-utils.d.ts +29 -0
- package/dist/types/tools/plan-mode-guard.d.ts +7 -0
- package/dist/types/tools/read.d.ts +2 -2
- package/dist/types/tools/render-utils.d.ts +8 -0
- package/dist/types/tools/renderers.d.ts +11 -0
- package/dist/types/tools/ssh.d.ts +2 -0
- package/dist/types/tools/todo.d.ts +0 -16
- package/dist/types/tools/write.d.ts +2 -2
- package/dist/types/utils/active-repo-context.d.ts +8 -0
- package/dist/types/utils/image-resize.d.ts +1 -0
- package/dist/types/utils/markit-cache.d.ts +23 -0
- package/dist/types/utils/markit.d.ts +5 -1
- package/dist/types/utils/prompt-path.d.ts +1 -0
- package/dist/types/web/search/providers/duckduckgo.d.ts +14 -0
- package/dist/types/web/search/providers/firecrawl.d.ts +28 -0
- package/dist/types/web/search/providers/tinyfish.d.ts +29 -0
- package/dist/types/web/search/providers/xai.d.ts +13 -0
- package/dist/types/web/search/types.d.ts +18 -2
- package/package.json +30 -15
- package/scripts/bench-guard.ts +1 -1
- package/scripts/build-binary.ts +9 -9
- package/scripts/bundle-dist.ts +2 -2
- package/src/advisor/__tests__/advisor.test.ts +40 -4
- package/src/advisor/__tests__/emission-guard.test.ts +147 -0
- package/src/advisor/advise-tool.ts +1 -1
- package/src/advisor/emission-guard.ts +172 -0
- package/src/advisor/index.ts +1 -0
- package/src/advisor/runtime.ts +11 -0
- package/src/advisor/watchdog.ts +12 -1
- package/src/cli/args.ts +5 -2
- package/src/cli/auth-broker-cli.ts +17 -0
- package/src/cli/config-cli.ts +4 -0
- package/src/cli/flag-tables.ts +7 -4
- package/src/cli/gallery-cli.ts +14 -2
- package/src/cli/gallery-fixtures/edit.ts +60 -0
- package/src/cli/gallery-fixtures/fs.ts +17 -17
- package/src/cli/gallery-fixtures/search.ts +4 -4
- package/src/cli/gc-cli.ts +939 -0
- package/src/cli/usage-cli.ts +20 -1
- package/src/cli/web-search-cli.ts +1 -1
- package/src/cli-commands.ts +1 -0
- package/src/collab/display-name.ts +13 -0
- package/src/collab/guest.ts +5 -1
- package/src/collab/host.ts +2 -13
- package/src/commands/gc.ts +46 -0
- package/src/commands/worktree.ts +6 -0
- package/src/config/inline-tool-descriptors-mode.ts +27 -0
- package/src/config/model-discovery.ts +77 -8
- package/src/config/model-registry.ts +89 -11
- package/src/config/model-resolver.ts +39 -1
- package/src/config/models-config-schema.ts +41 -5
- package/src/config/models-config.ts +4 -1
- package/src/config/settings-schema.ts +130 -27
- package/src/config/settings.ts +216 -7
- package/src/cursor.ts +1 -1
- package/src/dap/config.ts +152 -8
- package/src/dap/session.ts +1 -1
- package/src/discovery/helpers.ts +3 -1
- package/src/edit/hashline/diff.ts +14 -3
- package/src/edit/hashline/execute.ts +42 -6
- package/src/edit/hashline/filesystem.ts +49 -8
- package/src/edit/index.ts +1 -0
- package/src/edit/modes/patch.ts +11 -1
- package/src/edit/renderer.ts +140 -13
- package/src/eval/__tests__/agent-bridge.test.ts +101 -0
- package/src/eval/__tests__/julia-prelude.test.ts +18 -0
- package/src/eval/agent-bridge.ts +26 -3
- package/src/eval/jl/runner.jl +7 -1
- package/src/eval/js/tool-bridge.ts +2 -2
- package/src/export/html/index.ts +1 -1
- package/src/export/html/template.js +3 -1
- package/src/export/html/tool-views.generated.js +20 -20
- package/src/extensibility/extensions/types.ts +22 -22
- package/src/extensibility/hooks/types.ts +11 -11
- package/src/extensibility/plugins/legacy-pi-bundled-keys.ts +10 -3
- package/src/extensibility/plugins/legacy-pi-bundled-registry.ts +31 -10
- package/src/extensibility/plugins/marketplace/manager.ts +22 -0
- package/src/extensibility/plugins/marketplace/types.ts +1 -0
- package/src/internal-urls/__tests__/ssh-protocol.test.ts +331 -0
- package/src/internal-urls/docs-index.generated.txt +2 -2
- package/src/internal-urls/docs-index.ts +2 -3
- package/src/internal-urls/index.ts +1 -0
- package/src/internal-urls/registry-helpers.ts +19 -4
- package/src/internal-urls/router.ts +5 -3
- package/src/internal-urls/ssh-protocol.ts +367 -0
- package/src/internal-urls/types.ts +19 -2
- package/src/irc/bus.ts +11 -3
- package/src/lsp/index.ts +8 -1
- package/src/mcp/oauth-discovery.ts +20 -20
- package/src/mcp/tool-bridge.ts +32 -2
- package/src/mcp/transports/stdio.test.ts +20 -3
- package/src/mcp/transports/stdio.ts +45 -14
- package/src/memories/index.ts +1 -1
- package/src/modes/acp/acp-event-mapper.ts +2 -2
- package/src/modes/components/__tests__/move-overlay.test.ts +166 -0
- package/src/modes/components/agent-hub.ts +3 -0
- package/src/modes/components/agent-transcript-viewer.ts +9 -7
- package/src/modes/components/custom-editor.ts +90 -5
- package/src/modes/components/move-overlay.ts +282 -0
- package/src/modes/components/plan-review-overlay.ts +35 -35
- package/src/modes/components/plugin-selector.ts +6 -1
- package/src/modes/components/queue-mode-selector.ts +6 -1
- package/src/modes/components/select-list-mouse-routing.ts +35 -0
- package/src/modes/components/session-selector.ts +11 -10
- package/src/modes/components/settings-defs.ts +14 -1
- package/src/modes/components/settings-selector.ts +196 -29
- package/src/modes/components/show-images-selector.ts +6 -1
- package/src/modes/components/status-line/component.ts +108 -28
- package/src/modes/components/status-line/segments.ts +5 -1
- package/src/modes/components/status-line/types.ts +2 -0
- package/src/modes/components/theme-selector.ts +6 -1
- package/src/modes/components/thinking-selector.ts +6 -1
- package/src/modes/components/tool-execution.ts +25 -9
- package/src/modes/components/tree-selector.ts +5 -5
- package/src/modes/controllers/command-controller.ts +140 -47
- package/src/modes/controllers/event-controller.ts +59 -3
- package/src/modes/controllers/input-controller.ts +70 -4
- package/src/modes/controllers/selector-controller.ts +15 -2
- package/src/modes/controllers/streaming-reveal.ts +17 -0
- package/src/modes/controllers/tool-args-reveal.ts +1 -1
- package/src/modes/interactive-mode.ts +142 -59
- package/src/modes/internal-url-autocomplete.ts +17 -2
- package/src/modes/prompt-action-autocomplete.ts +3 -1
- package/src/modes/running-subagent-badge.ts +13 -0
- package/src/modes/setup-wizard/scenes/glyph.ts +2 -13
- package/src/modes/setup-wizard/scenes/providers.ts +2 -1
- package/src/modes/setup-wizard/scenes/theme.ts +6 -12
- package/src/modes/setup-wizard/scenes/web-search.ts +8 -13
- package/src/modes/setup-wizard/wizard-overlay.ts +6 -5
- package/src/modes/theme/mermaid-rendering.test.ts +53 -0
- package/src/modes/theme/theme.ts +42 -15
- package/src/modes/types.ts +9 -1
- package/src/modes/utils/interactive-context-helpers.ts +1 -1
- package/src/priority.json +15 -0
- package/src/prompts/advisor/active-repo-watchdog.md +6 -0
- package/src/prompts/advisor/system.md +21 -7
- package/src/prompts/agents/designer.md +1 -1
- package/src/prompts/agents/explore.md +1 -1
- package/src/prompts/agents/librarian.md +2 -2
- package/src/prompts/agents/plan.md +2 -2
- package/src/prompts/agents/reviewer.md +1 -1
- package/src/prompts/agents/task.md +2 -2
- package/src/prompts/system/active-repo-context.md +4 -0
- package/src/prompts/system/gemini-tool-call-reminder.md +9 -0
- package/src/prompts/system/plan-mode-active.md +12 -3
- package/src/prompts/system/project-prompt.md +2 -2
- package/src/prompts/system/system-prompt.md +8 -6
- package/src/prompts/tools/bash.md +2 -2
- package/src/prompts/tools/checkpoint.md +1 -1
- package/src/prompts/tools/{find.md → glob.md} +1 -1
- package/src/prompts/tools/{search.md → grep.md} +3 -3
- package/src/prompts/tools/read.md +4 -2
- package/src/sdk.ts +98 -29
- package/src/session/agent-session.ts +828 -191
- package/src/session/session-history-format.ts +2 -2
- package/src/session/session-listing.ts +35 -2
- package/src/session/session-manager.ts +46 -0
- package/src/slash-commands/builtin-registry.ts +158 -22
- package/src/slash-commands/helpers/usage-report.ts +23 -2
- package/src/ssh/__tests__/connection-manager-args.test.ts +69 -0
- package/src/ssh/__tests__/file-transfer-posix-guard.test.ts +68 -0
- package/src/ssh/connection-manager.ts +12 -15
- package/src/ssh/file-transfer.ts +209 -0
- package/src/ssh/utils.ts +24 -0
- package/src/system-prompt.ts +60 -28
- package/src/task/executor.ts +96 -36
- package/src/task/index.ts +3 -3
- package/src/task/render.ts +14 -13
- package/src/task/worktree.ts +38 -1
- package/src/tiny/text.ts +49 -4
- package/src/tiny/worker.ts +3 -3
- package/src/tools/acp-bridge.ts +6 -1
- package/src/tools/bash.ts +2 -2
- package/src/tools/builtin-names.ts +26 -2
- package/src/tools/{find.ts → glob.ts} +48 -42
- package/src/tools/{search.ts → grep.ts} +311 -129
- package/src/tools/index.ts +13 -14
- package/src/tools/irc.ts +6 -2
- package/src/tools/path-utils.ts +64 -1
- package/src/tools/plan-mode-guard.ts +26 -13
- package/src/tools/read.ts +35 -6
- package/src/tools/render-utils.ts +14 -0
- package/src/tools/renderers.ts +15 -4
- package/src/tools/ssh.ts +17 -2
- package/src/tools/todo.ts +4 -26
- package/src/tools/write.ts +25 -9
- package/src/utils/active-repo-context.ts +143 -0
- package/src/utils/edit-mode.ts +19 -2
- package/src/utils/image-resize.ts +88 -7
- package/src/utils/lang-from-path.ts +3 -3
- package/src/utils/markit-cache.ts +166 -0
- package/src/utils/markit.ts +86 -18
- package/src/utils/prompt-path.ts +3 -0
- package/src/utils/shell-snapshot.ts +1 -1
- package/src/utils/title-generator.ts +1 -1
- package/src/web/search/provider.ts +54 -34
- package/src/web/search/providers/duckduckgo.ts +140 -0
- package/src/web/search/providers/firecrawl.ts +144 -0
- package/src/web/search/providers/tinyfish.ts +159 -0
- package/src/web/search/providers/xai.ts +292 -0
- package/src/web/search/providers/zai.ts +142 -56
- package/src/web/search/types.ts +6 -2
|
@@ -5,15 +5,39 @@
|
|
|
5
5
|
* Messages are newline-delimited JSON.
|
|
6
6
|
*/
|
|
7
7
|
import type { MCPRequestOptions, MCPStdioServerConfig, MCPTransport } from "../../mcp/types";
|
|
8
|
-
/** Subprocess argv for
|
|
8
|
+
/** Subprocess argv and platform-derived spawn flags for an MCP stdio server. */
|
|
9
9
|
export interface StdioSpawnCommand {
|
|
10
10
|
cmd: string[];
|
|
11
|
+
/**
|
|
12
|
+
* Hide the Windows console window for the direct child.
|
|
13
|
+
*
|
|
14
|
+
* Windows uses this only when the OMP host has no console to share. When
|
|
15
|
+
* the host is running inside a terminal, `windowsHide: true` maps to
|
|
16
|
+
* `CREATE_NO_WINDOW`, which strips that inheritable console from hidden
|
|
17
|
+
* `cmd.exe` / PowerShell wrapper chains. Their console grandchildren then
|
|
18
|
+
* allocate fresh visible conhost windows during startup or reconnects
|
|
19
|
+
* (#3567).
|
|
20
|
+
*/
|
|
11
21
|
windowsHide?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Run the subprocess in its own session.
|
|
24
|
+
*
|
|
25
|
+
* POSIX: `true`. Detach → `setsid`, so the MCP process tree has no
|
|
26
|
+
* controlling terminal and terminal job-control signals (Ctrl+Z SIGTSTP,
|
|
27
|
+
* background-read SIGTTIN) cannot stop stdio servers such as
|
|
28
|
+
* `chrome-devtools-mcp` and leave our read loop blocked on silent pipes.
|
|
29
|
+
*
|
|
30
|
+
* Windows: `false`. There is no SIGTSTP/SIGTTIN to escape, and Windows
|
|
31
|
+
* wrapper chains must stay in the OMP console session so nested console
|
|
32
|
+
* grandchildren keep stdout routed through our pipe (#3544).
|
|
33
|
+
*/
|
|
34
|
+
detached: boolean;
|
|
12
35
|
}
|
|
13
36
|
/** Inputs used to resolve platform-specific stdio spawn behavior. */
|
|
14
37
|
export interface ResolveStdioSpawnOptions {
|
|
15
38
|
cwd: string;
|
|
16
39
|
env: Record<string, string | undefined>;
|
|
40
|
+
hostHasInheritableConsole?: boolean;
|
|
17
41
|
platform?: NodeJS.Platform;
|
|
18
42
|
}
|
|
19
43
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -28,6 +28,13 @@ export declare const SPACE_HOLD_RELEASE_MS = 250;
|
|
|
28
28
|
export declare function extractPastePathsFromText(text: string): string[] | undefined;
|
|
29
29
|
export declare function extractBracketedPastePaths(data: string): string[] | undefined;
|
|
30
30
|
export declare function extractBracketedImagePastePaths(data: string): string[] | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Same shape as {@link extractBracketedImagePastePaths} but operates on a
|
|
33
|
+
* payload that has already been stripped of the `\x1b[200~` / `\x1b[201~`
|
|
34
|
+
* markers — used by the assembled-paste router in {@link CustomEditor.handleInput}
|
|
35
|
+
* so split bracketed pastes get the same image-path detection as single-chunk ones.
|
|
36
|
+
*/
|
|
37
|
+
export declare function extractImagePastePathsFromText(text: string): string[] | undefined;
|
|
31
38
|
export declare function extractBracketedImagePastePath(data: string): string | undefined;
|
|
32
39
|
/**
|
|
33
40
|
* Return a single image file path when `text` is exactly one explicit path
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Component, type Focusable } from "@oh-my-pi/pi-tui";
|
|
2
|
+
export interface MoveOverlayResult {
|
|
3
|
+
directory: string;
|
|
4
|
+
}
|
|
5
|
+
/** Resolve a user-typed path (`~`, absolute, or relative to `cwd`) to an absolute path. */
|
|
6
|
+
export declare function resolveMovePath(input: string, cwd: string): string;
|
|
7
|
+
/** If `input` resolves to an existing directory, return it; otherwise `null`. */
|
|
8
|
+
export declare function resolveExistingDirectory(input: string, cwd: string): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Overlay component for `/move`: a single-line path input with a live-filtered
|
|
11
|
+
* list of matching directories. Tab accepts the highlighted suggestion; Enter
|
|
12
|
+
* confirms the current input (or the highlighted suggestion if the input is
|
|
13
|
+
* empty); Escape cancels.
|
|
14
|
+
*/
|
|
15
|
+
export declare class MoveOverlay implements Component, Focusable {
|
|
16
|
+
#private;
|
|
17
|
+
constructor(cwd: string, done: (result: MoveOverlayResult | undefined) => void);
|
|
18
|
+
get focused(): boolean;
|
|
19
|
+
set focused(value: boolean);
|
|
20
|
+
handleInput(data: string): void;
|
|
21
|
+
render(_width: number): readonly string[];
|
|
22
|
+
invalidate(): void;
|
|
23
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Shows available plugins from all configured marketplaces in a SelectList.
|
|
5
5
|
* Selecting a plugin triggers installation. Esc cancels.
|
|
6
6
|
*/
|
|
7
|
-
import { Container, SelectList } from "@oh-my-pi/pi-tui";
|
|
7
|
+
import { Container, SelectList, type SgrMouseEvent } from "@oh-my-pi/pi-tui";
|
|
8
8
|
export interface PluginSelectorCallbacks {
|
|
9
9
|
onSelect: (pluginName: string, marketplace: string, scope?: "user" | "project") => void;
|
|
10
10
|
onCancel: () => void;
|
|
@@ -23,4 +23,5 @@ export declare class PluginSelectorComponent extends Container {
|
|
|
23
23
|
#private;
|
|
24
24
|
constructor(marketplaceCount: number, plugins: PluginItem[], installedIds: Set<string>, callbacks: PluginSelectorCallbacks);
|
|
25
25
|
getSelectList(): SelectList;
|
|
26
|
+
routeMouse(event: SgrMouseEvent, line: number, col: number): void;
|
|
26
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Container, SelectList } from "@oh-my-pi/pi-tui";
|
|
1
|
+
import { Container, SelectList, type SgrMouseEvent } from "@oh-my-pi/pi-tui";
|
|
2
2
|
/**
|
|
3
3
|
* Component that renders a queue mode selector with borders
|
|
4
4
|
*/
|
|
@@ -6,4 +6,5 @@ export declare class QueueModeSelectorComponent extends Container {
|
|
|
6
6
|
#private;
|
|
7
7
|
constructor(currentMode: "all" | "one-at-a-time", onSelect: (mode: "all" | "one-at-a-time") => void, onCancel: () => void);
|
|
8
8
|
getSelectList(): SelectList;
|
|
9
|
+
routeMouse(event: SgrMouseEvent, line: number, col: number): void;
|
|
9
10
|
}
|
|
@@ -41,7 +41,10 @@ export interface SubmenuSettingDef extends BaseSettingDef {
|
|
|
41
41
|
export interface TextInputSettingDef extends BaseSettingDef {
|
|
42
42
|
type: "text";
|
|
43
43
|
}
|
|
44
|
-
export
|
|
44
|
+
export interface ProviderLimitsSettingDef extends BaseSettingDef {
|
|
45
|
+
type: "providerLimits";
|
|
46
|
+
}
|
|
47
|
+
export type SettingDef = BooleanSettingDef | EnumSettingDef | SubmenuSettingDef | TextInputSettingDef | ProviderLimitsSettingDef;
|
|
45
48
|
/** Get all setting definitions with UI */
|
|
46
49
|
export declare function getAllSettingDefs(): SettingDef[];
|
|
47
50
|
/**
|
|
@@ -15,6 +15,8 @@ export interface SettingsRuntimeContext {
|
|
|
15
15
|
thinkingLevel: ThinkingLevel | undefined;
|
|
16
16
|
/** Available themes */
|
|
17
17
|
availableThemes: string[];
|
|
18
|
+
/** Provider/source ids shown in /model. */
|
|
19
|
+
providers: string[];
|
|
18
20
|
/** Working directory for plugins tab */
|
|
19
21
|
cwd: string;
|
|
20
22
|
/** Active model (api + id); resolves what the snapcompact `auto` shape maps to. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Container, SelectList } from "@oh-my-pi/pi-tui";
|
|
1
|
+
import { Container, SelectList, type SgrMouseEvent } from "@oh-my-pi/pi-tui";
|
|
2
2
|
/**
|
|
3
3
|
* Component that renders a show images selector with borders
|
|
4
4
|
*/
|
|
@@ -6,4 +6,5 @@ export declare class ShowImagesSelectorComponent extends Container {
|
|
|
6
6
|
#private;
|
|
7
7
|
constructor(currentValue: boolean, onSelect: (show: boolean) => void, onCancel: () => void);
|
|
8
8
|
getSelectList(): SelectList;
|
|
9
|
+
routeMouse(event: SgrMouseEvent, line: number, col: number): void;
|
|
9
10
|
}
|
|
@@ -14,6 +14,8 @@ export declare class StatusLineComponent implements Component {
|
|
|
14
14
|
getEffectiveSettingsForTest(): EffectiveStatusLineSettings;
|
|
15
15
|
setAutoCompactEnabled(enabled: boolean): void;
|
|
16
16
|
setSubagentCount(count: number): void;
|
|
17
|
+
/** Hub key label shown in the forced running-subagents badge. */
|
|
18
|
+
setSubagentHubHint(hint: string | undefined): void;
|
|
17
19
|
/** Active subagent count as currently displayed (collab state mirroring). */
|
|
18
20
|
get subagentCount(): number;
|
|
19
21
|
setSessionStartTime(time: number): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CollabSessionState } from "../../../collab/protocol";
|
|
2
2
|
import type { StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle } from "../../../config/settings-schema";
|
|
3
3
|
import type { AgentSession } from "../../../session/agent-session";
|
|
4
|
+
import type { ActiveRepoContext } from "../../../utils/active-repo-context";
|
|
4
5
|
export type { StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle };
|
|
5
6
|
/** Collab session indicator + (guest-only) host-state override for segments. */
|
|
6
7
|
export interface CollabStatus {
|
|
@@ -47,6 +48,7 @@ export interface SegmentContext {
|
|
|
47
48
|
session: AgentSession;
|
|
48
49
|
/** Focused subagent id while the view is proxied at its session, undefined otherwise. */
|
|
49
50
|
focusedAgentId?: string | undefined;
|
|
51
|
+
activeRepo: ActiveRepoContext | null;
|
|
50
52
|
width: number;
|
|
51
53
|
options: StatusLineSegmentOptions;
|
|
52
54
|
planMode: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Container, SelectList } from "@oh-my-pi/pi-tui";
|
|
1
|
+
import { Container, SelectList, type SgrMouseEvent } from "@oh-my-pi/pi-tui";
|
|
2
2
|
/**
|
|
3
3
|
* Component that renders a theme selector.
|
|
4
4
|
* Themes must be pre-loaded and passed to the constructor.
|
|
@@ -7,4 +7,5 @@ export declare class ThemeSelectorComponent extends Container {
|
|
|
7
7
|
#private;
|
|
8
8
|
constructor(currentTheme: string, themes: string[], onSelect: (themeName: string) => void, onCancel: () => void, onPreview: (themeName: string) => void);
|
|
9
9
|
getSelectList(): SelectList;
|
|
10
|
+
routeMouse(event: SgrMouseEvent, line: number, col: number): void;
|
|
10
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Effort } from "@oh-my-pi/pi-ai";
|
|
2
|
-
import { Container, SelectList } from "@oh-my-pi/pi-tui";
|
|
2
|
+
import { Container, SelectList, type SgrMouseEvent } from "@oh-my-pi/pi-tui";
|
|
3
3
|
/**
|
|
4
4
|
* Component that renders a thinking level selector with borders
|
|
5
5
|
*/
|
|
@@ -7,4 +7,5 @@ export declare class ThinkingSelectorComponent extends Container {
|
|
|
7
7
|
#private;
|
|
8
8
|
constructor(currentLevel: Effort, availableLevels: Effort[], onSelect: (level: Effort) => void, onCancel: () => void);
|
|
9
9
|
getSelectList(): SelectList;
|
|
10
|
+
routeMouse(event: SgrMouseEvent, line: number, col: number): void;
|
|
10
11
|
}
|
|
@@ -29,7 +29,16 @@ export declare class CommandController {
|
|
|
29
29
|
handleFreshCommand(): Promise<void>;
|
|
30
30
|
handleDropCommand(): Promise<void>;
|
|
31
31
|
handleForkCommand(): Promise<void>;
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* `/move` — switch to a fresh empty session in a different directory.
|
|
34
|
+
*
|
|
35
|
+
* With no `targetPath` (TUI only), opens an autocomplete overlay so the user
|
|
36
|
+
* can pick or type a directory. With a `targetPath`, resolves it directly.
|
|
37
|
+
* If the target directory does not exist, the user is asked whether to create
|
|
38
|
+
* it. A brand-new empty session is then started in the target directory and
|
|
39
|
+
* the current session is left behind (resumable via `/resume`).
|
|
40
|
+
*/
|
|
41
|
+
handleMoveCommand(targetPath?: string): Promise<void>;
|
|
33
42
|
handleRenameCommand(title: string): Promise<void>;
|
|
34
43
|
handleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;
|
|
35
44
|
handlePythonCommand(code: string, excludeFromContext?: boolean): Promise<void>;
|
|
@@ -19,5 +19,11 @@ export declare class StreamingRevealController {
|
|
|
19
19
|
begin(component: StreamingRevealComponent, message: AssistantMessage): void;
|
|
20
20
|
setTarget(message: AssistantMessage): void;
|
|
21
21
|
stop(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Re-read cached visibility flags (hideThinkingBlock, proseOnlyThinking)
|
|
24
|
+
* and re-render the current target. Called when the thinking level changes
|
|
25
|
+
* mid-stream so the reveal controller doesn't keep rendering with stale values.
|
|
26
|
+
*/
|
|
27
|
+
resyncVisibility(): void;
|
|
22
28
|
}
|
|
23
29
|
export {};
|
|
@@ -109,6 +109,13 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
109
109
|
loopLimit: LoopLimitRuntime | undefined;
|
|
110
110
|
todoPhases: TodoPhase[];
|
|
111
111
|
hideThinkingBlock: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Effective thinking-block visibility: hidden when the user's setting is on
|
|
114
|
+
* OR the session thinking level is "off". Some providers (MiniMax, GLM,
|
|
115
|
+
* DeepSeek) return thinking blocks even with reasoning disabled; this
|
|
116
|
+
* respects the user's intent when they set thinking to "off" (#626).
|
|
117
|
+
*/
|
|
118
|
+
get effectiveHideThinkingBlock(): boolean;
|
|
112
119
|
proseOnlyThinking: boolean;
|
|
113
120
|
compactionQueuedMessages: CompactionQueuedMessage[];
|
|
114
121
|
pendingTools: Map<string, ToolExecutionHandle>;
|
|
@@ -198,6 +205,8 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
198
205
|
markPendingSubmissionStarted(input: SubmittedUserInput): boolean;
|
|
199
206
|
finishPendingSubmission(input: SubmittedUserInput): void;
|
|
200
207
|
updateEditorBorderColor(): void;
|
|
208
|
+
/** Refresh the running-subagents status badge from the active local or collab registry. */
|
|
209
|
+
syncRunningSubagentBadge(): void;
|
|
201
210
|
updateEditorTopBorder(): void;
|
|
202
211
|
rebuildChatFromMessages(): void;
|
|
203
212
|
/**
|
|
@@ -291,7 +300,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
291
300
|
handleFreshCommand(): Promise<void>;
|
|
292
301
|
handleDropCommand(): Promise<void>;
|
|
293
302
|
handleForkCommand(): Promise<void>;
|
|
294
|
-
handleMoveCommand(targetPath
|
|
303
|
+
handleMoveCommand(targetPath?: string): Promise<void>;
|
|
295
304
|
handleRenameCommand(title: string): Promise<void>;
|
|
296
305
|
handleMemoryCommand(text: string): Promise<void>;
|
|
297
306
|
handleSTTToggle(): Promise<void>;
|
|
@@ -25,7 +25,7 @@ export declare function extractInternalUrlContext(textBeforeCursor: string): Int
|
|
|
25
25
|
* Suggestions for the internal-url token ending at the cursor, or `null` when
|
|
26
26
|
* the text is not such a token or no candidate matches the typed query.
|
|
27
27
|
*/
|
|
28
|
-
export declare function getInternalUrlSuggestions(textBeforeCursor: string): Promise<{
|
|
28
|
+
export declare function getInternalUrlSuggestions(textBeforeCursor: string, cwd?: string): Promise<{
|
|
29
29
|
items: AutocompleteItem[];
|
|
30
30
|
prefix: string;
|
|
31
31
|
} | null>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AgentRegistry } from "../registry/agent-registry";
|
|
2
|
+
export interface RunningSubagentRegistrySource {
|
|
3
|
+
agentRegistry: AgentRegistry;
|
|
4
|
+
}
|
|
5
|
+
export declare function getRunningSubagentBadgeRegistry(collabGuest: RunningSubagentRegistrySource | undefined): AgentRegistry;
|
|
6
|
+
export declare function countRunningSubagentBadgeAgents(registry: AgentRegistry): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,7 +6,7 @@ export type SymbolPreset = "unicode" | "nerd" | "ascii";
|
|
|
6
6
|
/**
|
|
7
7
|
* All available symbol keys organized by category.
|
|
8
8
|
*/
|
|
9
|
-
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.inspectImage" | "tool.goal" | "tool.irc";
|
|
9
|
+
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.inspectImage" | "tool.goal" | "tool.irc" | "tool.delete" | "tool.move";
|
|
10
10
|
export type SpinnerType = "status" | "activity";
|
|
11
11
|
export type ThemeColor = "accent" | "border" | "borderAccent" | "borderMuted" | "success" | "error" | "warning" | "muted" | "dim" | "text" | "thinkingText" | "userMessageText" | "customMessageText" | "customMessageLabel" | "toolTitle" | "toolOutput" | "mdHeading" | "mdLink" | "mdLinkUrl" | "mdCode" | "mdCodeBlock" | "mdCodeBlockBorder" | "mdQuote" | "mdQuoteBorder" | "mdHr" | "mdListBullet" | "toolDiffAdded" | "toolDiffRemoved" | "toolDiffContext" | "syntaxComment" | "syntaxKeyword" | "syntaxFunction" | "syntaxVariable" | "syntaxString" | "syntaxNumber" | "syntaxType" | "syntaxOperator" | "syntaxPunctuation" | "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "bashMode" | "pythonMode" | "statusLineSep" | "statusLineModel" | "statusLinePath" | "statusLineGitClean" | "statusLineGitDirty" | "statusLineContext" | "statusLineSpend" | "statusLineStaged" | "statusLineDirty" | "statusLineUntracked" | "statusLineOutput" | "statusLineCost" | "statusLineSubagents";
|
|
12
12
|
/** Check if a string is a valid ThemeColor value */
|
|
@@ -347,6 +347,7 @@ export declare function getThemeExportColors(themeName?: string): Promise<{
|
|
|
347
347
|
*/
|
|
348
348
|
export declare function highlightCode(code: string, lang?: string, highlightTheme?: Theme): string[];
|
|
349
349
|
export declare function getSymbolTheme(): SymbolTheme;
|
|
350
|
+
export declare function setMarkdownMermaidRendering(enabled: boolean): void;
|
|
350
351
|
export declare function getMarkdownTheme(): MarkdownTheme;
|
|
351
352
|
export declare function getSelectListTheme(): SelectListTheme;
|
|
352
353
|
export declare function getEditorTheme(): EditorTheme;
|
|
@@ -140,6 +140,12 @@ export interface InteractiveModeContext {
|
|
|
140
140
|
loopLimit?: LoopLimitRuntime;
|
|
141
141
|
planModePlanFilePath?: string;
|
|
142
142
|
hideThinkingBlock: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Effective thinking-block visibility: true when hidden by user setting OR
|
|
145
|
+
* thinking level is "off". Read this in render paths instead of
|
|
146
|
+
* {@link hideThinkingBlock} so blocks are auto-hidden when thinking is off.
|
|
147
|
+
*/
|
|
148
|
+
readonly effectiveHideThinkingBlock: boolean;
|
|
143
149
|
proseOnlyThinking: boolean;
|
|
144
150
|
compactionQueuedMessages: CompactionQueuedMessage[];
|
|
145
151
|
pendingTools: Map<string, ToolExecutionHandle>;
|
|
@@ -269,6 +275,8 @@ export interface InteractiveModeContext {
|
|
|
269
275
|
findLastAssistantMessage(): AssistantMessage | undefined;
|
|
270
276
|
extractAssistantText(message: AssistantMessage): string;
|
|
271
277
|
updateEditorTopBorder(): void;
|
|
278
|
+
/** Refresh the running-subagents status badge from the active local or collab registry. */
|
|
279
|
+
syncRunningSubagentBadge(): void;
|
|
272
280
|
updateEditorBorderColor(): void;
|
|
273
281
|
rebuildChatFromMessages(): void;
|
|
274
282
|
setTodos(todos: TodoItem[] | TodoPhase[]): void;
|
|
@@ -299,7 +307,7 @@ export interface InteractiveModeContext {
|
|
|
299
307
|
handleCompactCommand(customInstructions?: string, mode?: CompactMode): Promise<CompactionOutcome>;
|
|
300
308
|
handleHandoffCommand(customInstructions?: string): Promise<void>;
|
|
301
309
|
handleShakeCommand(mode: ShakeMode): Promise<void>;
|
|
302
|
-
handleMoveCommand(targetPath
|
|
310
|
+
handleMoveCommand(targetPath?: string): Promise<void>;
|
|
303
311
|
handleRenameCommand(title: string): Promise<void>;
|
|
304
312
|
handleMemoryCommand(text: string): Promise<void>;
|
|
305
313
|
handleSTTToggle(): Promise<void>;
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ import type { AuthStorage } from "./session/auth-storage";
|
|
|
22
22
|
import { SessionManager } from "./session/session-manager";
|
|
23
23
|
import { type BuildSystemPromptResult } from "./system-prompt";
|
|
24
24
|
import { type ConfiguredThinkingLevel } from "./thinking";
|
|
25
|
-
import { BashTool, BUILTIN_TOOLS, createTools, EditTool, EvalTool,
|
|
25
|
+
import { BashTool, BUILTIN_TOOLS, createTools, EditTool, EvalTool, GlobTool, GrepTool, HIDDEN_TOOLS, type LspStartupServerInfo, loadSshTool, ReadTool, ResolveTool, type Tool, type ToolSession, WebSearchTool, WriteTool } from "./tools";
|
|
26
26
|
import { EventBus } from "./utils/event-bus";
|
|
27
27
|
import { type WorkspaceTree } from "./workspace-tree";
|
|
28
28
|
export interface CreateAgentSessionOptions {
|
|
@@ -224,7 +224,7 @@ export type { FileSlashCommand } from "./extensibility/slash-commands";
|
|
|
224
224
|
export type { MCPManager, MCPServerConfig, MCPServerConnection, MCPToolsLoadResult } from "./mcp";
|
|
225
225
|
export type { Tool } from "./tools";
|
|
226
226
|
export { buildDirectoryTree, buildWorkspaceTree, type DirectoryTree, type WorkspaceTree } from "./workspace-tree";
|
|
227
|
-
export { BashTool, BUILTIN_TOOLS, createTools, EditTool, EvalTool,
|
|
227
|
+
export { BashTool, BUILTIN_TOOLS, createTools, EditTool, EvalTool, GlobTool, GrepTool, HIDDEN_TOOLS, loadSshTool, ReadTool, ResolveTool, type ToolSession, WebSearchTool, WriteTool, };
|
|
228
228
|
/**
|
|
229
229
|
* Create an AuthStorage instance.
|
|
230
230
|
*
|
|
@@ -48,7 +48,7 @@ import type { ClientBridge } from "./client-bridge";
|
|
|
48
48
|
import { type CustomMessage } from "./messages";
|
|
49
49
|
import type { BuildSessionContextOptions, SessionContext } from "./session-context";
|
|
50
50
|
import type { BranchSummaryEntry, NewSessionOptions } from "./session-entries";
|
|
51
|
-
import type
|
|
51
|
+
import { type SessionManager } from "./session-manager";
|
|
52
52
|
import type { ShakeMode, ShakeResult } from "./shake-types";
|
|
53
53
|
import { ToolChoiceQueue } from "./tool-choice-queue";
|
|
54
54
|
import { YieldQueue } from "./yield-queue";
|
|
@@ -459,6 +459,7 @@ export declare class AgentSession {
|
|
|
459
459
|
/** True once dispose() has begun; deferred background work (e.g. the deferred
|
|
460
460
|
* MCP discovery task in sdk.ts) must not touch the session past this point. */
|
|
461
461
|
get isDisposed(): boolean;
|
|
462
|
+
markMovedFromEmptySessionFile(sessionFile: string): void;
|
|
462
463
|
/**
|
|
463
464
|
* Synchronously mark the session as disposing so new work is rejected
|
|
464
465
|
* immediately: eval starts throw, queued asides are dropped, and the
|
|
@@ -60,10 +60,19 @@ export declare function recoverOrphanedBackups(sessionDir: string, storage: Sess
|
|
|
60
60
|
* file's lifecycle {@link SessionStatus}.
|
|
61
61
|
*/
|
|
62
62
|
export declare function listSessions(sessionDir: string, storage: SessionStorage): Promise<SessionInfo[]>;
|
|
63
|
+
/**
|
|
64
|
+
* List sessions without repairing orphaned backups or mutating the directory.
|
|
65
|
+
*/
|
|
66
|
+
export declare function listSessionsReadOnly(sessionDir: string, storage: SessionStorage): Promise<SessionInfo[]>;
|
|
63
67
|
/** List all sessions across all project directories (newest first). */
|
|
64
68
|
export declare function listAllSessions(storage?: SessionStorage): Promise<SessionInfo[]>;
|
|
65
69
|
/** Exported for testing */
|
|
66
70
|
export declare function findMostRecentSession(sessionDir: string, storage?: SessionStorage): Promise<string | null>;
|
|
67
71
|
/** Get recent sessions for display in the welcome screen. */
|
|
68
72
|
export declare function getRecentSessions(sessionDir: string, limit?: number, storage?: SessionStorage): Promise<RecentSessionInfo[]>;
|
|
69
|
-
|
|
73
|
+
/** Controls cross-directory fallback for resumable session lookup. */
|
|
74
|
+
export interface ResolveResumableSessionOptions {
|
|
75
|
+
/** Search default global session buckets after the active/custom session directory misses. */
|
|
76
|
+
allowGlobalFallback?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export declare function resolveResumableSession(sessionArg: string, cwd: string, sessionDir?: string, storageOrOptions?: SessionStorage | ResolveResumableSessionOptions, options?: ResolveResumableSessionOptions): Promise<ResolvedSessionMatch | undefined>;
|
|
@@ -237,6 +237,14 @@ export declare class SessionManager {
|
|
|
237
237
|
* @param sessionDir Optional session directory; defaults to the cwd-derived dir.
|
|
238
238
|
*/
|
|
239
239
|
static create(cwd: string, sessionDir?: string, storage?: SessionStorage): SessionManager;
|
|
240
|
+
/**
|
|
241
|
+
* Create a fresh empty session file in the default session directory for
|
|
242
|
+
* `cwd`, writing only the session header. The returned path can be passed to
|
|
243
|
+
* `setSessionFile` / `AgentSession.switchSession` to start a new empty
|
|
244
|
+
* session in that directory. Used by `/move` to switch projects without
|
|
245
|
+
* dragging the current conversation along.
|
|
246
|
+
*/
|
|
247
|
+
static createEmptySessionFile(cwd: string, storage?: SessionStorage): string;
|
|
240
248
|
/**
|
|
241
249
|
* Fork a session into the current project directory: copy history from another
|
|
242
250
|
* session file while creating a fresh session file in this sessionDir.
|
|
@@ -290,4 +298,9 @@ export declare class SessionManager {
|
|
|
290
298
|
/** List all sessions across all project directories. */
|
|
291
299
|
static listAll(storage?: SessionStorage): Promise<SessionInfo[]>;
|
|
292
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* If the current session was created by `/move` and contains no real
|
|
303
|
+
* user/assistant messages, delete it so empty move sessions don't accumulate.
|
|
304
|
+
*/
|
|
305
|
+
export declare function cleanupEmptyMoveSession(sessionManager: SessionManager, movedFromEmptySessionFile: string | undefined): Promise<void>;
|
|
293
306
|
export {};
|
|
@@ -4,7 +4,7 @@ export type { BuiltinSlashCommand, SubcommandDef } from "./types";
|
|
|
4
4
|
/** TUI-specific runtime accepted by `executeBuiltinSlashCommand`. */
|
|
5
5
|
export type BuiltinSlashCommandRuntime = TuiSlashCommandRuntime;
|
|
6
6
|
export interface TuiBuiltinSlashCommand extends BuiltinSlashCommand {
|
|
7
|
-
getArgumentCompletions?: (prefix: string) => AutocompleteItem[] | null
|
|
7
|
+
getArgumentCompletions?: (prefix: string) => AutocompleteItem[] | null | Promise<AutocompleteItem[] | null>;
|
|
8
8
|
getInlineHint?: (argumentText: string) => string | null;
|
|
9
9
|
getAutocompleteDescription?: () => string | undefined;
|
|
10
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -19,6 +19,8 @@ export interface SSHHostInfo {
|
|
|
19
19
|
}
|
|
20
20
|
interface SSHArgsOptions {
|
|
21
21
|
platform?: SshPlatform;
|
|
22
|
+
/** When true, omit `-n` so the remote command can read from our piped stdin. */
|
|
23
|
+
allowStdin?: boolean;
|
|
22
24
|
}
|
|
23
25
|
export declare function getHostInfo(hostName: string): Promise<SSHHostInfo | undefined>;
|
|
24
26
|
export declare function getHostInfoForHost(host: SSHConnectionTarget): Promise<SSHHostInfo | undefined>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type SSHConnectionTarget } from "./connection-manager";
|
|
2
|
+
export interface RemoteFileReadOptions {
|
|
3
|
+
/** Maximum bytes to materialize; the helper fetches one extra byte to detect truncation. */
|
|
4
|
+
maxBytes: number;
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface RemoteFileReadResult {
|
|
9
|
+
/** Raw file bytes, capped at `maxBytes`. */
|
|
10
|
+
bytes: Uint8Array;
|
|
11
|
+
/** True when the remote file was larger than `maxBytes` (`bytes` is the prefix). */
|
|
12
|
+
truncated: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface RemoteFileWriteOptions {
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Read a remote file's raw bytes. Fetches `maxBytes + 1` so the caller can
|
|
20
|
+
* distinguish an exactly-`maxBytes` file from a larger (truncated) one.
|
|
21
|
+
*
|
|
22
|
+
* Throws `ptree.NonZeroExitError` (carrying the remote stderr tail) when the
|
|
23
|
+
* file is missing/unreadable or the host is unreachable.
|
|
24
|
+
*/
|
|
25
|
+
export declare function readRemoteFile(target: SSHConnectionTarget, remotePath: string, opts: RemoteFileReadOptions): Promise<RemoteFileReadResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Write `content` to a remote file byte-exact. Stdin is always staged first into
|
|
28
|
+
* a uniquely named temp in the destination directory (so the remote never blocks
|
|
29
|
+
* on an unread pipe and a dropped connection lands in the temp, never the
|
|
30
|
+
* destination). The destination then dictates the commit:
|
|
31
|
+
* - a directory — or a symlink to one, since the `-d` test follows links — is
|
|
32
|
+
* refused (a plain `mv tmp dir` would move the temp INTO it).
|
|
33
|
+
* - an existing non-symlink regular file is rewritten IN PLACE from the staged
|
|
34
|
+
* temp, preserving its inode and therefore its ordinary permission bits (a
|
|
35
|
+
* `0600` secret stays `0600` on overwrite), ACLs, xattrs, and hardlinks. The
|
|
36
|
+
* setuid/setgid bits may be cleared by the write (per POSIX). This commit is
|
|
37
|
+
* not fully atomic — a remote-side failure during the local temp->dest copy
|
|
38
|
+
* (e.g. the disk filling) can truncate the destination — but the slow network
|
|
39
|
+
* transfer has already landed in the temp, and the temp is removed on failure.
|
|
40
|
+
* It also needs write permission on the file itself (a read-only file is
|
|
41
|
+
* refused, not silently replaced).
|
|
42
|
+
* - an existing special file (FIFO/socket/device) is refused, not replaced.
|
|
43
|
+
* - anything else (a new path, a symlink to a non-directory, a dangling symlink)
|
|
44
|
+
* is committed with an atomic rename, which REPLACES a symlink with a regular
|
|
45
|
+
* file rather than writing through it (resolving the link target is not
|
|
46
|
+
* portable across the macOS/Linux hosts this stack supports).
|
|
47
|
+
* Throws `ptree.NonZeroExitError` when the remote path is unwritable or the host
|
|
48
|
+
* is unreachable.
|
|
49
|
+
*/
|
|
50
|
+
export declare function writeRemoteFile(target: SSHConnectionTarget, remotePath: string, content: Uint8Array, opts: RemoteFileWriteOptions): Promise<void>;
|
|
51
|
+
/** Classification of a remote path, used by the read handler's directory dispatch. */
|
|
52
|
+
export type RemotePathKind = "file" | "directory" | "other" | "missing";
|
|
53
|
+
/**
|
|
54
|
+
* Classify a remote path with POSIX `test` (portable across Linux/BSD/macOS):
|
|
55
|
+
* `directory`, regular `file`, `other` (special file), or `missing`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function statRemotePath(target: SSHConnectionTarget, remotePath: string, opts?: {
|
|
58
|
+
signal?: AbortSignal;
|
|
59
|
+
timeoutMs?: number;
|
|
60
|
+
}): Promise<RemotePathKind>;
|
|
61
|
+
/** A single entry in a remote directory listing. */
|
|
62
|
+
export interface RemoteDirEntry {
|
|
63
|
+
/** Entry name (no path component), trailing `/` stripped. */
|
|
64
|
+
name: string;
|
|
65
|
+
/** True when the entry is a directory. */
|
|
66
|
+
isDirectory: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* List a remote directory one level deep with `ls -1Ap` (one per line; all
|
|
70
|
+
* entries incl. dotfiles but not `.`/`..`; trailing `/` marks directories).
|
|
71
|
+
* Plain `ls` (no `| head`) so a permission/race failure surfaces as a non-zero
|
|
72
|
+
* exit instead of being masked as an empty listing. Entries are returned in
|
|
73
|
+
* full, sorted directories-first then by name to mirror the local
|
|
74
|
+
* directory-resource contract, so the read tool can paginate the listing.
|
|
75
|
+
*/
|
|
76
|
+
export declare function listRemoteDir(target: SSHConnectionTarget, remotePath: string, opts?: {
|
|
77
|
+
signal?: AbortSignal;
|
|
78
|
+
timeoutMs?: number;
|
|
79
|
+
}): Promise<RemoteDirEntry[]>;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export declare function sanitizeHostName(name: string): string;
|
|
2
2
|
export declare function buildSshTarget(username: string | undefined, host: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Single-quote a path for a POSIX remote shell, escaping embedded single quotes.
|
|
5
|
+
* Mirrors the private `quoteRemotePath` in `tools/ssh.ts`; shared here for the
|
|
6
|
+
* `ssh://` file-transfer helpers.
|
|
7
|
+
*/
|
|
8
|
+
export declare function quotePosixPath(value: string): string;
|
|
@@ -5,6 +5,7 @@ import type { AgentTool } from "@oh-my-pi/pi-agent-core";
|
|
|
5
5
|
import type { ToolExample, TSchema } from "@oh-my-pi/pi-ai";
|
|
6
6
|
import type { Personality, SkillsSettings } from "./config/settings";
|
|
7
7
|
import { type Skill } from "./extensibility/skills";
|
|
8
|
+
import { type ActiveRepoContext } from "./utils/active-repo-context";
|
|
8
9
|
import { type WorkspaceTree } from "./workspace-tree";
|
|
9
10
|
interface AlwaysApplyRule {
|
|
10
11
|
name: string;
|
|
@@ -112,6 +113,10 @@ export interface BuildSystemPromptOptions {
|
|
|
112
113
|
personality?: Personality;
|
|
113
114
|
/** Whether to include the workspace directory tree in the system prompt. Default: false */
|
|
114
115
|
includeWorkspaceTree?: boolean;
|
|
116
|
+
/** Whether Mermaid fenced blocks render as terminal ASCII diagrams. Default: true */
|
|
117
|
+
renderMermaid?: boolean;
|
|
118
|
+
/** Pre-resolved nested active repo context. Undefined resolves from cwd. */
|
|
119
|
+
activeRepoContext?: ActiveRepoContext | null;
|
|
115
120
|
}
|
|
116
121
|
/** Result of building provider-facing system prompt messages. */
|
|
117
122
|
export interface BuildSystemPromptResult {
|
|
@@ -17,6 +17,7 @@ import type { HindsightSessionState } from "../hindsight/state";
|
|
|
17
17
|
import type { LocalProtocolOptions } from "../internal-urls";
|
|
18
18
|
import type { MCPManager } from "../mcp/manager";
|
|
19
19
|
import type { MnemopiSessionState } from "../mnemopi/state";
|
|
20
|
+
import type { AgentSession } from "../session/agent-session";
|
|
20
21
|
import type { ArtifactManager } from "../session/artifacts";
|
|
21
22
|
import type { AuthStorage } from "../session/auth-storage";
|
|
22
23
|
import type { ContextFileEntry } from "../tools";
|
|
@@ -156,6 +157,12 @@ export interface ExecutorOptions {
|
|
|
156
157
|
* passes its own `getAgentId()`).
|
|
157
158
|
*/
|
|
158
159
|
parentAgentId?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Keep the finished subagent addressable in the registry for IRC/revival.
|
|
162
|
+
* Defaults to true. Eval bridge agents are programmatic one-shot helpers and
|
|
163
|
+
* set this false so disposal unregisters them instead of leaving idle peers.
|
|
164
|
+
*/
|
|
165
|
+
keepAlive?: boolean;
|
|
159
166
|
}
|
|
160
167
|
export interface YieldItem {
|
|
161
168
|
data?: unknown;
|
|
@@ -197,6 +204,15 @@ export declare function finalizeSubprocessOutput(args: FinalizeSubprocessOutputA
|
|
|
197
204
|
*/
|
|
198
205
|
export declare function createMCPProxyTools(mcpManager: MCPManager): CustomTool[];
|
|
199
206
|
export declare function createSubagentSettings(baseSettings: Settings, overrides?: Partial<Record<SettingPath, unknown>>, inheritedServiceTier?: ServiceTier | null): Settings;
|
|
207
|
+
export declare function finalizeSubagentLifecycle(args: {
|
|
208
|
+
id: string;
|
|
209
|
+
session: AgentSession;
|
|
210
|
+
aborted: boolean;
|
|
211
|
+
keepAlive: boolean;
|
|
212
|
+
isolated: boolean;
|
|
213
|
+
agentIdleTtlMs: number;
|
|
214
|
+
reviveSession: (() => Promise<AgentSession>) | null;
|
|
215
|
+
}): Promise<void>;
|
|
200
216
|
/**
|
|
201
217
|
* Run a single agent in-process.
|
|
202
218
|
*/
|
|
@@ -33,4 +33,4 @@ export declare function isLowSignalTitleInput(message: string): boolean;
|
|
|
33
33
|
* `none` instruction in `prompts/system/title-system.md`.
|
|
34
34
|
*/
|
|
35
35
|
export declare const NO_TITLE_SENTINEL = "none";
|
|
36
|
-
export declare function normalizeGeneratedTitle(value: string | null | undefined): string | null;
|
|
36
|
+
export declare function normalizeGeneratedTitle(value: string | null | undefined, sourceText?: string): string | null;
|