@mohanscodex/spectra-code 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/src/agents/definitions.d.ts +2 -2
  3. package/dist/src/agents/definitions.d.ts.map +1 -1
  4. package/dist/src/agents/definitions.js +18 -18
  5. package/dist/src/agents/definitions.js.map +1 -1
  6. package/dist/src/agents/registry.d.ts +1 -1
  7. package/dist/src/agents/registry.d.ts.map +1 -1
  8. package/dist/src/agents/registry.js.map +1 -1
  9. package/dist/src/cli.js +117 -115
  10. package/dist/src/cli.js.map +1 -1
  11. package/dist/src/commands/agent.d.ts +1 -1
  12. package/dist/src/commands/agent.d.ts.map +1 -1
  13. package/dist/src/commands/agent.js +14 -14
  14. package/dist/src/commands/agent.js.map +1 -1
  15. package/dist/src/commands/db.d.ts +1 -1
  16. package/dist/src/commands/db.d.ts.map +1 -1
  17. package/dist/src/commands/db.js +11 -11
  18. package/dist/src/commands/db.js.map +1 -1
  19. package/dist/src/commands/doctor.d.ts.map +1 -1
  20. package/dist/src/commands/doctor.js +33 -30
  21. package/dist/src/commands/doctor.js.map +1 -1
  22. package/dist/src/commands/mcp.d.ts +1 -1
  23. package/dist/src/commands/mcp.d.ts.map +1 -1
  24. package/dist/src/commands/mcp.js +39 -39
  25. package/dist/src/commands/mcp.js.map +1 -1
  26. package/dist/src/commands/plugin.d.ts +1 -1
  27. package/dist/src/commands/plugin.d.ts.map +1 -1
  28. package/dist/src/commands/plugin.js +13 -13
  29. package/dist/src/commands/plugin.js.map +1 -1
  30. package/dist/src/commands/session.d.ts +1 -1
  31. package/dist/src/commands/session.d.ts.map +1 -1
  32. package/dist/src/commands/session.js +12 -12
  33. package/dist/src/commands/session.js.map +1 -1
  34. package/dist/src/index.d.ts +18 -18
  35. package/dist/src/index.d.ts.map +1 -1
  36. package/dist/src/index.js +16 -16
  37. package/dist/src/index.js.map +1 -1
  38. package/dist/src/integrations/acp/index.d.ts +1 -1
  39. package/dist/src/integrations/acp/index.js +1 -1
  40. package/dist/src/integrations/acp/server.d.ts.map +1 -1
  41. package/dist/src/integrations/acp/server.js +89 -79
  42. package/dist/src/integrations/acp/server.js.map +1 -1
  43. package/dist/src/integrations/custom-tools/index.d.ts +2 -2
  44. package/dist/src/integrations/custom-tools/index.js +1 -1
  45. package/dist/src/integrations/custom-tools/loader.d.ts +2 -2
  46. package/dist/src/integrations/custom-tools/loader.d.ts.map +1 -1
  47. package/dist/src/integrations/custom-tools/loader.js +19 -18
  48. package/dist/src/integrations/custom-tools/loader.js.map +1 -1
  49. package/dist/src/integrations/mcp/client.d.ts +5 -5
  50. package/dist/src/integrations/mcp/client.d.ts.map +1 -1
  51. package/dist/src/integrations/mcp/client.js +7 -7
  52. package/dist/src/integrations/mcp/client.js.map +1 -1
  53. package/dist/src/integrations/mcp/index.d.ts +2 -2
  54. package/dist/src/integrations/mcp/index.d.ts.map +1 -1
  55. package/dist/src/integrations/mcp/index.js +1 -1
  56. package/dist/src/integrations/mcp/index.js.map +1 -1
  57. package/dist/src/security/doom-loop.d.ts +1 -1
  58. package/dist/src/security/doom-loop.d.ts.map +1 -1
  59. package/dist/src/security/doom-loop.js +4 -4
  60. package/dist/src/security/doom-loop.js.map +1 -1
  61. package/dist/src/security/index.d.ts +10 -10
  62. package/dist/src/security/index.d.ts.map +1 -1
  63. package/dist/src/security/index.js +116 -69
  64. package/dist/src/security/index.js.map +1 -1
  65. package/dist/src/security/path-safety.d.ts +1 -1
  66. package/dist/src/security/path-safety.d.ts.map +1 -1
  67. package/dist/src/security/path-safety.js +19 -19
  68. package/dist/src/security/path-safety.js.map +1 -1
  69. package/dist/src/security/permissions.d.ts +1 -1
  70. package/dist/src/security/permissions.d.ts.map +1 -1
  71. package/dist/src/security/permissions.js +12 -10
  72. package/dist/src/security/permissions.js.map +1 -1
  73. package/dist/src/security/read-tracker.d.ts +2 -2
  74. package/dist/src/security/read-tracker.d.ts.map +1 -1
  75. package/dist/src/security/read-tracker.js +15 -13
  76. package/dist/src/security/read-tracker.js.map +1 -1
  77. package/dist/src/security/ssrf-guard.d.ts +1 -1
  78. package/dist/src/security/ssrf-guard.d.ts.map +1 -1
  79. package/dist/src/security/ssrf-guard.js +11 -11
  80. package/dist/src/security/ssrf-guard.js.map +1 -1
  81. package/dist/src/security/types.d.ts +4 -4
  82. package/dist/src/security/types.d.ts.map +1 -1
  83. package/dist/src/security/wildcard.d.ts.map +1 -1
  84. package/dist/src/security/wildcard.js +14 -16
  85. package/dist/src/security/wildcard.js.map +1 -1
  86. package/dist/src/services/auth-store.d.ts +3 -3
  87. package/dist/src/services/auth-store.d.ts.map +1 -1
  88. package/dist/src/services/auth-store.js +7 -7
  89. package/dist/src/services/auth-store.js.map +1 -1
  90. package/dist/src/services/config.d.ts +3 -3
  91. package/dist/src/services/config.d.ts.map +1 -1
  92. package/dist/src/services/config.js +17 -21
  93. package/dist/src/services/config.js.map +1 -1
  94. package/dist/src/services/context.d.ts.map +1 -1
  95. package/dist/src/services/context.js +5 -8
  96. package/dist/src/services/context.js.map +1 -1
  97. package/dist/src/services/custom-providers.d.ts +2 -2
  98. package/dist/src/services/custom-providers.d.ts.map +1 -1
  99. package/dist/src/services/custom-providers.js +108 -49
  100. package/dist/src/services/custom-providers.js.map +1 -1
  101. package/dist/src/services/session-store.d.ts +1 -1
  102. package/dist/src/services/session-store.d.ts.map +1 -1
  103. package/dist/src/services/session-store.js +32 -24
  104. package/dist/src/services/session-store.js.map +1 -1
  105. package/dist/src/services/snapshot-manager.d.ts.map +1 -1
  106. package/dist/src/services/snapshot-manager.js +14 -15
  107. package/dist/src/services/snapshot-manager.js.map +1 -1
  108. package/dist/src/tools/edit.d.ts +1 -1
  109. package/dist/src/tools/edit.js +18 -16
  110. package/dist/src/tools/edit.js.map +1 -1
  111. package/dist/src/tools/glob.d.ts +1 -1
  112. package/dist/src/tools/glob.d.ts.map +1 -1
  113. package/dist/src/tools/glob.js +20 -16
  114. package/dist/src/tools/glob.js.map +1 -1
  115. package/dist/src/tools/grep.d.ts +1 -1
  116. package/dist/src/tools/grep.d.ts.map +1 -1
  117. package/dist/src/tools/grep.js +18 -18
  118. package/dist/src/tools/grep.js.map +1 -1
  119. package/dist/src/tools/index.d.ts +4 -4
  120. package/dist/src/tools/index.d.ts.map +1 -1
  121. package/dist/src/tools/index.js +40 -32
  122. package/dist/src/tools/index.js.map +1 -1
  123. package/dist/src/tools/mcp-tool.d.ts +2 -2
  124. package/dist/src/tools/mcp-tool.d.ts.map +1 -1
  125. package/dist/src/tools/mcp-tool.js +28 -25
  126. package/dist/src/tools/mcp-tool.js.map +1 -1
  127. package/dist/src/tools/read.d.ts +1 -1
  128. package/dist/src/tools/read.d.ts.map +1 -1
  129. package/dist/src/tools/read.js +15 -13
  130. package/dist/src/tools/read.js.map +1 -1
  131. package/dist/src/tools/shell.d.ts +1 -1
  132. package/dist/src/tools/shell.d.ts.map +1 -1
  133. package/dist/src/tools/shell.js +71 -62
  134. package/dist/src/tools/shell.js.map +1 -1
  135. package/dist/src/tools/task.d.ts +1 -1
  136. package/dist/src/tools/task.js +22 -22
  137. package/dist/src/tools/task.js.map +1 -1
  138. package/dist/src/tools/types.d.ts +3 -3
  139. package/dist/src/tools/types.d.ts.map +1 -1
  140. package/dist/src/tools/utils.d.ts +1 -1
  141. package/dist/src/tools/utils.js +2 -2
  142. package/dist/src/tools/utils.js.map +1 -1
  143. package/dist/src/tools/web-fetch.d.ts +1 -1
  144. package/dist/src/tools/web-fetch.js +31 -31
  145. package/dist/src/tools/web-fetch.js.map +1 -1
  146. package/dist/src/tools/write.d.ts +1 -1
  147. package/dist/src/tools/write.js +9 -9
  148. package/dist/src/tools/write.js.map +1 -1
  149. package/dist/src/tui/app-constants.d.ts.map +1 -1
  150. package/dist/src/tui/app-constants.js +11 -2
  151. package/dist/src/tui/app-constants.js.map +1 -1
  152. package/dist/src/tui/app.d.ts +1 -1
  153. package/dist/src/tui/app.d.ts.map +1 -1
  154. package/dist/src/tui/app.js +293 -121
  155. package/dist/src/tui/app.js.map +1 -1
  156. package/dist/src/tui/commands.d.ts +14 -14
  157. package/dist/src/tui/commands.d.ts.map +1 -1
  158. package/dist/src/tui/commands.js +242 -49
  159. package/dist/src/tui/commands.js.map +1 -1
  160. package/dist/src/tui/components/chat-area.d.ts +2 -2
  161. package/dist/src/tui/components/chat-area.d.ts.map +1 -1
  162. package/dist/src/tui/components/chat-area.js +5 -5
  163. package/dist/src/tui/components/chat-area.js.map +1 -1
  164. package/dist/src/tui/components/command-palette.d.ts.map +1 -1
  165. package/dist/src/tui/components/command-palette.js +7 -5
  166. package/dist/src/tui/components/command-palette.js.map +1 -1
  167. package/dist/src/tui/components/message.d.ts +2 -2
  168. package/dist/src/tui/components/message.d.ts.map +1 -1
  169. package/dist/src/tui/components/message.js +63 -50
  170. package/dist/src/tui/components/message.js.map +1 -1
  171. package/dist/src/tui/components/slash-autocomplete.d.ts +2 -2
  172. package/dist/src/tui/components/slash-autocomplete.d.ts.map +1 -1
  173. package/dist/src/tui/components/slash-autocomplete.js +6 -8
  174. package/dist/src/tui/components/slash-autocomplete.js.map +1 -1
  175. package/dist/src/tui/components/toast.d.ts +2 -2
  176. package/dist/src/tui/components/toast.d.ts.map +1 -1
  177. package/dist/src/tui/components/toast.js +10 -5
  178. package/dist/src/tui/components/toast.js.map +1 -1
  179. package/dist/src/tui/hooks/use-agent.d.ts +3 -3
  180. package/dist/src/tui/hooks/use-agent.d.ts.map +1 -1
  181. package/dist/src/tui/hooks/use-agent.js +22 -29
  182. package/dist/src/tui/hooks/use-agent.js.map +1 -1
  183. package/dist/src/tui/hooks/use-app-keyboard.d.ts +3 -3
  184. package/dist/src/tui/hooks/use-app-keyboard.d.ts.map +1 -1
  185. package/dist/src/tui/hooks/use-app-keyboard.js +28 -29
  186. package/dist/src/tui/hooks/use-app-keyboard.js.map +1 -1
  187. package/dist/src/tui/hooks/use-chat-submit.d.ts +6 -6
  188. package/dist/src/tui/hooks/use-chat-submit.d.ts.map +1 -1
  189. package/dist/src/tui/hooks/use-chat-submit.js +115 -54
  190. package/dist/src/tui/hooks/use-chat-submit.js.map +1 -1
  191. package/dist/src/tui/hooks/use-permission-queue.d.ts +2 -2
  192. package/dist/src/tui/hooks/use-permission-queue.d.ts.map +1 -1
  193. package/dist/src/tui/hooks/use-permission-queue.js +1 -1
  194. package/dist/src/tui/hooks/use-permission-queue.js.map +1 -1
  195. package/dist/src/tui/hooks/use-revert.d.ts +4 -4
  196. package/dist/src/tui/hooks/use-revert.d.ts.map +1 -1
  197. package/dist/src/tui/hooks/use-revert.js +22 -13
  198. package/dist/src/tui/hooks/use-revert.js.map +1 -1
  199. package/dist/src/tui/index.d.ts.map +1 -1
  200. package/dist/src/tui/index.js +11 -11
  201. package/dist/src/tui/index.js.map +1 -1
  202. package/dist/src/tui/prompt-bar.d.ts +1 -1
  203. package/dist/src/tui/prompt-bar.d.ts.map +1 -1
  204. package/dist/src/tui/prompt-bar.js +14 -11
  205. package/dist/src/tui/prompt-bar.js.map +1 -1
  206. package/dist/src/tui/slash-commands.d.ts +2 -2
  207. package/dist/src/tui/slash-commands.d.ts.map +1 -1
  208. package/dist/src/tui/slash-commands.js +9 -9
  209. package/dist/src/tui/slash-commands.js.map +1 -1
  210. package/dist/src/tui/theme.d.ts +1 -1
  211. package/dist/src/tui/theme.d.ts.map +1 -1
  212. package/dist/src/tui/theme.js +46 -38
  213. package/dist/src/tui/theme.js.map +1 -1
  214. package/dist/src/tui/tips.d.ts.map +1 -1
  215. package/dist/src/tui/tips.js +14 -14
  216. package/dist/src/tui/tips.js.map +1 -1
  217. package/dist/src/tui/types.d.ts +5 -5
  218. package/dist/src/tui/types.d.ts.map +1 -1
  219. package/dist/src/tui/ui/about-dialog.d.ts.map +1 -1
  220. package/dist/src/tui/ui/about-dialog.js +5 -5
  221. package/dist/src/tui/ui/about-dialog.js.map +1 -1
  222. package/dist/src/tui/ui/agent-switcher.d.ts.map +1 -1
  223. package/dist/src/tui/ui/agent-switcher.js +16 -14
  224. package/dist/src/tui/ui/agent-switcher.js.map +1 -1
  225. package/dist/src/tui/ui/debug-dialog.d.ts +1 -1
  226. package/dist/src/tui/ui/debug-dialog.d.ts.map +1 -1
  227. package/dist/src/tui/ui/debug-dialog.js +26 -26
  228. package/dist/src/tui/ui/debug-dialog.js.map +1 -1
  229. package/dist/src/tui/ui/doctor-dialog.d.ts +2 -2
  230. package/dist/src/tui/ui/doctor-dialog.d.ts.map +1 -1
  231. package/dist/src/tui/ui/doctor-dialog.js +10 -8
  232. package/dist/src/tui/ui/doctor-dialog.js.map +1 -1
  233. package/dist/src/tui/ui/manage-providers-dialog.d.ts +1 -1
  234. package/dist/src/tui/ui/manage-providers-dialog.d.ts.map +1 -1
  235. package/dist/src/tui/ui/manage-providers-dialog.js +102 -86
  236. package/dist/src/tui/ui/manage-providers-dialog.js.map +1 -1
  237. package/dist/src/tui/ui/mcp-toggle-dialog.d.ts.map +1 -1
  238. package/dist/src/tui/ui/mcp-toggle-dialog.js +17 -14
  239. package/dist/src/tui/ui/mcp-toggle-dialog.js.map +1 -1
  240. package/dist/src/tui/ui/message-controls.d.ts +1 -1
  241. package/dist/src/tui/ui/message-controls.d.ts.map +1 -1
  242. package/dist/src/tui/ui/message-controls.js +40 -28
  243. package/dist/src/tui/ui/message-controls.js.map +1 -1
  244. package/dist/src/tui/ui/model-switcher.d.ts.map +1 -1
  245. package/dist/src/tui/ui/model-switcher.js +40 -25
  246. package/dist/src/tui/ui/model-switcher.js.map +1 -1
  247. package/dist/src/tui/ui/permission-dialog.d.ts +1 -1
  248. package/dist/src/tui/ui/permission-dialog.d.ts.map +1 -1
  249. package/dist/src/tui/ui/permission-dialog.js +11 -11
  250. package/dist/src/tui/ui/permission-dialog.js.map +1 -1
  251. package/dist/src/tui/ui/provider-dialog.d.ts.map +1 -1
  252. package/dist/src/tui/ui/provider-dialog.js +75 -64
  253. package/dist/src/tui/ui/provider-dialog.js.map +1 -1
  254. package/dist/src/tui/ui/session-list.d.ts +3 -3
  255. package/dist/src/tui/ui/session-list.d.ts.map +1 -1
  256. package/dist/src/tui/ui/session-list.js +44 -32
  257. package/dist/src/tui/ui/session-list.js.map +1 -1
  258. package/dist/src/tui/ui/thinking-effort-dialog.d.ts.map +1 -1
  259. package/dist/src/tui/ui/thinking-effort-dialog.js +19 -19
  260. package/dist/src/tui/ui/thinking-effort-dialog.js.map +1 -1
  261. package/dist/src/tui/utils/model-config.d.ts.map +1 -1
  262. package/dist/src/tui/utils/model-config.js +13 -13
  263. package/dist/src/tui/utils/model-config.js.map +1 -1
  264. package/dist/src/tui/utils/session-messages.d.ts +2 -2
  265. package/dist/src/tui/utils/session-messages.d.ts.map +1 -1
  266. package/dist/src/tui/utils/session-messages.js +35 -22
  267. package/dist/src/tui/utils/session-messages.js.map +1 -1
  268. package/dist/src/tui/utils/version.d.ts.map +1 -1
  269. package/dist/src/tui/utils/version.js +7 -7
  270. package/dist/src/tui/utils/version.js.map +1 -1
  271. package/dist/src/tui/utils.d.ts +2 -2
  272. package/dist/src/tui/utils.d.ts.map +1 -1
  273. package/dist/src/tui/utils.js +7 -7
  274. package/dist/src/tui/utils.js.map +1 -1
  275. package/dist/src/tui/variant-cycle.d.ts.map +1 -1
  276. package/dist/src/tui/variant-cycle.js +23 -23
  277. package/dist/src/tui/variant-cycle.js.map +1 -1
  278. package/dist/src/utils/paths.d.ts.map +1 -1
  279. package/dist/src/utils/paths.js +25 -25
  280. package/dist/src/utils/paths.js.map +1 -1
  281. package/dist/src/utils/platform.d.ts.map +1 -1
  282. package/dist/src/utils/platform.js +15 -17
  283. package/dist/src/utils/platform.js.map +1 -1
  284. package/package.json +3 -3
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohanscodex/spectra-code",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "type": "module",
5
5
  "description": "Spectra Code — TUI coding agent with CLI commands, tools, and LLM integration",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
- import type { AgentTool } from "@mohanscodex/spectra-agent";
1
+ import type { AgentTool } from '@mohanscodex/spectra-agent';
2
2
  export interface AgentDefinition {
3
3
  name: string;
4
- mode: "primary" | "subagent";
4
+ mode: 'primary' | 'subagent';
5
5
  description: string;
6
6
  tools: string[];
7
7
  maxTurns: number;
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/agents/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,GAAG,UAAU,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAuI7D,CAAA;AAED,eAAO,MAAM,cAAc,UAEN,CAAA;AAErB,eAAO,MAAM,SAAS,UAED,CAAA;AAErB,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAGhE;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,SAAS,EAAE,EACrB,SAAS,EAAE,MAAM,GAChB,SAAS,EAAE,CAGb"}
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/agents/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,GAAG,UAAU,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CA2I7D,CAAC;AAEF,eAAO,MAAM,cAAc,UAEP,CAAC;AAErB,eAAO,MAAM,SAAS,UAEF,CAAC;AAErB,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAGhE;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,CAGxF"}
@@ -1,9 +1,9 @@
1
1
  export const AGENT_DEFINITIONS = {
2
2
  build: {
3
- name: "build",
4
- mode: "primary",
5
- description: "Full development agent with all tools enabled. Use for implementation, editing, and running commands.",
6
- tools: ["read", "write", "edit", "bash", "glob", "grep", "web_fetch", "task"],
3
+ name: 'build',
4
+ mode: 'primary',
5
+ description: 'Full development agent with all tools enabled. Use for implementation, editing, and running commands.',
6
+ tools: ['read', 'write', 'edit', 'bash', 'glob', 'grep', 'web_fetch', 'task'],
7
7
  maxTurns: 30,
8
8
  temperature: 0,
9
9
  prompt: `## Mode: Build
@@ -35,10 +35,10 @@ You are in build mode — full development access. All tools are available.
35
35
  - Be direct and concise — no conversational filler.`,
36
36
  },
37
37
  plan: {
38
- name: "plan",
39
- mode: "primary",
40
- description: "Read-only planning and analysis. Cannot edit files or run commands. Use for designing approaches and understanding code.",
41
- tools: ["read", "glob", "grep", "web_fetch", "task"],
38
+ name: 'plan',
39
+ mode: 'primary',
40
+ description: 'Read-only planning and analysis. Cannot edit files or run commands. Use for designing approaches and understanding code.',
41
+ tools: ['read', 'glob', 'grep', 'web_fetch', 'task'],
42
42
  maxTurns: 15,
43
43
  temperature: 0,
44
44
  prompt: `## Mode: Plan
@@ -68,10 +68,10 @@ You are in plan mode — read-only analysis and design. You CANNOT edit files, w
68
68
  - Be thorough but structured. Avoid tangential exploration.`,
69
69
  },
70
70
  debug: {
71
- name: "debug",
72
- mode: "primary",
73
- description: "Investigation and debugging. Can read files and run safe commands but cannot edit. Use for diagnosing issues.",
74
- tools: ["read", "bash", "grep", "glob"],
71
+ name: 'debug',
72
+ mode: 'primary',
73
+ description: 'Investigation and debugging. Can read files and run safe commands but cannot edit. Use for diagnosing issues.',
74
+ tools: ['read', 'bash', 'grep', 'glob'],
75
75
  maxTurns: 20,
76
76
  temperature: 0,
77
77
  prompt: `## Mode: Debug
@@ -102,10 +102,10 @@ You are in debug mode — investigation and diagnosis. You can read files and ru
102
102
  - Safe diagnostic commands are allowed (reading state, running tests). Destructive commands are not.`,
103
103
  },
104
104
  explore: {
105
- name: "explore",
106
- mode: "subagent",
107
- description: "Fast, read-only codebase explorer. Use for file search, code navigation, and answering questions about the codebase.",
108
- tools: ["read", "glob", "grep", "web_fetch"],
105
+ name: 'explore',
106
+ mode: 'subagent',
107
+ description: 'Fast, read-only codebase explorer. Use for file search, code navigation, and answering questions about the codebase.',
108
+ tools: ['read', 'glob', 'grep', 'web_fetch'],
109
109
  maxTurns: 5,
110
110
  temperature: 0,
111
111
  prompt: `## Mode: Explore
@@ -132,10 +132,10 @@ You are a codebase exploration specialist — fast, thorough, read-only. Your jo
132
132
  },
133
133
  };
134
134
  export const PRIMARY_AGENTS = Object.values(AGENT_DEFINITIONS)
135
- .filter((d) => d.mode === "primary")
135
+ .filter((d) => d.mode === 'primary')
136
136
  .map((d) => d.name);
137
137
  export const SUBAGENTS = Object.values(AGENT_DEFINITIONS)
138
- .filter((d) => d.mode === "subagent")
138
+ .filter((d) => d.mode === 'subagent')
139
139
  .map((d) => d.name);
140
140
  export function getToolNamesForAgent(agentName) {
141
141
  const def = AGENT_DEFINITIONS[agentName];
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../../src/agents/definitions.ts"],"names":[],"mappings":"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M,CAAC,MAAM,CAAC,iBAAiB,CAAC;KACvD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;KACpC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAErB,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACrD,MAAM,GAAG,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,QAAqB,EAAE,SAAiB;IAC1E,MAAM,OAAO,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAChD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACzD,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Model } from "@mohanscodex/spectra-ai";
1
+ import type { Model } from '@mohanscodex/spectra-ai';
2
2
  export interface AgentRegistryConfig {
3
3
  model: Model;
4
4
  getApiKey?: (provider: string) => Promise<string | undefined> | string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/agents/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAEpD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAAA;CACnF;AAID,eAAO,MAAM,aAAa;sBACN,mBAAmB;iBAGxB,mBAAmB,GAAG,IAAI;;CAMxC,CAAA"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/agents/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,WAAW,mBAAmB;IACnC,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;CACnF;AAID,eAAO,MAAM,aAAa;sBACP,mBAAmB;iBAGxB,mBAAmB,GAAG,IAAI;;CAMvC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/agents/registry.ts"],"names":[],"mappings":"AAOA,IAAI,aAAa,GAA+B,IAAI,CAAA;AAEpD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,SAAS,CAAC,MAA2B;QACnC,aAAa,GAAG,MAAM,CAAA;IACxB,CAAC;IACD,SAAS;QACP,OAAO,aAAa,CAAA;IACtB,CAAC;IACD,KAAK;QACH,aAAa,GAAG,IAAI,CAAA;IACtB,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/agents/registry.ts"],"names":[],"mappings":"AAOA,IAAI,aAAa,GAA+B,IAAI,CAAC;AAErD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,SAAS,CAAC,MAA2B;QACpC,aAAa,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,SAAS;QACR,OAAO,aAAa,CAAC;IACtB,CAAC;IACD,KAAK;QACJ,aAAa,GAAG,IAAI,CAAC;IACtB,CAAC;CACD,CAAC"}
package/dist/src/cli.js CHANGED
@@ -1,48 +1,48 @@
1
1
  #!/usr/bin/env bun
2
- import yargs from "yargs";
3
- import { hideBin } from "yargs/helpers";
4
- import { spinner, text, confirm, select, outro, isCancel, cancel } from "@clack/prompts";
5
- import chalk from "chalk";
6
- import { SessionStore } from "./services/session-store.js";
7
- import { loadConfig, saveConfig } from "./services/config.js";
8
- import { connectServer, disconnectServer, listConnectedServers, listServerTools } from "./integrations/mcp/index.js";
2
+ import yargs from 'yargs';
3
+ import { hideBin } from 'yargs/helpers';
4
+ import { spinner, text, confirm, select, outro, isCancel, cancel } from '@clack/prompts';
5
+ import chalk from 'chalk';
6
+ import { SessionStore } from './services/session-store.js';
7
+ import { loadConfig, saveConfig } from './services/config.js';
8
+ import { connectServer, disconnectServer, listConnectedServers, listServerTools } from './integrations/mcp/index.js';
9
9
  async function main() {
10
- const pkg = await import("../package.json", { with: { type: "json" } });
10
+ const pkg = await import('../package.json', { with: { type: 'json' } });
11
11
  const version = pkg.default.version;
12
12
  const cli = yargs(hideBin(process.argv))
13
- .scriptName("spectra")
13
+ .scriptName('spectra')
14
14
  .version(version)
15
15
  .help()
16
- .alias("h", "help")
17
- .alias("v", "version")
18
- .locale("en")
16
+ .alias('h', 'help')
17
+ .alias('v', 'version')
18
+ .locale('en')
19
19
  .wrap(Math.min(100, process.stdout.columns || 100))
20
- .epilogue(chalk.dim("Spectra Code — AI coding agent in your terminal"));
20
+ .epilogue(chalk.dim('Spectra Code — AI coding agent in your terminal'));
21
21
  // Default: launch TUI
22
- cli.command("$0", false, () => { }, async () => {
23
- const { launchTui } = await import("./tui/index.js");
22
+ cli.command('$0', false, () => { }, async () => {
23
+ const { launchTui } = await import('./tui/index.js');
24
24
  await launchTui({});
25
25
  });
26
26
  // Session commands
27
- cli.command("session <action>", "Manage sessions", (y) => y
28
- .positional("action", {
29
- describe: "Action to perform",
30
- choices: ["list", "delete"],
27
+ cli.command('session <action>', 'Manage sessions', (y) => y
28
+ .positional('action', {
29
+ describe: 'Action to perform',
30
+ choices: ['list', 'delete'],
31
31
  demandOption: true,
32
32
  })
33
- .option("id", {
34
- describe: "Session ID (for delete)",
35
- type: "string",
33
+ .option('id', {
34
+ describe: 'Session ID (for delete)',
35
+ type: 'string',
36
36
  }), async (argv) => {
37
37
  const store = new SessionStore();
38
38
  const action = argv.action;
39
- if (action === "list") {
39
+ if (action === 'list') {
40
40
  const sessions = store.list();
41
41
  if (!sessions.length) {
42
- outro(chalk.yellow("No sessions found."));
42
+ outro(chalk.yellow('No sessions found.'));
43
43
  return;
44
44
  }
45
- console.log(chalk.bold("\n Sessions\n"));
45
+ console.log(chalk.bold('\n Sessions\n'));
46
46
  for (const s of sessions) {
47
47
  const date = new Date(s.updated).toLocaleString();
48
48
  console.log(` ${chalk.cyan(s.id.slice(0, 12))} ${chalk.white(s.title.slice(0, 50))} ${chalk.dim(date)}`);
@@ -51,23 +51,23 @@ async function main() {
51
51
  outro(chalk.dim(`${sessions.length} session(s)`));
52
52
  return;
53
53
  }
54
- if (action === "delete") {
54
+ if (action === 'delete') {
55
55
  const id = argv.id;
56
56
  if (!id) {
57
57
  const selected = await select({
58
- message: "Select session to delete",
58
+ message: 'Select session to delete',
59
59
  options: store.list().map((s) => ({
60
60
  value: s.id,
61
61
  label: `${s.id.slice(0, 12)} ${s.title.slice(0, 50)}`,
62
62
  })),
63
63
  });
64
64
  if (isCancel(selected)) {
65
- cancel("Cancelled.");
65
+ cancel('Cancelled.');
66
66
  process.exit(0);
67
67
  }
68
- const ok = await confirm({ message: "Are you sure?" });
68
+ const ok = await confirm({ message: 'Are you sure?' });
69
69
  if (!ok) {
70
- cancel("Cancelled.");
70
+ cancel('Cancelled.');
71
71
  process.exit(0);
72
72
  }
73
73
  store.delete(selected);
@@ -86,19 +86,19 @@ async function main() {
86
86
  }
87
87
  });
88
88
  // Agent commands
89
- cli.command("agent <action>", "Manage agents", (y) => y.positional("action", {
90
- describe: "Action to perform",
91
- choices: ["list"],
89
+ cli.command('agent <action>', 'Manage agents', (y) => y.positional('action', {
90
+ describe: 'Action to perform',
91
+ choices: ['list'],
92
92
  demandOption: true,
93
93
  }), async (argv) => {
94
- if (argv.action === "list") {
94
+ if (argv.action === 'list') {
95
95
  const agents = [
96
- { name: "build", desc: "Default agent (full tools)" },
97
- { name: "plan", desc: "Planning mode" },
98
- { name: "explore", desc: "Codebase exploration" },
99
- { name: "debug", desc: "Investigation" },
96
+ { name: 'build', desc: 'Default agent (full tools)' },
97
+ { name: 'plan', desc: 'Planning mode' },
98
+ { name: 'explore', desc: 'Codebase exploration' },
99
+ { name: 'debug', desc: 'Investigation' },
100
100
  ];
101
- console.log(chalk.bold("\n Agents\n"));
101
+ console.log(chalk.bold('\n Agents\n'));
102
102
  for (const a of agents) {
103
103
  console.log(` ${chalk.cyan(a.name.padEnd(10))} ${chalk.dim(a.desc)}`);
104
104
  }
@@ -107,26 +107,26 @@ async function main() {
107
107
  }
108
108
  });
109
109
  // Plugin commands
110
- cli.command("plugin <action>", "Manage plugins", (y) => y
111
- .positional("action", {
112
- describe: "Action to perform",
113
- choices: ["list", "install"],
110
+ cli.command('plugin <action>', 'Manage plugins', (y) => y
111
+ .positional('action', {
112
+ describe: 'Action to perform',
113
+ choices: ['list', 'install'],
114
114
  demandOption: true,
115
115
  })
116
- .option("name", {
117
- describe: "Plugin name (for install)",
118
- type: "string",
116
+ .option('name', {
117
+ describe: 'Plugin name (for install)',
118
+ type: 'string',
119
119
  }), async (argv) => {
120
- if (argv.action === "list") {
121
- outro(chalk.yellow("No plugins installed."));
120
+ if (argv.action === 'list') {
121
+ outro(chalk.yellow('No plugins installed.'));
122
122
  return;
123
123
  }
124
- if (argv.action === "install") {
124
+ if (argv.action === 'install') {
125
125
  const name = argv.name;
126
126
  if (!name) {
127
- const input = await text({ message: "Plugin name to install" });
127
+ const input = await text({ message: 'Plugin name to install' });
128
128
  if (isCancel(input)) {
129
- cancel("Cancelled.");
129
+ cancel('Cancelled.');
130
130
  process.exit(0);
131
131
  }
132
132
  outro(chalk.yellow(`Install "${input}" — not yet implemented`));
@@ -137,38 +137,38 @@ async function main() {
137
137
  }
138
138
  });
139
139
  // MCP commands
140
- cli.command("mcp <action>", "Manage MCP servers", (y) => y
141
- .positional("action", {
142
- describe: "Action to perform",
143
- choices: ["list", "add", "remove", "connect", "disconnect", "tools"],
140
+ cli.command('mcp <action>', 'Manage MCP servers', (y) => y
141
+ .positional('action', {
142
+ describe: 'Action to perform',
143
+ choices: ['list', 'add', 'remove', 'connect', 'disconnect', 'tools'],
144
144
  demandOption: true,
145
145
  })
146
- .option("name", { describe: "Server name", type: "string" })
147
- .option("url", { describe: "Remote server URL", type: "string" })
148
- .option("env", { describe: "Environment variables (KEY=VALUE, comma-separated)", type: "string" })
149
- .option("header", { describe: "HTTP headers (KEY=VALUE, comma-separated)", type: "string" })
150
- .option("command", { describe: "Command to run (for local servers)", type: "string" })
151
- .option("server", { describe: "Server name (for tools command)", type: "string" }), async (argv) => {
146
+ .option('name', { describe: 'Server name', type: 'string' })
147
+ .option('url', { describe: 'Remote server URL', type: 'string' })
148
+ .option('env', { describe: 'Environment variables (KEY=VALUE, comma-separated)', type: 'string' })
149
+ .option('header', { describe: 'HTTP headers (KEY=VALUE, comma-separated)', type: 'string' })
150
+ .option('command', { describe: 'Command to run (for local servers)', type: 'string' })
151
+ .option('server', { describe: 'Server name (for tools command)', type: 'string' }), async (argv) => {
152
152
  const action = argv.action;
153
153
  const config = loadConfig();
154
- if (action === "list") {
154
+ if (action === 'list') {
155
155
  const servers = config.mcp ?? [];
156
156
  const connected = listConnectedServers().map((s) => s.name);
157
157
  if (!servers.length) {
158
- outro(chalk.yellow("No MCP servers configured."));
158
+ outro(chalk.yellow('No MCP servers configured.'));
159
159
  console.log(chalk.dim(` Use "spectra mcp add <name> --command ..." to add one.\n`));
160
160
  return;
161
161
  }
162
- console.log(chalk.bold("\n MCP Servers\n"));
162
+ console.log(chalk.bold('\n MCP Servers\n'));
163
163
  for (const s of servers) {
164
164
  const isConnected = connected.includes(s.name);
165
165
  const statusColor = s.enabled === false ? chalk.red : isConnected ? chalk.green : chalk.yellow;
166
- const status = s.enabled === false ? "disabled" : isConnected ? "connected" : "disconnected";
166
+ const status = s.enabled === false ? 'disabled' : isConnected ? 'connected' : 'disconnected';
167
167
  const target = s.command
168
- ? `stdio: ${chalk.dim([s.command, ...(s.args ?? [])].join(" "))}`
168
+ ? `stdio: ${chalk.dim([s.command, ...(s.args ?? [])].join(' '))}`
169
169
  : s.url
170
170
  ? `http: ${chalk.dim(s.url)}`
171
- : chalk.dim("(no target)");
171
+ : chalk.dim('(no target)');
172
172
  console.log(` ${chalk.cyan(s.name)} ${statusColor(`[${status}]`)}`);
173
173
  console.log(` ${target}`);
174
174
  if (isConnected) {
@@ -181,12 +181,12 @@ async function main() {
181
181
  outro(`${servers.length} server(s) configured`);
182
182
  return;
183
183
  }
184
- if (action === "add") {
184
+ if (action === 'add') {
185
185
  let serverName = argv.name;
186
186
  if (!serverName) {
187
- const input = await text({ message: "Server name" });
187
+ const input = await text({ message: 'Server name' });
188
188
  if (isCancel(input)) {
189
- cancel("Cancelled.");
189
+ cancel('Cancelled.');
190
190
  process.exit(0);
191
191
  }
192
192
  serverName = input;
@@ -200,28 +200,30 @@ async function main() {
200
200
  let url = argv.url;
201
201
  if (!command && !url) {
202
202
  const choice = await select({
203
- message: "Server type",
203
+ message: 'Server type',
204
204
  options: [
205
- { value: "local", label: "Local (stdio)" },
206
- { value: "remote", label: "Remote (HTTP)" },
205
+ { value: 'local', label: 'Local (stdio)' },
206
+ { value: 'remote', label: 'Remote (HTTP)' },
207
207
  ],
208
208
  });
209
209
  if (isCancel(choice)) {
210
- cancel("Cancelled.");
210
+ cancel('Cancelled.');
211
211
  process.exit(0);
212
212
  }
213
- if (choice === "local") {
214
- const cmdInput = await text({ message: "Command (e.g. npx -y @modelcontextprotocol/server-filesystem /path)" });
213
+ if (choice === 'local') {
214
+ const cmdInput = await text({
215
+ message: 'Command (e.g. npx -y @modelcontextprotocol/server-filesystem /path)',
216
+ });
215
217
  if (isCancel(cmdInput)) {
216
- cancel("Cancelled.");
218
+ cancel('Cancelled.');
217
219
  process.exit(0);
218
220
  }
219
221
  command = cmdInput;
220
222
  }
221
223
  else {
222
- const urlInput = await text({ message: "Server URL" });
224
+ const urlInput = await text({ message: 'Server URL' });
223
225
  if (isCancel(urlInput)) {
224
- cancel("Cancelled.");
226
+ cancel('Cancelled.');
225
227
  process.exit(0);
226
228
  }
227
229
  url = urlInput;
@@ -232,25 +234,25 @@ async function main() {
232
234
  entry.url = url;
233
235
  if (argv.header) {
234
236
  const headers = {};
235
- argv.header.split(",").forEach((pair) => {
236
- const [key, ...rest] = pair.split("=");
237
+ argv.header.split(',').forEach((pair) => {
238
+ const [key, ...rest] = pair.split('=');
237
239
  if (key && rest.length > 0)
238
- headers[key.trim()] = rest.join("=").trim();
240
+ headers[key.trim()] = rest.join('=').trim();
239
241
  });
240
242
  entry.headers = headers;
241
243
  }
242
244
  }
243
245
  else if (command) {
244
- const parts = command.split(" ");
246
+ const parts = command.split(' ');
245
247
  entry.command = parts[0];
246
248
  entry.args = parts.slice(1);
247
249
  }
248
250
  if (argv.env) {
249
251
  const env = {};
250
- argv.env.split(",").forEach((pair) => {
251
- const [key, ...rest] = pair.split("=");
252
+ argv.env.split(',').forEach((pair) => {
253
+ const [key, ...rest] = pair.split('=');
252
254
  if (key && rest.length > 0)
253
- env[key.trim()] = rest.join("=").trim();
255
+ env[key.trim()] = rest.join('=').trim();
254
256
  });
255
257
  entry.env = env;
256
258
  }
@@ -261,12 +263,12 @@ async function main() {
261
263
  outro(chalk.green(`Added MCP server "${serverName}".`));
262
264
  return;
263
265
  }
264
- if (action === "remove") {
266
+ if (action === 'remove') {
265
267
  const name = argv.name;
266
268
  if (!name) {
267
- const input = await text({ message: "Server name to remove" });
269
+ const input = await text({ message: 'Server name to remove' });
268
270
  if (isCancel(input)) {
269
- cancel("Cancelled.");
271
+ cancel('Cancelled.');
270
272
  process.exit(0);
271
273
  }
272
274
  argv.name = input;
@@ -283,23 +285,23 @@ async function main() {
283
285
  outro(chalk.green(`Removed MCP server "${serverName}".`));
284
286
  return;
285
287
  }
286
- if (action === "connect") {
288
+ if (action === 'connect') {
287
289
  let serverName = argv.name;
288
290
  if (!serverName) {
289
291
  const servers = (config.mcp ?? []).filter((s) => s.enabled !== false);
290
292
  if (!servers.length) {
291
- outro(chalk.yellow("No servers to connect."));
293
+ outro(chalk.yellow('No servers to connect.'));
292
294
  return;
293
295
  }
294
296
  const selected = await select({
295
- message: "Select server to connect",
297
+ message: 'Select server to connect',
296
298
  options: servers.map((s) => ({
297
299
  value: s.name,
298
- label: `${s.name} (${s.command ? "stdio" : "http"})`,
300
+ label: `${s.name} (${s.command ? 'stdio' : 'http'})`,
299
301
  })),
300
302
  });
301
303
  if (isCancel(selected)) {
302
- cancel("Cancelled.");
304
+ cancel('Cancelled.');
303
305
  process.exit(0);
304
306
  }
305
307
  serverName = selected;
@@ -330,20 +332,20 @@ async function main() {
330
332
  }
331
333
  return;
332
334
  }
333
- if (action === "disconnect") {
335
+ if (action === 'disconnect') {
334
336
  let serverName = argv.name;
335
337
  if (!serverName) {
336
338
  const connected = listConnectedServers();
337
339
  if (!connected.length) {
338
- outro(chalk.yellow("No servers connected."));
340
+ outro(chalk.yellow('No servers connected.'));
339
341
  return;
340
342
  }
341
343
  const selected = await select({
342
- message: "Select server to disconnect",
344
+ message: 'Select server to disconnect',
343
345
  options: connected.map((s) => ({ value: s.name, label: s.name })),
344
346
  });
345
347
  if (isCancel(selected)) {
346
- cancel("Cancelled.");
348
+ cancel('Cancelled.');
347
349
  process.exit(0);
348
350
  }
349
351
  serverName = selected;
@@ -358,20 +360,20 @@ async function main() {
358
360
  }
359
361
  return;
360
362
  }
361
- if (action === "tools") {
363
+ if (action === 'tools') {
362
364
  let serverName = (argv.server || argv.name);
363
365
  if (!serverName) {
364
366
  const connected = listConnectedServers();
365
367
  if (!connected.length) {
366
- outro(chalk.yellow("No servers connected."));
368
+ outro(chalk.yellow('No servers connected.'));
367
369
  return;
368
370
  }
369
371
  const selected = await select({
370
- message: "Select server",
372
+ message: 'Select server',
371
373
  options: connected.map((s) => ({ value: s.name, label: `${s.name} (${s.tools.length} tools)` })),
372
374
  });
373
375
  if (isCancel(selected)) {
374
- cancel("Cancelled.");
376
+ cancel('Cancelled.');
375
377
  process.exit(0);
376
378
  }
377
379
  serverName = selected;
@@ -399,38 +401,38 @@ async function main() {
399
401
  }
400
402
  });
401
403
  // Doctor command
402
- cli.command("doctor", "Run system health check", () => { }, async () => {
403
- const { runDoctor } = await import("./commands/doctor.js");
404
+ cli.command('doctor', 'Run system health check', () => { }, async () => {
405
+ const { runDoctor } = await import('./commands/doctor.js');
404
406
  const result = await runDoctor();
405
- process.stdout.write("Spectra Code — System Health Check\n\n");
407
+ process.stdout.write('Spectra Code — System Health Check\n\n');
406
408
  for (const check of result.checks) {
407
- process.stdout.write(`${check.passed ? "" : ""} [${check.section}] ${check.name}\n`);
409
+ process.stdout.write(`${check.passed ? '' : ''} [${check.section}] ${check.name}\n`);
408
410
  process.stdout.write(` ${check.detail}\n`);
409
411
  }
410
- process.stdout.write(`\n${result.allPassed ? "✓ All checks passed." : "✗ Some checks failed — review the items above."}\n`);
412
+ process.stdout.write(`\n${result.allPassed ? '✓ All checks passed.' : '✗ Some checks failed — review the items above.'}\n`);
411
413
  process.exit(result.allPassed ? 0 : 1);
412
414
  });
413
415
  // ACP command
414
- cli.command("acp", "Run as ACP-compatible agent (Agent Client Protocol over stdio)", () => { }, async () => {
415
- const { ACPAdapter } = await import("./integrations/acp/index.js");
416
+ cli.command('acp', 'Run as ACP-compatible agent (Agent Client Protocol over stdio)', () => { }, async () => {
417
+ const { ACPAdapter } = await import('./integrations/acp/index.js');
416
418
  const adapter = new ACPAdapter();
417
419
  adapter.start();
418
420
  });
419
421
  // DB command
420
- cli.command("db <action>", "Database utilities", (y) => y.positional("action", {
421
- describe: "Action",
422
- choices: ["path"],
422
+ cli.command('db <action>', 'Database utilities', (y) => y.positional('action', {
423
+ describe: 'Action',
424
+ choices: ['path'],
423
425
  demandOption: true,
424
426
  }), async (argv) => {
425
- if (argv.action === "path") {
426
- const { getGlobalDataDir } = await import("./utils/paths.js");
427
+ if (argv.action === 'path') {
428
+ const { getGlobalDataDir } = await import('./utils/paths.js');
427
429
  console.log(`${getGlobalDataDir()}/spectra.db`);
428
430
  }
429
431
  });
430
432
  await cli.parse();
431
433
  }
432
434
  main().catch((err) => {
433
- console.error(chalk.red("Fatal:"), err);
435
+ console.error(chalk.red('Fatal:'), err);
434
436
  process.exit(1);
435
437
  });
436
438
  //# sourceMappingURL=cli.js.map