@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.
@@ -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 };