@fantasticit/sumi 0.14.4 → 0.14.6

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 (398) hide show
  1. package/dist/agent-hooks.js +15 -2
  2. package/dist/agent-hooks.js.map +1 -1
  3. package/dist/agents.js +14 -9
  4. package/dist/agents.js.map +1 -1
  5. package/dist/cli.js +20 -3
  6. package/dist/cli.js.map +1 -1
  7. package/dist/codex-trust.d.ts +8 -0
  8. package/dist/codex-trust.js +27 -0
  9. package/dist/codex-trust.js.map +1 -0
  10. package/dist/codex-user-hook-entry.d.ts +1 -0
  11. package/dist/codex-user-hook-entry.js +134 -0
  12. package/dist/codex-user-hook-entry.js.map +1 -0
  13. package/dist/codex-user-hook.cjs +137 -0
  14. package/dist/codex-user-hook.d.ts +2 -0
  15. package/dist/codex-user-hook.js +85 -0
  16. package/dist/codex-user-hook.js.map +1 -0
  17. package/dist/context-providers.js +1 -3
  18. package/dist/context-providers.js.map +1 -1
  19. package/dist/context.d.ts +3 -1
  20. package/dist/context.js +16 -16
  21. package/dist/context.js.map +1 -1
  22. package/dist/doctor-wiring.d.ts +1 -6
  23. package/dist/doctor-wiring.js +4 -25
  24. package/dist/doctor-wiring.js.map +1 -1
  25. package/dist/hub/board.d.ts +85 -0
  26. package/dist/hub/board.js +261 -0
  27. package/dist/hub/board.js.map +1 -0
  28. package/dist/hub/commands.d.ts +13 -0
  29. package/dist/hub/commands.js +86 -0
  30. package/dist/hub/commands.js.map +1 -0
  31. package/dist/hub/pages.d.ts +2 -0
  32. package/dist/hub/pages.js +136 -0
  33. package/dist/hub/pages.js.map +1 -0
  34. package/dist/hub/server.d.ts +23 -0
  35. package/dist/hub/server.js +128 -0
  36. package/dist/hub/server.js.map +1 -0
  37. package/dist/hub/snapshot.d.ts +48 -0
  38. package/dist/hub/snapshot.js +132 -0
  39. package/dist/hub/snapshot.js.map +1 -0
  40. package/dist/hub/start.d.ts +13 -0
  41. package/dist/hub/start.js +59 -0
  42. package/dist/hub/start.js.map +1 -0
  43. package/dist/hub/state.d.ts +49 -0
  44. package/dist/hub/state.js +144 -0
  45. package/dist/hub/state.js.map +1 -0
  46. package/dist/index.d.ts +2 -0
  47. package/dist/index.js +2 -0
  48. package/dist/index.js.map +1 -1
  49. package/dist/instructions.js +1 -1
  50. package/dist/launcher.cjs +209 -155
  51. package/dist/run-stats.d.ts +20 -0
  52. package/dist/run-stats.js +58 -6
  53. package/dist/run-stats.js.map +1 -1
  54. package/dist/task.js +8 -2
  55. package/dist/task.js.map +1 -1
  56. package/node_modules/@sumi/create/package.json +2 -2
  57. package/node_modules/@sumi/create/template/control/flows/change.flow.yaml +1 -1
  58. package/node_modules/@sumi/create/template/control/flows/check.flow.yaml +8 -0
  59. package/node_modules/@sumi/create/template/control/flows/checkpoint.flow.yaml +8 -0
  60. package/node_modules/@sumi/create/template/control/rubrics/slice.yaml +14 -0
  61. package/node_modules/@sumi/create/template/control/rules/development.md +1 -1
  62. package/node_modules/@sumi/create/template/init/control/flows/change.flow.yaml +1 -1
  63. package/node_modules/@sumi/create/template/init/control/flows/check.flow.yaml +21 -0
  64. package/node_modules/@sumi/kernel/dist/brief.d.ts +2 -0
  65. package/node_modules/@sumi/kernel/dist/brief.js.map +1 -1
  66. package/node_modules/@sumi/kernel/dist/config.d.ts +1 -6
  67. package/node_modules/@sumi/kernel/dist/config.js +5 -16
  68. package/node_modules/@sumi/kernel/dist/config.js.map +1 -1
  69. package/node_modules/@sumi/kernel/dist/engine.js +6 -1
  70. package/node_modules/@sumi/kernel/dist/engine.js.map +1 -1
  71. package/node_modules/@sumi/kernel/dist/flow.d.ts +1 -0
  72. package/node_modules/@sumi/kernel/dist/flow.js +9 -1
  73. package/node_modules/@sumi/kernel/dist/flow.js.map +1 -1
  74. package/node_modules/@sumi/kernel/dist/plan.d.ts +2 -0
  75. package/node_modules/@sumi/kernel/dist/plan.js +8 -1
  76. package/node_modules/@sumi/kernel/dist/plan.js.map +1 -1
  77. package/node_modules/@sumi/kernel/dist/registry.d.ts +2 -3
  78. package/node_modules/@sumi/kernel/dist/registry.js +5 -6
  79. package/node_modules/@sumi/kernel/dist/registry.js.map +1 -1
  80. package/node_modules/@sumi/kernel/dist/runner.js +1 -1
  81. package/node_modules/@sumi/kernel/dist/runner.js.map +1 -1
  82. package/node_modules/@sumi/kernel/dist/runtime.d.ts +11 -0
  83. package/node_modules/@sumi/kernel/dist/runtime.js +34 -2
  84. package/node_modules/@sumi/kernel/dist/runtime.js.map +1 -1
  85. package/node_modules/@sumi/kernel/dist/step-cache.js +1 -0
  86. package/node_modules/@sumi/kernel/dist/step-cache.js.map +1 -1
  87. package/node_modules/@sumi/kernel/dist/step.d.ts +1 -0
  88. package/node_modules/@sumi/kernel/dist/step.js +1 -0
  89. package/node_modules/@sumi/kernel/dist/step.js.map +1 -1
  90. package/node_modules/@sumi/kernel/package.json +2 -2
  91. package/node_modules/@sumi/plugin-sdk/README.md +8 -0
  92. package/node_modules/@sumi/plugin-sdk/dist/context-delivery.d.ts +11 -6
  93. package/node_modules/@sumi/plugin-sdk/dist/context-delivery.js +35 -3
  94. package/node_modules/@sumi/plugin-sdk/dist/context-delivery.js.map +1 -1
  95. package/node_modules/@sumi/plugin-sdk/dist/edit-paths.d.ts +2 -0
  96. package/node_modules/@sumi/plugin-sdk/dist/edit-paths.js +29 -23
  97. package/node_modules/@sumi/plugin-sdk/dist/edit-paths.js.map +1 -1
  98. package/node_modules/@sumi/plugin-sdk/dist/env.d.ts +2 -0
  99. package/node_modules/@sumi/plugin-sdk/dist/env.js +7 -0
  100. package/node_modules/@sumi/plugin-sdk/dist/env.js.map +1 -1
  101. package/node_modules/@sumi/plugin-sdk/dist/git.d.ts +8 -0
  102. package/node_modules/@sumi/plugin-sdk/dist/git.js +38 -0
  103. package/node_modules/@sumi/plugin-sdk/dist/git.js.map +1 -1
  104. package/node_modules/@sumi/plugin-sdk/dist/html-page.d.ts +10 -2
  105. package/node_modules/@sumi/plugin-sdk/dist/html-page.js +14 -5
  106. package/node_modules/@sumi/plugin-sdk/dist/html-page.js.map +1 -1
  107. package/node_modules/@sumi/plugin-sdk/dist/hub.d.ts +31 -0
  108. package/node_modules/@sumi/plugin-sdk/dist/hub.js +32 -0
  109. package/node_modules/@sumi/plugin-sdk/dist/hub.js.map +1 -0
  110. package/node_modules/@sumi/plugin-sdk/dist/import-graph.d.ts +22 -0
  111. package/node_modules/@sumi/plugin-sdk/dist/import-graph.js +118 -0
  112. package/node_modules/@sumi/plugin-sdk/dist/import-graph.js.map +1 -0
  113. package/node_modules/@sumi/plugin-sdk/dist/index.d.ts +3 -0
  114. package/node_modules/@sumi/plugin-sdk/dist/index.js +3 -0
  115. package/node_modules/@sumi/plugin-sdk/dist/index.js.map +1 -1
  116. package/node_modules/@sumi/plugin-sdk/dist/permissions.d.ts +2 -0
  117. package/node_modules/@sumi/plugin-sdk/dist/permissions.js +12 -1
  118. package/node_modules/@sumi/plugin-sdk/dist/permissions.js.map +1 -1
  119. package/node_modules/@sumi/plugin-sdk/dist/protocol.d.ts +4 -0
  120. package/node_modules/@sumi/plugin-sdk/dist/protocol.js.map +1 -1
  121. package/node_modules/@sumi/plugin-sdk/dist/scenario-selection.d.ts +20 -0
  122. package/node_modules/@sumi/plugin-sdk/dist/scenario-selection.js +18 -0
  123. package/node_modules/@sumi/plugin-sdk/dist/scenario-selection.js.map +1 -0
  124. package/node_modules/@sumi/plugin-sdk/dist/session-context.d.ts +2 -2
  125. package/node_modules/@sumi/plugin-sdk/dist/session-context.js +10 -7
  126. package/node_modules/@sumi/plugin-sdk/dist/session-context.js.map +1 -1
  127. package/node_modules/@sumi/plugin-sdk/dist/session-env.d.ts +2 -0
  128. package/node_modules/@sumi/plugin-sdk/dist/session-env.js +3 -0
  129. package/node_modules/@sumi/plugin-sdk/dist/session-env.js.map +1 -0
  130. package/node_modules/@sumi/plugin-sdk/dist/shell.d.ts +11 -5
  131. package/node_modules/@sumi/plugin-sdk/dist/shell.js +132 -23
  132. package/node_modules/@sumi/plugin-sdk/dist/shell.js.map +1 -1
  133. package/node_modules/@sumi/plugin-sdk/dist/validate.js +5 -0
  134. package/node_modules/@sumi/plugin-sdk/dist/validate.js.map +1 -1
  135. package/node_modules/@sumi/plugin-sdk/package.json +1 -1
  136. package/node_modules/@sumi/plugins-core/dist/agent-rules.js +20 -5
  137. package/node_modules/@sumi/plugins-core/dist/agent-rules.js.map +1 -1
  138. package/node_modules/@sumi/plugins-core/dist/change-impact.js +1 -13
  139. package/node_modules/@sumi/plugins-core/dist/change-impact.js.map +1 -1
  140. package/node_modules/@sumi/plugins-core/dist/commands/agent-rules-subagent-context.d.ts +1 -0
  141. package/node_modules/@sumi/plugins-core/dist/commands/agent-rules-subagent-context.js +10 -0
  142. package/node_modules/@sumi/plugins-core/dist/commands/agent-rules-subagent-context.js.map +1 -0
  143. package/node_modules/@sumi/plugins-core/dist/commands/context-impact.js +1 -3
  144. package/node_modules/@sumi/plugins-core/dist/commands/context-impact.js.map +1 -1
  145. package/node_modules/@sumi/plugins-core/dist/plugins/test-affected.js +26 -7
  146. package/node_modules/@sumi/plugins-core/dist/plugins/test-affected.js.map +1 -1
  147. package/node_modules/@sumi/plugins-core/dist/test-scope.d.ts +3 -1
  148. package/node_modules/@sumi/plugins-core/dist/test-scope.js +14 -3
  149. package/node_modules/@sumi/plugins-core/dist/test-scope.js.map +1 -1
  150. package/node_modules/@sumi/plugins-core/dist/vitest-runner.js +16 -0
  151. package/node_modules/@sumi/plugins-core/dist/vitest-runner.js.map +1 -1
  152. package/node_modules/@sumi/plugins-core/instructions/bugfix.md +1 -1
  153. package/node_modules/@sumi/plugins-core/instructions/feature.md +1 -1
  154. package/node_modules/@sumi/plugins-core/package.json +2 -2
  155. package/node_modules/@sumi/plugins-core/sumi-plugins.yaml +6 -0
  156. package/node_modules/@sumi/plugins-governance/README.md +16 -1
  157. package/node_modules/@sumi/plugins-governance/dist/boundary-answer-page.d.ts +3 -0
  158. package/node_modules/@sumi/plugins-governance/dist/boundary-answer-page.js +76 -0
  159. package/node_modules/@sumi/plugins-governance/dist/boundary-answer-page.js.map +1 -0
  160. package/node_modules/@sumi/plugins-governance/dist/boundary-browser.d.ts +6 -0
  161. package/node_modules/@sumi/plugins-governance/dist/boundary-browser.js +121 -0
  162. package/node_modules/@sumi/plugins-governance/dist/boundary-browser.js.map +1 -0
  163. package/node_modules/@sumi/plugins-governance/dist/boundary-form.d.ts +18 -0
  164. package/node_modules/@sumi/plugins-governance/dist/boundary-form.js +97 -0
  165. package/node_modules/@sumi/plugins-governance/dist/boundary-form.js.map +1 -0
  166. package/node_modules/@sumi/plugins-governance/dist/boundary-mcp.d.ts +1 -0
  167. package/node_modules/@sumi/plugins-governance/dist/boundary-mcp.js +179 -0
  168. package/node_modules/@sumi/plugins-governance/dist/boundary-mcp.js.map +1 -0
  169. package/node_modules/@sumi/plugins-governance/dist/boundary.d.ts +10 -0
  170. package/node_modules/@sumi/plugins-governance/dist/boundary.js +136 -30
  171. package/node_modules/@sumi/plugins-governance/dist/boundary.js.map +1 -1
  172. package/node_modules/@sumi/plugins-governance/dist/branch-scope.d.ts +9 -0
  173. package/node_modules/@sumi/plugins-governance/dist/branch-scope.js +64 -0
  174. package/node_modules/@sumi/plugins-governance/dist/branch-scope.js.map +1 -0
  175. package/node_modules/@sumi/plugins-governance/dist/checkout.d.ts +2 -0
  176. package/node_modules/@sumi/plugins-governance/dist/checkout.js +13 -3
  177. package/node_modules/@sumi/plugins-governance/dist/checkout.js.map +1 -1
  178. package/node_modules/@sumi/plugins-governance/dist/commands/boundary.js +59 -9
  179. package/node_modules/@sumi/plugins-governance/dist/commands/boundary.js.map +1 -1
  180. package/node_modules/@sumi/plugins-governance/dist/commands/gate.js +16 -14
  181. package/node_modules/@sumi/plugins-governance/dist/commands/gate.js.map +1 -1
  182. package/node_modules/@sumi/plugins-governance/dist/commands/hub-snapshot.d.ts +1 -0
  183. package/node_modules/@sumi/plugins-governance/dist/commands/hub-snapshot.js +4 -0
  184. package/node_modules/@sumi/plugins-governance/dist/commands/hub-snapshot.js.map +1 -0
  185. package/node_modules/@sumi/plugins-governance/dist/commands/pr-report.js +7 -1
  186. package/node_modules/@sumi/plugins-governance/dist/commands/pr-report.js.map +1 -1
  187. package/node_modules/@sumi/plugins-governance/dist/commands/run-policy.js +1 -3
  188. package/node_modules/@sumi/plugins-governance/dist/commands/run-policy.js.map +1 -1
  189. package/node_modules/@sumi/plugins-governance/dist/extensions.d.ts +2 -0
  190. package/node_modules/@sumi/plugins-governance/dist/extensions.js +32 -0
  191. package/node_modules/@sumi/plugins-governance/dist/extensions.js.map +1 -0
  192. package/node_modules/@sumi/plugins-governance/dist/gate-cache.d.ts +2 -1
  193. package/node_modules/@sumi/plugins-governance/dist/gate-cache.js +11 -2
  194. package/node_modules/@sumi/plugins-governance/dist/gate-cache.js.map +1 -1
  195. package/node_modules/@sumi/plugins-governance/dist/guard.js +147 -19
  196. package/node_modules/@sumi/plugins-governance/dist/guard.js.map +1 -1
  197. package/node_modules/@sumi/plugins-governance/dist/hub-snapshot.d.ts +3 -0
  198. package/node_modules/@sumi/plugins-governance/dist/hub-snapshot.js +40 -0
  199. package/node_modules/@sumi/plugins-governance/dist/hub-snapshot.js.map +1 -0
  200. package/node_modules/@sumi/plugins-governance/dist/index.d.ts +3 -1
  201. package/node_modules/@sumi/plugins-governance/dist/index.js +3 -1
  202. package/node_modules/@sumi/plugins-governance/dist/index.js.map +1 -1
  203. package/node_modules/@sumi/plugins-governance/dist/plugins/size-budget.d.ts +1 -0
  204. package/node_modules/@sumi/plugins-governance/dist/plugins/size-budget.js +4 -0
  205. package/node_modules/@sumi/plugins-governance/dist/plugins/size-budget.js.map +1 -0
  206. package/node_modules/@sumi/plugins-governance/dist/pr-base.js +21 -1
  207. package/node_modules/@sumi/plugins-governance/dist/pr-base.js.map +1 -1
  208. package/node_modules/@sumi/plugins-governance/dist/pr-report-compose.js +25 -12
  209. package/node_modules/@sumi/plugins-governance/dist/pr-report-compose.js.map +1 -1
  210. package/node_modules/@sumi/plugins-governance/dist/pr-report-markers.d.ts +2 -0
  211. package/node_modules/@sumi/plugins-governance/dist/pr-report-markers.js +2 -0
  212. package/node_modules/@sumi/plugins-governance/dist/pr-report-markers.js.map +1 -1
  213. package/node_modules/@sumi/plugins-governance/dist/pr-report-sections.js +34 -4
  214. package/node_modules/@sumi/plugins-governance/dist/pr-report-sections.js.map +1 -1
  215. package/node_modules/@sumi/plugins-governance/dist/preflight.d.ts +1 -0
  216. package/node_modules/@sumi/plugins-governance/dist/preflight.js +2 -2
  217. package/node_modules/@sumi/plugins-governance/dist/preflight.js.map +1 -1
  218. package/node_modules/@sumi/plugins-governance/dist/protected.d.ts +2 -0
  219. package/node_modules/@sumi/plugins-governance/dist/protected.js +4 -0
  220. package/node_modules/@sumi/plugins-governance/dist/protected.js.map +1 -1
  221. package/node_modules/@sumi/plugins-governance/dist/size-budget.d.ts +2 -0
  222. package/node_modules/@sumi/plugins-governance/dist/size-budget.js +73 -0
  223. package/node_modules/@sumi/plugins-governance/dist/size-budget.js.map +1 -0
  224. package/node_modules/@sumi/plugins-governance/dist/upgrade-command.js +12 -5
  225. package/node_modules/@sumi/plugins-governance/dist/upgrade-command.js.map +1 -1
  226. package/node_modules/@sumi/plugins-governance/dist/view-page.d.ts +1 -0
  227. package/node_modules/@sumi/plugins-governance/dist/view-page.js +19 -18
  228. package/node_modules/@sumi/plugins-governance/dist/view-page.js.map +1 -1
  229. package/node_modules/@sumi/plugins-governance/instructions/boundary.md +18 -2
  230. package/node_modules/@sumi/plugins-governance/package.json +4 -4
  231. package/node_modules/@sumi/plugins-governance/sumi-plugins.yaml +12 -0
  232. package/node_modules/@sumi/plugins-openspec/README.md +36 -12
  233. package/node_modules/@sumi/plugins-openspec/dist/checkpoint-hook.d.ts +4 -0
  234. package/node_modules/@sumi/plugins-openspec/dist/checkpoint-hook.js +34 -0
  235. package/node_modules/@sumi/plugins-openspec/dist/checkpoint-hook.js.map +1 -0
  236. package/node_modules/@sumi/plugins-openspec/dist/commands/checkpoint-after-edit.d.ts +1 -0
  237. package/node_modules/@sumi/plugins-openspec/dist/commands/checkpoint-after-edit.js +9 -0
  238. package/node_modules/@sumi/plugins-openspec/dist/commands/checkpoint-after-edit.js.map +1 -0
  239. package/node_modules/@sumi/plugins-openspec/dist/commands/hub-snapshot.d.ts +1 -0
  240. package/node_modules/@sumi/plugins-openspec/dist/commands/hub-snapshot.js +4 -0
  241. package/node_modules/@sumi/plugins-openspec/dist/commands/hub-snapshot.js.map +1 -0
  242. package/node_modules/@sumi/plugins-openspec/dist/commands/pr-dependencies.d.ts +1 -0
  243. package/node_modules/@sumi/plugins-openspec/dist/commands/pr-dependencies.js +10 -0
  244. package/node_modules/@sumi/plugins-openspec/dist/commands/pr-dependencies.js.map +1 -0
  245. package/node_modules/@sumi/plugins-openspec/dist/commands/size-groups.d.ts +1 -0
  246. package/node_modules/@sumi/plugins-openspec/dist/commands/size-groups.js +12 -0
  247. package/node_modules/@sumi/plugins-openspec/dist/commands/size-groups.js.map +1 -0
  248. package/node_modules/@sumi/plugins-openspec/dist/commands/slice-record.d.ts +1 -0
  249. package/node_modules/@sumi/plugins-openspec/dist/commands/slice-record.js +28 -0
  250. package/node_modules/@sumi/plugins-openspec/dist/commands/slice-record.js.map +1 -0
  251. package/node_modules/@sumi/plugins-openspec/dist/hub-snapshot.d.ts +4 -0
  252. package/node_modules/@sumi/plugins-openspec/dist/hub-snapshot.js +34 -0
  253. package/node_modules/@sumi/plugins-openspec/dist/hub-snapshot.js.map +1 -0
  254. package/node_modules/@sumi/plugins-openspec/dist/index.d.ts +4 -0
  255. package/node_modules/@sumi/plugins-openspec/dist/index.js +4 -0
  256. package/node_modules/@sumi/plugins-openspec/dist/index.js.map +1 -1
  257. package/node_modules/@sumi/plugins-openspec/dist/plugins/change-tasks.js +7 -2
  258. package/node_modules/@sumi/plugins-openspec/dist/plugins/change-tasks.js.map +1 -1
  259. package/node_modules/@sumi/plugins-openspec/dist/plugins/impact-consistency.js +2 -0
  260. package/node_modules/@sumi/plugins-openspec/dist/plugins/impact-consistency.js.map +1 -1
  261. package/node_modules/@sumi/plugins-openspec/dist/plugins/planner.js +35 -0
  262. package/node_modules/@sumi/plugins-openspec/dist/plugins/planner.js.map +1 -1
  263. package/node_modules/@sumi/plugins-openspec/dist/slice-check.d.ts +3 -0
  264. package/node_modules/@sumi/plugins-openspec/dist/slice-check.js +13 -0
  265. package/node_modules/@sumi/plugins-openspec/dist/slice-check.js.map +1 -0
  266. package/node_modules/@sumi/plugins-openspec/dist/slice-ledger.d.ts +19 -0
  267. package/node_modules/@sumi/plugins-openspec/dist/slice-ledger.js +179 -0
  268. package/node_modules/@sumi/plugins-openspec/dist/slice-ledger.js.map +1 -0
  269. package/node_modules/@sumi/plugins-openspec/dist/slice.d.ts +2 -0
  270. package/node_modules/@sumi/plugins-openspec/dist/slice.js +134 -0
  271. package/node_modules/@sumi/plugins-openspec/dist/slice.js.map +1 -0
  272. package/node_modules/@sumi/plugins-openspec/dist/task-groups.d.ts +12 -0
  273. package/node_modules/@sumi/plugins-openspec/dist/task-groups.js +21 -0
  274. package/node_modules/@sumi/plugins-openspec/dist/task-groups.js.map +1 -0
  275. package/node_modules/@sumi/plugins-openspec/dist/upgrade-command.d.ts +1 -0
  276. package/node_modules/@sumi/plugins-openspec/dist/upgrade-command.js +7 -0
  277. package/node_modules/@sumi/plugins-openspec/dist/upgrade-command.js.map +1 -0
  278. package/node_modules/@sumi/plugins-openspec/package.json +8 -4
  279. package/node_modules/@sumi/plugins-openspec/sumi-plugins.yaml +30 -0
  280. package/node_modules/@sumi/plugins-precedent/dist/after-edit-context.js +10 -11
  281. package/node_modules/@sumi/plugins-precedent/dist/after-edit-context.js.map +1 -1
  282. package/node_modules/@sumi/plugins-precedent/dist/candidates.d.ts +9 -3
  283. package/node_modules/@sumi/plugins-precedent/dist/candidates.js +12 -6
  284. package/node_modules/@sumi/plugins-precedent/dist/candidates.js.map +1 -1
  285. package/node_modules/@sumi/plugins-precedent/dist/commands/promote.js +20 -5
  286. package/node_modules/@sumi/plugins-precedent/dist/commands/promote.js.map +1 -1
  287. package/node_modules/@sumi/plugins-precedent/dist/context-output.d.ts +15 -8
  288. package/node_modules/@sumi/plugins-precedent/dist/context-output.js +93 -34
  289. package/node_modules/@sumi/plugins-precedent/dist/context-output.js.map +1 -1
  290. package/node_modules/@sumi/plugins-precedent/dist/context-provider.js +7 -3
  291. package/node_modules/@sumi/plugins-precedent/dist/context-provider.js.map +1 -1
  292. package/node_modules/@sumi/plugins-precedent/dist/impact-state.d.ts +2 -1
  293. package/node_modules/@sumi/plugins-precedent/dist/impact-state.js +5 -4
  294. package/node_modules/@sumi/plugins-precedent/dist/impact-state.js.map +1 -1
  295. package/node_modules/@sumi/plugins-precedent/dist/impact.d.ts +7 -6
  296. package/node_modules/@sumi/plugins-precedent/dist/impact.js +33 -29
  297. package/node_modules/@sumi/plugins-precedent/dist/impact.js.map +1 -1
  298. package/node_modules/@sumi/plugins-precedent/dist/matching.d.ts +12 -0
  299. package/node_modules/@sumi/plugins-precedent/dist/matching.js +90 -0
  300. package/node_modules/@sumi/plugins-precedent/dist/matching.js.map +1 -0
  301. package/node_modules/@sumi/plugins-precedent/dist/plugins/harvest.js +44 -13
  302. package/node_modules/@sumi/plugins-precedent/dist/plugins/harvest.js.map +1 -1
  303. package/node_modules/@sumi/plugins-precedent/dist/plugins/impact.js +15 -10
  304. package/node_modules/@sumi/plugins-precedent/dist/plugins/impact.js.map +1 -1
  305. package/node_modules/@sumi/plugins-precedent/dist/plugins/planner.js +47 -6
  306. package/node_modules/@sumi/plugins-precedent/dist/plugins/planner.js.map +1 -1
  307. package/node_modules/@sumi/plugins-precedent/dist/review-candidates.d.ts +3 -0
  308. package/node_modules/@sumi/plugins-precedent/dist/review-candidates.js +40 -0
  309. package/node_modules/@sumi/plugins-precedent/dist/review-candidates.js.map +1 -0
  310. package/node_modules/@sumi/plugins-precedent/package.json +3 -3
  311. package/node_modules/@sumi/plugins-review/README.md +8 -0
  312. package/node_modules/@sumi/plugins-review/dist/batch-request.d.ts +4 -0
  313. package/node_modules/@sumi/plugins-review/dist/batch-request.js.map +1 -1
  314. package/node_modules/@sumi/plugins-review/dist/checkpoint.d.ts +6 -0
  315. package/node_modules/@sumi/plugins-review/dist/checkpoint.js +76 -0
  316. package/node_modules/@sumi/plugins-review/dist/checkpoint.js.map +1 -0
  317. package/node_modules/@sumi/plugins-review/dist/command-input.d.ts +1 -1
  318. package/node_modules/@sumi/plugins-review/dist/command-input.js +4 -4
  319. package/node_modules/@sumi/plugins-review/dist/command-input.js.map +1 -1
  320. package/node_modules/@sumi/plugins-review/dist/commands/preflight.js +0 -2
  321. package/node_modules/@sumi/plugins-review/dist/commands/preflight.js.map +1 -1
  322. package/node_modules/@sumi/plugins-review/dist/commands/stats.js +3 -3
  323. package/node_modules/@sumi/plugins-review/dist/commands/stats.js.map +1 -1
  324. package/node_modules/@sumi/plugins-review/dist/commands/submit.js +20 -6
  325. package/node_modules/@sumi/plugins-review/dist/commands/submit.js.map +1 -1
  326. package/node_modules/@sumi/plugins-review/dist/convergence.d.ts +7 -2
  327. package/node_modules/@sumi/plugins-review/dist/convergence.js +43 -5
  328. package/node_modules/@sumi/plugins-review/dist/convergence.js.map +1 -1
  329. package/node_modules/@sumi/plugins-review/dist/dispatch.d.ts +1 -0
  330. package/node_modules/@sumi/plugins-review/dist/dispatch.js +21 -12
  331. package/node_modules/@sumi/plugins-review/dist/dispatch.js.map +1 -1
  332. package/node_modules/@sumi/plugins-review/dist/plugins/checkpoint-save.d.ts +1 -0
  333. package/node_modules/@sumi/plugins-review/dist/plugins/checkpoint-save.js +4 -0
  334. package/node_modules/@sumi/plugins-review/dist/plugins/checkpoint-save.js.map +1 -0
  335. package/node_modules/@sumi/plugins-review/dist/plugins/checkpoint.d.ts +1 -0
  336. package/node_modules/@sumi/plugins-review/dist/plugins/checkpoint.js +4 -0
  337. package/node_modules/@sumi/plugins-review/dist/plugins/checkpoint.js.map +1 -0
  338. package/node_modules/@sumi/plugins-review/dist/plugins/dispatch.js +15 -3
  339. package/node_modules/@sumi/plugins-review/dist/plugins/dispatch.js.map +1 -1
  340. package/node_modules/@sumi/plugins-review/dist/plugins/independent-recheck.js +1 -1
  341. package/node_modules/@sumi/plugins-review/dist/plugins/independent-recheck.js.map +1 -1
  342. package/node_modules/@sumi/plugins-review/dist/plugins/validation.js +2 -1
  343. package/node_modules/@sumi/plugins-review/dist/plugins/validation.js.map +1 -1
  344. package/node_modules/@sumi/plugins-review/dist/precedent-context.d.ts +7 -0
  345. package/node_modules/@sumi/plugins-review/dist/precedent-context.js +28 -0
  346. package/node_modules/@sumi/plugins-review/dist/precedent-context.js.map +1 -0
  347. package/node_modules/@sumi/plugins-review/dist/preflight.d.ts +1 -0
  348. package/node_modules/@sumi/plugins-review/dist/preflight.js +32 -24
  349. package/node_modules/@sumi/plugins-review/dist/preflight.js.map +1 -1
  350. package/node_modules/@sumi/plugins-review/dist/report.d.ts +9 -0
  351. package/node_modules/@sumi/plugins-review/dist/report.js +28 -7
  352. package/node_modules/@sumi/plugins-review/dist/report.js.map +1 -1
  353. package/node_modules/@sumi/plugins-review/dist/resolved-blockers.d.ts +9 -0
  354. package/node_modules/@sumi/plugins-review/dist/resolved-blockers.js +50 -0
  355. package/node_modules/@sumi/plugins-review/dist/resolved-blockers.js.map +1 -0
  356. package/node_modules/@sumi/plugins-review/dist/review-evidence.d.ts +2 -2
  357. package/node_modules/@sumi/plugins-review/dist/review-evidence.js +24 -12
  358. package/node_modules/@sumi/plugins-review/dist/review-evidence.js.map +1 -1
  359. package/node_modules/@sumi/plugins-review/dist/review-scope.d.ts +1 -0
  360. package/node_modules/@sumi/plugins-review/dist/review-scope.js +2 -0
  361. package/node_modules/@sumi/plugins-review/dist/review-scope.js.map +1 -0
  362. package/node_modules/@sumi/plugins-review/dist/review-slices.d.ts +13 -0
  363. package/node_modules/@sumi/plugins-review/dist/review-slices.js +60 -0
  364. package/node_modules/@sumi/plugins-review/dist/review-slices.js.map +1 -0
  365. package/node_modules/@sumi/plugins-review/dist/review.d.ts +103 -24
  366. package/node_modules/@sumi/plugins-review/dist/review.js +439 -84
  367. package/node_modules/@sumi/plugins-review/dist/review.js.map +1 -1
  368. package/node_modules/@sumi/plugins-review/dist/rubric-check.d.ts +3 -1
  369. package/node_modules/@sumi/plugins-review/dist/rubric-check.js +232 -72
  370. package/node_modules/@sumi/plugins-review/dist/rubric-check.js.map +1 -1
  371. package/node_modules/@sumi/plugins-review/dist/startup-context.js +3 -2
  372. package/node_modules/@sumi/plugins-review/dist/startup-context.js.map +1 -1
  373. package/node_modules/@sumi/plugins-review/dist/stats.d.ts +1 -0
  374. package/node_modules/@sumi/plugins-review/dist/stats.js +11 -15
  375. package/node_modules/@sumi/plugins-review/dist/stats.js.map +1 -1
  376. package/node_modules/@sumi/plugins-review/dist/submission.js +92 -42
  377. package/node_modules/@sumi/plugins-review/dist/submission.js.map +1 -1
  378. package/node_modules/@sumi/plugins-review/dist/submit-continuation.d.ts +2 -0
  379. package/node_modules/@sumi/plugins-review/dist/submit-continuation.js +143 -0
  380. package/node_modules/@sumi/plugins-review/dist/submit-continuation.js.map +1 -0
  381. package/node_modules/@sumi/plugins-review/dist/submit-files.d.ts +3 -0
  382. package/node_modules/@sumi/plugins-review/dist/submit-files.js +55 -0
  383. package/node_modules/@sumi/plugins-review/dist/submit-files.js.map +1 -0
  384. package/node_modules/@sumi/plugins-review/dist/support-scope.d.ts +2 -0
  385. package/node_modules/@sumi/plugins-review/dist/support-scope.js +15 -0
  386. package/node_modules/@sumi/plugins-review/dist/support-scope.js.map +1 -1
  387. package/node_modules/@sumi/plugins-review/dist/tickets.d.ts +2 -0
  388. package/node_modules/@sumi/plugins-review/dist/tickets.js +41 -3
  389. package/node_modules/@sumi/plugins-review/dist/tickets.js.map +1 -1
  390. package/node_modules/@sumi/plugins-review/dist/upgrade-flow-plan.js +27 -0
  391. package/node_modules/@sumi/plugins-review/dist/upgrade-flow-plan.js.map +1 -1
  392. package/node_modules/@sumi/plugins-review/dist/upgrade.js +10 -1
  393. package/node_modules/@sumi/plugins-review/dist/upgrade.js.map +1 -1
  394. package/node_modules/@sumi/plugins-review/dist/validation-receipt.js +4 -2
  395. package/node_modules/@sumi/plugins-review/dist/validation-receipt.js.map +1 -1
  396. package/node_modules/@sumi/plugins-review/package.json +6 -6
  397. package/node_modules/@sumi/plugins-review/sumi-plugins.yaml +12 -0
  398. package/package.json +10 -10
package/dist/launcher.cjs CHANGED
@@ -7364,8 +7364,8 @@ var require_dist = __commonJS({
7364
7364
  // src/launcher.ts
7365
7365
  var import_node_child_process = require("node:child_process");
7366
7366
  var import_node_crypto4 = require("node:crypto");
7367
- var import_node_fs12 = require("node:fs");
7368
- var import_node_path15 = require("node:path");
7367
+ var import_node_fs13 = require("node:fs");
7368
+ var import_node_path16 = require("node:path");
7369
7369
 
7370
7370
  // ../plugin-sdk/dist/project.js
7371
7371
  var import_node_fs = require("node:fs");
@@ -7414,8 +7414,8 @@ function satisfies(version, range) {
7414
7414
  }
7415
7415
 
7416
7416
  // ../kernel/dist/config.js
7417
- var import_node_fs2 = require("node:fs");
7418
- var import_node_path2 = require("node:path");
7417
+ var import_node_fs3 = require("node:fs");
7418
+ var import_node_path3 = require("node:path");
7419
7419
  var import_yaml = __toESM(require_dist(), 1);
7420
7420
 
7421
7421
  // ../kernel/dist/errors.js
@@ -7427,10 +7427,61 @@ var KernelError = class extends Error {
7427
7427
  }
7428
7428
  };
7429
7429
 
7430
- // ../kernel/dist/config.js
7431
- var CONFIG_FILE = CONFIG_FILES[0];
7430
+ // ../kernel/dist/runtime.js
7431
+ var import_node_fs2 = require("node:fs");
7432
+ var import_node_path2 = require("node:path");
7433
+ var initialized = false;
7432
7434
  var cliVersion;
7433
7435
  var cliBuild;
7436
+ function setCliVersion(version) {
7437
+ cliVersion = version;
7438
+ initialized = true;
7439
+ }
7440
+ function getCliVersion() {
7441
+ return cliVersion;
7442
+ }
7443
+ function setCliBuild(build) {
7444
+ cliBuild = build;
7445
+ initialized = true;
7446
+ }
7447
+ function getCliBuild() {
7448
+ return cliBuild;
7449
+ }
7450
+ var builtinRoots = [];
7451
+ function setBuiltinRoots(roots) {
7452
+ builtinRoots = roots;
7453
+ initialized = true;
7454
+ }
7455
+ function ensureRuntime() {
7456
+ if (!initialized && process.env.SUMI_BIN)
7457
+ initializeRuntime(process.env.SUMI_BIN);
7458
+ }
7459
+ function initializeRuntime(entry) {
7460
+ if (!(0, import_node_path2.isAbsolute)(entry))
7461
+ throw new KernelError("\u8FD0\u884C\u5165\u53E3\u5FC5\u987B\u4E3A\u7EDD\u5BF9\u8DEF\u5F84");
7462
+ const root = (0, import_node_path2.dirname)((0, import_node_path2.dirname)(entry));
7463
+ let value;
7464
+ try {
7465
+ value = JSON.parse((0, import_node_fs2.readFileSync)((0, import_node_path2.join)(root, "package.json"), "utf8"));
7466
+ } catch (error) {
7467
+ throw new KernelError(`\u65E0\u6CD5\u8BFB\u53D6\u8FD0\u884C\u5165\u53E3\u6E05\u5355\uFF1A${error.message}`);
7468
+ }
7469
+ if (typeof value !== "object" || value === null || Array.isArray(value))
7470
+ throw new KernelError("\u8FD0\u884C\u5165\u53E3\u6E05\u5355\u5FC5\u987B\u662F\u5BF9\u8C61");
7471
+ const manifest = value;
7472
+ if (typeof manifest.version !== "string" || !manifest.version.trim())
7473
+ throw new KernelError("\u8FD0\u884C\u5165\u53E3\u6E05\u5355\u7F3A\u5C11\u7248\u672C");
7474
+ const build = manifest.sumiBuild;
7475
+ if (build !== void 0 && (typeof build !== "string" || !/^sha256:[a-f0-9]{64}$/.test(build)))
7476
+ throw new KernelError("\u8FD0\u884C\u5165\u53E3\u6E05\u5355\u7684\u6784\u5EFA\u8EAB\u4EFD\u65E0\u6548");
7477
+ setBuiltinRoots([root]);
7478
+ setCliVersion(manifest.version);
7479
+ setCliBuild(build);
7480
+ initialized = true;
7481
+ }
7482
+
7483
+ // ../kernel/dist/config.js
7484
+ var CONFIG_FILE = CONFIG_FILES[0];
7434
7485
  var identityHint = "\u8BF7\u4ECE\u9879\u76EE\u58F0\u660E\u7684 CLI \u5165\u53E3\u91CD\u65B0\u542F\u52A8";
7435
7486
  var DEFAULTS = {
7436
7487
  tiers: ["delta", "runtime", "full"],
@@ -7471,8 +7522,8 @@ var ProjectConfigError = class extends KernelError {
7471
7522
  function readProjectConfig(root) {
7472
7523
  const file = configFile(root);
7473
7524
  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");
7525
+ throw new KernelError(`\u7F3A\u5C11\u9879\u76EE\u914D\u7F6E\uFF1A${(0, import_node_path3.join)(root, CONFIG_FILE)}\uFF08\u6216\u65E7\u4F4D\u7F6E ${(0, import_node_path3.join)(root, CONFIG_FILES[1])}\uFF09`);
7526
+ const source = (0, import_node_fs3.readFileSync)((0, import_node_path3.join)(root, file), "utf8");
7476
7527
  const lines = new import_yaml.LineCounter();
7477
7528
  const document = (0, import_yaml.parseDocument)(source, { lineCounter: lines });
7478
7529
  const error = document.errors[0];
@@ -7495,6 +7546,7 @@ function readProjectConfig(root) {
7495
7546
  return { file, raw, lineFor };
7496
7547
  }
7497
7548
  function loadConfig(root) {
7549
+ ensureRuntime();
7498
7550
  const { file, raw, lineFor } = readProjectConfig(root);
7499
7551
  const config = { ...DEFAULTS, ...raw };
7500
7552
  config.brief = { ...DEFAULTS.brief, ...raw.brief };
@@ -7554,11 +7606,13 @@ function loadConfig(root) {
7554
7606
  const reason = errors[0];
7555
7607
  throw new ProjectConfigError(file, reason, lineFor(reason.split(" ")[0]));
7556
7608
  }
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);
7609
+ const cliVersion2 = getCliVersion();
7610
+ const cliBuild2 = getCliBuild();
7611
+ if (config.sumi && cliVersion2 && !satisfies(cliVersion2, config.sumi)) {
7612
+ throw new RuntimeIdentityError(`\u5F53\u524D sumi ${cliVersion2} \u4E0D\u6EE1\u8DB3\u9879\u76EE\u8981\u6C42\u7684 ${config.sumi}\uFF0C${identityHint}`, config);
7559
7613
  }
7560
- if (config.sumiBuild && config.sumiBuild !== cliBuild) {
7561
- const current = cliBuild ?? "unknown";
7614
+ if (config.sumiBuild && config.sumiBuild !== cliBuild2) {
7615
+ const current = cliBuild2 ?? "unknown";
7562
7616
  throw new RuntimeIdentityError(`\u5F53\u524D sumi \u6784\u5EFA ${current} \u4E0D\u6EE1\u8DB3\u9879\u76EE\u8981\u6C42\u7684 ${config.sumiBuild}\uFF0C${identityHint}`, config);
7563
7617
  }
7564
7618
  return config;
@@ -7566,16 +7620,16 @@ function loadConfig(root) {
7566
7620
 
7567
7621
  // src/runtime-manifest.ts
7568
7622
  var import_node_crypto2 = require("node:crypto");
7569
- var import_node_fs4 = require("node:fs");
7570
- var import_node_path4 = require("node:path");
7623
+ var import_node_fs5 = require("node:fs");
7624
+ var import_node_path5 = require("node:path");
7571
7625
 
7572
7626
  // src/build-identity.ts
7573
7627
  var import_node_crypto = require("node:crypto");
7574
- var import_node_fs3 = require("node:fs");
7575
- var import_node_path3 = require("node:path");
7628
+ var import_node_fs4 = require("node:fs");
7629
+ var import_node_path4 = require("node:path");
7576
7630
  var BUILD_ID_PATTERN = /^sha256:[0-9a-f]{64}$/;
7577
7631
  function payload(path, relative) {
7578
- const content = (0, import_node_fs3.readFileSync)(path);
7632
+ const content = (0, import_node_fs4.readFileSync)(path);
7579
7633
  if (relative !== "package.json") return content;
7580
7634
  const manifest = JSON.parse(content.toString("utf8"));
7581
7635
  delete manifest.sumiBuild;
@@ -7586,9 +7640,9 @@ function buildIdentity(root) {
7586
7640
  const hash = (0, import_node_crypto.createHash)("sha256");
7587
7641
  const entries = [];
7588
7642
  const walk = (dir, prefix = "") => {
7589
- for (const entry of (0, import_node_fs3.readdirSync)(dir, { withFileTypes: true })) {
7643
+ for (const entry of (0, import_node_fs4.readdirSync)(dir, { withFileTypes: true })) {
7590
7644
  const relative = prefix ? `${prefix}/${entry.name}` : entry.name;
7591
- const path = (0, import_node_path3.join)(dir, entry.name);
7645
+ const path = (0, import_node_path4.join)(dir, entry.name);
7592
7646
  if (entry.isDirectory() && entry.name === ".bin" && (prefix === "node_modules" || prefix.endsWith("/node_modules"))) continue;
7593
7647
  if (entry.isDirectory()) walk(path, relative);
7594
7648
  else entries.push(relative);
@@ -7597,10 +7651,10 @@ function buildIdentity(root) {
7597
7651
  walk(root);
7598
7652
  entries.sort();
7599
7653
  for (const relative of entries) {
7600
- const path = (0, import_node_path3.join)(root, ...relative.split("/"));
7601
- const stat = (0, import_node_fs3.lstatSync)(path);
7654
+ const path = (0, import_node_path4.join)(root, ...relative.split("/"));
7655
+ const stat = (0, import_node_fs4.lstatSync)(path);
7602
7656
  if (stat.isSymbolicLink()) {
7603
- const target = Buffer.from((0, import_node_fs3.readlinkSync)(path));
7657
+ const target = Buffer.from((0, import_node_fs4.readlinkSync)(path));
7604
7658
  hash.update(`link\0${relative}\0${target.length}\0`);
7605
7659
  hash.update(target);
7606
7660
  } else if (stat.isFile()) {
@@ -7621,7 +7675,7 @@ var RUNTIME_MANIFEST = `${VENDOR_DIR}/sumi-runtime.json`;
7621
7675
  var SHA256_PATTERN = /^[0-9a-f]{64}$/;
7622
7676
  var ARCHIVE_PATTERN = /^control\/vendor\/sumi-cli-[^/\\]+\.tgz$/;
7623
7677
  function fileSha256(path) {
7624
- return (0, import_node_crypto2.createHash)("sha256").update((0, import_node_fs4.readFileSync)(path)).digest("hex");
7678
+ return (0, import_node_crypto2.createHash)("sha256").update((0, import_node_fs5.readFileSync)(path)).digest("hex");
7625
7679
  }
7626
7680
  function parseRuntimeManifest(value, repo) {
7627
7681
  if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("runtime \u6E05\u5355\u5FC5\u987B\u662F JSON \u5BF9\u8C61");
@@ -7642,12 +7696,12 @@ function parseRuntimeManifest(value, repo) {
7642
7696
  archiveSha256: typeof input.archiveSha256 === "string" ? input.archiveSha256 : "",
7643
7697
  ...identity
7644
7698
  };
7645
- if (!ARCHIVE_PATTERN.test(manifest.archive) || (0, import_node_path4.isAbsolute)(manifest.archive) || manifest.archive.split("/").includes("..")) {
7699
+ if (!ARCHIVE_PATTERN.test(manifest.archive) || (0, import_node_path5.isAbsolute)(manifest.archive) || manifest.archive.split("/").includes("..")) {
7646
7700
  throw new Error(`runtime \u5B89\u88C5\u5305\u8DEF\u5F84\u65E0\u6548\uFF1A${manifest.archive || "(\u7F3A\u5931)"}`);
7647
7701
  }
7648
7702
  if (!SHA256_PATTERN.test(manifest.archiveSha256)) throw new Error("runtime \u5B89\u88C5\u5305 SHA-256 \u65E0\u6548\u6216\u7F3A\u5931");
7649
- const archive = (0, import_node_path4.resolve)(repo, ...manifest.archive.split("/"));
7650
- const vendor = (0, import_node_path4.resolve)(repo, "control/vendor");
7703
+ const archive = (0, import_node_path5.resolve)(repo, ...manifest.archive.split("/"));
7704
+ const vendor = (0, import_node_path5.resolve)(repo, "control/vendor");
7651
7705
  if (archive !== vendor && !archive.startsWith(`${vendor}/`) && !archive.startsWith(`${vendor}\\`)) {
7652
7706
  throw new Error(`runtime \u5B89\u88C5\u5305\u8D8A\u754C\uFF1A${manifest.archive}`);
7653
7707
  }
@@ -7663,13 +7717,13 @@ function safeArchiveEntry(path) {
7663
7717
  function safeLinkTarget(entryPath, target) {
7664
7718
  const normalized = target.replaceAll("\\", "/");
7665
7719
  if (!normalized || normalized.startsWith("/") || /^[A-Za-z]:/.test(normalized)) return false;
7666
- const resolved = import_node_path4.posix.normalize(import_node_path4.posix.join(import_node_path4.posix.dirname(entryPath.replaceAll("\\", "/")), normalized));
7720
+ const resolved = import_node_path5.posix.normalize(import_node_path5.posix.join(import_node_path5.posix.dirname(entryPath.replaceAll("\\", "/")), normalized));
7667
7721
  return resolved === "package" || resolved.startsWith("package/");
7668
7722
  }
7669
7723
 
7670
7724
  // src/runtime-package.ts
7671
- var import_node_fs11 = require("node:fs");
7672
- var import_node_path14 = require("node:path");
7725
+ var import_node_fs12 = require("node:fs");
7726
+ var import_node_path15 = require("node:path");
7673
7727
 
7674
7728
  // ../../node_modules/.pnpm/tar@7.5.22/node_modules/tar/dist/esm/index.min.js
7675
7729
  var import_events = __toESM(require("events"), 1);
@@ -7677,35 +7731,35 @@ var import_fs = __toESM(require("fs"), 1);
7677
7731
  var import_node_events = require("node:events");
7678
7732
  var import_node_stream = __toESM(require("node:stream"), 1);
7679
7733
  var import_node_string_decoder = require("node:string_decoder");
7680
- var import_node_path5 = __toESM(require("node:path"), 1);
7681
- var import_node_fs5 = __toESM(require("node:fs"), 1);
7734
+ var import_node_path6 = __toESM(require("node:path"), 1);
7735
+ var import_node_fs6 = __toESM(require("node:fs"), 1);
7682
7736
  var import_path = require("path");
7683
7737
  var import_events2 = require("events");
7684
7738
  var import_assert = __toESM(require("assert"), 1);
7685
7739
  var import_buffer = require("buffer");
7686
7740
  var Ps = __toESM(require("zlib"), 1);
7687
7741
  var import_zlib = __toESM(require("zlib"), 1);
7688
- var import_node_path6 = require("node:path");
7689
7742
  var import_node_path7 = require("node:path");
7743
+ var import_node_path8 = require("node:path");
7690
7744
  var import_fs2 = __toESM(require("fs"), 1);
7691
7745
  var import_fs3 = __toESM(require("fs"), 1);
7692
7746
  var import_path2 = __toESM(require("path"), 1);
7693
- var import_node_path8 = require("node:path");
7747
+ var import_node_path9 = require("node:path");
7694
7748
  var import_path3 = __toESM(require("path"), 1);
7695
- var import_node_fs6 = __toESM(require("node:fs"), 1);
7749
+ var import_node_fs7 = __toESM(require("node:fs"), 1);
7696
7750
  var import_node_assert = __toESM(require("node:assert"), 1);
7697
7751
  var import_node_crypto3 = require("node:crypto");
7698
- var import_node_fs7 = __toESM(require("node:fs"), 1);
7699
- var import_node_path9 = __toESM(require("node:path"), 1);
7700
- var import_fs4 = __toESM(require("fs"), 1);
7701
7752
  var import_node_fs8 = __toESM(require("node:fs"), 1);
7702
7753
  var import_node_path10 = __toESM(require("node:path"), 1);
7754
+ var import_fs4 = __toESM(require("fs"), 1);
7703
7755
  var import_node_fs9 = __toESM(require("node:fs"), 1);
7704
- var import_promises = __toESM(require("node:fs/promises"), 1);
7705
7756
  var import_node_path11 = __toESM(require("node:path"), 1);
7706
- var import_node_path12 = require("node:path");
7707
7757
  var import_node_fs10 = __toESM(require("node:fs"), 1);
7708
- var import_node_path13 = __toESM(require("node:path"), 1);
7758
+ var import_promises = __toESM(require("node:fs/promises"), 1);
7759
+ var import_node_path12 = __toESM(require("node:path"), 1);
7760
+ var import_node_path13 = require("node:path");
7761
+ var import_node_fs11 = __toESM(require("node:fs"), 1);
7762
+ var import_node_path14 = __toESM(require("node:path"), 1);
7709
7763
  var zr = Object.defineProperty;
7710
7764
  var Ur = (s3, t) => {
7711
7765
  for (var e in t) zr(s3, e, { get: t[e], enumerable: true });
@@ -8599,12 +8653,12 @@ var F = class {
8599
8653
  }
8600
8654
  };
8601
8655
  var mn = (s3, t) => {
8602
- let i = s3, r = "", n, o = import_node_path6.posix.parse(s3).root || ".";
8656
+ let i = s3, r = "", n, o = import_node_path7.posix.parse(s3).root || ".";
8603
8657
  if (Buffer.byteLength(i) < 100) n = [i, r, false];
8604
8658
  else {
8605
- r = import_node_path6.posix.dirname(i), i = import_node_path6.posix.basename(i);
8659
+ r = import_node_path7.posix.dirname(i), i = import_node_path7.posix.basename(i);
8606
8660
  do
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));
8661
+ 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_path7.posix.join(import_node_path7.posix.basename(r), i), r = import_node_path7.posix.dirname(r));
8608
8662
  while (r !== o && n === void 0);
8609
8663
  n || (n = [s3.slice(0, 99), "", true]);
8610
8664
  }
@@ -8650,7 +8704,7 @@ var ft = class s {
8650
8704
  if (t === "") return Buffer.allocUnsafe(0);
8651
8705
  let e = Buffer.byteLength(t), i = 512 * Math.ceil(1 + e / 512), r = Buffer.allocUnsafe(i);
8652
8706
  for (let n = 0; n < 512; n++) r[n] = 0;
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");
8707
+ new F({ path: ("PaxHeader/" + (0, import_node_path8.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");
8654
8708
  for (let n = e + 512; n < r.length; n++) r[n] = 0;
8655
8709
  return r;
8656
8710
  }
@@ -9076,15 +9130,15 @@ var Qi = (s3, t) => {
9076
9130
  var Mn = (s3) => {
9077
9131
  let t = new rt(s3), e = s3.file, i;
9078
9132
  try {
9079
- i = import_node_fs5.default.openSync(e, "r");
9080
- let r = import_node_fs5.default.fstatSync(i), n = s3.maxReadSize || 16 * 1024 * 1024;
9133
+ i = import_node_fs6.default.openSync(e, "r");
9134
+ let r = import_node_fs6.default.fstatSync(i), n = s3.maxReadSize || 16 * 1024 * 1024;
9081
9135
  if (r.size < n) {
9082
- let o = Buffer.allocUnsafe(r.size), h = import_node_fs5.default.readSync(i, o, 0, r.size, 0);
9136
+ let o = Buffer.allocUnsafe(r.size), h = import_node_fs6.default.readSync(i, o, 0, r.size, 0);
9083
9137
  t.end(h === o.byteLength ? o : o.subarray(0, h));
9084
9138
  } else {
9085
9139
  let o = 0, h = Buffer.allocUnsafe(n);
9086
9140
  for (; o < r.size; ) {
9087
- let a = import_node_fs5.default.readSync(i, h, 0, n, o);
9141
+ let a = import_node_fs6.default.readSync(i, h, 0, n, o);
9088
9142
  if (a === 0) break;
9089
9143
  o += a, t.write(h.subarray(0, a));
9090
9144
  }
@@ -9092,7 +9146,7 @@ var Mn = (s3) => {
9092
9146
  }
9093
9147
  } finally {
9094
9148
  if (typeof i == "number") try {
9095
- import_node_fs5.default.closeSync(i);
9149
+ import_node_fs6.default.closeSync(i);
9096
9150
  } catch {
9097
9151
  }
9098
9152
  }
@@ -9100,7 +9154,7 @@ var Mn = (s3) => {
9100
9154
  var Bn = (s3, t) => {
9101
9155
  let e = new rt(s3), i = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
9102
9156
  return new Promise((o, h) => {
9103
- e.on("error", h), e.on("end", o), import_node_fs5.default.stat(r, (a, l) => {
9157
+ e.on("error", h), e.on("end", o), import_node_fs6.default.stat(r, (a, l) => {
9104
9158
  if (a) h(a);
9105
9159
  else {
9106
9160
  let c = new _t(r, { readSize: i, size: l.size });
@@ -9113,7 +9167,7 @@ var Ct = K(Mn, Bn, (s3) => new rt(s3), (s3) => new rt(s3), (s3, t) => {
9113
9167
  t?.length && Qi(s3, t), s3.noResume || vn(s3);
9114
9168
  });
9115
9169
  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);
9116
- var { isAbsolute: zn, parse: qs } = import_node_path8.win32;
9170
+ var { isAbsolute: zn, parse: qs } = import_node_path9.win32;
9117
9171
  var ce = (s3) => {
9118
9172
  let t = "", e = qs(s3);
9119
9173
  for (; zn(s3) || e.root; ) {
@@ -9822,11 +9876,11 @@ var $n = (s3, t) => {
9822
9876
  };
9823
9877
  var fr = (s3, t) => {
9824
9878
  t.forEach((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);
9879
+ e.charAt(0) === "@" ? Ct({ file: import_node_path6.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
9826
9880
  }), s3.end();
9827
9881
  };
9828
9882
  var dr = async (s3, t) => {
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) => {
9883
+ for (let e of t) e.charAt(0) === "@" ? await Ct({ file: import_node_path6.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => {
9830
9884
  s3.add(i);
9831
9885
  } }) : s3.add(e);
9832
9886
  s3.end();
@@ -9853,29 +9907,29 @@ var mr = !Er && typeof ur == "number" ? ur | Sr | wr | yr : null;
9853
9907
  var ms = mr !== null ? () => mr : jn ? (s3) => s3 < to ? eo : "w" : () => "w";
9854
9908
  var ps = (s3, t, e) => {
9855
9909
  try {
9856
- return import_node_fs8.default.lchownSync(s3, t, e);
9910
+ return import_node_fs9.default.lchownSync(s3, t, e);
9857
9911
  } catch (i) {
9858
9912
  if (i?.code !== "ENOENT") throw i;
9859
9913
  }
9860
9914
  };
9861
9915
  var Ei = (s3, t, e, i) => {
9862
- import_node_fs8.default.lchown(s3, t, e, (r) => {
9916
+ import_node_fs9.default.lchown(s3, t, e, (r) => {
9863
9917
  i(r && r?.code !== "ENOENT" ? r : null);
9864
9918
  });
9865
9919
  };
9866
9920
  var io = (s3, t, e, i, r) => {
9867
- if (t.isDirectory()) Es(import_node_path10.default.resolve(s3, t.name), e, i, (n) => {
9921
+ if (t.isDirectory()) Es(import_node_path11.default.resolve(s3, t.name), e, i, (n) => {
9868
9922
  if (n) return r(n);
9869
- let o = import_node_path10.default.resolve(s3, t.name);
9923
+ let o = import_node_path11.default.resolve(s3, t.name);
9870
9924
  Ei(o, e, i, r);
9871
9925
  });
9872
9926
  else {
9873
- let n = import_node_path10.default.resolve(s3, t.name);
9927
+ let n = import_node_path11.default.resolve(s3, t.name);
9874
9928
  Ei(n, e, i, r);
9875
9929
  }
9876
9930
  };
9877
9931
  var Es = (s3, t, e, i) => {
9878
- import_node_fs8.default.readdir(s3, { withFileTypes: true }, (r, n) => {
9932
+ import_node_fs9.default.readdir(s3, { withFileTypes: true }, (r, n) => {
9879
9933
  if (r) {
9880
9934
  if (r.code === "ENOENT") return i();
9881
9935
  if (r.code !== "ENOTDIR" && r.code !== "ENOTSUP") return i(r);
@@ -9891,12 +9945,12 @@ var Es = (s3, t, e, i) => {
9891
9945
  });
9892
9946
  };
9893
9947
  var so = (s3, t, 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);
9948
+ t.isDirectory() && ws(import_node_path11.default.resolve(s3, t.name), e, i), ps(import_node_path11.default.resolve(s3, t.name), e, i);
9895
9949
  };
9896
9950
  var ws = (s3, t, e) => {
9897
9951
  let i;
9898
9952
  try {
9899
- i = import_node_fs8.default.readdirSync(s3, { withFileTypes: true });
9953
+ i = import_node_fs9.default.readdirSync(s3, { withFileTypes: true });
9900
9954
  } catch (r) {
9901
9955
  let n = r;
9902
9956
  if (n?.code === "ENOENT") return;
@@ -9930,32 +9984,32 @@ var St = class extends Error {
9930
9984
  }
9931
9985
  };
9932
9986
  var no = (s3, t) => {
9933
- import_node_fs9.default.stat(s3, (e, i) => {
9987
+ import_node_fs10.default.stat(s3, (e, i) => {
9934
9988
  (e || !i.isDirectory()) && (e = new Se(s3, e?.code || "ENOTDIR")), t(e);
9935
9989
  });
9936
9990
  };
9937
9991
  var gr = (s3, t, e) => {
9938
9992
  s3 = f(s3);
9939
9993
  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) => {
9940
- E ? e(E) : x && a ? Es(x, o, h, (Le) => y(Le)) : n ? import_node_fs9.default.chmod(s3, r, e) : e();
9994
+ E ? e(E) : x && a ? Es(x, o, h, (Le) => y(Le)) : n ? import_node_fs10.default.chmod(s3, r, e) : e();
9941
9995
  };
9942
9996
  if (s3 === d) return no(s3, y);
9943
9997
  if (l) return import_promises.default.mkdir(s3, { mode: r, recursive: true }).then((E) => y(null, E ?? void 0), y);
9944
- let D = f(import_node_path11.default.relative(d, s3)).split("/");
9998
+ let D = f(import_node_path12.default.relative(d, s3)).split("/");
9945
9999
  Ss(d, D, r, c, d, void 0, y);
9946
10000
  };
9947
10001
  var Ss = (s3, t, e, i, r, n, o) => {
9948
10002
  if (t.length === 0) return o(null, n);
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));
10003
+ let h = t.shift(), a = f(import_node_path12.default.resolve(s3 + "/" + h));
10004
+ import_node_fs10.default.mkdir(a, e, br(a, t, e, i, r, n, o));
9951
10005
  };
9952
10006
  var br = (s3, t, e, i, r, n, o) => (h) => {
9953
- h ? import_node_fs9.default.lstat(s3, (a, l) => {
10007
+ h ? import_node_fs10.default.lstat(s3, (a, l) => {
9954
10008
  if (a) a.path = a.path && f(a.path), o(a);
9955
10009
  else if (l.isDirectory()) Ss(s3, t, e, i, r, n, o);
9956
- else if (i) import_node_fs9.default.unlink(s3, (c) => {
10010
+ else if (i) import_node_fs10.default.unlink(s3, (c) => {
9957
10011
  if (c) return o(c);
9958
- import_node_fs9.default.mkdir(s3, e, br(s3, t, e, i, r, n, o));
10012
+ import_node_fs10.default.mkdir(s3, e, br(s3, t, e, i, r, n, o));
9959
10013
  });
9960
10014
  else {
9961
10015
  if (l.isSymbolicLink()) return o(new St(s3, s3 + "/" + t.join("/")));
@@ -9966,7 +10020,7 @@ var br = (s3, t, e, i, r, n, o) => (h) => {
9966
10020
  var oo = (s3) => {
9967
10021
  let t = false, e;
9968
10022
  try {
9969
- t = import_node_fs9.default.statSync(s3).isDirectory();
10023
+ t = import_node_fs10.default.statSync(s3).isDirectory();
9970
10024
  } catch (i) {
9971
10025
  e = i?.code;
9972
10026
  } finally {
@@ -9976,20 +10030,20 @@ var oo = (s3) => {
9976
10030
  var _r = (s3, t) => {
9977
10031
  s3 = f(s3);
9978
10032
  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) => {
9979
- E && h && ws(E, n, o), r && import_node_fs9.default.chmodSync(s3, i);
10033
+ E && h && ws(E, n, o), r && import_node_fs10.default.chmodSync(s3, i);
9980
10034
  };
9981
10035
  if (s3 === c) return oo(c), 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;
10036
+ if (a) return d(import_node_fs10.default.mkdirSync(s3, { mode: i, recursive: true }) ?? void 0);
10037
+ let T = f(import_node_path12.default.relative(c, s3)).split("/"), D;
9984
10038
  for (let E = T.shift(), x = c; E && (x += "/" + E); E = T.shift()) {
9985
- x = f(import_node_path11.default.resolve(x));
10039
+ x = f(import_node_path12.default.resolve(x));
9986
10040
  try {
9987
- import_node_fs9.default.mkdirSync(x, i), D = D || x;
10041
+ import_node_fs10.default.mkdirSync(x, i), D = D || x;
9988
10042
  } catch {
9989
- let Le = import_node_fs9.default.lstatSync(x);
10043
+ let Le = import_node_fs10.default.lstatSync(x);
9990
10044
  if (Le.isDirectory()) continue;
9991
10045
  if (l) {
9992
- import_node_fs9.default.unlinkSync(x), import_node_fs9.default.mkdirSync(x, i), D = D || x;
10046
+ import_node_fs10.default.unlinkSync(x), import_node_fs10.default.mkdirSync(x, i), D = D || x;
9993
10047
  continue;
9994
10048
  } else if (Le.isSymbolicLink()) return new St(x, x + "/" + T.join("/"));
9995
10049
  }
@@ -10011,14 +10065,14 @@ var ho = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
10011
10065
  var ao = ho === "win32";
10012
10066
  var lo = (s3) => s3.split("/").slice(0, -1).reduce((e, i) => {
10013
10067
  let r = e.at(-1);
10014
- return r !== void 0 && (i = (0, import_node_path12.join)(r, i)), e.push(i || "/"), e;
10068
+ return r !== void 0 && (i = (0, import_node_path13.join)(r, i)), e.push(i || "/"), e;
10015
10069
  }, []);
10016
10070
  var yi = class {
10017
10071
  #t = /* @__PURE__ */ new Map();
10018
10072
  #i = /* @__PURE__ */ new Map();
10019
10073
  #s = /* @__PURE__ */ new Set();
10020
10074
  reserve(t, e) {
10021
- t = ao ? ["win32 parallelization disabled"] : t.map((r) => mt((0, import_node_path12.join)(Tr(r))));
10075
+ t = ao ? ["win32 parallelization disabled"] : t.map((r) => mt((0, import_node_path13.join)(Tr(r))));
10022
10076
  let i = new Set(t.map((r) => lo(r)).reduce((r, n) => r.concat(n)));
10023
10077
  this.#i.set(e, { dirs: i, paths: t });
10024
10078
  for (let r of t) {
@@ -10108,17 +10162,17 @@ var fo = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
10108
10162
  var Te = fo === "win32";
10109
10163
  var uo = 1024;
10110
10164
  var mo = (s3, t) => {
10111
- if (!Te) return import_node_fs7.default.unlink(s3, t);
10165
+ if (!Te) return import_node_fs8.default.unlink(s3, t);
10112
10166
  let e = s3 + ".DELETE." + (0, import_node_crypto3.randomBytes)(16).toString("hex");
10113
- import_node_fs7.default.rename(s3, e, (i) => {
10167
+ import_node_fs8.default.rename(s3, e, (i) => {
10114
10168
  if (i) return t(i);
10115
- import_node_fs7.default.unlink(e, t);
10169
+ import_node_fs8.default.unlink(e, t);
10116
10170
  });
10117
10171
  };
10118
10172
  var po = (s3) => {
10119
- if (!Te) return import_node_fs7.default.unlinkSync(s3);
10173
+ if (!Te) return import_node_fs8.default.unlinkSync(s3);
10120
10174
  let t = s3 + ".DELETE." + (0, import_node_crypto3.randomBytes)(16).toString("hex");
10121
- import_node_fs7.default.renameSync(s3, t), import_node_fs7.default.unlinkSync(t);
10175
+ import_node_fs8.default.renameSync(s3, t), import_node_fs8.default.unlinkSync(t);
10122
10176
  };
10123
10177
  var vr = (s3, t, e) => s3 !== void 0 && s3 === s3 >>> 0 ? s3 : t !== void 0 && t === t >>> 0 ? t : e;
10124
10178
  var Xt = class extends rt {
@@ -10158,7 +10212,7 @@ var Xt = class extends rt {
10158
10212
  if (t.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
10159
10213
  this.uid = t.uid, this.gid = t.gid, this.setOwner = true;
10160
10214
  } else this.uid = void 0, this.gid = void 0, this.setOwner = false;
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));
10215
+ 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_path10.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));
10162
10216
  }
10163
10217
  warn(t, e, i = {}) {
10164
10218
  return (t === "TAR_BAD_ARCHIVE" || t === "TAR_ABORT") && (i.recoverable = false), super.warn(t, e, i);
@@ -10172,7 +10226,7 @@ var Xt = class extends rt {
10172
10226
  let [n, o] = ce(i), h = o.replaceAll(/\\/g, "/").split("/");
10173
10227
  if (h.includes("..") || Te && /^[a-z]:\.\.$/i.test(h[0] ?? "")) {
10174
10228
  if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t, [e]: i }), false;
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("/")));
10229
+ let a = import_node_path10.default.posix.dirname(t.path), l = import_node_path10.default.posix.normalize(import_node_path10.default.posix.join(a, h.join("/")));
10176
10230
  if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t, [e]: i }), false;
10177
10231
  }
10178
10232
  return n && (t[e] = String(o), this.warn("TAR_ENTRY_INFO", `stripping ${n} from absolute ${e}`, { entry: t, [e]: i })), true;
@@ -10190,12 +10244,12 @@ var Xt = class extends rt {
10190
10244
  }
10191
10245
  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;
10192
10246
  if (!this[Rs](t, "path") || !this[Rs](t, "linkpath")) return 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;
10247
+ if (t.absolute = import_node_path10.default.isAbsolute(t.path) ? f(import_node_path10.default.resolve(t.path)) : f(import_node_path10.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;
10194
10248
  if (t.absolute === this.cwd && t.type !== "Directory" && t.type !== "GNUDumpDir") return false;
10195
10249
  if (this.win32) {
10196
- let { root: r } = import_node_path9.default.win32.parse(String(t.absolute));
10250
+ let { root: r } = import_node_path10.default.win32.parse(String(t.absolute));
10197
10251
  t.absolute = r + ts(String(t.absolute).slice(r.length));
10198
- let { root: n } = import_node_path9.default.win32.parse(t.path);
10252
+ let { root: n } = import_node_path10.default.win32.parse(t.path);
10199
10253
  t.path = n + ts(t.path.slice(n.length));
10200
10254
  }
10201
10255
  return true;
@@ -10234,16 +10288,16 @@ var Xt = class extends rt {
10234
10288
  [Ts](t, e) {
10235
10289
  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 });
10236
10290
  r.on("error", (a) => {
10237
- r.fd && import_node_fs7.default.close(r.fd, () => {
10291
+ r.fd && import_node_fs8.default.close(r.fd, () => {
10238
10292
  }), r.write = () => true, this[O](a, t), e();
10239
10293
  });
10240
10294
  let n = 1, o = (a) => {
10241
10295
  if (a) {
10242
- r.fd && import_node_fs7.default.close(r.fd, () => {
10296
+ r.fd && import_node_fs8.default.close(r.fd, () => {
10243
10297
  }), this[O](a, t), e();
10244
10298
  return;
10245
10299
  }
10246
- --n === 0 && r.fd !== void 0 && import_node_fs7.default.close(r.fd, (l) => {
10300
+ --n === 0 && r.fd !== void 0 && import_node_fs8.default.close(r.fd, (l) => {
10247
10301
  l ? this[O](l, t) : this[$t](), e();
10248
10302
  });
10249
10303
  };
@@ -10252,12 +10306,12 @@ var Xt = class extends rt {
10252
10306
  if (typeof l == "number" && t.mtime && !this.noMtime) {
10253
10307
  n++;
10254
10308
  let c = t.atime || /* @__PURE__ */ new Date(), d = t.mtime;
10255
- import_node_fs7.default.futimes(l, c, d, (y) => y ? import_node_fs7.default.utimes(a, c, d, (T) => o(T && y)) : o());
10309
+ import_node_fs8.default.futimes(l, c, d, (y) => y ? import_node_fs8.default.utimes(a, c, d, (T) => o(T && y)) : o());
10256
10310
  }
10257
10311
  if (typeof l == "number" && this[ge](t)) {
10258
10312
  n++;
10259
10313
  let c = this[be](t), d = this[_e](t);
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());
10314
+ typeof c == "number" && typeof d == "number" && import_node_fs8.default.fchown(l, c, d, (y) => y ? import_node_fs8.default.chown(a, c, d, (T) => o(T && y)) : o());
10261
10315
  }
10262
10316
  o();
10263
10317
  });
@@ -10276,20 +10330,20 @@ var Xt = class extends rt {
10276
10330
  let n = 1, o = () => {
10277
10331
  --n === 0 && (e(), this[$t](), t.resume());
10278
10332
  };
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();
10333
+ t.mtime && !this.noMtime && (n++, import_node_fs8.default.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o)), this[ge](t) && (n++, import_node_fs8.default.chown(String(t.absolute), Number(this[be](t)), Number(this[_e](t)), o)), o();
10280
10334
  });
10281
10335
  }
10282
10336
  [Cr](t) {
10283
10337
  t.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t.type}`, { entry: t }), t.resume();
10284
10338
  }
10285
10339
  [Ar](t, e) {
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("/");
10340
+ let i = f(import_node_path10.default.relative(this.cwd, import_node_path10.default.resolve(import_node_path10.default.dirname(String(t.absolute)), String(t.linkpath)))).split("/");
10287
10341
  this[Re](t, this.cwd, i, () => this[gi](t, String(t.linkpath), "symlink", e), (r) => {
10288
10342
  this[O](r, t), e();
10289
10343
  });
10290
10344
  }
10291
10345
  [Ir](t, e) {
10292
- let i = f(import_node_path9.default.resolve(this.cwd, String(t.linkpath))), r = f(String(t.linkpath)).split("/");
10346
+ let i = f(import_node_path10.default.resolve(this.cwd, String(t.linkpath))), r = f(String(t.linkpath)).split("/");
10293
10347
  this[Re](t, this.cwd, r, () => this[gi](t, i, "link", e), (n) => {
10294
10348
  this[O](n, t), e();
10295
10349
  });
@@ -10297,10 +10351,10 @@ var Xt = class extends rt {
10297
10351
  [Re](t, e, i, r, n) {
10298
10352
  let o = i.shift();
10299
10353
  if (this.preservePaths || o === void 0) return r();
10300
- let h = import_node_path9.default.resolve(e, o);
10301
- import_node_fs7.default.lstat(h, (a, l) => {
10354
+ let h = import_node_path10.default.resolve(e, o);
10355
+ import_node_fs8.default.lstat(h, (a, l) => {
10302
10356
  if (a) return r();
10303
- if (l?.isSymbolicLink()) return n(new St(h, import_node_path9.default.resolve(h, i.join("/"))));
10357
+ if (l?.isSymbolicLink()) return n(new St(h, import_node_path10.default.resolve(h, i.join("/"))));
10304
10358
  this[Re](t, h, i, r, n);
10305
10359
  });
10306
10360
  }
@@ -10334,7 +10388,7 @@ var Xt = class extends rt {
10334
10388
  });
10335
10389
  }, n = () => {
10336
10390
  if (t.absolute !== this.cwd) {
10337
- let h = f(import_node_path9.default.dirname(String(t.absolute)));
10391
+ let h = f(import_node_path10.default.dirname(String(t.absolute)));
10338
10392
  if (h !== this.cwd) return this[yt](h, this.dmode, (a) => {
10339
10393
  if (a) {
10340
10394
  this[O](a, t), i();
@@ -10345,7 +10399,7 @@ var Xt = class extends rt {
10345
10399
  }
10346
10400
  o();
10347
10401
  }, o = () => {
10348
- import_node_fs7.default.lstat(String(t.absolute), (h, a) => {
10402
+ import_node_fs8.default.lstat(String(t.absolute), (h, a) => {
10349
10403
  if (a && (this.keep || this.newer && a.mtime > (t.mtime ?? a.mtime))) {
10350
10404
  this[Ls](t), i();
10351
10405
  return;
@@ -10354,9 +10408,9 @@ var Xt = class extends rt {
10354
10408
  if (a.isDirectory()) {
10355
10409
  if (t.type === "Directory") {
10356
10410
  let l = this.chmod && t.mode && (a.mode & 4095) !== t.mode, c = (d) => this[P](d ?? null, t, i);
10357
- return l ? import_node_fs7.default.chmod(String(t.absolute), Number(t.mode), c) : c();
10411
+ return l ? import_node_fs8.default.chmod(String(t.absolute), Number(t.mode), c) : c();
10358
10412
  }
10359
- if (t.absolute !== this.cwd) return import_node_fs7.default.rmdir(String(t.absolute), (l) => this[P](l ?? null, t, i));
10413
+ if (t.absolute !== this.cwd) return import_node_fs8.default.rmdir(String(t.absolute), (l) => this[P](l ?? null, t, i));
10360
10414
  }
10361
10415
  if (t.absolute === this.cwd) return this[P](null, t, i);
10362
10416
  mo(String(t.absolute), (l) => this[P](l ?? null, t, i));
@@ -10384,7 +10438,7 @@ var Xt = class extends rt {
10384
10438
  }
10385
10439
  }
10386
10440
  [gi](t, e, i, r) {
10387
- import_node_fs7.default[i](e, String(t.absolute), (n) => {
10441
+ import_node_fs8.default[i](e, String(t.absolute), (n) => {
10388
10442
  n ? this[O](n, t) : (this[$t](), t.resume()), r();
10389
10443
  });
10390
10444
  }
@@ -10409,23 +10463,23 @@ var xe = class extends Xt {
10409
10463
  this[Oe] = true;
10410
10464
  }
10411
10465
  if (t.absolute !== this.cwd) {
10412
- let n = f(import_node_path9.default.dirname(String(t.absolute)));
10466
+ let n = f(import_node_path10.default.dirname(String(t.absolute)));
10413
10467
  if (n !== this.cwd) {
10414
10468
  let o = this[yt](n, this.dmode);
10415
10469
  if (o) return this[O](o, t);
10416
10470
  }
10417
10471
  }
10418
- let [e, i] = ye(() => import_node_fs7.default.lstatSync(String(t.absolute)));
10472
+ let [e, i] = ye(() => import_node_fs8.default.lstatSync(String(t.absolute)));
10419
10473
  if (i && (this.keep || this.newer && i.mtime > (t.mtime ?? i.mtime))) return this[Ls](t);
10420
10474
  if (e || this[Os](t, i)) return this[P](null, t);
10421
10475
  if (i.isDirectory()) {
10422
10476
  if (t.type === "Directory") {
10423
10477
  let o = this.chmod && t.mode && (i.mode & 4095) !== t.mode, [h] = o ? ye(() => {
10424
- import_node_fs7.default.chmodSync(String(t.absolute), Number(t.mode));
10478
+ import_node_fs8.default.chmodSync(String(t.absolute), Number(t.mode));
10425
10479
  }) : [];
10426
10480
  return this[P](h, t);
10427
10481
  }
10428
- let [n] = ye(() => import_node_fs7.default.rmdirSync(String(t.absolute)));
10482
+ let [n] = ye(() => import_node_fs8.default.rmdirSync(String(t.absolute)));
10429
10483
  this[P](n, t);
10430
10484
  }
10431
10485
  let [r] = t.absolute === this.cwd ? [] : ye(() => po(String(t.absolute)));
@@ -10435,21 +10489,21 @@ var xe = class extends Xt {
10435
10489
  let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = (h) => {
10436
10490
  let a;
10437
10491
  try {
10438
- import_node_fs7.default.closeSync(n);
10492
+ import_node_fs8.default.closeSync(n);
10439
10493
  } catch (l) {
10440
10494
  a = l;
10441
10495
  }
10442
10496
  (h || a) && this[O](h || a, t), e();
10443
10497
  }, n;
10444
10498
  try {
10445
- n = import_node_fs7.default.openSync(String(t.absolute), ms(t.size), i);
10499
+ n = import_node_fs8.default.openSync(String(t.absolute), ms(t.size), i);
10446
10500
  } catch (h) {
10447
10501
  return r(h);
10448
10502
  }
10449
10503
  let o = this.transform && this.transform(t) || t;
10450
10504
  o !== t && (o.on("error", (h) => this[O](h, t)), t.pipe(o)), o.on("data", (h) => {
10451
10505
  try {
10452
- import_node_fs7.default.writeSync(n, h, 0, h.length);
10506
+ import_node_fs8.default.writeSync(n, h, 0, h.length);
10453
10507
  } catch (a) {
10454
10508
  r(a);
10455
10509
  }
@@ -10458,10 +10512,10 @@ var xe = class extends Xt {
10458
10512
  if (t.mtime && !this.noMtime) {
10459
10513
  let a = t.atime || /* @__PURE__ */ new Date(), l = t.mtime;
10460
10514
  try {
10461
- import_node_fs7.default.futimesSync(n, a, l);
10515
+ import_node_fs8.default.futimesSync(n, a, l);
10462
10516
  } catch (c) {
10463
10517
  try {
10464
- import_node_fs7.default.utimesSync(String(t.absolute), a, l);
10518
+ import_node_fs8.default.utimesSync(String(t.absolute), a, l);
10465
10519
  } catch {
10466
10520
  h = c;
10467
10521
  }
@@ -10470,10 +10524,10 @@ var xe = class extends Xt {
10470
10524
  if (this[ge](t)) {
10471
10525
  let a = this[be](t), l = this[_e](t);
10472
10526
  try {
10473
- import_node_fs7.default.fchownSync(n, Number(a), Number(l));
10527
+ import_node_fs8.default.fchownSync(n, Number(a), Number(l));
10474
10528
  } catch (c) {
10475
10529
  try {
10476
- import_node_fs7.default.chownSync(String(t.absolute), Number(a), Number(l));
10530
+ import_node_fs8.default.chownSync(String(t.absolute), Number(a), Number(l));
10477
10531
  } catch {
10478
10532
  h = h || c;
10479
10533
  }
@@ -10489,11 +10543,11 @@ var xe = class extends Xt {
10489
10543
  return;
10490
10544
  }
10491
10545
  if (t.mtime && !this.noMtime) try {
10492
- import_node_fs7.default.utimesSync(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime);
10546
+ import_node_fs8.default.utimesSync(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime);
10493
10547
  } catch {
10494
10548
  }
10495
10549
  if (this[ge](t)) try {
10496
- import_node_fs7.default.chownSync(String(t.absolute), Number(this[be](t)), Number(this[_e](t)));
10550
+ import_node_fs8.default.chownSync(String(t.absolute), Number(this[be](t)), Number(this[_e](t)));
10497
10551
  } catch {
10498
10552
  }
10499
10553
  e(), t.resume();
@@ -10509,30 +10563,30 @@ var xe = class extends Xt {
10509
10563
  if (this.preservePaths || i.length === 0) return r();
10510
10564
  let o = e;
10511
10565
  for (let h of i) {
10512
- o = import_node_path9.default.resolve(o, h);
10513
- let [a, l] = ye(() => import_node_fs7.default.lstatSync(o));
10566
+ o = import_node_path10.default.resolve(o, h);
10567
+ let [a, l] = ye(() => import_node_fs8.default.lstatSync(o));
10514
10568
  if (a) return r();
10515
- if (l.isSymbolicLink()) return n(new St(o, import_node_path9.default.resolve(e, i.join("/"))));
10569
+ if (l.isSymbolicLink()) return n(new St(o, import_node_path10.default.resolve(e, i.join("/"))));
10516
10570
  }
10517
10571
  r();
10518
10572
  }
10519
10573
  [gi](t, e, i, r) {
10520
10574
  let n = `${i}Sync`;
10521
10575
  try {
10522
- import_node_fs7.default[n](e, String(t.absolute)), r(), t.resume();
10576
+ import_node_fs8.default[n](e, String(t.absolute)), r(), t.resume();
10523
10577
  } catch (o) {
10524
10578
  return this[O](o, t);
10525
10579
  }
10526
10580
  }
10527
10581
  };
10528
10582
  var Eo = (s3) => {
10529
- let t = new xe(s3), e = s3.file, i = import_node_fs6.default.statSync(e), r = s3.maxReadSize || 16 * 1024 * 1024;
10583
+ let t = new xe(s3), e = s3.file, i = import_node_fs7.default.statSync(e), r = s3.maxReadSize || 16 * 1024 * 1024;
10530
10584
  new Be(e, { readSize: r, size: i.size }).pipe(t);
10531
10585
  };
10532
10586
  var wo = (s3, t) => {
10533
10587
  let e = new Xt(s3), i = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
10534
10588
  return new Promise((o, h) => {
10535
- e.on("error", h), e.on("close", o), import_node_fs6.default.stat(r, (a, l) => {
10589
+ e.on("error", h), e.on("close", o), import_node_fs7.default.stat(r, (a, l) => {
10536
10590
  if (a) h(a);
10537
10591
  else {
10538
10592
  let c = new _t(r, { readSize: i, size: l.size });
@@ -10548,15 +10602,15 @@ var yo = (s3, t) => {
10548
10602
  let e = new kt(s3), i = true, r, n;
10549
10603
  try {
10550
10604
  try {
10551
- r = import_node_fs10.default.openSync(s3.file, "r+");
10605
+ r = import_node_fs11.default.openSync(s3.file, "r+");
10552
10606
  } catch (a) {
10553
- if (a?.code === "ENOENT") r = import_node_fs10.default.openSync(s3.file, "w+");
10607
+ if (a?.code === "ENOENT") r = import_node_fs11.default.openSync(s3.file, "w+");
10554
10608
  else throw a;
10555
10609
  }
10556
- let o = import_node_fs10.default.fstatSync(r), h = Buffer.alloc(512);
10610
+ let o = import_node_fs11.default.fstatSync(r), h = Buffer.alloc(512);
10557
10611
  t: for (n = 0; n < o.size; n += 512) {
10558
10612
  for (let c = 0, d = 0; c < 512; c += d) {
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");
10613
+ if (d = import_node_fs11.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");
10560
10614
  if (!d) break t;
10561
10615
  }
10562
10616
  let a = new F(h);
@@ -10568,7 +10622,7 @@ var yo = (s3, t) => {
10568
10622
  i = false, Ro(s3, e, n, r, t);
10569
10623
  } finally {
10570
10624
  if (i) try {
10571
- import_node_fs10.default.closeSync(r);
10625
+ import_node_fs11.default.closeSync(r);
10572
10626
  } catch {
10573
10627
  }
10574
10628
  }
@@ -10581,29 +10635,29 @@ var go = (s3, t) => {
10581
10635
  t = Array.from(t);
10582
10636
  let e = new wt(s3), i = (n, o, h) => {
10583
10637
  let a = (T, D) => {
10584
- T ? import_node_fs10.default.close(n, (E) => h(T)) : h(null, D);
10638
+ T ? import_node_fs11.default.close(n, (E) => h(T)) : h(null, D);
10585
10639
  }, l = 0;
10586
10640
  if (o === 0) return a(null, 0);
10587
10641
  let c = 0, d = Buffer.alloc(512), y = (T, D) => {
10588
10642
  if (T || D === void 0) return a(T);
10589
- if (c += D, c < 512 && D) return import_node_fs10.default.read(n, d, c, d.length - c, l + c, y);
10643
+ if (c += D, c < 512 && D) return import_node_fs11.default.read(n, d, c, d.length - c, l + c, y);
10590
10644
  if (l === 0 && d[0] === 31 && d[1] === 139) return a(new Error("cannot append to compressed archives"));
10591
10645
  if (c < 512) return a(null, l);
10592
10646
  let E = new F(d);
10593
10647
  if (!E.cksumValid) return a(null, l);
10594
10648
  let x = 512 * Math.ceil((E.size ?? 0) / 512);
10595
10649
  if (l + x + 512 > o || (l += x + 512, l >= o)) return a(null, l);
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);
10650
+ s3.mtimeCache && E.mtime && s3.mtimeCache.set(String(E.path), E.mtime), c = 0, import_node_fs11.default.read(n, d, 0, 512, l, y);
10597
10651
  };
10598
- import_node_fs10.default.read(n, d, 0, 512, l, y);
10652
+ import_node_fs11.default.read(n, d, 0, 512, l, y);
10599
10653
  };
10600
10654
  return new Promise((n, o) => {
10601
10655
  e.on("error", o);
10602
10656
  let h = "r+", a = (l, c) => {
10603
- if (l && l.code === "ENOENT" && h === "r+") return h = "w+", import_node_fs10.default.open(s3.file, h, a);
10657
+ if (l && l.code === "ENOENT" && h === "r+") return h = "w+", import_node_fs11.default.open(s3.file, h, a);
10604
10658
  if (l || !c) return o(l);
10605
- import_node_fs10.default.fstat(c, (d, y) => {
10606
- if (d) return import_node_fs10.default.close(c, () => o(d));
10659
+ import_node_fs11.default.fstat(c, (d, y) => {
10660
+ if (d) return import_node_fs11.default.close(c, () => o(d));
10607
10661
  i(c, y.size, (T, D) => {
10608
10662
  if (T) return o(T);
10609
10663
  let E = new et(s3.file, { fd: c, start: D });
@@ -10611,16 +10665,16 @@ var go = (s3, t) => {
10611
10665
  });
10612
10666
  });
10613
10667
  };
10614
- import_node_fs10.default.open(s3.file, h, a);
10668
+ import_node_fs11.default.open(s3.file, h, a);
10615
10669
  });
10616
10670
  };
10617
10671
  var bo = (s3, t) => {
10618
10672
  t.forEach((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);
10673
+ e.charAt(0) === "@" ? Ct({ file: import_node_path14.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
10620
10674
  }), s3.end();
10621
10675
  };
10622
10676
  var _o = async (s3, t) => {
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);
10677
+ for (let e of t) e.charAt(0) === "@" ? await Ct({ file: import_node_path14.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
10624
10678
  s3.end();
10625
10679
  };
10626
10680
  var vt = K(yo, go, () => {
@@ -10672,7 +10726,7 @@ async function extractRuntimePackage(archive, destination) {
10672
10726
  if (violation) throw violation;
10673
10727
  }
10674
10728
  function validateRuntimeTree(root, expected) {
10675
- const pkg = JSON.parse((0, import_node_fs11.readFileSync)((0, import_node_path14.join)(root, "package.json"), "utf8"));
10729
+ const pkg = JSON.parse((0, import_node_fs12.readFileSync)((0, import_node_path15.join)(root, "package.json"), "utf8"));
10676
10730
  if (!CLI_PACKAGE_NAMES.includes(pkg.name ?? "") || !pkg.version || !pkg.sumiBuild || !BUILD_ID_PATTERN.test(pkg.sumiBuild)) {
10677
10731
  throw new Error("\u9700\u8981\u542B\u6784\u5EFA\u8EAB\u4EFD\u7684 pnpm pack:cli \u4EA7\u7269");
10678
10732
  }
@@ -10686,13 +10740,13 @@ function validateRuntimeTree(root, expected) {
10686
10740
 
10687
10741
  // src/launcher.ts
10688
10742
  function projectRoot(scriptPath) {
10689
- return (0, import_node_path15.resolve)((0, import_node_path15.dirname)(scriptPath), "../..");
10743
+ return (0, import_node_path16.resolve)((0, import_node_path16.dirname)(scriptPath), "../..");
10690
10744
  }
10691
10745
  function readManifest(repo) {
10692
- const path = (0, import_node_path15.join)(repo, RUNTIME_MANIFEST);
10746
+ const path = (0, import_node_path16.join)(repo, RUNTIME_MANIFEST);
10693
10747
  let value;
10694
10748
  try {
10695
- value = JSON.parse((0, import_node_fs12.readFileSync)(path, "utf8"));
10749
+ value = JSON.parse((0, import_node_fs13.readFileSync)(path, "utf8"));
10696
10750
  } catch (error) {
10697
10751
  throw new Error(`\u65E0\u6CD5\u8BFB\u53D6 runtime \u6E05\u5355 ${RUNTIME_MANIFEST}\uFF1A${error.message}`);
10698
10752
  }
@@ -10715,38 +10769,38 @@ function readManifest(repo) {
10715
10769
  function validRuntime(root, manifest) {
10716
10770
  try {
10717
10771
  validateRuntimeTree(root, { version: manifest.version, build: manifest.build });
10718
- return (0, import_node_fs12.existsSync)((0, import_node_path15.join)(root, "dist/bin.js"));
10772
+ return (0, import_node_fs13.existsSync)((0, import_node_path16.join)(root, "dist/bin.js"));
10719
10773
  } catch {
10720
10774
  return false;
10721
10775
  }
10722
10776
  }
10723
10777
  async function prepareRuntime(repo, manifest = readManifest(repo)) {
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}`);
10778
+ const archive = (0, import_node_path16.resolve)(repo, ...manifest.archive.split("/"));
10779
+ if (!(0, import_node_fs13.existsSync)(archive)) throw new Error(`\u627E\u4E0D\u5230\u9879\u76EE Sumi \u5B89\u88C5\u5305\uFF1A${manifest.archive}`);
10726
10780
  const archiveSha = fileSha256(archive);
10727
10781
  if (archiveSha !== manifest.archiveSha256) {
10728
10782
  throw new Error(`\u9879\u76EE Sumi \u5B89\u88C5\u5305 SHA-256 \u4E0D\u5339\u914D\uFF1A\u58F0\u660E ${manifest.archiveSha256}\uFF0C\u5B9E\u9645 ${archiveSha}`);
10729
10783
  }
10730
10784
  const hex = manifest.build.slice("sha256:".length);
10731
- const runtimeRoot = (0, import_node_path15.join)(repo, ".sumi/runtime");
10732
- const final = (0, import_node_path15.join)(runtimeRoot, hex);
10785
+ const runtimeRoot = (0, import_node_path16.join)(repo, ".sumi/runtime");
10786
+ const final = (0, import_node_path16.join)(runtimeRoot, hex);
10733
10787
  if (validRuntime(final, manifest)) return final;
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")}-`));
10788
+ (0, import_node_fs13.rmSync)(final, { recursive: true, force: true });
10789
+ (0, import_node_fs13.mkdirSync)(runtimeRoot, { recursive: true });
10790
+ const temporary = (0, import_node_fs13.mkdtempSync)((0, import_node_path16.join)(runtimeRoot, `.tmp-${hex}-${process.pid}-${(0, import_node_crypto4.randomBytes)(3).toString("hex")}-`));
10737
10791
  try {
10738
10792
  await extractRuntimePackage(archive, temporary);
10739
- const extracted = (0, import_node_path15.join)(temporary, "package");
10793
+ const extracted = (0, import_node_path16.join)(temporary, "package");
10740
10794
  if (!validRuntime(extracted, manifest)) throw new Error("\u89E3\u5305\u540E\u7684 Sumi runtime \u7248\u672C\u6216\u6784\u5EFA\u8EAB\u4EFD\u65E0\u6548");
10741
10795
  try {
10742
- (0, import_node_fs12.renameSync)(extracted, final);
10796
+ (0, import_node_fs13.renameSync)(extracted, final);
10743
10797
  } catch (error) {
10744
10798
  if (!validRuntime(final, manifest)) throw error;
10745
10799
  }
10746
10800
  if (!validRuntime(final, manifest)) throw new Error("Sumi runtime \u539F\u5B50\u5B89\u88C5\u540E\u6821\u9A8C\u5931\u8D25");
10747
10801
  return final;
10748
10802
  } finally {
10749
- (0, import_node_fs12.rmSync)(temporary, { recursive: true, force: true });
10803
+ (0, import_node_fs13.rmSync)(temporary, { recursive: true, force: true });
10750
10804
  }
10751
10805
  }
10752
10806
  function exitCode(code, signal) {
@@ -10757,7 +10811,7 @@ function exitCode(code, signal) {
10757
10811
  async function runLauncher(args = process.argv.slice(2), scriptPath = __filename) {
10758
10812
  const repo = projectRoot(scriptPath);
10759
10813
  const runtime = await prepareRuntime(repo);
10760
- const child = (0, import_node_child_process.spawn)(process.execPath, [(0, import_node_path15.join)(runtime, "dist/bin.js"), ...args], {
10814
+ const child = (0, import_node_child_process.spawn)(process.execPath, [(0, import_node_path16.join)(runtime, "dist/bin.js"), ...args], {
10761
10815
  cwd: process.cwd(),
10762
10816
  stdio: "inherit",
10763
10817
  windowsHide: true