@orkestrel/scaffold 0.0.26 → 0.0.27

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.
@@ -609,19 +609,61 @@ export declare const CATALOG_AGENT_PATH = ".claude/agents/orkestrel.md";
609
609
  * still a row: dropping it would hide a package the organization publishes
610
610
  * behind one failed request, and inventing a version would state something
611
611
  * upstream never said.
612
+ *
613
+ * `dependencies` are the RUNTIME edges the published version declares, which is
614
+ * what a publish order is computed over: a runtime bump obliges every dependent
615
+ * to re-pin and republish, while a development bump obliges nothing beyond the
616
+ * repository that declares it. No layer is recorded here, because a layer is a
617
+ * deterministic function of these edges across the whole catalog — a stored one
618
+ * could only disagree with the rows it was derived from. Read it through
619
+ * {@link catalogToLayers}.
612
620
  */
613
621
  export declare type CatalogEntry = {
614
622
  readonly name: string;
615
623
  readonly lookup: 'found';
616
624
  readonly version: string;
625
+ readonly dependencies: readonly Dependency[];
617
626
  readonly note?: never;
618
627
  } | {
619
628
  readonly name: string;
620
629
  readonly lookup: 'missing' | 'failed';
621
630
  readonly note: string;
622
631
  readonly version?: never;
632
+ readonly dependencies?: never;
623
633
  };
624
634
 
635
+ /**
636
+ * Project a catalog into the layers it publishes in.
637
+ *
638
+ * @param entries - The catalog rows to order.
639
+ * @returns One layer per round, each holding the names publishable together,
640
+ * sorted within the layer; a name whose edges never resolve is omitted.
641
+ *
642
+ * @remarks
643
+ * A layer is a deterministic function of the catalog's own edges, so it is
644
+ * computed here rather than stored on a row that could disagree with them.
645
+ * Only RUNTIME edges between catalogued packages count: a development
646
+ * dependency reaches no consumer, so it constrains nothing about publish order,
647
+ * and an edge leaving the fleet is a package this catalog does not publish.
648
+ *
649
+ * The order matters because these packages are `0.0.x`, where a caret pins one
650
+ * exact release. Publishing a dependent before its dependency leaves the
651
+ * dependent pinned to the older release, and two ranges that disagree install
652
+ * two copies of one package that the compiler reads as two distinct types.
653
+ *
654
+ * A cycle cannot be published in rounds, so its members are omitted rather than
655
+ * placed in an order that would be wrong. An absent name is the report: compare
656
+ * the returned names against the catalog to find one.
657
+ *
658
+ * @example
659
+ * ```ts
660
+ * import { catalogToLayers } from '@orkestrel/scaffold'
661
+ *
662
+ * catalogToLayers(entries)[0] // the names that depend on nothing in the fleet
663
+ * ```
664
+ */
665
+ export declare function catalogToLayers(entries: readonly CatalogEntry[]): ReadonlyArray<readonly string[]>;
666
+
625
667
  /**
626
668
  * Snapshot an untrusted value into exact JSON data the caller owns.
627
669
  *
@@ -609,19 +609,61 @@ export declare const CATALOG_AGENT_PATH = ".claude/agents/orkestrel.md";
609
609
  * still a row: dropping it would hide a package the organization publishes
610
610
  * behind one failed request, and inventing a version would state something
611
611
  * upstream never said.
612
+ *
613
+ * `dependencies` are the RUNTIME edges the published version declares, which is
614
+ * what a publish order is computed over: a runtime bump obliges every dependent
615
+ * to re-pin and republish, while a development bump obliges nothing beyond the
616
+ * repository that declares it. No layer is recorded here, because a layer is a
617
+ * deterministic function of these edges across the whole catalog — a stored one
618
+ * could only disagree with the rows it was derived from. Read it through
619
+ * {@link catalogToLayers}.
612
620
  */
613
621
  export declare type CatalogEntry = {
614
622
  readonly name: string;
615
623
  readonly lookup: 'found';
616
624
  readonly version: string;
625
+ readonly dependencies: readonly Dependency[];
617
626
  readonly note?: never;
618
627
  } | {
619
628
  readonly name: string;
620
629
  readonly lookup: 'missing' | 'failed';
621
630
  readonly note: string;
622
631
  readonly version?: never;
632
+ readonly dependencies?: never;
623
633
  };
624
634
 
635
+ /**
636
+ * Project a catalog into the layers it publishes in.
637
+ *
638
+ * @param entries - The catalog rows to order.
639
+ * @returns One layer per round, each holding the names publishable together,
640
+ * sorted within the layer; a name whose edges never resolve is omitted.
641
+ *
642
+ * @remarks
643
+ * A layer is a deterministic function of the catalog's own edges, so it is
644
+ * computed here rather than stored on a row that could disagree with them.
645
+ * Only RUNTIME edges between catalogued packages count: a development
646
+ * dependency reaches no consumer, so it constrains nothing about publish order,
647
+ * and an edge leaving the fleet is a package this catalog does not publish.
648
+ *
649
+ * The order matters because these packages are `0.0.x`, where a caret pins one
650
+ * exact release. Publishing a dependent before its dependency leaves the
651
+ * dependent pinned to the older release, and two ranges that disagree install
652
+ * two copies of one package that the compiler reads as two distinct types.
653
+ *
654
+ * A cycle cannot be published in rounds, so its members are omitted rather than
655
+ * placed in an order that would be wrong. An absent name is the report: compare
656
+ * the returned names against the catalog to find one.
657
+ *
658
+ * @example
659
+ * ```ts
660
+ * import { catalogToLayers } from '@orkestrel/scaffold'
661
+ *
662
+ * catalogToLayers(entries)[0] // the names that depend on nothing in the fleet
663
+ * ```
664
+ */
665
+ export declare function catalogToLayers(entries: readonly CatalogEntry[]): ReadonlyArray<readonly string[]>;
666
+
625
667
  /**
626
668
  * Snapshot an untrusted value into exact JSON data the caller owns.
627
669
  *
@@ -282,8 +282,8 @@ var DEFAULT_ENGINES = `>=${MINIMUM_NODE_VERSION}`;
282
282
  /** The tooling versions scaffold and every generated workspace share. */
283
283
  var BASE_DEV_DEPENDENCIES = Object.freeze({
284
284
  "@microsoft/api-extractor": "^7.58.12",
285
- "@orkestrel/guide": "^0.0.9",
286
- "@orkestrel/scaffold": "^0.0.26",
285
+ "@orkestrel/guide": "^0.0.10",
286
+ "@orkestrel/scaffold": "^0.0.27",
287
287
  "@types/node": "^26.2.0",
288
288
  oxfmt: "^0.62.0",
289
289
  oxlint: "^1.77.0",
@@ -298,11 +298,11 @@ var SOURCE_BROWSER_DEV_DEPENDENCIES = Object.freeze({
298
298
  playwright: "^1.62.1"
299
299
  });
300
300
  /** The development dependency every private `app` environment adds. */
301
- var APP_DEV_DEPENDENCIES = Object.freeze({ "@orkestrel/contract": "^0.0.10" });
301
+ var APP_DEV_DEPENDENCIES = Object.freeze({ "@orkestrel/contract": "^0.0.11" });
302
302
  /** The development dependencies a private Vue browser application adds. */
303
303
  var APP_BROWSER_DEV_DEPENDENCIES = Object.freeze({
304
304
  ...SOURCE_BROWSER_DEV_DEPENDENCIES,
305
- "@orkestrel/html": "^0.0.2",
305
+ "@orkestrel/html": "^0.0.3",
306
306
  "@vitejs/plugin-vue": "^6.0.8",
307
307
  vue: "^3.5.40",
308
308
  "vue-tsc": "^3.3.7"
@@ -320,10 +320,10 @@ var APP_BROWSER_DEV_DEPENDENCIES = Object.freeze({
320
320
  var SHOWCASE_DEV_DEPENDENCIES = Object.freeze({ "vite-plugin-singlefile": "^2.3.3" });
321
321
  /** The development dependencies a private server application adds. */
322
322
  var APP_SERVER_DEV_DEPENDENCIES = Object.freeze({
323
- "@orkestrel/emitter": "^0.0.5",
324
- "@orkestrel/middleware": "^0.0.9",
325
- "@orkestrel/router": "^0.0.8",
326
- "@orkestrel/server": "^0.0.10"
323
+ "@orkestrel/emitter": "^0.0.6",
324
+ "@orkestrel/middleware": "^0.0.10",
325
+ "@orkestrel/router": "^0.0.9",
326
+ "@orkestrel/server": "^0.0.11"
327
327
  });
328
328
  //#endregion
329
329
  //#region src/core/templates.ts
@@ -1590,7 +1590,8 @@ var isMirror = unionOf(recordOf({
1590
1590
  var isCatalogEntry = unionOf(recordOf({
1591
1591
  name: isDependencyName,
1592
1592
  lookup: literalOf("found"),
1593
- version: isString
1593
+ version: isString,
1594
+ dependencies: andOf(isCollection, arrayOf(isDependency))
1594
1595
  }), recordOf({
1595
1596
  name: isDependencyName,
1596
1597
  lookup: literalOf("missing", "failed"),
@@ -2163,6 +2164,54 @@ function matchesDriftReachability(ownership, finding) {
2163
2164
  return finding.drift === "stale" && ownership === "content";
2164
2165
  }
2165
2166
  /**
2167
+ * Project a catalog into the layers it publishes in.
2168
+ *
2169
+ * @param entries - The catalog rows to order.
2170
+ * @returns One layer per round, each holding the names publishable together,
2171
+ * sorted within the layer; a name whose edges never resolve is omitted.
2172
+ *
2173
+ * @remarks
2174
+ * A layer is a deterministic function of the catalog's own edges, so it is
2175
+ * computed here rather than stored on a row that could disagree with them.
2176
+ * Only RUNTIME edges between catalogued packages count: a development
2177
+ * dependency reaches no consumer, so it constrains nothing about publish order,
2178
+ * and an edge leaving the fleet is a package this catalog does not publish.
2179
+ *
2180
+ * The order matters because these packages are `0.0.x`, where a caret pins one
2181
+ * exact release. Publishing a dependent before its dependency leaves the
2182
+ * dependent pinned to the older release, and two ranges that disagree install
2183
+ * two copies of one package that the compiler reads as two distinct types.
2184
+ *
2185
+ * A cycle cannot be published in rounds, so its members are omitted rather than
2186
+ * placed in an order that would be wrong. An absent name is the report: compare
2187
+ * the returned names against the catalog to find one.
2188
+ *
2189
+ * @example
2190
+ * ```ts
2191
+ * import { catalogToLayers } from '@orkestrel/scaffold'
2192
+ *
2193
+ * catalogToLayers(entries)[0] // the names that depend on nothing in the fleet
2194
+ * ```
2195
+ */
2196
+ function catalogToLayers(entries) {
2197
+ const published = new Set(entries.filter((entry) => entry.lookup === "found").map((entry) => entry.name));
2198
+ const pending = /* @__PURE__ */ new Map();
2199
+ for (const entry of entries) {
2200
+ if (entry.lookup !== "found") continue;
2201
+ const edges = entry.dependencies.map((dependency) => dependency.name);
2202
+ pending.set(entry.name, new Set(edges.filter((name) => published.has(name))));
2203
+ }
2204
+ const layers = [];
2205
+ while (pending.size > 0) {
2206
+ const ready = [...pending].filter(([, edges]) => edges.size === 0).map(([name]) => name);
2207
+ if (ready.length === 0) break;
2208
+ for (const name of ready) pending.delete(name);
2209
+ for (const edges of pending.values()) for (const name of ready) edges.delete(name);
2210
+ layers.push(ready.sort());
2211
+ }
2212
+ return layers;
2213
+ }
2214
+ /**
2166
2215
  * Project a plan into its tally by artifact origin.
2167
2216
  *
2168
2217
  * @param plan - The plan to summarize.
@@ -4287,6 +4336,6 @@ function createCompiler(options) {
4287
4336
  return new Compiler(options);
4288
4337
  }
4289
4338
  //#endregion
4290
- export { APP_BROWSER_DEV_DEPENDENCIES, APP_DEV_DEPENDENCIES, APP_MATRIX, APP_SERVER_DEV_DEPENDENCIES, ARTIFACT_TEMPLATES, BASE_DEV_DEPENDENCIES, BIN_CONFIGS, BIN_ENTRY_PATH, CATALOG_AGENT_PATH, CONFIG_TEMPLATES, CONTROL_CHARACTER_PATTERN, Compiler, DEFAULT_ENGINES, DEFAULT_VERSION, DEPENDENCY_NAME_PATTERN, ENGINES_PATTERN, ENVIRONMENTS, EXECUTABLE_PATHS, EXTRA_NAME_PATTERN, EXTRA_RANGE_PATTERN, GLOBAL_SETUP_PATH, GROUPS, GUIDES_TEST_PATH, HEX_PATTERN, HOST_PATHS, INTEGRATION_TEST_PATH, INVALID_PATH_CHARACTER_PATTERN, 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_TOTAL_ARTIFACT_BYTES, MINIMUM_NODE_VERSION, NAME_PATTERN, ORCHESTRATION_PATH_NAMES, ORCHESTRATION_PATH_PREFIXES, ORKESTREL_RANGE_PATTERN, SERVICE_SCRIPT_PATH, SHOWCASE_CONFIG_PATH, SHOWCASE_DEV_DEPENDENCIES, SOURCE_BROWSER_DEV_DEPENDENCIES, SRC_MATRIX, ScaffoldError, VERSION_PATTERN, applyOverrides, artifactToFinding, artifactToHex, artifactsToQuestions, blueprintToConfigArtifacts, blueprintToDevDependencies, blueprintToDocumentArtifacts, blueprintToGuideArtifacts, blueprintToMachinery, blueprintToManifest, blueprintToOrchestrationArtifacts, blueprintToQuestions, blueprintToRootTsconfig, blueprintToRootVite, blueprintToScripts, blueprintToSourceArtifacts, blueprintToTestArtifacts, bytesToHex, cloneValue, compareVersions, computeBytes, computeHash, contentToHex, createBlueprint, createCompiler, dependenciesToQuestions, extractVersion, inferDrift, inferGroup, isArtifact, isAudit, isBlueprint, isCatalogEntry, isCollection, isCompilerHooks, isCompilerOptions, isContent, isDependency, isDependencyName, isEnvironment, isFinding, isGroup, isGroups, isHex, isMirror, isOverride, isPath, isPlan, isQuestion, isScaffoldError, isSnapshot, manifestToDependencies, manifestToName, matchesDriftReachability, matchesEngines, matchesOrchestrationPath, matchesRange, nameToGuide, nameToHostArtifacts, overridesToQuestions, parseBlueprint, parseCompilerOptions, parseGroups, parseSnapshot, pathToCondition, planToFindings, planToHash, planToSummary, selectGroups, selectHostPaths, serializeTypeScriptString, srcToEntry, srcToExports, srcToRoot };
4339
+ export { APP_BROWSER_DEV_DEPENDENCIES, APP_DEV_DEPENDENCIES, APP_MATRIX, APP_SERVER_DEV_DEPENDENCIES, ARTIFACT_TEMPLATES, BASE_DEV_DEPENDENCIES, BIN_CONFIGS, BIN_ENTRY_PATH, CATALOG_AGENT_PATH, CONFIG_TEMPLATES, CONTROL_CHARACTER_PATTERN, Compiler, DEFAULT_ENGINES, DEFAULT_VERSION, DEPENDENCY_NAME_PATTERN, ENGINES_PATTERN, ENVIRONMENTS, EXECUTABLE_PATHS, EXTRA_NAME_PATTERN, EXTRA_RANGE_PATTERN, GLOBAL_SETUP_PATH, GROUPS, GUIDES_TEST_PATH, HEX_PATTERN, HOST_PATHS, INTEGRATION_TEST_PATH, INVALID_PATH_CHARACTER_PATTERN, 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_TOTAL_ARTIFACT_BYTES, MINIMUM_NODE_VERSION, NAME_PATTERN, ORCHESTRATION_PATH_NAMES, ORCHESTRATION_PATH_PREFIXES, ORKESTREL_RANGE_PATTERN, SERVICE_SCRIPT_PATH, SHOWCASE_CONFIG_PATH, SHOWCASE_DEV_DEPENDENCIES, SOURCE_BROWSER_DEV_DEPENDENCIES, SRC_MATRIX, ScaffoldError, VERSION_PATTERN, applyOverrides, artifactToFinding, artifactToHex, artifactsToQuestions, blueprintToConfigArtifacts, blueprintToDevDependencies, blueprintToDocumentArtifacts, blueprintToGuideArtifacts, blueprintToMachinery, blueprintToManifest, blueprintToOrchestrationArtifacts, blueprintToQuestions, blueprintToRootTsconfig, blueprintToRootVite, blueprintToScripts, blueprintToSourceArtifacts, blueprintToTestArtifacts, bytesToHex, catalogToLayers, cloneValue, compareVersions, computeBytes, computeHash, contentToHex, createBlueprint, createCompiler, dependenciesToQuestions, extractVersion, inferDrift, inferGroup, isArtifact, isAudit, isBlueprint, isCatalogEntry, isCollection, isCompilerHooks, isCompilerOptions, isContent, isDependency, isDependencyName, isEnvironment, isFinding, isGroup, isGroups, isHex, isMirror, isOverride, isPath, isPlan, isQuestion, isScaffoldError, isSnapshot, manifestToDependencies, manifestToName, matchesDriftReachability, matchesEngines, matchesOrchestrationPath, matchesRange, nameToGuide, nameToHostArtifacts, overridesToQuestions, parseBlueprint, parseCompilerOptions, parseGroups, parseSnapshot, pathToCondition, planToFindings, planToHash, planToSummary, selectGroups, selectHostPaths, serializeTypeScriptString, srcToEntry, srcToExports, srcToRoot };
4291
4340
 
4292
4341
  //# sourceMappingURL=index.js.map