@12ui/design 0.2.14 → 0.2.16
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 +21 -1
- 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 +7 -0
- package/dist/branch-execution.d.ts.map +1 -1
- package/dist/branch-execution.js +175 -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 +109 -5
- package/dist/branch-page-conversion.d.ts.map +1 -1
- package/dist/branch-page-conversion.js +375 -179
- 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 +14 -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 +35 -2
- package/dist/cli-capabilities.d.ts.map +1 -1
- package/dist/cli-capabilities.js +38 -1
- package/dist/cli-capabilities.js.map +1 -1
- package/dist/cli-draft-command.d.ts +2 -0
- package/dist/cli-draft-command.d.ts.map +1 -1
- package/dist/cli-draft-command.js +22 -4
- package/dist/cli-draft-command.js.map +1 -1
- package/dist/cli-package-command.d.ts +13 -0
- package/dist/cli-package-command.d.ts.map +1 -1
- package/dist/cli-package-command.js +35 -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-skill-command.d.ts.map +1 -1
- package/dist/cli-skill-command.js +27 -12
- package/dist/cli-skill-command.js.map +1 -1
- package/dist/cli.js +20 -10
- package/dist/cli.js.map +1 -1
- package/dist/conversion-receipt-store.d.ts +75 -0
- package/dist/conversion-receipt-store.d.ts.map +1 -0
- package/dist/conversion-receipt-store.js +143 -0
- package/dist/conversion-receipt-store.js.map +1 -0
- package/dist/conversion-receipt.d.ts +223 -0
- package/dist/conversion-receipt.d.ts.map +1 -0
- package/dist/conversion-receipt.js +352 -0
- package/dist/conversion-receipt.js.map +1 -0
- package/dist/draft-adoption.d.ts +48 -0
- package/dist/draft-adoption.d.ts.map +1 -0
- package/dist/draft-adoption.js +237 -0
- package/dist/draft-adoption.js.map +1 -0
- package/dist/draft-run.d.ts +10 -0
- package/dist/draft-run.d.ts.map +1 -1
- package/dist/draft-run.js +16 -4
- package/dist/draft-run.js.map +1 -1
- 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 +65 -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 +43 -1
- package/dist/package-submission.d.ts.map +1 -1
- package/dist/package-submission.js +32 -7
- package/dist/package-submission.js.map +1 -1
- package/dist/skill-clients.d.ts +39 -0
- package/dist/skill-clients.d.ts.map +1 -0
- package/dist/skill-clients.js +156 -0
- package/dist/skill-clients.js.map +1 -0
- package/dist/skill-installer.d.ts +2 -3
- package/dist/skill-installer.d.ts.map +1 -1
- package/dist/skill-installer.js +9 -101
- package/dist/skill-installer.js.map +1 -1
- package/package.json +1 -1
- package/skills/design/SKILL.md +6 -3
- package/skills/design-branch/SKILL.md +6 -5
- package/skills/design-convert/SKILL.md +3 -3
- package/skills/design-draft/SKILL.md +3 -3
- package/skills/design-search/SKILL.md +3 -3
|
@@ -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,29 @@ 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 per-user record of conversions already bought, and the one thing that
|
|
42
|
+
* keeps the common flow — convert the approved design, then branch from it —
|
|
43
|
+
* from buying that design's LayerDoc twice. Nothing is written beside the
|
|
44
|
+
* user's images: a record is about bytes, so it is keyed by their digest and
|
|
45
|
+
* found from every copy of them.
|
|
46
|
+
*/
|
|
47
|
+
readonly conversionReceipt: {
|
|
48
|
+
readonly store: "~/.12ui/conversions/<sha256>.<model>.json";
|
|
49
|
+
/** Points the whole 12ui home, and with it the store, somewhere else. */
|
|
50
|
+
readonly homeOverride: "TWELVE_UI_HOME";
|
|
51
|
+
readonly keyedBy: readonly ["sha256", "model"];
|
|
52
|
+
readonly writtenBy: readonly ["12ui convert (image input, --output layerdoc)", "12ui convert package", "12ui branch execute --convert"];
|
|
53
|
+
readonly readBy: "12ui branch execute --convert";
|
|
54
|
+
/** Reuse requires every one of these to match the bytes about to be sent. */
|
|
55
|
+
readonly proves: readonly ["sha256", "conversionId", "model", "expiresAt"];
|
|
56
|
+
/** 0.2.15 wrote these beside the image. Read and migrated, never written. */
|
|
57
|
+
readonly legacySidecar: {
|
|
58
|
+
readonly file: "<converted-image>.conversion.json";
|
|
59
|
+
readonly status: "read beside a branch winner for one release cycle, then migrated into the store";
|
|
60
|
+
};
|
|
61
|
+
readonly bestEffort: true;
|
|
62
|
+
};
|
|
40
63
|
/** Ordered viewports of one continuous page: ONE conversion, not N. */
|
|
41
64
|
readonly conversionPackage: {
|
|
42
65
|
readonly command: "12ui convert package --manifest <package.json> --out-dir <directory>";
|
|
@@ -49,6 +72,16 @@ export declare const CLI_CAPABILITIES: {
|
|
|
49
72
|
readonly scopes: readonly ["page", "site"];
|
|
50
73
|
readonly completionSentinel: "branch.complete.json";
|
|
51
74
|
readonly endpoint: "/api/v1/create";
|
|
75
|
+
/**
|
|
76
|
+
* A page's package depends on its own screens and nothing else, so pages
|
|
77
|
+
* convert as they become whole and several at a time.
|
|
78
|
+
*/
|
|
79
|
+
readonly pageConcurrency: {
|
|
80
|
+
readonly flag: "--page-concurrency";
|
|
81
|
+
readonly default: 3;
|
|
82
|
+
readonly maximum: 10;
|
|
83
|
+
};
|
|
84
|
+
readonly expectedSecondsPerPage: 130;
|
|
52
85
|
};
|
|
53
86
|
readonly projectProfileSchema: {
|
|
54
87
|
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;;;;;;OAMG;;;QAGD,yEAAyE;;;;;QASzE,6EAA6E;;QAE7E,6EAA6E;;;;;;;IAO/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,33 @@ 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 per-user record of conversions already bought, and the one thing that
|
|
55
|
+
* keeps the common flow — convert the approved design, then branch from it —
|
|
56
|
+
* from buying that design's LayerDoc twice. Nothing is written beside the
|
|
57
|
+
* user's images: a record is about bytes, so it is keyed by their digest and
|
|
58
|
+
* found from every copy of them.
|
|
59
|
+
*/
|
|
60
|
+
conversionReceipt: {
|
|
61
|
+
store: '~/.12ui/conversions/<sha256>.<model>.json',
|
|
62
|
+
/** Points the whole 12ui home, and with it the store, somewhere else. */
|
|
63
|
+
homeOverride: 'TWELVE_UI_HOME',
|
|
64
|
+
keyedBy: ['sha256', 'model'],
|
|
65
|
+
writtenBy: [
|
|
66
|
+
'12ui convert (image input, --output layerdoc)',
|
|
67
|
+
'12ui convert package',
|
|
68
|
+
'12ui branch execute --convert',
|
|
69
|
+
],
|
|
70
|
+
readBy: '12ui branch execute --convert',
|
|
71
|
+
/** Reuse requires every one of these to match the bytes about to be sent. */
|
|
72
|
+
proves: ['sha256', 'conversionId', 'model', 'expiresAt'],
|
|
73
|
+
/** 0.2.15 wrote these beside the image. Read and migrated, never written. */
|
|
74
|
+
legacySidecar: {
|
|
75
|
+
file: '<converted-image>.conversion.json',
|
|
76
|
+
status: 'read beside a branch winner for one release cycle, then migrated into the store',
|
|
77
|
+
},
|
|
78
|
+
bestEffort: true,
|
|
79
|
+
},
|
|
53
80
|
/** Ordered viewports of one continuous page: ONE conversion, not N. */
|
|
54
81
|
conversionPackage: {
|
|
55
82
|
command: '12ui convert package --manifest <package.json> --out-dir <directory>',
|
|
@@ -62,6 +89,16 @@ export const CLI_CAPABILITIES = {
|
|
|
62
89
|
scopes: ['page', 'site'],
|
|
63
90
|
completionSentinel: 'branch.complete.json',
|
|
64
91
|
endpoint: '/api/v1/create',
|
|
92
|
+
/**
|
|
93
|
+
* A page's package depends on its own screens and nothing else, so pages
|
|
94
|
+
* convert as they become whole and several at a time.
|
|
95
|
+
*/
|
|
96
|
+
pageConcurrency: {
|
|
97
|
+
flag: '--page-concurrency',
|
|
98
|
+
default: BRANCH_PAGE_CONCURRENCY_DEFAULT,
|
|
99
|
+
maximum: 10,
|
|
100
|
+
},
|
|
101
|
+
expectedSecondsPerPage: OPERATION_DURATION_HINTS.branchPackage,
|
|
65
102
|
},
|
|
66
103
|
projectProfileSchema: PROJECT_PROFILE_SCHEMA,
|
|
67
104
|
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,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE;QACN,WAAW;QACX,YAAY;QACZ,YAAY;QACZ,6BAA6B,CAAC,QAAQ;KACvC;IACD,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EAAE,iBAAiB;IAC9B,gBAAgB,EAAE;QAChB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,sBAAsB;QAC/B,WAAW,EAAE,uFAAuF;KACrG;IACD,mBAAmB,EAAE,+BAA+B;IACpD,WAAW,EAAE;QACX,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,WAAW,EAAE,kBAAkB;QAC/B,OAAO,EAAE,cAAc;QACvB,WAAW,EACT,yFAAyF;cACvF,uFAAuF;cACvF,yEAAyE;QAC7E,eAAe,EAAE,yBAAyB,CAAC,KAAK;KACjD;IACD,eAAe,EAAE;QACf,OAAO,EAAE,yBAAyB,CAAC,OAAO;QAC1C,MAAM,EAAE,yBAAyB,C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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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-draft-command.d.ts","sourceRoot":"","sources":["../src/cli-draft-command.ts"],"names":[],"mappings":"AAIA,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAM5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-draft-command.d.ts","sourceRoot":"","sources":["../src/cli-draft-command.ts"],"names":[],"mappings":"AAIA,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAM5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAgB1D;;;;;;;GAOG;AAEH,eAAO,MAAM,WAAW,QAIoB,CAAC;AA2B7C,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,QAAQ,EACf,eAAc;IACZ,UAAU,CAAC,EAAE,OAAO,oBAAoB,CAAC;IACzC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,KAAK,oBAAoB,CAAC;IACzF,aAAa,CAAC,EAAE,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;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACjF,KACA,OAAO,CAAC,aAAa,CASvB,CAAC"}
|
|
@@ -7,8 +7,9 @@ import { readConversionConfig } from './config.js';
|
|
|
7
7
|
import { INSPIRATION_ATTEMPT_FILE } from './cli-corpus-types.js';
|
|
8
8
|
import { TwelveUiCorpusClient } from './corpus-client.js';
|
|
9
9
|
import { summarizeImageBatchProgress } from './image-batch-status.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { acquireDraftRunDirectory } from './draft-adoption.js';
|
|
11
|
+
import { draftPaths, readDraftRecord, } from './draft-workspace.js';
|
|
12
|
+
import { DRAFT_CANDIDATE_COUNT, draftRunCorpusKey, prepareDraftRun, } from './draft-run.js';
|
|
12
13
|
import { readSelectionRecord } from './selection-record.js';
|
|
13
14
|
/**
|
|
14
15
|
* `12ui draft` — the whole explore step as one command.
|
|
@@ -75,8 +76,20 @@ export const prepareDraftCommand = async (flags, dependencies = {}) => {
|
|
|
75
76
|
origin: stringFlag(flags, 'origin'),
|
|
76
77
|
apiKey: stringFlag(flags, 'api-key'),
|
|
77
78
|
});
|
|
78
|
-
|
|
79
|
+
/**
|
|
80
|
+
* The corpus key is derived here, before the directory exists, because it is
|
|
81
|
+
* what decides whether an incomplete previous run IS this run. A retry of a
|
|
82
|
+
* draft that died after its corpus search continues that directory instead of
|
|
83
|
+
* stranding a same-slug sibling beside it — measured overnight 2026-08-10,
|
|
84
|
+
* where two siblings held different candidates and slug-glob tooling switched
|
|
85
|
+
* between them silently.
|
|
86
|
+
*/
|
|
87
|
+
const { paths, adopted } = await acquireDraftRunDirectory({
|
|
79
88
|
query,
|
|
89
|
+
corpusKey: draftRunCorpusKey({
|
|
90
|
+
query,
|
|
91
|
+
redesignSourceSha256: redesignSource?.sha256 ?? null,
|
|
92
|
+
}),
|
|
80
93
|
...(dependencies.workspaceRoot ? { root: dependencies.workspaceRoot } : {}),
|
|
81
94
|
});
|
|
82
95
|
// FIRST line of output, before anything slow or paid: every later command
|
|
@@ -99,6 +112,7 @@ export const prepareDraftCommand = async (flags, dependencies = {}) => {
|
|
|
99
112
|
runDir: paths.runDir,
|
|
100
113
|
manifestPath: paths.generationManifest,
|
|
101
114
|
candidateCount: DRAFT_CANDIDATE_COUNT,
|
|
115
|
+
adopted,
|
|
102
116
|
nextAction: nextActionLine({
|
|
103
117
|
what: `${DRAFT_CANDIDATE_COUNT} candidates`,
|
|
104
118
|
typicalSeconds: OPERATION_DURATION_HINTS.imageBatch,
|
|
@@ -198,7 +212,11 @@ export const runDraftStatusCommand = async (runDirArgument, _flags) => {
|
|
|
198
212
|
}),
|
|
199
213
|
};
|
|
200
214
|
};
|
|
201
|
-
export const draftBanner = (prepared) => (
|
|
215
|
+
export const draftBanner = (prepared) => ((prepared.adopted
|
|
216
|
+
? 'Continuing the incomplete run already in this directory rather than opening a second one'
|
|
217
|
+
+ ' beside it; the corpus search replayed on its derived key.\n'
|
|
218
|
+
: '')
|
|
219
|
+
+ `${prepared.candidateCount} candidates generating from ${prepared.candidateCount} corpus`
|
|
202
220
|
+ ` references, one each.\n${prepared.nextAction}`);
|
|
203
221
|
export const draftDetachRequested = (flags) => !booleanFlag(flags, 'wait');
|
|
204
222
|
/**
|
|
@@ -1 +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,wBAA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,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"}
|
|
@@ -11,8 +11,21 @@ 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;
|
|
28
|
+
/** The per-user receipt store. Tests inject; the CLI uses the real one. */
|
|
29
|
+
receiptStore?: string;
|
|
17
30
|
}) => Promise<PackageSubmissionResult>;
|
|
18
31
|
//# sourceMappingURL=cli-package-command.d.ts.map
|
|
@@ -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;
|
|
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;AAInD,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;IACpG,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;CAClB,KACL,OAAO,CAAC,uBAAuB,CAuFjC,CAAC"}
|
|
@@ -3,11 +3,13 @@ import path from 'node:path';
|
|
|
3
3
|
import { booleanFlag, stringFlag } from './cli-arguments.js';
|
|
4
4
|
import { readConversionConfig } from './config.js';
|
|
5
5
|
import { conversionPackageKey } from './branch-identity.js';
|
|
6
|
+
import { recordPackageConversionReceipts } from './conversion-receipt.js';
|
|
6
7
|
import { normalizeOptionalIdempotencyKey } from './idempotency-key.js';
|
|
7
8
|
import { TwelveUiConversionPackageClient } from './package-client.js';
|
|
8
9
|
import { readLocalPackageManifest } from './package-manifest-file.js';
|
|
10
|
+
import { PACKAGE_MANIFEST_TEMPLATE_NOTES, renderPackageManifestTemplate, } from './package-manifest-template.js';
|
|
9
11
|
import { PACKAGE_RESULT_FILENAME, submitConversionPackage, writePackageResultRecord, } from './package-submission.js';
|
|
10
|
-
import { formatDuration, nextActionLine } from './cli-progress.js';
|
|
12
|
+
import { createPackageProgressReporter, formatDuration, nextActionLine, } from './cli-progress.js';
|
|
11
13
|
/**
|
|
12
14
|
* `12ui convert package` — the ordered-viewport submission that had no CLI at
|
|
13
15
|
* all. Without it the terminal step of the branch path was the least supported
|
|
@@ -42,6 +44,23 @@ const refuseExistingResult = async (outDir) => {
|
|
|
42
44
|
+ ' conversion id — read it back rather than submitting the same pages again, or choose a'
|
|
43
45
|
+ ' new --out-dir if you genuinely want another package.');
|
|
44
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* `12ui convert package --template` prints the starting manifest and returns
|
|
49
|
+
* before any config read or network call, so it works with no credentials.
|
|
50
|
+
* Guidance goes to stderr and only the JSON reaches stdout, which is what makes
|
|
51
|
+
* `--template > package.json` write a file that parses.
|
|
52
|
+
*
|
|
53
|
+
* Returns false when the caller did not ask for the template, so the dispatcher
|
|
54
|
+
* falls through to the real submission. This lives beside the command rather
|
|
55
|
+
* than inline in the dispatcher so the argv path is reachable from a test.
|
|
56
|
+
*/
|
|
57
|
+
export const runPackageTemplateCommand = (flags) => {
|
|
58
|
+
if (!booleanFlag(flags, 'template'))
|
|
59
|
+
return false;
|
|
60
|
+
process.stderr.write(`${PACKAGE_MANIFEST_TEMPLATE_NOTES}\n`);
|
|
61
|
+
process.stdout.write(renderPackageManifestTemplate());
|
|
62
|
+
return true;
|
|
63
|
+
};
|
|
45
64
|
export const runPackageCommand = async (flags, dependencies = {}) => {
|
|
46
65
|
const manifestFlag = stringFlag(flags, 'manifest')?.trim();
|
|
47
66
|
const outDirFlag = stringFlag(flags, 'out-dir')?.trim();
|
|
@@ -67,6 +86,10 @@ export const runPackageCommand = async (flags, dependencies = {}) => {
|
|
|
67
86
|
+ ` to ${manifest.output}; expect about ${formatDuration(PACKAGE_DURATION_SECONDS)}\n`);
|
|
68
87
|
}
|
|
69
88
|
const startedAt = Date.now();
|
|
89
|
+
const reportProgress = createPackageProgressReporter({
|
|
90
|
+
write: (line) => { process.stderr.write(`${line}\n`); },
|
|
91
|
+
elapsed: () => formatDuration((Date.now() - startedAt) / 1000),
|
|
92
|
+
});
|
|
70
93
|
const result = await submitConversionPackage({
|
|
71
94
|
client,
|
|
72
95
|
outDir,
|
|
@@ -90,15 +113,19 @@ export const runPackageCommand = async (flags, dependencies = {}) => {
|
|
|
90
113
|
waitHint: 'or leave this command running, which is what --wait already does by default',
|
|
91
114
|
})}\n`);
|
|
92
115
|
},
|
|
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
|
-
},
|
|
116
|
+
onProgress: quiet ? undefined : (event) => { reportProgress(undefined, event); },
|
|
100
117
|
});
|
|
101
118
|
const resultPath = await writePackageResultRecord(outDir, result);
|
|
119
|
+
// Every viewport the package converted is a reusable artifact in its own
|
|
120
|
+
// right, so the screenshots this manifest named are proved for the next run
|
|
121
|
+
// that starts from the same bytes — a branch run from one of these designs
|
|
122
|
+
// attaches its conversion instead of buying it again.
|
|
123
|
+
await recordPackageConversionReceipts({
|
|
124
|
+
pages: manifest.pages,
|
|
125
|
+
result,
|
|
126
|
+
...(dependencies.receiptStore ? { store: dependencies.receiptStore } : {}),
|
|
127
|
+
...(quiet ? {} : { warn: (message) => { process.stderr.write(`${message}\n`); } }),
|
|
128
|
+
});
|
|
102
129
|
const reported = { ...result, resultPath };
|
|
103
130
|
console.log(JSON.stringify({ manifestPath, outDir, ...reported }, null, 2));
|
|
104
131
|
const failed = reported.pages.filter((page) => page.status === 'failed');
|
|
@@ -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,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAiB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,GAEzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,
|
|
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,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAiB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CA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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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AE,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
|
*
|