@nomux-sh/extension 0.0.0-stage → 0.1.2
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/LICENSE-APACHE +202 -0
- package/LICENSE-MIT +22 -0
- package/README.md +136 -2
- package/dist/api-version.d.ts +15 -0
- package/dist/api-version.js +37 -0
- package/dist/call.d.ts +12 -0
- package/dist/call.js +1 -0
- package/dist/codec.d.ts +22 -0
- package/dist/codec.js +5 -0
- package/dist/connection.d.ts +57 -0
- package/dist/connection.js +183 -0
- package/dist/error.d.ts +41 -0
- package/dist/error.js +61 -0
- package/dist/extension.d.ts +75 -0
- package/dist/extension.js +132 -0
- package/dist/frame.d.ts +32 -0
- package/dist/frame.js +99 -0
- package/dist/generated/nomux/extension/v1/call.d.ts +29 -0
- package/dist/generated/nomux/extension/v1/call.js +103 -0
- package/dist/generated/nomux/extension/v1/envelope.d.ts +176 -0
- package/dist/generated/nomux/extension/v1/envelope.js +476 -0
- package/dist/generated/nomux/extension/v1/handshake.d.ts +66 -0
- package/dist/generated/nomux/extension/v1/handshake.js +269 -0
- package/dist/generated/nomux/extension/v1/lifecycle.d.ts +36 -0
- package/dist/generated/nomux/extension/v1/lifecycle.js +205 -0
- package/dist/handshake.d.ts +17 -0
- package/dist/handshake.js +36 -0
- package/dist/host.d.ts +37 -0
- package/dist/host.js +73 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +16 -0
- package/dist/outbound.d.ts +16 -0
- package/dist/outbound.js +30 -0
- package/dist/pending-calls.d.ts +20 -0
- package/dist/pending-calls.js +43 -0
- package/package.json +53 -4
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.18.5
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: nomux/extension/v1/envelope.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
import { CallRequest, CallResponse } from "./call.js";
|
|
9
|
+
import { Hello, Welcome } from "./handshake.js";
|
|
10
|
+
import { HealthRequest, HealthResponse, InitializeRequest, InitializeResponse, ShutdownRequest, ShutdownResponse, } from "./lifecycle.js";
|
|
11
|
+
/**
|
|
12
|
+
* The reason for a failed request.
|
|
13
|
+
*
|
|
14
|
+
* The values 1 to 5 are equal to the values of `ErrorCode` in the nomux
|
|
15
|
+
* control protocol (package `nomux.wire.v1`).
|
|
16
|
+
*/
|
|
17
|
+
export var ErrorCode;
|
|
18
|
+
(function (ErrorCode) {
|
|
19
|
+
/**
|
|
20
|
+
* UNSPECIFIED - The sender did not set the field. The receiver treats this as
|
|
21
|
+
* `ERROR_CODE_FAILED`. The receiver does the same for a value that it does
|
|
22
|
+
* not know.
|
|
23
|
+
*/
|
|
24
|
+
ErrorCode[ErrorCode["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
25
|
+
/** FAILED - The request failed, and no other code gives the reason. */
|
|
26
|
+
ErrorCode[ErrorCode["FAILED"] = 1] = "FAILED";
|
|
27
|
+
/** NOT_FOUND - The method or the item that the request names does not exist. */
|
|
28
|
+
ErrorCode[ErrorCode["NOT_FOUND"] = 2] = "NOT_FOUND";
|
|
29
|
+
/** TIMEOUT - The receiver did not complete the request in the permitted time. */
|
|
30
|
+
ErrorCode[ErrorCode["TIMEOUT"] = 3] = "TIMEOUT";
|
|
31
|
+
/** PERMISSION_DENIED - The extension does not have the permission that the request needs. */
|
|
32
|
+
ErrorCode[ErrorCode["PERMISSION_DENIED"] = 4] = "PERMISSION_DENIED";
|
|
33
|
+
/**
|
|
34
|
+
* VERSION_INCOMPATIBLE - The host does not supply the extension API version that the extension
|
|
35
|
+
* needs. Only the reply to `Hello` uses this code.
|
|
36
|
+
*/
|
|
37
|
+
ErrorCode[ErrorCode["VERSION_INCOMPATIBLE"] = 5] = "VERSION_INCOMPATIBLE";
|
|
38
|
+
/** INVALID_ARGUMENT - The receiver cannot read the payload of the request. */
|
|
39
|
+
ErrorCode[ErrorCode["INVALID_ARGUMENT"] = 6] = "INVALID_ARGUMENT";
|
|
40
|
+
/** CANCELLED - The receiver stopped the request because the sender sent `Cancel`. */
|
|
41
|
+
ErrorCode[ErrorCode["CANCELLED"] = 7] = "CANCELLED";
|
|
42
|
+
ErrorCode[ErrorCode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
43
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
44
|
+
function createBaseError() {
|
|
45
|
+
return { code: 0, message: "" };
|
|
46
|
+
}
|
|
47
|
+
export const Error = {
|
|
48
|
+
encode(message, writer = new BinaryWriter()) {
|
|
49
|
+
if (message.code !== 0) {
|
|
50
|
+
writer.uint32(8).int32(message.code);
|
|
51
|
+
}
|
|
52
|
+
if (message.message !== "") {
|
|
53
|
+
writer.uint32(18).string(message.message);
|
|
54
|
+
}
|
|
55
|
+
return writer;
|
|
56
|
+
},
|
|
57
|
+
decode(input, length) {
|
|
58
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
59
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
60
|
+
if (previousRecursionDepth >= 100) {
|
|
61
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
62
|
+
}
|
|
63
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
64
|
+
try {
|
|
65
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
66
|
+
const message = createBaseError();
|
|
67
|
+
while (reader.pos < end) {
|
|
68
|
+
const tag = reader.uint32();
|
|
69
|
+
switch (tag >>> 3) {
|
|
70
|
+
case 1: {
|
|
71
|
+
if (tag !== 8) {
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
message.code = reader.int32();
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
case 2: {
|
|
78
|
+
if (tag !== 18) {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
message.message = reader.string();
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
reader.skip(tag & 7);
|
|
89
|
+
}
|
|
90
|
+
return message;
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
function createBaseRequest() {
|
|
98
|
+
return { id: 0n, body: undefined };
|
|
99
|
+
}
|
|
100
|
+
export const Request = {
|
|
101
|
+
encode(message, writer = new BinaryWriter()) {
|
|
102
|
+
if (message.id !== 0n) {
|
|
103
|
+
if (BigInt.asUintN(64, message.id) !== message.id) {
|
|
104
|
+
throw new globalThis.Error("value provided for field message.id of type uint64 too large");
|
|
105
|
+
}
|
|
106
|
+
writer.uint32(8).uint64(message.id);
|
|
107
|
+
}
|
|
108
|
+
switch (message.body?.$case) {
|
|
109
|
+
case "hello":
|
|
110
|
+
Hello.encode(message.body.value, writer.uint32(802).fork()).join();
|
|
111
|
+
break;
|
|
112
|
+
case "initialize":
|
|
113
|
+
InitializeRequest.encode(message.body.value, writer.uint32(1602).fork()).join();
|
|
114
|
+
break;
|
|
115
|
+
case "shutdown":
|
|
116
|
+
ShutdownRequest.encode(message.body.value, writer.uint32(1610).fork()).join();
|
|
117
|
+
break;
|
|
118
|
+
case "health":
|
|
119
|
+
HealthRequest.encode(message.body.value, writer.uint32(1618).fork()).join();
|
|
120
|
+
break;
|
|
121
|
+
case "call":
|
|
122
|
+
CallRequest.encode(message.body.value, writer.uint32(2402).fork()).join();
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
return writer;
|
|
126
|
+
},
|
|
127
|
+
decode(input, length) {
|
|
128
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
129
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
130
|
+
if (previousRecursionDepth >= 100) {
|
|
131
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
132
|
+
}
|
|
133
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
134
|
+
try {
|
|
135
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
136
|
+
const message = createBaseRequest();
|
|
137
|
+
while (reader.pos < end) {
|
|
138
|
+
const tag = reader.uint32();
|
|
139
|
+
switch (tag >>> 3) {
|
|
140
|
+
case 1: {
|
|
141
|
+
if (tag !== 8) {
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
message.id = reader.uint64();
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
case 100: {
|
|
148
|
+
if (tag !== 802) {
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
message.body = { $case: "hello", value: Hello.decode(reader, reader.uint32()) };
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
case 200: {
|
|
155
|
+
if (tag !== 1602) {
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
message.body = { $case: "initialize", value: InitializeRequest.decode(reader, reader.uint32()) };
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
case 201: {
|
|
162
|
+
if (tag !== 1610) {
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
message.body = { $case: "shutdown", value: ShutdownRequest.decode(reader, reader.uint32()) };
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
case 202: {
|
|
169
|
+
if (tag !== 1618) {
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
message.body = { $case: "health", value: HealthRequest.decode(reader, reader.uint32()) };
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
case 300: {
|
|
176
|
+
if (tag !== 2402) {
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
message.body = { $case: "call", value: CallRequest.decode(reader, reader.uint32()) };
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
reader.skip(tag & 7);
|
|
187
|
+
}
|
|
188
|
+
return message;
|
|
189
|
+
}
|
|
190
|
+
finally {
|
|
191
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
function createBaseResponse() {
|
|
196
|
+
return { id: 0n, result: undefined };
|
|
197
|
+
}
|
|
198
|
+
export const Response = {
|
|
199
|
+
encode(message, writer = new BinaryWriter()) {
|
|
200
|
+
if (message.id !== 0n) {
|
|
201
|
+
if (BigInt.asUintN(64, message.id) !== message.id) {
|
|
202
|
+
throw new globalThis.Error("value provided for field message.id of type uint64 too large");
|
|
203
|
+
}
|
|
204
|
+
writer.uint32(8).uint64(message.id);
|
|
205
|
+
}
|
|
206
|
+
switch (message.result?.$case) {
|
|
207
|
+
case "error":
|
|
208
|
+
Error.encode(message.result.value, writer.uint32(18).fork()).join();
|
|
209
|
+
break;
|
|
210
|
+
case "welcome":
|
|
211
|
+
Welcome.encode(message.result.value, writer.uint32(802).fork()).join();
|
|
212
|
+
break;
|
|
213
|
+
case "initialize":
|
|
214
|
+
InitializeResponse.encode(message.result.value, writer.uint32(1602).fork()).join();
|
|
215
|
+
break;
|
|
216
|
+
case "shutdown":
|
|
217
|
+
ShutdownResponse.encode(message.result.value, writer.uint32(1610).fork()).join();
|
|
218
|
+
break;
|
|
219
|
+
case "health":
|
|
220
|
+
HealthResponse.encode(message.result.value, writer.uint32(1618).fork()).join();
|
|
221
|
+
break;
|
|
222
|
+
case "call":
|
|
223
|
+
CallResponse.encode(message.result.value, writer.uint32(2402).fork()).join();
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
return writer;
|
|
227
|
+
},
|
|
228
|
+
decode(input, length) {
|
|
229
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
230
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
231
|
+
if (previousRecursionDepth >= 100) {
|
|
232
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
233
|
+
}
|
|
234
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
235
|
+
try {
|
|
236
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
237
|
+
const message = createBaseResponse();
|
|
238
|
+
while (reader.pos < end) {
|
|
239
|
+
const tag = reader.uint32();
|
|
240
|
+
switch (tag >>> 3) {
|
|
241
|
+
case 1: {
|
|
242
|
+
if (tag !== 8) {
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
message.id = reader.uint64();
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
case 2: {
|
|
249
|
+
if (tag !== 18) {
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
message.result = { $case: "error", value: Error.decode(reader, reader.uint32()) };
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
case 100: {
|
|
256
|
+
if (tag !== 802) {
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
message.result = { $case: "welcome", value: Welcome.decode(reader, reader.uint32()) };
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
case 200: {
|
|
263
|
+
if (tag !== 1602) {
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
message.result = { $case: "initialize", value: InitializeResponse.decode(reader, reader.uint32()) };
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
case 201: {
|
|
270
|
+
if (tag !== 1610) {
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
message.result = { $case: "shutdown", value: ShutdownResponse.decode(reader, reader.uint32()) };
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
case 202: {
|
|
277
|
+
if (tag !== 1618) {
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
message.result = { $case: "health", value: HealthResponse.decode(reader, reader.uint32()) };
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
case 300: {
|
|
284
|
+
if (tag !== 2402) {
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
message.result = { $case: "call", value: CallResponse.decode(reader, reader.uint32()) };
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
reader.skip(tag & 7);
|
|
295
|
+
}
|
|
296
|
+
return message;
|
|
297
|
+
}
|
|
298
|
+
finally {
|
|
299
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
};
|
|
303
|
+
function createBaseEvent() {
|
|
304
|
+
return { name: "", payload: new Uint8Array(0) };
|
|
305
|
+
}
|
|
306
|
+
export const Event = {
|
|
307
|
+
encode(message, writer = new BinaryWriter()) {
|
|
308
|
+
if (message.name !== "") {
|
|
309
|
+
writer.uint32(10).string(message.name);
|
|
310
|
+
}
|
|
311
|
+
if (message.payload.length !== 0) {
|
|
312
|
+
writer.uint32(18).bytes(message.payload);
|
|
313
|
+
}
|
|
314
|
+
return writer;
|
|
315
|
+
},
|
|
316
|
+
decode(input, length) {
|
|
317
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
318
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
319
|
+
if (previousRecursionDepth >= 100) {
|
|
320
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
321
|
+
}
|
|
322
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
323
|
+
try {
|
|
324
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
325
|
+
const message = createBaseEvent();
|
|
326
|
+
while (reader.pos < end) {
|
|
327
|
+
const tag = reader.uint32();
|
|
328
|
+
switch (tag >>> 3) {
|
|
329
|
+
case 1: {
|
|
330
|
+
if (tag !== 10) {
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
message.name = reader.string();
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
case 2: {
|
|
337
|
+
if (tag !== 18) {
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
message.payload = reader.bytes();
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
reader.skip(tag & 7);
|
|
348
|
+
}
|
|
349
|
+
return message;
|
|
350
|
+
}
|
|
351
|
+
finally {
|
|
352
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
function createBaseCancel() {
|
|
357
|
+
return { id: 0n };
|
|
358
|
+
}
|
|
359
|
+
export const Cancel = {
|
|
360
|
+
encode(message, writer = new BinaryWriter()) {
|
|
361
|
+
if (message.id !== 0n) {
|
|
362
|
+
if (BigInt.asUintN(64, message.id) !== message.id) {
|
|
363
|
+
throw new globalThis.Error("value provided for field message.id of type uint64 too large");
|
|
364
|
+
}
|
|
365
|
+
writer.uint32(8).uint64(message.id);
|
|
366
|
+
}
|
|
367
|
+
return writer;
|
|
368
|
+
},
|
|
369
|
+
decode(input, length) {
|
|
370
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
371
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
372
|
+
if (previousRecursionDepth >= 100) {
|
|
373
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
374
|
+
}
|
|
375
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
376
|
+
try {
|
|
377
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
378
|
+
const message = createBaseCancel();
|
|
379
|
+
while (reader.pos < end) {
|
|
380
|
+
const tag = reader.uint32();
|
|
381
|
+
switch (tag >>> 3) {
|
|
382
|
+
case 1: {
|
|
383
|
+
if (tag !== 8) {
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
386
|
+
message.id = reader.uint64();
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
reader.skip(tag & 7);
|
|
394
|
+
}
|
|
395
|
+
return message;
|
|
396
|
+
}
|
|
397
|
+
finally {
|
|
398
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
};
|
|
402
|
+
function createBaseEnvelope() {
|
|
403
|
+
return { kind: undefined };
|
|
404
|
+
}
|
|
405
|
+
export const Envelope = {
|
|
406
|
+
encode(message, writer = new BinaryWriter()) {
|
|
407
|
+
switch (message.kind?.$case) {
|
|
408
|
+
case "request":
|
|
409
|
+
Request.encode(message.kind.value, writer.uint32(10).fork()).join();
|
|
410
|
+
break;
|
|
411
|
+
case "response":
|
|
412
|
+
Response.encode(message.kind.value, writer.uint32(18).fork()).join();
|
|
413
|
+
break;
|
|
414
|
+
case "event":
|
|
415
|
+
Event.encode(message.kind.value, writer.uint32(26).fork()).join();
|
|
416
|
+
break;
|
|
417
|
+
case "cancel":
|
|
418
|
+
Cancel.encode(message.kind.value, writer.uint32(34).fork()).join();
|
|
419
|
+
break;
|
|
420
|
+
}
|
|
421
|
+
return writer;
|
|
422
|
+
},
|
|
423
|
+
decode(input, length) {
|
|
424
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
425
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
426
|
+
if (previousRecursionDepth >= 100) {
|
|
427
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
428
|
+
}
|
|
429
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
430
|
+
try {
|
|
431
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
432
|
+
const message = createBaseEnvelope();
|
|
433
|
+
while (reader.pos < end) {
|
|
434
|
+
const tag = reader.uint32();
|
|
435
|
+
switch (tag >>> 3) {
|
|
436
|
+
case 1: {
|
|
437
|
+
if (tag !== 10) {
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
message.kind = { $case: "request", value: Request.decode(reader, reader.uint32()) };
|
|
441
|
+
continue;
|
|
442
|
+
}
|
|
443
|
+
case 2: {
|
|
444
|
+
if (tag !== 18) {
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
message.kind = { $case: "response", value: Response.decode(reader, reader.uint32()) };
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
case 3: {
|
|
451
|
+
if (tag !== 26) {
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
message.kind = { $case: "event", value: Event.decode(reader, reader.uint32()) };
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
case 4: {
|
|
458
|
+
if (tag !== 34) {
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
message.kind = { $case: "cancel", value: Cancel.decode(reader, reader.uint32()) };
|
|
462
|
+
continue;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
reader.skip(tag & 7);
|
|
469
|
+
}
|
|
470
|
+
return message;
|
|
471
|
+
}
|
|
472
|
+
finally {
|
|
473
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
/**
|
|
3
|
+
* A version of the extension API. The extension API uses Semantic Versioning
|
|
4
|
+
* 2.0.0 and its version is independent of the product version of nomux.
|
|
5
|
+
*/
|
|
6
|
+
export interface ApiVersion {
|
|
7
|
+
/** The major version. */
|
|
8
|
+
major: number;
|
|
9
|
+
/** The minor version. */
|
|
10
|
+
minor: number;
|
|
11
|
+
/** The patch version. */
|
|
12
|
+
patch: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The permissions that the user approved for the extension.
|
|
16
|
+
*
|
|
17
|
+
* The source is the `[permissions]` table of `extension.toml`. The host
|
|
18
|
+
* applies the permissions. The extension reads them to know what it can do.
|
|
19
|
+
*/
|
|
20
|
+
export interface Permissions {
|
|
21
|
+
/**
|
|
22
|
+
* The directories that the extension can read and write. Each item is an
|
|
23
|
+
* absolute path. The host replaced each variable of the manifest, for
|
|
24
|
+
* example `${worktree}`.
|
|
25
|
+
*/
|
|
26
|
+
fs: string[];
|
|
27
|
+
/** The programs that the extension can start. Each item is a program name. */
|
|
28
|
+
process: string[];
|
|
29
|
+
/** `true` if the extension can open network connections. */
|
|
30
|
+
network: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The scopes of host services that the extension can use, for example
|
|
33
|
+
* `sessions:read`.
|
|
34
|
+
*/
|
|
35
|
+
scopes: string[];
|
|
36
|
+
}
|
|
37
|
+
/** The first message from the host. */
|
|
38
|
+
export interface Hello {
|
|
39
|
+
/** The extension API version that the host supplies. */
|
|
40
|
+
apiVersion: ApiVersion | undefined;
|
|
41
|
+
/** The identifier of the extension in its manifest, for example `nomux.git`. */
|
|
42
|
+
extensionId: string;
|
|
43
|
+
/** The permissions that the extension has. */
|
|
44
|
+
permissions: Permissions | undefined;
|
|
45
|
+
}
|
|
46
|
+
/** The reply from the extension to `Hello`. */
|
|
47
|
+
export interface Welcome {
|
|
48
|
+
/** The extension API version that the extension was built for. */
|
|
49
|
+
apiVersion: ApiVersion | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* The identifier that the extension has in its code. The host stops the
|
|
52
|
+
* extension if the value is different from the identifier in the manifest.
|
|
53
|
+
*/
|
|
54
|
+
extensionId: string;
|
|
55
|
+
/** The version of the extension, for example `1.0.0`. */
|
|
56
|
+
extensionVersion: string;
|
|
57
|
+
}
|
|
58
|
+
export declare const ApiVersion: MessageFns<ApiVersion>;
|
|
59
|
+
export declare const Permissions: MessageFns<Permissions>;
|
|
60
|
+
export declare const Hello: MessageFns<Hello>;
|
|
61
|
+
export declare const Welcome: MessageFns<Welcome>;
|
|
62
|
+
interface MessageFns<T> {
|
|
63
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
64
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
65
|
+
}
|
|
66
|
+
export {};
|