@mostra/cli 0.9.0 → 0.10.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 (45) hide show
  1. package/dist/bin.js +2 -2
  2. package/dist/bootstrap-BStzS_41.js +1 -0
  3. package/dist/{bootstrap-Dc-SQHRF.js → bootstrap-_iCl_HaO.js} +3 -2
  4. package/dist/bootstrap-_iCl_HaO.js.map +1 -0
  5. package/dist/{flush-C16w3JL8.js → flush-znWmNZA1.js} +11 -3
  6. package/dist/flush-znWmNZA1.js.map +1 -0
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +2 -2
  10. package/dist/reference/cli.md +144 -4
  11. package/dist/reference/diagnostics.json +90 -0
  12. package/dist/reference/errors/MOSTRA_ARTIFACT_BUNDLE_INVALID.md +23 -0
  13. package/dist/reference/errors/MOSTRA_HOME_NETWORK_FILESYSTEM.md +23 -0
  14. package/dist/reference/errors/MOSTRA_REMOTE_CONFIG_INVALID.md +23 -0
  15. package/dist/reference/errors/MOSTRA_REMOTE_LOGIN_FAILED.md +23 -0
  16. package/dist/reference/errors/MOSTRA_REMOTE_NOT_OWNER_INSTANCE.md +23 -0
  17. package/dist/reference/errors/MOSTRA_REMOTE_OWNER_OFFLINE.md +23 -0
  18. package/dist/reference/errors/MOSTRA_REMOTE_QUEUE_FULL.md +23 -0
  19. package/dist/reference/errors/MOSTRA_REMOTE_RATE_LIMITED.md +23 -0
  20. package/dist/reference/errors/MOSTRA_REMOTE_SIGN_IN_REQUIRED.md +23 -0
  21. package/dist/reference/errors/MOSTRA_REMOTE_UNREACHABLE.md +23 -0
  22. package/dist/{run-DdYT3iHQ.js → run-Aq4HVIY0.js} +234 -15
  23. package/dist/run-Aq4HVIY0.js.map +1 -0
  24. package/dist/run-D1U_RFEP.js +1 -0
  25. package/dist/skill/SKILL.md +3 -3
  26. package/dist/skill/references/answers.md +36 -0
  27. package/dist/skill/references/mcp.md +3 -3
  28. package/dist/skill/references/sharing.md +54 -4
  29. package/dist/telemetry/flush-main.js +1 -1
  30. package/package.json +5 -5
  31. package/src/client.ts +1 -1
  32. package/src/commands/admin.ts +11 -1
  33. package/src/commands/authoring.ts +85 -3
  34. package/src/commands/index.ts +16 -3
  35. package/src/commands/remote.ts +113 -0
  36. package/src/commands/sharing.ts +33 -6
  37. package/src/commands/viewing.ts +20 -2
  38. package/src/detached.ts +2 -0
  39. package/src/exit.ts +2 -0
  40. package/src/telemetry/store.ts +15 -4
  41. package/dist/bootstrap-Dc-SQHRF.js.map +0 -1
  42. package/dist/bootstrap-aaE5wFo9.js +0 -1
  43. package/dist/flush-C16w3JL8.js.map +0 -1
  44. package/dist/run-Bw4_6kcW.js +0 -1
  45. package/dist/run-DdYT3iHQ.js.map +0 -1
@@ -99,6 +99,15 @@
99
99
  "explanation": "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.",
100
100
  "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."
101
101
  },
102
+ {
103
+ "code": "MOSTRA_ARTIFACT_BUNDLE_INVALID",
104
+ "severity": "error",
105
+ "phase": "host",
106
+ "title": "Not a bundle this version can import",
107
+ "hint": "Export the bundle again with `mostra export <artifact> --as bundle`, and import the files it wrote unchanged.",
108
+ "explanation": "Importing a bundle checks it before it keeps anything: its `mostra-bundle.json`, that its version ID is the one its artifact ID and digests give, and that its builds and source snapshot have the digests it records. This bundle failed one of those checks, so a file was changed, lost or added after it was exported, or it isn't a bundle Mostra wrote.",
109
+ "fix": "Export the version again from the home that published it, and copy the bundle's directory or archive whole."
110
+ },
102
111
  {
103
112
  "code": "MOSTRA_ARTIFACT_DIR_NOT_EMPTY",
104
113
  "severity": "error",
@@ -612,6 +621,15 @@
612
621
  "explanation": "A client sent `home.path` in `mostra/initialize`, and it names a different home from the one the instance locked at start-up. The home is chosen when the instance starts (`--home`, then `MOSTRA_HOME`, then the platform default), so `home.path` is a check: it stops a client from writing to a home it didn't mean.",
613
622
  "fix": "Start the instance with `--home` set to the home the client expects, or connect to the socket of the instance that serves it. Leave `home.path` out to accept whichever home the instance serves."
614
623
  },
624
+ {
625
+ "code": "MOSTRA_HOME_NETWORK_FILESYSTEM",
626
+ "severity": "error",
627
+ "phase": "host",
628
+ "title": "Data directory on a network filesystem",
629
+ "hint": "Put the server's data directory on a local disk.",
630
+ "explanation": "A remote server's data directory holds its hosted homes' ledgers and locks, which need a local disk: on a network filesystem a lock can seem held by two machines at once, and SQLite's WAL can't share memory across them (D165 item 0b). The server refuses a data directory it detects on NFS, SMB, AFP, WebDAV or a FUSE mount, before it opens anything.",
631
+ "fix": "Pass `--data` a directory on a local disk. To keep a copy elsewhere, replicate the homes with a backup tool instead."
632
+ },
615
633
  {
616
634
  "code": "MOSTRA_HOME_NOT_ALWAYS_ON",
617
635
  "severity": "warning",
@@ -1071,6 +1089,78 @@
1071
1089
  "explanation": "Verify rendered the newest version whose verdict passed and this source at the same viewport, clock and data, and the share of pixels the message gives differs between them. Any intended visual change shows here too.",
1072
1090
  "fix": "If the change is one you made on purpose, nothing needs to change. To see where it is, read the ARIA snapshots, or look at the diff image the message names if you can view images."
1073
1091
  },
1092
+ {
1093
+ "code": "MOSTRA_REMOTE_CONFIG_INVALID",
1094
+ "severity": "error",
1095
+ "phase": "host",
1096
+ "title": "Remote server configuration can't be used",
1097
+ "hint": "Fix the configuration key the message names, then start mostra-runtime server again.",
1098
+ "explanation": "`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.",
1099
+ "fix": "Correct the key the message names: `apiOrigin` must be an `https:` origin (or `http:` on loopback), and `domains.active` a host name."
1100
+ },
1101
+ {
1102
+ "code": "MOSTRA_REMOTE_LOGIN_FAILED",
1103
+ "severity": "error",
1104
+ "phase": "host",
1105
+ "title": "Signing in to a remote server failed",
1106
+ "hint": "Run mostra login again, and approve the code on the server's page within ten minutes.",
1107
+ "explanation": "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.",
1108
+ "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."
1109
+ },
1110
+ {
1111
+ "code": "MOSTRA_REMOTE_NOT_OWNER_INSTANCE",
1112
+ "severity": "error",
1113
+ "phase": "host",
1114
+ "title": "Another instance owns this hosted artifact",
1115
+ "hint": "Share or push this artifact from its owner instance, named in the message.",
1116
+ "explanation": "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.",
1117
+ "fix": "Run the command on the instance the message names. Moving an artifact to another owner instance isn't part of this release."
1118
+ },
1119
+ {
1120
+ "code": "MOSTRA_REMOTE_OWNER_OFFLINE",
1121
+ "severity": "error",
1122
+ "phase": "host",
1123
+ "title": "The artifact's owner instance is offline",
1124
+ "hint": "Start Mostra on the machine that shared the page, or try again once it is back.",
1125
+ "explanation": "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.",
1126
+ "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\"`."
1127
+ },
1128
+ {
1129
+ "code": "MOSTRA_REMOTE_QUEUE_FULL",
1130
+ "severity": "error",
1131
+ "phase": "host",
1132
+ "title": "Too many runs wait for the owner",
1133
+ "hint": "Wait for the owner to come back and work through its queue, then press again.",
1134
+ "explanation": "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.",
1135
+ "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."
1136
+ },
1137
+ {
1138
+ "code": "MOSTRA_REMOTE_RATE_LIMITED",
1139
+ "severity": "error",
1140
+ "phase": "host",
1141
+ "title": "Too many requests on this link",
1142
+ "hint": "Try again after the time the answer's Retry-After gives.",
1143
+ "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.",
1144
+ "fix": "Wait for the `Retry-After` the answer carries and try again. The limits are the server's `rateLimits` settings."
1145
+ },
1146
+ {
1147
+ "code": "MOSTRA_REMOTE_SIGN_IN_REQUIRED",
1148
+ "severity": "error",
1149
+ "phase": "host",
1150
+ "title": "This action needs a signed-in viewer",
1151
+ "hint": "Sign in from the page's chrome, or have the owner allow this for anyone with the link.",
1152
+ "explanation": "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.",
1153
+ "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)."
1154
+ },
1155
+ {
1156
+ "code": "MOSTRA_REMOTE_UNREACHABLE",
1157
+ "severity": "error",
1158
+ "phase": "host",
1159
+ "title": "The remote server can't be reached",
1160
+ "hint": "Check the network and the server's address, then try again; mostra status shows the link.",
1161
+ "explanation": "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.",
1162
+ "fix": "Run `mostra status` to see each server's link. When the server is back the link reconnects by itself; then write again."
1163
+ },
1074
1164
  {
1075
1165
  "code": "MOSTRA_RUNTIME_BLANK",
1076
1166
  "severity": "error",
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_ARTIFACT_BUNDLE_INVALID
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_ARTIFACT_BUNDLE_INVALID
10
+
11
+ Not a bundle this version can import. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ Importing a bundle checks it before it keeps anything: its `mostra-bundle.json`, that its version ID is the one its artifact ID and digests give, and that its builds and source snapshot have the digests it records. This bundle failed one of those checks, so a file was changed, lost or added after it was exported, or it isn't a bundle Mostra wrote.
16
+
17
+ ## How to fix it
18
+
19
+ Export the version again from the home that published it, and copy the bundle's directory or archive whole.
20
+
21
+ ## Hint
22
+
23
+ Export the bundle again with `mostra export <artifact> --as bundle`, and import the files it wrote unchanged.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_HOME_NETWORK_FILESYSTEM
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_HOME_NETWORK_FILESYSTEM
10
+
11
+ Data directory on a network filesystem. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ A remote server's data directory holds its hosted homes' ledgers and locks, which need a local disk: on a network filesystem a lock can seem held by two machines at once, and SQLite's WAL can't share memory across them (D165 item 0b). The server refuses a data directory it detects on NFS, SMB, AFP, WebDAV or a FUSE mount, before it opens anything.
16
+
17
+ ## How to fix it
18
+
19
+ Pass `--data` a directory on a local disk. To keep a copy elsewhere, replicate the homes with a backup tool instead.
20
+
21
+ ## Hint
22
+
23
+ Put the server's data directory on a local disk.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_REMOTE_CONFIG_INVALID
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_REMOTE_CONFIG_INVALID
10
+
11
+ Remote server configuration can't be used. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ `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.
16
+
17
+ ## How to fix it
18
+
19
+ Correct the key the message names: `apiOrigin` must be an `https:` origin (or `http:` on loopback), and `domains.active` a host name.
20
+
21
+ ## Hint
22
+
23
+ Fix the configuration key the message names, then start mostra-runtime server again.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_REMOTE_LOGIN_FAILED
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_REMOTE_LOGIN_FAILED
10
+
11
+ Signing in to a remote server failed. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ 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.
16
+
17
+ ## How to fix it
18
+
19
+ 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.
20
+
21
+ ## Hint
22
+
23
+ Run mostra login again, and approve the code on the server's page within ten minutes.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_REMOTE_NOT_OWNER_INSTANCE
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_REMOTE_NOT_OWNER_INSTANCE
10
+
11
+ Another instance owns this hosted artifact. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ 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.
16
+
17
+ ## How to fix it
18
+
19
+ Run the command on the instance the message names. Moving an artifact to another owner instance isn't part of this release.
20
+
21
+ ## Hint
22
+
23
+ Share or push this artifact from its owner instance, named in the message.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_REMOTE_OWNER_OFFLINE
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_REMOTE_OWNER_OFFLINE
10
+
11
+ The artifact's owner instance is offline. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ 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.
16
+
17
+ ## How to fix it
18
+
19
+ 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"`.
20
+
21
+ ## Hint
22
+
23
+ Start Mostra on the machine that shared the page, or try again once it is back.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_REMOTE_QUEUE_FULL
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_REMOTE_QUEUE_FULL
10
+
11
+ Too many runs wait for the owner. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ 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.
16
+
17
+ ## How to fix it
18
+
19
+ 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.
20
+
21
+ ## Hint
22
+
23
+ Wait for the owner to come back and work through its queue, then press again.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_REMOTE_RATE_LIMITED
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_REMOTE_RATE_LIMITED
10
+
11
+ Too many requests on this link. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ 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.
16
+
17
+ ## How to fix it
18
+
19
+ Wait for the `Retry-After` the answer carries and try again. The limits are the server's `rateLimits` settings.
20
+
21
+ ## Hint
22
+
23
+ Try again after the time the answer's Retry-After gives.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_REMOTE_SIGN_IN_REQUIRED
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_REMOTE_SIGN_IN_REQUIRED
10
+
11
+ This action needs a signed-in viewer. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ 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.
16
+
17
+ ## How to fix it
18
+
19
+ 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).
20
+
21
+ ## Hint
22
+
23
+ Sign in from the page's chrome, or have the owner allow this for anyone with the link.
@@ -0,0 +1,23 @@
1
+ ---
2
+ code: MOSTRA_REMOTE_UNREACHABLE
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_REMOTE_UNREACHABLE
10
+
11
+ The remote server can't be reached. Severity: error. Phase: host.
12
+
13
+ ## What it means
14
+
15
+ 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.
16
+
17
+ ## How to fix it
18
+
19
+ Run `mostra status` to see each server's link. When the server is back the link reconnects by itself; then write again.
20
+
21
+ ## Hint
22
+
23
+ Check the network and the server's address, then try again; mostra status shows the link.