@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.
- package/dist/browser.d.ts +42 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +29 -1
- package/dist/browser.js.map +1 -1
- package/dist/diagnostics/codes/action.d.ts +1 -1
- package/dist/diagnostics/codes/action.d.ts.map +1 -1
- package/dist/diagnostics/codes/action.js +12 -1
- package/dist/diagnostics/codes/action.js.map +1 -1
- package/dist/diagnostics/codes/remote.d.ts +1 -1
- package/dist/diagnostics/codes/remote.d.ts.map +1 -1
- package/dist/diagnostics/codes/remote.js +78 -1
- package/dist/diagnostics/codes/remote.js.map +1 -1
- package/dist/diagnostics/codes/submit.d.ts +1 -1
- package/dist/diagnostics/codes/submit.d.ts.map +1 -1
- package/dist/diagnostics/codes/submit.js +12 -1
- package/dist/diagnostics/codes/submit.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +4 -1
- package/dist/interaction.d.ts +5 -0
- package/dist/interaction.d.ts.map +1 -1
- package/dist/interaction.js +2 -1
- package/dist/interaction.js.map +1 -1
- package/dist/methods/artifact/pause.d.ts +33 -0
- package/dist/methods/artifact/pause.d.ts.map +1 -0
- package/dist/methods/artifact/pause.js +33 -0
- package/dist/methods/artifact/pause.js.map +1 -0
- package/dist/methods/index.d.ts.map +1 -1
- package/dist/methods/index.js +7 -1
- package/dist/methods/index.js.map +1 -1
- package/dist/methods/port/relay-author.d.ts +28 -0
- package/dist/methods/port/relay-author.d.ts.map +1 -0
- package/dist/methods/port/relay-author.js +42 -0
- package/dist/methods/port/relay-author.js.map +1 -0
- package/dist/methods/remote/link.d.ts +40 -0
- package/dist/methods/remote/link.d.ts.map +1 -0
- package/dist/methods/remote/link.js +40 -0
- package/dist/methods/remote/link.js.map +1 -0
- package/dist/operator.d.ts +464 -0
- package/dist/operator.d.ts.map +1 -0
- package/dist/operator.js +134 -0
- package/dist/operator.js.map +1 -0
- package/package.json +11 -1
- package/schemas/protocol.draft-07.json +259 -0
- package/schemas/protocol.schema.json +259 -0
- package/src/browser.ts +64 -0
- package/src/diagnostics/codes/action.ts +12 -0
- package/src/diagnostics/codes/remote.ts +84 -0
- package/src/diagnostics/codes/submit.ts +12 -0
- package/src/index.ts +19 -0
- package/src/interaction.ts +6 -0
- package/src/methods/artifact/pause.ts +59 -0
- package/src/methods/index.ts +6 -0
- package/src/methods/port/relay-author.ts +57 -0
- package/src/methods/remote/link.ts +65 -0
- package/src/operator.ts +621 -0
|
@@ -55,6 +55,16 @@
|
|
|
55
55
|
"$ref": "#/$defs/ArtifactListResult"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
+
"artifact/pause": {
|
|
59
|
+
"direction": "client-to-instance",
|
|
60
|
+
"mutating": true,
|
|
61
|
+
"params": {
|
|
62
|
+
"$ref": "#/$defs/ArtifactPauseParams"
|
|
63
|
+
},
|
|
64
|
+
"result": {
|
|
65
|
+
"$ref": "#/$defs/ArtifactPauseResult"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
58
68
|
"artifact/publish": {
|
|
59
69
|
"direction": "client-to-instance",
|
|
60
70
|
"mutating": true,
|
|
@@ -253,6 +263,16 @@
|
|
|
253
263
|
"$ref": "#/$defs/PortIdentityResolveResult"
|
|
254
264
|
}
|
|
255
265
|
},
|
|
266
|
+
"port/relay.author": {
|
|
267
|
+
"direction": "instance-to-host",
|
|
268
|
+
"mutating": true,
|
|
269
|
+
"params": {
|
|
270
|
+
"$ref": "#/$defs/PortRelayAuthorParams"
|
|
271
|
+
},
|
|
272
|
+
"result": {
|
|
273
|
+
"$ref": "#/$defs/PortRelayAuthorResult"
|
|
274
|
+
}
|
|
275
|
+
},
|
|
256
276
|
"port/relay.call": {
|
|
257
277
|
"direction": "instance-to-host",
|
|
258
278
|
"mutating": false,
|
|
@@ -381,6 +401,16 @@
|
|
|
381
401
|
"$ref": "#/$defs/RelayRunUpdateResult"
|
|
382
402
|
}
|
|
383
403
|
},
|
|
404
|
+
"remote/link": {
|
|
405
|
+
"direction": "client-to-instance",
|
|
406
|
+
"mutating": false,
|
|
407
|
+
"params": {
|
|
408
|
+
"$ref": "#/$defs/RemoteLinkParams"
|
|
409
|
+
},
|
|
410
|
+
"result": {
|
|
411
|
+
"$ref": "#/$defs/RemoteLinkResult"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
384
414
|
"remote/login": {
|
|
385
415
|
"direction": "client-to-instance",
|
|
386
416
|
"mutating": true,
|
|
@@ -1120,6 +1150,47 @@
|
|
|
1120
1150
|
],
|
|
1121
1151
|
"description": "The artifact manifest (INTERFACES §2.2): literal metadata from the entry's defineArtifact call or MDX frontmatter."
|
|
1122
1152
|
},
|
|
1153
|
+
"ArtifactPauseParams": {
|
|
1154
|
+
"type": "object",
|
|
1155
|
+
"properties": {
|
|
1156
|
+
"artifact": {
|
|
1157
|
+
"$ref": "#/$defs/ArtifactRef"
|
|
1158
|
+
},
|
|
1159
|
+
"paused": {
|
|
1160
|
+
"type": "boolean"
|
|
1161
|
+
},
|
|
1162
|
+
"reason": {
|
|
1163
|
+
"type": "string",
|
|
1164
|
+
"maxLength": 500
|
|
1165
|
+
},
|
|
1166
|
+
"requestId": {
|
|
1167
|
+
"type": "string",
|
|
1168
|
+
"minLength": 1
|
|
1169
|
+
}
|
|
1170
|
+
},
|
|
1171
|
+
"required": [
|
|
1172
|
+
"artifact",
|
|
1173
|
+
"paused"
|
|
1174
|
+
]
|
|
1175
|
+
},
|
|
1176
|
+
"ArtifactPauseResult": {
|
|
1177
|
+
"type": "object",
|
|
1178
|
+
"properties": {
|
|
1179
|
+
"paused": {
|
|
1180
|
+
"type": "boolean"
|
|
1181
|
+
},
|
|
1182
|
+
"by": {
|
|
1183
|
+
"type": "string",
|
|
1184
|
+
"enum": [
|
|
1185
|
+
"owner",
|
|
1186
|
+
"operator"
|
|
1187
|
+
]
|
|
1188
|
+
}
|
|
1189
|
+
},
|
|
1190
|
+
"required": [
|
|
1191
|
+
"paused"
|
|
1192
|
+
]
|
|
1193
|
+
},
|
|
1123
1194
|
"ArtifactProgressParams": {
|
|
1124
1195
|
"type": "object",
|
|
1125
1196
|
"properties": {
|
|
@@ -2885,6 +2956,111 @@
|
|
|
2885
2956
|
"mode": {
|
|
2886
2957
|
"type": "string",
|
|
2887
2958
|
"const": "worker"
|
|
2959
|
+
},
|
|
2960
|
+
"paused": {
|
|
2961
|
+
"type": "object",
|
|
2962
|
+
"properties": {
|
|
2963
|
+
"by": {
|
|
2964
|
+
"type": "string",
|
|
2965
|
+
"enum": [
|
|
2966
|
+
"owner",
|
|
2967
|
+
"operator"
|
|
2968
|
+
]
|
|
2969
|
+
},
|
|
2970
|
+
"reason": {
|
|
2971
|
+
"type": "string",
|
|
2972
|
+
"maxLength": 500
|
|
2973
|
+
}
|
|
2974
|
+
},
|
|
2975
|
+
"required": [
|
|
2976
|
+
"by"
|
|
2977
|
+
]
|
|
2978
|
+
},
|
|
2979
|
+
"hosted": {
|
|
2980
|
+
"type": "object",
|
|
2981
|
+
"properties": {
|
|
2982
|
+
"sender": {
|
|
2983
|
+
"type": "object",
|
|
2984
|
+
"properties": {
|
|
2985
|
+
"name": {
|
|
2986
|
+
"type": "string",
|
|
2987
|
+
"maxLength": 256
|
|
2988
|
+
},
|
|
2989
|
+
"verifiedBy": {
|
|
2990
|
+
"type": "string",
|
|
2991
|
+
"maxLength": 64
|
|
2992
|
+
}
|
|
2993
|
+
},
|
|
2994
|
+
"required": [
|
|
2995
|
+
"name"
|
|
2996
|
+
]
|
|
2997
|
+
},
|
|
2998
|
+
"viewer": {
|
|
2999
|
+
"type": "object",
|
|
3000
|
+
"properties": {
|
|
3001
|
+
"kind": {
|
|
3002
|
+
"type": "string",
|
|
3003
|
+
"enum": [
|
|
3004
|
+
"account",
|
|
3005
|
+
"anonymous",
|
|
3006
|
+
"named"
|
|
3007
|
+
]
|
|
3008
|
+
},
|
|
3009
|
+
"name": {
|
|
3010
|
+
"type": "string",
|
|
3011
|
+
"maxLength": 256
|
|
3012
|
+
},
|
|
3013
|
+
"verified": {
|
|
3014
|
+
"type": "boolean"
|
|
3015
|
+
}
|
|
3016
|
+
},
|
|
3017
|
+
"required": [
|
|
3018
|
+
"kind",
|
|
3019
|
+
"verified"
|
|
3020
|
+
]
|
|
3021
|
+
},
|
|
3022
|
+
"signIn": {
|
|
3023
|
+
"type": "boolean"
|
|
3024
|
+
},
|
|
3025
|
+
"footer": {
|
|
3026
|
+
"type": "string",
|
|
3027
|
+
"maxLength": 500
|
|
3028
|
+
},
|
|
3029
|
+
"afterSubmit": {
|
|
3030
|
+
"type": "string",
|
|
3031
|
+
"maxLength": 500
|
|
3032
|
+
},
|
|
3033
|
+
"madeWith": {
|
|
3034
|
+
"type": "object",
|
|
3035
|
+
"properties": {
|
|
3036
|
+
"href": {
|
|
3037
|
+
"type": "string",
|
|
3038
|
+
"maxLength": 2048,
|
|
3039
|
+
"format": "uri"
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3042
|
+
},
|
|
3043
|
+
"interstitial": {
|
|
3044
|
+
"type": "object",
|
|
3045
|
+
"properties": {
|
|
3046
|
+
"kind": {
|
|
3047
|
+
"type": "string",
|
|
3048
|
+
"maxLength": 64
|
|
3049
|
+
},
|
|
3050
|
+
"message": {
|
|
3051
|
+
"type": "string",
|
|
3052
|
+
"maxLength": 2000
|
|
3053
|
+
}
|
|
3054
|
+
},
|
|
3055
|
+
"required": [
|
|
3056
|
+
"kind"
|
|
3057
|
+
]
|
|
3058
|
+
}
|
|
3059
|
+
},
|
|
3060
|
+
"required": [
|
|
3061
|
+
"viewer",
|
|
3062
|
+
"signIn"
|
|
3063
|
+
]
|
|
2888
3064
|
}
|
|
2889
3065
|
},
|
|
2890
3066
|
"required": [
|
|
@@ -4044,6 +4220,31 @@
|
|
|
4044
4220
|
"pattern": "^[a-z][a-zA-Z0-9]*$",
|
|
4045
4221
|
"description": "A host port name: identity, submissions, drafts, reviews, addressing, trustedControls, capture, secrets, pty, or ai (reserved). Open for later ports."
|
|
4046
4222
|
},
|
|
4223
|
+
"PortRelayAuthorParams": {
|
|
4224
|
+
"type": "object",
|
|
4225
|
+
"properties": {
|
|
4226
|
+
"method": {
|
|
4227
|
+
"type": "string",
|
|
4228
|
+
"enum": [
|
|
4229
|
+
"artifact/create",
|
|
4230
|
+
"artifact/verify",
|
|
4231
|
+
"artifact/publish",
|
|
4232
|
+
"artifact/get",
|
|
4233
|
+
"workspace/root",
|
|
4234
|
+
"workspace/allocate",
|
|
4235
|
+
"workspace/read",
|
|
4236
|
+
"workspace/apply",
|
|
4237
|
+
"verify/screenshot"
|
|
4238
|
+
]
|
|
4239
|
+
},
|
|
4240
|
+
"params": {}
|
|
4241
|
+
},
|
|
4242
|
+
"required": [
|
|
4243
|
+
"method",
|
|
4244
|
+
"params"
|
|
4245
|
+
]
|
|
4246
|
+
},
|
|
4247
|
+
"PortRelayAuthorResult": {},
|
|
4047
4248
|
"PortRelayCallParams": {
|
|
4048
4249
|
"type": "object",
|
|
4049
4250
|
"properties": {
|
|
@@ -4759,6 +4960,61 @@
|
|
|
4759
4960
|
],
|
|
4760
4961
|
"description": "One remote server this home is linked to, and the state of the link."
|
|
4761
4962
|
},
|
|
4963
|
+
"RemoteLinkParams": {
|
|
4964
|
+
"type": "object",
|
|
4965
|
+
"properties": {
|
|
4966
|
+
"server": {
|
|
4967
|
+
"$ref": "#/$defs/ServerOrigin"
|
|
4968
|
+
},
|
|
4969
|
+
"key": {
|
|
4970
|
+
"type": "string",
|
|
4971
|
+
"minLength": 20,
|
|
4972
|
+
"maxLength": 512
|
|
4973
|
+
},
|
|
4974
|
+
"default": {
|
|
4975
|
+
"type": "boolean"
|
|
4976
|
+
}
|
|
4977
|
+
},
|
|
4978
|
+
"required": [
|
|
4979
|
+
"server",
|
|
4980
|
+
"key"
|
|
4981
|
+
]
|
|
4982
|
+
},
|
|
4983
|
+
"RemoteLinkResult": {
|
|
4984
|
+
"type": "object",
|
|
4985
|
+
"properties": {
|
|
4986
|
+
"server": {
|
|
4987
|
+
"$ref": "#/$defs/ServerOrigin"
|
|
4988
|
+
},
|
|
4989
|
+
"account": {
|
|
4990
|
+
"type": "object",
|
|
4991
|
+
"properties": {
|
|
4992
|
+
"id": {
|
|
4993
|
+
"type": "string"
|
|
4994
|
+
},
|
|
4995
|
+
"name": {
|
|
4996
|
+
"type": "string"
|
|
4997
|
+
}
|
|
4998
|
+
},
|
|
4999
|
+
"required": [
|
|
5000
|
+
"id"
|
|
5001
|
+
]
|
|
5002
|
+
},
|
|
5003
|
+
"instanceId": {
|
|
5004
|
+
"type": "string"
|
|
5005
|
+
},
|
|
5006
|
+
"default": {
|
|
5007
|
+
"type": "boolean"
|
|
5008
|
+
}
|
|
5009
|
+
},
|
|
5010
|
+
"required": [
|
|
5011
|
+
"server",
|
|
5012
|
+
"account",
|
|
5013
|
+
"instanceId",
|
|
5014
|
+
"default"
|
|
5015
|
+
],
|
|
5016
|
+
"description": "A home linked to a remote server with an operator-issued key."
|
|
5017
|
+
},
|
|
4762
5018
|
"RemoteLoginParams": {
|
|
4763
5019
|
"type": "object",
|
|
4764
5020
|
"properties": {
|
|
@@ -7152,6 +7408,9 @@
|
|
|
7152
7408
|
},
|
|
7153
7409
|
"ref": {
|
|
7154
7410
|
"type": "string"
|
|
7411
|
+
},
|
|
7412
|
+
"verified": {
|
|
7413
|
+
"type": "boolean"
|
|
7155
7414
|
}
|
|
7156
7415
|
},
|
|
7157
7416
|
"required": [
|
package/src/browser.ts
CHANGED
|
@@ -237,8 +237,65 @@ export interface FrameTicket extends ViewContext {
|
|
|
237
237
|
* (D70, D158 item 5). Absent: cookie mode.
|
|
238
238
|
*/
|
|
239
239
|
readonly mode?: "worker";
|
|
240
|
+
/**
|
|
241
|
+
* The artifact is paused (D165 item 14): the shell says so, by whom and why (the reason as text);
|
|
242
|
+
* it takes no submissions and runs no actions until it is resumed (WP-30).
|
|
243
|
+
*/
|
|
244
|
+
readonly paused?: { readonly by: "owner" | "operator"; readonly reason?: string };
|
|
245
|
+
/** On a remote server: what the hosted shell's trusted chrome shows around the page (D161). */
|
|
246
|
+
readonly hosted?: HostedChrome;
|
|
240
247
|
}
|
|
241
248
|
|
|
249
|
+
/**
|
|
250
|
+
* The hosted shell's trusted chrome for one view (D161, ARCHITECTURE §15.8; WP-30). Every string an
|
|
251
|
+
* owner or operator supplies is rendered as text, never as markup.
|
|
252
|
+
*/
|
|
253
|
+
export interface HostedChrome {
|
|
254
|
+
/** Who sent the page: the owner's display name, and the provider that verified it, if any. */
|
|
255
|
+
readonly sender?: { readonly name: string; readonly verifiedBy?: string };
|
|
256
|
+
/** Who this browser is to the page: signed in as an account, or anonymous (with a chosen name). */
|
|
257
|
+
readonly viewer: {
|
|
258
|
+
readonly kind: "account" | "anonymous" | "named";
|
|
259
|
+
readonly name?: string;
|
|
260
|
+
readonly verified: boolean;
|
|
261
|
+
};
|
|
262
|
+
/** Whether "Sign in" is offered (the viewer isn't signed in, and the server has a provider). */
|
|
263
|
+
readonly signIn: boolean;
|
|
264
|
+
/** The operator's footer wording in place of the shell's own; never hidden on a public link. */
|
|
265
|
+
readonly footer?: string;
|
|
266
|
+
/** The operator's line after "Your answer was sent.". */
|
|
267
|
+
readonly afterSubmit?: string;
|
|
268
|
+
/** The made-with mark, where the operator shows one. */
|
|
269
|
+
readonly madeWith?: { readonly href?: string };
|
|
270
|
+
/** A page shown before the artifact, once per browser and link. */
|
|
271
|
+
readonly interstitial?: { readonly kind: string; readonly message?: string };
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const HostedChrome: z.ZodType<HostedChrome> = z.object({
|
|
275
|
+
sender: z
|
|
276
|
+
.object({ name: z.string().max(256), verifiedBy: z.string().max(64).exactOptional() })
|
|
277
|
+
.exactOptional(),
|
|
278
|
+
viewer: z.object({
|
|
279
|
+
kind: z.enum(["account", "anonymous", "named"]),
|
|
280
|
+
name: z.string().max(256).exactOptional(),
|
|
281
|
+
verified: z.boolean(),
|
|
282
|
+
}),
|
|
283
|
+
signIn: z.boolean(),
|
|
284
|
+
footer: z.string().max(500).exactOptional(),
|
|
285
|
+
afterSubmit: z.string().max(500).exactOptional(),
|
|
286
|
+
madeWith: z
|
|
287
|
+
.object({
|
|
288
|
+
href: z
|
|
289
|
+
.url({ protocol: /^https$/ })
|
|
290
|
+
.max(2_048)
|
|
291
|
+
.exactOptional(),
|
|
292
|
+
})
|
|
293
|
+
.exactOptional(),
|
|
294
|
+
interstitial: z
|
|
295
|
+
.object({ kind: z.string().max(64), message: z.string().max(2_000).exactOptional() })
|
|
296
|
+
.exactOptional(),
|
|
297
|
+
});
|
|
298
|
+
|
|
242
299
|
/** The Zod schema of the `FrameTicket` type. */
|
|
243
300
|
export const FrameTicket: z.ZodType<FrameTicket> = z
|
|
244
301
|
.object({
|
|
@@ -257,6 +314,13 @@ export const FrameTicket: z.ZodType<FrameTicket> = z
|
|
|
257
314
|
serverParked: z.literal(true).exactOptional(),
|
|
258
315
|
devPreview: z.literal(true).exactOptional(),
|
|
259
316
|
mode: z.literal("worker").exactOptional(),
|
|
317
|
+
paused: z
|
|
318
|
+
.object({
|
|
319
|
+
by: z.enum(["owner", "operator"]),
|
|
320
|
+
reason: z.string().max(500).exactOptional(),
|
|
321
|
+
})
|
|
322
|
+
.exactOptional(),
|
|
323
|
+
hosted: HostedChrome.exactOptional(),
|
|
260
324
|
})
|
|
261
325
|
.register(wireRegistry, {
|
|
262
326
|
id: "FrameTicket",
|
|
@@ -14,6 +14,7 @@ export const actionDiagnosticCodes = [
|
|
|
14
14
|
"MOSTRA_ACTION_TOO_LARGE",
|
|
15
15
|
"MOSTRA_ACTION_RUN_NOT_FOUND",
|
|
16
16
|
"MOSTRA_ACTION_EVENT_INVALID",
|
|
17
|
+
"MOSTRA_ACTION_PAUSED",
|
|
17
18
|
// gen:codes
|
|
18
19
|
] as const;
|
|
19
20
|
|
|
@@ -121,5 +122,16 @@ export const actionDiagnostics: AreaCatalog<ActionDiagnosticCode> = {
|
|
|
121
122
|
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.",
|
|
122
123
|
},
|
|
123
124
|
},
|
|
125
|
+
MOSTRA_ACTION_PAUSED: {
|
|
126
|
+
severity: "error",
|
|
127
|
+
phase: "host",
|
|
128
|
+
title: "Artifact paused, no actions run",
|
|
129
|
+
hint: "Wait until the page is resumed, then run the action again.",
|
|
130
|
+
docs: {
|
|
131
|
+
explanation:
|
|
132
|
+
"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.",
|
|
133
|
+
fix: "The owner resumes it with `mostra resume <artifact>`; a pause by the server's operator is resumed only by the operator.",
|
|
134
|
+
},
|
|
135
|
+
},
|
|
124
136
|
// gen:entries
|
|
125
137
|
};
|
|
@@ -13,6 +13,13 @@ export const remoteDiagnosticCodes = [
|
|
|
13
13
|
"MOSTRA_REMOTE_NOT_OWNER_INSTANCE",
|
|
14
14
|
"MOSTRA_REMOTE_SIGN_IN_REQUIRED",
|
|
15
15
|
"MOSTRA_REMOTE_RATE_LIMITED",
|
|
16
|
+
"MOSTRA_REMOTE_PAUSED_BY_OPERATOR",
|
|
17
|
+
"MOSTRA_REMOTE_LIMIT_REACHED",
|
|
18
|
+
"MOSTRA_REMOTE_OPERATOR_UNAVAILABLE",
|
|
19
|
+
"MOSTRA_REMOTE_NO_INSTANCE",
|
|
20
|
+
"MOSTRA_REMOTE_UNDER_REVIEW",
|
|
21
|
+
"MOSTRA_REMOTE_HOME_SUSPENDED",
|
|
22
|
+
"MOSTRA_REMOTE_HOME_MOVING",
|
|
16
23
|
// gen:codes
|
|
17
24
|
] as const;
|
|
18
25
|
|
|
@@ -109,5 +116,82 @@ export const remoteDiagnostics: AreaCatalog<RemoteDiagnosticCode> = {
|
|
|
109
116
|
fix: "Wait for the `Retry-After` the answer carries and try again. The limits are the server's `rateLimits` settings.",
|
|
110
117
|
},
|
|
111
118
|
},
|
|
119
|
+
MOSTRA_REMOTE_PAUSED_BY_OPERATOR: {
|
|
120
|
+
severity: "error",
|
|
121
|
+
phase: "host",
|
|
122
|
+
title: "Paused by the server's operator",
|
|
123
|
+
hint: "Contact the server's operator: only the operator resumes a pause it made.",
|
|
124
|
+
docs: {
|
|
125
|
+
explanation:
|
|
126
|
+
"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.",
|
|
127
|
+
fix: "Ask the server's operator why it was paused and to resume it.",
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
MOSTRA_REMOTE_LIMIT_REACHED: {
|
|
131
|
+
severity: "error",
|
|
132
|
+
phase: "host",
|
|
133
|
+
title: "The server's limit refused this",
|
|
134
|
+
hint: "Read the message for the server's limit, and try again once it allows the operation.",
|
|
135
|
+
docs: {
|
|
136
|
+
explanation:
|
|
137
|
+
"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.",
|
|
138
|
+
fix: "Follow the operator's message; its `Retry-After`, when present, says when to try again.",
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
MOSTRA_REMOTE_OPERATOR_UNAVAILABLE: {
|
|
142
|
+
severity: "error",
|
|
143
|
+
phase: "host",
|
|
144
|
+
title: "The server's operator didn't answer",
|
|
145
|
+
hint: "Try again in a moment; the server's operator didn't answer in time.",
|
|
146
|
+
docs: {
|
|
147
|
+
explanation:
|
|
148
|
+
"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.",
|
|
149
|
+
fix: "Try again; if it lasts, the server's operator has to fix its operator module.",
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
MOSTRA_REMOTE_NO_INSTANCE: {
|
|
153
|
+
severity: "error",
|
|
154
|
+
phase: "host",
|
|
155
|
+
title: "No owner instance connected",
|
|
156
|
+
hint: "Start Mostra on the machine linked to this account (mostra daemon start), then try again.",
|
|
157
|
+
docs: {
|
|
158
|
+
explanation:
|
|
159
|
+
"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.",
|
|
160
|
+
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`.",
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
MOSTRA_REMOTE_UNDER_REVIEW: {
|
|
164
|
+
severity: "error",
|
|
165
|
+
phase: "host",
|
|
166
|
+
title: "This page is under review",
|
|
167
|
+
hint: "Nothing to do here: the server's operator is reviewing this page.",
|
|
168
|
+
docs: {
|
|
169
|
+
explanation:
|
|
170
|
+
"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.",
|
|
171
|
+
fix: "The owner can ask the server's operator about the review.",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
MOSTRA_REMOTE_HOME_SUSPENDED: {
|
|
175
|
+
severity: "error",
|
|
176
|
+
phase: "host",
|
|
177
|
+
title: "This account's pages are suspended",
|
|
178
|
+
hint: "Contact the server's operator: this account's pages are suspended.",
|
|
179
|
+
docs: {
|
|
180
|
+
explanation:
|
|
181
|
+
"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.",
|
|
182
|
+
fix: "Ask the server's operator to resume the account.",
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
MOSTRA_REMOTE_HOME_MOVING: {
|
|
186
|
+
severity: "error",
|
|
187
|
+
phase: "host",
|
|
188
|
+
title: "This account's pages are moving",
|
|
189
|
+
hint: "Try again in a minute: this account's pages are moving between machines.",
|
|
190
|
+
docs: {
|
|
191
|
+
explanation:
|
|
192
|
+
"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.",
|
|
193
|
+
fix: "Retry shortly; the move ends when the operator releases the home on its new machine.",
|
|
194
|
+
},
|
|
195
|
+
},
|
|
112
196
|
// gen:entries
|
|
113
197
|
};
|
|
@@ -13,6 +13,7 @@ export const submitDiagnosticCodes = [
|
|
|
13
13
|
"MOSTRA_SUBMIT_SIGNAL_INVALID",
|
|
14
14
|
"MOSTRA_SUBMIT_CHANNEL_DENIED",
|
|
15
15
|
"MOSTRA_SUBMIT_BLOCKED",
|
|
16
|
+
"MOSTRA_SUBMIT_PAUSED",
|
|
16
17
|
// gen:codes
|
|
17
18
|
] as const;
|
|
18
19
|
|
|
@@ -109,5 +110,16 @@ export const submitDiagnostics: AreaCatalog<SubmitDiagnosticCode> = {
|
|
|
109
110
|
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.",
|
|
110
111
|
},
|
|
111
112
|
},
|
|
113
|
+
MOSTRA_SUBMIT_PAUSED: {
|
|
114
|
+
severity: "error",
|
|
115
|
+
phase: "host",
|
|
116
|
+
title: "Artifact paused, no answers taken",
|
|
117
|
+
hint: "Wait until the page is resumed, then submit again; the draft is kept.",
|
|
118
|
+
docs: {
|
|
119
|
+
explanation:
|
|
120
|
+
"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.",
|
|
121
|
+
fix: "The owner resumes it with `mostra resume <artifact>`; a pause by the server's operator is resumed only by the operator.",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
112
124
|
// gen:entries
|
|
113
125
|
};
|
package/src/index.ts
CHANGED
|
@@ -105,6 +105,7 @@ export {
|
|
|
105
105
|
FRAME_SESSION_HEADER,
|
|
106
106
|
FrameSessionFacts,
|
|
107
107
|
FrameTicket,
|
|
108
|
+
type HostedChrome,
|
|
108
109
|
OrphanedField,
|
|
109
110
|
PollResult,
|
|
110
111
|
REVIEW_SET_ID_PATTERN,
|
|
@@ -338,6 +339,12 @@ export {
|
|
|
338
339
|
type ArtifactListResult,
|
|
339
340
|
artifactListMethod,
|
|
340
341
|
} from "./methods/artifact/list.ts";
|
|
342
|
+
export {
|
|
343
|
+
type ArtifactPauseParams,
|
|
344
|
+
type ArtifactPauseResult,
|
|
345
|
+
artifactPauseMethod,
|
|
346
|
+
type PausedBy,
|
|
347
|
+
} from "./methods/artifact/pause.ts";
|
|
341
348
|
export {
|
|
342
349
|
type ArtifactPublishParams,
|
|
343
350
|
type ArtifactPublishResult,
|
|
@@ -462,6 +469,13 @@ export {
|
|
|
462
469
|
type PortIdentityResolveResult,
|
|
463
470
|
portIdentityResolveMethod,
|
|
464
471
|
} from "./methods/port/identity-resolve.ts";
|
|
472
|
+
export {
|
|
473
|
+
type PortRelayAuthorParams,
|
|
474
|
+
type PortRelayAuthorResult,
|
|
475
|
+
portRelayAuthorMethod,
|
|
476
|
+
RELAY_AUTHOR_METHODS,
|
|
477
|
+
type RelayAuthorMethod,
|
|
478
|
+
} from "./methods/port/relay-author.ts";
|
|
465
479
|
export {
|
|
466
480
|
type PortRelayCallParams,
|
|
467
481
|
type PortRelayCallResult,
|
|
@@ -531,6 +545,11 @@ export {
|
|
|
531
545
|
type RelayRunUpdateResult,
|
|
532
546
|
relayRunUpdateMethod,
|
|
533
547
|
} from "./methods/relay/run-update.ts";
|
|
548
|
+
export {
|
|
549
|
+
type RemoteLinkParams,
|
|
550
|
+
type RemoteLinkResult,
|
|
551
|
+
remoteLinkMethod,
|
|
552
|
+
} from "./methods/remote/link.ts";
|
|
534
553
|
export {
|
|
535
554
|
type RemoteLoginParams,
|
|
536
555
|
type RemoteLoginResult,
|
package/src/interaction.ts
CHANGED
|
@@ -42,6 +42,11 @@ export interface Viewer {
|
|
|
42
42
|
readonly name?: string;
|
|
43
43
|
/** The host's own key for this person, as given to `view/url` (D104). */
|
|
44
44
|
readonly ref?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Whether an identity provider verified the name: `true` for a signed-in account, `false` for an
|
|
47
|
+
* anonymous viewer's self-chosen name (hosted links, D165 item 8). Absent for other kinds.
|
|
48
|
+
*/
|
|
49
|
+
readonly verified?: boolean;
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
/** The Zod schema of the `Viewer` type. */
|
|
@@ -51,6 +56,7 @@ export const Viewer: z.ZodType<Viewer> = z
|
|
|
51
56
|
kind: z.enum(["local", "tailnet", "token", "host", "account", "anonymous"]),
|
|
52
57
|
name: z.string().exactOptional(),
|
|
53
58
|
ref: z.string().exactOptional(),
|
|
59
|
+
verified: z.boolean().exactOptional(),
|
|
54
60
|
})
|
|
55
61
|
.register(wireRegistry, {
|
|
56
62
|
id: "Viewer",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { ArtifactRef } from "../../artifact.ts";
|
|
3
|
+
import { defineMethod, type MethodDefinition } from "../../method.ts";
|
|
4
|
+
import { wireRegistry } from "../../wire-registry.ts";
|
|
5
|
+
|
|
6
|
+
/** Who paused an artifact (D165 item 14). */
|
|
7
|
+
export type PausedBy = "owner" | "operator";
|
|
8
|
+
|
|
9
|
+
/** The params of `artifact/pause` (INTERFACES §18.2, D165 item 14). */
|
|
10
|
+
export interface ArtifactPauseParams {
|
|
11
|
+
/** The artifact to pause or resume. */
|
|
12
|
+
readonly artifact: ArtifactRef;
|
|
13
|
+
/** `true` pauses it, `false` resumes it. */
|
|
14
|
+
readonly paused: boolean;
|
|
15
|
+
/** Why, shown to viewers as text while it is paused. */
|
|
16
|
+
readonly reason?: string;
|
|
17
|
+
/** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */
|
|
18
|
+
readonly requestId?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The result of `artifact/pause`: whether the artifact is paused now, and by whom. */
|
|
22
|
+
export interface ArtifactPauseResult {
|
|
23
|
+
/** Whether it is paused after the call. */
|
|
24
|
+
readonly paused: boolean;
|
|
25
|
+
/** Who paused it, while it is paused. */
|
|
26
|
+
readonly by?: PausedBy;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const params: z.ZodType<ArtifactPauseParams> = z
|
|
30
|
+
.object({
|
|
31
|
+
artifact: ArtifactRef,
|
|
32
|
+
paused: z.boolean(),
|
|
33
|
+
reason: z.string().max(500).exactOptional(),
|
|
34
|
+
requestId: z.string().min(1).exactOptional(),
|
|
35
|
+
})
|
|
36
|
+
.register(wireRegistry, { id: "ArtifactPauseParams" });
|
|
37
|
+
|
|
38
|
+
const result: z.ZodType<ArtifactPauseResult> = z
|
|
39
|
+
.object({
|
|
40
|
+
paused: z.boolean(),
|
|
41
|
+
by: z.enum(["owner", "operator"]).exactOptional(),
|
|
42
|
+
})
|
|
43
|
+
.register(wireRegistry, { id: "ArtifactPauseResult" });
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* `artifact/pause`: pauses or resumes an artifact. While paused it stays viewable and its shell
|
|
47
|
+
* says so; submissions answer 423 `MOSTRA_SUBMIT_PAUSED` and actions 423 `MOSTRA_ACTION_PAUSED`,
|
|
48
|
+
* each keeping the draft; links stay valid. On an owner instance it acts on the local artifact and,
|
|
49
|
+
* for a hosted one, on every server it is hosted on. An operator's pause can't be resumed by the
|
|
50
|
+
* owner (`MOSTRA_REMOTE_PAUSED_BY_OPERATOR`).
|
|
51
|
+
*/
|
|
52
|
+
export const artifactPauseMethod: MethodDefinition<ArtifactPauseParams, ArtifactPauseResult> =
|
|
53
|
+
defineMethod({
|
|
54
|
+
method: "artifact/pause",
|
|
55
|
+
direction: "client-to-instance",
|
|
56
|
+
mutating: true,
|
|
57
|
+
params,
|
|
58
|
+
result,
|
|
59
|
+
});
|