@mostra/runtime 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mostra/runtime",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "The Mostra runtime: the supervisor that owns a home, its ledger, its child processes and the host protocol server (mostra-runtime host|daemon).",
5
5
  "license": "Apache-2.0",
6
6
  "author": "The Mostra Authors",
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "@hono/node-server": "2.1.5",
38
38
  "@mdx-js/mdx": "3.1.1",
39
- "@mostra/protocol": "0.8.0",
39
+ "@mostra/protocol": "0.9.0",
40
40
  "@tailwindcss/vite": "4.3.3",
41
41
  "@vitejs/plugin-react": "6.1.2",
42
42
  "better-sqlite3": "13.0.3",
@@ -54,11 +54,11 @@
54
54
  "zod": "4.6.7"
55
55
  },
56
56
  "devDependencies": {
57
- "@mostra/shell": "0.8.0",
57
+ "@mostra/shell": "0.9.0",
58
58
  "@mostra/tools": "0.0.0",
59
- "@mostra/verify": "0.8.0",
59
+ "@mostra/verify": "0.9.0",
60
60
  "@mostra/warm": "0.0.0",
61
- "@mostra/worker": "0.8.0",
61
+ "@mostra/worker": "0.9.0",
62
62
  "@types/better-sqlite3": "9.6.0",
63
63
  "@types/node": "24.19.2",
64
64
  "@types/semver": "7.8.0",
@@ -6,6 +6,7 @@
6
6
  import type { ArtifactLink, ArtifactManifest, DeliveryStatus, Results } from "@mostra/protocol";
7
7
  import { createDiagnostic, RpcError } from "@mostra/protocol";
8
8
  import type { LedgerDb } from "../ledger/index.ts";
9
+ import { storedPolicy } from "./policy.ts";
9
10
  import {
10
11
  deliveriesOf,
11
12
  overallDelivery,
@@ -89,6 +90,19 @@ export function submissionFor(
89
90
  artifactId,
90
91
  );
91
92
  if (!row) {
93
+ if (submissionId === undefined) {
94
+ // A page whose policy in force is `none` never gets one (D63): say where its answers are,
95
+ // since waiting for a submission is refused too (#115).
96
+ const artifact = db.get<{ policy_json: string | null }>(
97
+ "SELECT policy_json FROM artifact WHERE id = ?",
98
+ artifactId,
99
+ );
100
+ if (artifact && storedPolicy(artifact.policy_json).policy === "none") {
101
+ throw notFound(
102
+ `The artifact ${artifactId} takes no submissions (its submission policy is none): what its viewers do is in its shared state and its signals, so read its state, or wait for one of its signals (signal:<name>), whose event carries the payload the page sent.`,
103
+ );
104
+ }
105
+ }
92
106
  throw notFound(
93
107
  submissionId === undefined
94
108
  ? `The artifact ${artifactId} has no submission yet.`