@12ui/design 0.2.13 → 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/README.md +35 -9
- 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-client.d.ts +155 -0
- package/dist/branch-client.d.ts.map +1 -0
- package/dist/branch-client.js +179 -0
- package/dist/branch-client.js.map +1 -0
- package/dist/branch-completion.d.ts +37 -0
- package/dist/branch-completion.d.ts.map +1 -0
- package/dist/branch-completion.js +137 -0
- package/dist/branch-completion.js.map +1 -0
- package/dist/branch-dispatch-loop.d.ts +84 -0
- package/dist/branch-dispatch-loop.d.ts.map +1 -0
- package/dist/branch-dispatch-loop.js +206 -0
- package/dist/branch-dispatch-loop.js.map +1 -0
- package/dist/branch-downloads.d.ts +53 -0
- package/dist/branch-downloads.d.ts.map +1 -0
- package/dist/branch-downloads.js +114 -0
- package/dist/branch-downloads.js.map +1 -0
- package/dist/branch-execution-types.d.ts +54 -0
- package/dist/branch-execution-types.d.ts.map +1 -0
- package/dist/branch-execution-types.js +2 -0
- package/dist/branch-execution-types.js.map +1 -0
- package/dist/branch-execution.d.ts +20 -0
- package/dist/branch-execution.d.ts.map +1 -0
- package/dist/branch-execution.js +380 -0
- package/dist/branch-execution.js.map +1 -0
- package/dist/branch-identity.d.ts +71 -0
- package/dist/branch-identity.d.ts.map +1 -0
- package/dist/branch-identity.js +72 -0
- package/dist/branch-identity.js.map +1 -0
- package/dist/branch-materialize.d.ts +33 -0
- package/dist/branch-materialize.d.ts.map +1 -0
- package/dist/branch-materialize.js +64 -0
- package/dist/branch-materialize.js.map +1 -0
- package/dist/branch-page-conversion.d.ts +127 -0
- package/dist/branch-page-conversion.d.ts.map +1 -0
- package/dist/branch-page-conversion.js +382 -0
- package/dist/branch-page-conversion.js.map +1 -0
- package/dist/branch-plan.d.ts +63 -0
- package/dist/branch-plan.d.ts.map +1 -0
- package/dist/branch-plan.js +95 -0
- package/dist/branch-plan.js.map +1 -0
- package/dist/branch-progress.d.ts +99 -0
- package/dist/branch-progress.d.ts.map +1 -0
- package/dist/branch-progress.js +188 -0
- package/dist/branch-progress.js.map +1 -0
- package/dist/branch-run-record.d.ts +164 -0
- package/dist/branch-run-record.d.ts.map +1 -0
- package/dist/branch-run-record.js +94 -0
- package/dist/branch-run-record.js.map +1 -0
- package/dist/branch-schedule.d.ts +74 -0
- package/dist/branch-schedule.d.ts.map +1 -0
- package/dist/branch-schedule.js +130 -0
- package/dist/branch-schedule.js.map +1 -0
- package/dist/branch-status.d.ts +11 -0
- package/dist/branch-status.d.ts.map +1 -0
- package/dist/branch-status.js +118 -0
- package/dist/branch-status.js.map +1 -0
- package/dist/branch-viewport-normalization.d.ts +74 -0
- package/dist/branch-viewport-normalization.d.ts.map +1 -0
- package/dist/branch-viewport-normalization.js +120 -0
- package/dist/branch-viewport-normalization.js.map +1 -0
- package/dist/cli-arguments.d.ts.map +1 -1
- package/dist/cli-arguments.js +5 -0
- package/dist/cli-arguments.js.map +1 -1
- package/dist/cli-branch-command.d.ts +55 -0
- package/dist/cli-branch-command.d.ts.map +1 -0
- package/dist/cli-branch-command.js +475 -0
- package/dist/cli-branch-command.js.map +1 -0
- package/dist/cli-capabilities.d.ts +51 -0
- package/dist/cli-capabilities.d.ts.map +1 -1
- package/dist/cli-capabilities.js +52 -1
- package/dist/cli-capabilities.js.map +1 -1
- package/dist/cli-create-command.d.ts +21 -0
- package/dist/cli-create-command.d.ts.map +1 -0
- package/dist/cli-create-command.js +319 -0
- package/dist/cli-create-command.js.map +1 -0
- package/dist/cli-detach.d.ts +62 -0
- package/dist/cli-detach.d.ts.map +1 -0
- package/dist/cli-detach.js +123 -0
- package/dist/cli-detach.js.map +1 -0
- package/dist/cli-draft-command.d.ts +63 -0
- package/dist/cli-draft-command.d.ts.map +1 -0
- package/dist/cli-draft-command.js +220 -0
- package/dist/cli-draft-command.js.map +1 -0
- package/dist/cli-export-command.d.ts.map +1 -1
- package/dist/cli-export-command.js +2 -3
- package/dist/cli-export-command.js.map +1 -1
- package/dist/cli-image-batch-command.d.ts +21 -0
- package/dist/cli-image-batch-command.d.ts.map +1 -1
- package/dist/cli-image-batch-command.js +65 -4
- package/dist/cli-image-batch-command.js.map +1 -1
- package/dist/cli-image-batch-resume.d.ts +7 -0
- package/dist/cli-image-batch-resume.d.ts.map +1 -1
- package/dist/cli-image-batch-resume.js +19 -2
- package/dist/cli-image-batch-resume.js.map +1 -1
- package/dist/cli-package-command.d.ts +29 -0
- package/dist/cli-package-command.d.ts.map +1 -0
- package/dist/cli-package-command.js +128 -0
- package/dist/cli-package-command.js.map +1 -0
- package/dist/cli-progress.d.ts +137 -0
- package/dist/cli-progress.d.ts.map +1 -1
- package/dist/cli-progress.js +156 -0
- package/dist/cli-progress.js.map +1 -1
- package/dist/cli-select-command.d.ts +12 -0
- package/dist/cli-select-command.d.ts.map +1 -0
- package/dist/cli-select-command.js +66 -0
- package/dist/cli-select-command.js.map +1 -0
- package/dist/cli.js +150 -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/create-identity.d.ts +25 -0
- package/dist/create-identity.d.ts.map +1 -0
- package/dist/create-identity.js +0 -0
- package/dist/create-identity.js.map +1 -0
- package/dist/draft-identity.d.ts +30 -0
- package/dist/draft-identity.d.ts.map +1 -0
- package/dist/draft-identity.js +0 -0
- package/dist/draft-identity.js.map +1 -0
- package/dist/draft-prompts.d.ts +35 -0
- package/dist/draft-prompts.d.ts.map +1 -0
- package/dist/draft-prompts.js +51 -0
- package/dist/draft-prompts.js.map +1 -0
- package/dist/draft-run.d.ts +32 -0
- package/dist/draft-run.d.ts.map +1 -0
- package/dist/draft-run.js +152 -0
- package/dist/draft-run.js.map +1 -0
- package/dist/draft-workspace.d.ts +90 -0
- package/dist/draft-workspace.d.ts.map +1 -0
- package/dist/draft-workspace.js +64 -0
- package/dist/draft-workspace.js.map +1 -0
- package/dist/image-batch-status.d.ts +42 -0
- package/dist/image-batch-status.d.ts.map +1 -0
- package/dist/image-batch-status.js +142 -0
- package/dist/image-batch-status.js.map +1 -0
- package/dist/image-dimensions.d.ts +12 -0
- package/dist/image-dimensions.d.ts.map +1 -0
- package/dist/image-dimensions.js +14 -0
- package/dist/image-dimensions.js.map +1 -0
- package/dist/image-generation-resume.d.ts +13 -0
- package/dist/image-generation-resume.d.ts.map +1 -1
- package/dist/image-generation-resume.js +13 -0
- package/dist/image-generation-resume.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy-skill-catalog.d.ts.map +1 -1
- package/dist/legacy-skill-catalog.js +140 -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-manifest-file.d.ts +21 -0
- package/dist/package-manifest-file.d.ts.map +1 -0
- package/dist/package-manifest-file.js +119 -0
- package/dist/package-manifest-file.js.map +1 -0
- package/dist/package-manifest-template.d.ts +23 -0
- package/dist/package-manifest-template.d.ts.map +1 -0
- package/dist/package-manifest-template.js +60 -0
- package/dist/package-manifest-template.js.map +1 -0
- package/dist/package-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 +134 -0
- package/dist/package-submission.d.ts.map +1 -0
- package/dist/package-submission.js +196 -0
- package/dist/package-submission.js.map +1 -0
- package/dist/selection-record.d.ts +95 -0
- package/dist/selection-record.d.ts.map +1 -0
- package/dist/selection-record.js +121 -0
- package/dist/selection-record.js.map +1 -0
- package/package.json +1 -1
- package/skills/design/SKILL.md +43 -266
- package/skills/design-branch/SKILL.md +37 -116
- package/skills/design-convert/SKILL.md +62 -148
- package/skills/design-draft/SKILL.md +71 -135
- package/skills/design-search/SKILL.md +29 -78
- package/skills/design/references/continuation-contract.md +0 -60
- package/skills/design/references/selection-contract.md +0 -112
|
@@ -1,152 +1,66 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: design-convert
|
|
3
|
-
description: "
|
|
3
|
+
description: "Required to turn a finished PNG, JPEG, or WebP design into
|
|
4
|
+
production output: converts it once into a structured LayerDoc, then derives
|
|
5
|
+
responsive HTML, web or native app code, PDF, PSD, PPTX, Sketch, SVG, PNG,
|
|
6
|
+
JPEG, or WebP from that one conversion."
|
|
4
7
|
---
|
|
5
8
|
|
|
6
|
-
# Design
|
|
7
|
-
|
|
8
|
-
Convert one finished image once, keep its base LayerDoc conversion, and
|
|
9
|
-
every required format from that structured source
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
retry only the export, with `12ui export <source-conversion-id> --output html`.
|
|
65
|
-
|
|
66
|
-
Use `--export html` whenever responsive HTML is wanted. Use the plain form when
|
|
67
|
-
it is not: the fused form buys a responsive export every time.
|
|
68
|
-
|
|
69
|
-
### The exported page is the deliverable
|
|
70
|
-
|
|
71
|
-
The responsive HTML is the page, not a bag of parts. Adopt it by default: keep
|
|
72
|
-
its document, structure, classes, and anchor bindings, and build the surface by
|
|
73
|
-
adapting and composing that document — wire routing, real copy, state, and
|
|
74
|
-
interactions into it, wrap it as a section when the target page is larger than
|
|
75
|
-
the converted screen, and extend its visual system into anything it does not
|
|
76
|
-
cover.
|
|
77
|
-
|
|
78
|
-
Do not mine it for assets and re-author the markup around them. That discards
|
|
79
|
-
the converted design and lands the page back on the generic defaults the
|
|
80
|
-
conversion was bought to avoid. When something in the export is wrong, fix it in
|
|
81
|
-
the export's own markup. Rebuild from scratch only when the export cannot carry
|
|
82
|
-
the surface at all, and say so explicitly in the report when you do.
|
|
83
|
-
|
|
84
|
-
Preserve the source conversion ID, LayerDoc, assets, manifest, and stdout. For
|
|
85
|
-
a detached create, capture its ID and resume that same operation:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
12ui convert <source-image> \
|
|
89
|
-
--output layerdoc \
|
|
90
|
-
--model standard \
|
|
91
|
-
--width <intended-css-width> \
|
|
92
|
-
--idempotency-key <stable-key> \
|
|
93
|
-
--detach | tee <run-dir>/base-operation.json
|
|
94
|
-
|
|
95
|
-
12ui resume <conversion-id> \
|
|
96
|
-
--output layerdoc \
|
|
97
|
-
--out <run-dir>/base.layerdoc.json
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
If create emitted an ID, resume it. If it failed before emitting one, repeat
|
|
101
|
-
the exact request with the same idempotency key.
|
|
102
|
-
|
|
103
|
-
## Export from the base conversion
|
|
104
|
-
|
|
105
|
-
Use one command with comma-separated outputs. The CLI starts independent
|
|
106
|
-
exports in parallel without repeating image extraction. Every format except
|
|
107
|
-
`html` is fast (seconds to about a minute); `html` is responsive HTML and takes
|
|
108
|
-
about **4 minutes** on its own, which is why it is worth folding into the
|
|
109
|
-
convert command above when it is needed at all.
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
12ui export <source-conversion-id> \
|
|
113
|
-
--output html,html_fixed,svg,png,jpg,webp,pdf,psd,pptx,sketch \
|
|
114
|
-
--out-dir <run-dir>/exports \
|
|
115
|
-
--idempotency-key <stable-export-key>
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Request only needed outputs. The identifiers are `html`, `html_fixed`, `svg`,
|
|
119
|
-
`png`, `jpg`, `webp`, `pdf`, `psd`, `pptx`, `sketch`, `web_project`, and
|
|
120
|
-
`app_project`.
|
|
121
|
-
|
|
122
|
-
Project outputs require an exact profile appropriate to the inspected target:
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
12ui export <source-conversion-id> \
|
|
126
|
-
--output web_project,app_project \
|
|
127
|
-
--web-profile '{"version":1,"framework":"react","styling":"tailwind","language":"typescript","packaging":"page"}' \
|
|
128
|
-
--app-profile '{"version":1,"framework":"expo","styling":"native","language":"typescript","packaging":"screen"}' \
|
|
129
|
-
--out-dir <run-dir>/projects \
|
|
130
|
-
--idempotency-key <stable-project-export-key>
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Do not guess or change a profile after dispatch. The CLI refuses destination
|
|
134
|
-
collisions before sending API requests; preserve existing evidence rather than
|
|
135
|
-
deleting it to force another run.
|
|
136
|
-
|
|
137
|
-
## Integrate and verify
|
|
138
|
-
|
|
139
|
-
Inspect generated files and dependencies before merging the smallest coherent
|
|
140
|
-
set into the target. Preserve project routing, tokens, components,
|
|
141
|
-
accessibility, dependency policy, and unrelated changes; remove duplicate
|
|
142
|
-
generated scaffolding. The exported document goes in as the page; the
|
|
143
|
-
integration work is adapting it to the project, not replacing it.
|
|
144
|
-
|
|
145
|
-
Run focused checks in parallel when they do not contend for outputs. Launch
|
|
146
|
-
web/native examples, exercise interactions, and compare source and responsive
|
|
147
|
-
viewports. Open or render document/design exports and inspect structure,
|
|
148
|
-
dimensions, assets, and visible fidelity. Preserve conversion IDs and evidence
|
|
149
|
-
for any defect.
|
|
150
|
-
|
|
151
|
-
Report the source hash, base conversion ID and assets, each export ID/profile,
|
|
152
|
-
integrated files, launches, checks, and remaining visible differences.
|
|
9
|
+
# Design convert
|
|
10
|
+
|
|
11
|
+
Convert one finished image once, keep its base LayerDoc conversion, and
|
|
12
|
+
derive every required format from that structured source — near-pixel
|
|
13
|
+
fidelity, faster and truer than recreating the design by hand.
|
|
14
|
+
|
|
15
|
+
## 1. Convert
|
|
16
|
+
|
|
17
|
+
12ui convert <source-image> --export html
|
|
18
|
+
|
|
19
|
+
Converts the image to a LayerDoc and exports responsive HTML alongside it in
|
|
20
|
+
one blocking command (~5 minutes, progress streamed to stderr; ~4 minutes
|
|
21
|
+
without `--export html`). `--model fast|standard|pro` and
|
|
22
|
+
`--width <intended-css-px>` steer the conversion; `--out` and `--export-out`
|
|
23
|
+
place the artifacts. The result JSON carries the conversion under `id` and
|
|
24
|
+
the export under `export.id`. If the export half fails, the LayerDoc is
|
|
25
|
+
still written — retry only the export with
|
|
26
|
+
`12ui export <id> --output html`.
|
|
27
|
+
|
|
28
|
+
## 2. Export more formats
|
|
29
|
+
|
|
30
|
+
12ui export <conversion-id> --output html_fixed,svg,pdf \
|
|
31
|
+
--out-dir <dir> --idempotency-key <stable-key>
|
|
32
|
+
|
|
33
|
+
Derives further formats from the finished conversion without repeating
|
|
34
|
+
extraction; independent exports run in parallel, and every format except
|
|
35
|
+
`html` takes seconds to about a minute. Outputs: `html`, `html_fixed`,
|
|
36
|
+
`svg`, `png`, `jpg`, `webp`, `pdf`, `psd`, `pptx`, `sketch`, `web_project`,
|
|
37
|
+
`app_project`. Reusing the same key replays a finished export instead of
|
|
38
|
+
buying it again. Project outputs take a profile matching the target project:
|
|
39
|
+
|
|
40
|
+
--web-profile '{"version":1,"framework":"react","styling":"tailwind","language":"typescript","packaging":"page"}'
|
|
41
|
+
--app-profile '{"version":1,"framework":"expo","styling":"native","language":"typescript","packaging":"screen"}'
|
|
42
|
+
|
|
43
|
+
## 3. One page, one package
|
|
44
|
+
|
|
45
|
+
Ordered viewports of one continuous page are one package conversion, not one
|
|
46
|
+
convert per image — separate conversions lose page order and stitching:
|
|
47
|
+
|
|
48
|
+
12ui convert package --manifest <package.json> --out-dir <dir>
|
|
49
|
+
|
|
50
|
+
The manifest names each page and its ordered viewport images, with paths
|
|
51
|
+
relative to the manifest; independent routes are separate page entries:
|
|
52
|
+
|
|
53
|
+
{ "version": 1, "output": "html", "pages": [
|
|
54
|
+
{ "id": "home", "viewports": [
|
|
55
|
+
{ "id": "a", "image": "screens/a.png" },
|
|
56
|
+
{ "id": "b", "image": "screens/b.png" } ] } ] }
|
|
57
|
+
|
|
58
|
+
Runs ~5-8 minutes, writing `<out-dir>/<page-id>.html` per page plus
|
|
59
|
+
`package.result.json`. A viewport may carry `"sourceConversionId": "<id>"`
|
|
60
|
+
to reuse an already succeeded conversion of the same bytes for free.
|
|
61
|
+
|
|
62
|
+
## 4. Integrate
|
|
63
|
+
|
|
64
|
+
The exported HTML is the page: keep its document, structure, and bindings,
|
|
65
|
+
and build the surface around it — routing, real copy, state, interactions —
|
|
66
|
+
rather than mining it for assets and re-authoring the markup around them.
|
|
@@ -1,139 +1,75 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: design-draft
|
|
3
|
-
description: "
|
|
3
|
+
description: "Required to draft candidate interface designs through the
|
|
4
|
+
hosted create API when a run needs more slots or per-slot control than
|
|
5
|
+
`12ui draft` exposes: claims an idempotent run from a written brief,
|
|
6
|
+
generates one candidate per slot, and downloads the images."
|
|
4
7
|
---
|
|
5
8
|
|
|
6
|
-
# Design
|
|
7
|
-
|
|
8
|
-
Buy one small set of candidate designs
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
seven days
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
count changed too; either way keep the original request rather than editing a
|
|
74
|
-
claim. Mint a new key only when the reply says to start a new run, which a
|
|
75
|
-
poisoned claim such as `502 create_directions_failed` or
|
|
76
|
-
`409 run_setup_incomplete` does say.
|
|
77
|
-
|
|
78
|
-
## Dispatch the candidates
|
|
79
|
-
|
|
80
|
-
Each slot is one provider call and one paid image. Dispatch all slots
|
|
81
|
-
concurrently; every request blocks until its own image settles.
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
curl -sS -X POST "$ORIGIN/api/v1/create/<run-id>/candidates/a" \
|
|
85
|
-
-H "Authorization: Bearer $TWELVE_UI_API_KEY" \
|
|
86
|
-
-H 'content-length: 0'
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Send no `Idempotency-Key` on dispatch: an unkeyed repeat replays the durable
|
|
90
|
-
result for free. A new key on a settled slot buys another image for that slot,
|
|
91
|
-
so use it only when the user asks for a fresh attempt. `409 candidate_in_flight`
|
|
92
|
-
means another caller already holds the slot — wait a few seconds and read the
|
|
93
|
-
run instead of dispatching again.
|
|
94
|
-
|
|
95
|
-
## Poll and download
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
curl -sS "$ORIGIN/api/v1/create/<run-id>" \
|
|
99
|
-
-H "Authorization: Bearer $TWELVE_UI_API_KEY" | tee <run-dir>/status.json
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
There is no run-level status or percentage: count candidate `status` values,
|
|
103
|
-
which are `pending`, `dispatched`, `succeeded`, and `failed`. A `failed`
|
|
104
|
-
candidate is a settled, paid outcome — `content_policy`, `provider_timeout`,
|
|
105
|
-
`provider_error`, or `reference_unavailable` — not a transient error to retry.
|
|
106
|
-
|
|
107
|
-
A succeeded candidate carries a relative `image` path. It is owner
|
|
108
|
-
authenticated rather than signed, so download it with the same headers:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
curl -sS "$ORIGIN/api/v1/create/<run-id>/candidates/a/image" \
|
|
112
|
-
-H "Authorization: Bearer $TWELVE_UI_API_KEY" \
|
|
113
|
-
-o <run-dir>/candidates/a.png
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Runs expire seven days after the claim; `410 expired` is terminal.
|
|
117
|
-
|
|
118
|
-
## Quota
|
|
119
|
-
|
|
120
|
-
An account generates 20 images per UTC day and an anonymous caller 12. Overflow
|
|
121
|
-
spills to the prepaid wallet as one billable image per slot. An exhausted
|
|
122
|
-
allowance without a funded wallet is `429 quota_exhausted` with `retry-after`; a
|
|
123
|
-
funded account that cannot cover the overflow is `402 insufficient_funds` with
|
|
124
|
-
`required_micros` and `available_micros`, and no candidate is persisted. Neither
|
|
125
|
-
answer becomes success by resending.
|
|
126
|
-
|
|
127
|
-
## Select and hand off
|
|
128
|
-
|
|
129
|
-
Inspect every downloaded candidate at original detail and choose the best
|
|
130
|
-
direction for the brief, hierarchy, usability, personality, accessibility, and
|
|
131
|
-
ability to extend into later screens. Treat common model palettes as neutral,
|
|
132
|
-
and prefer a repeatable visual system over an impressive one-off hero. Record
|
|
133
|
-
the run ID, slots, directions, references, image hashes, and rejection reasons.
|
|
134
|
-
|
|
135
|
-
- Expand the winner into a multi-screen site or app with `design-branch`, which
|
|
136
|
-
starts from `{ "createRunId": "<run-id>", "slot": "<slot>" }` and never needs
|
|
137
|
-
the bytes.
|
|
138
|
-
- Turn one screen into code or another format with `design-convert` on the
|
|
139
|
-
downloaded PNG.
|
|
9
|
+
# Design draft
|
|
10
|
+
|
|
11
|
+
Buy one small set of candidate designs and keep every one addressable. This
|
|
12
|
+
is the hosted drafting API driven over HTTP — not the local `12ui draft`
|
|
13
|
+
command, which runs a four-candidate version of the same flow in one step —
|
|
14
|
+
so use it when the run needs more slots, per-slot references, or tighter
|
|
15
|
+
direction control.
|
|
16
|
+
|
|
17
|
+
Authenticate every request with `Authorization: Bearer <key>`, a personal
|
|
18
|
+
key from `TWELVE_UI_API_KEY` or `~/.config/12ui/credentials.json` with the
|
|
19
|
+
`design.corpus.retrieve` scope, against `TWELVE_UI_ORIGIN` or
|
|
20
|
+
`https://12ui.com`.
|
|
21
|
+
|
|
22
|
+
## 1. Claim the run
|
|
23
|
+
|
|
24
|
+
curl -sS -X POST "$ORIGIN/api/v1/create" \
|
|
25
|
+
-H "Authorization: Bearer $TWELVE_UI_API_KEY" \
|
|
26
|
+
-H 'content-type: application/json' \
|
|
27
|
+
-H "Idempotency-Key: <stable-run-key>" \
|
|
28
|
+
-d '{
|
|
29
|
+
"concept": "<product, audience, surface, goal, personality>",
|
|
30
|
+
"aspect": "landscape",
|
|
31
|
+
"candidates": [
|
|
32
|
+
{ "slot": "a", "direction": "<short direction>" },
|
|
33
|
+
{ "slot": "b", "direction": "<short direction>",
|
|
34
|
+
"referenceId": "gen-<corpus-id>" }
|
|
35
|
+
]
|
|
36
|
+
}'
|
|
37
|
+
|
|
38
|
+
You choose the concept (at most 600 characters), one aspect for the whole
|
|
39
|
+
run — `landscape` (1536x1024), `portrait` (1024x1536), or `square`
|
|
40
|
+
(1024x1024) — a short direction per slot, meaningfully different across
|
|
41
|
+
slots, and at most one reference per candidate: `referenceId` names a corpus
|
|
42
|
+
reference, or `"useReferenceImage": true` conditions on the one run-level
|
|
43
|
+
`referenceImage` (base64 `data`, `mediaType`, `sha256`). `mode` defaults to
|
|
44
|
+
`inspiration`; `preserve-structure` keeps the reference image's layout. A
|
|
45
|
+
run holds 1-96 candidates in slots `a`-`cr`.
|
|
46
|
+
|
|
47
|
+
`Idempotency-Key` identifies the run: the same key resolves the same run and
|
|
48
|
+
its stored images, so a retry replays instead of buying the work twice. The
|
|
49
|
+
reply is the run envelope with `id` and one entry per slot.
|
|
50
|
+
|
|
51
|
+
## 2. Dispatch the candidates
|
|
52
|
+
|
|
53
|
+
curl -sS -X POST "$ORIGIN/api/v1/create/<run-id>/candidates/a" \
|
|
54
|
+
-H "Authorization: Bearer $TWELVE_UI_API_KEY" \
|
|
55
|
+
-H 'content-length: 0'
|
|
56
|
+
|
|
57
|
+
One call per slot, all slots concurrently; each blocks until its own image
|
|
58
|
+
settles (up to ~2.5 minutes). Send no `Idempotency-Key` here — an unkeyed
|
|
59
|
+
repeat replays a settled slot for free, and a new key buys a fresh image for
|
|
60
|
+
that slot.
|
|
61
|
+
|
|
62
|
+
## 3. Read and download
|
|
63
|
+
|
|
64
|
+
curl -sS "$ORIGIN/api/v1/create/<run-id>" \
|
|
65
|
+
-H "Authorization: Bearer $TWELVE_UI_API_KEY"
|
|
66
|
+
|
|
67
|
+
curl -sS "$ORIGIN/api/v1/create/<run-id>/candidates/a/image" \
|
|
68
|
+
-H "Authorization: Bearer $TWELVE_UI_API_KEY" -o a.png
|
|
69
|
+
|
|
70
|
+
Candidate `status` is `pending`, `dispatched`, `succeeded`, or `failed`; a
|
|
71
|
+
`failed` candidate is a settled, paid outcome, not a transient error. Images
|
|
72
|
+
are owner-authenticated, so download them with the same header. Runs expire
|
|
73
|
+
seven days after the claim. A winning candidate can seed a branch run as
|
|
74
|
+
`12ui branch execute --winner-run <run-id> --winner-slot <slot>` without
|
|
75
|
+
re-uploading its bytes.
|
|
@@ -1,90 +1,41 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: design-search
|
|
3
|
-
description: "
|
|
3
|
+
description: "Required when reference imagery is the deliverable: searches
|
|
4
|
+
the 12ui design corpus from a rough UI, web, or mobile concept and downloads
|
|
5
|
+
a ranked, diverse set of reference images with strong visual quality, sound
|
|
6
|
+
UX, and personality."
|
|
4
7
|
---
|
|
5
8
|
|
|
6
|
-
# Design
|
|
9
|
+
# Design search
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
The corpus has already explored, ranked, and diversified the design space,
|
|
12
|
+
so retrieval returns real reference images in a considered order rather than
|
|
13
|
+
another model's guess. Use it when the references themselves are the
|
|
14
|
+
deliverable — surveying a space, gathering comparators, or conditioning work
|
|
15
|
+
you drive yourself. (`12ui draft` already runs this retrieval when drafting
|
|
16
|
+
designs.)
|
|
11
17
|
|
|
12
|
-
## Search
|
|
18
|
+
## 1. Search
|
|
13
19
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
12ui corpus inspire \
|
|
21
|
+
--query "<product, audience, surface, goal, personality>" \
|
|
22
|
+
--out-dir .12ui/<slug>/references
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
Retrieves four diverse references (`--count <n>`, up to 48), downloads the
|
|
25
|
+
full images into the output directory, and writes `manifest.json` — the
|
|
26
|
+
completion record with the ranked order, reference IDs, and hashes. Blocks
|
|
27
|
+
~20-40 seconds with progress on stderr. Preserve the returned order; the
|
|
28
|
+
ranking is the product.
|
|
19
29
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
30
|
+
`--mode direct|balanced|adventurer` trades literal query adherence against
|
|
31
|
+
exploration; `balanced` is the default. For a redesign,
|
|
32
|
+
`--reference-image <existing-interface.png>` conditions the ranking on the
|
|
33
|
+
current interface: its bytes are embedded once for retrieval, are not
|
|
34
|
+
persisted, and it is not one of the returned references.
|
|
26
35
|
|
|
27
|
-
|
|
36
|
+
## 2. Resume
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
12ui corpus inspire \
|
|
31
|
-
--query "<concise interface concept>" \
|
|
32
|
-
--mode balanced \
|
|
33
|
-
--count <requested-count> \
|
|
34
|
-
--out-dir <references-dir>
|
|
35
|
-
```
|
|
38
|
+
12ui corpus resume --out-dir <references-dir>
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
complete set before changing modes. Use `--mode direct` only when Balanced is
|
|
40
|
-
semantically diffuse or misses the literal requested surface. Use
|
|
41
|
-
`--mode adventurer` only when Balanced is on-brief but too conventional or
|
|
42
|
-
repetitive. Use at most one fallback in a new output directory, and record the
|
|
43
|
-
visible failure that justified it. Do not run all three modes for comparison.
|
|
44
|
-
|
|
45
|
-
Prefer direct `--query`; use `--query-file` only when quoting genuinely
|
|
46
|
-
requires it. Add `--origin` only when the task deliberately targets another
|
|
47
|
-
deployment.
|
|
48
|
-
|
|
49
|
-
For a redesign, distinguish the user's existing interface from corpus
|
|
50
|
-
inspiration. Send that redesign source into retrieval so visual structure can
|
|
51
|
-
condition the ranked space alongside the text:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
12ui corpus inspire \
|
|
55
|
-
--query "<what to preserve, what to change, desired direction>" \
|
|
56
|
-
--mode balanced \
|
|
57
|
-
--reference-image <existing-interface.png> \
|
|
58
|
-
--count 4 \
|
|
59
|
-
--out-dir <references-dir>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
The command accepts one PNG, JPEG, or WebP source, records its absolute path,
|
|
63
|
-
SHA-256, media type, and size locally, and uploads its bytes privately for one
|
|
64
|
-
image-and-text embedding. The source is not one of the returned references and
|
|
65
|
-
its bytes are not persisted by 12UI. If the same source path changes before a
|
|
66
|
-
resume, stop rather than silently searching with different evidence.
|
|
67
|
-
|
|
68
|
-
The command reserves the output directory, records request/response evidence,
|
|
69
|
-
downloads full images in parallel, and writes `manifest.json`. Validate the
|
|
70
|
-
locked mode, count, unique IDs, decodable files, and hashes. Return the exact
|
|
71
|
-
endpoint order and recorded reference evidence. Do not recalculate or reorder
|
|
72
|
-
the result.
|
|
73
|
-
|
|
74
|
-
## Resume
|
|
75
|
-
|
|
76
|
-
For an interrupted or ambiguous attempt, keep its directory and run:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
12ui corpus resume --out-dir <references-dir>
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Reuse a valid completed manifest. Never delete evidence, start a replacement
|
|
83
|
-
request for the unchanged query, or fill missing slots with cached or invented
|
|
84
|
-
references. A transport error, ambiguous request, underfilled set, or download
|
|
85
|
-
failure is not a reason to change modes. If resume remains ambiguous or
|
|
86
|
-
underfilled, report the stable key and evidence path and stop.
|
|
87
|
-
|
|
88
|
-
Hand off the manifest path, idempotency key, set ID, locked mode, ordered IDs,
|
|
89
|
-
image paths, hashes, redesign-source evidence when present, and usage notice. A
|
|
90
|
-
`design` run requires exactly four valid references before generation.
|
|
40
|
+
Continues an interrupted search in the same directory, reusing everything
|
|
41
|
+
already settled instead of repeating the retrieval.
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Continuation evidence contract
|
|
2
|
-
|
|
3
|
-
Write `continuations.json` when the selected first viewport does not cover the
|
|
4
|
-
complete interface. The winner remains the sole reference for every generation.
|
|
5
|
-
|
|
6
|
-
```json
|
|
7
|
-
{
|
|
8
|
-
"version": 1,
|
|
9
|
-
"createdAt": "<ISO-8601>",
|
|
10
|
-
"selectionPath": "<absolute selection.json path>",
|
|
11
|
-
"winner": {
|
|
12
|
-
"id": "A",
|
|
13
|
-
"path": "<absolute winner PNG path>",
|
|
14
|
-
"sha256": "<winner sha256>"
|
|
15
|
-
},
|
|
16
|
-
"baseConversion": {
|
|
17
|
-
"idempotencyKey": "<stable key>",
|
|
18
|
-
"conversionId": "<base LayerDoc conversion id>",
|
|
19
|
-
"resultEvidencePath": "<absolute result evidence path>"
|
|
20
|
-
},
|
|
21
|
-
"generation": {
|
|
22
|
-
"referenceMode": "inspiration",
|
|
23
|
-
"manifestPath": "<absolute batch manifest path>",
|
|
24
|
-
"manifestSha256": "<sha256>",
|
|
25
|
-
"batchAttemptPath": "<absolute batch attempt path>"
|
|
26
|
-
},
|
|
27
|
-
"continuations": [
|
|
28
|
-
{
|
|
29
|
-
"id": "viewport-2",
|
|
30
|
-
"kind": "<continuous-page|web-route|app-state|mobile-screen>",
|
|
31
|
-
"order": 2,
|
|
32
|
-
"prompt": "<semantic content, actions, state, and route purpose only>",
|
|
33
|
-
"promptSha256": "<sha256>",
|
|
34
|
-
"referencePath": "<same winner path>",
|
|
35
|
-
"referenceSha256": "<same winner sha256>",
|
|
36
|
-
"outputPath": "<absolute generated PNG path>",
|
|
37
|
-
"outputSha256": "<sha256>",
|
|
38
|
-
"attemptEvidencePath": "<absolute attempt path>",
|
|
39
|
-
"accepted": true,
|
|
40
|
-
"rejectionReason": null,
|
|
41
|
-
"conversionId": "<accepted image conversion id or null>",
|
|
42
|
-
"conversionEvidencePath": "<absolute evidence path or null>"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"integration": {
|
|
46
|
-
"mode": "<ordered-package|independent-surfaces>",
|
|
47
|
-
"packageEvidencePath": "<absolute package evidence path or null>"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Include 2-16 continuation entries. Every entry must repeat the winner path and
|
|
53
|
-
hash; never substitute a corpus image, composite, prior continuation, or
|
|
54
|
-
predecessor. The default continuation batch uses `inspiration`, because the
|
|
55
|
-
winner supplies a visual system rather than a first-viewport composition to
|
|
56
|
-
clone. If an intentional app-state edit must preserve exact structure, record
|
|
57
|
-
it in a separate `preserve-structure` batch. Preserve rejected generations
|
|
58
|
-
with a visible reason and null conversion fields. For `ordered-package`,
|
|
59
|
-
record the package evidence and keep continuous-page order exact. Never store
|
|
60
|
-
credentials or invent IDs or hashes.
|