@idapt/browser-app-sdk 0.1.0 → 0.2.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.
@@ -1,4 +1,4 @@
1
- import { H as HttpContext, C as CallOptions, F as File$1, g as Agent, b as DeletedResponse, j as ApiKey, ac as Permission, aF as SpeechResult, aQ as TranscriptionResult, aG as SpeechStreamEvent, aR as TranscriptionStreamEvent, B as BlobObject, q as Chat, r as ChatCost, a4 as MessageCosts, t as ChatStopResult, a2 as Message, aw as SendMessageResult, i as AgentRunState, h as AgentRun, aq as RepromptResult, R as ExecutionRun, Q as ExecutionBackend, S as ExecutionRunStatus, v as Computer, E as ComputerServerInfo, x as ComputerExecResult, aP as TmuxWindow, ay as SftpEntry, z as ComputerPort, J as ComputerUser, a0 as ListEnvelope, w as ComputerEnvVar, O as DatastoreEntry, d as FileUploadResult, W as WriteOptions, X as ImageModel, V as ImageGenerationResult, Z as LLMModel, a7 as Notification, a8 as NotificationConfig, a9 as NotificationPreference, af as ProviderEndpointKind, aj as ProviderEndpointProviderKey, ae as ProviderEndpointConnectionType, am as ProviderEndpointTransport, ak as ProviderEndpointRuntime, ai as ProviderEndpointProtocol, an as ProviderEndpointVisibility, ag as ProviderEndpointModality, ad as ProviderEndpoint, a1 as ManagedProviderPreset, al as ProviderEndpointTestResult, at as SearchResult, au as Secret, av as SecretWithValue, ax as Settings, aC as ShareResourceType, aB as SharePermission, az as Share, aA as ShareDeletedResult, aD as SharedWithMeItem, aJ as StoreItemType, aI as StoreItem, aH as StoreInstallResult, aL as Subscription, aN as TableCollection, aO as TableRecord, aS as Trigger, K as CreateTriggerInput, aX as TriggerWithSecret, a_ as UpdateTriggerInput, aV as TriggerRun, aU as TriggerCostStats, b1 as User, b0 as UsageSummary, a$ as UsageRecord, b3 as WebSearchResponse, b7 as WorkspaceMemberRole, b4 as Workspace, b6 as WorkspaceMember, b5 as WorkspaceInvitation, k as AppFolder, M as DataFolder, u as ClientMeta, as as RuntimeMode, aK as StoredCredential, P as EscalateRequest } from './data-Chus9wn2.js';
1
+ import { H as HttpContext, C as CallOptions, F as File$1, i as Agent, d as DeletedResponse, l as ApiKey, ak as Permission, aN as SpeechResult, aY as TranscriptionResult, aO as SpeechStreamEvent, aZ as TranscriptionStreamEvent, B as BlobObject, s as Chat, t as ChatCost, ac as MessageCosts, v as ChatStopResult, aa as Message, aE as SendMessageResult, k as AgentRunState, j as AgentRun, ay as RepromptResult, x as Computer, I as ComputerServerInfo, z as ComputerExecResult, aX as TmuxWindow, aG as SftpEntry, G as ComputerPort, L as ComputerUser, a8 as ListEnvelope, y as ComputerEnvVar, R as DatastoreEntry, f as FileUploadResult, W as WriteOptions, U as ExecutionRun, T as ExecutionBackend, X as ExecutionRunStatus, a0 as FunctionRun, $ as FunctionResource, Z as FunctionDeployment, _ as FunctionInvokeResult, a3 as ImageModel, a2 as ImageGenerationResult, a5 as LLMModel, af as Notification, ag as NotificationConfig, ah as NotificationPreference, an as ProviderEndpointKind, ar as ProviderEndpointProviderKey, am as ProviderEndpointConnectionType, au as ProviderEndpointTransport, as as ProviderEndpointRuntime, aq as ProviderEndpointProtocol, av as ProviderEndpointVisibility, ao as ProviderEndpointModality, al as ProviderEndpoint, a9 as ManagedProviderPreset, at as ProviderEndpointTestResult, aB as SearchResult, aC as Secret, aD as SecretWithValue, aF as Settings, aK as ShareResourceType, aJ as SharePermission, aH as Share, aI as ShareDeletedResult, aL as SharedWithMeItem, aR as StoreItemType, aQ as StoreItem, aP as StoreInstallResult, aT as Subscription, aV as TableCollection, aW as TableRecord, a_ as Trigger, M as CreateTriggerInput, b3 as TriggerWithSecret, b6 as UpdateTriggerInput, b1 as TriggerRun, b0 as TriggerCostStats, b9 as User, b8 as UsageSummary, b7 as UsageRecord, bf as WebSearchResponse, bj as WorkspaceMemberRole, bg as Workspace, bi as WorkspaceMember, bh as WorkspaceInvitation, m as AppFolder, P as DataFolder, w as ClientMeta, aA as RuntimeMode, aS as StoredCredential, S as EscalateRequest } from './data-BuXXki1D.cjs';
2
2
 
3
3
  /**
4
4
  * Stateless low-level file operations against `/api/v1/drive/files/*`.
@@ -351,6 +351,12 @@ interface CommandBinding {
351
351
  responseKind: "single" | "list" | "created" | "deleted" | "binary";
352
352
  /** Long-running → goes through the async-operation layer. */
353
353
  async: boolean;
354
+ /** Client polling parameters for operations that outlive the poller's
355
+ * defaults (e.g. video generation: 5000ms × 240 ≈ a 20-minute ceiling). */
356
+ pollHint?: {
357
+ intervalMs: number;
358
+ maxAttempts: number;
359
+ };
354
360
  /** For `binary` responses — the served media types (e.g. `text/event-stream`). */
355
361
  binaryContentTypes?: readonly string[];
356
362
  }
@@ -360,7 +366,7 @@ declare const COMMAND_BINDINGS: Record<string, CommandBinding>;
360
366
  * {@link COMMAND_BINDINGS}). Used to type `client.call(action, args)` so a
361
367
  * known action autocompletes and a typo is caught at compile time.
362
368
  */
363
- type V1CommandName = "agent archive" | "agent copy-to-workspace" | "agent create" | "agent delete" | "agent get" | "agent list" | "agent move" | "agent permanent-delete" | "agent restore" | "agent unarchive" | "agent update" | "ai-gateway providers" | "ai-gateway usage" | "api-key create" | "api-key delete" | "api-key list" | "api-key rotate" | "api-key update" | "audio models" | "audio search-models" | "audio search-voices" | "audio speak" | "audio speak-stream" | "audio transcribe" | "audio transcribe-stream" | "audio voices" | "blobs delete" | "blobs get" | "blobs head" | "blobs list" | "blobs namespaces" | "blobs put" | "blobs signed-url" | "browser-app create" | "browser-app deploy" | "browser-app deployments" | "browser-app fork" | "browser-app get" | "browser-app list" | "browser-app promote" | "browser-app snapshot" | "chat archive" | "chat copy-to-agent" | "chat copy-to-workspace" | "chat cost" | "chat create" | "chat delete" | "chat export" | "chat fork-to-workspace" | "chat get" | "chat list" | "chat message-costs" | "chat messages" | "chat permanent-delete" | "chat reprompt" | "chat restore" | "chat runs" | "chat send" | "chat stop" | "chat stream" | "chat unarchive" | "chat update" | "ci cancel" | "ci get" | "ci jobs" | "ci list" | "ci run" | "code execute" | "code get" | "code interrupt" | "code list" | "computer activity" | "computer add-local-model" | "computer app-create" | "computer app-delete" | "computer app-exec" | "computer app-expose" | "computer app-external" | "computer app-get" | "computer app-logs" | "computer app-ports" | "computer app-reset" | "computer app-restart" | "computer app-run" | "computer app-runtime" | "computer app-setup-runtime" | "computer app-start" | "computer app-stop" | "computer app-unexpose" | "computer apps" | "computer archive" | "computer compose-up" | "computer create" | "computer create-user" | "computer delete" | "computer delete-user" | "computer delete-user-env" | "computer download" | "computer exec" | "computer expose" | "computer get" | "computer get-user" | "computer hibernate" | "computer link" | "computer links" | "computer list" | "computer local-inference" | "computer local-models" | "computer manage" | "computer pair" | "computer ports" | "computer remove-local-model" | "computer set-ports" | "computer set-user-env" | "computer sftp" | "computer start" | "computer stop" | "computer test-connection" | "computer tmux" | "computer tunnels" | "computer unarchive" | "computer unexpose" | "computer unlink" | "computer update" | "computer update-user" | "computer upload" | "computer user-env" | "computer user-env-setup" | "computer user-env-setup-apply" | "computer user-env-sync" | "computer user-env-sync-repair" | "computer users" | "datastore batch" | "datastore delete" | "datastore get" | "datastore increment" | "datastore list" | "datastore namespaces" | "datastore set" | "drive content-versions" | "drive create-folder" | "drive delete" | "drive get-metadata" | "drive glob" | "drive grep" | "drive list" | "drive move" | "drive permanent-delete" | "drive read" | "drive restore" | "drive restore-version" | "drive run" | "drive update" | "drive upload" | "guide get" | "hook create" | "hook delete" | "hook get" | "hook history" | "hook list" | "hook override" | "hook preview" | "hook toggle" | "hook update" | "hub install" | "hub search" | "hub submissions" | "hub submit" | "hub update" | "hub update-check" | "image generate" | "image models" | "image search" | "me get" | "me usage" | "models list" | "models search" | "notes box-create" | "notes box-delete" | "notes box-get" | "notes box-list" | "notes box-update" | "notes delete" | "notes graph" | "notes index-read" | "notes index-write" | "notes links" | "notes list" | "notes note-rename" | "notes read" | "notes search" | "notes search-all" | "notes tag-list" | "notes tag-rename" | "notes write" | "notification config" | "notification delete" | "notification get" | "notification list" | "notification preferences" | "notification read-all" | "notification send" | "notification update" | "notification update-config" | "notification update-preferences" | "operation cancel" | "operation get" | "operation list" | "provider-endpoint create" | "provider-endpoint delete" | "provider-endpoint list" | "provider-endpoint presets" | "provider-endpoint test" | "provider-endpoint update" | "realtime broadcast" | "realtime presence" | "realtime presence-list" | "realtime subscribe" | "repos branches" | "repos clone-url" | "repos commit" | "repos commits" | "repos create" | "repos delete" | "repos get" | "repos list" | "repos read-file" | "repos set-visibility" | "search query" | "secret create" | "secret delete" | "secret get" | "secret list" | "secret reveal" | "secret update" | "settings get" | "settings update" | "share create" | "share delete" | "share list" | "share update" | "shared-with-me list" | "skill apply-update" | "skill attach" | "skill body" | "skill create" | "skill delete" | "skill detach" | "skill file-delete" | "skill file-list" | "skill file-read" | "skill file-write" | "skill fork" | "skill get" | "skill install" | "skill list" | "skill publish" | "skill render" | "skill search" | "skill update" | "skill update-check" | "subscription get" | "table create" | "table create-record" | "table delete" | "table delete-record" | "table export" | "table get" | "table get-record" | "table import" | "table list" | "table query" | "table update" | "table update-record" | "tasks ancestors" | "tasks assign" | "tasks comment" | "tasks comment-delete" | "tasks comment-list" | "tasks comment-update" | "tasks create" | "tasks delete" | "tasks depend" | "tasks dependencies" | "tasks duplicate" | "tasks events" | "tasks get" | "tasks label-create" | "tasks label-delete" | "tasks label-list" | "tasks label-update" | "tasks list" | "tasks list-create" | "tasks list-delete" | "tasks list-get" | "tasks list-list" | "tasks list-update" | "tasks unassign" | "tasks undepend" | "tasks update" | "trigger archive" | "trigger cost-stats" | "trigger cost-stats-all" | "trigger create" | "trigger delete" | "trigger fire" | "trigger get" | "trigger list" | "trigger rotate-secret" | "trigger runs" | "trigger test-fire" | "trigger unarchive" | "trigger update" | "web fetch" | "web search" | "workspace add-member" | "workspace archive" | "workspace create" | "workspace delete" | "workspace get" | "workspace invitations" | "workspace invite" | "workspace list" | "workspace members" | "workspace remove-member" | "workspace revoke-invitation" | "workspace unarchive" | "workspace update" | "workspace update-member";
369
+ type V1CommandName = "agent archive" | "agent copy-to-workspace" | "agent create" | "agent delete" | "agent get" | "agent list" | "agent move" | "agent permanent-delete" | "agent restore" | "agent unarchive" | "agent update" | "ai-gateway providers" | "ai-gateway usage" | "api-key create" | "api-key delete" | "api-key list" | "api-key rotate" | "api-key update" | "audio models" | "audio search-models" | "audio search-voices" | "audio speak" | "audio speak-stream" | "audio transcribe" | "audio transcribe-stream" | "audio voices" | "blobs delete" | "blobs get" | "blobs head" | "blobs list" | "blobs namespaces" | "blobs put" | "blobs signed-url" | "browser-app create" | "browser-app deploy" | "browser-app deployments" | "browser-app fork" | "browser-app get" | "browser-app list" | "browser-app promote" | "browser-app snapshot" | "chat archive" | "chat copy-to-agent" | "chat copy-to-workspace" | "chat cost" | "chat create" | "chat delete" | "chat export" | "chat fork-to-workspace" | "chat get" | "chat list" | "chat message-costs" | "chat messages" | "chat permanent-delete" | "chat reprompt" | "chat restore" | "chat runs" | "chat send" | "chat stop" | "chat stream" | "chat unarchive" | "chat update" | "ci cancel" | "ci get" | "ci jobs" | "ci list" | "ci run" | "computer activity" | "computer add-local-model" | "computer app-create" | "computer app-delete" | "computer app-exec" | "computer app-expose" | "computer app-external" | "computer app-get" | "computer app-logs" | "computer app-ports" | "computer app-reset" | "computer app-restart" | "computer app-run" | "computer app-runtime" | "computer app-setup-runtime" | "computer app-start" | "computer app-stop" | "computer app-unexpose" | "computer apps" | "computer archive" | "computer compose-up" | "computer create" | "computer create-user" | "computer delete" | "computer delete-user" | "computer delete-user-env" | "computer download" | "computer download-to-drive" | "computer ephemeral" | "computer exec" | "computer expose" | "computer get" | "computer get-user" | "computer hibernate" | "computer link" | "computer links" | "computer list" | "computer local-inference" | "computer local-models" | "computer manage" | "computer pair" | "computer ports" | "computer remove-local-model" | "computer set-ports" | "computer set-user-env" | "computer sftp" | "computer start" | "computer stop" | "computer test-connection" | "computer tmux" | "computer tunnels" | "computer unarchive" | "computer unexpose" | "computer unlink" | "computer update" | "computer update-user" | "computer upload" | "computer user-env" | "computer user-env-setup" | "computer user-env-setup-apply" | "computer user-env-sync" | "computer user-env-sync-repair" | "computer users" | "datastore batch" | "datastore delete" | "datastore get" | "datastore increment" | "datastore list" | "datastore namespaces" | "datastore set" | "drive content-versions" | "drive create-folder" | "drive delete" | "drive get-metadata" | "drive glob" | "drive grep" | "drive list" | "drive move" | "drive permanent-delete" | "drive read" | "drive restore" | "drive restore-version" | "drive run" | "drive update" | "drive upload" | "functions create" | "functions delete" | "functions deploy" | "functions deployments" | "functions get" | "functions invoke" | "functions list" | "functions promote" | "functions run" | "functions run-get" | "functions run-interrupt" | "functions run-list" | "functions update" | "guide get" | "hook create" | "hook delete" | "hook get" | "hook history" | "hook list" | "hook override" | "hook preview" | "hook toggle" | "hook update" | "hub install" | "hub search" | "hub submissions" | "hub submit" | "hub update" | "hub update-check" | "image generate" | "image models" | "image search" | "me get" | "me usage" | "memory box-delete" | "memory box-get" | "memory box-list" | "memory box-update" | "memory delete" | "memory index-read" | "memory index-write" | "memory list" | "memory read" | "memory search" | "memory write" | "models list" | "models search" | "notes box-create" | "notes box-delete" | "notes box-get" | "notes box-list" | "notes box-update" | "notes delete" | "notes folder-create" | "notes folder-delete" | "notes folder-list" | "notes folder-move" | "notes folder-rename" | "notes graph" | "notes import" | "notes index-read" | "notes index-write" | "notes links" | "notes list" | "notes note-move" | "notes note-rename" | "notes purge" | "notes read" | "notes restore" | "notes search" | "notes search-all" | "notes tag-list" | "notes tag-rename" | "notes trash-empty" | "notes trash-list" | "notes tree" | "notes write" | "notification config" | "notification delete" | "notification get" | "notification list" | "notification preferences" | "notification read-all" | "notification send" | "notification update" | "notification update-config" | "notification update-preferences" | "operation cancel" | "operation get" | "operation list" | "provider-endpoint create" | "provider-endpoint delete" | "provider-endpoint list" | "provider-endpoint presets" | "provider-endpoint test" | "provider-endpoint update" | "realtime broadcast" | "realtime presence" | "realtime presence-list" | "realtime subscribe" | "repos branches" | "repos clone-url" | "repos commit" | "repos commits" | "repos create" | "repos delete" | "repos get" | "repos list" | "repos read-file" | "repos set-visibility" | "search query" | "secret create" | "secret delete" | "secret get" | "secret list" | "secret reveal" | "secret update" | "settings get" | "settings update" | "share create" | "share delete" | "share list" | "share update" | "shared-with-me list" | "skill apply-update" | "skill attach" | "skill body" | "skill create" | "skill delete" | "skill detach" | "skill file-delete" | "skill file-list" | "skill file-read" | "skill file-write" | "skill fork" | "skill get" | "skill install" | "skill list" | "skill publish" | "skill render" | "skill search" | "skill update" | "skill update-check" | "subscription get" | "table create" | "table create-record" | "table delete" | "table delete-record" | "table export" | "table get" | "table get-record" | "table import" | "table list" | "table query" | "table update" | "table update-record" | "tasks ancestors" | "tasks assign" | "tasks comment" | "tasks comment-delete" | "tasks comment-list" | "tasks comment-update" | "tasks create" | "tasks delete" | "tasks depend" | "tasks dependencies" | "tasks duplicate" | "tasks events" | "tasks get" | "tasks import" | "tasks label-create" | "tasks label-delete" | "tasks label-list" | "tasks label-update" | "tasks list" | "tasks list-create" | "tasks list-delete" | "tasks list-get" | "tasks list-list" | "tasks list-update" | "tasks unassign" | "tasks undepend" | "tasks update" | "trigger archive" | "trigger cost-stats" | "trigger cost-stats-all" | "trigger create" | "trigger delete" | "trigger fire" | "trigger get" | "trigger list" | "trigger rotate-secret" | "trigger runs" | "trigger test-fire" | "trigger unarchive" | "trigger update" | "video generate" | "video models" | "video search" | "web fetch" | "web search" | "workspace add-member" | "workspace archive" | "workspace create" | "workspace delete" | "workspace get" | "workspace invitations" | "workspace invite" | "workspace list" | "workspace members" | "workspace remove-member" | "workspace revoke-invitation" | "workspace unarchive" | "workspace update" | "workspace update-member";
364
370
 
365
371
  /**
366
372
  * Generic, spec-driven command executor — the SDK twin of the CLI's `runSpec`.
@@ -630,54 +636,6 @@ declare class ChatsApi {
630
636
  repromptMessage(chatId: string, messageId: string, input?: RepromptMessageInput, opts?: CallOptions): Promise<RepromptResult>;
631
637
  }
632
638
 
633
- /**
634
- * CodeRunsApi — `/api/v1/code-runs`.
635
- *
636
- * Two surfaces:
637
- * - `POST /code-runs` — execute a code file in a sandboxed Lambda
638
- * environment. Returns stdout, stderr, exit code, timing.
639
- * - `GET /code-runs` + `GET /code-runs/:id` — history browsing.
640
- *
641
- * Browser-apps use `runs.run()` to invoke a file owned by the user (e.g., a
642
- * Python helper in the data folder) without needing a full computer.
643
- */
644
-
645
- interface RunCodeInput {
646
- file_id: string;
647
- /** Hard upper bound on wall-clock runtime. Default 30s server-side. */
648
- timeout_seconds?: number;
649
- /**
650
- * Environment variables passed to the running code. `IDAPT_API_KEY` is
651
- * allowed. `AWS_*` and runtime-hijacking vars are stripped server-side.
652
- */
653
- env?: Record<string, string>;
654
- }
655
- /**
656
- * `GET /v1/code-runs` query params. Cursor-paginated (opaque `cursor`);
657
- * `backend` and `status` are closed enums.
658
- */
659
- interface ListExecutionsQuery {
660
- limit?: number;
661
- /** Opaque pagination cursor — echo `pagination.next_cursor`. */
662
- cursor?: string;
663
- backend?: ExecutionBackend;
664
- status?: ExecutionRunStatus;
665
- }
666
- declare class CodeRunsApi {
667
- private readonly ctx;
668
- constructor(ctx: HttpContext);
669
- /**
670
- * Execute a code file. Returns the full `ExecutionRun` row — `id`,
671
- * `status`, `stdout`, `stderr`, `exit_code`, and the run timestamps —
672
- * the same shape as `GET /code-runs/:id`.
673
- */
674
- run(input: RunCodeInput, opts?: CallOptions): Promise<ExecutionRun>;
675
- /** List recent execution runs. */
676
- list(query?: ListExecutionsQuery, opts?: CallOptions): Promise<ExecutionRun[]>;
677
- /** Get a single execution run by id. */
678
- get(id: string, opts?: CallOptions): Promise<ExecutionRun>;
679
- }
680
-
681
639
  /**
682
640
  * ComputersApi — `/api/v1/computers`.
683
641
  *
@@ -1117,6 +1075,165 @@ declare class FilesApi {
1117
1075
  run(id: string, input?: RunFileInput, opts?: CallOptions): Promise<ExecutionRun>;
1118
1076
  }
1119
1077
 
1078
+ /**
1079
+ * FunctionsApi — `/api/v1/functions` (idapt Functions).
1080
+ *
1081
+ * Two tiers, mirroring the v1 `functions` contract:
1082
+ *
1083
+ * - One-off runs — `run()` executes a script ONCE in the sandboxed Lambda
1084
+ * (inline `script` XOR an existing Drive `file_id`) and returns the full
1085
+ * `FunctionRun` row (the `transformExecutionRun` shape). Anything the script
1086
+ * writes under `/tmp/output/` is copied into Drive and listed in
1087
+ * `output_files`. Browse history via the `runs` sub-api
1088
+ * (`runs.list` / `runs.get` / `runs.interrupt`).
1089
+ * - Deployed functions — named, versioned, HTTP-invokable units:
1090
+ * `create` → `deploy` (inline base64 bundle) → `invoke`. `promote` flips /
1091
+ * rolls back the live deployment; `deployments` lists the version history.
1092
+ *
1093
+ * Surfaced as `client.functions.*`. Replaces the former code-execution
1094
+ * surface. Wire types are snake_case over the wire.
1095
+ */
1096
+
1097
+ /**
1098
+ * `POST /functions/runs` body — run a script once. Pass EXACTLY one of inline
1099
+ * `script` (+ optional `language`) or an existing Drive `file_id`.
1100
+ */
1101
+ interface RunFunctionInput {
1102
+ /** Inline source (≤ 1 MB). Mutually exclusive with `file_id`. */
1103
+ script?: string;
1104
+ /** An existing Drive file id to execute. Mutually exclusive with `script`. */
1105
+ file_id?: string;
1106
+ /** Language for inline `script` — drives the entrypoint extension. */
1107
+ language?: "node" | "python" | "bash";
1108
+ /** Hard wall-clock bound (1–300s). Default 30s server-side. */
1109
+ timeout_seconds?: number;
1110
+ /** Environment variables injected into the run. */
1111
+ env?: Record<string, string>;
1112
+ /** Workspace secret names to inject as env vars (resolved server-side). */
1113
+ secrets?: string[];
1114
+ }
1115
+ /**
1116
+ * `GET /functions/runs` query params. Cursor-paginated (opaque `cursor`);
1117
+ * `backend` / `status` narrow the one-off run history.
1118
+ */
1119
+ interface ListFunctionRunsQuery {
1120
+ limit?: number;
1121
+ /** Opaque pagination cursor — echo `pagination.next_cursor`. */
1122
+ cursor?: string;
1123
+ backend?: ExecutionBackend;
1124
+ status?: ExecutionRunStatus;
1125
+ /** Scope the listing to a single workspace. */
1126
+ workspace_id?: string;
1127
+ }
1128
+ /** `GET /functions` query params — list deployed functions. */
1129
+ interface ListFunctionsQuery {
1130
+ limit?: number;
1131
+ }
1132
+ /** One declared permission grant on a function. */
1133
+ interface FunctionPermissionInput {
1134
+ resource: string;
1135
+ access: "read" | "write" | "admin";
1136
+ scope?: string;
1137
+ }
1138
+ /** `POST /functions` body — create a deployed function (config only). */
1139
+ interface CreateFunctionInput {
1140
+ name: string;
1141
+ description?: string;
1142
+ runtime?: "node" | "python";
1143
+ entrypoint?: string;
1144
+ auth_mode?: "bearer" | "secret" | "public";
1145
+ timeout_seconds?: number;
1146
+ permissions?: FunctionPermissionInput[];
1147
+ /** Workspace secret names to expose to the function at runtime. */
1148
+ secrets?: string[];
1149
+ source_repo_id?: string;
1150
+ branch?: string;
1151
+ browser_app_id?: string;
1152
+ }
1153
+ /** `PATCH /functions/:id` body — update a function's config (all optional). */
1154
+ interface UpdateFunctionInput {
1155
+ description?: string | null;
1156
+ auth_mode?: "bearer" | "secret" | "public";
1157
+ timeout_seconds?: number;
1158
+ permissions?: FunctionPermissionInput[] | null;
1159
+ secrets?: string[] | null;
1160
+ branch?: string | null;
1161
+ }
1162
+ /** One file of a deploy bundle — base64-encoded content at a bundle path. */
1163
+ interface DeployFunctionFile {
1164
+ path: string;
1165
+ content_b64: string;
1166
+ }
1167
+ /**
1168
+ * `POST /functions/:id/deploy` body — an inline base64 bundle. Promotes the
1169
+ * new deployment to live immediately unless `promote: false`.
1170
+ */
1171
+ interface DeployFunctionInput {
1172
+ files: DeployFunctionFile[];
1173
+ entrypoint?: string;
1174
+ runtime?: "node" | "python";
1175
+ /** Promote the new deployment to live immediately (default true). */
1176
+ promote?: boolean;
1177
+ }
1178
+ /** `POST /functions/:id/invoke` body — the request handed to the handler. */
1179
+ interface InvokeFunctionInput {
1180
+ method?: string;
1181
+ path?: string;
1182
+ query?: Record<string, string>;
1183
+ headers?: Record<string, string>;
1184
+ body?: unknown;
1185
+ }
1186
+ /** `client.functions.runs` — browse + interrupt one-off runs. */
1187
+ declare class FunctionRunsApi {
1188
+ private readonly ctx;
1189
+ constructor(ctx: HttpContext);
1190
+ /** List one-off function runs (cursor-paginated). */
1191
+ list(query?: ListFunctionRunsQuery, opts?: CallOptions): Promise<FunctionRun[]>;
1192
+ /** Get a single one-off run by id. */
1193
+ get(id: string, opts?: CallOptions): Promise<FunctionRun>;
1194
+ /**
1195
+ * Interrupt a running run. Only computer-backed runs can be interrupted;
1196
+ * Lambda-backed runs return 409 (`ConflictError`).
1197
+ */
1198
+ interrupt(id: string, opts?: CallOptions): Promise<FunctionRun>;
1199
+ }
1200
+ declare class FunctionsApi {
1201
+ private readonly ctx;
1202
+ /** One-off run history — list / get / interrupt. */
1203
+ readonly runs: FunctionRunsApi;
1204
+ constructor(ctx: HttpContext);
1205
+ /**
1206
+ * Run a script ONCE in the sandbox. Pass EITHER inline `script` (+ optional
1207
+ * `language`) OR an existing Drive `file_id`. Returns the full `FunctionRun`
1208
+ * row — `id`, `status`, `stdout`, `stderr`, `exit_code`, the run timestamps,
1209
+ * and any `output_files` the script wrote under `/tmp/output/`.
1210
+ */
1211
+ run(input: RunFunctionInput, opts?: CallOptions): Promise<FunctionRun>;
1212
+ /** List deployed functions in the workspace. */
1213
+ list(query?: ListFunctionsQuery, opts?: CallOptions): Promise<FunctionResource[]>;
1214
+ /** Get a deployed function by its resourceId. */
1215
+ get(id: string, opts?: CallOptions): Promise<FunctionResource>;
1216
+ /** Create a deployed function (config only — `deploy` adds a bundle). */
1217
+ create(input: CreateFunctionInput, opts?: CallOptions): Promise<FunctionResource>;
1218
+ /** Update a deployed function's config. */
1219
+ update(id: string, patch: UpdateFunctionInput, opts?: CallOptions): Promise<FunctionResource>;
1220
+ /** Delete a deployed function + all its deployments. */
1221
+ delete(id: string, opts?: CallOptions): Promise<DeletedResponse>;
1222
+ /**
1223
+ * Deploy a new bundle (inline base64 files). Promotes the new deployment to
1224
+ * live immediately unless `promote: false`. Returns the new deployment.
1225
+ */
1226
+ deploy(id: string, input: DeployFunctionInput, opts?: CallOptions): Promise<FunctionDeployment>;
1227
+ /** List a function's deployments (newest-first). */
1228
+ deployments(id: string, opts?: CallOptions): Promise<FunctionDeployment[]>;
1229
+ /** Promote (or roll back to) a deployment — flips the active one. */
1230
+ promote(id: string, input: {
1231
+ deployment_id: string;
1232
+ }, opts?: CallOptions): Promise<FunctionResource>;
1233
+ /** Invoke a deployed function synchronously; returns its response. */
1234
+ invoke(id: string, input?: InvokeFunctionInput, opts?: CallOptions): Promise<FunctionInvokeResult>;
1235
+ }
1236
+
1120
1237
  /**
1121
1238
  * GuideApi — `GET /api/v1/guide`.
1122
1239
  *
@@ -2132,8 +2249,8 @@ declare class IdaptClient {
2132
2249
  readonly images: ImagesApi;
2133
2250
  /** Text-to-speech + transcription. */
2134
2251
  readonly audio: AudioApi;
2135
- /** Execute code files in sandboxed Lambda. */
2136
- readonly code: CodeRunsApi;
2252
+ /** Run + invoke serverless functions. */
2253
+ readonly functions: FunctionsApi;
2137
2254
  /** Full-text search across user content. */
2138
2255
  readonly search: SearchApi;
2139
2256
  /** External web search. */
@@ -2210,4 +2327,4 @@ declare class IdaptClient {
2210
2327
  private navigate;
2211
2328
  }
2212
2329
 
2213
- export { type ListRunsQuery as $, type AddMemberInput as A, type BlobMeta as B, COMMAND_BINDINGS as C, DatastoreApi as D, type DeleteInvitationResult as E, type DeletedResult as F, DocsApi as G, type ExecCommandInput as H, IdaptClient as I, type ExecuteCommandOptions as J, FilesApi as K, type FireTriggerInput as L, type GenerateImageInput as M, GuideApi as N, type GuideContent as O, type IdaptClientDeps as P, ImagesApi as Q, type InstallStoreItemInput as R, type ListAgentsQuery as S, type ListApiKeysQuery as T, type ListChatsQuery as U, type ListComputersQuery as V, type ListExecutionsQuery as W, type ListFilesQuery as X, type ListMessagesQuery as Y, type ListNotificationsQuery as Z, type ListResult as _, AgentsApi as a, type V1CommandName as a$, type ListSharedWithMeQuery as a0, type ListSharesQuery as a1, type ListTriggerRunsQuery as a2, type ListUsageHistoryQuery as a3, ModelsApi as a4, type NotificationAudience as a5, type NotificationPreferenceUpdate as a6, NotificationsApi as a7, type PairComputerInput as a8, type PairComputerResult as a9, SharingApi as aA, type SpeakInput as aB, type SseEvent as aC, StoreApi as aD, type SubscribeOptions as aE, SubscriptionApi as aF, type TableQuery as aG, TablesApi as aH, type TmuxInput as aI, type TmuxOp as aJ, type TranscribeInput as aK, TriggersApi as aL, type UpdateAgentInput as aM, type UpdateApiKeyInput as aN, type UpdateChatInput as aO, type UpdateCollectionInput as aP, type UpdateComputerInput as aQ, type UpdateComputerUserInput as aR, type UpdateMemberInput as aS, type UpdateNotificationInput as aT, type UpdateProviderEndpointInput as aU, type UpdateSecretInput as aV, type UpdateSettingsInput as aW, type UpdateShareInput as aX, type UpdateWorkspaceInput as aY, type UploadInput as aZ, UserApi as a_, type PatchFileInput as aa, type PatchPortInput as ab, type PresenceEntry as ac, type PresenceHeartbeatOptions as ad, type ProviderEndpointModelMappingInput as ae, ProviderEndpointsApi as af, RealtimeApi as ag, type RealtimeEvent as ah, type RemoveShareInput as ai, type RepromptMessageInput as aj, type RotateApiKeyInput as ak, type RotateApiKeyResult as al, type RunCodeInput as am, type RunFileInput as an, SearchApi as ao, type SearchInput as ap, type SearchStoreQuery as aq, SecretsApi as ar, type SendMessageInput as as, type SendNotificationInput as at, type SendNotificationResult as au, SettingsApi as av, type SftpInput as aw, type SftpListResult as ax, type SftpOp as ay, type SftpUploadInput as az, ApiKeysApi as b, WebSearchApi as b0, type WebSearchInput as b1, WorkspacesApi as b2, type WritableMemberRole as b3, awaitOperation as b4, executeCommand as b5, getFileBlob as b6, getFileText as b7, listFiles as b8, AudioApi as c, BlobsApi as d, type BlobsListOptions as e, type ChannelHandle as f, ChatsApi as g, CodeRunsApi as h, type CommandBinding as i, ComputersApi as j, type CreateAgentInput as k, type CreateApiKeyInput as l, type CreateChatInput as m, type CreateCollectionInput as n, type CreateComputerInput as o, type CreateComputerUserInput as p, type CreateFolderInput as q, type CreateInvitationInput as r, type CreateInvitationResult as s, type CreateProviderEndpointInput as t, type CreateSecretInput as u, type CreateShareInput as v, type CreateUserEnvVarInput as w, type CreateWorkspaceInput as x, type DatastoreListOptions as y, type DatastoreSetOptions as z };
2330
+ export { type ListFilesQuery as $, type AddMemberInput as A, type BlobMeta as B, COMMAND_BINDINGS as C, DatastoreApi as D, type DeleteInvitationResult as E, type DeletedResult as F, type DeployFunctionFile as G, type DeployFunctionInput as H, IdaptClient as I, DocsApi as J, type ExecCommandInput as K, type ExecuteCommandOptions as L, FilesApi as M, type FireTriggerInput as N, type FunctionPermissionInput as O, FunctionsApi as P, type GenerateImageInput as Q, GuideApi as R, type GuideContent as S, type IdaptClientDeps as T, ImagesApi as U, type InstallStoreItemInput as V, type InvokeFunctionInput as W, type ListAgentsQuery as X, type ListApiKeysQuery as Y, type ListChatsQuery as Z, type ListComputersQuery as _, AgentsApi as a, type UpdateProviderEndpointInput as a$, type ListFunctionRunsQuery as a0, type ListFunctionsQuery as a1, type ListMessagesQuery as a2, type ListNotificationsQuery as a3, type ListResult as a4, type ListRunsQuery as a5, type ListSharedWithMeQuery as a6, type ListSharesQuery as a7, type ListTriggerRunsQuery as a8, type ListUsageHistoryQuery as a9, type SendNotificationResult as aA, SettingsApi as aB, type SftpInput as aC, type SftpListResult as aD, type SftpOp as aE, type SftpUploadInput as aF, SharingApi as aG, type SpeakInput as aH, type SseEvent as aI, StoreApi as aJ, type SubscribeOptions as aK, SubscriptionApi as aL, type TableQuery as aM, TablesApi as aN, type TmuxInput as aO, type TmuxOp as aP, type TranscribeInput as aQ, TriggersApi as aR, type UpdateAgentInput as aS, type UpdateApiKeyInput as aT, type UpdateChatInput as aU, type UpdateCollectionInput as aV, type UpdateComputerInput as aW, type UpdateComputerUserInput as aX, type UpdateFunctionInput as aY, type UpdateMemberInput as aZ, type UpdateNotificationInput as a_, ModelsApi as aa, type NotificationAudience as ab, type NotificationPreferenceUpdate as ac, NotificationsApi as ad, type PairComputerInput as ae, type PairComputerResult as af, type PatchFileInput as ag, type PatchPortInput as ah, type PresenceEntry as ai, type PresenceHeartbeatOptions as aj, type ProviderEndpointModelMappingInput as ak, ProviderEndpointsApi as al, RealtimeApi as am, type RealtimeEvent as an, type RemoveShareInput as ao, type RepromptMessageInput as ap, type RotateApiKeyInput as aq, type RotateApiKeyResult as ar, type RunFileInput as as, type RunFunctionInput as at, SearchApi as au, type SearchInput as av, type SearchStoreQuery as aw, SecretsApi as ax, type SendMessageInput as ay, type SendNotificationInput as az, ApiKeysApi as b, type UpdateSecretInput as b0, type UpdateSettingsInput as b1, type UpdateShareInput as b2, type UpdateWorkspaceInput as b3, type UploadInput as b4, UserApi as b5, type V1CommandName as b6, WebSearchApi as b7, type WebSearchInput as b8, WorkspacesApi as b9, type WritableMemberRole as ba, awaitOperation as bb, executeCommand as bc, getFileBlob as bd, getFileText as be, listFiles as bf, AudioApi as c, BlobsApi as d, type BlobsListOptions as e, type ChannelHandle as f, ChatsApi as g, type CommandBinding as h, ComputersApi as i, type CreateAgentInput as j, type CreateApiKeyInput as k, type CreateChatInput as l, type CreateCollectionInput as m, type CreateComputerInput as n, type CreateComputerUserInput as o, type CreateFolderInput as p, type CreateFunctionInput as q, type CreateInvitationInput as r, type CreateInvitationResult as s, type CreateProviderEndpointInput as t, type CreateSecretInput as u, type CreateShareInput as v, type CreateUserEnvVarInput as w, type CreateWorkspaceInput as x, type DatastoreListOptions as y, type DatastoreSetOptions as z };
@@ -173,34 +173,6 @@ declare const blobObjectResponseSchema: z.ZodObject<{
173
173
  }, z.core.$strip>;
174
174
  type BlobObjectResponse = z.infer<typeof blobObjectResponseSchema>;
175
175
 
176
- /** `execution_run` record — `transformExecutionRun` output, snake_case. */
177
- declare const executionRunResponseSchema: z.ZodObject<{
178
- id: z.ZodString;
179
- backend: z.ZodString;
180
- mode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
181
- status: z.ZodString;
182
- workspace_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
183
- file_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
184
- file_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
185
- runtime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
186
- exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
187
- stdout: z.ZodOptional<z.ZodNullable<z.ZodString>>;
188
- stderr: z.ZodOptional<z.ZodNullable<z.ZodString>>;
189
- duration_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
190
- timed_out: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
191
- timeout_seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
192
- trigger_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
193
- error_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
194
- created_at: z.ZodString;
195
- started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
196
- completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
197
- output_files: z.ZodOptional<z.ZodArray<z.ZodObject<{
198
- file_id: z.ZodString;
199
- path: z.ZodString;
200
- }, z.core.$strip>>>;
201
- }, z.core.$strip>;
202
- type ExecutionRunResponse = z.infer<typeof executionRunResponseSchema>;
203
-
204
176
  declare const computerResponseSchema: z.ZodObject<{
205
177
  id: z.ZodString;
206
178
  name: z.ZodString;
@@ -552,6 +524,67 @@ declare const fileUploadResponseSchema: z.ZodObject<{
552
524
  }, z.core.$strip>;
553
525
  type FileUploadResponse = z.infer<typeof fileUploadResponseSchema>;
554
526
 
527
+ /** `execution_run` record — `transformExecutionRun` output, snake_case. */
528
+ declare const functionRunResponseSchema: z.ZodObject<{
529
+ id: z.ZodString;
530
+ backend: z.ZodString;
531
+ mode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
532
+ status: z.ZodString;
533
+ workspace_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
534
+ file_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
535
+ file_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
536
+ runtime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
537
+ exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
538
+ stdout: z.ZodOptional<z.ZodNullable<z.ZodString>>;
539
+ stderr: z.ZodOptional<z.ZodNullable<z.ZodString>>;
540
+ duration_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
541
+ timed_out: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
542
+ timeout_seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
543
+ trigger_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
544
+ error_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
545
+ created_at: z.ZodString;
546
+ started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
547
+ completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
548
+ output_files: z.ZodOptional<z.ZodArray<z.ZodObject<{
549
+ file_id: z.ZodString;
550
+ path: z.ZodString;
551
+ }, z.core.$strip>>>;
552
+ }, z.core.$strip>;
553
+ type FunctionRunResponse = z.infer<typeof functionRunResponseSchema>;
554
+ declare const functionResponseSchema: z.ZodObject<{
555
+ id: z.ZodString;
556
+ name: z.ZodString;
557
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
558
+ runtime: z.ZodString;
559
+ entrypoint: z.ZodString;
560
+ auth_mode: z.ZodString;
561
+ timeout_seconds: z.ZodNumber;
562
+ active_deployment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
563
+ source_repo_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
564
+ branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
565
+ browser_app_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
566
+ size_bytes: z.ZodNumber;
567
+ invoke_url: z.ZodString;
568
+ created_at: z.ZodString;
569
+ updated_at: z.ZodString;
570
+ }, z.core.$strip>;
571
+ type FunctionResponse = z.infer<typeof functionResponseSchema>;
572
+ declare const functionDeploymentResponseSchema: z.ZodObject<{
573
+ id: z.ZodString;
574
+ function_id: z.ZodString;
575
+ status: z.ZodString;
576
+ runtime: z.ZodString;
577
+ entrypoint: z.ZodString;
578
+ size_bytes: z.ZodNumber;
579
+ file_count: z.ZodNumber;
580
+ content_hash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
581
+ producer_type: z.ZodString;
582
+ producer_ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
583
+ created_at: z.ZodString;
584
+ built_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
585
+ }, z.core.$strip>;
586
+ type FunctionDeploymentResponse = z.infer<typeof functionDeploymentResponseSchema>;
587
+
555
588
  /**
556
589
  * A hub/store item from `GET /hub/search` (snake_case wire). `id` is the item's
557
590
  * resourceId (non-null). The catalog has heterogeneous payloads per type
@@ -852,18 +885,41 @@ type SendMessageResult = {
852
885
  chat_id: string;
853
886
  };
854
887
  /**
855
- * Lifecycle status of an execution run. `interrupted` lands when a run is
856
- * cancelled via `POST /code-runs/:id/interrupt`.
888
+ * Lifecycle status of a one-off function run. `interrupted` lands when a run is
889
+ * cancelled via `POST /functions/runs/:id/interrupt`.
857
890
  */
858
891
  type ExecutionRunStatus = "pending" | "running" | "completed" | "failed" | "timed_out" | "interrupted";
859
- /** Where an execution run executes — sandboxed Lambda or a paired computer. */
892
+ /** Where a function run executes — sandboxed Lambda or a paired computer. */
860
893
  type ExecutionBackend = "computer" | "lambda";
861
894
  /**
862
- * An execution-run row. Returned by `POST /code-runs`, `POST /files/:id/run`,
863
- * `GET /code-runs` and `GET /code-runs/:id` — code execution always yields
864
- * this single shape (there is no separate stripped run-summary type).
895
+ * A one-off function-run row. Returned by `POST /functions/runs`,
896
+ * `POST /files/:id/run`, `GET /functions/runs` and `GET /functions/runs/:id` —
897
+ * the one-off run lane always yields this single shape (there is no separate
898
+ * stripped run-summary type).
899
+ */
900
+ type ExecutionRun = FunctionRunResponse;
901
+ /** Alias for the one-off run row — the `client.functions.run*` result shape. */
902
+ type FunctionRun = ExecutionRun;
903
+ /**
904
+ * A deployed function — a named, versioned, HTTP-invokable unit served on
905
+ * `fn.idapt.host`. Returned by `GET/POST /functions`, `GET/PATCH /functions/:id`
906
+ * and `POST /functions/:id/promote`.
907
+ */
908
+ type FunctionResource = FunctionResponse;
909
+ /**
910
+ * One deployment (build) of a function. Returned by
911
+ * `POST /functions/:id/deploy` and `GET /functions/:id/deployments`.
865
912
  */
866
- type ExecutionRun = ExecutionRunResponse;
913
+ type FunctionDeployment = FunctionDeploymentResponse;
914
+ /**
915
+ * Result of `POST /functions/:id/invoke` — the deployed handler's response:
916
+ * an HTTP `status`, a decoded `body`, and optional response `headers`.
917
+ */
918
+ interface FunctionInvokeResult {
919
+ status: number;
920
+ body: unknown;
921
+ headers?: Record<string, string>;
922
+ }
867
923
  type TriggerType = "webhook" | "schedule" | "manual" | string;
868
924
  type TriggerActionType = "run_code" | "run_chat" | string;
869
925
  /**
@@ -926,9 +982,10 @@ interface CreateTriggerInput {
926
982
  type UpdateTriggerInput = Partial<CreateTriggerInput>;
927
983
  /**
928
984
  * Modality bucket a model belongs to. Every model row across `/v1/models`,
929
- * `/v1/audio/models` and `/v1/images/models` carries this discriminant.
985
+ * `/v1/audio/models`, `/v1/images/models` and `/v1/videos/models` carries
986
+ * this discriminant.
930
987
  */
931
- type ModelModality = "chat" | "audio" | "image";
988
+ type ModelModality = "chat" | "audio" | "image" | "video";
932
989
  /**
933
990
  * Fields shared by every model row regardless of modality. Modality-specific
934
991
  * shapes (`LLMModel`, `AudioModel`, `ImageModel`) extend this.
@@ -1063,6 +1120,91 @@ interface ImageGenerationResult {
1063
1120
  model: string;
1064
1121
  cost_usd?: number | null;
1065
1122
  }
1123
+ /** One row of a video model's per-resolution rate table (post-markup). */
1124
+ interface VideoModelRate {
1125
+ resolution: string;
1126
+ audio?: boolean;
1127
+ per_second: number;
1128
+ }
1129
+ /** Video model pricing — USD per second of OUTPUT video (post-markup). */
1130
+ interface VideoModelPricing {
1131
+ /** Cheapest rate in the table. */
1132
+ per_second: number;
1133
+ rates: VideoModelRate[];
1134
+ }
1135
+ /** Video model capability block. */
1136
+ interface VideoModelCapabilities {
1137
+ /** Generation modes: t2v (text), i2v (image ref), v2v (video edit). */
1138
+ modes: ("t2v" | "i2v" | "v2v")[];
1139
+ /** Fixed output durations in seconds — requests must pick one. */
1140
+ durations: number[];
1141
+ resolutions: string[];
1142
+ aspect_ratios: string[];
1143
+ /** Whether the model generates native audio with the video. */
1144
+ audio: boolean;
1145
+ max_duration_seconds: number;
1146
+ max_input_images?: number | null;
1147
+ }
1148
+ /** A video model from `GET /v1/videos/models` (`modality: "video"`). */
1149
+ interface VideoModel extends ModelBase {
1150
+ modality: "video";
1151
+ provider_display_name?: string | null;
1152
+ provider_slug?: string | null;
1153
+ pricing: VideoModelPricing;
1154
+ capabilities: VideoModelCapabilities;
1155
+ paid: boolean;
1156
+ required_tier?: string | null;
1157
+ locked?: boolean;
1158
+ speed?: string | null;
1159
+ is_new?: boolean;
1160
+ }
1161
+ /**
1162
+ * The completed operation's `result` for `video generate` — surfaced by
1163
+ * `client.videos.generate()` (wait mode) or `client.operations.get(id)`.
1164
+ */
1165
+ interface VideoGenerationResult {
1166
+ file_id: string;
1167
+ path: string;
1168
+ url: string;
1169
+ raw_url?: string | null;
1170
+ model: string;
1171
+ cost_usd?: number | null;
1172
+ duration_seconds: number;
1173
+ resolution: string;
1174
+ }
1175
+ /** One row of `GET /v1/videos/models/search`. */
1176
+ interface VideoModelSearchItem {
1177
+ id: string;
1178
+ display_name: string;
1179
+ provider: string;
1180
+ provider_slug: string;
1181
+ /** Cheapest post-markup USD per second of output video. */
1182
+ per_second: number;
1183
+ modes: ("t2v" | "i2v" | "v2v")[];
1184
+ durations: number[];
1185
+ resolutions: string[];
1186
+ audio: boolean;
1187
+ speed: "fast" | "standard" | "slow";
1188
+ description?: string | null;
1189
+ }
1190
+ /** The shared search envelope instantiated for video models. */
1191
+ interface VideoModelSearchResult {
1192
+ items: VideoModelSearchItem[];
1193
+ total_count: number;
1194
+ offset: number;
1195
+ has_more: boolean;
1196
+ query?: string | null;
1197
+ applied_filters: Record<string, unknown>;
1198
+ }
1199
+ /**
1200
+ * An async-operation handle (`{id: "mg_…", status}`) — what `video generate`
1201
+ * resolves with under `wait: false`; poll via `client.operations.get(id)`.
1202
+ */
1203
+ interface OperationHandle {
1204
+ id: string;
1205
+ status: string;
1206
+ [key: string]: unknown;
1207
+ }
1066
1208
  /** Audio (TTS) model pricing block — price per 1,000 characters (post-markup). */
1067
1209
  interface AudioModelPricing {
1068
1210
  per_thousand_chars: number;
@@ -1711,4 +1853,4 @@ declare class DataFolder {
1711
1853
  private rebuildNameCache;
1712
1854
  }
1713
1855
 
1714
- export { type LLMModelPricing as $, type AiGatewayProvider as A, type BlobObject as B, type CallOptions as C, type DataStore as D, type ComputerServerInfo as E, type File as F, type ComputerState as G, type HttpContext as H, type ComputerType as I, type ComputerUser as J, type CreateTriggerInput as K, type DataCreateFolderInput as L, DataFolder as M, type DataUploadInput as N, type DatastoreEntry as O, type EscalateRequest as P, type ExecutionBackend as Q, type ExecutionRun as R, type ExecutionRunStatus as S, type FileList as T, type HttpRequest as U, type ImageGenerationResult as V, type WriteOptions as W, type ImageModel as X, type ImageModelPricing as Y, type LLMModel as Z, type LLMModelCapabilities as _, type AiGatewayUsageRow as a, type UsageRecord as a$, type ListEnvelope as a0, type ManagedProviderPreset as a1, type Message as a2, type MessageCostEntry as a3, type MessageCosts as a4, type ModelBase as a5, type ModelModality as a6, type Notification as a7, type NotificationConfig as a8, type NotificationPreference as a9, type ShareDeletedResult as aA, type SharePermission as aB, type ShareResourceType as aC, type SharedWithMeItem as aD, type SingleEnvelope as aE, type SpeechResult as aF, type SpeechStreamEvent as aG, type StoreInstallResult as aH, type StoreItem as aI, type StoreItemType as aJ, type StoredCredential as aK, type Subscription as aL, type SubscriptionPlan as aM, type TableCollection as aN, type TableRecord as aO, type TmuxWindow as aP, type TranscriptionResult as aQ, type TranscriptionStreamEvent as aR, type Trigger as aS, type TriggerActionType as aT, type TriggerCostStats as aU, type TriggerRun as aV, type TriggerType as aW, type TriggerWithSecret as aX, type TtsVoice as aY, type TtsVoiceGender as aZ, type UpdateTriggerInput as a_, type NotificationSenderKind as aa, type Pagination as ab, type Permission as ac, type ProviderEndpoint as ad, type ProviderEndpointConnectionType as ae, type ProviderEndpointKind as af, type ProviderEndpointModality as ag, type ProviderEndpointModelMapping as ah, type ProviderEndpointProtocol as ai, type ProviderEndpointProviderKey as aj, type ProviderEndpointRuntime as ak, type ProviderEndpointTestResult as al, type ProviderEndpointTransport as am, type ProviderEndpointVisibility as an, type QueryInput as ao, RemoteBundleReader as ap, type RepromptResult as aq, type RunCostMetrics as ar, type RuntimeMode as as, type SearchResult as at, type Secret as au, type SecretWithValue as av, type SendMessageResult as aw, type Settings as ax, type SftpEntry as ay, type Share as az, type DeletedResponse as b, type UsageSummary as b0, type User as b1, type WebSearchHit as b2, type WebSearchResponse as b3, type Workspace as b4, type WorkspaceInvitation as b5, type WorkspaceMember as b6, type WorkspaceMemberRole as b7, buildUrl as b8, request as b9, requestRaw as ba, type DataStoreUploadInput as c, type FileUploadResult as d, type DataStoreCreateFolderInput as e, type ConnectOptions as f, type Agent as g, type AgentRun as h, type AgentRunState as i, type ApiKey as j, AppFolder as k, type AudioModel as l, type AudioModelCapabilities as m, type AudioModelPricing as n, type AuthMode as o, type BundleReader as p, type Chat as q, type ChatCost as r, type ChatCostByCallType as s, type ChatStopResult as t, type ClientMeta as u, type Computer as v, type ComputerEnvVar as w, type ComputerExecResult as x, type ComputerLoggingLevel as y, type ComputerPort as z };
1856
+ export { type FunctionResource as $, type AiGatewayProvider as A, type BlobObject as B, type CallOptions as C, type DataStore as D, type ComputerLoggingLevel as E, type File as F, type ComputerPort as G, type HttpContext as H, type ComputerServerInfo as I, type ComputerState as J, type ComputerType as K, type ComputerUser as L, type CreateTriggerInput as M, type DataCreateFolderInput as N, type OperationHandle as O, DataFolder as P, type DataUploadInput as Q, type DatastoreEntry as R, type EscalateRequest as S, type ExecutionBackend as T, type ExecutionRun as U, type VideoModel as V, type WriteOptions as W, type ExecutionRunStatus as X, type FileList as Y, type FunctionDeployment as Z, type FunctionInvokeResult as _, type AiGatewayUsageRow as a, type TriggerActionType as a$, type FunctionRun as a0, type HttpRequest as a1, type ImageGenerationResult as a2, type ImageModel as a3, type ImageModelPricing as a4, type LLMModel as a5, type LLMModelCapabilities as a6, type LLMModelPricing as a7, type ListEnvelope as a8, type ManagedProviderPreset as a9, type RuntimeMode as aA, type SearchResult as aB, type Secret as aC, type SecretWithValue as aD, type SendMessageResult as aE, type Settings as aF, type SftpEntry as aG, type Share as aH, type ShareDeletedResult as aI, type SharePermission as aJ, type ShareResourceType as aK, type SharedWithMeItem as aL, type SingleEnvelope as aM, type SpeechResult as aN, type SpeechStreamEvent as aO, type StoreInstallResult as aP, type StoreItem as aQ, type StoreItemType as aR, type StoredCredential as aS, type Subscription as aT, type SubscriptionPlan as aU, type TableCollection as aV, type TableRecord as aW, type TmuxWindow as aX, type TranscriptionResult as aY, type TranscriptionStreamEvent as aZ, type Trigger as a_, type Message as aa, type MessageCostEntry as ab, type MessageCosts as ac, type ModelBase as ad, type ModelModality as ae, type Notification as af, type NotificationConfig as ag, type NotificationPreference as ah, type NotificationSenderKind as ai, type Pagination as aj, type Permission as ak, type ProviderEndpoint as al, type ProviderEndpointConnectionType as am, type ProviderEndpointKind as an, type ProviderEndpointModality as ao, type ProviderEndpointModelMapping as ap, type ProviderEndpointProtocol as aq, type ProviderEndpointProviderKey as ar, type ProviderEndpointRuntime as as, type ProviderEndpointTestResult as at, type ProviderEndpointTransport as au, type ProviderEndpointVisibility as av, type QueryInput as aw, RemoteBundleReader as ax, type RepromptResult as ay, type RunCostMetrics as az, type VideoModelSearchResult as b, type TriggerCostStats as b0, type TriggerRun as b1, type TriggerType as b2, type TriggerWithSecret as b3, type TtsVoice as b4, type TtsVoiceGender as b5, type UpdateTriggerInput as b6, type UsageRecord as b7, type UsageSummary as b8, type User as b9, type VideoModelCapabilities as ba, type VideoModelPricing as bb, type VideoModelRate as bc, type VideoModelSearchItem as bd, type WebSearchHit as be, type WebSearchResponse as bf, type Workspace as bg, type WorkspaceInvitation as bh, type WorkspaceMember as bi, type WorkspaceMemberRole as bj, buildUrl as bk, request as bl, requestRaw as bm, type VideoGenerationResult as c, type DeletedResponse as d, type DataStoreUploadInput as e, type FileUploadResult as f, type DataStoreCreateFolderInput as g, type ConnectOptions as h, type Agent as i, type AgentRun as j, type AgentRunState as k, type ApiKey as l, AppFolder as m, type AudioModel as n, type AudioModelCapabilities as o, type AudioModelPricing as p, type AuthMode as q, type BundleReader as r, type Chat as s, type ChatCost as t, type ChatCostByCallType as u, type ChatStopResult as v, type ClientMeta as w, type Computer as x, type ComputerEnvVar as y, type ComputerExecResult as z };