@boxide/protocol-rbep 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,1208 @@
1
+ import { create, fromBinary, toBinary } from "@bufbuild/protobuf";
2
+ import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
3
+ // src/generated/rbep/v1/exec_pb.ts
4
+ /**
5
+ * Describes the file rbep/v1/exec.proto.
6
+ */
7
+ const file_rbep_v1_exec = /*@__PURE__*/ fileDesc("ChJyYmVwL3YxL2V4ZWMucHJvdG8SB3JiZXAudjEiKAoKV2luZG93U2l6ZRIMCgRyb3dzGAEgASgNEgwKBGNvbHMYAiABKA0irgIKCUV4ZWNTdGFydBIMCgRhcmd2GAEgAygJEgsKA2N3ZBgCIAEoCRIoCgNlbnYYAyADKAsyGy5yYmVwLnYxLkV4ZWNTdGFydC5FbnZFbnRyeRIRCgljbGVhcl9lbnYYBCABKAgSIAoDdHR5GAUgASgLMhMucmJlcC52MS5XaW5kb3dTaXplEhAKCG5vX3N0ZGluGAYgASgIEjYKCmV4dGVuc2lvbnMYDyADKAsyIi5yYmVwLnYxLkV4ZWNTdGFydC5FeHRlbnNpb25zRW50cnkaKgoIRW52RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ARoxCg9FeHRlbnNpb25zRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgMOgI4ASItCgpFeGVjQXR0YWNoEg8KB3Byb2Nlc3MYASABKAkSDgoGb2Zmc2V0GAIgASgEInIKCUV4ZWNJbnB1dBIPCgVzdGRpbhgBIAEoDEgAEhMKCXN0ZGluX2VvZhgCIAEoCEgAEhAKBnNpZ25hbBgDIAEoCUgAEiUKBnJlc2l6ZRgEIAEoCzITLnJiZXAudjEuV2luZG93U2l6ZUgAQgYKBGJvZHkiKwoLRXhlY1N0YXJ0ZWQSCwoDcGlkGAEgASgDEg8KB3Byb2Nlc3MYAiABKAkiOAoKRXhlY0V4aXRlZBIOCgRjb2RlGAEgASgFSAASEAoGc2lnbmFsGAIgASgJSABCCAoGc3RhdHVzIiMKB0V4ZWNHYXASDAoEZnJvbRgBIAEoBBIKCgJ0bxgCIAEoBCLXAQoKRXhlY091dHB1dBIOCgZvZmZzZXQYASABKAQSJwoHc3RhcnRlZBgCIAEoCzIULnJiZXAudjEuRXhlY1N0YXJ0ZWRIABIQCgZzdGRvdXQYAyABKAxIABIQCgZzdGRlcnIYBCABKAxIABIlCgZleGl0ZWQYBSABKAsyEy5yYmVwLnYxLkV4ZWNFeGl0ZWRIABIfCgNnYXAYBiABKAsyEC5yYmVwLnYxLkV4ZWNHYXBIABIcChJzaWduYWxfdW5zdXBwb3J0ZWQYByABKAlIAEIGCgRib2R5YgZwcm90bzM");
8
+ /**
9
+ * Describes the message rbep.v1.WindowSize.
10
+ * Use `create(WindowSizeSchema)` to create a new message.
11
+ */
12
+ const WindowSizeSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_exec, 0);
13
+ /**
14
+ * Describes the message rbep.v1.ExecStart.
15
+ * Use `create(ExecStartSchema)` to create a new message.
16
+ */
17
+ const ExecStartSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_exec, 1);
18
+ /**
19
+ * Describes the message rbep.v1.ExecAttach.
20
+ * Use `create(ExecAttachSchema)` to create a new message.
21
+ */
22
+ const ExecAttachSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_exec, 2);
23
+ /**
24
+ * Describes the message rbep.v1.ExecInput.
25
+ * Use `create(ExecInputSchema)` to create a new message.
26
+ */
27
+ const ExecInputSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_exec, 3);
28
+ /**
29
+ * Describes the message rbep.v1.ExecStarted.
30
+ * Use `create(ExecStartedSchema)` to create a new message.
31
+ */
32
+ const ExecStartedSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_exec, 4);
33
+ /**
34
+ * Describes the message rbep.v1.ExecExited.
35
+ * Use `create(ExecExitedSchema)` to create a new message.
36
+ */
37
+ const ExecExitedSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_exec, 5);
38
+ /**
39
+ * Describes the message rbep.v1.ExecGap.
40
+ * Use `create(ExecGapSchema)` to create a new message.
41
+ */
42
+ const ExecGapSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_exec, 6);
43
+ /**
44
+ * Describes the message rbep.v1.ExecOutput.
45
+ * Use `create(ExecOutputSchema)` to create a new message.
46
+ */
47
+ const ExecOutputSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_exec, 7);
48
+ // src/generated/rbep/v1/fs_pb.ts
49
+ /**
50
+ * Describes the file rbep/v1/fs.proto.
51
+ */
52
+ const file_rbep_v1_fs = /*@__PURE__*/ fileDesc("ChByYmVwL3YxL2ZzLnByb3RvEgdyYmVwLnYxIqUCCgZGc0F0dHISCwoDaW5vGAEgASgEEgwKBHNpemUYAiABKAQSDgoGYmxvY2tzGAMgASgEEhEKCWF0aW1lX3NlYxgEIAEoAxISCgphdGltZV9uc2VjGAUgASgNEhEKCW10aW1lX3NlYxgGIAEoAxISCgptdGltZV9uc2VjGAcgASgNEhEKCWN0aW1lX3NlYxgIIAEoAxISCgpjdGltZV9uc2VjGAkgASgNEiEKBGtpbmQYCiABKA4yEy5yYmVwLnYxLkZzRmlsZVR5cGUSDAoEcGVybRgLIAEoDRINCgVubGluaxgMIAEoDRILCgN1aWQYDSABKA0SCwoDZ2lkGA4gASgNEg8KB2Jsa3NpemUYDyABKA0SEAoIdmFsaWRfbXMYECABKA0iywEKB0ZzTW91bnQSDAoEcm9vdBgBIAEoDBIRCglyZWFkX29ubHkYAiABKAgSJgoJbG9ja19tb2RlGAMgASgOMhMucmJlcC52MS5Gc0xvY2tNb2RlEg4KBnJlc3VtZRgEIAEoDBI0CgpleHRlbnNpb25zGA8gAygLMiAucmJlcC52MS5Gc01vdW50LkV4dGVuc2lvbnNFbnRyeR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lNfTE9DS19UWVBFX1VOU1BFQ0lGSUVEEAASFQoRRlNfTE9DS19UWVBFX1JFQUQQARIWChJGU19MT0NLX1RZUEVfV1JJVEUQAhIXChNGU19MT0NLX1RZUEVfVU5MT0NLEANiBnByb3RvMw");
53
+ /**
54
+ * Describes the message rbep.v1.FsAttr.
55
+ * Use `create(FsAttrSchema)` to create a new message.
56
+ */
57
+ const FsAttrSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 0);
58
+ /**
59
+ * Describes the message rbep.v1.FsMount.
60
+ * Use `create(FsMountSchema)` to create a new message.
61
+ */
62
+ const FsMountSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 1);
63
+ /**
64
+ * Describes the message rbep.v1.FsMounted.
65
+ * Use `create(FsMountedSchema)` to create a new message.
66
+ */
67
+ const FsMountedSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 2);
68
+ /**
69
+ * Describes the message rbep.v1.FsLookup.
70
+ * Use `create(FsLookupSchema)` to create a new message.
71
+ */
72
+ const FsLookupSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 3);
73
+ /**
74
+ * Describes the message rbep.v1.FsGetAttr.
75
+ * Use `create(FsGetAttrSchema)` to create a new message.
76
+ */
77
+ const FsGetAttrSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 4);
78
+ /**
79
+ * Describes the message rbep.v1.FsSetAttr.
80
+ * Use `create(FsSetAttrSchema)` to create a new message.
81
+ */
82
+ const FsSetAttrSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 5);
83
+ /**
84
+ * Describes the message rbep.v1.FsReadDirPlus.
85
+ * Use `create(FsReadDirPlusSchema)` to create a new message.
86
+ */
87
+ const FsReadDirPlusSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 6);
88
+ /**
89
+ * Describes the message rbep.v1.FsDirEntry.
90
+ * Use `create(FsDirEntrySchema)` to create a new message.
91
+ */
92
+ const FsDirEntrySchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 7);
93
+ /**
94
+ * Describes the message rbep.v1.FsReadDirPlusReply.
95
+ * Use `create(FsReadDirPlusReplySchema)` to create a new message.
96
+ */
97
+ const FsReadDirPlusReplySchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 8);
98
+ /**
99
+ * Describes the message rbep.v1.FsOpen.
100
+ * Use `create(FsOpenSchema)` to create a new message.
101
+ */
102
+ const FsOpenSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 9);
103
+ /**
104
+ * Describes the message rbep.v1.FsOpened.
105
+ * Use `create(FsOpenedSchema)` to create a new message.
106
+ */
107
+ const FsOpenedSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 10);
108
+ /**
109
+ * Describes the message rbep.v1.FsRead.
110
+ * Use `create(FsReadSchema)` to create a new message.
111
+ */
112
+ const FsReadSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 11);
113
+ /**
114
+ * Describes the message rbep.v1.FsData.
115
+ * Use `create(FsDataSchema)` to create a new message.
116
+ */
117
+ const FsDataSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 12);
118
+ /**
119
+ * Describes the message rbep.v1.FsWrite.
120
+ * Use `create(FsWriteSchema)` to create a new message.
121
+ */
122
+ const FsWriteSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 13);
123
+ /**
124
+ * Describes the message rbep.v1.FsWritten.
125
+ * Use `create(FsWrittenSchema)` to create a new message.
126
+ */
127
+ const FsWrittenSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 14);
128
+ /**
129
+ * Describes the message rbep.v1.FsFlush.
130
+ * Use `create(FsFlushSchema)` to create a new message.
131
+ */
132
+ const FsFlushSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 15);
133
+ /**
134
+ * Describes the message rbep.v1.FsFsync.
135
+ * Use `create(FsFsyncSchema)` to create a new message.
136
+ */
137
+ const FsFsyncSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 16);
138
+ /**
139
+ * Describes the message rbep.v1.FsRelease.
140
+ * Use `create(FsReleaseSchema)` to create a new message.
141
+ */
142
+ const FsReleaseSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 17);
143
+ /**
144
+ * Describes the message rbep.v1.FsCreate.
145
+ * Use `create(FsCreateSchema)` to create a new message.
146
+ */
147
+ const FsCreateSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 18);
148
+ /**
149
+ * Describes the message rbep.v1.FsCreated.
150
+ * Use `create(FsCreatedSchema)` to create a new message.
151
+ */
152
+ const FsCreatedSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 19);
153
+ /**
154
+ * Describes the message rbep.v1.FsCreateAndWrite.
155
+ * Use `create(FsCreateAndWriteSchema)` to create a new message.
156
+ */
157
+ const FsCreateAndWriteSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 20);
158
+ /**
159
+ * Describes the message rbep.v1.FsMkdir.
160
+ * Use `create(FsMkdirSchema)` to create a new message.
161
+ */
162
+ const FsMkdirSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 21);
163
+ /**
164
+ * Describes the message rbep.v1.FsUnlink.
165
+ * Use `create(FsUnlinkSchema)` to create a new message.
166
+ */
167
+ const FsUnlinkSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 22);
168
+ /**
169
+ * Describes the message rbep.v1.FsRmdir.
170
+ * Use `create(FsRmdirSchema)` to create a new message.
171
+ */
172
+ const FsRmdirSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 23);
173
+ /**
174
+ * Describes the message rbep.v1.FsRename.
175
+ * Use `create(FsRenameSchema)` to create a new message.
176
+ */
177
+ const FsRenameSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 24);
178
+ /**
179
+ * Describes the message rbep.v1.FsSymlink.
180
+ * Use `create(FsSymlinkSchema)` to create a new message.
181
+ */
182
+ const FsSymlinkSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 25);
183
+ /**
184
+ * Describes the message rbep.v1.FsReadLink.
185
+ * Use `create(FsReadLinkSchema)` to create a new message.
186
+ */
187
+ const FsReadLinkSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 26);
188
+ /**
189
+ * Describes the message rbep.v1.FsLinkTarget.
190
+ * Use `create(FsLinkTargetSchema)` to create a new message.
191
+ */
192
+ const FsLinkTargetSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 27);
193
+ /**
194
+ * Describes the message rbep.v1.FsLink.
195
+ * Use `create(FsLinkSchema)` to create a new message.
196
+ */
197
+ const FsLinkSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 28);
198
+ /**
199
+ * Describes the message rbep.v1.FsStatFs.
200
+ * Use `create(FsStatFsSchema)` to create a new message.
201
+ */
202
+ const FsStatFsSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 29);
203
+ /**
204
+ * Describes the message rbep.v1.FsStatFsReply.
205
+ * Use `create(FsStatFsReplySchema)` to create a new message.
206
+ */
207
+ const FsStatFsReplySchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 30);
208
+ /**
209
+ * Describes the message rbep.v1.FsForgetItem.
210
+ * Use `create(FsForgetItemSchema)` to create a new message.
211
+ */
212
+ const FsForgetItemSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 31);
213
+ /**
214
+ * Describes the message rbep.v1.FsForget.
215
+ * Use `create(FsForgetSchema)` to create a new message.
216
+ */
217
+ const FsForgetSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 32);
218
+ /**
219
+ * Describes the message rbep.v1.FsLockRange.
220
+ * Use `create(FsLockRangeSchema)` to create a new message.
221
+ */
222
+ const FsLockRangeSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 33);
223
+ /**
224
+ * Describes the message rbep.v1.FsGetLock.
225
+ * Use `create(FsGetLockSchema)` to create a new message.
226
+ */
227
+ const FsGetLockSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 34);
228
+ /**
229
+ * Describes the message rbep.v1.FsSetLock.
230
+ * Use `create(FsSetLockSchema)` to create a new message.
231
+ */
232
+ const FsSetLockSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 35);
233
+ /**
234
+ * Describes the message rbep.v1.FsLockReply.
235
+ * Use `create(FsLockReplySchema)` to create a new message.
236
+ */
237
+ const FsLockReplySchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 36);
238
+ /**
239
+ * Describes the message rbep.v1.FsPrefetchTree.
240
+ * Use `create(FsPrefetchTreeSchema)` to create a new message.
241
+ */
242
+ const FsPrefetchTreeSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 37);
243
+ /**
244
+ * Describes the message rbep.v1.FsPrefetchDir.
245
+ * Use `create(FsPrefetchDirSchema)` to create a new message.
246
+ */
247
+ const FsPrefetchDirSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 38);
248
+ /**
249
+ * Describes the message rbep.v1.FsPrefetchTreeReply.
250
+ * Use `create(FsPrefetchTreeReplySchema)` to create a new message.
251
+ */
252
+ const FsPrefetchTreeReplySchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 39);
253
+ /**
254
+ * Describes the message rbep.v1.FsError.
255
+ * Use `create(FsErrorSchema)` to create a new message.
256
+ */
257
+ const FsErrorSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 40);
258
+ /**
259
+ * Describes the message rbep.v1.FsEntry.
260
+ * Use `create(FsEntrySchema)` to create a new message.
261
+ */
262
+ const FsEntrySchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 41);
263
+ /**
264
+ * Describes the message rbep.v1.FsAttrReply.
265
+ * Use `create(FsAttrReplySchema)` to create a new message.
266
+ */
267
+ const FsAttrReplySchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 42);
268
+ /**
269
+ * Describes the message rbep.v1.FsOk.
270
+ * Use `create(FsOkSchema)` to create a new message.
271
+ */
272
+ const FsOkSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 43);
273
+ /**
274
+ * Describes the message rbep.v1.FsRequest.
275
+ * Use `create(FsRequestSchema)` to create a new message.
276
+ */
277
+ const FsRequestSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 44);
278
+ /**
279
+ * Describes the message rbep.v1.FsResponse.
280
+ * Use `create(FsResponseSchema)` to create a new message.
281
+ */
282
+ const FsResponseSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_fs, 45);
283
+ /**
284
+ * @generated from enum rbep.v1.FsFileType
285
+ */
286
+ let FsFileType = /* @__PURE__ */ function(FsFileType) {
287
+ /**
288
+ * @generated from enum value: FS_FILE_TYPE_UNSPECIFIED = 0;
289
+ */
290
+ FsFileType[FsFileType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
291
+ /**
292
+ * @generated from enum value: FS_FILE_TYPE_REGULAR = 1;
293
+ */
294
+ FsFileType[FsFileType["REGULAR"] = 1] = "REGULAR";
295
+ /**
296
+ * @generated from enum value: FS_FILE_TYPE_DIRECTORY = 2;
297
+ */
298
+ FsFileType[FsFileType["DIRECTORY"] = 2] = "DIRECTORY";
299
+ /**
300
+ * @generated from enum value: FS_FILE_TYPE_SYMLINK = 3;
301
+ */
302
+ FsFileType[FsFileType["SYMLINK"] = 3] = "SYMLINK";
303
+ return FsFileType;
304
+ }({});
305
+ /**
306
+ * Describes the enum rbep.v1.FsFileType.
307
+ */
308
+ const FsFileTypeSchema = /*@__PURE__*/ enumDesc(file_rbep_v1_fs, 0);
309
+ /**
310
+ * @generated from enum rbep.v1.FsLockMode
311
+ */
312
+ let FsLockMode = /* @__PURE__ */ function(FsLockMode) {
313
+ /**
314
+ * @generated from enum value: FS_LOCK_MODE_UNSPECIFIED = 0;
315
+ */
316
+ FsLockMode[FsLockMode["UNSPECIFIED"] = 0] = "UNSPECIFIED";
317
+ /**
318
+ * Locks are enforced by the client's kernel only.
319
+ *
320
+ * @generated from enum value: FS_LOCK_MODE_LOCAL = 1;
321
+ */
322
+ FsLockMode[FsLockMode["LOCAL"] = 1] = "LOCAL";
323
+ /**
324
+ * Byte-range locks are forwarded to the server (`fs.locks`).
325
+ *
326
+ * @generated from enum value: FS_LOCK_MODE_REMOTE = 2;
327
+ */
328
+ FsLockMode[FsLockMode["REMOTE"] = 2] = "REMOTE";
329
+ return FsLockMode;
330
+ }({});
331
+ /**
332
+ * Describes the enum rbep.v1.FsLockMode.
333
+ */
334
+ const FsLockModeSchema = /*@__PURE__*/ enumDesc(file_rbep_v1_fs, 1);
335
+ /**
336
+ * @generated from enum rbep.v1.FsLockType
337
+ */
338
+ let FsLockType = /* @__PURE__ */ function(FsLockType) {
339
+ /**
340
+ * @generated from enum value: FS_LOCK_TYPE_UNSPECIFIED = 0;
341
+ */
342
+ FsLockType[FsLockType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
343
+ /**
344
+ * @generated from enum value: FS_LOCK_TYPE_READ = 1;
345
+ */
346
+ FsLockType[FsLockType["READ"] = 1] = "READ";
347
+ /**
348
+ * @generated from enum value: FS_LOCK_TYPE_WRITE = 2;
349
+ */
350
+ FsLockType[FsLockType["WRITE"] = 2] = "WRITE";
351
+ /**
352
+ * @generated from enum value: FS_LOCK_TYPE_UNLOCK = 3;
353
+ */
354
+ FsLockType[FsLockType["UNLOCK"] = 3] = "UNLOCK";
355
+ return FsLockType;
356
+ }({});
357
+ /**
358
+ * Describes the enum rbep.v1.FsLockType.
359
+ */
360
+ const FsLockTypeSchema = /*@__PURE__*/ enumDesc(file_rbep_v1_fs, 2);
361
+ // src/generated/rbep/v1/session_pb.ts
362
+ /**
363
+ * Describes the file rbep/v1/session.proto.
364
+ */
365
+ const file_rbep_v1_session = /*@__PURE__*/ fileDesc("ChVyYmVwL3YxL3Nlc3Npb24ucHJvdG8SB3JiZXAudjEiLwoOU2Vzc2lvblJlcXVlc3QSHQoFZnJhbWUYASABKAsyDi5yYmVwLnYxL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TEUQBxIYChRTVEFUVVNfQ09ERV9JTlRFUk5BTBAIMk8KC1JiZXBTZXJ2aWNlEkAKB1Nlc3Npb24SFy5yYmVwLnYxLlNlc3Npb25SZXF1ZXN0GhgucmJlcC52MS5TZXNzaW9uUmVzcG9uc2UoATABYgZwcm90bzM", [file_rbep_v1_exec, file_rbep_v1_fs]);
366
+ /**
367
+ * Describes the message rbep.v1.SessionRequest.
368
+ * Use `create(SessionRequestSchema)` to create a new message.
369
+ */
370
+ const SessionRequestSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 0);
371
+ /**
372
+ * Describes the message rbep.v1.SessionResponse.
373
+ * Use `create(SessionResponseSchema)` to create a new message.
374
+ */
375
+ const SessionResponseSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 1);
376
+ /**
377
+ * Describes the message rbep.v1.Frame.
378
+ * Use `create(FrameSchema)` to create a new message.
379
+ */
380
+ const FrameSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 2);
381
+ /**
382
+ * Describes the message rbep.v1.Version.
383
+ * Use `create(VersionSchema)` to create a new message.
384
+ */
385
+ const VersionSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 3);
386
+ /**
387
+ * Describes the message rbep.v1.Implementation.
388
+ * Use `create(ImplementationSchema)` to create a new message.
389
+ */
390
+ const ImplementationSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 4);
391
+ /**
392
+ * Describes the message rbep.v1.Hello.
393
+ * Use `create(HelloSchema)` to create a new message.
394
+ */
395
+ const HelloSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 5);
396
+ /**
397
+ * Describes the message rbep.v1.Welcome.
398
+ * Use `create(WelcomeSchema)` to create a new message.
399
+ */
400
+ const WelcomeSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 6);
401
+ /**
402
+ * Describes the message rbep.v1.StreamOpen.
403
+ * Use `create(StreamOpenSchema)` to create a new message.
404
+ */
405
+ const StreamOpenSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 7);
406
+ /**
407
+ * Describes the message rbep.v1.Credit.
408
+ * Use `create(CreditSchema)` to create a new message.
409
+ */
410
+ const CreditSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 8);
411
+ /**
412
+ * Describes the message rbep.v1.StreamClose.
413
+ * Use `create(StreamCloseSchema)` to create a new message.
414
+ */
415
+ const StreamCloseSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 9);
416
+ /**
417
+ * Describes the message rbep.v1.Ping.
418
+ * Use `create(PingSchema)` to create a new message.
419
+ */
420
+ const PingSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 10);
421
+ /**
422
+ * Describes the message rbep.v1.Pong.
423
+ * Use `create(PongSchema)` to create a new message.
424
+ */
425
+ const PongSchema = /*@__PURE__*/ messageDesc(file_rbep_v1_session, 11);
426
+ /**
427
+ * @generated from enum rbep.v1.StatusCode
428
+ */
429
+ let StatusCode = /* @__PURE__ */ function(StatusCode) {
430
+ /**
431
+ * @generated from enum value: STATUS_CODE_UNSPECIFIED = 0;
432
+ */
433
+ StatusCode[StatusCode["UNSPECIFIED"] = 0] = "UNSPECIFIED";
434
+ /**
435
+ * @generated from enum value: STATUS_CODE_OK = 1;
436
+ */
437
+ StatusCode[StatusCode["OK"] = 1] = "OK";
438
+ /**
439
+ * @generated from enum value: STATUS_CODE_CANCELLED = 2;
440
+ */
441
+ StatusCode[StatusCode["CANCELLED"] = 2] = "CANCELLED";
442
+ /**
443
+ * @generated from enum value: STATUS_CODE_INVALID = 3;
444
+ */
445
+ StatusCode[StatusCode["INVALID"] = 3] = "INVALID";
446
+ /**
447
+ * @generated from enum value: STATUS_CODE_NOT_FOUND = 4;
448
+ */
449
+ StatusCode[StatusCode["NOT_FOUND"] = 4] = "NOT_FOUND";
450
+ /**
451
+ * @generated from enum value: STATUS_CODE_PERMISSION = 5;
452
+ */
453
+ StatusCode[StatusCode["PERMISSION"] = 5] = "PERMISSION";
454
+ /**
455
+ * @generated from enum value: STATUS_CODE_UNSUPPORTED = 6;
456
+ */
457
+ StatusCode[StatusCode["UNSUPPORTED"] = 6] = "UNSUPPORTED";
458
+ /**
459
+ * @generated from enum value: STATUS_CODE_UNAVAILABLE = 7;
460
+ */
461
+ StatusCode[StatusCode["UNAVAILABLE"] = 7] = "UNAVAILABLE";
462
+ /**
463
+ * @generated from enum value: STATUS_CODE_INTERNAL = 8;
464
+ */
465
+ StatusCode[StatusCode["INTERNAL"] = 8] = "INTERNAL";
466
+ return StatusCode;
467
+ }({});
468
+ /**
469
+ * Describes the enum rbep.v1.StatusCode.
470
+ */
471
+ const StatusCodeSchema = /*@__PURE__*/ enumDesc(file_rbep_v1_session, 0);
472
+ /**
473
+ * The gRPC binding: one bidirectional stream per session. The stdio binding
474
+ * writes a big-endian uint32 length before each `Frame`, and the WebSocket
475
+ * binding sends one or more such length-prefixed frames per binary message;
476
+ * neither uses this service.
477
+ *
478
+ * @generated from service rbep.v1.RbepService
479
+ */
480
+ const RbepService = /*@__PURE__*/ serviceDesc(file_rbep_v1_session, 0);
481
+ // src/wire.ts
482
+ /** The frame limit every peer accepts, and the value of a `max_frame_bytes` of 0 (spec §4). */
483
+ const MIN_FRAME_BYTES = 1048576;
484
+ var WireError = class extends Error {};
485
+ /** A peer's stated frame limit, with 0 read as the 1 MiB minimum. */
486
+ const frameLimit = (stated) => Math.max(stated || 0, MIN_FRAME_BYTES);
487
+ /**
488
+ * The stdio binding, and the WebSocket binding's message body: a big-endian
489
+ * uint32 length before each `Frame` (spec §3).
490
+ */
491
+ const packEncodedFrames = (bodies) => {
492
+ const out = new Uint8Array(bodies.reduce((sum, body) => sum + 4 + body.length, 0));
493
+ const view = new DataView(out.buffer);
494
+ let at = 0;
495
+ for (const body of bodies) {
496
+ view.setUint32(at, body.length);
497
+ out.set(body, at + 4);
498
+ at += 4 + body.length;
499
+ }
500
+ return out;
501
+ };
502
+ const encodeFrames = (frames) => packEncodedFrames(frames.map((frame) => toBinary(FrameSchema, frame)));
503
+ /**
504
+ * Encodes a sequence of frames once each and groups them into length-prefixed
505
+ * batches whose total payload stays within `maxFrameBytes`. Throws `WireError`
506
+ * if any single frame exceeds `maxFrameBytes`.
507
+ */
508
+ const encodeFrameBatches = (frames, maxFrameBytes) => {
509
+ const batches = [];
510
+ let batch = [];
511
+ let size = 0;
512
+ for (const frame of frames) {
513
+ const encoded = toBinary(FrameSchema, frame);
514
+ if (encoded.length > maxFrameBytes) throw new WireError(`refusing to send a ${encoded.length}-byte frame (limit ${maxFrameBytes})`);
515
+ const length = 4 + encoded.length;
516
+ if (batch.length > 0 && size + length > maxFrameBytes + 4 * (batch.length + 1)) {
517
+ batches.push(packEncodedFrames(batch));
518
+ batch = [];
519
+ size = 0;
520
+ }
521
+ batch.push(encoded);
522
+ size += length;
523
+ }
524
+ if (batch.length > 0) batches.push(packEncodedFrames(batch));
525
+ return batches;
526
+ };
527
+ /**
528
+ * Splits a byte stream into frames. A frame larger than `limit` ends the
529
+ * session (spec §4), so the decoder refuses it before it buffers the body.
530
+ */
531
+ var FrameDecoder = class {
532
+ limit;
533
+ buffered = /* @__PURE__ */ new Uint8Array(0);
534
+ constructor(limit) {
535
+ this.limit = limit;
536
+ }
537
+ push(chunk) {
538
+ this.buffered = this.buffered.length === 0 ? chunk : concat(this.buffered, chunk);
539
+ const frames = [];
540
+ while (this.buffered.length >= 4) {
541
+ const length = new DataView(this.buffered.buffer, this.buffered.byteOffset, 4).getUint32(0);
542
+ if (length > this.limit()) throw new WireError(`frame of ${length} bytes exceeds the limit of ${this.limit()}`);
543
+ if (this.buffered.length < 4 + length) break;
544
+ frames.push(fromBinary(FrameSchema, this.buffered.subarray(4, 4 + length)));
545
+ this.buffered = this.buffered.subarray(4 + length);
546
+ }
547
+ return frames;
548
+ }
549
+ /** A WebSocket message holds whole frames only: none may span two messages (spec §3). */
550
+ message(data) {
551
+ if (this.buffered.length > 0) throw new WireError("a frame spans two WebSocket messages");
552
+ const frames = this.push(data);
553
+ if (this.buffered.length > 0) {
554
+ this.buffered = /* @__PURE__ */ new Uint8Array(0);
555
+ throw new WireError("a WebSocket message ends inside a frame");
556
+ }
557
+ return frames;
558
+ }
559
+ };
560
+ const concat = (a, b) => {
561
+ const out = new Uint8Array(a.length + b.length);
562
+ out.set(a);
563
+ out.set(b, a.length);
564
+ return out;
565
+ };
566
+ // src/sessionCore.ts
567
+ const PROTOCOL_MAJOR = 1;
568
+ const PROTOCOL_MINOR = 0;
569
+ /** Spec §4: liveness. */
570
+ const PING_INTERVAL_MS = 15e3;
571
+ const MISSED_PONGS = 3;
572
+ /** Bytes a frame counts against credit (spec §4); control frames count nothing. */
573
+ const creditedBytes = (frame) => {
574
+ const { body } = frame;
575
+ switch (body.case) {
576
+ case "execInput": return body.value.body.case === "stdin" ? body.value.body.value.length : 0;
577
+ case "execOutput": {
578
+ const out = body.value.body;
579
+ return out.case === "stdout" || out.case === "stderr" ? out.value.length : 0;
580
+ }
581
+ case "fsRequest": return toBinary(FsRequestSchema, body.value).length;
582
+ case "fsResponse": return toBinary(FsResponseSchema, body.value).length;
583
+ default: return 0;
584
+ }
585
+ };
586
+ const initialStreamCredit = (frameBytes) => frameBytes;
587
+ const initialSessionCredit = (frameBytes) => 2 * frameBytes;
588
+ var SessionClosed = class extends Error {};
589
+ /**
590
+ * Shared RBEP v1 session transport, framing, credit flow control, and liveness
591
+ * machinery used by both `ServerSession` and `ClientSession`.
592
+ */
593
+ var SessionCore = class {
594
+ coreOptions;
595
+ decoder;
596
+ streams = /* @__PURE__ */ new Map();
597
+ sessionSendAvailable = 0;
598
+ sessionRecvRemaining;
599
+ sendWaiters = [];
600
+ peerFrameLimit = frameLimit(0);
601
+ ended = false;
602
+ outbox = [];
603
+ flushScheduled = false;
604
+ pendingCredit = /* @__PURE__ */ new Map();
605
+ missedPongs = 0;
606
+ pinger;
607
+ constructor(coreOptions) {
608
+ this.coreOptions = coreOptions;
609
+ this.decoder = new FrameDecoder(() => this.ownFrameLimit);
610
+ this.sessionRecvRemaining = initialSessionCredit(this.ownFrameLimit);
611
+ }
612
+ get ownFrameLimit() {
613
+ return frameLimit(this.coreOptions.maxFrameBytes ?? 0);
614
+ }
615
+ /** Feeds bytes from a stream transport (stdio). */
616
+ data(chunk) {
617
+ this.receive(() => this.decoder.push(chunk));
618
+ }
619
+ /** Feeds one WebSocket binary message. */
620
+ message(data) {
621
+ this.receive(() => this.decoder.message(data));
622
+ }
623
+ /** Notifies that the underlying transport closed. */
624
+ transportEnded() {
625
+ this.finish(7, "transport ended", false);
626
+ }
627
+ startPinger() {
628
+ this.pinger = setInterval(() => this.ping(), PING_INTERVAL_MS);
629
+ this.pinger?.unref?.();
630
+ }
631
+ receive(decode) {
632
+ if (this.ended) return;
633
+ let frames;
634
+ try {
635
+ frames = decode();
636
+ } catch (error) {
637
+ this.finish(3, error instanceof WireError ? error.message : String(error));
638
+ return;
639
+ }
640
+ for (const frame of frames) {
641
+ if (this.ended) return;
642
+ try {
643
+ this.dispatch(frame);
644
+ } catch (error) {
645
+ this.finish(8, error instanceof Error ? error.message : String(error));
646
+ }
647
+ }
648
+ }
649
+ sessionFrame(frame) {
650
+ switch (frame.body.case) {
651
+ case "credit":
652
+ this.sessionSendAvailable += Number(frame.body.value.bytes);
653
+ this.drainSendWaiters();
654
+ return;
655
+ case "ping":
656
+ this.enqueue(create(FrameSchema, {
657
+ body: {
658
+ case: "pong",
659
+ value: { timestampMs: frame.body.value.timestampMs }
660
+ },
661
+ stream: 0
662
+ }));
663
+ return;
664
+ case "pong":
665
+ this.missedPongs = 0;
666
+ return;
667
+ case "close":
668
+ this.finish(frame.body.value.code, frame.body.value.message, false);
669
+ return;
670
+ default: this.finish(3, `unexpected ${frame.body.case ?? "empty"} frame on stream 0`);
671
+ }
672
+ }
673
+ async sendOnStream(id, stream, body) {
674
+ if (this.ended || stream.closedBySelf || !this.streams.has(id)) return;
675
+ const frame = create(FrameSchema, {
676
+ body,
677
+ stream: id
678
+ });
679
+ const bytes = creditedBytes(frame);
680
+ if (bytes > 0) {
681
+ await this.acquireCredit(stream, bytes);
682
+ if (this.ended || stream.closedBySelf || !this.streams.has(id)) return;
683
+ }
684
+ this.enqueue(frame);
685
+ }
686
+ /** Atomically acquires both stream and session send credit without partial deduction. */
687
+ acquireCredit(stream, bytes) {
688
+ if (!this.sendWaiters.some((w) => w.stream === stream) && stream.sendAvailable >= bytes && this.sessionSendAvailable >= bytes) {
689
+ stream.sendAvailable -= bytes;
690
+ this.sessionSendAvailable -= bytes;
691
+ return Promise.resolve();
692
+ }
693
+ return new Promise((resolve, reject) => {
694
+ this.sendWaiters.push({
695
+ bytes,
696
+ reject,
697
+ resolve,
698
+ stream
699
+ });
700
+ });
701
+ }
702
+ drainSendWaiters() {
703
+ let i = 0;
704
+ while (i < this.sendWaiters.length) {
705
+ const w = this.sendWaiters[i];
706
+ if (w.stream.sendAvailable >= w.bytes && this.sessionSendAvailable >= w.bytes) {
707
+ this.sendWaiters.splice(i, 1);
708
+ w.stream.sendAvailable -= w.bytes;
709
+ this.sessionSendAvailable -= w.bytes;
710
+ w.resolve();
711
+ } else i += 1;
712
+ }
713
+ }
714
+ rejectWaitersFor(stream, error) {
715
+ for (let i = this.sendWaiters.length - 1; i >= 0; i -= 1) if (this.sendWaiters[i].stream === stream) {
716
+ const [w] = this.sendWaiters.splice(i, 1);
717
+ w.reject(error);
718
+ }
719
+ }
720
+ /**
721
+ * Checks and deducts receive credit for a data frame (spec §4).
722
+ * Returns the credited byte count, or `undefined` if credit was exceeded
723
+ * (in which case the session is ended).
724
+ *
725
+ * When `immediate` is `true` (default), replenishing `Credit` frames are
726
+ * queued immediately; pass `false` to defer replenishment until async
727
+ * consumption completes via `releaseCredit(streamId, bytes)`.
728
+ */
729
+ consumed(frame, stream, immediate = true) {
730
+ const bytes = creditedBytes(frame);
731
+ if (bytes <= 0) return 0;
732
+ if (bytes > stream.recvRemaining || bytes > this.sessionRecvRemaining) {
733
+ this.finish(3, "peer exceeded credit");
734
+ return;
735
+ }
736
+ stream.recvRemaining -= bytes;
737
+ this.sessionRecvRemaining -= bytes;
738
+ if (immediate) this.releaseCredit(frame.stream, bytes);
739
+ return bytes;
740
+ }
741
+ /**
742
+ * Queues replenishing `Credit` for `bytes` previously deducted by `consumed(..., false)`.
743
+ * Always replenishes session credit (stream 0); replenishes stream credit only if the
744
+ * stream is still open.
745
+ */
746
+ releaseCredit(streamId, bytes) {
747
+ if (this.ended || bytes <= 0) return;
748
+ if (streamId !== 0 && this.streams.has(streamId)) this.pendingCredit.set(streamId, (this.pendingCredit.get(streamId) ?? 0) + bytes);
749
+ this.pendingCredit.set(0, (this.pendingCredit.get(0) ?? 0) + bytes);
750
+ this.scheduleFlush();
751
+ }
752
+ ping() {
753
+ if (this.missedPongs >= 3) {
754
+ this.finish(7, `3 pings were not answered`);
755
+ return;
756
+ }
757
+ this.missedPongs += 1;
758
+ this.enqueue(create(FrameSchema, {
759
+ body: {
760
+ case: "ping",
761
+ value: { timestampMs: BigInt(Date.now()) }
762
+ },
763
+ stream: 0
764
+ }));
765
+ }
766
+ enqueue(frame) {
767
+ if (this.ended) return;
768
+ this.outbox.push(frame);
769
+ this.scheduleFlush();
770
+ }
771
+ /**
772
+ * Frames queued in one turn of the event loop leave in one write, which on
773
+ * the WebSocket binding is one message (spec §3).
774
+ */
775
+ scheduleFlush() {
776
+ if (this.flushScheduled) return;
777
+ this.flushScheduled = true;
778
+ const scheduleImmediate = globalThis.setImmediate;
779
+ if (typeof scheduleImmediate === "function") scheduleImmediate(() => this.flush());
780
+ else queueMicrotask(() => this.flush());
781
+ }
782
+ flush() {
783
+ this.flushScheduled = false;
784
+ if (this.ended) return;
785
+ for (const [streamId, bytes] of this.pendingCredit) {
786
+ if (bytes <= 0) continue;
787
+ if (streamId === 0) this.sessionRecvRemaining += bytes;
788
+ else {
789
+ const stream = this.streams.get(streamId);
790
+ if (!stream) continue;
791
+ stream.recvRemaining += bytes;
792
+ }
793
+ this.outbox.push(create(FrameSchema, {
794
+ body: {
795
+ case: "credit",
796
+ value: { bytes: BigInt(bytes) }
797
+ },
798
+ stream: streamId
799
+ }));
800
+ }
801
+ this.pendingCredit.clear();
802
+ if (this.outbox.length === 0) return;
803
+ try {
804
+ for (const batch of encodeFrameBatches(this.outbox.splice(0), this.peerFrameLimit)) this.coreOptions.write(batch);
805
+ } catch (error) {
806
+ this.finish(8, error instanceof Error ? error.message : String(error));
807
+ }
808
+ }
809
+ /** Ends the session, telling the peer why unless the transport is gone. */
810
+ finish(code, message, tell = true) {
811
+ if (this.ended) return;
812
+ if (tell) {
813
+ this.outbox.push(create(FrameSchema, {
814
+ body: {
815
+ case: "close",
816
+ value: {
817
+ code,
818
+ message
819
+ }
820
+ },
821
+ stream: 0
822
+ }));
823
+ this.flushScheduled = false;
824
+ this.flush();
825
+ }
826
+ this.ended = true;
827
+ clearInterval(this.pinger);
828
+ const reason = {
829
+ code,
830
+ message
831
+ };
832
+ this.onFinish(reason);
833
+ this.streams.clear();
834
+ const err = new SessionClosed(message || `session closed (${code})`);
835
+ for (const w of this.sendWaiters.splice(0)) w.reject(err);
836
+ this.coreOptions.ended?.(reason);
837
+ this.coreOptions.end();
838
+ }
839
+ };
840
+ // src/client.ts
841
+ /**
842
+ * The client side of one RBEP v1 session over a byte transport (stdio via
843
+ * `data`, or WebSocket binary messages via `message`).
844
+ */
845
+ var ClientSession = class extends SessionCore {
846
+ options;
847
+ nextStreamId = 1;
848
+ welcomeValue;
849
+ welcomePromise;
850
+ welcomeResolve;
851
+ welcomeReject;
852
+ constructor(options) {
853
+ super(options);
854
+ this.options = options;
855
+ }
856
+ get welcome() {
857
+ return this.welcomeValue;
858
+ }
859
+ /** Sends `Hello` on stream 0 and resolves with `Welcome`. Idempotent if already connecting or connected. */
860
+ connect() {
861
+ if (this.ended) return Promise.reject(new SessionClosed("session already ended"));
862
+ if (this.welcomeValue) return Promise.resolve(this.welcomeValue);
863
+ if (this.welcomePromise) return this.welcomePromise;
864
+ this.welcomePromise = new Promise((resolve, reject) => {
865
+ this.welcomeResolve = resolve;
866
+ this.welcomeReject = reject;
867
+ });
868
+ this.enqueue(create(FrameSchema, {
869
+ body: {
870
+ case: "hello",
871
+ value: {
872
+ capabilities: this.options.capabilities,
873
+ extensions: [],
874
+ implementation: this.options.implementation,
875
+ maxFrameBytes: this.ownFrameLimit,
876
+ token: this.options.token,
877
+ versions: [{
878
+ major: 1,
879
+ minor: 0
880
+ }]
881
+ }
882
+ },
883
+ stream: 0
884
+ }));
885
+ return this.welcomePromise;
886
+ }
887
+ /** Opens an exec stream and returns a handle for sending stdin/resize/signals. */
888
+ openExec(start, handlers) {
889
+ if (this.ended) throw new SessionClosed("session ended");
890
+ if (!this.welcomeValue) throw new Error("cannot open stream before Welcome");
891
+ const id = this.nextStreamId;
892
+ this.nextStreamId += 2;
893
+ const stream = {
894
+ closedBySelf: false,
895
+ onClose: handlers.onClose,
896
+ onFrame: (frame, bytes) => {
897
+ if (frame.body.case !== "execOutput") {
898
+ if (bytes > 0) this.releaseCredit(id, bytes);
899
+ return;
900
+ }
901
+ const output = frame.body.value;
902
+ const invoke = () => {
903
+ let result;
904
+ try {
905
+ result = handlers.onOutput(output);
906
+ } catch (error) {
907
+ if (bytes > 0) this.releaseCredit(id, bytes);
908
+ this.finish(8, error instanceof Error ? error.message : String(error));
909
+ return;
910
+ }
911
+ if (result && typeof result.then === "function") return Promise.resolve(result).then(() => {
912
+ if (bytes > 0) this.releaseCredit(id, bytes);
913
+ }, (error) => {
914
+ if (bytes > 0) this.releaseCredit(id, bytes);
915
+ this.finish(8, error instanceof Error ? error.message : String(error));
916
+ });
917
+ if (bytes > 0) this.releaseCredit(id, bytes);
918
+ };
919
+ if (!stream.recvTail) {
920
+ const pending = invoke();
921
+ if (pending) {
922
+ const tracked = pending.finally(() => {
923
+ if (stream.recvTail === tracked) stream.recvTail = void 0;
924
+ });
925
+ stream.recvTail = tracked;
926
+ }
927
+ } else {
928
+ const tracked = stream.recvTail.then(() => invoke()).finally(() => {
929
+ if (stream.recvTail === tracked) stream.recvTail = void 0;
930
+ });
931
+ stream.recvTail = tracked;
932
+ }
933
+ },
934
+ recvRemaining: initialStreamCredit(this.ownFrameLimit),
935
+ sendAvailable: initialStreamCredit(this.peerFrameLimit),
936
+ sendChain: Promise.resolve()
937
+ };
938
+ this.streams.set(id, stream);
939
+ this.enqueue(create(FrameSchema, {
940
+ body: {
941
+ case: "open",
942
+ value: { kind: {
943
+ case: "exec",
944
+ value: create(ExecStartSchema, start)
945
+ } }
946
+ },
947
+ stream: id
948
+ }));
949
+ const sendExec = (body) => this.sendOnStream(id, stream, {
950
+ case: "execInput",
951
+ value: { body }
952
+ });
953
+ const enqueueStdin = (task) => {
954
+ const next = stream.sendChain.then(task, task);
955
+ stream.sendChain = next.catch(() => {});
956
+ return next;
957
+ };
958
+ return {
959
+ close: (code = 1, message = "") => {
960
+ if (stream.closedBySelf || !this.streams.has(id)) return;
961
+ stream.closedBySelf = true;
962
+ this.streams.delete(id);
963
+ this.rejectWaitersFor(stream, new SessionClosed("stream closed"));
964
+ this.enqueue(create(FrameSchema, {
965
+ body: {
966
+ case: "close",
967
+ value: {
968
+ code,
969
+ message
970
+ }
971
+ },
972
+ stream: id
973
+ }));
974
+ },
975
+ id,
976
+ resize: (rows, cols) => sendExec({
977
+ case: "resize",
978
+ value: {
979
+ cols,
980
+ rows
981
+ }
982
+ }),
983
+ sendStdin: (data) => enqueueStdin(async () => {
984
+ const maxChunk = Math.max(1024, this.peerFrameLimit - 1024);
985
+ if (data.length <= maxChunk) {
986
+ await sendExec({
987
+ case: "stdin",
988
+ value: data
989
+ });
990
+ return;
991
+ }
992
+ for (let offset = 0; offset < data.length; offset += maxChunk) await sendExec({
993
+ case: "stdin",
994
+ value: data.subarray(offset, Math.min(offset + maxChunk, data.length))
995
+ });
996
+ }),
997
+ sendStdinEof: () => enqueueStdin(() => sendExec({
998
+ case: "stdinEof",
999
+ value: true
1000
+ })),
1001
+ signal: (name) => sendExec({
1002
+ case: "signal",
1003
+ value: name
1004
+ })
1005
+ };
1006
+ }
1007
+ close(code = 1, message = "") {
1008
+ this.finish(code, message, true);
1009
+ }
1010
+ dispatch(frame) {
1011
+ if (!this.welcomeValue) {
1012
+ if (frame.stream === 0 && frame.body.case === "welcome") {
1013
+ this.welcomeValue = frame.body.value;
1014
+ this.peerFrameLimit = frameLimit(this.welcomeValue.maxFrameBytes);
1015
+ this.sessionSendAvailable = initialSessionCredit(this.peerFrameLimit);
1016
+ this.startPinger();
1017
+ this.welcomeResolve?.(this.welcomeValue);
1018
+ this.welcomeResolve = void 0;
1019
+ this.welcomeReject = void 0;
1020
+ return;
1021
+ }
1022
+ if (frame.stream === 0 && frame.body.case === "close") {
1023
+ const msg = frame.body.value.message || `refused (${frame.body.value.code})`;
1024
+ this.finish(frame.body.value.code, msg, false);
1025
+ return;
1026
+ }
1027
+ this.finish(3, "expected Welcome on stream 0");
1028
+ return;
1029
+ }
1030
+ if (frame.stream === 0) {
1031
+ this.sessionFrame(frame);
1032
+ return;
1033
+ }
1034
+ const stream = this.streams.get(frame.stream);
1035
+ if (!stream) return;
1036
+ switch (frame.body.case) {
1037
+ case "credit":
1038
+ stream.sendAvailable += Number(frame.body.value.bytes);
1039
+ this.drainSendWaiters();
1040
+ return;
1041
+ case "close": {
1042
+ this.streams.delete(frame.stream);
1043
+ this.rejectWaitersFor(stream, new SessionClosed("stream closed"));
1044
+ const reason = {
1045
+ code: frame.body.value.code,
1046
+ message: frame.body.value.message
1047
+ };
1048
+ if (stream.recvTail) stream.recvTail.then(() => stream.onClose?.(reason));
1049
+ else stream.onClose?.(reason);
1050
+ return;
1051
+ }
1052
+ default: {
1053
+ const bytes = this.consumed(frame, stream, false);
1054
+ if (bytes === void 0) return;
1055
+ stream.onFrame(frame, bytes);
1056
+ }
1057
+ }
1058
+ }
1059
+ onFinish(reason) {
1060
+ const err = new SessionClosed(reason.message || `session closed (${reason.code})`);
1061
+ if (this.welcomeReject) {
1062
+ this.welcomeReject(err);
1063
+ this.welcomeResolve = void 0;
1064
+ this.welcomeReject = void 0;
1065
+ }
1066
+ for (const stream of this.streams.values()) if (stream.recvTail) stream.recvTail.then(() => stream.onClose?.(reason));
1067
+ else stream.onClose?.(reason);
1068
+ }
1069
+ };
1070
+ // src/session.ts
1071
+ /**
1072
+ * The server side of one RBEP session over a byte transport (stdio, or a
1073
+ * WebSocket whose messages the caller feeds whole through `message`).
1074
+ */
1075
+ var ServerSession = class extends SessionCore {
1076
+ options;
1077
+ granted = /* @__PURE__ */ new Set();
1078
+ welcomed = false;
1079
+ constructor(options) {
1080
+ super(options);
1081
+ this.options = options;
1082
+ }
1083
+ dispatch(frame) {
1084
+ if (!this.welcomed) {
1085
+ if (frame.stream !== 0 || frame.body.case !== "hello") {
1086
+ this.finish(3, "the first frame must be Hello on stream 0");
1087
+ return;
1088
+ }
1089
+ this.hello(frame.body.value);
1090
+ return;
1091
+ }
1092
+ if (frame.stream === 0) {
1093
+ this.sessionFrame(frame);
1094
+ return;
1095
+ }
1096
+ if (frame.body.case === "open") {
1097
+ this.openStream(frame.stream, frame.body.value);
1098
+ return;
1099
+ }
1100
+ const stream = this.streams.get(frame.stream);
1101
+ if (!stream) return;
1102
+ switch (frame.body.case) {
1103
+ case "credit":
1104
+ stream.sendAvailable += Number(frame.body.value.bytes);
1105
+ this.drainSendWaiters();
1106
+ return;
1107
+ case "close":
1108
+ this.streams.delete(frame.stream);
1109
+ this.rejectWaitersFor(stream, new SessionClosed("stream closed"));
1110
+ stream.handler?.closed({
1111
+ code: frame.body.value.code,
1112
+ message: frame.body.value.message
1113
+ });
1114
+ return;
1115
+ default:
1116
+ if (this.consumed(frame, stream) === void 0) return;
1117
+ stream.handler?.frame(frame);
1118
+ }
1119
+ }
1120
+ hello(hello) {
1121
+ if (!hello.versions.find((v) => v.major === 1)) {
1122
+ this.finish(6, `no common major version (server speaks 1)`);
1123
+ return;
1124
+ }
1125
+ if (!this.options.checkToken(hello.token)) {
1126
+ this.finish(5, "session token refused");
1127
+ return;
1128
+ }
1129
+ const own = new Set(this.options.capabilities);
1130
+ this.granted = new Set(hello.capabilities.filter((c) => own.has(c)));
1131
+ this.peerFrameLimit = frameLimit(hello.maxFrameBytes);
1132
+ this.sessionSendAvailable = initialSessionCredit(this.peerFrameLimit);
1133
+ this.welcomed = true;
1134
+ this.enqueue(create(FrameSchema, {
1135
+ body: {
1136
+ case: "welcome",
1137
+ value: {
1138
+ capabilities: [...this.granted],
1139
+ extensions: [],
1140
+ holdBufferBytes: 0n,
1141
+ holdMs: 0,
1142
+ implementation: this.options.implementation,
1143
+ maxFrameBytes: this.ownFrameLimit,
1144
+ termGraceMs: this.options.termGraceMs ?? 0,
1145
+ version: {
1146
+ major: 1,
1147
+ minor: 0
1148
+ }
1149
+ }
1150
+ },
1151
+ stream: 0
1152
+ }));
1153
+ this.startPinger();
1154
+ }
1155
+ openStream(id, open) {
1156
+ if (id % 2 === 0 || this.streams.has(id)) {
1157
+ this.finish(3, `stream ${id} cannot be opened by the client`);
1158
+ return;
1159
+ }
1160
+ const stream = {
1161
+ closedBySelf: false,
1162
+ recvRemaining: initialStreamCredit(this.ownFrameLimit),
1163
+ sendAvailable: initialStreamCredit(this.peerFrameLimit)
1164
+ };
1165
+ this.streams.set(id, stream);
1166
+ const context = {
1167
+ close: (code, message = "") => {
1168
+ if (stream.closedBySelf || !this.streams.has(id)) return;
1169
+ stream.closedBySelf = true;
1170
+ this.streams.delete(id);
1171
+ this.rejectWaitersFor(stream, new SessionClosed("stream closed"));
1172
+ this.enqueue(create(FrameSchema, {
1173
+ body: {
1174
+ case: "close",
1175
+ value: {
1176
+ code,
1177
+ message
1178
+ }
1179
+ },
1180
+ stream: id
1181
+ }));
1182
+ },
1183
+ granted: this.granted,
1184
+ id,
1185
+ ownFrameLimit: this.ownFrameLimit,
1186
+ peerFrameLimit: this.peerFrameLimit,
1187
+ send: (body) => this.sendOnStream(id, stream, body)
1188
+ };
1189
+ try {
1190
+ stream.handler = this.options.open(open, context);
1191
+ } catch (error) {
1192
+ const refusal = error instanceof Refusal ? error : new Refusal(8, String(error));
1193
+ context.close(refusal.code, refusal.message);
1194
+ }
1195
+ }
1196
+ onFinish(reason) {
1197
+ for (const stream of this.streams.values()) stream.handler?.closed(reason);
1198
+ }
1199
+ };
1200
+ /** Thrown by `open` to refuse a stream with a status. */
1201
+ var Refusal = class extends Error {
1202
+ code;
1203
+ constructor(code, message) {
1204
+ super(message);
1205
+ this.code = code;
1206
+ }
1207
+ };
1208
+ export { ClientSession, CreditSchema, ExecAttachSchema, ExecExitedSchema, ExecGapSchema, ExecInputSchema, ExecOutputSchema, ExecStartSchema, ExecStartedSchema, FrameDecoder, FrameSchema, FsAttrReplySchema, FsAttrSchema, FsCreateAndWriteSchema, FsCreateSchema, FsCreatedSchema, FsDataSchema, FsDirEntrySchema, FsEntrySchema, FsErrorSchema, FsFileType, FsFileTypeSchema, FsFlushSchema, FsForgetItemSchema, FsForgetSchema, FsFsyncSchema, FsGetAttrSchema, FsGetLockSchema, FsLinkSchema, FsLinkTargetSchema, FsLockMode, FsLockModeSchema, FsLockRangeSchema, FsLockReplySchema, FsLockType, FsLockTypeSchema, FsLookupSchema, FsMkdirSchema, FsMountSchema, FsMountedSchema, FsOkSchema, FsOpenSchema, FsOpenedSchema, FsPrefetchDirSchema, FsPrefetchTreeReplySchema, FsPrefetchTreeSchema, FsReadDirPlusReplySchema, FsReadDirPlusSchema, FsReadLinkSchema, FsReadSchema, FsReleaseSchema, FsRenameSchema, FsRequestSchema, FsResponseSchema, FsRmdirSchema, FsSetAttrSchema, FsSetLockSchema, FsStatFsReplySchema, FsStatFsSchema, FsSymlinkSchema, FsUnlinkSchema, FsWriteSchema, FsWrittenSchema, HelloSchema, ImplementationSchema, MIN_FRAME_BYTES, MISSED_PONGS, PING_INTERVAL_MS, PROTOCOL_MAJOR, PROTOCOL_MINOR, PingSchema, PongSchema, RbepService, Refusal, ServerSession, SessionClosed, SessionCore, SessionRequestSchema, SessionResponseSchema, StatusCode, StatusCodeSchema, StreamCloseSchema, StreamOpenSchema, VersionSchema, WelcomeSchema, WindowSizeSchema, WireError, creditedBytes, encodeFrameBatches, encodeFrames, file_rbep_v1_exec, file_rbep_v1_fs, file_rbep_v1_session, frameLimit, initialSessionCredit, initialStreamCredit };