@mindburn/helm-ai-kernel 0.5.10 → 0.5.12

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,1901 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.6
4
+ // protoc v7.34.1
5
+ // source: boundary/extauthz/v1/extauthz.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { makeGenericClientConstructor, } from "@grpc/grpc-js";
9
+ import { Struct } from "../../../google/protobuf/struct";
10
+ import { Timestamp } from "../../../google/protobuf/timestamp";
11
+ export const protobufPackage = "helm.boundary.extauthz.v1";
12
+ /**
13
+ * HELM Boundary External Authorization Protocol Buffer Definitions
14
+ *
15
+ * Canonical IDL for the optional gRPC transport of the Kernel-owned
16
+ * pre-dispatch external authorization contract.
17
+ *
18
+ * Stability: v1 additive-only.
19
+ *
20
+ * This contract deliberately represents pre-dispatch authorization only. Final
21
+ * EFFECT receipts, ProofGraph edges, and EvidencePack refs are post-dispatch
22
+ * proof artifacts and must not be minted by the gateway.
23
+ */
24
+ export var Verdict;
25
+ (function (Verdict) {
26
+ Verdict[Verdict["VERDICT_UNSPECIFIED"] = 0] = "VERDICT_UNSPECIFIED";
27
+ Verdict[Verdict["VERDICT_ALLOW"] = 1] = "VERDICT_ALLOW";
28
+ Verdict[Verdict["VERDICT_DENY"] = 2] = "VERDICT_DENY";
29
+ Verdict[Verdict["VERDICT_ESCALATE"] = 3] = "VERDICT_ESCALATE";
30
+ Verdict[Verdict["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
31
+ })(Verdict || (Verdict = {}));
32
+ export function verdictFromJSON(object) {
33
+ switch (object) {
34
+ case 0:
35
+ case "VERDICT_UNSPECIFIED":
36
+ return Verdict.VERDICT_UNSPECIFIED;
37
+ case 1:
38
+ case "VERDICT_ALLOW":
39
+ return Verdict.VERDICT_ALLOW;
40
+ case 2:
41
+ case "VERDICT_DENY":
42
+ return Verdict.VERDICT_DENY;
43
+ case 3:
44
+ case "VERDICT_ESCALATE":
45
+ return Verdict.VERDICT_ESCALATE;
46
+ case -1:
47
+ case "UNRECOGNIZED":
48
+ default:
49
+ return Verdict.UNRECOGNIZED;
50
+ }
51
+ }
52
+ export function verdictToJSON(object) {
53
+ switch (object) {
54
+ case Verdict.VERDICT_UNSPECIFIED:
55
+ return "VERDICT_UNSPECIFIED";
56
+ case Verdict.VERDICT_ALLOW:
57
+ return "VERDICT_ALLOW";
58
+ case Verdict.VERDICT_DENY:
59
+ return "VERDICT_DENY";
60
+ case Verdict.VERDICT_ESCALATE:
61
+ return "VERDICT_ESCALATE";
62
+ case Verdict.UNRECOGNIZED:
63
+ default:
64
+ return "UNRECOGNIZED";
65
+ }
66
+ }
67
+ export var Protocol;
68
+ (function (Protocol) {
69
+ Protocol[Protocol["PROTOCOL_UNSPECIFIED"] = 0] = "PROTOCOL_UNSPECIFIED";
70
+ Protocol[Protocol["PROTOCOL_MCP"] = 1] = "PROTOCOL_MCP";
71
+ Protocol[Protocol["PROTOCOL_A2A"] = 2] = "PROTOCOL_A2A";
72
+ Protocol[Protocol["PROTOCOL_HTTP"] = 3] = "PROTOCOL_HTTP";
73
+ Protocol[Protocol["PROTOCOL_GRPC"] = 4] = "PROTOCOL_GRPC";
74
+ Protocol[Protocol["PROTOCOL_OPENAI"] = 5] = "PROTOCOL_OPENAI";
75
+ Protocol[Protocol["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
76
+ })(Protocol || (Protocol = {}));
77
+ export function protocolFromJSON(object) {
78
+ switch (object) {
79
+ case 0:
80
+ case "PROTOCOL_UNSPECIFIED":
81
+ return Protocol.PROTOCOL_UNSPECIFIED;
82
+ case 1:
83
+ case "PROTOCOL_MCP":
84
+ return Protocol.PROTOCOL_MCP;
85
+ case 2:
86
+ case "PROTOCOL_A2A":
87
+ return Protocol.PROTOCOL_A2A;
88
+ case 3:
89
+ case "PROTOCOL_HTTP":
90
+ return Protocol.PROTOCOL_HTTP;
91
+ case 4:
92
+ case "PROTOCOL_GRPC":
93
+ return Protocol.PROTOCOL_GRPC;
94
+ case 5:
95
+ case "PROTOCOL_OPENAI":
96
+ return Protocol.PROTOCOL_OPENAI;
97
+ case -1:
98
+ case "UNRECOGNIZED":
99
+ default:
100
+ return Protocol.UNRECOGNIZED;
101
+ }
102
+ }
103
+ export function protocolToJSON(object) {
104
+ switch (object) {
105
+ case Protocol.PROTOCOL_UNSPECIFIED:
106
+ return "PROTOCOL_UNSPECIFIED";
107
+ case Protocol.PROTOCOL_MCP:
108
+ return "PROTOCOL_MCP";
109
+ case Protocol.PROTOCOL_A2A:
110
+ return "PROTOCOL_A2A";
111
+ case Protocol.PROTOCOL_HTTP:
112
+ return "PROTOCOL_HTTP";
113
+ case Protocol.PROTOCOL_GRPC:
114
+ return "PROTOCOL_GRPC";
115
+ case Protocol.PROTOCOL_OPENAI:
116
+ return "PROTOCOL_OPENAI";
117
+ case Protocol.UNRECOGNIZED:
118
+ default:
119
+ return "UNRECOGNIZED";
120
+ }
121
+ }
122
+ function createBaseAuthorizationRequest() {
123
+ return {
124
+ schemaVersion: "",
125
+ contractVersion: "",
126
+ requestId: "",
127
+ tenantId: "",
128
+ workspaceId: "",
129
+ principalId: "",
130
+ principalSeq: 0,
131
+ agentIdentityProfileRef: "",
132
+ protocol: 0,
133
+ actionUrn: "",
134
+ toolUrn: "",
135
+ connectorId: "",
136
+ connectorContractHash: "",
137
+ executorKind: "",
138
+ effectClass: "",
139
+ riskClass: "",
140
+ argsC14nHash: "",
141
+ requestBodyHash: "",
142
+ planHash: "",
143
+ policyHash: "",
144
+ p0Hash: "",
145
+ policyEpoch: "",
146
+ idempotencyKeyCandidate: "",
147
+ payloadClass: "",
148
+ redactionProfile: "",
149
+ upstreamTraceId: "",
150
+ upstreamRunId: "",
151
+ deadlineMs: 0,
152
+ riskContext: undefined,
153
+ riskContextHash: "",
154
+ };
155
+ }
156
+ export const AuthorizationRequest = {
157
+ encode(message, writer = new BinaryWriter()) {
158
+ if (message.schemaVersion !== "") {
159
+ writer.uint32(10).string(message.schemaVersion);
160
+ }
161
+ if (message.contractVersion !== "") {
162
+ writer.uint32(18).string(message.contractVersion);
163
+ }
164
+ if (message.requestId !== "") {
165
+ writer.uint32(26).string(message.requestId);
166
+ }
167
+ if (message.tenantId !== "") {
168
+ writer.uint32(34).string(message.tenantId);
169
+ }
170
+ if (message.workspaceId !== "") {
171
+ writer.uint32(42).string(message.workspaceId);
172
+ }
173
+ if (message.principalId !== "") {
174
+ writer.uint32(50).string(message.principalId);
175
+ }
176
+ if (message.principalSeq !== 0) {
177
+ writer.uint32(56).uint64(message.principalSeq);
178
+ }
179
+ if (message.agentIdentityProfileRef !== "") {
180
+ writer.uint32(66).string(message.agentIdentityProfileRef);
181
+ }
182
+ if (message.protocol !== 0) {
183
+ writer.uint32(72).int32(message.protocol);
184
+ }
185
+ if (message.actionUrn !== "") {
186
+ writer.uint32(82).string(message.actionUrn);
187
+ }
188
+ if (message.toolUrn !== "") {
189
+ writer.uint32(90).string(message.toolUrn);
190
+ }
191
+ if (message.connectorId !== "") {
192
+ writer.uint32(98).string(message.connectorId);
193
+ }
194
+ if (message.connectorContractHash !== "") {
195
+ writer.uint32(106).string(message.connectorContractHash);
196
+ }
197
+ if (message.executorKind !== "") {
198
+ writer.uint32(114).string(message.executorKind);
199
+ }
200
+ if (message.effectClass !== "") {
201
+ writer.uint32(122).string(message.effectClass);
202
+ }
203
+ if (message.riskClass !== "") {
204
+ writer.uint32(130).string(message.riskClass);
205
+ }
206
+ if (message.argsC14nHash !== "") {
207
+ writer.uint32(138).string(message.argsC14nHash);
208
+ }
209
+ if (message.requestBodyHash !== "") {
210
+ writer.uint32(146).string(message.requestBodyHash);
211
+ }
212
+ if (message.planHash !== "") {
213
+ writer.uint32(154).string(message.planHash);
214
+ }
215
+ if (message.policyHash !== "") {
216
+ writer.uint32(162).string(message.policyHash);
217
+ }
218
+ if (message.p0Hash !== "") {
219
+ writer.uint32(170).string(message.p0Hash);
220
+ }
221
+ if (message.policyEpoch !== "") {
222
+ writer.uint32(178).string(message.policyEpoch);
223
+ }
224
+ if (message.idempotencyKeyCandidate !== "") {
225
+ writer.uint32(186).string(message.idempotencyKeyCandidate);
226
+ }
227
+ if (message.payloadClass !== "") {
228
+ writer.uint32(194).string(message.payloadClass);
229
+ }
230
+ if (message.redactionProfile !== "") {
231
+ writer.uint32(202).string(message.redactionProfile);
232
+ }
233
+ if (message.upstreamTraceId !== "") {
234
+ writer.uint32(210).string(message.upstreamTraceId);
235
+ }
236
+ if (message.upstreamRunId !== "") {
237
+ writer.uint32(218).string(message.upstreamRunId);
238
+ }
239
+ if (message.deadlineMs !== 0) {
240
+ writer.uint32(224).uint64(message.deadlineMs);
241
+ }
242
+ if (message.riskContext !== undefined) {
243
+ Struct.encode(Struct.wrap(message.riskContext), writer.uint32(234).fork()).join();
244
+ }
245
+ if (message.riskContextHash !== "") {
246
+ writer.uint32(242).string(message.riskContextHash);
247
+ }
248
+ return writer;
249
+ },
250
+ decode(input, length) {
251
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
252
+ const end = length === undefined ? reader.len : reader.pos + length;
253
+ const message = createBaseAuthorizationRequest();
254
+ while (reader.pos < end) {
255
+ const tag = reader.uint32();
256
+ switch (tag >>> 3) {
257
+ case 1: {
258
+ if (tag !== 10) {
259
+ break;
260
+ }
261
+ message.schemaVersion = reader.string();
262
+ continue;
263
+ }
264
+ case 2: {
265
+ if (tag !== 18) {
266
+ break;
267
+ }
268
+ message.contractVersion = reader.string();
269
+ continue;
270
+ }
271
+ case 3: {
272
+ if (tag !== 26) {
273
+ break;
274
+ }
275
+ message.requestId = reader.string();
276
+ continue;
277
+ }
278
+ case 4: {
279
+ if (tag !== 34) {
280
+ break;
281
+ }
282
+ message.tenantId = reader.string();
283
+ continue;
284
+ }
285
+ case 5: {
286
+ if (tag !== 42) {
287
+ break;
288
+ }
289
+ message.workspaceId = reader.string();
290
+ continue;
291
+ }
292
+ case 6: {
293
+ if (tag !== 50) {
294
+ break;
295
+ }
296
+ message.principalId = reader.string();
297
+ continue;
298
+ }
299
+ case 7: {
300
+ if (tag !== 56) {
301
+ break;
302
+ }
303
+ message.principalSeq = longToNumber(reader.uint64());
304
+ continue;
305
+ }
306
+ case 8: {
307
+ if (tag !== 66) {
308
+ break;
309
+ }
310
+ message.agentIdentityProfileRef = reader.string();
311
+ continue;
312
+ }
313
+ case 9: {
314
+ if (tag !== 72) {
315
+ break;
316
+ }
317
+ message.protocol = reader.int32();
318
+ continue;
319
+ }
320
+ case 10: {
321
+ if (tag !== 82) {
322
+ break;
323
+ }
324
+ message.actionUrn = reader.string();
325
+ continue;
326
+ }
327
+ case 11: {
328
+ if (tag !== 90) {
329
+ break;
330
+ }
331
+ message.toolUrn = reader.string();
332
+ continue;
333
+ }
334
+ case 12: {
335
+ if (tag !== 98) {
336
+ break;
337
+ }
338
+ message.connectorId = reader.string();
339
+ continue;
340
+ }
341
+ case 13: {
342
+ if (tag !== 106) {
343
+ break;
344
+ }
345
+ message.connectorContractHash = reader.string();
346
+ continue;
347
+ }
348
+ case 14: {
349
+ if (tag !== 114) {
350
+ break;
351
+ }
352
+ message.executorKind = reader.string();
353
+ continue;
354
+ }
355
+ case 15: {
356
+ if (tag !== 122) {
357
+ break;
358
+ }
359
+ message.effectClass = reader.string();
360
+ continue;
361
+ }
362
+ case 16: {
363
+ if (tag !== 130) {
364
+ break;
365
+ }
366
+ message.riskClass = reader.string();
367
+ continue;
368
+ }
369
+ case 17: {
370
+ if (tag !== 138) {
371
+ break;
372
+ }
373
+ message.argsC14nHash = reader.string();
374
+ continue;
375
+ }
376
+ case 18: {
377
+ if (tag !== 146) {
378
+ break;
379
+ }
380
+ message.requestBodyHash = reader.string();
381
+ continue;
382
+ }
383
+ case 19: {
384
+ if (tag !== 154) {
385
+ break;
386
+ }
387
+ message.planHash = reader.string();
388
+ continue;
389
+ }
390
+ case 20: {
391
+ if (tag !== 162) {
392
+ break;
393
+ }
394
+ message.policyHash = reader.string();
395
+ continue;
396
+ }
397
+ case 21: {
398
+ if (tag !== 170) {
399
+ break;
400
+ }
401
+ message.p0Hash = reader.string();
402
+ continue;
403
+ }
404
+ case 22: {
405
+ if (tag !== 178) {
406
+ break;
407
+ }
408
+ message.policyEpoch = reader.string();
409
+ continue;
410
+ }
411
+ case 23: {
412
+ if (tag !== 186) {
413
+ break;
414
+ }
415
+ message.idempotencyKeyCandidate = reader.string();
416
+ continue;
417
+ }
418
+ case 24: {
419
+ if (tag !== 194) {
420
+ break;
421
+ }
422
+ message.payloadClass = reader.string();
423
+ continue;
424
+ }
425
+ case 25: {
426
+ if (tag !== 202) {
427
+ break;
428
+ }
429
+ message.redactionProfile = reader.string();
430
+ continue;
431
+ }
432
+ case 26: {
433
+ if (tag !== 210) {
434
+ break;
435
+ }
436
+ message.upstreamTraceId = reader.string();
437
+ continue;
438
+ }
439
+ case 27: {
440
+ if (tag !== 218) {
441
+ break;
442
+ }
443
+ message.upstreamRunId = reader.string();
444
+ continue;
445
+ }
446
+ case 28: {
447
+ if (tag !== 224) {
448
+ break;
449
+ }
450
+ message.deadlineMs = longToNumber(reader.uint64());
451
+ continue;
452
+ }
453
+ case 29: {
454
+ if (tag !== 234) {
455
+ break;
456
+ }
457
+ message.riskContext = Struct.unwrap(Struct.decode(reader, reader.uint32()));
458
+ continue;
459
+ }
460
+ case 30: {
461
+ if (tag !== 242) {
462
+ break;
463
+ }
464
+ message.riskContextHash = reader.string();
465
+ continue;
466
+ }
467
+ }
468
+ if ((tag & 7) === 4 || tag === 0) {
469
+ break;
470
+ }
471
+ reader.skip(tag & 7);
472
+ }
473
+ return message;
474
+ },
475
+ fromJSON(object) {
476
+ return {
477
+ schemaVersion: isSet(object.schemaVersion)
478
+ ? globalThis.String(object.schemaVersion)
479
+ : isSet(object.schema_version)
480
+ ? globalThis.String(object.schema_version)
481
+ : "",
482
+ contractVersion: isSet(object.contractVersion)
483
+ ? globalThis.String(object.contractVersion)
484
+ : isSet(object.contract_version)
485
+ ? globalThis.String(object.contract_version)
486
+ : "",
487
+ requestId: isSet(object.requestId)
488
+ ? globalThis.String(object.requestId)
489
+ : isSet(object.request_id)
490
+ ? globalThis.String(object.request_id)
491
+ : "",
492
+ tenantId: isSet(object.tenantId)
493
+ ? globalThis.String(object.tenantId)
494
+ : isSet(object.tenant_id)
495
+ ? globalThis.String(object.tenant_id)
496
+ : "",
497
+ workspaceId: isSet(object.workspaceId)
498
+ ? globalThis.String(object.workspaceId)
499
+ : isSet(object.workspace_id)
500
+ ? globalThis.String(object.workspace_id)
501
+ : "",
502
+ principalId: isSet(object.principalId)
503
+ ? globalThis.String(object.principalId)
504
+ : isSet(object.principal_id)
505
+ ? globalThis.String(object.principal_id)
506
+ : "",
507
+ principalSeq: isSet(object.principalSeq)
508
+ ? globalThis.Number(object.principalSeq)
509
+ : isSet(object.principal_seq)
510
+ ? globalThis.Number(object.principal_seq)
511
+ : 0,
512
+ agentIdentityProfileRef: isSet(object.agentIdentityProfileRef)
513
+ ? globalThis.String(object.agentIdentityProfileRef)
514
+ : isSet(object.agent_identity_profile_ref)
515
+ ? globalThis.String(object.agent_identity_profile_ref)
516
+ : "",
517
+ protocol: isSet(object.protocol) ? protocolFromJSON(object.protocol) : 0,
518
+ actionUrn: isSet(object.actionUrn)
519
+ ? globalThis.String(object.actionUrn)
520
+ : isSet(object.action_urn)
521
+ ? globalThis.String(object.action_urn)
522
+ : "",
523
+ toolUrn: isSet(object.toolUrn)
524
+ ? globalThis.String(object.toolUrn)
525
+ : isSet(object.tool_urn)
526
+ ? globalThis.String(object.tool_urn)
527
+ : "",
528
+ connectorId: isSet(object.connectorId)
529
+ ? globalThis.String(object.connectorId)
530
+ : isSet(object.connector_id)
531
+ ? globalThis.String(object.connector_id)
532
+ : "",
533
+ connectorContractHash: isSet(object.connectorContractHash)
534
+ ? globalThis.String(object.connectorContractHash)
535
+ : isSet(object.connector_contract_hash)
536
+ ? globalThis.String(object.connector_contract_hash)
537
+ : "",
538
+ executorKind: isSet(object.executorKind)
539
+ ? globalThis.String(object.executorKind)
540
+ : isSet(object.executor_kind)
541
+ ? globalThis.String(object.executor_kind)
542
+ : "",
543
+ effectClass: isSet(object.effectClass)
544
+ ? globalThis.String(object.effectClass)
545
+ : isSet(object.effect_class)
546
+ ? globalThis.String(object.effect_class)
547
+ : "",
548
+ riskClass: isSet(object.riskClass)
549
+ ? globalThis.String(object.riskClass)
550
+ : isSet(object.risk_class)
551
+ ? globalThis.String(object.risk_class)
552
+ : "",
553
+ argsC14nHash: isSet(object.argsC14nHash)
554
+ ? globalThis.String(object.argsC14nHash)
555
+ : isSet(object.args_c14n_hash)
556
+ ? globalThis.String(object.args_c14n_hash)
557
+ : "",
558
+ requestBodyHash: isSet(object.requestBodyHash)
559
+ ? globalThis.String(object.requestBodyHash)
560
+ : isSet(object.request_body_hash)
561
+ ? globalThis.String(object.request_body_hash)
562
+ : "",
563
+ planHash: isSet(object.planHash)
564
+ ? globalThis.String(object.planHash)
565
+ : isSet(object.plan_hash)
566
+ ? globalThis.String(object.plan_hash)
567
+ : "",
568
+ policyHash: isSet(object.policyHash)
569
+ ? globalThis.String(object.policyHash)
570
+ : isSet(object.policy_hash)
571
+ ? globalThis.String(object.policy_hash)
572
+ : "",
573
+ p0Hash: isSet(object.p0Hash)
574
+ ? globalThis.String(object.p0Hash)
575
+ : isSet(object.p0_hash)
576
+ ? globalThis.String(object.p0_hash)
577
+ : "",
578
+ policyEpoch: isSet(object.policyEpoch)
579
+ ? globalThis.String(object.policyEpoch)
580
+ : isSet(object.policy_epoch)
581
+ ? globalThis.String(object.policy_epoch)
582
+ : "",
583
+ idempotencyKeyCandidate: isSet(object.idempotencyKeyCandidate)
584
+ ? globalThis.String(object.idempotencyKeyCandidate)
585
+ : isSet(object.idempotency_key_candidate)
586
+ ? globalThis.String(object.idempotency_key_candidate)
587
+ : "",
588
+ payloadClass: isSet(object.payloadClass)
589
+ ? globalThis.String(object.payloadClass)
590
+ : isSet(object.payload_class)
591
+ ? globalThis.String(object.payload_class)
592
+ : "",
593
+ redactionProfile: isSet(object.redactionProfile)
594
+ ? globalThis.String(object.redactionProfile)
595
+ : isSet(object.redaction_profile)
596
+ ? globalThis.String(object.redaction_profile)
597
+ : "",
598
+ upstreamTraceId: isSet(object.upstreamTraceId)
599
+ ? globalThis.String(object.upstreamTraceId)
600
+ : isSet(object.upstream_trace_id)
601
+ ? globalThis.String(object.upstream_trace_id)
602
+ : "",
603
+ upstreamRunId: isSet(object.upstreamRunId)
604
+ ? globalThis.String(object.upstreamRunId)
605
+ : isSet(object.upstream_run_id)
606
+ ? globalThis.String(object.upstream_run_id)
607
+ : "",
608
+ deadlineMs: isSet(object.deadlineMs)
609
+ ? globalThis.Number(object.deadlineMs)
610
+ : isSet(object.deadline_ms)
611
+ ? globalThis.Number(object.deadline_ms)
612
+ : 0,
613
+ riskContext: isObject(object.riskContext)
614
+ ? object.riskContext
615
+ : isObject(object.risk_context)
616
+ ? object.risk_context
617
+ : undefined,
618
+ riskContextHash: isSet(object.riskContextHash)
619
+ ? globalThis.String(object.riskContextHash)
620
+ : isSet(object.risk_context_hash)
621
+ ? globalThis.String(object.risk_context_hash)
622
+ : "",
623
+ };
624
+ },
625
+ toJSON(message) {
626
+ const obj = {};
627
+ if (message.schemaVersion !== "") {
628
+ obj.schemaVersion = message.schemaVersion;
629
+ }
630
+ if (message.contractVersion !== "") {
631
+ obj.contractVersion = message.contractVersion;
632
+ }
633
+ if (message.requestId !== "") {
634
+ obj.requestId = message.requestId;
635
+ }
636
+ if (message.tenantId !== "") {
637
+ obj.tenantId = message.tenantId;
638
+ }
639
+ if (message.workspaceId !== "") {
640
+ obj.workspaceId = message.workspaceId;
641
+ }
642
+ if (message.principalId !== "") {
643
+ obj.principalId = message.principalId;
644
+ }
645
+ if (message.principalSeq !== 0) {
646
+ obj.principalSeq = Math.round(message.principalSeq);
647
+ }
648
+ if (message.agentIdentityProfileRef !== "") {
649
+ obj.agentIdentityProfileRef = message.agentIdentityProfileRef;
650
+ }
651
+ if (message.protocol !== 0) {
652
+ obj.protocol = protocolToJSON(message.protocol);
653
+ }
654
+ if (message.actionUrn !== "") {
655
+ obj.actionUrn = message.actionUrn;
656
+ }
657
+ if (message.toolUrn !== "") {
658
+ obj.toolUrn = message.toolUrn;
659
+ }
660
+ if (message.connectorId !== "") {
661
+ obj.connectorId = message.connectorId;
662
+ }
663
+ if (message.connectorContractHash !== "") {
664
+ obj.connectorContractHash = message.connectorContractHash;
665
+ }
666
+ if (message.executorKind !== "") {
667
+ obj.executorKind = message.executorKind;
668
+ }
669
+ if (message.effectClass !== "") {
670
+ obj.effectClass = message.effectClass;
671
+ }
672
+ if (message.riskClass !== "") {
673
+ obj.riskClass = message.riskClass;
674
+ }
675
+ if (message.argsC14nHash !== "") {
676
+ obj.argsC14nHash = message.argsC14nHash;
677
+ }
678
+ if (message.requestBodyHash !== "") {
679
+ obj.requestBodyHash = message.requestBodyHash;
680
+ }
681
+ if (message.planHash !== "") {
682
+ obj.planHash = message.planHash;
683
+ }
684
+ if (message.policyHash !== "") {
685
+ obj.policyHash = message.policyHash;
686
+ }
687
+ if (message.p0Hash !== "") {
688
+ obj.p0Hash = message.p0Hash;
689
+ }
690
+ if (message.policyEpoch !== "") {
691
+ obj.policyEpoch = message.policyEpoch;
692
+ }
693
+ if (message.idempotencyKeyCandidate !== "") {
694
+ obj.idempotencyKeyCandidate = message.idempotencyKeyCandidate;
695
+ }
696
+ if (message.payloadClass !== "") {
697
+ obj.payloadClass = message.payloadClass;
698
+ }
699
+ if (message.redactionProfile !== "") {
700
+ obj.redactionProfile = message.redactionProfile;
701
+ }
702
+ if (message.upstreamTraceId !== "") {
703
+ obj.upstreamTraceId = message.upstreamTraceId;
704
+ }
705
+ if (message.upstreamRunId !== "") {
706
+ obj.upstreamRunId = message.upstreamRunId;
707
+ }
708
+ if (message.deadlineMs !== 0) {
709
+ obj.deadlineMs = Math.round(message.deadlineMs);
710
+ }
711
+ if (message.riskContext !== undefined) {
712
+ obj.riskContext = message.riskContext;
713
+ }
714
+ if (message.riskContextHash !== "") {
715
+ obj.riskContextHash = message.riskContextHash;
716
+ }
717
+ return obj;
718
+ },
719
+ create(base) {
720
+ return AuthorizationRequest.fromPartial(base ?? {});
721
+ },
722
+ fromPartial(object) {
723
+ const message = createBaseAuthorizationRequest();
724
+ message.schemaVersion = object.schemaVersion ?? "";
725
+ message.contractVersion = object.contractVersion ?? "";
726
+ message.requestId = object.requestId ?? "";
727
+ message.tenantId = object.tenantId ?? "";
728
+ message.workspaceId = object.workspaceId ?? "";
729
+ message.principalId = object.principalId ?? "";
730
+ message.principalSeq = object.principalSeq ?? 0;
731
+ message.agentIdentityProfileRef = object.agentIdentityProfileRef ?? "";
732
+ message.protocol = object.protocol ?? 0;
733
+ message.actionUrn = object.actionUrn ?? "";
734
+ message.toolUrn = object.toolUrn ?? "";
735
+ message.connectorId = object.connectorId ?? "";
736
+ message.connectorContractHash = object.connectorContractHash ?? "";
737
+ message.executorKind = object.executorKind ?? "";
738
+ message.effectClass = object.effectClass ?? "";
739
+ message.riskClass = object.riskClass ?? "";
740
+ message.argsC14nHash = object.argsC14nHash ?? "";
741
+ message.requestBodyHash = object.requestBodyHash ?? "";
742
+ message.planHash = object.planHash ?? "";
743
+ message.policyHash = object.policyHash ?? "";
744
+ message.p0Hash = object.p0Hash ?? "";
745
+ message.policyEpoch = object.policyEpoch ?? "";
746
+ message.idempotencyKeyCandidate = object.idempotencyKeyCandidate ?? "";
747
+ message.payloadClass = object.payloadClass ?? "";
748
+ message.redactionProfile = object.redactionProfile ?? "";
749
+ message.upstreamTraceId = object.upstreamTraceId ?? "";
750
+ message.upstreamRunId = object.upstreamRunId ?? "";
751
+ message.deadlineMs = object.deadlineMs ?? 0;
752
+ message.riskContext = object.riskContext ?? undefined;
753
+ message.riskContextHash = object.riskContextHash ?? "";
754
+ return message;
755
+ },
756
+ };
757
+ function createBaseAuthorizationResponse() {
758
+ return {
759
+ schemaVersion: "",
760
+ contractVersion: "",
761
+ requestId: "",
762
+ tenantId: "",
763
+ workspaceId: "",
764
+ principalId: "",
765
+ principalSeq: 0,
766
+ agentIdentityProfileRef: "",
767
+ protocol: 0,
768
+ actionUrn: "",
769
+ toolUrn: "",
770
+ connectorId: "",
771
+ connectorContractHash: "",
772
+ executorKind: "",
773
+ effectClass: "",
774
+ riskClass: "",
775
+ argsC14nHash: "",
776
+ requestBodyHash: "",
777
+ planHash: "",
778
+ policyHash: "",
779
+ p0Hash: "",
780
+ policyEpoch: "",
781
+ idempotencyKeyCandidate: "",
782
+ payloadClass: "",
783
+ redactionProfile: "",
784
+ upstreamTraceId: "",
785
+ upstreamRunId: "",
786
+ deadlineMs: 0,
787
+ riskContextHash: "",
788
+ verdict: 0,
789
+ reasonCode: "",
790
+ kernelTrustRootId: "",
791
+ signingKeyRef: "",
792
+ kernelVerdictRef: "",
793
+ kernelVerdictHash: "",
794
+ kernelVerdictSignature: new Uint8Array(0),
795
+ kernelVerdictIssuedAt: undefined,
796
+ kernelVerdictExpiresAt: undefined,
797
+ effectPermitRef: "",
798
+ permitNonce: "",
799
+ permitExpiry: undefined,
800
+ proofSessionRef: "",
801
+ evidenceReservationRef: "",
802
+ budgetReservationRef: "",
803
+ cachePolicy: "",
804
+ replayHint: "",
805
+ denialReceiptRef: "",
806
+ escalationRef: "",
807
+ escalationReceiptRef: "",
808
+ proofObligation: "",
809
+ connectorReceiptPolicy: "",
810
+ proofFinalizationPolicy: "",
811
+ };
812
+ }
813
+ export const AuthorizationResponse = {
814
+ encode(message, writer = new BinaryWriter()) {
815
+ if (message.schemaVersion !== "") {
816
+ writer.uint32(10).string(message.schemaVersion);
817
+ }
818
+ if (message.contractVersion !== "") {
819
+ writer.uint32(18).string(message.contractVersion);
820
+ }
821
+ if (message.requestId !== "") {
822
+ writer.uint32(26).string(message.requestId);
823
+ }
824
+ if (message.tenantId !== "") {
825
+ writer.uint32(34).string(message.tenantId);
826
+ }
827
+ if (message.workspaceId !== "") {
828
+ writer.uint32(42).string(message.workspaceId);
829
+ }
830
+ if (message.principalId !== "") {
831
+ writer.uint32(50).string(message.principalId);
832
+ }
833
+ if (message.principalSeq !== 0) {
834
+ writer.uint32(56).uint64(message.principalSeq);
835
+ }
836
+ if (message.agentIdentityProfileRef !== "") {
837
+ writer.uint32(66).string(message.agentIdentityProfileRef);
838
+ }
839
+ if (message.protocol !== 0) {
840
+ writer.uint32(72).int32(message.protocol);
841
+ }
842
+ if (message.actionUrn !== "") {
843
+ writer.uint32(82).string(message.actionUrn);
844
+ }
845
+ if (message.toolUrn !== "") {
846
+ writer.uint32(90).string(message.toolUrn);
847
+ }
848
+ if (message.connectorId !== "") {
849
+ writer.uint32(98).string(message.connectorId);
850
+ }
851
+ if (message.connectorContractHash !== "") {
852
+ writer.uint32(106).string(message.connectorContractHash);
853
+ }
854
+ if (message.executorKind !== "") {
855
+ writer.uint32(114).string(message.executorKind);
856
+ }
857
+ if (message.effectClass !== "") {
858
+ writer.uint32(122).string(message.effectClass);
859
+ }
860
+ if (message.riskClass !== "") {
861
+ writer.uint32(130).string(message.riskClass);
862
+ }
863
+ if (message.argsC14nHash !== "") {
864
+ writer.uint32(138).string(message.argsC14nHash);
865
+ }
866
+ if (message.requestBodyHash !== "") {
867
+ writer.uint32(146).string(message.requestBodyHash);
868
+ }
869
+ if (message.planHash !== "") {
870
+ writer.uint32(154).string(message.planHash);
871
+ }
872
+ if (message.policyHash !== "") {
873
+ writer.uint32(162).string(message.policyHash);
874
+ }
875
+ if (message.p0Hash !== "") {
876
+ writer.uint32(170).string(message.p0Hash);
877
+ }
878
+ if (message.policyEpoch !== "") {
879
+ writer.uint32(178).string(message.policyEpoch);
880
+ }
881
+ if (message.idempotencyKeyCandidate !== "") {
882
+ writer.uint32(186).string(message.idempotencyKeyCandidate);
883
+ }
884
+ if (message.payloadClass !== "") {
885
+ writer.uint32(194).string(message.payloadClass);
886
+ }
887
+ if (message.redactionProfile !== "") {
888
+ writer.uint32(202).string(message.redactionProfile);
889
+ }
890
+ if (message.upstreamTraceId !== "") {
891
+ writer.uint32(210).string(message.upstreamTraceId);
892
+ }
893
+ if (message.upstreamRunId !== "") {
894
+ writer.uint32(218).string(message.upstreamRunId);
895
+ }
896
+ if (message.deadlineMs !== 0) {
897
+ writer.uint32(224).uint64(message.deadlineMs);
898
+ }
899
+ if (message.riskContextHash !== "") {
900
+ writer.uint32(234).string(message.riskContextHash);
901
+ }
902
+ if (message.verdict !== 0) {
903
+ writer.uint32(240).int32(message.verdict);
904
+ }
905
+ if (message.reasonCode !== "") {
906
+ writer.uint32(250).string(message.reasonCode);
907
+ }
908
+ if (message.kernelTrustRootId !== "") {
909
+ writer.uint32(258).string(message.kernelTrustRootId);
910
+ }
911
+ if (message.signingKeyRef !== "") {
912
+ writer.uint32(266).string(message.signingKeyRef);
913
+ }
914
+ if (message.kernelVerdictRef !== "") {
915
+ writer.uint32(274).string(message.kernelVerdictRef);
916
+ }
917
+ if (message.kernelVerdictHash !== "") {
918
+ writer.uint32(282).string(message.kernelVerdictHash);
919
+ }
920
+ if (message.kernelVerdictSignature.length !== 0) {
921
+ writer.uint32(290).bytes(message.kernelVerdictSignature);
922
+ }
923
+ if (message.kernelVerdictIssuedAt !== undefined) {
924
+ Timestamp.encode(toTimestamp(message.kernelVerdictIssuedAt), writer.uint32(298).fork()).join();
925
+ }
926
+ if (message.kernelVerdictExpiresAt !== undefined) {
927
+ Timestamp.encode(toTimestamp(message.kernelVerdictExpiresAt), writer.uint32(306).fork()).join();
928
+ }
929
+ if (message.effectPermitRef !== "") {
930
+ writer.uint32(314).string(message.effectPermitRef);
931
+ }
932
+ if (message.permitNonce !== "") {
933
+ writer.uint32(322).string(message.permitNonce);
934
+ }
935
+ if (message.permitExpiry !== undefined) {
936
+ Timestamp.encode(toTimestamp(message.permitExpiry), writer.uint32(330).fork()).join();
937
+ }
938
+ if (message.proofSessionRef !== "") {
939
+ writer.uint32(338).string(message.proofSessionRef);
940
+ }
941
+ if (message.evidenceReservationRef !== "") {
942
+ writer.uint32(346).string(message.evidenceReservationRef);
943
+ }
944
+ if (message.budgetReservationRef !== "") {
945
+ writer.uint32(354).string(message.budgetReservationRef);
946
+ }
947
+ if (message.cachePolicy !== "") {
948
+ writer.uint32(362).string(message.cachePolicy);
949
+ }
950
+ if (message.replayHint !== "") {
951
+ writer.uint32(370).string(message.replayHint);
952
+ }
953
+ if (message.denialReceiptRef !== "") {
954
+ writer.uint32(378).string(message.denialReceiptRef);
955
+ }
956
+ if (message.escalationRef !== "") {
957
+ writer.uint32(386).string(message.escalationRef);
958
+ }
959
+ if (message.escalationReceiptRef !== "") {
960
+ writer.uint32(394).string(message.escalationReceiptRef);
961
+ }
962
+ if (message.proofObligation !== "") {
963
+ writer.uint32(402).string(message.proofObligation);
964
+ }
965
+ if (message.connectorReceiptPolicy !== "") {
966
+ writer.uint32(410).string(message.connectorReceiptPolicy);
967
+ }
968
+ if (message.proofFinalizationPolicy !== "") {
969
+ writer.uint32(418).string(message.proofFinalizationPolicy);
970
+ }
971
+ return writer;
972
+ },
973
+ decode(input, length) {
974
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
975
+ const end = length === undefined ? reader.len : reader.pos + length;
976
+ const message = createBaseAuthorizationResponse();
977
+ while (reader.pos < end) {
978
+ const tag = reader.uint32();
979
+ switch (tag >>> 3) {
980
+ case 1: {
981
+ if (tag !== 10) {
982
+ break;
983
+ }
984
+ message.schemaVersion = reader.string();
985
+ continue;
986
+ }
987
+ case 2: {
988
+ if (tag !== 18) {
989
+ break;
990
+ }
991
+ message.contractVersion = reader.string();
992
+ continue;
993
+ }
994
+ case 3: {
995
+ if (tag !== 26) {
996
+ break;
997
+ }
998
+ message.requestId = reader.string();
999
+ continue;
1000
+ }
1001
+ case 4: {
1002
+ if (tag !== 34) {
1003
+ break;
1004
+ }
1005
+ message.tenantId = reader.string();
1006
+ continue;
1007
+ }
1008
+ case 5: {
1009
+ if (tag !== 42) {
1010
+ break;
1011
+ }
1012
+ message.workspaceId = reader.string();
1013
+ continue;
1014
+ }
1015
+ case 6: {
1016
+ if (tag !== 50) {
1017
+ break;
1018
+ }
1019
+ message.principalId = reader.string();
1020
+ continue;
1021
+ }
1022
+ case 7: {
1023
+ if (tag !== 56) {
1024
+ break;
1025
+ }
1026
+ message.principalSeq = longToNumber(reader.uint64());
1027
+ continue;
1028
+ }
1029
+ case 8: {
1030
+ if (tag !== 66) {
1031
+ break;
1032
+ }
1033
+ message.agentIdentityProfileRef = reader.string();
1034
+ continue;
1035
+ }
1036
+ case 9: {
1037
+ if (tag !== 72) {
1038
+ break;
1039
+ }
1040
+ message.protocol = reader.int32();
1041
+ continue;
1042
+ }
1043
+ case 10: {
1044
+ if (tag !== 82) {
1045
+ break;
1046
+ }
1047
+ message.actionUrn = reader.string();
1048
+ continue;
1049
+ }
1050
+ case 11: {
1051
+ if (tag !== 90) {
1052
+ break;
1053
+ }
1054
+ message.toolUrn = reader.string();
1055
+ continue;
1056
+ }
1057
+ case 12: {
1058
+ if (tag !== 98) {
1059
+ break;
1060
+ }
1061
+ message.connectorId = reader.string();
1062
+ continue;
1063
+ }
1064
+ case 13: {
1065
+ if (tag !== 106) {
1066
+ break;
1067
+ }
1068
+ message.connectorContractHash = reader.string();
1069
+ continue;
1070
+ }
1071
+ case 14: {
1072
+ if (tag !== 114) {
1073
+ break;
1074
+ }
1075
+ message.executorKind = reader.string();
1076
+ continue;
1077
+ }
1078
+ case 15: {
1079
+ if (tag !== 122) {
1080
+ break;
1081
+ }
1082
+ message.effectClass = reader.string();
1083
+ continue;
1084
+ }
1085
+ case 16: {
1086
+ if (tag !== 130) {
1087
+ break;
1088
+ }
1089
+ message.riskClass = reader.string();
1090
+ continue;
1091
+ }
1092
+ case 17: {
1093
+ if (tag !== 138) {
1094
+ break;
1095
+ }
1096
+ message.argsC14nHash = reader.string();
1097
+ continue;
1098
+ }
1099
+ case 18: {
1100
+ if (tag !== 146) {
1101
+ break;
1102
+ }
1103
+ message.requestBodyHash = reader.string();
1104
+ continue;
1105
+ }
1106
+ case 19: {
1107
+ if (tag !== 154) {
1108
+ break;
1109
+ }
1110
+ message.planHash = reader.string();
1111
+ continue;
1112
+ }
1113
+ case 20: {
1114
+ if (tag !== 162) {
1115
+ break;
1116
+ }
1117
+ message.policyHash = reader.string();
1118
+ continue;
1119
+ }
1120
+ case 21: {
1121
+ if (tag !== 170) {
1122
+ break;
1123
+ }
1124
+ message.p0Hash = reader.string();
1125
+ continue;
1126
+ }
1127
+ case 22: {
1128
+ if (tag !== 178) {
1129
+ break;
1130
+ }
1131
+ message.policyEpoch = reader.string();
1132
+ continue;
1133
+ }
1134
+ case 23: {
1135
+ if (tag !== 186) {
1136
+ break;
1137
+ }
1138
+ message.idempotencyKeyCandidate = reader.string();
1139
+ continue;
1140
+ }
1141
+ case 24: {
1142
+ if (tag !== 194) {
1143
+ break;
1144
+ }
1145
+ message.payloadClass = reader.string();
1146
+ continue;
1147
+ }
1148
+ case 25: {
1149
+ if (tag !== 202) {
1150
+ break;
1151
+ }
1152
+ message.redactionProfile = reader.string();
1153
+ continue;
1154
+ }
1155
+ case 26: {
1156
+ if (tag !== 210) {
1157
+ break;
1158
+ }
1159
+ message.upstreamTraceId = reader.string();
1160
+ continue;
1161
+ }
1162
+ case 27: {
1163
+ if (tag !== 218) {
1164
+ break;
1165
+ }
1166
+ message.upstreamRunId = reader.string();
1167
+ continue;
1168
+ }
1169
+ case 28: {
1170
+ if (tag !== 224) {
1171
+ break;
1172
+ }
1173
+ message.deadlineMs = longToNumber(reader.uint64());
1174
+ continue;
1175
+ }
1176
+ case 29: {
1177
+ if (tag !== 234) {
1178
+ break;
1179
+ }
1180
+ message.riskContextHash = reader.string();
1181
+ continue;
1182
+ }
1183
+ case 30: {
1184
+ if (tag !== 240) {
1185
+ break;
1186
+ }
1187
+ message.verdict = reader.int32();
1188
+ continue;
1189
+ }
1190
+ case 31: {
1191
+ if (tag !== 250) {
1192
+ break;
1193
+ }
1194
+ message.reasonCode = reader.string();
1195
+ continue;
1196
+ }
1197
+ case 32: {
1198
+ if (tag !== 258) {
1199
+ break;
1200
+ }
1201
+ message.kernelTrustRootId = reader.string();
1202
+ continue;
1203
+ }
1204
+ case 33: {
1205
+ if (tag !== 266) {
1206
+ break;
1207
+ }
1208
+ message.signingKeyRef = reader.string();
1209
+ continue;
1210
+ }
1211
+ case 34: {
1212
+ if (tag !== 274) {
1213
+ break;
1214
+ }
1215
+ message.kernelVerdictRef = reader.string();
1216
+ continue;
1217
+ }
1218
+ case 35: {
1219
+ if (tag !== 282) {
1220
+ break;
1221
+ }
1222
+ message.kernelVerdictHash = reader.string();
1223
+ continue;
1224
+ }
1225
+ case 36: {
1226
+ if (tag !== 290) {
1227
+ break;
1228
+ }
1229
+ message.kernelVerdictSignature = reader.bytes();
1230
+ continue;
1231
+ }
1232
+ case 37: {
1233
+ if (tag !== 298) {
1234
+ break;
1235
+ }
1236
+ message.kernelVerdictIssuedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1237
+ continue;
1238
+ }
1239
+ case 38: {
1240
+ if (tag !== 306) {
1241
+ break;
1242
+ }
1243
+ message.kernelVerdictExpiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1244
+ continue;
1245
+ }
1246
+ case 39: {
1247
+ if (tag !== 314) {
1248
+ break;
1249
+ }
1250
+ message.effectPermitRef = reader.string();
1251
+ continue;
1252
+ }
1253
+ case 40: {
1254
+ if (tag !== 322) {
1255
+ break;
1256
+ }
1257
+ message.permitNonce = reader.string();
1258
+ continue;
1259
+ }
1260
+ case 41: {
1261
+ if (tag !== 330) {
1262
+ break;
1263
+ }
1264
+ message.permitExpiry = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1265
+ continue;
1266
+ }
1267
+ case 42: {
1268
+ if (tag !== 338) {
1269
+ break;
1270
+ }
1271
+ message.proofSessionRef = reader.string();
1272
+ continue;
1273
+ }
1274
+ case 43: {
1275
+ if (tag !== 346) {
1276
+ break;
1277
+ }
1278
+ message.evidenceReservationRef = reader.string();
1279
+ continue;
1280
+ }
1281
+ case 44: {
1282
+ if (tag !== 354) {
1283
+ break;
1284
+ }
1285
+ message.budgetReservationRef = reader.string();
1286
+ continue;
1287
+ }
1288
+ case 45: {
1289
+ if (tag !== 362) {
1290
+ break;
1291
+ }
1292
+ message.cachePolicy = reader.string();
1293
+ continue;
1294
+ }
1295
+ case 46: {
1296
+ if (tag !== 370) {
1297
+ break;
1298
+ }
1299
+ message.replayHint = reader.string();
1300
+ continue;
1301
+ }
1302
+ case 47: {
1303
+ if (tag !== 378) {
1304
+ break;
1305
+ }
1306
+ message.denialReceiptRef = reader.string();
1307
+ continue;
1308
+ }
1309
+ case 48: {
1310
+ if (tag !== 386) {
1311
+ break;
1312
+ }
1313
+ message.escalationRef = reader.string();
1314
+ continue;
1315
+ }
1316
+ case 49: {
1317
+ if (tag !== 394) {
1318
+ break;
1319
+ }
1320
+ message.escalationReceiptRef = reader.string();
1321
+ continue;
1322
+ }
1323
+ case 50: {
1324
+ if (tag !== 402) {
1325
+ break;
1326
+ }
1327
+ message.proofObligation = reader.string();
1328
+ continue;
1329
+ }
1330
+ case 51: {
1331
+ if (tag !== 410) {
1332
+ break;
1333
+ }
1334
+ message.connectorReceiptPolicy = reader.string();
1335
+ continue;
1336
+ }
1337
+ case 52: {
1338
+ if (tag !== 418) {
1339
+ break;
1340
+ }
1341
+ message.proofFinalizationPolicy = reader.string();
1342
+ continue;
1343
+ }
1344
+ }
1345
+ if ((tag & 7) === 4 || tag === 0) {
1346
+ break;
1347
+ }
1348
+ reader.skip(tag & 7);
1349
+ }
1350
+ return message;
1351
+ },
1352
+ fromJSON(object) {
1353
+ return {
1354
+ schemaVersion: isSet(object.schemaVersion)
1355
+ ? globalThis.String(object.schemaVersion)
1356
+ : isSet(object.schema_version)
1357
+ ? globalThis.String(object.schema_version)
1358
+ : "",
1359
+ contractVersion: isSet(object.contractVersion)
1360
+ ? globalThis.String(object.contractVersion)
1361
+ : isSet(object.contract_version)
1362
+ ? globalThis.String(object.contract_version)
1363
+ : "",
1364
+ requestId: isSet(object.requestId)
1365
+ ? globalThis.String(object.requestId)
1366
+ : isSet(object.request_id)
1367
+ ? globalThis.String(object.request_id)
1368
+ : "",
1369
+ tenantId: isSet(object.tenantId)
1370
+ ? globalThis.String(object.tenantId)
1371
+ : isSet(object.tenant_id)
1372
+ ? globalThis.String(object.tenant_id)
1373
+ : "",
1374
+ workspaceId: isSet(object.workspaceId)
1375
+ ? globalThis.String(object.workspaceId)
1376
+ : isSet(object.workspace_id)
1377
+ ? globalThis.String(object.workspace_id)
1378
+ : "",
1379
+ principalId: isSet(object.principalId)
1380
+ ? globalThis.String(object.principalId)
1381
+ : isSet(object.principal_id)
1382
+ ? globalThis.String(object.principal_id)
1383
+ : "",
1384
+ principalSeq: isSet(object.principalSeq)
1385
+ ? globalThis.Number(object.principalSeq)
1386
+ : isSet(object.principal_seq)
1387
+ ? globalThis.Number(object.principal_seq)
1388
+ : 0,
1389
+ agentIdentityProfileRef: isSet(object.agentIdentityProfileRef)
1390
+ ? globalThis.String(object.agentIdentityProfileRef)
1391
+ : isSet(object.agent_identity_profile_ref)
1392
+ ? globalThis.String(object.agent_identity_profile_ref)
1393
+ : "",
1394
+ protocol: isSet(object.protocol) ? protocolFromJSON(object.protocol) : 0,
1395
+ actionUrn: isSet(object.actionUrn)
1396
+ ? globalThis.String(object.actionUrn)
1397
+ : isSet(object.action_urn)
1398
+ ? globalThis.String(object.action_urn)
1399
+ : "",
1400
+ toolUrn: isSet(object.toolUrn)
1401
+ ? globalThis.String(object.toolUrn)
1402
+ : isSet(object.tool_urn)
1403
+ ? globalThis.String(object.tool_urn)
1404
+ : "",
1405
+ connectorId: isSet(object.connectorId)
1406
+ ? globalThis.String(object.connectorId)
1407
+ : isSet(object.connector_id)
1408
+ ? globalThis.String(object.connector_id)
1409
+ : "",
1410
+ connectorContractHash: isSet(object.connectorContractHash)
1411
+ ? globalThis.String(object.connectorContractHash)
1412
+ : isSet(object.connector_contract_hash)
1413
+ ? globalThis.String(object.connector_contract_hash)
1414
+ : "",
1415
+ executorKind: isSet(object.executorKind)
1416
+ ? globalThis.String(object.executorKind)
1417
+ : isSet(object.executor_kind)
1418
+ ? globalThis.String(object.executor_kind)
1419
+ : "",
1420
+ effectClass: isSet(object.effectClass)
1421
+ ? globalThis.String(object.effectClass)
1422
+ : isSet(object.effect_class)
1423
+ ? globalThis.String(object.effect_class)
1424
+ : "",
1425
+ riskClass: isSet(object.riskClass)
1426
+ ? globalThis.String(object.riskClass)
1427
+ : isSet(object.risk_class)
1428
+ ? globalThis.String(object.risk_class)
1429
+ : "",
1430
+ argsC14nHash: isSet(object.argsC14nHash)
1431
+ ? globalThis.String(object.argsC14nHash)
1432
+ : isSet(object.args_c14n_hash)
1433
+ ? globalThis.String(object.args_c14n_hash)
1434
+ : "",
1435
+ requestBodyHash: isSet(object.requestBodyHash)
1436
+ ? globalThis.String(object.requestBodyHash)
1437
+ : isSet(object.request_body_hash)
1438
+ ? globalThis.String(object.request_body_hash)
1439
+ : "",
1440
+ planHash: isSet(object.planHash)
1441
+ ? globalThis.String(object.planHash)
1442
+ : isSet(object.plan_hash)
1443
+ ? globalThis.String(object.plan_hash)
1444
+ : "",
1445
+ policyHash: isSet(object.policyHash)
1446
+ ? globalThis.String(object.policyHash)
1447
+ : isSet(object.policy_hash)
1448
+ ? globalThis.String(object.policy_hash)
1449
+ : "",
1450
+ p0Hash: isSet(object.p0Hash)
1451
+ ? globalThis.String(object.p0Hash)
1452
+ : isSet(object.p0_hash)
1453
+ ? globalThis.String(object.p0_hash)
1454
+ : "",
1455
+ policyEpoch: isSet(object.policyEpoch)
1456
+ ? globalThis.String(object.policyEpoch)
1457
+ : isSet(object.policy_epoch)
1458
+ ? globalThis.String(object.policy_epoch)
1459
+ : "",
1460
+ idempotencyKeyCandidate: isSet(object.idempotencyKeyCandidate)
1461
+ ? globalThis.String(object.idempotencyKeyCandidate)
1462
+ : isSet(object.idempotency_key_candidate)
1463
+ ? globalThis.String(object.idempotency_key_candidate)
1464
+ : "",
1465
+ payloadClass: isSet(object.payloadClass)
1466
+ ? globalThis.String(object.payloadClass)
1467
+ : isSet(object.payload_class)
1468
+ ? globalThis.String(object.payload_class)
1469
+ : "",
1470
+ redactionProfile: isSet(object.redactionProfile)
1471
+ ? globalThis.String(object.redactionProfile)
1472
+ : isSet(object.redaction_profile)
1473
+ ? globalThis.String(object.redaction_profile)
1474
+ : "",
1475
+ upstreamTraceId: isSet(object.upstreamTraceId)
1476
+ ? globalThis.String(object.upstreamTraceId)
1477
+ : isSet(object.upstream_trace_id)
1478
+ ? globalThis.String(object.upstream_trace_id)
1479
+ : "",
1480
+ upstreamRunId: isSet(object.upstreamRunId)
1481
+ ? globalThis.String(object.upstreamRunId)
1482
+ : isSet(object.upstream_run_id)
1483
+ ? globalThis.String(object.upstream_run_id)
1484
+ : "",
1485
+ deadlineMs: isSet(object.deadlineMs)
1486
+ ? globalThis.Number(object.deadlineMs)
1487
+ : isSet(object.deadline_ms)
1488
+ ? globalThis.Number(object.deadline_ms)
1489
+ : 0,
1490
+ riskContextHash: isSet(object.riskContextHash)
1491
+ ? globalThis.String(object.riskContextHash)
1492
+ : isSet(object.risk_context_hash)
1493
+ ? globalThis.String(object.risk_context_hash)
1494
+ : "",
1495
+ verdict: isSet(object.verdict) ? verdictFromJSON(object.verdict) : 0,
1496
+ reasonCode: isSet(object.reasonCode)
1497
+ ? globalThis.String(object.reasonCode)
1498
+ : isSet(object.reason_code)
1499
+ ? globalThis.String(object.reason_code)
1500
+ : "",
1501
+ kernelTrustRootId: isSet(object.kernelTrustRootId)
1502
+ ? globalThis.String(object.kernelTrustRootId)
1503
+ : isSet(object.kernel_trust_root_id)
1504
+ ? globalThis.String(object.kernel_trust_root_id)
1505
+ : "",
1506
+ signingKeyRef: isSet(object.signingKeyRef)
1507
+ ? globalThis.String(object.signingKeyRef)
1508
+ : isSet(object.signing_key_ref)
1509
+ ? globalThis.String(object.signing_key_ref)
1510
+ : "",
1511
+ kernelVerdictRef: isSet(object.kernelVerdictRef)
1512
+ ? globalThis.String(object.kernelVerdictRef)
1513
+ : isSet(object.kernel_verdict_ref)
1514
+ ? globalThis.String(object.kernel_verdict_ref)
1515
+ : "",
1516
+ kernelVerdictHash: isSet(object.kernelVerdictHash)
1517
+ ? globalThis.String(object.kernelVerdictHash)
1518
+ : isSet(object.kernel_verdict_hash)
1519
+ ? globalThis.String(object.kernel_verdict_hash)
1520
+ : "",
1521
+ kernelVerdictSignature: isSet(object.kernelVerdictSignature)
1522
+ ? bytesFromBase64(object.kernelVerdictSignature)
1523
+ : isSet(object.kernel_verdict_signature)
1524
+ ? bytesFromBase64(object.kernel_verdict_signature)
1525
+ : new Uint8Array(0),
1526
+ kernelVerdictIssuedAt: isSet(object.kernelVerdictIssuedAt)
1527
+ ? fromJsonTimestamp(object.kernelVerdictIssuedAt)
1528
+ : isSet(object.kernel_verdict_issued_at)
1529
+ ? fromJsonTimestamp(object.kernel_verdict_issued_at)
1530
+ : undefined,
1531
+ kernelVerdictExpiresAt: isSet(object.kernelVerdictExpiresAt)
1532
+ ? fromJsonTimestamp(object.kernelVerdictExpiresAt)
1533
+ : isSet(object.kernel_verdict_expires_at)
1534
+ ? fromJsonTimestamp(object.kernel_verdict_expires_at)
1535
+ : undefined,
1536
+ effectPermitRef: isSet(object.effectPermitRef)
1537
+ ? globalThis.String(object.effectPermitRef)
1538
+ : isSet(object.effect_permit_ref)
1539
+ ? globalThis.String(object.effect_permit_ref)
1540
+ : "",
1541
+ permitNonce: isSet(object.permitNonce)
1542
+ ? globalThis.String(object.permitNonce)
1543
+ : isSet(object.permit_nonce)
1544
+ ? globalThis.String(object.permit_nonce)
1545
+ : "",
1546
+ permitExpiry: isSet(object.permitExpiry)
1547
+ ? fromJsonTimestamp(object.permitExpiry)
1548
+ : isSet(object.permit_expiry)
1549
+ ? fromJsonTimestamp(object.permit_expiry)
1550
+ : undefined,
1551
+ proofSessionRef: isSet(object.proofSessionRef)
1552
+ ? globalThis.String(object.proofSessionRef)
1553
+ : isSet(object.proof_session_ref)
1554
+ ? globalThis.String(object.proof_session_ref)
1555
+ : "",
1556
+ evidenceReservationRef: isSet(object.evidenceReservationRef)
1557
+ ? globalThis.String(object.evidenceReservationRef)
1558
+ : isSet(object.evidence_reservation_ref)
1559
+ ? globalThis.String(object.evidence_reservation_ref)
1560
+ : "",
1561
+ budgetReservationRef: isSet(object.budgetReservationRef)
1562
+ ? globalThis.String(object.budgetReservationRef)
1563
+ : isSet(object.budget_reservation_ref)
1564
+ ? globalThis.String(object.budget_reservation_ref)
1565
+ : "",
1566
+ cachePolicy: isSet(object.cachePolicy)
1567
+ ? globalThis.String(object.cachePolicy)
1568
+ : isSet(object.cache_policy)
1569
+ ? globalThis.String(object.cache_policy)
1570
+ : "",
1571
+ replayHint: isSet(object.replayHint)
1572
+ ? globalThis.String(object.replayHint)
1573
+ : isSet(object.replay_hint)
1574
+ ? globalThis.String(object.replay_hint)
1575
+ : "",
1576
+ denialReceiptRef: isSet(object.denialReceiptRef)
1577
+ ? globalThis.String(object.denialReceiptRef)
1578
+ : isSet(object.denial_receipt_ref)
1579
+ ? globalThis.String(object.denial_receipt_ref)
1580
+ : "",
1581
+ escalationRef: isSet(object.escalationRef)
1582
+ ? globalThis.String(object.escalationRef)
1583
+ : isSet(object.escalation_ref)
1584
+ ? globalThis.String(object.escalation_ref)
1585
+ : "",
1586
+ escalationReceiptRef: isSet(object.escalationReceiptRef)
1587
+ ? globalThis.String(object.escalationReceiptRef)
1588
+ : isSet(object.escalation_receipt_ref)
1589
+ ? globalThis.String(object.escalation_receipt_ref)
1590
+ : "",
1591
+ proofObligation: isSet(object.proofObligation)
1592
+ ? globalThis.String(object.proofObligation)
1593
+ : isSet(object.proof_obligation)
1594
+ ? globalThis.String(object.proof_obligation)
1595
+ : "",
1596
+ connectorReceiptPolicy: isSet(object.connectorReceiptPolicy)
1597
+ ? globalThis.String(object.connectorReceiptPolicy)
1598
+ : isSet(object.connector_receipt_policy)
1599
+ ? globalThis.String(object.connector_receipt_policy)
1600
+ : "",
1601
+ proofFinalizationPolicy: isSet(object.proofFinalizationPolicy)
1602
+ ? globalThis.String(object.proofFinalizationPolicy)
1603
+ : isSet(object.proof_finalization_policy)
1604
+ ? globalThis.String(object.proof_finalization_policy)
1605
+ : "",
1606
+ };
1607
+ },
1608
+ toJSON(message) {
1609
+ const obj = {};
1610
+ if (message.schemaVersion !== "") {
1611
+ obj.schemaVersion = message.schemaVersion;
1612
+ }
1613
+ if (message.contractVersion !== "") {
1614
+ obj.contractVersion = message.contractVersion;
1615
+ }
1616
+ if (message.requestId !== "") {
1617
+ obj.requestId = message.requestId;
1618
+ }
1619
+ if (message.tenantId !== "") {
1620
+ obj.tenantId = message.tenantId;
1621
+ }
1622
+ if (message.workspaceId !== "") {
1623
+ obj.workspaceId = message.workspaceId;
1624
+ }
1625
+ if (message.principalId !== "") {
1626
+ obj.principalId = message.principalId;
1627
+ }
1628
+ if (message.principalSeq !== 0) {
1629
+ obj.principalSeq = Math.round(message.principalSeq);
1630
+ }
1631
+ if (message.agentIdentityProfileRef !== "") {
1632
+ obj.agentIdentityProfileRef = message.agentIdentityProfileRef;
1633
+ }
1634
+ if (message.protocol !== 0) {
1635
+ obj.protocol = protocolToJSON(message.protocol);
1636
+ }
1637
+ if (message.actionUrn !== "") {
1638
+ obj.actionUrn = message.actionUrn;
1639
+ }
1640
+ if (message.toolUrn !== "") {
1641
+ obj.toolUrn = message.toolUrn;
1642
+ }
1643
+ if (message.connectorId !== "") {
1644
+ obj.connectorId = message.connectorId;
1645
+ }
1646
+ if (message.connectorContractHash !== "") {
1647
+ obj.connectorContractHash = message.connectorContractHash;
1648
+ }
1649
+ if (message.executorKind !== "") {
1650
+ obj.executorKind = message.executorKind;
1651
+ }
1652
+ if (message.effectClass !== "") {
1653
+ obj.effectClass = message.effectClass;
1654
+ }
1655
+ if (message.riskClass !== "") {
1656
+ obj.riskClass = message.riskClass;
1657
+ }
1658
+ if (message.argsC14nHash !== "") {
1659
+ obj.argsC14nHash = message.argsC14nHash;
1660
+ }
1661
+ if (message.requestBodyHash !== "") {
1662
+ obj.requestBodyHash = message.requestBodyHash;
1663
+ }
1664
+ if (message.planHash !== "") {
1665
+ obj.planHash = message.planHash;
1666
+ }
1667
+ if (message.policyHash !== "") {
1668
+ obj.policyHash = message.policyHash;
1669
+ }
1670
+ if (message.p0Hash !== "") {
1671
+ obj.p0Hash = message.p0Hash;
1672
+ }
1673
+ if (message.policyEpoch !== "") {
1674
+ obj.policyEpoch = message.policyEpoch;
1675
+ }
1676
+ if (message.idempotencyKeyCandidate !== "") {
1677
+ obj.idempotencyKeyCandidate = message.idempotencyKeyCandidate;
1678
+ }
1679
+ if (message.payloadClass !== "") {
1680
+ obj.payloadClass = message.payloadClass;
1681
+ }
1682
+ if (message.redactionProfile !== "") {
1683
+ obj.redactionProfile = message.redactionProfile;
1684
+ }
1685
+ if (message.upstreamTraceId !== "") {
1686
+ obj.upstreamTraceId = message.upstreamTraceId;
1687
+ }
1688
+ if (message.upstreamRunId !== "") {
1689
+ obj.upstreamRunId = message.upstreamRunId;
1690
+ }
1691
+ if (message.deadlineMs !== 0) {
1692
+ obj.deadlineMs = Math.round(message.deadlineMs);
1693
+ }
1694
+ if (message.riskContextHash !== "") {
1695
+ obj.riskContextHash = message.riskContextHash;
1696
+ }
1697
+ if (message.verdict !== 0) {
1698
+ obj.verdict = verdictToJSON(message.verdict);
1699
+ }
1700
+ if (message.reasonCode !== "") {
1701
+ obj.reasonCode = message.reasonCode;
1702
+ }
1703
+ if (message.kernelTrustRootId !== "") {
1704
+ obj.kernelTrustRootId = message.kernelTrustRootId;
1705
+ }
1706
+ if (message.signingKeyRef !== "") {
1707
+ obj.signingKeyRef = message.signingKeyRef;
1708
+ }
1709
+ if (message.kernelVerdictRef !== "") {
1710
+ obj.kernelVerdictRef = message.kernelVerdictRef;
1711
+ }
1712
+ if (message.kernelVerdictHash !== "") {
1713
+ obj.kernelVerdictHash = message.kernelVerdictHash;
1714
+ }
1715
+ if (message.kernelVerdictSignature.length !== 0) {
1716
+ obj.kernelVerdictSignature = base64FromBytes(message.kernelVerdictSignature);
1717
+ }
1718
+ if (message.kernelVerdictIssuedAt !== undefined) {
1719
+ obj.kernelVerdictIssuedAt = message.kernelVerdictIssuedAt.toISOString();
1720
+ }
1721
+ if (message.kernelVerdictExpiresAt !== undefined) {
1722
+ obj.kernelVerdictExpiresAt = message.kernelVerdictExpiresAt.toISOString();
1723
+ }
1724
+ if (message.effectPermitRef !== "") {
1725
+ obj.effectPermitRef = message.effectPermitRef;
1726
+ }
1727
+ if (message.permitNonce !== "") {
1728
+ obj.permitNonce = message.permitNonce;
1729
+ }
1730
+ if (message.permitExpiry !== undefined) {
1731
+ obj.permitExpiry = message.permitExpiry.toISOString();
1732
+ }
1733
+ if (message.proofSessionRef !== "") {
1734
+ obj.proofSessionRef = message.proofSessionRef;
1735
+ }
1736
+ if (message.evidenceReservationRef !== "") {
1737
+ obj.evidenceReservationRef = message.evidenceReservationRef;
1738
+ }
1739
+ if (message.budgetReservationRef !== "") {
1740
+ obj.budgetReservationRef = message.budgetReservationRef;
1741
+ }
1742
+ if (message.cachePolicy !== "") {
1743
+ obj.cachePolicy = message.cachePolicy;
1744
+ }
1745
+ if (message.replayHint !== "") {
1746
+ obj.replayHint = message.replayHint;
1747
+ }
1748
+ if (message.denialReceiptRef !== "") {
1749
+ obj.denialReceiptRef = message.denialReceiptRef;
1750
+ }
1751
+ if (message.escalationRef !== "") {
1752
+ obj.escalationRef = message.escalationRef;
1753
+ }
1754
+ if (message.escalationReceiptRef !== "") {
1755
+ obj.escalationReceiptRef = message.escalationReceiptRef;
1756
+ }
1757
+ if (message.proofObligation !== "") {
1758
+ obj.proofObligation = message.proofObligation;
1759
+ }
1760
+ if (message.connectorReceiptPolicy !== "") {
1761
+ obj.connectorReceiptPolicy = message.connectorReceiptPolicy;
1762
+ }
1763
+ if (message.proofFinalizationPolicy !== "") {
1764
+ obj.proofFinalizationPolicy = message.proofFinalizationPolicy;
1765
+ }
1766
+ return obj;
1767
+ },
1768
+ create(base) {
1769
+ return AuthorizationResponse.fromPartial(base ?? {});
1770
+ },
1771
+ fromPartial(object) {
1772
+ const message = createBaseAuthorizationResponse();
1773
+ message.schemaVersion = object.schemaVersion ?? "";
1774
+ message.contractVersion = object.contractVersion ?? "";
1775
+ message.requestId = object.requestId ?? "";
1776
+ message.tenantId = object.tenantId ?? "";
1777
+ message.workspaceId = object.workspaceId ?? "";
1778
+ message.principalId = object.principalId ?? "";
1779
+ message.principalSeq = object.principalSeq ?? 0;
1780
+ message.agentIdentityProfileRef = object.agentIdentityProfileRef ?? "";
1781
+ message.protocol = object.protocol ?? 0;
1782
+ message.actionUrn = object.actionUrn ?? "";
1783
+ message.toolUrn = object.toolUrn ?? "";
1784
+ message.connectorId = object.connectorId ?? "";
1785
+ message.connectorContractHash = object.connectorContractHash ?? "";
1786
+ message.executorKind = object.executorKind ?? "";
1787
+ message.effectClass = object.effectClass ?? "";
1788
+ message.riskClass = object.riskClass ?? "";
1789
+ message.argsC14nHash = object.argsC14nHash ?? "";
1790
+ message.requestBodyHash = object.requestBodyHash ?? "";
1791
+ message.planHash = object.planHash ?? "";
1792
+ message.policyHash = object.policyHash ?? "";
1793
+ message.p0Hash = object.p0Hash ?? "";
1794
+ message.policyEpoch = object.policyEpoch ?? "";
1795
+ message.idempotencyKeyCandidate = object.idempotencyKeyCandidate ?? "";
1796
+ message.payloadClass = object.payloadClass ?? "";
1797
+ message.redactionProfile = object.redactionProfile ?? "";
1798
+ message.upstreamTraceId = object.upstreamTraceId ?? "";
1799
+ message.upstreamRunId = object.upstreamRunId ?? "";
1800
+ message.deadlineMs = object.deadlineMs ?? 0;
1801
+ message.riskContextHash = object.riskContextHash ?? "";
1802
+ message.verdict = object.verdict ?? 0;
1803
+ message.reasonCode = object.reasonCode ?? "";
1804
+ message.kernelTrustRootId = object.kernelTrustRootId ?? "";
1805
+ message.signingKeyRef = object.signingKeyRef ?? "";
1806
+ message.kernelVerdictRef = object.kernelVerdictRef ?? "";
1807
+ message.kernelVerdictHash = object.kernelVerdictHash ?? "";
1808
+ message.kernelVerdictSignature = object.kernelVerdictSignature ?? new Uint8Array(0);
1809
+ message.kernelVerdictIssuedAt = object.kernelVerdictIssuedAt ?? undefined;
1810
+ message.kernelVerdictExpiresAt = object.kernelVerdictExpiresAt ?? undefined;
1811
+ message.effectPermitRef = object.effectPermitRef ?? "";
1812
+ message.permitNonce = object.permitNonce ?? "";
1813
+ message.permitExpiry = object.permitExpiry ?? undefined;
1814
+ message.proofSessionRef = object.proofSessionRef ?? "";
1815
+ message.evidenceReservationRef = object.evidenceReservationRef ?? "";
1816
+ message.budgetReservationRef = object.budgetReservationRef ?? "";
1817
+ message.cachePolicy = object.cachePolicy ?? "";
1818
+ message.replayHint = object.replayHint ?? "";
1819
+ message.denialReceiptRef = object.denialReceiptRef ?? "";
1820
+ message.escalationRef = object.escalationRef ?? "";
1821
+ message.escalationReceiptRef = object.escalationReceiptRef ?? "";
1822
+ message.proofObligation = object.proofObligation ?? "";
1823
+ message.connectorReceiptPolicy = object.connectorReceiptPolicy ?? "";
1824
+ message.proofFinalizationPolicy = object.proofFinalizationPolicy ?? "";
1825
+ return message;
1826
+ },
1827
+ };
1828
+ export const ExternalAuthorizationServiceService = {
1829
+ authorize: {
1830
+ path: "/helm.boundary.extauthz.v1.ExternalAuthorizationService/Authorize",
1831
+ requestStream: false,
1832
+ responseStream: false,
1833
+ requestSerialize: (value) => Buffer.from(AuthorizationRequest.encode(value).finish()),
1834
+ requestDeserialize: (value) => AuthorizationRequest.decode(value),
1835
+ responseSerialize: (value) => Buffer.from(AuthorizationResponse.encode(value).finish()),
1836
+ responseDeserialize: (value) => AuthorizationResponse.decode(value),
1837
+ },
1838
+ };
1839
+ export const ExternalAuthorizationServiceClient = makeGenericClientConstructor(ExternalAuthorizationServiceService, "helm.boundary.extauthz.v1.ExternalAuthorizationService");
1840
+ function bytesFromBase64(b64) {
1841
+ if (globalThis.Buffer) {
1842
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1843
+ }
1844
+ else {
1845
+ const bin = globalThis.atob(b64);
1846
+ const arr = new Uint8Array(bin.length);
1847
+ for (let i = 0; i < bin.length; ++i) {
1848
+ arr[i] = bin.charCodeAt(i);
1849
+ }
1850
+ return arr;
1851
+ }
1852
+ }
1853
+ function base64FromBytes(arr) {
1854
+ if (globalThis.Buffer) {
1855
+ return globalThis.Buffer.from(arr).toString("base64");
1856
+ }
1857
+ else {
1858
+ const bin = [];
1859
+ arr.forEach((byte) => {
1860
+ bin.push(globalThis.String.fromCharCode(byte));
1861
+ });
1862
+ return globalThis.btoa(bin.join(""));
1863
+ }
1864
+ }
1865
+ function toTimestamp(date) {
1866
+ const seconds = Math.trunc(date.getTime() / 1_000);
1867
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
1868
+ return { seconds, nanos };
1869
+ }
1870
+ function fromTimestamp(t) {
1871
+ let millis = (t.seconds || 0) * 1_000;
1872
+ millis += (t.nanos || 0) / 1_000_000;
1873
+ return new globalThis.Date(millis);
1874
+ }
1875
+ function fromJsonTimestamp(o) {
1876
+ if (o instanceof globalThis.Date) {
1877
+ return o;
1878
+ }
1879
+ else if (typeof o === "string") {
1880
+ return new globalThis.Date(o);
1881
+ }
1882
+ else {
1883
+ return fromTimestamp(Timestamp.fromJSON(o));
1884
+ }
1885
+ }
1886
+ function longToNumber(int64) {
1887
+ const num = globalThis.Number(int64.toString());
1888
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
1889
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1890
+ }
1891
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
1892
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1893
+ }
1894
+ return num;
1895
+ }
1896
+ function isObject(value) {
1897
+ return typeof value === "object" && value !== null;
1898
+ }
1899
+ function isSet(value) {
1900
+ return value !== null && value !== undefined;
1901
+ }