@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.
Files changed (162) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/{CHANGELOG-gs76k6wc.md → CHANGELOG-1p8yvde7.md} +17 -1
  3. package/dist/cli.js +3645 -3689
  4. package/dist/types/advisor/advise-tool.d.ts +10 -4
  5. package/dist/types/autoresearch/tools/init-experiment.d.ts +19 -7
  6. package/dist/types/autoresearch/tools/log-experiment.d.ts +19 -11
  7. package/dist/types/autoresearch/tools/run-experiment.d.ts +4 -2
  8. package/dist/types/autoresearch/tools/update-notes.d.ts +5 -2
  9. package/dist/types/commit/agentic/tools/analyze-file.d.ts +5 -2
  10. package/dist/types/commit/agentic/tools/git-file-diff.d.ts +5 -2
  11. package/dist/types/commit/agentic/tools/git-hunk.d.ts +6 -2
  12. package/dist/types/commit/agentic/tools/git-overview.d.ts +5 -2
  13. package/dist/types/commit/agentic/tools/propose-changelog.d.ts +29 -7
  14. package/dist/types/commit/agentic/tools/propose-commit.d.ts +14 -4
  15. package/dist/types/commit/agentic/tools/recent-commits.d.ts +4 -2
  16. package/dist/types/commit/agentic/tools/schemas.d.ts +7 -3
  17. package/dist/types/commit/agentic/tools/split-commit.d.ts +37 -10
  18. package/dist/types/commit/changelog/generate.d.ts +13 -3
  19. package/dist/types/commit/shared-llm.d.ts +13 -4
  20. package/dist/types/config/config-file.d.ts +1 -1
  21. package/dist/types/config/models-config-schema-bundle.d.ts +1992 -981
  22. package/dist/types/config/models-config-schema.d.ts +1201 -580
  23. package/dist/types/config/models-config.d.ts +355 -371
  24. package/dist/types/edit/hashline/params.d.ts +4 -2
  25. package/dist/types/edit/modes/apply-patch.d.ts +4 -2
  26. package/dist/types/edit/modes/patch.d.ts +16 -5
  27. package/dist/types/edit/modes/replace.d.ts +8 -3
  28. package/dist/types/eval/bridge-timeout.d.ts +5 -2
  29. package/dist/types/eval/completion-bridge.d.ts +13 -0
  30. package/dist/types/eval/py/tool-bridge.d.ts +12 -0
  31. package/dist/types/extensibility/custom-commands/types.d.ts +4 -4
  32. package/dist/types/extensibility/custom-tools/types.d.ts +4 -4
  33. package/dist/types/extensibility/extensions/types.d.ts +4 -4
  34. package/dist/types/extensibility/hooks/types.d.ts +4 -4
  35. package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +1 -1
  36. package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +1 -1
  37. package/dist/types/extensibility/legacy-typebox.d.ts +8 -0
  38. package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +6 -13
  39. package/dist/types/goals/tools/goal-tool.d.ts +12 -4
  40. package/dist/types/lsp/index.d.ts +15 -5
  41. package/dist/types/lsp/types.d.ts +15 -5
  42. package/dist/types/security/contracts/schemas.d.ts +985 -409
  43. package/dist/types/security/publication.d.ts +92 -34
  44. package/dist/types/session/agent-session-types.d.ts +1 -1
  45. package/dist/types/session/session-entries.d.ts +1 -1
  46. package/dist/types/session/session-manager.d.ts +1 -1
  47. package/dist/types/task/types.d.ts +63 -18
  48. package/dist/types/tools/ask.d.ts +34 -8
  49. package/dist/types/tools/ast-edit.d.ts +16 -4
  50. package/dist/types/tools/ast-grep.d.ts +12 -4
  51. package/dist/types/tools/bash.d.ts +20 -11
  52. package/dist/types/tools/browser.d.ts +64 -20
  53. package/dist/types/tools/checkpoint.d.ts +16 -8
  54. package/dist/types/tools/computer.d.ts +1 -1
  55. package/dist/types/tools/debug.d.ts +118 -48
  56. package/dist/types/tools/eval.d.ts +11 -5
  57. package/dist/types/tools/gh.d.ts +74 -26
  58. package/dist/types/tools/glob.d.ts +16 -6
  59. package/dist/types/tools/grep.d.ts +18 -6
  60. package/dist/types/tools/hub/index.d.ts +116 -46
  61. package/dist/types/tools/image-gen.d.ts +25 -8
  62. package/dist/types/tools/inspect-image.d.ts +10 -4
  63. package/dist/types/tools/learn.d.ts +26 -8
  64. package/dist/types/tools/manage-skill.d.ts +16 -6
  65. package/dist/types/tools/memory-edit.d.ts +18 -6
  66. package/dist/types/tools/memory-recall.d.ts +8 -4
  67. package/dist/types/tools/memory-reflect.d.ts +10 -4
  68. package/dist/types/tools/memory-retain.d.ts +14 -4
  69. package/dist/types/tools/read.d.ts +8 -4
  70. package/dist/types/tools/security-scan.d.ts +82 -30
  71. package/dist/types/tools/todo.d.ts +30 -10
  72. package/dist/types/tools/tts.d.ts +12 -5
  73. package/dist/types/tools/vibe.d.ts +42 -18
  74. package/dist/types/tools/write.d.ts +10 -4
  75. package/dist/types/web/search/index.d.ts +20 -6
  76. package/package.json +13 -13
  77. package/scripts/legacy-pi-virtual-module.ts +2 -2
  78. package/src/advisor/advise-tool.ts +1 -1
  79. package/src/advisor/config.ts +1 -1
  80. package/src/autoresearch/tools/init-experiment.ts +1 -2
  81. package/src/autoresearch/tools/log-experiment.ts +1 -2
  82. package/src/autoresearch/tools/run-experiment.ts +1 -1
  83. package/src/autoresearch/tools/update-notes.ts +1 -1
  84. package/src/commit/agentic/tools/analyze-file.ts +1 -1
  85. package/src/commit/agentic/tools/git-file-diff.ts +1 -1
  86. package/src/commit/agentic/tools/git-hunk.ts +1 -1
  87. package/src/commit/agentic/tools/git-overview.ts +1 -1
  88. package/src/commit/agentic/tools/propose-changelog.ts +1 -1
  89. package/src/commit/agentic/tools/propose-commit.ts +1 -1
  90. package/src/commit/agentic/tools/recent-commits.ts +1 -1
  91. package/src/commit/agentic/tools/schemas.ts +1 -1
  92. package/src/commit/agentic/tools/split-commit.ts +1 -1
  93. package/src/commit/analysis/summary.ts +1 -1
  94. package/src/commit/changelog/generate.ts +1 -1
  95. package/src/config/config-file.ts +2 -2
  96. package/src/config/models-config-schema-bundle.ts +1 -8
  97. package/src/discovery/codex.ts +22 -9
  98. package/src/edit/hashline/params.ts +1 -1
  99. package/src/edit/modes/apply-patch.ts +1 -1
  100. package/src/edit/modes/patch.ts +1 -1
  101. package/src/edit/modes/replace.ts +2 -1
  102. package/src/eval/agent-bridge.ts +4 -2
  103. package/src/eval/bridge-timeout.ts +5 -2
  104. package/src/eval/completion-bridge.ts +3 -2
  105. package/src/eval/executor-base.ts +20 -1
  106. package/src/eval/js/context-manager.ts +94 -6
  107. package/src/eval/py/tool-bridge.ts +29 -9
  108. package/src/extensibility/custom-commands/loader.ts +3 -3
  109. package/src/extensibility/custom-commands/types.ts +4 -4
  110. package/src/extensibility/custom-tools/loader.ts +3 -3
  111. package/src/extensibility/custom-tools/types.ts +5 -4
  112. package/src/extensibility/extensions/loader.ts +3 -3
  113. package/src/extensibility/extensions/types.ts +5 -4
  114. package/src/extensibility/hooks/loader.ts +3 -3
  115. package/src/extensibility/hooks/types.ts +4 -4
  116. package/src/extensibility/legacy-pi-ai-shim.ts +1 -1
  117. package/src/extensibility/legacy-pi-coding-agent-shim.ts +2 -2
  118. package/src/extensibility/legacy-typebox.ts +101 -0
  119. package/src/extensibility/plugins/legacy-pi-compat.ts +13 -22
  120. package/src/goals/tools/goal-tool.ts +1 -1
  121. package/src/lsp/types.ts +1 -1
  122. package/src/modes/theme/theme.ts +3 -3
  123. package/src/security/contracts/schemas.ts +1 -5
  124. package/src/security/contracts/validation.ts +1 -1
  125. package/src/security/publication.ts +1 -1
  126. package/src/session/agent-session-types.ts +1 -1
  127. package/src/session/agent-session.ts +1 -2
  128. package/src/session/session-context.ts +3 -3
  129. package/src/session/session-entries.ts +1 -1
  130. package/src/session/session-manager.ts +1 -1
  131. package/src/slash-commands/builtin-registry.ts +3 -4
  132. package/src/task/types.ts +1 -1
  133. package/src/tools/ask.ts +1 -1
  134. package/src/tools/ast-edit.ts +1 -1
  135. package/src/tools/ast-grep.ts +1 -1
  136. package/src/tools/bash.ts +61 -3
  137. package/src/tools/browser.ts +1 -1
  138. package/src/tools/checkpoint.ts +1 -1
  139. package/src/tools/computer.ts +1 -1
  140. package/src/tools/debug.ts +1 -1
  141. package/src/tools/eval.ts +1 -1
  142. package/src/tools/gh.ts +1 -2
  143. package/src/tools/glob.ts +1 -1
  144. package/src/tools/grep.ts +1 -1
  145. package/src/tools/hub/index.ts +1 -1
  146. package/src/tools/image-gen.ts +1 -1
  147. package/src/tools/inspect-image.ts +1 -1
  148. package/src/tools/learn.ts +1 -1
  149. package/src/tools/manage-skill.ts +1 -1
  150. package/src/tools/memory-edit.ts +1 -1
  151. package/src/tools/memory-recall.ts +1 -1
  152. package/src/tools/memory-reflect.ts +1 -1
  153. package/src/tools/memory-retain.ts +1 -1
  154. package/src/tools/read.ts +1 -1
  155. package/src/tools/security-scan.ts +1 -1
  156. package/src/tools/todo.ts +1 -1
  157. package/src/tools/tts.ts +1 -1
  158. package/src/tools/vibe.ts +2 -1
  159. package/src/tools/write.ts +1 -1
  160. package/src/web/search/index.ts +2 -1
  161. package/dist/types/extensibility/typebox.d.ts +0 -181
  162. package/src/extensibility/typebox.ts +0 -958
package/src/tools/eval.ts CHANGED
@@ -1,7 +1,7 @@
1
+ import { type } from "@oh-my-pi/omptype";
1
2
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
2
3
  import type { ImageContent, ToolExample } from "@oh-my-pi/pi-ai";
3
4
  import { prompt } from "@oh-my-pi/pi-utils";
4
- import { type } from "arktype";
5
5
  import { jsBackend, juliaBackend, pythonBackend, rubyBackend } from "../eval";
6
6
  import type { ExecutorBackend, ExecutorBackendResult } from "../eval/backend";
7
7
  import { EVAL_TIMEOUT_PAUSE_OP, EVAL_TIMEOUT_RESUME_OP } from "../eval/bridge-timeout";
package/src/tools/gh.ts CHANGED
@@ -2,6 +2,7 @@ import * as fs from "node:fs/promises";
2
2
  import * as os from "node:os";
3
3
  import * as path from "node:path";
4
4
  import { scheduler } from "node:timers/promises";
5
+ import { type } from "@oh-my-pi/omptype";
5
6
  import type {
6
7
  AgentTool,
7
8
  AgentToolContext,
@@ -9,9 +10,7 @@ import type {
9
10
  AgentToolUpdateCallback,
10
11
  ToolApprovalDecision,
11
12
  } from "@oh-my-pi/pi-agent-core";
12
-
13
13
  import { getWorktreeDir, hashPath, isEnoent, logger, prompt, untilAborted } from "@oh-my-pi/pi-utils";
14
- import { type } from "arktype";
15
14
  import type { Settings } from "../config/settings";
16
15
  import githubDescription from "../prompts/tools/github.md" with { type: "text" };
17
16
  import * as git from "../utils/git";
package/src/tools/glob.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
+ import { type } from "@oh-my-pi/omptype";
3
4
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
4
5
  import type { ToolExample } from "@oh-my-pi/pi-ai";
5
6
  import * as natives from "@oh-my-pi/pi-natives";
6
7
  import type { Component } from "@oh-my-pi/pi-tui";
7
8
  import { Text } from "@oh-my-pi/pi-tui";
8
9
  import { formatGroupedPaths, isEnoent, prompt, untilAborted } from "@oh-my-pi/pi-utils";
9
- import { type } from "arktype";
10
10
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
11
11
  import { InternalUrlRouter } from "../internal-urls";
12
12
  import { splitMemoryGlobPattern } from "../internal-urls/memory-protocol";
package/src/tools/grep.ts CHANGED
@@ -2,6 +2,7 @@ import { mkdtemp, rm, stat, writeFile } from "node:fs/promises";
2
2
  import { tmpdir } from "node:os";
3
3
  import * as path from "node:path";
4
4
  import { formatHashlineHeader } from "@oh-my-pi/hashline";
5
+ import { type } from "@oh-my-pi/omptype";
5
6
  import type {
6
7
  AgentTool,
7
8
  AgentToolContext,
@@ -13,7 +14,6 @@ import { type GrepMatch, GrepOutputMode, type GrepResult, grep } from "@oh-my-pi
13
14
  import type { Component } from "@oh-my-pi/pi-tui";
14
15
  import { Text } from "@oh-my-pi/pi-tui";
15
16
  import { prompt, untilAborted } from "@oh-my-pi/pi-utils";
16
- import { type } from "arktype";
17
17
  import { recordFileSnapshot, recordSeenLinesFromBody } from "../edit/file-snapshot-store";
18
18
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
19
19
  import type { LocalProtocolOptions } from "../internal-urls/local-protocol";
@@ -15,6 +15,7 @@
15
15
  * when the agent has nothing else to do.
16
16
  */
17
17
 
18
+ import { type } from "@oh-my-pi/omptype";
18
19
  import type {
19
20
  AgentTool,
20
21
  AgentToolContext,
@@ -25,7 +26,6 @@ import type {
25
26
  import type { ToolExample } from "@oh-my-pi/pi-ai";
26
27
  import type { Component } from "@oh-my-pi/pi-tui";
27
28
  import { prompt } from "@oh-my-pi/pi-utils";
28
- import { type } from "arktype";
29
29
  import type { RenderResultOptions } from "../../extensibility/custom-tools/types";
30
30
  import { IrcBus } from "../../irc/bus";
31
31
  import type { Theme } from "../../modes/theme/theme";
@@ -1,5 +1,6 @@
1
1
  import * as os from "node:os";
2
2
  import * as path from "node:path";
3
+ import { type } from "@oh-my-pi/omptype";
3
4
  import { type ApiKey, type FetchImpl, getEnvApiKey, type Model, withAuth } from "@oh-my-pi/pi-ai";
4
5
  import { ProviderHttpError } from "@oh-my-pi/pi-ai/error";
5
6
  import {
@@ -20,7 +21,6 @@ import {
20
21
  Snowflake,
21
22
  untilAborted,
22
23
  } from "@oh-my-pi/pi-utils";
23
- import { type } from "arktype";
24
24
  import packageJson from "../../package.json" with { type: "json" };
25
25
  import { isAuthenticated, type ModelRegistry } from "../config/model-registry";
26
26
  import { settings } from "../config/settings";
@@ -1,3 +1,4 @@
1
+ import { type } from "@oh-my-pi/omptype";
1
2
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
2
3
  import { instrumentedCompleteSimple, resolveTelemetry } from "@oh-my-pi/pi-agent-core";
3
4
  import {
@@ -9,7 +10,6 @@ import {
9
10
  type ToolExample,
10
11
  } from "@oh-my-pi/pi-ai";
11
12
  import { prompt } from "@oh-my-pi/pi-utils";
12
- import { type } from "arktype";
13
13
  import { extractTextContent } from "../commit/utils";
14
14
 
15
15
  import {
@@ -1,5 +1,5 @@
1
+ import { type } from "@oh-my-pi/omptype";
1
2
  import type { AgentTool, AgentToolResult } from "@oh-my-pi/pi-agent-core";
2
- import { type } from "arktype";
3
3
  import { sanitizeSkillName, writeManagedSkill } from "../autolearn/managed-skills";
4
4
  import { isNameClaimedByAuthoredSkill } from "../extensibility/skills";
5
5
  import { localBackend } from "../memory-backend/local-backend";
@@ -1,6 +1,6 @@
1
1
  import * as path from "node:path";
2
+ import { type } from "@oh-my-pi/omptype";
2
3
  import type { AgentTool, AgentToolResult } from "@oh-my-pi/pi-agent-core";
3
- import { type } from "arktype";
4
4
  import {
5
5
  deleteManagedSkill,
6
6
  getManagedSkillsDir,
@@ -1,5 +1,5 @@
1
+ import { type } from "@oh-my-pi/omptype";
1
2
  import type { AgentTool, AgentToolResult } from "@oh-my-pi/pi-agent-core";
2
- import { type } from "arktype";
3
3
  import memoryEditDescription from "../prompts/tools/memory-edit.md" with { type: "text" };
4
4
  import type { ToolSession } from ".";
5
5
 
@@ -1,6 +1,6 @@
1
+ import { type } from "@oh-my-pi/omptype";
1
2
  import type { AgentTool, AgentToolResult } from "@oh-my-pi/pi-agent-core";
2
3
  import { logger, untilAborted } from "@oh-my-pi/pi-utils";
3
- import { type } from "arktype";
4
4
  import { formatCurrentTime, formatMemories } from "../hindsight/content";
5
5
  import recallDescription from "../prompts/tools/recall.md" with { type: "text" };
6
6
  import type { ToolSession } from ".";
@@ -1,6 +1,6 @@
1
+ import { type } from "@oh-my-pi/omptype";
1
2
  import type { AgentTool, AgentToolResult } from "@oh-my-pi/pi-agent-core";
2
3
  import { logger, untilAborted } from "@oh-my-pi/pi-utils";
3
- import { type } from "arktype";
4
4
  import { ensureBankExists } from "../hindsight/bank";
5
5
  import reflectDescription from "../prompts/tools/reflect.md" with { type: "text" };
6
6
  import type { ToolSession } from ".";
@@ -1,5 +1,5 @@
1
+ import { type } from "@oh-my-pi/omptype";
1
2
  import type { AgentTool, AgentToolResult } from "@oh-my-pi/pi-agent-core";
2
- import { type } from "arktype";
3
3
  import retainDescription from "../prompts/tools/retain.md" with { type: "text" };
4
4
  import type { ToolSession } from ".";
5
5
 
package/src/tools/read.ts CHANGED
@@ -3,6 +3,7 @@ import * as fs from "node:fs/promises";
3
3
  import * as os from "node:os";
4
4
  import * as path from "node:path";
5
5
  import { formatHashlineHeader, formatNumberedLine, formatNumberedLines } from "@oh-my-pi/hashline";
6
+ import { type } from "@oh-my-pi/omptype";
6
7
  import type {
7
8
  AgentTool,
8
9
  AgentToolContext,
@@ -25,7 +26,6 @@ import {
25
26
  readImageMetadata,
26
27
  untilAborted,
27
28
  } from "@oh-my-pi/pi-utils";
28
- import { type } from "arktype";
29
29
  import { LRUCache } from "lru-cache/raw";
30
30
  import {
31
31
  canonicalSnapshotKey,
@@ -1,5 +1,5 @@
1
+ import { type } from "@oh-my-pi/omptype";
1
2
  import type { AgentTool, AgentToolResult, ToolTier } from "@oh-my-pi/pi-agent-core";
2
- import { type } from "arktype";
3
3
  import securityScanDescription from "../prompts/tools/security-scan.md" with { type: "text" };
4
4
  import { selectSecurityAccount } from "../security/auth";
5
5
  import {
package/src/tools/todo.ts CHANGED
@@ -1,9 +1,9 @@
1
+ import { type } from "@oh-my-pi/omptype";
1
2
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
2
3
  import type { ToolExample } from "@oh-my-pi/pi-ai";
3
4
  import type { Component } from "@oh-my-pi/pi-tui";
4
5
  import { Text } from "@oh-my-pi/pi-tui";
5
6
  import { isRecord, prompt, sanitizeText } from "@oh-my-pi/pi-utils";
6
- import { type } from "arktype";
7
7
  import chalk from "chalk";
8
8
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
9
9
  import type { Theme } from "../modes/theme/theme";
package/src/tools/tts.ts CHANGED
@@ -3,10 +3,10 @@
3
3
  // backend (Kokoro-82M via kokoro-js on the shared ONNX worker) is layered on behind
4
4
  // the `providers.tts` switch.
5
5
 
6
+ import { type } from "@oh-my-pi/omptype";
6
7
  import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
7
8
  import { type ApiKey, withAuth } from "@oh-my-pi/pi-ai";
8
9
  import { ProviderHttpError } from "@oh-my-pi/pi-ai/error";
9
- import { type } from "arktype";
10
10
  import { settings } from "../config/settings";
11
11
  import type { CustomTool, CustomToolContext } from "../extensibility/custom-tools/types";
12
12
  import { ohMyPiXAIUserAgent, resolveXAIHttpCredentials } from "../lib/xai-http";
package/src/tools/vibe.ts CHANGED
@@ -10,11 +10,12 @@
10
10
  * terminal), and wait/list draw the "TV wall" — one live screen per worker,
11
11
  * stacked, each showing its tool calls and streamed text as it works.
12
12
  */
13
+
14
+ import { type } from "@oh-my-pi/omptype";
13
15
  import type { AgentTool, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
14
16
  import type { Component } from "@oh-my-pi/pi-tui";
15
17
  import { Text } from "@oh-my-pi/pi-tui";
16
18
  import { prompt } from "@oh-my-pi/pi-utils";
17
- import { type } from "arktype";
18
19
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
19
20
  import { shimmerEnabled, shimmerText } from "../modes/theme/shimmer";
20
21
  import type { Theme } from "../modes/theme/theme";
@@ -3,6 +3,7 @@ import * as fs from "node:fs/promises";
3
3
  import * as path from "node:path";
4
4
 
5
5
  import { formatHashlineHeader, stripHashlinePrefixes } from "@oh-my-pi/hashline";
6
+ import { type } from "@oh-my-pi/omptype";
6
7
  import type {
7
8
  AgentTool,
8
9
  AgentToolContext,
@@ -12,7 +13,6 @@ import type {
12
13
  } from "@oh-my-pi/pi-agent-core";
13
14
  import { type Component, Text } from "@oh-my-pi/pi-tui";
14
15
  import { isEnoent, isRecord, prompt, untilAborted } from "@oh-my-pi/pi-utils";
15
- import { type } from "arktype";
16
16
 
17
17
  import { canonicalSnapshotKey, getFileSnapshotStore } from "../edit/file-snapshot-store";
18
18
  import { normalizeToLF } from "../edit/normalize";
@@ -4,10 +4,11 @@
4
4
  * Single tool supporting Anthropic, Perplexity, Exa, Brave, Jina, Kimi, Gemini, Codex, Tavily, Kagi, Z.AI, SearXNG, and Synthetic
5
5
  * providers with provider-specific parameters exposed conditionally.
6
6
  */
7
+
8
+ import { type } from "@oh-my-pi/omptype";
7
9
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
8
10
  import type { AuthStorage } from "@oh-my-pi/pi-ai";
9
11
  import { prompt } from "@oh-my-pi/pi-utils";
10
- import { type } from "arktype";
11
12
  import { ModelRegistry } from "../../config/model-registry";
12
13
  import { settings } from "../../config/settings";
13
14
  import type { CustomTool, CustomToolContext, RenderResultOptions } from "../../extensibility/custom-tools/types";
@@ -1,181 +0,0 @@
1
- /**
2
- * Minimal `@sinclair/typebox` runtime compatibility shim.
3
- *
4
- * Historically the coding agent injected the real `@sinclair/typebox` (~5MB
5
- * dependency) into extensions, hooks, custom tools, and custom commands so
6
- * they could author parameter schemas as `Type.Object({ name: Type.String() })`.
7
- *
8
- * This module provides the subset those integrations depend on:
9
- *
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.
14
- *
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.
18
- */
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
- /** TypeBox-compatible wrapper for raw JSON Schema documents. */
37
- export type TUnsafe<_T = unknown> = ArkSchema;
38
- declare const VALIDATION_FAILURE: unique symbol;
39
- interface ValidationFailure {
40
- message: string;
41
- readonly [VALIDATION_FAILURE]: true;
42
- }
43
- interface SafeParseSuccess {
44
- success: true;
45
- data: unknown;
46
- }
47
- interface SafeParseFailure {
48
- success: false;
49
- error: ValidationFailure;
50
- }
51
- /**
52
- * JSON-Schema-shaped object with non-enumerable runtime helpers.
53
- * Validators return the validated data or a marked `{ message }` failure.
54
- */
55
- interface ArkSchema {
56
- __validator: (data: unknown) => unknown;
57
- __metadata?: Record<string, unknown>;
58
- __optional?: true;
59
- __properties?: Record<string, ArkSchema>;
60
- __additionalProperties?: boolean | ArkSchema;
61
- __infer?: unknown;
62
- __inner?: ArkSchema;
63
- safeParse(input: unknown): SafeParseSuccess | SafeParseFailure;
64
- toJSON(): Record<string, unknown>;
65
- [key: string]: unknown;
66
- }
67
- interface Meta {
68
- title?: string;
69
- description?: string;
70
- default?: unknown;
71
- examples?: unknown[];
72
- [key: string]: unknown;
73
- }
74
- interface StringOpts extends Meta {
75
- minLength?: number;
76
- maxLength?: number;
77
- pattern?: string;
78
- format?: string;
79
- }
80
- interface NumberOpts extends Meta {
81
- minimum?: number;
82
- maximum?: number;
83
- exclusiveMinimum?: number;
84
- exclusiveMaximum?: number;
85
- multipleOf?: number;
86
- }
87
- interface ArrayOpts extends Meta {
88
- minItems?: number;
89
- maxItems?: number;
90
- uniqueItems?: boolean;
91
- }
92
- interface ObjectOpts extends Meta {
93
- /**
94
- * TypeBox default: extra keys are preserved. Set `false` to reject unknowns,
95
- * `true` to allow any, or a schema to validate them.
96
- */
97
- additionalProperties?: boolean | ArkSchema;
98
- }
99
- declare function tString(opts?: StringOpts): ArkSchema;
100
- declare function tNumber(opts?: NumberOpts): ArkSchema;
101
- declare function tInteger(opts?: NumberOpts): ArkSchema;
102
- declare function tBoolean(opts?: Meta): ArkSchema;
103
- declare function tNull(opts?: Meta): ArkSchema;
104
- declare function tAny(opts?: Meta): ArkSchema;
105
- declare function tUnknown(opts?: Meta): ArkSchema;
106
- declare function tNever(opts?: Meta): ArkSchema;
107
- declare function tLiteral<V extends string | number | boolean>(value: V, opts?: Meta): ArkSchema;
108
- declare function tUnion<T extends readonly ArkSchema[]>(schemas: T, opts?: Meta): ArkSchema;
109
- declare function tIntersect(schemas: readonly ArkSchema[], opts?: Meta): ArkSchema;
110
- declare function tEnum<T extends Record<string, string | number> | readonly (string | number)[]>(values: T, opts?: Meta): ArkSchema;
111
- declare function tArray<E extends ArkSchema>(item: E, opts?: ArrayOpts): ArkSchema;
112
- declare function tTuple(items: readonly ArkSchema[], opts?: Meta): ArkSchema;
113
- declare function tObject<P extends Record<string, ArkSchema>>(properties: P, opts?: ObjectOpts): ArkSchema;
114
- declare function tRecord<K extends ArkSchema, V extends ArkSchema>(key: K, value: V, opts?: Meta): ArkSchema;
115
- declare function tOptional<E extends ArkSchema>(schema: E, opts?: Meta): ArkSchema;
116
- declare function tNullable<E extends ArkSchema>(schema: E, opts?: Meta): ArkSchema;
117
- declare function tReadonly<E extends ArkSchema>(schema: E): ArkSchema;
118
- declare function tPartial<_P extends Record<string, ArkSchema>>(obj: ArkSchema): ArkSchema;
119
- declare function tRequired<_P extends Record<string, ArkSchema>>(obj: ArkSchema): ArkSchema;
120
- declare function tPick<P extends Record<string, ArkSchema>, K extends keyof P>(obj: ArkSchema, keys: readonly K[]): ArkSchema;
121
- declare function tOmit<P extends Record<string, ArkSchema>, K extends keyof P>(obj: ArkSchema, keys: readonly K[]): ArkSchema;
122
- declare function tComposite(objects: readonly ArkSchema[], opts?: Meta): ArkSchema;
123
- export declare const Type: {
124
- readonly String: typeof tString;
125
- readonly Number: typeof tNumber;
126
- readonly Integer: typeof tInteger;
127
- readonly Boolean: typeof tBoolean;
128
- readonly Null: typeof tNull;
129
- readonly Any: typeof tAny;
130
- readonly Unknown: typeof tUnknown;
131
- readonly Unsafe: <T = unknown>(jsonSchema?: Record<string, unknown>) => TUnsafe<T>;
132
- readonly Never: typeof tNever;
133
- readonly Literal: typeof tLiteral;
134
- readonly Union: typeof tUnion;
135
- readonly Intersect: typeof tIntersect;
136
- readonly Enum: typeof tEnum;
137
- readonly Array: typeof tArray;
138
- readonly Tuple: typeof tTuple;
139
- readonly Object: typeof tObject;
140
- readonly Record: typeof tRecord;
141
- readonly Optional: typeof tOptional;
142
- readonly Nullable: typeof tNullable;
143
- readonly Readonly: typeof tReadonly;
144
- readonly Partial: typeof tPartial;
145
- readonly Required: typeof tRequired;
146
- readonly Pick: typeof tPick;
147
- readonly Omit: typeof tOmit;
148
- readonly Composite: typeof tComposite;
149
- };
150
- export type TypeBuilder = typeof Type;
151
- /** Default namespace export so `import * as typebox from "./typebox.js"` still resolves the `Type` key. */
152
- declare const _default: {
153
- Type: {
154
- readonly String: typeof tString;
155
- readonly Number: typeof tNumber;
156
- readonly Integer: typeof tInteger;
157
- readonly Boolean: typeof tBoolean;
158
- readonly Null: typeof tNull;
159
- readonly Any: typeof tAny;
160
- readonly Unknown: typeof tUnknown;
161
- readonly Unsafe: <T = unknown>(jsonSchema?: Record<string, unknown>) => TUnsafe<T>;
162
- readonly Never: typeof tNever;
163
- readonly Literal: typeof tLiteral;
164
- readonly Union: typeof tUnion;
165
- readonly Intersect: typeof tIntersect;
166
- readonly Enum: typeof tEnum;
167
- readonly Array: typeof tArray;
168
- readonly Tuple: typeof tTuple;
169
- readonly Object: typeof tObject;
170
- readonly Record: typeof tRecord;
171
- readonly Optional: typeof tOptional;
172
- readonly Nullable: typeof tNullable;
173
- readonly Readonly: typeof tReadonly;
174
- readonly Partial: typeof tPartial;
175
- readonly Required: typeof tRequired;
176
- readonly Pick: typeof tPick;
177
- readonly Omit: typeof tOmit;
178
- readonly Composite: typeof tComposite;
179
- };
180
- };
181
- export default _default;