@mohanscodex/spectra-code 0.4.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 (319) hide show
  1. package/README.md +275 -0
  2. package/dist/package.json +62 -0
  3. package/dist/src/agents/definitions.d.ts +16 -0
  4. package/dist/src/agents/definitions.d.ts.map +1 -0
  5. package/dist/src/agents/definitions.js +148 -0
  6. package/dist/src/agents/definitions.js.map +1 -0
  7. package/dist/src/agents/registry.d.ts +11 -0
  8. package/dist/src/agents/registry.d.ts.map +1 -0
  9. package/dist/src/agents/registry.js +13 -0
  10. package/dist/src/agents/registry.js.map +1 -0
  11. package/dist/src/cli.d.ts +3 -0
  12. package/dist/src/cli.d.ts.map +1 -0
  13. package/dist/src/cli.js +436 -0
  14. package/dist/src/cli.js.map +1 -0
  15. package/dist/src/commands/agent.d.ts +3 -0
  16. package/dist/src/commands/agent.d.ts.map +1 -0
  17. package/dist/src/commands/agent.js +28 -0
  18. package/dist/src/commands/agent.js.map +1 -0
  19. package/dist/src/commands/db.d.ts +3 -0
  20. package/dist/src/commands/db.d.ts.map +1 -0
  21. package/dist/src/commands/db.js +47 -0
  22. package/dist/src/commands/db.js.map +1 -0
  23. package/dist/src/commands/doctor.d.ts +12 -0
  24. package/dist/src/commands/doctor.d.ts.map +1 -0
  25. package/dist/src/commands/doctor.js +59 -0
  26. package/dist/src/commands/doctor.js.map +1 -0
  27. package/dist/src/commands/mcp.d.ts +9 -0
  28. package/dist/src/commands/mcp.d.ts.map +1 -0
  29. package/dist/src/commands/mcp.js +208 -0
  30. package/dist/src/commands/mcp.js.map +1 -0
  31. package/dist/src/commands/plugin.d.ts +3 -0
  32. package/dist/src/commands/plugin.d.ts.map +1 -0
  33. package/dist/src/commands/plugin.js +36 -0
  34. package/dist/src/commands/plugin.js.map +1 -0
  35. package/dist/src/commands/session.d.ts +3 -0
  36. package/dist/src/commands/session.d.ts.map +1 -0
  37. package/dist/src/commands/session.js +49 -0
  38. package/dist/src/commands/session.js.map +1 -0
  39. package/dist/src/index.d.ts +19 -0
  40. package/dist/src/index.d.ts.map +1 -0
  41. package/dist/src/index.js +17 -0
  42. package/dist/src/index.js.map +1 -0
  43. package/dist/src/integrations/acp/index.d.ts +2 -0
  44. package/dist/src/integrations/acp/index.d.ts.map +1 -0
  45. package/dist/src/integrations/acp/index.js +2 -0
  46. package/dist/src/integrations/acp/index.js.map +1 -0
  47. package/dist/src/integrations/acp/server.d.ts +11 -0
  48. package/dist/src/integrations/acp/server.d.ts.map +1 -0
  49. package/dist/src/integrations/acp/server.js +220 -0
  50. package/dist/src/integrations/acp/server.js.map +1 -0
  51. package/dist/src/integrations/custom-tools/index.d.ts +3 -0
  52. package/dist/src/integrations/custom-tools/index.d.ts.map +1 -0
  53. package/dist/src/integrations/custom-tools/index.js +2 -0
  54. package/dist/src/integrations/custom-tools/index.js.map +1 -0
  55. package/dist/src/integrations/custom-tools/loader.d.ts +16 -0
  56. package/dist/src/integrations/custom-tools/loader.d.ts.map +1 -0
  57. package/dist/src/integrations/custom-tools/loader.js +95 -0
  58. package/dist/src/integrations/custom-tools/loader.js.map +1 -0
  59. package/dist/src/integrations/mcp/client.d.ts +32 -0
  60. package/dist/src/integrations/mcp/client.d.ts.map +1 -0
  61. package/dist/src/integrations/mcp/client.js +117 -0
  62. package/dist/src/integrations/mcp/client.js.map +1 -0
  63. package/dist/src/integrations/mcp/index.d.ts +3 -0
  64. package/dist/src/integrations/mcp/index.d.ts.map +1 -0
  65. package/dist/src/integrations/mcp/index.js +2 -0
  66. package/dist/src/integrations/mcp/index.js.map +1 -0
  67. package/dist/src/security/doom-loop.d.ts +22 -0
  68. package/dist/src/security/doom-loop.d.ts.map +1 -0
  69. package/dist/src/security/doom-loop.js +72 -0
  70. package/dist/src/security/doom-loop.js.map +1 -0
  71. package/dist/src/security/index.d.ts +46 -0
  72. package/dist/src/security/index.d.ts.map +1 -0
  73. package/dist/src/security/index.js +362 -0
  74. package/dist/src/security/index.js.map +1 -0
  75. package/dist/src/security/path-safety.d.ts +15 -0
  76. package/dist/src/security/path-safety.d.ts.map +1 -0
  77. package/dist/src/security/path-safety.js +57 -0
  78. package/dist/src/security/path-safety.js.map +1 -0
  79. package/dist/src/security/permissions.d.ts +7 -0
  80. package/dist/src/security/permissions.d.ts.map +1 -0
  81. package/dist/src/security/permissions.js +41 -0
  82. package/dist/src/security/permissions.js.map +1 -0
  83. package/dist/src/security/read-tracker.d.ts +20 -0
  84. package/dist/src/security/read-tracker.d.ts.map +1 -0
  85. package/dist/src/security/read-tracker.js +73 -0
  86. package/dist/src/security/read-tracker.js.map +1 -0
  87. package/dist/src/security/ssrf-guard.d.ts +19 -0
  88. package/dist/src/security/ssrf-guard.d.ts.map +1 -0
  89. package/dist/src/security/ssrf-guard.js +98 -0
  90. package/dist/src/security/ssrf-guard.js.map +1 -0
  91. package/dist/src/security/types.d.ts +70 -0
  92. package/dist/src/security/types.d.ts.map +1 -0
  93. package/dist/src/security/types.js +2 -0
  94. package/dist/src/security/types.js.map +1 -0
  95. package/dist/src/security/wildcard.d.ts +5 -0
  96. package/dist/src/security/wildcard.d.ts.map +1 -0
  97. package/dist/src/security/wildcard.js +50 -0
  98. package/dist/src/security/wildcard.js.map +1 -0
  99. package/dist/src/services/auth-store.d.ts +25 -0
  100. package/dist/src/services/auth-store.d.ts.map +1 -0
  101. package/dist/src/services/auth-store.js +40 -0
  102. package/dist/src/services/auth-store.js.map +1 -0
  103. package/dist/src/services/config.d.ts +66 -0
  104. package/dist/src/services/config.d.ts.map +1 -0
  105. package/dist/src/services/config.js +83 -0
  106. package/dist/src/services/config.js.map +1 -0
  107. package/dist/src/services/context.d.ts +7 -0
  108. package/dist/src/services/context.d.ts.map +1 -0
  109. package/dist/src/services/context.js +23 -0
  110. package/dist/src/services/context.js.map +1 -0
  111. package/dist/src/services/custom-providers.d.ts +5 -0
  112. package/dist/src/services/custom-providers.d.ts.map +1 -0
  113. package/dist/src/services/custom-providers.js +213 -0
  114. package/dist/src/services/custom-providers.js.map +1 -0
  115. package/dist/src/services/session-store.d.ts +76 -0
  116. package/dist/src/services/session-store.d.ts.map +1 -0
  117. package/dist/src/services/session-store.js +199 -0
  118. package/dist/src/services/session-store.js.map +1 -0
  119. package/dist/src/services/snapshot-manager.d.ts +46 -0
  120. package/dist/src/services/snapshot-manager.d.ts.map +1 -0
  121. package/dist/src/services/snapshot-manager.js +183 -0
  122. package/dist/src/services/snapshot-manager.js.map +1 -0
  123. package/dist/src/tools/edit.d.ts +3 -0
  124. package/dist/src/tools/edit.d.ts.map +1 -0
  125. package/dist/src/tools/edit.js +57 -0
  126. package/dist/src/tools/edit.js.map +1 -0
  127. package/dist/src/tools/glob.d.ts +3 -0
  128. package/dist/src/tools/glob.d.ts.map +1 -0
  129. package/dist/src/tools/glob.js +46 -0
  130. package/dist/src/tools/glob.js.map +1 -0
  131. package/dist/src/tools/grep.d.ts +3 -0
  132. package/dist/src/tools/grep.d.ts.map +1 -0
  133. package/dist/src/tools/grep.js +50 -0
  134. package/dist/src/tools/grep.js.map +1 -0
  135. package/dist/src/tools/index.d.ts +26 -0
  136. package/dist/src/tools/index.d.ts.map +1 -0
  137. package/dist/src/tools/index.js +202 -0
  138. package/dist/src/tools/index.js.map +1 -0
  139. package/dist/src/tools/mcp-tool.d.ts +5 -0
  140. package/dist/src/tools/mcp-tool.d.ts.map +1 -0
  141. package/dist/src/tools/mcp-tool.js +82 -0
  142. package/dist/src/tools/mcp-tool.js.map +1 -0
  143. package/dist/src/tools/read.d.ts +3 -0
  144. package/dist/src/tools/read.d.ts.map +1 -0
  145. package/dist/src/tools/read.js +48 -0
  146. package/dist/src/tools/read.js.map +1 -0
  147. package/dist/src/tools/shell.d.ts +3 -0
  148. package/dist/src/tools/shell.d.ts.map +1 -0
  149. package/dist/src/tools/shell.js +266 -0
  150. package/dist/src/tools/shell.js.map +1 -0
  151. package/dist/src/tools/task.d.ts +3 -0
  152. package/dist/src/tools/task.d.ts.map +1 -0
  153. package/dist/src/tools/task.js +75 -0
  154. package/dist/src/tools/task.js.map +1 -0
  155. package/dist/src/tools/types.d.ts +18 -0
  156. package/dist/src/tools/types.d.ts.map +1 -0
  157. package/dist/src/tools/types.js +2 -0
  158. package/dist/src/tools/types.js.map +1 -0
  159. package/dist/src/tools/utils.d.ts +4 -0
  160. package/dist/src/tools/utils.d.ts.map +1 -0
  161. package/dist/src/tools/utils.js +10 -0
  162. package/dist/src/tools/utils.js.map +1 -0
  163. package/dist/src/tools/web-fetch.d.ts +3 -0
  164. package/dist/src/tools/web-fetch.d.ts.map +1 -0
  165. package/dist/src/tools/web-fetch.js +81 -0
  166. package/dist/src/tools/web-fetch.js.map +1 -0
  167. package/dist/src/tools/write.d.ts +3 -0
  168. package/dist/src/tools/write.d.ts.map +1 -0
  169. package/dist/src/tools/write.js +28 -0
  170. package/dist/src/tools/write.js.map +1 -0
  171. package/dist/src/tui/app-constants.d.ts +3 -0
  172. package/dist/src/tui/app-constants.d.ts.map +1 -0
  173. package/dist/src/tui/app-constants.js +4 -0
  174. package/dist/src/tui/app-constants.js.map +1 -0
  175. package/dist/src/tui/app.d.ts +5 -0
  176. package/dist/src/tui/app.d.ts.map +1 -0
  177. package/dist/src/tui/app.js +322 -0
  178. package/dist/src/tui/app.js.map +1 -0
  179. package/dist/src/tui/commands.d.ts +61 -0
  180. package/dist/src/tui/commands.d.ts.map +1 -0
  181. package/dist/src/tui/commands.js +95 -0
  182. package/dist/src/tui/commands.js.map +1 -0
  183. package/dist/src/tui/components/chat-area.d.ts +9 -0
  184. package/dist/src/tui/components/chat-area.d.ts.map +1 -0
  185. package/dist/src/tui/components/chat-area.js +12 -0
  186. package/dist/src/tui/components/chat-area.js.map +1 -0
  187. package/dist/src/tui/components/command-palette.d.ts +18 -0
  188. package/dist/src/tui/components/command-palette.d.ts.map +1 -0
  189. package/dist/src/tui/components/command-palette.js +50 -0
  190. package/dist/src/tui/components/command-palette.js.map +1 -0
  191. package/dist/src/tui/components/message.d.ts +9 -0
  192. package/dist/src/tui/components/message.d.ts.map +1 -0
  193. package/dist/src/tui/components/message.js +116 -0
  194. package/dist/src/tui/components/message.js.map +1 -0
  195. package/dist/src/tui/components/slash-autocomplete.d.ts +14 -0
  196. package/dist/src/tui/components/slash-autocomplete.d.ts.map +1 -0
  197. package/dist/src/tui/components/slash-autocomplete.js +29 -0
  198. package/dist/src/tui/components/slash-autocomplete.js.map +1 -0
  199. package/dist/src/tui/components/toast.d.ts +8 -0
  200. package/dist/src/tui/components/toast.d.ts.map +1 -0
  201. package/dist/src/tui/components/toast.js +29 -0
  202. package/dist/src/tui/components/toast.js.map +1 -0
  203. package/dist/src/tui/hooks/use-agent.d.ts +20 -0
  204. package/dist/src/tui/hooks/use-agent.d.ts.map +1 -0
  205. package/dist/src/tui/hooks/use-agent.js +129 -0
  206. package/dist/src/tui/hooks/use-agent.js.map +1 -0
  207. package/dist/src/tui/hooks/use-app-keyboard.d.ts +53 -0
  208. package/dist/src/tui/hooks/use-app-keyboard.d.ts.map +1 -0
  209. package/dist/src/tui/hooks/use-app-keyboard.js +155 -0
  210. package/dist/src/tui/hooks/use-app-keyboard.js.map +1 -0
  211. package/dist/src/tui/hooks/use-chat-submit.d.ts +61 -0
  212. package/dist/src/tui/hooks/use-chat-submit.d.ts.map +1 -0
  213. package/dist/src/tui/hooks/use-chat-submit.js +269 -0
  214. package/dist/src/tui/hooks/use-chat-submit.js.map +1 -0
  215. package/dist/src/tui/hooks/use-permission-queue.d.ts +10 -0
  216. package/dist/src/tui/hooks/use-permission-queue.d.ts.map +1 -0
  217. package/dist/src/tui/hooks/use-permission-queue.js +26 -0
  218. package/dist/src/tui/hooks/use-permission-queue.js.map +1 -0
  219. package/dist/src/tui/hooks/use-revert.d.ts +26 -0
  220. package/dist/src/tui/hooks/use-revert.d.ts.map +1 -0
  221. package/dist/src/tui/hooks/use-revert.js +88 -0
  222. package/dist/src/tui/hooks/use-revert.js.map +1 -0
  223. package/dist/src/tui/index.d.ts +5 -0
  224. package/dist/src/tui/index.d.ts.map +1 -0
  225. package/dist/src/tui/index.js +38 -0
  226. package/dist/src/tui/index.js.map +1 -0
  227. package/dist/src/tui/prompt-bar.d.ts +29 -0
  228. package/dist/src/tui/prompt-bar.d.ts.map +1 -0
  229. package/dist/src/tui/prompt-bar.js +41 -0
  230. package/dist/src/tui/prompt-bar.js.map +1 -0
  231. package/dist/src/tui/slash-commands.d.ts +20 -0
  232. package/dist/src/tui/slash-commands.d.ts.map +1 -0
  233. package/dist/src/tui/slash-commands.js +30 -0
  234. package/dist/src/tui/slash-commands.js.map +1 -0
  235. package/dist/src/tui/theme.d.ts +29 -0
  236. package/dist/src/tui/theme.d.ts.map +1 -0
  237. package/dist/src/tui/theme.js +54 -0
  238. package/dist/src/tui/theme.js.map +1 -0
  239. package/dist/src/tui/tips.d.ts +2 -0
  240. package/dist/src/tui/tips.d.ts.map +1 -0
  241. package/dist/src/tui/tips.js +40 -0
  242. package/dist/src/tui/tips.js.map +1 -0
  243. package/dist/src/tui/types.d.ts +34 -0
  244. package/dist/src/tui/types.d.ts.map +1 -0
  245. package/dist/src/tui/types.js +2 -0
  246. package/dist/src/tui/types.js.map +1 -0
  247. package/dist/src/tui/ui/about-dialog.d.ts +8 -0
  248. package/dist/src/tui/ui/about-dialog.d.ts.map +1 -0
  249. package/dist/src/tui/ui/about-dialog.js +21 -0
  250. package/dist/src/tui/ui/about-dialog.js.map +1 -0
  251. package/dist/src/tui/ui/agent-switcher.d.ts +10 -0
  252. package/dist/src/tui/ui/agent-switcher.d.ts.map +1 -0
  253. package/dist/src/tui/ui/agent-switcher.js +77 -0
  254. package/dist/src/tui/ui/agent-switcher.js.map +1 -0
  255. package/dist/src/tui/ui/debug-dialog.d.ts +15 -0
  256. package/dist/src/tui/ui/debug-dialog.d.ts.map +1 -0
  257. package/dist/src/tui/ui/debug-dialog.js +74 -0
  258. package/dist/src/tui/ui/debug-dialog.js.map +1 -0
  259. package/dist/src/tui/ui/doctor-dialog.d.ts +9 -0
  260. package/dist/src/tui/ui/doctor-dialog.d.ts.map +1 -0
  261. package/dist/src/tui/ui/doctor-dialog.js +45 -0
  262. package/dist/src/tui/ui/doctor-dialog.js.map +1 -0
  263. package/dist/src/tui/ui/manage-providers-dialog.d.ts +10 -0
  264. package/dist/src/tui/ui/manage-providers-dialog.d.ts.map +1 -0
  265. package/dist/src/tui/ui/manage-providers-dialog.js +257 -0
  266. package/dist/src/tui/ui/manage-providers-dialog.js.map +1 -0
  267. package/dist/src/tui/ui/mcp-toggle-dialog.d.ts +8 -0
  268. package/dist/src/tui/ui/mcp-toggle-dialog.d.ts.map +1 -0
  269. package/dist/src/tui/ui/mcp-toggle-dialog.js +89 -0
  270. package/dist/src/tui/ui/mcp-toggle-dialog.js.map +1 -0
  271. package/dist/src/tui/ui/message-controls.d.ts +16 -0
  272. package/dist/src/tui/ui/message-controls.d.ts.map +1 -0
  273. package/dist/src/tui/ui/message-controls.js +102 -0
  274. package/dist/src/tui/ui/message-controls.js.map +1 -0
  275. package/dist/src/tui/ui/model-switcher.d.ts +10 -0
  276. package/dist/src/tui/ui/model-switcher.d.ts.map +1 -0
  277. package/dist/src/tui/ui/model-switcher.js +139 -0
  278. package/dist/src/tui/ui/model-switcher.js.map +1 -0
  279. package/dist/src/tui/ui/permission-dialog.d.ts +12 -0
  280. package/dist/src/tui/ui/permission-dialog.d.ts.map +1 -0
  281. package/dist/src/tui/ui/permission-dialog.js +37 -0
  282. package/dist/src/tui/ui/permission-dialog.js.map +1 -0
  283. package/dist/src/tui/ui/provider-dialog.d.ts +11 -0
  284. package/dist/src/tui/ui/provider-dialog.d.ts.map +1 -0
  285. package/dist/src/tui/ui/provider-dialog.js +232 -0
  286. package/dist/src/tui/ui/provider-dialog.js.map +1 -0
  287. package/dist/src/tui/ui/session-list.d.ts +23 -0
  288. package/dist/src/tui/ui/session-list.d.ts.map +1 -0
  289. package/dist/src/tui/ui/session-list.js +147 -0
  290. package/dist/src/tui/ui/session-list.js.map +1 -0
  291. package/dist/src/tui/ui/thinking-effort-dialog.d.ts +11 -0
  292. package/dist/src/tui/ui/thinking-effort-dialog.d.ts.map +1 -0
  293. package/dist/src/tui/ui/thinking-effort-dialog.js +79 -0
  294. package/dist/src/tui/ui/thinking-effort-dialog.js.map +1 -0
  295. package/dist/src/tui/utils/model-config.d.ts +9 -0
  296. package/dist/src/tui/utils/model-config.d.ts.map +1 -0
  297. package/dist/src/tui/utils/model-config.js +63 -0
  298. package/dist/src/tui/utils/model-config.js.map +1 -0
  299. package/dist/src/tui/utils/session-messages.d.ts +22 -0
  300. package/dist/src/tui/utils/session-messages.d.ts.map +1 -0
  301. package/dist/src/tui/utils/session-messages.js +62 -0
  302. package/dist/src/tui/utils/session-messages.js.map +1 -0
  303. package/dist/src/tui/utils.d.ts +6 -0
  304. package/dist/src/tui/utils.d.ts.map +1 -0
  305. package/dist/src/tui/utils.js +23 -0
  306. package/dist/src/tui/utils.js.map +1 -0
  307. package/dist/src/tui/variant-cycle.d.ts +10 -0
  308. package/dist/src/tui/variant-cycle.d.ts.map +1 -0
  309. package/dist/src/tui/variant-cycle.js +64 -0
  310. package/dist/src/tui/variant-cycle.js.map +1 -0
  311. package/dist/src/utils/paths.d.ts +10 -0
  312. package/dist/src/utils/paths.d.ts.map +1 -0
  313. package/dist/src/utils/paths.js +106 -0
  314. package/dist/src/utils/paths.js.map +1 -0
  315. package/dist/src/utils/platform.d.ts +10 -0
  316. package/dist/src/utils/platform.d.ts.map +1 -0
  317. package/dist/src/utils/platform.js +133 -0
  318. package/dist/src/utils/platform.js.map +1 -0
  319. package/package.json +62 -0
@@ -0,0 +1,106 @@
1
+ import { homedir } from "os";
2
+ import { sep, join, resolve } from "path";
3
+ import { existsSync, readdirSync, statSync } from "fs";
4
+ export function getGlobalConfigDir() {
5
+ const xdg = process.env.XDG_CONFIG_HOME;
6
+ if (xdg)
7
+ return join(xdg, "spectra");
8
+ const home = homedir();
9
+ if (process.platform === "win32") {
10
+ const appData = process.env.APPDATA;
11
+ if (appData)
12
+ return join(appData, "spectra");
13
+ return join(home, "AppData", "Roaming", "spectra");
14
+ }
15
+ return join(home, ".config", "spectra");
16
+ }
17
+ export function getGlobalDataDir() {
18
+ const xdg = process.env.XDG_DATA_HOME;
19
+ if (xdg)
20
+ return join(xdg, "spectra");
21
+ const home = homedir();
22
+ if (process.platform === "win32") {
23
+ const localAppData = process.env.LOCALAPPDATA;
24
+ if (localAppData)
25
+ return join(localAppData, "spectra");
26
+ return join(home, "AppData", "Local", "spectra");
27
+ }
28
+ return join(home, ".local", "share", "spectra");
29
+ }
30
+ export function getGlobalCacheDir() {
31
+ const xdg = process.env.XDG_CACHE_HOME;
32
+ if (xdg)
33
+ return join(xdg, "spectra");
34
+ const home = homedir();
35
+ if (process.platform === "win32") {
36
+ const localAppData = process.env.LOCALAPPDATA;
37
+ if (localAppData)
38
+ return join(localAppData, "spectra", "cache");
39
+ return join(home, "AppData", "Local", "spectra", "cache");
40
+ }
41
+ return join(home, ".cache", "spectra");
42
+ }
43
+ export function discoverConfigDirs(startDir) {
44
+ const dirs = [];
45
+ const global = getGlobalConfigDir();
46
+ if (existsSync(global))
47
+ dirs.push({ path: global, base: global });
48
+ const home = homedir();
49
+ const targets = [".spectra", ".opencode", ".claude", ".agents"];
50
+ let current = resolve(startDir);
51
+ const parts = current.split(sep);
52
+ for (let i = parts.length; i >= 1; i--) {
53
+ const dir = parts.slice(0, i).join(sep);
54
+ for (const target of targets) {
55
+ const candidate = join(dir, target);
56
+ if (existsSync(candidate)) {
57
+ if (!dirs.some(d => d.path === candidate)) {
58
+ dirs.push({ path: candidate, base: dir });
59
+ }
60
+ }
61
+ }
62
+ if (dir === home)
63
+ break;
64
+ }
65
+ const homeDot = join(home, ".spectra");
66
+ if (existsSync(homeDot) && !dirs.some(d => d.path === homeDot)) {
67
+ dirs.push({ path: homeDot, base: home });
68
+ }
69
+ return dirs;
70
+ }
71
+ export function discoverInstructionFiles(startDir) {
72
+ const files = [];
73
+ const names = ["AGENTS.md", "CLAUDE.md", "SPECTRA.md", "INSTRUCTIONS.md"];
74
+ let current = resolve(startDir);
75
+ const parts = current.split(sep);
76
+ for (let i = parts.length; i >= 1; i--) {
77
+ const dir = parts.slice(0, i).join(sep);
78
+ for (const name of names) {
79
+ const candidate = join(dir, name);
80
+ if (existsSync(candidate) && !files.includes(candidate)) {
81
+ files.push(candidate);
82
+ }
83
+ }
84
+ if (dir === homedir())
85
+ break;
86
+ }
87
+ const dirs = discoverConfigDirs(startDir);
88
+ for (const d of dirs) {
89
+ const instructionsDir = join(d.path, "instructions");
90
+ if (existsSync(instructionsDir) && statSync(instructionsDir).isDirectory()) {
91
+ for (const entry of readdirSync(instructionsDir)) {
92
+ if (entry.endsWith(".md")) {
93
+ files.push(join(instructionsDir, entry));
94
+ }
95
+ }
96
+ }
97
+ for (const name of names) {
98
+ const candidate = join(d.path, name);
99
+ if (existsSync(candidate) && !files.includes(candidate)) {
100
+ files.push(candidate);
101
+ }
102
+ }
103
+ }
104
+ return files;
105
+ }
106
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/utils/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAEvD,MAAM,UAAU,kBAAkB;IAChC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IACxC,IAAI,GAAG;QAAE,OAAO,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CA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C,CAAC;YACxB,CAAC;QACH,CAAC;QACD,IAAI,GAAG,KAAK,OAAO,EAAE;YAAE,MAAM;IAC/B,CAAC;IAED,MAAM,IAAI,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC1C,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,eAAe,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QACrD,IAAI,UAAU,CAAC,eAAe,CAAC,IAAI,QAAQ,CAAC,eAAe,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YAC3E,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC;gBACjD,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC1B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC;gBAC3C,CAAC;YACH,CAAC;QACH,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACrC,IAAI,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;gBACxD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare function getPlatformInfo(): {
2
+ os: string;
3
+ arch: string;
4
+ shell: string;
5
+ homeDir: string;
6
+ hostname: string;
7
+ cwd: string;
8
+ };
9
+ export declare function getSystemPrompt(): string;
10
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../src/utils/platform.ts"],"names":[],"mappings":"AAmBA,wBAAgB,eAAe,IAAI;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAU7H;AAED,wBAAgB,eAAe,IAAI,MAAM,CAuGxC"}
@@ -0,0 +1,133 @@
1
+ import { existsSync } from "fs";
2
+ function resolveShell() {
3
+ if (process.platform !== "win32") {
4
+ return process.env.SHELL || "/bin/bash";
5
+ }
6
+ const pathDirs = (process.env.PATH || "").split(";");
7
+ for (const dir of pathDirs) {
8
+ const pwshPath = dir ? `${dir}\pwsh.exe` : "pwsh.exe";
9
+ if (existsSync(pwshPath))
10
+ return "pwsh.exe";
11
+ }
12
+ for (const dir of pathDirs) {
13
+ const psPath = dir ? `${dir}\powershell.exe` : "powershell.exe";
14
+ if (existsSync(psPath))
15
+ return "powershell.exe";
16
+ }
17
+ return process.env.COMSPEC || "cmd.exe";
18
+ }
19
+ export function getPlatformInfo() {
20
+ const os = process.platform === "win32" ? "windows"
21
+ : process.platform === "darwin" ? "macos"
22
+ : "linux";
23
+ const arch = process.arch;
24
+ const shell = resolveShell();
25
+ const homeDir = process.env.HOME || process.env.USERPROFILE || "/home";
26
+ const hostname = process.env.HOSTNAME || process.env.COMPUTERNAME || "localhost";
27
+ const cwd = process.cwd();
28
+ return { os, arch, shell, homeDir, hostname, cwd };
29
+ }
30
+ export function getSystemPrompt() {
31
+ const info = getPlatformInfo();
32
+ const isWin = info.os === "windows";
33
+ return `You are Spectra Code, a deeply pragmatic, effective software engineer operating as an AI coding agent in the user's terminal.
34
+
35
+ You collaborate with the user in the same workspace, taking engineering quality seriously. You communicate directly and efficiently — keep the user informed about ongoing actions without unnecessary detail. Build context by examining the codebase first, never making assumptions or jumping to conclusions. Think through the nuances of the code you encounter.
36
+
37
+ ## Environment
38
+ - **Platform**: ${info.os} (${info.arch})
39
+ - **Host**: ${info.hostname}
40
+ - **Default Shell**: ${info.shell}
41
+ - **Home Directory**: ${info.homeDir}
42
+ - **Current Working Directory**: ${info.cwd}
43
+
44
+ All file operations default to the working directory. Use relative paths where possible.
45
+
46
+ ## Available Tools
47
+ You have access to these tools to complete tasks:
48
+
49
+ 1. **bash** — Execute shell commands. Returns stdout, stderr, and exit code.
50
+ - ${isWin ? `Shell: ${info.shell}. Prefer PowerShell cmdlets for complex operations. Simple commands work with cmd.exe builtins (dir, echo, type). Never use '&&' — use '; if (\$?) { ... }' instead.` : "Standard bash shell. Use single quotes for literal strings."}
51
+ - ${isWin ? "Path handling: Use forward slashes or escaped backslashes. Bun and Node.js handle both." : "Standard POSIX paths."}
52
+ - For commands that modify the file system, briefly explain what the command does and why.
53
+ - Avoid interactive commands (e.g., git rebase -i). Use non-interactive alternatives.
54
+ - Never run destructive commands (rm -rf, sudo, format, git reset --hard, git checkout --) without the user explicitly requesting them.
55
+ - Never use bash echo or command-line tools to communicate with the user — output text directly instead.
56
+
57
+ 2. **read** — Read file contents with line numbers. Supports offset/limit for large files. Can list directories.
58
+ - Always read a file before editing it to understand its full context.
59
+ - Maximum file size: 1MB. Use grep for larger files.
60
+
61
+ 3. **write** — Create or overwrite files. Creates parent directories automatically.
62
+ - Never create files unless they are absolutely necessary. Always prefer editing existing files.
63
+ - Write files with complete, correct content.
64
+
65
+ 4. **edit** — Find and replace exact text in existing files.
66
+ - Include enough surrounding context in the old string to ensure a unique match.
67
+ - Prefer edit for small surgical changes, write for large additions or new files.
68
+ - Mimic the file's existing code style: indentation, naming conventions, framework choices, type patterns.
69
+ - Verify the replacement produces valid syntax before submitting.
70
+
71
+ 5. **grep** — Search file contents using regular expressions. Powered by ripgrep.
72
+ - Use for finding patterns, classes, functions across the codebase.
73
+ - Prefer grep over reading entire files when searching for specific patterns.
74
+ - Results are limited to prevent overwhelming output.
75
+
76
+ 6. **glob** — Find files matching glob patterns (e.g., \`**/*.ts\`, \`src/components/**/*.tsx\`).
77
+ - Use for discovering files by name patterns before reading or searching.
78
+
79
+ 7. **web_fetch** — Fetch URL content as markdown text for docs, APIs, references.
80
+
81
+ ## Tool Usage Rules
82
+ - **Parallelize independent calls**: When multiple independent tool calls are needed, invoke them all in a single response.
83
+ - **Prefer dedicated tools over bash**: Use read/edit/write/grep/glob instead of cat/sed/echo/find/ls.
84
+ - **Tool selection priority**:
85
+ 1. **grep** — for searching code patterns (never read entire files for a search)
86
+ 2. **glob** — for finding files by name pattern
87
+ 3. **read** — for reading specific files you need to understand or edit
88
+ 4. **edit** — for small targeted changes (< 20 lines of context)
89
+ 5. **write** — for new files or large additions
90
+ 6. **bash** — only for actual system commands (builds, tests, git, package management)
91
+
92
+ ## Code Style & Conventions
93
+ - When making changes, first understand the file's existing conventions. Mimic code style, naming, framework choices, and architectural patterns.
94
+ - **NEVER assume a library or framework is available** even if well known. Check that the codebase already uses it (look at imports in neighboring files, package.json, Cargo.toml, etc.).
95
+ - **DO NOT ADD COMMENTS unless asked.** The code should speak for itself.
96
+ - The best changes are often the smallest correct changes. When weighing two correct approaches, prefer the more minimal one.
97
+ - Do not add backward-compatibility code unless there is a concrete need (persisted data, shipped behavior, external consumers).
98
+ - Keep things in one function unless composable or reusable.
99
+ - Never use \`unwrap\` or \`expect\` without explicit user permission — use \`?\` operator or proper error handling.
100
+ - If the user asks for a "review" or "audit", default to identifying bugs, risks, behavioral regressions, and missing tests. Present findings ordered by severity with file/line references.
101
+
102
+ ## Git & Safety
103
+ - **Never commit changes unless the user explicitly asks.**
104
+ - **Never amend commits, never force push, never hard reset, never skip hooks** unless the user explicitly instructs.
105
+ - **Never revert, undo, or modify changes you did not make** — another agent or the user may have made them.
106
+ - **Never expose secrets, API keys, or credentials** in code, commits, or output. Never commit .env files.
107
+ - If the user asks you to commit secrets, warn them and decline.
108
+ - Before running commands that modify the file system, briefly explain what the command does and why.
109
+
110
+ ## Tone & Output
111
+ - Output is rendered in a CLI environment in monospace font. Use GitHub-flavored Markdown.
112
+ - **Be concise. Answer the user directly in 1-3 lines when possible.** No preambles, no postambles, no conversational filler. Avoid openers like "Done!", "Great question!" or "Here's what I'll do..."
113
+ - **Never add code explanation summaries unless the user asks for them.** After editing a file, stop — the user can see what changed.
114
+ - Do not use emojis unless the user explicitly requests them.
115
+ - When referencing code, use the format \`file_path:line_number\` (e.g., \`src/services/process.ts:712\`).
116
+ - Use inline code blocks for paths, commands, variables, function names. Use fenced blocks with language tags for multi-line code.
117
+ - **Prioritize technical accuracy over validating the user's beliefs.** Provide direct, objective technical information. Respectful disagreement is more valuable than false agreement. When uncertain, investigate to find the truth first rather than instinctively confirming the user's assumptions.
118
+
119
+ ## Handling Uncertainty
120
+ - If the user's intent is ambiguous, ask a short clarifying question before proceeding.
121
+ - If you cannot or should not fulfill a request, say so briefly and offer alternatives if possible.
122
+ - If you encounter errors or unexpected behavior, diagnose the root cause — do not guess at fixes.
123
+ - If a task seems outside your scope or unsafe, state your concern clearly and suggest a path forward.
124
+
125
+ ## Task Workflow
126
+ When solving bugs, adding features, or refactoring:
127
+ 1. **Understand** the request and the relevant codebase context. Use grep and glob to explore.
128
+ 2. **Read** the specific files you need to modify. Do not read unrelated files.
129
+ 3. **Implement** the change using the appropriate tool.
130
+ 4. **Verify** your change by running the project's lint, typecheck, and test commands. Identify the correct commands from package.json, README, or existing CI configs. Never assume standard test commands.
131
+ 5. If the user provided instructions (AGENTS.md, CLAUDE.md, etc.), follow them.`;
132
+ }
133
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../../../src/utils/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAE/B,SAAS,YAAY;IACnB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,WAAW,CAAA;IACzC,CAAC;IA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AAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,MAAM,IAAI,GAAG,eAAe,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,KAAK,SAAS,CAAC;IAEpC,OAAO;;;;;kBAKS,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI;cACzB,IAAI,CAAC,QAAQ;uBACJ,IAAI,CAAC,KAAK;wBACT,IAAI,CAAC,OAAO;mCACD,IAAI,CAAC,GAAG;;;;;;;;OAQpC,KAAK,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,KAAK,sKAAsK,CAAC,CAAC,CAAC,6DAA6D;OAClQ,KAAK,CAAC,CAAC,CAAC,yFAAyF,CAAC,CAAC,CAAC,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gFAgFlD,CAAC;AACjF,CAAC"}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@mohanscodex/spectra-code",
3
+ "version": "0.4.5",
4
+ "type": "module",
5
+ "description": "Spectra Code — TUI coding agent with CLI commands, tools, and LLM integration",
6
+ "bin": {
7
+ "spectra": "dist/src/cli.js"
8
+ },
9
+ "main": "./dist/src/index.js",
10
+ "types": "./dist/src/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/src/index.d.ts",
14
+ "import": "./dist/src/index.js"
15
+ },
16
+ "./cli": {
17
+ "types": "./dist/src/cli.d.ts",
18
+ "import": "./dist/src/cli.js"
19
+ }
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsc",
26
+ "dev": "bun src/cli.ts",
27
+ "start": "bun src/cli.ts",
28
+ "spectra:help": "tsx src/cli.ts --help",
29
+ "test": "vitest --run",
30
+ "lint": "tsc --noEmit"
31
+ },
32
+ "dependencies": {
33
+ "@clack/prompts": "^1.4.0",
34
+ "@modelcontextprotocol/sdk": "^1.29.0",
35
+ "@opentui/core": ">=0.2.6",
36
+ "@opentui/react": "^0.2.10",
37
+ "@mohanscodex/spectra-agent": "^0.4.5",
38
+ "@mohanscodex/spectra-ai": "^0.4.5",
39
+ "chalk": "^5.6.2",
40
+ "clipboardy": "^5.3.1",
41
+ "openai": "^5.3.0",
42
+ "react": "^19.2.6",
43
+ "strip-ansi": "^7.2.0",
44
+ "yargs": "^18.0.0",
45
+ "zod": "^3.25.0"
46
+ },
47
+ "devDependencies": {
48
+ "@types/node": "^22.0.0",
49
+ "@types/react": "^19.2.14",
50
+ "@types/react-dom": "^19.2.3",
51
+ "@types/strip-ansi": "^5.2.1",
52
+ "@types/yargs": "^17.0.0",
53
+ "tsx": "^4.19.0",
54
+ "typescript": "^5.7.0",
55
+ "vitest": "^3.2.0"
56
+ },
57
+ "license": "MIT",
58
+ "engines": {
59
+ "bun": ">=1.0.0"
60
+ },
61
+ "preferGlobal": true
62
+ }