vgxness 1.20.4 → 1.20.6

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 (375) hide show
  1. package/dist/adapters/claude/agent-renderer.js +82 -0
  2. package/dist/{mcp → adapters/claude/install}/claude-code-agent-config.js +64 -9
  3. package/dist/{mcp → adapters/claude/install}/claude-code-config.js +28 -6
  4. package/dist/{mcp → adapters/claude/install}/claude-code-project-memory.js +35 -5
  5. package/dist/{mcp → adapters/claude/install}/claude-code-scope.js +12 -3
  6. package/dist/{mcp → adapters/claude/install}/claude-code-user-config.js +26 -5
  7. package/dist/{mcp → adapters/claude/install}/claude-code-user-memory.js +47 -7
  8. package/dist/{mcp → adapters/claude/install}/client-install-claude-code-contract.js +45 -8
  9. package/dist/{mcp → adapters/claude/install}/client-install-claude-code.js +98 -14
  10. package/dist/adapters/json/agent-renderer.js +104 -0
  11. package/dist/adapters/opencode/agent-renderer.js +113 -0
  12. package/dist/{mcp → adapters/opencode/install}/client-install-opencode-contract.js +2 -2
  13. package/dist/{mcp → adapters/opencode/install}/client-install-opencode.js +1 -1
  14. package/dist/{mcp → adapters/opencode/install}/opencode-default-agent-config.js +2 -2
  15. package/dist/{mcp → adapters/opencode/install}/opencode-handoff-preview.js +60 -7
  16. package/dist/{mcp → adapters/opencode/install}/opencode-visibility.js +1 -1
  17. package/dist/adapters/provider-renderer.js +6 -0
  18. package/dist/agents/agent-activation-service.js +1 -263
  19. package/dist/agents/agent-lookup-contexts.js +1 -28
  20. package/dist/agents/agent-registry-service.js +1 -81
  21. package/dist/agents/agent-resolver.js +1 -287
  22. package/dist/agents/agent-seed-service.js +1 -157
  23. package/dist/agents/agent-seed-upgrade-service.js +1 -231
  24. package/dist/agents/agent-selector-resolver.js +1 -28
  25. package/dist/agents/boot-upgrade.js +1 -59
  26. package/dist/agents/canonical-agent-manifest.js +1 -245
  27. package/dist/agents/canonical-agent-projection.js +1 -236
  28. package/dist/agents/manager-profile-overlay-service.js +1 -60
  29. package/dist/agents/profile-model-routing.js +1 -30
  30. package/dist/agents/renderers/claude-renderer.js +1 -82
  31. package/dist/agents/renderers/index.js +1 -14
  32. package/dist/agents/renderers/json-renderer.js +1 -104
  33. package/dist/agents/renderers/opencode-renderer.js +1 -113
  34. package/dist/agents/renderers/provider-adapter.js +1 -6
  35. package/dist/agents/repositories/agent-seed-history.js +1 -128
  36. package/dist/agents/repositories/agents.js +1 -200
  37. package/dist/agents/repositories/manager-profile-overlays.js +1 -90
  38. package/dist/agents/schema.js +1 -1
  39. package/dist/application/agents/agent-activation-service.js +261 -0
  40. package/dist/application/agents/agent-lookup-contexts.js +28 -0
  41. package/dist/application/agents/agent-registry-service.js +81 -0
  42. package/dist/application/agents/agent-resolver.js +287 -0
  43. package/dist/application/agents/agent-seed-service.js +157 -0
  44. package/dist/application/agents/agent-seed-upgrade-service.js +231 -0
  45. package/dist/application/agents/agent-selector-resolver.js +28 -0
  46. package/dist/application/agents/boot-upgrade.js +59 -0
  47. package/dist/application/agents/canonical-agent-projection.js +236 -0
  48. package/dist/application/agents/manager-profile-overlay-service.js +68 -0
  49. package/dist/application/agents/profile-model-routing.js +30 -0
  50. package/dist/application/agents/renderers/claude-renderer.js +1 -0
  51. package/dist/application/agents/renderers/index.js +14 -0
  52. package/dist/application/agents/renderers/json-renderer.js +1 -0
  53. package/dist/application/agents/renderers/opencode-renderer.js +1 -0
  54. package/dist/application/agents/renderers/provider-adapter.js +1 -0
  55. package/dist/application/memory/active-work-preview.js +75 -0
  56. package/dist/application/memory/agent-memory-capture-service.js +498 -0
  57. package/dist/application/memory/import/dry-run-planner.js +58 -0
  58. package/dist/application/memory/import/index.js +3 -0
  59. package/dist/application/memory/import/observation-writer.js +226 -0
  60. package/dist/application/memory/import/package.js +179 -0
  61. package/dist/application/memory/memory-service.js +202 -0
  62. package/dist/application/memory/search.js +11 -0
  63. package/dist/{mcp → application/provider-setup}/provider-change-plan.js +74 -13
  64. package/dist/{mcp → application/provider-setup}/provider-doctor.js +201 -31
  65. package/dist/{mcp → application/provider-setup}/provider-health-types.js +1 -1
  66. package/dist/{mcp → application/provider-setup}/provider-status.js +170 -33
  67. package/dist/application/runs/execution-planning.js +180 -0
  68. package/dist/application/runs/operation-execution.js +1 -0
  69. package/dist/application/runs/operation-retry.js +129 -0
  70. package/dist/application/runs/resume-after-approval-result.js +88 -0
  71. package/dist/application/runs/run-insights.js +270 -0
  72. package/dist/application/runs/run-service.js +1480 -0
  73. package/dist/application/runs/run-snapshot-export-service.js +31 -0
  74. package/dist/application/runs/sandbox-process-execution.js +244 -0
  75. package/dist/application/runs/sandbox-worktree-planning.js +59 -0
  76. package/dist/application/runs/task-scoped-command-grant-service.js +224 -0
  77. package/dist/application/sdd/artifact-portability-service.js +137 -0
  78. package/dist/application/sdd/cockpit-read-model.js +195 -0
  79. package/dist/application/sdd/sdd-continuation-plan.js +265 -0
  80. package/dist/application/sdd/sdd-workflow-service.js +892 -0
  81. package/dist/application/skills/boot-seed.js +42 -0
  82. package/dist/application/skills/personal-skills.js +41 -0
  83. package/dist/application/skills/skill-export-service.js +34 -0
  84. package/dist/application/skills/skill-index-service.js +126 -0
  85. package/dist/application/skills/skill-payload.js +186 -0
  86. package/dist/application/skills/skill-registry-service.js +648 -0
  87. package/dist/application/skills/skill-resolver.js +368 -0
  88. package/dist/application/skills/skill-seed-service.js +242 -0
  89. package/dist/application/skills/skill-status-service.js +147 -0
  90. package/dist/cli/bun-bin.js +0 -0
  91. package/dist/cli/cli-flags.js +1 -387
  92. package/dist/cli/cli-help.js +1 -173
  93. package/dist/cli/cli-helpers.js +1 -77
  94. package/dist/cli/cli-types.js +1 -1
  95. package/dist/cli/commands/agent-skill-dispatcher.js +1 -700
  96. package/dist/cli/commands/index.js +1 -9
  97. package/dist/cli/commands/interactive-entrypoint-dispatcher.js +1 -14
  98. package/dist/cli/commands/mcp-dispatcher.js +1 -232
  99. package/dist/cli/commands/memory-sdd-dispatcher.js +1 -367
  100. package/dist/cli/commands/run-permission-dispatcher.js +1 -455
  101. package/dist/cli/commands/setup-dispatcher.js +1 -496
  102. package/dist/cli/commands/status-dispatcher.js +1 -130
  103. package/dist/cli/commands/verification-dispatcher.js +1 -47
  104. package/dist/cli/commands/workflow-dispatcher.js +1 -566
  105. package/dist/cli/dispatcher.js +1 -247
  106. package/dist/cli/doctor-renderer.js +1 -26
  107. package/dist/cli/home-tui-app.js +1 -411
  108. package/dist/cli/home-tui-controller.js +1 -314
  109. package/dist/cli/mcp-start-path.js +1 -21
  110. package/dist/cli/product-resume-renderer.js +1 -32
  111. package/dist/cli/product-status-renderer.js +1 -81
  112. package/dist/cli/sdd-renderer.js +1 -247
  113. package/dist/cli/setup-plan-renderer.js +1 -79
  114. package/dist/cli/setup-status-renderer.js +1 -50
  115. package/dist/cli/setup-tui-app.js +1 -130
  116. package/dist/cli/setup-tui-controller.js +1 -89
  117. package/dist/cli/tui/focus-reducer.js +1 -0
  118. package/dist/cli/tui/focus-types.js +1 -0
  119. package/dist/cli/tui/ink/app-shell.js +1 -0
  120. package/dist/cli/tui/ink/components.js +1 -38
  121. package/dist/cli/tui/ink/help-overlay.js +1 -0
  122. package/dist/cli/tui/ink/state-components.js +1 -0
  123. package/dist/cli/tui/ink/theme.js +1 -36
  124. package/dist/cli/tui/key-intents.js +1 -0
  125. package/dist/cli/tui/keymap.js +1 -20
  126. package/dist/cli/tui/navigation.js +1 -10
  127. package/dist/cli/tui/screen-registry.js +1 -0
  128. package/dist/cli/tui/terminal-capabilities.js +1 -12
  129. package/dist/cli/tui/tui-types.js +1 -1
  130. package/dist/cli/tui/visual/badges.js +1 -19
  131. package/dist/cli/tui/visual/footer.js +1 -27
  132. package/dist/cli/tui/visual/index.js +1 -3
  133. package/dist/cli/tui/visual/viewport.js +1 -11
  134. package/dist/cli/tui-render-helpers.js +1 -200
  135. package/dist/cli/verification-plan-renderer.js +1 -25
  136. package/dist/cli/verification-report-renderer.js +1 -19
  137. package/dist/domain/agents/canonical-agent-manifest.js +355 -0
  138. package/dist/domain/agents/schema.js +1 -0
  139. package/dist/domain/memory/active-work-topics.js +64 -0
  140. package/dist/domain/memory/memory-capture-schema.js +1 -0
  141. package/dist/domain/memory/schema.js +1 -0
  142. package/dist/domain/runs/schema.js +5 -0
  143. package/dist/domain/sdd/cockpit-types.js +1 -0
  144. package/dist/domain/sdd/schema.js +111 -0
  145. package/dist/domain/skills/schema.js +1 -0
  146. package/dist/governance/risk-classifier.js +2 -0
  147. package/dist/interfaces/cli/bun-bin.js +46 -0
  148. package/dist/interfaces/cli/cli-flags.js +391 -0
  149. package/dist/interfaces/cli/cli-help.js +173 -0
  150. package/dist/interfaces/cli/cli-helpers.js +77 -0
  151. package/dist/interfaces/cli/cli-types.js +1 -0
  152. package/dist/interfaces/cli/commands/agent-skill-dispatcher.js +700 -0
  153. package/dist/interfaces/cli/commands/index.js +9 -0
  154. package/dist/interfaces/cli/commands/interactive-entrypoint-dispatcher.js +14 -0
  155. package/dist/interfaces/cli/commands/mcp-dispatcher.js +252 -0
  156. package/dist/interfaces/cli/commands/memory-sdd-dispatcher.js +367 -0
  157. package/dist/interfaces/cli/commands/run-permission-dispatcher.js +460 -0
  158. package/dist/interfaces/cli/commands/setup-dispatcher.js +496 -0
  159. package/dist/interfaces/cli/commands/status-dispatcher.js +130 -0
  160. package/dist/interfaces/cli/commands/verification-dispatcher.js +47 -0
  161. package/dist/interfaces/cli/commands/workflow-dispatcher.js +566 -0
  162. package/dist/interfaces/cli/dispatcher.js +247 -0
  163. package/dist/interfaces/cli/doctor-renderer.js +26 -0
  164. package/dist/interfaces/cli/home-tui-app.js +462 -0
  165. package/dist/interfaces/cli/home-tui-controller.js +341 -0
  166. package/dist/interfaces/cli/index.js +27 -0
  167. package/dist/interfaces/cli/mcp-start-path.js +21 -0
  168. package/dist/interfaces/cli/product-resume-renderer.js +32 -0
  169. package/dist/interfaces/cli/product-status-renderer.js +81 -0
  170. package/dist/interfaces/cli/sdd-renderer.js +247 -0
  171. package/dist/interfaces/cli/setup-plan-renderer.js +79 -0
  172. package/dist/interfaces/cli/setup-status-renderer.js +50 -0
  173. package/dist/interfaces/cli/setup-tui-app.js +135 -0
  174. package/dist/interfaces/cli/setup-tui-controller.js +89 -0
  175. package/dist/interfaces/cli/tui/focus-reducer.js +60 -0
  176. package/dist/interfaces/cli/tui/focus-types.js +10 -0
  177. package/dist/interfaces/cli/tui/ink/app-shell.js +16 -0
  178. package/dist/interfaces/cli/tui/ink/components.js +38 -0
  179. package/dist/interfaces/cli/tui/ink/help-overlay.js +6 -0
  180. package/dist/interfaces/cli/tui/ink/state-components.js +22 -0
  181. package/dist/interfaces/cli/tui/ink/theme.js +36 -0
  182. package/dist/interfaces/cli/tui/key-intents.js +33 -0
  183. package/dist/interfaces/cli/tui/keymap.js +20 -0
  184. package/dist/interfaces/cli/tui/navigation.js +10 -0
  185. package/dist/interfaces/cli/tui/screen-registry.js +43 -0
  186. package/dist/interfaces/cli/tui/terminal-capabilities.js +12 -0
  187. package/dist/interfaces/cli/tui/tui-types.js +1 -0
  188. package/dist/interfaces/cli/tui/visual/badges.js +19 -0
  189. package/dist/interfaces/cli/tui/visual/footer.js +27 -0
  190. package/dist/interfaces/cli/tui/visual/index.js +3 -0
  191. package/dist/interfaces/cli/tui/visual/viewport.js +11 -0
  192. package/dist/interfaces/cli/tui-render-helpers.js +200 -0
  193. package/dist/interfaces/cli/verification-plan-renderer.js +25 -0
  194. package/dist/interfaces/cli/verification-report-renderer.js +19 -0
  195. package/dist/interfaces/mcp/contracts/agents.js +1 -0
  196. package/dist/interfaces/mcp/contracts/context.js +1 -0
  197. package/dist/interfaces/mcp/contracts/governance.js +1 -0
  198. package/dist/interfaces/mcp/contracts/index.js +1 -0
  199. package/dist/interfaces/mcp/contracts/memory.js +1 -0
  200. package/dist/interfaces/mcp/contracts/providers.js +1 -0
  201. package/dist/interfaces/mcp/contracts/runs.js +1 -0
  202. package/dist/interfaces/mcp/contracts/sdd.js +1 -0
  203. package/dist/interfaces/mcp/contracts/sessions.js +1 -0
  204. package/dist/interfaces/mcp/contracts/skills.js +1 -0
  205. package/dist/interfaces/mcp/contracts/verification.js +1 -0
  206. package/dist/interfaces/mcp/control-plane/handlers/agents.js +38 -0
  207. package/dist/interfaces/mcp/control-plane/handlers/context.js +12 -0
  208. package/dist/interfaces/mcp/control-plane/handlers/memory.js +95 -0
  209. package/dist/interfaces/mcp/control-plane/handlers/providers.js +19 -0
  210. package/dist/interfaces/mcp/control-plane/handlers/runs.js +134 -0
  211. package/dist/interfaces/mcp/control-plane/handlers/sdd.js +225 -0
  212. package/dist/interfaces/mcp/control-plane/handlers/sessions.js +39 -0
  213. package/dist/interfaces/mcp/control-plane/handlers/skills.js +82 -0
  214. package/dist/interfaces/mcp/control-plane/handlers/verification.js +11 -0
  215. package/dist/interfaces/mcp/control-plane/types.js +1 -0
  216. package/dist/interfaces/mcp/control-plane.js +235 -0
  217. package/dist/interfaces/mcp/schema.js +174 -0
  218. package/dist/interfaces/mcp/schemas/common.js +121 -0
  219. package/dist/interfaces/mcp/schemas/inputs/agents.js +69 -0
  220. package/dist/interfaces/mcp/schemas/inputs/context.js +32 -0
  221. package/dist/interfaces/mcp/schemas/inputs/governance.js +23 -0
  222. package/dist/interfaces/mcp/schemas/inputs/index.js +10 -0
  223. package/dist/interfaces/mcp/schemas/inputs/memory.js +50 -0
  224. package/dist/interfaces/mcp/schemas/inputs/providers.js +35 -0
  225. package/dist/interfaces/mcp/schemas/inputs/runs.js +146 -0
  226. package/dist/interfaces/mcp/schemas/inputs/sdd.js +102 -0
  227. package/dist/interfaces/mcp/schemas/inputs/sessions.js +32 -0
  228. package/dist/interfaces/mcp/schemas/inputs/skills.js +231 -0
  229. package/dist/interfaces/mcp/schemas/inputs/verification.js +9 -0
  230. package/dist/interfaces/mcp/schemas/outputs/index.js +2 -0
  231. package/dist/interfaces/mcp/schemas/outputs/providers.js +28 -0
  232. package/dist/interfaces/mcp/schemas/outputs/sdd.js +166 -0
  233. package/dist/interfaces/mcp/stdio-server.js +116 -0
  234. package/dist/interfaces/mcp/validation/agents.js +189 -0
  235. package/dist/interfaces/mcp/validation/common.js +415 -0
  236. package/dist/interfaces/mcp/validation/governance.js +50 -0
  237. package/dist/interfaces/mcp/validation/memory.js +133 -0
  238. package/dist/interfaces/mcp/validation/providers.js +94 -0
  239. package/dist/interfaces/mcp/validation/runs.js +514 -0
  240. package/dist/interfaces/mcp/validation/sdd.js +247 -0
  241. package/dist/interfaces/mcp/validation/sessions.js +51 -0
  242. package/dist/interfaces/mcp/validation/skills.js +685 -0
  243. package/dist/interfaces/mcp/validation/verification.js +24 -0
  244. package/dist/interfaces/mcp/validation.js +149 -0
  245. package/dist/mcp/control-plane-snapshot-service.js +65 -2
  246. package/dist/mcp/control-plane.js +1 -646
  247. package/dist/mcp/doctor.js +1 -1
  248. package/dist/mcp/index.js +17 -17
  249. package/dist/mcp/schema.js +1 -1072
  250. package/dist/mcp/stdio-server.js +1 -116
  251. package/dist/mcp/validation.js +1 -2239
  252. package/dist/memory/active-work-preview.js +1 -75
  253. package/dist/memory/active-work-topics.js +1 -64
  254. package/dist/memory/agent-memory-capture-service.js +1 -497
  255. package/dist/memory/import/dry-run-planner.js +1 -58
  256. package/dist/memory/import/index.js +1 -3
  257. package/dist/memory/import/observation-writer.js +1 -226
  258. package/dist/memory/import/package.js +1 -179
  259. package/dist/memory/memory-capture-schema.js +1 -1
  260. package/dist/memory/memory-service.js +1 -201
  261. package/dist/memory/repositories/artifacts.js +1 -67
  262. package/dist/memory/repositories/observations.js +1 -217
  263. package/dist/memory/repositories/sessions.js +1 -125
  264. package/dist/memory/repositories/traces.js +1 -78
  265. package/dist/memory/schema.js +1 -1
  266. package/dist/memory/search.js +1 -11
  267. package/dist/memory/sqlite/database.js +1 -228
  268. package/dist/memory/storage-paths.js +1 -72
  269. package/dist/payload/context-budget-policy.js +10 -0
  270. package/dist/payload/context-budget-service.js +26 -0
  271. package/dist/payload/payload-diagnostics.js +50 -0
  272. package/dist/permissions/explicit-request-authorization.js +126 -0
  273. package/dist/permissions/policy-evaluator.js +54 -14
  274. package/dist/runs/execution-planning.js +1 -178
  275. package/dist/runs/operation-execution.js +1 -1
  276. package/dist/runs/operation-retry.js +1 -129
  277. package/dist/runs/repositories/runs.js +1 -676
  278. package/dist/runs/repositories/task-scoped-command-grants.js +1 -462
  279. package/dist/runs/resume-after-approval-result.js +1 -84
  280. package/dist/runs/run-insights.js +1 -270
  281. package/dist/runs/run-service.js +1 -1439
  282. package/dist/runs/run-snapshot-export-service.js +1 -31
  283. package/dist/runs/sandbox-process-execution.js +1 -240
  284. package/dist/runs/sandbox-worktree-planning.js +1 -59
  285. package/dist/runs/schema.js +1 -5
  286. package/dist/runs/task-scoped-command-grant-service.js +1 -216
  287. package/dist/sdd/artifact-portability-service.js +1 -137
  288. package/dist/sdd/cockpit-read-model.js +1 -195
  289. package/dist/sdd/cockpit-types.js +1 -1
  290. package/dist/sdd/schema.js +1 -111
  291. package/dist/sdd/sdd-continuation-plan.js +1 -265
  292. package/dist/sdd/sdd-workflow-service.js +1 -822
  293. package/dist/setup/providers/claude-setup-adapter.js +11 -4
  294. package/dist/setup/providers/opencode-setup-adapter.js +10 -7
  295. package/dist/setup/setup-plan.js +20 -7
  296. package/dist/skills/boot-seed.js +1 -42
  297. package/dist/skills/personal-skills.js +1 -41
  298. package/dist/skills/repositories/skill-evaluation-requests.js +1 -190
  299. package/dist/skills/repositories/skill-evaluation-scenarios.js +1 -305
  300. package/dist/skills/repositories/skill-improvement-proposals.js +1 -355
  301. package/dist/skills/repositories/skills.js +1 -1077
  302. package/dist/skills/schema.js +1 -1
  303. package/dist/skills/skill-export-service.js +1 -34
  304. package/dist/skills/skill-index-service.js +1 -126
  305. package/dist/skills/skill-payload.js +1 -186
  306. package/dist/skills/skill-registry-service.js +1 -644
  307. package/dist/skills/skill-resolver.js +1 -368
  308. package/dist/skills/skill-seed-service.js +1 -242
  309. package/dist/skills/skill-status-service.js +1 -147
  310. package/dist/storage/agents/repositories/agent-seed-history.js +128 -0
  311. package/dist/storage/agents/repositories/agents.js +200 -0
  312. package/dist/storage/agents/repositories/manager-profile-overlays.js +90 -0
  313. package/dist/storage/memory/repositories/artifacts.js +67 -0
  314. package/dist/storage/memory/repositories/observations.js +217 -0
  315. package/dist/storage/memory/repositories/sessions.js +125 -0
  316. package/dist/storage/memory/repositories/traces.js +78 -0
  317. package/dist/storage/memory/sqlite/database.js +228 -0
  318. package/dist/storage/memory/storage-paths.js +72 -0
  319. package/dist/storage/runs/repositories/runs.js +676 -0
  320. package/dist/storage/runs/repositories/task-scoped-command-grants.js +464 -0
  321. package/dist/storage/skills/repositories/skill-evaluation-requests.js +190 -0
  322. package/dist/storage/skills/repositories/skill-evaluation-scenarios.js +305 -0
  323. package/dist/storage/skills/repositories/skill-improvement-proposals.js +355 -0
  324. package/dist/storage/skills/repositories/skills.js +1084 -0
  325. package/docs/architecture.md +2 -2
  326. package/docs/glossary.md +1 -1
  327. package/docs/mcp.md +1 -1
  328. package/docs/module-boundaries.md +114 -0
  329. package/docs/prd.md +1 -1
  330. package/docs/project-health-audit-v1.10.x.md +1 -1
  331. package/docs/providers.md +2 -2
  332. package/docs/safety.md +3 -3
  333. package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/apply-progress.md +122 -0
  334. package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/archive-report.md +61 -0
  335. package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/design.md +66 -0
  336. package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/proposal.md +79 -0
  337. package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/spec.md +67 -0
  338. package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/tasks.md +63 -0
  339. package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/verify-report.md +71 -0
  340. package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/apply-progress.md +68 -0
  341. package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/archive-report.md +61 -0
  342. package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/design.md +43 -0
  343. package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/proposal.md +61 -0
  344. package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/spec.md +31 -0
  345. package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/tasks.md +27 -0
  346. package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/verify-report.md +58 -0
  347. package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/apply-progress.md +65 -0
  348. package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/archive-report.md +53 -0
  349. package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/design.md +64 -0
  350. package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/proposal.md +62 -0
  351. package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/spec.md +51 -0
  352. package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/tasks.md +50 -0
  353. package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/verify-report.md +66 -0
  354. package/docs/storage.md +2 -2
  355. package/package.json +2 -2
  356. /package/dist/{mcp → adapters/claude/install}/claude-code-cli.js +0 -0
  357. /package/dist/{memory → storage/memory}/sqlite/migrations/001_initial.sql +0 -0
  358. /package/dist/{memory → storage/memory}/sqlite/migrations/002_observation_revisions.sql +0 -0
  359. /package/dist/{memory → storage/memory}/sqlite/migrations/003_agent_registry.sql +0 -0
  360. /package/dist/{memory → storage/memory}/sqlite/migrations/004_run_runtime.sql +0 -0
  361. /package/dist/{memory → storage/memory}/sqlite/migrations/005_run_approvals.sql +0 -0
  362. /package/dist/{memory → storage/memory}/sqlite/migrations/006_run_operation_attempts.sql +0 -0
  363. /package/dist/{memory → storage/memory}/sqlite/migrations/007_abandoned_operation_attempts.sql +0 -0
  364. /package/dist/{memory → storage/memory}/sqlite/migrations/008_run_execution_plan_events.sql +0 -0
  365. /package/dist/{memory → storage/memory}/sqlite/migrations/009_multiple_operation_attempts.sql +0 -0
  366. /package/dist/{memory → storage/memory}/sqlite/migrations/010_skill_registry.sql +0 -0
  367. /package/dist/{memory → storage/memory}/sqlite/migrations/011_skill_usage_resolution_outcomes.sql +0 -0
  368. /package/dist/{memory → storage/memory}/sqlite/migrations/012_skill_improvement_proposals.sql +0 -0
  369. /package/dist/{memory → storage/memory}/sqlite/migrations/013_skill_evaluation_scenarios.sql +0 -0
  370. /package/dist/{memory → storage/memory}/sqlite/migrations/014_manager_profile_overlays.sql +0 -0
  371. /package/dist/{memory → storage/memory}/sqlite/migrations/015_artifact_metadata.sql +0 -0
  372. /package/dist/{memory → storage/memory}/sqlite/migrations/016_agent_seed_history.sql +0 -0
  373. /package/dist/{memory → storage/memory}/sqlite/migrations/017_intent_signal_skill_targets.sql +0 -0
  374. /package/dist/{memory → storage/memory}/sqlite/migrations/018_skill_system_v2.sql +0 -0
  375. /package/dist/{memory → storage/memory}/sqlite/migrations/019_task_scoped_command_grants.sql +0 -0
@@ -1,247 +1 @@
1
- import { normalizeSddArtifact, sddPhases, } from '../sdd/schema.js';
2
- export { sddContinuationPlanFrom } from '../sdd/sdd-continuation-plan.js';
3
- export function renderSddStatus(input) {
4
- const missing = input.status.phases.filter((phase) => !phase.present).map((phase) => phase.topicKey);
5
- const blockers = input.status.phases.filter((phase) => phase.present && phase.accepted !== true);
6
- const complete = input.status.phases.length > 0 && input.status.phases.every((phase) => phase.present && phase.accepted === true);
7
- const statusLabel = complete ? 'complete' : input.status.nextReadyPhase === undefined ? 'blocked' : 'ready';
8
- const directPhaseCommand = input.status.nextReadyPhase === undefined ? undefined : `vgxness sdd continue --project ${input.project} --change ${input.status.change}`;
9
- const recommendedAction = complete
10
- ? 'No next SDD phase remains for this change.'
11
- : input.status.nextReadyPhase === undefined
12
- ? 'Review blockers or accept present draft artifacts before continuing.'
13
- : `Continue the ${input.status.nextReadyPhase} phase in OpenCode using VGXNESS MCP and hidden SDD subagents.`;
14
- const commandLabel = directPhaseCommand === undefined ? 'Diagnostic command' : 'Continuation guidance command';
15
- const lines = [
16
- 'SDD Status',
17
- `Project: ${input.project}`,
18
- `Change: ${input.status.change}`,
19
- `Status: ${statusLabel}`,
20
- `Next ready phase: ${input.status.nextReadyPhase ?? 'none'}`,
21
- '',
22
- 'Phases:',
23
- ...input.status.phases.map((phase) => `- ${phase.phase}: ${phase.present ? (phase.state ?? 'present') : 'missing'}; accepted=${phase.accepted === true ? 'yes' : 'no'}; topic=${phase.topicKey}`),
24
- '',
25
- 'Blockers:',
26
- ...(blockers.length === 0 ? ['- none'] : blockers.map((phase) => `- ${phase.phase}: ${phase.state ?? 'present'} at ${phase.topicKey}`)),
27
- '',
28
- 'Missing topic keys:',
29
- ...(missing.length === 0 ? ['- none'] : missing.map((topicKey) => `- ${topicKey}`)),
30
- '',
31
- `Recommended action: ${recommendedAction}`,
32
- `${commandLabel}: ${directPhaseCommand ?? `vgxness sdd next --project ${input.project} --change ${input.status.change}`}`,
33
- `JSON: vgxness sdd status --project ${input.project} --change ${input.status.change} --json`,
34
- ];
35
- return `${lines.join('\n')}\n`;
36
- }
37
- export function renderSddNext(input) {
38
- const blockers = input.decision.blockedPrerequisites ?? [];
39
- const guidance = input.decision.blockerGuidance ?? [];
40
- const phase = input.decision.nextPhase ?? 'none';
41
- const commandGuidance = input.decision.status === 'runnable' && input.decision.nextPhase !== undefined
42
- ? `vgxness sdd continue --project ${input.project} --change ${input.decision.change}`
43
- : `vgxness sdd status --project ${input.project} --change ${input.decision.change}`;
44
- const commandLabel = input.decision.status === 'runnable' && input.decision.nextPhase !== undefined ? 'Continuation guidance command' : 'Diagnostic command';
45
- const primaryAction = input.decision.status === 'runnable' && input.decision.nextPhase !== undefined
46
- ? `Continue the ${input.decision.nextPhase} phase in OpenCode using VGXNESS MCP and hidden SDD subagents.`
47
- : input.decision.recommendedAction;
48
- const lines = [
49
- 'SDD Next',
50
- `Project: ${input.project}`,
51
- `Change: ${input.decision.change}`,
52
- `Status: ${input.decision.status}`,
53
- `Next phase: ${phase}`,
54
- `Reason: ${input.decision.reason}`,
55
- '',
56
- 'Blockers:',
57
- ...(blockers.length === 0
58
- ? ['- none']
59
- : blockers.map((blocker) => `- ${blocker.phase}: ${blocker.reason} at ${blocker.topicKey}${blocker.action === undefined ? '' : `; action=${blocker.action}`}`)),
60
- '',
61
- 'Missing topic keys:',
62
- ...(input.decision.missingArtifactTopicKeys.length === 0 ? ['- none'] : input.decision.missingArtifactTopicKeys.map((topicKey) => `- ${topicKey}`)),
63
- '',
64
- 'Missing prerequisite topic keys:',
65
- ...((input.decision.missingPrerequisiteTopicKeys ?? []).length === 0
66
- ? ['- none']
67
- : (input.decision.missingPrerequisiteTopicKeys ?? []).map((topicKey) => `- ${topicKey}`)),
68
- '',
69
- 'Next actions:',
70
- ...(guidance.length === 0 ? ['- none'] : guidance.map((item) => `- ${item.phase}: ${item.action}`)),
71
- '',
72
- `Recommended action: ${primaryAction}`,
73
- `${commandLabel}: ${commandGuidance}`,
74
- `JSON: vgxness sdd next --project ${input.project} --change ${input.decision.change} --json`,
75
- ];
76
- return `${lines.join('\n')}\n`;
77
- }
78
- export function renderSddContinuationPlan(plan) {
79
- const suggestedCommandLabel = plan.status === 'runnable' ? 'Continuation guidance command' : 'Diagnostic command';
80
- const lines = [
81
- 'SDD Continue (read-only)',
82
- `Project: ${plan.project}`,
83
- `Change: ${plan.change}`,
84
- `Status: ${plan.status}`,
85
- `Next phase: ${plan.nextPhase ?? 'none'}`,
86
- `Actionable phase: ${plan.actionablePhase ?? 'none'}`,
87
- `Reason: ${plan.reason}`,
88
- '',
89
- 'Recommended plan:',
90
- `- ${plan.status === 'runnable' && plan.nextPhase !== undefined ? `Continue the ${plan.nextPhase} phase in OpenCode using VGXNESS MCP and hidden SDD subagents.` : plan.recommendedAction}`,
91
- `- ${suggestedCommandLabel}: ${plan.suggestedCommand}`,
92
- `- Diagnostic command: ${plan.inspectCommand}`,
93
- '',
94
- ...renderSddAdviceLines(plan.advice),
95
- ...(plan.advice.length === 0 ? [] : ['']),
96
- 'Blocker-specific next actions:',
97
- ...(plan.blockerActions.length === 0
98
- ? ['- none']
99
- : plan.blockerActions.map((item) => {
100
- const draftRun = item.draftRunCommand === undefined ? '' : `; manualFallbackCommand=${item.draftRunCommand}`;
101
- const warning = item.warning === undefined ? '' : `; warning=${item.warning}`;
102
- return `- ${item.phase}: ${item.action}; recoveryCommand=${item.command}${draftRun}${warning}`;
103
- })),
104
- '',
105
- ...(plan.relatedRunContext === undefined
106
- ? []
107
- : [
108
- 'Related interrupted run:',
109
- `- Run ID: ${plan.relatedRunContext.runId}`,
110
- `- Status: ${plan.relatedRunContext.status}`,
111
- `- Workflow/phase: ${plan.relatedRunContext.workflow}/${plan.relatedRunContext.phase}`,
112
- `- Latest checkpoint: ${plan.relatedRunContext.latestCheckpointLabel ?? 'none'}`,
113
- `- Recommendation: ${plan.relatedRunContext.recommendation}`,
114
- `- Resume command: ${plan.relatedRunContext.resumeCommand}`,
115
- '',
116
- ]),
117
- 'Safety:',
118
- ...plan.safety.map((line) => `- ${line}`),
119
- '',
120
- `JSON: vgxness sdd continue --project ${plan.project} --change ${plan.change} --json${continuationDbFlag(plan.explicitDatabasePath)}`,
121
- ];
122
- return `${lines.join('\n')}\n`;
123
- }
124
- export function renderSddAdviceLines(advice) {
125
- if (advice.length === 0)
126
- return [];
127
- return ['Advice:', ...advice.map((item) => `- ${item.title}: ${item.message}`)];
128
- }
129
- export function renderSddCockpit(cockpit) {
130
- const readModel = cockpit.readModel;
131
- const blockers = readModel.blockers;
132
- const lines = [
133
- 'SDD Cockpit (read-only)',
134
- `Project: ${readModel.project}`,
135
- `Change: ${readModel.change}`,
136
- `Next action: ${readModel.nextAction.kind}${readModel.nextAction.phase === undefined ? '' : ` / ${readModel.nextAction.phase}`}`,
137
- `Recommended action: ${readModel.nextAction.label}`,
138
- `Content included: ${readModel.contentIncluded ? 'yes' : 'no'}`,
139
- `Accepted: ${readModel.summary.acceptedArtifacts}/${readModel.summary.totalPhases}`,
140
- `Legacy artifacts: ${readModel.summary.legacyArtifacts}`,
141
- '',
142
- 'Phases:',
143
- ...readModel.phases.map((phase) => `- ${phase.phase}: status=${phase.artifact.status}; accepted=${phase.acceptance.acceptedByHuman ? 'human' : 'no'}; content=${phase.artifact.contentAvailable ? 'metadata-only' : 'none'}; topic=${phase.topicKey}`),
144
- '',
145
- 'Blockers:',
146
- ...(blockers.length === 0
147
- ? ['- none']
148
- : blockers.map((blocker) => `- ${blocker.severity}/${blocker.code}: ${blocker.phase ?? 'change'} at ${blocker.topicKey ?? '-'} - ${blocker.message}${blocker.action === undefined ? '' : `; action=${blocker.action}`}`)),
149
- '',
150
- 'Guidance:',
151
- ...readModel.guidance.map((item) => `- ${item}`),
152
- '',
153
- `Inspect: ${cockpit.inspectCommand}`,
154
- `Cockpit JSON: ${cockpit.inspectCommand}`,
155
- ];
156
- return `${lines.join('\n')}\n`;
157
- }
158
- function continuationDbFlag(explicitDatabasePath) {
159
- return explicitDatabasePath === undefined ? '' : ` --db ${explicitDatabasePath}`;
160
- }
161
- export function renderSddArtifactAccepted(input) {
162
- const lines = [
163
- 'SDD Artifact Accepted',
164
- `- Project: ${input.project}`,
165
- `- Change: ${input.change}`,
166
- `- Phase: ${input.phase}`,
167
- `- Topic key: ${input.topicKey}`,
168
- `- Artifact ID: ${input.artifactId}`,
169
- `- Accepted by: ${input.acceptedBy.displayName} (${input.acceptedBy.id})`,
170
- `- Accepted at: ${input.acceptedAt}`,
171
- ...(input.note === undefined ? [] : [`- Note: ${input.note}`]),
172
- `JSON: vgxness sdd accept-artifact --project ${input.project} --change ${input.change} --phase ${input.phase} --actor ${input.acceptedBy.id} --json`,
173
- ];
174
- return `${lines.join('\n')}\n`;
175
- }
176
- export function renderSddArtifactReopened(input) {
177
- const lines = [
178
- 'SDD Artifact Reopened',
179
- `- Project: ${input.project}`,
180
- `- Change: ${input.change}`,
181
- `- Phase: ${input.phase}`,
182
- `- Status: ${input.status}`,
183
- `- Topic key: ${input.topicKey}`,
184
- `- Artifact ID: ${input.artifactId}`,
185
- `- Reopened by: ${input.reopenedBy.displayName} (${input.reopenedBy.id})`,
186
- `- Reopened at: ${input.reopenedAt}`,
187
- ...(input.note === undefined ? [] : [`- Note: ${input.note}`]),
188
- `Next step: update the ${input.phase} artifact, then request human acceptance again.`,
189
- `JSON: vgxness sdd reopen-artifact --project ${input.project} --change ${input.change} --phase ${input.phase} --actor ${input.reopenedBy.id} --json`,
190
- ];
191
- return `${lines.join('\n')}\n`;
192
- }
193
- export function renderSddArtifactList(input) {
194
- const artifactsByPhase = new Map(input.artifacts.map((artifact) => [artifact.phase, artifact]));
195
- const hasArtifacts = input.artifacts.length > 0;
196
- const lines = [
197
- 'SDD artifacts',
198
- `Project: ${input.project}`,
199
- `Change: ${input.change}`,
200
- '',
201
- 'Phases:',
202
- ...sddPhases.map((phase) => {
203
- const artifact = artifactsByPhase.get(phase);
204
- if (artifact === undefined)
205
- return `- ${phase}: state=missing; accepted=no; updated=-; preview=-`;
206
- const normalized = normalizedArtifactState(artifact);
207
- const preview = 'preview' in artifact ? artifact.preview : artifact.content;
208
- return `- ${phase}: state=${normalized.state}; accepted=${normalized.accepted ? 'yes' : 'no'}; updated=${artifact.updatedAt ?? '-'}; preview=${formatArtifactPreview(preview)}`;
209
- }),
210
- ...(hasArtifacts ? [] : ['', 'No stored SDD artifacts found for this change.']),
211
- ];
212
- return `${lines.join('\n')}\n`;
213
- }
214
- export function renderSddArtifactDetail(input) {
215
- const normalized = normalizeSddArtifact(input.artifact);
216
- const hash = input.artifact.hash ?? input.artifact.contentHash ?? '-';
217
- const lines = [
218
- 'SDD artifact',
219
- `Project: ${input.project}`,
220
- `Change: ${input.change}`,
221
- `Phase: ${input.phase}`,
222
- `State: ${normalized.metadata.status}`,
223
- `Accepted: ${normalized.metadata.status === 'accepted' ? 'yes' : 'no'}`,
224
- `Updated: ${input.artifact.updatedAt ?? '-'}`,
225
- `Hash: ${hash}`,
226
- `Topic key: ${input.artifact.topicKey}`,
227
- `Artifact: ${input.artifact.id}`,
228
- '',
229
- '--- Content ---',
230
- input.artifact.content,
231
- ];
232
- return `${lines.join('\n')}\n`;
233
- }
234
- function formatArtifactPreview(content) {
235
- const compact = (content ?? '').replace(/\s+/g, ' ').trim();
236
- if (compact.length === 0)
237
- return '-';
238
- if (compact.length <= 80)
239
- return compact;
240
- return `${compact.slice(0, 79)}…`;
241
- }
242
- function normalizedArtifactState(artifact) {
243
- if ('state' in artifact)
244
- return { state: artifact.state, accepted: artifact.accepted };
245
- const normalized = normalizeSddArtifact(artifact);
246
- return { state: normalized.metadata.status, accepted: normalized.metadata.status === 'accepted' };
247
- }
1
+ export * from '../interfaces/cli/sdd-renderer.js';
@@ -1,79 +1 @@
1
- import { joinSections, renderActionLine, renderPanel } from './tui-render-helpers.js';
2
- export function renderSetupPlan(plan) {
3
- return `${joinSections([
4
- renderPanel('VGXNESS Setup [read-only]', renderOverview(plan), { status: 'preview-only' }),
5
- renderOpenCode(plan),
6
- renderPanel('Planned Actions', renderActions(plan), { status: 'preview-only' }),
7
- renderPanel('Backups', renderBackups(plan), { status: 'requires confirmation' }),
8
- renderConflicts(plan),
9
- renderPanel('Next Commands', renderNextCommands(plan), { status: 'manual' }),
10
- 'Safety: [read-only] preview only. No provider config was written. Explicit confirmation is required before writing provider config; apply with --yes only after review.',
11
- ])}\n`;
12
- }
13
- function renderOpenCode(plan) {
14
- if (plan.opencode === undefined)
15
- return undefined;
16
- const target = plan.opencode.targetPath === undefined ? 'not applicable' : plan.opencode.targetPath;
17
- const status = plan.status === 'ready' ? 'ready' : plan.status === 'conflict' ? 'blocked' : 'manual';
18
- return renderPanel('OpenCode Provider', [
19
- field('Scope', plan.opencode.scope),
20
- field('Action', plan.opencode.action),
21
- field('Target path', target),
22
- field('Installs agents', yesNo(plan.opencode.installsAgents)),
23
- field('Reinstall entries', yesNo(plan.opencode.overwriteVgxness === true)),
24
- field('Bash policy', formatBashPermissionPolicy(plan.opencode.bashPermissionPolicy)),
25
- field('Agent names', plan.opencode.agentNames.length === 0 ? 'none' : plan.opencode.agentNames.join(', ')),
26
- ], { status });
27
- }
28
- function renderActions(plan) {
29
- if (plan.actions.length === 0)
30
- return ['No provider config writes are planned for this preview.'];
31
- return plan.actions.flatMap((action) => renderActionLine(action.id, {
32
- labels: [action.mutating ? 'writes provider config' : 'no provider writes', action.backupRequired ? 'requires confirmation' : 'preview-only'],
33
- description: action.targetPath === undefined ? action.description : `${action.description} Target: ${action.targetPath}`,
34
- }));
35
- }
36
- function renderBackups(plan) {
37
- if (plan.backupsPlanned.length === 0)
38
- return ['No backups are required for this preview.'];
39
- return plan.backupsPlanned.flatMap((backup) => renderActionLine(backup.targetPath, { labels: ['requires confirmation'], description: backup.reason }));
40
- }
41
- function renderConflicts(plan) {
42
- if (plan.conflicts.length === 0)
43
- return undefined;
44
- return renderPanel('Conflicts & Recovery', plan.conflicts.flatMap((conflict) => renderActionLine(conflict.id, {
45
- labels: [conflict.severity === 'blocking' ? 'blocked' : 'manual'],
46
- description: [
47
- conflict.message,
48
- conflict.targetPath === undefined ? undefined : `Target: ${conflict.targetPath}`,
49
- conflict.recovery === undefined ? undefined : `Recovery: ${conflict.recovery}`,
50
- ]
51
- .filter((value) => value !== undefined)
52
- .join(' '),
53
- })), { status: 'blocked' });
54
- }
55
- function renderNextCommands(plan) {
56
- if (plan.nextCommands.length === 0)
57
- return ['No next command is recommended.'];
58
- return plan.nextCommands.flatMap((command) => renderActionLine(command, { labels: ['manual'] }));
59
- }
60
- function renderOverview(plan) {
61
- return [
62
- field('Project', plan.project),
63
- field('Workspace', plan.workspaceRoot),
64
- field('Database', `${plan.db.mode} — ${plan.db.path}`),
65
- field('DB source', plan.db.source),
66
- field('Provider', plan.provider),
67
- field('Status', plan.status),
68
- ];
69
- }
70
- function field(label, value) {
71
- return `${label.padEnd(18)} ${value}`;
72
- }
73
- function yesNo(value) {
74
- return value ? 'yes' : 'no';
75
- }
76
- function formatBashPermissionPolicy(policy) {
77
- const typedPolicy = policy;
78
- return `top-level ${typedPolicy.topLevel}; manager ${typedPolicy.manager}`;
79
- }
1
+ export * from '../interfaces/cli/setup-plan-renderer.js';
@@ -1,50 +1 @@
1
- export function renderSetupStatus(status) {
2
- return [
3
- 'Setup Status [read-only]',
4
- `- Environment: ${status.environment.status} — ${status.environment.summary}`,
5
- `- Project: ${status.projectState.status} — ${status.projectState.summary}`,
6
- `- Store: ${status.store.status}${status.store.path === '' ? '' : ` — ${status.store.path}`}${status.store.blocker === undefined ? '' : ` (${status.store.blocker})`}`,
7
- `- Providers: ${status.providers.map(renderProvider).join('; ')}`,
8
- ...renderProviderPreviews(status.providers),
9
- `- Agents: ${status.agents.deferred ? 'deferred' : status.agents.status} — ${renderDefaults(status)}`,
10
- `- Verification: ${status.verification.status} — ${status.verification.summary}`,
11
- `- Next setup action: ${status.nextAction.command} — ${status.nextAction.reason}`,
12
- `- Provider writes: ${status.safety.writesProviderConfig} · provider execution: ${status.safety.executesProvider}`,
13
- 'Safety: [read-only] status only. No provider config was written; providers were not executed. Mutating setup commands require explicit confirmation.',
14
- ].join('\n');
15
- }
16
- export function setupNeedsAction(status) {
17
- return status.store.status !== 'ready' || status.verification.status !== 'ready' || status.defaults.status === 'blocked';
18
- }
19
- function renderProviderPreviews(providers) {
20
- const previews = providers.flatMap((provider) => (provider.preview === undefined ? [] : renderProviderPreview(provider)));
21
- return previews.length === 0 ? [] : ['- Provider plan previews:', ...previews];
22
- }
23
- function renderProviderPreview(provider) {
24
- const preview = provider.preview;
25
- if (preview === undefined)
26
- return [];
27
- return [
28
- ` - ${provider.displayName}: ${preview.action} — ${preview.summary}${preview.targetPath === undefined ? '' : ` (${preview.targetPath})`}`,
29
- ...(preview.backupRequired === undefined ? [] : [` Backup required: ${String(preview.backupRequired)}`]),
30
- ...(preview.confirmationRequired === undefined ? [] : [` Confirmation required: ${String(preview.confirmationRequired)}`]),
31
- ...(preview.risks.length === 0 ? [] : [` Risks: ${preview.risks.join(' ')}`]),
32
- ...(preview.warnings.length === 0 ? [] : [` Warnings: ${preview.warnings.join(' ')}`]),
33
- ];
34
- }
35
- function renderDefaults(status) {
36
- if (status.agents.deferred)
37
- return 'Project-scoped default manager/profile checks are deferred until a project is selected.';
38
- if (status.defaults.status !== 'ready')
39
- return status.defaults.blocker ?? 'default context unavailable';
40
- return `${status.defaults.agentName} via ${status.defaults.providerAdapter ?? 'unknown provider'} (${status.defaults.model ?? 'unknown model'})`;
41
- }
42
- function renderProvider(provider) {
43
- const safety = provider.actions.some((action) => action.safety.writesProviderConfig) ? 'external write action flagged' : 'no provider writes';
44
- return `${provider.displayName} ${provider.status}/${renderSupportLevel(provider.supportLevel)} (${safety})`;
45
- }
46
- function renderSupportLevel(supportLevel) {
47
- if (supportLevel === 'supported-primary' || supportLevel === 'supported-secondary')
48
- return 'supported';
49
- return supportLevel;
50
- }
1
+ export * from '../interfaces/cli/setup-status-renderer.js';
@@ -1,130 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from 'ink';
3
- import { TuiCard, TuiFocusedLine, TuiFooter, TuiHeader, TuiTabs } from './tui/ink/components.js';
4
- import { inkTuiTheme, normalizeInkTuiWidth } from './tui/ink/theme.js';
5
- export const setupTuiTabs = ['overview', 'provider', 'actions', 'safety'];
6
- const setupTuiTabItems = setupTuiTabs.map((tab) => ({ key: tab, label: labelForTab(tab) }));
7
- export function SetupTuiApp({ plan, width, selectedTab, focusedActionIndex, confirmationVisible }) {
8
- const cardWidth = normalizeInkTuiWidth(width);
9
- return (_jsxs(Box, { flexDirection: "column", width: cardWidth, paddingX: 1, paddingY: 1, children: [_jsx(TuiHeader, { title: inkTuiTheme.copy.setupTitle, subtitle: inkTuiTheme.copy.setupSubtitle, project: plan.project }), _jsx(TuiTabs, { items: setupTuiTabItems, selectedKey: selectedTab }), _jsx(Box, { marginTop: 1, children: _jsx(SelectedPanel, { plan: plan, selectedTab: selectedTab, focusedActionIndex: focusedActionIndex }) }), selectedTab === 'actions' && confirmationVisible && (_jsx(Box, { marginTop: 1, children: _jsx(ConfirmationPanel, { plan: plan, focusedActionIndex: focusedActionIndex }) })), _jsx(TuiFooter, { text: selectedTab === 'actions' ? inkTuiTheme.copy.actionHelp : inkTuiTheme.copy.keyboardHelp })] }));
10
- }
11
- function SelectedPanel({ plan, selectedTab, focusedActionIndex }) {
12
- if (selectedTab === 'overview')
13
- return _jsx(TuiCard, { title: "Overview", badge: "preview-only", tone: "warning", lines: overviewLines(plan) });
14
- if (selectedTab === 'provider')
15
- return _jsx(TuiCard, { title: "Provider Detail", badge: plan.status === 'ready' ? 'ready' : 'blocked', tone: plan.status === 'ready' ? 'success' : 'danger', lines: providerLines(plan) });
16
- if (selectedTab === 'actions')
17
- return _jsx(ActionsPanel, { plan: plan, focusedActionIndex: focusedActionIndex });
18
- return _jsx(TuiCard, { title: "Safety", badge: "no provider writes", tone: "info", lines: safetyLines() });
19
- }
20
- function ActionsPanel({ plan, focusedActionIndex }) {
21
- if (plan.actions.length === 0 && hasSetupTuiReinstallOption(plan)) {
22
- return (_jsx(TuiCard, { title: "Actions", badge: "reinstall available", tone: "warning", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(TuiFocusedLine, { label: "setup-reinstall [requires --yes] [VGXNESS-managed only]", focused: focusedActionIndex === 0 }), _jsx(Text, { color: "gray", children: " Reinstall existing VGXNESS-managed OpenCode entries only; unrelated OpenCode config is preserved." }), _jsx(Text, { color: "gray", children: " Command after review: vgxness setup reinstall --yes" })] }) }));
23
- }
24
- if (plan.actions.length === 0)
25
- return _jsx(TuiCard, { title: "Actions", badge: "preview-only", tone: "warning", lines: ['No provider config writes are planned for this preview.'] });
26
- return (_jsx(TuiCard, { title: "Actions", badge: "preview-only", tone: "warning", children: plan.actions.map((action, index) => (_jsxs(Box, { flexDirection: "column", children: [_jsx(TuiFocusedLine, { label: actionLineLabel(action), focused: index === focusedActionIndex }), _jsxs(Text, { color: "gray", children: [" ", action.description] })] }, action.id))) }));
27
- }
28
- function actionLineLabel(action) {
29
- return `${action.id} ${action.mutating ? '[writes provider config]' : '[no provider writes]'} ${action.backupRequired ? '[requires confirmation]' : '[preview-only]'}`;
30
- }
31
- function ConfirmationPanel({ plan, focusedActionIndex }) {
32
- const action = plan.actions[focusedActionIndex];
33
- if (action === undefined && hasSetupTuiReinstallOption(plan)) {
34
- return (_jsx(TuiCard, { title: "Confirm Reinstall", badge: "requires confirmation", tone: "warning", lines: [
35
- 'Selected action: setup-reinstall',
36
- 'This TUI is read-only and did not reinstall anything.',
37
- 'Reinstall replaces only VGXNESS-managed entries: mcp.vgxness and known VGXNESS agents/instructions.',
38
- 'Unrelated OpenCode config is preserved; this is not a full opencode.json reset.',
39
- 'Run manually after review: vgxness setup reinstall --yes',
40
- 'Press q or Esc to leave this preview.',
41
- ] }));
42
- }
43
- if (action === undefined)
44
- return null;
45
- return (_jsx(TuiCard, { title: "Confirm Action", badge: "requires confirmation", tone: "warning", lines: [
46
- `Selected action: ${action.id}`,
47
- inkTuiTheme.copy.readOnlyConfirmation,
48
- inkTuiTheme.copy.manualApplyCommand,
49
- 'Press q or Esc to leave this preview.',
50
- ] }));
51
- }
52
- function overviewLines(plan) {
53
- return [
54
- 'Setup summary',
55
- '',
56
- field('Project', plan.project),
57
- field('Status', plan.status),
58
- field('Provider', plan.provider),
59
- field('Database', `${plan.db.mode} (${plan.db.source})`),
60
- field('Safety', 'read-only preview'),
61
- '',
62
- `Workspace: ${plan.workspaceRoot}`,
63
- `DB path: ${plan.db.path}`,
64
- ];
65
- }
66
- function providerLines(plan) {
67
- if (plan.opencode === undefined)
68
- return [field('Provider', plan.provider), 'No provider-specific plan is available.'];
69
- const blocker = providerBlockerGuidance(plan);
70
- if (blocker !== undefined)
71
- return blocker;
72
- return [
73
- field('Provider', 'opencode'),
74
- field('Scope', plan.opencode.scope),
75
- field('Action', plan.opencode.action),
76
- field('Installs agents', plan.opencode.installsAgents ? 'yes' : 'no'),
77
- field('Agent count', String(plan.opencode.agentNames.length)),
78
- field('Recommended', recommendedProviderAction(plan)),
79
- '',
80
- `Target: ${plan.opencode.targetPath ?? 'not applicable'}`,
81
- ];
82
- }
83
- function providerBlockerGuidance(plan) {
84
- const conflict = plan.conflicts.find((item) => isExistingVgxnessInstallConflict(item.id));
85
- if (conflict === undefined || plan.opencode === undefined)
86
- return undefined;
87
- return [
88
- 'Already installed',
89
- '',
90
- conflict.id === 'existing_vgxness_mcp' ? 'OpenCode already has mcp.vgxness configured.' : 'OpenCode already has VGXNESS agent entries configured.',
91
- 'A reinstall option is available because existing VGXNESS-managed entries were detected.',
92
- '',
93
- field('Provider', 'opencode'),
94
- field('Scope', plan.opencode.scope),
95
- field('Target', plan.opencode.targetPath ?? conflict.targetPath ?? 'not applicable'),
96
- '',
97
- 'Reinstall option',
98
- 'Open the Actions tab to preview reinstall guidance.',
99
- 'It replaces only VGXNESS-managed entries and preserves unrelated OpenCode config.',
100
- 'Command after review: vgxness setup reinstall --yes',
101
- ];
102
- }
103
- export function hasSetupTuiReinstallOption(plan) {
104
- return plan.opencode !== undefined && plan.conflicts.some((item) => isExistingVgxnessInstallConflict(item.id));
105
- }
106
- function isExistingVgxnessInstallConflict(id) {
107
- return id === 'existing_vgxness_mcp' || id === 'existing_vgxness_agent';
108
- }
109
- function safetyLines() {
110
- return ['This setup TUI is read-only.', 'No provider config was written.', 'No provider process was executed.', 'Apply remains explicit through setup apply --yes after review.'];
111
- }
112
- function labelForTab(tab) {
113
- if (tab === 'overview')
114
- return 'Setup';
115
- if (tab === 'provider')
116
- return 'Provider';
117
- if (tab === 'actions')
118
- return 'Actions';
119
- return 'Safety';
120
- }
121
- function field(label, value) {
122
- return `${label.padEnd(16)} ${value}`;
123
- }
124
- function recommendedProviderAction(plan) {
125
- if (plan.status === 'conflict')
126
- return 'Resolve blocker, then rerun setup plan';
127
- if (plan.status === 'manual-required')
128
- return 'Follow manual recovery guidance';
129
- return 'Review plan, then run setup apply --yes only if it matches your intent';
130
- }
1
+ export * from '../interfaces/cli/setup-tui-app.js';
@@ -1,89 +1 @@
1
- import { okText } from './cli-help.js';
2
- import { renderSetupPlan } from './setup-plan-renderer.js';
3
- import { render as renderInk } from 'ink';
4
- import React from 'react';
5
- import { hasSetupTuiReinstallOption, SetupTuiApp } from './setup-tui-app.js';
6
- import { navigationIntentFromInput } from './tui/keymap.js';
7
- import { nextItem } from './tui/navigation.js';
8
- const enter = '\r';
9
- const escape = '\u001B';
10
- const ctrlC = '\u0003';
11
- const setupTabs = ['overview', 'provider', 'actions', 'safety'];
12
- export async function runSetupTuiController(input) {
13
- const { stdin, stdout } = input.environment;
14
- if (stdin === undefined || stdout === undefined)
15
- return okText(renderSetupPlan(input.plan));
16
- const width = setupTuiWidth(stdout);
17
- let selectedTab = 'overview';
18
- let focusedActionIndex = 0;
19
- let confirmationVisible = false;
20
- const app = renderInk(React.createElement(SetupTuiApp, { plan: input.plan, width, selectedTab, focusedActionIndex, confirmationVisible }), {
21
- stdin: stdin,
22
- stdout: stdout,
23
- interactive: true,
24
- patchConsole: false,
25
- exitOnCtrlC: false,
26
- });
27
- const rerender = () => {
28
- app.rerender(React.createElement(SetupTuiApp, { plan: input.plan, width, selectedTab, focusedActionIndex, confirmationVisible }));
29
- };
30
- stdin.setRawMode?.(true);
31
- stdin.resume?.();
32
- await new Promise((resolve) => {
33
- const listener = (chunk) => {
34
- const value = chunk.toString();
35
- const intent = navigationIntentFromInput(value);
36
- if (intent === 'cancel' || value === 'Q' || value === ctrlC) {
37
- cleanup();
38
- resolve();
39
- return;
40
- }
41
- if ((intent === 'next' && (value === enter || value === '\n')) || intent === 'select') {
42
- if (selectedTab === 'actions' && (input.plan.actions.length > 0 || hasSetupTuiReinstallOption(input.plan))) {
43
- confirmationVisible = true;
44
- rerender();
45
- return;
46
- }
47
- }
48
- if (selectedTab === 'actions' && (intent === 'down' || intent === 'up')) {
49
- focusedActionIndex = clampActionIndex(input.plan, intent === 'down' ? focusedActionIndex + 1 : focusedActionIndex - 1);
50
- confirmationVisible = false;
51
- rerender();
52
- return;
53
- }
54
- if (intent === 'next' || intent === 'down') {
55
- selectedTab = nextItem(setupTabs, selectedTab, 1);
56
- confirmationVisible = false;
57
- rerender();
58
- return;
59
- }
60
- if (intent === 'back' || intent === 'up') {
61
- selectedTab = nextItem(setupTabs, selectedTab, -1);
62
- confirmationVisible = false;
63
- rerender();
64
- }
65
- };
66
- const cleanup = () => {
67
- if (stdin.off !== undefined)
68
- stdin.off('data', listener);
69
- else
70
- stdin.removeListener?.('data', listener);
71
- stdin.setRawMode?.(false);
72
- stdin.pause?.();
73
- app.unmount();
74
- };
75
- stdin.on('data', listener);
76
- });
77
- await app.waitUntilExit();
78
- return okText('');
79
- }
80
- function clampActionIndex(plan, index) {
81
- if (plan.actions.length === 0)
82
- return 0;
83
- return Math.max(0, Math.min(index, plan.actions.length - 1));
84
- }
85
- function setupTuiWidth(stdout) {
86
- const columns = stdout.columns;
87
- const width = typeof columns === 'number' && Number.isFinite(columns) ? Math.floor(columns) : 88;
88
- return Math.max(60, Math.min(width, 88));
89
- }
1
+ export * from '../interfaces/cli/setup-tui-controller.js';
@@ -0,0 +1 @@
1
+ export * from '../../interfaces/cli/tui/focus-reducer.js';
@@ -0,0 +1 @@
1
+ export * from '../../interfaces/cli/tui/focus-types.js';
@@ -0,0 +1 @@
1
+ export * from '../../../interfaces/cli/tui/ink/app-shell.js';
@@ -1,38 +1 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { Box, Text } from 'ink';
3
- import { colorForTone, inkTuiTheme } from './theme.js';
4
- export function TuiHeader({ title, subtitle, project }) {
5
- return (_jsxs(Box, { borderStyle: "round", borderColor: colorForTone('info'), paddingX: 1, flexDirection: "column", children: [_jsxs(Box, { children: [_jsxs(Text, { bold: true, color: colorForTone('info'), children: [inkTuiTheme.symbols.brand, " ", title] }), _jsx(Text, { children: " " }), _jsx(TuiBadge, { label: inkTuiTheme.copy.readOnlyBadge, tone: "warning" }), _jsx(Text, { children: " " }), _jsx(TuiBadge, { label: inkTuiTheme.copy.previewOnlyBadge, tone: "warning" })] }), _jsxs(Text, { color: colorForTone('neutral'), children: [subtitle, " \u00B7 ", project] })] }));
6
- }
7
- export function TuiTabs({ items, selectedKey }) {
8
- return (_jsx(Box, { marginTop: 1, gap: 2, children: items.map((item) => {
9
- const selected = item.key === selectedKey;
10
- return (_jsxs(Text, { color: selected ? colorForTone('info') : colorForTone('neutral'), bold: selected, children: [selected ? inkTuiTheme.symbols.selected : inkTuiTheme.symbols.unselected, " ", item.label] }, item.key));
11
- }) }));
12
- }
13
- export function TuiSummaryBar({ items }) {
14
- return (_jsx(Box, { marginTop: 1, gap: 1, children: items.map((item) => {
15
- const tone = item.tone ?? 'neutral';
16
- const color = colorForTone(tone);
17
- return (_jsxs(Box, { borderStyle: "single", borderColor: color, paddingX: 1, flexDirection: "column", children: [_jsx(Text, { color: color, bold: true, children: item.value }), _jsx(Text, { color: colorForTone('neutral'), children: item.label })] }, `${item.label}:${item.value}`));
18
- }) }));
19
- }
20
- export function TuiCard({ title, badge, tone = 'info', lines, children }) {
21
- const color = colorForTone(tone);
22
- return (_jsxs(Box, { borderStyle: "round", borderColor: color, paddingX: 1, flexDirection: "column", width: "100%", children: [_jsxs(Text, { bold: true, color: color, children: [title, badge === undefined ? '' : ` [${badge}]`] }), (lines ?? []).map((line, index) => line.length === 0 ? (_jsx(Text, { children: " " }, lineKey(line, index))) : (_jsx(Text, { children: line }, lineKey(line, index)))), children] }));
23
- }
24
- export function TuiFooter({ text }) {
25
- return (_jsx(Box, { marginTop: 1, borderStyle: "single", borderColor: colorForTone('neutral'), paddingX: 1, children: _jsx(Text, { color: colorForTone('neutral'), children: text }) }));
26
- }
27
- export function TuiBadge({ label, tone }) {
28
- return _jsxs(Text, { color: colorForTone(tone), children: ["[", label, "]"] });
29
- }
30
- export function TuiFocusedLine({ label, focused }) {
31
- if (focused) {
32
- return (_jsxs(Text, { color: colorForTone('info'), bold: true, children: [inkTuiTheme.symbols.selected, " ", label] }));
33
- }
34
- return _jsxs(Text, { children: [" ", label] });
35
- }
36
- function lineKey(line, index) {
37
- return `${index}:${line}`;
38
- }
1
+ export * from '../../../interfaces/cli/tui/ink/components.js';
@@ -0,0 +1 @@
1
+ export * from '../../../interfaces/cli/tui/ink/help-overlay.js';