@meshery/schemas 1.3.41 → 1.3.43

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.
@@ -0,0 +1,458 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+
6
+ export interface paths {
7
+ "/api/integrations/connections/{connectionId}/console/capabilities": {
8
+ parameters: {
9
+ query?: never;
10
+ header?: never;
11
+ path?: never;
12
+ cookie?: never;
13
+ };
14
+ /**
15
+ * Report which console kinds a resource supports
16
+ * @description Resolve what the connection's console driver can do with the addressed resource, against live state rather than a static table: whether a resource admits a terminal generally depends on its current status. Used by a client to decide whether to offer a terminal or a log tail before opening a socket, and which containers the user may choose between.
17
+ */
18
+ get: operations["getConsoleCapabilities"];
19
+ put?: never;
20
+ post?: never;
21
+ delete?: never;
22
+ options?: never;
23
+ head?: never;
24
+ patch?: never;
25
+ trace?: never;
26
+ };
27
+ "/api/integrations/connections/{connectionId}/console/terminal": {
28
+ parameters: {
29
+ query?: never;
30
+ header?: never;
31
+ path?: never;
32
+ cookie?: never;
33
+ };
34
+ /**
35
+ * Open an interactive terminal over a WebSocket
36
+ * @description Upgrade to a WebSocket carrying an interactive, TTY-backed shell in the target resource. Consume with a native WebSocket client, not a generated RTK hook.
37
+ * Everything that can fail with a useful HTTP status — an unknown target, an unsupported console kind, an exhausted per-user console budget — is settled before the upgrade, so those failures arrive as ordinary HTTP responses rather than as a socket that opens and immediately closes. The handshake enforces a same-origin check: it is authenticated by an ambient session cookie, so accepting any Origin would let any page the user visits open a shell as them.
38
+ * The console runs with the requesting user's own credential, so the target's native authorization (Kubernetes RBAC, for a kubernetes connection) governs it unchanged.
39
+ * See ConsoleControlMessage for the frame protocol.
40
+ */
41
+ get: operations["openTerminalConsole"];
42
+ put?: never;
43
+ post?: never;
44
+ delete?: never;
45
+ options?: never;
46
+ head?: never;
47
+ patch?: never;
48
+ trace?: never;
49
+ };
50
+ "/api/integrations/connections/{connectionId}/console/logs": {
51
+ parameters: {
52
+ query?: never;
53
+ header?: never;
54
+ path?: never;
55
+ cookie?: never;
56
+ };
57
+ /**
58
+ * Stream a resource's logs over a WebSocket
59
+ * @description Upgrade to a WebSocket carrying the target resource's log output. With `follow=true` the socket stays open until the client leaves; otherwise it closes once the available history has been sent. Consume with a native WebSocket client, not a generated RTK hook.
60
+ * The stream parameters below are fixed when the remote log stream is created and cannot be renegotiated on a live socket: changing any of them means opening a new console.
61
+ * See ConsoleControlMessage for the frame protocol.
62
+ */
63
+ get: operations["openLogConsole"];
64
+ put?: never;
65
+ post?: never;
66
+ delete?: never;
67
+ options?: never;
68
+ head?: never;
69
+ patch?: never;
70
+ trace?: never;
71
+ };
72
+ }
73
+ export type webhooks = Record<string, never>;
74
+ export interface components {
75
+ schemas: {
76
+ /**
77
+ * @description The kinds of console a driver may support for a given target.
78
+ * @enum {string}
79
+ */
80
+ ConsoleKind: "terminal" | "logs";
81
+ /** @description Addresses the resource a console attaches to, within the universe of a single connection. The field names read Kubernetes-ish because that is the first driver, but each driver interprets them for itself: `namespace` is any parent scope, `container` is any sub-target within `name`. A driver ignores the fields it has no use for. */
82
+ ConsoleTarget: {
83
+ /** @description The driver-specific resource type, e.g. "pod". */
84
+ resource: string;
85
+ /** @description The parent scope of the resource, if it has one. */
86
+ namespace?: string;
87
+ /** @description Identifies the resource within its scope. */
88
+ name: string;
89
+ /** @description Selects a sub-target within the resource, if it has any. */
90
+ container?: string;
91
+ };
92
+ /** @description What a driver can do with one specific target. Resolved against live state rather than a static table, because whether a target admits a terminal generally depends on its current status. */
93
+ ConsoleCapabilities: {
94
+ /** @description Whether an interactive terminal can be opened. */
95
+ terminal: boolean;
96
+ /** @description Whether a log stream can be opened. */
97
+ logs: boolean;
98
+ /** @description The addressable sub-targets, if the resource has any. */
99
+ containers?: string[];
100
+ /** @description The sub-target used when ConsoleTarget.container is empty. */
101
+ defaultContainer?: string;
102
+ /** @description Explains, for a human, why an unsupported console kind is unsupported — e.g. that the pod is not running. */
103
+ reason?: string;
104
+ };
105
+ /**
106
+ * @description Identifies a console control frame. `resize` travels client-to-server; the rest travel server-to-client. A receiver ignores an unknown or wrong-direction type, so a newer peer can send frames an older one does not know about without breaking the console.
107
+ * @enum {string}
108
+ */
109
+ ConsoleControlType: "ready" | "resize" | "error" | "exit" | "eof";
110
+ /**
111
+ * @description The JSON payload of a console WebSocket's text frames.
112
+ * A console socket carries two interleaved channels, distinguished by WebSocket opcode rather than by an envelope field. Binary frames carry raw payload bytes: stdin keystrokes from the client (terminal consoles only), and stdout or log bytes to the client. Text frames carry one of these JSON control messages.
113
+ * Splitting on opcode keeps the hot path allocation-light and avoids base64-inflating every keystroke and every log line by a third. It is also required for correctness: terminal output is not valid UTF-8 in general — it carries escape sequences, and arbitrary octets from a program writing raw bytes — so a text frame could not carry it faithfully.
114
+ * Every console ends with exactly one terminal control frame (`error`, `exit`, or `eof`) before the socket is closed, so a client never has to infer why a stream stopped from the close code alone. The close code is 4000 when the console ended as intended and 4001 when it failed; both sit in the private-use range RFC 6455 §7.4.2 reserves for applications.
115
+ * Fields not relevant to a given `type` are omitted.
116
+ */
117
+ ConsoleControlMessage: {
118
+ /**
119
+ * @description Identifies a console control frame. `resize` travels client-to-server; the rest travel server-to-client. A receiver ignores an unknown or wrong-direction type, so a newer peer can send frames an older one does not know about without breaking the console.
120
+ * @enum {string}
121
+ */
122
+ type: "ready" | "resize" | "error" | "exit" | "eof";
123
+ /** @description Terminal width in character cells. Carried by `resize`. */
124
+ cols?: number;
125
+ /** @description Terminal height in character cells. Carried by `resize`. */
126
+ rows?: number;
127
+ /**
128
+ * @description The resolved target capabilities. Carried by `ready`, which the server sends once, after it has attached to the target. It lets a client render the sub-target it actually attached to when the request left `container` unspecified.
129
+ * Deliberately left as a pointer in Go: `omitempty` does not elide an empty struct, so a value type would stamp an empty capabilities object onto every `error` and `exit` frame.
130
+ */
131
+ capabilities?: {
132
+ /** @description Whether an interactive terminal can be opened. */
133
+ terminal: boolean;
134
+ /** @description Whether a log stream can be opened. */
135
+ logs: boolean;
136
+ /** @description The addressable sub-targets, if the resource has any. */
137
+ containers?: string[];
138
+ /** @description The sub-target used when ConsoleTarget.container is empty. */
139
+ defaultContainer?: string;
140
+ /** @description Explains, for a human, why an unsupported console kind is unsupported — e.g. that the pod is not running. */
141
+ reason?: string;
142
+ };
143
+ /** @description The MeshKit error code of an `error` frame, e.g. "meshery-server-1447". Lets a client branch on the failure without parsing prose. */
144
+ code?: string;
145
+ /** @description The human-readable description of an `error` frame. */
146
+ message?: string;
147
+ /** @description The remote command's status. Carried by `exit`. */
148
+ exitCode?: number;
149
+ };
150
+ };
151
+ responses: {
152
+ /** @description Invalid request body or request param */
153
+ 400: {
154
+ headers: {
155
+ [name: string]: unknown;
156
+ };
157
+ content: {
158
+ "text/plain": string;
159
+ };
160
+ };
161
+ /** @description Expired JWT token used or insufficient privilege */
162
+ 401: {
163
+ headers: {
164
+ [name: string]: unknown;
165
+ };
166
+ content: {
167
+ "text/plain": string;
168
+ };
169
+ };
170
+ /** @description Result not found */
171
+ 404: {
172
+ headers: {
173
+ [name: string]: unknown;
174
+ };
175
+ content: {
176
+ "text/plain": string;
177
+ };
178
+ };
179
+ /** @description Internal server error */
180
+ 500: {
181
+ headers: {
182
+ [name: string]: unknown;
183
+ };
184
+ content: {
185
+ "text/plain": string;
186
+ };
187
+ };
188
+ };
189
+ parameters: {
190
+ /** @description The connection whose resources the console addresses. */
191
+ connectionId: string;
192
+ /** @description The driver-specific resource type, e.g. `pod` for a kubernetes connection. */
193
+ resource: string;
194
+ /** @description The resource's name within its scope. */
195
+ name: string;
196
+ /** @description The resource's parent scope, where it has one. Required for namespaced Kubernetes resources. */
197
+ namespace: string;
198
+ /** @description A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted. */
199
+ container: string;
200
+ };
201
+ requestBodies: never;
202
+ headers: never;
203
+ pathItems: never;
204
+ }
205
+ export type $defs = Record<string, never>;
206
+ export interface operations {
207
+ getConsoleCapabilities: {
208
+ parameters: {
209
+ query: {
210
+ /** @description The driver-specific resource type, e.g. `pod` for a kubernetes connection. */
211
+ resource: string;
212
+ /** @description The resource's name within its scope. */
213
+ name: string;
214
+ /** @description The resource's parent scope, where it has one. Required for namespaced Kubernetes resources. */
215
+ namespace?: string;
216
+ /** @description A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted. */
217
+ container?: string;
218
+ };
219
+ header?: never;
220
+ path: {
221
+ /** @description The connection whose resources the console addresses. */
222
+ connectionId: string;
223
+ };
224
+ cookie?: never;
225
+ };
226
+ requestBody?: never;
227
+ responses: {
228
+ /** @description The console kinds the target admits. */
229
+ 200: {
230
+ headers: {
231
+ [name: string]: unknown;
232
+ };
233
+ content: {
234
+ "application/json": {
235
+ /** @description Whether an interactive terminal can be opened. */
236
+ terminal: boolean;
237
+ /** @description Whether a log stream can be opened. */
238
+ logs: boolean;
239
+ /** @description The addressable sub-targets, if the resource has any. */
240
+ containers?: string[];
241
+ /** @description The sub-target used when ConsoleTarget.container is empty. */
242
+ defaultContainer?: string;
243
+ /** @description Explains, for a human, why an unsupported console kind is unsupported — e.g. that the pod is not running. */
244
+ reason?: string;
245
+ };
246
+ };
247
+ };
248
+ /** @description Invalid request body or request param */
249
+ 400: {
250
+ headers: {
251
+ [name: string]: unknown;
252
+ };
253
+ content: {
254
+ "text/plain": string;
255
+ };
256
+ };
257
+ /** @description Expired JWT token used or insufficient privilege */
258
+ 401: {
259
+ headers: {
260
+ [name: string]: unknown;
261
+ };
262
+ content: {
263
+ "text/plain": string;
264
+ };
265
+ };
266
+ /** @description Result not found */
267
+ 404: {
268
+ headers: {
269
+ [name: string]: unknown;
270
+ };
271
+ content: {
272
+ "text/plain": string;
273
+ };
274
+ };
275
+ /** @description Internal server error */
276
+ 500: {
277
+ headers: {
278
+ [name: string]: unknown;
279
+ };
280
+ content: {
281
+ "text/plain": string;
282
+ };
283
+ };
284
+ };
285
+ };
286
+ openTerminalConsole: {
287
+ parameters: {
288
+ query: {
289
+ /** @description The driver-specific resource type, e.g. `pod` for a kubernetes connection. */
290
+ resource: string;
291
+ /** @description The resource's name within its scope. */
292
+ name: string;
293
+ /** @description The resource's parent scope, where it has one. Required for namespaced Kubernetes resources. */
294
+ namespace?: string;
295
+ /** @description A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted. */
296
+ container?: string;
297
+ /** @description The argv to execute, one query parameter per element. When omitted the driver picks a sensible interactive shell for the target. */
298
+ command?: string[];
299
+ };
300
+ header?: never;
301
+ path: {
302
+ /** @description The connection whose resources the console addresses. */
303
+ connectionId: string;
304
+ };
305
+ cookie?: never;
306
+ };
307
+ requestBody?: never;
308
+ responses: {
309
+ /** @description Switching Protocols. The connection becomes a console WebSocket speaking the frame protocol on ConsoleControlMessage. */
310
+ 101: {
311
+ headers: {
312
+ [name: string]: unknown;
313
+ };
314
+ content?: never;
315
+ };
316
+ /** @description Invalid request body or request param */
317
+ 400: {
318
+ headers: {
319
+ [name: string]: unknown;
320
+ };
321
+ content: {
322
+ "text/plain": string;
323
+ };
324
+ };
325
+ /** @description Expired JWT token used or insufficient privilege */
326
+ 401: {
327
+ headers: {
328
+ [name: string]: unknown;
329
+ };
330
+ content: {
331
+ "text/plain": string;
332
+ };
333
+ };
334
+ /** @description The WebSocket handshake carried an Origin that is neither the server's own nor in its configured allow-list. */
335
+ 403: {
336
+ headers: {
337
+ [name: string]: unknown;
338
+ };
339
+ content?: never;
340
+ };
341
+ /** @description Result not found */
342
+ 404: {
343
+ headers: {
344
+ [name: string]: unknown;
345
+ };
346
+ content: {
347
+ "text/plain": string;
348
+ };
349
+ };
350
+ /** @description The user already holds the maximum number of concurrent consoles. */
351
+ 429: {
352
+ headers: {
353
+ [name: string]: unknown;
354
+ };
355
+ content?: never;
356
+ };
357
+ /** @description Internal server error */
358
+ 500: {
359
+ headers: {
360
+ [name: string]: unknown;
361
+ };
362
+ content: {
363
+ "text/plain": string;
364
+ };
365
+ };
366
+ };
367
+ };
368
+ openLogConsole: {
369
+ parameters: {
370
+ query: {
371
+ /** @description The driver-specific resource type, e.g. `pod` for a kubernetes connection. */
372
+ resource: string;
373
+ /** @description The resource's name within its scope. */
374
+ name: string;
375
+ /** @description The resource's parent scope, where it has one. Required for namespaced Kubernetes resources. */
376
+ namespace?: string;
377
+ /** @description A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted. */
378
+ container?: string;
379
+ /** @description Keep the stream open and append new output as it is produced. */
380
+ follow?: boolean;
381
+ /** @description Return the logs of the target's prior instance, if any. */
382
+ previous?: boolean;
383
+ /** @description Prefix each line with an RFC 3339 timestamp. */
384
+ timestamps?: boolean;
385
+ /** @description Cap how many lines of history are replayed before following. Omit for no limit. */
386
+ tailLines?: number;
387
+ /** @description Bound history to output produced within the last N seconds. Omit for no bound; a value of 0 is treated as omitted. */
388
+ sinceSeconds?: number;
389
+ };
390
+ header?: never;
391
+ path: {
392
+ /** @description The connection whose resources the console addresses. */
393
+ connectionId: string;
394
+ };
395
+ cookie?: never;
396
+ };
397
+ requestBody?: never;
398
+ responses: {
399
+ /** @description Switching Protocols. The connection becomes a console WebSocket speaking the frame protocol on ConsoleControlMessage. */
400
+ 101: {
401
+ headers: {
402
+ [name: string]: unknown;
403
+ };
404
+ content?: never;
405
+ };
406
+ /** @description Invalid request body or request param */
407
+ 400: {
408
+ headers: {
409
+ [name: string]: unknown;
410
+ };
411
+ content: {
412
+ "text/plain": string;
413
+ };
414
+ };
415
+ /** @description Expired JWT token used or insufficient privilege */
416
+ 401: {
417
+ headers: {
418
+ [name: string]: unknown;
419
+ };
420
+ content: {
421
+ "text/plain": string;
422
+ };
423
+ };
424
+ /** @description The WebSocket handshake carried an Origin that is neither the server's own nor in its configured allow-list. */
425
+ 403: {
426
+ headers: {
427
+ [name: string]: unknown;
428
+ };
429
+ content?: never;
430
+ };
431
+ /** @description Result not found */
432
+ 404: {
433
+ headers: {
434
+ [name: string]: unknown;
435
+ };
436
+ content: {
437
+ "text/plain": string;
438
+ };
439
+ };
440
+ /** @description The user already holds the maximum number of concurrent consoles. */
441
+ 429: {
442
+ headers: {
443
+ [name: string]: unknown;
444
+ };
445
+ content?: never;
446
+ };
447
+ /** @description Internal server error */
448
+ 500: {
449
+ headers: {
450
+ [name: string]: unknown;
451
+ };
452
+ content: {
453
+ "text/plain": string;
454
+ };
455
+ };
456
+ };
457
+ };
458
+ }
@@ -0,0 +1 @@
1
+ 'use strict';
File without changes
@@ -0,0 +1,2 @@
1
+ declare const ConsoleSchema: Record<string, unknown>;
2
+ export default ConsoleSchema;
@@ -0,0 +1,4 @@
1
+ 'use strict';var e={openapi:"3.0.0",info:{title:"Console API",description:'OpenAPI schema for interactive consoles against the resources reachable through a Meshery connection: an interactive terminal, and a log tail.\n"Console" rather than "session": a Meshery session already means a user\'s authenticated session, and the two were read for one another.\nConsoles are deliberately connection-scoped and resource-agnostic. A console driver is registered per connection kind ("kubernetes" today; a container runtime, a managed database, or a remote host tomorrow), so support for a new resource universe is additive and none of the shapes below are Kubernetes-specific. `ConsoleTarget.resource` names a driver-specific resource type, and `namespace`/`container` are optional qualifiers a driver interprets for itself.\nTwo of the three endpoints are WebSockets. They are documented here because this file is the wire contract, but they must be consumed with a native WebSocket client rather than a generated RTK hook \u2014 the same way the Server-Sent Events endpoints in the System API are consumed with a native EventSource. The frame protocol they speak is described on ConsoleControlMessage.',version:"v1beta1",contact:{name:"Meshery Maintainers",email:"maintainers@meshery.io",url:"https://meshery.io"},license:{name:"Apache 2.0",url:"https://www.apache.org/licenses/LICENSE-2.0.html"}},security:[{jwt:[]}],tags:[{name:"Console",description:"Interactive terminal and log consoles against a connection's resources."}],paths:{"/api/integrations/connections/{connectionId}/console/capabilities":{get:{"x-internal":["meshery"],tags:["Console"],operationId:"getConsoleCapabilities",summary:"Report which console kinds a resource supports",description:"Resolve what the connection's console driver can do with the addressed resource, against live state rather than a static table: whether a resource admits a terminal generally depends on its current status. Used by a client to decide whether to offer a terminal or a log tail before opening a socket, and which containers the user may choose between.",parameters:[{name:"connectionId",in:"path",required:true,description:"The connection whose resources the console addresses.",schema:{type:"string",format:"uuid"}},{name:"resource",in:"query",required:true,description:"The driver-specific resource type, e.g. `pod` for a kubernetes connection.",schema:{type:"string",maxLength:253}},{name:"name",in:"query",required:true,description:"The resource's name within its scope.",schema:{type:"string",maxLength:253}},{name:"namespace",in:"query",required:false,description:"The resource's parent scope, where it has one. Required for namespaced Kubernetes resources.",schema:{type:"string",maxLength:253}},{name:"container",in:"query",required:false,description:"A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted.",schema:{type:"string",maxLength:253}}],responses:{200:{description:"The console kinds the target admits.",content:{"application/json":{schema:{type:"object",description:"What a driver can do with one specific target. Resolved against live state rather than a static table, because whether a target admits a terminal generally depends on its current status.",additionalProperties:false,required:["terminal","logs"],properties:{terminal:{type:"boolean",description:"Whether an interactive terminal can be opened.","x-oapi-codegen-extra-tags":{json:"terminal"}},logs:{type:"boolean",description:"Whether a log stream can be opened.","x-oapi-codegen-extra-tags":{json:"logs"}},containers:{type:"array",description:"The addressable sub-targets, if the resource has any.",maxItems:256,items:{type:"string",maxLength:253},"x-oapi-codegen-extra-tags":{json:"containers,omitempty"},"x-go-type-skip-optional-pointer":true},defaultContainer:{type:"string",description:"The sub-target used when ConsoleTarget.container is empty.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"defaultContainer,omitempty"},"x-go-type-skip-optional-pointer":true},reason:{type:"string",description:"Explains, for a human, why an unsupported console kind is unsupported \u2014 e.g. that the pod is not running.",maxLength:1024,"x-oapi-codegen-extra-tags":{json:"reason,omitempty"},"x-go-type-skip-optional-pointer":true}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/integrations/connections/{connectionId}/console/terminal":{get:{"x-internal":["meshery"],tags:["Console"],operationId:"openTerminalConsole",summary:"Open an interactive terminal over a WebSocket",description:`Upgrade to a WebSocket carrying an interactive, TTY-backed shell in the target resource. Consume with a native WebSocket client, not a generated RTK hook.
2
+ Everything that can fail with a useful HTTP status \u2014 an unknown target, an unsupported console kind, an exhausted per-user console budget \u2014 is settled before the upgrade, so those failures arrive as ordinary HTTP responses rather than as a socket that opens and immediately closes. The handshake enforces a same-origin check: it is authenticated by an ambient session cookie, so accepting any Origin would let any page the user visits open a shell as them.
3
+ The console runs with the requesting user's own credential, so the target's native authorization (Kubernetes RBAC, for a kubernetes connection) governs it unchanged.
4
+ See ConsoleControlMessage for the frame protocol.`,parameters:[{name:"connectionId",in:"path",required:true,description:"The connection whose resources the console addresses.",schema:{type:"string",format:"uuid"}},{name:"resource",in:"query",required:true,description:"The driver-specific resource type, e.g. `pod` for a kubernetes connection.",schema:{type:"string",maxLength:253}},{name:"name",in:"query",required:true,description:"The resource's name within its scope.",schema:{type:"string",maxLength:253}},{name:"namespace",in:"query",required:false,description:"The resource's parent scope, where it has one. Required for namespaced Kubernetes resources.",schema:{type:"string",maxLength:253}},{name:"container",in:"query",required:false,description:"A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted.",schema:{type:"string",maxLength:253}},{name:"command",in:"query",description:"The argv to execute, one query parameter per element. When omitted the driver picks a sensible interactive shell for the target.",required:false,schema:{type:"array",maxItems:64,items:{type:"string",maxLength:4096}}}],responses:{101:{description:"Switching Protocols. The connection becomes a console WebSocket speaking the frame protocol on ConsoleControlMessage."},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},403:{description:"The WebSocket handshake carried an Origin that is neither the server's own nor in its configured allow-list."},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},429:{description:"The user already holds the maximum number of concurrent consoles."},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/integrations/connections/{connectionId}/console/logs":{get:{"x-internal":["meshery"],tags:["Console"],operationId:"openLogConsole",summary:"Stream a resource's logs over a WebSocket",description:"Upgrade to a WebSocket carrying the target resource's log output. With `follow=true` the socket stays open until the client leaves; otherwise it closes once the available history has been sent. Consume with a native WebSocket client, not a generated RTK hook.\nThe stream parameters below are fixed when the remote log stream is created and cannot be renegotiated on a live socket: changing any of them means opening a new console.\nSee ConsoleControlMessage for the frame protocol.",parameters:[{name:"connectionId",in:"path",required:true,description:"The connection whose resources the console addresses.",schema:{type:"string",format:"uuid"}},{name:"resource",in:"query",required:true,description:"The driver-specific resource type, e.g. `pod` for a kubernetes connection.",schema:{type:"string",maxLength:253}},{name:"name",in:"query",required:true,description:"The resource's name within its scope.",schema:{type:"string",maxLength:253}},{name:"namespace",in:"query",required:false,description:"The resource's parent scope, where it has one. Required for namespaced Kubernetes resources.",schema:{type:"string",maxLength:253}},{name:"container",in:"query",required:false,description:"A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted.",schema:{type:"string",maxLength:253}},{name:"follow",in:"query",description:"Keep the stream open and append new output as it is produced.",required:false,schema:{type:"boolean",default:false}},{name:"previous",in:"query",description:"Return the logs of the target's prior instance, if any.",required:false,schema:{type:"boolean",default:false}},{name:"timestamps",in:"query",description:"Prefix each line with an RFC 3339 timestamp.",required:false,schema:{type:"boolean",default:false}},{name:"tailLines",in:"query",description:"Cap how many lines of history are replayed before following. Omit for no limit.",required:false,schema:{type:"integer",format:"int64",minimum:0}},{name:"sinceSeconds",in:"query",description:"Bound history to output produced within the last N seconds. Omit for no bound; a value of 0 is treated as omitted.",required:false,schema:{type:"integer",format:"int64",minimum:0}}],responses:{101:{description:"Switching Protocols. The connection becomes a console WebSocket speaking the frame protocol on ConsoleControlMessage."},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},403:{description:"The WebSocket handshake carried an Origin that is neither the server's own nor in its configured allow-list."},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},429:{description:"The user already holds the maximum number of concurrent consoles."},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}}},components:{responses:{400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}},securitySchemes:{jwt:{type:"http",scheme:"bearer",bearerFormat:"JWT"}},parameters:{connectionId:{name:"connectionId",in:"path",required:true,description:"The connection whose resources the console addresses.",schema:{type:"string",format:"uuid"}},resource:{name:"resource",in:"query",required:true,description:"The driver-specific resource type, e.g. `pod` for a kubernetes connection.",schema:{type:"string",maxLength:253}},name:{name:"name",in:"query",required:true,description:"The resource's name within its scope.",schema:{type:"string",maxLength:253}},namespace:{name:"namespace",in:"query",required:false,description:"The resource's parent scope, where it has one. Required for namespaced Kubernetes resources.",schema:{type:"string",maxLength:253}},container:{name:"container",in:"query",required:false,description:"A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted.",schema:{type:"string",maxLength:253}}},schemas:{ConsoleKind:{type:"string",description:"The kinds of console a driver may support for a given target.",enum:["terminal","logs"]},ConsoleTarget:{type:"object",description:"Addresses the resource a console attaches to, within the universe of a single connection. The field names read Kubernetes-ish because that is the first driver, but each driver interprets them for itself: `namespace` is any parent scope, `container` is any sub-target within `name`. A driver ignores the fields it has no use for.",additionalProperties:false,required:["resource","name"],properties:{resource:{type:"string",description:'The driver-specific resource type, e.g. "pod".',maxLength:253,"x-oapi-codegen-extra-tags":{json:"resource"}},namespace:{type:"string",description:"The parent scope of the resource, if it has one.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"namespace,omitempty"},"x-go-type-skip-optional-pointer":true},name:{type:"string",description:"Identifies the resource within its scope.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"name"}},container:{type:"string",description:"Selects a sub-target within the resource, if it has any.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"container,omitempty"},"x-go-type-skip-optional-pointer":true}}},ConsoleCapabilities:{type:"object",description:"What a driver can do with one specific target. Resolved against live state rather than a static table, because whether a target admits a terminal generally depends on its current status.",additionalProperties:false,required:["terminal","logs"],properties:{terminal:{type:"boolean",description:"Whether an interactive terminal can be opened.","x-oapi-codegen-extra-tags":{json:"terminal"}},logs:{type:"boolean",description:"Whether a log stream can be opened.","x-oapi-codegen-extra-tags":{json:"logs"}},containers:{type:"array",description:"The addressable sub-targets, if the resource has any.",maxItems:256,items:{type:"string",maxLength:253},"x-oapi-codegen-extra-tags":{json:"containers,omitempty"},"x-go-type-skip-optional-pointer":true},defaultContainer:{type:"string",description:"The sub-target used when ConsoleTarget.container is empty.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"defaultContainer,omitempty"},"x-go-type-skip-optional-pointer":true},reason:{type:"string",description:"Explains, for a human, why an unsupported console kind is unsupported \u2014 e.g. that the pod is not running.",maxLength:1024,"x-oapi-codegen-extra-tags":{json:"reason,omitempty"},"x-go-type-skip-optional-pointer":true}}},ConsoleControlType:{type:"string",description:"Identifies a console control frame. `resize` travels client-to-server; the rest travel server-to-client. A receiver ignores an unknown or wrong-direction type, so a newer peer can send frames an older one does not know about without breaking the console.",enum:["ready","resize","error","exit","eof"]},ConsoleControlMessage:{type:"object",description:"The JSON payload of a console WebSocket's text frames.\nA console socket carries two interleaved channels, distinguished by WebSocket opcode rather than by an envelope field. Binary frames carry raw payload bytes: stdin keystrokes from the client (terminal consoles only), and stdout or log bytes to the client. Text frames carry one of these JSON control messages.\nSplitting on opcode keeps the hot path allocation-light and avoids base64-inflating every keystroke and every log line by a third. It is also required for correctness: terminal output is not valid UTF-8 in general \u2014 it carries escape sequences, and arbitrary octets from a program writing raw bytes \u2014 so a text frame could not carry it faithfully.\nEvery console ends with exactly one terminal control frame (`error`, `exit`, or `eof`) before the socket is closed, so a client never has to infer why a stream stopped from the close code alone. The close code is 4000 when the console ended as intended and 4001 when it failed; both sit in the private-use range RFC 6455 \xA77.4.2 reserves for applications.\nFields not relevant to a given `type` are omitted.",additionalProperties:false,required:["type"],properties:{type:{type:"string",description:"Identifies a console control frame. `resize` travels client-to-server; the rest travel server-to-client. A receiver ignores an unknown or wrong-direction type, so a newer peer can send frames an older one does not know about without breaking the console.",enum:["ready","resize","error","exit","eof"]},cols:{type:"integer",description:"Terminal width in character cells. Carried by `resize`.",minimum:0,maximum:65535,"x-oapi-codegen-extra-tags":{json:"cols,omitempty"},"x-go-type-skip-optional-pointer":true},rows:{type:"integer",description:"Terminal height in character cells. Carried by `resize`.",minimum:0,maximum:65535,"x-oapi-codegen-extra-tags":{json:"rows,omitempty"},"x-go-type-skip-optional-pointer":true},capabilities:{allOf:[{type:"object",description:"What a driver can do with one specific target. Resolved against live state rather than a static table, because whether a target admits a terminal generally depends on its current status.",additionalProperties:false,required:["terminal","logs"],properties:{terminal:{type:"boolean",description:"Whether an interactive terminal can be opened.","x-oapi-codegen-extra-tags":{json:"terminal"}},logs:{type:"boolean",description:"Whether a log stream can be opened.","x-oapi-codegen-extra-tags":{json:"logs"}},containers:{type:"array",description:"The addressable sub-targets, if the resource has any.",maxItems:256,items:{type:"string",maxLength:253},"x-oapi-codegen-extra-tags":{json:"containers,omitempty"},"x-go-type-skip-optional-pointer":true},defaultContainer:{type:"string",description:"The sub-target used when ConsoleTarget.container is empty.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"defaultContainer,omitempty"},"x-go-type-skip-optional-pointer":true},reason:{type:"string",description:"Explains, for a human, why an unsupported console kind is unsupported \u2014 e.g. that the pod is not running.",maxLength:1024,"x-oapi-codegen-extra-tags":{json:"reason,omitempty"},"x-go-type-skip-optional-pointer":true}}}],description:"The resolved target capabilities. Carried by `ready`, which the server sends once, after it has attached to the target. It lets a client render the sub-target it actually attached to when the request left `container` unspecified.\nDeliberately left as a pointer in Go: `omitempty` does not elide an empty struct, so a value type would stamp an empty capabilities object onto every `error` and `exit` frame.","x-oapi-codegen-extra-tags":{json:"capabilities,omitempty"}},code:{type:"string",description:'The MeshKit error code of an `error` frame, e.g. "meshery-server-1447". Lets a client branch on the failure without parsing prose.',maxLength:64,"x-oapi-codegen-extra-tags":{json:"code,omitempty"},"x-go-type-skip-optional-pointer":true},message:{type:"string",description:"The human-readable description of an `error` frame.",maxLength:4096,"x-oapi-codegen-extra-tags":{json:"message,omitempty"},"x-go-type-skip-optional-pointer":true},exitCode:{type:"integer",description:"The remote command's status. Carried by `exit`.","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"exitCode"}}}}}}},t=e;module.exports=t;
@@ -0,0 +1,4 @@
1
+ var e={openapi:"3.0.0",info:{title:"Console API",description:'OpenAPI schema for interactive consoles against the resources reachable through a Meshery connection: an interactive terminal, and a log tail.\n"Console" rather than "session": a Meshery session already means a user\'s authenticated session, and the two were read for one another.\nConsoles are deliberately connection-scoped and resource-agnostic. A console driver is registered per connection kind ("kubernetes" today; a container runtime, a managed database, or a remote host tomorrow), so support for a new resource universe is additive and none of the shapes below are Kubernetes-specific. `ConsoleTarget.resource` names a driver-specific resource type, and `namespace`/`container` are optional qualifiers a driver interprets for itself.\nTwo of the three endpoints are WebSockets. They are documented here because this file is the wire contract, but they must be consumed with a native WebSocket client rather than a generated RTK hook \u2014 the same way the Server-Sent Events endpoints in the System API are consumed with a native EventSource. The frame protocol they speak is described on ConsoleControlMessage.',version:"v1beta1",contact:{name:"Meshery Maintainers",email:"maintainers@meshery.io",url:"https://meshery.io"},license:{name:"Apache 2.0",url:"https://www.apache.org/licenses/LICENSE-2.0.html"}},security:[{jwt:[]}],tags:[{name:"Console",description:"Interactive terminal and log consoles against a connection's resources."}],paths:{"/api/integrations/connections/{connectionId}/console/capabilities":{get:{"x-internal":["meshery"],tags:["Console"],operationId:"getConsoleCapabilities",summary:"Report which console kinds a resource supports",description:"Resolve what the connection's console driver can do with the addressed resource, against live state rather than a static table: whether a resource admits a terminal generally depends on its current status. Used by a client to decide whether to offer a terminal or a log tail before opening a socket, and which containers the user may choose between.",parameters:[{name:"connectionId",in:"path",required:true,description:"The connection whose resources the console addresses.",schema:{type:"string",format:"uuid"}},{name:"resource",in:"query",required:true,description:"The driver-specific resource type, e.g. `pod` for a kubernetes connection.",schema:{type:"string",maxLength:253}},{name:"name",in:"query",required:true,description:"The resource's name within its scope.",schema:{type:"string",maxLength:253}},{name:"namespace",in:"query",required:false,description:"The resource's parent scope, where it has one. Required for namespaced Kubernetes resources.",schema:{type:"string",maxLength:253}},{name:"container",in:"query",required:false,description:"A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted.",schema:{type:"string",maxLength:253}}],responses:{200:{description:"The console kinds the target admits.",content:{"application/json":{schema:{type:"object",description:"What a driver can do with one specific target. Resolved against live state rather than a static table, because whether a target admits a terminal generally depends on its current status.",additionalProperties:false,required:["terminal","logs"],properties:{terminal:{type:"boolean",description:"Whether an interactive terminal can be opened.","x-oapi-codegen-extra-tags":{json:"terminal"}},logs:{type:"boolean",description:"Whether a log stream can be opened.","x-oapi-codegen-extra-tags":{json:"logs"}},containers:{type:"array",description:"The addressable sub-targets, if the resource has any.",maxItems:256,items:{type:"string",maxLength:253},"x-oapi-codegen-extra-tags":{json:"containers,omitempty"},"x-go-type-skip-optional-pointer":true},defaultContainer:{type:"string",description:"The sub-target used when ConsoleTarget.container is empty.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"defaultContainer,omitempty"},"x-go-type-skip-optional-pointer":true},reason:{type:"string",description:"Explains, for a human, why an unsupported console kind is unsupported \u2014 e.g. that the pod is not running.",maxLength:1024,"x-oapi-codegen-extra-tags":{json:"reason,omitempty"},"x-go-type-skip-optional-pointer":true}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/integrations/connections/{connectionId}/console/terminal":{get:{"x-internal":["meshery"],tags:["Console"],operationId:"openTerminalConsole",summary:"Open an interactive terminal over a WebSocket",description:`Upgrade to a WebSocket carrying an interactive, TTY-backed shell in the target resource. Consume with a native WebSocket client, not a generated RTK hook.
2
+ Everything that can fail with a useful HTTP status \u2014 an unknown target, an unsupported console kind, an exhausted per-user console budget \u2014 is settled before the upgrade, so those failures arrive as ordinary HTTP responses rather than as a socket that opens and immediately closes. The handshake enforces a same-origin check: it is authenticated by an ambient session cookie, so accepting any Origin would let any page the user visits open a shell as them.
3
+ The console runs with the requesting user's own credential, so the target's native authorization (Kubernetes RBAC, for a kubernetes connection) governs it unchanged.
4
+ See ConsoleControlMessage for the frame protocol.`,parameters:[{name:"connectionId",in:"path",required:true,description:"The connection whose resources the console addresses.",schema:{type:"string",format:"uuid"}},{name:"resource",in:"query",required:true,description:"The driver-specific resource type, e.g. `pod` for a kubernetes connection.",schema:{type:"string",maxLength:253}},{name:"name",in:"query",required:true,description:"The resource's name within its scope.",schema:{type:"string",maxLength:253}},{name:"namespace",in:"query",required:false,description:"The resource's parent scope, where it has one. Required for namespaced Kubernetes resources.",schema:{type:"string",maxLength:253}},{name:"container",in:"query",required:false,description:"A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted.",schema:{type:"string",maxLength:253}},{name:"command",in:"query",description:"The argv to execute, one query parameter per element. When omitted the driver picks a sensible interactive shell for the target.",required:false,schema:{type:"array",maxItems:64,items:{type:"string",maxLength:4096}}}],responses:{101:{description:"Switching Protocols. The connection becomes a console WebSocket speaking the frame protocol on ConsoleControlMessage."},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},403:{description:"The WebSocket handshake carried an Origin that is neither the server's own nor in its configured allow-list."},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},429:{description:"The user already holds the maximum number of concurrent consoles."},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/integrations/connections/{connectionId}/console/logs":{get:{"x-internal":["meshery"],tags:["Console"],operationId:"openLogConsole",summary:"Stream a resource's logs over a WebSocket",description:"Upgrade to a WebSocket carrying the target resource's log output. With `follow=true` the socket stays open until the client leaves; otherwise it closes once the available history has been sent. Consume with a native WebSocket client, not a generated RTK hook.\nThe stream parameters below are fixed when the remote log stream is created and cannot be renegotiated on a live socket: changing any of them means opening a new console.\nSee ConsoleControlMessage for the frame protocol.",parameters:[{name:"connectionId",in:"path",required:true,description:"The connection whose resources the console addresses.",schema:{type:"string",format:"uuid"}},{name:"resource",in:"query",required:true,description:"The driver-specific resource type, e.g. `pod` for a kubernetes connection.",schema:{type:"string",maxLength:253}},{name:"name",in:"query",required:true,description:"The resource's name within its scope.",schema:{type:"string",maxLength:253}},{name:"namespace",in:"query",required:false,description:"The resource's parent scope, where it has one. Required for namespaced Kubernetes resources.",schema:{type:"string",maxLength:253}},{name:"container",in:"query",required:false,description:"A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted.",schema:{type:"string",maxLength:253}},{name:"follow",in:"query",description:"Keep the stream open and append new output as it is produced.",required:false,schema:{type:"boolean",default:false}},{name:"previous",in:"query",description:"Return the logs of the target's prior instance, if any.",required:false,schema:{type:"boolean",default:false}},{name:"timestamps",in:"query",description:"Prefix each line with an RFC 3339 timestamp.",required:false,schema:{type:"boolean",default:false}},{name:"tailLines",in:"query",description:"Cap how many lines of history are replayed before following. Omit for no limit.",required:false,schema:{type:"integer",format:"int64",minimum:0}},{name:"sinceSeconds",in:"query",description:"Bound history to output produced within the last N seconds. Omit for no bound; a value of 0 is treated as omitted.",required:false,schema:{type:"integer",format:"int64",minimum:0}}],responses:{101:{description:"Switching Protocols. The connection becomes a console WebSocket speaking the frame protocol on ConsoleControlMessage."},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},403:{description:"The WebSocket handshake carried an Origin that is neither the server's own nor in its configured allow-list."},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},429:{description:"The user already holds the maximum number of concurrent consoles."},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}}},components:{responses:{400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}},securitySchemes:{jwt:{type:"http",scheme:"bearer",bearerFormat:"JWT"}},parameters:{connectionId:{name:"connectionId",in:"path",required:true,description:"The connection whose resources the console addresses.",schema:{type:"string",format:"uuid"}},resource:{name:"resource",in:"query",required:true,description:"The driver-specific resource type, e.g. `pod` for a kubernetes connection.",schema:{type:"string",maxLength:253}},name:{name:"name",in:"query",required:true,description:"The resource's name within its scope.",schema:{type:"string",maxLength:253}},namespace:{name:"namespace",in:"query",required:false,description:"The resource's parent scope, where it has one. Required for namespaced Kubernetes resources.",schema:{type:"string",maxLength:253}},container:{name:"container",in:"query",required:false,description:"A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted.",schema:{type:"string",maxLength:253}}},schemas:{ConsoleKind:{type:"string",description:"The kinds of console a driver may support for a given target.",enum:["terminal","logs"]},ConsoleTarget:{type:"object",description:"Addresses the resource a console attaches to, within the universe of a single connection. The field names read Kubernetes-ish because that is the first driver, but each driver interprets them for itself: `namespace` is any parent scope, `container` is any sub-target within `name`. A driver ignores the fields it has no use for.",additionalProperties:false,required:["resource","name"],properties:{resource:{type:"string",description:'The driver-specific resource type, e.g. "pod".',maxLength:253,"x-oapi-codegen-extra-tags":{json:"resource"}},namespace:{type:"string",description:"The parent scope of the resource, if it has one.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"namespace,omitempty"},"x-go-type-skip-optional-pointer":true},name:{type:"string",description:"Identifies the resource within its scope.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"name"}},container:{type:"string",description:"Selects a sub-target within the resource, if it has any.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"container,omitempty"},"x-go-type-skip-optional-pointer":true}}},ConsoleCapabilities:{type:"object",description:"What a driver can do with one specific target. Resolved against live state rather than a static table, because whether a target admits a terminal generally depends on its current status.",additionalProperties:false,required:["terminal","logs"],properties:{terminal:{type:"boolean",description:"Whether an interactive terminal can be opened.","x-oapi-codegen-extra-tags":{json:"terminal"}},logs:{type:"boolean",description:"Whether a log stream can be opened.","x-oapi-codegen-extra-tags":{json:"logs"}},containers:{type:"array",description:"The addressable sub-targets, if the resource has any.",maxItems:256,items:{type:"string",maxLength:253},"x-oapi-codegen-extra-tags":{json:"containers,omitempty"},"x-go-type-skip-optional-pointer":true},defaultContainer:{type:"string",description:"The sub-target used when ConsoleTarget.container is empty.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"defaultContainer,omitempty"},"x-go-type-skip-optional-pointer":true},reason:{type:"string",description:"Explains, for a human, why an unsupported console kind is unsupported \u2014 e.g. that the pod is not running.",maxLength:1024,"x-oapi-codegen-extra-tags":{json:"reason,omitempty"},"x-go-type-skip-optional-pointer":true}}},ConsoleControlType:{type:"string",description:"Identifies a console control frame. `resize` travels client-to-server; the rest travel server-to-client. A receiver ignores an unknown or wrong-direction type, so a newer peer can send frames an older one does not know about without breaking the console.",enum:["ready","resize","error","exit","eof"]},ConsoleControlMessage:{type:"object",description:"The JSON payload of a console WebSocket's text frames.\nA console socket carries two interleaved channels, distinguished by WebSocket opcode rather than by an envelope field. Binary frames carry raw payload bytes: stdin keystrokes from the client (terminal consoles only), and stdout or log bytes to the client. Text frames carry one of these JSON control messages.\nSplitting on opcode keeps the hot path allocation-light and avoids base64-inflating every keystroke and every log line by a third. It is also required for correctness: terminal output is not valid UTF-8 in general \u2014 it carries escape sequences, and arbitrary octets from a program writing raw bytes \u2014 so a text frame could not carry it faithfully.\nEvery console ends with exactly one terminal control frame (`error`, `exit`, or `eof`) before the socket is closed, so a client never has to infer why a stream stopped from the close code alone. The close code is 4000 when the console ended as intended and 4001 when it failed; both sit in the private-use range RFC 6455 \xA77.4.2 reserves for applications.\nFields not relevant to a given `type` are omitted.",additionalProperties:false,required:["type"],properties:{type:{type:"string",description:"Identifies a console control frame. `resize` travels client-to-server; the rest travel server-to-client. A receiver ignores an unknown or wrong-direction type, so a newer peer can send frames an older one does not know about without breaking the console.",enum:["ready","resize","error","exit","eof"]},cols:{type:"integer",description:"Terminal width in character cells. Carried by `resize`.",minimum:0,maximum:65535,"x-oapi-codegen-extra-tags":{json:"cols,omitempty"},"x-go-type-skip-optional-pointer":true},rows:{type:"integer",description:"Terminal height in character cells. Carried by `resize`.",minimum:0,maximum:65535,"x-oapi-codegen-extra-tags":{json:"rows,omitempty"},"x-go-type-skip-optional-pointer":true},capabilities:{allOf:[{type:"object",description:"What a driver can do with one specific target. Resolved against live state rather than a static table, because whether a target admits a terminal generally depends on its current status.",additionalProperties:false,required:["terminal","logs"],properties:{terminal:{type:"boolean",description:"Whether an interactive terminal can be opened.","x-oapi-codegen-extra-tags":{json:"terminal"}},logs:{type:"boolean",description:"Whether a log stream can be opened.","x-oapi-codegen-extra-tags":{json:"logs"}},containers:{type:"array",description:"The addressable sub-targets, if the resource has any.",maxItems:256,items:{type:"string",maxLength:253},"x-oapi-codegen-extra-tags":{json:"containers,omitempty"},"x-go-type-skip-optional-pointer":true},defaultContainer:{type:"string",description:"The sub-target used when ConsoleTarget.container is empty.",maxLength:253,"x-oapi-codegen-extra-tags":{json:"defaultContainer,omitempty"},"x-go-type-skip-optional-pointer":true},reason:{type:"string",description:"Explains, for a human, why an unsupported console kind is unsupported \u2014 e.g. that the pod is not running.",maxLength:1024,"x-oapi-codegen-extra-tags":{json:"reason,omitempty"},"x-go-type-skip-optional-pointer":true}}}],description:"The resolved target capabilities. Carried by `ready`, which the server sends once, after it has attached to the target. It lets a client render the sub-target it actually attached to when the request left `container` unspecified.\nDeliberately left as a pointer in Go: `omitempty` does not elide an empty struct, so a value type would stamp an empty capabilities object onto every `error` and `exit` frame.","x-oapi-codegen-extra-tags":{json:"capabilities,omitempty"}},code:{type:"string",description:'The MeshKit error code of an `error` frame, e.g. "meshery-server-1447". Lets a client branch on the failure without parsing prose.',maxLength:64,"x-oapi-codegen-extra-tags":{json:"code,omitempty"},"x-go-type-skip-optional-pointer":true},message:{type:"string",description:"The human-readable description of an `error` frame.",maxLength:4096,"x-oapi-codegen-extra-tags":{json:"message,omitempty"},"x-go-type-skip-optional-pointer":true},exitCode:{type:"integer",description:"The remote command's status. Carried by `exit`.","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"exitCode"}}}}}}},t=e;export{t as default};