@aexhq/sdk 0.54.1 → 0.55.1
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/README.md +16 -123
- package/dist/errors.d.ts +33 -0
- package/dist/errors.js +69 -0
- package/dist/index.d.ts +16 -23
- package/dist/index.js +18 -16
- package/dist/json.d.ts +4 -0
- package/dist/json.js +46 -0
- package/dist/session.d.ts +74 -0
- package/dist/session.js +255 -0
- package/dist/transport.d.ts +22 -0
- package/dist/transport.js +196 -0
- package/package.json +16 -64
- package/LICENSE +0 -201
- package/NOTICE +0 -38
- package/dist/client/aex.d.ts +0 -38
- package/dist/client/aex.js +0 -149
- package/dist/client/aex.js.map +0 -1
- package/dist/client/credentials.d.ts +0 -25
- package/dist/client/credentials.js +0 -97
- package/dist/client/credentials.js.map +0 -1
- package/dist/client/routing.d.ts +0 -7
- package/dist/client/routing.js +0 -26
- package/dist/client/routing.js.map +0 -1
- package/dist/downloads/download.d.ts +0 -18
- package/dist/downloads/download.js +0 -67
- package/dist/downloads/download.js.map +0 -1
- package/dist/files/workspace-files.d.ts +0 -55
- package/dist/files/workspace-files.js +0 -150
- package/dist/files/workspace-files.js.map +0 -1
- package/dist/generated/errors.d.ts +0 -12
- package/dist/generated/errors.js +0 -66
- package/dist/generated/errors.js.map +0 -1
- package/dist/generated/models.d.ts +0 -853
- package/dist/generated/models.js +0 -62
- package/dist/generated/models.js.map +0 -1
- package/dist/generated/resources.d.ts +0 -265
- package/dist/generated/resources.js +0 -207
- package/dist/generated/resources.js.map +0 -1
- package/dist/generated/routes.d.ts +0 -44
- package/dist/generated/routes.js +0 -510
- package/dist/generated/routes.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/observations/stream.d.ts +0 -1
- package/dist/observations/stream.js +0 -18
- package/dist/observations/stream.js.map +0 -1
- package/dist/transport/errors.d.ts +0 -60
- package/dist/transport/errors.js +0 -107
- package/dist/transport/errors.js.map +0 -1
- package/dist/transport/pagination.d.ts +0 -8
- package/dist/transport/pagination.js +0 -34
- package/dist/transport/pagination.js.map +0 -1
- package/dist/transport/retry.d.ts +0 -21
- package/dist/transport/retry.js +0 -37
- package/dist/transport/retry.js.map +0 -1
- package/dist/transport/transport.d.ts +0 -33
- package/dist/transport/transport.js +0 -111
- package/dist/transport/transport.js.map +0 -1
|
@@ -1,853 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The public wire model types used by the generated SDK resources.
|
|
3
|
-
*
|
|
4
|
-
* These declarations and identifier utilities are projected from the same
|
|
5
|
-
* authored contract as `@aexhq/wire`, but carry no runtime validator dependency.
|
|
6
|
-
*/
|
|
7
|
-
export declare const ID_PREFIXES: {
|
|
8
|
-
readonly user: "usr";
|
|
9
|
-
readonly account: "acc";
|
|
10
|
-
readonly organization: "org";
|
|
11
|
-
readonly membership: "mem";
|
|
12
|
-
readonly invitation: "inv";
|
|
13
|
-
readonly workspace: "wsp";
|
|
14
|
-
readonly api_key: "key";
|
|
15
|
-
readonly provider_credential: "pcr";
|
|
16
|
-
readonly session: "ses";
|
|
17
|
-
readonly message: "msg";
|
|
18
|
-
readonly agent: "agt";
|
|
19
|
-
readonly tool_call: "tcl";
|
|
20
|
-
readonly operation: "op";
|
|
21
|
-
readonly approval: "apr";
|
|
22
|
-
readonly generation: "gen";
|
|
23
|
-
readonly file_upload: "ful";
|
|
24
|
-
readonly file_download: "fdl";
|
|
25
|
-
readonly observation: "obs";
|
|
26
|
-
readonly upload: "upl";
|
|
27
|
-
readonly measurement: "msr";
|
|
28
|
-
readonly statement: "stm";
|
|
29
|
-
readonly payment_method: "pmt";
|
|
30
|
-
readonly billing_transaction: "txn";
|
|
31
|
-
};
|
|
32
|
-
export type IdKind = keyof typeof ID_PREFIXES;
|
|
33
|
-
export type Id<K extends IdKind = IdKind> = `${(typeof ID_PREFIXES)[K]}_${string}`;
|
|
34
|
-
export declare const ID_KINDS: readonly ("message" | "user" | "account" | "organization" | "membership" | "invitation" | "workspace" | "api_key" | "provider_credential" | "session" | "agent" | "tool_call" | "operation" | "approval" | "generation" | "file_upload" | "file_download" | "observation" | "upload" | "measurement" | "statement" | "payment_method" | "billing_transaction")[];
|
|
35
|
-
export declare function idPatternSource(kind: IdKind): string;
|
|
36
|
-
export declare function idPattern(kind: IdKind): RegExp;
|
|
37
|
-
export declare function isId<K extends IdKind>(kind: K, value: unknown): value is Id<K>;
|
|
38
|
-
export declare function assertId<K extends IdKind>(kind: K, value: unknown, label?: string): Id<K>;
|
|
39
|
-
export declare function newId<K extends IdKind>(kind: K): Id<K>;
|
|
40
|
-
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
41
|
-
[key: string]: JsonValue;
|
|
42
|
-
};
|
|
43
|
-
/** An account in good standing. */
|
|
44
|
-
export interface AccountActiveState {
|
|
45
|
-
readonly changedAt: string;
|
|
46
|
-
readonly revision: number;
|
|
47
|
-
}
|
|
48
|
-
/** Whether the account may consume paid capacity. */
|
|
49
|
-
export type AccountOperationalState = (AccountActiveState & {
|
|
50
|
-
readonly status: "active";
|
|
51
|
-
}) | (AccountPausedState & {
|
|
52
|
-
readonly status: "paused";
|
|
53
|
-
});
|
|
54
|
-
/** Why the personal prepaid account cannot admit paid work. */
|
|
55
|
-
export type AccountPauseReason = "top_up_required" | "payment_hold" | "dispute_hold" | "account_closed";
|
|
56
|
-
/** A paused account and its customer-visible remedy. */
|
|
57
|
-
export interface AccountPausedState {
|
|
58
|
-
readonly changedAt: string;
|
|
59
|
-
readonly minimumRestoreCents?: string;
|
|
60
|
-
readonly reason: AccountPauseReason;
|
|
61
|
-
readonly revision: number;
|
|
62
|
-
}
|
|
63
|
-
/** The one error envelope every failing request returns. */
|
|
64
|
-
export interface ApiError {
|
|
65
|
-
readonly error: ApiErrorBody;
|
|
66
|
-
}
|
|
67
|
-
/** The failure itself. */
|
|
68
|
-
export interface ApiErrorBody {
|
|
69
|
-
readonly code: "unauthenticated" | "forbidden" | "insufficient_scope" | "token_invalid" | "token_revoked" | "token_expired" | "malformed_token" | "slow_down" | "not_found" | "gone" | "idempotency_conflict" | "idempotency_in_flight" | "api_key_secret_unavailable" | "operation_idempotency_conflict" | "invalid_request" | "invalid_scope" | "invalid_cursor" | "invalid_file_selection" | "invalid_range" | "unsupported_media_type" | "payload_too_large" | "limit_exceeded" | "session_not_idle" | "session_terminated" | "workspace_activation_required" | "workspace_not_live" | "session_deleting" | "session_deleted" | "deletion_in_progress" | "resource_conflict" | "last_owner_required" | "operation_not_cancelable" | "approval_not_found" | "approval_already_resolved" | "approval_binding_changed" | "file_not_found" | "content_missing" | "download_grant_expired" | "invalid_query" | "invalid_network_policy" | "unsupported_package_ecosystem" | "package_resolution_failed" | "package_artifact_unavailable" | "package_integrity_mismatch" | "unknown_provider" | "unknown_model" | "invalid_auto_topup_policy" | "payment_method_required" | "authentication_unavailable" | "account_paused" | "account_state_unavailable" | "precondition_failed" | "wrong_workspace_region" | "usage_unavailable" | "usage_coverage_gap" | "rate_limited" | "upstream_error" | "workspace_provision_pending" | "commit_outcome_unknown" | "not_implemented" | "internal_error";
|
|
70
|
-
readonly details?: ErrorDetails;
|
|
71
|
-
readonly message: string;
|
|
72
|
-
readonly operationId?: Id<"operation">;
|
|
73
|
-
readonly requestId: string;
|
|
74
|
-
readonly retryable: boolean;
|
|
75
|
-
}
|
|
76
|
-
/** Workspace API key metadata. Secret material is never returned by reads. */
|
|
77
|
-
export interface ApiKey {
|
|
78
|
-
readonly createdAt: string;
|
|
79
|
-
readonly id: Id<"api_key">;
|
|
80
|
-
readonly name: string;
|
|
81
|
-
readonly revokedAt?: string;
|
|
82
|
-
readonly scopes: ReadonlyArray<"account:read" | "account:write" | "api_keys:read" | "api_keys:write" | "billing:read" | "billing:write" | "sessions:read" | "sessions:write" | "sessions:delete" | "resources:read" | "resources:write">;
|
|
83
|
-
readonly workspaceId: Id<"workspace">;
|
|
84
|
-
}
|
|
85
|
-
/** Mint a key for the account's fixed workspace. */
|
|
86
|
-
export interface ApiKeyCreateRequest {
|
|
87
|
-
readonly name: string;
|
|
88
|
-
readonly scopes: ReadonlyArray<"account:read" | "account:write" | "api_keys:read" | "api_keys:write" | "billing:read" | "billing:write" | "sessions:read" | "sessions:write" | "sessions:delete" | "resources:read" | "resources:write">;
|
|
89
|
-
readonly workspaceId: Id<"workspace">;
|
|
90
|
-
}
|
|
91
|
-
/** One bounded page of API key metadata. */
|
|
92
|
-
export interface ApiKeyPage {
|
|
93
|
-
readonly items: ReadonlyArray<ApiKey>;
|
|
94
|
-
readonly nextCursor?: string;
|
|
95
|
-
}
|
|
96
|
-
/** The closed first-party client completing Google authorization. */
|
|
97
|
-
export type AuthClient = "dashboard" | "cli";
|
|
98
|
-
/** The current prepaid position of the caller's personal account. */
|
|
99
|
-
export interface BillingBalance {
|
|
100
|
-
readonly accountId: Id<"account">;
|
|
101
|
-
readonly availableCents: string;
|
|
102
|
-
readonly currency: Currency;
|
|
103
|
-
readonly pendingCents: string;
|
|
104
|
-
readonly reservedCents: string;
|
|
105
|
-
readonly updatedAt: string;
|
|
106
|
-
}
|
|
107
|
-
/** One immutable customer-visible ledger transaction. */
|
|
108
|
-
export interface BillingTransaction {
|
|
109
|
-
readonly amountCents: string;
|
|
110
|
-
readonly balanceAfterCents: string;
|
|
111
|
-
readonly currency: Currency;
|
|
112
|
-
readonly direction: BillingTransactionDirection;
|
|
113
|
-
readonly id: Id<"billing_transaction">;
|
|
114
|
-
readonly kind: BillingTransactionKind;
|
|
115
|
-
readonly occurredAt: string;
|
|
116
|
-
readonly reversesTransactionId?: Id<"billing_transaction">;
|
|
117
|
-
readonly sessionId?: Id<"session">;
|
|
118
|
-
}
|
|
119
|
-
/** Whether the transaction increases or decreases available prepaid value. */
|
|
120
|
-
export type BillingTransactionDirection = "credit" | "debit";
|
|
121
|
-
/** The customer-visible reason for an immutable balanced ledger transaction. */
|
|
122
|
-
export type BillingTransactionKind = "top_up" | "usage" | "refund" | "reversal" | "reservation" | "reservation_release";
|
|
123
|
-
/** One newest-first page of immutable ledger transactions. */
|
|
124
|
-
export interface BillingTransactionPage {
|
|
125
|
-
readonly items: ReadonlyArray<BillingTransaction>;
|
|
126
|
-
readonly nextCursor?: string;
|
|
127
|
-
}
|
|
128
|
-
/** The independently measured and rated launch categories. */
|
|
129
|
-
export type BillingUsageCategory = "model" | "runtime" | "storage" | "transfer";
|
|
130
|
-
/** The trustworthy completeness boundary for one usage answer. */
|
|
131
|
-
export interface BillingUsageCoverage {
|
|
132
|
-
readonly completeThrough: string;
|
|
133
|
-
readonly hasGap: boolean;
|
|
134
|
-
readonly includesThrough: string;
|
|
135
|
-
}
|
|
136
|
-
/** One bounded rated-usage aggregate with exact charge evidence. */
|
|
137
|
-
export interface BillingUsageItem {
|
|
138
|
-
readonly amountCents: string;
|
|
139
|
-
readonly category: BillingUsageCategory;
|
|
140
|
-
readonly chargedQuantity: string;
|
|
141
|
-
readonly currency: Currency;
|
|
142
|
-
readonly model?: string;
|
|
143
|
-
readonly provider?: ProviderId;
|
|
144
|
-
readonly quantity: string;
|
|
145
|
-
readonly serviceTime: TimeRange;
|
|
146
|
-
readonly sessionId?: Id<"session">;
|
|
147
|
-
readonly settlement: BillingUsageSettlement;
|
|
148
|
-
readonly unit: string;
|
|
149
|
-
}
|
|
150
|
-
/** One bounded page of rated usage and its explicit completeness boundary. */
|
|
151
|
-
export interface BillingUsagePage {
|
|
152
|
-
readonly coverage: BillingUsageCoverage;
|
|
153
|
-
readonly items: ReadonlyArray<BillingUsageItem>;
|
|
154
|
-
readonly nextCursor?: string;
|
|
155
|
-
}
|
|
156
|
-
/** Whether this rated row has been posted to the money ledger. */
|
|
157
|
-
export type BillingUsageSettlement = "pending" | "settled";
|
|
158
|
-
/** How inline blob bytes are encoded. */
|
|
159
|
-
export type BlobEncoding = "utf8" | "base64";
|
|
160
|
-
/** A small value carried in the request. */
|
|
161
|
-
export interface BlobInline {
|
|
162
|
-
readonly data: string;
|
|
163
|
-
readonly encoding: BlobEncoding;
|
|
164
|
-
readonly sha256: string;
|
|
165
|
-
}
|
|
166
|
-
/** Where a registered value's bytes come from. */
|
|
167
|
-
export type BlobInput = (BlobInline & {
|
|
168
|
-
readonly type: "inline";
|
|
169
|
-
}) | (BlobUpload & {
|
|
170
|
-
readonly type: "upload";
|
|
171
|
-
}) | (BlobUrl & {
|
|
172
|
-
readonly type: "url";
|
|
173
|
-
});
|
|
174
|
-
/** A large value staged through the upload surface. */
|
|
175
|
-
export interface BlobUpload {
|
|
176
|
-
readonly sha256: string;
|
|
177
|
-
readonly sizeBytes: string;
|
|
178
|
-
readonly uploadId: Id<"upload">;
|
|
179
|
-
}
|
|
180
|
-
/** An HTTPS source fetched asynchronously under the platform SSRF, redirect, time and size policy. */
|
|
181
|
-
export interface BlobUrl {
|
|
182
|
-
readonly url: string;
|
|
183
|
-
}
|
|
184
|
-
/** An explicit inclusive byte range over an immutable object. */
|
|
185
|
-
export interface ByteRange {
|
|
186
|
-
readonly endInclusive: string;
|
|
187
|
-
readonly start: string;
|
|
188
|
-
}
|
|
189
|
-
/** Customer-safe card-network display metadata reported by Stripe. */
|
|
190
|
-
export type CardBrand = "visa" | "mastercard" | "amex" | "discover" | "diners" | "jcb" | "unionpay" | "unknown";
|
|
191
|
-
/** Public, non-secret Google authorization configuration for the native CLI. */
|
|
192
|
-
export interface CliAuthConfig {
|
|
193
|
-
readonly authorizationUrl: string;
|
|
194
|
-
readonly clientId: string;
|
|
195
|
-
readonly redirectUri: string;
|
|
196
|
-
}
|
|
197
|
-
/** One resolved sandbox compute dimension. */
|
|
198
|
-
export interface ComputeShape {
|
|
199
|
-
readonly memoryMiB: number;
|
|
200
|
-
readonly vcpus: number;
|
|
201
|
-
}
|
|
202
|
-
/** A reference to a stored payload. The bytes are never published in a registry response; they are reached through a download grant. */
|
|
203
|
-
export interface ContentRef {
|
|
204
|
-
readonly sha256: string;
|
|
205
|
-
readonly sizeBytes: string;
|
|
206
|
-
}
|
|
207
|
-
/** The only launch currency. */
|
|
208
|
-
export type Currency = "USD";
|
|
209
|
-
/** The single bounded read that fills the launch dashboard shell. */
|
|
210
|
-
export interface DashboardBootstrap {
|
|
211
|
-
readonly accountId: Id<"account">;
|
|
212
|
-
readonly accountState: AccountOperationalState;
|
|
213
|
-
readonly email: string;
|
|
214
|
-
readonly generatedAt: string;
|
|
215
|
-
readonly userId: Id<"user">;
|
|
216
|
-
readonly workspace: Workspace;
|
|
217
|
-
}
|
|
218
|
-
/** A rotated first-party user session returned exactly once. */
|
|
219
|
-
export interface DashboardSessionCredential {
|
|
220
|
-
readonly expiresAt: string;
|
|
221
|
-
readonly session: string;
|
|
222
|
-
readonly userId: Id<"user">;
|
|
223
|
-
}
|
|
224
|
-
/** Complete a Google OAuth sign-in using PKCE-bound state and one registered first-party callback. */
|
|
225
|
-
export interface DashboardSessionRequest {
|
|
226
|
-
readonly client: AuthClient;
|
|
227
|
-
readonly code: string;
|
|
228
|
-
readonly codeVerifier: string;
|
|
229
|
-
readonly state: string;
|
|
230
|
-
}
|
|
231
|
-
/** Minimal deletion marker returned while content cleanup runs. */
|
|
232
|
-
export interface DeletingSession {
|
|
233
|
-
readonly id: Id<"session">;
|
|
234
|
-
readonly operationId: Id<"operation">;
|
|
235
|
-
readonly startedAt: string;
|
|
236
|
-
}
|
|
237
|
-
/** A short-lived signed grant for exactly one object and range. */
|
|
238
|
-
export interface DownloadGrant {
|
|
239
|
-
readonly authorizedBytes: string;
|
|
240
|
-
readonly expiresAt: string;
|
|
241
|
-
readonly measurementId: Id<"measurement">;
|
|
242
|
-
readonly range?: ByteRange;
|
|
243
|
-
readonly sha256: string;
|
|
244
|
-
readonly sizeBytes: string;
|
|
245
|
-
readonly url: string;
|
|
246
|
-
}
|
|
247
|
-
/** One effective workspace safety limit. There is no public mutation route. */
|
|
248
|
-
export interface EffectiveWorkspaceLimit {
|
|
249
|
-
readonly changedAt: string;
|
|
250
|
-
readonly effectiveValue: LimitValue;
|
|
251
|
-
readonly id: "context.tool_result_bytes" | "session.materialized_agents" | "session.initial_files_bytes" | "session.initial_files_count" | "session.agent_execution" | "session.run_budget" | "api.json_body" | "query.page" | "registry.entries" | "registry.value_bytes";
|
|
252
|
-
readonly revision: number;
|
|
253
|
-
readonly source: LimitSource;
|
|
254
|
-
}
|
|
255
|
-
/** One page of effective workspace limits. */
|
|
256
|
-
export interface EffectiveWorkspaceLimitPage {
|
|
257
|
-
readonly items: ReadonlyArray<EffectiveWorkspaceLimit>;
|
|
258
|
-
readonly nextCursor?: string;
|
|
259
|
-
}
|
|
260
|
-
/** A body that carries no fields; still strict, so an extra member is rejected. */
|
|
261
|
-
export type EmptyRequest = Readonly<Record<string, never>>;
|
|
262
|
-
/** Closed, typed remediation detail; never an untyped bag. */
|
|
263
|
-
export type ErrorDetails = (ErrorDetailsRequiredScope & {
|
|
264
|
-
readonly type: "required_scope";
|
|
265
|
-
}) | (ErrorDetailsLimit & {
|
|
266
|
-
readonly type: "limit";
|
|
267
|
-
}) | (ErrorDetailsQuota & {
|
|
268
|
-
readonly type: "quota";
|
|
269
|
-
}) | (ErrorDetailsRegion & {
|
|
270
|
-
readonly type: "region";
|
|
271
|
-
}) | (ErrorDetailsRetry & {
|
|
272
|
-
readonly type: "retry";
|
|
273
|
-
}) | (ErrorDetailsOperation & {
|
|
274
|
-
readonly type: "operation";
|
|
275
|
-
}) | (ErrorDetailsValidation & {
|
|
276
|
-
readonly type: "validation";
|
|
277
|
-
});
|
|
278
|
-
/** The effective limit that was exceeded. */
|
|
279
|
-
export interface ErrorDetailsLimit {
|
|
280
|
-
readonly effective: string;
|
|
281
|
-
readonly limit: "context.tool_result_bytes" | "session.materialized_agents" | "session.initial_files_bytes" | "session.initial_files_count" | "session.agent_execution" | "session.run_budget" | "api.json_body" | "query.page" | "registry.entries" | "registry.value_bytes";
|
|
282
|
-
readonly measured: string;
|
|
283
|
-
}
|
|
284
|
-
/** The original operation the replay resolved to. */
|
|
285
|
-
export interface ErrorDetailsOperation {
|
|
286
|
-
readonly operationId: Id<"operation">;
|
|
287
|
-
}
|
|
288
|
-
/** The quota dimension that was exhausted. */
|
|
289
|
-
export interface ErrorDetailsQuota {
|
|
290
|
-
readonly attempted: string;
|
|
291
|
-
readonly dimension: "context.tool_result_bytes" | "session.materialized_agents" | "session.initial_files_bytes" | "session.initial_files_count" | "session.agent_execution" | "session.run_budget" | "api.json_body" | "query.page" | "registry.entries" | "registry.value_bytes";
|
|
292
|
-
readonly used: string;
|
|
293
|
-
}
|
|
294
|
-
/** The authoritative placement of the workspace. */
|
|
295
|
-
export interface ErrorDetailsRegion {
|
|
296
|
-
readonly apiUrl: string;
|
|
297
|
-
readonly expected: "us-east-1" | "us-east-2" | "us-west-2" | "ap-northeast-1" | "eu-west-1";
|
|
298
|
-
}
|
|
299
|
-
/** The scope the credential lacks. */
|
|
300
|
-
export interface ErrorDetailsRequiredScope {
|
|
301
|
-
readonly scope: "account:read" | "account:write" | "api_keys:read" | "api_keys:write" | "billing:read" | "billing:write" | "sessions:read" | "sessions:write" | "sessions:delete" | "resources:read" | "resources:write";
|
|
302
|
-
}
|
|
303
|
-
/** How long to wait before retrying. */
|
|
304
|
-
export interface ErrorDetailsRetry {
|
|
305
|
-
readonly retryAfterMs: number;
|
|
306
|
-
}
|
|
307
|
-
/** Exactly where the body failed validation. */
|
|
308
|
-
export interface ErrorDetailsValidation {
|
|
309
|
-
readonly pointer: string;
|
|
310
|
-
readonly reason: string;
|
|
311
|
-
}
|
|
312
|
-
/** The sandbox network policy. */
|
|
313
|
-
export interface HandsNetworkRequest {
|
|
314
|
-
readonly mode: NetworkMode;
|
|
315
|
-
}
|
|
316
|
-
/** A short-lived hosted provider page. */
|
|
317
|
-
export interface HostedSession {
|
|
318
|
-
readonly expiresAt: string;
|
|
319
|
-
readonly url: string;
|
|
320
|
-
}
|
|
321
|
-
/** One request header a signed grant requires the caller to send verbatim. */
|
|
322
|
-
export interface HttpHeader {
|
|
323
|
-
readonly name: string;
|
|
324
|
-
readonly value: string;
|
|
325
|
-
}
|
|
326
|
-
/** A limit whose effective value is a map of named dimensions. */
|
|
327
|
-
export interface LimitMapValue {
|
|
328
|
-
readonly values: Readonly<Record<string, string>>;
|
|
329
|
-
}
|
|
330
|
-
/** A single non-negative integer limit. */
|
|
331
|
-
export interface LimitScalarValue {
|
|
332
|
-
readonly value: string;
|
|
333
|
-
}
|
|
334
|
-
/** Where an effective limit value came from. */
|
|
335
|
-
export type LimitSource = "default" | "workspace_override";
|
|
336
|
-
/** The effective value of a limit, discriminated by shape. */
|
|
337
|
-
export type LimitValue = (LimitScalarValue & {
|
|
338
|
-
readonly shape: "scalar";
|
|
339
|
-
}) | (LimitMapValue & {
|
|
340
|
-
readonly shape: "map";
|
|
341
|
-
});
|
|
342
|
-
/** One frozen MCP definition and its bounded tool namespace. */
|
|
343
|
-
export interface McpServer {
|
|
344
|
-
readonly name: string;
|
|
345
|
-
readonly transport: McpTransport;
|
|
346
|
-
}
|
|
347
|
-
/** The two admitted MCP transports. */
|
|
348
|
-
export type McpTransport = (RemoteMcpServer & {
|
|
349
|
-
readonly kind: "remote_http";
|
|
350
|
-
}) | (SandboxMcpServer & {
|
|
351
|
-
readonly kind: "sandbox_process";
|
|
352
|
-
});
|
|
353
|
-
/** One complete sealed message in immutable visibility order. */
|
|
354
|
-
export interface Message {
|
|
355
|
-
readonly content: ReadonlyArray<MessagePart>;
|
|
356
|
-
readonly createdAt: string;
|
|
357
|
-
readonly id: Id<"message">;
|
|
358
|
-
readonly role: MessageRole;
|
|
359
|
-
readonly sessionId: Id<"session">;
|
|
360
|
-
}
|
|
361
|
-
/** One page of complete messages. */
|
|
362
|
-
export interface MessagePage {
|
|
363
|
-
readonly items: ReadonlyArray<Message>;
|
|
364
|
-
readonly nextCursor?: string;
|
|
365
|
-
}
|
|
366
|
-
/** One part of a complete committed message. */
|
|
367
|
-
export type MessagePart = (MessagePartText & {
|
|
368
|
-
readonly type: "text";
|
|
369
|
-
}) | (MessagePartToolCall & {
|
|
370
|
-
readonly type: "tool_call";
|
|
371
|
-
}) | (MessagePartToolResult & {
|
|
372
|
-
readonly type: "tool_result";
|
|
373
|
-
});
|
|
374
|
-
/** Text content. */
|
|
375
|
-
export interface MessagePartText {
|
|
376
|
-
readonly text: string;
|
|
377
|
-
}
|
|
378
|
-
/** Canonical provider-independent tool call. */
|
|
379
|
-
export interface MessagePartToolCall {
|
|
380
|
-
readonly arguments: JsonValue;
|
|
381
|
-
readonly id: Id<"tool_call">;
|
|
382
|
-
readonly name: string;
|
|
383
|
-
}
|
|
384
|
-
/** Bounded tool result; large/full bytes remain at its sandbox path unless storage.persist explicitly registers them as a workspace file. */
|
|
385
|
-
export interface MessagePartToolResult {
|
|
386
|
-
readonly id: Id<"tool_call">;
|
|
387
|
-
readonly preview: string;
|
|
388
|
-
readonly sandboxPath?: string;
|
|
389
|
-
readonly sha256?: string;
|
|
390
|
-
readonly sizeBytes?: string;
|
|
391
|
-
readonly truncated: boolean;
|
|
392
|
-
}
|
|
393
|
-
/** Who produced a committed message. */
|
|
394
|
-
export type MessageRole = "user" | "assistant" | "tool";
|
|
395
|
-
/** Text-only user message; arbitrary files are referenced by mounted paths in this text. */
|
|
396
|
-
export interface MessageSendRequest {
|
|
397
|
-
readonly deadline?: string;
|
|
398
|
-
readonly maxSpendCents?: string;
|
|
399
|
-
readonly responseFormat?: ResponseFormat;
|
|
400
|
-
readonly text: string;
|
|
401
|
-
}
|
|
402
|
-
/** The admitted user message and session now processing it. */
|
|
403
|
-
export interface MessageSendResult {
|
|
404
|
-
readonly message: Message;
|
|
405
|
-
readonly session: Session;
|
|
406
|
-
}
|
|
407
|
-
/** One bounded NDJSON assistant-stream frame. */
|
|
408
|
-
export interface MessageStreamFrame {
|
|
409
|
-
readonly kind: MessageStreamKind;
|
|
410
|
-
readonly message?: Message;
|
|
411
|
-
readonly messageId?: Id<"message">;
|
|
412
|
-
readonly sequence: string;
|
|
413
|
-
readonly text?: string;
|
|
414
|
-
}
|
|
415
|
-
/** Preview/commit reconciliation protocol. */
|
|
416
|
-
export type MessageStreamKind = "preview" | "committed" | "reconcile" | "gap" | "heartbeat";
|
|
417
|
-
/** An explicit provider and model pair; a model-only override is rejected. */
|
|
418
|
-
export interface ModelSelection {
|
|
419
|
-
readonly model: string;
|
|
420
|
-
readonly provider: ProviderId;
|
|
421
|
-
}
|
|
422
|
-
/** What the sandbox may reach. */
|
|
423
|
-
export type NetworkMode = "none" | "public_internet";
|
|
424
|
-
/** A freshly minted key; its value is returned once and never stored. */
|
|
425
|
-
export interface NewApiKey {
|
|
426
|
-
readonly createdAt: string;
|
|
427
|
-
readonly id: Id<"api_key">;
|
|
428
|
-
readonly name: string;
|
|
429
|
-
readonly scopes: ReadonlyArray<"account:read" | "account:write" | "api_keys:read" | "api_keys:write" | "billing:read" | "billing:write" | "sessions:read" | "sessions:write" | "sessions:delete" | "resources:read" | "resources:write">;
|
|
430
|
-
readonly value: string;
|
|
431
|
-
readonly workspaceId: Id<"workspace">;
|
|
432
|
-
}
|
|
433
|
-
/** Supported setup package ecosystems. */
|
|
434
|
-
export type PackageEcosystem = "apt" | "pip" | "npm";
|
|
435
|
-
/** One exactly pinned setup package. */
|
|
436
|
-
export interface PackageRequest {
|
|
437
|
-
readonly ecosystem: PackageEcosystem;
|
|
438
|
-
readonly name: string;
|
|
439
|
-
readonly version: string;
|
|
440
|
-
}
|
|
441
|
-
/** Display-only metadata for one Stripe card; never PAN, CVC, or a client secret. */
|
|
442
|
-
export interface PaymentMethod {
|
|
443
|
-
readonly brand: CardBrand;
|
|
444
|
-
readonly createdAt: string;
|
|
445
|
-
readonly expiryMonth: number;
|
|
446
|
-
readonly expiryYear: number;
|
|
447
|
-
readonly id: Id<"payment_method">;
|
|
448
|
-
readonly isDefault: boolean;
|
|
449
|
-
readonly last4: string;
|
|
450
|
-
}
|
|
451
|
-
/** The bounded set of cards attached to the caller's account. */
|
|
452
|
-
export interface PaymentMethodPage {
|
|
453
|
-
readonly items: ReadonlyArray<PaymentMethod>;
|
|
454
|
-
}
|
|
455
|
-
/** Request a Stripe-hosted card setup session. */
|
|
456
|
-
export interface PaymentMethodSessionRequest {
|
|
457
|
-
readonly cancelUrl?: string;
|
|
458
|
-
readonly consent: boolean;
|
|
459
|
-
readonly successUrl?: string;
|
|
460
|
-
}
|
|
461
|
-
/** The candidate official BYOK authorities. Only models admitted by the current Rig-backed catalog are selectable; arbitrary base URLs are not accepted. */
|
|
462
|
-
export type ProviderId = "openai" | "anthropic" | "deepseek" | "xai" | "meta" | "moonshotai" | "alibaba";
|
|
463
|
-
/** A registered file entry, complete. */
|
|
464
|
-
export interface RegisteredFile {
|
|
465
|
-
readonly createdAt: string;
|
|
466
|
-
readonly failureCode?: string;
|
|
467
|
-
readonly name: string;
|
|
468
|
-
readonly state: RegisteredState;
|
|
469
|
-
readonly updatedAt: string;
|
|
470
|
-
readonly value?: RegisteredFileRead;
|
|
471
|
-
}
|
|
472
|
-
/** The two permitted registered-file modes. */
|
|
473
|
-
export type RegisteredFileMode = "0644" | "0755";
|
|
474
|
-
/** One page of registered files. */
|
|
475
|
-
export interface RegisteredFilePage {
|
|
476
|
-
readonly items: ReadonlyArray<RegisteredFileRow>;
|
|
477
|
-
readonly nextCursor?: string;
|
|
478
|
-
}
|
|
479
|
-
/** What a registered file is, as published. The payload bytes are referenced, never inlined; fetch them with a download grant. */
|
|
480
|
-
export interface RegisteredFileRead {
|
|
481
|
-
readonly content: ContentRef;
|
|
482
|
-
readonly mediaType: string;
|
|
483
|
-
readonly mode: RegisteredFileMode;
|
|
484
|
-
}
|
|
485
|
-
/** One registered file as a collection row. A listing carries no value document; read the entry itself to get one. */
|
|
486
|
-
export interface RegisteredFileRow {
|
|
487
|
-
readonly createdAt: string;
|
|
488
|
-
readonly failureCode?: string;
|
|
489
|
-
readonly name: string;
|
|
490
|
-
readonly state: RegisteredState;
|
|
491
|
-
readonly updatedAt: string;
|
|
492
|
-
}
|
|
493
|
-
/** A latest-only registered file replacement. */
|
|
494
|
-
export interface RegisteredFileValue {
|
|
495
|
-
readonly content: BlobInput;
|
|
496
|
-
readonly mediaType: string;
|
|
497
|
-
readonly mode: RegisteredFileMode;
|
|
498
|
-
}
|
|
499
|
-
/** State of the single current value; prior values are never addressable. */
|
|
500
|
-
export type RegisteredState = "pending" | "ready" | "failed";
|
|
501
|
-
/** Mint a download grant for a registered file. */
|
|
502
|
-
export interface RegistryDownloadRequest {
|
|
503
|
-
readonly range?: ByteRange;
|
|
504
|
-
}
|
|
505
|
-
/** A remote Streamable HTTP MCP server frozen at session setup and invoked on demand inside the sandbox. */
|
|
506
|
-
export interface RemoteMcpServer {
|
|
507
|
-
readonly headers?: Readonly<Record<string, string>>;
|
|
508
|
-
readonly url: string;
|
|
509
|
-
}
|
|
510
|
-
/** Complete provider-derived capacity of the frozen shape. */
|
|
511
|
-
export interface ResolvedCompute {
|
|
512
|
-
readonly baseline: ComputeShape;
|
|
513
|
-
readonly endpointBandwidthMBps: number;
|
|
514
|
-
readonly maxConcurrentConnections: number;
|
|
515
|
-
readonly maxDiskGiB: number;
|
|
516
|
-
readonly peak: ComputeShape;
|
|
517
|
-
readonly size: "512mb" | "1gb" | "2gb" | "4gb" | "8gb";
|
|
518
|
-
}
|
|
519
|
-
/** Customer-safe frozen session configuration; all plaintext secrets are omitted. */
|
|
520
|
-
export interface ResolvedConfig {
|
|
521
|
-
readonly compute?: ResolvedCompute;
|
|
522
|
-
readonly lifecycle: SessionLifecyclePolicy;
|
|
523
|
-
readonly mcpServerNames: ReadonlyArray<string>;
|
|
524
|
-
readonly model: string;
|
|
525
|
-
readonly network?: ResolvedNetwork;
|
|
526
|
-
readonly packages: ReadonlyArray<PackageRequest>;
|
|
527
|
-
readonly provider: ProviderId;
|
|
528
|
-
readonly registered: SessionRegisteredSelection;
|
|
529
|
-
readonly sandboxEnabled: boolean;
|
|
530
|
-
}
|
|
531
|
-
/** Resolved sandbox network policy. */
|
|
532
|
-
export interface ResolvedNetwork {
|
|
533
|
-
readonly hands: HandsNetworkRequest;
|
|
534
|
-
}
|
|
535
|
-
/** Optional native structured-output request; prompt emulation is never presented as strict. */
|
|
536
|
-
export interface ResponseFormat {
|
|
537
|
-
readonly kind: ResponseFormatKind;
|
|
538
|
-
readonly schema?: JsonValue;
|
|
539
|
-
}
|
|
540
|
-
/** Requested final response format. */
|
|
541
|
-
export type ResponseFormatKind = "text" | "json_schema";
|
|
542
|
-
/** An MCP process launched inside the sandbox after workspace materialization. */
|
|
543
|
-
export interface SandboxMcpServer {
|
|
544
|
-
readonly args?: ReadonlyArray<string>;
|
|
545
|
-
readonly command: string;
|
|
546
|
-
readonly environment?: Readonly<Record<string, string>>;
|
|
547
|
-
readonly workingDirectory?: string;
|
|
548
|
-
}
|
|
549
|
-
/** Observable preparation state of the session's single default-on sandbox. */
|
|
550
|
-
export type SandboxStatus = "disabled" | "requested" | "ready" | "suspending" | "suspended" | "resuming" | "lost";
|
|
551
|
-
/** The only public execution resource; sandbox loss never terminates agent state. */
|
|
552
|
-
export interface Session {
|
|
553
|
-
readonly activeMessageId?: Id<"message">;
|
|
554
|
-
readonly createdAt: string;
|
|
555
|
-
readonly expiresAt: string;
|
|
556
|
-
readonly id: Id<"session">;
|
|
557
|
-
readonly metadata?: Readonly<Record<string, string | number | boolean | null>>;
|
|
558
|
-
readonly resolvedConfig: ResolvedConfig;
|
|
559
|
-
readonly revision: number;
|
|
560
|
-
readonly sandboxStatus: SandboxStatus;
|
|
561
|
-
readonly status: SessionStatus;
|
|
562
|
-
readonly terminatedAt?: string;
|
|
563
|
-
readonly updatedAt: string;
|
|
564
|
-
readonly workspaceId: Id<"workspace">;
|
|
565
|
-
}
|
|
566
|
-
/** Admission receipt for an asynchronous session command; there is no generic operations resource. */
|
|
567
|
-
export interface SessionCommandReceipt {
|
|
568
|
-
readonly acceptedAt: string;
|
|
569
|
-
readonly operationId: Id<"operation">;
|
|
570
|
-
readonly sessionId: Id<"session">;
|
|
571
|
-
}
|
|
572
|
-
/** The single sandbox's bounded compute selector. */
|
|
573
|
-
export interface SessionComputeRequest {
|
|
574
|
-
readonly size?: "512mb" | "1gb" | "2gb" | "4gb" | "8gb";
|
|
575
|
-
}
|
|
576
|
-
/** Create a durable session with a write-only BYOK key, frozen file/MCP config and a default-on eager sandbox. */
|
|
577
|
-
export interface SessionCreateRequest {
|
|
578
|
-
readonly expiresAt?: string;
|
|
579
|
-
readonly maxSpendCents?: string;
|
|
580
|
-
readonly mcpServers?: ReadonlyArray<McpServer>;
|
|
581
|
-
readonly metadata?: Readonly<Record<string, string | number | boolean | null>>;
|
|
582
|
-
readonly model: string;
|
|
583
|
-
readonly provider: ProviderId;
|
|
584
|
-
readonly providerApiKey: string;
|
|
585
|
-
readonly registered?: SessionRegisteredSelection;
|
|
586
|
-
readonly sandbox?: SessionSandboxRequest;
|
|
587
|
-
}
|
|
588
|
-
/** Immutable public session bounds; sandbox suspension is an internal lifecycle. */
|
|
589
|
-
export interface SessionLifecyclePolicy {
|
|
590
|
-
readonly maximumLifetimeSeconds: number;
|
|
591
|
-
readonly maximumSubagentDepth: number;
|
|
592
|
-
readonly maximumSubagents: number;
|
|
593
|
-
}
|
|
594
|
-
/** Bounded collection projection. */
|
|
595
|
-
export interface SessionListItem {
|
|
596
|
-
readonly activeMessageId?: Id<"message">;
|
|
597
|
-
readonly createdAt: string;
|
|
598
|
-
readonly expiresAt: string;
|
|
599
|
-
readonly id: Id<"session">;
|
|
600
|
-
readonly model: string;
|
|
601
|
-
readonly provider: ProviderId;
|
|
602
|
-
readonly sandboxStatus: SandboxStatus;
|
|
603
|
-
readonly status: SessionStatus;
|
|
604
|
-
readonly updatedAt: string;
|
|
605
|
-
readonly workspaceId: Id<"workspace">;
|
|
606
|
-
}
|
|
607
|
-
/** One page of sessions. */
|
|
608
|
-
export interface SessionListPage {
|
|
609
|
-
readonly items: ReadonlyArray<SessionListItem>;
|
|
610
|
-
readonly nextCursor?: string;
|
|
611
|
-
}
|
|
612
|
-
/** Network policy for the one sandbox. */
|
|
613
|
-
export interface SessionNetworkRequest {
|
|
614
|
-
readonly hands: HandsNetworkRequest;
|
|
615
|
-
}
|
|
616
|
-
/** Files resolved once at session admission; later workspace overwrites cannot mutate this manifest. */
|
|
617
|
-
export interface SessionRegisteredSelection {
|
|
618
|
-
readonly mounts: ReadonlyArray<WorkspaceFileMount>;
|
|
619
|
-
}
|
|
620
|
-
/** Default-on sandbox configuration; enabled=false creates no Hand. */
|
|
621
|
-
export interface SessionSandboxRequest {
|
|
622
|
-
readonly compute?: SessionComputeRequest;
|
|
623
|
-
readonly enabled?: boolean;
|
|
624
|
-
readonly network?: SessionNetworkRequest;
|
|
625
|
-
readonly packages?: ReadonlyArray<PackageRequest>;
|
|
626
|
-
}
|
|
627
|
-
/** Customer-visible session lifecycle, independent of sandbox suspension. */
|
|
628
|
-
export type SessionStatus = "idle" | "running" | "terminating" | "terminated" | "deleting";
|
|
629
|
-
/** Minimal marker after irreversible deletion. */
|
|
630
|
-
export interface SessionTombstone {
|
|
631
|
-
readonly deletedAt: string;
|
|
632
|
-
readonly id: Id<"session">;
|
|
633
|
-
}
|
|
634
|
-
/** Short-lived signed download for one immutable compressed telemetry export. */
|
|
635
|
-
export interface TelemetryDownloadGrant {
|
|
636
|
-
readonly expiresAt: string;
|
|
637
|
-
readonly mediaType: string;
|
|
638
|
-
readonly sha256: string;
|
|
639
|
-
readonly sizeBytes: string;
|
|
640
|
-
readonly url: string;
|
|
641
|
-
}
|
|
642
|
-
/** Select a bounded half-open telemetry export. */
|
|
643
|
-
export interface TelemetryDownloadRequest {
|
|
644
|
-
readonly fromSequence?: string;
|
|
645
|
-
readonly toSequence?: string;
|
|
646
|
-
}
|
|
647
|
-
/** One bounded normalized telemetry frame transmitted live and persisted in compressed S3 segments. */
|
|
648
|
-
export interface TelemetryFrame {
|
|
649
|
-
readonly body?: JsonValue;
|
|
650
|
-
readonly kind: TelemetryKind;
|
|
651
|
-
readonly occurredAt: string;
|
|
652
|
-
readonly preview?: string;
|
|
653
|
-
readonly sequence: string;
|
|
654
|
-
readonly spanId?: string;
|
|
655
|
-
readonly traceId?: string;
|
|
656
|
-
readonly truncated: boolean;
|
|
657
|
-
}
|
|
658
|
-
/** Trusted live and retained session signals. */
|
|
659
|
-
export type TelemetryKind = "assistant" | "tool" | "runtime" | "log" | "span" | "usage" | "gap" | "heartbeat";
|
|
660
|
-
/** A half-open instant range, `gte` inclusive and `lt` exclusive. */
|
|
661
|
-
export interface TimeRange {
|
|
662
|
-
readonly gte: string;
|
|
663
|
-
readonly lt: string;
|
|
664
|
-
}
|
|
665
|
-
/** Request a one-time Stripe-hosted prepaid top-up. */
|
|
666
|
-
export interface TopUpCheckoutRequest {
|
|
667
|
-
readonly amountCents: string;
|
|
668
|
-
readonly cancelUrl?: string;
|
|
669
|
-
readonly successUrl?: string;
|
|
670
|
-
}
|
|
671
|
-
/** One staged multipart upload. Uploads are transport plumbing, not assets. */
|
|
672
|
-
export interface Upload {
|
|
673
|
-
readonly contentType: string;
|
|
674
|
-
readonly createdAt: string;
|
|
675
|
-
readonly expiresAt: string;
|
|
676
|
-
readonly id: Id<"upload">;
|
|
677
|
-
readonly partCount: number;
|
|
678
|
-
readonly partSizeBytes: string;
|
|
679
|
-
readonly sha256: string;
|
|
680
|
-
readonly sizeBytes: string;
|
|
681
|
-
readonly state: UploadState;
|
|
682
|
-
}
|
|
683
|
-
/** One pending current-file overwrite and every bounded part grant needed to upload it; no extra public grant route exists. */
|
|
684
|
-
export interface UploadAdmission {
|
|
685
|
-
readonly grants: ReadonlyArray<UploadPartGrant>;
|
|
686
|
-
readonly upload: Upload;
|
|
687
|
-
}
|
|
688
|
-
/** Complete a staged upload. */
|
|
689
|
-
export interface UploadCompleteRequest {
|
|
690
|
-
readonly parts: ReadonlyArray<UploadPart>;
|
|
691
|
-
}
|
|
692
|
-
/** Stage a large current workspace-file replacement. */
|
|
693
|
-
export interface UploadCreateRequest {
|
|
694
|
-
readonly contentType: string;
|
|
695
|
-
readonly name: string;
|
|
696
|
-
readonly parts: ReadonlyArray<UploadPartRequest>;
|
|
697
|
-
readonly sha256: string;
|
|
698
|
-
readonly sizeBytes: string;
|
|
699
|
-
}
|
|
700
|
-
/** One written part and the entity tag the store returned. */
|
|
701
|
-
export interface UploadPart {
|
|
702
|
-
readonly etag: string;
|
|
703
|
-
readonly partNumber: number;
|
|
704
|
-
}
|
|
705
|
-
/** One presigned PUT grant. The headers must be sent verbatim: they carry the part checksum and length the signature covers, and a PUT without them is rejected by the object store. */
|
|
706
|
-
export interface UploadPartGrant {
|
|
707
|
-
readonly expiresAt: string;
|
|
708
|
-
readonly headers: ReadonlyArray<HttpHeader>;
|
|
709
|
-
readonly partNumber: number;
|
|
710
|
-
readonly url: string;
|
|
711
|
-
}
|
|
712
|
-
/** One part to presign. The part's own SHA-256 is required because S3 verifies it on the way up and the completion manifest checks it again; the server never sees the bytes, so it cannot compute it. */
|
|
713
|
-
export interface UploadPartRequest {
|
|
714
|
-
readonly partNumber: number;
|
|
715
|
-
readonly sha256: string;
|
|
716
|
-
readonly sizeBytes: string;
|
|
717
|
-
}
|
|
718
|
-
/** Where a staged upload is in its lifecycle. */
|
|
719
|
-
export type UploadState = "staging" | "ready";
|
|
720
|
-
/** One resource aggregate, discriminated by category. */
|
|
721
|
-
export type UsageAggregate = (UsageStorageAggregate & {
|
|
722
|
-
readonly category: "storage";
|
|
723
|
-
}) | (UsageComputeAggregate & {
|
|
724
|
-
readonly category: "compute";
|
|
725
|
-
}) | (UsageMemoryAggregate & {
|
|
726
|
-
readonly category: "memory";
|
|
727
|
-
}) | (UsageDataTransferAggregate & {
|
|
728
|
-
readonly category: "data_transfer";
|
|
729
|
-
});
|
|
730
|
-
/** What a regional aggregate is attributed to. */
|
|
731
|
-
export interface UsageAttribution {
|
|
732
|
-
readonly operationId?: Id<"operation">;
|
|
733
|
-
readonly region: "us-east-1" | "us-east-2" | "us-west-2" | "ap-northeast-1" | "eu-west-1";
|
|
734
|
-
readonly serviceTime: TimeRange;
|
|
735
|
-
readonly sessionId?: Id<"session">;
|
|
736
|
-
readonly source: string;
|
|
737
|
-
readonly workspaceId: Id<"workspace">;
|
|
738
|
-
}
|
|
739
|
-
/** The three authorities that admit usage facts. There are three rather than
|
|
740
|
-
four because memory and compute are one contiguous fact sequence behind
|
|
741
|
-
one authority, so they share one frontier; publishing four frontiers with
|
|
742
|
-
two of them always identical would claim an independence that does not
|
|
743
|
-
exist.
|
|
744
|
-
*/
|
|
745
|
-
export type UsageAuthority = "storage" | "compute" | "transfer";
|
|
746
|
-
/** The time grain one usage query answers at. All bucketing is UTC and there
|
|
747
|
-
is no timezone parameter; a range must be aligned to whole buckets of the
|
|
748
|
-
requested grain and a misaligned range is refused rather than widened to
|
|
749
|
-
the enclosing buckets.
|
|
750
|
-
*/
|
|
751
|
-
export type UsageBucket = "hour" | "day" | "total";
|
|
752
|
-
/** The four priced categories. */
|
|
753
|
-
export type UsageCategory = "storage" | "compute" | "memory" | "data_transfer";
|
|
754
|
-
/** Millicpu-milliseconds of guest compute. */
|
|
755
|
-
export interface UsageComputeAggregate {
|
|
756
|
-
readonly attribution: UsageAttribution;
|
|
757
|
-
readonly millicpuMilliseconds: string;
|
|
758
|
-
readonly settlement: UsageSettlement;
|
|
759
|
-
}
|
|
760
|
-
/** Measured outbound bytes. */
|
|
761
|
-
export interface UsageDataTransferAggregate {
|
|
762
|
-
readonly attribution: UsageAttribution;
|
|
763
|
-
readonly egressBytes: string;
|
|
764
|
-
readonly settlement: UsageSettlement;
|
|
765
|
-
}
|
|
766
|
-
/** How far the pipeline has advanced for one workspace and authority. The
|
|
767
|
-
answer is exact at or below `completeThrough` and contains nothing above
|
|
768
|
-
`includesThrough`; between the two it is partial, and saying so is the
|
|
769
|
-
point. Both are monotone across repeated queries.
|
|
770
|
-
*/
|
|
771
|
-
export interface UsageFrontier {
|
|
772
|
-
readonly acceptedSequence: string;
|
|
773
|
-
readonly category: UsageAuthority;
|
|
774
|
-
readonly completeThrough: string;
|
|
775
|
-
readonly includesThrough: string;
|
|
776
|
-
readonly projectedSequence: string;
|
|
777
|
-
readonly publishedSequence: string;
|
|
778
|
-
readonly region: "us-east-1" | "us-east-2" | "us-west-2" | "ap-northeast-1" | "eu-west-1";
|
|
779
|
-
readonly serviceThrough?: string;
|
|
780
|
-
readonly settledSequence: string;
|
|
781
|
-
readonly stallReason?: string;
|
|
782
|
-
readonly stalledAt?: string;
|
|
783
|
-
readonly state: UsageFrontierState;
|
|
784
|
-
readonly workspaceId: Id<"workspace">;
|
|
785
|
-
}
|
|
786
|
-
/** Whether a fold is advancing or parked. */
|
|
787
|
-
export type UsageFrontierState = "advancing" | "stalled";
|
|
788
|
-
/** The axes a usage query may group by. Session, run and operation are
|
|
789
|
-
deliberately absent: every stored aggregate row is keyed by a hash of a
|
|
790
|
-
seven-member dimension tuple that includes the session, so grouping by one
|
|
791
|
-
of them would read hundreds of thousands of rows for a single monthly
|
|
792
|
-
total. "How much did session X cost?" is not answerable by any route in
|
|
793
|
-
v1, and publishing an axis that is always refused would be a false
|
|
794
|
-
capability.
|
|
795
|
-
*/
|
|
796
|
-
export type UsageGrouping = "category" | "region" | "workspace";
|
|
797
|
-
/** Byte-milliseconds of guest memory. */
|
|
798
|
-
export interface UsageMemoryAggregate {
|
|
799
|
-
readonly attribution: UsageAttribution;
|
|
800
|
-
readonly byteMilliseconds: string;
|
|
801
|
-
readonly settlement: UsageSettlement;
|
|
802
|
-
}
|
|
803
|
-
/** One page of usage quantities plus the frontiers that bound its completeness. Monetary statements remain a central finance read. */
|
|
804
|
-
export interface UsagePage {
|
|
805
|
-
readonly frontiers: ReadonlyArray<UsageFrontier>;
|
|
806
|
-
readonly items: ReadonlyArray<UsageAggregate>;
|
|
807
|
-
readonly nextCursor?: string;
|
|
808
|
-
}
|
|
809
|
-
/** A bounded query over authoritative regional usage quantities. */
|
|
810
|
-
export interface UsageQuery {
|
|
811
|
-
readonly bucket: UsageBucket;
|
|
812
|
-
readonly categories?: ReadonlyArray<UsageCategory>;
|
|
813
|
-
readonly cursor?: string;
|
|
814
|
-
readonly groupBy?: ReadonlyArray<UsageGrouping>;
|
|
815
|
-
readonly limit?: number;
|
|
816
|
-
readonly timeRange: TimeRange;
|
|
817
|
-
}
|
|
818
|
-
/** Whether an item is covered by a committed settlement receipt as of
|
|
819
|
-
`completeThrough`. Not permanently terminal: a correction or a void
|
|
820
|
-
arrives as a new fact at a higher sequence and re-opens its bucket to
|
|
821
|
-
`provisional`.
|
|
822
|
-
*/
|
|
823
|
-
export type UsageSettlement = "settled" | "provisional";
|
|
824
|
-
/** Retained bytes over time. */
|
|
825
|
-
export interface UsageStorageAggregate {
|
|
826
|
-
readonly attribution: UsageAttribution;
|
|
827
|
-
readonly byteMinutes: string;
|
|
828
|
-
readonly settlement: UsageSettlement;
|
|
829
|
-
}
|
|
830
|
-
/** The account's fixed eu-west-1 execution and content boundary. */
|
|
831
|
-
export interface Workspace {
|
|
832
|
-
readonly apiUrl: string;
|
|
833
|
-
readonly createdAt: string;
|
|
834
|
-
readonly id: Id<"workspace">;
|
|
835
|
-
readonly name: string;
|
|
836
|
-
readonly operationalState: WorkspaceOperationalState;
|
|
837
|
-
readonly region: "us-east-1" | "us-east-2" | "us-west-2" | "ap-northeast-1" | "eu-west-1";
|
|
838
|
-
}
|
|
839
|
-
/** Which retained session generation answered a live workspace call. */
|
|
840
|
-
export interface WorkspaceAccess {
|
|
841
|
-
readonly generationId: Id<"generation">;
|
|
842
|
-
readonly resumed: boolean;
|
|
843
|
-
}
|
|
844
|
-
/** Resolve one current workspace-file name to a private immutable hash and mount path at admission. */
|
|
845
|
-
export interface WorkspaceFileMount {
|
|
846
|
-
readonly name: string;
|
|
847
|
-
readonly path: string;
|
|
848
|
-
}
|
|
849
|
-
/** The fixed workspace's inherited personal-account state. */
|
|
850
|
-
export interface WorkspaceOperationalState {
|
|
851
|
-
readonly accountId: Id<"account">;
|
|
852
|
-
readonly state: AccountOperationalState;
|
|
853
|
-
}
|