@mostra/protocol 0.5.0 → 0.6.1

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/bundle.d.ts CHANGED
@@ -1,13 +1,15 @@
1
1
  import * as z from "zod";
2
2
  //#region src/bundle.d.ts
3
- /** The platforms v1 ships a bundle for (D35; Windows follows in v1.1, D120). */
4
- export declare const BUNDLE_PLATFORMS: readonly ["darwin-arm64", "darwin-x64", "linux-x64", "linux-arm64"];
3
+ /** The platforms v1 ships a bundle for (D35, D146): macOS, glibc Linux and Windows. */
4
+ export declare const BUNDLE_PLATFORMS: readonly ["darwin-arm64", "darwin-x64", "linux-x64", "linux-arm64", "win32-x64", "win32-arm64"];
5
5
  /** One platform a bundle is built for: `<os>-<arch>` as Node names them. */
6
6
  export type BundlePlatform = (typeof BUNDLE_PLATFORMS)[number];
7
7
  /** The `name` every `bundle.json` carries, so a stray JSON file is never taken for one. */
8
8
  export declare const BUNDLE_NAME = "mostra-runtime-bundle";
9
9
  /** The marker setup writes at a bundle's root once its files and its browser are verified. */
10
10
  export declare const BUNDLE_SETUP_MARKER = ".mostra-setup.json";
11
+ /** Whether a platform's bundle is a Windows one, whose links setup makes as junctions (D153). */
12
+ export declare function isWindowsBundle(platform: BundlePlatform): boolean;
11
13
  /** The archive a release attaches for a version and platform. */
12
14
  export declare function bundleAssetName(version: string, platform: BundlePlatform): string;
13
15
  /** The platform schema. */
@@ -25,7 +27,10 @@ export interface BundleFileEntry {
25
27
  }
26
28
  /** The file entry schema. */
27
29
  export declare const BundleFileEntry: z.ZodType<BundleFileEntry>;
28
- /** One symbolic link of a bundle. Its target is relative and resolves inside the bundle. */
30
+ /**
31
+ * One symbolic link of a bundle. Its target is relative and resolves inside the bundle. In a
32
+ * Windows bundle every link names a directory, and setup makes it a junction (D153).
33
+ */
29
34
  export interface BundleLinkEntry {
30
35
  /** The link itself, relative to the bundle's root. */
31
36
  readonly path: string;
@@ -148,6 +153,12 @@ export interface BundleSetup {
148
153
  };
149
154
  /** When setup finished (RFC 3339). */
150
155
  readonly at: string;
156
+ /**
157
+ * The bundle's real path when setup ran. A Windows bundle's junctions name their targets by
158
+ * absolute path, so a Windows bundle whose marker names another root (it was moved or copied)
159
+ * is set up again, which makes its junctions afresh (D153). Absent in markers before WP-W3.
160
+ */
161
+ readonly root?: string;
151
162
  }
152
163
  /** The setup marker's schema. */
153
164
  export declare const BundleSetup: z.ZodType<BundleSetup>;
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.d.ts","names":[],"sources":["../src/bundle.ts"],"mappings":";;;qBAuBa;;YAID,yBAAyB;;qBAGxB;;qBAGA;;wBAGG,gBAAgB,iBAAiB,UAAU;;qBAmB9C,sBAAsB,EAAE,QAAQ;;iBAK5B;;WAEN;;WAEA;;WAEA;;WAEA;;;qBAIE,iBAAiB,EAAE,QAAQ;;iBAUvB;;WAEN;;WAEA;;;qBAIE,iBAAiB,EAAE,QAAQ;;iBAKvB;;WAEN;;WAEA,gBAAgB;;WAEhB,gBAAgB;;;qBAId,aAAa,EAAE,QAAQ;;iBASnB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,gBAAgB;;;qBAId,eAAe,EAAE,QAAQ;;iBAWrB;;WAEN;;WAEA,aAAa;;WAEb;;WAEA,UAAU;;WAEV;aAAiB;aAA0B;;;WAE3C;;aAEE;;aAEA;;aAEA;;;WAGF;aAAkB;aAAuB;;;WAEzC,SAAS;;WAET;aAAoB;aAA6B;;;;qBAI/C,YAAY,EAAE,QAAQ;;iBAelB;;WAEN;;WAEA;;WAEA;;WAEA;;;qBAIE,aAAa,EAAE,QAAQ;;;;;iBAiBnB;;WAEN;;WAEA;;WAEA;;WAEA,QAAQ,QAAQ,OAAO,gBAAgB;;;;;;;qBAQrC,YAAY,EAAE,QAAQ;;iBAUlB;;WAEN;;WAEA;;WAEA,UAAU;;WAEV;;WAEA;aAAoB;;;WAEpB;;;qBAIE,aAAa,EAAE,QAAQ"}
1
+ {"version":3,"file":"bundle.d.ts","names":[],"sources":["../src/bundle.ts"],"mappings":";;;qBA4Ba;;YAUD,yBAAyB;;qBAGxB;;qBAGA;;wBAGG,gBAAgB,UAAU;;wBAK1B,gBAAgB,iBAAiB,UAAU;;qBAmB9C,sBAAsB,EAAE,QAAQ;;iBAK5B;;WAEN;;WAEA;;WAEA;;WAEA;;;qBAIE,iBAAiB,EAAE,QAAQ;;;;;iBAavB;;WAEN;;WAEA;;;qBAIE,iBAAiB,EAAE,QAAQ;;iBAKvB;;WAEN;;WAEA,gBAAgB;;WAEhB,gBAAgB;;;qBAId,aAAa,EAAE,QAAQ;;iBASnB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,gBAAgB;;;qBAId,eAAe,EAAE,QAAQ;;iBAWrB;;WAEN;;WAEA,aAAa;;WAEb;;WAEA,UAAU;;WAEV;aAAiB;aAA0B;;;WAE3C;;aAEE;;aAEA;;aAEA;;;WAGF;aAAkB;aAAuB;;;WAEzC,SAAS;;WAET;aAAoB;aAA6B;;;;qBAI/C,YAAY,EAAE,QAAQ;;iBAelB;;WAEN;;WAEA;;WAEA;;WAEA;;;qBAIE,aAAa,EAAE,QAAQ;;;;;iBAoBnB;;WAEN;;WAEA;;WAEA;;WAEA,QAAQ,QAAQ,OAAO,gBAAgB;;;;;;;qBAQrC,YAAY,EAAE,QAAQ;;iBAUlB;;WAEN;;WAEA;;WAEA,UAAU;;WAEV;;WAEA;aAAoB;;;WAEpB;;;;;;WAMA;;;qBAIE,aAAa,EAAE,QAAQ"}
package/dist/bundle.js CHANGED
@@ -14,23 +14,34 @@ import * as z from "zod";
14
14
  * files.json BundleFiles: every other file and link of the archive with its SHA-256
15
15
  * node/ the official Node.js distribution for the platform
16
16
  * lib/node_modules/ Mostra's packages (cli, runtime, worker, verify, shell, sdk, warm) and theirs
17
- * bin/ the mostra, mostra-runtime and mostra-setup launchers
17
+ * bin/ the mostra, mostra-runtime and mostra-setup launchers (POSIX scripts, or on
18
+ * Windows `.exe` launchers beside the helpers mostra-win and mostra-win-service)
18
19
  * ```
19
20
  *
21
+ * A Windows archive holds no links: an ordinary Windows user can't create symbolic links, so its
22
+ * `files.json` lists the links, each to a directory inside the bundle, and setup makes each one a
23
+ * junction at the bundle's real path (D153).
24
+ *
20
25
  * The verify browser isn't in the archive: setup downloads the pinned revision through the
21
26
  * bundle's own Playwright and checks every file against `BundleInfo.browser.files` (D142).
22
27
  */
23
- /** The platforms v1 ships a bundle for (D35; Windows follows in v1.1, D120). */
28
+ /** The platforms v1 ships a bundle for (D35, D146): macOS, glibc Linux and Windows. */
24
29
  const BUNDLE_PLATFORMS = [
25
30
  "darwin-arm64",
26
31
  "darwin-x64",
27
32
  "linux-x64",
28
- "linux-arm64"
33
+ "linux-arm64",
34
+ "win32-x64",
35
+ "win32-arm64"
29
36
  ];
30
37
  /** The `name` every `bundle.json` carries, so a stray JSON file is never taken for one. */
31
38
  const BUNDLE_NAME = "mostra-runtime-bundle";
32
39
  /** The marker setup writes at a bundle's root once its files and its browser are verified. */
33
40
  const BUNDLE_SETUP_MARKER = ".mostra-setup.json";
41
+ /** Whether a platform's bundle is a Windows one, whose links setup makes as junctions (D153). */
42
+ function isWindowsBundle(platform) {
43
+ return platform.startsWith("win32-");
44
+ }
34
45
  /** The archive a release attaches for a version and platform. */
35
46
  function bundleAssetName(version, platform) {
36
47
  return `mostra-${version}-${platform}.tar.gz`;
@@ -99,7 +110,7 @@ const BundleInfo = z.object({
99
110
  }).register(wireRegistry, { id: "BundleInfo" });
100
111
  /** The asset schema. */
101
112
  const BundleAsset = z.object({
102
- file: z.string().regex(/^mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-(darwin|linux)-(arm64|x64)\.tar\.gz$/),
113
+ file: z.string().regex(/^(?:mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-(darwin|linux)-(arm64|x64)\.tar\.gz$|mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-win32-(arm64|x64)\.tar\.gz$)/),
103
114
  sha256,
104
115
  size: z.int().positive(),
105
116
  unpackedSize: z.int().positive()
@@ -122,9 +133,10 @@ const BundleSetup = z.object({
122
133
  platform: BundlePlatformSchema,
123
134
  files: sha256,
124
135
  browser: z.object({ revision: z.string().min(1) }),
125
- at: z.string()
136
+ at: z.string(),
137
+ root: z.string().min(1).exactOptional()
126
138
  }).register(wireRegistry, { id: "BundleSetup" });
127
139
  //#endregion
128
- export { BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatformSchema, BundleSetup, bundleAssetName };
140
+ export { BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatformSchema, BundleSetup, bundleAssetName, isWindowsBundle };
129
141
 
130
142
  //# sourceMappingURL=bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.js","names":[],"sources":["../src/bundle.ts"],"sourcesContent":["/**\n * The runtime bundle's contract (RT-01, INTERFACES §16): what a host downloads, how it checks it\n * and where its entry points are. The SDK, the CLI's bootstrap and the Rust crate (WP-12) all read\n * these files, so they are wire schemas: published as JSON Schema and changed only additively.\n *\n * A release attaches one archive per platform, `mostra-<version>-<platform>.tar.gz`, whose single\n * top directory holds:\n *\n * ```text\n * bundle.json BundleInfo: identity, entry points, the digest of files.json, the browser pin\n * files.json BundleFiles: every other file and link of the archive with its SHA-256\n * node/ the official Node.js distribution for the platform\n * lib/node_modules/ Mostra's packages (cli, runtime, worker, verify, shell, sdk, warm) and theirs\n * bin/ the mostra, mostra-runtime and mostra-setup launchers\n * ```\n *\n * The verify browser isn't in the archive: setup downloads the pinned revision through the\n * bundle's own Playwright and checks every file against `BundleInfo.browser.files` (D142).\n */\nimport * as z from \"zod\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\n/** The platforms v1 ships a bundle for (D35; Windows follows in v1.1, D120). */\nexport const BUNDLE_PLATFORMS: readonly [\"darwin-arm64\", \"darwin-x64\", \"linux-x64\", \"linux-arm64\"] =\n [\"darwin-arm64\", \"darwin-x64\", \"linux-x64\", \"linux-arm64\"];\n\n/** One platform a bundle is built for: `<os>-<arch>` as Node names them. */\nexport type BundlePlatform = (typeof BUNDLE_PLATFORMS)[number];\n\n/** The `name` every `bundle.json` carries, so a stray JSON file is never taken for one. */\nexport const BUNDLE_NAME = \"mostra-runtime-bundle\";\n\n/** The marker setup writes at a bundle's root once its files and its browser are verified. */\nexport const BUNDLE_SETUP_MARKER = \".mostra-setup.json\";\n\n/** The archive a release attaches for a version and platform. */\nexport function bundleAssetName(version: string, platform: BundlePlatform): string {\n return `mostra-${version}-${platform}.tar.gz`;\n}\n\nconst sha256: z.ZodType<string> = z\n .string()\n .regex(/^[0-9a-f]{64}$/)\n .register(wireRegistry, { id: \"Sha256\", description: \"A SHA-256 digest in lowercase hex.\" });\n\n/**\n * A path inside a bundle, `/`-separated and relative. Readers refuse absolute paths and `.` or\n * `..` segments themselves; the pattern only keeps the obvious out.\n */\nconst bundlePath: z.ZodType<string> = z\n .string()\n .min(1)\n .regex(/^[^/\\0]/);\n\n/** The platform schema. */\nexport const BundlePlatformSchema: z.ZodType<BundlePlatform> = z\n .enum(BUNDLE_PLATFORMS)\n .register(wireRegistry, { id: \"BundlePlatform\" });\n\n/** One regular file of a bundle or of its browser. */\nexport interface BundleFileEntry {\n /** Relative to the bundle's root (or to `browsers/` for the browser), `/`-separated. */\n readonly path: string;\n /** Its length in bytes. */\n readonly size: number;\n /** The SHA-256 of its bytes, lowercase hex. */\n readonly sha256: string;\n /** Whether its owner may execute it (mode 0755 rather than 0644 once extracted). */\n readonly executable: boolean;\n}\n\n/** The file entry schema. */\nexport const BundleFileEntry: z.ZodType<BundleFileEntry> = z\n .object({\n path: bundlePath,\n size: z.int().min(0),\n sha256,\n executable: z.boolean(),\n })\n .register(wireRegistry, { id: \"BundleFileEntry\" });\n\n/** One symbolic link of a bundle. Its target is relative and resolves inside the bundle. */\nexport interface BundleLinkEntry {\n /** The link itself, relative to the bundle's root. */\n readonly path: string;\n /** What the link holds, exactly as written (relative). */\n readonly target: string;\n}\n\n/** The link entry schema. */\nexport const BundleLinkEntry: z.ZodType<BundleLinkEntry> = z\n .object({ path: bundlePath, target: z.string().min(1) })\n .register(wireRegistry, { id: \"BundleLinkEntry\" });\n\n/** `files.json`: everything in the archive besides `bundle.json`, each list sorted by path. */\nexport interface BundleFiles {\n /** The format's version; 1 today. */\n readonly schemaVersion: 1;\n /** Every regular file, sorted by path. */\n readonly files: readonly BundleFileEntry[];\n /** Every symbolic link, sorted by path. */\n readonly links: readonly BundleLinkEntry[];\n}\n\n/** The `files.json` schema. */\nexport const BundleFiles: z.ZodType<BundleFiles> = z\n .object({\n schemaVersion: z.literal(1),\n files: z.array(BundleFileEntry),\n links: z.array(BundleLinkEntry),\n })\n .register(wireRegistry, { id: \"BundleFiles\" });\n\n/** The verify browser a bundle pins: fetched at setup, checked file by file (D142). */\nexport interface BundleBrowser {\n /** Playwright's name for the browser. */\n readonly name: \"chromium-headless-shell\";\n /** Playwright's revision, the directory `browsers/chromium_headless_shell-<revision>`. */\n readonly revision: string;\n /** The browser's own version, for people and diagnostics. */\n readonly browserVersion: string;\n /** The bundle's Playwright CLI, run with the bundle's Node: `install chromium-headless-shell`. */\n readonly installer: string;\n /** Every file the install leaves under `browsers/`, besides Playwright's own markers. */\n readonly files: readonly BundleFileEntry[];\n}\n\n/** The browser pin schema. */\nexport const BundleBrowser: z.ZodType<BundleBrowser> = z\n .object({\n name: z.literal(\"chromium-headless-shell\"),\n revision: z.string().min(1),\n browserVersion: z.string().min(1),\n installer: bundlePath,\n files: z.array(BundleFileEntry),\n })\n .register(wireRegistry, { id: \"BundleBrowser\" });\n\n/** `bundle.json`: a bundle's identity and entry points. */\nexport interface BundleInfo {\n /** The format's version; 1 today. */\n readonly schemaVersion: 1;\n /** Always {@link BUNDLE_NAME}, so a stray `bundle.json` isn't taken for one. */\n readonly name: typeof BUNDLE_NAME;\n /** The Mostra release: every Mostra package in the bundle has this version. */\n readonly version: string;\n /** The platform it was built on and for. */\n readonly platform: BundlePlatform;\n /** The private Node.js the bundle runs on (RT-01), and its executable. */\n readonly node: { readonly version: string; readonly path: string };\n /** Scripts each run as `<node.path> <entry> …`, paths relative to the bundle's root. */\n readonly entries: {\n /** `mostra-runtime host|daemon|service`: what a host spawns (D85). */\n readonly runtime: string;\n /** `mostra`, the CLI. */\n readonly cli: string;\n /** Verifies the bundle, fetches its browser and writes `.mostra-setup.json`. */\n readonly setup: string;\n };\n /** `files.json` and its SHA-256, which ties every other file to this one. */\n readonly files: { readonly path: string; readonly sha256: string };\n /** The verify browser setup fetches and checks (D142 item 2). */\n readonly browser: BundleBrowser;\n /** Where it was built from. */\n readonly source?: { readonly repository: string; readonly commit: string };\n}\n\n/** The `bundle.json` schema. */\nexport const BundleInfo: z.ZodType<BundleInfo> = z\n .object({\n schemaVersion: z.literal(1),\n name: z.literal(BUNDLE_NAME),\n version: z.string().min(1),\n platform: BundlePlatformSchema,\n node: z.object({ version: z.string().min(1), path: bundlePath }),\n entries: z.object({ runtime: bundlePath, cli: bundlePath, setup: bundlePath }),\n files: z.object({ path: bundlePath, sha256 }),\n browser: BundleBrowser,\n source: z.object({ repository: z.string(), commit: z.string() }).exactOptional(),\n })\n .register(wireRegistry, { id: \"BundleInfo\" });\n\n/** One platform's archive in a release. */\nexport interface BundleAsset {\n /** The file name, {@link bundleAssetName}. */\n readonly file: string;\n /** The SHA-256 of the archive's bytes, lowercase hex. */\n readonly sha256: string;\n /** Bytes of the archive. */\n readonly size: number;\n /** Bytes once extracted, before the browser: what an installer checks free space against. */\n readonly unpackedSize: number;\n}\n\n/** The asset schema. */\nexport const BundleAsset: z.ZodType<BundleAsset> = z\n .object({\n // Exactly an archive's own name, no directory: an installer joins it to its scratch directory\n // (Opus review finding 8), and `BundlePins` checks it names its release and platform.\n file: z\n .string()\n .regex(/^mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-(darwin|linux)-(arm64|x64)\\.tar\\.gz$/),\n sha256,\n size: z.int().positive(),\n unpackedSize: z.int().positive(),\n })\n .register(wireRegistry, { id: \"BundleAsset\" });\n\n/**\n * `bundles.json`: one release's archives, pinned by SHA-256. The release workflow writes it into\n * `@mostra/sdk` before the package is published, so an npm install pins exactly what it fetches.\n */\nexport interface BundlePins {\n /** The format's version; 1 today. */\n readonly schemaVersion: 1;\n /** The release these archives belong to: the SDK's own version. */\n readonly version: string;\n /** The base URL the archives are under: the GitHub release's download path. */\n readonly release: string;\n /** Each platform's archive. */\n readonly assets: Partial<Record<BundlePlatform, BundleAsset>>;\n}\n\n/**\n * The `bundles.json` schema. Each asset's `file` has an archive's shape (no directory); that it is\n * exactly {@link bundleAssetName} of the pins' version and its platform is checked by the\n * installer before any I/O, since JSON Schema can't express the comparison.\n */\nexport const BundlePins: z.ZodType<BundlePins> = z\n .object({\n schemaVersion: z.literal(1),\n version: z.string().regex(/^[0-9A-Za-z][0-9A-Za-z.+-]*$/),\n release: z.url({ protocol: /^https?$/ }),\n assets: z.partialRecord(BundlePlatformSchema, BundleAsset),\n })\n .register(wireRegistry, { id: \"BundlePins\" });\n\n/** `.mostra-setup.json`: written by setup once the files and the browser are verified. */\nexport interface BundleSetup {\n /** The format's version; 1 today. */\n readonly schemaVersion: 1;\n /** The bundle's release. */\n readonly version: string;\n /** The bundle's platform. */\n readonly platform: BundlePlatform;\n /** `BundleInfo.files.sha256` of the bundle it describes. */\n readonly files: string;\n /** The browser revision setup fetched and checked. */\n readonly browser: { readonly revision: string };\n /** When setup finished (RFC 3339). */\n readonly at: string;\n}\n\n/** The setup marker's schema. */\nexport const BundleSetup: z.ZodType<BundleSetup> = z\n .object({\n schemaVersion: z.literal(1),\n version: z.string().min(1),\n platform: BundlePlatformSchema,\n files: sha256,\n browser: z.object({ revision: z.string().min(1) }),\n at: z.string(),\n })\n .register(wireRegistry, { id: \"BundleSetup\" });\n"],"mappings":"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"}
1
+ {"version":3,"file":"bundle.js","names":[],"sources":["../src/bundle.ts"],"sourcesContent":["/**\n * The runtime bundle's contract (RT-01, INTERFACES §16): what a host downloads, how it checks it\n * and where its entry points are. The SDK, the CLI's bootstrap and the Rust crate (WP-12) all read\n * these files, so they are wire schemas: published as JSON Schema and changed only additively.\n *\n * A release attaches one archive per platform, `mostra-<version>-<platform>.tar.gz`, whose single\n * top directory holds:\n *\n * ```text\n * bundle.json BundleInfo: identity, entry points, the digest of files.json, the browser pin\n * files.json BundleFiles: every other file and link of the archive with its SHA-256\n * node/ the official Node.js distribution for the platform\n * lib/node_modules/ Mostra's packages (cli, runtime, worker, verify, shell, sdk, warm) and theirs\n * bin/ the mostra, mostra-runtime and mostra-setup launchers (POSIX scripts, or on\n * Windows `.exe` launchers beside the helpers mostra-win and mostra-win-service)\n * ```\n *\n * A Windows archive holds no links: an ordinary Windows user can't create symbolic links, so its\n * `files.json` lists the links, each to a directory inside the bundle, and setup makes each one a\n * junction at the bundle's real path (D153).\n *\n * The verify browser isn't in the archive: setup downloads the pinned revision through the\n * bundle's own Playwright and checks every file against `BundleInfo.browser.files` (D142).\n */\nimport * as z from \"zod\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\n/** The platforms v1 ships a bundle for (D35, D146): macOS, glibc Linux and Windows. */\nexport const BUNDLE_PLATFORMS: readonly [\n \"darwin-arm64\",\n \"darwin-x64\",\n \"linux-x64\",\n \"linux-arm64\",\n \"win32-x64\",\n \"win32-arm64\",\n] = [\"darwin-arm64\", \"darwin-x64\", \"linux-x64\", \"linux-arm64\", \"win32-x64\", \"win32-arm64\"];\n\n/** One platform a bundle is built for: `<os>-<arch>` as Node names them. */\nexport type BundlePlatform = (typeof BUNDLE_PLATFORMS)[number];\n\n/** The `name` every `bundle.json` carries, so a stray JSON file is never taken for one. */\nexport const BUNDLE_NAME = \"mostra-runtime-bundle\";\n\n/** The marker setup writes at a bundle's root once its files and its browser are verified. */\nexport const BUNDLE_SETUP_MARKER = \".mostra-setup.json\";\n\n/** Whether a platform's bundle is a Windows one, whose links setup makes as junctions (D153). */\nexport function isWindowsBundle(platform: BundlePlatform): boolean {\n return platform.startsWith(\"win32-\");\n}\n\n/** The archive a release attaches for a version and platform. */\nexport function bundleAssetName(version: string, platform: BundlePlatform): string {\n return `mostra-${version}-${platform}.tar.gz`;\n}\n\nconst sha256: z.ZodType<string> = z\n .string()\n .regex(/^[0-9a-f]{64}$/)\n .register(wireRegistry, { id: \"Sha256\", description: \"A SHA-256 digest in lowercase hex.\" });\n\n/**\n * A path inside a bundle, `/`-separated and relative. Readers refuse absolute paths and `.` or\n * `..` segments themselves; the pattern only keeps the obvious out.\n */\nconst bundlePath: z.ZodType<string> = z\n .string()\n .min(1)\n .regex(/^[^/\\0]/);\n\n/** The platform schema. */\nexport const BundlePlatformSchema: z.ZodType<BundlePlatform> = z\n .enum(BUNDLE_PLATFORMS)\n .register(wireRegistry, { id: \"BundlePlatform\" });\n\n/** One regular file of a bundle or of its browser. */\nexport interface BundleFileEntry {\n /** Relative to the bundle's root (or to `browsers/` for the browser), `/`-separated. */\n readonly path: string;\n /** Its length in bytes. */\n readonly size: number;\n /** The SHA-256 of its bytes, lowercase hex. */\n readonly sha256: string;\n /** Whether its owner may execute it (mode 0755 rather than 0644 once extracted). */\n readonly executable: boolean;\n}\n\n/** The file entry schema. */\nexport const BundleFileEntry: z.ZodType<BundleFileEntry> = z\n .object({\n path: bundlePath,\n size: z.int().min(0),\n sha256,\n executable: z.boolean(),\n })\n .register(wireRegistry, { id: \"BundleFileEntry\" });\n\n/**\n * One symbolic link of a bundle. Its target is relative and resolves inside the bundle. In a\n * Windows bundle every link names a directory, and setup makes it a junction (D153).\n */\nexport interface BundleLinkEntry {\n /** The link itself, relative to the bundle's root. */\n readonly path: string;\n /** What the link holds, exactly as written (relative). */\n readonly target: string;\n}\n\n/** The link entry schema. */\nexport const BundleLinkEntry: z.ZodType<BundleLinkEntry> = z\n .object({ path: bundlePath, target: z.string().min(1) })\n .register(wireRegistry, { id: \"BundleLinkEntry\" });\n\n/** `files.json`: everything in the archive besides `bundle.json`, each list sorted by path. */\nexport interface BundleFiles {\n /** The format's version; 1 today. */\n readonly schemaVersion: 1;\n /** Every regular file, sorted by path. */\n readonly files: readonly BundleFileEntry[];\n /** Every symbolic link, sorted by path. */\n readonly links: readonly BundleLinkEntry[];\n}\n\n/** The `files.json` schema. */\nexport const BundleFiles: z.ZodType<BundleFiles> = z\n .object({\n schemaVersion: z.literal(1),\n files: z.array(BundleFileEntry),\n links: z.array(BundleLinkEntry),\n })\n .register(wireRegistry, { id: \"BundleFiles\" });\n\n/** The verify browser a bundle pins: fetched at setup, checked file by file (D142). */\nexport interface BundleBrowser {\n /** Playwright's name for the browser. */\n readonly name: \"chromium-headless-shell\";\n /** Playwright's revision, the directory `browsers/chromium_headless_shell-<revision>`. */\n readonly revision: string;\n /** The browser's own version, for people and diagnostics. */\n readonly browserVersion: string;\n /** The bundle's Playwright CLI, run with the bundle's Node: `install chromium-headless-shell`. */\n readonly installer: string;\n /** Every file the install leaves under `browsers/`, besides Playwright's own markers. */\n readonly files: readonly BundleFileEntry[];\n}\n\n/** The browser pin schema. */\nexport const BundleBrowser: z.ZodType<BundleBrowser> = z\n .object({\n name: z.literal(\"chromium-headless-shell\"),\n revision: z.string().min(1),\n browserVersion: z.string().min(1),\n installer: bundlePath,\n files: z.array(BundleFileEntry),\n })\n .register(wireRegistry, { id: \"BundleBrowser\" });\n\n/** `bundle.json`: a bundle's identity and entry points. */\nexport interface BundleInfo {\n /** The format's version; 1 today. */\n readonly schemaVersion: 1;\n /** Always {@link BUNDLE_NAME}, so a stray `bundle.json` isn't taken for one. */\n readonly name: typeof BUNDLE_NAME;\n /** The Mostra release: every Mostra package in the bundle has this version. */\n readonly version: string;\n /** The platform it was built on and for. */\n readonly platform: BundlePlatform;\n /** The private Node.js the bundle runs on (RT-01), and its executable. */\n readonly node: { readonly version: string; readonly path: string };\n /** Scripts each run as `<node.path> <entry> …`, paths relative to the bundle's root. */\n readonly entries: {\n /** `mostra-runtime host|daemon|service`: what a host spawns (D85). */\n readonly runtime: string;\n /** `mostra`, the CLI. */\n readonly cli: string;\n /** Verifies the bundle, fetches its browser and writes `.mostra-setup.json`. */\n readonly setup: string;\n };\n /** `files.json` and its SHA-256, which ties every other file to this one. */\n readonly files: { readonly path: string; readonly sha256: string };\n /** The verify browser setup fetches and checks (D142 item 2). */\n readonly browser: BundleBrowser;\n /** Where it was built from. */\n readonly source?: { readonly repository: string; readonly commit: string };\n}\n\n/** The `bundle.json` schema. */\nexport const BundleInfo: z.ZodType<BundleInfo> = z\n .object({\n schemaVersion: z.literal(1),\n name: z.literal(BUNDLE_NAME),\n version: z.string().min(1),\n platform: BundlePlatformSchema,\n node: z.object({ version: z.string().min(1), path: bundlePath }),\n entries: z.object({ runtime: bundlePath, cli: bundlePath, setup: bundlePath }),\n files: z.object({ path: bundlePath, sha256 }),\n browser: BundleBrowser,\n source: z.object({ repository: z.string(), commit: z.string() }).exactOptional(),\n })\n .register(wireRegistry, { id: \"BundleInfo\" });\n\n/** One platform's archive in a release. */\nexport interface BundleAsset {\n /** The file name, {@link bundleAssetName}. */\n readonly file: string;\n /** The SHA-256 of the archive's bytes, lowercase hex. */\n readonly sha256: string;\n /** Bytes of the archive. */\n readonly size: number;\n /** Bytes once extracted, before the browser: what an installer checks free space against. */\n readonly unpackedSize: number;\n}\n\n/** The asset schema. */\nexport const BundleAsset: z.ZodType<BundleAsset> = z\n .object({\n // Exactly an archive's own name, no directory: an installer joins it to its scratch directory\n // (Opus review finding 8), and `BundlePins` checks it names its release and platform.\n file: z\n .string()\n // Widened for Windows as the schema gate can prove: the old pattern is one alternative.\n .regex(\n /^(?:mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-(darwin|linux)-(arm64|x64)\\.tar\\.gz$|mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-win32-(arm64|x64)\\.tar\\.gz$)/,\n ),\n sha256,\n size: z.int().positive(),\n unpackedSize: z.int().positive(),\n })\n .register(wireRegistry, { id: \"BundleAsset\" });\n\n/**\n * `bundles.json`: one release's archives, pinned by SHA-256. The release workflow writes it into\n * `@mostra/sdk` before the package is published, so an npm install pins exactly what it fetches.\n */\nexport interface BundlePins {\n /** The format's version; 1 today. */\n readonly schemaVersion: 1;\n /** The release these archives belong to: the SDK's own version. */\n readonly version: string;\n /** The base URL the archives are under: the GitHub release's download path. */\n readonly release: string;\n /** Each platform's archive. */\n readonly assets: Partial<Record<BundlePlatform, BundleAsset>>;\n}\n\n/**\n * The `bundles.json` schema. Each asset's `file` has an archive's shape (no directory); that it is\n * exactly {@link bundleAssetName} of the pins' version and its platform is checked by the\n * installer before any I/O, since JSON Schema can't express the comparison.\n */\nexport const BundlePins: z.ZodType<BundlePins> = z\n .object({\n schemaVersion: z.literal(1),\n version: z.string().regex(/^[0-9A-Za-z][0-9A-Za-z.+-]*$/),\n release: z.url({ protocol: /^https?$/ }),\n assets: z.partialRecord(BundlePlatformSchema, BundleAsset),\n })\n .register(wireRegistry, { id: \"BundlePins\" });\n\n/** `.mostra-setup.json`: written by setup once the files and the browser are verified. */\nexport interface BundleSetup {\n /** The format's version; 1 today. */\n readonly schemaVersion: 1;\n /** The bundle's release. */\n readonly version: string;\n /** The bundle's platform. */\n readonly platform: BundlePlatform;\n /** `BundleInfo.files.sha256` of the bundle it describes. */\n readonly files: string;\n /** The browser revision setup fetched and checked. */\n readonly browser: { readonly revision: string };\n /** When setup finished (RFC 3339). */\n readonly at: string;\n /**\n * The bundle's real path when setup ran. A Windows bundle's junctions name their targets by\n * absolute path, so a Windows bundle whose marker names another root (it was moved or copied)\n * is set up again, which makes its junctions afresh (D153). Absent in markers before WP-W3.\n */\n readonly root?: string;\n}\n\n/** The setup marker's schema. */\nexport const BundleSetup: z.ZodType<BundleSetup> = z\n .object({\n schemaVersion: z.literal(1),\n version: z.string().min(1),\n platform: BundlePlatformSchema,\n files: sha256,\n browser: z.object({ revision: z.string().min(1) }),\n at: z.string(),\n root: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"BundleSetup\" });\n"],"mappings":"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"}
@@ -6,10 +6,10 @@ const platformDiagnostics = { MOSTRA_PLATFORM_UNSUPPORTED: {
6
6
  severity: "error",
7
7
  phase: "platform",
8
8
  title: "Unsupported platform",
9
- hint: "Run Mostra on macOS or Linux, on an x64 or arm64 machine.",
9
+ hint: "Run Mostra on macOS, glibc-based Linux or Windows, on an x64 or arm64 machine.",
10
10
  docs: {
11
- explanation: "Mostra runs on macOS and Linux, on x64 and arm64. On any other operating system or architecture every entry point stops with this code before it creates or changes anything, because the process model, the control endpoint and storage are built and tested only there. Windows on x64 and arm64 is being added and runs only in Mostra's own development builds until it is complete; a release stops there with this code too. The message names the platform that was detected.",
12
- fix: "Run Mostra on a macOS or Linux machine with an x64 or arm64 processor. Windows support arrives in a 1.0 release."
11
+ explanation: "Mostra runs on macOS, Linux with glibc and Windows, each on x64 and arm64. On any other operating system or architecture (32-bit Windows, musl-based Linux such as Alpine, BSDs) every entry point stops with this code before it creates or changes anything, because the process model, the control endpoint, storage and the runtime bundle are built and tested only on those platforms. The message names the platform that was detected.",
12
+ fix: "Run Mostra on macOS, a glibc-based Linux or Windows, with an x64 or arm64 processor. On Alpine Linux, use a glibc-based image instead."
13
13
  }
14
14
  } };
15
15
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","names":[],"sources":["../../../src/diagnostics/codes/platform.ts"],"sourcesContent":["/**\n * Diagnostic codes of the PLATFORM area: the operating systems and architectures Mostra runs on\n * (D35, RT-07).\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the PLATFORM area, in the order they were added. */\nexport const platformDiagnosticCodes = [\n \"MOSTRA_PLATFORM_UNSUPPORTED\",\n // gen:codes\n] as const;\n\n/** The codes of the PLATFORM area. */\nexport type PlatformDiagnosticCode = (typeof platformDiagnosticCodes)[number];\n\n/** The PLATFORM area's catalog entries. */\nexport const platformDiagnostics: AreaCatalog<PlatformDiagnosticCode> = {\n MOSTRA_PLATFORM_UNSUPPORTED: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Unsupported platform\",\n hint: \"Run Mostra on macOS or Linux, on an x64 or arm64 machine.\",\n docs: {\n explanation:\n \"Mostra runs on macOS and Linux, on x64 and arm64. On any other operating system or architecture every entry point stops with this code before it creates or changes anything, because the process model, the control endpoint and storage are built and tested only there. Windows on x64 and arm64 is being added and runs only in Mostra's own development builds until it is complete; a release stops there with this code too. The message names the platform that was detected.\",\n fix: \"Run Mostra on a macOS or Linux machine with an x64 or arm64 processor. Windows support arrives in a 1.0 release.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAOA,MAAa,0BAA0B,CACrC,6BAEF;;AAMA,MAAa,sBAA2D,EACtE,6BAA6B;CAC3B,UAAU;CACV,OAAO;CACP,OAAO;CACP,MAAM;CACN,MAAM;EACJ,aACE;EACF,KAAK;CACP;AACF,EAEF"}
1
+ {"version":3,"file":"platform.js","names":[],"sources":["../../../src/diagnostics/codes/platform.ts"],"sourcesContent":["/**\n * Diagnostic codes of the PLATFORM area: the operating systems and architectures Mostra runs on\n * (D35, D146, RT-07).\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the PLATFORM area, in the order they were added. */\nexport const platformDiagnosticCodes = [\n \"MOSTRA_PLATFORM_UNSUPPORTED\",\n // gen:codes\n] as const;\n\n/** The codes of the PLATFORM area. */\nexport type PlatformDiagnosticCode = (typeof platformDiagnosticCodes)[number];\n\n/** The PLATFORM area's catalog entries. */\nexport const platformDiagnostics: AreaCatalog<PlatformDiagnosticCode> = {\n MOSTRA_PLATFORM_UNSUPPORTED: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Unsupported platform\",\n hint: \"Run Mostra on macOS, glibc-based Linux or Windows, on an x64 or arm64 machine.\",\n docs: {\n explanation:\n \"Mostra runs on macOS, Linux with glibc and Windows, each on x64 and arm64. On any other operating system or architecture (32-bit Windows, musl-based Linux such as Alpine, BSDs) every entry point stops with this code before it creates or changes anything, because the process model, the control endpoint, storage and the runtime bundle are built and tested only on those platforms. The message names the platform that was detected.\",\n fix: \"Run Mostra on macOS, a glibc-based Linux or Windows, with an x64 or arm64 processor. On Alpine Linux, use a glibc-based image instead.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAOA,MAAa,0BAA0B,CACrC,6BAEF;;AAMA,MAAa,sBAA2D,EACtE,6BAA6B;CAC3B,UAAU;CACV,OAAO;CACP,OAAO;CACP,MAAM;CACN,MAAM;EACJ,aACE;EACF,KAAK;CACP;AACF,EAEF"}
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { AnyBridgeMessage, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX,
7
7
  import { ArtifactId, CommentId, Cursor, DeliveryId, GeneratedIdKind, Id, IdBody, IdKind, IdPrefix, MutationId, RunId, SubmissionId, ThreadId, TokenId, VersionId, VersionIdKind, ViewId, ViewerId } from "./ids.js";
8
8
  import { Actor, DeliveryState, DeliveryStatus, DocumentRevision, EventFilter, EventRecord, EventTypePattern, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldScope, FieldState, MutationResult, Rect, ResultComment, Results, SIGNAL_NAME_PATTERN, SubmissionSummary, Viewer, ViewerKind, ViewerSpec, Viewport, WaitCondition, isFieldId } from "./interaction.js";
9
9
  import { BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, CarryOver, ChooseRequest, DocumentSnapshot, FieldsRequest, FollowRequest, FrameTicket, OrphanedField, PollResult, SIGNAL_PAYLOAD_MAX_BYTES, ShellSubmitRequest, SignalRequest, StreamSnapshot, SubmitRequest } from "./browser.js";
10
- import { BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatform, BundlePlatformSchema, BundleSetup, bundleAssetName } from "./bundle.js";
10
+ import { BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatform, BundlePlatformSchema, BundleSetup, bundleAssetName, isWindowsBundle } from "./bundle.js";
11
11
  import { canonicalJson } from "./canonical.js";
12
12
  import { ALL_SCOPES, CapabilityScope, Duration, durationMs, normalizeScopes, scopeAllows } from "./capability.js";
13
13
  import { DIAGNOSTIC_AREAS, Diagnostic, DiagnosticArea, DiagnosticCode, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity } from "./diagnostics/diagnostic.js";
@@ -85,4 +85,4 @@ import { JSON_RPC_ERROR_CODES, RpcError } from "./rpc/error.js";
85
85
  import { LineSplitter, MAX_LINE_LENGTH, encodeLine } from "./rpc/lines.js";
86
86
  import { RpcPeer, RpcPeerOptions, RpcRequestContext, RpcRequestOptions, parseParams } from "./rpc/peer.js";
87
87
  import { CallContext, DEFAULT_WORKER_LIMITS, LiveSourceInfo, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, ServerStatePatchResult, WORKER_CHANNEL_REVISION, WORKER_METHODS, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerCancelParams, WorkerLimits, WorkerLiveParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerVersionRef } from "./worker.js";
88
- export { type A11yDiagnosticCode, ACTION_ARGS_MAX, ACTION_RESULT_MAX, ALL_SCOPES, ARGUMENT_BIGINT_DIGITS_MAX, ARTIFACT_MANIFEST_KEYS, ARTIFACT_PROGRESS, type ActionDiagnosticCode, ActionError, Actor, AddedPackage, type AnyBridgeMessage, type AnyFunction, type AnyMethod, type AnyNotification, type AreaCatalog, type ArtifactCreateParams, type ArtifactCreateResult, ArtifactDetail, type ArtifactDiagnosticCode, type ArtifactFamily, type ArtifactGetParams, type ArtifactGetResult, ArtifactId, ArtifactLink, type ArtifactListFilter, type ArtifactListParams, type ArtifactListResult, ArtifactManifest, ArtifactProgressParams, type ArtifactPublishParams, type ArtifactPublishResult, ArtifactRef, ArtifactSummary, type ArtifactVerifyParams, type ArtifactVerifyResult, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, Batches, type Bridge, type BridgeEvent, type BridgeHostContext, type BridgeImplementation, type BridgeMessage, type BridgeOptions, type BridgePeer, type BridgeReceiver, type BridgeRejection, type BridgeSide, type BuildDiagnosticCode, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, type BundlePlatform, BundlePlatformSchema, BundleSetup, CLI_CLIENT_NAME, CONTROL_LABEL_MAX, CSRF_HEADER, type CallContext, type CallLine, CallRequest, CapabilityLink, CapabilityScope, CarryOver, ChildProcessStatus, ChooseRequest, type ClassifiedMessage, type CliDiagnosticCode, ClientCapabilities, ClientInfo, CommentId, type CompareRequest, type CompareResult, type ConsoleDiagnosticCode, type ControlRequest, ControlsPolicy, type CreateDiagnosticOptions, Cursor, DEFAULT_DOCS_BASE, DEFAULT_VIEWPORTS, DEFAULT_WORKER_LIMITS, DEV_NOTIFY, DIAGNOSTIC_AREAS, DeliveryCounts, DeliveryId, type DeliveryState, DeliveryStatus, type DeliveryTarget, type DemoSpec, type DepDiagnosticCode, DependencyPolicy, type DepsAddParams, type DepsAddResult, type DevEventKind, DevNotifyParams, type DevStartParams, type DevStartResult, type DevStopParams, type DevStopResult, Diagnostic, type DiagnosticArea, type DiagnosticCode, type DiagnosticDetails, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity, type DiagnosticSpec, DocumentRevision, DocumentSnapshot, DraftMirror, type DraftsMirrorResult, Duration, EVENTS_NOTIFY, EVENTS_READ_MAX, type EnvDiagnosticCode, type EphemeralMessage, EventFilter, EventRecord, EventTypePattern, type EventsAckParams, type EventsAckResult, EventsNotifyParams, type EventsReadParams, type EventsReadResult, type EventsSubscribeParams, type EventsSubscribeResult, type EventsUnsubscribeParams, type EventsUnsubscribeResult, FIELD_ID_MAX_LENGTH, FieldConflict, type FieldDiagnosticCode, FieldOp, type FieldRegistration, type FieldScope, FieldState, type FieldsParams, FieldsRequest, type FlushResult, FollowRequest, type Frame, FrameTicket, GatewayStatus, type GcCompactEvents, type GcCompacted, type GcCount, type GcRunParams, type GcRunResult, type GcVersion, type GeneratedIdKind, HOST_PROTOCOL_REVISIONS, HomeConfig, type HomeDiagnosticCode, type HostDiagnosticCode, type HygieneDiagnosticCode, type Id, type IdBody, type IdKind, type IdPrefix, type IdentityVia, InstanceCapabilities, type InstanceCheck, type InstanceCheckParams, type InstanceCheckResult, InstanceInfo, type InstanceStatusParams, type InstanceStatusResult, JSON_RPC_ERROR_CODES, JsonRpcErrorObject, JsonRpcFailure, type JsonRpcId, type JsonRpcMessage, JsonRpcNotification, type JsonRpcParams, JsonRpcRequest, type JsonRpcResponse, JsonRpcSuccess, type KnownDiagnosticCode, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LineSplitter, type LiveDiagnosticCode, type LivePushParams, type LivePushResult, LiveRequest, type LiveSourceInfo, type LiveState, type LiveUpdate, MAX_LINE_LENGTH, MCP_APPS_PROTOCOL_VERSION, type ManifestDiagnosticCode, type MethodDefinition, type MethodDirection, type MostraInitializeParams, type MostraInitializeResult, type MostraShutdownParams, type MostraShutdownResult, MutationId, MutationResult, type NetworkDiagnosticCode, type NotificationDefinition, OPEN_LINK_SCHEMES, OrphanedField, type PlatformDiagnosticCode, PollResult, type PortIdentityResolveParams, type PortIdentityResolveResult, PortName, type PortSecretsGetParams, type PortSecretsGetResult, type PortTrustedControlsActivatedParams, type PortTrustedControlsActivatedResult, type PortTrustedControlsPolicyParams, type PortTrustedControlsPolicyResult, type ProbedField, type PublishDiagnosticCode, PublishReceipt, REVIEW_SET_ID_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, type Rect, type Refusal, type RegressionDiagnosticCode, RemoteError, type RenderRequest, type RenderResult, type RequestFacts, type RequestIntent, type RequestPolicy, ResultComment, Results, type ResultsGetParams, type ResultsGetResult, ResultsMarkdown, Revision, type RevisionNegotiation, RpcError, RpcPeer, type RpcPeerOptions, type RpcRequestContext, type RpcRequestOptions, RunAttachRequest, RunCancelRequest, type RunDelta, RunId, RunProgress, type RunReason, RunRequest, RunState, type RunStatus, type RuntimeDiagnosticCode, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, SIGNAL_NAME_PATTERN, SIGNAL_PAYLOAD_MAX_BYTES, type SaveState, ScreenshotPolicy, type SecretDeleteParams, type SecretDeleteResult, type SecretDiagnosticCode, SecretEntry, type SecretListParams, type SecretListResult, type SecretSetParams, type SecretSetResult, SerializationError, type SerializeMode, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, type ServerStatePatchResult, ShellSubmitRequest, SignalRequest, type SmokeDiagnosticCode, SourceRef, type StateGetParams, type StateGetResult, type StatePatchParams, type StatePatchResult, StreamSnapshot, SubmissionEnvelope, SubmissionId, SubmissionPolicy, SubmissionSummary, type SubmissionsDeliverResult, type SubmitBlocker, SubmitChannel, type SubmitDiagnosticCode, SubmitRequest, type TargetDiagnosticCode, type TerminalSpec, ThreadId, type TokenEstimate, TokenId, TrustedControl, type TypeDiagnosticCode, UNSERIALIZABLE_CODE, type UiInitializeParams, type UiInitializeResult, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, ValueReader, type ValueReaderOptions, ValueWriter, type ValueWriterOptions, type VerdictAria, type VerdictScreenshot, type VerifyDiagnosticCode, VerifyVerdict, type VerifyViewport, type VersionAvailableParams, VersionId, type VersionIdKind, VersionRef, VersionSummary, ViewContext, ViewContextWire, type ViewDefaultParams, type ViewDefaultResult, ViewId, type ViewLaunchParams, type ViewLaunchResult, type ViewRevokeParams, type ViewRevokeResult, type ViewRotateParams, type ViewRotateResult, type ViewUrlParams, type ViewUrlResult, Viewer, ViewerId, type ViewerKind, ViewerSpec, type Viewport, WAIT_MAX_MS, WORKER_CHANNEL_REVISION, WORKER_METHODS, WaitCondition, type WaitParams, type WaitResult, type WireError, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, type WorkerCancelParams, type WorkerLimits, type WorkerLiveParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerStatus, WorkerVersionRef, a11yDiagnosticCodes, actionDiagnosticCodes, ariaSummary, artifactCreateMethod, artifactDiagnosticCodes, artifactGetMethod, artifactListMethod, artifactPublishMethod, artifactVerifyMethod, buildDiagnosticCodes, bundleAssetName, canonicalJson, checkArgumentFrames, checkRequest, classifyMessage, cliDiagnosticCodes, connectBridge, consoleDiagnosticCodes, createDiagnostic, defineMethod, depDiagnosticCodes, depsAddMethod, deserializeAll, devStartMethod, devStopMethod, diagnosticCatalog, docsUrl, durationMs, encodeLine, envDiagnosticCodes, estimateImageTokens, eventsAckMethod, eventsReadMethod, eventsSubscribeMethod, eventsUnsubscribeMethod, fieldDiagnosticCodes, fromBase64, gcRunMethod, headerValue, homeDiagnosticCodes, hostDiagnosticCodes, hostMethods, hostNotifications, hygieneDiagnosticCodes, instanceCheckMethod, instanceStatusMethod, isFieldId, isFinalRunStatus, isJsonContentType, liveDiagnosticCodes, livePushMethod, manifestDiagnosticCodes, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraInitializeMethod, mostraPage, mostraReady, mostraShutdownMethod, mostraVersionAvailable, negotiateRevision, networkDiagnosticCodes, normalizeScopes, parseParams, platformDiagnosticCodes, portDraftsMirrorMethod, portIdentityResolveMethod, portSecretsGetMethod, portSubmissionsDeliverMethod, portTrustedControlsActivatedMethod, portTrustedControlsPolicyMethod, publishDiagnosticCodes, readViewContext, receivable, refusal, regressionDiagnosticCodes, resultsGetMethod, runtimeDiagnosticCodes, safeEqual, safePath, scopeAllows, secretDeleteMethod, secretDiagnosticCodes, secretListMethod, secretSetMethod, serializeAll, smokeDiagnosticCodes, stateGetMethod, statePatchMethod, submitDiagnosticCodes, targetDiagnosticCodes, toBase64, typeDiagnosticCodes, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged, verifyDiagnosticCodes, viewDefaultMethod, viewLaunchMethod, viewRevokeMethod, viewRotateMethod, viewUrlMethod, viewportsFor, waitMethod, wireError };
88
+ export { type A11yDiagnosticCode, ACTION_ARGS_MAX, ACTION_RESULT_MAX, ALL_SCOPES, ARGUMENT_BIGINT_DIGITS_MAX, ARTIFACT_MANIFEST_KEYS, ARTIFACT_PROGRESS, type ActionDiagnosticCode, ActionError, Actor, AddedPackage, type AnyBridgeMessage, type AnyFunction, type AnyMethod, type AnyNotification, type AreaCatalog, type ArtifactCreateParams, type ArtifactCreateResult, ArtifactDetail, type ArtifactDiagnosticCode, type ArtifactFamily, type ArtifactGetParams, type ArtifactGetResult, ArtifactId, ArtifactLink, type ArtifactListFilter, type ArtifactListParams, type ArtifactListResult, ArtifactManifest, ArtifactProgressParams, type ArtifactPublishParams, type ArtifactPublishResult, ArtifactRef, ArtifactSummary, type ArtifactVerifyParams, type ArtifactVerifyResult, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, Batches, type Bridge, type BridgeEvent, type BridgeHostContext, type BridgeImplementation, type BridgeMessage, type BridgeOptions, type BridgePeer, type BridgeReceiver, type BridgeRejection, type BridgeSide, type BuildDiagnosticCode, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, type BundlePlatform, BundlePlatformSchema, BundleSetup, CLI_CLIENT_NAME, CONTROL_LABEL_MAX, CSRF_HEADER, type CallContext, type CallLine, CallRequest, CapabilityLink, CapabilityScope, CarryOver, ChildProcessStatus, ChooseRequest, type ClassifiedMessage, type CliDiagnosticCode, ClientCapabilities, ClientInfo, CommentId, type CompareRequest, type CompareResult, type ConsoleDiagnosticCode, type ControlRequest, ControlsPolicy, type CreateDiagnosticOptions, Cursor, DEFAULT_DOCS_BASE, DEFAULT_VIEWPORTS, DEFAULT_WORKER_LIMITS, DEV_NOTIFY, DIAGNOSTIC_AREAS, DeliveryCounts, DeliveryId, type DeliveryState, DeliveryStatus, type DeliveryTarget, type DemoSpec, type DepDiagnosticCode, DependencyPolicy, type DepsAddParams, type DepsAddResult, type DevEventKind, DevNotifyParams, type DevStartParams, type DevStartResult, type DevStopParams, type DevStopResult, Diagnostic, type DiagnosticArea, type DiagnosticCode, type DiagnosticDetails, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity, type DiagnosticSpec, DocumentRevision, DocumentSnapshot, DraftMirror, type DraftsMirrorResult, Duration, EVENTS_NOTIFY, EVENTS_READ_MAX, type EnvDiagnosticCode, type EphemeralMessage, EventFilter, EventRecord, EventTypePattern, type EventsAckParams, type EventsAckResult, EventsNotifyParams, type EventsReadParams, type EventsReadResult, type EventsSubscribeParams, type EventsSubscribeResult, type EventsUnsubscribeParams, type EventsUnsubscribeResult, FIELD_ID_MAX_LENGTH, FieldConflict, type FieldDiagnosticCode, FieldOp, type FieldRegistration, type FieldScope, FieldState, type FieldsParams, FieldsRequest, type FlushResult, FollowRequest, type Frame, FrameTicket, GatewayStatus, type GcCompactEvents, type GcCompacted, type GcCount, type GcRunParams, type GcRunResult, type GcVersion, type GeneratedIdKind, HOST_PROTOCOL_REVISIONS, HomeConfig, type HomeDiagnosticCode, type HostDiagnosticCode, type HygieneDiagnosticCode, type Id, type IdBody, type IdKind, type IdPrefix, type IdentityVia, InstanceCapabilities, type InstanceCheck, type InstanceCheckParams, type InstanceCheckResult, InstanceInfo, type InstanceStatusParams, type InstanceStatusResult, JSON_RPC_ERROR_CODES, JsonRpcErrorObject, JsonRpcFailure, type JsonRpcId, type JsonRpcMessage, JsonRpcNotification, type JsonRpcParams, JsonRpcRequest, type JsonRpcResponse, JsonRpcSuccess, type KnownDiagnosticCode, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LineSplitter, type LiveDiagnosticCode, type LivePushParams, type LivePushResult, LiveRequest, type LiveSourceInfo, type LiveState, type LiveUpdate, MAX_LINE_LENGTH, MCP_APPS_PROTOCOL_VERSION, type ManifestDiagnosticCode, type MethodDefinition, type MethodDirection, type MostraInitializeParams, type MostraInitializeResult, type MostraShutdownParams, type MostraShutdownResult, MutationId, MutationResult, type NetworkDiagnosticCode, type NotificationDefinition, OPEN_LINK_SCHEMES, OrphanedField, type PlatformDiagnosticCode, PollResult, type PortIdentityResolveParams, type PortIdentityResolveResult, PortName, type PortSecretsGetParams, type PortSecretsGetResult, type PortTrustedControlsActivatedParams, type PortTrustedControlsActivatedResult, type PortTrustedControlsPolicyParams, type PortTrustedControlsPolicyResult, type ProbedField, type PublishDiagnosticCode, PublishReceipt, REVIEW_SET_ID_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, type Rect, type Refusal, type RegressionDiagnosticCode, RemoteError, type RenderRequest, type RenderResult, type RequestFacts, type RequestIntent, type RequestPolicy, ResultComment, Results, type ResultsGetParams, type ResultsGetResult, ResultsMarkdown, Revision, type RevisionNegotiation, RpcError, RpcPeer, type RpcPeerOptions, type RpcRequestContext, type RpcRequestOptions, RunAttachRequest, RunCancelRequest, type RunDelta, RunId, RunProgress, type RunReason, RunRequest, RunState, type RunStatus, type RuntimeDiagnosticCode, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, SIGNAL_NAME_PATTERN, SIGNAL_PAYLOAD_MAX_BYTES, type SaveState, ScreenshotPolicy, type SecretDeleteParams, type SecretDeleteResult, type SecretDiagnosticCode, SecretEntry, type SecretListParams, type SecretListResult, type SecretSetParams, type SecretSetResult, SerializationError, type SerializeMode, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, type ServerStatePatchResult, ShellSubmitRequest, SignalRequest, type SmokeDiagnosticCode, SourceRef, type StateGetParams, type StateGetResult, type StatePatchParams, type StatePatchResult, StreamSnapshot, SubmissionEnvelope, SubmissionId, SubmissionPolicy, SubmissionSummary, type SubmissionsDeliverResult, type SubmitBlocker, SubmitChannel, type SubmitDiagnosticCode, SubmitRequest, type TargetDiagnosticCode, type TerminalSpec, ThreadId, type TokenEstimate, TokenId, TrustedControl, type TypeDiagnosticCode, UNSERIALIZABLE_CODE, type UiInitializeParams, type UiInitializeResult, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, ValueReader, type ValueReaderOptions, ValueWriter, type ValueWriterOptions, type VerdictAria, type VerdictScreenshot, type VerifyDiagnosticCode, VerifyVerdict, type VerifyViewport, type VersionAvailableParams, VersionId, type VersionIdKind, VersionRef, VersionSummary, ViewContext, ViewContextWire, type ViewDefaultParams, type ViewDefaultResult, ViewId, type ViewLaunchParams, type ViewLaunchResult, type ViewRevokeParams, type ViewRevokeResult, type ViewRotateParams, type ViewRotateResult, type ViewUrlParams, type ViewUrlResult, Viewer, ViewerId, type ViewerKind, ViewerSpec, type Viewport, WAIT_MAX_MS, WORKER_CHANNEL_REVISION, WORKER_METHODS, WaitCondition, type WaitParams, type WaitResult, type WireError, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, type WorkerCancelParams, type WorkerLimits, type WorkerLiveParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerStatus, WorkerVersionRef, a11yDiagnosticCodes, actionDiagnosticCodes, ariaSummary, artifactCreateMethod, artifactDiagnosticCodes, artifactGetMethod, artifactListMethod, artifactPublishMethod, artifactVerifyMethod, buildDiagnosticCodes, bundleAssetName, canonicalJson, checkArgumentFrames, checkRequest, classifyMessage, cliDiagnosticCodes, connectBridge, consoleDiagnosticCodes, createDiagnostic, defineMethod, depDiagnosticCodes, depsAddMethod, deserializeAll, devStartMethod, devStopMethod, diagnosticCatalog, docsUrl, durationMs, encodeLine, envDiagnosticCodes, estimateImageTokens, eventsAckMethod, eventsReadMethod, eventsSubscribeMethod, eventsUnsubscribeMethod, fieldDiagnosticCodes, fromBase64, gcRunMethod, headerValue, homeDiagnosticCodes, hostDiagnosticCodes, hostMethods, hostNotifications, hygieneDiagnosticCodes, instanceCheckMethod, instanceStatusMethod, isFieldId, isFinalRunStatus, isJsonContentType, isWindowsBundle, liveDiagnosticCodes, livePushMethod, manifestDiagnosticCodes, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraInitializeMethod, mostraPage, mostraReady, mostraShutdownMethod, mostraVersionAvailable, negotiateRevision, networkDiagnosticCodes, normalizeScopes, parseParams, platformDiagnosticCodes, portDraftsMirrorMethod, portIdentityResolveMethod, portSecretsGetMethod, portSubmissionsDeliverMethod, portTrustedControlsActivatedMethod, portTrustedControlsPolicyMethod, publishDiagnosticCodes, readViewContext, receivable, refusal, regressionDiagnosticCodes, resultsGetMethod, runtimeDiagnosticCodes, safeEqual, safePath, scopeAllows, secretDeleteMethod, secretDiagnosticCodes, secretListMethod, secretSetMethod, serializeAll, smokeDiagnosticCodes, stateGetMethod, statePatchMethod, submitDiagnosticCodes, targetDiagnosticCodes, toBase64, typeDiagnosticCodes, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged, verifyDiagnosticCodes, viewDefaultMethod, viewLaunchMethod, viewRevokeMethod, viewRotateMethod, viewUrlMethod, viewportsFor, waitMethod, wireError };
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import { ControlsPolicy, REVIEW_SET_ID_PATTERN, SubmitChannel, TrustedControl, V
12
12
  import { BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, CONTROL_LABEL_MAX, MCP_APPS_PROTOCOL_VERSION, OPEN_LINK_SCHEMES, connectBridge, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraPage, mostraReady, mostraVersionAvailable, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged } from "./bridge.js";
13
13
  import { Actor, DeliveryStatus, DocumentRevision, EventFilter, EventRecord, EventTypePattern, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldState, MutationResult, ResultComment, Results, SIGNAL_NAME_PATTERN, SubmissionSummary, Viewer, ViewerSpec, WaitCondition, isFieldId } from "./interaction.js";
14
14
  import { BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, CarryOver, ChooseRequest, DocumentSnapshot, FieldsRequest, FollowRequest, FrameTicket, OrphanedField, PollResult, SIGNAL_PAYLOAD_MAX_BYTES, ShellSubmitRequest, SignalRequest, StreamSnapshot, SubmitRequest } from "./browser.js";
15
- import { BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatformSchema, BundleSetup, bundleAssetName } from "./bundle.js";
15
+ import { BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatformSchema, BundleSetup, bundleAssetName, isWindowsBundle } from "./bundle.js";
16
16
  import { canonicalJson } from "./canonical.js";
17
17
  import { ALL_SCOPES, CapabilityScope, Duration, durationMs, normalizeScopes, scopeAllows } from "./capability.js";
18
18
  import { a11yDiagnosticCodes } from "./diagnostics/codes/a11y.js";
@@ -85,4 +85,4 @@ import { hostMethods, hostNotifications } from "./methods/index.js";
85
85
  import { LineSplitter, MAX_LINE_LENGTH, encodeLine } from "./rpc/lines.js";
86
86
  import { ARGUMENT_BIGINT_DIGITS_MAX, RemoteError, SerializationError, UNSERIALIZABLE_CODE, ValueReader, ValueWriter, checkArgumentFrames, deserializeAll, fromBase64, serializeAll, toBase64, wireError } from "./serializer.js";
87
87
  import { DEFAULT_WORKER_LIMITS, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, WORKER_CHANNEL_REVISION, WORKER_METHODS, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerVersionRef } from "./worker.js";
88
- export { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ALL_SCOPES, ARGUMENT_BIGINT_DIGITS_MAX, ARTIFACT_MANIFEST_KEYS, ARTIFACT_PROGRESS, ActionError, Actor, AddedPackage, ArtifactDetail, ArtifactId, ArtifactLink, ArtifactManifest, ArtifactProgressParams, ArtifactRef, ArtifactSummary, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, Batches, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatformSchema, BundleSetup, CLI_CLIENT_NAME, CONTROL_LABEL_MAX, CSRF_HEADER, CallRequest, CapabilityLink, CapabilityScope, CarryOver, ChildProcessStatus, ChooseRequest, ClientCapabilities, ClientInfo, CommentId, ControlsPolicy, Cursor, DEFAULT_DOCS_BASE, DEFAULT_VIEWPORTS, DEFAULT_WORKER_LIMITS, DEV_NOTIFY, DIAGNOSTIC_AREAS, DeliveryCounts, DeliveryId, DeliveryStatus, DependencyPolicy, DevNotifyParams, Diagnostic, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity, DocumentRevision, DocumentSnapshot, DraftMirror, Duration, EVENTS_NOTIFY, EVENTS_READ_MAX, EventFilter, EventRecord, EventTypePattern, EventsNotifyParams, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldState, FieldsRequest, FollowRequest, FrameTicket, GatewayStatus, HOST_PROTOCOL_REVISIONS, HomeConfig, InstanceCapabilities, InstanceInfo, JSON_RPC_ERROR_CODES, JsonRpcErrorObject, JsonRpcFailure, JsonRpcNotification, JsonRpcRequest, JsonRpcSuccess, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LineSplitter, LiveRequest, MAX_LINE_LENGTH, MCP_APPS_PROTOCOL_VERSION, MutationId, MutationResult, OPEN_LINK_SCHEMES, OrphanedField, PollResult, PortName, PublishReceipt, REVIEW_SET_ID_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RemoteError, ResultComment, Results, ResultsMarkdown, Revision, RpcError, RpcPeer, RunAttachRequest, RunCancelRequest, RunId, RunProgress, RunRequest, RunState, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, SIGNAL_NAME_PATTERN, SIGNAL_PAYLOAD_MAX_BYTES, ScreenshotPolicy, SecretEntry, SerializationError, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, ShellSubmitRequest, SignalRequest, SourceRef, StreamSnapshot, SubmissionEnvelope, SubmissionId, SubmissionPolicy, SubmissionSummary, SubmitChannel, SubmitRequest, ThreadId, TokenId, TrustedControl, UNSERIALIZABLE_CODE, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, ValueReader, ValueWriter, VerifyVerdict, VersionId, VersionRef, VersionSummary, ViewContext, ViewContextWire, ViewId, Viewer, ViewerId, ViewerSpec, WAIT_MAX_MS, WORKER_CHANNEL_REVISION, WORKER_METHODS, WaitCondition, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerStatus, WorkerVersionRef, a11yDiagnosticCodes, actionDiagnosticCodes, ariaSummary, artifactCreateMethod, artifactDiagnosticCodes, artifactGetMethod, artifactListMethod, artifactPublishMethod, artifactVerifyMethod, buildDiagnosticCodes, bundleAssetName, canonicalJson, checkArgumentFrames, checkRequest, classifyMessage, cliDiagnosticCodes, connectBridge, consoleDiagnosticCodes, createDiagnostic, defineMethod, depDiagnosticCodes, depsAddMethod, deserializeAll, devStartMethod, devStopMethod, diagnosticCatalog, docsUrl, durationMs, encodeLine, envDiagnosticCodes, estimateImageTokens, eventsAckMethod, eventsReadMethod, eventsSubscribeMethod, eventsUnsubscribeMethod, fieldDiagnosticCodes, fromBase64, gcRunMethod, headerValue, homeDiagnosticCodes, hostDiagnosticCodes, hostMethods, hostNotifications, hygieneDiagnosticCodes, instanceCheckMethod, instanceStatusMethod, isFieldId, isFinalRunStatus, isJsonContentType, liveDiagnosticCodes, livePushMethod, manifestDiagnosticCodes, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraInitializeMethod, mostraPage, mostraReady, mostraShutdownMethod, mostraVersionAvailable, negotiateRevision, networkDiagnosticCodes, normalizeScopes, parseParams, platformDiagnosticCodes, portDraftsMirrorMethod, portIdentityResolveMethod, portSecretsGetMethod, portSubmissionsDeliverMethod, portTrustedControlsActivatedMethod, portTrustedControlsPolicyMethod, publishDiagnosticCodes, readViewContext, receivable, refusal, regressionDiagnosticCodes, resultsGetMethod, runtimeDiagnosticCodes, safeEqual, safePath, scopeAllows, secretDeleteMethod, secretDiagnosticCodes, secretListMethod, secretSetMethod, serializeAll, smokeDiagnosticCodes, stateGetMethod, statePatchMethod, submitDiagnosticCodes, targetDiagnosticCodes, toBase64, typeDiagnosticCodes, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged, verifyDiagnosticCodes, viewDefaultMethod, viewLaunchMethod, viewRevokeMethod, viewRotateMethod, viewUrlMethod, viewportsFor, waitMethod, wireError };
88
+ export { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ALL_SCOPES, ARGUMENT_BIGINT_DIGITS_MAX, ARTIFACT_MANIFEST_KEYS, ARTIFACT_PROGRESS, ActionError, Actor, AddedPackage, ArtifactDetail, ArtifactId, ArtifactLink, ArtifactManifest, ArtifactProgressParams, ArtifactRef, ArtifactSummary, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, Batches, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatformSchema, BundleSetup, CLI_CLIENT_NAME, CONTROL_LABEL_MAX, CSRF_HEADER, CallRequest, CapabilityLink, CapabilityScope, CarryOver, ChildProcessStatus, ChooseRequest, ClientCapabilities, ClientInfo, CommentId, ControlsPolicy, Cursor, DEFAULT_DOCS_BASE, DEFAULT_VIEWPORTS, DEFAULT_WORKER_LIMITS, DEV_NOTIFY, DIAGNOSTIC_AREAS, DeliveryCounts, DeliveryId, DeliveryStatus, DependencyPolicy, DevNotifyParams, Diagnostic, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity, DocumentRevision, DocumentSnapshot, DraftMirror, Duration, EVENTS_NOTIFY, EVENTS_READ_MAX, EventFilter, EventRecord, EventTypePattern, EventsNotifyParams, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldState, FieldsRequest, FollowRequest, FrameTicket, GatewayStatus, HOST_PROTOCOL_REVISIONS, HomeConfig, InstanceCapabilities, InstanceInfo, JSON_RPC_ERROR_CODES, JsonRpcErrorObject, JsonRpcFailure, JsonRpcNotification, JsonRpcRequest, JsonRpcSuccess, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LineSplitter, LiveRequest, MAX_LINE_LENGTH, MCP_APPS_PROTOCOL_VERSION, MutationId, MutationResult, OPEN_LINK_SCHEMES, OrphanedField, PollResult, PortName, PublishReceipt, REVIEW_SET_ID_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RemoteError, ResultComment, Results, ResultsMarkdown, Revision, RpcError, RpcPeer, RunAttachRequest, RunCancelRequest, RunId, RunProgress, RunRequest, RunState, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, SIGNAL_NAME_PATTERN, SIGNAL_PAYLOAD_MAX_BYTES, ScreenshotPolicy, SecretEntry, SerializationError, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, ShellSubmitRequest, SignalRequest, SourceRef, StreamSnapshot, SubmissionEnvelope, SubmissionId, SubmissionPolicy, SubmissionSummary, SubmitChannel, SubmitRequest, ThreadId, TokenId, TrustedControl, UNSERIALIZABLE_CODE, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, ValueReader, ValueWriter, VerifyVerdict, VersionId, VersionRef, VersionSummary, ViewContext, ViewContextWire, ViewId, Viewer, ViewerId, ViewerSpec, WAIT_MAX_MS, WORKER_CHANNEL_REVISION, WORKER_METHODS, WaitCondition, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerStatus, WorkerVersionRef, a11yDiagnosticCodes, actionDiagnosticCodes, ariaSummary, artifactCreateMethod, artifactDiagnosticCodes, artifactGetMethod, artifactListMethod, artifactPublishMethod, artifactVerifyMethod, buildDiagnosticCodes, bundleAssetName, canonicalJson, checkArgumentFrames, checkRequest, classifyMessage, cliDiagnosticCodes, connectBridge, consoleDiagnosticCodes, createDiagnostic, defineMethod, depDiagnosticCodes, depsAddMethod, deserializeAll, devStartMethod, devStopMethod, diagnosticCatalog, docsUrl, durationMs, encodeLine, envDiagnosticCodes, estimateImageTokens, eventsAckMethod, eventsReadMethod, eventsSubscribeMethod, eventsUnsubscribeMethod, fieldDiagnosticCodes, fromBase64, gcRunMethod, headerValue, homeDiagnosticCodes, hostDiagnosticCodes, hostMethods, hostNotifications, hygieneDiagnosticCodes, instanceCheckMethod, instanceStatusMethod, isFieldId, isFinalRunStatus, isJsonContentType, isWindowsBundle, liveDiagnosticCodes, livePushMethod, manifestDiagnosticCodes, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraInitializeMethod, mostraPage, mostraReady, mostraShutdownMethod, mostraVersionAvailable, negotiateRevision, networkDiagnosticCodes, normalizeScopes, parseParams, platformDiagnosticCodes, portDraftsMirrorMethod, portIdentityResolveMethod, portSecretsGetMethod, portSubmissionsDeliverMethod, portTrustedControlsActivatedMethod, portTrustedControlsPolicyMethod, publishDiagnosticCodes, readViewContext, receivable, refusal, regressionDiagnosticCodes, resultsGetMethod, runtimeDiagnosticCodes, safeEqual, safePath, scopeAllows, secretDeleteMethod, secretDiagnosticCodes, secretListMethod, secretSetMethod, serializeAll, smokeDiagnosticCodes, stateGetMethod, statePatchMethod, submitDiagnosticCodes, targetDiagnosticCodes, toBase64, typeDiagnosticCodes, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged, verifyDiagnosticCodes, viewDefaultMethod, viewLaunchMethod, viewRevokeMethod, viewRotateMethod, viewUrlMethod, viewportsFor, waitMethod, wireError };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mostra/protocol",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Mostra's shared protocol vocabulary: IDs, dated revisions and diagnostics, with Zod schemas and generated JSON Schema.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "The Mostra Authors",
@@ -43,20 +43,20 @@
43
43
  "provenance": true
44
44
  },
45
45
  "dependencies": {
46
- "zod": "4.6.6"
46
+ "zod": "4.6.7"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@mostra/tools": "0.0.0",
50
- "@size-limit/preset-small-lib": "14.1.0",
51
- "@types/node": "24.19.1",
50
+ "@size-limit/preset-small-lib": "14.2.0",
51
+ "@types/node": "24.19.2",
52
52
  "fast-check": "4.10.2",
53
- "react": "19.3.0",
54
- "react-dom": "19.3.0",
55
- "react-server-dom-parcel": "19.3.0",
56
- "size-limit": "14.1.0",
57
- "tsdown": "0.23.0",
53
+ "react": "19.3.1",
54
+ "react-dom": "19.3.1",
55
+ "react-server-dom-parcel": "19.3.1",
56
+ "size-limit": "14.2.0",
57
+ "tsdown": "0.23.1",
58
58
  "typescript": "7.0.2",
59
- "vitest": "5.0.3"
59
+ "vitest": "5.0.5"
60
60
  },
61
61
  "size-limit": [
62
62
  {
@@ -1011,7 +1011,7 @@
1011
1011
  "properties": {
1012
1012
  "file": {
1013
1013
  "type": "string",
1014
- "pattern": "^mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-(darwin|linux)-(arm64|x64)\\.tar\\.gz$"
1014
+ "pattern": "^(?:mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-(darwin|linux)-(arm64|x64)\\.tar\\.gz$|mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-win32-(arm64|x64)\\.tar\\.gz$)"
1015
1015
  },
1016
1016
  "sha256": {
1017
1017
  "$ref": "#/definitions/Sha256"
@@ -1286,7 +1286,9 @@
1286
1286
  "darwin-arm64",
1287
1287
  "darwin-x64",
1288
1288
  "linux-x64",
1289
- "linux-arm64"
1289
+ "linux-arm64",
1290
+ "win32-x64",
1291
+ "win32-arm64"
1290
1292
  ]
1291
1293
  },
1292
1294
  "BundleSetup": {
@@ -1320,6 +1322,10 @@
1320
1322
  },
1321
1323
  "at": {
1322
1324
  "type": "string"
1325
+ },
1326
+ "root": {
1327
+ "type": "string",
1328
+ "minLength": 1
1323
1329
  }
1324
1330
  },
1325
1331
  "required": [
@@ -979,7 +979,7 @@
979
979
  "properties": {
980
980
  "file": {
981
981
  "type": "string",
982
- "pattern": "^mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-(darwin|linux)-(arm64|x64)\\.tar\\.gz$"
982
+ "pattern": "^(?:mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-(darwin|linux)-(arm64|x64)\\.tar\\.gz$|mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-win32-(arm64|x64)\\.tar\\.gz$)"
983
983
  },
984
984
  "sha256": {
985
985
  "$ref": "#/$defs/Sha256"
@@ -1254,7 +1254,9 @@
1254
1254
  "darwin-arm64",
1255
1255
  "darwin-x64",
1256
1256
  "linux-x64",
1257
- "linux-arm64"
1257
+ "linux-arm64",
1258
+ "win32-x64",
1259
+ "win32-arm64"
1258
1260
  ]
1259
1261
  },
1260
1262
  "BundleSetup": {
@@ -1288,6 +1290,10 @@
1288
1290
  },
1289
1291
  "at": {
1290
1292
  "type": "string"
1293
+ },
1294
+ "root": {
1295
+ "type": "string",
1296
+ "minLength": 1
1291
1297
  }
1292
1298
  },
1293
1299
  "required": [
package/src/bundle.ts CHANGED
@@ -11,18 +11,29 @@
11
11
  * files.json BundleFiles: every other file and link of the archive with its SHA-256
12
12
  * node/ the official Node.js distribution for the platform
13
13
  * lib/node_modules/ Mostra's packages (cli, runtime, worker, verify, shell, sdk, warm) and theirs
14
- * bin/ the mostra, mostra-runtime and mostra-setup launchers
14
+ * bin/ the mostra, mostra-runtime and mostra-setup launchers (POSIX scripts, or on
15
+ * Windows `.exe` launchers beside the helpers mostra-win and mostra-win-service)
15
16
  * ```
16
17
  *
18
+ * A Windows archive holds no links: an ordinary Windows user can't create symbolic links, so its
19
+ * `files.json` lists the links, each to a directory inside the bundle, and setup makes each one a
20
+ * junction at the bundle's real path (D153).
21
+ *
17
22
  * The verify browser isn't in the archive: setup downloads the pinned revision through the
18
23
  * bundle's own Playwright and checks every file against `BundleInfo.browser.files` (D142).
19
24
  */
20
25
  import * as z from "zod";
21
26
  import { wireRegistry } from "./wire-registry.ts";
22
27
 
23
- /** The platforms v1 ships a bundle for (D35; Windows follows in v1.1, D120). */
24
- export const BUNDLE_PLATFORMS: readonly ["darwin-arm64", "darwin-x64", "linux-x64", "linux-arm64"] =
25
- ["darwin-arm64", "darwin-x64", "linux-x64", "linux-arm64"];
28
+ /** The platforms v1 ships a bundle for (D35, D146): macOS, glibc Linux and Windows. */
29
+ export const BUNDLE_PLATFORMS: readonly [
30
+ "darwin-arm64",
31
+ "darwin-x64",
32
+ "linux-x64",
33
+ "linux-arm64",
34
+ "win32-x64",
35
+ "win32-arm64",
36
+ ] = ["darwin-arm64", "darwin-x64", "linux-x64", "linux-arm64", "win32-x64", "win32-arm64"];
26
37
 
27
38
  /** One platform a bundle is built for: `<os>-<arch>` as Node names them. */
28
39
  export type BundlePlatform = (typeof BUNDLE_PLATFORMS)[number];
@@ -33,6 +44,11 @@ export const BUNDLE_NAME = "mostra-runtime-bundle";
33
44
  /** The marker setup writes at a bundle's root once its files and its browser are verified. */
34
45
  export const BUNDLE_SETUP_MARKER = ".mostra-setup.json";
35
46
 
47
+ /** Whether a platform's bundle is a Windows one, whose links setup makes as junctions (D153). */
48
+ export function isWindowsBundle(platform: BundlePlatform): boolean {
49
+ return platform.startsWith("win32-");
50
+ }
51
+
36
52
  /** The archive a release attaches for a version and platform. */
37
53
  export function bundleAssetName(version: string, platform: BundlePlatform): string {
38
54
  return `mostra-${version}-${platform}.tar.gz`;
@@ -79,7 +95,10 @@ export const BundleFileEntry: z.ZodType<BundleFileEntry> = z
79
95
  })
80
96
  .register(wireRegistry, { id: "BundleFileEntry" });
81
97
 
82
- /** One symbolic link of a bundle. Its target is relative and resolves inside the bundle. */
98
+ /**
99
+ * One symbolic link of a bundle. Its target is relative and resolves inside the bundle. In a
100
+ * Windows bundle every link names a directory, and setup makes it a junction (D153).
101
+ */
83
102
  export interface BundleLinkEntry {
84
103
  /** The link itself, relative to the bundle's root. */
85
104
  readonly path: string;
@@ -199,7 +218,10 @@ export const BundleAsset: z.ZodType<BundleAsset> = z
199
218
  // (Opus review finding 8), and `BundlePins` checks it names its release and platform.
200
219
  file: z
201
220
  .string()
202
- .regex(/^mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-(darwin|linux)-(arm64|x64)\.tar\.gz$/),
221
+ // Widened for Windows as the schema gate can prove: the old pattern is one alternative.
222
+ .regex(
223
+ /^(?:mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-(darwin|linux)-(arm64|x64)\.tar\.gz$|mostra-[0-9A-Za-z][0-9A-Za-z.+-]*-win32-(arm64|x64)\.tar\.gz$)/,
224
+ ),
203
225
  sha256,
204
226
  size: z.int().positive(),
205
227
  unpackedSize: z.int().positive(),
@@ -249,6 +271,12 @@ export interface BundleSetup {
249
271
  readonly browser: { readonly revision: string };
250
272
  /** When setup finished (RFC 3339). */
251
273
  readonly at: string;
274
+ /**
275
+ * The bundle's real path when setup ran. A Windows bundle's junctions name their targets by
276
+ * absolute path, so a Windows bundle whose marker names another root (it was moved or copied)
277
+ * is set up again, which makes its junctions afresh (D153). Absent in markers before WP-W3.
278
+ */
279
+ readonly root?: string;
252
280
  }
253
281
 
254
282
  /** The setup marker's schema. */
@@ -260,5 +288,6 @@ export const BundleSetup: z.ZodType<BundleSetup> = z
260
288
  files: sha256,
261
289
  browser: z.object({ revision: z.string().min(1) }),
262
290
  at: z.string(),
291
+ root: z.string().min(1).exactOptional(),
263
292
  })
264
293
  .register(wireRegistry, { id: "BundleSetup" });
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Diagnostic codes of the PLATFORM area: the operating systems and architectures Mostra runs on
3
- * (D35, RT-07).
3
+ * (D35, D146, RT-07).
4
4
  */
5
5
  import type { AreaCatalog } from "../spec.ts";
6
6
 
@@ -19,11 +19,11 @@ export const platformDiagnostics: AreaCatalog<PlatformDiagnosticCode> = {
19
19
  severity: "error",
20
20
  phase: "platform",
21
21
  title: "Unsupported platform",
22
- hint: "Run Mostra on macOS or Linux, on an x64 or arm64 machine.",
22
+ hint: "Run Mostra on macOS, glibc-based Linux or Windows, on an x64 or arm64 machine.",
23
23
  docs: {
24
24
  explanation:
25
- "Mostra runs on macOS and Linux, on x64 and arm64. On any other operating system or architecture every entry point stops with this code before it creates or changes anything, because the process model, the control endpoint and storage are built and tested only there. Windows on x64 and arm64 is being added and runs only in Mostra's own development builds until it is complete; a release stops there with this code too. The message names the platform that was detected.",
26
- fix: "Run Mostra on a macOS or Linux machine with an x64 or arm64 processor. Windows support arrives in a 1.0 release.",
25
+ "Mostra runs on macOS, Linux with glibc and Windows, each on x64 and arm64. On any other operating system or architecture (32-bit Windows, musl-based Linux such as Alpine, BSDs) every entry point stops with this code before it creates or changes anything, because the process model, the control endpoint, storage and the runtime bundle are built and tested only on those platforms. The message names the platform that was detected.",
26
+ fix: "Run Mostra on macOS, a glibc-based Linux or Windows, with an x64 or arm64 processor. On Alpine Linux, use a glibc-based image instead.",
27
27
  },
28
28
  },
29
29
  // gen:entries
package/src/index.ts CHANGED
@@ -123,6 +123,7 @@ export {
123
123
  BundlePlatformSchema,
124
124
  BundleSetup,
125
125
  bundleAssetName,
126
+ isWindowsBundle,
126
127
  } from "./bundle.ts";
127
128
  export { canonicalJson } from "./canonical.ts";
128
129
  export {