@mostra/protocol 0.9.0 → 0.11.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/actions.d.ts +30 -4
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +14 -4
- package/dist/actions.js.map +1 -1
- package/dist/artifact.d.ts +2 -1
- package/dist/artifact.d.ts.map +1 -1
- package/dist/artifact.js +2 -1
- package/dist/artifact.js.map +1 -1
- package/dist/browser.d.ts +47 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +36 -3
- package/dist/browser.js.map +1 -1
- package/dist/capability.d.ts +0 -9
- package/dist/capability.d.ts.map +1 -1
- package/dist/capability.js +1 -17
- package/dist/capability.js.map +1 -1
- package/dist/diagnostics/codes/action.d.ts +1 -1
- package/dist/diagnostics/codes/action.d.ts.map +1 -1
- package/dist/diagnostics/codes/action.js +12 -1
- package/dist/diagnostics/codes/action.js.map +1 -1
- package/dist/diagnostics/codes/artifact.d.ts +1 -1
- package/dist/diagnostics/codes/artifact.d.ts.map +1 -1
- package/dist/diagnostics/codes/artifact.js +12 -1
- package/dist/diagnostics/codes/artifact.js.map +1 -1
- package/dist/diagnostics/codes/home.d.ts +1 -1
- package/dist/diagnostics/codes/home.d.ts.map +1 -1
- package/dist/diagnostics/codes/home.js +12 -1
- package/dist/diagnostics/codes/home.js.map +1 -1
- package/dist/diagnostics/codes/index.d.ts +3 -2
- package/dist/diagnostics/codes/index.d.ts.map +1 -1
- package/dist/diagnostics/codes/index.js +3 -1
- package/dist/diagnostics/codes/index.js.map +1 -1
- package/dist/diagnostics/codes/remote.d.ts +8 -0
- package/dist/diagnostics/codes/remote.d.ts.map +1 -0
- package/dist/diagnostics/codes/remote.js +176 -0
- package/dist/diagnostics/codes/remote.js.map +1 -0
- package/dist/diagnostics/codes/submit.d.ts +1 -1
- package/dist/diagnostics/codes/submit.d.ts.map +1 -1
- package/dist/diagnostics/codes/submit.js +12 -1
- package/dist/diagnostics/codes/submit.js.map +1 -1
- package/dist/diagnostics/diagnostic.d.ts +1 -1
- package/dist/diagnostics/diagnostic.d.ts.map +1 -1
- package/dist/diagnostics/diagnostic.js +2 -1
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/duration.d.ts +13 -0
- package/dist/duration.d.ts.map +1 -0
- package/dist/duration.js +27 -0
- package/dist/duration.js.map +1 -0
- package/dist/ids.d.ts +17 -1
- package/dist/ids.d.ts.map +1 -1
- package/dist/ids.js +9 -1
- package/dist/ids.js.map +1 -1
- package/dist/index.d.ts +33 -8
- package/dist/index.js +33 -8
- package/dist/interaction.d.ts +33 -2
- package/dist/interaction.d.ts.map +1 -1
- package/dist/interaction.js +22 -6
- package/dist/interaction.js.map +1 -1
- package/dist/manifest.d.ts +59 -14
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +63 -15
- package/dist/manifest.js.map +1 -1
- package/dist/methods/artifact/export.d.ts +40 -0
- package/dist/methods/artifact/export.d.ts.map +1 -0
- package/dist/methods/artifact/export.js +36 -0
- package/dist/methods/artifact/export.js.map +1 -0
- package/dist/methods/artifact/import.d.ts +23 -0
- package/dist/methods/artifact/import.d.ts.map +1 -0
- package/dist/methods/artifact/import.js +25 -0
- package/dist/methods/artifact/import.js.map +1 -0
- package/dist/methods/artifact/pause.d.ts +33 -0
- package/dist/methods/artifact/pause.d.ts.map +1 -0
- package/dist/methods/artifact/pause.js +33 -0
- package/dist/methods/artifact/pause.js.map +1 -0
- package/dist/methods/artifact/publish.d.ts +2 -1
- package/dist/methods/artifact/publish.d.ts.map +1 -1
- package/dist/methods/artifact/publish.js +1 -1
- package/dist/methods/hosted/push.d.ts +76 -0
- package/dist/methods/hosted/push.d.ts.map +1 -0
- package/dist/methods/hosted/push.js +71 -0
- package/dist/methods/hosted/push.js.map +1 -0
- package/dist/methods/hosted/submission.d.ts +18 -0
- package/dist/methods/hosted/submission.d.ts.map +1 -0
- package/dist/methods/hosted/submission.js +23 -0
- package/dist/methods/hosted/submission.js.map +1 -0
- package/dist/methods/index.d.ts.map +1 -1
- package/dist/methods/index.js +44 -2
- package/dist/methods/index.js.map +1 -1
- package/dist/methods/instance/status.d.ts +3 -0
- package/dist/methods/instance/status.d.ts.map +1 -1
- package/dist/methods/instance/status.js +3 -1
- package/dist/methods/instance/status.js.map +1 -1
- package/dist/methods/mostra/initialize.d.ts +17 -3
- package/dist/methods/mostra/initialize.d.ts.map +1 -1
- package/dist/methods/mostra/initialize.js +11 -3
- package/dist/methods/mostra/initialize.js.map +1 -1
- package/dist/methods/port/relay-author.d.ts +28 -0
- package/dist/methods/port/relay-author.d.ts.map +1 -0
- package/dist/methods/port/relay-author.js +42 -0
- package/dist/methods/port/relay-author.js.map +1 -0
- package/dist/methods/port/relay-call.d.ts +33 -0
- package/dist/methods/port/relay-call.d.ts.map +1 -0
- package/dist/methods/port/relay-call.js +31 -0
- package/dist/methods/port/relay-call.js.map +1 -0
- package/dist/methods/port/relay-cancel.d.ts +16 -0
- package/dist/methods/port/relay-cancel.d.ts.map +1 -0
- package/dist/methods/port/relay-cancel.js +21 -0
- package/dist/methods/port/relay-cancel.js.map +1 -0
- package/dist/methods/port/relay-live.d.ts +25 -0
- package/dist/methods/port/relay-live.d.ts.map +1 -0
- package/dist/methods/port/relay-live.js +32 -0
- package/dist/methods/port/relay-live.js.map +1 -0
- package/dist/methods/port/relay-reconcile.d.ts +39 -0
- package/dist/methods/port/relay-reconcile.d.ts.map +1 -0
- package/dist/methods/port/relay-reconcile.js +35 -0
- package/dist/methods/port/relay-reconcile.js.map +1 -0
- package/dist/methods/port/relay-run.d.ts +47 -0
- package/dist/methods/port/relay-run.d.ts.map +1 -0
- package/dist/methods/port/relay-run.js +41 -0
- package/dist/methods/port/relay-run.js.map +1 -0
- package/dist/methods/port/submissions-deliver.d.ts +8 -0
- package/dist/methods/port/submissions-deliver.d.ts.map +1 -1
- package/dist/methods/port/submissions-deliver.js +4 -2
- package/dist/methods/port/submissions-deliver.js.map +1 -1
- package/dist/methods/relay/call-batch.d.ts +26 -0
- package/dist/methods/relay/call-batch.d.ts.map +1 -0
- package/dist/methods/relay/call-batch.js +30 -0
- package/dist/methods/relay/call-batch.js.map +1 -0
- package/dist/methods/relay/effect.d.ts +31 -0
- package/dist/methods/relay/effect.d.ts.map +1 -0
- package/dist/methods/relay/effect.js +30 -0
- package/dist/methods/relay/effect.js.map +1 -0
- package/dist/methods/relay/live-value.d.ts +33 -0
- package/dist/methods/relay/live-value.d.ts.map +1 -0
- package/dist/methods/relay/live-value.js +32 -0
- package/dist/methods/relay/live-value.js.map +1 -0
- package/dist/methods/relay/run-update.d.ts +46 -0
- package/dist/methods/relay/run-update.d.ts.map +1 -0
- package/dist/methods/relay/run-update.js +45 -0
- package/dist/methods/relay/run-update.js.map +1 -0
- package/dist/methods/remote/link.d.ts +40 -0
- package/dist/methods/remote/link.d.ts.map +1 -0
- package/dist/methods/remote/link.js +40 -0
- package/dist/methods/remote/link.js.map +1 -0
- package/dist/methods/remote/login-wait.d.ts +30 -0
- package/dist/methods/remote/login-wait.d.ts.map +1 -0
- package/dist/methods/remote/login-wait.js +36 -0
- package/dist/methods/remote/login-wait.js.map +1 -0
- package/dist/methods/remote/login.d.ts +41 -0
- package/dist/methods/remote/login.d.ts.map +1 -0
- package/dist/methods/remote/login.js +37 -0
- package/dist/methods/remote/login.js.map +1 -0
- package/dist/methods/remote/logout.d.ts +25 -0
- package/dist/methods/remote/logout.d.ts.map +1 -0
- package/dist/methods/remote/logout.js +28 -0
- package/dist/methods/remote/logout.js.map +1 -0
- package/dist/methods/remote/status.d.ts +14 -0
- package/dist/methods/remote/status.d.ts.map +1 -0
- package/dist/methods/remote/status.js +22 -0
- package/dist/methods/remote/status.js.map +1 -0
- package/dist/methods/remote/token.d.ts +19 -0
- package/dist/methods/remote/token.d.ts.map +1 -0
- package/dist/methods/remote/token.js +24 -0
- package/dist/methods/remote/token.js.map +1 -0
- package/dist/methods/share/start.d.ts +5 -2
- package/dist/methods/share/start.d.ts.map +1 -1
- package/dist/methods/share/start.js +6 -3
- package/dist/methods/share/start.js.map +1 -1
- package/dist/methods/state/patch.d.ts +7 -0
- package/dist/methods/state/patch.d.ts.map +1 -1
- package/dist/methods/state/patch.js +2 -1
- package/dist/methods/state/patch.js.map +1 -1
- package/dist/methods/view/url.d.ts +2 -1
- package/dist/methods/view/url.d.ts.map +1 -1
- package/dist/methods/view/url.js +2 -1
- package/dist/methods/view/url.js.map +1 -1
- package/dist/operator.d.ts +464 -0
- package/dist/operator.d.ts.map +1 -0
- package/dist/operator.js +134 -0
- package/dist/operator.js.map +1 -0
- package/dist/policy.d.ts +18 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +23 -0
- package/dist/policy.js.map +1 -0
- package/dist/remote.d.ts +55 -0
- package/dist/remote.d.ts.map +1 -0
- package/dist/remote.js +52 -0
- package/dist/remote.js.map +1 -0
- package/dist/view.d.ts +1 -1
- package/dist/view.js +1 -1
- package/dist/view.js.map +1 -1
- package/package.json +12 -2
- package/schemas/protocol.draft-07.json +1839 -99
- package/schemas/protocol.schema.json +1787 -111
- package/src/actions.ts +45 -5
- package/src/browser.ts +70 -0
- package/src/capability.ts +0 -23
- package/src/diagnostics/codes/action.ts +12 -0
- package/src/diagnostics/codes/artifact.ts +12 -0
- package/src/diagnostics/codes/home.ts +12 -0
- package/src/diagnostics/codes/index.ts +6 -2
- package/src/diagnostics/codes/remote.ts +197 -0
- package/src/diagnostics/codes/submit.ts +12 -0
- package/src/diagnostics/diagnostic.ts +3 -1
- package/src/duration.ts +29 -0
- package/src/ids.ts +33 -1
- package/src/index.ts +143 -8
- package/src/interaction.ts +48 -2
- package/src/manifest.ts +115 -24
- package/src/methods/artifact/export.ts +68 -0
- package/src/methods/artifact/import.ts +39 -0
- package/src/methods/artifact/pause.ts +59 -0
- package/src/methods/hosted/push.ts +146 -0
- package/src/methods/hosted/submission.ts +34 -0
- package/src/methods/index.ts +42 -0
- package/src/methods/instance/status.ts +4 -0
- package/src/methods/mostra/initialize.ts +19 -3
- package/src/methods/port/relay-author.ts +57 -0
- package/src/methods/port/relay-call.ts +58 -0
- package/src/methods/port/relay-cancel.ts +33 -0
- package/src/methods/port/relay-live.ts +48 -0
- package/src/methods/port/relay-reconcile.ts +71 -0
- package/src/methods/port/relay-run.ts +80 -0
- package/src/methods/port/submissions-deliver.ts +13 -1
- package/src/methods/relay/call-batch.ts +52 -0
- package/src/methods/relay/effect.ts +55 -0
- package/src/methods/relay/live-value.ts +54 -0
- package/src/methods/relay/run-update.ts +81 -0
- package/src/methods/remote/link.ts +65 -0
- package/src/methods/remote/login-wait.ts +55 -0
- package/src/methods/remote/login.ts +72 -0
- package/src/methods/remote/logout.ts +42 -0
- package/src/methods/remote/status.ts +34 -0
- package/src/methods/remote/token.ts +39 -0
- package/src/methods/share/start.ts +12 -4
- package/src/methods/state/patch.ts +6 -0
- package/src/methods/view/url.ts +2 -1
- package/src/operator.ts +621 -0
- package/src/policy.ts +30 -0
- package/src/remote.ts +89 -0
- package/src/view.ts +1 -1
package/dist/capability.js
CHANGED
|
@@ -20,22 +20,6 @@ const ALL_SCOPES = [
|
|
|
20
20
|
"signal",
|
|
21
21
|
"action:*"
|
|
22
22
|
];
|
|
23
|
-
/** The Zod schema of the `Duration` type. */
|
|
24
|
-
const Duration = z.string().regex(/^[1-9][0-9]{0,8}[smhd]$/).register(wireRegistry, {
|
|
25
|
-
id: "Duration",
|
|
26
|
-
description: "A duration: a positive whole number and s, m, h or d, such as 30m, 24h or 7d."
|
|
27
|
-
});
|
|
28
|
-
const UNIT_MS = {
|
|
29
|
-
s: 1e3,
|
|
30
|
-
m: 6e4,
|
|
31
|
-
h: 36e5,
|
|
32
|
-
d: 864e5
|
|
33
|
-
};
|
|
34
|
-
/** The length of a `Duration` in milliseconds. */
|
|
35
|
-
function durationMs(duration) {
|
|
36
|
-
const unit = duration.slice(-1);
|
|
37
|
-
return Number(duration.slice(0, -1)) * UNIT_MS[unit];
|
|
38
|
-
}
|
|
39
23
|
/**
|
|
40
24
|
* The scopes a token holds after normalization: `view` added, duplicates removed, sorted, so equal
|
|
41
25
|
* grants compare equal.
|
|
@@ -56,6 +40,6 @@ function scopeAllows(scopes, required) {
|
|
|
56
40
|
return hash >= 0 && scopes.includes(`action:${functionId.slice(hash + 1)}`);
|
|
57
41
|
}
|
|
58
42
|
//#endregion
|
|
59
|
-
export { ALL_SCOPES, CapabilityScope,
|
|
43
|
+
export { ALL_SCOPES, CapabilityScope, normalizeScopes, scopeAllows };
|
|
60
44
|
|
|
61
45
|
//# sourceMappingURL=capability.js.map
|
package/dist/capability.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability.js","names":[],"sources":["../src/capability.ts"],"sourcesContent":["/**\n * Capability links (D06, D97): the scopes a capability token grants and how long it lasts. A\n * token is the authorization: whoever holds its link may do what its scopes allow, and nothing\n * else limits an artifact or its viewers (D05).\n */\nimport * as z from \"zod\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\n/**\n * What a capability token allows (HY-03, D97):\n * - `view`: open the artifact; every token has it.\n * - `draft`: save answers and other field values.\n * - `submit`: submit.\n * - `review`: comment and choose.\n * - `signal`: raise a signal for the host's attention (D10), which a waiting agent may act on.\n * - `action:*`: run every server function; `action:<export>` runs that export of any\n * `\"use server\"` module; `action:<module path>#<export>` runs one function ID.\n */\nexport type CapabilityScope =\n | \"view\"\n | \"draft\"\n | \"submit\"\n | \"review\"\n | \"signal\"\n | `action:${string}`;\n\n/** The Zod schema of the `CapabilityScope` type. */\nexport const CapabilityScope: z.ZodType<CapabilityScope> = z\n .string()\n .regex(/^(view|draft|submit|review|signal|action:(\\*|[^\\s#*]+(#[^\\s#*]+)?))$/)\n .register(wireRegistry, {\n id: \"CapabilityScope\",\n description:\n \"A capability token's scope: view, draft, submit, review, signal, action:*, action:<export> or action:<module path>#<export>.\",\n }) as z.ZodType<CapabilityScope>;\n\n/** Every scope at once: what a link minted without `scopes`, and every default link, carries. */\nexport const ALL_SCOPES: readonly CapabilityScope[] = [\n \"view\",\n \"draft\",\n \"submit\",\n \"review\",\n \"signal\",\n \"action:*\",\n];\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"capability.js","names":[],"sources":["../src/capability.ts"],"sourcesContent":["/**\n * Capability links (D06, D97): the scopes a capability token grants and how long it lasts. A\n * token is the authorization: whoever holds its link may do what its scopes allow, and nothing\n * else limits an artifact or its viewers (D05).\n */\nimport * as z from \"zod\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\n/**\n * What a capability token allows (HY-03, D97):\n * - `view`: open the artifact; every token has it.\n * - `draft`: save answers and other field values.\n * - `submit`: submit.\n * - `review`: comment and choose.\n * - `signal`: raise a signal for the host's attention (D10), which a waiting agent may act on.\n * - `action:*`: run every server function; `action:<export>` runs that export of any\n * `\"use server\"` module; `action:<module path>#<export>` runs one function ID.\n */\nexport type CapabilityScope =\n | \"view\"\n | \"draft\"\n | \"submit\"\n | \"review\"\n | \"signal\"\n | `action:${string}`;\n\n/** The Zod schema of the `CapabilityScope` type. */\nexport const CapabilityScope: z.ZodType<CapabilityScope> = z\n .string()\n .regex(/^(view|draft|submit|review|signal|action:(\\*|[^\\s#*]+(#[^\\s#*]+)?))$/)\n .register(wireRegistry, {\n id: \"CapabilityScope\",\n description:\n \"A capability token's scope: view, draft, submit, review, signal, action:*, action:<export> or action:<module path>#<export>.\",\n }) as z.ZodType<CapabilityScope>;\n\n/** Every scope at once: what a link minted without `scopes`, and every default link, carries. */\nexport const ALL_SCOPES: readonly CapabilityScope[] = [\n \"view\",\n \"draft\",\n \"submit\",\n \"review\",\n \"signal\",\n \"action:*\",\n];\n\n/**\n * The scopes a token holds after normalization: `view` added, duplicates removed, sorted, so equal\n * grants compare equal.\n */\nexport function normalizeScopes(scopes: readonly CapabilityScope[]): CapabilityScope[] {\n return [...new Set<CapabilityScope>([\"view\", ...scopes])].sort();\n}\n\n/**\n * Whether `scopes` grant `required`. A plain scope must be held as written. An action scope\n * `action:<module path>#<export>` is granted by `action:*`, by `action:<export>` and by itself.\n */\nexport function scopeAllows(\n scopes: readonly CapabilityScope[],\n required: CapabilityScope,\n): boolean {\n if (scopes.includes(required)) return true;\n if (!required.startsWith(\"action:\")) return false;\n if (scopes.includes(\"action:*\")) return true;\n const functionId = required.slice(\"action:\".length);\n const hash = functionId.lastIndexOf(\"#\");\n return hash >= 0 && scopes.includes(`action:${functionId.slice(hash + 1)}`);\n}\n"],"mappings":";;;;;;;;;AA2BA,MAAa,kBAA8C,EACxD,OAAO,CAAC,CACR,MAAM,sEAAsE,CAAC,CAC7E,SAAS,cAAc;CACtB,IAAI;CACJ,aACE;AACJ,CAAC;;AAGH,MAAa,aAAyC;CACpD;CACA;CACA;CACA;CACA;CACA;AACF;;;;;AAMA,SAAgB,gBAAgB,QAAuD;CACrF,OAAO,CAAC,mBAAG,IAAI,IAAqB,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK;AACjE;;;;;AAMA,SAAgB,YACd,QACA,UACS;CACT,IAAI,OAAO,SAAS,QAAQ,GAAG,OAAO;CACtC,IAAI,CAAC,SAAS,WAAW,SAAS,GAAG,OAAO;CAC5C,IAAI,OAAO,SAAS,UAAU,GAAG,OAAO;CACxC,MAAM,aAAa,SAAS,MAAM,CAAgB;CAClD,MAAM,OAAO,WAAW,YAAY,GAAG;CACvC,OAAO,QAAQ,KAAK,OAAO,SAAS,UAAU,WAAW,MAAM,OAAO,CAAC,GAAG;AAC5E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../spec.js";
|
|
2
2
|
//#region src/diagnostics/codes/action.d.ts
|
|
3
3
|
/** The codes of the ACTION area, in the order they were added. */
|
|
4
|
-
export declare const actionDiagnosticCodes: readonly ["MOSTRA_ACTION_EXPORT_INVALID", "MOSTRA_ACTION_UNSERIALIZABLE", "MOSTRA_ACTION_THREW", "MOSTRA_ACTION_UNKNOWN_FUNCTION", "MOSTRA_ACTION_INTERRUPTED", "MOSTRA_ACTION_CANCELLED", "MOSTRA_ACTION_TOO_LARGE", "MOSTRA_ACTION_RUN_NOT_FOUND", "MOSTRA_ACTION_EVENT_INVALID"];
|
|
4
|
+
export declare const actionDiagnosticCodes: readonly ["MOSTRA_ACTION_EXPORT_INVALID", "MOSTRA_ACTION_UNSERIALIZABLE", "MOSTRA_ACTION_THREW", "MOSTRA_ACTION_UNKNOWN_FUNCTION", "MOSTRA_ACTION_INTERRUPTED", "MOSTRA_ACTION_CANCELLED", "MOSTRA_ACTION_TOO_LARGE", "MOSTRA_ACTION_RUN_NOT_FOUND", "MOSTRA_ACTION_EVENT_INVALID", "MOSTRA_ACTION_PAUSED"];
|
|
5
5
|
/** The codes of the ACTION area. */
|
|
6
6
|
export type ActionDiagnosticCode = (typeof actionDiagnosticCodes)[number];
|
|
7
7
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","names":[],"sources":["../../../src/diagnostics/codes/action.ts"],"mappings":";;;qBAMa;;
|
|
1
|
+
{"version":3,"file":"action.d.ts","names":[],"sources":["../../../src/diagnostics/codes/action.ts"],"mappings":";;;qBAMa;;YAeD,+BAA+B"}
|
|
@@ -9,7 +9,8 @@ const actionDiagnosticCodes = [
|
|
|
9
9
|
"MOSTRA_ACTION_CANCELLED",
|
|
10
10
|
"MOSTRA_ACTION_TOO_LARGE",
|
|
11
11
|
"MOSTRA_ACTION_RUN_NOT_FOUND",
|
|
12
|
-
"MOSTRA_ACTION_EVENT_INVALID"
|
|
12
|
+
"MOSTRA_ACTION_EVENT_INVALID",
|
|
13
|
+
"MOSTRA_ACTION_PAUSED"
|
|
13
14
|
];
|
|
14
15
|
/** The ACTION area's catalog entries. */
|
|
15
16
|
const actionDiagnostics = {
|
|
@@ -102,6 +103,16 @@ const actionDiagnostics = {
|
|
|
102
103
|
explanation: "Server code called `emit(type, payload)` from `@mostra/server` with a type that isn't `host.` followed by a name, or a payload that isn't JSON or is larger than 64 KiB. The event is not appended; `emit` throws.",
|
|
103
104
|
fix: "Use a type such as `host.reply-sent` and a small JSON payload. Put larger data in artifact state or a live source and send its key in the event."
|
|
104
105
|
}
|
|
106
|
+
},
|
|
107
|
+
MOSTRA_ACTION_PAUSED: {
|
|
108
|
+
severity: "error",
|
|
109
|
+
phase: "host",
|
|
110
|
+
title: "Artifact paused, no actions run",
|
|
111
|
+
hint: "Wait until the page is resumed, then run the action again.",
|
|
112
|
+
docs: {
|
|
113
|
+
explanation: "The artifact is paused, so its actions don't run: the run or call was refused before anything was recorded or sent to the owner's machine.",
|
|
114
|
+
fix: "The owner resumes it with `mostra resume <artifact>`; a pause by the server's operator is resumed only by the operator."
|
|
115
|
+
}
|
|
105
116
|
}
|
|
106
117
|
};
|
|
107
118
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","names":[],"sources":["../../../src/diagnostics/codes/action.ts"],"sourcesContent":["/**\n * Diagnostic codes of the ACTION area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the ACTION area, in the order they were added. */\nexport const actionDiagnosticCodes = [\n \"MOSTRA_ACTION_EXPORT_INVALID\",\n \"MOSTRA_ACTION_UNSERIALIZABLE\",\n \"MOSTRA_ACTION_THREW\",\n \"MOSTRA_ACTION_UNKNOWN_FUNCTION\",\n \"MOSTRA_ACTION_INTERRUPTED\",\n \"MOSTRA_ACTION_CANCELLED\",\n \"MOSTRA_ACTION_TOO_LARGE\",\n \"MOSTRA_ACTION_RUN_NOT_FOUND\",\n \"MOSTRA_ACTION_EVENT_INVALID\",\n // gen:codes\n] as const;\n\n/** The codes of the ACTION area. */\nexport type ActionDiagnosticCode = (typeof actionDiagnosticCodes)[number];\n\n/** The ACTION area's catalog entries. */\nexport const actionDiagnostics: AreaCatalog<ActionDiagnosticCode> = {\n MOSTRA_ACTION_EXPORT_INVALID: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Server module exports something other than an async function\",\n hint: 'Export only async functions from a \"use server\" module; move other exports to an ordinary module.',\n docs: {\n explanation:\n 'A module that starts with `\"use server\"` makes every export a server function the page can call. React\\'s contract allows only async functions there. Mostra reports this code for any other export (a constant, a class, a non-async function, `export *`), naming the export.',\n fix: \"Make the function `async`, or move the value to a separate module without the directive and import it from both sides.\",\n },\n },\n MOSTRA_ACTION_UNSERIALIZABLE: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Server function argument or result outside React's serializable types\",\n hint: \"Pass and return only plain objects, arrays, primitives, Map, Set, Date, typed arrays, FormData and promises; convert class instances to plain objects first.\",\n docs: {\n explanation:\n \"Server function arguments and results cross a process boundary, so Mostra accepts exactly the types React documents for Server Functions (D54): strings, numbers, bigints, booleans, `undefined`, `null`, symbols registered with `Symbol.for`, arrays, `Map`, `Set`, typed arrays, `ArrayBuffer`, `Date`, `FormData`, plain objects, other server functions and promises. A result may also be an async iterable, whose items stream to the page. Mostra reports this code for anything else (a class instance, an `Error`, a `RegExp`, an object with a null prototype, a function that isn't a server function, an unregistered symbol, JSX) and names where in the value it is, such as `Argument 2 at .items[1]`. A promise in an argument that rejects fails the call the same way.\",\n fix: \"Convert the value to the supported types before the call or the return: `{ ...instance }` or a mapping for class instances, `error.message` for errors and `regexp.source` for regular expressions.\",\n },\n },\n MOSTRA_ACTION_THREW: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Server function threw\",\n hint: \"Read the run's log for the stack, then fix the server function or catch the error and return a result instead.\",\n docs: {\n explanation:\n \"A server function threw while it ran. The page gets `{ code: \\\"MOSTRA_ACTION_THREW\\\", message }` with the thrown error's message (`useAction`'s `error`, or the rejected promise of a plain call); the stack goes to the action run's log, never to the page. When the error carried a diagnostic code of its own (a `MOSTRA_SECRET_MISSING`, say), that code is reported instead.\",\n fix: \"Fix the cause in the function, or catch the error inside it and return a value the page can show. Mostra never retries a run by itself (D24); retry in your own code, or call the action again with a new key.\",\n },\n },\n MOSTRA_ACTION_UNKNOWN_FUNCTION: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"No such server function in this version\",\n hint: \"Publish the artifact again so the page and its server code come from the same version.\",\n docs: {\n explanation:\n \"The page called a server function ID (`<module path>#<export>`) that the version's server bundle doesn't export. Pages call only functions their own build references, so this means a page and a worker of different versions, or a request written by hand.\",\n fix: 'Republish the artifact and reload the page. Call server functions by importing them from their `\"use server\"` module, never by ID.',\n },\n },\n MOSTRA_ACTION_INTERRUPTED: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Action run interrupted\",\n hint: \"Check the run's effects at their provider, then start it again with a new key if it should run again.\",\n docs: {\n explanation:\n \"The action run's worker crashed, ran out of memory, was stopped by the event-loop watchdog, or the instance stopped while the run was running. The run ends `failed` with the reason `interrupted`, and Mostra never retries it by itself (D24): an action that had already started a side effect, such as sending an email, may or may not have finished it.\",\n fix: \"Look at the effect where it happens (the mail provider's sent folder, say) before running the action again. Pass the provider's own idempotency key from the action (for example, the run's key) so a repeated request can't act twice.\",\n },\n },\n MOSTRA_ACTION_CANCELLED: {\n severity: \"warning\",\n phase: \"runtime\",\n title: \"Action run cancelled\",\n hint: \"Start the action again if it should still run.\",\n docs: {\n explanation:\n \"The action run was cancelled from a page, and its `abortSignal` fired. The run ends `cancelled` when the action stops; an action that ignores the signal ends with whatever it returns.\",\n fix: \"Nothing to fix. Pass `abortSignal` from `@mostra/server` to `fetch` and other cancellable calls so cancelling stops the work.\",\n },\n },\n MOSTRA_ACTION_TOO_LARGE: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Server function arguments or result too large\",\n hint: \"Return or pass less data: page through it, or write it to artifact state or a live source instead.\",\n docs: {\n explanation:\n \"A server function's serialized arguments, or an action run's serialized result, is over 16 MiB. A plain call or run with arguments that large is refused before it starts; a run whose result grows past the limit is stopped and ends `failed`.\",\n fix: \"Send identifiers rather than whole documents, return a page of results at a time, or publish large data through a live source or artifact state, which the page reads on its own.\",\n },\n },\n MOSTRA_ACTION_RUN_NOT_FOUND: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"No such action run\",\n hint: \"Start the action again; the run ID names no run of this artifact.\",\n docs: {\n explanation:\n \"A page asked for or cancelled an action run that this artifact doesn't have, or one started from another artifact.\",\n fix: \"Use the run IDs `useAction` reports. A page that keeps run IDs itself should drop IDs from other artifacts.\",\n },\n },\n MOSTRA_ACTION_EVENT_INVALID: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Host event type or payload invalid\",\n hint: \"Name the event `host.<name>` with 1 to 64 letters, digits, `.`, `_` and `-`, and keep its payload JSON of at most 64 KiB.\",\n docs: {\n explanation:\n \"Server code called `emit(type, payload)` from `@mostra/server` with a type that isn't `host.` followed by a name, or a payload that isn't JSON or is larger than 64 KiB. The event is not appended; `emit` throws.\",\n fix: \"Use a type such as `host.reply-sent` and a small JSON payload. Put larger data in artifact state or a live source and send its key in the event.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,oBAAuD;CAClE,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,qBAAqB;EACnB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,gCAAgC;EAC9B,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,yBAAyB;EACvB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,yBAAyB;EACvB,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,6BAA6B;EAC3B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
|
|
1
|
+
{"version":3,"file":"action.js","names":[],"sources":["../../../src/diagnostics/codes/action.ts"],"sourcesContent":["/**\n * Diagnostic codes of the ACTION area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the ACTION area, in the order they were added. */\nexport const actionDiagnosticCodes = [\n \"MOSTRA_ACTION_EXPORT_INVALID\",\n \"MOSTRA_ACTION_UNSERIALIZABLE\",\n \"MOSTRA_ACTION_THREW\",\n \"MOSTRA_ACTION_UNKNOWN_FUNCTION\",\n \"MOSTRA_ACTION_INTERRUPTED\",\n \"MOSTRA_ACTION_CANCELLED\",\n \"MOSTRA_ACTION_TOO_LARGE\",\n \"MOSTRA_ACTION_RUN_NOT_FOUND\",\n \"MOSTRA_ACTION_EVENT_INVALID\",\n \"MOSTRA_ACTION_PAUSED\",\n // gen:codes\n] as const;\n\n/** The codes of the ACTION area. */\nexport type ActionDiagnosticCode = (typeof actionDiagnosticCodes)[number];\n\n/** The ACTION area's catalog entries. */\nexport const actionDiagnostics: AreaCatalog<ActionDiagnosticCode> = {\n MOSTRA_ACTION_EXPORT_INVALID: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Server module exports something other than an async function\",\n hint: 'Export only async functions from a \"use server\" module; move other exports to an ordinary module.',\n docs: {\n explanation:\n 'A module that starts with `\"use server\"` makes every export a server function the page can call. React\\'s contract allows only async functions there. Mostra reports this code for any other export (a constant, a class, a non-async function, `export *`), naming the export.',\n fix: \"Make the function `async`, or move the value to a separate module without the directive and import it from both sides.\",\n },\n },\n MOSTRA_ACTION_UNSERIALIZABLE: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Server function argument or result outside React's serializable types\",\n hint: \"Pass and return only plain objects, arrays, primitives, Map, Set, Date, typed arrays, FormData and promises; convert class instances to plain objects first.\",\n docs: {\n explanation:\n \"Server function arguments and results cross a process boundary, so Mostra accepts exactly the types React documents for Server Functions (D54): strings, numbers, bigints, booleans, `undefined`, `null`, symbols registered with `Symbol.for`, arrays, `Map`, `Set`, typed arrays, `ArrayBuffer`, `Date`, `FormData`, plain objects, other server functions and promises. A result may also be an async iterable, whose items stream to the page. Mostra reports this code for anything else (a class instance, an `Error`, a `RegExp`, an object with a null prototype, a function that isn't a server function, an unregistered symbol, JSX) and names where in the value it is, such as `Argument 2 at .items[1]`. A promise in an argument that rejects fails the call the same way.\",\n fix: \"Convert the value to the supported types before the call or the return: `{ ...instance }` or a mapping for class instances, `error.message` for errors and `regexp.source` for regular expressions.\",\n },\n },\n MOSTRA_ACTION_THREW: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Server function threw\",\n hint: \"Read the run's log for the stack, then fix the server function or catch the error and return a result instead.\",\n docs: {\n explanation:\n \"A server function threw while it ran. The page gets `{ code: \\\"MOSTRA_ACTION_THREW\\\", message }` with the thrown error's message (`useAction`'s `error`, or the rejected promise of a plain call); the stack goes to the action run's log, never to the page. When the error carried a diagnostic code of its own (a `MOSTRA_SECRET_MISSING`, say), that code is reported instead.\",\n fix: \"Fix the cause in the function, or catch the error inside it and return a value the page can show. Mostra never retries a run by itself (D24); retry in your own code, or call the action again with a new key.\",\n },\n },\n MOSTRA_ACTION_UNKNOWN_FUNCTION: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"No such server function in this version\",\n hint: \"Publish the artifact again so the page and its server code come from the same version.\",\n docs: {\n explanation:\n \"The page called a server function ID (`<module path>#<export>`) that the version's server bundle doesn't export. Pages call only functions their own build references, so this means a page and a worker of different versions, or a request written by hand.\",\n fix: 'Republish the artifact and reload the page. Call server functions by importing them from their `\"use server\"` module, never by ID.',\n },\n },\n MOSTRA_ACTION_INTERRUPTED: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Action run interrupted\",\n hint: \"Check the run's effects at their provider, then start it again with a new key if it should run again.\",\n docs: {\n explanation:\n \"The action run's worker crashed, ran out of memory, was stopped by the event-loop watchdog, or the instance stopped while the run was running. The run ends `failed` with the reason `interrupted`, and Mostra never retries it by itself (D24): an action that had already started a side effect, such as sending an email, may or may not have finished it.\",\n fix: \"Look at the effect where it happens (the mail provider's sent folder, say) before running the action again. Pass the provider's own idempotency key from the action (for example, the run's key) so a repeated request can't act twice.\",\n },\n },\n MOSTRA_ACTION_CANCELLED: {\n severity: \"warning\",\n phase: \"runtime\",\n title: \"Action run cancelled\",\n hint: \"Start the action again if it should still run.\",\n docs: {\n explanation:\n \"The action run was cancelled from a page, and its `abortSignal` fired. The run ends `cancelled` when the action stops; an action that ignores the signal ends with whatever it returns.\",\n fix: \"Nothing to fix. Pass `abortSignal` from `@mostra/server` to `fetch` and other cancellable calls so cancelling stops the work.\",\n },\n },\n MOSTRA_ACTION_TOO_LARGE: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Server function arguments or result too large\",\n hint: \"Return or pass less data: page through it, or write it to artifact state or a live source instead.\",\n docs: {\n explanation:\n \"A server function's serialized arguments, or an action run's serialized result, is over 16 MiB. A plain call or run with arguments that large is refused before it starts; a run whose result grows past the limit is stopped and ends `failed`.\",\n fix: \"Send identifiers rather than whole documents, return a page of results at a time, or publish large data through a live source or artifact state, which the page reads on its own.\",\n },\n },\n MOSTRA_ACTION_RUN_NOT_FOUND: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"No such action run\",\n hint: \"Start the action again; the run ID names no run of this artifact.\",\n docs: {\n explanation:\n \"A page asked for or cancelled an action run that this artifact doesn't have, or one started from another artifact.\",\n fix: \"Use the run IDs `useAction` reports. A page that keeps run IDs itself should drop IDs from other artifacts.\",\n },\n },\n MOSTRA_ACTION_EVENT_INVALID: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Host event type or payload invalid\",\n hint: \"Name the event `host.<name>` with 1 to 64 letters, digits, `.`, `_` and `-`, and keep its payload JSON of at most 64 KiB.\",\n docs: {\n explanation:\n \"Server code called `emit(type, payload)` from `@mostra/server` with a type that isn't `host.` followed by a name, or a payload that isn't JSON or is larger than 64 KiB. The event is not appended; `emit` throws.\",\n fix: \"Use a type such as `host.reply-sent` and a small JSON payload. Put larger data in artifact state or a live source and send its key in the event.\",\n },\n },\n MOSTRA_ACTION_PAUSED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Artifact paused, no actions run\",\n hint: \"Wait until the page is resumed, then run the action again.\",\n docs: {\n explanation:\n \"The artifact is paused, so its actions don't run: the run or call was refused before anything was recorded or sent to the owner's machine.\",\n fix: \"The owner resumes it with `mostra resume <artifact>`; a pause by the server's operator is resumed only by the operator.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,oBAAuD;CAClE,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,qBAAqB;EACnB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,gCAAgC;EAC9B,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,yBAAyB;EACvB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,yBAAyB;EACvB,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,6BAA6B;EAC3B,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;AAEF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../spec.js";
|
|
2
2
|
//#region src/diagnostics/codes/artifact.d.ts
|
|
3
3
|
/** The codes of the ARTIFACT area, in the order they were added. */
|
|
4
|
-
export declare const artifactDiagnosticCodes: readonly ["MOSTRA_ARTIFACT_NOT_FOUND", "MOSTRA_ARTIFACT_SOURCE_MISSING", "MOSTRA_ARTIFACT_SOURCE_UNREADABLE", "MOSTRA_ARTIFACT_NO_ENTRY", "MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS", "MOSTRA_ARTIFACT_NO_PAGE", "MOSTRA_ARTIFACT_DIR_NOT_EMPTY", "MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN", "MOSTRA_ARTIFACT_VERSION_NOT_FOUND", "MOSTRA_ARTIFACT_VERSION_COLLECTED", "MOSTRA_ARTIFACT_PATH_INVALID", "MOSTRA_ARTIFACT_PATCH_REJECTED", "MOSTRA_ARTIFACT_ID_DROPPED"];
|
|
4
|
+
export declare const artifactDiagnosticCodes: readonly ["MOSTRA_ARTIFACT_NOT_FOUND", "MOSTRA_ARTIFACT_SOURCE_MISSING", "MOSTRA_ARTIFACT_SOURCE_UNREADABLE", "MOSTRA_ARTIFACT_NO_ENTRY", "MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS", "MOSTRA_ARTIFACT_NO_PAGE", "MOSTRA_ARTIFACT_DIR_NOT_EMPTY", "MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN", "MOSTRA_ARTIFACT_VERSION_NOT_FOUND", "MOSTRA_ARTIFACT_VERSION_COLLECTED", "MOSTRA_ARTIFACT_PATH_INVALID", "MOSTRA_ARTIFACT_PATCH_REJECTED", "MOSTRA_ARTIFACT_ID_DROPPED", "MOSTRA_ARTIFACT_BUNDLE_INVALID"];
|
|
5
5
|
/** The codes of the ARTIFACT area. */
|
|
6
6
|
export type ArtifactDiagnosticCode = (typeof artifactDiagnosticCodes)[number];
|
|
7
7
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.d.ts","names":[],"sources":["../../../src/diagnostics/codes/artifact.ts"],"mappings":";;;qBAMa;;
|
|
1
|
+
{"version":3,"file":"artifact.d.ts","names":[],"sources":["../../../src/diagnostics/codes/artifact.ts"],"mappings":";;;qBAMa;;YAmBD,iCAAiC"}
|
|
@@ -13,7 +13,8 @@ const artifactDiagnosticCodes = [
|
|
|
13
13
|
"MOSTRA_ARTIFACT_VERSION_COLLECTED",
|
|
14
14
|
"MOSTRA_ARTIFACT_PATH_INVALID",
|
|
15
15
|
"MOSTRA_ARTIFACT_PATCH_REJECTED",
|
|
16
|
-
"MOSTRA_ARTIFACT_ID_DROPPED"
|
|
16
|
+
"MOSTRA_ARTIFACT_ID_DROPPED",
|
|
17
|
+
"MOSTRA_ARTIFACT_BUNDLE_INVALID"
|
|
17
18
|
];
|
|
18
19
|
/** The ARTIFACT area's catalog entries. */
|
|
19
20
|
const artifactDiagnostics = {
|
|
@@ -146,6 +147,16 @@ const artifactDiagnostics = {
|
|
|
146
147
|
explanation: "A write replaced the artifact's entry (`index.tsx`, `index.jsx` or `index.mdx`) with text that no longer names the artifact ID its manifest held. Mostra wrote it as asked. An artifact without an `id` is bound to its source path at its first publish, so a page that was never published gets a new ID there, and one that was published keeps its ID only while its path stays the same: links, waits and results named by the old ID then don't find it.",
|
|
147
148
|
fix: "Add the `id` back, exactly as it was (`id: \"art_01…\"` in `defineArtifact`, or `id:` in the MDX frontmatter), with `artifact_patch` or `artifact_write`."
|
|
148
149
|
}
|
|
150
|
+
},
|
|
151
|
+
MOSTRA_ARTIFACT_BUNDLE_INVALID: {
|
|
152
|
+
severity: "error",
|
|
153
|
+
phase: "host",
|
|
154
|
+
title: "Not a bundle this version can import",
|
|
155
|
+
hint: "Export the bundle again with `mostra export <artifact> --as bundle`, and import the files it wrote unchanged.",
|
|
156
|
+
docs: {
|
|
157
|
+
explanation: "Importing a bundle checks it before it keeps anything: its `mostra-bundle.json`, that its version ID is the one its artifact ID and digests give, and that its builds and source snapshot have the digests it records. This bundle failed one of those checks, so a file was changed, lost or added after it was exported, or it isn't a bundle Mostra wrote.",
|
|
158
|
+
fix: "Export the version again from the home that published it, and copy the bundle's directory or archive whole."
|
|
159
|
+
}
|
|
149
160
|
}
|
|
150
161
|
};
|
|
151
162
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.js","names":[],"sources":["../../../src/diagnostics/codes/artifact.ts"],"sourcesContent":["/**\n * Diagnostic codes of the ARTIFACT area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the ARTIFACT area, in the order they were added. */\nexport const artifactDiagnosticCodes = [\n \"MOSTRA_ARTIFACT_NOT_FOUND\",\n \"MOSTRA_ARTIFACT_SOURCE_MISSING\",\n \"MOSTRA_ARTIFACT_SOURCE_UNREADABLE\",\n \"MOSTRA_ARTIFACT_NO_ENTRY\",\n \"MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS\",\n \"MOSTRA_ARTIFACT_NO_PAGE\",\n \"MOSTRA_ARTIFACT_DIR_NOT_EMPTY\",\n \"MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN\",\n \"MOSTRA_ARTIFACT_VERSION_NOT_FOUND\",\n \"MOSTRA_ARTIFACT_VERSION_COLLECTED\",\n \"MOSTRA_ARTIFACT_PATH_INVALID\",\n \"MOSTRA_ARTIFACT_PATCH_REJECTED\",\n \"MOSTRA_ARTIFACT_ID_DROPPED\",\n // gen:codes\n] as const;\n\n/** The codes of the ARTIFACT area. */\nexport type ArtifactDiagnosticCode = (typeof artifactDiagnosticCodes)[number];\n\n/** The ARTIFACT area's catalog entries. */\nexport const artifactDiagnostics: AreaCatalog<ArtifactDiagnosticCode> = {\n MOSTRA_ARTIFACT_NOT_FOUND: {\n severity: \"error\",\n phase: \"host\",\n title: \"Artifact not found\",\n hint: \"Check the artifact ID or source path, or list the home's artifacts with `mostra list`.\",\n docs: {\n explanation:\n \"The artifact named by an ID or a source path doesn't exist in this home: the ID was never published here, or the path was never published.\",\n fix: \"Use an ID or path from `mostra list`. A source that was never published becomes an artifact at its first `mostra publish`. A host that uses its own home sees only the artifacts published there.\",\n },\n },\n MOSTRA_ARTIFACT_SOURCE_MISSING: {\n severity: \"error\",\n phase: \"publish\",\n title: \"Artifact source missing\",\n hint: \"Publish from the artifact's source path, or restore the directory the message names.\",\n docs: {\n explanation:\n \"Publishing needs the artifact's source files. The path given, or the path the artifact was last published from, doesn't exist. Versions already published stay readable, because Mostra keeps a snapshot of their source in the home.\",\n fix: \"Pass the path where the source lives now. Its manifest `id`, if it has one, keeps the artifact identity at the new path.\",\n },\n },\n MOSTRA_ARTIFACT_SOURCE_UNREADABLE: {\n severity: \"error\",\n phase: \"publish\",\n title: \"Artifact source can't be read\",\n hint: \"Fix the file or directory the message names so your user can read it, then publish again.\",\n docs: {\n explanation:\n \"Mostra couldn't read a file of the artifact's source: permissions, a file that disappeared while it was copied, or two names that are the same after Unicode normalization. Nothing was published.\",\n fix: \"Make the named file readable, rename one of two clashing names, or exclude the file with `.mostraignore` in the artifact's root.\",\n },\n },\n MOSTRA_ARTIFACT_NO_ENTRY: {\n severity: \"error\",\n phase: \"manifest\",\n title: \"No entry file\",\n hint: \"Add `index.tsx` or `index.mdx` to the directory, or publish a single `.tsx` or `.mdx` file.\",\n docs: {\n explanation:\n \"An artifact is a single `.tsx`, `.jsx` or `.mdx` file, or a directory whose entry is `index.tsx`, `index.jsx` or `index.mdx`. The source given is neither.\",\n fix: 'Create the entry: its default export is the page, and its manifest is `export const artifact = defineArtifact({ title: \"...\" })` (or frontmatter in MDX). For a single page, publish the file itself.',\n },\n },\n MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS: {\n severity: \"error\",\n phase: \"manifest\",\n title: \"More than one entry file\",\n hint: \"Keep one entry file in the directory and rename or remove the others.\",\n docs: {\n explanation:\n \"A directory artifact has exactly one entry, and this directory has more than one of `index.tsx`, `index.jsx` and `index.mdx`, so Mostra can't tell which one is the page.\",\n fix: \"Keep the entry you mean and rename the others, for example into `components/`.\",\n },\n },\n MOSTRA_ARTIFACT_NO_PAGE: {\n severity: \"error\",\n phase: \"manifest\",\n title: \"Entry has no page\",\n hint: \"Export the page component as the entry's default export, or add a `pages/` folder.\",\n docs: {\n explanation:\n \"The entry has no default export and the artifact has no `pages/` folder, so there is nothing to render. With `pages/`, each file there is a route and the entry's default export, when present, is the layout around them.\",\n fix: \"Add `export default function Page() { ... }` to the entry, or move pages into `pages/index.tsx`, `pages/settings.tsx` and so on.\",\n },\n },\n MOSTRA_ARTIFACT_DIR_NOT_EMPTY: {\n severity: \"error\",\n phase: \"host\",\n title: \"Directory isn't empty\",\n hint: \"Choose a new or empty directory for the artifact.\",\n docs: {\n explanation:\n \"Creating an artifact writes its entry into a directory, and the directory given already has files. Mostra never overwrites them.\",\n fix: \"Pass a path that doesn't exist yet or an empty directory. To make existing files an artifact, add the entry yourself and publish.\",\n },\n },\n MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unknown template\",\n hint: \"Create the artifact without a template, or use a template this Mostra release provides.\",\n docs: {\n explanation:\n \"The template named isn't one this runtime provides. Without a template, Mostra writes a minimal entry with a generated artifact ID.\",\n fix: \"Leave out the template, or use one of the templates of this release.\",\n },\n },\n MOSTRA_ARTIFACT_VERSION_NOT_FOUND: {\n severity: \"error\",\n phase: \"host\",\n title: \"No such version\",\n hint: \"Name a version the artifact has (`artifact/get` lists them), or leave the version out for the latest.\",\n docs: {\n explanation:\n \"The request named a version number or version ID that this artifact never published in this home. Viewers only ever open published versions (D09), so there is nothing to show.\",\n fix: \"List the artifact's versions with `artifact/get` and pick one, or omit the version to open the latest. A link to `/a/<artifactId>/v/<number>` needs a number from that list.\",\n },\n },\n MOSTRA_ARTIFACT_VERSION_COLLECTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Version collected\",\n hint: \"Open the artifact's latest version, or publish this version's source again to restore its files.\",\n docs: {\n explanation:\n \"`mostra gc` removed this version's files because nothing referenced it (D140). Its ID and number stay in the ledger forever, so history and events still name it, but it can't be opened or linked.\",\n fix: \"Open a version that still exists (`artifact/get` marks collected ones), or publish the exact source of this version again: publish restores its files under the same ID and number.\",\n },\n },\n MOSTRA_ARTIFACT_PATH_INVALID: {\n severity: \"error\",\n phase: \"host\",\n title: \"File path outside the artifact\",\n hint: \"Name the file by a relative path inside the artifact's directory, such as `index.tsx` or `components/chart.tsx`.\",\n docs: {\n explanation:\n \"`artifact_write` and `artifact_patch` change an artifact's own files, which live in its directory. A path that is absolute, climbs out with `..`, names the directory itself or passes through a link to somewhere else names no file of the artifact, so nothing is written.\",\n fix: \"Give each file's path relative to the artifact's directory, with `/` between folders. To write elsewhere, use your own file tools.\",\n },\n },\n MOSTRA_ARTIFACT_PATCH_REJECTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Patch doesn't apply\",\n hint: \"Read the file again and send edits whose `old` text appears in it exactly once, or a diff made against its current content.\",\n docs: {\n explanation:\n \"An `artifact_patch` changes a file only when every edit applies: each `old` text must appear exactly once in the file as it is now, and each hunk of a unified diff must match its lines. When one doesn't, nothing is written, and the message lists each edit or hunk that didn't apply and why (not found, found more than once, the file is missing).\",\n fix: \"Use a longer `old` text that appears only once, fix the hunk's context lines, or write the whole file with `artifact_write`.\",\n },\n },\n MOSTRA_ARTIFACT_ID_DROPPED: {\n severity: \"warning\",\n phase: \"host\",\n title: \"Manifest id removed\",\n hint: 'Put the `id: \"art_…\"` line back into the entry\\'s `defineArtifact` (or its frontmatter), or the next publish gives the artifact a new ID.',\n docs: {\n explanation:\n \"A write replaced the artifact's entry (`index.tsx`, `index.jsx` or `index.mdx`) with text that no longer names the artifact ID its manifest held. Mostra wrote it as asked. An artifact without an `id` is bound to its source path at its first publish, so a page that was never published gets a new ID there, and one that was published keeps its ID only while its path stays the same: links, waits and results named by the old ID then don't find it.\",\n fix: 'Add the `id` back, exactly as it was (`id: \"art_01…\"` in `defineArtifact`, or `id:` in the MDX frontmatter), with `artifact_patch` or `artifact_write`.',\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,0BAA0B;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,sBAA2D;CACtE,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,gCAAgC;EAC9B,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,0BAA0B;EACxB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,iCAAiC;EAC/B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,yBAAyB;EACvB,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;CACA,mCAAmC;EACjC,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,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,gCAAgC;EAC9B,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;AAEF"}
|
|
1
|
+
{"version":3,"file":"artifact.js","names":[],"sources":["../../../src/diagnostics/codes/artifact.ts"],"sourcesContent":["/**\n * Diagnostic codes of the ARTIFACT area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the ARTIFACT area, in the order they were added. */\nexport const artifactDiagnosticCodes = [\n \"MOSTRA_ARTIFACT_NOT_FOUND\",\n \"MOSTRA_ARTIFACT_SOURCE_MISSING\",\n \"MOSTRA_ARTIFACT_SOURCE_UNREADABLE\",\n \"MOSTRA_ARTIFACT_NO_ENTRY\",\n \"MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS\",\n \"MOSTRA_ARTIFACT_NO_PAGE\",\n \"MOSTRA_ARTIFACT_DIR_NOT_EMPTY\",\n \"MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN\",\n \"MOSTRA_ARTIFACT_VERSION_NOT_FOUND\",\n \"MOSTRA_ARTIFACT_VERSION_COLLECTED\",\n \"MOSTRA_ARTIFACT_PATH_INVALID\",\n \"MOSTRA_ARTIFACT_PATCH_REJECTED\",\n \"MOSTRA_ARTIFACT_ID_DROPPED\",\n \"MOSTRA_ARTIFACT_BUNDLE_INVALID\",\n // gen:codes\n] as const;\n\n/** The codes of the ARTIFACT area. */\nexport type ArtifactDiagnosticCode = (typeof artifactDiagnosticCodes)[number];\n\n/** The ARTIFACT area's catalog entries. */\nexport const artifactDiagnostics: AreaCatalog<ArtifactDiagnosticCode> = {\n MOSTRA_ARTIFACT_NOT_FOUND: {\n severity: \"error\",\n phase: \"host\",\n title: \"Artifact not found\",\n hint: \"Check the artifact ID or source path, or list the home's artifacts with `mostra list`.\",\n docs: {\n explanation:\n \"The artifact named by an ID or a source path doesn't exist in this home: the ID was never published here, or the path was never published.\",\n fix: \"Use an ID or path from `mostra list`. A source that was never published becomes an artifact at its first `mostra publish`. A host that uses its own home sees only the artifacts published there.\",\n },\n },\n MOSTRA_ARTIFACT_SOURCE_MISSING: {\n severity: \"error\",\n phase: \"publish\",\n title: \"Artifact source missing\",\n hint: \"Publish from the artifact's source path, or restore the directory the message names.\",\n docs: {\n explanation:\n \"Publishing needs the artifact's source files. The path given, or the path the artifact was last published from, doesn't exist. Versions already published stay readable, because Mostra keeps a snapshot of their source in the home.\",\n fix: \"Pass the path where the source lives now. Its manifest `id`, if it has one, keeps the artifact identity at the new path.\",\n },\n },\n MOSTRA_ARTIFACT_SOURCE_UNREADABLE: {\n severity: \"error\",\n phase: \"publish\",\n title: \"Artifact source can't be read\",\n hint: \"Fix the file or directory the message names so your user can read it, then publish again.\",\n docs: {\n explanation:\n \"Mostra couldn't read a file of the artifact's source: permissions, a file that disappeared while it was copied, or two names that are the same after Unicode normalization. Nothing was published.\",\n fix: \"Make the named file readable, rename one of two clashing names, or exclude the file with `.mostraignore` in the artifact's root.\",\n },\n },\n MOSTRA_ARTIFACT_NO_ENTRY: {\n severity: \"error\",\n phase: \"manifest\",\n title: \"No entry file\",\n hint: \"Add `index.tsx` or `index.mdx` to the directory, or publish a single `.tsx` or `.mdx` file.\",\n docs: {\n explanation:\n \"An artifact is a single `.tsx`, `.jsx` or `.mdx` file, or a directory whose entry is `index.tsx`, `index.jsx` or `index.mdx`. The source given is neither.\",\n fix: 'Create the entry: its default export is the page, and its manifest is `export const artifact = defineArtifact({ title: \"...\" })` (or frontmatter in MDX). For a single page, publish the file itself.',\n },\n },\n MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS: {\n severity: \"error\",\n phase: \"manifest\",\n title: \"More than one entry file\",\n hint: \"Keep one entry file in the directory and rename or remove the others.\",\n docs: {\n explanation:\n \"A directory artifact has exactly one entry, and this directory has more than one of `index.tsx`, `index.jsx` and `index.mdx`, so Mostra can't tell which one is the page.\",\n fix: \"Keep the entry you mean and rename the others, for example into `components/`.\",\n },\n },\n MOSTRA_ARTIFACT_NO_PAGE: {\n severity: \"error\",\n phase: \"manifest\",\n title: \"Entry has no page\",\n hint: \"Export the page component as the entry's default export, or add a `pages/` folder.\",\n docs: {\n explanation:\n \"The entry has no default export and the artifact has no `pages/` folder, so there is nothing to render. With `pages/`, each file there is a route and the entry's default export, when present, is the layout around them.\",\n fix: \"Add `export default function Page() { ... }` to the entry, or move pages into `pages/index.tsx`, `pages/settings.tsx` and so on.\",\n },\n },\n MOSTRA_ARTIFACT_DIR_NOT_EMPTY: {\n severity: \"error\",\n phase: \"host\",\n title: \"Directory isn't empty\",\n hint: \"Choose a new or empty directory for the artifact.\",\n docs: {\n explanation:\n \"Creating an artifact writes its entry into a directory, and the directory given already has files. Mostra never overwrites them.\",\n fix: \"Pass a path that doesn't exist yet or an empty directory. To make existing files an artifact, add the entry yourself and publish.\",\n },\n },\n MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unknown template\",\n hint: \"Create the artifact without a template, or use a template this Mostra release provides.\",\n docs: {\n explanation:\n \"The template named isn't one this runtime provides. Without a template, Mostra writes a minimal entry with a generated artifact ID.\",\n fix: \"Leave out the template, or use one of the templates of this release.\",\n },\n },\n MOSTRA_ARTIFACT_VERSION_NOT_FOUND: {\n severity: \"error\",\n phase: \"host\",\n title: \"No such version\",\n hint: \"Name a version the artifact has (`artifact/get` lists them), or leave the version out for the latest.\",\n docs: {\n explanation:\n \"The request named a version number or version ID that this artifact never published in this home. Viewers only ever open published versions (D09), so there is nothing to show.\",\n fix: \"List the artifact's versions with `artifact/get` and pick one, or omit the version to open the latest. A link to `/a/<artifactId>/v/<number>` needs a number from that list.\",\n },\n },\n MOSTRA_ARTIFACT_VERSION_COLLECTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Version collected\",\n hint: \"Open the artifact's latest version, or publish this version's source again to restore its files.\",\n docs: {\n explanation:\n \"`mostra gc` removed this version's files because nothing referenced it (D140). Its ID and number stay in the ledger forever, so history and events still name it, but it can't be opened or linked.\",\n fix: \"Open a version that still exists (`artifact/get` marks collected ones), or publish the exact source of this version again: publish restores its files under the same ID and number.\",\n },\n },\n MOSTRA_ARTIFACT_PATH_INVALID: {\n severity: \"error\",\n phase: \"host\",\n title: \"File path outside the artifact\",\n hint: \"Name the file by a relative path inside the artifact's directory, such as `index.tsx` or `components/chart.tsx`.\",\n docs: {\n explanation:\n \"`artifact_write` and `artifact_patch` change an artifact's own files, which live in its directory. A path that is absolute, climbs out with `..`, names the directory itself or passes through a link to somewhere else names no file of the artifact, so nothing is written.\",\n fix: \"Give each file's path relative to the artifact's directory, with `/` between folders. To write elsewhere, use your own file tools.\",\n },\n },\n MOSTRA_ARTIFACT_PATCH_REJECTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Patch doesn't apply\",\n hint: \"Read the file again and send edits whose `old` text appears in it exactly once, or a diff made against its current content.\",\n docs: {\n explanation:\n \"An `artifact_patch` changes a file only when every edit applies: each `old` text must appear exactly once in the file as it is now, and each hunk of a unified diff must match its lines. When one doesn't, nothing is written, and the message lists each edit or hunk that didn't apply and why (not found, found more than once, the file is missing).\",\n fix: \"Use a longer `old` text that appears only once, fix the hunk's context lines, or write the whole file with `artifact_write`.\",\n },\n },\n MOSTRA_ARTIFACT_ID_DROPPED: {\n severity: \"warning\",\n phase: \"host\",\n title: \"Manifest id removed\",\n hint: 'Put the `id: \"art_…\"` line back into the entry\\'s `defineArtifact` (or its frontmatter), or the next publish gives the artifact a new ID.',\n docs: {\n explanation:\n \"A write replaced the artifact's entry (`index.tsx`, `index.jsx` or `index.mdx`) with text that no longer names the artifact ID its manifest held. Mostra wrote it as asked. An artifact without an `id` is bound to its source path at its first publish, so a page that was never published gets a new ID there, and one that was published keeps its ID only while its path stays the same: links, waits and results named by the old ID then don't find it.\",\n fix: 'Add the `id` back, exactly as it was (`id: \"art_01…\"` in `defineArtifact`, or `id:` in the MDX frontmatter), with `artifact_patch` or `artifact_write`.',\n },\n },\n MOSTRA_ARTIFACT_BUNDLE_INVALID: {\n severity: \"error\",\n phase: \"host\",\n title: \"Not a bundle this version can import\",\n hint: \"Export the bundle again with `mostra export <artifact> --as bundle`, and import the files it wrote unchanged.\",\n docs: {\n explanation:\n \"Importing a bundle checks it before it keeps anything: its `mostra-bundle.json`, that its version ID is the one its artifact ID and digests give, and that its builds and source snapshot have the digests it records. This bundle failed one of those checks, so a file was changed, lost or added after it was exported, or it isn't a bundle Mostra wrote.\",\n fix: \"Export the version again from the home that published it, and copy the bundle's directory or archive whole.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,0BAA0B;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,sBAA2D;CACtE,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,gCAAgC;EAC9B,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,0BAA0B;EACxB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,iCAAiC;EAC/B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,yBAAyB;EACvB,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;CACA,mCAAmC;EACjC,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,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,gCAAgC;EAC9B,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,gCAAgC;EAC9B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../spec.js";
|
|
2
2
|
//#region src/diagnostics/codes/home.d.ts
|
|
3
3
|
/** The codes of the HOME area, in the order they were added. */
|
|
4
|
-
export declare const homeDiagnosticCodes: readonly ["MOSTRA_HOME_LOCKED", "MOSTRA_HOME_NOT_OWNED", "MOSTRA_HOME_SOCKET_TOO_LONG", "MOSTRA_HOME_TOO_NEW", "MOSTRA_HOME_LEDGER_UNREADABLE", "MOSTRA_HOME_DISK_FULL", "MOSTRA_HOME_GONE", "MOSTRA_HOME_MISMATCH", "MOSTRA_HOME_INTEGRITY", "MOSTRA_HOME_NOT_ALWAYS_ON", "MOSTRA_HOME_GC_INCOMPLETE"];
|
|
4
|
+
export declare const homeDiagnosticCodes: readonly ["MOSTRA_HOME_LOCKED", "MOSTRA_HOME_NOT_OWNED", "MOSTRA_HOME_SOCKET_TOO_LONG", "MOSTRA_HOME_TOO_NEW", "MOSTRA_HOME_LEDGER_UNREADABLE", "MOSTRA_HOME_DISK_FULL", "MOSTRA_HOME_GONE", "MOSTRA_HOME_MISMATCH", "MOSTRA_HOME_INTEGRITY", "MOSTRA_HOME_NOT_ALWAYS_ON", "MOSTRA_HOME_GC_INCOMPLETE", "MOSTRA_HOME_NETWORK_FILESYSTEM"];
|
|
5
5
|
/** The codes of the HOME area. */
|
|
6
6
|
export type HomeDiagnosticCode = (typeof homeDiagnosticCodes)[number];
|
|
7
7
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home.d.ts","names":[],"sources":["../../../src/diagnostics/codes/home.ts"],"mappings":";;;qBAOa;;
|
|
1
|
+
{"version":3,"file":"home.d.ts","names":[],"sources":["../../../src/diagnostics/codes/home.ts"],"mappings":";;;qBAOa;;YAiBD,6BAA6B"}
|
|
@@ -11,7 +11,8 @@ const homeDiagnosticCodes = [
|
|
|
11
11
|
"MOSTRA_HOME_MISMATCH",
|
|
12
12
|
"MOSTRA_HOME_INTEGRITY",
|
|
13
13
|
"MOSTRA_HOME_NOT_ALWAYS_ON",
|
|
14
|
-
"MOSTRA_HOME_GC_INCOMPLETE"
|
|
14
|
+
"MOSTRA_HOME_GC_INCOMPLETE",
|
|
15
|
+
"MOSTRA_HOME_NETWORK_FILESYSTEM"
|
|
15
16
|
];
|
|
16
17
|
/** The HOME area's catalog entries. */
|
|
17
18
|
const homeDiagnostics = {
|
|
@@ -124,6 +125,16 @@ const homeDiagnostics = {
|
|
|
124
125
|
explanation: "`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.",
|
|
125
126
|
fix: "Run `mostra gc` again; a failure that repeats names its cause in the message (for example, a file the user can't remove)."
|
|
126
127
|
}
|
|
128
|
+
},
|
|
129
|
+
MOSTRA_HOME_NETWORK_FILESYSTEM: {
|
|
130
|
+
severity: "error",
|
|
131
|
+
phase: "host",
|
|
132
|
+
title: "Data directory on a network filesystem",
|
|
133
|
+
hint: "Put the server's data directory on a local disk.",
|
|
134
|
+
docs: {
|
|
135
|
+
explanation: "A remote server's data directory holds its hosted homes' ledgers and locks, which need a local disk: on a network filesystem a lock can seem held by two machines at once, and SQLite's WAL can't share memory across them (D165 item 0b). The server refuses a data directory it detects on NFS, SMB, AFP, WebDAV or a FUSE mount, before it opens anything.",
|
|
136
|
+
fix: "Pass `--data` a directory on a local disk. To keep a copy elsewhere, replicate the homes with a backup tool instead."
|
|
137
|
+
}
|
|
127
138
|
}
|
|
128
139
|
};
|
|
129
140
|
//#endregion
|
|
@@ -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 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"}
|
|
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 \"MOSTRA_HOME_NETWORK_FILESYSTEM\",\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 MOSTRA_HOME_NETWORK_FILESYSTEM: {\n severity: \"error\",\n phase: \"host\",\n title: \"Data directory on a network filesystem\",\n hint: \"Put the server's data directory on a local disk.\",\n docs: {\n explanation:\n \"A remote server's data directory holds its hosted homes' ledgers and locks, which need a local disk: on a network filesystem a lock can seem held by two machines at once, and SQLite's WAL can't share memory across them (D165 item 0b). The server refuses a data directory it detects on NFS, SMB, AFP, WebDAV or a FUSE mount, before it opens anything.\",\n fix: \"Pass `--data` a directory on a local disk. To keep a copy elsewhere, replicate the homes with a backup tool instead.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAOA,MAAa,sBAAsB;CACjC;CACA;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;CACA,gCAAgC;EAC9B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
|
|
@@ -18,6 +18,7 @@ import { NetworkDiagnosticCode, networkDiagnosticCodes } from "./network.js";
|
|
|
18
18
|
import { PlatformDiagnosticCode, platformDiagnosticCodes } from "./platform.js";
|
|
19
19
|
import { PublishDiagnosticCode, publishDiagnosticCodes } from "./publish.js";
|
|
20
20
|
import { RegressionDiagnosticCode, regressionDiagnosticCodes } from "./regression.js";
|
|
21
|
+
import { RemoteDiagnosticCode, remoteDiagnosticCodes } from "./remote.js";
|
|
21
22
|
import { RuntimeDiagnosticCode, runtimeDiagnosticCodes } from "./runtime.js";
|
|
22
23
|
import { SecretDiagnosticCode, secretDiagnosticCodes } from "./secret.js";
|
|
23
24
|
import { ShareDiagnosticCode, shareDiagnosticCodes } from "./share.js";
|
|
@@ -28,7 +29,7 @@ import { TypeDiagnosticCode, typeDiagnosticCodes } from "./type.js";
|
|
|
28
29
|
import { VerifyDiagnosticCode, verifyDiagnosticCodes } from "./verify.js";
|
|
29
30
|
//#region src/diagnostics/codes/index.d.ts
|
|
30
31
|
/** Every code in the catalog. Codes are semver surface and are never removed (AX-03). */
|
|
31
|
-
export type KnownDiagnosticCode = ShareDiagnosticCode | CliDiagnosticCode | RegressionDiagnosticCode | SmokeDiagnosticCode | A11yDiagnosticCode | NetworkDiagnosticCode | ConsoleDiagnosticCode | TypeDiagnosticCode | VerifyDiagnosticCode | LiveDiagnosticCode | SecretDiagnosticCode | RuntimeDiagnosticCode | FieldDiagnosticCode | SubmitDiagnosticCode | HygieneDiagnosticCode | DepDiagnosticCode | EnvDiagnosticCode | TargetDiagnosticCode | ArtifactDiagnosticCode | PublishDiagnosticCode | ActionDiagnosticCode | BuildDiagnosticCode | ManifestDiagnosticCode | HomeDiagnosticCode | PlatformDiagnosticCode | HostDiagnosticCode;
|
|
32
|
+
export type KnownDiagnosticCode = RemoteDiagnosticCode | ShareDiagnosticCode | CliDiagnosticCode | RegressionDiagnosticCode | SmokeDiagnosticCode | A11yDiagnosticCode | NetworkDiagnosticCode | ConsoleDiagnosticCode | TypeDiagnosticCode | VerifyDiagnosticCode | LiveDiagnosticCode | SecretDiagnosticCode | RuntimeDiagnosticCode | FieldDiagnosticCode | SubmitDiagnosticCode | HygieneDiagnosticCode | DepDiagnosticCode | EnvDiagnosticCode | TargetDiagnosticCode | ArtifactDiagnosticCode | PublishDiagnosticCode | ActionDiagnosticCode | BuildDiagnosticCode | ManifestDiagnosticCode | HomeDiagnosticCode | PlatformDiagnosticCode | HostDiagnosticCode;
|
|
32
33
|
/** Every cataloged code with its severity, phase, title, default hint and docs text. */
|
|
33
34
|
export declare const diagnosticCatalog: Readonly<Record<KnownDiagnosticCode, DiagnosticSpec>>;
|
|
34
35
|
/** Options for {@link createDiagnostic}. */
|
|
@@ -48,5 +49,5 @@ export interface CreateDiagnosticOptions {
|
|
|
48
49
|
*/
|
|
49
50
|
export declare function createDiagnostic(code: KnownDiagnosticCode, details: DiagnosticDetails, options?: CreateDiagnosticOptions): Diagnostic;
|
|
50
51
|
//#endregion
|
|
51
|
-
export { type A11yDiagnosticCode, type ActionDiagnosticCode, type ArtifactDiagnosticCode, type BuildDiagnosticCode, type CliDiagnosticCode, type ConsoleDiagnosticCode, type DepDiagnosticCode, type EnvDiagnosticCode, type FieldDiagnosticCode, type HomeDiagnosticCode, type HostDiagnosticCode, type HygieneDiagnosticCode, type LiveDiagnosticCode, type ManifestDiagnosticCode, type NetworkDiagnosticCode, type PlatformDiagnosticCode, type PublishDiagnosticCode, type RegressionDiagnosticCode, type RuntimeDiagnosticCode, type SecretDiagnosticCode, type ShareDiagnosticCode, type SmokeDiagnosticCode, type SubmitDiagnosticCode, type TargetDiagnosticCode, type TypeDiagnosticCode, type VerifyDiagnosticCode, a11yDiagnosticCodes, actionDiagnosticCodes, artifactDiagnosticCodes, buildDiagnosticCodes, cliDiagnosticCodes, consoleDiagnosticCodes, depDiagnosticCodes, envDiagnosticCodes, fieldDiagnosticCodes, homeDiagnosticCodes, hostDiagnosticCodes, hygieneDiagnosticCodes, liveDiagnosticCodes, manifestDiagnosticCodes, networkDiagnosticCodes, platformDiagnosticCodes, publishDiagnosticCodes, regressionDiagnosticCodes, runtimeDiagnosticCodes, secretDiagnosticCodes, shareDiagnosticCodes, smokeDiagnosticCodes, submitDiagnosticCodes, targetDiagnosticCodes, typeDiagnosticCodes, verifyDiagnosticCodes };
|
|
52
|
+
export { type A11yDiagnosticCode, type ActionDiagnosticCode, type ArtifactDiagnosticCode, type BuildDiagnosticCode, type CliDiagnosticCode, type ConsoleDiagnosticCode, type DepDiagnosticCode, type EnvDiagnosticCode, type FieldDiagnosticCode, type HomeDiagnosticCode, type HostDiagnosticCode, type HygieneDiagnosticCode, type LiveDiagnosticCode, type ManifestDiagnosticCode, type NetworkDiagnosticCode, type PlatformDiagnosticCode, type PublishDiagnosticCode, type RegressionDiagnosticCode, type RemoteDiagnosticCode, type RuntimeDiagnosticCode, type SecretDiagnosticCode, type ShareDiagnosticCode, type SmokeDiagnosticCode, type SubmitDiagnosticCode, type TargetDiagnosticCode, type TypeDiagnosticCode, type VerifyDiagnosticCode, a11yDiagnosticCodes, actionDiagnosticCodes, artifactDiagnosticCodes, buildDiagnosticCodes, cliDiagnosticCodes, consoleDiagnosticCodes, depDiagnosticCodes, envDiagnosticCodes, fieldDiagnosticCodes, homeDiagnosticCodes, hostDiagnosticCodes, hygieneDiagnosticCodes, liveDiagnosticCodes, manifestDiagnosticCodes, networkDiagnosticCodes, platformDiagnosticCodes, publishDiagnosticCodes, regressionDiagnosticCodes, remoteDiagnosticCodes, runtimeDiagnosticCodes, secretDiagnosticCodes, shareDiagnosticCodes, smokeDiagnosticCodes, submitDiagnosticCodes, targetDiagnosticCodes, typeDiagnosticCodes, verifyDiagnosticCodes };
|
|
52
53
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/diagnostics/codes/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/diagnostics/codes/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAiEY,sBAER,uBACA,sBACA,oBACA,2BACA,sBACA,qBACA,wBACA,wBACA,qBACA,uBACA,qBACA,uBACA,wBACA,sBACA,uBACA,wBACA,oBACA,oBACA,uBACA,yBACA,wBACA,uBACA,sBACA,yBACA,qBACA,yBACA;;qBAGS,mBAAmB,SAAS,OAAO,qBAAqB;;iBAgCpD;;WAEN;;;;;;;;;;;;wBAaK,iBACd,MAAM,qBACN,SAAS,mBACT,UAAS,0BACR"}
|
|
@@ -17,6 +17,7 @@ import { networkDiagnosticCodes, networkDiagnostics } from "./network.js";
|
|
|
17
17
|
import { platformDiagnosticCodes, platformDiagnostics } from "./platform.js";
|
|
18
18
|
import { publishDiagnosticCodes, publishDiagnostics } from "./publish.js";
|
|
19
19
|
import { regressionDiagnosticCodes, regressionDiagnostics } from "./regression.js";
|
|
20
|
+
import { remoteDiagnosticCodes, remoteDiagnostics } from "./remote.js";
|
|
20
21
|
import { runtimeDiagnosticCodes, runtimeDiagnostics } from "./runtime.js";
|
|
21
22
|
import { secretDiagnosticCodes, secretDiagnostics } from "./secret.js";
|
|
22
23
|
import { shareDiagnosticCodes, shareDiagnostics } from "./share.js";
|
|
@@ -28,6 +29,7 @@ import { verifyDiagnosticCodes, verifyDiagnostics } from "./verify.js";
|
|
|
28
29
|
//#region src/diagnostics/codes/index.ts
|
|
29
30
|
/** Every cataloged code with its severity, phase, title, default hint and docs text. */
|
|
30
31
|
const diagnosticCatalog = {
|
|
32
|
+
...remoteDiagnostics,
|
|
31
33
|
...shareDiagnostics,
|
|
32
34
|
...cliDiagnostics,
|
|
33
35
|
...regressionDiagnostics,
|
|
@@ -69,6 +71,6 @@ function createDiagnostic(code, details, options = {}) {
|
|
|
69
71
|
return buildDiagnostic(code, diagnosticCatalog[code], details, options.docsBase);
|
|
70
72
|
}
|
|
71
73
|
//#endregion
|
|
72
|
-
export { a11yDiagnosticCodes, actionDiagnosticCodes, artifactDiagnosticCodes, buildDiagnosticCodes, cliDiagnosticCodes, consoleDiagnosticCodes, createDiagnostic, depDiagnosticCodes, diagnosticCatalog, envDiagnosticCodes, fieldDiagnosticCodes, homeDiagnosticCodes, hostDiagnosticCodes, hygieneDiagnosticCodes, liveDiagnosticCodes, manifestDiagnosticCodes, networkDiagnosticCodes, platformDiagnosticCodes, publishDiagnosticCodes, regressionDiagnosticCodes, runtimeDiagnosticCodes, secretDiagnosticCodes, shareDiagnosticCodes, smokeDiagnosticCodes, submitDiagnosticCodes, targetDiagnosticCodes, typeDiagnosticCodes, verifyDiagnosticCodes };
|
|
74
|
+
export { a11yDiagnosticCodes, actionDiagnosticCodes, artifactDiagnosticCodes, buildDiagnosticCodes, cliDiagnosticCodes, consoleDiagnosticCodes, createDiagnostic, depDiagnosticCodes, diagnosticCatalog, envDiagnosticCodes, fieldDiagnosticCodes, homeDiagnosticCodes, hostDiagnosticCodes, hygieneDiagnosticCodes, liveDiagnosticCodes, manifestDiagnosticCodes, networkDiagnosticCodes, platformDiagnosticCodes, publishDiagnosticCodes, regressionDiagnosticCodes, remoteDiagnosticCodes, runtimeDiagnosticCodes, secretDiagnosticCodes, shareDiagnosticCodes, smokeDiagnosticCodes, submitDiagnosticCodes, targetDiagnosticCodes, typeDiagnosticCodes, verifyDiagnosticCodes };
|
|
73
75
|
|
|
74
76
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/diagnostics/codes/index.ts"],"sourcesContent":["/**\n * The diagnostic catalog, assembled from one source file per area. `pnpm gen diagnostic` keeps\n * the lists below in step with the area files; edit the area files, not these lists.\n */\nimport type { Diagnostic } from \"../diagnostic.ts\";\nimport { buildDiagnostic, type DiagnosticDetails, type DiagnosticSpec } from \"../spec.ts\";\nimport { type A11yDiagnosticCode, a11yDiagnostics } from \"./a11y.ts\";\nimport { type ActionDiagnosticCode, actionDiagnostics } from \"./action.ts\";\nimport { type ArtifactDiagnosticCode, artifactDiagnostics } from \"./artifact.ts\";\nimport { type BuildDiagnosticCode, buildDiagnostics } from \"./build.ts\";\nimport { type CliDiagnosticCode, cliDiagnostics } from \"./cli.ts\";\nimport { type ConsoleDiagnosticCode, consoleDiagnostics } from \"./console.ts\";\nimport { type DepDiagnosticCode, depDiagnostics } from \"./dep.ts\";\nimport { type EnvDiagnosticCode, envDiagnostics } from \"./env.ts\";\nimport { type FieldDiagnosticCode, fieldDiagnostics } from \"./field.ts\";\nimport { type HomeDiagnosticCode, homeDiagnostics } from \"./home.ts\";\nimport { type HostDiagnosticCode, hostDiagnostics } from \"./host.ts\";\nimport { type HygieneDiagnosticCode, hygieneDiagnostics } from \"./hygiene.ts\";\nimport { type LiveDiagnosticCode, liveDiagnostics } from \"./live.ts\";\nimport { type ManifestDiagnosticCode, manifestDiagnostics } from \"./manifest.ts\";\nimport { type NetworkDiagnosticCode, networkDiagnostics } from \"./network.ts\";\nimport { type PlatformDiagnosticCode, platformDiagnostics } from \"./platform.ts\";\nimport { type PublishDiagnosticCode, publishDiagnostics } from \"./publish.ts\";\nimport { type RegressionDiagnosticCode, regressionDiagnostics } from \"./regression.ts\";\nimport { type RuntimeDiagnosticCode, runtimeDiagnostics } from \"./runtime.ts\";\nimport { type SecretDiagnosticCode, secretDiagnostics } from \"./secret.ts\";\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/diagnostics/codes/index.ts"],"sourcesContent":["/**\n * The diagnostic catalog, assembled from one source file per area. `pnpm gen diagnostic` keeps\n * the lists below in step with the area files; edit the area files, not these lists.\n */\nimport type { Diagnostic } from \"../diagnostic.ts\";\nimport { buildDiagnostic, type DiagnosticDetails, type DiagnosticSpec } from \"../spec.ts\";\nimport { type A11yDiagnosticCode, a11yDiagnostics } from \"./a11y.ts\";\nimport { type ActionDiagnosticCode, actionDiagnostics } from \"./action.ts\";\nimport { type ArtifactDiagnosticCode, artifactDiagnostics } from \"./artifact.ts\";\nimport { type BuildDiagnosticCode, buildDiagnostics } from \"./build.ts\";\nimport { type CliDiagnosticCode, cliDiagnostics } from \"./cli.ts\";\nimport { type ConsoleDiagnosticCode, consoleDiagnostics } from \"./console.ts\";\nimport { type DepDiagnosticCode, depDiagnostics } from \"./dep.ts\";\nimport { type EnvDiagnosticCode, envDiagnostics } from \"./env.ts\";\nimport { type FieldDiagnosticCode, fieldDiagnostics } from \"./field.ts\";\nimport { type HomeDiagnosticCode, homeDiagnostics } from \"./home.ts\";\nimport { type HostDiagnosticCode, hostDiagnostics } from \"./host.ts\";\nimport { type HygieneDiagnosticCode, hygieneDiagnostics } from \"./hygiene.ts\";\nimport { type LiveDiagnosticCode, liveDiagnostics } from \"./live.ts\";\nimport { type ManifestDiagnosticCode, manifestDiagnostics } from \"./manifest.ts\";\nimport { type NetworkDiagnosticCode, networkDiagnostics } from \"./network.ts\";\nimport { type PlatformDiagnosticCode, platformDiagnostics } from \"./platform.ts\";\nimport { type PublishDiagnosticCode, publishDiagnostics } from \"./publish.ts\";\nimport { type RegressionDiagnosticCode, regressionDiagnostics } from \"./regression.ts\";\n// gen:area-imports\nimport { type RemoteDiagnosticCode, remoteDiagnostics } from \"./remote.ts\";\nimport { type RuntimeDiagnosticCode, runtimeDiagnostics } from \"./runtime.ts\";\nimport { type SecretDiagnosticCode, secretDiagnostics } from \"./secret.ts\";\nimport { type ShareDiagnosticCode, shareDiagnostics } from \"./share.ts\";\nimport { type SmokeDiagnosticCode, smokeDiagnostics } from \"./smoke.ts\";\nimport { type SubmitDiagnosticCode, submitDiagnostics } from \"./submit.ts\";\nimport { type TargetDiagnosticCode, targetDiagnostics } from \"./target.ts\";\nimport { type TypeDiagnosticCode, typeDiagnostics } from \"./type.ts\";\nimport { type VerifyDiagnosticCode, verifyDiagnostics } from \"./verify.ts\";\n\nexport { type A11yDiagnosticCode, a11yDiagnosticCodes } from \"./a11y.ts\";\nexport { type ActionDiagnosticCode, actionDiagnosticCodes } from \"./action.ts\";\nexport { type ArtifactDiagnosticCode, artifactDiagnosticCodes } from \"./artifact.ts\";\nexport { type BuildDiagnosticCode, buildDiagnosticCodes } from \"./build.ts\";\nexport { type CliDiagnosticCode, cliDiagnosticCodes } from \"./cli.ts\";\nexport { type ConsoleDiagnosticCode, consoleDiagnosticCodes } from \"./console.ts\";\nexport { type DepDiagnosticCode, depDiagnosticCodes } from \"./dep.ts\";\nexport { type EnvDiagnosticCode, envDiagnosticCodes } from \"./env.ts\";\nexport { type FieldDiagnosticCode, fieldDiagnosticCodes } from \"./field.ts\";\nexport { type HomeDiagnosticCode, homeDiagnosticCodes } from \"./home.ts\";\nexport { type HostDiagnosticCode, hostDiagnosticCodes } from \"./host.ts\";\nexport { type HygieneDiagnosticCode, hygieneDiagnosticCodes } from \"./hygiene.ts\";\nexport { type LiveDiagnosticCode, liveDiagnosticCodes } from \"./live.ts\";\nexport { type ManifestDiagnosticCode, manifestDiagnosticCodes } from \"./manifest.ts\";\nexport { type NetworkDiagnosticCode, networkDiagnosticCodes } from \"./network.ts\";\nexport { type PlatformDiagnosticCode, platformDiagnosticCodes } from \"./platform.ts\";\nexport { type PublishDiagnosticCode, publishDiagnosticCodes } from \"./publish.ts\";\nexport { type RegressionDiagnosticCode, regressionDiagnosticCodes } from \"./regression.ts\";\n// gen:area-exports\nexport { type RemoteDiagnosticCode, remoteDiagnosticCodes } from \"./remote.ts\";\nexport { type RuntimeDiagnosticCode, runtimeDiagnosticCodes } from \"./runtime.ts\";\nexport { type SecretDiagnosticCode, secretDiagnosticCodes } from \"./secret.ts\";\nexport { type ShareDiagnosticCode, shareDiagnosticCodes } from \"./share.ts\";\nexport { type SmokeDiagnosticCode, smokeDiagnosticCodes } from \"./smoke.ts\";\nexport { type SubmitDiagnosticCode, submitDiagnosticCodes } from \"./submit.ts\";\nexport { type TargetDiagnosticCode, targetDiagnosticCodes } from \"./target.ts\";\nexport { type TypeDiagnosticCode, typeDiagnosticCodes } from \"./type.ts\";\nexport { type VerifyDiagnosticCode, verifyDiagnosticCodes } from \"./verify.ts\";\n\n/** Every code in the catalog. Codes are semver surface and are never removed (AX-03). */\nexport type KnownDiagnosticCode =\n // gen:area-codes\n | RemoteDiagnosticCode\n | ShareDiagnosticCode\n | CliDiagnosticCode\n | RegressionDiagnosticCode\n | SmokeDiagnosticCode\n | A11yDiagnosticCode\n | NetworkDiagnosticCode\n | ConsoleDiagnosticCode\n | TypeDiagnosticCode\n | VerifyDiagnosticCode\n | LiveDiagnosticCode\n | SecretDiagnosticCode\n | RuntimeDiagnosticCode\n | FieldDiagnosticCode\n | SubmitDiagnosticCode\n | HygieneDiagnosticCode\n | DepDiagnosticCode\n | EnvDiagnosticCode\n | TargetDiagnosticCode\n | ArtifactDiagnosticCode\n | PublishDiagnosticCode\n | ActionDiagnosticCode\n | BuildDiagnosticCode\n | ManifestDiagnosticCode\n | HomeDiagnosticCode\n | PlatformDiagnosticCode\n | HostDiagnosticCode;\n\n/** Every cataloged code with its severity, phase, title, default hint and docs text. */\nexport const diagnosticCatalog: Readonly<Record<KnownDiagnosticCode, DiagnosticSpec>> = {\n // gen:area-spreads\n ...remoteDiagnostics,\n ...shareDiagnostics,\n ...cliDiagnostics,\n ...regressionDiagnostics,\n ...smokeDiagnostics,\n ...a11yDiagnostics,\n ...networkDiagnostics,\n ...consoleDiagnostics,\n ...typeDiagnostics,\n ...verifyDiagnostics,\n ...liveDiagnostics,\n ...secretDiagnostics,\n ...runtimeDiagnostics,\n ...fieldDiagnostics,\n ...submitDiagnostics,\n ...hygieneDiagnostics,\n ...depDiagnostics,\n ...envDiagnostics,\n ...targetDiagnostics,\n ...artifactDiagnostics,\n ...publishDiagnostics,\n ...actionDiagnostics,\n ...buildDiagnostics,\n ...manifestDiagnostics,\n ...homeDiagnostics,\n ...platformDiagnostics,\n ...hostDiagnostics,\n};\n\n/** Options for {@link createDiagnostic}. */\nexport interface CreateDiagnosticOptions {\n /** The docs site base URL. Defaults to `DEFAULT_DOCS_BASE`. */\n readonly docsBase?: string;\n}\n\n/**\n * Creates the diagnostic for one occurrence of a cataloged code. Severity, phase, the default hint\n * and the docs link come from the catalog.\n *\n * ```ts\n * createDiagnostic(\"MOSTRA_HOST_REVISION_UNSUPPORTED\", {\n * message: \"The client offered 2026-01-01; this instance supports 2026-10-10.\",\n * });\n * ```\n */\nexport function createDiagnostic(\n code: KnownDiagnosticCode,\n details: DiagnosticDetails,\n options: CreateDiagnosticOptions = {},\n): Diagnostic {\n return buildDiagnostic(code, diagnosticCatalog[code], details, options.docsBase);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAa,oBAA2E;CAEtF,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL;;;;;;;;;;;AAkBA,SAAgB,iBACd,MACA,SACA,UAAmC,CAAC,GACxB;CACZ,OAAO,gBAAgB,MAAM,kBAAkB,OAAO,SAAS,QAAQ,QAAQ;AACjF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "../spec.js";
|
|
2
|
+
//#region src/diagnostics/codes/remote.d.ts
|
|
3
|
+
/** The codes of the REMOTE area, in the order they were added. */
|
|
4
|
+
export declare const remoteDiagnosticCodes: readonly ["MOSTRA_REMOTE_CONFIG_INVALID", "MOSTRA_REMOTE_LOGIN_FAILED", "MOSTRA_REMOTE_UNREACHABLE", "MOSTRA_REMOTE_OWNER_OFFLINE", "MOSTRA_REMOTE_QUEUE_FULL", "MOSTRA_REMOTE_NOT_OWNER_INSTANCE", "MOSTRA_REMOTE_SIGN_IN_REQUIRED", "MOSTRA_REMOTE_RATE_LIMITED", "MOSTRA_REMOTE_PAUSED_BY_OPERATOR", "MOSTRA_REMOTE_LIMIT_REACHED", "MOSTRA_REMOTE_OPERATOR_UNAVAILABLE", "MOSTRA_REMOTE_NO_INSTANCE", "MOSTRA_REMOTE_UNDER_REVIEW", "MOSTRA_REMOTE_HOME_SUSPENDED", "MOSTRA_REMOTE_HOME_MOVING"];
|
|
5
|
+
/** The codes of the REMOTE area. */
|
|
6
|
+
export type RemoteDiagnosticCode = (typeof remoteDiagnosticCodes)[number];
|
|
7
|
+
//#endregion
|
|
8
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.d.ts","names":[],"sources":["../../../src/diagnostics/codes/remote.ts"],"mappings":";;;qBAMa;;YAoBD,+BAA+B"}
|