@aexol/spectral 0.8.0 → 0.8.5

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 (561) hide show
  1. package/CHANGELOG.md +82 -55
  2. package/README.md +80 -82
  3. package/dist/agent/agents.d.ts +37 -0
  4. package/dist/agent/agents.d.ts.map +1 -0
  5. package/dist/agent/index.d.ts +29 -0
  6. package/dist/agent/index.d.ts.map +1 -0
  7. package/dist/cli.d.ts +17 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/commands/bind.d.ts +12 -0
  10. package/dist/commands/bind.d.ts.map +1 -0
  11. package/dist/commands/login-oauth.d.ts +15 -0
  12. package/dist/commands/login-oauth.d.ts.map +1 -0
  13. package/dist/commands/login.d.ts +37 -0
  14. package/dist/commands/login.d.ts.map +1 -0
  15. package/dist/commands/logout.d.ts +8 -0
  16. package/dist/commands/logout.d.ts.map +1 -0
  17. package/dist/commands/serve.d.ts +112 -0
  18. package/dist/commands/serve.d.ts.map +1 -0
  19. package/dist/commands/unbind.d.ts +8 -0
  20. package/dist/commands/unbind.d.ts.map +1 -0
  21. package/dist/config.d.ts +49 -0
  22. package/dist/config.d.ts.map +1 -0
  23. package/dist/designer/guidelines.d.ts +23 -0
  24. package/dist/designer/guidelines.d.ts.map +1 -0
  25. package/dist/designer/index.d.ts +26 -0
  26. package/dist/designer/index.d.ts.map +1 -0
  27. package/dist/designer/philosophies.d.ts +33 -0
  28. package/dist/designer/philosophies.d.ts.map +1 -0
  29. package/dist/designer/skills.d.ts +27 -0
  30. package/dist/designer/skills.d.ts.map +1 -0
  31. package/dist/designer/systems.d.ts +36 -0
  32. package/dist/designer/systems.d.ts.map +1 -0
  33. package/dist/extensions/aexol-mcp.d.ts +25 -0
  34. package/dist/extensions/aexol-mcp.d.ts.map +1 -0
  35. package/dist/extensions/kanban-bridge.d.ts +24 -0
  36. package/dist/extensions/kanban-bridge.d.ts.map +1 -0
  37. package/dist/extensions/kanban-bridge.js +668 -0
  38. package/dist/extensions/openrouter-attribution.d.ts +12 -0
  39. package/dist/extensions/openrouter-attribution.d.ts.map +1 -0
  40. package/dist/extensions/spectral-vision-fallback.d.ts +23 -0
  41. package/dist/extensions/spectral-vision-fallback.d.ts.map +1 -0
  42. package/dist/extensions/spectral-vision-fallback.js +32 -22
  43. package/dist/index.d.ts +46 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +44 -0
  46. package/dist/mcp/agent-dir.d.ts +3 -0
  47. package/dist/mcp/agent-dir.d.ts.map +1 -0
  48. package/dist/mcp/commands.d.ts +9 -0
  49. package/dist/mcp/commands.d.ts.map +1 -0
  50. package/dist/mcp/config.d.ts +78 -0
  51. package/dist/mcp/config.d.ts.map +1 -0
  52. package/dist/mcp/consent-manager.d.ts +14 -0
  53. package/dist/mcp/consent-manager.d.ts.map +1 -0
  54. package/dist/mcp/direct-tools.d.ts +11 -0
  55. package/dist/mcp/direct-tools.d.ts.map +1 -0
  56. package/dist/mcp/errors.d.ts +100 -0
  57. package/dist/mcp/errors.d.ts.map +1 -0
  58. package/dist/mcp/glimpse-ui.d.ts +10 -0
  59. package/dist/mcp/glimpse-ui.d.ts.map +1 -0
  60. package/dist/mcp/host-html-template.d.ts +17 -0
  61. package/dist/mcp/host-html-template.d.ts.map +1 -0
  62. package/dist/mcp/index.d.ts +3 -0
  63. package/dist/mcp/index.d.ts.map +1 -0
  64. package/dist/mcp/init.d.ts +10 -0
  65. package/dist/mcp/init.d.ts.map +1 -0
  66. package/dist/mcp/init.js +1 -9
  67. package/dist/mcp/lifecycle.d.ts +30 -0
  68. package/dist/mcp/lifecycle.d.ts.map +1 -0
  69. package/dist/mcp/logger.d.ts +52 -0
  70. package/dist/mcp/logger.d.ts.map +1 -0
  71. package/dist/mcp/mcp-auth-flow.d.ts +69 -0
  72. package/dist/mcp/mcp-auth-flow.d.ts.map +1 -0
  73. package/dist/mcp/mcp-auth.d.ts +100 -0
  74. package/dist/mcp/mcp-auth.d.ts.map +1 -0
  75. package/dist/mcp/mcp-callback-server.d.ts +40 -0
  76. package/dist/mcp/mcp-callback-server.d.ts.map +1 -0
  77. package/dist/mcp/mcp-oauth-provider.d.ts +101 -0
  78. package/dist/mcp/mcp-oauth-provider.d.ts.map +1 -0
  79. package/dist/mcp/metadata-cache.d.ts +32 -0
  80. package/dist/mcp/metadata-cache.d.ts.map +1 -0
  81. package/dist/mcp/npx-resolver.d.ts +7 -0
  82. package/dist/mcp/npx-resolver.d.ts.map +1 -0
  83. package/dist/mcp/oauth-handler.d.ts +19 -0
  84. package/dist/mcp/oauth-handler.d.ts.map +1 -0
  85. package/dist/mcp/onboarding-state.d.ts +13 -0
  86. package/dist/mcp/onboarding-state.d.ts.map +1 -0
  87. package/dist/mcp/proxy-modes.d.ts +12 -0
  88. package/dist/mcp/proxy-modes.d.ts.map +1 -0
  89. package/dist/mcp/resource-tools.d.ts +2 -0
  90. package/dist/mcp/resource-tools.d.ts.map +1 -0
  91. package/dist/mcp/sampling-handler.d.ts +16 -0
  92. package/dist/mcp/sampling-handler.d.ts.map +1 -0
  93. package/dist/mcp/server-manager.d.ts +42 -0
  94. package/dist/mcp/server-manager.d.ts.map +1 -0
  95. package/dist/mcp/state.d.ts +41 -0
  96. package/dist/mcp/state.d.ts.map +1 -0
  97. package/dist/mcp/tool-metadata.d.ts +11 -0
  98. package/dist/mcp/tool-metadata.d.ts.map +1 -0
  99. package/dist/mcp/tool-registrar.d.ts +9 -0
  100. package/dist/mcp/tool-registrar.d.ts.map +1 -0
  101. package/dist/mcp/types.d.ts +263 -0
  102. package/dist/mcp/types.d.ts.map +1 -0
  103. package/dist/mcp/ui-resource-handler.d.ts +10 -0
  104. package/dist/mcp/ui-resource-handler.d.ts.map +1 -0
  105. package/dist/mcp/ui-server.d.ts +37 -0
  106. package/dist/mcp/ui-server.d.ts.map +1 -0
  107. package/dist/mcp/ui-session.d.ts +27 -0
  108. package/dist/mcp/ui-session.d.ts.map +1 -0
  109. package/dist/mcp/ui-stream-types.d.ts +197 -0
  110. package/dist/mcp/ui-stream-types.d.ts.map +1 -0
  111. package/dist/mcp/utils.d.ts +17 -0
  112. package/dist/mcp/utils.d.ts.map +1 -0
  113. package/dist/mcp/vitest.config.d.ts +3 -0
  114. package/dist/mcp/vitest.config.d.ts.map +1 -0
  115. package/dist/mcp-client.d.ts +58 -0
  116. package/dist/mcp-client.d.ts.map +1 -0
  117. package/dist/mcp-client.js +2 -1
  118. package/dist/memory/branch.d.ts +124 -0
  119. package/dist/memory/branch.d.ts.map +1 -0
  120. package/dist/memory/commands/status.d.ts +4 -0
  121. package/dist/memory/commands/status.d.ts.map +1 -0
  122. package/dist/memory/commands/view.d.ts +4 -0
  123. package/dist/memory/commands/view.d.ts.map +1 -0
  124. package/dist/memory/compaction.d.ts +113 -0
  125. package/dist/memory/compaction.d.ts.map +1 -0
  126. package/dist/memory/config.d.ts +27 -0
  127. package/dist/memory/config.d.ts.map +1 -0
  128. package/dist/memory/debug-log.d.ts +12 -0
  129. package/dist/memory/debug-log.d.ts.map +1 -0
  130. package/dist/memory/hooks/compaction-hook.d.ts +4 -0
  131. package/dist/memory/hooks/compaction-hook.d.ts.map +1 -0
  132. package/dist/memory/hooks/compaction-trigger.d.ts +4 -0
  133. package/dist/memory/hooks/compaction-trigger.d.ts.map +1 -0
  134. package/dist/memory/hooks/observer-trigger.d.ts +4 -0
  135. package/dist/memory/hooks/observer-trigger.d.ts.map +1 -0
  136. package/dist/memory/ids.d.ts +2 -0
  137. package/dist/memory/ids.d.ts.map +1 -0
  138. package/dist/memory/index.d.ts +3 -0
  139. package/dist/memory/index.d.ts.map +1 -0
  140. package/dist/memory/index.js +2 -0
  141. package/dist/memory/model-budget.d.ts +4 -0
  142. package/dist/memory/model-budget.d.ts.map +1 -0
  143. package/dist/memory/observer.d.ts +21 -0
  144. package/dist/memory/observer.d.ts.map +1 -0
  145. package/dist/memory/project-observations-store.d.ts +24 -0
  146. package/dist/memory/project-observations-store.d.ts.map +1 -0
  147. package/dist/memory/prompts.d.ts +11 -0
  148. package/dist/memory/prompts.d.ts.map +1 -0
  149. package/dist/memory/relevance.d.ts +4 -0
  150. package/dist/memory/relevance.d.ts.map +1 -0
  151. package/dist/memory/runtime.d.ts +40 -0
  152. package/dist/memory/runtime.d.ts.map +1 -0
  153. package/dist/memory/serialize.d.ts +26 -0
  154. package/dist/memory/serialize.d.ts.map +1 -0
  155. package/dist/memory/tokens.d.ts +8 -0
  156. package/dist/memory/tokens.d.ts.map +1 -0
  157. package/dist/memory/tools/read-project-observations.d.ts +8 -0
  158. package/dist/memory/tools/read-project-observations.d.ts.map +1 -0
  159. package/dist/memory/tools/recall-observation.d.ts +63 -0
  160. package/dist/memory/tools/recall-observation.d.ts.map +1 -0
  161. package/dist/memory/tools/write-project-observation.d.ts +9 -0
  162. package/dist/memory/tools/write-project-observation.d.ts.map +1 -0
  163. package/dist/memory/tools/write-project-observation.js +60 -0
  164. package/dist/memory/types.d.ts +65 -0
  165. package/dist/memory/types.d.ts.map +1 -0
  166. package/dist/preflight.d.ts +27 -0
  167. package/dist/preflight.d.ts.map +1 -0
  168. package/dist/preflight.js +3 -1
  169. package/dist/relay/auto-research.d.ts +64 -0
  170. package/dist/relay/auto-research.d.ts.map +1 -0
  171. package/dist/relay/auto-research.js +208 -69
  172. package/dist/relay/client.d.ts +126 -0
  173. package/dist/relay/client.d.ts.map +1 -0
  174. package/dist/relay/dispatcher.d.ts +207 -0
  175. package/dist/relay/dispatcher.d.ts.map +1 -0
  176. package/dist/relay/machine-store.d.ts +68 -0
  177. package/dist/relay/machine-store.d.ts.map +1 -0
  178. package/dist/relay/models-fetch.d.ts +75 -0
  179. package/dist/relay/models-fetch.d.ts.map +1 -0
  180. package/dist/relay/registration.d.ts +81 -0
  181. package/dist/relay/registration.d.ts.map +1 -0
  182. package/dist/sdk/agent-core/agent-loop.d.ts +24 -0
  183. package/dist/sdk/agent-core/agent-loop.d.ts.map +1 -0
  184. package/dist/sdk/agent-core/agent.d.ts +125 -0
  185. package/dist/sdk/agent-core/agent.d.ts.map +1 -0
  186. package/dist/sdk/agent-core/harness/agent-harness.d.ts +92 -0
  187. package/dist/sdk/agent-core/harness/agent-harness.d.ts.map +1 -0
  188. package/dist/sdk/agent-core/harness/compaction/branch-summarization.d.ts +53 -0
  189. package/dist/sdk/agent-core/harness/compaction/branch-summarization.d.ts.map +1 -0
  190. package/dist/sdk/agent-core/harness/compaction/compaction.d.ts +95 -0
  191. package/dist/sdk/agent-core/harness/compaction/compaction.d.ts.map +1 -0
  192. package/dist/sdk/agent-core/harness/compaction/utils.d.ts +25 -0
  193. package/dist/sdk/agent-core/harness/compaction/utils.d.ts.map +1 -0
  194. package/dist/sdk/agent-core/harness/env/nodejs.d.ts +51 -0
  195. package/dist/sdk/agent-core/harness/env/nodejs.d.ts.map +1 -0
  196. package/dist/sdk/agent-core/harness/messages.d.ts +51 -0
  197. package/dist/sdk/agent-core/harness/messages.d.ts.map +1 -0
  198. package/dist/sdk/agent-core/harness/prompt-templates.d.ts +48 -0
  199. package/dist/sdk/agent-core/harness/prompt-templates.d.ts.map +1 -0
  200. package/dist/sdk/agent-core/harness/session/jsonl-repo.d.ts +26 -0
  201. package/dist/sdk/agent-core/harness/session/jsonl-repo.d.ts.map +1 -0
  202. package/dist/sdk/agent-core/harness/session/jsonl-storage.d.ts +33 -0
  203. package/dist/sdk/agent-core/harness/session/jsonl-storage.d.ts.map +1 -0
  204. package/dist/sdk/agent-core/harness/session/memory-repo.d.ts +18 -0
  205. package/dist/sdk/agent-core/harness/session/memory-repo.d.ts.map +1 -0
  206. package/dist/sdk/agent-core/harness/session/memory-storage.d.ts +25 -0
  207. package/dist/sdk/agent-core/harness/session/memory-storage.d.ts.map +1 -0
  208. package/dist/sdk/agent-core/harness/session/repo-utils.d.ts +11 -0
  209. package/dist/sdk/agent-core/harness/session/repo-utils.d.ts.map +1 -0
  210. package/dist/sdk/agent-core/harness/session/session.d.ts +32 -0
  211. package/dist/sdk/agent-core/harness/session/session.d.ts.map +1 -0
  212. package/dist/sdk/agent-core/harness/session/uuid.d.ts +2 -0
  213. package/dist/sdk/agent-core/harness/session/uuid.d.ts.map +1 -0
  214. package/dist/sdk/agent-core/harness/skills.d.ts +44 -0
  215. package/dist/sdk/agent-core/harness/skills.d.ts.map +1 -0
  216. package/dist/sdk/agent-core/harness/system-prompt.d.ts +3 -0
  217. package/dist/sdk/agent-core/harness/system-prompt.d.ts.map +1 -0
  218. package/dist/sdk/agent-core/harness/types.d.ts +601 -0
  219. package/dist/sdk/agent-core/harness/types.d.ts.map +1 -0
  220. package/dist/sdk/agent-core/harness/utils/shell-output.d.ts +14 -0
  221. package/dist/sdk/agent-core/harness/utils/shell-output.d.ts.map +1 -0
  222. package/dist/sdk/agent-core/harness/utils/truncate.d.ts +70 -0
  223. package/dist/sdk/agent-core/harness/utils/truncate.d.ts.map +1 -0
  224. package/dist/sdk/agent-core/index.d.ts +20 -0
  225. package/dist/sdk/agent-core/index.d.ts.map +1 -0
  226. package/dist/sdk/agent-core/node.d.ts +3 -0
  227. package/dist/sdk/agent-core/node.d.ts.map +1 -0
  228. package/dist/sdk/agent-core/proxy.d.ts +69 -0
  229. package/dist/sdk/agent-core/proxy.d.ts.map +1 -0
  230. package/dist/sdk/agent-core/types.d.ts +393 -0
  231. package/dist/sdk/agent-core/types.d.ts.map +1 -0
  232. package/dist/sdk/ai/api-registry.d.ts +20 -0
  233. package/dist/sdk/ai/api-registry.d.ts.map +1 -0
  234. package/dist/sdk/ai/cli.d.ts +3 -0
  235. package/dist/sdk/ai/cli.d.ts.map +1 -0
  236. package/dist/sdk/ai/env-api-keys.d.ts +18 -0
  237. package/dist/sdk/ai/env-api-keys.d.ts.map +1 -0
  238. package/dist/sdk/ai/env-api-keys.js +9 -49
  239. package/dist/sdk/ai/image-models.d.ts +10 -0
  240. package/dist/sdk/ai/image-models.d.ts.map +1 -0
  241. package/dist/sdk/ai/image-models.generated.d.ts +440 -0
  242. package/dist/sdk/ai/image-models.generated.d.ts.map +1 -0
  243. package/dist/sdk/ai/images-api-registry.d.ts +14 -0
  244. package/dist/sdk/ai/images-api-registry.d.ts.map +1 -0
  245. package/dist/sdk/ai/images.d.ts +4 -0
  246. package/dist/sdk/ai/images.d.ts.map +1 -0
  247. package/dist/sdk/ai/index.d.ts +21 -0
  248. package/dist/sdk/ai/index.d.ts.map +1 -0
  249. package/dist/sdk/ai/models.d.ts +18 -0
  250. package/dist/sdk/ai/models.d.ts.map +1 -0
  251. package/dist/sdk/ai/models.generated.d.ts +17349 -0
  252. package/dist/sdk/ai/models.generated.d.ts.map +1 -0
  253. package/dist/sdk/ai/oauth.d.ts +2 -0
  254. package/dist/sdk/ai/oauth.d.ts.map +1 -0
  255. package/dist/sdk/ai/providers/anthropic.d.ts +54 -0
  256. package/dist/sdk/ai/providers/anthropic.d.ts.map +1 -0
  257. package/dist/sdk/ai/providers/faux.d.ts +56 -0
  258. package/dist/sdk/ai/providers/faux.d.ts.map +1 -0
  259. package/dist/sdk/ai/providers/github-copilot-headers.d.ts +8 -0
  260. package/dist/sdk/ai/providers/github-copilot-headers.d.ts.map +1 -0
  261. package/dist/sdk/ai/providers/openai-completions.d.ts +19 -0
  262. package/dist/sdk/ai/providers/openai-completions.d.ts.map +1 -0
  263. package/dist/sdk/ai/providers/openai-prompt-cache.d.ts +3 -0
  264. package/dist/sdk/ai/providers/openai-prompt-cache.d.ts.map +1 -0
  265. package/dist/sdk/ai/providers/register-builtins.d.ts +15 -0
  266. package/dist/sdk/ai/providers/register-builtins.d.ts.map +1 -0
  267. package/dist/sdk/ai/providers/simple-options.d.ts +8 -0
  268. package/dist/sdk/ai/providers/simple-options.d.ts.map +1 -0
  269. package/dist/sdk/ai/providers/transform-messages.d.ts +8 -0
  270. package/dist/sdk/ai/providers/transform-messages.d.ts.map +1 -0
  271. package/dist/sdk/ai/session-resources.d.ts +4 -0
  272. package/dist/sdk/ai/session-resources.d.ts.map +1 -0
  273. package/dist/sdk/ai/stream.d.ts +8 -0
  274. package/dist/sdk/ai/stream.d.ts.map +1 -0
  275. package/dist/sdk/ai/types.d.ts +488 -0
  276. package/dist/sdk/ai/types.d.ts.map +1 -0
  277. package/dist/sdk/ai/utils/diagnostics.d.ts +19 -0
  278. package/dist/sdk/ai/utils/diagnostics.d.ts.map +1 -0
  279. package/dist/sdk/ai/utils/event-stream.d.ts +21 -0
  280. package/dist/sdk/ai/utils/event-stream.d.ts.map +1 -0
  281. package/dist/sdk/ai/utils/hash.d.ts +3 -0
  282. package/dist/sdk/ai/utils/hash.d.ts.map +1 -0
  283. package/dist/sdk/ai/utils/headers.d.ts +2 -0
  284. package/dist/sdk/ai/utils/headers.d.ts.map +1 -0
  285. package/dist/sdk/ai/utils/json-parse.d.ts +16 -0
  286. package/dist/sdk/ai/utils/json-parse.d.ts.map +1 -0
  287. package/dist/sdk/ai/utils/node-http-proxy.d.ts +10 -0
  288. package/dist/sdk/ai/utils/node-http-proxy.d.ts.map +1 -0
  289. package/dist/sdk/ai/utils/oauth/anthropic.d.ts +25 -0
  290. package/dist/sdk/ai/utils/oauth/anthropic.d.ts.map +1 -0
  291. package/dist/sdk/ai/utils/oauth/anthropic.js +1 -1
  292. package/dist/sdk/ai/utils/oauth/device-code.d.ts +19 -0
  293. package/dist/sdk/ai/utils/oauth/device-code.d.ts.map +1 -0
  294. package/dist/sdk/ai/utils/oauth/github-copilot.d.ts +30 -0
  295. package/dist/sdk/ai/utils/oauth/github-copilot.d.ts.map +1 -0
  296. package/dist/sdk/ai/utils/oauth/index.d.ts +58 -0
  297. package/dist/sdk/ai/utils/oauth/index.d.ts.map +1 -0
  298. package/dist/sdk/ai/utils/oauth/oauth-page.d.ts +3 -0
  299. package/dist/sdk/ai/utils/oauth/oauth-page.d.ts.map +1 -0
  300. package/dist/sdk/ai/utils/oauth/openai-codex.d.ts +34 -0
  301. package/dist/sdk/ai/utils/oauth/openai-codex.d.ts.map +1 -0
  302. package/dist/sdk/ai/utils/oauth/openai-codex.js +1 -1
  303. package/dist/sdk/ai/utils/oauth/pkce.d.ts +13 -0
  304. package/dist/sdk/ai/utils/oauth/pkce.d.ts.map +1 -0
  305. package/dist/sdk/ai/utils/oauth/types.d.ts +64 -0
  306. package/dist/sdk/ai/utils/oauth/types.d.ts.map +1 -0
  307. package/dist/sdk/ai/utils/overflow.d.ts +56 -0
  308. package/dist/sdk/ai/utils/overflow.d.ts.map +1 -0
  309. package/dist/sdk/ai/utils/sanitize-unicode.d.ts +22 -0
  310. package/dist/sdk/ai/utils/sanitize-unicode.d.ts.map +1 -0
  311. package/dist/sdk/ai/utils/typebox-helpers.d.ts +17 -0
  312. package/dist/sdk/ai/utils/typebox-helpers.d.ts.map +1 -0
  313. package/dist/sdk/ai/utils/validation.d.ts +18 -0
  314. package/dist/sdk/ai/utils/validation.d.ts.map +1 -0
  315. package/dist/sdk/coding-agent/cli.d.ts +3 -0
  316. package/dist/sdk/coding-agent/cli.d.ts.map +1 -0
  317. package/dist/sdk/coding-agent/config.d.ts +71 -0
  318. package/dist/sdk/coding-agent/config.d.ts.map +1 -0
  319. package/dist/sdk/coding-agent/config.js +2 -69
  320. package/dist/sdk/coding-agent/core/agent-session-runtime.d.ts +117 -0
  321. package/dist/sdk/coding-agent/core/agent-session-runtime.d.ts.map +1 -0
  322. package/dist/sdk/coding-agent/core/agent-session-services.d.ts +86 -0
  323. package/dist/sdk/coding-agent/core/agent-session-services.d.ts.map +1 -0
  324. package/dist/sdk/coding-agent/core/agent-session.d.ts +626 -0
  325. package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -0
  326. package/dist/sdk/coding-agent/core/auth-guidance.d.ts +5 -0
  327. package/dist/sdk/coding-agent/core/auth-guidance.d.ts.map +1 -0
  328. package/dist/sdk/coding-agent/core/auth-storage.d.ts +145 -0
  329. package/dist/sdk/coding-agent/core/auth-storage.d.ts.map +1 -0
  330. package/dist/sdk/coding-agent/core/bash-executor.d.ts +32 -0
  331. package/dist/sdk/coding-agent/core/bash-executor.d.ts.map +1 -0
  332. package/dist/sdk/coding-agent/core/compaction/branch-summarization.d.ts +88 -0
  333. package/dist/sdk/coding-agent/core/compaction/branch-summarization.d.ts.map +1 -0
  334. package/dist/sdk/coding-agent/core/compaction/compaction.d.ts +142 -0
  335. package/dist/sdk/coding-agent/core/compaction/compaction.d.ts.map +1 -0
  336. package/dist/sdk/coding-agent/core/compaction/index.d.ts +7 -0
  337. package/dist/sdk/coding-agent/core/compaction/index.d.ts.map +1 -0
  338. package/dist/sdk/coding-agent/core/compaction/utils.d.ts +38 -0
  339. package/dist/sdk/coding-agent/core/compaction/utils.d.ts.map +1 -0
  340. package/dist/sdk/coding-agent/core/defaults.d.ts +3 -0
  341. package/dist/sdk/coding-agent/core/defaults.d.ts.map +1 -0
  342. package/dist/sdk/coding-agent/core/diagnostics.d.ts +15 -0
  343. package/dist/sdk/coding-agent/core/diagnostics.d.ts.map +1 -0
  344. package/dist/sdk/coding-agent/core/event-bus.d.ts +9 -0
  345. package/dist/sdk/coding-agent/core/event-bus.d.ts.map +1 -0
  346. package/dist/sdk/coding-agent/core/exec.d.ts +29 -0
  347. package/dist/sdk/coding-agent/core/exec.d.ts.map +1 -0
  348. package/dist/sdk/coding-agent/core/extensions/index.d.ts +12 -0
  349. package/dist/sdk/coding-agent/core/extensions/index.d.ts.map +1 -0
  350. package/dist/sdk/coding-agent/core/extensions/loader.d.ts +24 -0
  351. package/dist/sdk/coding-agent/core/extensions/loader.d.ts.map +1 -0
  352. package/dist/sdk/coding-agent/core/extensions/loader.js +3 -35
  353. package/dist/sdk/coding-agent/core/extensions/runner.d.ts +161 -0
  354. package/dist/sdk/coding-agent/core/extensions/runner.d.ts.map +1 -0
  355. package/dist/sdk/coding-agent/core/extensions/runner.js +1 -2
  356. package/dist/sdk/coding-agent/core/extensions/types.d.ts +1181 -0
  357. package/dist/sdk/coding-agent/core/extensions/types.d.ts.map +1 -0
  358. package/dist/sdk/coding-agent/core/extensions/wrapper.d.ts +20 -0
  359. package/dist/sdk/coding-agent/core/extensions/wrapper.d.ts.map +1 -0
  360. package/dist/sdk/coding-agent/core/http-dispatcher.d.ts +21 -0
  361. package/dist/sdk/coding-agent/core/http-dispatcher.d.ts.map +1 -0
  362. package/dist/sdk/coding-agent/core/index.d.ts +12 -0
  363. package/dist/sdk/coding-agent/core/index.d.ts.map +1 -0
  364. package/dist/sdk/coding-agent/core/keybindings.d.ts +371 -0
  365. package/dist/sdk/coding-agent/core/keybindings.d.ts.map +1 -0
  366. package/dist/sdk/coding-agent/core/messages.d.ts +77 -0
  367. package/dist/sdk/coding-agent/core/messages.d.ts.map +1 -0
  368. package/dist/sdk/coding-agent/core/model-registry.d.ts +150 -0
  369. package/dist/sdk/coding-agent/core/model-registry.d.ts.map +1 -0
  370. package/dist/sdk/coding-agent/core/model-resolver-utils.d.ts +7 -0
  371. package/dist/sdk/coding-agent/core/model-resolver-utils.d.ts.map +1 -0
  372. package/dist/sdk/coding-agent/core/model-resolver-utils.js +8 -0
  373. package/dist/sdk/coding-agent/core/model-resolver.d.ts +110 -0
  374. package/dist/sdk/coding-agent/core/model-resolver.d.ts.map +1 -0
  375. package/dist/sdk/coding-agent/core/model-resolver.js +1 -1
  376. package/dist/sdk/coding-agent/core/output-guard.d.ts +6 -0
  377. package/dist/sdk/coding-agent/core/output-guard.d.ts.map +1 -0
  378. package/dist/sdk/coding-agent/core/package-manager.d.ts +204 -0
  379. package/dist/sdk/coding-agent/core/package-manager.d.ts.map +1 -0
  380. package/dist/sdk/coding-agent/core/prompt-templates.d.ts +52 -0
  381. package/dist/sdk/coding-agent/core/prompt-templates.d.ts.map +1 -0
  382. package/dist/sdk/coding-agent/core/provider-display-names.d.ts +2 -0
  383. package/dist/sdk/coding-agent/core/provider-display-names.d.ts.map +1 -0
  384. package/dist/sdk/coding-agent/core/resolve-config-value.d.ts +23 -0
  385. package/dist/sdk/coding-agent/core/resolve-config-value.d.ts.map +1 -0
  386. package/dist/sdk/coding-agent/core/resource-loader.d.ts +194 -0
  387. package/dist/sdk/coding-agent/core/resource-loader.d.ts.map +1 -0
  388. package/dist/sdk/coding-agent/core/resource-loader.js +1 -1
  389. package/dist/sdk/coding-agent/core/sdk.d.ts +107 -0
  390. package/dist/sdk/coding-agent/core/sdk.d.ts.map +1 -0
  391. package/dist/sdk/coding-agent/core/session-cwd.d.ts +19 -0
  392. package/dist/sdk/coding-agent/core/session-cwd.d.ts.map +1 -0
  393. package/dist/sdk/coding-agent/core/session-manager.d.ts +333 -0
  394. package/dist/sdk/coding-agent/core/session-manager.d.ts.map +1 -0
  395. package/dist/sdk/coding-agent/core/settings-manager.d.ts +209 -0
  396. package/dist/sdk/coding-agent/core/settings-manager.d.ts.map +1 -0
  397. package/dist/sdk/coding-agent/core/settings-manager.js +1 -170
  398. package/dist/sdk/coding-agent/core/skills.d.ts +60 -0
  399. package/dist/sdk/coding-agent/core/skills.d.ts.map +1 -0
  400. package/dist/sdk/coding-agent/core/slash-commands.d.ts +14 -0
  401. package/dist/sdk/coding-agent/core/slash-commands.d.ts.map +1 -0
  402. package/dist/sdk/coding-agent/core/source-info.d.ts +18 -0
  403. package/dist/sdk/coding-agent/core/source-info.d.ts.map +1 -0
  404. package/dist/sdk/coding-agent/core/system-prompt.d.ts +28 -0
  405. package/dist/sdk/coding-agent/core/system-prompt.d.ts.map +1 -0
  406. package/dist/sdk/coding-agent/core/system-prompt.js +3 -1
  407. package/dist/sdk/coding-agent/core/telemetry.d.ts +3 -0
  408. package/dist/sdk/coding-agent/core/telemetry.d.ts.map +1 -0
  409. package/dist/sdk/coding-agent/core/theme.d.ts +28 -0
  410. package/dist/sdk/coding-agent/core/theme.d.ts.map +1 -0
  411. package/dist/sdk/coding-agent/core/theme.js +202 -0
  412. package/dist/sdk/coding-agent/core/timings.d.ts +8 -0
  413. package/dist/sdk/coding-agent/core/timings.d.ts.map +1 -0
  414. package/dist/sdk/coding-agent/core/tools/bash.d.ts +63 -0
  415. package/dist/sdk/coding-agent/core/tools/bash.d.ts.map +1 -0
  416. package/dist/sdk/coding-agent/core/tools/bash.js +17 -18
  417. package/dist/sdk/coding-agent/core/tools/edit-diff.d.ts +87 -0
  418. package/dist/sdk/coding-agent/core/tools/edit-diff.d.ts.map +1 -0
  419. package/dist/sdk/coding-agent/core/tools/edit.d.ts +39 -0
  420. package/dist/sdk/coding-agent/core/tools/edit.d.ts.map +1 -0
  421. package/dist/sdk/coding-agent/core/tools/edit.js +7 -8
  422. package/dist/sdk/coding-agent/core/tools/file-mutation-queue.d.ts +6 -0
  423. package/dist/sdk/coding-agent/core/tools/file-mutation-queue.d.ts.map +1 -0
  424. package/dist/sdk/coding-agent/core/tools/find.d.ts +35 -0
  425. package/dist/sdk/coding-agent/core/tools/find.d.ts.map +1 -0
  426. package/dist/sdk/coding-agent/core/tools/find.js +9 -13
  427. package/dist/sdk/coding-agent/core/tools/grep.d.ts +37 -0
  428. package/dist/sdk/coding-agent/core/tools/grep.d.ts.map +1 -0
  429. package/dist/sdk/coding-agent/core/tools/grep.js +10 -14
  430. package/dist/sdk/coding-agent/core/tools/index.d.ts +40 -0
  431. package/dist/sdk/coding-agent/core/tools/index.d.ts.map +1 -0
  432. package/dist/sdk/coding-agent/core/tools/ls.d.ts +37 -0
  433. package/dist/sdk/coding-agent/core/tools/ls.d.ts.map +1 -0
  434. package/dist/sdk/coding-agent/core/tools/ls.js +9 -10
  435. package/dist/sdk/coding-agent/core/tools/output-accumulator.d.ts +52 -0
  436. package/dist/sdk/coding-agent/core/tools/output-accumulator.d.ts.map +1 -0
  437. package/dist/sdk/coding-agent/core/tools/path-utils.d.ts +8 -0
  438. package/dist/sdk/coding-agent/core/tools/path-utils.d.ts.map +1 -0
  439. package/dist/sdk/coding-agent/core/tools/read.d.ts +35 -0
  440. package/dist/sdk/coding-agent/core/tools/read.d.ts.map +1 -0
  441. package/dist/sdk/coding-agent/core/tools/read.js +33 -35
  442. package/dist/sdk/coding-agent/core/tools/render-diff.d.ts +17 -0
  443. package/dist/sdk/coding-agent/core/tools/render-diff.d.ts.map +1 -0
  444. package/dist/sdk/coding-agent/{modes/interactive/components/diff.js → core/tools/render-diff.js} +18 -31
  445. package/dist/sdk/coding-agent/core/tools/render-utils.d.ts +21 -0
  446. package/dist/sdk/coding-agent/core/tools/render-utils.d.ts.map +1 -0
  447. package/dist/sdk/coding-agent/core/tools/tool-definition-wrapper.d.ts +14 -0
  448. package/dist/sdk/coding-agent/core/tools/tool-definition-wrapper.d.ts.map +1 -0
  449. package/dist/sdk/coding-agent/core/tools/truncate.d.ts +70 -0
  450. package/dist/sdk/coding-agent/core/tools/truncate.d.ts.map +1 -0
  451. package/dist/sdk/coding-agent/core/tools/write.d.ts +26 -0
  452. package/dist/sdk/coding-agent/core/tools/write.d.ts.map +1 -0
  453. package/dist/sdk/coding-agent/core/tools/write.js +10 -11
  454. package/dist/sdk/coding-agent/index.d.ts +29 -0
  455. package/dist/sdk/coding-agent/index.d.ts.map +1 -0
  456. package/dist/sdk/coding-agent/index.js +7 -5
  457. package/dist/sdk/coding-agent/main.d.ts +2 -0
  458. package/dist/sdk/coding-agent/main.d.ts.map +1 -0
  459. package/dist/sdk/coding-agent/migrations.d.ts +33 -0
  460. package/dist/sdk/coding-agent/migrations.d.ts.map +1 -0
  461. package/dist/sdk/coding-agent/modes/index.d.ts +8 -0
  462. package/dist/sdk/coding-agent/modes/index.d.ts.map +1 -0
  463. package/dist/sdk/coding-agent/modes/index.js +0 -1
  464. package/dist/sdk/coding-agent/modes/print-mode.d.ts +28 -0
  465. package/dist/sdk/coding-agent/modes/print-mode.d.ts.map +1 -0
  466. package/dist/sdk/coding-agent/modes/rpc/jsonl.d.ts +17 -0
  467. package/dist/sdk/coding-agent/modes/rpc/jsonl.d.ts.map +1 -0
  468. package/dist/sdk/coding-agent/modes/rpc/rpc-client.d.ts +224 -0
  469. package/dist/sdk/coding-agent/modes/rpc/rpc-client.d.ts.map +1 -0
  470. package/dist/sdk/coding-agent/modes/rpc/rpc-mode.d.ts +20 -0
  471. package/dist/sdk/coding-agent/modes/rpc/rpc-mode.d.ts.map +1 -0
  472. package/dist/sdk/coding-agent/modes/rpc/rpc-mode.js +2 -2
  473. package/dist/sdk/coding-agent/modes/rpc/rpc-types.d.ts +419 -0
  474. package/dist/sdk/coding-agent/modes/rpc/rpc-types.d.ts.map +1 -0
  475. package/dist/sdk/coding-agent/utils/ansi.d.ts +2 -0
  476. package/dist/sdk/coding-agent/utils/ansi.d.ts.map +1 -0
  477. package/dist/sdk/coding-agent/utils/changelog.d.ts +21 -0
  478. package/dist/sdk/coding-agent/utils/changelog.d.ts.map +1 -0
  479. package/dist/sdk/coding-agent/utils/child-process.d.ts +15 -0
  480. package/dist/sdk/coding-agent/utils/child-process.d.ts.map +1 -0
  481. package/dist/sdk/coding-agent/utils/clipboard-image.d.ts +11 -0
  482. package/dist/sdk/coding-agent/utils/clipboard-image.d.ts.map +1 -0
  483. package/dist/sdk/coding-agent/utils/clipboard-native.d.ts +8 -0
  484. package/dist/sdk/coding-agent/utils/clipboard-native.d.ts.map +1 -0
  485. package/dist/sdk/coding-agent/utils/clipboard.d.ts +2 -0
  486. package/dist/sdk/coding-agent/utils/clipboard.d.ts.map +1 -0
  487. package/dist/sdk/coding-agent/utils/exif-orientation.d.ts +5 -0
  488. package/dist/sdk/coding-agent/utils/exif-orientation.d.ts.map +1 -0
  489. package/dist/sdk/coding-agent/utils/frontmatter.d.ts +8 -0
  490. package/dist/sdk/coding-agent/utils/frontmatter.d.ts.map +1 -0
  491. package/dist/sdk/coding-agent/utils/fs-watch.d.ts +5 -0
  492. package/dist/sdk/coding-agent/utils/fs-watch.d.ts.map +1 -0
  493. package/dist/sdk/coding-agent/utils/git.d.ts +26 -0
  494. package/dist/sdk/coding-agent/utils/git.d.ts.map +1 -0
  495. package/dist/sdk/coding-agent/utils/html.d.ts +7 -0
  496. package/dist/sdk/coding-agent/utils/html.d.ts.map +1 -0
  497. package/dist/sdk/coding-agent/utils/image-convert.d.ts +9 -0
  498. package/dist/sdk/coding-agent/utils/image-convert.d.ts.map +1 -0
  499. package/dist/sdk/coding-agent/utils/image-resize.d.ts +36 -0
  500. package/dist/sdk/coding-agent/utils/image-resize.d.ts.map +1 -0
  501. package/dist/sdk/coding-agent/utils/mime.d.ts +3 -0
  502. package/dist/sdk/coding-agent/utils/mime.d.ts.map +1 -0
  503. package/dist/sdk/coding-agent/utils/paths.d.ts +31 -0
  504. package/dist/sdk/coding-agent/utils/paths.d.ts.map +1 -0
  505. package/dist/sdk/coding-agent/utils/photon.d.ts +13 -0
  506. package/dist/sdk/coding-agent/utils/photon.d.ts.map +1 -0
  507. package/dist/sdk/coding-agent/utils/photon.js +2 -10
  508. package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts +2 -0
  509. package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts.map +1 -0
  510. package/dist/sdk/coding-agent/utils/pi-user-agent.js +1 -2
  511. package/dist/sdk/coding-agent/utils/shell.d.ts +30 -0
  512. package/dist/sdk/coding-agent/utils/shell.d.ts.map +1 -0
  513. package/dist/sdk/coding-agent/utils/sleep.d.ts +5 -0
  514. package/dist/sdk/coding-agent/utils/sleep.d.ts.map +1 -0
  515. package/dist/sdk/coding-agent/utils/syntax-highlight.d.ts +12 -0
  516. package/dist/sdk/coding-agent/utils/syntax-highlight.d.ts.map +1 -0
  517. package/dist/sdk/coding-agent/utils/tools-manager.d.ts +3 -0
  518. package/dist/sdk/coding-agent/utils/tools-manager.d.ts.map +1 -0
  519. package/dist/sdk/coding-agent/utils/version-check.d.ts +15 -0
  520. package/dist/sdk/coding-agent/utils/version-check.d.ts.map +1 -0
  521. package/dist/sdk/coding-agent/utils/windows-self-update.d.ts +3 -0
  522. package/dist/sdk/coding-agent/utils/windows-self-update.d.ts.map +1 -0
  523. package/dist/server/agent-bridge.d.ts +308 -0
  524. package/dist/server/agent-bridge.d.ts.map +1 -0
  525. package/dist/server/agent-bridge.js +2 -1
  526. package/dist/server/handlers/errors.d.ts +26 -0
  527. package/dist/server/handlers/errors.d.ts.map +1 -0
  528. package/dist/server/handlers/paths-autocomplete.d.ts +45 -0
  529. package/dist/server/handlers/paths-autocomplete.d.ts.map +1 -0
  530. package/dist/server/handlers/projects.d.ts +58 -0
  531. package/dist/server/handlers/projects.d.ts.map +1 -0
  532. package/dist/server/handlers/queue.d.ts +27 -0
  533. package/dist/server/handlers/queue.d.ts.map +1 -0
  534. package/dist/server/handlers/sessions.d.ts +50 -0
  535. package/dist/server/handlers/sessions.d.ts.map +1 -0
  536. package/dist/server/paths.d.ts +51 -0
  537. package/dist/server/paths.d.ts.map +1 -0
  538. package/dist/server/session-stream.d.ts +379 -0
  539. package/dist/server/session-stream.d.ts.map +1 -0
  540. package/dist/server/shutdown.d.ts +102 -0
  541. package/dist/server/shutdown.d.ts.map +1 -0
  542. package/dist/server/storage.d.ts +287 -0
  543. package/dist/server/storage.d.ts.map +1 -0
  544. package/dist/server/title-generator.d.ts +25 -0
  545. package/dist/server/title-generator.d.ts.map +1 -0
  546. package/dist/server/wire.d.ts +448 -0
  547. package/dist/server/wire.d.ts.map +1 -0
  548. package/dist/studio-binding.d.ts +44 -0
  549. package/dist/studio-binding.d.ts.map +1 -0
  550. package/dist/studio-binding.js +1 -1
  551. package/package.json +11 -1
  552. package/dist/sdk/coding-agent/bun/cli.js +0 -7
  553. package/dist/sdk/coding-agent/bun/restore-sandbox-env.js +0 -31
  554. package/dist/sdk/coding-agent/cli/args.js +0 -340
  555. package/dist/sdk/coding-agent/cli/file-processor.js +0 -82
  556. package/dist/sdk/coding-agent/cli/initial-message.js +0 -21
  557. package/dist/sdk/coding-agent/core/footer-data-provider.js +0 -309
  558. package/dist/sdk/coding-agent/modes/interactive/components/keybinding-hints.js +0 -35
  559. package/dist/sdk/coding-agent/modes/interactive/components/visual-truncate.js +0 -26
  560. package/dist/sdk/coding-agent/modes/interactive/interactive-mode.js +0 -3
  561. package/dist/sdk/coding-agent/modes/interactive/theme/theme.js +0 -1022
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/coding-agent/core/tools/ls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI7D,OAAO,EAAiC,KAAK,gBAAgB,EAAgB,MAAM,eAAe,CAAC;AAEnG,QAAA,MAAM,QAAQ;;;EAGZ,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC;AAIlD,MAAM,WAAW,aAAa;IAC7B,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC5B,2BAA2B;IAC3B,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAC7D,wDAAwD;IACxD,IAAI,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,OAAO,CAAA;KAAE,CAAC,GAAG;QAAE,WAAW,EAAE,MAAM,OAAO,CAAA;KAAE,CAAC;IACzG,6BAA6B;IAC7B,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC;CAChE;AAQD,MAAM,WAAW,aAAa;IAC7B,yEAAyE;IACzE,UAAU,CAAC,EAAE,YAAY,CAAC;CAC1B;AAkDD,wBAAgB,sBAAsB,CACrC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,aAAa,GACrB,cAAc,CAAC,OAAO,QAAQ,EAAE,aAAa,GAAG,SAAS,CAAC,CAiH5D;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC,OAAO,QAAQ,CAAC,CAE7F"}
@@ -1,9 +1,8 @@
1
1
  import { existsSync, readdirSync, statSync } from "fs";
2
2
  import nodePath from "path";
3
3
  import { Type } from "typebox";
4
- import { keyHint } from "../../modes/interactive/components/keybinding-hints.js";
5
4
  import { resolveToCwd } from "./path-utils.js";
6
- import { getTextOutput, invalidArgText, shortenPath, str } from "./render-utils.js";
5
+ import { getTextOutput, shortenPath, str } from "./render-utils.js";
7
6
  import { wrapToolDefinition } from "./tool-definition-wrapper.js";
8
7
  import { DEFAULT_MAX_BYTES, formatSize, truncateHead } from "./truncate.js";
9
8
  const lsSchema = Type.Object({
@@ -16,18 +15,18 @@ const defaultLsOperations = {
16
15
  stat: statSync,
17
16
  readdir: readdirSync,
18
17
  };
19
- function formatLsCall(args, theme) {
18
+ function formatLsCall(args, _theme) {
20
19
  const rawPath = str(args?.path);
21
20
  const path = rawPath !== null ? shortenPath(rawPath || ".") : null;
22
21
  const limit = args?.limit;
23
- const invalidArg = invalidArgText(theme);
24
- let text = `${theme.fg("toolTitle", theme.bold("ls"))} ${path === null ? invalidArg : theme.fg("accent", path)}`;
22
+ const invalidArg = "[invalid]";
23
+ let text = `ls ${path === null ? invalidArg : path}`;
25
24
  if (limit !== undefined) {
26
- text += theme.fg("toolOutput", ` (limit ${limit})`);
25
+ text += ` (limit ${limit})`;
27
26
  }
28
27
  return text;
29
28
  }
30
- function formatLsResult(result, options, theme, showImages) {
29
+ function formatLsResult(result, options, _theme, showImages) {
31
30
  const output = getTextOutput(result, showImages).trim();
32
31
  let text = "";
33
32
  if (output) {
@@ -35,9 +34,9 @@ function formatLsResult(result, options, theme, showImages) {
35
34
  const maxLines = options.expanded ? lines.length : 20;
36
35
  const displayLines = lines.slice(0, maxLines);
37
36
  const remaining = lines.length - maxLines;
38
- text += `\n${displayLines.map((line) => theme.fg("toolOutput", line)).join("\n")}`;
37
+ text += `\n${displayLines.join("\n")}`;
39
38
  if (remaining > 0) {
40
- text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("app.tools.expand", "to expand")})`;
39
+ text += `\n... (${remaining} more lines)`;
41
40
  }
42
41
  }
43
42
  const entryLimit = result.details?.entryLimitReached;
@@ -48,7 +47,7 @@ function formatLsResult(result, options, theme, showImages) {
48
47
  warnings.push(`${entryLimit} entries limit`);
49
48
  if (truncation?.truncated)
50
49
  warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
51
- text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
50
+ text += `\n[Truncated: ${warnings.join(", ")}]`;
52
51
  }
53
52
  return text;
54
53
  }
@@ -0,0 +1,52 @@
1
+ import { type TruncationResult } from "./truncate.js";
2
+ export interface OutputAccumulatorOptions {
3
+ maxLines?: number;
4
+ maxBytes?: number;
5
+ tempFilePrefix?: string;
6
+ }
7
+ export interface OutputSnapshot {
8
+ content: string;
9
+ truncation: TruncationResult;
10
+ fullOutputPath?: string;
11
+ }
12
+ /**
13
+ * Incrementally tracks streaming output with bounded memory.
14
+ *
15
+ * Appends decode chunks with a streaming UTF-8 decoder, keeps only a decoded
16
+ * tail for display snapshots, and opens a temp file when the full output needs
17
+ * to be preserved.
18
+ */
19
+ export declare class OutputAccumulator {
20
+ private readonly maxLines;
21
+ private readonly maxBytes;
22
+ private readonly maxRollingBytes;
23
+ private readonly tempFilePrefix;
24
+ private readonly decoder;
25
+ private rawChunks;
26
+ private tailText;
27
+ private tailBytes;
28
+ private tailStartsAtLineBoundary;
29
+ private totalRawBytes;
30
+ private totalDecodedBytes;
31
+ private completedLines;
32
+ private totalLines;
33
+ private currentLineBytes;
34
+ private hasOpenLine;
35
+ private finished;
36
+ private tempFilePath;
37
+ private tempFileStream;
38
+ constructor(options?: OutputAccumulatorOptions);
39
+ append(data: Buffer): void;
40
+ finish(): void;
41
+ snapshot(options?: {
42
+ persistIfTruncated?: boolean;
43
+ }): OutputSnapshot;
44
+ closeTempFile(): Promise<void>;
45
+ getLastLineBytes(): number;
46
+ private appendDecodedText;
47
+ private trimTail;
48
+ private getSnapshotText;
49
+ private shouldUseTempFile;
50
+ private ensureTempFile;
51
+ }
52
+ //# sourceMappingURL=output-accumulator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-accumulator.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/coding-agent/core/tools/output-accumulator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAwC,KAAK,gBAAgB,EAAgB,MAAM,eAAe,CAAC;AAE1G,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAWD;;;;;;GAMG;AACH,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAE7C,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,wBAAwB,CAAQ;IACxC,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,cAAc,CAA0B;gBAEpC,OAAO,GAAE,wBAA6B;IAOlD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAgB1B,MAAM,IAAI,IAAI;IAWd,QAAQ,CAAC,OAAO,GAAE;QAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,cAAc;IA8BlE,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBpC,gBAAgB,IAAI,MAAM;IAI1B,OAAO,CAAC,iBAAiB;IA+BzB,OAAO,CAAC,QAAQ;IAiBhB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,cAAc;CAWtB"}
@@ -0,0 +1,8 @@
1
+ export declare function expandPath(filePath: string): string;
2
+ /**
3
+ * Resolve a path relative to the given cwd.
4
+ * Handles ~ expansion and absolute paths.
5
+ */
6
+ export declare function resolveToCwd(filePath: string, cwd: string): string;
7
+ export declare function resolveReadPath(filePath: string, cwd: string): string;
8
+ //# sourceMappingURL=path-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/coding-agent/core/tools/path-utils.ts"],"names":[],"mappings":"AA6BA,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAgCrE"}
@@ -0,0 +1,35 @@
1
+ import type { AgentTool } from "../../../agent-core/index.js";
2
+ import { type Static, Type } from "typebox";
3
+ import type { ToolDefinition } from "../extensions/types.js";
4
+ import { type TruncationResult } from "./truncate.js";
5
+ declare const readSchema: Type.TObject<{
6
+ path: Type.TString;
7
+ offset: Type.TOptional<Type.TNumber>;
8
+ limit: Type.TOptional<Type.TNumber>;
9
+ }>;
10
+ export type ReadToolInput = Static<typeof readSchema>;
11
+ export interface ReadToolDetails {
12
+ truncation?: TruncationResult;
13
+ }
14
+ /**
15
+ * Pluggable operations for the read tool.
16
+ * Override these to delegate file reading to remote systems (for example SSH).
17
+ */
18
+ export interface ReadOperations {
19
+ /** Read file contents as a Buffer */
20
+ readFile: (absolutePath: string) => Promise<Buffer>;
21
+ /** Check if file is readable (throw if not) */
22
+ access: (absolutePath: string) => Promise<void>;
23
+ /** Detect image MIME type, return null or undefined for non-images */
24
+ detectImageMimeType?: (absolutePath: string) => Promise<string | null | undefined>;
25
+ }
26
+ export interface ReadToolOptions {
27
+ /** Whether to auto-resize images to 2000x2000 max. Default: true */
28
+ autoResizeImages?: boolean;
29
+ /** Custom operations for file reading. Default: local filesystem */
30
+ operations?: ReadOperations;
31
+ }
32
+ export declare function createReadToolDefinition(cwd: string, options?: ReadToolOptions): ToolDefinition<typeof readSchema, ReadToolDetails | undefined>;
33
+ export declare function createReadTool(cwd: string, options?: ReadToolOptions): AgentTool<typeof readSchema>;
34
+ export {};
35
+ //# sourceMappingURL=read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/coding-agent/core/tools/read.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAI9D,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAM5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI7D,OAAO,EAAoD,KAAK,gBAAgB,EAAgB,MAAM,eAAe,CAAC;AAEtH,QAAA,MAAM,UAAU;;;;EAId,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC/B,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AASD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,qCAAqC;IACrC,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,+CAA+C;IAC/C,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACnF;AAQD,MAAM,WAAW,eAAe;IAC/B,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oEAAoE;IACpE,UAAU,CAAC,EAAE,cAAc,CAAC;CAC5B;AAkID,wBAAgB,wBAAwB,CACvC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,eAAe,GACvB,cAAc,CAAC,OAAO,UAAU,EAAE,eAAe,GAAG,SAAS,CAAC,CA+IhE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,OAAO,UAAU,CAAC,CAEnG"}
@@ -3,13 +3,12 @@ import { constants } from "fs";
3
3
  import { access as fsAccess, readFile as fsReadFile } from "fs/promises";
4
4
  import { Type } from "typebox";
5
5
  import { getReadmePath } from "../../config.js";
6
- import { keyHint, keyText } from "../../modes/interactive/components/keybinding-hints.js";
7
- import { getLanguageFromPath, highlightCode } from "../../modes/interactive/theme/theme.js";
6
+ import { getLanguageFromPath, highlightCode } from "../theme.js";
8
7
  import { formatDimensionNote, resizeImage } from "../../utils/image-resize.js";
9
8
  import { detectSupportedImageMimeTypeFromFile } from "../../utils/mime.js";
10
9
  import { formatPathRelativeToCwdOrAbsolute } from "../../utils/paths.js";
11
10
  import { resolveReadPath } from "./path-utils.js";
12
- import { getTextOutput, invalidArgText, replaceTabs, shortenPath, str } from "./render-utils.js";
11
+ import { getTextOutput, replaceTabs, shortenPath, str } from "./render-utils.js";
13
12
  import { wrapToolDefinition } from "./tool-definition-wrapper.js";
14
13
  import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead } from "./truncate.js";
15
14
  const readSchema = Type.Object({
@@ -23,19 +22,18 @@ const defaultReadOperations = {
23
22
  access: (path) => fsAccess(path, constants.R_OK),
24
23
  detectImageMimeType: detectSupportedImageMimeTypeFromFile,
25
24
  };
26
- function formatReadLineRange(args, theme) {
25
+ function formatReadLineRange(args, _theme) {
27
26
  if (args?.offset === undefined && args?.limit === undefined)
28
27
  return "";
29
28
  const startLine = args.offset ?? 1;
30
29
  const endLine = args.limit !== undefined ? startLine + args.limit - 1 : "";
31
- return theme.fg("warning", `:${startLine}${endLine ? `-${endLine}` : ""}`);
30
+ return `:${startLine}${endLine ? `-${endLine}` : ""}`;
32
31
  }
33
- function formatReadCall(args, theme) {
32
+ function formatReadCall(args, _theme) {
34
33
  const rawPath = str(args?.file_path ?? args?.path);
35
34
  const path = rawPath !== null ? shortenPath(rawPath) : null;
36
- const invalidArg = invalidArgText(theme);
37
- const pathDisplay = path === null ? invalidArg : path ? theme.fg("accent", path) : theme.fg("toolOutput", "...");
38
- return `${theme.fg("toolTitle", theme.bold("read"))} ${pathDisplay}${formatReadLineRange(args, theme)}`;
35
+ const pathDisplay = path === null ? "[invalid]" : path || "...";
36
+ return `read ${pathDisplay}${formatReadLineRange(args)}`;
39
37
  }
40
38
  function trimTrailingEmptyLines(lines) {
41
39
  let end = lines.length;
@@ -85,19 +83,11 @@ function getCompactReadClassification(args, cwd) {
85
83
  }
86
84
  return undefined;
87
85
  }
88
- function formatCompactReadCall(classification, args, theme) {
89
- const expandHint = theme.fg("dim", ` (${keyText("app.tools.expand")} to expand)`);
86
+ function formatCompactReadCall(classification, args, _theme) {
90
87
  if (classification.kind === "skill") {
91
- return (theme.fg("customMessageLabel", `\x1b[1m[skill]\x1b[22m `) +
92
- theme.fg("customMessageText", classification.label) +
93
- formatReadLineRange(args, theme) +
94
- expandHint);
88
+ return `[skill] ${classification.label}${formatReadLineRange(args)}`;
95
89
  }
96
- return (theme.fg("toolTitle", theme.bold(`read ${classification.kind}`)) +
97
- " " +
98
- theme.fg("accent", classification.label) +
99
- formatReadLineRange(args, theme) +
100
- expandHint);
90
+ return `read ${classification.kind} ${classification.label}${formatReadLineRange(args)}`;
101
91
  }
102
92
  function formatReadResult(args, result, options, theme, showImages, cwd, isError) {
103
93
  if (!options.expanded && !isError && getCompactReadClassification(args, cwd)) {
@@ -111,20 +101,20 @@ function formatReadResult(args, result, options, theme, showImages, cwd, isError
111
101
  const maxLines = options.expanded ? lines.length : 10;
112
102
  const displayLines = lines.slice(0, maxLines);
113
103
  const remaining = lines.length - maxLines;
114
- let text = `\n${displayLines.map((line) => (lang ? replaceTabs(line) : theme.fg("toolOutput", replaceTabs(line)))).join("\n")}`;
104
+ let text = `\n${displayLines.map((line) => replaceTabs(line)).join("\n")}`;
115
105
  if (remaining > 0) {
116
- text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("app.tools.expand", "to expand")})`;
106
+ text += `\n... (${remaining} more lines)`;
117
107
  }
118
108
  const truncation = result.details?.truncation;
119
109
  if (truncation?.truncated) {
120
110
  if (truncation.firstLineExceedsLimit) {
121
- text += `\n${theme.fg("warning", `[First line exceeds ${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit]`)}`;
111
+ text += `\n[First line exceeds ${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit]`;
122
112
  }
123
113
  else if (truncation.truncatedBy === "lines") {
124
- text += `\n${theme.fg("warning", `[Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines (${truncation.maxLines ?? DEFAULT_MAX_LINES} line limit)]`)}`;
114
+ text += `\n[Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines (${truncation.maxLines ?? DEFAULT_MAX_LINES} line limit)]`;
125
115
  }
126
116
  else {
127
- text += `\n${theme.fg("warning", `[Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)]`)}`;
117
+ text += `\n[Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)]`;
128
118
  }
129
119
  }
130
120
  return text;
@@ -180,22 +170,30 @@ export function createReadToolDefinition(cwd, options) {
180
170
  let textNote = `Read image file [${resized.mimeType}]`;
181
171
  if (dimensionNote)
182
172
  textNote += `\n${dimensionNote}`;
183
- if (nonVisionImageNote)
173
+ if (nonVisionImageNote) {
184
174
  textNote += `\n${nonVisionImageNote}`;
185
- content = [
186
- { type: "text", text: textNote },
187
- { type: "image", data: resized.data, mimeType: resized.mimeType },
188
- ];
175
+ content = [{ type: "text", text: textNote }];
176
+ }
177
+ else {
178
+ content = [
179
+ { type: "text", text: textNote },
180
+ { type: "image", data: resized.data, mimeType: resized.mimeType },
181
+ ];
182
+ }
189
183
  }
190
184
  }
191
185
  else {
192
186
  let textNote = `Read image file [${mimeType}]`;
193
- if (nonVisionImageNote)
187
+ if (nonVisionImageNote) {
194
188
  textNote += `\n${nonVisionImageNote}`;
195
- content = [
196
- { type: "text", text: textNote },
197
- { type: "image", data: base64, mimeType },
198
- ];
189
+ content = [{ type: "text", text: textNote }];
190
+ }
191
+ else {
192
+ content = [
193
+ { type: "text", text: textNote },
194
+ { type: "image", data: base64, mimeType },
195
+ ];
196
+ }
199
197
  }
200
198
  }
201
199
  else {
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Plain-text diff rendering for LLM consumption.
3
+ * Extracted from the TUI interactive mode diff renderer, with all ANSI
4
+ * styling removed — the output is plain text suitable for LLM input.
5
+ */
6
+ export interface RenderDiffOptions {
7
+ /** File path (unused, kept for API compatibility) */
8
+ filePath?: string;
9
+ }
10
+ /**
11
+ * Render a diff string as plain text with markers.
12
+ * - Context lines: unchanged
13
+ * - Removed lines: prefixed with "-"
14
+ * - Added lines: prefixed with "+"
15
+ */
16
+ export declare function renderDiff(diffText: string, _options?: RenderDiffOptions): string;
17
+ //# sourceMappingURL=render-diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-diff.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/coding-agent/core/tools/render-diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA0DH,MAAM,WAAW,iBAAiB;IACjC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,iBAAsB,GAAG,MAAM,CA2DrF"}
@@ -1,5 +1,9 @@
1
+ /**
2
+ * Plain-text diff rendering for LLM consumption.
3
+ * Extracted from the TUI interactive mode diff renderer, with all ANSI
4
+ * styling removed — the output is plain text suitable for LLM input.
5
+ */
1
6
  import * as Diff from "diff";
2
- import { theme } from "../theme/theme.js";
3
7
  /**
4
8
  * Parse diff line to extract prefix, line number, and content.
5
9
  * Format: "+123 content" or "-123 content" or " 123 content" or " ..."
@@ -10,17 +14,9 @@ function parseDiffLine(line) {
10
14
  return null;
11
15
  return { prefix: match[1], lineNum: match[2], content: match[3] };
12
16
  }
13
- /**
14
- * Replace tabs with spaces for consistent rendering.
15
- */
16
17
  function replaceTabs(text) {
17
18
  return text.replace(/\t/g, " ");
18
19
  }
19
- /**
20
- * Compute word-level diff and render with inverse on changed parts.
21
- * Uses diffWords which groups whitespace with adjacent words for cleaner highlighting.
22
- * Strips leading whitespace from inverse to avoid highlighting indentation.
23
- */
24
20
  function renderIntraLineDiff(oldContent, newContent) {
25
21
  const wordDiff = Diff.diffWords(oldContent, newContent);
26
22
  let removedLine = "";
@@ -30,7 +26,6 @@ function renderIntraLineDiff(oldContent, newContent) {
30
26
  for (const part of wordDiff) {
31
27
  if (part.removed) {
32
28
  let value = part.value;
33
- // Strip leading whitespace from the first removed part
34
29
  if (isFirstRemoved) {
35
30
  const leadingWs = value.match(/^(\s*)/)?.[1] || "";
36
31
  value = value.slice(leadingWs.length);
@@ -38,12 +33,11 @@ function renderIntraLineDiff(oldContent, newContent) {
38
33
  isFirstRemoved = false;
39
34
  }
40
35
  if (value) {
41
- removedLine += theme.inverse(value);
36
+ removedLine += `<REMOVED>${value}</REMOVED>`;
42
37
  }
43
38
  }
44
39
  else if (part.added) {
45
40
  let value = part.value;
46
- // Strip leading whitespace from the first added part
47
41
  if (isFirstAdded) {
48
42
  const leadingWs = value.match(/^(\s*)/)?.[1] || "";
49
43
  value = value.slice(leadingWs.length);
@@ -51,7 +45,7 @@ function renderIntraLineDiff(oldContent, newContent) {
51
45
  isFirstAdded = false;
52
46
  }
53
47
  if (value) {
54
- addedLine += theme.inverse(value);
48
+ addedLine += `<ADDED>${value}</ADDED>`;
55
49
  }
56
50
  }
57
51
  else {
@@ -62,10 +56,10 @@ function renderIntraLineDiff(oldContent, newContent) {
62
56
  return { removedLine, addedLine };
63
57
  }
64
58
  /**
65
- * Render a diff string with colored lines and intra-line change highlighting.
66
- * - Context lines: dim/gray
67
- * - Removed lines: red, with inverse on changed tokens
68
- * - Added lines: green, with inverse on changed tokens
59
+ * Render a diff string as plain text with markers.
60
+ * - Context lines: unchanged
61
+ * - Removed lines: prefixed with "-"
62
+ * - Added lines: prefixed with "+"
69
63
  */
70
64
  export function renderDiff(diffText, _options = {}) {
71
65
  const lines = diffText.split("\n");
@@ -75,12 +69,11 @@ export function renderDiff(diffText, _options = {}) {
75
69
  const line = lines[i];
76
70
  const parsed = parseDiffLine(line);
77
71
  if (!parsed) {
78
- result.push(theme.fg("toolDiffContext", line));
72
+ result.push(line);
79
73
  i++;
80
74
  continue;
81
75
  }
82
76
  if (parsed.prefix === "-") {
83
- // Collect consecutive removed lines
84
77
  const removedLines = [];
85
78
  while (i < lines.length) {
86
79
  const p = parseDiffLine(lines[i]);
@@ -89,7 +82,6 @@ export function renderDiff(diffText, _options = {}) {
89
82
  removedLines.push({ lineNum: p.lineNum, content: p.content });
90
83
  i++;
91
84
  }
92
- // Collect consecutive added lines
93
85
  const addedLines = [];
94
86
  while (i < lines.length) {
95
87
  const p = parseDiffLine(lines[i]);
@@ -98,33 +90,28 @@ export function renderDiff(diffText, _options = {}) {
98
90
  addedLines.push({ lineNum: p.lineNum, content: p.content });
99
91
  i++;
100
92
  }
101
- // Only do intra-line diffing when there's exactly one removed and one added line
102
- // (indicating a single line modification). Otherwise, show lines as-is.
103
93
  if (removedLines.length === 1 && addedLines.length === 1) {
104
94
  const removed = removedLines[0];
105
95
  const added = addedLines[0];
106
96
  const { removedLine, addedLine } = renderIntraLineDiff(replaceTabs(removed.content), replaceTabs(added.content));
107
- result.push(theme.fg("toolDiffRemoved", `-${removed.lineNum} ${removedLine}`));
108
- result.push(theme.fg("toolDiffAdded", `+${added.lineNum} ${addedLine}`));
97
+ result.push(`-${removed.lineNum} ${removedLine}`);
98
+ result.push(`+${added.lineNum} ${addedLine}`);
109
99
  }
110
100
  else {
111
- // Show all removed lines first, then all added lines
112
101
  for (const removed of removedLines) {
113
- result.push(theme.fg("toolDiffRemoved", `-${removed.lineNum} ${replaceTabs(removed.content)}`));
102
+ result.push(`-${removed.lineNum} ${replaceTabs(removed.content)}`);
114
103
  }
115
104
  for (const added of addedLines) {
116
- result.push(theme.fg("toolDiffAdded", `+${added.lineNum} ${replaceTabs(added.content)}`));
105
+ result.push(`+${added.lineNum} ${replaceTabs(added.content)}`);
117
106
  }
118
107
  }
119
108
  }
120
109
  else if (parsed.prefix === "+") {
121
- // Standalone added line
122
- result.push(theme.fg("toolDiffAdded", `+${parsed.lineNum} ${replaceTabs(parsed.content)}`));
110
+ result.push(`+${parsed.lineNum} ${replaceTabs(parsed.content)}`);
123
111
  i++;
124
112
  }
125
113
  else {
126
- // Context line
127
- result.push(theme.fg("toolDiffContext", ` ${parsed.lineNum} ${replaceTabs(parsed.content)}`));
114
+ result.push(` ${parsed.lineNum} ${replaceTabs(parsed.content)}`);
128
115
  i++;
129
116
  }
130
117
  }
@@ -0,0 +1,21 @@
1
+ import type { ImageContent, TextContent } from "../../../ai/index.js";
2
+ export declare function shortenPath(path: unknown): string;
3
+ export declare function str(value: unknown): string | null;
4
+ export declare function replaceTabs(text: string): string;
5
+ export declare function normalizeDisplayText(text: string): string;
6
+ export declare function getTextOutput(result: {
7
+ content: Array<{
8
+ type: string;
9
+ text?: string;
10
+ data?: string;
11
+ mimeType?: string;
12
+ }>;
13
+ } | undefined, _showImages: boolean): string;
14
+ export type ToolRenderResultLike<TDetails> = {
15
+ content: (TextContent | ImageContent)[];
16
+ details: TDetails;
17
+ };
18
+ export declare function invalidArgText(theme: {
19
+ fg: (name: any, text: string) => string;
20
+ }): string;
21
+ //# sourceMappingURL=render-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-utils.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/coding-agent/core/tools/render-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAItE,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAOjD;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAIjD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,aAAa,CAC5B,MAAM,EAAE;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAAG,SAAS,EACzG,WAAW,EAAE,OAAO,GAClB,MAAM,CAOR;AAED,MAAM,MAAM,oBAAoB,CAAC,QAAQ,IAAI;IAC5C,OAAO,EAAE,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC;IACxC,OAAO,EAAE,QAAQ,CAAC;CAClB,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE;IAAE,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;CAAE,GAAG,MAAM,CAEzF"}
@@ -0,0 +1,14 @@
1
+ import type { AgentTool } from "../../../agent-core/index.js";
2
+ import type { ExtensionContext, ToolDefinition } from "../extensions/types.js";
3
+ /** Wrap a ToolDefinition into an AgentTool for the core runtime. */
4
+ export declare function wrapToolDefinition<TDetails = unknown>(definition: ToolDefinition<any, TDetails>, ctxFactory?: () => ExtensionContext): AgentTool<any, TDetails>;
5
+ /** Wrap multiple ToolDefinitions into AgentTools for the core runtime. */
6
+ export declare function wrapToolDefinitions(definitions: ToolDefinition<any, any>[], ctxFactory?: () => ExtensionContext): AgentTool<any>[];
7
+ /**
8
+ * Synthesize a minimal ToolDefinition from an AgentTool.
9
+ *
10
+ * This keeps AgentSession's internal registry definition-first even when a caller
11
+ * provides plain AgentTool overrides that do not include prompt metadata or renderers.
12
+ */
13
+ export declare function createToolDefinitionFromAgentTool(tool: AgentTool<any>): ToolDefinition<any, unknown>;
14
+ //# sourceMappingURL=tool-definition-wrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-definition-wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/coding-agent/core/tools/tool-definition-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE/E,oEAAoE;AACpE,wBAAgB,kBAAkB,CAAC,QAAQ,GAAG,OAAO,EACpD,UAAU,EAAE,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,EACzC,UAAU,CAAC,EAAE,MAAM,gBAAgB,GACjC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAW1B;AAED,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAClC,WAAW,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EACvC,UAAU,CAAC,EAAE,MAAM,gBAAgB,GACjC,SAAS,CAAC,GAAG,CAAC,EAAE,CAElB;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAUpG"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Shared truncation utilities for tool outputs.
3
+ *
4
+ * Truncation is based on two independent limits - whichever is hit first wins:
5
+ * - Line limit (default: 2000 lines)
6
+ * - Byte limit (default: 50KB)
7
+ *
8
+ * Never returns partial lines (except bash tail truncation edge case).
9
+ */
10
+ export declare const DEFAULT_MAX_LINES = 2000;
11
+ export declare const DEFAULT_MAX_BYTES: number;
12
+ export declare const GREP_MAX_LINE_LENGTH = 500;
13
+ export interface TruncationResult {
14
+ /** The truncated content */
15
+ content: string;
16
+ /** Whether truncation occurred */
17
+ truncated: boolean;
18
+ /** Which limit was hit: "lines", "bytes", or null if not truncated */
19
+ truncatedBy: "lines" | "bytes" | null;
20
+ /** Total number of lines in the original content */
21
+ totalLines: number;
22
+ /** Total number of bytes in the original content */
23
+ totalBytes: number;
24
+ /** Number of complete lines in the truncated output */
25
+ outputLines: number;
26
+ /** Number of bytes in the truncated output */
27
+ outputBytes: number;
28
+ /** Whether the last line was partially truncated (only for tail truncation edge case) */
29
+ lastLinePartial: boolean;
30
+ /** Whether the first line exceeded the byte limit (for head truncation) */
31
+ firstLineExceedsLimit: boolean;
32
+ /** The max lines limit that was applied */
33
+ maxLines: number;
34
+ /** The max bytes limit that was applied */
35
+ maxBytes: number;
36
+ }
37
+ export interface TruncationOptions {
38
+ /** Maximum number of lines (default: 2000) */
39
+ maxLines?: number;
40
+ /** Maximum number of bytes (default: 50KB) */
41
+ maxBytes?: number;
42
+ }
43
+ /**
44
+ * Format bytes as human-readable size.
45
+ */
46
+ export declare function formatSize(bytes: number): string;
47
+ /**
48
+ * Truncate content from the head (keep first N lines/bytes).
49
+ * Suitable for file reads where you want to see the beginning.
50
+ *
51
+ * Never returns partial lines. If first line exceeds byte limit,
52
+ * returns empty content with firstLineExceedsLimit=true.
53
+ */
54
+ export declare function truncateHead(content: string, options?: TruncationOptions): TruncationResult;
55
+ /**
56
+ * Truncate content from the tail (keep last N lines/bytes).
57
+ * Suitable for bash output where you want to see the end (errors, final results).
58
+ *
59
+ * May return partial first line if the last line of original content exceeds byte limit.
60
+ */
61
+ export declare function truncateTail(content: string, options?: TruncationOptions): TruncationResult;
62
+ /**
63
+ * Truncate a single line to max characters, adding [truncated] suffix.
64
+ * Used for grep match lines.
65
+ */
66
+ export declare function truncateLine(line: string, maxChars?: number): {
67
+ text: string;
68
+ wasTruncated: boolean;
69
+ };
70
+ //# sourceMappingURL=truncate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"truncate.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/coding-agent/core/tools/truncate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,iBAAiB,QAAY,CAAC;AAC3C,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,MAAM,WAAW,gBAAgB;IAChC,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,sEAAsE;IACtE,WAAW,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;IACtC,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,eAAe,EAAE,OAAO,CAAC;IACzB,2EAA2E;IAC3E,qBAAqB,EAAE,OAAO,CAAC;IAC/B,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IACjC,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAaD;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQhD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,gBAAgB,CAkF/F;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,gBAAgB,CAyE/F;AAuBD;;;GAGG;AACH,wBAAgB,YAAY,CAC3B,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,MAA6B,GACrC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAKzC"}
@@ -0,0 +1,26 @@
1
+ import type { AgentTool } from "../../../agent-core/index.js";
2
+ import { type Static, Type } from "typebox";
3
+ import type { ToolDefinition } from "../extensions/types.js";
4
+ declare const writeSchema: Type.TObject<{
5
+ path: Type.TString;
6
+ content: Type.TString;
7
+ }>;
8
+ export type WriteToolInput = Static<typeof writeSchema>;
9
+ /**
10
+ * Pluggable operations for the write tool.
11
+ * Override these to delegate file writing to remote systems (for example SSH).
12
+ */
13
+ export interface WriteOperations {
14
+ /** Write content to a file */
15
+ writeFile: (absolutePath: string, content: string) => Promise<void>;
16
+ /** Create directory recursively */
17
+ mkdir: (dir: string) => Promise<void>;
18
+ }
19
+ export interface WriteToolOptions {
20
+ /** Custom operations for file writing. Default: local filesystem */
21
+ operations?: WriteOperations;
22
+ }
23
+ export declare function createWriteToolDefinition(cwd: string, options?: WriteToolOptions): ToolDefinition<typeof writeSchema, undefined>;
24
+ export declare function createWriteTool(cwd: string, options?: WriteToolOptions): AgentTool<typeof writeSchema>;
25
+ export {};
26
+ //# sourceMappingURL=write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/coding-agent/core/tools/write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAM7D,QAAA,MAAM,WAAW;;;EAGf,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B,8BAA8B;IAC9B,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,mCAAmC;IACnC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAOD,MAAM,WAAW,gBAAgB;IAChC,oEAAoE;IACpE,UAAU,CAAC,EAAE,eAAe,CAAC;CAC7B;AA2DD,wBAAgB,yBAAyB,CACxC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,gBAAgB,GACxB,cAAc,CAAC,OAAO,WAAW,EAAE,SAAS,CAAC,CA2D/C;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC,OAAO,WAAW,CAAC,CAEtG"}