@mostra/cli 0.0.0-stage → 0.2.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 (196) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +18 -2
  3. package/dist/bin.d.ts +1 -0
  4. package/dist/bin.js +79 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/bootstrap-DfEe_yPr.js +113 -0
  7. package/dist/bootstrap-DfEe_yPr.js.map +1 -0
  8. package/dist/exit-CBIf8nAU.js +79 -0
  9. package/dist/exit-CBIf8nAU.js.map +1 -0
  10. package/dist/flush-BCuWs0Zh.js +718 -0
  11. package/dist/flush-BCuWs0Zh.js.map +1 -0
  12. package/dist/index.d.ts +230 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +3 -0
  15. package/dist/reference/cli.md +977 -0
  16. package/dist/reference/diagnostics.json +1264 -0
  17. package/dist/reference/errors/MOSTRA_A11Y_MINOR.md +23 -0
  18. package/dist/reference/errors/MOSTRA_A11Y_SERIOUS.md +23 -0
  19. package/dist/reference/errors/MOSTRA_ACTION_CANCELLED.md +23 -0
  20. package/dist/reference/errors/MOSTRA_ACTION_EVENT_INVALID.md +23 -0
  21. package/dist/reference/errors/MOSTRA_ACTION_EXPORT_INVALID.md +23 -0
  22. package/dist/reference/errors/MOSTRA_ACTION_INTERRUPTED.md +23 -0
  23. package/dist/reference/errors/MOSTRA_ACTION_RUN_NOT_FOUND.md +23 -0
  24. package/dist/reference/errors/MOSTRA_ACTION_THREW.md +23 -0
  25. package/dist/reference/errors/MOSTRA_ACTION_TOO_LARGE.md +23 -0
  26. package/dist/reference/errors/MOSTRA_ACTION_UNKNOWN_FUNCTION.md +23 -0
  27. package/dist/reference/errors/MOSTRA_ACTION_UNSERIALIZABLE.md +23 -0
  28. package/dist/reference/errors/MOSTRA_ARTIFACT_DIR_NOT_EMPTY.md +23 -0
  29. package/dist/reference/errors/MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS.md +23 -0
  30. package/dist/reference/errors/MOSTRA_ARTIFACT_NOT_FOUND.md +23 -0
  31. package/dist/reference/errors/MOSTRA_ARTIFACT_NO_ENTRY.md +23 -0
  32. package/dist/reference/errors/MOSTRA_ARTIFACT_NO_PAGE.md +23 -0
  33. package/dist/reference/errors/MOSTRA_ARTIFACT_SOURCE_MISSING.md +23 -0
  34. package/dist/reference/errors/MOSTRA_ARTIFACT_SOURCE_UNREADABLE.md +23 -0
  35. package/dist/reference/errors/MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN.md +23 -0
  36. package/dist/reference/errors/MOSTRA_ARTIFACT_VERSION_COLLECTED.md +23 -0
  37. package/dist/reference/errors/MOSTRA_ARTIFACT_VERSION_NOT_FOUND.md +23 -0
  38. package/dist/reference/errors/MOSTRA_BUILD_CRASHED.md +23 -0
  39. package/dist/reference/errors/MOSTRA_BUILD_FAILED.md +23 -0
  40. package/dist/reference/errors/MOSTRA_BUILD_TIMEOUT.md +23 -0
  41. package/dist/reference/errors/MOSTRA_BUILD_UNRESOLVED.md +23 -0
  42. package/dist/reference/errors/MOSTRA_CLI_CONFIG_UNWRITABLE.md +23 -0
  43. package/dist/reference/errors/MOSTRA_CLI_UNKNOWN_COMMAND.md +23 -0
  44. package/dist/reference/errors/MOSTRA_CLI_USAGE.md +23 -0
  45. package/dist/reference/errors/MOSTRA_CONSOLE_ERROR.md +23 -0
  46. package/dist/reference/errors/MOSTRA_CONSOLE_WARNING.md +23 -0
  47. package/dist/reference/errors/MOSTRA_DEP_INSTALL_FAILED.md +23 -0
  48. package/dist/reference/errors/MOSTRA_DEP_MISSING.md +23 -0
  49. package/dist/reference/errors/MOSTRA_DEP_NOT_FOUND.md +23 -0
  50. package/dist/reference/errors/MOSTRA_DEP_OFFLINE.md +23 -0
  51. package/dist/reference/errors/MOSTRA_DEP_SPEC_INVALID.md +23 -0
  52. package/dist/reference/errors/MOSTRA_DEP_TIMEOUT.md +23 -0
  53. package/dist/reference/errors/MOSTRA_DEP_WARM_CONFLICT.md +23 -0
  54. package/dist/reference/errors/MOSTRA_ENV_BIND_FAILED.md +23 -0
  55. package/dist/reference/errors/MOSTRA_ENV_BROWSER_MISSING.md +23 -0
  56. package/dist/reference/errors/MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED.md +23 -0
  57. package/dist/reference/errors/MOSTRA_ENV_BUNDLE_INVALID.md +23 -0
  58. package/dist/reference/errors/MOSTRA_ENV_BUNDLE_UNAVAILABLE.md +23 -0
  59. package/dist/reference/errors/MOSTRA_ENV_NODE_UNSUPPORTED.md +23 -0
  60. package/dist/reference/errors/MOSTRA_ENV_PORT_TAKEN.md +23 -0
  61. package/dist/reference/errors/MOSTRA_ENV_RUNTIME_MISSING.md +23 -0
  62. package/dist/reference/errors/MOSTRA_ENV_SERVICE_FAILED.md +23 -0
  63. package/dist/reference/errors/MOSTRA_ENV_SHELL_MISSING.md +23 -0
  64. package/dist/reference/errors/MOSTRA_ENV_WARM_MISSING.md +23 -0
  65. package/dist/reference/errors/MOSTRA_FIELD_CONFLICT.md +23 -0
  66. package/dist/reference/errors/MOSTRA_FIELD_DUPLICATE_ID.md +23 -0
  67. package/dist/reference/errors/MOSTRA_FIELD_ID_INVALID.md +23 -0
  68. package/dist/reference/errors/MOSTRA_FIELD_ID_UNSTABLE.md +23 -0
  69. package/dist/reference/errors/MOSTRA_FIELD_MUTATION_ID_REUSED.md +23 -0
  70. package/dist/reference/errors/MOSTRA_FIELD_SHARED.md +23 -0
  71. package/dist/reference/errors/MOSTRA_FIELD_TOO_LARGE.md +23 -0
  72. package/dist/reference/errors/MOSTRA_FIELD_UNBOUND.md +23 -0
  73. package/dist/reference/errors/MOSTRA_HOME_DISK_FULL.md +23 -0
  74. package/dist/reference/errors/MOSTRA_HOME_GC_INCOMPLETE.md +23 -0
  75. package/dist/reference/errors/MOSTRA_HOME_GONE.md +23 -0
  76. package/dist/reference/errors/MOSTRA_HOME_INTEGRITY.md +23 -0
  77. package/dist/reference/errors/MOSTRA_HOME_LEDGER_UNREADABLE.md +23 -0
  78. package/dist/reference/errors/MOSTRA_HOME_LOCKED.md +23 -0
  79. package/dist/reference/errors/MOSTRA_HOME_MISMATCH.md +23 -0
  80. package/dist/reference/errors/MOSTRA_HOME_NOT_ALWAYS_ON.md +23 -0
  81. package/dist/reference/errors/MOSTRA_HOME_NOT_OWNED.md +23 -0
  82. package/dist/reference/errors/MOSTRA_HOME_SOCKET_TOO_LONG.md +23 -0
  83. package/dist/reference/errors/MOSTRA_HOME_TOO_NEW.md +23 -0
  84. package/dist/reference/errors/MOSTRA_HOST_CONNECTION_CLOSED.md +23 -0
  85. package/dist/reference/errors/MOSTRA_HOST_CURSOR_COMPACTED.md +23 -0
  86. package/dist/reference/errors/MOSTRA_HOST_IDENTITY_UNAVAILABLE.md +23 -0
  87. package/dist/reference/errors/MOSTRA_HOST_INITIALIZE_ORDER.md +23 -0
  88. package/dist/reference/errors/MOSTRA_HOST_INTERNAL_ERROR.md +23 -0
  89. package/dist/reference/errors/MOSTRA_HOST_INVALID_PARAMS.md +23 -0
  90. package/dist/reference/errors/MOSTRA_HOST_MALFORMED.md +23 -0
  91. package/dist/reference/errors/MOSTRA_HOST_MESSAGE_TOO_LARGE.md +23 -0
  92. package/dist/reference/errors/MOSTRA_HOST_METHOD_UNKNOWN.md +23 -0
  93. package/dist/reference/errors/MOSTRA_HOST_NOTIFICATION_UNSUPPORTED.md +23 -0
  94. package/dist/reference/errors/MOSTRA_HOST_PORT_UNSUPPORTED.md +23 -0
  95. package/dist/reference/errors/MOSTRA_HOST_REQUEST_ID_REUSED.md +23 -0
  96. package/dist/reference/errors/MOSTRA_HOST_REVISION_UNSUPPORTED.md +23 -0
  97. package/dist/reference/errors/MOSTRA_HOST_SHUTDOWN_REFUSED.md +23 -0
  98. package/dist/reference/errors/MOSTRA_HOST_SUBSCRIPTION_UNKNOWN.md +23 -0
  99. package/dist/reference/errors/MOSTRA_HOST_TIMEOUT.md +23 -0
  100. package/dist/reference/errors/MOSTRA_HYGIENE_CONTENT_TYPE.md +23 -0
  101. package/dist/reference/errors/MOSTRA_HYGIENE_CSRF_MISSING.md +23 -0
  102. package/dist/reference/errors/MOSTRA_HYGIENE_HEADERS_TOO_LARGE.md +23 -0
  103. package/dist/reference/errors/MOSTRA_HYGIENE_HOST_REFUSED.md +23 -0
  104. package/dist/reference/errors/MOSTRA_HYGIENE_NOT_SERVED.md +23 -0
  105. package/dist/reference/errors/MOSTRA_HYGIENE_ORIGIN_REFUSED.md +23 -0
  106. package/dist/reference/errors/MOSTRA_HYGIENE_RATE_LIMITED.md +23 -0
  107. package/dist/reference/errors/MOSTRA_HYGIENE_REQUEST_MALFORMED.md +23 -0
  108. package/dist/reference/errors/MOSTRA_HYGIENE_SCOPE_DENIED.md +23 -0
  109. package/dist/reference/errors/MOSTRA_HYGIENE_SESSION_CONFLICT.md +23 -0
  110. package/dist/reference/errors/MOSTRA_HYGIENE_SESSION_MISSING.md +23 -0
  111. package/dist/reference/errors/MOSTRA_HYGIENE_TOKEN_INVALID.md +23 -0
  112. package/dist/reference/errors/MOSTRA_HYGIENE_TOKEN_REVOKED.md +23 -0
  113. package/dist/reference/errors/MOSTRA_LIVE_SOURCE_FAILED.md +23 -0
  114. package/dist/reference/errors/MOSTRA_LIVE_TOO_LARGE.md +23 -0
  115. package/dist/reference/errors/MOSTRA_MANIFEST_INVALID.md +23 -0
  116. package/dist/reference/errors/MOSTRA_MANIFEST_NOT_LITERAL.md +23 -0
  117. package/dist/reference/errors/MOSTRA_MANIFEST_UNKNOWN_KEY.md +23 -0
  118. package/dist/reference/errors/MOSTRA_NETWORK_EXTERNAL_FAILED.md +23 -0
  119. package/dist/reference/errors/MOSTRA_NETWORK_REQUEST_FAILED.md +23 -0
  120. package/dist/reference/errors/MOSTRA_PLATFORM_UNSUPPORTED.md +23 -0
  121. package/dist/reference/errors/MOSTRA_PUBLISH_ID_CONFLICT.md +23 -0
  122. package/dist/reference/errors/MOSTRA_PUBLISH_SOURCE_CHANGED.md +23 -0
  123. package/dist/reference/errors/MOSTRA_PUBLISH_VERIFY_FAILED.md +23 -0
  124. package/dist/reference/errors/MOSTRA_REGRESSION_ACTION_REMOVED.md +23 -0
  125. package/dist/reference/errors/MOSTRA_REGRESSION_ARIA.md +23 -0
  126. package/dist/reference/errors/MOSTRA_REGRESSION_FIELD_REMOVED.md +23 -0
  127. package/dist/reference/errors/MOSTRA_REGRESSION_LIVE_REMOVED.md +23 -0
  128. package/dist/reference/errors/MOSTRA_REGRESSION_PAGE_REMOVED.md +23 -0
  129. package/dist/reference/errors/MOSTRA_REGRESSION_PIXELS.md +23 -0
  130. package/dist/reference/errors/MOSTRA_RUNTIME_BLANK.md +23 -0
  131. package/dist/reference/errors/MOSTRA_RUNTIME_NOT_READY.md +23 -0
  132. package/dist/reference/errors/MOSTRA_RUNTIME_PAGE_ERROR.md +23 -0
  133. package/dist/reference/errors/MOSTRA_RUNTIME_WORKER_CRASHED.md +23 -0
  134. package/dist/reference/errors/MOSTRA_RUNTIME_WORKER_PARKED.md +23 -0
  135. package/dist/reference/errors/MOSTRA_SECRET_MISSING.md +23 -0
  136. package/dist/reference/errors/MOSTRA_SMOKE_BUDGET.md +23 -0
  137. package/dist/reference/errors/MOSTRA_SMOKE_NO_EFFECT.md +23 -0
  138. package/dist/reference/errors/MOSTRA_SUBMIT_ALREADY.md +23 -0
  139. package/dist/reference/errors/MOSTRA_SUBMIT_BLOCKED.md +23 -0
  140. package/dist/reference/errors/MOSTRA_SUBMIT_CHANNEL_DENIED.md +23 -0
  141. package/dist/reference/errors/MOSTRA_SUBMIT_NOT_FOUND.md +23 -0
  142. package/dist/reference/errors/MOSTRA_SUBMIT_POLICY_NONE.md +23 -0
  143. package/dist/reference/errors/MOSTRA_SUBMIT_REVISION_MOVED.md +23 -0
  144. package/dist/reference/errors/MOSTRA_SUBMIT_SIGNAL_INVALID.md +23 -0
  145. package/dist/reference/errors/MOSTRA_SUBMIT_VIEW_INVALID.md +23 -0
  146. package/dist/reference/errors/MOSTRA_TARGET_UNAVAILABLE.md +23 -0
  147. package/dist/reference/errors/MOSTRA_TYPE_ERROR.md +23 -0
  148. package/dist/reference/errors/MOSTRA_TYPE_UNTYPED_PACKAGE.md +23 -0
  149. package/dist/reference/errors/MOSTRA_VERIFY_ACTION_SKIPPED.md +23 -0
  150. package/dist/reference/errors/MOSTRA_VERIFY_BASELINE_MISSING.md +23 -0
  151. package/dist/reference/errors/MOSTRA_VERIFY_CRASHED.md +23 -0
  152. package/dist/reference/errors/MOSTRA_VERIFY_LIVE_FAILED.md +23 -0
  153. package/dist/reference/errors/MOSTRA_VERIFY_NO_BASELINE.md +23 -0
  154. package/dist/reference/errors/MOSTRA_VERIFY_SECRET_MISSING.md +23 -0
  155. package/dist/reference/errors/MOSTRA_VERIFY_SKIP_CONSEQUENCE.md +23 -0
  156. package/dist/reference/errors/MOSTRA_VERIFY_TIMEOUT.md +23 -0
  157. package/dist/reference/telemetry.md +82 -0
  158. package/dist/run-BJaRnz-Q.js +3824 -0
  159. package/dist/run-BJaRnz-Q.js.map +1 -0
  160. package/dist/run-CMyjOm0Q.js +2 -0
  161. package/dist/telemetry/flush-main.d.ts +1 -0
  162. package/dist/telemetry/flush-main.js +14 -0
  163. package/dist/telemetry/flush-main.js.map +1 -0
  164. package/package.json +62 -3
  165. package/src/bin.ts +70 -0
  166. package/src/bootstrap.ts +156 -0
  167. package/src/browser.ts +186 -0
  168. package/src/client.ts +313 -0
  169. package/src/command.ts +147 -0
  170. package/src/commands/admin.ts +791 -0
  171. package/src/commands/authoring.ts +244 -0
  172. package/src/commands/dev.ts +106 -0
  173. package/src/commands/index.ts +71 -0
  174. package/src/commands/interaction.ts +288 -0
  175. package/src/commands/shared.ts +71 -0
  176. package/src/commands/viewing.ts +153 -0
  177. package/src/docs.ts +111 -0
  178. package/src/exit.ts +89 -0
  179. package/src/help.ts +170 -0
  180. package/src/home.ts +111 -0
  181. package/src/index.ts +23 -0
  182. package/src/node-gate.ts +15 -0
  183. package/src/parse.ts +246 -0
  184. package/src/run.ts +387 -0
  185. package/src/telemetry/decision.ts +101 -0
  186. package/src/telemetry/events.ts +147 -0
  187. package/src/telemetry/flush-main.ts +13 -0
  188. package/src/telemetry/flush.ts +143 -0
  189. package/src/telemetry/harness.ts +39 -0
  190. package/src/telemetry/index.ts +318 -0
  191. package/src/telemetry/store.ts +379 -0
  192. package/src/telemetry/timezone.ts +72 -0
  193. package/src/telemetry/words.ts +87 -0
  194. package/src/telemetry/zone-sets.ts +182 -0
  195. package/src/telemetry/zones.generated.ts +720 -0
  196. package/src/version.ts +43 -0
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_SUBSCRIPTION_UNKNOWN
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_SUBSCRIPTION_UNKNOWN
10
+
11
+ Unknown subscription. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ The subscription ID belongs to no subscription on this connection: it was never created here, was ended with `events/unsubscribe`, or belonged to a connection that closed. Subscriptions live as long as their connection; a named subscriber's acknowledged cursor outlives it.
16
+
17
+ ## How to fix it
18
+
19
+ Call `events/subscribe` again on this connection. With the same `name`, delivery resumes after the last acknowledged cursor.
20
+
21
+ ## Hint
22
+
23
+ Subscribe again with `events/subscribe`, then use the ID it returns.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOST_TIMEOUT
3
+ severity: error
4
+ phase: host
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HOST_TIMEOUT
10
+
11
+ Request timed out. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ No response arrived within the time the caller allowed. The other side may still be working on the request, and it may still take effect.
16
+
17
+ ## How to fix it
18
+
19
+ Retry with the same request ID, which returns the recorded result if the first attempt completed. Allow a longer timeout for slow operations.
20
+
21
+ ## Hint
22
+
23
+ Retry the request with the same request ID, or allow it more time.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_CONTENT_TYPE
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_CONTENT_TYPE
10
+
11
+ JSON content type required. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ Requests that change state must have a JSON body. A form or plain-text body is something any website can send without asking the browser first, so the gateway refuses it with 415.
16
+
17
+ ## How to fix it
18
+
19
+ Send `Content-Type: application/json` and a JSON body.
20
+
21
+ ## Hint
22
+
23
+ Send the body as JSON with `Content-Type: application/json`.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_CSRF_MISSING
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_CSRF_MISSING
10
+
11
+ CSRF token missing or wrong. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ Every request that changes state through a session carries the session's CSRF token in the `X-Mostra-CSRF` header. The token comes only from the session endpoint of the same origin, which no other page can read. A missing or different token is answered with 403.
16
+
17
+ ## How to fix it
18
+
19
+ Read `csrf` from `GET /_mostra/session` (on the shell, `GET /a/<artifactId>/_mostra/session`) and send it with every POST. Mostra's client runtime and shell do this for you.
20
+
21
+ ## Hint
22
+
23
+ Send the session's CSRF token from `GET /_mostra/session` in the `X-Mostra-CSRF` header.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_HEADERS_TOO_LARGE
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_HEADERS_TOO_LARGE
10
+
11
+ The request's headers are too large. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ The request's headers passed the gateway's limit of 1 MiB, more than any browser sends for one host's cookies. Every port of the loopback host shares one cookie jar, so a page on any of them can fill it. The gateway answers 431 with `Clear-Site-Data: "cookies"`, which empties the host's cookies, so the next request works. Mostra's sessions go with them and come back when a link is opened again.
16
+
17
+ ## How to fix it
18
+
19
+ Open the artifact's link again. If it keeps happening, find the page that sets the cookies: it runs on this host.
20
+
21
+ ## Hint
22
+
23
+ Open the link again: this page cleared the cookies that made the request too large.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_HOST_REFUSED
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_HOST_REFUSED
10
+
11
+ Host not served. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ The request's `Host` header named a host this gateway doesn't serve. Each gateway listener accepts exactly the host and port its capability URLs use, so a page that rebinds its own DNS name to the loopback address can't reach an artifact (DNS rebinding). The gateway answers 421.
16
+
17
+ ## How to fix it
18
+
19
+ Use the URL from `view/url` or the publish receipt as it is, without replacing `127.0.0.1` by `localhost` or another name. A gateway started with `--bind` and `--url-host` accepts the URL host it was given.
20
+
21
+ ## Hint
22
+
23
+ Open the artifact through the exact link Mostra gave you.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_NOT_SERVED
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_NOT_SERVED
10
+
11
+ Nothing served here. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ The gateway serves only published versions' client files and the browser-protocol paths under `/_mostra/`. Everything else in the home, such as sources, server bundles, staging and unpublished builds, has no URL. A path or method nothing answers gets 404 or 405.
16
+
17
+ ## How to fix it
18
+
19
+ Check the path. Server code runs through the browser protocol, never as a file, and an artifact becomes viewable only once it is published.
20
+
21
+ ## Hint
22
+
23
+ Request a published version's files or a documented `/_mostra/` path.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_ORIGIN_REFUSED
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_ORIGIN_REFUSED
10
+
11
+ Origin refused. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ A request that changes state, opens a stream or upgrades to a WebSocket must carry an `Origin` header equal to the origin it is sent to. The gateway compares the strings exactly and answers 403 otherwise, so another website, or another artifact on a different port, can't drive this one.
16
+
17
+ ## How to fix it
18
+
19
+ Call the gateway from the page it serves: the shell from the shell, the artifact from its own frame. Tools outside a browser send the listener's own origin.
20
+
21
+ ## Hint
22
+
23
+ Send the request from the page's own origin.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_RATE_LIMITED
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_RATE_LIMITED
10
+
11
+ Too many failed attempts. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ More than 30 capability tokens failed for this artifact within a minute, so the gateway refuses every token for it, valid ones included, until the minute has passed. A guess can't succeed while the limit holds, and only this artifact's links wait. The gateway answers 429 with `Retry-After`.
16
+
17
+ ## How to fix it
18
+
19
+ Wait, then open the link again. Repeated failures usually come from a mistyped link or a script retrying an old one.
20
+
21
+ ## Hint
22
+
23
+ Wait for the time in `Retry-After`, then open the link again.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_REQUEST_MALFORMED
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_REQUEST_MALFORMED
10
+
11
+ Malformed request. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ The gateway refused a request it can't interpret safely: a repeated `Host` or `Origin` header, a request target that isn't a path, an encoded `/` or `..` that would leave the served tree, a body that isn't valid JSON, or a header with control characters. It answers 400 rather than guess.
16
+
17
+ ## How to fix it
18
+
19
+ Send a single request with one `Host` header and a plain path. Browsers always do; this usually means a hand-written client or a probe.
20
+
21
+ ## Hint
22
+
23
+ Send one well-formed HTTP request with a path that starts with `/`.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_SCOPE_DENIED
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_SCOPE_DENIED
10
+
11
+ Not allowed by this link. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ The session's link doesn't carry the scope this request needs: `draft` to save answers, `submit` to submit, `review` to comment, and `action:*`, `action:<export>` or `action:<module path>#<export>` to run a server function. A view-and-comment link, for example, can't submit or run an action. The gateway answers 403.
16
+
17
+ ## How to fix it
18
+
19
+ Mint a link with the scopes the viewer needs, such as `view/url` with `scopes: ["view", "draft", "submit"]`. Without `scopes`, a link carries every scope.
20
+
21
+ ## Hint
22
+
23
+ Open a link minted with this scope (`view/url` with `scopes`).
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_SESSION_CONFLICT
3
+ severity: warning
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_SESSION_CONFLICT
10
+
11
+ Another link is already open for this artifact. Severity: warning. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ This browser already has a live session for the artifact from a different link. Opening a link never silently replaces it, because a page elsewhere could send the viewer to its own, narrower link and take over their tabs (D98). The shell shows both links' access and lets the viewer choose; the answer is 409 with `current` and `offered`.
16
+
17
+ ## How to fix it
18
+
19
+ In the shell, choose the link to keep. A client exchanging tokens itself sends `replace: true` to replace the session.
20
+
21
+ ## Hint
22
+
23
+ Choose which link to keep; send `replace: true` to use the new one.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_SESSION_MISSING
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_SESSION_MISSING
10
+
11
+ No session. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ The request carried no valid session for this origin. Sessions start when a capability link is opened: the shell exchanges the link's token for a session cookie, and gives the artifact frame a single-use ticket for its own. A session issued for another origin never counts, because every port of the host shares the browser's cookies. The gateway answers 401.
16
+
17
+ ## How to fix it
18
+
19
+ Open the full capability link, including the part after `#`. A bookmark of the page without it works while the browser keeps the session cookie (400 days).
20
+
21
+ ## Hint
22
+
23
+ Open the artifact's capability link again to start a session.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_TOKEN_INVALID
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_TOKEN_INVALID
10
+
11
+ Unknown capability token. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ The capability token or frame ticket matched nothing in this home: it was mistyped, cut short, belongs to another home or artifact, or the ticket was already used or expired (tickets last 60 seconds and work once). Over the host protocol, the token ID named in `view/revoke` or `view/rotate` doesn't exist. The gateway answers 401, and failed attempts count towards the rate limit.
16
+
17
+ ## How to fix it
18
+
19
+ Copy the whole link again. An agent or host mints a fresh one with `view/url`; the shell gets a new frame ticket by reloading.
20
+
21
+ ## Hint
22
+
23
+ Use the complete capability link Mostra gave you, or mint a new one with `view/url`.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HYGIENE_TOKEN_REVOKED
3
+ severity: error
4
+ phase: hygiene
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_HYGIENE_TOKEN_REVOKED
10
+
11
+ Link revoked or expired. Severity: error. Phase: hygiene.
12
+
13
+ ## What it means
14
+
15
+ The capability link was revoked (`view/revoke`), replaced (`view/rotate`), or reached the end of its `ttl`. Every session started from it ends too. The gateway answers 410. Local links have no expiry unless one was asked for.
16
+
17
+ ## How to fix it
18
+
19
+ Get a new link from whoever shared this one. An agent mints it with `view/url`, or rotates the old one with `view/rotate`, and shares the new URL.
20
+
21
+ ## Hint
22
+
23
+ Ask for a new link: `view/url` mints one, or `view/rotate` replaces this one.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_LIVE_SOURCE_FAILED
3
+ severity: error
4
+ phase: runtime
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_LIVE_SOURCE_FAILED
10
+
11
+ Live source failed. Severity: error. Phase: runtime.
12
+
13
+ ## What it means
14
+
15
+ A live source's `load` or `stream` threw, or its value was outside the serializable types. Pages keep showing the last good value with `useLive`'s `error` set, and the producer tries again on its schedule (FAILURE_MODEL §6).
16
+
17
+ ## How to fix it
18
+
19
+ Fix the producer in `live.ts`, or catch transient failures there and return the previous value.
20
+
21
+ ## Hint
22
+
23
+ Read the message, fix the live source's loader or stream, and publish again; the last good value stays meanwhile.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_LIVE_TOO_LARGE
3
+ severity: error
4
+ phase: runtime
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_LIVE_TOO_LARGE
10
+
11
+ Live value too large. Severity: error. Phase: runtime.
12
+
13
+ ## What it means
14
+
15
+ A live value, pushed or produced, is over 4 MiB once serialized (DATA_MODEL §5). It is refused and the last good value stays.
16
+
17
+ ## How to fix it
18
+
19
+ Send a smaller window of the data, or split it across several live sources. For high-rate series, push single points in append mode and let the page keep the window.
20
+
21
+ ## Hint
22
+
23
+ Push or produce a smaller value: at most 4 MiB serialized.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_MANIFEST_INVALID
3
+ severity: error
4
+ phase: manifest
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_MANIFEST_INVALID
10
+
11
+ Manifest value is invalid. Severity: error. Phase: manifest.
12
+
13
+ ## What it means
14
+
15
+ The manifest was read, but a field has a value the manifest doesn't allow: a missing `title`, a wrong type, an `id` that isn't an artifact ID (`art_` followed by a ULID), a `mode` this runtime doesn't build (`spa` is the only one), or frontmatter that isn't valid YAML. The message names the field and what was expected.
16
+
17
+ ## How to fix it
18
+
19
+ Correct the field the message names. Leave `id` out to let Mostra bind the artifact to its source path at first publish, or keep the `id` that `mostra new` wrote. Every field except `title` is optional.
20
+
21
+ ## Hint
22
+
23
+ Fix the manifest field named in the message so it matches the manifest's documented shape.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_MANIFEST_NOT_LITERAL
3
+ severity: error
4
+ phase: manifest
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_MANIFEST_NOT_LITERAL
10
+
11
+ Manifest isn't a literal. Severity: error. Phase: manifest.
12
+
13
+ ## What it means
14
+
15
+ Mostra reads an artifact's manifest without running its code: the `export const artifact = defineArtifact({...})` in a TSX entry, or the frontmatter of an MDX entry. It reports this code when the exported `artifact` isn't a `defineArtifact(...)` call with one object literal, or when a value inside it needs evaluation (an identifier, a function call, a spread, a computed key, a template literal with a placeholder). The location points at the first such value.
16
+
17
+ ## How to fix it
18
+
19
+ Replace the value with the literal it stands for, for example `title: "Q3 review"` instead of `title: TITLE`. Keep computed values in the page code, where they can use anything. `as const` and `satisfies` on the object are fine.
20
+
21
+ ## Hint
22
+
23
+ Write the manifest as plain values: strings, numbers, booleans, null, arrays and objects, with no variables, calls, spreads or computed keys.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_MANIFEST_UNKNOWN_KEY
3
+ severity: warning
4
+ phase: manifest
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_MANIFEST_UNKNOWN_KEY
10
+
11
+ Unknown manifest key. Severity: warning. Phase: manifest.
12
+
13
+ ## What it means
14
+
15
+ The manifest has a key this runtime doesn't know. Mostra ignores it, so manifests written for a newer release still publish, but a misspelled key (`familly`, `decription`) silently has no effect.
16
+
17
+ ## How to fix it
18
+
19
+ Check the key against the manifest fields (`id`, `title`, `description`, `family`, `links`, `mode`, `submission`, `kit`, `terminals`, `demos`, `limits`, `verify`) and fix the spelling, or remove it.
20
+
21
+ ## Hint
22
+
23
+ Remove the key or correct its spelling; a newer Mostra may support it.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_NETWORK_EXTERNAL_FAILED
3
+ severity: warning
4
+ phase: network
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_NETWORK_EXTERNAL_FAILED
10
+
11
+ Request to another origin failed. Severity: warning. Phase: network.
12
+
13
+ ## What it means
14
+
15
+ A request the page made to another origin failed or answered 4xx or 5xx. It may be the environment (no network, a service that is down, a request the service refuses from this origin) rather than the code, so it is a warning.
16
+
17
+ ## How to fix it
18
+
19
+ Check the URL and the service. If the page depends on it, show a fallback when it fails.
20
+
21
+ ## Hint
22
+
23
+ A request to another origin failed while verify ran; check the URL and whether that service was reachable.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_NETWORK_REQUEST_FAILED
3
+ severity: error
4
+ phase: network
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_NETWORK_REQUEST_FAILED
10
+
11
+ Request for the page's own resource failed. Severity: error. Phase: network.
12
+
13
+ ## What it means
14
+
15
+ A resource the page loaded from the artifact's own origin (the document, a script, a style, an image, a font, or a fetch by artifact code) failed or answered 4xx or 5xx. Requests the browser makes on its own, such as `/favicon.ico`, and Mostra's own protocol aren't counted.
16
+
17
+ ## How to fix it
18
+
19
+ Put the file in `public/` (served at the root) or import it from the code so the build includes it, and check the path's spelling.
20
+
21
+ ## Hint
22
+
23
+ Check the path: a file the page loads from the artifact itself failed to load.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_PLATFORM_UNSUPPORTED
3
+ severity: error
4
+ phase: platform
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_PLATFORM_UNSUPPORTED
10
+
11
+ Unsupported platform. Severity: error. Phase: platform.
12
+
13
+ ## What it means
14
+
15
+ Mostra 1.0 runs on macOS and Linux, on x64 and arm64. On any other operating system or architecture, Windows included, every entry point stops with this code before it creates or changes anything, because the process model, sockets and storage are built and tested only on those platforms. The message names the platform that was detected.
16
+
17
+ ## How to fix it
18
+
19
+ Run Mostra on a macOS or Linux machine with an x64 or arm64 processor. Windows support is planned for a release after 1.0.
20
+
21
+ ## Hint
22
+
23
+ Run Mostra on macOS or Linux, on an x64 or arm64 machine.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_PUBLISH_ID_CONFLICT
3
+ severity: error
4
+ phase: publish
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_PUBLISH_ID_CONFLICT
10
+
11
+ Artifact ID claimed by two sources. Severity: error. Phase: publish.
12
+
13
+ ## What it means
14
+
15
+ An artifact's `id` names exactly one source. Mostra reports this code when a manifest claims an `id` that is already bound to another source path whose entry still claims it, which usually means a directory was copied. A source that moved, so that the old path no longer claims the `id`, is rebound instead. The message names both paths.
16
+
17
+ ## How to fix it
18
+
19
+ Decide which source is the artifact. In the other one, remove the `id` from the manifest (it is then bound to its own path at its first publish) or replace it with a new ID from `mostra new`.
20
+
21
+ ## Hint
22
+
23
+ Give one of the two sources a different `id`, or delete the `id` line from the copy so it becomes a new artifact.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_PUBLISH_SOURCE_CHANGED
3
+ severity: error
4
+ phase: publish
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_PUBLISH_SOURCE_CHANGED
10
+
11
+ Source changed during the publish. Severity: error. Phase: publish.
12
+
13
+ ## What it means
14
+
15
+ Publishing reads the entry's manifest twice: once to find the artifact, and again from the snapshot it builds. Mostra reports this code when the two disagree about which artifact the source is, because the manifest `id` or the source's binding changed while the publish ran, for example when an editor saved the entry mid-publish or another publish rebound the path. Nothing was published.
16
+
17
+ ## How to fix it
18
+
19
+ Wait until the files are saved and nothing else is publishing the same source, then publish again. If the manifest `id` was changed on purpose, the next publish uses the new one.
20
+
21
+ ## Hint
22
+
23
+ Publish again once the artifact's files have stopped changing.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_PUBLISH_VERIFY_FAILED
3
+ severity: error
4
+ phase: publish
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_PUBLISH_VERIFY_FAILED
10
+
11
+ Verify found errors. Severity: error. Phase: publish.
12
+
13
+ ## What it means
14
+
15
+ Publish runs verify (or reuses the verdict it cached for the same source and environment) and refuses when the verdict has errors (D41). The message lists their codes. Nothing was published. With `--force`, publish goes ahead and records the codes in the version, where hosts read them; a source that doesn't build can't be published either way.
16
+
17
+ ## How to fix it
18
+
19
+ Fix the errors `mostra verify` reports and publish again, or publish with `--force` if the version must ship as it is.
20
+
21
+ ## Hint
22
+
23
+ Run `mostra verify` to see the errors and fix them, or publish with `--force` to record them in the version.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_REGRESSION_ACTION_REMOVED
3
+ severity: warning
4
+ phase: contract
5
+ ---
6
+
7
+ <!-- Generated from packages/protocol/src/diagnostics/codes by `node tools/docs/diagnostics.ts write`. Edit the area file, not this page. -->
8
+
9
+ # MOSTRA_REGRESSION_ACTION_REMOVED
10
+
11
+ Server function gone since the last passing version. Severity: warning. Phase: contract.
12
+
13
+ ## What it means
14
+
15
+ A `"use server"` export the last passing version had is gone. Pages of the older version still call it while they are open, and keyed runs started by it can't be started again.
16
+
17
+ ## How to fix it
18
+
19
+ If it was renamed by mistake, keep its name. If it was removed on purpose, nothing needs to change.
20
+
21
+ ## Hint
22
+
23
+ Observed only: the last passing version had this server function and this source doesn't; one removed on purpose needs nothing more.