@12ui/design 0.2.12 → 0.2.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/README.md +44 -9
- package/dist/branch-client.d.ts +155 -0
- package/dist/branch-client.d.ts.map +1 -0
- package/dist/branch-client.js +179 -0
- package/dist/branch-client.js.map +1 -0
- package/dist/branch-completion.d.ts +37 -0
- package/dist/branch-completion.d.ts.map +1 -0
- package/dist/branch-completion.js +137 -0
- package/dist/branch-completion.js.map +1 -0
- package/dist/branch-dispatch-loop.d.ts +84 -0
- package/dist/branch-dispatch-loop.d.ts.map +1 -0
- package/dist/branch-dispatch-loop.js +206 -0
- package/dist/branch-dispatch-loop.js.map +1 -0
- package/dist/branch-downloads.d.ts +43 -0
- package/dist/branch-downloads.d.ts.map +1 -0
- package/dist/branch-downloads.js +94 -0
- package/dist/branch-downloads.js.map +1 -0
- package/dist/branch-execution-types.d.ts +54 -0
- package/dist/branch-execution-types.d.ts.map +1 -0
- package/dist/branch-execution-types.js +2 -0
- package/dist/branch-execution-types.js.map +1 -0
- package/dist/branch-execution.d.ts +18 -0
- package/dist/branch-execution.d.ts.map +1 -0
- package/dist/branch-execution.js +261 -0
- package/dist/branch-execution.js.map +1 -0
- package/dist/branch-identity.d.ts +71 -0
- package/dist/branch-identity.d.ts.map +1 -0
- package/dist/branch-identity.js +72 -0
- package/dist/branch-identity.js.map +1 -0
- package/dist/branch-materialize.d.ts +22 -0
- package/dist/branch-materialize.d.ts.map +1 -0
- package/dist/branch-materialize.js +47 -0
- package/dist/branch-materialize.js.map +1 -0
- package/dist/branch-page-conversion.d.ts +39 -0
- package/dist/branch-page-conversion.d.ts.map +1 -0
- package/dist/branch-page-conversion.js +206 -0
- package/dist/branch-page-conversion.js.map +1 -0
- package/dist/branch-plan.d.ts +63 -0
- package/dist/branch-plan.d.ts.map +1 -0
- package/dist/branch-plan.js +95 -0
- package/dist/branch-plan.js.map +1 -0
- package/dist/branch-progress.d.ts +75 -0
- package/dist/branch-progress.d.ts.map +1 -0
- package/dist/branch-progress.js +159 -0
- package/dist/branch-progress.js.map +1 -0
- package/dist/branch-run-record.d.ts +153 -0
- package/dist/branch-run-record.d.ts.map +1 -0
- package/dist/branch-run-record.js +94 -0
- package/dist/branch-run-record.js.map +1 -0
- package/dist/branch-schedule.d.ts +74 -0
- package/dist/branch-schedule.d.ts.map +1 -0
- package/dist/branch-schedule.js +130 -0
- package/dist/branch-schedule.js.map +1 -0
- package/dist/branch-status.d.ts +11 -0
- package/dist/branch-status.d.ts.map +1 -0
- package/dist/branch-status.js +115 -0
- package/dist/branch-status.js.map +1 -0
- package/dist/branch-viewport-normalization.d.ts +74 -0
- package/dist/branch-viewport-normalization.d.ts.map +1 -0
- package/dist/branch-viewport-normalization.js +120 -0
- package/dist/branch-viewport-normalization.js.map +1 -0
- package/dist/cli-arguments.d.ts.map +1 -1
- package/dist/cli-arguments.js +5 -0
- package/dist/cli-arguments.js.map +1 -1
- package/dist/cli-branch-command.d.ts +46 -0
- package/dist/cli-branch-command.d.ts.map +1 -0
- package/dist/cli-branch-command.js +426 -0
- package/dist/cli-branch-command.js.map +1 -0
- package/dist/cli-capabilities.d.ts +28 -0
- package/dist/cli-capabilities.d.ts.map +1 -1
- package/dist/cli-capabilities.js +29 -1
- package/dist/cli-capabilities.js.map +1 -1
- package/dist/cli-create-command.d.ts +21 -0
- package/dist/cli-create-command.d.ts.map +1 -0
- package/dist/cli-create-command.js +319 -0
- package/dist/cli-create-command.js.map +1 -0
- package/dist/cli-detach.d.ts +62 -0
- package/dist/cli-detach.d.ts.map +1 -0
- package/dist/cli-detach.js +123 -0
- package/dist/cli-detach.js.map +1 -0
- package/dist/cli-draft-command.d.ts +63 -0
- package/dist/cli-draft-command.d.ts.map +1 -0
- package/dist/cli-draft-command.js +220 -0
- package/dist/cli-draft-command.js.map +1 -0
- package/dist/cli-export-command.d.ts.map +1 -1
- package/dist/cli-export-command.js +2 -3
- package/dist/cli-export-command.js.map +1 -1
- package/dist/cli-image-batch-command.d.ts +21 -0
- package/dist/cli-image-batch-command.d.ts.map +1 -1
- package/dist/cli-image-batch-command.js +166 -54
- package/dist/cli-image-batch-command.js.map +1 -1
- package/dist/cli-image-batch-materialize.d.ts +27 -0
- package/dist/cli-image-batch-materialize.d.ts.map +1 -0
- package/dist/cli-image-batch-materialize.js +41 -0
- package/dist/cli-image-batch-materialize.js.map +1 -0
- package/dist/cli-image-batch-resume.d.ts +34 -0
- package/dist/cli-image-batch-resume.d.ts.map +1 -0
- package/dist/cli-image-batch-resume.js +175 -0
- package/dist/cli-image-batch-resume.js.map +1 -0
- package/dist/cli-image-command.d.ts.map +1 -1
- package/dist/cli-image-command.js +14 -2
- package/dist/cli-image-command.js.map +1 -1
- package/dist/cli-package-command.d.ts +18 -0
- package/dist/cli-package-command.d.ts.map +1 -0
- package/dist/cli-package-command.js +112 -0
- package/dist/cli-package-command.js.map +1 -0
- package/dist/cli-progress.d.ts +61 -0
- package/dist/cli-progress.d.ts.map +1 -1
- package/dist/cli-progress.js +53 -0
- package/dist/cli-progress.js.map +1 -1
- package/dist/cli-select-command.d.ts +12 -0
- package/dist/cli-select-command.d.ts.map +1 -0
- package/dist/cli-select-command.js +66 -0
- package/dist/cli-select-command.js.map +1 -0
- package/dist/cli.js +140 -7
- package/dist/cli.js.map +1 -1
- package/dist/create-identity.d.ts +25 -0
- package/dist/create-identity.d.ts.map +1 -0
- package/dist/create-identity.js +0 -0
- package/dist/create-identity.js.map +1 -0
- package/dist/draft-identity.d.ts +30 -0
- package/dist/draft-identity.d.ts.map +1 -0
- package/dist/draft-identity.js +0 -0
- package/dist/draft-identity.js.map +1 -0
- package/dist/draft-prompts.d.ts +35 -0
- package/dist/draft-prompts.d.ts.map +1 -0
- package/dist/draft-prompts.js +51 -0
- package/dist/draft-prompts.js.map +1 -0
- package/dist/draft-run.d.ts +32 -0
- package/dist/draft-run.d.ts.map +1 -0
- package/dist/draft-run.js +152 -0
- package/dist/draft-run.js.map +1 -0
- package/dist/draft-workspace.d.ts +90 -0
- package/dist/draft-workspace.d.ts.map +1 -0
- package/dist/draft-workspace.js +64 -0
- package/dist/draft-workspace.js.map +1 -0
- package/dist/image-batch-status.d.ts +42 -0
- package/dist/image-batch-status.d.ts.map +1 -0
- package/dist/image-batch-status.js +142 -0
- package/dist/image-batch-status.js.map +1 -0
- package/dist/image-dimensions.d.ts +12 -0
- package/dist/image-dimensions.d.ts.map +1 -0
- package/dist/image-dimensions.js +14 -0
- package/dist/image-dimensions.js.map +1 -0
- package/dist/image-generation-batch-attempt.d.ts +28 -0
- package/dist/image-generation-batch-attempt.d.ts.map +1 -0
- package/dist/image-generation-batch-attempt.js +48 -0
- package/dist/image-generation-batch-attempt.js.map +1 -0
- package/dist/image-generation-completion.d.ts +43 -0
- package/dist/image-generation-completion.d.ts.map +1 -0
- package/dist/image-generation-completion.js +54 -0
- package/dist/image-generation-completion.js.map +1 -0
- package/dist/image-generation-fs.d.ts +3 -0
- package/dist/image-generation-fs.d.ts.map +1 -0
- package/dist/image-generation-fs.js +23 -0
- package/dist/image-generation-fs.js.map +1 -0
- package/dist/image-generation-request.d.ts +13 -3
- package/dist/image-generation-request.d.ts.map +1 -1
- package/dist/image-generation-request.js +21 -19
- package/dist/image-generation-request.js.map +1 -1
- package/dist/image-generation-resume.d.ts +49 -0
- package/dist/image-generation-resume.d.ts.map +1 -0
- package/dist/image-generation-resume.js +96 -0
- package/dist/image-generation-resume.js.map +1 -0
- package/dist/image-generation-run.d.ts +11 -0
- package/dist/image-generation-run.d.ts.map +1 -1
- package/dist/image-generation-run.js +23 -9
- package/dist/image-generation-run.js.map +1 -1
- package/dist/image-generation-staging.d.ts +25 -0
- package/dist/image-generation-staging.d.ts.map +1 -0
- package/dist/image-generation-staging.js +80 -0
- package/dist/image-generation-staging.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/legacy-skill-catalog.d.ts.map +1 -1
- package/dist/legacy-skill-catalog.js +133 -0
- package/dist/legacy-skill-catalog.js.map +1 -1
- package/dist/package-manifest-file.d.ts +21 -0
- package/dist/package-manifest-file.d.ts.map +1 -0
- package/dist/package-manifest-file.js +119 -0
- package/dist/package-manifest-file.js.map +1 -0
- package/dist/package-manifest-template.d.ts +23 -0
- package/dist/package-manifest-template.d.ts.map +1 -0
- package/dist/package-manifest-template.js +60 -0
- package/dist/package-manifest-template.js.map +1 -0
- package/dist/package-submission.d.ts +103 -0
- package/dist/package-submission.d.ts.map +1 -0
- package/dist/package-submission.js +173 -0
- package/dist/package-submission.js.map +1 -0
- package/dist/selection-record.d.ts +95 -0
- package/dist/selection-record.d.ts.map +1 -0
- package/dist/selection-record.js +121 -0
- package/dist/selection-record.js.map +1 -0
- package/package.json +1 -1
- package/skills/design/SKILL.md +55 -240
- package/skills/design-branch/SKILL.md +36 -116
- package/skills/design-convert/SKILL.md +62 -132
- package/skills/design-draft/SKILL.md +71 -135
- package/skills/design-search/SKILL.md +29 -78
- package/skills/design/references/continuation-contract.md +0 -60
- package/skills/design/references/selection-contract.md +0 -96
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { booleanFlag, stringFlag } from './cli-arguments.js';
|
|
5
|
+
import { OPERATION_DURATION_HINTS, formatDuration, nextActionLine, } from './cli-progress.js';
|
|
6
|
+
import { readConversionConfig } from './config.js';
|
|
7
|
+
import { INSPIRATION_ATTEMPT_FILE } from './cli-corpus-types.js';
|
|
8
|
+
import { TwelveUiCorpusClient } from './corpus-client.js';
|
|
9
|
+
import { summarizeImageBatchProgress } from './image-batch-status.js';
|
|
10
|
+
import { createDraftWorkspace, draftPaths, readDraftRecord, } from './draft-workspace.js';
|
|
11
|
+
import { DRAFT_CANDIDATE_COUNT, prepareDraftRun } from './draft-run.js';
|
|
12
|
+
import { readSelectionRecord } from './selection-record.js';
|
|
13
|
+
/**
|
|
14
|
+
* `12ui draft` — the whole explore step as one command.
|
|
15
|
+
*
|
|
16
|
+
* The caller supplies the design problem. Everything else — where the run
|
|
17
|
+
* lives, which references steer which candidate, how the keys are derived,
|
|
18
|
+
* when the batch is done — is the CLI's, because each of those was previously
|
|
19
|
+
* a paragraph of prose that a model could and did paraphrase away.
|
|
20
|
+
*/
|
|
21
|
+
export const DRAFT_USAGE = 'Usage:\n'
|
|
22
|
+
+ ' 12ui draft --query <text> [--redesign-source <png>] [--mode exploratory|reskin]\n'
|
|
23
|
+
+ ' [--aspect landscape|portrait|square] [--provider auto|codex|openai]\n'
|
|
24
|
+
+ ' [--project-root <directory>] [--wait] [--quiet]\n'
|
|
25
|
+
+ ' 12ui draft status <run-dir> [--json]';
|
|
26
|
+
const parseMode = (flags, hasSource) => {
|
|
27
|
+
const mode = stringFlag(flags, 'mode')?.trim();
|
|
28
|
+
if (!hasSource) {
|
|
29
|
+
if (mode)
|
|
30
|
+
throw new Error('--mode applies to a redesign; pass --redesign-source with it');
|
|
31
|
+
return 'new-interface';
|
|
32
|
+
}
|
|
33
|
+
if (mode === undefined || mode === 'exploratory')
|
|
34
|
+
return 'exploratory-redesign';
|
|
35
|
+
if (mode === 'reskin')
|
|
36
|
+
return 'structure-preserving-reskin';
|
|
37
|
+
throw new Error('--mode must be exploratory or reskin');
|
|
38
|
+
};
|
|
39
|
+
const parseAspect = (flags) => {
|
|
40
|
+
const aspect = stringFlag(flags, 'aspect')?.trim();
|
|
41
|
+
if (aspect === undefined)
|
|
42
|
+
return 'landscape';
|
|
43
|
+
if (aspect === 'landscape' || aspect === 'portrait' || aspect === 'square')
|
|
44
|
+
return aspect;
|
|
45
|
+
throw new Error('--aspect must be landscape, portrait, or square');
|
|
46
|
+
};
|
|
47
|
+
const parseProvider = (flags) => {
|
|
48
|
+
const provider = stringFlag(flags, 'provider')?.trim();
|
|
49
|
+
if (provider === undefined)
|
|
50
|
+
return 'auto';
|
|
51
|
+
if (provider === 'auto' || provider === 'codex' || provider === 'openai')
|
|
52
|
+
return provider;
|
|
53
|
+
throw new Error('--provider must be auto, codex, or openai');
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Prepare the run: create the directory, buy one corpus search, write the
|
|
57
|
+
* generation manifest. Dispatching the images is the caller's next move, so
|
|
58
|
+
* this stays testable without a provider.
|
|
59
|
+
*/
|
|
60
|
+
export const prepareDraftCommand = async (flags, dependencies = {}) => {
|
|
61
|
+
const query = stringFlag(flags, 'query')?.replace(/\s+/gu, ' ').trim();
|
|
62
|
+
if (!query)
|
|
63
|
+
throw new Error(DRAFT_USAGE);
|
|
64
|
+
const write = dependencies.write ?? ((line) => { process.stdout.write(`${line}\n`); });
|
|
65
|
+
const sourceFlag = stringFlag(flags, 'redesign-source')?.trim();
|
|
66
|
+
const mode = parseMode(flags, Boolean(sourceFlag));
|
|
67
|
+
const redesignSource = sourceFlag
|
|
68
|
+
? await (async () => {
|
|
69
|
+
const resolved = path.resolve(sourceFlag);
|
|
70
|
+
const bytes = new Uint8Array(await readFile(resolved));
|
|
71
|
+
return { path: resolved, sha256: createHash('sha256').update(bytes).digest('hex') };
|
|
72
|
+
})()
|
|
73
|
+
: undefined;
|
|
74
|
+
const config = (dependencies.readConfig ?? readConversionConfig)({
|
|
75
|
+
origin: stringFlag(flags, 'origin'),
|
|
76
|
+
apiKey: stringFlag(flags, 'api-key'),
|
|
77
|
+
});
|
|
78
|
+
const paths = await createDraftWorkspace({
|
|
79
|
+
query,
|
|
80
|
+
...(dependencies.workspaceRoot ? { root: dependencies.workspaceRoot } : {}),
|
|
81
|
+
});
|
|
82
|
+
// FIRST line of output, before anything slow or paid: every later command
|
|
83
|
+
// needs this path, and a run whose directory is never printed is a run the
|
|
84
|
+
// caller cannot continue.
|
|
85
|
+
write(paths.runDir);
|
|
86
|
+
const client = (dependencies.createClient ?? ((value) => new TwelveUiCorpusClient(value)))(config);
|
|
87
|
+
await prepareDraftRun({
|
|
88
|
+
paths,
|
|
89
|
+
client,
|
|
90
|
+
origin: config.origin,
|
|
91
|
+
query,
|
|
92
|
+
mode,
|
|
93
|
+
aspect: parseAspect(flags),
|
|
94
|
+
provider: parseProvider(flags),
|
|
95
|
+
projectRoot: path.resolve(stringFlag(flags, 'project-root')?.trim() || process.cwd()),
|
|
96
|
+
...(redesignSource ? { redesignSource } : {}),
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
runDir: paths.runDir,
|
|
100
|
+
manifestPath: paths.generationManifest,
|
|
101
|
+
candidateCount: DRAFT_CANDIDATE_COUNT,
|
|
102
|
+
nextAction: nextActionLine({
|
|
103
|
+
what: `${DRAFT_CANDIDATE_COUNT} candidates`,
|
|
104
|
+
typicalSeconds: OPERATION_DURATION_HINTS.imageBatch,
|
|
105
|
+
statusCommand: `12ui draft status ${paths.runDir}`,
|
|
106
|
+
waitHint: 'or re-run the draft with --wait to block in this shell instead',
|
|
107
|
+
}),
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* The corpus attempt record a draft writes before it spends anything. Its
|
|
112
|
+
* presence without a `draft.json` beside it is proof the run started here and
|
|
113
|
+
* died, which is the difference between "no run" and "a failed run".
|
|
114
|
+
*/
|
|
115
|
+
const readDraftAttemptRecord = async (referencesDir) => {
|
|
116
|
+
try {
|
|
117
|
+
const parsed = JSON.parse(await readFile(path.join(referencesDir, INSPIRATION_ATTEMPT_FILE), 'utf8'));
|
|
118
|
+
return { createdAt: typeof parsed.createdAt === 'string' ? parsed.createdAt : 'an earlier time' };
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
export const runDraftStatusCommand = async (runDirArgument, _flags) => {
|
|
125
|
+
if (!runDirArgument)
|
|
126
|
+
throw new Error(DRAFT_USAGE);
|
|
127
|
+
const paths = draftPaths(runDirArgument);
|
|
128
|
+
const record = await readDraftRecord(paths.draftRecord);
|
|
129
|
+
if (!record) {
|
|
130
|
+
/**
|
|
131
|
+
* MEASURED 2026-08-11: a draft whose corpus search died left its directory
|
|
132
|
+
* holding only the attempt record, and this message told the caller that
|
|
133
|
+
* "nothing has failed" — which was false, and sent a driver back to poll a
|
|
134
|
+
* dead handle. A directory that holds an attempt record IS a run that
|
|
135
|
+
* started here and did not finish, and it must say so.
|
|
136
|
+
*/
|
|
137
|
+
const started = await readDraftAttemptRecord(paths.referencesDir);
|
|
138
|
+
throw new Error(started
|
|
139
|
+
? `The draft run in ${paths.runDir} failed before its references landed —`
|
|
140
|
+
+ ` it started at ${started.createdAt} and never wrote`
|
|
141
|
+
+ ` ${path.basename(paths.draftRecord)}. Re-run the same`
|
|
142
|
+
+ ' `12ui draft --query "…"`: the corpus search replays on its derived key rather than'
|
|
143
|
+
+ ' being bought again, and the new run prints the directory to use from then on.'
|
|
144
|
+
: `No draft run in ${paths.runDir} — there is no ${path.basename(paths.draftRecord)} here, and`
|
|
145
|
+
+ ' nothing has failed. Start one with `12ui draft --query "<product, audience, surface,'
|
|
146
|
+
+ ' goal, personality>"`, which prints the run directory to use.');
|
|
147
|
+
}
|
|
148
|
+
const batch = await summarizeImageBatchProgress({ manifestPath: record.generation.manifestPath });
|
|
149
|
+
const selection = await readSelectionRecord(paths.selection);
|
|
150
|
+
const candidates = batch.candidates.map((candidate) => ({
|
|
151
|
+
id: candidate.id,
|
|
152
|
+
status: candidate.status,
|
|
153
|
+
path: candidate.outputPath,
|
|
154
|
+
}));
|
|
155
|
+
if (selection) {
|
|
156
|
+
return {
|
|
157
|
+
runDir: paths.runDir,
|
|
158
|
+
query: record.query,
|
|
159
|
+
phase: 'selected',
|
|
160
|
+
complete: true,
|
|
161
|
+
candidates,
|
|
162
|
+
winner: selection.winner,
|
|
163
|
+
narrative: `Candidate ${selection.winner} is selected. Convert it with`
|
|
164
|
+
+ ` \`12ui convert ${paths.candidatesDir}/${selection.winner}.png --export html\` for a`
|
|
165
|
+
+ ` single view, or grow the whole surface with \`12ui branch execute ${paths.runDir}\`.`,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
if (batch.complete) {
|
|
169
|
+
return {
|
|
170
|
+
runDir: paths.runDir,
|
|
171
|
+
query: record.query,
|
|
172
|
+
phase: 'ready',
|
|
173
|
+
complete: true,
|
|
174
|
+
candidates,
|
|
175
|
+
narrative: `${batch.counts.complete} of ${batch.counts.total} candidates are ready in`
|
|
176
|
+
+ ` ${paths.candidatesDir}. Look at them at original detail, then record the choice with`
|
|
177
|
+
+ ` \`12ui select ${paths.runDir} --winner <id> --reason "<why>"\`.`,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
runDir: paths.runDir,
|
|
182
|
+
query: record.query,
|
|
183
|
+
phase: batch.neverDispatched ? 'searching' : 'generating',
|
|
184
|
+
complete: false,
|
|
185
|
+
candidates,
|
|
186
|
+
narrative: batch.neverDispatched
|
|
187
|
+
? `The references are retrieved and the generation manifest is written, but no candidate has`
|
|
188
|
+
+ ' been requested yet.'
|
|
189
|
+
: batch.narrative,
|
|
190
|
+
nextAction: batch.neverDispatched
|
|
191
|
+
? `Run \`12ui image generate-batch --manifest ${record.generation.manifestPath}\` to generate`
|
|
192
|
+
+ ` the candidates; it takes about ${formatDuration(OPERATION_DURATION_HINTS.imageBatch)}.`
|
|
193
|
+
: nextActionLine({
|
|
194
|
+
what: `${batch.counts.total} candidates`,
|
|
195
|
+
typicalSeconds: OPERATION_DURATION_HINTS.imageBatch,
|
|
196
|
+
statusCommand: `12ui draft status ${paths.runDir}`,
|
|
197
|
+
waitHint: 'or wait for the dispatch that is already running',
|
|
198
|
+
}),
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
export const draftBanner = (prepared) => (`${prepared.candidateCount} candidates generating from ${prepared.candidateCount} corpus`
|
|
202
|
+
+ ` references, one each.\n${prepared.nextAction}`);
|
|
203
|
+
export const draftDetachRequested = (flags) => !booleanFlag(flags, 'wait');
|
|
204
|
+
/**
|
|
205
|
+
* The whole explore step. Prepare (one paid corpus search), then hand the
|
|
206
|
+
* generation to `image generate-batch` — detached by default, because an
|
|
207
|
+
* agent's shell cannot hold 90 seconds and a cut dispatch reads as a failure.
|
|
208
|
+
*/
|
|
209
|
+
export const runDraftCommand = async (flags, dependencies) => {
|
|
210
|
+
const prepared = await prepareDraftCommand(flags, dependencies);
|
|
211
|
+
const quiet = booleanFlag(flags, 'quiet');
|
|
212
|
+
if (!quiet)
|
|
213
|
+
process.stderr.write(`${draftBanner(prepared)}\n`);
|
|
214
|
+
await dependencies.generate({
|
|
215
|
+
manifestPath: prepared.manifestPath,
|
|
216
|
+
detach: draftDetachRequested(flags),
|
|
217
|
+
});
|
|
218
|
+
return prepared;
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=cli-draft-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-draft-command.js","sourceRoot":"","sources":["../src/cli-draft-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAiB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,eAAe,GAEhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAA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CAAC,KAAe,EAAW,EAAE,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAE9F;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAClC,KAAe,EACf,YAOC,EACuB,EAAE;IAC1B,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAChE,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK;QAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,YAAY,CAAC,QAAQ,CAAC;QAC1B,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC;KACpC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-export-command.d.ts","sourceRoot":"","sources":["../src/cli-export-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-export-command.d.ts","sourceRoot":"","sources":["../src/cli-export-command.ts"],"names":[],"mappings":"AASA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA8N/D,eAAO,MAAM,gBAAgB,GAC3B,oBAAoB,MAAM,GAAG,SAAS,EACtC,OAAO,QAAQ,KACd,OAAO,CAAC,IAAI,CAwFd,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { createHash } from 'node:crypto';
|
|
|
2
2
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { materializeConversionArtifacts, } from './artifact-materializer.js';
|
|
5
|
+
import { conversionExportKey } from './branch-identity.js';
|
|
5
6
|
import { stringFlag } from './cli-arguments.js';
|
|
6
7
|
import { exportManifestPath, exportOutputFilePath, prepareExportOutputDirectory, } from './cli-export-output-directory.js';
|
|
7
8
|
import { TwelveUiConversionClient, } from './conversion-client.js';
|
|
@@ -158,9 +159,7 @@ export const runExportCommand = async (sourceConversionId, flags) => {
|
|
|
158
159
|
if (!outDirValue)
|
|
159
160
|
throw new Error('--out-dir is required');
|
|
160
161
|
const outDir = path.resolve(outDirValue);
|
|
161
|
-
const idempotencyKey = normalizeOptionalIdempotencyKey(stringFlag(flags, 'idempotency-key'), '--idempotency-key');
|
|
162
|
-
if (!idempotencyKey)
|
|
163
|
-
throw new Error('--idempotency-key is required');
|
|
162
|
+
const idempotencyKey = normalizeOptionalIdempotencyKey(stringFlag(flags, 'idempotency-key'), '--idempotency-key') ?? conversionExportKey({ sourceConversionId: sourceId });
|
|
164
163
|
const responsiveValue = stringFlag(flags, 'responsive-quality') ?? 'standard';
|
|
165
164
|
if (!isResponsiveConversionQuality(responsiveValue)) {
|
|
166
165
|
throw new Error('--responsive-quality must be standard or pro');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-export-command.js","sourceRoot":"","sources":["../src/cli-export-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,8BAA8B,GAE/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAiB,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,wBAAwB,GAGzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,kBAAkB,GAEnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAA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C,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;aACtF,CAAC;QACF,CAAC,CAAC,EAAE,CAAC,CAAC;IACR,MAAM,YAAY,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,SAAS,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QAC9C,aAAa,EAAE,CAAC;QAChB,kBAAkB,EAAE,MAAM,CAAC,EAAE;QAC7B,oBAAoB,EAAE,MAAM,CAAC,YAAY,CAAC;QAC1C,cAAc;QACd,UAAU;QACV,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACrC,OAAO;QACP,QAAQ;KACT,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACjC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,kDAAkD,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAC1E,GAAG,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,KAAK,EAAE,CACtC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,YAAY,EAAE,CAC3C,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;QACzB,kBAAkB,EAAE,MAAM,CAAC,EAAE;QAC7B,oBAAoB,EAAE,MAAM,CAAC,YAAY,CAAC;QAC1C,YAAY;QACZ,OAAO;KACR,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { ensembleImage } from '@just-every/ensemble';
|
|
2
2
|
import { type CliFlags } from './cli-arguments.js';
|
|
3
3
|
import { preflightImageProvider } from './image-provider-preflight.js';
|
|
4
|
+
export declare const IMAGE_BATCH_HEARTBEAT_MS = 15000;
|
|
5
|
+
/**
|
|
6
|
+
* The batch keeps its output directory empty until it is terminal, so silence
|
|
7
|
+
* here is indistinguishable from death. A heartbeat reads the staging ledgers
|
|
8
|
+
* and narrates what each candidate is doing, which is what stops a caller from
|
|
9
|
+
* deciding the command hung and improvising around it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const startImageBatchHeartbeat: (args: {
|
|
12
|
+
manifestPath: string;
|
|
13
|
+
quiet?: boolean;
|
|
14
|
+
intervalMs?: number;
|
|
15
|
+
write?: (line: string) => void;
|
|
16
|
+
now?: () => number;
|
|
17
|
+
}) => {
|
|
18
|
+
stop: () => void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Read-only. It answers "is it still going?" without touching the batch, and
|
|
22
|
+
* it always answers with motion rather than with the absence of a sentinel.
|
|
23
|
+
*/
|
|
24
|
+
export declare const runImageBatchStatusCommand: (flags: CliFlags) => Promise<void>;
|
|
4
25
|
export declare const runImageBatchCommand: (flags: CliFlags, dependencies?: {
|
|
5
26
|
generate?: typeof ensembleImage;
|
|
6
27
|
preflight?: typeof preflightImageProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-image-batch-command.d.ts","sourceRoot":"","sources":["../src/cli-image-batch-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-image-batch-command.d.ts","sourceRoot":"","sources":["../src/cli-image-batch-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA+C5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AA+CvE,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,MAAM;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,KAAG;IAAE,IAAI,EAAE,MAAM,IAAI,CAAA;CAcrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAU,OAAO,QAAQ,KAAG,OAAO,CAAC,IAAI,CAO9E,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,QAAQ,EACf,eAAc;IACZ,QAAQ,CAAC,EAAE,OAAO,aAAa,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,sBAAsB,CAAC;CACtC,KACL,OAAO,CAAC,IAAI,CA0Md,CAAC"}
|
|
@@ -1,57 +1,135 @@
|
|
|
1
|
-
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { mkdir, rename, rm, writeFile } from 'node:fs/promises';
|
|
3
1
|
import path from 'node:path';
|
|
4
|
-
import { stringFlag } from './cli-arguments.js';
|
|
2
|
+
import { booleanFlag, stringFlag } from './cli-arguments.js';
|
|
3
|
+
import { OPERATION_DURATION_HINTS, formatDuration, nextActionLine, } from './cli-progress.js';
|
|
4
|
+
import { summarizeImageBatchProgress } from './image-batch-status.js';
|
|
5
|
+
import { materializeImageBatch, publishImageBatchCompletion, } from './cli-image-batch-materialize.js';
|
|
6
|
+
import { describeBatchRecovery, neverDispatchedBatchMessage, resumeImageBatchCommand, } from './cli-image-batch-resume.js';
|
|
7
|
+
import { imageBatchAttemptPath, readBatchAttempt, writeBatchAttempt, } from './image-generation-batch-attempt.js';
|
|
5
8
|
import { readImageGenerationBatchManifest, resolveImageGenerationBatchRequests, } from './image-generation-batch-manifest.js';
|
|
9
|
+
import { imageGenerationPathExists } from './image-generation-fs.js';
|
|
10
|
+
import { batchWasNeverDispatched, classifyImageGenerationResume, resumeStateSummary, } from './image-generation-resume.js';
|
|
6
11
|
import { dispatchImageGeneration, failImageGenerationBeforeDispatch, markImageGenerationDispatched, reserveImageGeneration, } from './image-generation-run.js';
|
|
7
|
-
import {
|
|
8
|
-
import { summarizeImageGenerationUsage
|
|
9
|
-
import { preflightImageProvider
|
|
10
|
-
const writeBatchAttempt = async (file, attempt, exclusive = false) => {
|
|
11
|
-
await mkdir(path.dirname(file), { recursive: true });
|
|
12
|
-
if (exclusive) {
|
|
13
|
-
await writeFile(file, `${JSON.stringify(attempt, null, 2)}\n`, {
|
|
14
|
-
encoding: 'utf8',
|
|
15
|
-
flag: 'wx',
|
|
16
|
-
mode: 0o600,
|
|
17
|
-
});
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const temporary = `${file}.${randomUUID()}.tmp`;
|
|
21
|
-
try {
|
|
22
|
-
await writeFile(temporary, `${JSON.stringify(attempt, null, 2)}\n`, {
|
|
23
|
-
encoding: 'utf8',
|
|
24
|
-
flag: 'wx',
|
|
25
|
-
mode: 0o600,
|
|
26
|
-
});
|
|
27
|
-
await rename(temporary, file);
|
|
28
|
-
}
|
|
29
|
-
finally {
|
|
30
|
-
await rm(temporary, { force: true });
|
|
31
|
-
}
|
|
32
|
-
};
|
|
12
|
+
import { imageGenerationSha256, prepareImageGenerationRequest, } from './image-generation-request.js';
|
|
13
|
+
import { summarizeImageGenerationUsage } from './image-generation-usage.js';
|
|
14
|
+
import { preflightImageProvider } from './image-provider-preflight.js';
|
|
33
15
|
const errorMessage = (error) => (error instanceof Error ? error.message : String(error));
|
|
34
16
|
const failReserved = async (reserved, message) => {
|
|
35
17
|
await Promise.allSettled(reserved.map((item) => failImageGenerationBeforeDispatch(item, message)));
|
|
36
18
|
};
|
|
19
|
+
const identities = (requests) => requests.map((request) => ({
|
|
20
|
+
...(request.candidateId ? { candidateId: request.candidateId } : {}),
|
|
21
|
+
outputPath: request.outputPath,
|
|
22
|
+
idempotencyKey: request.idempotencyKey,
|
|
23
|
+
}));
|
|
24
|
+
/**
|
|
25
|
+
* Explain what the existing evidence permits instead of stopping at "evidence
|
|
26
|
+
* exists". A refusal that names no recovery is what turned a finished batch
|
|
27
|
+
* into a dead end for eleven benchmark runs.
|
|
28
|
+
*/
|
|
29
|
+
const existingEvidenceRefusal = async (args) => {
|
|
30
|
+
const states = await Promise.all(args.requests.map((request) => classifyImageGenerationResume({
|
|
31
|
+
outputPath: request.outputPath,
|
|
32
|
+
...(request.candidateId ? { candidateId: request.candidateId } : {}),
|
|
33
|
+
})));
|
|
34
|
+
const summary = resumeStateSummary(states);
|
|
35
|
+
const recoverable = summary.stageable + summary.redispatchable;
|
|
36
|
+
const guidance = recoverable > 0
|
|
37
|
+
? `Re-run the same command with --resume to recover ${recoverable} candidate(s) with no new`
|
|
38
|
+
+ ' spend; it never re-buys a candidate.'
|
|
39
|
+
: summary.unrecoverable > 0
|
|
40
|
+
? 'Nothing can be recovered without new spend; give the affected candidates a new output'
|
|
41
|
+
+ ' path and idempotency key if you accept buying them again.'
|
|
42
|
+
: 'Every candidate is already on disk — read them rather than generating again.';
|
|
43
|
+
return `Image batch attempt evidence already exists at ${args.batchAttemptFile}.`
|
|
44
|
+
+ ` ${describeBatchRecovery(states)}. ${guidance}`;
|
|
45
|
+
};
|
|
46
|
+
export const IMAGE_BATCH_HEARTBEAT_MS = 15_000;
|
|
47
|
+
/**
|
|
48
|
+
* The batch keeps its output directory empty until it is terminal, so silence
|
|
49
|
+
* here is indistinguishable from death. A heartbeat reads the staging ledgers
|
|
50
|
+
* and narrates what each candidate is doing, which is what stops a caller from
|
|
51
|
+
* deciding the command hung and improvising around it.
|
|
52
|
+
*/
|
|
53
|
+
export const startImageBatchHeartbeat = (args) => {
|
|
54
|
+
if (args.quiet)
|
|
55
|
+
return { stop: () => undefined };
|
|
56
|
+
const write = args.write ?? ((line) => { process.stderr.write(`${line}\n`); });
|
|
57
|
+
const startedAt = (args.now ?? Date.now)();
|
|
58
|
+
const timer = setInterval(() => {
|
|
59
|
+
void summarizeImageBatchProgress({ manifestPath: args.manifestPath })
|
|
60
|
+
.then((report) => {
|
|
61
|
+
const elapsed = formatDuration(((args.now ?? Date.now)() - startedAt) / 1000);
|
|
62
|
+
write(`[${elapsed}] generate-batch: ${report.narrative}`);
|
|
63
|
+
})
|
|
64
|
+
.catch(() => undefined);
|
|
65
|
+
}, args.intervalMs ?? IMAGE_BATCH_HEARTBEAT_MS);
|
|
66
|
+
timer.unref?.();
|
|
67
|
+
return { stop: () => clearInterval(timer) };
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Read-only. It answers "is it still going?" without touching the batch, and
|
|
71
|
+
* it always answers with motion rather than with the absence of a sentinel.
|
|
72
|
+
*/
|
|
73
|
+
export const runImageBatchStatusCommand = async (flags) => {
|
|
74
|
+
const manifestFlag = stringFlag(flags, 'manifest')?.trim();
|
|
75
|
+
if (!manifestFlag) {
|
|
76
|
+
throw new Error('Usage: 12ui image batch-status --manifest <batch.json> [--json]');
|
|
77
|
+
}
|
|
78
|
+
const report = await summarizeImageBatchProgress({ manifestPath: path.resolve(manifestFlag) });
|
|
79
|
+
console.log(JSON.stringify(report, null, 2));
|
|
80
|
+
};
|
|
37
81
|
export const runImageBatchCommand = async (flags, dependencies = {}) => {
|
|
38
82
|
const manifestFlag = stringFlag(flags, 'manifest')?.trim();
|
|
39
83
|
if (!manifestFlag) {
|
|
40
|
-
throw new Error('Usage: 12ui image generate-batch --manifest <batch.json>');
|
|
84
|
+
throw new Error('Usage: 12ui image generate-batch --manifest <batch.json> [--resume] [--wait] [--quiet]');
|
|
41
85
|
}
|
|
42
86
|
const manifestPath = path.resolve(manifestFlag);
|
|
43
|
-
const batchAttemptFile =
|
|
44
|
-
|
|
45
|
-
throw new Error(`Image batch attempt evidence already exists at ${batchAttemptFile}`);
|
|
46
|
-
}
|
|
87
|
+
const batchAttemptFile = imageBatchAttemptPath(manifestPath);
|
|
88
|
+
const resumeRequested = booleanFlag(flags, 'resume');
|
|
47
89
|
const { manifest, source } = await readImageGenerationBatchManifest(manifestPath);
|
|
48
90
|
const requests = resolveImageGenerationBatchRequests({ manifest, manifestPath });
|
|
49
|
-
const
|
|
91
|
+
const manifestSha256 = imageGenerationSha256(source);
|
|
92
|
+
const existingBatchAttempt = await readBatchAttempt(batchAttemptFile);
|
|
93
|
+
// `--resume` reached for before the batch was ever dispatched. Answering with
|
|
94
|
+
// a recovery report here is what turned an un-started batch into a believed
|
|
95
|
+
// provider outage in 18 of 24 compliance runs, so this answers in a different
|
|
96
|
+
// register entirely: nothing failed, and here is the command to run.
|
|
97
|
+
if (resumeRequested && !(await imageGenerationPathExists(batchAttemptFile))) {
|
|
98
|
+
const states = await Promise.all(requests.map((request) => classifyImageGenerationResume({
|
|
99
|
+
outputPath: request.outputPath,
|
|
100
|
+
...(request.candidateId ? { candidateId: request.candidateId } : {}),
|
|
101
|
+
})));
|
|
102
|
+
if (batchWasNeverDispatched(states))
|
|
103
|
+
throw new Error(neverDispatchedBatchMessage(manifestPath));
|
|
104
|
+
}
|
|
105
|
+
if (await imageGenerationPathExists(batchAttemptFile)) {
|
|
106
|
+
if (!resumeRequested) {
|
|
107
|
+
throw new Error(await existingEvidenceRefusal({ batchAttemptFile, requests }));
|
|
108
|
+
}
|
|
109
|
+
if (!existingBatchAttempt) {
|
|
110
|
+
throw new Error(`Image batch attempt evidence at ${batchAttemptFile} is unreadable, so no candidate can be`
|
|
111
|
+
+ ' proved unbilled. Inspect it before resuming.');
|
|
112
|
+
}
|
|
113
|
+
if (existingBatchAttempt.manifestSha256 !== manifestSha256) {
|
|
114
|
+
throw new Error(`Refusing to resume: ${manifestPath} has changed since the batch was dispatched`
|
|
115
|
+
+ ` (${existingBatchAttempt.manifestSha256} then, ${manifestSha256} now). A resume must`
|
|
116
|
+
+ ' replay the same candidate identities.');
|
|
117
|
+
}
|
|
118
|
+
await resumeImageBatchCommand({
|
|
119
|
+
manifestPath,
|
|
120
|
+
manifestSha256,
|
|
121
|
+
batchAttemptFile,
|
|
122
|
+
batchAttempt: existingBatchAttempt,
|
|
123
|
+
requests,
|
|
124
|
+
dependencies,
|
|
125
|
+
});
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const prepared = await Promise.all(requests.map((request) => (prepareImageGenerationRequest(request))));
|
|
50
129
|
const preflight = await (dependencies.preflight ?? preflightImageProvider)({
|
|
51
130
|
provider: manifest.provider,
|
|
52
131
|
projectRoot: prepared[0].projectRoot,
|
|
53
132
|
});
|
|
54
|
-
const manifestSha256 = imageGenerationSha256(source);
|
|
55
133
|
const attempt = {
|
|
56
134
|
version: 2,
|
|
57
135
|
status: 'prepared',
|
|
@@ -67,6 +145,28 @@ export const runImageBatchCommand = async (flags, dependencies = {}) => {
|
|
|
67
145
|
preparedAt: new Date().toISOString(),
|
|
68
146
|
};
|
|
69
147
|
await writeBatchAttempt(batchAttemptFile, attempt, true);
|
|
148
|
+
const candidates = identities(prepared);
|
|
149
|
+
const terminate = async (args) => {
|
|
150
|
+
if (args.materialize)
|
|
151
|
+
await materializeImageBatch(candidates);
|
|
152
|
+
const { completionPath } = await publishImageBatchCompletion({
|
|
153
|
+
manifestPath,
|
|
154
|
+
manifestSha256,
|
|
155
|
+
batchAttemptFile,
|
|
156
|
+
provider: attempt.provider,
|
|
157
|
+
model: attempt.model,
|
|
158
|
+
resumed: false,
|
|
159
|
+
status: args.status,
|
|
160
|
+
candidates,
|
|
161
|
+
});
|
|
162
|
+
attempt.status = args.status;
|
|
163
|
+
attempt.completedAt = new Date().toISOString();
|
|
164
|
+
attempt.completionPath = completionPath;
|
|
165
|
+
if (args.errors)
|
|
166
|
+
attempt.errors = args.errors;
|
|
167
|
+
await writeBatchAttempt(batchAttemptFile, attempt);
|
|
168
|
+
return completionPath;
|
|
169
|
+
};
|
|
70
170
|
const reservations = await Promise.allSettled(prepared.map((request) => (reserveImageGeneration({
|
|
71
171
|
request,
|
|
72
172
|
preflight,
|
|
@@ -81,11 +181,12 @@ export const runImageBatchCommand = async (flags, dependencies = {}) => {
|
|
|
81
181
|
if (reservationErrors.length > 0) {
|
|
82
182
|
const message = 'Batch reservation failed before any provider request was started';
|
|
83
183
|
await failReserved(reserved, message);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
184
|
+
const completionPath = await terminate({
|
|
185
|
+
status: 'failed',
|
|
186
|
+
errors: reservationErrors,
|
|
187
|
+
materialize: false,
|
|
188
|
+
});
|
|
189
|
+
throw new AggregateError(reservationErrors, `${message}. Evidence: ${batchAttemptFile}. Completion sentinel: ${completionPath}`);
|
|
89
190
|
}
|
|
90
191
|
attempt.status = 'dispatched';
|
|
91
192
|
attempt.dispatchedAt = new Date().toISOString();
|
|
@@ -95,32 +196,43 @@ export const runImageBatchCommand = async (flags, dependencies = {}) => {
|
|
|
95
196
|
if (markErrors.length > 0) {
|
|
96
197
|
const message = 'Batch evidence preparation failed before any provider request was started';
|
|
97
198
|
await failReserved(reserved, message);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
199
|
+
const completionPath = await terminate({
|
|
200
|
+
status: 'failed',
|
|
201
|
+
errors: markErrors,
|
|
202
|
+
materialize: false,
|
|
203
|
+
});
|
|
204
|
+
throw new AggregateError(markErrors, `${message}. Evidence: ${batchAttemptFile}. Completion sentinel: ${completionPath}`);
|
|
205
|
+
}
|
|
206
|
+
const quiet = booleanFlag(flags, 'quiet');
|
|
207
|
+
if (!quiet) {
|
|
208
|
+
process.stderr.write(`12ui image generate-batch — ${reserved.length} candidate(s) on ${attempt.provider},`
|
|
209
|
+
+ ` started concurrently and blocking until every one lands.\n`
|
|
210
|
+
+ `${nextActionLine({
|
|
211
|
+
what: 'A batch of four candidates',
|
|
212
|
+
typicalSeconds: OPERATION_DURATION_HINTS.imageBatch,
|
|
213
|
+
statusCommand: `12ui image batch-status --manifest ${manifestPath}`,
|
|
214
|
+
waitHint: 'or leave this command running, which is what --wait already does by default',
|
|
215
|
+
})}\n`);
|
|
103
216
|
}
|
|
104
|
-
const
|
|
217
|
+
const heartbeat = startImageBatchHeartbeat({ manifestPath, quiet });
|
|
218
|
+
const settled = await Promise.allSettled(reserved.map((item) => (dispatchImageGeneration(item, { generate: dependencies.generate })))).finally(() => { heartbeat.stop(); });
|
|
105
219
|
const results = settled.flatMap((result) => (result.status === 'fulfilled' ? [result.value] : []));
|
|
106
220
|
const errors = settled.flatMap((result) => (result.status === 'rejected' ? [errorMessage(result.reason)] : []));
|
|
107
|
-
attempt.completedAt = new Date().toISOString();
|
|
108
221
|
attempt.results = results;
|
|
109
222
|
attempt.accounting = summarizeImageGenerationUsage(reserved.map((item) => item.attempt.usage), preflight.provider);
|
|
110
223
|
if (errors.length > 0) {
|
|
111
|
-
|
|
112
|
-
attempt.errors = errors;
|
|
113
|
-
await writeBatchAttempt(batchAttemptFile, attempt);
|
|
224
|
+
const completionPath = await terminate({ status: 'failed', errors, materialize: true });
|
|
114
225
|
throw new AggregateError(errors, `Image batch finished with ${errors.length} failed candidate(s); no retries or provider`
|
|
115
|
-
+ ` fallback were attempted. Evidence: ${batchAttemptFile}
|
|
226
|
+
+ ` fallback were attempted. Evidence: ${batchAttemptFile}.`
|
|
227
|
+
+ ` Completion sentinel: ${completionPath}`);
|
|
116
228
|
}
|
|
117
|
-
|
|
118
|
-
await writeBatchAttempt(batchAttemptFile, attempt);
|
|
229
|
+
const completionPath = await terminate({ status: 'succeeded', materialize: true });
|
|
119
230
|
console.log(JSON.stringify({
|
|
120
231
|
provider: attempt.provider,
|
|
121
232
|
model: attempt.model,
|
|
122
233
|
manifestPath,
|
|
123
234
|
batchAttemptFile,
|
|
235
|
+
completionPath,
|
|
124
236
|
accounting: attempt.accounting,
|
|
125
237
|
candidates: results,
|
|
126
238
|
}, null, 2));
|