@joshuafolkken/kit 1.1178.0 → 1.1240.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (442) hide show
  1. package/.claude/.claude-plugin/plugin.json +1 -1
  2. package/.claude/settings.json +2 -2
  3. package/.claude/skills/dependency-update/SKILL.md +4 -8
  4. package/.claude/skills/epic-commands/SKILL.md +2 -2
  5. package/.claude/skills/epic-commands/epic-bundle.md +1 -1
  6. package/.claude/skills/workflow-commands/SKILL.md +2 -4
  7. package/.claude/skills/workflow-commands/backlogrun-child.md +6 -4
  8. package/.claude/skills/workflow-commands/backlogrun-lanes.md +7 -3
  9. package/.claude/skills/workflow-commands/backlogrun-park.md +23 -2
  10. package/.claude/skills/workflow-commands/backlogrun-progress.md +9 -4
  11. package/.claude/skills/workflow-commands/backlogrun-recovery.md +4 -3
  12. package/.claude/skills/workflow-commands/backlogrun-steps.md +21 -13
  13. package/.claude/skills/workflow-commands/chain-rule.md +1 -1
  14. package/.claude/skills/workflow-commands/delegation.md +2 -2
  15. package/.claude/skills/workflow-commands/followup.md +10 -0
  16. package/.claude/skills/workflow-commands/fullrun-steps.md +1 -1
  17. package/.claude/skills/workflow-commands/halfrun.md +1 -1
  18. package/.claude/skills/workflow-commands/issue-scout.md +1 -1
  19. package/.claude/skills/workflow-commands/kickoff.md +2 -1
  20. package/.claude/skills/workflow-commands/latest-gate.md +1 -1
  21. package/.claude/skills/workflow-commands/observation-ledger.md +3 -3
  22. package/.claude/skills/workflow-commands/pre-gate-cut.md +6 -1
  23. package/.claude/skills/workflow-commands/prerequisite.md +2 -2
  24. package/.claude/skills/workflow-commands/progress-watcher.md +1 -1
  25. package/.claude/skills/workflow-commands/working-tree-hold.md +1 -1
  26. package/.codex/hooks.json +2 -2
  27. package/.cursorrules +6 -41
  28. package/.github/actions/setup-node/action.yml +1 -1
  29. package/.github/workflows/auto-tag.yml +3 -4
  30. package/.github/workflows/ci.yml +32 -31
  31. package/.github/workflows/dependabot-auto-merge.yml +13 -6
  32. package/.github/workflows/publish.yml +50 -4
  33. package/.github/workflows/sonar-qube.yml +3 -0
  34. package/.pnpmfile.mjs +4 -3
  35. package/.prettierignore +8 -2
  36. package/CLAUDE.md +18 -20
  37. package/README.md +44 -38
  38. package/SECURITY.md +15 -1
  39. package/dist/CLAUDE.md +18 -20
  40. package/dist/commands/document-section-cli.js +734 -0
  41. package/dist/hooks/audit-provision.js +346 -0
  42. package/dist/hooks/batch-guard.js +5 -4
  43. package/dist/hooks/{chunk-G6KRCKEC.js → chunk-4TZVB44A.js} +496 -378
  44. package/dist/hooks/chunk-5VNDSNG3.js +12 -0
  45. package/dist/hooks/chunk-CDY4NFQG.js +15 -0
  46. package/dist/hooks/chunk-ELCN5LCH.js +135 -0
  47. package/dist/hooks/{chunk-VQLLNFNT.js → chunk-F3ELQ2AF.js} +3 -3
  48. package/dist/hooks/{chunk-I4XSL4TT.js → chunk-GPTFMK5E.js} +1 -1
  49. package/dist/hooks/{chunk-3V37IID6.js → chunk-JBBMAPC4.js} +23 -14
  50. package/dist/hooks/{chunk-UAGLLIGZ.js → chunk-KHGB5S3Y.js} +7 -6
  51. package/dist/hooks/{chunk-GDS5N2KB.js → chunk-KHX4U3BG.js} +735 -683
  52. package/dist/hooks/{chunk-VESKRQOF.js → chunk-KRBERBBI.js} +3 -3
  53. package/dist/hooks/{chunk-DO6NWWHU.js → chunk-QVSWU24O.js} +4 -4
  54. package/dist/hooks/{chunk-S6X6WYKR.js → chunk-WK2XSHSI.js} +1643 -923
  55. package/dist/hooks/{chunk-ZAL3NRGL.js → chunk-XZYKEM6J.js} +25 -10
  56. package/dist/hooks/{chunk-32GQTL4F.js → chunk-ZQGD4GBY.js} +4 -2
  57. package/dist/hooks/codex-hook-adapter.js +14 -12
  58. package/dist/hooks/duplicate-read-guard.js +6 -5
  59. package/dist/hooks/format-edited.js +4 -3
  60. package/dist/hooks/inputs.json +203 -179
  61. package/dist/hooks/investigation-guard.js +6 -5
  62. package/dist/hooks/pretool-guard.js +12 -10
  63. package/dist/hooks/session-lang.js +2 -4
  64. package/dist/hooks/stop-guard.js +66 -72
  65. package/dist/josh.js +1088 -78
  66. package/dist/version/index.d.ts +7 -2
  67. package/dist/version/index.js +152 -75
  68. package/eslint/base.js +23 -1
  69. package/eslint/rules/code-quality.js +3 -0
  70. package/eslint/rules/early-return-one-liner.js +98 -0
  71. package/eslint/rules/unicorn.js +16 -1
  72. package/package.json +7 -6
  73. package/pnpm-workspace.yaml +9 -4
  74. package/prettier/basic.d.ts +3 -1
  75. package/prettier/index.d.ts +3 -1
  76. package/prettier/static.d.ts +3 -1
  77. package/prompts/coding-standards.md +1 -1
  78. package/prompts/collaboration-workflow/file-edits.md +4 -4
  79. package/prompts/collaboration-workflow/glossary.md +1 -1
  80. package/prompts/collaboration-workflow/issue-template.md +1 -0
  81. package/prompts/collaboration-workflow/operating-rules.md +17 -9
  82. package/prompts/collaboration-workflow/overview.md +2 -2
  83. package/prompts/collaboration-workflow/principles.md +14 -12
  84. package/prompts/collaboration-workflow/report-format.md +1 -1
  85. package/prompts/collaboration-workflow/residency.md +1 -1
  86. package/prompts/collaboration-workflow/rule-delivery.md +6 -6
  87. package/prompts/collaboration-workflow/shell-body.md +6 -6
  88. package/prompts/collaboration-workflow/turn-batching.md +1 -1
  89. package/prompts/collaboration-workflow/upstream-interrupt.md +12 -2
  90. package/prompts/collaboration-workflow/wip-cap.md +10 -10
  91. package/prompts/review-rubric.md +1 -2
  92. package/prompts/review.md +1 -1
  93. package/scripts/agent/agent-headless.ts +29 -0
  94. package/scripts/agent/agent-launch-environment.ts +6 -2
  95. package/scripts/agent/codex-agent-argv.ts +2 -1
  96. package/scripts/auto-ok/auto-ok-cli.ts +1 -1
  97. package/scripts/backlog/backlog-arrival.ts +3 -3
  98. package/scripts/backlog/backlog-budget.ts +1 -1
  99. package/scripts/backlog/backlog-drive-args.ts +135 -0
  100. package/scripts/backlog/backlog-drive-cli.ts +11 -137
  101. package/scripts/backlog/backlog-drive-launch.ts +39 -0
  102. package/scripts/backlog/backlog-drive-named-offer.ts +3 -5
  103. package/scripts/backlog/backlog-drive-named.ts +3 -3
  104. package/scripts/backlog/backlog-drive-offer-argv.ts +1 -1
  105. package/scripts/backlog/backlog-drive-owner.ts +1 -1
  106. package/scripts/backlog/backlog-drive-restore.ts +1 -1
  107. package/scripts/backlog/backlog-drive-retrospective.ts +1 -1
  108. package/scripts/backlog/backlog-drive.ts +1 -1
  109. package/scripts/backlog/backlog-next.ts +16 -5
  110. package/scripts/backlog/backlog-offer-cli.ts +6 -6
  111. package/scripts/backlog/backlog-offer.ts +1 -1
  112. package/scripts/backlog/backlog-plan-cli.ts +1 -1
  113. package/scripts/backlog/backlog-pool.ts +57 -11
  114. package/scripts/backlog/backlog-ready.ts +1 -1
  115. package/scripts/backlog/backlog-scope.ts +1 -1
  116. package/scripts/backlog/backlog-stalled-detect.ts +2 -2
  117. package/scripts/backlog/backlog-stalled.ts +1 -1
  118. package/scripts/build/build-codex-hooks.ts +3 -1
  119. package/scripts/build/build-commands.ts +66 -0
  120. package/scripts/build/build-hooks.ts +2 -1
  121. package/scripts/build/build-library.ts +12 -3
  122. package/scripts/build/build.ts +70 -0
  123. package/scripts/build/local-bin.ts +3 -13
  124. package/scripts/delegation/investigation-reads.ts +3 -1
  125. package/scripts/discovery/repo-origin.ts +5 -5
  126. package/scripts/doctor/doctor-consumer.ts +2 -2
  127. package/scripts/doctor/doctor-io.ts +2 -3
  128. package/scripts/document/capped-print-part.ts +30 -0
  129. package/scripts/document/capped-print.ts +3 -4
  130. package/scripts/document/document-byte-budget.ts +11 -2
  131. package/scripts/document/document-scan.ts +117 -0
  132. package/scripts/document/document-section.ts +143 -16
  133. package/scripts/document/entry-read-budget.ts +5 -3
  134. package/scripts/document/entry-read-set.ts +10 -89
  135. package/scripts/document/read-set-cost.ts +98 -0
  136. package/scripts/epic/epic-add-body.ts +1 -0
  137. package/scripts/epic/epic-audit-checks.ts +1 -1
  138. package/scripts/epic/epic-audit-rationale.ts +4 -3
  139. package/scripts/epic/epic-bundle-cli.ts +14 -3
  140. package/scripts/epic/epic-bundle-poll.ts +41 -0
  141. package/scripts/epic/epic-busy.ts +1 -1
  142. package/scripts/epic/epic-candidate-confirm.ts +3 -2
  143. package/scripts/epic/epic-classify.ts +1 -1
  144. package/scripts/epic/epic-cli-argv.ts +78 -46
  145. package/scripts/epic/epic-cli-remove.ts +11 -19
  146. package/scripts/epic/epic-cli.ts +74 -73
  147. package/scripts/epic/epic-close-comment.ts +1 -1
  148. package/scripts/epic/epic-close.ts +1 -1
  149. package/scripts/epic/epic-cross-repo.ts +5 -5
  150. package/scripts/epic/epic-graph.ts +1 -1
  151. package/scripts/epic/epic-index.ts +1 -1
  152. package/scripts/epic/epic-issue.ts +2 -6
  153. package/scripts/epic/epic-lane-offer.ts +2 -2
  154. package/scripts/epic/epic-next.ts +29 -42
  155. package/scripts/epic/epic-solo-stale.ts +1 -1
  156. package/scripts/epic/epic-triage.ts +8 -4
  157. package/scripts/epic/epic-validate.ts +1 -1
  158. package/scripts/followup/git-followup-finish.ts +2 -2
  159. package/scripts/followup/git-followup-label.ts +2 -2
  160. package/scripts/followup/git-followup-merged.ts +2 -2
  161. package/scripts/followup/git-pr-followup-checks.ts +142 -0
  162. package/scripts/followup/git-pr-followup.ts +4 -129
  163. package/scripts/gate/core-admission.ts +162 -0
  164. package/scripts/gate/core-budget.ts +190 -68
  165. package/scripts/gate/gate-plan.ts +80 -7
  166. package/scripts/gate/gate-report.ts +28 -9
  167. package/scripts/gate/gate-skip.ts +38 -7
  168. package/scripts/gate/hook-gate-reuse.ts +12 -10
  169. package/scripts/gate/machine-capacity.ts +175 -0
  170. package/scripts/gate/pre-commit-type-check.ts +4 -1
  171. package/scripts/gate/project-checks.ts +6 -9
  172. package/scripts/gate/type-check-step.ts +2 -3
  173. package/scripts/gate/verification-gate.ts +34 -10
  174. package/scripts/gh/git-gh-api-path.ts +2 -2
  175. package/scripts/gh/git-gh-issue-rest.ts +3 -3
  176. package/scripts/gh/git-gh-issue-write.ts +53 -7
  177. package/scripts/gh/git-gh-pr-read.ts +64 -19
  178. package/scripts/gh/git-gh-pr-rest.ts +1 -1
  179. package/scripts/gh/git-gh-pr.ts +5 -1
  180. package/scripts/gh/git-pr-ai-review.ts +1 -1
  181. package/scripts/gh/git-pr-checks-eval.ts +1 -3
  182. package/scripts/gh/git-pr-checks-parse.ts +1 -1
  183. package/scripts/gh/git-pr-checks-watch.ts +6 -5
  184. package/scripts/gh/git-pr-checks.ts +7 -5
  185. package/scripts/gh/git-pr-coderabbit.ts +1 -1
  186. package/scripts/gh/git-pr-error.ts +1 -3
  187. package/scripts/gh/git-pr.ts +9 -13
  188. package/scripts/gh/github-issue-url.ts +2 -2
  189. package/scripts/git/constants.ts +2 -6
  190. package/scripts/git/git-command.ts +20 -218
  191. package/scripts/git/git-diff-reads.ts +225 -0
  192. package/scripts/git/git-error.ts +4 -12
  193. package/scripts/git/git-pre-push-hook.ts +139 -0
  194. package/scripts/git/git-prompt.ts +2 -6
  195. package/scripts/git/git-spawn-sync.ts +3 -1
  196. package/scripts/git/git-spawn.ts +1 -1
  197. package/scripts/git/git-staging.ts +4 -6
  198. package/scripts/git/git-status.ts +3 -9
  199. package/scripts/hooks/codex-hook-adapter.ts +1 -1
  200. package/scripts/hooks/edited-cspell.ts +2 -4
  201. package/scripts/hooks/format-edited-file.ts +3 -12
  202. package/scripts/hooks/pre-push-unit.ts +31 -9
  203. package/scripts/hooks/reserved-run.ts +2 -2
  204. package/scripts/hooks/run-hook.sh +5 -4
  205. package/scripts/hooks/stop-guard.ts +5 -3
  206. package/scripts/init/init-actions.ts +0 -5
  207. package/scripts/init/init-ai-copy.ts +13 -2
  208. package/scripts/init/init-logic-json-merge.ts +19 -0
  209. package/scripts/init/init-logic-secretlint.ts +7 -7
  210. package/scripts/init/init-logic-workspace.ts +41 -2
  211. package/scripts/init/init-logic.ts +16 -26
  212. package/scripts/init/init.ts +10 -16
  213. package/scripts/init/initial-commit.ts +4 -4
  214. package/scripts/init/kit-development-versions.ts +40 -0
  215. package/scripts/init/kit-setup-state.ts +2 -2
  216. package/scripts/init/package-manager-pin.ts +35 -0
  217. package/scripts/init/start-exec.ts +68 -19
  218. package/scripts/init/start-setup-pr.ts +9 -9
  219. package/scripts/init/start-steps.ts +6 -10
  220. package/scripts/issue/defect-rate-cli.ts +1 -1
  221. package/scripts/issue/git-next-issues.ts +1 -1
  222. package/scripts/issue/issue-auto-ok.ts +32 -7
  223. package/scripts/issue/issue-backlinks-cli.ts +2 -2
  224. package/scripts/issue/issue-backlinks.ts +9 -9
  225. package/scripts/issue/issue-comment-cli.ts +19 -13
  226. package/scripts/issue/issue-file-cli.ts +72 -22
  227. package/scripts/issue/issue-file.ts +29 -1
  228. package/scripts/issue/issue-labels.ts +13 -0
  229. package/scripts/issue/issue-release-cli.ts +155 -0
  230. package/scripts/issue/issue-release.ts +58 -0
  231. package/scripts/issue/issue-scout-closed.ts +1 -1
  232. package/scripts/issue/issue-state-cli.ts +30 -74
  233. package/scripts/josh/josh-command-map.ts +2 -0
  234. package/scripts/josh/josh-command-types.ts +14 -0
  235. package/scripts/josh/josh-commands-ai.ts +4 -4
  236. package/scripts/josh/josh-commands-backlog.ts +4 -1
  237. package/scripts/josh/josh-commands-development.ts +18 -0
  238. package/scripts/josh/josh-commands-document.ts +1 -0
  239. package/scripts/josh/josh-commands-issue.ts +8 -1
  240. package/scripts/josh/josh-commands-lane.ts +24 -1
  241. package/scripts/josh/josh-commands-maintenance.ts +6 -6
  242. package/scripts/josh/josh-commands-run.ts +12 -7
  243. package/scripts/josh/josh-in-process.ts +28 -9
  244. package/scripts/josh/josh-logic.ts +34 -15
  245. package/scripts/josh/process-identity.ts +1 -3
  246. package/scripts/josh/session-language-cli.ts +3 -4
  247. package/scripts/lane/lane-await.ts +5 -1
  248. package/scripts/lane/lane-child-invocation.ts +2 -2
  249. package/scripts/lane/lane-cli.ts +12 -4
  250. package/scripts/lane/lane-dispatch.ts +14 -10
  251. package/scripts/lane/lane-environment.ts +5 -1
  252. package/scripts/lane/lane-handoff.ts +1 -1
  253. package/scripts/lane/lane-install.ts +2 -13
  254. package/scripts/lane/lane-launch-cli.ts +15 -1
  255. package/scripts/lane/lane-ledger.ts +145 -0
  256. package/scripts/lane/lane-leftover.ts +44 -30
  257. package/scripts/lane/lane-load.ts +108 -0
  258. package/scripts/lane/lane-measure-cli.ts +149 -0
  259. package/scripts/lane/lane-occupancy.ts +3 -0
  260. package/scripts/lane/lane-open.ts +5 -5
  261. package/scripts/lane/lane-paths.ts +13 -0
  262. package/scripts/lane/lane-reap.ts +1 -3
  263. package/scripts/lane/lane-registry.ts +11 -0
  264. package/scripts/lane/lane-relaunch.ts +1 -1
  265. package/scripts/lane/lane-stats.ts +224 -0
  266. package/scripts/lane/lane-stray.ts +140 -0
  267. package/scripts/lane/lane-vacant.ts +36 -0
  268. package/scripts/lane/openai-lane-ship.ts +2 -2
  269. package/scripts/lane/openai-lane-supervisor-owner.ts +180 -0
  270. package/scripts/lane/openai-lane-supervisor.ts +7 -165
  271. package/scripts/lane/openai-review-broker.ts +2 -4
  272. package/scripts/lib/ancestor-directories.ts +35 -0
  273. package/scripts/lib/animation-helpers.ts +2 -2
  274. package/scripts/lib/buffered-process.ts +3 -7
  275. package/scripts/lib/cli-flags.ts +71 -1
  276. package/scripts/lib/spawn-exit.ts +2 -2
  277. package/scripts/lib/timeouts.ts +35 -2
  278. package/scripts/lines/line-budget.ts +4 -6
  279. package/scripts/notify/telegram-test.ts +6 -0
  280. package/scripts/observations/observation-ledger-line.ts +6 -6
  281. package/scripts/observations/observation-ledger-migrate.ts +55 -4
  282. package/scripts/observations/observation-ledger.ts +26 -7
  283. package/scripts/overrides/lockfile-overrides.ts +1 -1
  284. package/scripts/overrides/overrides-logic.ts +1 -1
  285. package/scripts/propagate/propagate-git.ts +1 -1
  286. package/scripts/propagate/propagate-publish.ts +2 -2
  287. package/scripts/propagate/propagate-steps.ts +20 -15
  288. package/scripts/propagate/propagate.ts +36 -27
  289. package/scripts/refactor/import-graph.ts +18 -1
  290. package/scripts/refactor/refactor-lint.ts +4 -4
  291. package/scripts/release/github-release-environment.ts +1 -0
  292. package/scripts/release/github-release-runs.ts +115 -0
  293. package/scripts/release/github-release.ts +13 -67
  294. package/scripts/repo/repository-labels.ts +2 -2
  295. package/scripts/repo/required-checks-logic.ts +1 -3
  296. package/scripts/review/live-evidence.ts +2 -4
  297. package/scripts/review/review-brief-cli.ts +1 -1
  298. package/scripts/review/review-finding-ledger.ts +1 -1
  299. package/scripts/review/review-findings-cli.ts +1 -3
  300. package/scripts/rules/decision-oracle-batch.ts +128 -0
  301. package/scripts/rules/decision-oracle-tokens.ts +21 -0
  302. package/scripts/rules/decision-oracle.ts +8 -120
  303. package/scripts/rules/delivered-rules.ts +26 -182
  304. package/scripts/rules/direct-filing.ts +1 -1
  305. package/scripts/rules/early-heartbeat.ts +3 -3
  306. package/scripts/rules/git-argv.ts +1 -1
  307. package/scripts/rules/git-force.ts +1 -1
  308. package/scripts/rules/implementation-cut.ts +2 -2
  309. package/scripts/rules/index-guard.ts +1 -1
  310. package/scripts/rules/issue-comments.ts +118 -0
  311. package/scripts/rules/{issue-fold.ts → issue-fold-rule.ts} +2 -2
  312. package/scripts/rules/lane-background.ts +2 -2
  313. package/scripts/rules/lane-park.ts +18 -0
  314. package/scripts/rules/lane-split-park.ts +128 -0
  315. package/scripts/rules/oracle-firing.ts +1 -1
  316. package/scripts/rules/poll-loop.ts +1 -1
  317. package/scripts/rules/pre-gate-cut.ts +1 -1
  318. package/scripts/rules/protected-files.ts +59 -4
  319. package/scripts/rules/{run-tail.ts → run-tail-rule.ts} +2 -2
  320. package/scripts/rules/shell-body-trigger.ts +1 -1
  321. package/scripts/rules/stop-rules.ts +18 -7
  322. package/scripts/rules/test-declared-commit.ts +4 -4
  323. package/scripts/rules/wip-cap.ts +63 -0
  324. package/scripts/run/{run-carry-args.ts → carry/run-carry-args.ts} +37 -13
  325. package/scripts/run/{run-carry-change.ts → carry/run-carry-change.ts} +29 -7
  326. package/scripts/run/{run-carry-cli.ts → carry/run-carry-cli.ts} +4 -6
  327. package/scripts/run/{run-carry.ts → carry/run-carry.ts} +1 -1
  328. package/scripts/run/{run-cut-args.ts → cut/run-cut-args.ts} +1 -1
  329. package/scripts/run/{run-cut-cli.ts → cut/run-cut-cli.ts} +18 -5
  330. package/scripts/run/{run-cut.ts → cut/run-cut.ts} +1 -1
  331. package/scripts/run/{run-entry-cli.ts → entry/run-entry-cli.ts} +11 -11
  332. package/scripts/run/{run-entry.ts → entry/run-entry.ts} +2 -2
  333. package/scripts/run/{run-event-render.ts → event/run-event-render.ts} +1 -0
  334. package/scripts/run/{run-event-scope.ts → event/run-event-scope.ts} +1 -1
  335. package/scripts/run/{run-event-stream-emit.ts → event/run-event-stream-emit.ts} +1 -1
  336. package/scripts/run/{run-event-stream.ts → event/run-event-stream.ts} +20 -2
  337. package/scripts/run/{run-hold-cli.ts → hold/run-hold-cli.ts} +5 -5
  338. package/scripts/run/{run-merge-cli.ts → merge/run-merge-cli.ts} +10 -5
  339. package/scripts/run/{run-merge-steps.ts → merge/run-merge-steps.ts} +53 -5
  340. package/scripts/run/{run-merge.ts → merge/run-merge.ts} +1 -1
  341. package/scripts/run/{run-progress-cli.ts → progress/run-progress-cli.ts} +1 -1
  342. package/scripts/run/{run-progress-config.ts → progress/run-progress-config.ts} +2 -17
  343. package/scripts/run/{run-progress-read.ts → progress/run-progress-read.ts} +5 -5
  344. package/scripts/run/{run-progress.ts → progress/run-progress.ts} +1 -1
  345. package/scripts/run/{run-review-steps.ts → review/run-review-steps.ts} +2 -3
  346. package/scripts/run/run-ending.ts +2 -2
  347. package/scripts/run/run-halfrun-resume.ts +6 -1
  348. package/scripts/run/run-headless.ts +1 -1
  349. package/scripts/run/run-invocation.ts +85 -84
  350. package/scripts/run/run-liveness.ts +1 -1
  351. package/scripts/run/run-parent-cut-hook.ts +1 -1
  352. package/scripts/run/run-preflight.ts +6 -6
  353. package/scripts/run/run-prep-cli.ts +1 -1
  354. package/scripts/run/run-prrun-resume.ts +1 -1
  355. package/scripts/run/run-report-cli.ts +4 -4
  356. package/scripts/run/run-report.ts +2 -2
  357. package/scripts/run/run-status-cli.ts +1 -1
  358. package/scripts/run/run-step-cli.ts +3 -3
  359. package/scripts/run/run-step.ts +7 -4
  360. package/scripts/run/run-stop-notify.ts +1 -1
  361. package/scripts/run/run-stranded-detect.ts +4 -4
  362. package/scripts/run/run-stranded.ts +2 -2
  363. package/scripts/run/run-watcher-guard-cli.ts +1 -1
  364. package/scripts/run/run-watcher-guard.ts +5 -3
  365. package/scripts/run/run-watcher-hook.ts +1 -1
  366. package/scripts/run/{run-ship-cli.ts → ship/run-ship-cli.ts} +2 -2
  367. package/scripts/run/{run-ship-detach.ts → ship/run-ship-detach.ts} +3 -3
  368. package/scripts/run/ship/run-ship-lock.ts +50 -0
  369. package/scripts/run/{run-ship-preflight.ts → ship/run-ship-preflight.ts} +6 -2
  370. package/scripts/run/{run-ship-probe.ts → ship/run-ship-probe.ts} +2 -2
  371. package/scripts/run/{run-ship-return.ts → ship/run-ship-return.ts} +4 -3
  372. package/scripts/run/{run-ship-review-steps.ts → ship/run-ship-review-steps.ts} +3 -3
  373. package/scripts/run/{run-ship-scoped.ts → ship/run-ship-scoped.ts} +10 -1
  374. package/scripts/run/{run-ship-steps.ts → ship/run-ship-steps.ts} +11 -12
  375. package/scripts/run/ship/run-ship-stop-text.ts +13 -0
  376. package/scripts/run/{run-ship-sync.ts → ship/run-ship-sync.ts} +25 -11
  377. package/scripts/run/{run-tidy-lanes.ts → tidy/run-tidy-lanes.ts} +1 -1
  378. package/scripts/run/{run-wake-cli.ts → wake/run-wake-cli.ts} +25 -11
  379. package/scripts/run/{run-wake-describe.ts → wake/run-wake-describe.ts} +58 -7
  380. package/scripts/run/{run-wake-driver.ts → wake/run-wake-driver.ts} +59 -8
  381. package/scripts/run/{run-wake-handoff.ts → wake/run-wake-handoff.ts} +1 -1
  382. package/scripts/run/{run-wake-loop.ts → wake/run-wake-loop.ts} +13 -15
  383. package/scripts/run/wake/run-wake-restart.ts +58 -0
  384. package/scripts/run/{run-wake-session.ts → wake/run-wake-session.ts} +3 -3
  385. package/scripts/run/{run-wake.ts → wake/run-wake.ts} +16 -65
  386. package/scripts/safe-chain/preinstall-command.ts +20 -21
  387. package/scripts/safe-chain/project-config.ts +19 -15
  388. package/scripts/sync/sync-ai-files.ts +1 -1
  389. package/scripts/sync/sync-configs.ts +2 -1
  390. package/scripts/sync/sync.ts +15 -2
  391. package/scripts/test/unit-worker-share.ts +1 -0
  392. package/scripts/time-runtime/time-background.ts +5 -1
  393. package/scripts/time-runtime/time-instant.ts +3 -1
  394. package/scripts/time-runtime/time-spans.ts +6 -139
  395. package/scripts/time-runtime/time-tool-call.ts +160 -0
  396. package/scripts/version/effective-upstream.ts +2 -20
  397. package/scripts/version/latest-corepack.ts +124 -93
  398. package/scripts/version/latest-regression.ts +1 -1
  399. package/scripts/version/latest-update.ts +4 -4
  400. package/scripts/version/npm-registry.ts +20 -5
  401. package/scripts/version/publishable-range-check.ts +2 -2
  402. package/scripts/version/publishable-range.ts +1 -1
  403. package/scripts/version/release-age.ts +48 -38
  404. package/scripts/version/release-hold.ts +1 -1
  405. package/scripts/version/safe-chain-version-update.ts +40 -0
  406. package/scripts/version/upgrade-shell-command.ts +48 -8
  407. package/scripts/version/version-check-logic.ts +23 -14
  408. package/scripts/version/version-commands.ts +23 -11
  409. package/scripts/version/version-remote.ts +28 -13
  410. package/templates/pnpm-workspace.basic.yaml +4 -0
  411. package/templates/workflows/dependabot-auto-merge.yml +5 -5
  412. package/templates/workflows/github-release.yml +6 -0
  413. package/scripts/build/build-config-merge.ts +0 -27
  414. package/scripts/build/build-managed-marker.ts +0 -27
  415. package/scripts/build/build-self-sync-guard.ts +0 -27
  416. package/scripts/build/build-version.ts +0 -26
  417. package/scripts/version/preinstall-version-update.ts +0 -86
  418. /package/scripts/git/{schemas.ts → git-schemas.ts} +0 -0
  419. /package/scripts/overrides/{schemas.ts → overrides-schemas.ts} +0 -0
  420. /package/scripts/run/{run-carry-conversation.ts → carry/run-carry-conversation.ts} +0 -0
  421. /package/scripts/run/{run-carry-reclaim.ts → carry/run-carry-reclaim.ts} +0 -0
  422. /package/scripts/run/{run-carry-stash.ts → carry/run-carry-stash.ts} +0 -0
  423. /package/scripts/run/{run-carry-streak.ts → carry/run-carry-streak.ts} +0 -0
  424. /package/scripts/run/{run-cut-handoff.ts → cut/run-cut-handoff.ts} +0 -0
  425. /package/scripts/run/{run-cut-report.ts → cut/run-cut-report.ts} +0 -0
  426. /package/scripts/run/{run-entry-stop.ts → entry/run-entry-stop.ts} +0 -0
  427. /package/scripts/run/{run-event-cli.ts → event/run-event-cli.ts} +0 -0
  428. /package/scripts/run/{run-event-follow.ts → event/run-event-follow.ts} +0 -0
  429. /package/scripts/run/{run-event-watch.ts → event/run-event-watch.ts} +0 -0
  430. /package/scripts/run/{run-hold.ts → hold/run-hold.ts} +0 -0
  431. /package/scripts/run/{run-progress-args.ts → progress/run-progress-args.ts} +0 -0
  432. /package/scripts/run/{run-progress-clock.ts → progress/run-progress-clock.ts} +0 -0
  433. /package/scripts/run/{run-review-cli.ts → review/run-review-cli.ts} +0 -0
  434. /package/scripts/run/{run-review.ts → review/run-review.ts} +0 -0
  435. /package/scripts/run/{run-ship-next.ts → ship/run-ship-next.ts} +0 -0
  436. /package/scripts/run/{run-ship-pre-detach.ts → ship/run-ship-pre-detach.ts} +0 -0
  437. /package/scripts/run/{run-ship-review.ts → ship/run-ship-review.ts} +0 -0
  438. /package/scripts/run/{run-ship-stage.ts → ship/run-ship-stage.ts} +0 -0
  439. /package/scripts/run/{run-ship.ts → ship/run-ship.ts} +0 -0
  440. /package/scripts/run/{run-tidy-cli.ts → tidy/run-tidy-cli.ts} +0 -0
  441. /package/scripts/run/{run-tidy-stashes.ts → tidy/run-tidy-stashes.ts} +0 -0
  442. /package/scripts/run/{run-tidy.ts → tidy/run-tidy.ts} +0 -0
@@ -37,6 +37,11 @@ declare const kit_package_descriptor: UpstreamDescriptor;
37
37
 
38
38
  type InstalledVersions = ReadonlyMap<string, string | undefined>;
39
39
 
40
+ interface UpgradeCommand {
41
+ text: string;
42
+ steps: ReadonlyArray<ReadonlyArray<string>>;
43
+ }
44
+
40
45
  interface VersionSnapshot {
41
46
  global_version: string | undefined;
42
47
  project_version: string | undefined;
@@ -76,8 +81,8 @@ declare function read_snapshot(config: VersionCommandConfig): VersionSnapshot;
76
81
  declare function build_extras(config: VersionCommandConfig): VersionOutputExtras;
77
82
  declare function read_upstream_reports(config: VersionCommandConfig, snapshot: VersionSnapshot, is_hold_wanted?: boolean): Array<UpstreamReport>;
78
83
  declare function run_check(config: VersionCommandConfig): void;
79
- declare function run_upgrade_command(command: string): number;
80
- declare function run_all_upgrade_commands(commands: ReadonlyArray<string>): number;
84
+ declare function run_upgrade_command(command: UpgradeCommand): number;
85
+ declare function run_all_upgrade_commands(commands: ReadonlyArray<UpgradeCommand>): number;
81
86
  declare function run_upgrade(config: VersionCommandConfig): number;
82
87
  declare const version_commands: {
83
88
  read_snapshot: typeof read_snapshot;
@@ -64,7 +64,24 @@ function create_version_command_config(options) {
64
64
  // scripts/version/effective-upstream.ts
65
65
  import { existsSync, readFileSync } from "node:fs";
66
66
  import { createRequire } from "node:module";
67
+ import path2 from "node:path";
68
+
69
+ // scripts/lib/ancestor-directories.ts
67
70
  import path from "node:path";
71
+ var MAX_DEPTH = 64;
72
+ function list(start_directory) {
73
+ const directories = [];
74
+ let current = path.resolve(start_directory);
75
+ while (directories.length < MAX_DEPTH && !directories.includes(current)) {
76
+ directories.push(current);
77
+ current = path.dirname(current);
78
+ }
79
+ return directories;
80
+ }
81
+ function nearest(start_directory, is_match) {
82
+ return list(start_directory).find((directory) => is_match(directory));
83
+ }
84
+ var ancestor_directories = { list, nearest };
68
85
 
69
86
  // scripts/lib/json-value.ts
70
87
  function parse_or_undefined(text) {
@@ -113,7 +130,6 @@ var string_record_schema = z.record(z.string(), z.string());
113
130
 
114
131
  // scripts/version/effective-upstream.ts
115
132
  var PACKAGE_JSON = "package.json";
116
- var MAX_WALK_DEPTH = 64;
117
133
  function read_matching_version(manifest_path, package_name) {
118
134
  if (!existsSync(manifest_path)) return void 0;
119
135
  const parsed = package_named_version_schema.safeParse(
@@ -123,20 +139,9 @@ function read_matching_version(manifest_path, package_name) {
123
139
  if (parsed.data.name !== package_name) return void 0;
124
140
  return parsed.data.version;
125
141
  }
126
- function ancestor_directories(start_directory) {
127
- const directories = [];
128
- let current = start_directory;
129
- for (let depth = 0; depth < MAX_WALK_DEPTH; depth += 1) {
130
- directories.push(current);
131
- const parent = path.dirname(current);
132
- if (parent === current) break;
133
- current = parent;
134
- }
135
- return directories;
136
- }
137
142
  function walk_up_for_version(start_directory, package_name) {
138
- for (const directory of ancestor_directories(start_directory)) {
139
- const version = read_matching_version(path.join(directory, PACKAGE_JSON), package_name);
143
+ for (const directory of ancestor_directories.list(start_directory)) {
144
+ const version = read_matching_version(path2.join(directory, PACKAGE_JSON), package_name);
140
145
  if (version !== void 0) return version;
141
146
  }
142
147
  return void 0;
@@ -151,28 +156,67 @@ function resolve_from_base(base_url, package_name, resolve_marker) {
151
156
  function resolve_effective_upstream_version(base_url, package_name, options = {}) {
152
157
  const resolved = resolve_from_base(base_url, package_name, options.resolve_marker);
153
158
  if (resolved === void 0) return void 0;
154
- return walk_up_for_version(path.dirname(resolved), package_name);
159
+ return walk_up_for_version(path2.dirname(resolved), package_name);
155
160
  }
156
161
 
162
+ // scripts/lib/timeouts.ts
163
+ var FETCH_TIMEOUT_MS = 1e4;
164
+ var COMMAND_TIMEOUT_MS = 3e4;
165
+ var INSTALL_TIMEOUT_MS = 6e5;
166
+
157
167
  // scripts/version/version-commands.ts
158
168
  import { execaSync as execaSync4 } from "execa";
159
169
 
160
170
  // scripts/version/release-age.ts
161
171
  import { readFileSync as readFileSync2 } from "node:fs";
162
- import path2 from "node:path";
172
+ import path3 from "node:path";
173
+
174
+ // scripts/lib/yaml-document.ts
175
+ import { load, loadAll, YAMLException } from "js-yaml";
176
+ var EMPTY_YAML_REASON = "expected a document, but the input is empty";
177
+ function load_yaml_or_empty(content) {
178
+ try {
179
+ return load(content);
180
+ } catch (error) {
181
+ if (error instanceof YAMLException && error.reason === EMPTY_YAML_REASON) return {};
182
+ throw error;
183
+ }
184
+ }
185
+ function parse_yaml(content) {
186
+ const raw = load_yaml_or_empty(content);
187
+ if (raw === null || raw === void 0) return {};
188
+ return json_object_schema.parse(raw);
189
+ }
190
+ function is_mapping_document(value) {
191
+ return json_value.is_record(value);
192
+ }
193
+ function parse_yaml_documents(content) {
194
+ if (content.trim().length === 0) return [];
195
+ return loadAll(content).filter(is_mapping_document);
196
+ }
197
+ var yaml_document = { is_mapping_document, parse_yaml, parse_yaml_documents };
198
+
199
+ // scripts/version/release-age.ts
163
200
  import semver from "semver";
164
201
  import { z as z2 } from "zod";
165
- var MINIMUM_RELEASE_AGE_RE = /^minimum-release-age\s*=\s*(\d+)\s*$/mu;
166
202
  var NO_QUARANTINE_MINUTES = 0;
167
- var NPMRC_PATH = ".npmrc";
203
+ var WORKSPACE_PATH = "pnpm-workspace.yaml";
204
+ var workspace_age_schema = z2.object({ minimumReleaseAge: z2.number().int().nonnegative() });
168
205
  var release_times_schema = z2.record(z2.string(), z2.string());
169
206
  var MS_PER_MINUTE = 6e4;
170
- function parse_declared_minimum_release_age(npmrc_content) {
171
- const raw = MINIMUM_RELEASE_AGE_RE.exec(npmrc_content)?.[1];
172
- return raw === void 0 ? void 0 : Number(raw);
207
+ function parse_workspace(workspace_content) {
208
+ try {
209
+ return yaml_document.parse_yaml(workspace_content);
210
+ } catch {
211
+ return void 0;
212
+ }
173
213
  }
174
- function parse_minimum_release_age(npmrc_content) {
175
- return parse_declared_minimum_release_age(npmrc_content) ?? NO_QUARANTINE_MINUTES;
214
+ function parse_declared_minimum_release_age(workspace_content) {
215
+ const parsed = workspace_age_schema.safeParse(parse_workspace(workspace_content));
216
+ return parsed.success ? parsed.data.minimumReleaseAge : void 0;
217
+ }
218
+ function parse_minimum_release_age(workspace_content) {
219
+ return parse_declared_minimum_release_age(workspace_content) ?? NO_QUARANTINE_MINUTES;
176
220
  }
177
221
  function is_on_major(version, major) {
178
222
  return major === void 0 || String(semver.major(version)) === major;
@@ -189,25 +233,25 @@ function select_aged_version(times, major, minimum_age_minutes, now_ms) {
189
233
  const eligible = Object.entries(times).filter(([version, published_at]) => is_eligible(version, published_at, major, cutoff_ms)).map(([version]) => version).toSorted(semver.rcompare);
190
234
  return eligible[0];
191
235
  }
192
- function read_declared_minimum_release_age(npmrc_path) {
236
+ function read_declared_minimum_release_age(workspace_path) {
193
237
  try {
194
- return parse_declared_minimum_release_age(readFileSync2(npmrc_path, "utf8"));
238
+ return parse_declared_minimum_release_age(readFileSync2(workspace_path, "utf8"));
195
239
  } catch {
196
240
  return void 0;
197
241
  }
198
242
  }
199
- function read_minimum_release_age(npmrc_path = NPMRC_PATH) {
200
- return read_declared_minimum_release_age(npmrc_path) ?? NO_QUARANTINE_MINUTES;
243
+ function read_minimum_release_age(workspace_path = WORKSPACE_PATH) {
244
+ return read_declared_minimum_release_age(workspace_path) ?? NO_QUARANTINE_MINUTES;
201
245
  }
202
246
  function find_declared_minimum_release_age(start, boundary) {
203
- const declared = read_declared_minimum_release_age(path2.join(start, NPMRC_PATH));
247
+ const declared = read_declared_minimum_release_age(path3.join(start, WORKSPACE_PATH));
204
248
  if (declared !== void 0) return declared;
205
249
  if (start === boundary) return void 0;
206
- const parent = path2.dirname(start);
250
+ const parent = path3.dirname(start);
207
251
  return parent === start ? void 0 : find_declared_minimum_release_age(parent, boundary);
208
252
  }
209
253
  function read_nearest_minimum_release_age(start, boundary) {
210
- return find_declared_minimum_release_age(path2.resolve(start), boundary) ?? NO_QUARANTINE_MINUTES;
254
+ return find_declared_minimum_release_age(path3.resolve(start), boundary) ?? NO_QUARANTINE_MINUTES;
211
255
  }
212
256
  var release_age = {
213
257
  release_times_schema,
@@ -270,14 +314,14 @@ var release_hold = {
270
314
 
271
315
  // scripts/version/running-binary.ts
272
316
  import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
273
- import path3 from "node:path";
317
+ import path4 from "node:path";
274
318
  var PACKAGE_JSON2 = "package.json";
275
319
  var SCRIPT_DEPTH_FROM_ROOT = ["..", ".."];
276
320
  function resolve_self_package_path(self_directory) {
277
- return path3.join(self_directory, ...SCRIPT_DEPTH_FROM_ROOT, PACKAGE_JSON2);
321
+ return path4.join(self_directory, ...SCRIPT_DEPTH_FROM_ROOT, PACKAGE_JSON2);
278
322
  }
279
323
  function running_package_directory(self_directory) {
280
- return path3.resolve(self_directory, ...SCRIPT_DEPTH_FROM_ROOT);
324
+ return path4.resolve(self_directory, ...SCRIPT_DEPTH_FROM_ROOT);
281
325
  }
282
326
  function read_running_version(self_directory) {
283
327
  const package_path = resolve_self_package_path(self_directory);
@@ -311,16 +355,26 @@ function is_no_op_upgrade_command(command, installed) {
311
355
  }
312
356
 
313
357
  // scripts/version/upgrade-shell-command.ts
358
+ var STEP_SEPARATOR = " && ";
314
359
  function update_scope_flag(is_local) {
315
360
  return is_local ? "-D" : "-g";
316
361
  }
362
+ function update_argv(latest, is_local, config) {
363
+ return ["pnpm", "add", update_scope_flag(is_local), `${config.package_name}@${latest}`];
364
+ }
317
365
  function format_update_command(latest, is_local, config) {
318
- return `pnpm add ${update_scope_flag(is_local)} ${config.package_name}@${latest}`;
366
+ return update_argv(latest, is_local, config).join(" ");
367
+ }
368
+ function build_upgrade_command(latest, is_local, config) {
369
+ const steps = [update_argv(latest, is_local, config)];
370
+ if (is_local) steps.push(["node_modules/.bin/tsx", config.fix_gh_packages_path]);
371
+ return { text: steps.map((step) => step.join(" ")).join(STEP_SEPARATOR), steps };
372
+ }
373
+ function shell_upgrade_command(command) {
374
+ return { text: command, steps: [["sh", "-c", command]] };
319
375
  }
320
376
  function build_upgrade_shell_command(latest, is_local, config) {
321
- const add_command = format_update_command(latest, is_local, config);
322
- if (!is_local) return add_command;
323
- return `${add_command} && node_modules/.bin/tsx ${config.fix_gh_packages_path}`;
377
+ return build_upgrade_command(latest, is_local, config).text;
324
378
  }
325
379
 
326
380
  // scripts/version/version-check-logic.ts
@@ -376,7 +430,7 @@ function resolve_effective_upgrade_hint(report) {
376
430
  function build_effective_upgrade_commands(report) {
377
431
  const hint = resolve_effective_upgrade_hint(report);
378
432
  if (hint === void 0 || hint.is_no_op) return [];
379
- return [hint.command];
433
+ return [shell_upgrade_command(hint.command)];
380
434
  }
381
435
  function build_effective_upgrade_notes(report) {
382
436
  const hint = resolve_effective_upgrade_hint(report);
@@ -399,7 +453,7 @@ function format_upstream_lines(report) {
399
453
  ];
400
454
  }
401
455
  function unique_upgrade_commands(commands) {
402
- return [...new Set(commands)];
456
+ return [...new Map(commands.map((command) => [command.text, command])).values()];
403
457
  }
404
458
  function format_unchanged_outcome(report, version) {
405
459
  const name = report.config.package_name;
@@ -417,7 +471,7 @@ function format_effective_outcome(report, after) {
417
471
  }
418
472
  function build_project_upgrade_commands(report) {
419
473
  if (!is_target_stale(report.project_version, report.latest)) return [];
420
- return [build_upgrade_shell_command(report.latest, true, report.config)];
474
+ return [build_upgrade_command(report.latest, true, report.config)];
421
475
  }
422
476
  function build_upstream_upgrade_commands(reports) {
423
477
  return reports.flatMap((report) => [
@@ -429,10 +483,10 @@ function build_dual_upgrade_commands(snapshot, config) {
429
483
  const { global_version, project_version, latest } = snapshot;
430
484
  const commands = [];
431
485
  if (is_target_stale(global_version, latest)) {
432
- commands.push(build_upgrade_shell_command(latest, false, config));
486
+ commands.push(build_upgrade_command(latest, false, config));
433
487
  }
434
488
  if (is_target_stale(project_version, latest)) {
435
- commands.push(build_upgrade_shell_command(latest, true, config));
489
+ commands.push(build_upgrade_command(latest, true, config));
436
490
  }
437
491
  return commands;
438
492
  }
@@ -454,7 +508,7 @@ function format_dual_version_output(snapshot, config, extras = {}, upstreams = [
454
508
  const hints = unique_upgrade_commands([
455
509
  ...build_dual_upgrade_commands(snapshot, config),
456
510
  ...build_upstream_upgrade_commands(upstreams)
457
- ]).map((command) => `Run: ${command}`);
511
+ ]).map((command) => `Run: ${command.text}`);
458
512
  if (hints.length > 0) lines.push("", ...hints);
459
513
  if (extras.warning !== void 0) lines.push("", extras.warning);
460
514
  return lines.join("\n");
@@ -576,9 +630,6 @@ var error_text = { message_of, trace_swallowed };
576
630
  // scripts/gh/git-gh-exec.ts
577
631
  import { execa as execa2, execaSync } from "execa";
578
632
 
579
- // scripts/lib/timeouts.ts
580
- var COMMAND_TIMEOUT_MS = 3e4;
581
-
582
633
  // scripts/gh/git-gh-check.ts
583
634
  import { execa } from "execa";
584
635
  var GH_NOT_INSTALLED_MSG = "gh CLI is not installed. Install it from https://cli.github.com/";
@@ -710,20 +761,20 @@ function parse_status_line(output) {
710
761
  function status_of_failure(error) {
711
762
  return has_stdout_field(error) ? parse_status_line(error.stdout) : void 0;
712
763
  }
713
- async function exec_gh_api_status(path5, timeout_ms) {
764
+ async function exec_gh_api_status(path6, timeout_ms) {
714
765
  const options = to_spawn_options(timeout_ms);
715
766
  try {
716
767
  await check_gh_installed();
717
- const { stdout } = await execa2("gh", ["api", "--include", "--silent", path5], options);
768
+ const { stdout } = await execa2("gh", ["api", "--include", "--silent", path6], options);
718
769
  return parse_status_line(stdout);
719
770
  } catch (error) {
720
771
  return status_of_failure(error);
721
772
  }
722
773
  }
723
- function exec_gh_api_status_sync(path5, timeout_ms) {
774
+ function exec_gh_api_status_sync(path6, timeout_ms) {
724
775
  const options = to_spawn_options(timeout_ms);
725
776
  try {
726
- const { stdout } = execaSync("gh", ["api", "--include", "--silent", path5], options);
777
+ const { stdout } = execaSync("gh", ["api", "--include", "--silent", path6], options);
727
778
  return parse_status_line(stdout);
728
779
  } catch (error) {
729
780
  return status_of_failure(error);
@@ -793,7 +844,7 @@ var git_gh_exec = {
793
844
  };
794
845
 
795
846
  // scripts/gh/fix-gh-packages-logic.ts
796
- import { loadAll } from "js-yaml";
847
+ import { loadAll as loadAll2 } from "js-yaml";
797
848
  import { z as z4 } from "zod";
798
849
  var GH_PACKAGES_HOST = "npm.pkg.github.com";
799
850
  var RESOLUTION_BLOCK = "\n resolution:\n";
@@ -815,7 +866,7 @@ var lockfile_document_schema = z4.looseObject({
815
866
  });
816
867
  function parse_lockfile_packages(raw) {
817
868
  const merged = {};
818
- for (const document of loadAll(raw)) {
869
+ for (const document of loadAll2(raw)) {
819
870
  const { packages } = lockfile_document_schema.parse(document);
820
871
  if (packages !== void 0) Object.assign(merged, packages);
821
872
  }
@@ -1105,11 +1156,11 @@ var migrate_logic = {
1105
1156
 
1106
1157
  // scripts/version/npm-registry.ts
1107
1158
  import { execaSync as execaSync2 } from "execa";
1159
+ import semver3 from "semver";
1108
1160
  import { z as z5 } from "zod";
1109
1161
  var PUBLIC_REGISTRY2 = "https://registry.npmjs.org";
1110
1162
  var ABBREVIATED_ACCEPT = "application/vnd.npm.install-v1+json";
1111
1163
  var FULL_ACCEPT = "application/json";
1112
- var REQUEST_TIMEOUT_MS = 1e4;
1113
1164
  var SCOPE_SEPARATOR = "/";
1114
1165
  var ENCODED_SCOPE_SEPARATOR = "%2f";
1115
1166
  var SCOPE_PATTERN = /^@[^/]+(?=\/)/u;
@@ -1121,7 +1172,8 @@ var FETCH_SCRIPT = [
1121
1172
  "if (!response.ok) process.exit(1)",
1122
1173
  "process.stdout.write(await response.text())"
1123
1174
  ].join("\n");
1124
- var latest_schema = z5.looseObject({ "dist-tags": z5.looseObject({ latest: z5.string() }) });
1175
+ var version_schema = z5.string().refine((value) => semver3.valid(value) === value);
1176
+ var latest_schema = z5.looseObject({ "dist-tags": z5.looseObject({ latest: version_schema }) });
1125
1177
  var times_schema = z5.looseObject({ time: release_age.release_times_schema });
1126
1178
  function packument_url(package_name) {
1127
1179
  return `${PUBLIC_REGISTRY2}/${package_name.replace(SCOPE_SEPARATOR, () => ENCODED_SCOPE_SEPARATOR)}`;
@@ -1130,7 +1182,7 @@ function read_packument(package_name, accept) {
1130
1182
  const result = execaSync2(
1131
1183
  process.execPath,
1132
1184
  ["--input-type=module", "-e", FETCH_SCRIPT, packument_url(package_name), accept],
1133
- { reject: false, timeout: REQUEST_TIMEOUT_MS }
1185
+ { reject: false, timeout: FETCH_TIMEOUT_MS }
1134
1186
  );
1135
1187
  if (result.exitCode !== 0) return void 0;
1136
1188
  return json_value.parse_or_undefined(result.stdout);
@@ -1140,7 +1192,7 @@ function is_github_scope(scope) {
1140
1192
  if (is_cached_github !== void 0) return is_cached_github;
1141
1193
  const result = execaSync2("pnpm", ["config", "get", `${scope}${SCOPE_REGISTRY_SUFFIX}`], {
1142
1194
  reject: false,
1143
- timeout: REQUEST_TIMEOUT_MS
1195
+ timeout: FETCH_TIMEOUT_MS
1144
1196
  });
1145
1197
  const is_github = result.exitCode === 0 && migrate_logic.is_github_tarball(result.stdout.trim());
1146
1198
  github_scopes.set(scope, is_github);
@@ -1164,7 +1216,16 @@ function has_public_version(package_name, version) {
1164
1216
  const parsed = times_schema.safeParse(read_packument(package_name, FULL_ACCEPT));
1165
1217
  return parsed.success && parsed.data.time[version] !== void 0;
1166
1218
  }
1167
- var npm_registry = { has_public_version, packument_url, read_latest, read_release_times };
1219
+ function valid_version(value) {
1220
+ return version_schema.safeParse(value).success ? value : void 0;
1221
+ }
1222
+ var npm_registry = {
1223
+ has_public_version,
1224
+ packument_url,
1225
+ read_latest,
1226
+ read_release_times,
1227
+ valid_version
1228
+ };
1168
1229
 
1169
1230
  // scripts/version/version-remote.ts
1170
1231
  var TIMES_PAGE_SIZE = 100;
@@ -1175,10 +1236,7 @@ function require_endpoint(versions_endpoint, package_name) {
1175
1236
  `Could not derive a versions endpoint for ${package_name}; check its version-command config.`
1176
1237
  );
1177
1238
  }
1178
- function fetch_latest_version(versions_endpoint, package_name) {
1179
- const endpoint = require_endpoint(versions_endpoint, package_name);
1180
- const public_latest = npm_registry.read_latest(package_name);
1181
- if (public_latest !== void 0) return public_latest;
1239
+ function read_github_name(endpoint, package_name) {
1182
1240
  try {
1183
1241
  return git_gh_exec.exec_gh_api_sync({ path: endpoint, jq_filter: ".[0].name" }).trim();
1184
1242
  } catch (error) {
@@ -1191,6 +1249,18 @@ function fetch_latest_version(versions_endpoint, package_name) {
1191
1249
  );
1192
1250
  }
1193
1251
  }
1252
+ function read_github_latest(endpoint, package_name) {
1253
+ const name = read_github_name(endpoint, package_name);
1254
+ const version = npm_registry.valid_version(name);
1255
+ if (version !== void 0) return version;
1256
+ throw new Error(
1257
+ `Refused latest version for ${package_name} via ${endpoint}: ${JSON.stringify(name)} is not a semver version`
1258
+ );
1259
+ }
1260
+ function fetch_latest_version(versions_endpoint, package_name) {
1261
+ const endpoint = require_endpoint(versions_endpoint, package_name);
1262
+ return npm_registry.read_latest(package_name) ?? read_github_latest(endpoint, package_name);
1263
+ }
1194
1264
  function with_page_size(endpoint, page_size) {
1195
1265
  const separator = endpoint.indexOf("?");
1196
1266
  const path_part = separator === -1 ? endpoint : endpoint.slice(0, separator);
@@ -1211,7 +1281,7 @@ function fetch_release_times(versions_endpoint, package_name) {
1211
1281
  }
1212
1282
 
1213
1283
  // scripts/version/version-targets.ts
1214
- import path4 from "node:path";
1284
+ import path5 from "node:path";
1215
1285
 
1216
1286
  // scripts/lib/read-file.ts
1217
1287
  import { readFileSync as readFileSync4 } from "node:fs";
@@ -1219,20 +1289,20 @@ var ABSENT_CODE = "ENOENT";
1219
1289
  function is_absent(error) {
1220
1290
  return error instanceof Error && "code" in error && error.code === ABSENT_CODE;
1221
1291
  }
1222
- function read_optional(path5) {
1292
+ function read_optional(path6) {
1223
1293
  try {
1224
- return readFileSync4(path5, "utf8");
1294
+ return readFileSync4(path6, "utf8");
1225
1295
  } catch (error) {
1226
1296
  if (is_absent(error)) return void 0;
1227
1297
  throw error;
1228
1298
  }
1229
1299
  }
1230
- function read_file_or_empty(path5) {
1231
- return read_optional(path5) ?? "";
1300
+ function read_file_or_empty(path6) {
1301
+ return read_optional(path6) ?? "";
1232
1302
  }
1233
- function read_if_readable(path5) {
1303
+ function read_if_readable(path6) {
1234
1304
  try {
1235
- return readFileSync4(path5, "utf8");
1305
+ return readFileSync4(path6, "utf8");
1236
1306
  } catch {
1237
1307
  return void 0;
1238
1308
  }
@@ -1261,7 +1331,7 @@ function read_global_version(package_name) {
1261
1331
  return parse_global_version(result.stdout, package_name);
1262
1332
  }
1263
1333
  function project_package_path(cwd, package_name) {
1264
- return path4.join(cwd, NODE_MODULES2, package_name, PACKAGE_JSON3);
1334
+ return path5.join(cwd, NODE_MODULES2, package_name, PACKAGE_JSON3);
1265
1335
  }
1266
1336
  function read_project_version(cwd, package_name) {
1267
1337
  const package_path = project_package_path(cwd, package_name);
@@ -1269,7 +1339,7 @@ function read_project_version(cwd, package_name) {
1269
1339
  return parse_project_version(raw);
1270
1340
  }
1271
1341
  function read_workspace_version(cwd) {
1272
- const package_path = path4.join(cwd, PACKAGE_JSON3);
1342
+ const package_path = path5.join(cwd, PACKAGE_JSON3);
1273
1343
  const raw = file_reader.read_optional(package_path);
1274
1344
  return parse_project_version(raw);
1275
1345
  }
@@ -1291,7 +1361,6 @@ var version_targets = {
1291
1361
  var FAILURE_EXIT_CODE = 1;
1292
1362
  var ALREADY_UP_TO_DATE = "Already up to date";
1293
1363
  var NO_QUARANTINE_MINUTES2 = 0;
1294
- var UPGRADE_TIMEOUT_MS = 6e5;
1295
1364
  function read_release_hold(package_config, latest, versions) {
1296
1365
  if (versions.every((version) => version === void 0 || version === latest)) return void 0;
1297
1366
  const minimum_age_minutes = release_age.read_nearest_minimum_release_age(process.cwd());
@@ -1375,14 +1444,22 @@ function run_check(config) {
1375
1444
  )
1376
1445
  );
1377
1446
  }
1378
- function run_upgrade_command(command) {
1379
- const result = execaSync4("sh", ["-c", command], {
1447
+ function run_upgrade_step(step) {
1448
+ const [executable = "", ...rest] = step;
1449
+ const result = execaSync4(executable, rest, {
1380
1450
  stdio: "inherit",
1381
1451
  reject: false,
1382
- timeout: UPGRADE_TIMEOUT_MS
1452
+ timeout: INSTALL_TIMEOUT_MS
1383
1453
  });
1384
1454
  return result.exitCode ?? FAILURE_EXIT_CODE;
1385
1455
  }
1456
+ function run_upgrade_command(command) {
1457
+ for (const step of command.steps) {
1458
+ const code = run_upgrade_step(step);
1459
+ if (code !== 0) return code;
1460
+ }
1461
+ return 0;
1462
+ }
1386
1463
  function run_all_upgrade_commands(commands) {
1387
1464
  let exit_code = 0;
1388
1465
  const failed_commands = [];
@@ -1390,7 +1467,7 @@ function run_all_upgrade_commands(commands) {
1390
1467
  const code = run_upgrade_command(command);
1391
1468
  if (code === 0) continue;
1392
1469
  exit_code = code;
1393
- failed_commands.push(command);
1470
+ failed_commands.push(command.text);
1394
1471
  }
1395
1472
  if (failed_commands.length > 0) {
1396
1473
  console.error(
package/eslint/base.js CHANGED
@@ -13,6 +13,7 @@ import ts from 'typescript-eslint'
13
13
  import { checkout_rooted_parser } from './checkout-rooted-parser.js'
14
14
  import { config_fingerprint } from './config-fingerprint.js'
15
15
  import { code_quality_rules } from './rules/code-quality.js'
16
+ import { early_return_one_liner_rule } from './rules/early-return-one-liner.js'
16
17
  import { formatting_rules } from './rules/formatting.js'
17
18
  import { import_rules } from './rules/import.js'
18
19
  import { namespace_object_export_rule } from './rules/namespace-object-export.js'
@@ -40,6 +41,14 @@ const FILE_PATTERNS = {
40
41
  // file that was failing anyway.
41
42
  tests: ['**/*.test.ts', '**/*.e2e.ts'],
42
43
  eslint_rules: ['eslint/**/*.ts', 'eslint/rules/**/*.js'],
44
+ // joshuafolkken/kit#3294: the SvelteKit convention files, whose named exports — route handlers,
45
+ // `load`, `handle`, `match` — are typed through a const annotation (`export const GET:
46
+ // RequestHandler = …`). That idiom is the one place `func-style` allows an arrow const.
47
+ sveltekit_typed_exports: [
48
+ '**/src/routes/**/+*.{ts,js}',
49
+ '**/src/hooks{.server,.client,}.{ts,js}',
50
+ '**/src/params/**/*.{ts,js}',
51
+ ],
43
52
  }
44
53
 
45
54
  // One test-filename ban block. Both bans differ only in their glob and their message, so the shape
@@ -128,12 +137,18 @@ export function create_base_config({ gitignore_path, tsconfig_root_dir }) {
128
137
  // way the test-filename bans are.
129
138
  plugins: {
130
139
  '@stylistic': stylistic,
131
- local: { rules: { 'namespace-object-export': namespace_object_export_rule } },
140
+ local: {
141
+ rules: {
142
+ 'namespace-object-export': namespace_object_export_rule,
143
+ 'early-return-one-liner': early_return_one_liner_rule,
144
+ },
145
+ },
132
146
  },
133
147
  languageOptions: { globals: { ...globals.browser, ...globals.node } },
134
148
  rules: {
135
149
  'no-undef': 'off',
136
150
  'local/namespace-object-export': 'error',
151
+ 'local/early-return-one-liner': 'error',
137
152
  ...naming_convention_rules,
138
153
  ...typescript_rules,
139
154
  ...code_quality_rules,
@@ -145,6 +160,10 @@ export function create_base_config({ gitignore_path, tsconfig_root_dir }) {
145
160
  },
146
161
  },
147
162
  { files: FILE_PATTERNS.d_ts, rules: { 'import/no-default-export': 'off' } },
163
+ {
164
+ files: FILE_PATTERNS.sveltekit_typed_exports,
165
+ rules: { 'func-style': ['error', 'declaration', { allowTypeAnnotation: true }] },
166
+ },
148
167
  {
149
168
  files: FILE_PATTERNS.typescript,
150
169
  ignores: ['**/*.svelte.ts'],
@@ -178,6 +197,9 @@ export function create_base_config({ gitignore_path, tsconfig_root_dir }) {
178
197
  'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
179
198
  // vi mock/stub patterns require explicit undefined (mockResolvedValue/stubGlobal)
180
199
  'unicorn/no-useless-undefined': 'off',
200
+ // A fixture helper's parameter names the axis a test varies, even while every current
201
+ // call passes the same value; inlining it hides that axis until the next case re-adds it.
202
+ 'unicorn/no-unnecessary-parameters': 'off',
181
203
  // describe-scoped `let` assigned in beforeEach is the standard vitest fixture shape;
182
204
  // the declaration cannot be initialized where it is declared.
183
205
  'init-declarations': 'off',
@@ -11,6 +11,9 @@ export const code_quality_rules = {
11
11
  'prefer-const': 'error',
12
12
  // アロー関数を優先(名前付き関数式はスタックトレース可読性のため許可)
13
13
  'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
14
+ // 関数は function 宣言で書く(joshuafolkken/kit#3294)。SvelteKit の型付き const export は
15
+ // eslint/base.js が該当ファイルだけ allowTypeAnnotation で許可する
16
+ 'func-style': ['error', 'declaration'],
14
17
  // テンプレートリテラルを優先
15
18
  'prefer-template': 'error',
16
19
  // 等価演算子は厳密等価を使用