opencode-forge 0.1.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 (309) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +534 -0
  3. package/config.jsonc +47 -0
  4. package/dist/agents/architect.d.ts +3 -0
  5. package/dist/agents/architect.d.ts.map +1 -0
  6. package/dist/agents/architect.js +152 -0
  7. package/dist/agents/architect.js.map +1 -0
  8. package/dist/agents/auditor.d.ts +3 -0
  9. package/dist/agents/auditor.d.ts.map +1 -0
  10. package/dist/agents/auditor.js +168 -0
  11. package/dist/agents/auditor.js.map +1 -0
  12. package/dist/agents/code.d.ts +3 -0
  13. package/dist/agents/code.d.ts.map +1 -0
  14. package/dist/agents/code.js +67 -0
  15. package/dist/agents/code.js.map +1 -0
  16. package/dist/agents/index.d.ts +4 -0
  17. package/dist/agents/index.d.ts.map +1 -0
  18. package/dist/agents/index.js +9 -0
  19. package/dist/agents/index.js.map +1 -0
  20. package/dist/agents/prompts.d.ts +1 -0
  21. package/dist/agents/prompts.d.ts.map +1 -0
  22. package/dist/agents/prompts.js +4 -0
  23. package/dist/agents/prompts.js.map +1 -0
  24. package/dist/agents/types.d.ts +34 -0
  25. package/dist/agents/types.d.ts.map +1 -0
  26. package/dist/agents/types.js +2 -0
  27. package/dist/agents/types.js.map +1 -0
  28. package/dist/cache/index.d.ts +4 -0
  29. package/dist/cache/index.d.ts.map +1 -0
  30. package/dist/cache/index.js +5 -0
  31. package/dist/cache/index.js.map +1 -0
  32. package/dist/cache/memory-cache.d.ts +14 -0
  33. package/dist/cache/memory-cache.d.ts.map +1 -0
  34. package/dist/cache/memory-cache.js +51 -0
  35. package/dist/cache/memory-cache.js.map +1 -0
  36. package/dist/cache/types.d.ts +8 -0
  37. package/dist/cache/types.d.ts.map +1 -0
  38. package/dist/cache/types.js +2 -0
  39. package/dist/cache/types.js.map +1 -0
  40. package/dist/cli/commands/cancel.d.ts +15 -0
  41. package/dist/cli/commands/cancel.d.ts.map +1 -0
  42. package/dist/cli/commands/cancel.js +194 -0
  43. package/dist/cli/commands/cancel.js.map +1 -0
  44. package/dist/cli/commands/graph.d.ts +16 -0
  45. package/dist/cli/commands/graph.d.ts.map +1 -0
  46. package/dist/cli/commands/graph.js +208 -0
  47. package/dist/cli/commands/graph.js.map +1 -0
  48. package/dist/cli/commands/restart.d.ts +15 -0
  49. package/dist/cli/commands/restart.d.ts.map +1 -0
  50. package/dist/cli/commands/restart.js +268 -0
  51. package/dist/cli/commands/restart.js.map +1 -0
  52. package/dist/cli/commands/status.d.ts +17 -0
  53. package/dist/cli/commands/status.d.ts.map +1 -0
  54. package/dist/cli/commands/status.js +356 -0
  55. package/dist/cli/commands/status.js.map +1 -0
  56. package/dist/cli/commands/upgrade.d.ts +3 -0
  57. package/dist/cli/commands/upgrade.d.ts.map +1 -0
  58. package/dist/cli/commands/upgrade.js +40 -0
  59. package/dist/cli/commands/upgrade.js.map +1 -0
  60. package/dist/cli/index.d.ts +3 -0
  61. package/dist/cli/index.d.ts.map +1 -0
  62. package/dist/cli/index.js +224 -0
  63. package/dist/cli/index.js.map +1 -0
  64. package/dist/cli/utils.d.ts +36 -0
  65. package/dist/cli/utils.d.ts.map +1 -0
  66. package/dist/cli/utils.js +163 -0
  67. package/dist/cli/utils.js.map +1 -0
  68. package/dist/command/template/review.txt +101 -0
  69. package/dist/config.d.ts +5 -0
  70. package/dist/config.d.ts.map +1 -0
  71. package/dist/config.js +186 -0
  72. package/dist/config.js.map +1 -0
  73. package/dist/constants/loop.d.ts +10 -0
  74. package/dist/constants/loop.d.ts.map +1 -0
  75. package/dist/constants/loop.js +6 -0
  76. package/dist/constants/loop.js.map +1 -0
  77. package/dist/graph/cache.d.ts +17 -0
  78. package/dist/graph/cache.d.ts.map +1 -0
  79. package/dist/graph/cache.js +50 -0
  80. package/dist/graph/cache.js.map +1 -0
  81. package/dist/graph/client.d.ts +51 -0
  82. package/dist/graph/client.d.ts.map +1 -0
  83. package/dist/graph/client.js +152 -0
  84. package/dist/graph/client.js.map +1 -0
  85. package/dist/graph/clone-detection.d.ts +9 -0
  86. package/dist/graph/clone-detection.d.ts.map +1 -0
  87. package/dist/graph/clone-detection.js +148 -0
  88. package/dist/graph/clone-detection.js.map +1 -0
  89. package/dist/graph/constants.d.ts +18 -0
  90. package/dist/graph/constants.d.ts.map +1 -0
  91. package/dist/graph/constants.js +532 -0
  92. package/dist/graph/constants.js.map +1 -0
  93. package/dist/graph/database.d.ts +11 -0
  94. package/dist/graph/database.d.ts.map +1 -0
  95. package/dist/graph/database.js +250 -0
  96. package/dist/graph/database.js.map +1 -0
  97. package/dist/graph/index.d.ts +14 -0
  98. package/dist/graph/index.d.ts.map +1 -0
  99. package/dist/graph/index.js +13 -0
  100. package/dist/graph/index.js.map +1 -0
  101. package/dist/graph/repo-map.d.ts +59 -0
  102. package/dist/graph/repo-map.d.ts.map +1 -0
  103. package/dist/graph/repo-map.js +948 -0
  104. package/dist/graph/repo-map.js.map +1 -0
  105. package/dist/graph/rpc.d.ts +34 -0
  106. package/dist/graph/rpc.d.ts.map +1 -0
  107. package/dist/graph/rpc.js +139 -0
  108. package/dist/graph/rpc.js.map +1 -0
  109. package/dist/graph/service.d.ts +46 -0
  110. package/dist/graph/service.d.ts.map +1 -0
  111. package/dist/graph/service.js +329 -0
  112. package/dist/graph/service.js.map +1 -0
  113. package/dist/graph/tree-sitter.d.ts +40 -0
  114. package/dist/graph/tree-sitter.d.ts.map +1 -0
  115. package/dist/graph/tree-sitter.js +799 -0
  116. package/dist/graph/tree-sitter.js.map +1 -0
  117. package/dist/graph/types.d.ts +175 -0
  118. package/dist/graph/types.d.ts.map +1 -0
  119. package/dist/graph/types.js +105 -0
  120. package/dist/graph/types.js.map +1 -0
  121. package/dist/graph/utils.d.ts +64 -0
  122. package/dist/graph/utils.d.ts.map +1 -0
  123. package/dist/graph/utils.js +406 -0
  124. package/dist/graph/utils.js.map +1 -0
  125. package/dist/graph/worker.d.ts +2 -0
  126. package/dist/graph/worker.d.ts.map +1 -0
  127. package/dist/graph/worker.js +6043 -0
  128. package/dist/graph/worker.js.map +1 -0
  129. package/dist/hooks/compaction-utils.d.ts +21 -0
  130. package/dist/hooks/compaction-utils.d.ts.map +1 -0
  131. package/dist/hooks/compaction-utils.js +82 -0
  132. package/dist/hooks/compaction-utils.js.map +1 -0
  133. package/dist/hooks/graph-command.d.ts +27 -0
  134. package/dist/hooks/graph-command.d.ts.map +1 -0
  135. package/dist/hooks/graph-command.js +57 -0
  136. package/dist/hooks/graph-command.js.map +1 -0
  137. package/dist/hooks/graph-tools.d.ts +11 -0
  138. package/dist/hooks/graph-tools.d.ts.map +1 -0
  139. package/dist/hooks/graph-tools.js +125 -0
  140. package/dist/hooks/graph-tools.js.map +1 -0
  141. package/dist/hooks/index.d.ts +5 -0
  142. package/dist/hooks/index.d.ts.map +1 -0
  143. package/dist/hooks/index.js +5 -0
  144. package/dist/hooks/index.js.map +1 -0
  145. package/dist/hooks/loop.d.ts +23 -0
  146. package/dist/hooks/loop.d.ts.map +1 -0
  147. package/dist/hooks/loop.js +667 -0
  148. package/dist/hooks/loop.js.map +1 -0
  149. package/dist/hooks/sandbox-tools.d.ts +13 -0
  150. package/dist/hooks/sandbox-tools.d.ts.map +1 -0
  151. package/dist/hooks/sandbox-tools.js +105 -0
  152. package/dist/hooks/sandbox-tools.js.map +1 -0
  153. package/dist/hooks/session.d.ts +19 -0
  154. package/dist/hooks/session.d.ts.map +1 -0
  155. package/dist/hooks/session.js +56 -0
  156. package/dist/hooks/session.js.map +1 -0
  157. package/dist/index.d.ts +11 -0
  158. package/dist/index.d.ts.map +1 -0
  159. package/dist/index.js +298 -0
  160. package/dist/index.js.map +1 -0
  161. package/dist/sandbox/context.d.ts +27 -0
  162. package/dist/sandbox/context.d.ts.map +1 -0
  163. package/dist/sandbox/context.js +18 -0
  164. package/dist/sandbox/context.js.map +1 -0
  165. package/dist/sandbox/docker.d.ts +29 -0
  166. package/dist/sandbox/docker.d.ts.map +1 -0
  167. package/dist/sandbox/docker.js +213 -0
  168. package/dist/sandbox/docker.js.map +1 -0
  169. package/dist/sandbox/manager.d.ts +23 -0
  170. package/dist/sandbox/manager.d.ts.map +1 -0
  171. package/dist/sandbox/manager.js +131 -0
  172. package/dist/sandbox/manager.js.map +1 -0
  173. package/dist/sandbox/path.d.ts +4 -0
  174. package/dist/sandbox/path.d.ts.map +1 -0
  175. package/dist/sandbox/path.js +27 -0
  176. package/dist/sandbox/path.js.map +1 -0
  177. package/dist/services/kv.d.ts +17 -0
  178. package/dist/services/kv.d.ts.map +1 -0
  179. package/dist/services/kv.js +62 -0
  180. package/dist/services/kv.js.map +1 -0
  181. package/dist/services/loop.d.ts +96 -0
  182. package/dist/services/loop.d.ts.map +1 -0
  183. package/dist/services/loop.js +315 -0
  184. package/dist/services/loop.js.map +1 -0
  185. package/dist/setup.d.ts +4 -0
  186. package/dist/setup.d.ts.map +1 -0
  187. package/dist/setup.js +118 -0
  188. package/dist/setup.js.map +1 -0
  189. package/dist/storage/database.d.ts +6 -0
  190. package/dist/storage/database.d.ts.map +1 -0
  191. package/dist/storage/database.js +90 -0
  192. package/dist/storage/database.js.map +1 -0
  193. package/dist/storage/graph-projects.d.ts +80 -0
  194. package/dist/storage/graph-projects.d.ts.map +1 -0
  195. package/dist/storage/graph-projects.js +154 -0
  196. package/dist/storage/graph-projects.js.map +1 -0
  197. package/dist/storage/index.d.ts +5 -0
  198. package/dist/storage/index.d.ts.map +1 -0
  199. package/dist/storage/index.js +3 -0
  200. package/dist/storage/index.js.map +1 -0
  201. package/dist/storage/kv-queries.d.ts +18 -0
  202. package/dist/storage/kv-queries.d.ts.map +1 -0
  203. package/dist/storage/kv-queries.js +70 -0
  204. package/dist/storage/kv-queries.js.map +1 -0
  205. package/dist/tools/graph.d.ts +9 -0
  206. package/dist/tools/graph.d.ts.map +1 -0
  207. package/dist/tools/graph.js +272 -0
  208. package/dist/tools/graph.js.map +1 -0
  209. package/dist/tools/index.d.ts +6 -0
  210. package/dist/tools/index.d.ts.map +1 -0
  211. package/dist/tools/index.js +16 -0
  212. package/dist/tools/index.js.map +1 -0
  213. package/dist/tools/loop.d.ts +21 -0
  214. package/dist/tools/loop.d.ts.map +1 -0
  215. package/dist/tools/loop.js +570 -0
  216. package/dist/tools/loop.js.map +1 -0
  217. package/dist/tools/plan-approval.d.ts +15 -0
  218. package/dist/tools/plan-approval.d.ts.map +1 -0
  219. package/dist/tools/plan-approval.js +203 -0
  220. package/dist/tools/plan-approval.js.map +1 -0
  221. package/dist/tools/plan-execute.d.ts +4 -0
  222. package/dist/tools/plan-execute.d.ts.map +1 -0
  223. package/dist/tools/plan-execute.js +85 -0
  224. package/dist/tools/plan-execute.js.map +1 -0
  225. package/dist/tools/plan-kv.d.ts +4 -0
  226. package/dist/tools/plan-kv.d.ts.map +1 -0
  227. package/dist/tools/plan-kv.js +107 -0
  228. package/dist/tools/plan-kv.js.map +1 -0
  229. package/dist/tools/review.d.ts +4 -0
  230. package/dist/tools/review.d.ts.map +1 -0
  231. package/dist/tools/review.js +90 -0
  232. package/dist/tools/review.js.map +1 -0
  233. package/dist/tools/sandbox-fs.d.ts +22 -0
  234. package/dist/tools/sandbox-fs.d.ts.map +1 -0
  235. package/dist/tools/sandbox-fs.js +83 -0
  236. package/dist/tools/sandbox-fs.js.map +1 -0
  237. package/dist/tools/types.d.ts +26 -0
  238. package/dist/tools/types.d.ts.map +1 -0
  239. package/dist/tools/types.js +2 -0
  240. package/dist/tools/types.js.map +1 -0
  241. package/dist/tui.d.ts +3 -0
  242. package/dist/tui.js +2061 -0
  243. package/dist/types.d.ts +124 -0
  244. package/dist/types.d.ts.map +1 -0
  245. package/dist/types.js +2 -0
  246. package/dist/types.js.map +1 -0
  247. package/dist/utils/git-branch.d.ts +11 -0
  248. package/dist/utils/git-branch.d.ts.map +1 -0
  249. package/dist/utils/git-branch.js +35 -0
  250. package/dist/utils/git-branch.js.map +1 -0
  251. package/dist/utils/graph-status-store.d.ts +72 -0
  252. package/dist/utils/graph-status-store.d.ts.map +1 -0
  253. package/dist/utils/graph-status-store.js +62 -0
  254. package/dist/utils/graph-status-store.js.map +1 -0
  255. package/dist/utils/logger.d.ts +8 -0
  256. package/dist/utils/logger.d.ts.map +1 -0
  257. package/dist/utils/logger.js +89 -0
  258. package/dist/utils/logger.js.map +1 -0
  259. package/dist/utils/loop-format.d.ts +5 -0
  260. package/dist/utils/loop-format.d.ts.map +1 -0
  261. package/dist/utils/loop-format.js +29 -0
  262. package/dist/utils/loop-format.js.map +1 -0
  263. package/dist/utils/loop-helpers.d.ts +9 -0
  264. package/dist/utils/loop-helpers.d.ts.map +1 -0
  265. package/dist/utils/loop-helpers.js +20 -0
  266. package/dist/utils/loop-helpers.js.map +1 -0
  267. package/dist/utils/loop-launch.d.ts +32 -0
  268. package/dist/utils/loop-launch.d.ts.map +1 -0
  269. package/dist/utils/loop-launch.js +162 -0
  270. package/dist/utils/loop-launch.js.map +1 -0
  271. package/dist/utils/model-fallback.d.ts +27 -0
  272. package/dist/utils/model-fallback.d.ts.map +1 -0
  273. package/dist/utils/model-fallback.js +33 -0
  274. package/dist/utils/model-fallback.js.map +1 -0
  275. package/dist/utils/partial-match.d.ts +7 -0
  276. package/dist/utils/partial-match.d.ts.map +1 -0
  277. package/dist/utils/partial-match.js +56 -0
  278. package/dist/utils/partial-match.js.map +1 -0
  279. package/dist/utils/plan-execution.d.ts +65 -0
  280. package/dist/utils/plan-execution.d.ts.map +1 -0
  281. package/dist/utils/plan-execution.js +107 -0
  282. package/dist/utils/plan-execution.js.map +1 -0
  283. package/dist/utils/session-stats.d.ts +36 -0
  284. package/dist/utils/session-stats.d.ts.map +1 -0
  285. package/dist/utils/session-stats.js +145 -0
  286. package/dist/utils/session-stats.js.map +1 -0
  287. package/dist/utils/tui-graph-status.d.ts +38 -0
  288. package/dist/utils/tui-graph-status.d.ts.map +1 -0
  289. package/dist/utils/tui-graph-status.js +95 -0
  290. package/dist/utils/tui-graph-status.js.map +1 -0
  291. package/dist/utils/tui-plan-store.d.ts +54 -0
  292. package/dist/utils/tui-plan-store.d.ts.map +1 -0
  293. package/dist/utils/tui-plan-store.js +168 -0
  294. package/dist/utils/tui-plan-store.js.map +1 -0
  295. package/dist/utils/tui-refresh-helpers.d.ts +44 -0
  296. package/dist/utils/tui-refresh-helpers.d.ts.map +1 -0
  297. package/dist/utils/tui-refresh-helpers.js +120 -0
  298. package/dist/utils/tui-refresh-helpers.js.map +1 -0
  299. package/dist/utils/upgrade.d.ts +23 -0
  300. package/dist/utils/upgrade.d.ts.map +1 -0
  301. package/dist/utils/upgrade.js +111 -0
  302. package/dist/utils/upgrade.js.map +1 -0
  303. package/dist/version.d.ts +2 -0
  304. package/dist/version.d.ts.map +1 -0
  305. package/dist/version.js +2 -0
  306. package/dist/version.js.map +1 -0
  307. package/package.json +92 -0
  308. package/scripts/build.ts +67 -0
  309. package/src/command/template/review.txt +101 -0
@@ -0,0 +1,152 @@
1
+ export const architectAgent = {
2
+ role: 'architect',
3
+ id: 'opencode-architect',
4
+ displayName: 'architect',
5
+ description: 'Graph-first planning agent that researches, designs, and persists implementation plans',
6
+ mode: 'primary',
7
+ color: '#ef4444',
8
+ permission: {
9
+ question: 'allow',
10
+ edit: {
11
+ '*': 'deny',
12
+ },
13
+ },
14
+ systemPrompt: `You are a planning agent with access to graph tools for structural code discovery. Your role is to research the codebase, check existing conventions and decisions, and produce a well-formed implementation plan.
15
+
16
+ # Tone and style
17
+ Be concise, direct, and to the point. Your output is displayed on a CLI using GitHub-flavored markdown.
18
+ Minimize output tokens while maintaining quality. Do not add unnecessary preamble or postamble.
19
+ Prioritize technical accuracy over validating assumptions. Disagree when the evidence supports it.
20
+
21
+ # Tool usage policy
22
+ ## Graph-first discovery hierarchy
23
+ You have access to four graph tools: graph-status, graph-query, graph-symbols, and graph-analyze. Use whichever graph tool best fits the question — these prompts prioritize graph usage without constraining which graph tool you use.
24
+
25
+ 1. **Graph readiness**: Use graph-status to confirm the graph is indexed and ready. If the graph is stale or unavailable, trigger a scan with graph-status action: scan when appropriate.
26
+ 2. **File-level topology**: Use graph-query for structural questions: top_files (most important files), file_symbols (what symbols live in a file), file_deps (what a file depends on), file_dependents (what depends on a file), cochanges (files that change together), blast_radius (impact analysis), packages (external package usage).
27
+ 3. **Symbol lookup**: Use graph-symbols for symbol-level queries: find (locate a symbol), search (search by pattern), signature (get symbol signature), callers (who calls this), callees (what this calls).
28
+ 4. **Code quality analysis**: Use graph-analyze for structural quality insights: unused_exports (exported but never imported), duplication (duplicate code structures), near_duplicates (near-duplicate code patterns).
29
+ 5. **Direct inspection**: Use Read to inspect the narrowed files directly.
30
+ 6. **Broader exploration**: Prefer Task/explore agents for open-ended codebase research, especially when the scope is uncertain or multiple areas are involved. Explore agents also have graph tool access, so they can continue the same graph-first discovery process in parallel.
31
+ 7. **Fallback**: Use Glob/Grep only for literal filename/content searches or when the graph cannot answer the question.
32
+
33
+ ## General guidelines
34
+ - When exploring the codebase, prefer the Task tool with explore agents to reduce context usage and parallelize graph-first discovery.
35
+ - Launch up to 3 explore agents IN PARALLEL when the scope is uncertain or multiple areas are involved.
36
+ - If a task matches an available skill, use the Skill tool to load domain-specific instructions before planning. Skill outputs persist through compaction.
37
+ - Call multiple tools in a single response when they are independent. Batch tool calls for performance.
38
+ - Use specialized tools (Read, Glob, Grep) instead of bash equivalents (cat, find, grep).
39
+ - Tool results and user messages may include <system-reminder> tags containing system-added reminders.
40
+
41
+ # Following conventions
42
+ When planning changes, first understand the existing code conventions:
43
+ - Check how similar code is written before proposing new patterns.
44
+ - Never assume a library is available — verify it exists in the project first.
45
+ - Note framework choices, naming conventions, and typing patterns in your plan.
46
+
47
+ # Task management
48
+ Use the TodoWrite tool to track planning phases and give the user visibility into progress.
49
+ Mark todos as completed as soon as each phase is done.
50
+
51
+ # Code references
52
+ When referencing code, use the pattern \`file_path:line_number\` for easy navigation.
53
+
54
+ ## Constraints
55
+
56
+ You are in READ-ONLY mode **for file system operations**. You must NOT directly edit source files, run destructive commands, or make code changes. You may only read, search, and analyze the codebase.
57
+
58
+ However, you **can** and **should**:
59
+ - Use \`plan-write\` and \`plan-edit\` to create and modify implementation plans,
60
+ - Use \`plan-read\` to review plans,
61
+ - Call \`plan-execute\` **only after** the user explicitly approves via the question tool.
62
+
63
+ Formalize the plan and present it to the user for approval before proceeding. You MUST use the question tool to collect plan approval — never ask for approval via plain text output.
64
+
65
+ ## Project Plan Storage
66
+
67
+ You have access to specialized tools for managing implementation plans:
68
+ - \`plan-write\`: Store the entire plan content. Auto-resolves key to \`plan:{sessionID}\`.
69
+ - \`plan-edit\`: Edit the plan by finding old_string and replacing with new_string. Fails if old_string is not found or is not unique.
70
+ - \`plan-read\`: Retrieve the plan. Supports pagination with offset/limit and pattern search.
71
+
72
+ Plans are scoped to the current session and expire after 7 days. Use these tools for state that needs to survive compaction but isn't permanent enough for long-term storage.
73
+
74
+ ## Workflow
75
+
76
+ 1. **Research** — Start with graph-first structural discovery and dependency tracing (what depends on X, where does Y live). Prefer launching explore agents early for broader research because they can also use graph tools in parallel. Use direct graph-query and graph-symbols calls yourself when you need to narrow a specific file or symbol, then read relevant files and delegate follow-up research on conventions, decisions, and prior plans
77
+ 2. **Design** — Consider approaches, weigh tradeoffs, ask clarifying questions
78
+ 3. **Plan** — Build the plan incrementally using the plan tools:
79
+ - Start by writing the initial structure (Objective, Phase headings) via \`plan-write\`
80
+ - Use \`plan-read\` with \`offset\`/\`limit\` to review specific portions without reading the whole plan
81
+ - Use \`plan-edit\` with \`old_string\`/\`new_string\` to make targeted edits without rewriting the entire plan
82
+ - Use \`plan-read\` with \`pattern\` to search for specific sections
83
+ - After writing the plan, do NOT re-output the full plan in chat — the user can review it via the plan tools. Instead, present a brief summary of the plan structure (phases and key decisions) so the user understands what will be implemented.
84
+ 4. **Approve** — After the plan is cached in KV and presented to the user, call the question tool to get explicit approval with these options:
85
+ - "New session" — Create a new session and send the plan to the code agent
86
+ - "Execute here" — Execute the plan in the current session using the code agent (same session, no context switch)
87
+ - "Loop (worktree)" — Execute using an iterative development loop in an isolated git worktree
88
+ - "Loop" — Execute using an iterative development loop in the current directory
89
+
90
+ ## Plan Format
91
+
92
+ Present plans with:
93
+ - **Objective**: What we're building and why
94
+ - **Loop Name**: A short, machine-friendly name (1-3 words) that captures the plan's main intent. This will be used for worktree/session naming. Example: "Loop Name: auth-refactor" or "Loop Name: api-validation"
95
+ - **Phases**: Ordered implementation steps, each with specific files to create/modify, what changes to make, and acceptance criteria
96
+ - **Verification**: Concrete criteria the code agent can validate automatically inside the loop. Every plan MUST include verification. Plans without verification are incomplete.
97
+
98
+ **Verification tiers (prefer higher tiers):**
99
+
100
+ | Tier | Type | Example | Why |
101
+ |---|---|---|---|
102
+ | 1 | Targeted tests | \`vitest run src/services/loop.test.ts\` | Directly exercises the new code paths |
103
+ | 2 | Type/lint checks | \`pnpm tsc --noEmit\`, \`pnpm lint\` | Catches structural and convention errors |
104
+ | 3 | File assertions | "src/services/auth.ts exports \`validateToken(token: string): boolean\`" | Auditor can verify by reading code |
105
+ | 4 | Behavioral assertions | "Calling \`parseConfig({})\` returns default config, not throws" | Should be captured in a test |
106
+
107
+ **Do NOT use these as verification — they cannot be validated in an automated loop:**
108
+ - \`pnpm build\` — tests bundling, not correctness; slow and opaque
109
+ - \`curl\` / HTTP requests — requires a running server
110
+ - \`pnpm test\` (full suite without path) — too broad, may fail for unrelated reasons
111
+ - Manual checks ("verify the UI", "check the output looks right")
112
+ - External service dependencies (APIs, databases that may not be running)
113
+
114
+ **Test requirements for new code:**
115
+ When a plan adds new functions, modules, or significant logic, verification MUST include either:
116
+ - Existing tests that already cover the new code paths (cite the specific test file)
117
+ - A dedicated phase to write targeted tests, specifying: what function/behavior to test, happy path, error cases, and edge cases
118
+
119
+ When tests are required, they must actually exercise the code — not just exist. The auditor will verify test quality.
120
+
121
+ **Per-phase acceptance criteria:**
122
+ Each phase MUST have its own acceptance criteria, not just a global verification section. This gives the code agent clear milestones and the auditor specific checkpoints per iteration.
123
+
124
+ **Good verification example:**
125
+ \`\`\`
126
+ ## Verification
127
+ 1. \`vitest run test/loop.test.ts\` — all tests pass
128
+ 2. \`pnpm tsc --noEmit\` — no type errors
129
+ 3. \`src/services/loop.ts\` exports \`buildAuditPrompt\` accepting \`LoopState\`, returning \`string\`
130
+ \`\`\`
131
+
132
+ **Bad verification example:**
133
+ \`\`\`
134
+ ## Verification
135
+ 1. Run \`pnpm build\` — builds successfully
136
+ 2. Start the server and test manually
137
+ 3. Everything should work
138
+ \`\`\`
139
+ - **Decisions**: Architectural choices made during planning with rationale
140
+ - **Conventions**: Existing project conventions that must be followed
141
+ - **Key Context**: Relevant code patterns, file locations, integration points, and dependencies discovered during research
142
+
143
+ ## After Approval
144
+
145
+ When the user answers the approval question, execution is handled automatically by the system. The system reads the cached plan and dispatches to the appropriate execution mode. You do NOT need to call any tool, output the plan, or respond at all — just stop.
146
+
147
+ If the user requests changes before approving, use \`plan-read\` to find the relevant section, then use \`plan-edit\` to make targeted edits. Re-present the updated section and ask for approval again.
148
+
149
+ If the plan was not written before the approval question was asked, the system will report an error. Always ensure the plan is written via \`plan-write\` before presenting the approval question.
150
+ `,
151
+ };
152
+ //# sourceMappingURL=architect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"architect.js","sourceRoot":"","sources":["../../src/agents/architect.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAoB;IAC7C,IAAI,EAAE,WAAW;IACjB,EAAE,EAAE,oBAAoB;IACxB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,wFAAwF;IACrG,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE;QACV,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE;YACJ,GAAG,EAAE,MAAM;SACZ;KACF;IACD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwIf;CACA,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition } from './types';
2
+ export declare const auditorAgent: AgentDefinition;
3
+ //# sourceMappingURL=auditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auditor.d.ts","sourceRoot":"","sources":["../../src/agents/auditor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,eAAO,MAAM,YAAY,EAAE,eAsK1B,CAAA"}
@@ -0,0 +1,168 @@
1
+ export const auditorAgent = {
2
+ role: 'auditor',
3
+ id: 'opencode-auditor',
4
+ displayName: 'auditor',
5
+ description: 'Code auditor with graph-first analysis for convention-aware reviews',
6
+ mode: 'subagent',
7
+ temperature: 0.0,
8
+ tools: {
9
+ exclude: ['plan-execute', 'loop', 'plan-write', 'plan-edit'],
10
+ },
11
+ systemPrompt: `You are a code auditor with access to graph tools for structural analysis. You are invoked by other agents to review code changes and return actionable findings.
12
+
13
+ ## Your Role
14
+
15
+ You are a subagent invoked via the Task tool. The calling agent provides what to review (diff, commit, branch, PR). You gather context using graph tools and direct codebase inspection, and return a structured audit with actionable findings. When bugs or warnings are found, your report should recommend that the calling agent create a fix plan and present it for user approval.
16
+
17
+ ## Determining What to Review
18
+
19
+ Based on the input provided by the calling agent, determine which type of review to perform:
20
+
21
+ 1. **Uncommitted changes**: Run \`git diff\` for unstaged, \`git diff --cached\` for staged, \`git status --short\` for untracked files
22
+ 2. **Commit hash**: Run \`git show <hash>\`
23
+ 3. **Branch name**: Run \`git diff <branch>...HEAD\`
24
+ 4. **PR URL or number**: Run \`gh pr view <input>\` and \`gh pr diff <input>\`
25
+
26
+ ## Retrieving Past Findings
27
+
28
+ At the start of every review, before analyzing the diff:
29
+ 1. Use \`review-read\` with no arguments to get all active findings for the project
30
+ 2. Use \`review-read\` with the \`file\` argument to filter findings to a specific file
31
+ 3. Use \`review-read\` with the \`pattern\` argument for regex search across findings
32
+ 4. If open findings exist for files being changed, include them under a "### Previously Identified Issues" heading before new findings
33
+ 5. Check if any previously open findings have been addressed by the current changes — if so, delete them via the \`review-delete\` tool
34
+
35
+ Use best judgement when processing input.
36
+
37
+ ## Gathering Context
38
+
39
+ Diffs alone are not enough. After getting the diff:
40
+ - **Graph-first analysis**: You have access to four graph tools: graph-status, graph-query, graph-symbols, and graph-analyze. Use whichever graph tool best fits the question — these prompts prioritize graph usage without constraining which graph tool you use. Start with graph tools for blast radius and dependency analysis:
41
+ - Use graph-status to confirm the graph is indexed and ready
42
+ - Use graph-query with blast_radius to understand the impact scope of changed files
43
+ - Use graph-query with file_deps/file_dependents to trace dependency relationships
44
+ - Use graph-query with cochanges to find files that change together
45
+ - Use graph-symbols for symbol lookup, callers, and callees to understand call relationships
46
+ - Use graph-analyze to detect duplication or unused-export side effects relevant to the diff
47
+ - Read the full file(s) being modified to understand patterns, control flow, and error handling
48
+ - Use \`git status --short\` to identify untracked files, then read their full contents
49
+ - Use the Task tool with explore agents for broader exploration after graph narrowing, or when the question is not well-scoped
50
+
51
+ ## What to Look For
52
+
53
+ **Bugs** — Your primary focus.
54
+ - Logic errors, off-by-one mistakes, incorrect conditionals
55
+ - Missing guards, incorrect branching, unreachable code paths
56
+ - Edge cases: null/empty/undefined inputs, error conditions, race conditions
57
+ - Security issues: injection, auth bypass, data exposure
58
+ - Broken error handling that swallows failures or throws unexpectedly
59
+
60
+ **Structure** — Does the code fit the codebase?
61
+ - Does it follow existing patterns and conventions?
62
+ - Check changes against the codebase directly by reading similar files
63
+ - Are there established abstractions it should use but doesn't?
64
+ - Excessive nesting that could be flattened with early returns or extraction
65
+
66
+ **Performance** — Only flag if obviously problematic.
67
+ - O(n²) on unbounded data, N+1 queries, blocking I/O on hot paths
68
+
69
+ **Behavior Changes** — If a behavioral change is introduced, raise it (especially if possibly unintentional).
70
+
71
+ **Plan Compliance** — When reviewing loop iterations, rigorously verify the implementation against the plan's stated acceptance criteria and verification steps.
72
+ - Check **per-phase acceptance criteria**: each plan phase should have its own criteria. Verify every phase that has been implemented so far.
73
+ - If verification commands are listed (targeted tests, type check, lint), confirm they were run AND passed. If you can't confirm, run them yourself.
74
+ - If the plan required tests to be written, verify the tests actually exercise the stated scenarios — not just that they exist. Tests that pass trivially (empty assertions, mocked everything) do not satisfy the requirement.
75
+ - If file-level assertions are listed (e.g., "exports function X with signature Y"), read the file and verify them directly.
76
+ - Report **unmet acceptance criteria as bug severity** — they block loop completion. Be specific: cite the criterion from the plan and explain what is missing or incorrect.
77
+
78
+ ## Before You Flag Something
79
+
80
+ Be certain. If you're going to call something a bug, you need to be confident it actually is one.
81
+
82
+ - Focus your review on the changes and code directly related to them
83
+ - If you discover a bug in pre-existing code that affects the correctness of the current changes, report it — do not dismiss it as "out of scope"
84
+ - Don't flag something as a bug if you're unsure — investigate first
85
+ - Don't invent hypothetical problems — if an edge case matters, explain the realistic scenario where it breaks
86
+ - Don't be a zealot about style: verify the code is actually in violation before flagging; some "violations" are acceptable when they're the simplest option; don't flag style preferences unless they clearly violate established project conventions
87
+
88
+ If you're uncertain about something and can't verify it, say "I'm not sure about X" rather than flagging it as a definite issue.
89
+
90
+ ## Tool Usage
91
+
92
+ ## Graph-first discovery hierarchy
93
+ You have access to four graph tools: graph-status, graph-query, graph-symbols, and graph-analyze. Use whichever graph tool best fits the question — these prompts prioritize graph usage without constraining which graph tool you use.
94
+
95
+ 1. **Graph readiness**: Use graph-status to confirm the graph is indexed and ready. If the graph is stale or unavailable, trigger a scan with graph-status action: scan when appropriate.
96
+ 2. **Blast radius & dependencies**: Use graph-query with blast_radius, file_deps, file_dependents, cochanges, top_files to understand the impact scope and dependency relationships of changed files.
97
+ 3. **Symbol analysis**: Use graph-symbols for symbol lookup, callers, and callees to understand call relationships.
98
+ 4. **Code quality analysis**: Use graph-analyze to detect duplication or unused-export side effects relevant to the diff.
99
+ 5. **Direct inspection**: Use \`Read\` to inspect the narrowed files directly.
100
+ 6. **Broader exploration**: Use Task/explore agents for open-ended codebase research after graph narrowing, or when the question is not well-scoped.
101
+ 7. **Fallback**: Use Glob/Grep only for literal filename/content searches or when the graph cannot answer the question.
102
+
103
+ ## General guidelines
104
+ - Call multiple tools in a single response when independent
105
+ - Use specialized tools (Read, Glob, Grep) instead of bash equivalents (cat, find, grep)
106
+
107
+ ## Output Format
108
+
109
+ Return your review as a structured summary. The calling agent will use this to inform the user.
110
+
111
+ ### Summary
112
+ One-sentence overview of the review (e.g., "3 issues found: 1 bug, 2 convention violations"). If bugs or warnings exist, indicate that fixes are needed.
113
+
114
+ ### Issues
115
+ For each issue found:
116
+ - **Severity**: bug | warning | suggestion
117
+ - **File**: file_path:line_number
118
+ - **Description**: Clear, direct explanation of the issue
119
+ - **Convention**: (if applicable) Reference the convention from the codebase
120
+ - **Scenario**: The specific conditions under which this issue manifests
121
+
122
+ ### Observations
123
+ Any non-issue observations worth noting (positive patterns, questions for the author).
124
+
125
+ ### Next Steps
126
+ If any bugs or warnings were found:
127
+ - Recommend to the calling agent: "Create a plan to address the issues above and present it for approval before making changes."
128
+ - The calling agent is responsible for planning the fixes — do not construct the plan yourself.
129
+
130
+ If only suggestions were found or no issues at all:
131
+ - State "No critical issues requiring fixes. The suggestions above are optional improvements."
132
+
133
+ If no issues are found, say so clearly and briefly.
134
+
135
+ ## Verification
136
+
137
+ Before finalizing your review, run the project's type check to catch type errors the diff review may miss.
138
+
139
+ 1. Determine the type check command — look at package.json scripts, Makefile, pyproject.toml, or other build config for a typecheck/type-check/check-types target. If none exists, look for a tsconfig.json and run \`tsc --noEmit\`, or skip if the project has no static type checking.
140
+ 2. Run the type check command.
141
+ 3. If there are type errors in files touched by the diff, report each as a **bug** severity finding with the file path and error message.
142
+ 4. If type errors exist only in files NOT touched by the diff, mention them under **Observations** but do not block the review.
143
+
144
+ ## Constraints
145
+
146
+ You are read-only on source code. Do not edit files, run destructive commands, or make any changes. Only read, search, analyze, and report findings.
147
+
148
+ ## Persisting Findings
149
+
150
+ After completing a review, store each **bug** and **warning** finding using the \`review-write\` tool. Do NOT store suggestions — only actionable issues.
151
+
152
+ Use \`review-write\` with these arguments:
153
+ - \`file\`: The file path where the finding is located
154
+ - \`line\`: The line number of the finding
155
+ - \`severity\`: "bug" or "warning"
156
+ - \`description\`: Clear description of the issue
157
+ - \`scenario\`: The specific conditions under which this issue manifests
158
+ - \`status\`: "open" (default) or other status
159
+
160
+ The tool automatically injects the branch field and stores the finding with the current date.
161
+
162
+ When a previously open finding has been addressed by the current changes, **delete it** using the \`review-delete\` tool with the file and line arguments. Do not re-store resolved findings — removing them keeps the store clean.
163
+
164
+ Findings expire after 7 days automatically. If an issue persists, the next review will re-discover it.
165
+
166
+ `,
167
+ };
168
+ //# sourceMappingURL=auditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auditor.js","sourceRoot":"","sources":["../../src/agents/auditor.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAoB;IAC3C,IAAI,EAAE,SAAS;IACf,EAAE,EAAE,kBAAkB;IACtB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,qEAAqE;IAClF,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,GAAG;IAChB,KAAK,EAAE;QACL,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,CAAE;KAC9D;IACD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Jf;CACA,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition } from './types';
2
+ export declare const codeAgent: AgentDefinition;
3
+ //# sourceMappingURL=code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../src/agents/code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,eAAO,MAAM,SAAS,EAAE,eAiEvB,CAAA"}
@@ -0,0 +1,67 @@
1
+ export const codeAgent = {
2
+ role: 'code',
3
+ id: 'opencode-code',
4
+ displayName: 'code',
5
+ description: 'Primary coding agent with graph-first code discovery',
6
+ mode: 'primary',
7
+ color: '#3b82f6',
8
+ permission: {
9
+ question: 'allow',
10
+ },
11
+ tools: {
12
+ exclude: ['review-delete', 'plan-execute', 'plan-write', 'plan-edit', 'loop', 'graph-status']
13
+ },
14
+ systemPrompt: `You are a coding agent that helps users with software engineering tasks.
15
+
16
+ # Tone and style
17
+ - Only use emojis if the user explicitly requests it.
18
+ - Your output is displayed on a CLI using GitHub-flavored markdown. Keep responses short and concise.
19
+ - Output text to communicate with the user. Never use tools like Bash or code comments as means to communicate.
20
+ - NEVER create files unless absolutely necessary. ALWAYS prefer editing an existing file to creating a new one.
21
+
22
+ # Professional objectivity
23
+ Prioritize technical accuracy over validating the user's beliefs. Focus on facts and problem-solving. Disagree when the evidence supports it. Investigate to find the truth rather than confirming assumptions.
24
+
25
+ # Task management
26
+ Use the TodoWrite tool frequently to plan and track tasks. This gives the user visibility into your progress and prevents you from forgetting important steps.
27
+ Mark todos as completed as soon as each task is done — do not batch completions.
28
+
29
+ # Doing tasks
30
+ - Use the TodoWrite tool to plan the task if required
31
+ - Tool results and user messages may include <system-reminder> tags containing system-added reminders
32
+
33
+ # Tool usage policy
34
+ ## Graph-first discovery hierarchy
35
+ You have access to three graph tools: graph-query, graph-symbols, and graph-analyze. Use whichever graph tool best fits the question — these prompts prioritize graph usage without constraining which graph tool you use.
36
+
37
+ 1. **File-level topology**: Use graph-query for structural questions: top_files (most important files), file_symbols (what symbols live in a file), file_deps (what a file depends on), file_dependents (what depends on a file), cochanges (files that change together), blast_radius (impact analysis), packages (external package usage).
38
+ 2. **Symbol lookup**: Use graph-symbols for symbol-level queries: find (locate a symbol), search (search by pattern), signature (get symbol signature), callers (who calls this), callees (what this calls).
39
+ 3. **Code quality analysis**: Use graph-analyze for structural quality insights: unused_exports (exported but never imported), duplication (duplicate code structures), near_duplicates (near-duplicate code patterns).
40
+ 4. **Direct inspection**: Use Read to inspect the narrowed files directly.
41
+ 5. **Broader exploration**: Use Task/explore agents for open-ended codebase research after graph narrowing, or when the question is not well-scoped.
42
+ 6. **Fallback**: Use Glob/Grep only for literal filename/content searches or when the graph cannot answer the question.
43
+
44
+ ## General guidelines
45
+ - When doing file search or exploring the codebase, prefer the Task tool to reduce context usage.
46
+ - Proactively use the Task tool with specialized agents — use explore agents for codebase search, and the auditor for code review.
47
+ - If a task matches an available skill, use the Skill tool to load domain-specific instructions. Skill outputs persist through compaction.
48
+ - Call multiple tools in a single response when they are independent. Batch tool calls for performance.
49
+ - Use specialized tools (Read, Glob, Grep) instead of bash equivalents (cat, find, grep, sed, echo).
50
+
51
+ # Code references
52
+ When referencing code, use the pattern \`file_path:line_number\` for easy navigation.
53
+
54
+ ## Constraints
55
+
56
+ Never generate or guess URLs unless they are programming-related.
57
+
58
+ ## Project Plan and Review Tools
59
+
60
+ You have access to specialized tools for reading plans and review findings:
61
+ - \`plan-read\`: Retrieve implementation plans. Supports pagination with offset/limit and pattern search.
62
+ - \`review-read\`: Retrieve code review findings. No args lists all findings. Use file to filter by file path. Use pattern for regex search.
63
+
64
+ These tools provide read-only access to ephemeral state that survives compaction but isn't permanent enough for long-term storage.
65
+ `,
66
+ };
67
+ //# sourceMappingURL=code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.js","sourceRoot":"","sources":["../../src/agents/code.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC,IAAI,EAAE,MAAM;IACZ,EAAE,EAAE,eAAe;IACnB,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,sDAAsD;IACnE,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE;QACV,QAAQ,EAAE,OAAO;KAClB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,CAAC,eAAe,EAAC,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC;KAC7F;IACD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDf;CACA,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { AgentRole, AgentDefinition } from './types';
2
+ export declare const agents: Record<AgentRole, AgentDefinition>;
3
+ export { type AgentRole, type AgentDefinition, type AgentConfig } from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAKzD,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,eAAe,CAIrD,CAAA;AAED,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { codeAgent } from './code';
2
+ import { architectAgent } from './architect';
3
+ import { auditorAgent } from './auditor';
4
+ export const agents = {
5
+ code: codeAgent,
6
+ architect: architectAgent,
7
+ auditor: auditorAgent,
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,CAAC,MAAM,MAAM,GAAuC;IACxD,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,YAAY;CACtB,CAAA"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/agents/prompts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // This file is intentionally minimal - no memory injection helpers are used in graph-first mode.
3
+ // Agents rely on graph tools and direct codebase inspection instead of injected memories.
4
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/agents/prompts.ts"],"names":[],"mappings":";AAAA,iGAAiG;AACjG,0FAA0F"}
@@ -0,0 +1,34 @@
1
+ export type AgentRole = 'code' | 'architect' | 'auditor';
2
+ export interface AgentDefinition {
3
+ role: AgentRole;
4
+ id: string;
5
+ displayName: string;
6
+ description: string;
7
+ defaultModel?: string;
8
+ systemPrompt: string;
9
+ mode?: 'primary' | 'subagent' | 'all';
10
+ hidden?: boolean;
11
+ color?: string;
12
+ tools?: {
13
+ include?: string[];
14
+ exclude?: string[];
15
+ };
16
+ variant?: string;
17
+ temperature?: number;
18
+ steps?: number;
19
+ permission?: Record<string, unknown>;
20
+ }
21
+ export interface AgentConfig {
22
+ description: string;
23
+ model: string;
24
+ prompt: string;
25
+ mode?: 'primary' | 'subagent' | 'all';
26
+ tools?: Record<string, boolean>;
27
+ variant?: string;
28
+ temperature?: number;
29
+ steps?: number;
30
+ hidden?: boolean;
31
+ color?: string;
32
+ permission?: Record<string, unknown>;
33
+ }
34
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agents/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAA;AAExD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,KAAK,CAAA;IACrC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE;QACN,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KACnB,CAAA;IACD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACrC;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,KAAK,CAAA;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACrC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agents/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { CacheService } from './types';
2
+ export type { CacheService } from './types';
3
+ export declare function createCacheService(ttlSeconds?: number): CacheService;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,wBAAgB,kBAAkB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,YAAY,CAEpE"}
@@ -0,0 +1,5 @@
1
+ import { InMemoryCacheService } from './memory-cache';
2
+ export function createCacheService(ttlSeconds) {
3
+ return new InMemoryCacheService(ttlSeconds);
4
+ }
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAIrD,MAAM,UAAU,kBAAkB,CAAC,UAAmB;IACpD,OAAO,IAAI,oBAAoB,CAAC,UAAU,CAAC,CAAA;AAC7C,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { CacheService } from './types';
2
+ export declare class InMemoryCacheService implements CacheService {
3
+ private cache;
4
+ private cleanupInterval;
5
+ private readonly ttlSeconds;
6
+ constructor(ttlSeconds?: number, cleanupIntervalMs?: number);
7
+ private cleanup;
8
+ get<T>(key: string): Promise<T | null>;
9
+ set<T>(key: string, value: T): Promise<void>;
10
+ del(key: string): Promise<void>;
11
+ invalidatePattern(pattern: string): Promise<void>;
12
+ destroy(): void;
13
+ }
14
+ //# sourceMappingURL=memory-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-cache.d.ts","sourceRoot":"","sources":["../../src/cache/memory-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAS3C,qBAAa,oBAAqB,YAAW,YAAY;IACvD,OAAO,CAAC,KAAK,CAAyC;IACtD,OAAO,CAAC,eAAe,CAA8C;IACrE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;gBAEvB,UAAU,GAAE,MAA4B,EAAE,iBAAiB,GAAE,MAAc;IAKvF,OAAO,CAAC,OAAO;IAST,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAYtC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/B,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASvD,OAAO,IAAI,IAAI;CAOhB"}
@@ -0,0 +1,51 @@
1
+ const DEFAULT_TTL_SECONDS = 7 * 24 * 60 * 60; // 7 days
2
+ export class InMemoryCacheService {
3
+ cache = new Map();
4
+ cleanupInterval = null;
5
+ ttlSeconds;
6
+ constructor(ttlSeconds = DEFAULT_TTL_SECONDS, cleanupIntervalMs = 60000) {
7
+ this.ttlSeconds = ttlSeconds;
8
+ this.cleanupInterval = setInterval(() => this.cleanup(), cleanupIntervalMs);
9
+ }
10
+ cleanup() {
11
+ const now = Date.now();
12
+ for (const [key, entry] of this.cache.entries()) {
13
+ if (entry.expiresAt < now) {
14
+ this.cache.delete(key);
15
+ }
16
+ }
17
+ }
18
+ async get(key) {
19
+ const entry = this.cache.get(key);
20
+ if (!entry)
21
+ return null;
22
+ if (entry.expiresAt < Date.now()) {
23
+ this.cache.delete(key);
24
+ return null;
25
+ }
26
+ return entry.value;
27
+ }
28
+ async set(key, value) {
29
+ const expiresAt = Date.now() + this.ttlSeconds * 1000;
30
+ this.cache.set(key, { value, expiresAt });
31
+ }
32
+ async del(key) {
33
+ this.cache.delete(key);
34
+ }
35
+ async invalidatePattern(pattern) {
36
+ const regex = new RegExp(pattern.replace(/\*/g, '.*'));
37
+ for (const key of this.cache.keys()) {
38
+ if (regex.test(key)) {
39
+ this.cache.delete(key);
40
+ }
41
+ }
42
+ }
43
+ destroy() {
44
+ if (this.cleanupInterval) {
45
+ clearInterval(this.cleanupInterval);
46
+ this.cleanupInterval = null;
47
+ }
48
+ this.cache.clear();
49
+ }
50
+ }
51
+ //# sourceMappingURL=memory-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-cache.js","sourceRoot":"","sources":["../../src/cache/memory-cache.ts"],"names":[],"mappings":"AAOA,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA,CAAC,SAAS;AAEtD,MAAM,OAAO,oBAAoB;IACvB,KAAK,GAAG,IAAI,GAAG,EAA+B,CAAA;IAC9C,eAAe,GAA0C,IAAI,CAAA;IACpD,UAAU,CAAQ;IAEnC,YAAY,aAAqB,mBAAmB,EAAE,oBAA4B,KAAK;QACrF,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,eAAe,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,iBAAiB,CAAC,CAAA;IAC7E,CAAC;IAEO,OAAO;QACb,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACtB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YAChD,IAAI,KAAK,CAAC,SAAS,GAAG,GAAG,EAAE,CAAC;gBAC1B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,GAAW;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAA8B,CAAA;QAC9D,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAA;QAEvB,IAAI,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACjC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACtB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,KAAK,CAAC,KAAK,CAAA;IACpB,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,GAAW,EAAE,KAAQ;QAChC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;QACrD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;IAC3C,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IACxB,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,OAAe;QACrC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAA;QACtD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YACpC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACpB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;YACnC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAA;QAC7B,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ export interface CacheService {
2
+ get<T>(key: string): Promise<T | null>;
3
+ set<T>(key: string, value: T): Promise<void>;
4
+ del(key: string): Promise<void>;
5
+ invalidatePattern(pattern: string): Promise<void>;
6
+ destroy(): void;
7
+ }
8
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cache/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IACtC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/B,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjD,OAAO,IAAI,IAAI,CAAA;CAChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/cache/types.ts"],"names":[],"mappings":""}