@idapt/browser-app-sdk 0.2.0 → 0.4.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/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IdaptClient } from './client-DjipcztO.cjs';
2
- export { A as AddMemberInput, a as AgentsApi, b as ApiKeysApi, c as AudioApi, B as BlobMeta, d as BlobsApi, e as BlobsListOptions, C as COMMAND_BINDINGS, f as ChannelHandle, g as ChatsApi, h as CommandBinding, i as ComputersApi, j as CreateAgentInput, k as CreateApiKeyInput, l as CreateChatInput, m as CreateCollectionInput, n as CreateComputerInput, o as CreateComputerUserInput, p as CreateFolderInput, q as CreateFunctionInput, r as CreateInvitationInput, s as CreateInvitationResult, t as CreateProviderEndpointInput, u as CreateSecretInput, v as CreateShareInput, w as CreateUserEnvVarInput, x as CreateWorkspaceInput, D as DatastoreApi, y as DatastoreListOptions, z as DatastoreSetOptions, E as DeleteInvitationResult, F as DeletedResult, G as DeployFunctionFile, H as DeployFunctionInput, J as DocsApi, K as ExecCommandInput, L as ExecuteCommandOptions, M as FilesApi, N as FireTriggerInput, O as FunctionPermissionInput, P as FunctionsApi, Q as GenerateImageInput, R as GuideApi, S as GuideContent, T as IdaptClientDeps, U as ImagesApi, V as InstallStoreItemInput, W as InvokeFunctionInput, X as ListAgentsQuery, Y as ListApiKeysQuery, Z as ListChatsQuery, _ as ListComputersQuery, $ as ListFilesQuery, a0 as ListFunctionRunsQuery, a1 as ListFunctionsQuery, a2 as ListMessagesQuery, a3 as ListNotificationsQuery, a4 as ListResult, a5 as ListRunsQuery, a6 as ListSharedWithMeQuery, a7 as ListSharesQuery, a8 as ListTriggerRunsQuery, a9 as ListUsageHistoryQuery, aa as ModelsApi, ab as NotificationAudience, ac as NotificationPreferenceUpdate, ad as NotificationsApi, ae as PairComputerInput, af as PairComputerResult, ag as PatchFileInput, ah as PatchPortInput, ai as PresenceEntry, aj as PresenceHeartbeatOptions, ak as ProviderEndpointModelMappingInput, al as ProviderEndpointsApi, am as RealtimeApi, an as RealtimeEvent, ao as RemoveShareInput, ap as RepromptMessageInput, aq as RotateApiKeyInput, ar as RotateApiKeyResult, as as RunFileInput, at as RunFunctionInput, au as SearchApi, av as SearchInput, aw as SearchStoreQuery, ax as SecretsApi, ay as SendMessageInput, az as SendNotificationInput, aA as SendNotificationResult, aB as SettingsApi, aC as SftpInput, aD as SftpListResult, aE as SftpOp, aF as SftpUploadInput, aG as SharingApi, aH as SpeakInput, aI as SseEvent, aJ as StoreApi, aK as SubscribeOptions, aL as SubscriptionApi, aM as TableQuery, aN as TablesApi, aO as TmuxInput, aP as TmuxOp, aQ as TranscribeInput, aR as TriggersApi, aS as UpdateAgentInput, aT as UpdateApiKeyInput, aU as UpdateChatInput, aV as UpdateCollectionInput, aW as UpdateComputerInput, aX as UpdateComputerUserInput, aY as UpdateFunctionInput, aZ as UpdateMemberInput, a_ as UpdateNotificationInput, a$ as UpdateProviderEndpointInput, b0 as UpdateSecretInput, b1 as UpdateSettingsInput, b2 as UpdateShareInput, b3 as UpdateWorkspaceInput, b4 as UploadInput, b5 as UserApi, b6 as V1CommandName, b7 as WebSearchApi, b8 as WebSearchInput, b9 as WorkspacesApi, ba as WritableMemberRole, bb as awaitOperation, bc as executeCommand, bd as getFileBlob, be as getFileText, bf as listFiles } from './client-DjipcztO.cjs';
3
- import { H as HttpContext, C as CallOptions, A as AiGatewayProvider, a as AiGatewayUsageRow, V as VideoModel, b as VideoModelSearchResult, O as OperationHandle, c as VideoGenerationResult, D as DataStore, F as File, W as WriteOptions, d as DeletedResponse, e as DataStoreUploadInput, f as FileUploadResult, g as DataStoreCreateFolderInput, h as ConnectOptions } from './data-BuXXki1D.cjs';
4
- export { i as Agent, j as AgentRun, k as AgentRunState, l as ApiKey, m as AppFolder, n as AudioModel, o as AudioModelCapabilities, p as AudioModelPricing, q as AuthMode, B as BlobObject, r as BundleReader, s as Chat, t as ChatCost, u as ChatCostByCallType, v as ChatStopResult, w as ClientMeta, x as Computer, y as ComputerEnvVar, z as ComputerExecResult, E as ComputerLoggingLevel, G as ComputerPort, I as ComputerServerInfo, J as ComputerState, K as ComputerType, L as ComputerUser, M as CreateTriggerInput, N as DataCreateFolderInput, P as DataFolder, Q as DataUploadInput, R as DatastoreEntry, S as EscalateRequest, T as ExecutionBackend, U as ExecutionRun, X as ExecutionRunStatus, Y as FileList, Z as FunctionDeployment, _ as FunctionInvokeResult, $ as FunctionResource, a0 as FunctionRun, a1 as HttpRequest, a2 as ImageGenerationResult, a3 as ImageModel, a4 as ImageModelPricing, a5 as LLMModel, a6 as LLMModelCapabilities, a7 as LLMModelPricing, a8 as ListEnvelope, a9 as ManagedProviderPreset, aa as Message, ab as MessageCostEntry, ac as MessageCosts, ad as ModelBase, ae as ModelModality, af as Notification, ag as NotificationConfig, ah as NotificationPreference, ai as NotificationSenderKind, aj as Pagination, ak as Permission, al as ProviderEndpoint, am as ProviderEndpointConnectionType, an as ProviderEndpointKind, ao as ProviderEndpointModality, ap as ProviderEndpointModelMapping, aq as ProviderEndpointProtocol, ar as ProviderEndpointProviderKey, as as ProviderEndpointRuntime, at as ProviderEndpointTestResult, au as ProviderEndpointTransport, av as ProviderEndpointVisibility, aw as QueryInput, ax as RemoteBundleReader, ay as RepromptResult, az as RunCostMetrics, aA as RuntimeMode, aB as SearchResult, aC as Secret, aD as SecretWithValue, aE as SendMessageResult, aF as Settings, aG as SftpEntry, aH as Share, aI as ShareDeletedResult, aJ as SharePermission, aK as ShareResourceType, aL as SharedWithMeItem, aM as SingleEnvelope, aN as SpeechResult, aO as SpeechStreamEvent, aP as StoreInstallResult, aQ as StoreItem, aR as StoreItemType, aS as StoredCredential, aT as Subscription, aU as SubscriptionPlan, aV as TableCollection, aW as TableRecord, aX as TmuxWindow, aY as TranscriptionResult, aZ as TranscriptionStreamEvent, a_ as Trigger, a$ as TriggerActionType, b0 as TriggerCostStats, b1 as TriggerRun, b2 as TriggerType, b3 as TriggerWithSecret, b4 as TtsVoice, b5 as TtsVoiceGender, b6 as UpdateTriggerInput, b7 as UsageRecord, b8 as UsageSummary, b9 as User, ba as VideoModelCapabilities, bb as VideoModelPricing, bc as VideoModelRate, bd as VideoModelSearchItem, be as WebSearchHit, bf as WebSearchResponse, bg as Workspace, bh as WorkspaceInvitation, bi as WorkspaceMember, bj as WorkspaceMemberRole, bk as buildUrl, bl as request, bm as requestRaw } from './data-BuXXki1D.cjs';
1
+ import { E as ExecuteCommandOptions, I as IdaptClient } from './client-BvCqz1Eu.cjs';
2
+ export { A as AddMemberInput, a as AgentsApi, b as ApiKeysApi, c as AudioApi, d as AutomationsApi, C as COMMAND_BINDINGS, e as ChannelHandle, f as ChatsApi, g as CommandBinding, h as ComputersApi, i as CreateAgentInput, j as CreateApiKeyInput, k as CreateChatInput, l as CreateComputerInput, m as CreateComputerUserInput, n as CreateFolderInput, o as CreateInvitationInput, p as CreateInvitationResult, q as CreateProviderEndpointInput, r as CreateSecretInput, s as CreateShareInput, t as CreateUserEnvVarInput, u as CreateWorkspaceInput, D as DeleteInvitationResult, v as DeletedResult, w as DocsApi, x as ExecCommandInput, F as FilesApi, y as FireAutomationInput, z as FsInput, B as FsListResult, G as FsOp, H as FsUploadInput, J as GuideApi, K as GuideContent, L as IdaptClientDeps, M as ImagesApi, N as ListAgentsQuery, O as ListApiKeysQuery, P as ListAutomationRunsQuery, Q as ListChatsQuery, R as ListComputersQuery, S as ListFilesQuery, T as ListMessagesQuery, U as ListNotificationsQuery, V as ListResult, W as ListRunsQuery, X as ListSharedWithMeQuery, Y as ListSharesQuery, Z as ListUsageHistoryQuery, _ as ListVoicesInput, $ as ModelsApi, a0 as NotificationAudience, a1 as NotificationPreferenceUpdate, a2 as NotificationsApi, a3 as PairComputerInput, a4 as PairComputerResult, a5 as PatchFileInput, a6 as PatchPortInput, a7 as PresenceEntry, a8 as PresenceHeartbeatOptions, a9 as ProviderEndpointModelMappingInput, aa as ProviderEndpointsApi, ab as RealtimeApi, ac as RealtimeEvent, ad as RemoveShareInput, ae as RepromptMessageInput, af as RotateApiKeyInput, ag as RotateApiKeyResult, ah as SearchApi, ai as SearchInput, aj as SecretsApi, ak as SendMessageInput, al as SendNotificationInput, am as SendNotificationResult, an as SettingsApi, ao as SharingApi, ap as SseEvent, aq as SubscribeOptions, ar as SubscriptionApi, as as TerminalInput, at as TerminalOp, au as UpdateAgentInput, av as UpdateApiKeyInput, aw as UpdateChatInput, ax as UpdateComputerInput, ay as UpdateComputerUserInput, az as UpdateMemberInput, aA as UpdateNotificationInput, aB as UpdateProviderEndpointInput, aC as UpdateSecretInput, aD as UpdateSettingsInput, aE as UpdateShareInput, aF as UpdateWorkspaceInput, aG as UploadInput, aH as UserApi, aI as V1CommandName, aJ as WebSearchApi, aK as WebSearchInput, aL as WorkspacesApi, aM as WritableMemberRole, aN as awaitOperation, aO as executeCommand, aP as getFileBlob, aQ as getFileText, aR as listFiles } from './client-BvCqz1Eu.cjs';
3
+ import { H as HttpContext, C as CallOptions, A as AiGatewayProvider, a as AiGatewayUsageRow, b as AiGatewayRoutePreviewCapabilities, c as AiGatewayRoutePreview, O as OperationHandle, I as ImageGenerationResult, V as VideoGenerationResult, S as SpeechResult, L as ListEnvelope, d as VideoModel, e as VideoModelSearchResult, D as DataStore, F as File, W as WriteOptions, f as DeletedResponse, g as DataStoreUploadInput, h as FileUploadResult, i as DataStoreCreateFolderInput, j as ConnectOptions } from './data-BEWuiL70.cjs';
4
+ export { k as Agent, l as AgentRun, m as AgentRunState, n as AiGatewayRoutePreviewOption, o as AiGatewayRoutePreviewSkippedOption, p as ApiKey, q as AppFolder, r as AudioModel, s as AudioModelCapabilities, t as AudioModelPricing, u as AuthMode, v as Automation, w as AutomationActionType, x as AutomationCostStats, y as AutomationRun, z as AutomationWithSecret, B as BundleReader, E as Chat, G as ChatCost, J as ChatCostByCallType, K as ChatStopResult, M as ClientMeta, N as Computer, P as ComputerEnvVar, Q as ComputerExecResult, R as ComputerLoggingLevel, T as ComputerPort, U as ComputerServerInfo, X as ComputerState, Y as ComputerType, Z as ComputerUser, _ as CreateAutomationInput, $ as DataCreateFolderInput, a0 as DataFolder, a1 as DataUploadInput, a2 as EscalateRequest, a3 as FileList, a4 as FsEntry, a5 as FunctionDeployment, a6 as FunctionInvokeResult, a7 as FunctionResource, a8 as HttpRequest, a9 as ImageModel, aa as ImageModelPricing, ab as LLMModel, ac as LLMModelArchitecture, ad as LLMModelArchitectureType, ae as LLMModelCapabilities, af as LLMModelLocalInference, ag as LLMModelLocalInferenceVariant, ah as LLMModelPricing, ai as ManagedProviderPreset, aj as Message, ak as MessageCostEntry, al as MessageCosts, am as ModelBase, an as ModelModality, ao as Notification, ap as NotificationConfig, aq as NotificationPreference, ar as NotificationSenderKind, as as Pagination, at as Permission, au as ProviderEndpoint, av as ProviderEndpointConnectionType, aw as ProviderEndpointKind, ax as ProviderEndpointModality, ay as ProviderEndpointModelMapping, az as ProviderEndpointProtocol, aA as ProviderEndpointProviderKey, aB as ProviderEndpointRuntime, aC as ProviderEndpointTestResult, aD as ProviderEndpointTransport, aE as ProviderEndpointVisibility, aF as QueryInput, aG as RemoteBundleReader, aH as RepromptResult, aI as RunCostMetrics, aJ as RuntimeMode, aK as SearchResult, aL as Secret, aM as SecretWithValue, aN as SendMessageResult, aO as Settings, aP as Share, aQ as ShareDeletedResult, aR as SharePermission, aS as ShareResourceType, aT as SharedWithMeItem, aU as SingleEnvelope, aV as SpeechStreamEvent, aW as StoreInstallResult, aX as StoreItem, aY as StoreItemType, aZ as StoredCredential, a_ as Subscription, a$ as SubscriptionPlan, b0 as TerminalWindow, b1 as TranscriptionResult, b2 as TranscriptionStreamEvent, b3 as TriggerType, b4 as TtsVoice, b5 as TtsVoiceGender, b6 as UpdateAutomationInput, b7 as UsageRecord, b8 as UsageSummary, b9 as User, ba as VideoModelCapabilities, bb as VideoModelPricing, bc as VideoModelRate, bd as VideoModelSearchItem, be as WebSearchHit, bf as WebSearchResponse, bg as Workspace, bh as WorkspaceInvitation, bi as WorkspaceMember, bj as WorkspaceMemberRole, bk as buildUrl, bl as request, bm as requestRaw } from './data-BEWuiL70.cjs';
5
5
  import 'zod';
6
6
 
7
7
  /**
@@ -24,6 +24,16 @@ interface AiGatewayUsageOptions extends CallOptions {
24
24
  /** Look-back window in days (1–365, default 30). */
25
25
  windowDays?: number;
26
26
  }
27
+ interface AiGatewayRoutePreviewInput extends CallOptions {
28
+ /** Idapt/OpenRouter-style model id to route, for example `openai/gpt-5.5`. */
29
+ modelId: string;
30
+ /** Public workspace id or internal UUID — defaults to the caller's workspace. */
31
+ workspaceId?: string;
32
+ /** Estimated prompt/input tokens for request-window filtering. */
33
+ promptTokens?: number;
34
+ /** Endpoint capabilities required by this request shape. */
35
+ requiredCapabilities?: AiGatewayRoutePreviewCapabilities;
36
+ }
27
37
  declare class AiGatewayApi {
28
38
  private readonly ctx;
29
39
  constructor(ctx: HttpContext);
@@ -31,52 +41,157 @@ declare class AiGatewayApi {
31
41
  providers(opts?: AiGatewayProvidersOptions): Promise<AiGatewayProvider[]>;
32
42
  /** Per-model / per-provider usage breakdown over a window. */
33
43
  usage(opts?: AiGatewayUsageOptions): Promise<AiGatewayUsageRow[]>;
44
+ /** Preview the provider route order for a model without spending tokens. */
45
+ routePreview(input: AiGatewayRoutePreviewInput): Promise<AiGatewayRoutePreview>;
34
46
  }
35
47
 
36
48
  /**
37
- * VideosApi — `/api/v1/videos/*`.
49
+ * InferenceApi — `/api/v1/inference/*`.
38
50
  *
39
- * Video generation is ASYNC (renders take ~30s–several minutes):
40
- * - `POST /videos/generations` HTTP 202 with an OPERATION HANDLE
41
- * (`{id: "mg_…", status: "pending"}`), never an inline result.
42
- * - `GET /videos/models` / `GET /videos/models/search` the catalogue
43
- * (per-second pricing with a per-resolution rate table + fixed
44
- * duration/resolution options).
51
+ * The unified one-shot generation surface (distinct from `client.chats`, the
52
+ * stateful agent loop). Every verb returns the result inline, or — for
53
+ * inherently-async modalities (video) or `background: true` an operation
54
+ * handle that this facade polls to completion (pass `wait: false` to get the
55
+ * handle back and poll yourself via `client.operations`).
45
56
  *
46
- * `generate()` polls the operation to completion by default (wide cadence —
47
- * 5s × 240, a ~20-minute ceiling) and resolves with the completed payload
48
- * `{file_id, path, url, model, cost_usd, duration_seconds, resolution}`.
49
- * Pass `wait: false` to get the handle back immediately and poll yourself
50
- * via `client.operations.get(id)` / cancel via `client.operations.cancel(id)`.
57
+ * `inference text` is the net-new one-shot LLM verb (message-based). Streaming
58
+ * variants (`inference text-stream`, etc.) are SSE use `client.call` or the
59
+ * raw endpoints for those.
51
60
  */
52
61
 
53
- interface GenerateVideoInput {
62
+ interface InferenceTextMessage {
63
+ role: "system" | "user" | "assistant" | "tool";
64
+ content?: string | Array<Record<string, unknown>> | null;
65
+ name?: string;
66
+ tool_call_id?: string;
67
+ tool_calls?: Array<Record<string, unknown>>;
68
+ }
69
+ interface InferenceTextInput {
70
+ messages: InferenceTextMessage[];
71
+ model?: string;
72
+ max_tokens?: number;
73
+ temperature?: number;
74
+ top_p?: number;
75
+ stop?: string | string[];
76
+ response_format?: Record<string, unknown>;
77
+ tools?: Array<Record<string, unknown>>;
78
+ tool_choice?: string | Record<string, unknown>;
79
+ workspace_id?: string;
80
+ /** Return an operation handle immediately instead of the inline completion. */
81
+ background?: boolean;
82
+ }
83
+ interface InferenceTextResult {
84
+ id?: string | null;
85
+ model: string;
86
+ content: string;
87
+ finish_reason?: string | null;
88
+ tool_calls?: Array<Record<string, unknown>> | null;
89
+ usage?: {
90
+ input_tokens?: number | null;
91
+ output_tokens?: number | null;
92
+ cost_usd?: number | null;
93
+ } | null;
94
+ }
95
+ interface InferenceImageInput {
96
+ prompt: string;
97
+ workspace_id: string;
98
+ model?: string;
99
+ output_path?: string;
100
+ reference_image_ids?: string[];
101
+ reference_image_paths?: string[];
102
+ aspect_ratio?: string;
103
+ background?: boolean;
104
+ }
105
+ interface InferenceVideoInput {
54
106
  prompt: string;
55
107
  workspace_id: string;
56
108
  model?: string;
57
- /** Must be one of the model's fixed duration options (see the catalog). */
58
109
  duration_seconds?: number;
59
- /** Must be a resolution the model advertises, e.g. "720p". */
60
110
  resolution?: string;
61
111
  aspect_ratio?: string;
62
- /** Generate native audio (audio-capable models only). */
63
112
  generate_audio?: boolean;
64
113
  output_path?: string;
65
- /** Reference images for image-to-video. */
66
114
  reference_image_ids?: string[];
67
115
  reference_image_paths?: string[];
68
- /** Input video for video-to-video (e.g. model `runway-aleph-2`). */
69
116
  video_reference_id?: string;
70
117
  video_reference_path?: string;
71
118
  }
72
- interface GenerateVideoOptions extends CallOptions {
73
- /** Default true — poll the operation to completion. False → return the handle. */
74
- wait?: boolean;
75
- /** Override the poll cadence (default: the contract's 5000ms). */
76
- pollIntervalMs?: number;
77
- /** Override the poll ceiling (default: the contract's 240 attempts). */
78
- maxPollAttempts?: number;
119
+ interface InferenceSpeechInput {
120
+ text: string;
121
+ workspace_id: string;
122
+ model?: string;
123
+ voice?: string;
124
+ speed?: number;
125
+ pitch?: number;
126
+ emotion?: string;
127
+ output_path?: string;
128
+ background?: boolean;
129
+ }
130
+ /** Delivery/poll options — `wait: false` returns the operation handle. */
131
+ type InferenceOptions = ExecuteCommandOptions;
132
+ declare class InferenceApi {
133
+ private readonly ctx;
134
+ constructor(ctx: HttpContext);
135
+ /** One-shot LLM completion (message-based). */
136
+ text(input: InferenceTextInput, opts?: InferenceOptions): Promise<InferenceTextResult | OperationHandle>;
137
+ /** Generate an image from a prompt. */
138
+ image(input: InferenceImageInput, opts?: InferenceOptions): Promise<ImageGenerationResult | OperationHandle>;
139
+ /** Generate a video (ALWAYS async — polls to completion unless `wait:false`). */
140
+ video(input: InferenceVideoInput, opts?: InferenceOptions): Promise<VideoGenerationResult | OperationHandle>;
141
+ /** Synthesize speech from text (TTS). */
142
+ speech(input: InferenceSpeechInput, opts?: InferenceOptions): Promise<SpeechResult | OperationHandle>;
79
143
  }
144
+
145
+ /**
146
+ * OperationsApi — `/api/v1/operations/*`.
147
+ *
148
+ * The unified async-operation surface. An operation is any long-running job —
149
+ * async inference (`inf_…` ids: video today, more later) OR code/computer
150
+ * execution runs — projected onto one contract. Poll `get(id)` to a terminal
151
+ * status, `list()` recent operations, `cancel(id)` an in-flight one.
152
+ */
153
+
154
+ /** A projected async operation (the shared `OperationResponse` contract). */
155
+ interface Operation {
156
+ id: string;
157
+ status: "pending" | "running" | "completed" | "failed" | "cancelled";
158
+ /** The `${resource} ${verb}` that produced it, e.g. `"inference video"`. */
159
+ tool: string | null;
160
+ /** The unwrapped result payload once `completed`. */
161
+ result: unknown;
162
+ /** The structured error once `failed`. */
163
+ error: unknown;
164
+ created_at?: string;
165
+ started_at: string | null;
166
+ completed_at: string | null;
167
+ }
168
+ interface ListOperationsInput {
169
+ status?: "pending" | "running" | "completed" | "failed" | "cancelled";
170
+ limit?: number;
171
+ cursor?: string;
172
+ }
173
+ declare class OperationsApi {
174
+ private readonly ctx;
175
+ constructor(ctx: HttpContext);
176
+ /** Fetch one operation by its handle id (`inf_…` / execution-run id). */
177
+ get(id: string, opts?: CallOptions): Promise<Operation>;
178
+ /** List the caller's recent operations, newest first (keyset-paginated). */
179
+ list(input?: ListOperationsInput, opts?: CallOptions): Promise<ListEnvelope<Operation>>;
180
+ /** Request cancellation (idempotent — a terminal op is returned as-is). */
181
+ cancel(id: string, opts?: CallOptions): Promise<Operation>;
182
+ }
183
+
184
+ /**
185
+ * VideosApi — video-model DISCOVERY (`GET /api/v1/videos/models` +
186
+ * `/videos/models/search`).
187
+ *
188
+ * Video GENERATION moved to the unified inference surface — use
189
+ * `client.inference.video({ prompt, workspace_id, … })` (ALWAYS async; polls
190
+ * to completion unless `wait: false`). This namespace now exposes only the
191
+ * model catalog (per-second pricing with a per-resolution rate table + fixed
192
+ * duration/resolution options); model discovery stays per-modality by design.
193
+ */
194
+
80
195
  interface SearchVideoModelsInput {
81
196
  query?: string;
82
197
  provider?: string;
@@ -89,20 +204,17 @@ interface SearchVideoModelsInput {
89
204
  declare class VideosApi {
90
205
  private readonly ctx;
91
206
  constructor(ctx: HttpContext);
207
+ /** List the available video-generation models. */
92
208
  listModels(opts?: CallOptions): Promise<VideoModel[]>;
209
+ /** Search the video-model registry (filtered + paginated envelope). */
93
210
  searchModels(input?: SearchVideoModelsInput, opts?: CallOptions): Promise<VideoModelSearchResult>;
94
- /**
95
- * Start a video generation. With `wait` (default) polls the operation to
96
- * a terminal status and resolves the completed payload (throws a typed
97
- * error on failure/cancel); with `wait: false` resolves the 202 handle
98
- * immediately.
99
- */
100
- generate(input: GenerateVideoInput, opts: GenerateVideoOptions & {
101
- wait: false;
102
- }): Promise<OperationHandle>;
103
- generate(input: GenerateVideoInput, opts?: GenerateVideoOptions): Promise<VideoGenerationResult>;
104
211
  }
105
212
 
213
+ /** Public API version this SDK release targets. */
214
+ declare const IDAPT_API_VERSION = "2026-07-12";
215
+ /** Header used by Idapt's native public API versioning. */
216
+ declare const IDAPT_API_VERSION_HEADER = "x-idapt-version";
217
+
106
218
  /**
107
219
  * IdaptClient — the generic, isomorphic Idapt v1 API client.
108
220
  *
@@ -232,7 +344,7 @@ declare class InvalidRequestError extends IdaptError {
232
344
  * this is **retryable**: `retryable` is always `true` and `retryAfter`
233
345
  * carries the server's `retry_after` hint when one is present.
234
346
  *
235
- * Returned by the computer `exec` / `tmux` / `sftp` endpoints and
347
+ * Returned by the computer `exec` / `terminal` / `fs` endpoints and
236
348
  * `POST /v1/audio/transcriptions`.
237
349
  */
238
350
  declare class ServiceUnavailableError extends IdaptError {
@@ -439,4 +551,4 @@ declare const Idapt: {
439
551
  connect: typeof connect;
440
552
  };
441
553
 
442
- export { AiGatewayApi, AiGatewayProvider, type AiGatewayProvidersOptions, type AiGatewayUsageOptions, AiGatewayUsageRow, AuthError, CallOptions, ConflictError, ConnectOptions, DataStore, DataStoreCreateFolderInput, DataStoreUploadInput, type DefaultConnectConfig, DeletedResponse, File, FileUploadResult, type GenerateVideoInput, type GenerateVideoOptions, HttpContext, Idapt, IdaptClient, type IdaptClientOptions, IdaptError, type IdaptErrorCode, type IdaptErrorInit, type IdaptErrorSubCode, type IdaptErrorType, type IdaptRedirectingError, InvalidRequestError, type LocationLike, NetworkError, NotFoundError, OperationHandle, PermissionError, RateLimitError, RemoteDataStore, type SearchVideoModelsInput, ServerError, ServiceUnavailableError, VERSION, VideoGenerationResult, VideoModel, VideoModelSearchResult, VideosApi, WriteOptions, connect, detectAppId, errorFromStatus, getAppBaseUrl, makeConnect };
554
+ export { AiGatewayApi, AiGatewayProvider, type AiGatewayProvidersOptions, AiGatewayRoutePreview, AiGatewayRoutePreviewCapabilities, type AiGatewayRoutePreviewInput, type AiGatewayUsageOptions, AiGatewayUsageRow, AuthError, CallOptions, ConflictError, ConnectOptions, DataStore, DataStoreCreateFolderInput, DataStoreUploadInput, type DefaultConnectConfig, DeletedResponse, ExecuteCommandOptions, File, FileUploadResult, HttpContext, IDAPT_API_VERSION, IDAPT_API_VERSION_HEADER, Idapt, IdaptClient, type IdaptClientOptions, IdaptError, type IdaptErrorCode, type IdaptErrorInit, type IdaptErrorSubCode, type IdaptErrorType, type IdaptRedirectingError, ImageGenerationResult, InferenceApi, type InferenceImageInput, type InferenceSpeechInput, type InferenceTextInput, type InferenceTextMessage, type InferenceTextResult, type InferenceVideoInput, InvalidRequestError, ListEnvelope, type ListOperationsInput, type LocationLike, NetworkError, NotFoundError, type Operation, OperationHandle, OperationsApi, PermissionError, RateLimitError, RemoteDataStore, type SearchVideoModelsInput, ServerError, ServiceUnavailableError, SpeechResult, VERSION, VideoGenerationResult, VideoModel, VideoModelSearchResult, VideosApi, WriteOptions, connect, detectAppId, errorFromStatus, getAppBaseUrl, makeConnect };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IdaptClient } from './client-CZAWglsD.js';
2
- export { A as AddMemberInput, a as AgentsApi, b as ApiKeysApi, c as AudioApi, B as BlobMeta, d as BlobsApi, e as BlobsListOptions, C as COMMAND_BINDINGS, f as ChannelHandle, g as ChatsApi, h as CommandBinding, i as ComputersApi, j as CreateAgentInput, k as CreateApiKeyInput, l as CreateChatInput, m as CreateCollectionInput, n as CreateComputerInput, o as CreateComputerUserInput, p as CreateFolderInput, q as CreateFunctionInput, r as CreateInvitationInput, s as CreateInvitationResult, t as CreateProviderEndpointInput, u as CreateSecretInput, v as CreateShareInput, w as CreateUserEnvVarInput, x as CreateWorkspaceInput, D as DatastoreApi, y as DatastoreListOptions, z as DatastoreSetOptions, E as DeleteInvitationResult, F as DeletedResult, G as DeployFunctionFile, H as DeployFunctionInput, J as DocsApi, K as ExecCommandInput, L as ExecuteCommandOptions, M as FilesApi, N as FireTriggerInput, O as FunctionPermissionInput, P as FunctionsApi, Q as GenerateImageInput, R as GuideApi, S as GuideContent, T as IdaptClientDeps, U as ImagesApi, V as InstallStoreItemInput, W as InvokeFunctionInput, X as ListAgentsQuery, Y as ListApiKeysQuery, Z as ListChatsQuery, _ as ListComputersQuery, $ as ListFilesQuery, a0 as ListFunctionRunsQuery, a1 as ListFunctionsQuery, a2 as ListMessagesQuery, a3 as ListNotificationsQuery, a4 as ListResult, a5 as ListRunsQuery, a6 as ListSharedWithMeQuery, a7 as ListSharesQuery, a8 as ListTriggerRunsQuery, a9 as ListUsageHistoryQuery, aa as ModelsApi, ab as NotificationAudience, ac as NotificationPreferenceUpdate, ad as NotificationsApi, ae as PairComputerInput, af as PairComputerResult, ag as PatchFileInput, ah as PatchPortInput, ai as PresenceEntry, aj as PresenceHeartbeatOptions, ak as ProviderEndpointModelMappingInput, al as ProviderEndpointsApi, am as RealtimeApi, an as RealtimeEvent, ao as RemoveShareInput, ap as RepromptMessageInput, aq as RotateApiKeyInput, ar as RotateApiKeyResult, as as RunFileInput, at as RunFunctionInput, au as SearchApi, av as SearchInput, aw as SearchStoreQuery, ax as SecretsApi, ay as SendMessageInput, az as SendNotificationInput, aA as SendNotificationResult, aB as SettingsApi, aC as SftpInput, aD as SftpListResult, aE as SftpOp, aF as SftpUploadInput, aG as SharingApi, aH as SpeakInput, aI as SseEvent, aJ as StoreApi, aK as SubscribeOptions, aL as SubscriptionApi, aM as TableQuery, aN as TablesApi, aO as TmuxInput, aP as TmuxOp, aQ as TranscribeInput, aR as TriggersApi, aS as UpdateAgentInput, aT as UpdateApiKeyInput, aU as UpdateChatInput, aV as UpdateCollectionInput, aW as UpdateComputerInput, aX as UpdateComputerUserInput, aY as UpdateFunctionInput, aZ as UpdateMemberInput, a_ as UpdateNotificationInput, a$ as UpdateProviderEndpointInput, b0 as UpdateSecretInput, b1 as UpdateSettingsInput, b2 as UpdateShareInput, b3 as UpdateWorkspaceInput, b4 as UploadInput, b5 as UserApi, b6 as V1CommandName, b7 as WebSearchApi, b8 as WebSearchInput, b9 as WorkspacesApi, ba as WritableMemberRole, bb as awaitOperation, bc as executeCommand, bd as getFileBlob, be as getFileText, bf as listFiles } from './client-CZAWglsD.js';
3
- import { H as HttpContext, C as CallOptions, A as AiGatewayProvider, a as AiGatewayUsageRow, V as VideoModel, b as VideoModelSearchResult, O as OperationHandle, c as VideoGenerationResult, D as DataStore, F as File, W as WriteOptions, d as DeletedResponse, e as DataStoreUploadInput, f as FileUploadResult, g as DataStoreCreateFolderInput, h as ConnectOptions } from './data-BuXXki1D.js';
4
- export { i as Agent, j as AgentRun, k as AgentRunState, l as ApiKey, m as AppFolder, n as AudioModel, o as AudioModelCapabilities, p as AudioModelPricing, q as AuthMode, B as BlobObject, r as BundleReader, s as Chat, t as ChatCost, u as ChatCostByCallType, v as ChatStopResult, w as ClientMeta, x as Computer, y as ComputerEnvVar, z as ComputerExecResult, E as ComputerLoggingLevel, G as ComputerPort, I as ComputerServerInfo, J as ComputerState, K as ComputerType, L as ComputerUser, M as CreateTriggerInput, N as DataCreateFolderInput, P as DataFolder, Q as DataUploadInput, R as DatastoreEntry, S as EscalateRequest, T as ExecutionBackend, U as ExecutionRun, X as ExecutionRunStatus, Y as FileList, Z as FunctionDeployment, _ as FunctionInvokeResult, $ as FunctionResource, a0 as FunctionRun, a1 as HttpRequest, a2 as ImageGenerationResult, a3 as ImageModel, a4 as ImageModelPricing, a5 as LLMModel, a6 as LLMModelCapabilities, a7 as LLMModelPricing, a8 as ListEnvelope, a9 as ManagedProviderPreset, aa as Message, ab as MessageCostEntry, ac as MessageCosts, ad as ModelBase, ae as ModelModality, af as Notification, ag as NotificationConfig, ah as NotificationPreference, ai as NotificationSenderKind, aj as Pagination, ak as Permission, al as ProviderEndpoint, am as ProviderEndpointConnectionType, an as ProviderEndpointKind, ao as ProviderEndpointModality, ap as ProviderEndpointModelMapping, aq as ProviderEndpointProtocol, ar as ProviderEndpointProviderKey, as as ProviderEndpointRuntime, at as ProviderEndpointTestResult, au as ProviderEndpointTransport, av as ProviderEndpointVisibility, aw as QueryInput, ax as RemoteBundleReader, ay as RepromptResult, az as RunCostMetrics, aA as RuntimeMode, aB as SearchResult, aC as Secret, aD as SecretWithValue, aE as SendMessageResult, aF as Settings, aG as SftpEntry, aH as Share, aI as ShareDeletedResult, aJ as SharePermission, aK as ShareResourceType, aL as SharedWithMeItem, aM as SingleEnvelope, aN as SpeechResult, aO as SpeechStreamEvent, aP as StoreInstallResult, aQ as StoreItem, aR as StoreItemType, aS as StoredCredential, aT as Subscription, aU as SubscriptionPlan, aV as TableCollection, aW as TableRecord, aX as TmuxWindow, aY as TranscriptionResult, aZ as TranscriptionStreamEvent, a_ as Trigger, a$ as TriggerActionType, b0 as TriggerCostStats, b1 as TriggerRun, b2 as TriggerType, b3 as TriggerWithSecret, b4 as TtsVoice, b5 as TtsVoiceGender, b6 as UpdateTriggerInput, b7 as UsageRecord, b8 as UsageSummary, b9 as User, ba as VideoModelCapabilities, bb as VideoModelPricing, bc as VideoModelRate, bd as VideoModelSearchItem, be as WebSearchHit, bf as WebSearchResponse, bg as Workspace, bh as WorkspaceInvitation, bi as WorkspaceMember, bj as WorkspaceMemberRole, bk as buildUrl, bl as request, bm as requestRaw } from './data-BuXXki1D.js';
1
+ import { E as ExecuteCommandOptions, I as IdaptClient } from './client-BbDOj8l_.js';
2
+ export { A as AddMemberInput, a as AgentsApi, b as ApiKeysApi, c as AudioApi, d as AutomationsApi, C as COMMAND_BINDINGS, e as ChannelHandle, f as ChatsApi, g as CommandBinding, h as ComputersApi, i as CreateAgentInput, j as CreateApiKeyInput, k as CreateChatInput, l as CreateComputerInput, m as CreateComputerUserInput, n as CreateFolderInput, o as CreateInvitationInput, p as CreateInvitationResult, q as CreateProviderEndpointInput, r as CreateSecretInput, s as CreateShareInput, t as CreateUserEnvVarInput, u as CreateWorkspaceInput, D as DeleteInvitationResult, v as DeletedResult, w as DocsApi, x as ExecCommandInput, F as FilesApi, y as FireAutomationInput, z as FsInput, B as FsListResult, G as FsOp, H as FsUploadInput, J as GuideApi, K as GuideContent, L as IdaptClientDeps, M as ImagesApi, N as ListAgentsQuery, O as ListApiKeysQuery, P as ListAutomationRunsQuery, Q as ListChatsQuery, R as ListComputersQuery, S as ListFilesQuery, T as ListMessagesQuery, U as ListNotificationsQuery, V as ListResult, W as ListRunsQuery, X as ListSharedWithMeQuery, Y as ListSharesQuery, Z as ListUsageHistoryQuery, _ as ListVoicesInput, $ as ModelsApi, a0 as NotificationAudience, a1 as NotificationPreferenceUpdate, a2 as NotificationsApi, a3 as PairComputerInput, a4 as PairComputerResult, a5 as PatchFileInput, a6 as PatchPortInput, a7 as PresenceEntry, a8 as PresenceHeartbeatOptions, a9 as ProviderEndpointModelMappingInput, aa as ProviderEndpointsApi, ab as RealtimeApi, ac as RealtimeEvent, ad as RemoveShareInput, ae as RepromptMessageInput, af as RotateApiKeyInput, ag as RotateApiKeyResult, ah as SearchApi, ai as SearchInput, aj as SecretsApi, ak as SendMessageInput, al as SendNotificationInput, am as SendNotificationResult, an as SettingsApi, ao as SharingApi, ap as SseEvent, aq as SubscribeOptions, ar as SubscriptionApi, as as TerminalInput, at as TerminalOp, au as UpdateAgentInput, av as UpdateApiKeyInput, aw as UpdateChatInput, ax as UpdateComputerInput, ay as UpdateComputerUserInput, az as UpdateMemberInput, aA as UpdateNotificationInput, aB as UpdateProviderEndpointInput, aC as UpdateSecretInput, aD as UpdateSettingsInput, aE as UpdateShareInput, aF as UpdateWorkspaceInput, aG as UploadInput, aH as UserApi, aI as V1CommandName, aJ as WebSearchApi, aK as WebSearchInput, aL as WorkspacesApi, aM as WritableMemberRole, aN as awaitOperation, aO as executeCommand, aP as getFileBlob, aQ as getFileText, aR as listFiles } from './client-BbDOj8l_.js';
3
+ import { H as HttpContext, C as CallOptions, A as AiGatewayProvider, a as AiGatewayUsageRow, b as AiGatewayRoutePreviewCapabilities, c as AiGatewayRoutePreview, O as OperationHandle, I as ImageGenerationResult, V as VideoGenerationResult, S as SpeechResult, L as ListEnvelope, d as VideoModel, e as VideoModelSearchResult, D as DataStore, F as File, W as WriteOptions, f as DeletedResponse, g as DataStoreUploadInput, h as FileUploadResult, i as DataStoreCreateFolderInput, j as ConnectOptions } from './data-BEWuiL70.js';
4
+ export { k as Agent, l as AgentRun, m as AgentRunState, n as AiGatewayRoutePreviewOption, o as AiGatewayRoutePreviewSkippedOption, p as ApiKey, q as AppFolder, r as AudioModel, s as AudioModelCapabilities, t as AudioModelPricing, u as AuthMode, v as Automation, w as AutomationActionType, x as AutomationCostStats, y as AutomationRun, z as AutomationWithSecret, B as BundleReader, E as Chat, G as ChatCost, J as ChatCostByCallType, K as ChatStopResult, M as ClientMeta, N as Computer, P as ComputerEnvVar, Q as ComputerExecResult, R as ComputerLoggingLevel, T as ComputerPort, U as ComputerServerInfo, X as ComputerState, Y as ComputerType, Z as ComputerUser, _ as CreateAutomationInput, $ as DataCreateFolderInput, a0 as DataFolder, a1 as DataUploadInput, a2 as EscalateRequest, a3 as FileList, a4 as FsEntry, a5 as FunctionDeployment, a6 as FunctionInvokeResult, a7 as FunctionResource, a8 as HttpRequest, a9 as ImageModel, aa as ImageModelPricing, ab as LLMModel, ac as LLMModelArchitecture, ad as LLMModelArchitectureType, ae as LLMModelCapabilities, af as LLMModelLocalInference, ag as LLMModelLocalInferenceVariant, ah as LLMModelPricing, ai as ManagedProviderPreset, aj as Message, ak as MessageCostEntry, al as MessageCosts, am as ModelBase, an as ModelModality, ao as Notification, ap as NotificationConfig, aq as NotificationPreference, ar as NotificationSenderKind, as as Pagination, at as Permission, au as ProviderEndpoint, av as ProviderEndpointConnectionType, aw as ProviderEndpointKind, ax as ProviderEndpointModality, ay as ProviderEndpointModelMapping, az as ProviderEndpointProtocol, aA as ProviderEndpointProviderKey, aB as ProviderEndpointRuntime, aC as ProviderEndpointTestResult, aD as ProviderEndpointTransport, aE as ProviderEndpointVisibility, aF as QueryInput, aG as RemoteBundleReader, aH as RepromptResult, aI as RunCostMetrics, aJ as RuntimeMode, aK as SearchResult, aL as Secret, aM as SecretWithValue, aN as SendMessageResult, aO as Settings, aP as Share, aQ as ShareDeletedResult, aR as SharePermission, aS as ShareResourceType, aT as SharedWithMeItem, aU as SingleEnvelope, aV as SpeechStreamEvent, aW as StoreInstallResult, aX as StoreItem, aY as StoreItemType, aZ as StoredCredential, a_ as Subscription, a$ as SubscriptionPlan, b0 as TerminalWindow, b1 as TranscriptionResult, b2 as TranscriptionStreamEvent, b3 as TriggerType, b4 as TtsVoice, b5 as TtsVoiceGender, b6 as UpdateAutomationInput, b7 as UsageRecord, b8 as UsageSummary, b9 as User, ba as VideoModelCapabilities, bb as VideoModelPricing, bc as VideoModelRate, bd as VideoModelSearchItem, be as WebSearchHit, bf as WebSearchResponse, bg as Workspace, bh as WorkspaceInvitation, bi as WorkspaceMember, bj as WorkspaceMemberRole, bk as buildUrl, bl as request, bm as requestRaw } from './data-BEWuiL70.js';
5
5
  import 'zod';
6
6
 
7
7
  /**
@@ -24,6 +24,16 @@ interface AiGatewayUsageOptions extends CallOptions {
24
24
  /** Look-back window in days (1–365, default 30). */
25
25
  windowDays?: number;
26
26
  }
27
+ interface AiGatewayRoutePreviewInput extends CallOptions {
28
+ /** Idapt/OpenRouter-style model id to route, for example `openai/gpt-5.5`. */
29
+ modelId: string;
30
+ /** Public workspace id or internal UUID — defaults to the caller's workspace. */
31
+ workspaceId?: string;
32
+ /** Estimated prompt/input tokens for request-window filtering. */
33
+ promptTokens?: number;
34
+ /** Endpoint capabilities required by this request shape. */
35
+ requiredCapabilities?: AiGatewayRoutePreviewCapabilities;
36
+ }
27
37
  declare class AiGatewayApi {
28
38
  private readonly ctx;
29
39
  constructor(ctx: HttpContext);
@@ -31,52 +41,157 @@ declare class AiGatewayApi {
31
41
  providers(opts?: AiGatewayProvidersOptions): Promise<AiGatewayProvider[]>;
32
42
  /** Per-model / per-provider usage breakdown over a window. */
33
43
  usage(opts?: AiGatewayUsageOptions): Promise<AiGatewayUsageRow[]>;
44
+ /** Preview the provider route order for a model without spending tokens. */
45
+ routePreview(input: AiGatewayRoutePreviewInput): Promise<AiGatewayRoutePreview>;
34
46
  }
35
47
 
36
48
  /**
37
- * VideosApi — `/api/v1/videos/*`.
49
+ * InferenceApi — `/api/v1/inference/*`.
38
50
  *
39
- * Video generation is ASYNC (renders take ~30s–several minutes):
40
- * - `POST /videos/generations` HTTP 202 with an OPERATION HANDLE
41
- * (`{id: "mg_…", status: "pending"}`), never an inline result.
42
- * - `GET /videos/models` / `GET /videos/models/search` the catalogue
43
- * (per-second pricing with a per-resolution rate table + fixed
44
- * duration/resolution options).
51
+ * The unified one-shot generation surface (distinct from `client.chats`, the
52
+ * stateful agent loop). Every verb returns the result inline, or — for
53
+ * inherently-async modalities (video) or `background: true` an operation
54
+ * handle that this facade polls to completion (pass `wait: false` to get the
55
+ * handle back and poll yourself via `client.operations`).
45
56
  *
46
- * `generate()` polls the operation to completion by default (wide cadence —
47
- * 5s × 240, a ~20-minute ceiling) and resolves with the completed payload
48
- * `{file_id, path, url, model, cost_usd, duration_seconds, resolution}`.
49
- * Pass `wait: false` to get the handle back immediately and poll yourself
50
- * via `client.operations.get(id)` / cancel via `client.operations.cancel(id)`.
57
+ * `inference text` is the net-new one-shot LLM verb (message-based). Streaming
58
+ * variants (`inference text-stream`, etc.) are SSE use `client.call` or the
59
+ * raw endpoints for those.
51
60
  */
52
61
 
53
- interface GenerateVideoInput {
62
+ interface InferenceTextMessage {
63
+ role: "system" | "user" | "assistant" | "tool";
64
+ content?: string | Array<Record<string, unknown>> | null;
65
+ name?: string;
66
+ tool_call_id?: string;
67
+ tool_calls?: Array<Record<string, unknown>>;
68
+ }
69
+ interface InferenceTextInput {
70
+ messages: InferenceTextMessage[];
71
+ model?: string;
72
+ max_tokens?: number;
73
+ temperature?: number;
74
+ top_p?: number;
75
+ stop?: string | string[];
76
+ response_format?: Record<string, unknown>;
77
+ tools?: Array<Record<string, unknown>>;
78
+ tool_choice?: string | Record<string, unknown>;
79
+ workspace_id?: string;
80
+ /** Return an operation handle immediately instead of the inline completion. */
81
+ background?: boolean;
82
+ }
83
+ interface InferenceTextResult {
84
+ id?: string | null;
85
+ model: string;
86
+ content: string;
87
+ finish_reason?: string | null;
88
+ tool_calls?: Array<Record<string, unknown>> | null;
89
+ usage?: {
90
+ input_tokens?: number | null;
91
+ output_tokens?: number | null;
92
+ cost_usd?: number | null;
93
+ } | null;
94
+ }
95
+ interface InferenceImageInput {
96
+ prompt: string;
97
+ workspace_id: string;
98
+ model?: string;
99
+ output_path?: string;
100
+ reference_image_ids?: string[];
101
+ reference_image_paths?: string[];
102
+ aspect_ratio?: string;
103
+ background?: boolean;
104
+ }
105
+ interface InferenceVideoInput {
54
106
  prompt: string;
55
107
  workspace_id: string;
56
108
  model?: string;
57
- /** Must be one of the model's fixed duration options (see the catalog). */
58
109
  duration_seconds?: number;
59
- /** Must be a resolution the model advertises, e.g. "720p". */
60
110
  resolution?: string;
61
111
  aspect_ratio?: string;
62
- /** Generate native audio (audio-capable models only). */
63
112
  generate_audio?: boolean;
64
113
  output_path?: string;
65
- /** Reference images for image-to-video. */
66
114
  reference_image_ids?: string[];
67
115
  reference_image_paths?: string[];
68
- /** Input video for video-to-video (e.g. model `runway-aleph-2`). */
69
116
  video_reference_id?: string;
70
117
  video_reference_path?: string;
71
118
  }
72
- interface GenerateVideoOptions extends CallOptions {
73
- /** Default true — poll the operation to completion. False → return the handle. */
74
- wait?: boolean;
75
- /** Override the poll cadence (default: the contract's 5000ms). */
76
- pollIntervalMs?: number;
77
- /** Override the poll ceiling (default: the contract's 240 attempts). */
78
- maxPollAttempts?: number;
119
+ interface InferenceSpeechInput {
120
+ text: string;
121
+ workspace_id: string;
122
+ model?: string;
123
+ voice?: string;
124
+ speed?: number;
125
+ pitch?: number;
126
+ emotion?: string;
127
+ output_path?: string;
128
+ background?: boolean;
129
+ }
130
+ /** Delivery/poll options — `wait: false` returns the operation handle. */
131
+ type InferenceOptions = ExecuteCommandOptions;
132
+ declare class InferenceApi {
133
+ private readonly ctx;
134
+ constructor(ctx: HttpContext);
135
+ /** One-shot LLM completion (message-based). */
136
+ text(input: InferenceTextInput, opts?: InferenceOptions): Promise<InferenceTextResult | OperationHandle>;
137
+ /** Generate an image from a prompt. */
138
+ image(input: InferenceImageInput, opts?: InferenceOptions): Promise<ImageGenerationResult | OperationHandle>;
139
+ /** Generate a video (ALWAYS async — polls to completion unless `wait:false`). */
140
+ video(input: InferenceVideoInput, opts?: InferenceOptions): Promise<VideoGenerationResult | OperationHandle>;
141
+ /** Synthesize speech from text (TTS). */
142
+ speech(input: InferenceSpeechInput, opts?: InferenceOptions): Promise<SpeechResult | OperationHandle>;
79
143
  }
144
+
145
+ /**
146
+ * OperationsApi — `/api/v1/operations/*`.
147
+ *
148
+ * The unified async-operation surface. An operation is any long-running job —
149
+ * async inference (`inf_…` ids: video today, more later) OR code/computer
150
+ * execution runs — projected onto one contract. Poll `get(id)` to a terminal
151
+ * status, `list()` recent operations, `cancel(id)` an in-flight one.
152
+ */
153
+
154
+ /** A projected async operation (the shared `OperationResponse` contract). */
155
+ interface Operation {
156
+ id: string;
157
+ status: "pending" | "running" | "completed" | "failed" | "cancelled";
158
+ /** The `${resource} ${verb}` that produced it, e.g. `"inference video"`. */
159
+ tool: string | null;
160
+ /** The unwrapped result payload once `completed`. */
161
+ result: unknown;
162
+ /** The structured error once `failed`. */
163
+ error: unknown;
164
+ created_at?: string;
165
+ started_at: string | null;
166
+ completed_at: string | null;
167
+ }
168
+ interface ListOperationsInput {
169
+ status?: "pending" | "running" | "completed" | "failed" | "cancelled";
170
+ limit?: number;
171
+ cursor?: string;
172
+ }
173
+ declare class OperationsApi {
174
+ private readonly ctx;
175
+ constructor(ctx: HttpContext);
176
+ /** Fetch one operation by its handle id (`inf_…` / execution-run id). */
177
+ get(id: string, opts?: CallOptions): Promise<Operation>;
178
+ /** List the caller's recent operations, newest first (keyset-paginated). */
179
+ list(input?: ListOperationsInput, opts?: CallOptions): Promise<ListEnvelope<Operation>>;
180
+ /** Request cancellation (idempotent — a terminal op is returned as-is). */
181
+ cancel(id: string, opts?: CallOptions): Promise<Operation>;
182
+ }
183
+
184
+ /**
185
+ * VideosApi — video-model DISCOVERY (`GET /api/v1/videos/models` +
186
+ * `/videos/models/search`).
187
+ *
188
+ * Video GENERATION moved to the unified inference surface — use
189
+ * `client.inference.video({ prompt, workspace_id, … })` (ALWAYS async; polls
190
+ * to completion unless `wait: false`). This namespace now exposes only the
191
+ * model catalog (per-second pricing with a per-resolution rate table + fixed
192
+ * duration/resolution options); model discovery stays per-modality by design.
193
+ */
194
+
80
195
  interface SearchVideoModelsInput {
81
196
  query?: string;
82
197
  provider?: string;
@@ -89,20 +204,17 @@ interface SearchVideoModelsInput {
89
204
  declare class VideosApi {
90
205
  private readonly ctx;
91
206
  constructor(ctx: HttpContext);
207
+ /** List the available video-generation models. */
92
208
  listModels(opts?: CallOptions): Promise<VideoModel[]>;
209
+ /** Search the video-model registry (filtered + paginated envelope). */
93
210
  searchModels(input?: SearchVideoModelsInput, opts?: CallOptions): Promise<VideoModelSearchResult>;
94
- /**
95
- * Start a video generation. With `wait` (default) polls the operation to
96
- * a terminal status and resolves the completed payload (throws a typed
97
- * error on failure/cancel); with `wait: false` resolves the 202 handle
98
- * immediately.
99
- */
100
- generate(input: GenerateVideoInput, opts: GenerateVideoOptions & {
101
- wait: false;
102
- }): Promise<OperationHandle>;
103
- generate(input: GenerateVideoInput, opts?: GenerateVideoOptions): Promise<VideoGenerationResult>;
104
211
  }
105
212
 
213
+ /** Public API version this SDK release targets. */
214
+ declare const IDAPT_API_VERSION = "2026-07-12";
215
+ /** Header used by Idapt's native public API versioning. */
216
+ declare const IDAPT_API_VERSION_HEADER = "x-idapt-version";
217
+
106
218
  /**
107
219
  * IdaptClient — the generic, isomorphic Idapt v1 API client.
108
220
  *
@@ -232,7 +344,7 @@ declare class InvalidRequestError extends IdaptError {
232
344
  * this is **retryable**: `retryable` is always `true` and `retryAfter`
233
345
  * carries the server's `retry_after` hint when one is present.
234
346
  *
235
- * Returned by the computer `exec` / `tmux` / `sftp` endpoints and
347
+ * Returned by the computer `exec` / `terminal` / `fs` endpoints and
236
348
  * `POST /v1/audio/transcriptions`.
237
349
  */
238
350
  declare class ServiceUnavailableError extends IdaptError {
@@ -439,4 +551,4 @@ declare const Idapt: {
439
551
  connect: typeof connect;
440
552
  };
441
553
 
442
- export { AiGatewayApi, AiGatewayProvider, type AiGatewayProvidersOptions, type AiGatewayUsageOptions, AiGatewayUsageRow, AuthError, CallOptions, ConflictError, ConnectOptions, DataStore, DataStoreCreateFolderInput, DataStoreUploadInput, type DefaultConnectConfig, DeletedResponse, File, FileUploadResult, type GenerateVideoInput, type GenerateVideoOptions, HttpContext, Idapt, IdaptClient, type IdaptClientOptions, IdaptError, type IdaptErrorCode, type IdaptErrorInit, type IdaptErrorSubCode, type IdaptErrorType, type IdaptRedirectingError, InvalidRequestError, type LocationLike, NetworkError, NotFoundError, OperationHandle, PermissionError, RateLimitError, RemoteDataStore, type SearchVideoModelsInput, ServerError, ServiceUnavailableError, VERSION, VideoGenerationResult, VideoModel, VideoModelSearchResult, VideosApi, WriteOptions, connect, detectAppId, errorFromStatus, getAppBaseUrl, makeConnect };
554
+ export { AiGatewayApi, AiGatewayProvider, type AiGatewayProvidersOptions, AiGatewayRoutePreview, AiGatewayRoutePreviewCapabilities, type AiGatewayRoutePreviewInput, type AiGatewayUsageOptions, AiGatewayUsageRow, AuthError, CallOptions, ConflictError, ConnectOptions, DataStore, DataStoreCreateFolderInput, DataStoreUploadInput, type DefaultConnectConfig, DeletedResponse, ExecuteCommandOptions, File, FileUploadResult, HttpContext, IDAPT_API_VERSION, IDAPT_API_VERSION_HEADER, Idapt, IdaptClient, type IdaptClientOptions, IdaptError, type IdaptErrorCode, type IdaptErrorInit, type IdaptErrorSubCode, type IdaptErrorType, type IdaptRedirectingError, ImageGenerationResult, InferenceApi, type InferenceImageInput, type InferenceSpeechInput, type InferenceTextInput, type InferenceTextMessage, type InferenceTextResult, type InferenceVideoInput, InvalidRequestError, ListEnvelope, type ListOperationsInput, type LocationLike, NetworkError, NotFoundError, type Operation, OperationHandle, OperationsApi, PermissionError, RateLimitError, RemoteDataStore, type SearchVideoModelsInput, ServerError, ServiceUnavailableError, SpeechResult, VERSION, VideoGenerationResult, VideoModel, VideoModelSearchResult, VideosApi, WriteOptions, connect, detectAppId, errorFromStatus, getAppBaseUrl, makeConnect };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { Idapt, IdaptClient, connect, detectAppId, getAppBaseUrl, makeConnect } from './chunk-OKOO2JCS.js';
2
- export { AgentsApi, AiGatewayApi, ApiKeysApi, AppFolder, AudioApi, AuthError, BlobsApi, COMMAND_BINDINGS, ChatsApi, ComputersApi, ConflictError, DataFolder, DatastoreApi, DocsApi, FilesApi, FunctionsApi, GuideApi, IdaptError, ImagesApi, InvalidRequestError, ModelsApi, NetworkError, NotFoundError, NotificationsApi, PermissionError, ProviderEndpointsApi, RateLimitError, RealtimeApi, RemoteBundleReader, RemoteDataStore, SearchApi, SecretsApi, ServerError, ServiceUnavailableError, SettingsApi, SharingApi, StoreApi, SubscriptionApi, TablesApi, TriggersApi, UserApi, VERSION, VideosApi, WebSearchApi, WorkspacesApi, awaitOperation, buildUrl, errorFromStatus, executeCommand, getFileBlob, getFileText, listFiles, request, requestRaw } from './chunk-KHPTFRT3.js';
1
+ export { Idapt, IdaptClient, connect, detectAppId, getAppBaseUrl, makeConnect } from './chunk-Y22HYQZB.js';
2
+ export { AgentsApi, AiGatewayApi, ApiKeysApi, AppFolder, AudioApi, AuthError, AutomationsApi, COMMAND_BINDINGS, ChatsApi, ComputersApi, ConflictError, DataFolder, DocsApi, FilesApi, GuideApi, IDAPT_API_VERSION, IDAPT_API_VERSION_HEADER, IdaptError, ImagesApi, InferenceApi, InvalidRequestError, ModelsApi, NetworkError, NotFoundError, NotificationsApi, OperationsApi, PermissionError, ProviderEndpointsApi, RateLimitError, RealtimeApi, RemoteBundleReader, RemoteDataStore, SearchApi, SecretsApi, ServerError, ServiceUnavailableError, SettingsApi, SharingApi, SubscriptionApi, UserApi, VERSION, VideosApi, WebSearchApi, WorkspacesApi, awaitOperation, buildUrl, errorFromStatus, executeCommand, getFileBlob, getFileText, listFiles, request, requestRaw } from './chunk-5GAGDUWY.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map