@12ui/design 0.2.73 → 0.2.75

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 (142) hide show
  1. package/SKILL.md +1 -1
  2. package/dist/cli-codex-readiness.d.ts +19 -6
  3. package/dist/cli-codex-readiness.d.ts.map +1 -1
  4. package/dist/cli-codex-readiness.js +36 -16
  5. package/dist/cli-codex-readiness.js.map +1 -1
  6. package/dist/cli-help/design.d.ts +9 -2
  7. package/dist/cli-help/design.d.ts.map +1 -1
  8. package/dist/cli-help/design.js +17 -2
  9. package/dist/cli-help/design.js.map +1 -1
  10. package/dist/cli-help/index.d.ts +9 -2
  11. package/dist/cli-help/index.d.ts.map +1 -1
  12. package/dist/cli-run.d.ts.map +1 -1
  13. package/dist/cli-run.js +6 -0
  14. package/dist/cli-run.js.map +1 -1
  15. package/dist/cli-usage.d.ts.map +1 -1
  16. package/dist/cli-usage.js +1 -0
  17. package/dist/cli-usage.js.map +1 -1
  18. package/dist/cli-workspace-command.js +1 -1
  19. package/dist/cli-workspace-command.js.map +1 -1
  20. package/dist/cli-workspace-draw.d.ts +23 -0
  21. package/dist/cli-workspace-draw.d.ts.map +1 -0
  22. package/dist/cli-workspace-draw.js +97 -0
  23. package/dist/cli-workspace-draw.js.map +1 -0
  24. package/dist/codex-binary.d.ts +20 -0
  25. package/dist/codex-binary.d.ts.map +1 -0
  26. package/dist/codex-binary.js +46 -0
  27. package/dist/codex-binary.js.map +1 -0
  28. package/dist/mcp-slate-command.d.ts.map +1 -1
  29. package/dist/mcp-slate-command.js +6 -1
  30. package/dist/mcp-slate-command.js.map +1 -1
  31. package/dist/mcp-slate-tool-defs.js +3 -3
  32. package/dist/mcp-slate-tool-defs.js.map +1 -1
  33. package/dist/mcp-slate-ui-copy.d.ts +30 -19
  34. package/dist/mcp-slate-ui-copy.d.ts.map +1 -1
  35. package/dist/mcp-slate-ui-copy.js +51 -23
  36. package/dist/mcp-slate-ui-copy.js.map +1 -1
  37. package/dist/mcp-slate-ui-script-dialog.d.ts +15 -14
  38. package/dist/mcp-slate-ui-script-dialog.d.ts.map +1 -1
  39. package/dist/mcp-slate-ui-script-dialog.js +61 -72
  40. package/dist/mcp-slate-ui-script-dialog.js.map +1 -1
  41. package/dist/mcp-slate-ui-script-inline.d.ts.map +1 -1
  42. package/dist/mcp-slate-ui-script-inline.js +9 -6
  43. package/dist/mcp-slate-ui-script-inline.js.map +1 -1
  44. package/dist/mcp-slate-ui-script-inspiration.d.ts +3 -2
  45. package/dist/mcp-slate-ui-script-inspiration.d.ts.map +1 -1
  46. package/dist/mcp-slate-ui-script-inspiration.js +29 -9
  47. package/dist/mcp-slate-ui-script-inspiration.js.map +1 -1
  48. package/dist/mcp-slate-ui-script-more.d.ts +16 -14
  49. package/dist/mcp-slate-ui-script-more.d.ts.map +1 -1
  50. package/dist/mcp-slate-ui-script-more.js +120 -56
  51. package/dist/mcp-slate-ui-script-more.js.map +1 -1
  52. package/dist/mcp-slate-ui-script-remote.d.ts +2 -2
  53. package/dist/mcp-slate-ui-script-remote.js +2 -2
  54. package/dist/mcp-slate-ui-script-scribble.js +1 -1
  55. package/dist/mcp-slate-ui-script-stage.d.ts +3 -2
  56. package/dist/mcp-slate-ui-script-stage.d.ts.map +1 -1
  57. package/dist/mcp-slate-ui-script-stage.js +7 -8
  58. package/dist/mcp-slate-ui-script-stage.js.map +1 -1
  59. package/dist/mcp-slate-ui-script-state.js +3 -3
  60. package/dist/mcp-slate-ui-script.d.ts +1 -2
  61. package/dist/mcp-slate-ui-script.d.ts.map +1 -1
  62. package/dist/mcp-slate-ui-script.js +6 -4
  63. package/dist/mcp-slate-ui-script.js.map +1 -1
  64. package/dist/mcp-slate-ui-styles-dialog.d.ts +12 -9
  65. package/dist/mcp-slate-ui-styles-dialog.d.ts.map +1 -1
  66. package/dist/mcp-slate-ui-styles-dialog.js +48 -26
  67. package/dist/mcp-slate-ui-styles-dialog.js.map +1 -1
  68. package/dist/mcp-slate-ui-styles-stage.d.ts +15 -8
  69. package/dist/mcp-slate-ui-styles-stage.d.ts.map +1 -1
  70. package/dist/mcp-slate-ui-styles-stage.js +32 -18
  71. package/dist/mcp-slate-ui-styles-stage.js.map +1 -1
  72. package/dist/mcp-slate-ui-styles.d.ts +5 -0
  73. package/dist/mcp-slate-ui-styles.d.ts.map +1 -1
  74. package/dist/mcp-slate-ui-styles.js +21 -6
  75. package/dist/mcp-slate-ui-styles.js.map +1 -1
  76. package/dist/mcp-slate-ui.d.ts.map +1 -1
  77. package/dist/mcp-slate-ui.js +4 -3
  78. package/dist/mcp-slate-ui.js.map +1 -1
  79. package/dist/slate-actions.d.ts +7 -2
  80. package/dist/slate-actions.d.ts.map +1 -1
  81. package/dist/slate-actions.js +14 -8
  82. package/dist/slate-actions.js.map +1 -1
  83. package/dist/slate-handoff-options.d.ts +1 -1
  84. package/dist/slate-handoff-options.d.ts.map +1 -1
  85. package/dist/slate-handoff-options.js +8 -18
  86. package/dist/slate-handoff-options.js.map +1 -1
  87. package/dist/slate-image-executor.js +1 -1
  88. package/dist/slate-image-executor.js.map +1 -1
  89. package/dist/slate-inspiration.d.ts +1 -1
  90. package/dist/slate-inspiration.js +1 -1
  91. package/dist/slate-local-image.d.ts +3 -6
  92. package/dist/slate-local-image.d.ts.map +1 -1
  93. package/dist/slate-local-image.js +2 -18
  94. package/dist/slate-local-image.js.map +1 -1
  95. package/dist/slate-view-contract.d.ts +2 -3
  96. package/dist/slate-view-contract.d.ts.map +1 -1
  97. package/dist/slate-workspace-parse.d.ts.map +1 -1
  98. package/dist/slate-workspace-parse.js +6 -1
  99. package/dist/slate-workspace-parse.js.map +1 -1
  100. package/dist/workspace-draw-client.d.ts +69 -0
  101. package/dist/workspace-draw-client.d.ts.map +1 -0
  102. package/dist/workspace-draw-client.js +193 -0
  103. package/dist/workspace-draw-client.js.map +1 -0
  104. package/dist/workspace-draw-codex.d.ts +49 -0
  105. package/dist/workspace-draw-codex.d.ts.map +1 -0
  106. package/dist/workspace-draw-codex.js +89 -0
  107. package/dist/workspace-draw-codex.js.map +1 -0
  108. package/dist/workspace-draw-engine.d.ts +39 -0
  109. package/dist/workspace-draw-engine.d.ts.map +1 -0
  110. package/dist/workspace-draw-engine.js +72 -0
  111. package/dist/workspace-draw-engine.js.map +1 -0
  112. package/dist/workspace-draw-messages.d.ts +45 -0
  113. package/dist/workspace-draw-messages.d.ts.map +1 -0
  114. package/dist/workspace-draw-messages.js +48 -0
  115. package/dist/workspace-draw-messages.js.map +1 -0
  116. package/dist/workspace-draw-run.d.ts +43 -0
  117. package/dist/workspace-draw-run.d.ts.map +1 -0
  118. package/dist/workspace-draw-run.js +328 -0
  119. package/dist/workspace-draw-run.js.map +1 -0
  120. package/dist/workspace-draw-store.d.ts +23 -0
  121. package/dist/workspace-draw-store.d.ts.map +1 -0
  122. package/dist/workspace-draw-store.js +65 -0
  123. package/dist/workspace-draw-store.js.map +1 -0
  124. package/dist/workspace-draw-types.d.ts +121 -0
  125. package/dist/workspace-draw-types.d.ts.map +1 -0
  126. package/dist/workspace-draw-types.js +21 -0
  127. package/dist/workspace-draw-types.js.map +1 -0
  128. package/open-design.json +2 -2
  129. package/package.json +1 -1
  130. package/runtime/codex-conversion/src/codex/home.mjs +43 -14
  131. package/runtime/codex-conversion/src/images/native-files.mjs +20 -0
  132. package/runtime/codex-conversion/src/images/native-invoke.mjs +5 -2
  133. package/runtime/codex-conversion/src/images/native-records.mjs +75 -3
  134. package/runtime/codex-conversion/src/images/native.mjs +7 -4
  135. package/dist/mcp-slate-ui-script-thumbtools.d.ts +0 -23
  136. package/dist/mcp-slate-ui-script-thumbtools.d.ts.map +0 -1
  137. package/dist/mcp-slate-ui-script-thumbtools.js +0 -103
  138. package/dist/mcp-slate-ui-script-thumbtools.js.map +0 -1
  139. package/dist/mcp-slate-ui-styles-thumbtools.d.ts +0 -10
  140. package/dist/mcp-slate-ui-styles-thumbtools.d.ts.map +0 -1
  141. package/dist/mcp-slate-ui-styles-thumbtools.js +0 -25
  142. package/dist/mcp-slate-ui-styles-thumbtools.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-draw-client.js","sourceRoot":"","sources":["../src/workspace-draw-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,WAAW,EAA0C,MAAM,2BAA2B,CAAC;AAEhG;;;;GAIG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAC7B,4GAA4G;AAC5G,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAO,CAAC;AAE7C,4GAA4G;AAC5G,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC7B,MAAM,CAAS;IACf,IAAI,CAAS;IACb,iBAAiB,CAAgB;IACjC,IAAI,CAAU;IACvB,YAAY,MAAc,EAAE,IAAY,EAAE,iBAAgC,EAAE,IAAa;QACvF,KAAK,CAAC,4BAA4B,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,IAAI,CAA0C;IACvD,YAAY,IAA6C,EAAE,OAAe,EAAE,OAA6B;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAcD,MAAM,MAAM,GAAG,CAAC,KAA0B,EAAU,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAA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AAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACxC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,yBAAyB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;YACrH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YAC5E,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ;gBAAE,MAAM,IAAI,kBAAkB,CAAC,WAAW,EAAE,eAAe,GAAG,mBAAmB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACrK,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;gBAC/B,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC;gBACvC,QAAQ,EAAE,IAAI,CAAC,QAAQ,KAAK,IAAI;gBAChC,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC;aACpC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { type SlateImageExecutor } from './slate-image-executor.js';
2
+ import type { DrawOptionCodex, SlatePlanOption } from './workspace-draw-types.js';
3
+ /**
4
+ * The codex engine for one option (design section 6): one native `codex exec` image call through the repo's own
5
+ * executor, in its own temp `CODEX_HOME` linked to the agent's `auth.json`, under the call id the plan names. The
6
+ * executor's call store makes that id durable: a rerun returns a drawn image without a second call, and an id
7
+ * whose call ended without an image answers the same way again, never re-dispatched.
8
+ *
9
+ * After the call this reads the call directory back for the run record: the temp home (and whether it is gone),
10
+ * the rollouts kept in `native-custody/`, how many image calls the nested driver made, and whether the prompt it
11
+ * sent was the plan's prompt byte for byte.
12
+ */
13
+ export type CodexOptionResult = {
14
+ kind: 'drawn';
15
+ png: Buffer;
16
+ reused: boolean;
17
+ details: DrawOptionCodex;
18
+ }
19
+ /** A model-class failure: pushed to the screen with this fixed sentence. */
20
+ | {
21
+ kind: 'failed';
22
+ failure: string;
23
+ details: DrawOptionCodex;
24
+ }
25
+ /** An environment-class failure (signed out, binary gone, store locked): not pushed, so a rerun can fix it. */
26
+ | {
27
+ kind: 'environment';
28
+ error: string;
29
+ details: DrawOptionCodex;
30
+ };
31
+ export type ExecutorFactory = (args: {
32
+ root: string;
33
+ env: NodeJS.ProcessEnv;
34
+ }) => SlateImageExecutor;
35
+ /** The executor's call store keeps one folder per call id at `<root>/calls/<sha256(id)>`. */
36
+ export declare const callDirectoryOf: (root: string, callId: string) => string;
37
+ /** What the call directory says about the call, for the record. */
38
+ export declare const readCallDetails: (callDir: string, prompt: string) => Promise<DrawOptionCodex & {
39
+ receiptState: string | null;
40
+ timedOut: boolean;
41
+ }>;
42
+ export declare const drawOptionWithCodex: (args: {
43
+ root: string;
44
+ env: NodeJS.ProcessEnv;
45
+ option: SlatePlanOption;
46
+ images: Buffer[];
47
+ executorFactory?: ExecutorFactory;
48
+ }) => Promise<CodexOptionResult>;
49
+ //# sourceMappingURL=workspace-draw-codex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-draw-codex.d.ts","sourceRoot":"","sources":["../src/workspace-draw-codex.ts"],"names":[],"mappings":"AAKA,OAAO,EAA6B,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/F,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAElF;;;;;;;;;GASG;AAEH,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE;AAC3E,4EAA4E;GAC1E;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE;AAC/D,+GAA+G;GAC7G;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAAC;AAErE,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,KAAK,kBAAkB,CAAC;AAIrG,6FAA6F;AAC7F,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,MAAkD,CAAC;AAWlH,mEAAmE;AACnE,eAAO,MAAM,eAAe,GAAU,SAAS,MAAM,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,eAAe,GAAG;IAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAgCnJ,CAAC;AAQF,eAAO,MAAM,mBAAmB,GAAU,MAAM;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,KAAG,OAAO,CAAC,iBAAiB,CAsB5B,CAAC"}
@@ -0,0 +1,89 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { existsSync } from 'node:fs';
3
+ import { readdir, readFile } from 'node:fs/promises';
4
+ import path from 'node:path';
5
+ import { createNativeImageExecutor } from './slate-image-executor.js';
6
+ import { OPTION_FAILURES } from './workspace-draw-messages.js';
7
+ const sha256 = (value) => createHash('sha256').update(value).digest('hex');
8
+ /** The executor's call store keeps one folder per call id at `<root>/calls/<sha256(id)>`. */
9
+ export const callDirectoryOf = (root, callId) => path.join(root, 'calls', sha256(callId));
10
+ const readJson = async (file) => {
11
+ try {
12
+ return JSON.parse(await readFile(file, 'utf8'));
13
+ }
14
+ catch (error) {
15
+ if (error.code === 'ENOENT')
16
+ return null;
17
+ throw error;
18
+ }
19
+ };
20
+ /** What the call directory says about the call, for the record. */
21
+ export const readCallDetails = async (callDir, prompt) => {
22
+ const [state, receipt, completion] = await Promise.all([
23
+ readJson(path.join(callDir, 'state.json')),
24
+ readJson(path.join(callDir, 'native-custody', 'receipt.json')),
25
+ readJson(path.join(callDir, 'completion.json')),
26
+ ]);
27
+ const tempHome = typeof state?.metadata?.home === 'string' ? state.metadata.home : '';
28
+ let rollouts = [];
29
+ try {
30
+ rollouts = (await readdir(path.join(callDir, 'native-custody')))
31
+ .filter((name) => /^rollout-.*\.jsonl$/u.test(name))
32
+ .sort()
33
+ .map((name) => path.join(callDir, 'native-custody', name));
34
+ }
35
+ catch (error) {
36
+ if (error.code !== 'ENOENT')
37
+ throw error;
38
+ }
39
+ const calls = Array.isArray(receipt?.calls) ? receipt.calls : [];
40
+ const literals = calls.flatMap((call) => call.prompts ?? [null]);
41
+ const generations = Array.isArray(receipt?.generations) ? receipt.generations : [];
42
+ const revised = generations[0]?.revisedPrompt;
43
+ return {
44
+ callDir,
45
+ tempHome,
46
+ tempHomeRemoved: tempHome !== '' && !existsSync(tempHome),
47
+ rollouts,
48
+ imageGenCalls: typeof receipt?.invocationCount === 'number' ? receipt.invocationCount : 0,
49
+ // Measured, never assumed: true only when exactly one call's literal is the plan prompt byte for byte.
50
+ promptVerbatim: literals.length === 1 && literals[0] !== null && literals[0] !== undefined ? literals[0] === prompt : null,
51
+ revisedPrompt: typeof revised === 'string' ? revised : null,
52
+ receiptState: typeof receipt?.state === 'string' ? receipt.state : null,
53
+ timedOut: completion?.timedOut === true,
54
+ };
55
+ };
56
+ const failureSentence = (details) => {
57
+ if (details.timedOut)
58
+ return OPTION_FAILURES.timeout;
59
+ if (details.receiptState === 'protocol-violation-multiple-calls')
60
+ return OPTION_FAILURES.protocol;
61
+ return OPTION_FAILURES.noImage;
62
+ };
63
+ export const drawOptionWithCodex = async (args) => {
64
+ const executor = (args.executorFactory ?? createNativeImageExecutor)({ root: args.root, env: args.env });
65
+ const callDir = callDirectoryOf(args.root, args.option.callId);
66
+ const details = async () => {
67
+ const { receiptState, timedOut, ...record } = await readCallDetails(callDir, args.option.prompt);
68
+ return { record, receiptState, timedOut };
69
+ };
70
+ try {
71
+ const result = await executor.generate({
72
+ callId: args.option.callId,
73
+ prompt: args.option.prompt,
74
+ images: args.images,
75
+ expected: args.option.frame,
76
+ });
77
+ return { kind: 'drawn', png: result.png, reused: result.reused, details: (await details()).record };
78
+ }
79
+ catch (error) {
80
+ const code = error.code;
81
+ const read = await details();
82
+ if (code === 'NEEDS_RECONCILIATION')
83
+ return { kind: 'failed', failure: failureSentence(read), details: read.record };
84
+ if (code === 'REQUEST_CHANGED')
85
+ return { kind: 'failed', failure: OPTION_FAILURES.changed, details: read.record };
86
+ return { kind: 'environment', error: error instanceof Error ? error.message : String(error), details: read.record };
87
+ }
88
+ };
89
+ //# sourceMappingURL=workspace-draw-codex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-draw-codex.js","sourceRoot":"","sources":["../src/workspace-draw-codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,yBAAyB,EAA2B,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAuB/D,MAAM,MAAM,GAAG,CAAC,KAAa,EAAU,EAAE,CA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;AACH,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { type CodexReadiness, type CodexReadinessCheck } from './cli-codex-readiness.js';
2
+ import type { DrawEngine, DrawRecordCodex } from './workspace-draw-types.js';
3
+ /**
4
+ * Whether Codex can draw a request, decided once per op and recorded with its reason (design section 3, step 4):
5
+ * Codex when the readiness probe passes in the agent's own Codex home. There is no other engine in this release
6
+ * (decision D2-B: drawing on 12ui needs a 12ui sign-in), so a probe that fails is a reason, never a fallback.
7
+ */
8
+ export type RequestedEngine = 'auto' | DrawEngine;
9
+ export type EngineChoice = {
10
+ ok: true;
11
+ engine: DrawEngine;
12
+ reason: string;
13
+ codex: DrawRecordCodex;
14
+ } | {
15
+ ok: false;
16
+ reason: string;
17
+ check: Exclude<CodexReadinessCheck, 'ready'>;
18
+ };
19
+ export type ReadinessProbe = (options: {
20
+ env: NodeJS.ProcessEnv;
21
+ }) => Promise<CodexReadiness>;
22
+ /** "The same home": the calling agent's `CODEX_HOME`, else `~/.codex`. */
23
+ export declare const codexHomeOf: (env: NodeJS.ProcessEnv) => string;
24
+ /**
25
+ * `<home>/sessions/**\/rollout-*-<threadId>.jsonl`: the calling agent's own rollout, cheap proof that the drawing
26
+ * account is the caller's. Null when the thread id is unset or no such file exists.
27
+ */
28
+ export declare const findSameHomeRollout: (home: string, threadId: string | null) => Promise<string | null>;
29
+ /**
30
+ * `--engine` is strict: anything but auto or codex is a usage error. `TWELVE_UI_ENGINE` is shared with conversion,
31
+ * where `api` is a valid choice, so for this verb it counts only when it names auto or codex; any other value
32
+ * leaves the default, and a conversion setting never stops a workspace request from drawing.
33
+ */
34
+ export declare const parseRequestedEngine: (flag: string | undefined, env: NodeJS.ProcessEnv) => RequestedEngine | null;
35
+ export declare const chooseEngine: (args: {
36
+ env: NodeJS.ProcessEnv;
37
+ probe?: ReadinessProbe;
38
+ }) => Promise<EngineChoice>;
39
+ //# sourceMappingURL=workspace-draw-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,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vB,CAAC"}
@@ -0,0 +1,72 @@
1
+ import { readdir } from 'node:fs/promises';
2
+ import { homedir } from 'node:os';
3
+ import path from 'node:path';
4
+ import { probeCodexReadiness } from './cli-codex-readiness.js';
5
+ import { locateCodexBinary, NO_CODEX_BINARY_REASON } from './codex-binary.js';
6
+ /** "The same home": the calling agent's `CODEX_HOME`, else `~/.codex`. */
7
+ export const codexHomeOf = (env) => path.resolve(env.CODEX_HOME?.trim() || path.join(homedir(), '.codex'));
8
+ /**
9
+ * `<home>/sessions/**\/rollout-*-<threadId>.jsonl`: the calling agent's own rollout, cheap proof that the drawing
10
+ * account is the caller's. Null when the thread id is unset or no such file exists.
11
+ */
12
+ export const findSameHomeRollout = async (home, threadId) => {
13
+ if (!threadId)
14
+ return null;
15
+ let entries;
16
+ try {
17
+ entries = await readdir(path.join(home, 'sessions'), { recursive: true });
18
+ }
19
+ catch (error) {
20
+ if (error.code === 'ENOENT')
21
+ return null;
22
+ throw error;
23
+ }
24
+ const suffix = `-${threadId}.jsonl`;
25
+ const match = entries.filter((entry) => path.basename(entry).startsWith('rollout-') && entry.endsWith(suffix)).sort()[0];
26
+ return match ? path.join(home, 'sessions', match) : null;
27
+ };
28
+ const isRequestedEngine = (value) => value === 'auto' || value === 'codex';
29
+ /**
30
+ * `--engine` is strict: anything but auto or codex is a usage error. `TWELVE_UI_ENGINE` is shared with conversion,
31
+ * where `api` is a valid choice, so for this verb it counts only when it names auto or codex; any other value
32
+ * leaves the default, and a conversion setting never stops a workspace request from drawing.
33
+ */
34
+ export const parseRequestedEngine = (flag, env) => {
35
+ if (flag !== undefined) {
36
+ const value = flag.trim();
37
+ return isRequestedEngine(value) ? value : null;
38
+ }
39
+ const fromEnv = env.TWELVE_UI_ENGINE?.trim() ?? '';
40
+ return isRequestedEngine(fromEnv) ? fromEnv : 'auto';
41
+ };
42
+ export const chooseEngine = async (args) => {
43
+ const home = codexHomeOf(args.env);
44
+ const located = locateCodexBinary(args.env);
45
+ const readiness = located
46
+ ? await (args.probe ?? probeCodexReadiness)({ env: args.env })
47
+ : { ready: false, reason: NO_CODEX_BINARY_REASON, check: 'no_binary', codexBin: '', codexHome: home };
48
+ if (readiness.ready) {
49
+ const version = readiness.version ?? 'unknown';
50
+ const threadId = args.env.CODEX_THREAD_ID?.trim() || null;
51
+ return {
52
+ ok: true,
53
+ engine: 'codex',
54
+ reason: `Codex ${version} signed in with ChatGPT in ${readiness.codexHome}`,
55
+ codex: {
56
+ binary: readiness.codexBin,
57
+ version,
58
+ home: readiness.codexHome,
59
+ threadId,
60
+ sameHomeRollout: await findSameHomeRollout(readiness.codexHome, threadId),
61
+ },
62
+ };
63
+ }
64
+ return {
65
+ ok: false,
66
+ check: readiness.check === 'ready' ? 'binary' : readiness.check,
67
+ reason: located
68
+ ? `Codex at ${located.binary} (from ${located.source}) cannot draw here: ${readiness.reason}`
69
+ : `Codex cannot draw here: ${readiness.reason}`,
70
+ };
71
+ };
72
+ //# sourceMappingURL=workspace-draw-engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-draw-engine.js","sourceRoot":"","sources":["../src/workspace-draw-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,mBAAmB,EAAiD,MAAM,0BAA0B,CAAC;AAC9G,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAiB9E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAsB,EAAU,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEtI;;;GAGG;AACH,MAAM,CAAC,MAAM,m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AE,QAAQ,CAAC;aAC1E;SACF,CAAC;IACJ,CAAC;IACD,OAAO;QACL,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,SAAS,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK;QAC/D,MAAM,EAAE,OAAO;YACb,CAAC,CAAC,YAAY,OAAO,CAAC,MAAM,UAAU,OAAO,CAAC,MAAM,uBAAuB,SAAS,CAAC,MAAM,EAAE;YAC7F,CAAC,CAAC,2BAA2B,SAAS,CAAC,MAAM,EAAE;KAClD,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import type { CodexReadinessCheck } from './cli-codex-readiness.js';
2
+ export declare const DRAW_MESSAGES: {
3
+ readonly added: (args: {
4
+ count: number;
5
+ edit: boolean;
6
+ label: string | null;
7
+ }) => string;
8
+ readonly replayed: (args: {
9
+ count: number;
10
+ }) => string;
11
+ readonly partial: (args: {
12
+ added: number;
13
+ total: number;
14
+ }) => string;
15
+ readonly failed: (args: {
16
+ total: number;
17
+ }) => string;
18
+ readonly tokenInvalid: () => string;
19
+ readonly unknownOp: () => string;
20
+ readonly notDrawing: () => string;
21
+ readonly opInProgress: () => string;
22
+ readonly usage: (reason: string) => string;
23
+ readonly needsEscalation: () => string;
24
+ readonly unreachable: () => string;
25
+ readonly serverFault: () => string;
26
+ /**
27
+ * Codex cannot draw here (decision D2-B): why, in the user's words (the probe's own detail, which names conversion
28
+ * flags, stays in `engineReason` and the record), then that nothing was drawn and that drawing on 12ui needs a 12ui
29
+ * sign-in. The skill relays it word for word.
30
+ */
31
+ readonly noEngine: (check: Exclude<CodexReadinessCheck, "ready">) => string;
32
+ readonly codexStopped: () => string;
33
+ readonly cliOutdated: () => string;
34
+ };
35
+ /** Why Codex cannot draw here, one sentence per readiness check that can fail. */
36
+ export declare const CODEX_NOT_READY: Record<Exclude<CodexReadinessCheck, 'ready'>, string>;
37
+ /** What a failed option shows on the screen: fixed sentences, at most 200 characters each (I1 2.3). */
38
+ export declare const OPTION_FAILURES: {
39
+ readonly noImage: "Codex did not return an image for this option.";
40
+ readonly protocol: "Codex made more than one image call for this option.";
41
+ readonly timeout: "Codex took too long to draw this option.";
42
+ readonly changed: "This option was drawn on this Mac with different inputs and cannot be drawn again here.";
43
+ readonly codexUnavailable: "Codex cannot draw on this Mac, and drawing on 12ui needs a 12ui sign-in.";
44
+ };
45
+ //# sourceMappingURL=workspace-draw-messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-draw-messages.d.ts","sourceRoot":"","sources":["../src/workspace-draw-messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAUpE,eAAO,MAAM,aAAa;2BACV;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,KAAG,MAAM;8BAG5D;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAG,MAAM;6BAG3B;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAG,MAAM;4BAG1C;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAG,MAAM;iCAGvB,MAAM;8BACT,MAAM;+BACL,MAAM;iCACJ,MAAM;6BACR,MAAM,KAAG,MAAM;oCACV,MAAM;gCACV,MAAM;gCACN,MAAM;IACvB;;;;OAIG;+BACe,OAAO,CAAC,mBAAmB,EAAE,OAAO,CAAC,KAAG,MAAM;iCAG9C,MAAM;gCACP,MAAM;CACf,CAAC;AAEX,kFAAkF;AAClF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,mBAAmB,EAAE,OAAO,CAAC,EAAE,MAAM,CASjF,CAAC;AAEF,uGAAuG;AACvG,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Every sentence `12ui workspace draw` can print as its `message`, and every failure sentence it pushes to the
3
+ * screen. The agent replies with `message` in one sentence, so none of these may name a price, a credit, a plan,
4
+ * an upgrade or a subscription; a test scans each template with the plugin validator's `scanPaidSurface`.
5
+ */
6
+ const plural = (count, word) => `${count} ${word}${count === 1 ? '' : 's'}`;
7
+ export const DRAW_MESSAGES = {
8
+ added: (args) => (args.edit ? `Added the edited version${args.label ? ` ${args.label}` : ''}.` : `Added ${plural(args.count, 'option')}.`),
9
+ replayed: (args) => (args.count === 1 ? 'This option was already added.' : `These ${plural(args.count, 'option')} were already added.`),
10
+ partial: (args) => (`Added ${args.added} of ${plural(args.total, 'option')}; the rest could not be drawn and show as failed in the workspace.`),
11
+ failed: (args) => (args.total === 1 ? 'The option could not be drawn; it shows as failed in the workspace.' : `None of the ${plural(args.total, 'option')} could be drawn; they show as failed in the workspace.`),
12
+ tokenInvalid: () => 'The upload token is not valid any more. Call design.slate.data for a fresh one, then run the same command with it.',
13
+ unknownOp: () => 'That request is not in this workspace.',
14
+ notDrawing: () => 'That request has no options to draw.',
15
+ opInProgress: () => 'This request is already being drawn on this Mac. Wait for that command to finish.',
16
+ usage: (reason) => `${reason} Usage: 12ui workspace draw --op <request id> --token <upload token> [--origin <url>] [--engine auto|codex] [--dry-run]`,
17
+ needsEscalation: () => 'This command must run outside the sandbox. Run the same command again with escalated permissions.',
18
+ unreachable: () => 'design.12ui.com could not be reached from here. Run the same command again with escalated permissions.',
19
+ serverFault: () => 'design.12ui.com did not finish the request. Run the same command again.',
20
+ /**
21
+ * Codex cannot draw here (decision D2-B): why, in the user's words (the probe's own detail, which names conversion
22
+ * flags, stays in `engineReason` and the record), then that nothing was drawn and that drawing on 12ui needs a 12ui
23
+ * sign-in. The skill relays it word for word.
24
+ */
25
+ noEngine: (check) => (`${CODEX_NOT_READY[check]} Nothing was drawn. Drawing on 12ui needs a 12ui sign-in (12ui login).`),
26
+ codexStopped: () => 'Codex stopped being able to draw on this Mac partway through. Run the same command again.',
27
+ cliOutdated: () => 'This 12ui command line is older than the Design workspace needs. Install the current one, then run the same command.',
28
+ };
29
+ /** Why Codex cannot draw here, one sentence per readiness check that can fail. */
30
+ export const CODEX_NOT_READY = {
31
+ no_binary: 'Codex is not installed on this Mac.',
32
+ binary: 'The Codex command line on this Mac could not run.',
33
+ auth_file: 'Codex on this Mac is not signed in.',
34
+ chatgpt_login: 'Codex on this Mac is not signed in with ChatGPT.',
35
+ login_status: 'Codex on this Mac could not confirm its sign-in.',
36
+ exec_flags: 'The Codex command line on this Mac is too old to draw; update Codex.',
37
+ models: 'Codex on this Mac has not loaded the models it can use; open Codex once, then try again.',
38
+ image_generation: 'Codex image generation is not turned on for this Codex sign-in.',
39
+ };
40
+ /** What a failed option shows on the screen: fixed sentences, at most 200 characters each (I1 2.3). */
41
+ export const OPTION_FAILURES = {
42
+ noImage: 'Codex did not return an image for this option.',
43
+ protocol: 'Codex made more than one image call for this option.',
44
+ timeout: 'Codex took too long to draw this option.',
45
+ changed: 'This option was drawn on this Mac with different inputs and cannot be drawn again here.',
46
+ codexUnavailable: 'Codex cannot draw on this Mac, and drawing on 12ui needs a 12ui sign-in.',
47
+ };
48
+ //# sourceMappingURL=workspace-draw-messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-draw-messages.js","sourceRoot":"","sources":["../src/workspace-draw-messages.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,IAAY,EAAU,EAAE,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAEpG,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK,EAAE,CAAC,IAA4D,EAAU,EAAE,CAAC,CAC/E,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,2BAA2B,IAAI,CAAC,KAAK,C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W,EAAE,CAAC,2FAA2F;IACvH,WAAW,EAAE,GAAW,EAAE,CAAC,sHAAsH;CACzI,CAAC;AAEX,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAA0D;IACpF,SAAS,EAAE,qCAAqC;IAChD,MAAM,EAAE,mDAAmD;IAC3D,SAAS,EAAE,qCAAqC;IAChD,aAAa,EAAE,kDAAkD;IACjE,YAAY,EAAE,kDAAkD;IAChE,UAAU,EAAE,sEAAsE;IAClF,MAAM,EAAE,0FAA0F;IAClG,gBAAgB,EAAE,iEAAiE;CACpF,CAAC;AAEF,uGAAuG;AACvG,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,gDAAgD;IACzD,QAAQ,EAAE,sDAAsD;IAChE,OAAO,EAAE,0CAA0C;IACnD,OAAO,EAAE,yFAAyF;IAClG,gBAAgB,EAAE,0EAA0E;CACpF,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { type DrawFetch } from './workspace-draw-client.js';
2
+ import { type ExecutorFactory } from './workspace-draw-codex.js';
3
+ import { type ReadinessProbe, type RequestedEngine } from './workspace-draw-engine.js';
4
+ import { type DrawCode } from './workspace-draw-types.js';
5
+ /**
6
+ * `12ui workspace draw`, start to finish (design section 3): the sandbox gate, the op lock, the frozen plan and its
7
+ * images, Codex readiness for the op, every pending option drawn at once, each option pushed as it lands, and one
8
+ * JSON line with a run record behind it. The command builds no prompt: it executes the plan the server froze.
9
+ * When Codex cannot draw here it spends nothing and draws nothing (decision D2-B): it pushes each pending option's
10
+ * failure and exits 4 with the reason and that drawing on 12ui needs a 12ui sign-in.
11
+ */
12
+ export type DrawArguments = {
13
+ opId: string;
14
+ token: string;
15
+ origin: string;
16
+ engine: RequestedEngine;
17
+ dryRun: boolean;
18
+ };
19
+ export type DrawDependencies = {
20
+ env?: NodeJS.ProcessEnv;
21
+ fetch?: DrawFetch;
22
+ sleep?: (milliseconds: number) => Promise<void>;
23
+ now?: () => Date;
24
+ dataRoot?: string;
25
+ cliVersion?: string;
26
+ probe?: ReadinessProbe;
27
+ executorFactory?: ExecutorFactory;
28
+ /** One progress line per option, on stderr. */
29
+ progress?: (line: string) => void;
30
+ };
31
+ export type DrawResult = {
32
+ exitCode: number;
33
+ output: Record<string, unknown>;
34
+ };
35
+ type Abort = {
36
+ code: DrawCode;
37
+ message: string;
38
+ };
39
+ /** Server and transport failures, as the command's refusal codes. Anything else is a fault and is thrown. */
40
+ export declare const abortOf: (error: unknown) => Abort | null;
41
+ export declare const runWorkspaceDraw: (args: DrawArguments, deps?: DrawDependencies) => Promise<DrawResult>;
42
+ export {};
43
+ //# sourceMappingURL=workspace-draw-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-draw-run.d.ts","sourceRoot":"","sources":["../src/workspace-draw-run.ts"],"names":[],"mappings":"AACA,OAAO,EAAwE,KAAK,SAAS,EAAkB,MAAM,4BAA4B,CAAC;AAClJ,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAgB,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGrG,OAAO,EAGL,KAAK,QAAQ,EASd,MAAM,2BAA2B,CAAC;AAEnC;;;;;;GAMG;AAEH,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,eAAe,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,QAAQ,C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