@joshuafolkken/kit 1.1471.0 → 1.1514.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.
- package/.claude/settings.json +6 -6
- package/.claude/skills/epic-commands/SKILL.md +2 -14
- package/.claude/skills/epic-commands/epic-bundle.md +9 -5
- package/.claude/skills/epic-commands/execution-waves.md +1 -2
- package/.claude/skills/verify-ui/SKILL.md +1 -2
- package/.claude/skills/workflow-commands/SKILL.md +7 -9
- package/.claude/skills/workflow-commands/background-commands.md +3 -7
- package/.claude/skills/workflow-commands/backlogrun-child.md +3 -10
- package/.claude/skills/workflow-commands/backlogrun-lanes.md +6 -15
- package/.claude/skills/workflow-commands/backlogrun-park.md +2 -8
- package/.claude/skills/workflow-commands/backlogrun-progress.md +10 -19
- package/.claude/skills/workflow-commands/backlogrun-recovery.md +8 -8
- package/.claude/skills/workflow-commands/backlogrun-steps.md +2 -10
- package/.claude/skills/workflow-commands/backlogrun.md +31 -50
- package/.claude/skills/workflow-commands/chain-rule.md +7 -6
- package/.claude/skills/workflow-commands/delegation.md +12 -8
- package/.claude/skills/workflow-commands/entry-sequence.md +1 -3
- package/.claude/skills/workflow-commands/followup.md +3 -6
- package/.claude/skills/workflow-commands/fullrun-steps.md +3 -5
- package/.claude/skills/workflow-commands/fullrun.md +4 -6
- package/.claude/skills/workflow-commands/halfrun.md +3 -7
- package/.claude/skills/workflow-commands/into-target.md +1 -2
- package/.claude/skills/workflow-commands/issue-comments.md +3 -3
- package/.claude/skills/workflow-commands/issue-scout.md +3 -2
- package/.claude/skills/workflow-commands/latest-gate.md +2 -6
- package/.claude/skills/workflow-commands/needs-human-review.md +2 -5
- package/.claude/skills/workflow-commands/observation-filing.md +0 -14
- package/.claude/skills/workflow-commands/observation-ledger.md +4 -9
- package/.claude/skills/workflow-commands/pre-gate-cut.md +11 -16
- package/.claude/skills/workflow-commands/prerequisite.md +1 -2
- package/.claude/skills/workflow-commands/progress-watcher.md +2 -7
- package/.claude/skills/workflow-commands/prrun.md +3 -5
- package/.claude/skills/workflow-commands/retrospective.md +4 -4
- package/.claude/skills/workflow-commands/split-assessment.md +1 -3
- package/.claude/skills/workflow-commands/target-repository.md +1 -2
- package/.claude/skills/workflow-commands/working-tree-hold.md +2 -4
- package/.codex/hooks.json +6 -6
- package/.github/actions/setup-node/action.yml +1 -1
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/publish.yml +2 -2
- package/CLAUDE.md +1 -1
- package/cspell/index.yaml +7 -0
- package/dist/CLAUDE.md +1 -1
- package/dist/commands/document-section-cli.js +67 -34
- package/dist/hooks/batch-guard.js +6 -6
- package/dist/hooks/chunk-4KKD2UTK.js +66 -0
- package/dist/hooks/{chunk-J47HU5H5.js → chunk-6TS2JD6D.js} +3 -3
- package/dist/hooks/chunk-7DSBJVFH.js +50 -0
- package/dist/hooks/{chunk-YHBZAJSV.js → chunk-A65Y4YOR.js} +3 -3
- package/dist/hooks/{chunk-E7OIKX5Z.js → chunk-APUO6U4J.js} +85 -7
- package/dist/hooks/{chunk-IX6TTTI6.js → chunk-EFXE6C37.js} +8 -22
- package/dist/hooks/chunk-GP4IEC4O.js +20 -0
- package/dist/hooks/{chunk-SHGPANFB.js → chunk-JP45SOCJ.js} +3 -3
- package/dist/hooks/{chunk-K4EOONYM.js → chunk-LAOV7NLM.js} +1 -1
- package/dist/hooks/chunk-M4HGZV7U.js +83 -0
- package/dist/hooks/{chunk-KC5AK2GF.js → chunk-O6GDRNJB.js} +3 -3
- package/dist/hooks/{chunk-YYPI7SJZ.js → chunk-PF2NZL2A.js} +5 -5
- package/dist/hooks/{chunk-H5HVWYXK.js → chunk-PTICX4OL.js} +3 -4
- package/dist/hooks/{chunk-IIGFYXKC.js → chunk-RT27QRJW.js} +581 -1438
- package/dist/hooks/{chunk-43ZHT22P.js → chunk-SYOTDYCI.js} +1127 -1089
- package/dist/hooks/{chunk-AS74OU3D.js → chunk-TNUMY6NL.js} +1507 -1336
- package/dist/hooks/chunk-UPUZF3AN.js +279 -0
- package/dist/hooks/{chunk-EUMACUK2.js → chunk-WK6SMBIC.js} +1948 -806
- package/dist/hooks/codex-hook-adapter.js +17 -14
- package/dist/hooks/duplicate-read-guard.js +7 -7
- package/dist/hooks/format-edited.js +5 -4
- package/dist/hooks/inputs.json +317 -264
- package/dist/hooks/investigation-guard.js +8 -11
- package/dist/hooks/pretool-guard.js +16 -13
- package/dist/hooks/session-lang.js +370 -25
- package/dist/hooks/stop-guard.js +2576 -176
- package/dist/josh.js +2124 -277
- package/lefthook/base.yml +5 -3
- package/package.json +12 -10
- package/prompts/collaboration-workflow/file-edits.md +1 -3
- package/prompts/collaboration-workflow/gh-rest.md +1 -2
- package/prompts/collaboration-workflow/issue-citation.md +2 -4
- package/prompts/collaboration-workflow/issue-template.md +10 -2
- package/prompts/collaboration-workflow/lane-instructions.md +35 -0
- package/prompts/collaboration-workflow/operating-rules.md +2 -6
- package/prompts/collaboration-workflow/output-bounds.md +3 -3
- package/prompts/collaboration-workflow/overview.md +1 -1
- package/prompts/collaboration-workflow/principles.md +14 -8
- package/prompts/collaboration-workflow/report-format.md +9 -0
- package/prompts/collaboration-workflow/residency.md +12 -8
- package/prompts/collaboration-workflow/rule-delivery.md +3 -11
- package/prompts/collaboration-workflow/shell-body.md +6 -6
- package/prompts/collaboration-workflow/turn-batching.md +5 -5
- package/prompts/collaboration-workflow/upstream-interrupt.md +2 -2
- package/prompts/collaboration-workflow/wip-cap.md +6 -6
- package/prompts/collaboration-workflow.md +1 -0
- package/prompts/review.md +4 -5
- package/prompts/testing-guide.md +2 -2
- package/scripts/agent/agent-argv.ts +20 -4
- package/scripts/agent/agent-role-profile.ts +101 -45
- package/scripts/agent/agent-safe-text.ts +60 -0
- package/scripts/agent/claude-agent-argv.ts +14 -0
- package/scripts/agent/codex-agent-argv.ts +2 -0
- package/scripts/agent/lane-instructions.ts +144 -0
- package/scripts/backlog/backlog-budget.ts +4 -4
- package/scripts/backlog/backlog-drive-named.ts +1 -1
- package/scripts/backlog/backlog-drive-restore.ts +9 -1
- package/scripts/backlog/backlog-occupied.ts +56 -0
- package/scripts/backlog/backlog-ready.ts +47 -10
- package/scripts/delegation/duplicate-read-guard.ts +2 -2
- package/scripts/delegation/investigation-guard.ts +15 -65
- package/scripts/delegation/investigation-reads.ts +0 -1
- package/scripts/document/document-byte-budget.ts +6 -5
- package/scripts/document/document-section-cli.ts +17 -5
- package/scripts/document/entry-read-budget.ts +2 -2
- package/scripts/document/read-set-cli.ts +4 -1
- package/scripts/epic/epic-audit-orphans.ts +5 -8
- package/scripts/epic/epic-audit.ts +52 -1
- package/scripts/epic/epic-bundle-evidence.ts +49 -26
- package/scripts/epic/epic-bundle-referenced.ts +14 -3
- package/scripts/epic/epic-bundle.ts +17 -9
- package/scripts/followup/git-followup-workflow.ts +19 -1
- package/scripts/gate/check-inputs.ts +129 -0
- package/scripts/gate/check-reuse.ts +162 -0
- package/scripts/gate/core-budget.ts +93 -44
- package/scripts/gate/core-wait.ts +130 -0
- package/scripts/gate/free-cores.ts +49 -0
- package/scripts/gate/gate-ledger.ts +17 -3
- package/scripts/gate/gate-plan.ts +23 -1
- package/scripts/gate/gate-report.ts +15 -2
- package/scripts/gate/gate-run-steps.ts +150 -0
- package/scripts/gate/held-mark.ts +55 -0
- package/scripts/gate/machine-capacity.ts +70 -11
- package/scripts/gate/pre-commit-type-check.ts +14 -1
- package/scripts/gate/verification-gate.ts +58 -125
- package/scripts/gh/git-gh-issue-rest.ts +1 -0
- package/scripts/gh/git-gh-issue-write.ts +24 -2
- package/scripts/gh/git-pr.ts +13 -1
- package/scripts/git/main-merge-regenerate.ts +78 -0
- package/scripts/git/main-merge.ts +14 -5
- package/scripts/hooks/batch-guard.ts +5 -8
- package/scripts/hooks/pre-commit-lint.ts +91 -0
- package/scripts/hooks/pre-push-unit.ts +1 -1
- package/scripts/hooks/pretool-guard.ts +27 -52
- package/scripts/hooks/reserved-run.ts +1 -0
- package/scripts/hooks/run-hook.sh +10 -12
- package/scripts/hooks/stop-actions.ts +204 -0
- package/scripts/hooks/stop-guard.ts +62 -21
- package/scripts/init/hook-launch.ts +12 -7
- package/scripts/issue/expected-effect-lint.ts +59 -0
- package/scripts/issue/issue-cite-cli.ts +35 -15
- package/scripts/issue/issue-classification.ts +1 -1
- package/scripts/issue/issue-lint-cli.ts +5 -3
- package/scripts/issue/issue-scout-cli.ts +19 -14
- package/scripts/issue/markdown-section.ts +19 -5
- package/scripts/josh/command-usage.ts +110 -0
- package/scripts/josh/josh-command-map.ts +2 -0
- package/scripts/josh/josh-command-types.ts +55 -9
- package/scripts/josh/josh-commands-ai.ts +13 -0
- package/scripts/josh/josh-commands-development.ts +1 -1
- package/scripts/josh/josh-commands-hooks.ts +6 -0
- package/scripts/josh/josh-commands-lane.ts +10 -1
- package/scripts/josh/josh-commands-workflow.ts +5 -0
- package/scripts/josh/josh-logic.ts +6 -15
- package/scripts/josh/josh-usage-automation.ts +121 -0
- package/scripts/josh/josh-usage-backlog.ts +180 -0
- package/scripts/josh/josh-usage-developer.ts +230 -0
- package/scripts/josh/josh-usage-hooks.ts +38 -0
- package/scripts/josh/josh-usage-issue.ts +205 -0
- package/scripts/josh/josh-usage-review.ts +101 -0
- package/scripts/josh/josh-usage-run.ts +252 -0
- package/scripts/josh/josh-usage-session.ts +238 -0
- package/scripts/josh/josh-usage-workflow.ts +212 -0
- package/scripts/josh/josh.ts +14 -5
- package/scripts/josh/package-directory.ts +20 -0
- package/scripts/lane/lane-capacity.ts +8 -2
- package/scripts/lane/lane-check-stats.ts +56 -0
- package/scripts/lane/lane-child-invocation.ts +35 -4
- package/scripts/lane/lane-dispatch.ts +3 -3
- package/scripts/lane/lane-guard-policy.ts +2 -2
- package/scripts/lane/lane-handoff.ts +8 -1
- package/scripts/lane/lane-install.ts +12 -4
- package/scripts/lane/lane-ledger.ts +43 -1
- package/scripts/lane/lane-limit-cli.ts +8 -9
- package/scripts/lane/lane-measure-cli.ts +2 -0
- package/scripts/lane/lane-preserve.ts +29 -1
- package/scripts/lane/lane-registry.ts +9 -7
- package/scripts/lane/lane-restart.ts +5 -26
- package/scripts/lane/lane-session-action.ts +146 -0
- package/scripts/lane/lane-session-broker.ts +57 -138
- package/scripts/lane/lane-withdraw-cli.ts +71 -0
- package/scripts/lane/lane-withdraw.ts +182 -0
- package/scripts/lint/format.ts +4 -4
- package/scripts/lint/lint-parallel.ts +10 -3
- package/scripts/lint/lint-related-scope.ts +4 -1
- package/scripts/notify/telegram-test.ts +10 -5
- package/scripts/report/report-format-reference.ts +2 -0
- package/scripts/review/acceptance-map-check.ts +61 -0
- package/scripts/review/acceptance-map.ts +205 -0
- package/scripts/review/review-brief-cli.ts +1 -1
- package/scripts/rules/agent-model.ts +59 -0
- package/scripts/rules/delivered-rules.ts +11 -2
- package/scripts/rules/filing-cap.ts +1 -0
- package/scripts/rules/firing-point.ts +6 -5
- package/scripts/rules/guard-remedy.ts +117 -0
- package/scripts/rules/issue-comments.ts +67 -6
- package/scripts/rules/last-prompt.ts +50 -5
- package/scripts/rules/oracle-list-cli.ts +7 -0
- package/scripts/rules/piped-verification.ts +3 -1
- package/scripts/rules/rule-list.ts +4 -1
- package/scripts/rules/rule-registry-rows.ts +10 -0
- package/scripts/rules/rule-registry.ts +7 -4
- package/scripts/rules/rule-rewrite.ts +114 -0
- package/scripts/rules/rule-value.ts +7 -1
- package/scripts/rules/shell-segments.ts +15 -0
- package/scripts/rules/stop-decision.ts +77 -0
- package/scripts/rules/stop-rules.ts +147 -47
- package/scripts/rules/tail-commands.ts +15 -1
- package/scripts/run/board/run-board-cli.ts +2 -0
- package/scripts/run/board/run-board-closed.ts +8 -2
- package/scripts/run/board/run-board-github.ts +9 -1
- package/scripts/run/board/run-board-header.ts +4 -1
- package/scripts/run/board/run-board-labels.ts +2 -0
- package/scripts/run/board/run-board-layout.ts +1 -1
- package/scripts/run/board/run-board-read.ts +16 -0
- package/scripts/run/board/run-board-reason.ts +10 -1
- package/scripts/run/board/run-board-render-legend.ts +1 -0
- package/scripts/run/board/run-board-render-slot.ts +1 -1
- package/scripts/run/board/run-board-render-waits.ts +41 -0
- package/scripts/run/board/run-board-render.ts +6 -1
- package/scripts/run/board/run-board-row-yield.ts +1 -0
- package/scripts/run/board/run-board-state.ts +5 -0
- package/scripts/run/board/run-board-status.ts +72 -21
- package/scripts/run/board/run-board-tick.ts +5 -1
- package/scripts/run/cut/run-cut-cli.ts +3 -2
- package/scripts/run/cut/run-cut-report.ts +16 -0
- package/scripts/run/detached-launch.ts +23 -4
- package/scripts/run/entry/run-entry-cli.ts +8 -1
- package/scripts/run/event/run-event-render.ts +1 -0
- package/scripts/run/event/run-event-scope.ts +19 -1
- package/scripts/run/event/run-event-stream-emit.ts +13 -6
- package/scripts/run/event/run-event-stream.ts +4 -0
- package/scripts/run/hold/run-hold-session.ts +46 -0
- package/scripts/run/hold/run-hold.ts +7 -1
- package/scripts/run/launch-priority.ts +32 -0
- package/scripts/run/merge/run-merge-cli.ts +16 -65
- package/scripts/run/merge/run-merge-signals.ts +99 -0
- package/scripts/run/merge/run-merge-steps.ts +11 -1
- package/scripts/run/merge/run-merge.ts +21 -9
- package/scripts/run/run-liveness.ts +1 -1
- package/scripts/run/run-poll-hook.ts +157 -0
- package/scripts/run/run-step-cli.ts +22 -15
- package/scripts/run/run-step-section.ts +85 -0
- package/scripts/run/ship/run-ship-cli.ts +5 -12
- package/scripts/run/ship/run-ship-detach.ts +9 -0
- package/scripts/run/ship/run-ship-next.ts +10 -2
- package/scripts/run/ship/run-ship-overlap.ts +195 -0
- package/scripts/run/ship/run-ship-pre-detach.ts +33 -15
- package/scripts/run/ship/run-ship-preflight.ts +28 -2
- package/scripts/run/ship/run-ship-return.ts +31 -7
- package/scripts/run/ship/run-ship-review-steps.ts +12 -10
- package/scripts/run/ship/run-ship-steps.ts +1 -1
- package/scripts/run/ship/run-ship-stop-context.ts +206 -0
- package/scripts/run/ship/run-ship-sync.ts +14 -6
- package/scripts/test/test-e2e-guard.ts +30 -5
- package/scripts/test/test-unit-guard.ts +16 -1
- package/scripts/test/unit-worker-share.ts +26 -4
- package/scripts/time-runtime/time-shell.ts +29 -4
- package/scripts/time-runtime/time-spans.ts +1 -0
- package/scripts/time-runtime/time-tool-call.ts +7 -0
- package/templates/gitignore +6 -2
- package/dist/hooks/chunk-K4LMBQC2.js +0 -68
|
@@ -83,7 +83,7 @@ jobs:
|
|
|
83
83
|
env:
|
|
84
84
|
LATEST: ${{ steps.registry-latest.outputs.latest }}
|
|
85
85
|
|
|
86
|
-
- uses: actions/download-artifact@
|
|
86
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
87
87
|
with:
|
|
88
88
|
name: kit-package
|
|
89
89
|
path: ${{ runner.temp }}
|
|
@@ -126,7 +126,7 @@ jobs:
|
|
|
126
126
|
with:
|
|
127
127
|
cache: 'false'
|
|
128
128
|
|
|
129
|
-
- uses: actions/download-artifact@
|
|
129
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
130
130
|
with:
|
|
131
131
|
name: kit-package
|
|
132
132
|
path: ${{ runner.temp }}
|
package/CLAUDE.md
CHANGED
|
@@ -80,7 +80,7 @@ Never start a `kickoff` / `halfrun` / `prrun` / `fullrun` / `backlogrun` workflo
|
|
|
80
80
|
|
|
81
81
|
#### Mid-workflow stop notification (`confirmation`)
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
The `Stop` hook sends it when your held run awaits a decision — lead with the reason, end with `Recommended: <choice>`. Send it yourself only when the hook refuses the stop:
|
|
84
84
|
|
|
85
85
|
```bash
|
|
86
86
|
pnpm josh notify --task-type confirmation --issue-url "<url>" --body=$'<reason>' --recommended "<choice>" --alternative "<other>"
|
package/cspell/index.yaml
CHANGED
|
@@ -26,11 +26,17 @@ ignorePaths:
|
|
|
26
26
|
# joshuafolkken/kit#1347: `josh lint:related` has its own for the same reason — an implementation
|
|
27
27
|
# loop calls it while the gate lints the whole tree, and two eslint runs on one cache file discard
|
|
28
28
|
# each other's entries.
|
|
29
|
+
# joshuafolkken/kit#3948: prettier's gate and scoped caches, and the pre-commit hook's own cspell and
|
|
30
|
+
# eslint caches — a staged-files run on the gate's file would prune or narrow it.
|
|
29
31
|
- '**/.eslintcache'
|
|
30
32
|
- '**/.eslintcache.edit'
|
|
31
33
|
- '**/.eslintcache.related'
|
|
34
|
+
- '**/.eslintcache.commit'
|
|
32
35
|
- '**/.tsbuildinfo'
|
|
33
36
|
- '**/.cspellcache'
|
|
37
|
+
- '**/.cspellcache.commit'
|
|
38
|
+
- '**/.prettiercache'
|
|
39
|
+
- '**/.prettiercache.related'
|
|
34
40
|
- '**/.gitignore'
|
|
35
41
|
- '**/pnpm-lock.yaml'
|
|
36
42
|
- '**/.vscode/**'
|
|
@@ -110,6 +116,7 @@ words:
|
|
|
110
116
|
- domcontentloaded
|
|
111
117
|
- esbuild
|
|
112
118
|
- eslintcache
|
|
119
|
+
- prettiercache
|
|
113
120
|
- fetchpriority
|
|
114
121
|
- fullrun
|
|
115
122
|
- halfrun
|
package/dist/CLAUDE.md
CHANGED
|
@@ -80,7 +80,7 @@ Never start a `kickoff` / `halfrun` / `prrun` / `fullrun` / `backlogrun` workflo
|
|
|
80
80
|
|
|
81
81
|
#### Mid-workflow stop notification (`confirmation`)
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
The `Stop` hook sends it when your held run awaits a decision — lead with the reason, end with `Recommended: <choice>`. Send it yourself only when the hook refuses the stop:
|
|
84
84
|
|
|
85
85
|
```bash
|
|
86
86
|
pnpm josh notify --task-type confirmation --issue-url "<url>" --body=$'<reason>' --recommended "<choice>" --alternative "<other>"
|
|
@@ -1,13 +1,43 @@
|
|
|
1
1
|
#!/usr/bin/env tsx
|
|
2
2
|
|
|
3
3
|
// scripts/document/document-section-cli.ts
|
|
4
|
-
import { existsSync as
|
|
5
|
-
import
|
|
4
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
5
|
+
import path8 from "node:path";
|
|
6
6
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7
7
|
|
|
8
|
+
// scripts/josh/package-directory.ts
|
|
9
|
+
import { existsSync } from "node:fs";
|
|
10
|
+
import path2 from "node:path";
|
|
11
|
+
|
|
12
|
+
// scripts/lib/ancestor-directories.ts
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
var MAX_DEPTH = 64;
|
|
15
|
+
function list(start_directory) {
|
|
16
|
+
const directories = [];
|
|
17
|
+
let current = path.resolve(start_directory);
|
|
18
|
+
while (directories.length < MAX_DEPTH && !directories.includes(current)) {
|
|
19
|
+
directories.push(current);
|
|
20
|
+
current = path.dirname(current);
|
|
21
|
+
}
|
|
22
|
+
return directories;
|
|
23
|
+
}
|
|
24
|
+
function nearest(start_directory, is_match2) {
|
|
25
|
+
return list(start_directory).find((directory) => is_match2(directory));
|
|
26
|
+
}
|
|
27
|
+
var ancestor_directories = { list, nearest };
|
|
28
|
+
|
|
29
|
+
// scripts/josh/package-directory.ts
|
|
30
|
+
var PACKAGE_JSON = "package.json";
|
|
31
|
+
function find_package_directory(start_directory) {
|
|
32
|
+
return ancestor_directories.nearest(
|
|
33
|
+
start_directory,
|
|
34
|
+
(directory) => existsSync(path2.join(directory, PACKAGE_JSON))
|
|
35
|
+
) ?? start_directory;
|
|
36
|
+
}
|
|
37
|
+
|
|
8
38
|
// scripts/document/capped-print.ts
|
|
9
39
|
import { mkdtempSync, writeFileSync } from "node:fs";
|
|
10
|
-
import
|
|
40
|
+
import path5 from "node:path";
|
|
11
41
|
|
|
12
42
|
// scripts/josh/platform-temporary.ts
|
|
13
43
|
import { accessSync, constants } from "node:fs";
|
|
@@ -82,7 +112,7 @@ function reading_block(parts, cap) {
|
|
|
82
112
|
var review_diff_parts = { body_of, part_texts, reading_block, split_text };
|
|
83
113
|
|
|
84
114
|
// scripts/document/bash-output-cap.ts
|
|
85
|
-
import
|
|
115
|
+
import path3 from "node:path";
|
|
86
116
|
|
|
87
117
|
// scripts/lib/read-file.ts
|
|
88
118
|
import { readFileSync } from "node:fs";
|
|
@@ -90,20 +120,20 @@ var ABSENT_CODE = "ENOENT";
|
|
|
90
120
|
function is_absent(error) {
|
|
91
121
|
return error instanceof Error && "code" in error && error.code === ABSENT_CODE;
|
|
92
122
|
}
|
|
93
|
-
function read_optional(
|
|
123
|
+
function read_optional(path9) {
|
|
94
124
|
try {
|
|
95
|
-
return readFileSync(
|
|
125
|
+
return readFileSync(path9, "utf8");
|
|
96
126
|
} catch (error) {
|
|
97
127
|
if (is_absent(error)) return void 0;
|
|
98
128
|
throw error;
|
|
99
129
|
}
|
|
100
130
|
}
|
|
101
|
-
function read_file_or_empty(
|
|
102
|
-
return read_optional(
|
|
131
|
+
function read_file_or_empty(path9) {
|
|
132
|
+
return read_optional(path9) ?? "";
|
|
103
133
|
}
|
|
104
|
-
function read_if_readable(
|
|
134
|
+
function read_if_readable(path9) {
|
|
105
135
|
try {
|
|
106
|
-
return readFileSync(
|
|
136
|
+
return readFileSync(path9, "utf8");
|
|
107
137
|
} catch {
|
|
108
138
|
return void 0;
|
|
109
139
|
}
|
|
@@ -131,8 +161,8 @@ function is_real_label(token) {
|
|
|
131
161
|
function label_references(text) {
|
|
132
162
|
return matches(text, LABEL_PATTERN).map((match) => match[1] ?? "").filter((token) => is_real_label(token));
|
|
133
163
|
}
|
|
134
|
-
function base_name(
|
|
135
|
-
return
|
|
164
|
+
function base_name(path9) {
|
|
165
|
+
return path9.split("/").at(-1) ?? path9;
|
|
136
166
|
}
|
|
137
167
|
function is_placeholder_file(name) {
|
|
138
168
|
return name.includes("<") || PLACEHOLDER_FILES.has(base_name(name).toLowerCase());
|
|
@@ -313,7 +343,7 @@ var document_section = {
|
|
|
313
343
|
};
|
|
314
344
|
|
|
315
345
|
// scripts/document/bash-output-cap.ts
|
|
316
|
-
var SETTINGS_FILE =
|
|
346
|
+
var SETTINGS_FILE = path3.join(".claude", "settings.json");
|
|
317
347
|
var HARNESS_DEFAULT_CAP_CHARS = 3e4;
|
|
318
348
|
var ENV_KEY = "env";
|
|
319
349
|
var CAP_KEY = "BASH_MAX_OUTPUT_LENGTH";
|
|
@@ -330,14 +360,14 @@ function declared_cap(text) {
|
|
|
330
360
|
}
|
|
331
361
|
}
|
|
332
362
|
function bash_output_cap(root) {
|
|
333
|
-
const text = document_section.read_optional(
|
|
363
|
+
const text = document_section.read_optional(path3.join(root, SETTINGS_FILE)) ?? "";
|
|
334
364
|
const chars = Number(declared_cap(text));
|
|
335
365
|
return Number.isSafeInteger(chars) && chars > NONE ? chars : HARNESS_DEFAULT_CAP_CHARS;
|
|
336
366
|
}
|
|
337
367
|
var bash_output_cap_reader = { HARNESS_DEFAULT_CAP_CHARS, bash_output_cap };
|
|
338
368
|
|
|
339
369
|
// scripts/document/capped-print-part.ts
|
|
340
|
-
import
|
|
370
|
+
import path4 from "node:path";
|
|
341
371
|
var DIRECTORY_PREFIX = "josh-capped-print-";
|
|
342
372
|
var PART_PREFIX = "part-";
|
|
343
373
|
var PART_SUFFIX = ".md";
|
|
@@ -346,8 +376,8 @@ function part_name(index) {
|
|
|
346
376
|
return `${PART_PREFIX}${String(index + 1)}${PART_SUFFIX}`;
|
|
347
377
|
}
|
|
348
378
|
function is_part_file(absolute) {
|
|
349
|
-
const parent =
|
|
350
|
-
return parent.startsWith(DIRECTORY_PREFIX) && PART_PATTERN.test(
|
|
379
|
+
const parent = path4.basename(path4.dirname(absolute));
|
|
380
|
+
return parent.startsWith(DIRECTORY_PREFIX) && PART_PATTERN.test(path4.basename(absolute));
|
|
351
381
|
}
|
|
352
382
|
var capped_print_part = { DIRECTORY_PREFIX, part_name, is_part_file };
|
|
353
383
|
|
|
@@ -356,9 +386,9 @@ var FILE_MODE = 384;
|
|
|
356
386
|
var LINE_BREAK2 = "\n";
|
|
357
387
|
var HEADROOM_CHARS = 512;
|
|
358
388
|
function write_parts(label, text, cap) {
|
|
359
|
-
const directory = mkdtempSync(
|
|
389
|
+
const directory = mkdtempSync(path5.join(PLATFORM_TEMP_ROOT, capped_print_part.DIRECTORY_PREFIX));
|
|
360
390
|
return review_diff_parts.part_texts(label, text, cap).map((part, index) => {
|
|
361
|
-
const file =
|
|
391
|
+
const file = path5.join(directory, capped_print_part.part_name(index));
|
|
362
392
|
writeFileSync(file, part, { flag: "wx", mode: FILE_MODE });
|
|
363
393
|
return file;
|
|
364
394
|
});
|
|
@@ -385,13 +415,13 @@ function capped_print(text, label, root = process.cwd()) {
|
|
|
385
415
|
var capped_output = { HEADROOM_CHARS, capped_print };
|
|
386
416
|
|
|
387
417
|
// scripts/document/entry-read-set.ts
|
|
388
|
-
import { existsSync } from "node:fs";
|
|
389
|
-
import
|
|
418
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
419
|
+
import path7 from "node:path";
|
|
390
420
|
|
|
391
421
|
// scripts/init/init-paths.ts
|
|
392
|
-
import
|
|
422
|
+
import path6 from "node:path";
|
|
393
423
|
import { fileURLToPath } from "node:url";
|
|
394
|
-
var PACKAGE_DIR =
|
|
424
|
+
var PACKAGE_DIR = path6.join(path6.dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
395
425
|
var PROJECT_ROOT = process.cwd();
|
|
396
426
|
|
|
397
427
|
// scripts/cost-runtime/cost-tokens.ts
|
|
@@ -517,7 +547,7 @@ var read_set_point_of_use = {
|
|
|
517
547
|
// scripts/document/entry-read-set.ts
|
|
518
548
|
var { POINT_OF_USE_FILES: POINT_OF_USE_FILES2, POINT_OF_USE_BY_ENTRY: POINT_OF_USE_BY_ENTRY2, is_point_of_use: is_point_of_use2, point_of_use_files: point_of_use_files2 } = read_set_point_of_use;
|
|
519
549
|
var { cost_of: cost_of2, scoped_file_cost: scoped_file_cost2, total: total2 } = read_set_cost;
|
|
520
|
-
var SKILL_DIRECTORY =
|
|
550
|
+
var SKILL_DIRECTORY = path7.join(".claude", "skills", "workflow-commands");
|
|
521
551
|
var SKILL_FILE = "SKILL.md";
|
|
522
552
|
var TABLE_SECTION = "1. Which file to read";
|
|
523
553
|
var NOTHING2 = 0;
|
|
@@ -529,11 +559,11 @@ var ENTRY_KEYWORD = /`(?<keyword>[a-z]+)/u;
|
|
|
529
559
|
var SECTION_REFERENCE = /`(?<file>[\w.-]+\.md)` *→ *"(?<heading>[^"]+)"/gu;
|
|
530
560
|
var WHITESPACE_RUN = /\s+/gu;
|
|
531
561
|
function document_path(root, name) {
|
|
532
|
-
const in_project =
|
|
533
|
-
const in_package =
|
|
534
|
-
const project_manifest =
|
|
535
|
-
if (root !== "" &&
|
|
536
|
-
return
|
|
562
|
+
const in_project = path7.join(root, SKILL_DIRECTORY, name);
|
|
563
|
+
const in_package = path7.join(PACKAGE_DIR, SKILL_DIRECTORY, name);
|
|
564
|
+
const project_manifest = path7.join(root, "package.json");
|
|
565
|
+
if (root !== "" && existsSync2(project_manifest) && existsSync2(in_package)) return in_package;
|
|
566
|
+
return existsSync2(in_project) ? in_project : in_package;
|
|
537
567
|
}
|
|
538
568
|
function read_document(root, name) {
|
|
539
569
|
return document_section.read_optional(document_path(root, name)) ?? "";
|
|
@@ -721,11 +751,14 @@ var FILE_ARGUMENT = 0;
|
|
|
721
751
|
var HEADING_ARGUMENT = 1;
|
|
722
752
|
var NO_CANDIDATE = 0;
|
|
723
753
|
var USAGE = 'Usage: josh doc:section <file.md> "<heading>"';
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
754
|
+
var PACKAGE_DIRECTORY = find_package_directory(path8.dirname(fileURLToPath2(import.meta.url)));
|
|
755
|
+
function candidates_under(directory, name) {
|
|
756
|
+
return [path8.resolve(directory, name), entry_read_set.document_path(directory, name)];
|
|
757
|
+
}
|
|
758
|
+
function resolve_document(name, root = process.cwd(), package_directory = PACKAGE_DIRECTORY) {
|
|
759
|
+
const named = path8.resolve(root, name);
|
|
760
|
+
const candidates2 = [...candidates_under(root, name), ...candidates_under(package_directory, name)];
|
|
761
|
+
return candidates2.find((candidate) => existsSync3(candidate)) ?? named;
|
|
729
762
|
}
|
|
730
763
|
function report_missing(markdown, heading) {
|
|
731
764
|
const near = document_section.candidates(markdown, heading);
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
load_environment_file,
|
|
10
10
|
notice_refusal_path,
|
|
11
11
|
refusal_path
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-A65Y4YOR.js";
|
|
13
|
+
import "./chunk-JP45SOCJ.js";
|
|
14
|
+
import "./chunk-6TS2JD6D.js";
|
|
15
|
+
import "./chunk-TNUMY6NL.js";
|
|
16
|
+
import "./chunk-LAOV7NLM.js";
|
|
17
|
+
import "./chunk-APUO6U4J.js";
|
|
18
18
|
import "./chunk-DGT54IH5.js";
|
|
19
19
|
export {
|
|
20
20
|
DISABLED_VALUES,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// scripts/observations/observation-ledger.ts
|
|
2
|
+
var OBSERVATION_LEDGER_DIRECTORY = ".josh/observations";
|
|
3
|
+
var LEGACY_OBSERVATION_LEDGER_DIRECTORY = "docs/maintainers/observations";
|
|
4
|
+
var LEDGER_DIRECTORIES = [
|
|
5
|
+
OBSERVATION_LEDGER_DIRECTORY,
|
|
6
|
+
LEGACY_OBSERVATION_LEDGER_DIRECTORY
|
|
7
|
+
];
|
|
8
|
+
var LEDGER_FILE_EXTENSION = ".md";
|
|
9
|
+
var LEGACY_LEDGER_FILE = `legacy${LEDGER_FILE_EXTENSION}`;
|
|
10
|
+
var LEGACY_OBSERVATION_LEDGER_PATHS = [
|
|
11
|
+
"docs/maintainers/observations.md",
|
|
12
|
+
"docs/observations.md"
|
|
13
|
+
];
|
|
14
|
+
var STATUS_PATH_INDEX = 3;
|
|
15
|
+
function status_path(line) {
|
|
16
|
+
return line.slice(STATUS_PATH_INDEX).trim();
|
|
17
|
+
}
|
|
18
|
+
function ledger_file(name) {
|
|
19
|
+
return `${OBSERVATION_LEDGER_DIRECTORY}/${String(name)}${LEDGER_FILE_EXTENSION}`;
|
|
20
|
+
}
|
|
21
|
+
function is_ledger_file_name(name) {
|
|
22
|
+
return name.endsWith(LEDGER_FILE_EXTENSION);
|
|
23
|
+
}
|
|
24
|
+
var MIGRATION_CLAIM_SUFFIX = ".migrating";
|
|
25
|
+
function is_legacy_directory_file(file_path) {
|
|
26
|
+
return file_path.startsWith(`${LEGACY_OBSERVATION_LEDGER_DIRECTORY}/`);
|
|
27
|
+
}
|
|
28
|
+
function is_migration_claim(file_path) {
|
|
29
|
+
if (!file_path.endsWith(MIGRATION_CLAIM_SUFFIX)) return false;
|
|
30
|
+
return is_legacy_directory_file(file_path) || LEGACY_OBSERVATION_LEDGER_PATHS.some((legacy) => file_path.startsWith(`${legacy}.`));
|
|
31
|
+
}
|
|
32
|
+
function is_in_directory(file_path) {
|
|
33
|
+
return LEDGER_DIRECTORIES.some((directory) => file_path.startsWith(`${directory}/`));
|
|
34
|
+
}
|
|
35
|
+
function is_ledger_path(file_path) {
|
|
36
|
+
return is_in_directory(file_path) || LEGACY_OBSERVATION_LEDGER_PATHS.includes(file_path) || is_migration_claim(file_path);
|
|
37
|
+
}
|
|
38
|
+
function is_ledger_line(line) {
|
|
39
|
+
return is_ledger_path(status_path(line));
|
|
40
|
+
}
|
|
41
|
+
function ledger_paths(status_output) {
|
|
42
|
+
return status_output.split("\n").filter((line) => is_ledger_line(line)).map((line) => status_path(line));
|
|
43
|
+
}
|
|
44
|
+
function has_pending_append(status_output) {
|
|
45
|
+
return status_output.split("\n").some((line) => is_ledger_line(line));
|
|
46
|
+
}
|
|
47
|
+
var observation_ledger = {
|
|
48
|
+
has_pending_append,
|
|
49
|
+
is_ledger_file_name,
|
|
50
|
+
is_ledger_line,
|
|
51
|
+
is_ledger_path,
|
|
52
|
+
is_migration_claim,
|
|
53
|
+
ledger_file,
|
|
54
|
+
ledger_paths,
|
|
55
|
+
status_path
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
OBSERVATION_LEDGER_DIRECTORY,
|
|
60
|
+
LEGACY_OBSERVATION_LEDGER_DIRECTORY,
|
|
61
|
+
LEDGER_FILE_EXTENSION,
|
|
62
|
+
LEGACY_LEDGER_FILE,
|
|
63
|
+
LEGACY_OBSERVATION_LEDGER_PATHS,
|
|
64
|
+
MIGRATION_CLAIM_SUFFIX,
|
|
65
|
+
observation_ledger
|
|
66
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
time_density_hook,
|
|
3
3
|
time_hook_transcript
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TNUMY6NL.js";
|
|
5
5
|
import {
|
|
6
6
|
josh_environment_file
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LAOV7NLM.js";
|
|
8
8
|
import {
|
|
9
9
|
json_value
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-APUO6U4J.js";
|
|
11
11
|
import {
|
|
12
12
|
stamp_file
|
|
13
13
|
} from "./chunk-DGT54IH5.js";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
investigation_reads
|
|
3
|
+
} from "./chunk-PTICX4OL.js";
|
|
4
|
+
import {
|
|
5
|
+
agent_session_role
|
|
6
|
+
} from "./chunk-UPUZF3AN.js";
|
|
7
|
+
import {
|
|
8
|
+
lane_guard_policy
|
|
9
|
+
} from "./chunk-JP45SOCJ.js";
|
|
10
|
+
import {
|
|
11
|
+
hook_decision
|
|
12
|
+
} from "./chunk-6TS2JD6D.js";
|
|
13
|
+
|
|
14
|
+
// scripts/delegation/investigation-guard.ts
|
|
15
|
+
import { text } from "node:stream/consumers";
|
|
16
|
+
import { fileURLToPath } from "node:url";
|
|
17
|
+
var SWITCH_ENV_KEY = "JOSH_INVESTIGATION_GUARD";
|
|
18
|
+
var STAMP_PREFIX = "josh-investigation-guard-";
|
|
19
|
+
function should_block(tail, call, refused_at_ms, run) {
|
|
20
|
+
if (agent_session_role.is_reviewer() || lane_guard_policy.mode_here("investigation") !== "refuse") {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return investigation_reads.should_block(tail, call, refused_at_ms, run);
|
|
24
|
+
}
|
|
25
|
+
var GUARD = hook_decision.create_transcript_guard({
|
|
26
|
+
prefix: STAMP_PREFIX,
|
|
27
|
+
switch_key: SWITCH_ENV_KEY,
|
|
28
|
+
is_candidate: investigation_reads.is_refusable_call,
|
|
29
|
+
should_block,
|
|
30
|
+
reason: investigation_reads.REASON
|
|
31
|
+
});
|
|
32
|
+
var investigation_refusal = GUARD.refusal;
|
|
33
|
+
var investigation_outcome = GUARD.outcome;
|
|
34
|
+
var { is_enabled, refusal_path } = GUARD;
|
|
35
|
+
var { deny_envelope, load_environment_file, DISABLED_VALUES } = hook_decision;
|
|
36
|
+
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
37
|
+
if (process.stdin.isTTY) hook_decision.report_no_payload("investigation:guard");
|
|
38
|
+
else hook_decision.write_outcome(await text(process.stdin), investigation_outcome);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
SWITCH_ENV_KEY,
|
|
43
|
+
investigation_refusal,
|
|
44
|
+
investigation_outcome,
|
|
45
|
+
is_enabled,
|
|
46
|
+
refusal_path,
|
|
47
|
+
deny_envelope,
|
|
48
|
+
load_environment_file,
|
|
49
|
+
DISABLED_VALUES
|
|
50
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
lane_guard_policy
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JP45SOCJ.js";
|
|
4
4
|
import {
|
|
5
5
|
hook_decision
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6TS2JD6D.js";
|
|
7
7
|
import {
|
|
8
8
|
time_batch_guard
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TNUMY6NL.js";
|
|
10
10
|
|
|
11
11
|
// scripts/hooks/batch-guard.ts
|
|
12
12
|
import { text } from "node:stream/consumers";
|
|
@@ -1009,7 +1009,7 @@ var WATCH_VERDICT = "watch";
|
|
|
1009
1009
|
var STOP_VERDICT = "stop";
|
|
1010
1010
|
var TRIAGE_VERDICT = "triage";
|
|
1011
1011
|
var ANSWERS = ["blocked", "candidates", "exhausted", "parked", "unreadable", "untriaged"];
|
|
1012
|
-
var BLOCKED_REASON = "Everything opted in is blocked or already running, so waiting can still change the answer.
|
|
1012
|
+
var BLOCKED_REASON = "Everything opted in is blocked or already running, so waiting can still change the answer. Ask again at the re-ask floor (60 s).";
|
|
1013
1013
|
var TRIAGE_REASON = "An opted-in candidate carries neither `run:solo` nor `run:lane`, so nothing starts until it is judged. Read each issue named above, record its order and one of the two labels with a comment, then ask again.";
|
|
1014
1014
|
var EMPTY_BACKLOG = "The backlog is empty";
|
|
1015
1015
|
var WAITING_ON = {
|
|
@@ -1030,7 +1030,7 @@ function max_reached_reason(merged, max_issues) {
|
|
|
1030
1030
|
return `This run's maximum of ${String(max_issues)} is reached, with ${String(merged)} merged. Report what was done, including how many were picked up during an idle watch, and finish.`;
|
|
1031
1031
|
}
|
|
1032
1032
|
function draining_reason(running, reason) {
|
|
1033
|
-
return `Start nothing more and
|
|
1033
|
+
return `Start nothing more and wait on \`pnpm josh lane:await\` until the running children merge (running: ${String(running)}). Then report and finish \u2014 ${reason}`;
|
|
1034
1034
|
}
|
|
1035
1035
|
function idle_expired_reason(answer, idle_budget_ms) {
|
|
1036
1036
|
return `${waiting_on(answer)}, and stayed so for the whole ${to_minutes(idle_budget_ms)}-minute idle watch. Report what was done, including how many were picked up during the watch, and finish.`;
|
|
@@ -1039,7 +1039,7 @@ function idle_watch_reason(answer, left_ms) {
|
|
|
1039
1039
|
return `${waiting_on(answer)} and the idle watch has about ${to_minutes(left_ms)} minutes left. Release the working tree, ask again in ${String(OFFER_INTERVAL_SECONDS)} seconds, and restart the watch the moment a candidate appears.`;
|
|
1040
1040
|
}
|
|
1041
1041
|
function running_watch_reason(answer, running, left_ms) {
|
|
1042
|
-
return `${waiting_on(answer)} and the idle watch has about ${to_minutes(left_ms)} minutes left, with ${String(running)} still running. Keep the working tree
|
|
1042
|
+
return `${waiting_on(answer)} and the idle watch has about ${to_minutes(left_ms)} minutes left, with ${String(running)} still running. Keep the working tree and wait on \`pnpm josh lane:await\` until they merge \u2014 the watch is running down meanwhile.`;
|
|
1043
1043
|
}
|
|
1044
1044
|
function watching_reason(input, left_ms) {
|
|
1045
1045
|
if (input.running === 0) return idle_watch_reason(input.answer, left_ms);
|
|
@@ -2340,14 +2340,93 @@ var ports = {
|
|
|
2340
2340
|
import { z as z3 } from "zod";
|
|
2341
2341
|
var process_owner_schema = z3.object({ pid: z3.number(), process_start: z3.string().optional() });
|
|
2342
2342
|
|
|
2343
|
+
// scripts/git/git-schemas.ts
|
|
2344
|
+
import { z as z4 } from "zod";
|
|
2345
|
+
var package_name_schema = z4.object({ name: z4.string().min(1) });
|
|
2346
|
+
var rollup_item_schema = z4.looseObject({
|
|
2347
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- GraphQL field name from GitHub API
|
|
2348
|
+
__typename: z4.string().optional(),
|
|
2349
|
+
state: z4.string().optional(),
|
|
2350
|
+
status: z4.string().optional(),
|
|
2351
|
+
conclusion: z4.string().optional(),
|
|
2352
|
+
name: z4.string().optional(),
|
|
2353
|
+
context: z4.string().optional(),
|
|
2354
|
+
description: z4.string().nullish()
|
|
2355
|
+
});
|
|
2356
|
+
var pr_raw_schema = z4.object({
|
|
2357
|
+
statusCheckRollup: z4.array(rollup_item_schema).optional(),
|
|
2358
|
+
mergeStateStatus: z4.string().optional(),
|
|
2359
|
+
reviewDecision: z4.string().optional()
|
|
2360
|
+
});
|
|
2361
|
+
var pull_comment_schema = z4.object({
|
|
2362
|
+
body: z4.string().optional(),
|
|
2363
|
+
html_url: z4.string().optional(),
|
|
2364
|
+
user: z4.object({ login: z4.string().optional() }).optional()
|
|
2365
|
+
});
|
|
2366
|
+
var ai_review_pull_comment_schema = z4.object({
|
|
2367
|
+
body: z4.string().optional(),
|
|
2368
|
+
url: z4.string().optional(),
|
|
2369
|
+
author: z4.object({ login: z4.string().optional() }).optional()
|
|
2370
|
+
});
|
|
2371
|
+
var pr_info_schema = z4.object({
|
|
2372
|
+
mergeable: z4.union([z4.boolean(), z4.string()]).nullable().optional(),
|
|
2373
|
+
mergeStateStatus: z4.string().nullable().optional(),
|
|
2374
|
+
state: z4.string().optional()
|
|
2375
|
+
});
|
|
2376
|
+
var epic_issue_schema = z4.object({
|
|
2377
|
+
number: z4.number(),
|
|
2378
|
+
body: z4.string().optional()
|
|
2379
|
+
});
|
|
2380
|
+
var blocking_issue_schema = z4.object({
|
|
2381
|
+
number: z4.number(),
|
|
2382
|
+
state: z4.string().optional(),
|
|
2383
|
+
repository_url: z4.string().optional()
|
|
2384
|
+
});
|
|
2385
|
+
var blocked_by_schema = z4.object({
|
|
2386
|
+
nodes: z4.array(blocking_issue_schema).default([]),
|
|
2387
|
+
totalCount: z4.number().optional()
|
|
2388
|
+
}).optional();
|
|
2389
|
+
var epic_child_schema = z4.object({
|
|
2390
|
+
state: z4.string().optional(),
|
|
2391
|
+
blockedBy: blocked_by_schema
|
|
2392
|
+
});
|
|
2393
|
+
var rest_comment_schema = z4.looseObject({
|
|
2394
|
+
body: z4.string().nullish(),
|
|
2395
|
+
html_url: z4.string().optional(),
|
|
2396
|
+
user: z4.looseObject({ login: z4.string().optional() }).nullish()
|
|
2397
|
+
});
|
|
2398
|
+
var issue_label_schema = z4.object({ name: z4.string() });
|
|
2399
|
+
var epic_subject_schema = z4.object({
|
|
2400
|
+
number: z4.number(),
|
|
2401
|
+
state: z4.string().optional(),
|
|
2402
|
+
labels: z4.array(issue_label_schema).optional(),
|
|
2403
|
+
body: z4.string().optional()
|
|
2404
|
+
});
|
|
2405
|
+
var open_issue_schema = z4.object({
|
|
2406
|
+
number: z4.number(),
|
|
2407
|
+
title: z4.string(),
|
|
2408
|
+
labels: z4.array(issue_label_schema).optional(),
|
|
2409
|
+
createdAt: z4.string(),
|
|
2410
|
+
blockedBy: blocked_by_schema,
|
|
2411
|
+
// Present only on the pickup listing, which reads it for the paths each issue declares.
|
|
2412
|
+
body: z4.string().optional()
|
|
2413
|
+
});
|
|
2414
|
+
|
|
2343
2415
|
export {
|
|
2344
2416
|
json_value,
|
|
2417
|
+
process_identity,
|
|
2418
|
+
process_owner_schema,
|
|
2419
|
+
issue_number_shape,
|
|
2420
|
+
lane_paths,
|
|
2345
2421
|
PORT_SEED_KEY,
|
|
2346
2422
|
LANE_SEAT_KEY,
|
|
2347
2423
|
ENV_FILE_NAME,
|
|
2348
2424
|
ports,
|
|
2349
|
-
|
|
2350
|
-
|
|
2425
|
+
pr_raw_schema,
|
|
2426
|
+
blocking_issue_schema,
|
|
2427
|
+
rest_comment_schema,
|
|
2428
|
+
issue_label_schema,
|
|
2429
|
+
open_issue_schema,
|
|
2351
2430
|
PORCELAIN_FLAG,
|
|
2352
2431
|
UNTRACKED_FILES_FLAG,
|
|
2353
2432
|
git_utilities,
|
|
@@ -2358,11 +2437,10 @@ export {
|
|
|
2358
2437
|
git_location_environment,
|
|
2359
2438
|
git_spawn_sync,
|
|
2360
2439
|
git_command,
|
|
2440
|
+
changed_paths,
|
|
2361
2441
|
cli_flags,
|
|
2362
2442
|
backlog_budget,
|
|
2363
|
-
issue_number_shape,
|
|
2364
2443
|
run_invocation,
|
|
2365
|
-
lane_paths,
|
|
2366
2444
|
file_reader,
|
|
2367
2445
|
time_instant,
|
|
2368
2446
|
cost_usage,
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ancestor_directories
|
|
3
|
+
} from "./chunk-GP4IEC4O.js";
|
|
4
|
+
|
|
1
5
|
// scripts/build/local-bin.ts
|
|
2
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
7
|
import { createRequire } from "node:module";
|
|
4
|
-
import path2 from "node:path";
|
|
5
|
-
|
|
6
|
-
// scripts/lib/ancestor-directories.ts
|
|
7
8
|
import path from "node:path";
|
|
8
|
-
var MAX_DEPTH = 64;
|
|
9
|
-
function list(start_directory) {
|
|
10
|
-
const directories = [];
|
|
11
|
-
let current = path.resolve(start_directory);
|
|
12
|
-
while (directories.length < MAX_DEPTH && !directories.includes(current)) {
|
|
13
|
-
directories.push(current);
|
|
14
|
-
current = path.dirname(current);
|
|
15
|
-
}
|
|
16
|
-
return directories;
|
|
17
|
-
}
|
|
18
|
-
function nearest(start_directory, is_match) {
|
|
19
|
-
return list(start_directory).find((directory) => is_match(directory));
|
|
20
|
-
}
|
|
21
|
-
var ancestor_directories = { list, nearest };
|
|
22
9
|
|
|
23
10
|
// scripts/lib/schemas.ts
|
|
24
11
|
import { z } from "zod";
|
|
@@ -60,23 +47,23 @@ var WINDOWS_SHIM_SUFFIX = ".cmd";
|
|
|
60
47
|
var PACKAGE_JSON = "package.json";
|
|
61
48
|
function resolve_local_bin(project_root, bin_name) {
|
|
62
49
|
const shim = process.platform === WINDOWS_PLATFORM ? `${bin_name}${WINDOWS_SHIM_SUFFIX}` : bin_name;
|
|
63
|
-
return
|
|
50
|
+
return path.join(project_root, NODE_MODULES, BIN_DIR, shim);
|
|
64
51
|
}
|
|
65
52
|
function find_local_bin_upwards(start_directory, bin_name) {
|
|
66
53
|
return ancestor_directories.list(start_directory).map((directory) => resolve_local_bin(directory, bin_name)).find((candidate) => existsSync(candidate));
|
|
67
54
|
}
|
|
68
55
|
function read_bin_entry(manifest_path, package_name, bin_name) {
|
|
69
56
|
const { bin } = package_bin_schema.parse(JSON.parse(readFileSync(manifest_path, "utf8")));
|
|
70
|
-
if (typeof bin === "string") return bin_name ===
|
|
57
|
+
if (typeof bin === "string") return bin_name === path.basename(package_name) ? bin : void 0;
|
|
71
58
|
return bin?.[bin_name];
|
|
72
59
|
}
|
|
73
60
|
function resolve_package_bin(base_directory, package_name, bin_name) {
|
|
74
61
|
try {
|
|
75
|
-
const resolve_from = createRequire(
|
|
62
|
+
const resolve_from = createRequire(path.join(base_directory, PACKAGE_JSON));
|
|
76
63
|
const manifest_path = resolve_from.resolve(`${package_name}/${PACKAGE_JSON}`);
|
|
77
64
|
const bin_entry = read_bin_entry(manifest_path, package_name, bin_name);
|
|
78
65
|
if (bin_entry === void 0) return void 0;
|
|
79
|
-
const cli_entry =
|
|
66
|
+
const cli_entry = path.join(path.dirname(manifest_path), bin_entry);
|
|
80
67
|
return existsSync(cli_entry) ? cli_entry : void 0;
|
|
81
68
|
} catch {
|
|
82
69
|
return void 0;
|
|
@@ -84,7 +71,6 @@ function resolve_package_bin(base_directory, package_name, bin_name) {
|
|
|
84
71
|
}
|
|
85
72
|
|
|
86
73
|
export {
|
|
87
|
-
ancestor_directories,
|
|
88
74
|
vscode_settings_schema,
|
|
89
75
|
json_object_schema,
|
|
90
76
|
string_array_schema,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// scripts/lib/ancestor-directories.ts
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
var MAX_DEPTH = 64;
|
|
4
|
+
function list(start_directory) {
|
|
5
|
+
const directories = [];
|
|
6
|
+
let current = path.resolve(start_directory);
|
|
7
|
+
while (directories.length < MAX_DEPTH && !directories.includes(current)) {
|
|
8
|
+
directories.push(current);
|
|
9
|
+
current = path.dirname(current);
|
|
10
|
+
}
|
|
11
|
+
return directories;
|
|
12
|
+
}
|
|
13
|
+
function nearest(start_directory, is_match) {
|
|
14
|
+
return list(start_directory).find((directory) => is_match(directory));
|
|
15
|
+
}
|
|
16
|
+
var ancestor_directories = { list, nearest };
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
ancestor_directories
|
|
20
|
+
};
|