@opensip-cli/core 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 (604) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +31 -0
  4. package/dist/__tests__/config-resolution.test.d.ts +2 -0
  5. package/dist/__tests__/config-resolution.test.d.ts.map +1 -0
  6. package/dist/__tests__/config-resolution.test.js +94 -0
  7. package/dist/__tests__/config-resolution.test.js.map +1 -0
  8. package/dist/__tests__/public-api.test.d.ts +16 -0
  9. package/dist/__tests__/public-api.test.d.ts.map +1 -0
  10. package/dist/__tests__/public-api.test.js +209 -0
  11. package/dist/__tests__/public-api.test.js.map +1 -0
  12. package/dist/__tests__/signal-batch.test.d.ts +2 -0
  13. package/dist/__tests__/signal-batch.test.d.ts.map +1 -0
  14. package/dist/__tests__/signal-batch.test.js +39 -0
  15. package/dist/__tests__/signal-batch.test.js.map +1 -0
  16. package/dist/__tests__/signal-sink.test.d.ts +2 -0
  17. package/dist/__tests__/signal-sink.test.d.ts.map +1 -0
  18. package/dist/__tests__/signal-sink.test.js +25 -0
  19. package/dist/__tests__/signal-sink.test.js.map +1 -0
  20. package/dist/__tests__/strip-utils.test.d.ts +2 -0
  21. package/dist/__tests__/strip-utils.test.d.ts.map +1 -0
  22. package/dist/__tests__/strip-utils.test.js +397 -0
  23. package/dist/__tests__/strip-utils.test.js.map +1 -0
  24. package/dist/__tests__/text-tree.test.d.ts +2 -0
  25. package/dist/__tests__/text-tree.test.d.ts.map +1 -0
  26. package/dist/__tests__/text-tree.test.js +31 -0
  27. package/dist/__tests__/text-tree.test.js.map +1 -0
  28. package/dist/baseline/__tests__/fingerprint-strategy.test.d.ts +2 -0
  29. package/dist/baseline/__tests__/fingerprint-strategy.test.d.ts.map +1 -0
  30. package/dist/baseline/__tests__/fingerprint-strategy.test.js +69 -0
  31. package/dist/baseline/__tests__/fingerprint-strategy.test.js.map +1 -0
  32. package/dist/baseline/fingerprint-strategy.d.ts +70 -0
  33. package/dist/baseline/fingerprint-strategy.d.ts.map +1 -0
  34. package/dist/baseline/fingerprint-strategy.js +90 -0
  35. package/dist/baseline/fingerprint-strategy.js.map +1 -0
  36. package/dist/config-resolution.d.ts +27 -0
  37. package/dist/config-resolution.d.ts.map +1 -0
  38. package/dist/config-resolution.js +92 -0
  39. package/dist/config-resolution.js.map +1 -0
  40. package/dist/index.d.ts +81 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +165 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/languages/__tests__/content-filter-dispatch.test.d.ts +2 -0
  45. package/dist/languages/__tests__/content-filter-dispatch.test.d.ts.map +1 -0
  46. package/dist/languages/__tests__/content-filter-dispatch.test.js +87 -0
  47. package/dist/languages/__tests__/content-filter-dispatch.test.js.map +1 -0
  48. package/dist/languages/__tests__/non-code-formats.test.d.ts +2 -0
  49. package/dist/languages/__tests__/non-code-formats.test.d.ts.map +1 -0
  50. package/dist/languages/__tests__/non-code-formats.test.js +31 -0
  51. package/dist/languages/__tests__/non-code-formats.test.js.map +1 -0
  52. package/dist/languages/__tests__/parse-cache.test.d.ts +2 -0
  53. package/dist/languages/__tests__/parse-cache.test.d.ts.map +1 -0
  54. package/dist/languages/__tests__/parse-cache.test.js +228 -0
  55. package/dist/languages/__tests__/parse-cache.test.js.map +1 -0
  56. package/dist/languages/__tests__/registry.test.d.ts +2 -0
  57. package/dist/languages/__tests__/registry.test.d.ts.map +1 -0
  58. package/dist/languages/__tests__/registry.test.js +193 -0
  59. package/dist/languages/__tests__/registry.test.js.map +1 -0
  60. package/dist/languages/__tests__/workspace-unit-contract.test.d.ts +2 -0
  61. package/dist/languages/__tests__/workspace-unit-contract.test.d.ts.map +1 -0
  62. package/dist/languages/__tests__/workspace-unit-contract.test.js +66 -0
  63. package/dist/languages/__tests__/workspace-unit-contract.test.js.map +1 -0
  64. package/dist/languages/adapter.d.ts +66 -0
  65. package/dist/languages/adapter.d.ts.map +1 -0
  66. package/dist/languages/adapter.js +2 -0
  67. package/dist/languages/adapter.js.map +1 -0
  68. package/dist/languages/content-filter-dispatch.d.ts +36 -0
  69. package/dist/languages/content-filter-dispatch.d.ts.map +1 -0
  70. package/dist/languages/content-filter-dispatch.js +75 -0
  71. package/dist/languages/content-filter-dispatch.js.map +1 -0
  72. package/dist/languages/generic-types.d.ts +22 -0
  73. package/dist/languages/generic-types.d.ts.map +1 -0
  74. package/dist/languages/generic-types.js +3 -0
  75. package/dist/languages/generic-types.js.map +1 -0
  76. package/dist/languages/index.d.ts +12 -0
  77. package/dist/languages/index.d.ts.map +1 -0
  78. package/dist/languages/index.js +7 -0
  79. package/dist/languages/index.js.map +1 -0
  80. package/dist/languages/non-code-formats.d.ts +37 -0
  81. package/dist/languages/non-code-formats.d.ts.map +1 -0
  82. package/dist/languages/non-code-formats.js +45 -0
  83. package/dist/languages/non-code-formats.js.map +1 -0
  84. package/dist/languages/parse-cache-class.d.ts +69 -0
  85. package/dist/languages/parse-cache-class.d.ts.map +1 -0
  86. package/dist/languages/parse-cache-class.js +135 -0
  87. package/dist/languages/parse-cache-class.js.map +1 -0
  88. package/dist/languages/parse-cache.d.ts +54 -0
  89. package/dist/languages/parse-cache.d.ts.map +1 -0
  90. package/dist/languages/parse-cache.js +88 -0
  91. package/dist/languages/parse-cache.js.map +1 -0
  92. package/dist/languages/registry.d.ts +35 -0
  93. package/dist/languages/registry.d.ts.map +1 -0
  94. package/dist/languages/registry.js +123 -0
  95. package/dist/languages/registry.js.map +1 -0
  96. package/dist/languages/strip-scanners.d.ts +170 -0
  97. package/dist/languages/strip-scanners.d.ts.map +1 -0
  98. package/dist/languages/strip-scanners.js +233 -0
  99. package/dist/languages/strip-scanners.js.map +1 -0
  100. package/dist/languages/strip-utils.d.ts +66 -0
  101. package/dist/languages/strip-utils.d.ts.map +1 -0
  102. package/dist/languages/strip-utils.js +88 -0
  103. package/dist/languages/strip-utils.js.map +1 -0
  104. package/dist/languages/text-tree.d.ts +44 -0
  105. package/dist/languages/text-tree.d.ts.map +1 -0
  106. package/dist/languages/text-tree.js +34 -0
  107. package/dist/languages/text-tree.js.map +1 -0
  108. package/dist/languages/workspace-unit.d.ts +18 -0
  109. package/dist/languages/workspace-unit.d.ts.map +1 -0
  110. package/dist/languages/workspace-unit.js +2 -0
  111. package/dist/languages/workspace-unit.js.map +1 -0
  112. package/dist/lib/__tests__/config-version.test.d.ts +12 -0
  113. package/dist/lib/__tests__/config-version.test.d.ts.map +1 -0
  114. package/dist/lib/__tests__/config-version.test.js +92 -0
  115. package/dist/lib/__tests__/config-version.test.js.map +1 -0
  116. package/dist/lib/__tests__/diagnostics-bus.test.d.ts +7 -0
  117. package/dist/lib/__tests__/diagnostics-bus.test.d.ts.map +1 -0
  118. package/dist/lib/__tests__/diagnostics-bus.test.js +44 -0
  119. package/dist/lib/__tests__/diagnostics-bus.test.js.map +1 -0
  120. package/dist/lib/__tests__/env-registry.test.d.ts +7 -0
  121. package/dist/lib/__tests__/env-registry.test.d.ts.map +1 -0
  122. package/dist/lib/__tests__/env-registry.test.js +82 -0
  123. package/dist/lib/__tests__/env-registry.test.js.map +1 -0
  124. package/dist/lib/__tests__/errors.test.d.ts +2 -0
  125. package/dist/lib/__tests__/errors.test.d.ts.map +1 -0
  126. package/dist/lib/__tests__/errors.test.js +218 -0
  127. package/dist/lib/__tests__/errors.test.js.map +1 -0
  128. package/dist/lib/__tests__/format.test.d.ts +2 -0
  129. package/dist/lib/__tests__/format.test.d.ts.map +1 -0
  130. package/dist/lib/__tests__/format.test.js +23 -0
  131. package/dist/lib/__tests__/format.test.js.map +1 -0
  132. package/dist/lib/__tests__/ids.test.d.ts +2 -0
  133. package/dist/lib/__tests__/ids.test.d.ts.map +1 -0
  134. package/dist/lib/__tests__/ids.test.js +80 -0
  135. package/dist/lib/__tests__/ids.test.js.map +1 -0
  136. package/dist/lib/__tests__/logger.test.d.ts +2 -0
  137. package/dist/lib/__tests__/logger.test.d.ts.map +1 -0
  138. package/dist/lib/__tests__/logger.test.js +284 -0
  139. package/dist/lib/__tests__/logger.test.js.map +1 -0
  140. package/dist/lib/__tests__/package-version.test.d.ts +2 -0
  141. package/dist/lib/__tests__/package-version.test.d.ts.map +1 -0
  142. package/dist/lib/__tests__/package-version.test.js +47 -0
  143. package/dist/lib/__tests__/package-version.test.js.map +1 -0
  144. package/dist/lib/__tests__/paths.test.d.ts +5 -0
  145. package/dist/lib/__tests__/paths.test.d.ts.map +1 -0
  146. package/dist/lib/__tests__/paths.test.js +59 -0
  147. package/dist/lib/__tests__/paths.test.js.map +1 -0
  148. package/dist/lib/__tests__/payload-version.test.d.ts +2 -0
  149. package/dist/lib/__tests__/payload-version.test.d.ts.map +1 -0
  150. package/dist/lib/__tests__/payload-version.test.js +35 -0
  151. package/dist/lib/__tests__/payload-version.test.js.map +1 -0
  152. package/dist/lib/__tests__/phantom-detect.test.d.ts +10 -0
  153. package/dist/lib/__tests__/phantom-detect.test.d.ts.map +1 -0
  154. package/dist/lib/__tests__/phantom-detect.test.js +84 -0
  155. package/dist/lib/__tests__/phantom-detect.test.js.map +1 -0
  156. package/dist/lib/__tests__/project-context.test.d.ts +10 -0
  157. package/dist/lib/__tests__/project-context.test.d.ts.map +1 -0
  158. package/dist/lib/__tests__/project-context.test.js +240 -0
  159. package/dist/lib/__tests__/project-context.test.js.map +1 -0
  160. package/dist/lib/__tests__/registry.test.d.ts +2 -0
  161. package/dist/lib/__tests__/registry.test.d.ts.map +1 -0
  162. package/dist/lib/__tests__/registry.test.js +333 -0
  163. package/dist/lib/__tests__/registry.test.js.map +1 -0
  164. package/dist/lib/__tests__/retry.test.d.ts +2 -0
  165. package/dist/lib/__tests__/retry.test.d.ts.map +1 -0
  166. package/dist/lib/__tests__/retry.test.js +71 -0
  167. package/dist/lib/__tests__/retry.test.js.map +1 -0
  168. package/dist/lib/__tests__/run-diagnostics.test.d.ts +9 -0
  169. package/dist/lib/__tests__/run-diagnostics.test.d.ts.map +1 -0
  170. package/dist/lib/__tests__/run-diagnostics.test.js +61 -0
  171. package/dist/lib/__tests__/run-diagnostics.test.js.map +1 -0
  172. package/dist/lib/__tests__/run-scope.test.d.ts +2 -0
  173. package/dist/lib/__tests__/run-scope.test.d.ts.map +1 -0
  174. package/dist/lib/__tests__/run-scope.test.js +202 -0
  175. package/dist/lib/__tests__/run-scope.test.js.map +1 -0
  176. package/dist/lib/__tests__/run-timer.test.d.ts +2 -0
  177. package/dist/lib/__tests__/run-timer.test.d.ts.map +1 -0
  178. package/dist/lib/__tests__/run-timer.test.js +152 -0
  179. package/dist/lib/__tests__/run-timer.test.js.map +1 -0
  180. package/dist/lib/__tests__/severity-policy.test.d.ts +6 -0
  181. package/dist/lib/__tests__/severity-policy.test.d.ts.map +1 -0
  182. package/dist/lib/__tests__/severity-policy.test.js +47 -0
  183. package/dist/lib/__tests__/severity-policy.test.js.map +1 -0
  184. package/dist/lib/__tests__/telemetry.test.d.ts +2 -0
  185. package/dist/lib/__tests__/telemetry.test.d.ts.map +1 -0
  186. package/dist/lib/__tests__/telemetry.test.js +212 -0
  187. package/dist/lib/__tests__/telemetry.test.js.map +1 -0
  188. package/dist/lib/__tests__/verdict-policy.test.d.ts +7 -0
  189. package/dist/lib/__tests__/verdict-policy.test.d.ts.map +1 -0
  190. package/dist/lib/__tests__/verdict-policy.test.js +91 -0
  191. package/dist/lib/__tests__/verdict-policy.test.js.map +1 -0
  192. package/dist/lib/__tests__/yaml.test.d.ts +6 -0
  193. package/dist/lib/__tests__/yaml.test.d.ts.map +1 -0
  194. package/dist/lib/__tests__/yaml.test.js +79 -0
  195. package/dist/lib/__tests__/yaml.test.js.map +1 -0
  196. package/dist/lib/config-version.d.ts +49 -0
  197. package/dist/lib/config-version.d.ts.map +1 -0
  198. package/dist/lib/config-version.js +56 -0
  199. package/dist/lib/config-version.js.map +1 -0
  200. package/dist/lib/diagnostics-bus.d.ts +48 -0
  201. package/dist/lib/diagnostics-bus.d.ts.map +1 -0
  202. package/dist/lib/diagnostics-bus.js +74 -0
  203. package/dist/lib/diagnostics-bus.js.map +1 -0
  204. package/dist/lib/env-registry.d.ts +108 -0
  205. package/dist/lib/env-registry.d.ts.map +1 -0
  206. package/dist/lib/env-registry.js +92 -0
  207. package/dist/lib/env-registry.js.map +1 -0
  208. package/dist/lib/errors.d.ts +132 -0
  209. package/dist/lib/errors.d.ts.map +1 -0
  210. package/dist/lib/errors.js +160 -0
  211. package/dist/lib/errors.js.map +1 -0
  212. package/dist/lib/execution/__tests__/execution.test.d.ts +7 -0
  213. package/dist/lib/execution/__tests__/execution.test.d.ts.map +1 -0
  214. package/dist/lib/execution/__tests__/execution.test.js +254 -0
  215. package/dist/lib/execution/__tests__/execution.test.js.map +1 -0
  216. package/dist/lib/execution/index.d.ts +15 -0
  217. package/dist/lib/execution/index.d.ts.map +1 -0
  218. package/dist/lib/execution/index.js +10 -0
  219. package/dist/lib/execution/index.js.map +1 -0
  220. package/dist/lib/execution/options.d.ts +32 -0
  221. package/dist/lib/execution/options.d.ts.map +1 -0
  222. package/dist/lib/execution/options.js +15 -0
  223. package/dist/lib/execution/options.js.map +1 -0
  224. package/dist/lib/execution/pipeline.d.ts +36 -0
  225. package/dist/lib/execution/pipeline.d.ts.map +1 -0
  226. package/dist/lib/execution/pipeline.js +38 -0
  227. package/dist/lib/execution/pipeline.js.map +1 -0
  228. package/dist/lib/execution/retry.d.ts +38 -0
  229. package/dist/lib/execution/retry.d.ts.map +1 -0
  230. package/dist/lib/execution/retry.js +56 -0
  231. package/dist/lib/execution/retry.js.map +1 -0
  232. package/dist/lib/execution/run-with-timeout.d.ts +46 -0
  233. package/dist/lib/execution/run-with-timeout.d.ts.map +1 -0
  234. package/dist/lib/execution/run-with-timeout.js +86 -0
  235. package/dist/lib/execution/run-with-timeout.js.map +1 -0
  236. package/dist/lib/execution/schedule.d.ts +62 -0
  237. package/dist/lib/execution/schedule.d.ts.map +1 -0
  238. package/dist/lib/execution/schedule.js +130 -0
  239. package/dist/lib/execution/schedule.js.map +1 -0
  240. package/dist/lib/format.d.ts +17 -0
  241. package/dist/lib/format.d.ts.map +1 -0
  242. package/dist/lib/format.js +26 -0
  243. package/dist/lib/format.js.map +1 -0
  244. package/dist/lib/ids.d.ts +13 -0
  245. package/dist/lib/ids.d.ts.map +1 -0
  246. package/dist/lib/ids.js +48 -0
  247. package/dist/lib/ids.js.map +1 -0
  248. package/dist/lib/logger.d.ts +166 -0
  249. package/dist/lib/logger.d.ts.map +1 -0
  250. package/dist/lib/logger.js +283 -0
  251. package/dist/lib/logger.js.map +1 -0
  252. package/dist/lib/package-version.d.ts +17 -0
  253. package/dist/lib/package-version.d.ts.map +1 -0
  254. package/dist/lib/package-version.js +52 -0
  255. package/dist/lib/package-version.js.map +1 -0
  256. package/dist/lib/paths.d.ts +139 -0
  257. package/dist/lib/paths.d.ts.map +1 -0
  258. package/dist/lib/paths.js +105 -0
  259. package/dist/lib/paths.js.map +1 -0
  260. package/dist/lib/payload-version.d.ts +15 -0
  261. package/dist/lib/payload-version.d.ts.map +1 -0
  262. package/dist/lib/payload-version.js +24 -0
  263. package/dist/lib/payload-version.js.map +1 -0
  264. package/dist/lib/phantom-detect.d.ts +21 -0
  265. package/dist/lib/phantom-detect.d.ts.map +1 -0
  266. package/dist/lib/phantom-detect.js +76 -0
  267. package/dist/lib/phantom-detect.js.map +1 -0
  268. package/dist/lib/project-context.d.ts +66 -0
  269. package/dist/lib/project-context.d.ts.map +1 -0
  270. package/dist/lib/project-context.js +112 -0
  271. package/dist/lib/project-context.js.map +1 -0
  272. package/dist/lib/recipe-id.d.ts +13 -0
  273. package/dist/lib/recipe-id.d.ts.map +1 -0
  274. package/dist/lib/recipe-id.js +15 -0
  275. package/dist/lib/recipe-id.js.map +1 -0
  276. package/dist/lib/registry.d.ts +98 -0
  277. package/dist/lib/registry.d.ts.map +1 -0
  278. package/dist/lib/registry.js +152 -0
  279. package/dist/lib/registry.js.map +1 -0
  280. package/dist/lib/retry.d.ts +26 -0
  281. package/dist/lib/retry.d.ts.map +1 -0
  282. package/dist/lib/retry.js +48 -0
  283. package/dist/lib/retry.js.map +1 -0
  284. package/dist/lib/run-diagnostics.d.ts +64 -0
  285. package/dist/lib/run-diagnostics.d.ts.map +1 -0
  286. package/dist/lib/run-diagnostics.js +25 -0
  287. package/dist/lib/run-diagnostics.js.map +1 -0
  288. package/dist/lib/run-scope.d.ts +167 -0
  289. package/dist/lib/run-scope.d.ts.map +1 -0
  290. package/dist/lib/run-scope.js +176 -0
  291. package/dist/lib/run-scope.js.map +1 -0
  292. package/dist/lib/run-timer.d.ts +82 -0
  293. package/dist/lib/run-timer.d.ts.map +1 -0
  294. package/dist/lib/run-timer.js +79 -0
  295. package/dist/lib/run-timer.js.map +1 -0
  296. package/dist/lib/scope-types.d.ts +172 -0
  297. package/dist/lib/scope-types.d.ts.map +1 -0
  298. package/dist/lib/scope-types.js +27 -0
  299. package/dist/lib/scope-types.js.map +1 -0
  300. package/dist/lib/severity-policy.d.ts +38 -0
  301. package/dist/lib/severity-policy.d.ts.map +1 -0
  302. package/dist/lib/severity-policy.js +44 -0
  303. package/dist/lib/severity-policy.js.map +1 -0
  304. package/dist/lib/telemetry.d.ts +93 -0
  305. package/dist/lib/telemetry.d.ts.map +1 -0
  306. package/dist/lib/telemetry.js +144 -0
  307. package/dist/lib/telemetry.js.map +1 -0
  308. package/dist/lib/ui-context.d.ts +34 -0
  309. package/dist/lib/ui-context.d.ts.map +1 -0
  310. package/dist/lib/ui-context.js +16 -0
  311. package/dist/lib/ui-context.js.map +1 -0
  312. package/dist/lib/verdict-policy.d.ts +71 -0
  313. package/dist/lib/verdict-policy.d.ts.map +1 -0
  314. package/dist/lib/verdict-policy.js +82 -0
  315. package/dist/lib/verdict-policy.js.map +1 -0
  316. package/dist/lib/yaml.d.ts +74 -0
  317. package/dist/lib/yaml.d.ts.map +1 -0
  318. package/dist/lib/yaml.js +118 -0
  319. package/dist/lib/yaml.js.map +1 -0
  320. package/dist/plugins/__tests__/as-if-external.test.d.ts +18 -0
  321. package/dist/plugins/__tests__/as-if-external.test.d.ts.map +1 -0
  322. package/dist/plugins/__tests__/as-if-external.test.js +159 -0
  323. package/dist/plugins/__tests__/as-if-external.test.js.map +1 -0
  324. package/dist/plugins/__tests__/authored-tool-discovery.test.d.ts +8 -0
  325. package/dist/plugins/__tests__/authored-tool-discovery.test.d.ts.map +1 -0
  326. package/dist/plugins/__tests__/authored-tool-discovery.test.js +97 -0
  327. package/dist/plugins/__tests__/authored-tool-discovery.test.js.map +1 -0
  328. package/dist/plugins/__tests__/capability-discovery.test.d.ts +2 -0
  329. package/dist/plugins/__tests__/capability-discovery.test.d.ts.map +1 -0
  330. package/dist/plugins/__tests__/capability-discovery.test.js +349 -0
  331. package/dist/plugins/__tests__/capability-discovery.test.js.map +1 -0
  332. package/dist/plugins/__tests__/capability-from-manifest.test.d.ts +2 -0
  333. package/dist/plugins/__tests__/capability-from-manifest.test.d.ts.map +1 -0
  334. package/dist/plugins/__tests__/capability-from-manifest.test.js +172 -0
  335. package/dist/plugins/__tests__/capability-from-manifest.test.js.map +1 -0
  336. package/dist/plugins/__tests__/capability-loader.test.d.ts +2 -0
  337. package/dist/plugins/__tests__/capability-loader.test.d.ts.map +1 -0
  338. package/dist/plugins/__tests__/capability-loader.test.js +122 -0
  339. package/dist/plugins/__tests__/capability-loader.test.js.map +1 -0
  340. package/dist/plugins/__tests__/capability-registry.test.d.ts +2 -0
  341. package/dist/plugins/__tests__/capability-registry.test.d.ts.map +1 -0
  342. package/dist/plugins/__tests__/capability-registry.test.js +185 -0
  343. package/dist/plugins/__tests__/capability-registry.test.js.map +1 -0
  344. package/dist/plugins/__tests__/discover.test.d.ts +2 -0
  345. package/dist/plugins/__tests__/discover.test.d.ts.map +1 -0
  346. package/dist/plugins/__tests__/discover.test.js +311 -0
  347. package/dist/plugins/__tests__/discover.test.js.map +1 -0
  348. package/dist/plugins/__tests__/loader.test.d.ts +2 -0
  349. package/dist/plugins/__tests__/loader.test.d.ts.map +1 -0
  350. package/dist/plugins/__tests__/loader.test.js +191 -0
  351. package/dist/plugins/__tests__/loader.test.js.map +1 -0
  352. package/dist/plugins/__tests__/manifest-discovery.test.d.ts +2 -0
  353. package/dist/plugins/__tests__/manifest-discovery.test.d.ts.map +1 -0
  354. package/dist/plugins/__tests__/manifest-discovery.test.js +132 -0
  355. package/dist/plugins/__tests__/manifest-discovery.test.js.map +1 -0
  356. package/dist/plugins/__tests__/manifest-loader.test.d.ts +2 -0
  357. package/dist/plugins/__tests__/manifest-loader.test.d.ts.map +1 -0
  358. package/dist/plugins/__tests__/manifest-loader.test.js +434 -0
  359. package/dist/plugins/__tests__/manifest-loader.test.js.map +1 -0
  360. package/dist/plugins/__tests__/marker-discovery.test.d.ts +2 -0
  361. package/dist/plugins/__tests__/marker-discovery.test.d.ts.map +1 -0
  362. package/dist/plugins/__tests__/marker-discovery.test.js +164 -0
  363. package/dist/plugins/__tests__/marker-discovery.test.js.map +1 -0
  364. package/dist/plugins/__tests__/node-modules-walk.test.d.ts +2 -0
  365. package/dist/plugins/__tests__/node-modules-walk.test.d.ts.map +1 -0
  366. package/dist/plugins/__tests__/node-modules-walk.test.js +76 -0
  367. package/dist/plugins/__tests__/node-modules-walk.test.js.map +1 -0
  368. package/dist/plugins/__tests__/package-entry.test.d.ts +9 -0
  369. package/dist/plugins/__tests__/package-entry.test.d.ts.map +1 -0
  370. package/dist/plugins/__tests__/package-entry.test.js +117 -0
  371. package/dist/plugins/__tests__/package-entry.test.js.map +1 -0
  372. package/dist/plugins/__tests__/recipe-loader.test.d.ts +2 -0
  373. package/dist/plugins/__tests__/recipe-loader.test.d.ts.map +1 -0
  374. package/dist/plugins/__tests__/recipe-loader.test.js +130 -0
  375. package/dist/plugins/__tests__/recipe-loader.test.js.map +1 -0
  376. package/dist/plugins/__tests__/scope-validation.test.d.ts +2 -0
  377. package/dist/plugins/__tests__/scope-validation.test.d.ts.map +1 -0
  378. package/dist/plugins/__tests__/scope-validation.test.js +68 -0
  379. package/dist/plugins/__tests__/scope-validation.test.js.map +1 -0
  380. package/dist/plugins/__tests__/single-core-guard.test.d.ts +10 -0
  381. package/dist/plugins/__tests__/single-core-guard.test.d.ts.map +1 -0
  382. package/dist/plugins/__tests__/single-core-guard.test.js +89 -0
  383. package/dist/plugins/__tests__/single-core-guard.test.js.map +1 -0
  384. package/dist/plugins/__tests__/tool-package-discovery.test.d.ts +2 -0
  385. package/dist/plugins/__tests__/tool-package-discovery.test.d.ts.map +1 -0
  386. package/dist/plugins/__tests__/tool-package-discovery.test.js +215 -0
  387. package/dist/plugins/__tests__/tool-package-discovery.test.js.map +1 -0
  388. package/dist/plugins/authored-tool-discovery.d.ts +45 -0
  389. package/dist/plugins/authored-tool-discovery.d.ts.map +1 -0
  390. package/dist/plugins/authored-tool-discovery.js +61 -0
  391. package/dist/plugins/authored-tool-discovery.js.map +1 -0
  392. package/dist/plugins/capability-discovery.d.ts +80 -0
  393. package/dist/plugins/capability-discovery.d.ts.map +1 -0
  394. package/dist/plugins/capability-discovery.js +278 -0
  395. package/dist/plugins/capability-discovery.js.map +1 -0
  396. package/dist/plugins/capability-loader.d.ts +50 -0
  397. package/dist/plugins/capability-loader.d.ts.map +1 -0
  398. package/dist/plugins/capability-loader.js +85 -0
  399. package/dist/plugins/capability-loader.js.map +1 -0
  400. package/dist/plugins/capability-registry.d.ts +169 -0
  401. package/dist/plugins/capability-registry.d.ts.map +1 -0
  402. package/dist/plugins/capability-registry.js +319 -0
  403. package/dist/plugins/capability-registry.js.map +1 -0
  404. package/dist/plugins/discover.d.ts +64 -0
  405. package/dist/plugins/discover.d.ts.map +1 -0
  406. package/dist/plugins/discover.js +303 -0
  407. package/dist/plugins/discover.js.map +1 -0
  408. package/dist/plugins/index.d.ts +37 -0
  409. package/dist/plugins/index.d.ts.map +1 -0
  410. package/dist/plugins/index.js +40 -0
  411. package/dist/plugins/index.js.map +1 -0
  412. package/dist/plugins/json-guards.d.ts +11 -0
  413. package/dist/plugins/json-guards.d.ts.map +1 -0
  414. package/dist/plugins/json-guards.js +15 -0
  415. package/dist/plugins/json-guards.js.map +1 -0
  416. package/dist/plugins/loader.d.ts +67 -0
  417. package/dist/plugins/loader.d.ts.map +1 -0
  418. package/dist/plugins/loader.js +137 -0
  419. package/dist/plugins/loader.js.map +1 -0
  420. package/dist/plugins/manifest-discovery.d.ts +28 -0
  421. package/dist/plugins/manifest-discovery.d.ts.map +1 -0
  422. package/dist/plugins/manifest-discovery.js +103 -0
  423. package/dist/plugins/manifest-discovery.js.map +1 -0
  424. package/dist/plugins/manifest-loader.d.ts +120 -0
  425. package/dist/plugins/manifest-loader.d.ts.map +1 -0
  426. package/dist/plugins/manifest-loader.js +410 -0
  427. package/dist/plugins/manifest-loader.js.map +1 -0
  428. package/dist/plugins/marker-discovery.d.ts +115 -0
  429. package/dist/plugins/marker-discovery.d.ts.map +1 -0
  430. package/dist/plugins/marker-discovery.js +172 -0
  431. package/dist/plugins/marker-discovery.js.map +1 -0
  432. package/dist/plugins/node-modules-walk.d.ts +61 -0
  433. package/dist/plugins/node-modules-walk.d.ts.map +1 -0
  434. package/dist/plugins/node-modules-walk.js +99 -0
  435. package/dist/plugins/node-modules-walk.js.map +1 -0
  436. package/dist/plugins/package-entry.d.ts +38 -0
  437. package/dist/plugins/package-entry.d.ts.map +1 -0
  438. package/dist/plugins/package-entry.js +86 -0
  439. package/dist/plugins/package-entry.js.map +1 -0
  440. package/dist/plugins/recipe-loader.d.ts +63 -0
  441. package/dist/plugins/recipe-loader.d.ts.map +1 -0
  442. package/dist/plugins/recipe-loader.js +67 -0
  443. package/dist/plugins/recipe-loader.js.map +1 -0
  444. package/dist/plugins/scope-validation.d.ts +35 -0
  445. package/dist/plugins/scope-validation.d.ts.map +1 -0
  446. package/dist/plugins/scope-validation.js +55 -0
  447. package/dist/plugins/scope-validation.js.map +1 -0
  448. package/dist/plugins/single-core-guard.d.ts +28 -0
  449. package/dist/plugins/single-core-guard.d.ts.map +1 -0
  450. package/dist/plugins/single-core-guard.js +69 -0
  451. package/dist/plugins/single-core-guard.js.map +1 -0
  452. package/dist/plugins/tool-package-discovery.d.ts +93 -0
  453. package/dist/plugins/tool-package-discovery.d.ts.map +1 -0
  454. package/dist/plugins/tool-package-discovery.js +118 -0
  455. package/dist/plugins/tool-package-discovery.js.map +1 -0
  456. package/dist/plugins/types.d.ts +78 -0
  457. package/dist/plugins/types.d.ts.map +1 -0
  458. package/dist/plugins/types.js +15 -0
  459. package/dist/plugins/types.js.map +1 -0
  460. package/dist/recipes/__tests__/registry.test.d.ts +2 -0
  461. package/dist/recipes/__tests__/registry.test.d.ts.map +1 -0
  462. package/dist/recipes/__tests__/registry.test.js +170 -0
  463. package/dist/recipes/__tests__/registry.test.js.map +1 -0
  464. package/dist/recipes/__tests__/selector.test.d.ts +20 -0
  465. package/dist/recipes/__tests__/selector.test.d.ts.map +1 -0
  466. package/dist/recipes/__tests__/selector.test.js +173 -0
  467. package/dist/recipes/__tests__/selector.test.js.map +1 -0
  468. package/dist/recipes/__tests__/unit-config.test.d.ts +7 -0
  469. package/dist/recipes/__tests__/unit-config.test.d.ts.map +1 -0
  470. package/dist/recipes/__tests__/unit-config.test.js +52 -0
  471. package/dist/recipes/__tests__/unit-config.test.js.map +1 -0
  472. package/dist/recipes/registry.d.ts +105 -0
  473. package/dist/recipes/registry.d.ts.map +1 -0
  474. package/dist/recipes/registry.js +141 -0
  475. package/dist/recipes/registry.js.map +1 -0
  476. package/dist/recipes/selector.d.ts +112 -0
  477. package/dist/recipes/selector.d.ts.map +1 -0
  478. package/dist/recipes/selector.js +134 -0
  479. package/dist/recipes/selector.js.map +1 -0
  480. package/dist/recipes/unit-config.d.ts +63 -0
  481. package/dist/recipes/unit-config.d.ts.map +1 -0
  482. package/dist/recipes/unit-config.js +68 -0
  483. package/dist/recipes/unit-config.js.map +1 -0
  484. package/dist/runtime/__tests__/in-process-transport.test.d.ts +6 -0
  485. package/dist/runtime/__tests__/in-process-transport.test.d.ts.map +1 -0
  486. package/dist/runtime/__tests__/in-process-transport.test.js +73 -0
  487. package/dist/runtime/__tests__/in-process-transport.test.js.map +1 -0
  488. package/dist/runtime/__tests__/subprocess-transport.test.d.ts +11 -0
  489. package/dist/runtime/__tests__/subprocess-transport.test.d.ts.map +1 -0
  490. package/dist/runtime/__tests__/subprocess-transport.test.js +118 -0
  491. package/dist/runtime/__tests__/subprocess-transport.test.js.map +1 -0
  492. package/dist/runtime/in-process-transport.d.ts +20 -0
  493. package/dist/runtime/in-process-transport.d.ts.map +1 -0
  494. package/dist/runtime/in-process-transport.js +49 -0
  495. package/dist/runtime/in-process-transport.js.map +1 -0
  496. package/dist/runtime/progress-transport.d.ts +73 -0
  497. package/dist/runtime/progress-transport.d.ts.map +1 -0
  498. package/dist/runtime/progress-transport.js +17 -0
  499. package/dist/runtime/progress-transport.js.map +1 -0
  500. package/dist/runtime/subprocess-transport.d.ts +43 -0
  501. package/dist/runtime/subprocess-transport.d.ts.map +1 -0
  502. package/dist/runtime/subprocess-transport.js +134 -0
  503. package/dist/runtime/subprocess-transport.js.map +1 -0
  504. package/dist/signals/comment-openers.d.ts +29 -0
  505. package/dist/signals/comment-openers.d.ts.map +1 -0
  506. package/dist/signals/comment-openers.js +41 -0
  507. package/dist/signals/comment-openers.js.map +1 -0
  508. package/dist/signals/comment-openers.test.d.ts +7 -0
  509. package/dist/signals/comment-openers.test.d.ts.map +1 -0
  510. package/dist/signals/comment-openers.test.js +41 -0
  511. package/dist/signals/comment-openers.test.js.map +1 -0
  512. package/dist/signals/create-signal-from-violation.d.ts +29 -0
  513. package/dist/signals/create-signal-from-violation.d.ts.map +1 -0
  514. package/dist/signals/create-signal-from-violation.js +29 -0
  515. package/dist/signals/create-signal-from-violation.js.map +1 -0
  516. package/dist/signals/signal-sink.d.ts +49 -0
  517. package/dist/signals/signal-sink.d.ts.map +1 -0
  518. package/dist/signals/signal-sink.js +6 -0
  519. package/dist/signals/signal-sink.js.map +1 -0
  520. package/dist/signals/suppress.d.ts +102 -0
  521. package/dist/signals/suppress.d.ts.map +1 -0
  522. package/dist/signals/suppress.js +325 -0
  523. package/dist/signals/suppress.js.map +1 -0
  524. package/dist/signals/suppress.test.d.ts +2 -0
  525. package/dist/signals/suppress.test.d.ts.map +1 -0
  526. package/dist/signals/suppress.test.js +213 -0
  527. package/dist/signals/suppress.test.js.map +1 -0
  528. package/dist/tools/__tests__/command-spec.test.d.ts +2 -0
  529. package/dist/tools/__tests__/command-spec.test.d.ts.map +1 -0
  530. package/dist/tools/__tests__/command-spec.test.js +191 -0
  531. package/dist/tools/__tests__/command-spec.test.js.map +1 -0
  532. package/dist/tools/__tests__/compatibility.test.d.ts +5 -0
  533. package/dist/tools/__tests__/compatibility.test.d.ts.map +1 -0
  534. package/dist/tools/__tests__/compatibility.test.js +41 -0
  535. package/dist/tools/__tests__/compatibility.test.js.map +1 -0
  536. package/dist/tools/__tests__/ids.test.d.ts +5 -0
  537. package/dist/tools/__tests__/ids.test.d.ts.map +1 -0
  538. package/dist/tools/__tests__/ids.test.js +56 -0
  539. package/dist/tools/__tests__/ids.test.js.map +1 -0
  540. package/dist/tools/__tests__/manifest-assert.test.d.ts +5 -0
  541. package/dist/tools/__tests__/manifest-assert.test.d.ts.map +1 -0
  542. package/dist/tools/__tests__/manifest-assert.test.js +66 -0
  543. package/dist/tools/__tests__/manifest-assert.test.js.map +1 -0
  544. package/dist/tools/__tests__/registry.test.d.ts +2 -0
  545. package/dist/tools/__tests__/registry.test.d.ts.map +1 -0
  546. package/dist/tools/__tests__/registry.test.js +93 -0
  547. package/dist/tools/__tests__/registry.test.js.map +1 -0
  548. package/dist/tools/__tests__/types.test.d.ts +2 -0
  549. package/dist/tools/__tests__/types.test.d.ts.map +1 -0
  550. package/dist/tools/__tests__/types.test.js +51 -0
  551. package/dist/tools/__tests__/types.test.js.map +1 -0
  552. package/dist/tools/capability.d.ts +257 -0
  553. package/dist/tools/capability.d.ts.map +1 -0
  554. package/dist/tools/capability.js +46 -0
  555. package/dist/tools/capability.js.map +1 -0
  556. package/dist/tools/command-spec.d.ts +211 -0
  557. package/dist/tools/command-spec.d.ts.map +1 -0
  558. package/dist/tools/command-spec.js +110 -0
  559. package/dist/tools/command-spec.js.map +1 -0
  560. package/dist/tools/compatibility.d.ts +45 -0
  561. package/dist/tools/compatibility.d.ts.map +1 -0
  562. package/dist/tools/compatibility.js +49 -0
  563. package/dist/tools/compatibility.js.map +1 -0
  564. package/dist/tools/ids.d.ts +61 -0
  565. package/dist/tools/ids.d.ts.map +1 -0
  566. package/dist/tools/ids.js +61 -0
  567. package/dist/tools/ids.js.map +1 -0
  568. package/dist/tools/index.d.ts +22 -0
  569. package/dist/tools/index.d.ts.map +1 -0
  570. package/dist/tools/index.js +28 -0
  571. package/dist/tools/index.js.map +1 -0
  572. package/dist/tools/manifest-assert.d.ts +35 -0
  573. package/dist/tools/manifest-assert.d.ts.map +1 -0
  574. package/dist/tools/manifest-assert.js +67 -0
  575. package/dist/tools/manifest-assert.js.map +1 -0
  576. package/dist/tools/manifest.d.ts +178 -0
  577. package/dist/tools/manifest.d.ts.map +1 -0
  578. package/dist/tools/manifest.js +35 -0
  579. package/dist/tools/manifest.js.map +1 -0
  580. package/dist/tools/registry.d.ts +37 -0
  581. package/dist/tools/registry.d.ts.map +1 -0
  582. package/dist/tools/registry.js +49 -0
  583. package/dist/tools/registry.js.map +1 -0
  584. package/dist/tools/types.d.ts +1021 -0
  585. package/dist/tools/types.d.ts.map +1 -0
  586. package/dist/tools/types.js +77 -0
  587. package/dist/tools/types.js.map +1 -0
  588. package/dist/types/__tests__/signal.test.d.ts +2 -0
  589. package/dist/types/__tests__/signal.test.d.ts.map +1 -0
  590. package/dist/types/__tests__/signal.test.js +111 -0
  591. package/dist/types/__tests__/signal.test.js.map +1 -0
  592. package/dist/types/index.d.ts +5 -0
  593. package/dist/types/index.d.ts.map +1 -0
  594. package/dist/types/index.js +3 -0
  595. package/dist/types/index.js.map +1 -0
  596. package/dist/types/signal-batch.d.ts +56 -0
  597. package/dist/types/signal-batch.d.ts.map +1 -0
  598. package/dist/types/signal-batch.js +54 -0
  599. package/dist/types/signal-batch.js.map +1 -0
  600. package/dist/types/signal.d.ts +77 -0
  601. package/dist/types/signal.d.ts.map +1 -0
  602. package/dist/types/signal.js +42 -0
  603. package/dist/types/signal.js.map +1 -0
  604. package/package.json +57 -0
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @fileoverview Load-time manifest⇔Tool drift guard (launch, Phase 1).
3
+ *
4
+ * The static `ToolPluginManifest` (declared in `package.json#opensipTools`)
5
+ * and the runtime `Tool` are two declarations of the same tool. Per ADR-0048
6
+ * the runtime uses `metadata.id` for the stable UUID and `metadata.name` for
7
+ * the human key (matching the manifest's `id` for the human key). Manifests
8
+ * may also declare `stableId` (additive) for the UUID.
9
+ *
10
+ * This guard asserts:
11
+ * - manifest's human `id` === runtime `metadata.name`
12
+ * - if manifest declares `stableId`, it === runtime `metadata.id`
13
+ * - the **set** of command names is identical (order-insensitive).
14
+ *
15
+ * Descriptions/aliases are NOT compared. The guard runs after dynamic import
16
+ * for bundled, installed, and authored tools.
17
+ */
18
+ import type { ToolPluginManifest } from './manifest.js';
19
+ import type { Tool } from './types.js';
20
+ /**
21
+ * Assert that a static `ToolPluginManifest` matches the runtime `Tool` it
22
+ * declares — same `id`, same set of command names. Throws `ValidationError`
23
+ * on any mismatch; returns `void` when they agree.
24
+ *
25
+ * This is the drift guard between the two identity declarations: the
26
+ * `package.json#opensipTools` manifest (read before importing the module)
27
+ * and the imported `Tool` (`metadata.id` + `commands[]`). Catches a manifest
28
+ * that fell out of sync with the tool's runtime command surface.
29
+ *
30
+ * @param manifest The static manifest read from `package.json#opensipTools`.
31
+ * @param tool The runtime tool the manifest is supposed to describe.
32
+ * @throws {ValidationError} when `id` differs, or the command-name sets differ.
33
+ */
34
+ export declare function assertManifestMatchesTool(manifest: ToolPluginManifest, tool: Tool): void;
35
+ //# sourceMappingURL=manifest-assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-assert.d.ts","sourceRoot":"","sources":["../../src/tools/manifest-assert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CA6CxF"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @fileoverview Load-time manifest⇔Tool drift guard (launch, Phase 1).
3
+ *
4
+ * The static `ToolPluginManifest` (declared in `package.json#opensipTools`)
5
+ * and the runtime `Tool` are two declarations of the same tool. Per ADR-0048
6
+ * the runtime uses `metadata.id` for the stable UUID and `metadata.name` for
7
+ * the human key (matching the manifest's `id` for the human key). Manifests
8
+ * may also declare `stableId` (additive) for the UUID.
9
+ *
10
+ * This guard asserts:
11
+ * - manifest's human `id` === runtime `metadata.name`
12
+ * - if manifest declares `stableId`, it === runtime `metadata.id`
13
+ * - the **set** of command names is identical (order-insensitive).
14
+ *
15
+ * Descriptions/aliases are NOT compared. The guard runs after dynamic import
16
+ * for bundled, installed, and authored tools.
17
+ */
18
+ import { ValidationError } from '../lib/errors.js';
19
+ /**
20
+ * Assert that a static `ToolPluginManifest` matches the runtime `Tool` it
21
+ * declares — same `id`, same set of command names. Throws `ValidationError`
22
+ * on any mismatch; returns `void` when they agree.
23
+ *
24
+ * This is the drift guard between the two identity declarations: the
25
+ * `package.json#opensipTools` manifest (read before importing the module)
26
+ * and the imported `Tool` (`metadata.id` + `commands[]`). Catches a manifest
27
+ * that fell out of sync with the tool's runtime command surface.
28
+ *
29
+ * @param manifest The static manifest read from `package.json#opensipTools`.
30
+ * @param tool The runtime tool the manifest is supposed to describe.
31
+ * @throws {ValidationError} when `id` differs, or the command-name sets differ.
32
+ */
33
+ export function assertManifestMatchesTool(manifest, tool) {
34
+ // Human key resolution:
35
+ // - For tools using the post-ADR-0048 shape (stable UUID in .id, human key in .name): use .name
36
+ // - For legacy-shaped fixtures/tests (human key still in .id, or .name is display-only): fall back to .id
37
+ // This keeps authored/installed test fixtures working without mass updates while enforcing the split for real tools.
38
+ const isModernShape = typeof tool.metadata.id === 'string' && /^[0-9a-fA-F]{8}-/.test(tool.metadata.id);
39
+ const runtimeHuman = isModernShape && tool.metadata.name ? tool.metadata.name : tool.metadata.id;
40
+ if (manifest.id !== runtimeHuman) {
41
+ throw new ValidationError(`tool manifest id '${manifest.id}' does not match runtime tool name '${runtimeHuman}'`);
42
+ }
43
+ // If the manifest declares a stableId (additive per ADR-0048), it must match
44
+ // the runtime's stable UUID in `metadata.id`.
45
+ if (manifest.stableId !== undefined && manifest.stableId !== tool.metadata.id) {
46
+ throw new ValidationError(`tool manifest stableId '${manifest.stableId}' does not match runtime tool id '${tool.metadata.id}'`);
47
+ }
48
+ const manifestNames = new Set(manifest.commands.map((c) => c.name));
49
+ const toolNames = new Set(tool.commands.map((c) => c.name));
50
+ const missingFromManifest = [...toolNames]
51
+ .filter((n) => !manifestNames.has(n))
52
+ .sort((a, b) => a.localeCompare(b));
53
+ const extraInManifest = [...manifestNames]
54
+ .filter((n) => !toolNames.has(n))
55
+ .sort((a, b) => a.localeCompare(b));
56
+ if (missingFromManifest.length > 0 || extraInManifest.length > 0) {
57
+ const parts = [];
58
+ if (missingFromManifest.length > 0) {
59
+ parts.push(`missing from manifest: [${missingFromManifest.join(', ')}]`);
60
+ }
61
+ if (extraInManifest.length > 0) {
62
+ parts.push(`declared in manifest but not in tool: [${extraInManifest.join(', ')}]`);
63
+ }
64
+ throw new ValidationError(`tool manifest commands for '${manifest.id}' do not match runtime tool commands (${parts.join('; ')})`);
65
+ }
66
+ }
67
+ //# sourceMappingURL=manifest-assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-assert.js","sourceRoot":"","sources":["../../src/tools/manifest-assert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKnD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAA4B,EAAE,IAAU;IAChF,wBAAwB;IACxB,gGAAgG;IAChG,0GAA0G;IAC1G,qHAAqH;IACrH,MAAM,aAAa,GACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,QAAQ,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACpF,MAAM,YAAY,GAAG,aAAa,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;IAEjG,IAAI,QAAQ,CAAC,EAAE,KAAK,YAAY,EAAE,CAAC;QACjC,MAAM,IAAI,eAAe,CACvB,qBAAqB,QAAQ,CAAC,EAAE,uCAAuC,YAAY,GAAG,CACvF,CAAC;IACJ,CAAC;IAED,6EAA6E;IAC7E,8CAA8C;IAC9C,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QAC9E,MAAM,IAAI,eAAe,CACvB,2BAA2B,QAAQ,CAAC,QAAQ,qCAAqC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,CACrG,CAAC;IACJ,CAAC;IAED,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAE5D,MAAM,mBAAmB,GAAG,CAAC,GAAG,SAAS,CAAC;SACvC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACpC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,eAAe,GAAG,CAAC,GAAG,aAAa,CAAC;SACvC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAChC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtC,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjE,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,2BAA2B,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3E,CAAC;QACD,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,0CAA0C,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtF,CAAC;QACD,MAAM,IAAI,eAAe,CACvB,+BAA+B,QAAQ,CAAC,EAAE,yCAAyC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACvG,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,178 @@
1
+ /**
2
+ * @fileoverview Static tool-plugin manifest + the plugin-API epoch +
3
+ * provenance types (launch, raw-vs-admitted compatibility contract).
4
+ *
5
+ * The **manifest** is the static front matter the host reads *before*
6
+ * importing a tool's runtime `Tool` module (north-star §5.1). It is
7
+ * declared in `package.json#opensipTools` for bundled + installed tools
8
+ * (one read for both) and as a JSON sidecar for project-local tools.
9
+ *
10
+ * `PLUGIN_API_VERSION` is a coarse integer **epoch** for the plugin
11
+ * *input* contract. A tool declares the epoch it was compiled against
12
+ * via `RawToolPluginManifest.apiVersion`; the host's single
13
+ * `checkCompatibility()` gate (see `compatibility.ts`) admits or rejects
14
+ * on that integer alone — no semver range maths. Once admitted, the manifest is
15
+ * represented as `ToolPluginManifest`, whose `apiVersion` is required.
16
+ *
17
+ * The host consumes identity + command metadata and, as of ADR-0029, the
18
+ * concrete `capabilities` descriptor that declares owned capability domains.
19
+ * Remaining fields (`config`/`dashboard`/…) stay typed-but-not-consumed
20
+ * placeholders so a manifest authored today stays forward-shaped.
21
+ *
22
+ * These types live in **core** (next to the `Tool` contract). `contracts`
23
+ * re-exports them for the public surface; core cannot import contracts.
24
+ */
25
+ import type { ToolCapabilityDeclaration } from './capability.js';
26
+ /**
27
+ * The plugin-API epoch the running engine implements.
28
+ *
29
+ * A coarse integer, bumped only on a breaking change to the plugin
30
+ * *input* contract. A tool manifest's `apiVersion` is compared against
31
+ * this single value by `checkCompatibility()`. A missing `apiVersion`
32
+ * is incompatible as of launch; raw manifests stay representable so the
33
+ * admission gate can diagnose unversioned inputs before rejecting them.
34
+ */
35
+ export declare const PLUGIN_API_VERSION = 1;
36
+ /**
37
+ * Where a tool plugin came from. Drives the trust policy and the
38
+ * provenance record surfaced in structured logs + `plugin list`.
39
+ *
40
+ * - `bundled` — a first-party tool shipped with the CLI
41
+ * (trusted-by-shipping).
42
+ * - `installed` — an npm package discovered via tool-package-discovery
43
+ * (incl. `plugin add` / `plugin add --project`). Trusted
44
+ * as an installed dependency.
45
+ * - `user-global` — an authored sidecar under
46
+ * `~/.opensip-cli/tools/<name>/`
47
+ * (`opensip-tool.manifest.json`). The user placed it in
48
+ * their own home dir (the `npm i -g` analogue for
49
+ * authored code) → **trusted-by-default**.
50
+ * - `project-local` — an authored sidecar under
51
+ * `<project>/opensip-cli/tools/<name>/`
52
+ * (`opensip-tool.manifest.json`). It rides in with
53
+ * `git clone` → **deny-by-default**; admitted only when
54
+ * its id (or `*`) is allowlisted via
55
+ * `OPENSIP_CLI_ALLOW_PROJECT_TOOLS`.
56
+ */
57
+ export type ToolSource = 'bundled' | 'installed' | 'user-global' | 'project-local';
58
+ /**
59
+ * Identity of a command a tool contributes, as declared in the static
60
+ * manifest. Mirrors the runtime `ToolCommandDescriptor` (`types.ts`) so
61
+ * the bundled path can assert manifest⇔`Tool.commands` equality (Phase 1).
62
+ */
63
+ export interface ToolCommandManifest {
64
+ /** CLI subcommand name — 'fit', 'sim', 'fit-list', etc. */
65
+ readonly name: string;
66
+ readonly description: string;
67
+ readonly aliases?: readonly string[];
68
+ }
69
+ /**
70
+ * The static front matter a tool plugin declares (in
71
+ * `package.json#opensipTools` or a JSON sidecar) so the host can inspect
72
+ * its identity + contract epoch **without importing the runtime module**.
73
+ *
74
+ * The host consumes the identity subset
75
+ * (`kind`/`id`/`name`/`version`/`apiVersion`/`commands`) plus the concrete
76
+ * `capabilities` descriptor. The remaining fields are typed-but-not-consumed
77
+ * placeholders for later releases so a manifest authored today is
78
+ * forward-shaped; they are deliberately `unknown`-shaped until a release gives
79
+ * them concrete semantics.
80
+ *
81
+ * Launch (§5.3) gives `capabilities` its concrete shape — an
82
+ * array of {@link ToolCapabilityDeclaration} (the capability domains the
83
+ * tool OWNS). It stays OPTIONAL and additive: a manifest with no
84
+ * `capabilities` declares no domains, and `MARKER_KINDS` remains the
85
+ * bootstrap-default domain vocabulary. The other slots stay `unknown`.
86
+ */
87
+ interface ToolPluginManifestBase {
88
+ /** Discriminator — always `'tool'` (matches `opensipTools.kind`). */
89
+ readonly kind: 'tool';
90
+ /**
91
+ * Human/programmatic key (the value used for current storage, short ids,
92
+ * config, etc.). For published tools this is the "declared" identifier.
93
+ * This remains the manifest-side key for backward compat (ADR-0048).
94
+ * The tool's stable machine identity (UUID) is declared here as `stableId`
95
+ * (additive) when the tool author pins one; at runtime it appears as
96
+ * `ToolMetadata.id` (with the human key in `ToolMetadata.name`).
97
+ */
98
+ readonly id: string;
99
+ /**
100
+ * Stable machine identity (real UUID) for this tool, matching the semantics
101
+ * and field name of Checks' `id`. Declared additively by tools that opt into
102
+ * durable identity (first-party tools declare it; community tools should too).
103
+ * When present, the drift guard and provenance capture it.
104
+ */
105
+ readonly stableId?: string;
106
+ /** Human-facing display name. */
107
+ readonly name: string;
108
+ /** Display semver of the tool itself (NOT the contract epoch). */
109
+ readonly version: string;
110
+ /** Command identities the tool contributes — `--help` / conflict detection. */
111
+ readonly commands: readonly ToolCommandManifest[];
112
+ /**
113
+ * §5.3 → Launch: the capability domains this tool OWNS. Each entry is a
114
+ * {@link ToolCapabilityDeclaration} (id + contribution epoch + schema +
115
+ * kind); the host stamps `ownerToolId = this.stableId ?? this.id` (ADR-0048:
116
+ * the owner key must equal the owning tool's `metadata.id` — the stable UUID
117
+ * for modern tools) and registers each into the per-run capability registry,
118
+ * EXTENDING the `MARKER_KINDS` bootstrap vocabulary without a host-enum edit.
119
+ * Optional + additive.
120
+ */
121
+ readonly capabilities?: readonly ToolCapabilityDeclaration[];
122
+ /** §5.7 → 2.9.0: tool-owned config schema descriptor. */
123
+ readonly config?: unknown;
124
+ /** Later: dashboard-contribution descriptor. */
125
+ readonly dashboard?: unknown;
126
+ /** Later: sessions-contribution descriptor. */
127
+ readonly sessions?: unknown;
128
+ /** Later: declared plugin domains the tool hosts. */
129
+ readonly pluginDomains?: readonly unknown[];
130
+ /** Later: declared host/peer requirements. */
131
+ readonly requires?: readonly unknown[];
132
+ /** Reserved: compatibility metadata (minApiVersion, languages, etc.). */
133
+ readonly compatibility?: unknown;
134
+ /** Reserved: distribution posture for community/catalog. */
135
+ readonly distribution?: 'private' | 'public-free' | 'public-paid' | unknown;
136
+ /** General bag for future extension metadata (publisher, pricing, etc.). */
137
+ readonly extensionMetadata?: unknown;
138
+ }
139
+ /**
140
+ * Structurally valid manifest front matter before compatibility admission.
141
+ * `apiVersion` is optional here only so the loader can represent and diagnose
142
+ * manifest-incompatible unversioned tools without pretending they are admitted.
143
+ */
144
+ export interface RawToolPluginManifest extends ToolPluginManifestBase {
145
+ /** The plugin-API epoch this tool was compiled against, if declared. */
146
+ readonly apiVersion?: number;
147
+ }
148
+ /**
149
+ * A manifest that passed the compatibility gate and can seed runtime surfaces
150
+ * such as command mounting, provenance, and capability registration.
151
+ */
152
+ export interface ToolPluginManifest extends ToolPluginManifestBase {
153
+ /** The plugin-API epoch this admitted tool was compiled against. */
154
+ readonly apiVersion: number;
155
+ }
156
+ /**
157
+ * The provenance record the host attaches when it admits a tool —
158
+ * source + identity + a hash of the manifest it read. Surfaced via
159
+ * structured logs on load and via `plugin list` (Phase 4).
160
+ */
161
+ export interface ToolProvenance {
162
+ /** Where the tool came from. */
163
+ readonly source: ToolSource;
164
+ /** The tool's human/programmatic key (from the manifest). */
165
+ readonly id: string;
166
+ /** The tool's stable identity (real UUID) when declared (additive per ADR-0048). */
167
+ readonly stableId?: string;
168
+ /** The tool's display version (from the manifest). */
169
+ readonly version: string;
170
+ /** npm package name, when the tool is an installed/bundled package. */
171
+ readonly packageName?: string;
172
+ /** Filesystem path the manifest was resolved from, when applicable. */
173
+ readonly resolvedPath?: string;
174
+ /** Stable hash of the manifest bytes the host read — tamper/identity check. */
175
+ readonly manifestHash: string;
176
+ }
177
+ export {};
178
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/tools/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAEjE;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,eAAe,CAAC;AAEnF;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,UAAU,sBAAsB;IAC9B,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAMlD;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC7D,yDAAyD;IACzD,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,qDAAqD;IACrD,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC5C,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAWvC,yEAAyE;IACzE,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,4DAA4D;IAC5D,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,aAAa,GAAG,OAAO,CAAC;IAC5E,4EAA4E;IAC5E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,sBAAsB;IACnE,wEAAwE;IACxE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;IAChE,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,+EAA+E;IAC/E,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @fileoverview Static tool-plugin manifest + the plugin-API epoch +
3
+ * provenance types (launch, raw-vs-admitted compatibility contract).
4
+ *
5
+ * The **manifest** is the static front matter the host reads *before*
6
+ * importing a tool's runtime `Tool` module (north-star §5.1). It is
7
+ * declared in `package.json#opensipTools` for bundled + installed tools
8
+ * (one read for both) and as a JSON sidecar for project-local tools.
9
+ *
10
+ * `PLUGIN_API_VERSION` is a coarse integer **epoch** for the plugin
11
+ * *input* contract. A tool declares the epoch it was compiled against
12
+ * via `RawToolPluginManifest.apiVersion`; the host's single
13
+ * `checkCompatibility()` gate (see `compatibility.ts`) admits or rejects
14
+ * on that integer alone — no semver range maths. Once admitted, the manifest is
15
+ * represented as `ToolPluginManifest`, whose `apiVersion` is required.
16
+ *
17
+ * The host consumes identity + command metadata and, as of ADR-0029, the
18
+ * concrete `capabilities` descriptor that declares owned capability domains.
19
+ * Remaining fields (`config`/`dashboard`/…) stay typed-but-not-consumed
20
+ * placeholders so a manifest authored today stays forward-shaped.
21
+ *
22
+ * These types live in **core** (next to the `Tool` contract). `contracts`
23
+ * re-exports them for the public surface; core cannot import contracts.
24
+ */
25
+ /**
26
+ * The plugin-API epoch the running engine implements.
27
+ *
28
+ * A coarse integer, bumped only on a breaking change to the plugin
29
+ * *input* contract. A tool manifest's `apiVersion` is compared against
30
+ * this single value by `checkCompatibility()`. A missing `apiVersion`
31
+ * is incompatible as of launch; raw manifests stay representable so the
32
+ * admission gate can diagnose unversioned inputs before rejecting them.
33
+ */
34
+ export const PLUGIN_API_VERSION = 1;
35
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/tools/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Tool registry — in-memory list of registered Tool implementations.
3
+ *
4
+ * The CLI populates the registry at startup (first-party tools as
5
+ * direct imports, third-party tools via tool-package-discovery), then
6
+ * iterates `list()` to build its command tree.
7
+ *
8
+ * **Duplicate-id policy: first writer wins.** Re-registering the same
9
+ * id keeps the existing entry and emits a structured warning. This
10
+ * matches `LanguageRegistry`'s policy and prevents third-party plugins
11
+ * from accidentally clobbering first-party registrations.
12
+ *
13
+ * Implemented on top of the kernel's `Registry<T>` base. Tools don't
14
+ * naturally satisfy `Registerable` (no `name` field on metadata), so
15
+ * the registry wraps each Tool in a `{ id, name: id, tool }` envelope
16
+ * before storing it. `list()` / `get()` unwrap.
17
+ */
18
+ import type { Tool } from './types.js';
19
+ /** Per-run registry of {@link Tool} plugins, indexed by the human name (metadata.name). */
20
+ export declare class ToolRegistry {
21
+ private readonly inner;
22
+ /**
23
+ * Register a tool. **First writer wins** — re-registering the same
24
+ * (human) id is a no-op and emits a `tool.registry.duplicate` warning.
25
+ *
26
+ * The registry is keyed by the human `metadata.name` (the former `id` value)
27
+ * for continuity with callers that do registry.get('fitness') etc. The stable
28
+ * UUID lives in metadata.id and is not used as the registry key.
29
+ */
30
+ register(tool: Tool, opts?: {
31
+ sourcePackage?: string;
32
+ }): void;
33
+ list(): readonly Tool[];
34
+ get(id: string): Tool | undefined;
35
+ clear(): void;
36
+ }
37
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAQvC,2FAA2F;AAC3F,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAInB;IAEH;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,GAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,IAAI;IAKjE,IAAI,IAAI,SAAS,IAAI,EAAE;IAIvB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAIjC,KAAK,IAAI,IAAI;CAGd"}
@@ -0,0 +1,49 @@
1
+ // @fitness-ignore-file batch-operation-limits -- getAll() over the registered tool set (a handful of first-party + plugin tools per CLI invocation)
2
+ /**
3
+ * Tool registry — in-memory list of registered Tool implementations.
4
+ *
5
+ * The CLI populates the registry at startup (first-party tools as
6
+ * direct imports, third-party tools via tool-package-discovery), then
7
+ * iterates `list()` to build its command tree.
8
+ *
9
+ * **Duplicate-id policy: first writer wins.** Re-registering the same
10
+ * id keeps the existing entry and emits a structured warning. This
11
+ * matches `LanguageRegistry`'s policy and prevents third-party plugins
12
+ * from accidentally clobbering first-party registrations.
13
+ *
14
+ * Implemented on top of the kernel's `Registry<T>` base. Tools don't
15
+ * naturally satisfy `Registerable` (no `name` field on metadata), so
16
+ * the registry wraps each Tool in a `{ id, name: id, tool }` envelope
17
+ * before storing it. `list()` / `get()` unwrap.
18
+ */
19
+ import { Registry } from '../lib/registry.js';
20
+ /** Per-run registry of {@link Tool} plugins, indexed by the human name (metadata.name). */
21
+ export class ToolRegistry {
22
+ inner = new Registry({
23
+ module: 'core:tools',
24
+ duplicatePolicy: 'warn-first-wins',
25
+ evtPrefix: 'tool.registry',
26
+ });
27
+ /**
28
+ * Register a tool. **First writer wins** — re-registering the same
29
+ * (human) id is a no-op and emits a `tool.registry.duplicate` warning.
30
+ *
31
+ * The registry is keyed by the human `metadata.name` (the former `id` value)
32
+ * for continuity with callers that do registry.get('fitness') etc. The stable
33
+ * UUID lives in metadata.id and is not used as the registry key.
34
+ */
35
+ register(tool, opts = {}) {
36
+ const key = tool.metadata.name ?? tool.metadata.id;
37
+ this.inner.register({ id: key, name: key, tool }, { sourcePackage: opts.sourcePackage });
38
+ }
39
+ list() {
40
+ return this.inner.getAll().map((r) => r.tool);
41
+ }
42
+ get(id) {
43
+ return this.inner.getById(id)?.tool;
44
+ }
45
+ clear() {
46
+ this.inner.clear();
47
+ }
48
+ }
49
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA,oJAAoJ;AACpJ;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AAUjE,2FAA2F;AAC3F,MAAM,OAAO,YAAY;IACN,KAAK,GAAG,IAAI,QAAQ,CAAmB;QACtD,MAAM,EAAE,YAAY;QACpB,eAAe,EAAE,iBAAiB;QAClC,SAAS,EAAE,eAAe;KAC3B,CAAC,CAAC;IAEH;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAU,EAAE,OAAmC,EAAE;QACxD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC;IACtC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}