@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
package/dist/operator.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
//#region src/operator.ts
|
|
3
|
+
/**
|
|
4
|
+
* The operator boundary of a remote server (ARCHITECTURE §15.10, INTERFACES §18.6, D165 items 9
|
|
5
|
+
* and 11): the ports an operating layer implements in an ES module the server loads in process,
|
|
6
|
+
* and the handle the server gives it. Each port is optional and has a no-op default, so a
|
|
7
|
+
* self-hoster needs none of it; each call is async and time-limited, and the server checks every
|
|
8
|
+
* answer against the schemas below before it acts on one (an answer they refuse counts as no
|
|
9
|
+
* answer).
|
|
10
|
+
*
|
|
11
|
+
* An operating layer imports nothing of Mostra but this module (`@mostra/protocol/operator`), so
|
|
12
|
+
* the surface it builds on is this file's, versioned with `@mostra/protocol` and changed only
|
|
13
|
+
* additively (D32).
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { defineOperator } from "@mostra/protocol/operator";
|
|
17
|
+
*
|
|
18
|
+
* export default defineOperator((server) => ({
|
|
19
|
+
* limits: { check: async (q) => (q.operation === "share" ? { allowed: true } : { allowed: true }) },
|
|
20
|
+
* abuse: { report: async (r) => { await server.quarantine({ routeId: r.routeId }, r.reason); } },
|
|
21
|
+
* }));
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* Every port call and every handle target names a hosted route (`rte_…`): an artifact ID, and a
|
|
25
|
+
* version ID derived from it (D89), repeat across homes when a project is copied, so a bare ID
|
|
26
|
+
* would reach every tenant hosting it.
|
|
27
|
+
*/
|
|
28
|
+
/** The operator boundary's own revision, which a module may check (additive within it). */
|
|
29
|
+
const OPERATOR_REVISION = "2026-11-08";
|
|
30
|
+
/** How long the server waits for each port, in milliseconds, before it acts as if none answered. */
|
|
31
|
+
const OPERATOR_TIME_LIMITS = {
|
|
32
|
+
limits: 2e3,
|
|
33
|
+
policy: 2e3,
|
|
34
|
+
routing: 2e3,
|
|
35
|
+
identity: 2e3,
|
|
36
|
+
accounts: 5e3,
|
|
37
|
+
authenticate: 5e3,
|
|
38
|
+
pushed: 3e4,
|
|
39
|
+
outbound: 3e4
|
|
40
|
+
};
|
|
41
|
+
const cacheFor = z.int().min(0).max(864e5).exactOptional();
|
|
42
|
+
/** The schema the server checks `limits.check`'s answer against. */
|
|
43
|
+
const LimitAnswer = z.union([z.object({
|
|
44
|
+
allowed: z.literal(true),
|
|
45
|
+
cacheForMs: cacheFor
|
|
46
|
+
}), z.object({
|
|
47
|
+
allowed: z.literal(false),
|
|
48
|
+
code: z.string().min(1).max(128),
|
|
49
|
+
message: z.string().max(1e3),
|
|
50
|
+
retryAfterMs: z.int().min(0).max(864e5).exactOptional(),
|
|
51
|
+
cacheForMs: cacheFor
|
|
52
|
+
})]);
|
|
53
|
+
/** The schema the server checks a provider's `SignInIdentity` against. */
|
|
54
|
+
const SignInIdentity = z.object({
|
|
55
|
+
provider: z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),
|
|
56
|
+
subject: z.string().min(1).max(256),
|
|
57
|
+
email: z.string().max(320).exactOptional(),
|
|
58
|
+
emailVerified: z.boolean().exactOptional(),
|
|
59
|
+
name: z.string().max(256).exactOptional(),
|
|
60
|
+
facts: z.record(z.string(), z.unknown()).exactOptional()
|
|
61
|
+
});
|
|
62
|
+
/** The schema the server checks `accounts.resolve`'s answer against. */
|
|
63
|
+
const AccountResolution = z.union([
|
|
64
|
+
z.object({
|
|
65
|
+
account: z.string().min(1).max(128),
|
|
66
|
+
name: z.string().max(256).exactOptional(),
|
|
67
|
+
status: z.enum(["active", "suspended"])
|
|
68
|
+
}),
|
|
69
|
+
z.object({ step: z.object({ url: z.url({ protocol: /^https$/ }).max(2048) }) }),
|
|
70
|
+
z.object({ refused: z.object({ message: z.string().max(1e3) }) })
|
|
71
|
+
]);
|
|
72
|
+
/** The schema the server checks `accounts.authenticate`'s answer against. */
|
|
73
|
+
const AuthenticatedCredential = z.object({
|
|
74
|
+
account: z.string().min(1).max(128),
|
|
75
|
+
scope: z.array(z.string().max(64)).max(32),
|
|
76
|
+
subject: z.string().regex(/^[A-Za-z0-9._:-]{1,128}$/).exactOptional()
|
|
77
|
+
}).nullable();
|
|
78
|
+
/** The schema the server checks `abuse.pushed`'s answer against. */
|
|
79
|
+
const PushedAnswer = z.object({ quarantine: z.object({ reason: z.string().max(1e3) }).exactOptional() }).optional();
|
|
80
|
+
const duration = z.string().regex(/^[1-9][0-9]{0,8}[smhd]$/);
|
|
81
|
+
/** The schema the server checks `policy.link`'s answer against. */
|
|
82
|
+
const LinkPolicy = z.object({
|
|
83
|
+
interstitial: z.object({
|
|
84
|
+
kind: z.string().min(1).max(64),
|
|
85
|
+
message: z.string().max(2e3).exactOptional()
|
|
86
|
+
}).exactOptional(),
|
|
87
|
+
maxTtl: duration.exactOptional(),
|
|
88
|
+
idleExpiry: duration.exactOptional(),
|
|
89
|
+
afterSubmit: z.string().max(500).exactOptional(),
|
|
90
|
+
footer: z.string().min(1).max(500).exactOptional(),
|
|
91
|
+
madeWith: z.object({
|
|
92
|
+
show: z.boolean(),
|
|
93
|
+
href: z.url({ protocol: /^https$/ }).exactOptional()
|
|
94
|
+
}).exactOptional(),
|
|
95
|
+
cacheForMs: cacheFor
|
|
96
|
+
});
|
|
97
|
+
/** The schema of the `ChatHostPolicy` type, for configuration and `policy.chatHost`. */
|
|
98
|
+
const ChatHostPolicy = z.object({
|
|
99
|
+
render: z.enum(["app", "link"]).exactOptional(),
|
|
100
|
+
quota: z.enum(["limit-reached", "message"]).exactOptional()
|
|
101
|
+
});
|
|
102
|
+
/**
|
|
103
|
+
* A host name of at least two labels, lower case; a port only as a local test server's hosts carry
|
|
104
|
+
* one (the server's own configuration allows the same).
|
|
105
|
+
*/
|
|
106
|
+
const hostName = z.string().regex(/^(?=.{1,253}(:|$))[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+(:\d{1,5})?$/);
|
|
107
|
+
/** The schema the server checks `routing.resolve`'s answer against. */
|
|
108
|
+
const RoutingAnswer = z.union([
|
|
109
|
+
z.object({
|
|
110
|
+
shell: z.object({
|
|
111
|
+
domain: hostName,
|
|
112
|
+
home: z.string().min(1)
|
|
113
|
+
}),
|
|
114
|
+
cacheForMs: cacheFor
|
|
115
|
+
}),
|
|
116
|
+
z.object({
|
|
117
|
+
route: z.object({
|
|
118
|
+
home: z.string().min(1),
|
|
119
|
+
routeId: z.string().min(1)
|
|
120
|
+
}),
|
|
121
|
+
cacheForMs: cacheFor
|
|
122
|
+
}),
|
|
123
|
+
z.null()
|
|
124
|
+
]);
|
|
125
|
+
/** The schema of `routing.linkHost`'s answer: a shell host, or `null` for the active domain. */
|
|
126
|
+
const LinkHost = hostName.nullable();
|
|
127
|
+
/** Types an operator module's default export; returns it unchanged. */
|
|
128
|
+
function defineOperator(module) {
|
|
129
|
+
return module;
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
export { AccountResolution, AuthenticatedCredential, ChatHostPolicy, LimitAnswer, LinkHost, LinkPolicy, OPERATOR_REVISION, OPERATOR_TIME_LIMITS, PushedAnswer, RoutingAnswer, SignInIdentity, defineOperator };
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator.js","names":[],"sources":["../src/operator.ts"],"sourcesContent":["/**\n * The operator boundary of a remote server (ARCHITECTURE §15.10, INTERFACES §18.6, D165 items 9\n * and 11): the ports an operating layer implements in an ES module the server loads in process,\n * and the handle the server gives it. Each port is optional and has a no-op default, so a\n * self-hoster needs none of it; each call is async and time-limited, and the server checks every\n * answer against the schemas below before it acts on one (an answer they refuse counts as no\n * answer).\n *\n * An operating layer imports nothing of Mostra but this module (`@mostra/protocol/operator`), so\n * the surface it builds on is this file's, versioned with `@mostra/protocol` and changed only\n * additively (D32).\n *\n * ```ts\n * import { defineOperator } from \"@mostra/protocol/operator\";\n *\n * export default defineOperator((server) => ({\n * limits: { check: async (q) => (q.operation === \"share\" ? { allowed: true } : { allowed: true }) },\n * abuse: { report: async (r) => { await server.quarantine({ routeId: r.routeId }, r.reason); } },\n * }));\n * ```\n *\n * Every port call and every handle target names a hosted route (`rte_…`): an artifact ID, and a\n * version ID derived from it (D89), repeat across homes when a project is copied, so a bare ID\n * would reach every tenant hosting it.\n */\nimport * as z from \"zod\";\n\n/** The operator boundary's own revision, which a module may check (additive within it). */\nexport const OPERATOR_REVISION = \"2026-11-08\";\n\n/** How long the server waits for each port, in milliseconds, before it acts as if none answered. */\nexport const OPERATOR_TIME_LIMITS: {\n readonly limits: number;\n readonly policy: number;\n readonly routing: number;\n readonly identity: number;\n readonly accounts: number;\n readonly authenticate: number;\n readonly pushed: number;\n readonly outbound: number;\n} = {\n limits: 2_000,\n policy: 2_000,\n routing: 2_000,\n identity: 2_000,\n accounts: 5_000,\n authenticate: 5_000,\n pushed: 30_000,\n outbound: 30_000,\n};\n\n// ── limits ──────────────────────────────────────────────────────────────────────────────\n\n/**\n * An operation `limits.check` judges. When the operator doesn't answer in time, `share`,\n * `version.push`, `link` and authoring fail closed, and `view`, `submit` and draft writes proceed,\n * so nothing a person typed is lost (D165 item 9).\n */\nexport type LimitOperation =\n | \"share\"\n | \"version.push\"\n | \"link\"\n | \"view\"\n | \"submit\"\n | \"run\"\n | \"run.wait\"\n | \"call\"\n | \"mcp.call\"\n | \"storage\";\n\n/** What `limits.check` is asked. */\nexport interface LimitQuery {\n /** The account the operation counts against. */\n readonly account: string;\n /** The account's hosted home. */\n readonly home: string;\n /** The artifact, for operations on one. */\n readonly artifact?: string;\n /** The artifact's hosted route, for operations on one (WP-30). */\n readonly routeId?: string;\n /** What is asked for. */\n readonly operation: LimitOperation;\n /** How much: bytes for `storage` and `version.push`, else 1. */\n readonly quantity?: number;\n}\n\n/** How long the server may keep an answer instead of asking again, in milliseconds (WP-30). */\nexport interface Cacheable {\n /** Absent or 0: ask again next time. */\n readonly cacheForMs?: number;\n}\n\n/** `limits.check`'s answer. */\nexport type LimitAnswer =\n | ({ readonly allowed: true } & Cacheable)\n | ({\n readonly allowed: false;\n /** A diagnostic code of the operator's (the server answers `MOSTRA_REMOTE_LIMIT_REACHED`). */\n readonly code: string;\n /** Shown as text to whoever was refused. */\n readonly message: string;\n readonly retryAfterMs?: number;\n } & Cacheable);\n\nconst cacheFor = z.int().min(0).max(86_400_000).exactOptional();\n\n/** The schema the server checks `limits.check`'s answer against. */\nexport const LimitAnswer: z.ZodType<LimitAnswer> = z.union([\n z.object({ allowed: z.literal(true), cacheForMs: cacheFor }),\n z.object({\n allowed: z.literal(false),\n code: z.string().min(1).max(128),\n message: z.string().max(1_000),\n retryAfterMs: z.int().min(0).max(86_400_000).exactOptional(),\n cacheForMs: cacheFor,\n }),\n]);\n\n// ── metering ────────────────────────────────────────────────────────────────────────────\n\n/** A counter's name (INTERFACES §18.6). */\nexport type MeterName =\n | \"views\"\n | \"submissions\"\n | \"requests\"\n | \"bytes.stored\"\n | \"bytes.egress\"\n | \"relay.messages\"\n | \"mcp.calls\"\n | \"home.activeSeconds\"\n | (string & {});\n\n/**\n * One counter of a batch. `views` carry `viewerKey`, a monthly pseudonymous key (an HMAC under a\n * key the server rotates each month), never an identity: per account for a signed-in viewer, per\n * viewer for a link minted with one, and per route for an anonymous viewer, since the shell gives\n * each route a different key and none spans routes (HY-08). `mcp.calls` carry `client`, the MCP\n * client's `clientInfo` name (D148).\n */\nexport interface MeterCounter {\n /** What is counted. */\n readonly name: MeterName;\n /** The account it counts against. */\n readonly account: string;\n /** The account's hosted home. */\n readonly home?: string;\n /** The artifact, for counters of one. */\n readonly artifactId?: string;\n /** The artifact's hosted route, for counters of one. */\n readonly routeId?: string;\n /** How much in the batch's window: a count, bytes or seconds. */\n readonly value: number;\n /** What tells counters of one name apart (`viewerKey`, `client`). */\n readonly dimensions?: Readonly<Record<string, string>>;\n}\n\n/** What `metering.record` receives, at least once, idempotent by `batchId`. */\nexport interface MeterBatch {\n /** Stable across retries: a batch delivered twice is the same batch. */\n readonly batchId: string;\n /** Where the window the counters cover starts. */\n readonly from: string;\n /** Where it ends. */\n readonly to: string;\n /** The counters, one per name, account, route and dimensions. */\n readonly counters: readonly MeterCounter[];\n}\n\n// ── sign-in: identity providers and accounts ────────────────────────────────────────────\n\n/**\n * Who an identity provider says signed in (INTERFACES §18.5). `facts` carries what a provider\n * tells beyond that (GitHub's account age, `createdAt`), for an operator's policy.\n */\nexport interface SignInIdentity {\n /** The provider's ID (`IdentityProvider.id`). */\n readonly provider: string;\n /** The provider's own stable ID for the person. */\n readonly subject: string;\n /** The person's email address, when the provider gives one. */\n readonly email?: string;\n /** Whether the provider verified `email`. */\n readonly emailVerified?: boolean;\n /** The display name the provider gives. */\n readonly name?: string;\n /** What else the provider tells (an account's age as `createdAt`). */\n readonly facts?: Readonly<Record<string, unknown>>;\n}\n\n/** The schema the server checks a provider's `SignInIdentity` against. */\nexport const SignInIdentity: z.ZodType<SignInIdentity> = z.object({\n provider: z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),\n subject: z.string().min(1).max(256),\n email: z.string().max(320).exactOptional(),\n emailVerified: z.boolean().exactOptional(),\n name: z.string().max(256).exactOptional(),\n facts: z.record(z.string(), z.unknown()).exactOptional(),\n});\n\n/** PKCE for one sign-in at a provider: the server makes it; the provider sends `challenge`. */\nexport interface SignInPkce {\n /** The S256 challenge the provider's authorization request carries. */\n readonly challenge: string;\n /** Always S256. */\n readonly method: \"S256\";\n /** The verifier the provider's code exchange sends. */\n readonly verifier: string;\n}\n\n/** What a provider's `authorize` and `callback` are told about the sign-in in progress. */\nexport interface SignInContext {\n /** The provider's return address on the API origin: `<apiOrigin>/signin/<id>/callback`. */\n readonly redirectUri: string;\n /** A fresh value an OpenID Connect provider binds its ID token to. */\n readonly nonce: string;\n}\n\n/**\n * An identity provider behind the sign-in port (D165 item 8): the built-in OpenID Connect and\n * GitHub adapters, a development one for tests, or one an operator module supplies.\n */\nexport interface IdentityProvider {\n /** Lower-case letters, digits and hyphens, at most 32: part of its callback's path. */\n readonly id: string;\n /** What the sign-in page calls it (\"GitHub\"). */\n readonly label: string;\n /** Where to send the person: the provider's authorization URL with `state` and PKCE. */\n authorize(state: string, pkce: SignInPkce, context: SignInContext): string | Promise<string>;\n /**\n * The person the provider names on return, from its callback's query (each parameter once; a\n * repeated one is refused before this is called). The server has already\n * checked `state`; the provider exchanges the code (with `pkce.verifier`) and checks what it\n * gets. Throws when sign-in failed.\n */\n callback(\n params: Readonly<Record<string, string>>,\n context: SignInContext & { readonly state: string; readonly pkce: SignInPkce },\n ): Promise<SignInIdentity>;\n}\n\n/**\n * `accounts.resolve`'s answer: the account (`status` `suspended` refuses sign-in), a **first\n * sign-in step** on the operator's origin, or a refusal shown as text.\n *\n * A step: the server sends the person to `step.url` with `mostra_return` added, an address on the\n * API origin (`/signin/return?step=<handle>`). The handle is single-use, lasts 15 minutes and is\n * bound to the browser that started the sign-in (a `__Host-` cookie on the API origin, never on a\n * user-content domain), so it can't be replayed or swapped. When the person comes back the server\n * calls `resolve` again with the same identity and `context.steps` one higher; at most three steps\n * per sign-in (WP-30, D167).\n */\nexport type AccountResolution =\n | {\n readonly account: string;\n readonly name?: string;\n readonly status: \"active\" | \"suspended\";\n }\n | { readonly step: { readonly url: string } }\n | { readonly refused: { readonly message: string } };\n\n/** The schema the server checks `accounts.resolve`'s answer against. */\nexport const AccountResolution: z.ZodType<AccountResolution> = z.union([\n z.object({\n account: z.string().min(1).max(128),\n name: z.string().max(256).exactOptional(),\n status: z.enum([\"active\", \"suspended\"]),\n }),\n z.object({ step: z.object({ url: z.url({ protocol: /^https$/ }).max(2_048) }) }),\n z.object({ refused: z.object({ message: z.string().max(1_000) }) }),\n]);\n\n/** Where an operator-issued credential was presented (D165 item 9, Opus review of WP-28). */\nexport type CredentialResource = \"host\" | \"mcp\" | \"files\";\n\n/**\n * `accounts.authenticate`'s answer for a credential the operator issued, or `null`. `subject`\n * names the credential stably (a service key's ID): a binding with it is one owner instance link\n * of the account, kept per subject, so a program can run an always-on owner instance.\n */\nexport interface AuthenticatedCredential {\n /** The account the credential acts for. */\n readonly account: string;\n /** What it may do: `mostra` for everything a sign-in may. */\n readonly scope: readonly string[];\n /** The credential's own stable name, which keys its instance link. */\n readonly subject?: string;\n}\n\n/** The schema the server checks `accounts.authenticate`'s answer against. */\nexport const AuthenticatedCredential: z.ZodType<AuthenticatedCredential | null> = z\n .object({\n account: z.string().min(1).max(128),\n scope: z.array(z.string().max(64)).max(32),\n subject: z\n .string()\n .regex(/^[A-Za-z0-9._:-]{1,128}$/)\n .exactOptional(),\n })\n .nullable();\n\n// ── abuse ───────────────────────────────────────────────────────────────────────────────\n\n/** A report from the shell's report control (`POST /a/{routeId}/_mostra/report`). */\nexport interface AbuseReport {\n /** The reported route. */\n readonly routeId: string;\n /** The route's label. */\n readonly label: string;\n /** The artifact's own ID (as its manifest names it). */\n readonly artifactId: string;\n /** The hosted home. */\n readonly home: string;\n /** The version the reporter saw, when the shell knew it. */\n readonly versionId?: string;\n /** The reason the reporter chose. */\n readonly reason: string;\n /** What the reporter wrote, as text. */\n readonly detail?: string;\n /** When the report was made. */\n readonly at: string;\n}\n\n/** What `abuse.pushed` receives after each version push, with read access to its client files. */\nexport interface PushedVersion {\n /** The route the version was pushed to. */\n readonly routeId: string;\n /** The route's label. */\n readonly label: string;\n /** The artifact's own ID (as its manifest names it). */\n readonly artifactId: string;\n /** The hosted home. */\n readonly home: string;\n /** The pushed version. */\n readonly versionId: string;\n /** The version's `manifest.json`, parsed. */\n readonly manifest: unknown;\n /** Every client file's path (`client/…`). */\n readonly files: readonly string[];\n /** A client file's bytes, by its path in the listing. */\n read(path: string): Promise<Uint8Array>;\n}\n\n/** `abuse.pushed`'s answer: quarantine the version, or nothing. */\nexport type PushedAnswer = { readonly quarantine?: { readonly reason: string } } | undefined;\n\n/** The schema the server checks `abuse.pushed`'s answer against. */\nexport const PushedAnswer: z.ZodType<PushedAnswer> = z\n .object({ quarantine: z.object({ reason: z.string().max(1_000) }).exactOptional() })\n .optional();\n\n// ── policy ──────────────────────────────────────────────────────────────────────────────\n\n/** What `policy.link` is asked about one link of one route. */\nexport interface LinkQuery {\n /** The account that owns the route. */\n readonly account: string;\n /** Its hosted home. */\n readonly home: string;\n /** The route. */\n readonly routeId: string;\n /** The artifact's own ID (as its manifest names it). */\n readonly artifactId: string;\n /** The link, once it exists. */\n readonly tokenId?: string;\n}\n\n/**\n * Per link and artifact (D161): an interstitial before the page, the longest link lifetime and an\n * idle expiry (durations such as `7d`), the after-submit line, the footer's wording (it can't be\n * hidden on a public link), and the made-with mark.\n */\nexport interface LinkPolicy extends Cacheable {\n /** A page the shell shows before the artifact, once per browser and link; its message as text. */\n readonly interstitial?: { readonly kind: string; readonly message?: string };\n /** The longest a link may live from when it was minted. */\n readonly maxTtl?: string;\n /** A link unused for this long expires. */\n readonly idleExpiry?: string;\n /** The line after \"Your answer was sent.\", as text. */\n readonly afterSubmit?: string;\n /** The footer's wording in place of \"Never enter passwords\", as text. */\n readonly footer?: string;\n /** Whether the made-with mark shows, and where it links. */\n readonly madeWith?: { readonly show: boolean; readonly href?: string };\n}\n\nconst duration = z.string().regex(/^[1-9][0-9]{0,8}[smhd]$/);\n\n/** The schema the server checks `policy.link`'s answer against. */\nexport const LinkPolicy: z.ZodType<LinkPolicy> = z.object({\n interstitial: z\n .object({ kind: z.string().min(1).max(64), message: z.string().max(2_000).exactOptional() })\n .exactOptional(),\n maxTtl: duration.exactOptional(),\n idleExpiry: duration.exactOptional(),\n afterSubmit: z.string().max(500).exactOptional(),\n footer: z.string().min(1).max(500).exactOptional(),\n madeWith: z\n .object({ show: z.boolean(), href: z.url({ protocol: /^https$/ }).exactOptional() })\n .exactOptional(),\n cacheForMs: cacheFor,\n});\n\n/**\n * How Mostra behaves in one chat host (D160): how a page renders there (an MCP App resource, or\n * the hosted link), and what a reached limit may say (`limit-reached` only, or the operator's\n * message).\n */\nexport interface ChatHostPolicy {\n /** `app`: through the MCP Apps resource; `link`: the hosted link only. */\n readonly render?: \"app\" | \"link\";\n /** What a reached limit may say there. */\n readonly quota?: \"limit-reached\" | \"message\";\n}\n\n/** The schema of the `ChatHostPolicy` type, for configuration and `policy.chatHost`. */\nexport const ChatHostPolicy: z.ZodType<ChatHostPolicy> = z.object({\n render: z.enum([\"app\", \"link\"]).exactOptional(),\n quota: z.enum([\"limit-reached\", \"message\"]).exactOptional(),\n});\n\n// ── routing ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * `routing.resolve`'s answer for an exact `Host` the server doesn't serve by itself (any host but\n * a configured user-content domain's apex and its routes' labels):\n *\n * - `shell`: the host shows the hosted shell (`/a/<routeId>`) for one home's routes, whose frames\n * are served on `<route label>.<domain>`. `domain` is a configured user-content domain, or one\n * the operator supplies (an organization's own, whose TLS the operator's edge terminates for the\n * host and every label under `domain`); the server serves those labels once the host is\n * recorded, without asking again.\n * - `route`: the host shows the shell of one route only (`/a/<routeId>`), with its frames on its\n * label under the active domain: a chosen, readable name.\n * - `null`: nothing is served (421).\n *\n * A host the operator supplies is recorded like the server's own labels, bound to its home\n * forever: never issued to another home, so no origin's storage passes between tenants (D165).\n */\nexport type RoutingAnswer =\n | ({ readonly shell: { readonly domain: string; readonly home: string } } & Cacheable)\n | ({ readonly route: { readonly home: string; readonly routeId: string } } & Cacheable)\n | null;\n\n/**\n * A host name of at least two labels, lower case; a port only as a local test server's hosts carry\n * one (the server's own configuration allows the same).\n */\nconst hostName = z\n .string()\n .regex(\n /^(?=.{1,253}(:|$))[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+(:\\d{1,5})?$/,\n );\n\n/** The schema the server checks `routing.resolve`'s answer against. */\nexport const RoutingAnswer: z.ZodType<RoutingAnswer> = z.union([\n z.object({\n shell: z.object({ domain: hostName, home: z.string().min(1) }),\n cacheForMs: cacheFor,\n }),\n z.object({\n route: z.object({ home: z.string().min(1), routeId: z.string().min(1) }),\n cacheForMs: cacheFor,\n }),\n z.null(),\n]);\n\n/** The schema of `routing.linkHost`'s answer: a shell host, or `null` for the active domain. */\nexport const LinkHost: z.ZodType<string | null> = hostName.nullable();\n\n// ── events ──────────────────────────────────────────────────────────────────────────────\n\n/** The kind of an outbound event. */\nexport type OperatorEventKind =\n | \"submission.accepted\"\n | \"version.pushed\"\n | \"run.ended\"\n | \"roster.completed\"\n | (string & {});\n\n/**\n * One outbound event, delivered at least once with a stable `eventId`. `payload`:\n * `submission.accepted` carries the submission's `Results` (INTERFACES §8, the `Results` type of `@mostra/protocol`); `version.pushed`\n * `{ versionId, number }`; `run.ended` `{ runId, action, status }`; `roster.completed` is WP-31's.\n * `label` is the route's label, so an operator running several servers behind one front learns\n * which serves which label (WP-30).\n */\nexport interface OperatorEvent {\n /** Stable across retries. */\n readonly eventId: string;\n /** What happened. */\n readonly kind: OperatorEventKind;\n /** The account that owns the route. */\n readonly account: string;\n /** Its hosted home. */\n readonly home: string;\n /** The route. */\n readonly routeId: string;\n /** The route's label. */\n readonly label: string;\n /** The artifact's own ID (as its manifest names it). */\n readonly artifactId: string;\n /** When it happened. */\n readonly at: string;\n /** What the kind carries. */\n readonly payload: unknown;\n}\n\n// ── the module ──────────────────────────────────────────────────────────────────────────\n\n/** The ports an operator module implements; each is optional, with the default named. */\nexport interface OperatorPorts {\n /** Allows or refuses an operation for an account. Default: allow. */\n readonly limits?: { check(q: LimitQuery): Promise<LimitAnswer> };\n /** Counters in batches, at least once. Default: discard. */\n readonly metering?: { record(batch: MeterBatch): Promise<void> };\n /**\n * Identity providers beside the configured ones, asked at each sign-in so the set can change\n * while the server runs (WP-30). Default: none.\n */\n readonly identity?: {\n providers(): Promise<readonly IdentityProvider[]> | readonly IdentityProvider[];\n };\n /**\n * Sign-in identities to accounts, a first sign-in step, and credentials the operator issued.\n * Default: the server's own accounts, no step, no outside credential.\n */\n readonly accounts?: {\n resolve(\n identity: SignInIdentity,\n context: { readonly steps: number },\n ): Promise<AccountResolution>;\n authenticate?(\n bearer: string,\n context: { readonly resource: CredentialResource },\n ): Promise<AuthenticatedCredential | null>;\n status?(account: string): Promise<\"active\" | \"suspended\">;\n };\n /** Reports and the after-push hook. Default: nothing. */\n readonly abuse?: {\n report(r: AbuseReport): Promise<void>;\n pushed?(v: PushedVersion): Promise<PushedAnswer>;\n };\n /** Per link and per chat host. Default: nothing beyond configuration. */\n readonly policy?: {\n link(q: LinkQuery): Promise<LinkPolicy>;\n chatHost?(client: {\n readonly name: string;\n readonly redirectHost?: string;\n }): Promise<ChatHostPolicy | null>;\n };\n /**\n * Hosts the operator supplies, and the host a new link is minted on. Default: the server's own\n * labels, and links on the active domain.\n */\n readonly routing?: {\n resolve(host: string): Promise<RoutingAnswer>;\n /**\n * The shell host a new link of this route is minted on (one `resolve` answers `shell` or\n * `route` for), or `null` for the active domain (WP-30). A link keeps the host it was minted\n * on (D137).\n */\n linkHost?(q: {\n readonly account: string;\n readonly home: string;\n readonly routeId: string;\n }): Promise<string | null>;\n };\n /** Outbound events, at least once with stable IDs. Default: discard. */\n readonly events?: { deliver(e: OperatorEvent): Promise<void> };\n /** Reserved for WP-31 (D121, D165 item 16); no mailer ships. */\n readonly invitations?: unknown;\n}\n\n/** A hosted route, or one version of it: what the handle's quarantine and release act on. */\nexport type RouteTarget =\n | { readonly routeId: string }\n | { readonly routeId: string; readonly versionId: string };\n\n/**\n * What the server gives its operator module (INTERFACES §18.6). Every target names a hosted route.\n * Each call is durable when it resolves.\n */\nexport interface ServerHandle {\n /** The operator boundary's revision this server speaks. */\n readonly revision: string;\n /** The server's API origin. */\n readonly apiOrigin: string;\n /** A neutral \"under review\" page from the shell; data kept; `release` restores it. */\n quarantine(target: RouteTarget, reason: string): Promise<void>;\n /** Ends a quarantine. */\n release(target: RouteTarget): Promise<void>;\n /** Views keep working; submissions and relayed actions are refused; only the operator resumes. */\n pause(routeId: string, reason: string): Promise<void>;\n /** Ends an operator's pause (and an owner's, too). */\n resume(routeId: string): Promise<void>;\n /** Refuses the home's bindings, pushes, links and pages until `resumeHome`. */\n suspendHome(home: string, reason: string): Promise<void>;\n /** Ends a suspension. */\n resumeHome(home: string): Promise<void>;\n /** Revokes every link of a route; answers how many were live. */\n revokeLinks(routeId: string): Promise<number>;\n /** Revokes one link (410 from then on). */\n revokeLink(tokenId: string): Promise<void>;\n /** Closes the home and refuses to reopen it, to move it between data directories. */\n drainHome(home: string): Promise<void>;\n /** Serves a drained home again. */\n releaseHome(home: string): Promise<void>;\n /** A restore from a backup: rotates the home's incarnation before it serves anything. */\n restored(home: string): Promise<void>;\n /** Deletion: explicit, never part of another action. The route's label is never issued again. */\n remove(routeId: string): Promise<void>;\n}\n\n/** An operator module's default export. */\nexport type OperatorModule = (server: ServerHandle) => OperatorPorts | Promise<OperatorPorts>;\n\n/** Types an operator module's default export; returns it unchanged. */\nexport function defineOperator(module: OperatorModule): OperatorModule {\n return module;\n}\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mostra/protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Mostra's shared protocol vocabulary: IDs, dated revisions and diagnostics, with Zod schemas and generated JSON Schema.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "The Mostra Authors",
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"types": "./dist/index.d.ts",
|
|
27
27
|
"default": "./dist/index.js"
|
|
28
28
|
},
|
|
29
|
+
"./operator": {
|
|
30
|
+
"@mostra/source": "./src/operator.ts",
|
|
31
|
+
"types": "./dist/operator.d.ts",
|
|
32
|
+
"default": "./dist/operator.js"
|
|
33
|
+
},
|
|
29
34
|
"./schemas/*": "./schemas/*",
|
|
30
35
|
"./package.json": "./package.json"
|
|
31
36
|
},
|
|
@@ -105,6 +110,11 @@
|
|
|
105
110
|
"limit": "5 kB"
|
|
106
111
|
}
|
|
107
112
|
],
|
|
113
|
+
"mostra": {
|
|
114
|
+
"apiReports": [
|
|
115
|
+
"./operator"
|
|
116
|
+
]
|
|
117
|
+
},
|
|
108
118
|
"scripts": {
|
|
109
119
|
"build": "tsdown",
|
|
110
120
|
"typecheck": "tsc -b",
|
|
@@ -55,6 +55,16 @@
|
|
|
55
55
|
"$ref": "#/definitions/ArtifactListResult"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
+
"artifact/pause": {
|
|
59
|
+
"direction": "client-to-instance",
|
|
60
|
+
"mutating": true,
|
|
61
|
+
"params": {
|
|
62
|
+
"$ref": "#/definitions/ArtifactPauseParams"
|
|
63
|
+
},
|
|
64
|
+
"result": {
|
|
65
|
+
"$ref": "#/definitions/ArtifactPauseResult"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
58
68
|
"artifact/publish": {
|
|
59
69
|
"direction": "client-to-instance",
|
|
60
70
|
"mutating": true,
|
|
@@ -253,6 +263,16 @@
|
|
|
253
263
|
"$ref": "#/definitions/PortIdentityResolveResult"
|
|
254
264
|
}
|
|
255
265
|
},
|
|
266
|
+
"port/relay.author": {
|
|
267
|
+
"direction": "instance-to-host",
|
|
268
|
+
"mutating": true,
|
|
269
|
+
"params": {
|
|
270
|
+
"$ref": "#/definitions/PortRelayAuthorParams"
|
|
271
|
+
},
|
|
272
|
+
"result": {
|
|
273
|
+
"$ref": "#/definitions/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": "#/definitions/RelayRunUpdateResult"
|
|
382
402
|
}
|
|
383
403
|
},
|
|
404
|
+
"remote/link": {
|
|
405
|
+
"direction": "client-to-instance",
|
|
406
|
+
"mutating": false,
|
|
407
|
+
"params": {
|
|
408
|
+
"$ref": "#/definitions/RemoteLinkParams"
|
|
409
|
+
},
|
|
410
|
+
"result": {
|
|
411
|
+
"$ref": "#/definitions/RemoteLinkResult"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
384
414
|
"remote/login": {
|
|
385
415
|
"direction": "client-to-instance",
|
|
386
416
|
"mutating": true,
|
|
@@ -1140,6 +1170,47 @@
|
|
|
1140
1170
|
],
|
|
1141
1171
|
"description": "The artifact manifest (INTERFACES §2.2): literal metadata from the entry's defineArtifact call or MDX frontmatter."
|
|
1142
1172
|
},
|
|
1173
|
+
"ArtifactPauseParams": {
|
|
1174
|
+
"type": "object",
|
|
1175
|
+
"properties": {
|
|
1176
|
+
"artifact": {
|
|
1177
|
+
"$ref": "#/definitions/ArtifactRef"
|
|
1178
|
+
},
|
|
1179
|
+
"paused": {
|
|
1180
|
+
"type": "boolean"
|
|
1181
|
+
},
|
|
1182
|
+
"reason": {
|
|
1183
|
+
"type": "string",
|
|
1184
|
+
"maxLength": 500
|
|
1185
|
+
},
|
|
1186
|
+
"requestId": {
|
|
1187
|
+
"type": "string",
|
|
1188
|
+
"minLength": 1
|
|
1189
|
+
}
|
|
1190
|
+
},
|
|
1191
|
+
"required": [
|
|
1192
|
+
"artifact",
|
|
1193
|
+
"paused"
|
|
1194
|
+
]
|
|
1195
|
+
},
|
|
1196
|
+
"ArtifactPauseResult": {
|
|
1197
|
+
"type": "object",
|
|
1198
|
+
"properties": {
|
|
1199
|
+
"paused": {
|
|
1200
|
+
"type": "boolean"
|
|
1201
|
+
},
|
|
1202
|
+
"by": {
|
|
1203
|
+
"type": "string",
|
|
1204
|
+
"enum": [
|
|
1205
|
+
"owner",
|
|
1206
|
+
"operator"
|
|
1207
|
+
]
|
|
1208
|
+
}
|
|
1209
|
+
},
|
|
1210
|
+
"required": [
|
|
1211
|
+
"paused"
|
|
1212
|
+
]
|
|
1213
|
+
},
|
|
1143
1214
|
"ArtifactProgressParams": {
|
|
1144
1215
|
"type": "object",
|
|
1145
1216
|
"properties": {
|
|
@@ -2977,6 +3048,111 @@
|
|
|
2977
3048
|
"mode": {
|
|
2978
3049
|
"type": "string",
|
|
2979
3050
|
"const": "worker"
|
|
3051
|
+
},
|
|
3052
|
+
"paused": {
|
|
3053
|
+
"type": "object",
|
|
3054
|
+
"properties": {
|
|
3055
|
+
"by": {
|
|
3056
|
+
"type": "string",
|
|
3057
|
+
"enum": [
|
|
3058
|
+
"owner",
|
|
3059
|
+
"operator"
|
|
3060
|
+
]
|
|
3061
|
+
},
|
|
3062
|
+
"reason": {
|
|
3063
|
+
"type": "string",
|
|
3064
|
+
"maxLength": 500
|
|
3065
|
+
}
|
|
3066
|
+
},
|
|
3067
|
+
"required": [
|
|
3068
|
+
"by"
|
|
3069
|
+
]
|
|
3070
|
+
},
|
|
3071
|
+
"hosted": {
|
|
3072
|
+
"type": "object",
|
|
3073
|
+
"properties": {
|
|
3074
|
+
"sender": {
|
|
3075
|
+
"type": "object",
|
|
3076
|
+
"properties": {
|
|
3077
|
+
"name": {
|
|
3078
|
+
"type": "string",
|
|
3079
|
+
"maxLength": 256
|
|
3080
|
+
},
|
|
3081
|
+
"verifiedBy": {
|
|
3082
|
+
"type": "string",
|
|
3083
|
+
"maxLength": 64
|
|
3084
|
+
}
|
|
3085
|
+
},
|
|
3086
|
+
"required": [
|
|
3087
|
+
"name"
|
|
3088
|
+
]
|
|
3089
|
+
},
|
|
3090
|
+
"viewer": {
|
|
3091
|
+
"type": "object",
|
|
3092
|
+
"properties": {
|
|
3093
|
+
"kind": {
|
|
3094
|
+
"type": "string",
|
|
3095
|
+
"enum": [
|
|
3096
|
+
"account",
|
|
3097
|
+
"anonymous",
|
|
3098
|
+
"named"
|
|
3099
|
+
]
|
|
3100
|
+
},
|
|
3101
|
+
"name": {
|
|
3102
|
+
"type": "string",
|
|
3103
|
+
"maxLength": 256
|
|
3104
|
+
},
|
|
3105
|
+
"verified": {
|
|
3106
|
+
"type": "boolean"
|
|
3107
|
+
}
|
|
3108
|
+
},
|
|
3109
|
+
"required": [
|
|
3110
|
+
"kind",
|
|
3111
|
+
"verified"
|
|
3112
|
+
]
|
|
3113
|
+
},
|
|
3114
|
+
"signIn": {
|
|
3115
|
+
"type": "boolean"
|
|
3116
|
+
},
|
|
3117
|
+
"footer": {
|
|
3118
|
+
"type": "string",
|
|
3119
|
+
"maxLength": 500
|
|
3120
|
+
},
|
|
3121
|
+
"afterSubmit": {
|
|
3122
|
+
"type": "string",
|
|
3123
|
+
"maxLength": 500
|
|
3124
|
+
},
|
|
3125
|
+
"madeWith": {
|
|
3126
|
+
"type": "object",
|
|
3127
|
+
"properties": {
|
|
3128
|
+
"href": {
|
|
3129
|
+
"type": "string",
|
|
3130
|
+
"maxLength": 2048,
|
|
3131
|
+
"format": "uri"
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
},
|
|
3135
|
+
"interstitial": {
|
|
3136
|
+
"type": "object",
|
|
3137
|
+
"properties": {
|
|
3138
|
+
"kind": {
|
|
3139
|
+
"type": "string",
|
|
3140
|
+
"maxLength": 64
|
|
3141
|
+
},
|
|
3142
|
+
"message": {
|
|
3143
|
+
"type": "string",
|
|
3144
|
+
"maxLength": 2000
|
|
3145
|
+
}
|
|
3146
|
+
},
|
|
3147
|
+
"required": [
|
|
3148
|
+
"kind"
|
|
3149
|
+
]
|
|
3150
|
+
}
|
|
3151
|
+
},
|
|
3152
|
+
"required": [
|
|
3153
|
+
"viewer",
|
|
3154
|
+
"signIn"
|
|
3155
|
+
]
|
|
2980
3156
|
}
|
|
2981
3157
|
},
|
|
2982
3158
|
"required": [
|
|
@@ -4168,6 +4344,31 @@
|
|
|
4168
4344
|
"pattern": "^[a-z][a-zA-Z0-9]*$",
|
|
4169
4345
|
"description": "A host port name: identity, submissions, drafts, reviews, addressing, trustedControls, capture, secrets, pty, or ai (reserved). Open for later ports."
|
|
4170
4346
|
},
|
|
4347
|
+
"PortRelayAuthorParams": {
|
|
4348
|
+
"type": "object",
|
|
4349
|
+
"properties": {
|
|
4350
|
+
"method": {
|
|
4351
|
+
"type": "string",
|
|
4352
|
+
"enum": [
|
|
4353
|
+
"artifact/create",
|
|
4354
|
+
"artifact/verify",
|
|
4355
|
+
"artifact/publish",
|
|
4356
|
+
"artifact/get",
|
|
4357
|
+
"workspace/root",
|
|
4358
|
+
"workspace/allocate",
|
|
4359
|
+
"workspace/read",
|
|
4360
|
+
"workspace/apply",
|
|
4361
|
+
"verify/screenshot"
|
|
4362
|
+
]
|
|
4363
|
+
},
|
|
4364
|
+
"params": {}
|
|
4365
|
+
},
|
|
4366
|
+
"required": [
|
|
4367
|
+
"method",
|
|
4368
|
+
"params"
|
|
4369
|
+
]
|
|
4370
|
+
},
|
|
4371
|
+
"PortRelayAuthorResult": {},
|
|
4171
4372
|
"PortRelayCallParams": {
|
|
4172
4373
|
"type": "object",
|
|
4173
4374
|
"properties": {
|
|
@@ -4915,6 +5116,61 @@
|
|
|
4915
5116
|
],
|
|
4916
5117
|
"description": "One remote server this home is linked to, and the state of the link."
|
|
4917
5118
|
},
|
|
5119
|
+
"RemoteLinkParams": {
|
|
5120
|
+
"type": "object",
|
|
5121
|
+
"properties": {
|
|
5122
|
+
"server": {
|
|
5123
|
+
"$ref": "#/definitions/ServerOrigin"
|
|
5124
|
+
},
|
|
5125
|
+
"key": {
|
|
5126
|
+
"type": "string",
|
|
5127
|
+
"minLength": 20,
|
|
5128
|
+
"maxLength": 512
|
|
5129
|
+
},
|
|
5130
|
+
"default": {
|
|
5131
|
+
"type": "boolean"
|
|
5132
|
+
}
|
|
5133
|
+
},
|
|
5134
|
+
"required": [
|
|
5135
|
+
"server",
|
|
5136
|
+
"key"
|
|
5137
|
+
]
|
|
5138
|
+
},
|
|
5139
|
+
"RemoteLinkResult": {
|
|
5140
|
+
"type": "object",
|
|
5141
|
+
"properties": {
|
|
5142
|
+
"server": {
|
|
5143
|
+
"$ref": "#/definitions/ServerOrigin"
|
|
5144
|
+
},
|
|
5145
|
+
"account": {
|
|
5146
|
+
"type": "object",
|
|
5147
|
+
"properties": {
|
|
5148
|
+
"id": {
|
|
5149
|
+
"type": "string"
|
|
5150
|
+
},
|
|
5151
|
+
"name": {
|
|
5152
|
+
"type": "string"
|
|
5153
|
+
}
|
|
5154
|
+
},
|
|
5155
|
+
"required": [
|
|
5156
|
+
"id"
|
|
5157
|
+
]
|
|
5158
|
+
},
|
|
5159
|
+
"instanceId": {
|
|
5160
|
+
"type": "string"
|
|
5161
|
+
},
|
|
5162
|
+
"default": {
|
|
5163
|
+
"type": "boolean"
|
|
5164
|
+
}
|
|
5165
|
+
},
|
|
5166
|
+
"required": [
|
|
5167
|
+
"server",
|
|
5168
|
+
"account",
|
|
5169
|
+
"instanceId",
|
|
5170
|
+
"default"
|
|
5171
|
+
],
|
|
5172
|
+
"description": "A home linked to a remote server with an operator-issued key."
|
|
5173
|
+
},
|
|
4918
5174
|
"RemoteLoginParams": {
|
|
4919
5175
|
"type": "object",
|
|
4920
5176
|
"properties": {
|
|
@@ -7396,6 +7652,9 @@
|
|
|
7396
7652
|
},
|
|
7397
7653
|
"ref": {
|
|
7398
7654
|
"type": "string"
|
|
7655
|
+
},
|
|
7656
|
+
"verified": {
|
|
7657
|
+
"type": "boolean"
|
|
7399
7658
|
}
|
|
7400
7659
|
},
|
|
7401
7660
|
"required": [
|