@gobing-ai/knowledge-kit 0.0.13 → 0.0.14
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 +1 -1
- package/dist/index.js +20 -0
- package/package.json +1 -1
- package/plugins/generations/content-gen/dist/index.js +20 -0
- package/plugins/generations/core-facts-gen/dist/index.js +20 -0
- package/plugins/generations/daily-article-gen/dist/index.js +29 -1
- package/plugins/generations/daily-article-gen/src/index.ts +13 -1
- package/plugins/generations/dailynews-gen/dist/index.js +20 -0
- package/plugins/generations/episode-plan-gen/dist/index.js +24 -0
- package/plugins/generations/episode-plan-gen/src/index.ts +11 -0
- package/plugins/generations/image-gen/dist/index.js +2296 -53
- package/plugins/generations/image-gen/src/providers/agnes.ts +110 -0
- package/plugins/generations/image-gen/src/providers/azure.ts +153 -0
- package/plugins/generations/image-gen/src/providers/codex-cli.ts +170 -0
- package/plugins/generations/image-gen/src/providers/dashscope.ts +485 -0
- package/plugins/generations/image-gen/src/providers/google.ts +268 -0
- package/plugins/generations/image-gen/src/providers/huggingface.ts +59 -0
- package/plugins/generations/image-gen/src/providers/jimeng.ts +259 -0
- package/plugins/generations/image-gen/src/providers/minimax.ts +171 -0
- package/plugins/generations/image-gen/src/providers/openai.ts +319 -0
- package/plugins/generations/image-gen/src/providers/openrouter.ts +257 -0
- package/plugins/generations/image-gen/src/providers/refs.ts +24 -0
- package/plugins/generations/image-gen/src/providers/replicate.ts +279 -0
- package/plugins/generations/image-gen/src/providers/seedream.ts +1 -1
- package/plugins/generations/image-gen/src/providers/types.ts +52 -51
- package/plugins/generations/image-gen/src/providers/zai.ts +237 -0
- package/plugins/generations/news-report-gen/dist/index.js +22193 -0
- package/plugins/generations/news-report-gen/package.json +17 -0
- package/plugins/generations/news-report-gen/plugin.json +7 -0
- package/plugins/generations/news-report-gen/src/index.ts +308 -0
- package/plugins/generations/news-report-gen/tsconfig.json +4 -0
- package/plugins/generations/omni-voice-gen/Makefile +14 -0
- package/plugins/generations/omni-voice-gen/README.md +112 -0
- package/plugins/generations/omni-voice-gen/bin/omni-voice-gen +2 -0
- package/plugins/generations/omni-voice-gen/dist/omni-voice-gen-prr8skpb. +2 -0
- package/plugins/generations/omni-voice-gen/dist/omni-voice-gen.js +6 -0
- package/plugins/generations/omni-voice-gen/plugin.json +6 -0
- package/plugins/generations/omni-voice-gen/profiles.json +12 -0
- package/plugins/generations/omni-voice-gen/pyproject.toml +25 -0
- package/plugins/generations/omni-voice-gen/scripts/coverage_gate.py +74 -0
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/__init__.py +1 -0
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/__main__.py +39 -0
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/audio.py +190 -0
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/backend.py +150 -0
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/contract.py +76 -0
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/mp3.py +60 -0
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/pipeline.py +289 -0
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/profiles.py +100 -0
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/qc.py +234 -0
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/voicescript.py +352 -0
- package/plugins/generations/omni-voice-gen/uv.lock +3510 -0
- package/plugins/generations/voice-gen/dist/index.js +30 -2
- package/plugins/generations/voice-gen/src/index.ts +16 -1
- package/plugins/generations/voice-gen/src/voicebox-client.ts +3 -1
- package/plugins/ingestions/aihot-ingest/dist/index.js +20 -0
- package/plugins/ingestions/horizon-ingest/dist/index.js +20 -0
- package/plugins/ingestions/last30days-ingest/dist/index.js +20 -0
- package/plugins/ingestions/web-search/dist/index.js +20 -0
- package/plugins/kk/commands/image-extract.md +40 -0
- package/plugins/kk/commands/image-generate.md +18 -1
- package/plugins/kk/plugin.json +1 -1
- package/plugins/kk/skills/image-authoring/SKILL.md +10 -3
- package/plugins/kk/skills/image-authoring/references/format-drafting.md +57 -0
- package/plugins/kk/skills/image-authoring/references/style-extraction.md +14 -9
- package/plugins/kk/workflows/kk-daily-ai-voice.yaml +130 -30
- package/plugins/publishings/emdash-pub/dist/index.js +20 -0
- package/plugins/publishings/podcast-pub/dist/index.js +57 -3
- package/plugins/publishings/podcast-pub/src/index.ts +18 -2
- package/plugins/publishings/podcast-pub/src/show-notes.ts +56 -9
- package/plugins/publishings/qiita-pub/dist/index.js +20 -0
- package/plugins/publishings/surfdash-pub/dist/index.js +96 -6
- package/plugins/publishings/surfdash-pub/src/index.ts +109 -9
- package/plugins/publishings/zenn-pub/dist/index.js +20 -0
- package/plugins/sp/scripts/batch-preflight.mjs +346 -0
- package/plugins/sp/scripts/batch-preflight.ts +459 -0
- package/plugins/sp/scripts/daily-summary/daily-summary.mjs +615 -0
- package/plugins/sp/scripts/daily-summary/daily-summary.ts +846 -0
- package/plugins/sp/scripts/daily-summary/logger.ts +28 -0
- package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.mjs +223 -0
- package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +367 -0
- package/plugins/sp/scripts/dogfood-testing/validate-report.mjs +132 -0
- package/plugins/sp/scripts/dogfood-testing/validate-report.ts +169 -0
- package/plugins/sp/scripts/feature-dev-precheck.mjs +171 -0
- package/plugins/sp/scripts/feature-dev-precheck.ts +238 -0
- package/plugins/sp/scripts/feature-sync-bounded.mjs +285 -0
- package/plugins/sp/scripts/feature-sync-bounded.ts +478 -0
- package/plugins/sp/scripts/history-anatomy-cache.mjs +902 -0
- package/plugins/sp/scripts/history-anatomy-cache.ts +1028 -0
- package/plugins/sp/scripts/idea-handoff.mjs +22 -0
- package/plugins/sp/scripts/idea-handoff.ts +44 -0
- package/plugins/sp/scripts/inline-pipeline-parity-check.ts +185 -0
- package/plugins/sp/scripts/inline-run-setup.ts +198 -0
- package/plugins/sp/scripts/pr-reviewing.mjs +769 -0
- package/plugins/sp/scripts/pr-reviewing.ts +925 -0
- package/plugins/sp/scripts/quality-gate.mjs +179 -0
- package/plugins/sp/scripts/quality-gate.ts +217 -0
- package/plugins/sp/scripts/script-contract-check.ts +319 -0
- package/plugins/sp/scripts/stage-registry-adapter.ts +1533 -0
- package/plugins/sp/scripts/surface-drift-inventory.ts +929 -0
- package/plugins/sp/scripts/task-evidence-precheck.ts +181 -0
- package/plugins/sp/scripts/task-size-precheck.ts +175 -0
- package/plugins/sp/scripts/transition-shim-check.ts +238 -0
- package/plugins/sp/scripts/validate-commands.ts +689 -0
- package/plugins/sp/scripts/validate-flag-contracts.ts +878 -0
- package/plugins/sp/scripts/verify-answer-lint.ts +530 -0
- package/plugins/sp/scripts/workflow-step-profile.mjs +316 -0
- package/plugins/sp/scripts/workflow-step-profile.ts +456 -0
- package/plugins/sp/scripts/wrapup-steps.mjs +373 -0
- package/plugins/sp/scripts/wrapup-steps.ts +466 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
|
|
4
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
5
|
+
|
|
6
|
+
// plugins/sp/scripts/batch-preflight.ts
|
|
7
|
+
function quickReadiness(input) {
|
|
8
|
+
const status = (input.status ?? '').toLowerCase();
|
|
9
|
+
const operation = input.operation;
|
|
10
|
+
if (operation !== 'run' && operation !== 'refine' && operation !== 'verify') {
|
|
11
|
+
return {
|
|
12
|
+
action: 'invalid',
|
|
13
|
+
code: 'IV',
|
|
14
|
+
reason: `quick-readiness: unknown operation '${operation}' (${input.wbs})`,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
if (input.filteredCount !== undefined) {
|
|
18
|
+
if (input.filteredCount < 0) {
|
|
19
|
+
return {
|
|
20
|
+
action: 'invalid',
|
|
21
|
+
code: 'IV',
|
|
22
|
+
reason: `quick-readiness: invalid negative filtered count '${input.filteredCount}' (${input.wbs})`,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (input.filteredCount === 0) {
|
|
26
|
+
return {
|
|
27
|
+
action: 'skipped',
|
|
28
|
+
code: 'EMPTY',
|
|
29
|
+
reason: `quick-readiness: empty status-filtered set — nothing to ${operation} (${input.wbs})`,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (status === 'cancelled' || status === 'done') {
|
|
34
|
+
if (operation === 'verify' && input.force === true) {
|
|
35
|
+
return {
|
|
36
|
+
action: 'runnable',
|
|
37
|
+
code: 'FORCE',
|
|
38
|
+
reason: `quick-readiness: verify --force re-verification of ${status} task ${input.wbs}`,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
action: 'skipped',
|
|
43
|
+
code: status === 'done' ? 'DONE' : 'CANCELLED',
|
|
44
|
+
reason: `quick-readiness: already ${status} — no ${operation} hop (${input.wbs})`,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (status === 'blocked') {
|
|
48
|
+
return {
|
|
49
|
+
action: 'blocked',
|
|
50
|
+
code: 'BLK',
|
|
51
|
+
reason: `quick-readiness: blocked — human/handover first (${input.wbs})`,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (operation === 'run' && input.dependencies && input.dependencies.length > 0) {
|
|
55
|
+
const unmet = input.dependencies.filter((d) => (input.depStatuses?.[d] ?? 'missing').toLowerCase() !== 'done');
|
|
56
|
+
if (unmet.length > 0) {
|
|
57
|
+
return {
|
|
58
|
+
action: 'blocked',
|
|
59
|
+
code: 'DEP',
|
|
60
|
+
reason: `quick-readiness: unmet deps — ${unmet.join(', ')} (${input.wbs})`,
|
|
61
|
+
unmetDeps: unmet,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const required = input.requiredSections ?? [];
|
|
66
|
+
const present = input.presentSections ?? [];
|
|
67
|
+
const gaps = required.filter((s) => {
|
|
68
|
+
const finding = input.sectionFindings?.[s];
|
|
69
|
+
return !present.includes(s) || (finding !== undefined && finding !== '');
|
|
70
|
+
});
|
|
71
|
+
if (operation === 'refine') {
|
|
72
|
+
if (status !== 'backlog' && status !== 'todo') {
|
|
73
|
+
return {
|
|
74
|
+
action: 'skipped',
|
|
75
|
+
code: 'NONPLAN',
|
|
76
|
+
reason: `quick-readiness: refine targets backlog/todo only, not '${status}' (${input.wbs})`,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
action: 'runnable',
|
|
81
|
+
code: 'OK',
|
|
82
|
+
reason: `quick-readiness: refine ready for ${input.wbs} (${gaps.length} planning gap(s) to fill)`,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (operation === 'verify') {
|
|
86
|
+
if (status !== 'testing' && status !== 'wip') {
|
|
87
|
+
return {
|
|
88
|
+
action: 'invalid',
|
|
89
|
+
code: 'NOVERIFY',
|
|
90
|
+
reason: `quick-readiness: verify needs testing/wip, not '${status}' (${input.wbs})`,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
action: 'runnable',
|
|
95
|
+
code: 'OK',
|
|
96
|
+
reason: `quick-readiness: verify ready for ${input.wbs}`,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
if (status !== 'todo' && status !== 'wip' && status !== 'testing') {
|
|
100
|
+
return {
|
|
101
|
+
action: 'invalid',
|
|
102
|
+
code: 'NORUN',
|
|
103
|
+
reason: `quick-readiness: run needs todo/wip/testing, not '${status}' (${input.wbs})`,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (gaps.length > 0) {
|
|
107
|
+
return {
|
|
108
|
+
action: 'needs-refinement',
|
|
109
|
+
code: 'REFINE',
|
|
110
|
+
reason: `quick-readiness: implementation sections incomplete (${input.wbs})`,
|
|
111
|
+
gaps,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
action: 'runnable',
|
|
116
|
+
code: 'OK',
|
|
117
|
+
reason: `quick-readiness: run ready for ${input.wbs}`,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function preflightTask(input) {
|
|
121
|
+
const status = (input.status ?? '').toLowerCase();
|
|
122
|
+
const deps = input.dependencies ?? [];
|
|
123
|
+
const depStatuses = input.depStatuses ?? {};
|
|
124
|
+
if (status === 'cancelled') {
|
|
125
|
+
return {
|
|
126
|
+
action: 'skip',
|
|
127
|
+
code: 'A9',
|
|
128
|
+
reason: `dev-next: cancelled — nothing to advance (${input.wbs})`,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (status === 'done') {
|
|
132
|
+
return {
|
|
133
|
+
action: 'skip',
|
|
134
|
+
code: 'A8',
|
|
135
|
+
reason: `dev-next: already done — batch does not auto-wrap (${input.wbs})`,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if (status === 'blocked') {
|
|
139
|
+
return {
|
|
140
|
+
action: 'skip',
|
|
141
|
+
code: 'A7',
|
|
142
|
+
reason: `dev-next: blocked — do not launch pipeline; human/handover first (${input.wbs})`,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
if (status === 'todo' || status === 'backlog') {
|
|
146
|
+
const unmet = deps.filter((d) => {
|
|
147
|
+
const st = (depStatuses[d] ?? 'missing').toLowerCase();
|
|
148
|
+
return st !== 'done';
|
|
149
|
+
});
|
|
150
|
+
if (unmet.length > 0) {
|
|
151
|
+
return {
|
|
152
|
+
action: 'skip',
|
|
153
|
+
code: 'A2',
|
|
154
|
+
reason: `dev-next: blocked by deps — unmet: ${unmet.join(', ')} (${input.wbs})`,
|
|
155
|
+
unmetDeps: unmet,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return { action: 'run', code: 'OK', reason: `preflight clear — launch task-pipeline for ${input.wbs}` };
|
|
160
|
+
}
|
|
161
|
+
function recoveryHint(status, wbs) {
|
|
162
|
+
const st = (status ?? '').toLowerCase();
|
|
163
|
+
switch (st) {
|
|
164
|
+
case 'backlog':
|
|
165
|
+
return { code: 'A1', command: `/sp:dev-refine ${wbs} --auto --next` };
|
|
166
|
+
case 'todo':
|
|
167
|
+
return { code: 'A3', command: `/sp:dev-run ${wbs} --auto --next` };
|
|
168
|
+
case 'wip':
|
|
169
|
+
return { code: 'A5', command: `/sp:dev-run ${wbs} --mode implement --auto --next` };
|
|
170
|
+
case 'testing':
|
|
171
|
+
return { code: 'A6', command: `/sp:dev-verify ${wbs} --auto --next` };
|
|
172
|
+
case 'blocked':
|
|
173
|
+
return {
|
|
174
|
+
code: 'A7',
|
|
175
|
+
command: `/sp:dev-handover "blocked task ${wbs} — see Notes/History"`,
|
|
176
|
+
};
|
|
177
|
+
default:
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function parsePreflightCliArgs(argv) {
|
|
182
|
+
let status = null;
|
|
183
|
+
let deps = [];
|
|
184
|
+
const depStatuses = {};
|
|
185
|
+
let wbs = '0000';
|
|
186
|
+
let recovery = false;
|
|
187
|
+
let help = false;
|
|
188
|
+
let json = false;
|
|
189
|
+
let operation = null;
|
|
190
|
+
let force = false;
|
|
191
|
+
let filteredCount = null;
|
|
192
|
+
let requiredSections = [];
|
|
193
|
+
let presentSections = [];
|
|
194
|
+
for (let i = 0; i < argv.length; i++) {
|
|
195
|
+
const a = argv[i];
|
|
196
|
+
if (a === '--help' || a === '-h') help = true;
|
|
197
|
+
else if (a === '--json') json = true;
|
|
198
|
+
else if (a === '--recovery') recovery = true;
|
|
199
|
+
else if (a === '--force') force = true;
|
|
200
|
+
else if (a === '--operation') {
|
|
201
|
+
const v = argv[++i] ?? '';
|
|
202
|
+
operation = v === 'run' || v === 'refine' || v === 'verify' ? v : null;
|
|
203
|
+
} else if (a === '--filtered-count') {
|
|
204
|
+
const v = Number(argv[++i]);
|
|
205
|
+
filteredCount = Number.isFinite(v) ? v : null;
|
|
206
|
+
} else if (a === '--required-sections') {
|
|
207
|
+
const raw = argv[++i] ?? '';
|
|
208
|
+
requiredSections =
|
|
209
|
+
raw.length === 0
|
|
210
|
+
? []
|
|
211
|
+
: raw
|
|
212
|
+
.split(',')
|
|
213
|
+
.map((s) => s.trim())
|
|
214
|
+
.filter(Boolean);
|
|
215
|
+
} else if (a === '--present-sections') {
|
|
216
|
+
const raw = argv[++i] ?? '';
|
|
217
|
+
presentSections =
|
|
218
|
+
raw.length === 0
|
|
219
|
+
? []
|
|
220
|
+
: raw
|
|
221
|
+
.split(',')
|
|
222
|
+
.map((s) => s.trim())
|
|
223
|
+
.filter(Boolean);
|
|
224
|
+
} else if (a === '--wbs') wbs = argv[++i] ?? wbs;
|
|
225
|
+
else if (a === '--status') status = argv[++i] ?? null;
|
|
226
|
+
else if (a === '--deps') {
|
|
227
|
+
const raw = argv[++i] ?? '';
|
|
228
|
+
deps =
|
|
229
|
+
raw.length === 0
|
|
230
|
+
? []
|
|
231
|
+
: raw
|
|
232
|
+
.split(',')
|
|
233
|
+
.map((s) => s.trim())
|
|
234
|
+
.filter(Boolean);
|
|
235
|
+
} else if (a === '--dep-status') {
|
|
236
|
+
const raw = argv[++i] ?? '';
|
|
237
|
+
for (const part of raw.split(',')) {
|
|
238
|
+
const [k, v] = part.split(':');
|
|
239
|
+
if (k && v) depStatuses[k.trim()] = v.trim();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
status,
|
|
245
|
+
deps,
|
|
246
|
+
depStatuses,
|
|
247
|
+
wbs,
|
|
248
|
+
recovery,
|
|
249
|
+
help,
|
|
250
|
+
json,
|
|
251
|
+
operation,
|
|
252
|
+
force,
|
|
253
|
+
filteredCount,
|
|
254
|
+
requiredSections,
|
|
255
|
+
presentSections,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
var PREFLIGHT_CLI_USAGE = `Usage:
|
|
259
|
+
bun plugins/sp/scripts/batch-preflight.ts --wbs <wbs> --status <status> \\
|
|
260
|
+
[--deps 0275,0276] [--dep-status 0275:done,0276:todo] [--recovery] [--json]
|
|
261
|
+
bun plugins/sp/scripts/batch-preflight.ts --operation <run|refine|verify> --wbs <wbs> --status <status> [--filtered-count <n>] [--required-sections A,B] [--present-sections A,B] [--force] [--json]
|
|
262
|
+
|
|
263
|
+
Exit: 0 = run (or recovery hint printed); 2 = skip; 1 = usage.`;
|
|
264
|
+
function runPreflightCli(argv) {
|
|
265
|
+
const args = parsePreflightCliArgs(argv);
|
|
266
|
+
if (args.help) return { exitCode: 0, stdout: '', stderr: PREFLIGHT_CLI_USAGE };
|
|
267
|
+
if (!args.status) return { exitCode: 1, stdout: '', stderr: PREFLIGHT_CLI_USAGE };
|
|
268
|
+
if (args.recovery) {
|
|
269
|
+
const hint = recoveryHint(args.status, args.wbs);
|
|
270
|
+
const body = args.json
|
|
271
|
+
? `${JSON.stringify({ recovery: hint }, null, 2)}
|
|
272
|
+
`
|
|
273
|
+
: hint
|
|
274
|
+
? `${hint.command}
|
|
275
|
+
`
|
|
276
|
+
: `no recovery hop
|
|
277
|
+
`;
|
|
278
|
+
return { exitCode: 0, stdout: body, stderr: '' };
|
|
279
|
+
}
|
|
280
|
+
if (args.operation !== null) {
|
|
281
|
+
const result2 = quickReadiness({
|
|
282
|
+
wbs: args.wbs,
|
|
283
|
+
status: args.status,
|
|
284
|
+
operation: args.operation,
|
|
285
|
+
dependencies: args.deps,
|
|
286
|
+
depStatuses: args.depStatuses,
|
|
287
|
+
...(args.filteredCount !== null ? { filteredCount: args.filteredCount } : {}),
|
|
288
|
+
...(args.requiredSections.length > 0 ? { requiredSections: args.requiredSections } : {}),
|
|
289
|
+
...(args.presentSections.length > 0 ? { presentSections: args.presentSections } : {}),
|
|
290
|
+
...(args.force ? { force: true } : {}),
|
|
291
|
+
});
|
|
292
|
+
const runnable = result2.action === 'runnable' || result2.action === 'needs-refinement';
|
|
293
|
+
if (args.json) {
|
|
294
|
+
return {
|
|
295
|
+
exitCode: runnable ? 0 : 2,
|
|
296
|
+
stdout: `${JSON.stringify(result2, null, 2)}
|
|
297
|
+
`,
|
|
298
|
+
stderr: '',
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
return {
|
|
302
|
+
exitCode: runnable ? 0 : 2,
|
|
303
|
+
stdout: `${result2.action}${result2.code ? ` ${result2.code}` : ''}: ${result2.reason}
|
|
304
|
+
`,
|
|
305
|
+
stderr: '',
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
const result = preflightTask({
|
|
309
|
+
wbs: args.wbs,
|
|
310
|
+
status: args.status,
|
|
311
|
+
dependencies: args.deps,
|
|
312
|
+
depStatuses: args.depStatuses,
|
|
313
|
+
});
|
|
314
|
+
if (args.json) {
|
|
315
|
+
return {
|
|
316
|
+
exitCode: result.action === 'run' ? 0 : 2,
|
|
317
|
+
stdout: `${JSON.stringify(result, null, 2)}
|
|
318
|
+
`,
|
|
319
|
+
stderr: '',
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
if (result.action === 'run') {
|
|
323
|
+
return {
|
|
324
|
+
exitCode: 0,
|
|
325
|
+
stdout: `run: ${result.reason ?? 'ok'}
|
|
326
|
+
`,
|
|
327
|
+
stderr: '',
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
return {
|
|
331
|
+
exitCode: 2,
|
|
332
|
+
stdout: `skip ${result.code}: ${result.reason}
|
|
333
|
+
`,
|
|
334
|
+
stderr: '',
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
{
|
|
338
|
+
const { exitCode, stdout, stderr } = runPreflightCli(process.argv.slice(2));
|
|
339
|
+
if (stdout) process.stdout.write(stdout);
|
|
340
|
+
if (stderr)
|
|
341
|
+
process.stderr.write(`${stderr}
|
|
342
|
+
`);
|
|
343
|
+
process.exit(exitCode);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export { PREFLIGHT_CLI_USAGE, parsePreflightCliArgs, preflightTask, quickReadiness, recoveryHint, runPreflightCli };
|