@orkestrel/scaffold 0.0.12 → 0.0.14

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.
@@ -29,44 +29,47 @@ descriptions never enter agent instruction context.
29
29
 
30
30
  | Package | Version |
31
31
  | --------------------- | ------- |
32
- | @orkestrel/abort | 0.0.3 |
33
- | @orkestrel/agent | 0.0.8 |
34
- | @orkestrel/browser | 0.0.3 |
35
- | @orkestrel/budget | 0.0.3 |
36
- | @orkestrel/console | 0.0.3 |
37
- | @orkestrel/contract | 0.0.5 |
38
- | @orkestrel/csv | 0.0.1 |
39
- | @orkestrel/database | 0.0.5 |
40
- | @orkestrel/emitter | 0.0.3 |
41
- | @orkestrel/guide | 0.0.5 |
42
- | @orkestrel/indexeddb | 0.0.4 |
43
- | @orkestrel/interpret | 0.0.5 |
44
- | @orkestrel/markdown | 0.0.5 |
45
- | @orkestrel/mcp | 0.0.4 |
46
- | @orkestrel/middleware | 0.0.5 |
47
- | @orkestrel/msg | 0.0.4 |
48
- | @orkestrel/ndjson | 0.0.3 |
49
- | @orkestrel/ollama | 0.0.6 |
50
- | @orkestrel/pool | 0.0.3 |
51
- | @orkestrel/program | 0.0.3 |
52
- | @orkestrel/qualifier | 0.0.4 |
53
- | @orkestrel/queue | 0.0.3 |
54
- | @orkestrel/rater | 0.0.5 |
55
- | @orkestrel/reason | 0.0.3 |
56
- | @orkestrel/relation | 0.0.3 |
57
- | @orkestrel/router | 0.0.4 |
58
- | @orkestrel/scaffold | 0.0.1 |
59
- | @orkestrel/sea | 0.0.3 |
60
- | @orkestrel/server | 0.0.6 |
61
- | @orkestrel/sqlite | 0.0.4 |
62
- | @orkestrel/sse | 0.0.3 |
63
- | @orkestrel/template | 0.0.1 |
64
- | @orkestrel/terminal | 0.0.4 |
65
- | @orkestrel/timeout | 0.0.3 |
66
- | @orkestrel/tool | 0.0.3 |
67
- | @orkestrel/websocket | 0.0.3 |
68
- | @orkestrel/worker | 0.0.3 |
69
- | @orkestrel/workflow | 0.0.6 |
32
+ | @orkestrel/abort | 0.0.4 |
33
+ | @orkestrel/agent | 0.0.11 |
34
+ | @orkestrel/browser | 0.0.8 |
35
+ | @orkestrel/budget | 0.0.4 |
36
+ | @orkestrel/console | 0.0.4 |
37
+ | @orkestrel/contract | 0.0.9 |
38
+ | @orkestrel/csv | 0.0.2 |
39
+ | @orkestrel/database | 0.0.6 |
40
+ | @orkestrel/emitter | 0.0.5 |
41
+ | @orkestrel/guide | 0.0.8 |
42
+ | @orkestrel/html | 0.0.1 |
43
+ | @orkestrel/indexeddb | 0.0.6 |
44
+ | @orkestrel/interpret | 0.0.7 |
45
+ | @orkestrel/markdown | 0.0.7 |
46
+ | @orkestrel/mcp | 0.0.7 |
47
+ | @orkestrel/middleware | 0.0.6 |
48
+ | @orkestrel/msg | 0.0.5 |
49
+ | @orkestrel/ndjson | 0.0.5 |
50
+ | @orkestrel/ollama | 0.0.7 |
51
+ | @orkestrel/pool | 0.0.4 |
52
+ | @orkestrel/program | 0.0.6 |
53
+ | @orkestrel/qualifier | 0.0.7 |
54
+ | @orkestrel/queue | 0.0.4 |
55
+ | @orkestrel/rater | 0.0.8 |
56
+ | @orkestrel/reason | 0.0.4 |
57
+ | @orkestrel/relation | 0.0.6 |
58
+ | @orkestrel/router | 0.0.6 |
59
+ | @orkestrel/scaffold | 0.0.13 |
60
+ | @orkestrel/sea | 0.0.4 |
61
+ | @orkestrel/server | 0.0.7 |
62
+ | @orkestrel/sqlite | 0.0.6 |
63
+ | @orkestrel/sse | 0.0.4 |
64
+ | @orkestrel/template | 0.0.2 |
65
+ | @orkestrel/terminal | 0.0.5 |
66
+ | @orkestrel/timeout | 0.0.4 |
67
+ | @orkestrel/tool | 0.0.7 |
68
+ | @orkestrel/toolbox | 0.0.1 |
69
+ | @orkestrel/websocket | 0.0.7 |
70
+ | @orkestrel/worker | 0.0.4 |
71
+ | @orkestrel/workflow | 0.0.7 |
72
+ | @orkestrel/workspace | 0.0.1 |
70
73
 
71
74
  <!-- catalog:end -->
72
75
 
@@ -1098,7 +1098,7 @@ along the three `ViteMachinery` axes:
1098
1098
  | Machinery | Emitted when |
1099
1099
  | ----------------------------------------------------------------- | ------------------------------------ |
1100
1100
  | CSS pipeline (`ENVIRONMENT_CSS`, `preprocessCSS`, `isCSSRequest`) | a `src` or `app` browser environment |
1101
- | Playwright provider and `hasChromium` | a `src` or `app` browser environment |
1101
+ | Playwright provider and `resolveChromium` | a `src` or `app` browser environment |
1102
1102
  | Vue plugin, HTML boundary, browser development server | an `app` browser environment |
1103
1103
  | Output containment (`outputBoundary`, `enforceOutputPath`) | anything the workspace builds |
1104
1104
 
@@ -227,7 +227,7 @@ var DEFAULT_VERSION = "0.0.1";
227
227
  /** The `engines.node` range the `blueprint` builder fills. */
228
228
  var DEFAULT_ENGINES = `>=${MINIMUM_NODE_VERSION}`;
229
229
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
230
- var SCAFFOLD_RANGE = "^0.0.12";
230
+ var SCAFFOLD_RANGE = "^0.0.14";
231
231
  /** Tooling versions shared by scaffold and every generated workspace. */
232
232
  var BASE_DEV_DEPENDENCIES = Object.freeze({
233
233
  "@microsoft/api-extractor": "^7.58.12",
@@ -5876,7 +5876,7 @@ ${renderedProjects}
5876
5876
  ${fitsPrintWidth(inlineRegistrations) ? inlineRegistrations : ` [
5877
5877
  ${renderedRegistrations.map((registration) => ` ${registration},`).join("\n")}
5878
5878
  ],`}
5879
- hasChromium,
5879
+ chromiumPath !== undefined,
5880
5880
  process.argv,
5881
5881
  ),`;
5882
5882
  }
@@ -7253,11 +7253,66 @@ import {
7253
7253
  fstatSync,
7254
7254
  lstatSync,
7255
7255
  openSync,
7256
- readSync,
7256
+ ${needsBrowser ? " readdirSync,\n" : ""} readSync,
7257
7257
  realpathSync,
7258
- } from 'node:fs'
7259
- import { dirname, isAbsolute, relative, resolve as resolvePath, sep } from 'node:path'
7260
- ${playwrightImports}${vueImports}${needsBrowser ? `\n${CONST_KEYWORD} hasChromium = existsSync(chromium.executablePath())\n` : ""}
7258
+ ${needsBrowser ? " statSync,\n" : ""}} from 'node:fs'
7259
+ import { ${needsBrowser ? "basename, " : ""}dirname, isAbsolute, relative, resolve as resolvePath, sep } from 'node:path'
7260
+ ${playwrightImports}${vueImports}${needsBrowser ? `\n/** Chromium executable layouts inside a \`chromium-<revision>\` browsers-directory entry, per platform. */
7261
+ ${EXPORT_KEYWORD} ${CONST_KEYWORD} CHROMIUM_LAYOUTS = Object.freeze([
7262
+ 'chrome-linux/chrome',
7263
+ 'chrome-linux64/chrome',
7264
+ 'chrome-win/chrome.exe',
7265
+ 'chrome-win64/chrome.exe',
7266
+ 'chrome-mac/Chromium.app/Contents/MacOS/Chromium',
7267
+ 'chrome-mac-arm64/Chromium.app/Contents/MacOS/Chromium',
7268
+ ])
7269
+
7270
+ /**
7271
+ * Resolve a launchable Chromium executable: the pinned revision when installed,
7272
+ * otherwise a \`chromium\` / \`chromium.exe\` alias or any other \`chromium-*\`
7273
+ * revision under the same Playwright browsers directory. A pinned-revision miss
7274
+ * is not Chromium absence — managed containers ship one usable build (often
7275
+ * behind a revision-agnostic alias) for many Playwright versions.
7276
+ */
7277
+ ${EXPORT_KEYWORD} function resolveChromium(pinned: string): string | undefined {
7278
+ if (existsSync(pinned)) return pinned
7279
+ let revisionRoot = dirname(pinned)
7280
+ for (;;) {
7281
+ if (/^chromium-\\d+$/.test(basename(revisionRoot))) break
7282
+ const parent = dirname(revisionRoot)
7283
+ if (parent === revisionRoot) return undefined
7284
+ revisionRoot = parent
7285
+ }
7286
+ const browsersRoot = dirname(revisionRoot)
7287
+ for (const alias of ['chromium', 'chromium.exe']) {
7288
+ const candidate = resolvePath(browsersRoot, alias)
7289
+ if (existsSync(candidate) && statSync(candidate).isFile()) return candidate
7290
+ }
7291
+ let entries: readonly string[]
7292
+ try {
7293
+ entries = readdirSync(browsersRoot)
7294
+ } catch {
7295
+ return undefined
7296
+ }
7297
+ const revisions = entries
7298
+ .filter((entry) => /^chromium-\\d+$/.test(entry))
7299
+ .sort((a, b) => Number(b.slice('chromium-'.length)) - Number(a.slice('chromium-'.length)))
7300
+ for (const revision of revisions) {
7301
+ for (const layout of CHROMIUM_LAYOUTS) {
7302
+ const candidate = resolvePath(browsersRoot, revision, layout)
7303
+ if (existsSync(candidate)) return candidate
7304
+ }
7305
+ }
7306
+ return undefined
7307
+ }
7308
+
7309
+ ${CONST_KEYWORD} chromiumPinned = chromium.executablePath()
7310
+ ${CONST_KEYWORD} chromiumPath = resolveChromium(chromiumPinned)
7311
+ ${CONST_KEYWORD} chromiumOptions =
7312
+ chromiumPath === undefined || chromiumPath === chromiumPinned
7313
+ ? {}
7314
+ : { launchOptions: { executablePath: chromiumPath } }
7315
+ ` : ""}
7261
7316
  ${EXPORT_KEYWORD} function resolveWorkspacePath(relativePath: string): string {
7262
7317
  return fileURLToPath(new URL(relativePath, import.meta.url))
7263
7318
  }
@@ -7597,7 +7652,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7597
7652
  }),
7598
7653
  browser: {
7599
7654
  enabled: true,
7600
- provider: playwright(),
7655
+ provider: playwright(chromiumOptions),
7601
7656
  instances: [{ browser: 'chromium', headless: true }],
7602
7657
  },
7603
7658
  fileParallelism: false,
@@ -7730,7 +7785,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7730
7785
  }),
7731
7786
  browser: {
7732
7787
  enabled: true,
7733
- provider: playwright(),
7788
+ provider: playwright(chromiumOptions),
7734
7789
  instances: [{ browser: 'chromium', headless: true }],
7735
7790
  },
7736
7791
  fileParallelism: false,
@@ -7896,7 +7951,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
7896
7951
  }),
7897
7952
  browser: {
7898
7953
  enabled: true,
7899
- provider: playwright(),
7954
+ provider: playwright(chromiumOptions),
7900
7955
  instances: [{ browser: 'chromium', headless: true }],
7901
7956
  },
7902
7957
  fileParallelism: false,
@@ -8025,7 +8080,7 @@ ${EXPORT_KEYWORD} function appBrowser(...config: readonly never[]): UserConfig {
8025
8080
  },
8026
8081
  browser: {
8027
8082
  enabled: true,
8028
- provider: playwright(),
8083
+ provider: playwright(chromiumOptions),
8029
8084
  instances: [{ browser: 'chromium', headless: true }],
8030
8085
  },
8031
8086
  fileParallelism: false,
@@ -8598,8 +8653,8 @@ ${EXPORT_KEYWORD} ${FUNCTION_KEYWORD} exportsFor(specifier: string): readonly st
8598
8653
  function testArtifacts(spec, pascal) {
8599
8654
  const hasBrowser = spec.src.includes("browser") || spec.app.includes("browser");
8600
8655
  const hasVue = spec.app.includes("browser");
8601
- const browserPolicySpecifier = hasBrowser ? ", existsSync" : "";
8602
- const browserPolicyImport = hasBrowser ? "import { chromium } from 'playwright'" : "";
8656
+ const browserPolicySpecifier = hasBrowser ? ", accessSync, constants as FS_CONSTANTS, statSync" : "";
8657
+ const browserPolicyImport = hasBrowser ? "import { chromium } from 'playwright'\nimport { resolveChromium } from '../vite.config.js'" : "";
8603
8658
  const vuePolicyImport = hasVue ? "import { parse as parseVue } from 'vue/compiler-sfc'" : "";
8604
8659
  const workspacePolicyAssertion = hasVue ? `expect(
8605
8660
  inspectCodingWorkspace(process.cwd(), (path, content) => {
@@ -8611,12 +8666,13 @@ function testArtifacts(spec, pascal) {
8611
8666
  }),
8612
8667
  ).toEqual([])` : "expect(inspectCodingWorkspace(process.cwd())).toEqual([])";
8613
8668
  const browserPolicyTest = hasBrowser ? `
8614
- it.skipIf(!existsSync(chromium.executablePath()))(
8615
- 'runs browser suites only when the real Chromium executable is installed',
8616
- () => {
8617
- expect(existsSync(chromium.executablePath())).toBe(true)
8618
- },
8619
- )` : "";
8669
+ it('resolves Chromium only to a real executable file', () => {
8670
+ const chromiumPath = resolveChromium(chromium.executablePath())
8671
+ if (chromiumPath === undefined) return
8672
+
8673
+ expect(statSync(chromiumPath).isFile()).toBe(true)
8674
+ expect(() => accessSync(chromiumPath, FS_CONSTANTS.X_OK)).not.toThrow()
8675
+ })` : "";
8620
8676
  const artifacts = [fillArtifact("tests/setup.ts", "tests", "setup", {}), fillArtifact("tests/policy.test.ts", "tests", "policyTest", {
8621
8677
  browserPolicySpecifier,
8622
8678
  browserPolicyImport,