neondeck 1.0.0-beta.4

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 (760) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/DEVELOPMENT.md +310 -0
  3. package/LICENSE +21 -0
  4. package/README.md +128 -0
  5. package/SOUL.md +8 -0
  6. package/bin/neondeck.mjs +27 -0
  7. package/config/dashboard.json +208 -0
  8. package/config/dashboard.schema.json +207 -0
  9. package/dist/SOUL.md +8 -0
  10. package/dist/assets/app-BuuvLo98.js +3620 -0
  11. package/dist/assets/app-BuuvLo98.js.map +1 -0
  12. package/dist/assets/autopilot-CKgEx8yQ.js +68025 -0
  13. package/dist/assets/autopilot-CKgEx8yQ.js.map +1 -0
  14. package/dist/assets/briefing-DYVbJaqk.js +2 -0
  15. package/dist/assets/briefing-DoO-fJr1.js +22 -0
  16. package/dist/assets/briefing-DoO-fJr1.js.map +1 -0
  17. package/dist/assets/command-run-B2TWLpLL.js +20 -0
  18. package/dist/assets/command-run-B2TWLpLL.js.map +1 -0
  19. package/dist/assets/command-run-CzQra_Y7.js +2 -0
  20. package/dist/assets/display-assistant-CbCRBSYM.js +389 -0
  21. package/dist/assets/display-assistant-CbCRBSYM.js.map +1 -0
  22. package/dist/assets/fix-pr-ci-BlUl-2ht.js +46 -0
  23. package/dist/assets/fix-pr-ci-BlUl-2ht.js.map +1 -0
  24. package/dist/assets/fix-pr-ci-Dl1wpKXp.js +2 -0
  25. package/dist/assets/migrations/20260710061339_neondeck_pre_1_0_baseline/migration.sql +748 -0
  26. package/dist/assets/migrations/20260710061339_neondeck_pre_1_0_baseline/snapshot.json +7240 -0
  27. package/dist/assets/prepare-pr-worktree-CLzccRYh.js +2 -0
  28. package/dist/assets/prepare-pr-worktree-DxyTygiU.js +17 -0
  29. package/dist/assets/prepare-pr-worktree-DxyTygiU.js.map +1 -0
  30. package/dist/assets/push-pr-autofix-BFNSEASU.js +2 -0
  31. package/dist/assets/push-pr-autofix-DlVjw1IN.js +17 -0
  32. package/dist/assets/push-pr-autofix-DlVjw1IN.js.map +1 -0
  33. package/dist/assets/review-pr-for-human-B2j8wz2L.js +2 -0
  34. package/dist/assets/review-pr-for-human-DcGE-7wb.js +708 -0
  35. package/dist/assets/review-pr-for-human-DcGE-7wb.js.map +1 -0
  36. package/dist/assets/safety-CawD9GxD.js +2499 -0
  37. package/dist/assets/safety-CawD9GxD.js.map +1 -0
  38. package/dist/assets/scheduled-agent-instruction-CQgogBv3.js +22 -0
  39. package/dist/assets/scheduled-agent-instruction-CQgogBv3.js.map +1 -0
  40. package/dist/assets/scheduled-agent-instruction-Dr2ebZRD.js +2 -0
  41. package/dist/assets/scheduler-tick-Cy26qBld.js +105 -0
  42. package/dist/assets/scheduler-tick-Cy26qBld.js.map +1 -0
  43. package/dist/assets/skills/github-gh/SKILL.md +56 -0
  44. package/dist/assets/skills/neon-ci-fix/SKILL.md +15 -0
  45. package/dist/assets/skills/neon-docs-fix/SKILL.md +15 -0
  46. package/dist/assets/skills/neon-issue-triage/SKILL.md +13 -0
  47. package/dist/assets/skills/neon-pr-review/SKILL.md +19 -0
  48. package/dist/assets/skills/neondeck/SKILL.md +123 -0
  49. package/dist/assets/skills/neondeck-handoff/SKILL.md +31 -0
  50. package/dist/assets/triage-pr-event-BlE3GKNR.js +17 -0
  51. package/dist/assets/triage-pr-event-BlE3GKNR.js.map +1 -0
  52. package/dist/assets/triage-pr-event-hxUP587F.js +2 -0
  53. package/dist/assets/verify-then-push-pr-autofix-CIl5ZwZm.js +2 -0
  54. package/dist/assets/verify-then-push-pr-autofix-Djy0UFUv.js +75 -0
  55. package/dist/assets/verify-then-push-pr-autofix-Djy0UFUv.js.map +1 -0
  56. package/dist/config/dashboard.json +208 -0
  57. package/dist/config/dashboard.schema.json +207 -0
  58. package/dist/server.mjs +582 -0
  59. package/dist/server.mjs.map +1 -0
  60. package/dist/skills/github-gh/SKILL.md +56 -0
  61. package/dist/skills/neon-ci-fix/SKILL.md +15 -0
  62. package/dist/skills/neon-docs-fix/SKILL.md +15 -0
  63. package/dist/skills/neon-issue-triage/SKILL.md +13 -0
  64. package/dist/skills/neon-pr-review/SKILL.md +19 -0
  65. package/dist/skills/neondeck/SKILL.md +123 -0
  66. package/dist/skills/neondeck-handoff/SKILL.md +31 -0
  67. package/drizzle.config.ts +7 -0
  68. package/package.json +155 -0
  69. package/shared/patch-anchors.ts +78 -0
  70. package/src/agents/busywork-workflow.ts +24 -0
  71. package/src/agents/display-assistant.ts +134 -0
  72. package/src/agents/pr-review-assistant.ts +25 -0
  73. package/src/agents/scheduler-workflow.ts +20 -0
  74. package/src/agents/support/tools.ts +346 -0
  75. package/src/app.ts +1 -0
  76. package/src/cli/index.ts +560 -0
  77. package/src/cli/learning.ts +44 -0
  78. package/src/cli/mcp.ts +496 -0
  79. package/src/cli/modules.ts +107 -0
  80. package/src/cli/onboarding.ts +667 -0
  81. package/src/cli/options.ts +103 -0
  82. package/src/cli/output.ts +399 -0
  83. package/src/cli/preapprovals.ts +204 -0
  84. package/src/cli/prompts.ts +108 -0
  85. package/src/cli/types.ts +59 -0
  86. package/src/db.ts +41 -0
  87. package/src/desktop/open.ts +698 -0
  88. package/src/desktop/service.ts +863 -0
  89. package/src/domains/mcp/actions.ts +420 -0
  90. package/src/domains/mcp/config.ts +501 -0
  91. package/src/domains/mcp/format.ts +35 -0
  92. package/src/domains/mcp/gate.ts +188 -0
  93. package/src/domains/mcp/index.ts +9 -0
  94. package/src/domains/mcp/instructions.ts +18 -0
  95. package/src/domains/mcp/oauth.ts +1063 -0
  96. package/src/domains/mcp/policy.ts +15 -0
  97. package/src/domains/mcp/registry.ts +461 -0
  98. package/src/domains/mcp/schemas.ts +171 -0
  99. package/src/domains/mcp/stdio.ts +451 -0
  100. package/src/domains/mcp/store.ts +905 -0
  101. package/src/domains/mcp/tools.ts +119 -0
  102. package/src/lib/action-result.ts +51 -0
  103. package/src/lib/exec.ts +118 -0
  104. package/src/lib/git.ts +20 -0
  105. package/src/lib/report-html.ts +193 -0
  106. package/src/lib/sqlite.ts +51 -0
  107. package/src/lib/valibot.ts +33 -0
  108. package/src/modules/app-state/index.ts +5 -0
  109. package/src/modules/app-state/native-notifications.ts +76 -0
  110. package/src/modules/app-state/notification-events.ts +45 -0
  111. package/src/modules/app-state/notifications.ts +276 -0
  112. package/src/modules/app-state/types.ts +42 -0
  113. package/src/modules/app-state/workflow-summaries.ts +201 -0
  114. package/src/modules/autonomous-audit/index.ts +225 -0
  115. package/src/modules/autopilot/actions.ts +165 -0
  116. package/src/modules/autopilot/admissions.ts +865 -0
  117. package/src/modules/autopilot/approvals.ts +59 -0
  118. package/src/modules/autopilot/ci-fix-run.ts +1332 -0
  119. package/src/modules/autopilot/ci-fix.ts +692 -0
  120. package/src/modules/autopilot/comments.ts +426 -0
  121. package/src/modules/autopilot/fixtures.ts +344 -0
  122. package/src/modules/autopilot/github-facts.ts +303 -0
  123. package/src/modules/autopilot/index.ts +64 -0
  124. package/src/modules/autopilot/notifications.ts +271 -0
  125. package/src/modules/autopilot/push-support.ts +288 -0
  126. package/src/modules/autopilot/push.ts +661 -0
  127. package/src/modules/autopilot/recovery.ts +656 -0
  128. package/src/modules/autopilot/review-feedback.ts +651 -0
  129. package/src/modules/autopilot/review-support.ts +524 -0
  130. package/src/modules/autopilot/revision-run.ts +445 -0
  131. package/src/modules/autopilot/schemas.ts +485 -0
  132. package/src/modules/autopilot/state-mappers.ts +512 -0
  133. package/src/modules/autopilot/state-schemas.ts +451 -0
  134. package/src/modules/autopilot/state-store.ts +183 -0
  135. package/src/modules/autopilot/state.ts +255 -0
  136. package/src/modules/autopilot/triage-support.ts +234 -0
  137. package/src/modules/autopilot/triage.ts +156 -0
  138. package/src/modules/autopilot/utils.ts +145 -0
  139. package/src/modules/autopilot/worktree.ts +622 -0
  140. package/src/modules/autopilot-policy/config.ts +110 -0
  141. package/src/modules/autopilot-policy/index.ts +4 -0
  142. package/src/modules/autopilot-policy/risk.ts +359 -0
  143. package/src/modules/autopilot-policy/schemas.ts +284 -0
  144. package/src/modules/autopilot-policy/service.ts +304 -0
  145. package/src/modules/commands/actions.ts +112 -0
  146. package/src/modules/commands/handlers/index.ts +3 -0
  147. package/src/modules/commands/handlers/misc.ts +441 -0
  148. package/src/modules/commands/handlers/queue.ts +694 -0
  149. package/src/modules/commands/handlers/repo.ts +339 -0
  150. package/src/modules/commands/index.ts +5 -0
  151. package/src/modules/commands/registry.ts +157 -0
  152. package/src/modules/commands/runner.ts +152 -0
  153. package/src/modules/commands/schemas.ts +107 -0
  154. package/src/modules/commands/summaries.ts +92 -0
  155. package/src/modules/commands/utils.ts +113 -0
  156. package/src/modules/config/actions.ts +253 -0
  157. package/src/modules/config/events.ts +80 -0
  158. package/src/modules/config/files.ts +9 -0
  159. package/src/modules/config/history.ts +74 -0
  160. package/src/modules/config/index.ts +9 -0
  161. package/src/modules/config/mutations/dashboard.ts +319 -0
  162. package/src/modules/config/mutations/execution.ts +89 -0
  163. package/src/modules/config/mutations/models.ts +467 -0
  164. package/src/modules/config/mutations/providers.ts +163 -0
  165. package/src/modules/config/mutations/repos.ts +620 -0
  166. package/src/modules/config/read.ts +135 -0
  167. package/src/modules/config/result.ts +66 -0
  168. package/src/modules/config/schemas.ts +181 -0
  169. package/src/modules/docs-drift/index.ts +1 -0
  170. package/src/modules/docs-drift/service.ts +863 -0
  171. package/src/modules/execution/actions.ts +35 -0
  172. package/src/modules/execution/approvals.ts +322 -0
  173. package/src/modules/execution/exedev/checkouts.ts +356 -0
  174. package/src/modules/execution/exedev/context.ts +286 -0
  175. package/src/modules/execution/index.ts +7 -0
  176. package/src/modules/execution/policy.ts +102 -0
  177. package/src/modules/execution/run.ts +589 -0
  178. package/src/modules/execution/schemas.ts +116 -0
  179. package/src/modules/execution/scope.ts +137 -0
  180. package/src/modules/execution/store.ts +320 -0
  181. package/src/modules/execution/utils.ts +105 -0
  182. package/src/modules/execution-policy/index.ts +424 -0
  183. package/src/modules/flue/execution-context.ts +41 -0
  184. package/src/modules/github/actions.ts +334 -0
  185. package/src/modules/github/checks.ts +484 -0
  186. package/src/modules/github/client.ts +110 -0
  187. package/src/modules/github/comments.ts +204 -0
  188. package/src/modules/github/errors.ts +50 -0
  189. package/src/modules/github/index.ts +92 -0
  190. package/src/modules/github/issues.ts +116 -0
  191. package/src/modules/github/pr-file-cache.ts +264 -0
  192. package/src/modules/github/pull-requests.ts +384 -0
  193. package/src/modules/github/queue.ts +342 -0
  194. package/src/modules/github/reviews.ts +1421 -0
  195. package/src/modules/github/schemas.ts +794 -0
  196. package/src/modules/github/state-truncation.ts +31 -0
  197. package/src/modules/handoff/index.ts +2 -0
  198. package/src/modules/handoff/schemas.ts +61 -0
  199. package/src/modules/handoff/service.ts +587 -0
  200. package/src/modules/hygiene/index.ts +1 -0
  201. package/src/modules/hygiene/service.ts +513 -0
  202. package/src/modules/kilo/actions.ts +229 -0
  203. package/src/modules/kilo/ci-fix-run-reconcile.ts +299 -0
  204. package/src/modules/kilo/docs-drift-boundary.ts +178 -0
  205. package/src/modules/kilo/index.ts +8 -0
  206. package/src/modules/kilo/notifications.ts +295 -0
  207. package/src/modules/kilo/process.ts +637 -0
  208. package/src/modules/kilo/results/actions.ts +66 -0
  209. package/src/modules/kilo/results/gates.ts +227 -0
  210. package/src/modules/kilo/results/index.ts +23 -0
  211. package/src/modules/kilo/results/schemas.ts +112 -0
  212. package/src/modules/kilo/results/service.ts +512 -0
  213. package/src/modules/kilo/results/state.ts +508 -0
  214. package/src/modules/kilo/results/verify.ts +328 -0
  215. package/src/modules/kilo/revision-reconcile.ts +187 -0
  216. package/src/modules/kilo/runtime-facts.ts +128 -0
  217. package/src/modules/kilo/schemas.ts +265 -0
  218. package/src/modules/kilo/service.ts +714 -0
  219. package/src/modules/kilo/sessions-adapters.ts +343 -0
  220. package/src/modules/kilo/sessions.ts +446 -0
  221. package/src/modules/kilo/store.ts +689 -0
  222. package/src/modules/kilo/utils.ts +166 -0
  223. package/src/modules/learning/automation-health.ts +441 -0
  224. package/src/modules/learning/automation-memory.ts +179 -0
  225. package/src/modules/learning/index.ts +6 -0
  226. package/src/modules/learning/observability.ts +616 -0
  227. package/src/modules/learning/operator.ts +404 -0
  228. package/src/modules/learning/reviews/agents.ts +33 -0
  229. package/src/modules/learning/reviews/complete.ts +321 -0
  230. package/src/modules/learning/reviews/context.ts +145 -0
  231. package/src/modules/learning/reviews/events.ts +306 -0
  232. package/src/modules/learning/reviews/index.ts +6 -0
  233. package/src/modules/learning/reviews/pr-cadence.ts +157 -0
  234. package/src/modules/learning/reviews/pr-context.ts +749 -0
  235. package/src/modules/learning/reviews/prepare.ts +387 -0
  236. package/src/modules/learning/reviews/schemas.ts +184 -0
  237. package/src/modules/learning/reviews/store.ts +405 -0
  238. package/src/modules/learning/skill-patches/actions.ts +86 -0
  239. package/src/modules/learning/skill-patches/index.ts +3 -0
  240. package/src/modules/learning/skill-patches/schemas.ts +60 -0
  241. package/src/modules/learning/skill-patches/service.ts +571 -0
  242. package/src/modules/learning/skill-patches/support.ts +417 -0
  243. package/src/modules/memory/actions.ts +183 -0
  244. package/src/modules/memory/candidates.ts +525 -0
  245. package/src/modules/memory/events.ts +2 -0
  246. package/src/modules/memory/index.ts +6 -0
  247. package/src/modules/memory/prompt.ts +214 -0
  248. package/src/modules/memory/schemas.ts +170 -0
  249. package/src/modules/memory/service.ts +578 -0
  250. package/src/modules/memory/store.ts +489 -0
  251. package/src/modules/pr-events/actions.ts +191 -0
  252. package/src/modules/pr-events/index.ts +45 -0
  253. package/src/modules/pr-events/schemas.ts +186 -0
  254. package/src/modules/pr-events/service.ts +1414 -0
  255. package/src/modules/pr-events/target.ts +222 -0
  256. package/src/modules/pr-events/utils.ts +85 -0
  257. package/src/modules/pr-events/watermarks.ts +308 -0
  258. package/src/modules/pr-local-diffs/index.ts +334 -0
  259. package/src/modules/pr-review-assist/actions.ts +199 -0
  260. package/src/modules/pr-review-assist/index.ts +3 -0
  261. package/src/modules/pr-review-assist/schemas.ts +74 -0
  262. package/src/modules/pr-review-assist/service.ts +656 -0
  263. package/src/modules/prepared-diffs/actions.ts +132 -0
  264. package/src/modules/prepared-diffs/index.ts +53 -0
  265. package/src/modules/prepared-diffs/schemas.ts +255 -0
  266. package/src/modules/prepared-diffs/service.ts +777 -0
  267. package/src/modules/prepared-diffs/store.ts +606 -0
  268. package/src/modules/reports/index.ts +1 -0
  269. package/src/modules/reports/service.ts +322 -0
  270. package/src/modules/repos/index.ts +3 -0
  271. package/src/modules/repos/model-discovery.ts +233 -0
  272. package/src/modules/repos/providers.ts +194 -0
  273. package/src/modules/repos/registry.ts +232 -0
  274. package/src/modules/runtime/agent-config.ts +167 -0
  275. package/src/modules/runtime/doctor.ts +528 -0
  276. package/src/modules/runtime/env.ts +123 -0
  277. package/src/modules/runtime/index.ts +12 -0
  278. package/src/modules/runtime/local-api-auth.ts +43 -0
  279. package/src/modules/runtime/metrics.ts +211 -0
  280. package/src/modules/runtime/skills-actions.ts +141 -0
  281. package/src/modules/runtime/skills.ts +689 -0
  282. package/src/modules/runtime/soul.ts +68 -0
  283. package/src/modules/runtime/status-database.ts +252 -0
  284. package/src/modules/runtime/status-schema.ts +149 -0
  285. package/src/modules/runtime/status.ts +482 -0
  286. package/src/modules/runtime/subagents.ts +37 -0
  287. package/src/modules/runtime/utility-model.ts +47 -0
  288. package/src/modules/safety/index.ts +3 -0
  289. package/src/modules/safety/policy-entries.ts +2432 -0
  290. package/src/modules/safety/schemas.ts +63 -0
  291. package/src/modules/safety/service.ts +58 -0
  292. package/src/modules/safety/tools.ts +15 -0
  293. package/src/modules/scheduled-tasks/actions.ts +113 -0
  294. package/src/modules/scheduled-tasks/dispatch.ts +105 -0
  295. package/src/modules/scheduled-tasks/index.ts +6 -0
  296. package/src/modules/scheduled-tasks/schemas.ts +91 -0
  297. package/src/modules/scheduled-tasks/service.ts +296 -0
  298. package/src/modules/scheduled-tasks/store.ts +814 -0
  299. package/src/modules/scheduled-tasks/triggers.ts +87 -0
  300. package/src/modules/scheduler/actions.ts +37 -0
  301. package/src/modules/scheduler/dispatch.ts +126 -0
  302. package/src/modules/scheduler/index.ts +4 -0
  303. package/src/modules/scheduler/lease.ts +247 -0
  304. package/src/modules/scheduler/pr-watch-event-deltas.ts +367 -0
  305. package/src/modules/scheduler/pr-watch-events.ts +834 -0
  306. package/src/modules/scheduler/schemas.ts +79 -0
  307. package/src/modules/scheduler/service.ts +228 -0
  308. package/src/modules/scheduler/utils.ts +106 -0
  309. package/src/modules/scheduler/workflow-invocation.ts +40 -0
  310. package/src/modules/sessions/actions.ts +213 -0
  311. package/src/modules/sessions/active-session.ts +46 -0
  312. package/src/modules/sessions/agent-context.ts +146 -0
  313. package/src/modules/sessions/approval-nudges.ts +156 -0
  314. package/src/modules/sessions/events.ts +58 -0
  315. package/src/modules/sessions/index.ts +10 -0
  316. package/src/modules/sessions/queries.ts +252 -0
  317. package/src/modules/sessions/references.ts +113 -0
  318. package/src/modules/sessions/schemas.ts +263 -0
  319. package/src/modules/sessions/service.ts +845 -0
  320. package/src/modules/sessions/store.ts +559 -0
  321. package/src/modules/sessions/summaries.ts +129 -0
  322. package/src/modules/sessions/utils.ts +18 -0
  323. package/src/modules/watches/actions.ts +115 -0
  324. package/src/modules/watches/index.ts +6 -0
  325. package/src/modules/watches/polling.ts +245 -0
  326. package/src/modules/watches/references.ts +293 -0
  327. package/src/modules/watches/schemas.ts +156 -0
  328. package/src/modules/watches/service.ts +558 -0
  329. package/src/modules/watches/store.ts +398 -0
  330. package/src/modules/watches/utils.ts +51 -0
  331. package/src/modules/worktree-verification/index.ts +256 -0
  332. package/src/modules/worktrees/access.ts +129 -0
  333. package/src/modules/worktrees/actions.ts +108 -0
  334. package/src/modules/worktrees/cleanup.ts +98 -0
  335. package/src/modules/worktrees/errors.ts +38 -0
  336. package/src/modules/worktrees/git.ts +48 -0
  337. package/src/modules/worktrees/index.ts +5 -0
  338. package/src/modules/worktrees/locks.ts +192 -0
  339. package/src/modules/worktrees/paths.ts +209 -0
  340. package/src/modules/worktrees/queries.ts +31 -0
  341. package/src/modules/worktrees/schemas.ts +234 -0
  342. package/src/modules/worktrees/service.ts +657 -0
  343. package/src/modules/worktrees/store.ts +414 -0
  344. package/src/repo-edit/actions.ts +129 -0
  345. package/src/repo-edit/audit.ts +180 -0
  346. package/src/repo-edit/fuzzy-replace.ts +256 -0
  347. package/src/repo-edit/git.ts +784 -0
  348. package/src/repo-edit/index.ts +4 -0
  349. package/src/repo-edit/locks.ts +27 -0
  350. package/src/repo-edit/patch-parser.ts +212 -0
  351. package/src/repo-edit/patch-service.ts +572 -0
  352. package/src/repo-edit/path-safety.ts +294 -0
  353. package/src/repo-edit/schemas.ts +220 -0
  354. package/src/repo-edit/service.ts +488 -0
  355. package/src/repo-edit/support.ts +459 -0
  356. package/src/runtime-home/app-db/index.ts +73 -0
  357. package/src/runtime-home/app-db/migrate.ts +491 -0
  358. package/src/runtime-home/app-db/migrations/20260710061339_neondeck_pre_1_0_baseline/migration.sql +748 -0
  359. package/src/runtime-home/app-db/migrations/20260710061339_neondeck_pre_1_0_baseline/snapshot.json +7240 -0
  360. package/src/runtime-home/app-db/reconcile.ts +155 -0
  361. package/src/runtime-home/app-db/schema.ts +1118 -0
  362. package/src/runtime-home/bootstrap.ts +171 -0
  363. package/src/runtime-home/defaults.ts +42 -0
  364. package/src/runtime-home/files.ts +193 -0
  365. package/src/runtime-home/index.ts +68 -0
  366. package/src/runtime-home/paths.ts +75 -0
  367. package/src/runtime-home/schemas.ts +485 -0
  368. package/src/sandboxes/exedev.ts +676 -0
  369. package/src/server/app.ts +5 -0
  370. package/src/server/autopilot-push-dispatch.ts +326 -0
  371. package/src/server/create-app.ts +160 -0
  372. package/src/server/events/config-stream.ts +67 -0
  373. package/src/server/events/notification-stream.ts +49 -0
  374. package/src/server/events/session-stream.ts +49 -0
  375. package/src/server/http.ts +56 -0
  376. package/src/server/learning-hooks.ts +430 -0
  377. package/src/server/middleware.ts +81 -0
  378. package/src/server/routes/autopilot.ts +318 -0
  379. package/src/server/routes/commands.ts +12 -0
  380. package/src/server/routes/config.ts +124 -0
  381. package/src/server/routes/execution.ts +71 -0
  382. package/src/server/routes/github.ts +372 -0
  383. package/src/server/routes/handoff.ts +69 -0
  384. package/src/server/routes/kilo.ts +179 -0
  385. package/src/server/routes/learning.ts +384 -0
  386. package/src/server/routes/mcp.ts +301 -0
  387. package/src/server/routes/memory.ts +99 -0
  388. package/src/server/routes/metrics.ts +12 -0
  389. package/src/server/routes/notifications.ts +48 -0
  390. package/src/server/routes/repo-edit.ts +115 -0
  391. package/src/server/routes/reports.ts +127 -0
  392. package/src/server/routes/repos.ts +50 -0
  393. package/src/server/routes/runtime.ts +48 -0
  394. package/src/server/routes/safety.ts +13 -0
  395. package/src/server/routes/scheduled-tasks.ts +58 -0
  396. package/src/server/routes/scheduler.ts +13 -0
  397. package/src/server/routes/sessions.ts +216 -0
  398. package/src/server/routes/skills.ts +103 -0
  399. package/src/server/routes/watches.ts +81 -0
  400. package/src/server/routes/workflows.ts +21 -0
  401. package/src/server/routes/worktrees.ts +64 -0
  402. package/src/server/scheduler-workflow.ts +541 -0
  403. package/src/server/serve.ts +100 -0
  404. package/src/setup.ts +162 -0
  405. package/src/skills/github-gh/SKILL.md +56 -0
  406. package/src/skills/neon-ci-fix/SKILL.md +15 -0
  407. package/src/skills/neon-docs-fix/SKILL.md +15 -0
  408. package/src/skills/neon-issue-triage/SKILL.md +13 -0
  409. package/src/skills/neon-pr-review/SKILL.md +19 -0
  410. package/src/skills/neondeck/SKILL.md +123 -0
  411. package/src/skills/neondeck-handoff/SKILL.md +31 -0
  412. package/src/workflows/briefing.ts +14 -0
  413. package/src/workflows/command-run.ts +15 -0
  414. package/src/workflows/comment-pr-autofix-result.ts +10 -0
  415. package/src/workflows/curate_learning_store.ts +37 -0
  416. package/src/workflows/dev-doctor.ts +10 -0
  417. package/src/workflows/fix-pr-ci-failure.ts +10 -0
  418. package/src/workflows/fix-pr-ci.ts +15 -0
  419. package/src/workflows/fix-pr-review-feedback.ts +10 -0
  420. package/src/workflows/handoff_to_kilo.ts +10 -0
  421. package/src/workflows/prepare-pr-worktree.ts +10 -0
  422. package/src/workflows/promote_kilo_result.ts +10 -0
  423. package/src/workflows/push-pr-autofix.ts +10 -0
  424. package/src/workflows/reconcile_kilo_task.ts +10 -0
  425. package/src/workflows/review-pr-for-human.ts +15 -0
  426. package/src/workflows/review_conversation_for_learning.ts +37 -0
  427. package/src/workflows/review_kilo_result.ts +10 -0
  428. package/src/workflows/review_pr_batch_for_learning.ts +37 -0
  429. package/src/workflows/scheduled-agent-instruction.ts +16 -0
  430. package/src/workflows/scheduler-tick.ts +10 -0
  431. package/src/workflows/summarize_kilo_session.ts +25 -0
  432. package/src/workflows/triage-pr-event.ts +10 -0
  433. package/src/workflows/verify-pr-worktree.ts +10 -0
  434. package/src/workflows/verify-then-push-pr-autofix.ts +82 -0
  435. package/src/workflows/verify_kilo_result.ts +10 -0
  436. package/src/workflows/watch-pr.ts +10 -0
  437. package/web/dist/assets/GitHubPrReview-QK9oqeDs.js +2 -0
  438. package/web/dist/assets/MultiFileView-CMm6tA9f.js +2970 -0
  439. package/web/dist/assets/abap-CLvhMVsD.js +1 -0
  440. package/web/dist/assets/actionscript-3--17pq3dv.js +1 -0
  441. package/web/dist/assets/ada-C5qYipkI.js +1 -0
  442. package/web/dist/assets/andromeeda-vGVdxbeo.js +1 -0
  443. package/web/dist/assets/angular-html-BVBpGdXr.js +1 -0
  444. package/web/dist/assets/angular-ts-BfdufMKP.js +1 -0
  445. package/web/dist/assets/apache-U0d_L8uA.js +1 -0
  446. package/web/dist/assets/apex-VAyPSnFM.js +1 -0
  447. package/web/dist/assets/apl-DWBSSoBH.js +1 -0
  448. package/web/dist/assets/applescript-CCn79oCD.js +1 -0
  449. package/web/dist/assets/ara-4CJ0cIlV.js +1 -0
  450. package/web/dist/assets/asciidoc-DE70LPWp.js +1 -0
  451. package/web/dist/assets/asm-Cmm7eHzH.js +1 -0
  452. package/web/dist/assets/astro-3LtMP0Sq.js +1 -0
  453. package/web/dist/assets/aurora-x-CDeNXAV0.js +1 -0
  454. package/web/dist/assets/awk-BWXHIvNe.js +1 -0
  455. package/web/dist/assets/ayu-dark-DluEY0Gj.js +1 -0
  456. package/web/dist/assets/ayu-light-C3h-C4tm.js +1 -0
  457. package/web/dist/assets/ayu-mirage-Bqwy1Gya.js +1 -0
  458. package/web/dist/assets/ballerina-B7ZEbQpA.js +1 -0
  459. package/web/dist/assets/bat-Bo4NYOV-.js +1 -0
  460. package/web/dist/assets/beancount-D-usSTwE.js +1 -0
  461. package/web/dist/assets/berry-DKpUyyne.js +1 -0
  462. package/web/dist/assets/bibtex-Ci_nEsc7.js +1 -0
  463. package/web/dist/assets/bicep-CUHmPFLl.js +1 -0
  464. package/web/dist/assets/bird2-C6vDhewU.js +1 -0
  465. package/web/dist/assets/blade-llJRbbtR.js +1 -0
  466. package/web/dist/assets/bsl-BkkzgIyY.js +1 -0
  467. package/web/dist/assets/c-Wt1voDr2.js +1 -0
  468. package/web/dist/assets/c3-BFHwR3_K.js +1 -0
  469. package/web/dist/assets/cadence-CQ2zXKGN.js +1 -0
  470. package/web/dist/assets/cairo-DLTphjLi.js +1 -0
  471. package/web/dist/assets/catppuccin-frappe-3VR1Za6u.js +1 -0
  472. package/web/dist/assets/catppuccin-latte-DwIHMF0Q.js +1 -0
  473. package/web/dist/assets/catppuccin-macchiato-DYnBP6_5.js +1 -0
  474. package/web/dist/assets/catppuccin-mocha-DYhrFGRu.js +1 -0
  475. package/web/dist/assets/clarity-SemFz856.js +1 -0
  476. package/web/dist/assets/clojure-DqKBuwfJ.js +1 -0
  477. package/web/dist/assets/cmake-Bj61d0ZC.js +1 -0
  478. package/web/dist/assets/cobol-x_HIyl2P.js +1 -0
  479. package/web/dist/assets/codeowners-C8r90Shi.js +1 -0
  480. package/web/dist/assets/codeql-oeQT6MSM.js +1 -0
  481. package/web/dist/assets/coffee-CThvmt4R.js +1 -0
  482. package/web/dist/assets/common-lisp-Cv5bFMCO.js +1 -0
  483. package/web/dist/assets/coq-BrsZFFmf.js +1 -0
  484. package/web/dist/assets/cpp-NtAeskI3.js +1 -0
  485. package/web/dist/assets/crystal-DNu_sX0G.js +1 -0
  486. package/web/dist/assets/csharp-oqKa8noW.js +1 -0
  487. package/web/dist/assets/css-DJp_X0uY.js +1 -0
  488. package/web/dist/assets/csv-Dx-8-gkx.js +1 -0
  489. package/web/dist/assets/cue-CE9AQfxI.js +1 -0
  490. package/web/dist/assets/cypher-ClKdZ_lG.js +1 -0
  491. package/web/dist/assets/d-qD-0Kul2.js +1 -0
  492. package/web/dist/assets/dark-plus-Cs2F2srj.js +1 -0
  493. package/web/dist/assets/dart-CnvKMtbv.js +1 -0
  494. package/web/dist/assets/dax-BkyTk9wS.js +1 -0
  495. package/web/dist/assets/desktop-Dlh5hvp9.js +1 -0
  496. package/web/dist/assets/diff-woXpYk--.js +1 -0
  497. package/web/dist/assets/docker-IyjqRm3v.js +1 -0
  498. package/web/dist/assets/dotenv-_5a1GRtc.js +1 -0
  499. package/web/dist/assets/dracula-BHWKrbxM.js +1 -0
  500. package/web/dist/assets/dracula-soft-5eyTD99u.js +1 -0
  501. package/web/dist/assets/dream-maker-DW3nJb8Q.js +1 -0
  502. package/web/dist/assets/edge-ozw5tpLl.js +1 -0
  503. package/web/dist/assets/elixir-VhA6FeZt.js +1 -0
  504. package/web/dist/assets/elm-dREJmIFz.js +1 -0
  505. package/web/dist/assets/emacs-lisp-B4R74twV.js +1 -0
  506. package/web/dist/assets/erb-CIg6G69l.js +1 -0
  507. package/web/dist/assets/erlang-Cphh6RMH.js +1 -0
  508. package/web/dist/assets/everforest-dark-sB-x3p7T.js +1 -0
  509. package/web/dist/assets/everforest-light-Df2xbC6M.js +1 -0
  510. package/web/dist/assets/fennel-DQxkIbk2.js +1 -0
  511. package/web/dist/assets/fish-BJitypiv.js +1 -0
  512. package/web/dist/assets/fluent-C03EYrpw.js +1 -0
  513. package/web/dist/assets/fortran-fixed-form-DEKoE2YW.js +1 -0
  514. package/web/dist/assets/fortran-free-form-CYNrtFtB.js +1 -0
  515. package/web/dist/assets/fsharp-D13ZGOAj.js +1 -0
  516. package/web/dist/assets/gdresource-C0sCabJj.js +1 -0
  517. package/web/dist/assets/gdscript-Cp2uCuqX.js +1 -0
  518. package/web/dist/assets/gdshader-CBce3t8t.js +1 -0
  519. package/web/dist/assets/genie-CV2tkWYe.js +1 -0
  520. package/web/dist/assets/gherkin-DExj1W_8.js +1 -0
  521. package/web/dist/assets/git-commit-BSykSTBG.js +1 -0
  522. package/web/dist/assets/git-rebase-B44mJPta.js +1 -0
  523. package/web/dist/assets/github-dark-C-LZuMrd.js +1 -0
  524. package/web/dist/assets/github-dark-default-DXG-b-1a.js +1 -0
  525. package/web/dist/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
  526. package/web/dist/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
  527. package/web/dist/assets/github-light-EUqPIrTm.js +1 -0
  528. package/web/dist/assets/github-light-default-BXViO-2h.js +1 -0
  529. package/web/dist/assets/github-light-high-contrast-B68TUdTA.js +1 -0
  530. package/web/dist/assets/gleam-CSRkHgEL.js +1 -0
  531. package/web/dist/assets/glimmer-js-vH_gHG0-.js +1 -0
  532. package/web/dist/assets/glimmer-ts--abOzSAQ.js +1 -0
  533. package/web/dist/assets/glsl-Dv5r7kPw.js +1 -0
  534. package/web/dist/assets/gn-ilITqXS6.js +1 -0
  535. package/web/dist/assets/gnuplot-7GGW24-e.js +1 -0
  536. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  537. package/web/dist/assets/graphql-CB4jsw2E.js +1 -0
  538. package/web/dist/assets/groovy-CacY0gHj.js +1 -0
  539. package/web/dist/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
  540. package/web/dist/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
  541. package/web/dist/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
  542. package/web/dist/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
  543. package/web/dist/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
  544. package/web/dist/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
  545. package/web/dist/assets/hack-DvEYX148.js +1 -0
  546. package/web/dist/assets/haml-zE6W3STP.js +1 -0
  547. package/web/dist/assets/handlebars-CzBR2SDs.js +1 -0
  548. package/web/dist/assets/haskell-D8IpX4py.js +1 -0
  549. package/web/dist/assets/haxe-OTjmBuCE.js +1 -0
  550. package/web/dist/assets/hcl-Dh228itO.js +1 -0
  551. package/web/dist/assets/hjson-CxZEssPk.js +1 -0
  552. package/web/dist/assets/hlsl-Cvrh5tZx.js +1 -0
  553. package/web/dist/assets/horizon-CE9ld1lL.js +1 -0
  554. package/web/dist/assets/horizon-bright-DSNQnXHK.js +1 -0
  555. package/web/dist/assets/houston-CsvMBhTu.js +1 -0
  556. package/web/dist/assets/html-C8UlPnhE.js +1 -0
  557. package/web/dist/assets/html-derivative-CY6NRz-J.js +1 -0
  558. package/web/dist/assets/http-Cyd7bS_S.js +1 -0
  559. package/web/dist/assets/hurl-CWPsiEpf.js +1 -0
  560. package/web/dist/assets/hxml-B0Qn7Nwc.js +1 -0
  561. package/web/dist/assets/hy-CZbG8q4J.js +1 -0
  562. package/web/dist/assets/imba-DsUTQ-LC.js +1 -0
  563. package/web/dist/assets/index-DqZpo0Jd.js +44 -0
  564. package/web/dist/assets/index-_jKCE4ks.css +2 -0
  565. package/web/dist/assets/ini-B5eOa1yu.js +1 -0
  566. package/web/dist/assets/java-CGc3VwQr.js +1 -0
  567. package/web/dist/assets/javascript-CUt1pgmJ.js +1 -0
  568. package/web/dist/assets/jinja-CD-Z-FLd.js +1 -0
  569. package/web/dist/assets/jison-imPNup1l.js +1 -0
  570. package/web/dist/assets/json-Bg9ijW3F.js +1 -0
  571. package/web/dist/assets/json5-BR5RXkoi.js +1 -0
  572. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  573. package/web/dist/assets/jsonl-CmCQp5Yx.js +1 -0
  574. package/web/dist/assets/jsonnet-CJTPZ8u_.js +1 -0
  575. package/web/dist/assets/jssm-DXw9l8Rf.js +1 -0
  576. package/web/dist/assets/jsx-CY6oMTks.js +1 -0
  577. package/web/dist/assets/julia-Dc3O-irA.js +1 -0
  578. package/web/dist/assets/just-BhOq_Kbv.js +1 -0
  579. package/web/dist/assets/kanagawa-dragon-CXtmUGW6.js +1 -0
  580. package/web/dist/assets/kanagawa-lotus-BN08jTvb.js +1 -0
  581. package/web/dist/assets/kanagawa-wave-CTweb8Dz.js +1 -0
  582. package/web/dist/assets/kdl-CsD5j6eV.js +1 -0
  583. package/web/dist/assets/kotlin-DhhofPvG.js +1 -0
  584. package/web/dist/assets/kusto-C7mF5XQf.js +1 -0
  585. package/web/dist/assets/laserwave-C_8bwKvT.js +1 -0
  586. package/web/dist/assets/latex-Cu4Y1d5w.js +1 -0
  587. package/web/dist/assets/lean-CewbzKMR.js +1 -0
  588. package/web/dist/assets/less-DVTAwKKz.js +1 -0
  589. package/web/dist/assets/light-plus-DVQuIRkW.js +1 -0
  590. package/web/dist/assets/liquid-CvXMrjlQ.js +1 -0
  591. package/web/dist/assets/llvm-Cm23YOpf.js +1 -0
  592. package/web/dist/assets/log-BNLmms1o.js +1 -0
  593. package/web/dist/assets/logo-Cluzi2Zq.js +1 -0
  594. package/web/dist/assets/lua-BjLEUjKY.js +1 -0
  595. package/web/dist/assets/luau-FMPmPwt6.js +1 -0
  596. package/web/dist/assets/make-Dixweg8N.js +1 -0
  597. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  598. package/web/dist/assets/marko-DvhNOisQ.js +1 -0
  599. package/web/dist/assets/material-theme-Bm3Qr25_.js +1 -0
  600. package/web/dist/assets/material-theme-darker-2IIEA8gg.js +1 -0
  601. package/web/dist/assets/material-theme-lighter-uhdI0v04.js +1 -0
  602. package/web/dist/assets/material-theme-ocean-CHQ94UKr.js +1 -0
  603. package/web/dist/assets/material-theme-palenight-B5W6OYN7.js +1 -0
  604. package/web/dist/assets/matlab-D7qyCx1q.js +1 -0
  605. package/web/dist/assets/mdc-Bm9TpL1X.js +1 -0
  606. package/web/dist/assets/mdx-DQZ5AkYe.js +1 -0
  607. package/web/dist/assets/mermaid-Bk4SNUv9.js +1 -0
  608. package/web/dist/assets/min-dark-BSWPekZh.js +1 -0
  609. package/web/dist/assets/min-light-DDpmG2fV.js +1 -0
  610. package/web/dist/assets/mipsasm-BMqwQI7S.js +1 -0
  611. package/web/dist/assets/mojo-BgCJLMeH.js +1 -0
  612. package/web/dist/assets/monokai-CdkpiU2Y.js +1 -0
  613. package/web/dist/assets/moonbit-CaWjb8XO.js +1 -0
  614. package/web/dist/assets/move-B1IS1UjX.js +1 -0
  615. package/web/dist/assets/narrat-_X_XdTYD.js +1 -0
  616. package/web/dist/assets/nextflow-BJtWHP5T.js +1 -0
  617. package/web/dist/assets/nextflow-groovy-DJMQeKeT.js +1 -0
  618. package/web/dist/assets/nginx-Bhc82uuv.js +1 -0
  619. package/web/dist/assets/night-owl-DhmEMT88.js +1 -0
  620. package/web/dist/assets/night-owl-light-eJ-hLW7d.js +1 -0
  621. package/web/dist/assets/nim-DXTVBFnF.js +1 -0
  622. package/web/dist/assets/nix-IvuFDN5E.js +1 -0
  623. package/web/dist/assets/nord-Cb4Vim4T.js +1 -0
  624. package/web/dist/assets/nushell-DcLAeLz5.js +1 -0
  625. package/web/dist/assets/objective-c-D1A_Heim.js +1 -0
  626. package/web/dist/assets/objective-cpp-BsSzOQcm.js +1 -0
  627. package/web/dist/assets/ocaml-O90oeIOV.js +1 -0
  628. package/web/dist/assets/odin-B1RWQWA5.js +1 -0
  629. package/web/dist/assets/one-dark-pro-CLwyXe_n.js +1 -0
  630. package/web/dist/assets/one-light-D7Lr4KcI.js +1 -0
  631. package/web/dist/assets/openscad-BUDT5pXO.js +1 -0
  632. package/web/dist/assets/pascal-4ZHwLPI5.js +1 -0
  633. package/web/dist/assets/perl-C7veXV9z.js +1 -0
  634. package/web/dist/assets/php-BRiuMnnr.js +1 -0
  635. package/web/dist/assets/pierre-dark-CpLgRqie.js +1 -0
  636. package/web/dist/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +1 -0
  637. package/web/dist/assets/pierre-dark-soft-kZQmAZld.js +1 -0
  638. package/web/dist/assets/pierre-dark-tritanopia-CpjhbsIL.js +1 -0
  639. package/web/dist/assets/pierre-dark-vibrant-CpQYzh95.js +1 -0
  640. package/web/dist/assets/pierre-light-CoaEpmwp.js +1 -0
  641. package/web/dist/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +1 -0
  642. package/web/dist/assets/pierre-light-soft-lWLdNTOI.js +1 -0
  643. package/web/dist/assets/pierre-light-tritanopia-CEbqgOJL.js +1 -0
  644. package/web/dist/assets/pierre-light-vibrant-D80Fkn33.js +1 -0
  645. package/web/dist/assets/pkl-ot-7Btpt.js +1 -0
  646. package/web/dist/assets/plastic-DQwYfKfQ.js +1 -0
  647. package/web/dist/assets/plsql-DGHpHOYJ.js +1 -0
  648. package/web/dist/assets/po-BiJDBrnU.js +1 -0
  649. package/web/dist/assets/poimandres-DRFjx7u4.js +1 -0
  650. package/web/dist/assets/polar-C7UOKdEL.js +1 -0
  651. package/web/dist/assets/postcss-BXeXVLqQ.js +1 -0
  652. package/web/dist/assets/powerquery-DNMTfnFr.js +1 -0
  653. package/web/dist/assets/powershell-DshXNtvi.js +1 -0
  654. package/web/dist/assets/prisma-BsRQq5mF.js +1 -0
  655. package/web/dist/assets/prolog-iXnhIJG7.js +1 -0
  656. package/web/dist/assets/proto-DB4EqR-F.js +1 -0
  657. package/web/dist/assets/pug-C5hz5LQ7.js +1 -0
  658. package/web/dist/assets/puppet-CDv2pdJW.js +1 -0
  659. package/web/dist/assets/purescript-9MfHhQsQ.js +1 -0
  660. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  661. package/web/dist/assets/qml-BdUV3aTS.js +1 -0
  662. package/web/dist/assets/qmldir-DCQb3MpD.js +1 -0
  663. package/web/dist/assets/qss-Fe1Jh2GI.js +1 -0
  664. package/web/dist/assets/r-8R7vtdQc.js +1 -0
  665. package/web/dist/assets/racket-DcIDlBhZ.js +1 -0
  666. package/web/dist/assets/raku-B3gFvitq.js +1 -0
  667. package/web/dist/assets/razor-DRL52XO2.js +1 -0
  668. package/web/dist/assets/red-CJ3rzSJv.js +1 -0
  669. package/web/dist/assets/reg-CRGYupPL.js +1 -0
  670. package/web/dist/assets/regexp-Omp9DhTb.js +1 -0
  671. package/web/dist/assets/rel-BtDbiS_P.js +1 -0
  672. package/web/dist/assets/riscv-Ckw8ddFX.js +1 -0
  673. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  674. package/web/dist/assets/ron-VUp2lXgN.js +1 -0
  675. package/web/dist/assets/rose-pine-BthvhNj6.js +1 -0
  676. package/web/dist/assets/rose-pine-dawn-Dg85fqjY.js +1 -0
  677. package/web/dist/assets/rose-pine-moon-hon4tzzS.js +1 -0
  678. package/web/dist/assets/rosmsg-CAekHB0j.js +1 -0
  679. package/web/dist/assets/rst-BHX71KW9.js +1 -0
  680. package/web/dist/assets/ruby-B--HzjGU.js +1 -0
  681. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  682. package/web/dist/assets/sas-DrLaYOK_.js +1 -0
  683. package/web/dist/assets/sass-DXrisJhu.js +1 -0
  684. package/web/dist/assets/scala-DKOlJaKm.js +1 -0
  685. package/web/dist/assets/scheme-DQCgrYNe.js +1 -0
  686. package/web/dist/assets/scss-DdSxiZKl.js +1 -0
  687. package/web/dist/assets/sdbl-bTVj8UrX.js +1 -0
  688. package/web/dist/assets/shaderlab-TOUzSsQk.js +1 -0
  689. package/web/dist/assets/shellscript-DwcUjJBL.js +1 -0
  690. package/web/dist/assets/shellsession-CPZkydE6.js +1 -0
  691. package/web/dist/assets/slack-dark-DnToyrRv.js +1 -0
  692. package/web/dist/assets/slack-ochin-B2OO5cIa.js +1 -0
  693. package/web/dist/assets/smalltalk-B16xEiuN.js +1 -0
  694. package/web/dist/assets/snazzy-light-4G7pJPwS.js +1 -0
  695. package/web/dist/assets/solarized-dark-DV17i1UV.js +1 -0
  696. package/web/dist/assets/solarized-light-DSh2HLQt.js +1 -0
  697. package/web/dist/assets/solidity-CKzVLygQ.js +1 -0
  698. package/web/dist/assets/soy-Br5FhD7c.js +1 -0
  699. package/web/dist/assets/sparql-D_iOobhT.js +1 -0
  700. package/web/dist/assets/splunk-BC2Px7Mm.js +1 -0
  701. package/web/dist/assets/sql-DNssxck8.js +1 -0
  702. package/web/dist/assets/ssh-config-BgfXC-Er.js +1 -0
  703. package/web/dist/assets/stata-DXn1tqOr.js +1 -0
  704. package/web/dist/assets/stylus-B6D30XZt.js +1 -0
  705. package/web/dist/assets/surfaces-B8Ko8AJ3.js +1 -0
  706. package/web/dist/assets/surrealql-IeLNQw0f.js +1 -0
  707. package/web/dist/assets/svelte-DOdLCIlh.js +1 -0
  708. package/web/dist/assets/swift-DonLKvLd.js +1 -0
  709. package/web/dist/assets/synthwave-84-nFMaYfgc.js +1 -0
  710. package/web/dist/assets/system-verilog-DJ5XKQeo.js +1 -0
  711. package/web/dist/assets/systemd-BxMlprV5.js +1 -0
  712. package/web/dist/assets/talonscript-CohzipZa.js +1 -0
  713. package/web/dist/assets/tasl-DMoTqEGO.js +1 -0
  714. package/web/dist/assets/tcl-CZd0xW_V.js +1 -0
  715. package/web/dist/assets/templ-CIwIngms.js +1 -0
  716. package/web/dist/assets/terraform-DswuEJGm.js +1 -0
  717. package/web/dist/assets/tex-D8QMumu5.js +1 -0
  718. package/web/dist/assets/tokyo-night-oM2G3aXe.js +1 -0
  719. package/web/dist/assets/toml-CcmNWLt0.js +1 -0
  720. package/web/dist/assets/ts-tags-BMVY4q-l.js +1 -0
  721. package/web/dist/assets/tsv-sltzmVWM.js +1 -0
  722. package/web/dist/assets/tsx-5Eka4NBX.js +1 -0
  723. package/web/dist/assets/turtle-ByJddavk.js +1 -0
  724. package/web/dist/assets/twig-C8o_5mgw.js +1 -0
  725. package/web/dist/assets/typescript-DOu2WMV5.js +1 -0
  726. package/web/dist/assets/typespec-BRdr0IET.js +1 -0
  727. package/web/dist/assets/typst-DI99ib-x.js +1 -0
  728. package/web/dist/assets/v-DETTlOr0.js +1 -0
  729. package/web/dist/assets/vala-zf12oZj6.js +1 -0
  730. package/web/dist/assets/vb-Djn5o6TS.js +1 -0
  731. package/web/dist/assets/verilog-CiiDBU1e.js +1 -0
  732. package/web/dist/assets/vesper-DdrHHSXu.js +1 -0
  733. package/web/dist/assets/vhdl-BroJfC0k.js +1 -0
  734. package/web/dist/assets/viml-DvXPmvsu.js +1 -0
  735. package/web/dist/assets/vitesse-black-fwtXNY1n.js +1 -0
  736. package/web/dist/assets/vitesse-dark-BZCL-v6S.js +1 -0
  737. package/web/dist/assets/vitesse-light-VbXTXTou.js +1 -0
  738. package/web/dist/assets/vue-BU18DNDL.js +1 -0
  739. package/web/dist/assets/vue-html-BeluIYX0.js +1 -0
  740. package/web/dist/assets/vue-vine-DGUAbOCX.js +1 -0
  741. package/web/dist/assets/vyper-CgoNMtux.js +1 -0
  742. package/web/dist/assets/wasm-BnjxR4X6.js +1 -0
  743. package/web/dist/assets/wasm-ByWQv1Qj.js +1 -0
  744. package/web/dist/assets/wenyan-C8pVoKbM.js +1 -0
  745. package/web/dist/assets/wgsl-BsKzXJz4.js +1 -0
  746. package/web/dist/assets/wikitext-ClFFjSW2.js +1 -0
  747. package/web/dist/assets/wit-DdvCle-K.js +1 -0
  748. package/web/dist/assets/wolfram-DLL8P-h_.js +1 -0
  749. package/web/dist/assets/worker-CBKQOXEl.js +160 -0
  750. package/web/dist/assets/xml-DIqSwXR3.js +1 -0
  751. package/web/dist/assets/xsl-Ct_-YIAy.js +1 -0
  752. package/web/dist/assets/yaml-DTtCYNlS.js +1 -0
  753. package/web/dist/assets/zenscript-BnlCZFoB.js +1 -0
  754. package/web/dist/assets/zig-CMLA9XwU.js +1 -0
  755. package/web/dist/icons/neondeck-icon-192.png +0 -0
  756. package/web/dist/icons/neondeck-icon-512.png +0 -0
  757. package/web/dist/icons/neondeck-icon.svg +41 -0
  758. package/web/dist/icons/neondeck-maskable-512.png +0 -0
  759. package/web/dist/index.html +24 -0
  760. package/web/dist/manifest.webmanifest +28 -0
@@ -0,0 +1,2432 @@
1
+ import type { SafetyPolicyEntry } from './schemas';
2
+
3
+ export const readOnly = {
4
+ class: 'read-only',
5
+ unattended: true,
6
+ requiresConfirmation: false,
7
+ audited: false,
8
+ auditTarget: 'none',
9
+ } satisfies Partial<SafetyPolicyEntry>;
10
+
11
+ export const safeMutation = {
12
+ class: 'safe-mutation',
13
+ unattended: false,
14
+ requiresConfirmation: false,
15
+ audited: true,
16
+ } satisfies Partial<SafetyPolicyEntry>;
17
+
18
+ export const unauditedSafeMutation = {
19
+ class: 'safe-mutation',
20
+ unattended: false,
21
+ requiresConfirmation: false,
22
+ audited: false,
23
+ auditTarget: 'none',
24
+ } satisfies Partial<SafetyPolicyEntry>;
25
+
26
+ export const destructiveMutation = {
27
+ class: 'destructive-mutation',
28
+ unattended: false,
29
+ requiresConfirmation: true,
30
+ audited: true,
31
+ } satisfies Partial<SafetyPolicyEntry>;
32
+
33
+ export const hostExecution = {
34
+ class: 'host-execution',
35
+ unattended: false,
36
+ requiresConfirmation: true,
37
+ audited: true,
38
+ } satisfies Partial<SafetyPolicyEntry>;
39
+
40
+ const cliHostExecution = {
41
+ ...hostExecution,
42
+ audited: false,
43
+ auditTarget: 'none',
44
+ } satisfies Partial<SafetyPolicyEntry>;
45
+
46
+ const cliDestructiveMutation = {
47
+ ...destructiveMutation,
48
+ audited: false,
49
+ auditTarget: 'none',
50
+ } satisfies Partial<SafetyPolicyEntry>;
51
+
52
+ export const entries: SafetyPolicyEntry[] = [
53
+ tool(
54
+ 'neondeck_safety_policy_lookup',
55
+ 'Read safety policy',
56
+ readOnly,
57
+ 'Reads this approval and audit policy.',
58
+ ),
59
+ tool(
60
+ 'neondeck_commands_lookup',
61
+ 'List slash commands',
62
+ readOnly,
63
+ 'Lists supported Neon slash commands.',
64
+ ),
65
+ tool(
66
+ 'neondeck_workflow_summaries_lookup',
67
+ 'Read workflow summaries',
68
+ readOnly,
69
+ 'Reads persisted command and workflow summaries.',
70
+ ),
71
+ tool(
72
+ 'neondeck_runtime_status_lookup',
73
+ 'Read runtime readiness',
74
+ readOnly,
75
+ 'Reads local runtime status, credentials presence, counts, and recent failure summaries.',
76
+ ),
77
+ tool(
78
+ 'neondeck_app_db_migrations_lookup',
79
+ 'Read app DB migrations',
80
+ readOnly,
81
+ 'Reads the Neondeck app database migration journal, pending migrations, hash mismatches, unknown newer migrations, and latest backup path.',
82
+ ),
83
+ tool(
84
+ 'neondeck_session_status_lookup',
85
+ 'Read active session state',
86
+ readOnly,
87
+ 'Reads the active Neon session id and stale-context reasons.',
88
+ ),
89
+ tool(
90
+ 'neondeck_session_list_lookup',
91
+ 'List chat sessions',
92
+ readOnly,
93
+ 'Reads indexed chat session metadata without reading Flue transcripts.',
94
+ ),
95
+ tool(
96
+ 'neondeck_session_search_lookup',
97
+ 'Search chat sessions',
98
+ {
99
+ ...readOnly,
100
+ audited: true,
101
+ auditTarget: 'chat_session_audit',
102
+ },
103
+ 'Searches chat session metadata and summaries, recording an audit row.',
104
+ ),
105
+ tool(
106
+ 'neondeck_session_read_lookup',
107
+ 'Read chat session metadata',
108
+ {
109
+ ...readOnly,
110
+ audited: true,
111
+ auditTarget: 'chat_session_audit',
112
+ },
113
+ 'Reads one indexed chat session metadata record and audits the read.',
114
+ ),
115
+ tool(
116
+ 'neondeck_session_messages_lookup',
117
+ 'Request session messages',
118
+ {
119
+ ...readOnly,
120
+ audited: true,
121
+ auditTarget: 'chat_session_audit',
122
+ },
123
+ 'Audits a request for Flue-owned messages without duplicating transcripts into app state.',
124
+ ),
125
+ tool(
126
+ 'neondeck_repo_status_lookup',
127
+ 'Read local repo status',
128
+ readOnly,
129
+ 'Reads deterministic git status for configured repositories.',
130
+ ),
131
+ tool(
132
+ 'neondeck_github_pr_queue_lookup',
133
+ 'Read GitHub PR queue',
134
+ readOnly,
135
+ 'Fetches configured GitHub PR queue facts.',
136
+ ),
137
+ tool(
138
+ 'neondeck_github_check_summary_lookup',
139
+ 'Read GitHub check summary',
140
+ readOnly,
141
+ 'Fetches GitHub check summary facts for a configured repository ref.',
142
+ ),
143
+ tool(
144
+ 'neondeck_github_issues_lookup',
145
+ 'Read GitHub issues',
146
+ readOnly,
147
+ 'Fetches open GitHub issue facts for a configured repository without posting comments or changing labels.',
148
+ ),
149
+ tool(
150
+ 'neondeck_pr_review_comments_lookup',
151
+ 'Read PR review comments',
152
+ readOnly,
153
+ 'Fetches unresolved GitHub PR review comments and review thread metadata.',
154
+ ),
155
+ tool(
156
+ 'neondeck_pr_requested_changes_lookup',
157
+ 'Read requested changes',
158
+ readOnly,
159
+ 'Fetches current requested-changes review state for a GitHub PR.',
160
+ ),
161
+ tool(
162
+ 'neondeck_pr_branch_permissions_lookup',
163
+ 'Read PR branch permissions',
164
+ readOnly,
165
+ 'Fetches branch push permission facts for a GitHub PR without pushing.',
166
+ ),
167
+ tool(
168
+ 'neondeck_pr_watch_event_watermarks_lookup',
169
+ 'Read PR event watermarks',
170
+ readOnly,
171
+ 'Reads persisted PR watch event watermarks without contacting GitHub.',
172
+ ),
173
+ tool(
174
+ 'neondeck_scheduled_tasks_lookup',
175
+ 'Read scheduled tasks',
176
+ readOnly,
177
+ 'Reads canonical scheduled tasks and their most recent run.',
178
+ ),
179
+ tool(
180
+ 'neondeck_pr_watches_lookup',
181
+ 'Read PR watches',
182
+ readOnly,
183
+ 'Reads persistent PR watch state.',
184
+ ),
185
+ tool(
186
+ 'neondeck_ref_watches_lookup',
187
+ 'Read ref watches',
188
+ readOnly,
189
+ 'Reads persistent branch and commit ref watch state.',
190
+ ),
191
+ tool(
192
+ 'neondeck_runtime_skills_lookup',
193
+ 'List runtime skills',
194
+ readOnly,
195
+ 'Lists active, duplicate, and ignored runtime skill entries.',
196
+ ),
197
+ tool(
198
+ 'neondeck_runtime_skill_load',
199
+ 'Load runtime skill content',
200
+ readOnly,
201
+ 'Reads trusted local skill instructions for a selected runtime skill.',
202
+ ),
203
+ tool(
204
+ 'neondeck_memory_lookup',
205
+ 'Read structured memory',
206
+ readOnly,
207
+ 'Reads durable Neondeck memory scoped to user, local, or project.',
208
+ ),
209
+ tool(
210
+ 'neondeck_worktrees_lookup',
211
+ 'Read worktree state',
212
+ readOnly,
213
+ 'Reads Neondeck worktree records, active and stale locks, and cleanup failures.',
214
+ ),
215
+ tool(
216
+ 'neondeck_prepared_diffs_lookup',
217
+ 'Read prepared diffs',
218
+ readOnly,
219
+ 'Reads prepared-diff records and pending decision rows without reading file patches.',
220
+ ),
221
+ tool(
222
+ 'neondeck_kilo_tasks_lookup',
223
+ 'Read Kilo handoff tasks',
224
+ readOnly,
225
+ 'Reads persisted Kilo handoff task metadata without starting or cancelling work.',
226
+ ),
227
+ action(
228
+ 'neondeck_autopilot_triage_pr_event',
229
+ 'Triage PR event',
230
+ readOnly,
231
+ 'Classifies structured PR watcher deltas without mutating GitHub, repos, or worktrees.',
232
+ ),
233
+ action(
234
+ 'neondeck_execution_policy_check',
235
+ 'Check host execution policy',
236
+ readOnly,
237
+ 'Classifies a proposed local or exe.dev command against execution approval policy without running it.',
238
+ ),
239
+ action(
240
+ 'neondeck_execution_request_approval',
241
+ 'Request host execution approval',
242
+ {
243
+ ...safeMutation,
244
+ auditTarget: 'execution_approvals',
245
+ },
246
+ 'Creates a pending approval record for a non-preapproved local or exe.dev command without running it.',
247
+ ),
248
+ action(
249
+ 'neondeck_execution_run',
250
+ 'Run approved host command',
251
+ {
252
+ ...hostExecution,
253
+ auditTarget: 'execution_approvals',
254
+ },
255
+ 'Runs one approved local command or one approved exe.dev sandbox command, records bounded redacted output, and never bypasses hardline denies.',
256
+ ),
257
+ tool(
258
+ 'mcp__<server>__<tool>',
259
+ 'Call external MCP tool family',
260
+ {
261
+ ...hostExecution,
262
+ auditTarget: 'mcp_tool_approvals/mcp_tool_audit',
263
+ },
264
+ 'Dynamic third-party MCP tools are untrusted external tool calls. Per-call confirmation is delegated to the MCP approval gate; deny and auto-approve lists are exact-match per server.',
265
+ ),
266
+ tool(
267
+ 'neondeck_mcp_servers_lookup',
268
+ 'Read MCP servers',
269
+ readOnly,
270
+ 'Reads configured MCP servers with live connection status.',
271
+ ),
272
+ tool(
273
+ 'neondeck_mcp_tools_lookup',
274
+ 'Read MCP tool catalog',
275
+ readOnly,
276
+ 'Reads cached MCP tool catalogs without invoking third-party tools.',
277
+ ),
278
+ tool(
279
+ 'neondeck_mcp_status_lookup',
280
+ 'Read MCP status',
281
+ readOnly,
282
+ 'Reads MCP registry status and enabled server health.',
283
+ ),
284
+ tool(
285
+ 'neondeck_mcp_approvals_lookup',
286
+ 'Read MCP approvals',
287
+ readOnly,
288
+ 'Reads pending MCP tool-call approvals.',
289
+ ),
290
+ tool(
291
+ 'neondeck_mcp_audit_lookup',
292
+ 'Read MCP audit',
293
+ readOnly,
294
+ 'Reads recent MCP tool-call audit rows.',
295
+ ),
296
+ action(
297
+ 'neondeck_exedev_checkout_sync',
298
+ 'Sync exe.dev checkout',
299
+ {
300
+ ...hostExecution,
301
+ auditTarget: 'execution_approvals',
302
+ },
303
+ 'Creates or syncs a declared repo/worktree checkout on the existing exe.dev VM by routing each remote mkdir/git step through execution approvals.',
304
+ ),
305
+ cli(
306
+ 'neondeck_service_install',
307
+ 'Install login service',
308
+ cliHostExecution,
309
+ 'User-invoked CLI command that writes a launchd/systemd user service and starts the local server. It is never model-callable.',
310
+ ),
311
+ cli(
312
+ 'neondeck_service_uninstall',
313
+ 'Uninstall login service',
314
+ cliDestructiveMutation,
315
+ 'User-invoked CLI command that stops and removes only the Neondeck launchd/systemd service file. It does not delete runtime data and is never model-callable.',
316
+ ),
317
+ cli(
318
+ 'neondeck_service_start',
319
+ 'Start login service',
320
+ cliHostExecution,
321
+ 'User-invoked CLI command that starts the installed launchd/systemd user service. It is never model-callable.',
322
+ ),
323
+ cli(
324
+ 'neondeck_service_stop',
325
+ 'Stop login service',
326
+ cliHostExecution,
327
+ 'User-invoked CLI command that stops the installed launchd/systemd user service. It is never model-callable.',
328
+ ),
329
+ cli(
330
+ 'neondeck_service_status',
331
+ 'Read login service status',
332
+ readOnly,
333
+ 'User-invoked CLI command that reads service installation, running state, health, and embedded paths. It is never model-callable.',
334
+ ),
335
+ action(
336
+ 'neondeck_config_read',
337
+ 'Read runtime config',
338
+ readOnly,
339
+ 'Reads validated runtime config files without exposing raw provider secrets.',
340
+ ),
341
+ action(
342
+ 'neondeck_config_validate',
343
+ 'Validate runtime config',
344
+ readOnly,
345
+ 'Validates runtime config files and reports schema errors.',
346
+ ),
347
+ action(
348
+ 'neondeck_config_reload',
349
+ 'Reload runtime config snapshot',
350
+ readOnly,
351
+ 'Validates and returns active disk-backed runtime config.',
352
+ ),
353
+ action(
354
+ 'neondeck_config_read_providers',
355
+ 'Read provider config',
356
+ readOnly,
357
+ 'Reads allowlisted provider config without exposing secret values.',
358
+ ),
359
+ action(
360
+ 'neondeck_commands_list',
361
+ 'List slash commands',
362
+ readOnly,
363
+ 'Lists supported Neon slash commands through an action surface.',
364
+ ),
365
+ action(
366
+ 'neondeck_workflow_summaries_list',
367
+ 'List workflow summaries',
368
+ readOnly,
369
+ 'Lists persisted Neondeck workflow and command summaries.',
370
+ ),
371
+ action(
372
+ 'neondeck_watch_pr_list',
373
+ 'List PR watches',
374
+ readOnly,
375
+ 'Lists persistent PR watches.',
376
+ ),
377
+ action(
378
+ 'neondeck_scheduled_task_list',
379
+ 'List scheduled tasks',
380
+ readOnly,
381
+ 'Lists canonical scheduled tasks and their most recent run.',
382
+ ),
383
+ action(
384
+ 'neondeck_scheduled_task_read',
385
+ 'Read scheduled task',
386
+ readOnly,
387
+ 'Reads one canonical scheduled task and its most recent run.',
388
+ ),
389
+ action(
390
+ 'neondeck_skills_list',
391
+ 'List runtime skills',
392
+ readOnly,
393
+ 'Lists discovered runtime skills.',
394
+ ),
395
+ action(
396
+ 'neondeck_skill_load',
397
+ 'Load runtime skill',
398
+ readOnly,
399
+ 'Loads full content for a selected runtime skill.',
400
+ ),
401
+ action(
402
+ 'neondeck_session_status',
403
+ 'Read session status',
404
+ readOnly,
405
+ 'Reads active Neon session state through an action surface.',
406
+ ),
407
+ action(
408
+ 'neondeck_session_list',
409
+ 'List chat sessions',
410
+ readOnly,
411
+ 'Lists indexed chat session metadata.',
412
+ ),
413
+ action(
414
+ 'neondeck_session_search',
415
+ 'Search chat sessions',
416
+ {
417
+ ...readOnly,
418
+ audited: true,
419
+ auditTarget: 'chat_session_audit',
420
+ },
421
+ 'Searches indexed chat session metadata and records an audit row.',
422
+ ),
423
+ action(
424
+ 'neondeck_session_read',
425
+ 'Read chat session metadata',
426
+ {
427
+ ...readOnly,
428
+ audited: true,
429
+ auditTarget: 'chat_session_audit',
430
+ },
431
+ 'Reads one indexed chat session metadata record and records an audit row.',
432
+ ),
433
+ action(
434
+ 'neondeck_session_messages',
435
+ 'Request session messages',
436
+ {
437
+ ...readOnly,
438
+ audited: true,
439
+ auditTarget: 'chat_session_audit',
440
+ },
441
+ 'Audits a request for Flue-owned messages. Neondeck app state does not store transcript copies.',
442
+ ),
443
+ action(
444
+ 'neondeck_session_refresh_summary',
445
+ 'Refresh session summary',
446
+ {
447
+ ...safeMutation,
448
+ auditTarget: 'chat_sessions/chat_session_audit',
449
+ },
450
+ 'Refreshes stored session summary metadata without copying raw Flue transcript history.',
451
+ ),
452
+ action(
453
+ 'neondeck_session_reference',
454
+ 'Reference chat session',
455
+ {
456
+ ...safeMutation,
457
+ auditTarget: 'chat_sessions/chat_session_audit',
458
+ },
459
+ 'Audits cross-session context use and may refresh missing or stale summary metadata before returning a compact reference.',
460
+ ),
461
+ action(
462
+ 'neondeck_memory_list',
463
+ 'List structured memory',
464
+ readOnly,
465
+ 'Lists durable structured memory entries.',
466
+ ),
467
+ action(
468
+ 'neondeck_memory_events',
469
+ 'List memory audit events',
470
+ readOnly,
471
+ 'Lists durable memory mutation audit history.',
472
+ ),
473
+ action(
474
+ 'neondeck_memory_candidate_list',
475
+ 'List memory candidates',
476
+ readOnly,
477
+ 'Lists review-mode memory learning candidates.',
478
+ ),
479
+ action(
480
+ 'neondeck_repo_status_list',
481
+ 'List repo status',
482
+ readOnly,
483
+ 'Lists deterministic local git status facts.',
484
+ ),
485
+ action(
486
+ 'neondeck_worktree_status',
487
+ 'Read worktree status',
488
+ readOnly,
489
+ 'Reads git status, head/base SHA, dirty state, and lock state for a managed worktree.',
490
+ ),
491
+ action(
492
+ 'neondeck_dev_doctor_run',
493
+ 'Run local dev diagnostics',
494
+ readOnly,
495
+ 'Runs bounded read-only local diagnostics over repo status, package metadata, env presence, ports, API health, and database files.',
496
+ ),
497
+ action(
498
+ 'neondeck_command_run',
499
+ 'Run Neon command workflow action',
500
+ {
501
+ ...safeMutation,
502
+ auditTarget: 'workflow_summaries/workflow_events',
503
+ },
504
+ 'Runs supported slash commands and persists a workflow summary. Individual commands must stay within their own safety class.',
505
+ ),
506
+ action(
507
+ 'neondeck_pr_review_for_human',
508
+ 'Prepare PR review artifacts',
509
+ {
510
+ ...safeMutation,
511
+ auditTarget:
512
+ 'reports/pr_review_drafts/pr_review_draft_comments/notifications/workflow_summaries',
513
+ },
514
+ 'Creates local PR review reports and Neon-origin local draft comments for human review. It never submits a GitHub review or performs external writes.',
515
+ ),
516
+ action(
517
+ 'neondeck_autopilot_ci_fix_run',
518
+ 'Run bounded PR CI fix',
519
+ {
520
+ ...hostExecution,
521
+ auditTarget:
522
+ 'reports/worktrees/worktree_locks/kilo_tasks/kilo_task_events/prepared_diffs/notifications/workflow_summaries/workflow_events',
523
+ },
524
+ 'Creates a local CI dossier report, prepares a managed PR worktree, and starts a bounded Kilo fix task. It may create a local prepared diff, but it never pushes, comments, or submits a GitHub review.',
525
+ ),
526
+ action(
527
+ 'neondeck_config_add_repo',
528
+ 'Add repository config',
529
+ {
530
+ ...safeMutation,
531
+ auditTarget: 'config_history',
532
+ },
533
+ 'Adds a repo after local path, git, GitHub metadata, and schema validation.',
534
+ ),
535
+ action(
536
+ 'neondeck_config_update_repo',
537
+ 'Update repository config',
538
+ {
539
+ ...safeMutation,
540
+ auditTarget: 'config_history',
541
+ },
542
+ 'Updates an existing repo entry after schema and path validation.',
543
+ ),
544
+ action(
545
+ 'neondeck_config_update_repo_autopilot_policy',
546
+ 'Update repository autopilot policy',
547
+ {
548
+ ...safeMutation,
549
+ auditTarget: 'repos.json/config_history',
550
+ requiresConfirmation: true,
551
+ },
552
+ 'Updates typed repo autopilot policy. Increasing autonomy, relaxing limits, expanding push destinations, enabling force push, or changing watch overrides requires confirm=true.',
553
+ ),
554
+ action(
555
+ 'neondeck_config_update_agent_models',
556
+ 'Update agent model choices',
557
+ {
558
+ ...safeMutation,
559
+ auditTarget: 'config_history',
560
+ },
561
+ 'Updates display-assistant, utility, self-improvement, or known subagent model strings using already registered providers.',
562
+ ),
563
+ action(
564
+ 'neondeck_config_update_learning',
565
+ 'Update learning config',
566
+ {
567
+ ...safeMutation,
568
+ auditTarget: 'config_history',
569
+ },
570
+ 'Updates learning, memory write, and memory curation policy without running reviews or mutating memory.',
571
+ ),
572
+ action(
573
+ 'neondeck_scheduled_task_briefing_create',
574
+ 'Create briefing task',
575
+ {
576
+ ...safeMutation,
577
+ auditTarget: 'scheduled_tasks/scheduled_task_runs',
578
+ },
579
+ 'Creates or updates a canonical timezone-aware briefing task without running it.',
580
+ ),
581
+ action(
582
+ 'neondeck_scheduled_task_instruction_create',
583
+ 'Create scheduled instruction',
584
+ {
585
+ ...safeMutation,
586
+ auditTarget: 'scheduled_tasks/scheduled_task_runs',
587
+ },
588
+ 'Creates or updates a bounded scheduled agent instruction with an explicit workflow or session target.',
589
+ ),
590
+ action(
591
+ 'neondeck_scheduled_task_pause',
592
+ 'Pause scheduled task',
593
+ {
594
+ ...safeMutation,
595
+ auditTarget: 'scheduled_tasks',
596
+ },
597
+ 'Pauses a scheduled task without deleting run history.',
598
+ ),
599
+ action(
600
+ 'neondeck_scheduled_task_resume',
601
+ 'Resume scheduled task',
602
+ {
603
+ ...safeMutation,
604
+ auditTarget: 'scheduled_tasks',
605
+ },
606
+ 'Resumes a scheduled task without immediately executing it.',
607
+ ),
608
+ action(
609
+ 'neondeck_scheduled_task_delete',
610
+ 'Delete scheduled task',
611
+ {
612
+ ...destructiveMutation,
613
+ auditTarget: 'scheduled_tasks/scheduled_task_runs',
614
+ },
615
+ 'Deletes a scheduled task and its local run history after confirm=true.',
616
+ ),
617
+ action(
618
+ 'neondeck_config_update_provider',
619
+ 'Update allowlisted provider config',
620
+ {
621
+ ...safeMutation,
622
+ auditTarget: 'config_history',
623
+ },
624
+ 'Updates allowlisted provider settings using environment variable references only; server restart is required.',
625
+ ),
626
+ action(
627
+ 'neondeck_config_update_execution_policy',
628
+ 'Update execution approval policy',
629
+ {
630
+ ...safeMutation,
631
+ auditTarget: 'config_history',
632
+ },
633
+ 'Updates allowed execution backends and preapproved single-command patterns. It does not execute commands.',
634
+ ),
635
+ action(
636
+ 'neondeck_config_update_worktree_policy',
637
+ 'Update worktree policy',
638
+ {
639
+ ...safeMutation,
640
+ auditTarget: 'config_history',
641
+ },
642
+ 'Updates default worktree storage and cleanup policy. Faster deletion policies should be confirmed with the user first.',
643
+ ),
644
+ action(
645
+ 'neondeck_config_update_dashboard_layout',
646
+ 'Update dashboard layout',
647
+ {
648
+ ...safeMutation,
649
+ auditTarget: 'config_history',
650
+ },
651
+ 'Replaces dashboard.json with a validated statusline plus tabbed-region layout.',
652
+ ),
653
+ action(
654
+ 'neondeck_config_apply_dashboard_preset',
655
+ 'Apply dashboard layout preset',
656
+ {
657
+ ...safeMutation,
658
+ auditTarget: 'config_history',
659
+ },
660
+ 'Applies a known dashboard layout preset such as classic or cockpit.',
661
+ ),
662
+ action(
663
+ 'neondeck_mcp_server_add',
664
+ 'Add MCP server',
665
+ {
666
+ ...safeMutation,
667
+ auditTarget: 'config_history',
668
+ },
669
+ 'Adds a strict mcp.json server entry using environment-variable references for secrets.',
670
+ ),
671
+ action(
672
+ 'neondeck_mcp_server_update',
673
+ 'Update MCP server',
674
+ {
675
+ ...safeMutation,
676
+ auditTarget: 'config_history',
677
+ },
678
+ 'Updates a strict mcp.json server entry and refreshes the registry.',
679
+ ),
680
+ action(
681
+ 'neondeck_mcp_server_enable',
682
+ 'Enable MCP server',
683
+ {
684
+ ...safeMutation,
685
+ auditTarget: 'config_history',
686
+ },
687
+ 'Enables a configured MCP server and refreshes its connection.',
688
+ ),
689
+ action(
690
+ 'neondeck_mcp_server_disable',
691
+ 'Disable MCP server',
692
+ {
693
+ ...safeMutation,
694
+ auditTarget: 'config_history',
695
+ },
696
+ 'Disables a configured MCP server and closes its connection.',
697
+ ),
698
+ action(
699
+ 'neondeck_mcp_registry_refresh',
700
+ 'Refresh MCP registry',
701
+ readOnly,
702
+ 'Reconnects one safe HTTP/OAuth MCP server from the model action surface. Full refresh is available from user-owned API/CLI surfaces.',
703
+ ),
704
+ action(
705
+ 'neondeck_mcp_status',
706
+ 'Read MCP status action',
707
+ readOnly,
708
+ 'Reads MCP server connection status and tool counts through an action surface.',
709
+ ),
710
+ action(
711
+ 'neondeck_mcp_login_start',
712
+ 'Start MCP OAuth login',
713
+ {
714
+ ...safeMutation,
715
+ auditTarget: 'mcp_oauth_logins/mcp_oauth_tokens',
716
+ },
717
+ 'Creates a state-bound OAuth login record and returns a user-facing authorization URL.',
718
+ ),
719
+ action(
720
+ 'neondeck_mcp_logout',
721
+ 'Remove MCP OAuth tokens',
722
+ {
723
+ ...destructiveMutation,
724
+ auditTarget: 'mcp_oauth_tokens',
725
+ },
726
+ 'Requires confirm=true before deleting stored OAuth tokens for one MCP server.',
727
+ ),
728
+ action(
729
+ 'neondeck_mcp_approval_resolve',
730
+ 'Resolve MCP approval',
731
+ {
732
+ ...destructiveMutation,
733
+ auditTarget:
734
+ 'mcp_tool_approvals/chat_session_command_events/notifications',
735
+ },
736
+ 'User-owned approval resolver for local API and CLI surfaces. It records the decision and nudges the requesting display-assistant session when linked. This action is not registered on the display assistant to prevent self-approval.',
737
+ ),
738
+ action(
739
+ 'neondeck_mcp_server_remove',
740
+ 'Remove MCP server',
741
+ {
742
+ ...destructiveMutation,
743
+ auditTarget: 'config_history/mcp_tool_approvals/mcp_oauth_tokens',
744
+ },
745
+ 'Requires confirm=true before removing an MCP server and cached MCP runtime state.',
746
+ ),
747
+ action(
748
+ 'neondeck_config_update_handoff',
749
+ 'Update handoff config',
750
+ {
751
+ ...safeMutation,
752
+ auditTarget: 'config_history',
753
+ },
754
+ 'Updates external agent handoff policy, including whether external registrations can queue bounded PR review assistance.',
755
+ ),
756
+ action(
757
+ 'neondeck_scheduler_tick',
758
+ 'Run due scheduled tasks',
759
+ {
760
+ ...safeMutation,
761
+ auditTarget:
762
+ 'scheduled_tasks/scheduled_task_runs/notifications/workflow_events',
763
+ },
764
+ 'Claims due scheduled tasks and records task runs, notifications, and Flue workflow admissions.',
765
+ ),
766
+ action(
767
+ 'neondeck_watch_pr_add',
768
+ 'Add PR watch',
769
+ {
770
+ ...safeMutation,
771
+ auditTarget: 'pr_watches/scheduled_tasks',
772
+ },
773
+ 'Creates a durable PR watch and its canonical polling task after GitHub PR lookup.',
774
+ ),
775
+ action(
776
+ 'neondeck_watch_pr_refresh',
777
+ 'Refresh PR watch',
778
+ {
779
+ ...safeMutation,
780
+ auditTarget: 'pr_watches/notifications',
781
+ },
782
+ 'Refreshes a watch and records meaningful state changes; silent no-op refreshes should not notify.',
783
+ ),
784
+ action(
785
+ 'neondeck_github_pr_event_state_get',
786
+ 'Fetch PR event state',
787
+ readOnly,
788
+ 'Fetches read-only GitHub PR event facts without persisting watermarks.',
789
+ ),
790
+ action(
791
+ 'neondeck_github_pr_review_threads_get',
792
+ 'Fetch PR review threads',
793
+ readOnly,
794
+ 'Fetches read-only GitHub PR review thread and unresolved comment facts.',
795
+ ),
796
+ action(
797
+ 'neondeck_github_pr_files_get',
798
+ 'Fetch PR file diffs',
799
+ readOnly,
800
+ 'Fetches read-only GitHub PR file patches and per-file diff metadata.',
801
+ ),
802
+ action(
803
+ 'neondeck_github_pr_requested_changes_get',
804
+ 'Fetch requested changes',
805
+ readOnly,
806
+ 'Fetches read-only requested-changes review facts for a PR.',
807
+ ),
808
+ action(
809
+ 'neondeck_github_pr_branch_permissions_get',
810
+ 'Fetch PR branch permissions',
811
+ readOnly,
812
+ 'Fetches read-only branch push permission facts without pushing.',
813
+ ),
814
+ action(
815
+ 'neondeck_pr_comment',
816
+ 'Post PR comment',
817
+ unauditedSafeMutation,
818
+ 'Posts a GitHub PR comment through the server-side GitHub token and returns normalized comment metadata. Durable PR-comment audit records are deferred to the autopilot queue persistence slice.',
819
+ ),
820
+ action(
821
+ 'neondeck_pr_watch_event_state_refresh',
822
+ 'Refresh PR event watermarks',
823
+ {
824
+ ...safeMutation,
825
+ auditTarget: 'pr_watch_event_watermarks',
826
+ },
827
+ 'Fetches read-only GitHub PR event facts and updates per-watch app-state watermarks only.',
828
+ ),
829
+ action(
830
+ 'neondeck_pr_watch_event_watermarks_list',
831
+ 'List PR event watermarks',
832
+ readOnly,
833
+ 'Lists persisted PR watch event watermarks.',
834
+ ),
835
+ route(
836
+ '/api/github/prs/:owner/:repo/:number',
837
+ 'Fetch PR metadata API',
838
+ readOnly,
839
+ 'Local API route for fetching read-only PR metadata with the server-side GitHub token.',
840
+ ),
841
+ route(
842
+ '/api/github/prs/:owner/:repo/:number/files',
843
+ 'Fetch PR file diffs API',
844
+ readOnly,
845
+ 'Local API route for fetching read-only PR file patches with the server-side GitHub token.',
846
+ ),
847
+ route(
848
+ '/api/github/prs/:owner/:repo/:number/review-draft',
849
+ 'Manage PR review draft API',
850
+ {
851
+ ...safeMutation,
852
+ auditTarget: 'pr_review_drafts/pr_review_draft_comments',
853
+ },
854
+ 'User-surface-only local API for reading, saving, and discarding durable PR review drafts. This route is not registered as a model-callable action or tool.',
855
+ ),
856
+ route(
857
+ '/api/github/prs/:owner/:repo/:number/review-draft/comments',
858
+ 'Create PR review draft comment API',
859
+ {
860
+ ...safeMutation,
861
+ auditTarget: 'pr_review_drafts/pr_review_draft_comments',
862
+ },
863
+ 'User-surface-only local API for saving inline PR review draft comments in app DB only.',
864
+ ),
865
+ route(
866
+ '/api/github/prs/:owner/:repo/:number/review-draft/comments/:id',
867
+ 'Update PR review draft comment API',
868
+ {
869
+ ...safeMutation,
870
+ auditTarget: 'pr_review_drafts/pr_review_draft_comments',
871
+ },
872
+ 'User-surface-only local API for editing or deleting app-DB PR review draft comments.',
873
+ ),
874
+ route(
875
+ '/api/github/prs/:owner/:repo/:number/reviews',
876
+ 'Submit PR review API',
877
+ {
878
+ ...safeMutation,
879
+ auditTarget: 'workflow_summaries/GitHub',
880
+ },
881
+ 'User-surface-only local API for submitting a human-authored GitHub PR review with inline comments and a verdict. Neon has no action or tool path to this route.',
882
+ ),
883
+ route(
884
+ '/api/github/prs/:owner/:repo/:number/review-threads/:threadId/reply',
885
+ 'Reply to PR review thread API',
886
+ unauditedSafeMutation,
887
+ 'User-surface-only local API for posting an immediate human-authored reply to an existing GitHub review thread after verifying it belongs to the route PR. Thread replies are visible on GitHub and are not individually audited.',
888
+ ),
889
+ route(
890
+ '/api/github/prs/:owner/:repo/:number/review-threads/:threadId/resolve',
891
+ 'Resolve PR review thread API',
892
+ unauditedSafeMutation,
893
+ 'User-surface-only local API for resolving an existing GitHub review thread after verifying it belongs to the route PR. Resolution is user-owned and not model-callable.',
894
+ ),
895
+ route(
896
+ '/api/github/prs/:owner/:repo/:number/review-threads/:threadId/unresolve',
897
+ 'Unresolve PR review thread API',
898
+ unauditedSafeMutation,
899
+ 'User-surface-only local API for unresolving an existing GitHub review thread after verifying it belongs to the route PR. Resolution is user-owned and not model-callable.',
900
+ ),
901
+ route(
902
+ '/api/github/prs/comment',
903
+ 'Post PR comment API',
904
+ unauditedSafeMutation,
905
+ 'Local API route for posting a bounded PR comment with the server-side GitHub token. Durable PR-comment audit records are deferred to the autopilot queue persistence slice.',
906
+ ),
907
+ action(
908
+ 'neondeck_watch_ref_add',
909
+ 'Add ref watch',
910
+ {
911
+ ...safeMutation,
912
+ auditTarget: 'ref_watches/jobs',
913
+ },
914
+ 'Creates durable branch or commit ref watch and job records after GitHub check lookup.',
915
+ ),
916
+ action(
917
+ 'neondeck_watch_ref_refresh',
918
+ 'Refresh ref watch',
919
+ {
920
+ ...safeMutation,
921
+ auditTarget: 'ref_watches/notifications',
922
+ },
923
+ 'Refreshes a branch or commit ref watch and records meaningful state changes; silent no-op refreshes should not notify.',
924
+ ),
925
+ action(
926
+ 'neondeck_worktree_create',
927
+ 'Create or adopt worktree',
928
+ {
929
+ ...safeMutation,
930
+ auditTarget: 'worktrees/worktree_events',
931
+ },
932
+ 'Creates or adopts a git worktree only inside declared Neondeck worktree roots.',
933
+ ),
934
+ action(
935
+ 'neondeck_autopilot_prepare_pr_worktree',
936
+ 'Prepare PR worktree',
937
+ {
938
+ ...safeMutation,
939
+ auditTarget: 'worktrees/worktree_locks',
940
+ },
941
+ 'Creates, syncs, locks, and inspects a Neondeck-managed PR worktree, but does not edit, commit, push, or comment.',
942
+ ),
943
+ action(
944
+ 'neondeck_autopilot_fix_pr_review_feedback',
945
+ 'Fix PR review feedback',
946
+ {
947
+ ...safeMutation,
948
+ auditTarget: 'worktrees/repo_edit_events/prepared_diffs',
949
+ },
950
+ 'Fetches unresolved review feedback, groups it into a plan, applies caller-supplied bounded repo-edit changes inside an isolated worktree, commits locally, and prepares a diff without pushing or commenting.',
951
+ ),
952
+ action(
953
+ 'neondeck_prepared_diff_list',
954
+ 'List prepared diffs',
955
+ readOnly,
956
+ 'Lists prepared diffs and pending prepared-diff decisions.',
957
+ ),
958
+ action(
959
+ 'neondeck_prepared_diff_summary',
960
+ 'Read prepared diff summary',
961
+ readOnly,
962
+ 'Reads one prepared-diff record and backend-computed git diff summary from the source worktree.',
963
+ ),
964
+ action(
965
+ 'neondeck_prepared_diff_changed_files',
966
+ 'Read prepared diff files',
967
+ readOnly,
968
+ 'Reads changed files for a prepared diff through backend git helpers.',
969
+ ),
970
+ action(
971
+ 'neondeck_prepared_diff_file_diff',
972
+ 'Read prepared file diff',
973
+ readOnly,
974
+ 'Reads one prepared file patch through backend git helpers.',
975
+ ),
976
+ action(
977
+ 'neondeck_prepared_diff_open_worktree',
978
+ 'Open prepared diff worktree',
979
+ readOnly,
980
+ 'Returns the managed source worktree path for a prepared diff.',
981
+ ),
982
+ tool(
983
+ 'neondeck_autopilot_recovery_options_lookup',
984
+ 'Read autopilot recovery options',
985
+ readOnly,
986
+ 'Reads bounded recovery options for a prepared diff without mutating app state or repos.',
987
+ ),
988
+ action(
989
+ 'neondeck_autopilot_recovery_options',
990
+ 'Read autopilot recovery options',
991
+ readOnly,
992
+ 'Reads bounded recovery options for a prepared diff without mutating app state or repos.',
993
+ ),
994
+ action(
995
+ 'neondeck_autopilot_recovery_run',
996
+ 'Run autopilot recovery action',
997
+ {
998
+ ...hostExecution,
999
+ auditTarget:
1000
+ 'prepared_diffs/prepared_diff_approvals/worktrees/workflow_summaries/notifications/execution_approvals',
1001
+ },
1002
+ 'Dispatches one bounded recovery action to existing prepared-diff, worktree sync/cleanup, or autopilot workflow services; confirmation, execution, policy, GitHub, and push gates are still enforced by the delegated service.',
1003
+ ),
1004
+ action(
1005
+ 'neondeck_prepared_diff_run_verification',
1006
+ 'Request prepared diff verification',
1007
+ {
1008
+ ...safeMutation,
1009
+ auditTarget: 'prepared_diffs/prepared_diff_approvals',
1010
+ },
1011
+ 'Records a verification request; actual host command execution remains owned by verify_pr_worktree and execution approvals.',
1012
+ ),
1013
+ action(
1014
+ 'neondeck_prepared_diff_request_revision',
1015
+ 'Request prepared diff revision',
1016
+ {
1017
+ ...safeMutation,
1018
+ auditTarget: 'prepared_diffs/prepared_diff_approvals',
1019
+ },
1020
+ 'Records an operator revision request while retaining the source worktree.',
1021
+ ),
1022
+ action(
1023
+ 'neondeck_prepared_diff_approve_push',
1024
+ 'Approve prepared diff push',
1025
+ {
1026
+ ...destructiveMutation,
1027
+ auditTarget: 'prepared_diffs/prepared_diff_approvals',
1028
+ },
1029
+ 'Requires confirm=true and records push-back approval; the later push workflow performs GitHub mutations.',
1030
+ ),
1031
+ action(
1032
+ 'neondeck_prepared_diff_abandon',
1033
+ 'Abandon prepared diff',
1034
+ {
1035
+ ...destructiveMutation,
1036
+ auditTarget: 'prepared_diffs/prepared_diff_approvals/worktree_events',
1037
+ },
1038
+ 'Requires confirm=true and abandons the prepared-diff record without directly deleting the source worktree.',
1039
+ ),
1040
+ action(
1041
+ 'neondeck_autopilot_policy_check',
1042
+ 'Check autopilot policy',
1043
+ readOnly,
1044
+ 'Classifies a worktree diff against autopilot limits, high-risk file classes, push destination policy, and concurrency settings without mutating repos or GitHub.',
1045
+ ),
1046
+ action(
1047
+ 'neondeck_autopilot_fix_pr_ci_failure',
1048
+ 'Fix PR CI failure',
1049
+ {
1050
+ ...hostExecution,
1051
+ auditTarget:
1052
+ 'worktrees/worktree_locks/repo_edit_events/prepared_diffs/execution_approvals',
1053
+ },
1054
+ 'Fetches deterministic failing check facts/log availability, runs configured diagnostics through execution policy, applies an optional scoped repo-edit patch in a managed worktree, commits locally, and creates a prepared diff without pushing or commenting.',
1055
+ ),
1056
+ action(
1057
+ 'neondeck_autopilot_verify_pr_worktree',
1058
+ 'Verify PR worktree',
1059
+ {
1060
+ ...hostExecution,
1061
+ auditTarget: 'execution_approvals/workflow_events',
1062
+ },
1063
+ 'Runs configured repo checks through Neondeck execution approval policy and records execution approvals/results.',
1064
+ ),
1065
+ action(
1066
+ 'neondeck_autopilot_comment_pr_autofix_result',
1067
+ 'Comment PR autofix result',
1068
+ {
1069
+ ...safeMutation,
1070
+ auditTarget: 'workflow_summaries/GitHub issue comments',
1071
+ },
1072
+ 'Posts a concise PR comment generated only from prepared-diff/autopilot result facts and persists the rendered audit summary.',
1073
+ ),
1074
+ action(
1075
+ 'neondeck_autopilot_push_pr_autofix',
1076
+ 'Push PR autofix',
1077
+ {
1078
+ ...destructiveMutation,
1079
+ auditTarget: 'prepared_diffs/worktrees/worktree_events/notifications',
1080
+ },
1081
+ 'Pushes an approved and verified prepared diff back to the PR head branch only when autopilot policy, GitHub branch permissions, and clean committed worktree state allow it; blocked attempts retain the worktree.',
1082
+ ),
1083
+ action(
1084
+ 'neondeck_worktree_sync',
1085
+ 'Sync worktree',
1086
+ {
1087
+ ...safeMutation,
1088
+ auditTarget: 'worktrees/worktree_events',
1089
+ },
1090
+ 'Moves or rebases a clean managed worktree to a requested head ref or SHA and records lifecycle events.',
1091
+ ),
1092
+ action(
1093
+ 'neondeck_worktree_lock',
1094
+ 'Lock worktree or PR',
1095
+ {
1096
+ ...safeMutation,
1097
+ auditTarget: 'worktree_locks/worktree_events',
1098
+ },
1099
+ 'Acquires expiring per-worktree or per-PR locks and recovers stale locks.',
1100
+ ),
1101
+ action(
1102
+ 'neondeck_worktree_release',
1103
+ 'Release worktree lock',
1104
+ {
1105
+ ...safeMutation,
1106
+ auditTarget: 'worktree_locks/worktree_events',
1107
+ },
1108
+ 'Releases a lock and records the final bounded-work status.',
1109
+ ),
1110
+ action(
1111
+ 'neondeck_kilo_task_start',
1112
+ 'Start Kilo handoff',
1113
+ {
1114
+ ...hostExecution,
1115
+ auditTarget: 'kilo_tasks/kilo_task_events',
1116
+ },
1117
+ 'Starts Kilo only after an explicit user handoff request and only inside a declared repo or Neondeck-managed worktree.',
1118
+ ),
1119
+ action(
1120
+ 'neondeck_kilo_task_status',
1121
+ 'Read Kilo task status',
1122
+ readOnly,
1123
+ 'Reads one persisted Kilo task status record.',
1124
+ ),
1125
+ action(
1126
+ 'neondeck_kilo_task_events',
1127
+ 'Read Kilo task events',
1128
+ readOnly,
1129
+ 'Reads captured Kilo stdout/stderr and JSON event summaries.',
1130
+ ),
1131
+ action(
1132
+ 'neondeck_kilo_task_abort',
1133
+ 'Abort Kilo handoff',
1134
+ {
1135
+ ...destructiveMutation,
1136
+ auditTarget: 'kilo_tasks/kilo_task_events',
1137
+ },
1138
+ 'Terminates a running delegated Kilo process and marks the task cancelled.',
1139
+ ),
1140
+ action(
1141
+ 'neondeck_kilo_task_sessions',
1142
+ 'Read Kilo task sessions',
1143
+ readOnly,
1144
+ 'Reads root and child Kilo session ids linked to one task.',
1145
+ ),
1146
+ action(
1147
+ 'neondeck_kilo_task_diff',
1148
+ 'Read Kilo task diff',
1149
+ readOnly,
1150
+ 'Reads a git diff summary for the workspace used by a Kilo task.',
1151
+ ),
1152
+ action(
1153
+ 'neondeck_kilo_task_reconcile',
1154
+ 'Reconcile Kilo task',
1155
+ {
1156
+ ...safeMutation,
1157
+ auditTarget: 'kilo_tasks/kilo_task_events/worktree_events',
1158
+ },
1159
+ 'Reconciles persisted Kilo task state after restart by inspecting detached process, session, and diff facts.',
1160
+ ),
1161
+ action(
1162
+ 'neondeck_kilo_sessions_search',
1163
+ 'Search Kilo sessions',
1164
+ readOnly,
1165
+ 'Searches linked task metadata and Kilo CLI session metadata.',
1166
+ ),
1167
+ action(
1168
+ 'neondeck_kilo_session_read',
1169
+ 'Read Kilo session',
1170
+ readOnly,
1171
+ 'Reads normalized Kilo session metadata without reading storage directly.',
1172
+ ),
1173
+ action(
1174
+ 'neondeck_kilo_session_messages',
1175
+ 'Read Kilo session messages',
1176
+ readOnly,
1177
+ 'Audits transcript-read intent; the CLI MVP reports transcript adapter availability.',
1178
+ ),
1179
+ action(
1180
+ 'neondeck_kilo_session_children',
1181
+ 'Read Kilo child sessions',
1182
+ readOnly,
1183
+ 'Reads child session ids captured from Kilo task events.',
1184
+ ),
1185
+ action(
1186
+ 'neondeck_kilo_session_todos',
1187
+ 'Read Kilo todos',
1188
+ readOnly,
1189
+ 'Reports Kilo todo adapter availability through the typed Kilo surface.',
1190
+ ),
1191
+ action(
1192
+ 'neondeck_kilo_session_diff',
1193
+ 'Read Kilo session diff',
1194
+ readOnly,
1195
+ 'Reads the linked task workspace diff summary for a Kilo session.',
1196
+ ),
1197
+ action(
1198
+ 'neondeck_kilo_result_review',
1199
+ 'Review Kilo result',
1200
+ {
1201
+ ...safeMutation,
1202
+ auditTarget: 'kilo_result_state/kilo_result_events/prepared_diffs',
1203
+ },
1204
+ 'Classifies a Kilo-produced diff with deterministic facts and autopilot policy, then records review state.',
1205
+ ),
1206
+ action(
1207
+ 'neondeck_kilo_result_verify',
1208
+ 'Verify Kilo result',
1209
+ {
1210
+ ...hostExecution,
1211
+ auditTarget: 'kilo_result_state/kilo_result_events/execution_approvals',
1212
+ },
1213
+ 'Runs checks for a Kilo task worktree through the Neondeck execution approval policy.',
1214
+ ),
1215
+ action(
1216
+ 'neondeck_kilo_result_promote',
1217
+ 'Promote Kilo result',
1218
+ {
1219
+ ...safeMutation,
1220
+ auditTarget: 'kilo_result_state/kilo_result_events',
1221
+ },
1222
+ 'Records the safe promotion admission decision without committing, pushing, or commenting.',
1223
+ ),
1224
+ action(
1225
+ 'neondeck_skills_reload',
1226
+ 'Reload runtime skills',
1227
+ {
1228
+ ...safeMutation,
1229
+ auditTarget: 'runtime skill cache',
1230
+ },
1231
+ 'Rescans trusted local runtime skill folders. A new session is required before changed skills affect prompt context.',
1232
+ ),
1233
+ action(
1234
+ 'neondeck_memory_learn',
1235
+ 'Learn structured memory',
1236
+ {
1237
+ ...safeMutation,
1238
+ auditTarget: 'memories/memory_events/learning_events',
1239
+ },
1240
+ 'Writes user, local, or project current-guidance memory. Autonomous writes obey learning.memoryWriteMode.',
1241
+ ),
1242
+ action(
1243
+ 'neondeck_memory_rewrite',
1244
+ 'Rewrite structured memory',
1245
+ {
1246
+ ...safeMutation,
1247
+ auditTarget: 'memories/memory_events',
1248
+ },
1249
+ 'Rewrites one memory row with before/after audit. Autonomous rewrites obey learning.memoryWriteMode.',
1250
+ ),
1251
+ action(
1252
+ 'neondeck_memory_merge',
1253
+ 'Merge structured memories',
1254
+ {
1255
+ ...safeMutation,
1256
+ auditTarget: 'memories/memory_events',
1257
+ },
1258
+ 'Merges duplicate memories by rewriting a target and archiving source rows with audit history.',
1259
+ ),
1260
+ action(
1261
+ 'neondeck_memory_archive',
1262
+ 'Archive structured memory',
1263
+ {
1264
+ ...safeMutation,
1265
+ auditTarget: 'memories/memory_events',
1266
+ },
1267
+ 'Archives one memory so it no longer loads into new prompt snapshots while preserving audit history.',
1268
+ ),
1269
+ action(
1270
+ 'neondeck_memory_mark_used',
1271
+ 'Mark memory used',
1272
+ {
1273
+ ...safeMutation,
1274
+ auditTarget: 'memories',
1275
+ },
1276
+ 'Updates memory usage counters without creating a prompt-context-changing memory event.',
1277
+ ),
1278
+ action(
1279
+ 'neondeck_memory_candidate_create',
1280
+ 'Create memory candidate',
1281
+ {
1282
+ ...safeMutation,
1283
+ auditTarget: 'learning_candidates/learning_events',
1284
+ },
1285
+ 'Creates a review-mode memory candidate without mutating active memory.',
1286
+ ),
1287
+ action(
1288
+ 'neondeck_memory_candidate_decide',
1289
+ 'Decide memory candidate',
1290
+ {
1291
+ ...safeMutation,
1292
+ auditTarget: 'learning_candidates/memories/memory_events',
1293
+ },
1294
+ 'Applies, rejects, or archives a memory candidate after explicit user/API decision.',
1295
+ ),
1296
+ action(
1297
+ 'neondeck_memory_curate',
1298
+ 'Curate memory store',
1299
+ {
1300
+ ...safeMutation,
1301
+ auditTarget: 'learning_candidates/memories/memory_events',
1302
+ },
1303
+ 'Runs bounded memory curation. Review mode creates candidates; auto mode may apply audited archive cleanup.',
1304
+ ),
1305
+ action(
1306
+ 'neondeck_learning_skill_patch_propose',
1307
+ 'Propose skill patch',
1308
+ {
1309
+ ...safeMutation,
1310
+ auditTarget: 'learning_candidates/learning_events',
1311
+ },
1312
+ 'Creates a diff-backed skill patch candidate for the built-in neondeck skill or safe user runtime skills.',
1313
+ ),
1314
+ action(
1315
+ 'neondeck_learning_skill_patch_apply',
1316
+ 'Apply skill patch',
1317
+ {
1318
+ ...safeMutation,
1319
+ auditTarget: 'learning_candidates/config_history/learning_events',
1320
+ },
1321
+ 'Applies one proposed skill patch after policy or explicit review and stores before/after audit data.',
1322
+ ),
1323
+ action(
1324
+ 'neondeck_learning_skill_patch_reject',
1325
+ 'Reject skill patch',
1326
+ {
1327
+ ...safeMutation,
1328
+ auditTarget: 'learning_candidates/learning_events',
1329
+ },
1330
+ 'Rejects one proposed skill patch candidate.',
1331
+ ),
1332
+ action(
1333
+ 'neondeck_learning_skill_patch_list',
1334
+ 'List skill patches',
1335
+ readOnly,
1336
+ 'Lists skill patch candidates and decision history.',
1337
+ ),
1338
+ action(
1339
+ 'neondeck_learning_skill_patch_restore',
1340
+ 'Restore skill patch',
1341
+ {
1342
+ ...safeMutation,
1343
+ auditTarget: 'learning_events/config_history/SKILL.md',
1344
+ },
1345
+ 'Restores an applied skill patch from audited before-content after explicit user/API confirmation, only when the current skill file still matches the applied content.',
1346
+ ),
1347
+ action(
1348
+ 'neondeck_learning_operator_state',
1349
+ 'Read learning operator state',
1350
+ readOnly,
1351
+ 'Reads consolidated learning reviews, candidates, memory decisions, skill patch decisions, and audit history.',
1352
+ ),
1353
+ action(
1354
+ 'neondeck_session_create',
1355
+ 'Create chat session',
1356
+ {
1357
+ ...safeMutation,
1358
+ auditTarget: 'chat_sessions/chat_session_surfaces/chat_session_audit',
1359
+ },
1360
+ 'Creates indexed chat session metadata and optionally activates it for a surface.',
1361
+ ),
1362
+ action(
1363
+ 'neondeck_session_switch',
1364
+ 'Switch active chat session',
1365
+ {
1366
+ ...safeMutation,
1367
+ auditTarget: 'chat_session_surfaces/chat_session_audit',
1368
+ },
1369
+ 'Switches a dashboard or future TUI surface to an existing non-archived session.',
1370
+ ),
1371
+ action(
1372
+ 'neondeck_session_rename',
1373
+ 'Rename chat session',
1374
+ {
1375
+ ...safeMutation,
1376
+ auditTarget: 'chat_sessions/chat_session_audit',
1377
+ },
1378
+ 'Renames indexed chat session metadata.',
1379
+ ),
1380
+ action(
1381
+ 'neondeck_session_pin',
1382
+ 'Pin chat session',
1383
+ {
1384
+ ...safeMutation,
1385
+ auditTarget: 'chat_sessions/chat_session_audit',
1386
+ },
1387
+ 'Pins or unpins indexed chat session metadata.',
1388
+ ),
1389
+ action(
1390
+ 'neondeck_session_archive',
1391
+ 'Archive chat session',
1392
+ {
1393
+ ...safeMutation,
1394
+ auditTarget: 'chat_sessions/chat_session_audit',
1395
+ },
1396
+ 'Archives session metadata without deleting Flue transcript history.',
1397
+ ),
1398
+ action(
1399
+ 'neondeck_session_restore',
1400
+ 'Restore chat session',
1401
+ {
1402
+ ...safeMutation,
1403
+ auditTarget: 'chat_sessions/chat_session_audit',
1404
+ },
1405
+ 'Restores archived session metadata.',
1406
+ ),
1407
+ action(
1408
+ 'neondeck_session_link_context',
1409
+ 'Link chat session context',
1410
+ {
1411
+ ...safeMutation,
1412
+ auditTarget: 'chat_sessions/chat_session_audit',
1413
+ },
1414
+ 'Links repo, watch, task, UI metadata, or summary data to indexed session metadata.',
1415
+ ),
1416
+ action(
1417
+ 'neondeck_config_remove_repo',
1418
+ 'Remove repository config',
1419
+ {
1420
+ ...destructiveMutation,
1421
+ auditTarget: 'config_history',
1422
+ },
1423
+ 'Requires confirm=true before removing a configured repository.',
1424
+ ),
1425
+ action(
1426
+ 'neondeck_watch_pr_remove',
1427
+ 'Remove PR watch',
1428
+ {
1429
+ ...destructiveMutation,
1430
+ auditTarget: 'pr_watches/scheduled_tasks/scheduled_task_runs',
1431
+ },
1432
+ 'Requires confirm=true before removing the watch and its polling task history.',
1433
+ ),
1434
+ action(
1435
+ 'neondeck_worktree_cleanup',
1436
+ 'Clean up worktrees',
1437
+ {
1438
+ ...destructiveMutation,
1439
+ auditTarget: 'worktrees/worktree_cleanup_attempts',
1440
+ },
1441
+ 'Deletes eligible Neondeck-owned worktrees according to cleanup policy and never deletes adopted worktrees without explicit confirmation.',
1442
+ ),
1443
+ workflow(
1444
+ 'command-run',
1445
+ 'Run command workflow',
1446
+ {
1447
+ ...safeMutation,
1448
+ auditTarget: 'workflow_summaries/workflow_events',
1449
+ },
1450
+ 'Runs a bounded command through Flue with durable run identity and summaries.',
1451
+ ),
1452
+ workflow(
1453
+ 'briefing',
1454
+ 'Run briefing workflow',
1455
+ {
1456
+ ...safeMutation,
1457
+ auditTarget: 'workflow_summaries/workflow_events',
1458
+ },
1459
+ 'Runs the bounded briefing workflow and records Flue observations.',
1460
+ ),
1461
+ workflow(
1462
+ 'watch-pr',
1463
+ 'Run watch-pr workflow',
1464
+ {
1465
+ ...safeMutation,
1466
+ auditTarget: 'pr_watches/jobs/workflow_events',
1467
+ },
1468
+ 'Creates a PR watch through the Flue workflow surface.',
1469
+ ),
1470
+ workflow(
1471
+ 'review-pr-for-human',
1472
+ 'Run PR review assist workflow',
1473
+ {
1474
+ ...safeMutation,
1475
+ auditTarget:
1476
+ 'reports/pr_review_drafts/pr_review_draft_comments/notifications/workflow_events',
1477
+ },
1478
+ 'Runs bounded PR review assistance through the Flue workflow surface, creating local reports and Neon-origin draft comments only.',
1479
+ ),
1480
+ workflow(
1481
+ 'fix-pr-ci',
1482
+ 'Run PR CI fix workflow',
1483
+ {
1484
+ ...hostExecution,
1485
+ auditTarget:
1486
+ 'reports/worktrees/worktree_locks/kilo_tasks/kilo_task_events/prepared_diffs/notifications/workflow_events',
1487
+ },
1488
+ 'Runs bounded CI fix assistance through the Flue workflow surface, creating local reports, local worktree changes, and prepared diffs only. It does not push or comment.',
1489
+ ),
1490
+ workflow(
1491
+ 'scheduled-agent-instruction',
1492
+ 'Run scheduled instruction workflow',
1493
+ {
1494
+ ...safeMutation,
1495
+ auditTarget: 'scheduled_task_runs/workflow_events',
1496
+ },
1497
+ 'Runs one bounded scheduled instruction occurrence through Flue.',
1498
+ ),
1499
+ workflow(
1500
+ 'triage-pr-event',
1501
+ 'Run PR event triage workflow',
1502
+ readOnly,
1503
+ 'Classifies a structured PR watcher delta through the Flue workflow surface without mutating GitHub, repos, or worktrees.',
1504
+ ),
1505
+ workflow(
1506
+ 'prepare-pr-worktree',
1507
+ 'Run PR worktree preparation workflow',
1508
+ {
1509
+ ...safeMutation,
1510
+ auditTarget: 'worktrees/worktree_locks/workflow_events',
1511
+ },
1512
+ 'Creates, syncs, locks, and inspects an isolated PR worktree through the Flue workflow surface without fixing, committing, pushing, or commenting.',
1513
+ ),
1514
+ workflow(
1515
+ 'fix-pr-ci-failure',
1516
+ 'Run PR CI fixer workflow',
1517
+ {
1518
+ ...hostExecution,
1519
+ auditTarget:
1520
+ 'worktrees/worktree_locks/repo_edit_events/prepared_diffs/execution_approvals/workflow_events',
1521
+ },
1522
+ 'Runs the bounded PR CI fixer through the Flue workflow surface. It may apply scoped repo-edit patches, commit locally, and prepare a diff, but it does not push or comment.',
1523
+ ),
1524
+ workflow(
1525
+ 'fix-pr-review-feedback',
1526
+ 'Run PR review feedback fix workflow',
1527
+ {
1528
+ ...safeMutation,
1529
+ auditTarget: 'worktrees/repo_edit_events/prepared_diffs/workflow_events',
1530
+ },
1531
+ 'Plans review-feedback fixes from deterministic GitHub facts and applies only bounded repo-edit changes inside an isolated worktree; it commits locally and prepares a diff without pushing or commenting.',
1532
+ ),
1533
+ workflow(
1534
+ 'verify-pr-worktree',
1535
+ 'Run PR worktree verification workflow',
1536
+ {
1537
+ ...hostExecution,
1538
+ auditTarget: 'execution_approvals/workflow_events',
1539
+ },
1540
+ 'Runs configured checks for an isolated PR worktree through the execution approval policy before any push-back workflow is allowed.',
1541
+ ),
1542
+ workflow(
1543
+ 'verify-then-push-pr-autofix',
1544
+ 'Run PR autofix verify then push workflow',
1545
+ {
1546
+ ...destructiveMutation,
1547
+ auditTarget:
1548
+ 'execution_approvals/prepared_diffs/worktrees/worktree_events/notifications/workflow_events',
1549
+ },
1550
+ 'Runs configured checks for an approved prepared diff and then delegates to the bounded push workflow. Execution approvals, push policy, branch permissions, and clean-worktree gates remain authoritative.',
1551
+ ),
1552
+ workflow(
1553
+ 'push-pr-autofix',
1554
+ 'Run PR autofix push workflow',
1555
+ {
1556
+ ...destructiveMutation,
1557
+ auditTarget:
1558
+ 'prepared_diffs/worktrees/worktree_events/notifications/workflow_events',
1559
+ },
1560
+ 'Runs the bounded PR autofix push workflow. It pushes only approved and verified prepared diffs, and records blocked attempts without deleting worktrees.',
1561
+ ),
1562
+ workflow(
1563
+ 'dev-doctor',
1564
+ 'Run dev-doctor workflow',
1565
+ readOnly,
1566
+ 'Runs read-only local diagnostics through the Flue workflow surface.',
1567
+ ),
1568
+ workflow(
1569
+ 'scheduler-tick',
1570
+ 'Run scheduler-tick workflow',
1571
+ {
1572
+ ...safeMutation,
1573
+ auditTarget: 'jobs/notifications/workflow_events/reports',
1574
+ },
1575
+ 'Runs due scheduled work through the Flue workflow surface and records job outcomes, notifications, workflow observations, and scheduled report artifacts.',
1576
+ ),
1577
+ workflow(
1578
+ 'curate_learning_store',
1579
+ 'Run memory curation workflow',
1580
+ {
1581
+ ...safeMutation,
1582
+ auditTarget:
1583
+ 'learning_reviews/learning_candidates/memories/memory_events/workflow_events',
1584
+ },
1585
+ 'Runs bounded model-backed memory curation and applies or proposes changes through typed audited memory actions.',
1586
+ ),
1587
+ workflow(
1588
+ 'review_conversation_for_learning',
1589
+ 'Run conversation learning review workflow',
1590
+ {
1591
+ ...safeMutation,
1592
+ auditTarget:
1593
+ 'learning_reviews/learning_candidates/memories/memory_events/workflow_events',
1594
+ },
1595
+ 'Runs bounded model-backed conversation reflection and applies or proposes durable memory changes through typed audited memory actions.',
1596
+ ),
1597
+ workflow(
1598
+ 'review_pr_batch_for_learning',
1599
+ 'Run PR learning retrospective workflow',
1600
+ {
1601
+ ...safeMutation,
1602
+ auditTarget:
1603
+ 'learning_reviews/learning_candidates/memories/memory_events/config_history/workflow_events',
1604
+ },
1605
+ 'Runs bounded model-backed PR/autopilot retrospectives over compact summaries and applies or proposes memory and skill changes through typed actions.',
1606
+ ),
1607
+ workflow(
1608
+ 'handoff_to_kilo',
1609
+ 'Run Kilo handoff workflow',
1610
+ {
1611
+ ...hostExecution,
1612
+ auditTarget: 'kilo_tasks/kilo_task_events/workflow_events',
1613
+ },
1614
+ 'Admits an explicit Kilo handoff as a bounded Flue run, then lets the app supervisor own the background process.',
1615
+ ),
1616
+ workflow(
1617
+ 'reconcile_kilo_task',
1618
+ 'Reconcile Kilo task workflow',
1619
+ {
1620
+ ...safeMutation,
1621
+ auditTarget: 'kilo_tasks/kilo_task_events/worktree_events',
1622
+ },
1623
+ 'Reconciles persisted Kilo task state after restart by inspecting detached process, session, and diff facts.',
1624
+ ),
1625
+ workflow(
1626
+ 'summarize_kilo_session',
1627
+ 'Summarize Kilo session workflow',
1628
+ {
1629
+ ...safeMutation,
1630
+ auditTarget: 'kilo_tasks/workflow_events',
1631
+ },
1632
+ 'Summarizes linked Kilo task/session metadata and persists the bounded summary on the task record.',
1633
+ ),
1634
+ workflow(
1635
+ 'review_kilo_result',
1636
+ 'Review Kilo result workflow',
1637
+ {
1638
+ ...safeMutation,
1639
+ auditTarget: 'kilo_result_state/kilo_result_events/prepared_diffs',
1640
+ },
1641
+ 'Runs bounded Kilo result review and records classification in app state.',
1642
+ ),
1643
+ workflow(
1644
+ 'verify_kilo_result',
1645
+ 'Verify Kilo result workflow',
1646
+ {
1647
+ ...hostExecution,
1648
+ auditTarget: 'kilo_result_state/kilo_result_events/execution_approvals',
1649
+ },
1650
+ 'Runs configured Kilo result checks through execution approval policy.',
1651
+ ),
1652
+ workflow(
1653
+ 'promote_kilo_result',
1654
+ 'Promote Kilo result workflow',
1655
+ {
1656
+ ...safeMutation,
1657
+ auditTarget: 'kilo_result_state/kilo_result_events',
1658
+ },
1659
+ 'Runs the Kilo promotion admission layer and explicitly avoids commit, push, or PR comment mutation.',
1660
+ ),
1661
+ route(
1662
+ '/api/reports',
1663
+ 'Reports list API',
1664
+ readOnly,
1665
+ 'Lists local, self-contained Neondeck report artifacts for dashboard display.',
1666
+ ),
1667
+ route(
1668
+ '/api/reports/:id',
1669
+ 'Report metadata API',
1670
+ readOnly,
1671
+ 'Reads one local report metadata record by durable report id for dashboard and local clients.',
1672
+ ),
1673
+ route(
1674
+ '/api/reports/:id/stage-docs-fix',
1675
+ 'Stage docs drift fix API',
1676
+ {
1677
+ ...hostExecution,
1678
+ auditTarget:
1679
+ 'reports/worktrees/worktree_locks/kilo_tasks/kilo_task_events',
1680
+ },
1681
+ 'Starts a bounded docs-only Kilo handoff from a docs-drift report. It creates local worktree state only and never pushes or comments.',
1682
+ ),
1683
+ route(
1684
+ '/api/scheduled-tasks',
1685
+ 'Scheduled tasks API',
1686
+ {
1687
+ ...safeMutation,
1688
+ auditTarget: 'scheduled_tasks/scheduled_task_runs',
1689
+ },
1690
+ 'GET lists canonical scheduled tasks; task creation uses the typed briefing and instruction endpoints.',
1691
+ ),
1692
+ route(
1693
+ '/api/scheduled-tasks/briefings',
1694
+ 'Briefing task API',
1695
+ {
1696
+ ...safeMutation,
1697
+ auditTarget: 'scheduled_tasks/scheduled_task_runs',
1698
+ },
1699
+ 'Creates or updates canonical briefing tasks.',
1700
+ ),
1701
+ route(
1702
+ '/api/scheduled-tasks/instructions',
1703
+ 'Scheduled instruction API',
1704
+ {
1705
+ ...safeMutation,
1706
+ auditTarget: 'scheduled_tasks/scheduled_task_runs',
1707
+ },
1708
+ 'Creates or updates bounded scheduled agent instructions.',
1709
+ ),
1710
+ route(
1711
+ '/api/scheduled-tasks/:id',
1712
+ 'Scheduled task detail API',
1713
+ {
1714
+ ...readOnly,
1715
+ auditTarget: 'scheduled_tasks/scheduled_task_runs',
1716
+ },
1717
+ 'Reads one canonical scheduled task and its latest execution facts.',
1718
+ ),
1719
+ route(
1720
+ '/api/scheduled-tasks/:id/pause',
1721
+ 'Scheduled task pause API',
1722
+ {
1723
+ ...safeMutation,
1724
+ auditTarget: 'scheduled_tasks/scheduled_task_runs',
1725
+ },
1726
+ 'Pauses a scheduled task without deleting its run history.',
1727
+ ),
1728
+ route(
1729
+ '/api/scheduled-tasks/:id/resume',
1730
+ 'Scheduled task resume API',
1731
+ {
1732
+ ...safeMutation,
1733
+ auditTarget: 'scheduled_tasks/scheduled_task_runs',
1734
+ },
1735
+ 'Resumes a scheduled task without immediately executing it.',
1736
+ ),
1737
+ route(
1738
+ 'DELETE /api/scheduled-tasks/:id',
1739
+ 'Scheduled task delete API',
1740
+ {
1741
+ ...destructiveMutation,
1742
+ auditTarget: 'scheduled_task_runs/scheduled_tasks',
1743
+ },
1744
+ 'DELETE removes a scheduled task and its local execution history.',
1745
+ ),
1746
+ route(
1747
+ '/reports/:id',
1748
+ 'Report artifact route',
1749
+ readOnly,
1750
+ 'Serves one local HTML report artifact by durable report id behind local-access checks.',
1751
+ ),
1752
+ route(
1753
+ '/api/runtime/status',
1754
+ 'Runtime status API',
1755
+ readOnly,
1756
+ 'Reads readiness facts for the dashboard and local API clients.',
1757
+ ),
1758
+ route(
1759
+ '/api/events/config',
1760
+ 'Config event stream API',
1761
+ readOnly,
1762
+ 'Streams local config change and reload notifications to dashboard surfaces.',
1763
+ ),
1764
+ route(
1765
+ '/api/events/notifications',
1766
+ 'Notification event stream API',
1767
+ readOnly,
1768
+ 'Streams notification inbox changes to dashboard surfaces without browser notification APIs.',
1769
+ ),
1770
+ route(
1771
+ '/api/events/sessions',
1772
+ 'Session event stream API',
1773
+ readOnly,
1774
+ 'Streams chat session metadata and active-surface changes to dashboard and future TUI clients.',
1775
+ ),
1776
+ route(
1777
+ '/api/config/reload',
1778
+ 'Config reload API',
1779
+ {
1780
+ ...safeMutation,
1781
+ auditTarget: 'config_events',
1782
+ },
1783
+ 'Validates runtime config files and emits a local config reload event without writing config.',
1784
+ ),
1785
+ route(
1786
+ '/api/dashboard/config',
1787
+ 'Dashboard config API',
1788
+ {
1789
+ ...safeMutation,
1790
+ auditTarget: 'config_history',
1791
+ },
1792
+ 'GET reads dashboard layout; POST replaces it with a validated statusline plus tabbed-region layout.',
1793
+ ),
1794
+ route(
1795
+ '/api/dashboard/preset',
1796
+ 'Dashboard preset API',
1797
+ {
1798
+ ...safeMutation,
1799
+ auditTarget: 'config_history',
1800
+ },
1801
+ 'Applies a known dashboard layout preset and emits config-change events.',
1802
+ ),
1803
+ route(
1804
+ '/api/safety/policy',
1805
+ 'Safety policy API',
1806
+ readOnly,
1807
+ 'Reads this safety policy for the dashboard and local API clients.',
1808
+ ),
1809
+ route(
1810
+ '/api/execution/policy',
1811
+ 'Execution policy API',
1812
+ {
1813
+ ...safeMutation,
1814
+ auditTarget: 'config_history',
1815
+ },
1816
+ 'GET reads host execution approval policy; POST updates policy and preapproved commands through audited config history.',
1817
+ ),
1818
+ route(
1819
+ '/api/execution/check',
1820
+ 'Execution policy check API',
1821
+ readOnly,
1822
+ 'Classifies a proposed host command without running it.',
1823
+ ),
1824
+ route(
1825
+ '/api/execution/approvals',
1826
+ 'Execution approvals API',
1827
+ {
1828
+ ...safeMutation,
1829
+ auditTarget: 'execution_approvals',
1830
+ },
1831
+ 'GET lists execution approval records; POST creates a pending approval request without running a command.',
1832
+ ),
1833
+ route(
1834
+ '/api/execution/approvals/:id/resolve',
1835
+ 'Execution approval resolution API',
1836
+ {
1837
+ ...safeMutation,
1838
+ auditTarget:
1839
+ 'execution_approvals/config_history/chat_session_command_events/notifications',
1840
+ },
1841
+ 'Approves or denies a pending execution request and nudges the requesting display-assistant session when linked. allow-always also updates preapproved command config.',
1842
+ ),
1843
+ route(
1844
+ '/api/execution/run',
1845
+ 'Approved execution API',
1846
+ {
1847
+ ...hostExecution,
1848
+ auditTarget: 'execution_approvals',
1849
+ },
1850
+ 'Runs one approved local or exe.dev command and records bounded redacted output.',
1851
+ ),
1852
+ route(
1853
+ '/api/execution/exedev/sync-checkout',
1854
+ 'exe.dev checkout sync API',
1855
+ {
1856
+ ...hostExecution,
1857
+ auditTarget: 'execution_approvals',
1858
+ },
1859
+ 'Syncs a declared repo/worktree checkout on an existing exe.dev VM through approved execution steps.',
1860
+ ),
1861
+ route(
1862
+ '/api/mcp/servers',
1863
+ 'MCP servers API',
1864
+ {
1865
+ ...safeMutation,
1866
+ auditTarget: 'config_history',
1867
+ },
1868
+ 'GET reads MCP server status; POST adds a strict mcp.json server entry.',
1869
+ ),
1870
+ route(
1871
+ '/api/mcp/servers/:id',
1872
+ 'MCP server mutation API',
1873
+ {
1874
+ ...destructiveMutation,
1875
+ auditTarget: 'config_history/mcp_tool_approvals/mcp_oauth_tokens',
1876
+ },
1877
+ 'PATCH updates one MCP server; DELETE requires confirmation before removing server config and cached MCP state.',
1878
+ ),
1879
+ route(
1880
+ '/api/mcp/servers/:id/enable',
1881
+ 'Enable MCP server API',
1882
+ {
1883
+ ...safeMutation,
1884
+ auditTarget: 'config_history',
1885
+ },
1886
+ 'Enables one configured MCP server and refreshes the registry.',
1887
+ ),
1888
+ route(
1889
+ '/api/mcp/servers/:id/disable',
1890
+ 'Disable MCP server API',
1891
+ {
1892
+ ...safeMutation,
1893
+ auditTarget: 'config_history',
1894
+ },
1895
+ 'Disables one configured MCP server and closes its connection.',
1896
+ ),
1897
+ route(
1898
+ '/api/mcp/servers/:id/tools',
1899
+ 'MCP tool catalog API',
1900
+ readOnly,
1901
+ 'Reads cached MCP tool catalogs without invoking third-party tools.',
1902
+ ),
1903
+ route(
1904
+ '/api/mcp/servers/:id/refresh',
1905
+ 'Refresh MCP server API',
1906
+ readOnly,
1907
+ 'Reconnects one enabled MCP server and refreshes cached tool catalogs.',
1908
+ ),
1909
+ route(
1910
+ '/api/mcp/servers/:id/login',
1911
+ 'Start MCP OAuth login API',
1912
+ {
1913
+ ...safeMutation,
1914
+ auditTarget: 'mcp_oauth_logins/mcp_oauth_tokens',
1915
+ },
1916
+ 'Starts a state-bound OAuth login and returns the authorization URL.',
1917
+ ),
1918
+ route(
1919
+ '/api/mcp/logins/:id',
1920
+ 'MCP OAuth login API',
1921
+ readOnly,
1922
+ 'Reads one pending or completed MCP OAuth login record without exposing tokens.',
1923
+ ),
1924
+ route(
1925
+ '/api/mcp/oauth/callback',
1926
+ 'MCP OAuth callback API',
1927
+ {
1928
+ ...safeMutation,
1929
+ auditTarget: 'mcp_oauth_logins/mcp_oauth_tokens',
1930
+ },
1931
+ 'Validates OAuth state, exchanges the authorization code, stores tokens in SQLite, and never writes tokens to config.',
1932
+ ),
1933
+ route(
1934
+ '/api/mcp/servers/:id/logout',
1935
+ 'MCP OAuth logout API',
1936
+ {
1937
+ ...destructiveMutation,
1938
+ auditTarget: 'mcp_oauth_tokens',
1939
+ },
1940
+ 'Requires confirmation before deleting stored OAuth tokens for one MCP server.',
1941
+ ),
1942
+ route(
1943
+ '/api/mcp/approvals',
1944
+ 'MCP approvals API',
1945
+ readOnly,
1946
+ 'Lists pending or resolved MCP tool-call approvals.',
1947
+ ),
1948
+ route(
1949
+ '/api/mcp/approvals/:id/resolve',
1950
+ 'Resolve MCP approval API',
1951
+ {
1952
+ ...destructiveMutation,
1953
+ auditTarget:
1954
+ 'mcp_tool_approvals/chat_session_command_events/notifications',
1955
+ },
1956
+ 'Approves or denies one pending third-party MCP tool call by exact approval id and nudges the requesting display-assistant session when linked.',
1957
+ ),
1958
+ route(
1959
+ '/api/mcp/audit',
1960
+ 'MCP audit API',
1961
+ readOnly,
1962
+ 'Reads recent MCP tool-call audit rows.',
1963
+ ),
1964
+ route(
1965
+ '/api/autopilot/triage-pr-event',
1966
+ 'PR event triage API',
1967
+ readOnly,
1968
+ 'Classifies a structured PR watcher delta for dashboard, smoke-test, and future TUI clients.',
1969
+ ),
1970
+ route(
1971
+ '/api/autopilot/prepare-pr-worktree',
1972
+ 'PR worktree preparation API',
1973
+ {
1974
+ ...safeMutation,
1975
+ auditTarget: 'worktrees/worktree_locks',
1976
+ },
1977
+ 'Fetches deterministic GitHub PR/check facts and prepares a managed PR worktree without fixing, committing, pushing, or commenting.',
1978
+ ),
1979
+ route(
1980
+ '/api/autopilot/fix-pr-ci-failure',
1981
+ 'PR CI fixer API',
1982
+ {
1983
+ ...hostExecution,
1984
+ auditTarget:
1985
+ 'worktrees/worktree_locks/repo_edit_events/prepared_diffs/execution_approvals',
1986
+ },
1987
+ 'Fetches failing check facts/log availability, runs diagnostics, optionally applies a scoped repo-edit patch in a managed worktree, commits locally, and creates a prepared diff without pushing or commenting.',
1988
+ ),
1989
+ route(
1990
+ '/api/autopilot/fix-pr-review-feedback',
1991
+ 'PR review feedback fix API',
1992
+ {
1993
+ ...safeMutation,
1994
+ auditTarget: 'worktrees/repo_edit_events/prepared_diffs',
1995
+ },
1996
+ 'Fetches deterministic review feedback, prepares or reuses a managed worktree, applies bounded repo-edit changes, commits locally, and records a prepared diff without pushing or commenting.',
1997
+ ),
1998
+ route(
1999
+ '/api/prepared-diffs',
2000
+ 'Prepared diffs API',
2001
+ readOnly,
2002
+ 'Lists prepared-diff records for dashboard and future TUI clients.',
2003
+ ),
2004
+ route(
2005
+ '/api/prepared-diffs/:id/summary',
2006
+ 'Prepared diff summary API',
2007
+ readOnly,
2008
+ 'Reads one prepared-diff record and backend-computed diff summary.',
2009
+ ),
2010
+ route(
2011
+ '/api/prepared-diffs/:id/files',
2012
+ 'Prepared diff files API',
2013
+ readOnly,
2014
+ 'Reads changed files for a prepared diff through backend git helpers.',
2015
+ ),
2016
+ route(
2017
+ '/api/prepared-diffs/:id/files/diff',
2018
+ 'Prepared file diff API',
2019
+ readOnly,
2020
+ 'Reads one prepared file patch through backend git helpers.',
2021
+ ),
2022
+ route(
2023
+ '/api/prepared-diffs/:id/verify',
2024
+ 'Prepared diff verification API',
2025
+ {
2026
+ ...safeMutation,
2027
+ auditTarget: 'prepared_diffs/prepared_diff_approvals',
2028
+ },
2029
+ 'Records a verification request without running host commands directly.',
2030
+ ),
2031
+ route(
2032
+ '/api/autopilot/push-pr-autofix',
2033
+ 'PR autofix push API',
2034
+ {
2035
+ ...destructiveMutation,
2036
+ auditTarget: 'prepared_diffs/worktrees/worktree_events/notifications',
2037
+ },
2038
+ 'Pushes an approved and verified prepared diff through the same bounded push service used by the Flue workflow.',
2039
+ ),
2040
+ route(
2041
+ '/api/prepared-diffs/:id/push',
2042
+ 'Prepared diff push API',
2043
+ {
2044
+ ...destructiveMutation,
2045
+ auditTarget: 'prepared_diffs/worktrees/worktree_events/notifications',
2046
+ },
2047
+ 'Pushes one approved and verified prepared diff through the bounded push service, or records a blocked attempt while retaining the worktree.',
2048
+ ),
2049
+ route(
2050
+ '/api/prepared-diffs/:id/request-revision',
2051
+ 'Prepared diff revision API',
2052
+ {
2053
+ ...safeMutation,
2054
+ auditTarget: 'prepared_diffs/prepared_diff_approvals/kilo_tasks',
2055
+ },
2056
+ 'User-surface route that records a revision request and may dispatch a bounded Kilo revision run for the retained source worktree.',
2057
+ ),
2058
+ route(
2059
+ '/api/prepared-diffs/:id/run-revision',
2060
+ 'Prepared diff run revision API',
2061
+ {
2062
+ ...safeMutation,
2063
+ auditTarget: 'prepared_diffs/kilo_tasks',
2064
+ },
2065
+ 'User-surface route that starts a bounded Kilo revision run from an already recorded revision request without adding a model-callable action.',
2066
+ ),
2067
+ route(
2068
+ '/api/prepared-diffs/:id/approve-push',
2069
+ 'Prepared diff push approval API',
2070
+ {
2071
+ ...destructiveMutation,
2072
+ auditTarget:
2073
+ 'prepared_diffs/prepared_diff_approvals/workflow_summaries/notifications',
2074
+ },
2075
+ 'Requires confirmation, records push-back approval, and admits the configured push or verify-then-push workflow. Push policy, verification, branch permission, execution approval, and clean-worktree gates still run inside the delegated workflow.',
2076
+ ),
2077
+ route(
2078
+ '/api/prepared-diffs/:id/abandon',
2079
+ 'Prepared diff abandon API',
2080
+ {
2081
+ ...destructiveMutation,
2082
+ auditTarget: 'prepared_diffs/prepared_diff_approvals/worktree_events',
2083
+ },
2084
+ 'Requires confirmation and abandons the prepared-diff record without deleting the source worktree.',
2085
+ ),
2086
+ route(
2087
+ '/api/prepared-diffs/:id/worktree-path',
2088
+ 'Prepared diff worktree path API',
2089
+ readOnly,
2090
+ 'Returns the managed source worktree path for a prepared diff.',
2091
+ ),
2092
+ route(
2093
+ '/api/prepared-diffs/:id/recovery',
2094
+ 'Prepared diff recovery options API',
2095
+ readOnly,
2096
+ 'Reads bounded recovery options for a prepared diff.',
2097
+ ),
2098
+ route(
2099
+ '/api/prepared-diffs/:id/recovery/run',
2100
+ 'Prepared diff recovery runner API',
2101
+ {
2102
+ ...hostExecution,
2103
+ auditTarget:
2104
+ 'prepared_diffs/prepared_diff_approvals/worktrees/workflow_summaries/notifications/execution_approvals',
2105
+ },
2106
+ 'Dispatches one bounded recovery action through the same prepared-diff, worktree sync/cleanup, and autopilot workflow services used by Flue actions.',
2107
+ ),
2108
+ route(
2109
+ '/api/autopilot/verify-pr-worktree',
2110
+ 'PR worktree verification API',
2111
+ {
2112
+ ...hostExecution,
2113
+ auditTarget: 'execution_approvals',
2114
+ },
2115
+ 'Runs configured checks for a managed PR worktree through the execution approval policy.',
2116
+ ),
2117
+ route(
2118
+ '/api/autopilot/comment-pr-autofix-result',
2119
+ 'Comment PR autofix result API',
2120
+ {
2121
+ ...safeMutation,
2122
+ auditTarget: 'workflow_summaries/GitHub issue comments',
2123
+ },
2124
+ 'Posts a concise PR comment generated from prepared-diff/autopilot facts and records the human-readable audit summary.',
2125
+ ),
2126
+ route(
2127
+ '/api/session',
2128
+ 'Active session API',
2129
+ readOnly,
2130
+ 'Reads the active chat session for a dashboard or future TUI surface.',
2131
+ ),
2132
+ route(
2133
+ '/api/sessions',
2134
+ 'Chat sessions API',
2135
+ {
2136
+ ...safeMutation,
2137
+ auditTarget: 'chat_sessions/chat_session_surfaces/chat_session_audit',
2138
+ },
2139
+ 'GET lists indexed session metadata; POST creates and optionally activates a new session.',
2140
+ ),
2141
+ route(
2142
+ '/api/sessions/:id',
2143
+ 'Chat session read API',
2144
+ {
2145
+ ...readOnly,
2146
+ audited: true,
2147
+ auditTarget: 'chat_session_audit',
2148
+ },
2149
+ 'Reads one indexed session metadata record and audits the read.',
2150
+ ),
2151
+ route(
2152
+ '/api/sessions/:id/messages',
2153
+ 'Chat session messages API',
2154
+ {
2155
+ ...readOnly,
2156
+ audited: true,
2157
+ auditTarget: 'chat_session_audit',
2158
+ },
2159
+ 'Audits a request for Flue-owned messages without copying transcripts into app state.',
2160
+ ),
2161
+ route(
2162
+ '/api/sessions/:id/command-events',
2163
+ 'Chat session command event API',
2164
+ {
2165
+ ...safeMutation,
2166
+ auditTarget: 'chat_session_command_events/chat_session_audit',
2167
+ },
2168
+ 'GET lists durable slash-command transcript entries; POST records or updates command event rows for the session UI.',
2169
+ ),
2170
+ route(
2171
+ '/api/sessions/:id/summary/refresh',
2172
+ 'Chat session summary refresh API',
2173
+ {
2174
+ ...safeMutation,
2175
+ auditTarget: 'chat_sessions/chat_session_audit',
2176
+ },
2177
+ 'Refreshes a compact session summary from metadata or an explicitly provided summary.',
2178
+ ),
2179
+ route(
2180
+ '/api/sessions/:id/reference',
2181
+ 'Chat session reference API',
2182
+ {
2183
+ ...safeMutation,
2184
+ auditTarget: 'chat_sessions/chat_session_audit',
2185
+ },
2186
+ 'Reads compact cross-session summary and metadata while auditing context use, refreshing stale metadata when needed.',
2187
+ ),
2188
+ route(
2189
+ '/api/sessions/:id/switch',
2190
+ 'Chat session switch API',
2191
+ {
2192
+ ...safeMutation,
2193
+ auditTarget: 'chat_session_surfaces/chat_session_audit',
2194
+ },
2195
+ 'Switches a local surface to an existing non-archived session id.',
2196
+ ),
2197
+ route(
2198
+ '/api/sessions/:id/*',
2199
+ 'Chat session metadata mutation API',
2200
+ {
2201
+ ...safeMutation,
2202
+ auditTarget: 'chat_sessions/chat_session_audit',
2203
+ },
2204
+ 'Renames, pins, archives, restores, or links context metadata without mutating Flue transcripts.',
2205
+ ),
2206
+ route(
2207
+ '/api/models',
2208
+ 'Model config API',
2209
+ {
2210
+ ...safeMutation,
2211
+ auditTarget: 'config_history',
2212
+ },
2213
+ 'Updates display-assistant, utility, and subagent model settings.',
2214
+ ),
2215
+ route(
2216
+ '/api/providers/:provider',
2217
+ 'Provider config API',
2218
+ {
2219
+ ...safeMutation,
2220
+ auditTarget: 'config_history',
2221
+ },
2222
+ 'Updates allowlisted provider environment variable references.',
2223
+ ),
2224
+ route(
2225
+ '/api/kilo/*',
2226
+ 'Kilo handoff API',
2227
+ {
2228
+ ...hostExecution,
2229
+ auditTarget:
2230
+ 'kilo_tasks/kilo_task_events/kilo_result_state/kilo_result_events',
2231
+ },
2232
+ 'Starts, reads, searches, cancels, reviews, verifies, and records promotion admission for explicit Kilo handoff tasks through app-owned SQLite state.',
2233
+ ),
2234
+ route(
2235
+ '/api/handoff/*',
2236
+ 'External agent handoff API',
2237
+ {
2238
+ ...safeMutation,
2239
+ auditTarget:
2240
+ 'pr_watches/scheduled_tasks/notifications/workflow_summaries',
2241
+ },
2242
+ 'Localhost-only registration surface for external agents to create attributed watches, notes, and optionally queue bounded PR review assistance when config allows it. It does not execute commands, approve work, push, or mutate remote providers.',
2243
+ ),
2244
+ route(
2245
+ '/api/memories',
2246
+ 'Memory API',
2247
+ {
2248
+ ...destructiveMutation,
2249
+ auditTarget: 'memories/memory_events',
2250
+ },
2251
+ 'GET reads memory, POST writes user-scoped memory, and DELETE requires confirm=true before archiving through the delete alias.',
2252
+ ),
2253
+ route(
2254
+ '/api/memories/:id/archive',
2255
+ 'Memory archive API',
2256
+ {
2257
+ ...safeMutation,
2258
+ auditTarget: 'memories/memory_events',
2259
+ },
2260
+ 'Archives one memory row while preserving audit history.',
2261
+ ),
2262
+ route(
2263
+ '/api/memory-events',
2264
+ 'Memory events API',
2265
+ readOnly,
2266
+ 'Reads memory event audit history.',
2267
+ ),
2268
+ route(
2269
+ '/api/learning/curate',
2270
+ 'Learning curation API',
2271
+ {
2272
+ ...safeMutation,
2273
+ auditTarget:
2274
+ 'learning_reviews/learning_candidates/memories/memory_events',
2275
+ },
2276
+ 'Queues manual model-backed memory curation through the bounded Flue workflow surface.',
2277
+ ),
2278
+ route(
2279
+ '/api/learning/state',
2280
+ 'Learning operator state API',
2281
+ readOnly,
2282
+ 'Reads consolidated learning reviews, candidates, memory decisions, skill patch decisions, and audit history.',
2283
+ ),
2284
+ route(
2285
+ '/api/learning/reviews',
2286
+ 'Learning reviews API',
2287
+ readOnly,
2288
+ 'Lists persisted learning review records, summaries, model selections, and failures.',
2289
+ ),
2290
+ route(
2291
+ '/api/learning/reviews/conversation',
2292
+ 'Conversation learning review API',
2293
+ {
2294
+ ...safeMutation,
2295
+ auditTarget:
2296
+ 'learning_reviews/learning_candidates/memories/memory_events',
2297
+ },
2298
+ 'Queues manual model-backed conversation reflection through the bounded Flue workflow surface.',
2299
+ ),
2300
+ route(
2301
+ '/api/learning/reviews/prs',
2302
+ 'PR learning retrospective API',
2303
+ {
2304
+ ...safeMutation,
2305
+ auditTarget:
2306
+ 'learning_reviews/learning_candidates/memories/memory_events/config_history',
2307
+ },
2308
+ 'Queues manual PR/autopilot retrospectives through the bounded Flue workflow surface.',
2309
+ ),
2310
+ route(
2311
+ '/api/learning/candidates',
2312
+ 'Learning candidates API',
2313
+ readOnly,
2314
+ 'Lists memory and skill learning candidates.',
2315
+ ),
2316
+ route(
2317
+ '/api/learning/candidates/:id/approve',
2318
+ 'Approve learning candidate API',
2319
+ {
2320
+ ...safeMutation,
2321
+ auditTarget: 'learning_candidates/memories/memory_events/config_history',
2322
+ },
2323
+ 'Applies one reviewed memory or skill learning candidate.',
2324
+ ),
2325
+ route(
2326
+ '/api/learning/candidates/:id/reject',
2327
+ 'Reject learning candidate API',
2328
+ {
2329
+ ...safeMutation,
2330
+ auditTarget: 'learning_candidates/memory_events/learning_events',
2331
+ },
2332
+ 'Rejects one reviewed memory or skill learning candidate.',
2333
+ ),
2334
+ route(
2335
+ '/api/skills/patches',
2336
+ 'Skill patches API',
2337
+ readOnly,
2338
+ 'Lists skill patch candidates and decisions.',
2339
+ ),
2340
+ route(
2341
+ '/api/skills/patches/:id/apply',
2342
+ 'Apply skill patch API',
2343
+ {
2344
+ ...safeMutation,
2345
+ auditTarget: 'learning_candidates/config_history/learning_events',
2346
+ },
2347
+ 'Applies one reviewed skill patch candidate.',
2348
+ ),
2349
+ route(
2350
+ '/api/skills/patches/:id/reject',
2351
+ 'Reject skill patch API',
2352
+ {
2353
+ ...safeMutation,
2354
+ auditTarget: 'learning_candidates/learning_events',
2355
+ },
2356
+ 'Rejects one reviewed skill patch candidate.',
2357
+ ),
2358
+ route(
2359
+ '/api/skills/patches/:id/restore',
2360
+ 'Restore skill patch API',
2361
+ {
2362
+ ...safeMutation,
2363
+ auditTarget: 'learning_events/config_history/SKILL.md',
2364
+ },
2365
+ 'Restores an applied skill patch from audit after explicit confirmation when the skill file still matches the applied content.',
2366
+ ),
2367
+ ];
2368
+
2369
+ function tool(
2370
+ id: string,
2371
+ title: string,
2372
+ policy: Partial<SafetyPolicyEntry>,
2373
+ notes: string,
2374
+ ) {
2375
+ return entry('tool', id, title, policy, notes);
2376
+ }
2377
+
2378
+ function action(
2379
+ id: string,
2380
+ title: string,
2381
+ policy: Partial<SafetyPolicyEntry>,
2382
+ notes: string,
2383
+ ) {
2384
+ return entry('action', id, title, policy, notes);
2385
+ }
2386
+
2387
+ function workflow(
2388
+ id: string,
2389
+ title: string,
2390
+ policy: Partial<SafetyPolicyEntry>,
2391
+ notes: string,
2392
+ ) {
2393
+ return entry('workflow', id, title, policy, notes);
2394
+ }
2395
+
2396
+ function route(
2397
+ id: string,
2398
+ title: string,
2399
+ policy: Partial<SafetyPolicyEntry>,
2400
+ notes: string,
2401
+ ) {
2402
+ return entry('route', id, title, policy, notes);
2403
+ }
2404
+
2405
+ function cli(
2406
+ id: string,
2407
+ title: string,
2408
+ policy: Partial<SafetyPolicyEntry>,
2409
+ notes: string,
2410
+ ) {
2411
+ return entry('cli', id, title, policy, notes);
2412
+ }
2413
+
2414
+ function entry(
2415
+ primitive: SafetyPolicyEntry['primitive'],
2416
+ id: string,
2417
+ title: string,
2418
+ policy: Partial<SafetyPolicyEntry>,
2419
+ notes: string,
2420
+ ): SafetyPolicyEntry {
2421
+ return {
2422
+ id,
2423
+ primitive,
2424
+ title,
2425
+ class: policy.class ?? 'read-only',
2426
+ unattended: policy.unattended ?? false,
2427
+ requiresConfirmation: policy.requiresConfirmation ?? false,
2428
+ audited: policy.audited ?? false,
2429
+ auditTarget: policy.auditTarget ?? 'none',
2430
+ notes,
2431
+ };
2432
+ }