@aexhq/sdk 0.50.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -22
- package/dist/client/aex.js +15 -5
- package/dist/client/aex.js.map +1 -1
- package/dist/downloads/download.d.ts +2 -9
- package/dist/downloads/download.js +19 -5
- package/dist/downloads/download.js.map +1 -1
- package/dist/generated/errors.js +2 -1
- package/dist/generated/errors.js.map +1 -1
- package/dist/generated/models.d.ts +1392 -0
- package/dist/generated/models.js +62 -0
- package/dist/generated/models.js.map +1 -0
- package/dist/generated/resources.d.ts +394 -414
- package/dist/generated/resources.js +96 -120
- package/dist/generated/resources.js.map +1 -1
- package/dist/generated/routes.d.ts +5 -3
- package/dist/generated/routes.js +247 -443
- package/dist/generated/routes.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/node/session-file-limits.d.ts +4 -0
- package/dist/node/session-file-limits.js +7 -0
- package/dist/node/session-file-limits.js.map +1 -0
- package/dist/node/session-files.d.ts +80 -0
- package/dist/node/session-files.js +254 -0
- package/dist/node/session-files.js.map +1 -0
- package/dist/transport/transport.js +6 -1
- package/dist/transport/transport.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,1392 @@
|
|
|
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 organization: "org";
|
|
10
|
+
readonly membership: "mem";
|
|
11
|
+
readonly invitation: "inv";
|
|
12
|
+
readonly workspace: "wsp";
|
|
13
|
+
readonly api_key: "key";
|
|
14
|
+
readonly provider_credential: "pcr";
|
|
15
|
+
readonly session: "ses";
|
|
16
|
+
readonly message: "msg";
|
|
17
|
+
readonly agent: "agt";
|
|
18
|
+
readonly tool_call: "tcl";
|
|
19
|
+
readonly operation: "op";
|
|
20
|
+
readonly approval: "apr";
|
|
21
|
+
readonly generation: "gen";
|
|
22
|
+
readonly file_upload: "ful";
|
|
23
|
+
readonly file_download: "fdl";
|
|
24
|
+
readonly observation: "obs";
|
|
25
|
+
readonly telemetry_batch: "bch";
|
|
26
|
+
readonly telemetry_gap: "gap";
|
|
27
|
+
readonly export: "exp";
|
|
28
|
+
readonly upload: "upl";
|
|
29
|
+
readonly measurement: "msr";
|
|
30
|
+
readonly statement: "stm";
|
|
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" | "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")[];
|
|
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 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. */
|
|
55
|
+
export type AccountPauseReason = "top_up_required" | "payment_hold" | "dispute_hold" | "account_closed";
|
|
56
|
+
/** A paused account and what it takes to restore it. */
|
|
57
|
+
export interface AccountPausedState {
|
|
58
|
+
readonly changedAt: string;
|
|
59
|
+
readonly deletionScheduledAt?: string;
|
|
60
|
+
readonly minimumRestoreCents?: string;
|
|
61
|
+
readonly reason: AccountPauseReason;
|
|
62
|
+
readonly retentionFundedUntil?: string;
|
|
63
|
+
readonly revision: number;
|
|
64
|
+
}
|
|
65
|
+
/** The one error envelope every failing request returns. */
|
|
66
|
+
export interface ApiError {
|
|
67
|
+
readonly error: ApiErrorBody;
|
|
68
|
+
}
|
|
69
|
+
/** The failure itself. */
|
|
70
|
+
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" | "unqualified_provider_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";
|
|
72
|
+
readonly details?: ErrorDetails;
|
|
73
|
+
readonly message: string;
|
|
74
|
+
readonly operationId?: Id<"operation">;
|
|
75
|
+
readonly requestId: string;
|
|
76
|
+
readonly retryable: boolean;
|
|
77
|
+
}
|
|
78
|
+
/** Workspace API key metadata. There is no public last-used timestamp. */
|
|
79
|
+
export interface ApiKey {
|
|
80
|
+
readonly createdAt: string;
|
|
81
|
+
readonly id: Id<"api_key">;
|
|
82
|
+
readonly name: string;
|
|
83
|
+
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">;
|
|
85
|
+
readonly workspaceId: Id<"workspace">;
|
|
86
|
+
}
|
|
87
|
+
/** Mint a workspace API key. */
|
|
88
|
+
export interface ApiKeyCreateRequest {
|
|
89
|
+
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">;
|
|
91
|
+
readonly workspaceId: Id<"workspace">;
|
|
92
|
+
}
|
|
93
|
+
/** One page of API key metadata. */
|
|
94
|
+
export interface ApiKeyPage {
|
|
95
|
+
readonly items: ReadonlyArray<ApiKey>;
|
|
96
|
+
readonly nextCursor?: string;
|
|
97
|
+
}
|
|
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. */
|
|
114
|
+
export interface BillingBalance {
|
|
115
|
+
readonly availableCents: string;
|
|
116
|
+
readonly currency: Currency;
|
|
117
|
+
readonly operationalState: AccountOperationalState;
|
|
118
|
+
readonly organizationId: Id<"organization">;
|
|
119
|
+
readonly pendingCents: string;
|
|
120
|
+
readonly reservedCents: string;
|
|
121
|
+
readonly revision: number;
|
|
122
|
+
readonly updatedAt: string;
|
|
123
|
+
}
|
|
124
|
+
/** How inline blob bytes are encoded. */
|
|
125
|
+
export type BlobEncoding = "utf8" | "base64";
|
|
126
|
+
/** A small value carried in the request. */
|
|
127
|
+
export interface BlobInline {
|
|
128
|
+
readonly data: string;
|
|
129
|
+
readonly encoding: BlobEncoding;
|
|
130
|
+
readonly sha256: string;
|
|
131
|
+
}
|
|
132
|
+
/** Where a registered value's bytes come from. */
|
|
133
|
+
export type BlobInput = (BlobInline & {
|
|
134
|
+
readonly type: "inline";
|
|
135
|
+
}) | (BlobUpload & {
|
|
136
|
+
readonly type: "upload";
|
|
137
|
+
});
|
|
138
|
+
/** A large value staged through the upload surface. */
|
|
139
|
+
export interface BlobUpload {
|
|
140
|
+
readonly sha256: string;
|
|
141
|
+
readonly sizeBytes: string;
|
|
142
|
+
readonly uploadId: Id<"upload">;
|
|
143
|
+
}
|
|
144
|
+
/** An explicit inclusive byte range over an immutable object. */
|
|
145
|
+
export interface ByteRange {
|
|
146
|
+
readonly endInclusive: string;
|
|
147
|
+
readonly start: string;
|
|
148
|
+
}
|
|
149
|
+
/** One resolved compute dimension. */
|
|
150
|
+
export interface ComputeShape {
|
|
151
|
+
readonly memoryMiB: number;
|
|
152
|
+
readonly vcpus: number;
|
|
153
|
+
}
|
|
154
|
+
/** A reference to a stored payload. The bytes are never published in a registry response; they are reached through a download grant. */
|
|
155
|
+
export interface ContentRef {
|
|
156
|
+
readonly sha256: string;
|
|
157
|
+
readonly sizeBytes: string;
|
|
158
|
+
}
|
|
159
|
+
/** The only supported currency. */
|
|
160
|
+
export type Currency = "USD";
|
|
161
|
+
/** The one bounded read that fills the dashboard shell. */
|
|
162
|
+
export interface DashboardBootstrap {
|
|
163
|
+
readonly accounts: ReadonlyArray<OrganizationAccount>;
|
|
164
|
+
readonly email: string;
|
|
165
|
+
readonly generatedAt: string;
|
|
166
|
+
readonly organizations: ReadonlyArray<Organization>;
|
|
167
|
+
readonly userId: Id<"user">;
|
|
168
|
+
readonly workspaces: ReadonlyArray<Workspace>;
|
|
169
|
+
}
|
|
170
|
+
/** A minted browser session, returned exactly once. */
|
|
171
|
+
export interface DashboardSessionCredential {
|
|
172
|
+
readonly expiresAt: string;
|
|
173
|
+
readonly session: string;
|
|
174
|
+
readonly userId: Id<"user">;
|
|
175
|
+
}
|
|
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. */
|
|
177
|
+
export interface DashboardSessionRequest {
|
|
178
|
+
readonly code: string;
|
|
179
|
+
readonly codeVerifier: string;
|
|
180
|
+
readonly provider: IdentityProvider;
|
|
181
|
+
readonly state: string;
|
|
182
|
+
}
|
|
183
|
+
/** A session whose irreversible deletion is running; rendered at 410. */
|
|
184
|
+
export interface DeletingSession {
|
|
185
|
+
readonly id: Id<"session">;
|
|
186
|
+
readonly operationId: Id<"operation">;
|
|
187
|
+
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
|
+
}
|
|
228
|
+
/** A short-lived signed grant for exactly one object and range. */
|
|
229
|
+
export interface DownloadGrant {
|
|
230
|
+
readonly authorizedBytes: string;
|
|
231
|
+
readonly expiresAt: string;
|
|
232
|
+
readonly measurementId: Id<"measurement">;
|
|
233
|
+
readonly range?: ByteRange;
|
|
234
|
+
readonly sha256: string;
|
|
235
|
+
readonly sizeBytes: string;
|
|
236
|
+
readonly url: string;
|
|
237
|
+
}
|
|
238
|
+
/** One effective workspace safety limit. There is no public mutation route. */
|
|
239
|
+
export interface EffectiveWorkspaceLimit {
|
|
240
|
+
readonly changedAt: string;
|
|
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";
|
|
243
|
+
readonly revision: number;
|
|
244
|
+
readonly source: LimitSource;
|
|
245
|
+
}
|
|
246
|
+
/** One page of effective workspace limits. */
|
|
247
|
+
export interface EffectiveWorkspaceLimitPage {
|
|
248
|
+
readonly items: ReadonlyArray<EffectiveWorkspaceLimit>;
|
|
249
|
+
readonly nextCursor?: string;
|
|
250
|
+
}
|
|
251
|
+
/** A body that carries no fields; still strict, so an extra member is rejected. */
|
|
252
|
+
export type EmptyRequest = Readonly<Record<string, never>>;
|
|
253
|
+
/** Closed, typed remediation detail; never an untyped bag. */
|
|
254
|
+
export type ErrorDetails = (ErrorDetailsRequiredScope & {
|
|
255
|
+
readonly type: "required_scope";
|
|
256
|
+
}) | (ErrorDetailsLimit & {
|
|
257
|
+
readonly type: "limit";
|
|
258
|
+
}) | (ErrorDetailsQuota & {
|
|
259
|
+
readonly type: "quota";
|
|
260
|
+
}) | (ErrorDetailsRegion & {
|
|
261
|
+
readonly type: "region";
|
|
262
|
+
}) | (ErrorDetailsRetry & {
|
|
263
|
+
readonly type: "retry";
|
|
264
|
+
}) | (ErrorDetailsOperation & {
|
|
265
|
+
readonly type: "operation";
|
|
266
|
+
}) | (ErrorDetailsValidation & {
|
|
267
|
+
readonly type: "validation";
|
|
268
|
+
}) | (ErrorDetailsGap & {
|
|
269
|
+
readonly type: "gap";
|
|
270
|
+
});
|
|
271
|
+
/** The telemetry gaps that blocked a completeness requirement. */
|
|
272
|
+
export interface ErrorDetailsGap {
|
|
273
|
+
readonly gapIds: ReadonlyArray<Id<"telemetry_gap">>;
|
|
274
|
+
}
|
|
275
|
+
/** The effective limit that was exceeded. */
|
|
276
|
+
export interface ErrorDetailsLimit {
|
|
277
|
+
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";
|
|
279
|
+
readonly measured: string;
|
|
280
|
+
}
|
|
281
|
+
/** The original operation the replay resolved to. */
|
|
282
|
+
export interface ErrorDetailsOperation {
|
|
283
|
+
readonly operationId: Id<"operation">;
|
|
284
|
+
}
|
|
285
|
+
/** The quota dimension that was exhausted. */
|
|
286
|
+
export interface ErrorDetailsQuota {
|
|
287
|
+
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";
|
|
289
|
+
readonly used: string;
|
|
290
|
+
}
|
|
291
|
+
/** The authoritative placement of the workspace. */
|
|
292
|
+
export interface ErrorDetailsRegion {
|
|
293
|
+
readonly apiUrl: string;
|
|
294
|
+
readonly expected: "us-east-1" | "us-east-2" | "us-west-2" | "ap-northeast-1" | "eu-west-1";
|
|
295
|
+
}
|
|
296
|
+
/** The scope the credential lacks. */
|
|
297
|
+
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";
|
|
299
|
+
}
|
|
300
|
+
/** How long to wait before retrying. */
|
|
301
|
+
export interface ErrorDetailsRetry {
|
|
302
|
+
readonly retryAfterMs: number;
|
|
303
|
+
}
|
|
304
|
+
/** Exactly where the body failed validation. */
|
|
305
|
+
export interface ErrorDetailsValidation {
|
|
306
|
+
readonly pointer: string;
|
|
307
|
+
readonly reason: string;
|
|
308
|
+
}
|
|
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. */
|
|
349
|
+
export interface HandsNetworkRequest {
|
|
350
|
+
readonly mode: NetworkMode;
|
|
351
|
+
}
|
|
352
|
+
/** A short-lived hosted provider page. */
|
|
353
|
+
export interface HostedSession {
|
|
354
|
+
readonly expiresAt: string;
|
|
355
|
+
readonly url: string;
|
|
356
|
+
}
|
|
357
|
+
/** One request header a signed grant requires the caller to send verbatim. */
|
|
358
|
+
export interface HttpHeader {
|
|
359
|
+
readonly name: string;
|
|
360
|
+
readonly value: string;
|
|
361
|
+
}
|
|
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
|
+
/** A limit whose effective value is a map of named dimensions. */
|
|
389
|
+
export interface LimitMapValue {
|
|
390
|
+
readonly values: Readonly<Record<string, string>>;
|
|
391
|
+
}
|
|
392
|
+
/** A single non-negative integer limit. */
|
|
393
|
+
export interface LimitScalarValue {
|
|
394
|
+
readonly value: string;
|
|
395
|
+
}
|
|
396
|
+
/** Where an effective limit value came from. */
|
|
397
|
+
export type LimitSource = "default" | "workspace_override";
|
|
398
|
+
/** The effective value of a limit, discriminated by shape. */
|
|
399
|
+
export type LimitValue = (LimitScalarValue & {
|
|
400
|
+
readonly shape: "scalar";
|
|
401
|
+
}) | (LimitMapValue & {
|
|
402
|
+
readonly shape: "map";
|
|
403
|
+
});
|
|
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;
|
|
510
|
+
}
|
|
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. */
|
|
514
|
+
export interface Message {
|
|
515
|
+
readonly content: ReadonlyArray<MessagePart>;
|
|
516
|
+
readonly createdAt: string;
|
|
517
|
+
readonly id: Id<"message">;
|
|
518
|
+
readonly role: MessageRole;
|
|
519
|
+
readonly sessionId: Id<"session">;
|
|
520
|
+
}
|
|
521
|
+
/** One page of complete sealed messages, ordered by the immutable seal-visibility tuple `(sealedAt, messageId)`. Open partial messages are never visible. */
|
|
522
|
+
export interface MessagePage {
|
|
523
|
+
readonly items: ReadonlyArray<Message>;
|
|
524
|
+
readonly nextCursor?: string;
|
|
525
|
+
}
|
|
526
|
+
/** One part of a complete message. Admission is text-only; assistant and tool messages may contain canonical built-in tool records. */
|
|
527
|
+
export type MessagePart = (MessagePartText & {
|
|
528
|
+
readonly type: "text";
|
|
529
|
+
}) | (MessagePartToolCall & {
|
|
530
|
+
readonly type: "tool_call";
|
|
531
|
+
}) | (MessagePartToolResult & {
|
|
532
|
+
readonly type: "tool_result";
|
|
533
|
+
});
|
|
534
|
+
/** A text part. */
|
|
535
|
+
export interface MessagePartText {
|
|
536
|
+
readonly text: string;
|
|
537
|
+
}
|
|
538
|
+
/** A built-in tool call emitted by the model. */
|
|
539
|
+
export interface MessagePartToolCall {
|
|
540
|
+
readonly argumentsDigest: string;
|
|
541
|
+
readonly id: Id<"tool_call">;
|
|
542
|
+
}
|
|
543
|
+
/** The canonical result of a built-in tool call. */
|
|
544
|
+
export interface MessagePartToolResult {
|
|
545
|
+
readonly id: Id<"tool_call">;
|
|
546
|
+
readonly resultDigest: string;
|
|
547
|
+
}
|
|
548
|
+
/** Who produced a message. */
|
|
549
|
+
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. */
|
|
551
|
+
export interface MessageSendRequest {
|
|
552
|
+
readonly deadline?: string;
|
|
553
|
+
readonly maxSpendCents?: string;
|
|
554
|
+
readonly text: string;
|
|
555
|
+
}
|
|
556
|
+
/** The admitted user message and the session now processing it. */
|
|
557
|
+
export interface MessageSendResult {
|
|
558
|
+
readonly message: Message;
|
|
559
|
+
readonly session: Session;
|
|
560
|
+
}
|
|
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;
|
|
589
|
+
}
|
|
590
|
+
/** An explicit provider and model pair; a model-only override is rejected. */
|
|
591
|
+
export interface ModelSelection {
|
|
592
|
+
readonly credentialId?: Id<"provider_credential">;
|
|
593
|
+
readonly model: string;
|
|
594
|
+
readonly provider: ProviderId;
|
|
595
|
+
}
|
|
596
|
+
/** What the guest may reach. */
|
|
597
|
+
export type NetworkMode = "none" | "public_internet";
|
|
598
|
+
/** A freshly minted key. The value never appears in a later read. */
|
|
599
|
+
export interface NewApiKey {
|
|
600
|
+
readonly createdAt: string;
|
|
601
|
+
readonly id: Id<"api_key">;
|
|
602
|
+
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">;
|
|
604
|
+
readonly value: string;
|
|
605
|
+
readonly workspaceId: Id<"workspace">;
|
|
606
|
+
}
|
|
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" | "unqualified_provider_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. */
|
|
836
|
+
export type PackageEcosystem = "apt" | "pip" | "npm";
|
|
837
|
+
/** One exactly-pinned package to pre-install. */
|
|
838
|
+
export interface PackageRequest {
|
|
839
|
+
readonly ecosystem: PackageEcosystem;
|
|
840
|
+
readonly name: string;
|
|
841
|
+
readonly version: string;
|
|
842
|
+
}
|
|
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 {
|
|
849
|
+
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;
|
|
869
|
+
}
|
|
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";
|
|
874
|
+
/** A registered file entry, complete. */
|
|
875
|
+
export interface RegisteredFile {
|
|
876
|
+
readonly createdAt: string;
|
|
877
|
+
readonly name: string;
|
|
878
|
+
readonly revision: number;
|
|
879
|
+
readonly sha256: string;
|
|
880
|
+
readonly sizeBytes: string;
|
|
881
|
+
readonly state: RegisteredState;
|
|
882
|
+
readonly updatedAt: string;
|
|
883
|
+
readonly value: RegisteredFileRead;
|
|
884
|
+
}
|
|
885
|
+
/** The two permitted registered-file modes. */
|
|
886
|
+
export type RegisteredFileMode = "0644" | "0755";
|
|
887
|
+
/** One page of registered files. */
|
|
888
|
+
export interface RegisteredFilePage {
|
|
889
|
+
readonly items: ReadonlyArray<RegisteredFileRow>;
|
|
890
|
+
readonly nextCursor?: string;
|
|
891
|
+
}
|
|
892
|
+
/** What a registered file is, as published. The payload bytes are referenced, never inlined; fetch them with a download grant. */
|
|
893
|
+
export interface RegisteredFileRead {
|
|
894
|
+
readonly content: ContentRef;
|
|
895
|
+
readonly mediaType: string;
|
|
896
|
+
readonly mode: RegisteredFileMode;
|
|
897
|
+
readonly mountPath: string;
|
|
898
|
+
}
|
|
899
|
+
/** One registered file as a collection row. A listing carries no value document; read the entry itself to get one. */
|
|
900
|
+
export interface RegisteredFileRow {
|
|
901
|
+
readonly createdAt: string;
|
|
902
|
+
readonly name: string;
|
|
903
|
+
readonly revision: number;
|
|
904
|
+
readonly sha256: string;
|
|
905
|
+
readonly sizeBytes: string;
|
|
906
|
+
readonly state: RegisteredState;
|
|
907
|
+
readonly updatedAt: string;
|
|
908
|
+
}
|
|
909
|
+
/** A registered file. */
|
|
910
|
+
export interface RegisteredFileValue {
|
|
911
|
+
readonly content: BlobInput;
|
|
912
|
+
readonly mediaType: string;
|
|
913
|
+
readonly mode: RegisteredFileMode;
|
|
914
|
+
readonly mountPath: string;
|
|
915
|
+
}
|
|
916
|
+
/** The only state a registered entry has; there is no version history. */
|
|
917
|
+
export type RegisteredState = "current";
|
|
918
|
+
/** Mint a download grant for a registered file. */
|
|
919
|
+
export interface RegistryDownloadRequest {
|
|
920
|
+
readonly range?: ByteRange;
|
|
921
|
+
}
|
|
922
|
+
/** The complete provider-derived capacity of the selected shape. */
|
|
923
|
+
export interface ResolvedCompute {
|
|
924
|
+
readonly baseline: ComputeShape;
|
|
925
|
+
readonly endpointBandwidthMBps: number;
|
|
926
|
+
readonly maxConcurrentConnections: number;
|
|
927
|
+
readonly maxDiskGiB: number;
|
|
928
|
+
readonly peak: ComputeShape;
|
|
929
|
+
readonly size: "512mb" | "1gb" | "2gb" | "4gb" | "8gb";
|
|
930
|
+
}
|
|
931
|
+
/** Everything the platform resolved for this session. */
|
|
932
|
+
export interface ResolvedConfig {
|
|
933
|
+
readonly catalogRevision: string;
|
|
934
|
+
readonly compute: ResolvedCompute;
|
|
935
|
+
readonly lifecycle: SessionLifecyclePolicy;
|
|
936
|
+
readonly model: string;
|
|
937
|
+
readonly network: ResolvedNetwork;
|
|
938
|
+
readonly packages: ReadonlyArray<PackageRequest>;
|
|
939
|
+
readonly provider: ProviderId;
|
|
940
|
+
readonly providerCredentialId: Id<"provider_credential">;
|
|
941
|
+
readonly registered: SessionRegisteredSelection;
|
|
942
|
+
}
|
|
943
|
+
/** The resolved guest network policy. */
|
|
944
|
+
export interface ResolvedNetwork {
|
|
945
|
+
readonly hands: HandsNetworkRequest;
|
|
946
|
+
}
|
|
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. */
|
|
950
|
+
export interface Session {
|
|
951
|
+
readonly activeDeadline?: string;
|
|
952
|
+
readonly activeMaxSpendCents?: string;
|
|
953
|
+
readonly activeMessageId?: Id<"message">;
|
|
954
|
+
readonly createdAt: string;
|
|
955
|
+
readonly expiresAt: string;
|
|
956
|
+
readonly id: Id<"session">;
|
|
957
|
+
readonly idleSince?: string;
|
|
958
|
+
readonly launchedAt: string;
|
|
959
|
+
readonly metadata?: Readonly<Record<string, string | number | boolean | null>>;
|
|
960
|
+
readonly resolvedConfig: ResolvedConfig;
|
|
961
|
+
readonly revision: number;
|
|
962
|
+
readonly status: SessionStatus;
|
|
963
|
+
readonly suspendAt?: string;
|
|
964
|
+
readonly suspendedAt?: string;
|
|
965
|
+
readonly terminatedAt?: string;
|
|
966
|
+
readonly terminationReason?: SessionTerminationReason;
|
|
967
|
+
readonly updatedAt: string;
|
|
968
|
+
readonly workspaceId: Id<"workspace">;
|
|
969
|
+
}
|
|
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;
|
|
973
|
+
readonly sessionId: Id<"session">;
|
|
974
|
+
readonly sessionRevision: number;
|
|
975
|
+
}
|
|
976
|
+
/** The only customer compute selector. */
|
|
977
|
+
export interface SessionComputeRequest {
|
|
978
|
+
readonly size?: "512mb" | "1gb" | "2gb" | "4gb" | "8gb";
|
|
979
|
+
}
|
|
980
|
+
/** Create an eight-hour multi-turn session with one explicitly pinned BYOK provider credential. */
|
|
981
|
+
export interface SessionCreateRequest {
|
|
982
|
+
readonly compute?: SessionComputeRequest;
|
|
983
|
+
readonly metadata?: Readonly<Record<string, string | number | boolean | null>>;
|
|
984
|
+
readonly model: string;
|
|
985
|
+
readonly network?: SessionNetworkRequest;
|
|
986
|
+
readonly packages?: ReadonlyArray<PackageRequest>;
|
|
987
|
+
readonly provider: ProviderId;
|
|
988
|
+
readonly providerCredentialId: Id<"provider_credential">;
|
|
989
|
+
readonly registered?: SessionRegisteredSelection;
|
|
990
|
+
}
|
|
991
|
+
/** The immutable automatic lifecycle behavior applied to this session. */
|
|
992
|
+
export interface SessionLifecyclePolicy {
|
|
993
|
+
readonly idleSuspendAfterSeconds: number;
|
|
994
|
+
readonly maximumLifetimeSeconds: number;
|
|
995
|
+
readonly resumeOnLiveFileAccess: boolean;
|
|
996
|
+
readonly resumeOnMessage: boolean;
|
|
997
|
+
}
|
|
998
|
+
/** The collection projection of a session; `resolvedConfig` is omitted. */
|
|
999
|
+
export interface SessionListItem {
|
|
1000
|
+
readonly activeMessageId?: Id<"message">;
|
|
1001
|
+
readonly createdAt: string;
|
|
1002
|
+
readonly expiresAt: string;
|
|
1003
|
+
readonly id: Id<"session">;
|
|
1004
|
+
readonly model: string;
|
|
1005
|
+
readonly provider: ProviderId;
|
|
1006
|
+
readonly revision: number;
|
|
1007
|
+
readonly status: SessionStatus;
|
|
1008
|
+
readonly updatedAt: string;
|
|
1009
|
+
readonly workspaceId: Id<"workspace">;
|
|
1010
|
+
}
|
|
1011
|
+
/** One page of sessions. */
|
|
1012
|
+
export interface SessionListPage {
|
|
1013
|
+
readonly items: ReadonlyArray<SessionListItem>;
|
|
1014
|
+
readonly nextCursor?: string;
|
|
1015
|
+
}
|
|
1016
|
+
/** Network policy for the session. */
|
|
1017
|
+
export interface SessionNetworkRequest {
|
|
1018
|
+
readonly hands: HandsNetworkRequest;
|
|
1019
|
+
}
|
|
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. */
|
|
1021
|
+
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;
|
|
1040
|
+
}
|
|
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;
|
|
1047
|
+
}
|
|
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. */
|
|
1051
|
+
export interface SessionTombstone {
|
|
1052
|
+
readonly deletedAt: string;
|
|
1053
|
+
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
|
+
}
|
|
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 {
|
|
1120
|
+
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;
|
|
1129
|
+
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
|
+
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
|
+
}
|
|
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;
|
|
1155
|
+
}
|
|
1156
|
+
/** Why a gap exists. */
|
|
1157
|
+
export type TelemetryGapReason = "admission_rejected" | "spool_lost" | "producer_dropped" | "replay_expired" | "authority_unavailable";
|
|
1158
|
+
/** A half-open instant range, `gte` inclusive and `lt` exclusive. */
|
|
1159
|
+
export interface TimeRange {
|
|
1160
|
+
readonly gte: string;
|
|
1161
|
+
readonly lt: string;
|
|
1162
|
+
}
|
|
1163
|
+
/** Create a hosted top-up checkout. */
|
|
1164
|
+
export interface TopUpCheckoutRequest {
|
|
1165
|
+
readonly amountCents: string;
|
|
1166
|
+
readonly cancelUrl?: string;
|
|
1167
|
+
readonly successUrl?: string;
|
|
1168
|
+
}
|
|
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
|
+
/** One staged multipart upload. Uploads are transport plumbing, not assets. */
|
|
1185
|
+
export interface Upload {
|
|
1186
|
+
readonly contentType: string;
|
|
1187
|
+
readonly createdAt: string;
|
|
1188
|
+
readonly expiresAt: string;
|
|
1189
|
+
readonly id: Id<"upload">;
|
|
1190
|
+
readonly partCount: number;
|
|
1191
|
+
readonly partSizeBytes: string;
|
|
1192
|
+
readonly sha256: string;
|
|
1193
|
+
readonly sizeBytes: string;
|
|
1194
|
+
readonly state: UploadState;
|
|
1195
|
+
}
|
|
1196
|
+
/** Complete a staged upload. */
|
|
1197
|
+
export interface UploadCompleteRequest {
|
|
1198
|
+
readonly parts: ReadonlyArray<UploadPart>;
|
|
1199
|
+
}
|
|
1200
|
+
/** Stage a large registered-resource value. */
|
|
1201
|
+
export interface UploadCreateRequest {
|
|
1202
|
+
readonly contentType: string;
|
|
1203
|
+
readonly sha256: string;
|
|
1204
|
+
readonly sizeBytes: string;
|
|
1205
|
+
}
|
|
1206
|
+
/** One written part and the entity tag the store returned. */
|
|
1207
|
+
export interface UploadPart {
|
|
1208
|
+
readonly etag: string;
|
|
1209
|
+
readonly partNumber: number;
|
|
1210
|
+
}
|
|
1211
|
+
/** 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. */
|
|
1212
|
+
export interface UploadPartGrant {
|
|
1213
|
+
readonly expiresAt: string;
|
|
1214
|
+
readonly headers: ReadonlyArray<HttpHeader>;
|
|
1215
|
+
readonly partNumber: number;
|
|
1216
|
+
readonly url: string;
|
|
1217
|
+
}
|
|
1218
|
+
/** The presigned grants for the requested parts. */
|
|
1219
|
+
export interface UploadPartGrants {
|
|
1220
|
+
readonly grants: ReadonlyArray<UploadPartGrant>;
|
|
1221
|
+
readonly uploadId: Id<"upload">;
|
|
1222
|
+
}
|
|
1223
|
+
/** 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
|
+
export interface UploadPartRequest {
|
|
1225
|
+
readonly partNumber: number;
|
|
1226
|
+
readonly sha256: string;
|
|
1227
|
+
readonly sizeBytes: string;
|
|
1228
|
+
}
|
|
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
|
+
/** Where a staged upload is in its lifecycle. */
|
|
1234
|
+
export type UploadState = "staging" | "ready";
|
|
1235
|
+
/** One resource aggregate, discriminated by category. */
|
|
1236
|
+
export type UsageAggregate = (UsageStorageAggregate & {
|
|
1237
|
+
readonly category: "storage";
|
|
1238
|
+
}) | (UsageComputeAggregate & {
|
|
1239
|
+
readonly category: "compute";
|
|
1240
|
+
}) | (UsageMemoryAggregate & {
|
|
1241
|
+
readonly category: "memory";
|
|
1242
|
+
}) | (UsageDataTransferAggregate & {
|
|
1243
|
+
readonly category: "data_transfer";
|
|
1244
|
+
});
|
|
1245
|
+
/** What a regional aggregate is attributed to. */
|
|
1246
|
+
export interface UsageAttribution {
|
|
1247
|
+
readonly operationId?: Id<"operation">;
|
|
1248
|
+
readonly region: "us-east-1" | "us-east-2" | "us-west-2" | "ap-northeast-1" | "eu-west-1";
|
|
1249
|
+
readonly serviceTime: TimeRange;
|
|
1250
|
+
readonly sessionId?: Id<"session">;
|
|
1251
|
+
readonly source: string;
|
|
1252
|
+
readonly workspaceId: Id<"workspace">;
|
|
1253
|
+
}
|
|
1254
|
+
/** The three authorities that admit usage facts. There are three rather than
|
|
1255
|
+
four because memory and compute are one contiguous fact sequence behind
|
|
1256
|
+
one authority, so they share one frontier; publishing four frontiers with
|
|
1257
|
+
two of them always identical would claim an independence that does not
|
|
1258
|
+
exist.
|
|
1259
|
+
*/
|
|
1260
|
+
export type UsageAuthority = "storage" | "compute" | "transfer";
|
|
1261
|
+
/** The time grain one usage query answers at. All bucketing is UTC and there
|
|
1262
|
+
is no timezone parameter; a range must be aligned to whole buckets of the
|
|
1263
|
+
requested grain and a misaligned range is refused rather than widened to
|
|
1264
|
+
the enclosing buckets.
|
|
1265
|
+
*/
|
|
1266
|
+
export type UsageBucket = "hour" | "day" | "total";
|
|
1267
|
+
/** The four priced categories. */
|
|
1268
|
+
export type UsageCategory = "storage" | "compute" | "memory" | "data_transfer";
|
|
1269
|
+
/** Millicpu-milliseconds of guest compute. */
|
|
1270
|
+
export interface UsageComputeAggregate {
|
|
1271
|
+
readonly attribution: UsageAttribution;
|
|
1272
|
+
readonly millicpuMilliseconds: string;
|
|
1273
|
+
readonly settlement: UsageSettlement;
|
|
1274
|
+
}
|
|
1275
|
+
/** Measured outbound bytes. */
|
|
1276
|
+
export interface UsageDataTransferAggregate {
|
|
1277
|
+
readonly attribution: UsageAttribution;
|
|
1278
|
+
readonly egressBytes: string;
|
|
1279
|
+
readonly settlement: UsageSettlement;
|
|
1280
|
+
}
|
|
1281
|
+
/** How far the pipeline has advanced for one workspace and authority. The
|
|
1282
|
+
answer is exact at or below `completeThrough` and contains nothing above
|
|
1283
|
+
`includesThrough`; between the two it is partial, and saying so is the
|
|
1284
|
+
point. Both are monotone across repeated queries.
|
|
1285
|
+
*/
|
|
1286
|
+
export interface UsageFrontier {
|
|
1287
|
+
readonly acceptedSequence: string;
|
|
1288
|
+
readonly category: UsageAuthority;
|
|
1289
|
+
readonly completeThrough: string;
|
|
1290
|
+
readonly includesThrough: string;
|
|
1291
|
+
readonly projectedSequence: string;
|
|
1292
|
+
readonly publishedSequence: string;
|
|
1293
|
+
readonly region: "us-east-1" | "us-east-2" | "us-west-2" | "ap-northeast-1" | "eu-west-1";
|
|
1294
|
+
readonly serviceThrough?: string;
|
|
1295
|
+
readonly settledSequence: string;
|
|
1296
|
+
readonly stallReason?: string;
|
|
1297
|
+
readonly stalledAt?: string;
|
|
1298
|
+
readonly state: UsageFrontierState;
|
|
1299
|
+
readonly workspaceId: Id<"workspace">;
|
|
1300
|
+
}
|
|
1301
|
+
/** Whether a fold is advancing or parked. */
|
|
1302
|
+
export type UsageFrontierState = "advancing" | "stalled";
|
|
1303
|
+
/** The axes a usage query may group by. Session, run and operation are
|
|
1304
|
+
deliberately absent: every stored aggregate row is keyed by a hash of a
|
|
1305
|
+
seven-member dimension tuple that includes the session, so grouping by one
|
|
1306
|
+
of them would read hundreds of thousands of rows for a single monthly
|
|
1307
|
+
total. "How much did session X cost?" is not answerable by any route in
|
|
1308
|
+
v1, and publishing an axis that is always refused would be a false
|
|
1309
|
+
capability.
|
|
1310
|
+
*/
|
|
1311
|
+
export type UsageGrouping = "category" | "region" | "workspace";
|
|
1312
|
+
/** Byte-milliseconds of guest memory. */
|
|
1313
|
+
export interface UsageMemoryAggregate {
|
|
1314
|
+
readonly attribution: UsageAttribution;
|
|
1315
|
+
readonly byteMilliseconds: string;
|
|
1316
|
+
readonly settlement: UsageSettlement;
|
|
1317
|
+
}
|
|
1318
|
+
/** One page of usage quantities plus the frontiers that bound its completeness. Monetary statements remain a central finance read. */
|
|
1319
|
+
export interface UsagePage {
|
|
1320
|
+
readonly frontiers: ReadonlyArray<UsageFrontier>;
|
|
1321
|
+
readonly items: ReadonlyArray<UsageAggregate>;
|
|
1322
|
+
readonly nextCursor?: string;
|
|
1323
|
+
}
|
|
1324
|
+
/** A bounded query over authoritative regional usage quantities. */
|
|
1325
|
+
export interface UsageQuery {
|
|
1326
|
+
readonly bucket: UsageBucket;
|
|
1327
|
+
readonly categories?: ReadonlyArray<UsageCategory>;
|
|
1328
|
+
readonly cursor?: string;
|
|
1329
|
+
readonly groupBy?: ReadonlyArray<UsageGrouping>;
|
|
1330
|
+
readonly limit?: number;
|
|
1331
|
+
readonly timeRange: TimeRange;
|
|
1332
|
+
}
|
|
1333
|
+
/** Whether an item is covered by a committed settlement receipt as of
|
|
1334
|
+
`completeThrough`. Not permanently terminal: a correction or a void
|
|
1335
|
+
arrives as a new fact at a higher sequence and re-opens its bucket to
|
|
1336
|
+
`provisional`.
|
|
1337
|
+
*/
|
|
1338
|
+
export type UsageSettlement = "settled" | "provisional";
|
|
1339
|
+
/** Retained bytes over time. */
|
|
1340
|
+
export interface UsageStorageAggregate {
|
|
1341
|
+
readonly attribution: UsageAttribution;
|
|
1342
|
+
readonly byteMinutes: string;
|
|
1343
|
+
readonly settlement: UsageSettlement;
|
|
1344
|
+
}
|
|
1345
|
+
/** A region-pinned execution and content boundary. */
|
|
1346
|
+
export interface Workspace {
|
|
1347
|
+
readonly apiUrl: string;
|
|
1348
|
+
readonly createdAt: string;
|
|
1349
|
+
readonly deletionOperationId?: Id<"operation">;
|
|
1350
|
+
readonly id: Id<"workspace">;
|
|
1351
|
+
readonly name: string;
|
|
1352
|
+
readonly operationalState: WorkspaceOperationalState;
|
|
1353
|
+
readonly organizationId: Id<"organization">;
|
|
1354
|
+
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
|
+
}
|
|
1358
|
+
/** Which retained session generation answered a live workspace call. */
|
|
1359
|
+
export interface WorkspaceAccess {
|
|
1360
|
+
readonly generationId: Id<"generation">;
|
|
1361
|
+
readonly resumed: boolean;
|
|
1362
|
+
}
|
|
1363
|
+
/** Create a region-pinned workspace. Region is required and immutable. */
|
|
1364
|
+
export interface WorkspaceCreateRequest {
|
|
1365
|
+
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">;
|
|
1372
|
+
}
|
|
1373
|
+
/** The workspace view of the account operational state it inherits. */
|
|
1374
|
+
export interface WorkspaceOperationalState {
|
|
1375
|
+
readonly inheritedFrom: OperationalStateSource;
|
|
1376
|
+
readonly organizationId: Id<"organization">;
|
|
1377
|
+
readonly state: AccountOperationalState;
|
|
1378
|
+
}
|
|
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
|
+
}
|