@orkestrel/scaffold 0.0.143 → 0.0.145

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 (35) hide show
  1. package/dist/agents/skills/orkestrel-publish/scripts/swap.js +111 -5
  2. package/dist/agents/templates/brief.md +1 -0
  3. package/dist/bin/main.js +87 -30
  4. package/dist/bin/main.js.map +1 -1
  5. package/dist/host/agents/platforms/windows.md +1 -0
  6. package/dist/host/agents/skills/orkestrel-publish/references/release.md +1 -0
  7. package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +133 -6
  8. package/dist/host/agents/templates/brief.md +1 -0
  9. package/dist/host/claude/agents/orkestrel.md +52 -52
  10. package/dist/host/claude/rules/documentation.md +1 -0
  11. package/dist/host/claude/rules/quality.md +1 -0
  12. package/dist/host/claude/rules/tests.md +1 -0
  13. package/dist/host/claude/rules/workspace.md +14 -13
  14. package/dist/host/dotfiles/oxlintrc.json +1 -1
  15. package/dist/host/guides/browser.md +1 -1
  16. package/dist/host/guides/codec.md +29 -12
  17. package/dist/host/guides/contract.md +58 -57
  18. package/dist/host/guides/scaffold.md +63 -43
  19. package/dist/host/guides/server.md +1 -1
  20. package/dist/host/manifest.json +18 -18
  21. package/dist/host/scripts/browsers.sh +0 -0
  22. package/dist/host/scripts/codex.sh +0 -0
  23. package/dist/host/scripts/cursor.sh +0 -0
  24. package/dist/host/scripts/deps.sh +0 -0
  25. package/dist/host/scripts/npm.sh +0 -0
  26. package/dist/host/scripts/ollama.sh +0 -0
  27. package/dist/host/tests/config.test.ts +5 -0
  28. package/dist/host/tests/setupPolicy.ts +1 -0
  29. package/dist/src/core/index.cjs +64 -24
  30. package/dist/src/core/index.cjs.map +1 -1
  31. package/dist/src/core/index.d.cts +17 -2
  32. package/dist/src/core/index.d.ts +17 -2
  33. package/dist/src/core/index.js +64 -25
  34. package/dist/src/core/index.js.map +1 -1
  35. package/package.json +13 -13
@@ -4,7 +4,7 @@ let _orkestrel_template = require("@orkestrel/template");
4
4
  let _orkestrel_emitter = require("@orkestrel/emitter");
5
5
  var package_default = {
6
6
  name: "@orkestrel/scaffold",
7
- version: "0.0.143",
7
+ version: "0.0.145",
8
8
  description: "Scaffold workspaces with commands: new, audit, surface, repair, catalog, and overwrite.",
9
9
  keywords: [
10
10
  "audit",
@@ -96,20 +96,20 @@ var package_default = {
96
96
  "prepublishOnly": "npm run format:check && npm run lint:check && npm run check && npm run build && npm test && npm run test:templates && npm run test:distribution -- --mode release"
97
97
  },
98
98
  dependencies: {
99
- "@orkestrel/console": "^0.0.22",
100
- "@orkestrel/contract": "^0.0.26",
101
- "@orkestrel/emitter": "^0.0.18",
102
- "@orkestrel/markdown": "^0.0.23",
103
- "@orkestrel/process": "^0.0.22",
104
- "@orkestrel/template": "^0.0.16"
99
+ "@orkestrel/console": "^0.0.23",
100
+ "@orkestrel/contract": "^0.0.27",
101
+ "@orkestrel/emitter": "^0.0.19",
102
+ "@orkestrel/markdown": "^0.0.24",
103
+ "@orkestrel/process": "^0.0.23",
104
+ "@orkestrel/template": "^0.0.17"
105
105
  },
106
106
  devDependencies: {
107
107
  "@microsoft/api-extractor": "^7.60.1",
108
- "@orkestrel/browser": "^0.0.35",
109
- "@orkestrel/guide": "^0.0.33",
110
- "@orkestrel/html": "^0.0.18",
111
- "@orkestrel/probe": "^0.0.32",
112
- "@orkestrel/test": "^0.0.44",
108
+ "@orkestrel/browser": "^0.0.36",
109
+ "@orkestrel/guide": "^0.0.34",
110
+ "@orkestrel/html": "^0.0.19",
111
+ "@orkestrel/probe": "^0.0.33",
112
+ "@orkestrel/test": "^0.0.45",
113
113
  "@types/node": "^24.19.2",
114
114
  "@vitest/browser-playwright": "^5.1.0",
115
115
  "oxfmt": "^0.79.0",
@@ -117,7 +117,7 @@ var package_default = {
117
117
  "playwright": "^1.64.1",
118
118
  "typescript": "^7.0.2",
119
119
  "vite": "^8.3.8",
120
- "vitest": "^5.1.0"
120
+ "vitest": "^5.1.1"
121
121
  },
122
122
  engines: { "node": ">=22.18.0" }
123
123
  };
@@ -515,6 +515,8 @@ var TARGET_SKILL_NAMES = Object.freeze([
515
515
  var SERVICE_SCRIPT_PATH = "scripts/service.sh";
516
516
  /** Names the shared Vitest global-setup module whose presence makes a workspace `global`. */
517
517
  var GLOBAL_SETUP_PATH = "tests/setupGlobal.ts";
518
+ /** Names the browser-isolation guard module whose presence makes a workspace `isolation`. */
519
+ var ISOLATION_SETUP_PATH = "tests/setupIsolation.ts";
518
520
  /** Names the package-owned guide-parity entry used by `test:guides` and to select the `guides` project. */
519
521
  var GUIDES_TEST_PATH = "tests/guides.test.ts";
520
522
  /** Names the generated packed-package proof every publishing workspace is planned at. */
@@ -902,9 +904,9 @@ var SHOWCASE_OVERRIDES = Object.freeze({ [`vite-plugin-singlefile@${SHOWCASE_DEV
902
904
  /** Lists the development dependencies a private server application adds. */
903
905
  var APP_SERVER_DEV_DEPENDENCIES = Object.freeze({
904
906
  "@orkestrel/emitter": package_default.dependencies["@orkestrel/emitter"],
905
- "@orkestrel/middleware": "^0.0.36",
906
- "@orkestrel/router": "^0.0.24",
907
- "@orkestrel/server": "^0.0.30"
907
+ "@orkestrel/middleware": "^0.0.37",
908
+ "@orkestrel/router": "^0.0.25",
909
+ "@orkestrel/server": "^0.0.31"
908
910
  });
909
911
  // src/core/templates.ts
910
912
  /**
@@ -1095,6 +1097,13 @@ function isNamedPlugin(plugin: PluginOption): plugin is { name: string } {
1095
1097
  {{projects}}
1096
1098
  },
1097
1099
  })
1100
+ `,
1101
+ isolation: `// A cross-origin isolated page reads SharedArrayBuffer.\n// srcBrowser and appBrowser, and the projects and servers that spread them, serve these headers.
1102
+ export const isolation = {
1103
+ 'Cross-Origin-Opener-Policy': 'same-origin',
1104
+ 'Cross-Origin-Embedder-Policy': 'require-corp',
1105
+ }
1106
+
1098
1107
  `
1099
1108
  }),
1100
1109
  factories: Object.freeze({
@@ -1199,7 +1208,7 @@ export function srcBrowser(override?: UserConfig): UserConfig {
1199
1208
  resolve,
1200
1209
  optimizeDeps,
1201
1210
  publicDir: false,
1202
- plugins: [outputBoundary('dist/src/browser'), environmentBoundary('src/browser'){{vuePlugin}}],
1211
+ {{headers}} plugins: [outputBoundary('dist/src/browser'), environmentBoundary('src/browser'){{vuePlugin}}],
1203
1212
  build: {
1204
1213
  emptyOutDir: true,
1205
1214
  sourcemap: true,
@@ -1219,7 +1228,7 @@ export function srcBrowser(override?: UserConfig): UserConfig {
1219
1228
  test: {
1220
1229
  name: { label: 'src:browser', color: 'yellow' },
1221
1230
  include: ['tests/src/browser/**/*.test.ts'],
1222
- {{exclude}} setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
1231
+ {{exclude}} setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'{{isolation}}],
1223
1232
  {{global}}
1224
1233
  browser: {
1225
1234
  enabled: true,
@@ -1342,7 +1351,7 @@ export function srcBin(override?: UserConfig): UserConfig {
1342
1351
  const project: UserConfig = {
1343
1352
  resolve,
1344
1353
  optimizeDeps,
1345
- plugins: [outputBoundary(output), environmentBoundary('app/browser'){{vuePlugin}}],
1354
+ {{headers}} plugins: [outputBoundary(output), environmentBoundary('app/browser'){{vuePlugin}}],
1346
1355
  root: resolveWorkspacePath('app/browser'),
1347
1356
  publicDir: false,
1348
1357
  build: {
@@ -1359,7 +1368,7 @@ export function srcBin(override?: UserConfig): UserConfig {
1359
1368
  root: resolveWorkspacePath('.'),
1360
1369
  dir: resolveWorkspacePath('.'),
1361
1370
  include: ['tests/app/browser/**/*.test.ts'],
1362
- {{journeyExclude}} setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
1371
+ {{journeyExclude}} setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'{{isolation}}],
1363
1372
  browser: {
1364
1373
  enabled: true,
1365
1374
  provider: playwright(browserOptions),
@@ -2856,6 +2865,12 @@ describe('global setup', () => {
2856
2865
  })
2857
2866
  `
2858
2867
  }),
2868
+ isolation: `if (!globalThis.crossOriginIsolated) {
2869
+ throw new Error(
2870
+ 'The tester page is not cross-origin isolated: src:browser and app:browser must serve Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp.',
2871
+ )
2872
+ }
2873
+ `,
2859
2874
  entry: `import * as entry from {{specifier}}
2860
2875
  import { describe, expect, it } from 'vitest'
2861
2876
 
@@ -5412,6 +5427,7 @@ var isBlueprint = (0, _orkestrel_contract.recordOf)({
5412
5427
  vendors: (0, _orkestrel_contract.andOf)(isCollection, (0, _orkestrel_contract.arrayOf)(_orkestrel_contract.isString)),
5413
5428
  studies: _orkestrel_contract.isBoolean,
5414
5429
  global: _orkestrel_contract.isBoolean,
5430
+ isolation: _orkestrel_contract.isBoolean,
5415
5431
  showcase: _orkestrel_contract.isBoolean,
5416
5432
  journey: _orkestrel_contract.isBoolean,
5417
5433
  base: _orkestrel_contract.isBoolean,
@@ -8207,6 +8223,9 @@ function blueprintToRootVite(blueprint) {
8207
8223
  const sheets = blueprintToSheets(blueprint);
8208
8224
  const styled = sheets.length > 0 || blueprint.themes;
8209
8225
  const global = blueprint.global ? " globalSetup: ['./tests/setupGlobal.ts'],\n" : "";
8226
+ const isolated = blueprint.isolation && (planned.has("src:browser") || planned.has("app:browser"));
8227
+ const headers = isolated ? " server: { headers: isolation },\n" : "";
8228
+ const guard = isolated ? ", './tests/setupIsolation.ts'" : "";
8210
8229
  const imports = [
8211
8230
  ...styled || machinery.showcase ? [`import { ${[...styled ? ["existsSync"] : [], ...machinery.showcase ? ["renameSync"] : []].join(", ")} } from 'node:fs'`] : [],
8212
8231
  ...machinery.browser ? ["import { playwright } from '@vitest/browser-playwright'"] : [],
@@ -8238,7 +8257,9 @@ function blueprintToRootVite(blueprint) {
8238
8257
  vuePlugin: machinery.frameworks.includes("vue") ? ", vue()" : "",
8239
8258
  output: core ? " output: { paths: { '@src/core': '../core/index.js' } }," : " output: {},",
8240
8259
  exclude: core ? " exclude: ['tests/src/core/**/*.test.ts'],\n" : "",
8241
- global
8260
+ global,
8261
+ headers,
8262
+ isolation: guard
8242
8263
  })) : [],
8243
8264
  ...planned.has("src:server") ? [blueprint.src.includes("core")].map((core) => (0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.factories.src.server, {
8244
8265
  external,
@@ -8261,6 +8282,8 @@ function blueprintToRootVite(blueprint) {
8261
8282
  ...planned.has("app:core") ? [CONFIG_TEMPLATES.factories.app.core] : [],
8262
8283
  ...planned.has("app:browser") ? [(0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.factories.app.browser, {
8263
8284
  vuePlugin: machinery.frameworks.includes("vue") ? ", vue()" : "",
8285
+ headers,
8286
+ isolation: guard,
8264
8287
  showcaseFactory: machinery.showcase ? CONFIG_TEMPLATES.factories.app.showcase : "",
8265
8288
  journeyFactory: journeyed ? CONFIG_TEMPLATES.factories.app.journey : "",
8266
8289
  journeyExclude: blueprint.journey && base ? " exclude: ['tests/app/browser/integration.test.ts'],\n" : ""
@@ -8339,7 +8362,7 @@ ${projects.map((project) => `\t\t\t${project},`).join("\n")}
8339
8362
  vitest: benches.length === 0 ? "" : "defaultExclude, ",
8340
8363
  helpers: helpers.length === 0 ? "" : matchesPrintWidth(helperImport.trimEnd()) ? helperImport : `import {\n${helpers.map((helper) => `\t${helper},`).join("\n")}\n} from './configs/helpers.js'\n`,
8341
8364
  browsers: machinery.browser ? "import { resolveBrowser, resolvePinnedBrowser } from './configs/browsers.js'\nimport { commands } from './configs/commands.js'\n" : "",
8342
- options: (machinery.browser ? "const browserOptions = resolveBrowser(resolvePinnedBrowser(), process.platform, process.env)\n// Vitest writes a page.screenshot() capture beside its test file unless a directory is named.\nconst screenshots = resolveWorkspacePath('tmp/captures/screenshots')\n\n" + blueprintToOptimizedDependencies(blueprint) : "") + ((blueprint.journey || blueprint.showcase) && (base || applicationFaces.length > 0) ? `const applications = {\n${base ? " browser: appBrowser,\n" : ""}${applicationFaces.map((extension) => `\t${extension.name}: app${extension.name[0]?.toUpperCase()}${extension.name.slice(1)},\n`).join("")}}\n\n` : ""),
8365
+ options: (machinery.browser ? "const browserOptions = resolveBrowser(resolvePinnedBrowser(), process.platform, process.env)\n// Vitest writes a page.screenshot() capture beside its test file unless a directory is named.\nconst screenshots = resolveWorkspacePath('tmp/captures/screenshots')\n\n" + blueprintToOptimizedDependencies(blueprint) + (isolated ? CONFIG_TEMPLATES.root.isolation : "") : "") + ((blueprint.journey || blueprint.showcase) && (base || applicationFaces.length > 0) ? `const applications = {\n${base ? " browser: appBrowser,\n" : ""}${applicationFaces.map((extension) => `\t${extension.name}: app${extension.name[0]?.toUpperCase()}${extension.name.slice(1)},\n`).join("")}}\n\n` : ""),
8343
8366
  factories: body,
8344
8367
  projects: projectRows
8345
8368
  });
@@ -8454,7 +8477,8 @@ ${paths.join("\n")}
8454
8477
  ...blueprint.app.includes("core") ? includeSuffixes.map((suffix) => `../../app/core/**/*.${suffix}`) : [],
8455
8478
  ...includeSuffixes.map((suffix) => `../../tests/app/browser/**/*.${suffix}`),
8456
8479
  "../../tests/setup.ts",
8457
- "../../tests/setupBrowser.ts"
8480
+ "../../tests/setupBrowser.ts",
8481
+ ...blueprint.isolation ? ["../../tests/setupIsolation.ts"] : []
8458
8482
  ].map((entry, index, entries) => `\t\t${JSON.stringify(entry)}${index === entries.length - 1 ? "" : ","}`).join("\n") }) : path === "configs/app/vite.server.config.ts" ? CONFIG_TEMPLATES.vites.app.server : path === "configs/app/tsconfig.server.json" ? (0, _orkestrel_template.fillTemplate)(CONFIG_TEMPLATES.tsconfigs.app.server, { include: [
8459
8483
  ...includeSuffixes.map((suffix) => `../../app/server/**/*.${suffix}`),
8460
8484
  ...blueprint.app.includes("core") ? includeSuffixes.map((suffix) => `../../app/core/**/*.${suffix}`) : [],
@@ -8486,7 +8510,8 @@ ${paths.join("\n")}
8486
8510
  ...FRAMEWORK_MATRIX[extension.name].suffixes
8487
8511
  ].map((suffix) => `../../tests/app/${extension.name}/**/*.${suffix}`),
8488
8512
  "../../tests/setup.ts",
8489
- "../../tests/setupBrowser.ts"
8513
+ "../../tests/setupBrowser.ts",
8514
+ ...blueprint.isolation ? ["../../tests/setupIsolation.ts"] : []
8490
8515
  ];
8491
8516
  const siblings = blueprint.src.filter((environment) => environment === "core" || environment === "browser").flatMap((environment) => ["ts", "js"].map((suffix) => {
8492
8517
  const key = `\t[resolveWorkspacePath('src/${environment}/index.${suffix}').replaceAll('\\\\', '/')]:`;
@@ -8783,6 +8808,13 @@ function blueprintToTestArtifacts(blueprint) {
8783
8808
  origin: "template",
8784
8809
  content: ARTIFACT_TEMPLATES.tests.setup
8785
8810
  }] : [];
8811
+ const isolations = blueprint.isolation ? [{
8812
+ path: ISOLATION_SETUP_PATH,
8813
+ group: "tests",
8814
+ ownership: "birth",
8815
+ origin: "template",
8816
+ content: ARTIFACT_TEMPLATES.tests.isolation
8817
+ }] : [];
8786
8818
  const globals = blueprint.global ? [{
8787
8819
  path: GLOBAL_SETUP_PATH,
8788
8820
  group: "tests",
@@ -8891,6 +8923,7 @@ function blueprintToTestArtifacts(blueprint) {
8891
8923
  ...servers,
8892
8924
  ...services,
8893
8925
  ...globals,
8926
+ ...isolations,
8894
8927
  ...journeys,
8895
8928
  ...sources,
8896
8929
  ...bins,
@@ -10035,6 +10068,11 @@ function blueprintToQuestions(blueprint) {
10035
10068
  message: "showcase projects a browser app, and this workspace declares none, so it emits nothing.",
10036
10069
  blocking: false
10037
10070
  }] : [],
10071
+ ...blueprint.isolation && !blueprint.src.includes("browser") && !blueprint.app.includes("browser") ? [{
10072
+ field: "isolation",
10073
+ message: "isolation serves the src:browser and app:browser projects, and this workspace declares neither, so it emits no headers.",
10074
+ blocking: false
10075
+ }] : [],
10038
10076
  ...blueprint.journey && (!blueprint.app.includes("browser") || !blueprint.base && blueprint.extensions.every((extension) => extension.surface !== "browser" || !extension.axes.includes("app"))) ? [{
10039
10077
  field: "journey",
10040
10078
  message: blueprint.app.includes("browser") ? "journey projects a browser application, and this workspace declares neither a base entry nor an app-side browser face, so it emits nothing." : "journey projects a browser app, and this workspace declares none, so it emits nothing.",
@@ -10243,6 +10281,7 @@ function createBlueprint(name, input) {
10243
10281
  vendors: input?.vendors ?? [],
10244
10282
  studies: input?.studies ?? false,
10245
10283
  global: input?.global ?? false,
10284
+ isolation: input?.isolation ?? false,
10246
10285
  showcase: input?.showcase ?? false,
10247
10286
  journey: input?.journey ?? false,
10248
10287
  base: input?.base ?? input?.app?.includes("browser") ?? false,
@@ -10598,6 +10637,7 @@ exports.HOST_INVENTORY_PATH = HOST_INVENTORY_PATH;
10598
10637
  exports.HOST_PATHS = HOST_PATHS;
10599
10638
  exports.INTEGRATION_TEST_PATH = INTEGRATION_TEST_PATH;
10600
10639
  exports.INVALID_PATH_CHARACTER_PATTERN = INVALID_PATH_CHARACTER_PATTERN;
10640
+ exports.ISOLATION_SETUP_PATH = ISOLATION_SETUP_PATH;
10601
10641
  exports.JOURNEY_CONFIG_PATH = JOURNEY_CONFIG_PATH;
10602
10642
  exports.MANIFEST_KEY_ORDER = MANIFEST_KEY_ORDER;
10603
10643
  exports.MANIFEST_PATH = MANIFEST_PATH;