@oh-my-pi/pi-coding-agent 15.10.1 → 15.10.3

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.
Files changed (154) hide show
  1. package/CHANGELOG.md +113 -1
  2. package/dist/types/cli/gallery-fixtures/types.d.ts +7 -1
  3. package/dist/types/cli/startup-cwd.d.ts +2 -0
  4. package/dist/types/commands/launch.d.ts +3 -0
  5. package/dist/types/config/keybindings.d.ts +2 -2
  6. package/dist/types/config/model-provider-priority.d.ts +1 -0
  7. package/dist/types/config/model-resolver.d.ts +4 -1
  8. package/dist/types/config/settings.d.ts +7 -2
  9. package/dist/types/debug/report-bundle.d.ts +3 -0
  10. package/dist/types/edit/file-snapshot-store.d.ts +18 -10
  11. package/dist/types/edit/index.d.ts +0 -1
  12. package/dist/types/eval/py/__tests__/prelude.test.d.ts +1 -0
  13. package/dist/types/extensibility/extensions/types.d.ts +4 -1
  14. package/dist/types/lsp/client.d.ts +10 -0
  15. package/dist/types/lsp/index.d.ts +0 -5
  16. package/dist/types/main.d.ts +14 -9
  17. package/dist/types/mcp/tool-bridge.d.ts +2 -0
  18. package/dist/types/modes/components/assistant-message.d.ts +0 -9
  19. package/dist/types/modes/components/custom-editor.d.ts +1 -1
  20. package/dist/types/modes/components/late-diagnostics-message.d.ts +20 -0
  21. package/dist/types/modes/components/read-tool-group.d.ts +6 -0
  22. package/dist/types/modes/components/session-selector.d.ts +16 -7
  23. package/dist/types/modes/components/status-line.d.ts +2 -0
  24. package/dist/types/modes/components/tool-execution.d.ts +0 -18
  25. package/dist/types/modes/controllers/event-controller.d.ts +17 -0
  26. package/dist/types/modes/interactive-mode.d.ts +1 -0
  27. package/dist/types/modes/magic-keywords.d.ts +1 -1
  28. package/dist/types/modes/markdown-prose.d.ts +1 -1
  29. package/dist/types/modes/types.d.ts +7 -0
  30. package/dist/types/modes/workflow.d.ts +3 -3
  31. package/dist/types/session/auth-storage.d.ts +1 -1
  32. package/dist/types/session/messages.d.ts +11 -8
  33. package/dist/types/session/session-manager.d.ts +5 -2
  34. package/dist/types/session/yield-queue.d.ts +10 -1
  35. package/dist/types/task/executor.d.ts +10 -0
  36. package/dist/types/tools/eval-render.d.ts +0 -1
  37. package/dist/types/tools/eval.d.ts +8 -0
  38. package/dist/types/tools/gh-cache-invalidation.d.ts +6 -0
  39. package/dist/types/tools/github-cache.d.ts +12 -0
  40. package/dist/types/tools/index.d.ts +31 -0
  41. package/dist/types/tools/path-utils.d.ts +13 -1
  42. package/dist/types/tools/read.d.ts +2 -1
  43. package/dist/types/tools/render-utils.d.ts +3 -1
  44. package/dist/types/tools/renderers.d.ts +0 -15
  45. package/dist/types/tools/search.d.ts +2 -2
  46. package/dist/types/tools/write.d.ts +0 -2
  47. package/dist/types/tools/yield.d.ts +8 -0
  48. package/dist/types/tui/code-cell.d.ts +0 -2
  49. package/dist/types/tui/hyperlink.d.ts +5 -7
  50. package/dist/types/tui/output-block.d.ts +0 -18
  51. package/package.json +9 -9
  52. package/src/cli/args.ts +3 -1
  53. package/src/cli/dry-balance-cli.ts +2 -4
  54. package/src/cli/gallery-cli.ts +4 -0
  55. package/src/cli/gallery-fixtures/codeintel.ts +0 -1
  56. package/src/cli/gallery-fixtures/fs.ts +68 -1
  57. package/src/cli/gallery-fixtures/types.ts +8 -1
  58. package/src/cli/startup-cwd.ts +68 -0
  59. package/src/commands/launch.ts +3 -0
  60. package/src/commit/agentic/agent.ts +1 -0
  61. package/src/commit/model-selection.ts +3 -2
  62. package/src/config/model-provider-priority.ts +55 -0
  63. package/src/config/model-registry.ts +4 -22
  64. package/src/config/model-resolver.ts +39 -7
  65. package/src/config/settings.ts +86 -41
  66. package/src/debug/index.ts +8 -0
  67. package/src/debug/raw-sse-buffer.ts +7 -4
  68. package/src/debug/report-bundle.ts +9 -0
  69. package/src/edit/file-snapshot-store.ts +33 -1
  70. package/src/edit/hashline/diff.ts +86 -0
  71. package/src/edit/hashline/execute.ts +14 -1
  72. package/src/edit/hashline/filesystem.ts +2 -1
  73. package/src/edit/index.ts +31 -17
  74. package/src/edit/renderer.ts +116 -31
  75. package/src/eval/__tests__/llm-bridge.test.ts +20 -0
  76. package/src/eval/js/context-manager.ts +32 -15
  77. package/src/eval/js/shared/prelude.txt +26 -10
  78. package/src/eval/llm-bridge.ts +14 -3
  79. package/src/eval/py/__tests__/prelude.test.ts +19 -0
  80. package/src/eval/py/executor.ts +23 -11
  81. package/src/eval/py/prelude.py +1 -1
  82. package/src/extensibility/extensions/types.ts +10 -1
  83. package/src/internal-urls/docs-index.generated.ts +7 -7
  84. package/src/lsp/client.ts +23 -11
  85. package/src/lsp/config.ts +11 -1
  86. package/src/lsp/index.ts +189 -61
  87. package/src/main.ts +144 -78
  88. package/src/mcp/tool-bridge.ts +2 -0
  89. package/src/memories/index.ts +2 -2
  90. package/src/modes/components/assistant-message.ts +3 -15
  91. package/src/modes/components/custom-editor.ts +143 -111
  92. package/src/modes/components/late-diagnostics-message.ts +60 -0
  93. package/src/modes/components/model-selector.ts +59 -13
  94. package/src/modes/components/oauth-selector.ts +33 -7
  95. package/src/modes/components/plan-review-overlay.ts +26 -5
  96. package/src/modes/components/read-tool-group.ts +415 -35
  97. package/src/modes/components/session-selector.ts +89 -35
  98. package/src/modes/components/status-line.ts +19 -4
  99. package/src/modes/components/tips.txt +1 -1
  100. package/src/modes/components/tool-execution.ts +7 -49
  101. package/src/modes/components/transcript-container.ts +108 -32
  102. package/src/modes/components/user-message.ts +1 -1
  103. package/src/modes/controllers/event-controller.ts +32 -1
  104. package/src/modes/controllers/input-controller.ts +56 -9
  105. package/src/modes/interactive-mode.ts +107 -20
  106. package/src/modes/magic-keywords.ts +1 -1
  107. package/src/modes/markdown-prose.ts +1 -1
  108. package/src/modes/theme/shimmer.ts +20 -9
  109. package/src/modes/types.ts +7 -0
  110. package/src/modes/utils/ui-helpers.ts +26 -5
  111. package/src/modes/workflow.ts +10 -10
  112. package/src/prompts/system/manual-continue.md +7 -0
  113. package/src/prompts/system/plan-mode-active.md +56 -72
  114. package/src/prompts/system/workflow-notice.md +1 -1
  115. package/src/prompts/tools/bash.md +9 -0
  116. package/src/prompts/tools/browser.md +1 -1
  117. package/src/prompts/tools/eval.md +5 -2
  118. package/src/prompts/tools/lsp-late-diagnostic.md +8 -0
  119. package/src/prompts/tools/read.md +2 -2
  120. package/src/sdk.ts +85 -10
  121. package/src/session/agent-session.ts +42 -15
  122. package/src/session/auth-storage.ts +2 -0
  123. package/src/session/messages.ts +21 -14
  124. package/src/session/session-manager.ts +98 -25
  125. package/src/session/yield-queue.ts +20 -2
  126. package/src/task/executor.ts +72 -36
  127. package/src/task/render.ts +3 -4
  128. package/src/tiny/title-client.ts +6 -1
  129. package/src/tools/bash.ts +7 -7
  130. package/src/tools/browser/tab-supervisor.ts +13 -1
  131. package/src/tools/browser/tab-worker.ts +33 -4
  132. package/src/tools/eval-render.ts +4 -23
  133. package/src/tools/eval.ts +13 -2
  134. package/src/tools/find.ts +148 -99
  135. package/src/tools/gh-cache-invalidation.ts +200 -0
  136. package/src/tools/github-cache.ts +25 -0
  137. package/src/tools/index.ts +32 -0
  138. package/src/tools/inspect-image.ts +2 -2
  139. package/src/tools/path-utils.ts +47 -24
  140. package/src/tools/plan-mode-guard.ts +52 -7
  141. package/src/tools/read.ts +41 -20
  142. package/src/tools/render-utils.ts +3 -1
  143. package/src/tools/renderers.ts +0 -15
  144. package/src/tools/search.ts +38 -3
  145. package/src/tools/ssh.ts +0 -1
  146. package/src/tools/todo.ts +1 -0
  147. package/src/tools/write.ts +5 -14
  148. package/src/tools/yield.ts +10 -1
  149. package/src/tui/code-cell.ts +1 -6
  150. package/src/tui/hyperlink.ts +13 -23
  151. package/src/tui/output-block.ts +2 -97
  152. package/src/utils/commit-message-generator.ts +2 -2
  153. package/src/utils/enhanced-paste.ts +30 -2
  154. package/src/web/search/providers/codex.ts +37 -8
@@ -52,8 +52,14 @@ interface JsSession {
52
52
 
53
53
  const sessions = new Map<string, JsSession>();
54
54
  const startingSessions = new Map<string, Promise<JsSession>>();
55
- const resettingSessions = new Set<string>();
56
- const READY_TIMEOUT_MS_DEFAULT = 5_000;
55
+ const resettingSessions = new Map<string, Promise<void>>();
56
+ // Worker startup (module-graph import + WorkerCore construction) is infrastructure
57
+ // cost, not user compute. Floor it independently of Bun's 5s default per-test timeout
58
+ // so a slow cold-start under load isn't aborted mid-init — terminating a still-
59
+ // initializing Bun worker triggers the same kind of terminate-race that motivates
60
+ // avoiding `vm.runInContext` (see shared/indirect-eval.ts), here surfacing as a
61
+ // SIGILL/SIGSEGV. Callers that pass a larger per-cell budget still dominate.
62
+ const WORKER_INIT_TIMEOUT_MS = 15_000;
57
63
 
58
64
  export async function executeInVmContext(options: {
59
65
  sessionKey: string;
@@ -67,17 +73,28 @@ export async function executeInVmContext(options: {
67
73
  runState: VmRunState;
68
74
  }): Promise<{ value: unknown }> {
69
75
  if (options.reset) {
70
- if (resettingSessions.has(options.sessionKey)) {
71
- throw new ToolError("JS context reset already in progress");
72
- }
73
- resettingSessions.add(options.sessionKey);
74
- try {
75
- await resetVmContext(options.sessionKey);
76
- } finally {
77
- resettingSessions.delete(options.sessionKey);
76
+ // Coalesce concurrent resets: an existing in-flight reset already
77
+ // produces a fresh context, so a follow-up `reset: true` cell should
78
+ // just wait for it rather than failing the user-visible call.
79
+ const inFlight = resettingSessions.get(options.sessionKey);
80
+ if (inFlight) await inFlight.catch(() => undefined);
81
+ else {
82
+ const resetPromise = resetVmContext(options.sessionKey);
83
+ resettingSessions.set(
84
+ options.sessionKey,
85
+ resetPromise.then(() => undefined),
86
+ );
87
+ try {
88
+ await resetPromise;
89
+ } finally {
90
+ resettingSessions.delete(options.sessionKey);
91
+ }
78
92
  }
79
- } else if (resettingSessions.has(options.sessionKey)) {
80
- throw new ToolError("JS context reset in progress");
93
+ } else {
94
+ // Internal coordination: wait for any in-flight reset to settle and
95
+ // then run on the freshly-rebuilt context.
96
+ const inFlight = resettingSessions.get(options.sessionKey);
97
+ if (inFlight) await inFlight.catch(() => undefined);
81
98
  }
82
99
  const session = await acquireSession(
83
100
  options.sessionKey,
@@ -191,9 +208,9 @@ async function acquireSession(sessionKey: string, snapshot: SessionSnapshot, tim
191
208
  handleSessionMessage(session, msg);
192
209
  });
193
210
  try {
194
- // Cold-start can exceed 5s on slow hosts. Let the caller's per-cell timeout dominate so
195
- // users can grant more headroom when they raise `timeout` on a cell.
196
- const readyTimeoutMs = Math.max(READY_TIMEOUT_MS_DEFAULT, timeoutMs ?? 0);
211
+ // Init headroom is the fixed infrastructure floor; the caller's per-cell timeout
212
+ // dominates when larger so users can grant more by raising `timeout` on a cell.
213
+ const readyTimeoutMs = Math.max(WORKER_INIT_TIMEOUT_MS, timeoutMs ?? 0);
197
214
  await raceWithTimeout(readyPromise, readyTimeoutMs, "Timed out initializing JS eval worker");
198
215
  worker.send({ type: "init", snapshot });
199
216
  sessions.set(sessionKey, session);
@@ -1,17 +1,33 @@
1
1
  if (!globalThis.__omp_js_prelude_loaded__) {
2
2
  globalThis.__omp_js_prelude_loaded__ = true;
3
3
 
4
- const toOptions = value => (value && typeof value === "object" && !Array.isArray(value) ? value : {});
4
+ const isPlainObject = value => value !== null && typeof value === "object" && !Array.isArray(value);
5
+ const optionsArg = (name, value, rest, example) => {
6
+ if (rest.length > 0) {
7
+ throw new TypeError(
8
+ `${name}() takes options as a single trailing object literal, not positional arguments (got ${rest.length + 1} extra args). Pass them as ${name}(..., ${example}).`,
9
+ );
10
+ }
11
+ if (value === undefined || value === null) return {};
12
+ if (!isPlainObject(value)) {
13
+ const kind = Array.isArray(value) ? "an array" : typeof value;
14
+ throw new TypeError(
15
+ `${name}() options must be a trailing object literal like ${example}, not ${kind}. JS helpers never take positional options.`,
16
+ );
17
+ }
18
+ return value;
19
+ };
5
20
  const callHelper = (name, ...args) => globalThis.__omp_helpers__[name](...args);
6
21
 
7
- const read = (path, opts = {}) => callHelper("read", path, toOptions(opts));
22
+ const read = (path, opts, ...rest) => callHelper("read", path, optionsArg("read", opts, rest, "{ offset, limit }"));
8
23
  const write = async (path, data) => callHelper("writeFile", path, data);
9
24
  const append = (path, content) => callHelper("append", path, content);
10
- const sort = (text, opts = {}) => callHelper("sortText", text, toOptions(opts));
11
- const uniq = (text, opts = {}) => callHelper("uniqText", text, toOptions(opts));
12
- const counter = (items, opts = {}) => callHelper("counter", items, toOptions(opts));
25
+ const sort = (text, opts, ...rest) => callHelper("sortText", text, optionsArg("sort", opts, rest, "{ reverse, unique }"));
26
+ const uniq = (text, opts, ...rest) => callHelper("uniqText", text, optionsArg("uniq", opts, rest, "{ count }"));
27
+ const counter = (items, opts, ...rest) =>
28
+ callHelper("counter", items, optionsArg("counter", opts, rest, "{ limit, reverse }"));
13
29
  const diff = (a, b) => callHelper("diff", a, b);
14
- const tree = (path = ".", opts = {}) => callHelper("tree", path, toOptions(opts));
30
+ const tree = (path = ".", opts, ...rest) => callHelper("tree", path, optionsArg("tree", opts, rest, "{ maxDepth, showHidden }"));
15
31
  const env = (key, value) => callHelper("env", key, value);
16
32
 
17
33
  const tool = new Proxy(
@@ -41,15 +57,15 @@ if (!globalThis.__omp_js_prelude_loaded__) {
41
57
 
42
58
  const hasOwn = (object, key) => Object.prototype.hasOwnProperty.call(object, key);
43
59
 
44
- const llm = async (prompt, opts = {}) => {
45
- const o = toOptions(opts);
60
+ const llm = async (prompt, opts, ...rest) => {
61
+ const o = optionsArg("llm", opts, rest, "{ model, system, schema }");
46
62
  const res = await globalThis.__omp_call_tool__("__llm__", { prompt, ...o });
47
63
  const text = res && typeof res === "object" ? res.text : res;
48
64
  return hasOwn(o, "schema") ? JSON.parse(text) : text;
49
65
  };
50
66
 
51
- const agent = async (prompt, opts = {}) => {
52
- const o = toOptions(opts);
67
+ const agent = async (prompt, opts, ...rest) => {
68
+ const o = optionsArg("agent", opts, rest, "{ agentType, model, context, label, schema }");
53
69
  const res = await globalThis.__omp_call_tool__("__agent__", { prompt, ...o });
54
70
  const text = res && typeof res === "object" ? res.text : res;
55
71
  return hasOwn(o, "schema") ? JSON.parse(text) : text;
@@ -16,7 +16,12 @@ import { type Api, Effort, getSupportedEfforts, type Model, type Tool } from "@o
16
16
  import * as z from "zod/v4";
17
17
  import { extractTextContent, extractToolCall, parseJsonPayload } from "../commit/utils";
18
18
 
19
- import { expandRoleAlias, formatModelString, resolveModelFromString } from "../config/model-resolver";
19
+ import {
20
+ expandRoleAlias,
21
+ formatModelString,
22
+ getModelMatchPreferences,
23
+ resolveModelFromString,
24
+ } from "../config/model-resolver";
20
25
  import type { ToolSession } from "../tools";
21
26
  import { ToolError } from "../tools/tool-errors";
22
27
  import { withBridgeTimeoutPause } from "./bridge-timeout";
@@ -65,7 +70,7 @@ function resolveTierModel(tier: LlmTier, session: ToolSession): Model<Api> | und
65
70
  const available = modelRegistry.getAvailable();
66
71
  if (available.length === 0) return undefined;
67
72
 
68
- const matchPreferences = { usageOrder: session.settings.getStorage()?.getModelUsageOrder() };
73
+ const matchPreferences = getModelMatchPreferences(session.settings);
69
74
  const resolve = (pattern: string | undefined): Model<Api> | undefined => {
70
75
  if (!pattern) return undefined;
71
76
  const expanded = expandRoleAlias(pattern, session.settings);
@@ -134,13 +139,19 @@ export async function runEvalLlm(args: unknown, options: EvalLlmBridgeOptions):
134
139
 
135
140
  const telemetry = resolveTelemetry(options.session.getTelemetry?.(), options.session.getSessionId?.() ?? undefined);
136
141
 
142
+ // Some providers (notably openai-codex) require a non-empty `instructions`
143
+ // field on every Responses request and 400 with "Instructions are required"
144
+ // when it is missing. Fall back to a minimal default so `llm(prompt)` works
145
+ // without forcing every caller to pass a `system` prompt.
146
+ const systemPrompt = system ? [system] : ["You are a helpful assistant."];
147
+
137
148
  // Suspend eval timeout accounting while the model request owns control. The
138
149
  // timeout clock restarts once the bridge returns to the cell runtime.
139
150
  const response = await withBridgeTimeoutPause(options.emitStatus, () =>
140
151
  instrumentedCompleteSimple(
141
152
  model,
142
153
  {
143
- systemPrompt: system ? [system] : undefined,
154
+ systemPrompt,
144
155
  messages: [{ role: "user", content: [{ type: "text", text: prompt }], timestamp: Date.now() }],
145
156
  tools,
146
157
  },
@@ -0,0 +1,19 @@
1
+ import { describe, expect, it } from "bun:test";
2
+ import { PYTHON_PRELUDE } from "../prelude";
3
+
4
+ describe("python prelude", () => {
5
+ it("exposes read(path, offset?, limit?) with positional optional args", () => {
6
+ // The eval docs advertise `read(path, offset?=1, limit?=None)`. A
7
+ // keyword-only signature (`def read(path, *, offset=1, limit=None)`)
8
+ // makes `read("file", 10)` raise `TypeError: read() takes 1 positional
9
+ // argument but 2 were given`, which agents in the wild repeatedly hit.
10
+ // Lock the contract so the helper accepts both positional and keyword
11
+ // forms.
12
+ const match = PYTHON_PRELUDE.match(/def\s+read\(([^)]+)\)/);
13
+ expect(match).not.toBeNull();
14
+ const signature = match?.[1] ?? "";
15
+ expect(signature).not.toContain("*,");
16
+ expect(signature).toContain("offset");
17
+ expect(signature).toContain("limit");
18
+ });
19
+ });
@@ -126,7 +126,7 @@ interface PythonSession {
126
126
 
127
127
  const sessions = new Map<string, PythonSession>();
128
128
  const startingSessions = new Map<string, Promise<PythonSession>>();
129
- const resettingSessions = new Set<string>();
129
+ const resettingSessions = new Map<string, Promise<void>>();
130
130
 
131
131
  function normalizeSessionCwd(cwd: string): string {
132
132
  return path.resolve(cwd);
@@ -611,17 +611,29 @@ async function executeOnSession(code: string, cwd: string, options: PythonExecut
611
611
  options.bridgeSessionId = sessionId;
612
612
  }
613
613
  if (options.reset) {
614
- if (resettingSessions.has(sessionKey)) {
615
- throw new Error("Python kernel reset already in progress");
616
- }
617
- resettingSessions.add(sessionKey);
618
- try {
619
- await resetSession(sessionKey);
620
- } finally {
621
- resettingSessions.delete(sessionKey);
614
+ // Coalesce concurrent resets: if another reset is in flight for this
615
+ // session, await it instead of throwing — the caller's intent ("start
616
+ // from a clean kernel") is satisfied once that reset settles.
617
+ const inFlight = resettingSessions.get(sessionKey);
618
+ if (inFlight) await inFlight.catch(() => undefined);
619
+ else {
620
+ const resetPromise = resetSession(sessionKey);
621
+ resettingSessions.set(
622
+ sessionKey,
623
+ resetPromise.then(() => undefined),
624
+ );
625
+ try {
626
+ await resetPromise;
627
+ } finally {
628
+ resettingSessions.delete(sessionKey);
629
+ }
622
630
  }
623
- } else if (resettingSessions.has(sessionKey)) {
624
- throw new Error("Python kernel reset in progress");
631
+ } else {
632
+ // A reset already in progress is an internal coordination state, not a
633
+ // user-visible failure. Wait for it to clear, then proceed with the
634
+ // requested execution on the freshly-restarted kernel.
635
+ const inFlight = resettingSessions.get(sessionKey);
636
+ if (inFlight) await inFlight.catch(() => undefined);
625
637
  }
626
638
  const session = await acquireSession(sessionKey, sessionId, cwd, options);
627
639
  if (options.signal?.aborted) {
@@ -53,7 +53,7 @@ if "__omp_prelude_loaded__" not in globals():
53
53
  _emit_status("env", key=key, value=val, action="get")
54
54
  return val
55
55
 
56
- def read(path: str | Path, *, offset: int = 1, limit: int | None = None) -> str:
56
+ def read(path: str | Path, offset: int = 1, limit: int | None = None) -> str:
57
57
  """Read file contents. offset/limit are 1-indexed line numbers."""
58
58
  p = Path(path)
59
59
  data = p.read_text(encoding="utf-8")
@@ -7,7 +7,13 @@
7
7
  * - Register commands, keyboard shortcuts, and CLI flags
8
8
  * - Interact with the user via UI primitives
9
9
  */
10
- import type { AgentMessage, AgentToolResult, AgentToolUpdateCallback, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
10
+ import type {
11
+ AgentMessage,
12
+ AgentToolResult,
13
+ AgentToolUpdateCallback,
14
+ ThinkingLevel,
15
+ ToolApproval,
16
+ } from "@oh-my-pi/pi-agent-core";
11
17
  import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
12
18
  import type {
13
19
  Api,
@@ -392,6 +398,9 @@ export interface ToolDefinition<TParams extends TSchema = TSchema, TDetails = un
392
398
  defaultInactive?: boolean;
393
399
  /** If true, tool may stage deferred changes that require explicit resolve/discard. */
394
400
  deferrable?: boolean;
401
+ /** Tool approval tier. Defaults to `"exec"` when omitted.
402
+ * `"read"`: read-only operations. `"write"`: mutations. `"exec"`: code execution. */
403
+ approval?: ToolApproval;
395
404
  /** MCP server name for discovery/search metadata when this tool fronts an MCP server. */
396
405
  mcpServerName?: string;
397
406
  /** Original MCP tool name for discovery/search metadata. */