@mostra/protocol 0.4.0 → 0.6.0
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 +14 -3
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +18 -6
- package/dist/bundle.js.map +1 -1
- package/dist/diagnostics/codes/host-core.d.ts +1 -0
- package/dist/diagnostics/codes/host-core.js +68 -0
- package/dist/diagnostics/codes/host-core.js.map +1 -0
- package/dist/diagnostics/codes/host.d.ts.map +1 -1
- package/dist/diagnostics/codes/host.js +6 -61
- package/dist/diagnostics/codes/host.js.map +1 -1
- package/dist/diagnostics/codes/index.js +1 -1
- package/dist/diagnostics/codes/platform.js +3 -3
- package/dist/diagnostics/codes/platform.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -3
- package/dist/receive.d.ts +24 -0
- package/dist/receive.d.ts.map +1 -0
- package/dist/receive.js +137 -0
- package/dist/receive.js.map +1 -0
- package/dist/rpc/error.d.ts +1 -1
- package/dist/rpc/error.d.ts.map +1 -1
- package/dist/rpc/error.js +4 -4
- package/dist/rpc/error.js.map +1 -1
- package/dist/rpc/peer.d.ts +3 -1
- package/dist/rpc/peer.d.ts.map +1 -1
- package/dist/rpc/peer.js +5 -2
- package/dist/rpc/peer.js.map +1 -1
- package/package.json +4 -4
- package/schemas/protocol.draft-07.json +8 -2
- package/schemas/protocol.schema.json +8 -2
- package/src/bundle.ts +35 -6
- package/src/diagnostics/codes/host-core.ts +87 -0
- package/src/diagnostics/codes/host.ts +6 -67
- package/src/diagnostics/codes/platform.ts +4 -4
- package/src/index.ts +2 -0
- package/src/receive.ts +176 -0
- package/src/rpc/error.ts +8 -5
- package/src/rpc/peer.ts +5 -2
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
|
|
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
|
-
/**
|
|
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>;
|
package/dist/bundle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","names":[],"sources":["../src/bundle.ts"],"mappings":";;;
|
|
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
|
|
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
|
package/dist/bundle.js.map
CHANGED
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,mBACX;CAAC;CAAgB;CAAc;CAAa;AAAa;;AAM3D,MAAa,cAAc;;AAG3B,MAAa,sBAAsB;;AAGnC,SAAgB,gBAAgB,SAAiB,UAAkC;CACjF,OAAO,UAAU,QAAQ,GAAG,SAAS;AACvC;AAEA,MAAM,SAA4B,EAC/B,OAAO,CAAC,CACR,MAAM,gBAAgB,CAAC,CACvB,SAAS,cAAc;CAAE,IAAI;CAAU,aAAa;AAAqC,CAAC;;;;;AAM7F,MAAM,aAAgC,EACnC,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,MAAM,SAAS;;AAGlB,MAAa,uBAAkD,EAC5D,KAAK,gBAAgB,CAAC,CACtB,SAAS,cAAc,EAAE,IAAI,iBAAiB,CAAC;;AAelD,MAAa,kBAA8C,EACxD,OAAO;CACN,MAAM;CACN,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;CACnB;CACA,YAAY,EAAE,QAAQ;AACxB,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,kBAAkB,CAAC;;AAWnD,MAAa,kBAA8C,EACxD,OAAO;CAAE,MAAM;CAAY,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;AAAE,CAAC,CAAC,CACvD,SAAS,cAAc,EAAE,IAAI,kBAAkB,CAAC;;AAanD,MAAa,cAAsC,EAChD,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC;CAC1B,OAAO,EAAE,MAAM,eAAe;CAC9B,OAAO,EAAE,MAAM,eAAe;AAChC,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,cAAc,CAAC;;AAiB/C,MAAa,gBAA0C,EACpD,OAAO;CACN,MAAM,EAAE,QAAQ,yBAAyB;CACzC,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC1B,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAChC,WAAW;CACX,OAAO,EAAE,MAAM,eAAe;AAChC,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,gBAAgB,CAAC;;AAgCjD,MAAa,aAAoC,EAC9C,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC;CAC1B,MAAM,EAAE,QAAQ,WAAW;CAC3B,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACzB,UAAU;CACV,MAAM,EAAE,OAAO;EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;EAAG,MAAM;CAAW,CAAC;CAC/D,SAAS,EAAE,OAAO;EAAE,SAAS;EAAY,KAAK;EAAY,OAAO;CAAW,CAAC;CAC7E,OAAO,EAAE,OAAO;EAAE,MAAM;EAAY;CAAO,CAAC;CAC5C,SAAS;CACT,QAAQ,EAAE,OAAO;EAAE,YAAY,EAAE,OAAO;EAAG,QAAQ,EAAE,OAAO;CAAE,CAAC,CAAC,CAAC,cAAc;AACjF,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,aAAa,CAAC;;AAe9C,MAAa,cAAsC,EAChD,OAAO;CAGN,MAAM,EACH,OAAO,CAAC,CACR,MAAM,yEAAyE;CAClF;CACA,MAAM,EAAE,IAAI,CAAC,CAAC,SAAS;CACvB,cAAc,EAAE,IAAI,CAAC,CAAC,SAAS;AACjC,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,cAAc,CAAC;;;;;;AAsB/C,MAAa,aAAoC,EAC9C,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC;CAC1B,SAAS,EAAE,OAAO,CAAC,CAAC,MAAM,8BAA8B;CACxD,SAAS,EAAE,IAAI,EAAE,UAAU,WAAW,CAAC;CACvC,QAAQ,EAAE,cAAc,sBAAsB,WAAW;AAC3D,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,aAAa,CAAC;;AAmB9C,MAAa,cAAsC,EAChD,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC;CAC1B,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACzB,UAAU;CACV,OAAO;CACP,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;CACjD,IAAI,EAAE,OAAO;AACf,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,cAAc,CAAC"}
|
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,mBAOT;CAAC;CAAgB;CAAc;CAAa;CAAe;CAAa;AAAa;;AAMzF,MAAa,cAAc;;AAG3B,MAAa,sBAAsB;;AAGnC,SAAgB,gBAAgB,UAAmC;CACjE,OAAO,SAAS,WAAW,QAAQ;AACrC;;AAGA,SAAgB,gBAAgB,SAAiB,UAAkC;CACjF,OAAO,UAAU,QAAQ,GAAG,SAAS;AACvC;AAEA,MAAM,SAA4B,EAC/B,OAAO,CAAC,CACR,MAAM,gBAAgB,CAAC,CACvB,SAAS,cAAc;CAAE,IAAI;CAAU,aAAa;AAAqC,CAAC;;;;;AAM7F,MAAM,aAAgC,EACnC,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,MAAM,SAAS;;AAGlB,MAAa,uBAAkD,EAC5D,KAAK,gBAAgB,CAAC,CACtB,SAAS,cAAc,EAAE,IAAI,iBAAiB,CAAC;;AAelD,MAAa,kBAA8C,EACxD,OAAO;CACN,MAAM;CACN,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;CACnB;CACA,YAAY,EAAE,QAAQ;AACxB,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,kBAAkB,CAAC;;AAcnD,MAAa,kBAA8C,EACxD,OAAO;CAAE,MAAM;CAAY,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;AAAE,CAAC,CAAC,CACvD,SAAS,cAAc,EAAE,IAAI,kBAAkB,CAAC;;AAanD,MAAa,cAAsC,EAChD,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC;CAC1B,OAAO,EAAE,MAAM,eAAe;CAC9B,OAAO,EAAE,MAAM,eAAe;AAChC,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,cAAc,CAAC;;AAiB/C,MAAa,gBAA0C,EACpD,OAAO;CACN,MAAM,EAAE,QAAQ,yBAAyB;CACzC,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC1B,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAChC,WAAW;CACX,OAAO,EAAE,MAAM,eAAe;AAChC,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,gBAAgB,CAAC;;AAgCjD,MAAa,aAAoC,EAC9C,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC;CAC1B,MAAM,EAAE,QAAQ,WAAW;CAC3B,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACzB,UAAU;CACV,MAAM,EAAE,OAAO;EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;EAAG,MAAM;CAAW,CAAC;CAC/D,SAAS,EAAE,OAAO;EAAE,SAAS;EAAY,KAAK;EAAY,OAAO;CAAW,CAAC;CAC7E,OAAO,EAAE,OAAO;EAAE,MAAM;EAAY;CAAO,CAAC;CAC5C,SAAS;CACT,QAAQ,EAAE,OAAO;EAAE,YAAY,EAAE,OAAO;EAAG,QAAQ,EAAE,OAAO;CAAE,CAAC,CAAC,CAAC,cAAc;AACjF,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,aAAa,CAAC;;AAe9C,MAAa,cAAsC,EAChD,OAAO;CAGN,MAAM,EACH,OAAO,CAAC,CAER,MACC,2IACF;CACF;CACA,MAAM,EAAE,IAAI,CAAC,CAAC,SAAS;CACvB,cAAc,EAAE,IAAI,CAAC,CAAC,SAAS;AACjC,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,cAAc,CAAC;;;;;;AAsB/C,MAAa,aAAoC,EAC9C,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC;CAC1B,SAAS,EAAE,OAAO,CAAC,CAAC,MAAM,8BAA8B;CACxD,SAAS,EAAE,IAAI,EAAE,UAAU,WAAW,CAAC;CACvC,QAAQ,EAAE,cAAc,sBAAsB,WAAW;AAC3D,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,aAAa,CAAC;;AAyB9C,MAAa,cAAsC,EAChD,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC;CAC1B,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACzB,UAAU;CACV,OAAO;CACP,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;CACjD,IAAI,EAAE,OAAO;CACb,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AACxC,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../spec.js";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//#region src/diagnostics/codes/host-core.ts
|
|
2
|
+
/** Their catalog entries. */
|
|
3
|
+
const coreHostDiagnostics = {
|
|
4
|
+
MOSTRA_HOST_MALFORMED: {
|
|
5
|
+
severity: "error",
|
|
6
|
+
phase: "host",
|
|
7
|
+
title: "Malformed protocol message",
|
|
8
|
+
hint: "Send each message as one line of JSON holding a single JSON-RPC 2.0 request or notification.",
|
|
9
|
+
docs: {
|
|
10
|
+
explanation: "Every message on a Mostra connection is one line of JSON with one JSON-RPC 2.0 object. This code means a line wasn't valid JSON, wasn't a JSON-RPC 2.0 request or response, or was a batch (a JSON array), which revision `2026-10-10` doesn't accept. A client also reports it when a response doesn't match the method's result schema.",
|
|
11
|
+
fix: "Encode one request per line with `\"jsonrpc\": \"2.0\"`, a `method`, an `id` for requests, and `params` as an object. Send several requests as separate lines instead of a batch."
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
MOSTRA_HOST_METHOD_UNKNOWN: {
|
|
15
|
+
severity: "error",
|
|
16
|
+
phase: "host",
|
|
17
|
+
title: "Unknown protocol method",
|
|
18
|
+
hint: "Call only the methods listed in `capabilities.methods` of the `mostra/initialize` result.",
|
|
19
|
+
docs: {
|
|
20
|
+
explanation: "The instance doesn't serve the method that was called. Either the name is misspelled, or the client is newer than the instance and calls a method the instance's release doesn't have.",
|
|
21
|
+
fix: "Check the method name against INTERFACES §6, and against `capabilities.methods` in the `mostra/initialize` result, which lists every method this instance serves. Upgrade the instance if the client needs a newer method."
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
MOSTRA_HOST_INVALID_PARAMS: {
|
|
25
|
+
severity: "error",
|
|
26
|
+
phase: "host",
|
|
27
|
+
title: "Invalid method params",
|
|
28
|
+
hint: "Fix the params named in the message so they match the method's schema.",
|
|
29
|
+
docs: {
|
|
30
|
+
explanation: "The request's `params` don't match the method's published schema: a required field is missing, a value has the wrong type, or a value is outside its allowed range. The message names the first problem found.",
|
|
31
|
+
fix: "Compare the request with the method's schema in `@mostra/protocol` (or the published JSON Schema) and correct the field named in the message."
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
MOSTRA_HOST_INTERNAL_ERROR: {
|
|
35
|
+
severity: "error",
|
|
36
|
+
phase: "host",
|
|
37
|
+
title: "Unexpected failure in the instance",
|
|
38
|
+
hint: "Retry the request with the same request ID; if it fails again, report it with the instance's log.",
|
|
39
|
+
docs: {
|
|
40
|
+
explanation: "The instance failed while handling the request, for a reason that isn't one of its known conditions. Durable state is unaffected: a request is acknowledged only after its ledger transaction commits. The details are in the instance's log (`logs/supervisor.log` in the home), not in the response.",
|
|
41
|
+
fix: "Retry the request with the same request ID; retries are idempotent. If the failure repeats, report it with the relevant lines of `logs/supervisor.log`."
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
MOSTRA_HOST_CONNECTION_CLOSED: {
|
|
45
|
+
severity: "error",
|
|
46
|
+
phase: "host",
|
|
47
|
+
title: "Connection closed",
|
|
48
|
+
hint: "Reconnect, then retry the request with the same request ID.",
|
|
49
|
+
docs: {
|
|
50
|
+
explanation: "The connection to the other side closed before a response arrived, for example because the instance exited or restarted. The request may or may not have taken effect.",
|
|
51
|
+
fix: "Reconnect and send `mostra/initialize` again, then retry the request with the same request ID. Mutating methods are idempotent by request ID, so a retry never applies twice."
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
MOSTRA_HOST_TIMEOUT: {
|
|
55
|
+
severity: "error",
|
|
56
|
+
phase: "host",
|
|
57
|
+
title: "Request timed out",
|
|
58
|
+
hint: "Retry the request with the same request ID, or allow it more time.",
|
|
59
|
+
docs: {
|
|
60
|
+
explanation: "No response arrived within the time the caller allowed. The other side may still be working on the request, and it may still take effect.",
|
|
61
|
+
fix: "Retry with the same request ID, which returns the recorded result if the first attempt completed. Allow a longer timeout for slow operations."
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { coreHostDiagnostics };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=host-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-core.js","names":[],"sources":["../../../src/diagnostics/codes/host-core.ts"],"sourcesContent":["/**\n * The HOST-area codes the JSON-RPC core raises itself (D83): malformed messages, unknown methods,\n * invalid params, internal errors, closed connections and timeouts. They are defined here once\n * and spread into the HOST catalog, so a browser bundle that imports the core (the bridge,\n * `@mostra/react`, the shell) carries these six entries, not the whole area's text: a new HOST\n * code no longer grows them (#17).\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes the JSON-RPC core raises. */\nexport type CoreHostDiagnosticCode =\n | \"MOSTRA_HOST_MALFORMED\"\n | \"MOSTRA_HOST_METHOD_UNKNOWN\"\n | \"MOSTRA_HOST_INVALID_PARAMS\"\n | \"MOSTRA_HOST_INTERNAL_ERROR\"\n | \"MOSTRA_HOST_CONNECTION_CLOSED\"\n | \"MOSTRA_HOST_TIMEOUT\";\n\n/** Their catalog entries. */\nexport const coreHostDiagnostics: AreaCatalog<CoreHostDiagnosticCode> = {\n MOSTRA_HOST_MALFORMED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Malformed protocol message\",\n hint: \"Send each message as one line of JSON holding a single JSON-RPC 2.0 request or notification.\",\n docs: {\n explanation:\n \"Every message on a Mostra connection is one line of JSON with one JSON-RPC 2.0 object. This code means a line wasn't valid JSON, wasn't a JSON-RPC 2.0 request or response, or was a batch (a JSON array), which revision `2026-10-10` doesn't accept. A client also reports it when a response doesn't match the method's result schema.\",\n fix: 'Encode one request per line with `\"jsonrpc\": \"2.0\"`, a `method`, an `id` for requests, and `params` as an object. Send several requests as separate lines instead of a batch.',\n },\n },\n MOSTRA_HOST_METHOD_UNKNOWN: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unknown protocol method\",\n hint: \"Call only the methods listed in `capabilities.methods` of the `mostra/initialize` result.\",\n docs: {\n explanation:\n \"The instance doesn't serve the method that was called. Either the name is misspelled, or the client is newer than the instance and calls a method the instance's release doesn't have.\",\n fix: \"Check the method name against INTERFACES \\u00a76, and against `capabilities.methods` in the `mostra/initialize` result, which lists every method this instance serves. Upgrade the instance if the client needs a newer method.\",\n },\n },\n MOSTRA_HOST_INVALID_PARAMS: {\n severity: \"error\",\n phase: \"host\",\n title: \"Invalid method params\",\n hint: \"Fix the params named in the message so they match the method's schema.\",\n docs: {\n explanation:\n \"The request's `params` don't match the method's published schema: a required field is missing, a value has the wrong type, or a value is outside its allowed range. The message names the first problem found.\",\n fix: \"Compare the request with the method's schema in `@mostra/protocol` (or the published JSON Schema) and correct the field named in the message.\",\n },\n },\n MOSTRA_HOST_INTERNAL_ERROR: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unexpected failure in the instance\",\n hint: \"Retry the request with the same request ID; if it fails again, report it with the instance's log.\",\n docs: {\n explanation:\n \"The instance failed while handling the request, for a reason that isn't one of its known conditions. Durable state is unaffected: a request is acknowledged only after its ledger transaction commits. The details are in the instance's log (`logs/supervisor.log` in the home), not in the response.\",\n fix: \"Retry the request with the same request ID; retries are idempotent. If the failure repeats, report it with the relevant lines of `logs/supervisor.log`.\",\n },\n },\n MOSTRA_HOST_CONNECTION_CLOSED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Connection closed\",\n hint: \"Reconnect, then retry the request with the same request ID.\",\n docs: {\n explanation:\n \"The connection to the other side closed before a response arrived, for example because the instance exited or restarted. The request may or may not have taken effect.\",\n fix: \"Reconnect and send `mostra/initialize` again, then retry the request with the same request ID. Mutating methods are idempotent by request ID, so a retry never applies twice.\",\n },\n },\n MOSTRA_HOST_TIMEOUT: {\n severity: \"error\",\n phase: \"host\",\n title: \"Request timed out\",\n hint: \"Retry the request with the same request ID, or allow it more time.\",\n docs: {\n explanation:\n \"No response arrived within the time the caller allowed. The other side may still be working on the request, and it may still take effect.\",\n fix: \"Retry with the same request ID, which returns the recorded result if the first attempt completed. Allow a longer timeout for slow operations.\",\n },\n },\n};\n"],"mappings":";;AAmBA,MAAa,sBAA2D;CACtE,uBAAuB;EACrB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,+BAA+B;EAC7B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,qBAAqB;EACnB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","names":[],"sources":["../../../src/diagnostics/codes/host.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"host.d.ts","names":[],"sources":["../../../src/diagnostics/codes/host.ts"],"mappings":";;;qBAOa;;YAqBD,6BAA6B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { coreHostDiagnostics } from "./host-core.js";
|
|
1
2
|
//#region src/diagnostics/codes/host.ts
|
|
2
3
|
/** The codes of the HOST area, in the order they were added. */
|
|
3
4
|
const hostDiagnosticCodes = [
|
|
@@ -18,8 +19,12 @@ const hostDiagnosticCodes = [
|
|
|
18
19
|
"MOSTRA_HOST_MESSAGE_TOO_LARGE",
|
|
19
20
|
"MOSTRA_HOST_IDENTITY_UNAVAILABLE"
|
|
20
21
|
];
|
|
21
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* The HOST area's catalog entries. The codes the JSON-RPC core raises live in `host-core.ts`, so
|
|
24
|
+
* browser bundles carry only theirs (#17).
|
|
25
|
+
*/
|
|
22
26
|
const hostDiagnostics = {
|
|
27
|
+
...coreHostDiagnostics,
|
|
23
28
|
MOSTRA_HOST_REVISION_UNSUPPORTED: {
|
|
24
29
|
severity: "error",
|
|
25
30
|
phase: "host",
|
|
@@ -30,46 +35,6 @@ const hostDiagnostics = {
|
|
|
30
35
|
fix: "Restart the daemon so it runs the same release as the client: `mostra daemon restart`. Durable state survives the restart, and open views reconnect. A host that embeds Mostra updates its pinned Mostra runtime or its host library until both support a common revision."
|
|
31
36
|
}
|
|
32
37
|
},
|
|
33
|
-
MOSTRA_HOST_MALFORMED: {
|
|
34
|
-
severity: "error",
|
|
35
|
-
phase: "host",
|
|
36
|
-
title: "Malformed protocol message",
|
|
37
|
-
hint: "Send each message as one line of JSON holding a single JSON-RPC 2.0 request or notification.",
|
|
38
|
-
docs: {
|
|
39
|
-
explanation: "Every message on a Mostra connection is one line of JSON with one JSON-RPC 2.0 object. This code means a line wasn't valid JSON, wasn't a JSON-RPC 2.0 request or response, or was a batch (a JSON array), which revision `2026-10-10` doesn't accept. A client also reports it when a response doesn't match the method's result schema.",
|
|
40
|
-
fix: "Encode one request per line with `\"jsonrpc\": \"2.0\"`, a `method`, an `id` for requests, and `params` as an object. Send several requests as separate lines instead of a batch."
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
MOSTRA_HOST_METHOD_UNKNOWN: {
|
|
44
|
-
severity: "error",
|
|
45
|
-
phase: "host",
|
|
46
|
-
title: "Unknown protocol method",
|
|
47
|
-
hint: "Call only the methods listed in `capabilities.methods` of the `mostra/initialize` result.",
|
|
48
|
-
docs: {
|
|
49
|
-
explanation: "The instance doesn't serve the method that was called. Either the name is misspelled, or the client is newer than the instance and calls a method the instance's release doesn't have.",
|
|
50
|
-
fix: "Check the method name against INTERFACES §6, and against `capabilities.methods` in the `mostra/initialize` result, which lists every method this instance serves. Upgrade the instance if the client needs a newer method."
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
MOSTRA_HOST_INVALID_PARAMS: {
|
|
54
|
-
severity: "error",
|
|
55
|
-
phase: "host",
|
|
56
|
-
title: "Invalid method params",
|
|
57
|
-
hint: "Fix the params named in the message so they match the method's schema.",
|
|
58
|
-
docs: {
|
|
59
|
-
explanation: "The request's `params` don't match the method's published schema: a required field is missing, a value has the wrong type, or a value is outside its allowed range. The message names the first problem found.",
|
|
60
|
-
fix: "Compare the request with the method's schema in `@mostra/protocol` (or the published JSON Schema) and correct the field named in the message."
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
MOSTRA_HOST_INTERNAL_ERROR: {
|
|
64
|
-
severity: "error",
|
|
65
|
-
phase: "host",
|
|
66
|
-
title: "Unexpected failure in the instance",
|
|
67
|
-
hint: "Retry the request with the same request ID; if it fails again, report it with the instance's log.",
|
|
68
|
-
docs: {
|
|
69
|
-
explanation: "The instance failed while handling the request, for a reason that isn't one of its known conditions. Durable state is unaffected: a request is acknowledged only after its ledger transaction commits. The details are in the instance's log (`logs/supervisor.log` in the home), not in the response.",
|
|
70
|
-
fix: "Retry the request with the same request ID; retries are idempotent. If the failure repeats, report it with the relevant lines of `logs/supervisor.log`."
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
38
|
MOSTRA_HOST_INITIALIZE_ORDER: {
|
|
74
39
|
severity: "error",
|
|
75
40
|
phase: "host",
|
|
@@ -90,26 +55,6 @@ const hostDiagnostics = {
|
|
|
90
55
|
fix: "Register only the ports listed in `capabilities.ports` of the `mostra/initialize` result. If the host needs the port, upgrade the instance to a release that supports it."
|
|
91
56
|
}
|
|
92
57
|
},
|
|
93
|
-
MOSTRA_HOST_CONNECTION_CLOSED: {
|
|
94
|
-
severity: "error",
|
|
95
|
-
phase: "host",
|
|
96
|
-
title: "Connection closed",
|
|
97
|
-
hint: "Reconnect, then retry the request with the same request ID.",
|
|
98
|
-
docs: {
|
|
99
|
-
explanation: "The connection to the other side closed before a response arrived, for example because the instance exited or restarted. The request may or may not have taken effect.",
|
|
100
|
-
fix: "Reconnect and send `mostra/initialize` again, then retry the request with the same request ID. Mutating methods are idempotent by request ID, so a retry never applies twice."
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
MOSTRA_HOST_TIMEOUT: {
|
|
104
|
-
severity: "error",
|
|
105
|
-
phase: "host",
|
|
106
|
-
title: "Request timed out",
|
|
107
|
-
hint: "Retry the request with the same request ID, or allow it more time.",
|
|
108
|
-
docs: {
|
|
109
|
-
explanation: "No response arrived within the time the caller allowed. The other side may still be working on the request, and it may still take effect.",
|
|
110
|
-
fix: "Retry with the same request ID, which returns the recorded result if the first attempt completed. Allow a longer timeout for slow operations."
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
58
|
MOSTRA_HOST_SHUTDOWN_REFUSED: {
|
|
114
59
|
severity: "error",
|
|
115
60
|
phase: "host",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","names":[],"sources":["../../../src/diagnostics/codes/host.ts"],"sourcesContent":["/**\n * Diagnostic codes of the HOST area: the host protocol between clients and an instance.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the HOST area, in the order they were added. */\nexport const hostDiagnosticCodes = [\n \"MOSTRA_HOST_REVISION_UNSUPPORTED\",\n \"MOSTRA_HOST_MALFORMED\",\n \"MOSTRA_HOST_METHOD_UNKNOWN\",\n \"MOSTRA_HOST_INVALID_PARAMS\",\n \"MOSTRA_HOST_INTERNAL_ERROR\",\n \"MOSTRA_HOST_INITIALIZE_ORDER\",\n \"MOSTRA_HOST_PORT_UNSUPPORTED\",\n \"MOSTRA_HOST_CONNECTION_CLOSED\",\n \"MOSTRA_HOST_TIMEOUT\",\n \"MOSTRA_HOST_SHUTDOWN_REFUSED\",\n \"MOSTRA_HOST_REQUEST_ID_REUSED\",\n \"MOSTRA_HOST_CURSOR_COMPACTED\",\n \"MOSTRA_HOST_SUBSCRIPTION_UNKNOWN\",\n \"MOSTRA_HOST_NOTIFICATION_UNSUPPORTED\",\n \"MOSTRA_HOST_MESSAGE_TOO_LARGE\",\n \"MOSTRA_HOST_IDENTITY_UNAVAILABLE\",\n // gen:codes\n] as const;\n\n/** The codes of the HOST area. */\nexport type HostDiagnosticCode = (typeof hostDiagnosticCodes)[number];\n\n/** The HOST area's catalog entries. */\nexport const hostDiagnostics: AreaCatalog<HostDiagnosticCode> = {\n MOSTRA_HOST_REVISION_UNSUPPORTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"No common host protocol revision\",\n hint: \"Run the client and the instance from the same Mostra release, for example with `mostra daemon restart`.\",\n docs: {\n explanation:\n \"A client and a Mostra instance agree on a host protocol revision when they connect (`mostra/initialize`). The client offers the revisions it speaks, and the instance picks the newest one it also supports. This code means the two lists have nothing in common, usually because the client and the running daemon come from Mostra releases far apart.\",\n fix: \"Restart the daemon so it runs the same release as the client: `mostra daemon restart`. Durable state survives the restart, and open views reconnect. A host that embeds Mostra updates its pinned Mostra runtime or its host library until both support a common revision.\",\n },\n },\n MOSTRA_HOST_MALFORMED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Malformed protocol message\",\n hint: \"Send each message as one line of JSON holding a single JSON-RPC 2.0 request or notification.\",\n docs: {\n explanation:\n \"Every message on a Mostra connection is one line of JSON with one JSON-RPC 2.0 object. This code means a line wasn't valid JSON, wasn't a JSON-RPC 2.0 request or response, or was a batch (a JSON array), which revision `2026-10-10` doesn't accept. A client also reports it when a response doesn't match the method's result schema.\",\n fix: 'Encode one request per line with `\"jsonrpc\": \"2.0\"`, a `method`, an `id` for requests, and `params` as an object. Send several requests as separate lines instead of a batch.',\n },\n },\n MOSTRA_HOST_METHOD_UNKNOWN: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unknown protocol method\",\n hint: \"Call only the methods listed in `capabilities.methods` of the `mostra/initialize` result.\",\n docs: {\n explanation:\n \"The instance doesn't serve the method that was called. Either the name is misspelled, or the client is newer than the instance and calls a method the instance's release doesn't have.\",\n fix: \"Check the method name against INTERFACES \\u00a76, and against `capabilities.methods` in the `mostra/initialize` result, which lists every method this instance serves. Upgrade the instance if the client needs a newer method.\",\n },\n },\n MOSTRA_HOST_INVALID_PARAMS: {\n severity: \"error\",\n phase: \"host\",\n title: \"Invalid method params\",\n hint: \"Fix the params named in the message so they match the method's schema.\",\n docs: {\n explanation:\n \"The request's `params` don't match the method's published schema: a required field is missing, a value has the wrong type, or a value is outside its allowed range. The message names the first problem found.\",\n fix: \"Compare the request with the method's schema in `@mostra/protocol` (or the published JSON Schema) and correct the field named in the message.\",\n },\n },\n MOSTRA_HOST_INTERNAL_ERROR: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unexpected failure in the instance\",\n hint: \"Retry the request with the same request ID; if it fails again, report it with the instance's log.\",\n docs: {\n explanation:\n \"The instance failed while handling the request, for a reason that isn't one of its known conditions. Durable state is unaffected: a request is acknowledged only after its ledger transaction commits. The details are in the instance's log (`logs/supervisor.log` in the home), not in the response.\",\n fix: \"Retry the request with the same request ID; retries are idempotent. If the failure repeats, report it with the relevant lines of `logs/supervisor.log`.\",\n },\n },\n MOSTRA_HOST_INITIALIZE_ORDER: {\n severity: \"error\",\n phase: \"host\",\n title: \"Initialize first, and only once\",\n hint: \"Send `mostra/initialize` as the first request on the connection, and only once.\",\n docs: {\n explanation:\n \"Every connection starts with `mostra/initialize`, which agrees the protocol revision and registers the client's ports. The instance received another request before it, or a second `mostra/initialize` on the same connection.\",\n fix: \"Send `mostra/initialize` first and wait for its result before any other request. To renegotiate, open a new connection.\",\n },\n },\n MOSTRA_HOST_PORT_UNSUPPORTED: {\n severity: \"warning\",\n phase: \"host\",\n title: \"Port not supported by this instance\",\n hint: \"Leave the port out of `mostra/initialize`, or run a Mostra release that lists it in `capabilities.ports`.\",\n docs: {\n explanation:\n \"The client registered a port this instance doesn't call, so registering it has no effect. The port may be reserved for a later release (such as `ai`), or the client may be newer than the instance. The session continues without the port, and Mostra uses its standalone behavior instead.\",\n fix: \"Register only the ports listed in `capabilities.ports` of the `mostra/initialize` result. If the host needs the port, upgrade the instance to a release that supports it.\",\n },\n },\n MOSTRA_HOST_CONNECTION_CLOSED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Connection closed\",\n hint: \"Reconnect, then retry the request with the same request ID.\",\n docs: {\n explanation:\n \"The connection to the other side closed before a response arrived, for example because the instance exited or restarted. The request may or may not have taken effect.\",\n fix: \"Reconnect and send `mostra/initialize` again, then retry the request with the same request ID. Mutating methods are idempotent by request ID, so a retry never applies twice.\",\n },\n },\n MOSTRA_HOST_TIMEOUT: {\n severity: \"error\",\n phase: \"host\",\n title: \"Request timed out\",\n hint: \"Retry the request with the same request ID, or allow it more time.\",\n docs: {\n explanation:\n \"No response arrived within the time the caller allowed. The other side may still be working on the request, and it may still take effect.\",\n fix: \"Retry with the same request ID, which returns the recorded result if the first attempt completed. Allow a longer timeout for slow operations.\",\n },\n },\n MOSTRA_HOST_SHUTDOWN_REFUSED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Only the spawning host can stop this instance\",\n hint: \"Ask the host that started this instance to stop it, or end the connection you opened instead.\",\n docs: {\n explanation:\n \"An instance started by a host over stdio (`mostra host`) lives as long as that host's connection, so only the host may stop it with `mostra/shutdown`. A client that attached through the home's socket asked it to stop. A daemon (`mostra daemon`) accepts `mostra/shutdown` from every attached client (D87).\",\n fix: \"Close your own connection when you are done. To stop the instance, stop the host that spawned it, or have the host send `mostra/shutdown` or close its stdio.\",\n },\n },\n MOSTRA_HOST_REQUEST_ID_REUSED: {\n severity: \"error\",\n phase: \"host\",\n title: \"A requestId was reused with other parameters\",\n hint: \"Send a new `requestId` for a new request; repeat the exact parameters only to retry one.\",\n docs: {\n explanation:\n \"A mutating method recorded its result under this `requestId` for different parameters. Replaying that result would answer a request nobody made (a link for another artifact or with other scopes, another source's publish), so the instance refuses (H-03). Retries with the same parameters still return the recorded result.\",\n fix: \"Generate a fresh `requestId` for every new request, and reuse one only to retry the same request after a timeout or a lost connection.\",\n },\n },\n MOSTRA_HOST_CURSOR_COMPACTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Events compacted\",\n hint: \"Read from the cursor in the message to receive the compaction summary, then continue from there.\",\n docs: {\n explanation:\n \"Events before a cursor were compacted on request (`mostra gc --compact-events`, DATA_MODEL §4): an artifact's old events were replaced by one `artifact.compacted` event that summarizes them. A reader asking for events after an earlier cursor would miss some, and Mostra never leaves a silent gap.\",\n fix: \"Read again with `after` set to the cursor the message names: the next event is the `artifact.compacted` summary. Rebuild what you track from it and continue as usual.\",\n },\n },\n MOSTRA_HOST_SUBSCRIPTION_UNKNOWN: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unknown subscription\",\n hint: \"Subscribe again with `events/subscribe`, then use the ID it returns.\",\n docs: {\n explanation:\n \"The subscription ID belongs to no subscription on this connection: it was never created here, was ended with `events/unsubscribe`, or belonged to a connection that closed. Subscriptions live as long as their connection; a named subscriber's acknowledged cursor outlives it.\",\n fix: \"Call `events/subscribe` again on this connection. With the same `name`, delivery resumes after the last acknowledged cursor.\",\n },\n },\n MOSTRA_HOST_NOTIFICATION_UNSUPPORTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Notification not accepted\",\n hint: \"List the notification in `capabilities.notifications` when you initialize.\",\n docs: {\n explanation:\n \"Mostra sends a client only the notifications it listed in `mostra/initialize` (D84). This method would send one the client didn't list, such as `events/notify` for `events/subscribe`.\",\n fix: 'Reconnect and initialize with `capabilities: { notifications: [\"events/notify\"] }`, or poll with `events/read` instead.',\n },\n },\n MOSTRA_HOST_MESSAGE_TOO_LARGE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Message too large for the protocol\",\n hint: \"Ask for less at once: a specific submission, fewer events, or smaller values.\",\n docs: {\n explanation:\n \"One host-protocol message is one line of JSON, and a line holds at most 64 Mi characters (`MAX_LINE_LENGTH`), so neither side buffers without bound. Mostra checks every message before it writes it: an answer that would be longer is replaced by this error, and a delivery whose envelope would be longer is recorded as undeliverable instead of being sent and retried forever.\",\n fix: \"Read less per request (`events/read` with a smaller `limit`, `results/get` for one submission), and keep artifacts' values within the field and document limits.\",\n },\n },\n MOSTRA_HOST_IDENTITY_UNAVAILABLE: {\n severity: \"error\",\n phase: \"host\",\n title: \"The host that identifies viewers didn't answer\",\n hint: \"Start the host that serves this home's identity port, then open the link again.\",\n docs: {\n explanation:\n \"A host registered the `identity` port, so it decides who opens this home's links. When a link minted without a viewer was opened, that host failed, didn't answer within 5 seconds, gave an answer its schema refuses, or is expected (it lists `identity` in `HomeConfig.ports`) but not connected. Mostra refuses the link rather than let the session act as someone else.\",\n fix: \"Start or reconnect the host, then open the link again. A link minted with `view/url`'s `viewer` names its person itself and never needs the port. To return the home to Mostra's own identity, have the host register without the port and clear its expected ports (`HomeConfig.ports: []`).\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,kBAAmD;CAC9D,kCAAkC;EAChC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,uBAAuB;EACrB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,+BAA+B;EAC7B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,qBAAqB;EACnB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,+BAA+B;EAC7B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,kCAAkC;EAChC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,sCAAsC;EACpC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,+BAA+B;EAC7B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,kCAAkC;EAChC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
|
|
1
|
+
{"version":3,"file":"host.js","names":[],"sources":["../../../src/diagnostics/codes/host.ts"],"sourcesContent":["/**\n * Diagnostic codes of the HOST area: the host protocol between clients and an instance.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\nimport { coreHostDiagnostics } from \"./host-core.ts\";\n\n/** The codes of the HOST area, in the order they were added. */\nexport const hostDiagnosticCodes = [\n \"MOSTRA_HOST_REVISION_UNSUPPORTED\",\n \"MOSTRA_HOST_MALFORMED\",\n \"MOSTRA_HOST_METHOD_UNKNOWN\",\n \"MOSTRA_HOST_INVALID_PARAMS\",\n \"MOSTRA_HOST_INTERNAL_ERROR\",\n \"MOSTRA_HOST_INITIALIZE_ORDER\",\n \"MOSTRA_HOST_PORT_UNSUPPORTED\",\n \"MOSTRA_HOST_CONNECTION_CLOSED\",\n \"MOSTRA_HOST_TIMEOUT\",\n \"MOSTRA_HOST_SHUTDOWN_REFUSED\",\n \"MOSTRA_HOST_REQUEST_ID_REUSED\",\n \"MOSTRA_HOST_CURSOR_COMPACTED\",\n \"MOSTRA_HOST_SUBSCRIPTION_UNKNOWN\",\n \"MOSTRA_HOST_NOTIFICATION_UNSUPPORTED\",\n \"MOSTRA_HOST_MESSAGE_TOO_LARGE\",\n \"MOSTRA_HOST_IDENTITY_UNAVAILABLE\",\n // gen:codes\n] as const;\n\n/** The codes of the HOST area. */\nexport type HostDiagnosticCode = (typeof hostDiagnosticCodes)[number];\n\n/**\n * The HOST area's catalog entries. The codes the JSON-RPC core raises live in `host-core.ts`, so\n * browser bundles carry only theirs (#17).\n */\nexport const hostDiagnostics: AreaCatalog<HostDiagnosticCode> = {\n ...coreHostDiagnostics,\n MOSTRA_HOST_REVISION_UNSUPPORTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"No common host protocol revision\",\n hint: \"Run the client and the instance from the same Mostra release, for example with `mostra daemon restart`.\",\n docs: {\n explanation:\n \"A client and a Mostra instance agree on a host protocol revision when they connect (`mostra/initialize`). The client offers the revisions it speaks, and the instance picks the newest one it also supports. This code means the two lists have nothing in common, usually because the client and the running daemon come from Mostra releases far apart.\",\n fix: \"Restart the daemon so it runs the same release as the client: `mostra daemon restart`. Durable state survives the restart, and open views reconnect. A host that embeds Mostra updates its pinned Mostra runtime or its host library until both support a common revision.\",\n },\n },\n MOSTRA_HOST_INITIALIZE_ORDER: {\n severity: \"error\",\n phase: \"host\",\n title: \"Initialize first, and only once\",\n hint: \"Send `mostra/initialize` as the first request on the connection, and only once.\",\n docs: {\n explanation:\n \"Every connection starts with `mostra/initialize`, which agrees the protocol revision and registers the client's ports. The instance received another request before it, or a second `mostra/initialize` on the same connection.\",\n fix: \"Send `mostra/initialize` first and wait for its result before any other request. To renegotiate, open a new connection.\",\n },\n },\n MOSTRA_HOST_PORT_UNSUPPORTED: {\n severity: \"warning\",\n phase: \"host\",\n title: \"Port not supported by this instance\",\n hint: \"Leave the port out of `mostra/initialize`, or run a Mostra release that lists it in `capabilities.ports`.\",\n docs: {\n explanation:\n \"The client registered a port this instance doesn't call, so registering it has no effect. The port may be reserved for a later release (such as `ai`), or the client may be newer than the instance. The session continues without the port, and Mostra uses its standalone behavior instead.\",\n fix: \"Register only the ports listed in `capabilities.ports` of the `mostra/initialize` result. If the host needs the port, upgrade the instance to a release that supports it.\",\n },\n },\n MOSTRA_HOST_SHUTDOWN_REFUSED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Only the spawning host can stop this instance\",\n hint: \"Ask the host that started this instance to stop it, or end the connection you opened instead.\",\n docs: {\n explanation:\n \"An instance started by a host over stdio (`mostra host`) lives as long as that host's connection, so only the host may stop it with `mostra/shutdown`. A client that attached through the home's socket asked it to stop. A daemon (`mostra daemon`) accepts `mostra/shutdown` from every attached client (D87).\",\n fix: \"Close your own connection when you are done. To stop the instance, stop the host that spawned it, or have the host send `mostra/shutdown` or close its stdio.\",\n },\n },\n MOSTRA_HOST_REQUEST_ID_REUSED: {\n severity: \"error\",\n phase: \"host\",\n title: \"A requestId was reused with other parameters\",\n hint: \"Send a new `requestId` for a new request; repeat the exact parameters only to retry one.\",\n docs: {\n explanation:\n \"A mutating method recorded its result under this `requestId` for different parameters. Replaying that result would answer a request nobody made (a link for another artifact or with other scopes, another source's publish), so the instance refuses (H-03). Retries with the same parameters still return the recorded result.\",\n fix: \"Generate a fresh `requestId` for every new request, and reuse one only to retry the same request after a timeout or a lost connection.\",\n },\n },\n MOSTRA_HOST_CURSOR_COMPACTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Events compacted\",\n hint: \"Read from the cursor in the message to receive the compaction summary, then continue from there.\",\n docs: {\n explanation:\n \"Events before a cursor were compacted on request (`mostra gc --compact-events`, DATA_MODEL §4): an artifact's old events were replaced by one `artifact.compacted` event that summarizes them. A reader asking for events after an earlier cursor would miss some, and Mostra never leaves a silent gap.\",\n fix: \"Read again with `after` set to the cursor the message names: the next event is the `artifact.compacted` summary. Rebuild what you track from it and continue as usual.\",\n },\n },\n MOSTRA_HOST_SUBSCRIPTION_UNKNOWN: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unknown subscription\",\n hint: \"Subscribe again with `events/subscribe`, then use the ID it returns.\",\n docs: {\n explanation:\n \"The subscription ID belongs to no subscription on this connection: it was never created here, was ended with `events/unsubscribe`, or belonged to a connection that closed. Subscriptions live as long as their connection; a named subscriber's acknowledged cursor outlives it.\",\n fix: \"Call `events/subscribe` again on this connection. With the same `name`, delivery resumes after the last acknowledged cursor.\",\n },\n },\n MOSTRA_HOST_NOTIFICATION_UNSUPPORTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Notification not accepted\",\n hint: \"List the notification in `capabilities.notifications` when you initialize.\",\n docs: {\n explanation:\n \"Mostra sends a client only the notifications it listed in `mostra/initialize` (D84). This method would send one the client didn't list, such as `events/notify` for `events/subscribe`.\",\n fix: 'Reconnect and initialize with `capabilities: { notifications: [\"events/notify\"] }`, or poll with `events/read` instead.',\n },\n },\n MOSTRA_HOST_MESSAGE_TOO_LARGE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Message too large for the protocol\",\n hint: \"Ask for less at once: a specific submission, fewer events, or smaller values.\",\n docs: {\n explanation:\n \"One host-protocol message is one line of JSON, and a line holds at most 64 Mi characters (`MAX_LINE_LENGTH`), so neither side buffers without bound. Mostra checks every message before it writes it: an answer that would be longer is replaced by this error, and a delivery whose envelope would be longer is recorded as undeliverable instead of being sent and retried forever.\",\n fix: \"Read less per request (`events/read` with a smaller `limit`, `results/get` for one submission), and keep artifacts' values within the field and document limits.\",\n },\n },\n MOSTRA_HOST_IDENTITY_UNAVAILABLE: {\n severity: \"error\",\n phase: \"host\",\n title: \"The host that identifies viewers didn't answer\",\n hint: \"Start the host that serves this home's identity port, then open the link again.\",\n docs: {\n explanation:\n \"A host registered the `identity` port, so it decides who opens this home's links. When a link minted without a viewer was opened, that host failed, didn't answer within 5 seconds, gave an answer its schema refuses, or is expected (it lists `identity` in `HomeConfig.ports`) but not connected. Mostra refuses the link rather than let the session act as someone else.\",\n fix: \"Start or reconnect the host, then open the link again. A link minted with `view/url`'s `viewer` names its person itself and never needs the port. To return the home to Mostra's own identity, have the host register without the port and clear its expected ports (`HomeConfig.ports: []`).\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;;AAOA,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;;;;AASA,MAAa,kBAAmD;CAC9D,GAAG;CACH,kCAAkC;EAChC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,+BAA+B;EAC7B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,kCAAkC;EAChC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,sCAAsC;EACpC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,+BAA+B;EAC7B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,kCAAkC;EAChC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { hostDiagnosticCodes, hostDiagnostics } from "./host.js";
|
|
2
1
|
import { buildDiagnostic } from "../spec.js";
|
|
3
2
|
import { a11yDiagnosticCodes, a11yDiagnostics } from "./a11y.js";
|
|
4
3
|
import { actionDiagnosticCodes, actionDiagnostics } from "./action.js";
|
|
@@ -10,6 +9,7 @@ import { depDiagnosticCodes, depDiagnostics } from "./dep.js";
|
|
|
10
9
|
import { envDiagnosticCodes, envDiagnostics } from "./env.js";
|
|
11
10
|
import { fieldDiagnosticCodes, fieldDiagnostics } from "./field.js";
|
|
12
11
|
import { homeDiagnosticCodes, homeDiagnostics } from "./home.js";
|
|
12
|
+
import { hostDiagnosticCodes, hostDiagnostics } from "./host.js";
|
|
13
13
|
import { hygieneDiagnosticCodes, hygieneDiagnostics } from "./hygiene.js";
|
|
14
14
|
import { liveDiagnosticCodes, liveDiagnostics } from "./live.js";
|
|
15
15
|
import { manifestDiagnosticCodes, manifestDiagnostics } from "./manifest.js";
|
|
@@ -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
|
|
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
|
|
12
|
-
fix: "Run Mostra on a
|
|
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
|
|
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";
|
|
@@ -79,9 +79,10 @@ import { ViewLaunchParams, ViewLaunchResult, viewLaunchMethod } from "./methods/
|
|
|
79
79
|
import { ViewRevokeParams, ViewRevokeResult, viewRevokeMethod } from "./methods/view/revoke.js";
|
|
80
80
|
import { ViewRotateParams, ViewRotateResult, viewRotateMethod } from "./methods/view/rotate.js";
|
|
81
81
|
import { WAIT_MAX_MS, WaitParams, WaitResult, waitMethod } from "./methods/wait/wait.js";
|
|
82
|
+
import { receivable } from "./receive.js";
|
|
82
83
|
import { ClassifiedMessage, JsonRpcErrorObject, JsonRpcFailure, JsonRpcId, JsonRpcMessage, JsonRpcNotification, JsonRpcParams, JsonRpcRequest, JsonRpcResponse, JsonRpcSuccess, classifyMessage } from "./rpc/messages.js";
|
|
83
84
|
import { JSON_RPC_ERROR_CODES, RpcError } from "./rpc/error.js";
|
|
84
85
|
import { LineSplitter, MAX_LINE_LENGTH, encodeLine } from "./rpc/lines.js";
|
|
85
86
|
import { RpcPeer, RpcPeerOptions, RpcRequestContext, RpcRequestOptions, parseParams } from "./rpc/peer.js";
|
|
86
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";
|
|
87
|
-
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, 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
|
@@ -2,17 +2,17 @@ import { ArtifactId, CommentId, Cursor, DeliveryId, MutationId, RunId, Submissio
|
|
|
2
2
|
import { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ActionError, Batches, CallRequest, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LiveRequest, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RunAttachRequest, RunCancelRequest, RunProgress, RunRequest, RunState, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, isFinalRunStatus } from "./actions.js";
|
|
3
3
|
import { ARTIFACT_MANIFEST_KEYS, ArtifactLink, ArtifactManifest, SubmissionPolicy } from "./manifest.js";
|
|
4
4
|
import { ArtifactDetail, ArtifactRef, ArtifactSummary, PublishReceipt, SourceRef, VersionSummary } from "./artifact.js";
|
|
5
|
-
import { hostDiagnosticCodes } from "./diagnostics/codes/host.js";
|
|
6
5
|
import { DIAGNOSTIC_AREAS, Diagnostic, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity } from "./diagnostics/diagnostic.js";
|
|
7
6
|
import { DEFAULT_DOCS_BASE, docsUrl } from "./diagnostics/spec.js";
|
|
8
7
|
import { JSON_RPC_ERROR_CODES, RpcError } from "./rpc/error.js";
|
|
9
8
|
import { JsonRpcErrorObject, JsonRpcFailure, JsonRpcNotification, JsonRpcRequest, JsonRpcSuccess, classifyMessage } from "./rpc/messages.js";
|
|
9
|
+
import { receivable } from "./receive.js";
|
|
10
10
|
import { RpcPeer, parseParams } from "./rpc/peer.js";
|
|
11
11
|
import { ControlsPolicy, REVIEW_SET_ID_PATTERN, SubmitChannel, TrustedControl, VersionRef, ViewContext, ViewContextWire, readViewContext } from "./view.js";
|
|
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";
|
|
@@ -25,6 +25,7 @@ import { depDiagnosticCodes } from "./diagnostics/codes/dep.js";
|
|
|
25
25
|
import { envDiagnosticCodes } from "./diagnostics/codes/env.js";
|
|
26
26
|
import { fieldDiagnosticCodes } from "./diagnostics/codes/field.js";
|
|
27
27
|
import { homeDiagnosticCodes } from "./diagnostics/codes/home.js";
|
|
28
|
+
import { hostDiagnosticCodes } from "./diagnostics/codes/host.js";
|
|
28
29
|
import { hygieneDiagnosticCodes } from "./diagnostics/codes/hygiene.js";
|
|
29
30
|
import { liveDiagnosticCodes } from "./diagnostics/codes/live.js";
|
|
30
31
|
import { manifestDiagnosticCodes } from "./diagnostics/codes/manifest.js";
|
|
@@ -84,4 +85,4 @@ import { hostMethods, hostNotifications } from "./methods/index.js";
|
|
|
84
85
|
import { LineSplitter, MAX_LINE_LENGTH, encodeLine } from "./rpc/lines.js";
|
|
85
86
|
import { ARGUMENT_BIGINT_DIGITS_MAX, RemoteError, SerializationError, UNSERIALIZABLE_CODE, ValueReader, ValueWriter, checkArgumentFrames, deserializeAll, fromBase64, serializeAll, toBase64, wireError } from "./serializer.js";
|
|
86
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";
|
|
87
|
-
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, 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 };
|