aura-code 0.3.0

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 (288) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +137 -0
  3. package/dist/agent/context.d.ts +13 -0
  4. package/dist/agent/context.js +183 -0
  5. package/dist/agent/context.js.map +1 -0
  6. package/dist/agent/loop.d.ts +60 -0
  7. package/dist/agent/loop.js +228 -0
  8. package/dist/agent/loop.js.map +1 -0
  9. package/dist/agent/session-store.d.ts +30 -0
  10. package/dist/agent/session-store.js +178 -0
  11. package/dist/agent/session-store.js.map +1 -0
  12. package/dist/agent/spawner.d.ts +57 -0
  13. package/dist/agent/spawner.js +112 -0
  14. package/dist/agent/spawner.js.map +1 -0
  15. package/dist/agent/system-prompt.d.ts +3 -0
  16. package/dist/agent/system-prompt.js +100 -0
  17. package/dist/agent/system-prompt.js.map +1 -0
  18. package/dist/architect/engine.d.ts +47 -0
  19. package/dist/architect/engine.js +217 -0
  20. package/dist/architect/engine.js.map +1 -0
  21. package/dist/architect/types.d.ts +61 -0
  22. package/dist/architect/types.js +6 -0
  23. package/dist/architect/types.js.map +1 -0
  24. package/dist/cli/diamond.d.ts +1 -0
  25. package/dist/cli/diamond.js +23 -0
  26. package/dist/cli/diamond.js.map +1 -0
  27. package/dist/cli/display.d.ts +44 -0
  28. package/dist/cli/display.js +234 -0
  29. package/dist/cli/display.js.map +1 -0
  30. package/dist/cli/index.d.ts +2 -0
  31. package/dist/cli/index.js +1734 -0
  32. package/dist/cli/index.js.map +1 -0
  33. package/dist/config/defaults.d.ts +46 -0
  34. package/dist/config/defaults.js +106 -0
  35. package/dist/config/defaults.js.map +1 -0
  36. package/dist/config/project-config.d.ts +90 -0
  37. package/dist/config/project-config.js +141 -0
  38. package/dist/config/project-config.js.map +1 -0
  39. package/dist/harness/proposer.d.ts +26 -0
  40. package/dist/harness/proposer.js +204 -0
  41. package/dist/harness/proposer.js.map +1 -0
  42. package/dist/harness/weakness-miner.d.ts +28 -0
  43. package/dist/harness/weakness-miner.js +359 -0
  44. package/dist/harness/weakness-miner.js.map +1 -0
  45. package/dist/integrations/harnesses.d.ts +23 -0
  46. package/dist/integrations/harnesses.js +161 -0
  47. package/dist/integrations/harnesses.js.map +1 -0
  48. package/dist/orchestration/competence.d.ts +53 -0
  49. package/dist/orchestration/competence.js +181 -0
  50. package/dist/orchestration/competence.js.map +1 -0
  51. package/dist/orchestration/executor.d.ts +42 -0
  52. package/dist/orchestration/executor.js +206 -0
  53. package/dist/orchestration/executor.js.map +1 -0
  54. package/dist/orchestration/index.d.ts +20 -0
  55. package/dist/orchestration/index.js +39 -0
  56. package/dist/orchestration/index.js.map +1 -0
  57. package/dist/orchestration/orchestrator-prompts.d.ts +11 -0
  58. package/dist/orchestration/orchestrator-prompts.js +153 -0
  59. package/dist/orchestration/orchestrator-prompts.js.map +1 -0
  60. package/dist/orchestration/orchestrator.d.ts +27 -0
  61. package/dist/orchestration/orchestrator.js +169 -0
  62. package/dist/orchestration/orchestrator.js.map +1 -0
  63. package/dist/orchestration/plan-store.d.ts +53 -0
  64. package/dist/orchestration/plan-store.js +176 -0
  65. package/dist/orchestration/plan-store.js.map +1 -0
  66. package/dist/orchestration/router-prompts.d.ts +6 -0
  67. package/dist/orchestration/router-prompts.js +55 -0
  68. package/dist/orchestration/router-prompts.js.map +1 -0
  69. package/dist/orchestration/router.d.ts +23 -0
  70. package/dist/orchestration/router.js +70 -0
  71. package/dist/orchestration/router.js.map +1 -0
  72. package/dist/orchestration/ruby-detect.d.ts +6 -0
  73. package/dist/orchestration/ruby-detect.js +130 -0
  74. package/dist/orchestration/ruby-detect.js.map +1 -0
  75. package/dist/orchestration/ruby-types.d.ts +44 -0
  76. package/dist/orchestration/ruby-types.js +6 -0
  77. package/dist/orchestration/ruby-types.js.map +1 -0
  78. package/dist/orchestration/specialist-prompts.d.ts +19 -0
  79. package/dist/orchestration/specialist-prompts.js +143 -0
  80. package/dist/orchestration/specialist-prompts.js.map +1 -0
  81. package/dist/orchestration/specialists.d.ts +66 -0
  82. package/dist/orchestration/specialists.js +175 -0
  83. package/dist/orchestration/specialists.js.map +1 -0
  84. package/dist/orchestration/types.d.ts +82 -0
  85. package/dist/orchestration/types.js +6 -0
  86. package/dist/orchestration/types.js.map +1 -0
  87. package/dist/perception/extractor.d.ts +7 -0
  88. package/dist/perception/extractor.js +521 -0
  89. package/dist/perception/extractor.js.map +1 -0
  90. package/dist/perception/graph-store.d.ts +25 -0
  91. package/dist/perception/graph-store.js +117 -0
  92. package/dist/perception/graph-store.js.map +1 -0
  93. package/dist/perception/index.d.ts +4 -0
  94. package/dist/perception/index.js +18 -0
  95. package/dist/perception/index.js.map +1 -0
  96. package/dist/perception/queries.d.ts +29 -0
  97. package/dist/perception/queries.js +354 -0
  98. package/dist/perception/queries.js.map +1 -0
  99. package/dist/perception/types.d.ts +103 -0
  100. package/dist/perception/types.js +6 -0
  101. package/dist/perception/types.js.map +1 -0
  102. package/dist/providers/anthropic.d.ts +11 -0
  103. package/dist/providers/anthropic.js +172 -0
  104. package/dist/providers/anthropic.js.map +1 -0
  105. package/dist/providers/factory.d.ts +58 -0
  106. package/dist/providers/factory.js +354 -0
  107. package/dist/providers/factory.js.map +1 -0
  108. package/dist/providers/fallback.d.ts +24 -0
  109. package/dist/providers/fallback.js +72 -0
  110. package/dist/providers/fallback.js.map +1 -0
  111. package/dist/providers/google.d.ts +11 -0
  112. package/dist/providers/google.js +129 -0
  113. package/dist/providers/google.js.map +1 -0
  114. package/dist/providers/openai-compatible.d.ts +24 -0
  115. package/dist/providers/openai-compatible.js +216 -0
  116. package/dist/providers/openai-compatible.js.map +1 -0
  117. package/dist/providers/resilient-factory.d.ts +24 -0
  118. package/dist/providers/resilient-factory.js +57 -0
  119. package/dist/providers/resilient-factory.js.map +1 -0
  120. package/dist/providers/resilient.d.ts +63 -0
  121. package/dist/providers/resilient.js +145 -0
  122. package/dist/providers/resilient.js.map +1 -0
  123. package/dist/providers/types.d.ts +84 -0
  124. package/dist/providers/types.js +6 -0
  125. package/dist/providers/types.js.map +1 -0
  126. package/dist/ruby/alternator.d.ts +40 -0
  127. package/dist/ruby/alternator.js +233 -0
  128. package/dist/ruby/alternator.js.map +1 -0
  129. package/dist/ruby/competence.d.ts +34 -0
  130. package/dist/ruby/competence.js +264 -0
  131. package/dist/ruby/competence.js.map +1 -0
  132. package/dist/ruby/episode-capture.d.ts +56 -0
  133. package/dist/ruby/episode-capture.js +193 -0
  134. package/dist/ruby/episode-capture.js.map +1 -0
  135. package/dist/ruby/fine-tune.d.ts +16 -0
  136. package/dist/ruby/fine-tune.js +253 -0
  137. package/dist/ruby/fine-tune.js.map +1 -0
  138. package/dist/ruby/index.d.ts +10 -0
  139. package/dist/ruby/index.js +26 -0
  140. package/dist/ruby/index.js.map +1 -0
  141. package/dist/ruby/ruby-model.d.ts +36 -0
  142. package/dist/ruby/ruby-model.js +81 -0
  143. package/dist/ruby/ruby-model.js.map +1 -0
  144. package/dist/ruby/training-data.d.ts +11 -0
  145. package/dist/ruby/training-data.js +107 -0
  146. package/dist/ruby/training-data.js.map +1 -0
  147. package/dist/ruby/types.d.ts +136 -0
  148. package/dist/ruby/types.js +20 -0
  149. package/dist/ruby/types.js.map +1 -0
  150. package/dist/safety/permissions.d.ts +32 -0
  151. package/dist/safety/permissions.js +304 -0
  152. package/dist/safety/permissions.js.map +1 -0
  153. package/dist/server/index.d.ts +9 -0
  154. package/dist/server/index.js +342 -0
  155. package/dist/server/index.js.map +1 -0
  156. package/dist/server/session.d.ts +22 -0
  157. package/dist/server/session.js +16 -0
  158. package/dist/server/session.js.map +1 -0
  159. package/dist/setup/first-run.d.ts +41 -0
  160. package/dist/setup/first-run.js +386 -0
  161. package/dist/setup/first-run.js.map +1 -0
  162. package/dist/setup/global-config.d.ts +19 -0
  163. package/dist/setup/global-config.js +97 -0
  164. package/dist/setup/global-config.js.map +1 -0
  165. package/dist/tools/audio-transcribe.d.ts +8 -0
  166. package/dist/tools/audio-transcribe.js +156 -0
  167. package/dist/tools/audio-transcribe.js.map +1 -0
  168. package/dist/tools/browser.d.ts +15 -0
  169. package/dist/tools/browser.js +241 -0
  170. package/dist/tools/browser.js.map +1 -0
  171. package/dist/tools/calendar.d.ts +12 -0
  172. package/dist/tools/calendar.js +196 -0
  173. package/dist/tools/calendar.js.map +1 -0
  174. package/dist/tools/clipboard.d.ts +7 -0
  175. package/dist/tools/clipboard.js +90 -0
  176. package/dist/tools/clipboard.js.map +1 -0
  177. package/dist/tools/cron.d.ts +10 -0
  178. package/dist/tools/cron.js +167 -0
  179. package/dist/tools/cron.js.map +1 -0
  180. package/dist/tools/edit-file.d.ts +6 -0
  181. package/dist/tools/edit-file.js +98 -0
  182. package/dist/tools/edit-file.js.map +1 -0
  183. package/dist/tools/email.d.ts +11 -0
  184. package/dist/tools/email.js +153 -0
  185. package/dist/tools/email.js.map +1 -0
  186. package/dist/tools/git.d.ts +1 -0
  187. package/dist/tools/git.js +7 -0
  188. package/dist/tools/git.js.map +1 -0
  189. package/dist/tools/http-request.d.ts +12 -0
  190. package/dist/tools/http-request.js +91 -0
  191. package/dist/tools/http-request.js.map +1 -0
  192. package/dist/tools/image-read.d.ts +7 -0
  193. package/dist/tools/image-read.js +125 -0
  194. package/dist/tools/image-read.js.map +1 -0
  195. package/dist/tools/index.d.ts +3 -0
  196. package/dist/tools/index.js +201 -0
  197. package/dist/tools/index.js.map +1 -0
  198. package/dist/tools/list-dir.d.ts +1 -0
  199. package/dist/tools/list-dir.js +6 -0
  200. package/dist/tools/list-dir.js.map +1 -0
  201. package/dist/tools/mcp.d.ts +11 -0
  202. package/dist/tools/mcp.js +356 -0
  203. package/dist/tools/mcp.js.map +1 -0
  204. package/dist/tools/memory.d.ts +9 -0
  205. package/dist/tools/memory.js +124 -0
  206. package/dist/tools/memory.js.map +1 -0
  207. package/dist/tools/notify.d.ts +9 -0
  208. package/dist/tools/notify.js +40 -0
  209. package/dist/tools/notify.js.map +1 -0
  210. package/dist/tools/read-file.d.ts +6 -0
  211. package/dist/tools/read-file.js +76 -0
  212. package/dist/tools/read-file.js.map +1 -0
  213. package/dist/tools/run-shell.d.ts +1 -0
  214. package/dist/tools/run-shell.js +6 -0
  215. package/dist/tools/run-shell.js.map +1 -0
  216. package/dist/tools/run-tests.d.ts +1 -0
  217. package/dist/tools/run-tests.js +6 -0
  218. package/dist/tools/run-tests.js.map +1 -0
  219. package/dist/tools/search-code.d.ts +1 -0
  220. package/dist/tools/search-code.js +6 -0
  221. package/dist/tools/search-code.js.map +1 -0
  222. package/dist/tools/telegram-bot.d.ts +2 -0
  223. package/dist/tools/telegram-bot.js +693 -0
  224. package/dist/tools/telegram-bot.js.map +1 -0
  225. package/dist/tools/telegram-safety.d.ts +52 -0
  226. package/dist/tools/telegram-safety.js +189 -0
  227. package/dist/tools/telegram-safety.js.map +1 -0
  228. package/dist/tools/telegram.d.ts +16 -0
  229. package/dist/tools/telegram.js +227 -0
  230. package/dist/tools/telegram.js.map +1 -0
  231. package/dist/tools/tools.d.ts +48 -0
  232. package/dist/tools/tools.js +328 -0
  233. package/dist/tools/tools.js.map +1 -0
  234. package/dist/tools/web-fetch.d.ts +11 -0
  235. package/dist/tools/web-fetch.js +119 -0
  236. package/dist/tools/web-fetch.js.map +1 -0
  237. package/dist/tools/web-search.d.ts +8 -0
  238. package/dist/tools/web-search.js +81 -0
  239. package/dist/tools/web-search.js.map +1 -0
  240. package/dist/tools/whatsapp.d.ts +10 -0
  241. package/dist/tools/whatsapp.js +222 -0
  242. package/dist/tools/whatsapp.js.map +1 -0
  243. package/dist/tools/write-file.d.ts +1 -0
  244. package/dist/tools/write-file.js +6 -0
  245. package/dist/tools/write-file.js.map +1 -0
  246. package/dist/tools/youtube-transcript.d.ts +9 -0
  247. package/dist/tools/youtube-transcript.js +200 -0
  248. package/dist/tools/youtube-transcript.js.map +1 -0
  249. package/dist/util/circuit-breaker.d.ts +44 -0
  250. package/dist/util/circuit-breaker.js +78 -0
  251. package/dist/util/circuit-breaker.js.map +1 -0
  252. package/dist/util/env.d.ts +18 -0
  253. package/dist/util/env.js +39 -0
  254. package/dist/util/env.js.map +1 -0
  255. package/dist/util/errors.d.ts +42 -0
  256. package/dist/util/errors.js +121 -0
  257. package/dist/util/errors.js.map +1 -0
  258. package/dist/util/rate-limiter.d.ts +71 -0
  259. package/dist/util/rate-limiter.js +141 -0
  260. package/dist/util/rate-limiter.js.map +1 -0
  261. package/dist/util/retry.d.ts +30 -0
  262. package/dist/util/retry.js +57 -0
  263. package/dist/util/retry.js.map +1 -0
  264. package/dist/util/sanitize.d.ts +16 -0
  265. package/dist/util/sanitize.js +255 -0
  266. package/dist/util/sanitize.js.map +1 -0
  267. package/dist/verify/checks.d.ts +21 -0
  268. package/dist/verify/checks.js +311 -0
  269. package/dist/verify/checks.js.map +1 -0
  270. package/dist/verify/index.d.ts +33 -0
  271. package/dist/verify/index.js +127 -0
  272. package/dist/verify/index.js.map +1 -0
  273. package/dist/verify/types.d.ts +20 -0
  274. package/dist/verify/types.js +3 -0
  275. package/dist/verify/types.js.map +1 -0
  276. package/dist/versioncheck.d.ts +22 -0
  277. package/dist/versioncheck.js +203 -0
  278. package/dist/versioncheck.js.map +1 -0
  279. package/dist/viz/index.d.ts +2 -0
  280. package/dist/viz/index.js +733 -0
  281. package/dist/viz/index.js.map +1 -0
  282. package/dist/workflows/engine.d.ts +46 -0
  283. package/dist/workflows/engine.js +320 -0
  284. package/dist/workflows/engine.js.map +1 -0
  285. package/dist/workflows/types.d.ts +92 -0
  286. package/dist/workflows/types.js +6 -0
  287. package/dist/workflows/types.js.map +1 -0
  288. package/package.json +86 -0
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REVIEWER_SYSTEM_PROMPT = exports.RESEARCHER_SYSTEM_PROMPT = void 0;
4
+ exports.CODER_CONTEXT_TEMPLATE = CODER_CONTEXT_TEMPLATE;
5
+ // ─────────────────────────────────────────────────────────────────────────────
6
+ // Researcher system prompt
7
+ // ─────────────────────────────────────────────────────────────────────────────
8
+ /**
9
+ * System prompt for the researcher specialist.
10
+ * The researcher is read-only: it gathers context, identifies patterns, and
11
+ * produces structured summaries. It must never write or modify files.
12
+ */
13
+ exports.RESEARCHER_SYSTEM_PROMPT = `You are the Research specialist for Aura — a multi-agent coding system.
14
+
15
+ ## Your role
16
+ You gather context, read code, and produce structured analysis. You have only
17
+ read-only tools. You never create, edit, or delete files.
18
+
19
+ ## Your process
20
+ 1. READ everything relevant to the task — do not guess or assume.
21
+ 2. FOLLOW import chains and dependency graphs to understand relationships.
22
+ 3. IDENTIFY patterns, conventions, and constraints in the codebase.
23
+ 4. OUTPUT a structured summary in the exact format below.
24
+
25
+ ## Output format
26
+ After you have gathered sufficient information, ouput ONLY the following
27
+ structured summary. No markdown fences, no extra prose — just the raw sections:
28
+
29
+ ---
30
+ KEY FILES FOUND
31
+ - path/to/file.ts — brief description of what it contains and why it matters
32
+ - path/to/another.ts — brief description
33
+ ...
34
+
35
+ IMPORTANT PATTERNS
36
+ - pattern description (e.g. "all middleware exports a factory function")
37
+ ...
38
+
39
+ DEPENDENCIES DISCOVERED
40
+ - file-a.ts depends on file-b.ts (via import of X)
41
+ - external: package-name (used in N files)
42
+ ...
43
+
44
+ RISKS IDENTIFIED
45
+ - risk description (e.g. "auth.ts has no error boundaries on line 42")
46
+ ...
47
+
48
+ ---
49
+
50
+ ## Rules
51
+ - NEVER write, edit, or delete files.
52
+ - Always read files before reporting on them.
53
+ - If a file is large, use line ranges to focus on the relevant sections.
54
+ - Prefer search_code to find patterns across the codebase.
55
+ - If you cannot find enough information, say so explicitly rather than guessing.
56
+ - Keep your analysis focused on the task at hand — don't wander.
57
+ - Spend at most 2 turns reading/gathering, then produce your summary.`;
58
+ // ─────────────────────────────────────────────────────────────────────────────
59
+ // Reviewer system prompt
60
+ // ─────────────────────────────────────────────────────────────────────────────
61
+ /**
62
+ * System prompt for the reviewer specialist.
63
+ * The reviewer checks correctness, security, style, and test coverage. It is
64
+ * read-only and MUST output issues in a structured JSON format.
65
+ */
66
+ exports.REVIEWER_SYSTEM_PROMPT = `You are the Review specialist for Aura — a multi-agent coding system.
67
+
68
+ ## Your role
69
+ You review code changes for correctness, security, test coverage, and style
70
+ consistency. You have only read-only tools. You never create, edit, or delete files.
71
+
72
+ ## Your process
73
+ 1. READ the files that were modified — check the diff with git_diff.
74
+ 2. READ related files that may be impacted.
75
+ 3. CHECK for:
76
+ - Correctness: logic errors, edge cases, off-by-one errors.
77
+ - Security: injection risks, leaked secrets, unsafe input handling.
78
+ - Test coverage: are new paths tested? Do existing tests still pass?
79
+ - Style consistency: does the change follow existing conventions?
80
+ 4. OUTPUT a structured issues list.
81
+
82
+ ## Output format
83
+ After you have completed your review, output ONLY a valid JSON object:
84
+
85
+ {
86
+ "issues": [
87
+ {
88
+ "severity": "critical" | "major" | "minor",
89
+ "description": "What the issue is",
90
+ "location": "file.ts:line-number"
91
+ }
92
+ ]
93
+ }
94
+
95
+ If you find no issues, output exactly:
96
+ { "issues": [] }
97
+ and then clearly state: "No issues found."
98
+
99
+ ## Severity guide
100
+ - critical — security vulnerability, data loss, or crash-on-start
101
+ - major — incorrect behaviour, missing error handling, broken test
102
+ - minor — style drift, missing comment, unnecessary verbosity
103
+
104
+ ## Rules
105
+ - NEVER write, edit, or delete files.
106
+ - Never approve code that introduces security vulnerabilities.
107
+ - If you find a critical issue, state it first and be explicit about the risk.
108
+ - Do not flag issues you cannot verify — if unsure, omit it rather than misattribute.
109
+ - Each issue must include a specific file path and line number.`;
110
+ // ─────────────────────────────────────────────────────────────────────────────
111
+ // Coder context template
112
+ // ─────────────────────────────────────────────────────────────────────────────
113
+ /**
114
+ * Builds the context block injected into the coder's task description.
115
+ * Includes step-specific scope, relevant memory from prior steps, and an
116
+ * explicit instruction to stay focused on the assigned task.
117
+ */
118
+ function CODER_CONTEXT_TEMPLATE(step, memory) {
119
+ const lines = [];
120
+ lines.push('## Step context');
121
+ lines.push(`Step id: ${step.id}`);
122
+ lines.push(`Scope: ${step.context}`);
123
+ if (memory.length > 0) {
124
+ lines.push('');
125
+ lines.push('## Relevant findings from previous steps');
126
+ for (const entry of memory) {
127
+ if (entry.stepId === step.id)
128
+ continue; // skip own output
129
+ // Only include memory entries that seem relevant — all entries are fair game
130
+ // since the orchestrator already filtered them.
131
+ lines.push(`[${entry.key}] ${entry.value.slice(0, 300)}`);
132
+ }
133
+ }
134
+ lines.push('');
135
+ lines.push('## Instructions');
136
+ lines.push('Only touch files relevant to this specific task. Do not refactor');
137
+ lines.push('unrelated code. Do not modify files from previous steps unless the');
138
+ lines.push('task explicitly requires it. After implementing, verify with run_tests.');
139
+ lines.push('');
140
+ lines.push(`Task: ${step.task}`);
141
+ return lines.join('\n');
142
+ }
143
+ //# sourceMappingURL=specialist-prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specialist-prompts.js","sourceRoot":"","sources":["../../src/orchestration/specialist-prompts.ts"],"names":[],"mappings":";;;AAwHA,wDA8BC;AApJD,gFAAgF;AAChF,2BAA2B;AAC3B,gFAAgF;AAEhF;;;;GAIG;AACU,QAAA,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sEA4C8B,CAAC;AAEvE,gFAAgF;AAChF,yBAAyB;AACzB,gFAAgF;AAEhF;;;;GAIG;AACU,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEA2C0B,CAAC;AAEjE,gFAAgF;AAChF,yBAAyB;AACzB,gFAAgF;AAEhF;;;;GAIG;AACH,SAAgB,sBAAsB,CACpC,IAAc,EACd,MAA6B;IAE7B,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC9B,KAAK,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAClC,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAErC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QACvD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,EAAE;gBAAE,SAAS,CAAC,kBAAkB;YAC1D,6EAA6E;YAC7E,gDAAgD;YAChD,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC9B,KAAK,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;IAC/E,KAAK,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;IACjF,KAAK,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;IACtF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAEjC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,66 @@
1
+ import type { LLMProvider } from '../providers/types.js';
2
+ import type { ProjectContext } from '../agent/context.js';
3
+ import type { PlanStep, OrchestrationMemory } from './types.js';
4
+ import type { ProjectPerception } from '../perception/types.js';
5
+ import type { Display } from '../cli/display.js';
6
+ /** Configuration passed to every specialist invocation. */
7
+ export interface SpecialistOptions {
8
+ /** LLM provider used for this step. */
9
+ provider: LLMProvider;
10
+ /** Loaded project context. */
11
+ context: ProjectContext;
12
+ /** Optional perception snapshot for context-aware execution. */
13
+ perception?: ProjectPerception;
14
+ /** The plan step to execute. */
15
+ step: PlanStep;
16
+ /** Memory entries from previously completed steps. */
17
+ memory: OrchestrationMemory[];
18
+ /** Display interface for progress output. */
19
+ display: Display;
20
+ /** Optional abort signal for cancellation. */
21
+ signal?: AbortSignal;
22
+ }
23
+ /** Structured result returned by every specialist. */
24
+ export interface SpecialistResult {
25
+ /** The specialist's output — research summary, review result, or implementation log. */
26
+ result: string;
27
+ /** Whether the step completed successfully. */
28
+ success: boolean;
29
+ /** Total tokens consumed (input + output). */
30
+ tokensUsed: number;
31
+ /** Wall-clock duration of the step in milliseconds. */
32
+ durationMs: number;
33
+ /** id of the PlanStep this result corresponds to. */
34
+ stepId: string;
35
+ }
36
+ /**
37
+ * Execute a research step.
38
+ * Runs within read-only permissions so the agent cannot create, edit, or
39
+ * delete files. The researcher system prompt is prepended to the task so
40
+ * the agent follows the structured output format.
41
+ */
42
+ export declare function runResearcher(opts: SpecialistOptions): Promise<SpecialistResult>;
43
+ /**
44
+ * Execute a review step.
45
+ * Runs within read-only permissions so the agent cannot create, edit, or
46
+ * delete files. The reviewer system prompt is prepended to the task so
47
+ * the agent follows the structured issues format.
48
+ */
49
+ export declare function runReviewer(opts: SpecialistOptions): Promise<SpecialistResult>;
50
+ /**
51
+ * Execute a coding step.
52
+ * The coder has full tool access (normal permissions). Step context and
53
+ * relevant memory are injected into the task description via
54
+ * `CODER_CONTEXT_TEMPLATE`.
55
+ */
56
+ export declare function runCoder(opts: SpecialistOptions): Promise<SpecialistResult>;
57
+ /**
58
+ * Dispatches to the correct specialist based on `step.specialist`.
59
+ * - `researcher` → runResearcher
60
+ * - `reviewer` → runReviewer
61
+ * - `coder` → runCoder
62
+ * - `planner` → runResearcher (read-only planning, same constraints)
63
+ *
64
+ * Catches all errors and returns an error message as the result. Never throws.
65
+ */
66
+ export declare function runSpecialist(opts: SpecialistOptions): Promise<SpecialistResult>;
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runResearcher = runResearcher;
4
+ exports.runReviewer = runReviewer;
5
+ exports.runCoder = runCoder;
6
+ exports.runSpecialist = runSpecialist;
7
+ const loop_js_1 = require("../agent/loop.js");
8
+ const permissions_js_1 = require("../safety/permissions.js");
9
+ const specialist_prompts_js_1 = require("./specialist-prompts.js");
10
+ const defaults_js_1 = require("../config/defaults.js");
11
+ // ─────────────────────────────────────────────────────────────────────────────
12
+ // runResearcher
13
+ // ─────────────────────────────────────────────────────────────────────────────
14
+ /**
15
+ * Execute a research step.
16
+ * Runs within read-only permissions so the agent cannot create, edit, or
17
+ * delete files. The researcher system prompt is prepended to the task so
18
+ * the agent follows the structured output format.
19
+ */
20
+ async function runResearcher(opts) {
21
+ const start = Date.now();
22
+ const task = `${specialist_prompts_js_1.RESEARCHER_SYSTEM_PROMPT}\n\n---\n\n${buildTask(opts)}`;
23
+ try {
24
+ const result = await (0, loop_js_1.runAgentLoop)({
25
+ provider: opts.provider,
26
+ task,
27
+ context: opts.context,
28
+ permissions: new permissions_js_1.PermissionSystem('read-only'),
29
+ display: opts.display,
30
+ maxTurns: 10,
31
+ pricingModel: opts.provider.model,
32
+ });
33
+ return {
34
+ result: result.summary,
35
+ success: result.success,
36
+ tokensUsed: result.usage.totalTokens,
37
+ durationMs: Date.now() - start,
38
+ stepId: opts.step.id,
39
+ };
40
+ }
41
+ catch (e) {
42
+ return failResult(opts.step.id, `Research error: ${String(e)}`, Date.now() - start);
43
+ }
44
+ }
45
+ // ─────────────────────────────────────────────────────────────────────────────
46
+ // runReviewer
47
+ // ─────────────────────────────────────────────────────────────────────────────
48
+ /**
49
+ * Execute a review step.
50
+ * Runs within read-only permissions so the agent cannot create, edit, or
51
+ * delete files. The reviewer system prompt is prepended to the task so
52
+ * the agent follows the structured issues format.
53
+ */
54
+ async function runReviewer(opts) {
55
+ const start = Date.now();
56
+ const task = `${specialist_prompts_js_1.REVIEWER_SYSTEM_PROMPT}\n\n---\n\n${buildTask(opts)}`;
57
+ try {
58
+ const result = await (0, loop_js_1.runAgentLoop)({
59
+ provider: opts.provider,
60
+ task,
61
+ context: opts.context,
62
+ permissions: new permissions_js_1.PermissionSystem('read-only'),
63
+ display: opts.display,
64
+ maxTurns: 10,
65
+ pricingModel: opts.provider.model,
66
+ });
67
+ return {
68
+ result: result.summary,
69
+ success: result.success,
70
+ tokensUsed: result.usage.totalTokens,
71
+ durationMs: Date.now() - start,
72
+ stepId: opts.step.id,
73
+ };
74
+ }
75
+ catch (e) {
76
+ return failResult(opts.step.id, `Review error: ${String(e)}`, Date.now() - start);
77
+ }
78
+ }
79
+ // ─────────────────────────────────────────────────────────────────────────────
80
+ // runCoder
81
+ // ─────────────────────────────────────────────────────────────────────────────
82
+ /**
83
+ * Execute a coding step.
84
+ * The coder has full tool access (normal permissions). Step context and
85
+ * relevant memory are injected into the task description via
86
+ * `CODER_CONTEXT_TEMPLATE`.
87
+ */
88
+ async function runCoder(opts) {
89
+ const start = Date.now();
90
+ const task = (0, specialist_prompts_js_1.CODER_CONTEXT_TEMPLATE)(opts.step, opts.memory);
91
+ try {
92
+ const result = await (0, loop_js_1.runAgentLoop)({
93
+ provider: opts.provider,
94
+ task,
95
+ context: opts.context,
96
+ permissions: new permissions_js_1.PermissionSystem('normal'),
97
+ display: opts.display,
98
+ maxTurns: defaults_js_1.DEFAULTS.maxTurns,
99
+ pricingModel: opts.provider.model,
100
+ });
101
+ return {
102
+ result: result.summary,
103
+ success: result.success,
104
+ tokensUsed: result.usage.totalTokens,
105
+ durationMs: Date.now() - start,
106
+ stepId: opts.step.id,
107
+ };
108
+ }
109
+ catch (e) {
110
+ return failResult(opts.step.id, `Coder error: ${String(e)}`, Date.now() - start);
111
+ }
112
+ }
113
+ // ─────────────────────────────────────────────────────────────────────────────
114
+ // runSpecialist — dispatcher
115
+ // ─────────────────────────────────────────────────────────────────────────────
116
+ /**
117
+ * Dispatches to the correct specialist based on `step.specialist`.
118
+ * - `researcher` → runResearcher
119
+ * - `reviewer` → runReviewer
120
+ * - `coder` → runCoder
121
+ * - `planner` → runResearcher (read-only planning, same constraints)
122
+ *
123
+ * Catches all errors and returns an error message as the result. Never throws.
124
+ */
125
+ async function runSpecialist(opts) {
126
+ try {
127
+ switch (opts.step.specialist) {
128
+ case 'researcher':
129
+ return await runResearcher(opts);
130
+ case 'reviewer':
131
+ return await runReviewer(opts);
132
+ case 'coder':
133
+ return await runCoder(opts);
134
+ case 'planner':
135
+ return await runResearcher(opts);
136
+ default:
137
+ return failResult(opts.step.id, `Unknown specialist type: ${opts.step.specialist}`, 0);
138
+ }
139
+ }
140
+ catch (e) {
141
+ return failResult(opts.step.id, `Specialist error (${opts.step.specialist}): ${String(e)}`, 0);
142
+ }
143
+ }
144
+ // ─────────────────────────────────────────────────────────────────────────────
145
+ // Internal helpers
146
+ // ─────────────────────────────────────────────────────────────────────────────
147
+ function buildTask(opts) {
148
+ const lines = [];
149
+ lines.push(`Task: ${opts.step.task}`);
150
+ if (opts.step.context) {
151
+ lines.push('');
152
+ lines.push('Context:');
153
+ lines.push(opts.step.context);
154
+ }
155
+ if (opts.memory.length > 0) {
156
+ lines.push('');
157
+ lines.push('Relevant findings from previous steps:');
158
+ for (const entry of opts.memory) {
159
+ if (entry.stepId === opts.step.id)
160
+ continue;
161
+ lines.push(` [${entry.key}] ${entry.value.slice(0, 300)}`);
162
+ }
163
+ }
164
+ return lines.join('\n');
165
+ }
166
+ function failResult(stepId, message, durationMs) {
167
+ return {
168
+ result: message,
169
+ success: false,
170
+ tokensUsed: 0,
171
+ durationMs,
172
+ stepId,
173
+ };
174
+ }
175
+ //# sourceMappingURL=specialists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specialists.js","sourceRoot":"","sources":["../../src/orchestration/specialists.ts"],"names":[],"mappings":";;AAwDA,sCAyBC;AAYD,kCAyBC;AAYD,4BAyBC;AAeD,sCAiBC;AA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AAC,CAAC;AAC1B,CAAC;AAED,SAAS,UAAU,CAAC,MAAc,EAAE,OAAe,EAAE,UAAkB;IACrE,OAAO;QACL,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,CAAC;QACb,UAAU;QACV,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,82 @@
1
+ /** A single unit of work assigned to one specialist agent. */
2
+ export interface PlanStep {
3
+ /** Stable unique identifier for this step within the plan. */
4
+ id: string;
5
+ /**
6
+ * Which specialist role executes this step.
7
+ * - `researcher` — gathers context, reads files, queries perception graph
8
+ * - `coder` — writes or modifies source files
9
+ * - `reviewer` — validates correctness, style, and constraints
10
+ * - `planner` — decomposes sub-goals when the original plan needs revision
11
+ */
12
+ specialist: 'researcher' | 'coder' | 'reviewer' | 'planner';
13
+ /** Human-readable description of what this step must accomplish. */
14
+ task: string;
15
+ /** Relevant background injected into the specialist's system prompt. */
16
+ context: string;
17
+ /** ids of steps that must reach `done` before this step may start. */
18
+ dependsOn: string[];
19
+ /** Output produced by the specialist once the step finishes. */
20
+ result?: string;
21
+ /**
22
+ * Lifecycle state of this step.
23
+ * - `waiting` — blocked on `dependsOn`
24
+ * - `running` — currently executing
25
+ * - `done` — completed successfully
26
+ * - `failed` — terminated with an error
27
+ * - `skipped` — bypassed because a dependency failed
28
+ */
29
+ status: 'waiting' | 'running' | 'done' | 'failed' | 'skipped';
30
+ /** Total tokens consumed by the specialist during this step. */
31
+ tokensUsed?: number;
32
+ /** Wall-clock time the step took to complete, in milliseconds. */
33
+ durationMs?: number;
34
+ }
35
+ /** A decomposed, ordered work plan produced by the orchestrator for a goal. */
36
+ export interface ExecutionPlan {
37
+ /** Unique identifier for this plan (used as the on-disk filename). */
38
+ id: string;
39
+ /** The original user goal that triggered plan creation. */
40
+ goal: string;
41
+ /** Ordered list of steps; may be executed concurrently where deps allow. */
42
+ steps: PlanStep[];
43
+ /**
44
+ * Lifecycle state of the overall plan.
45
+ * - `pending` — created but not yet started
46
+ * - `running` — at least one step is executing
47
+ * - `done` — all steps reached `done`
48
+ * - `failed` — a step failed and execution halted
49
+ * - `aborted` — cancelled by the user or a safety guard
50
+ */
51
+ status: 'pending' | 'running' | 'done' | 'failed' | 'aborted';
52
+ /** Unix timestamp (ms) when this plan was created. */
53
+ created: number;
54
+ /** Unix timestamp (ms) when the plan reached a terminal state. */
55
+ completed?: number;
56
+ /** Aggregate token count across all steps. */
57
+ totalTokens?: number;
58
+ /** Final summary written by the orchestrator after all steps finish. */
59
+ outcome?: string;
60
+ }
61
+ /** A single key-value fact persisted to the project's orchestration memory. */
62
+ export interface OrchestrationMemory {
63
+ /** Logical key used to retrieve this entry later (e.g. "auth_strategy"). */
64
+ key: string;
65
+ /** The remembered value — free-form string, may be serialised JSON. */
66
+ value: string;
67
+ /** id of the PlanStep that wrote this entry. */
68
+ stepId: string;
69
+ /** Unix timestamp (ms) when this entry was written. */
70
+ timestamp: number;
71
+ }
72
+ /** Output of the orchestrator's routing pass for an incoming goal. */
73
+ export interface RouterDecision {
74
+ /** Whether the goal should be decomposed into a multi-step plan. */
75
+ shouldDecompose: boolean;
76
+ /** Explanation of why the router reached this decision. */
77
+ reason: string;
78
+ /** Router's confidence in the decision, in [0, 1]. */
79
+ confidence: number;
80
+ /** Rough number of steps the router expects the plan will contain. */
81
+ estimatedSteps?: number;
82
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // ─────────────────────────────────────────────────────────────────────────────
3
+ // Execution plan steps
4
+ // ─────────────────────────────────────────────────────────────────────────────
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/orchestration/types.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,uBAAuB;AACvB,gFAAgF"}
@@ -0,0 +1,7 @@
1
+ import type { ProjectPerception } from './types.js';
2
+ /**
3
+ * Walk the project at `projectRoot` and build a full ProjectPerception snapshot.
4
+ * Reads the directory tree, parses imports and comments from every .ts/.js file,
5
+ * and extracts auxiliary information from README, CHANGELOG, config files, etc.
6
+ */
7
+ export declare function extractPerception(projectRoot: string): Promise<ProjectPerception>;