@oh-my-pi/pi-coding-agent 16.0.5 → 16.0.7
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 +60 -0
- package/dist/cli.js +1945 -1386
- package/dist/types/advisor/advise-tool.d.ts +22 -19
- package/dist/types/autoresearch/tools/init-experiment.d.ts +13 -17
- package/dist/types/autoresearch/tools/log-experiment.d.ts +17 -19
- package/dist/types/autoresearch/tools/run-experiment.d.ts +3 -4
- package/dist/types/autoresearch/tools/update-notes.d.ts +4 -5
- package/dist/types/cli/ttsr-cli.d.ts +39 -0
- package/dist/types/commands/ttsr.d.ts +57 -0
- package/dist/types/commit/agentic/tools/analyze-file.d.ts +4 -5
- package/dist/types/commit/agentic/tools/git-file-diff.d.ts +4 -5
- package/dist/types/commit/agentic/tools/git-hunk.d.ts +5 -6
- package/dist/types/commit/agentic/tools/git-overview.d.ts +4 -5
- package/dist/types/commit/agentic/tools/propose-changelog.d.ts +23 -24
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +11 -32
- package/dist/types/commit/agentic/tools/recent-commits.d.ts +3 -4
- package/dist/types/commit/agentic/tools/schemas.d.ts +6 -27
- package/dist/types/commit/agentic/tools/split-commit.d.ts +28 -49
- package/dist/types/commit/changelog/generate.d.ts +12 -13
- package/dist/types/commit/shared-llm.d.ts +10 -37
- package/dist/types/config/config-file.d.ts +4 -4
- package/dist/types/config/keybindings.d.ts +5 -0
- package/dist/types/config/models-config-schema.d.ts +625 -990
- package/dist/types/config/models-config.d.ts +229 -217
- package/dist/types/config/settings-schema.d.ts +53 -23
- package/dist/types/edit/hashline/params.d.ts +7 -11
- package/dist/types/edit/index.d.ts +2 -1
- package/dist/types/edit/modes/apply-patch.d.ts +4 -5
- package/dist/types/edit/modes/patch.d.ts +15 -24
- package/dist/types/edit/modes/replace.d.ts +16 -17
- package/dist/types/eval/js/index.d.ts +1 -0
- package/dist/types/extensibility/custom-commands/types.d.ts +6 -3
- package/dist/types/extensibility/custom-tools/types.d.ts +8 -5
- package/dist/types/extensibility/extensions/types.d.ts +6 -3
- package/dist/types/extensibility/hooks/types.d.ts +7 -4
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +13 -5
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +17 -0
- package/dist/types/extensibility/typebox.d.ts +80 -58
- package/dist/types/goals/tools/goal-tool.d.ts +11 -24
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lsp/index.d.ts +11 -26
- package/dist/types/lsp/types.d.ts +12 -28
- package/dist/types/mcp/client.d.ts +8 -0
- package/dist/types/modes/components/btw-panel.d.ts +1 -0
- package/dist/types/modes/components/custom-editor.d.ts +3 -1
- package/dist/types/modes/controllers/btw-controller.d.ts +2 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +3 -0
- package/dist/types/modes/setup-wizard/index.d.ts +1 -0
- package/dist/types/modes/setup-wizard/startup-splash.d.ts +7 -0
- package/dist/types/modes/theme/theme.d.ts +1 -1
- package/dist/types/modes/types.d.ts +3 -0
- package/dist/types/sdk.d.ts +5 -0
- package/dist/types/session/agent-session.d.ts +4 -0
- package/dist/types/startup-splash.d.ts +12 -0
- package/dist/types/task/types.d.ts +47 -48
- package/dist/types/tools/ask.d.ts +26 -27
- package/dist/types/tools/ast-edit.d.ts +17 -17
- package/dist/types/tools/ast-grep.d.ts +12 -13
- package/dist/types/tools/bash.d.ts +20 -17
- package/dist/types/tools/browser.d.ts +46 -71
- package/dist/types/tools/checkpoint.d.ts +14 -15
- package/dist/types/tools/debug.d.ts +82 -145
- package/dist/types/tools/eval.d.ts +30 -40
- package/dist/types/tools/find.d.ts +17 -18
- package/dist/types/tools/gh.d.ts +49 -78
- package/dist/types/tools/image-gen.d.ts +20 -36
- package/dist/types/tools/inspect-image.d.ts +10 -11
- package/dist/types/tools/irc.d.ts +22 -33
- package/dist/types/tools/job.d.ts +11 -12
- package/dist/types/tools/learn.d.ts +21 -28
- package/dist/types/tools/manage-skill.d.ts +13 -22
- package/dist/types/tools/memory-edit.d.ts +15 -24
- package/dist/types/tools/memory-recall.d.ts +7 -8
- package/dist/types/tools/memory-reflect.d.ts +9 -10
- package/dist/types/tools/memory-retain.d.ts +13 -14
- package/dist/types/tools/read.d.ts +7 -8
- package/dist/types/tools/resolve.d.ts +11 -18
- package/dist/types/tools/review.d.ts +9 -15
- package/dist/types/tools/search-tool-bm25.d.ts +9 -10
- package/dist/types/tools/search.d.ts +16 -17
- package/dist/types/tools/ssh.d.ts +14 -15
- package/dist/types/tools/todo.d.ts +27 -43
- package/dist/types/tools/tts.d.ts +8 -9
- package/dist/types/tools/write.d.ts +9 -10
- package/dist/types/tui/index.d.ts +1 -0
- package/dist/types/tui/width-aware-text.d.ts +23 -0
- package/dist/types/utils/markit.d.ts +10 -1
- package/dist/types/web/search/index.d.ts +17 -28
- package/dist/types/web/search/providers/perplexity.d.ts +0 -2
- package/dist/types/web/search/types.d.ts +32 -26
- package/package.json +14 -13
- package/scripts/omp +1 -1
- package/src/advisor/__tests__/advisor.test.ts +44 -1
- package/src/advisor/advise-tool.ts +34 -11
- package/src/autoresearch/tools/init-experiment.ts +13 -16
- package/src/autoresearch/tools/log-experiment.ts +15 -18
- package/src/autoresearch/tools/run-experiment.ts +3 -3
- package/src/autoresearch/tools/update-notes.ts +4 -4
- package/src/cli/ttsr-cli.ts +995 -0
- package/src/cli-commands.ts +1 -0
- package/src/cli.ts +7 -1
- package/src/commands/ttsr.ts +125 -0
- package/src/commit/agentic/tools/analyze-file.ts +4 -4
- package/src/commit/agentic/tools/git-file-diff.ts +4 -4
- package/src/commit/agentic/tools/git-hunk.ts +7 -5
- package/src/commit/agentic/tools/git-overview.ts +4 -4
- package/src/commit/agentic/tools/propose-changelog.ts +18 -15
- package/src/commit/agentic/tools/propose-commit.ts +6 -6
- package/src/commit/agentic/tools/recent-commits.ts +3 -3
- package/src/commit/agentic/tools/schemas.ts +8 -20
- package/src/commit/agentic/tools/split-commit.ts +19 -23
- package/src/commit/analysis/summary.ts +7 -5
- package/src/commit/changelog/generate.ts +15 -11
- package/src/commit/shared-llm.ts +17 -24
- package/src/config/config-file.ts +13 -15
- package/src/config/keybindings.ts +6 -0
- package/src/config/models-config-schema.ts +206 -179
- package/src/config/settings-schema.ts +34 -0
- package/src/discovery/builtin-rules/index.ts +2 -0
- package/src/discovery/builtin-rules/ts-import-type.md +2 -2
- package/src/discovery/builtin-rules/ts-no-any.md +11 -2
- package/src/discovery/builtin-rules/ts-no-inline-cast-access.md +55 -0
- package/src/edit/hashline/params.ts +12 -11
- package/src/edit/index.ts +5 -4
- package/src/edit/modes/apply-patch.ts +4 -4
- package/src/edit/modes/patch.ts +15 -18
- package/src/edit/modes/replace.ts +13 -17
- package/src/edit/renderer.ts +0 -1
- package/src/eval/agent-bridge.ts +11 -13
- package/src/eval/completion-bridge.ts +25 -17
- package/src/eval/js/context-manager.ts +17 -2
- package/src/eval/js/index.ts +1 -1
- package/src/eval/py/executor.ts +2 -2
- package/src/extensibility/custom-commands/loader.ts +5 -3
- package/src/extensibility/custom-commands/types.ts +6 -3
- package/src/extensibility/custom-tools/loader.ts +4 -2
- package/src/extensibility/custom-tools/types.ts +8 -5
- package/src/extensibility/extensions/loader.ts +4 -2
- package/src/extensibility/extensions/types.ts +6 -3
- package/src/extensibility/hooks/loader.ts +5 -2
- package/src/extensibility/hooks/types.ts +7 -4
- package/src/extensibility/legacy-pi-ai-shim.ts +42 -5
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +113 -0
- package/src/extensibility/plugins/legacy-pi-compat.ts +13 -13
- package/src/extensibility/tool-proxy.ts +4 -1
- package/src/extensibility/typebox.ts +778 -251
- package/src/goals/guided-setup.ts +12 -3
- package/src/goals/tools/goal-tool.ts +6 -6
- package/src/index.ts +2 -0
- package/src/internal-urls/docs-index.generated.ts +11 -9
- package/src/lsp/types.ts +13 -27
- package/src/main.ts +19 -18
- package/src/mcp/client.ts +38 -13
- package/src/mcp/render.ts +102 -89
- package/src/modes/components/agent-hub.ts +11 -4
- package/src/modes/components/btw-panel.ts +5 -1
- package/src/modes/components/custom-editor.ts +18 -0
- package/src/modes/components/status-line/component.ts +8 -1
- package/src/modes/components/tool-execution.ts +17 -10
- package/src/modes/controllers/btw-controller.ts +69 -1
- package/src/modes/controllers/input-controller.ts +29 -0
- package/src/modes/interactive-mode.ts +38 -8
- package/src/modes/setup-wizard/index.ts +1 -0
- package/src/modes/setup-wizard/scenes/sign-in.ts +77 -5
- package/src/modes/setup-wizard/startup-splash.ts +107 -0
- package/src/modes/theme/theme.ts +133 -143
- package/src/modes/types.ts +3 -0
- package/src/modes/utils/context-usage.ts +9 -5
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/prompts/system/system-prompt.md +1 -0
- package/src/sdk.ts +21 -4
- package/src/session/agent-session.ts +173 -33
- package/src/session/session-history-format.ts +11 -2
- package/src/session/snapcompact-inline.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +3 -10
- package/src/startup-splash.ts +19 -0
- package/src/task/executor.ts +11 -6
- package/src/task/types.ts +44 -41
- package/src/tool-discovery/tool-index.ts +17 -4
- package/src/tools/ask.ts +14 -14
- package/src/tools/ast-edit.ts +17 -14
- package/src/tools/ast-grep.ts +10 -9
- package/src/tools/bash.ts +15 -10
- package/src/tools/browser/launch.ts +13 -0
- package/src/tools/browser.ts +26 -32
- package/src/tools/checkpoint.ts +7 -7
- package/src/tools/debug.ts +72 -69
- package/src/tools/eval.ts +18 -19
- package/src/tools/find.ts +20 -13
- package/src/tools/gh.ts +29 -49
- package/src/tools/image-gen.ts +27 -32
- package/src/tools/inspect-image.ts +8 -9
- package/src/tools/irc.ts +12 -12
- package/src/tools/job.ts +6 -6
- package/src/tools/learn.ts +11 -14
- package/src/tools/manage-skill.ts +19 -23
- package/src/tools/memory-edit.ts +8 -8
- package/src/tools/memory-recall.ts +4 -4
- package/src/tools/memory-reflect.ts +5 -5
- package/src/tools/memory-retain.ts +9 -11
- package/src/tools/puppeteer/02_stealth_hairline.txt +1 -1
- package/src/tools/puppeteer/04_stealth_iframe.txt +4 -4
- package/src/tools/puppeteer/05_stealth_webgl.txt +1 -1
- package/src/tools/puppeteer/10_stealth_plugins.txt +6 -4
- package/src/tools/puppeteer/12_stealth_codecs.txt +2 -2
- package/src/tools/puppeteer/13_stealth_worker.txt +1 -1
- package/src/tools/read.ts +169 -13
- package/src/tools/report-tool-issue.ts +6 -6
- package/src/tools/resolve.ts +6 -6
- package/src/tools/review.ts +10 -12
- package/src/tools/search-tool-bm25.ts +5 -5
- package/src/tools/search.ts +20 -29
- package/src/tools/ssh.ts +8 -8
- package/src/tools/todo.ts +16 -19
- package/src/tools/tts.ts +16 -15
- package/src/tools/write.ts +5 -5
- package/src/tui/index.ts +1 -0
- package/src/tui/width-aware-text.ts +58 -0
- package/src/utils/markit.ts +17 -2
- package/src/web/search/index.ts +9 -9
- package/src/web/search/providers/perplexity.ts +373 -126
- package/src/web/search/types.ts +28 -48
|
@@ -7,12 +7,11 @@
|
|
|
7
7
|
* LSP writethrough, fs-cache invalidation, diagnostics) is shared with
|
|
8
8
|
* the `patch` mode.
|
|
9
9
|
*/
|
|
10
|
-
import { z } from "zod/v4";
|
|
11
10
|
import type { PatchEditEntry } from "./patch";
|
|
12
|
-
export declare const applyPatchSchema:
|
|
13
|
-
input:
|
|
14
|
-
},
|
|
15
|
-
export type ApplyPatchParams =
|
|
11
|
+
export declare const applyPatchSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
12
|
+
input: string;
|
|
13
|
+
}, {}>;
|
|
14
|
+
export type ApplyPatchParams = typeof applyPatchSchema.infer;
|
|
16
15
|
export type ApplyPatchEntry = PatchEditEntry & {
|
|
17
16
|
path: string;
|
|
18
17
|
};
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* for robust handling of whitespace and formatting differences.
|
|
6
6
|
*/
|
|
7
7
|
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
8
|
-
import { z } from "zod/v4";
|
|
9
8
|
import { type WritethroughCallback, type WritethroughDeferredHandle } from "../../lsp";
|
|
10
9
|
import type { ToolSession } from "../../tools";
|
|
11
10
|
import type { EditToolDetails, LspBatchRequest } from "../renderer";
|
|
@@ -61,29 +60,21 @@ export declare function computePatchDiff(input: PatchInput, cwd: string, options
|
|
|
61
60
|
} | {
|
|
62
61
|
error: string;
|
|
63
62
|
}>;
|
|
64
|
-
export declare const patchEditEntrySchema:
|
|
65
|
-
op
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
update: "update";
|
|
80
|
-
}>>;
|
|
81
|
-
rename: z.ZodOptional<z.ZodString>;
|
|
82
|
-
diff: z.ZodOptional<z.ZodString>;
|
|
83
|
-
}, z.core.$strict>>;
|
|
84
|
-
}, z.core.$strict>;
|
|
85
|
-
export type PatchEditEntry = z.infer<typeof patchEditEntrySchema>;
|
|
86
|
-
export type PatchParams = z.infer<typeof patchEditSchema>;
|
|
63
|
+
export declare const patchEditEntrySchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
64
|
+
op?: "create" | "delete" | "update" | undefined;
|
|
65
|
+
rename?: string | undefined;
|
|
66
|
+
diff?: string | undefined;
|
|
67
|
+
}, {}>;
|
|
68
|
+
export type PatchEditEntry = typeof patchEditEntrySchema.infer;
|
|
69
|
+
export declare const patchEditSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
70
|
+
path: string;
|
|
71
|
+
edits: {
|
|
72
|
+
op?: "create" | "delete" | "update" | undefined;
|
|
73
|
+
rename?: string | undefined;
|
|
74
|
+
diff?: string | undefined;
|
|
75
|
+
}[];
|
|
76
|
+
}, {}>;
|
|
77
|
+
export type PatchParams = typeof patchEditSchema.infer;
|
|
87
78
|
export interface ExecutePatchSingleOptions {
|
|
88
79
|
session: ToolSession;
|
|
89
80
|
path: string;
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* fallback strategies for finding text in files.
|
|
6
6
|
*/
|
|
7
7
|
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
8
|
-
import { z } from "zod/v4";
|
|
9
8
|
import type { WritethroughCallback, WritethroughDeferredHandle } from "../../lsp";
|
|
10
9
|
import type { ToolSession } from "../../tools";
|
|
11
10
|
import type { EditToolDetails, LspBatchRequest } from "../renderer";
|
|
@@ -113,21 +112,21 @@ export declare function findContextLine(lines: string[], context: string, startF
|
|
|
113
112
|
allowFuzzy?: boolean;
|
|
114
113
|
skipFunctionFallback?: boolean;
|
|
115
114
|
}): ContextLineResult;
|
|
116
|
-
export declare const replaceEditEntrySchema:
|
|
117
|
-
old_text:
|
|
118
|
-
new_text:
|
|
119
|
-
all
|
|
120
|
-
},
|
|
121
|
-
export declare const replaceEditSchema:
|
|
122
|
-
path:
|
|
123
|
-
edits:
|
|
124
|
-
old_text:
|
|
125
|
-
new_text:
|
|
126
|
-
all
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
export type ReplaceEditEntry =
|
|
130
|
-
export type ReplaceParams =
|
|
115
|
+
export declare const replaceEditEntrySchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
116
|
+
old_text: string;
|
|
117
|
+
new_text: string;
|
|
118
|
+
all?: boolean | undefined;
|
|
119
|
+
}, {}>;
|
|
120
|
+
export declare const replaceEditSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
121
|
+
path: string;
|
|
122
|
+
edits: {
|
|
123
|
+
old_text: string;
|
|
124
|
+
new_text: string;
|
|
125
|
+
all?: boolean | undefined;
|
|
126
|
+
}[];
|
|
127
|
+
}, {}>;
|
|
128
|
+
export type ReplaceEditEntry = typeof replaceEditEntrySchema.infer;
|
|
129
|
+
export type ReplaceParams = typeof replaceEditSchema.infer;
|
|
131
130
|
export interface ExecuteReplaceSingleOptions {
|
|
132
131
|
session: ToolSession;
|
|
133
132
|
path: string;
|
|
@@ -139,4 +138,4 @@ export interface ExecuteReplaceSingleOptions {
|
|
|
139
138
|
writethrough: WritethroughCallback;
|
|
140
139
|
beginDeferredDiagnosticsForPath: (path: string) => WritethroughDeferredHandle;
|
|
141
140
|
}
|
|
142
|
-
export declare function executeReplaceSingle(options: ExecuteReplaceSingleOptions): Promise<AgentToolResult<EditToolDetails,
|
|
141
|
+
export declare function executeReplaceSingle(options: ExecuteReplaceSingleOptions): Promise<AgentToolResult<EditToolDetails, ReplaceEditEntry>>;
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* Unlike markdown commands which expand to prompts, custom commands can execute
|
|
6
6
|
* arbitrary logic with full access to the hook context.
|
|
7
7
|
*/
|
|
8
|
-
import type
|
|
8
|
+
import type * as arktype from "arktype";
|
|
9
|
+
import type * as zod from "zod/v4";
|
|
9
10
|
import type { ExecOptions, ExecResult, HookCommandContext } from "../../extensibility/hooks/types";
|
|
10
11
|
import type * as PiCodingAgent from "../../index";
|
|
11
12
|
import type * as TypeBox from "../typebox";
|
|
@@ -21,8 +22,10 @@ export interface CustomCommandAPI {
|
|
|
21
22
|
exec(command: string, args: string[], options?: ExecOptions): Promise<ExecResult>;
|
|
22
23
|
/** Injected zod-backed typebox shim (legacy/compat). */
|
|
23
24
|
typebox: typeof TypeBox;
|
|
24
|
-
/** Injected
|
|
25
|
-
|
|
25
|
+
/** Injected arktype module for validation in custom commands. */
|
|
26
|
+
arktype: typeof arktype;
|
|
27
|
+
/** Injected zod/v4 module for canonical command validation. */
|
|
28
|
+
zod: typeof zod;
|
|
26
29
|
/** Injected pi-coding-agent exports */
|
|
27
30
|
pi: typeof PiCodingAgent;
|
|
28
31
|
}
|
|
@@ -9,7 +9,8 @@ import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
|
|
|
9
9
|
import type { FetchImpl, Model, Static, TSchema } from "@oh-my-pi/pi-ai";
|
|
10
10
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
11
11
|
import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
|
|
12
|
-
import type {
|
|
12
|
+
import type { type as ArkType } from "arktype";
|
|
13
|
+
import type * as zod from "zod/v4";
|
|
13
14
|
import type { Rule } from "../../capability/rule";
|
|
14
15
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
15
16
|
import type { Settings } from "../../config/settings";
|
|
@@ -50,10 +51,12 @@ export interface CustomToolAPI {
|
|
|
50
51
|
hasUI: boolean;
|
|
51
52
|
/** File logger for error/warning/debug messages */
|
|
52
53
|
logger: typeof PiLogger;
|
|
53
|
-
/** Injected
|
|
54
|
+
/** Injected typebox shim (legacy/compat — arktype-authored tools are preferred). */
|
|
54
55
|
typebox: typeof TypeBox;
|
|
55
|
-
/** Injected
|
|
56
|
-
|
|
56
|
+
/** Injected arktype module for arktype-authored custom tools. */
|
|
57
|
+
arktype: typeof ArkType;
|
|
58
|
+
/** Injected zod/v4 module for canonical parameter schemas. */
|
|
59
|
+
zod: typeof zod;
|
|
57
60
|
/** Injected pi-coding-agent exports */
|
|
58
61
|
pi: typeof PiCodingAgent;
|
|
59
62
|
/** Push a preview action that can later be resolved with the hidden resolve tool */
|
|
@@ -172,7 +175,7 @@ export interface CustomTool<TParams extends TSchema = TSchema, TDetails = any> {
|
|
|
172
175
|
strict?: boolean;
|
|
173
176
|
/** Description for LLM */
|
|
174
177
|
description: string;
|
|
175
|
-
/** Parameter schema (
|
|
178
|
+
/** Parameter schema (arktype, TypeBox, or legacy formats). */
|
|
176
179
|
parameters: TParams;
|
|
177
180
|
/** If true, tool is excluded unless explicitly listed in --tools or agent's tools field */
|
|
178
181
|
hidden?: boolean;
|
|
@@ -13,7 +13,8 @@ import type { Api, AssistantMessageEvent, AssistantMessageEventStream, Context,
|
|
|
13
13
|
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/oauth/types";
|
|
14
14
|
import type { AutocompleteItem, Component, EditorTheme, KeyId, TUI } from "@oh-my-pi/pi-tui";
|
|
15
15
|
import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
|
|
16
|
-
import type {
|
|
16
|
+
import type { Type as arktype } from "arktype";
|
|
17
|
+
import type * as zod from "zod/v4";
|
|
17
18
|
import type { KeybindingsManager } from "../../config/keybindings";
|
|
18
19
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
19
20
|
import type { EditToolDetails } from "../../edit";
|
|
@@ -601,8 +602,10 @@ export interface ExtensionAPI {
|
|
|
601
602
|
logger: typeof PiLogger;
|
|
602
603
|
/** Injected zod-backed typebox shim for legacy `Type.Object(...)` parameter authoring. */
|
|
603
604
|
typebox: typeof TypeBox;
|
|
604
|
-
/** Injected
|
|
605
|
-
|
|
605
|
+
/** Injected arktype module for arktype-authored extension tools (canonical going forward). */
|
|
606
|
+
arktype: typeof arktype;
|
|
607
|
+
/** Injected zod/v4 module for canonical extension tool parameter schemas. */
|
|
608
|
+
zod: typeof zod;
|
|
606
609
|
/** Injected pi-coding-agent exports for accessing SDK utilities */
|
|
607
610
|
pi: typeof PiCodingAgent;
|
|
608
611
|
on(event: "resources_discover", handler: ExtensionHandler<ResourcesDiscoverEvent, ResourcesDiscoverResult>): void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ImageContent, Message, Model, TextContent } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import type { Component, TUI } from "@oh-my-pi/pi-tui";
|
|
3
3
|
import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
|
|
4
|
-
import type {
|
|
4
|
+
import type { Type } from "arktype";
|
|
5
|
+
import type * as zod from "zod/v4";
|
|
5
6
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
6
7
|
import type { EditToolDetails } from "../../edit";
|
|
7
8
|
import type { ExecOptions, ExecResult } from "../../exec/exec";
|
|
@@ -417,10 +418,12 @@ export interface HookAPI {
|
|
|
417
418
|
exec(command: string, args: string[], options?: ExecOptions): Promise<ExecResult>;
|
|
418
419
|
/** File logger for error/warning/debug messages */
|
|
419
420
|
logger: typeof PiLogger;
|
|
420
|
-
/** Injected zod-backed typebox shim (legacy/compat — prefer `
|
|
421
|
+
/** Injected zod-backed typebox shim (legacy/compat — prefer `arktype`). */
|
|
421
422
|
typebox: typeof TypeBox;
|
|
422
|
-
/** Injected
|
|
423
|
-
|
|
423
|
+
/** Injected arktype module for arktype-authored hooks. */
|
|
424
|
+
arktype: typeof Type;
|
|
425
|
+
/** Injected zod/v4 module for canonical hook validation. */
|
|
426
|
+
zod: typeof zod;
|
|
424
427
|
/** Injected pi-coding-agent exports */
|
|
425
428
|
pi: typeof PiCodingAgent;
|
|
426
429
|
}
|
|
@@ -11,13 +11,21 @@
|
|
|
11
11
|
* bare package root. Subpath imports (`@oh-my-pi/pi-ai/oauth`, etc.)
|
|
12
12
|
* continue to resolve directly against the bundled pi-ai package.
|
|
13
13
|
*
|
|
14
|
-
* The `Type` runtime
|
|
15
|
-
* already serves
|
|
16
|
-
* class, keeping the legacy-compat surface internally consistent.
|
|
14
|
+
* The `Type` runtime and legacy `StringEnum()` helper are borrowed from the
|
|
15
|
+
* Zod-backed TypeBox shim that already serves TypeBox imports for the same
|
|
16
|
+
* extension class, keeping the legacy-compat surface internally consistent.
|
|
17
17
|
*
|
|
18
18
|
* Type-level `Static` and `TSchema` continue to come from pi-ai's own
|
|
19
19
|
* `types.ts` via the `export *` below — pi-ai still exports both as types,
|
|
20
|
-
* only the runtime `Type` builder
|
|
20
|
+
* only the runtime `Type` builder and `StringEnum()` helper were removed.
|
|
21
21
|
*/
|
|
22
|
+
import { type TSchema, Type } from "./typebox";
|
|
23
|
+
export interface StringEnumOptions<T extends string> {
|
|
24
|
+
description?: string;
|
|
25
|
+
default?: T;
|
|
26
|
+
examples?: T[];
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
export declare function StringEnum<T extends string>(values: readonly T[], options?: StringEnumOptions<T>): TSchema;
|
|
22
30
|
export * from "@oh-my-pi/pi-ai";
|
|
23
|
-
export { Type }
|
|
31
|
+
export { Type };
|
|
@@ -11,4 +11,21 @@
|
|
|
11
11
|
* entry, while still re-exporting the canonical surface so plugins observe
|
|
12
12
|
* the same module identity as a direct `@oh-my-pi/pi-coding-agent` import.
|
|
13
13
|
*/
|
|
14
|
+
import type { TSchema } from "@oh-my-pi/pi-ai";
|
|
15
|
+
import { Settings } from "../config/settings";
|
|
16
|
+
import type { ToolDefinition } from "./extensions/types";
|
|
17
|
+
import { Type } from "./typebox";
|
|
18
|
+
export interface ParsedFrontmatter<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
19
|
+
frontmatter: T;
|
|
20
|
+
body: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function parseFrontmatter<T extends Record<string, unknown> = Record<string, unknown>>(content: string): ParsedFrontmatter<T>;
|
|
23
|
+
export declare function stripFrontmatter(content: string): string;
|
|
24
|
+
export declare function defineTool<TParams extends TSchema = TSchema, TDetails = unknown>(tool: ToolDefinition<TParams, TDetails>): ToolDefinition<TParams, TDetails>;
|
|
25
|
+
export declare function createCodingTools(cwd: string): ToolDefinition[];
|
|
26
|
+
export declare const SettingsManager: {
|
|
27
|
+
readonly create: (cwd: string, agentDir?: string) => Promise<Settings>;
|
|
28
|
+
readonly inMemory: () => Settings;
|
|
29
|
+
};
|
|
14
30
|
export * from "../index";
|
|
31
|
+
export { Type };
|
|
@@ -1,45 +1,67 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Minimal `@sinclair/typebox` runtime compatibility shim
|
|
2
|
+
* Minimal `@sinclair/typebox` runtime compatibility shim.
|
|
3
3
|
*
|
|
4
4
|
* Historically the coding agent injected the real `@sinclair/typebox` (~5MB
|
|
5
5
|
* dependency) into extensions, hooks, custom tools, and custom commands so
|
|
6
6
|
* they could author parameter schemas as `Type.Object({ name: Type.String() })`.
|
|
7
|
-
* Internally everything already runs through Zod (`wire.ts`, `validation.ts`);
|
|
8
|
-
* the only reason TypeBox remained was extension-author compat.
|
|
9
7
|
*
|
|
10
|
-
* This module
|
|
11
|
-
* return Zod schemas. Output is indistinguishable from hand-written Zod inside
|
|
12
|
-
* the agent pipeline:
|
|
8
|
+
* This module provides the subset those integrations depend on:
|
|
13
9
|
*
|
|
14
|
-
* -
|
|
15
|
-
* - `
|
|
16
|
-
*
|
|
10
|
+
* - TypeBox-style `Type.*` builders.
|
|
11
|
+
* - Runtime validation through `schema.safeParse(input)` and `schema.__validator(input)`.
|
|
12
|
+
* - Enumerable JSON Schema keywords so `{ ...schema }`, `JSON.stringify(schema)`,
|
|
13
|
+
* and `toolWireSchema({ parameters: schema })` all see the same schema.
|
|
17
14
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* `@sinclair/typebox` directly in their own package.
|
|
15
|
+
* Internal validator fields and methods are intentionally non-enumerable. The
|
|
16
|
+
* object should look like JSON Schema at every serialization/wire boundary and
|
|
17
|
+
* like a small validator at runtime.
|
|
22
18
|
*/
|
|
23
|
-
|
|
24
|
-
export type
|
|
25
|
-
export type
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
30
|
-
export type
|
|
31
|
-
export type
|
|
32
|
-
export type
|
|
33
|
-
export type
|
|
34
|
-
export type
|
|
35
|
-
export type
|
|
36
|
-
export type
|
|
37
|
-
export type
|
|
38
|
-
export type
|
|
39
|
-
export type
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
export type TSchema = ArkSchema;
|
|
20
|
+
export type Static<T extends ArkSchema> = T["__infer"];
|
|
21
|
+
export type TAny = ArkSchema;
|
|
22
|
+
export type TUnknown = ArkSchema;
|
|
23
|
+
export type TNever = ArkSchema;
|
|
24
|
+
export type TNull = ArkSchema;
|
|
25
|
+
export type TString = ArkSchema;
|
|
26
|
+
export type TNumber = ArkSchema;
|
|
27
|
+
export type TInteger = ArkSchema;
|
|
28
|
+
export type TBoolean = ArkSchema;
|
|
29
|
+
export type TLiteral<_V extends string | number | boolean> = ArkSchema;
|
|
30
|
+
export type TArray<_E extends ArkSchema> = ArkSchema;
|
|
31
|
+
export type TObject<_P extends Record<string, ArkSchema> = Record<string, ArkSchema>> = ArkSchema;
|
|
32
|
+
export type TOptional<_E extends ArkSchema> = ArkSchema;
|
|
33
|
+
export type TUnion<_T extends readonly ArkSchema[] = readonly ArkSchema[]> = ArkSchema;
|
|
34
|
+
export type TEnum<_T extends readonly (string | number)[] = readonly (string | number)[]> = ArkSchema;
|
|
35
|
+
export type TRecord<_K extends ArkSchema, _V extends ArkSchema> = ArkSchema;
|
|
36
|
+
declare const VALIDATION_FAILURE: unique symbol;
|
|
37
|
+
interface ValidationFailure {
|
|
38
|
+
message: string;
|
|
39
|
+
readonly [VALIDATION_FAILURE]: true;
|
|
40
|
+
}
|
|
41
|
+
interface SafeParseSuccess {
|
|
42
|
+
success: true;
|
|
43
|
+
data: unknown;
|
|
44
|
+
}
|
|
45
|
+
interface SafeParseFailure {
|
|
46
|
+
success: false;
|
|
47
|
+
error: ValidationFailure;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* JSON-Schema-shaped object with non-enumerable runtime helpers.
|
|
51
|
+
* Validators return the validated data or a marked `{ message }` failure.
|
|
52
|
+
*/
|
|
53
|
+
interface ArkSchema {
|
|
54
|
+
__validator: (data: unknown) => unknown;
|
|
55
|
+
__metadata?: Record<string, unknown>;
|
|
56
|
+
__optional?: true;
|
|
57
|
+
__properties?: Record<string, ArkSchema>;
|
|
58
|
+
__additionalProperties?: boolean | ArkSchema;
|
|
59
|
+
__infer?: unknown;
|
|
60
|
+
__inner?: ArkSchema;
|
|
61
|
+
safeParse(input: unknown): SafeParseSuccess | SafeParseFailure;
|
|
62
|
+
toJSON(): Record<string, unknown>;
|
|
63
|
+
[key: string]: unknown;
|
|
64
|
+
}
|
|
43
65
|
interface Meta {
|
|
44
66
|
title?: string;
|
|
45
67
|
description?: string;
|
|
@@ -70,32 +92,32 @@ interface ObjectOpts extends Meta {
|
|
|
70
92
|
* TypeBox default: extra keys are preserved. Set `false` to reject unknowns,
|
|
71
93
|
* `true` to allow any, or a schema to validate them.
|
|
72
94
|
*/
|
|
73
|
-
additionalProperties?: boolean |
|
|
95
|
+
additionalProperties?: boolean | ArkSchema;
|
|
74
96
|
}
|
|
75
|
-
declare function tString(opts?: StringOpts):
|
|
76
|
-
declare function tNumber(opts?: NumberOpts):
|
|
77
|
-
declare function tInteger(opts?: NumberOpts):
|
|
78
|
-
declare function tBoolean(opts?: Meta):
|
|
79
|
-
declare function tNull(opts?: Meta):
|
|
80
|
-
declare function tAny(opts?: Meta):
|
|
81
|
-
declare function tUnknown(opts?: Meta):
|
|
82
|
-
declare function tNever(opts?: Meta):
|
|
83
|
-
declare function tLiteral<V extends string | number | boolean>(value: V, opts?: Meta):
|
|
84
|
-
declare function tUnion<T extends readonly
|
|
85
|
-
declare function tIntersect(schemas: readonly
|
|
86
|
-
declare function tEnum<T extends Record<string, string | number> | readonly (string | number)[]>(values: T, opts?: Meta):
|
|
87
|
-
declare function tArray<E extends
|
|
88
|
-
declare function tTuple(items: readonly
|
|
89
|
-
declare function tObject<P extends
|
|
90
|
-
declare function tRecord<V extends
|
|
91
|
-
declare function tOptional<E extends
|
|
92
|
-
declare function tNullable<E extends
|
|
93
|
-
declare function tReadonly<E extends
|
|
94
|
-
declare function tPartial<
|
|
95
|
-
declare function tRequired<
|
|
96
|
-
declare function tPick<P extends
|
|
97
|
-
declare function tOmit<P extends
|
|
98
|
-
declare function tComposite(objects: readonly
|
|
97
|
+
declare function tString(opts?: StringOpts): ArkSchema;
|
|
98
|
+
declare function tNumber(opts?: NumberOpts): ArkSchema;
|
|
99
|
+
declare function tInteger(opts?: NumberOpts): ArkSchema;
|
|
100
|
+
declare function tBoolean(opts?: Meta): ArkSchema;
|
|
101
|
+
declare function tNull(opts?: Meta): ArkSchema;
|
|
102
|
+
declare function tAny(opts?: Meta): ArkSchema;
|
|
103
|
+
declare function tUnknown(opts?: Meta): ArkSchema;
|
|
104
|
+
declare function tNever(opts?: Meta): ArkSchema;
|
|
105
|
+
declare function tLiteral<V extends string | number | boolean>(value: V, opts?: Meta): ArkSchema;
|
|
106
|
+
declare function tUnion<T extends readonly ArkSchema[]>(schemas: T, opts?: Meta): ArkSchema;
|
|
107
|
+
declare function tIntersect(schemas: readonly ArkSchema[], opts?: Meta): ArkSchema;
|
|
108
|
+
declare function tEnum<T extends Record<string, string | number> | readonly (string | number)[]>(values: T, opts?: Meta): ArkSchema;
|
|
109
|
+
declare function tArray<E extends ArkSchema>(item: E, opts?: ArrayOpts): ArkSchema;
|
|
110
|
+
declare function tTuple(items: readonly ArkSchema[], opts?: Meta): ArkSchema;
|
|
111
|
+
declare function tObject<P extends Record<string, ArkSchema>>(properties: P, opts?: ObjectOpts): ArkSchema;
|
|
112
|
+
declare function tRecord<K extends ArkSchema, V extends ArkSchema>(key: K, value: V, opts?: Meta): ArkSchema;
|
|
113
|
+
declare function tOptional<E extends ArkSchema>(schema: E, opts?: Meta): ArkSchema;
|
|
114
|
+
declare function tNullable<E extends ArkSchema>(schema: E, opts?: Meta): ArkSchema;
|
|
115
|
+
declare function tReadonly<E extends ArkSchema>(schema: E): ArkSchema;
|
|
116
|
+
declare function tPartial<_P extends Record<string, ArkSchema>>(obj: ArkSchema): ArkSchema;
|
|
117
|
+
declare function tRequired<_P extends Record<string, ArkSchema>>(obj: ArkSchema): ArkSchema;
|
|
118
|
+
declare function tPick<P extends Record<string, ArkSchema>, K extends keyof P>(obj: ArkSchema, keys: readonly K[]): ArkSchema;
|
|
119
|
+
declare function tOmit<P extends Record<string, ArkSchema>, K extends keyof P>(obj: ArkSchema, keys: readonly K[]): ArkSchema;
|
|
120
|
+
declare function tComposite(objects: readonly ArkSchema[], opts?: Meta): ArkSchema;
|
|
99
121
|
export declare const Type: {
|
|
100
122
|
readonly String: typeof tString;
|
|
101
123
|
readonly Number: typeof tNumber;
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
|
-
import { z } from "zod/v4";
|
|
4
3
|
import type { RenderResultOptions } from "../../extensibility/custom-tools/types";
|
|
5
4
|
import type { Theme } from "../../modes/theme/theme";
|
|
6
5
|
import type { ToolSession } from "../../tools";
|
|
7
6
|
import type { Goal, GoalToolDetails } from "../state";
|
|
8
|
-
declare const goalSchema:
|
|
9
|
-
op:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
resume: "resume";
|
|
15
|
-
}>;
|
|
16
|
-
objective: z.ZodOptional<z.ZodString>;
|
|
17
|
-
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
export type GoalToolInput = z.infer<typeof goalSchema>;
|
|
7
|
+
declare const goalSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
8
|
+
op: "complete" | "create" | "drop" | "get" | "resume";
|
|
9
|
+
objective?: string | undefined;
|
|
10
|
+
token_budget?: number | undefined;
|
|
11
|
+
}, {}>;
|
|
12
|
+
export type GoalToolInput = typeof goalSchema.infer;
|
|
20
13
|
export interface GoalToolResponse {
|
|
21
14
|
goal: Goal | null;
|
|
22
15
|
remainingTokens: number | null;
|
|
@@ -30,17 +23,11 @@ export declare class GoalTool implements AgentTool<typeof goalSchema, GoalToolDe
|
|
|
30
23
|
readonly name = "goal";
|
|
31
24
|
readonly label = "Goal";
|
|
32
25
|
readonly description: string;
|
|
33
|
-
readonly parameters:
|
|
34
|
-
op:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
get: "get";
|
|
39
|
-
resume: "resume";
|
|
40
|
-
}>;
|
|
41
|
-
objective: z.ZodOptional<z.ZodString>;
|
|
42
|
-
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
43
|
-
}, z.core.$strip>;
|
|
26
|
+
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
27
|
+
op: "complete" | "create" | "drop" | "get" | "resume";
|
|
28
|
+
objective?: string | undefined;
|
|
29
|
+
token_budget?: number | undefined;
|
|
30
|
+
}, {}>;
|
|
44
31
|
readonly strict = true;
|
|
45
32
|
readonly intent: "omit";
|
|
46
33
|
constructor(session: ToolSession);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { HookEditorComponent, HookInputComponent, HookSelectorComponent } from "./modes/components";
|
|
2
2
|
export { Container, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui";
|
|
3
3
|
export { getAgentDir, logger, VERSION } from "@oh-my-pi/pi-utils";
|
|
4
|
+
export * as zod from "zod/v4";
|
|
5
|
+
export { z } from "zod/v4";
|
|
4
6
|
export * from "./config/keybindings";
|
|
5
7
|
export * from "./config/model-registry";
|
|
6
8
|
export type * from "./config/prompt-templates";
|
|
@@ -102,32 +102,17 @@ export declare class LspTool implements AgentTool<typeof lspSchema, LspToolDetai
|
|
|
102
102
|
readonly loadMode = "discoverable";
|
|
103
103
|
readonly summary = "Query LSP (language server) for diagnostics, hover info, and references";
|
|
104
104
|
readonly description: string;
|
|
105
|
-
readonly parameters: import("
|
|
106
|
-
action:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
rename_file: "rename_file";
|
|
117
|
-
request: "request";
|
|
118
|
-
status: "status";
|
|
119
|
-
symbols: "symbols";
|
|
120
|
-
type_definition: "type_definition";
|
|
121
|
-
}>;
|
|
122
|
-
file: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
|
123
|
-
line: import("zod/v4").ZodOptional<import("zod/v4").ZodNumber>;
|
|
124
|
-
symbol: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
|
125
|
-
query: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
|
126
|
-
new_name: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
|
127
|
-
apply: import("zod/v4").ZodOptional<import("zod/v4").ZodBoolean>;
|
|
128
|
-
timeout: import("zod/v4").ZodOptional<import("zod/v4").ZodNumber>;
|
|
129
|
-
payload: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
|
130
|
-
}, import("zod/v4/core").$strip>;
|
|
105
|
+
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
106
|
+
action: "capabilities" | "code_actions" | "definition" | "diagnostics" | "hover" | "implementation" | "references" | "reload" | "rename" | "rename_file" | "request" | "status" | "symbols" | "type_definition";
|
|
107
|
+
file?: string | undefined;
|
|
108
|
+
line?: number | undefined;
|
|
109
|
+
symbol?: string | undefined;
|
|
110
|
+
query?: string | undefined;
|
|
111
|
+
new_name?: string | undefined;
|
|
112
|
+
apply?: boolean | undefined;
|
|
113
|
+
timeout?: number | undefined;
|
|
114
|
+
payload?: string | undefined;
|
|
115
|
+
}, {}>;
|
|
131
116
|
readonly strict = true;
|
|
132
117
|
constructor(session: ToolSession);
|
|
133
118
|
static createIf(session: ToolSession): LspTool | null;
|
|
@@ -1,32 +1,16 @@
|
|
|
1
1
|
import type { ptree } from "@oh-my-pi/pi-utils";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
rename_file: "rename_file";
|
|
15
|
-
request: "request";
|
|
16
|
-
status: "status";
|
|
17
|
-
symbols: "symbols";
|
|
18
|
-
type_definition: "type_definition";
|
|
19
|
-
}>;
|
|
20
|
-
file: z.ZodOptional<z.ZodString>;
|
|
21
|
-
line: z.ZodOptional<z.ZodNumber>;
|
|
22
|
-
symbol: z.ZodOptional<z.ZodString>;
|
|
23
|
-
query: z.ZodOptional<z.ZodString>;
|
|
24
|
-
new_name: z.ZodOptional<z.ZodString>;
|
|
25
|
-
apply: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
-
timeout: z.ZodOptional<z.ZodNumber>;
|
|
27
|
-
payload: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}, z.core.$strip>;
|
|
29
|
-
export type LspParams = z.infer<typeof lspSchema>;
|
|
2
|
+
export declare const lspSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
action: "capabilities" | "code_actions" | "definition" | "diagnostics" | "hover" | "implementation" | "references" | "reload" | "rename" | "rename_file" | "request" | "status" | "symbols" | "type_definition";
|
|
4
|
+
file?: string | undefined;
|
|
5
|
+
line?: number | undefined;
|
|
6
|
+
symbol?: string | undefined;
|
|
7
|
+
query?: string | undefined;
|
|
8
|
+
new_name?: string | undefined;
|
|
9
|
+
apply?: boolean | undefined;
|
|
10
|
+
timeout?: number | undefined;
|
|
11
|
+
payload?: string | undefined;
|
|
12
|
+
}, {}>;
|
|
13
|
+
export type LspParams = typeof lspSchema.infer;
|
|
30
14
|
export interface LspToolDetails {
|
|
31
15
|
serverName?: string;
|
|
32
16
|
action: string;
|
|
@@ -35,6 +35,14 @@ export declare function listResources(connection: MCPServerConnection, options?:
|
|
|
35
35
|
}): Promise<MCPResource[]>;
|
|
36
36
|
/**
|
|
37
37
|
* List resource templates from a connected server.
|
|
38
|
+
*
|
|
39
|
+
* A server MAY advertise the `resources` capability without implementing the
|
|
40
|
+
* optional `resources/templates/list` method (it is optional in the MCP spec).
|
|
41
|
+
* Such servers reject the request with JSON-RPC -32601 ("Method not found").
|
|
42
|
+
* Treat that as "no templates" and return `[]` rather than throwing — otherwise
|
|
43
|
+
* a caller that loads resources and templates together (see `MCPManager`'s
|
|
44
|
+
* `Promise.all([listResources, listResourceTemplates])`) would discard the
|
|
45
|
+
* server's concrete resources too. Any other error still propagates.
|
|
38
46
|
*/
|
|
39
47
|
export declare function listResourceTemplates(connection: MCPServerConnection, options?: {
|
|
40
48
|
signal?: AbortSignal;
|