@mostra/protocol 0.10.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.
Files changed (55) hide show
  1. package/dist/browser.d.ts +42 -0
  2. package/dist/browser.d.ts.map +1 -1
  3. package/dist/browser.js +29 -1
  4. package/dist/browser.js.map +1 -1
  5. package/dist/diagnostics/codes/action.d.ts +1 -1
  6. package/dist/diagnostics/codes/action.d.ts.map +1 -1
  7. package/dist/diagnostics/codes/action.js +12 -1
  8. package/dist/diagnostics/codes/action.js.map +1 -1
  9. package/dist/diagnostics/codes/remote.d.ts +1 -1
  10. package/dist/diagnostics/codes/remote.d.ts.map +1 -1
  11. package/dist/diagnostics/codes/remote.js +78 -1
  12. package/dist/diagnostics/codes/remote.js.map +1 -1
  13. package/dist/diagnostics/codes/submit.d.ts +1 -1
  14. package/dist/diagnostics/codes/submit.d.ts.map +1 -1
  15. package/dist/diagnostics/codes/submit.js +12 -1
  16. package/dist/diagnostics/codes/submit.js.map +1 -1
  17. package/dist/index.d.ts +5 -2
  18. package/dist/index.js +4 -1
  19. package/dist/interaction.d.ts +5 -0
  20. package/dist/interaction.d.ts.map +1 -1
  21. package/dist/interaction.js +2 -1
  22. package/dist/interaction.js.map +1 -1
  23. package/dist/methods/artifact/pause.d.ts +33 -0
  24. package/dist/methods/artifact/pause.d.ts.map +1 -0
  25. package/dist/methods/artifact/pause.js +33 -0
  26. package/dist/methods/artifact/pause.js.map +1 -0
  27. package/dist/methods/index.d.ts.map +1 -1
  28. package/dist/methods/index.js +7 -1
  29. package/dist/methods/index.js.map +1 -1
  30. package/dist/methods/port/relay-author.d.ts +28 -0
  31. package/dist/methods/port/relay-author.d.ts.map +1 -0
  32. package/dist/methods/port/relay-author.js +42 -0
  33. package/dist/methods/port/relay-author.js.map +1 -0
  34. package/dist/methods/remote/link.d.ts +40 -0
  35. package/dist/methods/remote/link.d.ts.map +1 -0
  36. package/dist/methods/remote/link.js +40 -0
  37. package/dist/methods/remote/link.js.map +1 -0
  38. package/dist/operator.d.ts +464 -0
  39. package/dist/operator.d.ts.map +1 -0
  40. package/dist/operator.js +134 -0
  41. package/dist/operator.js.map +1 -0
  42. package/package.json +11 -1
  43. package/schemas/protocol.draft-07.json +259 -0
  44. package/schemas/protocol.schema.json +259 -0
  45. package/src/browser.ts +64 -0
  46. package/src/diagnostics/codes/action.ts +12 -0
  47. package/src/diagnostics/codes/remote.ts +84 -0
  48. package/src/diagnostics/codes/submit.ts +12 -0
  49. package/src/index.ts +19 -0
  50. package/src/interaction.ts +6 -0
  51. package/src/methods/artifact/pause.ts +59 -0
  52. package/src/methods/index.ts +6 -0
  53. package/src/methods/port/relay-author.ts +57 -0
  54. package/src/methods/remote/link.ts +65 -0
  55. package/src/operator.ts +621 -0
package/dist/browser.d.ts CHANGED
@@ -126,6 +126,48 @@ export interface FrameTicket extends ViewContext {
126
126
  * (D70, D158 item 5). Absent: cookie mode.
127
127
  */
128
128
  readonly mode?: "worker";
129
+ /**
130
+ * The artifact is paused (D165 item 14): the shell says so, by whom and why (the reason as text);
131
+ * it takes no submissions and runs no actions until it is resumed (WP-30).
132
+ */
133
+ readonly paused?: {
134
+ readonly by: "owner" | "operator";
135
+ readonly reason?: string;
136
+ };
137
+ /** On a remote server: what the hosted shell's trusted chrome shows around the page (D161). */
138
+ readonly hosted?: HostedChrome;
139
+ }
140
+ /**
141
+ * The hosted shell's trusted chrome for one view (D161, ARCHITECTURE §15.8; WP-30). Every string an
142
+ * owner or operator supplies is rendered as text, never as markup.
143
+ */
144
+ export interface HostedChrome {
145
+ /** Who sent the page: the owner's display name, and the provider that verified it, if any. */
146
+ readonly sender?: {
147
+ readonly name: string;
148
+ readonly verifiedBy?: string;
149
+ };
150
+ /** Who this browser is to the page: signed in as an account, or anonymous (with a chosen name). */
151
+ readonly viewer: {
152
+ readonly kind: "account" | "anonymous" | "named";
153
+ readonly name?: string;
154
+ readonly verified: boolean;
155
+ };
156
+ /** Whether "Sign in" is offered (the viewer isn't signed in, and the server has a provider). */
157
+ readonly signIn: boolean;
158
+ /** The operator's footer wording in place of the shell's own; never hidden on a public link. */
159
+ readonly footer?: string;
160
+ /** The operator's line after "Your answer was sent.". */
161
+ readonly afterSubmit?: string;
162
+ /** The made-with mark, where the operator shows one. */
163
+ readonly madeWith?: {
164
+ readonly href?: string;
165
+ };
166
+ /** A page shown before the artifact, once per browser and link. */
167
+ readonly interstitial?: {
168
+ readonly kind: string;
169
+ readonly message?: string;
170
+ };
129
171
  }
130
172
  /** The Zod schema of the `FrameTicket` type. */
131
173
  export declare const FrameTicket: z.ZodType<FrameTicket>;
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","names":[],"sources":["../src/browser.ts"],"mappings":";;;;;;qBA0Ca;;qBAGA;;qBAGA;;iBAGI;;WAEN;;WAEA;;WAEA,cAAc;;WAEd;;WAEA,cAAc;;;qBAIZ,eAAe,EAAE,QAAQ;;iBAcrB;;WAEN;;WAEA,kBAAkB;;WAElB;;;qBAIE,eAAe,EAAE,QAAQ;;iBAYrB;;WAEN;;WAEA;;WAEA;;;qBAIE,eAAe,EAAE,QAAQ;;iBAYrB;;WAEN,UAAU;;WAEV;;WAEA,QAAQ,SAAS,eAAe;;;qBAI9B,kBAAkB,EAAE,QAAQ;;;;;iBAexB;;WAEN;;WAEA,QAAQ;;WAER,OAAO;;WAEP,OAAO;;WAEP,aAAa;;;;;;WAMb,SAAS;;;qBAIP,gBAAgB,EAAE,QAAQ;;iBAetB;;WAEN;;WAEA,iBAAiB;;WAEjB,WAAW;;;;;WAKX,qBAAqB;;;qBAInB,YAAY,EAAE,QAAQ;;;;;iBAgBlB,oBAAoB;;WAE1B;;WAEA;;WAEA;;WAEA;;;;;WAKA;;;;;WAKA;;;;;;WAMA;;;qBAIE,aAAa,EAAE,QAAQ;;;;;qBA6BvB;;;;;qBAMA;;;;;iBAMI;;WAEN;;;qBAIE,cAAc,EAAE,QAAQ;;iBAKpB;;WAEN;;WAEA;;;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;;WAE1B;;WAEA;;WAEA;;WAEA;;;;;WAKA;;;;;WAKA;;;;;;WAMA;;;;;WAKA;aAAoB;aAAmC;;;WAEvD,SAAS;;;;;;iBAOH;;WAEN;aAAoB;aAAuB;;;WAE3C;aACE;aACA;aACA;;;WAGF;;WAEA;;WAEA;;WAEA;aAAsB;;;WAEtB;aAA0B;aAAuB;;;;qBA6B/C,aAAa,EAAE,QAAQ;;;;;qBAoCvB;;;;;qBAMA;;;;;iBAMI;;WAEN;;;qBAIE,cAAc,EAAE,QAAQ;;iBAKpB;;WAEN;;WAEA;;;qBAIE,aAAa,EAAE,QAAQ;;;;;;iBAYnB;;WAEN;;;qBAIE,qBAAqB,EAAE,QAAQ;;iBAK3B;;WAEN;;WAEA;;;qBAIE,cAAc,EAAE,QAAQ;;;;iBAUpB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,SAAS;;WAET,UAAU;;WAEV;;;;;WAKA;;;qBAIE,mBAAmB,EAAE,QAAQ;;;;;;iBAuBzB;;WAEN;;WAEA,kBAAkB;;;qBAIhB,oBAAoB,EAAE,QAAQ;;;;;;iBAY1B;;WAEN;;WAEA;;WAEA,cAAc;;WAEd;;WAEA;;WAEA;;;qBAIE,eAAe,EAAE,QAAQ;;iBAgBrB;;WAEN;;;qBAIE,eAAe,EAAE,QAAQ;;iBAQrB;;WAEN;;WAEA;;WAEA;;WAEA;;;qBAIE,eAAe,EAAE,QAAQ;;;;;;iBAiBrB;;WAEN,SAAS;;WAET,kBAAkB;;;qBAIhB,WAAW,EAAE,QAAQ"}
package/dist/browser.js CHANGED
@@ -82,6 +82,29 @@ const PollResult = z.object({
82
82
  id: "PollResult",
83
83
  description: "A long-poll answer: the cursor, the events after the asked one, and a snapshot."
84
84
  });
85
+ const HostedChrome = z.object({
86
+ sender: z.object({
87
+ name: z.string().max(256),
88
+ verifiedBy: z.string().max(64).exactOptional()
89
+ }).exactOptional(),
90
+ viewer: z.object({
91
+ kind: z.enum([
92
+ "account",
93
+ "anonymous",
94
+ "named"
95
+ ]),
96
+ name: z.string().max(256).exactOptional(),
97
+ verified: z.boolean()
98
+ }),
99
+ signIn: z.boolean(),
100
+ footer: z.string().max(500).exactOptional(),
101
+ afterSubmit: z.string().max(500).exactOptional(),
102
+ madeWith: z.object({ href: z.url({ protocol: /^https$/ }).max(2048).exactOptional() }).exactOptional(),
103
+ interstitial: z.object({
104
+ kind: z.string().max(64),
105
+ message: z.string().max(2e3).exactOptional()
106
+ }).exactOptional()
107
+ });
85
108
  /** The Zod schema of the `FrameTicket` type. */
86
109
  const FrameTicket = z.object({
87
110
  artifactId: ArtifactId.schema,
@@ -103,7 +126,12 @@ const FrameTicket = z.object({
103
126
  pinned: z.boolean(),
104
127
  serverParked: z.literal(true).exactOptional(),
105
128
  devPreview: z.literal(true).exactOptional(),
106
- mode: z.literal("worker").exactOptional()
129
+ mode: z.literal("worker").exactOptional(),
130
+ paused: z.object({
131
+ by: z.enum(["owner", "operator"]),
132
+ reason: z.string().max(500).exactOptional()
133
+ }).exactOptional(),
134
+ hosted: HostedChrome.exactOptional()
107
135
  }).register(wireRegistry, {
108
136
  id: "FrameTicket",
109
137
  description: "A frame ticket: the view it opens, where to load it, and the view's controls."
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","names":[],"sources":["../src/browser.ts"],"sourcesContent":["/**\n * The browser protocol (INTERFACES §4, D106): what the client runtime in an artifact's frame sends\n * to the gateway and receives from it. Published versions embed the client runtime, so a gateway\n * serves every revision it ever shipped (FAILURE_MODEL §7); within a revision payloads only grow.\n * Paths are `/_mostra/v/{revision}/…` on the artifact's origin.\n *\n * ```ts\n * const body: FieldsRequest = { mutationId, scope: \"viewer\", baseRevision: \"3\", viewId, ops };\n * await fetch(`/_mostra/v/${BROWSER_PROTOCOL_REVISION}/fields`, { method: \"POST\", body: … });\n * ```\n */\nimport * as z from \"zod\";\nimport type { EphemeralMessage } from \"./actions.ts\";\nimport { ArtifactId, Cursor, MutationId, ViewId } from \"./ids.ts\";\nimport {\n DocumentRevision,\n EventRecord,\n FieldOp,\n FieldState,\n SubmissionSummary,\n Viewer,\n} from \"./interaction.ts\";\nimport { SubmissionPolicy } from \"./manifest.ts\";\nimport {\n REVIEW_SET_ID_PATTERN,\n SubmitChannel,\n TrustedControl,\n VersionRef,\n type ViewContext,\n} from \"./view.ts\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\nexport {\n type DeliveryTarget,\n REVIEW_SET_ID_PATTERN,\n readViewContext,\n VersionRef,\n ViewContext,\n ViewContextWire,\n} from \"./view.ts\";\n\n/** Every browser-protocol revision this release serves, oldest first. */\nexport const BROWSER_PROTOCOL_REVISIONS: readonly [\"2026-10-15\"] = [\"2026-10-15\"];\n\n/** The newest browser-protocol revision: what a client runtime built now speaks. */\nexport const BROWSER_PROTOCOL_REVISION = \"2026-10-15\";\n\n/** The longest JSON a signal's payload may be, in UTF-8 bytes (D106). */\nexport const SIGNAL_PAYLOAD_MAX_BYTES: number = 64 * 1024;\n\n/** `POST …/fields`: one mutation of the viewer's draft or the artifact's state. */\nexport interface FieldsRequest {\n /** A fresh `mut_` ID per change; a retry repeats it and gets the recorded result. */\n readonly mutationId: string;\n /** Which document: the viewer's draft or the artifact's shared state. */\n readonly scope: \"viewer\" | \"artifact\";\n /** The document revision the page last saw; fields changed after it come back as conflicts. */\n readonly baseRevision: DocumentRevision;\n /** The view the page was opened as (D104). */\n readonly viewId: string;\n /** The field changes, applied together under one revision. */\n readonly ops: readonly FieldOp[];\n}\n\n/** The Zod schema of the `FieldsRequest` type. */\nexport const FieldsRequest: z.ZodType<FieldsRequest> = z\n .object({\n mutationId: MutationId.schema,\n scope: z.enum([\"viewer\", \"artifact\"]),\n baseRevision: DocumentRevision,\n viewId: ViewId.schema,\n ops: z.array(FieldOp).min(1).max(1000).readonly(),\n })\n .register(wireRegistry, {\n id: \"FieldsRequest\",\n description: \"A browser mutation: its ID, scope, base revision, view and field ops.\",\n });\n\n/** `POST …/submit`: submit the viewer's draft from the artifact's own code (D40). */\nexport interface SubmitRequest {\n /** The view the page was opened as (D104); its version is what the submission names. */\n readonly viewId: string;\n /** The draft revision the viewer saw; another one is `MOSTRA_SUBMIT_REVISION_MOVED`. */\n readonly expectedRevision: DocumentRevision;\n /** Always `artifact` on this route; the shell's trusted Submit is the `shell` channel (D40). */\n readonly channel: \"artifact\";\n}\n\n/** The Zod schema of the `SubmitRequest` type. */\nexport const SubmitRequest: z.ZodType<SubmitRequest> = z\n .object({\n viewId: ViewId.schema,\n expectedRevision: DocumentRevision,\n channel: z.literal(\"artifact\"),\n })\n .register(wireRegistry, {\n id: \"SubmitRequest\",\n description: \"A browser submit: the view and the draft revision the viewer saw.\",\n });\n\n/** `POST …/signal`: raise a named signal for the host's attention (IN-09). */\nexport interface SignalRequest {\n /** The view the page was opened as (D104). */\n readonly viewId: string;\n /** Letters, digits, `.`, `_` and `-`; `submit` is reserved. */\n readonly name: string;\n /** Any JSON, at most 64 KiB. */\n readonly payload?: unknown;\n}\n\n/** The Zod schema of the `SignalRequest` type. */\nexport const SignalRequest: z.ZodType<SignalRequest> = z\n .object({\n viewId: ViewId.schema,\n name: z.string().min(1).max(64),\n payload: z.unknown().exactOptional(),\n })\n .register(wireRegistry, {\n id: \"SignalRequest\",\n description: \"A browser signal: the view, the signal's name and an optional JSON payload.\",\n }) as z.ZodType<SignalRequest>;\n\n/** A document as the page loads it: its revision and fields. */\nexport interface DocumentSnapshot {\n /** The document's revision. */\n readonly revision: DocumentRevision;\n /** The draft's epoch (D103); 1 for artifact state. */\n readonly epoch: number;\n /** Every field by ID. */\n readonly fields: Readonly<Record<string, FieldState>>;\n}\n\n/** The Zod schema of the `DocumentSnapshot` type. */\nexport const DocumentSnapshot: z.ZodType<DocumentSnapshot> = z\n .object({\n revision: DocumentRevision,\n epoch: z.int().min(1),\n fields: z.record(z.string(), FieldState),\n })\n .register(wireRegistry, {\n id: \"DocumentSnapshot\",\n description: \"A document's revision, epoch and fields, as a page loads it.\",\n });\n\n/**\n * The first message of a browser event stream, and a poll's `snapshot`: where the page stands,\n * so it renders the canonical draft and state before applying events after `cursor`.\n */\nexport interface StreamSnapshot {\n /** Events after this cursor follow. */\n readonly cursor: string;\n /** Who the page acts as. */\n readonly viewer: Viewer;\n /** The viewer's draft. */\n readonly draft: DocumentSnapshot;\n /** The artifact's shared state. */\n readonly state: DocumentSnapshot;\n /** The submission that closed this draft, or this viewer's latest under `epochs`. */\n readonly submission?: SubmissionSummary;\n /**\n * The artifact's latest version when the snapshot was read (WP-07): a reader that missed its\n * `version.published` event (published between a frame ticket and the stream, or compacted)\n * still learns of it.\n */\n readonly latest?: VersionRef;\n}\n\n/** The Zod schema of the `StreamSnapshot` type. */\nexport const StreamSnapshot: z.ZodType<StreamSnapshot> = z\n .object({\n cursor: Cursor.schema,\n viewer: Viewer,\n draft: DocumentSnapshot,\n state: DocumentSnapshot,\n submission: SubmissionSummary.exactOptional(),\n latest: VersionRef.exactOptional(),\n })\n .register(wireRegistry, {\n id: \"StreamSnapshot\",\n description: \"Where a page stands: cursor, viewer, draft, artifact state and its submission.\",\n });\n\n/** `GET …/events/poll`: the long-poll answer on the same cursor as the stream (D47). */\nexport interface PollResult {\n /** Where the next poll continues. */\n readonly cursor: string;\n /** The events for this page after the cursor asked for, in order. */\n readonly events: readonly EventRecord[];\n /** Present when the poll asked for none or its cursor was compacted away. */\n readonly snapshot?: StreamSnapshot;\n /**\n * Run and live updates for this view since its last poll (WP-08): lossy and never stored as\n * events, the long-poll's counterpart of the stream's `run` and `live` messages.\n */\n readonly ephemeral?: readonly EphemeralMessage[];\n}\n\n/** The Zod schema of the `PollResult` type. */\nexport const PollResult: z.ZodType<PollResult> = z\n .object({\n cursor: Cursor.schema,\n events: z.array(EventRecord).readonly(),\n snapshot: StreamSnapshot.exactOptional(),\n ephemeral: z.array(z.record(z.string(), z.unknown())).readonly().exactOptional(),\n })\n .register(wireRegistry, {\n id: \"PollResult\",\n description: \"A long-poll answer: the cursor, the events after the asked one, and a snapshot.\",\n }) as unknown as z.ZodType<PollResult>;\n\n/**\n * `POST /a/{artifactId}/_mostra/ticket`'s answer on the shell origin: a single-use frame ticket,\n * the view it opens and what the shell needs to render the view's trusted controls (D104, D108).\n */\nexport interface FrameTicket extends ViewContext {\n /** The frame's entry URL, carrying the single-use ticket. */\n readonly src: string;\n /** The artifact's origin: the only origin the bridge accepts messages from. */\n readonly artifactOrigin: string;\n /** Whether this viewer follows the artifact's new versions (D63). */\n readonly follow: boolean;\n /** Whether the link opens this version only (D97 item 9): then the shell offers no newer one. */\n readonly pinned: boolean;\n /**\n * The version's server code keeps crashing and is parked (WP-08, FAILURE_MODEL §2): the shell\n * says so, since the page's actions and live data won't work until a new publish.\n */\n readonly serverParked?: true;\n /**\n * The frame shows `mostra dev`'s development preview of unpublished source (D140 item 12): the\n * shell says so, and it is never a published version.\n */\n readonly devPreview?: true;\n /**\n * `worker` when the shell and the artifact are two sites (a Cloudflare quick tunnel, a host's\n * addresses on two hosts): the frame enters through the bootstrap page and a service worker\n * (D70, D158 item 5). Absent: cookie mode.\n */\n readonly mode?: \"worker\";\n}\n\n/** The Zod schema of the `FrameTicket` type. */\nexport const FrameTicket: z.ZodType<FrameTicket> = z\n .object({\n artifactId: ArtifactId.schema,\n viewId: ViewId.schema,\n version: VersionRef,\n latest: VersionRef,\n policy: SubmissionPolicy,\n submitChannels: z.array(SubmitChannel).min(1).max(2).readonly(),\n controls: z.array(TrustedControl).max(32).readonly(),\n target: z.enum([\"live\", \"static\", \"mcp-app\", \"verify\"]),\n src: z.string().min(1),\n artifactOrigin: z.string().min(1),\n follow: z.boolean(),\n pinned: z.boolean(),\n serverParked: z.literal(true).exactOptional(),\n devPreview: z.literal(true).exactOptional(),\n mode: z.literal(\"worker\").exactOptional(),\n })\n .register(wireRegistry, {\n id: \"FrameTicket\",\n description: \"A frame ticket: the view it opens, where to load it, and the view's controls.\",\n });\n\n// ── Frame sessions in worker mode (WP-13, D70, D158 item 5) ───────────────────────────────\n\n/**\n * The header Mostra's service worker adds to every same-origin request of a worker-mode frame:\n * its frame session's secret, which no cookie can carry across sites.\n */\nexport const FRAME_SESSION_HEADER = \"x-mostra-frame\";\n\n/**\n * The header a hosted shell sends its session's secret in (INTERFACES §18.4, D165 item 8): no\n * cookie is ever set or read on a hosted host, so no tenant page can toss, shadow or crowd one out.\n */\nexport const SHELL_SESSION_HEADER = \"x-mostra-shell\";\n\n/**\n * `POST /_mostra/enter` on the artifact's origin: the bootstrap page exchanges the shell's\n * single-use frame ticket, from `/_mostra/enter#t=…`, for a worker-mode frame session.\n */\nexport interface EnterRequest {\n /** The frame ticket. */\n readonly ticket: string;\n}\n\n/** The Zod schema of the `EnterRequest` type. */\nexport const EnterRequest: z.ZodType<EnterRequest> = z\n .object({ ticket: z.string().min(1).max(64) })\n .register(wireRegistry, { id: \"EnterRequest\", description: \"A frame ticket to exchange.\" });\n\n/** The answer to `EnterRequest`. */\nexport interface EnterResult {\n /** The frame session's secret, which the service worker sends as `X-Mostra-Frame`. */\n readonly session: string;\n /** The shell's origin: the only page the bootstrap reports to. */\n readonly shellOrigin: string;\n}\n\n/** The Zod schema of the `EnterResult` type. */\nexport const EnterResult: z.ZodType<EnterResult> = z\n .object({ session: z.string().min(1), shellOrigin: z.string().min(1) })\n .register(wireRegistry, {\n id: \"EnterResult\",\n description: \"A worker-mode frame session's secret and the shell's origin.\",\n });\n\n/**\n * `POST /_mostra/v/{rev}/ticket`: a single-use ticket that opens one event stream, long poll or\n * WebSocket of this session without it (`?ticket=`), so the request can bypass the service\n * worker (VERIFIED_FACTS: Firefox stalls on endless responses a worker passes on).\n */\nexport interface StreamTicketRequest {\n /** What it opens: `stream` (events and polls, the default) or `socket` (a WebSocket). */\n readonly purpose?: \"stream\" | \"socket\";\n}\n\n/** The Zod schema of the `StreamTicketRequest` type. */\nexport const StreamTicketRequest: z.ZodType<StreamTicketRequest> = z\n .object({ purpose: z.enum([\"stream\", \"socket\"]).exactOptional() })\n .register(wireRegistry, { id: \"StreamTicketRequest\" });\n\n/** The answer to a `StreamTicketRequest`. */\nexport interface StreamTicket {\n /** The ticket: 130 bits, single-use. */\n readonly ticket: string;\n /** When it stops working, 60 s after it was minted. */\n readonly expiresAt: string;\n}\n\n/** The Zod schema of the `StreamTicket` type. */\nexport const StreamTicket: z.ZodType<StreamTicket> = z\n .object({ ticket: z.string().min(1), expiresAt: z.iso.datetime() })\n .register(wireRegistry, {\n id: \"StreamTicket\",\n description: \"A single-use ticket for one stream, poll or WebSocket.\",\n });\n\n/**\n * `GET /_mostra/session` on the artifact's origin: the frame session's facts for same-origin code.\n */\nexport interface FrameSessionFacts {\n /** The CSRF token every mutation sends as `X-Mostra-CSRF`. */\n readonly csrf: string;\n /** The artifact the frame shows. */\n readonly artifactId: string;\n /** The shell's exact origin: the bridge's only peer. */\n readonly shellOrigin: string;\n /** The link's scopes. */\n readonly scopes: readonly string[];\n /** The viewer the page acts as (WP-07). */\n readonly viewer?: Viewer;\n /** The version the frame session entered. */\n readonly version?: VersionRef;\n /** How the frame authenticates (D70): absent means `cookie`. */\n readonly mode?: \"cookie\" | \"worker\";\n /**\n * `false` where event streams don't pass (a Cloudflare quick tunnel holds responses back until\n * they end): the page long-polls from the start (D47). Absent means streams pass.\n */\n readonly streams?: boolean;\n}\n\n/** The Zod schema of the `FrameSessionFacts` type. */\nexport const FrameSessionFacts: z.ZodType<FrameSessionFacts> = z\n .object({\n csrf: z.string().min(1),\n artifactId: ArtifactId.schema,\n shellOrigin: z.string().min(1),\n scopes: z.array(z.string()).readonly(),\n viewer: Viewer.exactOptional(),\n version: VersionRef.exactOptional(),\n mode: z.enum([\"cookie\", \"worker\"]).exactOptional(),\n streams: z.boolean().exactOptional(),\n })\n .register(wireRegistry, {\n id: \"FrameSessionFacts\",\n description: \"A frame session's CSRF token, shell origin, scopes, viewer, version and mode.\",\n });\n\n// ── The shell's own routes (WP-07, on the shell origin) ──────────────────────────────────\n\n/**\n * `POST /a/{artifactId}/_mostra/v/{rev}/submit`: the shell's trusted Submit (the `shell` channel,\n * D40). Only the shell's page can send it: the route takes the shell's session, its exact origin\n * and its CSRF token, none of which an artifact's page has.\n */\nexport interface ShellSubmitRequest {\n /** The view the shell's frame shows (D104); its version is what the submission names. */\n readonly viewId: string;\n /** The draft revision the viewer saw, after the frame flushed its saves. */\n readonly expectedRevision: DocumentRevision;\n}\n\n/** The Zod schema of the `ShellSubmitRequest` type. */\nexport const ShellSubmitRequest: z.ZodType<ShellSubmitRequest> = z\n .object({ viewId: ViewId.schema, expectedRevision: DocumentRevision })\n .register(wireRegistry, {\n id: \"ShellSubmitRequest\",\n description: \"The shell's trusted Submit: the view and the draft revision the viewer saw.\",\n });\n\n/**\n * `POST /a/{artifactId}/_mostra/v/{rev}/review/choose`: the shell's trusted Choose (D65, D113).\n * It writes the viewer's draft field `review.<reviewSetId>.choice` like any mutation, so a stale\n * base revision comes back as a conflict.\n */\nexport interface ChooseRequest {\n /** The view the shell's frame shows. */\n readonly viewId: string;\n /** A fresh `mut_` ID; a retry repeats it. */\n readonly mutationId: string;\n /** The draft revision the shell last saw. */\n readonly baseRevision: DocumentRevision;\n /** The review set. */\n readonly reviewSetId: string;\n /** The chosen candidate's ID. */\n readonly candidateId: string;\n /** The candidate's label, kept with the choice for results. */\n readonly label?: string;\n}\n\n/** The Zod schema of the `ChooseRequest` type. */\nexport const ChooseRequest: z.ZodType<ChooseRequest> = z\n .object({\n viewId: ViewId.schema,\n mutationId: MutationId.schema,\n baseRevision: DocumentRevision,\n reviewSetId: z.string().regex(REVIEW_SET_ID_PATTERN),\n candidateId: z.string().min(1).max(256),\n label: z.string().max(256).exactOptional(),\n })\n .register(wireRegistry, {\n id: \"ChooseRequest\",\n description:\n \"The shell's trusted Choose: the view, mutation, base revision, set and candidate.\",\n });\n\n/** `POST /a/{artifactId}/_mostra/v/{rev}/follow`: the viewer's \"Always follow this artifact\" (D63). */\nexport interface FollowRequest {\n /** `true` to load new versions automatically, `false` to stop. */\n readonly follow: boolean;\n}\n\n/** The Zod schema of the `FollowRequest` type. */\nexport const FollowRequest: z.ZodType<FollowRequest> = z\n .object({ follow: z.boolean() })\n .register(wireRegistry, {\n id: \"FollowRequest\",\n description: \"Whether the viewer follows the artifact's new versions.\",\n });\n\n/** A draft field a version doesn't cover (D42, D109): kept, shown read-only and delivered. */\nexport interface OrphanedField {\n /** The field's ID. */\n readonly id: string;\n /** Its label, when it has one. */\n readonly label?: string;\n /** Its value. */\n readonly value: unknown;\n /** The version whose view last wrote it. */\n readonly fromVersion: number;\n}\n\n/** The Zod schema of the `OrphanedField` type. */\nexport const OrphanedField: z.ZodType<OrphanedField> = z\n .object({\n id: z.string(),\n label: z.string().exactOptional(),\n value: z.unknown(),\n fromVersion: z.int().min(1),\n })\n .register(wireRegistry, {\n id: \"OrphanedField\",\n description: \"A draft field a version doesn't cover: its ID, label, value and source version.\",\n }) as z.ZodType<OrphanedField>;\n\n/**\n * `GET /a/{artifactId}/_mostra/v/{rev}/carry?version=<number>`: which of the viewer's answers a\n * version doesn't carry over (D42, D109). The banner counts them before a switch; the \"Not\n * carried over\" panel lists them for the version shown.\n */\nexport interface CarryOver {\n /** The version asked about. */\n readonly version: VersionRef;\n /** The viewer's draft fields the version doesn't cover. */\n readonly orphans: readonly OrphanedField[];\n}\n\n/** The Zod schema of the `CarryOver` type. */\nexport const CarryOver: z.ZodType<CarryOver> = z\n .object({ version: VersionRef, orphans: z.array(OrphanedField).readonly() })\n .register(wireRegistry, {\n id: \"CarryOver\",\n description: \"The viewer's answers a version doesn't carry over.\",\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,MAAa,6BAAsD,CAAC,YAAY;;AAGhF,MAAa,4BAA4B;;AAGzC,MAAa,2BAAmC;;AAiBhD,MAAa,gBAA0C,EACpD,OAAO;CACN,YAAY,WAAW;CACvB,OAAO,EAAE,KAAK,CAAC,UAAU,UAAU,CAAC;CACpC,cAAc;CACd,QAAQ,OAAO;CACf,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,C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AAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAC/B,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;AAeH,MAAa,gBAA0C,EACpD,OAAO;CACN,IAAI,EAAE,OAAO;CACb,OAAO,EAAE,OAAO,CAAC,CAAC,cAAc;CAChC,OAAO,EAAE,QAAQ;CACjB,aAAa,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;AAC5B,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;AAeH,MAAa,YAAkC,EAC5C,OAAO;CAAE,SAAS;CAAY,SAAS,EAAE,MAAM,aAAa,CAAC,CAAC,SAAS;AAAE,CAAC,CAAC,CAC3E,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC"}
1
+ {"version":3,"file":"browser.js","names":[],"sources":["../src/browser.ts"],"sourcesContent":["/**\n * The browser protocol (INTERFACES §4, D106): what the client runtime in an artifact's frame sends\n * to the gateway and receives from it. Published versions embed the client runtime, so a gateway\n * serves every revision it ever shipped (FAILURE_MODEL §7); within a revision payloads only grow.\n * Paths are `/_mostra/v/{revision}/…` on the artifact's origin.\n *\n * ```ts\n * const body: FieldsRequest = { mutationId, scope: \"viewer\", baseRevision: \"3\", viewId, ops };\n * await fetch(`/_mostra/v/${BROWSER_PROTOCOL_REVISION}/fields`, { method: \"POST\", body: … });\n * ```\n */\nimport * as z from \"zod\";\nimport type { EphemeralMessage } from \"./actions.ts\";\nimport { ArtifactId, Cursor, MutationId, ViewId } from \"./ids.ts\";\nimport {\n DocumentRevision,\n EventRecord,\n FieldOp,\n FieldState,\n SubmissionSummary,\n Viewer,\n} from \"./interaction.ts\";\nimport { SubmissionPolicy } from \"./manifest.ts\";\nimport {\n REVIEW_SET_ID_PATTERN,\n SubmitChannel,\n TrustedControl,\n VersionRef,\n type ViewContext,\n} from \"./view.ts\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\nexport {\n type DeliveryTarget,\n REVIEW_SET_ID_PATTERN,\n readViewContext,\n VersionRef,\n ViewContext,\n ViewContextWire,\n} from \"./view.ts\";\n\n/** Every browser-protocol revision this release serves, oldest first. */\nexport const BROWSER_PROTOCOL_REVISIONS: readonly [\"2026-10-15\"] = [\"2026-10-15\"];\n\n/** The newest browser-protocol revision: what a client runtime built now speaks. */\nexport const BROWSER_PROTOCOL_REVISION = \"2026-10-15\";\n\n/** The longest JSON a signal's payload may be, in UTF-8 bytes (D106). */\nexport const SIGNAL_PAYLOAD_MAX_BYTES: number = 64 * 1024;\n\n/** `POST …/fields`: one mutation of the viewer's draft or the artifact's state. */\nexport interface FieldsRequest {\n /** A fresh `mut_` ID per change; a retry repeats it and gets the recorded result. */\n readonly mutationId: string;\n /** Which document: the viewer's draft or the artifact's shared state. */\n readonly scope: \"viewer\" | \"artifact\";\n /** The document revision the page last saw; fields changed after it come back as conflicts. */\n readonly baseRevision: DocumentRevision;\n /** The view the page was opened as (D104). */\n readonly viewId: string;\n /** The field changes, applied together under one revision. */\n readonly ops: readonly FieldOp[];\n}\n\n/** The Zod schema of the `FieldsRequest` type. */\nexport const FieldsRequest: z.ZodType<FieldsRequest> = z\n .object({\n mutationId: MutationId.schema,\n scope: z.enum([\"viewer\", \"artifact\"]),\n baseRevision: DocumentRevision,\n viewId: ViewId.schema,\n ops: z.array(FieldOp).min(1).max(1000).readonly(),\n })\n .register(wireRegistry, {\n id: \"FieldsRequest\",\n description: \"A browser mutation: its ID, scope, base revision, view and field ops.\",\n });\n\n/** `POST …/submit`: submit the viewer's draft from the artifact's own code (D40). */\nexport interface SubmitRequest {\n /** The view the page was opened as (D104); its version is what the submission names. */\n readonly viewId: string;\n /** The draft revision the viewer saw; another one is `MOSTRA_SUBMIT_REVISION_MOVED`. */\n readonly expectedRevision: DocumentRevision;\n /** Always `artifact` on this route; the shell's trusted Submit is the `shell` channel (D40). */\n readonly channel: \"artifact\";\n}\n\n/** The Zod schema of the `SubmitRequest` type. */\nexport const SubmitRequest: z.ZodType<SubmitRequest> = z\n .object({\n viewId: ViewId.schema,\n expectedRevision: DocumentRevision,\n channel: z.literal(\"artifact\"),\n })\n .register(wireRegistry, {\n id: \"SubmitRequest\",\n description: \"A browser submit: the view and the draft revision the viewer saw.\",\n });\n\n/** `POST …/signal`: raise a named signal for the host's attention (IN-09). */\nexport interface SignalRequest {\n /** The view the page was opened as (D104). */\n readonly viewId: string;\n /** Letters, digits, `.`, `_` and `-`; `submit` is reserved. */\n readonly name: string;\n /** Any JSON, at most 64 KiB. */\n readonly payload?: unknown;\n}\n\n/** The Zod schema of the `SignalRequest` type. */\nexport const SignalRequest: z.ZodType<SignalRequest> = z\n .object({\n viewId: ViewId.schema,\n name: z.string().min(1).max(64),\n payload: z.unknown().exactOptional(),\n })\n .register(wireRegistry, {\n id: \"SignalRequest\",\n description: \"A browser signal: the view, the signal's name and an optional JSON payload.\",\n }) as z.ZodType<SignalRequest>;\n\n/** A document as the page loads it: its revision and fields. */\nexport interface DocumentSnapshot {\n /** The document's revision. */\n readonly revision: DocumentRevision;\n /** The draft's epoch (D103); 1 for artifact state. */\n readonly epoch: number;\n /** Every field by ID. */\n readonly fields: Readonly<Record<string, FieldState>>;\n}\n\n/** The Zod schema of the `DocumentSnapshot` type. */\nexport const DocumentSnapshot: z.ZodType<DocumentSnapshot> = z\n .object({\n revision: DocumentRevision,\n epoch: z.int().min(1),\n fields: z.record(z.string(), FieldState),\n })\n .register(wireRegistry, {\n id: \"DocumentSnapshot\",\n description: \"A document's revision, epoch and fields, as a page loads it.\",\n });\n\n/**\n * The first message of a browser event stream, and a poll's `snapshot`: where the page stands,\n * so it renders the canonical draft and state before applying events after `cursor`.\n */\nexport interface StreamSnapshot {\n /** Events after this cursor follow. */\n readonly cursor: string;\n /** Who the page acts as. */\n readonly viewer: Viewer;\n /** The viewer's draft. */\n readonly draft: DocumentSnapshot;\n /** The artifact's shared state. */\n readonly state: DocumentSnapshot;\n /** The submission that closed this draft, or this viewer's latest under `epochs`. */\n readonly submission?: SubmissionSummary;\n /**\n * The artifact's latest version when the snapshot was read (WP-07): a reader that missed its\n * `version.published` event (published between a frame ticket and the stream, or compacted)\n * still learns of it.\n */\n readonly latest?: VersionRef;\n}\n\n/** The Zod schema of the `StreamSnapshot` type. */\nexport const StreamSnapshot: z.ZodType<StreamSnapshot> = z\n .object({\n cursor: Cursor.schema,\n viewer: Viewer,\n draft: DocumentSnapshot,\n state: DocumentSnapshot,\n submission: SubmissionSummary.exactOptional(),\n latest: VersionRef.exactOptional(),\n })\n .register(wireRegistry, {\n id: \"StreamSnapshot\",\n description: \"Where a page stands: cursor, viewer, draft, artifact state and its submission.\",\n });\n\n/** `GET …/events/poll`: the long-poll answer on the same cursor as the stream (D47). */\nexport interface PollResult {\n /** Where the next poll continues. */\n readonly cursor: string;\n /** The events for this page after the cursor asked for, in order. */\n readonly events: readonly EventRecord[];\n /** Present when the poll asked for none or its cursor was compacted away. */\n readonly snapshot?: StreamSnapshot;\n /**\n * Run and live updates for this view since its last poll (WP-08): lossy and never stored as\n * events, the long-poll's counterpart of the stream's `run` and `live` messages.\n */\n readonly ephemeral?: readonly EphemeralMessage[];\n}\n\n/** The Zod schema of the `PollResult` type. */\nexport const PollResult: z.ZodType<PollResult> = z\n .object({\n cursor: Cursor.schema,\n events: z.array(EventRecord).readonly(),\n snapshot: StreamSnapshot.exactOptional(),\n ephemeral: z.array(z.record(z.string(), z.unknown())).readonly().exactOptional(),\n })\n .register(wireRegistry, {\n id: \"PollResult\",\n description: \"A long-poll answer: the cursor, the events after the asked one, and a snapshot.\",\n }) as unknown as z.ZodType<PollResult>;\n\n/**\n * `POST /a/{artifactId}/_mostra/ticket`'s answer on the shell origin: a single-use frame ticket,\n * the view it opens and what the shell needs to render the view's trusted controls (D104, D108).\n */\nexport interface FrameTicket extends ViewContext {\n /** The frame's entry URL, carrying the single-use ticket. */\n readonly src: string;\n /** The artifact's origin: the only origin the bridge accepts messages from. */\n readonly artifactOrigin: string;\n /** Whether this viewer follows the artifact's new versions (D63). */\n readonly follow: boolean;\n /** Whether the link opens this version only (D97 item 9): then the shell offers no newer one. */\n readonly pinned: boolean;\n /**\n * The version's server code keeps crashing and is parked (WP-08, FAILURE_MODEL §2): the shell\n * says so, since the page's actions and live data won't work until a new publish.\n */\n readonly serverParked?: true;\n /**\n * The frame shows `mostra dev`'s development preview of unpublished source (D140 item 12): the\n * shell says so, and it is never a published version.\n */\n readonly devPreview?: true;\n /**\n * `worker` when the shell and the artifact are two sites (a Cloudflare quick tunnel, a host's\n * addresses on two hosts): the frame enters through the bootstrap page and a service worker\n * (D70, D158 item 5). Absent: cookie mode.\n */\n readonly mode?: \"worker\";\n /**\n * The artifact is paused (D165 item 14): the shell says so, by whom and why (the reason as text);\n * it takes no submissions and runs no actions until it is resumed (WP-30).\n */\n readonly paused?: { readonly by: \"owner\" | \"operator\"; readonly reason?: string };\n /** On a remote server: what the hosted shell's trusted chrome shows around the page (D161). */\n readonly hosted?: HostedChrome;\n}\n\n/**\n * The hosted shell's trusted chrome for one view (D161, ARCHITECTURE §15.8; WP-30). Every string an\n * owner or operator supplies is rendered as text, never as markup.\n */\nexport interface HostedChrome {\n /** Who sent the page: the owner's display name, and the provider that verified it, if any. */\n readonly sender?: { readonly name: string; readonly verifiedBy?: string };\n /** Who this browser is to the page: signed in as an account, or anonymous (with a chosen name). */\n readonly viewer: {\n readonly kind: \"account\" | \"anonymous\" | \"named\";\n readonly name?: string;\n readonly verified: boolean;\n };\n /** Whether \"Sign in\" is offered (the viewer isn't signed in, and the server has a provider). */\n readonly signIn: boolean;\n /** The operator's footer wording in place of the shell's own; never hidden on a public link. */\n readonly footer?: string;\n /** The operator's line after \"Your answer was sent.\". */\n readonly afterSubmit?: string;\n /** The made-with mark, where the operator shows one. */\n readonly madeWith?: { readonly href?: string };\n /** A page shown before the artifact, once per browser and link. */\n readonly interstitial?: { readonly kind: string; readonly message?: string };\n}\n\nconst HostedChrome: z.ZodType<HostedChrome> = z.object({\n sender: z\n .object({ name: z.string().max(256), verifiedBy: z.string().max(64).exactOptional() })\n .exactOptional(),\n viewer: z.object({\n kind: z.enum([\"account\", \"anonymous\", \"named\"]),\n name: z.string().max(256).exactOptional(),\n verified: z.boolean(),\n }),\n signIn: z.boolean(),\n footer: z.string().max(500).exactOptional(),\n afterSubmit: z.string().max(500).exactOptional(),\n madeWith: z\n .object({\n href: z\n .url({ protocol: /^https$/ })\n .max(2_048)\n .exactOptional(),\n })\n .exactOptional(),\n interstitial: z\n .object({ kind: z.string().max(64), message: z.string().max(2_000).exactOptional() })\n .exactOptional(),\n});\n\n/** The Zod schema of the `FrameTicket` type. */\nexport const FrameTicket: z.ZodType<FrameTicket> = z\n .object({\n artifactId: ArtifactId.schema,\n viewId: ViewId.schema,\n version: VersionRef,\n latest: VersionRef,\n policy: SubmissionPolicy,\n submitChannels: z.array(SubmitChannel).min(1).max(2).readonly(),\n controls: z.array(TrustedControl).max(32).readonly(),\n target: z.enum([\"live\", \"static\", \"mcp-app\", \"verify\"]),\n src: z.string().min(1),\n artifactOrigin: z.string().min(1),\n follow: z.boolean(),\n pinned: z.boolean(),\n serverParked: z.literal(true).exactOptional(),\n devPreview: z.literal(true).exactOptional(),\n mode: z.literal(\"worker\").exactOptional(),\n paused: z\n .object({\n by: z.enum([\"owner\", \"operator\"]),\n reason: z.string().max(500).exactOptional(),\n })\n .exactOptional(),\n hosted: HostedChrome.exactOptional(),\n })\n .register(wireRegistry, {\n id: \"FrameTicket\",\n description: \"A frame ticket: the view it opens, where to load it, and the view's controls.\",\n });\n\n// ── Frame sessions in worker mode (WP-13, D70, D158 item 5) ───────────────────────────────\n\n/**\n * The header Mostra's service worker adds to every same-origin request of a worker-mode frame:\n * its frame session's secret, which no cookie can carry across sites.\n */\nexport const FRAME_SESSION_HEADER = \"x-mostra-frame\";\n\n/**\n * The header a hosted shell sends its session's secret in (INTERFACES §18.4, D165 item 8): no\n * cookie is ever set or read on a hosted host, so no tenant page can toss, shadow or crowd one out.\n */\nexport const SHELL_SESSION_HEADER = \"x-mostra-shell\";\n\n/**\n * `POST /_mostra/enter` on the artifact's origin: the bootstrap page exchanges the shell's\n * single-use frame ticket, from `/_mostra/enter#t=…`, for a worker-mode frame session.\n */\nexport interface EnterRequest {\n /** The frame ticket. */\n readonly ticket: string;\n}\n\n/** The Zod schema of the `EnterRequest` type. */\nexport const EnterRequest: z.ZodType<EnterRequest> = z\n .object({ ticket: z.string().min(1).max(64) })\n .register(wireRegistry, { id: \"EnterRequest\", description: \"A frame ticket to exchange.\" });\n\n/** The answer to `EnterRequest`. */\nexport interface EnterResult {\n /** The frame session's secret, which the service worker sends as `X-Mostra-Frame`. */\n readonly session: string;\n /** The shell's origin: the only page the bootstrap reports to. */\n readonly shellOrigin: string;\n}\n\n/** The Zod schema of the `EnterResult` type. */\nexport const EnterResult: z.ZodType<EnterResult> = z\n .object({ session: z.string().min(1), shellOrigin: z.string().min(1) })\n .register(wireRegistry, {\n id: \"EnterResult\",\n description: \"A worker-mode frame session's secret and the shell's origin.\",\n });\n\n/**\n * `POST /_mostra/v/{rev}/ticket`: a single-use ticket that opens one event stream, long poll or\n * WebSocket of this session without it (`?ticket=`), so the request can bypass the service\n * worker (VERIFIED_FACTS: Firefox stalls on endless responses a worker passes on).\n */\nexport interface StreamTicketRequest {\n /** What it opens: `stream` (events and polls, the default) or `socket` (a WebSocket). */\n readonly purpose?: \"stream\" | \"socket\";\n}\n\n/** The Zod schema of the `StreamTicketRequest` type. */\nexport const StreamTicketRequest: z.ZodType<StreamTicketRequest> = z\n .object({ purpose: z.enum([\"stream\", \"socket\"]).exactOptional() })\n .register(wireRegistry, { id: \"StreamTicketRequest\" });\n\n/** The answer to a `StreamTicketRequest`. */\nexport interface StreamTicket {\n /** The ticket: 130 bits, single-use. */\n readonly ticket: string;\n /** When it stops working, 60 s after it was minted. */\n readonly expiresAt: string;\n}\n\n/** The Zod schema of the `StreamTicket` type. */\nexport const StreamTicket: z.ZodType<StreamTicket> = z\n .object({ ticket: z.string().min(1), expiresAt: z.iso.datetime() })\n .register(wireRegistry, {\n id: \"StreamTicket\",\n description: \"A single-use ticket for one stream, poll or WebSocket.\",\n });\n\n/**\n * `GET /_mostra/session` on the artifact's origin: the frame session's facts for same-origin code.\n */\nexport interface FrameSessionFacts {\n /** The CSRF token every mutation sends as `X-Mostra-CSRF`. */\n readonly csrf: string;\n /** The artifact the frame shows. */\n readonly artifactId: string;\n /** The shell's exact origin: the bridge's only peer. */\n readonly shellOrigin: string;\n /** The link's scopes. */\n readonly scopes: readonly string[];\n /** The viewer the page acts as (WP-07). */\n readonly viewer?: Viewer;\n /** The version the frame session entered. */\n readonly version?: VersionRef;\n /** How the frame authenticates (D70): absent means `cookie`. */\n readonly mode?: \"cookie\" | \"worker\";\n /**\n * `false` where event streams don't pass (a Cloudflare quick tunnel holds responses back until\n * they end): the page long-polls from the start (D47). Absent means streams pass.\n */\n readonly streams?: boolean;\n}\n\n/** The Zod schema of the `FrameSessionFacts` type. */\nexport const FrameSessionFacts: z.ZodType<FrameSessionFacts> = z\n .object({\n csrf: z.string().min(1),\n artifactId: ArtifactId.schema,\n shellOrigin: z.string().min(1),\n scopes: z.array(z.string()).readonly(),\n viewer: Viewer.exactOptional(),\n version: VersionRef.exactOptional(),\n mode: z.enum([\"cookie\", \"worker\"]).exactOptional(),\n streams: z.boolean().exactOptional(),\n })\n .register(wireRegistry, {\n id: \"FrameSessionFacts\",\n description: \"A frame session's CSRF token, shell origin, scopes, viewer, version and mode.\",\n });\n\n// ── The shell's own routes (WP-07, on the shell origin) ──────────────────────────────────\n\n/**\n * `POST /a/{artifactId}/_mostra/v/{rev}/submit`: the shell's trusted Submit (the `shell` channel,\n * D40). Only the shell's page can send it: the route takes the shell's session, its exact origin\n * and its CSRF token, none of which an artifact's page has.\n */\nexport interface ShellSubmitRequest {\n /** The view the shell's frame shows (D104); its version is what the submission names. */\n readonly viewId: string;\n /** The draft revision the viewer saw, after the frame flushed its saves. */\n readonly expectedRevision: DocumentRevision;\n}\n\n/** The Zod schema of the `ShellSubmitRequest` type. */\nexport const ShellSubmitRequest: z.ZodType<ShellSubmitRequest> = z\n .object({ viewId: ViewId.schema, expectedRevision: DocumentRevision })\n .register(wireRegistry, {\n id: \"ShellSubmitRequest\",\n description: \"The shell's trusted Submit: the view and the draft revision the viewer saw.\",\n });\n\n/**\n * `POST /a/{artifactId}/_mostra/v/{rev}/review/choose`: the shell's trusted Choose (D65, D113).\n * It writes the viewer's draft field `review.<reviewSetId>.choice` like any mutation, so a stale\n * base revision comes back as a conflict.\n */\nexport interface ChooseRequest {\n /** The view the shell's frame shows. */\n readonly viewId: string;\n /** A fresh `mut_` ID; a retry repeats it. */\n readonly mutationId: string;\n /** The draft revision the shell last saw. */\n readonly baseRevision: DocumentRevision;\n /** The review set. */\n readonly reviewSetId: string;\n /** The chosen candidate's ID. */\n readonly candidateId: string;\n /** The candidate's label, kept with the choice for results. */\n readonly label?: string;\n}\n\n/** The Zod schema of the `ChooseRequest` type. */\nexport const ChooseRequest: z.ZodType<ChooseRequest> = z\n .object({\n viewId: ViewId.schema,\n mutationId: MutationId.schema,\n baseRevision: DocumentRevision,\n reviewSetId: z.string().regex(REVIEW_SET_ID_PATTERN),\n candidateId: z.string().min(1).max(256),\n label: z.string().max(256).exactOptional(),\n })\n .register(wireRegistry, {\n id: \"ChooseRequest\",\n description:\n \"The shell's trusted Choose: the view, mutation, base revision, set and candidate.\",\n });\n\n/** `POST /a/{artifactId}/_mostra/v/{rev}/follow`: the viewer's \"Always follow this artifact\" (D63). */\nexport interface FollowRequest {\n /** `true` to load new versions automatically, `false` to stop. */\n readonly follow: boolean;\n}\n\n/** The Zod schema of the `FollowRequest` type. */\nexport const FollowRequest: z.ZodType<FollowRequest> = z\n .object({ follow: z.boolean() })\n .register(wireRegistry, {\n id: \"FollowRequest\",\n description: \"Whether the viewer follows the artifact's new versions.\",\n });\n\n/** A draft field a version doesn't cover (D42, D109): kept, shown read-only and delivered. */\nexport interface OrphanedField {\n /** The field's ID. */\n readonly id: string;\n /** Its label, when it has one. */\n readonly label?: string;\n /** Its value. */\n readonly value: unknown;\n /** The version whose view last wrote it. */\n readonly fromVersion: number;\n}\n\n/** The Zod schema of the `OrphanedField` type. */\nexport const OrphanedField: z.ZodType<OrphanedField> = z\n .object({\n id: z.string(),\n label: z.string().exactOptional(),\n value: z.unknown(),\n fromVersion: z.int().min(1),\n })\n .register(wireRegistry, {\n id: \"OrphanedField\",\n description: \"A draft field a version doesn't cover: its ID, label, value and source version.\",\n }) as z.ZodType<OrphanedField>;\n\n/**\n * `GET /a/{artifactId}/_mostra/v/{rev}/carry?version=<number>`: which of the viewer's answers a\n * version doesn't carry over (D42, D109). The banner counts them before a switch; the \"Not\n * carried over\" panel lists them for the version shown.\n */\nexport interface CarryOver {\n /** The version asked about. */\n readonly version: VersionRef;\n /** The viewer's draft fields the version doesn't cover. */\n readonly orphans: readonly OrphanedField[];\n}\n\n/** The Zod schema of the `CarryOver` type. */\nexport const CarryOver: z.ZodType<CarryOver> = z\n .object({ version: VersionRef, orphans: z.array(OrphanedField).readonly() })\n .register(wireRegistry, {\n id: \"CarryOver\",\n description: \"The viewer's answers a version doesn't carry over.\",\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,MAAa,6BAAsD,CAAC,YAAY;;AAGhF,MAAa,4BAA4B;;AAGzC,MAAa,2BAAmC;;AAiBhD,MAAa,gBAA0C,EACpD,OAAO;CACN,YAAY,WAAW;CACvB,OAAO,EAAE,KAAK,CAAC,UAAU,UAAU,CAAC;CACpC,cAAc;CACd,QAAQ,OAAO;CACf,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS;AAClD,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;AAaH,MAAa,gBAA0C,EACpD,OAAO;CACN,QAAQ,OAAO;CACf,kBAAkB;CAClB,SAAS,EAAE,QAAQ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AO;CAAE,SAAS;CAAY,SAAS,EAAE,MAAM,aAAa,CAAC,CAAC,SAAS;AAAE,CAAC,CAAC,CAC3E,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC"}
@@ -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;;YAcD,+BAA+B"}
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/remote.d.ts
3
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"];
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
5
  /** The codes of the REMOTE area. */
6
6
  export type RemoteDiagnosticCode = (typeof remoteDiagnosticCodes)[number];
7
7
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","names":[],"sources":["../../../src/diagnostics/codes/remote.ts"],"mappings":";;;qBAMa;;YAaD,+BAA+B"}
1
+ {"version":3,"file":"remote.d.ts","names":[],"sources":["../../../src/diagnostics/codes/remote.ts"],"mappings":";;;qBAMa;;YAoBD,+BAA+B"}
@@ -8,7 +8,14 @@ const remoteDiagnosticCodes = [
8
8
  "MOSTRA_REMOTE_QUEUE_FULL",
9
9
  "MOSTRA_REMOTE_NOT_OWNER_INSTANCE",
10
10
  "MOSTRA_REMOTE_SIGN_IN_REQUIRED",
11
- "MOSTRA_REMOTE_RATE_LIMITED"
11
+ "MOSTRA_REMOTE_RATE_LIMITED",
12
+ "MOSTRA_REMOTE_PAUSED_BY_OPERATOR",
13
+ "MOSTRA_REMOTE_LIMIT_REACHED",
14
+ "MOSTRA_REMOTE_OPERATOR_UNAVAILABLE",
15
+ "MOSTRA_REMOTE_NO_INSTANCE",
16
+ "MOSTRA_REMOTE_UNDER_REVIEW",
17
+ "MOSTRA_REMOTE_HOME_SUSPENDED",
18
+ "MOSTRA_REMOTE_HOME_MOVING"
12
19
  ];
13
20
  /** The REMOTE area's catalog entries. */
14
21
  const remoteDiagnostics = {
@@ -91,6 +98,76 @@ const remoteDiagnostics = {
91
98
  explanation: "Too many requests of this kind came through one link or one address in a short time, past the server's `rateLimits`. Nothing was recorded, and a draft stays as it was.",
92
99
  fix: "Wait for the `Retry-After` the answer carries and try again. The limits are the server's `rateLimits` settings."
93
100
  }
101
+ },
102
+ MOSTRA_REMOTE_PAUSED_BY_OPERATOR: {
103
+ severity: "error",
104
+ phase: "host",
105
+ title: "Paused by the server's operator",
106
+ hint: "Contact the server's operator: only the operator resumes a pause it made.",
107
+ docs: {
108
+ explanation: "The server's operator paused this hosted artifact, and an owner can't undo an operator's pause (D165 item 14). Views keep working and the links stay valid.",
109
+ fix: "Ask the server's operator why it was paused and to resume it."
110
+ }
111
+ },
112
+ MOSTRA_REMOTE_LIMIT_REACHED: {
113
+ severity: "error",
114
+ phase: "host",
115
+ title: "The server's limit refused this",
116
+ hint: "Read the message for the server's limit, and try again once it allows the operation.",
117
+ docs: {
118
+ explanation: "The server's operator refused the operation for this account (its `limits` port): a share, a version push, a link, a view, a submission, an action or an MCP call. The message is the operator's own. A refused submission keeps its draft.",
119
+ fix: "Follow the operator's message; its `Retry-After`, when present, says when to try again."
120
+ }
121
+ },
122
+ MOSTRA_REMOTE_OPERATOR_UNAVAILABLE: {
123
+ severity: "error",
124
+ phase: "host",
125
+ title: "The server's operator didn't answer",
126
+ hint: "Try again in a moment; the server's operator didn't answer in time.",
127
+ docs: {
128
+ explanation: "The server's operator module didn't answer in time (2 s for limits, 5 s for sign-in), so an operation that creates something (a share, a push, a link, authoring, a sign-in) was refused rather than allowed blind. Views, drafts and submissions never wait for it, and existing sessions keep working.",
129
+ fix: "Try again; if it lasts, the server's operator has to fix its operator module."
130
+ }
131
+ },
132
+ MOSTRA_REMOTE_NO_INSTANCE: {
133
+ severity: "error",
134
+ phase: "host",
135
+ title: "No owner instance connected",
136
+ hint: "Start Mostra on the machine linked to this account (mostra daemon start), then try again.",
137
+ docs: {
138
+ explanation: "Creating, verifying and publishing from a chat host run on the account's default owner instance, through the relay (D165 item 5), and no default instance is connected to the server now. Reading tools (list, wait, results, state, docs, open) keep working.",
139
+ fix: "Start Mostra on the linked machine (`mostra daemon start`, or `mostra daemon install` to keep it running); link a machine first with `mostra login <server> --default`."
140
+ }
141
+ },
142
+ MOSTRA_REMOTE_UNDER_REVIEW: {
143
+ severity: "error",
144
+ phase: "host",
145
+ title: "This page is under review",
146
+ hint: "Nothing to do here: the server's operator is reviewing this page.",
147
+ docs: {
148
+ explanation: "The server's operator quarantined this hosted page, or this version of it, while it reviews it. Its data is kept; the page shows a neutral notice instead of its content until the operator releases it.",
149
+ fix: "The owner can ask the server's operator about the review."
150
+ }
151
+ },
152
+ MOSTRA_REMOTE_HOME_SUSPENDED: {
153
+ severity: "error",
154
+ phase: "host",
155
+ title: "This account's pages are suspended",
156
+ hint: "Contact the server's operator: this account's pages are suspended.",
157
+ docs: {
158
+ explanation: "The server's operator suspended this account's hosted home: its pages, its owner instances' bindings, pushes and links are refused until the operator resumes it. Nothing was deleted.",
159
+ fix: "Ask the server's operator to resume the account."
160
+ }
161
+ },
162
+ MOSTRA_REMOTE_HOME_MOVING: {
163
+ severity: "error",
164
+ phase: "host",
165
+ title: "This account's pages are moving",
166
+ hint: "Try again in a minute: this account's pages are moving between machines.",
167
+ docs: {
168
+ explanation: "The server's operator is moving this account's hosted home to another data directory (`drainHome`), so the home is closed here until it serves again. Clients retry; nothing is lost.",
169
+ fix: "Retry shortly; the move ends when the operator releases the home on its new machine."
170
+ }
94
171
  }
95
172
  };
96
173
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"remote.js","names":[],"sources":["../../../src/diagnostics/codes/remote.ts"],"sourcesContent":["/**\n * Diagnostic codes of the REMOTE area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the REMOTE area, in the order they were added. */\nexport const remoteDiagnosticCodes = [\n \"MOSTRA_REMOTE_CONFIG_INVALID\",\n \"MOSTRA_REMOTE_LOGIN_FAILED\",\n \"MOSTRA_REMOTE_UNREACHABLE\",\n \"MOSTRA_REMOTE_OWNER_OFFLINE\",\n \"MOSTRA_REMOTE_QUEUE_FULL\",\n \"MOSTRA_REMOTE_NOT_OWNER_INSTANCE\",\n \"MOSTRA_REMOTE_SIGN_IN_REQUIRED\",\n \"MOSTRA_REMOTE_RATE_LIMITED\",\n // gen:codes\n] as const;\n\n/** The codes of the REMOTE area. */\nexport type RemoteDiagnosticCode = (typeof remoteDiagnosticCodes)[number];\n\n/** The REMOTE area's catalog entries. */\nexport const remoteDiagnostics: AreaCatalog<RemoteDiagnosticCode> = {\n MOSTRA_REMOTE_CONFIG_INVALID: {\n severity: \"error\",\n phase: \"host\",\n title: \"Remote server configuration can't be used\",\n hint: \"Fix the configuration key the message names, then start mostra-runtime server again.\",\n docs: {\n explanation:\n \"`mostra-runtime server` reads its configuration (the file `--config` names and `MOSTRA_SERVER_*` variables) before it serves anything, and stops when a key is missing, of the wrong type or out of range, naming the key. Nothing was served.\",\n fix: \"Correct the key the message names: `apiOrigin` must be an `https:` origin (or `http:` on loopback), and `domains.active` a host name.\",\n },\n },\n MOSTRA_REMOTE_LOGIN_FAILED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Signing in to a remote server failed\",\n hint: \"Run mostra login again, and approve the code on the server's page within ten minutes.\",\n docs: {\n explanation:\n \"Signing this home in to a remote server didn't finish: the code expired, the person refused it, the server refused the client, or the binding's access token was refused (revoked, expired, or for another server). Nothing of the home changed; artifacts it owns on that server stay its own.\",\n fix: \"Sign in to the server again and approve the code on the page it names. A refusal you didn't expect means the sign-in was revoked on the server.\",\n },\n },\n MOSTRA_REMOTE_UNREACHABLE: {\n severity: \"error\",\n phase: \"host\",\n title: \"The remote server can't be reached\",\n hint: \"Check the network and the server's address, then try again; mostra status shows the link.\",\n docs: {\n explanation:\n \"The owner instance couldn't reach the remote server that holds this hosted artifact, so a write that must go there (its artifact state, a live value) was refused, never applied locally alone (D165 item 1). Nothing was lost: a page's edit stays in its journal and is sent again.\",\n fix: \"Run `mostra status` to see each server's link. When the server is back the link reconnects by itself; then write again.\",\n },\n },\n MOSTRA_REMOTE_OWNER_OFFLINE: {\n severity: \"error\",\n phase: \"host\",\n title: \"The artifact's owner instance is offline\",\n hint: \"Start Mostra on the machine that shared the page, or try again once it is back.\",\n docs: {\n explanation:\n \"A hosted page called server code its owner instance runs, and the owner instance isn't connected. A plain call isn't kept, so it is refused at once; an action run waits or fails as the artifact's `hosted.offline` says.\",\n fix: 'Start Mostra on the owner\\'s machine (`mostra daemon start`, or `mostra daemon install` for always-on). An action that must work while the owner is away should be an action run with `hosted.offline.actions: \"queue\"`.',\n },\n },\n MOSTRA_REMOTE_QUEUE_FULL: {\n severity: \"error\",\n phase: \"host\",\n title: \"Too many runs wait for the owner\",\n hint: \"Wait for the owner to come back and work through its queue, then press again.\",\n docs: {\n explanation:\n \"The artifact's owner instance is offline and as many runs as the server allows already wait for it, so this one was refused before anything was recorded. Runs already waiting keep their place.\",\n fix: \"Bring the owner instance back online: waiting runs then go out in the order they were made. The cap is the server's `relay.waitingRunsPerArtifact` setting.\",\n },\n },\n MOSTRA_REMOTE_NOT_OWNER_INSTANCE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Another instance owns this hosted artifact\",\n hint: \"Share or push this artifact from its owner instance, named in the message.\",\n docs: {\n explanation:\n \"A hosted artifact has one owner instance: the one that shared it. It alone receives the artifact's submissions, relayed runs and authoring, and only it pushes versions of it (D165 item 1b). Another instance of the same account reads and waits through the hosted home.\",\n fix: \"Run the command on the instance the message names. Moving an artifact to another owner instance isn't part of this release.\",\n },\n },\n MOSTRA_REMOTE_SIGN_IN_REQUIRED: {\n severity: \"error\",\n phase: \"host\",\n title: \"This action needs a signed-in viewer\",\n hint: \"Sign in from the page's chrome, or have the owner allow this for anyone with the link.\",\n docs: {\n explanation:\n \"On a hosted link, an action that runs on the owner's machine, or a submission when the artifact asks for it, needs a viewer signed in (D159, D165 item 13). Nothing was recorded.\",\n fix: 'Sign in with the page\\'s Sign in. An owner who wants anyone with the link to run actions sets `hosted: { actions: \"link\" }` in the manifest (and `submissions: \"link\"` for answers).',\n },\n },\n MOSTRA_REMOTE_RATE_LIMITED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Too many requests on this link\",\n hint: \"Try again after the time the answer's Retry-After gives.\",\n docs: {\n explanation:\n \"Too many requests of this kind came through one link or one address in a short time, past the server's `rateLimits`. Nothing was recorded, and a draft stays as it was.\",\n fix: \"Wait for the `Retry-After` the answer carries and try again. The limits are the server's `rateLimits` settings.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,wBAAwB;CACnC;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,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,6BAA6B;EAC3B,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,kCAAkC;EAChC,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":"remote.js","names":[],"sources":["../../../src/diagnostics/codes/remote.ts"],"sourcesContent":["/**\n * Diagnostic codes of the REMOTE area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the REMOTE area, in the order they were added. */\nexport const remoteDiagnosticCodes = [\n \"MOSTRA_REMOTE_CONFIG_INVALID\",\n \"MOSTRA_REMOTE_LOGIN_FAILED\",\n \"MOSTRA_REMOTE_UNREACHABLE\",\n \"MOSTRA_REMOTE_OWNER_OFFLINE\",\n \"MOSTRA_REMOTE_QUEUE_FULL\",\n \"MOSTRA_REMOTE_NOT_OWNER_INSTANCE\",\n \"MOSTRA_REMOTE_SIGN_IN_REQUIRED\",\n \"MOSTRA_REMOTE_RATE_LIMITED\",\n \"MOSTRA_REMOTE_PAUSED_BY_OPERATOR\",\n \"MOSTRA_REMOTE_LIMIT_REACHED\",\n \"MOSTRA_REMOTE_OPERATOR_UNAVAILABLE\",\n \"MOSTRA_REMOTE_NO_INSTANCE\",\n \"MOSTRA_REMOTE_UNDER_REVIEW\",\n \"MOSTRA_REMOTE_HOME_SUSPENDED\",\n \"MOSTRA_REMOTE_HOME_MOVING\",\n // gen:codes\n] as const;\n\n/** The codes of the REMOTE area. */\nexport type RemoteDiagnosticCode = (typeof remoteDiagnosticCodes)[number];\n\n/** The REMOTE area's catalog entries. */\nexport const remoteDiagnostics: AreaCatalog<RemoteDiagnosticCode> = {\n MOSTRA_REMOTE_CONFIG_INVALID: {\n severity: \"error\",\n phase: \"host\",\n title: \"Remote server configuration can't be used\",\n hint: \"Fix the configuration key the message names, then start mostra-runtime server again.\",\n docs: {\n explanation:\n \"`mostra-runtime server` reads its configuration (the file `--config` names and `MOSTRA_SERVER_*` variables) before it serves anything, and stops when a key is missing, of the wrong type or out of range, naming the key. Nothing was served.\",\n fix: \"Correct the key the message names: `apiOrigin` must be an `https:` origin (or `http:` on loopback), and `domains.active` a host name.\",\n },\n },\n MOSTRA_REMOTE_LOGIN_FAILED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Signing in to a remote server failed\",\n hint: \"Run mostra login again, and approve the code on the server's page within ten minutes.\",\n docs: {\n explanation:\n \"Signing this home in to a remote server didn't finish: the code expired, the person refused it, the server refused the client, or the binding's access token was refused (revoked, expired, or for another server). Nothing of the home changed; artifacts it owns on that server stay its own.\",\n fix: \"Sign in to the server again and approve the code on the page it names. A refusal you didn't expect means the sign-in was revoked on the server.\",\n },\n },\n MOSTRA_REMOTE_UNREACHABLE: {\n severity: \"error\",\n phase: \"host\",\n title: \"The remote server can't be reached\",\n hint: \"Check the network and the server's address, then try again; mostra status shows the link.\",\n docs: {\n explanation:\n \"The owner instance couldn't reach the remote server that holds this hosted artifact, so a write that must go there (its artifact state, a live value) was refused, never applied locally alone (D165 item 1). Nothing was lost: a page's edit stays in its journal and is sent again.\",\n fix: \"Run `mostra status` to see each server's link. When the server is back the link reconnects by itself; then write again.\",\n },\n },\n MOSTRA_REMOTE_OWNER_OFFLINE: {\n severity: \"error\",\n phase: \"host\",\n title: \"The artifact's owner instance is offline\",\n hint: \"Start Mostra on the machine that shared the page, or try again once it is back.\",\n docs: {\n explanation:\n \"A hosted page called server code its owner instance runs, and the owner instance isn't connected. A plain call isn't kept, so it is refused at once; an action run waits or fails as the artifact's `hosted.offline` says.\",\n fix: 'Start Mostra on the owner\\'s machine (`mostra daemon start`, or `mostra daemon install` for always-on). An action that must work while the owner is away should be an action run with `hosted.offline.actions: \"queue\"`.',\n },\n },\n MOSTRA_REMOTE_QUEUE_FULL: {\n severity: \"error\",\n phase: \"host\",\n title: \"Too many runs wait for the owner\",\n hint: \"Wait for the owner to come back and work through its queue, then press again.\",\n docs: {\n explanation:\n \"The artifact's owner instance is offline and as many runs as the server allows already wait for it, so this one was refused before anything was recorded. Runs already waiting keep their place.\",\n fix: \"Bring the owner instance back online: waiting runs then go out in the order they were made. The cap is the server's `relay.waitingRunsPerArtifact` setting.\",\n },\n },\n MOSTRA_REMOTE_NOT_OWNER_INSTANCE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Another instance owns this hosted artifact\",\n hint: \"Share or push this artifact from its owner instance, named in the message.\",\n docs: {\n explanation:\n \"A hosted artifact has one owner instance: the one that shared it. It alone receives the artifact's submissions, relayed runs and authoring, and only it pushes versions of it (D165 item 1b). Another instance of the same account reads and waits through the hosted home.\",\n fix: \"Run the command on the instance the message names. Moving an artifact to another owner instance isn't part of this release.\",\n },\n },\n MOSTRA_REMOTE_SIGN_IN_REQUIRED: {\n severity: \"error\",\n phase: \"host\",\n title: \"This action needs a signed-in viewer\",\n hint: \"Sign in from the page's chrome, or have the owner allow this for anyone with the link.\",\n docs: {\n explanation:\n \"On a hosted link, an action that runs on the owner's machine, or a submission when the artifact asks for it, needs a viewer signed in (D159, D165 item 13). Nothing was recorded.\",\n fix: 'Sign in with the page\\'s Sign in. An owner who wants anyone with the link to run actions sets `hosted: { actions: \"link\" }` in the manifest (and `submissions: \"link\"` for answers).',\n },\n },\n MOSTRA_REMOTE_RATE_LIMITED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Too many requests on this link\",\n hint: \"Try again after the time the answer's Retry-After gives.\",\n docs: {\n explanation:\n \"Too many requests of this kind came through one link or one address in a short time, past the server's `rateLimits`. Nothing was recorded, and a draft stays as it was.\",\n fix: \"Wait for the `Retry-After` the answer carries and try again. The limits are the server's `rateLimits` settings.\",\n },\n },\n MOSTRA_REMOTE_PAUSED_BY_OPERATOR: {\n severity: \"error\",\n phase: \"host\",\n title: \"Paused by the server's operator\",\n hint: \"Contact the server's operator: only the operator resumes a pause it made.\",\n docs: {\n explanation:\n \"The server's operator paused this hosted artifact, and an owner can't undo an operator's pause (D165 item 14). Views keep working and the links stay valid.\",\n fix: \"Ask the server's operator why it was paused and to resume it.\",\n },\n },\n MOSTRA_REMOTE_LIMIT_REACHED: {\n severity: \"error\",\n phase: \"host\",\n title: \"The server's limit refused this\",\n hint: \"Read the message for the server's limit, and try again once it allows the operation.\",\n docs: {\n explanation:\n \"The server's operator refused the operation for this account (its `limits` port): a share, a version push, a link, a view, a submission, an action or an MCP call. The message is the operator's own. A refused submission keeps its draft.\",\n fix: \"Follow the operator's message; its `Retry-After`, when present, says when to try again.\",\n },\n },\n MOSTRA_REMOTE_OPERATOR_UNAVAILABLE: {\n severity: \"error\",\n phase: \"host\",\n title: \"The server's operator didn't answer\",\n hint: \"Try again in a moment; the server's operator didn't answer in time.\",\n docs: {\n explanation:\n \"The server's operator module didn't answer in time (2 s for limits, 5 s for sign-in), so an operation that creates something (a share, a push, a link, authoring, a sign-in) was refused rather than allowed blind. Views, drafts and submissions never wait for it, and existing sessions keep working.\",\n fix: \"Try again; if it lasts, the server's operator has to fix its operator module.\",\n },\n },\n MOSTRA_REMOTE_NO_INSTANCE: {\n severity: \"error\",\n phase: \"host\",\n title: \"No owner instance connected\",\n hint: \"Start Mostra on the machine linked to this account (mostra daemon start), then try again.\",\n docs: {\n explanation:\n \"Creating, verifying and publishing from a chat host run on the account's default owner instance, through the relay (D165 item 5), and no default instance is connected to the server now. Reading tools (list, wait, results, state, docs, open) keep working.\",\n fix: \"Start Mostra on the linked machine (`mostra daemon start`, or `mostra daemon install` to keep it running); link a machine first with `mostra login <server> --default`.\",\n },\n },\n MOSTRA_REMOTE_UNDER_REVIEW: {\n severity: \"error\",\n phase: \"host\",\n title: \"This page is under review\",\n hint: \"Nothing to do here: the server's operator is reviewing this page.\",\n docs: {\n explanation:\n \"The server's operator quarantined this hosted page, or this version of it, while it reviews it. Its data is kept; the page shows a neutral notice instead of its content until the operator releases it.\",\n fix: \"The owner can ask the server's operator about the review.\",\n },\n },\n MOSTRA_REMOTE_HOME_SUSPENDED: {\n severity: \"error\",\n phase: \"host\",\n title: \"This account's pages are suspended\",\n hint: \"Contact the server's operator: this account's pages are suspended.\",\n docs: {\n explanation:\n \"The server's operator suspended this account's hosted home: its pages, its owner instances' bindings, pushes and links are refused until the operator resumes it. Nothing was deleted.\",\n fix: \"Ask the server's operator to resume the account.\",\n },\n },\n MOSTRA_REMOTE_HOME_MOVING: {\n severity: \"error\",\n phase: \"host\",\n title: \"This account's pages are moving\",\n hint: \"Try again in a minute: this account's pages are moving between machines.\",\n docs: {\n explanation:\n \"The server's operator is moving this account's hosted home to another data directory (`drainHome`), so the home is closed here until it serves again. Clients retry; nothing is lost.\",\n fix: \"Retry shortly; the move ends when the operator releases the home on its new machine.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;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,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,6BAA6B;EAC3B,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,kCAAkC;EAChC,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,kCAAkC;EAChC,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,oCAAoC;EAClC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,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,7 +1,7 @@
1
1
  import "../spec.js";
2
2
  //#region src/diagnostics/codes/submit.d.ts
3
3
  /** The codes of the SUBMIT area, in the order they were added. */
4
- export declare const submitDiagnosticCodes: readonly ["MOSTRA_SUBMIT_ALREADY", "MOSTRA_SUBMIT_REVISION_MOVED", "MOSTRA_SUBMIT_POLICY_NONE", "MOSTRA_SUBMIT_NOT_FOUND", "MOSTRA_SUBMIT_VIEW_INVALID", "MOSTRA_SUBMIT_SIGNAL_INVALID", "MOSTRA_SUBMIT_CHANNEL_DENIED", "MOSTRA_SUBMIT_BLOCKED"];
4
+ export declare const submitDiagnosticCodes: readonly ["MOSTRA_SUBMIT_ALREADY", "MOSTRA_SUBMIT_REVISION_MOVED", "MOSTRA_SUBMIT_POLICY_NONE", "MOSTRA_SUBMIT_NOT_FOUND", "MOSTRA_SUBMIT_VIEW_INVALID", "MOSTRA_SUBMIT_SIGNAL_INVALID", "MOSTRA_SUBMIT_CHANNEL_DENIED", "MOSTRA_SUBMIT_BLOCKED", "MOSTRA_SUBMIT_PAUSED"];
5
5
  /** The codes of the SUBMIT area. */
6
6
  export type SubmitDiagnosticCode = (typeof submitDiagnosticCodes)[number];
7
7
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"submit.d.ts","names":[],"sources":["../../../src/diagnostics/codes/submit.ts"],"mappings":";;;qBAMa;;YAaD,+BAA+B"}
1
+ {"version":3,"file":"submit.d.ts","names":[],"sources":["../../../src/diagnostics/codes/submit.ts"],"mappings":";;;qBAMa;;YAcD,+BAA+B"}
@@ -8,7 +8,8 @@ const submitDiagnosticCodes = [
8
8
  "MOSTRA_SUBMIT_VIEW_INVALID",
9
9
  "MOSTRA_SUBMIT_SIGNAL_INVALID",
10
10
  "MOSTRA_SUBMIT_CHANNEL_DENIED",
11
- "MOSTRA_SUBMIT_BLOCKED"
11
+ "MOSTRA_SUBMIT_BLOCKED",
12
+ "MOSTRA_SUBMIT_PAUSED"
12
13
  ];
13
14
  /** The SUBMIT area's catalog entries. */
14
15
  const submitDiagnostics = {
@@ -91,6 +92,16 @@ const submitDiagnostics = {
91
92
  explanation: "Before a submit, the shell and the client runtime check every mounted field (D106): a `required` field without a value, a value its `validate` rejects, or a conflict the viewer hasn't resolved blocks the submit. The diagnostic lists the blockers with their field IDs and labels; `useSubmit().blockers` lists them before anyone submits. Nothing was submitted.",
92
93
  fix: "Show `useSubmit().blockers` next to your submit button, or let the shell list them by label. Answer the required fields, fix the invalid values, and keep or take the conflicting values, then submit again."
93
94
  }
95
+ },
96
+ MOSTRA_SUBMIT_PAUSED: {
97
+ severity: "error",
98
+ phase: "host",
99
+ title: "Artifact paused, no answers taken",
100
+ hint: "Wait until the page is resumed, then submit again; the draft is kept.",
101
+ docs: {
102
+ explanation: "The artifact is paused (`mostra pause`, or its server's operator paused it). A paused artifact stays viewable and its links stay valid, but it takes no submissions until it is resumed. Nothing was recorded, and the draft stays as it was.",
103
+ fix: "The owner resumes it with `mostra resume <artifact>`; a pause by the server's operator is resumed only by the operator."
104
+ }
94
105
  }
95
106
  };
96
107
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"submit.js","names":[],"sources":["../../../src/diagnostics/codes/submit.ts"],"sourcesContent":["/**\n * Diagnostic codes of the SUBMIT area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the SUBMIT area, in the order they were added. */\nexport const submitDiagnosticCodes = [\n \"MOSTRA_SUBMIT_ALREADY\",\n \"MOSTRA_SUBMIT_REVISION_MOVED\",\n \"MOSTRA_SUBMIT_POLICY_NONE\",\n \"MOSTRA_SUBMIT_NOT_FOUND\",\n \"MOSTRA_SUBMIT_VIEW_INVALID\",\n \"MOSTRA_SUBMIT_SIGNAL_INVALID\",\n \"MOSTRA_SUBMIT_CHANNEL_DENIED\",\n \"MOSTRA_SUBMIT_BLOCKED\",\n // gen:codes\n] as const;\n\n/** The codes of the SUBMIT area. */\nexport type SubmitDiagnosticCode = (typeof submitDiagnosticCodes)[number];\n\n/** The SUBMIT area's catalog entries. */\nexport const submitDiagnostics: AreaCatalog<SubmitDiagnosticCode> = {\n MOSTRA_SUBMIT_ALREADY: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Already submitted\",\n hint: \"This artifact takes one submission, and it was made; read it with `mostra results`.\",\n docs: {\n explanation:\n \"The artifact's submission policy is `once`, and a submission already closed this draft: for scope `per-artifact` any viewer's submission closes every draft, for `per-viewer` the viewer's own. A submission is immutable and final, so Mostra refuses a second one and further edits to the closed draft. The refusal carries the existing submission. A repeated submit of the same view at the same draft revision is not refused: it returns the original submission.\",\n fix: 'Read the existing submission with `mostra results <artifact>`. When another round of answers is wanted, publish a new artifact linked to this one (`links: [{ rel: \"round-of\", artifact }]`), or have the host publish with the `epochs` policy.',\n },\n },\n MOSTRA_SUBMIT_REVISION_MOVED: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Draft changed before submit\",\n hint: \"Reload the draft, check what changed, and submit again with its current revision.\",\n docs: {\n explanation:\n \"A submit names the draft revision the viewer saw (`expectedRevision`), and the draft has changed since: another tab, device or writer saved an edit. Mostra never makes a submission from content the viewer didn't see (FAILURE_MODEL §4), so it refuses. The message names the draft's current revision.\",\n fix: \"Let the page reload the draft so the viewer sees exactly what will be sent, then submit with the new revision. The shell and the client runtime flush pending saves before they submit, which makes this rare.\",\n },\n },\n MOSTRA_SUBMIT_POLICY_NONE: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Artifact takes no submissions\",\n hint: \"Exchange data through artifact state, actions and signals; this artifact has no submissions.\",\n docs: {\n explanation:\n \"The artifact's submission policy is `none` (D63): long-lived artifacts such as dashboards and task managers talk to agents through artifact state, actions, signals and events, and the shell shows no Submit control. Mostra refuses a submit, and a `wait --until submitted`, on such an artifact.\",\n fix: \"Wait for a signal (`--until signal:<name>`), a state change (`--until state:<field>`) or an event instead, and read state with `mostra state get`. To collect submissions, publish with policy `once` or `epochs`.\",\n },\n },\n MOSTRA_SUBMIT_NOT_FOUND: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"No such submission\",\n hint: \"Wait for a submission with `mostra wait <artifact> --until submitted`, or, when the message says the policy is none, read `mostra state get <artifact>` or wait for a signal with `--until signal:<name>`.\",\n docs: {\n explanation:\n \"The artifact has no submission yet, or none with the ID asked for. Submissions are durable once made, so this means none was made (or the ID belongs to another artifact or home). An artifact whose submission policy is `none` never has one, and the message says so: its viewers' work is in its shared state, its signals and its action runs.\",\n fix: \"Run `mostra wait <artifact> --until submitted` to block until the viewer submits, then read the results. List the artifact's submissions through `submission.created` events. Under policy `none`, read the shared state with `mostra state get <artifact>`, or wait for a signal the page raises with `mostra wait <artifact> --until signal:<name>`: its event carries the signal's payload.\",\n },\n },\n MOSTRA_SUBMIT_VIEW_INVALID: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Unknown view\",\n hint: \"Send the view ID this page was opened with.\",\n docs: {\n explanation:\n \"Mutations and submits name the view they come from, the one the shell created when it opened this frame. The view named doesn't exist, belongs to another artifact, or belongs to another viewer. Mostra binds every submission to the exact version its view showed, so it refuses a view it can't place.\",\n fix: \"Use the `viewId` the shell handed this frame. A page opened outside Mostra's shell has no view and can't submit.\",\n },\n },\n MOSTRA_SUBMIT_SIGNAL_INVALID: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Invalid signal\",\n hint: \"Name signals with letters, digits, `.`, `_` and `-`, and keep their payload under 64 KiB of JSON.\",\n docs: {\n explanation:\n \"A signal names something the artifact wants a host's attention for, such as `ping-agent`. Its name is 1 to 64 characters of letters, digits, `.`, `_` and `-`, starting with a letter or digit, and its payload is JSON of at most 64 KiB. This one broke one of those rules. The name `submit` is reserved for submissions.\",\n fix: \"Rename the signal or shrink its payload; put large data into a field or artifact state and send its ID in the payload.\",\n },\n },\n MOSTRA_SUBMIT_CHANNEL_DENIED: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Submit channel not allowed\",\n hint: \"Let the viewer submit with the shell's trusted Submit; this host doesn't take submissions from artifact code.\",\n docs: {\n explanation:\n \"A submission comes through one of two channels (D40): the shell's trusted Submit (`shell`), which only a person can press, or the artifact's own code (`artifact`, `useSubmit().submit()` and `useChoice().choose()`). The host decides which it accepts (D108): through `HomeConfig.submitChannels` for the home, or its `trustedControls` port for each artifact. This view allows only the other channel, so Mostra refused the submit or the choice. `useSubmit().allowed` is `false` in such a view.\",\n fix: \"Ask the viewer to press the shell's Submit (relabel it with `useSubmitControl`), and use `useChoice(id, { candidates })` to have the shell render a trusted Choose. Check `allowed` before showing an in-page submit button.\",\n },\n },\n MOSTRA_SUBMIT_BLOCKED: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Answers missing before submit\",\n hint: \"Fill in the fields this diagnostic lists, fix their errors or resolve their conflicts, then submit again.\",\n docs: {\n explanation:\n \"Before a submit, the shell and the client runtime check every mounted field (D106): a `required` field without a value, a value its `validate` rejects, or a conflict the viewer hasn't resolved blocks the submit. The diagnostic lists the blockers with their field IDs and labels; `useSubmit().blockers` lists them before anyone submits. Nothing was submitted.\",\n fix: \"Show `useSubmit().blockers` next to your submit button, or let the shell list them by label. Answer the required fields, fix the invalid values, and keep or take the conflicting values, then submit again.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,oBAAuD;CAClE,uBAAuB;EACrB,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,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,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,uBAAuB;EACrB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
1
+ {"version":3,"file":"submit.js","names":[],"sources":["../../../src/diagnostics/codes/submit.ts"],"sourcesContent":["/**\n * Diagnostic codes of the SUBMIT area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the SUBMIT area, in the order they were added. */\nexport const submitDiagnosticCodes = [\n \"MOSTRA_SUBMIT_ALREADY\",\n \"MOSTRA_SUBMIT_REVISION_MOVED\",\n \"MOSTRA_SUBMIT_POLICY_NONE\",\n \"MOSTRA_SUBMIT_NOT_FOUND\",\n \"MOSTRA_SUBMIT_VIEW_INVALID\",\n \"MOSTRA_SUBMIT_SIGNAL_INVALID\",\n \"MOSTRA_SUBMIT_CHANNEL_DENIED\",\n \"MOSTRA_SUBMIT_BLOCKED\",\n \"MOSTRA_SUBMIT_PAUSED\",\n // gen:codes\n] as const;\n\n/** The codes of the SUBMIT area. */\nexport type SubmitDiagnosticCode = (typeof submitDiagnosticCodes)[number];\n\n/** The SUBMIT area's catalog entries. */\nexport const submitDiagnostics: AreaCatalog<SubmitDiagnosticCode> = {\n MOSTRA_SUBMIT_ALREADY: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Already submitted\",\n hint: \"This artifact takes one submission, and it was made; read it with `mostra results`.\",\n docs: {\n explanation:\n \"The artifact's submission policy is `once`, and a submission already closed this draft: for scope `per-artifact` any viewer's submission closes every draft, for `per-viewer` the viewer's own. A submission is immutable and final, so Mostra refuses a second one and further edits to the closed draft. The refusal carries the existing submission. A repeated submit of the same view at the same draft revision is not refused: it returns the original submission.\",\n fix: 'Read the existing submission with `mostra results <artifact>`. When another round of answers is wanted, publish a new artifact linked to this one (`links: [{ rel: \"round-of\", artifact }]`), or have the host publish with the `epochs` policy.',\n },\n },\n MOSTRA_SUBMIT_REVISION_MOVED: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Draft changed before submit\",\n hint: \"Reload the draft, check what changed, and submit again with its current revision.\",\n docs: {\n explanation:\n \"A submit names the draft revision the viewer saw (`expectedRevision`), and the draft has changed since: another tab, device or writer saved an edit. Mostra never makes a submission from content the viewer didn't see (FAILURE_MODEL §4), so it refuses. The message names the draft's current revision.\",\n fix: \"Let the page reload the draft so the viewer sees exactly what will be sent, then submit with the new revision. The shell and the client runtime flush pending saves before they submit, which makes this rare.\",\n },\n },\n MOSTRA_SUBMIT_POLICY_NONE: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Artifact takes no submissions\",\n hint: \"Exchange data through artifact state, actions and signals; this artifact has no submissions.\",\n docs: {\n explanation:\n \"The artifact's submission policy is `none` (D63): long-lived artifacts such as dashboards and task managers talk to agents through artifact state, actions, signals and events, and the shell shows no Submit control. Mostra refuses a submit, and a `wait --until submitted`, on such an artifact.\",\n fix: \"Wait for a signal (`--until signal:<name>`), a state change (`--until state:<field>`) or an event instead, and read state with `mostra state get`. To collect submissions, publish with policy `once` or `epochs`.\",\n },\n },\n MOSTRA_SUBMIT_NOT_FOUND: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"No such submission\",\n hint: \"Wait for a submission with `mostra wait <artifact> --until submitted`, or, when the message says the policy is none, read `mostra state get <artifact>` or wait for a signal with `--until signal:<name>`.\",\n docs: {\n explanation:\n \"The artifact has no submission yet, or none with the ID asked for. Submissions are durable once made, so this means none was made (or the ID belongs to another artifact or home). An artifact whose submission policy is `none` never has one, and the message says so: its viewers' work is in its shared state, its signals and its action runs.\",\n fix: \"Run `mostra wait <artifact> --until submitted` to block until the viewer submits, then read the results. List the artifact's submissions through `submission.created` events. Under policy `none`, read the shared state with `mostra state get <artifact>`, or wait for a signal the page raises with `mostra wait <artifact> --until signal:<name>`: its event carries the signal's payload.\",\n },\n },\n MOSTRA_SUBMIT_VIEW_INVALID: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Unknown view\",\n hint: \"Send the view ID this page was opened with.\",\n docs: {\n explanation:\n \"Mutations and submits name the view they come from, the one the shell created when it opened this frame. The view named doesn't exist, belongs to another artifact, or belongs to another viewer. Mostra binds every submission to the exact version its view showed, so it refuses a view it can't place.\",\n fix: \"Use the `viewId` the shell handed this frame. A page opened outside Mostra's shell has no view and can't submit.\",\n },\n },\n MOSTRA_SUBMIT_SIGNAL_INVALID: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Invalid signal\",\n hint: \"Name signals with letters, digits, `.`, `_` and `-`, and keep their payload under 64 KiB of JSON.\",\n docs: {\n explanation:\n \"A signal names something the artifact wants a host's attention for, such as `ping-agent`. Its name is 1 to 64 characters of letters, digits, `.`, `_` and `-`, starting with a letter or digit, and its payload is JSON of at most 64 KiB. This one broke one of those rules. The name `submit` is reserved for submissions.\",\n fix: \"Rename the signal or shrink its payload; put large data into a field or artifact state and send its ID in the payload.\",\n },\n },\n MOSTRA_SUBMIT_CHANNEL_DENIED: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Submit channel not allowed\",\n hint: \"Let the viewer submit with the shell's trusted Submit; this host doesn't take submissions from artifact code.\",\n docs: {\n explanation:\n \"A submission comes through one of two channels (D40): the shell's trusted Submit (`shell`), which only a person can press, or the artifact's own code (`artifact`, `useSubmit().submit()` and `useChoice().choose()`). The host decides which it accepts (D108): through `HomeConfig.submitChannels` for the home, or its `trustedControls` port for each artifact. This view allows only the other channel, so Mostra refused the submit or the choice. `useSubmit().allowed` is `false` in such a view.\",\n fix: \"Ask the viewer to press the shell's Submit (relabel it with `useSubmitControl`), and use `useChoice(id, { candidates })` to have the shell render a trusted Choose. Check `allowed` before showing an in-page submit button.\",\n },\n },\n MOSTRA_SUBMIT_BLOCKED: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Answers missing before submit\",\n hint: \"Fill in the fields this diagnostic lists, fix their errors or resolve their conflicts, then submit again.\",\n docs: {\n explanation:\n \"Before a submit, the shell and the client runtime check every mounted field (D106): a `required` field without a value, a value its `validate` rejects, or a conflict the viewer hasn't resolved blocks the submit. The diagnostic lists the blockers with their field IDs and labels; `useSubmit().blockers` lists them before anyone submits. Nothing was submitted.\",\n fix: \"Show `useSubmit().blockers` next to your submit button, or let the shell list them by label. Answer the required fields, fix the invalid values, and keep or take the conflicting values, then submit again.\",\n },\n },\n MOSTRA_SUBMIT_PAUSED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Artifact paused, no answers taken\",\n hint: \"Wait until the page is resumed, then submit again; the draft is kept.\",\n docs: {\n explanation:\n \"The artifact is paused (`mostra pause`, or its server's operator paused it). A paused artifact stays viewable and its links stay valid, but it takes no submissions until it is resumed. Nothing was recorded, and the draft stays as it was.\",\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;AAEF;;AAMA,MAAa,oBAAuD;CAClE,uBAAuB;EACrB,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,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,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,uBAAuB;EACrB,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"}