@opencode/ai 0.0.0-dev-1286 → 0.0.0-dev-1289
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -11
- package/dist/effect.d.ts +3 -1
- package/dist/image-client.d.ts +52 -59
- package/dist/image-client.js +47 -8
- package/dist/image.d.ts +27 -7
- package/dist/image.js +10 -6
- package/dist/index.d.ts +12 -7
- package/dist/index.js +12 -7
- package/dist/media-client.d.ts +13 -5
- package/dist/media-client.js +42 -37
- package/dist/media.d.ts +8 -0
- package/dist/media.js +14 -0
- package/dist/protocols/google-interactions-video.d.ts +38 -0
- package/dist/protocols/google-interactions-video.js +185 -0
- package/dist/protocols/google-interactions.d.ts +14 -1
- package/dist/protocols/google-interactions.js +1 -1
- package/dist/protocols/minimax-video.d.ts +45 -0
- package/dist/protocols/minimax-video.js +290 -0
- package/dist/protocols/openrouter-video.d.ts +4 -9
- package/dist/protocols/openrouter-video.js +8 -7
- package/dist/protocols/seedance-video.d.ts +4 -9
- package/dist/protocols/seedance-video.js +9 -8
- package/dist/protocols/utils/responses-compaction.js +1 -1
- package/dist/protocols/xai-video.d.ts +4 -9
- package/dist/protocols/xai-video.js +8 -7
- package/dist/providers/google/videos.d.ts +2 -0
- package/dist/providers/google/videos.js +1 -0
- package/dist/providers/google.d.ts +5 -0
- package/dist/providers/google.js +7 -0
- package/dist/providers/minimax/videos.d.ts +3 -0
- package/dist/providers/minimax/videos.js +1 -0
- package/dist/providers/minimax.d.ts +6 -1
- package/dist/providers/minimax.js +10 -1
- package/dist/providers/xai/videos.d.ts +2 -0
- package/dist/providers/xai/videos.js +1 -0
- package/dist/providers/xai.d.ts +4 -3
- package/dist/providers/xai.js +5 -1
- package/dist/public.d.ts +1 -1
- package/dist/route/executor-service.d.ts +6 -0
- package/dist/route/executor-service.js +7 -0
- package/dist/route/executor.d.ts +7 -1
- package/dist/route/executor.js +7 -2
- package/dist/route/media-protocol.d.ts +5 -0
- package/dist/route/media.js +4 -3
- package/dist/route/transport/http.js +1 -1
- package/dist/schema/options.d.ts +8 -0
- package/dist/schema/options.js +1 -0
- package/dist/video-client.d.ts +6 -6
- package/dist/video-client.js +13 -11
- package/dist/video.d.ts +14 -72
- package/dist/video.js +9 -8
- package/package.json +19 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { videoModel as model } from "../minimax.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ProviderPackage } from "../provider-package.js";
|
|
2
2
|
import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
3
3
|
import { type MiniMaxImageOptions } from "../protocols/minimax-images.js";
|
|
4
|
+
import { type MiniMaxVideoOptions } from "../protocols/minimax-video.js";
|
|
4
5
|
import type { ProviderAuthOption } from "../route/auth-options.js";
|
|
5
6
|
import { Route } from "../route/client.js";
|
|
6
7
|
import { type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js";
|
|
@@ -34,7 +35,7 @@ export type Settings<Options = MessagesOptionsInput> = ProviderPackage.Settings
|
|
|
34
35
|
readonly apiKey?: string | false;
|
|
35
36
|
readonly baseURL?: string;
|
|
36
37
|
};
|
|
37
|
-
export type { MiniMaxImageOptions };
|
|
38
|
+
export type { MiniMaxImageOptions, MiniMaxVideoOptions };
|
|
38
39
|
export declare const routes: (Route<{
|
|
39
40
|
readonly context_management?: {
|
|
40
41
|
readonly edits: readonly {
|
|
@@ -725,6 +726,7 @@ export declare const configure: (input?: Config) => {
|
|
|
725
726
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
726
727
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
727
728
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
729
|
+
video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<MiniMaxVideoOptions>;
|
|
728
730
|
configure: typeof configure;
|
|
729
731
|
};
|
|
730
732
|
export declare const provider: {
|
|
@@ -734,12 +736,15 @@ export declare const provider: {
|
|
|
734
736
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
735
737
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
736
738
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
739
|
+
video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<MiniMaxVideoOptions>;
|
|
737
740
|
configure: typeof configure;
|
|
738
741
|
};
|
|
739
742
|
export declare const model: ProviderPackage.Model<Settings<MessagesOptionsInput>, MessagesOptionsInput>;
|
|
740
743
|
export declare const imageModel: (modelID: string, settings?: Settings<MiniMaxImageOptions>) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
744
|
+
export declare const videoModel: (modelID: string, settings?: Settings<MiniMaxVideoOptions>) => import("../video.js").VideoModel<MiniMaxVideoOptions>;
|
|
741
745
|
export declare const messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<MessagesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
742
746
|
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
743
747
|
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
744
748
|
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
749
|
+
export declare const video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<MiniMaxVideoOptions>;
|
|
745
750
|
export * as MiniMax from "./minimax.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
3
3
|
import { MiniMaxImages } from "../protocols/minimax-images.js";
|
|
4
|
+
import { MiniMaxVideo } from "../protocols/minimax-video.js";
|
|
4
5
|
import { OpenAIChat } from "../protocols/openai-chat.js";
|
|
5
6
|
import { OpenResponses } from "../protocols/open-responses.js";
|
|
6
7
|
import { ProviderShared } from "../protocols/shared.js";
|
|
@@ -75,7 +76,10 @@ export const configure = (input = {}) => {
|
|
|
75
76
|
const responses = (modelID) => responsesRoute.with(defaults).model({ id: modelID });
|
|
76
77
|
const media = MediaRoute.deployment(input, defaults.auth);
|
|
77
78
|
const image = (modelID, providerOptions) => MiniMaxImages.model({ ...media, id: modelID, providerOptions });
|
|
78
|
-
|
|
79
|
+
// H3 is under /v2 and Hailuo under /v1, so video drops the version a shared `baseURL` carries for the other APIs.
|
|
80
|
+
const videoBaseURL = media.baseURL?.replace(/(\/v1)?\/*$/, "");
|
|
81
|
+
const video = (modelID, providerOptions) => MiniMaxVideo.model({ ...media, baseURL: videoBaseURL, id: modelID, providerOptions });
|
|
82
|
+
return { id, model: messages, messages, chat, responses, image, video, configure };
|
|
79
83
|
};
|
|
80
84
|
export const provider = configure();
|
|
81
85
|
export const model = (modelID, settings) => configure(toConfig(settings)).model(modelID);
|
|
@@ -83,8 +87,13 @@ export const imageModel = (modelID, settings) => {
|
|
|
83
87
|
const input = toConfig(settings);
|
|
84
88
|
return configure(input).image(modelID, input.providerOptions);
|
|
85
89
|
};
|
|
90
|
+
export const videoModel = (modelID, settings) => {
|
|
91
|
+
const input = toConfig(settings);
|
|
92
|
+
return configure(input).video(modelID, input.providerOptions);
|
|
93
|
+
};
|
|
86
94
|
export const messages = provider.messages;
|
|
87
95
|
export const chat = provider.chat;
|
|
88
96
|
export const responses = provider.responses;
|
|
89
97
|
export const image = provider.image;
|
|
98
|
+
export const video = provider.video;
|
|
90
99
|
export * as MiniMax from "./minimax.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { videoModel as model } from "../xai.js";
|
package/dist/providers/xai.d.ts
CHANGED
|
@@ -208,7 +208,7 @@ export declare const configure: (input?: Config) => {
|
|
|
208
208
|
}>;
|
|
209
209
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
210
210
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
|
|
211
|
-
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/xai-video.js").XAIVideoOptions>;
|
|
211
|
+
video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<import("../protocols/xai-video.js").XAIVideoOptions>;
|
|
212
212
|
configure: typeof configure;
|
|
213
213
|
};
|
|
214
214
|
export declare const provider: {
|
|
@@ -221,14 +221,15 @@ export declare const provider: {
|
|
|
221
221
|
}>;
|
|
222
222
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
223
223
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
|
|
224
|
-
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/xai-video.js").XAIVideoOptions>;
|
|
224
|
+
video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<import("../protocols/xai-video.js").XAIVideoOptions>;
|
|
225
225
|
configure: typeof configure;
|
|
226
226
|
};
|
|
227
227
|
export declare const model: ProviderPackage.Model<Settings, XAIProviderOptionsInput, typeof responsesRoute.compact>;
|
|
228
228
|
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
|
|
229
|
+
export declare const videoModel: (modelID: string, settings?: Settings) => import("../video.js").VideoModel<import("../protocols/xai-video.js").XAIVideoOptions>;
|
|
229
230
|
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput, {
|
|
230
231
|
endpoint: import("../route/client.js").CompactOperation;
|
|
231
232
|
}>;
|
|
232
233
|
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
233
234
|
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
|
|
234
|
-
export declare const video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/xai-video.js").XAIVideoOptions>;
|
|
235
|
+
export declare const video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<import("../protocols/xai-video.js").XAIVideoOptions>;
|
package/dist/providers/xai.js
CHANGED
|
@@ -69,7 +69,7 @@ export const configure = (input = {}) => {
|
|
|
69
69
|
responses,
|
|
70
70
|
chat,
|
|
71
71
|
image: (modelID, providerOptions) => XAIImages.model({ ...media, id: modelID, providerOptions }),
|
|
72
|
-
video: (modelID) => XAIVideo.model({ ...media, id: modelID }),
|
|
72
|
+
video: (modelID, providerOptions) => XAIVideo.model({ ...media, id: modelID, providerOptions }),
|
|
73
73
|
configure,
|
|
74
74
|
};
|
|
75
75
|
};
|
|
@@ -79,6 +79,10 @@ export const imageModel = (modelID, settings) => {
|
|
|
79
79
|
const input = toConfig(settings);
|
|
80
80
|
return configure(input).image(modelID, input.providerOptions);
|
|
81
81
|
};
|
|
82
|
+
export const videoModel = (modelID, settings) => {
|
|
83
|
+
const input = toConfig(settings);
|
|
84
|
+
return configure(input).video(modelID, input.providerOptions);
|
|
85
|
+
};
|
|
82
86
|
export const responses = provider.responses;
|
|
83
87
|
export const chat = provider.chat;
|
|
84
88
|
export const image = provider.image;
|
package/dist/public.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { isContextOverflow, isContextOverflowFailure, isRetryable } from "./prov
|
|
|
2
2
|
export { ProtocolID, RouteID, ModelID, ProviderID, ResponseID, ContentBlockID, ToolCallID, JsonSchema, ProviderOptions, ProviderMetadata, HttpTimeout, RequestEncoding, GENERATION_KEYS, ReasoningEfforts, ReasoningEffort, LanguageModelCompatibility, LanguageModel, LanguageModelSchema, CacheTTL, CacheHint, CachePolicyObject, CachePolicy, MessageRole, SystemPart, TextPart, MediaPart, ToolResultValue, ToolOutput, ToolCallPart, ToolResultPart, ReasoningPart, CompactionPart, EffortPart, ContentPart, Message, SystemMessage, UserMessage, AssistantMessage, ToolMessage, Freeform, ToolDefinition, ToolNamespace, ToolEntry, ToolChoice, FinishReason, Usage, MediaUsage, CompactionResponse, CompactionCheckpointResponse, StepStart, TextStart, TextDelta, TextEnd, ReasoningStart, ReasoningDelta, ReasoningEnd, ToolInputStart, ToolInputDelta, ToolInputEnd, ToolInputError, ToolCall, ToolResult, FinishReasonDetails, StepFinish, Finish, MediaEvent, RawEvent, LLMEvent, LLMResponse, HttpContext, HttpRateLimitDetails, InvalidRequestError, UnsupportedOperationError, ProviderConfigurationError, AuthenticationError, RateLimitError, QuotaExceededError, ContentPolicyError, ProviderInternalError, TransportType, TransportOperation, TransportError, InvalidProviderOutputError, UnknownProviderError, TimeoutError, AIErrorReason, AIError, } from "./schema/index.js";
|
|
3
3
|
export type { BaseRequest, ContentPartInput, GenerationOptionsFields, HttpOptions, RequestOptions, LanguageModelInput, LanguageModelProviderOptions, LLMRequest, MediaPartInput, RequestTimeout, TimeoutConfig, ToolDefinitionInput, ToolNamespaceInput, ToolNamespaceEntryInput, ToolEntryInput, TransportOptions, UsageInput, } from "./schema/index.js";
|
|
4
4
|
export { ImageAspectRatio, ImageEvent, ImageModel, ImageModelSchema, ImageResponse } from "./image.js";
|
|
5
|
-
export type { ImageModelOptions, ImageOptions, ImageRequest, ImageRequestInput, ImageResolution, ImageRoute, } from "./image.js";
|
|
5
|
+
export type { ImageJob, ImageModelOptions, ImageOptions, ImageRequest, ImageRequestInput, ImageResolution, ImageRoute, ImageStatus, } from "./image.js";
|
|
6
6
|
export { VideoAspectRatio, VideoDuration, VideoModel, VideoModelSchema, VideoResponse } from "./video.js";
|
|
7
7
|
export type { VideoJob, VideoModelOptions, VideoOptions, VideoRequest, VideoRequestInput, VideoResolution, VideoRoute, VideoStatus, } from "./video.js";
|
|
8
8
|
export { ChoiceAnswer, ChoiceQuestion, ChoiceValue, DecisionAnswer, DecisionJsonPart, DecisionMediaPart, DecisionModel, DecisionModelCompatibility, DecisionModelSchema, DecisionPart, DecisionQuestion, DecisionResponse, DecisionTextPart, DecisionUsage, ErrorAnswer, ErrorReason, PredicateAnswer, PredicateQuestion, ScoreAnswer, ScoreQuestion, } from "./decision.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Context, type Effect } from "effect";
|
|
2
2
|
import type { Headers, HttpClientRequest, HttpClientResponse } from "effect/http";
|
|
3
3
|
import { HttpContext, type AIError } from "../schema/errors.js";
|
|
4
|
+
import type { ClientTls } from "../schema/options.js";
|
|
4
5
|
export interface Interface {
|
|
5
6
|
readonly execute: (request: HttpClientRequest.HttpClientRequest, middleware?: HttpMiddleware) => Effect.Effect<HttpClientResponse.HttpClientResponse, AIError>;
|
|
6
7
|
}
|
|
@@ -10,6 +11,11 @@ declare const RequestExecutorService_base: Context.ServiceClass<RequestExecutorS
|
|
|
10
11
|
export declare class RequestExecutorService extends RequestExecutorService_base {
|
|
11
12
|
}
|
|
12
13
|
export declare const Service: typeof RequestExecutorService;
|
|
14
|
+
/**
|
|
15
|
+
* The client certificate for the HTTP request being executed. Transports set it from `http.tls`; the executor's HTTP
|
|
16
|
+
* client presents it, since only the runtime's fetch can.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CurrentTls: Context.Reference<ClientTls | undefined>;
|
|
13
19
|
export type Service = RequestExecutorService;
|
|
14
20
|
export declare const headerDetails: (headers: Headers.Headers) => {
|
|
15
21
|
[k: string]: string;
|
|
@@ -3,6 +3,13 @@ import { HttpContext } from "../schema/errors.js";
|
|
|
3
3
|
export class RequestExecutorService extends Context.Service()("@opencode/AI/RequestExecutor") {
|
|
4
4
|
}
|
|
5
5
|
export const Service = RequestExecutorService;
|
|
6
|
+
/**
|
|
7
|
+
* The client certificate for the HTTP request being executed. Transports set it from `http.tls`; the executor's HTTP
|
|
8
|
+
* client presents it, since only the runtime's fetch can.
|
|
9
|
+
*/
|
|
10
|
+
export const CurrentTls = Context.Reference("@opencode/AI/RequestExecutor/CurrentTls", {
|
|
11
|
+
defaultValue: () => undefined,
|
|
12
|
+
});
|
|
6
13
|
export const headerDetails = (headers) => Object.fromEntries(Object.entries(headers).map(([name, value]) => [name, value]));
|
|
7
14
|
export const responseHttp = (response) => new HttpContext({
|
|
8
15
|
url: response.request.url,
|
package/dist/route/executor.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { Layer, Stream } from "effect";
|
|
|
2
2
|
import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
|
|
3
3
|
import { AIError } from "../schema/index.js";
|
|
4
4
|
import { Service, type HttpMiddleware, type Interface } from "./executor-service.js";
|
|
5
|
-
|
|
5
|
+
import type { ClientTls } from "../schema/options.js";
|
|
6
|
+
export { CurrentTls, responseHttp, Service } from "./executor-service.js";
|
|
6
7
|
export type { HttpHandler, HttpMiddleware, Interface, RequestExecutorService } from "./executor-service.js";
|
|
7
8
|
/** Preserve HTTP diagnostics for executor and externally captured failures alike. */
|
|
8
9
|
export declare const httpFailure: (input: {
|
|
@@ -18,6 +19,11 @@ export declare const responseStream: (response: HttpClientResponse.HttpClientRes
|
|
|
18
19
|
export declare const stream: (executor: Interface, request: HttpClientRequest.HttpClientRequest, middleware?: HttpMiddleware) => Stream.Stream<Uint8Array, AIError>;
|
|
19
20
|
export declare const layer: Layer.Layer<Service, never, HttpClient.HttpClient>;
|
|
20
21
|
export declare const fetchLayer: Layer.Layer<import("./executor-service.js").RequestExecutorService, never, never>;
|
|
22
|
+
/**
|
|
23
|
+
* Sends through `execute`, presenting `tls` on each request. Apply it only where a provider request is sent, so
|
|
24
|
+
* downloads made through the plain executor never carry the certificate. The executor's HTTP client reads `CurrentTls`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const withTls: (execute: Interface["execute"], tls: ClientTls | undefined) => Interface["execute"];
|
|
21
27
|
/**
|
|
22
28
|
* Per-call middleware that sends through `fetch` instead of the executor's HTTP client. Executor middleware and
|
|
23
29
|
* `middleware` still wrap the call, and status classification still applies.
|
package/dist/route/executor.js
CHANGED
|
@@ -2,8 +2,8 @@ import { Cause, Effect, Layer, Option, Schema, Stream } from "effect";
|
|
|
2
2
|
import { FetchHttpClient, Headers, HttpClient, HttpClientError, HttpClientRequest, HttpClientResponse, } from "effect/http";
|
|
3
3
|
import { HttpContext, HttpRateLimitDetails, AIError, TransportError } from "../schema/index.js";
|
|
4
4
|
import { classifyProviderFailure, providerErrorMessage } from "../provider-error.js";
|
|
5
|
-
import { headerDetails, responseHttp, Service } from "./executor-service.js";
|
|
6
|
-
export { responseHttp, Service } from "./executor-service.js";
|
|
5
|
+
import { CurrentTls, headerDetails, responseHttp, Service, } from "./executor-service.js";
|
|
6
|
+
export { CurrentTls, responseHttp, Service } from "./executor-service.js";
|
|
7
7
|
const normalizedHeaders = (headers) => Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value]));
|
|
8
8
|
const clampRetryAfterMs = (millis) => Math.min(Number.MAX_SAFE_INTEGER, Math.max(0, Math.ceil(millis)));
|
|
9
9
|
const retryAfterMs = (headers) => {
|
|
@@ -186,6 +186,11 @@ export const layer = Layer.effect(Service, Effect.gen(function* () {
|
|
|
186
186
|
});
|
|
187
187
|
}));
|
|
188
188
|
export const fetchLayer = layer.pipe(Layer.provide(FetchHttpClient.layer));
|
|
189
|
+
/**
|
|
190
|
+
* Sends through `execute`, presenting `tls` on each request. Apply it only where a provider request is sent, so
|
|
191
|
+
* downloads made through the plain executor never carry the certificate. The executor's HTTP client reads `CurrentTls`.
|
|
192
|
+
*/
|
|
193
|
+
export const withTls = (execute, tls) => tls ? (request, middleware) => execute(request, middleware).pipe(Effect.provideService(CurrentTls, tls)) : execute;
|
|
189
194
|
/**
|
|
190
195
|
* Per-call middleware that sends through `fetch` instead of the executor's HTTP client. Executor middleware and
|
|
191
196
|
* `middleware` still wrap the call, and status classification still applies.
|
|
@@ -58,6 +58,11 @@ export interface PollContext<Token> {
|
|
|
58
58
|
* the API key to download. URLs on another origin than the route's base URL get no headers.
|
|
59
59
|
*/
|
|
60
60
|
readonly headers: (url: string) => Effect.Effect<Record<string, string>, AIError>;
|
|
61
|
+
/**
|
|
62
|
+
* A further GET with the same auth and headers, retried like the poll itself, for providers whose result needs a
|
|
63
|
+
* second lookup (MiniMax v1 answers with a file id that resolves to a download URL).
|
|
64
|
+
*/
|
|
65
|
+
readonly get: (path: string) => Effect.Effect<HttpClientResponse.HttpClientResponse, AIError>;
|
|
61
66
|
}
|
|
62
67
|
/**
|
|
63
68
|
* Submit, then poll. `start` posts the body to the route endpoint; `status`, `result`, and `cancel` are follow-up
|
package/dist/route/media.js
CHANGED
|
@@ -57,7 +57,8 @@ export const queued = (input) => {
|
|
|
57
57
|
const generationRoute = (token, exchange, execute) => {
|
|
58
58
|
// Only the GET exchange retries: a decoded terminal failure (`output.ended`) can be a `ProviderInternal` too, and
|
|
59
59
|
// re-reading it would spin until the caller's deadline.
|
|
60
|
-
const
|
|
60
|
+
const get = (path) => transport.call("GET", path, exchange, execute).pipe(Effect.retry({ schedule: READ_RETRY, while: isRetryable }), Effect.map((sent) => sent.response));
|
|
61
|
+
const poll = (operation) => get(operation.path(token)).pipe(Effect.flatMap((response) => operation.decode(response, { token, get, headers: (url) => transport.headers(url, exchange) })));
|
|
61
62
|
const status = poll(protocol.status);
|
|
62
63
|
const cancel = protocol.cancel;
|
|
63
64
|
return {
|
|
@@ -138,7 +139,7 @@ const makeTransport = (input) => {
|
|
|
138
139
|
body: encoded.text,
|
|
139
140
|
headers: encoded.headers,
|
|
140
141
|
});
|
|
141
|
-
const response = yield* execute(encoded.apply(HttpClientRequest.make(call.method)(url).pipe(HttpClientRequest.setHeaders(headers))), RequestExecutor.withFetch(fetch));
|
|
142
|
+
const response = yield* RequestExecutor.withTls(execute, call.request.http?.tls)(encoded.apply(HttpClientRequest.make(call.method)(url).pipe(HttpClientRequest.setHeaders(headers))), RequestExecutor.withFetch(fetch));
|
|
142
143
|
return { response };
|
|
143
144
|
});
|
|
144
145
|
return {
|
|
@@ -153,7 +154,7 @@ const makeTransport = (input) => {
|
|
|
153
154
|
const headers = Headers.fromInput(merged);
|
|
154
155
|
const prepared = protocol.prepare === undefined
|
|
155
156
|
? request
|
|
156
|
-
: yield* protocol.prepare(request, (path, body) => send({ method: "POST", url: baseURL(path), headers, request, body }, request.fetch, execute).pipe(Effect.map((sent) => sent.response)));
|
|
157
|
+
: yield* protocol.prepare(request, (path, body) => send({ method: "POST", url: baseURL(path), headers, request: { ...request, http }, body }, request.fetch, execute).pipe(Effect.map((sent) => sent.response)));
|
|
157
158
|
// Sanitize after merging so model-level overlays are covered; the model value is restored, not sanitized.
|
|
158
159
|
const resolved = {
|
|
159
160
|
...sanitizeSurrogates({ ...prepared, headers: merged, http, providerOptions }),
|
|
@@ -66,7 +66,7 @@ export const httpJson = (input) => ({
|
|
|
66
66
|
const limits = timeoutConfig(request.timeout);
|
|
67
67
|
// Unlike the header and chunk limits, the whole-request budget has no default.
|
|
68
68
|
const total = limits.total ? Duration.millis(limits.total) : Duration.infinity;
|
|
69
|
-
const response = yield* runtime.http.execute(prepared.request, prepared.middleware).pipe(Effect.timeoutOrElse({
|
|
69
|
+
const response = yield* RequestExecutor.withTls(runtime.http.execute, request.http?.tls)(prepared.request, prepared.middleware).pipe(Effect.timeoutOrElse({
|
|
70
70
|
duration: Duration.min(timeoutDuration(limits.headers), total),
|
|
71
71
|
orElse: () => timeout("request", "Timed out waiting for response headers"),
|
|
72
72
|
}));
|
package/dist/schema/options.d.ts
CHANGED
|
@@ -29,6 +29,14 @@ export interface HttpOptions {
|
|
|
29
29
|
readonly body?: Record<string, unknown>;
|
|
30
30
|
/** Compression for JSON request bodies. Only set it for endpoints known to decode it. */
|
|
31
31
|
readonly encoding?: RequestEncoding;
|
|
32
|
+
/** Client certificate presented to HTTPS endpoints that request one (mutual TLS). */
|
|
33
|
+
readonly tls?: ClientTls;
|
|
34
|
+
}
|
|
35
|
+
/** PEM client certificate and private key, with the passphrase of an encrypted key. */
|
|
36
|
+
export interface ClientTls {
|
|
37
|
+
readonly cert: string;
|
|
38
|
+
readonly key: string;
|
|
39
|
+
readonly passphrase?: string;
|
|
32
40
|
}
|
|
33
41
|
/** Per-phase time limits in milliseconds. */
|
|
34
42
|
export interface TimeoutConfig {
|
package/dist/schema/options.js
CHANGED
|
@@ -61,6 +61,7 @@ export const mergeTransport = (...items) => {
|
|
|
61
61
|
query: mergeStringRecords(...http.map((item) => item?.query)),
|
|
62
62
|
body: mergeJsonRecords(...http.map((item) => item?.body)),
|
|
63
63
|
encoding: last(http.map((item) => item?.encoding)),
|
|
64
|
+
tls: last(http.map((item) => item?.tls)),
|
|
64
65
|
}),
|
|
65
66
|
};
|
|
66
67
|
};
|
package/dist/video-client.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { AIError } from "./schema/index.js";
|
|
|
4
4
|
import type { VideoJob, VideoModel, VideoRequest, VideoResponse, VideoStatus } from "./video.js";
|
|
5
5
|
export interface Interface {
|
|
6
6
|
readonly start: (request: VideoRequest) => Effect.Effect<VideoJob, AIError>;
|
|
7
|
-
readonly status: (model: VideoModel,
|
|
8
|
-
readonly result: (model: VideoModel,
|
|
9
|
-
readonly cancel: (model: VideoModel,
|
|
7
|
+
readonly status: (model: VideoModel, id: string) => Effect.Effect<VideoStatus, AIError>;
|
|
8
|
+
readonly result: (model: VideoModel, id: string) => Effect.Effect<VideoResponse, AIError>;
|
|
9
|
+
readonly cancel: (model: VideoModel, id: string) => Effect.Effect<void, AIError>;
|
|
10
10
|
}
|
|
11
11
|
declare const VideoClientService_base: Context.ServiceClass<VideoClientService, "@opencode/VideoClient", Interface>;
|
|
12
12
|
export declare class VideoClientService extends VideoClientService_base {
|
|
@@ -18,8 +18,8 @@ export declare const VideoClient: {
|
|
|
18
18
|
readonly Service: typeof VideoClientService;
|
|
19
19
|
readonly layer: Layer.Layer<VideoClientService, never, RequestExecutor.RequestExecutorService>;
|
|
20
20
|
readonly start: (request: VideoRequest) => Effect.Effect<VideoJob, AIError, VideoClientService>;
|
|
21
|
-
readonly status: (model: VideoModel,
|
|
22
|
-
readonly result: (model: VideoModel,
|
|
23
|
-
readonly cancel: (model: VideoModel,
|
|
21
|
+
readonly status: (model: VideoModel, id: string) => Effect.Effect<VideoStatus, AIError, VideoClientService>;
|
|
22
|
+
readonly result: (model: VideoModel, id: string) => Effect.Effect<VideoResponse, AIError, VideoClientService>;
|
|
23
|
+
readonly cancel: (model: VideoModel, id: string) => Effect.Effect<void, AIError, VideoClientService>;
|
|
24
24
|
};
|
|
25
25
|
export {};
|
package/dist/video-client.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { Context, Effect, Layer } from "effect";
|
|
1
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
2
2
|
import { RequestExecutor } from "./route/executor.js";
|
|
3
3
|
import { AIError, UnsupportedOperationError } from "./schema/index.js";
|
|
4
4
|
export class VideoClientService extends Context.Service()("@opencode/VideoClient") {
|
|
5
5
|
}
|
|
6
6
|
export const Service = VideoClientService;
|
|
7
|
+
// A video route whose token isn't a string is a programmer defect, not a provider error.
|
|
8
|
+
const decodeID = (token) => Schema.decodeUnknownEffect(Schema.String)(token).pipe(Effect.orDie);
|
|
7
9
|
export const layer = Layer.effect(Service, Effect.gen(function* () {
|
|
8
10
|
const executor = yield* RequestExecutor.Service;
|
|
9
|
-
const attach = (model,
|
|
11
|
+
const attach = (model, id) => model.route.attach(model, id, executor.execute);
|
|
10
12
|
return Service.of({
|
|
11
|
-
start: (request) => request.model.route
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
status: (model,
|
|
15
|
-
result: (model,
|
|
16
|
-
cancel: (model,
|
|
13
|
+
start: (request) => request.model.route.start(request, executor.execute).pipe(
|
|
14
|
+
// The token, not the snapshot id, is what `status` and `result` decode; `VideoModel.fromRoute` makes it a string.
|
|
15
|
+
Effect.flatMap((generation) => decodeID(generation.token)), Effect.map((id) => ({ id }))),
|
|
16
|
+
status: (model, id) => attach(model, id).pipe(Effect.flatMap((route) => route.status), Effect.map((snapshot) => ({ status: snapshot.status, progress: snapshot.progress }))),
|
|
17
|
+
result: (model, id) => attach(model, id).pipe(Effect.flatMap((route) => route.result)),
|
|
18
|
+
cancel: (model, id) => attach(model, id).pipe(Effect.flatMap((route) => route.cancel ??
|
|
17
19
|
Effect.fail(new AIError({
|
|
18
20
|
reason: new UnsupportedOperationError({
|
|
19
21
|
operation: "video.cancel",
|
|
@@ -28,7 +30,7 @@ export const VideoClient = {
|
|
|
28
30
|
Service,
|
|
29
31
|
layer,
|
|
30
32
|
start: (request) => Service.use((client) => client.start(request)),
|
|
31
|
-
status: (model,
|
|
32
|
-
result: (model,
|
|
33
|
-
cancel: (model,
|
|
33
|
+
status: (model, id) => Service.use((client) => client.status(model, id)),
|
|
34
|
+
result: (model, id) => Service.use((client) => client.result(model, id)),
|
|
35
|
+
cancel: (model, id) => Service.use((client) => client.cancel(model, id)),
|
|
34
36
|
};
|
package/dist/video.d.ts
CHANGED
|
@@ -6,11 +6,12 @@ import { MediaRoute } from "./route/media.js";
|
|
|
6
6
|
import { AIError, type OpenString, type BaseRequest } from "./schema/index.js";
|
|
7
7
|
import { Service } from "./video-client.js";
|
|
8
8
|
export type VideoOptions = MediaModel.Options;
|
|
9
|
-
/** Video generation is always a queued job: submit, then read its status and result by
|
|
9
|
+
/** Video generation is always a queued job: submit, then read its status and result by the provider's job ID. */
|
|
10
10
|
export type VideoRoute = MediaRoute.QueuedRoute<VideoRequest, VideoResponse>;
|
|
11
11
|
export declare class VideoModel<Options extends VideoOptions = VideoOptions> extends MediaModel<VideoRoute, Options> {
|
|
12
12
|
protected readonly _VideoModel: void;
|
|
13
|
-
|
|
13
|
+
/** A video route's token is the provider's job ID, so `VideoJob.id` is exactly what `status` and `result` take. */
|
|
14
|
+
static fromRoute<Options extends VideoOptions>(route: MediaModel.QueuedRouteInput<VideoRequest<VideoModel<Options>>, VideoResponse, string>, input: MediaRoute.ModelInput): VideoModel<Options>;
|
|
14
15
|
}
|
|
15
16
|
export declare const VideoModelSchema: Schema.declare<VideoModel<{
|
|
16
17
|
readonly [x: string]: unknown;
|
|
@@ -33,69 +34,9 @@ declare const VideoRequestSchema: Schema.Struct<{
|
|
|
33
34
|
}>>;
|
|
34
35
|
readonly prompt: Schema.String;
|
|
35
36
|
/** Image the video starts on exactly. */
|
|
36
|
-
readonly start: Schema.optional<Schema.
|
|
37
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
38
|
-
readonly type: Schema.Literal<"bytes">;
|
|
39
|
-
readonly data: Schema.Uint8Array;
|
|
40
|
-
readonly mediaType: Schema.String;
|
|
41
|
-
}>, Schema.Struct<{
|
|
42
|
-
readonly type: Schema.Literal<"base64">;
|
|
43
|
-
readonly data: Schema.String;
|
|
44
|
-
readonly mediaType: Schema.String;
|
|
45
|
-
}>, Schema.Struct<{
|
|
46
|
-
readonly type: Schema.Literal<"url">;
|
|
47
|
-
readonly url: Schema.String;
|
|
48
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
49
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
50
|
-
}>, Schema.Struct<{
|
|
51
|
-
readonly type: Schema.Literal<"ref">;
|
|
52
|
-
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
53
|
-
readonly id: Schema.String;
|
|
54
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
55
|
-
}>]>;
|
|
56
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
57
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
58
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
59
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
60
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
61
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
62
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
63
|
-
readonly format: Schema.optional<Schema.String>;
|
|
64
|
-
}>>;
|
|
65
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
66
|
-
}>, never, never>>;
|
|
37
|
+
readonly start: Schema.optional<Schema.brand<Schema.declare<Media.Asset, Media.Asset>, "Media.ImageAsset">>;
|
|
67
38
|
/** Image the video ends on exactly. */
|
|
68
|
-
readonly end: Schema.optional<Schema.
|
|
69
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
70
|
-
readonly type: Schema.Literal<"bytes">;
|
|
71
|
-
readonly data: Schema.Uint8Array;
|
|
72
|
-
readonly mediaType: Schema.String;
|
|
73
|
-
}>, Schema.Struct<{
|
|
74
|
-
readonly type: Schema.Literal<"base64">;
|
|
75
|
-
readonly data: Schema.String;
|
|
76
|
-
readonly mediaType: Schema.String;
|
|
77
|
-
}>, Schema.Struct<{
|
|
78
|
-
readonly type: Schema.Literal<"url">;
|
|
79
|
-
readonly url: Schema.String;
|
|
80
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
81
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
82
|
-
}>, Schema.Struct<{
|
|
83
|
-
readonly type: Schema.Literal<"ref">;
|
|
84
|
-
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
85
|
-
readonly id: Schema.String;
|
|
86
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
87
|
-
}>]>;
|
|
88
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
89
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
90
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
91
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
92
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
93
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
94
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
95
|
-
readonly format: Schema.optional<Schema.String>;
|
|
96
|
-
}>>;
|
|
97
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
98
|
-
}>, never, never>>;
|
|
39
|
+
readonly end: Schema.optional<Schema.brand<Schema.declare<Media.Asset, Media.Asset>, "Media.ImageAsset">>;
|
|
99
40
|
/** Images, videos or audio that guide the subject or style without pinning a frame. */
|
|
100
41
|
readonly references: Schema.optional<Schema.$Array<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
101
42
|
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
@@ -142,17 +83,18 @@ export type VideoRequest<Model extends VideoModel = VideoModel> = Omit<typeof Vi
|
|
|
142
83
|
export type VideoModelOptions<Model> = Model extends VideoModel<infer Options> ? Options : never;
|
|
143
84
|
/** Input accepted by `ai.video.request` and `ai.video.start`; a `VideoRequest` is also a valid input. */
|
|
144
85
|
export type VideoRequestInput<Model extends VideoModel = VideoModel> = Omit<VideoRequest<Model>, "start" | "end" | "references" | "providerOptions"> & {
|
|
145
|
-
|
|
146
|
-
readonly
|
|
86
|
+
/** An image: `Media.image(...)`, or a URL, data URL, base64 string or bytes, which must not be a known non-image. */
|
|
87
|
+
readonly start?: Media.ImageAsset | Media.Data;
|
|
88
|
+
readonly end?: Media.ImageAsset | Media.Data;
|
|
147
89
|
readonly references?: ReadonlyArray<Media.Input>;
|
|
148
90
|
readonly providerOptions?: NoInfer<VideoModelOptions<Model>>;
|
|
149
91
|
};
|
|
150
92
|
/** Seconds in a request's `duration`, for protocols that send a number. */
|
|
151
93
|
export declare const seconds: (duration: VideoDuration) => number;
|
|
152
|
-
/** A submitted generation. Store `
|
|
94
|
+
/** A submitted generation. Store `id` with the model to read the job later, from any process. */
|
|
153
95
|
export interface VideoJob {
|
|
96
|
+
/** The provider's job ID. */
|
|
154
97
|
readonly id: string;
|
|
155
|
-
readonly token: unknown;
|
|
156
98
|
}
|
|
157
99
|
export interface VideoStatus {
|
|
158
100
|
readonly status: Status;
|
|
@@ -219,12 +161,12 @@ export declare class VideoResponse extends VideoResponse_base {
|
|
|
219
161
|
export declare const request: <const Model extends VideoModel>(input: VideoRequestInput<Model>) => VideoRequest<Model>;
|
|
220
162
|
/** Submit a generation and return at once; nothing polls. */
|
|
221
163
|
export declare function start<const Model extends VideoModel>(input: VideoRequestInput<Model>): Effect.Effect<VideoJob, AIError, Service>;
|
|
222
|
-
/** One status read for a
|
|
223
|
-
export declare const status: (model: VideoModel,
|
|
164
|
+
/** One status read for a job ID. */
|
|
165
|
+
export declare const status: (model: VideoModel, id: string) => Effect.Effect<VideoStatus, AIError, Service>;
|
|
224
166
|
/** The finished videos; fails while the job is still running, or with the provider's reason when it failed. */
|
|
225
|
-
export declare const result: (model: VideoModel,
|
|
167
|
+
export declare const result: (model: VideoModel, id: string) => Effect.Effect<VideoResponse, AIError, Service>;
|
|
226
168
|
/** Ask the provider to stop the job; fails with `UnsupportedOperation` when the provider has no cancel call. */
|
|
227
|
-
export declare const cancel: (model: VideoModel,
|
|
169
|
+
export declare const cancel: (model: VideoModel, id: string) => Effect.Effect<void, AIError, Service>;
|
|
228
170
|
export declare const Video: {
|
|
229
171
|
readonly request: typeof request;
|
|
230
172
|
readonly start: typeof start;
|
package/dist/video.js
CHANGED
|
@@ -5,6 +5,7 @@ import { MediaRoute } from "./route/media.js";
|
|
|
5
5
|
import { AIError, MediaUsage, ProviderMetadata, ProviderOptions, } from "./schema/index.js";
|
|
6
6
|
import { VideoClient, Service } from "./video-client.js";
|
|
7
7
|
export class VideoModel extends MediaModel {
|
|
8
|
+
/** A video route's token is the provider's job ID, so `VideoJob.id` is exactly what `status` and `result` take. */
|
|
8
9
|
static fromRoute(route, input) {
|
|
9
10
|
return new VideoModel({
|
|
10
11
|
id: input.id,
|
|
@@ -24,9 +25,9 @@ const VideoRequestSchema = Schema.Struct({
|
|
|
24
25
|
model: VideoModelSchema,
|
|
25
26
|
prompt: Schema.String,
|
|
26
27
|
/** Image the video starts on exactly. */
|
|
27
|
-
start: Schema.optional(Media.
|
|
28
|
+
start: Schema.optional(Media.ImageAssetSchema),
|
|
28
29
|
/** Image the video ends on exactly. */
|
|
29
|
-
end: Schema.optional(Media.
|
|
30
|
+
end: Schema.optional(Media.ImageAssetSchema),
|
|
30
31
|
/** Images, videos or audio that guide the subject or style without pinning a frame. */
|
|
31
32
|
references: Schema.optional(Schema.Array(Media.AssetSchema)),
|
|
32
33
|
duration: Schema.optional(VideoDuration),
|
|
@@ -53,8 +54,8 @@ export class VideoResponse extends Schema.Class("Video.Response")({
|
|
|
53
54
|
/** Normalize video request input into a plain `VideoRequest`. */
|
|
54
55
|
export const request = (input) => ({
|
|
55
56
|
...input,
|
|
56
|
-
start: input.start === undefined ? undefined : Media.
|
|
57
|
-
end: input.end === undefined ? undefined : Media.
|
|
57
|
+
start: input.start === undefined ? undefined : Media.image(input.start),
|
|
58
|
+
end: input.end === undefined ? undefined : Media.image(input.end),
|
|
58
59
|
references: input.references?.map((reference) => Media.make(reference)),
|
|
59
60
|
});
|
|
60
61
|
const validate = Schema.decodeUnknownSync(VideoRequestSchema);
|
|
@@ -66,12 +67,12 @@ const requestEffect = (input) => tryRequest(() => {
|
|
|
66
67
|
export function start(input) {
|
|
67
68
|
return requestEffect(input).pipe(Effect.flatMap((request) => VideoClient.start(request)));
|
|
68
69
|
}
|
|
69
|
-
/** One status read for a
|
|
70
|
-
export const status = (model,
|
|
70
|
+
/** One status read for a job ID. */
|
|
71
|
+
export const status = (model, id) => VideoClient.status(model, id);
|
|
71
72
|
/** The finished videos; fails while the job is still running, or with the provider's reason when it failed. */
|
|
72
|
-
export const result = (model,
|
|
73
|
+
export const result = (model, id) => VideoClient.result(model, id);
|
|
73
74
|
/** Ask the provider to stop the job; fails with `UnsupportedOperation` when the provider has no cancel call. */
|
|
74
|
-
export const cancel = (model,
|
|
75
|
+
export const cancel = (model, id) => VideoClient.cancel(model, id);
|
|
75
76
|
export const Video = {
|
|
76
77
|
request,
|
|
77
78
|
start,
|