@oh-my-pi/pi-coding-agent 17.2.6 → 17.2.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 +17 -1
- package/dist/{CHANGELOG-gs76k6wc.md → CHANGELOG-1p8yvde7.md} +17 -1
- package/dist/cli.js +3645 -3689
- package/dist/types/advisor/advise-tool.d.ts +10 -4
- package/dist/types/autoresearch/tools/init-experiment.d.ts +19 -7
- package/dist/types/autoresearch/tools/log-experiment.d.ts +19 -11
- package/dist/types/autoresearch/tools/run-experiment.d.ts +4 -2
- package/dist/types/autoresearch/tools/update-notes.d.ts +5 -2
- package/dist/types/commit/agentic/tools/analyze-file.d.ts +5 -2
- package/dist/types/commit/agentic/tools/git-file-diff.d.ts +5 -2
- package/dist/types/commit/agentic/tools/git-hunk.d.ts +6 -2
- package/dist/types/commit/agentic/tools/git-overview.d.ts +5 -2
- package/dist/types/commit/agentic/tools/propose-changelog.d.ts +29 -7
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +14 -4
- package/dist/types/commit/agentic/tools/recent-commits.d.ts +4 -2
- package/dist/types/commit/agentic/tools/schemas.d.ts +7 -3
- package/dist/types/commit/agentic/tools/split-commit.d.ts +37 -10
- package/dist/types/commit/changelog/generate.d.ts +13 -3
- package/dist/types/commit/shared-llm.d.ts +13 -4
- package/dist/types/config/config-file.d.ts +1 -1
- package/dist/types/config/models-config-schema-bundle.d.ts +1992 -981
- package/dist/types/config/models-config-schema.d.ts +1201 -580
- package/dist/types/config/models-config.d.ts +355 -371
- package/dist/types/edit/hashline/params.d.ts +4 -2
- package/dist/types/edit/modes/apply-patch.d.ts +4 -2
- package/dist/types/edit/modes/patch.d.ts +16 -5
- package/dist/types/edit/modes/replace.d.ts +8 -3
- package/dist/types/eval/bridge-timeout.d.ts +5 -2
- package/dist/types/eval/completion-bridge.d.ts +13 -0
- package/dist/types/eval/py/tool-bridge.d.ts +12 -0
- package/dist/types/extensibility/custom-commands/types.d.ts +4 -4
- package/dist/types/extensibility/custom-tools/types.d.ts +4 -4
- package/dist/types/extensibility/extensions/types.d.ts +4 -4
- package/dist/types/extensibility/hooks/types.d.ts +4 -4
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +1 -1
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +1 -1
- package/dist/types/extensibility/legacy-typebox.d.ts +8 -0
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +6 -13
- package/dist/types/goals/tools/goal-tool.d.ts +12 -4
- package/dist/types/lsp/index.d.ts +15 -5
- package/dist/types/lsp/types.d.ts +15 -5
- package/dist/types/security/contracts/schemas.d.ts +985 -409
- package/dist/types/security/publication.d.ts +92 -34
- package/dist/types/session/agent-session-types.d.ts +1 -1
- package/dist/types/session/session-entries.d.ts +1 -1
- package/dist/types/session/session-manager.d.ts +1 -1
- package/dist/types/task/types.d.ts +63 -18
- package/dist/types/tools/ask.d.ts +34 -8
- package/dist/types/tools/ast-edit.d.ts +16 -4
- package/dist/types/tools/ast-grep.d.ts +12 -4
- package/dist/types/tools/bash.d.ts +20 -11
- package/dist/types/tools/browser.d.ts +64 -20
- package/dist/types/tools/checkpoint.d.ts +16 -8
- package/dist/types/tools/computer.d.ts +1 -1
- package/dist/types/tools/debug.d.ts +118 -48
- package/dist/types/tools/eval.d.ts +11 -5
- package/dist/types/tools/gh.d.ts +74 -26
- package/dist/types/tools/glob.d.ts +16 -6
- package/dist/types/tools/grep.d.ts +18 -6
- package/dist/types/tools/hub/index.d.ts +116 -46
- package/dist/types/tools/image-gen.d.ts +25 -8
- package/dist/types/tools/inspect-image.d.ts +10 -4
- package/dist/types/tools/learn.d.ts +26 -8
- package/dist/types/tools/manage-skill.d.ts +16 -6
- package/dist/types/tools/memory-edit.d.ts +18 -6
- package/dist/types/tools/memory-recall.d.ts +8 -4
- package/dist/types/tools/memory-reflect.d.ts +10 -4
- package/dist/types/tools/memory-retain.d.ts +14 -4
- package/dist/types/tools/read.d.ts +8 -4
- package/dist/types/tools/security-scan.d.ts +82 -30
- package/dist/types/tools/todo.d.ts +30 -10
- package/dist/types/tools/tts.d.ts +12 -5
- package/dist/types/tools/vibe.d.ts +42 -18
- package/dist/types/tools/write.d.ts +10 -4
- package/dist/types/web/search/index.d.ts +20 -6
- package/package.json +13 -13
- package/scripts/legacy-pi-virtual-module.ts +2 -2
- package/src/advisor/advise-tool.ts +1 -1
- package/src/advisor/config.ts +1 -1
- package/src/autoresearch/tools/init-experiment.ts +1 -2
- package/src/autoresearch/tools/log-experiment.ts +1 -2
- package/src/autoresearch/tools/run-experiment.ts +1 -1
- package/src/autoresearch/tools/update-notes.ts +1 -1
- package/src/commit/agentic/tools/analyze-file.ts +1 -1
- package/src/commit/agentic/tools/git-file-diff.ts +1 -1
- package/src/commit/agentic/tools/git-hunk.ts +1 -1
- package/src/commit/agentic/tools/git-overview.ts +1 -1
- package/src/commit/agentic/tools/propose-changelog.ts +1 -1
- package/src/commit/agentic/tools/propose-commit.ts +1 -1
- package/src/commit/agentic/tools/recent-commits.ts +1 -1
- package/src/commit/agentic/tools/schemas.ts +1 -1
- package/src/commit/agentic/tools/split-commit.ts +1 -1
- package/src/commit/analysis/summary.ts +1 -1
- package/src/commit/changelog/generate.ts +1 -1
- package/src/config/config-file.ts +2 -2
- package/src/config/models-config-schema-bundle.ts +1 -8
- package/src/discovery/codex.ts +22 -9
- package/src/edit/hashline/params.ts +1 -1
- package/src/edit/modes/apply-patch.ts +1 -1
- package/src/edit/modes/patch.ts +1 -1
- package/src/edit/modes/replace.ts +2 -1
- package/src/eval/agent-bridge.ts +4 -2
- package/src/eval/bridge-timeout.ts +5 -2
- package/src/eval/completion-bridge.ts +3 -2
- package/src/eval/executor-base.ts +20 -1
- package/src/eval/js/context-manager.ts +94 -6
- package/src/eval/py/tool-bridge.ts +29 -9
- package/src/extensibility/custom-commands/loader.ts +3 -3
- package/src/extensibility/custom-commands/types.ts +4 -4
- package/src/extensibility/custom-tools/loader.ts +3 -3
- package/src/extensibility/custom-tools/types.ts +5 -4
- package/src/extensibility/extensions/loader.ts +3 -3
- package/src/extensibility/extensions/types.ts +5 -4
- package/src/extensibility/hooks/loader.ts +3 -3
- package/src/extensibility/hooks/types.ts +4 -4
- package/src/extensibility/legacy-pi-ai-shim.ts +1 -1
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +2 -2
- package/src/extensibility/legacy-typebox.ts +101 -0
- package/src/extensibility/plugins/legacy-pi-compat.ts +13 -22
- package/src/goals/tools/goal-tool.ts +1 -1
- package/src/lsp/types.ts +1 -1
- package/src/modes/theme/theme.ts +3 -3
- package/src/security/contracts/schemas.ts +1 -5
- package/src/security/contracts/validation.ts +1 -1
- package/src/security/publication.ts +1 -1
- package/src/session/agent-session-types.ts +1 -1
- package/src/session/agent-session.ts +1 -2
- package/src/session/session-context.ts +3 -3
- package/src/session/session-entries.ts +1 -1
- package/src/session/session-manager.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +3 -4
- package/src/task/types.ts +1 -1
- package/src/tools/ask.ts +1 -1
- package/src/tools/ast-edit.ts +1 -1
- package/src/tools/ast-grep.ts +1 -1
- package/src/tools/bash.ts +61 -3
- package/src/tools/browser.ts +1 -1
- package/src/tools/checkpoint.ts +1 -1
- package/src/tools/computer.ts +1 -1
- package/src/tools/debug.ts +1 -1
- package/src/tools/eval.ts +1 -1
- package/src/tools/gh.ts +1 -2
- package/src/tools/glob.ts +1 -1
- package/src/tools/grep.ts +1 -1
- package/src/tools/hub/index.ts +1 -1
- package/src/tools/image-gen.ts +1 -1
- package/src/tools/inspect-image.ts +1 -1
- package/src/tools/learn.ts +1 -1
- package/src/tools/manage-skill.ts +1 -1
- package/src/tools/memory-edit.ts +1 -1
- package/src/tools/memory-recall.ts +1 -1
- package/src/tools/memory-reflect.ts +1 -1
- package/src/tools/memory-retain.ts +1 -1
- package/src/tools/read.ts +1 -1
- package/src/tools/security-scan.ts +1 -1
- package/src/tools/todo.ts +1 -1
- package/src/tools/tts.ts +1 -1
- package/src/tools/vibe.ts +2 -1
- package/src/tools/write.ts +1 -1
- package/src/web/search/index.ts +2 -1
- package/dist/types/extensibility/typebox.d.ts +0 -181
- package/src/extensibility/typebox.ts +0 -958
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const hashlineEditParamsSchema: import("
|
|
1
|
+
export declare const hashlineEditParamsSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
2
2
|
input: string;
|
|
3
|
-
}, {
|
|
3
|
+
}, {
|
|
4
|
+
input: string;
|
|
5
|
+
}>;
|
|
4
6
|
export type HashlineParams = typeof hashlineEditParamsSchema.infer;
|
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
* the `patch` mode.
|
|
9
9
|
*/
|
|
10
10
|
import type { PatchEditEntry } from "./patch.js";
|
|
11
|
-
export declare const applyPatchSchema: import("
|
|
11
|
+
export declare const applyPatchSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
12
12
|
input: string;
|
|
13
|
-
}, {
|
|
13
|
+
}, {
|
|
14
|
+
input: string;
|
|
15
|
+
}>;
|
|
14
16
|
export type ApplyPatchParams = typeof applyPatchSchema.infer;
|
|
15
17
|
export type ApplyPatchEntry = PatchEditEntry & {
|
|
16
18
|
path: string;
|
|
@@ -69,20 +69,31 @@ export declare function computePatchDiff(input: PatchInput, cwd: string, options
|
|
|
69
69
|
} | {
|
|
70
70
|
error: string;
|
|
71
71
|
}>;
|
|
72
|
-
export declare const patchEditEntrySchema: import("
|
|
72
|
+
export declare const patchEditEntrySchema: import("@oh-my-pi/omptype").FluentType<{
|
|
73
|
+
diff?: string | undefined;
|
|
73
74
|
op?: "create" | "delete" | "update" | undefined;
|
|
74
75
|
rename?: string | undefined;
|
|
76
|
+
}, {
|
|
75
77
|
diff?: string | undefined;
|
|
76
|
-
|
|
78
|
+
op?: "create" | "delete" | "update" | undefined;
|
|
79
|
+
rename?: string | undefined;
|
|
80
|
+
}>;
|
|
77
81
|
export type PatchEditEntry = typeof patchEditEntrySchema.infer;
|
|
78
|
-
export declare const patchEditSchema: import("
|
|
79
|
-
path: string;
|
|
82
|
+
export declare const patchEditSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
80
83
|
edits: {
|
|
84
|
+
diff?: string | undefined;
|
|
81
85
|
op?: "create" | "delete" | "update" | undefined;
|
|
82
86
|
rename?: string | undefined;
|
|
87
|
+
}[];
|
|
88
|
+
path: string;
|
|
89
|
+
}, {
|
|
90
|
+
edits: {
|
|
83
91
|
diff?: string | undefined;
|
|
92
|
+
op?: "create" | "delete" | "update" | undefined;
|
|
93
|
+
rename?: string | undefined;
|
|
84
94
|
}[];
|
|
85
|
-
|
|
95
|
+
path: string;
|
|
96
|
+
}>;
|
|
86
97
|
export type PatchParams = typeof patchEditSchema.infer;
|
|
87
98
|
export interface ExecutePatchSingleOptions {
|
|
88
99
|
session: ToolSession;
|
|
@@ -116,12 +116,17 @@ export declare function findContextLine(lines: string[], context: string, startF
|
|
|
116
116
|
allowFuzzy?: boolean;
|
|
117
117
|
skipFunctionFallback?: boolean;
|
|
118
118
|
}): ContextLineResult;
|
|
119
|
-
export declare const replaceEditSchema: import("
|
|
120
|
-
|
|
119
|
+
export declare const replaceEditSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
120
|
+
new_string: string;
|
|
121
121
|
old_string: string;
|
|
122
|
+
path: string;
|
|
123
|
+
replace_all?: boolean | undefined;
|
|
124
|
+
}, {
|
|
122
125
|
new_string: string;
|
|
126
|
+
old_string: string;
|
|
127
|
+
path: string;
|
|
123
128
|
replace_all?: boolean | undefined;
|
|
124
|
-
}
|
|
129
|
+
}>;
|
|
125
130
|
export type ReplaceParams = typeof replaceEditSchema.infer;
|
|
126
131
|
/**
|
|
127
132
|
* Internal batch form of {@link ReplaceParams}, produced only by the Cursor
|
|
@@ -23,8 +23,11 @@ export declare function isEvalTimeoutControlEvent(event: JsStatusEvent): boolean
|
|
|
23
23
|
/** Optional behavior for a timeout pause around a host bridge call. */
|
|
24
24
|
export interface BridgeTimeoutPauseOptions {
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* Holds an external eval abort back from the *kernel* until this bridge call
|
|
27
|
+
* settles, so the runtime is never torn down mid-phase (`agent()` isolation
|
|
28
|
+
* worktree setup and merge/cherry-pick). It does not shield the delegated
|
|
29
|
+
* work itself: the bridge hands subagents the caller's real signal, so a
|
|
30
|
+
* turn cancel still stops them immediately.
|
|
28
31
|
*/
|
|
29
32
|
deferExternalAbort?: boolean;
|
|
30
33
|
}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-side handler for the eval `completion()` helper.
|
|
3
|
+
*
|
|
4
|
+
* Both eval runtimes (JS worker + Python kernel) route helper→host calls
|
|
5
|
+
* through {@link callSessionTool}. Reserving the synthetic tool name
|
|
6
|
+
* {@link EVAL_COMPLETION_BRIDGE_NAME} lets a single host handler serve both
|
|
7
|
+
* transports without registering an agent-visible tool: cell code calls
|
|
8
|
+
* `completion(prompt, opts)`, the prelude forwards `{ prompt, model, system?, schema? }`
|
|
9
|
+
* through the bridge, and this module performs one stateless completion.
|
|
10
|
+
*
|
|
11
|
+
* The call is oneshot and toolless from the model's perspective — pure text
|
|
12
|
+
* in, text (or, with `schema`, a structured object) out.
|
|
13
|
+
*/
|
|
1
14
|
import type { ToolSession } from "../tools/index.js";
|
|
2
15
|
import type { JsStatusEvent } from "./js/shared/types.js";
|
|
3
16
|
/** Synthetic bridge name reserved for the `completion()` helper across both runtimes. */
|
|
@@ -2,7 +2,19 @@ import type { ToolSession } from "../../tools/index.js";
|
|
|
2
2
|
import { type JsStatusEvent } from "../js/tool-bridge.js";
|
|
3
3
|
export interface PyToolBridgeEntry {
|
|
4
4
|
toolSession: ToolSession;
|
|
5
|
+
/**
|
|
6
|
+
* Turn-cancel handed to the tool implementation. Raw and never deferred, so
|
|
7
|
+
* delegated work — above all the subagents `agent()` spawns — stops at once.
|
|
8
|
+
*/
|
|
5
9
|
signal?: AbortSignal;
|
|
10
|
+
/**
|
|
11
|
+
* Kernel-side abort, held back while a critical `agent()` phase (isolation
|
|
12
|
+
* worktree setup, merge/cherry-pick) is in flight. Decides only when the host
|
|
13
|
+
* may stop waiting on a call and let the kernel unwind; it is never given to
|
|
14
|
+
* a tool. Keeping these separate is what stops a cancel from settling the
|
|
15
|
+
* cell on top of a still-running, abort-insensitive merge.
|
|
16
|
+
*/
|
|
17
|
+
shieldedSignal?: AbortSignal;
|
|
6
18
|
emitStatus?: (event: JsStatusEvent) => void;
|
|
7
19
|
abortRequested?: () => boolean;
|
|
8
20
|
}
|
|
@@ -5,11 +5,11 @@
|
|
|
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 * as arktype from "
|
|
9
|
-
import type * as
|
|
8
|
+
import type * as arktype from "@oh-my-pi/omptype";
|
|
9
|
+
import type * as TypeBox from "@oh-my-pi/omptype/typebox";
|
|
10
|
+
import type * as zod from "@oh-my-pi/omptype/zod";
|
|
10
11
|
import type { ExecOptions, ExecResult, HookCommandContext } from "../../extensibility/hooks/types.js";
|
|
11
12
|
import type * as PiCodingAgent from "../../index.js";
|
|
12
|
-
import type * as TypeBox from "../typebox.js";
|
|
13
13
|
export type { ExecOptions, ExecResult, HookCommandContext };
|
|
14
14
|
/**
|
|
15
15
|
* API passed to custom command factory.
|
|
@@ -24,7 +24,7 @@ export interface CustomCommandAPI {
|
|
|
24
24
|
typebox: typeof TypeBox;
|
|
25
25
|
/** Injected arktype module for validation in custom commands. */
|
|
26
26
|
arktype: typeof arktype;
|
|
27
|
-
/** Injected zod
|
|
27
|
+
/** Injected omptype-backed zod facade for command validation. */
|
|
28
28
|
zod: typeof zod;
|
|
29
29
|
/** Injected pi-coding-agent exports */
|
|
30
30
|
pi: typeof PiCodingAgent;
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
* Custom tools are TypeScript modules that define additional tools for the agent.
|
|
5
5
|
* They can provide custom rendering for tool calls and results in the TUI.
|
|
6
6
|
*/
|
|
7
|
+
import type { type as ArkType } from "@oh-my-pi/omptype";
|
|
8
|
+
import type * as TypeBox from "@oh-my-pi/omptype/typebox";
|
|
9
|
+
import type * as zod from "@oh-my-pi/omptype/zod";
|
|
7
10
|
import type { AgentToolResult, AgentToolUpdateCallback, ToolApproval, ToolApprovalDecision, ToolLoadMode, ToolTier } from "@oh-my-pi/pi-agent-core";
|
|
8
11
|
import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
|
|
9
12
|
import type { FetchImpl, Model, Static, TSchema } from "@oh-my-pi/pi-ai";
|
|
10
13
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
11
14
|
import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
|
|
12
|
-
import type { type as ArkType } from "arktype";
|
|
13
|
-
import type * as zod from "zod/v4";
|
|
14
15
|
import type { Rule } from "../../capability/rule.js";
|
|
15
16
|
import type { ModelRegistry } from "../../config/model-registry.js";
|
|
16
17
|
import type { Settings } from "../../config/settings.js";
|
|
@@ -22,7 +23,6 @@ import type { Theme } from "../../modes/theme/theme.js";
|
|
|
22
23
|
import type { ReadonlySessionManager } from "../../session/session-manager.js";
|
|
23
24
|
import type { TodoItem } from "../../tools/todo.js";
|
|
24
25
|
import type { RecoveredRetryError } from "../shared-events.js";
|
|
25
|
-
import type * as TypeBox from "../typebox.js";
|
|
26
26
|
/** Alias for clarity */
|
|
27
27
|
export type CustomToolUIContext = HookUIContext;
|
|
28
28
|
export type { ExecOptions, ExecResult } from "../../exec/exec.js";
|
|
@@ -57,7 +57,7 @@ export interface CustomToolAPI {
|
|
|
57
57
|
typebox: typeof TypeBox;
|
|
58
58
|
/** Injected arktype module for arktype-authored custom tools. */
|
|
59
59
|
arktype: typeof ArkType;
|
|
60
|
-
/** Injected zod
|
|
60
|
+
/** Injected omptype-backed zod facade for parameter schemas. */
|
|
61
61
|
zod: typeof zod;
|
|
62
62
|
/** Injected pi-coding-agent exports */
|
|
63
63
|
pi: typeof PiCodingAgent;
|
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
* - Register commands, keyboard shortcuts, and CLI flags
|
|
8
8
|
* - Interact with the user via UI primitives
|
|
9
9
|
*/
|
|
10
|
+
import type { Type as arktype } from "@oh-my-pi/omptype";
|
|
11
|
+
import type * as TypeBox from "@oh-my-pi/omptype/typebox";
|
|
12
|
+
import type * as zod from "@oh-my-pi/omptype/zod";
|
|
10
13
|
import type { AgentMessage, AgentToolResult, AgentToolUpdateCallback, ThinkingLevel, ToolApproval, ToolLoadMode } from "@oh-my-pi/pi-agent-core";
|
|
11
14
|
import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
|
|
12
15
|
import type { Api, AssistantMessageEvent, AssistantMessageEventStream, Context, ImageContent, Model, ModelSpec, ProviderResponseMetadata, ServiceTier, ServiceTierByFamily, ServiceTierFamily, SimpleStreamOptions, Static, TextContent, TSchema } from "@oh-my-pi/pi-ai";
|
|
13
16
|
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/oauth/types";
|
|
14
17
|
import type { AutocompleteItem, AutocompleteProvider, Component, EditorTheme, KeyId, TUI } from "@oh-my-pi/pi-tui";
|
|
15
18
|
import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
|
|
16
|
-
import type { Type as arktype } from "arktype";
|
|
17
|
-
import type * as zod from "zod/v4";
|
|
18
19
|
import type { KeybindingsManager } from "../../config/keybindings.js";
|
|
19
20
|
import type { ModelRegistry } from "../../config/model-registry.js";
|
|
20
21
|
import type { EditToolDetails } from "../../edit/index.js";
|
|
@@ -35,7 +36,6 @@ import type { ApprovalMode } from "../../tools/approval.js";
|
|
|
35
36
|
import type { EventBus } from "../../utils/event-bus.js";
|
|
36
37
|
import type { AgentEndEvent, AgentStartEvent, AutoCompactionEndEvent, AutoCompactionStartEvent, AutoRetryEndEvent, AutoRetryStartEvent, ContextEvent, GoalUpdatedEvent, SessionBeforeBranchEvent, SessionBeforeBranchResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBranchEvent, SessionCompactEvent, SessionCompactingEvent, SessionCompactingResult, SessionEvent, SessionShutdownEvent, SessionStartEvent, SessionStopEvent, SessionStopEventResult, SessionSwitchEvent, SessionTreeEvent, TodoReminderEvent, ToolCallEventResult, ToolResultEventResult, TtsrTriggeredEvent, TurnEndEvent, TurnStartEvent } from "../shared-events.js";
|
|
37
38
|
import type { SlashCommandInfo } from "../slash-commands.js";
|
|
38
|
-
import type * as TypeBox from "../typebox.js";
|
|
39
39
|
export type { AppKeybinding, KeybindingsManager } from "../../config/keybindings.js";
|
|
40
40
|
export type { ExecOptions, ExecResult } from "../../exec/exec.js";
|
|
41
41
|
export type { AgentToolResult, AgentToolUpdateCallback };
|
|
@@ -740,7 +740,7 @@ export interface ExtensionAPI {
|
|
|
740
740
|
typebox: typeof TypeBox;
|
|
741
741
|
/** Injected arktype module for arktype-authored extension tools (canonical going forward). */
|
|
742
742
|
arktype: typeof arktype;
|
|
743
|
-
/** Injected zod
|
|
743
|
+
/** Injected omptype-backed zod facade for extension tool parameter schemas. */
|
|
744
744
|
zod: typeof zod;
|
|
745
745
|
/** Injected pi-coding-agent exports for accessing SDK utilities */
|
|
746
746
|
pi: typeof PiCodingAgent;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { Type } from "@oh-my-pi/omptype";
|
|
2
|
+
import type * as TypeBox from "@oh-my-pi/omptype/typebox";
|
|
3
|
+
import type * as zod from "@oh-my-pi/omptype/zod";
|
|
1
4
|
import type { ImageContent, Message, Model, TextContent } from "@oh-my-pi/pi-ai";
|
|
2
5
|
import type { Component, TUI } from "@oh-my-pi/pi-tui";
|
|
3
6
|
import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
|
|
4
|
-
import type { Type } from "arktype";
|
|
5
|
-
import type * as zod from "zod/v4";
|
|
6
7
|
import type { ModelRegistry } from "../../config/model-registry.js";
|
|
7
8
|
import type { EditToolDetails } from "../../edit/index.js";
|
|
8
9
|
import type { ExecOptions, ExecResult } from "../../exec/exec.js";
|
|
@@ -12,7 +13,6 @@ import type { CustomMessagePayload, HookMessage } from "../../session/messages.j
|
|
|
12
13
|
import type { ReadonlySessionManager, SessionManager } from "../../session/session-manager.js";
|
|
13
14
|
import type { BashToolDetails, GlobToolDetails, GrepToolDetails, ReadToolDetails } from "../../tools/index.js";
|
|
14
15
|
import type { AgentEndEvent, AgentStartEvent, AutoCompactionEndEvent, AutoCompactionStartEvent, AutoRetryEndEvent, AutoRetryStartEvent, ContextEvent, SessionBeforeBranchEvent, SessionBeforeBranchResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBranchEvent, SessionCompactEvent, SessionCompactingEvent, SessionCompactingResult, SessionEvent, SessionShutdownEvent, SessionStartEvent, SessionSwitchEvent, SessionTreeEvent, TodoReminderEvent, ToolCallEventResult, ToolResultEventResult, TtsrTriggeredEvent, TurnEndEvent, TurnStartEvent } from "../shared-events.js";
|
|
15
|
-
import type * as TypeBox from "../typebox.js";
|
|
16
16
|
export type { ExecOptions, ExecResult } from "../../exec/exec.js";
|
|
17
17
|
/**
|
|
18
18
|
* UI context for hooks to request interactive UI from the harness.
|
|
@@ -422,7 +422,7 @@ export interface HookAPI {
|
|
|
422
422
|
typebox: typeof TypeBox;
|
|
423
423
|
/** Injected arktype module for arktype-authored hooks. */
|
|
424
424
|
arktype: typeof Type;
|
|
425
|
-
/** Injected zod
|
|
425
|
+
/** Injected omptype-backed zod facade for hook validation. */
|
|
426
426
|
zod: typeof zod;
|
|
427
427
|
/** Injected pi-coding-agent exports */
|
|
428
428
|
pi: typeof PiCodingAgent;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import { type Api, type AssistantMessage, type AssistantMessageEventStream, type Context, type Model, type SimpleStreamOptions } from "@oh-my-pi/pi-ai";
|
|
23
23
|
import type { Effort } from "@oh-my-pi/pi-catalog/effort";
|
|
24
24
|
import { calculateCost, getBundledModel, getBundledModels, getBundledProviders, modelsAreEqual } from "@oh-my-pi/pi-catalog/models";
|
|
25
|
-
import { type TSchema, Type } from "./typebox.js";
|
|
25
|
+
import { type TSchema, Type } from "./legacy-typebox.js";
|
|
26
26
|
export interface StringEnumOptions<T extends string> {
|
|
27
27
|
description?: string;
|
|
28
28
|
default?: T;
|
|
@@ -404,4 +404,4 @@ export { parseArgs } from "../cli/args.js";
|
|
|
404
404
|
export * from "../index.js";
|
|
405
405
|
export { formatBytes as formatSize } from "../tools/render-utils.js";
|
|
406
406
|
export { copyToClipboard } from "../utils/clipboard.js";
|
|
407
|
-
export { Type } from "./typebox.js";
|
|
407
|
+
export { Type } from "./legacy-typebox.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type TypeBuilder as OmpTypeBuilder } from "@oh-my-pi/omptype/typebox";
|
|
2
|
+
export * from "@oh-my-pi/omptype/typebox";
|
|
3
|
+
export declare const Type: OmpTypeBuilder;
|
|
4
|
+
export type TypeBuilder = OmpTypeBuilder;
|
|
5
|
+
declare const legacyTypeBox: {
|
|
6
|
+
Type: OmpTypeBuilder;
|
|
7
|
+
};
|
|
8
|
+
export default legacyTypeBox;
|
|
@@ -20,20 +20,13 @@ export declare function __getLegacyPiBundledModulesGlobal(): string;
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function __computeBundledSelfPackageRoot(metaDir: string, pathImpl?: typeof path): string;
|
|
22
22
|
/**
|
|
23
|
-
* Resolve the
|
|
24
|
-
*
|
|
23
|
+
* Resolve the coding-agent compatibility surface that composes omptype's
|
|
24
|
+
* TypeBox facade with legacy `Type.Unsafe`, then drop the remap when that
|
|
25
|
+
* entrypoint is missing.
|
|
25
26
|
*
|
|
26
|
-
* In compiled-binary mode the
|
|
27
|
-
* `omp-legacy-pi-bundled:` virtual namespace (issue #3423)
|
|
28
|
-
*
|
|
29
|
-
* needs no filesystem probe. In dev / source-link / installed-package mode the
|
|
30
|
-
* shim is an on-disk source file; validation mirrors
|
|
31
|
-
* `__validateLegacyPiPackageRootOverrides` (#2168): if the computed candidate
|
|
32
|
-
* doesn't exist (e.g. an install that dropped the source — issue #3414),
|
|
33
|
-
* `resolveTypeBoxSpecifier` returns `undefined` and
|
|
34
|
-
* `rewriteLegacyExtensionSource` leaves bare `typebox` / `@sinclair/typebox`
|
|
35
|
-
* specifiers alone, so Bun falls through to native resolution against the
|
|
36
|
-
* extension's own `node_modules`.
|
|
27
|
+
* In compiled-binary mode the surface is served through the
|
|
28
|
+
* `omp-legacy-pi-bundled:` virtual namespace (issue #3423). Dev, source-link,
|
|
29
|
+
* and installed-package modes use the shipped source module.
|
|
37
30
|
*
|
|
38
31
|
* Exported for tests; production callers use `TYPEBOX_SHIM_PATH`.
|
|
39
32
|
*/
|
|
@@ -4,11 +4,15 @@ import type { RenderResultOptions } from "../../extensibility/custom-tools/types
|
|
|
4
4
|
import type { Theme } from "../../modes/theme/theme.js";
|
|
5
5
|
import type { ToolSession } from "../../tools/index.js";
|
|
6
6
|
import type { Goal, GoalToolDetails } from "../state.js";
|
|
7
|
-
declare const goalSchema: import("
|
|
7
|
+
declare const goalSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
8
|
+
objective?: string | undefined;
|
|
8
9
|
op: "complete" | "create" | "drop" | "get" | "resume";
|
|
10
|
+
token_budget?: number | undefined;
|
|
11
|
+
}, {
|
|
9
12
|
objective?: string | undefined;
|
|
13
|
+
op: "complete" | "create" | "drop" | "get" | "resume";
|
|
10
14
|
token_budget?: number | undefined;
|
|
11
|
-
}
|
|
15
|
+
}>;
|
|
12
16
|
export type GoalToolInput = typeof goalSchema.infer;
|
|
13
17
|
export interface GoalToolResponse {
|
|
14
18
|
goal: Goal | null;
|
|
@@ -23,11 +27,15 @@ export declare class GoalTool implements AgentTool<typeof goalSchema, GoalToolDe
|
|
|
23
27
|
readonly name = "goal";
|
|
24
28
|
readonly label = "Goal";
|
|
25
29
|
readonly description: string;
|
|
26
|
-
readonly parameters: import("
|
|
30
|
+
readonly parameters: import("@oh-my-pi/omptype").FluentType<{
|
|
31
|
+
objective?: string | undefined;
|
|
27
32
|
op: "complete" | "create" | "drop" | "get" | "resume";
|
|
33
|
+
token_budget?: number | undefined;
|
|
34
|
+
}, {
|
|
28
35
|
objective?: string | undefined;
|
|
36
|
+
op: "complete" | "create" | "drop" | "get" | "resume";
|
|
29
37
|
token_budget?: number | undefined;
|
|
30
|
-
}
|
|
38
|
+
}>;
|
|
31
39
|
readonly strict = true;
|
|
32
40
|
readonly intent: "omit";
|
|
33
41
|
constructor(session: ToolSession);
|
|
@@ -102,17 +102,27 @@ 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("
|
|
105
|
+
readonly parameters: import("@oh-my-pi/omptype").FluentType<{
|
|
106
106
|
action: "capabilities" | "code_actions" | "definition" | "diagnostics" | "hover" | "implementation" | "references" | "reload" | "rename" | "rename_file" | "request" | "status" | "symbols" | "type_definition";
|
|
107
|
+
apply?: boolean | undefined;
|
|
107
108
|
file?: string | undefined;
|
|
108
109
|
line?: number | undefined;
|
|
109
|
-
symbol?: string | undefined;
|
|
110
|
-
query?: string | undefined;
|
|
111
110
|
new_name?: string | undefined;
|
|
112
|
-
|
|
111
|
+
payload?: string | undefined;
|
|
112
|
+
query?: string | undefined;
|
|
113
|
+
symbol?: string | undefined;
|
|
113
114
|
timeout?: number | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
action: "capabilities" | "code_actions" | "definition" | "diagnostics" | "hover" | "implementation" | "references" | "reload" | "rename" | "rename_file" | "request" | "status" | "symbols" | "type_definition";
|
|
117
|
+
apply?: boolean | undefined;
|
|
118
|
+
file?: string | undefined;
|
|
119
|
+
line?: number | undefined;
|
|
120
|
+
new_name?: string | undefined;
|
|
114
121
|
payload?: string | undefined;
|
|
115
|
-
|
|
122
|
+
query?: string | undefined;
|
|
123
|
+
symbol?: string | undefined;
|
|
124
|
+
timeout?: number | undefined;
|
|
125
|
+
}>;
|
|
116
126
|
readonly strict = true;
|
|
117
127
|
constructor(session: ToolSession);
|
|
118
128
|
static createIf(session: ToolSession): LspTool | null;
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
export declare const lspSchema: import("
|
|
1
|
+
export declare const lspSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
2
2
|
action: "capabilities" | "code_actions" | "definition" | "diagnostics" | "hover" | "implementation" | "references" | "reload" | "rename" | "rename_file" | "request" | "status" | "symbols" | "type_definition";
|
|
3
|
+
apply?: boolean | undefined;
|
|
3
4
|
file?: string | undefined;
|
|
4
5
|
line?: number | undefined;
|
|
5
|
-
symbol?: string | undefined;
|
|
6
|
-
query?: string | undefined;
|
|
7
6
|
new_name?: string | undefined;
|
|
8
|
-
|
|
7
|
+
payload?: string | undefined;
|
|
8
|
+
query?: string | undefined;
|
|
9
|
+
symbol?: string | undefined;
|
|
9
10
|
timeout?: number | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
action: "capabilities" | "code_actions" | "definition" | "diagnostics" | "hover" | "implementation" | "references" | "reload" | "rename" | "rename_file" | "request" | "status" | "symbols" | "type_definition";
|
|
13
|
+
apply?: boolean | undefined;
|
|
14
|
+
file?: string | undefined;
|
|
15
|
+
line?: number | undefined;
|
|
16
|
+
new_name?: string | undefined;
|
|
10
17
|
payload?: string | undefined;
|
|
11
|
-
|
|
18
|
+
query?: string | undefined;
|
|
19
|
+
symbol?: string | undefined;
|
|
20
|
+
timeout?: number | undefined;
|
|
21
|
+
}>;
|
|
12
22
|
export type LspParams = typeof lspSchema.infer;
|
|
13
23
|
export interface LspToolDetails {
|
|
14
24
|
serverName?: string;
|