@aexhq/sdk 0.52.0 → 0.53.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.
Files changed (37) hide show
  1. package/README.md +99 -41
  2. package/dist/client/aex.d.ts +6 -1
  3. package/dist/client/aex.js +51 -10
  4. package/dist/client/aex.js.map +1 -1
  5. package/dist/client/credentials.d.ts +3 -3
  6. package/dist/client/credentials.js +8 -8
  7. package/dist/client/credentials.js.map +1 -1
  8. package/dist/client/routing.d.ts +1 -1
  9. package/dist/client/routing.js +2 -5
  10. package/dist/client/routing.js.map +1 -1
  11. package/dist/files/workspace-files.d.ts +55 -0
  12. package/dist/files/workspace-files.js +150 -0
  13. package/dist/files/workspace-files.js.map +1 -0
  14. package/dist/generated/errors.js +2 -17
  15. package/dist/generated/errors.js.map +1 -1
  16. package/dist/generated/models.d.ts +248 -796
  17. package/dist/generated/models.js +4 -4
  18. package/dist/generated/models.js.map +1 -1
  19. package/dist/generated/resources.d.ts +72 -519
  20. package/dist/generated/resources.js +49 -428
  21. package/dist/generated/resources.js.map +1 -1
  22. package/dist/generated/routes.d.ts +4 -4
  23. package/dist/generated/routes.js +190 -1600
  24. package/dist/generated/routes.js.map +1 -1
  25. package/dist/index.d.ts +4 -2
  26. package/dist/index.js +2 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/transport/transport.d.ts +9 -1
  29. package/dist/transport/transport.js +79 -1
  30. package/dist/transport/transport.js.map +1 -1
  31. package/package.json +1 -5
  32. package/dist/node/session-file-limits.d.ts +0 -4
  33. package/dist/node/session-file-limits.js +0 -7
  34. package/dist/node/session-file-limits.js.map +0 -1
  35. package/dist/node/session-files.d.ts +0 -80
  36. package/dist/node/session-files.js +0 -254
  37. package/dist/node/session-files.js.map +0 -1
@@ -6,6 +6,7 @@
6
6
  */
7
7
  export declare const ID_PREFIXES: {
8
8
  readonly user: "usr";
9
+ readonly account: "acc";
9
10
  readonly organization: "org";
10
11
  readonly membership: "mem";
11
12
  readonly invitation: "inv";
@@ -22,16 +23,15 @@ export declare const ID_PREFIXES: {
22
23
  readonly file_upload: "ful";
23
24
  readonly file_download: "fdl";
24
25
  readonly observation: "obs";
25
- readonly telemetry_batch: "bch";
26
- readonly telemetry_gap: "gap";
27
- readonly export: "exp";
28
26
  readonly upload: "upl";
29
27
  readonly measurement: "msr";
30
28
  readonly statement: "stm";
29
+ readonly payment_method: "pmt";
30
+ readonly billing_transaction: "txn";
31
31
  };
32
32
  export type IdKind = keyof typeof ID_PREFIXES;
33
33
  export type Id<K extends IdKind = IdKind> = `${(typeof ID_PREFIXES)[K]}_${string}`;
34
- export declare const ID_KINDS: readonly ("message" | "user" | "organization" | "membership" | "invitation" | "workspace" | "api_key" | "provider_credential" | "session" | "agent" | "tool_call" | "operation" | "approval" | "generation" | "file_upload" | "file_download" | "observation" | "telemetry_batch" | "telemetry_gap" | "export" | "upload" | "measurement" | "statement")[];
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
35
  export declare function idPatternSource(kind: IdKind): string;
36
36
  export declare function idPattern(kind: IdKind): RegExp;
37
37
  export declare function isId<K extends IdKind>(kind: K, value: unknown): value is Id<K>;
@@ -51,15 +51,13 @@ export type AccountOperationalState = (AccountActiveState & {
51
51
  }) | (AccountPausedState & {
52
52
  readonly status: "paused";
53
53
  });
54
- /** Why an account is paused, and therefore which remedy exists. One value per durable `finance.billing_account.state` hold: collapsing all four onto `top_up_required` told a customer under a dispute hold to make a payment that would not restore service. */
54
+ /** Why the personal prepaid account cannot admit paid work. */
55
55
  export type AccountPauseReason = "top_up_required" | "payment_hold" | "dispute_hold" | "account_closed";
56
- /** A paused account and what it takes to restore it. */
56
+ /** A paused account and its customer-visible remedy. */
57
57
  export interface AccountPausedState {
58
58
  readonly changedAt: string;
59
- readonly deletionScheduledAt?: string;
60
59
  readonly minimumRestoreCents?: string;
61
60
  readonly reason: AccountPauseReason;
62
- readonly retentionFundedUntil?: string;
63
61
  readonly revision: number;
64
62
  }
65
63
  /** The one error envelope every failing request returns. */
@@ -68,59 +66,93 @@ export interface ApiError {
68
66
  }
69
67
  /** The failure itself. */
70
68
  export interface ApiErrorBody {
71
- readonly code: "unauthenticated" | "forbidden" | "insufficient_scope" | "token_invalid" | "token_revoked" | "token_expired" | "malformed_token" | "authorization_pending" | "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" | "export_not_found" | "export_not_ready" | "export_expired" | "export_revoked" | "export_capacity" | "download_grant_expired" | "telemetry_payload_too_large" | "invalid_telemetry" | "telemetry_quota_exceeded" | "telemetry_incomplete" | "unsupported_export_signal" | "invalid_query" | "telemetry_query_budget_exhausted" | "invalid_metric_aggregation" | "invalid_network_policy" | "unsupported_package_ecosystem" | "package_resolution_failed" | "package_artifact_unavailable" | "package_integrity_mismatch" | "unknown_provider" | "unknown_model" | "provider_credential_not_found" | "provider_credential_revoked" | "invalid_auto_topup_policy" | "payment_method_required" | "authentication_unavailable" | "account_paused" | "account_state_unavailable" | "precondition_failed" | "wrong_workspace_region" | "observability_unavailable" | "usage_unavailable" | "rate_limited" | "upstream_error" | "workspace_provision_pending" | "commit_outcome_unknown" | "not_implemented" | "internal_error";
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";
72
70
  readonly details?: ErrorDetails;
73
71
  readonly message: string;
74
72
  readonly operationId?: Id<"operation">;
75
73
  readonly requestId: string;
76
74
  readonly retryable: boolean;
77
75
  }
78
- /** Workspace API key metadata. There is no public last-used timestamp. */
76
+ /** Workspace API key metadata. Secret material is never returned by reads. */
79
77
  export interface ApiKey {
80
78
  readonly createdAt: string;
81
79
  readonly id: Id<"api_key">;
82
80
  readonly name: string;
83
81
  readonly revokedAt?: string;
84
- readonly scopes: ReadonlyArray<"account:read" | "account:write" | "organizations:read" | "organizations:write" | "memberships:read" | "memberships:write" | "memberships:accept" | "workspaces:read" | "workspaces:write" | "workspaces:delete" | "api_keys:read" | "api_keys:write" | "billing:read" | "billing:write" | "operations:read" | "operations:write" | "workspace:read" | "sessions:read" | "sessions:write" | "sessions:delete" | "files:live" | "resources:read" | "resources:write" | "provider_credentials:read" | "provider_credentials:write" | "telemetry:read" | "telemetry:write">;
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">;
85
83
  readonly workspaceId: Id<"workspace">;
86
84
  }
87
- /** Mint a workspace API key. */
85
+ /** Mint a key for the account's fixed workspace. */
88
86
  export interface ApiKeyCreateRequest {
89
87
  readonly name: string;
90
- readonly scopes: ReadonlyArray<"account:read" | "account:write" | "organizations:read" | "organizations:write" | "memberships:read" | "memberships:write" | "memberships:accept" | "workspaces:read" | "workspaces:write" | "workspaces:delete" | "api_keys:read" | "api_keys:write" | "billing:read" | "billing:write" | "operations:read" | "operations:write" | "workspace:read" | "sessions:read" | "sessions:write" | "sessions:delete" | "files:live" | "resources:read" | "resources:write" | "provider_credentials:read" | "provider_credentials:write" | "telemetry:read" | "telemetry:write">;
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">;
91
89
  readonly workspaceId: Id<"workspace">;
92
90
  }
93
- /** One page of API key metadata. */
91
+ /** One bounded page of API key metadata. */
94
92
  export interface ApiKeyPage {
95
93
  readonly items: ReadonlyArray<ApiKey>;
96
94
  readonly nextCursor?: string;
97
95
  }
98
- /** The complete automatic top-up policy. */
99
- export interface AutoTopupPolicy {
100
- readonly amountCents: string;
101
- readonly enabled: boolean;
102
- readonly organizationId: Id<"organization">;
103
- readonly revision: number;
104
- readonly thresholdCents: string;
105
- readonly updatedAt: string;
106
- }
107
- /** Replace the automatic top-up policy; every field is required. */
108
- export interface AutoTopupPolicyRequest {
109
- readonly amountCents: string;
110
- readonly enabled: boolean;
111
- readonly thresholdCents: string;
112
- }
113
- /** The prepaid balance of one organization. */
96
+ /** The current prepaid position of the caller's personal account. */
114
97
  export interface BillingBalance {
98
+ readonly accountId: Id<"account">;
115
99
  readonly availableCents: string;
116
100
  readonly currency: Currency;
117
- readonly operationalState: AccountOperationalState;
118
- readonly organizationId: Id<"organization">;
119
101
  readonly pendingCents: string;
120
102
  readonly reservedCents: string;
121
- readonly revision: number;
122
103
  readonly updatedAt: string;
123
104
  }
105
+ /** One immutable customer-visible ledger transaction. */
106
+ export interface BillingTransaction {
107
+ readonly amountCents: string;
108
+ readonly balanceAfterCents: string;
109
+ readonly currency: Currency;
110
+ readonly direction: BillingTransactionDirection;
111
+ readonly id: Id<"billing_transaction">;
112
+ readonly kind: BillingTransactionKind;
113
+ readonly occurredAt: string;
114
+ readonly reversesTransactionId?: Id<"billing_transaction">;
115
+ readonly sessionId?: Id<"session">;
116
+ }
117
+ /** Whether the transaction increases or decreases available prepaid value. */
118
+ export type BillingTransactionDirection = "credit" | "debit";
119
+ /** The customer-visible reason for an immutable balanced ledger transaction. */
120
+ export type BillingTransactionKind = "top_up" | "usage" | "refund" | "reversal" | "reservation" | "reservation_release";
121
+ /** One newest-first page of immutable ledger transactions. */
122
+ export interface BillingTransactionPage {
123
+ readonly items: ReadonlyArray<BillingTransaction>;
124
+ readonly nextCursor?: string;
125
+ }
126
+ /** The independently measured and rated launch categories. */
127
+ export type BillingUsageCategory = "model" | "runtime" | "storage" | "transfer";
128
+ /** The trustworthy completeness boundary for one usage answer. */
129
+ export interface BillingUsageCoverage {
130
+ readonly completeThrough: string;
131
+ readonly hasGap: boolean;
132
+ readonly includesThrough: string;
133
+ }
134
+ /** One bounded rated-usage aggregate with exact charge evidence. */
135
+ export interface BillingUsageItem {
136
+ readonly amountCents: string;
137
+ readonly category: BillingUsageCategory;
138
+ readonly chargedQuantity: string;
139
+ readonly currency: Currency;
140
+ readonly model?: string;
141
+ readonly provider?: ProviderId;
142
+ readonly quantity: string;
143
+ readonly serviceTime: TimeRange;
144
+ readonly sessionId?: Id<"session">;
145
+ readonly settlement: BillingUsageSettlement;
146
+ readonly unit: string;
147
+ }
148
+ /** One bounded page of rated usage and its explicit completeness boundary. */
149
+ export interface BillingUsagePage {
150
+ readonly coverage: BillingUsageCoverage;
151
+ readonly items: ReadonlyArray<BillingUsageItem>;
152
+ readonly nextCursor?: string;
153
+ }
154
+ /** Whether this rated row has been posted to the money ledger. */
155
+ export type BillingUsageSettlement = "pending" | "settled";
124
156
  /** How inline blob bytes are encoded. */
125
157
  export type BlobEncoding = "utf8" | "base64";
126
158
  /** A small value carried in the request. */
@@ -134,6 +166,8 @@ export type BlobInput = (BlobInline & {
134
166
  readonly type: "inline";
135
167
  }) | (BlobUpload & {
136
168
  readonly type: "upload";
169
+ }) | (BlobUrl & {
170
+ readonly type: "url";
137
171
  });
138
172
  /** A large value staged through the upload surface. */
139
173
  export interface BlobUpload {
@@ -141,12 +175,18 @@ export interface BlobUpload {
141
175
  readonly sizeBytes: string;
142
176
  readonly uploadId: Id<"upload">;
143
177
  }
178
+ /** An HTTPS source fetched asynchronously under the platform SSRF, redirect, time and size policy. */
179
+ export interface BlobUrl {
180
+ readonly url: string;
181
+ }
144
182
  /** An explicit inclusive byte range over an immutable object. */
145
183
  export interface ByteRange {
146
184
  readonly endInclusive: string;
147
185
  readonly start: string;
148
186
  }
149
- /** One resolved compute dimension. */
187
+ /** Customer-safe card-network display metadata reported by Stripe. */
188
+ export type CardBrand = "visa" | "mastercard" | "amex" | "discover" | "diners" | "jcb" | "unionpay" | "unknown";
189
+ /** One resolved sandbox compute dimension. */
150
190
  export interface ComputeShape {
151
191
  readonly memoryMiB: number;
152
192
  readonly vcpus: number;
@@ -156,74 +196,34 @@ export interface ContentRef {
156
196
  readonly sha256: string;
157
197
  readonly sizeBytes: string;
158
198
  }
159
- /** The only supported currency. */
199
+ /** The only launch currency. */
160
200
  export type Currency = "USD";
161
- /** The one bounded read that fills the dashboard shell. */
201
+ /** The single bounded read that fills the launch dashboard shell. */
162
202
  export interface DashboardBootstrap {
163
- readonly accounts: ReadonlyArray<OrganizationAccount>;
203
+ readonly accountId: Id<"account">;
204
+ readonly accountState: AccountOperationalState;
164
205
  readonly email: string;
165
206
  readonly generatedAt: string;
166
- readonly organizations: ReadonlyArray<Organization>;
167
207
  readonly userId: Id<"user">;
168
- readonly workspaces: ReadonlyArray<Workspace>;
208
+ readonly workspace: Workspace;
169
209
  }
170
- /** A minted browser session, returned exactly once. */
210
+ /** A rotated browser session returned exactly once. */
171
211
  export interface DashboardSessionCredential {
172
212
  readonly expiresAt: string;
173
213
  readonly session: string;
174
214
  readonly userId: Id<"user">;
175
215
  }
176
- /** Complete a browser sign-in by handing this plane the authorization code a provider redirect returned. `central-identity-api` performs the token exchange with the provider itself, so nothing the caller asserts about who they are is believed: the person is whoever the provider answers with. */
216
+ /** Complete a Google OAuth browser sign-in using PKCE-bound state. */
177
217
  export interface DashboardSessionRequest {
178
218
  readonly code: string;
179
219
  readonly codeVerifier: string;
180
- readonly provider: IdentityProvider;
181
220
  readonly state: string;
182
221
  }
183
- /** A session whose irreversible deletion is running; rendered at 410. */
222
+ /** Minimal deletion marker returned while content cleanup runs. */
184
223
  export interface DeletingSession {
185
224
  readonly id: Id<"session">;
186
225
  readonly operationId: Id<"operation">;
187
226
  readonly startedAt: string;
188
- readonly workspaceId: Id<"workspace">;
189
- }
190
- /** A pending device authorization the user must approve in a browser. */
191
- export interface DeviceAuthorization {
192
- readonly deviceCode: string;
193
- readonly expiresAt: string;
194
- readonly intervalSeconds: number;
195
- readonly userCode: string;
196
- readonly verificationUri: string;
197
- readonly verificationUriComplete: string;
198
- }
199
- /** Begin the CLI device-authorization flow. */
200
- export interface DeviceAuthorizationRequest {
201
- readonly clientId: string;
202
- readonly scopes: ReadonlyArray<"account:read" | "account:write" | "organizations:read" | "organizations:write" | "memberships:read" | "memberships:write" | "memberships:accept" | "workspaces:read" | "workspaces:write" | "workspaces:delete" | "api_keys:read" | "api_keys:write" | "billing:read" | "billing:write" | "operations:read" | "operations:write" | "workspace:read" | "sessions:read" | "sessions:write" | "sessions:delete" | "files:live" | "resources:read" | "resources:write" | "provider_credentials:read" | "provider_credentials:write" | "telemetry:read" | "telemetry:write">;
203
- }
204
- /** What a person chose about a device authorization. */
205
- export type DeviceDecision = "approve" | "deny";
206
- /** Approve or deny a pending device authorization by its user code. */
207
- export interface DeviceDecisionRequest {
208
- readonly decision: DeviceDecision;
209
- readonly userCode: string;
210
- }
211
- /** The recorded outcome of a device decision. */
212
- export interface DeviceDecisionResult {
213
- readonly decidedAt: string;
214
- readonly decision: DeviceDecision;
215
- readonly scopes: ReadonlyArray<"account:read" | "account:write" | "organizations:read" | "organizations:write" | "memberships:read" | "memberships:write" | "memberships:accept" | "workspaces:read" | "workspaces:write" | "workspaces:delete" | "api_keys:read" | "api_keys:write" | "billing:read" | "billing:write" | "operations:read" | "operations:write" | "workspace:read" | "sessions:read" | "sessions:write" | "sessions:delete" | "files:live" | "resources:read" | "resources:write" | "provider_credentials:read" | "provider_credentials:write" | "telemetry:read" | "telemetry:write">;
216
- }
217
- /** An issued account token. */
218
- export interface DeviceToken {
219
- readonly accountToken: string;
220
- readonly expiresAt: string;
221
- readonly scopes: ReadonlyArray<"account:read" | "account:write" | "organizations:read" | "organizations:write" | "memberships:read" | "memberships:write" | "memberships:accept" | "workspaces:read" | "workspaces:write" | "workspaces:delete" | "api_keys:read" | "api_keys:write" | "billing:read" | "billing:write" | "operations:read" | "operations:write" | "workspace:read" | "sessions:read" | "sessions:write" | "sessions:delete" | "files:live" | "resources:read" | "resources:write" | "provider_credentials:read" | "provider_credentials:write" | "telemetry:read" | "telemetry:write">;
222
- }
223
- /** Exchange an approved device code for an account token. */
224
- export interface DeviceTokenRequest {
225
- readonly clientId: string;
226
- readonly deviceCode: string;
227
227
  }
228
228
  /** A short-lived signed grant for exactly one object and range. */
229
229
  export interface DownloadGrant {
@@ -239,7 +239,7 @@ export interface DownloadGrant {
239
239
  export interface EffectiveWorkspaceLimit {
240
240
  readonly changedAt: string;
241
241
  readonly effectiveValue: LimitValue;
242
- 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" | "telemetry.batch" | "telemetry.ingest_rate" | "telemetry.metric_series" | "query.filter" | "query.page" | "stream.frame" | "metric.aggregate" | "registry.entries" | "registry.value_bytes" | "telemetry.export";
242
+ 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";
243
243
  readonly revision: number;
244
244
  readonly source: LimitSource;
245
245
  }
@@ -265,17 +265,11 @@ export type ErrorDetails = (ErrorDetailsRequiredScope & {
265
265
  readonly type: "operation";
266
266
  }) | (ErrorDetailsValidation & {
267
267
  readonly type: "validation";
268
- }) | (ErrorDetailsGap & {
269
- readonly type: "gap";
270
268
  });
271
- /** The telemetry gaps that blocked a completeness requirement. */
272
- export interface ErrorDetailsGap {
273
- readonly gapIds: ReadonlyArray<Id<"telemetry_gap">>;
274
- }
275
269
  /** The effective limit that was exceeded. */
276
270
  export interface ErrorDetailsLimit {
277
271
  readonly effective: string;
278
- 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" | "telemetry.batch" | "telemetry.ingest_rate" | "telemetry.metric_series" | "query.filter" | "query.page" | "stream.frame" | "metric.aggregate" | "registry.entries" | "registry.value_bytes" | "telemetry.export";
272
+ 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";
279
273
  readonly measured: string;
280
274
  }
281
275
  /** The original operation the replay resolved to. */
@@ -285,7 +279,7 @@ export interface ErrorDetailsOperation {
285
279
  /** The quota dimension that was exhausted. */
286
280
  export interface ErrorDetailsQuota {
287
281
  readonly attempted: string;
288
- 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" | "telemetry.batch" | "telemetry.ingest_rate" | "telemetry.metric_series" | "query.filter" | "query.page" | "stream.frame" | "metric.aggregate" | "registry.entries" | "registry.value_bytes" | "telemetry.export";
282
+ 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";
289
283
  readonly used: string;
290
284
  }
291
285
  /** The authoritative placement of the workspace. */
@@ -295,7 +289,7 @@ export interface ErrorDetailsRegion {
295
289
  }
296
290
  /** The scope the credential lacks. */
297
291
  export interface ErrorDetailsRequiredScope {
298
- readonly scope: "account:read" | "account:write" | "organizations:read" | "organizations:write" | "memberships:read" | "memberships:write" | "memberships:accept" | "workspaces:read" | "workspaces:write" | "workspaces:delete" | "api_keys:read" | "api_keys:write" | "billing:read" | "billing:write" | "operations:read" | "operations:write" | "workspace:read" | "sessions:read" | "sessions:write" | "sessions:delete" | "files:live" | "resources:read" | "resources:write" | "provider_credentials:read" | "provider_credentials:write" | "telemetry:read" | "telemetry:write";
292
+ 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";
299
293
  }
300
294
  /** How long to wait before retrying. */
301
295
  export interface ErrorDetailsRetry {
@@ -306,46 +300,7 @@ export interface ErrorDetailsValidation {
306
300
  readonly pointer: string;
307
301
  readonly reason: string;
308
302
  }
309
- /** What an export does when the window has recorded gaps. */
310
- export type ExportCompleteness = "require" | "allow_gaps";
311
- /** The two export formats. Parquet is deliberately absent: its encoder is a
312
- typed refusal pending a writer that can be pinned to byte-identical
313
- output, and admitting an operation guaranteed to fail is worse than
314
- refusing the request. Re-adding it is a wire change.
315
- */
316
- export type ExportFormat = "ndjson" | "otlp_json";
317
- /** What one export walks. Deliberately not an `ObservationQuery`: an export
318
- has no caller-visible pagination, so a cursor, a limit and a walk
319
- direction are meaningless states rather than states to refuse at runtime.
320
- The partition list and the snapshot position are pinned at admission and
321
- live on the export row, which is the only channel the task has.
322
- */
323
- export interface ExportQuery {
324
- readonly consistency?: ObservationConsistency;
325
- readonly filter?: ObservationFilter;
326
- readonly signal: ObservationSignal;
327
- readonly timeRange: TimeRange;
328
- }
329
- /** Where an export is in its lifecycle. */
330
- export type ExportStatus = "preparing" | "ready" | "failed" | "expired" | "revoked";
331
- /** One file entry, identified by its normalized POSIX path. */
332
- export interface FileEntry {
333
- readonly mode: string;
334
- readonly mtime: string;
335
- readonly path: string;
336
- readonly sha256?: string;
337
- readonly sizeBytes: string;
338
- readonly target?: string;
339
- readonly type: FileEntryType;
340
- }
341
- /** One page of file entries. */
342
- export interface FileEntryPage {
343
- readonly items: ReadonlyArray<FileEntry>;
344
- readonly nextCursor?: string;
345
- }
346
- /** What a file entry is. */
347
- export type FileEntryType = "file" | "directory" | "symlink";
348
- /** The guest network policy. */
303
+ /** The sandbox network policy. */
349
304
  export interface HandsNetworkRequest {
350
305
  readonly mode: NetworkMode;
351
306
  }
@@ -359,32 +314,6 @@ export interface HttpHeader {
359
314
  readonly name: string;
360
315
  readonly value: string;
361
316
  }
362
- /** An external sign-in provider AEX links a person to. */
363
- export type IdentityProvider = "google";
364
- /** A pending invitation to join an organization. */
365
- export interface Invitation {
366
- readonly createdAt: string;
367
- readonly email: string;
368
- readonly expiresAt: string;
369
- readonly id: Id<"invitation">;
370
- readonly organizationId: Id<"organization">;
371
- readonly resolvedAt?: string;
372
- readonly role: InvitationRole;
373
- readonly status: InvitationStatus;
374
- }
375
- /** What one acceptance redeemed. An invitation carries no secret, so acceptance names nothing: every pending invitation addressed to the caller's verified email is redeemed in one transaction. The list is empty when nothing was pending, which is what a repeated call answers. */
376
- export interface InvitationAcceptResult {
377
- readonly memberships: ReadonlyArray<Membership>;
378
- }
379
- /** Invite a person to an organization. */
380
- export interface InvitationCreateRequest {
381
- readonly email: string;
382
- readonly role: InvitationRole;
383
- }
384
- /** The role an invitation grants; ownership is never invited. */
385
- export type InvitationRole = "admin" | "member";
386
- /** Where an invitation is in its lifecycle. */
387
- export type InvitationStatus = "pending" | "accepted" | "revoked" | "expired";
388
317
  /** A limit whose effective value is a map of named dimensions. */
389
318
  export interface LimitMapValue {
390
319
  readonly values: Readonly<Record<string, string>>;
@@ -401,116 +330,18 @@ export type LimitValue = (LimitScalarValue & {
401
330
  }) | (LimitMapValue & {
402
331
  readonly shape: "map";
403
332
  });
404
- /** One exact-generation descriptor-pinned multipart download. It carries no object-store URL: every part is read directly from the retained `MicroVM`. */
405
- export interface LiveFileDownload {
406
- readonly expiresAt: string;
407
- readonly generationId: Id<"generation">;
408
- readonly id: Id<"file_download">;
409
- readonly partCount: number;
410
- readonly partSizeBytes: number;
411
- readonly parts: ReadonlyArray<LiveFileDownloadPart>;
412
- readonly path: string;
413
- readonly sessionId: Id<"session">;
414
- readonly sha256: string;
415
- readonly sizeBytes: string;
416
- readonly state: LiveFileDownloadState;
417
- readonly version: string;
418
- readonly workspaceAccess: WorkspaceAccess;
419
- }
420
- /** Close an exact live-file descriptor after the SDK verified every part and the whole hash. */
421
- export interface LiveFileDownloadCompleteRequest {
422
- readonly sha256: string;
423
- readonly version: string;
424
- }
425
- /** One fixed range and its expected digest in an exact live-file version. */
426
- export interface LiveFileDownloadPart {
427
- readonly offset: string;
428
- readonly partNumber: number;
429
- readonly sha256: string;
430
- readonly sizeBytes: number;
431
- }
432
- /** Open one regular file without following a symlink, auto-resuming the same generation. */
433
- export interface LiveFileDownloadRequest {
434
- readonly ifGenerationId?: Id<"generation">;
435
- readonly path: string;
436
- }
437
- /** Whether an exact-version live download is still open or fully verified. */
438
- export type LiveFileDownloadState = "open" | "verified";
439
- /** One live file entry plus what the read did to the workspace. */
440
- export interface LiveFileEntry {
441
- readonly entry: FileEntry;
442
- readonly workspaceAccess: WorkspaceAccess;
443
- }
444
- /** One page of live file entries plus what the read did. */
445
- export interface LiveFileEntryPage {
446
- readonly items: ReadonlyArray<FileEntry>;
447
- readonly nextCursor?: string;
448
- readonly workspaceAccess: WorkspaceAccess;
449
- }
450
- /** List live workspace files, auto-resuming the same retained generation if suspended. */
451
- export interface LiveFileListRequest {
452
- readonly cursor?: string;
453
- readonly ifGenerationId?: Id<"generation">;
454
- readonly limit?: number;
455
- readonly path?: string;
456
- readonly recursive?: boolean;
457
- }
458
- /** Stat one live workspace file, auto-resuming the same retained generation if suspended. */
459
- export interface LiveFileStatRequest {
460
- readonly ifGenerationId?: Id<"generation">;
461
- readonly path: string;
462
- }
463
- /** One resumable upload held only by the session's exact `MicroVM` generation. Suspension retains it; termination or runtime loss destroys it. */
464
- export interface LiveFileUpload {
465
- readonly expiresAt: string;
466
- readonly generationId: Id<"generation">;
467
- readonly id: Id<"file_upload">;
468
- readonly mode: RegisteredFileMode;
469
- readonly partCount: number;
470
- readonly partSizeBytes: number;
471
- readonly parts: ReadonlyArray<LiveFileUploadPart>;
472
- readonly path: string;
473
- readonly sessionId: Id<"session">;
474
- readonly sha256: string;
475
- readonly sizeBytes: string;
476
- readonly state: LiveFileUploadState;
477
- readonly workspaceAccess: WorkspaceAccess;
478
- }
479
- /** Create or exactly replay a resumable upload in the session's retained generation. */
480
- export interface LiveFileUploadCreateRequest {
481
- readonly ifGenerationId?: Id<"generation">;
482
- readonly mode?: RegisteredFileMode;
483
- readonly path: string;
484
- readonly sha256: string;
485
- readonly sizeBytes: string;
486
- }
487
- /** One verified logical part retained by the exact `MicroVM` generation. */
488
- export interface LiveFileUploadPart {
489
- readonly offset: string;
490
- readonly partNumber: number;
491
- readonly sha256: string;
492
- readonly sizeBytes: number;
493
- }
494
- /** The generation-local position of one ephemeral upload. */
495
- export type LiveFileUploadState = "staging" | "complete";
496
- /** A person's role inside one organization. */
497
- export interface Membership {
498
- readonly createdAt: string;
499
- readonly email: string;
500
- readonly id: Id<"membership">;
501
- readonly organizationId: Id<"organization">;
502
- readonly role: OrganizationRole;
503
- readonly status: MembershipStatus;
504
- readonly userId: Id<"user">;
505
- }
506
- /** One page of memberships. */
507
- export interface MembershipPage {
508
- readonly items: ReadonlyArray<Membership>;
509
- readonly nextCursor?: string;
333
+ /** One frozen MCP definition and its bounded tool namespace. */
334
+ export interface McpServer {
335
+ readonly name: string;
336
+ readonly transport: McpTransport;
510
337
  }
511
- /** Whether a membership is usable. */
512
- export type MembershipStatus = "active";
513
- /** One complete, sealed message in a session. `createdAt` is display metadata; collection order is the immutable seal-visibility order and is not derived from this field. */
338
+ /** The two admitted MCP transports. */
339
+ export type McpTransport = (RemoteMcpServer & {
340
+ readonly kind: "remote_http";
341
+ }) | (SandboxMcpServer & {
342
+ readonly kind: "sandbox_process";
343
+ });
344
+ /** One complete sealed message in immutable visibility order. */
514
345
  export interface Message {
515
346
  readonly content: ReadonlyArray<MessagePart>;
516
347
  readonly createdAt: string;
@@ -518,12 +349,12 @@ export interface Message {
518
349
  readonly role: MessageRole;
519
350
  readonly sessionId: Id<"session">;
520
351
  }
521
- /** One page of complete sealed messages, ordered by the immutable seal-visibility tuple `(sealedAt, messageId)`. Open partial messages are never visible. */
352
+ /** One page of complete messages. */
522
353
  export interface MessagePage {
523
354
  readonly items: ReadonlyArray<Message>;
524
355
  readonly nextCursor?: string;
525
356
  }
526
- /** One part of a complete message. Admission is text-only; assistant and tool messages may contain canonical built-in tool records. */
357
+ /** One part of a complete committed message. */
527
358
  export type MessagePart = (MessagePartText & {
528
359
  readonly type: "text";
529
360
  }) | (MessagePartToolCall & {
@@ -531,356 +362,103 @@ export type MessagePart = (MessagePartText & {
531
362
  }) | (MessagePartToolResult & {
532
363
  readonly type: "tool_result";
533
364
  });
534
- /** A text part. */
365
+ /** Text content. */
535
366
  export interface MessagePartText {
536
367
  readonly text: string;
537
368
  }
538
- /** A built-in tool call emitted by the model. */
369
+ /** Canonical provider-independent tool call. */
539
370
  export interface MessagePartToolCall {
540
- readonly argumentsDigest: string;
371
+ readonly arguments: JsonValue;
541
372
  readonly id: Id<"tool_call">;
373
+ readonly name: string;
542
374
  }
543
- /** The canonical result of a built-in tool call. */
375
+ /** Bounded tool result; large/full bytes remain at its sandbox path unless storage.persist explicitly registers them as a workspace file. */
544
376
  export interface MessagePartToolResult {
545
377
  readonly id: Id<"tool_call">;
546
- readonly resultDigest: string;
378
+ readonly preview: string;
379
+ readonly sandboxPath?: string;
380
+ readonly sha256?: string;
381
+ readonly sizeBytes?: string;
382
+ readonly truncated: boolean;
547
383
  }
548
- /** Who produced a message. */
384
+ /** Who produced a committed message. */
549
385
  export type MessageRole = "user" | "assistant" | "tool";
550
- /** Admit one text message of at most 24,576 UTF-8 bytes. Omitting `maxSpendCents` selects the 1000-cent default; an explicit positive value may be higher or lower. Omitting `deadline` uses the session's remaining lifetime/drain fence; an explicit deadline may only shorten it. */
386
+ /** Text-only user message; arbitrary files are referenced by mounted paths in this text. */
551
387
  export interface MessageSendRequest {
552
388
  readonly deadline?: string;
553
389
  readonly maxSpendCents?: string;
390
+ readonly responseFormat?: ResponseFormat;
554
391
  readonly text: string;
555
392
  }
556
- /** The admitted user message and the session now processing it. */
393
+ /** The admitted user message and session now processing it. */
557
394
  export interface MessageSendResult {
558
395
  readonly message: Message;
559
396
  readonly session: Session;
560
397
  }
561
- /** The calculations a metric aggregation may request. */
562
- export type MetricAggregationCalculation = "sum" | "count" | "min" | "max" | "avg";
563
- /** One aggregated group. */
564
- export interface MetricAggregationGroup {
565
- readonly key: Readonly<Record<string, string>>;
566
- readonly sampleCount: string;
567
- readonly value: number;
568
- }
569
- /** One page of aggregated groups plus the coverage they are complete over. */
570
- export interface MetricAggregationPage {
571
- readonly coverage: ObservationCoverage;
572
- readonly items: ReadonlyArray<MetricAggregationGroup>;
573
- readonly nextCursor?: string;
574
- }
575
- /** A bounded metric aggregation. */
576
- export interface MetricAggregationRequest {
577
- readonly calculation: MetricAggregationCalculation;
578
- readonly cursor?: string;
579
- readonly filter?: ObservationFilter;
580
- readonly groupBy?: ReadonlyArray<string>;
581
- readonly limit?: number;
582
- readonly metric: string;
583
- readonly timeRange: TimeRange;
584
- }
585
- /** A known hole in the ordered series. */
586
- export interface MissingInterval {
587
- readonly gapId: Id<"telemetry_gap">;
588
- readonly range: TimeRange;
398
+ /** One bounded NDJSON assistant-stream frame. */
399
+ export interface MessageStreamFrame {
400
+ readonly kind: MessageStreamKind;
401
+ readonly message?: Message;
402
+ readonly messageId?: Id<"message">;
403
+ readonly sequence: string;
404
+ readonly text?: string;
589
405
  }
406
+ /** Preview/commit reconciliation protocol. */
407
+ export type MessageStreamKind = "preview" | "committed" | "reconcile" | "gap" | "heartbeat";
590
408
  /** An explicit provider and model pair; a model-only override is rejected. */
591
409
  export interface ModelSelection {
592
- readonly credentialId?: Id<"provider_credential">;
593
410
  readonly model: string;
594
411
  readonly provider: ProviderId;
595
412
  }
596
- /** What the guest may reach. */
413
+ /** What the sandbox may reach. */
597
414
  export type NetworkMode = "none" | "public_internet";
598
- /** A freshly minted key. The value never appears in a later read. */
415
+ /** A freshly minted key; its value is returned once and never stored. */
599
416
  export interface NewApiKey {
600
417
  readonly createdAt: string;
601
418
  readonly id: Id<"api_key">;
602
419
  readonly name: string;
603
- readonly scopes: ReadonlyArray<"account:read" | "account:write" | "organizations:read" | "organizations:write" | "memberships:read" | "memberships:write" | "memberships:accept" | "workspaces:read" | "workspaces:write" | "workspaces:delete" | "api_keys:read" | "api_keys:write" | "billing:read" | "billing:write" | "operations:read" | "operations:write" | "workspace:read" | "sessions:read" | "sessions:write" | "sessions:delete" | "files:live" | "resources:read" | "resources:write" | "provider_credentials:read" | "provider_credentials:write" | "telemetry:read" | "telemetry:write">;
420
+ 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">;
604
421
  readonly value: string;
605
422
  readonly workspaceId: Id<"workspace">;
606
423
  }
607
- /** One admitted observation, in the canonical envelope. */
608
- export interface Observation {
609
- readonly acceptedAt: string;
610
- readonly body: JsonValue;
611
- readonly id: Id<"observation">;
612
- readonly observedAt: string;
613
- readonly sequence: string;
614
- readonly sessionId?: Id<"session">;
615
- readonly signal: ObservationSignal;
616
- readonly spanId?: string;
617
- readonly traceId?: string;
618
- readonly workspaceId: Id<"workspace">;
619
- }
620
- /** How much of the accepted series a read must observe. */
621
- export type ObservationConsistency = "indexed" | "accepted";
622
- /** What the answer is actually complete over. Never omitted. All four watermarks are accepted-time positions in epoch milliseconds (O-04). */
623
- export interface ObservationCoverage {
624
- readonly accepted: string;
625
- readonly caughtUp: boolean;
626
- readonly complete: boolean;
627
- readonly earliestReplay: string;
628
- readonly indexed: string;
629
- readonly missingIntervals: ReadonlyArray<MissingInterval>;
630
- readonly snapshot: string;
631
- readonly unboundedGaps: ReadonlyArray<Id<"telemetry_gap">>;
632
- }
633
- /** A bounded filter AST. Structural bounds are enforced before construction. */
634
- export type ObservationFilter = (ObservationFilterAll & {
635
- readonly op: "all";
636
- }) | (ObservationFilterAny & {
637
- readonly op: "any";
638
- }) | (ObservationFilterNot & {
639
- readonly op: "not";
640
- }) | (ObservationFilterCompare & {
641
- readonly op: "compare";
642
- }) | (ObservationFilterIn & {
643
- readonly op: "in";
644
- }) | (ObservationFilterExists & {
645
- readonly op: "exists";
646
- });
647
- /** Every child must match. */
648
- export interface ObservationFilterAll {
649
- readonly filters: ReadonlyArray<ObservationFilter>;
650
- }
651
- /** At least one child must match. */
652
- export interface ObservationFilterAny {
653
- readonly filters: ReadonlyArray<ObservationFilter>;
654
- }
655
- /** A comparison against one field. */
656
- export interface ObservationFilterCompare {
657
- readonly field: string;
658
- readonly operator: ObservationOperator;
659
- readonly value: string;
660
- }
661
- /** Presence of a field. */
662
- export interface ObservationFilterExists {
663
- readonly field: string;
664
- }
665
- /** Membership of a bounded value set. */
666
- export interface ObservationFilterIn {
667
- readonly field: string;
668
- readonly values: ReadonlyArray<string>;
669
- }
670
- /** The child must not match. */
671
- export interface ObservationFilterNot {
672
- readonly filters: ReadonlyArray<ObservationFilter>;
673
- }
674
- /** One NDJSON frame. `stream` and `listen` emit nothing else. */
675
- export type ObservationFrame = (ObservationFrameRecords & {
676
- readonly type: "records";
677
- }) | (ObservationFrameGap & {
678
- readonly type: "gap";
679
- }) | (ObservationFrameCursor & {
680
- readonly type: "cursor";
681
- }) | (ObservationFrameRotate & {
682
- readonly type: "rotate";
683
- });
684
- /** A resumable position. */
685
- export interface ObservationFrameCursor {
686
- readonly coverage: ObservationCoverage;
687
- readonly cursor: string;
688
- }
689
- /** A gap surfaced inline; it is never silently skipped. */
690
- export interface ObservationFrameGap {
691
- readonly gap: TelemetryGap;
692
- }
693
- /** A batch of observations. The server splits before the effective frame bound. */
694
- export interface ObservationFrameRecords {
695
- readonly items: ReadonlyArray<Observation>;
696
- }
697
- /** The terminal condition after a 200. A stream always ends with a reason. */
698
- export interface ObservationFrameRotate {
699
- readonly cursor?: string;
700
- readonly error?: ApiErrorBody;
701
- readonly reason: RotateReason;
702
- readonly retryable: boolean;
703
- }
704
- /** Capture the current accepted position and follow it. Origins are rejected. */
705
- export interface ObservationListenRequest {
706
- readonly filter?: ObservationFilter;
707
- readonly signal: ObservationSignal;
708
- }
709
- /** The comparison operators a filter leaf may use. */
710
- export type ObservationOperator = "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "prefix";
711
- /** Which direction a read walks the ordered series. */
712
- export type ObservationOrder = "ascending" | "descending";
713
- /** Exactly one origin. A stream that declares none or two is rejected. */
714
- export type ObservationOrigin = (ObservationOriginCursor & {
715
- readonly from: "cursor";
716
- }) | (ObservationOriginTime & {
717
- readonly from: "time";
718
- }) | (ObservationOriginEarliest & {
719
- readonly from: "earliest";
720
- });
721
- /** Resume from an exact prior position. */
722
- export interface ObservationOriginCursor {
723
- readonly cursor: string;
724
- }
725
- /** Start from the earliest replayable position. */
726
- export type ObservationOriginEarliest = Readonly<Record<string, never>>;
727
- /** Start from an instant. */
728
- export interface ObservationOriginTime {
729
- readonly at: string;
730
- }
731
- /** One page of observations plus the coverage it is complete over. */
732
- export interface ObservationPage {
733
- readonly coverage: ObservationCoverage;
734
- readonly items: ReadonlyArray<Observation>;
735
- readonly nextCursor?: string;
736
- }
737
- /** A bounded, paged observation read. */
738
- export interface ObservationQuery {
739
- readonly consistency?: ObservationConsistency;
740
- readonly cursor?: string;
741
- readonly filter?: ObservationFilter;
742
- readonly limit?: number;
743
- readonly order?: ObservationOrder;
744
- readonly signal: ObservationSignal;
745
- readonly timeRange: TimeRange;
746
- }
747
- /** The six observable signals. */
748
- export type ObservationSignal = "events" | "logs" | "spans" | "metrics" | "traces" | "telemetry";
749
- /** Replay from exactly one declared origin as NDJSON. */
750
- export interface ObservationStreamRequest {
751
- readonly filter?: ObservationFilter;
752
- readonly origin: ObservationOrigin;
753
- readonly signal: ObservationSignal;
754
- }
755
- /** A durable operation record. */
756
- export interface Operation {
757
- readonly cancelable: boolean;
758
- readonly committedAt?: string;
759
- readonly createdAt: string;
760
- readonly error?: OperationFailure;
761
- readonly id: Id<"operation">;
762
- readonly kind: OperationKind;
763
- readonly progress?: OperationProgress;
764
- readonly result?: OperationResult;
765
- readonly sessionId?: Id<"session">;
766
- readonly startedAt?: string;
767
- readonly status: OperationStatus;
768
- readonly terminalAt?: string;
769
- readonly updatedAt: string;
770
- readonly workspaceId: Id<"workspace">;
771
- }
772
- /** A durable operation failure. It carries no synthetic request identity. */
773
- export interface OperationFailure {
774
- readonly code: "unauthenticated" | "forbidden" | "insufficient_scope" | "token_invalid" | "token_revoked" | "token_expired" | "malformed_token" | "authorization_pending" | "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" | "export_not_found" | "export_not_ready" | "export_expired" | "export_revoked" | "export_capacity" | "download_grant_expired" | "telemetry_payload_too_large" | "invalid_telemetry" | "telemetry_quota_exceeded" | "telemetry_incomplete" | "unsupported_export_signal" | "invalid_query" | "telemetry_query_budget_exhausted" | "invalid_metric_aggregation" | "invalid_network_policy" | "unsupported_package_ecosystem" | "package_resolution_failed" | "package_artifact_unavailable" | "package_integrity_mismatch" | "unknown_provider" | "unknown_model" | "provider_credential_not_found" | "provider_credential_revoked" | "invalid_auto_topup_policy" | "payment_method_required" | "authentication_unavailable" | "account_paused" | "account_state_unavailable" | "precondition_failed" | "wrong_workspace_region" | "observability_unavailable" | "usage_unavailable" | "rate_limited" | "upstream_error" | "workspace_provision_pending" | "commit_outcome_unknown" | "not_implemented" | "internal_error";
775
- readonly detail?: JsonValue;
776
- readonly retryable: boolean;
777
- }
778
- /** Every durable operation the platform admits. */
779
- export type OperationKind = "session_cancel" | "session_suspend" | "session_resume" | "session_terminate" | "session_delete" | "telemetry_export" | "workspace_delete";
780
- /** One page of durable operations. */
781
- export interface OperationPage {
782
- readonly items: ReadonlyArray<Operation>;
783
- readonly nextCursor?: string;
784
- }
785
- /** Coarse progress; never a completion promise. */
786
- export interface OperationProgress {
787
- readonly completed?: string;
788
- readonly phase: string;
789
- readonly total?: string;
790
- }
791
- /** The typed successful result of a durable operation. */
792
- export type OperationResult = (SessionCancelResult & {
793
- readonly kind: "session_cancel";
794
- }) | (SessionSuspendResult & {
795
- readonly kind: "session_suspend";
796
- }) | (SessionResumeResult & {
797
- readonly kind: "session_resume";
798
- }) | (SessionTerminateResult & {
799
- readonly kind: "session_terminate";
800
- }) | (SessionTombstone & {
801
- readonly kind: "session_delete";
802
- }) | (TelemetryExportResult & {
803
- readonly kind: "telemetry_export";
804
- }) | (WorkspaceTombstone & {
805
- readonly kind: "workspace_delete";
806
- });
807
- /** Where a durable operation is in its lifecycle. */
808
- export type OperationStatus = "queued" | "running" | "succeeded" | "failed" | "cancelled";
809
- /** Where a workspace operational state comes from. */
810
- export type OperationalStateSource = "account";
811
- /** The billing and ownership boundary. */
812
- export interface Organization {
813
- readonly callerRole: OrganizationRole;
814
- readonly createdAt: string;
815
- readonly id: Id<"organization">;
816
- readonly name: string;
817
- readonly slug: string;
818
- }
819
- /** One organization's operational state in a multi-organization dashboard snapshot. */
820
- export interface OrganizationAccount {
821
- readonly organizationId: Id<"organization">;
822
- readonly state: AccountOperationalState;
823
- }
824
- /** Create an organization. */
825
- export interface OrganizationCreateRequest {
826
- readonly name: string;
827
- }
828
- /** One page of organizations. */
829
- export interface OrganizationPage {
830
- readonly items: ReadonlyArray<Organization>;
831
- readonly nextCursor?: string;
832
- }
833
- /** The caller role inside one organization. */
834
- export type OrganizationRole = "owner" | "admin" | "member";
835
- /** The package ecosystems a session may pre-install from. */
424
+ /** Supported setup package ecosystems. */
836
425
  export type PackageEcosystem = "apt" | "pip" | "npm";
837
- /** One exactly-pinned package to pre-install. */
426
+ /** One exactly pinned setup package. */
838
427
  export interface PackageRequest {
839
428
  readonly ecosystem: PackageEcosystem;
840
429
  readonly name: string;
841
430
  readonly version: string;
842
431
  }
843
- /** Create a hosted billing portal session. */
844
- export interface PortalSessionRequest {
845
- readonly returnUrl?: string;
846
- }
847
- /** A BYOK provider-credential binding. The key material never appears here. */
848
- export interface ProviderCredential {
432
+ /** Display-only metadata for one Stripe card; never PAN, CVC, or a client secret. */
433
+ export interface PaymentMethod {
434
+ readonly brand: CardBrand;
849
435
  readonly createdAt: string;
850
- readonly fingerprint: string;
851
- readonly id: Id<"provider_credential">;
852
- readonly name: string;
853
- readonly provider: ProviderId;
854
- readonly revision: number;
855
- readonly revokedAt?: string;
856
- readonly state: ProviderCredentialState;
857
- readonly updatedAt: string;
858
- }
859
- /** One page of provider-credential bindings. */
860
- export interface ProviderCredentialPage {
861
- readonly items: ReadonlyArray<ProviderCredential>;
862
- readonly nextCursor?: string;
863
- }
864
- /** Register a BYOK provider credential. This request carries plaintext. */
865
- export interface ProviderCredentialRegisterRequest {
866
- readonly apiKey: string;
867
- readonly name: string;
868
- readonly provider: ProviderId;
436
+ readonly expiryMonth: number;
437
+ readonly expiryYear: number;
438
+ readonly id: Id<"payment_method">;
439
+ readonly isDefault: boolean;
440
+ readonly last4: string;
441
+ }
442
+ /** The bounded set of cards attached to the caller's account. */
443
+ export interface PaymentMethodPage {
444
+ readonly items: ReadonlyArray<PaymentMethod>;
445
+ }
446
+ /** Request a Stripe-hosted card setup session. */
447
+ export interface PaymentMethodSessionRequest {
448
+ readonly cancelUrl?: string;
449
+ readonly consent: boolean;
450
+ readonly successUrl?: string;
869
451
  }
870
- /** Whether a BYOK binding may still be selected. */
871
- export type ProviderCredentialState = "ready" | "revoked";
872
- /** The eight customer-owned BYOK authorities. Gateway authorities use fixed endpoints; arbitrary base URLs are not accepted. */
873
- export type ProviderId = "openai" | "anthropic" | "deepseek" | "zai" | "moonshotai" | "google" | "openrouter" | "vercel_ai_gateway";
452
+ /** The candidate official BYOK authorities. Only models admitted by the current Rig-backed catalog are selectable; arbitrary base URLs are not accepted. */
453
+ export type ProviderId = "openai" | "anthropic" | "deepseek" | "xai" | "meta" | "moonshotai" | "alibaba";
874
454
  /** A registered file entry, complete. */
875
455
  export interface RegisteredFile {
876
456
  readonly createdAt: string;
457
+ readonly failureCode?: string;
877
458
  readonly name: string;
878
- readonly revision: number;
879
- readonly sha256: string;
880
- readonly sizeBytes: string;
881
459
  readonly state: RegisteredState;
882
460
  readonly updatedAt: string;
883
- readonly value: RegisteredFileRead;
461
+ readonly value?: RegisteredFileRead;
884
462
  }
885
463
  /** The two permitted registered-file modes. */
886
464
  export type RegisteredFileMode = "0644" | "0755";
@@ -894,32 +472,33 @@ export interface RegisteredFileRead {
894
472
  readonly content: ContentRef;
895
473
  readonly mediaType: string;
896
474
  readonly mode: RegisteredFileMode;
897
- readonly mountPath: string;
898
475
  }
899
476
  /** One registered file as a collection row. A listing carries no value document; read the entry itself to get one. */
900
477
  export interface RegisteredFileRow {
901
478
  readonly createdAt: string;
479
+ readonly failureCode?: string;
902
480
  readonly name: string;
903
- readonly revision: number;
904
- readonly sha256: string;
905
- readonly sizeBytes: string;
906
481
  readonly state: RegisteredState;
907
482
  readonly updatedAt: string;
908
483
  }
909
- /** A registered file. */
484
+ /** A latest-only registered file replacement. */
910
485
  export interface RegisteredFileValue {
911
486
  readonly content: BlobInput;
912
487
  readonly mediaType: string;
913
488
  readonly mode: RegisteredFileMode;
914
- readonly mountPath: string;
915
489
  }
916
- /** The only state a registered entry has; there is no version history. */
917
- export type RegisteredState = "current";
490
+ /** State of the single current value; prior values are never addressable. */
491
+ export type RegisteredState = "pending" | "ready" | "failed";
918
492
  /** Mint a download grant for a registered file. */
919
493
  export interface RegistryDownloadRequest {
920
494
  readonly range?: ByteRange;
921
495
  }
922
- /** The complete provider-derived capacity of the selected shape. */
496
+ /** A remote Streamable HTTP MCP server frozen at session setup and invoked on demand inside the sandbox. */
497
+ export interface RemoteMcpServer {
498
+ readonly headers?: Readonly<Record<string, string>>;
499
+ readonly url: string;
500
+ }
501
+ /** Complete provider-derived capacity of the frozen shape. */
923
502
  export interface ResolvedCompute {
924
503
  readonly baseline: ComputeShape;
925
504
  readonly endpointBandwidthMBps: number;
@@ -928,74 +507,82 @@ export interface ResolvedCompute {
928
507
  readonly peak: ComputeShape;
929
508
  readonly size: "512mb" | "1gb" | "2gb" | "4gb" | "8gb";
930
509
  }
931
- /** Everything the platform resolved for this session. */
510
+ /** Customer-safe frozen session configuration; all plaintext secrets are omitted. */
932
511
  export interface ResolvedConfig {
933
- readonly catalogRevision: string;
934
- readonly compute: ResolvedCompute;
512
+ readonly compute?: ResolvedCompute;
935
513
  readonly lifecycle: SessionLifecyclePolicy;
514
+ readonly mcpServerNames: ReadonlyArray<string>;
936
515
  readonly model: string;
937
- readonly network: ResolvedNetwork;
516
+ readonly network?: ResolvedNetwork;
938
517
  readonly packages: ReadonlyArray<PackageRequest>;
939
518
  readonly provider: ProviderId;
940
- readonly providerCredentialId: Id<"provider_credential">;
941
519
  readonly registered: SessionRegisteredSelection;
520
+ readonly sandboxEnabled: boolean;
942
521
  }
943
- /** The resolved guest network policy. */
522
+ /** Resolved sandbox network policy. */
944
523
  export interface ResolvedNetwork {
945
524
  readonly hands: HandsNetworkRequest;
946
525
  }
947
- /** Why a stream ended after its 200. */
948
- export type RotateReason = "budget_exhausted" | "server_rotating" | "client_idle" | "upstream_unavailable" | "failed";
949
- /** A multi-turn conversation backed by at most one retained provider generation. Termination destroys compute and live files but preserves this metadata and sealed messages until deletion. */
526
+ /** Optional native structured-output request; prompt emulation is never presented as strict. */
527
+ export interface ResponseFormat {
528
+ readonly kind: ResponseFormatKind;
529
+ readonly schema?: JsonValue;
530
+ }
531
+ /** Requested final response format. */
532
+ export type ResponseFormatKind = "text" | "json_schema";
533
+ /** An MCP process launched inside the sandbox after workspace materialization. */
534
+ export interface SandboxMcpServer {
535
+ readonly args?: ReadonlyArray<string>;
536
+ readonly command: string;
537
+ readonly environment?: Readonly<Record<string, string>>;
538
+ readonly workingDirectory?: string;
539
+ }
540
+ /** Observable preparation state of the session's single default-on sandbox. */
541
+ export type SandboxStatus = "disabled" | "requested" | "ready" | "suspending" | "suspended" | "resuming" | "lost";
542
+ /** The only public execution resource; sandbox loss never terminates agent state. */
950
543
  export interface Session {
951
- readonly activeDeadline?: string;
952
- readonly activeMaxSpendCents?: string;
953
544
  readonly activeMessageId?: Id<"message">;
954
545
  readonly createdAt: string;
955
546
  readonly expiresAt: string;
956
547
  readonly id: Id<"session">;
957
- readonly idleSince?: string;
958
- readonly launchedAt: string;
959
548
  readonly metadata?: Readonly<Record<string, string | number | boolean | null>>;
960
549
  readonly resolvedConfig: ResolvedConfig;
961
550
  readonly revision: number;
551
+ readonly sandboxStatus: SandboxStatus;
962
552
  readonly status: SessionStatus;
963
- readonly suspendAt?: string;
964
- readonly suspendedAt?: string;
965
553
  readonly terminatedAt?: string;
966
- readonly terminationReason?: SessionTerminationReason;
967
554
  readonly updatedAt: string;
968
555
  readonly workspaceId: Id<"workspace">;
969
556
  }
970
- /** The result of cancelling the session's current work. The session is idle afterward and accepts another message. */
971
- export interface SessionCancelResult {
972
- readonly changed: boolean;
557
+ /** Admission receipt for an asynchronous session command; there is no generic operations resource. */
558
+ export interface SessionCommandReceipt {
559
+ readonly acceptedAt: string;
560
+ readonly operationId: Id<"operation">;
973
561
  readonly sessionId: Id<"session">;
974
- readonly sessionRevision: number;
975
562
  }
976
- /** The only customer compute selector. */
563
+ /** The single sandbox's bounded compute selector. */
977
564
  export interface SessionComputeRequest {
978
565
  readonly size?: "512mb" | "1gb" | "2gb" | "4gb" | "8gb";
979
566
  }
980
- /** Create an eight-hour multi-turn session with one explicitly pinned BYOK provider credential. */
567
+ /** Create a durable session with a write-only BYOK key, frozen file/MCP config and a default-on eager sandbox. */
981
568
  export interface SessionCreateRequest {
982
- readonly compute?: SessionComputeRequest;
569
+ readonly expiresAt?: string;
570
+ readonly maxSpendCents?: string;
571
+ readonly mcpServers?: ReadonlyArray<McpServer>;
983
572
  readonly metadata?: Readonly<Record<string, string | number | boolean | null>>;
984
573
  readonly model: string;
985
- readonly network?: SessionNetworkRequest;
986
- readonly packages?: ReadonlyArray<PackageRequest>;
987
574
  readonly provider: ProviderId;
988
- readonly providerCredentialId: Id<"provider_credential">;
575
+ readonly providerApiKey: string;
989
576
  readonly registered?: SessionRegisteredSelection;
577
+ readonly sandbox?: SessionSandboxRequest;
990
578
  }
991
- /** The immutable automatic lifecycle behavior applied to this session. */
579
+ /** Immutable public session bounds; sandbox suspension is an internal lifecycle. */
992
580
  export interface SessionLifecyclePolicy {
993
- readonly idleSuspendAfterSeconds: number;
994
581
  readonly maximumLifetimeSeconds: number;
995
- readonly resumeOnLiveFileAccess: boolean;
996
- readonly resumeOnMessage: boolean;
582
+ readonly maximumSubagentDepth: number;
583
+ readonly maximumSubagents: number;
997
584
  }
998
- /** The collection projection of a session; `resolvedConfig` is omitted. */
585
+ /** Bounded collection projection. */
999
586
  export interface SessionListItem {
1000
587
  readonly activeMessageId?: Id<"message">;
1001
588
  readonly createdAt: string;
@@ -1003,7 +590,7 @@ export interface SessionListItem {
1003
590
  readonly id: Id<"session">;
1004
591
  readonly model: string;
1005
592
  readonly provider: ProviderId;
1006
- readonly revision: number;
593
+ readonly sandboxStatus: SandboxStatus;
1007
594
  readonly status: SessionStatus;
1008
595
  readonly updatedAt: string;
1009
596
  readonly workspaceId: Id<"workspace">;
@@ -1013,174 +600,65 @@ export interface SessionListPage {
1013
600
  readonly items: ReadonlyArray<SessionListItem>;
1014
601
  readonly nextCursor?: string;
1015
602
  }
1016
- /** Network policy for the session. */
603
+ /** Network policy for the one sandbox. */
1017
604
  export interface SessionNetworkRequest {
1018
605
  readonly hands: HandsNetworkRequest;
1019
606
  }
1020
- /** Opaque workspace files mounted into the session. Conventional files such as `AGENTS.md` may carry guidance, skills, tool bundles, MCP configuration or custom instructions; the built-in model tools are `read_file`, `edit_file`, `write_file`, and Bash. */
607
+ /** Files resolved once at session admission; later workspace overwrites cannot mutate this manifest. */
1021
608
  export interface SessionRegisteredSelection {
1022
- readonly files?: ReadonlyArray<string>;
1023
- }
1024
- /** The result of manually resuming the same retained generation to idle. */
1025
- export interface SessionResumeResult {
1026
- readonly changed: boolean;
1027
- readonly resumedAt: string;
1028
- readonly sessionId: Id<"session">;
1029
- readonly sessionRevision: number;
1030
- readonly status: SessionStatus;
1031
- }
1032
- /** What a session is doing right now. */
1033
- export type SessionStatus = "idle" | "running" | "suspending" | "suspended" | "resuming" | "terminating" | "terminated" | "deleting";
1034
- /** The result of manually suspending an idle session's exact retained generation. Active work must be cancelled first. */
1035
- export interface SessionSuspendResult {
1036
- readonly changed: boolean;
1037
- readonly sessionId: Id<"session">;
1038
- readonly sessionRevision: number;
1039
- readonly suspendedAt: string;
609
+ readonly mounts: ReadonlyArray<WorkspaceFileMount>;
1040
610
  }
1041
- /** The result of permanently destroying compute and live files while preserving session metadata and sealed messages. */
1042
- export interface SessionTerminateResult {
1043
- readonly changed: boolean;
1044
- readonly sessionId: Id<"session">;
1045
- readonly sessionRevision: number;
1046
- readonly terminatedAt: string;
611
+ /** Default-on sandbox configuration; enabled=false creates no Hand. */
612
+ export interface SessionSandboxRequest {
613
+ readonly compute?: SessionComputeRequest;
614
+ readonly enabled?: boolean;
615
+ readonly network?: SessionNetworkRequest;
616
+ readonly packages?: ReadonlyArray<PackageRequest>;
1047
617
  }
1048
- /** Why a session permanently lost its compute and live files. */
1049
- export type SessionTerminationReason = "user" | "lifetime_expired" | "provider_credential_revoked" | "runtime_lost";
1050
- /** The minimal marker left after irreversible deletion. Compute and live files are terminated first; session, message, Brain user-content, observation, telemetry and export payloads are removed. Independent registered workspace files and aggregate billing/audit facts remain. */
618
+ /** Customer-visible session lifecycle, independent of sandbox suspension. */
619
+ export type SessionStatus = "idle" | "running" | "terminating" | "terminated" | "deleting";
620
+ /** Minimal marker after irreversible deletion. */
1051
621
  export interface SessionTombstone {
1052
622
  readonly deletedAt: string;
1053
623
  readonly id: Id<"session">;
1054
- readonly operationId: Id<"operation">;
1055
- readonly workspaceId: Id<"workspace">;
1056
- }
1057
- /** One immutable issued statement. The platform never rerenders history. */
1058
- export interface Statement {
1059
- readonly artifactHash: string;
1060
- readonly currency: Currency;
1061
- readonly id: Id<"statement">;
1062
- readonly issuedAt: string;
1063
- readonly lines: ReadonlyArray<StatementLine>;
1064
- readonly organizationId: Id<"organization">;
1065
- readonly period: TimeRange;
1066
- readonly totalCents: string;
1067
- }
1068
- /** One priced category line. Lines sum exactly to the statement total. */
1069
- export interface StatementLine {
1070
- readonly category: UsageCategory;
1071
- readonly totalCents: string;
1072
- }
1073
- /** The header of one immutable issued statement. */
1074
- export interface StatementSummary {
1075
- readonly artifactHash: string;
1076
- readonly currency: Currency;
1077
- readonly id: Id<"statement">;
1078
- readonly issuedAt: string;
1079
- readonly organizationId: Id<"organization">;
1080
- readonly period: TimeRange;
1081
- readonly totalCents: string;
1082
- }
1083
- /** One page of statement headers, newest first. */
1084
- export interface StatementSummaryPage {
1085
- readonly items: ReadonlyArray<StatementSummary>;
1086
- readonly nextCursor?: string;
1087
- }
1088
- /** The AEX receipt returned alongside the standard OTLP response. */
1089
- export interface TelemetryAdmissionReceipt {
1090
- readonly accepted: string;
1091
- readonly acceptedAt: string;
1092
- readonly batchId: Id<"telemetry_batch">;
1093
- readonly bytes: string;
1094
- readonly rejected: string;
1095
624
  }
1096
- /** One telemetry export record. Session exports remain workspace-owned. */
1097
- export interface TelemetryExport {
1098
- readonly completeness: ExportCompleteness;
1099
- readonly createdAt: string;
1100
- readonly expiresAt?: string;
1101
- readonly format: ExportFormat;
1102
- readonly gapIds?: ReadonlyArray<Id<"telemetry_gap">>;
1103
- readonly id: Id<"export">;
1104
- readonly manifestHash?: string;
1105
- readonly readyAt?: string;
1106
- readonly revokedAt?: string;
1107
- readonly sessionId?: Id<"session">;
1108
- readonly sizeBytes?: string;
1109
- readonly status: ExportStatus;
1110
- readonly workspaceId: Id<"workspace">;
1111
- }
1112
- /** Admit a durable telemetry-export operation. */
1113
- export interface TelemetryExportRequest {
1114
- readonly completeness: ExportCompleteness;
1115
- readonly format: ExportFormat;
1116
- readonly query: ExportQuery;
1117
- }
1118
- /** The result of a telemetry-export operation. */
1119
- export interface TelemetryExportResult {
625
+ /** Short-lived signed download for one immutable compressed telemetry export. */
626
+ export interface TelemetryDownloadGrant {
1120
627
  readonly expiresAt: string;
1121
- readonly exportId: Id<"export">;
1122
- readonly format: ExportFormat;
1123
- readonly manifestHash: string;
1124
- }
1125
- /** A recorded hole in the observation series. There is no public repair route. */
1126
- export interface TelemetryGap {
1127
- readonly byteCount?: string;
1128
- readonly detectedAt: string;
628
+ readonly mediaType: string;
629
+ readonly sha256: string;
630
+ readonly sizeBytes: string;
631
+ readonly url: string;
632
+ }
633
+ /** Select a bounded half-open telemetry export. */
634
+ export interface TelemetryDownloadRequest {
1129
635
  readonly fromSequence?: string;
1130
- readonly id: Id<"telemetry_gap">;
1131
- readonly observationCount?: string;
1132
- readonly reason: TelemetryGapReason;
1133
- readonly recoverable: boolean;
1134
- readonly repairSource?: string;
1135
- readonly repairedAt?: string;
1136
- readonly revision: number;
1137
- readonly sessionId?: Id<"session">;
1138
- readonly signals: ReadonlyArray<ObservationSignal>;
1139
- readonly timeRange?: TimeRange;
1140
636
  readonly toSequence?: string;
1141
- readonly workspaceId: Id<"workspace">;
1142
- }
1143
- /** One page of recorded gaps. */
1144
- export interface TelemetryGapPage {
1145
- readonly items: ReadonlyArray<TelemetryGap>;
1146
- readonly nextCursor?: string;
1147
637
  }
1148
- /** A bounded query over recorded gaps. */
1149
- export interface TelemetryGapQuery {
1150
- readonly cursor?: string;
1151
- readonly limit?: number;
1152
- readonly recoverable?: boolean;
1153
- readonly signals?: ReadonlyArray<ObservationSignal>;
1154
- readonly timeRange: TimeRange;
638
+ /** One bounded normalized telemetry frame transmitted live and persisted in compressed S3 segments. */
639
+ export interface TelemetryFrame {
640
+ readonly body?: JsonValue;
641
+ readonly kind: TelemetryKind;
642
+ readonly occurredAt: string;
643
+ readonly preview?: string;
644
+ readonly sequence: string;
645
+ readonly spanId?: string;
646
+ readonly traceId?: string;
647
+ readonly truncated: boolean;
1155
648
  }
1156
- /** Why a gap exists. */
1157
- export type TelemetryGapReason = "admission_rejected" | "spool_lost" | "producer_dropped" | "replay_expired" | "authority_unavailable";
649
+ /** Trusted live and retained session signals. */
650
+ export type TelemetryKind = "assistant" | "tool" | "runtime" | "log" | "span" | "usage" | "gap" | "heartbeat";
1158
651
  /** A half-open instant range, `gte` inclusive and `lt` exclusive. */
1159
652
  export interface TimeRange {
1160
653
  readonly gte: string;
1161
654
  readonly lt: string;
1162
655
  }
1163
- /** Create a hosted top-up checkout. */
656
+ /** Request a one-time Stripe-hosted prepaid top-up. */
1164
657
  export interface TopUpCheckoutRequest {
1165
658
  readonly amountCents: string;
1166
659
  readonly cancelUrl?: string;
1167
660
  readonly successUrl?: string;
1168
661
  }
1169
- /** One assembled trace and the observations it was assembled from. */
1170
- export interface TraceDetail {
1171
- readonly coverage: ObservationCoverage;
1172
- readonly spans: ReadonlyArray<Observation>;
1173
- readonly summary: TraceSummary;
1174
- }
1175
- /** The header of one assembled trace. */
1176
- export interface TraceSummary {
1177
- readonly endedAt: string;
1178
- readonly rootName: string;
1179
- readonly spanCount: string;
1180
- readonly startedAt: string;
1181
- readonly traceId: string;
1182
- readonly workspaceId?: Id<"workspace">;
1183
- }
1184
662
  /** One staged multipart upload. Uploads are transport plumbing, not assets. */
1185
663
  export interface Upload {
1186
664
  readonly contentType: string;
@@ -1193,13 +671,20 @@ export interface Upload {
1193
671
  readonly sizeBytes: string;
1194
672
  readonly state: UploadState;
1195
673
  }
674
+ /** One pending current-file overwrite and every bounded part grant needed to upload it; no extra public grant route exists. */
675
+ export interface UploadAdmission {
676
+ readonly grants: ReadonlyArray<UploadPartGrant>;
677
+ readonly upload: Upload;
678
+ }
1196
679
  /** Complete a staged upload. */
1197
680
  export interface UploadCompleteRequest {
1198
681
  readonly parts: ReadonlyArray<UploadPart>;
1199
682
  }
1200
- /** Stage a large registered-resource value. */
683
+ /** Stage a large current workspace-file replacement. */
1201
684
  export interface UploadCreateRequest {
1202
685
  readonly contentType: string;
686
+ readonly name: string;
687
+ readonly parts: ReadonlyArray<UploadPartRequest>;
1203
688
  readonly sha256: string;
1204
689
  readonly sizeBytes: string;
1205
690
  }
@@ -1215,21 +700,12 @@ export interface UploadPartGrant {
1215
700
  readonly partNumber: number;
1216
701
  readonly url: string;
1217
702
  }
1218
- /** The presigned grants for the requested parts. */
1219
- export interface UploadPartGrants {
1220
- readonly grants: ReadonlyArray<UploadPartGrant>;
1221
- readonly uploadId: Id<"upload">;
1222
- }
1223
703
  /** 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. */
1224
704
  export interface UploadPartRequest {
1225
705
  readonly partNumber: number;
1226
706
  readonly sha256: string;
1227
707
  readonly sizeBytes: string;
1228
708
  }
1229
- /** Mint presigned PUT grants for the named parts. At most 1000 parts per call against the 10000-part ceiling, so a maximal upload needs at least ten calls. */
1230
- export interface UploadPartsRequest {
1231
- readonly parts: ReadonlyArray<UploadPartRequest>;
1232
- }
1233
709
  /** Where a staged upload is in its lifecycle. */
1234
710
  export type UploadState = "staging" | "ready";
1235
711
  /** One resource aggregate, discriminated by category. */
@@ -1342,51 +818,27 @@ export interface UsageStorageAggregate {
1342
818
  readonly byteMinutes: string;
1343
819
  readonly settlement: UsageSettlement;
1344
820
  }
1345
- /** A region-pinned execution and content boundary. */
821
+ /** The account's fixed eu-west-1 execution and content boundary. */
1346
822
  export interface Workspace {
1347
823
  readonly apiUrl: string;
1348
824
  readonly createdAt: string;
1349
- readonly deletionOperationId?: Id<"operation">;
1350
825
  readonly id: Id<"workspace">;
1351
826
  readonly name: string;
1352
827
  readonly operationalState: WorkspaceOperationalState;
1353
- readonly organizationId: Id<"organization">;
1354
828
  readonly region: "us-east-1" | "us-east-2" | "us-west-2" | "ap-northeast-1" | "eu-west-1";
1355
- readonly slug: string;
1356
- readonly status: WorkspaceStatus;
1357
829
  }
1358
830
  /** Which retained session generation answered a live workspace call. */
1359
831
  export interface WorkspaceAccess {
1360
832
  readonly generationId: Id<"generation">;
1361
833
  readonly resumed: boolean;
1362
834
  }
1363
- /** Create a region-pinned workspace. Region is required and immutable. */
1364
- export interface WorkspaceCreateRequest {
835
+ /** Resolve one current workspace-file name to a private immutable hash and mount path at admission. */
836
+ export interface WorkspaceFileMount {
1365
837
  readonly name: string;
1366
- readonly organizationId: Id<"organization">;
1367
- readonly region: "us-east-1" | "us-east-2" | "us-west-2" | "ap-northeast-1" | "eu-west-1";
1368
- }
1369
- /** Admit the global workspace-deletion operation. */
1370
- export interface WorkspaceDeleteRequest {
1371
- readonly confirmation: Id<"workspace">;
838
+ readonly path: string;
1372
839
  }
1373
- /** The workspace view of the account operational state it inherits. */
840
+ /** The fixed workspace's inherited personal-account state. */
1374
841
  export interface WorkspaceOperationalState {
1375
- readonly inheritedFrom: OperationalStateSource;
1376
- readonly organizationId: Id<"organization">;
842
+ readonly accountId: Id<"account">;
1377
843
  readonly state: AccountOperationalState;
1378
844
  }
1379
- /** One page of workspaces. */
1380
- export interface WorkspacePage {
1381
- readonly items: ReadonlyArray<Workspace>;
1382
- readonly nextCursor?: string;
1383
- }
1384
- /** Whether a workspace admits work. */
1385
- export type WorkspaceStatus = "active" | "deleting";
1386
- /** What remains of a deleted workspace. */
1387
- export interface WorkspaceTombstone {
1388
- readonly deletedAt: string;
1389
- readonly operationId: Id<"operation">;
1390
- readonly organizationId: Id<"organization">;
1391
- readonly workspaceId: Id<"workspace">;
1392
- }