@12ui/design 0.2.91 → 0.2.92
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/SKILL.md +1 -1
- package/codex-plugin/plugin.json +14 -14
- package/dist/branch-client.d.ts +8 -0
- package/dist/branch-client.d.ts.map +1 -1
- package/dist/branch-client.js.map +1 -1
- package/dist/branch-core/branch-canvas.d.ts +41 -0
- package/dist/branch-core/branch-canvas.d.ts.map +1 -0
- package/dist/branch-core/branch-canvas.js +87 -0
- package/dist/branch-core/branch-canvas.js.map +1 -0
- package/dist/branch-core/branch-gates.d.ts +62 -0
- package/dist/branch-core/branch-gates.d.ts.map +1 -0
- package/dist/branch-core/branch-gates.js +56 -0
- package/dist/branch-core/branch-gates.js.map +1 -0
- package/dist/branch-core/branch-plan-model.d.ts +115 -0
- package/dist/branch-core/branch-plan-model.d.ts.map +1 -0
- package/dist/branch-core/branch-plan-model.js +75 -0
- package/dist/branch-core/branch-plan-model.js.map +1 -0
- package/dist/branch-core/branch-planner.d.ts +78 -0
- package/dist/branch-core/branch-planner.d.ts.map +1 -0
- package/dist/branch-core/branch-planner.js +441 -0
- package/dist/branch-core/branch-planner.js.map +1 -0
- package/dist/branch-core/branch-prompt.d.ts +40 -0
- package/dist/branch-core/branch-prompt.d.ts.map +1 -0
- package/dist/branch-core/branch-prompt.js +180 -0
- package/dist/branch-core/branch-prompt.js.map +1 -0
- package/dist/branch-core/index.d.ts +17 -0
- package/dist/branch-core/index.d.ts.map +1 -0
- package/dist/branch-core/index.js +19 -0
- package/dist/branch-core/index.js.map +1 -0
- package/dist/branch-dispatch-loop.d.ts +2 -2
- package/dist/branch-dispatch-loop.d.ts.map +1 -1
- package/dist/branch-dispatch-loop.js +4 -0
- package/dist/branch-dispatch-loop.js.map +1 -1
- package/dist/branch-downloads.d.ts +2 -2
- package/dist/branch-downloads.d.ts.map +1 -1
- package/dist/branch-engine.d.ts +61 -0
- package/dist/branch-engine.d.ts.map +1 -0
- package/dist/branch-engine.js +94 -0
- package/dist/branch-engine.js.map +1 -0
- package/dist/branch-execution-types.d.ts +5 -0
- package/dist/branch-execution-types.d.ts.map +1 -1
- package/dist/branch-execution.d.ts +2 -2
- package/dist/branch-execution.d.ts.map +1 -1
- package/dist/branch-execution.js +27 -4
- package/dist/branch-execution.js.map +1 -1
- package/dist/branch-local-call-wait.d.ts +58 -0
- package/dist/branch-local-call-wait.d.ts.map +1 -0
- package/dist/branch-local-call-wait.js +122 -0
- package/dist/branch-local-call-wait.js.map +1 -0
- package/dist/branch-local-client.d.ts +108 -0
- package/dist/branch-local-client.d.ts.map +1 -0
- package/dist/branch-local-client.js +477 -0
- package/dist/branch-local-client.js.map +1 -0
- package/dist/branch-local-plan.d.ts +64 -0
- package/dist/branch-local-plan.d.ts.map +1 -0
- package/dist/branch-local-plan.js +281 -0
- package/dist/branch-local-plan.js.map +1 -0
- package/dist/branch-local-session-adoption.d.ts +35 -0
- package/dist/branch-local-session-adoption.d.ts.map +1 -0
- package/dist/branch-local-session-adoption.js +185 -0
- package/dist/branch-local-session-adoption.js.map +1 -0
- package/dist/branch-materialize.d.ts +2 -2
- package/dist/branch-materialize.d.ts.map +1 -1
- package/dist/branch-run-observation.d.ts +2 -2
- package/dist/branch-run-observation.d.ts.map +1 -1
- package/dist/branch-run-observation.js.map +1 -1
- package/dist/branch-run-record.d.ts +8 -0
- package/dist/branch-run-record.d.ts.map +1 -1
- package/dist/branch-run-record.js.map +1 -1
- package/dist/branch-schedule.d.ts +1 -1
- package/dist/branch-schedule.js +1 -1
- package/dist/cli-branch-command.d.ts +9 -2
- package/dist/cli-branch-command.d.ts.map +1 -1
- package/dist/cli-branch-command.js +61 -16
- package/dist/cli-branch-command.js.map +1 -1
- package/dist/cli-help/design.d.ts +1 -1
- package/dist/cli-help/design.d.ts.map +1 -1
- package/dist/cli-help/design.js +1 -0
- package/dist/cli-help/design.js.map +1 -1
- package/dist/cli-help/index.d.ts +1 -1
- package/dist/cli-local-dispatch.d.ts.map +1 -1
- package/dist/cli-local-dispatch.js +6 -2
- package/dist/cli-local-dispatch.js.map +1 -1
- package/dist/cli-next-command.d.ts.map +1 -1
- package/dist/cli-next-command.js +3 -1
- package/dist/cli-next-command.js.map +1 -1
- package/dist/cli-usage.js +1 -1
- package/dist/legacy-skill-catalog.d.ts.map +1 -1
- package/dist/legacy-skill-catalog.js +10 -0
- package/dist/legacy-skill-catalog.js.map +1 -1
- package/dist/slate-branch-runner.d.ts +9 -3
- package/dist/slate-branch-runner.d.ts.map +1 -1
- package/dist/slate-branch-runner.js +22 -6
- package/dist/slate-branch-runner.js.map +1 -1
- package/dist/slate-image-executor.d.ts +1 -0
- package/dist/slate-image-executor.d.ts.map +1 -1
- package/dist/slate-image-executor.js +1 -1
- package/dist/slate-image-executor.js.map +1 -1
- package/dist/slate-runner-context.d.ts +6 -0
- package/dist/slate-runner-context.d.ts.map +1 -1
- package/dist/slate-runner-context.js.map +1 -1
- package/dist/slate-runner-main.d.ts +3 -0
- package/dist/slate-runner-main.d.ts.map +1 -1
- package/dist/slate-runner-main.js +4 -0
- package/dist/slate-runner-main.js.map +1 -1
- package/dist/workspace-draw-branch.d.ts +5 -2
- package/dist/workspace-draw-branch.d.ts.map +1 -1
- package/dist/workspace-draw-branch.js +28 -22
- package/dist/workspace-draw-branch.js.map +1 -1
- package/dist/workspace-draw-codex.d.ts +5 -1
- package/dist/workspace-draw-codex.d.ts.map +1 -1
- package/dist/workspace-draw-codex.js +1 -0
- package/dist/workspace-draw-codex.js.map +1 -1
- package/dist/workspace-draw-run.d.ts +2 -1
- package/dist/workspace-draw-run.d.ts.map +1 -1
- package/dist/workspace-draw-run.js +7 -2
- package/dist/workspace-draw-run.js.map +1 -1
- package/open-design.json +2 -2
- package/package.json +1 -1
- package/skills/12ui-design/outputs.md +1 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branch data model for build runs, ported from Design Lab's
|
|
3
|
+
* `sessionBranchTypes.ts`. A build run grows one approved design (the "root")
|
|
4
|
+
* into a coherent set of screens: a source page that may continue below the
|
|
5
|
+
* approved screen, plus additional pages or application routes. Every screen
|
|
6
|
+
* is one cell occupying one create slot.
|
|
7
|
+
*
|
|
8
|
+
* Structural chrome (header / footer / pageEndsHere) is DERIVED from the
|
|
9
|
+
* surface type and the screen's position, never asked of the model.
|
|
10
|
+
*/
|
|
11
|
+
import type { BranchCanvas, BranchCanvasDecision } from './branch-canvas.js';
|
|
12
|
+
/** The eight dispatchable slots of a branch run, in plan order. */
|
|
13
|
+
export declare const BUILD_SLOTS: readonly ["a", "b", "c", "d", "e", "f", "g", "h"];
|
|
14
|
+
export type BuildSlot = (typeof BUILD_SLOTS)[number];
|
|
15
|
+
export declare const BRANCH_PLAN_SCHEMA_VERSION: 1;
|
|
16
|
+
export declare const BRANCH_PAGE_TYPES: readonly ["marketing", "explanatory", "directory", "editorial", "application", "documentation", "other"];
|
|
17
|
+
export type BranchPageType = (typeof BRANCH_PAGE_TYPES)[number];
|
|
18
|
+
/** Structural relationship between generated screens, independent of density. */
|
|
19
|
+
export declare const BRANCH_SURFACE_TYPES: readonly ["web_page", "web_app", "mobile_app", "immersive"];
|
|
20
|
+
export type BranchSurfaceType = (typeof BRANCH_SURFACE_TYPES)[number];
|
|
21
|
+
/** Editorial content role carried from planning into the image request. */
|
|
22
|
+
export declare const BRANCH_VIEWPORT_SLOT_TYPES: readonly ["text-column", "text-with-graphic", "conclusion-footer", "other"];
|
|
23
|
+
export type BranchViewportSlotType = (typeof BRANCH_VIEWPORT_SLOT_TYPES)[number];
|
|
24
|
+
export type BranchPlanViewport = {
|
|
25
|
+
/** 1-based within an additional page; source continuations begin at 2. */
|
|
26
|
+
viewportOrdinal: number;
|
|
27
|
+
/** The only semantic content this screen should render. */
|
|
28
|
+
content: string;
|
|
29
|
+
/** Stable replacement identity derived from plan coordinates, never model-authored. */
|
|
30
|
+
contentSlotId?: string;
|
|
31
|
+
/** Optional for legacy and non-editorial plans. */
|
|
32
|
+
slotType?: BranchViewportSlotType;
|
|
33
|
+
/** Approximate replaceable prose capacity requested by the planner. */
|
|
34
|
+
targetWords?: number;
|
|
35
|
+
/** Derived chrome. null means webpage header semantics do not apply. */
|
|
36
|
+
header: boolean | null;
|
|
37
|
+
/** Derived chrome. null means webpage footer semantics do not apply. */
|
|
38
|
+
footer: boolean | null;
|
|
39
|
+
pageEndsHere: boolean;
|
|
40
|
+
/** Optional deterministic plan override; omitted slots inherit the winner. */
|
|
41
|
+
declaredCanvas?: BranchCanvas;
|
|
42
|
+
/** Added after planning and before any generated candidate is materialized. */
|
|
43
|
+
canvasDecision?: BranchCanvasDecision;
|
|
44
|
+
};
|
|
45
|
+
export type BranchPlanPage = {
|
|
46
|
+
/**
|
|
47
|
+
* 0 is always the source page — present even when it contributes no screens
|
|
48
|
+
* of its own — and additional pages follow in plan order. Plans stored
|
|
49
|
+
* before 2026-08-18 may start at index 1; readers must not assume position 0
|
|
50
|
+
* is in the list.
|
|
51
|
+
*/
|
|
52
|
+
index: number;
|
|
53
|
+
kind: 'source' | 'additional';
|
|
54
|
+
title: string;
|
|
55
|
+
pageType: BranchPageType;
|
|
56
|
+
surfaceType: BranchSurfaceType;
|
|
57
|
+
purpose: string;
|
|
58
|
+
/** Source page only: the approved screen already reaches its natural end. */
|
|
59
|
+
sourceEndsHere?: boolean;
|
|
60
|
+
viewports: BranchPlanViewport[];
|
|
61
|
+
};
|
|
62
|
+
export type BranchPlan = {
|
|
63
|
+
schemaVersion: typeof BRANCH_PLAN_SCHEMA_VERSION;
|
|
64
|
+
sitePurpose: string;
|
|
65
|
+
statusUpdate: string;
|
|
66
|
+
approvedScreenSummary: string;
|
|
67
|
+
/** Native declared dimensions of the approved design this plan branches from. */
|
|
68
|
+
winnerCanvas?: BranchCanvas;
|
|
69
|
+
pages: BranchPlanPage[];
|
|
70
|
+
/**
|
|
71
|
+
* Deterministic recoveries applied while parsing model output (over-length
|
|
72
|
+
* arrays, cell-cap trims, contradictory sourceEndsHere). Persisted with the
|
|
73
|
+
* plan for operators; never surfaced as a user-visible error.
|
|
74
|
+
*/
|
|
75
|
+
anomalies: string[];
|
|
76
|
+
};
|
|
77
|
+
/** Everything one dispatched screen needs, persisted on its candidate row. */
|
|
78
|
+
export type BranchCellPlacement = {
|
|
79
|
+
pageIndex: number;
|
|
80
|
+
pageKind: 'source' | 'additional';
|
|
81
|
+
pageTitle: string;
|
|
82
|
+
pageType: BranchPageType;
|
|
83
|
+
surfaceType: BranchSurfaceType;
|
|
84
|
+
pagePurpose: string;
|
|
85
|
+
viewportOrdinal: number;
|
|
86
|
+
lastViewportOrdinal: number;
|
|
87
|
+
header: boolean | null;
|
|
88
|
+
footer: boolean | null;
|
|
89
|
+
pageEndsHere: boolean;
|
|
90
|
+
/** The previous viewport of the same page, which must arrive first. */
|
|
91
|
+
dependsOnSlot: string | null;
|
|
92
|
+
content: string;
|
|
93
|
+
/** Stable replacement identity derived from plan coordinates, never model-authored. */
|
|
94
|
+
contentSlotId?: string;
|
|
95
|
+
/** Optional for legacy and non-editorial placements. */
|
|
96
|
+
slotType?: BranchViewportSlotType;
|
|
97
|
+
/** Approximate replaceable prose capacity requested by the planner. */
|
|
98
|
+
targetWords?: number;
|
|
99
|
+
/** Optional only for placements stored before winner-canvas inheritance. */
|
|
100
|
+
canvasDecision?: BranchCanvasDecision;
|
|
101
|
+
};
|
|
102
|
+
export type BranchCell = {
|
|
103
|
+
slot: string;
|
|
104
|
+
/** Short human label for the existing candidate `direction` field. */
|
|
105
|
+
label: string;
|
|
106
|
+
placement: BranchCellPlacement;
|
|
107
|
+
};
|
|
108
|
+
export declare const branchContentSlotId: (pageIndex: number, viewportOrdinal: number) => string;
|
|
109
|
+
/**
|
|
110
|
+
* Flattens a plan into ordered cells and assigns slots. The order is page
|
|
111
|
+
* order then viewport order, which is exactly the order the footer seed and
|
|
112
|
+
* every dependency chain assume.
|
|
113
|
+
*/
|
|
114
|
+
export declare const branchPlanCells: (plan: BranchPlan, slots: readonly string[]) => BranchCell[];
|
|
115
|
+
//# sourceMappingURL=branch-plan-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-plan-model.d.ts","sourceRoot":"","sources":["../../src/branch-core/branch-plan-model.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE7E,mEAAmE;AACnE,eAAO,MAAM,WAAW,mDAAoD,CAAC;AAC7E,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,eAAO,MAAM,0BAA0B,EAAG,CAAU,CAAC;AAErD,eAAO,MAAM,iBAAiB,0GAQpB,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,6DAKvB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,2EAA2E;AAC3E,eAAO,MAAM,0BAA0B,6EAK7B,CAAC;AACX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,0EAA0E;IAC1E,eAAe,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,uFAAuF;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,wEAAwE;IACxE,MAAM,EAAE,OAAO,GAAG,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E,OAAO,CAAC;IACtB,uEAAuE;IACvE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,uFAAuF;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,oBAAoB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,mBAAmB,CAAC;CAChC,CAAC;AAMF,eAAO,MAAM,mBAAmB,GAAI,WAAW,MAAM,EAAE,iBAAiB,MAAM,KAAG,MAEhF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,MAAM,UAAU,EAChB,OAAO,SAAS,MAAM,EAAE,KACvB,UAAU,EAqCZ,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// GENERATED — do not edit. Copied verbatim from
|
|
2
|
+
// packages/layerdoc/src/branch-core by scripts/sync-improve-core.mjs.
|
|
3
|
+
/** The eight dispatchable slots of a branch run, in plan order. */
|
|
4
|
+
export const BUILD_SLOTS = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
|
|
5
|
+
export const BRANCH_PLAN_SCHEMA_VERSION = 1;
|
|
6
|
+
export const BRANCH_PAGE_TYPES = [
|
|
7
|
+
'marketing',
|
|
8
|
+
'explanatory',
|
|
9
|
+
'directory',
|
|
10
|
+
'editorial',
|
|
11
|
+
'application',
|
|
12
|
+
'documentation',
|
|
13
|
+
'other',
|
|
14
|
+
];
|
|
15
|
+
/** Structural relationship between generated screens, independent of density. */
|
|
16
|
+
export const BRANCH_SURFACE_TYPES = [
|
|
17
|
+
'web_page',
|
|
18
|
+
'web_app',
|
|
19
|
+
'mobile_app',
|
|
20
|
+
'immersive',
|
|
21
|
+
];
|
|
22
|
+
/** Editorial content role carried from planning into the image request. */
|
|
23
|
+
export const BRANCH_VIEWPORT_SLOT_TYPES = [
|
|
24
|
+
'text-column',
|
|
25
|
+
'text-with-graphic',
|
|
26
|
+
'conclusion-footer',
|
|
27
|
+
'other',
|
|
28
|
+
];
|
|
29
|
+
const cellLabel = (title, viewportOrdinal) => (viewportOrdinal === 1 ? title : `${title} (part ${viewportOrdinal})`);
|
|
30
|
+
export const branchContentSlotId = (pageIndex, viewportOrdinal) => (`content-p${pageIndex}-v${viewportOrdinal}`);
|
|
31
|
+
/**
|
|
32
|
+
* Flattens a plan into ordered cells and assigns slots. The order is page
|
|
33
|
+
* order then viewport order, which is exactly the order the footer seed and
|
|
34
|
+
* every dependency chain assume.
|
|
35
|
+
*/
|
|
36
|
+
export const branchPlanCells = (plan, slots) => {
|
|
37
|
+
const cells = [];
|
|
38
|
+
for (const page of plan.pages) {
|
|
39
|
+
const lastViewportOrdinal = page.viewports.length > 0
|
|
40
|
+
? page.viewports[page.viewports.length - 1].viewportOrdinal
|
|
41
|
+
: 0;
|
|
42
|
+
page.viewports.forEach((viewport, index) => {
|
|
43
|
+
const slot = slots[cells.length];
|
|
44
|
+
if (slot === undefined)
|
|
45
|
+
return;
|
|
46
|
+
cells.push({
|
|
47
|
+
slot,
|
|
48
|
+
label: cellLabel(page.title, viewport.viewportOrdinal),
|
|
49
|
+
placement: {
|
|
50
|
+
pageIndex: page.index,
|
|
51
|
+
pageKind: page.kind,
|
|
52
|
+
pageTitle: page.title,
|
|
53
|
+
pageType: page.pageType,
|
|
54
|
+
surfaceType: page.surfaceType,
|
|
55
|
+
pagePurpose: page.purpose,
|
|
56
|
+
viewportOrdinal: viewport.viewportOrdinal,
|
|
57
|
+
lastViewportOrdinal,
|
|
58
|
+
header: viewport.header,
|
|
59
|
+
footer: viewport.footer,
|
|
60
|
+
pageEndsHere: viewport.pageEndsHere,
|
|
61
|
+
dependsOnSlot: index === 0 ? null : cells[cells.length - 1].slot,
|
|
62
|
+
content: viewport.content,
|
|
63
|
+
...(viewport.slotType
|
|
64
|
+
? { contentSlotId: viewport.contentSlotId ?? branchContentSlotId(page.index, viewport.viewportOrdinal) }
|
|
65
|
+
: {}),
|
|
66
|
+
...(viewport.slotType ? { slotType: viewport.slotType } : {}),
|
|
67
|
+
...(viewport.targetWords !== undefined ? { targetWords: viewport.targetWords } : {}),
|
|
68
|
+
...(viewport.canvasDecision ? { canvasDecision: viewport.canvasDecision } : {}),
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return cells;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=branch-plan-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-plan-model.js","sourceRoot":"","sources":["../../src/branch-core/branch-plan-model.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,sEAAsE;AAetE,mEAAmE;AACnE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAG7E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAU,CAAC;AAErD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW;IACX,aAAa;IACb,WAAW;IACX,WAAW;IACX,aAAa;IACb,eAAe;IACf,OAAO;CACC,CAAC;AAGX,iFAAiF;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU;IACV,SAAS;IACT,YAAY;IACZ,WAAW;CACH,CAAC;AAGX,2EAA2E;AAC3E,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,OAAO;CACC,CAAC;AA4FX,MAAM,SAAS,GAAG,CAAC,KAAa,E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,EAAE,QAAQ,CAAC,eAAe;oBACzC,mBAAmB;oBACnB,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,YAAY,EAAE,QAAQ,CAAC,YAAY;oBACnC,aAAa,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,IAAI;oBACjE,OAAO,EAAE,QAAQ,CAAC,OAAO;oBACzB,GAAG,CAAC,QAAQ,CAAC,QAAQ;wBACnB,CAAC,CAAC,EAAE,aAAa,EAAE,QAAQ,CAAC,aAAa,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC,EAAE;wBACxG,CAAC,CAAC,EAAE,CAAC;oBACP,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC7D,GAAG,CAAC,QAAQ,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBACpF,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBAChF;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The branch director, ported from Design Lab's `branchPlanner.ts`. One strict
|
|
3
|
+
* JSON call over the approved design decides the semantic structure of the
|
|
4
|
+
* branch: what the product is for, what the approved screen already says,
|
|
5
|
+
* whether that screen already ends, and which pages or routes complete it.
|
|
6
|
+
*
|
|
7
|
+
* Header, footer, and page-ending chrome are NEVER asked of the model — they
|
|
8
|
+
* are derived here from the surface type and the screen's position, so the
|
|
9
|
+
* model spends its inference on the design problem alone.
|
|
10
|
+
*/
|
|
11
|
+
import { type BranchPlan } from './branch-plan-model.js';
|
|
12
|
+
/** The branch planner's model: one low-effort structured call per run (owner rule 2026-10-03: GPT-6.1 Sol, never GPT-6 Sol). */
|
|
13
|
+
export declare const BUILD_PLAN_MODEL = "gpt-6.1-sol";
|
|
14
|
+
/** The planner's fixed system text, sent ahead of `buildBranchPlannerPrompt`. */
|
|
15
|
+
export declare const BRANCH_PLANNER_SYSTEM_PROMPT = "Plan the semantic structure of a website or application branched from one approved design. Obey the supplied JSON schema exactly and add no commentary.";
|
|
16
|
+
/**
|
|
17
|
+
* The brief as the planner reads it: whitespace runs collapsed and the ends
|
|
18
|
+
* trimmed, exactly as the create route cleans a build request's concept.
|
|
19
|
+
*/
|
|
20
|
+
export declare const branchConceptText: (concept: string) => string;
|
|
21
|
+
export declare const MIN_BRANCH_ADDITIONAL_PAGES = 0;
|
|
22
|
+
/** 12ui caps total cells at eight slots (a-h), so four pages of two fit. */
|
|
23
|
+
export declare const MAX_BRANCH_ADDITIONAL_PAGES = 4;
|
|
24
|
+
export declare const MIN_BRANCH_VIEWPORTS = 1;
|
|
25
|
+
export declare const MAX_BRANCH_VIEWPORTS = 2;
|
|
26
|
+
export declare const MAX_BRANCH_SOURCE_CONTINUATIONS = 2;
|
|
27
|
+
export declare const MAX_EDITORIAL_BRANCH_SOURCE_CONTINUATIONS = 4;
|
|
28
|
+
/** Slots a-h. The parser trims any plan that would exceed this. */
|
|
29
|
+
export declare const MAX_BRANCH_CELLS = 8;
|
|
30
|
+
export declare const branchPlanResponseSchema: () => Record<string, unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* The screen cap the caller asked for, clamped to what 12ui can dispatch.
|
|
33
|
+
* `maxScreens` is a plan-shaping hint (the CLI's `--max-screens`), so an
|
|
34
|
+
* absent or out-of-range value simply falls back to the eight-slot ceiling.
|
|
35
|
+
*/
|
|
36
|
+
export declare const branchScreenCap: (maxScreens?: number) => number;
|
|
37
|
+
/** A footer is not an ending when the brief explicitly keeps one long article on this page. */
|
|
38
|
+
export declare const branchBriefRequestsLongFormSamePage: (concept: string) => boolean;
|
|
39
|
+
export declare const buildBranchPlannerPrompt: (args: {
|
|
40
|
+
concept: string;
|
|
41
|
+
maxScreens?: number;
|
|
42
|
+
}) => string;
|
|
43
|
+
/**
|
|
44
|
+
* Deterministic parse of the director's JSON. Structural defects (not JSON,
|
|
45
|
+
* missing required decisions, no generated screens) reject so the bounded
|
|
46
|
+
* retry can run; recoverable representation defects (over-length text or
|
|
47
|
+
* arrays, contradictory sourceEndsHere, more screens than slots) are
|
|
48
|
+
* canonicalized here and recorded in `anomalies`.
|
|
49
|
+
*
|
|
50
|
+
* The SOURCE PAGE IS ALWAYS PLAN POSITION 0, including when the approved
|
|
51
|
+
* screen already ends: it names the design the branch grew from, so the board
|
|
52
|
+
* and the site export can place that approved screen at index.html. When it
|
|
53
|
+
* ends it carries `viewports: []` and `sourceEndsHere: true` while keeping the
|
|
54
|
+
* model's own title, pageType, surfaceType, and purpose. (A page dropped here
|
|
55
|
+
* cost the site its winner page: the export refused, or the run reported
|
|
56
|
+
* success with the approved design missing.) Additional pages still require at
|
|
57
|
+
* least one screen each.
|
|
58
|
+
*
|
|
59
|
+
* `maxCells` is the caller's screen cap (the CLI's `--max-screens`), clamped
|
|
60
|
+
* to the eight dispatchable slots. Trimming to it happens BEFORE chrome
|
|
61
|
+
* derivation and slot assignment, so every surviving page keeps at least one
|
|
62
|
+
* screen and the footer seed and dependency chains are computed on the plan
|
|
63
|
+
* that actually ships.
|
|
64
|
+
*/
|
|
65
|
+
export declare const parseBranchPlan: (raw: string, options?: {
|
|
66
|
+
maxCells?: number;
|
|
67
|
+
longFormSamePage?: boolean;
|
|
68
|
+
}) => BranchPlan;
|
|
69
|
+
/**
|
|
70
|
+
* The options the planner's answer is parsed with for one brief and screen cap:
|
|
71
|
+
* the cap the director was asked for, and the long-form same-page rule the
|
|
72
|
+
* brief itself triggers.
|
|
73
|
+
*/
|
|
74
|
+
export declare const branchPlanParseOptions: (concept: string, maxScreens?: number) => {
|
|
75
|
+
maxCells?: number;
|
|
76
|
+
longFormSamePage?: boolean;
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=branch-planner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-planner.d.ts","sourceRoot":"","sources":["../../src/branch-core/branch-planner.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AAEH,OAAO,EAML,KAAK,UAAU,EAIhB,MAAM,wBAAwB,CAAC;AAEhC,gIAAgI;AAChI,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAE9C,iFAAiF;AACjF,eAAO,MAAM,4BAA4B,4JAA4J,CAAC;AAEtM;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MAA8C,CAAC;AAEnG,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,4EAA4E;AAC5E,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,+BAA+B,IAAI,CAAC;AACjD,eAAO,MAAM,yCAAyC,IAAI,CAAC;AAC3D,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,IAAI,CAAC;AA8ElC,eAAO,MAAM,wBAAwB,QAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CA6BhE,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,aAAa,MAAM,KAAG,MAIrD,CAAC;AAUF,+FAA+F;AAC/F,eAAO,MAAM,mCAAmC,GAAI,SAAS,MAAM,KAAG,OAMrE,CAAC;AAEF,eAAO,MAAM,w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