@orkestrel/scaffold 0.0.105 → 0.0.106
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/bin/main.js +6 -6
- package/dist/bin/main.js.map +1 -1
- package/dist/host/claude/agents/orkestrel.md +1 -1
- package/dist/host/guides/agent.md +68 -59
- package/dist/host/guides/scaffold.md +38 -38
- package/dist/host/manifest.json +4 -4
- package/dist/src/core/index.cjs +10 -10
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +6 -6
- package/dist/src/core/index.d.ts +6 -6
- package/dist/src/core/index.js +10 -10
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +7 -7
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +10 -10
- package/dist/src/server/index.d.ts +10 -10
- package/dist/src/server/index.js +7 -7
- package/dist/src/server/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -138,7 +138,7 @@ export declare const ARTIFACT_TEMPLATES: Readonly<{
|
|
|
138
138
|
types: "import type { PlaywrightProviderOptions } from '@vitest/browser-playwright'\nimport type { Browser } from 'playwright'\n";
|
|
139
139
|
launcher: "import { chromium } from 'playwright'\nimport { build } from 'vite'\nimport { resolveBrowser, resolvePinnedBrowser } from '../configs/browsers.js'\n";
|
|
140
140
|
import: "checkDistributionBrowser,\n\t";
|
|
141
|
-
helpers: "/** Defines the page that loads a bundled browser consumer. */\nexport const DISTRIBUTION_BROWSER_PAGE = `<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"UTF-8\" />\n\t\t<title>Distribution</title>\n\t</head>\n\t<body>\n\t\t<script type=\"module\" src=\"./main.js\"></script>\n\t</body>\n</html>\n`\n\n/**\n * Infers the response media type from a bundle filename.\n *\n * @param path - The requested bundle path.\n * @returns The media type, defaulting to application/octet-stream.\n */\nexport function inferDistributionContentType(path: string): string {\n\tif (path.endsWith('.html')) return 'text/html'\n\tif (path.endsWith('.js')) return 'text/javascript'\n\tif (path.endsWith('.css')) return 'text/css'\n\tif (path.endsWith('.json') || path.endsWith('.map')) return 'application/json'\n\treturn 'application/octet-stream'\n}\n\n// `resolveBrowser` answers with provider options and never reports absence: its\n// last resort is a channel nothing verified. So the launch is attempted and its\n// rejection classified, rather than probed for and ruled on.\n/**\n * Renders the browser endpoint selected by provider options.\n *\n * @param options - The browser provider options.\n * @returns The endpoint, executable, channel, or bundled-browser description.\n */\nexport function renderDistributionBrowser(options: PlaywrightProviderOptions): string {\n\tconst endpoint = options.connectOptions?.wsEndpoint\n\tif (endpoint !== undefined) return `the browser server at ${endpoint}`\n\tconst executable = options.launchOptions?.executablePath\n\tif (executable !== undefined) return `the executable at ${executable}`\n\tconst channel = options.launchOptions?.channel\n\tif (channel !== undefined) return `the ${channel} channel`\n\treturn 'the Chromium Playwright installed for itself'\n}\n\n/**\n * Launches or connects to the selected Chromium browser.\n *\n * @param options - The browser provider options.\n * @returns The real browser. Rejects when the selected browser is unavailable.\n */\nexport async function launchDistributionBrowser(\n\toptions: PlaywrightProviderOptions,\n): Promise<Browser> {\n\tconst endpoint = options.connectOptions?.wsEndpoint\n\tif (endpoint !== undefined) return chromium.connect(endpoint)\n\treturn chromium.launch({ ...options.launchOptions, headless: true })\n}\n\n// A consumer of one installed browser entry, bundled by the Vite toolchain this\n// workspace already declares. Nothing is stubbed: the bundle resolves the installed\n// package and its whole transitive graph as an application consuming it would.\n/**\n * Bundles a browser consumer against an installed public entry.\n *\n * @param stage - The installed consumer.\n * @param entry - The browser publication.\n * @returns The bundle directory. Rejects when Vite cannot build the consumer.\n */\nexport async function bundleDistributionEntry(\n\tstage: DistributionStage,\n\tentry: DistributionEntry,\n): Promise<string> {\n\tconst page = join(stage.consumer, 'pages', entry.subpath.replaceAll(/[^\\w]+/gu, '-'))\n\tconst specifier = JSON.stringify(entry.specifier)\n\twriteDistributionFile(join(page, 'index.html'), DISTRIBUTION_BROWSER_PAGE)\n\twriteDistributionFile(\n\t\tjoin(page, 'main.js'),\n\t\t`import * as entry from ${specifier}\\nglobalThis.subject = Object.keys(entry).sort()\\n`,\n\t)\n\tawait build({\n\t\tbase: './',\n\t\tbuild: { emptyOutDir: true, outDir: 'bundle' },\n\t\tconfigFile: false,\n\t\tlogLevel: 'error',\n\t\troot: page,\n\t})\n\treturn join(page, 'bundle')\n}\n\n// The key set the bundled module publishes in a real browser, read off the page\n//
|
|
141
|
+
helpers: "/** Defines the page that loads a bundled browser consumer. */\nexport const DISTRIBUTION_BROWSER_PAGE = `<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"UTF-8\" />\n\t\t<title>Distribution</title>\n\t</head>\n\t<body>\n\t\t<script type=\"module\" src=\"./main.js\"></script>\n\t</body>\n</html>\n`\n\n/**\n * Infers the response media type from a bundle filename.\n *\n * @param path - The requested bundle path.\n * @returns The media type, defaulting to application/octet-stream.\n */\nexport function inferDistributionContentType(path: string): string {\n\tif (path.endsWith('.html')) return 'text/html'\n\tif (path.endsWith('.js')) return 'text/javascript'\n\tif (path.endsWith('.css')) return 'text/css'\n\tif (path.endsWith('.json') || path.endsWith('.map')) return 'application/json'\n\treturn 'application/octet-stream'\n}\n\n// `resolveBrowser` answers with provider options and never reports absence: its\n// last resort is a channel nothing verified. So the launch is attempted and its\n// rejection classified, rather than probed for and ruled on.\n/**\n * Renders the browser endpoint selected by provider options.\n *\n * @param options - The browser provider options.\n * @returns The endpoint, executable, channel, or bundled-browser description.\n */\nexport function renderDistributionBrowser(options: PlaywrightProviderOptions): string {\n\tconst endpoint = options.connectOptions?.wsEndpoint\n\tif (endpoint !== undefined) return `the browser server at ${endpoint}`\n\tconst executable = options.launchOptions?.executablePath\n\tif (executable !== undefined) return `the executable at ${executable}`\n\tconst channel = options.launchOptions?.channel\n\tif (channel !== undefined) return `the ${channel} channel`\n\treturn 'the Chromium Playwright installed for itself'\n}\n\n/**\n * Launches or connects to the selected Chromium browser.\n *\n * @param options - The browser provider options.\n * @returns The real browser. Rejects when the selected browser is unavailable.\n */\nexport async function launchDistributionBrowser(\n\toptions: PlaywrightProviderOptions,\n): Promise<Browser> {\n\tconst endpoint = options.connectOptions?.wsEndpoint\n\tif (endpoint !== undefined) return chromium.connect(endpoint)\n\treturn chromium.launch({ ...options.launchOptions, headless: true })\n}\n\n// A consumer of one installed browser entry, bundled by the Vite toolchain this\n// workspace already declares. Nothing is stubbed: the bundle resolves the installed\n// package and its whole transitive graph as an application consuming it would.\n/**\n * Bundles a browser consumer against an installed public entry.\n *\n * @param stage - The installed consumer.\n * @param entry - The browser publication.\n * @returns The bundle directory. Rejects when Vite cannot build the consumer.\n */\nexport async function bundleDistributionEntry(\n\tstage: DistributionStage,\n\tentry: DistributionEntry,\n): Promise<string> {\n\tconst page = join(stage.consumer, 'pages', entry.subpath.replaceAll(/[^\\w]+/gu, '-'))\n\tconst specifier = JSON.stringify(entry.specifier)\n\twriteDistributionFile(join(page, 'index.html'), DISTRIBUTION_BROWSER_PAGE)\n\twriteDistributionFile(\n\t\tjoin(page, 'main.js'),\n\t\t`import * as entry from ${specifier}\\nglobalThis.subject = Object.keys(entry).sort()\\n`,\n\t)\n\tawait build({\n\t\tbase: './',\n\t\tbuild: { emptyOutDir: true, outDir: 'bundle' },\n\t\tconfigFile: false,\n\t\tlogLevel: 'error',\n\t\troot: page,\n\t})\n\treturn join(page, 'bundle')\n}\n\n// The key set the bundled module publishes in a real browser, read off the page\n// after it has loaded over a loopback server. A module that never evaluated\n// publishes nothing, and a page error is raised rather than compared away.\n/**\n * Reads the names a real browser publishes from a served bundle.\n *\n * @param browser - The browser to drive.\n * @param bundle - The built consumer directory.\n * @returns The exported names. Rejects on a page error or an invalid name list.\n */\nexport async function readDistributionBrowserExports(\n\tbrowser: Browser,\n\tbundle: string,\n): Promise<readonly string[]> {\n\tconst server = createServer((request, response) => {\n\t\tconst asked = request.url === undefined || request.url === '/' ? '/index.html' : request.url\n\t\tconst path = join(bundle, decodeURIComponent(asked))\n\t\tif (!path.startsWith(bundle) || !existsSync(path)) {\n\t\t\tresponse.writeHead(404)\n\t\t\tresponse.end()\n\t\t\treturn\n\t\t}\n\t\tresponse.writeHead(200, { 'content-type': inferDistributionContentType(path) })\n\t\tresponse.end(readFileSync(path))\n\t})\n\ttry {\n\t\tawait new Promise<void>((settle) => {\n\t\t\tserver.listen(0, '127.0.0.1', settle)\n\t\t})\n\t\tconst address = server.address()\n\t\tif (address === null || typeof address === 'string') {\n\t\t\tthrow new Error('The bundle server bound no port')\n\t\t}\n\t\tconst page = await browser.newPage()\n\t\tconst failures: string[] = []\n\t\tpage.on('pageerror', (error) => failures.push(String(error)))\n\t\tawait page.goto(`http://127.0.0.1:${String(address.port)}/`, { waitUntil: 'load' })\n\t\tconst published: unknown = await page.evaluate('globalThis.subject')\n\t\tif (failures.length > 0) throw new Error(`The bundle raised ${failures.join(' | ')}`)\n\t\tif (!isDistributionNames(published))\n\t\t\tthrow new Error('The bundled module published no name list')\n\t\treturn published\n\t} finally {\n\t\tserver.close()\n\t}\n}\n/**\n * Checks each browser publication against its installed declarations in a real browser.\n * @param stage - The installed consumer to drive.\n * @param context - The proof context that reports unavailable browser prerequisites.\n * @returns The compiler diagnostics each browser publication reports.\n */\nexport async function checkDistributionBrowser(\n\tstage: DistributionStage,\n\tcontext: TestContext,\n): Promise<readonly string[]> {\n\tconst driver = DISTRIBUTION_BROWSER_RESOLUTION\n\tif (driver === undefined) throw new Error(\"DISTRIBUTION_RESOLUTIONS carries no 'bundler' row\")\n\tconst entries = stage.entries.filter((entry) => entry.browsable)\n\tif (entries.length === 0) return context.skip('No installed entry supports a browser')\n\tconst readings: Array<readonly string[]> = []\n\tfor (const entry of entries) {\n\t\tif (!entry.declaration.browsable) {\n\t\t\tthrow new Error(`${entry.subpath} publishes no browser declaration`)\n\t\t}\n\t\tconst options = resolveBrowser(resolvePinnedBrowser(), process.platform, process.env)\n\t\tconst browser = await launchDistributionBrowser(options).catch((error: unknown) => {\n\t\t\tconst cause = `${renderDistributionBrowser(options)} was rejected: ${String(error)}`\n\t\t\tif (DISTRIBUTION_RELEASE) throw new Error(`The release gate requires a browser, and ${cause}`)\n\t\t\treturn context.skip(`No browser launched. ${cause}`)\n\t\t})\n\t\ttry {\n\t\t\tconst bundle = await bundleDistributionEntry(stage, entry)\n\t\t\tconst published = await readDistributionBrowserExports(browser, bundle)\n\t\t\t// A browser consumer reads the installed declarations through a bundler, so\n\t\t\t// that is the one driver this face answers under.\n\t\t\tconst reported = checkDistributionSurface(stage, {\n\t\t\t\tentry,\n\t\t\t\textension: 'ts',\n\t\t\t\tpublished,\n\t\t\t\tdriver,\n\t\t\t})\n\t\t\treadings.push(reported)\n\t\t} finally {\n\t\t\tawait browser.close()\n\t\t}\n\t}\n\treturn readings.flat()\n}\n";
|
|
142
142
|
drive: "\tit('publishes what it declares to a real browser [requires a browser]', async (context) => {\n\t\texpect(await checkDistributionBrowser(DISTRIBUTION_SUITE.read(context), context)).toStrictEqual(\n\t\t\t[],\n\t\t)\n\t})\n";
|
|
143
143
|
guard: "\tit('publishes no browser face this proof cannot drive [requires the registry]', (context) => {\n\t\tconst faces = DISTRIBUTION_SUITE.read(context).entries.filter((entry) => entry.browsable)\n\t\texpect(faces.map((entry) => entry.subpath)).toStrictEqual([])\n\t})\n";
|
|
144
144
|
}>;
|
|
@@ -2851,7 +2851,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
2851
2851
|
*
|
|
2852
2852
|
* @remarks
|
|
2853
2853
|
* `text` is the brace character or the quoted string with its quotes, `index` is
|
|
2854
|
-
* where it starts in the scanned text, and `depth` counts the objects open
|
|
2854
|
+
* where it starts in the scanned text, and `depth` counts the objects open after
|
|
2855
2855
|
* it is read, braces alone. `value` is set only for a string that a colon
|
|
2856
2856
|
* follows, and is the offset of the first character after that colon and the
|
|
2857
2857
|
* whitespace beside it, so the character at `value` begins the string's value.
|
|
@@ -2955,7 +2955,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
2955
2955
|
*
|
|
2956
2956
|
* @remarks
|
|
2957
2957
|
* The one home of the orchestration membership rule. A vendored path and a
|
|
2958
|
-
* foreign path found in a target are both classified through here, so
|
|
2958
|
+
* foreign path found in a target are both classified through here, so an added
|
|
2959
2959
|
* harness directory is admitted once in `ORCHESTRATION_PATH_PREFIXES` and every
|
|
2960
2960
|
* caller follows.
|
|
2961
2961
|
*
|
|
@@ -2997,7 +2997,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
2997
2997
|
* Tests whether a declared range already admits a published version.
|
|
2998
2998
|
*
|
|
2999
2999
|
* @param range - The declared dependency range.
|
|
3000
|
-
* @param latest - The version the registry
|
|
3000
|
+
* @param latest - The version the registry's `latest` tag reports.
|
|
3001
3001
|
* @returns True if the range admits that version; false otherwise.
|
|
3002
3002
|
*
|
|
3003
3003
|
* @remarks
|
|
@@ -3177,7 +3177,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
3177
3177
|
* beneath one of these prefixes is `orchestration`, and everything else that is
|
|
3178
3178
|
* not source, tests, guides, docs, or a manifest is `configs`. A vendored path
|
|
3179
3179
|
* and a foreign path found in a target are classified against the same list, so
|
|
3180
|
-
*
|
|
3180
|
+
* an added harness directory is admitted once.
|
|
3181
3181
|
*/
|
|
3182
3182
|
export declare const ORCHESTRATION_PATH_PREFIXES: readonly string[];
|
|
3183
3183
|
|
|
@@ -3522,7 +3522,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
3522
3522
|
* `range` is the declared range, and `latest` is the version the producer
|
|
3523
3523
|
* selected. A found lookup carries that selected version; one that produced no
|
|
3524
3524
|
* answer carries the cause and no selected version. `major`, when present, is
|
|
3525
|
-
* the stable major named by the registry's latest tag in the same answer.
|
|
3525
|
+
* the stable major named by the registry's `latest` tag in the same answer.
|
|
3526
3526
|
*/
|
|
3527
3527
|
export declare type Release = {
|
|
3528
3528
|
readonly name: string;
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -138,7 +138,7 @@ export declare const ARTIFACT_TEMPLATES: Readonly<{
|
|
|
138
138
|
types: "import type { PlaywrightProviderOptions } from '@vitest/browser-playwright'\nimport type { Browser } from 'playwright'\n";
|
|
139
139
|
launcher: "import { chromium } from 'playwright'\nimport { build } from 'vite'\nimport { resolveBrowser, resolvePinnedBrowser } from '../configs/browsers.js'\n";
|
|
140
140
|
import: "checkDistributionBrowser,\n\t";
|
|
141
|
-
helpers: "/** Defines the page that loads a bundled browser consumer. */\nexport const DISTRIBUTION_BROWSER_PAGE = `<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"UTF-8\" />\n\t\t<title>Distribution</title>\n\t</head>\n\t<body>\n\t\t<script type=\"module\" src=\"./main.js\"></script>\n\t</body>\n</html>\n`\n\n/**\n * Infers the response media type from a bundle filename.\n *\n * @param path - The requested bundle path.\n * @returns The media type, defaulting to application/octet-stream.\n */\nexport function inferDistributionContentType(path: string): string {\n\tif (path.endsWith('.html')) return 'text/html'\n\tif (path.endsWith('.js')) return 'text/javascript'\n\tif (path.endsWith('.css')) return 'text/css'\n\tif (path.endsWith('.json') || path.endsWith('.map')) return 'application/json'\n\treturn 'application/octet-stream'\n}\n\n// `resolveBrowser` answers with provider options and never reports absence: its\n// last resort is a channel nothing verified. So the launch is attempted and its\n// rejection classified, rather than probed for and ruled on.\n/**\n * Renders the browser endpoint selected by provider options.\n *\n * @param options - The browser provider options.\n * @returns The endpoint, executable, channel, or bundled-browser description.\n */\nexport function renderDistributionBrowser(options: PlaywrightProviderOptions): string {\n\tconst endpoint = options.connectOptions?.wsEndpoint\n\tif (endpoint !== undefined) return `the browser server at ${endpoint}`\n\tconst executable = options.launchOptions?.executablePath\n\tif (executable !== undefined) return `the executable at ${executable}`\n\tconst channel = options.launchOptions?.channel\n\tif (channel !== undefined) return `the ${channel} channel`\n\treturn 'the Chromium Playwright installed for itself'\n}\n\n/**\n * Launches or connects to the selected Chromium browser.\n *\n * @param options - The browser provider options.\n * @returns The real browser. Rejects when the selected browser is unavailable.\n */\nexport async function launchDistributionBrowser(\n\toptions: PlaywrightProviderOptions,\n): Promise<Browser> {\n\tconst endpoint = options.connectOptions?.wsEndpoint\n\tif (endpoint !== undefined) return chromium.connect(endpoint)\n\treturn chromium.launch({ ...options.launchOptions, headless: true })\n}\n\n// A consumer of one installed browser entry, bundled by the Vite toolchain this\n// workspace already declares. Nothing is stubbed: the bundle resolves the installed\n// package and its whole transitive graph as an application consuming it would.\n/**\n * Bundles a browser consumer against an installed public entry.\n *\n * @param stage - The installed consumer.\n * @param entry - The browser publication.\n * @returns The bundle directory. Rejects when Vite cannot build the consumer.\n */\nexport async function bundleDistributionEntry(\n\tstage: DistributionStage,\n\tentry: DistributionEntry,\n): Promise<string> {\n\tconst page = join(stage.consumer, 'pages', entry.subpath.replaceAll(/[^\\w]+/gu, '-'))\n\tconst specifier = JSON.stringify(entry.specifier)\n\twriteDistributionFile(join(page, 'index.html'), DISTRIBUTION_BROWSER_PAGE)\n\twriteDistributionFile(\n\t\tjoin(page, 'main.js'),\n\t\t`import * as entry from ${specifier}\\nglobalThis.subject = Object.keys(entry).sort()\\n`,\n\t)\n\tawait build({\n\t\tbase: './',\n\t\tbuild: { emptyOutDir: true, outDir: 'bundle' },\n\t\tconfigFile: false,\n\t\tlogLevel: 'error',\n\t\troot: page,\n\t})\n\treturn join(page, 'bundle')\n}\n\n// The key set the bundled module publishes in a real browser, read off the page\n//
|
|
141
|
+
helpers: "/** Defines the page that loads a bundled browser consumer. */\nexport const DISTRIBUTION_BROWSER_PAGE = `<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"UTF-8\" />\n\t\t<title>Distribution</title>\n\t</head>\n\t<body>\n\t\t<script type=\"module\" src=\"./main.js\"></script>\n\t</body>\n</html>\n`\n\n/**\n * Infers the response media type from a bundle filename.\n *\n * @param path - The requested bundle path.\n * @returns The media type, defaulting to application/octet-stream.\n */\nexport function inferDistributionContentType(path: string): string {\n\tif (path.endsWith('.html')) return 'text/html'\n\tif (path.endsWith('.js')) return 'text/javascript'\n\tif (path.endsWith('.css')) return 'text/css'\n\tif (path.endsWith('.json') || path.endsWith('.map')) return 'application/json'\n\treturn 'application/octet-stream'\n}\n\n// `resolveBrowser` answers with provider options and never reports absence: its\n// last resort is a channel nothing verified. So the launch is attempted and its\n// rejection classified, rather than probed for and ruled on.\n/**\n * Renders the browser endpoint selected by provider options.\n *\n * @param options - The browser provider options.\n * @returns The endpoint, executable, channel, or bundled-browser description.\n */\nexport function renderDistributionBrowser(options: PlaywrightProviderOptions): string {\n\tconst endpoint = options.connectOptions?.wsEndpoint\n\tif (endpoint !== undefined) return `the browser server at ${endpoint}`\n\tconst executable = options.launchOptions?.executablePath\n\tif (executable !== undefined) return `the executable at ${executable}`\n\tconst channel = options.launchOptions?.channel\n\tif (channel !== undefined) return `the ${channel} channel`\n\treturn 'the Chromium Playwright installed for itself'\n}\n\n/**\n * Launches or connects to the selected Chromium browser.\n *\n * @param options - The browser provider options.\n * @returns The real browser. Rejects when the selected browser is unavailable.\n */\nexport async function launchDistributionBrowser(\n\toptions: PlaywrightProviderOptions,\n): Promise<Browser> {\n\tconst endpoint = options.connectOptions?.wsEndpoint\n\tif (endpoint !== undefined) return chromium.connect(endpoint)\n\treturn chromium.launch({ ...options.launchOptions, headless: true })\n}\n\n// A consumer of one installed browser entry, bundled by the Vite toolchain this\n// workspace already declares. Nothing is stubbed: the bundle resolves the installed\n// package and its whole transitive graph as an application consuming it would.\n/**\n * Bundles a browser consumer against an installed public entry.\n *\n * @param stage - The installed consumer.\n * @param entry - The browser publication.\n * @returns The bundle directory. Rejects when Vite cannot build the consumer.\n */\nexport async function bundleDistributionEntry(\n\tstage: DistributionStage,\n\tentry: DistributionEntry,\n): Promise<string> {\n\tconst page = join(stage.consumer, 'pages', entry.subpath.replaceAll(/[^\\w]+/gu, '-'))\n\tconst specifier = JSON.stringify(entry.specifier)\n\twriteDistributionFile(join(page, 'index.html'), DISTRIBUTION_BROWSER_PAGE)\n\twriteDistributionFile(\n\t\tjoin(page, 'main.js'),\n\t\t`import * as entry from ${specifier}\\nglobalThis.subject = Object.keys(entry).sort()\\n`,\n\t)\n\tawait build({\n\t\tbase: './',\n\t\tbuild: { emptyOutDir: true, outDir: 'bundle' },\n\t\tconfigFile: false,\n\t\tlogLevel: 'error',\n\t\troot: page,\n\t})\n\treturn join(page, 'bundle')\n}\n\n// The key set the bundled module publishes in a real browser, read off the page\n// after it has loaded over a loopback server. A module that never evaluated\n// publishes nothing, and a page error is raised rather than compared away.\n/**\n * Reads the names a real browser publishes from a served bundle.\n *\n * @param browser - The browser to drive.\n * @param bundle - The built consumer directory.\n * @returns The exported names. Rejects on a page error or an invalid name list.\n */\nexport async function readDistributionBrowserExports(\n\tbrowser: Browser,\n\tbundle: string,\n): Promise<readonly string[]> {\n\tconst server = createServer((request, response) => {\n\t\tconst asked = request.url === undefined || request.url === '/' ? '/index.html' : request.url\n\t\tconst path = join(bundle, decodeURIComponent(asked))\n\t\tif (!path.startsWith(bundle) || !existsSync(path)) {\n\t\t\tresponse.writeHead(404)\n\t\t\tresponse.end()\n\t\t\treturn\n\t\t}\n\t\tresponse.writeHead(200, { 'content-type': inferDistributionContentType(path) })\n\t\tresponse.end(readFileSync(path))\n\t})\n\ttry {\n\t\tawait new Promise<void>((settle) => {\n\t\t\tserver.listen(0, '127.0.0.1', settle)\n\t\t})\n\t\tconst address = server.address()\n\t\tif (address === null || typeof address === 'string') {\n\t\t\tthrow new Error('The bundle server bound no port')\n\t\t}\n\t\tconst page = await browser.newPage()\n\t\tconst failures: string[] = []\n\t\tpage.on('pageerror', (error) => failures.push(String(error)))\n\t\tawait page.goto(`http://127.0.0.1:${String(address.port)}/`, { waitUntil: 'load' })\n\t\tconst published: unknown = await page.evaluate('globalThis.subject')\n\t\tif (failures.length > 0) throw new Error(`The bundle raised ${failures.join(' | ')}`)\n\t\tif (!isDistributionNames(published))\n\t\t\tthrow new Error('The bundled module published no name list')\n\t\treturn published\n\t} finally {\n\t\tserver.close()\n\t}\n}\n/**\n * Checks each browser publication against its installed declarations in a real browser.\n * @param stage - The installed consumer to drive.\n * @param context - The proof context that reports unavailable browser prerequisites.\n * @returns The compiler diagnostics each browser publication reports.\n */\nexport async function checkDistributionBrowser(\n\tstage: DistributionStage,\n\tcontext: TestContext,\n): Promise<readonly string[]> {\n\tconst driver = DISTRIBUTION_BROWSER_RESOLUTION\n\tif (driver === undefined) throw new Error(\"DISTRIBUTION_RESOLUTIONS carries no 'bundler' row\")\n\tconst entries = stage.entries.filter((entry) => entry.browsable)\n\tif (entries.length === 0) return context.skip('No installed entry supports a browser')\n\tconst readings: Array<readonly string[]> = []\n\tfor (const entry of entries) {\n\t\tif (!entry.declaration.browsable) {\n\t\t\tthrow new Error(`${entry.subpath} publishes no browser declaration`)\n\t\t}\n\t\tconst options = resolveBrowser(resolvePinnedBrowser(), process.platform, process.env)\n\t\tconst browser = await launchDistributionBrowser(options).catch((error: unknown) => {\n\t\t\tconst cause = `${renderDistributionBrowser(options)} was rejected: ${String(error)}`\n\t\t\tif (DISTRIBUTION_RELEASE) throw new Error(`The release gate requires a browser, and ${cause}`)\n\t\t\treturn context.skip(`No browser launched. ${cause}`)\n\t\t})\n\t\ttry {\n\t\t\tconst bundle = await bundleDistributionEntry(stage, entry)\n\t\t\tconst published = await readDistributionBrowserExports(browser, bundle)\n\t\t\t// A browser consumer reads the installed declarations through a bundler, so\n\t\t\t// that is the one driver this face answers under.\n\t\t\tconst reported = checkDistributionSurface(stage, {\n\t\t\t\tentry,\n\t\t\t\textension: 'ts',\n\t\t\t\tpublished,\n\t\t\t\tdriver,\n\t\t\t})\n\t\t\treadings.push(reported)\n\t\t} finally {\n\t\t\tawait browser.close()\n\t\t}\n\t}\n\treturn readings.flat()\n}\n";
|
|
142
142
|
drive: "\tit('publishes what it declares to a real browser [requires a browser]', async (context) => {\n\t\texpect(await checkDistributionBrowser(DISTRIBUTION_SUITE.read(context), context)).toStrictEqual(\n\t\t\t[],\n\t\t)\n\t})\n";
|
|
143
143
|
guard: "\tit('publishes no browser face this proof cannot drive [requires the registry]', (context) => {\n\t\tconst faces = DISTRIBUTION_SUITE.read(context).entries.filter((entry) => entry.browsable)\n\t\texpect(faces.map((entry) => entry.subpath)).toStrictEqual([])\n\t})\n";
|
|
144
144
|
}>;
|
|
@@ -2851,7 +2851,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
2851
2851
|
*
|
|
2852
2852
|
* @remarks
|
|
2853
2853
|
* `text` is the brace character or the quoted string with its quotes, `index` is
|
|
2854
|
-
* where it starts in the scanned text, and `depth` counts the objects open
|
|
2854
|
+
* where it starts in the scanned text, and `depth` counts the objects open after
|
|
2855
2855
|
* it is read, braces alone. `value` is set only for a string that a colon
|
|
2856
2856
|
* follows, and is the offset of the first character after that colon and the
|
|
2857
2857
|
* whitespace beside it, so the character at `value` begins the string's value.
|
|
@@ -2955,7 +2955,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
2955
2955
|
*
|
|
2956
2956
|
* @remarks
|
|
2957
2957
|
* The one home of the orchestration membership rule. A vendored path and a
|
|
2958
|
-
* foreign path found in a target are both classified through here, so
|
|
2958
|
+
* foreign path found in a target are both classified through here, so an added
|
|
2959
2959
|
* harness directory is admitted once in `ORCHESTRATION_PATH_PREFIXES` and every
|
|
2960
2960
|
* caller follows.
|
|
2961
2961
|
*
|
|
@@ -2997,7 +2997,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
2997
2997
|
* Tests whether a declared range already admits a published version.
|
|
2998
2998
|
*
|
|
2999
2999
|
* @param range - The declared dependency range.
|
|
3000
|
-
* @param latest - The version the registry
|
|
3000
|
+
* @param latest - The version the registry's `latest` tag reports.
|
|
3001
3001
|
* @returns True if the range admits that version; false otherwise.
|
|
3002
3002
|
*
|
|
3003
3003
|
* @remarks
|
|
@@ -3177,7 +3177,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
3177
3177
|
* beneath one of these prefixes is `orchestration`, and everything else that is
|
|
3178
3178
|
* not source, tests, guides, docs, or a manifest is `configs`. A vendored path
|
|
3179
3179
|
* and a foreign path found in a target are classified against the same list, so
|
|
3180
|
-
*
|
|
3180
|
+
* an added harness directory is admitted once.
|
|
3181
3181
|
*/
|
|
3182
3182
|
export declare const ORCHESTRATION_PATH_PREFIXES: readonly string[];
|
|
3183
3183
|
|
|
@@ -3522,7 +3522,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
3522
3522
|
* `range` is the declared range, and `latest` is the version the producer
|
|
3523
3523
|
* selected. A found lookup carries that selected version; one that produced no
|
|
3524
3524
|
* answer carries the cause and no selected version. `major`, when present, is
|
|
3525
|
-
* the stable major named by the registry's latest tag in the same answer.
|
|
3525
|
+
* the stable major named by the registry's `latest` tag in the same answer.
|
|
3526
3526
|
*/
|
|
3527
3527
|
export declare type Release = {
|
|
3528
3528
|
readonly name: string;
|
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.106",
|
|
7
7
|
description: "Scaffold workspaces with commands: new, audit, repair, catalog, and overwrite.",
|
|
8
8
|
keywords: [
|
|
9
9
|
"audit",
|
|
@@ -108,14 +108,14 @@ var package_default = {
|
|
|
108
108
|
"@orkestrel/html": "^0.0.12",
|
|
109
109
|
"@orkestrel/probe": "^0.0.24",
|
|
110
110
|
"@orkestrel/test": "^0.0.29",
|
|
111
|
-
"@types/node": "^
|
|
111
|
+
"@types/node": "^24.19.2",
|
|
112
112
|
"@vitest/browser-playwright": "^4.1.11",
|
|
113
|
-
"oxfmt": "^0.
|
|
114
|
-
"oxlint": "^1.
|
|
113
|
+
"oxfmt": "^0.74.0",
|
|
114
|
+
"oxlint": "^1.89.0",
|
|
115
115
|
"playwright": "^1.63.0",
|
|
116
116
|
"typescript": "^6.0.3",
|
|
117
|
-
"vite": "^8.3.
|
|
118
|
-
"vitest": "^4.1.
|
|
117
|
+
"vite": "^8.3.5",
|
|
118
|
+
"vitest": "^4.1.12"
|
|
119
119
|
},
|
|
120
120
|
engines: { "node": ">=22.18.0" }
|
|
121
121
|
};
|
|
@@ -400,7 +400,7 @@ var EXECUTABLE_PATHS = Object.freeze([
|
|
|
400
400
|
* beneath one of these prefixes is `orchestration`, and everything else that is
|
|
401
401
|
* not source, tests, guides, docs, or a manifest is `configs`. A vendored path
|
|
402
402
|
* and a foreign path found in a target are classified against the same list, so
|
|
403
|
-
*
|
|
403
|
+
* an added harness directory is admitted once.
|
|
404
404
|
*/
|
|
405
405
|
var ORCHESTRATION_PATH_PREFIXES = Object.freeze([
|
|
406
406
|
".agents/",
|
|
@@ -4389,7 +4389,7 @@ export async function bundleDistributionEntry(
|
|
|
4389
4389
|
}
|
|
4390
4390
|
|
|
4391
4391
|
// The key set the bundled module publishes in a real browser, read off the page
|
|
4392
|
-
//
|
|
4392
|
+
// after it has loaded over a loopback server. A module that never evaluated
|
|
4393
4393
|
// publishes nothing, and a page error is raised rather than compared away.
|
|
4394
4394
|
/**
|
|
4395
4395
|
* Reads the names a real browser publishes from a served bundle.
|
|
@@ -5554,7 +5554,7 @@ function computeHash(text) {
|
|
|
5554
5554
|
*
|
|
5555
5555
|
* @remarks
|
|
5556
5556
|
* The one home of the orchestration membership rule. A vendored path and a
|
|
5557
|
-
* foreign path found in a target are both classified through here, so
|
|
5557
|
+
* foreign path found in a target are both classified through here, so an added
|
|
5558
5558
|
* harness directory is admitted once in `ORCHESTRATION_PATH_PREFIXES` and every
|
|
5559
5559
|
* caller follows.
|
|
5560
5560
|
*
|
|
@@ -6219,7 +6219,7 @@ function compareVersions(left, right) {
|
|
|
6219
6219
|
* Tests whether a declared range already admits a published version.
|
|
6220
6220
|
*
|
|
6221
6221
|
* @param range - The declared dependency range.
|
|
6222
|
-
* @param latest - The version the registry
|
|
6222
|
+
* @param latest - The version the registry's `latest` tag reports.
|
|
6223
6223
|
* @returns True if the range admits that version; false otherwise.
|
|
6224
6224
|
*
|
|
6225
6225
|
* @remarks
|