@rpamis/comet 0.3.9 → 0.4.0-beta.1

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 (624) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +371 -222
  3. package/assets/manifest.json +33 -12
  4. package/assets/skills/comet/SKILL.md +87 -102
  5. package/assets/skills/comet/reference/auto-transition.md +1 -1
  6. package/assets/skills/comet/reference/comet-yaml-fields.md +11 -4
  7. package/assets/skills/comet/reference/context-recovery.md +12 -2
  8. package/assets/skills/comet/reference/debug-gate.md +17 -1
  9. package/assets/skills/comet/reference/decision-point.md +13 -2
  10. package/assets/skills/comet/reference/intent-frame.md +74 -0
  11. package/assets/skills/comet/reference/scripts.md +69 -0
  12. package/assets/skills/comet/reference/subagent-dispatch.md +79 -23
  13. package/assets/skills/comet/rules/comet-phase-guard.en.md +18 -10
  14. package/assets/skills/comet/rules/comet-phase-guard.md +17 -10
  15. package/assets/skills/comet/runtime/classic/checks.yaml +6 -0
  16. package/assets/skills/comet/runtime/classic/guardrails.yaml +13 -0
  17. package/assets/skills/comet/runtime/classic/skill.yaml +122 -0
  18. package/assets/skills/comet/scripts/comet-archive.mjs +3 -0
  19. package/assets/skills/comet/scripts/comet-env.mjs +15 -0
  20. package/assets/skills/comet/scripts/comet-guard.mjs +3 -0
  21. package/assets/skills/comet/scripts/comet-handoff.mjs +3 -0
  22. package/assets/skills/comet/scripts/comet-hook-guard.mjs +3 -0
  23. package/assets/skills/comet/scripts/comet-intent.mjs +3 -0
  24. package/assets/skills/comet/scripts/comet-runtime.mjs +12857 -0
  25. package/assets/skills/comet/scripts/comet-state.mjs +3 -0
  26. package/assets/skills/comet/scripts/comet-yaml-validate.mjs +3 -0
  27. package/assets/skills/comet-any/SKILL.md +118 -0
  28. package/assets/skills/comet-any/reference/authored-zone-example.md +100 -0
  29. package/assets/skills/comet-any/reference/authoring-protocol.json +91 -0
  30. package/assets/skills/comet-any/reference/authoring-subagents.md +102 -0
  31. package/assets/skills/comet-any/reference/bundle-authoring.md +166 -0
  32. package/assets/skills/comet-any/reference/eval-provider.md +83 -0
  33. package/assets/skills/comet-any/reference/subagents/pause-points-author.md +75 -0
  34. package/assets/skills/comet-any/reference/subagents/reference-author.md +77 -0
  35. package/assets/skills/comet-any/reference/subagents/script-author.md +81 -0
  36. package/assets/skills/comet-any/reference/subagents/skill-core-author.md +129 -0
  37. package/assets/skills/comet-any/reference/subagents/skill-reviewer.md +124 -0
  38. package/assets/skills/comet-any/reference/subagents/workflow-entry-author.md +100 -0
  39. package/assets/skills/comet-archive/SKILL.md +25 -15
  40. package/assets/skills/comet-build/SKILL.md +51 -40
  41. package/assets/skills/comet-design/SKILL.md +14 -18
  42. package/assets/skills/comet-hotfix/SKILL.md +33 -43
  43. package/assets/skills/comet-open/SKILL.md +10 -20
  44. package/assets/skills/comet-tweak/SKILL.md +71 -65
  45. package/assets/skills/comet-verify/SKILL.md +31 -35
  46. package/assets/skills-zh/comet/SKILL.md +87 -101
  47. package/assets/skills-zh/comet/reference/auto-transition.md +3 -3
  48. package/assets/skills-zh/comet/reference/comet-yaml-fields.md +8 -4
  49. package/assets/skills-zh/comet/reference/context-recovery.md +11 -1
  50. package/assets/skills-zh/comet/reference/debug-gate.md +17 -1
  51. package/assets/skills-zh/comet/reference/decision-point.md +13 -2
  52. package/assets/skills-zh/comet/reference/intent-frame.md +74 -0
  53. package/assets/skills-zh/comet/reference/scripts.md +69 -0
  54. package/assets/skills-zh/comet/reference/subagent-dispatch.md +67 -18
  55. package/assets/skills-zh/comet/runtime/classic/checks.yaml +6 -0
  56. package/assets/skills-zh/comet/runtime/classic/guardrails.yaml +13 -0
  57. package/assets/skills-zh/comet/runtime/classic/skill.yaml +122 -0
  58. package/assets/skills-zh/comet-any/SKILL.md +118 -0
  59. package/assets/skills-zh/comet-any/reference/authored-zone-example.md +100 -0
  60. package/assets/skills-zh/comet-any/reference/authoring-protocol.json +91 -0
  61. package/assets/skills-zh/comet-any/reference/authoring-subagents.md +107 -0
  62. package/assets/skills-zh/comet-any/reference/bundle-authoring.md +166 -0
  63. package/assets/skills-zh/comet-any/reference/eval-provider.md +66 -0
  64. package/assets/skills-zh/comet-any/reference/subagents/pause-points-author.md +79 -0
  65. package/assets/skills-zh/comet-any/reference/subagents/reference-author.md +81 -0
  66. package/assets/skills-zh/comet-any/reference/subagents/script-author.md +84 -0
  67. package/assets/skills-zh/comet-any/reference/subagents/skill-core-author.md +129 -0
  68. package/assets/skills-zh/comet-any/reference/subagents/skill-reviewer.md +124 -0
  69. package/assets/skills-zh/comet-any/reference/subagents/workflow-entry-author.md +98 -0
  70. package/assets/skills-zh/comet-archive/SKILL.md +25 -15
  71. package/assets/skills-zh/comet-build/SKILL.md +41 -43
  72. package/assets/skills-zh/comet-design/SKILL.md +14 -18
  73. package/assets/skills-zh/comet-hotfix/SKILL.md +37 -47
  74. package/assets/skills-zh/comet-open/SKILL.md +12 -22
  75. package/assets/skills-zh/comet-tweak/SKILL.md +70 -63
  76. package/assets/skills-zh/comet-verify/SKILL.md +28 -30
  77. package/bin/comet.js +1 -1
  78. package/dist/{cli → app/cli}/index.d.ts.map +1 -1
  79. package/dist/app/cli/index.js +430 -0
  80. package/dist/app/cli/index.js.map +1 -0
  81. package/dist/app/commands/bundle.d.ts +51 -0
  82. package/dist/app/commands/bundle.d.ts.map +1 -0
  83. package/dist/app/commands/bundle.js +387 -0
  84. package/dist/app/commands/bundle.js.map +1 -0
  85. package/dist/app/commands/creator.d.ts +14 -0
  86. package/dist/app/commands/creator.d.ts.map +1 -0
  87. package/dist/app/commands/creator.js +82 -0
  88. package/dist/app/commands/creator.js.map +1 -0
  89. package/dist/app/commands/dashboard.d.ts +16 -0
  90. package/dist/app/commands/dashboard.d.ts.map +1 -0
  91. package/dist/app/commands/dashboard.js +53 -0
  92. package/dist/app/commands/dashboard.js.map +1 -0
  93. package/dist/{commands → app/commands}/doctor.d.ts +1 -1
  94. package/dist/app/commands/doctor.d.ts.map +1 -0
  95. package/dist/{commands → app/commands}/doctor.js +110 -60
  96. package/dist/app/commands/doctor.js.map +1 -0
  97. package/dist/app/commands/eval.d.ts +17 -0
  98. package/dist/app/commands/eval.d.ts.map +1 -0
  99. package/dist/app/commands/eval.js +169 -0
  100. package/dist/app/commands/eval.js.map +1 -0
  101. package/dist/app/commands/i18n.d.ts +4 -0
  102. package/dist/app/commands/i18n.d.ts.map +1 -0
  103. package/dist/{commands → app/commands}/i18n.js +22 -2
  104. package/dist/app/commands/i18n.js.map +1 -0
  105. package/dist/{commands → app/commands}/init.d.ts +3 -1
  106. package/dist/app/commands/init.d.ts.map +1 -0
  107. package/dist/{commands → app/commands}/init.js +81 -31
  108. package/dist/app/commands/init.js.map +1 -0
  109. package/dist/app/commands/platform-select-prompt.d.ts +38 -0
  110. package/dist/app/commands/platform-select-prompt.d.ts.map +1 -0
  111. package/dist/app/commands/platform-select-prompt.js +141 -0
  112. package/dist/app/commands/platform-select-prompt.js.map +1 -0
  113. package/dist/app/commands/publish.d.ts +7 -0
  114. package/dist/app/commands/publish.d.ts.map +1 -0
  115. package/dist/app/commands/publish.js +14 -0
  116. package/dist/app/commands/publish.js.map +1 -0
  117. package/dist/app/commands/skill.d.ts +23 -0
  118. package/dist/app/commands/skill.d.ts.map +1 -0
  119. package/dist/app/commands/skill.js +208 -0
  120. package/dist/app/commands/skill.js.map +1 -0
  121. package/dist/app/commands/status.d.ts.map +1 -0
  122. package/dist/app/commands/status.js +159 -0
  123. package/dist/app/commands/status.js.map +1 -0
  124. package/dist/{commands → app/commands}/uninstall.d.ts +1 -1
  125. package/dist/app/commands/uninstall.d.ts.map +1 -0
  126. package/dist/{commands → app/commands}/uninstall.js +3 -3
  127. package/dist/app/commands/uninstall.js.map +1 -0
  128. package/dist/{commands → app/commands}/update.d.ts +4 -3
  129. package/dist/app/commands/update.d.ts.map +1 -0
  130. package/dist/{commands → app/commands}/update.js +33 -10
  131. package/dist/app/commands/update.js.map +1 -0
  132. package/dist/config/repository-layout.json +98 -0
  133. package/dist/domains/bundle/authoring.d.ts +82 -0
  134. package/dist/domains/bundle/authoring.d.ts.map +1 -0
  135. package/dist/domains/bundle/authoring.js +185 -0
  136. package/dist/domains/bundle/authoring.js.map +1 -0
  137. package/dist/domains/bundle/bundle-platform.d.ts +39 -0
  138. package/dist/domains/bundle/bundle-platform.d.ts.map +1 -0
  139. package/dist/domains/bundle/bundle-platform.js +287 -0
  140. package/dist/domains/bundle/bundle-platform.js.map +1 -0
  141. package/dist/domains/bundle/candidates.d.ts +29 -0
  142. package/dist/domains/bundle/candidates.d.ts.map +1 -0
  143. package/dist/domains/bundle/candidates.js +37 -0
  144. package/dist/domains/bundle/candidates.js.map +1 -0
  145. package/dist/domains/bundle/compatibility-benchmark.d.ts +12 -0
  146. package/dist/domains/bundle/compatibility-benchmark.d.ts.map +1 -0
  147. package/dist/domains/bundle/compatibility-benchmark.js +224 -0
  148. package/dist/domains/bundle/compatibility-benchmark.js.map +1 -0
  149. package/dist/domains/bundle/compiler.d.ts +5 -0
  150. package/dist/domains/bundle/compiler.d.ts.map +1 -0
  151. package/dist/domains/bundle/compiler.js +106 -0
  152. package/dist/domains/bundle/compiler.js.map +1 -0
  153. package/dist/domains/bundle/distribute.d.ts +33 -0
  154. package/dist/domains/bundle/distribute.d.ts.map +1 -0
  155. package/dist/domains/bundle/distribute.js +166 -0
  156. package/dist/domains/bundle/distribute.js.map +1 -0
  157. package/dist/domains/bundle/draft.d.ts +19 -0
  158. package/dist/domains/bundle/draft.d.ts.map +1 -0
  159. package/dist/domains/bundle/draft.js +82 -0
  160. package/dist/domains/bundle/draft.js.map +1 -0
  161. package/dist/domains/bundle/eval.d.ts +36 -0
  162. package/dist/domains/bundle/eval.d.ts.map +1 -0
  163. package/dist/domains/bundle/eval.js +501 -0
  164. package/dist/domains/bundle/eval.js.map +1 -0
  165. package/dist/domains/bundle/factory-compose.d.ts +12 -0
  166. package/dist/domains/bundle/factory-compose.d.ts.map +1 -0
  167. package/dist/domains/bundle/factory-compose.js +309 -0
  168. package/dist/domains/bundle/factory-compose.js.map +1 -0
  169. package/dist/domains/bundle/factory-guide.d.ts +37 -0
  170. package/dist/domains/bundle/factory-guide.d.ts.map +1 -0
  171. package/dist/domains/bundle/factory-guide.js +96 -0
  172. package/dist/domains/bundle/factory-guide.js.map +1 -0
  173. package/dist/domains/bundle/factory-plan.d.ts +48 -0
  174. package/dist/domains/bundle/factory-plan.d.ts.map +1 -0
  175. package/dist/domains/bundle/factory-plan.js +172 -0
  176. package/dist/domains/bundle/factory-plan.js.map +1 -0
  177. package/dist/domains/bundle/factory-proposal.d.ts +31 -0
  178. package/dist/domains/bundle/factory-proposal.d.ts.map +1 -0
  179. package/dist/domains/bundle/factory-proposal.js +225 -0
  180. package/dist/domains/bundle/factory-proposal.js.map +1 -0
  181. package/dist/domains/bundle/factory-resolve.d.ts +11 -0
  182. package/dist/domains/bundle/factory-resolve.d.ts.map +1 -0
  183. package/dist/domains/bundle/factory-resolve.js +121 -0
  184. package/dist/domains/bundle/factory-resolve.js.map +1 -0
  185. package/dist/domains/bundle/factory.d.ts +17 -0
  186. package/dist/domains/bundle/factory.d.ts.map +1 -0
  187. package/dist/domains/bundle/factory.js +511 -0
  188. package/dist/domains/bundle/factory.js.map +1 -0
  189. package/dist/domains/bundle/hash.d.ts +3 -0
  190. package/dist/domains/bundle/hash.d.ts.map +1 -0
  191. package/dist/domains/bundle/hash.js +72 -0
  192. package/dist/domains/bundle/hash.js.map +1 -0
  193. package/dist/domains/bundle/load.d.ts +4 -0
  194. package/dist/domains/bundle/load.d.ts.map +1 -0
  195. package/dist/domains/bundle/load.js +355 -0
  196. package/dist/domains/bundle/load.js.map +1 -0
  197. package/dist/domains/bundle/next-action.d.ts +37 -0
  198. package/dist/domains/bundle/next-action.d.ts.map +1 -0
  199. package/dist/domains/bundle/next-action.js +185 -0
  200. package/dist/domains/bundle/next-action.js.map +1 -0
  201. package/dist/domains/bundle/platform.d.ts +21 -0
  202. package/dist/domains/bundle/platform.d.ts.map +1 -0
  203. package/dist/domains/bundle/platform.js +170 -0
  204. package/dist/domains/bundle/platform.js.map +1 -0
  205. package/dist/domains/bundle/preferences.d.ts +11 -0
  206. package/dist/domains/bundle/preferences.d.ts.map +1 -0
  207. package/dist/domains/bundle/preferences.js +17 -0
  208. package/dist/domains/bundle/preferences.js.map +1 -0
  209. package/dist/domains/bundle/publish.d.ts +14 -0
  210. package/dist/domains/bundle/publish.d.ts.map +1 -0
  211. package/dist/domains/bundle/publish.js +159 -0
  212. package/dist/domains/bundle/publish.js.map +1 -0
  213. package/dist/domains/bundle/readiness-user-summary.d.ts +25 -0
  214. package/dist/domains/bundle/readiness-user-summary.d.ts.map +1 -0
  215. package/dist/domains/bundle/readiness-user-summary.js +186 -0
  216. package/dist/domains/bundle/readiness-user-summary.js.map +1 -0
  217. package/dist/domains/bundle/review-summary.d.ts +36 -0
  218. package/dist/domains/bundle/review-summary.d.ts.map +1 -0
  219. package/dist/domains/bundle/review-summary.js +348 -0
  220. package/dist/domains/bundle/review-summary.js.map +1 -0
  221. package/dist/domains/bundle/state.d.ts +7 -0
  222. package/dist/domains/bundle/state.d.ts.map +1 -0
  223. package/dist/domains/bundle/state.js +132 -0
  224. package/dist/domains/bundle/state.js.map +1 -0
  225. package/dist/domains/bundle/types.d.ts +347 -0
  226. package/dist/domains/bundle/types.d.ts.map +1 -0
  227. package/dist/domains/bundle/types.js.map +1 -0
  228. package/dist/domains/bundle/user-facing.d.ts +48 -0
  229. package/dist/domains/bundle/user-facing.d.ts.map +1 -0
  230. package/dist/domains/bundle/user-facing.js +73 -0
  231. package/dist/domains/bundle/user-facing.js.map +1 -0
  232. package/dist/domains/bundle/validate.d.ts +5 -0
  233. package/dist/domains/bundle/validate.d.ts.map +1 -0
  234. package/dist/domains/bundle/validate.js +292 -0
  235. package/dist/domains/bundle/validate.js.map +1 -0
  236. package/dist/domains/comet-classic/classic-archive-entry.d.ts +2 -0
  237. package/dist/domains/comet-classic/classic-archive-entry.d.ts.map +1 -0
  238. package/dist/domains/comet-classic/classic-archive-entry.js +4 -0
  239. package/dist/domains/comet-classic/classic-archive-entry.js.map +1 -0
  240. package/dist/domains/comet-classic/classic-archive.d.ts +3 -0
  241. package/dist/domains/comet-classic/classic-archive.d.ts.map +1 -0
  242. package/dist/domains/comet-classic/classic-archive.js +392 -0
  243. package/dist/domains/comet-classic/classic-archive.js.map +1 -0
  244. package/dist/domains/comet-classic/classic-cli.d.ts +15 -0
  245. package/dist/domains/comet-classic/classic-cli.d.ts.map +1 -0
  246. package/dist/domains/comet-classic/classic-cli.js +94 -0
  247. package/dist/domains/comet-classic/classic-cli.js.map +1 -0
  248. package/dist/domains/comet-classic/classic-diagnostics.d.ts +16 -0
  249. package/dist/domains/comet-classic/classic-diagnostics.d.ts.map +1 -0
  250. package/dist/domains/comet-classic/classic-diagnostics.js +57 -0
  251. package/dist/domains/comet-classic/classic-diagnostics.js.map +1 -0
  252. package/dist/domains/comet-classic/classic-evidence.d.ts +10 -0
  253. package/dist/domains/comet-classic/classic-evidence.d.ts.map +1 -0
  254. package/dist/domains/comet-classic/classic-evidence.js +114 -0
  255. package/dist/domains/comet-classic/classic-evidence.js.map +1 -0
  256. package/dist/domains/comet-classic/classic-guard-entry.d.ts +2 -0
  257. package/dist/domains/comet-classic/classic-guard-entry.d.ts.map +1 -0
  258. package/dist/domains/comet-classic/classic-guard-entry.js +4 -0
  259. package/dist/domains/comet-classic/classic-guard-entry.js.map +1 -0
  260. package/dist/domains/comet-classic/classic-guard.d.ts +3 -0
  261. package/dist/domains/comet-classic/classic-guard.d.ts.map +1 -0
  262. package/dist/domains/comet-classic/classic-guard.js +833 -0
  263. package/dist/domains/comet-classic/classic-guard.js.map +1 -0
  264. package/dist/domains/comet-classic/classic-handoff-entry.d.ts +2 -0
  265. package/dist/domains/comet-classic/classic-handoff-entry.d.ts.map +1 -0
  266. package/dist/domains/comet-classic/classic-handoff-entry.js +4 -0
  267. package/dist/domains/comet-classic/classic-handoff-entry.js.map +1 -0
  268. package/dist/domains/comet-classic/classic-handoff.d.ts +3 -0
  269. package/dist/domains/comet-classic/classic-handoff.d.ts.map +1 -0
  270. package/dist/domains/comet-classic/classic-handoff.js +478 -0
  271. package/dist/domains/comet-classic/classic-handoff.js.map +1 -0
  272. package/dist/domains/comet-classic/classic-hook-guard-entry.d.ts +2 -0
  273. package/dist/domains/comet-classic/classic-hook-guard-entry.d.ts.map +1 -0
  274. package/dist/domains/comet-classic/classic-hook-guard-entry.js +4 -0
  275. package/dist/domains/comet-classic/classic-hook-guard-entry.js.map +1 -0
  276. package/dist/domains/comet-classic/classic-hook-guard.d.ts +3 -0
  277. package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -0
  278. package/dist/domains/comet-classic/classic-hook-guard.js +302 -0
  279. package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -0
  280. package/dist/domains/comet-classic/classic-intent-command.d.ts +3 -0
  281. package/dist/domains/comet-classic/classic-intent-command.d.ts.map +1 -0
  282. package/dist/domains/comet-classic/classic-intent-command.js +40 -0
  283. package/dist/domains/comet-classic/classic-intent-command.js.map +1 -0
  284. package/dist/domains/comet-classic/classic-intent-entry.d.ts +2 -0
  285. package/dist/domains/comet-classic/classic-intent-entry.d.ts.map +1 -0
  286. package/dist/domains/comet-classic/classic-intent-entry.js +4 -0
  287. package/dist/domains/comet-classic/classic-intent-entry.js.map +1 -0
  288. package/dist/domains/comet-classic/classic-intent.d.ts +79 -0
  289. package/dist/domains/comet-classic/classic-intent.d.ts.map +1 -0
  290. package/dist/domains/comet-classic/classic-intent.js +307 -0
  291. package/dist/domains/comet-classic/classic-intent.js.map +1 -0
  292. package/dist/domains/comet-classic/classic-migrate.d.ts +18 -0
  293. package/dist/domains/comet-classic/classic-migrate.d.ts.map +1 -0
  294. package/dist/domains/comet-classic/classic-migrate.js +184 -0
  295. package/dist/domains/comet-classic/classic-migrate.js.map +1 -0
  296. package/dist/domains/comet-classic/classic-paths.d.ts +8 -0
  297. package/dist/domains/comet-classic/classic-paths.d.ts.map +1 -0
  298. package/dist/domains/comet-classic/classic-paths.js +61 -0
  299. package/dist/domains/comet-classic/classic-paths.js.map +1 -0
  300. package/dist/domains/comet-classic/classic-resolver.d.ts +10 -0
  301. package/dist/domains/comet-classic/classic-resolver.d.ts.map +1 -0
  302. package/dist/domains/comet-classic/classic-resolver.js +89 -0
  303. package/dist/domains/comet-classic/classic-resolver.js.map +1 -0
  304. package/dist/domains/comet-classic/classic-runtime-evals.d.ts +9 -0
  305. package/dist/domains/comet-classic/classic-runtime-evals.d.ts.map +1 -0
  306. package/dist/domains/comet-classic/classic-runtime-evals.js +45 -0
  307. package/dist/domains/comet-classic/classic-runtime-evals.js.map +1 -0
  308. package/dist/domains/comet-classic/classic-runtime-run.d.ts +7 -0
  309. package/dist/domains/comet-classic/classic-runtime-run.d.ts.map +1 -0
  310. package/dist/domains/comet-classic/classic-runtime-run.js +105 -0
  311. package/dist/domains/comet-classic/classic-runtime-run.js.map +1 -0
  312. package/dist/domains/comet-classic/classic-script-entry.d.ts +3 -0
  313. package/dist/domains/comet-classic/classic-script-entry.d.ts.map +1 -0
  314. package/dist/domains/comet-classic/classic-script-entry.js +31 -0
  315. package/dist/domains/comet-classic/classic-script-entry.js.map +1 -0
  316. package/dist/domains/comet-classic/classic-state-command.d.ts +3 -0
  317. package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -0
  318. package/dist/domains/comet-classic/classic-state-command.js +984 -0
  319. package/dist/domains/comet-classic/classic-state-command.js.map +1 -0
  320. package/dist/domains/comet-classic/classic-state-entry.d.ts +2 -0
  321. package/dist/domains/comet-classic/classic-state-entry.d.ts.map +1 -0
  322. package/dist/domains/comet-classic/classic-state-entry.js +4 -0
  323. package/dist/domains/comet-classic/classic-state-entry.js.map +1 -0
  324. package/dist/domains/comet-classic/classic-state-events.d.ts +18 -0
  325. package/dist/domains/comet-classic/classic-state-events.d.ts.map +1 -0
  326. package/dist/domains/comet-classic/classic-state-events.js +15 -0
  327. package/dist/domains/comet-classic/classic-state-events.js.map +1 -0
  328. package/dist/domains/comet-classic/classic-state.d.ts +69 -0
  329. package/dist/domains/comet-classic/classic-state.d.ts.map +1 -0
  330. package/dist/domains/comet-classic/classic-state.js +238 -0
  331. package/dist/domains/comet-classic/classic-state.js.map +1 -0
  332. package/dist/domains/comet-classic/classic-store.d.ts +7 -0
  333. package/dist/domains/comet-classic/classic-store.d.ts.map +1 -0
  334. package/dist/domains/comet-classic/classic-store.js +127 -0
  335. package/dist/domains/comet-classic/classic-store.js.map +1 -0
  336. package/dist/domains/comet-classic/classic-transitions.d.ts +24 -0
  337. package/dist/domains/comet-classic/classic-transitions.d.ts.map +1 -0
  338. package/dist/domains/comet-classic/classic-transitions.js +124 -0
  339. package/dist/domains/comet-classic/classic-transitions.js.map +1 -0
  340. package/dist/domains/comet-classic/classic-validate-command.d.ts +3 -0
  341. package/dist/domains/comet-classic/classic-validate-command.d.ts.map +1 -0
  342. package/dist/domains/comet-classic/classic-validate-command.js +154 -0
  343. package/dist/domains/comet-classic/classic-validate-command.js.map +1 -0
  344. package/dist/domains/comet-classic/classic-validate-entry.d.ts +2 -0
  345. package/dist/domains/comet-classic/classic-validate-entry.d.ts.map +1 -0
  346. package/dist/domains/comet-classic/classic-validate-entry.js +4 -0
  347. package/dist/domains/comet-classic/classic-validate-entry.js.map +1 -0
  348. package/dist/domains/comet-classic/index.d.ts +20 -0
  349. package/dist/domains/comet-classic/index.d.ts.map +1 -0
  350. package/dist/domains/comet-classic/index.js +20 -0
  351. package/dist/domains/comet-classic/index.js.map +1 -0
  352. package/dist/domains/dashboard/collector.d.ts +12 -0
  353. package/dist/domains/dashboard/collector.d.ts.map +1 -0
  354. package/dist/domains/dashboard/collector.js +475 -0
  355. package/dist/domains/dashboard/collector.js.map +1 -0
  356. package/dist/domains/dashboard/git.d.ts +8 -0
  357. package/dist/domains/dashboard/git.d.ts.map +1 -0
  358. package/dist/domains/dashboard/git.js +69 -0
  359. package/dist/domains/dashboard/git.js.map +1 -0
  360. package/dist/domains/dashboard/next-action.d.ts +17 -0
  361. package/dist/domains/dashboard/next-action.d.ts.map +1 -0
  362. package/dist/domains/dashboard/next-action.js +83 -0
  363. package/dist/domains/dashboard/next-action.js.map +1 -0
  364. package/dist/domains/dashboard/open-browser.d.ts +9 -0
  365. package/dist/domains/dashboard/open-browser.d.ts.map +1 -0
  366. package/dist/domains/dashboard/open-browser.js +40 -0
  367. package/dist/domains/dashboard/open-browser.js.map +1 -0
  368. package/dist/domains/dashboard/risk.d.ts +24 -0
  369. package/dist/domains/dashboard/risk.d.ts.map +1 -0
  370. package/dist/domains/dashboard/risk.js +97 -0
  371. package/dist/domains/dashboard/risk.js.map +1 -0
  372. package/dist/domains/dashboard/server.d.ts +21 -0
  373. package/dist/domains/dashboard/server.d.ts.map +1 -0
  374. package/dist/domains/dashboard/server.js +149 -0
  375. package/dist/domains/dashboard/server.js.map +1 -0
  376. package/dist/domains/dashboard/task-parser.d.ts +13 -0
  377. package/dist/domains/dashboard/task-parser.d.ts.map +1 -0
  378. package/dist/domains/dashboard/task-parser.js +82 -0
  379. package/dist/domains/dashboard/task-parser.js.map +1 -0
  380. package/dist/domains/dashboard/types.d.ts +122 -0
  381. package/dist/domains/dashboard/types.d.ts.map +1 -0
  382. package/dist/domains/dashboard/types.js +10 -0
  383. package/dist/domains/dashboard/types.js.map +1 -0
  384. package/dist/domains/dashboard/verify-parser.d.ts +18 -0
  385. package/dist/domains/dashboard/verify-parser.d.ts.map +1 -0
  386. package/dist/domains/dashboard/verify-parser.js +94 -0
  387. package/dist/domains/dashboard/verify-parser.js.map +1 -0
  388. package/dist/domains/dashboard/web/assets/demo-DQyfozbi.js +1 -0
  389. package/dist/domains/dashboard/web/assets/index-BcO3_QlT.css +1 -0
  390. package/dist/domains/dashboard/web/assets/index-CjU3VXVu.js +22 -0
  391. package/dist/domains/dashboard/web/favicon.png +0 -0
  392. package/dist/domains/dashboard/web/index.html +16 -0
  393. package/dist/domains/dashboard/yaml.d.ts +13 -0
  394. package/dist/domains/dashboard/yaml.d.ts.map +1 -0
  395. package/dist/domains/dashboard/yaml.js +61 -0
  396. package/dist/domains/dashboard/yaml.js.map +1 -0
  397. package/dist/domains/engine/evals.d.ts +4 -0
  398. package/dist/domains/engine/evals.d.ts.map +1 -0
  399. package/dist/domains/engine/evals.js +25 -0
  400. package/dist/domains/engine/evals.js.map +1 -0
  401. package/dist/domains/engine/guardrails.d.ts +10 -0
  402. package/dist/domains/engine/guardrails.d.ts.map +1 -0
  403. package/dist/domains/engine/guardrails.js +25 -0
  404. package/dist/domains/engine/guardrails.js.map +1 -0
  405. package/dist/domains/engine/loop.d.ts +15 -0
  406. package/dist/domains/engine/loop.d.ts.map +1 -0
  407. package/dist/domains/engine/loop.js +126 -0
  408. package/dist/domains/engine/loop.js.map +1 -0
  409. package/dist/domains/engine/manual-run.d.ts +30 -0
  410. package/dist/domains/engine/manual-run.d.ts.map +1 -0
  411. package/dist/domains/engine/manual-run.js +184 -0
  412. package/dist/domains/engine/manual-run.js.map +1 -0
  413. package/dist/domains/engine/resolver.d.ts +20 -0
  414. package/dist/domains/engine/resolver.d.ts.map +1 -0
  415. package/dist/domains/engine/resolver.js +36 -0
  416. package/dist/domains/engine/resolver.js.map +1 -0
  417. package/dist/domains/engine/run-store.d.ts +13 -0
  418. package/dist/domains/engine/run-store.d.ts.map +1 -0
  419. package/dist/domains/engine/run-store.js +100 -0
  420. package/dist/domains/engine/run-store.js.map +1 -0
  421. package/dist/domains/engine/runtime-types.d.ts +11 -0
  422. package/dist/domains/engine/runtime-types.d.ts.map +1 -0
  423. package/dist/domains/engine/runtime-types.js +2 -0
  424. package/dist/domains/engine/runtime-types.js.map +1 -0
  425. package/dist/domains/engine/standalone-run.d.ts +13 -0
  426. package/dist/domains/engine/standalone-run.d.ts.map +1 -0
  427. package/dist/domains/engine/standalone-run.js +27 -0
  428. package/dist/domains/engine/standalone-run.js.map +1 -0
  429. package/dist/domains/engine/state.d.ts +10 -0
  430. package/dist/domains/engine/state.d.ts.map +1 -0
  431. package/dist/domains/engine/state.js +160 -0
  432. package/dist/domains/engine/state.js.map +1 -0
  433. package/dist/domains/engine/types.d.ts +51 -0
  434. package/dist/domains/engine/types.d.ts.map +1 -0
  435. package/dist/domains/engine/types.js +2 -0
  436. package/dist/domains/engine/types.js.map +1 -0
  437. package/dist/domains/eval/index.d.ts +7 -0
  438. package/dist/domains/eval/index.d.ts.map +1 -0
  439. package/dist/domains/eval/index.js +11 -0
  440. package/dist/domains/eval/index.js.map +1 -0
  441. package/dist/domains/eval/repository-benchmarks.d.ts +6 -0
  442. package/dist/domains/eval/repository-benchmarks.d.ts.map +1 -0
  443. package/dist/domains/eval/repository-benchmarks.js +10 -0
  444. package/dist/domains/eval/repository-benchmarks.js.map +1 -0
  445. package/dist/domains/factory/artifacts.d.ts +53 -0
  446. package/dist/domains/factory/artifacts.d.ts.map +1 -0
  447. package/dist/domains/factory/artifacts.js +8 -0
  448. package/dist/domains/factory/artifacts.js.map +1 -0
  449. package/dist/domains/factory/package.d.ts +7 -0
  450. package/dist/domains/factory/package.d.ts.map +1 -0
  451. package/dist/domains/factory/package.js +1511 -0
  452. package/dist/domains/factory/package.js.map +1 -0
  453. package/dist/domains/factory/types.d.ts +127 -0
  454. package/dist/domains/factory/types.d.ts.map +1 -0
  455. package/dist/domains/factory/types.js +2 -0
  456. package/dist/domains/factory/types.js.map +1 -0
  457. package/dist/{core → domains/integrations}/codegraph.d.ts +1 -1
  458. package/dist/domains/integrations/codegraph.d.ts.map +1 -0
  459. package/dist/{core → domains/integrations}/codegraph.js +1 -1
  460. package/dist/domains/integrations/codegraph.js.map +1 -0
  461. package/dist/domains/integrations/openspec.d.ts +18 -0
  462. package/dist/domains/integrations/openspec.d.ts.map +1 -0
  463. package/dist/{core → domains/integrations}/openspec.js +102 -25
  464. package/dist/domains/integrations/openspec.js.map +1 -0
  465. package/dist/{core → domains/integrations}/superpowers.d.ts +10 -2
  466. package/dist/domains/integrations/superpowers.d.ts.map +1 -0
  467. package/dist/{core → domains/integrations}/superpowers.js +59 -13
  468. package/dist/domains/integrations/superpowers.js.map +1 -0
  469. package/dist/domains/skill/discovery.d.ts +17 -0
  470. package/dist/domains/skill/discovery.d.ts.map +1 -0
  471. package/dist/domains/skill/discovery.js +80 -0
  472. package/dist/domains/skill/discovery.js.map +1 -0
  473. package/dist/domains/skill/find.d.ts +41 -0
  474. package/dist/domains/skill/find.d.ts.map +1 -0
  475. package/dist/domains/skill/find.js +251 -0
  476. package/dist/domains/skill/find.js.map +1 -0
  477. package/dist/domains/skill/install.d.ts +11 -0
  478. package/dist/domains/skill/install.d.ts.map +1 -0
  479. package/dist/domains/skill/install.js +82 -0
  480. package/dist/domains/skill/install.js.map +1 -0
  481. package/dist/domains/skill/inventory.d.ts +19 -0
  482. package/dist/domains/skill/inventory.d.ts.map +1 -0
  483. package/dist/domains/skill/inventory.js +64 -0
  484. package/dist/domains/skill/inventory.js.map +1 -0
  485. package/dist/domains/skill/languages.d.ts +19 -0
  486. package/dist/domains/skill/languages.d.ts.map +1 -0
  487. package/dist/domains/skill/languages.js +21 -0
  488. package/dist/domains/skill/languages.js.map +1 -0
  489. package/dist/domains/skill/load.d.ts +5 -0
  490. package/dist/domains/skill/load.d.ts.map +1 -0
  491. package/dist/domains/skill/load.js +313 -0
  492. package/dist/domains/skill/load.js.map +1 -0
  493. package/dist/domains/skill/platform-install.d.ts +87 -0
  494. package/dist/domains/skill/platform-install.d.ts.map +1 -0
  495. package/dist/{core/skills.js → domains/skill/platform-install.js} +243 -51
  496. package/dist/domains/skill/platform-install.js.map +1 -0
  497. package/dist/domains/skill/preferences.d.ts +42 -0
  498. package/dist/domains/skill/preferences.d.ts.map +1 -0
  499. package/dist/domains/skill/preferences.js +118 -0
  500. package/dist/domains/skill/preferences.js.map +1 -0
  501. package/dist/domains/skill/snapshot.d.ts +8 -0
  502. package/dist/domains/skill/snapshot.d.ts.map +1 -0
  503. package/dist/domains/skill/snapshot.js +184 -0
  504. package/dist/domains/skill/snapshot.js.map +1 -0
  505. package/dist/domains/skill/types.d.ts +85 -0
  506. package/dist/domains/skill/types.d.ts.map +1 -0
  507. package/dist/domains/skill/types.js +2 -0
  508. package/dist/{core → domains/skill}/types.js.map +1 -1
  509. package/dist/{core → domains/skill}/uninstall.d.ts +2 -18
  510. package/dist/domains/skill/uninstall.d.ts.map +1 -0
  511. package/dist/{core → domains/skill}/uninstall.js +15 -66
  512. package/dist/domains/skill/uninstall.js.map +1 -0
  513. package/dist/domains/skill/validate.d.ts +3 -0
  514. package/dist/domains/skill/validate.d.ts.map +1 -0
  515. package/dist/domains/skill/validate.js +81 -0
  516. package/dist/domains/skill/validate.js.map +1 -0
  517. package/dist/domains/workflow-contract/builtins.d.ts +8 -0
  518. package/dist/domains/workflow-contract/builtins.d.ts.map +1 -0
  519. package/dist/domains/workflow-contract/builtins.js +229 -0
  520. package/dist/domains/workflow-contract/builtins.js.map +1 -0
  521. package/dist/domains/workflow-contract/hash.d.ts +3 -0
  522. package/dist/domains/workflow-contract/hash.d.ts.map +1 -0
  523. package/dist/domains/workflow-contract/hash.js +16 -0
  524. package/dist/domains/workflow-contract/hash.js.map +1 -0
  525. package/dist/domains/workflow-contract/index.d.ts +6 -0
  526. package/dist/domains/workflow-contract/index.d.ts.map +1 -0
  527. package/dist/domains/workflow-contract/index.js +5 -0
  528. package/dist/domains/workflow-contract/index.js.map +1 -0
  529. package/dist/domains/workflow-contract/normalize.d.ts +3 -0
  530. package/dist/domains/workflow-contract/normalize.d.ts.map +1 -0
  531. package/dist/domains/workflow-contract/normalize.js +146 -0
  532. package/dist/domains/workflow-contract/normalize.js.map +1 -0
  533. package/dist/domains/workflow-contract/types.d.ts +128 -0
  534. package/dist/domains/workflow-contract/types.d.ts.map +1 -0
  535. package/dist/domains/workflow-contract/types.js +2 -0
  536. package/dist/domains/workflow-contract/types.js.map +1 -0
  537. package/dist/domains/workflow-contract/validation.d.ts +3 -0
  538. package/dist/domains/workflow-contract/validation.d.ts.map +1 -0
  539. package/dist/domains/workflow-contract/validation.js +180 -0
  540. package/dist/domains/workflow-contract/validation.js.map +1 -0
  541. package/dist/platform/fs/file-system.d.ts.map +1 -0
  542. package/dist/platform/fs/file-system.js.map +1 -0
  543. package/dist/platform/install/detect.d.ts.map +1 -0
  544. package/dist/{core → platform/install}/detect.js +4 -3
  545. package/dist/platform/install/detect.js.map +1 -0
  546. package/dist/platform/install/platforms.d.ts.map +1 -0
  547. package/dist/{core → platform/install}/platforms.js +41 -0
  548. package/dist/platform/install/platforms.js.map +1 -0
  549. package/dist/platform/install/types.d.ts +3 -0
  550. package/dist/platform/install/types.d.ts.map +1 -0
  551. package/dist/platform/install/types.js +2 -0
  552. package/dist/platform/install/types.js.map +1 -0
  553. package/dist/platform/paths/repository-layout.d.ts +22 -0
  554. package/dist/platform/paths/repository-layout.d.ts.map +1 -0
  555. package/dist/platform/paths/repository-layout.js +11 -0
  556. package/dist/platform/paths/repository-layout.js.map +1 -0
  557. package/dist/platform/process/command-error.d.ts.map +1 -0
  558. package/dist/platform/process/command-error.js.map +1 -0
  559. package/dist/platform/process/shell-quote.d.ts +22 -0
  560. package/dist/platform/process/shell-quote.d.ts.map +1 -0
  561. package/dist/platform/process/shell-quote.js +34 -0
  562. package/dist/platform/process/shell-quote.js.map +1 -0
  563. package/dist/platform/version/version.d.ts.map +1 -0
  564. package/dist/{core → platform/version}/version.js +16 -3
  565. package/dist/platform/version/version.js.map +1 -0
  566. package/package.json +39 -13
  567. package/assets/skills/comet/scripts/comet-archive.sh +0 -311
  568. package/assets/skills/comet/scripts/comet-env.sh +0 -110
  569. package/assets/skills/comet/scripts/comet-guard.sh +0 -778
  570. package/assets/skills/comet/scripts/comet-handoff.sh +0 -390
  571. package/assets/skills/comet/scripts/comet-hook-guard.sh +0 -336
  572. package/assets/skills/comet/scripts/comet-state.sh +0 -1338
  573. package/assets/skills/comet/scripts/comet-yaml-validate.sh +0 -225
  574. package/dist/cli/index.js +0 -84
  575. package/dist/cli/index.js.map +0 -1
  576. package/dist/commands/doctor.d.ts.map +0 -1
  577. package/dist/commands/doctor.js.map +0 -1
  578. package/dist/commands/i18n.d.ts +0 -4
  579. package/dist/commands/i18n.d.ts.map +0 -1
  580. package/dist/commands/i18n.js.map +0 -1
  581. package/dist/commands/init.d.ts.map +0 -1
  582. package/dist/commands/init.js.map +0 -1
  583. package/dist/commands/status.d.ts.map +0 -1
  584. package/dist/commands/status.js +0 -108
  585. package/dist/commands/status.js.map +0 -1
  586. package/dist/commands/uninstall.d.ts.map +0 -1
  587. package/dist/commands/uninstall.js.map +0 -1
  588. package/dist/commands/update.d.ts.map +0 -1
  589. package/dist/commands/update.js.map +0 -1
  590. package/dist/core/codegraph.d.ts.map +0 -1
  591. package/dist/core/codegraph.js.map +0 -1
  592. package/dist/core/command-error.d.ts.map +0 -1
  593. package/dist/core/command-error.js.map +0 -1
  594. package/dist/core/detect.d.ts.map +0 -1
  595. package/dist/core/detect.js.map +0 -1
  596. package/dist/core/openspec.d.ts +0 -11
  597. package/dist/core/openspec.d.ts.map +0 -1
  598. package/dist/core/openspec.js.map +0 -1
  599. package/dist/core/platforms.d.ts.map +0 -1
  600. package/dist/core/platforms.js.map +0 -1
  601. package/dist/core/skills.d.ts +0 -58
  602. package/dist/core/skills.d.ts.map +0 -1
  603. package/dist/core/skills.js.map +0 -1
  604. package/dist/core/superpowers.d.ts.map +0 -1
  605. package/dist/core/superpowers.js.map +0 -1
  606. package/dist/core/types.d.ts +0 -2
  607. package/dist/core/types.d.ts.map +0 -1
  608. package/dist/core/uninstall.d.ts.map +0 -1
  609. package/dist/core/uninstall.js.map +0 -1
  610. package/dist/core/version.d.ts.map +0 -1
  611. package/dist/core/version.js.map +0 -1
  612. package/dist/utils/file-system.d.ts.map +0 -1
  613. package/dist/utils/file-system.js.map +0 -1
  614. /package/dist/{cli → app/cli}/index.d.ts +0 -0
  615. /package/dist/{commands → app/commands}/status.d.ts +0 -0
  616. /package/dist/{core → domains/bundle}/types.js +0 -0
  617. /package/dist/{utils → platform/fs}/file-system.d.ts +0 -0
  618. /package/dist/{utils → platform/fs}/file-system.js +0 -0
  619. /package/dist/{core → platform/install}/detect.d.ts +0 -0
  620. /package/dist/{core → platform/install}/platforms.d.ts +0 -0
  621. /package/dist/{core → platform/process}/command-error.d.ts +0 -0
  622. /package/dist/{core → platform/process}/command-error.js +0 -0
  623. /package/dist/{core → platform/version}/version.d.ts +0 -0
  624. /package/scripts/{postinstall.js → install/postinstall.js} +0 -0
@@ -0,0 +1,287 @@
1
+ import path from 'path';
2
+ import { promises as fs } from 'fs';
3
+ import { copyFile, ensureDir, fileExists, writeFile } from '../../platform/fs/file-system.js';
4
+ import { computeRuleDestPath, formatRuleContent } from '../skill/platform-install.js';
5
+ import { getPlatformSkillsDir, PLATFORMS, } from '../../platform/install/platforms.js';
6
+ function rulesRoot(platform, baseDir, scope) {
7
+ if (!platform.rulesDir || !platform.rulesFormat)
8
+ return null;
9
+ const rulesBase = platform.rulesBaseDir !== undefined
10
+ ? platform.rulesBaseDir === ''
11
+ ? baseDir
12
+ : path.join(baseDir, platform.rulesBaseDir)
13
+ : path.join(baseDir, getPlatformSkillsDir(platform, scope));
14
+ return path.join(rulesBase, platform.rulesDir);
15
+ }
16
+ export function listBundlePlatformTargets(options) {
17
+ const baseDir = options.scope === 'global' ? options.homeDir : options.projectRoot;
18
+ return PLATFORMS.map((platform) => {
19
+ const platformRoot = path.join(baseDir, getPlatformSkillsDir(platform, options.scope));
20
+ const capabilities = new Set(['skills', 'scripts', 'references', 'assets']);
21
+ if (platform.rulesDir && platform.rulesFormat)
22
+ capabilities.add('rules');
23
+ if (platform.supportsHooks && platform.hookFormat)
24
+ capabilities.add('hooks');
25
+ if (platform.id === 'claude')
26
+ capabilities.add('agents');
27
+ return {
28
+ id: platform.id,
29
+ name: platform.name,
30
+ platform,
31
+ layout: {
32
+ platform: platform.id,
33
+ scope: options.scope,
34
+ baseDir,
35
+ skillsRoot: path.join(platformRoot, 'skills'),
36
+ rulesRoot: rulesRoot(platform, baseDir, options.scope),
37
+ hooksSupported: capabilities.has('hooks'),
38
+ scriptsRoot: path.join(platformRoot, 'skills', '.comet-bundles'),
39
+ agentsRoot: platform.id === 'claude' ? path.join(platformRoot, 'agents') : null,
40
+ },
41
+ capabilities,
42
+ };
43
+ });
44
+ }
45
+ export function planBundleRule(target, rule) {
46
+ const format = target.platform.rulesFormat;
47
+ if (!target.layout.rulesRoot || !format)
48
+ return [];
49
+ if (rule.mode === 'matched' && format === 'md')
50
+ return [];
51
+ return [
52
+ {
53
+ source: rule.source,
54
+ destination: computeRuleDestPath(target.layout.rulesRoot, path.basename(rule.path), format),
55
+ kind: 'rule',
56
+ operation: {
57
+ type: 'rule',
58
+ format,
59
+ mode: rule.mode,
60
+ ...(rule.match ? { match: rule.match } : {}),
61
+ },
62
+ },
63
+ ];
64
+ }
65
+ function hookDestination(target, hookId) {
66
+ const platformRoot = path.dirname(target.layout.skillsRoot);
67
+ switch (target.platform.hookFormat) {
68
+ case 'claude-code':
69
+ return path.join(platformRoot, 'settings.local.json');
70
+ case 'qwen':
71
+ case 'qoder':
72
+ case 'gemini':
73
+ return path.join(platformRoot, 'settings.json');
74
+ case 'windsurf':
75
+ return path.join(platformRoot, 'hooks.json');
76
+ case 'copilot':
77
+ return path.join(platformRoot, 'hooks', `${hookId}.json`);
78
+ case 'kiro':
79
+ return path.join(platformRoot, 'hooks', `${hookId}.kiro.hook`);
80
+ default:
81
+ return null;
82
+ }
83
+ }
84
+ function scriptDestination(target, bundleName, script) {
85
+ return path.join(target.layout.scriptsRoot, bundleName, ...script.path.replace(/^scripts\//, 'scripts/').split('/'));
86
+ }
87
+ function scriptCommand(script, destination) {
88
+ const executable = script.runtime === 'node' ? 'node' : script.runtime === 'python' ? 'python' : 'bash';
89
+ return `${executable} ${quoteCommandPath(destination)}`;
90
+ }
91
+ function quoteCommandPath(destination) {
92
+ const normalized = destination.replaceAll('\\', '/');
93
+ if (/^[A-Za-z0-9_./:-]+$/u.test(normalized))
94
+ return normalized;
95
+ return `"${normalized.replaceAll('"', '\\"')}"`;
96
+ }
97
+ export function planBundleHook(target, hook, scripts, bundleName = 'bundle', installedScriptDestination, commandScriptPath) {
98
+ const format = target.platform.hookFormat;
99
+ const destination = hookDestination(target, hook.id);
100
+ if (!target.layout.hooksSupported || !format || !destination)
101
+ return null;
102
+ if (!['before_tool', 'before_write'].includes(hook.event))
103
+ return null;
104
+ const script = scripts.find((item) => item.id === hook.script);
105
+ if (!script || !target.layout.scriptsRoot)
106
+ return null;
107
+ const installedScript = installedScriptDestination ?? scriptDestination(target, bundleName, script);
108
+ const command = scriptCommand(script, commandScriptPath ?? installedScript);
109
+ return {
110
+ files: [
111
+ {
112
+ source: hook.source,
113
+ destination,
114
+ kind: 'hook',
115
+ operation: {
116
+ type: 'hook',
117
+ format,
118
+ event: hook.event,
119
+ ...(hook.matcher ? { matcher: hook.matcher } : {}),
120
+ command,
121
+ failure: hook.failure,
122
+ requiresConfirmation: hook.requiresConfirmation,
123
+ },
124
+ },
125
+ ],
126
+ disclosure: {
127
+ id: hook.id,
128
+ command,
129
+ sideEffect: script.sideEffect,
130
+ destination,
131
+ },
132
+ };
133
+ }
134
+ export function planBundleOverride(target, override, kind) {
135
+ const prefix = `overrides/${target.id}/`;
136
+ const relative = override.path.startsWith(prefix)
137
+ ? override.path.slice(prefix.length)
138
+ : path.basename(override.path);
139
+ return {
140
+ source: override.source,
141
+ destination: path.join(path.dirname(target.layout.skillsRoot), ...relative.split('/')),
142
+ kind,
143
+ };
144
+ }
145
+ function hookMatcher(file) {
146
+ if (file.operation?.type !== 'hook')
147
+ return '*';
148
+ if (file.operation.matcher)
149
+ return file.operation.matcher;
150
+ return file.operation.event === 'before_write' ? 'Write|Edit' : '*';
151
+ }
152
+ function readJsonObject(value, file) {
153
+ if (value.trim() === '')
154
+ return {};
155
+ const parsed = JSON.parse(value);
156
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
157
+ throw new Error(`Invalid JSON object at ${file}`);
158
+ }
159
+ return parsed;
160
+ }
161
+ async function readExistingJson(file) {
162
+ if (!(await fileExists(file)))
163
+ return {};
164
+ return readJsonObject(await fs.readFile(file, 'utf8'), file);
165
+ }
166
+ function asHookGroups(value) {
167
+ return Array.isArray(value) ? value : [];
168
+ }
169
+ function mergeCommandHookGroup(existingGroups, matcher, hook, command) {
170
+ const groups = existingGroups
171
+ .map((group) => {
172
+ if (!Array.isArray(group.hooks))
173
+ return group;
174
+ return {
175
+ ...group,
176
+ hooks: group.hooks.filter((entry) => !entry ||
177
+ typeof entry !== 'object' ||
178
+ entry.command !== command),
179
+ };
180
+ })
181
+ .filter((group) => !Array.isArray(group.hooks) || group.hooks.length > 0);
182
+ const group = groups.find((candidate) => candidate.matcher === matcher && Array.isArray(candidate.hooks));
183
+ if (group) {
184
+ group.hooks = [...group.hooks, hook];
185
+ }
186
+ else {
187
+ groups.push({ matcher, hooks: [hook] });
188
+ }
189
+ return groups;
190
+ }
191
+ async function applyHookInstallFile(file) {
192
+ const operation = file.operation;
193
+ if (operation?.type !== 'hook') {
194
+ throw new Error(`Install file ${file.destination} is not a hook operation`);
195
+ }
196
+ const matcher = hookMatcher(file);
197
+ const settings = await readExistingJson(file.destination);
198
+ const hooks = settings.hooks ?? {};
199
+ const commandHook = { type: 'command', command: operation.command };
200
+ switch (operation.format) {
201
+ case 'claude-code':
202
+ case 'qwen':
203
+ case 'qoder': {
204
+ hooks.PreToolUse = mergeCommandHookGroup(asHookGroups(hooks.PreToolUse), matcher, commandHook, operation.command);
205
+ settings.hooks = hooks;
206
+ await writeFile(file.destination, JSON.stringify(settings, null, 2) + '\n');
207
+ return;
208
+ }
209
+ case 'gemini': {
210
+ const geminiMatcher = matcher === 'Write|Edit' ? 'write_file|edit_file' : matcher;
211
+ hooks.BeforeTool = mergeCommandHookGroup(asHookGroups(hooks.BeforeTool), geminiMatcher, { ...commandHook, name: file.kind }, operation.command);
212
+ settings.hooks = hooks;
213
+ await writeFile(file.destination, JSON.stringify(settings, null, 2) + '\n');
214
+ return;
215
+ }
216
+ case 'windsurf': {
217
+ const existing = asHookGroups(hooks.pre_write_code).filter((entry) => entry.command !== operation.command);
218
+ hooks.pre_write_code = [...existing, { command: operation.command, show_output: true }];
219
+ settings.hooks = hooks;
220
+ await writeFile(file.destination, JSON.stringify(settings, null, 2) + '\n');
221
+ return;
222
+ }
223
+ case 'copilot': {
224
+ const hookFile = await readExistingJson(file.destination);
225
+ const existingHooks = hookFile.hooks ?? {};
226
+ const preToolUse = Array.isArray(existingHooks.preToolUse)
227
+ ? existingHooks.preToolUse.filter((entry) => {
228
+ if (!entry || typeof entry !== 'object')
229
+ return true;
230
+ const value = entry;
231
+ return value.bash !== operation.command && value.powershell !== operation.command;
232
+ })
233
+ : [];
234
+ hookFile.version = hookFile.version ?? 1;
235
+ hookFile.hooks = {
236
+ ...existingHooks,
237
+ preToolUse: [...preToolUse, { bash: operation.command, powershell: operation.command }],
238
+ };
239
+ await writeFile(file.destination, JSON.stringify(hookFile, null, 2) + '\n');
240
+ return;
241
+ }
242
+ case 'kiro': {
243
+ const hookFile = await readExistingJson(file.destination);
244
+ const toolName = matcher === 'Write|Edit' ? 'write' : matcher;
245
+ await writeFile(file.destination, JSON.stringify({
246
+ ...hookFile,
247
+ enabled: true,
248
+ name: hookFile.name ?? path.basename(file.destination),
249
+ description: hookFile.description ?? path.basename(file.destination),
250
+ version: hookFile.version ?? '1',
251
+ when: { type: 'preToolUse', toolName },
252
+ then: { type: 'runCommand', command: operation.command },
253
+ }, null, 2) + '\n');
254
+ return;
255
+ }
256
+ }
257
+ }
258
+ async function applyInstallFile(file, overwrite) {
259
+ if (file.operation?.type === 'hook') {
260
+ await applyHookInstallFile(file);
261
+ return 'written';
262
+ }
263
+ if (!overwrite && (await fileExists(file.destination))) {
264
+ return 'skipped';
265
+ }
266
+ await ensureDir(path.dirname(file.destination));
267
+ if (file.operation?.type === 'rule') {
268
+ const content = await fs.readFile(file.source, 'utf8');
269
+ await writeFile(file.destination, formatRuleContent(content, path.basename(file.source), file.operation.format));
270
+ return 'written';
271
+ }
272
+ await copyFile(file.source, file.destination);
273
+ return 'written';
274
+ }
275
+ export async function applyPlatformInstallPlan(options) {
276
+ const written = [];
277
+ const skipped = [];
278
+ for (const file of options.files) {
279
+ const result = await applyInstallFile(file, options.overwrite);
280
+ if (result === 'written')
281
+ written.push(file.destination);
282
+ else
283
+ skipped.push(file.destination);
284
+ }
285
+ return { written, skipped };
286
+ }
287
+ //# sourceMappingURL=bundle-platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle-platform.js","sourceRoot":"","sources":["../../../domains/bundle/bundle-platform.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AAOpC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EACL,oBAAoB,EACpB,SAAS,GAEV,MAAM,qCAAqC,CAAC;AAqB7C,SAAS,SAAS,CAChB,QAAkB,EAClB,OAAe,EACf,KAA2B;IAE3B,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAC7D,MAAM,SAAS,GACb,QAAQ,CAAC,YAAY,KAAK,SAAS;QACjC,CAAC,CAAC,QAAQ,CAAC,YAAY,KAAK,EAAE;YAC5B,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC;QAC7C,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;IA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string;
4
+ preferenceIndex: number | null;
5
+ platform: string;
6
+ scope: FoundSkillSource['origin'];
7
+ origin: FoundSkillSource['origin'];
8
+ factory?: {
9
+ query: string;
10
+ };
11
+ root: string;
12
+ description: string;
13
+ skillMd: string;
14
+ references?: FoundSkillSource['references'];
15
+ scripts?: FoundSkillSource['scripts'];
16
+ hash: string;
17
+ }
18
+ export interface BundleCandidate {
19
+ name: string;
20
+ preferenceIndex: number | null;
21
+ status: 'available' | 'missing' | 'ambiguous';
22
+ sources: BundleCandidateSource[];
23
+ }
24
+ export declare function discoverBundleCandidates(options: {
25
+ projectRoot: string;
26
+ homeDir?: string;
27
+ preferences?: string[] | null;
28
+ }): Promise<BundleCandidate[]>;
29
+ //# sourceMappingURL=candidates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"candidates.d.ts","sourceRoot":"","sources":["../../../domains/bundle/candidates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE9E,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAClC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;IAC9C,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAC/B,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAkC7B"}
@@ -0,0 +1,37 @@
1
+ import os from 'os';
2
+ import path from 'path';
3
+ import { findPreferredSkills } from '../skill/find.js';
4
+ export async function discoverBundleCandidates(options) {
5
+ const preferences = options.preferences === undefined
6
+ ? undefined
7
+ : (options.preferences?.map((query, preferenceIndex) => ({ query, preferenceIndex })) ??
8
+ null);
9
+ const found = await findPreferredSkills({
10
+ projectRoot: options.projectRoot,
11
+ homeDir: options.homeDir ?? os.homedir(),
12
+ builtinRoot: path.join(options.projectRoot, '.comet', '__bundle_builtin_disabled__'),
13
+ preferences,
14
+ });
15
+ return found.map((candidate) => ({
16
+ name: candidate.query,
17
+ preferenceIndex: candidate.preferenceIndex,
18
+ status: candidate.status,
19
+ sources: candidate.sources.map((source) => ({
20
+ name: source.name,
21
+ preferenceIndex: candidate.preferenceIndex,
22
+ platform: source.platform ?? source.origin,
23
+ scope: source.origin,
24
+ origin: source.origin,
25
+ factory: {
26
+ query: candidate.query,
27
+ },
28
+ root: source.root,
29
+ description: source.description,
30
+ skillMd: source.skillMd,
31
+ references: source.references,
32
+ scripts: source.scripts,
33
+ hash: source.hash,
34
+ })),
35
+ }));
36
+ }
37
+ //# sourceMappingURL=candidates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"candidates.js","sourceRoot":"","sources":["../../../domains/bundle/candidates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAA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E,MAAM,CAAC,WAAW;YAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC,CAAC;KACJ,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,12 @@
1
+ export interface CometBundleCompatibilityResult {
2
+ platforms: number;
3
+ skillContractRate: number;
4
+ ruleContractRate: number;
5
+ hookContractRate: number;
6
+ referenceContractRate: number;
7
+ pathContractRate: number;
8
+ }
9
+ export declare function runCometBundleCompatibilityBenchmark(options: {
10
+ repoRoot: string;
11
+ }): Promise<CometBundleCompatibilityResult>;
12
+ //# sourceMappingURL=compatibility-benchmark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility-benchmark.d.ts","sourceRoot":"","sources":["../../../domains/bundle/compatibility-benchmark.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,8BAA8B;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AA6ID,wBAAsB,oCAAoC,CAAC,OAAO,EAAE;IAClE,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAuH1C"}
@@ -0,0 +1,224 @@
1
+ import { promises as fs } from 'fs';
2
+ import os from 'os';
3
+ import path from 'path';
4
+ import { stringify } from 'yaml';
5
+ import { compileBundleIr } from './compiler.js';
6
+ import { loadBundle } from './load.js';
7
+ import { compileBundleForPlatform } from './platform.js';
8
+ import { listBundlePlatformTargets } from './bundle-platform.js';
9
+ import { computeRuleDestPath } from '../skill/platform-install.js';
10
+ function rate(counter) {
11
+ return counter.total === 0 ? 1 : counter.passed / counter.total;
12
+ }
13
+ function record(counter, passed) {
14
+ counter.total++;
15
+ if (passed)
16
+ counter.passed++;
17
+ }
18
+ function compareBuffers(left, right) {
19
+ return left.equals(right);
20
+ }
21
+ async function exists(target) {
22
+ try {
23
+ await fs.access(target);
24
+ return true;
25
+ }
26
+ catch {
27
+ return false;
28
+ }
29
+ }
30
+ function topLevelSkillNames(paths) {
31
+ return [
32
+ ...new Set(paths.flatMap((relative) => {
33
+ const parts = relative.split('/');
34
+ return parts.length === 2 && parts[1] === 'SKILL.md' ? [parts[0]] : [];
35
+ })),
36
+ ];
37
+ }
38
+ function resourceId(relative) {
39
+ return path
40
+ .basename(relative)
41
+ .replace(/\.[^.]+$/, '')
42
+ .replace(/[^a-zA-Z0-9-]+/g, '-');
43
+ }
44
+ async function createCurrentCometBundle(repoRoot, root) {
45
+ const assetsRoot = path.join(repoRoot, 'assets');
46
+ const manifest = JSON.parse(await fs.readFile(path.join(assetsRoot, 'manifest.json'), 'utf8'));
47
+ const managed = [...manifest.skills, ...(manifest.internalSkills ?? [])];
48
+ const entryNames = topLevelSkillNames(manifest.skills);
49
+ const internalNames = topLevelSkillNames(manifest.internalSkills ?? []);
50
+ const skillNames = [...new Set([...entryNames, ...internalNames])];
51
+ for (const name of skillNames) {
52
+ await fs.cp(path.join(assetsRoot, 'skills', name), path.join(root, 'skills', name), {
53
+ recursive: true,
54
+ });
55
+ const localized = path.join(assetsRoot, 'skills-zh', name);
56
+ if (await exists(localized)) {
57
+ await fs.cp(localized, path.join(root, 'locales', 'zh', 'skills', name), {
58
+ recursive: true,
59
+ });
60
+ }
61
+ }
62
+ const scriptPaths = manifest.skills.filter((relative) => relative.includes('/scripts/'));
63
+ const referencePaths = manifest.skills.filter((relative) => relative.includes('/reference/'));
64
+ const rulePaths = manifest.rules ?? [];
65
+ const hookEntries = Object.entries(manifest.hooks ?? {});
66
+ const hookScript = hookEntries[0]?.[0];
67
+ const hookScriptId = hookScript ? resourceId(hookScript) : null;
68
+ if (hookScript && hookScriptId) {
69
+ await fs.mkdir(path.join(root, 'hooks'), { recursive: true });
70
+ await fs.writeFile(path.join(root, 'hooks', 'comet-phase-guard.yaml'), stringify({
71
+ event: 'before_write',
72
+ matcher: manifest.hooks[hookScript].matcher,
73
+ script: hookScriptId,
74
+ failure: 'block',
75
+ requiresConfirmation: false,
76
+ }));
77
+ }
78
+ const bundleManifest = {
79
+ apiVersion: 'comet/v1alpha1',
80
+ kind: 'SkillBundle',
81
+ metadata: {
82
+ name: 'comet-current',
83
+ version: manifest.version,
84
+ description: 'Current Comet managed asset compatibility fixture',
85
+ defaultLocale: 'en',
86
+ locales: ['en', 'zh'],
87
+ },
88
+ skills: [
89
+ ...entryNames.map((name) => ({
90
+ id: name,
91
+ path: `skills/${name}`,
92
+ visibility: 'entry',
93
+ })),
94
+ ...internalNames.map((name) => ({
95
+ id: name,
96
+ path: `skills/${name}`,
97
+ visibility: 'internal',
98
+ })),
99
+ ],
100
+ resources: {
101
+ rules: rulePaths.map((relative) => ({
102
+ id: resourceId(relative),
103
+ path: `skills/${relative}`,
104
+ mode: 'always',
105
+ required: true,
106
+ })),
107
+ hooks: hookScript && hookScriptId
108
+ ? [{ id: 'comet-phase-guard', path: 'hooks/comet-phase-guard.yaml' }]
109
+ : [],
110
+ references: referencePaths.map((relative) => `skills/${relative}`),
111
+ scripts: scriptPaths.map((relative) => ({
112
+ id: resourceId(relative),
113
+ path: `skills/${relative}`,
114
+ sideEffect: 'read',
115
+ runtime: relative.endsWith('.mjs') ? 'node' : 'bash',
116
+ })),
117
+ assets: [],
118
+ },
119
+ platforms: {
120
+ requires: ['skills'],
121
+ optional: ['rules', 'hooks', 'scripts', 'references'],
122
+ overrides: [],
123
+ },
124
+ engine: { enabled: false },
125
+ };
126
+ await fs.writeFile(path.join(root, 'bundle.yaml'), stringify(bundleManifest));
127
+ return { ...manifest, skills: managed };
128
+ }
129
+ async function sameFile(left, right) {
130
+ return compareBuffers(await fs.readFile(left), await fs.readFile(right));
131
+ }
132
+ export async function runCometBundleCompatibilityBenchmark(options) {
133
+ const temporary = await fs.mkdtemp(path.join(os.tmpdir(), 'comet-bundle-compat-'));
134
+ const bundleRoot = path.join(temporary, 'bundle');
135
+ const targetRoot = path.join(temporary, 'target');
136
+ await fs.mkdir(bundleRoot, { recursive: true });
137
+ try {
138
+ const current = await createCurrentCometBundle(options.repoRoot, bundleRoot);
139
+ const bundle = await loadBundle(bundleRoot);
140
+ const irByLocale = {
141
+ en: await compileBundleIr(bundle, { locale: 'en' }),
142
+ zh: await compileBundleIr(bundle, { locale: 'zh' }),
143
+ };
144
+ const targets = listBundlePlatformTargets({
145
+ projectRoot: targetRoot,
146
+ homeDir: path.join(temporary, 'home'),
147
+ scope: 'project',
148
+ });
149
+ const skill = { passed: 0, total: 0 };
150
+ const rule = { passed: 0, total: 0 };
151
+ const hook = { passed: 0, total: 0 };
152
+ const reference = { passed: 0, total: 0 };
153
+ const paths = { passed: 0, total: 0 };
154
+ const referencePaths = current.skills.filter((relative) => relative.includes('/reference/'));
155
+ for (const target of targets) {
156
+ for (const locale of ['en', 'zh']) {
157
+ const report = await compileBundleForPlatform(irByLocale[locale], target, {
158
+ projectRoot: targetRoot,
159
+ scope: 'project',
160
+ locale,
161
+ });
162
+ const languageDir = locale === 'zh' ? 'skills-zh' : 'skills';
163
+ for (const relative of current.skills) {
164
+ const sourceDir = relative.includes('/scripts/') ? 'skills' : languageDir;
165
+ const expectedSource = path.join(options.repoRoot, 'assets', sourceDir, relative);
166
+ const destination = path.join(target.layout.skillsRoot, ...relative.split('/'));
167
+ const actual = report.files.find((file) => file.kind === 'skill' && path.normalize(file.destination) === destination);
168
+ record(paths, Boolean(actual));
169
+ record(skill, Boolean(actual) && (await sameFile(actual.source, expectedSource)));
170
+ }
171
+ for (const relative of referencePaths) {
172
+ const expectedSource = path.join(options.repoRoot, 'assets', languageDir, relative);
173
+ const destination = path.join(target.layout.skillsRoot, ...relative.split('/'));
174
+ const actual = report.files.find((file) => file.kind === 'skill' && path.normalize(file.destination) === destination);
175
+ record(reference, Boolean(actual) && (await sameFile(actual.source, expectedSource)));
176
+ }
177
+ }
178
+ const report = await compileBundleForPlatform(irByLocale.en, target, {
179
+ projectRoot: targetRoot,
180
+ scope: 'project',
181
+ locale: 'en',
182
+ });
183
+ for (const relative of current.rules ?? []) {
184
+ if (target.layout.rulesRoot && target.platform.rulesFormat) {
185
+ const destination = computeRuleDestPath(target.layout.rulesRoot, path.basename(relative), target.platform.rulesFormat);
186
+ const actual = report.files.find((file) => file.kind === 'rule' && path.normalize(file.destination) === destination);
187
+ record(rule, Boolean(actual) &&
188
+ actual.operation?.type === 'rule' &&
189
+ actual.operation.format === target.platform.rulesFormat);
190
+ }
191
+ else {
192
+ record(rule, report.unsupported.some((item) => item.capability === 'rules') &&
193
+ !report.files.some((file) => file.kind === 'rule'));
194
+ }
195
+ }
196
+ const hookScript = Object.keys(current.hooks ?? {})[0];
197
+ if (hookScript) {
198
+ if (target.layout.hooksSupported) {
199
+ const expectedScript = path
200
+ .relative(target.layout.baseDir, path.join(target.layout.skillsRoot, ...hookScript.split('/')))
201
+ .replaceAll('\\', '/');
202
+ record(hook, report.files.some((file) => file.kind === 'hook') &&
203
+ report.executableDisclosures.some((item) => item.command.replaceAll('\\', '/').endsWith(expectedScript)));
204
+ }
205
+ else {
206
+ record(hook, report.unsupported.some((item) => item.capability === 'hooks') &&
207
+ !report.files.some((file) => file.kind === 'hook'));
208
+ }
209
+ }
210
+ }
211
+ return {
212
+ platforms: targets.length,
213
+ skillContractRate: rate(skill),
214
+ ruleContractRate: rate(rule),
215
+ hookContractRate: rate(hook),
216
+ referenceContractRate: rate(reference),
217
+ pathContractRate: rate(paths),
218
+ };
219
+ }
220
+ finally {
221
+ await fs.rm(temporary, { recursive: true, force: true });
222
+ }
223
+ }
224
+ //# sourceMappingURL=compatibility-benchmark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility-benchmark.js","sourceRoot":"","s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S,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { BundleCompilerIr, SkillBundle } from './types.js';
2
+ export declare function compileBundleIr(bundle: SkillBundle, options?: {
3
+ locale?: string;
4
+ }): Promise<BundleCompilerIr>;
5
+ //# sourceMappingURL=compiler.d.ts.map