@orkestrel/scaffold 0.0.107 → 0.0.109
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/dist/agents/skills/orkestrel-dispatch/scripts/bench.js +326 -91
- package/dist/agents/skills/orkestrel-dispatch/scripts/brief.js +110 -14
- package/dist/agents/skills/orkestrel-dispatch/scripts/chain.js +280 -0
- package/dist/agents/skills/orkestrel-dispatch/scripts/cite.js +188 -26
- package/dist/agents/skills/orkestrel-dispatch/scripts/launch.js +142 -43
- package/dist/agents/skills/orkestrel-dispatch/scripts/login.js +240 -62
- package/dist/agents/skills/orkestrel-dispatch/scripts/patch.js +323 -0
- package/dist/agents/skills/orkestrel-dispatch/scripts/result.js +169 -32
- package/dist/agents/skills/orkestrel-dispatch/scripts/sweep.js +368 -27
- package/dist/agents/skills/orkestrel-falsify/scripts/mutate.js +560 -0
- package/dist/agents/skills/orkestrel-harden/scripts/discovery.js +1052 -205
- package/dist/agents/skills/orkestrel-harden/scripts/measure.js +361 -0
- package/dist/agents/skills/orkestrel-harden/scripts/titles.js +455 -80
- package/dist/agents/skills/orkestrel-parallel/scripts/cases.js +327 -0
- package/dist/agents/skills/orkestrel-publish/scripts/compare.js +298 -51
- package/dist/agents/skills/orkestrel-publish/scripts/pins.js +170 -13
- package/dist/agents/skills/orkestrel-publish/scripts/swap.js +956 -191
- package/dist/agents/skills/orkestrel-publish/scripts/wave.js +707 -112
- package/dist/agents/skills/orkestrel-publish/scripts/window.js +235 -41
- package/dist/agents/skills/orkestrel-scout/scripts/map.js +341 -54
- package/dist/agents/templates/brief.md +1 -1
- package/dist/bin/main.js +51 -46
- package/dist/bin/main.js.map +1 -1
- package/dist/host/AGENTS.md +26 -20
- package/dist/host/agents/orchestration.md +98 -58
- package/dist/host/agents/platforms/posix.md +15 -0
- package/dist/host/agents/platforms/windows.md +37 -0
- package/dist/host/agents/skills/orkestrel-align/SKILL.md +10 -13
- package/dist/host/agents/skills/orkestrel-align/references/fleet.md +4 -10
- package/dist/host/agents/skills/orkestrel-align/references/integration.md +1 -1
- package/dist/host/agents/skills/orkestrel-build/SKILL.md +16 -48
- package/dist/host/agents/skills/orkestrel-build/agents/openai.yaml +1 -1
- package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +19 -16
- package/dist/host/agents/skills/orkestrel-debrief/agents/openai.yaml +1 -1
- package/dist/host/agents/skills/orkestrel-debrief/references/field-testing.md +15 -28
- package/dist/host/agents/skills/orkestrel-debrief/references/instruction-audit.md +5 -6
- package/dist/host/agents/skills/orkestrel-debrief/references/retention.md +12 -14
- package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +36 -24
- package/dist/host/agents/skills/orkestrel-dispatch/references/launch.md +14 -11
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/bench.ts +366 -75
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/brief.ts +126 -16
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/chain.ts +323 -0
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/cite.ts +220 -31
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/launch.ts +176 -33
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/login.ts +294 -59
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/patch.ts +401 -0
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/result.ts +199 -34
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/sweep.ts +428 -27
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +10 -8
- package/dist/host/agents/skills/orkestrel-falsify/references/brief.md +1 -5
- package/dist/host/agents/skills/orkestrel-falsify/references/reconcile.md +1 -1
- package/dist/host/agents/skills/orkestrel-falsify/scripts/mutate.ts +701 -0
- package/dist/host/agents/skills/orkestrel-harden/SKILL.md +16 -12
- package/dist/host/agents/skills/orkestrel-harden/references/bindings.md +23 -81
- package/dist/host/agents/skills/orkestrel-harden/references/centralization.md +4 -5
- package/dist/host/agents/skills/orkestrel-harden/references/contract.md +2 -0
- package/dist/host/agents/skills/orkestrel-harden/references/document.md +33 -0
- package/dist/host/agents/skills/orkestrel-harden/references/equivalence.md +6 -3
- package/dist/host/agents/skills/orkestrel-harden/references/hardening.md +8 -4
- package/dist/host/agents/skills/orkestrel-harden/references/research.md +2 -0
- package/dist/host/agents/skills/orkestrel-harden/scripts/discovery.ts +1272 -279
- package/dist/host/agents/skills/orkestrel-harden/scripts/measure.ts +425 -0
- package/dist/host/agents/skills/orkestrel-harden/scripts/titles.ts +603 -98
- package/dist/host/agents/skills/orkestrel-journey/SKILL.md +75 -98
- package/dist/host/agents/skills/orkestrel-journey/references/captures.md +54 -17
- package/dist/host/agents/skills/orkestrel-journey/references/decide.md +1 -20
- package/dist/host/agents/skills/orkestrel-journey/references/layer.md +21 -31
- package/dist/host/agents/skills/orkestrel-journey/references/styles.md +1 -1
- package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +91 -30
- package/dist/host/agents/skills/orkestrel-parallel/agents/openai.yaml +2 -2
- package/dist/host/agents/skills/orkestrel-parallel/references/claude.md +34 -0
- package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +29 -0
- package/dist/host/agents/skills/orkestrel-parallel/references/cursor.md +29 -0
- package/dist/host/agents/skills/orkestrel-parallel/references/t3.md +31 -0
- package/dist/host/agents/skills/orkestrel-parallel/scripts/cases.ts +389 -0
- package/dist/host/agents/skills/orkestrel-polish/SKILL.md +16 -20
- package/dist/host/agents/skills/orkestrel-polish/references/capture-harness.md +16 -26
- package/dist/host/agents/skills/orkestrel-publish/SKILL.md +12 -26
- package/dist/host/agents/skills/orkestrel-publish/agents/openai.yaml +2 -2
- package/dist/host/agents/skills/orkestrel-publish/references/adopt.md +23 -0
- package/dist/host/agents/skills/orkestrel-publish/references/release.md +4 -4
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +12 -10
- package/dist/host/agents/skills/orkestrel-publish/references/window.md +20 -25
- package/dist/host/agents/skills/orkestrel-publish/scripts/compare.ts +348 -59
- package/dist/host/agents/skills/orkestrel-publish/scripts/pins.ts +202 -22
- package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +1061 -191
- package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +812 -140
- package/dist/host/agents/skills/orkestrel-publish/scripts/window.ts +280 -38
- package/dist/host/agents/skills/orkestrel-scout/SKILL.md +3 -3
- package/dist/host/agents/skills/orkestrel-scout/scripts/map.ts +428 -70
- package/dist/host/agents/templates/brief.md +1 -1
- package/dist/host/agents/transports/claude-cli.md +3 -3
- package/dist/host/agents/transports/codex.md +3 -8
- package/dist/host/agents/transports/cursor.md +2 -3
- package/dist/host/claude/AGENTS.md +7 -10
- package/dist/host/claude/agents/analyst.md +3 -3
- package/dist/host/claude/agents/astra.md +3 -3
- package/dist/host/claude/agents/builder.md +1 -1
- package/dist/host/claude/agents/checker.md +1 -1
- package/dist/host/claude/agents/distiller.md +1 -1
- package/dist/host/claude/agents/grok.md +1 -1
- package/dist/host/claude/agents/opus.md +2 -2
- package/dist/host/claude/agents/orkestrel.md +57 -90
- package/dist/host/claude/agents/researcher.md +1 -1
- package/dist/host/claude/agents/reviewer.md +4 -0
- package/dist/host/claude/agents/scout.md +1 -1
- package/dist/host/claude/agents/verifier.md +1 -1
- package/dist/host/claude/rules/application.md +14 -21
- package/dist/host/claude/rules/architecture.md +34 -44
- package/dist/host/claude/rules/browser.md +3 -4
- package/dist/host/claude/rules/campaign.md +55 -0
- package/dist/host/claude/rules/documentation.md +26 -11
- package/dist/host/claude/rules/names.md +9 -4
- package/dist/host/claude/rules/patterns.md +6 -7
- package/dist/host/claude/rules/portability.md +2 -3
- package/dist/host/claude/rules/quality.md +4 -5
- package/dist/host/claude/rules/styles.md +2 -2
- package/dist/host/claude/rules/tests.md +57 -114
- package/dist/host/claude/rules/typescript.md +8 -10
- package/dist/host/claude/rules/workspace.md +21 -19
- package/dist/host/claude/rules/writing.md +3 -3
- package/dist/host/claude/skills/orkestrel-dispatch/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-harden/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-parallel/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-publish/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-scout/SKILL.md +1 -1
- package/dist/host/codex/agents/analyst.toml +9 -3
- package/dist/host/codex/agents/astra.toml +3 -4
- package/dist/host/codex/agents/builder.toml +1 -1
- package/dist/host/codex/agents/opus.toml +3 -4
- package/dist/host/codex/agents/orkestrel.toml +1 -1
- package/dist/host/codex/agents/researcher.toml +2 -2
- package/dist/host/codex/agents/verifier.toml +1 -1
- package/dist/host/codex/config.toml +3 -3
- package/dist/host/configs/helpers.ts +21 -1
- package/dist/host/configs/policy.ts +405 -16
- package/dist/host/cursor/rules/orchestration.mdc +1 -0
- package/dist/host/dotfiles/oxlintrc.json +141 -5
- package/dist/host/guides/agent.md +111 -134
- package/dist/host/guides/capture.md +801 -0
- package/dist/host/guides/probe.md +27 -8
- package/dist/host/guides/scaffold.md +152 -19
- package/dist/host/guides/study.md +534 -440
- package/dist/host/guides/test.md +111 -44
- package/dist/host/manifest.json +199 -242
- package/dist/host/tests/config.test.ts +1558 -219
- package/dist/host/tests/policy.test.ts +127 -1
- package/dist/host/tests/setupPolicy.ts +1389 -39
- package/dist/src/core/index.cjs +239 -87
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +123 -39
- package/dist/src/core/index.d.ts +123 -39
- package/dist/src/core/index.js +234 -86
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +20 -27
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.js +21 -28
- package/dist/src/server/index.js.map +1 -1
- package/package.json +11 -11
- package/dist/agents/skills/orkestrel-dispatch/scripts/helpers.js +0 -283
- package/dist/host/agents/skills/orkestrel-dispatch/references/bench.md +0 -25
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/helpers.ts +0 -333
- package/dist/host/agents/skills/orkestrel-parallel/references/harnesses.md +0 -19
- package/dist/host/guides/supervisor.md +0 -4890
package/dist/src/core/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { fillTemplate } from "@orkestrel/template";
|
|
|
3
3
|
import { Emitter } from "@orkestrel/emitter";
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "@orkestrel/scaffold",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.109",
|
|
7
7
|
description: "Scaffold workspaces with commands: new, audit, repair, catalog, and overwrite.",
|
|
8
8
|
keywords: [
|
|
9
9
|
"audit",
|
|
@@ -80,7 +80,7 @@ var package_default = {
|
|
|
80
80
|
"test:templates": "vitest run --config vite.config.ts --no-cache --reporter=dot --project templates",
|
|
81
81
|
"test:distribution": "vitest run --config vite.config.ts --no-cache --reporter=dot --project distribution",
|
|
82
82
|
"test:probe": "vitest run --config vite.config.ts --no-cache --reporter=verbose --project probe",
|
|
83
|
-
"test:bench": "vitest bench --config vite.config.ts --no-cache --project probe",
|
|
83
|
+
"test:bench": "vitest bench --config vite.config.ts --no-cache --project \"probe (bench)\" --mode benchmark",
|
|
84
84
|
"test:setup": "vitest run --config vite.config.ts --no-cache --reporter=dot --project setup",
|
|
85
85
|
"build": "npm run clean && npm run build:src && npm run build:host && npm run build:skills && npm run build:inventory",
|
|
86
86
|
"build:src": "npm run build:src:core && npm run build:src:server && npm run build:src:bin",
|
|
@@ -102,25 +102,24 @@ var package_default = {
|
|
|
102
102
|
"@orkestrel/template": "^0.0.10"
|
|
103
103
|
},
|
|
104
104
|
devDependencies: {
|
|
105
|
-
"@microsoft/api-extractor": "^7.
|
|
105
|
+
"@microsoft/api-extractor": "^7.60.0",
|
|
106
106
|
"@orkestrel/browser": "^0.0.29",
|
|
107
107
|
"@orkestrel/guide": "^0.0.25",
|
|
108
108
|
"@orkestrel/html": "^0.0.12",
|
|
109
|
-
"@orkestrel/probe": "^0.0.
|
|
110
|
-
"@orkestrel/test": "^0.0.
|
|
109
|
+
"@orkestrel/probe": "^0.0.25",
|
|
110
|
+
"@orkestrel/test": "^0.0.30",
|
|
111
111
|
"@types/node": "^24.19.2",
|
|
112
|
-
"@vitest/browser-playwright": "^
|
|
113
|
-
"oxfmt": "^0.
|
|
114
|
-
"oxlint": "^1.
|
|
115
|
-
"playwright": "^1.
|
|
116
|
-
"typescript": "^
|
|
112
|
+
"@vitest/browser-playwright": "^5.0.5",
|
|
113
|
+
"oxfmt": "^0.75.0",
|
|
114
|
+
"oxlint": "^1.90.0",
|
|
115
|
+
"playwright": "^1.64.1",
|
|
116
|
+
"typescript": "^7.0.2",
|
|
117
117
|
"vite": "^8.3.5",
|
|
118
|
-
"vitest": "^
|
|
118
|
+
"vitest": "^5.0.5"
|
|
119
119
|
},
|
|
120
120
|
engines: { "node": ">=22.18.0" }
|
|
121
121
|
};
|
|
122
|
-
|
|
123
|
-
//#region src/core/constants.ts
|
|
122
|
+
// src/core/constants.ts
|
|
124
123
|
/**
|
|
125
124
|
* Lists the `Environment` values, frozen.
|
|
126
125
|
*
|
|
@@ -330,6 +329,7 @@ var CANON_PATHS = Object.freeze([
|
|
|
330
329
|
".claude/AGENTS.md",
|
|
331
330
|
".mcp.json",
|
|
332
331
|
".agents/orchestration.md",
|
|
332
|
+
".agents/platforms",
|
|
333
333
|
".agents/skills",
|
|
334
334
|
".agents/templates",
|
|
335
335
|
".agents/transports",
|
|
@@ -438,19 +438,19 @@ var CATALOG_AGENT_PATH = ".claude/agents/orkestrel.md";
|
|
|
438
438
|
*
|
|
439
439
|
* @remarks
|
|
440
440
|
* The catalog verb rewrites the region between this marker and
|
|
441
|
-
* {@link
|
|
441
|
+
* {@link CATALOG_END_MARKER} and leaves every other byte of the file alone,
|
|
442
442
|
* so the writer and every proof that reads the rendered file read the pair from
|
|
443
443
|
* here rather than repeating a literal that only agrees by inspection.
|
|
444
444
|
*/
|
|
445
|
-
var
|
|
445
|
+
var CATALOG_START_MARKER = "<!-- orkestrel:catalog -->";
|
|
446
446
|
/**
|
|
447
447
|
* Names the marker closing the package table inside {@link CATALOG_AGENT_PATH}.
|
|
448
448
|
*
|
|
449
449
|
* @remarks
|
|
450
|
-
* It pairs with {@link
|
|
450
|
+
* It pairs with {@link CATALOG_START_MARKER}; a file missing either marker is
|
|
451
451
|
* refused rather than rewritten.
|
|
452
452
|
*/
|
|
453
|
-
var
|
|
453
|
+
var CATALOG_END_MARKER = "<!-- /orkestrel:catalog -->";
|
|
454
454
|
/**
|
|
455
455
|
* Lists the package-facing skills a target receives pointers for, frozen and alphabetical.
|
|
456
456
|
*
|
|
@@ -656,7 +656,7 @@ var WORKSPACE_DEV_ENGINES = Object.freeze({ packageManager: Object.freeze({
|
|
|
656
656
|
version: `>=${MINIMUM_NPM_VERSION}`,
|
|
657
657
|
onFail: "error"
|
|
658
658
|
}) });
|
|
659
|
-
/** Holds the tooling versions
|
|
659
|
+
/** Holds the baseline tooling versions, before framework holds apply. */
|
|
660
660
|
var BASE_DEV_DEPENDENCIES = Object.freeze({
|
|
661
661
|
"@orkestrel/guide": package_default.devDependencies["@orkestrel/guide"],
|
|
662
662
|
"@orkestrel/probe": package_default.devDependencies["@orkestrel/probe"],
|
|
@@ -670,6 +670,19 @@ var BASE_DEV_DEPENDENCIES = Object.freeze({
|
|
|
670
670
|
vitest: package_default.devDependencies.vitest
|
|
671
671
|
});
|
|
672
672
|
/**
|
|
673
|
+
* Holds foreign tool ranges required by selected browser frameworks, frozen.
|
|
674
|
+
*
|
|
675
|
+
* @remarks
|
|
676
|
+
* A selected framework overrides the baseline floor with its held range. `audit` names the hold
|
|
677
|
+
* where it would report a newer served major and reports a declaration past that hold. The
|
|
678
|
+
* constants proof ties the held range to the baseline manifest and the framework's planned range.
|
|
679
|
+
*/
|
|
680
|
+
var TOOLCHAIN_HOLDS = Object.freeze({ typescript: Object.freeze({
|
|
681
|
+
framework: "vue",
|
|
682
|
+
range: "^6.0.3",
|
|
683
|
+
reason: "Vue workspaces require TypeScript 6.0.3 because no stable vue-tsc runs on TypeScript 7: @volar/typescript@2.4.30 declares peer typescript <7, and the TypeScript 7.0 announcement directs Vue projects to stay on TypeScript 6.0"
|
|
684
|
+
}) });
|
|
685
|
+
/**
|
|
673
686
|
* Lists the development dependencies that roll declarations up for published source.
|
|
674
687
|
*
|
|
675
688
|
* @remarks
|
|
@@ -693,6 +706,45 @@ var SOURCE_BROWSER_DEV_DEPENDENCIES = Object.freeze({
|
|
|
693
706
|
*/
|
|
694
707
|
var BROWSE_DEV_DEPENDENCIES = Object.freeze({ "@orkestrel/browser": package_default.devDependencies["@orkestrel/browser"] });
|
|
695
708
|
/**
|
|
709
|
+
* Names the development dependency a browser application's journey axis adds.
|
|
710
|
+
*
|
|
711
|
+
* @remarks
|
|
712
|
+
* Scaffold does not install this package, so its range is a seed. The planner withholds it
|
|
713
|
+
* from the workspaces {@link CAPTURE_UPSTREAM} lists.
|
|
714
|
+
*
|
|
715
|
+
* @example
|
|
716
|
+
* ```ts
|
|
717
|
+
* import { CAPTURE_DEV_DEPENDENCIES } from '@orkestrel/scaffold'
|
|
718
|
+
*
|
|
719
|
+
* CAPTURE_DEV_DEPENDENCIES['@orkestrel/capture'] // '^0.0.1'
|
|
720
|
+
* ```
|
|
721
|
+
*/
|
|
722
|
+
var CAPTURE_DEV_DEPENDENCIES = Object.freeze({ "@orkestrel/capture": "^0.0.1" });
|
|
723
|
+
/**
|
|
724
|
+
* Lists the capture package and its fleet runtime dependency closure, frozen.
|
|
725
|
+
*
|
|
726
|
+
* @remarks
|
|
727
|
+
* The sorted list includes `@orkestrel/capture` and its transitive `@orkestrel/*` dependencies
|
|
728
|
+
* and peers, read from capture's installed manifests, and moves with the capture pin.
|
|
729
|
+
* A listed workspace cannot receive the capture development dependency without closing a cycle.
|
|
730
|
+
* Scaffold does not install capture, so the proof checks planning against this list; the
|
|
731
|
+
* installed closure-equality proof lands when scaffold installs capture.
|
|
732
|
+
*
|
|
733
|
+
* @example
|
|
734
|
+
* ```ts
|
|
735
|
+
* import { CAPTURE_UPSTREAM } from '@orkestrel/scaffold'
|
|
736
|
+
*
|
|
737
|
+
* CAPTURE_UPSTREAM.includes('@orkestrel/process') // true
|
|
738
|
+
* ```
|
|
739
|
+
*/
|
|
740
|
+
var CAPTURE_UPSTREAM = Object.freeze([
|
|
741
|
+
"@orkestrel/capture",
|
|
742
|
+
"@orkestrel/contract",
|
|
743
|
+
"@orkestrel/emitter",
|
|
744
|
+
"@orkestrel/process",
|
|
745
|
+
"@orkestrel/timeout"
|
|
746
|
+
]);
|
|
747
|
+
/**
|
|
696
748
|
* Lists the packages `@orkestrel/browser` depends on at runtime, directly or transitively, frozen.
|
|
697
749
|
*
|
|
698
750
|
* @remarks
|
|
@@ -748,8 +800,7 @@ var APP_SERVER_DEV_DEPENDENCIES = Object.freeze({
|
|
|
748
800
|
"@orkestrel/router": "^0.0.10",
|
|
749
801
|
"@orkestrel/server": "^0.0.14"
|
|
750
802
|
});
|
|
751
|
-
|
|
752
|
-
//#region src/core/templates.ts
|
|
803
|
+
// src/core/templates.ts
|
|
753
804
|
/**
|
|
754
805
|
* Holds formatter-stable template text for every configuration artifact.
|
|
755
806
|
*
|
|
@@ -1247,6 +1298,7 @@ export function appJourney(
|
|
|
1247
1298
|
variant: JourneyVariant,
|
|
1248
1299
|
variants: readonly JourneyVariant[],
|
|
1249
1300
|
mode?: string,
|
|
1301
|
+
override?: UserConfig,
|
|
1250
1302
|
): UserConfig {
|
|
1251
1303
|
const application = resolveApplication(mode, applications)
|
|
1252
1304
|
const browser = applications[application]()
|
|
@@ -1268,7 +1320,7 @@ export function appJourney(
|
|
|
1268
1320
|
},
|
|
1269
1321
|
},
|
|
1270
1322
|
}
|
|
1271
|
-
return mergeOverride(project)
|
|
1323
|
+
return mergeOverride(project, override)
|
|
1272
1324
|
}
|
|
1273
1325
|
`,
|
|
1274
1326
|
showcase: `
|
|
@@ -1369,7 +1421,30 @@ export function appServer(override?: UserConfig): UserConfig {
|
|
|
1369
1421
|
browser: { enabled: false },
|
|
1370
1422
|
},
|
|
1371
1423
|
}
|
|
1372
|
-
|
|
1424
|
+
// Fills the missing codeSplitting of each merged output with false and adds no output,
|
|
1425
|
+
// so an override's output list keeps its own members and their order. A member that
|
|
1426
|
+
// already supplies a value is returned as written, found by property lookup, so a value
|
|
1427
|
+
// an inherited getter supplies survives.
|
|
1428
|
+
const merged = mergeOverride(project, override)
|
|
1429
|
+
const rolldown = merged.build?.rolldownOptions
|
|
1430
|
+
const output = rolldown?.output
|
|
1431
|
+
const unsplit = { codeSplitting: false }
|
|
1432
|
+
return {
|
|
1433
|
+
...merged,
|
|
1434
|
+
build: {
|
|
1435
|
+
...merged.build,
|
|
1436
|
+
rolldownOptions: {
|
|
1437
|
+
...rolldown,
|
|
1438
|
+
output: Array.isArray(output)
|
|
1439
|
+
? output.map((member) =>
|
|
1440
|
+
member.codeSplitting === undefined ? { ...member, ...unsplit } : member,
|
|
1441
|
+
)
|
|
1442
|
+
: output?.codeSplitting === undefined
|
|
1443
|
+
? { ...output, ...unsplit }
|
|
1444
|
+
: output,
|
|
1445
|
+
},
|
|
1446
|
+
},
|
|
1447
|
+
}
|
|
1373
1448
|
}
|
|
1374
1449
|
`
|
|
1375
1450
|
}),
|
|
@@ -1532,8 +1607,9 @@ export function service(override?: UserConfig): UserConfig {
|
|
|
1532
1607
|
return mergeOverride(project, override)
|
|
1533
1608
|
}
|
|
1534
1609
|
`,
|
|
1535
|
-
studies: `//
|
|
1536
|
-
// so this project is isolated in its own gate script,
|
|
1610
|
+
studies: `// The @orkestrel/study engine drives these proofs, running installed packages through bounded
|
|
1611
|
+
// subprocesses and protocol fixtures, so this project is isolated in its own gate script,
|
|
1612
|
+
// test:studies.
|
|
1537
1613
|
export function studies(override?: UserConfig): UserConfig {
|
|
1538
1614
|
const project: UserConfig = {
|
|
1539
1615
|
resolve,
|
|
@@ -1571,9 +1647,9 @@ export function studies(override?: UserConfig): UserConfig {
|
|
|
1571
1647
|
`,
|
|
1572
1648
|
probe: `// A workbench, not a proof. No gate selects this project. Run in test mode by the
|
|
1573
1649
|
// \`test:probe\` script, it collects \`tmp/probes/**/*.test.ts\`. Run in benchmark mode by the
|
|
1574
|
-
// \`test:bench\` script,
|
|
1575
|
-
//
|
|
1576
|
-
//
|
|
1650
|
+
// \`test:bench\` script, it collects \`*.bench.ts\` files under \`tmp/probes\` and \`tests\`.
|
|
1651
|
+
// Each benchmark is a regular test that uses its context's \`bench\` fixture and awaits
|
|
1652
|
+
// \`bench(name, options, fn).run()\` or \`bench.compare(...)\`.
|
|
1577
1653
|
export function probe(override?: UserConfig): UserConfig {
|
|
1578
1654
|
const project: UserConfig = {
|
|
1579
1655
|
resolve,
|
|
@@ -1586,7 +1662,7 @@ export function probe(override?: UserConfig): UserConfig {
|
|
|
1586
1662
|
fileParallelism: false,
|
|
1587
1663
|
sequence: { groupOrder: 1 },
|
|
1588
1664
|
pool: 'threads',
|
|
1589
|
-
benchmark: { include: ['tmp/probes/**/*.
|
|
1665
|
+
benchmark: { include: ['tmp/probes/**/*.bench.ts', 'tests/**/*.bench.ts'] },
|
|
1590
1666
|
},
|
|
1591
1667
|
}
|
|
1592
1668
|
return mergeOverride(project, override)
|
|
@@ -2601,11 +2677,14 @@ export const DISTRIBUTION_NPM = process.platform === 'win32' ? 'npm.cmd' : 'npm'
|
|
|
2601
2677
|
// process: the command and its plain-text diagnostics are the same across the
|
|
2602
2678
|
// compiler majors this toolchain supports, and its in-process API is not. It is
|
|
2603
2679
|
// resolved from the workspace under proof, so a consumer of the packed artifact is
|
|
2604
|
-
// checked by the same compiler that workspace's own \`check\` script runs.
|
|
2680
|
+
// checked by the same compiler that workspace's own \`check\` script runs. TypeScript 7 exports
|
|
2681
|
+
// \`package.json\` but not \`bin/tsc\`, so the path is joined from the manifest's directory.
|
|
2682
|
+
/** Names the TypeScript manifest installed by the workspace under proof. */
|
|
2683
|
+
export const DISTRIBUTION_TYPESCRIPT = createRequire(
|
|
2684
|
+
join(DISTRIBUTION_ROOT, 'package.json'),
|
|
2685
|
+
).resolve('typescript/package.json')
|
|
2605
2686
|
/** Names the compiler installed by the workspace under proof. */
|
|
2606
|
-
export const DISTRIBUTION_COMPILER =
|
|
2607
|
-
'typescript/bin/tsc',
|
|
2608
|
-
)
|
|
2687
|
+
export const DISTRIBUTION_COMPILER = join(dirname(DISTRIBUTION_TYPESCRIPT), 'bin', 'tsc')
|
|
2609
2688
|
// Windows needs a shell to launch a \`.cmd\`: Node refuses one directly since the
|
|
2610
2689
|
// batch-argument hardening, and \`spawnSync\` returns \`EINVAL\` with a null status
|
|
2611
2690
|
// rather than an exit code a caller can read. Every following argument is a literal or
|
|
@@ -2873,6 +2952,50 @@ export function readDistributionManifestName(path: string): string {
|
|
|
2873
2952
|
return manifest.name
|
|
2874
2953
|
}
|
|
2875
2954
|
|
|
2955
|
+
// A host carries a package's required peers at its own root. A consumer that carries none leaves
|
|
2956
|
+
// npm to place them, and npm can then resolve an optional peer of a peer to a release the
|
|
2957
|
+
// package's own range refuses, so the consumer declares them as a host would.
|
|
2958
|
+
/**
|
|
2959
|
+
* Reads the peers a host must carry: every peer dependency its metadata does not mark optional.
|
|
2960
|
+
*
|
|
2961
|
+
* @param path - The manifest to read.
|
|
2962
|
+
* @returns Each required peer's name mapped to its declared range.
|
|
2963
|
+
*/
|
|
2964
|
+
export function readDistributionPeers(path: string): Readonly<Record<string, string>> {
|
|
2965
|
+
const manifest = readDistributionJSON(path)
|
|
2966
|
+
if (!isDistributionRecord(manifest) || !isDistributionRecord(manifest.peerDependencies)) {
|
|
2967
|
+
return {}
|
|
2968
|
+
}
|
|
2969
|
+
const meta = isDistributionRecord(manifest.peerDependenciesMeta)
|
|
2970
|
+
? manifest.peerDependenciesMeta
|
|
2971
|
+
: undefined
|
|
2972
|
+
const peers = Object.entries(manifest.peerDependencies).filter(
|
|
2973
|
+
(entry): entry is [string, string] => typeof entry[1] === 'string',
|
|
2974
|
+
)
|
|
2975
|
+
return Object.fromEntries(
|
|
2976
|
+
peers.filter(([name]) => {
|
|
2977
|
+
const entry = meta?.[name]
|
|
2978
|
+
return !isDistributionRecord(entry) || entry.optional !== true
|
|
2979
|
+
}),
|
|
2980
|
+
)
|
|
2981
|
+
}
|
|
2982
|
+
|
|
2983
|
+
/**
|
|
2984
|
+
* Writes the consumer manifest, declaring the required peers as dependencies.
|
|
2985
|
+
*
|
|
2986
|
+
* @param peers - Each required peer's name mapped to its declared range.
|
|
2987
|
+
* @returns The manifest text; the bare manifest when the package declares no required peer.
|
|
2988
|
+
*/
|
|
2989
|
+
export function createDistributionConsumerManifest(
|
|
2990
|
+
peers: Readonly<Record<string, string>>,
|
|
2991
|
+
): string {
|
|
2992
|
+
const manifest: unknown = JSON.parse(DISTRIBUTION_CONSUMER_MANIFEST)
|
|
2993
|
+
if (Object.keys(peers).length === 0 || !isDistributionRecord(manifest)) {
|
|
2994
|
+
return DISTRIBUTION_CONSUMER_MANIFEST
|
|
2995
|
+
}
|
|
2996
|
+
return \`\${JSON.stringify({ ...manifest, dependencies: peers })}\\n\`
|
|
2997
|
+
}
|
|
2998
|
+
|
|
2876
2999
|
/**
|
|
2877
3000
|
* Writes a consumer file after creating its parent directory.
|
|
2878
3001
|
*
|
|
@@ -3507,7 +3630,8 @@ export function buildDistributionStage(scratch: string): DistributionStage {
|
|
|
3507
3630
|
if (archives.length !== 1 || archive === undefined) {
|
|
3508
3631
|
throw new Error(\`npm pack wrote no single archive: \${archives.join(', ')}\`)
|
|
3509
3632
|
}
|
|
3510
|
-
|
|
3633
|
+
const peers = readDistributionPeers(join(DISTRIBUTION_ROOT, 'package.json'))
|
|
3634
|
+
writeDistributionFile(join(consumer, 'package.json'), createDistributionConsumerManifest(peers))
|
|
3511
3635
|
writeDistributionFile(join(consumer, DISTRIBUTION_ESM_DRIVER), DISTRIBUTION_ESM_DRIVER_SOURCE)
|
|
3512
3636
|
writeDistributionFile(join(consumer, DISTRIBUTION_CJS_DRIVER), DISTRIBUTION_CJS_DRIVER_SOURCE)
|
|
3513
3637
|
const install = runDistributionNpm(
|
|
@@ -4590,8 +4714,7 @@ printf '%s\\n' \\
|
|
|
4590
4714
|
`
|
|
4591
4715
|
})
|
|
4592
4716
|
});
|
|
4593
|
-
|
|
4594
|
-
//#region src/core/errors.ts
|
|
4717
|
+
// src/core/errors.ts
|
|
4595
4718
|
/**
|
|
4596
4719
|
* Represents the one error this package throws, carrying the coded reason it was raised.
|
|
4597
4720
|
*
|
|
@@ -4660,8 +4783,7 @@ var ScaffoldError = class extends Error {
|
|
|
4660
4783
|
function isScaffoldError(value) {
|
|
4661
4784
|
return isInstance(value, ScaffoldError);
|
|
4662
4785
|
}
|
|
4663
|
-
|
|
4664
|
-
//#region src/core/validators.ts
|
|
4786
|
+
// src/core/validators.ts
|
|
4665
4787
|
/**
|
|
4666
4788
|
* Narrows a value to a logical target-relative path.
|
|
4667
4789
|
*
|
|
@@ -5220,8 +5342,7 @@ var isCompilerOptions = recordOf({
|
|
|
5220
5342
|
on: isCompilerHooks,
|
|
5221
5343
|
error: isFunction
|
|
5222
5344
|
}, true);
|
|
5223
|
-
|
|
5224
|
-
//#region src/core/cloners.ts
|
|
5345
|
+
// src/core/cloners.ts
|
|
5225
5346
|
/**
|
|
5226
5347
|
* Snapshots an untrusted value into exact JSON data the caller owns.
|
|
5227
5348
|
*
|
|
@@ -5268,8 +5389,7 @@ function cloneValue(value) {
|
|
|
5268
5389
|
const outcome = attempt(() => cloneJSONValue(value));
|
|
5269
5390
|
return outcome.success ? outcome.value : void 0;
|
|
5270
5391
|
}
|
|
5271
|
-
|
|
5272
|
-
//#region src/core/parsers.ts
|
|
5392
|
+
// src/core/parsers.ts
|
|
5273
5393
|
/**
|
|
5274
5394
|
* Coerces an extension value or a `surface:name` selection into an extension.
|
|
5275
5395
|
* @param value - An extension record or its selection text.
|
|
@@ -5384,8 +5504,7 @@ function parseSnapshot(value) {
|
|
|
5384
5504
|
function parseCompilerOptions(value) {
|
|
5385
5505
|
return isCompilerOptions(value) ? value : void 0;
|
|
5386
5506
|
}
|
|
5387
|
-
|
|
5388
|
-
//#region src/core/helpers.ts
|
|
5507
|
+
// src/core/helpers.ts
|
|
5389
5508
|
/**
|
|
5390
5509
|
* Encodes bytes as exact lowercase hexadecimal text.
|
|
5391
5510
|
*
|
|
@@ -6404,9 +6523,9 @@ function manifestToDependencies(manifest) {
|
|
|
6404
6523
|
function renderSkillPointer(canonical, name) {
|
|
6405
6524
|
const lines = canonical.split(/\r\n|\n/u);
|
|
6406
6525
|
if (lines[0] !== "---") return void 0;
|
|
6407
|
-
const
|
|
6408
|
-
if (
|
|
6409
|
-
return `${lines.slice(0,
|
|
6526
|
+
const end = lines.indexOf("---", 1);
|
|
6527
|
+
if (end === -1) return void 0;
|
|
6528
|
+
return `${lines.slice(0, end + 1).join("\n")}\n${fillTemplate(ARTIFACT_TEMPLATES.orchestration.skill, { name })}`;
|
|
6410
6529
|
}
|
|
6411
6530
|
/**
|
|
6412
6531
|
* Scans manifest text for its strings and object braces, in order.
|
|
@@ -6452,8 +6571,7 @@ function scanManifestTokens(text) {
|
|
|
6452
6571
|
}
|
|
6453
6572
|
return tokens;
|
|
6454
6573
|
}
|
|
6455
|
-
|
|
6456
|
-
//#region src/core/compilers.ts
|
|
6574
|
+
// src/core/compilers.ts
|
|
6457
6575
|
/**
|
|
6458
6576
|
* Projects a blueprint into browser extensions restricted to occupied browser axes.
|
|
6459
6577
|
* @param blueprint - The workspace specification.
|
|
@@ -6629,8 +6747,10 @@ function srcToExports(src) {
|
|
|
6629
6747
|
* @returns The merged set, sorted by package name.
|
|
6630
6748
|
*
|
|
6631
6749
|
* @remarks
|
|
6632
|
-
* The shared toolchain is the baseline every generated workspace carries
|
|
6633
|
-
*
|
|
6750
|
+
* The shared toolchain is the baseline every generated workspace carries.
|
|
6751
|
+
* A selected browser framework applies its toolchain hold before the host-specific sets.
|
|
6752
|
+
* Vue faces on either axis select TypeScript 6.0.3; other workspaces select TypeScript 7.0.2.
|
|
6753
|
+
* Each declared axis adds the set its host needs. A declared extra or peer is
|
|
6634
6754
|
* applied after those, so a workspace that pins a range for a package the
|
|
6635
6755
|
* conditional sets also name gets the range it declared. An extra that restates
|
|
6636
6756
|
* a shared toolchain pin never reaches here, because the gate refuses it. A peer
|
|
@@ -6645,6 +6765,11 @@ function srcToExports(src) {
|
|
|
6645
6765
|
* to drive. A workspace {@link BROWSE_UPSTREAM} names receives nothing either, because
|
|
6646
6766
|
* `@orkestrel/browser` depends on it at runtime and the declaration would close a cycle.
|
|
6647
6767
|
*
|
|
6768
|
+
* A journey axis with a browser application receives {@link CAPTURE_DEV_DEPENDENCIES}.
|
|
6769
|
+
* A workspace {@link CAPTURE_UPSTREAM} names receives no capture seed, because it is capture
|
|
6770
|
+
* itself or a member of capture's runtime closure. A browser source, styles surface, or browser
|
|
6771
|
+
* setup alone selects no capture dependency.
|
|
6772
|
+
*
|
|
6648
6773
|
* A peer is declared here as well as under `peerDependencies`, because a peer is
|
|
6649
6774
|
* not installed by the workspace that declares it and developing against one
|
|
6650
6775
|
* requires it present. A runtime dependency is the opposite case and is removed:
|
|
@@ -6671,7 +6796,9 @@ function blueprintToDevDependencies(blueprint) {
|
|
|
6671
6796
|
const own = blueprint.src.length > 0 || sheets ? `@orkestrel/${blueprint.name}` : blueprint.name;
|
|
6672
6797
|
const prior = {
|
|
6673
6798
|
...BASE_DEV_DEPENDENCIES,
|
|
6799
|
+
...Object.fromEntries(Object.entries(blueprintToToolchainHolds(blueprint)).map(([name, hold]) => [name, hold.range])),
|
|
6674
6800
|
...rendered && !BROWSE_UPSTREAM.includes(own) ? BROWSE_DEV_DEPENDENCIES : {},
|
|
6801
|
+
...blueprint.journey && blueprint.app.includes("browser") && !CAPTURE_UPSTREAM.includes(own) ? CAPTURE_DEV_DEPENDENCIES : {},
|
|
6675
6802
|
...sheets ? STYLES_DEV_DEPENDENCIES : {},
|
|
6676
6803
|
...blueprint.src.length > 0 || blueprint.bin ? DECLARATION_DEV_DEPENDENCIES : {},
|
|
6677
6804
|
...blueprint.src.includes("browser") || blueprint.setup.includes("browser") || sheets ? SOURCE_BROWSER_DEV_DEPENDENCIES : {},
|
|
@@ -6691,6 +6818,21 @@ function blueprintToDevDependencies(blueprint) {
|
|
|
6691
6818
|
return Object.fromEntries(Object.entries(merged).filter(([name]) => name !== own && !runtime.has(name)).sort(([left], [right]) => compareValues(left, right)));
|
|
6692
6819
|
}
|
|
6693
6820
|
/**
|
|
6821
|
+
* Projects a blueprint into the toolchain holds its browser frameworks require.
|
|
6822
|
+
* @param blueprint - The workspace specification.
|
|
6823
|
+
* @returns The held tools for selected browser framework faces; empty without a framework.
|
|
6824
|
+
* @example
|
|
6825
|
+
* ```ts
|
|
6826
|
+
* import { blueprintToToolchainHolds, createBlueprint } from '@orkestrel/scaffold'
|
|
6827
|
+
*
|
|
6828
|
+
* blueprintToToolchainHolds(createBlueprint('router', { src: ['core'] })) // {}
|
|
6829
|
+
* ```
|
|
6830
|
+
*/
|
|
6831
|
+
function blueprintToToolchainHolds(blueprint) {
|
|
6832
|
+
const frameworks = blueprintToFaces(blueprint).map((face) => face.name);
|
|
6833
|
+
return Object.fromEntries(Object.entries(TOOLCHAIN_HOLDS).filter(([, hold]) => frameworks.includes(hold.framework)));
|
|
6834
|
+
}
|
|
6835
|
+
/**
|
|
6694
6836
|
* Projects the scoped npm overrides required by a selected browser showcase.
|
|
6695
6837
|
*
|
|
6696
6838
|
* @param blueprint - The workspace specification.
|
|
@@ -6827,6 +6969,9 @@ function replaceManifestOverride(manifest, path, range) {
|
|
|
6827
6969
|
* The configuration paths interpolated here are the same ones `SRC_MATRIX` and
|
|
6828
6970
|
* `APP_MATRIX` list as each environment's configuration files, so a rename in
|
|
6829
6971
|
* either matrix is a rename in both places.
|
|
6972
|
+
* A browser application's journey axis adds `journey` (`capture journey`) and `capture`
|
|
6973
|
+
* (`capture frames`) beside `test:journey`. The scoped commands take an explicit selection;
|
|
6974
|
+
* the whole-suite `test:journey` invocation remains in the test chain.
|
|
6830
6975
|
*
|
|
6831
6976
|
* @example
|
|
6832
6977
|
* ```ts
|
|
@@ -6925,6 +7070,8 @@ function blueprintToScripts(blueprint) {
|
|
|
6925
7070
|
...blueprint.setup.includes("browser") ? { "test:setup:browser": `${vitest} --project setup:browser` } : {},
|
|
6926
7071
|
...blueprint.journey && blueprint.app.includes("browser") ? {
|
|
6927
7072
|
"test:journey": journey,
|
|
7073
|
+
journey: "capture journey",
|
|
7074
|
+
capture: "capture frames",
|
|
6928
7075
|
...Object.fromEntries(application.map((name) => [`test:journey:${name}`, `${journey} --mode ${name}`]))
|
|
6929
7076
|
} : {},
|
|
6930
7077
|
...blueprint.skills ? { "test:skills": `${vitest} --project skills` } : {},
|
|
@@ -6932,7 +7079,7 @@ function blueprintToScripts(blueprint) {
|
|
|
6932
7079
|
...blueprint.conformance ? { "test:conformance": `${vitest} --project conformance` } : {},
|
|
6933
7080
|
...blueprint.tree ? { "test:tree": `${vitest} --project tree` } : {},
|
|
6934
7081
|
"test:probe": "vitest run --config vite.config.ts --no-cache --reporter=verbose --project probe",
|
|
6935
|
-
"test:bench": "vitest bench --config vite.config.ts --no-cache --project probe",
|
|
7082
|
+
"test:bench": "vitest bench --config vite.config.ts --no-cache --project \"probe (bench)\" --mode benchmark",
|
|
6936
7083
|
...publishes ? { "test:distribution": `${vitest} --project distribution` } : {},
|
|
6937
7084
|
...integrates ? { "test:integration": `${vitest} --project integration` } : {},
|
|
6938
7085
|
...blueprint.service ? { "test:service": `${vitest} --project service` } : {},
|
|
@@ -6997,6 +7144,8 @@ function blueprintToScripts(blueprint) {
|
|
|
6997
7144
|
* rewrites, and one carrying skills adds `test:skills`. Publishing adds the pack and publication lifecycle scripts.
|
|
6998
7145
|
* Sheet and framework faces add their check and build scripts, application frameworks add dev scripts,
|
|
6999
7146
|
* and selected showcases and journeys add their mode scripts.
|
|
7147
|
+
* A browser application's journey axis also adds `journey` and `capture`. Their generated
|
|
7148
|
+
* commands are writable and have no predecessor forms; customized values remain caller-owned.
|
|
7000
7149
|
* Aggregate test scripts and
|
|
7001
7150
|
* maintainer-owned gate chains stay outside the region.
|
|
7002
7151
|
*
|
|
@@ -7028,7 +7177,7 @@ function blueprintToWritableScripts(blueprint) {
|
|
|
7028
7177
|
const sheet = sheets.some((face) => name === `build:src:${face}` || name === `check:src:${face}`);
|
|
7029
7178
|
const framework = blueprintToFaces(blueprint).some((extension) => extension.surface === "browser" && extension.axes.some((axis) => name === `check:${axis}:${extension.name}` || name === `build:${axis}:${extension.name}` || axis === "app" && name === `dev:${extension.name}`));
|
|
7030
7179
|
const showcase = name === "showcase" || name.startsWith("showcase:") || name === "build:showcase" || name.startsWith("build:showcase:");
|
|
7031
|
-
if (!direct && !sheet && !framework && !showcase) return [];
|
|
7180
|
+
if (!direct && !sheet && !framework && !showcase && !(name === "journey" || name === "capture")) return [];
|
|
7032
7181
|
return [{
|
|
7033
7182
|
name,
|
|
7034
7183
|
command,
|
|
@@ -7253,7 +7402,8 @@ function blueprintToRootTsconfig(blueprint) {
|
|
|
7253
7402
|
* Projects a blueprint into the project labels its root Vitest configuration registers.
|
|
7254
7403
|
*
|
|
7255
7404
|
* @param blueprint - The workspace specification.
|
|
7256
|
-
* @returns Project labels in registration order, including wrapper-registered sheet faces
|
|
7405
|
+
* @returns Project labels in registration order, including wrapper-registered sheet faces and
|
|
7406
|
+
* the probe benchmark variant.
|
|
7257
7407
|
*
|
|
7258
7408
|
* @example
|
|
7259
7409
|
* ```ts
|
|
@@ -7287,7 +7437,8 @@ function blueprintToProjects(blueprint) {
|
|
|
7287
7437
|
...blueprint.studies ? ["studies"] : [],
|
|
7288
7438
|
...blueprint.src.length > 0 || styled ? ["distribution"] : [],
|
|
7289
7439
|
...blueprint.integration ? ["integration"] : [],
|
|
7290
|
-
"probe"
|
|
7440
|
+
"probe",
|
|
7441
|
+
"probe (bench)"
|
|
7291
7442
|
];
|
|
7292
7443
|
}
|
|
7293
7444
|
/**
|
|
@@ -8469,9 +8620,9 @@ function insertManifestSection(manifest, section, dependencies, present) {
|
|
|
8469
8620
|
const root = tokens.find((token) => token.text === "}" && token.depth === 0)?.index;
|
|
8470
8621
|
if (bounds === void 0) {
|
|
8471
8622
|
if (present || root === void 0) return void 0;
|
|
8472
|
-
const
|
|
8473
|
-
const margin =
|
|
8474
|
-
const gap =
|
|
8623
|
+
const lineBreak = head === void 0 ? -1 : manifest.lastIndexOf("\n", head);
|
|
8624
|
+
const margin = lineBreak < 0 ? "" : manifest.slice(lineBreak + 1, head);
|
|
8625
|
+
const gap = lineBreak < 0 || /\S/u.test(margin) ? "" : `\n${margin}`;
|
|
8475
8626
|
const block = `${JSON.stringify(section)}: {${lines.map((line) => `${gap === "" ? "" : `${gap}${margin}`}${line}`).join(",")}${gap}}`;
|
|
8476
8627
|
const tail = manifest.slice(1, root).trimEnd().length;
|
|
8477
8628
|
const [position, insertion] = neighbor === void 0 ? [tail + 1, manifest.charAt(tail) === "{" ? block : `,${gap}${block}`] : section === "devDependencies" ? [neighbor.close + 1, `,${gap}${block}`] : [neighbor.start, `${block},${gap}`];
|
|
@@ -8493,11 +8644,11 @@ function insertManifestSection(manifest, section, dependencies, present) {
|
|
|
8493
8644
|
const first = declarations[0];
|
|
8494
8645
|
const last = declarations.at(-1);
|
|
8495
8646
|
if (first === void 0 || last === void 0) {
|
|
8496
|
-
const
|
|
8497
|
-
const level =
|
|
8498
|
-
const separator =
|
|
8499
|
-
const
|
|
8500
|
-
return `${manifest.slice(0, open + 1)}${lines.map((line) => `${separator}${line}`).join(",")}${
|
|
8647
|
+
const lineBreak = manifest.lastIndexOf("\n", open);
|
|
8648
|
+
const level = lineBreak < 0 ? "" : /^\s*/u.exec(manifest.slice(lineBreak + 1, open))?.[0] ?? "";
|
|
8649
|
+
const separator = lineBreak < 0 ? "" : `\n${level}${level}`;
|
|
8650
|
+
const suffix = lineBreak < 0 ? "" : `\n${level}`;
|
|
8651
|
+
return `${manifest.slice(0, open + 1)}${lines.map((line) => `${separator}${line}`).join(",")}${suffix}${manifest.slice(close)}`;
|
|
8501
8652
|
}
|
|
8502
8653
|
const newline = manifest.lastIndexOf("\n", first.start);
|
|
8503
8654
|
const indent = newline < 0 ? "" : manifest.slice(newline + 1, first.start);
|
|
@@ -8608,10 +8759,10 @@ function replaceManifestScripts(manifest, scripts) {
|
|
|
8608
8759
|
}];
|
|
8609
8760
|
});
|
|
8610
8761
|
const missing = scripts.filter((script) => !written.has(script.name));
|
|
8611
|
-
const
|
|
8612
|
-
const level =
|
|
8613
|
-
const emptySeparator =
|
|
8614
|
-
const
|
|
8762
|
+
const lineBreak = manifest.lastIndexOf("\n", start);
|
|
8763
|
+
const level = lineBreak < 0 ? "" : /^\s*/u.exec(manifest.slice(lineBreak + 1, start))?.[0] ?? "";
|
|
8764
|
+
const emptySeparator = lineBreak < 0 ? "" : `\n${level}${level}`;
|
|
8765
|
+
const emptySuffix = lineBreak < 0 ? "" : `\n${level}`;
|
|
8615
8766
|
const tail = start + manifest.slice(start, end - 1).trimEnd().length;
|
|
8616
8767
|
const newline = first === void 0 ? -1 : manifest.lastIndexOf("\n", first);
|
|
8617
8768
|
const indent = first === void 0 || newline < 0 ? "" : manifest.slice(newline + 1, first);
|
|
@@ -8627,7 +8778,7 @@ function replaceManifestScripts(manifest, scripts) {
|
|
|
8627
8778
|
const appended = missing.length === 0 ? [] : first === void 0 ? [{
|
|
8628
8779
|
start: start + 1,
|
|
8629
8780
|
end: end - 1,
|
|
8630
|
-
text: `${missing.map((script) => `${emptySeparator}${JSON.stringify(script.name)}: ${JSON.stringify(script.command)}`).join(",")}${
|
|
8781
|
+
text: `${missing.map((script) => `${emptySeparator}${JSON.stringify(script.name)}: ${JSON.stringify(script.command)}`).join(",")}${emptySuffix}`
|
|
8631
8782
|
}] : [...Map.groupBy(placements, ({ anchor }) => anchor)].map(([anchor, group]) => ({
|
|
8632
8783
|
start: anchor,
|
|
8633
8784
|
end: anchor,
|
|
@@ -9098,8 +9249,7 @@ function overridesToQuestions(overrides, artifacts) {
|
|
|
9098
9249
|
}] : []];
|
|
9099
9250
|
});
|
|
9100
9251
|
}
|
|
9101
|
-
|
|
9102
|
-
//#region src/core/factories.ts
|
|
9252
|
+
// src/core/factories.ts
|
|
9103
9253
|
/**
|
|
9104
9254
|
* Constructs a {@link Blueprint} from a name and the fields that differ from the defaults.
|
|
9105
9255
|
*
|
|
@@ -9176,8 +9326,7 @@ function createBlueprint(name, input) {
|
|
|
9176
9326
|
if (blueprint === void 0) throw new ScaffoldError("INVALID", "The filled record is not a blueprint.", { name });
|
|
9177
9327
|
return blueprint;
|
|
9178
9328
|
}
|
|
9179
|
-
|
|
9180
|
-
//#region src/core/Compiler.ts
|
|
9329
|
+
// src/core/Compiler.ts
|
|
9181
9330
|
/**
|
|
9182
9331
|
* Represents the compile spine: draft, gate, pin, run in that order over a blueprint.
|
|
9183
9332
|
*
|
|
@@ -9189,7 +9338,7 @@ function createBlueprint(name, input) {
|
|
|
9189
9338
|
* records the coded reason beside them; the stages after a failed one never run,
|
|
9190
9339
|
* so the records stop where the compile stopped.
|
|
9191
9340
|
*
|
|
9192
|
-
* The compile fails closed on one rule: a
|
|
9341
|
+
* The compile fails closed on one rule: a compile result carries a plan exactly
|
|
9193
9342
|
* when no question blocks. A refused blueprint is answered rather than raised,
|
|
9194
9343
|
* so a caller reads the refusal from the value it asked for.
|
|
9195
9344
|
*
|
|
@@ -9214,10 +9363,10 @@ function createBlueprint(name, input) {
|
|
|
9214
9363
|
* import { Compiler, createBlueprint } from '@orkestrel/scaffold'
|
|
9215
9364
|
*
|
|
9216
9365
|
* const compiler = new Compiler()
|
|
9217
|
-
* const
|
|
9366
|
+
* const result = compiler.compile(createBlueprint('router', { src: ['core'] }))
|
|
9218
9367
|
*
|
|
9219
|
-
*
|
|
9220
|
-
*
|
|
9368
|
+
* result.plan?.artifacts // every planned file, in group order
|
|
9369
|
+
* result.stages // one CompileRecord per stage that ran
|
|
9221
9370
|
* compiler.destroy()
|
|
9222
9371
|
* ```
|
|
9223
9372
|
*/
|
|
@@ -9254,7 +9403,7 @@ var Compiler = class {
|
|
|
9254
9403
|
*
|
|
9255
9404
|
* @param blueprint - The workspace specification to compile.
|
|
9256
9405
|
* @param groups - The artifact groups to cover; every group when absent.
|
|
9257
|
-
* @returns The
|
|
9406
|
+
* @returns The compile result, carrying a plan only when the gate passed.
|
|
9258
9407
|
* @throws {@link ScaffoldError} coded `INVALID` when an argument is not the
|
|
9259
9408
|
* exact shape, and `DESTROYED` when the compiler has been torn down.
|
|
9260
9409
|
*
|
|
@@ -9283,10 +9432,10 @@ var Compiler = class {
|
|
|
9283
9432
|
compile(blueprint, groups) {
|
|
9284
9433
|
this.#assertAlive();
|
|
9285
9434
|
const accepted = this.#accept(blueprint, parseBlueprint, "blueprint");
|
|
9286
|
-
const
|
|
9287
|
-
if (
|
|
9288
|
-
this.#emitter.emit("compile",
|
|
9289
|
-
return
|
|
9435
|
+
const result = this.#scaffold(accepted, this.#select(groups));
|
|
9436
|
+
if (result.plan === void 0) this.#emitter.emit("block", result.questions);
|
|
9437
|
+
this.#emitter.emit("compile", result);
|
|
9438
|
+
return result;
|
|
9290
9439
|
}
|
|
9291
9440
|
/**
|
|
9292
9441
|
* Compiles a blueprint and compares its plan to a target's current content.
|
|
@@ -9322,11 +9471,11 @@ var Compiler = class {
|
|
|
9322
9471
|
this.#assertAlive();
|
|
9323
9472
|
const accepted = this.#accept(blueprint, parseBlueprint, "blueprint");
|
|
9324
9473
|
const observed = this.#accept(current, parseSnapshot, "current");
|
|
9325
|
-
const
|
|
9326
|
-
if (
|
|
9474
|
+
const compiled = this.#scaffold(accepted, this.#select(groups));
|
|
9475
|
+
if (compiled.plan === void 0) this.#emitter.emit("block", compiled.questions);
|
|
9327
9476
|
const result = {
|
|
9328
|
-
findings:
|
|
9329
|
-
questions:
|
|
9477
|
+
findings: compiled.plan === void 0 ? [] : planToFindings(compiled.plan, observed),
|
|
9478
|
+
questions: compiled.questions
|
|
9330
9479
|
};
|
|
9331
9480
|
this.#emitter.emit("audit", result);
|
|
9332
9481
|
return result;
|
|
@@ -9477,7 +9626,6 @@ var Compiler = class {
|
|
|
9477
9626
|
return error;
|
|
9478
9627
|
}
|
|
9479
9628
|
};
|
|
9480
|
-
|
|
9481
|
-
export { APP_BROWSER_DEV_DEPENDENCIES, APP_DEV_DEPENDENCIES, APP_MATRIX, APP_SERVER_DEV_DEPENDENCIES, ARTIFACT_TEMPLATES, AXES, BASE_DEV_DEPENDENCIES, BIN_CONFIGS, BIN_ENTRY_PATH, BIN_OUTPUT_PATH, BROWSE_DEV_DEPENDENCIES, BROWSE_UPSTREAM, CANON_PATHS, CATALOG_AGENT_PATH, CATALOG_CLOSING_MARKER, CATALOG_OPENING_MARKER, CONFIG_TEMPLATES, CONFORMANCE_TEST_PATH, CONTROL_CHARACTER_PATTERN, Compiler, DECLARATION_DEV_DEPENDENCIES, DEFAULT_ENGINES, DEFAULT_VERSION, DEPENDENCY_NAME_PATTERN, DISTRIBUTION_SETUP_PATH, DISTRIBUTION_TEST_PATH, ENGINES_PATTERN, ENVIRONMENTS, EXECUTABLE_PATHS, EXTRA_RANGE_PATTERN, FLOOR_RANGE_PATTERN, FOREIGN_NAME_PATTERN, FRAMEWORKS, FRAMEWORK_MATRIX, GLOBAL_SETUP_PATH, GROUPS, GUIDES_TEST_PATH, HEX_PATTERN, HOST_INVENTORY_PATH, HOST_PATHS, INTEGRATION_TEST_PATH, INVALID_PATH_CHARACTER_PATTERN, JOURNEY_CONFIG_PATH, MANIFEST_PATH, MAX_ARTIFACT_BYTES, MAX_ARTIFACT_HEX_LENGTH, MAX_AUDIT_FINDINGS, MAX_COLLECTION_ITEMS, MAX_DEPENDENCY_NAME_LENGTH, MAX_MANIFEST_BYTES, MAX_NAME_LENGTH, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, MAX_REGISTRY_BYTES, MAX_SCRIPT_LENGTH, MAX_TOTAL_ARTIFACT_BYTES, MAX_TOTAL_REGISTRY_BYTES, MINIMUM_NODE_VERSION, MINIMUM_NPM_VERSION, NAME_PATTERN, ORCHESTRATION_PATH_NAMES, ORCHESTRATION_PATH_PREFIXES, ORKESTREL_RANGE_PATTERN, PRINT_WIDTH, REFERENCE_PATHS, RELEASE_PROOF_COMMAND, RESERVED_SHEET_NAMES, SEED_GUIDE_PATHS, SERVICE_SCRIPT_PATH, SERVICE_SETUP_PATH, SERVICE_TEST_INCLUDE, SHEET_ENTRY_NAME, SHOWCASE_CONFIG_PATH, SHOWCASE_DEV_DEPENDENCIES, SHOWCASE_OVERRIDES, SHOWCASE_PAGES_PATH, SKILLS_CONFIG_PATH, SOURCE_BROWSER_DEV_DEPENDENCIES, SRC_MATRIX, STUDIES_TEST_INCLUDE, STYLES_DEV_DEPENDENCIES, STYLES_ENTRY_PATH, SURFACES, ScaffoldError, TAB_WIDTH, TARGET_SKILL_NAMES, THEMES_BARREL_PATH, THEMES_ENTRY_PATH, TREE_TEST_PATH, VERSION_PATTERN, WORKSPACE_DEV_ENGINES, WORKSPACE_OWNED_PATHS, applyOverrides, artifactToFinding, artifactToHex, artifactsToQuestions, blueprintToConfigArtifacts, blueprintToDevDependencies, blueprintToDocumentArtifacts, blueprintToExports, blueprintToFaces, blueprintToGuideArtifacts, blueprintToHostArtifacts, blueprintToMachinery, blueprintToManifest, blueprintToManifestOverrides, blueprintToOptimizedDependencies, blueprintToOrchestrationArtifacts, blueprintToProjects, blueprintToQuestions, blueprintToRootTsconfig, blueprintToRootVite, blueprintToScripts, blueprintToSheets, blueprintToSourceArtifacts, blueprintToTestArtifacts, blueprintToWritableScripts, bytesToHex, catalogToLayers, cloneValue, compareVersions, computeBytes, computeHash, computeTotal, contentToHex, createBlueprint, dependenciesToQuestions, extractRangeMajor, extractVersion, inferDrift, inferGroup, insertManifestDependencies, insertManifestSection, isArtifact, isAudit, isBlueprint, isBrowserExtension, isCanonPath, isCatalogEntry, isCollection, isCompilerHooks, isCompilerOptions, isContent, isDeferredPath, isDependency, isDependencyName, isEnvironment, isExtension, isFinding, isFloorPath, isGroup, isGroups, isHex, isManifestScript, isMirror, isOverride, isPath, isPlan, isQuestion, isRetainedPath, isScaffoldError, isSheetName, isSnapshot, isStylesExtension, isSurface, iterateAnswers, manifestToDependencies, manifestToName, matchesDriftReachability, matchesEngines, matchesOrchestrationPath, matchesPrintWidth, matchesRange, nameToGuide, overridesToQuestions, parseBlueprint, parseCompilerOptions, parseExtension, parseGroups, parseSnapshot, pathToCondition, planToFindings, planToHash, planToSummary, renderSkillPointer, replaceManifestOverride, replaceManifestOverrides, replaceManifestRanges, replaceManifestScripts, replacePlanRanges, scanManifestTokens, selectGroups, selectHostPaths, serializeTypeScriptString, srcToEntry, srcToExports, srcToRoot };
|
|
9629
|
+
export { APP_BROWSER_DEV_DEPENDENCIES, APP_DEV_DEPENDENCIES, APP_MATRIX, APP_SERVER_DEV_DEPENDENCIES, ARTIFACT_TEMPLATES, AXES, BASE_DEV_DEPENDENCIES, BIN_CONFIGS, BIN_ENTRY_PATH, BIN_OUTPUT_PATH, BROWSE_DEV_DEPENDENCIES, BROWSE_UPSTREAM, CANON_PATHS, CAPTURE_DEV_DEPENDENCIES, CAPTURE_UPSTREAM, CATALOG_AGENT_PATH, CATALOG_END_MARKER, CATALOG_START_MARKER, CONFIG_TEMPLATES, CONFORMANCE_TEST_PATH, CONTROL_CHARACTER_PATTERN, Compiler, DECLARATION_DEV_DEPENDENCIES, DEFAULT_ENGINES, DEFAULT_VERSION, DEPENDENCY_NAME_PATTERN, DISTRIBUTION_SETUP_PATH, DISTRIBUTION_TEST_PATH, ENGINES_PATTERN, ENVIRONMENTS, EXECUTABLE_PATHS, EXTRA_RANGE_PATTERN, FLOOR_RANGE_PATTERN, FOREIGN_NAME_PATTERN, FRAMEWORKS, FRAMEWORK_MATRIX, GLOBAL_SETUP_PATH, GROUPS, GUIDES_TEST_PATH, HEX_PATTERN, HOST_INVENTORY_PATH, HOST_PATHS, INTEGRATION_TEST_PATH, INVALID_PATH_CHARACTER_PATTERN, JOURNEY_CONFIG_PATH, MANIFEST_PATH, MAX_ARTIFACT_BYTES, MAX_ARTIFACT_HEX_LENGTH, MAX_AUDIT_FINDINGS, MAX_COLLECTION_ITEMS, MAX_DEPENDENCY_NAME_LENGTH, MAX_MANIFEST_BYTES, MAX_NAME_LENGTH, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, MAX_REGISTRY_BYTES, MAX_SCRIPT_LENGTH, MAX_TOTAL_ARTIFACT_BYTES, MAX_TOTAL_REGISTRY_BYTES, MINIMUM_NODE_VERSION, MINIMUM_NPM_VERSION, NAME_PATTERN, ORCHESTRATION_PATH_NAMES, ORCHESTRATION_PATH_PREFIXES, ORKESTREL_RANGE_PATTERN, PRINT_WIDTH, REFERENCE_PATHS, RELEASE_PROOF_COMMAND, RESERVED_SHEET_NAMES, SEED_GUIDE_PATHS, SERVICE_SCRIPT_PATH, SERVICE_SETUP_PATH, SERVICE_TEST_INCLUDE, SHEET_ENTRY_NAME, SHOWCASE_CONFIG_PATH, SHOWCASE_DEV_DEPENDENCIES, SHOWCASE_OVERRIDES, SHOWCASE_PAGES_PATH, SKILLS_CONFIG_PATH, SOURCE_BROWSER_DEV_DEPENDENCIES, SRC_MATRIX, STUDIES_TEST_INCLUDE, STYLES_DEV_DEPENDENCIES, STYLES_ENTRY_PATH, SURFACES, ScaffoldError, TAB_WIDTH, TARGET_SKILL_NAMES, THEMES_BARREL_PATH, THEMES_ENTRY_PATH, TOOLCHAIN_HOLDS, TREE_TEST_PATH, VERSION_PATTERN, WORKSPACE_DEV_ENGINES, WORKSPACE_OWNED_PATHS, applyOverrides, artifactToFinding, artifactToHex, artifactsToQuestions, blueprintToConfigArtifacts, blueprintToDevDependencies, blueprintToDocumentArtifacts, blueprintToExports, blueprintToFaces, blueprintToGuideArtifacts, blueprintToHostArtifacts, blueprintToMachinery, blueprintToManifest, blueprintToManifestOverrides, blueprintToOptimizedDependencies, blueprintToOrchestrationArtifacts, blueprintToProjects, blueprintToQuestions, blueprintToRootTsconfig, blueprintToRootVite, blueprintToScripts, blueprintToSheets, blueprintToSourceArtifacts, blueprintToTestArtifacts, blueprintToToolchainHolds, blueprintToWritableScripts, bytesToHex, catalogToLayers, cloneValue, compareVersions, computeBytes, computeHash, computeTotal, contentToHex, createBlueprint, dependenciesToQuestions, extractRangeMajor, extractVersion, inferDrift, inferGroup, insertManifestDependencies, insertManifestSection, isArtifact, isAudit, isBlueprint, isBrowserExtension, isCanonPath, isCatalogEntry, isCollection, isCompilerHooks, isCompilerOptions, isContent, isDeferredPath, isDependency, isDependencyName, isEnvironment, isExtension, isFinding, isFloorPath, isGroup, isGroups, isHex, isManifestScript, isMirror, isOverride, isPath, isPlan, isQuestion, isRetainedPath, isScaffoldError, isSheetName, isSnapshot, isStylesExtension, isSurface, iterateAnswers, manifestToDependencies, manifestToName, matchesDriftReachability, matchesEngines, matchesOrchestrationPath, matchesPrintWidth, matchesRange, nameToGuide, overridesToQuestions, parseBlueprint, parseCompilerOptions, parseExtension, parseGroups, parseSnapshot, pathToCondition, planToFindings, planToHash, planToSummary, renderSkillPointer, replaceManifestOverride, replaceManifestOverrides, replaceManifestRanges, replaceManifestScripts, replacePlanRanges, scanManifestTokens, selectGroups, selectHostPaths, serializeTypeScriptString, srcToEntry, srcToExports, srcToRoot };
|
|
9482
9630
|
|
|
9483
9631
|
//# sourceMappingURL=index.js.map
|