@mostra/protocol 0.2.0 → 0.4.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/artifact.d.ts.map +1 -1
- package/dist/artifact.js +8 -3
- package/dist/artifact.js.map +1 -1
- package/dist/diagnostics/codes/env.d.ts +1 -1
- package/dist/diagnostics/codes/env.d.ts.map +1 -1
- package/dist/diagnostics/codes/env.js +14 -3
- package/dist/diagnostics/codes/env.js.map +1 -1
- package/dist/diagnostics/codes/home.js +1 -1
- package/dist/diagnostics/codes/home.js.map +1 -1
- package/dist/diagnostics/codes/platform.js +2 -2
- package/dist/diagnostics/codes/platform.js.map +1 -1
- package/dist/methods/artifact/create.d.ts.map +1 -1
- package/dist/methods/artifact/create.js +2 -1
- package/dist/methods/artifact/create.js.map +1 -1
- package/package.json +2 -2
- package/schemas/protocol.draft-07.json +3 -3
- package/schemas/protocol.schema.json +3 -3
- package/src/artifact.ts +7 -2
- package/src/diagnostics/codes/env.ts +14 -2
- package/src/diagnostics/codes/home.ts +1 -1
- package/src/diagnostics/codes/platform.ts +2 -2
- package/src/methods/artifact/create.ts +2 -1
package/dist/artifact.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.d.ts","names":[],"sources":["../src/artifact.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"artifact.d.ts","names":[],"sources":["../src/artifact.ts"],"mappings":";;;;;;;YAqBY;WAAuB;;WAA4B;;;YAGnD;WAAyB;;WAAkC;;;qBAG1D,WAAW,EAAE,QAAQ;;qBASrB,aAAa,EAAE,QAAQ;;iBAQnB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;;;WAKA;;;iBAIM;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,gBAAgB;;WAEhB;;WAEA,SAAS;;WAET;;WAEA;;WAEA,gBAAgB;;;iBAIV,uBAAuB;;WAE7B,UAAU;;WAEV,mBAAmB;;;;;;iBAOb;;WAEN;;WAEA;;WAEA;;;;;;WAMA;;;;;WAKA;;WAEA;;WAEA;;WAEA;;;qBAIE,gBAAgB,EAAE,QAAQ;;qBA2B1B,iBAAiB,EAAE,QAAQ;;qBAQ3B,gBAAgB,EAAE,QAAQ;;qBAY1B,gBAAgB,EAAE,QAAQ"}
|
package/dist/artifact.js
CHANGED
|
@@ -7,8 +7,13 @@ import * as z from "zod";
|
|
|
7
7
|
* Artifacts and versions as clients see them (INTERFACES §6): how a client names an artifact or its
|
|
8
8
|
* source, and the summaries `artifact/list`, `artifact/get` and `artifact/publish` return.
|
|
9
9
|
*/
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* An absolute file system path: the client resolves relative paths against its own directory.
|
|
12
|
+
* POSIX `/…`, and on Windows a drive path (`C:\…`, `C:/…`) or a UNC path (`\\server\share\…`,
|
|
13
|
+
* WP-W1, D150); a drive-relative `C:x` or a root-relative `\x` isn't absolute. The Windows forms
|
|
14
|
+
* are alternatives beside the POSIX one, which the schema gate reads as a widening (D32).
|
|
15
|
+
*/
|
|
16
|
+
const AbsolutePath = z.string().regex(/^(?:\/|[A-Za-z]:[\\/]|\\\\[^\\])/);
|
|
12
17
|
/** The Zod schema of the `SourceRef` type. */
|
|
13
18
|
const SourceRef = z.union([z.object({ path: AbsolutePath }), z.object({ artifactId: ArtifactId.schema })]).register(wireRegistry, {
|
|
14
19
|
id: "SourceRef",
|
|
@@ -74,6 +79,6 @@ const PublishReceipt = z.object({
|
|
|
74
79
|
description: "The receipt of artifact/publish: artifact, version, number, capability URL when served, event cursor, reuse."
|
|
75
80
|
});
|
|
76
81
|
//#endregion
|
|
77
|
-
export { ArtifactDetail, ArtifactRef, ArtifactSummary, PublishReceipt, SourceRef, VersionSummary };
|
|
82
|
+
export { AbsolutePath, ArtifactDetail, ArtifactRef, ArtifactSummary, PublishReceipt, SourceRef, VersionSummary };
|
|
78
83
|
|
|
79
84
|
//# sourceMappingURL=artifact.js.map
|
package/dist/artifact.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.js","names":[],"sources":["../src/artifact.ts"],"sourcesContent":["/**\n * Artifacts and versions as clients see them (INTERFACES §6): how a client names an artifact or its\n * source, and the summaries `artifact/list`, `artifact/get` and `artifact/publish` return.\n */\nimport * as z from \"zod\";\nimport { ArtifactId, Cursor, TokenId, VersionId } from \"./ids.ts\";\nimport { ArtifactLink, ArtifactManifest, SubmissionPolicy } from \"./manifest.ts\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\n
|
|
1
|
+
{"version":3,"file":"artifact.js","names":[],"sources":["../src/artifact.ts"],"sourcesContent":["/**\n * Artifacts and versions as clients see them (INTERFACES §6): how a client names an artifact or its\n * source, and the summaries `artifact/list`, `artifact/get` and `artifact/publish` return.\n */\nimport * as z from \"zod\";\nimport { ArtifactId, Cursor, TokenId, VersionId } from \"./ids.ts\";\nimport { ArtifactLink, ArtifactManifest, SubmissionPolicy } from \"./manifest.ts\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\n/**\n * An absolute file system path: the client resolves relative paths against its own directory.\n * POSIX `/…`, and on Windows a drive path (`C:\\…`, `C:/…`) or a UNC path (`\\\\server\\share\\…`,\n * WP-W1, D150); a drive-relative `C:x` or a root-relative `\\x` isn't absolute. The Windows forms\n * are alternatives beside the POSIX one, which the schema gate reads as a widening (D32).\n */\nexport const AbsolutePath: z.ZodString = z.string().regex(/^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\])/);\n\n/**\n * Where to build an artifact from: a source path (a `.tsx`, `.jsx` or `.mdx` file, or a directory\n * with an `index` entry), or an artifact ID, meaning the path it was last published from.\n */\nexport type SourceRef = { readonly path: string } | { readonly artifactId: string };\n\n/** Names an artifact: by its ID, or by a source path bound to it. */\nexport type ArtifactRef = { readonly artifactId: string } | { readonly path: string };\n\n/** The Zod schema of the `SourceRef` type. */\nexport const SourceRef: z.ZodType<SourceRef> = z\n .union([z.object({ path: AbsolutePath }), z.object({ artifactId: ArtifactId.schema })])\n .register(wireRegistry, {\n id: \"SourceRef\",\n description:\n \"Where to build an artifact from: an absolute source path, or an artifact ID (its last published source path).\",\n });\n\n/** The Zod schema of the `ArtifactRef` type. */\nexport const ArtifactRef: z.ZodType<ArtifactRef> = z\n .union([z.object({ artifactId: ArtifactId.schema }), z.object({ path: AbsolutePath })])\n .register(wireRegistry, {\n id: \"ArtifactRef\",\n description: \"Names an artifact by its ID or by an absolute source path bound to it.\",\n });\n\n/** One published version. */\nexport interface VersionSummary {\n /** The content-addressed version ID (D89). */\n readonly id: string;\n /** The per-artifact version number, for people: 1, 2, 3 … */\n readonly number: number;\n /** When it was published (RFC 3339, UTC). */\n readonly publishedAt: string;\n /** SHA-256 of the source tree's canonical listing, lowercase hex (DATA_MODEL §2). */\n readonly sourceDigest: string;\n /** SHA-256 of the build environment's canonical JSON, lowercase hex (DATA_MODEL §2). */\n readonly envDigest: string;\n /** SHA-256 of the build output's canonical listing: recorded, never identity (VR-01). */\n readonly outputDigest: string;\n /** Diagnostic codes a forced publish recorded (D41); absent when none. */\n readonly forcedDiagnostics?: readonly string[];\n /**\n * When `mostra gc` removed the version's files (D140): its ID and number stay, but it can't be\n * opened until its exact source is published again. Absent for a version whose files exist.\n */\n readonly collected?: string;\n}\n\n/** One artifact, as `artifact/list` returns it. Metadata comes from the latest version's manifest. */\nexport interface ArtifactSummary {\n /** The artifact ID. */\n readonly id: string;\n /** The title people see. */\n readonly title: string;\n /** What the artifact is for. */\n readonly description?: string;\n /** What kind of artifact it is. */\n readonly family?: string;\n /** Related artifacts. */\n readonly links: readonly ArtifactLink[];\n /** The render mode of the latest version. */\n readonly mode: \"spa\";\n /** The submission policy requested at publish or in the manifest; the host decides (D39). */\n readonly policy?: SubmissionPolicy;\n /** The source path the artifact was last published from. */\n readonly source?: string;\n /** When the artifact was first published (RFC 3339, UTC). */\n readonly createdAt: string;\n /** The version viewers are offered. */\n readonly latestVersion?: VersionSummary;\n}\n\n/** One artifact in full, as `artifact/get` returns it. */\nexport interface ArtifactDetail extends ArtifactSummary {\n /** The latest version's manifest. */\n readonly manifest: ArtifactManifest;\n /** Every version, newest number first. */\n readonly versions: readonly VersionSummary[];\n}\n\n/**\n * The receipt of `artifact/publish` (INTERFACES §6, H-07). Everything it names is durable before the\n * response is sent.\n */\nexport interface PublishReceipt {\n /** The artifact the version belongs to. */\n readonly artifactId: string;\n /** The content-addressed version ID (D89). */\n readonly versionId: string;\n /** The version number. */\n readonly version: number;\n /**\n * The capability URL: the artifact's default link (D97), the same for every publish until it is\n * rotated or revoked. Instances with the gateway (WP-05 on) always set it; optional on\n * the wire so instances without it can publish (D90).\n */\n readonly url?: string;\n /**\n * The ID of the token behind `url`, the artifact's default link (D97), for `view/rotate` and\n * `view/revoke`. Present whenever `url` is.\n */\n readonly tokenId?: string;\n /** The event cursor of the version's `version.published` event; `wait` and events read after it. */\n readonly cursor: string;\n /** `true` when this artifact already had this exact source and environment as a version. */\n readonly reused: boolean;\n /** The error codes a forced publish recorded (D41). */\n readonly forcedDiagnostics?: readonly string[];\n}\n\n/** The Zod schema of the `VersionSummary` type. */\nexport const VersionSummary: z.ZodType<VersionSummary> = z\n .object({\n id: VersionId.schema,\n number: z.int().min(1),\n publishedAt: z.iso.datetime(),\n sourceDigest: z.string().regex(/^[0-9a-f]{64}$/),\n envDigest: z.string().regex(/^[0-9a-f]{64}$/),\n outputDigest: z.string().regex(/^[0-9a-f]{64}$/),\n forcedDiagnostics: z.array(z.string()).readonly().exactOptional(),\n collected: z.iso.datetime().exactOptional(),\n })\n .register(wireRegistry, { id: \"VersionSummary\", description: \"One published version.\" });\n\nconst summaryShape = {\n id: ArtifactId.schema,\n title: z.string(),\n description: z.string().exactOptional(),\n family: z.string().exactOptional(),\n links: z.array(ArtifactLink).readonly(),\n mode: z.literal(\"spa\"),\n policy: SubmissionPolicy.exactOptional(),\n source: z.string().exactOptional(),\n createdAt: z.iso.datetime(),\n latestVersion: VersionSummary.exactOptional(),\n};\n\n/** The Zod schema of the `ArtifactSummary` type. */\nexport const ArtifactSummary: z.ZodType<ArtifactSummary> = z\n .object(summaryShape)\n .register(wireRegistry, {\n id: \"ArtifactSummary\",\n description: \"One artifact: metadata from its latest version, its source and latest version.\",\n });\n\n/** The Zod schema of the `ArtifactDetail` type. */\nexport const ArtifactDetail: z.ZodType<ArtifactDetail> = z\n .object({\n ...summaryShape,\n manifest: ArtifactManifest,\n versions: z.array(VersionSummary).readonly(),\n })\n .register(wireRegistry, {\n id: \"ArtifactDetail\",\n description: \"One artifact in full: its summary, the latest manifest and every version.\",\n });\n\n/** The Zod schema of the `PublishReceipt` type. */\nexport const PublishReceipt: z.ZodType<PublishReceipt> = z\n .object({\n artifactId: ArtifactId.schema,\n versionId: VersionId.schema,\n version: z.int().min(1),\n url: z.string().exactOptional(),\n tokenId: TokenId.schema.exactOptional(),\n cursor: Cursor.schema,\n reused: z.boolean(),\n forcedDiagnostics: z.array(z.string()).readonly().exactOptional(),\n })\n .register(wireRegistry, {\n id: \"PublishReceipt\",\n description:\n \"The receipt of artifact/publish: artifact, version, number, capability URL when served, event cursor, reuse.\",\n });\n"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAa,eAA4B,EAAE,OAAO,CAAC,CAAC,MAAM,kCAAkC;;AAY5F,MAAa,YAAkC,EAC5C,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY,WAAW,OAAO,CAAC,CAAC,CAAC,CAAC,CACtF,SAAS,cAAc;CACtB,IAAI;CACJ,aACE;AACJ,CAAC;;AAGH,MAAa,cAAsC,EAChD,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,WAAW,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC,CAAC,CAAC,CAAC,CACtF,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;AAwFH,MAAa,iBAA4C,EACtD,OAAO;CACN,IAAI,UAAU;CACd,QAAQ,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;CACrB,aAAa,EAAE,IAAI,SAAS;CAC5B,cAAc,EAAE,OAAO,CAAC,CAAC,MAAM,gBAAgB;CAC/C,WAAW,EAAE,OAAO,CAAC,CAAC,MAAM,gBAAgB;CAC5C,cAAc,EAAE,OAAO,CAAC,CAAC,MAAM,gBAAgB;CAC/C,mBAAmB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;CAChE,WAAW,EAAE,IAAI,SAAS,CAAC,CAAC,cAAc;AAC5C,CAAC,CAAC,CACD,SAAS,cAAc;CAAE,IAAI;CAAkB,aAAa;AAAyB,CAAC;AAEzF,MAAM,eAAe;CACnB,IAAI,WAAW;CACf,OAAO,EAAE,OAAO;CAChB,aAAa,EAAE,OAAO,CAAC,CAAC,cAAc;CACtC,QAAQ,EAAE,OAAO,CAAC,CAAC,cAAc;CACjC,OAAO,EAAE,MAAM,YAAY,CAAC,CAAC,SAAS;CACtC,MAAM,EAAE,QAAQ,KAAK;CACrB,QAAQ,iBAAiB,cAAc;CACvC,QAAQ,EAAE,OAAO,CAAC,CAAC,cAAc;CACjC,WAAW,EAAE,IAAI,SAAS;CAC1B,eAAe,eAAe,cAAc;AAC9C;;AAGA,MAAa,kBAA8C,EACxD,OAAO,YAAY,CAAC,CACpB,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;AAGH,MAAa,iBAA4C,EACtD,OAAO;CACN,GAAG;CACH,UAAU;CACV,UAAU,EAAE,MAAM,cAAc,CAAC,CAAC,SAAS;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;AAGH,MAAa,iBAA4C,EACtD,OAAO;CACN,YAAY,WAAW;CACvB,WAAW,UAAU;CACrB,SAAS,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;CACtB,KAAK,EAAE,OAAO,CAAC,CAAC,cAAc;CAC9B,SAAS,QAAQ,OAAO,cAAc;CACtC,QAAQ,OAAO;CACf,QAAQ,EAAE,QAAQ;CAClB,mBAAmB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;AAClE,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aACE;AACJ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../spec.js";
|
|
2
2
|
//#region src/diagnostics/codes/env.d.ts
|
|
3
3
|
/** The codes of the ENV area, in the order they were added. */
|
|
4
|
-
export declare const envDiagnosticCodes: readonly ["MOSTRA_ENV_WARM_MISSING", "MOSTRA_ENV_PORT_TAKEN", "MOSTRA_ENV_BIND_FAILED", "MOSTRA_ENV_SHELL_MISSING", "MOSTRA_ENV_SERVICE_FAILED", "MOSTRA_ENV_BROWSER_MISSING", "MOSTRA_ENV_RUNTIME_MISSING", "MOSTRA_ENV_BUNDLE_INVALID", "MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED", "MOSTRA_ENV_BUNDLE_UNAVAILABLE", "MOSTRA_ENV_NODE_UNSUPPORTED"];
|
|
4
|
+
export declare const envDiagnosticCodes: readonly ["MOSTRA_ENV_WARM_MISSING", "MOSTRA_ENV_PORT_TAKEN", "MOSTRA_ENV_BIND_FAILED", "MOSTRA_ENV_SHELL_MISSING", "MOSTRA_ENV_SERVICE_FAILED", "MOSTRA_ENV_BROWSER_MISSING", "MOSTRA_ENV_RUNTIME_MISSING", "MOSTRA_ENV_BUNDLE_INVALID", "MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED", "MOSTRA_ENV_BUNDLE_UNAVAILABLE", "MOSTRA_ENV_NODE_UNSUPPORTED", "MOSTRA_ENV_HELPER_MISSING"];
|
|
5
5
|
/** The codes of the ENV area. */
|
|
6
6
|
export type EnvDiagnosticCode = (typeof envDiagnosticCodes)[number];
|
|
7
7
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","names":[],"sources":["../../../src/diagnostics/codes/env.ts"],"mappings":";;;qBAMa;;
|
|
1
|
+
{"version":3,"file":"env.d.ts","names":[],"sources":["../../../src/diagnostics/codes/env.ts"],"mappings":";;;qBAMa;;YAiBD,4BAA4B"}
|
|
@@ -11,7 +11,8 @@ const envDiagnosticCodes = [
|
|
|
11
11
|
"MOSTRA_ENV_BUNDLE_INVALID",
|
|
12
12
|
"MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED",
|
|
13
13
|
"MOSTRA_ENV_BUNDLE_UNAVAILABLE",
|
|
14
|
-
"MOSTRA_ENV_NODE_UNSUPPORTED"
|
|
14
|
+
"MOSTRA_ENV_NODE_UNSUPPORTED",
|
|
15
|
+
"MOSTRA_ENV_HELPER_MISSING"
|
|
15
16
|
];
|
|
16
17
|
/** The ENV area's catalog entries. */
|
|
17
18
|
const envDiagnostics = {
|
|
@@ -61,8 +62,8 @@ const envDiagnostics = {
|
|
|
61
62
|
title: "Login service could not be installed",
|
|
62
63
|
hint: "Read the message, fix what it names, and run the install again.",
|
|
63
64
|
docs: {
|
|
64
|
-
explanation: "`mostra daemon install` couldn't register the home's daemon as a login service: writing the launchd agent
|
|
65
|
-
fix: "Check the named file's directory permissions
|
|
65
|
+
explanation: "`mostra daemon install` couldn't register the home's daemon as a login service: writing the launchd agent, systemd user unit or Task Scheduler task failed, or `launchctl`, `systemctl --user` or `schtasks` refused it.",
|
|
66
|
+
fix: "Check the named file's directory permissions; on Linux, that a systemd user session is running (`systemctl --user status`); on Windows, that Task Scheduler runs and your account may create tasks (`schtasks /Query`). On a machine without one, start the daemon from your own login scripts with `mostra daemon start`."
|
|
66
67
|
}
|
|
67
68
|
},
|
|
68
69
|
MOSTRA_ENV_BROWSER_MISSING: {
|
|
@@ -124,6 +125,16 @@ const envDiagnostics = {
|
|
|
124
125
|
explanation: "A `mostra` (or `npm create mostra`) installed from npm starts on the machine's Node.js only long enough to find its runtime bundle, then every Mostra process runs on the bundle's own Node.js (RT-01, D142). That start needs Node.js 22.19 or later, and this one is older, so Mostra stopped before loading anything.",
|
|
125
126
|
fix: "Upgrade the machine's Node.js to 22.19 or later, or run Mostra without npm: download the runtime bundle for your platform from the GitHub release, check it against `SHA256SUMS`, extract it, run its `bin/mostra-setup` once, then use its `bin/mostra`."
|
|
126
127
|
}
|
|
128
|
+
},
|
|
129
|
+
MOSTRA_ENV_HELPER_MISSING: {
|
|
130
|
+
severity: "error",
|
|
131
|
+
phase: "platform",
|
|
132
|
+
title: "Windows helper missing",
|
|
133
|
+
hint: "Reinstall Mostra, or set `MOSTRA_WIN_HELPER` to its `mostra-win.exe`.",
|
|
134
|
+
docs: {
|
|
135
|
+
explanation: "On Windows the runtime runs `mostra-win.exe`, a helper that ships with it, for what Node.js can't do there: owner-only access to the home, the home's control pipe, and every child process in a Job Object. The runtime looked for it at `MOSTRA_WIN_HELPER`, in its runtime bundle, and in a development checkout's Cargo build, and found none, so it stopped before touching the home.",
|
|
136
|
+
fix: "Reinstall Mostra so the runtime bundle is complete. In a development checkout, build the helper with `cargo build -p mostra-win`. A custom layout can point the runtime at the helper with `MOSTRA_WIN_HELPER`."
|
|
137
|
+
}
|
|
127
138
|
}
|
|
128
139
|
};
|
|
129
140
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","names":[],"sources":["../../../src/diagnostics/codes/env.ts"],"sourcesContent":["/**\n * Diagnostic codes of the ENV area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the ENV area, in the order they were added. */\nexport const envDiagnosticCodes = [\n \"MOSTRA_ENV_WARM_MISSING\",\n \"MOSTRA_ENV_PORT_TAKEN\",\n \"MOSTRA_ENV_BIND_FAILED\",\n \"MOSTRA_ENV_SHELL_MISSING\",\n \"MOSTRA_ENV_SERVICE_FAILED\",\n \"MOSTRA_ENV_BROWSER_MISSING\",\n \"MOSTRA_ENV_RUNTIME_MISSING\",\n \"MOSTRA_ENV_BUNDLE_INVALID\",\n \"MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED\",\n \"MOSTRA_ENV_BUNDLE_UNAVAILABLE\",\n \"MOSTRA_ENV_NODE_UNSUPPORTED\",\n // gen:codes\n] as const;\n\n/** The codes of the ENV area. */\nexport type EnvDiagnosticCode = (typeof envDiagnosticCodes)[number];\n\n/** The ENV area's catalog entries. */\nexport const envDiagnostics: AreaCatalog<EnvDiagnosticCode> = {\n MOSTRA_ENV_WARM_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Warm package set missing\",\n hint: \"Reinstall the Mostra runtime, or set `MOSTRA_WARM_DIR` to its warm package set.\",\n docs: {\n explanation:\n \"Builds resolve React, Tailwind and Mostra's own client packages from the warm package set that ships with the runtime. The runtime couldn't find it, which means the runtime installation is incomplete.\",\n fix: \"Reinstall Mostra so the runtime bundle is complete. A custom layout can point the runtime at the warm set's directory with `MOSTRA_WARM_DIR`.\",\n },\n },\n MOSTRA_ENV_PORT_TAKEN: {\n severity: \"warning\",\n phase: \"host\",\n title: \"Leased port taken\",\n hint: \"Open the artifact through a new link: `view/url` or `mostra open` mints one on the new port.\",\n docs: {\n explanation:\n \"The shell's port or an artifact's port is leased per home and reused across restarts, so links keep working (D62, D99). At start-up another program held the leased port, so Mostra leased a new one. Links that named the old port stop working; the shell's port changing affects every link of the home.\",\n fix: \"Mint new links with `view/url` (the publish receipt of the next publish carries the new default link too). Stop the program that took the port if you want the old links back; `mostra doctor` names it where it can.\",\n },\n },\n MOSTRA_ENV_BIND_FAILED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Gateway can't bind\",\n hint: \"Start Mostra with an address this machine has, or without `--bind` to use the loopback address.\",\n docs: {\n explanation:\n \"The gateway couldn't listen on the address it was given: `--bind` named an address no interface has, a wildcard bind came without `--url-host`, or the operating system refused the address. Mostra doesn't start rather than serve on an address nobody asked for.\",\n fix: \"Omit `--bind` to serve on `127.0.0.1` only (the default). For a wider bind, pass an address of one of this machine's interfaces, and with `0.0.0.0` or `::` also `--url-host <name>`, the name viewers use to reach it.\",\n },\n },\n MOSTRA_ENV_SHELL_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Shell app missing\",\n hint: \"Reinstall the Mostra runtime, or set `MOSTRA_SHELL_DIR` to its built shell.\",\n docs: {\n explanation:\n \"Viewers open artifacts inside the shell, Mostra's trusted page, which ships with the runtime as built files. The runtime couldn't find them, which means the runtime installation is incomplete. Artifact frames are still served.\",\n fix: \"Reinstall Mostra so the runtime bundle is complete. A custom layout can point the runtime at the shell's built directory with `MOSTRA_SHELL_DIR`.\",\n },\n },\n MOSTRA_ENV_SERVICE_FAILED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Login service could not be installed\",\n hint: \"Read the message, fix what it names, and run the install again.\",\n docs: {\n explanation:\n \"`mostra daemon install` couldn't register the home's daemon as a login service: writing the launchd agent or systemd user unit failed, or `launchctl` or `systemctl --user` refused to load it.\",\n fix: \"Check the named file's directory permissions, and on Linux that a systemd user session is running (`systemctl --user status`). On a machine without one, start the daemon from your own login scripts with `mostra daemon start`.\",\n },\n },\n MOSTRA_ENV_BROWSER_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Browser for verify missing\",\n hint: \"Run the runtime bundle's `bin/mostra-setup` (with network access) to fetch the browser verify uses, then verify again.\",\n docs: {\n explanation:\n \"Verify renders pages in the Chromium headless shell its Playwright release pins. The runtime bundle fetches that browser when it is set up and checks every file of it (D142). It wasn't there, so verify ran only the stages that need no browser (type check, build and the field-ID scan) and reported this error. Publishing needs `--force` until it is installed.\",\n fix: \"Run `bin/mostra-setup` in the runtime bundle's directory (the message names it) with network access; it fetches and checks the pinned browser. Outside a bundle, in a development checkout, run `npx playwright-core install chromium-headless-shell`. Then verify again.\",\n },\n },\n MOSTRA_ENV_RUNTIME_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Runtime not found\",\n hint: \"Reinstall Mostra, or set `MOSTRA_RUNTIME_BIN` to the runtime's `mostra-runtime` entry.\",\n docs: {\n explanation:\n \"The CLI starts and attaches to the home's instance through the runtime binary (`mostra-runtime`, D85). It looked, in order, for `MOSTRA_BUNDLE`, `MOSTRA_RUNTIME_BIN`, the runtime bundle it runs from, its release's pinned bundle and a development checkout's built runtime (D142), and found nothing it could run: here, `MOSTRA_RUNTIME_BIN` names a file that doesn't exist, or the runtime couldn't be started.\",\n fix: \"Unset `MOSTRA_RUNTIME_BIN` or point it at a `mostra-runtime` entry (its `dist/bin.js`), or reinstall Mostra so the CLI and its runtime are complete.\",\n },\n },\n MOSTRA_ENV_BUNDLE_INVALID: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Runtime bundle failed verification\",\n hint: \"Nothing was installed; install Mostra again, and if it fails the same way, report it with the message.\",\n docs: {\n explanation:\n \"Mostra checks every runtime bundle before it runs anything from it: the archive against the SHA-256 the installing package pins, then each extracted file against the bundle's own file list, and the verify browser against the bundle's browser pin. One of them differed, so the download was corrupted, changed on the way or replaced, and Mostra refused it. A bundle already installed that fails a later check (`mostra doctor --deep`) is refused the same way.\",\n fix: \"Run the install again (`npm create mostra`, or the command that started it), which downloads a fresh copy. When a mirror is configured (`MOSTRA_BUNDLE_MIRROR`), check that it serves the release's files unchanged. Check a file you downloaded yourself against the release's `SHA256SUMS`, or with `gh attestation verify <file> --repo mostra-dev/mostra`.\",\n },\n },\n MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Runtime bundle download failed\",\n hint: \"Check the network or proxy (`HTTPS_PROXY`), then run the command again: a retry starts the download over.\",\n docs: {\n explanation:\n \"The runtime bundle for this release and platform isn't in the local cache yet, and fetching it failed: the network or a proxy refused it, the server answered with an error, the connection stalled for 60 seconds, or the disk ran out of space while it was written. Nothing partial is kept.\",\n fix: \"Check the connection, and set `HTTPS_PROXY` (and `NO_PROXY`) when the network needs a proxy. Behind a firewall that blocks GitHub, host the release's files on a reachable server and set `MOSTRA_BUNDLE_MIRROR` to its base URL (a `file:` URL works for a local directory). Free space in the cache directory (`MOSTRA_CACHE_DIR`) if the message says the disk is full.\",\n },\n },\n MOSTRA_ENV_BUNDLE_UNAVAILABLE: {\n severity: \"error\",\n phase: \"platform\",\n title: \"No runtime bundle available\",\n hint: \"Run this once with network access, or point `MOSTRA_BUNDLE` at an extracted bundle.\",\n docs: {\n explanation:\n \"Mostra runs on its own runtime bundle, found in the local cache, beside the installed package or at `MOSTRA_BUNDLE`. None was there, and no download could start: Mostra is offline (`MOSTRA_OFFLINE`), this build of the package pins no bundle for this platform, or the platform has none.\",\n fix: \"Run the command once with network access and without `MOSTRA_OFFLINE`, so the pinned bundle is fetched and cached; later runs work offline. On a machine without network access, extract the release's archive for the platform and set `MOSTRA_BUNDLE` to its directory. A development checkout uses its own built runtime instead.\",\n },\n },\n MOSTRA_ENV_NODE_UNSUPPORTED: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Node.js too old to start Mostra\",\n hint: \"Run `mostra` with Node.js 22.19 or later, or run the runtime bundle's own `bin/mostra`, which needs no Node.js.\",\n docs: {\n explanation:\n \"A `mostra` (or `npm create mostra`) installed from npm starts on the machine's Node.js only long enough to find its runtime bundle, then every Mostra process runs on the bundle's own Node.js (RT-01, D142). That start needs Node.js 22.19 or later, and this one is older, so Mostra stopped before loading anything.\",\n fix: \"Upgrade the machine's Node.js to 22.19 or later, or run Mostra without npm: download the runtime bundle for your platform from the GitHub release, check it against `SHA256SUMS`, extract it, run its `bin/mostra-setup` once, then use its `bin/mostra`.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,iBAAiD;CAC5D,yBAAyB;EACvB,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,wBAAwB;EACtB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,0BAA0B;EACxB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,2BAA2B;EACzB,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,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,mCAAmC;EACjC,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,6BAA6B;EAC3B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
|
|
1
|
+
{"version":3,"file":"env.js","names":[],"sources":["../../../src/diagnostics/codes/env.ts"],"sourcesContent":["/**\n * Diagnostic codes of the ENV area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the ENV area, in the order they were added. */\nexport const envDiagnosticCodes = [\n \"MOSTRA_ENV_WARM_MISSING\",\n \"MOSTRA_ENV_PORT_TAKEN\",\n \"MOSTRA_ENV_BIND_FAILED\",\n \"MOSTRA_ENV_SHELL_MISSING\",\n \"MOSTRA_ENV_SERVICE_FAILED\",\n \"MOSTRA_ENV_BROWSER_MISSING\",\n \"MOSTRA_ENV_RUNTIME_MISSING\",\n \"MOSTRA_ENV_BUNDLE_INVALID\",\n \"MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED\",\n \"MOSTRA_ENV_BUNDLE_UNAVAILABLE\",\n \"MOSTRA_ENV_NODE_UNSUPPORTED\",\n \"MOSTRA_ENV_HELPER_MISSING\",\n // gen:codes\n] as const;\n\n/** The codes of the ENV area. */\nexport type EnvDiagnosticCode = (typeof envDiagnosticCodes)[number];\n\n/** The ENV area's catalog entries. */\nexport const envDiagnostics: AreaCatalog<EnvDiagnosticCode> = {\n MOSTRA_ENV_WARM_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Warm package set missing\",\n hint: \"Reinstall the Mostra runtime, or set `MOSTRA_WARM_DIR` to its warm package set.\",\n docs: {\n explanation:\n \"Builds resolve React, Tailwind and Mostra's own client packages from the warm package set that ships with the runtime. The runtime couldn't find it, which means the runtime installation is incomplete.\",\n fix: \"Reinstall Mostra so the runtime bundle is complete. A custom layout can point the runtime at the warm set's directory with `MOSTRA_WARM_DIR`.\",\n },\n },\n MOSTRA_ENV_PORT_TAKEN: {\n severity: \"warning\",\n phase: \"host\",\n title: \"Leased port taken\",\n hint: \"Open the artifact through a new link: `view/url` or `mostra open` mints one on the new port.\",\n docs: {\n explanation:\n \"The shell's port or an artifact's port is leased per home and reused across restarts, so links keep working (D62, D99). At start-up another program held the leased port, so Mostra leased a new one. Links that named the old port stop working; the shell's port changing affects every link of the home.\",\n fix: \"Mint new links with `view/url` (the publish receipt of the next publish carries the new default link too). Stop the program that took the port if you want the old links back; `mostra doctor` names it where it can.\",\n },\n },\n MOSTRA_ENV_BIND_FAILED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Gateway can't bind\",\n hint: \"Start Mostra with an address this machine has, or without `--bind` to use the loopback address.\",\n docs: {\n explanation:\n \"The gateway couldn't listen on the address it was given: `--bind` named an address no interface has, a wildcard bind came without `--url-host`, or the operating system refused the address. Mostra doesn't start rather than serve on an address nobody asked for.\",\n fix: \"Omit `--bind` to serve on `127.0.0.1` only (the default). For a wider bind, pass an address of one of this machine's interfaces, and with `0.0.0.0` or `::` also `--url-host <name>`, the name viewers use to reach it.\",\n },\n },\n MOSTRA_ENV_SHELL_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Shell app missing\",\n hint: \"Reinstall the Mostra runtime, or set `MOSTRA_SHELL_DIR` to its built shell.\",\n docs: {\n explanation:\n \"Viewers open artifacts inside the shell, Mostra's trusted page, which ships with the runtime as built files. The runtime couldn't find them, which means the runtime installation is incomplete. Artifact frames are still served.\",\n fix: \"Reinstall Mostra so the runtime bundle is complete. A custom layout can point the runtime at the shell's built directory with `MOSTRA_SHELL_DIR`.\",\n },\n },\n MOSTRA_ENV_SERVICE_FAILED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Login service could not be installed\",\n hint: \"Read the message, fix what it names, and run the install again.\",\n docs: {\n explanation:\n \"`mostra daemon install` couldn't register the home's daemon as a login service: writing the launchd agent, systemd user unit or Task Scheduler task failed, or `launchctl`, `systemctl --user` or `schtasks` refused it.\",\n fix: \"Check the named file's directory permissions; on Linux, that a systemd user session is running (`systemctl --user status`); on Windows, that Task Scheduler runs and your account may create tasks (`schtasks /Query`). On a machine without one, start the daemon from your own login scripts with `mostra daemon start`.\",\n },\n },\n MOSTRA_ENV_BROWSER_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Browser for verify missing\",\n hint: \"Run the runtime bundle's `bin/mostra-setup` (with network access) to fetch the browser verify uses, then verify again.\",\n docs: {\n explanation:\n \"Verify renders pages in the Chromium headless shell its Playwright release pins. The runtime bundle fetches that browser when it is set up and checks every file of it (D142). It wasn't there, so verify ran only the stages that need no browser (type check, build and the field-ID scan) and reported this error. Publishing needs `--force` until it is installed.\",\n fix: \"Run `bin/mostra-setup` in the runtime bundle's directory (the message names it) with network access; it fetches and checks the pinned browser. Outside a bundle, in a development checkout, run `npx playwright-core install chromium-headless-shell`. Then verify again.\",\n },\n },\n MOSTRA_ENV_RUNTIME_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Runtime not found\",\n hint: \"Reinstall Mostra, or set `MOSTRA_RUNTIME_BIN` to the runtime's `mostra-runtime` entry.\",\n docs: {\n explanation:\n \"The CLI starts and attaches to the home's instance through the runtime binary (`mostra-runtime`, D85). It looked, in order, for `MOSTRA_BUNDLE`, `MOSTRA_RUNTIME_BIN`, the runtime bundle it runs from, its release's pinned bundle and a development checkout's built runtime (D142), and found nothing it could run: here, `MOSTRA_RUNTIME_BIN` names a file that doesn't exist, or the runtime couldn't be started.\",\n fix: \"Unset `MOSTRA_RUNTIME_BIN` or point it at a `mostra-runtime` entry (its `dist/bin.js`), or reinstall Mostra so the CLI and its runtime are complete.\",\n },\n },\n MOSTRA_ENV_BUNDLE_INVALID: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Runtime bundle failed verification\",\n hint: \"Nothing was installed; install Mostra again, and if it fails the same way, report it with the message.\",\n docs: {\n explanation:\n \"Mostra checks every runtime bundle before it runs anything from it: the archive against the SHA-256 the installing package pins, then each extracted file against the bundle's own file list, and the verify browser against the bundle's browser pin. One of them differed, so the download was corrupted, changed on the way or replaced, and Mostra refused it. A bundle already installed that fails a later check (`mostra doctor --deep`) is refused the same way.\",\n fix: \"Run the install again (`npm create mostra`, or the command that started it), which downloads a fresh copy. When a mirror is configured (`MOSTRA_BUNDLE_MIRROR`), check that it serves the release's files unchanged. Check a file you downloaded yourself against the release's `SHA256SUMS`, or with `gh attestation verify <file> --repo mostra-dev/mostra`.\",\n },\n },\n MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Runtime bundle download failed\",\n hint: \"Check the network or proxy (`HTTPS_PROXY`), then run the command again: a retry starts the download over.\",\n docs: {\n explanation:\n \"The runtime bundle for this release and platform isn't in the local cache yet, and fetching it failed: the network or a proxy refused it, the server answered with an error, the connection stalled for 60 seconds, or the disk ran out of space while it was written. Nothing partial is kept.\",\n fix: \"Check the connection, and set `HTTPS_PROXY` (and `NO_PROXY`) when the network needs a proxy. Behind a firewall that blocks GitHub, host the release's files on a reachable server and set `MOSTRA_BUNDLE_MIRROR` to its base URL (a `file:` URL works for a local directory). Free space in the cache directory (`MOSTRA_CACHE_DIR`) if the message says the disk is full.\",\n },\n },\n MOSTRA_ENV_BUNDLE_UNAVAILABLE: {\n severity: \"error\",\n phase: \"platform\",\n title: \"No runtime bundle available\",\n hint: \"Run this once with network access, or point `MOSTRA_BUNDLE` at an extracted bundle.\",\n docs: {\n explanation:\n \"Mostra runs on its own runtime bundle, found in the local cache, beside the installed package or at `MOSTRA_BUNDLE`. None was there, and no download could start: Mostra is offline (`MOSTRA_OFFLINE`), this build of the package pins no bundle for this platform, or the platform has none.\",\n fix: \"Run the command once with network access and without `MOSTRA_OFFLINE`, so the pinned bundle is fetched and cached; later runs work offline. On a machine without network access, extract the release's archive for the platform and set `MOSTRA_BUNDLE` to its directory. A development checkout uses its own built runtime instead.\",\n },\n },\n MOSTRA_ENV_NODE_UNSUPPORTED: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Node.js too old to start Mostra\",\n hint: \"Run `mostra` with Node.js 22.19 or later, or run the runtime bundle's own `bin/mostra`, which needs no Node.js.\",\n docs: {\n explanation:\n \"A `mostra` (or `npm create mostra`) installed from npm starts on the machine's Node.js only long enough to find its runtime bundle, then every Mostra process runs on the bundle's own Node.js (RT-01, D142). That start needs Node.js 22.19 or later, and this one is older, so Mostra stopped before loading anything.\",\n fix: \"Upgrade the machine's Node.js to 22.19 or later, or run Mostra without npm: download the runtime bundle for your platform from the GitHub release, check it against `SHA256SUMS`, extract it, run its `bin/mostra-setup` once, then use its `bin/mostra`.\",\n },\n },\n MOSTRA_ENV_HELPER_MISSING: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Windows helper missing\",\n hint: \"Reinstall Mostra, or set `MOSTRA_WIN_HELPER` to its `mostra-win.exe`.\",\n docs: {\n explanation:\n \"On Windows the runtime runs `mostra-win.exe`, a helper that ships with it, for what Node.js can't do there: owner-only access to the home, the home's control pipe, and every child process in a Job Object. The runtime looked for it at `MOSTRA_WIN_HELPER`, in its runtime bundle, and in a development checkout's Cargo build, and found none, so it stopped before touching the home.\",\n fix: \"Reinstall Mostra so the runtime bundle is complete. In a development checkout, build the helper with `cargo build -p mostra-win`. A custom layout can point the runtime at the helper with `MOSTRA_WIN_HELPER`.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,iBAAiD;CAC5D,yBAAyB;EACvB,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,wBAAwB;EACtB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,0BAA0B;EACxB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,2BAA2B;EACzB,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,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,mCAAmC;EACjC,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,6BAA6B;EAC3B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
|
|
@@ -112,7 +112,7 @@ const homeDiagnostics = {
|
|
|
112
112
|
hint: "Run `mostra daemon install` so the home's daemon runs as a login service and these artifacts answer at any hour.",
|
|
113
113
|
docs: {
|
|
114
114
|
explanation: "The home has artifacts with submission policy `none`, which are meant to stay open (dashboards, task managers, D63), but no login service runs its daemon. Without one, the daemon exits after 30 idle minutes and their links stop answering until a command starts it again.",
|
|
115
|
-
fix: "Run `mostra daemon install`. It registers a launchd
|
|
115
|
+
fix: "Run `mostra daemon install`. It registers a login service (a launchd agent, a systemd user service or a Task Scheduler task) that keeps the home's daemon running; `mostra daemon uninstall` removes it."
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
MOSTRA_HOME_GC_INCOMPLETE: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home.js","names":[],"sources":["../../../src/diagnostics/codes/home.ts"],"sourcesContent":["/**\n * Diagnostic codes of the HOME area: the Mostra home, its ledger and the instance that owns it\n * (DATA_MODEL §1, §6; FAILURE_MODEL §2, §3).\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the HOME area, in the order they were added. */\nexport const homeDiagnosticCodes = [\n \"MOSTRA_HOME_LOCKED\",\n \"MOSTRA_HOME_NOT_OWNED\",\n \"MOSTRA_HOME_SOCKET_TOO_LONG\",\n \"MOSTRA_HOME_TOO_NEW\",\n \"MOSTRA_HOME_LEDGER_UNREADABLE\",\n \"MOSTRA_HOME_DISK_FULL\",\n \"MOSTRA_HOME_GONE\",\n \"MOSTRA_HOME_MISMATCH\",\n \"MOSTRA_HOME_INTEGRITY\",\n \"MOSTRA_HOME_NOT_ALWAYS_ON\",\n \"MOSTRA_HOME_GC_INCOMPLETE\",\n // gen:codes\n] as const;\n\n/** The codes of the HOME area. */\nexport type HomeDiagnosticCode = (typeof homeDiagnosticCodes)[number];\n\n/** The HOME area's catalog entries. */\nexport const homeDiagnostics: AreaCatalog<HomeDiagnosticCode> = {\n MOSTRA_HOME_LOCKED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Home in use by another instance\",\n hint: \"Use the instance that already owns this home, or stop it (`mostra daemon stop`, or end the process named in the message) and start again.\",\n docs: {\n explanation:\n \"One Mostra instance owns a home at a time. It holds an exclusive lock on the home's ledger, and the operating system releases that lock when the process exits. Mostra reports this code in two cases: `mostra host` was started for a home another instance already owns, or a starter found the owner but couldn't reach its control socket. The message names the owner's process ID.\",\n fix: \"To share the running instance, attach to it: start the client with the same home (`MOSTRA_HOME` or `--home`) instead of starting a second instance. To replace it, stop it with `mostra daemon stop`, or end the process named in the message, and start again. A host that needs its own instance gives it its own home.\",\n },\n },\n MOSTRA_HOME_NOT_OWNED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Directory not owned by you\",\n hint: \"Choose a home you own with `--home` or `MOSTRA_HOME`, or give the directory named in the message back to your user with `chown`.\",\n docs: {\n explanation:\n \"Mostra keeps secrets, answers and its ledger in the home, and its control socket in a runtime directory, so it uses only directories that belong to the user running it. It reports this code when the home or the runtime directory is owned by another user, or when the path exists but isn't a directory. Mostra changes nothing in that case.\",\n fix: \"Point Mostra at a directory you own: `--home <dir>` or `MOSTRA_HOME` for the home, `MOSTRA_RUNTIME_DIR` for the runtime directory. If the directory should be yours, change its owner with `chown`. Mostra tightens a directory you own to mode 0700 by itself.\",\n },\n },\n MOSTRA_HOME_SOCKET_TOO_LONG: {\n severity: \"error\",\n phase: \"host\",\n title: \"Control socket path too long\",\n hint: \"Set `MOSTRA_RUNTIME_DIR` to a short directory you own, for example `/tmp/mostra-$USER`, and start again.\",\n docs: {\n explanation:\n \"Clients reach an instance through a Unix socket in a per-user runtime directory. The operating system limits a socket path to 103 bytes on macOS and 107 on Linux, and the path Mostra computed is longer, usually because the home directory's path is long. Mostra stops instead of using a different place that clients couldn't find.\",\n fix: \"Set `MOSTRA_RUNTIME_DIR` to a short directory you own, such as `/tmp/mostra-$USER`, in the environment of every Mostra client and host that uses this home. Mostra creates it with mode 0700 and re-creates its socket if a temporary-file cleanup removes it.\",\n },\n },\n MOSTRA_HOME_TOO_NEW: {\n severity: \"error\",\n phase: \"host\",\n title: \"Home written by a newer Mostra\",\n hint: \"Run a Mostra release at least as new as the one named in the message, or use another home with `--home`.\",\n docs: {\n explanation:\n \"A newer Mostra migrated this home's ledger to a schema version this runtime doesn't know. Reading it could misinterpret or lose data, so this runtime refuses to open it. The message names the schema version and the release that wrote it.\",\n fix: \"Upgrade the runtime (or the host or CLI that bundles it) to at least the release named in the message. Mostra never migrates a ledger backwards; to keep an older release, give it a separate home with `--home` or `MOSTRA_HOME`.\",\n },\n },\n MOSTRA_HOME_LEDGER_UNREADABLE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Ledger can't be read\",\n hint: \"Restore the ledger from the latest `ledger.sqlite.bak-*` backup in the home's `store/` directory, or move the damaged file aside.\",\n docs: {\n explanation:\n \"The ledger (`store/ledger.sqlite` in the home) holds drafts, submissions, events and the rest of the home's interaction data. Mostra reports this code when the file can't be opened, isn't a SQLite database, isn't a Mostra ledger, or fails SQLite's integrity check. Mostra never replaces an existing ledger with an empty one.\",\n fix: \"Stop every Mostra process for this home. Copy `store/ledger.sqlite` somewhere safe, then restore the newest `store/ledger.sqlite.bak-<from>-<to>` in its place, or move the damaged file aside to start an empty ledger. Versions, sources and blobs in the home are untouched either way.\",\n },\n },\n MOSTRA_HOME_DISK_FULL: {\n severity: \"error\",\n phase: \"host\",\n title: \"Disk full\",\n hint: \"Free space on the disk that holds the Mostra home, then retry.\",\n docs: {\n explanation:\n \"A ledger write failed because the disk holding the home is full. The transaction was rolled back, so nothing partial was saved and nothing that was acknowledged earlier is lost. Viewers keep unsaved edits in their browser until a retry succeeds.\",\n fix: \"Free space on that disk (`mostra gc` removes unreferenced versions; build caches can be deleted), then retry the operation. Retries with the same request or mutation ID are safe.\",\n },\n },\n MOSTRA_HOME_GONE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Home directory removed\",\n hint: \"Restore or recreate the home directory, then start Mostra again.\",\n docs: {\n explanation:\n \"The instance's home directory disappeared or was replaced while the instance was running. Writing anywhere else could split the home's data, so the instance stops accepting requests, stops its child processes and exits.\",\n fix: \"Put the home back (or choose a new one with `--home` or `MOSTRA_HOME`) and start Mostra again. Clients reconnect and retry their requests by ID.\",\n },\n },\n MOSTRA_HOME_MISMATCH: {\n severity: \"error\",\n phase: \"host\",\n title: \"Instance serves a different home\",\n hint: \"Connect to the instance for the home you expect, or start it with `--home` set to that home.\",\n docs: {\n explanation:\n \"A client sent `home.path` in `mostra/initialize`, and it names a different home from the one the instance locked at start-up. The home is chosen when the instance starts (`--home`, then `MOSTRA_HOME`, then the platform default), so `home.path` is a check: it stops a client from writing to a home it didn't mean.\",\n fix: \"Start the instance with `--home` set to the home the client expects, or connect to the socket of the instance that serves it. Leave `home.path` out to accept whichever home the instance serves.\",\n },\n },\n MOSTRA_HOME_INTEGRITY: {\n severity: \"error\",\n phase: \"host\",\n title: \"Stored version or file damaged\",\n hint: \"Publish the version's source again to rebuild a damaged version in place, and run `mostra doctor` for other damaged objects.\",\n docs: {\n explanation:\n \"Mostra checks stored versions, source snapshots and blobs against their recorded content digests before using them. This code means a stored object is missing or its content changed after it was written, for example after a disk error or a manual edit inside the home. The message names the object.\",\n fix: \"Leave files inside the home unchanged. To repair a version, publish the same source again: Mostra rebuilds the version's directory and puts it back under the same version ID, and the artifact keeps its version number. If the source has changed since, the publish makes a new version and the damaged one stays as it is; its source snapshot in the home holds the original files. `mostra doctor` lists other damaged objects.\",\n },\n },\n MOSTRA_HOME_NOT_ALWAYS_ON: {\n severity: \"warning\",\n phase: \"host\",\n title: \"Long-lived artifacts without an always-on daemon\",\n hint: \"Run `mostra daemon install` so the home's daemon runs as a login service and these artifacts answer at any hour.\",\n docs: {\n explanation:\n \"The home has artifacts with submission policy `none`, which are meant to stay open (dashboards, task managers, D63), but no login service runs its daemon. Without one, the daemon exits after 30 idle minutes and their links stop answering until a command starts it again.\",\n fix: \"Run `mostra daemon install`. It registers a launchd or systemd user service that keeps the home's daemon running; `mostra daemon uninstall` removes it.\",\n },\n },\n MOSTRA_HOME_GC_INCOMPLETE: {\n severity: \"warning\",\n phase: \"host\",\n title: \"gc didn't finish a step\",\n hint: \"Run `mostra gc` again: what this run removed is in its result, and the next run picks up what it left.\",\n docs: {\n explanation:\n \"`mostra gc` removes what nothing references in steps: version files, source snapshots, lock layouts, the package store, verify's caches and, when asked, events. One step failed (the message names it and why), so it left that step's files in place. Everything an earlier step removed is listed in the result, and the versions it collected stay collected. The home is consistent: what gc left is still recorded as there.\",\n fix: \"Run `mostra gc` again; a failure that repeats names its cause in the message (for example, a file the user can't remove).\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAOA,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,kBAAmD;CAC9D,oBAAoB;EAClB,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,6BAA6B;EAC3B,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,+BAA+B;EAC7B,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,kBAAkB;EAChB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,sBAAsB;EACpB,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,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
|
|
1
|
+
{"version":3,"file":"home.js","names":[],"sources":["../../../src/diagnostics/codes/home.ts"],"sourcesContent":["/**\n * Diagnostic codes of the HOME area: the Mostra home, its ledger and the instance that owns it\n * (DATA_MODEL §1, §6; FAILURE_MODEL §2, §3).\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the HOME area, in the order they were added. */\nexport const homeDiagnosticCodes = [\n \"MOSTRA_HOME_LOCKED\",\n \"MOSTRA_HOME_NOT_OWNED\",\n \"MOSTRA_HOME_SOCKET_TOO_LONG\",\n \"MOSTRA_HOME_TOO_NEW\",\n \"MOSTRA_HOME_LEDGER_UNREADABLE\",\n \"MOSTRA_HOME_DISK_FULL\",\n \"MOSTRA_HOME_GONE\",\n \"MOSTRA_HOME_MISMATCH\",\n \"MOSTRA_HOME_INTEGRITY\",\n \"MOSTRA_HOME_NOT_ALWAYS_ON\",\n \"MOSTRA_HOME_GC_INCOMPLETE\",\n // gen:codes\n] as const;\n\n/** The codes of the HOME area. */\nexport type HomeDiagnosticCode = (typeof homeDiagnosticCodes)[number];\n\n/** The HOME area's catalog entries. */\nexport const homeDiagnostics: AreaCatalog<HomeDiagnosticCode> = {\n MOSTRA_HOME_LOCKED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Home in use by another instance\",\n hint: \"Use the instance that already owns this home, or stop it (`mostra daemon stop`, or end the process named in the message) and start again.\",\n docs: {\n explanation:\n \"One Mostra instance owns a home at a time. It holds an exclusive lock on the home's ledger, and the operating system releases that lock when the process exits. Mostra reports this code in two cases: `mostra host` was started for a home another instance already owns, or a starter found the owner but couldn't reach its control socket. The message names the owner's process ID.\",\n fix: \"To share the running instance, attach to it: start the client with the same home (`MOSTRA_HOME` or `--home`) instead of starting a second instance. To replace it, stop it with `mostra daemon stop`, or end the process named in the message, and start again. A host that needs its own instance gives it its own home.\",\n },\n },\n MOSTRA_HOME_NOT_OWNED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Directory not owned by you\",\n hint: \"Choose a home you own with `--home` or `MOSTRA_HOME`, or give the directory named in the message back to your user with `chown`.\",\n docs: {\n explanation:\n \"Mostra keeps secrets, answers and its ledger in the home, and its control socket in a runtime directory, so it uses only directories that belong to the user running it. It reports this code when the home or the runtime directory is owned by another user, or when the path exists but isn't a directory. Mostra changes nothing in that case.\",\n fix: \"Point Mostra at a directory you own: `--home <dir>` or `MOSTRA_HOME` for the home, `MOSTRA_RUNTIME_DIR` for the runtime directory. If the directory should be yours, change its owner with `chown`. Mostra tightens a directory you own to mode 0700 by itself.\",\n },\n },\n MOSTRA_HOME_SOCKET_TOO_LONG: {\n severity: \"error\",\n phase: \"host\",\n title: \"Control socket path too long\",\n hint: \"Set `MOSTRA_RUNTIME_DIR` to a short directory you own, for example `/tmp/mostra-$USER`, and start again.\",\n docs: {\n explanation:\n \"Clients reach an instance through a Unix socket in a per-user runtime directory. The operating system limits a socket path to 103 bytes on macOS and 107 on Linux, and the path Mostra computed is longer, usually because the home directory's path is long. Mostra stops instead of using a different place that clients couldn't find.\",\n fix: \"Set `MOSTRA_RUNTIME_DIR` to a short directory you own, such as `/tmp/mostra-$USER`, in the environment of every Mostra client and host that uses this home. Mostra creates it with mode 0700 and re-creates its socket if a temporary-file cleanup removes it.\",\n },\n },\n MOSTRA_HOME_TOO_NEW: {\n severity: \"error\",\n phase: \"host\",\n title: \"Home written by a newer Mostra\",\n hint: \"Run a Mostra release at least as new as the one named in the message, or use another home with `--home`.\",\n docs: {\n explanation:\n \"A newer Mostra migrated this home's ledger to a schema version this runtime doesn't know. Reading it could misinterpret or lose data, so this runtime refuses to open it. The message names the schema version and the release that wrote it.\",\n fix: \"Upgrade the runtime (or the host or CLI that bundles it) to at least the release named in the message. Mostra never migrates a ledger backwards; to keep an older release, give it a separate home with `--home` or `MOSTRA_HOME`.\",\n },\n },\n MOSTRA_HOME_LEDGER_UNREADABLE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Ledger can't be read\",\n hint: \"Restore the ledger from the latest `ledger.sqlite.bak-*` backup in the home's `store/` directory, or move the damaged file aside.\",\n docs: {\n explanation:\n \"The ledger (`store/ledger.sqlite` in the home) holds drafts, submissions, events and the rest of the home's interaction data. Mostra reports this code when the file can't be opened, isn't a SQLite database, isn't a Mostra ledger, or fails SQLite's integrity check. Mostra never replaces an existing ledger with an empty one.\",\n fix: \"Stop every Mostra process for this home. Copy `store/ledger.sqlite` somewhere safe, then restore the newest `store/ledger.sqlite.bak-<from>-<to>` in its place, or move the damaged file aside to start an empty ledger. Versions, sources and blobs in the home are untouched either way.\",\n },\n },\n MOSTRA_HOME_DISK_FULL: {\n severity: \"error\",\n phase: \"host\",\n title: \"Disk full\",\n hint: \"Free space on the disk that holds the Mostra home, then retry.\",\n docs: {\n explanation:\n \"A ledger write failed because the disk holding the home is full. The transaction was rolled back, so nothing partial was saved and nothing that was acknowledged earlier is lost. Viewers keep unsaved edits in their browser until a retry succeeds.\",\n fix: \"Free space on that disk (`mostra gc` removes unreferenced versions; build caches can be deleted), then retry the operation. Retries with the same request or mutation ID are safe.\",\n },\n },\n MOSTRA_HOME_GONE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Home directory removed\",\n hint: \"Restore or recreate the home directory, then start Mostra again.\",\n docs: {\n explanation:\n \"The instance's home directory disappeared or was replaced while the instance was running. Writing anywhere else could split the home's data, so the instance stops accepting requests, stops its child processes and exits.\",\n fix: \"Put the home back (or choose a new one with `--home` or `MOSTRA_HOME`) and start Mostra again. Clients reconnect and retry their requests by ID.\",\n },\n },\n MOSTRA_HOME_MISMATCH: {\n severity: \"error\",\n phase: \"host\",\n title: \"Instance serves a different home\",\n hint: \"Connect to the instance for the home you expect, or start it with `--home` set to that home.\",\n docs: {\n explanation:\n \"A client sent `home.path` in `mostra/initialize`, and it names a different home from the one the instance locked at start-up. The home is chosen when the instance starts (`--home`, then `MOSTRA_HOME`, then the platform default), so `home.path` is a check: it stops a client from writing to a home it didn't mean.\",\n fix: \"Start the instance with `--home` set to the home the client expects, or connect to the socket of the instance that serves it. Leave `home.path` out to accept whichever home the instance serves.\",\n },\n },\n MOSTRA_HOME_INTEGRITY: {\n severity: \"error\",\n phase: \"host\",\n title: \"Stored version or file damaged\",\n hint: \"Publish the version's source again to rebuild a damaged version in place, and run `mostra doctor` for other damaged objects.\",\n docs: {\n explanation:\n \"Mostra checks stored versions, source snapshots and blobs against their recorded content digests before using them. This code means a stored object is missing or its content changed after it was written, for example after a disk error or a manual edit inside the home. The message names the object.\",\n fix: \"Leave files inside the home unchanged. To repair a version, publish the same source again: Mostra rebuilds the version's directory and puts it back under the same version ID, and the artifact keeps its version number. If the source has changed since, the publish makes a new version and the damaged one stays as it is; its source snapshot in the home holds the original files. `mostra doctor` lists other damaged objects.\",\n },\n },\n MOSTRA_HOME_NOT_ALWAYS_ON: {\n severity: \"warning\",\n phase: \"host\",\n title: \"Long-lived artifacts without an always-on daemon\",\n hint: \"Run `mostra daemon install` so the home's daemon runs as a login service and these artifacts answer at any hour.\",\n docs: {\n explanation:\n \"The home has artifacts with submission policy `none`, which are meant to stay open (dashboards, task managers, D63), but no login service runs its daemon. Without one, the daemon exits after 30 idle minutes and their links stop answering until a command starts it again.\",\n fix: \"Run `mostra daemon install`. It registers a login service (a launchd agent, a systemd user service or a Task Scheduler task) that keeps the home's daemon running; `mostra daemon uninstall` removes it.\",\n },\n },\n MOSTRA_HOME_GC_INCOMPLETE: {\n severity: \"warning\",\n phase: \"host\",\n title: \"gc didn't finish a step\",\n hint: \"Run `mostra gc` again: what this run removed is in its result, and the next run picks up what it left.\",\n docs: {\n explanation:\n \"`mostra gc` removes what nothing references in steps: version files, source snapshots, lock layouts, the package store, verify's caches and, when asked, events. One step failed (the message names it and why), so it left that step's files in place. Everything an earlier step removed is listed in the result, and the versions it collected stay collected. The home is consistent: what gc left is still recorded as there.\",\n fix: \"Run `mostra gc` again; a failure that repeats names its cause in the message (for example, a file the user can't remove).\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAOA,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,kBAAmD;CAC9D,oBAAoB;EAClB,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,6BAA6B;EAC3B,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,+BAA+B;EAC7B,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,kBAAkB;EAChB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,sBAAsB;EACpB,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,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
|
|
@@ -8,8 +8,8 @@ const platformDiagnostics = { MOSTRA_PLATFORM_UNSUPPORTED: {
|
|
|
8
8
|
title: "Unsupported platform",
|
|
9
9
|
hint: "Run Mostra on macOS or Linux, on an x64 or arm64 machine.",
|
|
10
10
|
docs: {
|
|
11
|
-
explanation: "Mostra
|
|
12
|
-
fix: "Run Mostra on a macOS or Linux machine with an x64 or arm64 processor. Windows support
|
|
11
|
+
explanation: "Mostra runs on macOS and Linux, on x64 and arm64. On any other operating system or architecture every entry point stops with this code before it creates or changes anything, because the process model, the control endpoint and storage are built and tested only there. Windows on x64 and arm64 is being added and runs only in Mostra's own development builds until it is complete; a release stops there with this code too. The message names the platform that was detected.",
|
|
12
|
+
fix: "Run Mostra on a macOS or Linux machine with an x64 or arm64 processor. Windows support arrives in a 1.0 release."
|
|
13
13
|
}
|
|
14
14
|
} };
|
|
15
15
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","names":[],"sources":["../../../src/diagnostics/codes/platform.ts"],"sourcesContent":["/**\n * Diagnostic codes of the PLATFORM area: the operating systems and architectures Mostra runs on\n * (D35, RT-07).\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the PLATFORM area, in the order they were added. */\nexport const platformDiagnosticCodes = [\n \"MOSTRA_PLATFORM_UNSUPPORTED\",\n // gen:codes\n] as const;\n\n/** The codes of the PLATFORM area. */\nexport type PlatformDiagnosticCode = (typeof platformDiagnosticCodes)[number];\n\n/** The PLATFORM area's catalog entries. */\nexport const platformDiagnostics: AreaCatalog<PlatformDiagnosticCode> = {\n MOSTRA_PLATFORM_UNSUPPORTED: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Unsupported platform\",\n hint: \"Run Mostra on macOS or Linux, on an x64 or arm64 machine.\",\n docs: {\n explanation:\n \"Mostra
|
|
1
|
+
{"version":3,"file":"platform.js","names":[],"sources":["../../../src/diagnostics/codes/platform.ts"],"sourcesContent":["/**\n * Diagnostic codes of the PLATFORM area: the operating systems and architectures Mostra runs on\n * (D35, RT-07).\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the PLATFORM area, in the order they were added. */\nexport const platformDiagnosticCodes = [\n \"MOSTRA_PLATFORM_UNSUPPORTED\",\n // gen:codes\n] as const;\n\n/** The codes of the PLATFORM area. */\nexport type PlatformDiagnosticCode = (typeof platformDiagnosticCodes)[number];\n\n/** The PLATFORM area's catalog entries. */\nexport const platformDiagnostics: AreaCatalog<PlatformDiagnosticCode> = {\n MOSTRA_PLATFORM_UNSUPPORTED: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Unsupported platform\",\n hint: \"Run Mostra on macOS or Linux, on an x64 or arm64 machine.\",\n docs: {\n explanation:\n \"Mostra runs on macOS and Linux, on x64 and arm64. On any other operating system or architecture every entry point stops with this code before it creates or changes anything, because the process model, the control endpoint and storage are built and tested only there. Windows on x64 and arm64 is being added and runs only in Mostra's own development builds until it is complete; a release stops there with this code too. The message names the platform that was detected.\",\n fix: \"Run Mostra on a macOS or Linux machine with an x64 or arm64 processor. Windows support arrives in a 1.0 release.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAOA,MAAa,0BAA0B,CACrC,6BAEF;;AAMA,MAAa,sBAA2D,EACtE,6BAA6B;CAC3B,UAAU;CACV,OAAO;CACP,OAAO;CACP,MAAM;CACN,MAAM;EACJ,aACE;EACF,KAAK;CACP;AACF,EAEF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","names":[],"sources":["../../../src/methods/artifact/create.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"create.d.ts","names":[],"sources":["../../../src/methods/artifact/create.ts"],"mappings":";;;iBAOiB;;WAEN;;WAEA;;WAEA;;WAEA;;;iBAIM;;WAEN;;WAEA;;WAEA;;;;;;qBAwBE,sBAAsB,iBAAiB,sBAAsB"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { wireRegistry } from "../../wire-registry.js";
|
|
2
2
|
import { ArtifactId } from "../../ids.js";
|
|
3
|
+
import { AbsolutePath } from "../../artifact.js";
|
|
3
4
|
import { defineMethod } from "../../method.js";
|
|
4
5
|
import * as z from "zod";
|
|
5
6
|
//#region src/methods/artifact/create.ts
|
|
6
7
|
const params = z.object({
|
|
7
|
-
dir:
|
|
8
|
+
dir: AbsolutePath,
|
|
8
9
|
template: z.string().min(1).exactOptional(),
|
|
9
10
|
title: z.string().min(1).exactOptional(),
|
|
10
11
|
requestId: z.string().min(1).exactOptional()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","names":[],"sources":["../../../src/methods/artifact/create.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactId } from \"../../ids.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `artifact/create` (INTERFACES §6). */\nexport interface ArtifactCreateParams {\n /** The new artifact's directory, absolute. It must not exist yet, or be empty. */\n readonly dir: string;\n /** A template to start from. Templates arrive with `mostra new` (WP-26); none is the default. */\n readonly template?: string;\n /** The artifact's title. Default: the directory's name. */\n readonly title?: string;\n /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */\n readonly requestId?: string;\n}\n\n/** The result of `artifact/create`. */\nexport interface ArtifactCreateResult {\n /** The generated artifact ID, written into the entry's manifest. */\n readonly artifactId: string;\n /** The artifact's directory (its real path). */\n readonly dir: string;\n /** The files written, relative to `dir`. */\n readonly files: readonly string[];\n}\n\nconst params: z.ZodType<ArtifactCreateParams> = z\n .object({\n dir:
|
|
1
|
+
{"version":3,"file":"create.js","names":[],"sources":["../../../src/methods/artifact/create.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { AbsolutePath } from \"../../artifact.ts\";\nimport { ArtifactId } from \"../../ids.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `artifact/create` (INTERFACES §6). */\nexport interface ArtifactCreateParams {\n /** The new artifact's directory, absolute. It must not exist yet, or be empty. */\n readonly dir: string;\n /** A template to start from. Templates arrive with `mostra new` (WP-26); none is the default. */\n readonly template?: string;\n /** The artifact's title. Default: the directory's name. */\n readonly title?: string;\n /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */\n readonly requestId?: string;\n}\n\n/** The result of `artifact/create`. */\nexport interface ArtifactCreateResult {\n /** The generated artifact ID, written into the entry's manifest. */\n readonly artifactId: string;\n /** The artifact's directory (its real path). */\n readonly dir: string;\n /** The files written, relative to `dir`. */\n readonly files: readonly string[];\n}\n\nconst params: z.ZodType<ArtifactCreateParams> = z\n .object({\n dir: AbsolutePath,\n template: z.string().min(1).exactOptional(),\n title: z.string().min(1).exactOptional(),\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"ArtifactCreateParams\" });\n\nconst result: z.ZodType<ArtifactCreateResult> = z\n .object({\n artifactId: ArtifactId.schema,\n dir: z.string(),\n files: z.array(z.string()).readonly(),\n })\n .register(wireRegistry, { id: \"ArtifactCreateResult\" });\n\n/**\n * `artifact/create`: writes a new artifact's entry, with a generated artifact ID in its manifest, into\n * an empty directory. The artifact appears in `artifact/list` once it is published.\n */\nexport const artifactCreateMethod: MethodDefinition<ArtifactCreateParams, ArtifactCreateResult> =\n defineMethod({\n method: \"artifact/create\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n });\n"],"mappings":";;;;;;AA4BA,MAAM,SAA0C,EAC7C,OAAO;CACN,KAAK;CACL,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;CAC1C,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;CACvC,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,uBAAuB,CAAC;AAExD,MAAM,SAA0C,EAC7C,OAAO;CACN,YAAY,WAAW;CACvB,KAAK,EAAE,OAAO;CACd,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;AACtC,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,uBAAuB,CAAC;;;;;AAMxD,MAAa,uBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mostra/protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Mostra's shared protocol vocabulary: IDs, dated revisions and diagnostics, with Zod schemas and generated JSON Schema.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "The Mostra Authors",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"ignore": [
|
|
67
67
|
"zod"
|
|
68
68
|
],
|
|
69
|
-
"limit": "
|
|
69
|
+
"limit": "49 kB"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"name": "@mostra/protocol JSON-RPC core (D83, zod excluded)",
|
|
@@ -449,7 +449,7 @@
|
|
|
449
449
|
"properties": {
|
|
450
450
|
"dir": {
|
|
451
451
|
"type": "string",
|
|
452
|
-
"pattern": "
|
|
452
|
+
"pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\])"
|
|
453
453
|
},
|
|
454
454
|
"template": {
|
|
455
455
|
"type": "string",
|
|
@@ -899,7 +899,7 @@
|
|
|
899
899
|
"properties": {
|
|
900
900
|
"path": {
|
|
901
901
|
"type": "string",
|
|
902
|
-
"pattern": "
|
|
902
|
+
"pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\])"
|
|
903
903
|
}
|
|
904
904
|
},
|
|
905
905
|
"required": [
|
|
@@ -4527,7 +4527,7 @@
|
|
|
4527
4527
|
"properties": {
|
|
4528
4528
|
"path": {
|
|
4529
4529
|
"type": "string",
|
|
4530
|
-
"pattern": "
|
|
4530
|
+
"pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\])"
|
|
4531
4531
|
}
|
|
4532
4532
|
},
|
|
4533
4533
|
"required": [
|
|
@@ -449,7 +449,7 @@
|
|
|
449
449
|
"properties": {
|
|
450
450
|
"dir": {
|
|
451
451
|
"type": "string",
|
|
452
|
-
"pattern": "
|
|
452
|
+
"pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\])"
|
|
453
453
|
},
|
|
454
454
|
"template": {
|
|
455
455
|
"type": "string",
|
|
@@ -879,7 +879,7 @@
|
|
|
879
879
|
"properties": {
|
|
880
880
|
"path": {
|
|
881
881
|
"type": "string",
|
|
882
|
-
"pattern": "
|
|
882
|
+
"pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\])"
|
|
883
883
|
}
|
|
884
884
|
},
|
|
885
885
|
"required": [
|
|
@@ -4395,7 +4395,7 @@
|
|
|
4395
4395
|
"properties": {
|
|
4396
4396
|
"path": {
|
|
4397
4397
|
"type": "string",
|
|
4398
|
-
"pattern": "
|
|
4398
|
+
"pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\])"
|
|
4399
4399
|
}
|
|
4400
4400
|
},
|
|
4401
4401
|
"required": [
|
package/src/artifact.ts
CHANGED
|
@@ -7,8 +7,13 @@ import { ArtifactId, Cursor, TokenId, VersionId } from "./ids.ts";
|
|
|
7
7
|
import { ArtifactLink, ArtifactManifest, SubmissionPolicy } from "./manifest.ts";
|
|
8
8
|
import { wireRegistry } from "./wire-registry.ts";
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* An absolute file system path: the client resolves relative paths against its own directory.
|
|
12
|
+
* POSIX `/…`, and on Windows a drive path (`C:\…`, `C:/…`) or a UNC path (`\\server\share\…`,
|
|
13
|
+
* WP-W1, D150); a drive-relative `C:x` or a root-relative `\x` isn't absolute. The Windows forms
|
|
14
|
+
* are alternatives beside the POSIX one, which the schema gate reads as a widening (D32).
|
|
15
|
+
*/
|
|
16
|
+
export const AbsolutePath: z.ZodString = z.string().regex(/^(?:\/|[A-Za-z]:[\\/]|\\\\[^\\])/);
|
|
12
17
|
|
|
13
18
|
/**
|
|
14
19
|
* Where to build an artifact from: a source path (a `.tsx`, `.jsx` or `.mdx` file, or a directory
|
|
@@ -16,6 +16,7 @@ export const envDiagnosticCodes = [
|
|
|
16
16
|
"MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED",
|
|
17
17
|
"MOSTRA_ENV_BUNDLE_UNAVAILABLE",
|
|
18
18
|
"MOSTRA_ENV_NODE_UNSUPPORTED",
|
|
19
|
+
"MOSTRA_ENV_HELPER_MISSING",
|
|
19
20
|
// gen:codes
|
|
20
21
|
] as const;
|
|
21
22
|
|
|
@@ -75,8 +76,8 @@ export const envDiagnostics: AreaCatalog<EnvDiagnosticCode> = {
|
|
|
75
76
|
hint: "Read the message, fix what it names, and run the install again.",
|
|
76
77
|
docs: {
|
|
77
78
|
explanation:
|
|
78
|
-
"`mostra daemon install` couldn't register the home's daemon as a login service: writing the launchd agent
|
|
79
|
-
fix: "Check the named file's directory permissions
|
|
79
|
+
"`mostra daemon install` couldn't register the home's daemon as a login service: writing the launchd agent, systemd user unit or Task Scheduler task failed, or `launchctl`, `systemctl --user` or `schtasks` refused it.",
|
|
80
|
+
fix: "Check the named file's directory permissions; on Linux, that a systemd user session is running (`systemctl --user status`); on Windows, that Task Scheduler runs and your account may create tasks (`schtasks /Query`). On a machine without one, start the daemon from your own login scripts with `mostra daemon start`.",
|
|
80
81
|
},
|
|
81
82
|
},
|
|
82
83
|
MOSTRA_ENV_BROWSER_MISSING: {
|
|
@@ -145,5 +146,16 @@ export const envDiagnostics: AreaCatalog<EnvDiagnosticCode> = {
|
|
|
145
146
|
fix: "Upgrade the machine's Node.js to 22.19 or later, or run Mostra without npm: download the runtime bundle for your platform from the GitHub release, check it against `SHA256SUMS`, extract it, run its `bin/mostra-setup` once, then use its `bin/mostra`.",
|
|
146
147
|
},
|
|
147
148
|
},
|
|
149
|
+
MOSTRA_ENV_HELPER_MISSING: {
|
|
150
|
+
severity: "error",
|
|
151
|
+
phase: "platform",
|
|
152
|
+
title: "Windows helper missing",
|
|
153
|
+
hint: "Reinstall Mostra, or set `MOSTRA_WIN_HELPER` to its `mostra-win.exe`.",
|
|
154
|
+
docs: {
|
|
155
|
+
explanation:
|
|
156
|
+
"On Windows the runtime runs `mostra-win.exe`, a helper that ships with it, for what Node.js can't do there: owner-only access to the home, the home's control pipe, and every child process in a Job Object. The runtime looked for it at `MOSTRA_WIN_HELPER`, in its runtime bundle, and in a development checkout's Cargo build, and found none, so it stopped before touching the home.",
|
|
157
|
+
fix: "Reinstall Mostra so the runtime bundle is complete. In a development checkout, build the helper with `cargo build -p mostra-win`. A custom layout can point the runtime at the helper with `MOSTRA_WIN_HELPER`.",
|
|
158
|
+
},
|
|
159
|
+
},
|
|
148
160
|
// gen:entries
|
|
149
161
|
};
|
|
@@ -132,7 +132,7 @@ export const homeDiagnostics: AreaCatalog<HomeDiagnosticCode> = {
|
|
|
132
132
|
docs: {
|
|
133
133
|
explanation:
|
|
134
134
|
"The home has artifacts with submission policy `none`, which are meant to stay open (dashboards, task managers, D63), but no login service runs its daemon. Without one, the daemon exits after 30 idle minutes and their links stop answering until a command starts it again.",
|
|
135
|
-
fix: "Run `mostra daemon install`. It registers a launchd
|
|
135
|
+
fix: "Run `mostra daemon install`. It registers a login service (a launchd agent, a systemd user service or a Task Scheduler task) that keeps the home's daemon running; `mostra daemon uninstall` removes it.",
|
|
136
136
|
},
|
|
137
137
|
},
|
|
138
138
|
MOSTRA_HOME_GC_INCOMPLETE: {
|
|
@@ -22,8 +22,8 @@ export const platformDiagnostics: AreaCatalog<PlatformDiagnosticCode> = {
|
|
|
22
22
|
hint: "Run Mostra on macOS or Linux, on an x64 or arm64 machine.",
|
|
23
23
|
docs: {
|
|
24
24
|
explanation:
|
|
25
|
-
"Mostra
|
|
26
|
-
fix: "Run Mostra on a macOS or Linux machine with an x64 or arm64 processor. Windows support
|
|
25
|
+
"Mostra runs on macOS and Linux, on x64 and arm64. On any other operating system or architecture every entry point stops with this code before it creates or changes anything, because the process model, the control endpoint and storage are built and tested only there. Windows on x64 and arm64 is being added and runs only in Mostra's own development builds until it is complete; a release stops there with this code too. The message names the platform that was detected.",
|
|
26
|
+
fix: "Run Mostra on a macOS or Linux machine with an x64 or arm64 processor. Windows support arrives in a 1.0 release.",
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
// gen:entries
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
import { AbsolutePath } from "../../artifact.ts";
|
|
2
3
|
import { ArtifactId } from "../../ids.ts";
|
|
3
4
|
import { defineMethod, type MethodDefinition } from "../../method.ts";
|
|
4
5
|
import { wireRegistry } from "../../wire-registry.ts";
|
|
@@ -27,7 +28,7 @@ export interface ArtifactCreateResult {
|
|
|
27
28
|
|
|
28
29
|
const params: z.ZodType<ArtifactCreateParams> = z
|
|
29
30
|
.object({
|
|
30
|
-
dir:
|
|
31
|
+
dir: AbsolutePath,
|
|
31
32
|
template: z.string().min(1).exactOptional(),
|
|
32
33
|
title: z.string().min(1).exactOptional(),
|
|
33
34
|
requestId: z.string().min(1).exactOptional(),
|