@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 Shared npm-scope validation + resolution for scoped plugin
3
+ * auto-discovery (scenario packs, future package families).
4
+ *
5
+ * Discovery code maps a scope string to `node_modules/<scope>/` and
6
+ * scans for packages. Untrusted scope strings reach `path.join`, so we
7
+ * enforce strict npm-scope syntax before they're used as path
8
+ * segments. A stray `..` or `/` would otherwise scan the wrong
9
+ * directory.
10
+ *
11
+ * Hoisted into core so every scoped discovery surface enforces the
12
+ * same invariant. The `@opensip-cli/scenarios-*` discovery in sim
13
+ * flows through this helper.
14
+ */
15
+ /**
16
+ * npm scope syntax: `@` followed by a kebab-case identifier. We anchor
17
+ * strictly because scope strings end up in `path.join('node_modules', scope)`
18
+ * — a stray `..` or `/` would scan the wrong directory.
19
+ */
20
+ export declare const VALID_NPM_SCOPE_REGEX: RegExp;
21
+ /**
22
+ * Resolve the effective list of npm scopes to scan: the platform
23
+ * default is always included; customer additions are appended after
24
+ * deduplication and format validation. Invalid scope strings are
25
+ * dropped with a structured warning rather than throwing — consistent
26
+ * with how discovery handles unresolved explicit packages elsewhere.
27
+ *
28
+ * @param defaultScope The platform default (e.g. `@opensip-cli`)
29
+ * @param extraScopes Customer-configured additions
30
+ * @param evt Log event name to use when warning about invalid
31
+ * entries — lets each caller emit a domain-specific
32
+ * event name (`plugin.scenario_package.invalid_scope`).
33
+ */
34
+ export declare function resolveScopes(defaultScope: string, extraScopes: readonly string[], evt: string): readonly string[];
35
+ //# sourceMappingURL=scope-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-validation.d.ts","sourceRoot":"","sources":["../../src/plugins/scope-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAA4B,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,GAAG,EAAE,MAAM,GACV,SAAS,MAAM,EAAE,CAkBnB"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @fileoverview Shared npm-scope validation + resolution for scoped plugin
3
+ * auto-discovery (scenario packs, future package families).
4
+ *
5
+ * Discovery code maps a scope string to `node_modules/<scope>/` and
6
+ * scans for packages. Untrusted scope strings reach `path.join`, so we
7
+ * enforce strict npm-scope syntax before they're used as path
8
+ * segments. A stray `..` or `/` would otherwise scan the wrong
9
+ * directory.
10
+ *
11
+ * Hoisted into core so every scoped discovery surface enforces the
12
+ * same invariant. The `@opensip-cli/scenarios-*` discovery in sim
13
+ * flows through this helper.
14
+ */
15
+ import { logger } from '../lib/logger.js';
16
+ /**
17
+ * npm scope syntax: `@` followed by a kebab-case identifier. We anchor
18
+ * strictly because scope strings end up in `path.join('node_modules', scope)`
19
+ * — a stray `..` or `/` would scan the wrong directory.
20
+ */
21
+ export const VALID_NPM_SCOPE_REGEX = /^@[a-z0-9][a-z0-9._-]*$/;
22
+ /**
23
+ * Resolve the effective list of npm scopes to scan: the platform
24
+ * default is always included; customer additions are appended after
25
+ * deduplication and format validation. Invalid scope strings are
26
+ * dropped with a structured warning rather than throwing — consistent
27
+ * with how discovery handles unresolved explicit packages elsewhere.
28
+ *
29
+ * @param defaultScope The platform default (e.g. `@opensip-cli`)
30
+ * @param extraScopes Customer-configured additions
31
+ * @param evt Log event name to use when warning about invalid
32
+ * entries — lets each caller emit a domain-specific
33
+ * event name (`plugin.scenario_package.invalid_scope`).
34
+ */
35
+ export function resolveScopes(defaultScope, extraScopes, evt) {
36
+ const out = [defaultScope];
37
+ const seen = new Set(out);
38
+ for (const scope of extraScopes) {
39
+ if (!VALID_NPM_SCOPE_REGEX.test(scope)) {
40
+ logger.warn({
41
+ evt,
42
+ module: 'core:plugins',
43
+ scope,
44
+ msg: `plugins.packageScopes entry "${scope}" is not a valid npm scope (expected "@kebab-case") — skipping`,
45
+ });
46
+ continue;
47
+ }
48
+ if (seen.has(scope))
49
+ continue;
50
+ seen.add(scope);
51
+ out.push(scope);
52
+ }
53
+ return out;
54
+ }
55
+ //# sourceMappingURL=scope-validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-validation.js","sourceRoot":"","sources":["../../src/plugins/scope-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAC3B,YAAoB,EACpB,WAA8B,EAC9B,GAAW;IAEX,MAAM,GAAG,GAAa,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAS,GAAG,CAAC,CAAC;IAClC,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;QAChC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACvC,MAAM,CAAC,IAAI,CAAC;gBACV,GAAG;gBACH,MAAM,EAAE,cAAc;gBACtB,KAAK;gBACL,GAAG,EAAE,gCAAgC,KAAK,gEAAgE;aAC3G,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,SAAS;QAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @fileoverview Single-`@opensip-cli/core` guard for discovered packages.
3
+ *
4
+ * A capability pack (check pack, scenario pack, graph adapter) that resolves a
5
+ * DIFFERENT physical `@opensip-cli/core` than the running engine registers its
6
+ * contributions against a core whose `currentScope()` is always `undefined` here
7
+ * (a different `AsyncLocalStorage`). That silently degrades the run — the failure
8
+ * mode seen when a globally-installed CLI discovers packs in a project that
9
+ * vendors its own `@opensip-cli/*`. Such packs are refused at discovery time.
10
+ *
11
+ * Packs that don't depend on core at all resolve nothing and pass. The guard is
12
+ * tool-agnostic: the generic discovery substrate applies it to EVERY domain's
13
+ * packs, so the policy lives here once instead of in each tool's loader.
14
+ */
15
+ /** The canonical `@opensip-cli/core` path this runtime resolves (for diagnostics). */
16
+ export declare function selfCore(): string | undefined;
17
+ /** The pack's resolved `@opensip-cli/core` if it differs from {@link selfCore}; else undefined. */
18
+ export declare function foreignCorePath(packageDir: string): string | undefined;
19
+ /**
20
+ * Keep only the packages that resolve THIS runtime's `@opensip-cli/core`
21
+ * (or none at all). `onForeign` is invoked for each dropped pack with the foreign
22
+ * core path it resolved, for a caller-shaped diagnostic.
23
+ */
24
+ export declare function filterSameCorePackages<T extends {
25
+ readonly name: string;
26
+ readonly packageDir: string;
27
+ }>(packages: readonly T[], onForeign?: (pkg: T, foreignCore: string) => void): T[];
28
+ //# sourceMappingURL=single-core-guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-core-guard.d.ts","sourceRoot":"","sources":["../../src/plugins/single-core-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAqBH,sFAAsF;AACtF,wBAAgB,QAAQ,IAAI,MAAM,GAAG,SAAS,CAE7C;AAED,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYtE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EAChE,QAAQ,EAAE,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,GAAG,CAAC,EAAE,CAQhF"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @fileoverview Single-`@opensip-cli/core` guard for discovered packages.
3
+ *
4
+ * A capability pack (check pack, scenario pack, graph adapter) that resolves a
5
+ * DIFFERENT physical `@opensip-cli/core` than the running engine registers its
6
+ * contributions against a core whose `currentScope()` is always `undefined` here
7
+ * (a different `AsyncLocalStorage`). That silently degrades the run — the failure
8
+ * mode seen when a globally-installed CLI discovers packs in a project that
9
+ * vendors its own `@opensip-cli/*`. Such packs are refused at discovery time.
10
+ *
11
+ * Packs that don't depend on core at all resolve nothing and pass. The guard is
12
+ * tool-agnostic: the generic discovery substrate applies it to EVERY domain's
13
+ * packs, so the policy lives here once instead of in each tool's loader.
14
+ */
15
+ import { createRequire } from 'node:module';
16
+ import { join } from 'node:path';
17
+ import { pathToFileURL } from 'node:url';
18
+ /**
19
+ * The `@opensip-cli/core` THIS module resolves — the canonical core whose
20
+ * `runWithScope` populates `currentScope()`. Captured once. `undefined` disables
21
+ * the guard (fail-open; defensive only — core always resolves from itself).
22
+ */
23
+ const selfCorePath = (() => {
24
+ try {
25
+ return createRequire(import.meta.url).resolve('@opensip-cli/core');
26
+ }
27
+ catch {
28
+ /* v8 ignore next 2 -- core resolves from itself; defensive only */
29
+ // @fitness-ignore-next-line error-handling-quality -- an unresolvable self-core disables the guard (fail-open), not an error.
30
+ return;
31
+ }
32
+ })();
33
+ /** The canonical `@opensip-cli/core` path this runtime resolves (for diagnostics). */
34
+ export function selfCore() {
35
+ return selfCorePath;
36
+ }
37
+ /** The pack's resolved `@opensip-cli/core` if it differs from {@link selfCore}; else undefined. */
38
+ export function foreignCorePath(packageDir) {
39
+ if (selfCorePath === undefined)
40
+ return undefined;
41
+ try {
42
+ // The anchor file need not exist — createRequire only uses its directory as
43
+ // the resolution base, walking up node_modules from the pack.
44
+ const anchor = pathToFileURL(join(packageDir, 'noop.js')).href;
45
+ const packCore = createRequire(anchor).resolve('@opensip-cli/core');
46
+ return packCore === selfCorePath ? undefined : packCore;
47
+ }
48
+ catch {
49
+ // @fitness-ignore-next-line error-handling-quality -- resolution probe: a pack with no core dep throws here, and "no foreign core → allow" is the contract.
50
+ return undefined;
51
+ }
52
+ }
53
+ /**
54
+ * Keep only the packages that resolve THIS runtime's `@opensip-cli/core`
55
+ * (or none at all). `onForeign` is invoked for each dropped pack with the foreign
56
+ * core path it resolved, for a caller-shaped diagnostic.
57
+ */
58
+ export function filterSameCorePackages(packages, onForeign) {
59
+ if (selfCorePath === undefined)
60
+ return [...packages];
61
+ return packages.filter((pkg) => {
62
+ const foreign = foreignCorePath(pkg.packageDir);
63
+ if (foreign === undefined)
64
+ return true;
65
+ onForeign?.(pkg, foreign);
66
+ return false;
67
+ });
68
+ }
69
+ //# sourceMappingURL=single-core-guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-core-guard.js","sourceRoot":"","sources":["../../src/plugins/single-core-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;GAIG;AACH,MAAM,YAAY,GAAuB,CAAC,GAAG,EAAE;IAC7C,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrE,CAAC;IAAC,MAAM,CAAC;QACP,mEAAmE;QACnE,8HAA8H;QAC9H,OAAO;IACT,CAAC;AACH,CAAC,CAAC,EAAE,CAAC;AAEL,sFAAsF;AACtF,MAAM,UAAU,QAAQ;IACtB,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACjD,IAAI,CAAC;QACH,4EAA4E;QAC5E,8DAA8D;QAC9D,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/D,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACpE,OAAO,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,4JAA4J;QAC5J,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAEpC,QAAsB,EAAE,SAAiD;IACzE,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;IACrD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7B,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAChD,IAAI,OAAO,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACvC,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * @fileoverview Thin domain-typed wrapper around the generic marker
3
+ * walker for `kind: "tool"`.
4
+ *
5
+ * A Tool plugin is any npm package (scoped or unscoped, first- or third-
6
+ * party) whose `package.json` declares:
7
+ *
8
+ * { "opensipTools": { "kind": "tool" } }
9
+ *
10
+ * The walker itself lives in `marker-discovery.ts` — this file preserves
11
+ * the public surface (`discoverToolPackages`, `DiscoveredToolPackage`)
12
+ * existing CLI consumers depend on, and delegates the actual node_modules
13
+ * traversal to the shared primitive.
14
+ *
15
+ * Direct dependencies of opensip-cli are always loaded by the
16
+ * CLI's own import statements; this discovery exists so a user can
17
+ * install a third-party tool via `npm install` and have it picked up
18
+ * with no further wiring.
19
+ */
20
+ export interface ToolPackageDiscoveryOptions {
21
+ /** Absolute path to the project root. */
22
+ readonly projectDir: string;
23
+ }
24
+ export interface DiscoveredToolPackage {
25
+ /** npm package name, e.g. '@opensip-cli/fitness' or '@my-co/audit'. */
26
+ readonly name: string;
27
+ /** Absolute path to the package's directory inside node_modules. */
28
+ readonly packageDir: string;
29
+ }
30
+ /**
31
+ * Walk up from `projectDir` looking for `node_modules/` directories
32
+ * containing packages with `opensipTools.kind === 'tool'`. Returns the
33
+ * deduplicated list (first-occurrence-wins by package name).
34
+ */
35
+ export declare function discoverToolPackages(options: ToolPackageDiscoveryOptions): DiscoveredToolPackage[];
36
+ /**
37
+ * One discovery source for {@link discoverToolPackagesFromAnchors}.
38
+ *
39
+ * - `walkUp`: walk ancestor `node_modules` from `dir` (project trees, the
40
+ * CLI install dir — covers a plain `npm install @tool` and global CLI
41
+ * siblings).
42
+ * - `scanDir`: scan exactly `<dir>/node_modules`, no walk (the fixed
43
+ * plugin host dirs — `~/.opensip-cli/plugins/tool`,
44
+ * `<project>/.runtime/plugins/tool`).
45
+ */
46
+ export interface ToolDiscoverySource {
47
+ readonly dir: string;
48
+ readonly mode: 'walkUp' | 'scanDir';
49
+ }
50
+ /**
51
+ * Discover tool packages across an ORDERED list of sources, deduplicated
52
+ * by package name with first-occurrence-wins. Order encodes precedence:
53
+ * an earlier source's package shadows a later same-named one (e.g. a
54
+ * project-local pin shadows a user-global install). Mirrors the
55
+ * ToolRegistry's own first-writer-wins on duplicate ids.
56
+ *
57
+ * **Provenance contract.** Every anchor yields `source: 'installed'`
58
+ * provenance regardless of which anchor it came from — the anchor distinction
59
+ * encodes PRECEDENCE/SHADOWING, NOT source. So the caller
60
+ * (`admitInstalledTool` in `register-tools.ts`) assigns `source: 'installed'`
61
+ * UNIFORMLY; a per-anchor source tag here would add no information and is
62
+ * deliberately NOT threaded. *Authored* provenance (`project-local` /
63
+ * `user-global`) comes from the separate `discoverAuthoredToolSidecars` walk,
64
+ * keyed by its calling root — not from this npm-anchor walk.
65
+ *
66
+ * Scope flag: if a future release adds a third installed sub-source that needs
67
+ * distinct provenance, revisit whether the anchors walk should carry a source
68
+ * enum. Out of scope today.
69
+ */
70
+ export declare function discoverToolPackagesFromAnchors(sources: readonly ToolDiscoverySource[]): DiscoveredToolPackage[];
71
+ /**
72
+ * Read `name` and the resolved main entry of a discovered tool package.
73
+ * Mirrors readCheckPackageMetadata in shape but is exposed at the kernel
74
+ * level so any consumer (CLI, tests, future tooling) can resolve a tool
75
+ * package without depending on fitness.
76
+ */
77
+ export interface ToolPackageMetadata {
78
+ readonly name: string;
79
+ readonly mainEntry: string;
80
+ }
81
+ /**
82
+ * Resolve a tool directory's runtime entry.
83
+ *
84
+ * An INSTALLED npm tool resolves via `package.json` (`exports['.']` → `main` →
85
+ * `./index.js`). An AUTHORED tool has no `package.json` — it declares identity
86
+ * via an `opensip-tool.manifest.json` sidecar, so when the package.json resolver
87
+ * finds nothing, fall back to the sidecar: its `main` field (or `./index.js`
88
+ * default), with the directory name as the package name. This keeps the two
89
+ * discovery surfaces symmetric — one entry resolver serves both the npm and
90
+ * authored legs.
91
+ */
92
+ export declare function readToolPackageMetadata(packageDir: string): ToolPackageMetadata | undefined;
93
+ //# sourceMappingURL=tool-package-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-package-discovery.d.ts","sourceRoot":"","sources":["../../src/plugins/tool-package-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,MAAM,WAAW,2BAA2B;IAC1C,yCAAyC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,2BAA2B,GACnC,qBAAqB,EAAE,CAKzB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,SAAS,mBAAmB,EAAE,GACtC,qBAAqB,EAAE,CAezB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAI3F"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * @fileoverview Thin domain-typed wrapper around the generic marker
3
+ * walker for `kind: "tool"`.
4
+ *
5
+ * A Tool plugin is any npm package (scoped or unscoped, first- or third-
6
+ * party) whose `package.json` declares:
7
+ *
8
+ * { "opensipTools": { "kind": "tool" } }
9
+ *
10
+ * The walker itself lives in `marker-discovery.ts` — this file preserves
11
+ * the public surface (`discoverToolPackages`, `DiscoveredToolPackage`)
12
+ * existing CLI consumers depend on, and delegates the actual node_modules
13
+ * traversal to the shared primitive.
14
+ *
15
+ * Direct dependencies of opensip-cli are always loaded by the
16
+ * CLI's own import statements; this discovery exists so a user can
17
+ * install a third-party tool via `npm install` and have it picked up
18
+ * with no further wiring.
19
+ */
20
+ import { existsSync, readFileSync } from 'node:fs';
21
+ import { basename, join } from 'node:path';
22
+ import { isRecord } from './json-guards.js';
23
+ import { PROJECT_LOCAL_MANIFEST_FILE } from './manifest-loader.js';
24
+ import { discoverPackagesByMarker, discoverPackagesInNodeModules } from './marker-discovery.js';
25
+ import { resolvePackageEntryPoint } from './package-entry.js';
26
+ /**
27
+ * Walk up from `projectDir` looking for `node_modules/` directories
28
+ * containing packages with `opensipTools.kind === 'tool'`. Returns the
29
+ * deduplicated list (first-occurrence-wins by package name).
30
+ */
31
+ export function discoverToolPackages(options) {
32
+ return discoverPackagesByMarker({ projectDir: options.projectDir, kind: 'tool' }).map((pkg) => ({
33
+ name: pkg.name,
34
+ packageDir: pkg.packageDir,
35
+ }));
36
+ }
37
+ /**
38
+ * Discover tool packages across an ORDERED list of sources, deduplicated
39
+ * by package name with first-occurrence-wins. Order encodes precedence:
40
+ * an earlier source's package shadows a later same-named one (e.g. a
41
+ * project-local pin shadows a user-global install). Mirrors the
42
+ * ToolRegistry's own first-writer-wins on duplicate ids.
43
+ *
44
+ * **Provenance contract.** Every anchor yields `source: 'installed'`
45
+ * provenance regardless of which anchor it came from — the anchor distinction
46
+ * encodes PRECEDENCE/SHADOWING, NOT source. So the caller
47
+ * (`admitInstalledTool` in `register-tools.ts`) assigns `source: 'installed'`
48
+ * UNIFORMLY; a per-anchor source tag here would add no information and is
49
+ * deliberately NOT threaded. *Authored* provenance (`project-local` /
50
+ * `user-global`) comes from the separate `discoverAuthoredToolSidecars` walk,
51
+ * keyed by its calling root — not from this npm-anchor walk.
52
+ *
53
+ * Scope flag: if a future release adds a third installed sub-source that needs
54
+ * distinct provenance, revisit whether the anchors walk should carry a source
55
+ * enum. Out of scope today.
56
+ */
57
+ export function discoverToolPackagesFromAnchors(sources) {
58
+ const seen = new Set();
59
+ const out = [];
60
+ for (const src of sources) {
61
+ const found = src.mode === 'walkUp'
62
+ ? discoverPackagesByMarker({ projectDir: src.dir, kind: 'tool' })
63
+ : discoverPackagesInNodeModules(join(src.dir, 'node_modules'), 'tool');
64
+ for (const pkg of found) {
65
+ if (seen.has(pkg.name))
66
+ continue;
67
+ seen.add(pkg.name);
68
+ out.push({ name: pkg.name, packageDir: pkg.packageDir });
69
+ }
70
+ }
71
+ return out;
72
+ }
73
+ /**
74
+ * Resolve a tool directory's runtime entry.
75
+ *
76
+ * An INSTALLED npm tool resolves via `package.json` (`exports['.']` → `main` →
77
+ * `./index.js`). An AUTHORED tool has no `package.json` — it declares identity
78
+ * via an `opensip-tool.manifest.json` sidecar, so when the package.json resolver
79
+ * finds nothing, fall back to the sidecar: its `main` field (or `./index.js`
80
+ * default), with the directory name as the package name. This keeps the two
81
+ * discovery surfaces symmetric — one entry resolver serves both the npm and
82
+ * authored legs.
83
+ */
84
+ export function readToolPackageMetadata(packageDir) {
85
+ const resolved = resolvePackageEntryPoint(packageDir);
86
+ if (resolved)
87
+ return { name: resolved.name, mainEntry: resolved.entry };
88
+ return readAuthoredSidecarEntry(packageDir);
89
+ }
90
+ /**
91
+ * Resolve an authored tool's entry from its `opensip-tool.manifest.json`
92
+ * sidecar. Reads the sidecar's `main` (default `./index.js`) and `name`/`id`
93
+ * for the package name. Returns `undefined` when the sidecar is absent or
94
+ * unreadable (the caller treats that as "no resolvable entry").
95
+ */
96
+ function readAuthoredSidecarEntry(dir) {
97
+ const sidecarPath = join(dir, PROJECT_LOCAL_MANIFEST_FILE);
98
+ if (!existsSync(sidecarPath))
99
+ return undefined;
100
+ let parsed;
101
+ try {
102
+ parsed = JSON.parse(readFileSync(sidecarPath, 'utf8'));
103
+ }
104
+ catch {
105
+ // @fitness-ignore-next-line error-handling-quality -- malformed sidecar surfaces via undefined return; caller treats as "no resolvable entry" (mirrors resolvePackageEntryPoint's package.json contract).
106
+ return undefined;
107
+ }
108
+ if (!isRecord(parsed))
109
+ return undefined;
110
+ const rawMain = typeof parsed.main === 'string' && parsed.main.length > 0 ? parsed.main : './index.js';
111
+ // Name from the sidecar's name/id, falling back to the directory name (always
112
+ // present for a real authored-tool dir).
113
+ const name = (typeof parsed.name === 'string' && parsed.name) ||
114
+ (typeof parsed.id === 'string' && parsed.id) ||
115
+ basename(dir);
116
+ return { name, mainEntry: join(dir, rawMain) };
117
+ }
118
+ //# sourceMappingURL=tool-package-discovery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-package-discovery.js","sourceRoot":"","sources":["../../src/plugins/tool-package-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAc9D;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAoC;IAEpC,OAAO,wBAAwB,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC9F,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,UAAU,EAAE,GAAG,CAAC,UAAU;KAC3B,CAAC,CAAC,CAAC;AACN,CAAC;AAiBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,+BAA+B,CAC7C,OAAuC;IAEvC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,MAAM,KAAK,GACT,GAAG,CAAC,IAAI,KAAK,QAAQ;YACnB,CAAC,CAAC,wBAAwB,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;YACjE,CAAC,CAAC,6BAA6B,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;QAC3E,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;YACxB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,SAAS;YACjC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACnB,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAaD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACxD,MAAM,QAAQ,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;IACtD,IAAI,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxE,OAAO,wBAAwB,CAAC,UAAU,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,SAAS,wBAAwB,CAAC,GAAW;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,2BAA2B,CAAC,CAAC;IAC3D,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/C,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,0MAA0M;QAC1M,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,OAAO,GACX,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;IACzF,8EAA8E;IAC9E,yCAAyC;IACzC,MAAM,IAAI,GACR,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC;QAChD,CAAC,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ,IAAI,MAAM,CAAC,EAAE,CAAC;QAC5C,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC;AACjD,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @fileoverview Plugin contract types for opensip-cli
3
+ *
4
+ * Plugins can be npm packages or loose JS/MJS files.
5
+ *
6
+ * Tool-specific plugin export shapes (e.g. fitness's `FitPluginExports`,
7
+ * which references Check / FitnessRecipe types) live with the tool that
8
+ * owns them. This file holds the kernel-level types that any tool
9
+ * loader can use without dragging in tool-specific symbols.
10
+ */
11
+ import type { LanguageAdapter } from '../languages/adapter.js';
12
+ /** What a language plugin package/file exports */
13
+ export interface LangPluginExports {
14
+ readonly adapters?: readonly LanguageAdapter[];
15
+ }
16
+ /**
17
+ * Union of all plugin export shapes — kept open so tool-specific exports
18
+ * (e.g. fitness's FitPluginExports) can be assigned through structural
19
+ * compatibility. Each tool owns its own export-shape interface.
20
+ */
21
+ export type PluginExports = LangPluginExports | Record<string, unknown>;
22
+ /**
23
+ * Where a tool's project-local plugins live. Supplied by the tool (via
24
+ * its `Tool.pluginLayout` descriptor) and threaded into `discoverPlugins`
25
+ * / `loadAllPlugins`. The kernel never enumerates tool domains itself —
26
+ * this descriptor is the seam that keeps core tool-agnostic
27
+ * (ADR-0009 corollary 1 / M2).
28
+ */
29
+ export interface PluginLayout {
30
+ /**
31
+ * Path/domain segment. User loose-file plugins live under
32
+ * `<project>/opensip-cli/<domain>/<kind>/` and npm plugins under
33
+ * `<project>/opensip-cli/.runtime/plugins/<domain>/`. Also the key
34
+ * read from `opensip-cli.config.yml#plugins.<domain>`.
35
+ */
36
+ readonly domain: string;
37
+ /**
38
+ * User-source subdirectories walked for loose `.mjs`/`.js` plugins —
39
+ * e.g. `['checks', 'recipes']` for fitness, `['scenarios', 'recipes']`
40
+ * for simulation. Empty means no loose-file layout (npm plugins only).
41
+ */
42
+ readonly userSubdirs: readonly string[];
43
+ }
44
+ /** Discovered plugin before loading */
45
+ export interface DiscoveredPlugin {
46
+ readonly type: 'package' | 'file';
47
+ /** Absolute path to the entry point */
48
+ readonly entryPoint: string;
49
+ /** Namespace derived from package name or filename */
50
+ readonly namespace: string;
51
+ /** Package name (for npm packages) or filename (for loose files) */
52
+ readonly source: string;
53
+ }
54
+ /**
55
+ * Result of loading a single plugin. `registered` is a generic count
56
+ * map keyed by whatever artifact kinds the tool's `registerExports`
57
+ * callback reports (e.g. `{ checks: 3, recipes: 1 }`, `{ scenarios: 2 }`,
58
+ * `{ adapters: 1 }`). The kernel carries no tool-specific counter names
59
+ * (ADR-0009 M2) — it only sums the map.
60
+ */
61
+ export interface LoadedPlugin {
62
+ readonly namespace: string;
63
+ readonly source: string;
64
+ readonly type: 'package' | 'file';
65
+ /** Per-kind registration counts reported by the domain callback. */
66
+ readonly registered: Readonly<Record<string, number>>;
67
+ readonly error?: string;
68
+ }
69
+ /**
70
+ * Result of loading all plugins for a layout. `totals` is the
71
+ * per-kind sum across every loaded plugin's `registered` map.
72
+ */
73
+ export interface PluginLoadResult {
74
+ readonly plugins: readonly LoadedPlugin[];
75
+ readonly totals: Readonly<Record<string, number>>;
76
+ readonly errors: readonly string[];
77
+ }
78
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAM/D,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;CAChD;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAMxE;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAClC,uCAAuC;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAMD;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAClC,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @fileoverview Plugin contract types for opensip-cli
3
+ *
4
+ * Plugins can be npm packages or loose JS/MJS files.
5
+ *
6
+ * Tool-specific plugin export shapes (e.g. fitness's `FitPluginExports`,
7
+ * which references Check / FitnessRecipe types) live with the tool that
8
+ * owns them. This file holds the kernel-level types that any tool
9
+ * loader can use without dragging in tool-specific symbols.
10
+ */
11
+ export {};
12
+ // Note: there is deliberately NO `PluginDomain` type. A plugin domain is a
13
+ // plain `string` segment (see `PluginLayout.domain`); the kernel does not
14
+ // enumerate — nor even name — the first-party domains (ADR-0009 corollary 1).
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;AAwFH,2EAA2E;AAC3E,0EAA0E;AAC1E,8EAA8E"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=registry.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.test.d.ts","sourceRoot":"","sources":["../../../src/recipes/__tests__/registry.test.ts"],"names":[],"mappings":""}