runcycles 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,551 @@
1
+ /** Configuration for the Cycles client. */
2
+ declare class CyclesConfig {
3
+ readonly baseUrl: string;
4
+ readonly apiKey: string;
5
+ readonly tenant?: string;
6
+ readonly workspace?: string;
7
+ readonly app?: string;
8
+ readonly workflow?: string;
9
+ readonly agent?: string;
10
+ readonly toolset?: string;
11
+ readonly connectTimeout: number;
12
+ readonly readTimeout: number;
13
+ readonly retryEnabled: boolean;
14
+ readonly retryMaxAttempts: number;
15
+ readonly retryInitialDelay: number;
16
+ readonly retryMultiplier: number;
17
+ readonly retryMaxDelay: number;
18
+ constructor(options: {
19
+ baseUrl: string;
20
+ apiKey: string;
21
+ tenant?: string;
22
+ workspace?: string;
23
+ app?: string;
24
+ workflow?: string;
25
+ agent?: string;
26
+ toolset?: string;
27
+ connectTimeout?: number;
28
+ readTimeout?: number;
29
+ retryEnabled?: boolean;
30
+ retryMaxAttempts?: number;
31
+ retryInitialDelay?: number;
32
+ retryMultiplier?: number;
33
+ retryMaxDelay?: number;
34
+ });
35
+ static fromEnv(prefix?: string): CyclesConfig;
36
+ }
37
+
38
+ /** Enums, interfaces, and helper functions for the Cycles protocol. */
39
+ declare enum Unit {
40
+ USD_MICROCENTS = "USD_MICROCENTS",
41
+ TOKENS = "TOKENS",
42
+ CREDITS = "CREDITS",
43
+ RISK_POINTS = "RISK_POINTS"
44
+ }
45
+ declare enum CommitOveragePolicy {
46
+ REJECT = "REJECT",
47
+ ALLOW_IF_AVAILABLE = "ALLOW_IF_AVAILABLE",
48
+ ALLOW_WITH_OVERDRAFT = "ALLOW_WITH_OVERDRAFT"
49
+ }
50
+ declare enum Decision {
51
+ ALLOW = "ALLOW",
52
+ ALLOW_WITH_CAPS = "ALLOW_WITH_CAPS",
53
+ DENY = "DENY"
54
+ }
55
+ declare enum ReservationStatus {
56
+ ACTIVE = "ACTIVE",
57
+ COMMITTED = "COMMITTED",
58
+ RELEASED = "RELEASED",
59
+ EXPIRED = "EXPIRED"
60
+ }
61
+ declare enum CommitStatus {
62
+ COMMITTED = "COMMITTED"
63
+ }
64
+ declare enum ReleaseStatus {
65
+ RELEASED = "RELEASED"
66
+ }
67
+ declare enum ExtendStatus {
68
+ ACTIVE = "ACTIVE"
69
+ }
70
+ declare enum EventStatus {
71
+ APPLIED = "APPLIED"
72
+ }
73
+ declare enum ErrorCode {
74
+ INVALID_REQUEST = "INVALID_REQUEST",
75
+ UNAUTHORIZED = "UNAUTHORIZED",
76
+ FORBIDDEN = "FORBIDDEN",
77
+ NOT_FOUND = "NOT_FOUND",
78
+ BUDGET_EXCEEDED = "BUDGET_EXCEEDED",
79
+ RESERVATION_EXPIRED = "RESERVATION_EXPIRED",
80
+ RESERVATION_FINALIZED = "RESERVATION_FINALIZED",
81
+ IDEMPOTENCY_MISMATCH = "IDEMPOTENCY_MISMATCH",
82
+ UNIT_MISMATCH = "UNIT_MISMATCH",
83
+ OVERDRAFT_LIMIT_EXCEEDED = "OVERDRAFT_LIMIT_EXCEEDED",
84
+ DEBT_OUTSTANDING = "DEBT_OUTSTANDING",
85
+ INTERNAL_ERROR = "INTERNAL_ERROR",
86
+ UNKNOWN = "UNKNOWN"
87
+ }
88
+ interface Amount {
89
+ unit: Unit | string;
90
+ amount: number;
91
+ }
92
+ interface SignedAmount {
93
+ unit: Unit | string;
94
+ amount: number;
95
+ }
96
+ interface Subject {
97
+ tenant?: string;
98
+ workspace?: string;
99
+ app?: string;
100
+ workflow?: string;
101
+ agent?: string;
102
+ toolset?: string;
103
+ dimensions?: Record<string, string>;
104
+ }
105
+ interface Action {
106
+ kind: string;
107
+ name: string;
108
+ tags?: string[];
109
+ }
110
+ interface Caps {
111
+ maxTokens?: number;
112
+ maxStepsRemaining?: number;
113
+ toolAllowlist?: string[];
114
+ toolDenylist?: string[];
115
+ cooldownMs?: number;
116
+ }
117
+ interface CyclesMetrics {
118
+ tokensInput?: number;
119
+ tokensOutput?: number;
120
+ latencyMs?: number;
121
+ modelVersion?: string;
122
+ custom?: Record<string, unknown>;
123
+ }
124
+ interface Balance {
125
+ scope: string;
126
+ scopePath: string;
127
+ remaining: SignedAmount;
128
+ reserved?: Amount;
129
+ spent?: Amount;
130
+ allocated?: Amount;
131
+ debt?: Amount;
132
+ overdraftLimit?: Amount;
133
+ isOverLimit?: boolean;
134
+ }
135
+ interface ReservationCreateRequest {
136
+ idempotencyKey: string;
137
+ subject: Subject;
138
+ action: Action;
139
+ estimate: Amount;
140
+ ttlMs?: number;
141
+ gracePeriodMs?: number;
142
+ overagePolicy?: CommitOveragePolicy | string;
143
+ dryRun?: boolean;
144
+ metadata?: Record<string, unknown>;
145
+ }
146
+ interface CommitRequest {
147
+ idempotencyKey: string;
148
+ actual: Amount;
149
+ metrics?: CyclesMetrics;
150
+ metadata?: Record<string, unknown>;
151
+ }
152
+ interface ReleaseRequest {
153
+ idempotencyKey: string;
154
+ reason?: string;
155
+ }
156
+ interface ReservationExtendRequest {
157
+ idempotencyKey: string;
158
+ extendByMs: number;
159
+ metadata?: Record<string, unknown>;
160
+ }
161
+ interface DecisionRequest {
162
+ idempotencyKey: string;
163
+ subject: Subject;
164
+ action: Action;
165
+ estimate: Amount;
166
+ metadata?: Record<string, unknown>;
167
+ }
168
+ interface EventCreateRequest {
169
+ idempotencyKey: string;
170
+ subject: Subject;
171
+ action: Action;
172
+ actual: Amount;
173
+ overagePolicy?: CommitOveragePolicy | string;
174
+ metrics?: CyclesMetrics;
175
+ clientTimeMs?: number;
176
+ metadata?: Record<string, unknown>;
177
+ }
178
+ interface ReservationCreateResponse {
179
+ decision: Decision;
180
+ reservationId?: string;
181
+ affectedScopes: string[];
182
+ expiresAtMs?: number;
183
+ scopePath?: string;
184
+ reserved?: Amount;
185
+ caps?: Caps;
186
+ reasonCode?: string;
187
+ retryAfterMs?: number;
188
+ balances?: Balance[];
189
+ }
190
+ interface CommitResponse {
191
+ status: CommitStatus;
192
+ charged: Amount;
193
+ released?: Amount;
194
+ balances?: Balance[];
195
+ }
196
+ interface ReleaseResponse {
197
+ status: ReleaseStatus;
198
+ released: Amount;
199
+ balances?: Balance[];
200
+ }
201
+ interface ReservationExtendResponse {
202
+ status: ExtendStatus;
203
+ expiresAtMs: number;
204
+ balances?: Balance[];
205
+ }
206
+ interface DecisionResponse {
207
+ decision: Decision;
208
+ caps?: Caps;
209
+ reasonCode?: string;
210
+ retryAfterMs?: number;
211
+ affectedScopes?: string[];
212
+ }
213
+ interface EventCreateResponse {
214
+ status: EventStatus;
215
+ eventId: string;
216
+ balances?: Balance[];
217
+ }
218
+ interface DryRunResult {
219
+ decision: Decision;
220
+ caps?: Caps;
221
+ affectedScopes?: string[];
222
+ scopePath?: string;
223
+ reserved?: Amount;
224
+ balances?: Balance[];
225
+ reasonCode?: string;
226
+ retryAfterMs?: number;
227
+ }
228
+ interface ErrorResponse {
229
+ error: string;
230
+ message: string;
231
+ requestId: string;
232
+ details?: Record<string, unknown>;
233
+ }
234
+ interface ReservationDetail {
235
+ reservationId: string;
236
+ status: ReservationStatus;
237
+ subject: Subject;
238
+ action: Action;
239
+ reserved: Amount;
240
+ createdAtMs: number;
241
+ expiresAtMs: number;
242
+ scopePath: string;
243
+ affectedScopes: string[];
244
+ idempotencyKey?: string;
245
+ committed?: Amount;
246
+ finalizedAtMs?: number;
247
+ metadata?: Record<string, unknown>;
248
+ }
249
+ interface ReservationSummary {
250
+ reservationId: string;
251
+ status: ReservationStatus;
252
+ subject: Subject;
253
+ action: Action;
254
+ reserved: Amount;
255
+ createdAtMs: number;
256
+ expiresAtMs: number;
257
+ scopePath: string;
258
+ affectedScopes: string[];
259
+ idempotencyKey?: string;
260
+ }
261
+ interface ReservationListResponse {
262
+ reservations: ReservationSummary[];
263
+ hasMore?: boolean;
264
+ nextCursor?: string;
265
+ }
266
+ interface BalanceResponse {
267
+ balances: Balance[];
268
+ hasMore?: boolean;
269
+ nextCursor?: string;
270
+ }
271
+ declare function isAllowed(decision: Decision): boolean;
272
+ declare function isDenied(decision: Decision): boolean;
273
+ declare function isRetryableErrorCode(code: ErrorCode): boolean;
274
+ declare function errorCodeFromString(value: string | undefined): ErrorCode | undefined;
275
+ declare function isToolAllowed(caps: Caps, tool: string): boolean;
276
+ declare function isMetricsEmpty(metrics: CyclesMetrics): boolean;
277
+
278
+ /** Uniform response wrapper for all Cycles API calls. */
279
+
280
+ declare class CyclesResponse {
281
+ readonly status: number;
282
+ readonly body: Record<string, unknown> | undefined;
283
+ readonly errorMessage: string | undefined;
284
+ readonly headers: Record<string, string>;
285
+ private readonly _isTransportError;
286
+ readonly transportError: Error | undefined;
287
+ private constructor();
288
+ static success(status: number, body: Record<string, unknown>, headers?: Record<string, string>): CyclesResponse;
289
+ static httpError(status: number, errorMessage: string, body?: Record<string, unknown>, headers?: Record<string, string>): CyclesResponse;
290
+ static transportError(err: Error): CyclesResponse;
291
+ get requestId(): string | undefined;
292
+ get rateLimitRemaining(): number | undefined;
293
+ get rateLimitReset(): number | undefined;
294
+ get cyclesTenant(): string | undefined;
295
+ get isSuccess(): boolean;
296
+ get isClientError(): boolean;
297
+ get isServerError(): boolean;
298
+ get isTransportError(): boolean;
299
+ getBodyAttribute(key: string): unknown;
300
+ getErrorResponse(): ErrorResponse | undefined;
301
+ }
302
+
303
+ /**
304
+ * Async HTTP client for the Cycles API.
305
+ *
306
+ * The client is transport-oriented and runtime-agnostic: it sends and receives
307
+ * wire-format (snake_case) JSON bodies without any automatic key conversion.
308
+ * Callers are responsible for building wire-format request bodies; the response
309
+ * body is returned in wire format for explicit mapping by the caller.
310
+ *
311
+ * Timeout note: Node's built-in fetch does not distinguish connection timeout
312
+ * from read timeout. The config's connectTimeout and readTimeout are summed
313
+ * into a single AbortSignal.timeout() value that caps total request duration.
314
+ * For stricter timeout control, consider using a custom HTTP client.
315
+ */
316
+
317
+ declare class CyclesClient {
318
+ private readonly _config;
319
+ constructor(config: CyclesConfig);
320
+ get config(): CyclesConfig;
321
+ createReservation(request: Record<string, unknown>): Promise<CyclesResponse>;
322
+ commitReservation(reservationId: string, request: Record<string, unknown>): Promise<CyclesResponse>;
323
+ releaseReservation(reservationId: string, request: Record<string, unknown>): Promise<CyclesResponse>;
324
+ extendReservation(reservationId: string, request: Record<string, unknown>): Promise<CyclesResponse>;
325
+ decide(request: Record<string, unknown>): Promise<CyclesResponse>;
326
+ listReservations(params?: Record<string, string>): Promise<CyclesResponse>;
327
+ getReservation(reservationId: string): Promise<CyclesResponse>;
328
+ getBalances(params: Record<string, string>): Promise<CyclesResponse>;
329
+ createEvent(request: Record<string, unknown>): Promise<CyclesResponse>;
330
+ private _post;
331
+ private _get;
332
+ private _handleResponse;
333
+ }
334
+
335
+ /** Lifecycle orchestration: reserve -> execute -> commit/release. */
336
+
337
+ interface WithCyclesConfig {
338
+ estimate: number | ((...args: unknown[]) => number);
339
+ actual?: number | ((result: unknown) => number);
340
+ actionKind?: string;
341
+ actionName?: string;
342
+ actionTags?: string[];
343
+ unit?: string;
344
+ ttlMs?: number;
345
+ gracePeriodMs?: number;
346
+ overagePolicy?: string;
347
+ dryRun?: boolean;
348
+ tenant?: string;
349
+ workspace?: string;
350
+ app?: string;
351
+ workflow?: string;
352
+ agent?: string;
353
+ toolset?: string;
354
+ dimensions?: Record<string, string>;
355
+ useEstimateIfActualNotProvided?: boolean;
356
+ }
357
+
358
+ /** The withCycles higher-order function for budget-guarded function calls. */
359
+
360
+ declare function setDefaultClient(client: CyclesClient): void;
361
+ declare function setDefaultConfig(config: CyclesConfig): void;
362
+ declare function withCycles<TArgs extends unknown[], TResult>(options: WithCyclesConfig & {
363
+ client?: CyclesClient;
364
+ }, fn: (...args: TArgs) => Promise<TResult>): (...args: TArgs) => Promise<TResult>;
365
+
366
+ /**
367
+ * First-class streaming adapter for Cycles budget governance.
368
+ *
369
+ * Unlike `withCycles` (which wraps a Promise-returning function and commits
370
+ * immediately after the function resolves), `reserveForStream` returns a
371
+ * handle that lets the caller control when to commit or release. This is
372
+ * essential for LLM streaming where the function returns a stream object
373
+ * immediately but actual usage is only known after the stream finishes.
374
+ *
375
+ * The handle owns its own finalization: calling `commit()` or `release()`
376
+ * automatically stops the heartbeat. There is no need for a `finally`
377
+ * block around the stream — the heartbeat lives until a terminal
378
+ * operation (commit/release) is reached.
379
+ *
380
+ * RACE SAFETY: In real streaming code, multiple terminal paths can fire
381
+ * concurrently (onFinish, error handler, abort signal, client disconnect).
382
+ * The handle is once-only: the first terminal call (commit/release/dispose)
383
+ * wins, and subsequent calls are either no-ops (release, dispose) or throw
384
+ * (commit). Check `handle.finalized` to inspect state.
385
+ *
386
+ * Typical lifecycle:
387
+ * 1. `reserveForStream(...)` — creates reservation + starts heartbeat
388
+ * 2. Start streaming (e.g. `streamText(...)`)
389
+ * 3. On stream finish → `handle.commit(actualCost, metrics)` (stops heartbeat)
390
+ * 4. On stream error/abort → `handle.release("aborted")` (stops heartbeat)
391
+ * 5. If stream startup fails before streaming begins → `handle.dispose()`
392
+ */
393
+
394
+ interface StreamReservationOptions {
395
+ client: CyclesClient;
396
+ estimate: number;
397
+ unit?: string;
398
+ actionKind?: string;
399
+ actionName?: string;
400
+ actionTags?: string[];
401
+ ttlMs?: number;
402
+ gracePeriodMs?: number;
403
+ overagePolicy?: string;
404
+ tenant?: string;
405
+ workspace?: string;
406
+ app?: string;
407
+ workflow?: string;
408
+ agent?: string;
409
+ toolset?: string;
410
+ dimensions?: Record<string, string>;
411
+ }
412
+ interface StreamReservation {
413
+ /** The reservation ID from the server. */
414
+ readonly reservationId: string;
415
+ /** The budget decision (ALLOW or ALLOW_WITH_CAPS). */
416
+ readonly decision: Decision;
417
+ /** Caps imposed by the budget, if any. */
418
+ readonly caps: Caps | undefined;
419
+ /** True after commit(), release(), or dispose() has been called. */
420
+ readonly finalized: boolean;
421
+ /**
422
+ * Commit actual usage after the stream completes successfully.
423
+ * Automatically stops the heartbeat. Call from `onFinish` or equivalent.
424
+ * Throws `CyclesError` if the handle is already finalized.
425
+ */
426
+ commit(actual: number, metrics?: CyclesMetrics, metadata?: Record<string, unknown>): Promise<void>;
427
+ /**
428
+ * Release the reservation on error or abort.
429
+ * Automatically stops the heartbeat. Best-effort — errors are swallowed.
430
+ * No-op if the handle is already finalized.
431
+ */
432
+ release(reason?: string): Promise<void>;
433
+ /**
434
+ * Stop the heartbeat timer without committing or releasing.
435
+ * Use only for stream startup failures where the stream was never started.
436
+ * For normal finalization, use `commit()` or `release()` instead.
437
+ * No-op if the handle is already finalized.
438
+ */
439
+ dispose(): void;
440
+ }
441
+ /**
442
+ * Reserve budget for a streaming operation and return a handle to
443
+ * commit or release when the stream completes.
444
+ *
445
+ * Throws `BudgetExceededError` (or other protocol errors) if the
446
+ * reservation is denied.
447
+ */
448
+ declare function reserveForStream(options: StreamReservationOptions): Promise<StreamReservation>;
449
+
450
+ /** AsyncLocalStorage-based context holder for active Cycles reservations. */
451
+
452
+ interface CyclesContext {
453
+ readonly reservationId: string;
454
+ readonly estimate: number;
455
+ readonly decision: Decision;
456
+ readonly caps?: Caps;
457
+ expiresAtMs?: number;
458
+ readonly affectedScopes?: string[];
459
+ readonly scopePath?: string;
460
+ readonly reserved?: Amount;
461
+ readonly balances?: Balance[];
462
+ metrics?: CyclesMetrics;
463
+ commitMetadata?: Record<string, unknown>;
464
+ }
465
+ declare function getCyclesContext(): CyclesContext | undefined;
466
+
467
+ /** Exception hierarchy for the Cycles client. */
468
+ declare class CyclesError extends Error {
469
+ constructor(message: string);
470
+ }
471
+ declare class CyclesProtocolError extends CyclesError {
472
+ readonly status: number;
473
+ readonly errorCode: string | undefined;
474
+ readonly reasonCode: string | undefined;
475
+ readonly retryAfterMs: number | undefined;
476
+ readonly requestId: string | undefined;
477
+ readonly details: Record<string, unknown> | undefined;
478
+ constructor(message: string, options?: {
479
+ status?: number;
480
+ errorCode?: string;
481
+ reasonCode?: string;
482
+ retryAfterMs?: number;
483
+ requestId?: string;
484
+ details?: Record<string, unknown>;
485
+ });
486
+ isBudgetExceeded(): boolean;
487
+ isOverdraftLimitExceeded(): boolean;
488
+ isDebtOutstanding(): boolean;
489
+ isReservationExpired(): boolean;
490
+ isReservationFinalized(): boolean;
491
+ isIdempotencyMismatch(): boolean;
492
+ isUnitMismatch(): boolean;
493
+ isRetryable(): boolean;
494
+ }
495
+ declare class BudgetExceededError extends CyclesProtocolError {
496
+ constructor(message: string, options?: ConstructorParameters<typeof CyclesProtocolError>[1]);
497
+ }
498
+ declare class OverdraftLimitExceededError extends CyclesProtocolError {
499
+ constructor(message: string, options?: ConstructorParameters<typeof CyclesProtocolError>[1]);
500
+ }
501
+ declare class DebtOutstandingError extends CyclesProtocolError {
502
+ constructor(message: string, options?: ConstructorParameters<typeof CyclesProtocolError>[1]);
503
+ }
504
+ declare class ReservationExpiredError extends CyclesProtocolError {
505
+ constructor(message: string, options?: ConstructorParameters<typeof CyclesProtocolError>[1]);
506
+ }
507
+ declare class ReservationFinalizedError extends CyclesProtocolError {
508
+ constructor(message: string, options?: ConstructorParameters<typeof CyclesProtocolError>[1]);
509
+ }
510
+ declare class CyclesTransportError extends CyclesError {
511
+ readonly cause: Error | undefined;
512
+ constructor(message: string, options?: {
513
+ cause?: Error;
514
+ });
515
+ }
516
+
517
+ /**
518
+ * Explicit request/response mappers between camelCase TypeScript interfaces
519
+ * and snake_case wire format.
520
+ *
521
+ * These are intentionally verbose — each field is mapped individually so that
522
+ * protocol drift is immediately visible, special cases are handled explicitly,
523
+ * and the wire contract is auditable.
524
+ */
525
+
526
+ declare function metricsToWire(metrics: CyclesMetrics): Record<string, unknown>;
527
+ declare function capsFromWire(wire: Record<string, unknown> | undefined): Caps | undefined;
528
+ declare function reservationCreateResponseFromWire(wire: Record<string, unknown>): ReservationCreateResponse;
529
+ declare function commitResponseFromWire(wire: Record<string, unknown>): CommitResponse;
530
+ declare function releaseResponseFromWire(wire: Record<string, unknown>): ReleaseResponse;
531
+ declare function reservationExtendResponseFromWire(wire: Record<string, unknown>): ReservationExtendResponse;
532
+ declare function decisionResponseFromWire(wire: Record<string, unknown>): DecisionResponse;
533
+ declare function eventCreateResponseFromWire(wire: Record<string, unknown>): EventCreateResponse;
534
+ declare function reservationDetailFromWire(wire: Record<string, unknown>): ReservationDetail;
535
+ declare function reservationSummaryFromWire(wire: Record<string, unknown>): ReservationSummary;
536
+ declare function reservationListResponseFromWire(wire: Record<string, unknown>): ReservationListResponse;
537
+ declare function balanceResponseFromWire(wire: Record<string, unknown>): BalanceResponse;
538
+ declare function errorResponseFromWire(wire: Record<string, unknown>): {
539
+ error: string;
540
+ message: string;
541
+ requestId: string;
542
+ details?: Record<string, unknown>;
543
+ } | undefined;
544
+ declare function reservationCreateRequestToWire(req: ReservationCreateRequest): Record<string, unknown>;
545
+ declare function commitRequestToWire(req: CommitRequest): Record<string, unknown>;
546
+ declare function releaseRequestToWire(req: ReleaseRequest): Record<string, unknown>;
547
+ declare function reservationExtendRequestToWire(req: ReservationExtendRequest): Record<string, unknown>;
548
+ declare function decisionRequestToWire(req: DecisionRequest): Record<string, unknown>;
549
+ declare function eventCreateRequestToWire(req: EventCreateRequest): Record<string, unknown>;
550
+
551
+ export { type Action, type Amount, type Balance, type BalanceResponse, BudgetExceededError, type Caps, CommitOveragePolicy, type CommitRequest, type CommitResponse, CommitStatus, CyclesClient, CyclesConfig, type CyclesContext, CyclesError, type CyclesMetrics, CyclesProtocolError, CyclesResponse, CyclesTransportError, DebtOutstandingError, Decision, type DecisionRequest, type DecisionResponse, type DryRunResult, ErrorCode, type ErrorResponse, type EventCreateRequest, type EventCreateResponse, EventStatus, ExtendStatus, OverdraftLimitExceededError, type ReleaseRequest, type ReleaseResponse, ReleaseStatus, type ReservationCreateRequest, type ReservationCreateResponse, type ReservationDetail, ReservationExpiredError, type ReservationExtendRequest, type ReservationExtendResponse, ReservationFinalizedError, type ReservationListResponse, ReservationStatus, type ReservationSummary, type SignedAmount, type StreamReservation, type StreamReservationOptions, type Subject, Unit, type WithCyclesConfig, balanceResponseFromWire, capsFromWire, commitRequestToWire, commitResponseFromWire, decisionRequestToWire, decisionResponseFromWire, errorCodeFromString, errorResponseFromWire, eventCreateRequestToWire, eventCreateResponseFromWire, getCyclesContext, isAllowed, isDenied, isMetricsEmpty, isRetryableErrorCode, isToolAllowed, metricsToWire, releaseRequestToWire, releaseResponseFromWire, reservationCreateRequestToWire, reservationCreateResponseFromWire, reservationDetailFromWire, reservationExtendRequestToWire, reservationExtendResponseFromWire, reservationListResponseFromWire, reservationSummaryFromWire, reserveForStream, setDefaultClient, setDefaultConfig, withCycles };