@miradorlabs/web-grpc 3.8.0 → 3.9.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.
@@ -0,0 +1,1194 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.4
4
+ // protoc v3.21.12
5
+ // source: proto/gateway/web/v1/policy_gateway.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import type { Metadata } from "@grpc/grpc-js";
10
+ import { Timestamp } from "../../../../google/protobuf/timestamp";
11
+ import { ResponseStatus } from "../../common/v1/status";
12
+
13
+ export const protobufPackage = "gateway.web.v1";
14
+
15
+ export enum TermaSignal {
16
+ TERMA_SIGNAL_UNSPECIFIED = 0,
17
+ TERMA_SIGNAL_TRACES = 1,
18
+ TERMA_SIGNAL_LOGS = 2,
19
+ TERMA_SIGNAL_METRICS = 3,
20
+ UNRECOGNIZED = -1,
21
+ }
22
+
23
+ export function termaSignalFromJSON(object: any): TermaSignal {
24
+ switch (object) {
25
+ case 0:
26
+ case "TERMA_SIGNAL_UNSPECIFIED":
27
+ return TermaSignal.TERMA_SIGNAL_UNSPECIFIED;
28
+ case 1:
29
+ case "TERMA_SIGNAL_TRACES":
30
+ return TermaSignal.TERMA_SIGNAL_TRACES;
31
+ case 2:
32
+ case "TERMA_SIGNAL_LOGS":
33
+ return TermaSignal.TERMA_SIGNAL_LOGS;
34
+ case 3:
35
+ case "TERMA_SIGNAL_METRICS":
36
+ return TermaSignal.TERMA_SIGNAL_METRICS;
37
+ case -1:
38
+ case "UNRECOGNIZED":
39
+ default:
40
+ return TermaSignal.UNRECOGNIZED;
41
+ }
42
+ }
43
+
44
+ export function termaSignalToJSON(object: TermaSignal): string {
45
+ switch (object) {
46
+ case TermaSignal.TERMA_SIGNAL_UNSPECIFIED:
47
+ return "TERMA_SIGNAL_UNSPECIFIED";
48
+ case TermaSignal.TERMA_SIGNAL_TRACES:
49
+ return "TERMA_SIGNAL_TRACES";
50
+ case TermaSignal.TERMA_SIGNAL_LOGS:
51
+ return "TERMA_SIGNAL_LOGS";
52
+ case TermaSignal.TERMA_SIGNAL_METRICS:
53
+ return "TERMA_SIGNAL_METRICS";
54
+ case TermaSignal.UNRECOGNIZED:
55
+ default:
56
+ return "UNRECOGNIZED";
57
+ }
58
+ }
59
+
60
+ /** ProjectPolicy holds one arm per product; a project takes only its own product's arm. */
61
+ export interface ProjectPolicy {
62
+ terma?: TermaPolicy | undefined;
63
+ }
64
+
65
+ /** TermaPolicy is a Terma team's policy. */
66
+ export interface TermaPolicy {
67
+ /** every member emits from every repository */
68
+ global?:
69
+ | TermaGlobalCoverage
70
+ | undefined;
71
+ /** members emit only from the repositories they connect */
72
+ perRepository?:
73
+ | TermaPerRepositoryCoverage
74
+ | undefined;
75
+ /** required */
76
+ capture: TermaCapture | undefined;
77
+ }
78
+
79
+ export interface TermaGlobalCoverage {
80
+ /** a member may pause sending for a while */
81
+ membersCanPause: boolean;
82
+ }
83
+
84
+ export interface TermaPerRepositoryCoverage {
85
+ /** a member may opt more repositories in at connect */
86
+ membersCanAddRepositories: boolean;
87
+ }
88
+
89
+ /**
90
+ * TermaCapture is what leaves a member's machine. Capture is the default, so content switches are
91
+ * exclusions.
92
+ */
93
+ export interface TermaCapture {
94
+ /** at least one; the OTLP streams exported */
95
+ signals: TermaSignal[];
96
+ /** prompt text is redacted before it leaves the machine */
97
+ excludePrompts: boolean;
98
+ /** tool inputs and results are redacted */
99
+ excludeToolContent: boolean;
100
+ /** file globs whose content is never sent */
101
+ excludePaths: string[];
102
+ }
103
+
104
+ export interface GetProjectPolicyRequest {
105
+ /** Organization UUID */
106
+ organizationId: string;
107
+ /** Project UUID */
108
+ projectId: string;
109
+ }
110
+
111
+ export interface GetProjectPolicyResponse {
112
+ status:
113
+ | ResponseStatus
114
+ | undefined;
115
+ /** absent when the project has never set a policy */
116
+ policy:
117
+ | ProjectPolicy
118
+ | undefined;
119
+ /** the policy's schema version, "major.minor"; empty with policy absent */
120
+ version: string;
121
+ /** bumped on every save, 1 for the first; 0 with policy absent */
122
+ revision: number;
123
+ /** absent with policy */
124
+ updatedAt: Date | undefined;
125
+ }
126
+
127
+ export interface SetProjectPolicyRequest {
128
+ /** Organization UUID */
129
+ organizationId: string;
130
+ /** Project UUID */
131
+ projectId: string;
132
+ /** required, the whole policy */
133
+ policy: ProjectPolicy | undefined;
134
+ }
135
+
136
+ export interface SetProjectPolicyResponse {
137
+ status:
138
+ | ResponseStatus
139
+ | undefined;
140
+ /** as stored */
141
+ policy: ProjectPolicy | undefined;
142
+ version: string;
143
+ revision: number;
144
+ updatedAt: Date | undefined;
145
+ }
146
+
147
+ function createBaseProjectPolicy(): ProjectPolicy {
148
+ return { terma: undefined };
149
+ }
150
+
151
+ export const ProjectPolicy: MessageFns<ProjectPolicy> = {
152
+ encode(message: ProjectPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
153
+ if (message.terma !== undefined) {
154
+ TermaPolicy.encode(message.terma, writer.uint32(10).fork()).join();
155
+ }
156
+ return writer;
157
+ },
158
+
159
+ decode(input: BinaryReader | Uint8Array, length?: number): ProjectPolicy {
160
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
161
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
162
+ if (previousRecursionDepth >= 100) {
163
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
164
+ }
165
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
166
+ try {
167
+ const end = length === undefined ? reader.len : reader.pos + length;
168
+ const message = createBaseProjectPolicy();
169
+ while (reader.pos < end) {
170
+ const tag = reader.uint32();
171
+ switch (tag >>> 3) {
172
+ case 1: {
173
+ if (tag !== 10) {
174
+ break;
175
+ }
176
+
177
+ message.terma = TermaPolicy.decode(reader, reader.uint32());
178
+ continue;
179
+ }
180
+ }
181
+ if ((tag & 7) === 4 || tag === 0) {
182
+ break;
183
+ }
184
+ reader.skip(tag & 7);
185
+ }
186
+ return message;
187
+ } finally {
188
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
189
+ }
190
+ },
191
+
192
+ fromJSON(object: any): ProjectPolicy {
193
+ return { terma: isSet(object.terma) ? TermaPolicy.fromJSON(object.terma) : undefined };
194
+ },
195
+
196
+ toJSON(message: ProjectPolicy): unknown {
197
+ const obj: any = {};
198
+ if (message.terma !== undefined) {
199
+ obj.terma = TermaPolicy.toJSON(message.terma);
200
+ }
201
+ return obj;
202
+ },
203
+
204
+ create<I extends Exact<DeepPartial<ProjectPolicy>, I>>(base?: I): ProjectPolicy {
205
+ return ProjectPolicy.fromPartial(base ?? ({} as any));
206
+ },
207
+ fromPartial<I extends Exact<DeepPartial<ProjectPolicy>, I>>(object: I): ProjectPolicy {
208
+ const message = createBaseProjectPolicy();
209
+ message.terma = (object.terma !== undefined && object.terma !== null)
210
+ ? TermaPolicy.fromPartial(object.terma)
211
+ : undefined;
212
+ return message;
213
+ },
214
+ };
215
+
216
+ function createBaseTermaPolicy(): TermaPolicy {
217
+ return { global: undefined, perRepository: undefined, capture: undefined };
218
+ }
219
+
220
+ export const TermaPolicy: MessageFns<TermaPolicy> = {
221
+ encode(message: TermaPolicy, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
222
+ if (message.global !== undefined) {
223
+ TermaGlobalCoverage.encode(message.global, writer.uint32(10).fork()).join();
224
+ }
225
+ if (message.perRepository !== undefined) {
226
+ TermaPerRepositoryCoverage.encode(message.perRepository, writer.uint32(18).fork()).join();
227
+ }
228
+ if (message.capture !== undefined) {
229
+ TermaCapture.encode(message.capture, writer.uint32(26).fork()).join();
230
+ }
231
+ return writer;
232
+ },
233
+
234
+ decode(input: BinaryReader | Uint8Array, length?: number): TermaPolicy {
235
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
236
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
237
+ if (previousRecursionDepth >= 100) {
238
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
239
+ }
240
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
241
+ try {
242
+ const end = length === undefined ? reader.len : reader.pos + length;
243
+ const message = createBaseTermaPolicy();
244
+ while (reader.pos < end) {
245
+ const tag = reader.uint32();
246
+ switch (tag >>> 3) {
247
+ case 1: {
248
+ if (tag !== 10) {
249
+ break;
250
+ }
251
+
252
+ message.global = TermaGlobalCoverage.decode(reader, reader.uint32());
253
+ continue;
254
+ }
255
+ case 2: {
256
+ if (tag !== 18) {
257
+ break;
258
+ }
259
+
260
+ message.perRepository = TermaPerRepositoryCoverage.decode(reader, reader.uint32());
261
+ continue;
262
+ }
263
+ case 3: {
264
+ if (tag !== 26) {
265
+ break;
266
+ }
267
+
268
+ message.capture = TermaCapture.decode(reader, reader.uint32());
269
+ continue;
270
+ }
271
+ }
272
+ if ((tag & 7) === 4 || tag === 0) {
273
+ break;
274
+ }
275
+ reader.skip(tag & 7);
276
+ }
277
+ return message;
278
+ } finally {
279
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
280
+ }
281
+ },
282
+
283
+ fromJSON(object: any): TermaPolicy {
284
+ return {
285
+ global: isSet(object.global) ? TermaGlobalCoverage.fromJSON(object.global) : undefined,
286
+ perRepository: isSet(object.perRepository)
287
+ ? TermaPerRepositoryCoverage.fromJSON(object.perRepository)
288
+ : isSet(object.per_repository)
289
+ ? TermaPerRepositoryCoverage.fromJSON(object.per_repository)
290
+ : undefined,
291
+ capture: isSet(object.capture) ? TermaCapture.fromJSON(object.capture) : undefined,
292
+ };
293
+ },
294
+
295
+ toJSON(message: TermaPolicy): unknown {
296
+ const obj: any = {};
297
+ if (message.global !== undefined) {
298
+ obj.global = TermaGlobalCoverage.toJSON(message.global);
299
+ }
300
+ if (message.perRepository !== undefined) {
301
+ obj.perRepository = TermaPerRepositoryCoverage.toJSON(message.perRepository);
302
+ }
303
+ if (message.capture !== undefined) {
304
+ obj.capture = TermaCapture.toJSON(message.capture);
305
+ }
306
+ return obj;
307
+ },
308
+
309
+ create<I extends Exact<DeepPartial<TermaPolicy>, I>>(base?: I): TermaPolicy {
310
+ return TermaPolicy.fromPartial(base ?? ({} as any));
311
+ },
312
+ fromPartial<I extends Exact<DeepPartial<TermaPolicy>, I>>(object: I): TermaPolicy {
313
+ const message = createBaseTermaPolicy();
314
+ message.global = (object.global !== undefined && object.global !== null)
315
+ ? TermaGlobalCoverage.fromPartial(object.global)
316
+ : undefined;
317
+ message.perRepository = (object.perRepository !== undefined && object.perRepository !== null)
318
+ ? TermaPerRepositoryCoverage.fromPartial(object.perRepository)
319
+ : undefined;
320
+ message.capture = (object.capture !== undefined && object.capture !== null)
321
+ ? TermaCapture.fromPartial(object.capture)
322
+ : undefined;
323
+ return message;
324
+ },
325
+ };
326
+
327
+ function createBaseTermaGlobalCoverage(): TermaGlobalCoverage {
328
+ return { membersCanPause: false };
329
+ }
330
+
331
+ export const TermaGlobalCoverage: MessageFns<TermaGlobalCoverage> = {
332
+ encode(message: TermaGlobalCoverage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
333
+ if (message.membersCanPause !== false) {
334
+ writer.uint32(8).bool(message.membersCanPause);
335
+ }
336
+ return writer;
337
+ },
338
+
339
+ decode(input: BinaryReader | Uint8Array, length?: number): TermaGlobalCoverage {
340
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
341
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
342
+ if (previousRecursionDepth >= 100) {
343
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
344
+ }
345
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
346
+ try {
347
+ const end = length === undefined ? reader.len : reader.pos + length;
348
+ const message = createBaseTermaGlobalCoverage();
349
+ while (reader.pos < end) {
350
+ const tag = reader.uint32();
351
+ switch (tag >>> 3) {
352
+ case 1: {
353
+ if (tag !== 8) {
354
+ break;
355
+ }
356
+
357
+ message.membersCanPause = reader.bool();
358
+ continue;
359
+ }
360
+ }
361
+ if ((tag & 7) === 4 || tag === 0) {
362
+ break;
363
+ }
364
+ reader.skip(tag & 7);
365
+ }
366
+ return message;
367
+ } finally {
368
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
369
+ }
370
+ },
371
+
372
+ fromJSON(object: any): TermaGlobalCoverage {
373
+ return {
374
+ membersCanPause: isSet(object.membersCanPause)
375
+ ? globalThis.Boolean(object.membersCanPause)
376
+ : isSet(object.members_can_pause)
377
+ ? globalThis.Boolean(object.members_can_pause)
378
+ : false,
379
+ };
380
+ },
381
+
382
+ toJSON(message: TermaGlobalCoverage): unknown {
383
+ const obj: any = {};
384
+ if (message.membersCanPause !== false) {
385
+ obj.membersCanPause = message.membersCanPause;
386
+ }
387
+ return obj;
388
+ },
389
+
390
+ create<I extends Exact<DeepPartial<TermaGlobalCoverage>, I>>(base?: I): TermaGlobalCoverage {
391
+ return TermaGlobalCoverage.fromPartial(base ?? ({} as any));
392
+ },
393
+ fromPartial<I extends Exact<DeepPartial<TermaGlobalCoverage>, I>>(object: I): TermaGlobalCoverage {
394
+ const message = createBaseTermaGlobalCoverage();
395
+ message.membersCanPause = object.membersCanPause ?? false;
396
+ return message;
397
+ },
398
+ };
399
+
400
+ function createBaseTermaPerRepositoryCoverage(): TermaPerRepositoryCoverage {
401
+ return { membersCanAddRepositories: false };
402
+ }
403
+
404
+ export const TermaPerRepositoryCoverage: MessageFns<TermaPerRepositoryCoverage> = {
405
+ encode(message: TermaPerRepositoryCoverage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
406
+ if (message.membersCanAddRepositories !== false) {
407
+ writer.uint32(8).bool(message.membersCanAddRepositories);
408
+ }
409
+ return writer;
410
+ },
411
+
412
+ decode(input: BinaryReader | Uint8Array, length?: number): TermaPerRepositoryCoverage {
413
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
414
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
415
+ if (previousRecursionDepth >= 100) {
416
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
417
+ }
418
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
419
+ try {
420
+ const end = length === undefined ? reader.len : reader.pos + length;
421
+ const message = createBaseTermaPerRepositoryCoverage();
422
+ while (reader.pos < end) {
423
+ const tag = reader.uint32();
424
+ switch (tag >>> 3) {
425
+ case 1: {
426
+ if (tag !== 8) {
427
+ break;
428
+ }
429
+
430
+ message.membersCanAddRepositories = reader.bool();
431
+ continue;
432
+ }
433
+ }
434
+ if ((tag & 7) === 4 || tag === 0) {
435
+ break;
436
+ }
437
+ reader.skip(tag & 7);
438
+ }
439
+ return message;
440
+ } finally {
441
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
442
+ }
443
+ },
444
+
445
+ fromJSON(object: any): TermaPerRepositoryCoverage {
446
+ return {
447
+ membersCanAddRepositories: isSet(object.membersCanAddRepositories)
448
+ ? globalThis.Boolean(object.membersCanAddRepositories)
449
+ : isSet(object.members_can_add_repositories)
450
+ ? globalThis.Boolean(object.members_can_add_repositories)
451
+ : false,
452
+ };
453
+ },
454
+
455
+ toJSON(message: TermaPerRepositoryCoverage): unknown {
456
+ const obj: any = {};
457
+ if (message.membersCanAddRepositories !== false) {
458
+ obj.membersCanAddRepositories = message.membersCanAddRepositories;
459
+ }
460
+ return obj;
461
+ },
462
+
463
+ create<I extends Exact<DeepPartial<TermaPerRepositoryCoverage>, I>>(base?: I): TermaPerRepositoryCoverage {
464
+ return TermaPerRepositoryCoverage.fromPartial(base ?? ({} as any));
465
+ },
466
+ fromPartial<I extends Exact<DeepPartial<TermaPerRepositoryCoverage>, I>>(object: I): TermaPerRepositoryCoverage {
467
+ const message = createBaseTermaPerRepositoryCoverage();
468
+ message.membersCanAddRepositories = object.membersCanAddRepositories ?? false;
469
+ return message;
470
+ },
471
+ };
472
+
473
+ function createBaseTermaCapture(): TermaCapture {
474
+ return { signals: [], excludePrompts: false, excludeToolContent: false, excludePaths: [] };
475
+ }
476
+
477
+ export const TermaCapture: MessageFns<TermaCapture> = {
478
+ encode(message: TermaCapture, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
479
+ writer.uint32(10).fork();
480
+ for (const v of message.signals) {
481
+ writer.int32(v);
482
+ }
483
+ writer.join();
484
+ if (message.excludePrompts !== false) {
485
+ writer.uint32(16).bool(message.excludePrompts);
486
+ }
487
+ if (message.excludeToolContent !== false) {
488
+ writer.uint32(24).bool(message.excludeToolContent);
489
+ }
490
+ for (const v of message.excludePaths) {
491
+ writer.uint32(34).string(v!);
492
+ }
493
+ return writer;
494
+ },
495
+
496
+ decode(input: BinaryReader | Uint8Array, length?: number): TermaCapture {
497
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
498
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
499
+ if (previousRecursionDepth >= 100) {
500
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
501
+ }
502
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
503
+ try {
504
+ const end = length === undefined ? reader.len : reader.pos + length;
505
+ const message = createBaseTermaCapture();
506
+ while (reader.pos < end) {
507
+ const tag = reader.uint32();
508
+ switch (tag >>> 3) {
509
+ case 1: {
510
+ if (tag === 8) {
511
+ message.signals.push(reader.int32() as any);
512
+
513
+ continue;
514
+ }
515
+
516
+ if (tag === 10) {
517
+ const end2 = reader.uint32() + reader.pos;
518
+ while (reader.pos < end2) {
519
+ message.signals.push(reader.int32() as any);
520
+ }
521
+
522
+ continue;
523
+ }
524
+
525
+ break;
526
+ }
527
+ case 2: {
528
+ if (tag !== 16) {
529
+ break;
530
+ }
531
+
532
+ message.excludePrompts = reader.bool();
533
+ continue;
534
+ }
535
+ case 3: {
536
+ if (tag !== 24) {
537
+ break;
538
+ }
539
+
540
+ message.excludeToolContent = reader.bool();
541
+ continue;
542
+ }
543
+ case 4: {
544
+ if (tag !== 34) {
545
+ break;
546
+ }
547
+
548
+ message.excludePaths.push(reader.string());
549
+ continue;
550
+ }
551
+ }
552
+ if ((tag & 7) === 4 || tag === 0) {
553
+ break;
554
+ }
555
+ reader.skip(tag & 7);
556
+ }
557
+ return message;
558
+ } finally {
559
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
560
+ }
561
+ },
562
+
563
+ fromJSON(object: any): TermaCapture {
564
+ return {
565
+ signals: globalThis.Array.isArray(object?.signals) ? object.signals.map((e: any) => termaSignalFromJSON(e)) : [],
566
+ excludePrompts: isSet(object.excludePrompts)
567
+ ? globalThis.Boolean(object.excludePrompts)
568
+ : isSet(object.exclude_prompts)
569
+ ? globalThis.Boolean(object.exclude_prompts)
570
+ : false,
571
+ excludeToolContent: isSet(object.excludeToolContent)
572
+ ? globalThis.Boolean(object.excludeToolContent)
573
+ : isSet(object.exclude_tool_content)
574
+ ? globalThis.Boolean(object.exclude_tool_content)
575
+ : false,
576
+ excludePaths: globalThis.Array.isArray(object?.excludePaths)
577
+ ? object.excludePaths.map((e: any) => globalThis.String(e))
578
+ : globalThis.Array.isArray(object?.exclude_paths)
579
+ ? object.exclude_paths.map((e: any) => globalThis.String(e))
580
+ : [],
581
+ };
582
+ },
583
+
584
+ toJSON(message: TermaCapture): unknown {
585
+ const obj: any = {};
586
+ if (message.signals?.length) {
587
+ obj.signals = message.signals.map((e) => termaSignalToJSON(e));
588
+ }
589
+ if (message.excludePrompts !== false) {
590
+ obj.excludePrompts = message.excludePrompts;
591
+ }
592
+ if (message.excludeToolContent !== false) {
593
+ obj.excludeToolContent = message.excludeToolContent;
594
+ }
595
+ if (message.excludePaths?.length) {
596
+ obj.excludePaths = message.excludePaths;
597
+ }
598
+ return obj;
599
+ },
600
+
601
+ create<I extends Exact<DeepPartial<TermaCapture>, I>>(base?: I): TermaCapture {
602
+ return TermaCapture.fromPartial(base ?? ({} as any));
603
+ },
604
+ fromPartial<I extends Exact<DeepPartial<TermaCapture>, I>>(object: I): TermaCapture {
605
+ const message = createBaseTermaCapture();
606
+ message.signals = object.signals?.map((e) => e) || [];
607
+ message.excludePrompts = object.excludePrompts ?? false;
608
+ message.excludeToolContent = object.excludeToolContent ?? false;
609
+ message.excludePaths = object.excludePaths?.map((e) => e) || [];
610
+ return message;
611
+ },
612
+ };
613
+
614
+ function createBaseGetProjectPolicyRequest(): GetProjectPolicyRequest {
615
+ return { organizationId: "", projectId: "" };
616
+ }
617
+
618
+ export const GetProjectPolicyRequest: MessageFns<GetProjectPolicyRequest> = {
619
+ encode(message: GetProjectPolicyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
620
+ if (message.organizationId !== "") {
621
+ writer.uint32(10).string(message.organizationId);
622
+ }
623
+ if (message.projectId !== "") {
624
+ writer.uint32(18).string(message.projectId);
625
+ }
626
+ return writer;
627
+ },
628
+
629
+ decode(input: BinaryReader | Uint8Array, length?: number): GetProjectPolicyRequest {
630
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
631
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
632
+ if (previousRecursionDepth >= 100) {
633
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
634
+ }
635
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
636
+ try {
637
+ const end = length === undefined ? reader.len : reader.pos + length;
638
+ const message = createBaseGetProjectPolicyRequest();
639
+ while (reader.pos < end) {
640
+ const tag = reader.uint32();
641
+ switch (tag >>> 3) {
642
+ case 1: {
643
+ if (tag !== 10) {
644
+ break;
645
+ }
646
+
647
+ message.organizationId = reader.string();
648
+ continue;
649
+ }
650
+ case 2: {
651
+ if (tag !== 18) {
652
+ break;
653
+ }
654
+
655
+ message.projectId = reader.string();
656
+ continue;
657
+ }
658
+ }
659
+ if ((tag & 7) === 4 || tag === 0) {
660
+ break;
661
+ }
662
+ reader.skip(tag & 7);
663
+ }
664
+ return message;
665
+ } finally {
666
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
667
+ }
668
+ },
669
+
670
+ fromJSON(object: any): GetProjectPolicyRequest {
671
+ return {
672
+ organizationId: isSet(object.organizationId)
673
+ ? globalThis.String(object.organizationId)
674
+ : isSet(object.organization_id)
675
+ ? globalThis.String(object.organization_id)
676
+ : "",
677
+ projectId: isSet(object.projectId)
678
+ ? globalThis.String(object.projectId)
679
+ : isSet(object.project_id)
680
+ ? globalThis.String(object.project_id)
681
+ : "",
682
+ };
683
+ },
684
+
685
+ toJSON(message: GetProjectPolicyRequest): unknown {
686
+ const obj: any = {};
687
+ if (message.organizationId !== "") {
688
+ obj.organizationId = message.organizationId;
689
+ }
690
+ if (message.projectId !== "") {
691
+ obj.projectId = message.projectId;
692
+ }
693
+ return obj;
694
+ },
695
+
696
+ create<I extends Exact<DeepPartial<GetProjectPolicyRequest>, I>>(base?: I): GetProjectPolicyRequest {
697
+ return GetProjectPolicyRequest.fromPartial(base ?? ({} as any));
698
+ },
699
+ fromPartial<I extends Exact<DeepPartial<GetProjectPolicyRequest>, I>>(object: I): GetProjectPolicyRequest {
700
+ const message = createBaseGetProjectPolicyRequest();
701
+ message.organizationId = object.organizationId ?? "";
702
+ message.projectId = object.projectId ?? "";
703
+ return message;
704
+ },
705
+ };
706
+
707
+ function createBaseGetProjectPolicyResponse(): GetProjectPolicyResponse {
708
+ return { status: undefined, policy: undefined, version: "", revision: 0, updatedAt: undefined };
709
+ }
710
+
711
+ export const GetProjectPolicyResponse: MessageFns<GetProjectPolicyResponse> = {
712
+ encode(message: GetProjectPolicyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
713
+ if (message.status !== undefined) {
714
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
715
+ }
716
+ if (message.policy !== undefined) {
717
+ ProjectPolicy.encode(message.policy, writer.uint32(18).fork()).join();
718
+ }
719
+ if (message.version !== "") {
720
+ writer.uint32(26).string(message.version);
721
+ }
722
+ if (message.revision !== 0) {
723
+ writer.uint32(32).int64(message.revision);
724
+ }
725
+ if (message.updatedAt !== undefined) {
726
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(42).fork()).join();
727
+ }
728
+ return writer;
729
+ },
730
+
731
+ decode(input: BinaryReader | Uint8Array, length?: number): GetProjectPolicyResponse {
732
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
733
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
734
+ if (previousRecursionDepth >= 100) {
735
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
736
+ }
737
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
738
+ try {
739
+ const end = length === undefined ? reader.len : reader.pos + length;
740
+ const message = createBaseGetProjectPolicyResponse();
741
+ while (reader.pos < end) {
742
+ const tag = reader.uint32();
743
+ switch (tag >>> 3) {
744
+ case 1: {
745
+ if (tag !== 10) {
746
+ break;
747
+ }
748
+
749
+ message.status = ResponseStatus.decode(reader, reader.uint32());
750
+ continue;
751
+ }
752
+ case 2: {
753
+ if (tag !== 18) {
754
+ break;
755
+ }
756
+
757
+ message.policy = ProjectPolicy.decode(reader, reader.uint32());
758
+ continue;
759
+ }
760
+ case 3: {
761
+ if (tag !== 26) {
762
+ break;
763
+ }
764
+
765
+ message.version = reader.string();
766
+ continue;
767
+ }
768
+ case 4: {
769
+ if (tag !== 32) {
770
+ break;
771
+ }
772
+
773
+ message.revision = longToNumber(reader.int64());
774
+ continue;
775
+ }
776
+ case 5: {
777
+ if (tag !== 42) {
778
+ break;
779
+ }
780
+
781
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
782
+ continue;
783
+ }
784
+ }
785
+ if ((tag & 7) === 4 || tag === 0) {
786
+ break;
787
+ }
788
+ reader.skip(tag & 7);
789
+ }
790
+ return message;
791
+ } finally {
792
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
793
+ }
794
+ },
795
+
796
+ fromJSON(object: any): GetProjectPolicyResponse {
797
+ return {
798
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
799
+ policy: isSet(object.policy) ? ProjectPolicy.fromJSON(object.policy) : undefined,
800
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
801
+ revision: isSet(object.revision) ? globalThis.Number(object.revision) : 0,
802
+ updatedAt: isSet(object.updatedAt)
803
+ ? fromJsonTimestamp(object.updatedAt)
804
+ : isSet(object.updated_at)
805
+ ? fromJsonTimestamp(object.updated_at)
806
+ : undefined,
807
+ };
808
+ },
809
+
810
+ toJSON(message: GetProjectPolicyResponse): unknown {
811
+ const obj: any = {};
812
+ if (message.status !== undefined) {
813
+ obj.status = ResponseStatus.toJSON(message.status);
814
+ }
815
+ if (message.policy !== undefined) {
816
+ obj.policy = ProjectPolicy.toJSON(message.policy);
817
+ }
818
+ if (message.version !== "") {
819
+ obj.version = message.version;
820
+ }
821
+ if (message.revision !== 0) {
822
+ obj.revision = Math.round(message.revision);
823
+ }
824
+ if (message.updatedAt !== undefined) {
825
+ obj.updatedAt = message.updatedAt.toISOString();
826
+ }
827
+ return obj;
828
+ },
829
+
830
+ create<I extends Exact<DeepPartial<GetProjectPolicyResponse>, I>>(base?: I): GetProjectPolicyResponse {
831
+ return GetProjectPolicyResponse.fromPartial(base ?? ({} as any));
832
+ },
833
+ fromPartial<I extends Exact<DeepPartial<GetProjectPolicyResponse>, I>>(object: I): GetProjectPolicyResponse {
834
+ const message = createBaseGetProjectPolicyResponse();
835
+ message.status = (object.status !== undefined && object.status !== null)
836
+ ? ResponseStatus.fromPartial(object.status)
837
+ : undefined;
838
+ message.policy = (object.policy !== undefined && object.policy !== null)
839
+ ? ProjectPolicy.fromPartial(object.policy)
840
+ : undefined;
841
+ message.version = object.version ?? "";
842
+ message.revision = object.revision ?? 0;
843
+ message.updatedAt = object.updatedAt ?? undefined;
844
+ return message;
845
+ },
846
+ };
847
+
848
+ function createBaseSetProjectPolicyRequest(): SetProjectPolicyRequest {
849
+ return { organizationId: "", projectId: "", policy: undefined };
850
+ }
851
+
852
+ export const SetProjectPolicyRequest: MessageFns<SetProjectPolicyRequest> = {
853
+ encode(message: SetProjectPolicyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
854
+ if (message.organizationId !== "") {
855
+ writer.uint32(10).string(message.organizationId);
856
+ }
857
+ if (message.projectId !== "") {
858
+ writer.uint32(18).string(message.projectId);
859
+ }
860
+ if (message.policy !== undefined) {
861
+ ProjectPolicy.encode(message.policy, writer.uint32(26).fork()).join();
862
+ }
863
+ return writer;
864
+ },
865
+
866
+ decode(input: BinaryReader | Uint8Array, length?: number): SetProjectPolicyRequest {
867
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
868
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
869
+ if (previousRecursionDepth >= 100) {
870
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
871
+ }
872
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
873
+ try {
874
+ const end = length === undefined ? reader.len : reader.pos + length;
875
+ const message = createBaseSetProjectPolicyRequest();
876
+ while (reader.pos < end) {
877
+ const tag = reader.uint32();
878
+ switch (tag >>> 3) {
879
+ case 1: {
880
+ if (tag !== 10) {
881
+ break;
882
+ }
883
+
884
+ message.organizationId = reader.string();
885
+ continue;
886
+ }
887
+ case 2: {
888
+ if (tag !== 18) {
889
+ break;
890
+ }
891
+
892
+ message.projectId = reader.string();
893
+ continue;
894
+ }
895
+ case 3: {
896
+ if (tag !== 26) {
897
+ break;
898
+ }
899
+
900
+ message.policy = ProjectPolicy.decode(reader, reader.uint32());
901
+ continue;
902
+ }
903
+ }
904
+ if ((tag & 7) === 4 || tag === 0) {
905
+ break;
906
+ }
907
+ reader.skip(tag & 7);
908
+ }
909
+ return message;
910
+ } finally {
911
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
912
+ }
913
+ },
914
+
915
+ fromJSON(object: any): SetProjectPolicyRequest {
916
+ return {
917
+ organizationId: isSet(object.organizationId)
918
+ ? globalThis.String(object.organizationId)
919
+ : isSet(object.organization_id)
920
+ ? globalThis.String(object.organization_id)
921
+ : "",
922
+ projectId: isSet(object.projectId)
923
+ ? globalThis.String(object.projectId)
924
+ : isSet(object.project_id)
925
+ ? globalThis.String(object.project_id)
926
+ : "",
927
+ policy: isSet(object.policy) ? ProjectPolicy.fromJSON(object.policy) : undefined,
928
+ };
929
+ },
930
+
931
+ toJSON(message: SetProjectPolicyRequest): unknown {
932
+ const obj: any = {};
933
+ if (message.organizationId !== "") {
934
+ obj.organizationId = message.organizationId;
935
+ }
936
+ if (message.projectId !== "") {
937
+ obj.projectId = message.projectId;
938
+ }
939
+ if (message.policy !== undefined) {
940
+ obj.policy = ProjectPolicy.toJSON(message.policy);
941
+ }
942
+ return obj;
943
+ },
944
+
945
+ create<I extends Exact<DeepPartial<SetProjectPolicyRequest>, I>>(base?: I): SetProjectPolicyRequest {
946
+ return SetProjectPolicyRequest.fromPartial(base ?? ({} as any));
947
+ },
948
+ fromPartial<I extends Exact<DeepPartial<SetProjectPolicyRequest>, I>>(object: I): SetProjectPolicyRequest {
949
+ const message = createBaseSetProjectPolicyRequest();
950
+ message.organizationId = object.organizationId ?? "";
951
+ message.projectId = object.projectId ?? "";
952
+ message.policy = (object.policy !== undefined && object.policy !== null)
953
+ ? ProjectPolicy.fromPartial(object.policy)
954
+ : undefined;
955
+ return message;
956
+ },
957
+ };
958
+
959
+ function createBaseSetProjectPolicyResponse(): SetProjectPolicyResponse {
960
+ return { status: undefined, policy: undefined, version: "", revision: 0, updatedAt: undefined };
961
+ }
962
+
963
+ export const SetProjectPolicyResponse: MessageFns<SetProjectPolicyResponse> = {
964
+ encode(message: SetProjectPolicyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
965
+ if (message.status !== undefined) {
966
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
967
+ }
968
+ if (message.policy !== undefined) {
969
+ ProjectPolicy.encode(message.policy, writer.uint32(18).fork()).join();
970
+ }
971
+ if (message.version !== "") {
972
+ writer.uint32(26).string(message.version);
973
+ }
974
+ if (message.revision !== 0) {
975
+ writer.uint32(32).int64(message.revision);
976
+ }
977
+ if (message.updatedAt !== undefined) {
978
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(42).fork()).join();
979
+ }
980
+ return writer;
981
+ },
982
+
983
+ decode(input: BinaryReader | Uint8Array, length?: number): SetProjectPolicyResponse {
984
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
985
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
986
+ if (previousRecursionDepth >= 100) {
987
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
988
+ }
989
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
990
+ try {
991
+ const end = length === undefined ? reader.len : reader.pos + length;
992
+ const message = createBaseSetProjectPolicyResponse();
993
+ while (reader.pos < end) {
994
+ const tag = reader.uint32();
995
+ switch (tag >>> 3) {
996
+ case 1: {
997
+ if (tag !== 10) {
998
+ break;
999
+ }
1000
+
1001
+ message.status = ResponseStatus.decode(reader, reader.uint32());
1002
+ continue;
1003
+ }
1004
+ case 2: {
1005
+ if (tag !== 18) {
1006
+ break;
1007
+ }
1008
+
1009
+ message.policy = ProjectPolicy.decode(reader, reader.uint32());
1010
+ continue;
1011
+ }
1012
+ case 3: {
1013
+ if (tag !== 26) {
1014
+ break;
1015
+ }
1016
+
1017
+ message.version = reader.string();
1018
+ continue;
1019
+ }
1020
+ case 4: {
1021
+ if (tag !== 32) {
1022
+ break;
1023
+ }
1024
+
1025
+ message.revision = longToNumber(reader.int64());
1026
+ continue;
1027
+ }
1028
+ case 5: {
1029
+ if (tag !== 42) {
1030
+ break;
1031
+ }
1032
+
1033
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1034
+ continue;
1035
+ }
1036
+ }
1037
+ if ((tag & 7) === 4 || tag === 0) {
1038
+ break;
1039
+ }
1040
+ reader.skip(tag & 7);
1041
+ }
1042
+ return message;
1043
+ } finally {
1044
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1045
+ }
1046
+ },
1047
+
1048
+ fromJSON(object: any): SetProjectPolicyResponse {
1049
+ return {
1050
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
1051
+ policy: isSet(object.policy) ? ProjectPolicy.fromJSON(object.policy) : undefined,
1052
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
1053
+ revision: isSet(object.revision) ? globalThis.Number(object.revision) : 0,
1054
+ updatedAt: isSet(object.updatedAt)
1055
+ ? fromJsonTimestamp(object.updatedAt)
1056
+ : isSet(object.updated_at)
1057
+ ? fromJsonTimestamp(object.updated_at)
1058
+ : undefined,
1059
+ };
1060
+ },
1061
+
1062
+ toJSON(message: SetProjectPolicyResponse): unknown {
1063
+ const obj: any = {};
1064
+ if (message.status !== undefined) {
1065
+ obj.status = ResponseStatus.toJSON(message.status);
1066
+ }
1067
+ if (message.policy !== undefined) {
1068
+ obj.policy = ProjectPolicy.toJSON(message.policy);
1069
+ }
1070
+ if (message.version !== "") {
1071
+ obj.version = message.version;
1072
+ }
1073
+ if (message.revision !== 0) {
1074
+ obj.revision = Math.round(message.revision);
1075
+ }
1076
+ if (message.updatedAt !== undefined) {
1077
+ obj.updatedAt = message.updatedAt.toISOString();
1078
+ }
1079
+ return obj;
1080
+ },
1081
+
1082
+ create<I extends Exact<DeepPartial<SetProjectPolicyResponse>, I>>(base?: I): SetProjectPolicyResponse {
1083
+ return SetProjectPolicyResponse.fromPartial(base ?? ({} as any));
1084
+ },
1085
+ fromPartial<I extends Exact<DeepPartial<SetProjectPolicyResponse>, I>>(object: I): SetProjectPolicyResponse {
1086
+ const message = createBaseSetProjectPolicyResponse();
1087
+ message.status = (object.status !== undefined && object.status !== null)
1088
+ ? ResponseStatus.fromPartial(object.status)
1089
+ : undefined;
1090
+ message.policy = (object.policy !== undefined && object.policy !== null)
1091
+ ? ProjectPolicy.fromPartial(object.policy)
1092
+ : undefined;
1093
+ message.version = object.version ?? "";
1094
+ message.revision = object.revision ?? 0;
1095
+ message.updatedAt = object.updatedAt ?? undefined;
1096
+ return message;
1097
+ },
1098
+ };
1099
+
1100
+ /**
1101
+ * PolicyGatewayService serves project policies: what the CLIs of a project's members configure
1102
+ * themselves from. A deployment serves it only when WEB_GATEWAY_SERVICES names "policy".
1103
+ */
1104
+ export interface PolicyGatewayService {
1105
+ /** GetProjectPolicy returns the project's policy; any member may read it. */
1106
+ GetProjectPolicy(request: GetProjectPolicyRequest, metadata?: Metadata): Promise<GetProjectPolicyResponse>;
1107
+ /** SetProjectPolicy replaces the project's policy whole; only an organization admin may set it. */
1108
+ SetProjectPolicy(request: SetProjectPolicyRequest, metadata?: Metadata): Promise<SetProjectPolicyResponse>;
1109
+ }
1110
+
1111
+ export const PolicyGatewayServiceServiceName = "gateway.web.v1.PolicyGatewayService";
1112
+ export class PolicyGatewayServiceClientImpl implements PolicyGatewayService {
1113
+ private readonly rpc: Rpc;
1114
+ private readonly service: string;
1115
+ constructor(rpc: Rpc, opts?: { service?: string }) {
1116
+ this.service = opts?.service || PolicyGatewayServiceServiceName;
1117
+ this.rpc = rpc;
1118
+ this.GetProjectPolicy = this.GetProjectPolicy.bind(this);
1119
+ this.SetProjectPolicy = this.SetProjectPolicy.bind(this);
1120
+ }
1121
+ GetProjectPolicy(request: GetProjectPolicyRequest, metadata?: Metadata): Promise<GetProjectPolicyResponse> {
1122
+ const data = GetProjectPolicyRequest.encode(request).finish();
1123
+ const promise = this.rpc.request(this.service, "GetProjectPolicy", data, metadata);
1124
+ return promise.then((data) => GetProjectPolicyResponse.decode(new BinaryReader(data)));
1125
+ }
1126
+
1127
+ SetProjectPolicy(request: SetProjectPolicyRequest, metadata?: Metadata): Promise<SetProjectPolicyResponse> {
1128
+ const data = SetProjectPolicyRequest.encode(request).finish();
1129
+ const promise = this.rpc.request(this.service, "SetProjectPolicy", data, metadata);
1130
+ return promise.then((data) => SetProjectPolicyResponse.decode(new BinaryReader(data)));
1131
+ }
1132
+ }
1133
+
1134
+ interface Rpc {
1135
+ request(service: string, method: string, data: Uint8Array, metadata?: Metadata): Promise<Uint8Array>;
1136
+ }
1137
+
1138
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
1139
+
1140
+ export type DeepPartial<T> = T extends Builtin ? T
1141
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
1142
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
1143
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
1144
+ : Partial<T>;
1145
+
1146
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
1147
+ export type Exact<P, I extends P> = P extends Builtin ? P
1148
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
1149
+
1150
+ function toTimestamp(date: Date): Timestamp {
1151
+ const seconds = Math.trunc(date.getTime() / 1_000);
1152
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
1153
+ return { seconds, nanos };
1154
+ }
1155
+
1156
+ function fromTimestamp(t: Timestamp): Date {
1157
+ let millis = (t.seconds || 0) * 1_000;
1158
+ millis += (t.nanos || 0) / 1_000_000;
1159
+ return new globalThis.Date(millis);
1160
+ }
1161
+
1162
+ function fromJsonTimestamp(o: any): Date {
1163
+ if (o instanceof globalThis.Date) {
1164
+ return o;
1165
+ } else if (typeof o === "string") {
1166
+ return new globalThis.Date(o);
1167
+ } else {
1168
+ return fromTimestamp(Timestamp.fromJSON(o));
1169
+ }
1170
+ }
1171
+
1172
+ function longToNumber(int64: { toString(): string }): number {
1173
+ const num = globalThis.Number(int64.toString());
1174
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
1175
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1176
+ }
1177
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
1178
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1179
+ }
1180
+ return num;
1181
+ }
1182
+
1183
+ function isSet(value: any): boolean {
1184
+ return value !== null && value !== undefined;
1185
+ }
1186
+
1187
+ export interface MessageFns<T> {
1188
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
1189
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
1190
+ fromJSON(object: any): T;
1191
+ toJSON(message: T): unknown;
1192
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
1193
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
1194
+ }