@imgly/codesign-mcp 0.1.6 → 0.1.7

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 (360) hide show
  1. package/README.md +5 -10
  2. package/dist/cli/http.d.ts.map +1 -1
  3. package/dist/cli/http.js +12 -2
  4. package/dist/cli/http.js.map +1 -1
  5. package/dist/cli/stdio.d.ts.map +1 -1
  6. package/dist/cli/stdio.js +103 -35
  7. package/dist/cli/stdio.js.map +1 -1
  8. package/dist/config.d.ts +11 -2
  9. package/dist/config.d.ts.map +1 -1
  10. package/dist/config.js +12 -1
  11. package/dist/config.js.map +1 -1
  12. package/dist/diagnostics/events.d.ts +6 -0
  13. package/dist/diagnostics/events.d.ts.map +1 -1
  14. package/dist/diagnostics/events.js.map +1 -1
  15. package/dist/engine/cesdk-adapter.d.ts +5 -1
  16. package/dist/engine/cesdk-adapter.d.ts.map +1 -1
  17. package/dist/engine/cesdk-adapter.js +8 -1
  18. package/dist/engine/cesdk-adapter.js.map +1 -1
  19. package/dist/engine/engine-capacity.d.ts +16 -0
  20. package/dist/engine/engine-capacity.d.ts.map +1 -0
  21. package/dist/engine/engine-capacity.js +48 -0
  22. package/dist/engine/engine-capacity.js.map +1 -0
  23. package/dist/engine/engine-slots.d.ts +48 -0
  24. package/dist/engine/engine-slots.d.ts.map +1 -0
  25. package/dist/engine/engine-slots.js +182 -0
  26. package/dist/engine/engine-slots.js.map +1 -0
  27. package/dist/tools/engine.d.ts +13 -0
  28. package/dist/tools/engine.d.ts.map +1 -1
  29. package/dist/tools/engine.js +28 -0
  30. package/dist/tools/engine.js.map +1 -1
  31. package/package.json +2 -2
  32. package/dist/dashboard/router.d.ts +0 -3
  33. package/dist/dashboard/router.d.ts.map +0 -1
  34. package/dist/dashboard/router.js +0 -19
  35. package/dist/dashboard/router.js.map +0 -1
  36. package/dist/dashboard/spa-assets.generated.d.ts +0 -2
  37. package/dist/dashboard/spa-assets.generated.d.ts.map +0 -1
  38. package/dist/dashboard/spa-assets.generated.js +0 -220
  39. package/dist/dashboard/spa-assets.generated.js.map +0 -1
  40. package/dist/metrics/mount.d.ts +0 -11
  41. package/dist/metrics/mount.d.ts.map +0 -1
  42. package/dist/metrics/mount.js +0 -13
  43. package/dist/metrics/mount.js.map +0 -1
  44. package/dist/metrics/recorder.d.ts +0 -55
  45. package/dist/metrics/recorder.d.ts.map +0 -1
  46. package/dist/metrics/recorder.js +0 -97
  47. package/dist/metrics/recorder.js.map +0 -1
  48. package/dist/test/scripts/changelog-add.d.ts +0 -8
  49. package/dist/test/scripts/changelog-add.d.ts.map +0 -1
  50. package/dist/test/scripts/changelog-add.js +0 -50
  51. package/dist/test/scripts/changelog-add.js.map +0 -1
  52. package/dist/test/scripts/changelog-collate.d.ts +0 -38
  53. package/dist/test/scripts/changelog-collate.d.ts.map +0 -1
  54. package/dist/test/scripts/changelog-collate.js +0 -171
  55. package/dist/test/scripts/changelog-collate.js.map +0 -1
  56. package/dist/test/test/changelog.test.d.ts +0 -2
  57. package/dist/test/test/changelog.test.d.ts.map +0 -1
  58. package/dist/test/test/changelog.test.js +0 -293
  59. package/dist/test/test/changelog.test.js.map +0 -1
  60. package/dist/test/test/cli/dispatcher.test.d.ts +0 -2
  61. package/dist/test/test/cli/dispatcher.test.d.ts.map +0 -1
  62. package/dist/test/test/cli/dispatcher.test.js +0 -54
  63. package/dist/test/test/cli/dispatcher.test.js.map +0 -1
  64. package/dist/test/test/cli/redirect-console.test.d.ts +0 -2
  65. package/dist/test/test/cli/redirect-console.test.d.ts.map +0 -1
  66. package/dist/test/test/cli/redirect-console.test.js +0 -78
  67. package/dist/test/test/cli/redirect-console.test.js.map +0 -1
  68. package/dist/test/test/cli/resolve-license.test.d.ts +0 -2
  69. package/dist/test/test/cli/resolve-license.test.d.ts.map +0 -1
  70. package/dist/test/test/cli/resolve-license.test.js +0 -29
  71. package/dist/test/test/cli/resolve-license.test.js.map +0 -1
  72. package/dist/test/test/cli/stdio-diagnostics.test.d.ts +0 -2
  73. package/dist/test/test/cli/stdio-diagnostics.test.d.ts.map +0 -1
  74. package/dist/test/test/cli/stdio-diagnostics.test.js +0 -31
  75. package/dist/test/test/cli/stdio-diagnostics.test.js.map +0 -1
  76. package/dist/test/test/cli/stdio-license.test.d.ts +0 -2
  77. package/dist/test/test/cli/stdio-license.test.d.ts.map +0 -1
  78. package/dist/test/test/cli/stdio-license.test.js +0 -19
  79. package/dist/test/test/cli/stdio-license.test.js.map +0 -1
  80. package/dist/test/test/config.test.d.ts +0 -2
  81. package/dist/test/test/config.test.d.ts.map +0 -1
  82. package/dist/test/test/config.test.js +0 -95
  83. package/dist/test/test/config.test.js.map +0 -1
  84. package/dist/test/test/cross-ref.test.d.ts +0 -2
  85. package/dist/test/test/cross-ref.test.d.ts.map +0 -1
  86. package/dist/test/test/cross-ref.test.js +0 -39
  87. package/dist/test/test/cross-ref.test.js.map +0 -1
  88. package/dist/test/test/diagnostics/bundle.test.d.ts +0 -2
  89. package/dist/test/test/diagnostics/bundle.test.d.ts.map +0 -1
  90. package/dist/test/test/diagnostics/bundle.test.js +0 -53
  91. package/dist/test/test/diagnostics/bundle.test.js.map +0 -1
  92. package/dist/test/test/diagnostics/compose.test.d.ts +0 -2
  93. package/dist/test/test/diagnostics/compose.test.d.ts.map +0 -1
  94. package/dist/test/test/diagnostics/compose.test.js +0 -31
  95. package/dist/test/test/diagnostics/compose.test.js.map +0 -1
  96. package/dist/test/test/diagnostics/file-sink.test.d.ts +0 -2
  97. package/dist/test/test/diagnostics/file-sink.test.d.ts.map +0 -1
  98. package/dist/test/test/diagnostics/file-sink.test.js +0 -113
  99. package/dist/test/test/diagnostics/file-sink.test.js.map +0 -1
  100. package/dist/test/test/diagnostics/redact.test.d.ts +0 -2
  101. package/dist/test/test/diagnostics/redact.test.d.ts.map +0 -1
  102. package/dist/test/test/diagnostics/redact.test.js +0 -59
  103. package/dist/test/test/diagnostics/redact.test.js.map +0 -1
  104. package/dist/test/test/diagnostics/tool-call-adapter.test.d.ts +0 -2
  105. package/dist/test/test/diagnostics/tool-call-adapter.test.d.ts.map +0 -1
  106. package/dist/test/test/diagnostics/tool-call-adapter.test.js +0 -34
  107. package/dist/test/test/diagnostics/tool-call-adapter.test.js.map +0 -1
  108. package/dist/test/test/engine/asset-sources.test.d.ts +0 -2
  109. package/dist/test/test/engine/asset-sources.test.d.ts.map +0 -1
  110. package/dist/test/test/engine/asset-sources.test.js +0 -100
  111. package/dist/test/test/engine/asset-sources.test.js.map +0 -1
  112. package/dist/test/test/engine/cesdk-adapter.test.d.ts +0 -2
  113. package/dist/test/test/engine/cesdk-adapter.test.d.ts.map +0 -1
  114. package/dist/test/test/engine/cesdk-adapter.test.js +0 -32
  115. package/dist/test/test/engine/cesdk-adapter.test.js.map +0 -1
  116. package/dist/test/test/engine/mutex.test.d.ts +0 -2
  117. package/dist/test/test/engine/mutex.test.d.ts.map +0 -1
  118. package/dist/test/test/engine/mutex.test.js +0 -63
  119. package/dist/test/test/engine/mutex.test.js.map +0 -1
  120. package/dist/test/test/engine/session.test.d.ts +0 -2
  121. package/dist/test/test/engine/session.test.d.ts.map +0 -1
  122. package/dist/test/test/engine/session.test.js +0 -159
  123. package/dist/test/test/engine/session.test.js.map +0 -1
  124. package/dist/test/test/engine/unsplash-source.test.d.ts +0 -2
  125. package/dist/test/test/engine/unsplash-source.test.d.ts.map +0 -1
  126. package/dist/test/test/engine/unsplash-source.test.js +0 -129
  127. package/dist/test/test/engine/unsplash-source.test.js.map +0 -1
  128. package/dist/test/test/engine/uri-resolver.test.d.ts +0 -2
  129. package/dist/test/test/engine/uri-resolver.test.d.ts.map +0 -1
  130. package/dist/test/test/engine/uri-resolver.test.js +0 -38
  131. package/dist/test/test/engine/uri-resolver.test.js.map +0 -1
  132. package/dist/test/test/gateway/hosted-stub.test.d.ts +0 -2
  133. package/dist/test/test/gateway/hosted-stub.test.d.ts.map +0 -1
  134. package/dist/test/test/gateway/hosted-stub.test.js +0 -11
  135. package/dist/test/test/gateway/hosted-stub.test.js.map +0 -1
  136. package/dist/test/test/gateway/local.test.d.ts +0 -2
  137. package/dist/test/test/gateway/local.test.d.ts.map +0 -1
  138. package/dist/test/test/gateway/local.test.js +0 -29
  139. package/dist/test/test/gateway/local.test.js.map +0 -1
  140. package/dist/test/test/handbook-contract.test.d.ts +0 -2
  141. package/dist/test/test/handbook-contract.test.d.ts.map +0 -1
  142. package/dist/test/test/handbook-contract.test.js +0 -79
  143. package/dist/test/test/handbook-contract.test.js.map +0 -1
  144. package/dist/test/test/http/server.test.d.ts +0 -2
  145. package/dist/test/test/http/server.test.d.ts.map +0 -1
  146. package/dist/test/test/http/server.test.js +0 -338
  147. package/dist/test/test/http/server.test.js.map +0 -1
  148. package/dist/test/test/http/session-id-header.test.d.ts +0 -2
  149. package/dist/test/test/http/session-id-header.test.d.ts.map +0 -1
  150. package/dist/test/test/http/session-id-header.test.js +0 -76
  151. package/dist/test/test/http/session-id-header.test.js.map +0 -1
  152. package/dist/test/test/http/session-manager.test.d.ts +0 -2
  153. package/dist/test/test/http/session-manager.test.d.ts.map +0 -1
  154. package/dist/test/test/http/session-manager.test.js +0 -97
  155. package/dist/test/test/http/session-manager.test.js.map +0 -1
  156. package/dist/test/test/http/workspace-auth.test.d.ts +0 -2
  157. package/dist/test/test/http/workspace-auth.test.d.ts.map +0 -1
  158. package/dist/test/test/http/workspace-auth.test.js +0 -40
  159. package/dist/test/test/http/workspace-auth.test.js.map +0 -1
  160. package/dist/test/test/metrics/mount.test.d.ts +0 -2
  161. package/dist/test/test/metrics/mount.test.d.ts.map +0 -1
  162. package/dist/test/test/metrics/mount.test.js +0 -59
  163. package/dist/test/test/metrics/mount.test.js.map +0 -1
  164. package/dist/test/test/metrics/recorder.test.d.ts +0 -2
  165. package/dist/test/test/metrics/recorder.test.d.ts.map +0 -1
  166. package/dist/test/test/metrics/recorder.test.js +0 -118
  167. package/dist/test/test/metrics/recorder.test.js.map +0 -1
  168. package/dist/test/test/revisions/hash.test.d.ts +0 -2
  169. package/dist/test/test/revisions/hash.test.d.ts.map +0 -1
  170. package/dist/test/test/revisions/hash.test.js +0 -33
  171. package/dist/test/test/revisions/hash.test.js.map +0 -1
  172. package/dist/test/test/revisions/store.test.d.ts +0 -2
  173. package/dist/test/test/revisions/store.test.d.ts.map +0 -1
  174. package/dist/test/test/revisions/store.test.js +0 -315
  175. package/dist/test/test/revisions/store.test.js.map +0 -1
  176. package/dist/test/test/server.metrics.test.d.ts +0 -2
  177. package/dist/test/test/server.metrics.test.d.ts.map +0 -1
  178. package/dist/test/test/server.metrics.test.js +0 -87
  179. package/dist/test/test/server.metrics.test.js.map +0 -1
  180. package/dist/test/test/server.test.d.ts +0 -2
  181. package/dist/test/test/server.test.d.ts.map +0 -1
  182. package/dist/test/test/server.test.js +0 -146
  183. package/dist/test/test/server.test.js.map +0 -1
  184. package/dist/test/test/skill-tools.test.d.ts +0 -2
  185. package/dist/test/test/skill-tools.test.d.ts.map +0 -1
  186. package/dist/test/test/skill-tools.test.js +0 -84
  187. package/dist/test/test/skill-tools.test.js.map +0 -1
  188. package/dist/test/test/smoke.test.d.ts +0 -2
  189. package/dist/test/test/smoke.test.d.ts.map +0 -1
  190. package/dist/test/test/smoke.test.js +0 -8
  191. package/dist/test/test/smoke.test.js.map +0 -1
  192. package/dist/test/test/tools/asset-generate.test.d.ts +0 -2
  193. package/dist/test/test/tools/asset-generate.test.d.ts.map +0 -1
  194. package/dist/test/test/tools/asset-generate.test.js +0 -66
  195. package/dist/test/test/tools/asset-generate.test.js.map +0 -1
  196. package/dist/test/test/tools/asset-search.test.d.ts +0 -2
  197. package/dist/test/test/tools/asset-search.test.d.ts.map +0 -1
  198. package/dist/test/test/tools/asset-search.test.js +0 -121
  199. package/dist/test/test/tools/asset-search.test.js.map +0 -1
  200. package/dist/test/test/tools/edit-harness.d.ts +0 -14
  201. package/dist/test/test/tools/edit-harness.d.ts.map +0 -1
  202. package/dist/test/test/tools/edit-harness.js +0 -30
  203. package/dist/test/test/tools/edit-harness.js.map +0 -1
  204. package/dist/test/test/tools/edit.telemetry.test.d.ts +0 -2
  205. package/dist/test/test/tools/edit.telemetry.test.d.ts.map +0 -1
  206. package/dist/test/test/tools/edit.telemetry.test.js +0 -46
  207. package/dist/test/test/tools/edit.telemetry.test.js.map +0 -1
  208. package/dist/test/test/tools/edit.test.d.ts +0 -2
  209. package/dist/test/test/tools/edit.test.d.ts.map +0 -1
  210. package/dist/test/test/tools/edit.test.js +0 -267
  211. package/dist/test/test/tools/edit.test.js.map +0 -1
  212. package/dist/test/test/tools/export-harness.d.ts +0 -13
  213. package/dist/test/test/tools/export-harness.d.ts.map +0 -1
  214. package/dist/test/test/tools/export-harness.js +0 -27
  215. package/dist/test/test/tools/export-harness.js.map +0 -1
  216. package/dist/test/test/tools/export.telemetry.test.d.ts +0 -2
  217. package/dist/test/test/tools/export.telemetry.test.d.ts.map +0 -1
  218. package/dist/test/test/tools/export.telemetry.test.js +0 -65
  219. package/dist/test/test/tools/export.telemetry.test.js.map +0 -1
  220. package/dist/test/test/tools/export.test.d.ts +0 -2
  221. package/dist/test/test/tools/export.test.d.ts.map +0 -1
  222. package/dist/test/test/tools/export.test.js +0 -174
  223. package/dist/test/test/tools/export.test.js.map +0 -1
  224. package/dist/test/test/tools/history.test.d.ts +0 -2
  225. package/dist/test/test/tools/history.test.d.ts.map +0 -1
  226. package/dist/test/test/tools/history.test.js +0 -29
  227. package/dist/test/test/tools/history.test.js.map +0 -1
  228. package/dist/test/test/tools/import.test.d.ts +0 -2
  229. package/dist/test/test/tools/import.test.d.ts.map +0 -1
  230. package/dist/test/test/tools/import.test.js +0 -122
  231. package/dist/test/test/tools/import.test.js.map +0 -1
  232. package/dist/test/test/tools/index.test.d.ts +0 -2
  233. package/dist/test/test/tools/index.test.d.ts.map +0 -1
  234. package/dist/test/test/tools/index.test.js +0 -117
  235. package/dist/test/test/tools/index.test.js.map +0 -1
  236. package/dist/test/test/tools/inspect.test.d.ts +0 -2
  237. package/dist/test/test/tools/inspect.test.d.ts.map +0 -1
  238. package/dist/test/test/tools/inspect.test.js +0 -62
  239. package/dist/test/test/tools/inspect.test.js.map +0 -1
  240. package/dist/test/test/tools/list.test.d.ts +0 -2
  241. package/dist/test/test/tools/list.test.d.ts.map +0 -1
  242. package/dist/test/test/tools/list.test.js +0 -23
  243. package/dist/test/test/tools/list.test.js.map +0 -1
  244. package/dist/test/test/tools/load.integration.test.d.ts +0 -2
  245. package/dist/test/test/tools/load.integration.test.d.ts.map +0 -1
  246. package/dist/test/test/tools/load.integration.test.js +0 -165
  247. package/dist/test/test/tools/load.integration.test.js.map +0 -1
  248. package/dist/test/test/tools/load.test.d.ts +0 -2
  249. package/dist/test/test/tools/load.test.d.ts.map +0 -1
  250. package/dist/test/test/tools/load.test.js +0 -387
  251. package/dist/test/test/tools/load.test.js.map +0 -1
  252. package/dist/test/test/tools/metrics.test.d.ts +0 -2
  253. package/dist/test/test/tools/metrics.test.d.ts.map +0 -1
  254. package/dist/test/test/tools/metrics.test.js +0 -29
  255. package/dist/test/test/tools/metrics.test.js.map +0 -1
  256. package/dist/test/test/tools/open-editor.test.d.ts +0 -2
  257. package/dist/test/test/tools/open-editor.test.d.ts.map +0 -1
  258. package/dist/test/test/tools/open-editor.test.js +0 -53
  259. package/dist/test/test/tools/open-editor.test.js.map +0 -1
  260. package/dist/test/test/tools/preview-harness.d.ts +0 -9
  261. package/dist/test/test/tools/preview-harness.d.ts.map +0 -1
  262. package/dist/test/test/tools/preview-harness.js +0 -23
  263. package/dist/test/test/tools/preview-harness.js.map +0 -1
  264. package/dist/test/test/tools/preview.telemetry.test.d.ts +0 -2
  265. package/dist/test/test/tools/preview.telemetry.test.d.ts.map +0 -1
  266. package/dist/test/test/tools/preview.telemetry.test.js +0 -36
  267. package/dist/test/test/tools/preview.telemetry.test.js.map +0 -1
  268. package/dist/test/test/tools/preview.test.d.ts +0 -2
  269. package/dist/test/test/tools/preview.test.d.ts.map +0 -1
  270. package/dist/test/test/tools/preview.test.js +0 -75
  271. package/dist/test/test/tools/preview.test.js.map +0 -1
  272. package/dist/test/test/tools/rename.test.d.ts +0 -2
  273. package/dist/test/test/tools/rename.test.d.ts.map +0 -1
  274. package/dist/test/test/tools/rename.test.js +0 -16
  275. package/dist/test/test/tools/rename.test.js.map +0 -1
  276. package/dist/test/test/tools/save.test.d.ts +0 -2
  277. package/dist/test/test/tools/save.test.d.ts.map +0 -1
  278. package/dist/test/test/tools/save.test.js +0 -137
  279. package/dist/test/test/tools/save.test.js.map +0 -1
  280. package/dist/test/test/tools/schema-best-practices.d.ts +0 -13
  281. package/dist/test/test/tools/schema-best-practices.d.ts.map +0 -1
  282. package/dist/test/test/tools/schema-best-practices.js +0 -169
  283. package/dist/test/test/tools/schema-best-practices.js.map +0 -1
  284. package/dist/test/test/tools/schema-best-practices.test.d.ts +0 -3
  285. package/dist/test/test/tools/schema-best-practices.test.d.ts.map +0 -1
  286. package/dist/test/test/tools/schema-best-practices.test.js +0 -194
  287. package/dist/test/test/tools/schema-best-practices.test.js.map +0 -1
  288. package/dist/test/test/tools/spans.test.d.ts +0 -2
  289. package/dist/test/test/tools/spans.test.d.ts.map +0 -1
  290. package/dist/test/test/tools/spans.test.js +0 -84
  291. package/dist/test/test/tools/spans.test.js.map +0 -1
  292. package/dist/test/test/viewer/broadcaster.test.d.ts +0 -2
  293. package/dist/test/test/viewer/broadcaster.test.d.ts.map +0 -1
  294. package/dist/test/test/viewer/broadcaster.test.js +0 -53
  295. package/dist/test/test/viewer/broadcaster.test.js.map +0 -1
  296. package/dist/test/test/viewer/cesdk-cdn.test.d.ts +0 -2
  297. package/dist/test/test/viewer/cesdk-cdn.test.d.ts.map +0 -1
  298. package/dist/test/test/viewer/cesdk-cdn.test.js +0 -19
  299. package/dist/test/test/viewer/cesdk-cdn.test.js.map +0 -1
  300. package/dist/test/test/viewer/config-route.test.d.ts +0 -2
  301. package/dist/test/test/viewer/config-route.test.d.ts.map +0 -1
  302. package/dist/test/test/viewer/config-route.test.js +0 -28
  303. package/dist/test/test/viewer/config-route.test.js.map +0 -1
  304. package/dist/test/test/viewer/resource-route.test.d.ts +0 -2
  305. package/dist/test/test/viewer/resource-route.test.d.ts.map +0 -1
  306. package/dist/test/test/viewer/resource-route.test.js +0 -70
  307. package/dist/test/test/viewer/resource-route.test.js.map +0 -1
  308. package/dist/test/test/viewer/router.test.d.ts +0 -2
  309. package/dist/test/test/viewer/router.test.d.ts.map +0 -1
  310. package/dist/test/test/viewer/router.test.js +0 -227
  311. package/dist/test/test/viewer/router.test.js.map +0 -1
  312. package/dist/test/test/viewer/session-mount.test.d.ts +0 -2
  313. package/dist/test/test/viewer/session-mount.test.d.ts.map +0 -1
  314. package/dist/test/test/viewer/session-mount.test.js +0 -52
  315. package/dist/test/test/viewer/session-mount.test.js.map +0 -1
  316. package/dist/test/test/viewer/spa-version.test.d.ts +0 -2
  317. package/dist/test/test/viewer/spa-version.test.d.ts.map +0 -1
  318. package/dist/test/test/viewer/spa-version.test.js +0 -14
  319. package/dist/test/test/viewer/spa-version.test.js.map +0 -1
  320. package/dist/test/test/viewer/url-builder.test.d.ts +0 -2
  321. package/dist/test/test/viewer/url-builder.test.d.ts.map +0 -1
  322. package/dist/test/test/viewer/url-builder.test.js +0 -98
  323. package/dist/test/test/viewer/url-builder.test.js.map +0 -1
  324. package/dist/test/test/workspace/content-hash.test.d.ts +0 -2
  325. package/dist/test/test/workspace/content-hash.test.d.ts.map +0 -1
  326. package/dist/test/test/workspace/content-hash.test.js +0 -17
  327. package/dist/test/test/workspace/content-hash.test.js.map +0 -1
  328. package/dist/test/test/workspace/hosted-stub.test.d.ts +0 -2
  329. package/dist/test/test/workspace/hosted-stub.test.d.ts.map +0 -1
  330. package/dist/test/test/workspace/hosted-stub.test.js +0 -30
  331. package/dist/test/test/workspace/hosted-stub.test.js.map +0 -1
  332. package/dist/test/test/workspace/in-memory.test.d.ts +0 -2
  333. package/dist/test/test/workspace/in-memory.test.d.ts.map +0 -1
  334. package/dist/test/test/workspace/in-memory.test.js +0 -4
  335. package/dist/test/test/workspace/in-memory.test.js.map +0 -1
  336. package/dist/test/test/workspace/node-fs.test.d.ts +0 -2
  337. package/dist/test/test/workspace/node-fs.test.d.ts.map +0 -1
  338. package/dist/test/test/workspace/node-fs.test.js +0 -20
  339. package/dist/test/test/workspace/node-fs.test.js.map +0 -1
  340. package/dist/test/test/workspace/s3.test.d.ts +0 -2
  341. package/dist/test/test/workspace/s3.test.d.ts.map +0 -1
  342. package/dist/test/test/workspace/s3.test.js +0 -153
  343. package/dist/test/test/workspace/s3.test.js.map +0 -1
  344. package/dist/test/test/workspace/scoped.test.d.ts +0 -2
  345. package/dist/test/test/workspace/scoped.test.d.ts.map +0 -1
  346. package/dist/test/test/workspace/scoped.test.js +0 -59
  347. package/dist/test/test/workspace/scoped.test.js.map +0 -1
  348. package/dist/test/test/workspace/shared-contract.d.ts +0 -3
  349. package/dist/test/test/workspace/shared-contract.d.ts.map +0 -1
  350. package/dist/test/test/workspace/shared-contract.js +0 -92
  351. package/dist/test/test/workspace/shared-contract.js.map +0 -1
  352. package/dist/test/tsconfig.test.tsbuildinfo +0 -1
  353. package/dist/test/vitest.config.d.ts +0 -3
  354. package/dist/test/vitest.config.d.ts.map +0 -1
  355. package/dist/test/vitest.config.js +0 -8
  356. package/dist/test/vitest.config.js.map +0 -1
  357. package/dist/tools/metrics.d.ts +0 -11
  358. package/dist/tools/metrics.d.ts.map +0 -1
  359. package/dist/tools/metrics.js +0 -28
  360. package/dist/tools/metrics.js.map +0 -1
@@ -1,171 +0,0 @@
1
- #!/usr/bin/env node
2
- // Collate changelog-next/*.md entries into CHANGELOG.md under `## Version <v>`.
3
- // Run via `node --experimental-strip-types` (see package.json) — no build step.
4
- // See docs/specs/2026-06-30-changelog-system-design.md.
5
- const FENCE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
6
- // Minimal frontmatter read for the two scalar keys we need. We intentionally do
7
- // NOT reuse src/frontmatter.ts: it whitelists name/description, and importing it
8
- // (a `.js` specifier resolving to src/frontmatter.js) would require a build
9
- // before this script could run. Keeping it self-contained keeps collate
10
- // build-free. Lines starting with `#` are comments; inline `# ...` is stripped.
11
- export function parseEntry(text) {
12
- const match = text.match(FENCE);
13
- const block = match ? match[1] : '';
14
- const body = (match ? text.slice(match[0].length) : text).trim();
15
- let type = '';
16
- let breaking = false;
17
- for (const line of block.split(/\r?\n/)) {
18
- const m = line.match(/^(type|breaking)\s*:\s*(.*)$/);
19
- if (!m)
20
- continue;
21
- const value = m[2]
22
- .replace(/\s+#.*$/, '')
23
- .trim()
24
- .toLowerCase();
25
- if (m[1] === 'type')
26
- type = value;
27
- else
28
- breaking = value === 'true';
29
- }
30
- return { type, breaking, body };
31
- }
32
- // Breaking entries go to `breaking` only (Option A). Unknown type -> changes.
33
- export function groupEntries(entries) {
34
- const grouped = {
35
- breaking: [],
36
- changes: [],
37
- fixed: [],
38
- deprecated: []
39
- };
40
- for (const e of [...entries].sort((a, b) => a.name.localeCompare(b.name))) {
41
- if (e.breaking)
42
- grouped.breaking.push(e.body);
43
- else if (e.type === 'fixed')
44
- grouped.fixed.push(e.body);
45
- else if (e.type === 'deprecated')
46
- grouped.deprecated.push(e.body);
47
- else
48
- grouped.changes.push(e.body);
49
- }
50
- return grouped;
51
- }
52
- const SECTIONS = [
53
- { key: 'breaking', heading: '### ⚠ Breaking' },
54
- { key: 'changes', heading: '### Changes' },
55
- { key: 'fixed', heading: '### Fixed' },
56
- { key: 'deprecated', heading: '### Deprecated' }
57
- ];
58
- export function renderVersionSection(version, grouped, absorbedBody = '') {
59
- const parts = [`## Version ${version}`];
60
- for (const { key, heading } of SECTIONS) {
61
- const bodies = grouped[key];
62
- if (bodies.length)
63
- parts.push(`${heading}\n\n${bodies.join('\n')}`);
64
- }
65
- if (absorbedBody.trim())
66
- parts.push(absorbedBody.trim());
67
- return parts.join('\n\n') + '\n';
68
- }
69
- // Split a CHANGELOG into the leading header (before the first `## `) and the
70
- // `## `-delimited sections. `### ` subheadings stay inside a section's body.
71
- function parseSections(md) {
72
- let header = '';
73
- const sections = [];
74
- for (const part of md.split(/^(?=## )/m)) {
75
- if (part.startsWith('## ')) {
76
- const nl = part.indexOf('\n');
77
- const heading = (nl === -1 ? part : part.slice(0, nl)).trim();
78
- const body = (nl === -1 ? '' : part.slice(nl + 1)).trim();
79
- sections.push({ heading, body });
80
- }
81
- else {
82
- header = part.replace(/\s+$/, '');
83
- }
84
- }
85
- return { header, sections };
86
- }
87
- function renderChangelog(header, sections) {
88
- const blocks = sections.map((s) => s.body ? `${s.heading}\n\n${s.body}` : s.heading);
89
- return [header, ...blocks].filter(Boolean).join('\n\n') + '\n';
90
- }
91
- export function extractUnreleased(md) {
92
- const { header, sections } = parseSections(md);
93
- const idx = sections.findIndex((s) => s.heading === '## Unreleased');
94
- if (idx === -1)
95
- return { body: '', md };
96
- const body = sections[idx].body;
97
- sections.splice(idx, 1);
98
- return { body, md: renderChangelog(header, sections) };
99
- }
100
- export function hasVersion(md, version) {
101
- return parseSections(md).sections.some((s) => s.heading === `## Version ${version}`);
102
- }
103
- export function insertVersionSection(md, sectionMd) {
104
- const { header, sections } = parseSections(md);
105
- const newSection = parseSections(sectionMd).sections[0];
106
- return renderChangelog(header, [newSection, ...sections]);
107
- }
108
- import { readFile, writeFile, readdir, rm } from 'node:fs/promises';
109
- import { dirname, join } from 'node:path';
110
- import { fileURLToPath, pathToFileURL } from 'node:url';
111
- async function readEntries(entriesDir) {
112
- let names;
113
- try {
114
- names = await readdir(entriesDir);
115
- }
116
- catch (err) {
117
- if (err.code === 'ENOENT')
118
- return [];
119
- throw err;
120
- }
121
- const files = names
122
- .filter((n) => n.endsWith('.md') && !n.startsWith('-'))
123
- .sort();
124
- const entries = [];
125
- for (const name of files) {
126
- const text = await readFile(join(entriesDir, name), 'utf8');
127
- entries.push({ name, ...parseEntry(text) });
128
- }
129
- return entries;
130
- }
131
- export async function collateFiles(opts) {
132
- const { entriesDir, changelogPath, version } = opts;
133
- const entries = await readEntries(entriesDir);
134
- const existing = await readFile(changelogPath, 'utf8');
135
- const { body: unreleasedBody, md: mdNoUnreleased } = extractUnreleased(existing);
136
- if (entries.length === 0 && !unreleasedBody)
137
- return { noop: true };
138
- if (hasVersion(mdNoUnreleased, version)) {
139
- throw new Error(`## Version ${version} already exists in ${changelogPath}`);
140
- }
141
- const section = renderVersionSection(version, groupEntries(entries), unreleasedBody);
142
- await writeFile(changelogPath, insertVersionSection(mdNoUnreleased, section));
143
- await Promise.all(entries.map((e) => rm(join(entriesDir, e.name))));
144
- return { noop: false, section };
145
- }
146
- async function main() {
147
- const version = process.argv[2];
148
- if (!version) {
149
- console.error('usage: node --experimental-strip-types scripts/changelog-collate.ts <version>');
150
- process.exit(1);
151
- }
152
- const here = dirname(fileURLToPath(import.meta.url));
153
- const result = await collateFiles({
154
- entriesDir: join(here, '..', 'changelog-next'),
155
- changelogPath: join(here, '..', 'CHANGELOG.md'),
156
- version
157
- });
158
- if (result.noop) {
159
- console.error('changelog: nothing to collate');
160
- return;
161
- }
162
- process.stdout.write(result.section);
163
- }
164
- if (process.argv[1] &&
165
- import.meta.url === pathToFileURL(process.argv[1]).href) {
166
- main().catch((err) => {
167
- console.error(err instanceof Error ? err.message : String(err));
168
- process.exit(1);
169
- });
170
- }
171
- //# sourceMappingURL=changelog-collate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"changelog-collate.js","sourceRoot":"","sources":["../../../scripts/changelog-collate.ts"],"names":[],"mappings":";AACA,gFAAgF;AAChF,gFAAgF;AAChF,wDAAwD;AAgBxD,MAAM,KAAK,GAAG,mCAAmC,CAAC;AAElD,gFAAgF;AAChF,iFAAiF;AACjF,4EAA4E;AAC5E,wEAAwE;AACxE,gFAAgF;AAChF,MAAM,UAAU,UAAU,CAAC,IAAY;IAKrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC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,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,gBAAgB,CAAC;QAC9C,aAAa,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC;QAC/C,OAAO;KACR,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC/C,OAAO;IACT,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AAED,IACE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACf,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EACvD,CAAC;IACD,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;QAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["#!/usr/bin/env node\n// Collate changelog-next/*.md entries into CHANGELOG.md under `## Version <v>`.\n// Run via `node --experimental-strip-types` (see package.json) — no build step.\n// See docs/specs/2026-06-30-changelog-system-design.md.\n\nexport interface ChangelogEntry {\n name: string;\n type: string;\n breaking: boolean;\n body: string;\n}\n\nexport interface GroupedEntries {\n breaking: string[];\n changes: string[];\n fixed: string[];\n deprecated: string[];\n}\n\nconst FENCE = /^---\\r?\\n([\\s\\S]*?)\\r?\\n---\\r?\\n?/;\n\n// Minimal frontmatter read for the two scalar keys we need. We intentionally do\n// NOT reuse src/frontmatter.ts: it whitelists name/description, and importing it\n// (a `.js` specifier resolving to src/frontmatter.js) would require a build\n// before this script could run. Keeping it self-contained keeps collate\n// build-free. Lines starting with `#` are comments; inline `# ...` is stripped.\nexport function parseEntry(text: string): {\n type: string;\n breaking: boolean;\n body: string;\n} {\n const match = text.match(FENCE);\n const block = match ? match[1] : '';\n const body = (match ? text.slice(match[0].length) : text).trim();\n let type = '';\n let breaking = false;\n for (const line of block.split(/\\r?\\n/)) {\n const m = line.match(/^(type|breaking)\\s*:\\s*(.*)$/);\n if (!m) continue;\n const value = m[2]\n .replace(/\\s+#.*$/, '')\n .trim()\n .toLowerCase();\n if (m[1] === 'type') type = value;\n else breaking = value === 'true';\n }\n return { type, breaking, body };\n}\n\n// Breaking entries go to `breaking` only (Option A). Unknown type -> changes.\nexport function groupEntries(entries: ChangelogEntry[]): GroupedEntries {\n const grouped: GroupedEntries = {\n breaking: [],\n changes: [],\n fixed: [],\n deprecated: []\n };\n for (const e of [...entries].sort((a, b) => a.name.localeCompare(b.name))) {\n if (e.breaking) grouped.breaking.push(e.body);\n else if (e.type === 'fixed') grouped.fixed.push(e.body);\n else if (e.type === 'deprecated') grouped.deprecated.push(e.body);\n else grouped.changes.push(e.body);\n }\n return grouped;\n}\n\nconst SECTIONS: { key: keyof GroupedEntries; heading: string }[] = [\n { key: 'breaking', heading: '### ⚠ Breaking' },\n { key: 'changes', heading: '### Changes' },\n { key: 'fixed', heading: '### Fixed' },\n { key: 'deprecated', heading: '### Deprecated' }\n];\n\nexport function renderVersionSection(\n version: string,\n grouped: GroupedEntries,\n absorbedBody = ''\n): string {\n const parts = [`## Version ${version}`];\n for (const { key, heading } of SECTIONS) {\n const bodies = grouped[key];\n if (bodies.length) parts.push(`${heading}\\n\\n${bodies.join('\\n')}`);\n }\n if (absorbedBody.trim()) parts.push(absorbedBody.trim());\n return parts.join('\\n\\n') + '\\n';\n}\n\ninterface MarkdownSection {\n heading: string;\n body: string;\n}\n\n// Split a CHANGELOG into the leading header (before the first `## `) and the\n// `## `-delimited sections. `### ` subheadings stay inside a section's body.\nfunction parseSections(md: string): {\n header: string;\n sections: MarkdownSection[];\n} {\n let header = '';\n const sections: MarkdownSection[] = [];\n for (const part of md.split(/^(?=## )/m)) {\n if (part.startsWith('## ')) {\n const nl = part.indexOf('\\n');\n const heading = (nl === -1 ? part : part.slice(0, nl)).trim();\n const body = (nl === -1 ? '' : part.slice(nl + 1)).trim();\n sections.push({ heading, body });\n } else {\n header = part.replace(/\\s+$/, '');\n }\n }\n return { header, sections };\n}\n\nfunction renderChangelog(header: string, sections: MarkdownSection[]): string {\n const blocks = sections.map((s) =>\n s.body ? `${s.heading}\\n\\n${s.body}` : s.heading\n );\n return [header, ...blocks].filter(Boolean).join('\\n\\n') + '\\n';\n}\n\nexport function extractUnreleased(md: string): { body: string; md: string } {\n const { header, sections } = parseSections(md);\n const idx = sections.findIndex((s) => s.heading === '## Unreleased');\n if (idx === -1) return { body: '', md };\n const body = sections[idx].body;\n sections.splice(idx, 1);\n return { body, md: renderChangelog(header, sections) };\n}\n\nexport function hasVersion(md: string, version: string): boolean {\n return parseSections(md).sections.some(\n (s) => s.heading === `## Version ${version}`\n );\n}\n\nexport function insertVersionSection(md: string, sectionMd: string): string {\n const { header, sections } = parseSections(md);\n const newSection = parseSections(sectionMd).sections[0];\n return renderChangelog(header, [newSection, ...sections]);\n}\n\nimport { readFile, writeFile, readdir, rm } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\nexport type CollateResult = { noop: true } | { noop: false; section: string };\n\nasync function readEntries(entriesDir: string): Promise<ChangelogEntry[]> {\n let names: string[];\n try {\n names = await readdir(entriesDir);\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === 'ENOENT') return [];\n throw err;\n }\n const files = names\n .filter((n) => n.endsWith('.md') && !n.startsWith('-'))\n .sort();\n const entries: ChangelogEntry[] = [];\n for (const name of files) {\n const text = await readFile(join(entriesDir, name), 'utf8');\n entries.push({ name, ...parseEntry(text) });\n }\n return entries;\n}\n\nexport async function collateFiles(opts: {\n entriesDir: string;\n changelogPath: string;\n version: string;\n}): Promise<CollateResult> {\n const { entriesDir, changelogPath, version } = opts;\n const entries = await readEntries(entriesDir);\n const existing = await readFile(changelogPath, 'utf8');\n const { body: unreleasedBody, md: mdNoUnreleased } =\n extractUnreleased(existing);\n if (entries.length === 0 && !unreleasedBody) return { noop: true };\n if (hasVersion(mdNoUnreleased, version)) {\n throw new Error(`## Version ${version} already exists in ${changelogPath}`);\n }\n const section = renderVersionSection(\n version,\n groupEntries(entries),\n unreleasedBody\n );\n await writeFile(changelogPath, insertVersionSection(mdNoUnreleased, section));\n await Promise.all(entries.map((e) => rm(join(entriesDir, e.name))));\n return { noop: false, section };\n}\n\nasync function main(): Promise<void> {\n const version = process.argv[2];\n if (!version) {\n console.error(\n 'usage: node --experimental-strip-types scripts/changelog-collate.ts <version>'\n );\n process.exit(1);\n }\n const here = dirname(fileURLToPath(import.meta.url));\n const result = await collateFiles({\n entriesDir: join(here, '..', 'changelog-next'),\n changelogPath: join(here, '..', 'CHANGELOG.md'),\n version\n });\n if (result.noop) {\n console.error('changelog: nothing to collate');\n return;\n }\n process.stdout.write(result.section);\n}\n\nif (\n process.argv[1] &&\n import.meta.url === pathToFileURL(process.argv[1]).href\n) {\n main().catch((err: unknown) => {\n console.error(err instanceof Error ? err.message : String(err));\n process.exit(1);\n });\n}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=changelog.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"changelog.test.d.ts","sourceRoot":"","sources":["../../../test/changelog.test.ts"],"names":[],"mappings":""}
@@ -1,293 +0,0 @@
1
- import { mkdtemp, mkdir, writeFile, readFile, readdir, rm } from 'node:fs/promises';
2
- import { tmpdir } from 'node:os';
3
- import { join } from 'node:path';
4
- import { afterAll, describe, expect, it } from 'vitest';
5
- import { parseEntry, groupEntries, renderVersionSection, extractUnreleased, hasVersion, insertVersionSection, collateFiles } from '../scripts/changelog-collate.js';
6
- import { entryFileName, addEntry } from '../scripts/changelog-add.js';
7
- const tmpDirs = [];
8
- afterAll(async () => {
9
- await Promise.all(tmpDirs.map((d) => rm(d, { recursive: true, force: true })));
10
- });
11
- describe('parseEntry', () => {
12
- it('reads type and breaking from frontmatter and trims the body', () => {
13
- const input = [
14
- '---',
15
- 'type: fixed',
16
- 'breaking: true',
17
- '---',
18
- '- Fixed a thing.',
19
- ''
20
- ].join('\n');
21
- expect(parseEntry(input)).toEqual({
22
- type: 'fixed',
23
- breaking: true,
24
- body: '- Fixed a thing.'
25
- });
26
- });
27
- it('defaults to empty type and breaking=false', () => {
28
- const input = [
29
- '---',
30
- 'type:',
31
- 'breaking: false',
32
- '---',
33
- '- A change.'
34
- ].join('\n');
35
- expect(parseEntry(input)).toEqual({
36
- type: '',
37
- breaking: false,
38
- body: '- A change.'
39
- });
40
- });
41
- it('ignores comment lines and inline comments in frontmatter', () => {
42
- const input = [
43
- '---',
44
- '# type: omit for a normal change',
45
- 'type: deprecated # note',
46
- 'breaking: false',
47
- '---',
48
- '- Deprecated X.'
49
- ].join('\n');
50
- expect(parseEntry(input)).toEqual({
51
- type: 'deprecated',
52
- breaking: false,
53
- body: '- Deprecated X.'
54
- });
55
- });
56
- it('treats a file with no frontmatter as an empty-type change', () => {
57
- expect(parseEntry('- Just a bullet.')).toEqual({
58
- type: '',
59
- breaking: false,
60
- body: '- Just a bullet.'
61
- });
62
- });
63
- });
64
- describe('groupEntries', () => {
65
- const entry = (name, type, breaking) => ({
66
- name,
67
- type,
68
- breaking,
69
- body: `- ${name}`
70
- });
71
- it('buckets by type, sorts by filename, and keeps breaking out of its type section (Option A)', () => {
72
- const grouped = groupEntries([
73
- entry('b-feature.md', '', false),
74
- entry('a-fix.md', 'fixed', false),
75
- entry('c-breaking-fix.md', 'fixed', true),
76
- entry('d-deprecate.md', 'deprecated', false)
77
- ]);
78
- expect(grouped).toEqual({
79
- breaking: ['- c-breaking-fix.md'],
80
- changes: ['- b-feature.md'],
81
- fixed: ['- a-fix.md'],
82
- deprecated: ['- d-deprecate.md']
83
- });
84
- });
85
- it('falls back to changes for an unknown type', () => {
86
- expect(groupEntries([entry('x.md', 'whoops', false)]).changes).toEqual([
87
- '- x.md'
88
- ]);
89
- });
90
- });
91
- describe('renderVersionSection', () => {
92
- it('renders sections in order and omits empty ones', () => {
93
- const out = renderVersionSection('0.2.0', {
94
- breaking: ['- Broke X.'],
95
- changes: ['- Added Y.'],
96
- fixed: [],
97
- deprecated: []
98
- });
99
- expect(out).toBe([
100
- '## Version 0.2.0',
101
- '',
102
- '### ⚠ Breaking',
103
- '',
104
- '- Broke X.',
105
- '',
106
- '### Changes',
107
- '',
108
- '- Added Y.',
109
- ''
110
- ].join('\n'));
111
- });
112
- it('appends an absorbed body verbatim after the generated sections', () => {
113
- const out = renderVersionSection('0.2.0', { breaking: [], changes: ['- Added Y.'], fixed: [], deprecated: [] }, '### Notes\n\n- carried over');
114
- expect(out).toBe([
115
- '## Version 0.2.0',
116
- '',
117
- '### Changes',
118
- '',
119
- '- Added Y.',
120
- '',
121
- '### Notes',
122
- '',
123
- '- carried over',
124
- ''
125
- ].join('\n'));
126
- });
127
- });
128
- describe('extractUnreleased', () => {
129
- it('removes the Unreleased section and returns its body', () => {
130
- const md = [
131
- '# CHANGELOG',
132
- '',
133
- '## Unreleased',
134
- '',
135
- '- pending note',
136
- '',
137
- '## Version 0.1.0',
138
- '',
139
- '- old'
140
- ].join('\n');
141
- const { body, md: rest } = extractUnreleased(md);
142
- expect(body).toBe('- pending note');
143
- expect(rest).toBe(['# CHANGELOG', '', '## Version 0.1.0', '', '- old', ''].join('\n'));
144
- });
145
- it('returns an empty body when there is no Unreleased section', () => {
146
- const md = ['# CHANGELOG', '', '## Version 0.1.0', '', '- old'].join('\n');
147
- expect(extractUnreleased(md).body).toBe('');
148
- });
149
- });
150
- describe('hasVersion', () => {
151
- it('detects an existing version heading', () => {
152
- const md = ['# CHANGELOG', '', '## Version 0.1.0', '', '- old'].join('\n');
153
- expect(hasVersion(md, '0.1.0')).toBe(true);
154
- expect(hasVersion(md, '0.2.0')).toBe(false);
155
- });
156
- });
157
- describe('insertVersionSection', () => {
158
- it('inserts the new version directly under the title, above older versions', () => {
159
- const md = ['# CHANGELOG', '', '## Version 0.1.0', '', '- old', ''].join('\n');
160
- const section = [
161
- '## Version 0.2.0',
162
- '',
163
- '### Changes',
164
- '',
165
- '- new',
166
- ''
167
- ].join('\n');
168
- expect(insertVersionSection(md, section)).toBe([
169
- '# CHANGELOG',
170
- '',
171
- '## Version 0.2.0',
172
- '',
173
- '### Changes',
174
- '',
175
- '- new',
176
- '',
177
- '## Version 0.1.0',
178
- '',
179
- '- old',
180
- ''
181
- ].join('\n'));
182
- });
183
- });
184
- async function tmpWorkspace(changelog, entries) {
185
- const dir = await mkdtemp(join(tmpdir(), 'changelog-'));
186
- tmpDirs.push(dir);
187
- const entriesDir = join(dir, 'changelog-next');
188
- await mkdir(entriesDir, { recursive: true });
189
- const changelogPath = join(dir, 'CHANGELOG.md');
190
- await writeFile(changelogPath, changelog);
191
- for (const [name, text] of Object.entries(entries))
192
- await writeFile(join(entriesDir, name), text);
193
- return { entriesDir, changelogPath };
194
- }
195
- describe('collateFiles', () => {
196
- const baseChangelog = [
197
- '# CHANGELOG',
198
- '',
199
- '## Version 0.1.0',
200
- '',
201
- '- first',
202
- ''
203
- ].join('\n');
204
- it('collates entries, deletes them, and returns the section', async () => {
205
- const { entriesDir, changelogPath } = await tmpWorkspace(baseChangelog, {
206
- '-template.md': '---\ntype:\n---\n- ignored template',
207
- 'feature.md': '---\ntype:\nbreaking: false\n---\n- Added a feature.',
208
- 'fix.md': '---\ntype: fixed\n---\n- Fixed a bug.'
209
- });
210
- const result = await collateFiles({
211
- entriesDir,
212
- changelogPath,
213
- version: '0.2.0'
214
- });
215
- expect(result.noop).toBe(false);
216
- if (result.noop === false) {
217
- expect(result.section).toContain('## Version 0.2.0');
218
- expect(result.section).toContain('### Changes\n\n- Added a feature.');
219
- expect(result.section).toContain('### Fixed\n\n- Fixed a bug.');
220
- }
221
- const written = await readFile(changelogPath, 'utf8');
222
- expect(written).toContain('## Version 0.2.0');
223
- expect(written).toContain('## Version 0.1.0');
224
- // template survives; consumed entries are gone
225
- expect((await readdir(entriesDir)).sort()).toEqual(['-template.md']);
226
- });
227
- it('absorbs an existing Unreleased section on collation', async () => {
228
- const changelog = [
229
- '# CHANGELOG',
230
- '',
231
- '## Unreleased',
232
- '',
233
- '- carried note',
234
- ''
235
- ].join('\n');
236
- const { entriesDir, changelogPath } = await tmpWorkspace(changelog, {});
237
- const result = await collateFiles({
238
- entriesDir,
239
- changelogPath,
240
- version: '0.2.0'
241
- });
242
- expect(result.noop).toBe(false);
243
- const written = await readFile(changelogPath, 'utf8');
244
- expect(written).toContain('## Version 0.2.0');
245
- expect(written).toContain('- carried note');
246
- expect(written).not.toContain('## Unreleased');
247
- });
248
- it('is a no-op when there are no entries and no Unreleased section', async () => {
249
- const { entriesDir, changelogPath } = await tmpWorkspace(baseChangelog, {});
250
- const result = await collateFiles({
251
- entriesDir,
252
- changelogPath,
253
- version: '0.2.0'
254
- });
255
- expect(result.noop).toBe(true);
256
- expect(await readFile(changelogPath, 'utf8')).toBe(baseChangelog);
257
- });
258
- it('errors when the target version already exists', async () => {
259
- const { entriesDir, changelogPath } = await tmpWorkspace(baseChangelog, {
260
- 'feature.md': '---\ntype:\n---\n- Added a feature.'
261
- });
262
- await expect(collateFiles({ entriesDir, changelogPath, version: '0.1.0' })).rejects.toThrow('already exists');
263
- });
264
- });
265
- describe('entryFileName', () => {
266
- it('sanitizes slashes and ensures a single .md suffix', () => {
267
- expect(entryFileName('fix/video bug')).toBe('fix-video bug.md');
268
- expect(entryFileName('already.md')).toBe('already.md');
269
- expect(entryFileName('a\\b')).toBe('a-b.md');
270
- });
271
- it('strips a leading dash so collate will not skip the entry', () => {
272
- expect(entryFileName('-foo')).toBe('foo.md');
273
- });
274
- });
275
- describe('addEntry', () => {
276
- it('copies the template to a new entry file and returns its path', async () => {
277
- const dir = await mkdtemp(join(tmpdir(), 'changelog-add-'));
278
- tmpDirs.push(dir);
279
- const entriesDir = join(dir, 'changelog-next');
280
- await mkdir(entriesDir, { recursive: true });
281
- const templatePath = join(entriesDir, '-template.md');
282
- await writeFile(templatePath, '---\ntype:\nbreaking: false\n---\n- describe me');
283
- const target = await addEntry({
284
- templatePath,
285
- entriesDir,
286
- name: 'my-change'
287
- });
288
- expect(target).toBe(join(entriesDir, 'my-change.md'));
289
- expect(await readFile(target, 'utf8')).toContain('- describe me');
290
- await expect(addEntry({ templatePath, entriesDir, name: 'my-change' })).rejects.toThrow('already exists');
291
- });
292
- });
293
- //# sourceMappingURL=changelog.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"changelog.test.js","sourceRoot":"","sources":["../../../test/changelog.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,EACL,SAAS,EACT,QAAQ,EACR,OAAO,EACP,EAAE,EACH,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,oBAAoB,EACpB,YAAY,EACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEtE,MAAM,OAAO,GAAa,EAAE,CAAC;AAE7B,QAAQ,CAAC,KAAK,IAAI,EAAE;IAClB,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK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EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC;QAC5D,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClB,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;QAC/C,MAAM,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACtD,MAAM,SAAS,CACb,YAAY,EACZ,iDAAiD,CAClD,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC;YAC5B,YAAY;YACZ,UAAU;YACV,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;QACtD,MAAM,CAAC,MAAM,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QAElE,MAAM,MAAM,CACV,QAAQ,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAC1D,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {\n mkdtemp,\n mkdir,\n writeFile,\n readFile,\n readdir,\n rm\n} from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { afterAll, describe, expect, it } from 'vitest';\nimport {\n parseEntry,\n groupEntries,\n renderVersionSection,\n extractUnreleased,\n hasVersion,\n insertVersionSection,\n collateFiles\n} from '../scripts/changelog-collate.js';\nimport { entryFileName, addEntry } from '../scripts/changelog-add.js';\n\nconst tmpDirs: string[] = [];\n\nafterAll(async () => {\n await Promise.all(\n tmpDirs.map((d) => rm(d, { recursive: true, force: true }))\n );\n});\n\ndescribe('parseEntry', () => {\n it('reads type and breaking from frontmatter and trims the body', () => {\n const input = [\n '---',\n 'type: fixed',\n 'breaking: true',\n '---',\n '- Fixed a thing.',\n ''\n ].join('\\n');\n expect(parseEntry(input)).toEqual({\n type: 'fixed',\n breaking: true,\n body: '- Fixed a thing.'\n });\n });\n\n it('defaults to empty type and breaking=false', () => {\n const input = [\n '---',\n 'type:',\n 'breaking: false',\n '---',\n '- A change.'\n ].join('\\n');\n expect(parseEntry(input)).toEqual({\n type: '',\n breaking: false,\n body: '- A change.'\n });\n });\n\n it('ignores comment lines and inline comments in frontmatter', () => {\n const input = [\n '---',\n '# type: omit for a normal change',\n 'type: deprecated # note',\n 'breaking: false',\n '---',\n '- Deprecated X.'\n ].join('\\n');\n expect(parseEntry(input)).toEqual({\n type: 'deprecated',\n breaking: false,\n body: '- Deprecated X.'\n });\n });\n\n it('treats a file with no frontmatter as an empty-type change', () => {\n expect(parseEntry('- Just a bullet.')).toEqual({\n type: '',\n breaking: false,\n body: '- Just a bullet.'\n });\n });\n});\n\ndescribe('groupEntries', () => {\n const entry = (name: string, type: string, breaking: boolean) => ({\n name,\n type,\n breaking,\n body: `- ${name}`\n });\n\n it('buckets by type, sorts by filename, and keeps breaking out of its type section (Option A)', () => {\n const grouped = groupEntries([\n entry('b-feature.md', '', false),\n entry('a-fix.md', 'fixed', false),\n entry('c-breaking-fix.md', 'fixed', true),\n entry('d-deprecate.md', 'deprecated', false)\n ]);\n expect(grouped).toEqual({\n breaking: ['- c-breaking-fix.md'],\n changes: ['- b-feature.md'],\n fixed: ['- a-fix.md'],\n deprecated: ['- d-deprecate.md']\n });\n });\n\n it('falls back to changes for an unknown type', () => {\n expect(groupEntries([entry('x.md', 'whoops', false)]).changes).toEqual([\n '- x.md'\n ]);\n });\n});\n\ndescribe('renderVersionSection', () => {\n it('renders sections in order and omits empty ones', () => {\n const out = renderVersionSection('0.2.0', {\n breaking: ['- Broke X.'],\n changes: ['- Added Y.'],\n fixed: [],\n deprecated: []\n });\n expect(out).toBe(\n [\n '## Version 0.2.0',\n '',\n '### ⚠ Breaking',\n '',\n '- Broke X.',\n '',\n '### Changes',\n '',\n '- Added Y.',\n ''\n ].join('\\n')\n );\n });\n\n it('appends an absorbed body verbatim after the generated sections', () => {\n const out = renderVersionSection(\n '0.2.0',\n { breaking: [], changes: ['- Added Y.'], fixed: [], deprecated: [] },\n '### Notes\\n\\n- carried over'\n );\n expect(out).toBe(\n [\n '## Version 0.2.0',\n '',\n '### Changes',\n '',\n '- Added Y.',\n '',\n '### Notes',\n '',\n '- carried over',\n ''\n ].join('\\n')\n );\n });\n});\n\ndescribe('extractUnreleased', () => {\n it('removes the Unreleased section and returns its body', () => {\n const md = [\n '# CHANGELOG',\n '',\n '## Unreleased',\n '',\n '- pending note',\n '',\n '## Version 0.1.0',\n '',\n '- old'\n ].join('\\n');\n const { body, md: rest } = extractUnreleased(md);\n expect(body).toBe('- pending note');\n expect(rest).toBe(\n ['# CHANGELOG', '', '## Version 0.1.0', '', '- old', ''].join('\\n')\n );\n });\n\n it('returns an empty body when there is no Unreleased section', () => {\n const md = ['# CHANGELOG', '', '## Version 0.1.0', '', '- old'].join('\\n');\n expect(extractUnreleased(md).body).toBe('');\n });\n});\n\ndescribe('hasVersion', () => {\n it('detects an existing version heading', () => {\n const md = ['# CHANGELOG', '', '## Version 0.1.0', '', '- old'].join('\\n');\n expect(hasVersion(md, '0.1.0')).toBe(true);\n expect(hasVersion(md, '0.2.0')).toBe(false);\n });\n});\n\ndescribe('insertVersionSection', () => {\n it('inserts the new version directly under the title, above older versions', () => {\n const md = ['# CHANGELOG', '', '## Version 0.1.0', '', '- old', ''].join(\n '\\n'\n );\n const section = [\n '## Version 0.2.0',\n '',\n '### Changes',\n '',\n '- new',\n ''\n ].join('\\n');\n expect(insertVersionSection(md, section)).toBe(\n [\n '# CHANGELOG',\n '',\n '## Version 0.2.0',\n '',\n '### Changes',\n '',\n '- new',\n '',\n '## Version 0.1.0',\n '',\n '- old',\n ''\n ].join('\\n')\n );\n });\n});\n\nasync function tmpWorkspace(\n changelog: string,\n entries: Record<string, string>\n) {\n const dir = await mkdtemp(join(tmpdir(), 'changelog-'));\n tmpDirs.push(dir);\n const entriesDir = join(dir, 'changelog-next');\n await mkdir(entriesDir, { recursive: true });\n const changelogPath = join(dir, 'CHANGELOG.md');\n await writeFile(changelogPath, changelog);\n for (const [name, text] of Object.entries(entries))\n await writeFile(join(entriesDir, name), text);\n return { entriesDir, changelogPath };\n}\n\ndescribe('collateFiles', () => {\n const baseChangelog = [\n '# CHANGELOG',\n '',\n '## Version 0.1.0',\n '',\n '- first',\n ''\n ].join('\\n');\n\n it('collates entries, deletes them, and returns the section', async () => {\n const { entriesDir, changelogPath } = await tmpWorkspace(baseChangelog, {\n '-template.md': '---\\ntype:\\n---\\n- ignored template',\n 'feature.md': '---\\ntype:\\nbreaking: false\\n---\\n- Added a feature.',\n 'fix.md': '---\\ntype: fixed\\n---\\n- Fixed a bug.'\n });\n const result = await collateFiles({\n entriesDir,\n changelogPath,\n version: '0.2.0'\n });\n expect(result.noop).toBe(false);\n if (result.noop === false) {\n expect(result.section).toContain('## Version 0.2.0');\n expect(result.section).toContain('### Changes\\n\\n- Added a feature.');\n expect(result.section).toContain('### Fixed\\n\\n- Fixed a bug.');\n }\n const written = await readFile(changelogPath, 'utf8');\n expect(written).toContain('## Version 0.2.0');\n expect(written).toContain('## Version 0.1.0');\n // template survives; consumed entries are gone\n expect((await readdir(entriesDir)).sort()).toEqual(['-template.md']);\n });\n\n it('absorbs an existing Unreleased section on collation', async () => {\n const changelog = [\n '# CHANGELOG',\n '',\n '## Unreleased',\n '',\n '- carried note',\n ''\n ].join('\\n');\n const { entriesDir, changelogPath } = await tmpWorkspace(changelog, {});\n const result = await collateFiles({\n entriesDir,\n changelogPath,\n version: '0.2.0'\n });\n expect(result.noop).toBe(false);\n const written = await readFile(changelogPath, 'utf8');\n expect(written).toContain('## Version 0.2.0');\n expect(written).toContain('- carried note');\n expect(written).not.toContain('## Unreleased');\n });\n\n it('is a no-op when there are no entries and no Unreleased section', async () => {\n const { entriesDir, changelogPath } = await tmpWorkspace(baseChangelog, {});\n const result = await collateFiles({\n entriesDir,\n changelogPath,\n version: '0.2.0'\n });\n expect(result.noop).toBe(true);\n expect(await readFile(changelogPath, 'utf8')).toBe(baseChangelog);\n });\n\n it('errors when the target version already exists', async () => {\n const { entriesDir, changelogPath } = await tmpWorkspace(baseChangelog, {\n 'feature.md': '---\\ntype:\\n---\\n- Added a feature.'\n });\n await expect(\n collateFiles({ entriesDir, changelogPath, version: '0.1.0' })\n ).rejects.toThrow('already exists');\n });\n});\n\ndescribe('entryFileName', () => {\n it('sanitizes slashes and ensures a single .md suffix', () => {\n expect(entryFileName('fix/video bug')).toBe('fix-video bug.md');\n expect(entryFileName('already.md')).toBe('already.md');\n expect(entryFileName('a\\\\b')).toBe('a-b.md');\n });\n\n it('strips a leading dash so collate will not skip the entry', () => {\n expect(entryFileName('-foo')).toBe('foo.md');\n });\n});\n\ndescribe('addEntry', () => {\n it('copies the template to a new entry file and returns its path', async () => {\n const dir = await mkdtemp(join(tmpdir(), 'changelog-add-'));\n tmpDirs.push(dir);\n const entriesDir = join(dir, 'changelog-next');\n await mkdir(entriesDir, { recursive: true });\n const templatePath = join(entriesDir, '-template.md');\n await writeFile(\n templatePath,\n '---\\ntype:\\nbreaking: false\\n---\\n- describe me'\n );\n\n const target = await addEntry({\n templatePath,\n entriesDir,\n name: 'my-change'\n });\n expect(target).toBe(join(entriesDir, 'my-change.md'));\n expect(await readFile(target, 'utf8')).toContain('- describe me');\n\n await expect(\n addEntry({ templatePath, entriesDir, name: 'my-change' })\n ).rejects.toThrow('already exists');\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=dispatcher.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dispatcher.test.d.ts","sourceRoot":"","sources":["../../../../test/cli/dispatcher.test.ts"],"names":[],"mappings":""}
@@ -1,54 +0,0 @@
1
- import { spawnSync } from 'node:child_process';
2
- import path from 'node:path';
3
- import { tmpdir } from 'node:os';
4
- import { fileURLToPath } from 'node:url';
5
- import { describe, expect, it } from 'vitest';
6
- const here = path.dirname(fileURLToPath(import.meta.url));
7
- const CLI = path.resolve(here, '..', '..', 'dist', 'cli.js');
8
- function run(args, extraEnv = {}) {
9
- const r = spawnSync('node', [CLI, ...args], {
10
- encoding: 'utf8',
11
- // Don't inherit env — the bare/--help/unknown paths must succeed
12
- // regardless of CESDK_LICENSE etc., since they don't actually start a
13
- // transport.
14
- env: { PATH: process.env.PATH ?? '', ...extraEnv },
15
- timeout: 10000
16
- });
17
- return {
18
- code: r.status ?? -1,
19
- stdout: r.stdout ?? '',
20
- stderr: r.stderr ?? ''
21
- };
22
- }
23
- describe('codesign-mcp dispatcher', () => {
24
- it('prints usage and exits 0 for --help', () => {
25
- const r = run(['--help']);
26
- expect(r.code).toBe(0);
27
- expect(r.stdout).toContain('Usage: codesign-mcp');
28
- expect(r.stdout).toContain('stdio');
29
- expect(r.stdout).toContain('http');
30
- });
31
- it('prints usage and exits 0 for -h', () => {
32
- const r = run(['-h']);
33
- expect(r.code).toBe(0);
34
- expect(r.stdout).toContain('Usage: codesign-mcp');
35
- });
36
- it('prints usage to stderr and exits 2 when no subcommand is given', () => {
37
- const r = run([]);
38
- expect(r.code).toBe(2);
39
- expect(r.stderr).toContain('missing subcommand');
40
- expect(r.stderr).toContain('Usage: codesign-mcp');
41
- });
42
- it('rejects unknown subcommand with stderr + exit 2', () => {
43
- const r = run(['bogus']);
44
- expect(r.code).toBe(2);
45
- expect(r.stderr).toContain('unknown subcommand "bogus"');
46
- });
47
- it('diagnose: exits 0 and prints a .zip path to stdout', () => {
48
- const diagDir = path.join(tmpdir(), `diag-dispatcher-test-${Date.now()}`);
49
- const r = run(['diagnose'], { IMGLY_DIAGNOSTICS_DIR: diagDir });
50
- expect(r.code).toBe(0);
51
- expect(r.stdout).toContain('.zip');
52
- });
53
- });
54
- //# sourceMappingURL=dispatcher.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dispatcher.test.js","sourceRoot":"","sources":["../../../../test/cli/dispatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAE7D,SAAS,GAAG,CACV,IAAc,EACd,WAAmC,EAAE;IAErC,MAAM,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE;QAC1C,QAAQ,EAAE,MAAM;QAChB,iEAAiE;QACjE,sEAAsE;QACtE,aAAa;QACb,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,EAAE,GAAG,QAAQ,EAAE;QAClD,OAAO,EAAE,KAAK;KACf,CAAC,CAAC;IACH,OAAO;QACL,IAAI,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;QACpB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;QACtB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;KACvB,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CA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AC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,wBAAwB,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC1E,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,UAAU,CAAC,EAAE,EAAE,qBAAqB,EAAE,OAAO,EAAE,CAAC,CAAC;QAChE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { spawnSync } from 'node:child_process';\nimport path from 'node:path';\nimport { tmpdir } from 'node:os';\nimport { fileURLToPath } from 'node:url';\nimport { describe, expect, it } from 'vitest';\n\nconst here = path.dirname(fileURLToPath(import.meta.url));\nconst CLI = path.resolve(here, '..', '..', 'dist', 'cli.js');\n\nfunction run(\n args: string[],\n extraEnv: Record<string, string> = {}\n): { code: number; stdout: string; stderr: string } {\n const r = spawnSync('node', [CLI, ...args], {\n encoding: 'utf8',\n // Don't inherit env — the bare/--help/unknown paths must succeed\n // regardless of CESDK_LICENSE etc., since they don't actually start a\n // transport.\n env: { PATH: process.env.PATH ?? '', ...extraEnv },\n timeout: 10000\n });\n return {\n code: r.status ?? -1,\n stdout: r.stdout ?? '',\n stderr: r.stderr ?? ''\n };\n}\n\ndescribe('codesign-mcp dispatcher', () => {\n it('prints usage and exits 0 for --help', () => {\n const r = run(['--help']);\n expect(r.code).toBe(0);\n expect(r.stdout).toContain('Usage: codesign-mcp');\n expect(r.stdout).toContain('stdio');\n expect(r.stdout).toContain('http');\n });\n\n it('prints usage and exits 0 for -h', () => {\n const r = run(['-h']);\n expect(r.code).toBe(0);\n expect(r.stdout).toContain('Usage: codesign-mcp');\n });\n\n it('prints usage to stderr and exits 2 when no subcommand is given', () => {\n const r = run([]);\n expect(r.code).toBe(2);\n expect(r.stderr).toContain('missing subcommand');\n expect(r.stderr).toContain('Usage: codesign-mcp');\n });\n\n it('rejects unknown subcommand with stderr + exit 2', () => {\n const r = run(['bogus']);\n expect(r.code).toBe(2);\n expect(r.stderr).toContain('unknown subcommand \"bogus\"');\n });\n\n it('diagnose: exits 0 and prints a .zip path to stdout', () => {\n const diagDir = path.join(tmpdir(), `diag-dispatcher-test-${Date.now()}`);\n const r = run(['diagnose'], { IMGLY_DIAGNOSTICS_DIR: diagDir });\n expect(r.code).toBe(0);\n expect(r.stdout).toContain('.zip');\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=redirect-console.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redirect-console.test.d.ts","sourceRoot":"","sources":["../../../../test/cli/redirect-console.test.ts"],"names":[],"mappings":""}