@reqvire-org/ads 0.3.35 → 0.3.37
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 +10 -8
- package/dist/bootstrap-ds/README.md +8 -9
- package/dist/bootstrap-ds/ds.config.json +1 -8
- package/dist/bootstrap-ds/package.json +4 -3
- package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +2 -32
- package/dist/bun-compiler.mjs +13 -0
- package/dist/bun-worker.mjs +9 -0
- package/dist/check.mjs +7 -4
- package/dist/cli.mjs +11 -7
- package/dist/config.mjs +22 -4
- package/dist/development-runtime.mjs +3 -1
- package/dist/init.mjs +16 -18
- package/dist/mcp/build-status.mjs +6 -4
- package/dist/mcp/context.mjs +9 -4
- package/dist/mcp/drafts.mjs +9 -4
- package/dist/mcp/mutation-limits.mjs +2 -0
- package/dist/mcp/mutations.mjs +8 -17
- package/dist/mcp/patch.mjs +5 -3
- package/dist/mcp/preview-watch.mjs +21 -9
- package/dist/mcp/preview-widget.bundle.js +58 -63
- package/dist/mcp/preview-work.mjs +1 -15
- package/dist/mcp/project-widget.bundle.js +57 -62
- package/dist/mcp/prompts.mjs +2 -2
- package/dist/mcp/resource-loader.js +32 -10
- package/dist/mcp/server.mjs +90 -35
- package/dist/mcp/widget.bundle.js +59 -64
- package/dist/preview-builder.mjs +17 -5
- package/dist/preview-bun.mjs +266 -0
- package/dist/preview-imports.mjs +73 -0
- package/dist/preview-resources.mjs +26 -14
- package/dist/scenario-inspector.mjs +11 -4
- package/dist/scenarios-compiler.mjs +47 -6
- package/dist/showcase/client.bundle.js +68 -72
- package/dist/showcase/index.html +2 -2
- package/dist/showcase/sandbox.bundle.js +1 -1
- package/dist/showcase/style.css +4 -0
- package/dist/skills/ads-break-ui/SKILL.md +39 -40
- package/dist/skills/ads-break-ui/references/drafts.md +12 -3
- package/dist/skills/ads-break-ui/references/guarded-editing.md +6 -5
- package/dist/skills/ads-break-ui/references/runtimes.md +91 -140
- package/dist/skills/ads-break-ui/references/validation.md +13 -3
- package/dist/skills/ads-break-ui/references/workflows.md +82 -0
- package/dist/skills/ads-designer/SKILL.md +38 -39
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +8 -9
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -8
- package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +4 -3
- package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +2 -32
- package/dist/skills/ads-designer/references/cli.md +24 -20
- package/dist/skills/ads-designer/references/drafts.md +12 -3
- package/dist/skills/ads-designer/references/guarded-editing.md +6 -5
- package/dist/skills/ads-designer/references/runtimes.md +91 -140
- package/dist/skills/ads-designer/references/validation.md +13 -3
- package/dist/skills/ads-designer/references/workflows.md +82 -0
- package/dist/skills/ads-import/SKILL.md +40 -42
- package/dist/skills/ads-import/references/cli.md +24 -20
- package/dist/skills/ads-import/references/drafts.md +12 -3
- package/dist/skills/ads-import/references/guarded-editing.md +6 -5
- package/dist/skills/ads-import/references/runtimes.md +91 -140
- package/dist/skills/ads-import/references/validation.md +13 -3
- package/dist/skills/ads-import/references/workflows.md +82 -0
- package/dist/skills/ads-motion/SKILL.md +37 -38
- package/dist/skills/ads-motion/references/drafts.md +12 -3
- package/dist/skills/ads-motion/references/guarded-editing.md +6 -5
- package/dist/skills/ads-motion/references/runtimes.md +91 -140
- package/dist/skills/ads-motion/references/validation.md +13 -3
- package/dist/skills/ads-motion/references/workflows.md +82 -0
- package/dist/skills/ads-port/SKILL.md +37 -38
- package/dist/skills/ads-port/references/cli.md +24 -20
- package/dist/skills/ads-port/references/drafts.md +12 -3
- package/dist/skills/ads-port/references/guarded-editing.md +6 -5
- package/dist/skills/ads-port/references/runtimes.md +91 -140
- package/dist/skills/ads-port/references/validation.md +13 -3
- package/dist/skills/ads-port/references/workflows.md +82 -0
- package/dist/usage.mjs +84 -0
- package/dist/validation.mjs +0 -12
- package/dist/verification/browser.mjs +77 -48
- package/docs/ADS.md +17 -11
- package/docs/ARCHITECTURE.md +43 -29
- package/docs/BEHAVIORS.md +3 -3
- package/docs/CHANGELOG.md +67 -12
- package/docs/GUIDE.md +96 -53
- package/docs/MCP.md +97 -123
- package/docs/benchmarks/bun-previews.md +91 -0
- package/docs/benchmarks/gidi-preview-memory.md +4 -0
- package/package.json +15 -13
|
@@ -207,6 +207,20 @@ export async function runScenarioCompiler(directory, { watched = false, validate
|
|
|
207
207
|
const requested = new Set();
|
|
208
208
|
const pending = new Set();
|
|
209
209
|
let active;
|
|
210
|
+
const prewarm = watched && process.env.ADS_MCP_PREWARM_VIEWS === "1";
|
|
211
|
+
const warmed = new Set(), warmFailures = new Set();
|
|
212
|
+
let preferred, warming;
|
|
213
|
+
if(prewarm)try{preferred=JSON.parse(readFileSync(path.join(root,".ds/last-preview.json"),"utf8")).scenario;}catch{/* First startup warms the first view. */}
|
|
214
|
+
function warmProgress() {
|
|
215
|
+
if(!prewarm)return;
|
|
216
|
+
const completed=entries.filter(entry=>warmed.has(entry.id)).length,failed=entries.filter(entry=>warmFailures.has(entry.id)).length;
|
|
217
|
+
reporter.warmup({state:completed===entries.length?"ready":completed+failed===entries.length?"error":"warming",completed,total:entries.length,failed,...(warming?{active:warming}:{})});
|
|
218
|
+
}
|
|
219
|
+
function nextWarm() {
|
|
220
|
+
if(!prewarm||registryFailure)return;
|
|
221
|
+
return entries.find(entry=>entry.id===preferred&&!requested.has(entry.id)&&!warmed.has(entry.id))??entries.find(entry=>!requested.has(entry.id)&&!warmed.has(entry.id));
|
|
222
|
+
}
|
|
223
|
+
warmProgress();
|
|
210
224
|
let compiling = false;
|
|
211
225
|
let stopped = false;
|
|
212
226
|
let generation = 0;
|
|
@@ -317,7 +331,7 @@ export async function runScenarioCompiler(directory, { watched = false, validate
|
|
|
317
331
|
try { readPreviewManifest(options, { verify: true }); }
|
|
318
332
|
catch { reusable = false; }
|
|
319
333
|
}
|
|
320
|
-
const outcomes = await checkedBuild(stamp, () => reusable ? null : buildGraph(entries, options, track, { watched: false }));
|
|
334
|
+
const outcomes = await checkedBuild(stamp, () => reusable ? null : buildGraph(entries, options, track, { watched: false, sourceRevision }));
|
|
321
335
|
const failure = outcomes.find(outcome => outcome.status === "rejected");
|
|
322
336
|
if (failure) throw failure.reason;
|
|
323
337
|
cache.assertCompiler();
|
|
@@ -334,6 +348,8 @@ export async function runScenarioCompiler(directory, { watched = false, validate
|
|
|
334
348
|
publishedStamp = stamp;
|
|
335
349
|
publishedEntries = new Set(entries.map(entry => entry.id));
|
|
336
350
|
cache.recordProduction(stamp);
|
|
351
|
+
for(const entry of entries){warmed.add(entry.id);warmFailures.delete(entry.id);}
|
|
352
|
+
warmProgress();
|
|
337
353
|
reporter.progress("idle");
|
|
338
354
|
return true;
|
|
339
355
|
} catch (error) {
|
|
@@ -360,7 +376,10 @@ export async function runScenarioCompiler(directory, { watched = false, validate
|
|
|
360
376
|
reporter.setApps(buildApps());
|
|
361
377
|
}
|
|
362
378
|
const registryReused = !!prepared && JSON.stringify(prepared) === JSON.stringify(entries);
|
|
363
|
-
|
|
379
|
+
// Publication/cache identities follow discovery order, never navigation
|
|
380
|
+
// order. Otherwise warming a non-first view produces a full graph that
|
|
381
|
+
// cannot match the next process's canonical registry and rebuilds forever.
|
|
382
|
+
const selected = registryReused ? prepared : entries.filter(entry=>requested.has(entry.id));
|
|
364
383
|
const candidate = { generation, stamp, sourceRevision, registry: [...entries], entries: selected, dependencies: new Set(), registryReused };
|
|
365
384
|
// Retain roots requested by other mounted Apps, without compiling untouched
|
|
366
385
|
// catalogue entries. Production/unwatched builds still cover all entries.
|
|
@@ -387,7 +406,7 @@ export async function runScenarioCompiler(directory, { watched = false, validate
|
|
|
387
406
|
cache.assertCompiler();
|
|
388
407
|
const cached = cachedPreviewPublication(options, candidate.entries, cache.graphRevision());
|
|
389
408
|
if (cached && cache.reusableEntries(candidate.entries,cached.revision)) { candidate.reused = true; return cached; }
|
|
390
|
-
return buildGraph(candidate.entries, options, track, { watched: true });
|
|
409
|
+
return buildGraph(candidate.entries, options, track, { watched: true, sourceRevision });
|
|
391
410
|
});
|
|
392
411
|
liveCandidate = candidate;
|
|
393
412
|
try {
|
|
@@ -396,6 +415,8 @@ export async function runScenarioCompiler(directory, { watched = false, validate
|
|
|
396
415
|
if (publication.publishLive) {
|
|
397
416
|
publication.publishLive(reporter.session);
|
|
398
417
|
reporter.live({ revision: publication.revision, sourceRevision });
|
|
418
|
+
for(const entry of candidate.entries){warmed.add(entry.id);warmFailures.delete(entry.id);}
|
|
419
|
+
warmProgress();
|
|
399
420
|
}
|
|
400
421
|
reporter.progress("validation");
|
|
401
422
|
} catch (error) {
|
|
@@ -406,6 +427,8 @@ export async function runScenarioCompiler(directory, { watched = false, validate
|
|
|
406
427
|
}
|
|
407
428
|
function rejectLive(candidate, error) {
|
|
408
429
|
candidate.failed = true;
|
|
430
|
+
for(const entry of candidate.entries){warmed.delete(entry.id);warmFailures.add(entry.id);}
|
|
431
|
+
warmProgress();
|
|
409
432
|
reporter.batch(() => {
|
|
410
433
|
reporter.live(undefined);
|
|
411
434
|
for (const entry of candidate.entries) reporter.error(entry.id, candidate.revisions.get(entry.id), error);
|
|
@@ -478,7 +501,7 @@ export async function runScenarioCompiler(directory, { watched = false, validate
|
|
|
478
501
|
if (compiling) return;
|
|
479
502
|
compiling = true;
|
|
480
503
|
try {
|
|
481
|
-
while ((pending.size || fullRequest && fullRequest !== completedFull) && !stopped) {
|
|
504
|
+
while ((pending.size || fullRequest && fullRequest !== completedFull || nextWarm()) && !stopped) {
|
|
482
505
|
if (fullRequest && fullRequest !== completedFull) {
|
|
483
506
|
const token = fullRequest, sourceRevision = previewSourceRevision(options);
|
|
484
507
|
// Production compilation and incremental compilation never overlap.
|
|
@@ -498,10 +521,26 @@ export async function runScenarioCompiler(directory, { watched = false, validate
|
|
|
498
521
|
continue;
|
|
499
522
|
}
|
|
500
523
|
if (registryFailure) break;
|
|
524
|
+
if(!pending.size){
|
|
525
|
+
// Let incoming foreground selections enter the queue before the next
|
|
526
|
+
// background job in the shared compiler.
|
|
527
|
+
await new Promise(resolve=>setTimeout(resolve,50));
|
|
528
|
+
if(stopped)break;
|
|
529
|
+
if(!pending.size){
|
|
530
|
+
const entry=nextWarm();
|
|
531
|
+
if(entry){
|
|
532
|
+
// Bun can finish the remaining graph in one bounded build after
|
|
533
|
+
// the first view. Rebuilding 1, 2, ... N roots repeats bundling N
|
|
534
|
+
// times despite the persistent per-file transform cache.
|
|
535
|
+
const warm=buildGraph?.warmBatch&&warmed.size?entries.filter(item=>!requested.has(item.id)&&!warmed.has(item.id)):[entry];
|
|
536
|
+
for(const item of warm){requested.add(item.id);pending.add(item.id);}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
501
540
|
const id = pending.has(active) ? active : pending.values().next().value;
|
|
502
541
|
pending.delete(id);
|
|
503
542
|
const entry = entries.find(entry => entry.id === id);
|
|
504
|
-
if (entry) await compile(entry);
|
|
543
|
+
if (entry) {warming=id;warmProgress();try{await compile(entry);}finally{warming=undefined;warmProgress();}}
|
|
505
544
|
}
|
|
506
545
|
} catch (error) { failure(error); }
|
|
507
546
|
finally { compiling = false; }
|
|
@@ -565,6 +604,7 @@ export async function runScenarioCompiler(directory, { watched = false, validate
|
|
|
565
604
|
++generation;
|
|
566
605
|
reporter.progress("queued");
|
|
567
606
|
validation = undefined;
|
|
607
|
+
warmed.clear();warmFailures.clear();warmProgress();
|
|
568
608
|
const changes = [...changed]; changed.clear();
|
|
569
609
|
try {
|
|
570
610
|
// Registry inspection for live graphs runs in the verification worker.
|
|
@@ -639,7 +679,8 @@ export async function runScenarioCompiler(directory, { watched = false, validate
|
|
|
639
679
|
} catch (error) { failure(error); }
|
|
640
680
|
}, 1000);
|
|
641
681
|
request();
|
|
642
|
-
|
|
682
|
+
if(prewarm)void drain();
|
|
683
|
+
console.log(`Scenario compiler ready: ${entries.length} entries; ${prewarm?"sequential background warming enabled":"builds are requested on demand"}.`);
|
|
643
684
|
for (const signal of ["SIGINT", "SIGTERM"]) process.once(signal, () => {
|
|
644
685
|
stopped = true; clearTimeout(timer); clearInterval(reconcileTimer); for (const { watcher } of watchers.values()) watcher.close();
|
|
645
686
|
void inspector?.close();
|