@fantasticit/sumi 0.13.0 → 0.14.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 (458) hide show
  1. package/README.md +7 -7
  2. package/dist/adapters.d.ts +3 -27
  3. package/dist/adapters.js +75 -134
  4. package/dist/adapters.js.map +1 -1
  5. package/dist/agent-hooks.d.ts +32 -11
  6. package/dist/agent-hooks.js +546 -194
  7. package/dist/agent-hooks.js.map +1 -1
  8. package/dist/agents.d.ts +1 -3
  9. package/dist/agents.js +12 -15
  10. package/dist/agents.js.map +1 -1
  11. package/dist/bin.js +14 -10
  12. package/dist/bin.js.map +1 -1
  13. package/dist/cli.d.ts +1 -1
  14. package/dist/cli.js +135 -7
  15. package/dist/cli.js.map +1 -1
  16. package/dist/compaction-marker.d.ts +4 -0
  17. package/dist/compaction-marker.js +37 -0
  18. package/dist/compaction-marker.js.map +1 -0
  19. package/dist/config-text.d.ts +1 -1
  20. package/dist/config-text.js +21 -13
  21. package/dist/config-text.js.map +1 -1
  22. package/dist/constraint-list.js +1 -1
  23. package/dist/constraint-list.js.map +1 -1
  24. package/dist/context-providers.js +12 -0
  25. package/dist/context-providers.js.map +1 -0
  26. package/dist/context.js +49 -51
  27. package/dist/context.js.map +1 -1
  28. package/dist/declared-hooks.d.ts +29 -0
  29. package/dist/declared-hooks.js +99 -0
  30. package/dist/declared-hooks.js.map +1 -0
  31. package/dist/hook-output.d.ts +3 -0
  32. package/dist/hook-output.js +5 -0
  33. package/dist/hook-output.js.map +1 -0
  34. package/dist/hook-routing.d.ts +29 -1
  35. package/dist/hook-routing.js +106 -15
  36. package/dist/hook-routing.js.map +1 -1
  37. package/dist/host-adapters.d.ts +32 -0
  38. package/dist/host-adapters.js +97 -0
  39. package/dist/host-adapters.js.map +1 -0
  40. package/dist/instructions.js +7 -5
  41. package/dist/instructions.js.map +1 -1
  42. package/dist/launcher.cjs +350 -158
  43. package/dist/launcher.js +13 -2
  44. package/dist/launcher.js.map +1 -1
  45. package/dist/run-stats.d.ts +6 -0
  46. package/dist/run-stats.js +44 -3
  47. package/dist/run-stats.js.map +1 -1
  48. package/dist/scaffold-commands.js +18 -7
  49. package/dist/scaffold-commands.js.map +1 -1
  50. package/dist/stop-hint.d.ts +4 -0
  51. package/dist/stop-hint.js +29 -0
  52. package/dist/stop-hint.js.map +1 -0
  53. package/dist/subagent-history.d.ts +2 -0
  54. package/dist/subagent-history.js +35 -0
  55. package/dist/subagent-history.js.map +1 -0
  56. package/dist/task.js +45 -37
  57. package/dist/task.js.map +1 -1
  58. package/dist/vendor.js +10 -4
  59. package/dist/vendor.js.map +1 -1
  60. package/dist/visualize-page.js +2 -25
  61. package/dist/visualize-page.js.map +1 -1
  62. package/node_modules/@sumi/create/dist/scaffold.js +5 -4
  63. package/node_modules/@sumi/create/dist/scaffold.js.map +1 -1
  64. package/node_modules/@sumi/create/package.json +2 -2
  65. package/node_modules/@sumi/create/template/AGENTS.md +1 -1
  66. package/node_modules/@sumi/create/template/control/config.yaml +3 -0
  67. package/node_modules/@sumi/create/template/control/flows/change.flow.yaml +8 -5
  68. package/node_modules/@sumi/create/template/control/flows/check.flow.yaml +7 -21
  69. package/node_modules/@sumi/create/template/control/rubrics/behavior.yaml +14 -1
  70. package/node_modules/@sumi/create/template/control/rubrics/omission.yaml +1 -1
  71. package/node_modules/@sumi/create/template/control/rubrics/{clean-code.yaml → quality.yaml} +12 -4
  72. package/node_modules/@sumi/create/template/control/rules/boundaries.md +25 -0
  73. package/node_modules/@sumi/create/template/control/rules/codecheck.md +1 -1
  74. package/node_modules/@sumi/create/template/control/rules/development.md +7 -2
  75. package/node_modules/@sumi/create/template/init/AGENTS.md +1 -1
  76. package/node_modules/@sumi/create/template/init/control/flows/change.flow.yaml +7 -4
  77. package/node_modules/@sumi/create/template/init/control/flows/check.flow.yaml +3 -0
  78. package/node_modules/@sumi/create/template/init/control/rubrics/behavior.yaml +30 -0
  79. package/node_modules/@sumi/create/template/init/control/rubrics/omission.yaml +13 -0
  80. package/node_modules/@sumi/create/template/init/control/rubrics/quality.yaml +22 -0
  81. package/node_modules/@sumi/create/template/init/control/rubrics/security.yaml +20 -0
  82. package/node_modules/@sumi/create/template/init/openspec/config.yaml +6 -0
  83. package/node_modules/@sumi/create/template/openspec/config.yaml +6 -0
  84. package/node_modules/@sumi/kernel/dist/config.d.ts +19 -0
  85. package/node_modules/@sumi/kernel/dist/config.js +72 -17
  86. package/node_modules/@sumi/kernel/dist/config.js.map +1 -1
  87. package/node_modules/@sumi/kernel/dist/context-providers.d.ts +17 -0
  88. package/node_modules/@sumi/kernel/dist/context-providers.js +74 -0
  89. package/node_modules/@sumi/kernel/dist/context-providers.js.map +1 -0
  90. package/node_modules/@sumi/kernel/dist/engine.js +119 -71
  91. package/node_modules/@sumi/kernel/dist/engine.js.map +1 -1
  92. package/node_modules/@sumi/kernel/dist/flow.d.ts +7 -0
  93. package/node_modules/@sumi/kernel/dist/flow.js +16 -0
  94. package/node_modules/@sumi/kernel/dist/flow.js.map +1 -1
  95. package/node_modules/@sumi/kernel/dist/index.d.ts +3 -0
  96. package/node_modules/@sumi/kernel/dist/index.js +3 -0
  97. package/node_modules/@sumi/kernel/dist/index.js.map +1 -1
  98. package/node_modules/@sumi/kernel/dist/plan.d.ts +12 -0
  99. package/node_modules/@sumi/kernel/dist/plan.js.map +1 -1
  100. package/node_modules/@sumi/kernel/dist/record.d.ts +10 -1
  101. package/node_modules/@sumi/kernel/dist/record.js +133 -3
  102. package/node_modules/@sumi/kernel/dist/record.js.map +1 -1
  103. package/node_modules/@sumi/kernel/dist/resume.d.ts +3 -1
  104. package/node_modules/@sumi/kernel/dist/resume.js +35 -27
  105. package/node_modules/@sumi/kernel/dist/resume.js.map +1 -1
  106. package/node_modules/@sumi/kernel/dist/runtime.d.ts +2 -0
  107. package/node_modules/@sumi/kernel/dist/runtime.js +30 -0
  108. package/node_modules/@sumi/kernel/dist/runtime.js.map +1 -0
  109. package/node_modules/@sumi/kernel/dist/scope.d.ts +2 -1
  110. package/node_modules/@sumi/kernel/dist/scope.js +2 -2
  111. package/node_modules/@sumi/kernel/dist/scope.js.map +1 -1
  112. package/node_modules/@sumi/kernel/dist/source-monitor.d.ts +20 -0
  113. package/node_modules/@sumi/kernel/dist/source-monitor.js +105 -0
  114. package/node_modules/@sumi/kernel/dist/source-monitor.js.map +1 -0
  115. package/node_modules/@sumi/kernel/dist/step-cache.d.ts +1 -1
  116. package/node_modules/@sumi/kernel/dist/step-cache.js +62 -51
  117. package/node_modules/@sumi/kernel/dist/step-cache.js.map +1 -1
  118. package/node_modules/@sumi/kernel/dist/step.d.ts +61 -0
  119. package/node_modules/@sumi/kernel/dist/step.js +55 -0
  120. package/node_modules/@sumi/kernel/dist/step.js.map +1 -0
  121. package/node_modules/@sumi/kernel/package.json +6 -2
  122. package/node_modules/@sumi/plugin-sdk/README.md +3 -3
  123. package/node_modules/@sumi/plugin-sdk/dist/context-delivery.d.ts +15 -0
  124. package/node_modules/@sumi/plugin-sdk/dist/context-delivery.js +28 -0
  125. package/node_modules/@sumi/plugin-sdk/dist/context-delivery.js.map +1 -0
  126. package/node_modules/@sumi/plugin-sdk/dist/context-scope.d.ts +2 -0
  127. package/node_modules/@sumi/plugin-sdk/dist/context-scope.js +49 -0
  128. package/node_modules/@sumi/plugin-sdk/dist/context-scope.js.map +1 -0
  129. package/node_modules/@sumi/plugin-sdk/dist/edit-paths.d.ts +2 -0
  130. package/node_modules/@sumi/plugin-sdk/dist/edit-paths.js +54 -0
  131. package/node_modules/@sumi/plugin-sdk/dist/edit-paths.js.map +1 -0
  132. package/node_modules/@sumi/plugin-sdk/dist/files.d.ts +1 -1
  133. package/node_modules/@sumi/plugin-sdk/dist/files.js +64 -13
  134. package/node_modules/@sumi/plugin-sdk/dist/files.js.map +1 -1
  135. package/node_modules/@sumi/plugin-sdk/dist/host-event.d.ts +9 -2
  136. package/node_modules/@sumi/plugin-sdk/dist/host-event.js +41 -16
  137. package/node_modules/@sumi/plugin-sdk/dist/host-event.js.map +1 -1
  138. package/node_modules/@sumi/plugin-sdk/dist/html-page.d.ts +5 -0
  139. package/node_modules/@sumi/plugin-sdk/dist/html-page.js +93 -0
  140. package/node_modules/@sumi/plugin-sdk/dist/html-page.js.map +1 -0
  141. package/node_modules/@sumi/plugin-sdk/dist/html-style.d.ts +1 -0
  142. package/node_modules/@sumi/plugin-sdk/dist/html-style.js +27 -0
  143. package/node_modules/@sumi/plugin-sdk/dist/html-style.js.map +1 -0
  144. package/node_modules/@sumi/plugin-sdk/dist/index.d.ts +7 -0
  145. package/node_modules/@sumi/plugin-sdk/dist/index.js +7 -0
  146. package/node_modules/@sumi/plugin-sdk/dist/index.js.map +1 -1
  147. package/node_modules/@sumi/plugin-sdk/dist/permissions.d.ts +7 -0
  148. package/node_modules/@sumi/plugin-sdk/dist/permissions.js +41 -0
  149. package/node_modules/@sumi/plugin-sdk/dist/permissions.js.map +1 -0
  150. package/node_modules/@sumi/plugin-sdk/dist/project.d.ts +2 -0
  151. package/node_modules/@sumi/plugin-sdk/dist/project.js +2 -0
  152. package/node_modules/@sumi/plugin-sdk/dist/project.js.map +1 -1
  153. package/node_modules/@sumi/plugin-sdk/dist/protocol.d.ts +39 -4
  154. package/node_modules/@sumi/plugin-sdk/dist/protocol.js +12 -4
  155. package/node_modules/@sumi/plugin-sdk/dist/protocol.js.map +1 -1
  156. package/node_modules/@sumi/plugin-sdk/dist/sdk.js +3 -1
  157. package/node_modules/@sumi/plugin-sdk/dist/sdk.js.map +1 -1
  158. package/node_modules/@sumi/plugin-sdk/dist/session-context.d.ts +26 -1
  159. package/node_modules/@sumi/plugin-sdk/dist/session-context.js +98 -17
  160. package/node_modules/@sumi/plugin-sdk/dist/session-context.js.map +1 -1
  161. package/node_modules/@sumi/plugin-sdk/dist/shell.js +2 -1
  162. package/node_modules/@sumi/plugin-sdk/dist/shell.js.map +1 -1
  163. package/node_modules/@sumi/plugin-sdk/dist/snapshot.d.ts +12 -0
  164. package/node_modules/@sumi/plugin-sdk/dist/snapshot.js +29 -5
  165. package/node_modules/@sumi/plugin-sdk/dist/snapshot.js.map +1 -1
  166. package/node_modules/@sumi/plugin-sdk/dist/trace.d.ts +7 -2
  167. package/node_modules/@sumi/plugin-sdk/dist/trace.js +21 -1
  168. package/node_modules/@sumi/plugin-sdk/dist/trace.js.map +1 -1
  169. package/node_modules/@sumi/plugin-sdk/dist/validate.js +25 -1
  170. package/node_modules/@sumi/plugin-sdk/dist/validate.js.map +1 -1
  171. package/node_modules/@sumi/plugin-sdk/dist/yaml-text.d.ts +7 -0
  172. package/node_modules/@sumi/plugin-sdk/dist/yaml-text.js +116 -0
  173. package/node_modules/@sumi/plugin-sdk/dist/yaml-text.js.map +1 -0
  174. package/node_modules/@sumi/plugin-sdk/package.json +3 -2
  175. package/node_modules/@sumi/plugins-core/dist/agent-rules.js +2 -2
  176. package/node_modules/@sumi/plugins-core/dist/agent-rules.js.map +1 -1
  177. package/node_modules/@sumi/plugins-core/dist/commands/adopt.js +7 -5
  178. package/node_modules/@sumi/plugins-core/dist/commands/adopt.js.map +1 -1
  179. package/node_modules/@sumi/plugins-core/dist/commands/context-impact.js +9 -21
  180. package/node_modules/@sumi/plugins-core/dist/commands/context-impact.js.map +1 -1
  181. package/node_modules/@sumi/plugins-core/dist/context-provider.d.ts +3 -0
  182. package/node_modules/@sumi/plugins-core/dist/context-provider.js +45 -0
  183. package/node_modules/@sumi/plugins-core/dist/context-provider.js.map +1 -0
  184. package/node_modules/@sumi/plugins-core/dist/plugins/coverage.js +110 -15
  185. package/node_modules/@sumi/plugins-core/dist/plugins/coverage.js.map +1 -1
  186. package/node_modules/@sumi/plugins-core/dist/plugins/test-affected.js +32 -5
  187. package/node_modules/@sumi/plugins-core/dist/plugins/test-affected.js.map +1 -1
  188. package/node_modules/@sumi/plugins-core/dist/vitest-runner.js +1 -0
  189. package/node_modules/@sumi/plugins-core/dist/vitest-runner.js.map +1 -1
  190. package/node_modules/@sumi/plugins-core/instructions/bugfix.md +4 -0
  191. package/node_modules/@sumi/plugins-core/instructions/feature.md +2 -0
  192. package/node_modules/@sumi/plugins-core/package.json +2 -2
  193. package/node_modules/@sumi/plugins-core/sumi-plugins.yaml +1 -0
  194. package/node_modules/@sumi/plugins-governance/assets/hook-bootstrap.cjs +195 -0
  195. package/node_modules/@sumi/plugins-governance/dist/boundary-hooks.d.ts +12 -0
  196. package/node_modules/@sumi/plugins-governance/dist/boundary-hooks.js +76 -0
  197. package/node_modules/@sumi/plugins-governance/dist/boundary-hooks.js.map +1 -0
  198. package/node_modules/@sumi/plugins-governance/dist/boundary.d.ts +42 -0
  199. package/node_modules/@sumi/plugins-governance/dist/boundary.js +206 -0
  200. package/node_modules/@sumi/plugins-governance/dist/boundary.js.map +1 -0
  201. package/node_modules/@sumi/plugins-governance/dist/checkout.d.ts +1 -0
  202. package/node_modules/@sumi/plugins-governance/dist/checkout.js +16 -6
  203. package/node_modules/@sumi/plugins-governance/dist/checkout.js.map +1 -1
  204. package/node_modules/@sumi/plugins-governance/dist/commands/boundary-after-edit.js +14 -0
  205. package/node_modules/@sumi/plugins-governance/dist/commands/boundary-after-edit.js.map +1 -0
  206. package/node_modules/@sumi/plugins-governance/dist/commands/boundary-before-edit.js +22 -0
  207. package/node_modules/@sumi/plugins-governance/dist/commands/boundary-before-edit.js.map +1 -0
  208. package/node_modules/@sumi/plugins-governance/dist/commands/boundary-prompt.js +12 -0
  209. package/node_modules/@sumi/plugins-governance/dist/commands/boundary-prompt.js.map +1 -0
  210. package/node_modules/@sumi/plugins-governance/dist/commands/boundary.d.ts +1 -0
  211. package/node_modules/@sumi/plugins-governance/dist/commands/boundary.js +48 -0
  212. package/node_modules/@sumi/plugins-governance/dist/commands/boundary.js.map +1 -0
  213. package/node_modules/@sumi/plugins-governance/dist/commands/context-state.d.ts +1 -0
  214. package/node_modules/@sumi/plugins-governance/dist/commands/context-state.js +4 -0
  215. package/node_modules/@sumi/plugins-governance/dist/commands/context-state.js.map +1 -0
  216. package/node_modules/@sumi/plugins-governance/dist/commands/gate.js +168 -24
  217. package/node_modules/@sumi/plugins-governance/dist/commands/gate.js.map +1 -1
  218. package/node_modules/@sumi/plugins-governance/dist/commands/pr-report-check.js +5 -2
  219. package/node_modules/@sumi/plugins-governance/dist/commands/pr-report-check.js.map +1 -1
  220. package/node_modules/@sumi/plugins-governance/dist/commands/pr-report.js +5 -1
  221. package/node_modules/@sumi/plugins-governance/dist/commands/pr-report.js.map +1 -1
  222. package/node_modules/@sumi/plugins-governance/dist/commands/resume-work.d.ts +1 -0
  223. package/node_modules/@sumi/plugins-governance/dist/commands/resume-work.js +6 -0
  224. package/node_modules/@sumi/plugins-governance/dist/commands/resume-work.js.map +1 -0
  225. package/node_modules/@sumi/plugins-governance/dist/commands/run-policy.d.ts +1 -0
  226. package/node_modules/@sumi/plugins-governance/dist/commands/run-policy.js +19 -0
  227. package/node_modules/@sumi/plugins-governance/dist/commands/run-policy.js.map +1 -0
  228. package/node_modules/@sumi/plugins-governance/dist/commands/stop-work.d.ts +1 -0
  229. package/node_modules/@sumi/plugins-governance/dist/commands/stop-work.js +12 -0
  230. package/node_modules/@sumi/plugins-governance/dist/commands/stop-work.js.map +1 -0
  231. package/node_modules/@sumi/plugins-governance/dist/commands/view.d.ts +1 -0
  232. package/node_modules/@sumi/plugins-governance/dist/commands/view.js +45 -0
  233. package/node_modules/@sumi/plugins-governance/dist/commands/view.js.map +1 -0
  234. package/node_modules/@sumi/plugins-governance/dist/config-recovery.d.ts +2 -0
  235. package/node_modules/@sumi/plugins-governance/dist/config-recovery.js +15 -0
  236. package/node_modules/@sumi/plugins-governance/dist/config-recovery.js.map +1 -0
  237. package/node_modules/@sumi/plugins-governance/dist/context-provider.d.ts +2 -0
  238. package/node_modules/@sumi/plugins-governance/dist/context-provider.js +22 -0
  239. package/node_modules/@sumi/plugins-governance/dist/context-provider.js.map +1 -0
  240. package/node_modules/@sumi/plugins-governance/dist/gate-cache.js +10 -2
  241. package/node_modules/@sumi/plugins-governance/dist/gate-cache.js.map +1 -1
  242. package/node_modules/@sumi/plugins-governance/dist/guard.js +4 -4
  243. package/node_modules/@sumi/plugins-governance/dist/guard.js.map +1 -1
  244. package/node_modules/@sumi/plugins-governance/dist/human-stop.d.ts +4 -0
  245. package/node_modules/@sumi/plugins-governance/dist/human-stop.js +39 -0
  246. package/node_modules/@sumi/plugins-governance/dist/human-stop.js.map +1 -0
  247. package/node_modules/@sumi/plugins-governance/dist/index.d.ts +5 -1
  248. package/node_modules/@sumi/plugins-governance/dist/index.js +5 -1
  249. package/node_modules/@sumi/plugins-governance/dist/index.js.map +1 -1
  250. package/node_modules/@sumi/plugins-governance/dist/plugins/state-writable.d.ts +1 -0
  251. package/node_modules/@sumi/plugins-governance/dist/plugins/state-writable.js +4 -0
  252. package/node_modules/@sumi/plugins-governance/dist/plugins/state-writable.js.map +1 -0
  253. package/node_modules/@sumi/plugins-governance/dist/pr-report-compose.d.ts +1 -1
  254. package/node_modules/@sumi/plugins-governance/dist/pr-report-compose.js +2 -1
  255. package/node_modules/@sumi/plugins-governance/dist/pr-report-compose.js.map +1 -1
  256. package/node_modules/@sumi/plugins-governance/dist/pr-report-markers.d.ts +1 -0
  257. package/node_modules/@sumi/plugins-governance/dist/pr-report-markers.js +1 -0
  258. package/node_modules/@sumi/plugins-governance/dist/pr-report-markers.js.map +1 -1
  259. package/node_modules/@sumi/plugins-governance/dist/pr-report-sections.js +4 -1
  260. package/node_modules/@sumi/plugins-governance/dist/pr-report-sections.js.map +1 -1
  261. package/node_modules/@sumi/plugins-governance/dist/pr-report-status.d.ts +1 -1
  262. package/node_modules/@sumi/plugins-governance/dist/pr-report-status.js +22 -3
  263. package/node_modules/@sumi/plugins-governance/dist/pr-report-status.js.map +1 -1
  264. package/node_modules/@sumi/plugins-governance/dist/preflight.d.ts +18 -0
  265. package/node_modules/@sumi/plugins-governance/dist/preflight.js +120 -0
  266. package/node_modules/@sumi/plugins-governance/dist/preflight.js.map +1 -0
  267. package/node_modules/@sumi/plugins-governance/dist/protected.d.ts +1 -0
  268. package/node_modules/@sumi/plugins-governance/dist/protected.js +1 -0
  269. package/node_modules/@sumi/plugins-governance/dist/protected.js.map +1 -1
  270. package/node_modules/@sumi/plugins-governance/dist/report-view.d.ts +12 -0
  271. package/node_modules/@sumi/plugins-governance/dist/report-view.js +59 -0
  272. package/node_modules/@sumi/plugins-governance/dist/report-view.js.map +1 -0
  273. package/node_modules/@sumi/plugins-governance/dist/state-access.d.ts +3 -0
  274. package/node_modules/@sumi/plugins-governance/dist/state-access.js +35 -0
  275. package/node_modules/@sumi/plugins-governance/dist/state-access.js.map +1 -0
  276. package/node_modules/@sumi/plugins-governance/dist/state.js +1 -4
  277. package/node_modules/@sumi/plugins-governance/dist/state.js.map +1 -1
  278. package/node_modules/@sumi/plugins-governance/dist/upgrade-command.d.ts +1 -0
  279. package/node_modules/@sumi/plugins-governance/dist/upgrade-command.js +30 -0
  280. package/node_modules/@sumi/plugins-governance/dist/upgrade-command.js.map +1 -0
  281. package/node_modules/@sumi/plugins-governance/dist/view-page.d.ts +4 -0
  282. package/node_modules/@sumi/plugins-governance/dist/view-page.js +51 -0
  283. package/node_modules/@sumi/plugins-governance/dist/view-page.js.map +1 -0
  284. package/node_modules/@sumi/plugins-governance/instructions/boundary.md +35 -0
  285. package/node_modules/@sumi/plugins-governance/instructions/push.md +11 -8
  286. package/node_modules/@sumi/plugins-governance/package.json +6 -3
  287. package/node_modules/@sumi/plugins-governance/sumi-plugins.yaml +30 -1
  288. package/node_modules/@sumi/plugins-openspec/package.json +4 -4
  289. package/node_modules/@sumi/plugins-precedent/README.md +6 -4
  290. package/node_modules/@sumi/plugins-precedent/dist/after-edit-context.d.ts +6 -23
  291. package/node_modules/@sumi/plugins-precedent/dist/after-edit-context.js +48 -156
  292. package/node_modules/@sumi/plugins-precedent/dist/after-edit-context.js.map +1 -1
  293. package/node_modules/@sumi/plugins-precedent/dist/commands/before-edit-context.js +16 -13
  294. package/node_modules/@sumi/plugins-precedent/dist/commands/before-edit-context.js.map +1 -1
  295. package/node_modules/@sumi/plugins-precedent/dist/commands/context.js +3 -44
  296. package/node_modules/@sumi/plugins-precedent/dist/commands/context.js.map +1 -1
  297. package/node_modules/@sumi/plugins-precedent/dist/commands/impact-submit.js +2 -1
  298. package/node_modules/@sumi/plugins-precedent/dist/commands/impact-submit.js.map +1 -1
  299. package/node_modules/@sumi/plugins-precedent/dist/context-output.d.ts +65 -0
  300. package/node_modules/@sumi/plugins-precedent/dist/context-output.js +186 -0
  301. package/node_modules/@sumi/plugins-precedent/dist/context-output.js.map +1 -0
  302. package/node_modules/@sumi/plugins-precedent/dist/context-provider.d.ts +3 -0
  303. package/node_modules/@sumi/plugins-precedent/dist/context-provider.js +48 -0
  304. package/node_modules/@sumi/plugins-precedent/dist/context-provider.js.map +1 -0
  305. package/node_modules/@sumi/plugins-precedent/dist/impact-state.js +4 -6
  306. package/node_modules/@sumi/plugins-precedent/dist/impact-state.js.map +1 -1
  307. package/node_modules/@sumi/plugins-precedent/dist/impact.js +1 -2
  308. package/node_modules/@sumi/plugins-precedent/dist/impact.js.map +1 -1
  309. package/node_modules/@sumi/plugins-precedent/dist/index.d.ts +1 -0
  310. package/node_modules/@sumi/plugins-precedent/dist/index.js +1 -0
  311. package/node_modules/@sumi/plugins-precedent/dist/index.js.map +1 -1
  312. package/node_modules/@sumi/plugins-precedent/dist/model.d.ts +1 -0
  313. package/node_modules/@sumi/plugins-precedent/dist/model.js.map +1 -1
  314. package/node_modules/@sumi/plugins-precedent/dist/plugins/context-read.js +2 -1
  315. package/node_modules/@sumi/plugins-precedent/dist/plugins/context-read.js.map +1 -1
  316. package/node_modules/@sumi/plugins-precedent/package.json +3 -3
  317. package/node_modules/@sumi/plugins-precedent/sumi-plugins.yaml +3 -2
  318. package/node_modules/@sumi/plugins-review/README.md +17 -4
  319. package/node_modules/@sumi/plugins-review/dist/batch-request.d.ts +22 -0
  320. package/node_modules/@sumi/plugins-review/dist/batch-request.js +30 -0
  321. package/node_modules/@sumi/plugins-review/dist/batch-request.js.map +1 -0
  322. package/node_modules/@sumi/plugins-review/dist/claude-review-agent.d.ts +8 -0
  323. package/node_modules/@sumi/plugins-review/dist/claude-review-agent.js +51 -0
  324. package/node_modules/@sumi/plugins-review/dist/claude-review-agent.js.map +1 -0
  325. package/node_modules/@sumi/plugins-review/dist/command-hint.d.ts +7 -0
  326. package/node_modules/@sumi/plugins-review/dist/command-hint.js +21 -0
  327. package/node_modules/@sumi/plugins-review/dist/command-hint.js.map +1 -1
  328. package/node_modules/@sumi/plugins-review/dist/command-input.d.ts +3 -0
  329. package/node_modules/@sumi/plugins-review/dist/command-input.js +32 -0
  330. package/node_modules/@sumi/plugins-review/dist/command-input.js.map +1 -0
  331. package/node_modules/@sumi/plugins-review/dist/commands/context.js +3 -69
  332. package/node_modules/@sumi/plugins-review/dist/commands/context.js.map +1 -1
  333. package/node_modules/@sumi/plugins-review/dist/commands/host-model-hook.js +4 -3
  334. package/node_modules/@sumi/plugins-review/dist/commands/host-model-hook.js.map +1 -1
  335. package/node_modules/@sumi/plugins-review/dist/commands/model-recheck.js +37 -25
  336. package/node_modules/@sumi/plugins-review/dist/commands/model-recheck.js.map +1 -1
  337. package/node_modules/@sumi/plugins-review/dist/commands/preflight.d.ts +1 -0
  338. package/node_modules/@sumi/plugins-review/dist/commands/preflight.js +13 -0
  339. package/node_modules/@sumi/plugins-review/dist/commands/preflight.js.map +1 -0
  340. package/node_modules/@sumi/plugins-review/dist/commands/request-read.d.ts +1 -0
  341. package/node_modules/@sumi/plugins-review/dist/commands/request-read.js +6 -0
  342. package/node_modules/@sumi/plugins-review/dist/commands/request-read.js.map +1 -0
  343. package/node_modules/@sumi/plugins-review/dist/commands/review-batch.d.ts +1 -0
  344. package/node_modules/@sumi/plugins-review/dist/commands/review-batch.js +8 -0
  345. package/node_modules/@sumi/plugins-review/dist/commands/review-batch.js.map +1 -0
  346. package/node_modules/@sumi/plugins-review/dist/commands/startup-context.d.ts +1 -0
  347. package/node_modules/@sumi/plugins-review/dist/commands/startup-context.js +6 -0
  348. package/node_modules/@sumi/plugins-review/dist/commands/startup-context.js.map +1 -0
  349. package/node_modules/@sumi/plugins-review/dist/commands/stats.d.ts +1 -0
  350. package/node_modules/@sumi/plugins-review/dist/commands/stats.js +10 -0
  351. package/node_modules/@sumi/plugins-review/dist/commands/stats.js.map +1 -0
  352. package/node_modules/@sumi/plugins-review/dist/commands/submit.js +79 -32
  353. package/node_modules/@sumi/plugins-review/dist/commands/submit.js.map +1 -1
  354. package/node_modules/@sumi/plugins-review/dist/context-provider.d.ts +3 -0
  355. package/node_modules/@sumi/plugins-review/dist/context-provider.js +84 -0
  356. package/node_modules/@sumi/plugins-review/dist/context-provider.js.map +1 -0
  357. package/node_modules/@sumi/plugins-review/dist/convergence.d.ts +17 -0
  358. package/node_modules/@sumi/plugins-review/dist/convergence.js +114 -0
  359. package/node_modules/@sumi/plugins-review/dist/convergence.js.map +1 -0
  360. package/node_modules/@sumi/plugins-review/dist/cost-advice.d.ts +2 -0
  361. package/node_modules/@sumi/plugins-review/dist/cost-advice.js +35 -0
  362. package/node_modules/@sumi/plugins-review/dist/cost-advice.js.map +1 -0
  363. package/node_modules/@sumi/plugins-review/dist/dispatch.d.ts +38 -0
  364. package/node_modules/@sumi/plugins-review/dist/dispatch.js +235 -0
  365. package/node_modules/@sumi/plugins-review/dist/dispatch.js.map +1 -0
  366. package/node_modules/@sumi/plugins-review/dist/dispute.d.ts +4 -0
  367. package/node_modules/@sumi/plugins-review/dist/dispute.js +38 -4
  368. package/node_modules/@sumi/plugins-review/dist/dispute.js.map +1 -1
  369. package/node_modules/@sumi/plugins-review/dist/instructions.d.ts +1 -0
  370. package/node_modules/@sumi/plugins-review/dist/instructions.js +2 -0
  371. package/node_modules/@sumi/plugins-review/dist/instructions.js.map +1 -0
  372. package/node_modules/@sumi/plugins-review/dist/model-execution.d.ts +1 -0
  373. package/node_modules/@sumi/plugins-review/dist/model-execution.js +51 -46
  374. package/node_modules/@sumi/plugins-review/dist/model-execution.js.map +1 -1
  375. package/node_modules/@sumi/plugins-review/dist/plugins/dispatch.d.ts +1 -0
  376. package/node_modules/@sumi/plugins-review/dist/plugins/dispatch.js +41 -0
  377. package/node_modules/@sumi/plugins-review/dist/plugins/dispatch.js.map +1 -0
  378. package/node_modules/@sumi/plugins-review/dist/plugins/independent-recheck.js +62 -39
  379. package/node_modules/@sumi/plugins-review/dist/plugins/independent-recheck.js.map +1 -1
  380. package/node_modules/@sumi/plugins-review/dist/plugins/rubric.js +3 -337
  381. package/node_modules/@sumi/plugins-review/dist/plugins/rubric.js.map +1 -1
  382. package/node_modules/@sumi/plugins-review/dist/preflight.d.ts +31 -0
  383. package/node_modules/@sumi/plugins-review/dist/preflight.js +172 -0
  384. package/node_modules/@sumi/plugins-review/dist/preflight.js.map +1 -0
  385. package/node_modules/@sumi/plugins-review/dist/recheck-tickets.d.ts +26 -0
  386. package/node_modules/@sumi/plugins-review/dist/recheck-tickets.js +48 -0
  387. package/node_modules/@sumi/plugins-review/dist/recheck-tickets.js.map +1 -0
  388. package/node_modules/@sumi/plugins-review/dist/recheck.d.ts +15 -0
  389. package/node_modules/@sumi/plugins-review/dist/recheck.js +33 -16
  390. package/node_modules/@sumi/plugins-review/dist/recheck.js.map +1 -1
  391. package/node_modules/@sumi/plugins-review/dist/report.d.ts +5 -1
  392. package/node_modules/@sumi/plugins-review/dist/report.js +25 -5
  393. package/node_modules/@sumi/plugins-review/dist/report.js.map +1 -1
  394. package/node_modules/@sumi/plugins-review/dist/review-evidence.js +2 -2
  395. package/node_modules/@sumi/plugins-review/dist/review-evidence.js.map +1 -1
  396. package/node_modules/@sumi/plugins-review/dist/review.d.ts +53 -7
  397. package/node_modules/@sumi/plugins-review/dist/review.js +100 -38
  398. package/node_modules/@sumi/plugins-review/dist/review.js.map +1 -1
  399. package/node_modules/@sumi/plugins-review/dist/rubric-check.d.ts +4 -0
  400. package/node_modules/@sumi/plugins-review/dist/rubric-check.js +382 -0
  401. package/node_modules/@sumi/plugins-review/dist/rubric-check.js.map +1 -0
  402. package/node_modules/@sumi/plugins-review/dist/startup-context.d.ts +21 -0
  403. package/node_modules/@sumi/plugins-review/dist/startup-context.js +94 -0
  404. package/node_modules/@sumi/plugins-review/dist/startup-context.js.map +1 -0
  405. package/node_modules/@sumi/plugins-review/dist/stats.d.ts +19 -0
  406. package/node_modules/@sumi/plugins-review/dist/stats.js +99 -0
  407. package/node_modules/@sumi/plugins-review/dist/stats.js.map +1 -0
  408. package/node_modules/@sumi/plugins-review/dist/submission.js +34 -18
  409. package/node_modules/@sumi/plugins-review/dist/submission.js.map +1 -1
  410. package/node_modules/@sumi/plugins-review/dist/support-scope.d.ts +4 -0
  411. package/node_modules/@sumi/plugins-review/dist/support-scope.js +9 -0
  412. package/node_modules/@sumi/plugins-review/dist/support-scope.js.map +1 -0
  413. package/node_modules/@sumi/plugins-review/dist/tickets.d.ts +12 -0
  414. package/node_modules/@sumi/plugins-review/dist/tickets.js +98 -0
  415. package/node_modules/@sumi/plugins-review/dist/tickets.js.map +1 -0
  416. package/node_modules/@sumi/plugins-review/dist/upgrade-flow-plan.js +34 -9
  417. package/node_modules/@sumi/plugins-review/dist/upgrade-flow-plan.js.map +1 -1
  418. package/node_modules/@sumi/plugins-review/dist/upgrade-flow-render.js +2 -3
  419. package/node_modules/@sumi/plugins-review/dist/upgrade-flow-render.js.map +1 -1
  420. package/node_modules/@sumi/plugins-review/dist/upgrade.d.ts +2 -0
  421. package/node_modules/@sumi/plugins-review/dist/upgrade.js +12 -83
  422. package/node_modules/@sumi/plugins-review/dist/upgrade.js.map +1 -1
  423. package/node_modules/@sumi/plugins-review/package.json +6 -5
  424. package/node_modules/@sumi/plugins-review/sumi-plugins.yaml +22 -1
  425. package/package.json +10 -10
  426. package/dist/trace.d.ts +0 -16
  427. package/dist/trace.js +0 -30
  428. package/dist/trace.js.map +0 -1
  429. package/node_modules/@sumi/create/dist/bin.d.ts +0 -2
  430. package/node_modules/@sumi/create/dist/bin.js +0 -52
  431. package/node_modules/@sumi/create/dist/bin.js.map +0 -1
  432. package/node_modules/@sumi/create/template/control/rubrics/architecture.yaml +0 -15
  433. package/node_modules/@sumi/create/template/control/rubrics/business-impact.yaml +0 -6
  434. package/node_modules/@sumi/create/template/control/rubrics/device-acceptance.yaml +0 -10
  435. package/node_modules/@sumi/create/template/control/rubrics/domain.yaml +0 -9
  436. package/node_modules/@sumi/create/template/init/control/rubrics/architecture.yaml +0 -15
  437. package/node_modules/@sumi/create/template/init/control/rubrics/business-impact.yaml +0 -6
  438. package/node_modules/@sumi/plugins-core/dist/tool-batches.d.ts +0 -11
  439. package/node_modules/@sumi/plugins-core/dist/tool-batches.js +0 -41
  440. package/node_modules/@sumi/plugins-core/dist/tool-batches.js.map +0 -1
  441. package/node_modules/@sumi/plugins-governance/dist/commands/approve.js +0 -29
  442. package/node_modules/@sumi/plugins-governance/dist/commands/approve.js.map +0 -1
  443. package/node_modules/@sumi/plugins-governance/dist/commands/protected-after-shell.js +0 -20
  444. package/node_modules/@sumi/plugins-governance/dist/commands/protected-after-shell.js.map +0 -1
  445. package/node_modules/@sumi/plugins-governance/dist/commands/unlock.js +0 -23
  446. package/node_modules/@sumi/plugins-governance/dist/commands/unlock.js.map +0 -1
  447. package/node_modules/@sumi/plugins-governance/dist/hooks.d.ts +0 -2
  448. package/node_modules/@sumi/plugins-governance/dist/hooks.js +0 -4
  449. package/node_modules/@sumi/plugins-governance/dist/hooks.js.map +0 -1
  450. package/node_modules/@sumi/plugins-governance/dist/protected-shell.d.ts +0 -12
  451. package/node_modules/@sumi/plugins-governance/dist/protected-shell.js +0 -152
  452. package/node_modules/@sumi/plugins-governance/dist/protected-shell.js.map +0 -1
  453. package/node_modules/@sumi/plugins-precedent/dist/commands/session-start-context.js +0 -6
  454. package/node_modules/@sumi/plugins-precedent/dist/commands/session-start-context.js.map +0 -1
  455. /package/{node_modules/@sumi/plugins-governance/dist/commands/approve.d.ts → dist/context-providers.d.ts} +0 -0
  456. /package/node_modules/@sumi/plugins-governance/dist/commands/{protected-after-shell.d.ts → boundary-after-edit.d.ts} +0 -0
  457. /package/node_modules/@sumi/plugins-governance/dist/commands/{unlock.d.ts → boundary-before-edit.d.ts} +0 -0
  458. /package/node_modules/@sumi/{plugins-precedent/dist/commands/session-start-context.d.ts → plugins-governance/dist/commands/boundary-prompt.d.ts} +0 -0
package/dist/launcher.cjs CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ /* global process, console, Buffer, __filename, atob, btoa, queueMicrotask */
2
3
  "use strict";
3
4
  var __create = Object.create;
4
5
  var __defProp = Object.defineProperty;
@@ -56,7 +57,7 @@ var require_identity = __commonJS({
56
57
  }
57
58
  return false;
58
59
  }
59
- function isNode(node) {
60
+ function isNode2(node) {
60
61
  if (node && typeof node === "object")
61
62
  switch (node[NODE_TYPE]) {
62
63
  case ALIAS:
@@ -80,7 +81,7 @@ var require_identity = __commonJS({
80
81
  exports2.isCollection = isCollection;
81
82
  exports2.isDocument = isDocument;
82
83
  exports2.isMap = isMap;
83
- exports2.isNode = isNode;
84
+ exports2.isNode = isNode2;
84
85
  exports2.isPair = isPair;
85
86
  exports2.isScalar = isScalar;
86
87
  exports2.isSeq = isSeq;
@@ -3484,7 +3485,7 @@ var require_Document = __commonJS({
3484
3485
  createAlias(node, name) {
3485
3486
  if (!node.anchor) {
3486
3487
  const prev = anchors.anchorNames(this);
3487
- node.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
3488
+ node.anchor =
3488
3489
  !name || prev.has(name) ? anchors.findNewAnchor(name || "a", prev) : name;
3489
3490
  }
3490
3491
  return new Alias.Alias(node.anchor);
@@ -3507,7 +3508,7 @@ var require_Document = __commonJS({
3507
3508
  const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {};
3508
3509
  const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(
3509
3510
  this,
3510
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
3511
+
3511
3512
  anchorPrefix || "a"
3512
3513
  );
3513
3514
  const ctx = {
@@ -6310,7 +6311,7 @@ var require_lexer = __commonJS({
6310
6311
  var require_line_counter = __commonJS({
6311
6312
  "../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/line-counter.js"(exports2) {
6312
6313
  "use strict";
6313
- var LineCounter = class {
6314
+ var LineCounter2 = class {
6314
6315
  constructor() {
6315
6316
  this.lineStarts = [];
6316
6317
  this.addNewLine = (offset) => this.lineStarts.push(offset);
@@ -6333,7 +6334,7 @@ var require_line_counter = __commonJS({
6333
6334
  };
6334
6335
  }
6335
6336
  };
6336
- exports2.LineCounter = LineCounter;
6337
+ exports2.LineCounter = LineCounter2;
6337
6338
  }
6338
6339
  });
6339
6340
 
@@ -7241,7 +7242,7 @@ var require_public_api = __commonJS({
7241
7242
  return docs;
7242
7243
  return Object.assign([], { empty: true }, composer$1.streamInfo());
7243
7244
  }
7244
- function parseDocument(source, options = {}) {
7245
+ function parseDocument2(source, options = {}) {
7245
7246
  const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options);
7246
7247
  const parser$1 = new parser.Parser(lineCounter2?.addNewLine);
7247
7248
  const composer$1 = new composer.Composer(options);
@@ -7260,14 +7261,14 @@ var require_public_api = __commonJS({
7260
7261
  }
7261
7262
  return doc;
7262
7263
  }
7263
- function parse2(src, reviver, options) {
7264
+ function parse(src, reviver, options) {
7264
7265
  let _reviver = void 0;
7265
7266
  if (typeof reviver === "function") {
7266
7267
  _reviver = reviver;
7267
7268
  } else if (options === void 0 && reviver && typeof reviver === "object") {
7268
7269
  options = reviver;
7269
7270
  }
7270
- const doc = parseDocument(src, options);
7271
+ const doc = parseDocument2(src, options);
7271
7272
  if (!doc)
7272
7273
  return null;
7273
7274
  doc.warnings.forEach((warning) => log.warn(doc.options.logLevel, warning));
@@ -7301,9 +7302,9 @@ var require_public_api = __commonJS({
7301
7302
  return value.toString(options);
7302
7303
  return new Document.Document(value, _replacer, options).toString(options);
7303
7304
  }
7304
- exports2.parse = parse2;
7305
+ exports2.parse = parse;
7305
7306
  exports2.parseAllDocuments = parseAllDocuments;
7306
- exports2.parseDocument = parseDocument;
7307
+ exports2.parseDocument = parseDocument2;
7307
7308
  exports2.stringify = stringify;
7308
7309
  }
7309
7310
  });
@@ -7363,8 +7364,8 @@ var require_dist = __commonJS({
7363
7364
  // src/launcher.ts
7364
7365
  var import_node_child_process = require("node:child_process");
7365
7366
  var import_node_crypto4 = require("node:crypto");
7366
- var import_node_fs11 = require("node:fs");
7367
- var import_node_path14 = require("node:path");
7367
+ var import_node_fs12 = require("node:fs");
7368
+ var import_node_path15 = require("node:path");
7368
7369
 
7369
7370
  // ../plugin-sdk/dist/project.js
7370
7371
  var import_node_fs = require("node:fs");
@@ -7375,22 +7376,206 @@ function configFile(root) {
7375
7376
  }
7376
7377
  var PUBLISHED_CLI_PACKAGE = "@fantasticit/sumi";
7377
7378
  var CLI_PACKAGE_NAMES = ["@sumi/cli", PUBLISHED_CLI_PACKAGE];
7379
+ var isCliPackageName = (name) => typeof name === "string" && CLI_PACKAGE_NAMES.includes(name);
7380
+ function satisfies(version, range) {
7381
+ const parse = (v3) => v3.replace(/^v/, "").split("-")[0].split(".").map((n) => Number(n) || 0);
7382
+ const cmp = (a, b2) => {
7383
+ for (let i = 0; i < 3; i++)
7384
+ if ((a[i] ?? 0) !== (b2[i] ?? 0))
7385
+ return (a[i] ?? 0) - (b2[i] ?? 0);
7386
+ return 0;
7387
+ };
7388
+ const v2 = parse(version);
7389
+ return range.trim().split(/\s+/).every((part) => {
7390
+ const m2 = /^(>=|<=|>|<|=|\^|~)?(.+)$/.exec(part);
7391
+ if (!m2)
7392
+ return false;
7393
+ const target = parse(m2[2]);
7394
+ const c = cmp(v2, target);
7395
+ switch (m2[1]) {
7396
+ case ">=":
7397
+ return c >= 0;
7398
+ case ">":
7399
+ return c > 0;
7400
+ case "<=":
7401
+ return c <= 0;
7402
+ case "<":
7403
+ return c < 0;
7404
+ case "^": {
7405
+ const upper = target[0] > 0 ? [target[0] + 1, 0, 0] : target[1] > 0 ? [0, target[1] + 1, 0] : [0, 0, target[2] + 1];
7406
+ return c >= 0 && cmp(v2, upper) < 0;
7407
+ }
7408
+ case "~":
7409
+ return c >= 0 && cmp(v2, [target[0], target[1] + 1, 0]) < 0;
7410
+ default:
7411
+ return c === 0;
7412
+ }
7413
+ });
7414
+ }
7378
7415
 
7379
- // src/launcher.ts
7416
+ // ../kernel/dist/config.js
7417
+ var import_node_fs2 = require("node:fs");
7418
+ var import_node_path2 = require("node:path");
7380
7419
  var import_yaml = __toESM(require_dist(), 1);
7381
7420
 
7421
+ // ../kernel/dist/errors.js
7422
+ var KernelError = class extends Error {
7423
+ exitCode = 3;
7424
+ constructor(message) {
7425
+ super(message);
7426
+ this.name = "KernelError";
7427
+ }
7428
+ };
7429
+
7430
+ // ../kernel/dist/config.js
7431
+ var CONFIG_FILE = CONFIG_FILES[0];
7432
+ var cliVersion;
7433
+ var cliBuild;
7434
+ var identityHint = "\u8BF7\u4ECE\u9879\u76EE\u58F0\u660E\u7684 CLI \u5165\u53E3\u91CD\u65B0\u542F\u52A8";
7435
+ var DEFAULTS = {
7436
+ tiers: ["delta", "runtime", "full"],
7437
+ zones: {},
7438
+ neutral: [],
7439
+ pathHints: {},
7440
+ exclude: [],
7441
+ upgrade: [],
7442
+ packages: [],
7443
+ plugins: [],
7444
+ groups: {},
7445
+ flows: "control/flows",
7446
+ brief: { maxLines: 40, maxFindings: 10 },
7447
+ loop: { threshold: 3 },
7448
+ runs: { keepLast: 100, keepDays: 14 },
7449
+ sourceCheck: { intervalMs: 5e3 }
7450
+ };
7451
+ var isStringArray = (v2) => Array.isArray(v2) && v2.every((x) => typeof x === "string");
7452
+ var RuntimeIdentityError = class extends KernelError {
7453
+ config;
7454
+ constructor(message, config) {
7455
+ super(message);
7456
+ this.config = config;
7457
+ this.name = "RuntimeIdentityError";
7458
+ }
7459
+ };
7460
+ var ProjectConfigError = class extends KernelError {
7461
+ file;
7462
+ line;
7463
+ constructor(file, reason, line) {
7464
+ const location = line === void 0 ? file : `${file}:${line}`;
7465
+ super(`\u9879\u76EE\u914D\u7F6E\u4E0D\u5408\u6CD5\uFF08${location}\uFF1A${reason.replace(/[\r\n]+/g, " ")}\uFF09\uFF0C\u5148\u4FEE\u590D\u8BE5\u6587\u4EF6\u6216\u7528 git checkout -- ${file} \u6062\u590D`);
7466
+ this.file = file;
7467
+ this.line = line;
7468
+ this.name = "ProjectConfigError";
7469
+ }
7470
+ };
7471
+ function readProjectConfig(root) {
7472
+ const file = configFile(root);
7473
+ if (!file)
7474
+ throw new KernelError(`\u7F3A\u5C11\u9879\u76EE\u914D\u7F6E\uFF1A${(0, import_node_path2.join)(root, CONFIG_FILE)}\uFF08\u6216\u65E7\u4F4D\u7F6E ${(0, import_node_path2.join)(root, CONFIG_FILES[1])}\uFF09`);
7475
+ const source = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(root, file), "utf8");
7476
+ const lines = new import_yaml.LineCounter();
7477
+ const document = (0, import_yaml.parseDocument)(source, { lineCounter: lines });
7478
+ const error = document.errors[0];
7479
+ if (error) {
7480
+ const reason = error.message.split("\n")[0].replace(/ at line \d+, column \d+:$/, "");
7481
+ throw new ProjectConfigError(file, reason, lines.linePos(error.pos[0]).line);
7482
+ }
7483
+ let raw;
7484
+ try {
7485
+ raw = document.toJS() ?? {};
7486
+ } catch (error2) {
7487
+ throw new ProjectConfigError(file, error2.message.split("\n")[0]);
7488
+ }
7489
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw))
7490
+ throw new ProjectConfigError(file, "\u9879\u76EE\u914D\u7F6E\u5FC5\u987B\u662F\u5BF9\u8C61", 1);
7491
+ const lineFor = (key) => {
7492
+ const node = document.getIn(key.split("."), true);
7493
+ return (0, import_yaml.isNode)(node) && node.range ? lines.linePos(node.range[0]).line : void 0;
7494
+ };
7495
+ return { file, raw, lineFor };
7496
+ }
7497
+ function loadConfig(root) {
7498
+ const { file, raw, lineFor } = readProjectConfig(root);
7499
+ const config = { ...DEFAULTS, ...raw };
7500
+ config.brief = { ...DEFAULTS.brief, ...raw.brief };
7501
+ config.loop = { ...DEFAULTS.loop, ...raw.loop };
7502
+ config.runs = { ...DEFAULTS.runs, ...raw.runs };
7503
+ config.sourceCheck = { ...DEFAULTS.sourceCheck, ...raw.sourceCheck };
7504
+ const errors = [];
7505
+ const sourceCheck = raw.sourceCheck;
7506
+ if (sourceCheck !== void 0 && (!sourceCheck || typeof sourceCheck !== "object" || Array.isArray(sourceCheck)))
7507
+ errors.push("sourceCheck \u5FC5\u987B\u662F\u5BF9\u8C61");
7508
+ if (!Number.isSafeInteger(config.sourceCheck.intervalMs) || config.sourceCheck.intervalMs < 0)
7509
+ errors.push("sourceCheck.intervalMs \u5FC5\u987B\u662F\u975E\u8D1F\u6574\u6570");
7510
+ if (!isStringArray(config.tiers) || config.tiers.length === 0)
7511
+ errors.push("tiers \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\u6570\u7EC4");
7512
+ for (const key of ["keepLast", "keepDays"])
7513
+ if (!Number.isSafeInteger(config.runs[key]) || config.runs[key] < 0)
7514
+ errors.push(`runs.${key} \u5FC5\u987B\u662F\u975E\u8D1F\u6574\u6570`);
7515
+ for (const key of ["neutral", "exclude", "packages", "plugins"]) {
7516
+ if (!isStringArray(config[key]))
7517
+ errors.push(`${key} \u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u6570\u7EC4`);
7518
+ }
7519
+ for (const [zone, globs] of Object.entries(config.zones ?? {})) {
7520
+ if (!isStringArray(globs))
7521
+ errors.push(`zones.${zone} \u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u6570\u7EC4`);
7522
+ }
7523
+ for (const [group, ids] of Object.entries(config.groups ?? {})) {
7524
+ if (!isStringArray(ids))
7525
+ errors.push(`groups.${group} \u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u6570\u7EC4`);
7526
+ }
7527
+ if (!config.pathHints || typeof config.pathHints !== "object" || Array.isArray(config.pathHints))
7528
+ errors.push("pathHints \u5FC5\u987B\u662F\u5BF9\u8C61");
7529
+ else
7530
+ for (const [name, change] of Object.entries(config.pathHints)) {
7531
+ if (!change || typeof change !== "object" || Array.isArray(change) || Object.keys(change).some((key) => key !== "add" && key !== "remove")) {
7532
+ errors.push(`pathHints.${name} \u5FC5\u987B\u662F { add?, remove? } \u5BF9\u8C61`);
7533
+ continue;
7534
+ }
7535
+ for (const key of ["add", "remove"])
7536
+ if (change[key] !== void 0 && !isStringArray(change[key]))
7537
+ errors.push(`pathHints.${name}.${key} \u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u6570\u7EC4`);
7538
+ }
7539
+ if (!Array.isArray(config.upgrade))
7540
+ errors.push("upgrade \u5FC5\u987B\u662F\u6570\u7EC4");
7541
+ else
7542
+ for (const rule of config.upgrade) {
7543
+ const validTier = isStringArray(config.tiers) && config.tiers.includes(rule?.tier);
7544
+ if (!rule || !isStringArray(rule.paths) || !validTier)
7545
+ errors.push("upgrade \u89C4\u5219\u975E\u6CD5");
7546
+ }
7547
+ if (config.sumiBuild !== void 0 && (typeof config.sumiBuild !== "string" || !/^sha256:[0-9a-f]{64}$/.test(config.sumiBuild))) {
7548
+ errors.push("sumiBuild \u5FC5\u987B\u662F sha256:<64 \u4F4D\u5C0F\u5199\u5341\u516D\u8FDB\u5236>");
7549
+ }
7550
+ if (config.sumiPackage !== void 0 && !isCliPackageName(config.sumiPackage)) {
7551
+ errors.push(`sumiPackage \u5FC5\u987B\u662F ${CLI_PACKAGE_NAMES.join(" \u6216 ")}`);
7552
+ }
7553
+ if (errors.length) {
7554
+ const reason = errors[0];
7555
+ throw new ProjectConfigError(file, reason, lineFor(reason.split(" ")[0]));
7556
+ }
7557
+ if (config.sumi && cliVersion && !satisfies(cliVersion, config.sumi)) {
7558
+ throw new RuntimeIdentityError(`\u5F53\u524D sumi ${cliVersion} \u4E0D\u6EE1\u8DB3\u9879\u76EE\u8981\u6C42\u7684 ${config.sumi}\uFF0C${identityHint}`, config);
7559
+ }
7560
+ if (config.sumiBuild && config.sumiBuild !== cliBuild) {
7561
+ const current = cliBuild ?? "unknown";
7562
+ throw new RuntimeIdentityError(`\u5F53\u524D sumi \u6784\u5EFA ${current} \u4E0D\u6EE1\u8DB3\u9879\u76EE\u8981\u6C42\u7684 ${config.sumiBuild}\uFF0C${identityHint}`, config);
7563
+ }
7564
+ return config;
7565
+ }
7566
+
7382
7567
  // src/runtime-manifest.ts
7383
7568
  var import_node_crypto2 = require("node:crypto");
7384
- var import_node_fs3 = require("node:fs");
7385
- var import_node_path3 = require("node:path");
7569
+ var import_node_fs4 = require("node:fs");
7570
+ var import_node_path4 = require("node:path");
7386
7571
 
7387
7572
  // src/build-identity.ts
7388
7573
  var import_node_crypto = require("node:crypto");
7389
- var import_node_fs2 = require("node:fs");
7390
- var import_node_path2 = require("node:path");
7574
+ var import_node_fs3 = require("node:fs");
7575
+ var import_node_path3 = require("node:path");
7391
7576
  var BUILD_ID_PATTERN = /^sha256:[0-9a-f]{64}$/;
7392
7577
  function payload(path, relative) {
7393
- const content = (0, import_node_fs2.readFileSync)(path);
7578
+ const content = (0, import_node_fs3.readFileSync)(path);
7394
7579
  if (relative !== "package.json") return content;
7395
7580
  const manifest = JSON.parse(content.toString("utf8"));
7396
7581
  delete manifest.sumiBuild;
@@ -7401,9 +7586,9 @@ function buildIdentity(root) {
7401
7586
  const hash = (0, import_node_crypto.createHash)("sha256");
7402
7587
  const entries = [];
7403
7588
  const walk = (dir, prefix = "") => {
7404
- for (const entry of (0, import_node_fs2.readdirSync)(dir, { withFileTypes: true })) {
7589
+ for (const entry of (0, import_node_fs3.readdirSync)(dir, { withFileTypes: true })) {
7405
7590
  const relative = prefix ? `${prefix}/${entry.name}` : entry.name;
7406
- const path = (0, import_node_path2.join)(dir, entry.name);
7591
+ const path = (0, import_node_path3.join)(dir, entry.name);
7407
7592
  if (entry.isDirectory() && entry.name === ".bin" && (prefix === "node_modules" || prefix.endsWith("/node_modules"))) continue;
7408
7593
  if (entry.isDirectory()) walk(path, relative);
7409
7594
  else entries.push(relative);
@@ -7412,10 +7597,10 @@ function buildIdentity(root) {
7412
7597
  walk(root);
7413
7598
  entries.sort();
7414
7599
  for (const relative of entries) {
7415
- const path = (0, import_node_path2.join)(root, ...relative.split("/"));
7416
- const stat = (0, import_node_fs2.lstatSync)(path);
7600
+ const path = (0, import_node_path3.join)(root, ...relative.split("/"));
7601
+ const stat = (0, import_node_fs3.lstatSync)(path);
7417
7602
  if (stat.isSymbolicLink()) {
7418
- const target = Buffer.from((0, import_node_fs2.readlinkSync)(path));
7603
+ const target = Buffer.from((0, import_node_fs3.readlinkSync)(path));
7419
7604
  hash.update(`link\0${relative}\0${target.length}\0`);
7420
7605
  hash.update(target);
7421
7606
  } else if (stat.isFile()) {
@@ -7436,7 +7621,7 @@ var RUNTIME_MANIFEST = `${VENDOR_DIR}/sumi-runtime.json`;
7436
7621
  var SHA256_PATTERN = /^[0-9a-f]{64}$/;
7437
7622
  var ARCHIVE_PATTERN = /^control\/vendor\/sumi-cli-[^/\\]+\.tgz$/;
7438
7623
  function fileSha256(path) {
7439
- return (0, import_node_crypto2.createHash)("sha256").update((0, import_node_fs3.readFileSync)(path)).digest("hex");
7624
+ return (0, import_node_crypto2.createHash)("sha256").update((0, import_node_fs4.readFileSync)(path)).digest("hex");
7440
7625
  }
7441
7626
  function parseRuntimeManifest(value, repo) {
7442
7627
  if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("runtime \u6E05\u5355\u5FC5\u987B\u662F JSON \u5BF9\u8C61");
@@ -7457,12 +7642,12 @@ function parseRuntimeManifest(value, repo) {
7457
7642
  archiveSha256: typeof input.archiveSha256 === "string" ? input.archiveSha256 : "",
7458
7643
  ...identity
7459
7644
  };
7460
- if (!ARCHIVE_PATTERN.test(manifest.archive) || (0, import_node_path3.isAbsolute)(manifest.archive) || manifest.archive.split("/").includes("..")) {
7645
+ if (!ARCHIVE_PATTERN.test(manifest.archive) || (0, import_node_path4.isAbsolute)(manifest.archive) || manifest.archive.split("/").includes("..")) {
7461
7646
  throw new Error(`runtime \u5B89\u88C5\u5305\u8DEF\u5F84\u65E0\u6548\uFF1A${manifest.archive || "(\u7F3A\u5931)"}`);
7462
7647
  }
7463
7648
  if (!SHA256_PATTERN.test(manifest.archiveSha256)) throw new Error("runtime \u5B89\u88C5\u5305 SHA-256 \u65E0\u6548\u6216\u7F3A\u5931");
7464
- const archive = (0, import_node_path3.resolve)(repo, ...manifest.archive.split("/"));
7465
- const vendor = (0, import_node_path3.resolve)(repo, "control/vendor");
7649
+ const archive = (0, import_node_path4.resolve)(repo, ...manifest.archive.split("/"));
7650
+ const vendor = (0, import_node_path4.resolve)(repo, "control/vendor");
7466
7651
  if (archive !== vendor && !archive.startsWith(`${vendor}/`) && !archive.startsWith(`${vendor}\\`)) {
7467
7652
  throw new Error(`runtime \u5B89\u88C5\u5305\u8D8A\u754C\uFF1A${manifest.archive}`);
7468
7653
  }
@@ -7478,13 +7663,13 @@ function safeArchiveEntry(path) {
7478
7663
  function safeLinkTarget(entryPath, target) {
7479
7664
  const normalized = target.replaceAll("\\", "/");
7480
7665
  if (!normalized || normalized.startsWith("/") || /^[A-Za-z]:/.test(normalized)) return false;
7481
- const resolved = import_node_path3.posix.normalize(import_node_path3.posix.join(import_node_path3.posix.dirname(entryPath.replaceAll("\\", "/")), normalized));
7666
+ const resolved = import_node_path4.posix.normalize(import_node_path4.posix.join(import_node_path4.posix.dirname(entryPath.replaceAll("\\", "/")), normalized));
7482
7667
  return resolved === "package" || resolved.startsWith("package/");
7483
7668
  }
7484
7669
 
7485
7670
  // src/runtime-package.ts
7486
- var import_node_fs10 = require("node:fs");
7487
- var import_node_path13 = require("node:path");
7671
+ var import_node_fs11 = require("node:fs");
7672
+ var import_node_path14 = require("node:path");
7488
7673
 
7489
7674
  // ../../node_modules/.pnpm/tar@7.5.22/node_modules/tar/dist/esm/index.min.js
7490
7675
  var import_events = __toESM(require("events"), 1);
@@ -7492,35 +7677,35 @@ var import_fs = __toESM(require("fs"), 1);
7492
7677
  var import_node_events = require("node:events");
7493
7678
  var import_node_stream = __toESM(require("node:stream"), 1);
7494
7679
  var import_node_string_decoder = require("node:string_decoder");
7495
- var import_node_path4 = __toESM(require("node:path"), 1);
7496
- var import_node_fs4 = __toESM(require("node:fs"), 1);
7680
+ var import_node_path5 = __toESM(require("node:path"), 1);
7681
+ var import_node_fs5 = __toESM(require("node:fs"), 1);
7497
7682
  var import_path = require("path");
7498
7683
  var import_events2 = require("events");
7499
7684
  var import_assert = __toESM(require("assert"), 1);
7500
7685
  var import_buffer = require("buffer");
7501
7686
  var Ps = __toESM(require("zlib"), 1);
7502
7687
  var import_zlib = __toESM(require("zlib"), 1);
7503
- var import_node_path5 = require("node:path");
7504
7688
  var import_node_path6 = require("node:path");
7689
+ var import_node_path7 = require("node:path");
7505
7690
  var import_fs2 = __toESM(require("fs"), 1);
7506
7691
  var import_fs3 = __toESM(require("fs"), 1);
7507
7692
  var import_path2 = __toESM(require("path"), 1);
7508
- var import_node_path7 = require("node:path");
7693
+ var import_node_path8 = require("node:path");
7509
7694
  var import_path3 = __toESM(require("path"), 1);
7510
- var import_node_fs5 = __toESM(require("node:fs"), 1);
7695
+ var import_node_fs6 = __toESM(require("node:fs"), 1);
7511
7696
  var import_node_assert = __toESM(require("node:assert"), 1);
7512
7697
  var import_node_crypto3 = require("node:crypto");
7513
- var import_node_fs6 = __toESM(require("node:fs"), 1);
7514
- var import_node_path8 = __toESM(require("node:path"), 1);
7515
- var import_fs4 = __toESM(require("fs"), 1);
7516
7698
  var import_node_fs7 = __toESM(require("node:fs"), 1);
7517
7699
  var import_node_path9 = __toESM(require("node:path"), 1);
7700
+ var import_fs4 = __toESM(require("fs"), 1);
7518
7701
  var import_node_fs8 = __toESM(require("node:fs"), 1);
7519
- var import_promises = __toESM(require("node:fs/promises"), 1);
7520
7702
  var import_node_path10 = __toESM(require("node:path"), 1);
7521
- var import_node_path11 = require("node:path");
7522
7703
  var import_node_fs9 = __toESM(require("node:fs"), 1);
7523
- var import_node_path12 = __toESM(require("node:path"), 1);
7704
+ var import_promises = __toESM(require("node:fs/promises"), 1);
7705
+ var import_node_path11 = __toESM(require("node:path"), 1);
7706
+ var import_node_path12 = require("node:path");
7707
+ var import_node_fs10 = __toESM(require("node:fs"), 1);
7708
+ var import_node_path13 = __toESM(require("node:path"), 1);
7524
7709
  var zr = Object.defineProperty;
7525
7710
  var Ur = (s3, t) => {
7526
7711
  for (var e in t) zr(s3, e, { get: t[e], enumerable: true });
@@ -8414,12 +8599,12 @@ var F = class {
8414
8599
  }
8415
8600
  };
8416
8601
  var mn = (s3, t) => {
8417
- let i = s3, r = "", n, o = import_node_path5.posix.parse(s3).root || ".";
8602
+ let i = s3, r = "", n, o = import_node_path6.posix.parse(s3).root || ".";
8418
8603
  if (Buffer.byteLength(i) < 100) n = [i, r, false];
8419
8604
  else {
8420
- r = import_node_path5.posix.dirname(i), i = import_node_path5.posix.basename(i);
8605
+ r = import_node_path6.posix.dirname(i), i = import_node_path6.posix.basename(i);
8421
8606
  do
8422
- Buffer.byteLength(i) <= 100 && Buffer.byteLength(r) <= t ? n = [i, r, false] : Buffer.byteLength(i) > 100 && Buffer.byteLength(r) <= t ? n = [i.slice(0, 99), r, true] : (i = import_node_path5.posix.join(import_node_path5.posix.basename(r), i), r = import_node_path5.posix.dirname(r));
8607
+ Buffer.byteLength(i) <= 100 && Buffer.byteLength(r) <= t ? n = [i, r, false] : Buffer.byteLength(i) > 100 && Buffer.byteLength(r) <= t ? n = [i.slice(0, 99), r, true] : (i = import_node_path6.posix.join(import_node_path6.posix.basename(r), i), r = import_node_path6.posix.dirname(r));
8423
8608
  while (r !== o && n === void 0);
8424
8609
  n || (n = [s3.slice(0, 99), "", true]);
8425
8610
  }
@@ -8465,7 +8650,7 @@ var ft = class s {
8465
8650
  if (t === "") return Buffer.allocUnsafe(0);
8466
8651
  let e = Buffer.byteLength(t), i = 512 * Math.ceil(1 + e / 512), r = Buffer.allocUnsafe(i);
8467
8652
  for (let n = 0; n < 512; n++) r[n] = 0;
8468
- new F({ path: ("PaxHeader/" + (0, import_node_path6.basename)(this.path ?? "")).slice(0, 99), mode: this.mode || 420, uid: this.uid, gid: this.gid, size: e, mtime: this.mtime, type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", linkpath: "", uname: this.uname || "", gname: this.gname || "", devmaj: 0, devmin: 0, atime: this.atime, ctime: this.ctime }).encode(r), r.write(t, 512, e, "utf8");
8653
+ new F({ path: ("PaxHeader/" + (0, import_node_path7.basename)(this.path ?? "")).slice(0, 99), mode: this.mode || 420, uid: this.uid, gid: this.gid, size: e, mtime: this.mtime, type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", linkpath: "", uname: this.uname || "", gname: this.gname || "", devmaj: 0, devmin: 0, atime: this.atime, ctime: this.ctime }).encode(r), r.write(t, 512, e, "utf8");
8469
8654
  for (let n = e + 512; n < r.length; n++) r[n] = 0;
8470
8655
  return r;
8471
8656
  }
@@ -8891,15 +9076,15 @@ var Qi = (s3, t) => {
8891
9076
  var Mn = (s3) => {
8892
9077
  let t = new rt(s3), e = s3.file, i;
8893
9078
  try {
8894
- i = import_node_fs4.default.openSync(e, "r");
8895
- let r = import_node_fs4.default.fstatSync(i), n = s3.maxReadSize || 16 * 1024 * 1024;
9079
+ i = import_node_fs5.default.openSync(e, "r");
9080
+ let r = import_node_fs5.default.fstatSync(i), n = s3.maxReadSize || 16 * 1024 * 1024;
8896
9081
  if (r.size < n) {
8897
- let o = Buffer.allocUnsafe(r.size), h = import_node_fs4.default.readSync(i, o, 0, r.size, 0);
9082
+ let o = Buffer.allocUnsafe(r.size), h = import_node_fs5.default.readSync(i, o, 0, r.size, 0);
8898
9083
  t.end(h === o.byteLength ? o : o.subarray(0, h));
8899
9084
  } else {
8900
9085
  let o = 0, h = Buffer.allocUnsafe(n);
8901
9086
  for (; o < r.size; ) {
8902
- let a = import_node_fs4.default.readSync(i, h, 0, n, o);
9087
+ let a = import_node_fs5.default.readSync(i, h, 0, n, o);
8903
9088
  if (a === 0) break;
8904
9089
  o += a, t.write(h.subarray(0, a));
8905
9090
  }
@@ -8907,7 +9092,7 @@ var Mn = (s3) => {
8907
9092
  }
8908
9093
  } finally {
8909
9094
  if (typeof i == "number") try {
8910
- import_node_fs4.default.closeSync(i);
9095
+ import_node_fs5.default.closeSync(i);
8911
9096
  } catch {
8912
9097
  }
8913
9098
  }
@@ -8915,7 +9100,7 @@ var Mn = (s3) => {
8915
9100
  var Bn = (s3, t) => {
8916
9101
  let e = new rt(s3), i = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
8917
9102
  return new Promise((o, h) => {
8918
- e.on("error", h), e.on("end", o), import_node_fs4.default.stat(r, (a, l) => {
9103
+ e.on("error", h), e.on("end", o), import_node_fs5.default.stat(r, (a, l) => {
8919
9104
  if (a) h(a);
8920
9105
  else {
8921
9106
  let c = new _t(r, { readSize: i, size: l.size });
@@ -8928,7 +9113,7 @@ var Ct = K(Mn, Bn, (s3) => new rt(s3), (s3) => new rt(s3), (s3, t) => {
8928
9113
  t?.length && Qi(s3, t), s3.noResume || vn(s3);
8929
9114
  });
8930
9115
  var Ji = (s3, t, e) => (s3 &= 4095, e && (s3 = (s3 | 384) & -19), t && (s3 & 256 && (s3 |= 64), s3 & 32 && (s3 |= 8), s3 & 4 && (s3 |= 1)), s3);
8931
- var { isAbsolute: zn, parse: qs } = import_node_path7.win32;
9116
+ var { isAbsolute: zn, parse: qs } = import_node_path8.win32;
8932
9117
  var ce = (s3) => {
8933
9118
  let t = "", e = qs(s3);
8934
9119
  for (; zn(s3) || e.root; ) {
@@ -9637,11 +9822,11 @@ var $n = (s3, t) => {
9637
9822
  };
9638
9823
  var fr = (s3, t) => {
9639
9824
  t.forEach((e) => {
9640
- e.charAt(0) === "@" ? Ct({ file: import_node_path4.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
9825
+ e.charAt(0) === "@" ? Ct({ file: import_node_path5.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
9641
9826
  }), s3.end();
9642
9827
  };
9643
9828
  var dr = async (s3, t) => {
9644
- for (let e of t) e.charAt(0) === "@" ? await Ct({ file: import_node_path4.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => {
9829
+ for (let e of t) e.charAt(0) === "@" ? await Ct({ file: import_node_path5.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => {
9645
9830
  s3.add(i);
9646
9831
  } }) : s3.add(e);
9647
9832
  s3.end();
@@ -9668,29 +9853,29 @@ var mr = !Er && typeof ur == "number" ? ur | Sr | wr | yr : null;
9668
9853
  var ms = mr !== null ? () => mr : jn ? (s3) => s3 < to ? eo : "w" : () => "w";
9669
9854
  var ps = (s3, t, e) => {
9670
9855
  try {
9671
- return import_node_fs7.default.lchownSync(s3, t, e);
9856
+ return import_node_fs8.default.lchownSync(s3, t, e);
9672
9857
  } catch (i) {
9673
9858
  if (i?.code !== "ENOENT") throw i;
9674
9859
  }
9675
9860
  };
9676
9861
  var Ei = (s3, t, e, i) => {
9677
- import_node_fs7.default.lchown(s3, t, e, (r) => {
9862
+ import_node_fs8.default.lchown(s3, t, e, (r) => {
9678
9863
  i(r && r?.code !== "ENOENT" ? r : null);
9679
9864
  });
9680
9865
  };
9681
9866
  var io = (s3, t, e, i, r) => {
9682
- if (t.isDirectory()) Es(import_node_path9.default.resolve(s3, t.name), e, i, (n) => {
9867
+ if (t.isDirectory()) Es(import_node_path10.default.resolve(s3, t.name), e, i, (n) => {
9683
9868
  if (n) return r(n);
9684
- let o = import_node_path9.default.resolve(s3, t.name);
9869
+ let o = import_node_path10.default.resolve(s3, t.name);
9685
9870
  Ei(o, e, i, r);
9686
9871
  });
9687
9872
  else {
9688
- let n = import_node_path9.default.resolve(s3, t.name);
9873
+ let n = import_node_path10.default.resolve(s3, t.name);
9689
9874
  Ei(n, e, i, r);
9690
9875
  }
9691
9876
  };
9692
9877
  var Es = (s3, t, e, i) => {
9693
- import_node_fs7.default.readdir(s3, { withFileTypes: true }, (r, n) => {
9878
+ import_node_fs8.default.readdir(s3, { withFileTypes: true }, (r, n) => {
9694
9879
  if (r) {
9695
9880
  if (r.code === "ENOENT") return i();
9696
9881
  if (r.code !== "ENOTDIR" && r.code !== "ENOTSUP") return i(r);
@@ -9706,12 +9891,12 @@ var Es = (s3, t, e, i) => {
9706
9891
  });
9707
9892
  };
9708
9893
  var so = (s3, t, e, i) => {
9709
- t.isDirectory() && ws(import_node_path9.default.resolve(s3, t.name), e, i), ps(import_node_path9.default.resolve(s3, t.name), e, i);
9894
+ t.isDirectory() && ws(import_node_path10.default.resolve(s3, t.name), e, i), ps(import_node_path10.default.resolve(s3, t.name), e, i);
9710
9895
  };
9711
9896
  var ws = (s3, t, e) => {
9712
9897
  let i;
9713
9898
  try {
9714
- i = import_node_fs7.default.readdirSync(s3, { withFileTypes: true });
9899
+ i = import_node_fs8.default.readdirSync(s3, { withFileTypes: true });
9715
9900
  } catch (r) {
9716
9901
  let n = r;
9717
9902
  if (n?.code === "ENOENT") return;
@@ -9745,32 +9930,32 @@ var St = class extends Error {
9745
9930
  }
9746
9931
  };
9747
9932
  var no = (s3, t) => {
9748
- import_node_fs8.default.stat(s3, (e, i) => {
9933
+ import_node_fs9.default.stat(s3, (e, i) => {
9749
9934
  (e || !i.isDirectory()) && (e = new Se(s3, e?.code || "ENOTDIR")), t(e);
9750
9935
  });
9751
9936
  };
9752
9937
  var gr = (s3, t, e) => {
9753
9938
  s3 = f(s3);
9754
9939
  let i = t.umask ?? 18, r = t.mode | 448, n = (r & i) !== 0, o = t.uid, h = t.gid, a = typeof o == "number" && typeof h == "number" && (o !== t.processUid || h !== t.processGid), l = t.preserve, c = t.unlink, d = f(t.cwd), y = (E, x) => {
9755
- E ? e(E) : x && a ? Es(x, o, h, (Le) => y(Le)) : n ? import_node_fs8.default.chmod(s3, r, e) : e();
9940
+ E ? e(E) : x && a ? Es(x, o, h, (Le) => y(Le)) : n ? import_node_fs9.default.chmod(s3, r, e) : e();
9756
9941
  };
9757
9942
  if (s3 === d) return no(s3, y);
9758
9943
  if (l) return import_promises.default.mkdir(s3, { mode: r, recursive: true }).then((E) => y(null, E ?? void 0), y);
9759
- let D = f(import_node_path10.default.relative(d, s3)).split("/");
9944
+ let D = f(import_node_path11.default.relative(d, s3)).split("/");
9760
9945
  Ss(d, D, r, c, d, void 0, y);
9761
9946
  };
9762
9947
  var Ss = (s3, t, e, i, r, n, o) => {
9763
9948
  if (t.length === 0) return o(null, n);
9764
- let h = t.shift(), a = f(import_node_path10.default.resolve(s3 + "/" + h));
9765
- import_node_fs8.default.mkdir(a, e, br(a, t, e, i, r, n, o));
9949
+ let h = t.shift(), a = f(import_node_path11.default.resolve(s3 + "/" + h));
9950
+ import_node_fs9.default.mkdir(a, e, br(a, t, e, i, r, n, o));
9766
9951
  };
9767
9952
  var br = (s3, t, e, i, r, n, o) => (h) => {
9768
- h ? import_node_fs8.default.lstat(s3, (a, l) => {
9953
+ h ? import_node_fs9.default.lstat(s3, (a, l) => {
9769
9954
  if (a) a.path = a.path && f(a.path), o(a);
9770
9955
  else if (l.isDirectory()) Ss(s3, t, e, i, r, n, o);
9771
- else if (i) import_node_fs8.default.unlink(s3, (c) => {
9956
+ else if (i) import_node_fs9.default.unlink(s3, (c) => {
9772
9957
  if (c) return o(c);
9773
- import_node_fs8.default.mkdir(s3, e, br(s3, t, e, i, r, n, o));
9958
+ import_node_fs9.default.mkdir(s3, e, br(s3, t, e, i, r, n, o));
9774
9959
  });
9775
9960
  else {
9776
9961
  if (l.isSymbolicLink()) return o(new St(s3, s3 + "/" + t.join("/")));
@@ -9781,7 +9966,7 @@ var br = (s3, t, e, i, r, n, o) => (h) => {
9781
9966
  var oo = (s3) => {
9782
9967
  let t = false, e;
9783
9968
  try {
9784
- t = import_node_fs8.default.statSync(s3).isDirectory();
9969
+ t = import_node_fs9.default.statSync(s3).isDirectory();
9785
9970
  } catch (i) {
9786
9971
  e = i?.code;
9787
9972
  } finally {
@@ -9791,20 +9976,20 @@ var oo = (s3) => {
9791
9976
  var _r = (s3, t) => {
9792
9977
  s3 = f(s3);
9793
9978
  let e = t.umask ?? 18, i = t.mode | 448, r = (i & e) !== 0, n = t.uid, o = t.gid, h = typeof n == "number" && typeof o == "number" && (n !== t.processUid || o !== t.processGid), a = t.preserve, l = t.unlink, c = f(t.cwd), d = (E) => {
9794
- E && h && ws(E, n, o), r && import_node_fs8.default.chmodSync(s3, i);
9979
+ E && h && ws(E, n, o), r && import_node_fs9.default.chmodSync(s3, i);
9795
9980
  };
9796
9981
  if (s3 === c) return oo(c), d();
9797
- if (a) return d(import_node_fs8.default.mkdirSync(s3, { mode: i, recursive: true }) ?? void 0);
9798
- let T = f(import_node_path10.default.relative(c, s3)).split("/"), D;
9982
+ if (a) return d(import_node_fs9.default.mkdirSync(s3, { mode: i, recursive: true }) ?? void 0);
9983
+ let T = f(import_node_path11.default.relative(c, s3)).split("/"), D;
9799
9984
  for (let E = T.shift(), x = c; E && (x += "/" + E); E = T.shift()) {
9800
- x = f(import_node_path10.default.resolve(x));
9985
+ x = f(import_node_path11.default.resolve(x));
9801
9986
  try {
9802
- import_node_fs8.default.mkdirSync(x, i), D = D || x;
9987
+ import_node_fs9.default.mkdirSync(x, i), D = D || x;
9803
9988
  } catch {
9804
- let Le = import_node_fs8.default.lstatSync(x);
9989
+ let Le = import_node_fs9.default.lstatSync(x);
9805
9990
  if (Le.isDirectory()) continue;
9806
9991
  if (l) {
9807
- import_node_fs8.default.unlinkSync(x), import_node_fs8.default.mkdirSync(x, i), D = D || x;
9992
+ import_node_fs9.default.unlinkSync(x), import_node_fs9.default.mkdirSync(x, i), D = D || x;
9808
9993
  continue;
9809
9994
  } else if (Le.isSymbolicLink()) return new St(x, x + "/" + T.join("/"));
9810
9995
  }
@@ -9826,14 +10011,14 @@ var ho = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
9826
10011
  var ao = ho === "win32";
9827
10012
  var lo = (s3) => s3.split("/").slice(0, -1).reduce((e, i) => {
9828
10013
  let r = e.at(-1);
9829
- return r !== void 0 && (i = (0, import_node_path11.join)(r, i)), e.push(i || "/"), e;
10014
+ return r !== void 0 && (i = (0, import_node_path12.join)(r, i)), e.push(i || "/"), e;
9830
10015
  }, []);
9831
10016
  var yi = class {
9832
10017
  #t = /* @__PURE__ */ new Map();
9833
10018
  #i = /* @__PURE__ */ new Map();
9834
10019
  #s = /* @__PURE__ */ new Set();
9835
10020
  reserve(t, e) {
9836
- t = ao ? ["win32 parallelization disabled"] : t.map((r) => mt((0, import_node_path11.join)(Tr(r))));
10021
+ t = ao ? ["win32 parallelization disabled"] : t.map((r) => mt((0, import_node_path12.join)(Tr(r))));
9837
10022
  let i = new Set(t.map((r) => lo(r)).reduce((r, n) => r.concat(n)));
9838
10023
  this.#i.set(e, { dirs: i, paths: t });
9839
10024
  for (let r of t) {
@@ -9923,17 +10108,17 @@ var fo = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
9923
10108
  var Te = fo === "win32";
9924
10109
  var uo = 1024;
9925
10110
  var mo = (s3, t) => {
9926
- if (!Te) return import_node_fs6.default.unlink(s3, t);
10111
+ if (!Te) return import_node_fs7.default.unlink(s3, t);
9927
10112
  let e = s3 + ".DELETE." + (0, import_node_crypto3.randomBytes)(16).toString("hex");
9928
- import_node_fs6.default.rename(s3, e, (i) => {
10113
+ import_node_fs7.default.rename(s3, e, (i) => {
9929
10114
  if (i) return t(i);
9930
- import_node_fs6.default.unlink(e, t);
10115
+ import_node_fs7.default.unlink(e, t);
9931
10116
  });
9932
10117
  };
9933
10118
  var po = (s3) => {
9934
- if (!Te) return import_node_fs6.default.unlinkSync(s3);
10119
+ if (!Te) return import_node_fs7.default.unlinkSync(s3);
9935
10120
  let t = s3 + ".DELETE." + (0, import_node_crypto3.randomBytes)(16).toString("hex");
9936
- import_node_fs6.default.renameSync(s3, t), import_node_fs6.default.unlinkSync(t);
10121
+ import_node_fs7.default.renameSync(s3, t), import_node_fs7.default.unlinkSync(t);
9937
10122
  };
9938
10123
  var vr = (s3, t, e) => s3 !== void 0 && s3 === s3 >>> 0 ? s3 : t !== void 0 && t === t >>> 0 ? t : e;
9939
10124
  var Xt = class extends rt {
@@ -9973,7 +10158,7 @@ var Xt = class extends rt {
9973
10158
  if (t.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
9974
10159
  this.uid = t.uid, this.gid = t.gid, this.setOwner = true;
9975
10160
  } else this.uid = void 0, this.gid = void 0, this.setOwner = false;
9976
- this.preserveOwner = t.preserveOwner === void 0 && typeof t.uid != "number" ? process.getuid?.() === 0 : !!t.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t.maxDepth == "number" ? t.maxDepth : uo, this.forceChown = t.forceChown === true, this.win32 = !!t.win32 || Te, this.newer = !!t.newer, this.keep = !!t.keep, this.noMtime = !!t.noMtime, this.preservePaths = !!t.preservePaths, this.unlink = !!t.unlink, this.cwd = f(import_node_path8.default.resolve(t.cwd || process.cwd())), this.strip = Number(t.strip) || 0, this.processUmask = this.chmod ? typeof t.processUmask == "number" ? t.processUmask : Lr() : 0, this.umask = typeof t.umask == "number" ? t.umask : this.processUmask, this.dmode = t.dmode || 511 & ~this.umask, this.fmode = t.fmode || 438 & ~this.umask, this.on("entry", (e) => this[Dr](e));
10161
+ this.preserveOwner = t.preserveOwner === void 0 && typeof t.uid != "number" ? process.getuid?.() === 0 : !!t.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t.maxDepth == "number" ? t.maxDepth : uo, this.forceChown = t.forceChown === true, this.win32 = !!t.win32 || Te, this.newer = !!t.newer, this.keep = !!t.keep, this.noMtime = !!t.noMtime, this.preservePaths = !!t.preservePaths, this.unlink = !!t.unlink, this.cwd = f(import_node_path9.default.resolve(t.cwd || process.cwd())), this.strip = Number(t.strip) || 0, this.processUmask = this.chmod ? typeof t.processUmask == "number" ? t.processUmask : Lr() : 0, this.umask = typeof t.umask == "number" ? t.umask : this.processUmask, this.dmode = t.dmode || 511 & ~this.umask, this.fmode = t.fmode || 438 & ~this.umask, this.on("entry", (e) => this[Dr](e));
9977
10162
  }
9978
10163
  warn(t, e, i = {}) {
9979
10164
  return (t === "TAR_BAD_ARCHIVE" || t === "TAR_ABORT") && (i.recoverable = false), super.warn(t, e, i);
@@ -9987,7 +10172,7 @@ var Xt = class extends rt {
9987
10172
  let [n, o] = ce(i), h = o.replaceAll(/\\/g, "/").split("/");
9988
10173
  if (h.includes("..") || Te && /^[a-z]:\.\.$/i.test(h[0] ?? "")) {
9989
10174
  if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t, [e]: i }), false;
9990
- let a = import_node_path8.default.posix.dirname(t.path), l = import_node_path8.default.posix.normalize(import_node_path8.default.posix.join(a, h.join("/")));
10175
+ let a = import_node_path9.default.posix.dirname(t.path), l = import_node_path9.default.posix.normalize(import_node_path9.default.posix.join(a, h.join("/")));
9991
10176
  if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t, [e]: i }), false;
9992
10177
  }
9993
10178
  return n && (t[e] = String(o), this.warn("TAR_ENTRY_INFO", `stripping ${n} from absolute ${e}`, { entry: t, [e]: i })), true;
@@ -10005,12 +10190,12 @@ var Xt = class extends rt {
10005
10190
  }
10006
10191
  if (isFinite(this.maxDepth) && i.length > this.maxDepth) return this.warn("TAR_ENTRY_ERROR", "path excessively deep", { entry: t, path: e, depth: i.length, maxDepth: this.maxDepth }), false;
10007
10192
  if (!this[Rs](t, "path") || !this[Rs](t, "linkpath")) return false;
10008
- if (t.absolute = import_node_path8.default.isAbsolute(t.path) ? f(import_node_path8.default.resolve(t.path)) : f(import_node_path8.default.resolve(this.cwd, t.path)), !this.preservePaths && typeof t.absolute == "string" && t.absolute.indexOf(this.cwd + "/") !== 0 && t.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { entry: t, path: f(t.path), resolvedPath: t.absolute, cwd: this.cwd }), false;
10193
+ if (t.absolute = import_node_path9.default.isAbsolute(t.path) ? f(import_node_path9.default.resolve(t.path)) : f(import_node_path9.default.resolve(this.cwd, t.path)), !this.preservePaths && typeof t.absolute == "string" && t.absolute.indexOf(this.cwd + "/") !== 0 && t.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { entry: t, path: f(t.path), resolvedPath: t.absolute, cwd: this.cwd }), false;
10009
10194
  if (t.absolute === this.cwd && t.type !== "Directory" && t.type !== "GNUDumpDir") return false;
10010
10195
  if (this.win32) {
10011
- let { root: r } = import_node_path8.default.win32.parse(String(t.absolute));
10196
+ let { root: r } = import_node_path9.default.win32.parse(String(t.absolute));
10012
10197
  t.absolute = r + ts(String(t.absolute).slice(r.length));
10013
- let { root: n } = import_node_path8.default.win32.parse(t.path);
10198
+ let { root: n } = import_node_path9.default.win32.parse(t.path);
10014
10199
  t.path = n + ts(t.path.slice(n.length));
10015
10200
  }
10016
10201
  return true;
@@ -10049,16 +10234,16 @@ var Xt = class extends rt {
10049
10234
  [Ts](t, e) {
10050
10235
  let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = new et(String(t.absolute), { flags: ms(t.size), mode: i, autoClose: false });
10051
10236
  r.on("error", (a) => {
10052
- r.fd && import_node_fs6.default.close(r.fd, () => {
10237
+ r.fd && import_node_fs7.default.close(r.fd, () => {
10053
10238
  }), r.write = () => true, this[O](a, t), e();
10054
10239
  });
10055
10240
  let n = 1, o = (a) => {
10056
10241
  if (a) {
10057
- r.fd && import_node_fs6.default.close(r.fd, () => {
10242
+ r.fd && import_node_fs7.default.close(r.fd, () => {
10058
10243
  }), this[O](a, t), e();
10059
10244
  return;
10060
10245
  }
10061
- --n === 0 && r.fd !== void 0 && import_node_fs6.default.close(r.fd, (l) => {
10246
+ --n === 0 && r.fd !== void 0 && import_node_fs7.default.close(r.fd, (l) => {
10062
10247
  l ? this[O](l, t) : this[$t](), e();
10063
10248
  });
10064
10249
  };
@@ -10067,12 +10252,12 @@ var Xt = class extends rt {
10067
10252
  if (typeof l == "number" && t.mtime && !this.noMtime) {
10068
10253
  n++;
10069
10254
  let c = t.atime || /* @__PURE__ */ new Date(), d = t.mtime;
10070
- import_node_fs6.default.futimes(l, c, d, (y) => y ? import_node_fs6.default.utimes(a, c, d, (T) => o(T && y)) : o());
10255
+ import_node_fs7.default.futimes(l, c, d, (y) => y ? import_node_fs7.default.utimes(a, c, d, (T) => o(T && y)) : o());
10071
10256
  }
10072
10257
  if (typeof l == "number" && this[ge](t)) {
10073
10258
  n++;
10074
10259
  let c = this[be](t), d = this[_e](t);
10075
- typeof c == "number" && typeof d == "number" && import_node_fs6.default.fchown(l, c, d, (y) => y ? import_node_fs6.default.chown(a, c, d, (T) => o(T && y)) : o());
10260
+ typeof c == "number" && typeof d == "number" && import_node_fs7.default.fchown(l, c, d, (y) => y ? import_node_fs7.default.chown(a, c, d, (T) => o(T && y)) : o());
10076
10261
  }
10077
10262
  o();
10078
10263
  });
@@ -10091,20 +10276,20 @@ var Xt = class extends rt {
10091
10276
  let n = 1, o = () => {
10092
10277
  --n === 0 && (e(), this[$t](), t.resume());
10093
10278
  };
10094
- t.mtime && !this.noMtime && (n++, import_node_fs6.default.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o)), this[ge](t) && (n++, import_node_fs6.default.chown(String(t.absolute), Number(this[be](t)), Number(this[_e](t)), o)), o();
10279
+ t.mtime && !this.noMtime && (n++, import_node_fs7.default.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o)), this[ge](t) && (n++, import_node_fs7.default.chown(String(t.absolute), Number(this[be](t)), Number(this[_e](t)), o)), o();
10095
10280
  });
10096
10281
  }
10097
10282
  [Cr](t) {
10098
10283
  t.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t.type}`, { entry: t }), t.resume();
10099
10284
  }
10100
10285
  [Ar](t, e) {
10101
- let i = f(import_node_path8.default.relative(this.cwd, import_node_path8.default.resolve(import_node_path8.default.dirname(String(t.absolute)), String(t.linkpath)))).split("/");
10286
+ let i = f(import_node_path9.default.relative(this.cwd, import_node_path9.default.resolve(import_node_path9.default.dirname(String(t.absolute)), String(t.linkpath)))).split("/");
10102
10287
  this[Re](t, this.cwd, i, () => this[gi](t, String(t.linkpath), "symlink", e), (r) => {
10103
10288
  this[O](r, t), e();
10104
10289
  });
10105
10290
  }
10106
10291
  [Ir](t, e) {
10107
- let i = f(import_node_path8.default.resolve(this.cwd, String(t.linkpath))), r = f(String(t.linkpath)).split("/");
10292
+ let i = f(import_node_path9.default.resolve(this.cwd, String(t.linkpath))), r = f(String(t.linkpath)).split("/");
10108
10293
  this[Re](t, this.cwd, r, () => this[gi](t, i, "link", e), (n) => {
10109
10294
  this[O](n, t), e();
10110
10295
  });
@@ -10112,10 +10297,10 @@ var Xt = class extends rt {
10112
10297
  [Re](t, e, i, r, n) {
10113
10298
  let o = i.shift();
10114
10299
  if (this.preservePaths || o === void 0) return r();
10115
- let h = import_node_path8.default.resolve(e, o);
10116
- import_node_fs6.default.lstat(h, (a, l) => {
10300
+ let h = import_node_path9.default.resolve(e, o);
10301
+ import_node_fs7.default.lstat(h, (a, l) => {
10117
10302
  if (a) return r();
10118
- if (l?.isSymbolicLink()) return n(new St(h, import_node_path8.default.resolve(h, i.join("/"))));
10303
+ if (l?.isSymbolicLink()) return n(new St(h, import_node_path9.default.resolve(h, i.join("/"))));
10119
10304
  this[Re](t, h, i, r, n);
10120
10305
  });
10121
10306
  }
@@ -10149,7 +10334,7 @@ var Xt = class extends rt {
10149
10334
  });
10150
10335
  }, n = () => {
10151
10336
  if (t.absolute !== this.cwd) {
10152
- let h = f(import_node_path8.default.dirname(String(t.absolute)));
10337
+ let h = f(import_node_path9.default.dirname(String(t.absolute)));
10153
10338
  if (h !== this.cwd) return this[yt](h, this.dmode, (a) => {
10154
10339
  if (a) {
10155
10340
  this[O](a, t), i();
@@ -10160,7 +10345,7 @@ var Xt = class extends rt {
10160
10345
  }
10161
10346
  o();
10162
10347
  }, o = () => {
10163
- import_node_fs6.default.lstat(String(t.absolute), (h, a) => {
10348
+ import_node_fs7.default.lstat(String(t.absolute), (h, a) => {
10164
10349
  if (a && (this.keep || this.newer && a.mtime > (t.mtime ?? a.mtime))) {
10165
10350
  this[Ls](t), i();
10166
10351
  return;
@@ -10169,9 +10354,9 @@ var Xt = class extends rt {
10169
10354
  if (a.isDirectory()) {
10170
10355
  if (t.type === "Directory") {
10171
10356
  let l = this.chmod && t.mode && (a.mode & 4095) !== t.mode, c = (d) => this[P](d ?? null, t, i);
10172
- return l ? import_node_fs6.default.chmod(String(t.absolute), Number(t.mode), c) : c();
10357
+ return l ? import_node_fs7.default.chmod(String(t.absolute), Number(t.mode), c) : c();
10173
10358
  }
10174
- if (t.absolute !== this.cwd) return import_node_fs6.default.rmdir(String(t.absolute), (l) => this[P](l ?? null, t, i));
10359
+ if (t.absolute !== this.cwd) return import_node_fs7.default.rmdir(String(t.absolute), (l) => this[P](l ?? null, t, i));
10175
10360
  }
10176
10361
  if (t.absolute === this.cwd) return this[P](null, t, i);
10177
10362
  mo(String(t.absolute), (l) => this[P](l ?? null, t, i));
@@ -10199,7 +10384,7 @@ var Xt = class extends rt {
10199
10384
  }
10200
10385
  }
10201
10386
  [gi](t, e, i, r) {
10202
- import_node_fs6.default[i](e, String(t.absolute), (n) => {
10387
+ import_node_fs7.default[i](e, String(t.absolute), (n) => {
10203
10388
  n ? this[O](n, t) : (this[$t](), t.resume()), r();
10204
10389
  });
10205
10390
  }
@@ -10224,23 +10409,23 @@ var xe = class extends Xt {
10224
10409
  this[Oe] = true;
10225
10410
  }
10226
10411
  if (t.absolute !== this.cwd) {
10227
- let n = f(import_node_path8.default.dirname(String(t.absolute)));
10412
+ let n = f(import_node_path9.default.dirname(String(t.absolute)));
10228
10413
  if (n !== this.cwd) {
10229
10414
  let o = this[yt](n, this.dmode);
10230
10415
  if (o) return this[O](o, t);
10231
10416
  }
10232
10417
  }
10233
- let [e, i] = ye(() => import_node_fs6.default.lstatSync(String(t.absolute)));
10418
+ let [e, i] = ye(() => import_node_fs7.default.lstatSync(String(t.absolute)));
10234
10419
  if (i && (this.keep || this.newer && i.mtime > (t.mtime ?? i.mtime))) return this[Ls](t);
10235
10420
  if (e || this[Os](t, i)) return this[P](null, t);
10236
10421
  if (i.isDirectory()) {
10237
10422
  if (t.type === "Directory") {
10238
10423
  let o = this.chmod && t.mode && (i.mode & 4095) !== t.mode, [h] = o ? ye(() => {
10239
- import_node_fs6.default.chmodSync(String(t.absolute), Number(t.mode));
10424
+ import_node_fs7.default.chmodSync(String(t.absolute), Number(t.mode));
10240
10425
  }) : [];
10241
10426
  return this[P](h, t);
10242
10427
  }
10243
- let [n] = ye(() => import_node_fs6.default.rmdirSync(String(t.absolute)));
10428
+ let [n] = ye(() => import_node_fs7.default.rmdirSync(String(t.absolute)));
10244
10429
  this[P](n, t);
10245
10430
  }
10246
10431
  let [r] = t.absolute === this.cwd ? [] : ye(() => po(String(t.absolute)));
@@ -10250,21 +10435,21 @@ var xe = class extends Xt {
10250
10435
  let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = (h) => {
10251
10436
  let a;
10252
10437
  try {
10253
- import_node_fs6.default.closeSync(n);
10438
+ import_node_fs7.default.closeSync(n);
10254
10439
  } catch (l) {
10255
10440
  a = l;
10256
10441
  }
10257
10442
  (h || a) && this[O](h || a, t), e();
10258
10443
  }, n;
10259
10444
  try {
10260
- n = import_node_fs6.default.openSync(String(t.absolute), ms(t.size), i);
10445
+ n = import_node_fs7.default.openSync(String(t.absolute), ms(t.size), i);
10261
10446
  } catch (h) {
10262
10447
  return r(h);
10263
10448
  }
10264
10449
  let o = this.transform && this.transform(t) || t;
10265
10450
  o !== t && (o.on("error", (h) => this[O](h, t)), t.pipe(o)), o.on("data", (h) => {
10266
10451
  try {
10267
- import_node_fs6.default.writeSync(n, h, 0, h.length);
10452
+ import_node_fs7.default.writeSync(n, h, 0, h.length);
10268
10453
  } catch (a) {
10269
10454
  r(a);
10270
10455
  }
@@ -10273,10 +10458,10 @@ var xe = class extends Xt {
10273
10458
  if (t.mtime && !this.noMtime) {
10274
10459
  let a = t.atime || /* @__PURE__ */ new Date(), l = t.mtime;
10275
10460
  try {
10276
- import_node_fs6.default.futimesSync(n, a, l);
10461
+ import_node_fs7.default.futimesSync(n, a, l);
10277
10462
  } catch (c) {
10278
10463
  try {
10279
- import_node_fs6.default.utimesSync(String(t.absolute), a, l);
10464
+ import_node_fs7.default.utimesSync(String(t.absolute), a, l);
10280
10465
  } catch {
10281
10466
  h = c;
10282
10467
  }
@@ -10285,10 +10470,10 @@ var xe = class extends Xt {
10285
10470
  if (this[ge](t)) {
10286
10471
  let a = this[be](t), l = this[_e](t);
10287
10472
  try {
10288
- import_node_fs6.default.fchownSync(n, Number(a), Number(l));
10473
+ import_node_fs7.default.fchownSync(n, Number(a), Number(l));
10289
10474
  } catch (c) {
10290
10475
  try {
10291
- import_node_fs6.default.chownSync(String(t.absolute), Number(a), Number(l));
10476
+ import_node_fs7.default.chownSync(String(t.absolute), Number(a), Number(l));
10292
10477
  } catch {
10293
10478
  h = h || c;
10294
10479
  }
@@ -10304,11 +10489,11 @@ var xe = class extends Xt {
10304
10489
  return;
10305
10490
  }
10306
10491
  if (t.mtime && !this.noMtime) try {
10307
- import_node_fs6.default.utimesSync(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime);
10492
+ import_node_fs7.default.utimesSync(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime);
10308
10493
  } catch {
10309
10494
  }
10310
10495
  if (this[ge](t)) try {
10311
- import_node_fs6.default.chownSync(String(t.absolute), Number(this[be](t)), Number(this[_e](t)));
10496
+ import_node_fs7.default.chownSync(String(t.absolute), Number(this[be](t)), Number(this[_e](t)));
10312
10497
  } catch {
10313
10498
  }
10314
10499
  e(), t.resume();
@@ -10324,30 +10509,30 @@ var xe = class extends Xt {
10324
10509
  if (this.preservePaths || i.length === 0) return r();
10325
10510
  let o = e;
10326
10511
  for (let h of i) {
10327
- o = import_node_path8.default.resolve(o, h);
10328
- let [a, l] = ye(() => import_node_fs6.default.lstatSync(o));
10512
+ o = import_node_path9.default.resolve(o, h);
10513
+ let [a, l] = ye(() => import_node_fs7.default.lstatSync(o));
10329
10514
  if (a) return r();
10330
- if (l.isSymbolicLink()) return n(new St(o, import_node_path8.default.resolve(e, i.join("/"))));
10515
+ if (l.isSymbolicLink()) return n(new St(o, import_node_path9.default.resolve(e, i.join("/"))));
10331
10516
  }
10332
10517
  r();
10333
10518
  }
10334
10519
  [gi](t, e, i, r) {
10335
10520
  let n = `${i}Sync`;
10336
10521
  try {
10337
- import_node_fs6.default[n](e, String(t.absolute)), r(), t.resume();
10522
+ import_node_fs7.default[n](e, String(t.absolute)), r(), t.resume();
10338
10523
  } catch (o) {
10339
10524
  return this[O](o, t);
10340
10525
  }
10341
10526
  }
10342
10527
  };
10343
10528
  var Eo = (s3) => {
10344
- let t = new xe(s3), e = s3.file, i = import_node_fs5.default.statSync(e), r = s3.maxReadSize || 16 * 1024 * 1024;
10529
+ let t = new xe(s3), e = s3.file, i = import_node_fs6.default.statSync(e), r = s3.maxReadSize || 16 * 1024 * 1024;
10345
10530
  new Be(e, { readSize: r, size: i.size }).pipe(t);
10346
10531
  };
10347
10532
  var wo = (s3, t) => {
10348
10533
  let e = new Xt(s3), i = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
10349
10534
  return new Promise((o, h) => {
10350
- e.on("error", h), e.on("close", o), import_node_fs5.default.stat(r, (a, l) => {
10535
+ e.on("error", h), e.on("close", o), import_node_fs6.default.stat(r, (a, l) => {
10351
10536
  if (a) h(a);
10352
10537
  else {
10353
10538
  let c = new _t(r, { readSize: i, size: l.size });
@@ -10363,15 +10548,15 @@ var yo = (s3, t) => {
10363
10548
  let e = new kt(s3), i = true, r, n;
10364
10549
  try {
10365
10550
  try {
10366
- r = import_node_fs9.default.openSync(s3.file, "r+");
10551
+ r = import_node_fs10.default.openSync(s3.file, "r+");
10367
10552
  } catch (a) {
10368
- if (a?.code === "ENOENT") r = import_node_fs9.default.openSync(s3.file, "w+");
10553
+ if (a?.code === "ENOENT") r = import_node_fs10.default.openSync(s3.file, "w+");
10369
10554
  else throw a;
10370
10555
  }
10371
- let o = import_node_fs9.default.fstatSync(r), h = Buffer.alloc(512);
10556
+ let o = import_node_fs10.default.fstatSync(r), h = Buffer.alloc(512);
10372
10557
  t: for (n = 0; n < o.size; n += 512) {
10373
10558
  for (let c = 0, d = 0; c < 512; c += d) {
10374
- if (d = import_node_fs9.default.readSync(r, h, c, h.length - c, n + c), n === 0 && h[0] === 31 && h[1] === 139) throw new Error("cannot append to compressed archives");
10559
+ if (d = import_node_fs10.default.readSync(r, h, c, h.length - c, n + c), n === 0 && h[0] === 31 && h[1] === 139) throw new Error("cannot append to compressed archives");
10375
10560
  if (!d) break t;
10376
10561
  }
10377
10562
  let a = new F(h);
@@ -10383,7 +10568,7 @@ var yo = (s3, t) => {
10383
10568
  i = false, Ro(s3, e, n, r, t);
10384
10569
  } finally {
10385
10570
  if (i) try {
10386
- import_node_fs9.default.closeSync(r);
10571
+ import_node_fs10.default.closeSync(r);
10387
10572
  } catch {
10388
10573
  }
10389
10574
  }
@@ -10396,29 +10581,29 @@ var go = (s3, t) => {
10396
10581
  t = Array.from(t);
10397
10582
  let e = new wt(s3), i = (n, o, h) => {
10398
10583
  let a = (T, D) => {
10399
- T ? import_node_fs9.default.close(n, (E) => h(T)) : h(null, D);
10584
+ T ? import_node_fs10.default.close(n, (E) => h(T)) : h(null, D);
10400
10585
  }, l = 0;
10401
10586
  if (o === 0) return a(null, 0);
10402
10587
  let c = 0, d = Buffer.alloc(512), y = (T, D) => {
10403
10588
  if (T || D === void 0) return a(T);
10404
- if (c += D, c < 512 && D) return import_node_fs9.default.read(n, d, c, d.length - c, l + c, y);
10589
+ if (c += D, c < 512 && D) return import_node_fs10.default.read(n, d, c, d.length - c, l + c, y);
10405
10590
  if (l === 0 && d[0] === 31 && d[1] === 139) return a(new Error("cannot append to compressed archives"));
10406
10591
  if (c < 512) return a(null, l);
10407
10592
  let E = new F(d);
10408
10593
  if (!E.cksumValid) return a(null, l);
10409
10594
  let x = 512 * Math.ceil((E.size ?? 0) / 512);
10410
10595
  if (l + x + 512 > o || (l += x + 512, l >= o)) return a(null, l);
10411
- s3.mtimeCache && E.mtime && s3.mtimeCache.set(String(E.path), E.mtime), c = 0, import_node_fs9.default.read(n, d, 0, 512, l, y);
10596
+ s3.mtimeCache && E.mtime && s3.mtimeCache.set(String(E.path), E.mtime), c = 0, import_node_fs10.default.read(n, d, 0, 512, l, y);
10412
10597
  };
10413
- import_node_fs9.default.read(n, d, 0, 512, l, y);
10598
+ import_node_fs10.default.read(n, d, 0, 512, l, y);
10414
10599
  };
10415
10600
  return new Promise((n, o) => {
10416
10601
  e.on("error", o);
10417
10602
  let h = "r+", a = (l, c) => {
10418
- if (l && l.code === "ENOENT" && h === "r+") return h = "w+", import_node_fs9.default.open(s3.file, h, a);
10603
+ if (l && l.code === "ENOENT" && h === "r+") return h = "w+", import_node_fs10.default.open(s3.file, h, a);
10419
10604
  if (l || !c) return o(l);
10420
- import_node_fs9.default.fstat(c, (d, y) => {
10421
- if (d) return import_node_fs9.default.close(c, () => o(d));
10605
+ import_node_fs10.default.fstat(c, (d, y) => {
10606
+ if (d) return import_node_fs10.default.close(c, () => o(d));
10422
10607
  i(c, y.size, (T, D) => {
10423
10608
  if (T) return o(T);
10424
10609
  let E = new et(s3.file, { fd: c, start: D });
@@ -10426,16 +10611,16 @@ var go = (s3, t) => {
10426
10611
  });
10427
10612
  });
10428
10613
  };
10429
- import_node_fs9.default.open(s3.file, h, a);
10614
+ import_node_fs10.default.open(s3.file, h, a);
10430
10615
  });
10431
10616
  };
10432
10617
  var bo = (s3, t) => {
10433
10618
  t.forEach((e) => {
10434
- e.charAt(0) === "@" ? Ct({ file: import_node_path12.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
10619
+ e.charAt(0) === "@" ? Ct({ file: import_node_path13.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
10435
10620
  }), s3.end();
10436
10621
  };
10437
10622
  var _o = async (s3, t) => {
10438
- for (let e of t) e.charAt(0) === "@" ? await Ct({ file: import_node_path12.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
10623
+ for (let e of t) e.charAt(0) === "@" ? await Ct({ file: import_node_path13.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
10439
10624
  s3.end();
10440
10625
  };
10441
10626
  var vt = K(yo, go, () => {
@@ -10487,7 +10672,7 @@ async function extractRuntimePackage(archive, destination) {
10487
10672
  if (violation) throw violation;
10488
10673
  }
10489
10674
  function validateRuntimeTree(root, expected) {
10490
- const pkg = JSON.parse((0, import_node_fs10.readFileSync)((0, import_node_path13.join)(root, "package.json"), "utf8"));
10675
+ const pkg = JSON.parse((0, import_node_fs11.readFileSync)((0, import_node_path14.join)(root, "package.json"), "utf8"));
10491
10676
  if (!CLI_PACKAGE_NAMES.includes(pkg.name ?? "") || !pkg.version || !pkg.sumiBuild || !BUILD_ID_PATTERN.test(pkg.sumiBuild)) {
10492
10677
  throw new Error("\u9700\u8981\u542B\u6784\u5EFA\u8EAB\u4EFD\u7684 pnpm pack:cli \u4EA7\u7269");
10493
10678
  }
@@ -10501,20 +10686,27 @@ function validateRuntimeTree(root, expected) {
10501
10686
 
10502
10687
  // src/launcher.ts
10503
10688
  function projectRoot(scriptPath) {
10504
- return (0, import_node_path14.resolve)((0, import_node_path14.dirname)(scriptPath), "../..");
10689
+ return (0, import_node_path15.resolve)((0, import_node_path15.dirname)(scriptPath), "../..");
10505
10690
  }
10506
10691
  function readManifest(repo) {
10507
- const path = (0, import_node_path14.join)(repo, RUNTIME_MANIFEST);
10692
+ const path = (0, import_node_path15.join)(repo, RUNTIME_MANIFEST);
10508
10693
  let value;
10509
10694
  try {
10510
- value = JSON.parse((0, import_node_fs11.readFileSync)(path, "utf8"));
10695
+ value = JSON.parse((0, import_node_fs12.readFileSync)(path, "utf8"));
10511
10696
  } catch (error) {
10512
10697
  throw new Error(`\u65E0\u6CD5\u8BFB\u53D6 runtime \u6E05\u5355 ${RUNTIME_MANIFEST}\uFF1A${error.message}`);
10513
10698
  }
10514
10699
  const manifest = parseRuntimeManifest(value, repo);
10515
10700
  const configPath = configFile(repo);
10516
10701
  if (!configPath) throw new Error(`\u7F3A\u5C11\u9879\u76EE\u914D\u7F6E ${CONFIG_FILES[0]}`);
10517
- const config = (0, import_yaml.parse)((0, import_node_fs11.readFileSync)((0, import_node_path14.join)(repo, configPath), "utf8"));
10702
+ let config;
10703
+ try {
10704
+ config = loadConfig(repo);
10705
+ } catch (error) {
10706
+ if (error instanceof ProjectConfigError) return manifest;
10707
+ if (!(error instanceof RuntimeIdentityError)) throw error;
10708
+ config = error.config;
10709
+ }
10518
10710
  if (config.sumi !== manifest.version || config.sumiBuild !== manifest.build) {
10519
10711
  throw new Error(`runtime \u6E05\u5355\u4E0E ${configPath} \u4E0D\u4E00\u81F4\uFF1A${manifest.version}\uFF08${manifest.build}\uFF09`);
10520
10712
  }
@@ -10523,38 +10715,38 @@ function readManifest(repo) {
10523
10715
  function validRuntime(root, manifest) {
10524
10716
  try {
10525
10717
  validateRuntimeTree(root, { version: manifest.version, build: manifest.build });
10526
- return (0, import_node_fs11.existsSync)((0, import_node_path14.join)(root, "dist/bin.js"));
10718
+ return (0, import_node_fs12.existsSync)((0, import_node_path15.join)(root, "dist/bin.js"));
10527
10719
  } catch {
10528
10720
  return false;
10529
10721
  }
10530
10722
  }
10531
10723
  async function prepareRuntime(repo, manifest = readManifest(repo)) {
10532
- const archive = (0, import_node_path14.resolve)(repo, ...manifest.archive.split("/"));
10533
- if (!(0, import_node_fs11.existsSync)(archive)) throw new Error(`\u627E\u4E0D\u5230\u9879\u76EE Sumi \u5B89\u88C5\u5305\uFF1A${manifest.archive}`);
10724
+ const archive = (0, import_node_path15.resolve)(repo, ...manifest.archive.split("/"));
10725
+ if (!(0, import_node_fs12.existsSync)(archive)) throw new Error(`\u627E\u4E0D\u5230\u9879\u76EE Sumi \u5B89\u88C5\u5305\uFF1A${manifest.archive}`);
10534
10726
  const archiveSha = fileSha256(archive);
10535
10727
  if (archiveSha !== manifest.archiveSha256) {
10536
10728
  throw new Error(`\u9879\u76EE Sumi \u5B89\u88C5\u5305 SHA-256 \u4E0D\u5339\u914D\uFF1A\u58F0\u660E ${manifest.archiveSha256}\uFF0C\u5B9E\u9645 ${archiveSha}`);
10537
10729
  }
10538
10730
  const hex = manifest.build.slice("sha256:".length);
10539
- const runtimeRoot = (0, import_node_path14.join)(repo, ".sumi/runtime");
10540
- const final = (0, import_node_path14.join)(runtimeRoot, hex);
10731
+ const runtimeRoot = (0, import_node_path15.join)(repo, ".sumi/runtime");
10732
+ const final = (0, import_node_path15.join)(runtimeRoot, hex);
10541
10733
  if (validRuntime(final, manifest)) return final;
10542
- (0, import_node_fs11.rmSync)(final, { recursive: true, force: true });
10543
- (0, import_node_fs11.mkdirSync)(runtimeRoot, { recursive: true });
10544
- const temporary = (0, import_node_fs11.mkdtempSync)((0, import_node_path14.join)(runtimeRoot, `.tmp-${hex}-${process.pid}-${(0, import_node_crypto4.randomBytes)(3).toString("hex")}-`));
10734
+ (0, import_node_fs12.rmSync)(final, { recursive: true, force: true });
10735
+ (0, import_node_fs12.mkdirSync)(runtimeRoot, { recursive: true });
10736
+ const temporary = (0, import_node_fs12.mkdtempSync)((0, import_node_path15.join)(runtimeRoot, `.tmp-${hex}-${process.pid}-${(0, import_node_crypto4.randomBytes)(3).toString("hex")}-`));
10545
10737
  try {
10546
10738
  await extractRuntimePackage(archive, temporary);
10547
- const extracted = (0, import_node_path14.join)(temporary, "package");
10739
+ const extracted = (0, import_node_path15.join)(temporary, "package");
10548
10740
  if (!validRuntime(extracted, manifest)) throw new Error("\u89E3\u5305\u540E\u7684 Sumi runtime \u7248\u672C\u6216\u6784\u5EFA\u8EAB\u4EFD\u65E0\u6548");
10549
10741
  try {
10550
- (0, import_node_fs11.renameSync)(extracted, final);
10742
+ (0, import_node_fs12.renameSync)(extracted, final);
10551
10743
  } catch (error) {
10552
10744
  if (!validRuntime(final, manifest)) throw error;
10553
10745
  }
10554
10746
  if (!validRuntime(final, manifest)) throw new Error("Sumi runtime \u539F\u5B50\u5B89\u88C5\u540E\u6821\u9A8C\u5931\u8D25");
10555
10747
  return final;
10556
10748
  } finally {
10557
- (0, import_node_fs11.rmSync)(temporary, { recursive: true, force: true });
10749
+ (0, import_node_fs12.rmSync)(temporary, { recursive: true, force: true });
10558
10750
  }
10559
10751
  }
10560
10752
  function exitCode(code, signal) {
@@ -10565,7 +10757,7 @@ function exitCode(code, signal) {
10565
10757
  async function runLauncher(args = process.argv.slice(2), scriptPath = __filename) {
10566
10758
  const repo = projectRoot(scriptPath);
10567
10759
  const runtime = await prepareRuntime(repo);
10568
- const child = (0, import_node_child_process.spawn)(process.execPath, [(0, import_node_path14.join)(runtime, "dist/bin.js"), ...args], {
10760
+ const child = (0, import_node_child_process.spawn)(process.execPath, [(0, import_node_path15.join)(runtime, "dist/bin.js"), ...args], {
10569
10761
  cwd: process.cwd(),
10570
10762
  stdio: "inherit",
10571
10763
  windowsHide: true