@spendguard/sdk 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/proto.js ADDED
@@ -0,0 +1,3055 @@
1
+ import { MessageType, PbLong, typeofJsonValue, isJsonObject } from '@protobuf-ts/runtime';
2
+ import { ServiceType, stackIntercept } from '@protobuf-ts/runtime-rpc';
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+
10
+ // src/_proto/spendguard/common/v1/common.ts
11
+ var common_exports = {};
12
+ __export(common_exports, {
13
+ Amount: () => Amount,
14
+ BudgetClaim: () => BudgetClaim,
15
+ BudgetClaim_Direction: () => BudgetClaim_Direction,
16
+ CloudEvent: () => CloudEvent,
17
+ ContractBundleRef: () => ContractBundleRef,
18
+ Error: () => Error2,
19
+ Error_Code: () => Error_Code,
20
+ Fencing: () => Fencing,
21
+ FullResponsePayload: () => FullResponsePayload,
22
+ Idempotency: () => Idempotency,
23
+ LockOrderToken: () => LockOrderToken,
24
+ PricingFreeze: () => PricingFreeze,
25
+ Replay: () => Replay,
26
+ Replay_StatusCode: () => Replay_StatusCode,
27
+ ReservationSource: () => ReservationSource,
28
+ SchemaBundleRef: () => SchemaBundleRef,
29
+ SpendGuardIds: () => SpendGuardIds,
30
+ SubscriptionMeter: () => SubscriptionMeter,
31
+ SubscriptionMeter_CapDecision: () => SubscriptionMeter_CapDecision,
32
+ TraceContext: () => TraceContext,
33
+ UnitRef: () => UnitRef,
34
+ UnitRef_Kind: () => UnitRef_Kind
35
+ });
36
+ var Timestamp$Type = class extends MessageType {
37
+ constructor() {
38
+ super("google.protobuf.Timestamp", [
39
+ {
40
+ no: 1,
41
+ name: "seconds",
42
+ kind: "scalar",
43
+ T: 3
44
+ /*ScalarType.INT64*/
45
+ },
46
+ {
47
+ no: 2,
48
+ name: "nanos",
49
+ kind: "scalar",
50
+ T: 5
51
+ /*ScalarType.INT32*/
52
+ }
53
+ ]);
54
+ }
55
+ /**
56
+ * Creates a new `Timestamp` for the current time.
57
+ */
58
+ now() {
59
+ const msg = this.create();
60
+ const ms = Date.now();
61
+ msg.seconds = PbLong.from(Math.floor(ms / 1e3)).toString();
62
+ msg.nanos = ms % 1e3 * 1e6;
63
+ return msg;
64
+ }
65
+ /**
66
+ * Converts a `Timestamp` to a JavaScript Date.
67
+ */
68
+ toDate(message) {
69
+ return new Date(PbLong.from(message.seconds).toNumber() * 1e3 + Math.ceil(message.nanos / 1e6));
70
+ }
71
+ /**
72
+ * Converts a JavaScript Date to a `Timestamp`.
73
+ */
74
+ fromDate(date) {
75
+ const msg = this.create();
76
+ const ms = date.getTime();
77
+ msg.seconds = PbLong.from(Math.floor(ms / 1e3)).toString();
78
+ msg.nanos = (ms % 1e3 + (ms < 0 && ms % 1e3 !== 0 ? 1e3 : 0)) * 1e6;
79
+ return msg;
80
+ }
81
+ /**
82
+ * In JSON format, the `Timestamp` type is encoded as a string
83
+ * in the RFC 3339 format.
84
+ */
85
+ internalJsonWrite(message, options) {
86
+ let ms = PbLong.from(message.seconds).toNumber() * 1e3;
87
+ if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
88
+ throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
89
+ if (message.nanos < 0)
90
+ throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");
91
+ let z = "Z";
92
+ if (message.nanos > 0) {
93
+ let nanosStr = (message.nanos + 1e9).toString().substring(1);
94
+ if (nanosStr.substring(3) === "000000")
95
+ z = "." + nanosStr.substring(0, 3) + "Z";
96
+ else if (nanosStr.substring(6) === "000")
97
+ z = "." + nanosStr.substring(0, 6) + "Z";
98
+ else
99
+ z = "." + nanosStr + "Z";
100
+ }
101
+ return new Date(ms).toISOString().replace(".000Z", z);
102
+ }
103
+ /**
104
+ * In JSON format, the `Timestamp` type is encoded as a string
105
+ * in the RFC 3339 format.
106
+ */
107
+ internalJsonRead(json, options, target) {
108
+ if (typeof json !== "string")
109
+ throw new Error("Unable to parse Timestamp from JSON " + typeofJsonValue(json) + ".");
110
+ let matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);
111
+ if (!matches)
112
+ throw new Error("Unable to parse Timestamp from JSON. Invalid format.");
113
+ let ms = Date.parse(matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z"));
114
+ if (Number.isNaN(ms))
115
+ throw new Error("Unable to parse Timestamp from JSON. Invalid value.");
116
+ if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
117
+ throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
118
+ if (!target)
119
+ target = this.create();
120
+ target.seconds = PbLong.from(ms / 1e3).toString();
121
+ target.nanos = 0;
122
+ if (matches[7])
123
+ target.nanos = parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1e9;
124
+ return target;
125
+ }
126
+ };
127
+ var Timestamp = new Timestamp$Type();
128
+
129
+ // src/_proto/spendguard/common/v1/common.ts
130
+ var UnitRef_Kind = /* @__PURE__ */ ((UnitRef_Kind2) => {
131
+ UnitRef_Kind2[UnitRef_Kind2["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
132
+ UnitRef_Kind2[UnitRef_Kind2["MONETARY"] = 1] = "MONETARY";
133
+ UnitRef_Kind2[UnitRef_Kind2["TOKEN"] = 2] = "TOKEN";
134
+ UnitRef_Kind2[UnitRef_Kind2["CREDIT"] = 3] = "CREDIT";
135
+ UnitRef_Kind2[UnitRef_Kind2["NON_MONETARY"] = 4] = "NON_MONETARY";
136
+ return UnitRef_Kind2;
137
+ })(UnitRef_Kind || {});
138
+ var Replay_StatusCode = /* @__PURE__ */ ((Replay_StatusCode2) => {
139
+ Replay_StatusCode2[Replay_StatusCode2["STATUS_CODE_UNSPECIFIED"] = 0] = "STATUS_CODE_UNSPECIFIED";
140
+ Replay_StatusCode2[Replay_StatusCode2["POSTED"] = 1] = "POSTED";
141
+ Replay_StatusCode2[Replay_StatusCode2["VOIDED"] = 2] = "VOIDED";
142
+ Replay_StatusCode2[Replay_StatusCode2["PENDING"] = 3] = "PENDING";
143
+ return Replay_StatusCode2;
144
+ })(Replay_StatusCode || {});
145
+ var Error_Code = /* @__PURE__ */ ((Error_Code2) => {
146
+ Error_Code2[Error_Code2["CODE_UNSPECIFIED"] = 0] = "CODE_UNSPECIFIED";
147
+ Error_Code2[Error_Code2["FENCING_EPOCH_STALE"] = 1] = "FENCING_EPOCH_STALE";
148
+ Error_Code2[Error_Code2["LOCK_ORDER_TOKEN_MISMATCH"] = 2] = "LOCK_ORDER_TOKEN_MISMATCH";
149
+ Error_Code2[Error_Code2["PRICING_VERSION_UNKNOWN"] = 3] = "PRICING_VERSION_UNKNOWN";
150
+ Error_Code2[Error_Code2["UNIT_NORMALIZATION_REQUIRED"] = 4] = "UNIT_NORMALIZATION_REQUIRED";
151
+ Error_Code2[Error_Code2["BUDGET_EXHAUSTED"] = 5] = "BUDGET_EXHAUSTED";
152
+ Error_Code2[Error_Code2["DEADLOCK_TIMEOUT"] = 6] = "DEADLOCK_TIMEOUT";
153
+ Error_Code2[Error_Code2["SYNC_REPLICA_UNAVAILABLE"] = 7] = "SYNC_REPLICA_UNAVAILABLE";
154
+ Error_Code2[Error_Code2["TENANT_DISABLED"] = 8] = "TENANT_DISABLED";
155
+ Error_Code2[Error_Code2["SCHEMA_BUNDLE_UNKNOWN"] = 9] = "SCHEMA_BUNDLE_UNKNOWN";
156
+ Error_Code2[Error_Code2["SIGNATURE_INVALID"] = 10] = "SIGNATURE_INVALID";
157
+ Error_Code2[Error_Code2["AUDIT_INVARIANT_VIOLATED"] = 11] = "AUDIT_INVARIANT_VIOLATED";
158
+ Error_Code2[Error_Code2["DUPLICATE_DECISION_EVENT"] = 12] = "DUPLICATE_DECISION_EVENT";
159
+ Error_Code2[Error_Code2["RESERVATION_STATE_CONFLICT"] = 13] = "RESERVATION_STATE_CONFLICT";
160
+ Error_Code2[Error_Code2["PRICING_FREEZE_MISMATCH"] = 14] = "PRICING_FREEZE_MISMATCH";
161
+ Error_Code2[Error_Code2["OVERRUN_RESERVATION"] = 15] = "OVERRUN_RESERVATION";
162
+ Error_Code2[Error_Code2["RESERVATION_TTL_EXPIRED"] = 16] = "RESERVATION_TTL_EXPIRED";
163
+ Error_Code2[Error_Code2["MULTI_RESERVATION_COMMIT_DEFERRED"] = 17] = "MULTI_RESERVATION_COMMIT_DEFERRED";
164
+ Error_Code2[Error_Code2["IDEMPOTENCY_CONFLICT"] = 18] = "IDEMPOTENCY_CONFLICT";
165
+ return Error_Code2;
166
+ })(Error_Code || {});
167
+ var BudgetClaim_Direction = /* @__PURE__ */ ((BudgetClaim_Direction2) => {
168
+ BudgetClaim_Direction2[BudgetClaim_Direction2["DIRECTION_UNSPECIFIED"] = 0] = "DIRECTION_UNSPECIFIED";
169
+ BudgetClaim_Direction2[BudgetClaim_Direction2["DEBIT"] = 1] = "DEBIT";
170
+ BudgetClaim_Direction2[BudgetClaim_Direction2["CREDIT"] = 2] = "CREDIT";
171
+ return BudgetClaim_Direction2;
172
+ })(BudgetClaim_Direction || {});
173
+ var SubscriptionMeter_CapDecision = /* @__PURE__ */ ((SubscriptionMeter_CapDecision2) => {
174
+ SubscriptionMeter_CapDecision2[SubscriptionMeter_CapDecision2["CAP_DECISION_UNSPECIFIED"] = 0] = "CAP_DECISION_UNSPECIFIED";
175
+ SubscriptionMeter_CapDecision2[SubscriptionMeter_CapDecision2["CAP_PASS"] = 1] = "CAP_PASS";
176
+ SubscriptionMeter_CapDecision2[SubscriptionMeter_CapDecision2["CAP_SOFT_ALERT"] = 2] = "CAP_SOFT_ALERT";
177
+ SubscriptionMeter_CapDecision2[SubscriptionMeter_CapDecision2["CAP_HARD_BLOCK"] = 3] = "CAP_HARD_BLOCK";
178
+ return SubscriptionMeter_CapDecision2;
179
+ })(SubscriptionMeter_CapDecision || {});
180
+ var ReservationSource = /* @__PURE__ */ ((ReservationSource2) => {
181
+ ReservationSource2[ReservationSource2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
182
+ ReservationSource2[ReservationSource2["BYOK"] = 1] = "BYOK";
183
+ ReservationSource2[ReservationSource2["SUBSCRIPTION_METER"] = 2] = "SUBSCRIPTION_METER";
184
+ return ReservationSource2;
185
+ })(ReservationSource || {});
186
+ var TraceContext$Type = class extends MessageType {
187
+ constructor() {
188
+ super("spendguard.common.v1.TraceContext", [
189
+ {
190
+ no: 1,
191
+ name: "trace_id",
192
+ kind: "scalar",
193
+ T: 9
194
+ /*ScalarType.STRING*/
195
+ },
196
+ {
197
+ no: 2,
198
+ name: "span_id",
199
+ kind: "scalar",
200
+ T: 9
201
+ /*ScalarType.STRING*/
202
+ },
203
+ {
204
+ no: 3,
205
+ name: "parent_span_id",
206
+ kind: "scalar",
207
+ T: 9
208
+ /*ScalarType.STRING*/
209
+ },
210
+ {
211
+ no: 4,
212
+ name: "trace_state",
213
+ kind: "scalar",
214
+ T: 9
215
+ /*ScalarType.STRING*/
216
+ }
217
+ ]);
218
+ }
219
+ };
220
+ var TraceContext = new TraceContext$Type();
221
+ var SpendGuardIds$Type = class extends MessageType {
222
+ constructor() {
223
+ super("spendguard.common.v1.SpendGuardIds", [
224
+ {
225
+ no: 1,
226
+ name: "run_id",
227
+ kind: "scalar",
228
+ T: 9
229
+ /*ScalarType.STRING*/
230
+ },
231
+ {
232
+ no: 2,
233
+ name: "step_id",
234
+ kind: "scalar",
235
+ T: 9
236
+ /*ScalarType.STRING*/
237
+ },
238
+ {
239
+ no: 3,
240
+ name: "llm_call_id",
241
+ kind: "scalar",
242
+ T: 9
243
+ /*ScalarType.STRING*/
244
+ },
245
+ {
246
+ no: 4,
247
+ name: "tool_call_id",
248
+ kind: "scalar",
249
+ T: 9
250
+ /*ScalarType.STRING*/
251
+ },
252
+ {
253
+ no: 5,
254
+ name: "decision_id",
255
+ kind: "scalar",
256
+ T: 9
257
+ /*ScalarType.STRING*/
258
+ },
259
+ {
260
+ no: 6,
261
+ name: "snapshot_id",
262
+ kind: "scalar",
263
+ T: 9
264
+ /*ScalarType.STRING*/
265
+ }
266
+ ]);
267
+ }
268
+ };
269
+ var SpendGuardIds = new SpendGuardIds$Type();
270
+ var UnitRef$Type = class extends MessageType {
271
+ constructor() {
272
+ super("spendguard.common.v1.UnitRef", [
273
+ {
274
+ no: 1,
275
+ name: "unit_id",
276
+ kind: "scalar",
277
+ T: 9
278
+ /*ScalarType.STRING*/
279
+ },
280
+ { no: 2, name: "kind", kind: "enum", T: () => ["spendguard.common.v1.UnitRef.Kind", UnitRef_Kind] },
281
+ {
282
+ no: 3,
283
+ name: "currency",
284
+ kind: "scalar",
285
+ T: 9
286
+ /*ScalarType.STRING*/
287
+ },
288
+ {
289
+ no: 4,
290
+ name: "unit_name",
291
+ kind: "scalar",
292
+ T: 9
293
+ /*ScalarType.STRING*/
294
+ },
295
+ {
296
+ no: 5,
297
+ name: "token_kind",
298
+ kind: "scalar",
299
+ T: 9
300
+ /*ScalarType.STRING*/
301
+ },
302
+ {
303
+ no: 6,
304
+ name: "model_family",
305
+ kind: "scalar",
306
+ T: 9
307
+ /*ScalarType.STRING*/
308
+ },
309
+ {
310
+ no: 7,
311
+ name: "credit_program",
312
+ kind: "scalar",
313
+ T: 9
314
+ /*ScalarType.STRING*/
315
+ }
316
+ ]);
317
+ }
318
+ };
319
+ var UnitRef = new UnitRef$Type();
320
+ var Amount$Type = class extends MessageType {
321
+ constructor() {
322
+ super("spendguard.common.v1.Amount", [
323
+ {
324
+ no: 1,
325
+ name: "atomic",
326
+ kind: "scalar",
327
+ T: 9
328
+ /*ScalarType.STRING*/
329
+ },
330
+ { no: 2, name: "unit", kind: "message", T: () => UnitRef }
331
+ ]);
332
+ }
333
+ };
334
+ var Amount = new Amount$Type();
335
+ var PricingFreeze$Type = class extends MessageType {
336
+ constructor() {
337
+ super("spendguard.common.v1.PricingFreeze", [
338
+ {
339
+ no: 1,
340
+ name: "pricing_version",
341
+ kind: "scalar",
342
+ T: 9
343
+ /*ScalarType.STRING*/
344
+ },
345
+ {
346
+ no: 2,
347
+ name: "price_snapshot_hash",
348
+ kind: "scalar",
349
+ T: 12
350
+ /*ScalarType.BYTES*/
351
+ },
352
+ {
353
+ no: 3,
354
+ name: "fx_rate_version",
355
+ kind: "scalar",
356
+ T: 9
357
+ /*ScalarType.STRING*/
358
+ },
359
+ {
360
+ no: 4,
361
+ name: "unit_conversion_version",
362
+ kind: "scalar",
363
+ T: 9
364
+ /*ScalarType.STRING*/
365
+ }
366
+ ]);
367
+ }
368
+ };
369
+ var PricingFreeze = new PricingFreeze$Type();
370
+ var Fencing$Type = class extends MessageType {
371
+ constructor() {
372
+ super("spendguard.common.v1.Fencing", [
373
+ {
374
+ no: 1,
375
+ name: "epoch",
376
+ kind: "scalar",
377
+ T: 4
378
+ /*ScalarType.UINT64*/
379
+ },
380
+ {
381
+ no: 2,
382
+ name: "scope_id",
383
+ kind: "scalar",
384
+ T: 9
385
+ /*ScalarType.STRING*/
386
+ },
387
+ {
388
+ no: 3,
389
+ name: "workload_instance_id",
390
+ kind: "scalar",
391
+ T: 9
392
+ /*ScalarType.STRING*/
393
+ }
394
+ ]);
395
+ }
396
+ };
397
+ var Fencing = new Fencing$Type();
398
+ var Replay$Type = class extends MessageType {
399
+ constructor() {
400
+ super("spendguard.common.v1.Replay", [
401
+ {
402
+ no: 1,
403
+ name: "ledger_transaction_id",
404
+ kind: "scalar",
405
+ T: 9
406
+ /*ScalarType.STRING*/
407
+ },
408
+ {
409
+ no: 2,
410
+ name: "operation_kind",
411
+ kind: "scalar",
412
+ T: 9
413
+ /*ScalarType.STRING*/
414
+ },
415
+ {
416
+ no: 3,
417
+ name: "audit_decision_event_id",
418
+ kind: "scalar",
419
+ T: 9
420
+ /*ScalarType.STRING*/
421
+ },
422
+ { no: 4, name: "recorded_at", kind: "message", T: () => Timestamp },
423
+ {
424
+ no: 5,
425
+ name: "operation_id",
426
+ kind: "scalar",
427
+ T: 9
428
+ /*ScalarType.STRING*/
429
+ },
430
+ { no: 6, name: "status_code", kind: "enum", T: () => ["spendguard.common.v1.Replay.StatusCode", Replay_StatusCode] },
431
+ {
432
+ no: 7,
433
+ name: "decision_id",
434
+ kind: "scalar",
435
+ T: 9
436
+ /*ScalarType.STRING*/
437
+ },
438
+ {
439
+ no: 8,
440
+ name: "projection_ids",
441
+ kind: "scalar",
442
+ repeat: 2,
443
+ T: 9
444
+ /*ScalarType.STRING*/
445
+ },
446
+ { no: 9, name: "ttl_expires_at", kind: "message", T: () => Timestamp }
447
+ ]);
448
+ }
449
+ };
450
+ var Replay = new Replay$Type();
451
+ var FullResponsePayload$Type = class extends MessageType {
452
+ constructor() {
453
+ super("spendguard.common.v1.FullResponsePayload", [
454
+ {
455
+ no: 1,
456
+ name: "payload",
457
+ kind: "scalar",
458
+ T: 12
459
+ /*ScalarType.BYTES*/
460
+ },
461
+ { no: 2, name: "expires_at", kind: "message", T: () => Timestamp }
462
+ ]);
463
+ }
464
+ };
465
+ var FullResponsePayload = new FullResponsePayload$Type();
466
+ var Error$Type = class extends MessageType {
467
+ constructor() {
468
+ super("spendguard.common.v1.Error", [
469
+ { no: 1, name: "code", kind: "enum", T: () => ["spendguard.common.v1.Error.Code", Error_Code] },
470
+ {
471
+ no: 2,
472
+ name: "message",
473
+ kind: "scalar",
474
+ T: 9
475
+ /*ScalarType.STRING*/
476
+ },
477
+ { no: 3, name: "details", kind: "map", K: 9, V: {
478
+ kind: "scalar",
479
+ T: 9
480
+ /*ScalarType.STRING*/
481
+ } }
482
+ ]);
483
+ }
484
+ };
485
+ var Error2 = new Error$Type();
486
+ var BudgetClaim$Type = class extends MessageType {
487
+ constructor() {
488
+ super("spendguard.common.v1.BudgetClaim", [
489
+ {
490
+ no: 1,
491
+ name: "budget_id",
492
+ kind: "scalar",
493
+ T: 9
494
+ /*ScalarType.STRING*/
495
+ },
496
+ { no: 2, name: "unit", kind: "message", T: () => UnitRef },
497
+ {
498
+ no: 3,
499
+ name: "amount_atomic",
500
+ kind: "scalar",
501
+ T: 9
502
+ /*ScalarType.STRING*/
503
+ },
504
+ { no: 4, name: "direction", kind: "enum", T: () => ["spendguard.common.v1.BudgetClaim.Direction", BudgetClaim_Direction] },
505
+ {
506
+ no: 5,
507
+ name: "window_instance_id",
508
+ kind: "scalar",
509
+ T: 9
510
+ /*ScalarType.STRING*/
511
+ }
512
+ ]);
513
+ }
514
+ };
515
+ var BudgetClaim = new BudgetClaim$Type();
516
+ var LockOrderToken$Type = class extends MessageType {
517
+ constructor() {
518
+ super("spendguard.common.v1.LockOrderToken", [
519
+ {
520
+ no: 1,
521
+ name: "value",
522
+ kind: "scalar",
523
+ T: 9
524
+ /*ScalarType.STRING*/
525
+ }
526
+ ]);
527
+ }
528
+ };
529
+ var LockOrderToken = new LockOrderToken$Type();
530
+ var CloudEvent$Type = class extends MessageType {
531
+ constructor() {
532
+ super("spendguard.common.v1.CloudEvent", [
533
+ {
534
+ no: 1,
535
+ name: "specversion",
536
+ kind: "scalar",
537
+ T: 9
538
+ /*ScalarType.STRING*/
539
+ },
540
+ {
541
+ no: 2,
542
+ name: "type",
543
+ kind: "scalar",
544
+ T: 9
545
+ /*ScalarType.STRING*/
546
+ },
547
+ {
548
+ no: 3,
549
+ name: "source",
550
+ kind: "scalar",
551
+ T: 9
552
+ /*ScalarType.STRING*/
553
+ },
554
+ {
555
+ no: 4,
556
+ name: "id",
557
+ kind: "scalar",
558
+ T: 9
559
+ /*ScalarType.STRING*/
560
+ },
561
+ { no: 5, name: "time", kind: "message", T: () => Timestamp },
562
+ {
563
+ no: 6,
564
+ name: "datacontenttype",
565
+ kind: "scalar",
566
+ T: 9
567
+ /*ScalarType.STRING*/
568
+ },
569
+ {
570
+ no: 7,
571
+ name: "data",
572
+ kind: "scalar",
573
+ T: 12
574
+ /*ScalarType.BYTES*/
575
+ },
576
+ {
577
+ no: 100,
578
+ name: "tenant_id",
579
+ kind: "scalar",
580
+ T: 9
581
+ /*ScalarType.STRING*/
582
+ },
583
+ {
584
+ no: 101,
585
+ name: "run_id",
586
+ kind: "scalar",
587
+ T: 9
588
+ /*ScalarType.STRING*/
589
+ },
590
+ {
591
+ no: 102,
592
+ name: "decision_id",
593
+ kind: "scalar",
594
+ T: 9
595
+ /*ScalarType.STRING*/
596
+ },
597
+ {
598
+ no: 103,
599
+ name: "schema_bundle_id",
600
+ kind: "scalar",
601
+ T: 9
602
+ /*ScalarType.STRING*/
603
+ },
604
+ {
605
+ no: 200,
606
+ name: "producer_id",
607
+ kind: "scalar",
608
+ T: 9
609
+ /*ScalarType.STRING*/
610
+ },
611
+ {
612
+ no: 201,
613
+ name: "producer_sequence",
614
+ kind: "scalar",
615
+ T: 4
616
+ /*ScalarType.UINT64*/
617
+ },
618
+ {
619
+ no: 202,
620
+ name: "producer_signature",
621
+ kind: "scalar",
622
+ T: 12
623
+ /*ScalarType.BYTES*/
624
+ },
625
+ {
626
+ no: 203,
627
+ name: "signing_key_id",
628
+ kind: "scalar",
629
+ T: 9
630
+ /*ScalarType.STRING*/
631
+ },
632
+ {
633
+ no: 300,
634
+ name: "predicted_a_tokens",
635
+ kind: "scalar",
636
+ T: 3
637
+ /*ScalarType.INT64*/
638
+ },
639
+ {
640
+ no: 301,
641
+ name: "predicted_b_tokens",
642
+ kind: "scalar",
643
+ T: 3
644
+ /*ScalarType.INT64*/
645
+ },
646
+ {
647
+ no: 302,
648
+ name: "predicted_c_tokens",
649
+ kind: "scalar",
650
+ T: 3
651
+ /*ScalarType.INT64*/
652
+ },
653
+ {
654
+ no: 303,
655
+ name: "reserved_strategy",
656
+ kind: "scalar",
657
+ T: 9
658
+ /*ScalarType.STRING*/
659
+ },
660
+ {
661
+ no: 304,
662
+ name: "prediction_strategy_used",
663
+ kind: "scalar",
664
+ T: 9
665
+ /*ScalarType.STRING*/
666
+ },
667
+ {
668
+ no: 305,
669
+ name: "prediction_policy_used",
670
+ kind: "scalar",
671
+ T: 9
672
+ /*ScalarType.STRING*/
673
+ },
674
+ {
675
+ no: 306,
676
+ name: "tokenizer_tier",
677
+ kind: "scalar",
678
+ T: 9
679
+ /*ScalarType.STRING*/
680
+ },
681
+ {
682
+ no: 307,
683
+ name: "tokenizer_version_id",
684
+ kind: "scalar",
685
+ T: 9
686
+ /*ScalarType.STRING*/
687
+ },
688
+ {
689
+ no: 308,
690
+ name: "prediction_confidence",
691
+ kind: "scalar",
692
+ T: 2
693
+ /*ScalarType.FLOAT*/
694
+ },
695
+ {
696
+ no: 309,
697
+ name: "prediction_sample_size",
698
+ kind: "scalar",
699
+ T: 3
700
+ /*ScalarType.INT64*/
701
+ },
702
+ {
703
+ no: 310,
704
+ name: "cold_start_layer_used",
705
+ kind: "scalar",
706
+ T: 9
707
+ /*ScalarType.STRING*/
708
+ },
709
+ {
710
+ no: 311,
711
+ name: "run_projection_at_decision_atomic",
712
+ kind: "scalar",
713
+ T: 3
714
+ /*ScalarType.INT64*/
715
+ },
716
+ {
717
+ no: 312,
718
+ name: "run_predicted_remaining_steps",
719
+ kind: "scalar",
720
+ T: 5
721
+ /*ScalarType.INT32*/
722
+ },
723
+ {
724
+ no: 313,
725
+ name: "run_steps_completed_so_far",
726
+ kind: "scalar",
727
+ T: 3
728
+ /*ScalarType.INT64*/
729
+ },
730
+ {
731
+ no: 314,
732
+ name: "actual_input_tokens",
733
+ kind: "scalar",
734
+ T: 3
735
+ /*ScalarType.INT64*/
736
+ },
737
+ {
738
+ no: 315,
739
+ name: "actual_output_tokens",
740
+ kind: "scalar",
741
+ T: 3
742
+ /*ScalarType.INT64*/
743
+ },
744
+ {
745
+ no: 316,
746
+ name: "delta_b_ratio",
747
+ kind: "scalar",
748
+ T: 2
749
+ /*ScalarType.FLOAT*/
750
+ },
751
+ {
752
+ no: 317,
753
+ name: "delta_c_ratio",
754
+ kind: "scalar",
755
+ T: 2
756
+ /*ScalarType.FLOAT*/
757
+ }
758
+ ]);
759
+ }
760
+ };
761
+ var CloudEvent = new CloudEvent$Type();
762
+ var SchemaBundleRef$Type = class extends MessageType {
763
+ constructor() {
764
+ super("spendguard.common.v1.SchemaBundleRef", [
765
+ {
766
+ no: 1,
767
+ name: "schema_bundle_id",
768
+ kind: "scalar",
769
+ T: 9
770
+ /*ScalarType.STRING*/
771
+ },
772
+ {
773
+ no: 2,
774
+ name: "schema_bundle_hash",
775
+ kind: "scalar",
776
+ T: 12
777
+ /*ScalarType.BYTES*/
778
+ },
779
+ {
780
+ no: 3,
781
+ name: "canonical_schema_version",
782
+ kind: "scalar",
783
+ T: 9
784
+ /*ScalarType.STRING*/
785
+ }
786
+ ]);
787
+ }
788
+ };
789
+ var SchemaBundleRef = new SchemaBundleRef$Type();
790
+ var ContractBundleRef$Type = class extends MessageType {
791
+ constructor() {
792
+ super("spendguard.common.v1.ContractBundleRef", [
793
+ {
794
+ no: 1,
795
+ name: "bundle_id",
796
+ kind: "scalar",
797
+ T: 9
798
+ /*ScalarType.STRING*/
799
+ },
800
+ {
801
+ no: 2,
802
+ name: "bundle_hash",
803
+ kind: "scalar",
804
+ T: 12
805
+ /*ScalarType.BYTES*/
806
+ },
807
+ {
808
+ no: 3,
809
+ name: "bundle_signature",
810
+ kind: "scalar",
811
+ T: 12
812
+ /*ScalarType.BYTES*/
813
+ },
814
+ {
815
+ no: 4,
816
+ name: "signing_key_id",
817
+ kind: "scalar",
818
+ T: 9
819
+ /*ScalarType.STRING*/
820
+ }
821
+ ]);
822
+ }
823
+ };
824
+ var ContractBundleRef = new ContractBundleRef$Type();
825
+ var Idempotency$Type = class extends MessageType {
826
+ constructor() {
827
+ super("spendguard.common.v1.Idempotency", [
828
+ {
829
+ no: 1,
830
+ name: "key",
831
+ kind: "scalar",
832
+ T: 9
833
+ /*ScalarType.STRING*/
834
+ },
835
+ {
836
+ no: 2,
837
+ name: "request_hash",
838
+ kind: "scalar",
839
+ T: 12
840
+ /*ScalarType.BYTES*/
841
+ }
842
+ ]);
843
+ }
844
+ };
845
+ var Idempotency = new Idempotency$Type();
846
+ var SubscriptionMeter$Type = class extends MessageType {
847
+ constructor() {
848
+ super("spendguard.common.v1.SubscriptionMeter", [
849
+ {
850
+ no: 1,
851
+ name: "plan",
852
+ kind: "scalar",
853
+ T: 9
854
+ /*ScalarType.STRING*/
855
+ },
856
+ { no: 2, name: "period_start", kind: "message", T: () => Timestamp },
857
+ { no: 3, name: "period_end", kind: "message", T: () => Timestamp },
858
+ {
859
+ no: 4,
860
+ name: "consumed_atomic",
861
+ kind: "scalar",
862
+ T: 3
863
+ /*ScalarType.INT64*/
864
+ },
865
+ {
866
+ no: 5,
867
+ name: "monthly_cap_atomic",
868
+ kind: "scalar",
869
+ T: 3
870
+ /*ScalarType.INT64*/
871
+ },
872
+ {
873
+ no: 6,
874
+ name: "alert_at_atomic",
875
+ kind: "scalar",
876
+ T: 3
877
+ /*ScalarType.INT64*/
878
+ },
879
+ {
880
+ no: 7,
881
+ name: "hard_cap_at_atomic",
882
+ kind: "scalar",
883
+ T: 3
884
+ /*ScalarType.INT64*/
885
+ },
886
+ { no: 8, name: "cap_decision", kind: "enum", T: () => ["spendguard.common.v1.SubscriptionMeter.CapDecision", SubscriptionMeter_CapDecision] },
887
+ {
888
+ no: 9,
889
+ name: "retry_after_seconds",
890
+ kind: "scalar",
891
+ T: 3
892
+ /*ScalarType.INT64*/
893
+ }
894
+ ]);
895
+ }
896
+ };
897
+ var SubscriptionMeter = new SubscriptionMeter$Type();
898
+
899
+ // src/_proto/spendguard/sidecar_adapter/v1/adapter.ts
900
+ var adapter_exports = {};
901
+ __export(adapter_exports, {
902
+ ApprovalLifecyclePayload: () => ApprovalLifecyclePayload,
903
+ ApprovalLifecyclePayload_State: () => ApprovalLifecyclePayload_State,
904
+ ClaimEstimate: () => ClaimEstimate,
905
+ CommitSessionDeltaAccepted: () => CommitSessionDeltaAccepted,
906
+ CommitSessionDeltaOutcome: () => CommitSessionDeltaOutcome,
907
+ CommitSessionDeltaRequest: () => CommitSessionDeltaRequest,
908
+ CommitSessionDeltaRequest_Outcome: () => CommitSessionDeltaRequest_Outcome,
909
+ ConsumeBudgetGrantRequest: () => ConsumeBudgetGrantRequest,
910
+ ConsumeBudgetGrantResponse: () => ConsumeBudgetGrantResponse,
911
+ DecisionRequest: () => DecisionRequest,
912
+ DecisionRequest_Inputs: () => DecisionRequest_Inputs,
913
+ DecisionRequest_Trigger: () => DecisionRequest_Trigger,
914
+ DecisionResponse: () => DecisionResponse,
915
+ DecisionResponse_Decision: () => DecisionResponse_Decision,
916
+ DrainSignal: () => DrainSignal,
917
+ DrainSignal_Phase: () => DrainSignal_Phase,
918
+ DrainSubscribeRequest: () => DrainSubscribeRequest,
919
+ HandshakeRequest: () => HandshakeRequest,
920
+ HandshakeRequest_CapabilityLevel: () => HandshakeRequest_CapabilityLevel,
921
+ HandshakeResponse: () => HandshakeResponse,
922
+ HandshakeResponse_KeyEpochs: () => HandshakeResponse_KeyEpochs,
923
+ IssueBudgetGrantRequest: () => IssueBudgetGrantRequest,
924
+ IssueBudgetGrantRequest_Scope: () => IssueBudgetGrantRequest_Scope,
925
+ IssueBudgetGrantResponse: () => IssueBudgetGrantResponse,
926
+ LlmCallPostPayload: () => LlmCallPostPayload,
927
+ LlmCallPostPayload_Outcome: () => LlmCallPostPayload_Outcome,
928
+ PublishOutcomeRequest: () => PublishOutcomeRequest,
929
+ PublishOutcomeRequest_Outcome: () => PublishOutcomeRequest_Outcome,
930
+ PublishOutcomeResponse: () => PublishOutcomeResponse,
931
+ ReleaseReservationRequest: () => ReleaseReservationRequest,
932
+ ReleaseReservationResponse: () => ReleaseReservationResponse,
933
+ ReleaseSessionAccepted: () => ReleaseSessionAccepted,
934
+ ReleaseSessionOutcome: () => ReleaseSessionOutcome,
935
+ ReleaseSessionRequest: () => ReleaseSessionRequest,
936
+ ReserveSessionAccepted: () => ReserveSessionAccepted,
937
+ ReserveSessionDenied: () => ReserveSessionDenied,
938
+ ReserveSessionOutcome: () => ReserveSessionOutcome,
939
+ ReserveSessionRequest: () => ReserveSessionRequest,
940
+ ResumeAfterApprovalDenied: () => ResumeAfterApprovalDenied,
941
+ ResumeAfterApprovalRequest: () => ResumeAfterApprovalRequest,
942
+ ResumeAfterApprovalResponse: () => ResumeAfterApprovalResponse,
943
+ RevokeBudgetGrantRequest: () => RevokeBudgetGrantRequest,
944
+ RevokeBudgetGrantResponse: () => RevokeBudgetGrantResponse,
945
+ RollbackPayload: () => RollbackPayload,
946
+ SidecarAdapter: () => SidecarAdapter,
947
+ TraceEvent: () => TraceEvent,
948
+ TraceEventAck: () => TraceEventAck,
949
+ TraceEventAck_Status: () => TraceEventAck_Status,
950
+ TraceEvent_EventKind: () => TraceEvent_EventKind
951
+ });
952
+ var NullValue = /* @__PURE__ */ ((NullValue2) => {
953
+ NullValue2[NullValue2["NULL_VALUE"] = 0] = "NULL_VALUE";
954
+ return NullValue2;
955
+ })(NullValue || {});
956
+ var Struct$Type = class extends MessageType {
957
+ constructor() {
958
+ super("google.protobuf.Struct", [
959
+ { no: 1, name: "fields", kind: "map", K: 9, V: { kind: "message", T: () => Value } }
960
+ ]);
961
+ }
962
+ /**
963
+ * Encode `Struct` to JSON object.
964
+ */
965
+ internalJsonWrite(message, options) {
966
+ let json = {};
967
+ for (let [k, v] of Object.entries(message.fields)) {
968
+ json[k] = Value.toJson(v);
969
+ }
970
+ return json;
971
+ }
972
+ /**
973
+ * Decode `Struct` from JSON object.
974
+ */
975
+ internalJsonRead(json, options, target) {
976
+ if (!isJsonObject(json))
977
+ throw new globalThis.Error("Unable to parse message " + this.typeName + " from JSON " + typeofJsonValue(json) + ".");
978
+ if (!target)
979
+ target = this.create();
980
+ for (let [k, v] of globalThis.Object.entries(json)) {
981
+ target.fields[k] = Value.fromJson(v);
982
+ }
983
+ return target;
984
+ }
985
+ };
986
+ var Struct = new Struct$Type();
987
+ var Value$Type = class extends MessageType {
988
+ constructor() {
989
+ super("google.protobuf.Value", [
990
+ { no: 1, name: "null_value", kind: "enum", oneof: "kind", T: () => ["google.protobuf.NullValue", NullValue] },
991
+ {
992
+ no: 2,
993
+ name: "number_value",
994
+ kind: "scalar",
995
+ oneof: "kind",
996
+ T: 1
997
+ /*ScalarType.DOUBLE*/
998
+ },
999
+ {
1000
+ no: 3,
1001
+ name: "string_value",
1002
+ kind: "scalar",
1003
+ oneof: "kind",
1004
+ T: 9
1005
+ /*ScalarType.STRING*/
1006
+ },
1007
+ {
1008
+ no: 4,
1009
+ name: "bool_value",
1010
+ kind: "scalar",
1011
+ oneof: "kind",
1012
+ T: 8
1013
+ /*ScalarType.BOOL*/
1014
+ },
1015
+ { no: 5, name: "struct_value", kind: "message", oneof: "kind", T: () => Struct },
1016
+ { no: 6, name: "list_value", kind: "message", oneof: "kind", T: () => ListValue }
1017
+ ]);
1018
+ }
1019
+ /**
1020
+ * Encode `Value` to JSON value.
1021
+ */
1022
+ internalJsonWrite(message, options) {
1023
+ if (message.kind.oneofKind === void 0)
1024
+ throw new globalThis.Error();
1025
+ switch (message.kind.oneofKind) {
1026
+ case void 0:
1027
+ throw new globalThis.Error();
1028
+ case "boolValue":
1029
+ return message.kind.boolValue;
1030
+ case "nullValue":
1031
+ return null;
1032
+ case "numberValue":
1033
+ let numberValue = message.kind.numberValue;
1034
+ if (typeof numberValue == "number" && !Number.isFinite(numberValue))
1035
+ throw new globalThis.Error();
1036
+ return numberValue;
1037
+ case "stringValue":
1038
+ return message.kind.stringValue;
1039
+ case "listValue":
1040
+ let listValueField = this.fields.find((f) => f.no === 6);
1041
+ if (listValueField?.kind !== "message")
1042
+ throw new globalThis.Error();
1043
+ return listValueField.T().toJson(message.kind.listValue);
1044
+ case "structValue":
1045
+ let structValueField = this.fields.find((f) => f.no === 5);
1046
+ if (structValueField?.kind !== "message")
1047
+ throw new globalThis.Error();
1048
+ return structValueField.T().toJson(message.kind.structValue);
1049
+ }
1050
+ }
1051
+ /**
1052
+ * Decode `Value` from JSON value.
1053
+ */
1054
+ internalJsonRead(json, options, target) {
1055
+ if (!target)
1056
+ target = this.create();
1057
+ switch (typeof json) {
1058
+ case "number":
1059
+ target.kind = { oneofKind: "numberValue", numberValue: json };
1060
+ break;
1061
+ case "string":
1062
+ target.kind = { oneofKind: "stringValue", stringValue: json };
1063
+ break;
1064
+ case "boolean":
1065
+ target.kind = { oneofKind: "boolValue", boolValue: json };
1066
+ break;
1067
+ case "object":
1068
+ if (json === null) {
1069
+ target.kind = { oneofKind: "nullValue", nullValue: 0 /* NULL_VALUE */ };
1070
+ } else if (globalThis.Array.isArray(json)) {
1071
+ target.kind = { oneofKind: "listValue", listValue: ListValue.fromJson(json) };
1072
+ } else {
1073
+ target.kind = { oneofKind: "structValue", structValue: Struct.fromJson(json) };
1074
+ }
1075
+ break;
1076
+ default:
1077
+ throw new globalThis.Error("Unable to parse " + this.typeName + " from JSON " + typeofJsonValue(json));
1078
+ }
1079
+ return target;
1080
+ }
1081
+ };
1082
+ var Value = new Value$Type();
1083
+ var ListValue$Type = class extends MessageType {
1084
+ constructor() {
1085
+ super("google.protobuf.ListValue", [
1086
+ { no: 1, name: "values", kind: "message", repeat: 2, T: () => Value }
1087
+ ]);
1088
+ }
1089
+ /**
1090
+ * Encode `ListValue` to JSON array.
1091
+ */
1092
+ internalJsonWrite(message, options) {
1093
+ return message.values.map((v) => Value.toJson(v));
1094
+ }
1095
+ /**
1096
+ * Decode `ListValue` from JSON array.
1097
+ */
1098
+ internalJsonRead(json, options, target) {
1099
+ if (!globalThis.Array.isArray(json))
1100
+ throw new globalThis.Error("Unable to parse " + this.typeName + " from JSON " + typeofJsonValue(json));
1101
+ if (!target)
1102
+ target = this.create();
1103
+ let values = json.map((v) => Value.fromJson(v));
1104
+ target.values.push(...values);
1105
+ return target;
1106
+ }
1107
+ };
1108
+ var ListValue = new ListValue$Type();
1109
+
1110
+ // src/_proto/spendguard/sidecar_adapter/v1/adapter.ts
1111
+ var HandshakeRequest_CapabilityLevel = /* @__PURE__ */ ((HandshakeRequest_CapabilityLevel2) => {
1112
+ HandshakeRequest_CapabilityLevel2[HandshakeRequest_CapabilityLevel2["CAPABILITY_LEVEL_UNSPECIFIED"] = 0] = "CAPABILITY_LEVEL_UNSPECIFIED";
1113
+ HandshakeRequest_CapabilityLevel2[HandshakeRequest_CapabilityLevel2["L0_INGEST"] = 16] = "L0_INGEST";
1114
+ HandshakeRequest_CapabilityLevel2[HandshakeRequest_CapabilityLevel2["L1_LLM_CALL"] = 32] = "L1_LLM_CALL";
1115
+ HandshakeRequest_CapabilityLevel2[HandshakeRequest_CapabilityLevel2["L2_STEP"] = 48] = "L2_STEP";
1116
+ HandshakeRequest_CapabilityLevel2[HandshakeRequest_CapabilityLevel2["L3_POLICY_HOOK"] = 64] = "L3_POLICY_HOOK";
1117
+ HandshakeRequest_CapabilityLevel2[HandshakeRequest_CapabilityLevel2["L4_RUNTIME_NATIVE"] = 80] = "L4_RUNTIME_NATIVE";
1118
+ return HandshakeRequest_CapabilityLevel2;
1119
+ })(HandshakeRequest_CapabilityLevel || {});
1120
+ var DecisionRequest_Trigger = /* @__PURE__ */ ((DecisionRequest_Trigger2) => {
1121
+ DecisionRequest_Trigger2[DecisionRequest_Trigger2["TRIGGER_UNSPECIFIED"] = 0] = "TRIGGER_UNSPECIFIED";
1122
+ DecisionRequest_Trigger2[DecisionRequest_Trigger2["RUN_PRE"] = 1] = "RUN_PRE";
1123
+ DecisionRequest_Trigger2[DecisionRequest_Trigger2["AGENT_STEP_PRE"] = 2] = "AGENT_STEP_PRE";
1124
+ DecisionRequest_Trigger2[DecisionRequest_Trigger2["LLM_CALL_PRE"] = 3] = "LLM_CALL_PRE";
1125
+ DecisionRequest_Trigger2[DecisionRequest_Trigger2["TOOL_CALL_PRE"] = 4] = "TOOL_CALL_PRE";
1126
+ return DecisionRequest_Trigger2;
1127
+ })(DecisionRequest_Trigger || {});
1128
+ var DecisionResponse_Decision = /* @__PURE__ */ ((DecisionResponse_Decision2) => {
1129
+ DecisionResponse_Decision2[DecisionResponse_Decision2["DECISION_UNSPECIFIED"] = 0] = "DECISION_UNSPECIFIED";
1130
+ DecisionResponse_Decision2[DecisionResponse_Decision2["CONTINUE"] = 1] = "CONTINUE";
1131
+ DecisionResponse_Decision2[DecisionResponse_Decision2["DEGRADE"] = 2] = "DEGRADE";
1132
+ DecisionResponse_Decision2[DecisionResponse_Decision2["SKIP"] = 3] = "SKIP";
1133
+ DecisionResponse_Decision2[DecisionResponse_Decision2["STOP"] = 4] = "STOP";
1134
+ DecisionResponse_Decision2[DecisionResponse_Decision2["REQUIRE_APPROVAL"] = 5] = "REQUIRE_APPROVAL";
1135
+ DecisionResponse_Decision2[DecisionResponse_Decision2["STOP_RUN_PROJECTION"] = 6] = "STOP_RUN_PROJECTION";
1136
+ return DecisionResponse_Decision2;
1137
+ })(DecisionResponse_Decision || {});
1138
+ var PublishOutcomeRequest_Outcome = /* @__PURE__ */ ((PublishOutcomeRequest_Outcome2) => {
1139
+ PublishOutcomeRequest_Outcome2[PublishOutcomeRequest_Outcome2["OUTCOME_UNSPECIFIED"] = 0] = "OUTCOME_UNSPECIFIED";
1140
+ PublishOutcomeRequest_Outcome2[PublishOutcomeRequest_Outcome2["APPLIED"] = 1] = "APPLIED";
1141
+ PublishOutcomeRequest_Outcome2[PublishOutcomeRequest_Outcome2["APPLIED_NOOP"] = 2] = "APPLIED_NOOP";
1142
+ PublishOutcomeRequest_Outcome2[PublishOutcomeRequest_Outcome2["APPLY_FAILED"] = 3] = "APPLY_FAILED";
1143
+ PublishOutcomeRequest_Outcome2[PublishOutcomeRequest_Outcome2["APPROVAL_GRANTED"] = 4] = "APPROVAL_GRANTED";
1144
+ PublishOutcomeRequest_Outcome2[PublishOutcomeRequest_Outcome2["APPROVAL_DENIED"] = 5] = "APPROVAL_DENIED";
1145
+ PublishOutcomeRequest_Outcome2[PublishOutcomeRequest_Outcome2["APPROVAL_TIMED_OUT"] = 6] = "APPROVAL_TIMED_OUT";
1146
+ return PublishOutcomeRequest_Outcome2;
1147
+ })(PublishOutcomeRequest_Outcome || {});
1148
+ var TraceEvent_EventKind = /* @__PURE__ */ ((TraceEvent_EventKind2) => {
1149
+ TraceEvent_EventKind2[TraceEvent_EventKind2["EVENT_KIND_UNSPECIFIED"] = 0] = "EVENT_KIND_UNSPECIFIED";
1150
+ TraceEvent_EventKind2[TraceEvent_EventKind2["RUN_START"] = 1] = "RUN_START";
1151
+ TraceEvent_EventKind2[TraceEvent_EventKind2["RUN_END"] = 2] = "RUN_END";
1152
+ TraceEvent_EventKind2[TraceEvent_EventKind2["AGENT_STEP_POST"] = 3] = "AGENT_STEP_POST";
1153
+ TraceEvent_EventKind2[TraceEvent_EventKind2["LLM_CALL_POST"] = 4] = "LLM_CALL_POST";
1154
+ TraceEvent_EventKind2[TraceEvent_EventKind2["TOOL_CALL_POST"] = 5] = "TOOL_CALL_POST";
1155
+ TraceEvent_EventKind2[TraceEvent_EventKind2["SPAN_DELTA"] = 6] = "SPAN_DELTA";
1156
+ TraceEvent_EventKind2[TraceEvent_EventKind2["APPROVAL_LIFECYCLE"] = 7] = "APPROVAL_LIFECYCLE";
1157
+ TraceEvent_EventKind2[TraceEvent_EventKind2["ROLLBACK"] = 8] = "ROLLBACK";
1158
+ return TraceEvent_EventKind2;
1159
+ })(TraceEvent_EventKind || {});
1160
+ var LlmCallPostPayload_Outcome = /* @__PURE__ */ ((LlmCallPostPayload_Outcome2) => {
1161
+ LlmCallPostPayload_Outcome2[LlmCallPostPayload_Outcome2["OUTCOME_UNSPECIFIED"] = 0] = "OUTCOME_UNSPECIFIED";
1162
+ LlmCallPostPayload_Outcome2[LlmCallPostPayload_Outcome2["SUCCESS"] = 1] = "SUCCESS";
1163
+ LlmCallPostPayload_Outcome2[LlmCallPostPayload_Outcome2["PROVIDER_ERROR"] = 2] = "PROVIDER_ERROR";
1164
+ LlmCallPostPayload_Outcome2[LlmCallPostPayload_Outcome2["CLIENT_TIMEOUT"] = 3] = "CLIENT_TIMEOUT";
1165
+ LlmCallPostPayload_Outcome2[LlmCallPostPayload_Outcome2["RUN_ABORTED"] = 4] = "RUN_ABORTED";
1166
+ return LlmCallPostPayload_Outcome2;
1167
+ })(LlmCallPostPayload_Outcome || {});
1168
+ var ApprovalLifecyclePayload_State = /* @__PURE__ */ ((ApprovalLifecyclePayload_State2) => {
1169
+ ApprovalLifecyclePayload_State2[ApprovalLifecyclePayload_State2["STATE_UNSPECIFIED"] = 0] = "STATE_UNSPECIFIED";
1170
+ ApprovalLifecyclePayload_State2[ApprovalLifecyclePayload_State2["REQUESTED"] = 1] = "REQUESTED";
1171
+ ApprovalLifecyclePayload_State2[ApprovalLifecyclePayload_State2["GRANTED"] = 2] = "GRANTED";
1172
+ ApprovalLifecyclePayload_State2[ApprovalLifecyclePayload_State2["DENIED"] = 3] = "DENIED";
1173
+ ApprovalLifecyclePayload_State2[ApprovalLifecyclePayload_State2["EXPIRED"] = 4] = "EXPIRED";
1174
+ return ApprovalLifecyclePayload_State2;
1175
+ })(ApprovalLifecyclePayload_State || {});
1176
+ var TraceEventAck_Status = /* @__PURE__ */ ((TraceEventAck_Status2) => {
1177
+ TraceEventAck_Status2[TraceEventAck_Status2["STATUS_UNSPECIFIED"] = 0] = "STATUS_UNSPECIFIED";
1178
+ TraceEventAck_Status2[TraceEventAck_Status2["ACCEPTED"] = 1] = "ACCEPTED";
1179
+ TraceEventAck_Status2[TraceEventAck_Status2["QUARANTINED"] = 2] = "QUARANTINED";
1180
+ TraceEventAck_Status2[TraceEventAck_Status2["REJECTED"] = 3] = "REJECTED";
1181
+ return TraceEventAck_Status2;
1182
+ })(TraceEventAck_Status || {});
1183
+ var DrainSignal_Phase = /* @__PURE__ */ ((DrainSignal_Phase2) => {
1184
+ DrainSignal_Phase2[DrainSignal_Phase2["PHASE_UNSPECIFIED"] = 0] = "PHASE_UNSPECIFIED";
1185
+ DrainSignal_Phase2[DrainSignal_Phase2["DRAIN_INITIATED"] = 1] = "DRAIN_INITIATED";
1186
+ DrainSignal_Phase2[DrainSignal_Phase2["DRAIN_TIMEOUT_APPROACHING"] = 2] = "DRAIN_TIMEOUT_APPROACHING";
1187
+ DrainSignal_Phase2[DrainSignal_Phase2["DRAIN_COMPLETE"] = 3] = "DRAIN_COMPLETE";
1188
+ return DrainSignal_Phase2;
1189
+ })(DrainSignal_Phase || {});
1190
+ var CommitSessionDeltaRequest_Outcome = /* @__PURE__ */ ((CommitSessionDeltaRequest_Outcome2) => {
1191
+ CommitSessionDeltaRequest_Outcome2[CommitSessionDeltaRequest_Outcome2["OUTCOME_UNSPECIFIED"] = 0] = "OUTCOME_UNSPECIFIED";
1192
+ CommitSessionDeltaRequest_Outcome2[CommitSessionDeltaRequest_Outcome2["SUCCESS"] = 1] = "SUCCESS";
1193
+ CommitSessionDeltaRequest_Outcome2[CommitSessionDeltaRequest_Outcome2["PROVIDER_ERROR"] = 2] = "PROVIDER_ERROR";
1194
+ CommitSessionDeltaRequest_Outcome2[CommitSessionDeltaRequest_Outcome2["CLIENT_TIMEOUT"] = 3] = "CLIENT_TIMEOUT";
1195
+ CommitSessionDeltaRequest_Outcome2[CommitSessionDeltaRequest_Outcome2["RUN_ABORTED"] = 4] = "RUN_ABORTED";
1196
+ return CommitSessionDeltaRequest_Outcome2;
1197
+ })(CommitSessionDeltaRequest_Outcome || {});
1198
+ var ResumeAfterApprovalRequest$Type = class extends MessageType {
1199
+ constructor() {
1200
+ super("spendguard.sidecar_adapter.v1.ResumeAfterApprovalRequest", [
1201
+ {
1202
+ no: 1,
1203
+ name: "tenant_id",
1204
+ kind: "scalar",
1205
+ T: 9
1206
+ /*ScalarType.STRING*/
1207
+ },
1208
+ {
1209
+ no: 2,
1210
+ name: "decision_id",
1211
+ kind: "scalar",
1212
+ T: 9
1213
+ /*ScalarType.STRING*/
1214
+ },
1215
+ {
1216
+ no: 3,
1217
+ name: "approval_id",
1218
+ kind: "scalar",
1219
+ T: 9
1220
+ /*ScalarType.STRING*/
1221
+ },
1222
+ {
1223
+ no: 4,
1224
+ name: "workload_instance_id",
1225
+ kind: "scalar",
1226
+ T: 9
1227
+ /*ScalarType.STRING*/
1228
+ },
1229
+ {
1230
+ no: 5,
1231
+ name: "session_id",
1232
+ kind: "scalar",
1233
+ T: 9
1234
+ /*ScalarType.STRING*/
1235
+ }
1236
+ ]);
1237
+ }
1238
+ };
1239
+ var ResumeAfterApprovalRequest = new ResumeAfterApprovalRequest$Type();
1240
+ var ResumeAfterApprovalResponse$Type = class extends MessageType {
1241
+ constructor() {
1242
+ super("spendguard.sidecar_adapter.v1.ResumeAfterApprovalResponse", [
1243
+ { no: 1, name: "decision", kind: "message", oneof: "outcome", T: () => DecisionResponse },
1244
+ { no: 2, name: "denied", kind: "message", oneof: "outcome", T: () => ResumeAfterApprovalDenied },
1245
+ { no: 3, name: "error", kind: "message", oneof: "outcome", T: () => Error2 }
1246
+ ]);
1247
+ }
1248
+ };
1249
+ var ResumeAfterApprovalResponse = new ResumeAfterApprovalResponse$Type();
1250
+ var ResumeAfterApprovalDenied$Type = class extends MessageType {
1251
+ constructor() {
1252
+ super("spendguard.sidecar_adapter.v1.ResumeAfterApprovalDenied", [
1253
+ {
1254
+ no: 1,
1255
+ name: "audit_decision_event_id",
1256
+ kind: "scalar",
1257
+ T: 9
1258
+ /*ScalarType.STRING*/
1259
+ },
1260
+ {
1261
+ no: 2,
1262
+ name: "approver_reason",
1263
+ kind: "scalar",
1264
+ T: 9
1265
+ /*ScalarType.STRING*/
1266
+ },
1267
+ {
1268
+ no: 3,
1269
+ name: "approver_subject",
1270
+ kind: "scalar",
1271
+ T: 9
1272
+ /*ScalarType.STRING*/
1273
+ },
1274
+ {
1275
+ no: 4,
1276
+ name: "matched_rule_ids",
1277
+ kind: "scalar",
1278
+ repeat: 2,
1279
+ T: 9
1280
+ /*ScalarType.STRING*/
1281
+ }
1282
+ ]);
1283
+ }
1284
+ };
1285
+ var ResumeAfterApprovalDenied = new ResumeAfterApprovalDenied$Type();
1286
+ var HandshakeRequest$Type = class extends MessageType {
1287
+ constructor() {
1288
+ super("spendguard.sidecar_adapter.v1.HandshakeRequest", [
1289
+ {
1290
+ no: 1,
1291
+ name: "sdk_version",
1292
+ kind: "scalar",
1293
+ T: 9
1294
+ /*ScalarType.STRING*/
1295
+ },
1296
+ {
1297
+ no: 2,
1298
+ name: "runtime_kind",
1299
+ kind: "scalar",
1300
+ T: 9
1301
+ /*ScalarType.STRING*/
1302
+ },
1303
+ {
1304
+ no: 3,
1305
+ name: "runtime_version",
1306
+ kind: "scalar",
1307
+ T: 9
1308
+ /*ScalarType.STRING*/
1309
+ },
1310
+ { no: 4, name: "capability_level", kind: "enum", T: () => ["spendguard.sidecar_adapter.v1.HandshakeRequest.CapabilityLevel", HandshakeRequest_CapabilityLevel] },
1311
+ {
1312
+ no: 5,
1313
+ name: "tenant_id_assertion",
1314
+ kind: "scalar",
1315
+ T: 9
1316
+ /*ScalarType.STRING*/
1317
+ },
1318
+ {
1319
+ no: 6,
1320
+ name: "workload_instance_id",
1321
+ kind: "scalar",
1322
+ T: 9
1323
+ /*ScalarType.STRING*/
1324
+ },
1325
+ {
1326
+ no: 7,
1327
+ name: "protocol_version",
1328
+ kind: "scalar",
1329
+ T: 13
1330
+ /*ScalarType.UINT32*/
1331
+ }
1332
+ ]);
1333
+ }
1334
+ };
1335
+ var HandshakeRequest = new HandshakeRequest$Type();
1336
+ var HandshakeResponse$Type = class extends MessageType {
1337
+ constructor() {
1338
+ super("spendguard.sidecar_adapter.v1.HandshakeResponse", [
1339
+ {
1340
+ no: 1,
1341
+ name: "sidecar_version",
1342
+ kind: "scalar",
1343
+ T: 9
1344
+ /*ScalarType.STRING*/
1345
+ },
1346
+ { no: 2, name: "schema_bundle", kind: "message", T: () => SchemaBundleRef },
1347
+ { no: 3, name: "contract_bundle", kind: "message", T: () => ContractBundleRef },
1348
+ { no: 4, name: "capability_required", kind: "enum", T: () => ["spendguard.sidecar_adapter.v1.HandshakeRequest.CapabilityLevel", HandshakeRequest_CapabilityLevel] },
1349
+ { no: 5, name: "active_key_epochs", kind: "message", T: () => HandshakeResponse_KeyEpochs },
1350
+ {
1351
+ no: 6,
1352
+ name: "protocol_version",
1353
+ kind: "scalar",
1354
+ T: 13
1355
+ /*ScalarType.UINT32*/
1356
+ },
1357
+ {
1358
+ no: 7,
1359
+ name: "session_id",
1360
+ kind: "scalar",
1361
+ T: 9
1362
+ /*ScalarType.STRING*/
1363
+ },
1364
+ {
1365
+ no: 8,
1366
+ name: "signing_key_id",
1367
+ kind: "scalar",
1368
+ T: 9
1369
+ /*ScalarType.STRING*/
1370
+ },
1371
+ {
1372
+ no: 9,
1373
+ name: "announcement_signature",
1374
+ kind: "scalar",
1375
+ T: 12
1376
+ /*ScalarType.BYTES*/
1377
+ }
1378
+ ]);
1379
+ }
1380
+ };
1381
+ var HandshakeResponse = new HandshakeResponse$Type();
1382
+ var HandshakeResponse_KeyEpochs$Type = class extends MessageType {
1383
+ constructor() {
1384
+ super("spendguard.sidecar_adapter.v1.HandshakeResponse.KeyEpochs", [
1385
+ {
1386
+ no: 1,
1387
+ name: "producer_signing_key_epochs",
1388
+ kind: "scalar",
1389
+ repeat: 2,
1390
+ T: 9
1391
+ /*ScalarType.STRING*/
1392
+ },
1393
+ {
1394
+ no: 2,
1395
+ name: "hmac_tenant_salt_epochs",
1396
+ kind: "scalar",
1397
+ repeat: 2,
1398
+ T: 9
1399
+ /*ScalarType.STRING*/
1400
+ }
1401
+ ]);
1402
+ }
1403
+ };
1404
+ var HandshakeResponse_KeyEpochs = new HandshakeResponse_KeyEpochs$Type();
1405
+ var ClaimEstimate$Type = class extends MessageType {
1406
+ constructor() {
1407
+ super("spendguard.sidecar_adapter.v1.ClaimEstimate", [
1408
+ {
1409
+ no: 1,
1410
+ name: "tokenizer_tier",
1411
+ kind: "scalar",
1412
+ T: 9
1413
+ /*ScalarType.STRING*/
1414
+ },
1415
+ {
1416
+ no: 2,
1417
+ name: "tokenizer_version_id",
1418
+ kind: "scalar",
1419
+ T: 9
1420
+ /*ScalarType.STRING*/
1421
+ },
1422
+ {
1423
+ no: 3,
1424
+ name: "input_tokens",
1425
+ kind: "scalar",
1426
+ T: 3
1427
+ /*ScalarType.INT64*/
1428
+ },
1429
+ {
1430
+ no: 4,
1431
+ name: "predicted_a_tokens",
1432
+ kind: "scalar",
1433
+ T: 3
1434
+ /*ScalarType.INT64*/
1435
+ },
1436
+ {
1437
+ no: 5,
1438
+ name: "predicted_b_tokens",
1439
+ kind: "scalar",
1440
+ T: 3
1441
+ /*ScalarType.INT64*/
1442
+ },
1443
+ {
1444
+ no: 6,
1445
+ name: "predicted_c_tokens",
1446
+ kind: "scalar",
1447
+ T: 3
1448
+ /*ScalarType.INT64*/
1449
+ },
1450
+ {
1451
+ no: 7,
1452
+ name: "reserved_strategy",
1453
+ kind: "scalar",
1454
+ T: 9
1455
+ /*ScalarType.STRING*/
1456
+ },
1457
+ {
1458
+ no: 8,
1459
+ name: "prediction_strategy_used",
1460
+ kind: "scalar",
1461
+ T: 9
1462
+ /*ScalarType.STRING*/
1463
+ },
1464
+ {
1465
+ no: 9,
1466
+ name: "prediction_policy_used",
1467
+ kind: "scalar",
1468
+ T: 9
1469
+ /*ScalarType.STRING*/
1470
+ },
1471
+ {
1472
+ no: 10,
1473
+ name: "prediction_confidence",
1474
+ kind: "scalar",
1475
+ T: 2
1476
+ /*ScalarType.FLOAT*/
1477
+ },
1478
+ {
1479
+ no: 11,
1480
+ name: "prediction_sample_size",
1481
+ kind: "scalar",
1482
+ T: 3
1483
+ /*ScalarType.INT64*/
1484
+ },
1485
+ {
1486
+ no: 12,
1487
+ name: "cold_start_layer_used",
1488
+ kind: "scalar",
1489
+ T: 9
1490
+ /*ScalarType.STRING*/
1491
+ },
1492
+ {
1493
+ no: 13,
1494
+ name: "classifier_version",
1495
+ kind: "scalar",
1496
+ T: 9
1497
+ /*ScalarType.STRING*/
1498
+ },
1499
+ {
1500
+ no: 14,
1501
+ name: "fingerprint_version",
1502
+ kind: "scalar",
1503
+ T: 9
1504
+ /*ScalarType.STRING*/
1505
+ },
1506
+ {
1507
+ no: 15,
1508
+ name: "prompt_class_fingerprint",
1509
+ kind: "scalar",
1510
+ T: 9
1511
+ /*ScalarType.STRING*/
1512
+ },
1513
+ {
1514
+ no: 16,
1515
+ name: "run_projection_at_decision_atomic",
1516
+ kind: "scalar",
1517
+ T: 3
1518
+ /*ScalarType.INT64*/
1519
+ },
1520
+ {
1521
+ no: 17,
1522
+ name: "run_predicted_remaining_steps",
1523
+ kind: "scalar",
1524
+ T: 5
1525
+ /*ScalarType.INT32*/
1526
+ },
1527
+ {
1528
+ no: 18,
1529
+ name: "run_steps_completed_so_far",
1530
+ kind: "scalar",
1531
+ T: 3
1532
+ /*ScalarType.INT64*/
1533
+ },
1534
+ {
1535
+ no: 19,
1536
+ name: "run_code_triggered",
1537
+ kind: "scalar",
1538
+ T: 9
1539
+ /*ScalarType.STRING*/
1540
+ },
1541
+ {
1542
+ no: 20,
1543
+ name: "model",
1544
+ kind: "scalar",
1545
+ T: 9
1546
+ /*ScalarType.STRING*/
1547
+ },
1548
+ {
1549
+ no: 21,
1550
+ name: "prompt_class",
1551
+ kind: "scalar",
1552
+ T: 9
1553
+ /*ScalarType.STRING*/
1554
+ }
1555
+ ]);
1556
+ }
1557
+ };
1558
+ var ClaimEstimate = new ClaimEstimate$Type();
1559
+ var DecisionRequest$Type = class extends MessageType {
1560
+ constructor() {
1561
+ super("spendguard.sidecar_adapter.v1.DecisionRequest", [
1562
+ {
1563
+ no: 1,
1564
+ name: "session_id",
1565
+ kind: "scalar",
1566
+ T: 9
1567
+ /*ScalarType.STRING*/
1568
+ },
1569
+ { no: 2, name: "trigger", kind: "enum", T: () => ["spendguard.sidecar_adapter.v1.DecisionRequest.Trigger", DecisionRequest_Trigger] },
1570
+ { no: 3, name: "trace", kind: "message", T: () => TraceContext },
1571
+ { no: 4, name: "ids", kind: "message", T: () => SpendGuardIds },
1572
+ {
1573
+ no: 5,
1574
+ name: "route",
1575
+ kind: "scalar",
1576
+ T: 9
1577
+ /*ScalarType.STRING*/
1578
+ },
1579
+ { no: 6, name: "inputs", kind: "message", T: () => DecisionRequest_Inputs },
1580
+ {
1581
+ no: 7,
1582
+ name: "parent_run_id",
1583
+ kind: "scalar",
1584
+ T: 9
1585
+ /*ScalarType.STRING*/
1586
+ },
1587
+ {
1588
+ no: 8,
1589
+ name: "budget_grant_jti",
1590
+ kind: "scalar",
1591
+ T: 9
1592
+ /*ScalarType.STRING*/
1593
+ },
1594
+ { no: 9, name: "idempotency", kind: "message", T: () => Idempotency },
1595
+ {
1596
+ no: 17,
1597
+ name: "planned_steps_hint",
1598
+ kind: "scalar",
1599
+ T: 5
1600
+ /*ScalarType.INT32*/
1601
+ },
1602
+ { no: 18, name: "reservation_source", kind: "enum", T: () => ["spendguard.common.v1.ReservationSource", ReservationSource, "RESERVATION_SOURCE_"] },
1603
+ {
1604
+ no: 19,
1605
+ name: "meter_only_estimate",
1606
+ kind: "scalar",
1607
+ T: 8
1608
+ /*ScalarType.BOOL*/
1609
+ }
1610
+ ]);
1611
+ }
1612
+ };
1613
+ var DecisionRequest = new DecisionRequest$Type();
1614
+ var DecisionRequest_Inputs$Type = class extends MessageType {
1615
+ constructor() {
1616
+ super("spendguard.sidecar_adapter.v1.DecisionRequest.Inputs", [
1617
+ { no: 1, name: "projected_claims", kind: "message", repeat: 2, T: () => BudgetClaim },
1618
+ {
1619
+ no: 2,
1620
+ name: "projected_p50_atomic",
1621
+ kind: "scalar",
1622
+ T: 9
1623
+ /*ScalarType.STRING*/
1624
+ },
1625
+ {
1626
+ no: 3,
1627
+ name: "projected_p90_atomic",
1628
+ kind: "scalar",
1629
+ T: 9
1630
+ /*ScalarType.STRING*/
1631
+ },
1632
+ {
1633
+ no: 4,
1634
+ name: "projected_p95_atomic",
1635
+ kind: "scalar",
1636
+ T: 9
1637
+ /*ScalarType.STRING*/
1638
+ },
1639
+ {
1640
+ no: 5,
1641
+ name: "projected_p99_atomic",
1642
+ kind: "scalar",
1643
+ T: 9
1644
+ /*ScalarType.STRING*/
1645
+ },
1646
+ { no: 6, name: "projected_unit", kind: "message", T: () => UnitRef },
1647
+ { no: 7, name: "runtime_metadata", kind: "message", T: () => Struct },
1648
+ { no: 8, name: "claim_estimate", kind: "message", T: () => ClaimEstimate }
1649
+ ]);
1650
+ }
1651
+ };
1652
+ var DecisionRequest_Inputs = new DecisionRequest_Inputs$Type();
1653
+ var DecisionResponse$Type = class extends MessageType {
1654
+ constructor() {
1655
+ super("spendguard.sidecar_adapter.v1.DecisionResponse", [
1656
+ {
1657
+ no: 1,
1658
+ name: "decision_id",
1659
+ kind: "scalar",
1660
+ T: 9
1661
+ /*ScalarType.STRING*/
1662
+ },
1663
+ {
1664
+ no: 2,
1665
+ name: "audit_decision_event_id",
1666
+ kind: "scalar",
1667
+ T: 9
1668
+ /*ScalarType.STRING*/
1669
+ },
1670
+ { no: 3, name: "decision", kind: "enum", T: () => ["spendguard.sidecar_adapter.v1.DecisionResponse.Decision", DecisionResponse_Decision] },
1671
+ {
1672
+ no: 4,
1673
+ name: "reason_codes",
1674
+ kind: "scalar",
1675
+ repeat: 2,
1676
+ T: 9
1677
+ /*ScalarType.STRING*/
1678
+ },
1679
+ {
1680
+ no: 5,
1681
+ name: "matched_rule_ids",
1682
+ kind: "scalar",
1683
+ repeat: 2,
1684
+ T: 9
1685
+ /*ScalarType.STRING*/
1686
+ },
1687
+ {
1688
+ no: 6,
1689
+ name: "mutation_patch_json",
1690
+ kind: "scalar",
1691
+ T: 9
1692
+ /*ScalarType.STRING*/
1693
+ },
1694
+ {
1695
+ no: 7,
1696
+ name: "effect_hash",
1697
+ kind: "scalar",
1698
+ T: 12
1699
+ /*ScalarType.BYTES*/
1700
+ },
1701
+ {
1702
+ no: 8,
1703
+ name: "ledger_transaction_id",
1704
+ kind: "scalar",
1705
+ T: 9
1706
+ /*ScalarType.STRING*/
1707
+ },
1708
+ {
1709
+ no: 9,
1710
+ name: "reservation_ids",
1711
+ kind: "scalar",
1712
+ repeat: 2,
1713
+ T: 9
1714
+ /*ScalarType.STRING*/
1715
+ },
1716
+ { no: 10, name: "ttl_expires_at", kind: "message", T: () => Timestamp },
1717
+ {
1718
+ no: 11,
1719
+ name: "approval_request_id",
1720
+ kind: "scalar",
1721
+ T: 9
1722
+ /*ScalarType.STRING*/
1723
+ },
1724
+ { no: 12, name: "approval_ttl", kind: "message", T: () => Timestamp },
1725
+ {
1726
+ no: 13,
1727
+ name: "approver_role",
1728
+ kind: "scalar",
1729
+ T: 9
1730
+ /*ScalarType.STRING*/
1731
+ },
1732
+ {
1733
+ no: 14,
1734
+ name: "terminal",
1735
+ kind: "scalar",
1736
+ T: 8
1737
+ /*ScalarType.BOOL*/
1738
+ },
1739
+ { no: 15, name: "error", kind: "message", T: () => Error2 },
1740
+ {
1741
+ no: 16,
1742
+ name: "run_code_triggered",
1743
+ kind: "scalar",
1744
+ T: 9
1745
+ /*ScalarType.STRING*/
1746
+ },
1747
+ { no: 17, name: "subscription_meter", kind: "message", T: () => SubscriptionMeter }
1748
+ ]);
1749
+ }
1750
+ };
1751
+ var DecisionResponse = new DecisionResponse$Type();
1752
+ var PublishOutcomeRequest$Type = class extends MessageType {
1753
+ constructor() {
1754
+ super("spendguard.sidecar_adapter.v1.PublishOutcomeRequest", [
1755
+ {
1756
+ no: 1,
1757
+ name: "session_id",
1758
+ kind: "scalar",
1759
+ T: 9
1760
+ /*ScalarType.STRING*/
1761
+ },
1762
+ {
1763
+ no: 2,
1764
+ name: "decision_id",
1765
+ kind: "scalar",
1766
+ T: 9
1767
+ /*ScalarType.STRING*/
1768
+ },
1769
+ {
1770
+ no: 3,
1771
+ name: "effect_hash",
1772
+ kind: "scalar",
1773
+ T: 12
1774
+ /*ScalarType.BYTES*/
1775
+ },
1776
+ { no: 4, name: "outcome", kind: "enum", T: () => ["spendguard.sidecar_adapter.v1.PublishOutcomeRequest.Outcome", PublishOutcomeRequest_Outcome] },
1777
+ {
1778
+ no: 5,
1779
+ name: "adapter_error",
1780
+ kind: "scalar",
1781
+ T: 9
1782
+ /*ScalarType.STRING*/
1783
+ }
1784
+ ]);
1785
+ }
1786
+ };
1787
+ var PublishOutcomeRequest = new PublishOutcomeRequest$Type();
1788
+ var PublishOutcomeResponse$Type = class extends MessageType {
1789
+ constructor() {
1790
+ super("spendguard.sidecar_adapter.v1.PublishOutcomeResponse", [
1791
+ {
1792
+ no: 1,
1793
+ name: "audit_outcome_event_id",
1794
+ kind: "scalar",
1795
+ T: 9
1796
+ /*ScalarType.STRING*/
1797
+ },
1798
+ { no: 2, name: "recorded_at", kind: "message", T: () => Timestamp },
1799
+ { no: 3, name: "error", kind: "message", T: () => Error2 }
1800
+ ]);
1801
+ }
1802
+ };
1803
+ var PublishOutcomeResponse = new PublishOutcomeResponse$Type();
1804
+ var TraceEvent$Type = class extends MessageType {
1805
+ constructor() {
1806
+ super("spendguard.sidecar_adapter.v1.TraceEvent", [
1807
+ {
1808
+ no: 1,
1809
+ name: "session_id",
1810
+ kind: "scalar",
1811
+ T: 9
1812
+ /*ScalarType.STRING*/
1813
+ },
1814
+ { no: 2, name: "trace", kind: "message", T: () => TraceContext },
1815
+ { no: 3, name: "ids", kind: "message", T: () => SpendGuardIds },
1816
+ { no: 4, name: "kind", kind: "enum", T: () => ["spendguard.sidecar_adapter.v1.TraceEvent.EventKind", TraceEvent_EventKind] },
1817
+ { no: 5, name: "event_time", kind: "message", T: () => Timestamp },
1818
+ { no: 6, name: "generic", kind: "message", oneof: "payload", T: () => Struct },
1819
+ { no: 8, name: "llm_call_post", kind: "message", oneof: "payload", T: () => LlmCallPostPayload },
1820
+ { no: 9, name: "approval", kind: "message", oneof: "payload", T: () => ApprovalLifecyclePayload },
1821
+ { no: 10, name: "rollback", kind: "message", oneof: "payload", T: () => RollbackPayload },
1822
+ {
1823
+ no: 7,
1824
+ name: "provider_response_metadata",
1825
+ kind: "scalar",
1826
+ T: 9
1827
+ /*ScalarType.STRING*/
1828
+ }
1829
+ ]);
1830
+ }
1831
+ };
1832
+ var TraceEvent = new TraceEvent$Type();
1833
+ var LlmCallPostPayload$Type = class extends MessageType {
1834
+ constructor() {
1835
+ super("spendguard.sidecar_adapter.v1.LlmCallPostPayload", [
1836
+ {
1837
+ no: 1,
1838
+ name: "reservation_id",
1839
+ kind: "scalar",
1840
+ T: 9
1841
+ /*ScalarType.STRING*/
1842
+ },
1843
+ {
1844
+ no: 2,
1845
+ name: "provider_reported_amount_atomic",
1846
+ kind: "scalar",
1847
+ T: 9
1848
+ /*ScalarType.STRING*/
1849
+ },
1850
+ { no: 3, name: "unit", kind: "message", T: () => UnitRef },
1851
+ { no: 4, name: "pricing", kind: "message", T: () => PricingFreeze },
1852
+ {
1853
+ no: 5,
1854
+ name: "provider_event_id",
1855
+ kind: "scalar",
1856
+ T: 9
1857
+ /*ScalarType.STRING*/
1858
+ },
1859
+ { no: 6, name: "outcome", kind: "enum", T: () => ["spendguard.sidecar_adapter.v1.LlmCallPostPayload.Outcome", LlmCallPostPayload_Outcome] },
1860
+ {
1861
+ no: 7,
1862
+ name: "estimated_amount_atomic",
1863
+ kind: "scalar",
1864
+ T: 9
1865
+ /*ScalarType.STRING*/
1866
+ },
1867
+ {
1868
+ no: 8,
1869
+ name: "actual_input_tokens",
1870
+ kind: "scalar",
1871
+ opt: true,
1872
+ T: 3
1873
+ /*ScalarType.INT64*/
1874
+ },
1875
+ {
1876
+ no: 9,
1877
+ name: "actual_output_tokens",
1878
+ kind: "scalar",
1879
+ opt: true,
1880
+ T: 3
1881
+ /*ScalarType.INT64*/
1882
+ },
1883
+ {
1884
+ no: 10,
1885
+ name: "delta_b_ratio",
1886
+ kind: "scalar",
1887
+ opt: true,
1888
+ T: 2
1889
+ /*ScalarType.FLOAT*/
1890
+ },
1891
+ {
1892
+ no: 11,
1893
+ name: "delta_c_ratio",
1894
+ kind: "scalar",
1895
+ opt: true,
1896
+ T: 2
1897
+ /*ScalarType.FLOAT*/
1898
+ }
1899
+ ]);
1900
+ }
1901
+ };
1902
+ var LlmCallPostPayload = new LlmCallPostPayload$Type();
1903
+ var ApprovalLifecyclePayload$Type = class extends MessageType {
1904
+ constructor() {
1905
+ super("spendguard.sidecar_adapter.v1.ApprovalLifecyclePayload", [
1906
+ {
1907
+ no: 1,
1908
+ name: "approval_request_id",
1909
+ kind: "scalar",
1910
+ T: 9
1911
+ /*ScalarType.STRING*/
1912
+ },
1913
+ { no: 2, name: "state", kind: "enum", T: () => ["spendguard.sidecar_adapter.v1.ApprovalLifecyclePayload.State", ApprovalLifecyclePayload_State] },
1914
+ {
1915
+ no: 3,
1916
+ name: "approver",
1917
+ kind: "scalar",
1918
+ T: 9
1919
+ /*ScalarType.STRING*/
1920
+ },
1921
+ { no: 4, name: "deadline", kind: "message", T: () => Timestamp }
1922
+ ]);
1923
+ }
1924
+ };
1925
+ var ApprovalLifecyclePayload = new ApprovalLifecyclePayload$Type();
1926
+ var RollbackPayload$Type = class extends MessageType {
1927
+ constructor() {
1928
+ super("spendguard.sidecar_adapter.v1.RollbackPayload", [
1929
+ {
1930
+ no: 1,
1931
+ name: "ledger_transaction_id",
1932
+ kind: "scalar",
1933
+ T: 9
1934
+ /*ScalarType.STRING*/
1935
+ },
1936
+ {
1937
+ no: 2,
1938
+ name: "reason_code",
1939
+ kind: "scalar",
1940
+ T: 9
1941
+ /*ScalarType.STRING*/
1942
+ },
1943
+ {
1944
+ no: 3,
1945
+ name: "compensating_ledger_transaction_id",
1946
+ kind: "scalar",
1947
+ T: 9
1948
+ /*ScalarType.STRING*/
1949
+ }
1950
+ ]);
1951
+ }
1952
+ };
1953
+ var RollbackPayload = new RollbackPayload$Type();
1954
+ var TraceEventAck$Type = class extends MessageType {
1955
+ constructor() {
1956
+ super("spendguard.sidecar_adapter.v1.TraceEventAck", [
1957
+ {
1958
+ no: 1,
1959
+ name: "event_id",
1960
+ kind: "scalar",
1961
+ T: 9
1962
+ /*ScalarType.STRING*/
1963
+ },
1964
+ { no: 2, name: "status", kind: "enum", T: () => ["spendguard.sidecar_adapter.v1.TraceEventAck.Status", TraceEventAck_Status] },
1965
+ { no: 3, name: "error", kind: "message", T: () => Error2 }
1966
+ ]);
1967
+ }
1968
+ };
1969
+ var TraceEventAck = new TraceEventAck$Type();
1970
+ var IssueBudgetGrantRequest$Type = class extends MessageType {
1971
+ constructor() {
1972
+ super("spendguard.sidecar_adapter.v1.IssueBudgetGrantRequest", [
1973
+ {
1974
+ no: 1,
1975
+ name: "session_id",
1976
+ kind: "scalar",
1977
+ T: 9
1978
+ /*ScalarType.STRING*/
1979
+ },
1980
+ {
1981
+ no: 2,
1982
+ name: "parent_run_id",
1983
+ kind: "scalar",
1984
+ T: 9
1985
+ /*ScalarType.STRING*/
1986
+ },
1987
+ {
1988
+ no: 3,
1989
+ name: "child_workload_kind",
1990
+ kind: "scalar",
1991
+ T: 9
1992
+ /*ScalarType.STRING*/
1993
+ },
1994
+ { no: 4, name: "scope", kind: "message", T: () => IssueBudgetGrantRequest_Scope }
1995
+ ]);
1996
+ }
1997
+ };
1998
+ var IssueBudgetGrantRequest = new IssueBudgetGrantRequest$Type();
1999
+ var IssueBudgetGrantRequest_Scope$Type = class extends MessageType {
2000
+ constructor() {
2001
+ super("spendguard.sidecar_adapter.v1.IssueBudgetGrantRequest.Scope", [
2002
+ {
2003
+ no: 1,
2004
+ name: "allowed_routes",
2005
+ kind: "scalar",
2006
+ repeat: 2,
2007
+ T: 9
2008
+ /*ScalarType.STRING*/
2009
+ },
2010
+ {
2011
+ no: 2,
2012
+ name: "allowed_runtimes",
2013
+ kind: "scalar",
2014
+ repeat: 2,
2015
+ T: 9
2016
+ /*ScalarType.STRING*/
2017
+ },
2018
+ {
2019
+ no: 3,
2020
+ name: "max_amount_atomic",
2021
+ kind: "scalar",
2022
+ T: 9
2023
+ /*ScalarType.STRING*/
2024
+ },
2025
+ { no: 4, name: "max_amount_unit", kind: "message", T: () => UnitRef },
2026
+ { no: 5, name: "expires_at", kind: "message", T: () => Timestamp },
2027
+ {
2028
+ no: 6,
2029
+ name: "reservation_id",
2030
+ kind: "scalar",
2031
+ T: 9
2032
+ /*ScalarType.STRING*/
2033
+ }
2034
+ ]);
2035
+ }
2036
+ };
2037
+ var IssueBudgetGrantRequest_Scope = new IssueBudgetGrantRequest_Scope$Type();
2038
+ var IssueBudgetGrantResponse$Type = class extends MessageType {
2039
+ constructor() {
2040
+ super("spendguard.sidecar_adapter.v1.IssueBudgetGrantResponse", [
2041
+ {
2042
+ no: 1,
2043
+ name: "jwt_grant",
2044
+ kind: "scalar",
2045
+ T: 9
2046
+ /*ScalarType.STRING*/
2047
+ },
2048
+ {
2049
+ no: 2,
2050
+ name: "grant_jti",
2051
+ kind: "scalar",
2052
+ T: 9
2053
+ /*ScalarType.STRING*/
2054
+ },
2055
+ { no: 3, name: "issued_at", kind: "message", T: () => Timestamp },
2056
+ { no: 4, name: "expires_at", kind: "message", T: () => Timestamp }
2057
+ ]);
2058
+ }
2059
+ };
2060
+ var IssueBudgetGrantResponse = new IssueBudgetGrantResponse$Type();
2061
+ var RevokeBudgetGrantRequest$Type = class extends MessageType {
2062
+ constructor() {
2063
+ super("spendguard.sidecar_adapter.v1.RevokeBudgetGrantRequest", [
2064
+ {
2065
+ no: 1,
2066
+ name: "session_id",
2067
+ kind: "scalar",
2068
+ T: 9
2069
+ /*ScalarType.STRING*/
2070
+ },
2071
+ {
2072
+ no: 2,
2073
+ name: "grant_jti",
2074
+ kind: "scalar",
2075
+ T: 9
2076
+ /*ScalarType.STRING*/
2077
+ },
2078
+ {
2079
+ no: 3,
2080
+ name: "reason",
2081
+ kind: "scalar",
2082
+ T: 9
2083
+ /*ScalarType.STRING*/
2084
+ }
2085
+ ]);
2086
+ }
2087
+ };
2088
+ var RevokeBudgetGrantRequest = new RevokeBudgetGrantRequest$Type();
2089
+ var RevokeBudgetGrantResponse$Type = class extends MessageType {
2090
+ constructor() {
2091
+ super("spendguard.sidecar_adapter.v1.RevokeBudgetGrantResponse", [
2092
+ {
2093
+ no: 1,
2094
+ name: "revoked",
2095
+ kind: "scalar",
2096
+ T: 8
2097
+ /*ScalarType.BOOL*/
2098
+ },
2099
+ { no: 2, name: "revoked_at", kind: "message", T: () => Timestamp }
2100
+ ]);
2101
+ }
2102
+ };
2103
+ var RevokeBudgetGrantResponse = new RevokeBudgetGrantResponse$Type();
2104
+ var ConsumeBudgetGrantRequest$Type = class extends MessageType {
2105
+ constructor() {
2106
+ super("spendguard.sidecar_adapter.v1.ConsumeBudgetGrantRequest", [
2107
+ {
2108
+ no: 1,
2109
+ name: "session_id",
2110
+ kind: "scalar",
2111
+ T: 9
2112
+ /*ScalarType.STRING*/
2113
+ },
2114
+ {
2115
+ no: 2,
2116
+ name: "jwt_grant",
2117
+ kind: "scalar",
2118
+ T: 9
2119
+ /*ScalarType.STRING*/
2120
+ }
2121
+ ]);
2122
+ }
2123
+ };
2124
+ var ConsumeBudgetGrantRequest = new ConsumeBudgetGrantRequest$Type();
2125
+ var ConsumeBudgetGrantResponse$Type = class extends MessageType {
2126
+ constructor() {
2127
+ super("spendguard.sidecar_adapter.v1.ConsumeBudgetGrantResponse", [
2128
+ {
2129
+ no: 1,
2130
+ name: "accepted",
2131
+ kind: "scalar",
2132
+ T: 8
2133
+ /*ScalarType.BOOL*/
2134
+ },
2135
+ {
2136
+ no: 2,
2137
+ name: "parent_run_id",
2138
+ kind: "scalar",
2139
+ T: 9
2140
+ /*ScalarType.STRING*/
2141
+ },
2142
+ {
2143
+ no: 3,
2144
+ name: "parent_tenant_id",
2145
+ kind: "scalar",
2146
+ T: 9
2147
+ /*ScalarType.STRING*/
2148
+ },
2149
+ { no: 4, name: "expires_at", kind: "message", T: () => Timestamp },
2150
+ { no: 5, name: "error", kind: "message", T: () => Error2 }
2151
+ ]);
2152
+ }
2153
+ };
2154
+ var ConsumeBudgetGrantResponse = new ConsumeBudgetGrantResponse$Type();
2155
+ var DrainSubscribeRequest$Type = class extends MessageType {
2156
+ constructor() {
2157
+ super("spendguard.sidecar_adapter.v1.DrainSubscribeRequest", [
2158
+ {
2159
+ no: 1,
2160
+ name: "session_id",
2161
+ kind: "scalar",
2162
+ T: 9
2163
+ /*ScalarType.STRING*/
2164
+ }
2165
+ ]);
2166
+ }
2167
+ };
2168
+ var DrainSubscribeRequest = new DrainSubscribeRequest$Type();
2169
+ var DrainSignal$Type = class extends MessageType {
2170
+ constructor() {
2171
+ super("spendguard.sidecar_adapter.v1.DrainSignal", [
2172
+ { no: 1, name: "phase", kind: "enum", T: () => ["spendguard.sidecar_adapter.v1.DrainSignal.Phase", DrainSignal_Phase] },
2173
+ { no: 2, name: "deadline", kind: "message", T: () => Timestamp },
2174
+ {
2175
+ no: 3,
2176
+ name: "drain_trigger",
2177
+ kind: "scalar",
2178
+ T: 9
2179
+ /*ScalarType.STRING*/
2180
+ }
2181
+ ]);
2182
+ }
2183
+ };
2184
+ var DrainSignal = new DrainSignal$Type();
2185
+ var ReleaseReservationRequest$Type = class extends MessageType {
2186
+ constructor() {
2187
+ super("spendguard.sidecar_adapter.v1.ReleaseReservationRequest", [
2188
+ {
2189
+ no: 1,
2190
+ name: "reservation_id",
2191
+ kind: "scalar",
2192
+ T: 9
2193
+ /*ScalarType.STRING*/
2194
+ },
2195
+ {
2196
+ no: 2,
2197
+ name: "idempotency_key",
2198
+ kind: "scalar",
2199
+ T: 9
2200
+ /*ScalarType.STRING*/
2201
+ },
2202
+ {
2203
+ no: 3,
2204
+ name: "reason_codes",
2205
+ kind: "scalar",
2206
+ repeat: 2,
2207
+ T: 9
2208
+ /*ScalarType.STRING*/
2209
+ },
2210
+ {
2211
+ no: 100,
2212
+ name: "tenant_id",
2213
+ kind: "scalar",
2214
+ T: 9
2215
+ /*ScalarType.STRING*/
2216
+ },
2217
+ {
2218
+ no: 101,
2219
+ name: "workload_instance_id",
2220
+ kind: "scalar",
2221
+ T: 9
2222
+ /*ScalarType.STRING*/
2223
+ },
2224
+ {
2225
+ no: 102,
2226
+ name: "session_id",
2227
+ kind: "scalar",
2228
+ T: 9
2229
+ /*ScalarType.STRING*/
2230
+ }
2231
+ ]);
2232
+ }
2233
+ };
2234
+ var ReleaseReservationRequest = new ReleaseReservationRequest$Type();
2235
+ var ReleaseReservationResponse$Type = class extends MessageType {
2236
+ constructor() {
2237
+ super("spendguard.sidecar_adapter.v1.ReleaseReservationResponse", [
2238
+ {
2239
+ no: 1,
2240
+ name: "audit_event_signature",
2241
+ kind: "scalar",
2242
+ T: 12
2243
+ /*ScalarType.BYTES*/
2244
+ },
2245
+ {
2246
+ no: 100,
2247
+ name: "ledger_transaction_id",
2248
+ kind: "scalar",
2249
+ T: 9
2250
+ /*ScalarType.STRING*/
2251
+ },
2252
+ {
2253
+ no: 101,
2254
+ name: "released_reservation_ids",
2255
+ kind: "scalar",
2256
+ repeat: 2,
2257
+ T: 9
2258
+ /*ScalarType.STRING*/
2259
+ }
2260
+ ]);
2261
+ }
2262
+ };
2263
+ var ReleaseReservationResponse = new ReleaseReservationResponse$Type();
2264
+ var ReserveSessionRequest$Type = class extends MessageType {
2265
+ constructor() {
2266
+ super("spendguard.sidecar_adapter.v1.ReserveSessionRequest", [
2267
+ {
2268
+ no: 1,
2269
+ name: "tenant_id",
2270
+ kind: "scalar",
2271
+ T: 9
2272
+ /*ScalarType.STRING*/
2273
+ },
2274
+ {
2275
+ no: 2,
2276
+ name: "budget_id",
2277
+ kind: "scalar",
2278
+ T: 9
2279
+ /*ScalarType.STRING*/
2280
+ },
2281
+ {
2282
+ no: 3,
2283
+ name: "window_instance_id",
2284
+ kind: "scalar",
2285
+ T: 9
2286
+ /*ScalarType.STRING*/
2287
+ },
2288
+ { no: 4, name: "unit", kind: "message", T: () => UnitRef },
2289
+ { no: 5, name: "pricing", kind: "message", T: () => PricingFreeze },
2290
+ {
2291
+ no: 6,
2292
+ name: "session_id",
2293
+ kind: "scalar",
2294
+ T: 9
2295
+ /*ScalarType.STRING*/
2296
+ },
2297
+ {
2298
+ no: 7,
2299
+ name: "route",
2300
+ kind: "scalar",
2301
+ T: 9
2302
+ /*ScalarType.STRING*/
2303
+ },
2304
+ {
2305
+ no: 8,
2306
+ name: "estimated_amount_atomic",
2307
+ kind: "scalar",
2308
+ T: 9
2309
+ /*ScalarType.STRING*/
2310
+ },
2311
+ {
2312
+ no: 9,
2313
+ name: "ttl_seconds",
2314
+ kind: "scalar",
2315
+ T: 13
2316
+ /*ScalarType.UINT32*/
2317
+ },
2318
+ {
2319
+ no: 10,
2320
+ name: "idempotency_key",
2321
+ kind: "scalar",
2322
+ T: 9
2323
+ /*ScalarType.STRING*/
2324
+ }
2325
+ ]);
2326
+ }
2327
+ };
2328
+ var ReserveSessionRequest = new ReserveSessionRequest$Type();
2329
+ var ReserveSessionOutcome$Type = class extends MessageType {
2330
+ constructor() {
2331
+ super("spendguard.sidecar_adapter.v1.ReserveSessionOutcome", [
2332
+ { no: 1, name: "accepted", kind: "message", oneof: "outcome", T: () => ReserveSessionAccepted },
2333
+ { no: 2, name: "denied", kind: "message", oneof: "outcome", T: () => ReserveSessionDenied },
2334
+ { no: 3, name: "error", kind: "message", oneof: "outcome", T: () => Error2 }
2335
+ ]);
2336
+ }
2337
+ };
2338
+ var ReserveSessionOutcome = new ReserveSessionOutcome$Type();
2339
+ var ReserveSessionAccepted$Type = class extends MessageType {
2340
+ constructor() {
2341
+ super("spendguard.sidecar_adapter.v1.ReserveSessionAccepted", [
2342
+ {
2343
+ no: 1,
2344
+ name: "session_reservation_id",
2345
+ kind: "scalar",
2346
+ T: 9
2347
+ /*ScalarType.STRING*/
2348
+ },
2349
+ {
2350
+ no: 2,
2351
+ name: "ledger_transaction_id",
2352
+ kind: "scalar",
2353
+ T: 9
2354
+ /*ScalarType.STRING*/
2355
+ },
2356
+ {
2357
+ no: 3,
2358
+ name: "audit_session_event_id",
2359
+ kind: "scalar",
2360
+ T: 9
2361
+ /*ScalarType.STRING*/
2362
+ },
2363
+ { no: 4, name: "ttl_expires_at", kind: "message", T: () => Timestamp },
2364
+ {
2365
+ no: 5,
2366
+ name: "reserved_amount_atomic",
2367
+ kind: "scalar",
2368
+ T: 9
2369
+ /*ScalarType.STRING*/
2370
+ },
2371
+ {
2372
+ no: 6,
2373
+ name: "remaining_amount_atomic",
2374
+ kind: "scalar",
2375
+ T: 9
2376
+ /*ScalarType.STRING*/
2377
+ }
2378
+ ]);
2379
+ }
2380
+ };
2381
+ var ReserveSessionAccepted = new ReserveSessionAccepted$Type();
2382
+ var ReserveSessionDenied$Type = class extends MessageType {
2383
+ constructor() {
2384
+ super("spendguard.sidecar_adapter.v1.ReserveSessionDenied", [
2385
+ {
2386
+ no: 1,
2387
+ name: "audit_session_event_id",
2388
+ kind: "scalar",
2389
+ T: 9
2390
+ /*ScalarType.STRING*/
2391
+ },
2392
+ {
2393
+ no: 2,
2394
+ name: "reason_codes",
2395
+ kind: "scalar",
2396
+ repeat: 2,
2397
+ T: 9
2398
+ /*ScalarType.STRING*/
2399
+ },
2400
+ {
2401
+ no: 3,
2402
+ name: "matched_rule_ids",
2403
+ kind: "scalar",
2404
+ repeat: 2,
2405
+ T: 9
2406
+ /*ScalarType.STRING*/
2407
+ },
2408
+ { no: 4, name: "error", kind: "message", T: () => Error2 }
2409
+ ]);
2410
+ }
2411
+ };
2412
+ var ReserveSessionDenied = new ReserveSessionDenied$Type();
2413
+ var CommitSessionDeltaRequest$Type = class extends MessageType {
2414
+ constructor() {
2415
+ super("spendguard.sidecar_adapter.v1.CommitSessionDeltaRequest", [
2416
+ {
2417
+ no: 1,
2418
+ name: "session_reservation_id",
2419
+ kind: "scalar",
2420
+ T: 9
2421
+ /*ScalarType.STRING*/
2422
+ },
2423
+ {
2424
+ no: 2,
2425
+ name: "streaming_commit_id",
2426
+ kind: "scalar",
2427
+ T: 9
2428
+ /*ScalarType.STRING*/
2429
+ },
2430
+ {
2431
+ no: 3,
2432
+ name: "amount_atomic_delta",
2433
+ kind: "scalar",
2434
+ T: 9
2435
+ /*ScalarType.STRING*/
2436
+ },
2437
+ { no: 4, name: "outcome", kind: "enum", T: () => ["spendguard.sidecar_adapter.v1.CommitSessionDeltaRequest.Outcome", CommitSessionDeltaRequest_Outcome] },
2438
+ { no: 5, name: "event_time", kind: "message", T: () => Timestamp },
2439
+ {
2440
+ no: 6,
2441
+ name: "idempotency_key",
2442
+ kind: "scalar",
2443
+ T: 9
2444
+ /*ScalarType.STRING*/
2445
+ }
2446
+ ]);
2447
+ }
2448
+ };
2449
+ var CommitSessionDeltaRequest = new CommitSessionDeltaRequest$Type();
2450
+ var CommitSessionDeltaOutcome$Type = class extends MessageType {
2451
+ constructor() {
2452
+ super("spendguard.sidecar_adapter.v1.CommitSessionDeltaOutcome", [
2453
+ { no: 1, name: "accepted", kind: "message", oneof: "outcome", T: () => CommitSessionDeltaAccepted },
2454
+ { no: 2, name: "error", kind: "message", oneof: "outcome", T: () => Error2 }
2455
+ ]);
2456
+ }
2457
+ };
2458
+ var CommitSessionDeltaOutcome = new CommitSessionDeltaOutcome$Type();
2459
+ var CommitSessionDeltaAccepted$Type = class extends MessageType {
2460
+ constructor() {
2461
+ super("spendguard.sidecar_adapter.v1.CommitSessionDeltaAccepted", [
2462
+ {
2463
+ no: 1,
2464
+ name: "session_reservation_id",
2465
+ kind: "scalar",
2466
+ T: 9
2467
+ /*ScalarType.STRING*/
2468
+ },
2469
+ {
2470
+ no: 2,
2471
+ name: "streaming_commit_id",
2472
+ kind: "scalar",
2473
+ T: 9
2474
+ /*ScalarType.STRING*/
2475
+ },
2476
+ {
2477
+ no: 3,
2478
+ name: "ledger_transaction_id",
2479
+ kind: "scalar",
2480
+ T: 9
2481
+ /*ScalarType.STRING*/
2482
+ },
2483
+ {
2484
+ no: 4,
2485
+ name: "audit_session_event_id",
2486
+ kind: "scalar",
2487
+ T: 9
2488
+ /*ScalarType.STRING*/
2489
+ },
2490
+ {
2491
+ no: 5,
2492
+ name: "committed_delta_atomic",
2493
+ kind: "scalar",
2494
+ T: 9
2495
+ /*ScalarType.STRING*/
2496
+ },
2497
+ {
2498
+ no: 6,
2499
+ name: "cumulative_committed_atomic",
2500
+ kind: "scalar",
2501
+ T: 9
2502
+ /*ScalarType.STRING*/
2503
+ },
2504
+ {
2505
+ no: 7,
2506
+ name: "remaining_amount_atomic",
2507
+ kind: "scalar",
2508
+ T: 9
2509
+ /*ScalarType.STRING*/
2510
+ },
2511
+ { no: 8, name: "recorded_at", kind: "message", T: () => Timestamp }
2512
+ ]);
2513
+ }
2514
+ };
2515
+ var CommitSessionDeltaAccepted = new CommitSessionDeltaAccepted$Type();
2516
+ var ReleaseSessionRequest$Type = class extends MessageType {
2517
+ constructor() {
2518
+ super("spendguard.sidecar_adapter.v1.ReleaseSessionRequest", [
2519
+ {
2520
+ no: 1,
2521
+ name: "session_reservation_id",
2522
+ kind: "scalar",
2523
+ T: 9
2524
+ /*ScalarType.STRING*/
2525
+ },
2526
+ {
2527
+ no: 2,
2528
+ name: "reason_code",
2529
+ kind: "scalar",
2530
+ T: 9
2531
+ /*ScalarType.STRING*/
2532
+ },
2533
+ { no: 3, name: "event_time", kind: "message", T: () => Timestamp },
2534
+ {
2535
+ no: 4,
2536
+ name: "idempotency_key",
2537
+ kind: "scalar",
2538
+ T: 9
2539
+ /*ScalarType.STRING*/
2540
+ }
2541
+ ]);
2542
+ }
2543
+ };
2544
+ var ReleaseSessionRequest = new ReleaseSessionRequest$Type();
2545
+ var ReleaseSessionOutcome$Type = class extends MessageType {
2546
+ constructor() {
2547
+ super("spendguard.sidecar_adapter.v1.ReleaseSessionOutcome", [
2548
+ { no: 1, name: "accepted", kind: "message", oneof: "outcome", T: () => ReleaseSessionAccepted },
2549
+ { no: 2, name: "error", kind: "message", oneof: "outcome", T: () => Error2 }
2550
+ ]);
2551
+ }
2552
+ };
2553
+ var ReleaseSessionOutcome = new ReleaseSessionOutcome$Type();
2554
+ var ReleaseSessionAccepted$Type = class extends MessageType {
2555
+ constructor() {
2556
+ super("spendguard.sidecar_adapter.v1.ReleaseSessionAccepted", [
2557
+ {
2558
+ no: 1,
2559
+ name: "session_reservation_id",
2560
+ kind: "scalar",
2561
+ T: 9
2562
+ /*ScalarType.STRING*/
2563
+ },
2564
+ {
2565
+ no: 2,
2566
+ name: "ledger_transaction_id",
2567
+ kind: "scalar",
2568
+ T: 9
2569
+ /*ScalarType.STRING*/
2570
+ },
2571
+ {
2572
+ no: 3,
2573
+ name: "audit_session_event_id",
2574
+ kind: "scalar",
2575
+ T: 9
2576
+ /*ScalarType.STRING*/
2577
+ },
2578
+ {
2579
+ no: 4,
2580
+ name: "released_amount_atomic",
2581
+ kind: "scalar",
2582
+ T: 9
2583
+ /*ScalarType.STRING*/
2584
+ },
2585
+ {
2586
+ no: 5,
2587
+ name: "committed_amount_atomic",
2588
+ kind: "scalar",
2589
+ T: 9
2590
+ /*ScalarType.STRING*/
2591
+ },
2592
+ { no: 6, name: "recorded_at", kind: "message", T: () => Timestamp }
2593
+ ]);
2594
+ }
2595
+ };
2596
+ var ReleaseSessionAccepted = new ReleaseSessionAccepted$Type();
2597
+ var SidecarAdapter = new ServiceType("spendguard.sidecar_adapter.v1.SidecarAdapter", [
2598
+ { name: "Handshake", options: {}, I: HandshakeRequest, O: HandshakeResponse },
2599
+ { name: "RequestDecision", options: {}, I: DecisionRequest, O: DecisionResponse },
2600
+ { name: "ConfirmPublishOutcome", options: {}, I: PublishOutcomeRequest, O: PublishOutcomeResponse },
2601
+ { name: "EmitTraceEvents", serverStreaming: true, clientStreaming: true, options: {}, I: TraceEvent, O: TraceEventAck },
2602
+ { name: "IssueBudgetGrant", options: {}, I: IssueBudgetGrantRequest, O: IssueBudgetGrantResponse },
2603
+ { name: "RevokeBudgetGrant", options: {}, I: RevokeBudgetGrantRequest, O: RevokeBudgetGrantResponse },
2604
+ { name: "ConsumeBudgetGrant", options: {}, I: ConsumeBudgetGrantRequest, O: ConsumeBudgetGrantResponse },
2605
+ { name: "StreamDrainSignal", serverStreaming: true, options: {}, I: DrainSubscribeRequest, O: DrainSignal },
2606
+ { name: "ResumeAfterApproval", options: {}, I: ResumeAfterApprovalRequest, O: ResumeAfterApprovalResponse },
2607
+ { name: "ReleaseReservation", options: {}, I: ReleaseReservationRequest, O: ReleaseReservationResponse },
2608
+ { name: "ReserveSession", options: {}, I: ReserveSessionRequest, O: ReserveSessionOutcome },
2609
+ { name: "CommitSessionDelta", options: {}, I: CommitSessionDeltaRequest, O: CommitSessionDeltaOutcome },
2610
+ { name: "ReleaseSession", options: {}, I: ReleaseSessionRequest, O: ReleaseSessionOutcome }
2611
+ ]);
2612
+
2613
+ // src/_proto/spendguard/sidecar_adapter/v1/adapter.client.ts
2614
+ var adapter_client_exports = {};
2615
+ __export(adapter_client_exports, {
2616
+ SidecarAdapterClient: () => SidecarAdapterClient
2617
+ });
2618
+ var SidecarAdapterClient = class {
2619
+ constructor(_transport) {
2620
+ this._transport = _transport;
2621
+ }
2622
+ _transport;
2623
+ typeName = SidecarAdapter.typeName;
2624
+ methods = SidecarAdapter.methods;
2625
+ options = SidecarAdapter.options;
2626
+ /**
2627
+ * Initial handshake; mandatory before any other RPC. Negotiates SDK version,
2628
+ * runtime kind, capability level, tenant_id assertion, key epochs.
2629
+ *
2630
+ * @generated from protobuf rpc: Handshake
2631
+ */
2632
+ handshake(input, options) {
2633
+ const method = this.methods[0], opt = this._transport.mergeOptions(options);
2634
+ return stackIntercept("unary", this._transport, method, opt, input);
2635
+ }
2636
+ // -- Decision boundary (per Contract §15 trigger points) -----------------
2637
+ /**
2638
+ * Adapter requests a decision at a *.pre trigger point.
2639
+ * Sidecar runs Contract §6 stages 1-5 and returns DecisionResult.
2640
+ * Sidecar may take up to Contract §14 latency budget (50ms p99 warm).
2641
+ *
2642
+ * @generated from protobuf rpc: RequestDecision
2643
+ */
2644
+ requestDecision(input, options) {
2645
+ const method = this.methods[1], opt = this._transport.mergeOptions(options);
2646
+ return stackIntercept("unary", this._transport, method, opt, input);
2647
+ }
2648
+ /**
2649
+ * Adapter confirms publish_effect outcome (per Contract §6 stage 7).
2650
+ * Idempotent via effect_hash (Stage 2 §4.6).
2651
+ *
2652
+ * @generated from protobuf rpc: ConfirmPublishOutcome
2653
+ */
2654
+ confirmPublishOutcome(input, options) {
2655
+ const method = this.methods[2], opt = this._transport.mergeOptions(options);
2656
+ return stackIntercept("unary", this._transport, method, opt, input);
2657
+ }
2658
+ // -- Trace events (per Contract §15 *.post triggers; observation only) ---
2659
+ /**
2660
+ * Adapter emits canonical/lifecycle events (agent.run.start, agent.step.post
2661
+ * tool.call.post, llm.call.post for commit, etc.). Server-streamed because
2662
+ * sidecar may emit follow-up acks or correction events.
2663
+ *
2664
+ * @generated from protobuf rpc: EmitTraceEvents
2665
+ */
2666
+ emitTraceEvents(options) {
2667
+ const method = this.methods[3], opt = this._transport.mergeOptions(options);
2668
+ return stackIntercept("duplex", this._transport, method, opt);
2669
+ }
2670
+ // -- Sub-agent budget grant (per Contract §8) ----------------------------
2671
+ /**
2672
+ * Parent agent requests budget_grant JWT to delegate to child agent.
2673
+ *
2674
+ * @generated from protobuf rpc: IssueBudgetGrant
2675
+ */
2676
+ issueBudgetGrant(input, options) {
2677
+ const method = this.methods[4], opt = this._transport.mergeOptions(options);
2678
+ return stackIntercept("unary", this._transport, method, opt, input);
2679
+ }
2680
+ /**
2681
+ * Parent revokes a previously issued grant.
2682
+ *
2683
+ * @generated from protobuf rpc: RevokeBudgetGrant
2684
+ */
2685
+ revokeBudgetGrant(input, options) {
2686
+ const method = this.methods[5], opt = this._transport.mergeOptions(options);
2687
+ return stackIntercept("unary", this._transport, method, opt, input);
2688
+ }
2689
+ /**
2690
+ * Child agent uses grant to bootstrap budget context.
2691
+ *
2692
+ * @generated from protobuf rpc: ConsumeBudgetGrant
2693
+ */
2694
+ consumeBudgetGrant(input, options) {
2695
+ const method = this.methods[6], opt = this._transport.mergeOptions(options);
2696
+ return stackIntercept("unary", this._transport, method, opt, input);
2697
+ }
2698
+ // -- Lifecycle drain (per Sidecar §11) -----------------------------------
2699
+ /**
2700
+ * Sidecar signals adapter that drain has begun; adapter should stop
2701
+ * initiating new decision boundaries and let in-flight finish.
2702
+ *
2703
+ * @generated from protobuf rpc: StreamDrainSignal
2704
+ */
2705
+ streamDrainSignal(input, options) {
2706
+ const method = this.methods[7], opt = this._transport.mergeOptions(options);
2707
+ return stackIntercept("serverStreaming", this._transport, method, opt, input);
2708
+ }
2709
+ // -- Approval resume (Phase 5 GA hardening S16) --------------------------
2710
+ /**
2711
+ * Adapter calls this AFTER the human approver has approved/denied the
2712
+ * pending approval (REQUIRE_APPROVAL outcome from RequestDecision).
2713
+ * Sidecar:
2714
+ * 1. Looks up the approval by (tenant_id, decision_id, approval_id).
2715
+ * 2. Reads the current state (must be `approved` or `denied`).
2716
+ * 3. For `approved`: re-runs Contract evaluation + Ledger.ReserveSet
2717
+ * with a NEW idempotency key derived from approval_id (so a
2718
+ * replay can never double-publish the effect).
2719
+ * 4. For `denied`: emits the deny audit row + returns Decision::STOP.
2720
+ * 5. For other states (pending/expired/cancelled): returns the
2721
+ * typed Error code so the adapter raises the right exception.
2722
+ *
2723
+ * Idempotent: repeated ResumeAfterApproval calls with the same
2724
+ * (decision_id, approval_id) produce the same DecisionResponse
2725
+ * because the idempotency key includes both.
2726
+ *
2727
+ * @generated from protobuf rpc: ResumeAfterApproval
2728
+ */
2729
+ resumeAfterApproval(input, options) {
2730
+ const method = this.methods[8], opt = this._transport.mergeOptions(options);
2731
+ return stackIntercept("unary", this._transport, method, opt, input);
2732
+ }
2733
+ // -- Explicit Release (Draft-01 §4 of Agent Spend Protocol) ---------------
2734
+ /**
2735
+ * Adapter-initiated release of a held reservation before commit.
2736
+ * Use when the provider call is aborted, the client times out, or the
2737
+ * agent run is cancelled — and the adapter wants to surface that
2738
+ * explicitly rather than waiting for an outcome-driven (APPLY_FAILED
2739
+ * or trace-event-driven) implicit release.
2740
+ *
2741
+ * Coexists with the implicit release paths in ConfirmPublishOutcome and
2742
+ * EmitTraceEvents; those remain unchanged. Implicit paths are still the
2743
+ * default for adapters that report outcomes naturally; the explicit RPC
2744
+ * is for adapters that want to match the Agent Spend Protocol Draft-01
2745
+ * wire shape (docs/specs/agent-spend-protocol/draft-01.md §4).
2746
+ *
2747
+ * Idempotent: repeated ReleaseReservation calls with the same
2748
+ * (reservation_id, idempotency_key) pair return the original outcome.
2749
+ *
2750
+ * @generated from protobuf rpc: ReleaseReservation
2751
+ */
2752
+ releaseReservation(input, options) {
2753
+ const method = this.methods[9], opt = this._transport.mergeOptions(options);
2754
+ return stackIntercept("unary", this._transport, method, opt, input);
2755
+ }
2756
+ // -- Session reservation (D41 voice substrate SR-V1) ---------------------
2757
+ /**
2758
+ * Reserve a session-scoped ledger hold before a realtime voice session
2759
+ * connects to paid model providers. Idempotent by
2760
+ * (tenant_id, session_id, route, idempotency_key).
2761
+ *
2762
+ * @generated from protobuf rpc: ReserveSession
2763
+ */
2764
+ reserveSession(input, options) {
2765
+ const method = this.methods[10], opt = this._transport.mergeOptions(options);
2766
+ return stackIntercept("unary", this._transport, method, opt, input);
2767
+ }
2768
+ /**
2769
+ * Commit one positive streaming spend delta against an existing session
2770
+ * reservation. Idempotent by (session_reservation_id,
2771
+ * streaming_commit_id). amount_atomic_delta MUST be > 0.
2772
+ *
2773
+ * @generated from protobuf rpc: CommitSessionDelta
2774
+ */
2775
+ commitSessionDelta(input, options) {
2776
+ const method = this.methods[11], opt = this._transport.mergeOptions(options);
2777
+ return stackIntercept("unary", this._transport, method, opt, input);
2778
+ }
2779
+ /**
2780
+ * Release the uncommitted remainder of a session-scoped reservation.
2781
+ * Idempotent by (session_reservation_id, idempotency_key).
2782
+ *
2783
+ * @generated from protobuf rpc: ReleaseSession
2784
+ */
2785
+ releaseSession(input, options) {
2786
+ const method = this.methods[12], opt = this._transport.mergeOptions(options);
2787
+ return stackIntercept("unary", this._transport, method, opt, input);
2788
+ }
2789
+ };
2790
+
2791
+ // src/_proto/spendguard/tokenizer/v1/tokenizer.ts
2792
+ var tokenizer_exports = {};
2793
+ __export(tokenizer_exports, {
2794
+ ShadowVerifyRequest: () => ShadowVerifyRequest,
2795
+ ShadowVerifyResponse: () => ShadowVerifyResponse,
2796
+ TokenizeRequest: () => TokenizeRequest,
2797
+ TokenizeRequest_Message: () => TokenizeRequest_Message,
2798
+ TokenizeRequest_Message_ToolCall: () => TokenizeRequest_Message_ToolCall,
2799
+ TokenizeResponse: () => TokenizeResponse,
2800
+ Tokenizer: () => Tokenizer
2801
+ });
2802
+ var TokenizeRequest$Type = class extends MessageType {
2803
+ constructor() {
2804
+ super("spendguard.tokenizer.v1.TokenizeRequest", [
2805
+ {
2806
+ no: 1,
2807
+ name: "model",
2808
+ kind: "scalar",
2809
+ T: 9
2810
+ /*ScalarType.STRING*/
2811
+ },
2812
+ { no: 2, name: "messages", kind: "message", repeat: 2, T: () => TokenizeRequest_Message },
2813
+ {
2814
+ no: 3,
2815
+ name: "raw_text",
2816
+ kind: "scalar",
2817
+ T: 9
2818
+ /*ScalarType.STRING*/
2819
+ },
2820
+ {
2821
+ no: 4,
2822
+ name: "request_id",
2823
+ kind: "scalar",
2824
+ T: 9
2825
+ /*ScalarType.STRING*/
2826
+ }
2827
+ ]);
2828
+ }
2829
+ };
2830
+ var TokenizeRequest = new TokenizeRequest$Type();
2831
+ var TokenizeRequest_Message$Type = class extends MessageType {
2832
+ constructor() {
2833
+ super("spendguard.tokenizer.v1.TokenizeRequest.Message", [
2834
+ {
2835
+ no: 1,
2836
+ name: "role",
2837
+ kind: "scalar",
2838
+ T: 9
2839
+ /*ScalarType.STRING*/
2840
+ },
2841
+ {
2842
+ no: 2,
2843
+ name: "content",
2844
+ kind: "scalar",
2845
+ T: 9
2846
+ /*ScalarType.STRING*/
2847
+ },
2848
+ { no: 3, name: "tool_calls", kind: "message", repeat: 2, T: () => TokenizeRequest_Message_ToolCall }
2849
+ ]);
2850
+ }
2851
+ };
2852
+ var TokenizeRequest_Message = new TokenizeRequest_Message$Type();
2853
+ var TokenizeRequest_Message_ToolCall$Type = class extends MessageType {
2854
+ constructor() {
2855
+ super("spendguard.tokenizer.v1.TokenizeRequest.Message.ToolCall", [
2856
+ {
2857
+ no: 1,
2858
+ name: "name",
2859
+ kind: "scalar",
2860
+ T: 9
2861
+ /*ScalarType.STRING*/
2862
+ },
2863
+ {
2864
+ no: 2,
2865
+ name: "arguments_json",
2866
+ kind: "scalar",
2867
+ T: 9
2868
+ /*ScalarType.STRING*/
2869
+ }
2870
+ ]);
2871
+ }
2872
+ };
2873
+ var TokenizeRequest_Message_ToolCall = new TokenizeRequest_Message_ToolCall$Type();
2874
+ var TokenizeResponse$Type = class extends MessageType {
2875
+ constructor() {
2876
+ super("spendguard.tokenizer.v1.TokenizeResponse", [
2877
+ {
2878
+ no: 1,
2879
+ name: "input_tokens",
2880
+ kind: "scalar",
2881
+ T: 3
2882
+ /*ScalarType.INT64*/
2883
+ },
2884
+ {
2885
+ no: 2,
2886
+ name: "tier",
2887
+ kind: "scalar",
2888
+ T: 9
2889
+ /*ScalarType.STRING*/
2890
+ },
2891
+ {
2892
+ no: 3,
2893
+ name: "tokenizer_version_id",
2894
+ kind: "scalar",
2895
+ T: 9
2896
+ /*ScalarType.STRING*/
2897
+ },
2898
+ {
2899
+ no: 4,
2900
+ name: "kind",
2901
+ kind: "scalar",
2902
+ T: 9
2903
+ /*ScalarType.STRING*/
2904
+ },
2905
+ {
2906
+ no: 5,
2907
+ name: "fallback_char_count",
2908
+ kind: "scalar",
2909
+ T: 3
2910
+ /*ScalarType.INT64*/
2911
+ },
2912
+ {
2913
+ no: 6,
2914
+ name: "fallback_margin_ratio",
2915
+ kind: "scalar",
2916
+ T: 2
2917
+ /*ScalarType.FLOAT*/
2918
+ },
2919
+ {
2920
+ no: 7,
2921
+ name: "latency_ns",
2922
+ kind: "scalar",
2923
+ T: 3
2924
+ /*ScalarType.INT64*/
2925
+ }
2926
+ ]);
2927
+ }
2928
+ };
2929
+ var TokenizeResponse = new TokenizeResponse$Type();
2930
+ var ShadowVerifyRequest$Type = class extends MessageType {
2931
+ constructor() {
2932
+ super("spendguard.tokenizer.v1.ShadowVerifyRequest", [
2933
+ {
2934
+ no: 1,
2935
+ name: "model",
2936
+ kind: "scalar",
2937
+ T: 9
2938
+ /*ScalarType.STRING*/
2939
+ },
2940
+ { no: 2, name: "messages", kind: "message", repeat: 2, T: () => TokenizeRequest_Message },
2941
+ {
2942
+ no: 3,
2943
+ name: "raw_text",
2944
+ kind: "scalar",
2945
+ T: 9
2946
+ /*ScalarType.STRING*/
2947
+ },
2948
+ {
2949
+ no: 4,
2950
+ name: "t2_input_tokens",
2951
+ kind: "scalar",
2952
+ T: 3
2953
+ /*ScalarType.INT64*/
2954
+ },
2955
+ {
2956
+ no: 5,
2957
+ name: "t2_tokenizer_version_id",
2958
+ kind: "scalar",
2959
+ T: 9
2960
+ /*ScalarType.STRING*/
2961
+ }
2962
+ ]);
2963
+ }
2964
+ };
2965
+ var ShadowVerifyRequest = new ShadowVerifyRequest$Type();
2966
+ var ShadowVerifyResponse$Type = class extends MessageType {
2967
+ constructor() {
2968
+ super("spendguard.tokenizer.v1.ShadowVerifyResponse", [
2969
+ {
2970
+ no: 1,
2971
+ name: "t1_input_tokens",
2972
+ kind: "scalar",
2973
+ T: 3
2974
+ /*ScalarType.INT64*/
2975
+ },
2976
+ {
2977
+ no: 2,
2978
+ name: "drift_ratio",
2979
+ kind: "scalar",
2980
+ T: 2
2981
+ /*ScalarType.FLOAT*/
2982
+ },
2983
+ {
2984
+ no: 3,
2985
+ name: "drift_alert_emitted",
2986
+ kind: "scalar",
2987
+ T: 8
2988
+ /*ScalarType.BOOL*/
2989
+ },
2990
+ {
2991
+ no: 4,
2992
+ name: "provider_latency_ms",
2993
+ kind: "scalar",
2994
+ T: 3
2995
+ /*ScalarType.INT64*/
2996
+ },
2997
+ {
2998
+ no: 5,
2999
+ name: "provider_request_id",
3000
+ kind: "scalar",
3001
+ T: 9
3002
+ /*ScalarType.STRING*/
3003
+ }
3004
+ ]);
3005
+ }
3006
+ };
3007
+ var ShadowVerifyResponse = new ShadowVerifyResponse$Type();
3008
+ var Tokenizer = new ServiceType("spendguard.tokenizer.v1.Tokenizer", [
3009
+ { name: "Tokenize", options: {}, I: TokenizeRequest, O: TokenizeResponse },
3010
+ { name: "ShadowVerify", options: {}, I: ShadowVerifyRequest, O: ShadowVerifyResponse }
3011
+ ]);
3012
+
3013
+ // src/_proto/spendguard/tokenizer/v1/tokenizer.client.ts
3014
+ var tokenizer_client_exports = {};
3015
+ __export(tokenizer_client_exports, {
3016
+ TokenizerClient: () => TokenizerClient
3017
+ });
3018
+ var TokenizerClient = class {
3019
+ constructor(_transport) {
3020
+ this._transport = _transport;
3021
+ }
3022
+ _transport;
3023
+ typeName = Tokenizer.typeName;
3024
+ methods = Tokenizer.methods;
3025
+ options = Tokenizer.options;
3026
+ /**
3027
+ * Hot-path tokenize. Synchronous; returns Tier 2 result (or Tier 3
3028
+ * fallback) under 1ms p99 (library form) / 3ms p99 (gRPC over UDS).
3029
+ * Per spec §10.1 latency SLO.
3030
+ *
3031
+ * @generated from protobuf rpc: Tokenize
3032
+ */
3033
+ tokenize(input, options) {
3034
+ const method = this.methods[0], opt = this._transport.mergeOptions(options);
3035
+ return stackIntercept("unary", this._transport, method, opt, input);
3036
+ }
3037
+ /**
3038
+ * Async shadow check via provider count_tokens API. Caller is
3039
+ * expected to be the shadow sampling worker, NOT the hot path.
3040
+ * Returns Tier 1 (provider-reported) count.
3041
+ *
3042
+ * SLICE_03: stub — returns gRPC UNIMPLEMENTED. SLICE_05 wires the
3043
+ * real shadow worker + Anthropic / Gemini provider clients.
3044
+ *
3045
+ * @generated from protobuf rpc: ShadowVerify
3046
+ */
3047
+ shadowVerify(input, options) {
3048
+ const method = this.methods[1], opt = this._transport.mergeOptions(options);
3049
+ return stackIntercept("unary", this._transport, method, opt, input);
3050
+ }
3051
+ };
3052
+
3053
+ export { adapter_exports as adapter, adapter_client_exports as adapterClient, common_exports as common, tokenizer_exports as tokenizer, tokenizer_client_exports as tokenizerClient };
3054
+ //# sourceMappingURL=proto.js.map
3055
+ //# sourceMappingURL=proto.js.map