opensip-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +51 -0
  4. package/dist/api.d.ts +17 -0
  5. package/dist/api.d.ts.map +1 -0
  6. package/dist/api.js +16 -0
  7. package/dist/api.js.map +1 -0
  8. package/dist/bootstrap/admit-tool-package.d.ts +117 -0
  9. package/dist/bootstrap/admit-tool-package.d.ts.map +1 -0
  10. package/dist/bootstrap/admit-tool-package.js +170 -0
  11. package/dist/bootstrap/admit-tool-package.js.map +1 -0
  12. package/dist/bootstrap/baseline-seams.d.ts +30 -0
  13. package/dist/bootstrap/baseline-seams.d.ts.map +1 -0
  14. package/dist/bootstrap/baseline-seams.js +156 -0
  15. package/dist/bootstrap/baseline-seams.js.map +1 -0
  16. package/dist/bootstrap/bootstrap-error.d.ts +41 -0
  17. package/dist/bootstrap/bootstrap-error.d.ts.map +1 -0
  18. package/dist/bootstrap/bootstrap-error.js +33 -0
  19. package/dist/bootstrap/bootstrap-error.js.map +1 -0
  20. package/dist/bootstrap/build-command-registration-input.d.ts +34 -0
  21. package/dist/bootstrap/build-command-registration-input.d.ts.map +1 -0
  22. package/dist/bootstrap/build-command-registration-input.js +73 -0
  23. package/dist/bootstrap/build-command-registration-input.js.map +1 -0
  24. package/dist/bootstrap/build-per-run-scope.d.ts +62 -0
  25. package/dist/bootstrap/build-per-run-scope.d.ts.map +1 -0
  26. package/dist/bootstrap/build-per-run-scope.js +152 -0
  27. package/dist/bootstrap/build-per-run-scope.js.map +1 -0
  28. package/dist/bootstrap/build-targets.d.ts +42 -0
  29. package/dist/bootstrap/build-targets.d.ts.map +1 -0
  30. package/dist/bootstrap/build-targets.js +117 -0
  31. package/dist/bootstrap/build-targets.js.map +1 -0
  32. package/dist/bootstrap/cli-defaults.d.ts +35 -0
  33. package/dist/bootstrap/cli-defaults.d.ts.map +1 -0
  34. package/dist/bootstrap/cli-defaults.js +65 -0
  35. package/dist/bootstrap/cli-defaults.js.map +1 -0
  36. package/dist/bootstrap/config-and-capabilities.d.ts +74 -0
  37. package/dist/bootstrap/config-and-capabilities.d.ts.map +1 -0
  38. package/dist/bootstrap/config-and-capabilities.js +224 -0
  39. package/dist/bootstrap/config-and-capabilities.js.map +1 -0
  40. package/dist/bootstrap/deliver-envelope.d.ts +80 -0
  41. package/dist/bootstrap/deliver-envelope.d.ts.map +1 -0
  42. package/dist/bootstrap/deliver-envelope.js +195 -0
  43. package/dist/bootstrap/deliver-envelope.js.map +1 -0
  44. package/dist/bootstrap/egress-plane.d.ts +22 -0
  45. package/dist/bootstrap/egress-plane.d.ts.map +1 -0
  46. package/dist/bootstrap/egress-plane.js +37 -0
  47. package/dist/bootstrap/egress-plane.js.map +1 -0
  48. package/dist/bootstrap/host-planes.d.ts +28 -0
  49. package/dist/bootstrap/host-planes.d.ts.map +1 -0
  50. package/dist/bootstrap/host-planes.js +152 -0
  51. package/dist/bootstrap/host-planes.js.map +1 -0
  52. package/dist/bootstrap/index.d.ts +76 -0
  53. package/dist/bootstrap/index.d.ts.map +1 -0
  54. package/dist/bootstrap/index.js +109 -0
  55. package/dist/bootstrap/index.js.map +1 -0
  56. package/dist/bootstrap/live-plane.d.ts +51 -0
  57. package/dist/bootstrap/live-plane.d.ts.map +1 -0
  58. package/dist/bootstrap/live-plane.js +72 -0
  59. package/dist/bootstrap/live-plane.js.map +1 -0
  60. package/dist/bootstrap/load-tool-capabilities.d.ts +42 -0
  61. package/dist/bootstrap/load-tool-capabilities.d.ts.map +1 -0
  62. package/dist/bootstrap/load-tool-capabilities.js +76 -0
  63. package/dist/bootstrap/load-tool-capabilities.js.map +1 -0
  64. package/dist/bootstrap/output-plane.d.ts +37 -0
  65. package/dist/bootstrap/output-plane.d.ts.map +1 -0
  66. package/dist/bootstrap/output-plane.js +114 -0
  67. package/dist/bootstrap/output-plane.js.map +1 -0
  68. package/dist/bootstrap/owning-tool-init.d.ts +32 -0
  69. package/dist/bootstrap/owning-tool-init.d.ts.map +1 -0
  70. package/dist/bootstrap/owning-tool-init.js +69 -0
  71. package/dist/bootstrap/owning-tool-init.js.map +1 -0
  72. package/dist/bootstrap/pre-action-guards.d.ts +44 -0
  73. package/dist/bootstrap/pre-action-guards.d.ts.map +1 -0
  74. package/dist/bootstrap/pre-action-guards.js +136 -0
  75. package/dist/bootstrap/pre-action-guards.js.map +1 -0
  76. package/dist/bootstrap/pre-action-hook.d.ts +68 -0
  77. package/dist/bootstrap/pre-action-hook.d.ts.map +1 -0
  78. package/dist/bootstrap/pre-action-hook.js +289 -0
  79. package/dist/bootstrap/pre-action-hook.js.map +1 -0
  80. package/dist/bootstrap/pre-action-messages.d.ts +32 -0
  81. package/dist/bootstrap/pre-action-messages.d.ts.map +1 -0
  82. package/dist/bootstrap/pre-action-messages.js +49 -0
  83. package/dist/bootstrap/pre-action-messages.js.map +1 -0
  84. package/dist/bootstrap/process-idempotency.d.ts +17 -0
  85. package/dist/bootstrap/process-idempotency.d.ts.map +1 -0
  86. package/dist/bootstrap/process-idempotency.js +20 -0
  87. package/dist/bootstrap/process-idempotency.js.map +1 -0
  88. package/dist/bootstrap/register-language-adapters.d.ts +23 -0
  89. package/dist/bootstrap/register-language-adapters.d.ts.map +1 -0
  90. package/dist/bootstrap/register-language-adapters.js +35 -0
  91. package/dist/bootstrap/register-language-adapters.js.map +1 -0
  92. package/dist/bootstrap/register-tools.d.ts +228 -0
  93. package/dist/bootstrap/register-tools.d.ts.map +1 -0
  94. package/dist/bootstrap/register-tools.js +696 -0
  95. package/dist/bootstrap/register-tools.js.map +1 -0
  96. package/dist/bootstrap/render.d.ts +27 -0
  97. package/dist/bootstrap/render.d.ts.map +1 -0
  98. package/dist/bootstrap/render.js +53 -0
  99. package/dist/bootstrap/render.js.map +1 -0
  100. package/dist/bootstrap/report.d.ts +34 -0
  101. package/dist/bootstrap/report.d.ts.map +1 -0
  102. package/dist/bootstrap/report.js +47 -0
  103. package/dist/bootstrap/report.js.map +1 -0
  104. package/dist/bootstrap/run-plane.d.ts +105 -0
  105. package/dist/bootstrap/run-plane.d.ts.map +1 -0
  106. package/dist/bootstrap/run-plane.js +190 -0
  107. package/dist/bootstrap/run-plane.js.map +1 -0
  108. package/dist/bootstrap/scope-access.d.ts +68 -0
  109. package/dist/bootstrap/scope-access.d.ts.map +1 -0
  110. package/dist/bootstrap/scope-access.js +115 -0
  111. package/dist/bootstrap/scope-access.js.map +1 -0
  112. package/dist/bootstrap/state-seams.d.ts +14 -0
  113. package/dist/bootstrap/state-seams.d.ts.map +1 -0
  114. package/dist/bootstrap/state-seams.js +26 -0
  115. package/dist/bootstrap/state-seams.js.map +1 -0
  116. package/dist/bootstrap/tool-lifecycle.d.ts +102 -0
  117. package/dist/bootstrap/tool-lifecycle.d.ts.map +1 -0
  118. package/dist/bootstrap/tool-lifecycle.js +103 -0
  119. package/dist/bootstrap/tool-lifecycle.js.map +1 -0
  120. package/dist/bootstrap/tool-trust.d.ts +49 -0
  121. package/dist/bootstrap/tool-trust.d.ts.map +1 -0
  122. package/dist/bootstrap/tool-trust.js +65 -0
  123. package/dist/bootstrap/tool-trust.js.map +1 -0
  124. package/dist/bootstrap/validate-tool.d.ts +22 -0
  125. package/dist/bootstrap/validate-tool.d.ts.map +1 -0
  126. package/dist/bootstrap/validate-tool.js +38 -0
  127. package/dist/bootstrap/validate-tool.js.map +1 -0
  128. package/dist/cli-context.d.ts +38 -0
  129. package/dist/cli-context.d.ts.map +1 -0
  130. package/dist/cli-context.js +134 -0
  131. package/dist/cli-context.js.map +1 -0
  132. package/dist/commands/agent-catalog.d.ts +45 -0
  133. package/dist/commands/agent-catalog.d.ts.map +1 -0
  134. package/dist/commands/agent-catalog.js +115 -0
  135. package/dist/commands/agent-catalog.js.map +1 -0
  136. package/dist/commands/assemble-outcome.d.ts +69 -0
  137. package/dist/commands/assemble-outcome.d.ts.map +1 -0
  138. package/dist/commands/assemble-outcome.js +121 -0
  139. package/dist/commands/assemble-outcome.js.map +1 -0
  140. package/dist/commands/clear.d.ts +32 -0
  141. package/dist/commands/clear.d.ts.map +1 -0
  142. package/dist/commands/clear.js +73 -0
  143. package/dist/commands/clear.js.map +1 -0
  144. package/dist/commands/completion.d.ts +90 -0
  145. package/dist/commands/completion.d.ts.map +1 -0
  146. package/dist/commands/completion.js +233 -0
  147. package/dist/commands/completion.js.map +1 -0
  148. package/dist/commands/configure.d.ts +32 -0
  149. package/dist/commands/configure.d.ts.map +1 -0
  150. package/dist/commands/configure.js +94 -0
  151. package/dist/commands/configure.js.map +1 -0
  152. package/dist/commands/history.d.ts +18 -0
  153. package/dist/commands/history.d.ts.map +1 -0
  154. package/dist/commands/history.js +48 -0
  155. package/dist/commands/history.js.map +1 -0
  156. package/dist/commands/host-command-specs.d.ts +49 -0
  157. package/dist/commands/host-command-specs.d.ts.map +1 -0
  158. package/dist/commands/host-command-specs.js +331 -0
  159. package/dist/commands/host-command-specs.js.map +1 -0
  160. package/dist/commands/host-subcommand-groups.d.ts +69 -0
  161. package/dist/commands/host-subcommand-groups.d.ts.map +1 -0
  162. package/dist/commands/host-subcommand-groups.js +374 -0
  163. package/dist/commands/host-subcommand-groups.js.map +1 -0
  164. package/dist/commands/index.d.ts +36 -0
  165. package/dist/commands/index.d.ts.map +1 -0
  166. package/dist/commands/index.js +36 -0
  167. package/dist/commands/index.js.map +1 -0
  168. package/dist/commands/init/config-templates.d.ts +16 -0
  169. package/dist/commands/init/config-templates.d.ts.map +1 -0
  170. package/dist/commands/init/config-templates.js +108 -0
  171. package/dist/commands/init/config-templates.js.map +1 -0
  172. package/dist/commands/init/file-classifier.d.ts +40 -0
  173. package/dist/commands/init/file-classifier.d.ts.map +1 -0
  174. package/dist/commands/init/file-classifier.js +155 -0
  175. package/dist/commands/init/file-classifier.js.map +1 -0
  176. package/dist/commands/init/language-detection.d.ts +44 -0
  177. package/dist/commands/init/language-detection.d.ts.map +1 -0
  178. package/dist/commands/init/language-detection.js +124 -0
  179. package/dist/commands/init/language-detection.js.map +1 -0
  180. package/dist/commands/init/scaffold-writer.d.ts +26 -0
  181. package/dist/commands/init/scaffold-writer.d.ts.map +1 -0
  182. package/dist/commands/init/scaffold-writer.js +102 -0
  183. package/dist/commands/init/scaffold-writer.js.map +1 -0
  184. package/dist/commands/init/state-machine.d.ts +32 -0
  185. package/dist/commands/init/state-machine.d.ts.map +1 -0
  186. package/dist/commands/init/state-machine.js +105 -0
  187. package/dist/commands/init/state-machine.js.map +1 -0
  188. package/dist/commands/init.d.ts +95 -0
  189. package/dist/commands/init.d.ts.map +1 -0
  190. package/dist/commands/init.js +209 -0
  191. package/dist/commands/init.js.map +1 -0
  192. package/dist/commands/mount-command-spec.d.ts +106 -0
  193. package/dist/commands/mount-command-spec.d.ts.map +1 -0
  194. package/dist/commands/mount-command-spec.js +313 -0
  195. package/dist/commands/mount-command-spec.js.map +1 -0
  196. package/dist/commands/mount-result-command.d.ts +71 -0
  197. package/dist/commands/mount-result-command.d.ts.map +1 -0
  198. package/dist/commands/mount-result-command.js +76 -0
  199. package/dist/commands/mount-result-command.js.map +1 -0
  200. package/dist/commands/plugin/config-edit.d.ts +20 -0
  201. package/dist/commands/plugin/config-edit.d.ts.map +1 -0
  202. package/dist/commands/plugin/config-edit.js +102 -0
  203. package/dist/commands/plugin/config-edit.js.map +1 -0
  204. package/dist/commands/plugin/domain-resolution.d.ts +38 -0
  205. package/dist/commands/plugin/domain-resolution.d.ts.map +1 -0
  206. package/dist/commands/plugin/domain-resolution.js +98 -0
  207. package/dist/commands/plugin/domain-resolution.js.map +1 -0
  208. package/dist/commands/plugin/host-dir.d.ts +42 -0
  209. package/dist/commands/plugin/host-dir.d.ts.map +1 -0
  210. package/dist/commands/plugin/host-dir.js +168 -0
  211. package/dist/commands/plugin/host-dir.js.map +1 -0
  212. package/dist/commands/plugin-host-ops.d.ts +41 -0
  213. package/dist/commands/plugin-host-ops.d.ts.map +1 -0
  214. package/dist/commands/plugin-host-ops.js +114 -0
  215. package/dist/commands/plugin-host-ops.js.map +1 -0
  216. package/dist/commands/plugin.d.ts +81 -0
  217. package/dist/commands/plugin.d.ts.map +1 -0
  218. package/dist/commands/plugin.js +287 -0
  219. package/dist/commands/plugin.js.map +1 -0
  220. package/dist/commands/render-outcome.d.ts +52 -0
  221. package/dist/commands/render-outcome.d.ts.map +1 -0
  222. package/dist/commands/render-outcome.js +55 -0
  223. package/dist/commands/render-outcome.js.map +1 -0
  224. package/dist/commands/session-show.d.ts +27 -0
  225. package/dist/commands/session-show.d.ts.map +1 -0
  226. package/dist/commands/session-show.js +166 -0
  227. package/dist/commands/session-show.js.map +1 -0
  228. package/dist/commands/shared.d.ts +107 -0
  229. package/dist/commands/shared.d.ts.map +1 -0
  230. package/dist/commands/shared.js +13 -0
  231. package/dist/commands/shared.js.map +1 -0
  232. package/dist/commands/tools/data-purge.d.ts +20 -0
  233. package/dist/commands/tools/data-purge.d.ts.map +1 -0
  234. package/dist/commands/tools/data-purge.js +59 -0
  235. package/dist/commands/tools/data-purge.js.map +1 -0
  236. package/dist/commands/tools/index.d.ts +16 -0
  237. package/dist/commands/tools/index.d.ts.map +1 -0
  238. package/dist/commands/tools/index.js +213 -0
  239. package/dist/commands/tools/index.js.map +1 -0
  240. package/dist/commands/tools/install.d.ts +24 -0
  241. package/dist/commands/tools/install.d.ts.map +1 -0
  242. package/dist/commands/tools/install.js +83 -0
  243. package/dist/commands/tools/install.js.map +1 -0
  244. package/dist/commands/tools/list.d.ts +41 -0
  245. package/dist/commands/tools/list.d.ts.map +1 -0
  246. package/dist/commands/tools/list.js +103 -0
  247. package/dist/commands/tools/list.js.map +1 -0
  248. package/dist/commands/tools/runtime-probe-entry.d.ts +14 -0
  249. package/dist/commands/tools/runtime-probe-entry.d.ts.map +1 -0
  250. package/dist/commands/tools/runtime-probe-entry.js +36 -0
  251. package/dist/commands/tools/runtime-probe-entry.js.map +1 -0
  252. package/dist/commands/tools/runtime-probe.d.ts +29 -0
  253. package/dist/commands/tools/runtime-probe.d.ts.map +1 -0
  254. package/dist/commands/tools/runtime-probe.js +66 -0
  255. package/dist/commands/tools/runtime-probe.js.map +1 -0
  256. package/dist/commands/tools/storage-contract-checks.d.ts +37 -0
  257. package/dist/commands/tools/storage-contract-checks.d.ts.map +1 -0
  258. package/dist/commands/tools/storage-contract-checks.js +91 -0
  259. package/dist/commands/tools/storage-contract-checks.js.map +1 -0
  260. package/dist/commands/tools/uninstall.d.ts +29 -0
  261. package/dist/commands/tools/uninstall.d.ts.map +1 -0
  262. package/dist/commands/tools/uninstall.js +77 -0
  263. package/dist/commands/tools/uninstall.js.map +1 -0
  264. package/dist/commands/tools/validate.d.ts +44 -0
  265. package/dist/commands/tools/validate.d.ts.map +1 -0
  266. package/dist/commands/tools/validate.js +202 -0
  267. package/dist/commands/tools/validate.js.map +1 -0
  268. package/dist/commands/uninstall/targets.d.ts +53 -0
  269. package/dist/commands/uninstall/targets.d.ts.map +1 -0
  270. package/dist/commands/uninstall/targets.js +205 -0
  271. package/dist/commands/uninstall/targets.js.map +1 -0
  272. package/dist/commands/uninstall.d.ts +88 -0
  273. package/dist/commands/uninstall.d.ts.map +1 -0
  274. package/dist/commands/uninstall.js +184 -0
  275. package/dist/commands/uninstall.js.map +1 -0
  276. package/dist/env/host-env-specs.d.ts +52 -0
  277. package/dist/env/host-env-specs.d.ts.map +1 -0
  278. package/dist/env/host-env-specs.js +129 -0
  279. package/dist/env/host-env-specs.js.map +1 -0
  280. package/dist/error-handler.d.ts +64 -0
  281. package/dist/error-handler.d.ts.map +1 -0
  282. package/dist/error-handler.js +180 -0
  283. package/dist/error-handler.js.map +1 -0
  284. package/dist/index.d.ts +21 -0
  285. package/dist/index.d.ts.map +1 -0
  286. package/dist/index.js +154 -0
  287. package/dist/index.js.map +1 -0
  288. package/dist/open-report.d.ts +40 -0
  289. package/dist/open-report.d.ts.map +1 -0
  290. package/dist/open-report.js +54 -0
  291. package/dist/open-report.js.map +1 -0
  292. package/dist/report-compose.d.ts +35 -0
  293. package/dist/report-compose.d.ts.map +1 -0
  294. package/dist/report-compose.js +103 -0
  295. package/dist/report-compose.js.map +1 -0
  296. package/dist/session-replay-registry.d.ts +20 -0
  297. package/dist/session-replay-registry.d.ts.map +1 -0
  298. package/dist/session-replay-registry.js +38 -0
  299. package/dist/session-replay-registry.js.map +1 -0
  300. package/dist/telemetry/profiling.d.ts +42 -0
  301. package/dist/telemetry/profiling.d.ts.map +1 -0
  302. package/dist/telemetry/profiling.js +160 -0
  303. package/dist/telemetry/profiling.js.map +1 -0
  304. package/dist/telemetry/sdk-init.d.ts +87 -0
  305. package/dist/telemetry/sdk-init.d.ts.map +1 -0
  306. package/dist/telemetry/sdk-init.js +235 -0
  307. package/dist/telemetry/sdk-init.js.map +1 -0
  308. package/dist/ui/App.d.ts +32 -0
  309. package/dist/ui/App.d.ts.map +1 -0
  310. package/dist/ui/App.js +35 -0
  311. package/dist/ui/App.js.map +1 -0
  312. package/dist/ui/render.d.ts +15 -0
  313. package/dist/ui/render.d.ts.map +1 -0
  314. package/dist/ui/render.js +21 -0
  315. package/dist/ui/render.js.map +1 -0
  316. package/dist/ui/result-to-view.d.ts +40 -0
  317. package/dist/ui/result-to-view.d.ts.map +1 -0
  318. package/dist/ui/result-to-view.js +389 -0
  319. package/dist/ui/result-to-view.js.map +1 -0
  320. package/dist/ui/views/init-view.d.ts +9 -0
  321. package/dist/ui/views/init-view.d.ts.map +1 -0
  322. package/dist/ui/views/init-view.js +119 -0
  323. package/dist/ui/views/init-view.js.map +1 -0
  324. package/dist/ui/views/misc-views.d.ts +18 -0
  325. package/dist/ui/views/misc-views.d.ts.map +1 -0
  326. package/dist/ui/views/misc-views.js +244 -0
  327. package/dist/ui/views/misc-views.js.map +1 -0
  328. package/dist/ui/views/plugin-view.d.ts +8 -0
  329. package/dist/ui/views/plugin-view.d.ts.map +1 -0
  330. package/dist/ui/views/plugin-view.js +135 -0
  331. package/dist/ui/views/plugin-view.js.map +1 -0
  332. package/dist/ui/views/tools-views.d.ts +12 -0
  333. package/dist/ui/views/tools-views.d.ts.map +1 -0
  334. package/dist/ui/views/tools-views.js +152 -0
  335. package/dist/ui/views/tools-views.js.map +1 -0
  336. package/dist/update-notifier.d.ts +108 -0
  337. package/dist/update-notifier.d.ts.map +1 -0
  338. package/dist/update-notifier.js +188 -0
  339. package/dist/update-notifier.js.map +1 -0
  340. package/dist/update-state.d.ts +40 -0
  341. package/dist/update-state.d.ts.map +1 -0
  342. package/dist/update-state.js +81 -0
  343. package/dist/update-state.js.map +1 -0
  344. package/dist/welcome.d.ts +53 -0
  345. package/dist/welcome.d.ts.map +1 -0
  346. package/dist/welcome.js +89 -0
  347. package/dist/welcome.js.map +1 -0
  348. package/package.json +100 -0
@@ -0,0 +1,374 @@
1
+ // @fitness-ignore-file file-length-limit -- deliberate single cycle-free leaf module: it houses BOTH host subcommand groups' leaf specs (sessions + plugin) AND the completion inventory together specifically because it must import neither completion.ts nor host-command-specs.ts (see header — splitting would reintroduce the module cycle this file exists to break). Cohesive by design; grew past the 400-line soft limit with the per-leaf CommandSpec builders.
2
+ /**
3
+ * host-subcommand-groups — the action-less Commander subcommand GROUPS
4
+ * (`sessions`, `plugin`) and their leaf {@link CommandSpec}s (launch
5
+ * Phase 6).
6
+ *
7
+ * Split out of `host-command-specs.ts` for ONE reason: to break a module cycle.
8
+ * The completion-script generator (`completion.ts`) sources its `plugin` /
9
+ * `sessions` sub-subcommand NAME lists from the live leaf specs (single source —
10
+ * Phase 6 Task 6.2), so it must import the group inventory. The
11
+ * `host-command-specs.ts` module, in turn, imports `printCompletionScript` from
12
+ * `completion.ts` for the `completion` command's handler. Housing the GROUP
13
+ * leaves + inventory here (a module that imports NEITHER `completion.ts` nor
14
+ * `host-command-specs.ts`) lets both depend on this leaf module without a cycle.
15
+ *
16
+ * The two parents are action-less GROUPS — a parent with no action body is not
17
+ * a single mountable `CommandSpec`, so it stays a raw `program.command(name)`
18
+ * shell (the FINITE, NAMED documented exceptions for the Phase 7
19
+ * `command-surface-parity` guardrail's allow-list, see {@link HOST_SUBCOMMAND_GROUPS}).
20
+ * Their LEAVES (`sessions list|purge`, `plugin list|add|remove|sync`) ARE specs.
21
+ */
22
+ import { currentScope, defineCommand, } from '@opensip-cli/core';
23
+ import { executeClear } from './clear.js';
24
+ import { showHistory } from './history.js';
25
+ import { pluginAdd, pluginList, pluginRemove, pluginSync } from './plugin.js';
26
+ import { executeSessionShow } from './session-show.js';
27
+ import { buildToolsGroupLeaves } from './tools/index.js';
28
+ /** Every grouped leaf needs the entered project scope (datastore / project
29
+ * context). Named once so the discriminant isn't restated per spec. */
30
+ const PROJECT_SCOPE = 'project';
31
+ /** The `command-result` output mode, named once (the leaves all share it). */
32
+ const COMMAND_RESULT = 'command-result';
33
+ const RAW_STREAM = 'raw-stream';
34
+ /** Prefer the discovered project root; fall back to literal cwd; finally process.cwd(). */
35
+ export function effectiveCwd(opts) {
36
+ return opts.projectContext?.projectRoot ?? opts.cwd ?? process.cwd();
37
+ }
38
+ // ---------------------------------------------------------------------------
39
+ // sessions list / purge
40
+ // ---------------------------------------------------------------------------
41
+ function buildSessionsListSpec(ctx) {
42
+ return defineCommand({
43
+ name: 'list',
44
+ description: 'List stored sessions',
45
+ commonFlags: ['json'],
46
+ options: [
47
+ {
48
+ flag: '--tool',
49
+ value: '<name>',
50
+ description: 'Filter to one tool',
51
+ choices: ['fit', 'graph', 'sim'],
52
+ },
53
+ {
54
+ flag: '--limit',
55
+ value: '<n>',
56
+ description: 'Maximum sessions to return',
57
+ parse: parsePositiveInt,
58
+ },
59
+ {
60
+ flag: '--summary-only',
61
+ description: 'Omit heavy per-session payloads (agent friendly; showCommand and lightweight summary remain). ' +
62
+ 'Pairs well with --json for lean "menu" of historical results.',
63
+ },
64
+ ],
65
+ scope: PROJECT_SCOPE,
66
+ output: COMMAND_RESULT,
67
+ handler: (rawOpts) => {
68
+ const opts = rawOpts;
69
+ return showHistory(ctx.datastore(), {
70
+ tool: opts.tool,
71
+ limit: opts.limit,
72
+ summaryOnly: !!opts.summaryOnly,
73
+ });
74
+ },
75
+ });
76
+ }
77
+ function buildSessionsShowSpec(ctx) {
78
+ return defineCommand({
79
+ name: 'show',
80
+ description: 'Display a stored session result',
81
+ commonFlags: ['json'],
82
+ args: [{ name: 'ref', description: 'Session id, or latest with --tool' }],
83
+ options: [
84
+ {
85
+ flag: '--tool',
86
+ value: '<name>',
87
+ description: 'Tool for latest, or an optional id sanity check',
88
+ choices: ['fit', 'graph', 'sim'],
89
+ },
90
+ {
91
+ flag: '--filter',
92
+ value: '<type>',
93
+ description: 'Filter replayed signals (repeatable): errors-only | warnings-only | top:<n>. ' +
94
+ 'Composable, e.g. --filter errors-only --filter top:20. Agent ergonomics for historical results.',
95
+ arrayDefault: [],
96
+ parse: (val, prev) => [...prev, val],
97
+ },
98
+ {
99
+ flag: '--raw',
100
+ description: 'With --json: emit the inner payload (session + envelope + metadata) without the outer CommandResult wrapper. ' +
101
+ 'Ideal for agents that want the smallest possible response.',
102
+ },
103
+ ],
104
+ scope: PROJECT_SCOPE,
105
+ output: RAW_STREAM,
106
+ rawStreamReason: 'session-replay',
107
+ handler: async (rawOpts) => {
108
+ const opts = rawOpts;
109
+ const ref = opts._args[0];
110
+ const filters = normalizeFilterOption(opts.filter);
111
+ await executeSessionShow({
112
+ replayRegistry: ctx.sessionReplayRegistry,
113
+ ref,
114
+ tool: opts.tool,
115
+ json: opts.json,
116
+ filters,
117
+ raw: opts.raw,
118
+ render: ctx.render,
119
+ emitJson: ctx.emitJson,
120
+ emitRaw: ctx.emitRaw,
121
+ emitError: ctx.emitError,
122
+ setExitCode: ctx.setExitCode,
123
+ });
124
+ },
125
+ });
126
+ }
127
+ /**
128
+ * Normalize the repeatable `--filter` option (Commander yields a string for one
129
+ * occurrence, a string[] for many, undefined for none) into a uniform
130
+ * `string[] | undefined` for `executeSessionShow`.
131
+ */
132
+ function normalizeFilterOption(filter) {
133
+ if (Array.isArray(filter))
134
+ return filter;
135
+ if (filter)
136
+ return [filter];
137
+ return undefined;
138
+ }
139
+ /**
140
+ * Validating coercion for `sessions list --limit <n>`.
141
+ *
142
+ * @throws {Error} When the raw value is not a positive integer.
143
+ */
144
+ function parsePositiveInt(raw) {
145
+ const n = Number.parseInt(raw, 10);
146
+ if (Number.isNaN(n) || n <= 0) {
147
+ throw new Error(`Invalid --limit value: '${raw}'. Must be a positive integer.`);
148
+ }
149
+ return n;
150
+ }
151
+ /**
152
+ * Validating coercion for `sessions purge --older-than <days>` — identical to
153
+ * the former inline argParser. A named declaration (not an inline lambda) so the
154
+ * `@throws` contract below is documented.
155
+ *
156
+ * @throws {Error} When the raw value is not a non-negative integer.
157
+ */
158
+ function parseOlderThanDays(raw) {
159
+ const n = Number.parseInt(raw, 10);
160
+ if (Number.isNaN(n) || n < 0) {
161
+ throw new Error(`Invalid --older-than value: '${raw}'. Must be a non-negative integer.`);
162
+ }
163
+ return n;
164
+ }
165
+ function buildSessionsPurgeSpec(ctx) {
166
+ return defineCommand({
167
+ name: 'purge',
168
+ description: 'Delete session rows from the project-local SQLite store (opensip-cli/.runtime/datastore.sqlite)',
169
+ commonFlags: ['json'],
170
+ options: [
171
+ {
172
+ flag: '--older-than',
173
+ value: '<days>',
174
+ description: 'Only delete sessions older than N days',
175
+ // Pure validating coercion — identical to the former inline argParser.
176
+ parse: parseOlderThanDays,
177
+ },
178
+ { flag: '-y, --yes', description: 'Skip confirmation prompt', default: false },
179
+ ],
180
+ scope: PROJECT_SCOPE,
181
+ output: COMMAND_RESULT,
182
+ handler: (rawOpts) => {
183
+ const opts = rawOpts;
184
+ return executeClear({
185
+ olderThan: opts.olderThan,
186
+ yes: opts.yes,
187
+ datastore: ctx.datastore(),
188
+ });
189
+ },
190
+ });
191
+ }
192
+ // ---------------------------------------------------------------------------
193
+ // plugin list / add / remove / sync
194
+ // ---------------------------------------------------------------------------
195
+ /** The shared `--cwd <path>` option for the plugin leaves. Its description is
196
+ * "Project root" (NOT the registry's "Target directory"), so it is declared as
197
+ * a per-command OptionSpec rather than the `cwd` common flag — preserving the
198
+ * byte-identical help text. The default resolves per-invocation (the builders
199
+ * run on each `registerCliCommands` call). */
200
+ function pluginCwdOption() {
201
+ return {
202
+ flag: '--cwd',
203
+ value: '<path>',
204
+ description: 'Project root',
205
+ default: process.cwd(),
206
+ };
207
+ }
208
+ function buildPluginListSpec(ctx) {
209
+ return defineCommand({
210
+ name: 'list',
211
+ description: 'List installed plugins',
212
+ commonFlags: ['json'],
213
+ options: [pluginCwdOption()],
214
+ scope: PROJECT_SCOPE,
215
+ output: COMMAND_RESULT,
216
+ handler: (rawOpts) => {
217
+ const opts = rawOpts;
218
+ // Per-run admitted-tool provenance is on the entered RunScope (stamped by
219
+ // the bootstrap); read it here and pass it into the pure `pluginList`.
220
+ return pluginList(effectiveCwd(opts), ctx.pluginLayouts, currentScope()?.toolProvenance ?? []);
221
+ },
222
+ });
223
+ }
224
+ function buildPluginAddSpec(ctx) {
225
+ return defineCommand({
226
+ name: 'add',
227
+ description: 'Install a plugin (fit/sim pack → project config; tool → user-global by default)',
228
+ commonFlags: ['json'],
229
+ options: [
230
+ {
231
+ flag: '--domain',
232
+ value: '<fit|sim|tool>',
233
+ description: 'Target domain (default: inferred; tool plugins auto-detected by marker)',
234
+ },
235
+ {
236
+ flag: '--project',
237
+ description: 'For a tool plugin, install project-local (.runtime/) instead of user-global',
238
+ default: false,
239
+ },
240
+ pluginCwdOption(),
241
+ ],
242
+ // Empty description: the former `.command('add <package>')` declared the
243
+ // positional inline with no help text, so Commander rendered no "Arguments:"
244
+ // block. Keeping it empty preserves the byte-identical --help.
245
+ args: [{ name: 'package', description: '' }],
246
+ scope: PROJECT_SCOPE,
247
+ output: COMMAND_RESULT,
248
+ handler: (rawOpts) => {
249
+ const opts = rawOpts;
250
+ const packageName = opts._args[0];
251
+ return pluginAdd(packageName, effectiveCwd(opts), opts.domain, ctx.pluginLayouts, {
252
+ project: opts.project,
253
+ });
254
+ },
255
+ });
256
+ }
257
+ function buildPluginRemoveSpec(ctx) {
258
+ return defineCommand({
259
+ name: 'remove',
260
+ description: 'Uninstall a plugin (and remove from opensip-cli.config.yml for fit/sim packs)',
261
+ commonFlags: ['json'],
262
+ options: [
263
+ {
264
+ flag: '--domain',
265
+ value: '<fit|sim|tool>',
266
+ description: 'Target domain (default: inferred from package name)',
267
+ },
268
+ {
269
+ flag: '--project',
270
+ description: 'For a tool plugin, target the project-local install instead of user-global',
271
+ default: false,
272
+ },
273
+ pluginCwdOption(),
274
+ ],
275
+ // Empty description — see the plugin-add note above (byte-identical --help).
276
+ args: [{ name: 'package', description: '' }],
277
+ scope: PROJECT_SCOPE,
278
+ output: COMMAND_RESULT,
279
+ handler: (rawOpts) => {
280
+ const opts = rawOpts;
281
+ const packageName = opts._args[0];
282
+ return pluginRemove(packageName, effectiveCwd(opts), opts.domain, ctx.pluginLayouts, {
283
+ project: opts.project,
284
+ });
285
+ },
286
+ });
287
+ }
288
+ function buildPluginSyncSpec(ctx) {
289
+ return defineCommand({
290
+ name: 'sync',
291
+ description: 'Install every plugin declared in opensip-cli.config.yml (post-clone bootstrap)',
292
+ commonFlags: ['json'],
293
+ options: [
294
+ { flag: '--domain', value: '<fit|sim>', description: 'Sync only one domain' },
295
+ pluginCwdOption(),
296
+ ],
297
+ scope: PROJECT_SCOPE,
298
+ output: COMMAND_RESULT,
299
+ handler: (rawOpts) => {
300
+ const opts = rawOpts;
301
+ return pluginSync(effectiveCwd(opts), opts.domain, ctx.pluginLayouts);
302
+ },
303
+ });
304
+ }
305
+ /**
306
+ * The action-less Commander subcommand GROUPS that legitimately cannot be a
307
+ * single {@link CommandSpec} — they have no action body, only sub-subcommands.
308
+ * This is the FINITE, NAMED set the Phase 7 `command-surface-parity` guardrail
309
+ * allow-lists as documented host exceptions. Every other host command IS a spec.
310
+ */
311
+ export const HOST_SUBCOMMAND_GROUPS = ['sessions', 'plugin', 'tools'];
312
+ /**
313
+ * Build the subcommand-group parents with their leaf specs. The mounter turns
314
+ * each into a raw parent `program.command(name)` plus `mountCommandSpec(parent,
315
+ * leaf)` for each leaf.
316
+ */
317
+ export function buildHostSubcommandGroups(ctx) {
318
+ return [
319
+ {
320
+ name: 'sessions',
321
+ description: 'Manage session data',
322
+ leaves: [buildSessionsListSpec(ctx), buildSessionsShowSpec(ctx), buildSessionsPurgeSpec(ctx)],
323
+ },
324
+ {
325
+ name: 'plugin',
326
+ description: 'Manage project-local plugins (add, list, remove, sync)',
327
+ leaves: [
328
+ buildPluginListSpec(ctx),
329
+ buildPluginAddSpec(ctx),
330
+ buildPluginRemoveSpec(ctx),
331
+ buildPluginSyncSpec(ctx),
332
+ ],
333
+ },
334
+ {
335
+ name: 'tools',
336
+ description: 'Manage whole Tool plugins (list, validate, install, uninstall)',
337
+ leaves: buildToolsGroupLeaves(ctx),
338
+ },
339
+ ];
340
+ }
341
+ /**
342
+ * A no-op {@link CliCommandsContext} used purely to BUILD the group leaf specs
343
+ * so their `name` can be read for the completion-script sub-subcommand
344
+ * inventory. The handlers are never invoked here — we only inspect the static
345
+ * declarations — so the render/datastore/exit members are inert stubs.
346
+ */
347
+ const INVENTORY_CTX = {
348
+ setExitCode: () => {
349
+ /* inert — inventory builds never dispatch a handler */
350
+ },
351
+ render: () => Promise.resolve(),
352
+ emitJson: () => {
353
+ /* inert — inventory builds never dispatch a handler */
354
+ },
355
+ emitRaw: () => {
356
+ /* inert — inventory builds never dispatch a handler */
357
+ },
358
+ emitError: () => {
359
+ /* inert — inventory builds never dispatch a handler */
360
+ },
361
+ pluginLayouts: [],
362
+ toolScaffolds: [],
363
+ // eslint-disable-next-line unicorn/no-useless-undefined -- explicit no-store sentinel matching the `datastore` thunk contract (returns `unknown`; consumers cast to `DataStore | undefined`).
364
+ datastore: () => undefined,
365
+ };
366
+ /** Build the host subcommand-group name inventory (single source for completion). */
367
+ export function buildHostCommandInventory() {
368
+ const groupSubcommands = {};
369
+ for (const group of buildHostSubcommandGroups(INVENTORY_CTX)) {
370
+ groupSubcommands[group.name] = group.leaves.map((l) => l.name);
371
+ }
372
+ return { groupSubcommands };
373
+ }
374
+ //# sourceMappingURL=host-subcommand-groups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-subcommand-groups.js","sourceRoot":"","sources":["../../src/commands/host-subcommand-groups.ts"],"names":[],"mappings":"AAAA,2cAA2c;AAC3c;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,YAAY,EACZ,aAAa,GAKd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAQzD;wEACwE;AACxE,MAAM,aAAa,GAA4B,SAAS,CAAC;AAEzD,8EAA8E;AAC9E,MAAM,cAAc,GAA0B,gBAAgB,CAAC;AAE/D,MAAM,UAAU,GAA0B,YAAY,CAAC;AAEvD,2FAA2F;AAC3F,MAAM,UAAU,YAAY,CAAC,IAAuD;IAClF,OAAO,IAAI,CAAC,cAAc,EAAE,WAAW,IAAI,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;AACvE,CAAC;AAED,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E;AAE9E,SAAS,qBAAqB,CAAC,GAAuB;IACpD,OAAO,aAAa,CAA8B;QAChD,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,sBAAsB;QACnC,WAAW,EAAE,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,oBAAoB;gBACjC,OAAO,EAAE,CAAC,KAAK,E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AAuB;IACxC,WAAW,EAAE,GAAG,EAAE;QAChB,uDAAuD;IACzD,CAAC;IACD,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;IAC/B,QAAQ,EAAE,GAAG,EAAE;QACb,uDAAuD;IACzD,CAAC;IACD,OAAO,EAAE,GAAG,EAAE;QACZ,uDAAuD;IACzD,CAAC;IACD,SAAS,EAAE,GAAG,EAAE;QACd,uDAAuD;IACzD,CAAC;IACD,aAAa,EAAE,EAAE;IACjB,aAAa,EAAE,EAAE;IACjB,8LAA8L;IAC9L,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS;CAC3B,CAAC;AAoBF,qFAAqF;AACrF,MAAM,UAAU,yBAAyB;IACvC,MAAM,gBAAgB,GAAsC,EAAE,CAAC;IAC/D,KAAK,MAAM,KAAK,IAAI,yBAAyB,CAAC,aAAa,CAAC,EAAE,CAAC;QAC7D,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * commands — orchestrator for the CLI-owned (host) subcommands.
3
+ *
4
+ * Cross-tool housekeeping that doesn't belong to any single tool:
5
+ *
6
+ * - `init` — scaffold opensip-cli.config.yml + example tree
7
+ * - `report` — compose + open the cross-tool HTML report
8
+ * - `sessions` — `list` / `purge`
9
+ * - `configure` — set up the OpenSIP Cloud API key
10
+ * - `plugin` — `list` / `add` / `remove` / `sync`
11
+ * - `completion` — print a shell-completion script
12
+ * - `uninstall` — remove user-level / project-local state
13
+ *
14
+ * Launch Phase 6: every host command is now a declarative
15
+ * `CommandSpec` mounted through the SAME `mountCommandSpec` plane the tools
16
+ * use (`host-command-specs.ts`). The former per-command `register-*.ts`
17
+ * registrars (hand-rolled `.command().option().action()` bodies) are gone —
18
+ * host and tool commands share ONE mounting path, so the Phase 7
19
+ * `command-surface-parity` guardrail sees a single uniform surface with no
20
+ * two-tier privilege.
21
+ *
22
+ * Tool-owned subcommands (`fit`, `sim`, `graph`, …) are mounted separately by
23
+ * walking the CLI-managed tool registry (`mountToolCommands`), which mounts
24
+ * each tool's `commandSpecs` via the same `mountCommandSpec`.
25
+ */
26
+ import type { CliCommandsContext } from './shared.js';
27
+ import type { Command } from 'commander';
28
+ export type { CliCommandsContext } from './shared.js';
29
+ /**
30
+ * Mount the CLI-owned host commands onto the supplied Commander program.
31
+ * Pure function — no module-level side effects, no closure over globals — so
32
+ * tests can register commands against a fresh `Command` instance and inspect
33
+ * the resulting subcommand tree.
34
+ */
35
+ export declare function registerCliCommands(program: Command, ctx: CliCommandsContext): void;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,kBAAkB,GAAG,IAAI,CAEnF"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * commands — orchestrator for the CLI-owned (host) subcommands.
3
+ *
4
+ * Cross-tool housekeeping that doesn't belong to any single tool:
5
+ *
6
+ * - `init` — scaffold opensip-cli.config.yml + example tree
7
+ * - `report` — compose + open the cross-tool HTML report
8
+ * - `sessions` — `list` / `purge`
9
+ * - `configure` — set up the OpenSIP Cloud API key
10
+ * - `plugin` — `list` / `add` / `remove` / `sync`
11
+ * - `completion` — print a shell-completion script
12
+ * - `uninstall` — remove user-level / project-local state
13
+ *
14
+ * Launch Phase 6: every host command is now a declarative
15
+ * `CommandSpec` mounted through the SAME `mountCommandSpec` plane the tools
16
+ * use (`host-command-specs.ts`). The former per-command `register-*.ts`
17
+ * registrars (hand-rolled `.command().option().action()` bodies) are gone —
18
+ * host and tool commands share ONE mounting path, so the Phase 7
19
+ * `command-surface-parity` guardrail sees a single uniform surface with no
20
+ * two-tier privilege.
21
+ *
22
+ * Tool-owned subcommands (`fit`, `sim`, `graph`, …) are mounted separately by
23
+ * walking the CLI-managed tool registry (`mountToolCommands`), which mounts
24
+ * each tool's `commandSpecs` via the same `mountCommandSpec`.
25
+ */
26
+ import { mountHostCommands } from './host-command-specs.js';
27
+ /**
28
+ * Mount the CLI-owned host commands onto the supplied Commander program.
29
+ * Pure function — no module-level side effects, no closure over globals — so
30
+ * tests can register commands against a fresh `Command` instance and inspect
31
+ * the resulting subcommand tree.
32
+ */
33
+ export function registerCliCommands(program, ctx) {
34
+ mountHostCommands(program, ctx);
35
+ }
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAO5D;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAAE,GAAuB;IAC3E,iBAAiB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Host-owned document skeleton for the `opensip init` config.
3
+ *
4
+ * Owns ONLY the document-level bytes: the YAML header, `schemaVersion`,
5
+ * `globalExcludes`, and the per-language `targets:` blocks. Each tool's
6
+ * own config block (e.g. `fitness:`) is contributed by the tool via
7
+ * `Tool.scaffoldConfigBlock()` (ADR-0038 Decision 2) and appended here —
8
+ * the host never hard-codes a tool's namespace. The example check / recipe
9
+ * / scenario `.mjs` bytes and the pinned check-id universe likewise live in
10
+ * the owning tool's `scaffold/` (relocated out of this file in ADR-0038
11
+ * Phases 1–2).
12
+ */
13
+ import type { SupportedLanguage } from './language-detection.js';
14
+ import type { ToolScaffold } from '../shared.js';
15
+ export declare function generateConfig(languages: readonly SupportedLanguage[], toolScaffolds: readonly ToolScaffold[]): string;
16
+ //# sourceMappingURL=config-templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-templates.d.ts","sourceRoot":"","sources":["../../../src/commands/init/config-templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAiFjD,wBAAgB,cAAc,CAC5B,SAAS,EAAE,SAAS,iBAAiB,EAAE,EACvC,aAAa,EAAE,SAAS,YAAY,EAAE,GACrC,MAAM,CAkBR"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Host-owned document skeleton for the `opensip init` config.
3
+ *
4
+ * Owns ONLY the document-level bytes: the YAML header, `schemaVersion`,
5
+ * `globalExcludes`, and the per-language `targets:` blocks. Each tool's
6
+ * own config block (e.g. `fitness:`) is contributed by the tool via
7
+ * `Tool.scaffoldConfigBlock()` (ADR-0038 Decision 2) and appended here —
8
+ * the host never hard-codes a tool's namespace. The example check / recipe
9
+ * / scenario `.mjs` bytes and the pinned check-id universe likewise live in
10
+ * the owning tool's `scaffold/` (relocated out of this file in ADR-0038
11
+ * Phases 1–2).
12
+ */
13
+ import { renderDocumentHeader } from '@opensip-cli/config';
14
+ import { CLI_SUPPORTED_SCHEMA_VERSION } from '@opensip-cli/core';
15
+ function targetTemplate(lang) {
16
+ switch (lang) {
17
+ case 'typescript': {
18
+ return {
19
+ name: 'typescript-source',
20
+ description: 'TypeScript / TSX source code',
21
+ languages: ['typescript'],
22
+ include: [
23
+ 'src/**/*.ts',
24
+ 'src/**/*.tsx',
25
+ 'packages/*/src/**/*.ts',
26
+ 'packages/*/src/**/*.tsx',
27
+ ],
28
+ exclude: [
29
+ '**/*.test.ts',
30
+ '**/*.test.tsx',
31
+ '**/__tests__/**',
32
+ '**/node_modules/**',
33
+ '**/dist/**',
34
+ ],
35
+ };
36
+ }
37
+ case 'rust': {
38
+ return {
39
+ name: 'rust-source',
40
+ description: 'Rust source code',
41
+ languages: ['rust'],
42
+ include: ['src/**/*.rs', 'crates/**/*.rs', 'services/**/*.rs'],
43
+ exclude: ['**/target/**'],
44
+ };
45
+ }
46
+ case 'python': {
47
+ return {
48
+ name: 'python-source',
49
+ description: 'Python source code',
50
+ languages: ['python'],
51
+ include: ['src/**/*.py', '**/*.py'],
52
+ exclude: [
53
+ '**/__pycache__/**',
54
+ '**/.venv/**',
55
+ '**/venv/**',
56
+ '**/dist/**',
57
+ '**/build/**',
58
+ '**/*.egg-info/**',
59
+ ],
60
+ };
61
+ }
62
+ case 'go': {
63
+ return {
64
+ name: 'go-source',
65
+ description: 'Go source code',
66
+ languages: ['go'],
67
+ include: ['**/*.go'],
68
+ exclude: ['**/vendor/**', '**/_test.go'],
69
+ };
70
+ }
71
+ case 'java': {
72
+ return {
73
+ name: 'java-source',
74
+ description: 'Java source code',
75
+ languages: ['java'],
76
+ include: ['src/main/java/**/*.java', 'src/**/*.java'],
77
+ exclude: ['**/target/**', '**/build/**', '**/*Test.java'],
78
+ };
79
+ }
80
+ case 'cpp': {
81
+ return {
82
+ name: 'cpp-source',
83
+ description: 'C/C++ source code',
84
+ languages: ['cpp'],
85
+ include: ['src/**/*.{c,cpp,cc,h,hpp}', '**/*.{c,cpp,cc,h,hpp}'],
86
+ exclude: ['**/build/**', '**/cmake-build-*/**'],
87
+ };
88
+ }
89
+ }
90
+ }
91
+ export function generateConfig(languages, toolScaffolds) {
92
+ // The document-level skeleton (header, schemaVersion, globalExcludes, targets)
93
+ // is rendered by @opensip-cli/config — the package that also OWNS + validates
94
+ // those blocks (ADR-0023), so the scaffold cannot drift from what the
95
+ // composed schema accepts (asserted by a round-trip test). The CLI supplies the
96
+ // per-language target content; each registered tool contributes its own config
97
+ // block (ADR-0038 Decision 2 — fitness owns `fitness:`, sim contributes none).
98
+ const header = renderDocumentHeader({
99
+ schemaVersion: CLI_SUPPORTED_SCHEMA_VERSION,
100
+ targets: languages.map(targetTemplate),
101
+ });
102
+ const toolBlocks = toolScaffolds
103
+ .map((ts) => ts.scaffoldConfigBlock?.())
104
+ .filter((block) => block !== undefined)
105
+ .join('');
106
+ return `${header}\n${toolBlocks}`;
107
+ }
108
+ //# sourceMappingURL=config-templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-templates.js","sourceRoot":"","sources":["../../../src/commands/init/config-templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,oBAAoB,EAA4B,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AAOjE,SAAS,cAAc,CAAC,IAAuB;IAC7C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,YAAY,CAAC,CAAC,CAAC;YAClB,OAAO;gBACL,IAAI,EAAE,mBAAmB;gBACzB,WAAW,EAAE,8BAA8B;gBAC3C,SAAS,EAAE,CAAC,YAAY,CAAC;gBACzB,OAAO,EAAE;oBACP,aAAa;oBACb,cAAc;oBACd,wBAAwB;oBACxB,yBAAyB;iBAC1B;gBACD,OAAO,EAAE;oBACP,cAAc;oBACd,eAAe;oBACf,iBAAiB;oBACjB,oBAAoB;oBACpB,YAAY;iBACb;aACF,CAAC;QACJ,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,OAAO;gBACL,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,kBAAkB;gBAC/B,SAAS,EAAE,CAAC,MAAM,CAAC;gBACnB,OAAO,EAAE,CAAC,aAAa,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AM,UAAU,cAAc,CAC5B,SAAuC,EACvC,aAAsC;IAEtC,+EAA+E;IAC/E,8EAA8E;IAC9E,sEAAsE;IACtE,gFAAgF;IAChF,+EAA+E;IAC/E,+EAA+E;IAC/E,MAAM,MAAM,GAAG,oBAAoB,CAAC;QAClC,aAAa,EAAE,4BAA4B;QAC3C,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC;KACvC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,aAAa;SAC7B,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,mBAAmB,EAAE,EAAE,CAAC;SACvC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC;SACvD,IAAI,CAAC,EAAE,CAAC,CAAC;IAEZ,OAAO,GAAG,MAAM,KAAK,UAAU,EAAE,CAAC;AACpC,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Pre-existing file classification for `opensip init`.
3
+ *
4
+ * Walks `opensip-cli/` (skipping `.runtime/`) and tags each file as
5
+ * 'scaffolded', 'stale-scaffolded', or 'custom' so `--keep` / `--remove`
6
+ * can decide what to overwrite and what to preserve.
7
+ */
8
+ import type { SupportedLanguage } from './language-detection.js';
9
+ import type { ToolScaffold } from '../shared.js';
10
+ import type { PreExistingFile } from '@opensip-cli/contracts';
11
+ import type { ProjectPaths } from '@opensip-cli/core';
12
+ /**
13
+ * Walk every file under `opensip-cli/` (excluding `.runtime/`, which
14
+ * is gitignored runtime state and not user-authored) and tag each one.
15
+ *
16
+ * Classification rules:
17
+ *
18
+ * - 'scaffolded' — content matches a current-template byte-for-byte.
19
+ * - 'stale-scaffolded' — file shape matches a previous-language scaffold:
20
+ * filename `example-check-<lang>.mjs` for <lang>
21
+ * NOT in the current detection set, OR the file
22
+ * carries a pinned EXAMPLE_CHECK_IDS UUID for a
23
+ * language not in the current set.
24
+ * - 'custom' — anything else (user-authored).
25
+ *
26
+ * The walk is bounded to the `opensip-cli/` subtree (kilobytes in
27
+ * practice). The `.runtime/` subdir is skipped so caches/logs/sessions
28
+ * don't pollute the file list.
29
+ *
30
+ * Note on hash-based scaffolded detection: a scaffolded file that has
31
+ * been line-ending normalized (CRLF↔LF) or stripped of a trailing
32
+ * newline by an editor will not byte-for-byte match the template. In
33
+ * that case it falls back to 'custom' or 'stale-scaffolded' (when the
34
+ * UUID still matches but content drifted). The UUID-based fallback
35
+ * catches the common "stale language" case; cosmetic drift on a
36
+ * current-language file is treated as custom — which is the safer
37
+ * outcome (won't silently overwrite).
38
+ */
39
+ export declare function classifyFiles(paths: ProjectPaths, currentLanguages: readonly SupportedLanguage[], toolScaffolds: readonly ToolScaffold[]): PreExistingFile[];
40
+ //# sourceMappingURL=file-classifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-classifier.d.ts","sourceRoot":"","sources":["../../../src/commands/init/file-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA8BtD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,YAAY,EACnB,gBAAgB,EAAE,SAAS,iBAAiB,EAAE,EAC9C,aAAa,EAAE,SAAS,YAAY,EAAE,GACrC,eAAe,EAAE,CA0DnB"}