@12ui/design 0.2.69 → 0.2.71
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/SKILL.md +1 -1
- package/dist/cli-conversion-engine.d.ts.map +1 -1
- package/dist/cli-conversion-engine.js +12 -2
- package/dist/cli-conversion-engine.js.map +1 -1
- package/dist/cli-conversion-recovery-advice.d.ts +35 -0
- package/dist/cli-conversion-recovery-advice.d.ts.map +1 -0
- package/dist/cli-conversion-recovery-advice.js +72 -0
- package/dist/cli-conversion-recovery-advice.js.map +1 -0
- package/dist/cli-convert-command.d.ts.map +1 -1
- package/dist/cli-convert-command.js +153 -35
- package/dist/cli-convert-command.js.map +1 -1
- package/dist/cli-help/conversion.d.ts +1 -1
- package/dist/cli-help/conversion.d.ts.map +1 -1
- package/dist/cli-help/conversion.js +1 -0
- package/dist/cli-help/conversion.js.map +1 -1
- package/dist/cli-help/index.d.ts +1 -1
- package/dist/cli-usage.d.ts.map +1 -1
- package/dist/cli-usage.js +5 -3
- package/dist/cli-usage.js.map +1 -1
- package/dist/conversion-client.d.ts +11 -0
- package/dist/conversion-client.d.ts.map +1 -1
- package/dist/conversion-client.js +11 -1
- package/dist/conversion-client.js.map +1 -1
- package/dist/legacy-skill-catalog.d.ts.map +1 -1
- package/dist/legacy-skill-catalog.js +8 -0
- package/dist/legacy-skill-catalog.js.map +1 -1
- package/open-design.json +2 -2
- package/package.json +1 -1
- package/runtime/codex-conversion/README.md +3 -1
- package/runtime/codex-conversion/bin/export.mjs +2 -1
- package/runtime/codex-conversion/npm-shrinkwrap.json +10 -9
- package/runtime/codex-conversion/package.json +1 -1
- package/runtime/codex-conversion/src/exports/browser-install.mjs +30 -0
- package/runtime/codex-conversion/src/exports/browser.mjs +3 -1
- package/runtime/codex-conversion/templates/initial.txt +1 -1
- package/skills/12ui-design/SKILL.md +2 -0
- package/skills/12ui-design/outputs.md +2 -0
package/SKILL.md
CHANGED
|
@@ -28,7 +28,7 @@ dispatch paid work when it is absent, rejected, or times out.
|
|
|
28
28
|
Use `12ui` when it is available on `PATH`. Otherwise invoke the pinned CLI that
|
|
29
29
|
the plugin's `open-design.json` MCP entry uses:
|
|
30
30
|
|
|
31
|
-
npx -y @12ui/design@0.2.
|
|
31
|
+
npx -y @12ui/design@0.2.71 <command> ...
|
|
32
32
|
|
|
33
33
|
Run `12ui auth status --json` (or its pinned `npx` equivalent) before the paid
|
|
34
34
|
preflight. A desktop user can authenticate with `12ui auth login`; a headless
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-conversion-engine.d.ts","sourceRoot":"","sources":["../src/cli-conversion-engine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI/D,eAAO,MAAM,sBAAsB,aAAyI,CAAC;AAC7K,eAAO,MAAM,wBAAwB,GAAI,QAAQ,MAAM,EAAE,OAAO,QAAQ,KAAG,MAAoI,CAAC;AAChN,gGAAgG;AAChG,wBAAsB,sBAAsB,CAAC,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAC,EAAE;IAAC,MAAM,EAAC,MAAM,CAAC;IAAA,KAAK,EAAC,QAAQ,CAAC;IAAA,MAAM,CAAC,EAAC,MAAM,CAAA;CAAC,
|
|
1
|
+
{"version":3,"file":"cli-conversion-engine.d.ts","sourceRoot":"","sources":["../src/cli-conversion-engine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI/D,eAAO,MAAM,sBAAsB,aAAyI,CAAC;AAC7K,eAAO,MAAM,wBAAwB,GAAI,QAAQ,MAAM,EAAE,OAAO,QAAQ,KAAG,MAAoI,CAAC;AAChN,gGAAgG;AAChG,wBAAsB,sBAAsB,CAAC,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAC,EAAE;IAAC,MAAM,EAAC,MAAM,CAAC;IAAA,KAAK,EAAC,QAAQ,CAAC;IAAA,MAAM,CAAC,EAAC,MAAM,CAAA;CAAC,sDAmBhH;AACD,wBAAgB,wBAAwB,CAAC,KAAK,EAAC,QAAQ,GAAG,IAAI,CAG7D"}
|
|
@@ -11,8 +11,18 @@ export async function chooseConversionEngine({ source, flags, runDir }) {
|
|
|
11
11
|
const directory = runDir ?? localConversionDirectory(source, flags);
|
|
12
12
|
const saved = await readLocalRecord(directory);
|
|
13
13
|
const hosted = !saved && await stat(path.join(directory, 'journal.jsonl')).catch(() => null);
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const requested = stringFlag(flags, 'engine') ?? process.env.TWELVE_UI_ENGINE ?? 'auto';
|
|
15
|
+
const unsupported = Object.keys(flags).filter(key => !LOCAL_CONVERSION_FLAGS.has(key));
|
|
16
|
+
if (!saved && !hosted && requested === 'codex' && unsupported.length) {
|
|
17
|
+
throw new CliRefusal(`${unsupported.map(key => '--' + key).join(', ')} cannot be used with the Codex conversion engine. Remove these options for local HTML. Local work is identified by its saved run directory; recover it with 12ui resume <local-run-dir>.`, 'engine_unsupported');
|
|
18
|
+
}
|
|
19
|
+
const imagePath = /\.(png|jpe?g|webp)$/iu.test(source);
|
|
20
|
+
const image = imagePath && (await stat(source).catch(() => null))?.isFile();
|
|
21
|
+
const localOptions = stringFlag(flags, 'output') === 'html' && unsupported.length === 0;
|
|
22
|
+
if (!saved && !hosted && imagePath && !image && localOptions && ['auto', 'codex'].includes(requested)) {
|
|
23
|
+
throw new CliRefusal(`Source image is missing or is not a readable regular file: ${path.resolve(source)}`, 'conversion_source_invalid');
|
|
24
|
+
}
|
|
25
|
+
const supported = Boolean(image && localOptions);
|
|
16
26
|
const selection = await selectEngine(flags, supported, saved ? 'codex' : hosted ? 'api' : undefined);
|
|
17
27
|
if (selection.engine === 'api')
|
|
18
28
|
assertApiConversionFlags(flags);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-conversion-engine.js","sourceRoot":"","sources":["../src/cli-conversion-engine.ts"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AI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAC,2BAA2B,CAAC,CAAC;IACxI,CAAC;IACD,MAAM,SAAS,GAAC,OAAO,CAAC,KAAK,IAAI,YAAY,CAAC,CAAC;IAC/C,MAAM,SAAS,GAAC,MAAM,YAAY,CAAC,KAAK,EAAC,SAAS,EAAC,KAAK,CAAA,CAAC,CAAA,OAAO,CAAA,CAAC,CAAA,MAAM,CAAA,CAAC,CAAA,KAAK,CAAA,CAAC,CAAA,SAAS,CAAC,CAAC;IACzF,IAAG,SAAS,CAAC,MAAM,KAAG,KAAK;QAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAC7D,OAAO,SAAS,CAAC;AAClB,CAAC;AACD,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACtD,MAAM,WAAW,GAAC,CAAC,eAAe,EAAC,cAAc,EAAC,WAAW,CAAC,CAAC,MAAM,CAAC,GAAG,CAAA,EAAE,CAAA,KAAK,CAAC,GAAG,CAAC,KAAG,SAAS,CAAC,CAAC;IACnG,IAAG,WAAW,CAAC,MAAM;QAAC,MAAM,IAAI,UAAU,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAA,EAAE,CAAA,IAAI,GAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,yGAAyG,EAAC,iBAAiB,CAAC,CAAC;AACrN,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ConversionOperation, type TwelveUiConversionClient, type TerminalConversionStatus } from './conversion-client.js';
|
|
2
|
+
import type { TerminalArtifactReport } from './cli-progress.js';
|
|
3
|
+
import { type ObservedConversionStatus } from './conversion-status-contract.js';
|
|
4
|
+
export declare const terminalConversionOperation: (error: unknown) => (ConversionOperation & {
|
|
5
|
+
status: TerminalConversionStatus;
|
|
6
|
+
}) | null;
|
|
7
|
+
export declare const terminalConversionStatus: (error: unknown) => TerminalConversionStatus | null;
|
|
8
|
+
export declare const conversionRecoveryAdvice: (args: {
|
|
9
|
+
conversionId: string;
|
|
10
|
+
terminalStatus: TerminalConversionStatus | null;
|
|
11
|
+
resumeCommand: string;
|
|
12
|
+
}) => string;
|
|
13
|
+
export type LinkedExportRecoveryState = {
|
|
14
|
+
id: string;
|
|
15
|
+
status: ObservedConversionStatus;
|
|
16
|
+
readError?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const describeTerminalRecovery: (args: {
|
|
19
|
+
client: Pick<TwelveUiConversionClient, "getConversion">;
|
|
20
|
+
error: unknown;
|
|
21
|
+
conversionId: string;
|
|
22
|
+
fallbackExportId?: string;
|
|
23
|
+
resumeCommand: string;
|
|
24
|
+
parentArtifact?: Pick<TerminalArtifactReport, "name" | "path">;
|
|
25
|
+
linkedArtifact?: Pick<TerminalArtifactReport, "name" | "path">;
|
|
26
|
+
}) => Promise<{
|
|
27
|
+
terminalOperation: (ConversionOperation & {
|
|
28
|
+
status: TerminalConversionStatus;
|
|
29
|
+
}) | null;
|
|
30
|
+
terminalStatus: TerminalConversionStatus | null;
|
|
31
|
+
linkedExport?: LinkedExportRecoveryState;
|
|
32
|
+
artifacts?: TerminalArtifactReport[];
|
|
33
|
+
next: string;
|
|
34
|
+
}>;
|
|
35
|
+
//# sourceMappingURL=cli-conversion-recovery-advice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-conversion-recovery-advice.d.ts","sourceRoot":"","sources":["../src/cli-conversion-recovery-advice.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AAEzC,eAAO,MAAM,2BAA2B,GACtC,OAAO,OAAO,KACb,CAAC,mBAAmB,GAAG;IAAE,MAAM,EAAE,wBAAwB,CAAA;CAAE,CAAC,GAAG,IAEjE,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,OAAO,OAAO,KAAG,wBAAwB,GAAG,IAEpF,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,MAAM;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAChD,aAAa,EAAE,MAAM,CAAC;CACvB,KAAG,MASH,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,wBAAwB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAU,MAAM;IACnD,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,eAAe,CAAC,CAAC;IACxD,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC/D,cAAc,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CAChE,KAAG,OAAO,CAAC;IACV,iBAAiB,EAAE,CAAC,mBAAmB,GAAG;QAAE,MAAM,EAAE,wBAAwB,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;IACvF,cAAc,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAChD,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC,SAAS,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;CACd,CAwDA,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ConversionTerminalError, } from './conversion-client.js';
|
|
2
|
+
import { readConversionStatusObservation, } from './conversion-status-contract.js';
|
|
3
|
+
export const terminalConversionOperation = (error) => (error instanceof ConversionTerminalError ? error.operation : null);
|
|
4
|
+
export const terminalConversionStatus = (error) => (terminalConversionOperation(error)?.status ?? null);
|
|
5
|
+
export const conversionRecoveryAdvice = (args) => {
|
|
6
|
+
if (args.terminalStatus === 'failed') {
|
|
7
|
+
return `contact 12ui support with conversion ID ${args.conversionId};`
|
|
8
|
+
+ ' resume only collects a purchase and cannot restart a terminal failure';
|
|
9
|
+
}
|
|
10
|
+
if (args.terminalStatus === 'expired') {
|
|
11
|
+
return `conversion ${args.conversionId} has expired; start a new conversion if you still need the result`;
|
|
12
|
+
}
|
|
13
|
+
return `${args.resumeCommand}; collection is free until the purchase expires`;
|
|
14
|
+
};
|
|
15
|
+
export const describeTerminalRecovery = async (args) => {
|
|
16
|
+
const terminalOperation = terminalConversionOperation(args.error);
|
|
17
|
+
const terminalStatus = terminalOperation?.status ?? null;
|
|
18
|
+
let linkedExport;
|
|
19
|
+
if (terminalOperation && terminalOperation.id === args.conversionId) {
|
|
20
|
+
const exportId = terminalOperation.export?.conversion_id ?? args.fallbackExportId;
|
|
21
|
+
if (exportId) {
|
|
22
|
+
const observation = await readConversionStatusObservation(args.client, exportId);
|
|
23
|
+
linkedExport = {
|
|
24
|
+
id: exportId,
|
|
25
|
+
status: observation.status,
|
|
26
|
+
...(observation.readError ? { readError: observation.readError.message } : {}),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
let next = conversionRecoveryAdvice({
|
|
31
|
+
conversionId: terminalOperation?.id ?? args.conversionId,
|
|
32
|
+
terminalStatus,
|
|
33
|
+
resumeCommand: args.resumeCommand,
|
|
34
|
+
});
|
|
35
|
+
if (linkedExport) {
|
|
36
|
+
if (linkedExport.status === 'succeeded' || linkedExport.status === 'queued' || linkedExport.status === 'running') {
|
|
37
|
+
next += `; linked responsive export ${linkedExport.id} is ${linkedExport.status}`
|
|
38
|
+
+ `; collect it with 12ui resume ${linkedExport.id} --output html --out ${args.linkedArtifact?.path ?? '<file>'}`;
|
|
39
|
+
}
|
|
40
|
+
else if (linkedExport.status === 'unknown') {
|
|
41
|
+
next += `; linked responsive export ${linkedExport.id} could not be read, so its state is unknown`;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
next += `; linked responsive export ${linkedExport.id} is ${linkedExport.status}`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const artifacts = terminalOperation && terminalOperation.id === args.conversionId && args.parentArtifact
|
|
48
|
+
? [
|
|
49
|
+
{ ...args.parentArtifact, state: terminalOperation.status },
|
|
50
|
+
...(args.linkedArtifact
|
|
51
|
+
? [{
|
|
52
|
+
...args.linkedArtifact,
|
|
53
|
+
name: args.linkedArtifact.name ?? 'responsive html',
|
|
54
|
+
state: !linkedExport || linkedExport.status === 'unknown'
|
|
55
|
+
? 'unknown — linked export was not read'
|
|
56
|
+
: ['succeeded', 'queued', 'running'].includes(linkedExport.status)
|
|
57
|
+
? `${linkedExport.status} — not collected`
|
|
58
|
+
: linkedExport.status,
|
|
59
|
+
...(linkedExport?.readError ? { note: linkedExport.readError } : {}),
|
|
60
|
+
}]
|
|
61
|
+
: []),
|
|
62
|
+
]
|
|
63
|
+
: undefined;
|
|
64
|
+
return {
|
|
65
|
+
terminalOperation,
|
|
66
|
+
terminalStatus,
|
|
67
|
+
...(linkedExport ? { linkedExport } : {}),
|
|
68
|
+
...(artifacts ? { artifacts } : {}),
|
|
69
|
+
next,
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=cli-conversion-recovery-advice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-conversion-recovery-advice.js","sourceRoot":"","sources":["../src/cli-conversion-recovery-advice.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,GAIxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,+BAA+B,GAEhC,MAAM,iCAAiC,CAAC;AAEzC,MAAM,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wBACD,GAAG,IAAI,CAAC,cAAc;wBACtB,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,IAAI,iBAAiB;wBACnD,KAAK,EAAE,CAAC,YAAY,IAAI,YAAY,CAAC,MAAM,KAAK,SAAS;4BACvD,CAAC,CAAC,sCAAsC;4BACxC,CAAC,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC;gCAChE,CAAC,CAAC,GAAG,YAAY,CAAC,MAAM,kBAAkB;gCAC1C,CAAC,CAAC,YAAY,CAAC,MAAM;wBACzB,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBACrE,CAAC;gBACF,CAAC,CAAC,EAAE,CAAC;SACR;QACD,CAAC,CAAC,SAAS,CAAC;IACd,OAAO;QACL,iBAAiB;QACjB,cAAc;QACd,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,IAAI;KACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-convert-command.d.ts","sourceRoot":"","sources":["../src/cli-convert-command.ts"],"names":[],"mappings":"AAKA,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-convert-command.d.ts","sourceRoot":"","sources":["../src/cli-convert-command.ts"],"names":[],"mappings":"AAKA,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAmC5E,OAAO,EAIL,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AAgBzC,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;GAIG;AAEH,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,SAOxD,CAAC;AAqHF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,KAAG,MAIpD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,MAAM;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE;QACb,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,wBAAwB,CAAC;QACjC,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,KAAG,MAYH,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM;IAC3C,MAAM,EAAE,wBAAwB,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;CACnB,KAAG,MAMH,CAAC;AAyLF,eAAO,MAAM,oBAAoB,GAC/B,SAAS,SAAS,MAAM,EAAE,EAC1B,OAAO,QAAQ,EACf,SAAS,eAAe,EACxB,eAAc;IACZ,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,2FAA2F;IAC3F,cAAc,CAAC,EAAE,MAAM,CAAC;CACpB,KACL,OAAO,CAAC,IAAI,CA2xBd,CAAC"}
|
|
@@ -8,7 +8,8 @@ import { runConversionDerivation } from './cli-conversion-derivation.js';
|
|
|
8
8
|
import { CONVERSION_DURATION_HINTS, createLongRunningProgress, } from './cli-progress.js';
|
|
9
9
|
import { refuseUsage, usage, usageRefusal } from './cli-usage.js';
|
|
10
10
|
import { readConversionConfig } from './config.js';
|
|
11
|
-
import { TwelveUiConversionClient, } from './conversion-client.js';
|
|
11
|
+
import { TwelveUiConversionClient, ConversionTerminalError, } from './conversion-client.js';
|
|
12
|
+
import { conversionRecoveryAdvice, describeTerminalRecovery, } from './cli-conversion-recovery-advice.js';
|
|
12
13
|
import { isConversionModel } from './conversion-models.js';
|
|
13
14
|
import { isCliConversionOutput, } from './conversion-outputs.js';
|
|
14
15
|
import { recordConvertedImageReceipt } from './conversion-receipt.js';
|
|
@@ -201,10 +202,13 @@ const outputPathForRecovery = async (artifact, overrideDirectory) => prepareOutp
|
|
|
201
202
|
: artifact.outFile);
|
|
202
203
|
const completedOperation = async (args) => {
|
|
203
204
|
const current = await args.client.getConversion(args.id);
|
|
204
|
-
if (current.status === 'succeeded') {
|
|
205
|
+
if (current.status === 'succeeded' || current.responsive_alternative) {
|
|
205
206
|
args.onProgress?.(current);
|
|
206
207
|
return current;
|
|
207
208
|
}
|
|
209
|
+
if (current.status === 'failed' || current.status === 'expired') {
|
|
210
|
+
throw new ConversionTerminalError({ ...current, status: current.status });
|
|
211
|
+
}
|
|
208
212
|
return await args.client.waitForConversion(current.id, {
|
|
209
213
|
expiresAt: current.expires_at,
|
|
210
214
|
...(args.timeoutMs === undefined ? {} : { timeoutMs: args.timeoutMs }),
|
|
@@ -431,9 +435,19 @@ export const runConversionCommand = async (command, flags, journal, dependencies
|
|
|
431
435
|
});
|
|
432
436
|
}
|
|
433
437
|
catch (error) {
|
|
434
|
-
|
|
438
|
+
const recoveryReport = await describeTerminalRecovery({
|
|
439
|
+
client, error, conversionId,
|
|
440
|
+
resumeCommand: `re-run 12ui resume ${conversionId}`,
|
|
441
|
+
parentArtifact: { name: recovery.conversion.output, path: shownPath(recovery.conversion.outFile) },
|
|
442
|
+
...(recovery.linkedExport ? {
|
|
443
|
+
fallbackExportId: recovery.linkedExport.conversionId,
|
|
444
|
+
linkedArtifact: { name: 'responsive html', path: shownPath(recovery.linkedExport.outFile) },
|
|
445
|
+
} : {}),
|
|
446
|
+
});
|
|
447
|
+
progress.finish(recoveryReport.terminalStatus ? 'failed' : 'stopped', {
|
|
435
448
|
detail: error instanceof Error ? error.message : String(error),
|
|
436
|
-
|
|
449
|
+
artifacts: recoveryReport.artifacts,
|
|
450
|
+
next: recoveryReport.next,
|
|
437
451
|
});
|
|
438
452
|
throw error;
|
|
439
453
|
}
|
|
@@ -475,6 +489,11 @@ export const runConversionCommand = async (command, flags, journal, dependencies
|
|
|
475
489
|
const current = await client.getConversion(conversionId).catch((error) => {
|
|
476
490
|
progress.finish('stopped', {
|
|
477
491
|
detail: error instanceof Error ? error.message : String(error),
|
|
492
|
+
next: conversionRecoveryAdvice({
|
|
493
|
+
conversionId,
|
|
494
|
+
terminalStatus: null,
|
|
495
|
+
resumeCommand: `re-run 12ui resume ${conversionId} --output ${requestedOutput} --out ${resolvedOutFile}`,
|
|
496
|
+
}),
|
|
478
497
|
});
|
|
479
498
|
throw error;
|
|
480
499
|
});
|
|
@@ -492,10 +511,13 @@ export const runConversionCommand = async (command, flags, journal, dependencies
|
|
|
492
511
|
}
|
|
493
512
|
let completed;
|
|
494
513
|
try {
|
|
495
|
-
if (current.status === 'succeeded') {
|
|
514
|
+
if (current.status === 'succeeded' || current.responsive_alternative) {
|
|
496
515
|
reportConversion(progress, current, `collecting ${requestedOutput}`);
|
|
497
516
|
completed = current;
|
|
498
517
|
}
|
|
518
|
+
else if (current.status === 'failed' || current.status === 'expired') {
|
|
519
|
+
throw new ConversionTerminalError({ ...current, status: current.status });
|
|
520
|
+
}
|
|
499
521
|
else {
|
|
500
522
|
completed = await client.waitForConversion(current.id, {
|
|
501
523
|
expiresAt: current.expires_at,
|
|
@@ -504,20 +526,47 @@ export const runConversionCommand = async (command, flags, journal, dependencies
|
|
|
504
526
|
});
|
|
505
527
|
}
|
|
506
528
|
}
|
|
529
|
+
catch (error) {
|
|
530
|
+
const savedLinkedExport = current.export
|
|
531
|
+
? (await readConversionRecovery(conversionId))?.linkedExport
|
|
532
|
+
: undefined;
|
|
533
|
+
const recoveryReport = await describeTerminalRecovery({
|
|
534
|
+
client, error, conversionId,
|
|
535
|
+
resumeCommand: `re-run 12ui resume ${conversionId} --output ${requestedOutput} --out ${resolvedOutFile}`,
|
|
536
|
+
parentArtifact: { name: current.output, path: resolvedOutFile },
|
|
537
|
+
...(current.export ? {
|
|
538
|
+
fallbackExportId: current.export.conversion_id,
|
|
539
|
+
linkedArtifact: { name: 'responsive html', ...(savedLinkedExport ? { path: savedLinkedExport.outFile } : {}) },
|
|
540
|
+
} : {}),
|
|
541
|
+
});
|
|
542
|
+
progress.finish(recoveryReport.terminalStatus ? 'failed' : 'stopped', {
|
|
543
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
544
|
+
artifacts: recoveryReport.artifacts,
|
|
545
|
+
next: recoveryReport.next,
|
|
546
|
+
});
|
|
547
|
+
throw error;
|
|
548
|
+
}
|
|
549
|
+
let downloaded;
|
|
550
|
+
try {
|
|
551
|
+
downloaded = await downloadCompletedConversion({
|
|
552
|
+
client,
|
|
553
|
+
operation: completed,
|
|
554
|
+
output: requestedOutput,
|
|
555
|
+
outFile: resolvedOutFile,
|
|
556
|
+
});
|
|
557
|
+
}
|
|
507
558
|
catch (error) {
|
|
508
559
|
progress.finish('stopped', {
|
|
509
560
|
detail: error instanceof Error ? error.message : String(error),
|
|
510
|
-
|
|
511
|
-
|
|
561
|
+
artifacts: [{ name: requestedOutput, state: 'succeeded — not collected', path: resolvedOutFile }],
|
|
562
|
+
next: conversionRecoveryAdvice({
|
|
563
|
+
conversionId,
|
|
564
|
+
terminalStatus: null,
|
|
565
|
+
resumeCommand: `re-run 12ui resume ${conversionId} --output ${requestedOutput} --out ${resolvedOutFile}`,
|
|
566
|
+
}),
|
|
512
567
|
});
|
|
513
568
|
throw error;
|
|
514
569
|
}
|
|
515
|
-
const downloaded = await downloadCompletedConversion({
|
|
516
|
-
client,
|
|
517
|
-
operation: completed,
|
|
518
|
-
output: requestedOutput,
|
|
519
|
-
outFile: resolvedOutFile,
|
|
520
|
-
});
|
|
521
570
|
journal.note({ runId: completed.id, artifacts: [resolvedOutFile] });
|
|
522
571
|
let linkedExport;
|
|
523
572
|
if (completed.output === 'layerdoc' && completed.export?.conversion_id) {
|
|
@@ -749,10 +798,14 @@ export const runConversionCommand = async (command, flags, journal, dependencies
|
|
|
749
798
|
: ''}`);
|
|
750
799
|
let operation;
|
|
751
800
|
try {
|
|
752
|
-
if (created.status === 'succeeded') {
|
|
801
|
+
if (created.status === 'succeeded' || created.responsive_alternative) {
|
|
753
802
|
reportConversion(progress, created);
|
|
754
803
|
operation = created;
|
|
755
804
|
}
|
|
805
|
+
else if (created.status === 'failed' || created.status === 'expired') {
|
|
806
|
+
reportConversion(progress, created);
|
|
807
|
+
throw new ConversionTerminalError({ ...created, status: created.status });
|
|
808
|
+
}
|
|
756
809
|
else {
|
|
757
810
|
operation = await client.waitForConversion(created.id, {
|
|
758
811
|
expiresAt: created.expires_at,
|
|
@@ -763,17 +816,23 @@ export const runConversionCommand = async (command, flags, journal, dependencies
|
|
|
763
816
|
}
|
|
764
817
|
catch (error) {
|
|
765
818
|
const detail = error instanceof Error ? error.message : String(error);
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
? {
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
819
|
+
const recoveryReport = await describeTerminalRecovery({
|
|
820
|
+
client, error, conversionId: created.id,
|
|
821
|
+
resumeCommand: exportOperationId
|
|
822
|
+
? `12ui resume ${created.id} recovers both halves without re-buying`
|
|
823
|
+
: `12ui resume ${created.id} recovers the purchase without re-buying`,
|
|
824
|
+
parentArtifact: { name: output, path: outFile },
|
|
825
|
+
...(exportOperationId && exportOutFile ? {
|
|
826
|
+
fallbackExportId: exportOperationId,
|
|
827
|
+
linkedArtifact: { name: 'responsive html', path: exportOutFile },
|
|
828
|
+
} : {}),
|
|
829
|
+
});
|
|
830
|
+
progress.finish(recoveryReport.terminalStatus ? 'failed' : 'stopped', {
|
|
831
|
+
detail: recoveryReport.terminalStatus
|
|
832
|
+
? `conversion ${created.id} is ${recoveryReport.terminalStatus}: ${detail}`
|
|
833
|
+
: `conversion ${created.id} did not settle: ${detail}`,
|
|
834
|
+
artifacts: recoveryReport.artifacts,
|
|
835
|
+
next: recoveryReport.next,
|
|
777
836
|
});
|
|
778
837
|
throw new Error(`Conversion ${created.id} failed: ${detail}`, { cause: error });
|
|
779
838
|
}
|
|
@@ -791,7 +850,22 @@ export const runConversionCommand = async (command, flags, journal, dependencies
|
|
|
791
850
|
...(quiet ? {} : { warn: (message) => process.stderr.write(`${message}\n`) }),
|
|
792
851
|
});
|
|
793
852
|
}
|
|
794
|
-
|
|
853
|
+
let result;
|
|
854
|
+
try {
|
|
855
|
+
result = await downloadCompletedConversion({ client, operation, output, outFile });
|
|
856
|
+
}
|
|
857
|
+
catch (error) {
|
|
858
|
+
progress.finish('stopped', {
|
|
859
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
860
|
+
artifacts: [{ name: output, state: 'succeeded — not collected', path: outFile }],
|
|
861
|
+
next: conversionRecoveryAdvice({
|
|
862
|
+
conversionId: created.id,
|
|
863
|
+
terminalStatus: null,
|
|
864
|
+
resumeCommand: `12ui resume ${created.id}`,
|
|
865
|
+
}),
|
|
866
|
+
});
|
|
867
|
+
throw error;
|
|
868
|
+
}
|
|
795
869
|
journal.note({ artifacts: [outFile] });
|
|
796
870
|
if (!exportOperationId || !exportOutFile) {
|
|
797
871
|
const disposition = responsiveAlternativeDisposition(result);
|
|
@@ -879,16 +953,35 @@ export const runConversionCommand = async (command, flags, journal, dependencies
|
|
|
879
953
|
: undefined;
|
|
880
954
|
const pending = isPendingConversionStatus(exportStatus);
|
|
881
955
|
const collect = `12ui resume ${exportOperationId} --output html --out <file>`;
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
956
|
+
const collectToOutput = `12ui resume ${exportOperationId} --output html --out ${exportOutFile}`;
|
|
957
|
+
const terminalExportStatus = !exportResult
|
|
958
|
+
&& (exportStatus === 'failed' || exportStatus === 'expired')
|
|
959
|
+
? exportStatus
|
|
960
|
+
: null;
|
|
961
|
+
const nextAction = exportResult
|
|
962
|
+
? layerDocStateAction({
|
|
885
963
|
outFile,
|
|
886
964
|
linkedExport: {
|
|
887
965
|
id: exportOperationId,
|
|
888
966
|
status: exportStatus,
|
|
889
|
-
|
|
967
|
+
outFile: exportOutFile,
|
|
890
968
|
},
|
|
891
|
-
})
|
|
969
|
+
})
|
|
970
|
+
: terminalExportStatus
|
|
971
|
+
? conversionRecoveryAdvice({
|
|
972
|
+
conversionId: exportOperationId,
|
|
973
|
+
terminalStatus: terminalExportStatus,
|
|
974
|
+
resumeCommand: collectToOutput,
|
|
975
|
+
})
|
|
976
|
+
: exportStatus === 'succeeded' || exportStatus === 'unknown'
|
|
977
|
+
? `Responsive export ${exportOperationId} is ${exportStatus}; collect the existing export with ${collectToOutput}`
|
|
978
|
+
: layerDocStateAction({
|
|
979
|
+
outFile,
|
|
980
|
+
linkedExport: { id: exportOperationId, status: exportStatus },
|
|
981
|
+
});
|
|
982
|
+
const report = {
|
|
983
|
+
...result,
|
|
984
|
+
nextAction,
|
|
892
985
|
export: exportResult
|
|
893
986
|
? { ...exportResult, status: exportStatus }
|
|
894
987
|
: {
|
|
@@ -955,7 +1048,32 @@ export const runConversionCommand = async (command, flags, journal, dependencies
|
|
|
955
1048
|
next: `the purchase stays collectable until ${created.expires_at}`,
|
|
956
1049
|
});
|
|
957
1050
|
}
|
|
1051
|
+
else if (exportStatus === 'succeeded' || exportStatus === 'unknown') {
|
|
1052
|
+
progress.finish('stopped', {
|
|
1053
|
+
detail: exportStatus === 'succeeded'
|
|
1054
|
+
? `the linked responsive export succeeded but collection did not complete: ${exportError}`
|
|
1055
|
+
: `the linked responsive export state could not be read: ${exportReadDetail ?? exportError}`,
|
|
1056
|
+
artifacts: [
|
|
1057
|
+
layerdocRow,
|
|
1058
|
+
{
|
|
1059
|
+
name: 'responsive html',
|
|
1060
|
+
state: exportStatus === 'succeeded' ? 'succeeded — not collected' : 'unknown — not collected',
|
|
1061
|
+
path: exportOutFile,
|
|
1062
|
+
...((exportObservation?.readError?.message || exportError)
|
|
1063
|
+
? { note: exportObservation?.readError?.message || exportError || undefined }
|
|
1064
|
+
: {}),
|
|
1065
|
+
},
|
|
1066
|
+
],
|
|
1067
|
+
spend: spendLine,
|
|
1068
|
+
next: `${collectToOutput}; collection is free until the purchase expires`,
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
958
1071
|
else {
|
|
1072
|
+
const next = conversionRecoveryAdvice({
|
|
1073
|
+
conversionId: exportOperationId,
|
|
1074
|
+
terminalStatus: terminalExportStatus,
|
|
1075
|
+
resumeCommand: collectToOutput,
|
|
1076
|
+
});
|
|
959
1077
|
progress.finish('failed', {
|
|
960
1078
|
detail: `the linked responsive export ${exportOperationId} ${exportStatus}`,
|
|
961
1079
|
artifacts: [
|
|
@@ -967,7 +1085,7 @@ export const runConversionCommand = async (command, flags, journal, dependencies
|
|
|
967
1085
|
},
|
|
968
1086
|
],
|
|
969
1087
|
spend: spendLine,
|
|
970
|
-
next
|
|
1088
|
+
next,
|
|
971
1089
|
});
|
|
972
1090
|
}
|
|
973
1091
|
writeResultWithSummary(report, writeResult);
|
|
@@ -980,10 +1098,10 @@ export const runConversionCommand = async (command, flags, journal, dependencies
|
|
|
980
1098
|
? `Conversion ${created.id} succeeded and was written to ${outFile}, but responsive export`
|
|
981
1099
|
+ ` ${exportOperationId} failed with ${responsiveAlternativeLabel(exportDisposition)};`
|
|
982
1100
|
+ ` coverage is recorded in ${exportResult.artifactManifest.manifestFile}.`
|
|
983
|
-
: exportStatus === 'unknown'
|
|
984
|
-
? `Conversion ${created.id} succeeded and was written to ${outFile}. Responsive HTML export ${exportOperationId}
|
|
1101
|
+
: exportStatus === 'succeeded' || exportStatus === 'unknown'
|
|
1102
|
+
? `Conversion ${created.id} succeeded and was written to ${outFile}. Responsive HTML export ${exportOperationId} is ${exportStatus} and was not collected. Use ${collectToOutput}; this collects the existing purchase.`
|
|
985
1103
|
: `Conversion ${created.id} succeeded and was written to ${outFile}, but its responsive HTML`
|
|
986
|
-
+ ` export ${exportOperationId}
|
|
1104
|
+
+ ` export ${exportOperationId} is ${exportStatus}: ${exportError}. ${nextAction}`);
|
|
987
1105
|
}
|
|
988
1106
|
};
|
|
989
1107
|
//# sourceMappingURL=cli-convert-command.js.map
|