@12ui/design 0.2.19 → 0.2.21

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.
Files changed (117) hide show
  1. package/README.md +3 -3
  2. package/dist/branch-progress.d.ts.map +1 -1
  3. package/dist/branch-progress.js +4 -1
  4. package/dist/branch-progress.js.map +1 -1
  5. package/dist/cli-auth-command.d.ts.map +1 -1
  6. package/dist/cli-auth-command.js +7 -1
  7. package/dist/cli-auth-command.js.map +1 -1
  8. package/dist/cli-branch-command.d.ts +0 -1
  9. package/dist/cli-branch-command.d.ts.map +1 -1
  10. package/dist/cli-branch-command.js +16 -41
  11. package/dist/cli-branch-command.js.map +1 -1
  12. package/dist/cli-capabilities.d.ts +6 -5
  13. package/dist/cli-capabilities.d.ts.map +1 -1
  14. package/dist/cli-capabilities.js +6 -5
  15. package/dist/cli-capabilities.js.map +1 -1
  16. package/dist/cli-cli-command.d.ts.map +1 -1
  17. package/dist/cli-cli-command.js +7 -1
  18. package/dist/cli-cli-command.js.map +1 -1
  19. package/dist/cli-convert-command.d.ts +12 -0
  20. package/dist/cli-convert-command.d.ts.map +1 -1
  21. package/dist/cli-convert-command.js +115 -18
  22. package/dist/cli-convert-command.js.map +1 -1
  23. package/dist/cli-corpus-command.d.ts.map +1 -1
  24. package/dist/cli-corpus-command.js +7 -6
  25. package/dist/cli-corpus-command.js.map +1 -1
  26. package/dist/cli-create-command.d.ts +35 -1
  27. package/dist/cli-create-command.d.ts.map +1 -1
  28. package/dist/cli-create-command.js +46 -28
  29. package/dist/cli-create-command.js.map +1 -1
  30. package/dist/cli-detach.js +2 -2
  31. package/dist/cli-detach.js.map +1 -1
  32. package/dist/cli-draft-command.d.ts +23 -7
  33. package/dist/cli-draft-command.d.ts.map +1 -1
  34. package/dist/cli-draft-command.js +39 -12
  35. package/dist/cli-draft-command.js.map +1 -1
  36. package/dist/cli-export-command.d.ts.map +1 -1
  37. package/dist/cli-export-command.js +85 -13
  38. package/dist/cli-export-command.js.map +1 -1
  39. package/dist/cli-export-output-directory.d.ts.map +1 -1
  40. package/dist/cli-export-output-directory.js +3 -2
  41. package/dist/cli-export-output-directory.js.map +1 -1
  42. package/dist/cli-image-batch-command.d.ts +0 -6
  43. package/dist/cli-image-batch-command.d.ts.map +1 -1
  44. package/dist/cli-image-batch-command.js +7 -15
  45. package/dist/cli-image-batch-command.js.map +1 -1
  46. package/dist/cli-image-command.d.ts.map +1 -1
  47. package/dist/cli-image-command.js +7 -7
  48. package/dist/cli-image-command.js.map +1 -1
  49. package/dist/cli-next-command.d.ts +51 -0
  50. package/dist/cli-next-command.d.ts.map +1 -0
  51. package/dist/cli-next-command.js +152 -0
  52. package/dist/cli-next-command.js.map +1 -0
  53. package/dist/cli-output-paths.d.ts +42 -0
  54. package/dist/cli-output-paths.d.ts.map +1 -0
  55. package/dist/cli-output-paths.js +97 -0
  56. package/dist/cli-output-paths.js.map +1 -0
  57. package/dist/cli-package-command.d.ts +0 -1
  58. package/dist/cli-package-command.d.ts.map +1 -1
  59. package/dist/cli-package-command.js +14 -6
  60. package/dist/cli-package-command.js.map +1 -1
  61. package/dist/cli-progress.d.ts +9 -0
  62. package/dist/cli-progress.d.ts.map +1 -1
  63. package/dist/cli-progress.js +24 -5
  64. package/dist/cli-progress.js.map +1 -1
  65. package/dist/cli-run.d.ts.map +1 -1
  66. package/dist/cli-run.js +15 -12
  67. package/dist/cli-run.js.map +1 -1
  68. package/dist/cli-select-command.d.ts +0 -1
  69. package/dist/cli-select-command.d.ts.map +1 -1
  70. package/dist/cli-select-command.js +25 -35
  71. package/dist/cli-select-command.js.map +1 -1
  72. package/dist/cli-skill-command.d.ts.map +1 -1
  73. package/dist/cli-skill-command.js +7 -2
  74. package/dist/cli-skill-command.js.map +1 -1
  75. package/dist/cli-usage.d.ts +69 -2
  76. package/dist/cli-usage.d.ts.map +1 -1
  77. package/dist/cli-usage.js +119 -37
  78. package/dist/cli-usage.js.map +1 -1
  79. package/dist/conversion-status-contract.d.ts +50 -0
  80. package/dist/conversion-status-contract.d.ts.map +1 -0
  81. package/dist/conversion-status-contract.js +46 -0
  82. package/dist/conversion-status-contract.js.map +1 -0
  83. package/dist/image-batch-status.d.ts +1 -1
  84. package/dist/image-batch-status.d.ts.map +1 -1
  85. package/dist/image-batch-status.js +2 -1
  86. package/dist/image-batch-status.js.map +1 -1
  87. package/dist/image-generation-request.d.ts.map +1 -1
  88. package/dist/image-generation-request.js +3 -2
  89. package/dist/image-generation-request.js.map +1 -1
  90. package/dist/legacy-skill-catalog.d.ts.map +1 -1
  91. package/dist/legacy-skill-catalog.js +84 -0
  92. package/dist/legacy-skill-catalog.js.map +1 -1
  93. package/dist/mcp-convert.d.ts +32 -0
  94. package/dist/mcp-convert.d.ts.map +1 -0
  95. package/dist/mcp-convert.js +118 -0
  96. package/dist/mcp-convert.js.map +1 -0
  97. package/dist/next-target.d.ts +56 -0
  98. package/dist/next-target.d.ts.map +1 -0
  99. package/dist/next-target.js +72 -0
  100. package/dist/next-target.js.map +1 -0
  101. package/dist/run-journal-commands.d.ts +10 -0
  102. package/dist/run-journal-commands.d.ts.map +1 -1
  103. package/dist/run-journal-commands.js +35 -26
  104. package/dist/run-journal-commands.js.map +1 -1
  105. package/dist/selection-record.d.ts +7 -5
  106. package/dist/selection-record.d.ts.map +1 -1
  107. package/dist/selection-record.js +21 -4
  108. package/dist/selection-record.js.map +1 -1
  109. package/dist/server.d.ts.map +1 -1
  110. package/dist/server.js +7 -76
  111. package/dist/server.js.map +1 -1
  112. package/package.json +9 -1
  113. package/skills/design/SKILL.md +9 -8
  114. package/skills/design-branch/SKILL.md +16 -16
  115. package/skills/design-convert/SKILL.md +14 -15
  116. package/skills/design-draft/SKILL.md +31 -65
  117. package/skills/design-search/SKILL.md +8 -7
package/dist/server.js CHANGED
@@ -1,15 +1,12 @@
1
1
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
2
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
3
  import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
4
- import { readFile, writeFile } from 'node:fs/promises';
5
- import path from 'node:path';
6
- import { materializeConversionArtifacts } from './artifact-materializer.js';
7
- import { CONVERSION_MODELS, isConversionModel } from './conversion-models.js';
4
+ import { readFile } from 'node:fs/promises';
5
+ import { CONVERSION_MODELS } from './conversion-models.js';
8
6
  import { TwelveUiConversionClient } from './conversion-client.js';
9
- import { CONVERSION_OUTPUTS, LAYERDOC_INPUT_OUTPUTS, isConversionOutput, } from './conversion-outputs.js';
10
- import { createInputForLocalFile, defaultConversionOutputPath, } from './local-conversion-input.js';
11
- import { normalizeOptionalIdempotencyKey } from './idempotency-key.js';
12
- import { APP_PROJECT_FRAMEWORKS, APP_PROJECT_LANGUAGES, APP_PROJECT_PACKAGINGS, APP_PROJECT_STYLINGS, WEB_PROJECT_FRAMEWORKS, WEB_PROJECT_LANGUAGES, WEB_PROJECT_PACKAGINGS, WEB_PROJECT_STYLINGS, isProjectConversionOutput, parseConversionOutputProfile, } from './project-profiles.js';
7
+ import { CONVERSION_OUTPUTS, LAYERDOC_INPUT_OUTPUTS, } from './conversion-outputs.js';
8
+ import { runMcpConvert } from './mcp-convert.js';
9
+ import { APP_PROJECT_FRAMEWORKS, APP_PROJECT_LANGUAGES, APP_PROJECT_PACKAGINGS, APP_PROJECT_STYLINGS, WEB_PROJECT_FRAMEWORKS, WEB_PROJECT_LANGUAGES, WEB_PROJECT_PACKAGINGS, WEB_PROJECT_STYLINGS, } from './project-profiles.js';
13
10
  export async function startMcpServer(options) {
14
11
  const client = new TwelveUiConversionClient({
15
12
  origin: options.config.origin,
@@ -84,74 +81,8 @@ export async function startMcpServer(options) {
84
81
  try {
85
82
  if (request.params.name !== 'design.convert')
86
83
  throw new Error(`Unknown tool: ${request.params.name}`);
87
- const input = (request.params.arguments ?? {});
88
- const imagePath = typeof input.imagePath === 'string' && input.imagePath.trim()
89
- ? input.imagePath
90
- : null;
91
- const layerdocPath = typeof input.layerdocPath === 'string' && input.layerdocPath.trim()
92
- ? input.layerdocPath
93
- : null;
94
- if ((imagePath === null) === (layerdocPath === null)) {
95
- throw new Error('Provide exactly one imagePath or layerdocPath');
96
- }
97
- const inputPath = path.resolve(imagePath ?? layerdocPath);
98
- if (!isConversionOutput(input.output)) {
99
- throw new Error(`output must be one of ${CONVERSION_OUTPUTS.join(', ')}`);
100
- }
101
- const output = input.output;
102
- if (input.model !== undefined && !isConversionModel(input.model)) {
103
- throw new Error(`model must be one of ${CONVERSION_MODELS.join(', ')}`);
104
- }
105
- if (layerdocPath && input.model !== undefined) {
106
- throw new Error('model is only valid with imagePath');
107
- }
108
- const profile = isProjectConversionOutput(output)
109
- ? parseConversionOutputProfile(output, input.profile)
110
- : undefined;
111
- if (!isProjectConversionOutput(output) && input.profile !== undefined) {
112
- throw new Error('profile is only valid for web_project or app_project outputs');
113
- }
114
- const conversionInput = createInputForLocalFile({
115
- bytes: new Uint8Array(await readFile(inputPath)),
116
- filePath: inputPath,
117
- output,
118
- ...(profile ? { profile } : {}),
119
- });
120
- if (layerdocPath && conversionInput.layerdoc === undefined) {
121
- throw new Error('layerdocPath must refer to a JSON file');
122
- }
123
- if (imagePath && conversionInput.layerdoc !== undefined) {
124
- throw new Error('Use layerdocPath for LayerDoc JSON input');
125
- }
126
- const idempotencyKey = normalizeOptionalIdempotencyKey(input.idempotencyKey);
127
- const requestInput = conversionInput.layerdoc !== undefined
128
- ? conversionInput
129
- : {
130
- ...conversionInput,
131
- ...(isConversionModel(input.model) ? { model: input.model } : {}),
132
- };
133
- const operation = await client.createConversion({
134
- ...requestInput,
135
- ...(idempotencyKey ? { idempotencyKey } : {}),
136
- });
137
- const completed = operation.status === 'succeeded'
138
- ? operation
139
- : await client.waitForConversion(operation.id, {
140
- timeoutMs: typeof input.timeoutMs === 'number' ? input.timeoutMs : undefined,
141
- expiresAt: operation.expires_at,
142
- });
143
- const downloaded = await client.downloadResult(completed.id, output);
144
- const outFile = path.resolve(typeof input.outFile === 'string' && input.outFile.trim()
145
- ? input.outFile
146
- : defaultConversionOutputPath(inputPath, output));
147
- await writeFile(outFile, downloaded.bytes);
148
- const artifactManifest = await materializeConversionArtifacts(client, completed, outFile);
149
- return {
150
- content: [{
151
- type: 'text',
152
- text: JSON.stringify({ id: completed.id, output, outFile, artifactManifest }, null, 2),
153
- }],
154
- };
84
+ const result = await runMcpConvert(client, (request.params.arguments ?? {}));
85
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
155
86
  }
156
87
  catch (error) {
157
88
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAA8B,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,GAEnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,EACzB,4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C,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QACjE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@12ui/design",
3
- "version": "0.2.19",
3
+ "version": "0.2.21",
4
4
  "type": "module",
5
5
  "description": "The canonical 12UI CLI, SDK, MCP server, and visual interface design skills",
6
6
  "main": "dist/index.js",
@@ -47,6 +47,14 @@
47
47
  ],
48
48
  "author": "Just Every",
49
49
  "license": "MIT",
50
+ "homepage": "https://12ui.com/",
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/just-every/12ui-plugin.git"
54
+ },
55
+ "bugs": {
56
+ "url": "https://github.com/just-every/12ui-plugin/issues"
57
+ },
50
58
  "engines": {
51
59
  "node": "^22.13.0 || >=24.0.0"
52
60
  }
@@ -7,6 +7,10 @@ description: "Required for non-trivial UI creation and redesign (web, app,
7
7
 
8
8
  # Design
9
9
 
10
+ ## Setup
11
+
12
+ For a public-directory install, run `npx -y @12ui/design skill install --skill design` once. It pins the CLI and verifies this skill's account scopes.
13
+
10
14
  Code-generating models converge on a narrow band of visual defaults — the
11
15
  same fonts, palettes, and layouts across unrelated products — and a model
12
16
  cannot see its own convergence from inside it. This skill escapes that:
@@ -20,13 +24,15 @@ quicker.
20
24
 
21
25
  ## 1. Explore — four directions
22
26
 
27
+ Already holding the finished design? Build it, do not redraw it: see
28
+ `design-convert`. Only to redraw an existing interface:
29
+ `12ui draft --redesign-source <png> --mode exploratory|reskin`.
30
+
23
31
  12ui draft --query "<product, audience, surface, goal, personality>"
24
32
 
25
33
  Creates the run directory and prints its path — pass it to every later
26
34
  command. Searches the corpus for four diverse references and generates one
27
35
  one-viewport candidate steered by each, returning immediately.
28
- `12ui draft status <run-dir>` reports progress (typically ~90s).
29
- Redesigns: `--redesign-source <png> --mode exploratory|reskin`.
30
36
 
31
37
  ## 2. Select
32
38
 
@@ -41,8 +47,6 @@ For a single fold, view, or state:
41
47
 
42
48
  12ui convert <run-dir>/candidates/B.png --export html
43
49
 
44
- Runs ~5 minutes with streamed progress.
45
-
46
50
  For a full page or a multi-page site or app — the winner is viewport 1 of
47
51
  the first page; it needs no separate conversion:
48
52
 
@@ -51,12 +55,9 @@ the first page; it needs no separate conversion:
51
55
  --scope page|site --convert html
52
56
 
53
57
  The server plans the screens; the command dispatches, downloads, and
54
- converts one package per page. Returns immediately;
55
- `12ui branch status <run-dir>` reports progress (typically 5–15 min;
56
- large runs can take up to ~30 min).
58
+ converts one package per page, into `<run-dir>/branch/pages/`.
57
59
  Wait for it rather than building the same pages by hand in the meantime —
58
60
  they are already being produced and paid for.
59
- Per-page HTML lands in `<run-dir>/branch/pages/`.
60
61
 
61
62
  ## 4. Integrate
62
63
 
@@ -8,11 +8,16 @@ description: "Required whenever the deliverable is more than one viewport — a
8
8
 
9
9
  # Design branch
10
10
 
11
+ ## Setup
12
+
13
+ For a public-directory install, run `npx -y @12ui/design skill install --skill design-branch` once. It pins the CLI and verifies this skill's account scopes.
14
+
11
15
  One approved screen fixes the visual system; branching extends it across the
12
16
  rest of the surface with consistent, professional quality instead of
13
17
  re-deriving the design once per screen. The server plans the screens and
14
18
  their dependencies; one command executes the whole plan and keeps every paid
15
- screen addressable, so a retry never repeats paid work.
19
+ screen addressable, so a retry never repeats paid work. Use it whenever the
20
+ deliverable is more than one viewport; a single fold is a plain convert.
16
21
 
17
22
  ## 1. Execute
18
23
 
@@ -23,25 +28,20 @@ screen addressable, so a retry never repeats paid work.
23
28
  The run directory is the one `12ui draft` printed; the starting design is
24
29
  the candidate `12ui select` recorded there. `--scope page` grows that screen
25
30
  into viewports 2..n of its own page; `--scope site` adds sibling routes and
26
- app states as well. The server plans 2-8 screens (`--max-screens` trims the
27
- plan). `--convert html` converts each finished page as one ordered package;
28
- omitting it stops at downloaded PNGs.
29
-
30
- To start from something else, pass a fresh directory plus exactly one of
31
- `--winner-run crt-<id> --winner-slot <slot>` — an earlier hosted candidate,
32
- whose bytes never leave the server — or `--winner-image <file>` with a PNG,
33
- JPEG, or WebP. The starting design is viewport 1 of the first page; it needs
34
- no separate conversion.
31
+ app states as well. `--convert html` converts each finished page as one
32
+ ordered package; omitting it stops at downloaded PNGs. A run with no draft
33
+ behind it takes a fresh directory and names its own starting design — the
34
+ command refuses with both spellings if none is given. Either way the starting
35
+ design is viewport 1 of the first page; it needs no separate conversion.
35
36
 
36
37
  ## 2. Follow
37
38
 
38
- 12ui branch status <run-dir>
39
+ 12ui next <run-dir>
39
40
 
40
- Execute returns immediately and the run continues on its own (typically
41
- 5–15 min, up to ~30 for large runs; add `--wait` to block instead).
42
- Status reports per-screen progress
43
- and the next action. `12ui branch resume <run-dir>` continues an interrupted
44
- run, replaying already-settled screens for free.
41
+ Execute returns immediately; `12ui next` reports progress and the one command
42
+ to run next, and `--wait` blocks instead of polling.
43
+ `12ui branch resume <run-dir>` continues an interrupted run, replaying
44
+ already-settled screens for free.
45
45
 
46
46
  ## 3. Collect
47
47
 
@@ -8,6 +8,10 @@ description: "Required to turn a finished PNG, JPEG, or WebP design into
8
8
 
9
9
  # Design convert
10
10
 
11
+ ## Setup
12
+
13
+ For a public-directory install, run `npx -y @12ui/design skill install --skill design-convert` once. It pins the CLI and verifies this skill's account scopes.
14
+
11
15
  Convert one finished image once, keep its base LayerDoc conversion, and
12
16
  derive every required format from that structured source — near-pixel
13
17
  fidelity, faster and truer than recreating the design by hand.
@@ -17,13 +21,8 @@ fidelity, faster and truer than recreating the design by hand.
17
21
  12ui convert <source-image> --export html
18
22
 
19
23
  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`.
24
+ one blocking command, which is faster than converting and then exporting.
25
+ The result carries the conversion under `id` and the export under `export.id`.
27
26
 
28
27
  ## 2. Export more formats
29
28
 
@@ -31,11 +30,11 @@ still written — retry only the export with
31
30
  --out-dir <dir> --idempotency-key <stable-key>
32
31
 
33
32
  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:
33
+ extraction, and independent exports run in parallel. Outputs: `html`,
34
+ `html_fixed`, `svg`, `png`, `jpg`, `webp`, `pdf`, `psd`, `pptx`, `sketch`,
35
+ `web_project`, `app_project`. Reusing the same key replays a finished export
36
+ instead of buying it again. Project outputs take a profile matching the
37
+ target project:
39
38
 
40
39
  --web-profile '{"version":1,"framework":"react","styling":"tailwind","language":"typescript","packaging":"page"}'
41
40
  --app-profile '{"version":1,"framework":"expo","styling":"native","language":"typescript","packaging":"screen"}'
@@ -55,9 +54,9 @@ relative to the manifest; independent routes are separate page entries:
55
54
  { "id": "a", "image": "screens/a.png" },
56
55
  { "id": "b", "image": "screens/b.png" } ] } ] }
57
56
 
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.
57
+ Writes `<out-dir>/<page-id>.html` per page plus `package.result.json`. A
58
+ viewport may carry `"sourceConversionId": "<id>"` to reuse an already
59
+ succeeded conversion of the same bytes for free.
61
60
 
62
61
  ## 4. Integrate
63
62
 
@@ -8,68 +8,34 @@ description: "Required to draft candidate interface designs through the
8
8
 
9
9
  # Design draft
10
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.
11
+ ## Setup
12
+
13
+ For a public-directory install, run `npx -y @12ui/design skill install --skill design-draft` once. It pins the CLI and verifies this skill's account scopes.
14
+
15
+ Buy one small set of candidate designs and keep every one addressable. Use
16
+ this when the run needs more than the four candidates `12ui draft` produces
17
+ in one step, a corpus reference or direction per slot, or tighter control
18
+ over what each slot explores.
19
+
20
+ 12ui create claim --concept "<product, audience, surface, goal, personality>" \
21
+ --candidates '[{"slot":"a","direction":"<short direction>"},
22
+ {"slot":"b","direction":"<short direction>",
23
+ "referenceId":"gen-<corpus-id>"}]'
24
+ 12ui create dispatch <run-id>
25
+ 12ui create download <run-id> --out-dir <directory>
26
+
27
+ Each command prints the next; `12ui next <run-id>` reports what is still
28
+ generating, and `--wait` blocks until every slot settles.
29
+
30
+ The judgement is the brief and the slots. One aspect covers the whole run —
31
+ `landscape` (1536x1024), `portrait` (1024x1536), `square` (1024x1024) — and
32
+ directions must be meaningfully different from each other, since four
33
+ paraphrases of one idea buy four of the same design. A slot takes at most one
34
+ reference: `referenceId` names a corpus reference, or `"useReferenceImage":
35
+ true` conditions it on the run-level `--reference-image`, whose
36
+ `preserve-structure` mode keeps that image's layout. A run holds 1-96
37
+ candidates in slots `a`-`cr` and expires seven days after the claim.
38
+
39
+ A candidate that comes back `failed` is a settled, paid outcome rather than a
40
+ transient error. A winning candidate seeds a branch run as
41
+ `--winner-run <run-id> --winner-slot <slot>` without re-uploading its bytes.
@@ -8,12 +8,15 @@ description: "Required when reference imagery is the deliverable: searches
8
8
 
9
9
  # Design search
10
10
 
11
+ ## Setup
12
+
13
+ For a public-directory install, run `npx -y @12ui/design skill install --skill design-search` once. It pins the CLI and verifies this skill's account scopes.
14
+
11
15
  The corpus has already explored, ranked, and diversified the design space,
12
16
  so retrieval returns real reference images in a considered order rather than
13
17
  another model's guess. Use it when the references themselves are the
14
18
  deliverable — surveying a space, gathering comparators, or conditioning work
15
- you drive yourself. (`12ui draft` already runs this retrieval when drafting
16
- designs.)
19
+ you drive yourself. `12ui draft` already runs this retrieval when drafting.
17
20
 
18
21
  ## 1. Search
19
22
 
@@ -21,11 +24,9 @@ designs.)
21
24
  --query "<product, audience, surface, goal, personality>" \
22
25
  --out-dir .12ui/<slug>/references
23
26
 
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.
27
+ Downloads the full images into the output directory and writes
28
+ `manifest.json` the completion record with the ranked order, reference IDs,
29
+ and hashes. Preserve the returned order; the ranking is the product.
29
30
 
30
31
  `--mode direct|balanced|adventurer` trades literal query adherence against
31
32
  exploration; `balanced` is the default. For a redesign,