@reqvire-org/ads 0.3.32 → 0.3.34
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 +9 -0
- package/dist/behavior-libraries.mjs +93 -0
- package/dist/behaviors.mjs +0 -6
- package/dist/bootstrap-ds/ds.config.json +1 -0
- package/dist/bootstrap-ds/vite.config.ts +2 -1
- package/dist/boundaries.mjs +2 -0
- package/dist/capture.mjs +8 -6
- package/dist/check.mjs +2 -0
- package/dist/config.mjs +9 -2
- package/dist/draft-boundary.mjs +27 -0
- package/dist/draft-workspace.mjs +10 -0
- package/dist/lint-config.mjs +8 -0
- package/dist/mcp/build-status.mjs +1 -1
- package/dist/mcp/catalog.mjs +4 -2
- package/dist/mcp/context.mjs +2 -2
- package/dist/mcp/draft-discovery.mjs +55 -0
- package/dist/mcp/draft-exports.mjs +40 -0
- package/dist/mcp/drafts.mjs +460 -0
- package/dist/mcp/edit-preparation.mjs +8 -7
- package/dist/mcp/execution-results.mjs +2 -0
- package/dist/mcp/mutations.mjs +6 -2
- package/dist/mcp/preview-watch.mjs +24 -5
- package/dist/mcp/preview-widget.bundle.js +14 -14
- package/dist/mcp/prompts.mjs +3 -2
- package/dist/mcp/server.mjs +178 -39
- package/dist/mcp/widget.bundle.js +1 -1
- package/dist/preview-files.mjs +2 -0
- package/dist/scenario-inspector.mjs +5 -5
- package/dist/scenario-program.mjs +36 -0
- package/dist/scenario-registry.mjs +90 -0
- package/dist/scenarios-compiler.mjs +68 -22
- package/dist/scenarios-vite.d.mts +1 -0
- package/dist/scenarios-vite.mjs +1 -0
- package/dist/scenarios.mjs +2 -1
- package/dist/showcase/client.bundle.js +28 -28
- package/dist/showcase/comparison.js +45 -0
- package/dist/showcase/draft-navigation.js +41 -0
- package/dist/showcase/preview-state.js +19 -0
- package/dist/showcase/style.css +5 -0
- package/dist/skills/README.md +5 -0
- package/dist/skills/ads-break-ui/SKILL.md +26 -0
- package/dist/skills/ads-break-ui/references/behaviors.md +10 -0
- package/dist/skills/ads-break-ui/references/captures.md +7 -0
- package/dist/skills/ads-break-ui/references/drafts.md +146 -0
- package/dist/skills/ads-break-ui/references/guarded-editing.md +6 -0
- package/dist/skills/ads-break-ui/references/validation.md +6 -0
- package/dist/skills/ads-designer/SKILL.md +33 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/vite.config.ts +2 -1
- package/dist/skills/ads-designer/references/behaviors.md +10 -0
- package/dist/skills/ads-designer/references/captures.md +7 -0
- package/dist/skills/ads-designer/references/drafts.md +146 -0
- package/dist/skills/ads-designer/references/guarded-editing.md +6 -0
- package/dist/skills/ads-designer/references/validation.md +6 -0
- package/dist/skills/ads-import/SKILL.md +30 -0
- package/dist/skills/ads-import/references/behaviors.md +10 -0
- package/dist/skills/ads-import/references/captures.md +7 -0
- package/dist/skills/ads-import/references/drafts.md +146 -0
- package/dist/skills/ads-import/references/guarded-editing.md +6 -0
- package/dist/skills/ads-import/references/validation.md +6 -0
- package/dist/skills/ads-motion/SKILL.md +26 -0
- package/dist/skills/ads-motion/references/behaviors.md +10 -0
- package/dist/skills/ads-motion/references/captures.md +7 -0
- package/dist/skills/ads-motion/references/drafts.md +146 -0
- package/dist/skills/ads-motion/references/guarded-editing.md +6 -0
- package/dist/skills/ads-motion/references/validation.md +6 -0
- package/dist/skills/ads-port/SKILL.md +34 -1
- package/dist/skills/ads-port/references/behaviors.md +10 -0
- package/dist/skills/ads-port/references/captures.md +7 -0
- package/dist/skills/ads-port/references/drafts.md +146 -0
- package/dist/skills/ads-port/references/guarded-editing.md +6 -0
- package/dist/skills/ads-port/references/native-implementation.md +14 -1
- package/dist/skills/ads-port/references/validation.md +6 -0
- package/dist/unit-contracts.mjs +2 -2
- package/dist/units.mjs +6 -0
- package/dist/verification/browser.d.mts +27 -0
- package/dist/verification.mjs +3 -0
- package/docs/ADS.md +13 -0
- package/docs/ARCHITECTURE.md +94 -0
- package/docs/CHANGELOG.md +111 -0
- package/docs/CONTRACTS.md +8 -0
- package/docs/GUIDE.md +46 -9
- package/docs/MCP.md +90 -0
- package/package.json +6 -4
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AppBridge, PostMessageTransport } from "@modelcontextprotocol/ext-apps/app-bridge";
|
|
2
|
+
|
|
3
|
+
/** Each version gets its own ordinary opaque MCP App, never another browser shell. */
|
|
4
|
+
export async function mountComparisonApp({slot,title,sandboxUrl,resourceUri,result,readResource,callTool,context,onError,onState}) {
|
|
5
|
+
const options={slot,title,sandboxUrl,resourceUri,readResource,callTool,context,onError,onState};
|
|
6
|
+
let latest=result,active,opening,restarting,closed=false;
|
|
7
|
+
function reopen(){
|
|
8
|
+
if(closed||restarting)return;
|
|
9
|
+
onState?.({state:"loading"});
|
|
10
|
+
restarting=Promise.resolve().then(async()=>{
|
|
11
|
+
await opening;
|
|
12
|
+
await active?.close();
|
|
13
|
+
if(closed)return;
|
|
14
|
+
opening=mountVersion({...options,result:latest,onReopen:reopen});
|
|
15
|
+
try{active=await opening;}finally{opening=undefined;}
|
|
16
|
+
}).catch(error=>{if(!closed)onError(error);}).finally(()=>{restarting=undefined;});
|
|
17
|
+
}
|
|
18
|
+
opening=mountVersion({...options,result:latest,onReopen:reopen});
|
|
19
|
+
try{active=await opening;}finally{opening=undefined;}
|
|
20
|
+
return{
|
|
21
|
+
async updateResult(value){latest=value;await restarting;if(!closed)await active.updateResult(latest);},
|
|
22
|
+
refreshContext(){if(!closed&&!restarting)active.refreshContext();},
|
|
23
|
+
async close(){closed=true;await restarting;await active?.close();},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function mountVersion({slot,title,sandboxUrl,resourceUri,result,readResource,callTool,context,onError,onState,onReopen}){
|
|
28
|
+
let disposed=false;
|
|
29
|
+
const resource=await readResource({uri:resourceUri});
|
|
30
|
+
const content=resource.contents.find(item=>item.mimeType==="text/html;profile=mcp-app"&&typeof item.text==="string");
|
|
31
|
+
if(!content)throw new Error("Comparison preview App is unavailable.");
|
|
32
|
+
const frame=document.createElement("iframe");frame.title=title;frame.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms");frame.src=sandboxUrl;slot.append(frame);
|
|
33
|
+
const bridge=new AppBridge(null,{name:"ADS showcase",version:"1.0.0"},{serverResources:{},serverTools:{},logging:{}},{hostContext:context(frame)});
|
|
34
|
+
bridge.onreadresource=readResource;bridge.oncalltool=callTool;bridge.onerror=error=>{if(!disposed)onError(error);};
|
|
35
|
+
bridge.onloggingmessage=value=>{if(disposed||value.logger!=="ads-preview")return;if(value.data?.code==="ADS_PREVIEW_REOPEN"){onReopen();return;}onState?.(value.data);if(value.data?.state==="error")onError(new Error(value.data.message));};
|
|
36
|
+
let timer;
|
|
37
|
+
const initialized=new Promise((resolve,reject)=>{timer=setTimeout(()=>reject(new Error("Comparison App initialization timed out.")),15000);bridge.oninitialized=()=>{clearTimeout(timer);resolve();};});
|
|
38
|
+
bridge.onsandboxready=()=>bridge.sendSandboxResourceReady({html:content.text,csp:content._meta?.ui?.csp,sandbox:"allow-scripts allow-forms"});
|
|
39
|
+
const observer=new ResizeObserver(()=>bridge.setHostContext(context(frame)));
|
|
40
|
+
try{
|
|
41
|
+
await Promise.all([bridge.connect(new PostMessageTransport(frame.contentWindow,frame.contentWindow)),initialized]);
|
|
42
|
+
observer.observe(frame);await bridge.sendToolInput({arguments:{}});await bridge.sendToolResult(result);
|
|
43
|
+
}catch(error){observer.disconnect();frame.remove();await bridge.close();throw error;}finally{clearTimeout(timer);}
|
|
44
|
+
return {updateResult:value=>bridge.sendToolResult(value),refreshContext:()=>bridge.setHostContext(context(frame)),async close(){disposed=true;observer.disconnect();try{await bridge.teardownResource({},{timeout:500});}catch{/* A disconnected App may not acknowledge teardown. */}await bridge.close();frame.remove();}};
|
|
45
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export function ownsScenario(unit, id) {
|
|
2
|
+
return id === unit || id.startsWith(unit + "/") || id.startsWith(unit + ".");
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/** Proposals remain attached to the ordinary catalogue, including new owners. */
|
|
6
|
+
export function withDraftEntries(scenarios, categories, drafts, previews = new Map()) {
|
|
7
|
+
const references = new Map(drafts.map(({ id, title, revision, state, preview }) => [id, { id, title, revision, state, ...(preview ? { preview } : {}) }]));
|
|
8
|
+
const entries = new Map(scenarios.map(item => [item.id, { ...item, drafts: (item.drafts ?? []).flatMap(draft => references.has(draft.id) ? [references.get(draft.id)] : []) }]));
|
|
9
|
+
for (const item of categories) {
|
|
10
|
+
const existing = entries.get(item.id);
|
|
11
|
+
entries.set(item.id, { ...existing, ...item, kind: "tokens", drafts: existing?.drafts ?? [] });
|
|
12
|
+
}
|
|
13
|
+
const owns = (unit, item) => unit === "tokens" && item.kind === "tokens" || (item.unit ? item.unit === unit : ownsScenario(unit, item.id));
|
|
14
|
+
const attach = (entry, draft) => {
|
|
15
|
+
if (!entry.drafts.some(item => item.id === draft.id)) entry.drafts.push(references.get(draft.id));
|
|
16
|
+
};
|
|
17
|
+
// Resolve known draft scenarios first so another proposal for the same new
|
|
18
|
+
// owner cannot leave a duplicate placeholder in the catalogue.
|
|
19
|
+
for (const draft of drafts) {
|
|
20
|
+
const preview = previews.get(draft.id);
|
|
21
|
+
for (const item of preview?.scenarios ?? []) {
|
|
22
|
+
if (!draft.units.some(unit => owns(unit, item))) continue;
|
|
23
|
+
let entry = entries.get(item.id);
|
|
24
|
+
if (!entry) {
|
|
25
|
+
entry = { ...item, draftOnly: true, drafts: [] };
|
|
26
|
+
entries.set(item.id, entry);
|
|
27
|
+
}
|
|
28
|
+
attach(entry, draft);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
for (const draft of drafts) {
|
|
32
|
+
for (const unit of draft.units) {
|
|
33
|
+
const kind = unit.split("/")[0];
|
|
34
|
+
if (!["tokens", "components", "patterns", "composition"].includes(kind)) continue;
|
|
35
|
+
const owned = [...entries.values()].filter(item => owns(unit, item));
|
|
36
|
+
if (owned.length) for (const item of owned) attach(item, draft);
|
|
37
|
+
else entries.set(unit, { id: unit, unit, title: unit.split("/").at(-1), kind, draftOnly: true, pendingDraftScenario: true, drafts: [references.get(draft.id)] });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return { scenarios: [...entries.values()], categories: [...entries.values()].filter(item => item.kind === "tokens") };
|
|
41
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** One monochrome state per entry; proposal presence and build state are distinct. */
|
|
2
|
+
export function entryPreviewState(item, report, preferredDraft) {
|
|
3
|
+
const draft = item.drafts?.find(value => value.id === preferredDraft) ?? item.drafts?.[0];
|
|
4
|
+
const proposal = draft && (report?.drafts?.find(value => value.id === draft.id) ?? draft.preview);
|
|
5
|
+
const build = draft ? proposal?.scenarios?.find(value => value.id === item.id) ?? proposal : report?.previews?.find(value => value.id === item.id) ?? item.build;
|
|
6
|
+
const state = build?.state === "error" ? "error" : build?.state === "checking" || build?.live ? "checking"
|
|
7
|
+
: build?.building || ["queued", "building"].includes(build?.state) ? "building" : build?.current ? "ready" : build?.stale ? "stale" : "unreported";
|
|
8
|
+
const labels = { error: "Preview build failed", checking: "Preview compiled; checking changes", building: "Preview build in progress", ready: "Preview build complete", stale: "Previous preview; current source not built", unreported: "Preview not built" };
|
|
9
|
+
return { state, label: `${draft ? "Draft · " : ""}${labels[state]}${draft && state === "ready" ? " · unaccepted" : ""}` };
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const previewGlyphs = {
|
|
13
|
+
unreported: '<circle cx="8" cy="8" r="3"/>',
|
|
14
|
+
building: '<circle cx="8" cy="8" r="5" stroke-dasharray="22 10"/>',
|
|
15
|
+
checking: '<circle cx="8" cy="8" r="5" stroke-dasharray="3 3"/><path d="m6 8 1.5 1.5L10 6"/>',
|
|
16
|
+
ready: '<circle cx="8" cy="8" r="5"/><path d="m5.5 8 1.7 1.7 3.3-3.4"/>',
|
|
17
|
+
stale: '<circle cx="8" cy="8" r="5" stroke-dasharray="2 3"/>',
|
|
18
|
+
error: '<circle cx="8" cy="8" r="5"/><path d="M8 5.5v3M8 10.5h.01"/>',
|
|
19
|
+
};
|
package/dist/showcase/style.css
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
:root{font:13px/1.5 system-ui,sans-serif;color-scheme:light;background:#fafafa;color:#444;--frame-bg:#fafafa;--frame-ink:#444;--frame-line:#ddd;--pane-width:min(276px,42vw)}
|
|
2
2
|
:root[data-theme="dark"]{color-scheme:dark;--frame-bg:#181818;--frame-ink:#ddd;--frame-line:#444;background:var(--frame-bg);color:var(--frame-ink)}
|
|
3
|
+
.entry-preview{float:right;display:inline-flex;align-items:center;margin-inline-start:8px;opacity:.65}.entry-preview svg{width:14px;height:14px}.entry-preview[data-state="building"] svg{animation:preview-spin 1s linear infinite}.entry-preview[data-state="error"],.entry-preview[data-state="ready"]{opacity:1}@keyframes preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.entry-preview svg{animation:none!important}}
|
|
3
4
|
*{box-sizing:border-box}body{margin:0;height:100vh;display:flex;flex-direction:column;overflow:hidden}button,a{font:inherit;color:inherit}button{cursor:pointer;background:transparent;border:1px solid var(--frame-line);border-radius:4px}button:focus-visible,a:focus-visible{outline:2px solid var(--frame-ink);outline-offset:2px}svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;flex:none}svg:not([aria-label]){pointer-events:none}
|
|
4
5
|
header{height:52px;display:flex;flex:none;border-bottom:1px solid var(--frame-line);align-items:stretch;background:var(--frame-bg)}#brand{width:var(--pane-width);display:flex;flex:none;gap:8px;align-items:center;padding:0 12px;border-right:1px solid var(--frame-line);font-weight:600;white-space:nowrap}#brand .mark{font-weight:700}#title{min-width:0;overflow:hidden;text-overflow:ellipsis}#pane-toggle{width:28px;height:28px;margin-inline-start:auto;display:grid;place-items:center;flex:none}.collapsed #brand{width:44px;padding:0 8px;border-right:0}.collapsed #brand .mark,.collapsed #title{display:none}
|
|
5
6
|
#sections{display:flex;gap:4px;align-items:center;min-width:0;overflow-x:auto;padding:8px}#sections button{display:flex;align-items:center;gap:8px;flex:none;border-color:transparent;padding:6px 10px}#sections button[aria-current="page"]{border-color:var(--frame-line)}#sections svg{opacity:.7}.actions{display:flex;align-items:center;gap:4px;margin-inline-start:auto;padding:8px;flex:none}.actions button{width:28px;height:28px;display:grid;place-items:center}
|
|
@@ -16,3 +17,7 @@ main{flex:1;min-height:0;display:flex}#sidebar{width:var(--pane-width);flex:none
|
|
|
16
17
|
/* A real iframe viewport keeps phone previews responsive without changing the app host. */
|
|
17
18
|
:root[data-viewport="phone"] #frame-slot{width:min(390px,100%);margin-inline:auto}
|
|
18
19
|
#viewport[aria-pressed="true"]{background:var(--frame-ink);color:var(--frame-bg)}
|
|
20
|
+
#split-view[aria-pressed="true"]{background:var(--frame-ink);color:var(--frame-bg)}button:disabled{cursor:default;opacity:.45}
|
|
21
|
+
.draft-badge{display:inline-block;font-size:11px;font-weight:400;white-space:nowrap;padding:1px 5px;margin-inline-start:8px;border:1px solid var(--frame-line);border-radius:4px}.draft-comparison{height:100%;display:grid;grid-template-columns:minmax(0,1fr);min-width:0}.draft-comparison[data-split="true"]{grid-template-columns:repeat(2,minmax(0,1fr))}.draft-version{display:flex;flex-direction:column;min-width:0;min-height:0}.draft-version+ .draft-version{border-inline-start:1px solid var(--frame-line)}.draft-version h2{font-size:12px;font-weight:600;padding:6px 12px;margin:0;border-bottom:1px solid var(--frame-line)}.draft-stage{flex:1;min-height:0;display:flex;justify-content:center}.draft-stage iframe{min-width:0}
|
|
22
|
+
:root[data-viewport="phone"] #frame-slot:has(.draft-comparison){width:100%}:root[data-viewport="phone"] .draft-stage iframe{width:min(390px,100%)}
|
|
23
|
+
@media(max-width:760px){.draft-comparison[data-split="true"]{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(2,minmax(0,1fr))}.draft-version+ .draft-version{border-inline-start:0;border-top:1px solid var(--frame-line)}}
|
package/dist/skills/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# ADS skills
|
|
2
2
|
|
|
3
|
+
All change-authoring workflows share the [auto-mode draft guide](ads-designer/references/drafts.md).
|
|
4
|
+
Drafts are tracked and previewable, including dependency and token-group changes.
|
|
5
|
+
Agents must review and accept the required drafts before reporting a coherent
|
|
6
|
+
design change complete; failed acceptance remains unfinished work.
|
|
7
|
+
|
|
3
8
|
Install the skills you need with `npx skills`:
|
|
4
9
|
|
|
5
10
|
```sh
|
|
@@ -3,6 +3,32 @@ name: ads-break-ui
|
|
|
3
3
|
description: Stress-test a project's local design-system components or patterns with extreme realistic content, empty and failure states, narrow containers, and accessibility settings. Build development fixtures, report layout failures, and fix them when requested.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
## Auto-mode tracked drafts
|
|
7
|
+
|
|
8
|
+
For iterative design work, read [tracked drafts](references/drafts.md) and use
|
|
9
|
+
`ads_create_draft` → ordinary edits → `ads_show_draft` → rendered review →
|
|
10
|
+
`ads_accept({id,revision})`. Use `ads_drafts` to find pending proposals and their
|
|
11
|
+
current revisions; catalogue entries mark owners with drafts. Enable mutations
|
|
12
|
+
for acceptance. The low-level guarded patch workflow below remains available for
|
|
13
|
+
focused repairs/migrations; it does not replace the draft preview loop.
|
|
14
|
+
|
|
15
|
+
A coherent design change may span multiple components, patterns or an entire
|
|
16
|
+
view. **Do not report that change complete while its intended work exists only
|
|
17
|
+
in drafts.** Validate and accept its required drafts, accepting dependencies
|
|
18
|
+
first and reviewing dependents again after promotion. If acceptance is blocked,
|
|
19
|
+
continue fixing it or report the exact unfinished draft/blocker. Retain a
|
|
20
|
+
proposal for later only when the user requests that outcome; never silently drop
|
|
21
|
+
requested work or bypass failed checks. Auto mode requires agent review, not a
|
|
22
|
+
new human confirmation step.
|
|
23
|
+
|
|
24
|
+
Drafts live in tracked `ads-drafts/` with `.ads` source. Pattern and
|
|
25
|
+
composition previews may depend on component/pattern/token drafts through normal
|
|
26
|
+
`@ds` imports in an isolated overlay. Accepting a dependency automatically switches
|
|
27
|
+
dependent drafts to its final implementation. Never import `.ads` draft files
|
|
28
|
+
into application or accepted ADS code. Shared token drafts support discovered
|
|
29
|
+
groups from `ads_tokens.tokenGroups`; they remain owned by `tokens`.
|
|
30
|
+
|
|
31
|
+
|
|
6
32
|
For validation scope, full audits, and CLI/MCP parity, read
|
|
7
33
|
[validation.md](references/validation.md).
|
|
8
34
|
|
|
@@ -21,6 +21,16 @@ UI references are allowed, but shared controllers cannot import component/patter
|
|
|
21
21
|
runtime implementations. Keep business data in application adapters. Measured
|
|
22
22
|
style writes retain exact `boundaries.styleWrites` properties; they do not allow
|
|
23
23
|
shared-token overrides or an extra styling layer.
|
|
24
|
+
Projects explicitly approve installed runtime packages through
|
|
25
|
+
`behaviorLibraries` in `ds.config.json`; each must also be a `package.json`
|
|
26
|
+
dependency. Components, patterns and controllers may use them directly, including
|
|
27
|
+
package subpaths. Extract a shared controller when behavior is shared. Type-only
|
|
28
|
+
and development-role imports retain their existing rules. An empty/missing list
|
|
29
|
+
allows no additional runtime packages beyond the configured framework and Linaria.
|
|
30
|
+
ADS checks declarations and installed versions, not third-party source or
|
|
31
|
+
transitive dependency trees. The preview build bundles used code normally inside
|
|
32
|
+
the MCP App sandbox. Existing project styling and measured-geometry guards keep
|
|
33
|
+
their scope; declaration creates no broad style-write permissions.
|
|
24
34
|
These gates inspect supported direct imports, markup and style boundaries.
|
|
25
35
|
External package internals and delegated DOM behavior still require source,
|
|
26
36
|
build and browser review; declaring a dependency does not prove it is headless.
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# On-demand visual captures
|
|
2
2
|
|
|
3
|
+
For a [tracked draft](drafts.md), pass `draft` and its exact `revision` to
|
|
4
|
+
`ads_capture`. Accepted/current and Draft/candidate images use warm preview hosts
|
|
5
|
+
without running draft acceptance checks. The candidate records the proposal
|
|
6
|
+
revision; changed inputs prevent publication. Read the returned PNG resources
|
|
7
|
+
for model-visible review before `ads_accept`. Compilation/screenshots alone do
|
|
8
|
+
not establish behavioral or acceptance evidence.
|
|
9
|
+
|
|
3
10
|
Use captures when reviewing appearance or a proposed visual change. Discover exact
|
|
4
11
|
scenario IDs with `ads_scenarios`; these are project-owned independently mountable
|
|
5
12
|
token, component, pattern and composition views. A component export alone is not
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Tracked drafts and auto-mode acceptance
|
|
2
|
+
|
|
3
|
+
Use this workflow for iterative design changes. Auto mode means the agent reviews
|
|
4
|
+
the rendered result and accepts it; it does not introduce a human approval gate.
|
|
5
|
+
Human acceptance controls are not part of this version.
|
|
6
|
+
|
|
7
|
+
## Complete a coherent design change
|
|
8
|
+
|
|
9
|
+
A unit of design work can span several components, a pattern or an entire view.
|
|
10
|
+
Do not finish that work with its intended changes left only in drafts. Review,
|
|
11
|
+
validate and accept all required drafts before reporting the change complete.
|
|
12
|
+
Accept dependency drafts first, then review their dependents again. If checks or
|
|
13
|
+
baseline conflicts block acceptance, fix them and continue. If progress requires
|
|
14
|
+
missing user input or an external change, report the work as unfinished, with the
|
|
15
|
+
exact draft and blocker. Never silently drop requested work or accept a failing
|
|
16
|
+
draft to meet this completion rule. Leave a draft intentionally only when the
|
|
17
|
+
user asks to retain a proposal for later review.
|
|
18
|
+
|
|
19
|
+
## Source and lifecycle
|
|
20
|
+
|
|
21
|
+
`ads_create_draft({units:["components/Button"], title:"Button spacing"})` creates
|
|
22
|
+
`ads-drafts/<id>/proposal.ads.draft.json` and `.ads` draft sources.
|
|
23
|
+
For example, `Button.tsx.ads` maps to the normal `Button.tsx` target. The final
|
|
24
|
+
`.ads` extension keeps proposed code out of default TypeScript/lint discovery,
|
|
25
|
+
without editing project tsconfig files. The manifest remains
|
|
26
|
+
`proposal.ads.draft.json`. These are ordinary tracked project files: commit them and review them in a PR.
|
|
27
|
+
Git is not required to create or recover a draft. Restarting ADS or cloning the
|
|
28
|
+
project discovers the same source. Generated compiler workspaces and execution
|
|
29
|
+
events remain under ignored `.ds/`; an interrupted check is never a pass.
|
|
30
|
+
|
|
31
|
+
The manifest maps each proposed file to its normal project target and records
|
|
32
|
+
its baseline fingerprint and owner. Edit returned source files with local file
|
|
33
|
+
tools. `ads_read_file` reads mapped draft source in bounded ranges.
|
|
34
|
+
`ads_update_draft` registers additions/deletions or edits source for remote
|
|
35
|
+
clients; pass the current revision from `ads_drafts`. `content:null` proposes a
|
|
36
|
+
deletion. Binary content uses `encoding:"base64"`; acceptance uses Git's existing
|
|
37
|
+
binary patch support. Do not edit accepted source to iterate a proposal.
|
|
38
|
+
|
|
39
|
+
`ads_drafts` lists only drafts. Filter by unit/query, page with offset/limit, or
|
|
40
|
+
pass id to inspect file mappings. Catalogue and scenario entries expose their
|
|
41
|
+
draft references. `ads_tokens` also lists tokenGroups derived from token CSS
|
|
42
|
+
files. For a group draft, create `{units:["tokens"],tokenGroups:["colors"]}` using
|
|
43
|
+
the actual returned IDs. Shared tokens remain owned by `tokens`; groups do not
|
|
44
|
+
create component-local value catalogues.
|
|
45
|
+
|
|
46
|
+
## Preview and dependencies
|
|
47
|
+
|
|
48
|
+
Call `ads_show_draft({id,scenario?})`, then inspect its actual `showcaseUrl` in a
|
|
49
|
+
browser. The preview reuses an isolated compiler workspace across edits and does
|
|
50
|
+
not run acceptance checks. Up to four draft compiler sessions stay warm; opening
|
|
51
|
+
more reclaims an older generated workspace without deleting its tracked proposal.
|
|
52
|
+
Creation queues compiler prewarming without delaying its response. Bursts of
|
|
53
|
+
creations coalesce, and only one queued compiler initializes at a time. A newer
|
|
54
|
+
speculative prewarm reclaims the older unused one; explicitly opened sessions
|
|
55
|
+
remain warm within the four-session bound. MCP edits
|
|
56
|
+
and direct draft-file edits notify warm previews through file events; periodic
|
|
57
|
+
reconciliation recovers missed events. Watched builds compile requested scenarios
|
|
58
|
+
and their dependencies, retaining roots used by other open previews. Full builds
|
|
59
|
+
and validation still cover the complete configured scope. Incremental semantic
|
|
60
|
+
analysis reuses unchanged TypeScript source trees without caching passing checks.
|
|
61
|
+
Reopening a known scenario renders through the existing compiler while a worker
|
|
62
|
+
refreshes catalogue metadata. Read `discovery.state` (`current`, `pending`,
|
|
63
|
+
`error`) and its metadata revision separately from the exact proposal revision.
|
|
64
|
+
New/missing scenario identities wait for fresh discovery. A previous preview may
|
|
65
|
+
stay visible until compilation finishes; pending/stale output is not evidence.
|
|
66
|
+
Reopen after edits to obtain the current revision.
|
|
67
|
+
Compilation is feedback, not passing behavior/visual evidence.
|
|
68
|
+
|
|
69
|
+
For model-visible images, use `ads_capture({scenario,draft:id,revision,...settings})`
|
|
70
|
+
and read the returned PNG resource URIs. This captures Accepted/current and
|
|
71
|
+
Draft/candidate without acceptance checks; new scenarios have only a candidate.
|
|
72
|
+
The candidate records the exact proposal revision. Edits during capture prevent
|
|
73
|
+
publication of its image slots. Captures establish appearance at those settings,
|
|
74
|
+
not passing acceptance or behavioral checks.
|
|
75
|
+
|
|
76
|
+
A pattern draft may use a component draft; a composition may use component,
|
|
77
|
+
pattern and token drafts. Declare their IDs in `dependencies` when creating or
|
|
78
|
+
updating the dependent draft. Keep normal `@ds` imports in all implementations
|
|
79
|
+
and scenarios. The preview overlays the proposed files at canonical paths; no
|
|
80
|
+
project code imports `.ads` draft source. Cycles, missing dependencies and
|
|
81
|
+
overlapping non-barrel edits are errors. Use one coupled draft for overlapping
|
|
82
|
+
changes. A coupled draft may declare up to eight existing/new owners.
|
|
83
|
+
|
|
84
|
+
Accept dependencies first. ADS removes resolved dependency IDs from dependent
|
|
85
|
+
manifests and their previews use the final accepted implementation automatically.
|
|
86
|
+
Independent shared-barrel exports are merged; overlapping source changes remain
|
|
87
|
+
explicit conflicts. Review the dependent's new revision before accepting it.
|
|
88
|
+
If a dependency is dropped, correct the remaining draft's dependency list.
|
|
89
|
+
|
|
90
|
+
DS Explorer keeps drafts in the ordinary Tokens, Components, Patterns and
|
|
91
|
+
Composition navigation. A Draft badge marks an owner with a pending proposal,
|
|
92
|
+
whether or not it has an accepted version. Select that entry and use the header
|
|
93
|
+
Split view toggle to compare Accepted and Draft in the right pane. Both use the
|
|
94
|
+
same scenario/theme and available or phone viewport width. New owners appear
|
|
95
|
+
in their normal section; without an accepted counterpart they show only the
|
|
96
|
+
draft and disable comparison. There is no separate Drafts tab or scenario picker.
|
|
97
|
+
An isolated overlay can also render an unchanged scenario as an explicit review
|
|
98
|
+
context; that alone does not give its owner a Draft badge. Use `ads_drafts` for
|
|
99
|
+
draft-only MCP listing.
|
|
100
|
+
|
|
101
|
+
After 20 retained module revisions, Explorer restarts the affected App to release
|
|
102
|
+
its module cache, then restores the selected scenario/theme/viewport. Comparison
|
|
103
|
+
keeps the other version mounted; no manual reload or draft acceptance is needed.
|
|
104
|
+
|
|
105
|
+
Explorer entry glyphs separately show preview build states in monochrome: not
|
|
106
|
+
built, building, compiled/checking, ready, stale and failed. MCP draft summaries
|
|
107
|
+
include `preview` and preview calls include `build`; inspect `building`,
|
|
108
|
+
`current`, `stale`, scenario revisions and `preview.resourceUri` for detail.
|
|
109
|
+
Subscribe to `ads://project/build` and `ads://project/drafts` for standard
|
|
110
|
+
resource-update notifications on completion, failure and metadata refresh, or
|
|
111
|
+
subscribe only to an active draft's `preview.resourceUri` for its isolated report.
|
|
112
|
+
Modern clients use `subscriptions/listen` resource filters; older clients use
|
|
113
|
+
`resources/subscribe`. Re-read notified resources to update the existing view;
|
|
114
|
+
unsubscribe on teardown and resubscribe/read after reconnect. Removal invalidates
|
|
115
|
+
the scoped resource. Poll when the host does not forward notifications.
|
|
116
|
+
Build completion and mounted-App rendering readiness are separate. Ready draft
|
|
117
|
+
output remains unaccepted. Review the
|
|
118
|
+
current rendered revision and complete acceptance before finishing the change.
|
|
119
|
+
|
|
120
|
+
## Accept or drop
|
|
121
|
+
|
|
122
|
+
After rendered review, call `ads_accept({id,revision})` once. It checks that exact
|
|
123
|
+
revision, runs mandatory ADS/registered Oxlint/project checks and affected
|
|
124
|
+
behavior checks against an isolated candidate, and applies passing changes at
|
|
125
|
+
their normal paths. Changes during checking or baseline conflicts prevent
|
|
126
|
+
application. Successful acceptance removes the proposal and records an event.
|
|
127
|
+
There is no separate Apply or Iterate action. A failed attempt retains the draft;
|
|
128
|
+
inspect its returned resultId with `ads_results` and fix the reported boundary.
|
|
129
|
+
|
|
130
|
+
`ads_drop_draft({id,revision})` deletes a proposal and its generated preview,
|
|
131
|
+
without changing accepted source. Drop replaces a separate refusal action.
|
|
132
|
+
Read `ads_status.drafts`, `ads_drafts.events` or `ads://project/drafts` to observe
|
|
133
|
+
decisions. Resource notifications are available, but the host may not wake an
|
|
134
|
+
agent; always use the returned outcome or persisted status as the fallback.
|
|
135
|
+
|
|
136
|
+
## Build isolation
|
|
137
|
+
|
|
138
|
+
Draft presence alone must not fail an application build. Drafts are excluded from
|
|
139
|
+
normal ADS discovery and validation inputs. ADS import guards reject direct,
|
|
140
|
+
aliased, re-exported, dynamic and symlink imports of marked files or ads-drafts/,
|
|
141
|
+
including attempts from scenarios/tests outside the isolated preview overlay.
|
|
142
|
+
Install `draftImportGuard()` from `@reqvire-org/ads/scenarios/vite` in application
|
|
143
|
+
Vite/Rollup builds as well as keeping the mandatory ADS check/build pipeline.
|
|
144
|
+
It rejects resolved draft modules and glob-expanded module loads. Merely adding a
|
|
145
|
+
TypeScript exclude pattern is not an import boundary. Do not export drafts, add
|
|
146
|
+
production aliases to them, or copy draft storage into published assets.
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Advanced guarded editing
|
|
2
2
|
|
|
3
|
+
For iterative design, prefer the [tracked auto-mode draft workflow](drafts.md):
|
|
4
|
+
ordinary edits and fast previews, then exact-revision acceptance. Complete a
|
|
5
|
+
coherent change by accepting its required drafts, or report it as unfinished.
|
|
6
|
+
The disposable `.ds/patch-drafts/` copies described below are low-level patch
|
|
7
|
+
staging for focused repairs and migrations, not tracked review proposals.
|
|
8
|
+
|
|
3
9
|
Use `ads_apply_patch` for independent owner edits. `ads_prepare_patch` can create a
|
|
4
10
|
local draft of one owner and its companions; edit that directory with local file
|
|
5
11
|
tools, request `action:"diff"`, then apply the returned patchFile. Discard the
|
|
@@ -67,3 +67,9 @@ separate latest validation result, alongside verification and mutation results.
|
|
|
67
67
|
Source changes during execution reject success and leave the previous full
|
|
68
68
|
baseline intact. Skipped registered behavior cases never pass; a project with no
|
|
69
69
|
registered behavior contracts reports that stage as skipped with a reason.
|
|
70
|
+
|
|
71
|
+
Registered browser verification queues the selected scenario roots together
|
|
72
|
+
before browser workers open their pages. They share one candidate graph and
|
|
73
|
+
keep independent App state. This avoids compiling a growing graph per page.
|
|
74
|
+
A graph revision changing during startup keeps the preview pending until a
|
|
75
|
+
coherent current build mounts; it does not establish passing case evidence.
|
|
@@ -3,6 +3,32 @@ name: ads-designer
|
|
|
3
3
|
description: Bootstrap an empty local React design system from bundled scaffolding, or build UI using a project's existing design system. Covers shared token contracts, local ownership, public APIs, external source integration, showcase inspection, and validation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
## Auto-mode tracked drafts
|
|
7
|
+
|
|
8
|
+
For iterative design work, read [tracked drafts](references/drafts.md) and use
|
|
9
|
+
`ads_create_draft` → ordinary edits → `ads_show_draft` → rendered review →
|
|
10
|
+
`ads_accept({id,revision})`. Use `ads_drafts` to find pending proposals and their
|
|
11
|
+
current revisions; catalogue entries mark owners with drafts. Enable mutations
|
|
12
|
+
for acceptance. The low-level guarded patch workflow below remains available for
|
|
13
|
+
focused repairs/migrations; it does not replace the draft preview loop.
|
|
14
|
+
|
|
15
|
+
A coherent design change may span multiple components, patterns or an entire
|
|
16
|
+
view. **Do not report that change complete while its intended work exists only
|
|
17
|
+
in drafts.** Validate and accept its required drafts, accepting dependencies
|
|
18
|
+
first and reviewing dependents again after promotion. If acceptance is blocked,
|
|
19
|
+
continue fixing it or report the exact unfinished draft/blocker. Retain a
|
|
20
|
+
proposal for later only when the user requests that outcome; never silently drop
|
|
21
|
+
requested work or bypass failed checks. Auto mode requires agent review, not a
|
|
22
|
+
new human confirmation step.
|
|
23
|
+
|
|
24
|
+
Drafts live in tracked `ads-drafts/` with `.ads` source. Pattern and
|
|
25
|
+
composition previews may depend on component/pattern/token drafts through normal
|
|
26
|
+
`@ds` imports in an isolated overlay. Accepting a dependency automatically switches
|
|
27
|
+
dependent drafts to its final implementation. Never import `.ads` draft files
|
|
28
|
+
into application or accepted ADS code. Shared token drafts support discovered
|
|
29
|
+
groups from `ads_tokens.tokenGroups`; they remain owned by `tokens`.
|
|
30
|
+
|
|
31
|
+
|
|
6
32
|
For validation scope, full audits, and CLI/MCP parity, read
|
|
7
33
|
[validation.md](references/validation.md).
|
|
8
34
|
|
|
@@ -126,6 +152,13 @@ matching-property fixes, plus the build resolver for preserving opaque custom
|
|
|
126
152
|
properties through extraction. Review warnings in the real `cx` composition and verify
|
|
127
153
|
computed styles across affected sizes/states; retain intentional product behavior.
|
|
128
154
|
|
|
155
|
+
For positioning, menu/listbox keyboard handling, focus trapping and virtual lists,
|
|
156
|
+
prefer an installed library already listed in `ds.config.json` behaviorLibraries.
|
|
157
|
+
Use it directly in its consuming component, pattern or controller, with project-owned
|
|
158
|
+
styling and existing measured-geometry boundaries. If none fits, suggest a suitable
|
|
159
|
+
framework-free package for approval or implement natively. Add dependencies and
|
|
160
|
+
allowlist entries only with authorization; existing approval need not be repeated.
|
|
161
|
+
|
|
129
162
|
Controllers are UI behavior owners: private helpers stay with their component or
|
|
130
163
|
pattern; reusable controllers use discovered `controllers/<Name>` units. Use the
|
|
131
164
|
project's configured framework and declared dependencies, or plain TypeScript,
|
|
@@ -3,9 +3,10 @@ import { defineConfig } from "vite";
|
|
|
3
3
|
import react from "@vitejs/plugin-react";
|
|
4
4
|
import wyw from "@wyw-in-js/vite";
|
|
5
5
|
import { linariaTagResolver } from "@reqvire-org/ads/linaria";
|
|
6
|
+
import { draftImportGuard } from "@reqvire-org/ads/scenarios/vite";
|
|
6
7
|
|
|
7
8
|
export default defineConfig({
|
|
8
|
-
plugins: [wyw({ tagResolver: linariaTagResolver }), react()],
|
|
9
|
+
plugins: [draftImportGuard(), wyw({ tagResolver: linariaTagResolver }), react()],
|
|
9
10
|
resolve: {
|
|
10
11
|
alias: { "@ds/review": path.resolve(import.meta.dirname, "design-system/review/index.ts"), "@ds": path.resolve(import.meta.dirname, "design-system/index.ts") },
|
|
11
12
|
},
|
|
@@ -21,6 +21,16 @@ UI references are allowed, but shared controllers cannot import component/patter
|
|
|
21
21
|
runtime implementations. Keep business data in application adapters. Measured
|
|
22
22
|
style writes retain exact `boundaries.styleWrites` properties; they do not allow
|
|
23
23
|
shared-token overrides or an extra styling layer.
|
|
24
|
+
Projects explicitly approve installed runtime packages through
|
|
25
|
+
`behaviorLibraries` in `ds.config.json`; each must also be a `package.json`
|
|
26
|
+
dependency. Components, patterns and controllers may use them directly, including
|
|
27
|
+
package subpaths. Extract a shared controller when behavior is shared. Type-only
|
|
28
|
+
and development-role imports retain their existing rules. An empty/missing list
|
|
29
|
+
allows no additional runtime packages beyond the configured framework and Linaria.
|
|
30
|
+
ADS checks declarations and installed versions, not third-party source or
|
|
31
|
+
transitive dependency trees. The preview build bundles used code normally inside
|
|
32
|
+
the MCP App sandbox. Existing project styling and measured-geometry guards keep
|
|
33
|
+
their scope; declaration creates no broad style-write permissions.
|
|
24
34
|
These gates inspect supported direct imports, markup and style boundaries.
|
|
25
35
|
External package internals and delegated DOM behavior still require source,
|
|
26
36
|
build and browser review; declaring a dependency does not prove it is headless.
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# On-demand visual captures
|
|
2
2
|
|
|
3
|
+
For a [tracked draft](drafts.md), pass `draft` and its exact `revision` to
|
|
4
|
+
`ads_capture`. Accepted/current and Draft/candidate images use warm preview hosts
|
|
5
|
+
without running draft acceptance checks. The candidate records the proposal
|
|
6
|
+
revision; changed inputs prevent publication. Read the returned PNG resources
|
|
7
|
+
for model-visible review before `ads_accept`. Compilation/screenshots alone do
|
|
8
|
+
not establish behavioral or acceptance evidence.
|
|
9
|
+
|
|
3
10
|
Use captures when reviewing appearance or a proposed visual change. Discover exact
|
|
4
11
|
scenario IDs with `ads_scenarios`; these are project-owned independently mountable
|
|
5
12
|
token, component, pattern and composition views. A component export alone is not
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Tracked drafts and auto-mode acceptance
|
|
2
|
+
|
|
3
|
+
Use this workflow for iterative design changes. Auto mode means the agent reviews
|
|
4
|
+
the rendered result and accepts it; it does not introduce a human approval gate.
|
|
5
|
+
Human acceptance controls are not part of this version.
|
|
6
|
+
|
|
7
|
+
## Complete a coherent design change
|
|
8
|
+
|
|
9
|
+
A unit of design work can span several components, a pattern or an entire view.
|
|
10
|
+
Do not finish that work with its intended changes left only in drafts. Review,
|
|
11
|
+
validate and accept all required drafts before reporting the change complete.
|
|
12
|
+
Accept dependency drafts first, then review their dependents again. If checks or
|
|
13
|
+
baseline conflicts block acceptance, fix them and continue. If progress requires
|
|
14
|
+
missing user input or an external change, report the work as unfinished, with the
|
|
15
|
+
exact draft and blocker. Never silently drop requested work or accept a failing
|
|
16
|
+
draft to meet this completion rule. Leave a draft intentionally only when the
|
|
17
|
+
user asks to retain a proposal for later review.
|
|
18
|
+
|
|
19
|
+
## Source and lifecycle
|
|
20
|
+
|
|
21
|
+
`ads_create_draft({units:["components/Button"], title:"Button spacing"})` creates
|
|
22
|
+
`ads-drafts/<id>/proposal.ads.draft.json` and `.ads` draft sources.
|
|
23
|
+
For example, `Button.tsx.ads` maps to the normal `Button.tsx` target. The final
|
|
24
|
+
`.ads` extension keeps proposed code out of default TypeScript/lint discovery,
|
|
25
|
+
without editing project tsconfig files. The manifest remains
|
|
26
|
+
`proposal.ads.draft.json`. These are ordinary tracked project files: commit them and review them in a PR.
|
|
27
|
+
Git is not required to create or recover a draft. Restarting ADS or cloning the
|
|
28
|
+
project discovers the same source. Generated compiler workspaces and execution
|
|
29
|
+
events remain under ignored `.ds/`; an interrupted check is never a pass.
|
|
30
|
+
|
|
31
|
+
The manifest maps each proposed file to its normal project target and records
|
|
32
|
+
its baseline fingerprint and owner. Edit returned source files with local file
|
|
33
|
+
tools. `ads_read_file` reads mapped draft source in bounded ranges.
|
|
34
|
+
`ads_update_draft` registers additions/deletions or edits source for remote
|
|
35
|
+
clients; pass the current revision from `ads_drafts`. `content:null` proposes a
|
|
36
|
+
deletion. Binary content uses `encoding:"base64"`; acceptance uses Git's existing
|
|
37
|
+
binary patch support. Do not edit accepted source to iterate a proposal.
|
|
38
|
+
|
|
39
|
+
`ads_drafts` lists only drafts. Filter by unit/query, page with offset/limit, or
|
|
40
|
+
pass id to inspect file mappings. Catalogue and scenario entries expose their
|
|
41
|
+
draft references. `ads_tokens` also lists tokenGroups derived from token CSS
|
|
42
|
+
files. For a group draft, create `{units:["tokens"],tokenGroups:["colors"]}` using
|
|
43
|
+
the actual returned IDs. Shared tokens remain owned by `tokens`; groups do not
|
|
44
|
+
create component-local value catalogues.
|
|
45
|
+
|
|
46
|
+
## Preview and dependencies
|
|
47
|
+
|
|
48
|
+
Call `ads_show_draft({id,scenario?})`, then inspect its actual `showcaseUrl` in a
|
|
49
|
+
browser. The preview reuses an isolated compiler workspace across edits and does
|
|
50
|
+
not run acceptance checks. Up to four draft compiler sessions stay warm; opening
|
|
51
|
+
more reclaims an older generated workspace without deleting its tracked proposal.
|
|
52
|
+
Creation queues compiler prewarming without delaying its response. Bursts of
|
|
53
|
+
creations coalesce, and only one queued compiler initializes at a time. A newer
|
|
54
|
+
speculative prewarm reclaims the older unused one; explicitly opened sessions
|
|
55
|
+
remain warm within the four-session bound. MCP edits
|
|
56
|
+
and direct draft-file edits notify warm previews through file events; periodic
|
|
57
|
+
reconciliation recovers missed events. Watched builds compile requested scenarios
|
|
58
|
+
and their dependencies, retaining roots used by other open previews. Full builds
|
|
59
|
+
and validation still cover the complete configured scope. Incremental semantic
|
|
60
|
+
analysis reuses unchanged TypeScript source trees without caching passing checks.
|
|
61
|
+
Reopening a known scenario renders through the existing compiler while a worker
|
|
62
|
+
refreshes catalogue metadata. Read `discovery.state` (`current`, `pending`,
|
|
63
|
+
`error`) and its metadata revision separately from the exact proposal revision.
|
|
64
|
+
New/missing scenario identities wait for fresh discovery. A previous preview may
|
|
65
|
+
stay visible until compilation finishes; pending/stale output is not evidence.
|
|
66
|
+
Reopen after edits to obtain the current revision.
|
|
67
|
+
Compilation is feedback, not passing behavior/visual evidence.
|
|
68
|
+
|
|
69
|
+
For model-visible images, use `ads_capture({scenario,draft:id,revision,...settings})`
|
|
70
|
+
and read the returned PNG resource URIs. This captures Accepted/current and
|
|
71
|
+
Draft/candidate without acceptance checks; new scenarios have only a candidate.
|
|
72
|
+
The candidate records the exact proposal revision. Edits during capture prevent
|
|
73
|
+
publication of its image slots. Captures establish appearance at those settings,
|
|
74
|
+
not passing acceptance or behavioral checks.
|
|
75
|
+
|
|
76
|
+
A pattern draft may use a component draft; a composition may use component,
|
|
77
|
+
pattern and token drafts. Declare their IDs in `dependencies` when creating or
|
|
78
|
+
updating the dependent draft. Keep normal `@ds` imports in all implementations
|
|
79
|
+
and scenarios. The preview overlays the proposed files at canonical paths; no
|
|
80
|
+
project code imports `.ads` draft source. Cycles, missing dependencies and
|
|
81
|
+
overlapping non-barrel edits are errors. Use one coupled draft for overlapping
|
|
82
|
+
changes. A coupled draft may declare up to eight existing/new owners.
|
|
83
|
+
|
|
84
|
+
Accept dependencies first. ADS removes resolved dependency IDs from dependent
|
|
85
|
+
manifests and their previews use the final accepted implementation automatically.
|
|
86
|
+
Independent shared-barrel exports are merged; overlapping source changes remain
|
|
87
|
+
explicit conflicts. Review the dependent's new revision before accepting it.
|
|
88
|
+
If a dependency is dropped, correct the remaining draft's dependency list.
|
|
89
|
+
|
|
90
|
+
DS Explorer keeps drafts in the ordinary Tokens, Components, Patterns and
|
|
91
|
+
Composition navigation. A Draft badge marks an owner with a pending proposal,
|
|
92
|
+
whether or not it has an accepted version. Select that entry and use the header
|
|
93
|
+
Split view toggle to compare Accepted and Draft in the right pane. Both use the
|
|
94
|
+
same scenario/theme and available or phone viewport width. New owners appear
|
|
95
|
+
in their normal section; without an accepted counterpart they show only the
|
|
96
|
+
draft and disable comparison. There is no separate Drafts tab or scenario picker.
|
|
97
|
+
An isolated overlay can also render an unchanged scenario as an explicit review
|
|
98
|
+
context; that alone does not give its owner a Draft badge. Use `ads_drafts` for
|
|
99
|
+
draft-only MCP listing.
|
|
100
|
+
|
|
101
|
+
After 20 retained module revisions, Explorer restarts the affected App to release
|
|
102
|
+
its module cache, then restores the selected scenario/theme/viewport. Comparison
|
|
103
|
+
keeps the other version mounted; no manual reload or draft acceptance is needed.
|
|
104
|
+
|
|
105
|
+
Explorer entry glyphs separately show preview build states in monochrome: not
|
|
106
|
+
built, building, compiled/checking, ready, stale and failed. MCP draft summaries
|
|
107
|
+
include `preview` and preview calls include `build`; inspect `building`,
|
|
108
|
+
`current`, `stale`, scenario revisions and `preview.resourceUri` for detail.
|
|
109
|
+
Subscribe to `ads://project/build` and `ads://project/drafts` for standard
|
|
110
|
+
resource-update notifications on completion, failure and metadata refresh, or
|
|
111
|
+
subscribe only to an active draft's `preview.resourceUri` for its isolated report.
|
|
112
|
+
Modern clients use `subscriptions/listen` resource filters; older clients use
|
|
113
|
+
`resources/subscribe`. Re-read notified resources to update the existing view;
|
|
114
|
+
unsubscribe on teardown and resubscribe/read after reconnect. Removal invalidates
|
|
115
|
+
the scoped resource. Poll when the host does not forward notifications.
|
|
116
|
+
Build completion and mounted-App rendering readiness are separate. Ready draft
|
|
117
|
+
output remains unaccepted. Review the
|
|
118
|
+
current rendered revision and complete acceptance before finishing the change.
|
|
119
|
+
|
|
120
|
+
## Accept or drop
|
|
121
|
+
|
|
122
|
+
After rendered review, call `ads_accept({id,revision})` once. It checks that exact
|
|
123
|
+
revision, runs mandatory ADS/registered Oxlint/project checks and affected
|
|
124
|
+
behavior checks against an isolated candidate, and applies passing changes at
|
|
125
|
+
their normal paths. Changes during checking or baseline conflicts prevent
|
|
126
|
+
application. Successful acceptance removes the proposal and records an event.
|
|
127
|
+
There is no separate Apply or Iterate action. A failed attempt retains the draft;
|
|
128
|
+
inspect its returned resultId with `ads_results` and fix the reported boundary.
|
|
129
|
+
|
|
130
|
+
`ads_drop_draft({id,revision})` deletes a proposal and its generated preview,
|
|
131
|
+
without changing accepted source. Drop replaces a separate refusal action.
|
|
132
|
+
Read `ads_status.drafts`, `ads_drafts.events` or `ads://project/drafts` to observe
|
|
133
|
+
decisions. Resource notifications are available, but the host may not wake an
|
|
134
|
+
agent; always use the returned outcome or persisted status as the fallback.
|
|
135
|
+
|
|
136
|
+
## Build isolation
|
|
137
|
+
|
|
138
|
+
Draft presence alone must not fail an application build. Drafts are excluded from
|
|
139
|
+
normal ADS discovery and validation inputs. ADS import guards reject direct,
|
|
140
|
+
aliased, re-exported, dynamic and symlink imports of marked files or ads-drafts/,
|
|
141
|
+
including attempts from scenarios/tests outside the isolated preview overlay.
|
|
142
|
+
Install `draftImportGuard()` from `@reqvire-org/ads/scenarios/vite` in application
|
|
143
|
+
Vite/Rollup builds as well as keeping the mandatory ADS check/build pipeline.
|
|
144
|
+
It rejects resolved draft modules and glob-expanded module loads. Merely adding a
|
|
145
|
+
TypeScript exclude pattern is not an import boundary. Do not export drafts, add
|
|
146
|
+
production aliases to them, or copy draft storage into published assets.
|