@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
|
@@ -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.
|
|
@@ -6,6 +6,13 @@ import type { ToolSession } from ".";
|
|
|
6
6
|
* resolver surfaces the real error. Exported for callers (e.g. `write`) that
|
|
7
7
|
* make scheme/bridge-routing decisions before {@link resolvePlanPath} runs. */
|
|
8
8
|
export declare function unwrapHashlineHeaderPath(targetPath: string): string;
|
|
9
|
+
/** True when `targetPath` resolves into the session-local artifact sandbox.
|
|
10
|
+
* Routes through {@link resolvePlanPath} so the guard and the eventual write
|
|
11
|
+
* always agree on the absolute target (including bracketed hashline headers,
|
|
12
|
+
* `local://` URLs, and bare absolute paths). Files inside the sandbox are not
|
|
13
|
+
* part of the working tree, so plan mode treats them as freely writable
|
|
14
|
+
* scratch/plan space — and tag-based path recovery may rebind onto them. */
|
|
15
|
+
export declare function targetsLocalSandbox(session: ToolSession, targetPath: string): boolean;
|
|
9
16
|
/**
|
|
10
17
|
* Resolve a write/edit target to its absolute filesystem path, honoring the
|
|
11
18
|
* `local://` and `vault://` schemes. Plain paths resolve against the session cwd.
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Firecrawl Web Search Provider
|
|
3
|
+
*
|
|
4
|
+
* Calls Firecrawl's search API and maps web results into the unified
|
|
5
|
+
* SearchResponse shape used by the web search tool.
|
|
6
|
+
*/
|
|
7
|
+
import { type AuthStorage, type FetchImpl } from "@oh-my-pi/pi-ai";
|
|
8
|
+
import type { SearchResponse } from "../../../web/search/types";
|
|
9
|
+
import type { SearchParams } from "./base";
|
|
10
|
+
import { SearchProvider } from "./base";
|
|
11
|
+
export interface FirecrawlSearchParams {
|
|
12
|
+
query: string;
|
|
13
|
+
num_results?: number;
|
|
14
|
+
recency?: SearchParams["recency"];
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
fetch?: FetchImpl;
|
|
17
|
+
}
|
|
18
|
+
/** Resolve Firecrawl API key through the shared auth storage pipeline. */
|
|
19
|
+
export declare function findApiKey(authStorage: AuthStorage, sessionId?: string, signal?: AbortSignal): Promise<string | undefined>;
|
|
20
|
+
/** Execute Firecrawl web search. */
|
|
21
|
+
export declare function searchFirecrawl(params: SearchParams): Promise<SearchResponse>;
|
|
22
|
+
/** Search provider for Firecrawl web search. */
|
|
23
|
+
export declare class FirecrawlProvider extends SearchProvider {
|
|
24
|
+
readonly id = "firecrawl";
|
|
25
|
+
readonly label = "Firecrawl";
|
|
26
|
+
isAvailable(authStorage: AuthStorage): boolean;
|
|
27
|
+
search(params: SearchParams): Promise<SearchResponse>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TinyFish Web Search Provider
|
|
3
|
+
*
|
|
4
|
+
* Calls TinyFish's search API and maps results into the unified
|
|
5
|
+
* SearchResponse shape used by the web search tool.
|
|
6
|
+
*/
|
|
7
|
+
import { type AuthStorage, type FetchImpl } from "@oh-my-pi/pi-ai";
|
|
8
|
+
import type { SearchResponse } from "../../../web/search/types";
|
|
9
|
+
import type { SearchParams } from "./base";
|
|
10
|
+
import { SearchProvider } from "./base";
|
|
11
|
+
export interface TinyFishSearchParams {
|
|
12
|
+
query: string;
|
|
13
|
+
num_results?: number;
|
|
14
|
+
recency?: SearchParams["recency"];
|
|
15
|
+
page?: number;
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
fetch?: FetchImpl;
|
|
18
|
+
}
|
|
19
|
+
/** Resolve TinyFish API key through the shared auth storage pipeline. */
|
|
20
|
+
export declare function findApiKey(authStorage: AuthStorage, sessionId?: string, signal?: AbortSignal): Promise<string | undefined>;
|
|
21
|
+
/** Execute TinyFish web search. */
|
|
22
|
+
export declare function searchTinyFish(params: SearchParams): Promise<SearchResponse>;
|
|
23
|
+
/** Search provider for TinyFish web search. */
|
|
24
|
+
export declare class TinyFishProvider extends SearchProvider {
|
|
25
|
+
readonly id = "tinyfish";
|
|
26
|
+
readonly label = "TinyFish";
|
|
27
|
+
isAvailable(authStorage: AuthStorage): boolean;
|
|
28
|
+
search(params: SearchParams): Promise<SearchResponse>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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 xAI Responses API web search. */
|
|
6
|
+
export declare function searchXAI(params: SearchParams): Promise<SearchResponse>;
|
|
7
|
+
/** Search provider for xAI web search. */
|
|
8
|
+
export declare class XAIProvider extends SearchProvider {
|
|
9
|
+
readonly id = "xai";
|
|
10
|
+
readonly label = "xAI";
|
|
11
|
+
isAvailable(authStorage: AuthStorage): boolean;
|
|
12
|
+
search(params: SearchParams): Promise<SearchResponse>;
|
|
13
|
+
}
|
|
@@ -23,6 +23,10 @@ export declare const SEARCH_PROVIDER_OPTIONS: readonly [{
|
|
|
23
23
|
readonly value: "codex";
|
|
24
24
|
readonly label: "OpenAI";
|
|
25
25
|
readonly description: "OpenAI's native web_search (uses ChatGPT OAuth via /login openai-codex)";
|
|
26
|
+
}, {
|
|
27
|
+
readonly value: "xai";
|
|
28
|
+
readonly label: "xAI";
|
|
29
|
+
readonly description: "Grok web search via xAI Responses API (requires XAI_API_KEY)";
|
|
26
30
|
}, {
|
|
27
31
|
readonly value: "zai";
|
|
28
32
|
readonly label: "Z.AI";
|
|
@@ -31,6 +35,10 @@ export declare const SEARCH_PROVIDER_OPTIONS: readonly [{
|
|
|
31
35
|
readonly value: "exa";
|
|
32
36
|
readonly label: "Exa";
|
|
33
37
|
readonly description: "Uses Exa API when EXA_API_KEY is set; falls back to Exa MCP";
|
|
38
|
+
}, {
|
|
39
|
+
readonly value: "tinyfish";
|
|
40
|
+
readonly label: "TinyFish";
|
|
41
|
+
readonly description: "Requires TINYFISH_API_KEY";
|
|
34
42
|
}, {
|
|
35
43
|
readonly value: "jina";
|
|
36
44
|
readonly label: "Jina";
|
|
@@ -43,6 +51,10 @@ export declare const SEARCH_PROVIDER_OPTIONS: readonly [{
|
|
|
43
51
|
readonly value: "tavily";
|
|
44
52
|
readonly label: "Tavily";
|
|
45
53
|
readonly description: "Requires TAVILY_API_KEY";
|
|
54
|
+
}, {
|
|
55
|
+
readonly value: "firecrawl";
|
|
56
|
+
readonly label: "Firecrawl";
|
|
57
|
+
readonly description: "Requires FIRECRAWL_API_KEY";
|
|
46
58
|
}, {
|
|
47
59
|
readonly value: "brave";
|
|
48
60
|
readonly label: "Brave";
|
|
@@ -63,6 +75,10 @@ export declare const SEARCH_PROVIDER_OPTIONS: readonly [{
|
|
|
63
75
|
readonly value: "searxng";
|
|
64
76
|
readonly label: "SearXNG";
|
|
65
77
|
readonly description: "Requires SEARXNG_ENDPOINT or searxng.endpoint";
|
|
78
|
+
}, {
|
|
79
|
+
readonly value: "duckduckgo";
|
|
80
|
+
readonly label: "DuckDuckGo";
|
|
81
|
+
readonly description: "Uses DuckDuckGo Instant Answer API (no API key)";
|
|
66
82
|
}];
|
|
67
83
|
/** Supported web search providers (every option except `auto`). */
|
|
68
84
|
export type SearchProviderId = Exclude<(typeof SEARCH_PROVIDER_OPTIONS)[number]["value"], "auto">;
|
|
@@ -88,7 +104,7 @@ export interface SearchSource {
|
|
|
88
104
|
ageSeconds?: number;
|
|
89
105
|
author?: string;
|
|
90
106
|
}
|
|
91
|
-
/** Citation with text reference (
|
|
107
|
+
/** Citation with text reference (LLM-mediated providers) */
|
|
92
108
|
export interface SearchCitation {
|
|
93
109
|
url: string;
|
|
94
110
|
title: string;
|
|
@@ -106,7 +122,7 @@ export interface SearchUsage {
|
|
|
106
122
|
/** Unified response across providers */
|
|
107
123
|
export interface SearchResponse {
|
|
108
124
|
provider: SearchProviderId | "none";
|
|
109
|
-
/** Synthesized answer text (
|
|
125
|
+
/** Synthesized answer text (LLM-mediated providers) */
|
|
110
126
|
answer?: string;
|
|
111
127
|
/** Search result sources */
|
|
112
128
|
sources: SearchSource[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-coding-agent",
|
|
4
|
-
"version": "16.
|
|
4
|
+
"version": "16.2.0",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -39,26 +39,33 @@
|
|
|
39
39
|
"fix": "biome check --write --unsafe . && bun run format-prompts",
|
|
40
40
|
"fmt": "biome format --write . && bun run format-prompts",
|
|
41
41
|
"format-prompts": "bun scripts/format-prompts.ts",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
42
|
+
"gen:docs": "bun scripts/generate-docs-index.ts --generate",
|
|
43
|
+
"gen:docs:reset": "bun scripts/generate-docs-index.ts --reset",
|
|
44
|
+
"gen:tool-views": "bun --cwd=../collab-web run gen:tool-views",
|
|
45
|
+
"gen:bundle": "bun scripts/bundle-dist.ts",
|
|
46
|
+
"gen:mupdf": "bun scripts/embed-mupdf-wasm.ts --generate",
|
|
47
|
+
"gen:mupdf:reset": "bun scripts/embed-mupdf-wasm.ts --reset",
|
|
48
|
+
"gen:native": "bun --cwd=../natives run gen:native",
|
|
49
|
+
"gen:native:reset": "bun --cwd=../natives run gen:native:reset",
|
|
50
|
+
"prepack": "bun run gen:docs && bun run gen:tool-views && bun run gen:bundle || ( bun run gen:docs:reset; exit 1 )",
|
|
51
|
+
"postpack": "bun run gen:docs:reset",
|
|
45
52
|
"bench:guard": "bun scripts/bench-guard.ts"
|
|
46
53
|
},
|
|
47
54
|
"dependencies": {
|
|
48
55
|
"@agentclientprotocol/sdk": "0.25.0",
|
|
49
56
|
"@babel/parser": "^7.29.7",
|
|
50
57
|
"@mozilla/readability": "^0.6.0",
|
|
51
|
-
"@oh-my-pi/hashline": "16.
|
|
52
|
-
"@oh-my-pi/omp-stats": "16.
|
|
53
|
-
"@oh-my-pi/pi-agent-core": "16.
|
|
54
|
-
"@oh-my-pi/pi-ai": "16.
|
|
55
|
-
"@oh-my-pi/pi-catalog": "16.
|
|
56
|
-
"@oh-my-pi/pi-mnemopi": "16.
|
|
57
|
-
"@oh-my-pi/pi-natives": "16.
|
|
58
|
-
"@oh-my-pi/pi-tui": "16.
|
|
59
|
-
"@oh-my-pi/pi-utils": "16.
|
|
60
|
-
"@oh-my-pi/pi-wire": "16.
|
|
61
|
-
"@oh-my-pi/snapcompact": "16.
|
|
58
|
+
"@oh-my-pi/hashline": "16.2.0",
|
|
59
|
+
"@oh-my-pi/omp-stats": "16.2.0",
|
|
60
|
+
"@oh-my-pi/pi-agent-core": "16.2.0",
|
|
61
|
+
"@oh-my-pi/pi-ai": "16.2.0",
|
|
62
|
+
"@oh-my-pi/pi-catalog": "16.2.0",
|
|
63
|
+
"@oh-my-pi/pi-mnemopi": "16.2.0",
|
|
64
|
+
"@oh-my-pi/pi-natives": "16.2.0",
|
|
65
|
+
"@oh-my-pi/pi-tui": "16.2.0",
|
|
66
|
+
"@oh-my-pi/pi-utils": "16.2.0",
|
|
67
|
+
"@oh-my-pi/pi-wire": "16.2.0",
|
|
68
|
+
"@oh-my-pi/snapcompact": "16.2.0",
|
|
62
69
|
"@opentelemetry/api": "^1.9.1",
|
|
63
70
|
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
64
71
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
|
|
@@ -375,6 +382,14 @@
|
|
|
375
382
|
"types": "./dist/types/lsp/clients/*.d.ts",
|
|
376
383
|
"import": "./src/lsp/clients/*.ts"
|
|
377
384
|
},
|
|
385
|
+
"./markit": {
|
|
386
|
+
"types": "./dist/types/markit/index.d.ts",
|
|
387
|
+
"import": "./src/markit/index.ts"
|
|
388
|
+
},
|
|
389
|
+
"./markit/*": {
|
|
390
|
+
"types": "./dist/types/markit/*.d.ts",
|
|
391
|
+
"import": "./src/markit/*.ts"
|
|
392
|
+
},
|
|
378
393
|
"./mcp": {
|
|
379
394
|
"types": "./dist/types/mcp/index.d.ts",
|
|
380
395
|
"import": "./src/mcp/index.ts"
|
package/scripts/bench-guard.ts
CHANGED
|
@@ -22,7 +22,7 @@ import * as path from "node:path";
|
|
|
22
22
|
|
|
23
23
|
const THRESHOLD = 1.05; // 5% regression budget
|
|
24
24
|
const BASELINE_PATH = path.join(import.meta.dir, "..", "bench", "boot-baseline.json");
|
|
25
|
-
const BENCH_COMMAND = "PI_TIMING=x bun src/cli.ts";
|
|
25
|
+
const BENCH_COMMAND = "PI_TIMING=x PI_STRICT_EDIT_MODE=1 bun src/cli.ts";
|
|
26
26
|
const cwd = path.join(import.meta.dir, "..");
|
|
27
27
|
|
|
28
28
|
function medianOf(hyperfineJson: string): number {
|