@gobing-ai/spur 0.3.41 → 0.3.43
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-plugin/marketplace.json +15 -0
- package/README.md +15 -1
- package/config/templates/AGENTS.md +5 -3
- package/config/workflows/task-pipeline.yaml +113 -12
- package/package.json +15 -12
- package/plugins/README.md +655 -0
- package/plugins/sp/README.md +621 -0
- package/plugins/sp/agents/expert-spur.md +109 -0
- package/plugins/sp/agents/super-coder.md +126 -0
- package/plugins/sp/agents/super-planner.md +283 -0
- package/plugins/sp/agents/super-reviewer.md +154 -0
- package/plugins/sp/commands/dev-arch.md +30 -0
- package/plugins/sp/commands/dev-brainstorm.md +40 -0
- package/plugins/sp/commands/dev-changelog.md +28 -0
- package/plugins/sp/commands/dev-daily.md +29 -0
- package/plugins/sp/commands/dev-debug.md +29 -0
- package/plugins/sp/commands/dev-dogfood.md +33 -0
- package/plugins/sp/commands/dev-featurechange.md +130 -0
- package/plugins/sp/commands/dev-find-conflict.md +51 -0
- package/plugins/sp/commands/dev-find-issue.md +76 -0
- package/plugins/sp/commands/dev-find-next.md +60 -0
- package/plugins/sp/commands/dev-fixall.md +33 -0
- package/plugins/sp/commands/dev-gitmsg.md +28 -0
- package/plugins/sp/commands/dev-gtd.md +97 -0
- package/plugins/sp/commands/dev-handover.md +26 -0
- package/plugins/sp/commands/dev-idea.md +50 -0
- package/plugins/sp/commands/dev-next.md +31 -0
- package/plugins/sp/commands/dev-parallel.md +30 -0
- package/plugins/sp/commands/dev-plan.md +46 -0
- package/plugins/sp/commands/dev-refine.md +48 -0
- package/plugins/sp/commands/dev-refineall.md +65 -0
- package/plugins/sp/commands/dev-refresh.md +32 -0
- package/plugins/sp/commands/dev-reverse.md +32 -0
- package/plugins/sp/commands/dev-review.md +31 -0
- package/plugins/sp/commands/dev-run.md +63 -0
- package/plugins/sp/commands/dev-runall.md +83 -0
- package/plugins/sp/commands/dev-simplify.md +39 -0
- package/plugins/sp/commands/dev-unit.md +29 -0
- package/plugins/sp/commands/dev-verify.md +48 -0
- package/plugins/sp/commands/dev-verifyall.md +72 -0
- package/plugins/sp/commands/dev-wrap.md +48 -0
- package/plugins/sp/commands/dev-wrapall.md +51 -0
- package/plugins/sp/commands/rule-add.md +18 -0
- package/plugins/sp/commands/rule-refine.md +18 -0
- package/plugins/sp/commands/rule-scan.md +18 -0
- package/plugins/sp/commands/spur-init.md +22 -0
- package/plugins/sp/commands/workflow-add.md +18 -0
- package/plugins/sp/commands/workflow-refine.md +18 -0
- package/plugins/sp/hooks/agent-hint.ts +60 -0
- package/plugins/sp/hooks/careful-guard.ts +147 -0
- package/plugins/sp/hooks/context-post-tool.ts +325 -0
- package/plugins/sp/hooks/context-session-start.ts +182 -0
- package/plugins/sp/hooks/context-session-stop.ts +95 -0
- package/plugins/sp/hooks/hooks.json +51 -0
- package/plugins/sp/hooks/pi/guard-extension.ts +341 -0
- package/plugins/sp/hooks/task-write-guard.ts +84 -0
- package/plugins/sp/plugin.json +8 -0
- package/plugins/sp/scripts/batch-preflight.ts +204 -0
- package/plugins/sp/scripts/daily-summary/daily-summary.ts +606 -0
- package/plugins/sp/scripts/daily-summary/logger.ts +28 -0
- package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +363 -0
- package/plugins/sp/scripts/dogfood-testing/validate-report.ts +168 -0
- package/plugins/sp/scripts/feature-sync-bounded.ts +451 -0
- package/plugins/sp/scripts/stage-registry-adapter.ts +1341 -0
- package/plugins/sp/scripts/task-size-precheck.ts +202 -0
- package/plugins/sp/scripts/validate-commands.ts +651 -0
- package/plugins/sp/scripts/validate-flag-contracts.ts +875 -0
- package/plugins/sp/skills/brainstorm/SKILL.md +361 -0
- package/plugins/sp/skills/brainstorm/agents/openai.yaml +14 -0
- package/plugins/sp/skills/brainstorm/examples/ideation-example.md +209 -0
- package/plugins/sp/skills/brainstorm/metadata.openclaw +7 -0
- package/plugins/sp/skills/brainstorm/references/grilling-interview.md +68 -0
- package/plugins/sp/skills/brainstorm/references/workflows.md +255 -0
- package/plugins/sp/skills/branch-workflow/SKILL.md +109 -0
- package/plugins/sp/skills/branch-workflow/references/branch-lifecycle.md +69 -0
- package/plugins/sp/skills/branch-workflow/references/worktree-patterns.md +100 -0
- package/plugins/sp/skills/code-implementation/SKILL.md +203 -0
- package/plugins/sp/skills/code-implementation/references/debugging.md +64 -0
- package/plugins/sp/skills/code-implementation/references/implementation-patterns.md +113 -0
- package/plugins/sp/skills/code-improvement/SKILL.md +231 -0
- package/plugins/sp/skills/code-improvement/references/deepening-signals.md +205 -0
- package/plugins/sp/skills/code-review/SKILL.md +112 -0
- package/plugins/sp/skills/code-review/references/receiving-code-review.md +70 -0
- package/plugins/sp/skills/code-review/references/review-lenses.md +117 -0
- package/plugins/sp/skills/code-review/references/self-review-checklist.md +53 -0
- package/plugins/sp/skills/code-review/references/verification-before-completion.md +68 -0
- package/plugins/sp/skills/code-simplification/SKILL.md +225 -0
- package/plugins/sp/skills/code-testing/SKILL.md +108 -0
- package/plugins/sp/skills/code-testing/references/stacks/bun-ts.md +165 -0
- package/plugins/sp/skills/code-testing/references/stacks/go.md +88 -0
- package/plugins/sp/skills/code-testing/references/stacks/python.md +117 -0
- package/plugins/sp/skills/code-testing/references/test-loop-breaker.md +37 -0
- package/plugins/sp/skills/code-testing/references/test-output-discipline.md +52 -0
- package/plugins/sp/skills/code-testing/references/unit-testing.md +212 -0
- package/plugins/sp/skills/code-verification/SKILL.md +535 -0
- package/plugins/sp/skills/code-verification/references/code-improvement.md +39 -0
- package/plugins/sp/skills/code-verification/references/secu-review.md +94 -0
- package/plugins/sp/skills/code-verification/references/verdict-schema.md +141 -0
- package/plugins/sp/skills/conflict-finding/SKILL.md +254 -0
- package/plugins/sp/skills/conflict-finding/references/authority-resolution.md +258 -0
- package/plugins/sp/skills/conflict-finding/references/comparison-protocol.md +277 -0
- package/plugins/sp/skills/conflict-finding/references/finding-contract.md +346 -0
- package/plugins/sp/skills/conflict-finding/references/remediation-routing.md +276 -0
- package/plugins/sp/skills/daily-summary/SKILL.md +171 -0
- package/plugins/sp/skills/daily-summary/agents/openai.yaml +13 -0
- package/plugins/sp/skills/doc-evolve/SKILL.md +175 -0
- package/plugins/sp/skills/doc-evolve/references/operations.md +93 -0
- package/plugins/sp/skills/dogfood-testing/SKILL.md +608 -0
- package/plugins/sp/skills/dogfood-testing/references/monitor-ledger.md +211 -0
- package/plugins/sp/skills/dogfood-testing/references/report-template.md +351 -0
- package/plugins/sp/skills/doubt-driven-development/SKILL.md +136 -0
- package/plugins/sp/skills/functional-review/SKILL.md +364 -0
- package/plugins/sp/skills/functional-review/references/verdict-schema.md +133 -0
- package/plugins/sp/skills/indexed-context/SKILL.md +164 -0
- package/plugins/sp/skills/issue-finding/SKILL.md +442 -0
- package/plugins/sp/skills/issue-finding/agents/openai.yaml +15 -0
- package/plugins/sp/skills/issue-finding/examples/expected-findings.json +27 -0
- package/plugins/sp/skills/issue-finding/examples/session-test-loop.jsonl +23 -0
- package/plugins/sp/skills/issue-finding/references/session-formats.md +151 -0
- package/plugins/sp/skills/next-feature/SKILL.md +125 -0
- package/plugins/sp/skills/next-feature/references/handoff-routing.md +92 -0
- package/plugins/sp/skills/next-feature/references/proposal-contract.md +49 -0
- package/plugins/sp/skills/next-feature/references/ranking-rubric.md +52 -0
- package/plugins/sp/skills/next-feature/references/signal-derivation.md +67 -0
- package/plugins/sp/skills/next-router/SKILL.md +181 -0
- package/plugins/sp/skills/next-router/references/messages.md +90 -0
- package/plugins/sp/skills/next-router/references/routing-table.md +216 -0
- package/plugins/sp/skills/parallel-execution/SKILL.md +148 -0
- package/plugins/sp/skills/parallel-execution/references/dispatch-surface.md +109 -0
- package/plugins/sp/skills/parallel-execution/references/fan-out-patterns.md +101 -0
- package/plugins/sp/skills/parallel-execution/references/result-synthesis.md +94 -0
- package/plugins/sp/skills/reverse-engineering/SKILL.md +375 -0
- package/plugins/sp/skills/reverse-engineering/agents/openai.yaml +18 -0
- package/plugins/sp/skills/source-driven-development/SKILL.md +124 -0
- package/plugins/sp/skills/spec-decomposition/SKILL.md +117 -0
- package/plugins/sp/skills/spec-decomposition/references/decomposition.md +539 -0
- package/plugins/sp/skills/spur-cli/SKILL.md +133 -0
- package/plugins/sp/skills/spur-cli/references/agent.md +179 -0
- package/plugins/sp/skills/spur-cli/references/features/acceptance-criteria.md +82 -0
- package/plugins/sp/skills/spur-cli/references/features/hierarchy-mece.md +177 -0
- package/plugins/sp/skills/spur-cli/references/features/roadmap-priority.md +84 -0
- package/plugins/sp/skills/spur-cli/references/features/verbs.md +122 -0
- package/plugins/sp/skills/spur-cli/references/features.md +234 -0
- package/plugins/sp/skills/spur-cli/references/init.md +119 -0
- package/plugins/sp/skills/spur-cli/references/message.md +98 -0
- package/plugins/sp/skills/spur-cli/references/rules/authoring-rules.md +212 -0
- package/plugins/sp/skills/spur-cli/references/rules/fine-tuning.md +148 -0
- package/plugins/sp/skills/spur-cli/references/rules/operations.md +228 -0
- package/plugins/sp/skills/spur-cli/references/rules/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/rules.md +209 -0
- package/plugins/sp/skills/spur-cli/references/serve.md +58 -0
- package/plugins/sp/skills/spur-cli/references/tasks/l3-guard-cheatsheet.md +98 -0
- package/plugins/sp/skills/spur-cli/references/tasks/section-editing.md +95 -0
- package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +361 -0
- package/plugins/sp/skills/spur-cli/references/tasks.md +280 -0
- package/plugins/sp/skills/spur-cli/references/team.md +133 -0
- package/plugins/sp/skills/spur-cli/references/workflows/authoring-workflows.md +226 -0
- package/plugins/sp/skills/spur-cli/references/workflows/operations.md +211 -0
- package/plugins/sp/skills/spur-cli/references/workflows/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/workflows.md +355 -0
- package/plugins/sp/skills/spur-dev/SKILL.md +224 -0
- package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +196 -0
- package/plugins/sp/skills/spur-dev/references/cross-cutting.md +680 -0
- package/plugins/sp/skills/spur-dev/references/decision-brief.md +80 -0
- package/plugins/sp/skills/spur-dev/references/dev-operations.md +546 -0
- package/plugins/sp/skills/spur-dev/references/done-housekeeping.md +164 -0
- package/plugins/sp/skills/spur-dev/references/execution-batch.md +790 -0
- package/plugins/sp/skills/spur-dev/references/execution-workflow.md +352 -0
- package/plugins/sp/skills/spur-dev/references/feature-link-helper.md +191 -0
- package/plugins/sp/skills/spur-dev/references/flag-glossary.md +417 -0
- package/plugins/sp/skills/spur-dev/references/gate-checklists.md +171 -0
- package/plugins/sp/skills/spur-dev/references/glossary.md +95 -0
- package/plugins/sp/skills/spur-dev/references/idea-evaluation.md +80 -0
- package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +120 -0
- package/plugins/sp/skills/spur-dev/references/planning-workflow.md +302 -0
- package/plugins/sp/skills/spur-dev/references/product-planning.md +206 -0
- package/plugins/sp/skills/spur-dev/references/section-batching.md +24 -0
- package/plugins/sp/skills/sys-architecture/SKILL.md +155 -0
- package/plugins/sp/skills/sys-architecture/references/decision-method.md +137 -0
- package/plugins/sp/skills/sys-architecture/references/upkeep-survey.md +75 -0
- package/plugins/sp/skills/sys-debugging/SKILL.md +228 -0
- package/plugins/sp/skills/sys-debugging/references/debugging-protocol.md +62 -0
- package/plugins/sp/skills/test-driven-development/SKILL.md +248 -0
- package/plugins/sp/skills/wayfinder/SKILL.md +292 -0
- package/spur.js +6035 -4963
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* batch-preflight — pure TABLE A STOP evaluation for sp:super-planner (task 0279).
|
|
3
|
+
*
|
|
4
|
+
* Mirrors routing-table.md TABLE A hard-STOP preconditions so the batch driver can
|
|
5
|
+
* skip doomed pipeline launches without spawning a Skill subprocess. Happy-path
|
|
6
|
+
* statuses still return `action: 'run'` — the caller launches task-pipeline.yaml
|
|
7
|
+
* verbatim (preflight is readiness only, never a pipeline substitute).
|
|
8
|
+
*
|
|
9
|
+
* Recovery hints (one-shot after FAIL) map stuck statuses to a single /sp:dev-* hop
|
|
10
|
+
* per TABLE A; the batch driver prints or dispatches at most once per WBS.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export type TaskStatus = 'backlog' | 'todo' | 'wip' | 'testing' | 'blocked' | 'done' | 'cancelled' | string;
|
|
14
|
+
|
|
15
|
+
export interface PreflightInput {
|
|
16
|
+
wbs: string;
|
|
17
|
+
status: TaskStatus;
|
|
18
|
+
/** Frontmatter dependencies[] WBS list. */
|
|
19
|
+
dependencies: string[];
|
|
20
|
+
/** Status of each dependency WBS (from spur task show). Missing → treated as unmet. */
|
|
21
|
+
depStatuses: Record<string, string>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type PreflightResult =
|
|
25
|
+
| { action: 'run'; code?: string; reason?: string }
|
|
26
|
+
| { action: 'skip'; code: string; reason: string; unmetDeps?: string[] };
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Evaluate whether the batch should launch task-pipeline.yaml for this WBS.
|
|
30
|
+
* STOP codes align with routing-table TABLE A row ids (A2, A7, A8, A9).
|
|
31
|
+
*/
|
|
32
|
+
export function preflightTask(input: PreflightInput): PreflightResult {
|
|
33
|
+
const status = (input.status ?? '').toLowerCase();
|
|
34
|
+
const deps = input.dependencies ?? [];
|
|
35
|
+
const depStatuses = input.depStatuses ?? {};
|
|
36
|
+
|
|
37
|
+
if (status === 'cancelled') {
|
|
38
|
+
return {
|
|
39
|
+
action: 'skip',
|
|
40
|
+
code: 'A9',
|
|
41
|
+
reason: `dev-next: cancelled — nothing to advance (${input.wbs})`,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (status === 'done') {
|
|
46
|
+
return {
|
|
47
|
+
action: 'skip',
|
|
48
|
+
code: 'A8',
|
|
49
|
+
reason: `dev-next: already done — batch does not auto-wrap (${input.wbs})`,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (status === 'blocked') {
|
|
54
|
+
return {
|
|
55
|
+
action: 'skip',
|
|
56
|
+
code: 'A7',
|
|
57
|
+
reason: `dev-next: blocked — do not launch pipeline; human/handover first (${input.wbs})`,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// A2: todo/backlog with any dependency not done (mirrors TABLE A2 / ready filter).
|
|
62
|
+
if (status === 'todo' || status === 'backlog') {
|
|
63
|
+
const unmet = deps.filter((d) => {
|
|
64
|
+
const st = (depStatuses[d] ?? 'missing').toLowerCase();
|
|
65
|
+
return st !== 'done';
|
|
66
|
+
});
|
|
67
|
+
if (unmet.length > 0) {
|
|
68
|
+
return {
|
|
69
|
+
action: 'skip',
|
|
70
|
+
code: 'A2',
|
|
71
|
+
reason: `dev-next: blocked by deps — unmet: ${unmet.join(', ')} (${input.wbs})`,
|
|
72
|
+
unmetDeps: unmet,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Ready for pipeline: backlog/todo (deps ok), wip, testing.
|
|
78
|
+
return { action: 'run', code: 'OK', reason: `preflight clear — launch task-pipeline for ${input.wbs}` };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* One-shot recovery hint after a non-PASS pipeline or stuck status (TABLE A primary hop).
|
|
83
|
+
* Caller substitutes the real WBS; never loop this — at most one hop per WBS per batch.
|
|
84
|
+
*/
|
|
85
|
+
export function recoveryHint(status: TaskStatus, wbs: string): { command: string; code: string } | null {
|
|
86
|
+
const st = (status ?? '').toLowerCase();
|
|
87
|
+
switch (st) {
|
|
88
|
+
case 'backlog':
|
|
89
|
+
return { code: 'A1', command: `/sp:dev-refine ${wbs} --auto --next` };
|
|
90
|
+
case 'todo':
|
|
91
|
+
return { code: 'A3', command: `/sp:dev-run ${wbs} --auto --next` };
|
|
92
|
+
case 'wip':
|
|
93
|
+
return { code: 'A5', command: `/sp:dev-run ${wbs} --mode implement --auto --next` };
|
|
94
|
+
case 'testing':
|
|
95
|
+
return { code: 'A6', command: `/sp:dev-verify ${wbs} --auto --next` };
|
|
96
|
+
case 'blocked':
|
|
97
|
+
return {
|
|
98
|
+
code: 'A7',
|
|
99
|
+
command: `/sp:dev-handover "blocked task ${wbs} — see Notes/History"`,
|
|
100
|
+
};
|
|
101
|
+
default:
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ── CLI for agents / dogfood (optional) ──────────────────────────────────────
|
|
107
|
+
|
|
108
|
+
export interface PreflightCliArgs {
|
|
109
|
+
status: string | null;
|
|
110
|
+
deps: string[];
|
|
111
|
+
depStatuses: Record<string, string>;
|
|
112
|
+
wbs: string;
|
|
113
|
+
recovery: boolean;
|
|
114
|
+
help: boolean;
|
|
115
|
+
json: boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function parsePreflightCliArgs(argv: string[]): PreflightCliArgs {
|
|
119
|
+
let status: string | null = null;
|
|
120
|
+
let deps: string[] = [];
|
|
121
|
+
const depStatuses: Record<string, string> = {};
|
|
122
|
+
let wbs = '0000';
|
|
123
|
+
let recovery = false;
|
|
124
|
+
let help = false;
|
|
125
|
+
let json = false;
|
|
126
|
+
|
|
127
|
+
for (let i = 0; i < argv.length; i++) {
|
|
128
|
+
const a = argv[i];
|
|
129
|
+
if (a === '--help' || a === '-h') help = true;
|
|
130
|
+
else if (a === '--json') json = true;
|
|
131
|
+
else if (a === '--recovery') recovery = true;
|
|
132
|
+
else if (a === '--wbs') wbs = argv[++i] ?? wbs;
|
|
133
|
+
else if (a === '--status') status = argv[++i] ?? null;
|
|
134
|
+
else if (a === '--deps') {
|
|
135
|
+
const raw = argv[++i] ?? '';
|
|
136
|
+
deps =
|
|
137
|
+
raw.length === 0
|
|
138
|
+
? []
|
|
139
|
+
: raw
|
|
140
|
+
.split(',')
|
|
141
|
+
.map((s) => s.trim())
|
|
142
|
+
.filter(Boolean);
|
|
143
|
+
} else if (a === '--dep-status') {
|
|
144
|
+
// format: 0275:done,0276:todo
|
|
145
|
+
const raw = argv[++i] ?? '';
|
|
146
|
+
for (const part of raw.split(',')) {
|
|
147
|
+
const [k, v] = part.split(':');
|
|
148
|
+
if (k && v) depStatuses[k.trim()] = v.trim();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return { status, deps, depStatuses, wbs, recovery, help, json };
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export const PREFLIGHT_CLI_USAGE = `Usage:
|
|
156
|
+
bun plugins/sp/scripts/batch-preflight.ts --wbs <wbs> --status <status> \\
|
|
157
|
+
[--deps 0275,0276] [--dep-status 0275:done,0276:todo] [--recovery] [--json]
|
|
158
|
+
|
|
159
|
+
Exit: 0 = run (or recovery hint printed); 2 = skip; 1 = usage.`;
|
|
160
|
+
|
|
161
|
+
export function runPreflightCli(argv: string[]): { exitCode: number; stdout: string; stderr: string } {
|
|
162
|
+
const args = parsePreflightCliArgs(argv);
|
|
163
|
+
if (args.help) return { exitCode: 0, stdout: '', stderr: PREFLIGHT_CLI_USAGE };
|
|
164
|
+
if (!args.status) return { exitCode: 1, stdout: '', stderr: PREFLIGHT_CLI_USAGE };
|
|
165
|
+
|
|
166
|
+
if (args.recovery) {
|
|
167
|
+
const hint = recoveryHint(args.status, args.wbs);
|
|
168
|
+
const body = args.json
|
|
169
|
+
? `${JSON.stringify({ recovery: hint }, null, 2)}\n`
|
|
170
|
+
: hint
|
|
171
|
+
? `${hint.command}\n`
|
|
172
|
+
: 'no recovery hop\n';
|
|
173
|
+
return { exitCode: 0, stdout: body, stderr: '' };
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const result = preflightTask({
|
|
177
|
+
wbs: args.wbs,
|
|
178
|
+
status: args.status,
|
|
179
|
+
dependencies: args.deps,
|
|
180
|
+
depStatuses: args.depStatuses,
|
|
181
|
+
});
|
|
182
|
+
if (args.json) {
|
|
183
|
+
return {
|
|
184
|
+
exitCode: result.action === 'run' ? 0 : 2,
|
|
185
|
+
stdout: `${JSON.stringify(result, null, 2)}\n`,
|
|
186
|
+
stderr: '',
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
if (result.action === 'run') {
|
|
190
|
+
return { exitCode: 0, stdout: `run: ${result.reason ?? 'ok'}\n`, stderr: '' };
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
exitCode: 2,
|
|
194
|
+
stdout: `skip ${result.code}: ${result.reason}\n`,
|
|
195
|
+
stderr: '',
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (import.meta.main) {
|
|
200
|
+
const { exitCode, stdout, stderr } = runPreflightCli(Bun.argv.slice(2));
|
|
201
|
+
if (stdout) process.stdout.write(stdout);
|
|
202
|
+
if (stderr) process.stderr.write(`${stderr}\n`);
|
|
203
|
+
process.exit(exitCode);
|
|
204
|
+
}
|