@aexol/spectral 0.8.2 → 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 (523) 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/openrouter-attribution.d.ts +12 -0
  38. package/dist/extensions/openrouter-attribution.d.ts.map +1 -0
  39. package/dist/extensions/spectral-vision-fallback.d.ts +23 -0
  40. package/dist/extensions/spectral-vision-fallback.d.ts.map +1 -0
  41. package/dist/extensions/spectral-vision-fallback.js +29 -20
  42. package/dist/index.d.ts +46 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +44 -0
  45. package/dist/mcp/agent-dir.d.ts +3 -0
  46. package/dist/mcp/agent-dir.d.ts.map +1 -0
  47. package/dist/mcp/commands.d.ts +9 -0
  48. package/dist/mcp/commands.d.ts.map +1 -0
  49. package/dist/mcp/config.d.ts +78 -0
  50. package/dist/mcp/config.d.ts.map +1 -0
  51. package/dist/mcp/consent-manager.d.ts +14 -0
  52. package/dist/mcp/consent-manager.d.ts.map +1 -0
  53. package/dist/mcp/direct-tools.d.ts +11 -0
  54. package/dist/mcp/direct-tools.d.ts.map +1 -0
  55. package/dist/mcp/errors.d.ts +100 -0
  56. package/dist/mcp/errors.d.ts.map +1 -0
  57. package/dist/mcp/glimpse-ui.d.ts +10 -0
  58. package/dist/mcp/glimpse-ui.d.ts.map +1 -0
  59. package/dist/mcp/host-html-template.d.ts +17 -0
  60. package/dist/mcp/host-html-template.d.ts.map +1 -0
  61. package/dist/mcp/index.d.ts +3 -0
  62. package/dist/mcp/index.d.ts.map +1 -0
  63. package/dist/mcp/init.d.ts +10 -0
  64. package/dist/mcp/init.d.ts.map +1 -0
  65. package/dist/mcp/lifecycle.d.ts +30 -0
  66. package/dist/mcp/lifecycle.d.ts.map +1 -0
  67. package/dist/mcp/logger.d.ts +52 -0
  68. package/dist/mcp/logger.d.ts.map +1 -0
  69. package/dist/mcp/mcp-auth-flow.d.ts +69 -0
  70. package/dist/mcp/mcp-auth-flow.d.ts.map +1 -0
  71. package/dist/mcp/mcp-auth.d.ts +100 -0
  72. package/dist/mcp/mcp-auth.d.ts.map +1 -0
  73. package/dist/mcp/mcp-callback-server.d.ts +40 -0
  74. package/dist/mcp/mcp-callback-server.d.ts.map +1 -0
  75. package/dist/mcp/mcp-oauth-provider.d.ts +101 -0
  76. package/dist/mcp/mcp-oauth-provider.d.ts.map +1 -0
  77. package/dist/mcp/metadata-cache.d.ts +32 -0
  78. package/dist/mcp/metadata-cache.d.ts.map +1 -0
  79. package/dist/mcp/npx-resolver.d.ts +7 -0
  80. package/dist/mcp/npx-resolver.d.ts.map +1 -0
  81. package/dist/mcp/oauth-handler.d.ts +19 -0
  82. package/dist/mcp/oauth-handler.d.ts.map +1 -0
  83. package/dist/mcp/onboarding-state.d.ts +13 -0
  84. package/dist/mcp/onboarding-state.d.ts.map +1 -0
  85. package/dist/mcp/proxy-modes.d.ts +12 -0
  86. package/dist/mcp/proxy-modes.d.ts.map +1 -0
  87. package/dist/mcp/resource-tools.d.ts +2 -0
  88. package/dist/mcp/resource-tools.d.ts.map +1 -0
  89. package/dist/mcp/sampling-handler.d.ts +16 -0
  90. package/dist/mcp/sampling-handler.d.ts.map +1 -0
  91. package/dist/mcp/server-manager.d.ts +42 -0
  92. package/dist/mcp/server-manager.d.ts.map +1 -0
  93. package/dist/mcp/state.d.ts +41 -0
  94. package/dist/mcp/state.d.ts.map +1 -0
  95. package/dist/mcp/tool-metadata.d.ts +11 -0
  96. package/dist/mcp/tool-metadata.d.ts.map +1 -0
  97. package/dist/mcp/tool-registrar.d.ts +9 -0
  98. package/dist/mcp/tool-registrar.d.ts.map +1 -0
  99. package/dist/mcp/types.d.ts +263 -0
  100. package/dist/mcp/types.d.ts.map +1 -0
  101. package/dist/mcp/ui-resource-handler.d.ts +10 -0
  102. package/dist/mcp/ui-resource-handler.d.ts.map +1 -0
  103. package/dist/mcp/ui-server.d.ts +37 -0
  104. package/dist/mcp/ui-server.d.ts.map +1 -0
  105. package/dist/mcp/ui-session.d.ts +27 -0
  106. package/dist/mcp/ui-session.d.ts.map +1 -0
  107. package/dist/mcp/ui-stream-types.d.ts +197 -0
  108. package/dist/mcp/ui-stream-types.d.ts.map +1 -0
  109. package/dist/mcp/utils.d.ts +17 -0
  110. package/dist/mcp/utils.d.ts.map +1 -0
  111. package/dist/mcp/vitest.config.d.ts +3 -0
  112. package/dist/mcp/vitest.config.d.ts.map +1 -0
  113. package/dist/mcp-client.d.ts +58 -0
  114. package/dist/mcp-client.d.ts.map +1 -0
  115. package/dist/mcp-client.js +2 -1
  116. package/dist/memory/branch.d.ts +124 -0
  117. package/dist/memory/branch.d.ts.map +1 -0
  118. package/dist/memory/commands/status.d.ts +4 -0
  119. package/dist/memory/commands/status.d.ts.map +1 -0
  120. package/dist/memory/commands/view.d.ts +4 -0
  121. package/dist/memory/commands/view.d.ts.map +1 -0
  122. package/dist/memory/compaction.d.ts +113 -0
  123. package/dist/memory/compaction.d.ts.map +1 -0
  124. package/dist/memory/config.d.ts +27 -0
  125. package/dist/memory/config.d.ts.map +1 -0
  126. package/dist/memory/debug-log.d.ts +12 -0
  127. package/dist/memory/debug-log.d.ts.map +1 -0
  128. package/dist/memory/hooks/compaction-hook.d.ts +4 -0
  129. package/dist/memory/hooks/compaction-hook.d.ts.map +1 -0
  130. package/dist/memory/hooks/compaction-trigger.d.ts +4 -0
  131. package/dist/memory/hooks/compaction-trigger.d.ts.map +1 -0
  132. package/dist/memory/hooks/observer-trigger.d.ts +4 -0
  133. package/dist/memory/hooks/observer-trigger.d.ts.map +1 -0
  134. package/dist/memory/ids.d.ts +2 -0
  135. package/dist/memory/ids.d.ts.map +1 -0
  136. package/dist/memory/index.d.ts +3 -0
  137. package/dist/memory/index.d.ts.map +1 -0
  138. package/dist/memory/model-budget.d.ts +4 -0
  139. package/dist/memory/model-budget.d.ts.map +1 -0
  140. package/dist/memory/observer.d.ts +21 -0
  141. package/dist/memory/observer.d.ts.map +1 -0
  142. package/dist/memory/project-observations-store.d.ts +24 -0
  143. package/dist/memory/project-observations-store.d.ts.map +1 -0
  144. package/dist/memory/prompts.d.ts +11 -0
  145. package/dist/memory/prompts.d.ts.map +1 -0
  146. package/dist/memory/relevance.d.ts +4 -0
  147. package/dist/memory/relevance.d.ts.map +1 -0
  148. package/dist/memory/runtime.d.ts +40 -0
  149. package/dist/memory/runtime.d.ts.map +1 -0
  150. package/dist/memory/serialize.d.ts +26 -0
  151. package/dist/memory/serialize.d.ts.map +1 -0
  152. package/dist/memory/tokens.d.ts +8 -0
  153. package/dist/memory/tokens.d.ts.map +1 -0
  154. package/dist/memory/tools/read-project-observations.d.ts +8 -0
  155. package/dist/memory/tools/read-project-observations.d.ts.map +1 -0
  156. package/dist/memory/tools/recall-observation.d.ts +63 -0
  157. package/dist/memory/tools/recall-observation.d.ts.map +1 -0
  158. package/dist/memory/tools/write-project-observation.d.ts +9 -0
  159. package/dist/memory/tools/write-project-observation.d.ts.map +1 -0
  160. package/dist/memory/types.d.ts +65 -0
  161. package/dist/memory/types.d.ts.map +1 -0
  162. package/dist/preflight.d.ts +27 -0
  163. package/dist/preflight.d.ts.map +1 -0
  164. package/dist/preflight.js +3 -1
  165. package/dist/relay/auto-research.d.ts +64 -0
  166. package/dist/relay/auto-research.d.ts.map +1 -0
  167. package/dist/relay/auto-research.js +174 -69
  168. package/dist/relay/client.d.ts +126 -0
  169. package/dist/relay/client.d.ts.map +1 -0
  170. package/dist/relay/dispatcher.d.ts +207 -0
  171. package/dist/relay/dispatcher.d.ts.map +1 -0
  172. package/dist/relay/machine-store.d.ts +68 -0
  173. package/dist/relay/machine-store.d.ts.map +1 -0
  174. package/dist/relay/models-fetch.d.ts +75 -0
  175. package/dist/relay/models-fetch.d.ts.map +1 -0
  176. package/dist/relay/registration.d.ts +81 -0
  177. package/dist/relay/registration.d.ts.map +1 -0
  178. package/dist/sdk/agent-core/agent-loop.d.ts +24 -0
  179. package/dist/sdk/agent-core/agent-loop.d.ts.map +1 -0
  180. package/dist/sdk/agent-core/agent.d.ts +125 -0
  181. package/dist/sdk/agent-core/agent.d.ts.map +1 -0
  182. package/dist/sdk/agent-core/harness/agent-harness.d.ts +92 -0
  183. package/dist/sdk/agent-core/harness/agent-harness.d.ts.map +1 -0
  184. package/dist/sdk/agent-core/harness/compaction/branch-summarization.d.ts +53 -0
  185. package/dist/sdk/agent-core/harness/compaction/branch-summarization.d.ts.map +1 -0
  186. package/dist/sdk/agent-core/harness/compaction/compaction.d.ts +95 -0
  187. package/dist/sdk/agent-core/harness/compaction/compaction.d.ts.map +1 -0
  188. package/dist/sdk/agent-core/harness/compaction/utils.d.ts +25 -0
  189. package/dist/sdk/agent-core/harness/compaction/utils.d.ts.map +1 -0
  190. package/dist/sdk/agent-core/harness/env/nodejs.d.ts +51 -0
  191. package/dist/sdk/agent-core/harness/env/nodejs.d.ts.map +1 -0
  192. package/dist/sdk/agent-core/harness/messages.d.ts +51 -0
  193. package/dist/sdk/agent-core/harness/messages.d.ts.map +1 -0
  194. package/dist/sdk/agent-core/harness/prompt-templates.d.ts +48 -0
  195. package/dist/sdk/agent-core/harness/prompt-templates.d.ts.map +1 -0
  196. package/dist/sdk/agent-core/harness/session/jsonl-repo.d.ts +26 -0
  197. package/dist/sdk/agent-core/harness/session/jsonl-repo.d.ts.map +1 -0
  198. package/dist/sdk/agent-core/harness/session/jsonl-storage.d.ts +33 -0
  199. package/dist/sdk/agent-core/harness/session/jsonl-storage.d.ts.map +1 -0
  200. package/dist/sdk/agent-core/harness/session/memory-repo.d.ts +18 -0
  201. package/dist/sdk/agent-core/harness/session/memory-repo.d.ts.map +1 -0
  202. package/dist/sdk/agent-core/harness/session/memory-storage.d.ts +25 -0
  203. package/dist/sdk/agent-core/harness/session/memory-storage.d.ts.map +1 -0
  204. package/dist/sdk/agent-core/harness/session/repo-utils.d.ts +11 -0
  205. package/dist/sdk/agent-core/harness/session/repo-utils.d.ts.map +1 -0
  206. package/dist/sdk/agent-core/harness/session/session.d.ts +32 -0
  207. package/dist/sdk/agent-core/harness/session/session.d.ts.map +1 -0
  208. package/dist/sdk/agent-core/harness/session/uuid.d.ts +2 -0
  209. package/dist/sdk/agent-core/harness/session/uuid.d.ts.map +1 -0
  210. package/dist/sdk/agent-core/harness/skills.d.ts +44 -0
  211. package/dist/sdk/agent-core/harness/skills.d.ts.map +1 -0
  212. package/dist/sdk/agent-core/harness/system-prompt.d.ts +3 -0
  213. package/dist/sdk/agent-core/harness/system-prompt.d.ts.map +1 -0
  214. package/dist/sdk/agent-core/harness/types.d.ts +601 -0
  215. package/dist/sdk/agent-core/harness/types.d.ts.map +1 -0
  216. package/dist/sdk/agent-core/harness/utils/shell-output.d.ts +14 -0
  217. package/dist/sdk/agent-core/harness/utils/shell-output.d.ts.map +1 -0
  218. package/dist/sdk/agent-core/harness/utils/truncate.d.ts +70 -0
  219. package/dist/sdk/agent-core/harness/utils/truncate.d.ts.map +1 -0
  220. package/dist/sdk/agent-core/index.d.ts +20 -0
  221. package/dist/sdk/agent-core/index.d.ts.map +1 -0
  222. package/dist/sdk/agent-core/node.d.ts +3 -0
  223. package/dist/sdk/agent-core/node.d.ts.map +1 -0
  224. package/dist/sdk/agent-core/proxy.d.ts +69 -0
  225. package/dist/sdk/agent-core/proxy.d.ts.map +1 -0
  226. package/dist/sdk/agent-core/types.d.ts +393 -0
  227. package/dist/sdk/agent-core/types.d.ts.map +1 -0
  228. package/dist/sdk/ai/api-registry.d.ts +20 -0
  229. package/dist/sdk/ai/api-registry.d.ts.map +1 -0
  230. package/dist/sdk/ai/cli.d.ts +3 -0
  231. package/dist/sdk/ai/cli.d.ts.map +1 -0
  232. package/dist/sdk/ai/env-api-keys.d.ts +18 -0
  233. package/dist/sdk/ai/env-api-keys.d.ts.map +1 -0
  234. package/dist/sdk/ai/image-models.d.ts +10 -0
  235. package/dist/sdk/ai/image-models.d.ts.map +1 -0
  236. package/dist/sdk/ai/image-models.generated.d.ts +440 -0
  237. package/dist/sdk/ai/image-models.generated.d.ts.map +1 -0
  238. package/dist/sdk/ai/images-api-registry.d.ts +14 -0
  239. package/dist/sdk/ai/images-api-registry.d.ts.map +1 -0
  240. package/dist/sdk/ai/images.d.ts +4 -0
  241. package/dist/sdk/ai/images.d.ts.map +1 -0
  242. package/dist/sdk/ai/index.d.ts +21 -0
  243. package/dist/sdk/ai/index.d.ts.map +1 -0
  244. package/dist/sdk/ai/models.d.ts +18 -0
  245. package/dist/sdk/ai/models.d.ts.map +1 -0
  246. package/dist/sdk/ai/models.generated.d.ts +17349 -0
  247. package/dist/sdk/ai/models.generated.d.ts.map +1 -0
  248. package/dist/sdk/ai/oauth.d.ts +2 -0
  249. package/dist/sdk/ai/oauth.d.ts.map +1 -0
  250. package/dist/sdk/ai/providers/anthropic.d.ts +54 -0
  251. package/dist/sdk/ai/providers/anthropic.d.ts.map +1 -0
  252. package/dist/sdk/ai/providers/faux.d.ts +56 -0
  253. package/dist/sdk/ai/providers/faux.d.ts.map +1 -0
  254. package/dist/sdk/ai/providers/github-copilot-headers.d.ts +8 -0
  255. package/dist/sdk/ai/providers/github-copilot-headers.d.ts.map +1 -0
  256. package/dist/sdk/ai/providers/openai-completions.d.ts +19 -0
  257. package/dist/sdk/ai/providers/openai-completions.d.ts.map +1 -0
  258. package/dist/sdk/ai/providers/openai-prompt-cache.d.ts +3 -0
  259. package/dist/sdk/ai/providers/openai-prompt-cache.d.ts.map +1 -0
  260. package/dist/sdk/ai/providers/register-builtins.d.ts +15 -0
  261. package/dist/sdk/ai/providers/register-builtins.d.ts.map +1 -0
  262. package/dist/sdk/ai/providers/simple-options.d.ts +8 -0
  263. package/dist/sdk/ai/providers/simple-options.d.ts.map +1 -0
  264. package/dist/sdk/ai/providers/transform-messages.d.ts +8 -0
  265. package/dist/sdk/ai/providers/transform-messages.d.ts.map +1 -0
  266. package/dist/sdk/ai/session-resources.d.ts +4 -0
  267. package/dist/sdk/ai/session-resources.d.ts.map +1 -0
  268. package/dist/sdk/ai/stream.d.ts +8 -0
  269. package/dist/sdk/ai/stream.d.ts.map +1 -0
  270. package/dist/sdk/ai/types.d.ts +488 -0
  271. package/dist/sdk/ai/types.d.ts.map +1 -0
  272. package/dist/sdk/ai/utils/diagnostics.d.ts +19 -0
  273. package/dist/sdk/ai/utils/diagnostics.d.ts.map +1 -0
  274. package/dist/sdk/ai/utils/event-stream.d.ts +21 -0
  275. package/dist/sdk/ai/utils/event-stream.d.ts.map +1 -0
  276. package/dist/sdk/ai/utils/hash.d.ts +3 -0
  277. package/dist/sdk/ai/utils/hash.d.ts.map +1 -0
  278. package/dist/sdk/ai/utils/headers.d.ts +2 -0
  279. package/dist/sdk/ai/utils/headers.d.ts.map +1 -0
  280. package/dist/sdk/ai/utils/json-parse.d.ts +16 -0
  281. package/dist/sdk/ai/utils/json-parse.d.ts.map +1 -0
  282. package/dist/sdk/ai/utils/node-http-proxy.d.ts +10 -0
  283. package/dist/sdk/ai/utils/node-http-proxy.d.ts.map +1 -0
  284. package/dist/sdk/ai/utils/oauth/anthropic.d.ts +25 -0
  285. package/dist/sdk/ai/utils/oauth/anthropic.d.ts.map +1 -0
  286. package/dist/sdk/ai/utils/oauth/device-code.d.ts +19 -0
  287. package/dist/sdk/ai/utils/oauth/device-code.d.ts.map +1 -0
  288. package/dist/sdk/ai/utils/oauth/github-copilot.d.ts +30 -0
  289. package/dist/sdk/ai/utils/oauth/github-copilot.d.ts.map +1 -0
  290. package/dist/sdk/ai/utils/oauth/index.d.ts +58 -0
  291. package/dist/sdk/ai/utils/oauth/index.d.ts.map +1 -0
  292. package/dist/sdk/ai/utils/oauth/oauth-page.d.ts +3 -0
  293. package/dist/sdk/ai/utils/oauth/oauth-page.d.ts.map +1 -0
  294. package/dist/sdk/ai/utils/oauth/openai-codex.d.ts +34 -0
  295. package/dist/sdk/ai/utils/oauth/openai-codex.d.ts.map +1 -0
  296. package/dist/sdk/ai/utils/oauth/pkce.d.ts +13 -0
  297. package/dist/sdk/ai/utils/oauth/pkce.d.ts.map +1 -0
  298. package/dist/sdk/ai/utils/oauth/types.d.ts +64 -0
  299. package/dist/sdk/ai/utils/oauth/types.d.ts.map +1 -0
  300. package/dist/sdk/ai/utils/overflow.d.ts +56 -0
  301. package/dist/sdk/ai/utils/overflow.d.ts.map +1 -0
  302. package/dist/sdk/ai/utils/sanitize-unicode.d.ts +22 -0
  303. package/dist/sdk/ai/utils/sanitize-unicode.d.ts.map +1 -0
  304. package/dist/sdk/ai/utils/typebox-helpers.d.ts +17 -0
  305. package/dist/sdk/ai/utils/typebox-helpers.d.ts.map +1 -0
  306. package/dist/sdk/ai/utils/validation.d.ts +18 -0
  307. package/dist/sdk/ai/utils/validation.d.ts.map +1 -0
  308. package/dist/sdk/coding-agent/cli.d.ts +3 -0
  309. package/dist/sdk/coding-agent/cli.d.ts.map +1 -0
  310. package/dist/sdk/coding-agent/config.d.ts +71 -0
  311. package/dist/sdk/coding-agent/config.d.ts.map +1 -0
  312. package/dist/sdk/coding-agent/core/agent-session-runtime.d.ts +117 -0
  313. package/dist/sdk/coding-agent/core/agent-session-runtime.d.ts.map +1 -0
  314. package/dist/sdk/coding-agent/core/agent-session-services.d.ts +86 -0
  315. package/dist/sdk/coding-agent/core/agent-session-services.d.ts.map +1 -0
  316. package/dist/sdk/coding-agent/core/agent-session.d.ts +626 -0
  317. package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -0
  318. package/dist/sdk/coding-agent/core/auth-guidance.d.ts +5 -0
  319. package/dist/sdk/coding-agent/core/auth-guidance.d.ts.map +1 -0
  320. package/dist/sdk/coding-agent/core/auth-storage.d.ts +145 -0
  321. package/dist/sdk/coding-agent/core/auth-storage.d.ts.map +1 -0
  322. package/dist/sdk/coding-agent/core/bash-executor.d.ts +32 -0
  323. package/dist/sdk/coding-agent/core/bash-executor.d.ts.map +1 -0
  324. package/dist/sdk/coding-agent/core/compaction/branch-summarization.d.ts +88 -0
  325. package/dist/sdk/coding-agent/core/compaction/branch-summarization.d.ts.map +1 -0
  326. package/dist/sdk/coding-agent/core/compaction/compaction.d.ts +142 -0
  327. package/dist/sdk/coding-agent/core/compaction/compaction.d.ts.map +1 -0
  328. package/dist/sdk/coding-agent/core/compaction/index.d.ts +7 -0
  329. package/dist/sdk/coding-agent/core/compaction/index.d.ts.map +1 -0
  330. package/dist/sdk/coding-agent/core/compaction/utils.d.ts +38 -0
  331. package/dist/sdk/coding-agent/core/compaction/utils.d.ts.map +1 -0
  332. package/dist/sdk/coding-agent/core/defaults.d.ts +3 -0
  333. package/dist/sdk/coding-agent/core/defaults.d.ts.map +1 -0
  334. package/dist/sdk/coding-agent/core/diagnostics.d.ts +15 -0
  335. package/dist/sdk/coding-agent/core/diagnostics.d.ts.map +1 -0
  336. package/dist/sdk/coding-agent/core/event-bus.d.ts +9 -0
  337. package/dist/sdk/coding-agent/core/event-bus.d.ts.map +1 -0
  338. package/dist/sdk/coding-agent/core/exec.d.ts +29 -0
  339. package/dist/sdk/coding-agent/core/exec.d.ts.map +1 -0
  340. package/dist/sdk/coding-agent/core/extensions/index.d.ts +12 -0
  341. package/dist/sdk/coding-agent/core/extensions/index.d.ts.map +1 -0
  342. package/dist/sdk/coding-agent/core/extensions/loader.d.ts +24 -0
  343. package/dist/sdk/coding-agent/core/extensions/loader.d.ts.map +1 -0
  344. package/dist/sdk/coding-agent/core/extensions/loader.js +1 -0
  345. package/dist/sdk/coding-agent/core/extensions/runner.d.ts +161 -0
  346. package/dist/sdk/coding-agent/core/extensions/runner.d.ts.map +1 -0
  347. package/dist/sdk/coding-agent/core/extensions/types.d.ts +1181 -0
  348. package/dist/sdk/coding-agent/core/extensions/types.d.ts.map +1 -0
  349. package/dist/sdk/coding-agent/core/extensions/wrapper.d.ts +20 -0
  350. package/dist/sdk/coding-agent/core/extensions/wrapper.d.ts.map +1 -0
  351. package/dist/sdk/coding-agent/core/http-dispatcher.d.ts +21 -0
  352. package/dist/sdk/coding-agent/core/http-dispatcher.d.ts.map +1 -0
  353. package/dist/sdk/coding-agent/core/index.d.ts +12 -0
  354. package/dist/sdk/coding-agent/core/index.d.ts.map +1 -0
  355. package/dist/sdk/coding-agent/core/keybindings.d.ts +371 -0
  356. package/dist/sdk/coding-agent/core/keybindings.d.ts.map +1 -0
  357. package/dist/sdk/coding-agent/core/messages.d.ts +77 -0
  358. package/dist/sdk/coding-agent/core/messages.d.ts.map +1 -0
  359. package/dist/sdk/coding-agent/core/model-registry.d.ts +150 -0
  360. package/dist/sdk/coding-agent/core/model-registry.d.ts.map +1 -0
  361. package/dist/sdk/coding-agent/core/model-resolver-utils.d.ts +7 -0
  362. package/dist/sdk/coding-agent/core/model-resolver-utils.d.ts.map +1 -0
  363. package/dist/sdk/coding-agent/core/model-resolver.d.ts +110 -0
  364. package/dist/sdk/coding-agent/core/model-resolver.d.ts.map +1 -0
  365. package/dist/sdk/coding-agent/core/output-guard.d.ts +6 -0
  366. package/dist/sdk/coding-agent/core/output-guard.d.ts.map +1 -0
  367. package/dist/sdk/coding-agent/core/package-manager.d.ts +204 -0
  368. package/dist/sdk/coding-agent/core/package-manager.d.ts.map +1 -0
  369. package/dist/sdk/coding-agent/core/prompt-templates.d.ts +52 -0
  370. package/dist/sdk/coding-agent/core/prompt-templates.d.ts.map +1 -0
  371. package/dist/sdk/coding-agent/core/provider-display-names.d.ts +2 -0
  372. package/dist/sdk/coding-agent/core/provider-display-names.d.ts.map +1 -0
  373. package/dist/sdk/coding-agent/core/resolve-config-value.d.ts +23 -0
  374. package/dist/sdk/coding-agent/core/resolve-config-value.d.ts.map +1 -0
  375. package/dist/sdk/coding-agent/core/resource-loader.d.ts +194 -0
  376. package/dist/sdk/coding-agent/core/resource-loader.d.ts.map +1 -0
  377. package/dist/sdk/coding-agent/core/sdk.d.ts +107 -0
  378. package/dist/sdk/coding-agent/core/sdk.d.ts.map +1 -0
  379. package/dist/sdk/coding-agent/core/session-cwd.d.ts +19 -0
  380. package/dist/sdk/coding-agent/core/session-cwd.d.ts.map +1 -0
  381. package/dist/sdk/coding-agent/core/session-manager.d.ts +333 -0
  382. package/dist/sdk/coding-agent/core/session-manager.d.ts.map +1 -0
  383. package/dist/sdk/coding-agent/core/settings-manager.d.ts +209 -0
  384. package/dist/sdk/coding-agent/core/settings-manager.d.ts.map +1 -0
  385. package/dist/sdk/coding-agent/core/skills.d.ts +60 -0
  386. package/dist/sdk/coding-agent/core/skills.d.ts.map +1 -0
  387. package/dist/sdk/coding-agent/core/slash-commands.d.ts +14 -0
  388. package/dist/sdk/coding-agent/core/slash-commands.d.ts.map +1 -0
  389. package/dist/sdk/coding-agent/core/source-info.d.ts +18 -0
  390. package/dist/sdk/coding-agent/core/source-info.d.ts.map +1 -0
  391. package/dist/sdk/coding-agent/core/system-prompt.d.ts +28 -0
  392. package/dist/sdk/coding-agent/core/system-prompt.d.ts.map +1 -0
  393. package/dist/sdk/coding-agent/core/telemetry.d.ts +3 -0
  394. package/dist/sdk/coding-agent/core/telemetry.d.ts.map +1 -0
  395. package/dist/sdk/coding-agent/core/theme.d.ts +28 -0
  396. package/dist/sdk/coding-agent/core/theme.d.ts.map +1 -0
  397. package/dist/sdk/coding-agent/core/timings.d.ts +8 -0
  398. package/dist/sdk/coding-agent/core/timings.d.ts.map +1 -0
  399. package/dist/sdk/coding-agent/core/tools/bash.d.ts +63 -0
  400. package/dist/sdk/coding-agent/core/tools/bash.d.ts.map +1 -0
  401. package/dist/sdk/coding-agent/core/tools/edit-diff.d.ts +87 -0
  402. package/dist/sdk/coding-agent/core/tools/edit-diff.d.ts.map +1 -0
  403. package/dist/sdk/coding-agent/core/tools/edit.d.ts +39 -0
  404. package/dist/sdk/coding-agent/core/tools/edit.d.ts.map +1 -0
  405. package/dist/sdk/coding-agent/core/tools/file-mutation-queue.d.ts +6 -0
  406. package/dist/sdk/coding-agent/core/tools/file-mutation-queue.d.ts.map +1 -0
  407. package/dist/sdk/coding-agent/core/tools/find.d.ts +35 -0
  408. package/dist/sdk/coding-agent/core/tools/find.d.ts.map +1 -0
  409. package/dist/sdk/coding-agent/core/tools/grep.d.ts +37 -0
  410. package/dist/sdk/coding-agent/core/tools/grep.d.ts.map +1 -0
  411. package/dist/sdk/coding-agent/core/tools/index.d.ts +40 -0
  412. package/dist/sdk/coding-agent/core/tools/index.d.ts.map +1 -0
  413. package/dist/sdk/coding-agent/core/tools/ls.d.ts +37 -0
  414. package/dist/sdk/coding-agent/core/tools/ls.d.ts.map +1 -0
  415. package/dist/sdk/coding-agent/core/tools/output-accumulator.d.ts +52 -0
  416. package/dist/sdk/coding-agent/core/tools/output-accumulator.d.ts.map +1 -0
  417. package/dist/sdk/coding-agent/core/tools/path-utils.d.ts +8 -0
  418. package/dist/sdk/coding-agent/core/tools/path-utils.d.ts.map +1 -0
  419. package/dist/sdk/coding-agent/core/tools/read.d.ts +35 -0
  420. package/dist/sdk/coding-agent/core/tools/read.d.ts.map +1 -0
  421. package/dist/sdk/coding-agent/core/tools/read.js +18 -10
  422. package/dist/sdk/coding-agent/core/tools/render-diff.d.ts +17 -0
  423. package/dist/sdk/coding-agent/core/tools/render-diff.d.ts.map +1 -0
  424. package/dist/sdk/coding-agent/core/tools/render-utils.d.ts +21 -0
  425. package/dist/sdk/coding-agent/core/tools/render-utils.d.ts.map +1 -0
  426. package/dist/sdk/coding-agent/core/tools/tool-definition-wrapper.d.ts +14 -0
  427. package/dist/sdk/coding-agent/core/tools/tool-definition-wrapper.d.ts.map +1 -0
  428. package/dist/sdk/coding-agent/core/tools/truncate.d.ts +70 -0
  429. package/dist/sdk/coding-agent/core/tools/truncate.d.ts.map +1 -0
  430. package/dist/sdk/coding-agent/core/tools/write.d.ts +26 -0
  431. package/dist/sdk/coding-agent/core/tools/write.d.ts.map +1 -0
  432. package/dist/sdk/coding-agent/index.d.ts +29 -0
  433. package/dist/sdk/coding-agent/index.d.ts.map +1 -0
  434. package/dist/sdk/coding-agent/main.d.ts +2 -0
  435. package/dist/sdk/coding-agent/main.d.ts.map +1 -0
  436. package/dist/sdk/coding-agent/migrations.d.ts +33 -0
  437. package/dist/sdk/coding-agent/migrations.d.ts.map +1 -0
  438. package/dist/sdk/coding-agent/modes/index.d.ts +8 -0
  439. package/dist/sdk/coding-agent/modes/index.d.ts.map +1 -0
  440. package/dist/sdk/coding-agent/modes/print-mode.d.ts +28 -0
  441. package/dist/sdk/coding-agent/modes/print-mode.d.ts.map +1 -0
  442. package/dist/sdk/coding-agent/modes/rpc/jsonl.d.ts +17 -0
  443. package/dist/sdk/coding-agent/modes/rpc/jsonl.d.ts.map +1 -0
  444. package/dist/sdk/coding-agent/modes/rpc/rpc-client.d.ts +224 -0
  445. package/dist/sdk/coding-agent/modes/rpc/rpc-client.d.ts.map +1 -0
  446. package/dist/sdk/coding-agent/modes/rpc/rpc-mode.d.ts +20 -0
  447. package/dist/sdk/coding-agent/modes/rpc/rpc-mode.d.ts.map +1 -0
  448. package/dist/sdk/coding-agent/modes/rpc/rpc-types.d.ts +419 -0
  449. package/dist/sdk/coding-agent/modes/rpc/rpc-types.d.ts.map +1 -0
  450. package/dist/sdk/coding-agent/utils/ansi.d.ts +2 -0
  451. package/dist/sdk/coding-agent/utils/ansi.d.ts.map +1 -0
  452. package/dist/sdk/coding-agent/utils/changelog.d.ts +21 -0
  453. package/dist/sdk/coding-agent/utils/changelog.d.ts.map +1 -0
  454. package/dist/sdk/coding-agent/utils/child-process.d.ts +15 -0
  455. package/dist/sdk/coding-agent/utils/child-process.d.ts.map +1 -0
  456. package/dist/sdk/coding-agent/utils/clipboard-image.d.ts +11 -0
  457. package/dist/sdk/coding-agent/utils/clipboard-image.d.ts.map +1 -0
  458. package/dist/sdk/coding-agent/utils/clipboard-native.d.ts +8 -0
  459. package/dist/sdk/coding-agent/utils/clipboard-native.d.ts.map +1 -0
  460. package/dist/sdk/coding-agent/utils/clipboard.d.ts +2 -0
  461. package/dist/sdk/coding-agent/utils/clipboard.d.ts.map +1 -0
  462. package/dist/sdk/coding-agent/utils/exif-orientation.d.ts +5 -0
  463. package/dist/sdk/coding-agent/utils/exif-orientation.d.ts.map +1 -0
  464. package/dist/sdk/coding-agent/utils/frontmatter.d.ts +8 -0
  465. package/dist/sdk/coding-agent/utils/frontmatter.d.ts.map +1 -0
  466. package/dist/sdk/coding-agent/utils/fs-watch.d.ts +5 -0
  467. package/dist/sdk/coding-agent/utils/fs-watch.d.ts.map +1 -0
  468. package/dist/sdk/coding-agent/utils/git.d.ts +26 -0
  469. package/dist/sdk/coding-agent/utils/git.d.ts.map +1 -0
  470. package/dist/sdk/coding-agent/utils/html.d.ts +7 -0
  471. package/dist/sdk/coding-agent/utils/html.d.ts.map +1 -0
  472. package/dist/sdk/coding-agent/utils/image-convert.d.ts +9 -0
  473. package/dist/sdk/coding-agent/utils/image-convert.d.ts.map +1 -0
  474. package/dist/sdk/coding-agent/utils/image-resize.d.ts +36 -0
  475. package/dist/sdk/coding-agent/utils/image-resize.d.ts.map +1 -0
  476. package/dist/sdk/coding-agent/utils/mime.d.ts +3 -0
  477. package/dist/sdk/coding-agent/utils/mime.d.ts.map +1 -0
  478. package/dist/sdk/coding-agent/utils/paths.d.ts +31 -0
  479. package/dist/sdk/coding-agent/utils/paths.d.ts.map +1 -0
  480. package/dist/sdk/coding-agent/utils/photon.d.ts +13 -0
  481. package/dist/sdk/coding-agent/utils/photon.d.ts.map +1 -0
  482. package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts +2 -0
  483. package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts.map +1 -0
  484. package/dist/sdk/coding-agent/utils/shell.d.ts +30 -0
  485. package/dist/sdk/coding-agent/utils/shell.d.ts.map +1 -0
  486. package/dist/sdk/coding-agent/utils/sleep.d.ts +5 -0
  487. package/dist/sdk/coding-agent/utils/sleep.d.ts.map +1 -0
  488. package/dist/sdk/coding-agent/utils/syntax-highlight.d.ts +12 -0
  489. package/dist/sdk/coding-agent/utils/syntax-highlight.d.ts.map +1 -0
  490. package/dist/sdk/coding-agent/utils/tools-manager.d.ts +3 -0
  491. package/dist/sdk/coding-agent/utils/tools-manager.d.ts.map +1 -0
  492. package/dist/sdk/coding-agent/utils/version-check.d.ts +15 -0
  493. package/dist/sdk/coding-agent/utils/version-check.d.ts.map +1 -0
  494. package/dist/sdk/coding-agent/utils/windows-self-update.d.ts +3 -0
  495. package/dist/sdk/coding-agent/utils/windows-self-update.d.ts.map +1 -0
  496. package/dist/server/agent-bridge.d.ts +308 -0
  497. package/dist/server/agent-bridge.d.ts.map +1 -0
  498. package/dist/server/handlers/errors.d.ts +26 -0
  499. package/dist/server/handlers/errors.d.ts.map +1 -0
  500. package/dist/server/handlers/paths-autocomplete.d.ts +45 -0
  501. package/dist/server/handlers/paths-autocomplete.d.ts.map +1 -0
  502. package/dist/server/handlers/projects.d.ts +58 -0
  503. package/dist/server/handlers/projects.d.ts.map +1 -0
  504. package/dist/server/handlers/queue.d.ts +27 -0
  505. package/dist/server/handlers/queue.d.ts.map +1 -0
  506. package/dist/server/handlers/sessions.d.ts +50 -0
  507. package/dist/server/handlers/sessions.d.ts.map +1 -0
  508. package/dist/server/paths.d.ts +51 -0
  509. package/dist/server/paths.d.ts.map +1 -0
  510. package/dist/server/session-stream.d.ts +379 -0
  511. package/dist/server/session-stream.d.ts.map +1 -0
  512. package/dist/server/shutdown.d.ts +102 -0
  513. package/dist/server/shutdown.d.ts.map +1 -0
  514. package/dist/server/storage.d.ts +287 -0
  515. package/dist/server/storage.d.ts.map +1 -0
  516. package/dist/server/title-generator.d.ts +25 -0
  517. package/dist/server/title-generator.d.ts.map +1 -0
  518. package/dist/server/wire.d.ts +448 -0
  519. package/dist/server/wire.d.ts.map +1 -0
  520. package/dist/studio-binding.d.ts +44 -0
  521. package/dist/studio-binding.d.ts.map +1 -0
  522. package/dist/studio-binding.js +1 -1
  523. package/package.json +11 -1
@@ -0,0 +1,3 @@
1
+ export declare function detectSupportedImageMimeType(buffer: Uint8Array): string | null;
2
+ export declare function detectSupportedImageMimeTypeFromFile(filePath: string): Promise<string | null>;
3
+ //# sourceMappingURL=mime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mime.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/utils/mime.ts"],"names":[],"mappings":"AAKA,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAc9E;AAED,wBAAsB,oCAAoC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASnG"}
@@ -0,0 +1,31 @@
1
+ export interface PathInputOptions {
2
+ /** Trim leading/trailing whitespace before normalization. */
3
+ trim?: boolean;
4
+ /** Expand leading `~` to a home directory. Defaults to true. */
5
+ expandTilde?: boolean;
6
+ /** Home directory used for `~` expansion. Defaults to `os.homedir()`. */
7
+ homeDir?: string;
8
+ /** Strip a leading `@`, used for CLI @file paths. */
9
+ stripAtPrefix?: boolean;
10
+ /** Normalize unicode space variants to regular spaces. */
11
+ normalizeUnicodeSpaces?: boolean;
12
+ }
13
+ /**
14
+ * Resolve a path to its canonical (real) form, following symlinks.
15
+ * Falls back to the raw path if resolution fails (e.g. the target does
16
+ * not exist yet), so that callers never crash on missing filesystem
17
+ * entries.
18
+ */
19
+ export declare function canonicalizePath(path: string): string;
20
+ /**
21
+ * Returns true if the value is NOT a package source (npm:, git:, etc.)
22
+ * or a remote URL protocol. Bare names, relative paths, and file: URLs
23
+ * are considered local.
24
+ */
25
+ export declare function isLocalPath(value: string): boolean;
26
+ export declare function normalizePath(input: string, options?: PathInputOptions): string;
27
+ export declare function resolvePath(input: string, baseDir?: string, options?: PathInputOptions): string;
28
+ export declare function getCwdRelativePath(filePath: string, cwd: string): string | undefined;
29
+ export declare function formatPathRelativeToCwdOrAbsolute(filePath: string, cwd: string): string;
30
+ export declare function markPathIgnoredByCloudSync(path: string): void;
31
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/utils/paths.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,gBAAgB;IAChC,6DAA6D;IAC7D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0DAA0D;IAC1D,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAclD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAsBnF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAIlH;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASpF;AAED,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGvF;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAe7D"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Photon image processing wrapper.
3
+ *
4
+ * This module provides a unified interface to @silvia-odwyer/photon-node for
5
+ * use in Node.js (development, npm run build).
6
+ */
7
+ export type { PhotonImage as PhotonImageType } from "@silvia-odwyer/photon-node";
8
+ /**
9
+ * Load the photon module asynchronously.
10
+ * Returns cached module on subsequent calls.
11
+ */
12
+ export declare function loadPhoton(): Promise<typeof import("@silvia-odwyer/photon-node") | null>;
13
+ //# sourceMappingURL=photon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"photon.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/utils/photon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,YAAY,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAuFjF;;;GAGG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,cAAc,4BAA4B,CAAC,GAAG,IAAI,CAAC,CAuB9F"}
@@ -0,0 +1,2 @@
1
+ export declare function getPiUserAgent(version: string): string;
2
+ //# sourceMappingURL=pi-user-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pi-user-agent.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/utils/pi-user-agent.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD"}
@@ -0,0 +1,30 @@
1
+ export interface ShellConfig {
2
+ shell: string;
3
+ args: string[];
4
+ }
5
+ /**
6
+ * Resolve shell configuration based on platform and an optional explicit shell path.
7
+ * Resolution order:
8
+ * 1. User-specified shellPath
9
+ * 2. On Windows: Git Bash in known locations, then bash on PATH
10
+ * 3. On Unix: /bin/bash, then bash on PATH, then fallback to sh
11
+ */
12
+ export declare function getShellConfig(customShellPath?: string): ShellConfig;
13
+ export declare function getShellEnv(): NodeJS.ProcessEnv;
14
+ /**
15
+ * Sanitize binary output for display/storage.
16
+ * Removes characters that crash string-width or cause display issues:
17
+ * - Control characters (except tab, newline, carriage return)
18
+ * - Lone surrogates
19
+ * - Unicode Format characters (crash string-width due to a bug)
20
+ * - Characters with undefined code points
21
+ */
22
+ export declare function sanitizeBinaryOutput(str: string): string;
23
+ export declare function trackDetachedChildPid(pid: number): void;
24
+ export declare function untrackDetachedChildPid(pid: number): void;
25
+ export declare function killTrackedDetachedChildren(): void;
26
+ /**
27
+ * Kill a process and all its children (cross-platform)
28
+ */
29
+ export declare function killProcessTree(pid: number): void;
30
+ //# sourceMappingURL=shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/utils/shell.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,EAAE,CAAC;CACf;AAyCD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,WAAW,CAqDpE;AAED,wBAAgB,WAAW,IAAI,MAAM,CAAC,UAAU,CAY/C;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA8BxD;AAQD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAKlD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAyBjD"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Sleep helper that respects abort signal.
3
+ */
4
+ export declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
5
+ //# sourceMappingURL=sleep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/utils/sleep.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAcrE"}
@@ -0,0 +1,12 @@
1
+ export type HighlightFormatter = (text: string) => string;
2
+ export type HighlightTheme = Partial<Record<string, HighlightFormatter>>;
3
+ export interface HighlightOptions {
4
+ language?: string;
5
+ ignoreIllegals?: boolean;
6
+ languageSubset?: string[];
7
+ theme?: HighlightTheme;
8
+ }
9
+ export declare function renderHighlightedHtml(html: string, theme?: HighlightTheme): string;
10
+ export declare function highlight(code: string, options?: HighlightOptions): string;
11
+ export declare function supportsLanguage(name: string): boolean;
12
+ //# sourceMappingURL=syntax-highlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syntax-highlight.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/utils/syntax-highlight.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAEzE,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,cAAc,CAAC;CACvB;AAoED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,cAAmB,GAAG,MAAM,CAoDtF;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAQ9E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD"}
@@ -0,0 +1,3 @@
1
+ export declare function getToolPath(tool: "fd" | "rg"): string | null;
2
+ export declare function ensureTool(tool: "fd" | "rg", silent?: boolean): Promise<string | undefined>;
3
+ //# sourceMappingURL=tools-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools-manager.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/utils/tools-manager.ts"],"names":[],"mappings":"AAoFA,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAmB5D;AA8ND,wBAAsB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,MAAM,GAAE,OAAe,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA2CxG"}
@@ -0,0 +1,15 @@
1
+ export interface LatestPiRelease {
2
+ version: string;
3
+ packageName?: string;
4
+ note?: string;
5
+ }
6
+ export declare function comparePackageVersions(leftVersion: string, rightVersion: string): number | undefined;
7
+ export declare function isNewerPackageVersion(candidateVersion: string, currentVersion: string): boolean;
8
+ export declare function getLatestPiRelease(currentVersion: string, options?: {
9
+ timeoutMs?: number;
10
+ }): Promise<LatestPiRelease | undefined>;
11
+ export declare function getLatestPiVersion(currentVersion: string, options?: {
12
+ timeoutMs?: number;
13
+ }): Promise<string | undefined>;
14
+ export declare function checkForNewPiVersion(currentVersion: string): Promise<LatestPiRelease | undefined>;
15
+ //# sourceMappingURL=version-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-check.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/utils/version-check.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAsBD,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAcpG;AAED,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAM/F;AAED,wBAAsB,kBAAkB,CACvC,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CA4BtC;AAED,wBAAsB,kBAAkB,CACvC,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7B;AAED,wBAAsB,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAUvG"}
@@ -0,0 +1,3 @@
1
+ export declare function cleanupWindowsSelfUpdateQuarantine(packageDir: string): void;
2
+ export declare function quarantineWindowsNativeDependencies(packageDir: string): void;
3
+ //# sourceMappingURL=windows-self-update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"windows-self-update.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/utils/windows-self-update.ts"],"names":[],"mappings":"AAiDA,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAU3E;AAED,wBAAgB,mCAAmC,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAsB5E"}
@@ -0,0 +1,308 @@
1
+ /**
2
+ * Per-connection pi SDK lifecycle.
3
+ *
4
+ * One `AgentBridge` instance per active WebSocket connection. Wraps:
5
+ * - `createAgentSession` (in-memory session manager — we own persistence in
6
+ * SQLite; pi doesn't need to write its own JSONL files).
7
+ * - `subscribe` listener that translates pi `AgentSessionEvent`s into our
8
+ * own `ServerEvent` wire format and pushes them through a caller-supplied
9
+ * sink.
10
+ * - `prompt(text)` to send user input.
11
+ * - `dispose()` for clean teardown on WS close.
12
+ *
13
+ * Event mapping (pi → wire):
14
+ * - `message_start` (assistant) → emit our own `message_start` with a
15
+ * fresh UUID `messageId`. Pi's AssistantMessage has no stable id field, so
16
+ * we mint one per turn and use it for all subsequent deltas/tool events
17
+ * until `message_end`.
18
+ * - `message_update` w/ inner text_delta / thinking_delta → wire `text_delta`
19
+ * or `thinking_delta` carrying the `delta` and our `messageId`.
20
+ * - `tool_execution_start` → wire `tool_call`.
21
+ * - `tool_execution_end` → wire `tool_result`.
22
+ * - `message_end` (assistant) → wire `message_end` and persist the
23
+ * final assembled text + JSONL of every WIRE event we emitted for this
24
+ * message into SQLite. Content is taken from the final
25
+ * `AssistantMessage.content` (concatenating `text` blocks); we fall back
26
+ * to the `text_delta` accumulator when the provider didn't populate
27
+ * final blocks (e.g. deepseek via openai-compatible).
28
+ * - `agent_end` → wire `agent_end`.
29
+ *
30
+ * Persistence shape:
31
+ * `events_jsonl` is the newline-delimited JSON of the wire-format
32
+ * `ServerEvent`s we emitted for this message — NOT raw pi
33
+ * `AgentSessionEvent`s. This guarantees the client's `parseWireEvents`
34
+ * reducer can rehydrate the turn after a refresh using the exact same
35
+ * reducer it uses for the live broadcast.
36
+ *
37
+ * Errors thrown synchronously from `session.prompt()` (e.g. no model
38
+ * configured) are caught by the caller in `routes.ts` and re-emitted as
39
+ * `{type:"error"}`.
40
+ *
41
+ * History rehydration:
42
+ * On first attach to a previously-created session (e.g. after a server
43
+ * restart), the SessionStreamManager passes the full SQLite transcript
44
+ * to the AgentBridge via `AgentBridgeOptions.history`. Before
45
+ * `createAgentSession` is called, each message is appended to the
46
+ * in-memory SessionManager so the LLM sees the full conversation
47
+ * context from the very first prompt. Multi-turn conversations within
48
+ * a single pi session also work normally (the same AgentSession
49
+ * instance is reused across `prompt()` calls).
50
+ */
51
+ import { type AgentSessionEvent } from "../sdk/coding-agent/index.js";
52
+ import { fetchAllowedModels as defaultFetchAllowedModels } from "../relay/models-fetch.js";
53
+ import type { SessionMemorySnapshot } from "./storage.js";
54
+ import type { ImageAttachment, ServerEvent, WireMessage } from "./wire.js";
55
+ /** Optional override for fetchAllowedModels (tests inject a mock). */
56
+ export type FetchAllowedModelsFn = typeof defaultFetchAllowedModels;
57
+ export interface AgentBridgeOptions {
58
+ /** Working directory pi will operate in (used by built-in tools). */
59
+ cwd: string;
60
+ /** Pi config / agent dir. Defaults to ~/.spectral/agent (pi default). */
61
+ agentDir?: string;
62
+ /**
63
+ * Backend base URL (no trailing slash). All inference is proxied through
64
+ * `${backendUrl}/v1` — pi NEVER reads `~/.spectral/agent/auth.json` and NEVER
65
+ * holds raw provider API keys; the backend authenticates the machine via
66
+ * `machineJwt` and uses its own centralized provider credentials.
67
+ */
68
+ backendUrl: string;
69
+ /**
70
+ * Bearer token used to authenticate with the backend's `/v1/*` endpoints
71
+ * AND with the GraphQL `availableBaseModels` query. Issued by
72
+ * `ensureMachineRegistered` and persisted in `machine.json`.
73
+ */
74
+ machineJwt: string;
75
+ /** Sink for outbound wire events. Synchronous; the bridge does not buffer. */
76
+ emit: (event: ServerEvent) => void;
77
+ /**
78
+ * Called when an assistant message completes, after `message_end` is
79
+ * emitted. The bridge passes the accumulated text content and the JSONL
80
+ * of every pi event captured for this message. Caller is expected to
81
+ * persist this to SQLite.
82
+ */
83
+ onAssistantMessageComplete: (msg: {
84
+ messageId: string;
85
+ content: string;
86
+ eventsJsonl: string;
87
+ }) => void;
88
+ /**
89
+ * Called when the bridge decides to skip persisting an empty intermediate
90
+ * message. Caller should clean up any stub row inserted at message_start.
91
+ */
92
+ onAssistantMessageSkipped?: (messageId: string) => void;
93
+ /**
94
+ * Called when pi or an extension throws asynchronously (e.g. from
95
+ * `prompt`). Caller can choose how to surface to the client. The bridge
96
+ * also emits `{type:"error"}` on the wire as a fallback.
97
+ */
98
+ onError?: (err: Error) => void;
99
+ /**
100
+ * Optional session history to rehydrate into pi's in-memory session
101
+ * before the first prompt. Populated from SQLite by the session-stream
102
+ * manager when attaching to a previously-created session (so the LLM
103
+ * sees the full conversation transcript from the beginning). Omitted for
104
+ * brand-new sessions (no history) and for tests that don't need it.
105
+ */
106
+ history?: WireMessage[];
107
+ /**
108
+ * Optional persisted observational-memory snapshot restored after message
109
+ * history rehydration so the next prompt still sees compacted memory after
110
+ * reconnect/server restart.
111
+ */
112
+ memorySnapshot?: SessionMemorySnapshot | null;
113
+ /**
114
+ * Test seam — override the model whitelist fetch. Production code never
115
+ * sets this; tests inject a stub returning a synthetic list so `start()`
116
+ * can run without a live backend.
117
+ */
118
+ fetchAllowedModels?: FetchAllowedModelsFn;
119
+ }
120
+ export declare class AgentBridge {
121
+ private session?;
122
+ private sessionManager?;
123
+ private unsubscribe?;
124
+ private pending?;
125
+ private disposed;
126
+ private readonly opts;
127
+ /**
128
+ * Pi's model registry. Built lazily in `start()` so we can resolve a
129
+ * `modelId` (envelope-supplied or SQLite-persisted) to a concrete `Model`
130
+ * via `registry.getAll().find(m => m.id === modelId)` before invoking
131
+ * `session.setModel()`. Phase 3 (Available Models whitelist).
132
+ */
133
+ private modelRegistry?;
134
+ /**
135
+ * Raw allowed models list from the backend, preserved in sortOrder.
136
+ * Used by `getFirstAvailableModelId()` to return the backend-curated
137
+ * top pick when no explicit model selection is made.
138
+ */
139
+ private allowedModels?;
140
+ /**
141
+ * Last `modelId` we successfully applied via `session.setModel()`, or
142
+ * `undefined` if we never applied one (pi falls back to its own settings
143
+ * file in that case, matching pre-Phase-3 behaviour). Tracked so repeated
144
+ * envelopes carrying the same modelId don't churn pi's internal state.
145
+ */
146
+ private lastAppliedModelId?;
147
+ /** Current model's credit rates (from availableBaseModels), used for token_usage. */
148
+ private activeCreditRates;
149
+ private readonly memoryRuntime;
150
+ private memoryPhase;
151
+ constructor(opts: AgentBridgeOptions);
152
+ /**
153
+ * Create the pi session, wire up subscription, and return.
154
+ * Throws on creation failure (caller should surface to client).
155
+ */
156
+ start(): Promise<void>;
157
+ private proxyProviderForAllowedModel;
158
+ private refreshAllowedModels;
159
+ /**
160
+ * Register one synthetic provider per upstream API shape. Anthropic models
161
+ * go to `${backendUrl}/v1/messages` (Messages API); everything else (OpenAI,
162
+ * Google, Cerebras, etc.) goes to `${backendUrl}/v1/chat/completions`
163
+ * (OpenAI-compatible API). The backend supports both endpoints natively
164
+ * (verified in F1).
165
+ *
166
+ * Pi will send `Authorization: Bearer ${apiKey}` (because `authHeader: true`)
167
+ * which carries the machine JWT — the only credential the backend trusts.
168
+ *
169
+ * The `id` we register is the raw `modelId` (e.g. `claude-3-5-haiku-latest`),
170
+ * which is exactly what the backend expects in `body.model`.
171
+ */
172
+ private registerSyntheticProviders;
173
+ /**
174
+ * Apply a sticky model selection to the underlying pi session, if it
175
+ * differs from what was last applied. No-ops when:
176
+ * - `modelId` is null/undefined (caller passed nothing to apply)
177
+ * - the same modelId was already applied to this session
178
+ * - the registry can't resolve the modelId (emits an `error` wire event
179
+ * so the client surfaces the failure, but does NOT throw — the caller
180
+ * is expected to drop the prompt)
181
+ *
182
+ * Returns true when the requested model is now in effect (either because
183
+ * we just applied it or because it was already applied). Returns false
184
+ * on resolution failure so the caller can skip `prompt()` and avoid
185
+ * driving pi against the wrong model.
186
+ *
187
+ * Phase 3 (Available Models whitelist).
188
+ */
189
+ /**
190
+ * Return the modelId of the first available model from the backend
191
+ * whitelist (preserving the backend's sortOrder, which is the same
192
+ * ordering the frontend uses in its model picker). Returns `undefined`
193
+ * when no models are available (e.g. backend unreachable at startup).
194
+ *
195
+ * Used by `SessionStreamManager.prompt()` as a defense-in-depth
196
+ * default when neither the envelope nor SQLite supply a modelId.
197
+ */
198
+ getFirstAvailableModelId(): string | undefined;
199
+ /**
200
+ * Return current session context usage from pi's built-in estimator.
201
+ * Used after compaction and session start to push updated context-window
202
+ * stats to the frontend without waiting for the next assistant turn.
203
+ */
204
+ getContextUsage(): {
205
+ tokens: number | null;
206
+ contextWindow: number;
207
+ percent: number | null;
208
+ } | undefined;
209
+ getSessionBranch(): Array<{
210
+ type: string;
211
+ id: string;
212
+ timestamp?: string;
213
+ message?: unknown;
214
+ content?: unknown;
215
+ customType?: string;
216
+ summary?: unknown;
217
+ fromId?: string;
218
+ data?: unknown;
219
+ details?: unknown;
220
+ firstKeptEntryId?: string;
221
+ }>;
222
+ getMemoryActivity(): {
223
+ phase: "idle" | "observing" | "compacting" | "reflecting" | "pruning";
224
+ inFlight: {
225
+ observer: boolean;
226
+ compaction: boolean;
227
+ reflection: boolean;
228
+ pruner: boolean;
229
+ };
230
+ };
231
+ private updateMemoryPhase;
232
+ setModel(modelId: string | null | undefined): Promise<boolean>;
233
+ /**
234
+ * Map a frontend reasoning-effort string to pi's ThinkingLevel.
235
+ * Frontend sends: xhigh | high | medium | low | minimal | none | undefined
236
+ * Pi expects: "high" | "medium" | "low" | "minimal" | "off"
237
+ *
238
+ * Mapping:
239
+ * xhigh → high (pi doesn't have xhigh, default to max)
240
+ * high → high
241
+ * medium → medium
242
+ * low → low
243
+ * minimal → minimal
244
+ * none → off
245
+ * undefined → no-op (pi keeps whatever it has currently)
246
+ */
247
+ private mapReasoningEffortToThinkingLevel;
248
+ /**
249
+ * Set the reasoning/thinking effort level for the next prompt.
250
+ * Pass `undefined` to leave pi's current level unchanged.
251
+ *
252
+ * The caller (SessionStreamManager) is responsible for persisting the
253
+ * value to SQLite; this method only applies it to pi's in-memory session.
254
+ */
255
+ setReasoningEffort(effort: string | undefined): void;
256
+ /**
257
+ * Forward a user message to pi. Resolves when the full turn ends.
258
+ * The caller is responsible for persisting the user message to SQLite
259
+ * BEFORE invoking this — we don't do it here because pi's `prompt` may
260
+ * fail and we still want the user message recorded.
261
+ *
262
+ * When `images` is non-empty, each base64-encoded attachment is converted
263
+ * to a pi `ImageContent` block and passed as `options.images` to
264
+ * `session.prompt()`. If the current model does not support image inputs,
265
+ * images are instead converted to text placeholders so the conversation
266
+ * can continue without errors.
267
+ */
268
+ prompt(text: string, images?: ImageAttachment[]): Promise<void>;
269
+ /**
270
+ * Manually compact the session context via pi's built-in compaction.
271
+ * Pi generates a summary of older conversation history, preserving the
272
+ * most recent ~20K tokens verbatim. Compaction events are forwarded to
273
+ * the wire through `handleEvent()`.
274
+ *
275
+ * `customInstructions` can inject guidance into the compaction prompt
276
+ * so the summary captures information relevant to the current task.
277
+ */
278
+ compact(customInstructions?: string): Promise<void>;
279
+ dispose(): void;
280
+ /**
281
+ * Emit a wire event AND record it in the pending message's audit log so
282
+ * the persisted JSONL exactly matches the live broadcast. Use this in
283
+ * place of `this.opts.emit` for any event that should appear in
284
+ * `events_jsonl` for the current assistant message.
285
+ */
286
+ private emitAndBuffer;
287
+ /**
288
+ * Finalize the current `pending` assistant message: persist its assembled
289
+ * content + wire events (including any tool_call / tool_result events that
290
+ * arrived after `message_end`) to SQLite via `onAssistantMessageComplete`.
291
+ *
292
+ * Idempotent: marks the pending as `finalized` on first call; subsequent
293
+ * calls are no-ops (guards against double-persisting when both
294
+ * `message_start` and `agent_end` would otherwise finalize the same pending).
295
+ *
296
+ * Skips empty framing-only messages (messages with no text, thinking, or
297
+ * tool events that contribute nothing the client can render).
298
+ */
299
+ private finalizePendingMessage;
300
+ /**
301
+ * Subscriber callback. Public so tests can drive event flow without
302
+ * spinning up a real pi session — production code never calls this
303
+ * directly; pi's `subscribe()` does, via the closure registered in
304
+ * `start()`.
305
+ */
306
+ handleEvent(ev: AgentSessionEvent): void;
307
+ }
308
+ //# sourceMappingURL=agent-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-bridge.d.ts","sourceRoot":"","sources":["../../src/server/agent-bridge.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Typed errors thrown by REST handlers.
3
+ *
4
+ * Each error carries a stable `code` that the relay envelope dispatcher
5
+ * (Batch 3) maps to a wire-level status. Until then, the handlers throw
6
+ * and the relay loop just acks — Batch 3 will catch and translate.
7
+ *
8
+ * Why typed errors instead of returning `{ ok: false, code }` discriminated
9
+ * unions? Two reasons:
10
+ * - The handlers are also called directly from unit tests; `throw` lets
11
+ * tests use `expect(...).rejects.toThrow(NotFoundError)` ergonomically.
12
+ * - The Batch 3 dispatcher needs a single `try/catch` boundary; a sum
13
+ * type per handler would force every handler to return its own variant.
14
+ */
15
+ export type HandlerErrorCode = "BAD_REQUEST" | "NOT_FOUND";
16
+ export declare class HandlerError extends Error {
17
+ readonly code: HandlerErrorCode;
18
+ constructor(code: HandlerErrorCode, message: string);
19
+ }
20
+ export declare class BadRequestError extends HandlerError {
21
+ constructor(message: string);
22
+ }
23
+ export declare class NotFoundError extends HandlerError {
24
+ constructor(message: string);
25
+ }
26
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,WAAW,CAAC;AAE3D,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;gBACpB,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM;CAKpD;AAED,qBAAa,eAAgB,SAAQ,YAAY;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,aAAc,SAAQ,YAAY;gBACjC,OAAO,EAAE,MAAM;CAI5B"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Filesystem autocomplete for project path creation.
3
+ *
4
+ * When a user types a partial path in the New Project form, the browser
5
+ * sends `GET /api/paths/autocomplete?prefix=<partial>`. This handler
6
+ * expands the prefix (tilde → $HOME, relative → absolute), lists the
7
+ * containing directory, and returns up to 10 directory suggestions whose
8
+ * basenames start with the typed partial segment.
9
+ *
10
+ * Two strategies:
11
+ * 1. If the expanded prefix exists on disk as a directory — show its
12
+ * immediate children (trailing separator is implicit). This is the
13
+ * natural behaviour when the user has already typed a real directory
14
+ * and wants to drill deeper.
15
+ * 2. Otherwise — split into parent + basename prefix and do a
16
+ * starts-with match so the user can filter siblings while typing.
17
+ *
18
+ * Dotfiles are excluded — they are rarely intentional project roots.
19
+ * Symlinks to directories ARE included (readdirSync with withFileTypes
20
+ * returns true for both real dirs and symlink dirs).
21
+ *
22
+ * Thread-safety: synchronous, called from the relay-dispatcher hot path.
23
+ * fs ops block the event loop for microseconds on local SSDs; the form
24
+ * is typed by a single human, so this is perfectly fine.
25
+ */
26
+ export interface PathAutocompleteResult {
27
+ suggestions: string[];
28
+ expandedPrefix: string;
29
+ }
30
+ /**
31
+ * List directory suggestions for the given path prefix.
32
+ *
33
+ * Examples (assume $HOME=/Users/alice, dirs are `projects`, `proj-old`,
34
+ * `Documents`, `.config`):
35
+ * prefix="~" → expanded="/Users/alice" (exists as dir)
36
+ * → children of /Users/alice/ ["projects","proj-old","Documents"]
37
+ * prefix="~/pro" → expanded="/Users/alice/pro" (does NOT exist)
38
+ * → starts-with "pro" in /Users/alice/ ["projects","proj-old"]
39
+ * prefix="~/projects/" → expanded="/Users/alice/projects/" (exists as dir)
40
+ * → children of /Users/alice/projects/
41
+ * prefix="~/projects/sr" → expanded="/Users/alice/projects/sr" (does NOT exist)
42
+ * → starts-with "sr" in /Users/alice/projects/
43
+ */
44
+ export declare function handlePathAutocomplete(prefix: string): PathAutocompleteResult;
45
+ //# sourceMappingURL=paths-autocomplete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths-autocomplete.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/paths-autocomplete.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAMH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB;AAgCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB,CA+B7E"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Pure REST handlers for `/api/projects/*`.
3
+ *
4
+ * Extracted from the deleted Hono `routes.ts` so the relay envelope dispatcher
5
+ * (Batch 3) can call them with a parsed payload instead of a Hono context.
6
+ *
7
+ * Contract:
8
+ * - Inputs are already-parsed JSON objects (or `unknown` shapes the handler
9
+ * validates). The dispatcher upstream parses the relay envelope body.
10
+ * - Outputs are the wire shapes the landing client already expects, so the
11
+ * Batch 3 dispatcher can JSON-stringify them straight into the response
12
+ * envelope without remapping.
13
+ * - Errors are thrown as typed `HandlerError` subclasses; the dispatcher
14
+ * maps `BAD_REQUEST` → 400-equivalent and `NOT_FOUND` → 404-equivalent.
15
+ * - Stream teardown on project delete is the caller's responsibility — the
16
+ * handler returns the cascaded session ids so the dispatcher can hand
17
+ * them to `SessionStreamManager.disposeProjectStreams` BEFORE the SQL
18
+ * cascade has already torn down (in our model the cascade has already
19
+ * happened by the time we return; that's intentional and matches the
20
+ * old route's ordering — the manager is best-effort cleanup).
21
+ */
22
+ import type { SessionStore } from "../storage.js";
23
+ import type { WireProject, WireSessionSummary } from "../wire.js";
24
+ export interface CreateProjectInputRaw {
25
+ name?: unknown;
26
+ path?: unknown;
27
+ }
28
+ export interface UpdateProjectInputRaw {
29
+ name?: unknown;
30
+ path?: unknown;
31
+ }
32
+ export declare function handleListProjects(store: SessionStore): WireProject[];
33
+ export declare function handleCreateProject(store: SessionStore, body: CreateProjectInputRaw): WireProject;
34
+ export declare function handleGetProject(store: SessionStore, id: string): WireProject;
35
+ export declare function handleUpdateProject(store: SessionStore, id: string, body: UpdateProjectInputRaw): WireProject;
36
+ export interface DeleteProjectResult {
37
+ /** Session ids that belonged to the project (cascade-deleted). */
38
+ sessionIds: string[];
39
+ }
40
+ export declare function handleDeleteProject(store: SessionStore, id: string): DeleteProjectResult;
41
+ export interface BindStudioInputRaw {
42
+ studioProjectId?: unknown;
43
+ studioTeamId?: unknown;
44
+ studioProjectName?: unknown;
45
+ }
46
+ export interface BindStudioResult {
47
+ project: WireProject;
48
+ studioProjectId: string;
49
+ studioProjectName: string;
50
+ studioTeamId?: string;
51
+ }
52
+ /**
53
+ * Bind a local project directory to an Aexol Studio project by writing
54
+ * `.aexol/aexol.jsonc` into the project's filesystem path.
55
+ */
56
+ export declare function handleBindStudioProject(store: SessionStore, id: string, body: BindStudioInputRaw): Promise<BindStudioResult>;
57
+ export declare function handleListSessionsByProject(store: SessionStore, id: string): WireSessionSummary[];
58
+ //# sourceMappingURL=projects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/projects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIlE,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW,EAAE,CAErE;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,qBAAqB,GAC1B,WAAW,CAYb;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,CAI7E;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,qBAAqB,GAC1B,WAAW,CAwBb;AAED,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,MAAM,GACT,mBAAmB,CAMrB;AAED,MAAM,WAAW,kBAAkB;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,WAAW,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,gBAAgB,CAAC,CAoC3B;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,MAAM,GACT,kBAAkB,EAAE,CAItB"}