@camerontaylor/paseo-protocol 0.12.0-fork.1 → 0.13.0-fork.1

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 (35) hide show
  1. package/dist/addresses.d.ts +6 -0
  2. package/dist/addresses.js +2 -0
  3. package/dist/agent-labels.d.ts +4 -0
  4. package/dist/agent-labels.js +17 -0
  5. package/dist/agent-message.d.ts +1 -0
  6. package/dist/agent-message.js +1 -0
  7. package/dist/binary-frames/demux.d.ts +4 -0
  8. package/dist/binary-frames/demux.js +5 -0
  9. package/dist/binary-frames/host-route.d.ts +12 -0
  10. package/dist/binary-frames/host-route.js +36 -0
  11. package/dist/binary-frames/index.d.ts +1 -0
  12. package/dist/binary-frames/index.js +1 -0
  13. package/dist/client-capabilities.d.ts +1 -0
  14. package/dist/client-capabilities.js +1 -0
  15. package/dist/connection-offer.d.ts +2 -0
  16. package/dist/connection-offer.js +3 -0
  17. package/dist/daemon-endpoints.js +8 -0
  18. package/dist/generated/validation/ws-outbound-schema-metadata.d.ts +716 -311
  19. package/dist/generated/validation/ws-outbound-schema-metadata.js +10 -0
  20. package/dist/generated/validation/ws-outbound.aot.d.ts +20 -0
  21. package/dist/generated/validation/ws-outbound.aot.js +116406 -114752
  22. package/dist/host-target.d.ts +18 -0
  23. package/dist/host-target.js +118 -0
  24. package/dist/hosts.d.ts +303 -0
  25. package/dist/hosts.js +117 -0
  26. package/dist/messages.d.ts +1961 -307
  27. package/dist/messages.js +70 -2
  28. package/dist/paseo-tool-presentation/catalog.d.ts +3 -0
  29. package/dist/paseo-tool-presentation/catalog.js +1 -0
  30. package/dist/plugin-registry.d.ts +21 -0
  31. package/dist/plugin-registry.js +11 -1
  32. package/dist/schedule/rpc-schemas.d.ts +4 -4
  33. package/dist/schedule/types.d.ts +1 -1
  34. package/dist/validation/ws-outbound-envelope.d.ts +445 -70
  35. package/package.json +5 -1
@@ -0,0 +1,18 @@
1
+ import { type ConnectionOffer } from "./connection-offer.js";
2
+ import { type SshTransportTarget } from "./ssh-transport.js";
3
+ export type HostTarget = {
4
+ kind: "ssh";
5
+ ssh: SshTransportTarget;
6
+ password?: string;
7
+ description: string;
8
+ } | {
9
+ kind: "socket";
10
+ url: string;
11
+ socketPath?: string;
12
+ password?: string;
13
+ offer?: ConnectionOffer;
14
+ description: string;
15
+ };
16
+ /** The shared saved-host and CLI grammar. Errors never echo credential-bearing input. */
17
+ export declare function parseHostTarget(input: string): HostTarget;
18
+ //# sourceMappingURL=host-target.d.ts.map
@@ -0,0 +1,118 @@
1
+ import { parseConnectionOfferFromUrl } from "./connection-offer.js";
2
+ import { buildDaemonWebSocketUrl, buildRelayWebSocketUrl, normalizeHostPort, parseConnectionUri, parseRelayConnectionUri, shouldUseTlsForDefaultHostedRelay, } from "./daemon-endpoints.js";
3
+ import { parseSshTransportUri } from "./ssh-transport.js";
4
+ /** The shared saved-host and CLI grammar. Errors never echo credential-bearing input. */
5
+ export function parseHostTarget(input) {
6
+ try {
7
+ return parse(input.trim());
8
+ }
9
+ catch {
10
+ throw Object.assign(new Error("Invalid host connection. Use host:port, ws(s)://, tcp://, unix://, pipe://, ssh:// or a pairing URL."), { code: "invalid_connection" });
11
+ }
12
+ }
13
+ function parse(input) {
14
+ if (!input)
15
+ throw new Error("empty");
16
+ if (input.startsWith("ssh://")) {
17
+ return sshTarget(input);
18
+ }
19
+ if (input.startsWith("relay://") || input.includes("#connect=")) {
20
+ const relay = parseRelayConnectionUri(input);
21
+ return relayTarget(relay.offer, relay.password);
22
+ }
23
+ const offer = parseConnectionOfferFromUrl(input);
24
+ if (offer)
25
+ return relayTarget(offer);
26
+ if (input.startsWith("unix://") ||
27
+ input.startsWith("pipe://") ||
28
+ input.startsWith("/") ||
29
+ input.startsWith("~") ||
30
+ input.startsWith("\\\\.\\pipe\\")) {
31
+ const socketPath = input.replace(/^(unix|pipe):\/\//, "");
32
+ if (!socketPath || socketPath === "~")
33
+ throw new Error("empty socket");
34
+ const pipe = input.startsWith("pipe://") || input.startsWith("\\\\.\\pipe\\");
35
+ return {
36
+ kind: "socket",
37
+ socketPath,
38
+ url: pipe ? "ws://localhost/ws" : `ws+unix://${socketPath}:/ws`,
39
+ description: `${pipe ? "pipe" : "unix"}://${socketPath}`,
40
+ };
41
+ }
42
+ if (input.startsWith("tcp://"))
43
+ return tcpTarget(input);
44
+ if (/^wss?:\/\//.test(input))
45
+ return websocketTarget(input);
46
+ const endpoint = validatedEndpoint(/^\d+$/.test(input) ? `127.0.0.1:${input}` : input);
47
+ return {
48
+ kind: "socket",
49
+ url: buildDaemonWebSocketUrl(endpoint, { useTls: false }),
50
+ description: `tcp://${endpoint}`,
51
+ };
52
+ }
53
+ function relayTarget(offer, password) {
54
+ const endpoint = validatedEndpoint(offer.relay.endpoint);
55
+ return {
56
+ kind: "socket",
57
+ url: buildRelayWebSocketUrl({
58
+ endpoint,
59
+ serverId: offer.serverId,
60
+ role: "client",
61
+ useTls: offer.relay.useTls ?? shouldUseTlsForDefaultHostedRelay(offer.relay.endpoint),
62
+ }),
63
+ offer,
64
+ password,
65
+ description: `relay://${endpoint}/${encodeURIComponent(offer.serverId)}`,
66
+ };
67
+ }
68
+ function tcpTarget(input) {
69
+ const uri = new URL(input);
70
+ if (uri.pathname && uri.pathname !== "/")
71
+ throw new Error("Unexpected TCP path");
72
+ if (uri.hash)
73
+ throw new Error("Unexpected TCP fragment");
74
+ const parts = parseConnectionUri(input);
75
+ const endpoint = validatedEndpoint(`${parts.isIpv6 ? `[${parts.host}]` : parts.host}:${parts.port}`);
76
+ return {
77
+ kind: "socket",
78
+ url: buildDaemonWebSocketUrl(endpoint, { useTls: parts.useTls }),
79
+ password: parts.password,
80
+ description: `tcp://${endpoint}`,
81
+ };
82
+ }
83
+ function websocketTarget(input) {
84
+ const url = new URL(input);
85
+ if (!url.hostname || url.username || url.password || url.hash)
86
+ throw new Error("invalid url");
87
+ const password = url.searchParams.get("password") ?? undefined;
88
+ // Unknown query parameters may themselves contain credentials; discovery shows only the origin.
89
+ if (url.pathname === "/")
90
+ url.pathname = "/ws";
91
+ url.searchParams.delete("password");
92
+ return { kind: "socket", url: url.toString(), password, description: url.origin };
93
+ }
94
+ function sshTarget(input) {
95
+ const uri = new URL(input);
96
+ if (uri.searchParams.getAll("password").length > 1)
97
+ throw new Error("Duplicate daemon password");
98
+ const password = uri.searchParams.get("password") || undefined;
99
+ uri.searchParams.delete("password");
100
+ const ssh = parseSshTransportUri(uri.toString());
101
+ return {
102
+ kind: "ssh",
103
+ ssh,
104
+ ...(password ? { password } : {}),
105
+ description: `ssh://${uri.hostname}${ssh.sshPort ? `:${ssh.sshPort}` : ""} (daemon port ${ssh.daemonPort})`,
106
+ };
107
+ }
108
+ /** A bare endpoint has exactly one authority; URL syntax must use an explicit supported scheme. */
109
+ function validatedEndpoint(input) {
110
+ if (!/^(?:[a-zA-Z0-9_][a-zA-Z0-9_.-]*|\[[0-9a-fA-F:.]+\]):[0-9]{1,5}$/.test(input))
111
+ throw new Error("Invalid endpoint");
112
+ // URL parsing validates IPv6 literals and rejects invalid authority/port encodings.
113
+ const url = new URL(`http://${input}`);
114
+ if (!url.hostname)
115
+ throw new Error("Missing endpoint host");
116
+ return normalizeHostPort(input);
117
+ }
118
+ //# sourceMappingURL=host-target.js.map
@@ -0,0 +1,303 @@
1
+ import { z } from "zod";
2
+ export declare const HostMetadataSchema: z.ZodRecord<z.ZodString, z.ZodString>;
3
+ export declare const HostAddSchema: z.ZodObject<{
4
+ connection: z.ZodString;
5
+ label: z.ZodOptional<z.ZodString>;
6
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
7
+ sourceKey: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strip>;
9
+ export declare const HostUpdateSchema: z.ZodObject<{
10
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
12
+ enabled: z.ZodOptional<z.ZodBoolean>;
13
+ connection: z.ZodOptional<z.ZodString>;
14
+ replaceIdentity: z.ZodOptional<z.ZodBoolean>;
15
+ }, z.core.$strip>;
16
+ export declare const HostSummarySchema: z.ZodObject<{
17
+ registrationId: z.ZodString;
18
+ serverId: z.ZodNullable<z.ZodString>;
19
+ label: z.ZodNullable<z.ZodString>;
20
+ source: z.ZodObject<{
21
+ id: z.ZodString;
22
+ key: z.ZodString;
23
+ }, z.core.$strip>;
24
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
25
+ enabled: z.ZodBoolean;
26
+ status: z.ZodEnum<{
27
+ error: "error";
28
+ connecting: "connecting";
29
+ online: "online";
30
+ offline: "offline";
31
+ disabled: "disabled";
32
+ }>;
33
+ targetDescription: z.ZodString;
34
+ lastOnlineAt: z.ZodNullable<z.ZodString>;
35
+ nextRetryAt: z.ZodNullable<z.ZodString>;
36
+ error: z.ZodNullable<z.ZodObject<{
37
+ code: z.ZodString;
38
+ message: z.ZodString;
39
+ }, z.core.$strip>>;
40
+ }, z.core.$strip>;
41
+ export declare const HostDirectorySchema: z.ZodObject<{
42
+ self: z.ZodObject<{
43
+ serverId: z.ZodString;
44
+ label: z.ZodString;
45
+ }, z.core.$strip>;
46
+ hosts: z.ZodArray<z.ZodObject<{
47
+ registrationId: z.ZodString;
48
+ serverId: z.ZodNullable<z.ZodString>;
49
+ label: z.ZodNullable<z.ZodString>;
50
+ source: z.ZodObject<{
51
+ id: z.ZodString;
52
+ key: z.ZodString;
53
+ }, z.core.$strip>;
54
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
55
+ enabled: z.ZodBoolean;
56
+ status: z.ZodEnum<{
57
+ error: "error";
58
+ connecting: "connecting";
59
+ online: "online";
60
+ offline: "offline";
61
+ disabled: "disabled";
62
+ }>;
63
+ targetDescription: z.ZodString;
64
+ lastOnlineAt: z.ZodNullable<z.ZodString>;
65
+ nextRetryAt: z.ZodNullable<z.ZodString>;
66
+ error: z.ZodNullable<z.ZodObject<{
67
+ code: z.ZodString;
68
+ message: z.ZodString;
69
+ }, z.core.$strip>>;
70
+ }, z.core.$strip>>;
71
+ }, z.core.$strip>;
72
+ export type HostAdd = z.infer<typeof HostAddSchema>;
73
+ export type HostUpdate = z.infer<typeof HostUpdateSchema>;
74
+ export type HostSummary = z.infer<typeof HostSummarySchema>;
75
+ export type HostDirectory = z.infer<typeof HostDirectorySchema>;
76
+ export declare const HostsListRequestSchema: z.ZodObject<{
77
+ type: z.ZodLiteral<"hosts.list.request">;
78
+ requestId: z.ZodString;
79
+ observe: z.ZodOptional<z.ZodBoolean>;
80
+ }, z.core.$strip>;
81
+ export declare const HostsAddRequestSchema: z.ZodObject<{
82
+ type: z.ZodLiteral<"hosts.add.request">;
83
+ requestId: z.ZodString;
84
+ input: z.ZodObject<{
85
+ connection: z.ZodString;
86
+ label: z.ZodOptional<z.ZodString>;
87
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
88
+ sourceKey: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strip>;
90
+ }, z.core.$strip>;
91
+ export declare const HostsUpdateRequestSchema: z.ZodObject<{
92
+ type: z.ZodLiteral<"hosts.update.request">;
93
+ requestId: z.ZodString;
94
+ registrationId: z.ZodString;
95
+ patch: z.ZodObject<{
96
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
97
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
98
+ enabled: z.ZodOptional<z.ZodBoolean>;
99
+ connection: z.ZodOptional<z.ZodString>;
100
+ replaceIdentity: z.ZodOptional<z.ZodBoolean>;
101
+ }, z.core.$strip>;
102
+ }, z.core.$strip>;
103
+ export declare const HostsRemoveRequestSchema: z.ZodObject<{
104
+ type: z.ZodLiteral<"hosts.remove.request">;
105
+ requestId: z.ZodString;
106
+ registrationId: z.ZodString;
107
+ }, z.core.$strip>;
108
+ export declare const HostsRouteOpenRequestSchema: z.ZodObject<{
109
+ type: z.ZodLiteral<"hosts.route.open.request">;
110
+ requestId: z.ZodString;
111
+ serverId: z.ZodString;
112
+ scopeId: z.ZodString;
113
+ }, z.core.$strip>;
114
+ export declare const HostsRouteFrameRequestSchema: z.ZodObject<{
115
+ type: z.ZodLiteral<"hosts.route.frame.request">;
116
+ routeId: z.ZodString;
117
+ data: z.ZodString;
118
+ binary: z.ZodLiteral<false>;
119
+ }, z.core.$strip>;
120
+ export declare const HostsRouteCloseRequestSchema: z.ZodObject<{
121
+ type: z.ZodLiteral<"hosts.route.close.request">;
122
+ routeId: z.ZodOptional<z.ZodString>;
123
+ scopeId: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strip>;
125
+ export declare const HostsListResponseSchema: z.ZodObject<{
126
+ type: z.ZodLiteral<"hosts.list.response">;
127
+ payload: z.ZodObject<{
128
+ requestId: z.ZodString;
129
+ directory: z.ZodObject<{
130
+ self: z.ZodObject<{
131
+ serverId: z.ZodString;
132
+ label: z.ZodString;
133
+ }, z.core.$strip>;
134
+ hosts: z.ZodArray<z.ZodObject<{
135
+ registrationId: z.ZodString;
136
+ serverId: z.ZodNullable<z.ZodString>;
137
+ label: z.ZodNullable<z.ZodString>;
138
+ source: z.ZodObject<{
139
+ id: z.ZodString;
140
+ key: z.ZodString;
141
+ }, z.core.$strip>;
142
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
143
+ enabled: z.ZodBoolean;
144
+ status: z.ZodEnum<{
145
+ error: "error";
146
+ connecting: "connecting";
147
+ online: "online";
148
+ offline: "offline";
149
+ disabled: "disabled";
150
+ }>;
151
+ targetDescription: z.ZodString;
152
+ lastOnlineAt: z.ZodNullable<z.ZodString>;
153
+ nextRetryAt: z.ZodNullable<z.ZodString>;
154
+ error: z.ZodNullable<z.ZodObject<{
155
+ code: z.ZodString;
156
+ message: z.ZodString;
157
+ }, z.core.$strip>>;
158
+ }, z.core.$strip>>;
159
+ }, z.core.$strip>;
160
+ subscriptionId: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>;
162
+ }, z.core.$strip>;
163
+ export declare const HostsChangedSchema: z.ZodObject<{
164
+ type: z.ZodLiteral<"hosts.changed">;
165
+ payload: z.ZodObject<{
166
+ subscriptionId: z.ZodString;
167
+ directory: z.ZodObject<{
168
+ self: z.ZodObject<{
169
+ serverId: z.ZodString;
170
+ label: z.ZodString;
171
+ }, z.core.$strip>;
172
+ hosts: z.ZodArray<z.ZodObject<{
173
+ registrationId: z.ZodString;
174
+ serverId: z.ZodNullable<z.ZodString>;
175
+ label: z.ZodNullable<z.ZodString>;
176
+ source: z.ZodObject<{
177
+ id: z.ZodString;
178
+ key: z.ZodString;
179
+ }, z.core.$strip>;
180
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
181
+ enabled: z.ZodBoolean;
182
+ status: z.ZodEnum<{
183
+ error: "error";
184
+ connecting: "connecting";
185
+ online: "online";
186
+ offline: "offline";
187
+ disabled: "disabled";
188
+ }>;
189
+ targetDescription: z.ZodString;
190
+ lastOnlineAt: z.ZodNullable<z.ZodString>;
191
+ nextRetryAt: z.ZodNullable<z.ZodString>;
192
+ error: z.ZodNullable<z.ZodObject<{
193
+ code: z.ZodString;
194
+ message: z.ZodString;
195
+ }, z.core.$strip>>;
196
+ }, z.core.$strip>>;
197
+ }, z.core.$strip>;
198
+ }, z.core.$strip>;
199
+ }, z.core.$strip>;
200
+ export declare const HostsAddResponseSchema: z.ZodObject<{
201
+ type: z.ZodLiteral<"hosts.add.response">;
202
+ payload: z.ZodObject<{
203
+ requestId: z.ZodString;
204
+ host: z.ZodObject<{
205
+ registrationId: z.ZodString;
206
+ serverId: z.ZodNullable<z.ZodString>;
207
+ label: z.ZodNullable<z.ZodString>;
208
+ source: z.ZodObject<{
209
+ id: z.ZodString;
210
+ key: z.ZodString;
211
+ }, z.core.$strip>;
212
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
213
+ enabled: z.ZodBoolean;
214
+ status: z.ZodEnum<{
215
+ error: "error";
216
+ connecting: "connecting";
217
+ online: "online";
218
+ offline: "offline";
219
+ disabled: "disabled";
220
+ }>;
221
+ targetDescription: z.ZodString;
222
+ lastOnlineAt: z.ZodNullable<z.ZodString>;
223
+ nextRetryAt: z.ZodNullable<z.ZodString>;
224
+ error: z.ZodNullable<z.ZodObject<{
225
+ code: z.ZodString;
226
+ message: z.ZodString;
227
+ }, z.core.$strip>>;
228
+ }, z.core.$strip>;
229
+ }, z.core.$strip>;
230
+ }, z.core.$strip>;
231
+ export declare const HostsUpdateResponseSchema: z.ZodObject<{
232
+ type: z.ZodLiteral<"hosts.update.response">;
233
+ payload: z.ZodObject<{
234
+ requestId: z.ZodString;
235
+ host: z.ZodObject<{
236
+ registrationId: z.ZodString;
237
+ serverId: z.ZodNullable<z.ZodString>;
238
+ label: z.ZodNullable<z.ZodString>;
239
+ source: z.ZodObject<{
240
+ id: z.ZodString;
241
+ key: z.ZodString;
242
+ }, z.core.$strip>;
243
+ metadata: z.ZodRecord<z.ZodString, z.ZodString>;
244
+ enabled: z.ZodBoolean;
245
+ status: z.ZodEnum<{
246
+ error: "error";
247
+ connecting: "connecting";
248
+ online: "online";
249
+ offline: "offline";
250
+ disabled: "disabled";
251
+ }>;
252
+ targetDescription: z.ZodString;
253
+ lastOnlineAt: z.ZodNullable<z.ZodString>;
254
+ nextRetryAt: z.ZodNullable<z.ZodString>;
255
+ error: z.ZodNullable<z.ZodObject<{
256
+ code: z.ZodString;
257
+ message: z.ZodString;
258
+ }, z.core.$strip>>;
259
+ }, z.core.$strip>;
260
+ }, z.core.$strip>;
261
+ }, z.core.$strip>;
262
+ export declare const HostsRemoveResponseSchema: z.ZodObject<{
263
+ type: z.ZodLiteral<"hosts.remove.response">;
264
+ payload: z.ZodObject<{
265
+ requestId: z.ZodString;
266
+ }, z.core.$strip>;
267
+ }, z.core.$strip>;
268
+ export declare const HostsRouteOpenResponseSchema: z.ZodObject<{
269
+ type: z.ZodLiteral<"hosts.route.open.response">;
270
+ payload: z.ZodObject<{
271
+ requestId: z.ZodString;
272
+ routeId: z.ZodString;
273
+ }, z.core.$strip>;
274
+ }, z.core.$strip>;
275
+ export declare const HostsRouteFrameSchema: z.ZodObject<{
276
+ type: z.ZodLiteral<"hosts.route.frame">;
277
+ payload: z.ZodObject<{
278
+ subscriptionId: z.ZodString;
279
+ data: z.ZodString;
280
+ binary: z.ZodLiteral<false>;
281
+ }, z.core.$strip>;
282
+ }, z.core.$strip>;
283
+ export declare const HostsRouteClosedSchema: z.ZodObject<{
284
+ type: z.ZodLiteral<"hosts.route.closed">;
285
+ payload: z.ZodObject<{
286
+ subscriptionId: z.ZodString;
287
+ code: z.ZodString;
288
+ message: z.ZodString;
289
+ }, z.core.$strip>;
290
+ }, z.core.$strip>;
291
+ export declare const HostsLinkOpenRequestSchema: z.ZodObject<{
292
+ type: z.ZodLiteral<"hosts.link.open.request">;
293
+ requestId: z.ZodString;
294
+ channelId: z.ZodString;
295
+ }, z.core.$strip>;
296
+ export declare const HostsLinkOpenResponseSchema: z.ZodObject<{
297
+ type: z.ZodLiteral<"hosts.link.open.response">;
298
+ payload: z.ZodObject<{
299
+ requestId: z.ZodString;
300
+ routeId: z.ZodString;
301
+ }, z.core.$strip>;
302
+ }, z.core.$strip>;
303
+ //# sourceMappingURL=hosts.d.ts.map
package/dist/hosts.js ADDED
@@ -0,0 +1,117 @@
1
+ import { z } from "zod";
2
+ export const HostMetadataSchema = z.record(z.string().max(256), z.string().max(4096));
3
+ export const HostAddSchema = z.object({
4
+ connection: z.string().min(1).max(16384),
5
+ label: z.string().max(256).optional(),
6
+ metadata: HostMetadataSchema.optional(),
7
+ sourceKey: z.string().min(1).max(256).optional(),
8
+ });
9
+ export const HostUpdateSchema = z.object({
10
+ label: z.string().max(256).nullable().optional(),
11
+ metadata: HostMetadataSchema.optional(),
12
+ enabled: z.boolean().optional(),
13
+ connection: z.string().min(1).max(16384).optional(),
14
+ replaceIdentity: z.boolean().optional(),
15
+ });
16
+ export const HostSummarySchema = z.object({
17
+ registrationId: z.string(),
18
+ serverId: z.string().nullable(),
19
+ label: z.string().nullable(),
20
+ source: z.object({ id: z.string(), key: z.string() }),
21
+ metadata: HostMetadataSchema,
22
+ enabled: z.boolean(),
23
+ status: z.enum(["connecting", "online", "offline", "error", "disabled"]),
24
+ targetDescription: z.string(),
25
+ lastOnlineAt: z.string().nullable(),
26
+ nextRetryAt: z.string().nullable(),
27
+ error: z.object({ code: z.string(), message: z.string() }).nullable(),
28
+ });
29
+ export const HostDirectorySchema = z.object({
30
+ self: z.object({ serverId: z.string(), label: z.string() }),
31
+ hosts: z.array(HostSummarySchema),
32
+ });
33
+ export const HostsListRequestSchema = z.object({
34
+ type: z.literal("hosts.list.request"),
35
+ requestId: z.string(),
36
+ observe: z.boolean().optional(),
37
+ });
38
+ export const HostsAddRequestSchema = z.object({
39
+ type: z.literal("hosts.add.request"),
40
+ requestId: z.string(),
41
+ input: HostAddSchema,
42
+ });
43
+ export const HostsUpdateRequestSchema = z.object({
44
+ type: z.literal("hosts.update.request"),
45
+ requestId: z.string(),
46
+ registrationId: z.string(),
47
+ patch: HostUpdateSchema,
48
+ });
49
+ export const HostsRemoveRequestSchema = z.object({
50
+ type: z.literal("hosts.remove.request"),
51
+ requestId: z.string(),
52
+ registrationId: z.string(),
53
+ });
54
+ export const HostsRouteOpenRequestSchema = z.object({
55
+ type: z.literal("hosts.route.open.request"),
56
+ requestId: z.string(),
57
+ serverId: z.string(),
58
+ scopeId: z.string().min(1).max(256),
59
+ });
60
+ export const HostsRouteFrameRequestSchema = z.object({
61
+ type: z.literal("hosts.route.frame.request"),
62
+ routeId: z.string(),
63
+ data: z.string().max(100 * 1024 * 1024),
64
+ binary: z.literal(false),
65
+ });
66
+ export const HostsRouteCloseRequestSchema = z.object({
67
+ type: z.literal("hosts.route.close.request"),
68
+ routeId: z.string().optional(),
69
+ scopeId: z.string().optional(),
70
+ });
71
+ export const HostsListResponseSchema = z.object({
72
+ type: z.literal("hosts.list.response"),
73
+ payload: z.object({
74
+ requestId: z.string(),
75
+ directory: HostDirectorySchema,
76
+ subscriptionId: z.string().optional(),
77
+ }),
78
+ });
79
+ export const HostsChangedSchema = z.object({
80
+ type: z.literal("hosts.changed"),
81
+ payload: z.object({ subscriptionId: z.string(), directory: HostDirectorySchema }),
82
+ });
83
+ export const HostsAddResponseSchema = z.object({
84
+ type: z.literal("hosts.add.response"),
85
+ payload: z.object({ requestId: z.string(), host: HostSummarySchema }),
86
+ });
87
+ export const HostsUpdateResponseSchema = z.object({
88
+ type: z.literal("hosts.update.response"),
89
+ payload: z.object({ requestId: z.string(), host: HostSummarySchema }),
90
+ });
91
+ export const HostsRemoveResponseSchema = z.object({
92
+ type: z.literal("hosts.remove.response"),
93
+ payload: z.object({ requestId: z.string() }),
94
+ });
95
+ export const HostsRouteOpenResponseSchema = z.object({
96
+ type: z.literal("hosts.route.open.response"),
97
+ payload: z.object({ requestId: z.string(), routeId: z.string() }),
98
+ });
99
+ export const HostsRouteFrameSchema = z.object({
100
+ type: z.literal("hosts.route.frame"),
101
+ payload: z.object({ subscriptionId: z.string(), data: z.string(), binary: z.literal(false) }),
102
+ });
103
+ export const HostsRouteClosedSchema = z.object({
104
+ type: z.literal("hosts.route.closed"),
105
+ payload: z.object({ subscriptionId: z.string(), code: z.string(), message: z.string() }),
106
+ });
107
+ // Logical B sessions are admitted under the authenticated physical link, never hello auth.
108
+ export const HostsLinkOpenRequestSchema = z.object({
109
+ type: z.literal("hosts.link.open.request"),
110
+ requestId: z.string(),
111
+ channelId: z.string().min(1).max(256),
112
+ });
113
+ export const HostsLinkOpenResponseSchema = z.object({
114
+ type: z.literal("hosts.link.open.response"),
115
+ payload: z.object({ requestId: z.string(), routeId: z.string() }),
116
+ });
117
+ //# sourceMappingURL=hosts.js.map