@joshuafolkken/kit 1.1005.0 → 1.1035.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 +1 -5
- package/.claude/skills/dependency-update/SKILL.md +6 -3
- package/.claude/skills/epic-commands/SKILL.md +46 -17
- package/.claude/skills/workflow-commands/SKILL.md +8 -23
- package/.claude/skills/workflow-commands/backlogrun-child.md +4 -2
- package/.claude/skills/workflow-commands/backlogrun.md +3 -12
- package/.claude/skills/workflow-commands/fullrun-steps.md +4 -3
- package/.claude/skills/workflow-commands/fullrun.md +1 -1
- package/.claude/skills/workflow-commands/halfrun.md +2 -1
- package/.claude/skills/workflow-commands/into-target.md +1 -1
- package/.claude/skills/workflow-commands/observation-filing.md +42 -43
- package/.claude/skills/workflow-commands/prerequisite.md +1 -1
- package/.codex/hooks.json +1 -5
- package/.github/workflows/sonar-qube.yml +1 -1
- package/AGENTS.md +4 -25
- package/CLAUDE.md +24 -38
- package/GEMINI.md +4 -24
- package/README.md +22 -58
- package/dist/CLAUDE.md +24 -38
- package/dist/hooks/batch-guard.js +4 -4
- package/dist/hooks/{chunk-WMIR5SNX.js → chunk-D67KVGGY.js} +3 -3
- package/dist/hooks/{chunk-EZLHXKJ6.js → chunk-EIFCAJRB.js} +70 -27
- package/dist/hooks/{chunk-KPZN42RT.js → chunk-GJT4BNVE.js} +3 -3
- package/dist/hooks/{chunk-PAXMLGSS.js → chunk-GLBDBJOK.js} +44 -24
- package/dist/hooks/{chunk-GBJUERYK.js → chunk-HOYJU5RM.js} +1 -1
- package/dist/hooks/{chunk-6PSTVOLH.js → chunk-HU66PWWL.js} +33 -57
- package/dist/hooks/{chunk-A2H5I2VD.js → chunk-KG6PZD72.js} +2 -2
- package/dist/hooks/{chunk-AWTFKKFW.js → chunk-XPLP27WA.js} +3 -8
- package/dist/hooks/{chunk-4GDR2YTV.js → chunk-Y27M6A7X.js} +4 -4
- package/dist/hooks/{chunk-56LGMJJV.js → chunk-ZXNE6NY3.js} +2 -2
- package/dist/hooks/codex-hook-adapter.js +10 -10
- package/dist/hooks/duplicate-read-guard.js +5 -5
- package/dist/hooks/format-edited.js +2 -2
- package/dist/hooks/investigation-guard.js +5 -5
- package/dist/hooks/pretool-guard.js +9 -9
- package/dist/hooks/stop-guard.js +11 -15
- package/dist/josh.js +38 -19
- package/dist/version/index.js +93 -41
- package/eslint/base.js +2 -11
- package/package.json +32 -6
- package/prompts/coding-standards.md +15 -290
- package/prompts/collaboration-workflow/cross-repo-epic.md +2 -51
- package/prompts/collaboration-workflow/epic-audit.md +2 -53
- package/prompts/collaboration-workflow/epic-bundle.md +2 -106
- package/prompts/collaboration-workflow/issue-template.md +4 -4
- package/prompts/collaboration-workflow/operating-rules.md +18 -75
- package/prompts/collaboration-workflow/principles.md +74 -0
- package/prompts/collaboration-workflow/residency.md +54 -14
- package/prompts/collaboration-workflow/rule-delivery.md +1 -11
- package/prompts/collaboration-workflow/upstream-interrupt.md +1 -1
- package/prompts/collaboration-workflow.md +22 -28
- package/scripts/adopt/adopt-logic.ts +2 -2
- package/scripts/adopt/adopt-toolkits.ts +1 -1
- package/scripts/adopt/adopt.ts +2 -2
- package/scripts/agent/agent-event.ts +2 -9
- package/scripts/agent/agent-exit-record.ts +2 -9
- package/scripts/backlog/backlog-budget-cli.ts +2 -6
- package/scripts/backlog/backlog-drive-cli.ts +20 -10
- package/scripts/backlog/backlog-drive.ts +50 -16
- package/scripts/backlog/backlog-offer-cli.ts +6 -5
- package/scripts/backlog/backlog-plan.ts +1 -1
- package/scripts/build/build-bin.ts +2 -1
- package/scripts/build/build-config-merge.ts +2 -1
- package/scripts/build/build-hooks.ts +24 -4
- package/scripts/build/build-managed-marker.ts +2 -1
- package/scripts/build/build-self-sync-guard.ts +2 -1
- package/scripts/build/build-version.ts +2 -1
- package/scripts/cases/cases-logic.ts +2 -6
- package/scripts/ci/pr-classification.ts +13 -11
- package/scripts/cost-runtime/cost-transcript.ts +4 -11
- package/scripts/doctor/doctor-consumer.ts +5 -12
- package/scripts/doctor/doctor-ports.ts +2 -2
- package/scripts/document/document-byte-budget.ts +8 -16
- package/scripts/document/document-section.ts +2 -6
- package/scripts/document/entry-read-budget.ts +1 -1
- package/scripts/{git/git-epic-add-body.ts → epic/epic-add-body.ts} +23 -23
- package/scripts/{git/git-epic-add-plan.ts → epic/epic-add-plan.ts} +23 -26
- package/scripts/{git/git-epic-add.ts → epic/epic-add.ts} +17 -17
- package/scripts/epic/epic-audit-cli.ts +4 -4
- package/scripts/epic/epic-audit-orphans.ts +2 -2
- package/scripts/epic/epic-audit-rationale.ts +1 -1
- package/scripts/epic/epic-audit.ts +1 -1
- package/scripts/{git/git-epic-body.ts → epic/epic-body.ts} +6 -6
- package/scripts/epic/epic-bundle-cli.ts +1 -1
- package/scripts/epic/epic-bundle.ts +2 -2
- package/scripts/epic/epic-candidate-confirm.ts +2 -1
- package/scripts/{git/git-epic-chains.ts → epic/epic-chains.ts} +4 -4
- package/{scripts-ai → scripts/epic}/epic-check.ts +5 -4
- package/{scripts-ai → scripts/epic}/epic-cli.ts +4 -4
- package/scripts/{git/git-epic-close-comment.ts → epic/epic-close-comment.ts} +9 -9
- package/scripts/{git/git-epic-close.ts → epic/epic-close.ts} +23 -19
- package/scripts/epic/epic-cross-repo.ts +21 -38
- package/scripts/{git/git-epic-decision.ts → epic/epic-decision.ts} +12 -14
- package/scripts/epic/epic-fetch.ts +3 -3
- package/scripts/epic/epic-graph.ts +3 -3
- package/scripts/epic/epic-index.ts +2 -2
- package/scripts/epic/epic-issue.ts +1 -1
- package/scripts/epic/epic-next.ts +3 -3
- package/scripts/{git/git-epic-parse.ts → epic/epic-parse.ts} +3 -3
- package/scripts/{git/git-epic-promote.ts → epic/epic-promote.ts} +10 -10
- package/scripts/{git/git-epic-read.ts → epic/epic-read.ts} +9 -9
- package/scripts/{git/git-epic-reconcile.ts → epic/epic-reconcile.ts} +18 -20
- package/scripts/{git/git-epic-reference.ts → epic/epic-reference.ts} +4 -23
- package/scripts/epic/epic-relation-recheck.ts +4 -3
- package/scripts/{git/git-epic-relations.ts → epic/epic-relations.ts} +5 -5
- package/scripts/{git/git-epic-remove-plan.ts → epic/epic-remove-plan.ts} +17 -19
- package/scripts/{git/git-epic-remove.ts → epic/epic-remove.ts} +13 -13
- package/scripts/{git/git-epic-run.ts → epic/epic-run.ts} +27 -27
- package/scripts/{git/git-epic-sections.ts → epic/epic-sections.ts} +6 -6
- package/scripts/{git/git-epic-shape.ts → epic/epic-shape.ts} +7 -7
- package/scripts/{git/git-epic-validate.ts → epic/epic-validate.ts} +13 -13
- package/{scripts-ai → scripts/epic}/epic.ts +17 -16
- package/scripts/gh/fix-gh-packages.ts +2 -1
- package/scripts/gh/gh-spawn.ts +12 -10
- package/scripts/git/constants.ts +1 -1
- package/scripts/git/git-branch.ts +10 -1
- package/scripts/git/git-command.ts +1 -1
- package/scripts/git/git-error.ts +2 -5
- package/{scripts-ai → scripts/git}/git-followup-finish.ts +7 -7
- package/scripts/git/git-followup-flush.ts +74 -48
- package/scripts/git/git-followup-issue-close.ts +2 -2
- package/scripts/git/git-followup-label.ts +1 -1
- package/scripts/git/git-followup-pending.ts +1 -1
- package/{scripts-ai → scripts/git}/git-followup-workflow.ts +23 -11
- package/scripts/git/git-gh-exec.ts +85 -26
- package/scripts/git/git-gh-issue-read.ts +2 -2
- package/scripts/git/git-gh-issue-rest.ts +2 -2
- package/scripts/git/git-gh-issue-write.ts +6 -6
- package/scripts/git/git-gh-pr-read.ts +0 -21
- package/scripts/git/git-gh-pr.ts +2 -23
- package/scripts/git/git-pr-followup-wrapup.ts +2 -6
- package/scripts/git/git-preflight.ts +3 -6
- package/scripts/git/git-staging.ts +21 -9
- package/{scripts-ai → scripts/git}/git-workflow.ts +11 -11
- package/scripts/git/github-issue-url.ts +1 -1
- package/scripts/git/issue-labels.ts +1 -1
- package/scripts/git/issue-reference.ts +19 -0
- package/scripts/git/main-merge.ts +2 -1
- package/scripts/git/main-sync.ts +3 -2
- package/scripts/git/schemas.ts +1 -1
- package/scripts/git/stash-pop-args.ts +7 -13
- package/scripts/git/stash-pop-cli.ts +2 -1
- package/{scripts-ai → scripts/git}/telegram-test-logic.ts +2 -2
- package/{scripts-ai → scripts/git}/telegram-test.ts +7 -7
- package/scripts/hooks/format-rewrite-notice.ts +2 -8
- package/scripts/init/init-ai-copy.ts +23 -14
- package/scripts/init/init.ts +8 -4
- package/scripts/init/start-steps.ts +2 -1
- package/scripts/init/start.ts +2 -1
- package/scripts/issue/issue-comment-cli.ts +2 -1
- package/scripts/issue/issue-file-cli.ts +2 -1
- package/scripts/issue/issue-fold-cli.ts +9 -16
- package/scripts/issue/issue-scout-cli.ts +8 -13
- package/scripts/issue/measure-rerun-cli.ts +7 -6
- package/scripts/josh/josh-commands-ai.ts +2 -2
- package/scripts/josh/josh-commands-backlog.ts +1 -1
- package/scripts/josh/josh-commands-development.ts +1 -1
- package/scripts/josh/josh-commands-workflow.ts +4 -4
- package/scripts/lane/lane-cli.ts +2 -1
- package/scripts/lane/lane-open.ts +3 -2
- package/scripts/lane/lane-registry.ts +3 -6
- package/scripts/lib/cli-flags.ts +20 -2
- package/scripts/lib/error-message.ts +9 -0
- package/scripts/lib/read-file.ts +26 -2
- package/scripts/observations/observation-ledger-home.ts +98 -26
- package/scripts/observations/observation-ledger-migrate.ts +26 -21
- package/scripts/observations/observation-ledger-prepare.ts +10 -20
- package/scripts/observations/observation-ledger.ts +58 -25
- package/scripts/observations/observations-flush-cli.ts +6 -23
- package/scripts/observations/observations-flush-landing.ts +2 -1
- package/scripts/observations/observations-flush.ts +29 -20
- package/scripts/package/package-scout-cli.ts +8 -16
- package/scripts/ports/port-command.ts +2 -1
- package/scripts/propagate/propagate-publish.ts +6 -7
- package/scripts/propagate/propagate-steps.ts +2 -1
- package/scripts/propagate/propagate.ts +3 -2
- package/scripts/refactor/import-graph.ts +2 -6
- package/scripts/registry-migration/migrate.ts +3 -2
- package/scripts/registry-migration/user-npmrc.ts +2 -2
- package/scripts/release/release-cli.ts +2 -1
- package/scripts/repo/repo-setting.ts +10 -8
- package/scripts/review/review-finding-ledger.ts +3 -3
- package/scripts/review/review-findings-cli.ts +4 -11
- package/scripts/review/review-record-cli.ts +14 -11
- package/scripts/review/review-record.ts +6 -16
- package/scripts/rules/decision-oracle.ts +2 -2
- package/scripts/rules/rule-body-guard.ts +2 -2
- package/scripts/rules/rule-value-cache.ts +99 -0
- package/scripts/rules/rule-value-cli.ts +10 -9
- package/scripts/rules/rule-value.ts +1 -1
- package/scripts/run/run-carry-args.ts +2 -6
- package/scripts/run/run-carry-cli.ts +5 -7
- package/scripts/run/run-cut-args.ts +7 -13
- package/scripts/run/run-ending-cli.ts +4 -7
- package/scripts/run/run-event-stream.ts +2 -5
- package/scripts/run/run-liveness-cli.ts +4 -7
- package/scripts/run/run-progress-args.ts +2 -6
- package/scripts/run/run-progress-cli.ts +2 -1
- package/scripts/run/run-tail-cli.ts +3 -3
- package/scripts/run/run-tidy-stashes.ts +7 -14
- package/scripts/run/run-wake-cli.ts +2 -6
- package/scripts/run/run-wake-driver.ts +15 -2
- package/scripts/run/run-wake-session.ts +14 -4
- package/scripts/safe-chain/project-config.ts +3 -6
- package/scripts/security/security-audit-provision.ts +6 -7
- package/scripts/sonar/sonar-hotspots-cli.ts +2 -1
- package/scripts/sync/directory-copy-guard.ts +2 -1
- package/scripts/sync/sync-ai-files.ts +3 -3
- package/scripts/sync/template-source-logic.ts +3 -4
- package/scripts/test/e2e-retry-check.ts +3 -6
- package/scripts/ui/ui-routes-cli.ts +3 -6
- package/scripts/version/bump-version.ts +2 -1
- package/scripts/version/version-remote.ts +18 -27
- package/scripts/version/version-targets.ts +3 -3
- package/.claude/skills/workflow-commands/rule-residency.md +0 -267
- package/evals/scenarios/consult-not-execute.json +0 -20
- package/evals/scenarios/no-implicit-workflow.json +0 -26
- package/evals/scenarios/overrides-both-locations.json +0 -29
- package/evals/scenarios/upstream-interrupt.json +0 -23
- package/evals/scenarios/workflow-skill-loaded.json +0 -16
- package/prompts/agent-lint-protocol.json +0 -79
- package/prompts/agent-rules.md +0 -63
- package/prompts/collaboration-workflow/consultation-vs-execution.md +0 -8
- package/prompts/collaboration-workflow/distributed-docs.md +0 -7
- package/prompts/collaboration-workflow/durable-rules.md +0 -24
- package/prompts/collaboration-workflow/latest-first.md +0 -14
- package/prompts/collaboration-workflow/no-clones.md +0 -11
- package/prompts/collaboration-workflow/simplicity-first.md +0 -9
- package/prompts/collaboration-workflow/single-source-rules.md +0 -13
- package/scripts/build/shim-shell.ts +0 -25
- package/scripts/claude/skill-meta.ts +0 -37
- package/scripts/document/document-scan.ts +0 -108
- package/scripts/document/generate-catalog.ts +0 -69
- package/scripts/document/retired-phrases.ts +0 -143
- package/scripts/document/review-agent-type.ts +0 -46
- package/scripts/document/single-source.ts +0 -73
- package/scripts/git/git-fixture-workspace.ts +0 -88
- package/scripts/hooks/format-edited-file-fixtures.ts +0 -109
- package/scripts/hooks/prompt-hooks.ts +0 -38
- package/scripts/init/hook-command-bootstrap.ts +0 -83
- package/scripts/issue/issue-logic.ts +0 -50
- package/scripts/josh/__snapshots__/josh-command-map.test.ts.snap +0 -1227
- package/scripts/josh/josh-script-reader.ts +0 -11
- package/scripts/package/production-dependency-graph.ts +0 -68
- package/scripts/retrospective/retrospective-cli.ts +0 -97
- package/scripts/retrospective/retrospective.ts +0 -127
- package/scripts/rules/delivered-rules-harness.ts +0 -72
- package/scripts/rules/top-level-scripts-guard.ts +0 -47
- package/scripts/run/run-carry-flush.ts +0 -58
- package/scripts/run/run-transcript.golden.txt +0 -57
- package/scripts/run/run-wake-work.ts +0 -108
- package/scripts/sync/dependabot-pin-logic.ts +0 -135
- package/scripts/test/classify-isolation.ts +0 -149
- package/scripts/test/http-fault-injection.ts +0 -79
- package/scripts/test/josh-harness-environment.ts +0 -260
- package/scripts/test/josh-harness.ts +0 -96
- package/scripts/test/pilot-files.ts +0 -452
- package/scripts/test/pilot-measure.ts +0 -78
- package/scripts/test/test-network-guard.ts +0 -453
- package/scripts/test/test-repository-guard.ts +0 -317
- package/scripts/test/test-state-guard.ts +0 -85
- package/scripts/test/test-stdout-guard.ts +0 -54
- package/scripts/test/test-telegram-guard.ts +0 -90
- package/scripts/test/unit-guard-environment.ts +0 -12
- package/scripts/test/unit-projects.ts +0 -139
- package/scripts/test/vitest-include-globs.ts +0 -12
- package/scripts/time-runtime/time-batch-guard-fixtures.ts +0 -66
- package/scripts-ai/completion-gate.ts +0 -13
- package/scripts-ai/environment-loader.ts +0 -9
- /package/{scripts-ai → scripts/epic}/epic-cli-argv.ts +0 -0
- /package/{scripts-ai → scripts/epic}/epic-cli-remove.ts +0 -0
- /package/{scripts-ai → scripts/git}/followup-issue-number.ts +0 -0
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
lane_child_marker,
|
|
3
3
|
run_issue_number
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HOYJU5RM.js";
|
|
5
5
|
import {
|
|
6
6
|
PLATFORM_TEMP_ROOT,
|
|
7
7
|
cost_blocks,
|
|
8
8
|
cost_usage,
|
|
9
|
+
file_reader,
|
|
9
10
|
json_value,
|
|
10
11
|
lane_paths,
|
|
11
12
|
stamp_file,
|
|
12
13
|
time_density_hook,
|
|
13
14
|
time_shell,
|
|
14
15
|
time_transcript_line
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GLBDBJOK.js";
|
|
16
17
|
import {
|
|
17
18
|
ENV_FILE_NAME,
|
|
18
19
|
LANE_SEAT_KEY,
|
|
@@ -2038,7 +2039,7 @@ function current_owner(repository_path = process.cwd()) {
|
|
|
2038
2039
|
var repo_party = { FIRST_PARTY, THIRD_PARTY, UNKNOWN, classify: classify3, current_owner, target_owner };
|
|
2039
2040
|
|
|
2040
2041
|
// scripts/lane/lane-registry.ts
|
|
2041
|
-
import { existsSync as existsSync2
|
|
2042
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
2042
2043
|
import path3 from "node:path";
|
|
2043
2044
|
|
|
2044
2045
|
// scripts/git/git-ls-remote.ts
|
|
@@ -2528,11 +2529,7 @@ function held_seat(content) {
|
|
|
2528
2529
|
return seat_from_content(content) ?? EMPTY_SEAT;
|
|
2529
2530
|
}
|
|
2530
2531
|
function read_environment(directory) {
|
|
2531
|
-
|
|
2532
|
-
return readFileSync4(path3.join(directory, ENV_FILE_NAME), "utf8");
|
|
2533
|
-
} catch {
|
|
2534
|
-
return void 0;
|
|
2535
|
-
}
|
|
2532
|
+
return file_reader.read_if_readable(path3.join(directory, ENV_FILE_NAME));
|
|
2536
2533
|
}
|
|
2537
2534
|
function branch_issue(branch2) {
|
|
2538
2535
|
if (!branch2?.endsWith(lane_paths.LANE_BRANCH_SUFFIX)) return void 0;
|
|
@@ -2612,7 +2609,6 @@ var lane_registry = {
|
|
|
2612
2609
|
|
|
2613
2610
|
// scripts/backlog/backlog-budget-cli.ts
|
|
2614
2611
|
import { fileURLToPath } from "node:url";
|
|
2615
|
-
import { parseArgs } from "node:util";
|
|
2616
2612
|
|
|
2617
2613
|
// scripts/git/changed-paths.ts
|
|
2618
2614
|
function to_paths(raw) {
|
|
@@ -2675,6 +2671,24 @@ var path_decision = {
|
|
|
2675
2671
|
STAGED_FLAG
|
|
2676
2672
|
};
|
|
2677
2673
|
|
|
2674
|
+
// scripts/lib/cli-flags.ts
|
|
2675
|
+
import { parseArgs } from "node:util";
|
|
2676
|
+
function refuse_unknown_flags(argv, known_flags, command) {
|
|
2677
|
+
const unknown = argv.filter((argument) => !known_flags.includes(argument));
|
|
2678
|
+
if (unknown.length === 0) return void 0;
|
|
2679
|
+
const usage = `Usage: josh ${command} [${known_flags.join("] [")}]`;
|
|
2680
|
+
return `Unknown argument(s): ${unknown.join(" ")}
|
|
2681
|
+
${usage}`;
|
|
2682
|
+
}
|
|
2683
|
+
function parse_or_undefined(config) {
|
|
2684
|
+
try {
|
|
2685
|
+
return parseArgs(config);
|
|
2686
|
+
} catch {
|
|
2687
|
+
return void 0;
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
var cli_flags = { refuse_unknown_flags, parse_or_undefined };
|
|
2691
|
+
|
|
2678
2692
|
// scripts/backlog/backlog-budget-cli.ts
|
|
2679
2693
|
var ARGV_OFFSET = 2;
|
|
2680
2694
|
var SUCCESS_EXIT_CODE = 0;
|
|
@@ -2692,11 +2706,7 @@ var OPTIONS = {
|
|
|
2692
2706
|
started: { type: "string" }
|
|
2693
2707
|
};
|
|
2694
2708
|
function read_arguments(argv) {
|
|
2695
|
-
|
|
2696
|
-
return parseArgs({ args: [...argv], options: OPTIONS, strict: true }).values;
|
|
2697
|
-
} catch {
|
|
2698
|
-
return void 0;
|
|
2699
|
-
}
|
|
2709
|
+
return cli_flags.parse_or_undefined({ args: [...argv], options: OPTIONS, strict: true })?.values;
|
|
2700
2710
|
}
|
|
2701
2711
|
function text_of(value) {
|
|
2702
2712
|
return typeof value === "string" ? value : void 0;
|
|
@@ -3461,6 +3471,12 @@ var parse_json = {
|
|
|
3461
3471
|
read_json_listing
|
|
3462
3472
|
};
|
|
3463
3473
|
|
|
3474
|
+
// scripts/lib/error-message.ts
|
|
3475
|
+
function message_of(error) {
|
|
3476
|
+
return error instanceof Error ? error.message : String(error);
|
|
3477
|
+
}
|
|
3478
|
+
var error_text = { message_of };
|
|
3479
|
+
|
|
3464
3480
|
// scripts/git/git-gh-exec.ts
|
|
3465
3481
|
import { execa as execa4, execaSync as execaSync2 } from "execa";
|
|
3466
3482
|
|
|
@@ -3520,8 +3536,12 @@ function direct_environment() {
|
|
|
3520
3536
|
const removed = agent_session_environment.removed_proxy_environment();
|
|
3521
3537
|
return Object.keys(removed).length > 0 ? { env: removed } : {};
|
|
3522
3538
|
}
|
|
3523
|
-
function to_spawn_options(timeout_ms) {
|
|
3524
|
-
return {
|
|
3539
|
+
function to_spawn_options(timeout_ms, cwd) {
|
|
3540
|
+
return {
|
|
3541
|
+
...to_timeout_option(timeout_ms),
|
|
3542
|
+
...direct_environment(),
|
|
3543
|
+
...cwd !== void 0 && { cwd }
|
|
3544
|
+
};
|
|
3525
3545
|
}
|
|
3526
3546
|
var GH_REQUEST_TIMEOUT_MESSAGE = "gh request timed out";
|
|
3527
3547
|
function has_stderr_field(error) {
|
|
@@ -3533,13 +3553,10 @@ function has_stdout_field(error) {
|
|
|
3533
3553
|
function to_timeout_prefix(error) {
|
|
3534
3554
|
return has_timed_out(error) ? `${GH_REQUEST_TIMEOUT_MESSAGE}: ` : "";
|
|
3535
3555
|
}
|
|
3536
|
-
function to_error_message(error) {
|
|
3537
|
-
return error instanceof Error ? error.message : String(error);
|
|
3538
|
-
}
|
|
3539
3556
|
function to_gh_error(error) {
|
|
3540
3557
|
const stderr = has_stderr_field(error) ? error.stderr.trim() : "";
|
|
3541
3558
|
const stdout = has_stdout_field(error) ? error.stdout.trim() : "";
|
|
3542
|
-
const summary = stderr.length > 0 ? stderr :
|
|
3559
|
+
const summary = stderr.length > 0 ? stderr : error_text.message_of(error);
|
|
3543
3560
|
const detail = stdout.length > 0 ? `${summary}
|
|
3544
3561
|
${stdout}` : summary;
|
|
3545
3562
|
return gh_failure.attach(
|
|
@@ -3547,10 +3564,11 @@ ${stdout}` : summary;
|
|
|
3547
3564
|
gh_failure.classify_stdout(stdout)
|
|
3548
3565
|
);
|
|
3549
3566
|
}
|
|
3550
|
-
async function exec_gh_command(arguments_, timeout_ms) {
|
|
3567
|
+
async function exec_gh_command(arguments_, timeout_ms, cwd) {
|
|
3551
3568
|
await check_gh_installed();
|
|
3569
|
+
const options = to_spawn_options(timeout_ms, cwd);
|
|
3552
3570
|
try {
|
|
3553
|
-
const { stdout } = await execa4("gh", arguments_,
|
|
3571
|
+
const { stdout } = await execa4("gh", arguments_, options);
|
|
3554
3572
|
return stdout.trimEnd();
|
|
3555
3573
|
} catch (error) {
|
|
3556
3574
|
throw to_gh_error(error);
|
|
@@ -3558,7 +3576,7 @@ async function exec_gh_command(arguments_, timeout_ms) {
|
|
|
3558
3576
|
}
|
|
3559
3577
|
async function exec_gh_command_with_stdin(input) {
|
|
3560
3578
|
await check_gh_installed();
|
|
3561
|
-
const options = { input: input.stdin_body, ...to_spawn_options(input.timeout_ms) };
|
|
3579
|
+
const options = { input: input.stdin_body, ...to_spawn_options(input.timeout_ms, input.cwd) };
|
|
3562
3580
|
try {
|
|
3563
3581
|
const { stdout } = await execa4("gh", input.args, options);
|
|
3564
3582
|
return stdout.trimEnd();
|
|
@@ -3571,6 +3589,9 @@ function parse_status_line(output) {
|
|
|
3571
3589
|
const { status: status2 } = STATUS_LINE_PATTERN.exec(output)?.groups ?? {};
|
|
3572
3590
|
return status2 === void 0 ? void 0 : Number(status2);
|
|
3573
3591
|
}
|
|
3592
|
+
function status_of_failure(error) {
|
|
3593
|
+
return has_stdout_field(error) ? parse_status_line(error.stdout) : void 0;
|
|
3594
|
+
}
|
|
3574
3595
|
async function exec_gh_api_status(path4, timeout_ms) {
|
|
3575
3596
|
const options = to_spawn_options(timeout_ms);
|
|
3576
3597
|
try {
|
|
@@ -3578,7 +3599,16 @@ async function exec_gh_api_status(path4, timeout_ms) {
|
|
|
3578
3599
|
const { stdout } = await execa4("gh", ["api", "--include", "--silent", path4], options);
|
|
3579
3600
|
return parse_status_line(stdout);
|
|
3580
3601
|
} catch (error) {
|
|
3581
|
-
return
|
|
3602
|
+
return status_of_failure(error);
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
function exec_gh_api_status_sync(path4, timeout_ms) {
|
|
3606
|
+
const options = to_spawn_options(timeout_ms);
|
|
3607
|
+
try {
|
|
3608
|
+
const { stdout } = execaSync2("gh", ["api", "--include", "--silent", path4], options);
|
|
3609
|
+
return parse_status_line(stdout);
|
|
3610
|
+
} catch (error) {
|
|
3611
|
+
return status_of_failure(error);
|
|
3582
3612
|
}
|
|
3583
3613
|
}
|
|
3584
3614
|
var METHOD_FLAG = "--method";
|
|
@@ -3605,16 +3635,19 @@ function to_gh_api_args(request) {
|
|
|
3605
3635
|
}
|
|
3606
3636
|
async function exec_gh_api(request) {
|
|
3607
3637
|
const args = to_gh_api_args(request);
|
|
3608
|
-
if (request.body === void 0)
|
|
3638
|
+
if (request.body === void 0) {
|
|
3639
|
+
return await exec_gh_command(args, request.timeout_ms, request.cwd);
|
|
3640
|
+
}
|
|
3609
3641
|
return await exec_gh_command_with_stdin({
|
|
3610
3642
|
args,
|
|
3611
3643
|
stdin_body: request.body,
|
|
3612
|
-
timeout_ms: request.timeout_ms
|
|
3644
|
+
timeout_ms: request.timeout_ms,
|
|
3645
|
+
cwd: request.cwd
|
|
3613
3646
|
});
|
|
3614
3647
|
}
|
|
3615
3648
|
function exec_gh_api_sync(request) {
|
|
3616
3649
|
const body_option = request.body === void 0 ? {} : { input: request.body };
|
|
3617
|
-
const options = { ...body_option, ...to_spawn_options(request.timeout_ms) };
|
|
3650
|
+
const options = { ...body_option, ...to_spawn_options(request.timeout_ms, request.cwd) };
|
|
3618
3651
|
try {
|
|
3619
3652
|
const { stdout } = execaSync2("gh", to_gh_api_args(request), options);
|
|
3620
3653
|
return stdout.trimEnd();
|
|
@@ -3622,13 +3655,22 @@ function exec_gh_api_sync(request) {
|
|
|
3622
3655
|
throw to_gh_error(error);
|
|
3623
3656
|
}
|
|
3624
3657
|
}
|
|
3658
|
+
function read_gh_api_sync(request) {
|
|
3659
|
+
try {
|
|
3660
|
+
return exec_gh_api_sync(request);
|
|
3661
|
+
} catch {
|
|
3662
|
+
return void 0;
|
|
3663
|
+
}
|
|
3664
|
+
}
|
|
3625
3665
|
var git_gh_exec = {
|
|
3626
3666
|
direct_environment,
|
|
3627
3667
|
exec_gh_command,
|
|
3628
3668
|
exec_gh_command_with_stdin,
|
|
3629
3669
|
exec_gh_api,
|
|
3630
3670
|
exec_gh_api_sync,
|
|
3671
|
+
read_gh_api_sync,
|
|
3631
3672
|
exec_gh_api_status,
|
|
3673
|
+
exec_gh_api_status_sync,
|
|
3632
3674
|
parse_status_line
|
|
3633
3675
|
};
|
|
3634
3676
|
|
|
@@ -3666,6 +3708,7 @@ export {
|
|
|
3666
3708
|
repo_party,
|
|
3667
3709
|
FULL_PAGE_QUERY,
|
|
3668
3710
|
git_gh_api_path,
|
|
3711
|
+
error_text,
|
|
3669
3712
|
parse_json_array_or_undefined,
|
|
3670
3713
|
read_json_listing,
|
|
3671
3714
|
parse_json_object_safe,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
investigation_reads
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D67KVGGY.js";
|
|
4
4
|
import {
|
|
5
5
|
lane_guard_policy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZXNE6NY3.js";
|
|
7
7
|
import {
|
|
8
8
|
hook_decision
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HOYJU5RM.js";
|
|
10
10
|
|
|
11
11
|
// scripts/delegation/investigation-guard.ts
|
|
12
12
|
import { text } from "node:stream/consumers";
|
|
@@ -156,7 +156,7 @@ var BACKLOG_COMMANDS = {
|
|
|
156
156
|
script: "scripts/backlog/backlog-offer-cli.ts",
|
|
157
157
|
description: "Collapse a backlogrun loop-head event into one call: read backlog:next, ask backlog:budget, return the verdict and any issues to start",
|
|
158
158
|
category: "AI tools",
|
|
159
|
-
reference: ["[options]", "automation", ["network"]]
|
|
159
|
+
reference: ["[options]", "automation", ["files", "network", "processes"]]
|
|
160
160
|
},
|
|
161
161
|
"backlog:drive": {
|
|
162
162
|
script: "scripts/backlog/backlog-drive-cli.ts",
|
|
@@ -393,7 +393,7 @@ var AI_COMMANDS = {
|
|
|
393
393
|
reference: ["<message>", "automation", ["git"]]
|
|
394
394
|
},
|
|
395
395
|
epic: {
|
|
396
|
-
script: "scripts
|
|
396
|
+
script: "scripts/epic/epic.ts",
|
|
397
397
|
description: "Create an epic issue from its child issue numbers",
|
|
398
398
|
category: "AI tools",
|
|
399
399
|
reference: ["<title> <issue...> [--ordered]", "automation", ["network"]]
|
|
@@ -417,7 +417,7 @@ var AI_COMMANDS = {
|
|
|
417
417
|
reference: ["<epic>", "automation", ["network"]]
|
|
418
418
|
},
|
|
419
419
|
"epic:check": {
|
|
420
|
-
script: "scripts
|
|
420
|
+
script: "scripts/epic/epic-check.ts",
|
|
421
421
|
description: "Check an epic issue against the tracking requirements",
|
|
422
422
|
category: "AI tools",
|
|
423
423
|
reference: ["<epic>", "automation", ["network"]]
|
|
@@ -744,7 +744,7 @@ var DEV_COMMANDS = {
|
|
|
744
744
|
script: "scripts/rules/rule-value-cli.ts",
|
|
745
745
|
description: "Print each delivered rule's unaided compliance \u2014 runs reached, kept rate, refusals",
|
|
746
746
|
category: "AI tools",
|
|
747
|
-
reference: ["", "developer", ["
|
|
747
|
+
reference: ["[--refresh]", "developer", ["files"]]
|
|
748
748
|
},
|
|
749
749
|
format: {
|
|
750
750
|
script: "scripts/lint/format.ts",
|
|
@@ -1137,7 +1137,7 @@ var VERSIONING_COMMANDS = {
|
|
|
1137
1137
|
};
|
|
1138
1138
|
|
|
1139
1139
|
// scripts/josh/josh-commands-workflow.ts
|
|
1140
|
-
var GIT_WORKFLOW_SCRIPT = "scripts
|
|
1140
|
+
var GIT_WORKFLOW_SCRIPT = "scripts/git/git-workflow.ts";
|
|
1141
1141
|
var GIT_MESSAGE_ARGUMENTS = "[-y] <message>";
|
|
1142
1142
|
var WORKFLOW_COMMANDS = {
|
|
1143
1143
|
git: {
|
|
@@ -1162,7 +1162,7 @@ var WORKFLOW_COMMANDS = {
|
|
|
1162
1162
|
// session, and `followup` with them the merge step of every `fullrun` there. `doctor` was moved to
|
|
1163
1163
|
// this form for the same reason in joshuafolkken/kit#869.
|
|
1164
1164
|
//
|
|
1165
|
-
// Nothing is lost by relaxing it: both scripts already
|
|
1165
|
+
// Nothing is lost by relaxing it: both scripts already load `.env` through `josh_environment_file`
|
|
1166
1166
|
// themselves, so the file is read either way and node's precedence — an existing environment
|
|
1167
1167
|
// variable wins over the file — is node's own in both spellings.
|
|
1168
1168
|
//
|
|
@@ -1170,7 +1170,7 @@ var WORKFLOW_COMMANDS = {
|
|
|
1170
1170
|
// than dropped: `telegram_notify.send` now throws on missing credentials and on a failed send, so
|
|
1171
1171
|
// `josh notify` exits non-zero instead of warning and answering 0.
|
|
1172
1172
|
followup: {
|
|
1173
|
-
script: "scripts
|
|
1173
|
+
script: "scripts/git/git-followup-workflow.ts",
|
|
1174
1174
|
description: "Follow-up git workflow",
|
|
1175
1175
|
category: "Workflow",
|
|
1176
1176
|
reference: [
|
|
@@ -1181,7 +1181,7 @@ var WORKFLOW_COMMANDS = {
|
|
|
1181
1181
|
tsx_arguments: OPTIONAL_ENV_FILE_FLAGS
|
|
1182
1182
|
},
|
|
1183
1183
|
notify: {
|
|
1184
|
-
script: "scripts
|
|
1184
|
+
script: "scripts/git/telegram-test.ts",
|
|
1185
1185
|
description: "Send Telegram notification",
|
|
1186
1186
|
category: "Workflow",
|
|
1187
1187
|
reference: ["--task-type <type> --body <text>", "automation", ["notifications"]],
|
|
@@ -2726,7 +2726,7 @@ var time_spans = {
|
|
|
2726
2726
|
import path3 from "node:path";
|
|
2727
2727
|
|
|
2728
2728
|
// scripts/cost-runtime/cost-transcript.ts
|
|
2729
|
-
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
2729
|
+
import { readdirSync, readFileSync as readFileSync2, statSync } from "node:fs";
|
|
2730
2730
|
import { homedir } from "node:os";
|
|
2731
2731
|
import path2 from "node:path";
|
|
2732
2732
|
|
|
@@ -2772,6 +2772,32 @@ var lane_paths = {
|
|
|
2772
2772
|
lane_root
|
|
2773
2773
|
};
|
|
2774
2774
|
|
|
2775
|
+
// scripts/lib/read-file.ts
|
|
2776
|
+
import { readFileSync } from "node:fs";
|
|
2777
|
+
var ABSENT_CODE = "ENOENT";
|
|
2778
|
+
function is_absent(error) {
|
|
2779
|
+
return error instanceof Error && "code" in error && error.code === ABSENT_CODE;
|
|
2780
|
+
}
|
|
2781
|
+
function read_optional(path6) {
|
|
2782
|
+
try {
|
|
2783
|
+
return readFileSync(path6, "utf8");
|
|
2784
|
+
} catch (error) {
|
|
2785
|
+
if (is_absent(error)) return void 0;
|
|
2786
|
+
throw error;
|
|
2787
|
+
}
|
|
2788
|
+
}
|
|
2789
|
+
function read_file_or_empty(path6) {
|
|
2790
|
+
return read_optional(path6) ?? "";
|
|
2791
|
+
}
|
|
2792
|
+
function read_if_readable(path6) {
|
|
2793
|
+
try {
|
|
2794
|
+
return readFileSync(path6, "utf8");
|
|
2795
|
+
} catch {
|
|
2796
|
+
return void 0;
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
var file_reader = { read_optional, read_file_or_empty, read_if_readable };
|
|
2800
|
+
|
|
2775
2801
|
// scripts/cost-runtime/cost-usage.ts
|
|
2776
2802
|
import { z as z4 } from "zod";
|
|
2777
2803
|
var CACHE_CREATION_SCHEMA = z4.object({
|
|
@@ -2927,7 +2953,7 @@ var WORKTREE_SEGMENT = `/${GIT_ENTRY}/worktrees/`;
|
|
|
2927
2953
|
var NOT_FOUND = -1;
|
|
2928
2954
|
function linked_worktree_gitdir(cwd) {
|
|
2929
2955
|
try {
|
|
2930
|
-
const contents =
|
|
2956
|
+
const contents = readFileSync2(path2.join(cwd, GIT_ENTRY), "utf8").trim();
|
|
2931
2957
|
return contents.startsWith(GITDIR_PREFIX) ? contents.slice(GITDIR_PREFIX.length).trim() : "";
|
|
2932
2958
|
} catch {
|
|
2933
2959
|
return "";
|
|
@@ -3064,23 +3090,16 @@ function tally(content) {
|
|
|
3064
3090
|
baseline_tokens: first === void 0 ? 0 : cost_usage.billed_input(first.totals)
|
|
3065
3091
|
};
|
|
3066
3092
|
}
|
|
3067
|
-
function read_text(file_path) {
|
|
3068
|
-
try {
|
|
3069
|
-
return readFileSync(file_path, "utf8");
|
|
3070
|
-
} catch {
|
|
3071
|
-
return void 0;
|
|
3072
|
-
}
|
|
3073
|
-
}
|
|
3074
3093
|
function read_session(file) {
|
|
3075
|
-
const content =
|
|
3094
|
+
const content = file_reader.read_if_readable(file.path);
|
|
3076
3095
|
if (content === void 0) return { session_id: file.session_id, ...empty_session() };
|
|
3077
3096
|
return { session_id: file.session_id, ...tally(content) };
|
|
3078
3097
|
}
|
|
3079
3098
|
function read_raw(file) {
|
|
3080
|
-
return
|
|
3099
|
+
return file_reader.read_if_readable(file.path) ?? "";
|
|
3081
3100
|
}
|
|
3082
|
-
function
|
|
3083
|
-
return
|
|
3101
|
+
function read_optional2(file) {
|
|
3102
|
+
return file_reader.read_if_readable(file.path);
|
|
3084
3103
|
}
|
|
3085
3104
|
function directory_exists(directory) {
|
|
3086
3105
|
try {
|
|
@@ -3126,7 +3145,7 @@ var cost_transcript = {
|
|
|
3126
3145
|
tally,
|
|
3127
3146
|
read_session,
|
|
3128
3147
|
read_raw,
|
|
3129
|
-
read_optional,
|
|
3148
|
+
read_optional: read_optional2,
|
|
3130
3149
|
missing_message,
|
|
3131
3150
|
home_directory
|
|
3132
3151
|
};
|
|
@@ -3159,7 +3178,7 @@ import { closeSync, fstatSync, openSync, readSync } from "node:fs";
|
|
|
3159
3178
|
|
|
3160
3179
|
// scripts/josh/stamp-file.ts
|
|
3161
3180
|
import { createHash, randomUUID } from "node:crypto";
|
|
3162
|
-
import { lstatSync, readFileSync as
|
|
3181
|
+
import { lstatSync, readFileSync as readFileSync3, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
3163
3182
|
import path5 from "node:path";
|
|
3164
3183
|
|
|
3165
3184
|
// scripts/init/init-paths.ts
|
|
@@ -3258,7 +3277,7 @@ function is_own_regular_file(source) {
|
|
|
3258
3277
|
function read_stamp_text(source) {
|
|
3259
3278
|
try {
|
|
3260
3279
|
if (!is_own_regular_file(source)) return void 0;
|
|
3261
|
-
return
|
|
3280
|
+
return readFileSync3(source, "utf8");
|
|
3262
3281
|
} catch {
|
|
3263
3282
|
return void 0;
|
|
3264
3283
|
}
|
|
@@ -3528,6 +3547,7 @@ export {
|
|
|
3528
3547
|
time_spans,
|
|
3529
3548
|
time_round_trips,
|
|
3530
3549
|
lane_paths,
|
|
3550
|
+
file_reader,
|
|
3531
3551
|
cost_usage,
|
|
3532
3552
|
cost_transcript,
|
|
3533
3553
|
time_hook_transcript,
|