@oh-my-pi/pi-coding-agent 16.1.23 → 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 +70 -0
- package/dist/cli.js +3817 -3735
- 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/collab/display-name.d.ts +3 -0
- package/dist/types/collab/host.d.ts +0 -2
- 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 +91 -21
- package/dist/types/config/settings.d.ts +2 -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/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/theme.d.ts +1 -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-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 +3 -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/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/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/usage-cli.ts +20 -1
- package/src/cli/web-search-cli.ts +1 -1
- 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/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 +85 -27
- package/src/config/settings.ts +172 -1
- 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 +38 -2
- 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/agent-bridge.ts +26 -3
- 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 +8 -3
- package/src/extensibility/plugins/legacy-pi-bundled-registry.ts +25 -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/mcp/tool-bridge.ts +32 -2
- 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 +68 -2
- package/src/modes/controllers/selector-controller.ts +5 -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 +116 -50
- 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/theme.ts +9 -1
- 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 +3 -3
- package/src/prompts/system/project-prompt.md +2 -2
- package/src/prompts/system/system-prompt.md +6 -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 +55 -25
- package/src/session/agent-session.ts +508 -132
- package/src/session/session-history-format.ts +2 -2
- package/src/session/session-manager.ts +46 -0
- package/src/slash-commands/builtin-registry.ts +138 -20
- 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 +56 -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/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/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/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/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
|
@@ -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;
|
|
@@ -114,6 +115,8 @@ export interface BuildSystemPromptOptions {
|
|
|
114
115
|
includeWorkspaceTree?: boolean;
|
|
115
116
|
/** Whether Mermaid fenced blocks render as terminal ASCII diagrams. Default: true */
|
|
116
117
|
renderMermaid?: boolean;
|
|
118
|
+
/** Pre-resolved nested active repo context. Undefined resolves from cwd. */
|
|
119
|
+
activeRepoContext?: ActiveRepoContext | null;
|
|
117
120
|
}
|
|
118
121
|
/** Result of building provider-facing system prompt messages. */
|
|
119
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;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export declare const BUILTIN_TOOL_NAMES: readonly ["read", "bash", "edit", "ast_grep", "ast_edit", "ask", "debug", "eval", "ssh", "github", "
|
|
1
|
+
export declare const BUILTIN_TOOL_NAMES: readonly ["read", "bash", "edit", "ast_grep", "ast_edit", "ask", "debug", "eval", "ssh", "github", "glob", "grep", "lsp", "inspect_image", "browser", "checkpoint", "rewind", "task", "job", "irc", "todo", "web_search", "search_tool_bm25", "write", "memory_edit", "retain", "recall", "reflect", "learn", "manage_skill"];
|
|
2
2
|
export type BuiltinToolName = (typeof BUILTIN_TOOL_NAMES)[number];
|
|
3
|
+
/** Return the canonical tool name for current and legacy built-in tool IDs. */
|
|
4
|
+
export declare function normalizeToolName(name: string): string;
|
|
5
|
+
/** Normalize and deduplicate tool names while preserving first-seen order. */
|
|
6
|
+
export declare function normalizeToolNames(names: Iterable<string>): string[];
|
|
@@ -12,8 +12,8 @@ declare const findSchema: import("arktype/internal/variants/object.ts").ObjectTy
|
|
|
12
12
|
gitignore?: boolean | undefined;
|
|
13
13
|
limit?: number | undefined;
|
|
14
14
|
}, {}>;
|
|
15
|
-
export type
|
|
16
|
-
export interface
|
|
15
|
+
export type GlobToolInput = typeof findSchema.infer;
|
|
16
|
+
export interface GlobToolDetails {
|
|
17
17
|
truncation?: TruncationResult;
|
|
18
18
|
resultLimitReached?: number;
|
|
19
19
|
meta?: OutputMeta;
|
|
@@ -34,7 +34,7 @@ export interface FindToolDetails {
|
|
|
34
34
|
* Pluggable operations for the find tool.
|
|
35
35
|
* Override these to delegate file search to remote systems (e.g., SSH).
|
|
36
36
|
*/
|
|
37
|
-
export interface
|
|
37
|
+
export interface GlobOperations {
|
|
38
38
|
/** Check if path exists */
|
|
39
39
|
exists: (absolutePath: string) => Promise<boolean> | boolean;
|
|
40
40
|
/** Optional stat for distinguishing files vs directories. */
|
|
@@ -51,17 +51,17 @@ export interface FindOperations {
|
|
|
51
51
|
limit: number;
|
|
52
52
|
}) => Promise<string[]> | string[];
|
|
53
53
|
}
|
|
54
|
-
export interface
|
|
54
|
+
export interface GlobToolOptions {
|
|
55
55
|
/** Custom operations for find. Default: local filesystem + rg */
|
|
56
|
-
operations?:
|
|
56
|
+
operations?: GlobOperations;
|
|
57
57
|
}
|
|
58
|
-
export declare class
|
|
58
|
+
export declare class GlobTool implements AgentTool<typeof findSchema, GlobToolDetails> {
|
|
59
59
|
#private;
|
|
60
60
|
private readonly session;
|
|
61
|
-
readonly name = "
|
|
61
|
+
readonly name = "glob";
|
|
62
62
|
readonly approval: "read";
|
|
63
63
|
readonly loadMode = "essential";
|
|
64
|
-
readonly label = "
|
|
64
|
+
readonly label = "Glob";
|
|
65
65
|
readonly description: string;
|
|
66
66
|
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
67
67
|
paths: string[];
|
|
@@ -71,24 +71,24 @@ export declare class FindTool implements AgentTool<typeof findSchema, FindToolDe
|
|
|
71
71
|
}, {}>;
|
|
72
72
|
readonly examples: readonly ToolExample<typeof findSchema.infer>[];
|
|
73
73
|
readonly strict = true;
|
|
74
|
-
constructor(session: ToolSession, options?:
|
|
75
|
-
execute(_toolCallId: string, params: typeof findSchema.infer, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<
|
|
74
|
+
constructor(session: ToolSession, options?: GlobToolOptions);
|
|
75
|
+
execute(_toolCallId: string, params: typeof findSchema.infer, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<GlobToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<GlobToolDetails>>;
|
|
76
76
|
}
|
|
77
|
-
interface
|
|
77
|
+
interface GlobRenderArgs {
|
|
78
78
|
paths?: string | string[];
|
|
79
79
|
limit?: number;
|
|
80
80
|
}
|
|
81
|
-
export declare const
|
|
81
|
+
export declare const globToolRenderer: {
|
|
82
82
|
inline: boolean;
|
|
83
|
-
renderCall(args:
|
|
83
|
+
renderCall(args: GlobRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component;
|
|
84
84
|
renderResult(result: {
|
|
85
85
|
content: Array<{
|
|
86
86
|
type: string;
|
|
87
87
|
text?: string;
|
|
88
88
|
}>;
|
|
89
|
-
details?:
|
|
89
|
+
details?: GlobToolDetails;
|
|
90
90
|
isError?: boolean;
|
|
91
|
-
}, options: RenderResultOptions, uiTheme: Theme, args?:
|
|
91
|
+
}, options: RenderResultOptions, uiTheme: Theme, args?: GlobRenderArgs): Component;
|
|
92
92
|
mergeCallAndResult: boolean;
|
|
93
93
|
};
|
|
94
94
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
1
|
+
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolTier } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
3
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
4
4
|
import type { Theme } from "../modes/theme/theme";
|
|
@@ -12,7 +12,7 @@ declare const searchSchema: import("arktype/internal/variants/object.ts").Object
|
|
|
12
12
|
gitignore?: boolean | undefined;
|
|
13
13
|
skip?: number | null | undefined;
|
|
14
14
|
}, {}>;
|
|
15
|
-
export type
|
|
15
|
+
export type GrepToolInput = typeof searchSchema.infer;
|
|
16
16
|
export declare function toPathList(input: string | string[] | undefined): string[];
|
|
17
17
|
/** Maximum number of distinct files surfaced in a single response. The
|
|
18
18
|
* agent paginates further pages via `skip`. */
|
|
@@ -23,7 +23,7 @@ export declare const MULTI_FILE_PER_FILE_MATCHES = 20;
|
|
|
23
23
|
/** Per-file match cap for single-file searches — there's no diversity
|
|
24
24
|
* concern when the scope is one file. */
|
|
25
25
|
export declare const SINGLE_FILE_MATCHES = 200;
|
|
26
|
-
export interface
|
|
26
|
+
export interface GrepToolDetails {
|
|
27
27
|
truncation?: TruncationResult;
|
|
28
28
|
fileLimitReached?: number;
|
|
29
29
|
perFileLimitReached?: number;
|
|
@@ -56,13 +56,13 @@ export interface SearchToolDetails {
|
|
|
56
56
|
missingPaths?: string[];
|
|
57
57
|
}
|
|
58
58
|
type SearchParams = typeof searchSchema.infer;
|
|
59
|
-
export declare class
|
|
59
|
+
export declare class GrepTool implements AgentTool<typeof searchSchema, GrepToolDetails> {
|
|
60
60
|
private readonly session;
|
|
61
|
-
readonly name = "
|
|
62
|
-
readonly approval:
|
|
63
|
-
readonly label = "
|
|
61
|
+
readonly name = "grep";
|
|
62
|
+
readonly approval: (args: unknown) => ToolTier;
|
|
63
|
+
readonly label = "Grep";
|
|
64
64
|
readonly loadMode = "discoverable";
|
|
65
|
-
readonly summary = "
|
|
65
|
+
readonly summary = "Grep file contents using ripgrep (fast regex search)";
|
|
66
66
|
readonly description: string;
|
|
67
67
|
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
68
68
|
pattern: string;
|
|
@@ -73,26 +73,26 @@ export declare class SearchTool implements AgentTool<typeof searchSchema, Search
|
|
|
73
73
|
}, {}>;
|
|
74
74
|
readonly strict = true;
|
|
75
75
|
constructor(session: ToolSession);
|
|
76
|
-
execute(_toolCallId: string, params: SearchParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<
|
|
76
|
+
execute(_toolCallId: string, params: SearchParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<GrepToolDetails>, _toolContext?: AgentToolContext): Promise<AgentToolResult<GrepToolDetails>>;
|
|
77
77
|
}
|
|
78
|
-
interface
|
|
78
|
+
interface GrepRenderArgs {
|
|
79
79
|
pattern: string;
|
|
80
80
|
paths?: string | string[];
|
|
81
81
|
case?: boolean;
|
|
82
82
|
gitignore?: boolean;
|
|
83
83
|
skip?: number;
|
|
84
84
|
}
|
|
85
|
-
export declare const
|
|
85
|
+
export declare const grepToolRenderer: {
|
|
86
86
|
inline: boolean;
|
|
87
|
-
renderCall(args:
|
|
87
|
+
renderCall(args: GrepRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component;
|
|
88
88
|
renderResult(result: {
|
|
89
89
|
content: Array<{
|
|
90
90
|
type: string;
|
|
91
91
|
text?: string;
|
|
92
92
|
}>;
|
|
93
|
-
details?:
|
|
93
|
+
details?: GrepToolDetails;
|
|
94
94
|
isError?: boolean;
|
|
95
|
-
}, options: RenderResultOptions, uiTheme: Theme, args?:
|
|
95
|
+
}, options: RenderResultOptions, uiTheme: Theme, args?: GrepRenderArgs): Component;
|
|
96
96
|
mergeCallAndResult: boolean;
|
|
97
97
|
};
|
|
98
98
|
export {};
|
|
@@ -23,7 +23,7 @@ import type { AgentOutputManager } from "../task/output-manager";
|
|
|
23
23
|
import type { DiscoverableTool, DiscoverableToolSearchIndex } from "../tool-discovery/tool-index";
|
|
24
24
|
import type { EventBus } from "../utils/event-bus";
|
|
25
25
|
import type { WorkspaceTree } from "../workspace-tree";
|
|
26
|
-
import type
|
|
26
|
+
import { type BuiltinToolName } from "./builtin-names";
|
|
27
27
|
import { type CheckpointState } from "./checkpoint";
|
|
28
28
|
import { type TodoPhase } from "./todo";
|
|
29
29
|
export * from "../edit";
|
|
@@ -41,8 +41,9 @@ export * from "./checkpoint";
|
|
|
41
41
|
export * from "./debug";
|
|
42
42
|
export * from "./eval";
|
|
43
43
|
export * from "./eval-backends";
|
|
44
|
-
export * from "./find";
|
|
45
44
|
export * from "./gh";
|
|
45
|
+
export * from "./glob";
|
|
46
|
+
export * from "./grep";
|
|
46
47
|
export * from "./image-gen";
|
|
47
48
|
export * from "./inspect-image";
|
|
48
49
|
export * from "./irc";
|
|
@@ -57,7 +58,6 @@ export * from "./read";
|
|
|
57
58
|
export * from "./report-tool-issue";
|
|
58
59
|
export * from "./resolve";
|
|
59
60
|
export * from "./review";
|
|
60
|
-
export * from "./search";
|
|
61
61
|
export * from "./search-tool-bm25";
|
|
62
62
|
export * from "./ssh";
|
|
63
63
|
export * from "./todo";
|
|
@@ -58,8 +58,37 @@ export declare function splitInternalUrlSel(rawPath: string): {
|
|
|
58
58
|
path: string;
|
|
59
59
|
sel?: string;
|
|
60
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Peel a read-tool selector off an internal-URL write target so `write` resolves
|
|
63
|
+
* the same file `read` does (e.g. `ssh://h/f:raw` -> `ssh://h/f`). Only the
|
|
64
|
+
* whole-file display modes `raw`/`conflicts` are accepted (they do not change
|
|
65
|
+
* which bytes are written); any other selector-shaped tail `splitInternalUrlSel`
|
|
66
|
+
* peels — a line range, a compound like `raw:1-20`, or a malformed `:-N` — throws,
|
|
67
|
+
* because `write` addresses a whole file, not a partial range, and silently
|
|
68
|
+
* stripping it would write to a path the caller never named. Non-URL paths and
|
|
69
|
+
* URLs without a selector pass through unchanged.
|
|
70
|
+
*/
|
|
71
|
+
export declare function peelWriteUrlSelector(rawPath: string): string;
|
|
61
72
|
export declare function normalizeLocalScheme(filePath: string): string;
|
|
62
73
|
export declare function isInternalUrlPath(filePath: string): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* True when a tool path argument references the `ssh://` scheme anywhere.
|
|
76
|
+
*
|
|
77
|
+
* Substring (not anchored) on purpose: it feeds the read/search/write approval
|
|
78
|
+
* tier, which runs synchronously on the raw args. `search` only flattens a
|
|
79
|
+
* delimited `paths: "a,ssh://h/x"` into separate entries *after* approval, so an
|
|
80
|
+
* anchored check would let an embedded `ssh://` slip through at the read tier.
|
|
81
|
+
* Matching the literal `ssh://` substring also tracks exactly what routes to the
|
|
82
|
+
* SSH handler; over-matching only over-prompts (fail-closed).
|
|
83
|
+
*/
|
|
84
|
+
export declare function pathTargetsSsh(path: string): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* True when a path is specifically an `ssh://` URL (anchored scheme match).
|
|
87
|
+
* Unlike {@link pathTargetsSsh} (substring, for the pre-expansion approval
|
|
88
|
+
* scan), this is the exact per-entry check used to reject `ssh://` *before* a
|
|
89
|
+
* side-effecting `InternalUrlRouter.resolve` in tools that need a local file.
|
|
90
|
+
*/
|
|
91
|
+
export declare function isSshUrl(path: string): boolean;
|
|
63
92
|
/**
|
|
64
93
|
* Resolve a path relative to the given cwd.
|
|
65
94
|
* Handles ~ expansion and absolute paths.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
1
|
+
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolTier } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
3
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
4
4
|
import { type Theme } from "../modes/theme/theme";
|
|
@@ -53,7 +53,7 @@ export declare class ReadTool implements AgentTool<typeof readSchema, ReadToolDe
|
|
|
53
53
|
#private;
|
|
54
54
|
private readonly session;
|
|
55
55
|
readonly name = "read";
|
|
56
|
-
readonly approval:
|
|
56
|
+
readonly approval: (args: unknown) => ToolTier;
|
|
57
57
|
readonly label = "Read";
|
|
58
58
|
readonly loadMode = "essential";
|
|
59
59
|
readonly description: string;
|
|
@@ -52,6 +52,14 @@ export declare function expandKeyHint(): string;
|
|
|
52
52
|
* Get first N lines of text as preview, with each line truncated.
|
|
53
53
|
*/
|
|
54
54
|
export declare function getPreviewLines(text: string, maxLines: number, maxLineLen: number, ellipsis?: Ellipsis): string[];
|
|
55
|
+
/**
|
|
56
|
+
* Collapse a possibly multi-line string into a single line, then truncate it to
|
|
57
|
+
* `maxWidth` display cells. {@link truncateToWidth} alone caps width but
|
|
58
|
+
* newlines are zero-width, so multi-line content (markdown briefs, tool args,
|
|
59
|
+
* provider errors) would otherwise spill a single status row across several
|
|
60
|
+
* visual lines. Whitespace runs collapse to one space, so tabs are handled too.
|
|
61
|
+
*/
|
|
62
|
+
export declare function previewLine(text: string, maxWidth: number, ellipsis?: Ellipsis): string;
|
|
55
63
|
/**
|
|
56
64
|
* Extract domain from URL, stripping www. prefix.
|
|
57
65
|
*/
|
|
@@ -30,5 +30,16 @@ export type ToolRenderer = {
|
|
|
30
30
|
* streams rows the result render preserves.
|
|
31
31
|
*/
|
|
32
32
|
provisionalPendingPreview?: boolean | "collapsed";
|
|
33
|
+
/**
|
|
34
|
+
* Whether the partial-result render is provisional: chrome rows (header
|
|
35
|
+
* glyph, frame state) that change between `options.isPartial === true` and
|
|
36
|
+
* the final result render. When `true`, the block is treated as
|
|
37
|
+
* commit-unstable while a partial result is in flight, so the
|
|
38
|
+
* stable-prefix ratchet in `deriveLiveCommitState` cannot promote the
|
|
39
|
+
* partial chrome to native scrollback only to have the final render strand
|
|
40
|
+
* it above the settled frame. Absent = the partial render is byte-stable
|
|
41
|
+
* with the final render and may commit like any settled stream.
|
|
42
|
+
*/
|
|
43
|
+
provisionalPartialResult?: boolean;
|
|
33
44
|
};
|
|
34
45
|
export declare const toolRenderers: Record<string, ToolRenderer>;
|
|
@@ -62,10 +62,12 @@ export declare const sshToolRenderer: {
|
|
|
62
62
|
text?: string;
|
|
63
63
|
}>;
|
|
64
64
|
details?: SSHToolDetails;
|
|
65
|
+
isError?: boolean;
|
|
65
66
|
}, options: RenderResultOptions & {
|
|
66
67
|
renderContext?: SshRenderContext;
|
|
67
68
|
}, uiTheme: Theme, args?: SshRenderArgs): Component;
|
|
68
69
|
mergeCallAndResult: boolean;
|
|
69
70
|
provisionalPendingPreview: string;
|
|
71
|
+
provisionalPartialResult: boolean;
|
|
70
72
|
};
|
|
71
73
|
export {};
|
|
@@ -37,22 +37,6 @@ type TodoParams = TodoSchema;
|
|
|
37
37
|
type TodoSchema = typeof todoSchema.infer;
|
|
38
38
|
export declare const USER_TODO_EDIT_CUSTOM_TYPE = "user_todo_edit";
|
|
39
39
|
export declare function getLatestTodoPhasesFromEntries(entries: SessionEntry[]): TodoPhase[];
|
|
40
|
-
/**
|
|
41
|
-
* Pick the actionable window of tasks to display in the sticky todo panel.
|
|
42
|
-
*
|
|
43
|
-
* Returns up to `maxVisible` open (pending / in_progress) tasks in their
|
|
44
|
-
* original phase order, plus the count of remaining open tasks not shown so
|
|
45
|
-
* the caller can render a `+N more` hint. When every task in `tasks` is
|
|
46
|
-
* closed (completed or abandoned), returns the trailing `maxVisible` tasks
|
|
47
|
-
* with `hiddenOpenCount = 0`, so the panel keeps useful context until the
|
|
48
|
-
* active-phase pointer advances on the next `todo`.
|
|
49
|
-
*
|
|
50
|
-
* Task identity and order are preserved — this is a slice, never a sort.
|
|
51
|
-
*/
|
|
52
|
-
export declare function selectStickyTodoWindow(tasks: TodoItem[], maxVisible?: number): {
|
|
53
|
-
visible: TodoItem[];
|
|
54
|
-
hiddenOpenCount: number;
|
|
55
|
-
};
|
|
56
40
|
/**
|
|
57
41
|
* Report whether `content` likely names the same work as any entry in
|
|
58
42
|
* `descriptions`. Used by the sticky todo panel to light up a pending todo
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
1
|
+
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolTier } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
3
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
4
4
|
import { type FileDiagnosticsResult } from "../lsp";
|
|
@@ -30,7 +30,7 @@ export declare class WriteTool implements AgentTool<typeof writeSchema, WriteToo
|
|
|
30
30
|
#private;
|
|
31
31
|
private readonly session;
|
|
32
32
|
readonly name = "write";
|
|
33
|
-
readonly approval: (args: unknown) =>
|
|
33
|
+
readonly approval: (args: unknown) => ToolTier;
|
|
34
34
|
readonly formatApprovalDetails: (args: unknown) => string[];
|
|
35
35
|
readonly label = "Write";
|
|
36
36
|
readonly description: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ActiveRepoContext {
|
|
2
|
+
cwd: string;
|
|
3
|
+
repoRoot: string;
|
|
4
|
+
relativeRepoRoot: string;
|
|
5
|
+
source: "single-direct-child-repo";
|
|
6
|
+
}
|
|
7
|
+
export declare function resolveActiveRepoContext(cwd: string): Promise<ActiveRepoContext | null>;
|
|
8
|
+
export declare function resolveActiveRepoContextSync(cwd: string): ActiveRepoContext | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache schema/format revision. Bumping it changes the on-disk key prefix
|
|
3
|
+
* (`v<N>-...`), so old entries become unreachable and are pruned naturally.
|
|
4
|
+
* Bump when the cache *file* shape changes (entry JSON layout, key scheme).
|
|
5
|
+
*
|
|
6
|
+
* Converter *output* changes are handled separately: the package version is
|
|
7
|
+
* folded into the key (see {@link markitConversionCacheKey}), so any release
|
|
8
|
+
* that ships new markdown from `src/markit/converters/*` auto-invalidates the
|
|
9
|
+
* cache without a manual bump here.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MARKIT_CONVERSION_CACHE_VERSION = 1;
|
|
12
|
+
export declare const MAX_MARKIT_CONVERSION_CACHE_BYTES: number;
|
|
13
|
+
export type MarkitConversionCacheStatus = "hit" | "miss" | "skipped";
|
|
14
|
+
export type MarkitConversionCacheReadResult = {
|
|
15
|
+
status: "hit";
|
|
16
|
+
content: string;
|
|
17
|
+
} | {
|
|
18
|
+
status: "miss";
|
|
19
|
+
};
|
|
20
|
+
export declare function markitConversionCacheKey(bytes: Uint8Array, extension: string): string;
|
|
21
|
+
export declare function readMarkitConversionCache(key: string): Promise<MarkitConversionCacheReadResult>;
|
|
22
|
+
export declare function pruneMarkitConversionCache(cacheDir: string): Promise<void>;
|
|
23
|
+
export declare function writeMarkitConversionCache(key: string, content: string): Promise<void>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { type MarkitConversionCacheStatus } from "./markit-cache";
|
|
1
2
|
export interface MarkitConversionResult {
|
|
2
3
|
content: string;
|
|
3
4
|
ok: boolean;
|
|
4
5
|
error?: string;
|
|
6
|
+
cache?: MarkitConversionCacheStatus;
|
|
5
7
|
}
|
|
6
8
|
export interface MarkitFileConversionOptions {
|
|
7
9
|
/**
|
|
@@ -13,4 +15,6 @@ export interface MarkitFileConversionOptions {
|
|
|
13
15
|
imageDir?: string;
|
|
14
16
|
}
|
|
15
17
|
export declare function convertFileWithMarkit(filePath: string, signal?: AbortSignal, options?: MarkitFileConversionOptions): Promise<MarkitConversionResult>;
|
|
16
|
-
export declare function convertBufferWithMarkit(buffer: Uint8Array, extension: string, signal?: AbortSignal
|
|
18
|
+
export declare function convertBufferWithMarkit(buffer: Uint8Array, extension: string, signal?: AbortSignal, options?: {
|
|
19
|
+
useCache?: boolean;
|
|
20
|
+
}): Promise<MarkitConversionResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizePromptPath(value: string): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AuthStorage } from "@oh-my-pi/pi-ai";
|
|
2
|
+
import type { SearchResponse } from "../../../web/search/types";
|
|
3
|
+
import type { SearchParams } from "./base";
|
|
4
|
+
import { SearchProvider } from "./base";
|
|
5
|
+
/** Execute DuckDuckGo Instant Answer API search. */
|
|
6
|
+
export declare function searchDuckDuckGo(params: SearchParams): Promise<SearchResponse>;
|
|
7
|
+
/** Search provider for DuckDuckGo Instant Answer API. */
|
|
8
|
+
export declare class DuckDuckGoProvider extends SearchProvider {
|
|
9
|
+
readonly id = "duckduckgo";
|
|
10
|
+
readonly label = "DuckDuckGo";
|
|
11
|
+
isAvailable(_authStorage: AuthStorage): boolean;
|
|
12
|
+
isExplicitlyAvailable(_authStorage: AuthStorage): boolean;
|
|
13
|
+
search(params: SearchParams): Promise<SearchResponse>;
|
|
14
|
+
}
|