@12ui/design 0.2.14 → 0.2.15
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/dist/bounded-concurrency.d.ts +13 -0
- package/dist/bounded-concurrency.d.ts.map +1 -0
- package/dist/bounded-concurrency.js +43 -0
- package/dist/bounded-concurrency.js.map +1 -0
- package/dist/branch-downloads.d.ts +10 -0
- package/dist/branch-downloads.d.ts.map +1 -1
- package/dist/branch-downloads.js +20 -0
- package/dist/branch-downloads.js.map +1 -1
- package/dist/branch-execution.d.ts +2 -0
- package/dist/branch-execution.d.ts.map +1 -1
- package/dist/branch-execution.js +157 -38
- package/dist/branch-execution.js.map +1 -1
- package/dist/branch-materialize.d.ts +23 -12
- package/dist/branch-materialize.d.ts.map +1 -1
- package/dist/branch-materialize.js +55 -38
- package/dist/branch-materialize.js.map +1 -1
- package/dist/branch-page-conversion.d.ts +93 -5
- package/dist/branch-page-conversion.d.ts.map +1 -1
- package/dist/branch-page-conversion.js +356 -180
- package/dist/branch-page-conversion.js.map +1 -1
- package/dist/branch-progress.d.ts +24 -0
- package/dist/branch-progress.d.ts.map +1 -1
- package/dist/branch-progress.js +35 -6
- package/dist/branch-progress.js.map +1 -1
- package/dist/branch-run-record.d.ts +11 -0
- package/dist/branch-run-record.d.ts.map +1 -1
- package/dist/branch-run-record.js.map +1 -1
- package/dist/branch-status.d.ts.map +1 -1
- package/dist/branch-status.js +3 -0
- package/dist/branch-status.js.map +1 -1
- package/dist/cli-arguments.d.ts.map +1 -1
- package/dist/cli-arguments.js +1 -0
- package/dist/cli-arguments.js.map +1 -1
- package/dist/cli-branch-command.d.ts +10 -1
- package/dist/cli-branch-command.d.ts.map +1 -1
- package/dist/cli-branch-command.js +60 -11
- package/dist/cli-branch-command.js.map +1 -1
- package/dist/cli-capabilities.d.ts +25 -2
- package/dist/cli-capabilities.d.ts.map +1 -1
- package/dist/cli-capabilities.js +24 -1
- package/dist/cli-capabilities.js.map +1 -1
- package/dist/cli-package-command.d.ts +11 -0
- package/dist/cli-package-command.d.ts.map +1 -1
- package/dist/cli-package-command.js +24 -8
- package/dist/cli-package-command.js.map +1 -1
- package/dist/cli-progress.d.ts +81 -5
- package/dist/cli-progress.d.ts.map +1 -1
- package/dist/cli-progress.js +108 -5
- package/dist/cli-progress.js.map +1 -1
- package/dist/cli.js +17 -7
- package/dist/cli.js.map +1 -1
- package/dist/conversion-receipt.d.ts +127 -0
- package/dist/conversion-receipt.d.ts.map +1 -0
- package/dist/conversion-receipt.js +184 -0
- package/dist/conversion-receipt.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy-skill-catalog.d.ts.map +1 -1
- package/dist/legacy-skill-catalog.js +25 -0
- package/dist/legacy-skill-catalog.js.map +1 -1
- package/dist/package-client.d.ts +28 -0
- package/dist/package-client.d.ts.map +1 -1
- package/dist/package-client.js +21 -1
- package/dist/package-client.js.map +1 -1
- package/dist/package-source-refusal.d.ts +17 -0
- package/dist/package-source-refusal.d.ts.map +1 -0
- package/dist/package-source-refusal.js +61 -0
- package/dist/package-source-refusal.js.map +1 -0
- package/dist/package-submission.d.ts +31 -0
- package/dist/package-submission.d.ts.map +1 -1
- package/dist/package-submission.js +30 -7
- package/dist/package-submission.js.map +1 -1
- package/package.json +1 -1
- package/skills/design/SKILL.md +4 -1
- package/skills/design-branch/SKILL.md +3 -2
|
@@ -24,8 +24,8 @@ export declare const CLI_CAPABILITIES: {
|
|
|
24
24
|
readonly imageBatch: 90;
|
|
25
25
|
readonly branchClaim: 15;
|
|
26
26
|
readonly branchScreen: 90;
|
|
27
|
-
readonly branchPageRun:
|
|
28
|
-
readonly branchSiteRun:
|
|
27
|
+
readonly branchPageRun: 362;
|
|
28
|
+
readonly branchSiteRun: 492;
|
|
29
29
|
readonly conversionPackage: 360;
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
@@ -37,6 +37,19 @@ export declare const CLI_CAPABILITIES: {
|
|
|
37
37
|
readonly branch: "12ui branch status --out-dir <directory>";
|
|
38
38
|
readonly imageBatch: "12ui image batch-status --manifest <batch.json>";
|
|
39
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* The only file a conversion leaves outside its requested output, and the one
|
|
42
|
+
* thing that keeps the common flow — convert the approved design, then branch
|
|
43
|
+
* from it — from buying that design's LayerDoc twice.
|
|
44
|
+
*/
|
|
45
|
+
readonly conversionReceipt: {
|
|
46
|
+
readonly file: "<converted-image>.conversion.json";
|
|
47
|
+
readonly writtenBy: readonly ["12ui convert (image input, --output layerdoc)", "12ui branch execute --convert"];
|
|
48
|
+
readonly readBy: "12ui branch execute --convert";
|
|
49
|
+
/** Reuse requires every one of these to match the bytes about to be sent. */
|
|
50
|
+
readonly proves: readonly ["sha256", "conversionId", "model", "expiresAt"];
|
|
51
|
+
readonly bestEffort: true;
|
|
52
|
+
};
|
|
40
53
|
/** Ordered viewports of one continuous page: ONE conversion, not N. */
|
|
41
54
|
readonly conversionPackage: {
|
|
42
55
|
readonly command: "12ui convert package --manifest <package.json> --out-dir <directory>";
|
|
@@ -49,6 +62,16 @@ export declare const CLI_CAPABILITIES: {
|
|
|
49
62
|
readonly scopes: readonly ["page", "site"];
|
|
50
63
|
readonly completionSentinel: "branch.complete.json";
|
|
51
64
|
readonly endpoint: "/api/v1/create";
|
|
65
|
+
/**
|
|
66
|
+
* A page's package depends on its own screens and nothing else, so pages
|
|
67
|
+
* convert as they become whole and several at a time.
|
|
68
|
+
*/
|
|
69
|
+
readonly pageConcurrency: {
|
|
70
|
+
readonly flag: "--page-concurrency";
|
|
71
|
+
readonly default: 3;
|
|
72
|
+
readonly maximum: 10;
|
|
73
|
+
};
|
|
74
|
+
readonly expectedSecondsPerPage: 130;
|
|
52
75
|
};
|
|
53
76
|
readonly projectProfileSchema: {
|
|
54
77
|
readonly required: readonly ["version", "framework", "styling", "language", "packaging"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-capabilities.d.ts","sourceRoot":"","sources":["../src/cli-capabilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-capabilities.d.ts","sourceRoot":"","sources":["../src/cli-capabilities.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsC3B;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;QAKD,6EAA6E;;;;IAI/E,uEAAuE;;;;;;;;;;;;QAYrE;;;WAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAaG,CAAC"}
|
package/dist/cli-capabilities.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CONVERSION_DURATION_HINTS, OPERATION_DURATION_HINTS } from './cli-progress.js';
|
|
1
|
+
import { BRANCH_PAGE_CONCURRENCY_DEFAULT, CONVERSION_DURATION_HINTS, OPERATION_DURATION_HINTS, } from './cli-progress.js';
|
|
2
2
|
import { CONVERSION_MODELS } from './conversion-models.js';
|
|
3
3
|
import { CONVERSION_OUTPUT_MEDIA_TYPES, CONVERSION_OUTPUTS, } from './conversion-outputs.js';
|
|
4
4
|
import { MAX_IMAGE_OUTPUT_WIDTH } from './image-output-width.js';
|
|
@@ -50,6 +50,19 @@ export const CLI_CAPABILITIES = {
|
|
|
50
50
|
branch: '12ui branch status --out-dir <directory>',
|
|
51
51
|
imageBatch: '12ui image batch-status --manifest <batch.json>',
|
|
52
52
|
},
|
|
53
|
+
/**
|
|
54
|
+
* The only file a conversion leaves outside its requested output, and the one
|
|
55
|
+
* thing that keeps the common flow — convert the approved design, then branch
|
|
56
|
+
* from it — from buying that design's LayerDoc twice.
|
|
57
|
+
*/
|
|
58
|
+
conversionReceipt: {
|
|
59
|
+
file: '<converted-image>.conversion.json',
|
|
60
|
+
writtenBy: ['12ui convert (image input, --output layerdoc)', '12ui branch execute --convert'],
|
|
61
|
+
readBy: '12ui branch execute --convert',
|
|
62
|
+
/** Reuse requires every one of these to match the bytes about to be sent. */
|
|
63
|
+
proves: ['sha256', 'conversionId', 'model', 'expiresAt'],
|
|
64
|
+
bestEffort: true,
|
|
65
|
+
},
|
|
53
66
|
/** Ordered viewports of one continuous page: ONE conversion, not N. */
|
|
54
67
|
conversionPackage: {
|
|
55
68
|
command: '12ui convert package --manifest <package.json> --out-dir <directory>',
|
|
@@ -62,6 +75,16 @@ export const CLI_CAPABILITIES = {
|
|
|
62
75
|
scopes: ['page', 'site'],
|
|
63
76
|
completionSentinel: 'branch.complete.json',
|
|
64
77
|
endpoint: '/api/v1/create',
|
|
78
|
+
/**
|
|
79
|
+
* A page's package depends on its own screens and nothing else, so pages
|
|
80
|
+
* convert as they become whole and several at a time.
|
|
81
|
+
*/
|
|
82
|
+
pageConcurrency: {
|
|
83
|
+
flag: '--page-concurrency',
|
|
84
|
+
default: BRANCH_PAGE_CONCURRENCY_DEFAULT,
|
|
85
|
+
maximum: 10,
|
|
86
|
+
},
|
|
87
|
+
expectedSecondsPerPage: OPERATION_DURATION_HINTS.branchPackage,
|
|
65
88
|
},
|
|
66
89
|
projectProfileSchema: PROJECT_PROFILE_SCHEMA,
|
|
67
90
|
projectProfiles: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-capabilities.js","sourceRoot":"","sources":["../src/cli-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"cli-capabilities.js","sourceRoot":"","sources":["../src/cli-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,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AE,CAAC,+CAA+C,EAAE,+BAA+B,CAAC;QAC7F,MAAM,EAAE,+BAA+B;QACvC,6EAA6E;QAC7E,MAAM,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,CAAC;QACxD,UAAU,EAAE,IAAI;KACjB;IACD,uEAAuE;IACvE,iBAAiB,EAAE;QACjB,OAAO,EAAE,sEAAsE;QAC/E,QAAQ,EAAE,yBAAyB;QACnC,qBAAqB,EAAE,oBAAoB;QAC3C,eAAe,EAAE,wBAAwB,CAAC,OAAO;KAClD;IACD,MAAM,EAAE;QACN,OAAO,EAAE,qBAAqB;QAC9B,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,kBAAkB,EAAE,sBAAsB;QAC1C,QAAQ,EAAE,gBAAgB;QAC1B;;;WAGG;QACH,eAAe,EAAE;YACf,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,+BAA+B;YACxC,OAAO,EAAE,EAAE;SACZ;QACD,sBAAsB,EAAE,wBAAwB,CAAC,aAAa;KAC/D;IACD,oBAAoB,EAAE,sBAAsB;IAC5C,eAAe,EAAE;QACf,WAAW,EAAE,wBAAwB;QACrC,WAAW,EAAE,wBAAwB;KACtC;CACO,CAAC"}
|
|
@@ -11,6 +11,17 @@ import { type PackageSubmissionResult } from './package-submission.js';
|
|
|
11
11
|
export declare const PACKAGE_USAGE: string;
|
|
12
12
|
/** A multi-viewport page converts its viewports in parallel, then composes. */
|
|
13
13
|
export declare const PACKAGE_DURATION_SECONDS = 360;
|
|
14
|
+
/**
|
|
15
|
+
* `12ui convert package --template` prints the starting manifest and returns
|
|
16
|
+
* before any config read or network call, so it works with no credentials.
|
|
17
|
+
* Guidance goes to stderr and only the JSON reaches stdout, which is what makes
|
|
18
|
+
* `--template > package.json` write a file that parses.
|
|
19
|
+
*
|
|
20
|
+
* Returns false when the caller did not ask for the template, so the dispatcher
|
|
21
|
+
* falls through to the real submission. This lives beside the command rather
|
|
22
|
+
* than inline in the dispatcher so the argv path is reachable from a test.
|
|
23
|
+
*/
|
|
24
|
+
export declare const runPackageTemplateCommand: (flags: CliFlags) => boolean;
|
|
14
25
|
export declare const runPackageCommand: (flags: CliFlags, dependencies?: {
|
|
15
26
|
readConfig?: typeof readConversionConfig;
|
|
16
27
|
createClient?: (config: ReturnType<typeof readConversionConfig>) => TwelveUiConversionPackageClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-package-command.d.ts","sourceRoot":"","sources":["../src/cli-package-command.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-package-command.d.ts","sourceRoot":"","sources":["../src/cli-package-command.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAMtE,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,yBAAyB,CAAC;AAOjC;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,QAEmC,CAAC;AAE9D,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,MAAM,CAAC;AA0B5C;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,QAAQ,KAAG,OAK3D,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,OAAO,QAAQ,EACf,eAAc;IACZ,UAAU,CAAC,EAAE,OAAO,oBAAoB,CAAC;IACzC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,KAAK,+BAA+B,CAAC;CAChG,KACL,OAAO,CAAC,uBAAuB,CA6EjC,CAAC"}
|
|
@@ -6,8 +6,9 @@ import { conversionPackageKey } from './branch-identity.js';
|
|
|
6
6
|
import { normalizeOptionalIdempotencyKey } from './idempotency-key.js';
|
|
7
7
|
import { TwelveUiConversionPackageClient } from './package-client.js';
|
|
8
8
|
import { readLocalPackageManifest } from './package-manifest-file.js';
|
|
9
|
+
import { PACKAGE_MANIFEST_TEMPLATE_NOTES, renderPackageManifestTemplate, } from './package-manifest-template.js';
|
|
9
10
|
import { PACKAGE_RESULT_FILENAME, submitConversionPackage, writePackageResultRecord, } from './package-submission.js';
|
|
10
|
-
import { formatDuration, nextActionLine } from './cli-progress.js';
|
|
11
|
+
import { createPackageProgressReporter, formatDuration, nextActionLine, } from './cli-progress.js';
|
|
11
12
|
/**
|
|
12
13
|
* `12ui convert package` — the ordered-viewport submission that had no CLI at
|
|
13
14
|
* all. Without it the terminal step of the branch path was the least supported
|
|
@@ -42,6 +43,23 @@ const refuseExistingResult = async (outDir) => {
|
|
|
42
43
|
+ ' conversion id — read it back rather than submitting the same pages again, or choose a'
|
|
43
44
|
+ ' new --out-dir if you genuinely want another package.');
|
|
44
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* `12ui convert package --template` prints the starting manifest and returns
|
|
48
|
+
* before any config read or network call, so it works with no credentials.
|
|
49
|
+
* Guidance goes to stderr and only the JSON reaches stdout, which is what makes
|
|
50
|
+
* `--template > package.json` write a file that parses.
|
|
51
|
+
*
|
|
52
|
+
* Returns false when the caller did not ask for the template, so the dispatcher
|
|
53
|
+
* falls through to the real submission. This lives beside the command rather
|
|
54
|
+
* than inline in the dispatcher so the argv path is reachable from a test.
|
|
55
|
+
*/
|
|
56
|
+
export const runPackageTemplateCommand = (flags) => {
|
|
57
|
+
if (!booleanFlag(flags, 'template'))
|
|
58
|
+
return false;
|
|
59
|
+
process.stderr.write(`${PACKAGE_MANIFEST_TEMPLATE_NOTES}\n`);
|
|
60
|
+
process.stdout.write(renderPackageManifestTemplate());
|
|
61
|
+
return true;
|
|
62
|
+
};
|
|
45
63
|
export const runPackageCommand = async (flags, dependencies = {}) => {
|
|
46
64
|
const manifestFlag = stringFlag(flags, 'manifest')?.trim();
|
|
47
65
|
const outDirFlag = stringFlag(flags, 'out-dir')?.trim();
|
|
@@ -67,6 +85,10 @@ export const runPackageCommand = async (flags, dependencies = {}) => {
|
|
|
67
85
|
+ ` to ${manifest.output}; expect about ${formatDuration(PACKAGE_DURATION_SECONDS)}\n`);
|
|
68
86
|
}
|
|
69
87
|
const startedAt = Date.now();
|
|
88
|
+
const reportProgress = createPackageProgressReporter({
|
|
89
|
+
write: (line) => { process.stderr.write(`${line}\n`); },
|
|
90
|
+
elapsed: () => formatDuration((Date.now() - startedAt) / 1000),
|
|
91
|
+
});
|
|
70
92
|
const result = await submitConversionPackage({
|
|
71
93
|
client,
|
|
72
94
|
outDir,
|
|
@@ -90,13 +112,7 @@ export const runPackageCommand = async (flags, dependencies = {}) => {
|
|
|
90
112
|
waitHint: 'or leave this command running, which is what --wait already does by default',
|
|
91
113
|
})}\n`);
|
|
92
114
|
},
|
|
93
|
-
onProgress: quiet
|
|
94
|
-
? undefined
|
|
95
|
-
: (event) => {
|
|
96
|
-
const elapsed = formatDuration((Date.now() - startedAt) / 1000);
|
|
97
|
-
const percent = event.percent === undefined ? '' : ` ${event.percent}%`;
|
|
98
|
-
process.stderr.write(`[${elapsed}] package: ${event.stage}${percent}\n`);
|
|
99
|
-
},
|
|
115
|
+
onProgress: quiet ? undefined : (event) => { reportProgress(undefined, event); },
|
|
100
116
|
});
|
|
101
117
|
const resultPath = await writePackageResultRecord(outDir, result);
|
|
102
118
|
const reported = { ...result, resultPath };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-package-command.js","sourceRoot":"","sources":["../src/cli-package-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAA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CAAC,SAAS,cAAc,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,KAAK;cACnF,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,qBAAqB,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;cACzF,cAAc,UAAU,EAAE,CAC7B,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
|
package/dist/cli-progress.d.ts
CHANGED
|
@@ -35,11 +35,24 @@ export declare const OPERATION_DURATION_HINTS: {
|
|
|
35
35
|
/** One branch screen. The server's own provider budget is 150 s. */
|
|
36
36
|
readonly branchScreen: 90;
|
|
37
37
|
readonly branchScreenBudget: 150;
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
/**
|
|
39
|
+
* The screen-generation phase of a whole run. Viewport chains run in parallel
|
|
40
|
+
* across pages, so it tracks the depth of ONE page's chain rather than the
|
|
41
|
+
* screen count: measured median 3m22 over 49 four-page runs.
|
|
42
|
+
*/
|
|
43
|
+
readonly branchScreenPhase: 202;
|
|
44
|
+
/** One branch page as one package. Measured median 2m10 over the same runs. */
|
|
45
|
+
readonly branchPackage: 130;
|
|
46
|
+
/** Downloads, the sentinel, and the final records. */
|
|
47
|
+
readonly branchFinalize: 15;
|
|
48
|
+
/**
|
|
49
|
+
* Whole runs, derived from the phases above by `branchRunEstimateSeconds` at
|
|
50
|
+
* the default page concurrency: one page for `--scope page`, four for
|
|
51
|
+
* `--scope site`. A test holds them to that derivation.
|
|
52
|
+
*/
|
|
53
|
+
readonly branchPage: 362;
|
|
54
|
+
readonly branchSite: 492;
|
|
55
|
+
/** One `12ui convert package` submission, whose page count is not known here. */
|
|
43
56
|
readonly package: 360;
|
|
44
57
|
/** image -> LayerDoc. Extraction plus materialization. */
|
|
45
58
|
readonly convert: 240;
|
|
@@ -52,6 +65,35 @@ export declare const OPERATION_DURATION_HINTS: {
|
|
|
52
65
|
*/
|
|
53
66
|
readonly fused: 300;
|
|
54
67
|
};
|
|
68
|
+
/**
|
|
69
|
+
* Three pages convert at a time. Each holds two or three viewport children on
|
|
70
|
+
* the server, so three pages sit just under the account's ~10 active
|
|
71
|
+
* conversions: a brief queue at the admission boundary is visible in the
|
|
72
|
+
* package's own published progress rather than looking like a stall. It lives
|
|
73
|
+
* beside the duration hints because the run estimate is a function of it.
|
|
74
|
+
*/
|
|
75
|
+
export declare const BRANCH_PAGE_CONCURRENCY_DEFAULT = 3;
|
|
76
|
+
/**
|
|
77
|
+
* A whole branch run, decomposed rather than guessed: the claim, the screen
|
|
78
|
+
* phase, the page conversions — which run `concurrency` at a time and start as
|
|
79
|
+
* each page's own screens land — and the records at the end.
|
|
80
|
+
*
|
|
81
|
+
* The floor is the run whose conversions all overlap generation except the last
|
|
82
|
+
* one; the ceiling is the run where none of them do. Quoting the pair is what
|
|
83
|
+
* keeps a caller from reading the slower half of a normal distribution as a
|
|
84
|
+
* stall.
|
|
85
|
+
*/
|
|
86
|
+
export declare const branchRunEstimateSeconds: (args: {
|
|
87
|
+
pages: number;
|
|
88
|
+
concurrency: number;
|
|
89
|
+
/** A run that stops at downloaded PNGs converts nothing. */
|
|
90
|
+
convert?: boolean;
|
|
91
|
+
}) => {
|
|
92
|
+
floor: number;
|
|
93
|
+
ceiling: number;
|
|
94
|
+
};
|
|
95
|
+
/** What `--scope site` plans in practice, for an estimate made before the plan. */
|
|
96
|
+
export declare const BRANCH_TYPICAL_SITE_PAGES = 4;
|
|
55
97
|
export type OperationDurationHintKind = keyof typeof OPERATION_DURATION_HINTS;
|
|
56
98
|
export declare const formatDuration: (seconds: number) => string;
|
|
57
99
|
export declare const durationHint: (kind: ConversionDurationHintKind) => string;
|
|
@@ -84,6 +126,40 @@ export declare const narrateCounts: (counts: readonly {
|
|
|
84
126
|
}[]) => string;
|
|
85
127
|
export declare const secondsSince: (iso: string | undefined, now: number) => number | undefined;
|
|
86
128
|
export declare const stageLabel: (stage: string) => string;
|
|
129
|
+
export type PackageStageProgress = {
|
|
130
|
+
stage: string;
|
|
131
|
+
percent?: number;
|
|
132
|
+
completed?: number;
|
|
133
|
+
total?: number;
|
|
134
|
+
running?: number;
|
|
135
|
+
stageSince?: string;
|
|
136
|
+
pagesAvailable?: number;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* `converting viewports 32% — 1 of 3 viewports, 2 running, 1m 20s in stage`.
|
|
140
|
+
*
|
|
141
|
+
* A percent alone is the number that stalls: a phase whose children each take
|
|
142
|
+
* minutes reports the same figure for minutes, and an agent polling it decides
|
|
143
|
+
* the run is wedged. The counts and the time in phase are facts that keep
|
|
144
|
+
* advancing while the percent does not. Every one of them is optional, because
|
|
145
|
+
* a server that predates them answers without them and a renderer that demanded
|
|
146
|
+
* them would print nothing at all.
|
|
147
|
+
*/
|
|
148
|
+
export declare const packageProgressLine: (progress: PackageStageProgress, now?: number) => string;
|
|
149
|
+
/**
|
|
150
|
+
* One writer for every package progress line, deduplicated per page.
|
|
151
|
+
*
|
|
152
|
+
* The poll revalidates every few seconds and mostly sees the same facts;
|
|
153
|
+
* repeating an unchanged line is how a stream stops reading as motion. When the
|
|
154
|
+
* server publishes its time in phase the line advances on its own, which is the
|
|
155
|
+
* point — a percent that has not moved is exactly when a caller needs to see
|
|
156
|
+
* that something still is.
|
|
157
|
+
*/
|
|
158
|
+
export declare const createPackageProgressReporter: (args: {
|
|
159
|
+
write: (line: string) => void;
|
|
160
|
+
elapsed: () => string;
|
|
161
|
+
now?: () => number;
|
|
162
|
+
}) => ((pageId: string | undefined, progress: PackageStageProgress) => void);
|
|
87
163
|
export type ProgressReporter = {
|
|
88
164
|
onProgress: (operation: ConversionOperation) => void;
|
|
89
165
|
/** Final line for a finished operation. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-progress.d.ts","sourceRoot":"","sources":["../src/cli-progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB;IACpC,0DAA0D;;IAE1D,8EAA8E;;IAE9E;;;;OAIG;;CAEK,CAAC;AAEX,MAAM,MAAM,0BAA0B,GAAG,MAAM,OAAO,yBAAyB,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;IAEnC,6DAA6D;;IAE7D,6CAA6C;;IAE7C,kEAAkE;;IAElE,oEAAoE;;;IAGpE,+EAA+E;;IAE/E,
|
|
1
|
+
{"version":3,"file":"cli-progress.d.ts","sourceRoot":"","sources":["../src/cli-progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB;IACpC,0DAA0D;;IAE1D,8EAA8E;;IAE9E;;;;OAIG;;CAEK,CAAC;AAEX,MAAM,MAAM,0BAA0B,GAAG,MAAM,OAAO,yBAAyB,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;IAEnC,6DAA6D;;IAE7D,6CAA6C;;IAE7C,kEAAkE;;IAElE,oEAAoE;;;IAGpE;;;;OAIG;;IAEH,+EAA+E;;IAE/E,sDAAsD;;IAEtD;;;;OAIG;;;IAGH,iFAAiF;;IA/CjF,0DAA0D;;IAE1D,8EAA8E;;IAE9E;;;;OAIG;;CAyCK,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,IAAI,CAAC;AAEjD;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,GAAI,MAAM;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,KAAG;IAAE,KAAK,EAAE,MAA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,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,oBAAoB,EAC9B,MAAK,MAAmB,KACvB,MAeF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,GAAI,MAAM;IAClD,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,OAAO,EAAE,MAAM,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,KAAG,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAQxE,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACrD,2CAA2C;IAC3C,IAAI,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,KAAG,gBAsBH,CAAC"}
|
package/dist/cli-progress.js
CHANGED
|
@@ -34,13 +34,58 @@ export const OPERATION_DURATION_HINTS = {
|
|
|
34
34
|
/** One branch screen. The server's own provider budget is 150 s. */
|
|
35
35
|
branchScreen: 90,
|
|
36
36
|
branchScreenBudget: 150,
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
/**
|
|
38
|
+
* The screen-generation phase of a whole run. Viewport chains run in parallel
|
|
39
|
+
* across pages, so it tracks the depth of ONE page's chain rather than the
|
|
40
|
+
* screen count: measured median 3m22 over 49 four-page runs.
|
|
41
|
+
*/
|
|
42
|
+
branchScreenPhase: 202,
|
|
43
|
+
/** One branch page as one package. Measured median 2m10 over the same runs. */
|
|
44
|
+
branchPackage: 130,
|
|
45
|
+
/** Downloads, the sentinel, and the final records. */
|
|
46
|
+
branchFinalize: 15,
|
|
47
|
+
/**
|
|
48
|
+
* Whole runs, derived from the phases above by `branchRunEstimateSeconds` at
|
|
49
|
+
* the default page concurrency: one page for `--scope page`, four for
|
|
50
|
+
* `--scope site`. A test holds them to that derivation.
|
|
51
|
+
*/
|
|
52
|
+
branchPage: 362,
|
|
53
|
+
branchSite: 492,
|
|
54
|
+
/** One `12ui convert package` submission, whose page count is not known here. */
|
|
42
55
|
package: 360,
|
|
43
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Three pages convert at a time. Each holds two or three viewport children on
|
|
59
|
+
* the server, so three pages sit just under the account's ~10 active
|
|
60
|
+
* conversions: a brief queue at the admission boundary is visible in the
|
|
61
|
+
* package's own published progress rather than looking like a stall. It lives
|
|
62
|
+
* beside the duration hints because the run estimate is a function of it.
|
|
63
|
+
*/
|
|
64
|
+
export const BRANCH_PAGE_CONCURRENCY_DEFAULT = 3;
|
|
65
|
+
/**
|
|
66
|
+
* A whole branch run, decomposed rather than guessed: the claim, the screen
|
|
67
|
+
* phase, the page conversions — which run `concurrency` at a time and start as
|
|
68
|
+
* each page's own screens land — and the records at the end.
|
|
69
|
+
*
|
|
70
|
+
* The floor is the run whose conversions all overlap generation except the last
|
|
71
|
+
* one; the ceiling is the run where none of them do. Quoting the pair is what
|
|
72
|
+
* keeps a caller from reading the slower half of a normal distribution as a
|
|
73
|
+
* stall.
|
|
74
|
+
*/
|
|
75
|
+
export const branchRunEstimateSeconds = (args) => {
|
|
76
|
+
const base = OPERATION_DURATION_HINTS.branchClaim
|
|
77
|
+
+ OPERATION_DURATION_HINTS.branchScreenPhase
|
|
78
|
+
+ OPERATION_DURATION_HINTS.branchFinalize;
|
|
79
|
+
if (args.convert === false)
|
|
80
|
+
return { floor: base, ceiling: base };
|
|
81
|
+
const waves = Math.max(1, Math.ceil(Math.max(1, args.pages) / Math.max(1, args.concurrency)));
|
|
82
|
+
return {
|
|
83
|
+
floor: base + OPERATION_DURATION_HINTS.branchPackage,
|
|
84
|
+
ceiling: base + waves * OPERATION_DURATION_HINTS.branchPackage,
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
/** What `--scope site` plans in practice, for an estimate made before the plan. */
|
|
88
|
+
export const BRANCH_TYPICAL_SITE_PAGES = 4;
|
|
44
89
|
export const formatDuration = (seconds) => {
|
|
45
90
|
const whole = Math.max(0, Math.round(seconds));
|
|
46
91
|
if (whole < 90)
|
|
@@ -98,8 +143,66 @@ const STAGE_LABELS = {
|
|
|
98
143
|
static_export: 'rendering export',
|
|
99
144
|
project_export: 'building project',
|
|
100
145
|
publish: 'publishing',
|
|
146
|
+
// The package coordinator's own phases.
|
|
147
|
+
convert_viewports: 'converting viewports',
|
|
148
|
+
compose_pages: 'composing pages',
|
|
149
|
+
export_pages: 'exporting pages',
|
|
101
150
|
};
|
|
102
151
|
export const stageLabel = (stage) => STAGE_LABELS[stage] ?? stage;
|
|
152
|
+
/** What the current package phase counts. */
|
|
153
|
+
const STAGE_UNITS = {
|
|
154
|
+
convert_viewports: 'viewport',
|
|
155
|
+
compose_pages: 'page',
|
|
156
|
+
export_pages: 'page',
|
|
157
|
+
publish: 'page',
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* `converting viewports 32% — 1 of 3 viewports, 2 running, 1m 20s in stage`.
|
|
161
|
+
*
|
|
162
|
+
* A percent alone is the number that stalls: a phase whose children each take
|
|
163
|
+
* minutes reports the same figure for minutes, and an agent polling it decides
|
|
164
|
+
* the run is wedged. The counts and the time in phase are facts that keep
|
|
165
|
+
* advancing while the percent does not. Every one of them is optional, because
|
|
166
|
+
* a server that predates them answers without them and a renderer that demanded
|
|
167
|
+
* them would print nothing at all.
|
|
168
|
+
*/
|
|
169
|
+
export const packageProgressLine = (progress, now = Date.now()) => {
|
|
170
|
+
const head = progress.percent === undefined
|
|
171
|
+
? stageLabel(progress.stage)
|
|
172
|
+
: `${stageLabel(progress.stage)} ${progress.percent}%`;
|
|
173
|
+
const unit = STAGE_UNITS[progress.stage];
|
|
174
|
+
const facts = [];
|
|
175
|
+
if (progress.total !== undefined) {
|
|
176
|
+
facts.push(`${progress.completed ?? 0} of ${progress.total}${unit ? ` ${unit}${progress.total === 1 ? '' : 's'}` : ''}`);
|
|
177
|
+
}
|
|
178
|
+
if (progress.running !== undefined)
|
|
179
|
+
facts.push(`${progress.running} running`);
|
|
180
|
+
const inStage = secondsSince(progress.stageSince, now);
|
|
181
|
+
if (inStage !== undefined)
|
|
182
|
+
facts.push(`${formatDuration(inStage)} in stage`);
|
|
183
|
+
if (progress.pagesAvailable)
|
|
184
|
+
facts.push(`${progress.pagesAvailable} page(s) ready`);
|
|
185
|
+
return facts.length === 0 ? head : `${head} — ${facts.join(', ')}`;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* One writer for every package progress line, deduplicated per page.
|
|
189
|
+
*
|
|
190
|
+
* The poll revalidates every few seconds and mostly sees the same facts;
|
|
191
|
+
* repeating an unchanged line is how a stream stops reading as motion. When the
|
|
192
|
+
* server publishes its time in phase the line advances on its own, which is the
|
|
193
|
+
* point — a percent that has not moved is exactly when a caller needs to see
|
|
194
|
+
* that something still is.
|
|
195
|
+
*/
|
|
196
|
+
export const createPackageProgressReporter = (args) => {
|
|
197
|
+
const last = new Map();
|
|
198
|
+
return (pageId, progress) => {
|
|
199
|
+
const line = packageProgressLine(progress, (args.now ?? Date.now)());
|
|
200
|
+
if (last.get(pageId ?? '') === line)
|
|
201
|
+
return;
|
|
202
|
+
last.set(pageId ?? '', line);
|
|
203
|
+
args.write(`[${args.elapsed()}] package${pageId ? ` ${pageId}` : ''}: ${line}`);
|
|
204
|
+
};
|
|
205
|
+
};
|
|
103
206
|
/**
|
|
104
207
|
* Streams stage progress to stderr, one line per distinct stage/percent.
|
|
105
208
|
*
|
package/dist/cli-progress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-progress.js","sourceRoot":"","sources":["../src/cli-progress.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,0DAA0D;IAC1D,OAAO,EAAE,GAAG;IACZ,8EAA8E;IAC9E,MAAM,EAAE,GAAG;IACX;;;;OAIG;IACH,KAAK,EAAE,GAAG;CACF,CAAC;AAIX;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,GAAG,yBAAyB;IAC5B,6DAA6D;IAC7D,cAAc,EAAE,EAAE;IAClB,6CAA6C;IAC7C,UAAU,EAAE,EAAE;IACd,kEAAkE;IAClE,WAAW,EAAE,EAAE;IACf,oEAAoE;IACpE,YAAY,EAAE,EAAE;IAChB,kBAAkB,EAAE,GAAG;IACvB,+EAA+E;IAC/E,UAAU,EAAE,GAAG;IACf,
|
|
1
|
+
{"version":3,"file":"cli-progress.js","sourceRoot":"","sources":["../src/cli-progress.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,0DAA0D;IAC1D,OAAO,EAAE,GAAG;IACZ,8EAA8E;IAC9E,MAAM,EAAE,GAAG;IACX;;;;OAIG;IACH,KAAK,EAAE,GAAG;CACF,CAAC;AAIX;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,GAAG,yBAAyB;IAC5B,6DAA6D;IAC7D,cAAc,EAAE,EAAE;IAClB,6CAA6C;IAC7C,UAAU,EAAE,EAAE;IACd,kEAAkE;IAClE,WAAW,EAAE,EAAE;IACf,oEAAoE;IACpE,YAAY,EAAE,EAAE;IAChB,kBAAkB,EAAE,GAAG;IACvB;;;;OAIG;IACH,iBAAiB,EAAE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, runImageBatchStatusCommand, } from './cli-image-batch-command.js';
|
|
14
14
|
import { runImageCommand } from './cli-image-command.js';
|
|
15
15
|
import { runCreateCommand } from './cli-create-command.js';
|
|
16
|
-
import { runPackageCommand } from './cli-package-command.js';
|
|
17
|
-
import { PACKAGE_MANIFEST_TEMPLATE_NOTES, renderPackageManifestTemplate, } from './package-manifest-template.js';
|
|
16
|
+
import { runPackageCommand, runPackageTemplateCommand } from './cli-package-command.js';
|
|
18
17
|
import { runSkillCommand } from './cli-skill-command.js';
|
|
19
18
|
import { isConversionModel } from './conversion-models.js';
|
|
20
19
|
import { TwelveUiConversionClient, } from './conversion-client.js';
|
|
@@ -24,6 +23,7 @@ import { runSelectCommand } from './cli-select-command.js';
|
|
|
24
23
|
import { resolveBranchDirectory } from './cli-branch-command.js';
|
|
25
24
|
import { CONVERSION_DURATION_HINTS, OPERATION_DURATION_HINTS, createProgressReporter, durationHint, nextActionLine, } from './cli-progress.js';
|
|
26
25
|
import { CONVERSION_OUTPUTS, isConversionOutput } from './conversion-outputs.js';
|
|
26
|
+
import { recordConvertedImageReceipt } from './conversion-receipt.js';
|
|
27
27
|
import { readConversionConfig } from './config.js';
|
|
28
28
|
import { classifyLocalConversionInput, createInputForLocalFile, defaultConversionOutputPath, } from './local-conversion-input.js';
|
|
29
29
|
import { normalizeImageOutputWidth, parseImageOutputWidth, } from './image-output-width.js';
|
|
@@ -55,7 +55,7 @@ const usage = (exitCode = 1) => {
|
|
|
55
55
|
12ui create download <run-id> --out-dir <directory> [--slot <a,b,...>] [--origin <url>] [--api-key <key>]
|
|
56
56
|
12ui image generate-batch --manifest <batch.json> [--resume] [--wait] [--quiet]
|
|
57
57
|
12ui image batch-status --manifest <batch.json> [--json]
|
|
58
|
-
12ui branch execute <run-dir> --concept <text>|--concept-file <file> --scope page|site [--convert html] [--convert-model fast|standard|pro] [--convert-quality standard|pro] [--winner-image <file>|--winner-run <crt-id> --winner-slot <slot>] [--source-conversion-id <id>] [--max-screens <n>] [--idempotency-key <key>] [--out-dir <directory>] [--resume] [--dry-run] [--wait] [--quiet] [--origin <url>] [--api-key <key>]
|
|
58
|
+
12ui branch execute <run-dir> --concept <text>|--concept-file <file> --scope page|site [--convert html] [--convert-model fast|standard|pro] [--convert-quality standard|pro] [--winner-image <file>|--winner-run <crt-id> --winner-slot <slot>] [--source-conversion-id <id>] [--max-screens <n>] [--page-concurrency <n>] [--idempotency-key <key>] [--out-dir <directory>] [--resume] [--dry-run] [--wait] [--quiet] [--origin <url>] [--api-key <key>]
|
|
59
59
|
12ui branch resume <run-dir> [--quiet] [--origin <url>] [--api-key <key>]
|
|
60
60
|
12ui branch status <run-dir> [--json] [--origin <url>] [--api-key <key>]
|
|
61
61
|
12ui capabilities [--json]
|
|
@@ -151,11 +151,8 @@ const runConversionCommand = async (command, flags) => {
|
|
|
151
151
|
}
|
|
152
152
|
// Ordered viewports of one page are ONE package conversion, not N converts.
|
|
153
153
|
if (verb === 'convert' && command[1] === 'package') {
|
|
154
|
-
if (
|
|
155
|
-
process.stderr.write(`${PACKAGE_MANIFEST_TEMPLATE_NOTES}\n`);
|
|
156
|
-
process.stdout.write(renderPackageManifestTemplate());
|
|
154
|
+
if (runPackageTemplateCommand(flags))
|
|
157
155
|
return;
|
|
158
|
-
}
|
|
159
156
|
await runPackageCommand(flags);
|
|
160
157
|
return;
|
|
161
158
|
}
|
|
@@ -336,6 +333,19 @@ const runConversionCommand = async (command, flags) => {
|
|
|
336
333
|
throw new Error(`Conversion ${created.id} failed: ${detail}`, { cause: error });
|
|
337
334
|
}
|
|
338
335
|
reporter.done(operation);
|
|
336
|
+
// The proof that pairs these exact bytes with the conversion just bought, so
|
|
337
|
+
// a later `12ui branch execute` from the same image attaches it instead of
|
|
338
|
+
// buying viewport 1 of its source page a second time. Best effort by design:
|
|
339
|
+
// it is written beside the input, wherever the caller keeps it, and a
|
|
340
|
+
// destination that refuses the write costs a later conversion and nothing else.
|
|
341
|
+
if (input.layerdoc === undefined) {
|
|
342
|
+
await recordConvertedImageReceipt({
|
|
343
|
+
imagePath: inputPath,
|
|
344
|
+
bytes: inputBytes,
|
|
345
|
+
operation,
|
|
346
|
+
...(quiet ? {} : { warn: (message) => process.stderr.write(`${message}\n`) }),
|
|
347
|
+
});
|
|
348
|
+
}
|
|
339
349
|
const outFile = path.resolve(stringFlag(flags, 'out') || defaultConversionOutputPath(inputPath, output));
|
|
340
350
|
const result = await downloadCompletedConversion({ client, operation, output, outFile });
|
|
341
351
|
if (!exportOperationId) {
|