@orkestrel/scaffold 0.0.114 → 0.0.116

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.
Files changed (108) hide show
  1. package/dist/bin/main.js +137 -15
  2. package/dist/bin/main.js.map +1 -1
  3. package/dist/host/agents/orchestration.md +5 -3
  4. package/dist/host/agents/platforms/windows.md +1 -0
  5. package/dist/host/agents/skills/orkestrel-align/references/integration.md +1 -1
  6. package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +4 -4
  7. package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +4 -1
  8. package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +8 -2
  9. package/dist/host/agents/skills/orkestrel-harden/references/equivalence.md +1 -0
  10. package/dist/host/agents/skills/orkestrel-harden/references/hardening.md +1 -1
  11. package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +1 -1
  12. package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +1 -0
  13. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +9 -3
  14. package/dist/host/claude/agents/analyst.md +1 -1
  15. package/dist/host/claude/agents/astra.md +2 -2
  16. package/dist/host/claude/agents/builder.md +4 -4
  17. package/dist/host/claude/agents/opus.md +3 -3
  18. package/dist/host/claude/agents/orkestrel.md +5 -7
  19. package/dist/host/claude/agents/planner.md +8 -2
  20. package/dist/host/claude/rules/campaign.md +2 -1
  21. package/dist/host/claude/rules/documentation.md +1 -0
  22. package/dist/host/claude/rules/names.md +3 -1
  23. package/dist/host/claude/rules/tests.md +7 -4
  24. package/dist/host/claude/rules/writing.md +1 -0
  25. package/dist/host/claude/skills/enterprise-bootstrap/SKILL.md +1 -2
  26. package/dist/host/claude/skills/orkestrel-align/SKILL.md +1 -1
  27. package/dist/host/claude/skills/orkestrel-build/SKILL.md +1 -2
  28. package/dist/host/claude/skills/orkestrel-debrief/SKILL.md +1 -2
  29. package/dist/host/claude/skills/orkestrel-dispatch/SKILL.md +1 -1
  30. package/dist/host/claude/skills/orkestrel-falsify/SKILL.md +1 -1
  31. package/dist/host/claude/skills/orkestrel-harden/SKILL.md +1 -1
  32. package/dist/host/claude/skills/orkestrel-journey/SKILL.md +1 -1
  33. package/dist/host/claude/skills/orkestrel-parallel/SKILL.md +1 -1
  34. package/dist/host/claude/skills/orkestrel-polish/SKILL.md +1 -2
  35. package/dist/host/claude/skills/orkestrel-publish/SKILL.md +1 -2
  36. package/dist/host/claude/skills/orkestrel-scout/SKILL.md +1 -1
  37. package/dist/host/codex/agents/analyst.toml +8 -5
  38. package/dist/host/codex/agents/astra.toml +4 -5
  39. package/dist/host/codex/agents/builder.toml +5 -5
  40. package/dist/host/codex/agents/opus.toml +3 -4
  41. package/dist/host/codex/agents/orkestrel.toml +2 -1
  42. package/dist/host/codex/agents/planner.toml +8 -5
  43. package/dist/host/codex/agents/reviewer.toml +5 -4
  44. package/dist/host/guides/abort.md +17 -17
  45. package/dist/host/guides/agent.md +445 -445
  46. package/dist/host/guides/brief.md +143 -143
  47. package/dist/host/guides/browser.md +731 -731
  48. package/dist/host/guides/budget.md +39 -39
  49. package/dist/host/guides/capture.md +298 -298
  50. package/dist/host/guides/console.md +109 -109
  51. package/dist/host/guides/contract.md +335 -335
  52. package/dist/host/guides/csv.md +30 -30
  53. package/dist/host/guides/database.md +163 -163
  54. package/dist/host/guides/emitter.md +17 -17
  55. package/dist/host/guides/form.md +99 -99
  56. package/dist/host/guides/guide.md +361 -183
  57. package/dist/host/guides/html.md +49 -49
  58. package/dist/host/guides/indexeddb.md +40 -40
  59. package/dist/host/guides/interpret.md +139 -139
  60. package/dist/host/guides/lsp.md +114 -114
  61. package/dist/host/guides/markdown.md +68 -68
  62. package/dist/host/guides/mcp.md +3745 -3745
  63. package/dist/host/guides/middleware.md +170 -170
  64. package/dist/host/guides/msg.md +95 -95
  65. package/dist/host/guides/ndjson.md +8 -8
  66. package/dist/host/guides/ollama.md +56 -56
  67. package/dist/host/guides/pool.md +21 -21
  68. package/dist/host/guides/probe.md +82 -82
  69. package/dist/host/guides/process.md +99 -99
  70. package/dist/host/guides/program.md +98 -96
  71. package/dist/host/guides/qualifier.md +70 -70
  72. package/dist/host/guides/queue.md +37 -37
  73. package/dist/host/guides/rater.md +38 -38
  74. package/dist/host/guides/reason.md +308 -308
  75. package/dist/host/guides/relation.md +50 -50
  76. package/dist/host/guides/router.md +58 -58
  77. package/dist/host/guides/scaffold.md +554 -419
  78. package/dist/host/guides/sea.md +128 -128
  79. package/dist/host/guides/server.md +100 -100
  80. package/dist/host/guides/sqlite.md +28 -28
  81. package/dist/host/guides/sse.md +20 -20
  82. package/dist/host/guides/study.md +444 -444
  83. package/dist/host/guides/table.md +82 -82
  84. package/dist/host/guides/template.md +41 -41
  85. package/dist/host/guides/terminal.md +121 -121
  86. package/dist/host/guides/test.md +273 -273
  87. package/dist/host/guides/timeout.md +18 -18
  88. package/dist/host/guides/tool.md +27 -27
  89. package/dist/host/guides/toolbox.md +166 -166
  90. package/dist/host/guides/websocket.md +54 -54
  91. package/dist/host/guides/worker.md +24 -24
  92. package/dist/host/guides/workflow.md +187 -187
  93. package/dist/host/guides/workspace.md +55 -55
  94. package/dist/host/manifest.json +93 -93
  95. package/dist/host/tests/setupPolicy.ts +5 -3
  96. package/dist/src/core/index.cjs +89 -3
  97. package/dist/src/core/index.cjs.map +1 -1
  98. package/dist/src/core/index.d.cts +229 -144
  99. package/dist/src/core/index.d.ts +229 -144
  100. package/dist/src/core/index.js +87 -4
  101. package/dist/src/core/index.js.map +1 -1
  102. package/dist/src/server/index.cjs +292 -66
  103. package/dist/src/server/index.cjs.map +1 -1
  104. package/dist/src/server/index.d.cts +188 -6
  105. package/dist/src/server/index.d.ts +188 -6
  106. package/dist/src/server/index.js +287 -69
  107. package/dist/src/server/index.js.map +1 -1
  108. package/package.json +4 -3
package/dist/bin/main.js CHANGED
@@ -1,23 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
  import { align, renderTable, strip, stripControls, width } from "@orkestrel/console";
3
3
  import { attempt, isArray, isDefined, isError, isInstance, isRecord, isString, parseJSON } from "@orkestrel/contract";
4
- import { AXES, BIN_ENTRY_PATH, CATALOG_AGENT_PATH, CONFORMANCE_TEST_PATH, Compiler, DEPENDENCY_NAME_PATTERN, ENVIRONMENTS, FRAMEWORKS, GLOBAL_SETUP_PATH, GROUPS, GUIDES_TEST_PATH, HOST_PATHS, INTEGRATION_TEST_PATH, JOURNEY_CONFIG_PATH, MAX_MANIFEST_BYTES, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, RESERVED_SHEET_NAMES, SERVICE_SETUP_PATH, SHEET_ENTRY_NAME, SHOWCASE_CONFIG_PATH, SHOWCASE_DEV_DEPENDENCIES, SHOWCASE_PAGES_PATH, SKILLS_CONFIG_PATH, STYLES_ENTRY_PATH, ScaffoldError, THEMES_BARREL_PATH, THEMES_ENTRY_PATH, TREE_TEST_PATH, blueprintToConfigArtifacts, blueprintToDevDependencies, blueprintToFaces, blueprintToManifestOverrides, blueprintToProjects, blueprintToScripts, blueprintToSheets, blueprintToTestArtifacts, blueprintToToolchainHolds, blueprintToWritableScripts, compareVersions, createBlueprint, extractRangeMajor, extractVersion, isFloorPath, isScaffoldError, isSheetName, iterateAnswers, manifestToDependencies, manifestToName, nameToGuide, parseExtension, replaceManifestOverrides, replaceManifestScripts, replacePlanRanges } from "../src/core/index.js";
5
- import { MAX_INVENTORY_PATHS, Materializer, Upstream, filesToHost, isExactCaseFile, isPhysicalDirectory, isWorktree, listFiles, readFileText, readHostFloor, readHostManifest, readSnapshot, resolveContainedPath } from "../src/server/index.js";
4
+ import { AXES, BIN_ENTRY_PATH, CATALOG_AGENT_PATH, CONFORMANCE_TEST_PATH, Compiler, DEPENDENCY_NAME_PATTERN, ENVIRONMENTS, FRAMEWORKS, GLOBAL_SETUP_PATH, GROUPS, GUIDES_TEST_PATH, HOST_PATHS, INTEGRATION_TEST_PATH, JOURNEY_CONFIG_PATH, MAX_MANIFEST_BYTES, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, RESERVED_SHEET_NAMES, SERVICE_SETUP_PATH, SHEET_ENTRY_NAME, SHOWCASE_CONFIG_PATH, SHOWCASE_DEV_DEPENDENCIES, SHOWCASE_PAGES_PATH, SKILLS_CONFIG_PATH, STYLES_ENTRY_PATH, ScaffoldError, THEMES_BARREL_PATH, THEMES_ENTRY_PATH, TREE_TEST_PATH, blueprintToConfigArtifacts, blueprintToDevDependencies, blueprintToFaces, blueprintToManifestOverrides, blueprintToProjects, blueprintToScripts, blueprintToSheets, blueprintToTestArtifacts, blueprintToToolchainHolds, blueprintToWritableScripts, collectSurfaceCollisions, compareSurfaceCollisions, compareVersions, createBlueprint, extractRangeMajor, extractVersion, isFloorPath, isScaffoldError, isSheetName, iterateAnswers, manifestToDependencies, manifestToName, nameToGuide, parseExtension, replaceManifestOverrides, replaceManifestScripts, replacePlanRanges } from "../src/core/index.js";
5
+ import { MAX_INVENTORY_PATHS, Materializer, Upstream, filesToHost, isExactCaseFile, isPhysicalDirectory, isWorktree, listFiles, readFileText, readHostFloor, readHostManifest, readSnapshot, readSurfaceCandidate, readSurfaceFile, readSurfaceGuide, readSurfaceRecord, resolveContainedPath } from "../src/server/index.js";
6
+ import { join, normalize, resolve } from "node:path";
6
7
  import { createSession } from "@orkestrel/process/server";
7
8
  import { createMarkdown, flattenText, isTableNode } from "@orkestrel/markdown";
8
9
  import { readdirSync } from "node:fs";
9
- import { normalize } from "node:path";
10
10
  import { parseArgs } from "node:util";
11
11
  var package_default = {
12
12
  name: "@orkestrel/scaffold",
13
- version: "0.0.114",
14
- description: "Scaffold workspaces with commands: new, audit, repair, catalog, and overwrite.",
13
+ version: "0.0.116",
14
+ description: "Scaffold workspaces with commands: new, audit, surface, repair, catalog, and overwrite.",
15
15
  keywords: [
16
16
  "audit",
17
17
  "catalog",
18
18
  "new",
19
19
  "overwrite",
20
- "repair"
20
+ "repair",
21
+ "surface"
21
22
  ],
22
23
  homepage: "https://github.com/orkestrel/scaffold#readme",
23
24
  bugs: "https://github.com/orkestrel/scaffold/issues",
@@ -150,12 +151,13 @@ var PACKAGE_NAME = package_default.name;
150
151
  *
151
152
  * @remarks
152
153
  * The order the type declares them in, which is also the order usage lists them:
153
- * the verb that creates a workspace, then the one that only reads it, then the
154
+ * the verb that creates a workspace, then the verbs that only read, then the
154
155
  * ones that write to one that already exists, widest last.
155
156
  */
156
157
  var VERBS = Object.freeze([
157
158
  "new",
158
159
  "audit",
160
+ "surface",
159
161
  "repair",
160
162
  "catalog",
161
163
  "overwrite"
@@ -187,13 +189,14 @@ var FAILED_CODE = "FAILED";
187
189
  /** Holds what the failure envelope says when the raised value carried no message. */
188
190
  var FAILED_MESSAGE = "The command failed for an unrecognized reason";
189
191
  /**
190
- * Names the positional argument `new` alone takes, as usage writes it.
192
+ * Names the workspace argument the creation verb takes, as usage writes it.
191
193
  *
192
194
  * @remarks
193
- * The workspace name is the only positional argument any verb takes, so it is
194
- * one value rather than a per-verb table with holes in it.
195
+ * The surface verb's positional arguments name candidate checkouts instead.
195
196
  */
196
197
  var NAME_ARGUMENT = "<name>";
198
+ /** Names the surface command's optional positional checkout list. */
199
+ var CHECKOUT_ARGUMENT = "[<checkout>...]";
197
200
  /**
198
201
  * Declares every option the executable accepts, as `node:util` parses them, frozen.
199
202
  *
@@ -288,6 +291,12 @@ var VERB_OPTIONS = Object.freeze({
288
291
  "--target <path>",
289
292
  "--json"
290
293
  ]),
294
+ surface: Object.freeze([
295
+ "--offline",
296
+ "--from <path>",
297
+ "--target <path>",
298
+ "--json"
299
+ ]),
291
300
  repair: Object.freeze([
292
301
  "--groups <list>",
293
302
  "--offline",
@@ -320,6 +329,7 @@ var VERB_OPTIONS = Object.freeze({
320
329
  var VERB_SUMMARY = Object.freeze({
321
330
  new: "scaffold a workspace",
322
331
  audit: "report how the target compares to its plan, writing nothing",
332
+ surface: "report fleet name collisions against the recorded baseline, writing nothing",
323
333
  repair: "write each planned path the target is missing or has let drift",
324
334
  catalog: "regenerate the package table and refresh the guide mirrors",
325
335
  overwrite: "do everything repair and catalog do, then delete what the plan does not own, re-declare the dependency ranges, and declare each planned dependency the manifest lacks"
@@ -446,7 +456,7 @@ function environmentToUpstream(environment) {
446
456
  * @remarks
447
457
  * The synopsis is derived from the verb's own option list rather than stored
448
458
  * beside it, so a line that documents an option the verb does not take cannot be
449
- * written. `new` alone carries the positional argument.
459
+ * written. `new` carries a workspace name; `surface` carries candidate checkouts.
450
460
  *
451
461
  * @example
452
462
  * ```ts
@@ -456,7 +466,7 @@ function environmentToUpstream(environment) {
456
466
  * ```
457
467
  */
458
468
  function verbToSyntax(verb) {
459
- return `${EXECUTABLE_NAME} ${verb}${verb === "new" ? ` ${NAME_ARGUMENT}` : ""} ${VERB_OPTIONS[verb].map((option) => `[${option}]`).join(" ")}`;
469
+ return `${EXECUTABLE_NAME} ${verb}${verb === "new" ? ` ${NAME_ARGUMENT}` : verb === "surface" ? ` ${CHECKOUT_ARGUMENT}` : ""} ${VERB_OPTIONS[verb].map((option) => `[${option}]`).join(" ")}`;
460
470
  }
461
471
  /**
462
472
  * Renders the whole command reference.
@@ -530,8 +540,8 @@ function argvToCommand(argv) {
530
540
  const refused = Object.keys(values).filter((name) => !accepted.includes(name));
531
541
  if (refused.length > 0) throw new UsageError(`'${verb}' does not take ${refused.map((name) => `--${name}`).join(", ")}.`);
532
542
  const [name] = positionals;
533
- if (positionals.length > 1) throw new UsageError(`'${verb}' takes at most one argument, and was given ${String(positionals.length)}.`);
534
- if (verb !== "new" && name !== void 0) throw new UsageError(`'${verb}' takes no argument, and was given '${name}'.`);
543
+ if (verb !== "surface" && positionals.length > 1) throw new UsageError(`'${verb}' takes at most one argument, and was given ${String(positionals.length)}.`);
544
+ if (verb !== "new" && verb !== "surface" && name !== void 0) throw new UsageError(`'${verb}' takes no argument, and was given '${name}'.`);
535
545
  const paths = isArray(values.from) ? values.from.filter(isString) : [];
536
546
  if (verb !== "catalog" && paths.length > 1) throw new UsageError(`'${verb}' takes --from once, and was given it ${String(paths.length)} times.`);
537
547
  const src = isString(values.src) ? values.src : void 0;
@@ -575,6 +585,14 @@ function argvToCommand(argv) {
575
585
  ...selection,
576
586
  ...offline ? { offline } : {}
577
587
  };
588
+ case "surface": return {
589
+ verb,
590
+ checkouts: positionals,
591
+ json,
592
+ ...location,
593
+ ...source,
594
+ ...offline ? { offline } : {}
595
+ };
578
596
  case "repair": return {
579
597
  verb,
580
598
  json,
@@ -1489,6 +1507,29 @@ function selectionToExtensions(selection, axes, styles) {
1489
1507
  });
1490
1508
  }
1491
1509
  /**
1510
+ * Resolves the data root a reading verb draws its floor from.
1511
+ *
1512
+ * @param from - The local root `--from` names. Default: the bundled host.
1513
+ * @returns The verified host value of a built root, or the path of a raw checkout that carries
1514
+ * no `manifest.json`.
1515
+ * @throws As `readHostFloor` throws when the bundled host or a built root is unreadable.
1516
+ *
1517
+ * @remarks
1518
+ * A built root stores each file under its storage name, so a destination such as the catalog
1519
+ * table is read through the verified host value rather than by path.
1520
+ *
1521
+ * @example
1522
+ * ```ts
1523
+ * import { resolveFloor } from './helpers.js'
1524
+ *
1525
+ * resolveFloor('../scaffold') // the checkout path when it carries no manifest.json
1526
+ * ```
1527
+ */
1528
+ function resolveFloor(from) {
1529
+ if (from === void 0) return readHostFloor();
1530
+ return readHostManifest(from) === void 0 ? from : readHostFloor(from);
1531
+ }
1532
+ /**
1492
1533
  * Reads the packages a target's catalog table listed before this run.
1493
1534
  *
1494
1535
  * @param target - The target or raw checkout directory, or a verified value host.
@@ -1867,11 +1908,92 @@ var CLI = class {
1867
1908
  switch (command.verb) {
1868
1909
  case "new": return this.#create(command);
1869
1910
  case "audit": return this.#inspect(command);
1911
+ case "surface": return this.#compare(command);
1870
1912
  case "repair": return this.#restore(command);
1871
1913
  case "catalog": return this.#refresh(command);
1872
1914
  case "overwrite": return this.#replace(command);
1873
1915
  }
1874
1916
  }
1917
+ async #compare(command) {
1918
+ const floor = resolveFloor(command.from);
1919
+ const upstream = command.from === void 0 && command.offline !== true ? new Upstream({
1920
+ ...this.#upstream,
1921
+ retries: 0
1922
+ }) : void 0;
1923
+ try {
1924
+ const membership = upstream === void 0 ? void 0 : await this.#readMembership(upstream);
1925
+ const inventory = upstream === void 0 ? void 0 : await this.#readRecord(upstream);
1926
+ const target = resolve(command.target ?? process.cwd());
1927
+ const candidates = [.../* @__PURE__ */ new Set([...command.checkouts.map((path) => resolve(path)), ...isExactCaseFile(join(target, "package.json")) ? [target] : []])].map((path) => readSurfaceCandidate(path));
1928
+ const names = membership?.entries?.map(({ name }) => name) ?? catalogToNames(floor);
1929
+ const owners = [.../* @__PURE__ */ new Set([...candidates.map(({ owner }) => owner), ...names.map((name) => name.replace(/^@orkestrel\//u, ""))])].sort();
1930
+ const pending = owners.filter((owner) => !candidates.some((candidate) => candidate.owner === owner));
1931
+ const mirrors = upstream === void 0 ? [] : await upstream.fetch(pending.map((owner) => `@orkestrel/${owner}`), {});
1932
+ const claims = owners.map((owner) => {
1933
+ const own = candidates.filter((candidate) => candidate.owner === owner);
1934
+ if (own.length > 0) return {
1935
+ owner,
1936
+ names: [...new Set(own.flatMap((candidate) => candidate.names))].sort(),
1937
+ source: "candidate"
1938
+ };
1939
+ const live = mirrors.find((mirror) => mirror.name === `@orkestrel/${owner}`);
1940
+ if (live?.lookup === "found") return {
1941
+ ...readSurfaceGuide(live.content, owner, `live ${live.path}`),
1942
+ source: "live"
1943
+ };
1944
+ const fallback = readSurfaceFile(floor, owner, "floor");
1945
+ return fallback === void 0 ? {
1946
+ owner,
1947
+ source: "unread"
1948
+ } : {
1949
+ ...fallback,
1950
+ source: "floor"
1951
+ };
1952
+ });
1953
+ const record = inventory?.lookup === "found" ? inventory.surface : isString(floor) ? readSurfaceRecord(floor) : floor.manifest.surface;
1954
+ const collisions = compareSurfaceCollisions(collectSurfaceCollisions(claims.flatMap((claim) => claim.source === "unread" ? [] : [claim])), record);
1955
+ const fell = claims.some(({ source }) => source === "floor" || source === "unread");
1956
+ const provenance = command.from !== void 0 ? {} : {
1957
+ membership: membership?.entries === void 0 ? "floor" : "live",
1958
+ guides: upstream === void 0 || fell ? "floor" : "live",
1959
+ record: inventory?.lookup === "found" ? "live" : "floor"
1960
+ };
1961
+ const conflicts = candidates.flatMap((candidate) => candidate.conflicts);
1962
+ const result = {
1963
+ owners: claims,
1964
+ collisions,
1965
+ conflicts,
1966
+ provenance
1967
+ };
1968
+ if (command.json === true) this.#report(result);
1969
+ else {
1970
+ if (membership?.note !== void 0) this.#say(`Surface membership fell to the floor catalog table: ${membership.note}`);
1971
+ for (const claim of claims) {
1972
+ if (upstream !== void 0 && claim.source === "floor") this.#say(`Surface owner ${JSON.stringify(claim.owner)} fell to the floor guide: no candidate or live guide answered.`);
1973
+ if (claim.source === "unread") this.#say(`Surface owner ${JSON.stringify(claim.owner)} is unread: no candidate, live guide, or floor guide answered.`);
1974
+ }
1975
+ if (inventory !== void 0 && inventory.lookup !== "found") this.#say(`Surface record fell to the floor inventory: ${inventory.note}.`);
1976
+ for (const collision of collisions.filter(({ standing }) => standing === "error")) this.#say(`Surface collision ${JSON.stringify(collision.name.slice(0, 512))}: ${collision.owners.map((owner) => JSON.stringify(owner.slice(0, 512))).join(", ")}. Rename the declaration outside its owning package or reuse the owner's export.`);
1977
+ for (const conflict of conflicts) this.#say(`Surface conflict ${JSON.stringify(conflict.name.slice(0, 512))}: ${JSON.stringify(conflict.owner.slice(0, 512))} exports it from ${conflict.environments.map((environment) => JSON.stringify(environment.slice(0, 512))).join(", ")}. Export it once from core, or give each environment's export a distinct name.`);
1978
+ this.#say(`${String(collisions.filter(({ standing }) => standing === "recorded").length)} recorded collisions, ${String(collisions.filter(({ standing }) => standing === "closed").length)} closed collisions.`);
1979
+ }
1980
+ return collisions.some(({ standing }) => standing === "error") || conflicts.length > 0 || claims.some(({ source }) => source === "unread") || upstream !== void 0 && (provenance.membership === "floor" || provenance.guides === "floor" || provenance.record === "floor") ? 1 : 0;
1981
+ } finally {
1982
+ upstream?.destroy();
1983
+ }
1984
+ }
1985
+ async #readMembership(upstream) {
1986
+ return upstream.catalog().then((entries) => ({ entries }), (error) => {
1987
+ const context = isScaffoldError(error) && isRecord(error.context) ? error.context : {};
1988
+ if (context.unreachable === true) throw new ScaffoldError("FETCH", `Surface registry is unreachable from this host: the organization package list at ${isString(context.url) ? context.url : "the registry"} produced no answer: ${isString(context.note) ? context.note : "no cause was reported"}. Use --offline to check against the bundled guides.`, context);
1989
+ return { note: errorToEnvelope(error).error.message };
1990
+ });
1991
+ }
1992
+ async #readRecord(upstream) {
1993
+ const inventory = await upstream.inventory();
1994
+ if (inventory.unreachable === true) throw new ScaffoldError("FETCH", `Surface repository is unreachable from this host: ${inventory.note}. Use --offline to check against the bundled guides.`, { note: inventory.note });
1995
+ return inventory;
1996
+ }
1875
1997
  async #create(command) {
1876
1998
  const target = command.target ?? command.name;
1877
1999
  const app = selectionToEnvironments(command.app, "app");
@@ -2016,7 +2138,7 @@ var CLI = class {
2016
2138
  const [host, ...extra] = command.from ?? [];
2017
2139
  if (extra.length > 0) this.#warn(`Read the data root from ${String(host)}. The other ${String(extra.length)} local root${extra.length === 1 ? "" : "s"} named by --from reach nothing this run does.`);
2018
2140
  const previous = catalogToNames(target);
2019
- const floor = host === void 0 ? readHostFloor() : readHostManifest(host) === void 0 ? host : readHostFloor(host);
2141
+ const floor = resolveFloor(host);
2020
2142
  const materializer = new Materializer({ host: floor });
2021
2143
  const outcome = await this.#assemble(command, target, floor, materializer, previous);
2022
2144
  if (command.json === true) this.#report(outcome);