@theway-ai/sdk 1.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.
Files changed (59) hide show
  1. package/README.md +102 -0
  2. package/dist/client.d.ts +138 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +390 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/generated/commands.d.ts +160 -0
  7. package/dist/generated/commands.d.ts.map +1 -0
  8. package/dist/generated/commands.js +449 -0
  9. package/dist/generated/commands.js.map +1 -0
  10. package/dist/generated/events.d.ts +144 -0
  11. package/dist/generated/events.d.ts.map +1 -0
  12. package/dist/generated/events.js +1044 -0
  13. package/dist/generated/events.js.map +1 -0
  14. package/dist/generated/extensions.d.ts +184 -0
  15. package/dist/generated/extensions.d.ts.map +1 -0
  16. package/dist/generated/extensions.js +1309 -0
  17. package/dist/generated/extensions.js.map +1 -0
  18. package/dist/generated/graph_engine.d.ts +373 -0
  19. package/dist/generated/graph_engine.d.ts.map +1 -0
  20. package/dist/generated/graph_engine.js +2422 -0
  21. package/dist/generated/graph_engine.js.map +1 -0
  22. package/dist/generated/health.d.ts +83 -0
  23. package/dist/generated/health.d.ts.map +1 -0
  24. package/dist/generated/health.js +179 -0
  25. package/dist/generated/health.js.map +1 -0
  26. package/dist/generated/session.d.ts +490 -0
  27. package/dist/generated/session.d.ts.map +1 -0
  28. package/dist/generated/session.js +3809 -0
  29. package/dist/generated/session.js.map +1 -0
  30. package/dist/generated/settings.d.ts +175 -0
  31. package/dist/generated/settings.d.ts.map +1 -0
  32. package/dist/generated/settings.js +304 -0
  33. package/dist/generated/settings.js.map +1 -0
  34. package/dist/generated/state.d.ts +291 -0
  35. package/dist/generated/state.d.ts.map +1 -0
  36. package/dist/generated/state.js +1382 -0
  37. package/dist/generated/state.js.map +1 -0
  38. package/dist/generated/tools.d.ts +413 -0
  39. package/dist/generated/tools.d.ts.map +1 -0
  40. package/dist/generated/tools.js +2487 -0
  41. package/dist/generated/tools.js.map +1 -0
  42. package/dist/health.d.ts +20 -0
  43. package/dist/health.d.ts.map +1 -0
  44. package/dist/health.js +62 -0
  45. package/dist/health.js.map +1 -0
  46. package/dist/index.d.ts +15 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +21 -0
  49. package/dist/index.js.map +1 -0
  50. package/package.json +46 -0
  51. package/proto/commands.proto +57 -0
  52. package/proto/events.proto +80 -0
  53. package/proto/extensions.proto +99 -0
  54. package/proto/graph_engine.proto +193 -0
  55. package/proto/health.proto +26 -0
  56. package/proto/session.proto +299 -0
  57. package/proto/settings.proto +73 -0
  58. package/proto/state.proto +129 -0
  59. package/proto/tools.proto +238 -0
@@ -0,0 +1,2487 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.0
4
+ // protoc v3.19.1
5
+ // source: tools.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { makeGenericClientConstructor, } from "@grpc/grpc-js";
9
+ export const protobufPackage = "theway.grpc.v1";
10
+ function createBaseReadFileRequest() {
11
+ return { path: "", offset: undefined, limit: undefined };
12
+ }
13
+ export const ReadFileRequest = {
14
+ encode(message, writer = new BinaryWriter()) {
15
+ if (message.path !== "") {
16
+ writer.uint32(10).string(message.path);
17
+ }
18
+ if (message.offset !== undefined) {
19
+ writer.uint32(16).uint64(message.offset);
20
+ }
21
+ if (message.limit !== undefined) {
22
+ writer.uint32(24).uint64(message.limit);
23
+ }
24
+ return writer;
25
+ },
26
+ decode(input, length) {
27
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
28
+ const end = length === undefined ? reader.len : reader.pos + length;
29
+ const message = createBaseReadFileRequest();
30
+ while (reader.pos < end) {
31
+ const tag = reader.uint32();
32
+ switch (tag >>> 3) {
33
+ case 1: {
34
+ if (tag !== 10) {
35
+ break;
36
+ }
37
+ message.path = reader.string();
38
+ continue;
39
+ }
40
+ case 2: {
41
+ if (tag !== 16) {
42
+ break;
43
+ }
44
+ message.offset = reader.uint64().toString();
45
+ continue;
46
+ }
47
+ case 3: {
48
+ if (tag !== 24) {
49
+ break;
50
+ }
51
+ message.limit = reader.uint64().toString();
52
+ continue;
53
+ }
54
+ }
55
+ if ((tag & 7) === 4 || tag === 0) {
56
+ break;
57
+ }
58
+ reader.skip(tag & 7);
59
+ }
60
+ return message;
61
+ },
62
+ fromJSON(object) {
63
+ return {
64
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
65
+ offset: isSet(object.offset) ? globalThis.String(object.offset) : undefined,
66
+ limit: isSet(object.limit) ? globalThis.String(object.limit) : undefined,
67
+ };
68
+ },
69
+ toJSON(message) {
70
+ const obj = {};
71
+ if (message.path !== "") {
72
+ obj.path = message.path;
73
+ }
74
+ if (message.offset !== undefined) {
75
+ obj.offset = message.offset;
76
+ }
77
+ if (message.limit !== undefined) {
78
+ obj.limit = message.limit;
79
+ }
80
+ return obj;
81
+ },
82
+ create(base) {
83
+ return ReadFileRequest.fromPartial(base ?? {});
84
+ },
85
+ fromPartial(object) {
86
+ const message = createBaseReadFileRequest();
87
+ message.path = object.path ?? "";
88
+ message.offset = object.offset ?? undefined;
89
+ message.limit = object.limit ?? undefined;
90
+ return message;
91
+ },
92
+ };
93
+ function createBaseReadFileResponse() {
94
+ return { content: "", totalLines: "0", truncated: false };
95
+ }
96
+ export const ReadFileResponse = {
97
+ encode(message, writer = new BinaryWriter()) {
98
+ if (message.content !== "") {
99
+ writer.uint32(10).string(message.content);
100
+ }
101
+ if (message.totalLines !== "0") {
102
+ writer.uint32(16).uint64(message.totalLines);
103
+ }
104
+ if (message.truncated !== false) {
105
+ writer.uint32(24).bool(message.truncated);
106
+ }
107
+ return writer;
108
+ },
109
+ decode(input, length) {
110
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
111
+ const end = length === undefined ? reader.len : reader.pos + length;
112
+ const message = createBaseReadFileResponse();
113
+ while (reader.pos < end) {
114
+ const tag = reader.uint32();
115
+ switch (tag >>> 3) {
116
+ case 1: {
117
+ if (tag !== 10) {
118
+ break;
119
+ }
120
+ message.content = reader.string();
121
+ continue;
122
+ }
123
+ case 2: {
124
+ if (tag !== 16) {
125
+ break;
126
+ }
127
+ message.totalLines = reader.uint64().toString();
128
+ continue;
129
+ }
130
+ case 3: {
131
+ if (tag !== 24) {
132
+ break;
133
+ }
134
+ message.truncated = reader.bool();
135
+ continue;
136
+ }
137
+ }
138
+ if ((tag & 7) === 4 || tag === 0) {
139
+ break;
140
+ }
141
+ reader.skip(tag & 7);
142
+ }
143
+ return message;
144
+ },
145
+ fromJSON(object) {
146
+ return {
147
+ content: isSet(object.content) ? globalThis.String(object.content) : "",
148
+ totalLines: isSet(object.totalLines)
149
+ ? globalThis.String(object.totalLines)
150
+ : isSet(object.total_lines)
151
+ ? globalThis.String(object.total_lines)
152
+ : "0",
153
+ truncated: isSet(object.truncated) ? globalThis.Boolean(object.truncated) : false,
154
+ };
155
+ },
156
+ toJSON(message) {
157
+ const obj = {};
158
+ if (message.content !== "") {
159
+ obj.content = message.content;
160
+ }
161
+ if (message.totalLines !== "0") {
162
+ obj.totalLines = message.totalLines;
163
+ }
164
+ if (message.truncated !== false) {
165
+ obj.truncated = message.truncated;
166
+ }
167
+ return obj;
168
+ },
169
+ create(base) {
170
+ return ReadFileResponse.fromPartial(base ?? {});
171
+ },
172
+ fromPartial(object) {
173
+ const message = createBaseReadFileResponse();
174
+ message.content = object.content ?? "";
175
+ message.totalLines = object.totalLines ?? "0";
176
+ message.truncated = object.truncated ?? false;
177
+ return message;
178
+ },
179
+ };
180
+ function createBaseWriteFileRequest() {
181
+ return { path: "", content: "" };
182
+ }
183
+ export const WriteFileRequest = {
184
+ encode(message, writer = new BinaryWriter()) {
185
+ if (message.path !== "") {
186
+ writer.uint32(10).string(message.path);
187
+ }
188
+ if (message.content !== "") {
189
+ writer.uint32(18).string(message.content);
190
+ }
191
+ return writer;
192
+ },
193
+ decode(input, length) {
194
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
195
+ const end = length === undefined ? reader.len : reader.pos + length;
196
+ const message = createBaseWriteFileRequest();
197
+ while (reader.pos < end) {
198
+ const tag = reader.uint32();
199
+ switch (tag >>> 3) {
200
+ case 1: {
201
+ if (tag !== 10) {
202
+ break;
203
+ }
204
+ message.path = reader.string();
205
+ continue;
206
+ }
207
+ case 2: {
208
+ if (tag !== 18) {
209
+ break;
210
+ }
211
+ message.content = reader.string();
212
+ continue;
213
+ }
214
+ }
215
+ if ((tag & 7) === 4 || tag === 0) {
216
+ break;
217
+ }
218
+ reader.skip(tag & 7);
219
+ }
220
+ return message;
221
+ },
222
+ fromJSON(object) {
223
+ return {
224
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
225
+ content: isSet(object.content) ? globalThis.String(object.content) : "",
226
+ };
227
+ },
228
+ toJSON(message) {
229
+ const obj = {};
230
+ if (message.path !== "") {
231
+ obj.path = message.path;
232
+ }
233
+ if (message.content !== "") {
234
+ obj.content = message.content;
235
+ }
236
+ return obj;
237
+ },
238
+ create(base) {
239
+ return WriteFileRequest.fromPartial(base ?? {});
240
+ },
241
+ fromPartial(object) {
242
+ const message = createBaseWriteFileRequest();
243
+ message.path = object.path ?? "";
244
+ message.content = object.content ?? "";
245
+ return message;
246
+ },
247
+ };
248
+ function createBaseWriteFileResponse() {
249
+ return { bytesWritten: "0" };
250
+ }
251
+ export const WriteFileResponse = {
252
+ encode(message, writer = new BinaryWriter()) {
253
+ if (message.bytesWritten !== "0") {
254
+ writer.uint32(8).uint64(message.bytesWritten);
255
+ }
256
+ return writer;
257
+ },
258
+ decode(input, length) {
259
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
260
+ const end = length === undefined ? reader.len : reader.pos + length;
261
+ const message = createBaseWriteFileResponse();
262
+ while (reader.pos < end) {
263
+ const tag = reader.uint32();
264
+ switch (tag >>> 3) {
265
+ case 1: {
266
+ if (tag !== 8) {
267
+ break;
268
+ }
269
+ message.bytesWritten = reader.uint64().toString();
270
+ continue;
271
+ }
272
+ }
273
+ if ((tag & 7) === 4 || tag === 0) {
274
+ break;
275
+ }
276
+ reader.skip(tag & 7);
277
+ }
278
+ return message;
279
+ },
280
+ fromJSON(object) {
281
+ return {
282
+ bytesWritten: isSet(object.bytesWritten)
283
+ ? globalThis.String(object.bytesWritten)
284
+ : isSet(object.bytes_written)
285
+ ? globalThis.String(object.bytes_written)
286
+ : "0",
287
+ };
288
+ },
289
+ toJSON(message) {
290
+ const obj = {};
291
+ if (message.bytesWritten !== "0") {
292
+ obj.bytesWritten = message.bytesWritten;
293
+ }
294
+ return obj;
295
+ },
296
+ create(base) {
297
+ return WriteFileResponse.fromPartial(base ?? {});
298
+ },
299
+ fromPartial(object) {
300
+ const message = createBaseWriteFileResponse();
301
+ message.bytesWritten = object.bytesWritten ?? "0";
302
+ return message;
303
+ },
304
+ };
305
+ function createBaseEditFileRequest() {
306
+ return { path: "", oldString: "", newString: "", replaceAll: false, rangeStart: undefined, rangeEnd: undefined };
307
+ }
308
+ export const EditFileRequest = {
309
+ encode(message, writer = new BinaryWriter()) {
310
+ if (message.path !== "") {
311
+ writer.uint32(10).string(message.path);
312
+ }
313
+ if (message.oldString !== "") {
314
+ writer.uint32(18).string(message.oldString);
315
+ }
316
+ if (message.newString !== "") {
317
+ writer.uint32(26).string(message.newString);
318
+ }
319
+ if (message.replaceAll !== false) {
320
+ writer.uint32(32).bool(message.replaceAll);
321
+ }
322
+ if (message.rangeStart !== undefined) {
323
+ writer.uint32(40).uint64(message.rangeStart);
324
+ }
325
+ if (message.rangeEnd !== undefined) {
326
+ writer.uint32(48).uint64(message.rangeEnd);
327
+ }
328
+ return writer;
329
+ },
330
+ decode(input, length) {
331
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
332
+ const end = length === undefined ? reader.len : reader.pos + length;
333
+ const message = createBaseEditFileRequest();
334
+ while (reader.pos < end) {
335
+ const tag = reader.uint32();
336
+ switch (tag >>> 3) {
337
+ case 1: {
338
+ if (tag !== 10) {
339
+ break;
340
+ }
341
+ message.path = reader.string();
342
+ continue;
343
+ }
344
+ case 2: {
345
+ if (tag !== 18) {
346
+ break;
347
+ }
348
+ message.oldString = reader.string();
349
+ continue;
350
+ }
351
+ case 3: {
352
+ if (tag !== 26) {
353
+ break;
354
+ }
355
+ message.newString = reader.string();
356
+ continue;
357
+ }
358
+ case 4: {
359
+ if (tag !== 32) {
360
+ break;
361
+ }
362
+ message.replaceAll = reader.bool();
363
+ continue;
364
+ }
365
+ case 5: {
366
+ if (tag !== 40) {
367
+ break;
368
+ }
369
+ message.rangeStart = reader.uint64().toString();
370
+ continue;
371
+ }
372
+ case 6: {
373
+ if (tag !== 48) {
374
+ break;
375
+ }
376
+ message.rangeEnd = reader.uint64().toString();
377
+ continue;
378
+ }
379
+ }
380
+ if ((tag & 7) === 4 || tag === 0) {
381
+ break;
382
+ }
383
+ reader.skip(tag & 7);
384
+ }
385
+ return message;
386
+ },
387
+ fromJSON(object) {
388
+ return {
389
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
390
+ oldString: isSet(object.oldString)
391
+ ? globalThis.String(object.oldString)
392
+ : isSet(object.old_string)
393
+ ? globalThis.String(object.old_string)
394
+ : "",
395
+ newString: isSet(object.newString)
396
+ ? globalThis.String(object.newString)
397
+ : isSet(object.new_string)
398
+ ? globalThis.String(object.new_string)
399
+ : "",
400
+ replaceAll: isSet(object.replaceAll)
401
+ ? globalThis.Boolean(object.replaceAll)
402
+ : isSet(object.replace_all)
403
+ ? globalThis.Boolean(object.replace_all)
404
+ : false,
405
+ rangeStart: isSet(object.rangeStart)
406
+ ? globalThis.String(object.rangeStart)
407
+ : isSet(object.range_start)
408
+ ? globalThis.String(object.range_start)
409
+ : undefined,
410
+ rangeEnd: isSet(object.rangeEnd)
411
+ ? globalThis.String(object.rangeEnd)
412
+ : isSet(object.range_end)
413
+ ? globalThis.String(object.range_end)
414
+ : undefined,
415
+ };
416
+ },
417
+ toJSON(message) {
418
+ const obj = {};
419
+ if (message.path !== "") {
420
+ obj.path = message.path;
421
+ }
422
+ if (message.oldString !== "") {
423
+ obj.oldString = message.oldString;
424
+ }
425
+ if (message.newString !== "") {
426
+ obj.newString = message.newString;
427
+ }
428
+ if (message.replaceAll !== false) {
429
+ obj.replaceAll = message.replaceAll;
430
+ }
431
+ if (message.rangeStart !== undefined) {
432
+ obj.rangeStart = message.rangeStart;
433
+ }
434
+ if (message.rangeEnd !== undefined) {
435
+ obj.rangeEnd = message.rangeEnd;
436
+ }
437
+ return obj;
438
+ },
439
+ create(base) {
440
+ return EditFileRequest.fromPartial(base ?? {});
441
+ },
442
+ fromPartial(object) {
443
+ const message = createBaseEditFileRequest();
444
+ message.path = object.path ?? "";
445
+ message.oldString = object.oldString ?? "";
446
+ message.newString = object.newString ?? "";
447
+ message.replaceAll = object.replaceAll ?? false;
448
+ message.rangeStart = object.rangeStart ?? undefined;
449
+ message.rangeEnd = object.rangeEnd ?? undefined;
450
+ return message;
451
+ },
452
+ };
453
+ function createBaseEditFileResponse() {
454
+ return { replacements: 0 };
455
+ }
456
+ export const EditFileResponse = {
457
+ encode(message, writer = new BinaryWriter()) {
458
+ if (message.replacements !== 0) {
459
+ writer.uint32(8).uint32(message.replacements);
460
+ }
461
+ return writer;
462
+ },
463
+ decode(input, length) {
464
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
465
+ const end = length === undefined ? reader.len : reader.pos + length;
466
+ const message = createBaseEditFileResponse();
467
+ while (reader.pos < end) {
468
+ const tag = reader.uint32();
469
+ switch (tag >>> 3) {
470
+ case 1: {
471
+ if (tag !== 8) {
472
+ break;
473
+ }
474
+ message.replacements = reader.uint32();
475
+ continue;
476
+ }
477
+ }
478
+ if ((tag & 7) === 4 || tag === 0) {
479
+ break;
480
+ }
481
+ reader.skip(tag & 7);
482
+ }
483
+ return message;
484
+ },
485
+ fromJSON(object) {
486
+ return { replacements: isSet(object.replacements) ? globalThis.Number(object.replacements) : 0 };
487
+ },
488
+ toJSON(message) {
489
+ const obj = {};
490
+ if (message.replacements !== 0) {
491
+ obj.replacements = Math.round(message.replacements);
492
+ }
493
+ return obj;
494
+ },
495
+ create(base) {
496
+ return EditFileResponse.fromPartial(base ?? {});
497
+ },
498
+ fromPartial(object) {
499
+ const message = createBaseEditFileResponse();
500
+ message.replacements = object.replacements ?? 0;
501
+ return message;
502
+ },
503
+ };
504
+ function createBaseExecCommandRequest() {
505
+ return { command: "", cwd: undefined, timeoutMs: undefined };
506
+ }
507
+ export const ExecCommandRequest = {
508
+ encode(message, writer = new BinaryWriter()) {
509
+ if (message.command !== "") {
510
+ writer.uint32(10).string(message.command);
511
+ }
512
+ if (message.cwd !== undefined) {
513
+ writer.uint32(18).string(message.cwd);
514
+ }
515
+ if (message.timeoutMs !== undefined) {
516
+ writer.uint32(24).uint64(message.timeoutMs);
517
+ }
518
+ return writer;
519
+ },
520
+ decode(input, length) {
521
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
522
+ const end = length === undefined ? reader.len : reader.pos + length;
523
+ const message = createBaseExecCommandRequest();
524
+ while (reader.pos < end) {
525
+ const tag = reader.uint32();
526
+ switch (tag >>> 3) {
527
+ case 1: {
528
+ if (tag !== 10) {
529
+ break;
530
+ }
531
+ message.command = reader.string();
532
+ continue;
533
+ }
534
+ case 2: {
535
+ if (tag !== 18) {
536
+ break;
537
+ }
538
+ message.cwd = reader.string();
539
+ continue;
540
+ }
541
+ case 3: {
542
+ if (tag !== 24) {
543
+ break;
544
+ }
545
+ message.timeoutMs = reader.uint64().toString();
546
+ continue;
547
+ }
548
+ }
549
+ if ((tag & 7) === 4 || tag === 0) {
550
+ break;
551
+ }
552
+ reader.skip(tag & 7);
553
+ }
554
+ return message;
555
+ },
556
+ fromJSON(object) {
557
+ return {
558
+ command: isSet(object.command) ? globalThis.String(object.command) : "",
559
+ cwd: isSet(object.cwd) ? globalThis.String(object.cwd) : undefined,
560
+ timeoutMs: isSet(object.timeoutMs)
561
+ ? globalThis.String(object.timeoutMs)
562
+ : isSet(object.timeout_ms)
563
+ ? globalThis.String(object.timeout_ms)
564
+ : undefined,
565
+ };
566
+ },
567
+ toJSON(message) {
568
+ const obj = {};
569
+ if (message.command !== "") {
570
+ obj.command = message.command;
571
+ }
572
+ if (message.cwd !== undefined) {
573
+ obj.cwd = message.cwd;
574
+ }
575
+ if (message.timeoutMs !== undefined) {
576
+ obj.timeoutMs = message.timeoutMs;
577
+ }
578
+ return obj;
579
+ },
580
+ create(base) {
581
+ return ExecCommandRequest.fromPartial(base ?? {});
582
+ },
583
+ fromPartial(object) {
584
+ const message = createBaseExecCommandRequest();
585
+ message.command = object.command ?? "";
586
+ message.cwd = object.cwd ?? undefined;
587
+ message.timeoutMs = object.timeoutMs ?? undefined;
588
+ return message;
589
+ },
590
+ };
591
+ function createBaseExecOutputFrame() {
592
+ return { kind: undefined };
593
+ }
594
+ export const ExecOutputFrame = {
595
+ encode(message, writer = new BinaryWriter()) {
596
+ switch (message.kind?.$case) {
597
+ case "output":
598
+ writer.uint32(10).string(message.kind.output);
599
+ break;
600
+ case "exit":
601
+ ExecExit.encode(message.kind.exit, writer.uint32(18).fork()).join();
602
+ break;
603
+ }
604
+ return writer;
605
+ },
606
+ decode(input, length) {
607
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
608
+ const end = length === undefined ? reader.len : reader.pos + length;
609
+ const message = createBaseExecOutputFrame();
610
+ while (reader.pos < end) {
611
+ const tag = reader.uint32();
612
+ switch (tag >>> 3) {
613
+ case 1: {
614
+ if (tag !== 10) {
615
+ break;
616
+ }
617
+ message.kind = { $case: "output", output: reader.string() };
618
+ continue;
619
+ }
620
+ case 2: {
621
+ if (tag !== 18) {
622
+ break;
623
+ }
624
+ message.kind = { $case: "exit", exit: ExecExit.decode(reader, reader.uint32()) };
625
+ continue;
626
+ }
627
+ }
628
+ if ((tag & 7) === 4 || tag === 0) {
629
+ break;
630
+ }
631
+ reader.skip(tag & 7);
632
+ }
633
+ return message;
634
+ },
635
+ fromJSON(object) {
636
+ return {
637
+ kind: isSet(object.output)
638
+ ? { $case: "output", output: globalThis.String(object.output) }
639
+ : isSet(object.exit)
640
+ ? { $case: "exit", exit: ExecExit.fromJSON(object.exit) }
641
+ : undefined,
642
+ };
643
+ },
644
+ toJSON(message) {
645
+ const obj = {};
646
+ if (message.kind?.$case === "output") {
647
+ obj.output = message.kind.output;
648
+ }
649
+ else if (message.kind?.$case === "exit") {
650
+ obj.exit = ExecExit.toJSON(message.kind.exit);
651
+ }
652
+ return obj;
653
+ },
654
+ create(base) {
655
+ return ExecOutputFrame.fromPartial(base ?? {});
656
+ },
657
+ fromPartial(object) {
658
+ const message = createBaseExecOutputFrame();
659
+ switch (object.kind?.$case) {
660
+ case "output": {
661
+ if (object.kind?.output !== undefined && object.kind?.output !== null) {
662
+ message.kind = { $case: "output", output: object.kind.output };
663
+ }
664
+ break;
665
+ }
666
+ case "exit": {
667
+ if (object.kind?.exit !== undefined && object.kind?.exit !== null) {
668
+ message.kind = { $case: "exit", exit: ExecExit.fromPartial(object.kind.exit) };
669
+ }
670
+ break;
671
+ }
672
+ }
673
+ return message;
674
+ },
675
+ };
676
+ function createBaseExecExit() {
677
+ return { code: 0, timedOut: false, durationMs: "0" };
678
+ }
679
+ export const ExecExit = {
680
+ encode(message, writer = new BinaryWriter()) {
681
+ if (message.code !== 0) {
682
+ writer.uint32(8).int32(message.code);
683
+ }
684
+ if (message.timedOut !== false) {
685
+ writer.uint32(16).bool(message.timedOut);
686
+ }
687
+ if (message.durationMs !== "0") {
688
+ writer.uint32(24).uint64(message.durationMs);
689
+ }
690
+ return writer;
691
+ },
692
+ decode(input, length) {
693
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
694
+ const end = length === undefined ? reader.len : reader.pos + length;
695
+ const message = createBaseExecExit();
696
+ while (reader.pos < end) {
697
+ const tag = reader.uint32();
698
+ switch (tag >>> 3) {
699
+ case 1: {
700
+ if (tag !== 8) {
701
+ break;
702
+ }
703
+ message.code = reader.int32();
704
+ continue;
705
+ }
706
+ case 2: {
707
+ if (tag !== 16) {
708
+ break;
709
+ }
710
+ message.timedOut = reader.bool();
711
+ continue;
712
+ }
713
+ case 3: {
714
+ if (tag !== 24) {
715
+ break;
716
+ }
717
+ message.durationMs = reader.uint64().toString();
718
+ continue;
719
+ }
720
+ }
721
+ if ((tag & 7) === 4 || tag === 0) {
722
+ break;
723
+ }
724
+ reader.skip(tag & 7);
725
+ }
726
+ return message;
727
+ },
728
+ fromJSON(object) {
729
+ return {
730
+ code: isSet(object.code) ? globalThis.Number(object.code) : 0,
731
+ timedOut: isSet(object.timedOut)
732
+ ? globalThis.Boolean(object.timedOut)
733
+ : isSet(object.timed_out)
734
+ ? globalThis.Boolean(object.timed_out)
735
+ : false,
736
+ durationMs: isSet(object.durationMs)
737
+ ? globalThis.String(object.durationMs)
738
+ : isSet(object.duration_ms)
739
+ ? globalThis.String(object.duration_ms)
740
+ : "0",
741
+ };
742
+ },
743
+ toJSON(message) {
744
+ const obj = {};
745
+ if (message.code !== 0) {
746
+ obj.code = Math.round(message.code);
747
+ }
748
+ if (message.timedOut !== false) {
749
+ obj.timedOut = message.timedOut;
750
+ }
751
+ if (message.durationMs !== "0") {
752
+ obj.durationMs = message.durationMs;
753
+ }
754
+ return obj;
755
+ },
756
+ create(base) {
757
+ return ExecExit.fromPartial(base ?? {});
758
+ },
759
+ fromPartial(object) {
760
+ const message = createBaseExecExit();
761
+ message.code = object.code ?? 0;
762
+ message.timedOut = object.timedOut ?? false;
763
+ message.durationMs = object.durationMs ?? "0";
764
+ return message;
765
+ },
766
+ };
767
+ function createBaseListDirRequest() {
768
+ return { path: "", limit: undefined };
769
+ }
770
+ export const ListDirRequest = {
771
+ encode(message, writer = new BinaryWriter()) {
772
+ if (message.path !== "") {
773
+ writer.uint32(10).string(message.path);
774
+ }
775
+ if (message.limit !== undefined) {
776
+ writer.uint32(16).uint64(message.limit);
777
+ }
778
+ return writer;
779
+ },
780
+ decode(input, length) {
781
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
782
+ const end = length === undefined ? reader.len : reader.pos + length;
783
+ const message = createBaseListDirRequest();
784
+ while (reader.pos < end) {
785
+ const tag = reader.uint32();
786
+ switch (tag >>> 3) {
787
+ case 1: {
788
+ if (tag !== 10) {
789
+ break;
790
+ }
791
+ message.path = reader.string();
792
+ continue;
793
+ }
794
+ case 2: {
795
+ if (tag !== 16) {
796
+ break;
797
+ }
798
+ message.limit = reader.uint64().toString();
799
+ continue;
800
+ }
801
+ }
802
+ if ((tag & 7) === 4 || tag === 0) {
803
+ break;
804
+ }
805
+ reader.skip(tag & 7);
806
+ }
807
+ return message;
808
+ },
809
+ fromJSON(object) {
810
+ return {
811
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
812
+ limit: isSet(object.limit) ? globalThis.String(object.limit) : undefined,
813
+ };
814
+ },
815
+ toJSON(message) {
816
+ const obj = {};
817
+ if (message.path !== "") {
818
+ obj.path = message.path;
819
+ }
820
+ if (message.limit !== undefined) {
821
+ obj.limit = message.limit;
822
+ }
823
+ return obj;
824
+ },
825
+ create(base) {
826
+ return ListDirRequest.fromPartial(base ?? {});
827
+ },
828
+ fromPartial(object) {
829
+ const message = createBaseListDirRequest();
830
+ message.path = object.path ?? "";
831
+ message.limit = object.limit ?? undefined;
832
+ return message;
833
+ },
834
+ };
835
+ function createBaseDirEntry() {
836
+ return { name: "", kind: "", size: "0" };
837
+ }
838
+ export const DirEntry = {
839
+ encode(message, writer = new BinaryWriter()) {
840
+ if (message.name !== "") {
841
+ writer.uint32(10).string(message.name);
842
+ }
843
+ if (message.kind !== "") {
844
+ writer.uint32(18).string(message.kind);
845
+ }
846
+ if (message.size !== "0") {
847
+ writer.uint32(24).uint64(message.size);
848
+ }
849
+ return writer;
850
+ },
851
+ decode(input, length) {
852
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
853
+ const end = length === undefined ? reader.len : reader.pos + length;
854
+ const message = createBaseDirEntry();
855
+ while (reader.pos < end) {
856
+ const tag = reader.uint32();
857
+ switch (tag >>> 3) {
858
+ case 1: {
859
+ if (tag !== 10) {
860
+ break;
861
+ }
862
+ message.name = reader.string();
863
+ continue;
864
+ }
865
+ case 2: {
866
+ if (tag !== 18) {
867
+ break;
868
+ }
869
+ message.kind = reader.string();
870
+ continue;
871
+ }
872
+ case 3: {
873
+ if (tag !== 24) {
874
+ break;
875
+ }
876
+ message.size = reader.uint64().toString();
877
+ continue;
878
+ }
879
+ }
880
+ if ((tag & 7) === 4 || tag === 0) {
881
+ break;
882
+ }
883
+ reader.skip(tag & 7);
884
+ }
885
+ return message;
886
+ },
887
+ fromJSON(object) {
888
+ return {
889
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
890
+ kind: isSet(object.kind) ? globalThis.String(object.kind) : "",
891
+ size: isSet(object.size) ? globalThis.String(object.size) : "0",
892
+ };
893
+ },
894
+ toJSON(message) {
895
+ const obj = {};
896
+ if (message.name !== "") {
897
+ obj.name = message.name;
898
+ }
899
+ if (message.kind !== "") {
900
+ obj.kind = message.kind;
901
+ }
902
+ if (message.size !== "0") {
903
+ obj.size = message.size;
904
+ }
905
+ return obj;
906
+ },
907
+ create(base) {
908
+ return DirEntry.fromPartial(base ?? {});
909
+ },
910
+ fromPartial(object) {
911
+ const message = createBaseDirEntry();
912
+ message.name = object.name ?? "";
913
+ message.kind = object.kind ?? "";
914
+ message.size = object.size ?? "0";
915
+ return message;
916
+ },
917
+ };
918
+ function createBaseListDirResponse() {
919
+ return { entries: [] };
920
+ }
921
+ export const ListDirResponse = {
922
+ encode(message, writer = new BinaryWriter()) {
923
+ for (const v of message.entries) {
924
+ DirEntry.encode(v, writer.uint32(10).fork()).join();
925
+ }
926
+ return writer;
927
+ },
928
+ decode(input, length) {
929
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
930
+ const end = length === undefined ? reader.len : reader.pos + length;
931
+ const message = createBaseListDirResponse();
932
+ while (reader.pos < end) {
933
+ const tag = reader.uint32();
934
+ switch (tag >>> 3) {
935
+ case 1: {
936
+ if (tag !== 10) {
937
+ break;
938
+ }
939
+ message.entries.push(DirEntry.decode(reader, reader.uint32()));
940
+ continue;
941
+ }
942
+ }
943
+ if ((tag & 7) === 4 || tag === 0) {
944
+ break;
945
+ }
946
+ reader.skip(tag & 7);
947
+ }
948
+ return message;
949
+ },
950
+ fromJSON(object) {
951
+ return {
952
+ entries: globalThis.Array.isArray(object?.entries) ? object.entries.map((e) => DirEntry.fromJSON(e)) : [],
953
+ };
954
+ },
955
+ toJSON(message) {
956
+ const obj = {};
957
+ if (message.entries?.length) {
958
+ obj.entries = message.entries.map((e) => DirEntry.toJSON(e));
959
+ }
960
+ return obj;
961
+ },
962
+ create(base) {
963
+ return ListDirResponse.fromPartial(base ?? {});
964
+ },
965
+ fromPartial(object) {
966
+ const message = createBaseListDirResponse();
967
+ message.entries = object.entries?.map((e) => DirEntry.fromPartial(e)) || [];
968
+ return message;
969
+ },
970
+ };
971
+ function createBaseGrepRequest() {
972
+ return {
973
+ pattern: "",
974
+ path: undefined,
975
+ globFilter: undefined,
976
+ caseInsensitive: false,
977
+ outputMode: undefined,
978
+ maxResults: undefined,
979
+ };
980
+ }
981
+ export const GrepRequest = {
982
+ encode(message, writer = new BinaryWriter()) {
983
+ if (message.pattern !== "") {
984
+ writer.uint32(10).string(message.pattern);
985
+ }
986
+ if (message.path !== undefined) {
987
+ writer.uint32(18).string(message.path);
988
+ }
989
+ if (message.globFilter !== undefined) {
990
+ writer.uint32(26).string(message.globFilter);
991
+ }
992
+ if (message.caseInsensitive !== false) {
993
+ writer.uint32(32).bool(message.caseInsensitive);
994
+ }
995
+ if (message.outputMode !== undefined) {
996
+ writer.uint32(42).string(message.outputMode);
997
+ }
998
+ if (message.maxResults !== undefined) {
999
+ writer.uint32(48).uint64(message.maxResults);
1000
+ }
1001
+ return writer;
1002
+ },
1003
+ decode(input, length) {
1004
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1005
+ const end = length === undefined ? reader.len : reader.pos + length;
1006
+ const message = createBaseGrepRequest();
1007
+ while (reader.pos < end) {
1008
+ const tag = reader.uint32();
1009
+ switch (tag >>> 3) {
1010
+ case 1: {
1011
+ if (tag !== 10) {
1012
+ break;
1013
+ }
1014
+ message.pattern = reader.string();
1015
+ continue;
1016
+ }
1017
+ case 2: {
1018
+ if (tag !== 18) {
1019
+ break;
1020
+ }
1021
+ message.path = reader.string();
1022
+ continue;
1023
+ }
1024
+ case 3: {
1025
+ if (tag !== 26) {
1026
+ break;
1027
+ }
1028
+ message.globFilter = reader.string();
1029
+ continue;
1030
+ }
1031
+ case 4: {
1032
+ if (tag !== 32) {
1033
+ break;
1034
+ }
1035
+ message.caseInsensitive = reader.bool();
1036
+ continue;
1037
+ }
1038
+ case 5: {
1039
+ if (tag !== 42) {
1040
+ break;
1041
+ }
1042
+ message.outputMode = reader.string();
1043
+ continue;
1044
+ }
1045
+ case 6: {
1046
+ if (tag !== 48) {
1047
+ break;
1048
+ }
1049
+ message.maxResults = reader.uint64().toString();
1050
+ continue;
1051
+ }
1052
+ }
1053
+ if ((tag & 7) === 4 || tag === 0) {
1054
+ break;
1055
+ }
1056
+ reader.skip(tag & 7);
1057
+ }
1058
+ return message;
1059
+ },
1060
+ fromJSON(object) {
1061
+ return {
1062
+ pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "",
1063
+ path: isSet(object.path) ? globalThis.String(object.path) : undefined,
1064
+ globFilter: isSet(object.globFilter)
1065
+ ? globalThis.String(object.globFilter)
1066
+ : isSet(object.glob_filter)
1067
+ ? globalThis.String(object.glob_filter)
1068
+ : undefined,
1069
+ caseInsensitive: isSet(object.caseInsensitive)
1070
+ ? globalThis.Boolean(object.caseInsensitive)
1071
+ : isSet(object.case_insensitive)
1072
+ ? globalThis.Boolean(object.case_insensitive)
1073
+ : false,
1074
+ outputMode: isSet(object.outputMode)
1075
+ ? globalThis.String(object.outputMode)
1076
+ : isSet(object.output_mode)
1077
+ ? globalThis.String(object.output_mode)
1078
+ : undefined,
1079
+ maxResults: isSet(object.maxResults)
1080
+ ? globalThis.String(object.maxResults)
1081
+ : isSet(object.max_results)
1082
+ ? globalThis.String(object.max_results)
1083
+ : undefined,
1084
+ };
1085
+ },
1086
+ toJSON(message) {
1087
+ const obj = {};
1088
+ if (message.pattern !== "") {
1089
+ obj.pattern = message.pattern;
1090
+ }
1091
+ if (message.path !== undefined) {
1092
+ obj.path = message.path;
1093
+ }
1094
+ if (message.globFilter !== undefined) {
1095
+ obj.globFilter = message.globFilter;
1096
+ }
1097
+ if (message.caseInsensitive !== false) {
1098
+ obj.caseInsensitive = message.caseInsensitive;
1099
+ }
1100
+ if (message.outputMode !== undefined) {
1101
+ obj.outputMode = message.outputMode;
1102
+ }
1103
+ if (message.maxResults !== undefined) {
1104
+ obj.maxResults = message.maxResults;
1105
+ }
1106
+ return obj;
1107
+ },
1108
+ create(base) {
1109
+ return GrepRequest.fromPartial(base ?? {});
1110
+ },
1111
+ fromPartial(object) {
1112
+ const message = createBaseGrepRequest();
1113
+ message.pattern = object.pattern ?? "";
1114
+ message.path = object.path ?? undefined;
1115
+ message.globFilter = object.globFilter ?? undefined;
1116
+ message.caseInsensitive = object.caseInsensitive ?? false;
1117
+ message.outputMode = object.outputMode ?? undefined;
1118
+ message.maxResults = object.maxResults ?? undefined;
1119
+ return message;
1120
+ },
1121
+ };
1122
+ function createBaseGrepMatch() {
1123
+ return { path: "", lineNumber: "0", line: "" };
1124
+ }
1125
+ export const GrepMatch = {
1126
+ encode(message, writer = new BinaryWriter()) {
1127
+ if (message.path !== "") {
1128
+ writer.uint32(10).string(message.path);
1129
+ }
1130
+ if (message.lineNumber !== "0") {
1131
+ writer.uint32(16).uint64(message.lineNumber);
1132
+ }
1133
+ if (message.line !== "") {
1134
+ writer.uint32(26).string(message.line);
1135
+ }
1136
+ return writer;
1137
+ },
1138
+ decode(input, length) {
1139
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1140
+ const end = length === undefined ? reader.len : reader.pos + length;
1141
+ const message = createBaseGrepMatch();
1142
+ while (reader.pos < end) {
1143
+ const tag = reader.uint32();
1144
+ switch (tag >>> 3) {
1145
+ case 1: {
1146
+ if (tag !== 10) {
1147
+ break;
1148
+ }
1149
+ message.path = reader.string();
1150
+ continue;
1151
+ }
1152
+ case 2: {
1153
+ if (tag !== 16) {
1154
+ break;
1155
+ }
1156
+ message.lineNumber = reader.uint64().toString();
1157
+ continue;
1158
+ }
1159
+ case 3: {
1160
+ if (tag !== 26) {
1161
+ break;
1162
+ }
1163
+ message.line = reader.string();
1164
+ continue;
1165
+ }
1166
+ }
1167
+ if ((tag & 7) === 4 || tag === 0) {
1168
+ break;
1169
+ }
1170
+ reader.skip(tag & 7);
1171
+ }
1172
+ return message;
1173
+ },
1174
+ fromJSON(object) {
1175
+ return {
1176
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
1177
+ lineNumber: isSet(object.lineNumber)
1178
+ ? globalThis.String(object.lineNumber)
1179
+ : isSet(object.line_number)
1180
+ ? globalThis.String(object.line_number)
1181
+ : "0",
1182
+ line: isSet(object.line) ? globalThis.String(object.line) : "",
1183
+ };
1184
+ },
1185
+ toJSON(message) {
1186
+ const obj = {};
1187
+ if (message.path !== "") {
1188
+ obj.path = message.path;
1189
+ }
1190
+ if (message.lineNumber !== "0") {
1191
+ obj.lineNumber = message.lineNumber;
1192
+ }
1193
+ if (message.line !== "") {
1194
+ obj.line = message.line;
1195
+ }
1196
+ return obj;
1197
+ },
1198
+ create(base) {
1199
+ return GrepMatch.fromPartial(base ?? {});
1200
+ },
1201
+ fromPartial(object) {
1202
+ const message = createBaseGrepMatch();
1203
+ message.path = object.path ?? "";
1204
+ message.lineNumber = object.lineNumber ?? "0";
1205
+ message.line = object.line ?? "";
1206
+ return message;
1207
+ },
1208
+ };
1209
+ function createBaseGrepFileCount() {
1210
+ return { path: "", count: "0" };
1211
+ }
1212
+ export const GrepFileCount = {
1213
+ encode(message, writer = new BinaryWriter()) {
1214
+ if (message.path !== "") {
1215
+ writer.uint32(10).string(message.path);
1216
+ }
1217
+ if (message.count !== "0") {
1218
+ writer.uint32(16).uint64(message.count);
1219
+ }
1220
+ return writer;
1221
+ },
1222
+ decode(input, length) {
1223
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1224
+ const end = length === undefined ? reader.len : reader.pos + length;
1225
+ const message = createBaseGrepFileCount();
1226
+ while (reader.pos < end) {
1227
+ const tag = reader.uint32();
1228
+ switch (tag >>> 3) {
1229
+ case 1: {
1230
+ if (tag !== 10) {
1231
+ break;
1232
+ }
1233
+ message.path = reader.string();
1234
+ continue;
1235
+ }
1236
+ case 2: {
1237
+ if (tag !== 16) {
1238
+ break;
1239
+ }
1240
+ message.count = reader.uint64().toString();
1241
+ continue;
1242
+ }
1243
+ }
1244
+ if ((tag & 7) === 4 || tag === 0) {
1245
+ break;
1246
+ }
1247
+ reader.skip(tag & 7);
1248
+ }
1249
+ return message;
1250
+ },
1251
+ fromJSON(object) {
1252
+ return {
1253
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
1254
+ count: isSet(object.count) ? globalThis.String(object.count) : "0",
1255
+ };
1256
+ },
1257
+ toJSON(message) {
1258
+ const obj = {};
1259
+ if (message.path !== "") {
1260
+ obj.path = message.path;
1261
+ }
1262
+ if (message.count !== "0") {
1263
+ obj.count = message.count;
1264
+ }
1265
+ return obj;
1266
+ },
1267
+ create(base) {
1268
+ return GrepFileCount.fromPartial(base ?? {});
1269
+ },
1270
+ fromPartial(object) {
1271
+ const message = createBaseGrepFileCount();
1272
+ message.path = object.path ?? "";
1273
+ message.count = object.count ?? "0";
1274
+ return message;
1275
+ },
1276
+ };
1277
+ function createBaseGrepResponse() {
1278
+ return { matches: [], files: [], counts: [] };
1279
+ }
1280
+ export const GrepResponse = {
1281
+ encode(message, writer = new BinaryWriter()) {
1282
+ for (const v of message.matches) {
1283
+ GrepMatch.encode(v, writer.uint32(10).fork()).join();
1284
+ }
1285
+ for (const v of message.files) {
1286
+ writer.uint32(18).string(v);
1287
+ }
1288
+ for (const v of message.counts) {
1289
+ GrepFileCount.encode(v, writer.uint32(26).fork()).join();
1290
+ }
1291
+ return writer;
1292
+ },
1293
+ decode(input, length) {
1294
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1295
+ const end = length === undefined ? reader.len : reader.pos + length;
1296
+ const message = createBaseGrepResponse();
1297
+ while (reader.pos < end) {
1298
+ const tag = reader.uint32();
1299
+ switch (tag >>> 3) {
1300
+ case 1: {
1301
+ if (tag !== 10) {
1302
+ break;
1303
+ }
1304
+ message.matches.push(GrepMatch.decode(reader, reader.uint32()));
1305
+ continue;
1306
+ }
1307
+ case 2: {
1308
+ if (tag !== 18) {
1309
+ break;
1310
+ }
1311
+ message.files.push(reader.string());
1312
+ continue;
1313
+ }
1314
+ case 3: {
1315
+ if (tag !== 26) {
1316
+ break;
1317
+ }
1318
+ message.counts.push(GrepFileCount.decode(reader, reader.uint32()));
1319
+ continue;
1320
+ }
1321
+ }
1322
+ if ((tag & 7) === 4 || tag === 0) {
1323
+ break;
1324
+ }
1325
+ reader.skip(tag & 7);
1326
+ }
1327
+ return message;
1328
+ },
1329
+ fromJSON(object) {
1330
+ return {
1331
+ matches: globalThis.Array.isArray(object?.matches) ? object.matches.map((e) => GrepMatch.fromJSON(e)) : [],
1332
+ files: globalThis.Array.isArray(object?.files) ? object.files.map((e) => globalThis.String(e)) : [],
1333
+ counts: globalThis.Array.isArray(object?.counts) ? object.counts.map((e) => GrepFileCount.fromJSON(e)) : [],
1334
+ };
1335
+ },
1336
+ toJSON(message) {
1337
+ const obj = {};
1338
+ if (message.matches?.length) {
1339
+ obj.matches = message.matches.map((e) => GrepMatch.toJSON(e));
1340
+ }
1341
+ if (message.files?.length) {
1342
+ obj.files = message.files;
1343
+ }
1344
+ if (message.counts?.length) {
1345
+ obj.counts = message.counts.map((e) => GrepFileCount.toJSON(e));
1346
+ }
1347
+ return obj;
1348
+ },
1349
+ create(base) {
1350
+ return GrepResponse.fromPartial(base ?? {});
1351
+ },
1352
+ fromPartial(object) {
1353
+ const message = createBaseGrepResponse();
1354
+ message.matches = object.matches?.map((e) => GrepMatch.fromPartial(e)) || [];
1355
+ message.files = object.files?.map((e) => e) || [];
1356
+ message.counts = object.counts?.map((e) => GrepFileCount.fromPartial(e)) || [];
1357
+ return message;
1358
+ },
1359
+ };
1360
+ function createBaseFindRequest() {
1361
+ return { pattern: "", path: undefined, limit: undefined };
1362
+ }
1363
+ export const FindRequest = {
1364
+ encode(message, writer = new BinaryWriter()) {
1365
+ if (message.pattern !== "") {
1366
+ writer.uint32(10).string(message.pattern);
1367
+ }
1368
+ if (message.path !== undefined) {
1369
+ writer.uint32(18).string(message.path);
1370
+ }
1371
+ if (message.limit !== undefined) {
1372
+ writer.uint32(24).uint64(message.limit);
1373
+ }
1374
+ return writer;
1375
+ },
1376
+ decode(input, length) {
1377
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1378
+ const end = length === undefined ? reader.len : reader.pos + length;
1379
+ const message = createBaseFindRequest();
1380
+ while (reader.pos < end) {
1381
+ const tag = reader.uint32();
1382
+ switch (tag >>> 3) {
1383
+ case 1: {
1384
+ if (tag !== 10) {
1385
+ break;
1386
+ }
1387
+ message.pattern = reader.string();
1388
+ continue;
1389
+ }
1390
+ case 2: {
1391
+ if (tag !== 18) {
1392
+ break;
1393
+ }
1394
+ message.path = reader.string();
1395
+ continue;
1396
+ }
1397
+ case 3: {
1398
+ if (tag !== 24) {
1399
+ break;
1400
+ }
1401
+ message.limit = reader.uint64().toString();
1402
+ continue;
1403
+ }
1404
+ }
1405
+ if ((tag & 7) === 4 || tag === 0) {
1406
+ break;
1407
+ }
1408
+ reader.skip(tag & 7);
1409
+ }
1410
+ return message;
1411
+ },
1412
+ fromJSON(object) {
1413
+ return {
1414
+ pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "",
1415
+ path: isSet(object.path) ? globalThis.String(object.path) : undefined,
1416
+ limit: isSet(object.limit) ? globalThis.String(object.limit) : undefined,
1417
+ };
1418
+ },
1419
+ toJSON(message) {
1420
+ const obj = {};
1421
+ if (message.pattern !== "") {
1422
+ obj.pattern = message.pattern;
1423
+ }
1424
+ if (message.path !== undefined) {
1425
+ obj.path = message.path;
1426
+ }
1427
+ if (message.limit !== undefined) {
1428
+ obj.limit = message.limit;
1429
+ }
1430
+ return obj;
1431
+ },
1432
+ create(base) {
1433
+ return FindRequest.fromPartial(base ?? {});
1434
+ },
1435
+ fromPartial(object) {
1436
+ const message = createBaseFindRequest();
1437
+ message.pattern = object.pattern ?? "";
1438
+ message.path = object.path ?? undefined;
1439
+ message.limit = object.limit ?? undefined;
1440
+ return message;
1441
+ },
1442
+ };
1443
+ function createBaseFindResponse() {
1444
+ return { paths: [] };
1445
+ }
1446
+ export const FindResponse = {
1447
+ encode(message, writer = new BinaryWriter()) {
1448
+ for (const v of message.paths) {
1449
+ writer.uint32(10).string(v);
1450
+ }
1451
+ return writer;
1452
+ },
1453
+ decode(input, length) {
1454
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1455
+ const end = length === undefined ? reader.len : reader.pos + length;
1456
+ const message = createBaseFindResponse();
1457
+ while (reader.pos < end) {
1458
+ const tag = reader.uint32();
1459
+ switch (tag >>> 3) {
1460
+ case 1: {
1461
+ if (tag !== 10) {
1462
+ break;
1463
+ }
1464
+ message.paths.push(reader.string());
1465
+ continue;
1466
+ }
1467
+ }
1468
+ if ((tag & 7) === 4 || tag === 0) {
1469
+ break;
1470
+ }
1471
+ reader.skip(tag & 7);
1472
+ }
1473
+ return message;
1474
+ },
1475
+ fromJSON(object) {
1476
+ return { paths: globalThis.Array.isArray(object?.paths) ? object.paths.map((e) => globalThis.String(e)) : [] };
1477
+ },
1478
+ toJSON(message) {
1479
+ const obj = {};
1480
+ if (message.paths?.length) {
1481
+ obj.paths = message.paths;
1482
+ }
1483
+ return obj;
1484
+ },
1485
+ create(base) {
1486
+ return FindResponse.fromPartial(base ?? {});
1487
+ },
1488
+ fromPartial(object) {
1489
+ const message = createBaseFindResponse();
1490
+ message.paths = object.paths?.map((e) => e) || [];
1491
+ return message;
1492
+ },
1493
+ };
1494
+ function createBaseMemorySaveRequest() {
1495
+ return { name: "", content: "", description: undefined, memoryType: undefined };
1496
+ }
1497
+ export const MemorySaveRequest = {
1498
+ encode(message, writer = new BinaryWriter()) {
1499
+ if (message.name !== "") {
1500
+ writer.uint32(10).string(message.name);
1501
+ }
1502
+ if (message.content !== "") {
1503
+ writer.uint32(18).string(message.content);
1504
+ }
1505
+ if (message.description !== undefined) {
1506
+ writer.uint32(26).string(message.description);
1507
+ }
1508
+ if (message.memoryType !== undefined) {
1509
+ writer.uint32(34).string(message.memoryType);
1510
+ }
1511
+ return writer;
1512
+ },
1513
+ decode(input, length) {
1514
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1515
+ const end = length === undefined ? reader.len : reader.pos + length;
1516
+ const message = createBaseMemorySaveRequest();
1517
+ while (reader.pos < end) {
1518
+ const tag = reader.uint32();
1519
+ switch (tag >>> 3) {
1520
+ case 1: {
1521
+ if (tag !== 10) {
1522
+ break;
1523
+ }
1524
+ message.name = reader.string();
1525
+ continue;
1526
+ }
1527
+ case 2: {
1528
+ if (tag !== 18) {
1529
+ break;
1530
+ }
1531
+ message.content = reader.string();
1532
+ continue;
1533
+ }
1534
+ case 3: {
1535
+ if (tag !== 26) {
1536
+ break;
1537
+ }
1538
+ message.description = reader.string();
1539
+ continue;
1540
+ }
1541
+ case 4: {
1542
+ if (tag !== 34) {
1543
+ break;
1544
+ }
1545
+ message.memoryType = reader.string();
1546
+ continue;
1547
+ }
1548
+ }
1549
+ if ((tag & 7) === 4 || tag === 0) {
1550
+ break;
1551
+ }
1552
+ reader.skip(tag & 7);
1553
+ }
1554
+ return message;
1555
+ },
1556
+ fromJSON(object) {
1557
+ return {
1558
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
1559
+ content: isSet(object.content) ? globalThis.String(object.content) : "",
1560
+ description: isSet(object.description) ? globalThis.String(object.description) : undefined,
1561
+ memoryType: isSet(object.memoryType)
1562
+ ? globalThis.String(object.memoryType)
1563
+ : isSet(object.memory_type)
1564
+ ? globalThis.String(object.memory_type)
1565
+ : undefined,
1566
+ };
1567
+ },
1568
+ toJSON(message) {
1569
+ const obj = {};
1570
+ if (message.name !== "") {
1571
+ obj.name = message.name;
1572
+ }
1573
+ if (message.content !== "") {
1574
+ obj.content = message.content;
1575
+ }
1576
+ if (message.description !== undefined) {
1577
+ obj.description = message.description;
1578
+ }
1579
+ if (message.memoryType !== undefined) {
1580
+ obj.memoryType = message.memoryType;
1581
+ }
1582
+ return obj;
1583
+ },
1584
+ create(base) {
1585
+ return MemorySaveRequest.fromPartial(base ?? {});
1586
+ },
1587
+ fromPartial(object) {
1588
+ const message = createBaseMemorySaveRequest();
1589
+ message.name = object.name ?? "";
1590
+ message.content = object.content ?? "";
1591
+ message.description = object.description ?? undefined;
1592
+ message.memoryType = object.memoryType ?? undefined;
1593
+ return message;
1594
+ },
1595
+ };
1596
+ function createBaseMemorySaveResponse() {
1597
+ return { name: "", path: "" };
1598
+ }
1599
+ export const MemorySaveResponse = {
1600
+ encode(message, writer = new BinaryWriter()) {
1601
+ if (message.name !== "") {
1602
+ writer.uint32(10).string(message.name);
1603
+ }
1604
+ if (message.path !== "") {
1605
+ writer.uint32(18).string(message.path);
1606
+ }
1607
+ return writer;
1608
+ },
1609
+ decode(input, length) {
1610
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1611
+ const end = length === undefined ? reader.len : reader.pos + length;
1612
+ const message = createBaseMemorySaveResponse();
1613
+ while (reader.pos < end) {
1614
+ const tag = reader.uint32();
1615
+ switch (tag >>> 3) {
1616
+ case 1: {
1617
+ if (tag !== 10) {
1618
+ break;
1619
+ }
1620
+ message.name = reader.string();
1621
+ continue;
1622
+ }
1623
+ case 2: {
1624
+ if (tag !== 18) {
1625
+ break;
1626
+ }
1627
+ message.path = reader.string();
1628
+ continue;
1629
+ }
1630
+ }
1631
+ if ((tag & 7) === 4 || tag === 0) {
1632
+ break;
1633
+ }
1634
+ reader.skip(tag & 7);
1635
+ }
1636
+ return message;
1637
+ },
1638
+ fromJSON(object) {
1639
+ return {
1640
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
1641
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
1642
+ };
1643
+ },
1644
+ toJSON(message) {
1645
+ const obj = {};
1646
+ if (message.name !== "") {
1647
+ obj.name = message.name;
1648
+ }
1649
+ if (message.path !== "") {
1650
+ obj.path = message.path;
1651
+ }
1652
+ return obj;
1653
+ },
1654
+ create(base) {
1655
+ return MemorySaveResponse.fromPartial(base ?? {});
1656
+ },
1657
+ fromPartial(object) {
1658
+ const message = createBaseMemorySaveResponse();
1659
+ message.name = object.name ?? "";
1660
+ message.path = object.path ?? "";
1661
+ return message;
1662
+ },
1663
+ };
1664
+ function createBaseMemoryListRequest() {
1665
+ return {};
1666
+ }
1667
+ export const MemoryListRequest = {
1668
+ encode(_, writer = new BinaryWriter()) {
1669
+ return writer;
1670
+ },
1671
+ decode(input, length) {
1672
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1673
+ const end = length === undefined ? reader.len : reader.pos + length;
1674
+ const message = createBaseMemoryListRequest();
1675
+ while (reader.pos < end) {
1676
+ const tag = reader.uint32();
1677
+ switch (tag >>> 3) {
1678
+ }
1679
+ if ((tag & 7) === 4 || tag === 0) {
1680
+ break;
1681
+ }
1682
+ reader.skip(tag & 7);
1683
+ }
1684
+ return message;
1685
+ },
1686
+ fromJSON(_) {
1687
+ return {};
1688
+ },
1689
+ toJSON(_) {
1690
+ const obj = {};
1691
+ return obj;
1692
+ },
1693
+ create(base) {
1694
+ return MemoryListRequest.fromPartial(base ?? {});
1695
+ },
1696
+ fromPartial(_) {
1697
+ const message = createBaseMemoryListRequest();
1698
+ return message;
1699
+ },
1700
+ };
1701
+ function createBaseMemoryEntry() {
1702
+ return { name: "", description: undefined, memoryType: undefined, path: "" };
1703
+ }
1704
+ export const MemoryEntry = {
1705
+ encode(message, writer = new BinaryWriter()) {
1706
+ if (message.name !== "") {
1707
+ writer.uint32(10).string(message.name);
1708
+ }
1709
+ if (message.description !== undefined) {
1710
+ writer.uint32(18).string(message.description);
1711
+ }
1712
+ if (message.memoryType !== undefined) {
1713
+ writer.uint32(26).string(message.memoryType);
1714
+ }
1715
+ if (message.path !== "") {
1716
+ writer.uint32(34).string(message.path);
1717
+ }
1718
+ return writer;
1719
+ },
1720
+ decode(input, length) {
1721
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1722
+ const end = length === undefined ? reader.len : reader.pos + length;
1723
+ const message = createBaseMemoryEntry();
1724
+ while (reader.pos < end) {
1725
+ const tag = reader.uint32();
1726
+ switch (tag >>> 3) {
1727
+ case 1: {
1728
+ if (tag !== 10) {
1729
+ break;
1730
+ }
1731
+ message.name = reader.string();
1732
+ continue;
1733
+ }
1734
+ case 2: {
1735
+ if (tag !== 18) {
1736
+ break;
1737
+ }
1738
+ message.description = reader.string();
1739
+ continue;
1740
+ }
1741
+ case 3: {
1742
+ if (tag !== 26) {
1743
+ break;
1744
+ }
1745
+ message.memoryType = reader.string();
1746
+ continue;
1747
+ }
1748
+ case 4: {
1749
+ if (tag !== 34) {
1750
+ break;
1751
+ }
1752
+ message.path = reader.string();
1753
+ continue;
1754
+ }
1755
+ }
1756
+ if ((tag & 7) === 4 || tag === 0) {
1757
+ break;
1758
+ }
1759
+ reader.skip(tag & 7);
1760
+ }
1761
+ return message;
1762
+ },
1763
+ fromJSON(object) {
1764
+ return {
1765
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
1766
+ description: isSet(object.description) ? globalThis.String(object.description) : undefined,
1767
+ memoryType: isSet(object.memoryType)
1768
+ ? globalThis.String(object.memoryType)
1769
+ : isSet(object.memory_type)
1770
+ ? globalThis.String(object.memory_type)
1771
+ : undefined,
1772
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
1773
+ };
1774
+ },
1775
+ toJSON(message) {
1776
+ const obj = {};
1777
+ if (message.name !== "") {
1778
+ obj.name = message.name;
1779
+ }
1780
+ if (message.description !== undefined) {
1781
+ obj.description = message.description;
1782
+ }
1783
+ if (message.memoryType !== undefined) {
1784
+ obj.memoryType = message.memoryType;
1785
+ }
1786
+ if (message.path !== "") {
1787
+ obj.path = message.path;
1788
+ }
1789
+ return obj;
1790
+ },
1791
+ create(base) {
1792
+ return MemoryEntry.fromPartial(base ?? {});
1793
+ },
1794
+ fromPartial(object) {
1795
+ const message = createBaseMemoryEntry();
1796
+ message.name = object.name ?? "";
1797
+ message.description = object.description ?? undefined;
1798
+ message.memoryType = object.memoryType ?? undefined;
1799
+ message.path = object.path ?? "";
1800
+ return message;
1801
+ },
1802
+ };
1803
+ function createBaseMemoryListResponse() {
1804
+ return { entries: [] };
1805
+ }
1806
+ export const MemoryListResponse = {
1807
+ encode(message, writer = new BinaryWriter()) {
1808
+ for (const v of message.entries) {
1809
+ MemoryEntry.encode(v, writer.uint32(10).fork()).join();
1810
+ }
1811
+ return writer;
1812
+ },
1813
+ decode(input, length) {
1814
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1815
+ const end = length === undefined ? reader.len : reader.pos + length;
1816
+ const message = createBaseMemoryListResponse();
1817
+ while (reader.pos < end) {
1818
+ const tag = reader.uint32();
1819
+ switch (tag >>> 3) {
1820
+ case 1: {
1821
+ if (tag !== 10) {
1822
+ break;
1823
+ }
1824
+ message.entries.push(MemoryEntry.decode(reader, reader.uint32()));
1825
+ continue;
1826
+ }
1827
+ }
1828
+ if ((tag & 7) === 4 || tag === 0) {
1829
+ break;
1830
+ }
1831
+ reader.skip(tag & 7);
1832
+ }
1833
+ return message;
1834
+ },
1835
+ fromJSON(object) {
1836
+ return {
1837
+ entries: globalThis.Array.isArray(object?.entries) ? object.entries.map((e) => MemoryEntry.fromJSON(e)) : [],
1838
+ };
1839
+ },
1840
+ toJSON(message) {
1841
+ const obj = {};
1842
+ if (message.entries?.length) {
1843
+ obj.entries = message.entries.map((e) => MemoryEntry.toJSON(e));
1844
+ }
1845
+ return obj;
1846
+ },
1847
+ create(base) {
1848
+ return MemoryListResponse.fromPartial(base ?? {});
1849
+ },
1850
+ fromPartial(object) {
1851
+ const message = createBaseMemoryListResponse();
1852
+ message.entries = object.entries?.map((e) => MemoryEntry.fromPartial(e)) || [];
1853
+ return message;
1854
+ },
1855
+ };
1856
+ function createBaseMemoryReadRequest() {
1857
+ return { name: "" };
1858
+ }
1859
+ export const MemoryReadRequest = {
1860
+ encode(message, writer = new BinaryWriter()) {
1861
+ if (message.name !== "") {
1862
+ writer.uint32(10).string(message.name);
1863
+ }
1864
+ return writer;
1865
+ },
1866
+ decode(input, length) {
1867
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1868
+ const end = length === undefined ? reader.len : reader.pos + length;
1869
+ const message = createBaseMemoryReadRequest();
1870
+ while (reader.pos < end) {
1871
+ const tag = reader.uint32();
1872
+ switch (tag >>> 3) {
1873
+ case 1: {
1874
+ if (tag !== 10) {
1875
+ break;
1876
+ }
1877
+ message.name = reader.string();
1878
+ continue;
1879
+ }
1880
+ }
1881
+ if ((tag & 7) === 4 || tag === 0) {
1882
+ break;
1883
+ }
1884
+ reader.skip(tag & 7);
1885
+ }
1886
+ return message;
1887
+ },
1888
+ fromJSON(object) {
1889
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
1890
+ },
1891
+ toJSON(message) {
1892
+ const obj = {};
1893
+ if (message.name !== "") {
1894
+ obj.name = message.name;
1895
+ }
1896
+ return obj;
1897
+ },
1898
+ create(base) {
1899
+ return MemoryReadRequest.fromPartial(base ?? {});
1900
+ },
1901
+ fromPartial(object) {
1902
+ const message = createBaseMemoryReadRequest();
1903
+ message.name = object.name ?? "";
1904
+ return message;
1905
+ },
1906
+ };
1907
+ function createBaseMemoryReadResponse() {
1908
+ return { name: "", content: "" };
1909
+ }
1910
+ export const MemoryReadResponse = {
1911
+ encode(message, writer = new BinaryWriter()) {
1912
+ if (message.name !== "") {
1913
+ writer.uint32(10).string(message.name);
1914
+ }
1915
+ if (message.content !== "") {
1916
+ writer.uint32(18).string(message.content);
1917
+ }
1918
+ return writer;
1919
+ },
1920
+ decode(input, length) {
1921
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1922
+ const end = length === undefined ? reader.len : reader.pos + length;
1923
+ const message = createBaseMemoryReadResponse();
1924
+ while (reader.pos < end) {
1925
+ const tag = reader.uint32();
1926
+ switch (tag >>> 3) {
1927
+ case 1: {
1928
+ if (tag !== 10) {
1929
+ break;
1930
+ }
1931
+ message.name = reader.string();
1932
+ continue;
1933
+ }
1934
+ case 2: {
1935
+ if (tag !== 18) {
1936
+ break;
1937
+ }
1938
+ message.content = reader.string();
1939
+ continue;
1940
+ }
1941
+ }
1942
+ if ((tag & 7) === 4 || tag === 0) {
1943
+ break;
1944
+ }
1945
+ reader.skip(tag & 7);
1946
+ }
1947
+ return message;
1948
+ },
1949
+ fromJSON(object) {
1950
+ return {
1951
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
1952
+ content: isSet(object.content) ? globalThis.String(object.content) : "",
1953
+ };
1954
+ },
1955
+ toJSON(message) {
1956
+ const obj = {};
1957
+ if (message.name !== "") {
1958
+ obj.name = message.name;
1959
+ }
1960
+ if (message.content !== "") {
1961
+ obj.content = message.content;
1962
+ }
1963
+ return obj;
1964
+ },
1965
+ create(base) {
1966
+ return MemoryReadResponse.fromPartial(base ?? {});
1967
+ },
1968
+ fromPartial(object) {
1969
+ const message = createBaseMemoryReadResponse();
1970
+ message.name = object.name ?? "";
1971
+ message.content = object.content ?? "";
1972
+ return message;
1973
+ },
1974
+ };
1975
+ function createBaseMemoryForgetRequest() {
1976
+ return { name: "" };
1977
+ }
1978
+ export const MemoryForgetRequest = {
1979
+ encode(message, writer = new BinaryWriter()) {
1980
+ if (message.name !== "") {
1981
+ writer.uint32(10).string(message.name);
1982
+ }
1983
+ return writer;
1984
+ },
1985
+ decode(input, length) {
1986
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1987
+ const end = length === undefined ? reader.len : reader.pos + length;
1988
+ const message = createBaseMemoryForgetRequest();
1989
+ while (reader.pos < end) {
1990
+ const tag = reader.uint32();
1991
+ switch (tag >>> 3) {
1992
+ case 1: {
1993
+ if (tag !== 10) {
1994
+ break;
1995
+ }
1996
+ message.name = reader.string();
1997
+ continue;
1998
+ }
1999
+ }
2000
+ if ((tag & 7) === 4 || tag === 0) {
2001
+ break;
2002
+ }
2003
+ reader.skip(tag & 7);
2004
+ }
2005
+ return message;
2006
+ },
2007
+ fromJSON(object) {
2008
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
2009
+ },
2010
+ toJSON(message) {
2011
+ const obj = {};
2012
+ if (message.name !== "") {
2013
+ obj.name = message.name;
2014
+ }
2015
+ return obj;
2016
+ },
2017
+ create(base) {
2018
+ return MemoryForgetRequest.fromPartial(base ?? {});
2019
+ },
2020
+ fromPartial(object) {
2021
+ const message = createBaseMemoryForgetRequest();
2022
+ message.name = object.name ?? "";
2023
+ return message;
2024
+ },
2025
+ };
2026
+ function createBaseMemoryForgetResponse() {
2027
+ return { removed: false };
2028
+ }
2029
+ export const MemoryForgetResponse = {
2030
+ encode(message, writer = new BinaryWriter()) {
2031
+ if (message.removed !== false) {
2032
+ writer.uint32(8).bool(message.removed);
2033
+ }
2034
+ return writer;
2035
+ },
2036
+ decode(input, length) {
2037
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2038
+ const end = length === undefined ? reader.len : reader.pos + length;
2039
+ const message = createBaseMemoryForgetResponse();
2040
+ while (reader.pos < end) {
2041
+ const tag = reader.uint32();
2042
+ switch (tag >>> 3) {
2043
+ case 1: {
2044
+ if (tag !== 8) {
2045
+ break;
2046
+ }
2047
+ message.removed = reader.bool();
2048
+ continue;
2049
+ }
2050
+ }
2051
+ if ((tag & 7) === 4 || tag === 0) {
2052
+ break;
2053
+ }
2054
+ reader.skip(tag & 7);
2055
+ }
2056
+ return message;
2057
+ },
2058
+ fromJSON(object) {
2059
+ return { removed: isSet(object.removed) ? globalThis.Boolean(object.removed) : false };
2060
+ },
2061
+ toJSON(message) {
2062
+ const obj = {};
2063
+ if (message.removed !== false) {
2064
+ obj.removed = message.removed;
2065
+ }
2066
+ return obj;
2067
+ },
2068
+ create(base) {
2069
+ return MemoryForgetResponse.fromPartial(base ?? {});
2070
+ },
2071
+ fromPartial(object) {
2072
+ const message = createBaseMemoryForgetResponse();
2073
+ message.removed = object.removed ?? false;
2074
+ return message;
2075
+ },
2076
+ };
2077
+ function createBaseSkillInstallRequest() {
2078
+ return { source: undefined, confirm: false, overwrite: false };
2079
+ }
2080
+ export const SkillInstallRequest = {
2081
+ encode(message, writer = new BinaryWriter()) {
2082
+ switch (message.source?.$case) {
2083
+ case "url":
2084
+ writer.uint32(10).string(message.source.url);
2085
+ break;
2086
+ case "path":
2087
+ writer.uint32(18).string(message.source.path);
2088
+ break;
2089
+ case "content":
2090
+ writer.uint32(26).string(message.source.content);
2091
+ break;
2092
+ }
2093
+ if (message.confirm !== false) {
2094
+ writer.uint32(32).bool(message.confirm);
2095
+ }
2096
+ if (message.overwrite !== false) {
2097
+ writer.uint32(40).bool(message.overwrite);
2098
+ }
2099
+ return writer;
2100
+ },
2101
+ decode(input, length) {
2102
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2103
+ const end = length === undefined ? reader.len : reader.pos + length;
2104
+ const message = createBaseSkillInstallRequest();
2105
+ while (reader.pos < end) {
2106
+ const tag = reader.uint32();
2107
+ switch (tag >>> 3) {
2108
+ case 1: {
2109
+ if (tag !== 10) {
2110
+ break;
2111
+ }
2112
+ message.source = { $case: "url", url: reader.string() };
2113
+ continue;
2114
+ }
2115
+ case 2: {
2116
+ if (tag !== 18) {
2117
+ break;
2118
+ }
2119
+ message.source = { $case: "path", path: reader.string() };
2120
+ continue;
2121
+ }
2122
+ case 3: {
2123
+ if (tag !== 26) {
2124
+ break;
2125
+ }
2126
+ message.source = { $case: "content", content: reader.string() };
2127
+ continue;
2128
+ }
2129
+ case 4: {
2130
+ if (tag !== 32) {
2131
+ break;
2132
+ }
2133
+ message.confirm = reader.bool();
2134
+ continue;
2135
+ }
2136
+ case 5: {
2137
+ if (tag !== 40) {
2138
+ break;
2139
+ }
2140
+ message.overwrite = reader.bool();
2141
+ continue;
2142
+ }
2143
+ }
2144
+ if ((tag & 7) === 4 || tag === 0) {
2145
+ break;
2146
+ }
2147
+ reader.skip(tag & 7);
2148
+ }
2149
+ return message;
2150
+ },
2151
+ fromJSON(object) {
2152
+ return {
2153
+ source: isSet(object.url)
2154
+ ? { $case: "url", url: globalThis.String(object.url) }
2155
+ : isSet(object.path)
2156
+ ? { $case: "path", path: globalThis.String(object.path) }
2157
+ : isSet(object.content)
2158
+ ? { $case: "content", content: globalThis.String(object.content) }
2159
+ : undefined,
2160
+ confirm: isSet(object.confirm) ? globalThis.Boolean(object.confirm) : false,
2161
+ overwrite: isSet(object.overwrite) ? globalThis.Boolean(object.overwrite) : false,
2162
+ };
2163
+ },
2164
+ toJSON(message) {
2165
+ const obj = {};
2166
+ if (message.source?.$case === "url") {
2167
+ obj.url = message.source.url;
2168
+ }
2169
+ else if (message.source?.$case === "path") {
2170
+ obj.path = message.source.path;
2171
+ }
2172
+ else if (message.source?.$case === "content") {
2173
+ obj.content = message.source.content;
2174
+ }
2175
+ if (message.confirm !== false) {
2176
+ obj.confirm = message.confirm;
2177
+ }
2178
+ if (message.overwrite !== false) {
2179
+ obj.overwrite = message.overwrite;
2180
+ }
2181
+ return obj;
2182
+ },
2183
+ create(base) {
2184
+ return SkillInstallRequest.fromPartial(base ?? {});
2185
+ },
2186
+ fromPartial(object) {
2187
+ const message = createBaseSkillInstallRequest();
2188
+ switch (object.source?.$case) {
2189
+ case "url": {
2190
+ if (object.source?.url !== undefined && object.source?.url !== null) {
2191
+ message.source = { $case: "url", url: object.source.url };
2192
+ }
2193
+ break;
2194
+ }
2195
+ case "path": {
2196
+ if (object.source?.path !== undefined && object.source?.path !== null) {
2197
+ message.source = { $case: "path", path: object.source.path };
2198
+ }
2199
+ break;
2200
+ }
2201
+ case "content": {
2202
+ if (object.source?.content !== undefined && object.source?.content !== null) {
2203
+ message.source = { $case: "content", content: object.source.content };
2204
+ }
2205
+ break;
2206
+ }
2207
+ }
2208
+ message.confirm = object.confirm ?? false;
2209
+ message.overwrite = object.overwrite ?? false;
2210
+ return message;
2211
+ },
2212
+ };
2213
+ function createBaseSkillInstallResponse() {
2214
+ return {
2215
+ name: "",
2216
+ targetPath: "",
2217
+ installed: false,
2218
+ contentHash: undefined,
2219
+ size: "0",
2220
+ existing: false,
2221
+ warning: undefined,
2222
+ };
2223
+ }
2224
+ export const SkillInstallResponse = {
2225
+ encode(message, writer = new BinaryWriter()) {
2226
+ if (message.name !== "") {
2227
+ writer.uint32(10).string(message.name);
2228
+ }
2229
+ if (message.targetPath !== "") {
2230
+ writer.uint32(18).string(message.targetPath);
2231
+ }
2232
+ if (message.installed !== false) {
2233
+ writer.uint32(24).bool(message.installed);
2234
+ }
2235
+ if (message.contentHash !== undefined) {
2236
+ writer.uint32(34).string(message.contentHash);
2237
+ }
2238
+ if (message.size !== "0") {
2239
+ writer.uint32(40).uint64(message.size);
2240
+ }
2241
+ if (message.existing !== false) {
2242
+ writer.uint32(48).bool(message.existing);
2243
+ }
2244
+ if (message.warning !== undefined) {
2245
+ writer.uint32(58).string(message.warning);
2246
+ }
2247
+ return writer;
2248
+ },
2249
+ decode(input, length) {
2250
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2251
+ const end = length === undefined ? reader.len : reader.pos + length;
2252
+ const message = createBaseSkillInstallResponse();
2253
+ while (reader.pos < end) {
2254
+ const tag = reader.uint32();
2255
+ switch (tag >>> 3) {
2256
+ case 1: {
2257
+ if (tag !== 10) {
2258
+ break;
2259
+ }
2260
+ message.name = reader.string();
2261
+ continue;
2262
+ }
2263
+ case 2: {
2264
+ if (tag !== 18) {
2265
+ break;
2266
+ }
2267
+ message.targetPath = reader.string();
2268
+ continue;
2269
+ }
2270
+ case 3: {
2271
+ if (tag !== 24) {
2272
+ break;
2273
+ }
2274
+ message.installed = reader.bool();
2275
+ continue;
2276
+ }
2277
+ case 4: {
2278
+ if (tag !== 34) {
2279
+ break;
2280
+ }
2281
+ message.contentHash = reader.string();
2282
+ continue;
2283
+ }
2284
+ case 5: {
2285
+ if (tag !== 40) {
2286
+ break;
2287
+ }
2288
+ message.size = reader.uint64().toString();
2289
+ continue;
2290
+ }
2291
+ case 6: {
2292
+ if (tag !== 48) {
2293
+ break;
2294
+ }
2295
+ message.existing = reader.bool();
2296
+ continue;
2297
+ }
2298
+ case 7: {
2299
+ if (tag !== 58) {
2300
+ break;
2301
+ }
2302
+ message.warning = reader.string();
2303
+ continue;
2304
+ }
2305
+ }
2306
+ if ((tag & 7) === 4 || tag === 0) {
2307
+ break;
2308
+ }
2309
+ reader.skip(tag & 7);
2310
+ }
2311
+ return message;
2312
+ },
2313
+ fromJSON(object) {
2314
+ return {
2315
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
2316
+ targetPath: isSet(object.targetPath)
2317
+ ? globalThis.String(object.targetPath)
2318
+ : isSet(object.target_path)
2319
+ ? globalThis.String(object.target_path)
2320
+ : "",
2321
+ installed: isSet(object.installed) ? globalThis.Boolean(object.installed) : false,
2322
+ contentHash: isSet(object.contentHash)
2323
+ ? globalThis.String(object.contentHash)
2324
+ : isSet(object.content_hash)
2325
+ ? globalThis.String(object.content_hash)
2326
+ : undefined,
2327
+ size: isSet(object.size) ? globalThis.String(object.size) : "0",
2328
+ existing: isSet(object.existing) ? globalThis.Boolean(object.existing) : false,
2329
+ warning: isSet(object.warning) ? globalThis.String(object.warning) : undefined,
2330
+ };
2331
+ },
2332
+ toJSON(message) {
2333
+ const obj = {};
2334
+ if (message.name !== "") {
2335
+ obj.name = message.name;
2336
+ }
2337
+ if (message.targetPath !== "") {
2338
+ obj.targetPath = message.targetPath;
2339
+ }
2340
+ if (message.installed !== false) {
2341
+ obj.installed = message.installed;
2342
+ }
2343
+ if (message.contentHash !== undefined) {
2344
+ obj.contentHash = message.contentHash;
2345
+ }
2346
+ if (message.size !== "0") {
2347
+ obj.size = message.size;
2348
+ }
2349
+ if (message.existing !== false) {
2350
+ obj.existing = message.existing;
2351
+ }
2352
+ if (message.warning !== undefined) {
2353
+ obj.warning = message.warning;
2354
+ }
2355
+ return obj;
2356
+ },
2357
+ create(base) {
2358
+ return SkillInstallResponse.fromPartial(base ?? {});
2359
+ },
2360
+ fromPartial(object) {
2361
+ const message = createBaseSkillInstallResponse();
2362
+ message.name = object.name ?? "";
2363
+ message.targetPath = object.targetPath ?? "";
2364
+ message.installed = object.installed ?? false;
2365
+ message.contentHash = object.contentHash ?? undefined;
2366
+ message.size = object.size ?? "0";
2367
+ message.existing = object.existing ?? false;
2368
+ message.warning = object.warning ?? undefined;
2369
+ return message;
2370
+ },
2371
+ };
2372
+ export const ToolServiceService = {
2373
+ readFile: {
2374
+ path: "/theway.grpc.v1.ToolService/ReadFile",
2375
+ requestStream: false,
2376
+ responseStream: false,
2377
+ requestSerialize: (value) => Buffer.from(ReadFileRequest.encode(value).finish()),
2378
+ requestDeserialize: (value) => ReadFileRequest.decode(value),
2379
+ responseSerialize: (value) => Buffer.from(ReadFileResponse.encode(value).finish()),
2380
+ responseDeserialize: (value) => ReadFileResponse.decode(value),
2381
+ },
2382
+ writeFile: {
2383
+ path: "/theway.grpc.v1.ToolService/WriteFile",
2384
+ requestStream: false,
2385
+ responseStream: false,
2386
+ requestSerialize: (value) => Buffer.from(WriteFileRequest.encode(value).finish()),
2387
+ requestDeserialize: (value) => WriteFileRequest.decode(value),
2388
+ responseSerialize: (value) => Buffer.from(WriteFileResponse.encode(value).finish()),
2389
+ responseDeserialize: (value) => WriteFileResponse.decode(value),
2390
+ },
2391
+ editFile: {
2392
+ path: "/theway.grpc.v1.ToolService/EditFile",
2393
+ requestStream: false,
2394
+ responseStream: false,
2395
+ requestSerialize: (value) => Buffer.from(EditFileRequest.encode(value).finish()),
2396
+ requestDeserialize: (value) => EditFileRequest.decode(value),
2397
+ responseSerialize: (value) => Buffer.from(EditFileResponse.encode(value).finish()),
2398
+ responseDeserialize: (value) => EditFileResponse.decode(value),
2399
+ },
2400
+ /** Streaming output: zero or more output chunks, then the exit frame. */
2401
+ execCommand: {
2402
+ path: "/theway.grpc.v1.ToolService/ExecCommand",
2403
+ requestStream: false,
2404
+ responseStream: true,
2405
+ requestSerialize: (value) => Buffer.from(ExecCommandRequest.encode(value).finish()),
2406
+ requestDeserialize: (value) => ExecCommandRequest.decode(value),
2407
+ responseSerialize: (value) => Buffer.from(ExecOutputFrame.encode(value).finish()),
2408
+ responseDeserialize: (value) => ExecOutputFrame.decode(value),
2409
+ },
2410
+ listDir: {
2411
+ path: "/theway.grpc.v1.ToolService/ListDir",
2412
+ requestStream: false,
2413
+ responseStream: false,
2414
+ requestSerialize: (value) => Buffer.from(ListDirRequest.encode(value).finish()),
2415
+ requestDeserialize: (value) => ListDirRequest.decode(value),
2416
+ responseSerialize: (value) => Buffer.from(ListDirResponse.encode(value).finish()),
2417
+ responseDeserialize: (value) => ListDirResponse.decode(value),
2418
+ },
2419
+ grep: {
2420
+ path: "/theway.grpc.v1.ToolService/Grep",
2421
+ requestStream: false,
2422
+ responseStream: false,
2423
+ requestSerialize: (value) => Buffer.from(GrepRequest.encode(value).finish()),
2424
+ requestDeserialize: (value) => GrepRequest.decode(value),
2425
+ responseSerialize: (value) => Buffer.from(GrepResponse.encode(value).finish()),
2426
+ responseDeserialize: (value) => GrepResponse.decode(value),
2427
+ },
2428
+ find: {
2429
+ path: "/theway.grpc.v1.ToolService/Find",
2430
+ requestStream: false,
2431
+ responseStream: false,
2432
+ requestSerialize: (value) => Buffer.from(FindRequest.encode(value).finish()),
2433
+ requestDeserialize: (value) => FindRequest.decode(value),
2434
+ responseSerialize: (value) => Buffer.from(FindResponse.encode(value).finish()),
2435
+ responseDeserialize: (value) => FindResponse.decode(value),
2436
+ },
2437
+ memorySave: {
2438
+ path: "/theway.grpc.v1.ToolService/MemorySave",
2439
+ requestStream: false,
2440
+ responseStream: false,
2441
+ requestSerialize: (value) => Buffer.from(MemorySaveRequest.encode(value).finish()),
2442
+ requestDeserialize: (value) => MemorySaveRequest.decode(value),
2443
+ responseSerialize: (value) => Buffer.from(MemorySaveResponse.encode(value).finish()),
2444
+ responseDeserialize: (value) => MemorySaveResponse.decode(value),
2445
+ },
2446
+ memoryList: {
2447
+ path: "/theway.grpc.v1.ToolService/MemoryList",
2448
+ requestStream: false,
2449
+ responseStream: false,
2450
+ requestSerialize: (value) => Buffer.from(MemoryListRequest.encode(value).finish()),
2451
+ requestDeserialize: (value) => MemoryListRequest.decode(value),
2452
+ responseSerialize: (value) => Buffer.from(MemoryListResponse.encode(value).finish()),
2453
+ responseDeserialize: (value) => MemoryListResponse.decode(value),
2454
+ },
2455
+ memoryRead: {
2456
+ path: "/theway.grpc.v1.ToolService/MemoryRead",
2457
+ requestStream: false,
2458
+ responseStream: false,
2459
+ requestSerialize: (value) => Buffer.from(MemoryReadRequest.encode(value).finish()),
2460
+ requestDeserialize: (value) => MemoryReadRequest.decode(value),
2461
+ responseSerialize: (value) => Buffer.from(MemoryReadResponse.encode(value).finish()),
2462
+ responseDeserialize: (value) => MemoryReadResponse.decode(value),
2463
+ },
2464
+ memoryForget: {
2465
+ path: "/theway.grpc.v1.ToolService/MemoryForget",
2466
+ requestStream: false,
2467
+ responseStream: false,
2468
+ requestSerialize: (value) => Buffer.from(MemoryForgetRequest.encode(value).finish()),
2469
+ requestDeserialize: (value) => MemoryForgetRequest.decode(value),
2470
+ responseSerialize: (value) => Buffer.from(MemoryForgetResponse.encode(value).finish()),
2471
+ responseDeserialize: (value) => MemoryForgetResponse.decode(value),
2472
+ },
2473
+ skillInstall: {
2474
+ path: "/theway.grpc.v1.ToolService/SkillInstall",
2475
+ requestStream: false,
2476
+ responseStream: false,
2477
+ requestSerialize: (value) => Buffer.from(SkillInstallRequest.encode(value).finish()),
2478
+ requestDeserialize: (value) => SkillInstallRequest.decode(value),
2479
+ responseSerialize: (value) => Buffer.from(SkillInstallResponse.encode(value).finish()),
2480
+ responseDeserialize: (value) => SkillInstallResponse.decode(value),
2481
+ },
2482
+ };
2483
+ export const ToolServiceClient = makeGenericClientConstructor(ToolServiceService, "theway.grpc.v1.ToolService");
2484
+ function isSet(value) {
2485
+ return value !== null && value !== undefined;
2486
+ }
2487
+ //# sourceMappingURL=tools.js.map