@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.
- package/README.md +3 -3
- package/dist/branch-progress.d.ts.map +1 -1
- package/dist/branch-progress.js +4 -1
- package/dist/branch-progress.js.map +1 -1
- package/dist/cli-auth-command.d.ts.map +1 -1
- package/dist/cli-auth-command.js +7 -1
- package/dist/cli-auth-command.js.map +1 -1
- package/dist/cli-branch-command.d.ts +0 -1
- package/dist/cli-branch-command.d.ts.map +1 -1
- package/dist/cli-branch-command.js +16 -41
- package/dist/cli-branch-command.js.map +1 -1
- package/dist/cli-capabilities.d.ts +6 -5
- package/dist/cli-capabilities.d.ts.map +1 -1
- package/dist/cli-capabilities.js +6 -5
- package/dist/cli-capabilities.js.map +1 -1
- package/dist/cli-cli-command.d.ts.map +1 -1
- package/dist/cli-cli-command.js +7 -1
- package/dist/cli-cli-command.js.map +1 -1
- package/dist/cli-convert-command.d.ts +12 -0
- package/dist/cli-convert-command.d.ts.map +1 -1
- package/dist/cli-convert-command.js +115 -18
- package/dist/cli-convert-command.js.map +1 -1
- package/dist/cli-corpus-command.d.ts.map +1 -1
- package/dist/cli-corpus-command.js +7 -6
- package/dist/cli-corpus-command.js.map +1 -1
- package/dist/cli-create-command.d.ts +35 -1
- package/dist/cli-create-command.d.ts.map +1 -1
- package/dist/cli-create-command.js +46 -28
- package/dist/cli-create-command.js.map +1 -1
- package/dist/cli-detach.js +2 -2
- package/dist/cli-detach.js.map +1 -1
- package/dist/cli-draft-command.d.ts +23 -7
- package/dist/cli-draft-command.d.ts.map +1 -1
- package/dist/cli-draft-command.js +39 -12
- package/dist/cli-draft-command.js.map +1 -1
- package/dist/cli-export-command.d.ts.map +1 -1
- package/dist/cli-export-command.js +85 -13
- package/dist/cli-export-command.js.map +1 -1
- package/dist/cli-export-output-directory.d.ts.map +1 -1
- package/dist/cli-export-output-directory.js +3 -2
- package/dist/cli-export-output-directory.js.map +1 -1
- package/dist/cli-image-batch-command.d.ts +0 -6
- package/dist/cli-image-batch-command.d.ts.map +1 -1
- package/dist/cli-image-batch-command.js +7 -15
- package/dist/cli-image-batch-command.js.map +1 -1
- package/dist/cli-image-command.d.ts.map +1 -1
- package/dist/cli-image-command.js +7 -7
- package/dist/cli-image-command.js.map +1 -1
- package/dist/cli-next-command.d.ts +51 -0
- package/dist/cli-next-command.d.ts.map +1 -0
- package/dist/cli-next-command.js +152 -0
- package/dist/cli-next-command.js.map +1 -0
- package/dist/cli-output-paths.d.ts +42 -0
- package/dist/cli-output-paths.d.ts.map +1 -0
- package/dist/cli-output-paths.js +97 -0
- package/dist/cli-output-paths.js.map +1 -0
- package/dist/cli-package-command.d.ts +0 -1
- package/dist/cli-package-command.d.ts.map +1 -1
- package/dist/cli-package-command.js +14 -6
- package/dist/cli-package-command.js.map +1 -1
- package/dist/cli-progress.d.ts +9 -0
- package/dist/cli-progress.d.ts.map +1 -1
- package/dist/cli-progress.js +24 -5
- package/dist/cli-progress.js.map +1 -1
- package/dist/cli-run.d.ts.map +1 -1
- package/dist/cli-run.js +15 -12
- package/dist/cli-run.js.map +1 -1
- package/dist/cli-select-command.d.ts +0 -1
- package/dist/cli-select-command.d.ts.map +1 -1
- package/dist/cli-select-command.js +25 -35
- package/dist/cli-select-command.js.map +1 -1
- package/dist/cli-skill-command.d.ts.map +1 -1
- package/dist/cli-skill-command.js +7 -2
- package/dist/cli-skill-command.js.map +1 -1
- package/dist/cli-usage.d.ts +69 -2
- package/dist/cli-usage.d.ts.map +1 -1
- package/dist/cli-usage.js +119 -37
- package/dist/cli-usage.js.map +1 -1
- package/dist/conversion-status-contract.d.ts +50 -0
- package/dist/conversion-status-contract.d.ts.map +1 -0
- package/dist/conversion-status-contract.js +46 -0
- package/dist/conversion-status-contract.js.map +1 -0
- package/dist/image-batch-status.d.ts +1 -1
- package/dist/image-batch-status.d.ts.map +1 -1
- package/dist/image-batch-status.js +2 -1
- package/dist/image-batch-status.js.map +1 -1
- package/dist/image-generation-request.d.ts.map +1 -1
- package/dist/image-generation-request.js +3 -2
- package/dist/image-generation-request.js.map +1 -1
- package/dist/legacy-skill-catalog.d.ts.map +1 -1
- package/dist/legacy-skill-catalog.js +84 -0
- package/dist/legacy-skill-catalog.js.map +1 -1
- package/dist/mcp-convert.d.ts +32 -0
- package/dist/mcp-convert.d.ts.map +1 -0
- package/dist/mcp-convert.js +118 -0
- package/dist/mcp-convert.js.map +1 -0
- package/dist/next-target.d.ts +56 -0
- package/dist/next-target.d.ts.map +1 -0
- package/dist/next-target.js +72 -0
- package/dist/next-target.js.map +1 -0
- package/dist/run-journal-commands.d.ts +10 -0
- package/dist/run-journal-commands.d.ts.map +1 -1
- package/dist/run-journal-commands.js +35 -26
- package/dist/run-journal-commands.js.map +1 -1
- package/dist/selection-record.d.ts +7 -5
- package/dist/selection-record.d.ts.map +1 -1
- package/dist/selection-record.js +21 -4
- package/dist/selection-record.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +7 -76
- package/dist/server.js.map +1 -1
- package/package.json +9 -1
- package/skills/design/SKILL.md +9 -8
- package/skills/design-branch/SKILL.md +16 -16
- package/skills/design-convert/SKILL.md +14 -15
- package/skills/design-draft/SKILL.md +31 -65
- 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
|
|
5
|
-
import
|
|
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,
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
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
|
|
88
|
-
|
|
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 {
|
package/dist/server.js.map
CHANGED
|
@@ -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,
|
|
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,MAAM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I,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAChF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzF,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,qBAAqB,GAAG,KAAK,IAAqB,EAAE;IACxD,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;IAChF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA0B,CAAC;IACxD,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,IAAI,CAAC,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.
|
|
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
|
}
|
package/skills/design/SKILL.md
CHANGED
|
@@ -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
|
|
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.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
39
|
+
12ui next <run-dir>
|
|
39
40
|
|
|
40
|
-
Execute returns immediately
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
21
|
-
|
|
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
|
|
35
|
-
`
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
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
|
-
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.
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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,
|