@vibedev-si/dsh-vibedev 0.2.1
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/LICENSE +21 -0
- package/README.md +155 -0
- package/THIRD-PARTY-NOTICES.txt +566 -0
- package/client/client.js +1368 -0
- package/cordis.patch.yml +5 -0
- package/icon.svg +7 -0
- package/lib/account/index.d.ts +118 -0
- package/lib/anthropic-messages-KOS0z8Fy.js +13472 -0
- package/lib/auth/credentials.d.ts +47 -0
- package/lib/auth/login.d.ts +154 -0
- package/lib/gateway/assets.d.ts +61 -0
- package/lib/gateway/catalog.d.ts +126 -0
- package/lib/gateway/errors.d.ts +76 -0
- package/lib/gateway/http.d.ts +94 -0
- package/lib/index.d.ts +105 -0
- package/lib/index.js +7301 -0
- package/lib/llm/adapter.d.ts +129 -0
- package/lib/llm/catalog.d.ts +75 -0
- package/lib/llm/context.d.ts +54 -0
- package/lib/llm/index.d.ts +69 -0
- package/lib/llm/limits.d.ts +19 -0
- package/lib/llm/models.d.ts +67 -0
- package/lib/llm/replay.d.ts +66 -0
- package/lib/llm/stream.d.ts +46 -0
- package/lib/media/chat.d.ts +49 -0
- package/lib/media/sources.d.ts +46 -0
- package/lib/models-CAcLevEN.js +1045 -0
- package/lib/node-Cujw_a4_.js +2403 -0
- package/lib/node-vkDR3GtK.js +25 -0
- package/lib/openai-completions-DqTCiqpS.js +983 -0
- package/lib/openai-prompt-cache-kzRZVokq.js +9567 -0
- package/lib/openai-responses-DygWnsye.js +832 -0
- package/lib/pricing.d.ts +49 -0
- package/lib/runtime.d.ts +150 -0
- package/lib/search/provider.d.ts +86 -0
- package/lib/service.d.ts +99 -0
- package/lib/tasks/remote.d.ts +47 -0
- package/lib/tasks/store.d.ts +132 -0
- package/lib/tasks/tracker.d.ts +127 -0
- package/lib/tools/account.d.ts +21 -0
- package/lib/tools/audio.d.ts +13 -0
- package/lib/tools/common.d.ts +77 -0
- package/lib/tools/image.d.ts +50 -0
- package/lib/tools/models.d.ts +13 -0
- package/lib/tools/tasks.d.ts +13 -0
- package/lib/tools/transcribe.d.ts +19 -0
- package/lib/tools/video.d.ts +48 -0
- package/lib/transform-messages-Csvf2ItW.js +1023 -0
- package/lib/util/files.d.ts +80 -0
- package/lib/video/plan.d.ts +96 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +127 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Following video and audio tasks to the end: submit under the task's
|
|
3
|
+
* idempotency key, poll the gateway, save the results into the workspace and
|
|
4
|
+
* record the outcome. Polling belongs to the plugin, not to a tool call or a
|
|
5
|
+
* background job, so a task keeps being followed after its job is stopped and
|
|
6
|
+
* after the host restarts.
|
|
7
|
+
*
|
|
8
|
+
* Money rules: a task record is removed only when the first submission was
|
|
9
|
+
* refused outright, so nothing can exist under its key. Every answer that
|
|
10
|
+
* leaves the outcome open (no answer, a gateway error, a 409) keeps the record,
|
|
11
|
+
* and the same request is resent under the same key, which returns the
|
|
12
|
+
* original task when there is one. A resend that is refused outright is
|
|
13
|
+
* retried only briefly, so a refused request is not created later behind the
|
|
14
|
+
* user's back.
|
|
15
|
+
* @module dsh-vibedev/tasks/tracker
|
|
16
|
+
*/
|
|
17
|
+
import type { GatewayHttp } from '../gateway/http.js';
|
|
18
|
+
import type { RemoteTask } from './remote.js';
|
|
19
|
+
import type { TaskRecord, TaskStore } from './store.js';
|
|
20
|
+
/** Construction options; the clock and `sleep` are test seams. */
|
|
21
|
+
export interface TrackerOptions {
|
|
22
|
+
readonly http: GatewayHttp;
|
|
23
|
+
readonly store: TaskStore;
|
|
24
|
+
readonly log?: (message: string) => void;
|
|
25
|
+
readonly now?: () => number;
|
|
26
|
+
/** Resolves after `ms`, or early when `signal` aborts; never rejects. */
|
|
27
|
+
readonly sleep?: (ms: number, signal: AbortSignal) => Promise<void>;
|
|
28
|
+
/** Give up on a task this long after it was created. Defaults to 3 hours. */
|
|
29
|
+
readonly maxAgeMs?: number;
|
|
30
|
+
/** An unconfirmed submission is resent until it is this old. Defaults to 5 minutes. */
|
|
31
|
+
readonly resendWindowMs?: number;
|
|
32
|
+
/**
|
|
33
|
+
* A resend refused outright is retried until the task is this old, in case
|
|
34
|
+
* an earlier attempt is still being created. Defaults to 3 minutes.
|
|
35
|
+
*/
|
|
36
|
+
readonly refusalGraceMs?: number;
|
|
37
|
+
/** Download attempts for a finished task before its links are reported instead. Defaults to 5. */
|
|
38
|
+
readonly downloadAttempts?: number;
|
|
39
|
+
/** The largest output downloaded. Defaults to 2 GiB. */
|
|
40
|
+
readonly maxDownloadBytes?: number;
|
|
41
|
+
/** A claim not renewed for this long is taken over by another process. Defaults to 60 seconds. */
|
|
42
|
+
readonly claimStaleMs?: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Whether a failed submission may still have created the task: no answer, an
|
|
46
|
+
* unreadable answer, a gateway error that is not "busy", or a 409 such as
|
|
47
|
+
* `VIDEO_SUBMISSION_IN_PROGRESS` (an earlier attempt is still being submitted).
|
|
48
|
+
* @param error - the failure.
|
|
49
|
+
* @returns true when the same key should be sent again.
|
|
50
|
+
*/
|
|
51
|
+
export declare function outcomeUnknown(error: unknown): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The live progress line of a running task.
|
|
54
|
+
* @param task - the gateway's view.
|
|
55
|
+
* @returns a short line such as `in progress 40%`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function progressLine(task: RemoteTask): string;
|
|
58
|
+
/** Follows tasks; one poll loop per task. */
|
|
59
|
+
export declare class TaskTracker {
|
|
60
|
+
private readonly options;
|
|
61
|
+
private readonly following;
|
|
62
|
+
private readonly submissions;
|
|
63
|
+
private readonly listeners;
|
|
64
|
+
private readonly claims;
|
|
65
|
+
private readonly downloadFailures;
|
|
66
|
+
private readonly controller;
|
|
67
|
+
private readonly holder;
|
|
68
|
+
private readonly now;
|
|
69
|
+
private readonly sleep;
|
|
70
|
+
/**
|
|
71
|
+
* @param options - gateway client, store and test seams.
|
|
72
|
+
*/
|
|
73
|
+
constructor(options: TrackerOptions);
|
|
74
|
+
private get signal();
|
|
75
|
+
private log;
|
|
76
|
+
/**
|
|
77
|
+
* Record and submit a new task. An outright refusal of the first attempt
|
|
78
|
+
* throws and leaves no record. When the outcome stays open, the task stays
|
|
79
|
+
* recorded and is resent in the background, and this throws `SUBMISSION_UNCONFIRMED`.
|
|
80
|
+
* @param draft - the task, with status `submitting`.
|
|
81
|
+
* @param signal - cancels waiting for the submission.
|
|
82
|
+
* @returns the accepted task.
|
|
83
|
+
*/
|
|
84
|
+
submit(draft: TaskRecord, signal?: AbortSignal): Promise<TaskRecord>;
|
|
85
|
+
private runSubmission;
|
|
86
|
+
/**
|
|
87
|
+
* Follow a recorded task until it ends or the tracker is disposed. A task
|
|
88
|
+
* still being submitted is followed once its submission settles.
|
|
89
|
+
* @param id - the local task id.
|
|
90
|
+
* @returns the task at the end (or at disposal, still running).
|
|
91
|
+
*/
|
|
92
|
+
follow(id: string): Promise<TaskRecord>;
|
|
93
|
+
private followQuietly;
|
|
94
|
+
/**
|
|
95
|
+
* Hear about every change to one task.
|
|
96
|
+
* @param id - the local task id.
|
|
97
|
+
* @param listener - called with the updated task.
|
|
98
|
+
* @returns unsubscribe.
|
|
99
|
+
*/
|
|
100
|
+
onUpdate(id: string, listener: (record: TaskRecord) => void): () => void;
|
|
101
|
+
/** Follow every task that has not ended, as after a restart. */
|
|
102
|
+
resume(): Promise<void>;
|
|
103
|
+
/** Stop all polling and give up this process's claims; tasks stay recorded and are resumed next time. */
|
|
104
|
+
dispose(): void;
|
|
105
|
+
private notify;
|
|
106
|
+
private update;
|
|
107
|
+
private finish;
|
|
108
|
+
/** Hold (or keep) this process's claim on a task, renewing it while held. */
|
|
109
|
+
private holdClaim;
|
|
110
|
+
private dropClaim;
|
|
111
|
+
private releaseClaim;
|
|
112
|
+
private loop;
|
|
113
|
+
/**
|
|
114
|
+
* Decide what a failed resend, poll or download means.
|
|
115
|
+
* @returns how long to wait before the next try, or undefined once the task has been ended.
|
|
116
|
+
*/
|
|
117
|
+
private afterFailure;
|
|
118
|
+
/** Record what the gateway says about a task; save the outputs of a finished one. */
|
|
119
|
+
private apply;
|
|
120
|
+
/**
|
|
121
|
+
* Save every output not saved yet, recording each one as it lands. A
|
|
122
|
+
* shutdown mid-download throws, so the task stays open and is resumed.
|
|
123
|
+
*/
|
|
124
|
+
private saveOutputs;
|
|
125
|
+
/** Download one output: the authenticated `/content` route, then the gateway's no-login link. */
|
|
126
|
+
private fetchOutput;
|
|
127
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `media_account`: which VibeDev account the VibeDev models and media requests
|
|
3
|
+
* use, and the plugin's own sign-in for hosts without a VibeDev account
|
|
4
|
+
* (official DeepSeek Harness). People can also sign in from the sidebar or
|
|
5
|
+
* Settings → VibeDev 账号; this is the agent's way to the same sign-in.
|
|
6
|
+
* @module dsh-vibedev/tools/account
|
|
7
|
+
*/
|
|
8
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
9
|
+
import type { CredentialChain } from '../auth/credentials.js';
|
|
10
|
+
import type { PluginLogin } from '../auth/login.js';
|
|
11
|
+
import type { MediaRuntime } from '../runtime.js';
|
|
12
|
+
/** Where new users register. */
|
|
13
|
+
export declare const REGISTER_URL = "https://vibedev.jzsaas.com";
|
|
14
|
+
/**
|
|
15
|
+
* Build the tool.
|
|
16
|
+
* @param runtime - the media runtime.
|
|
17
|
+
* @param chain - the credential chain.
|
|
18
|
+
* @param login - the plugin's own sign-in.
|
|
19
|
+
* @returns the tool definition.
|
|
20
|
+
*/
|
|
21
|
+
export declare function mediaAccountTool(runtime: MediaRuntime, chain: CredentialChain, login: PluginLogin): ToolDefinition;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `audio_generate`: a song or a podcast episode, as a background task whose
|
|
3
|
+
* results are saved in the workspace.
|
|
4
|
+
* @module dsh-vibedev/tools/audio
|
|
5
|
+
*/
|
|
6
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
7
|
+
import type { MediaRuntime } from '../runtime.js';
|
|
8
|
+
/**
|
|
9
|
+
* Build the tool.
|
|
10
|
+
* @param runtime - the media runtime.
|
|
11
|
+
* @returns the tool definition.
|
|
12
|
+
*/
|
|
13
|
+
export declare function audioGenerateTool(runtime: MediaRuntime): ToolDefinition;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pieces the media tools share: how inputs are described to the model, the
|
|
3
|
+
* background job that reports a video or audio task, and the wording of task
|
|
4
|
+
* outcomes.
|
|
5
|
+
* @module dsh-vibedev/tools/common
|
|
6
|
+
*/
|
|
7
|
+
import type { ToolRunContext } from '@deepseek-ai/dsh-tools';
|
|
8
|
+
import type { MediaRuntime } from '../runtime.js';
|
|
9
|
+
import type { TaskRecord } from '../tasks/store.js';
|
|
10
|
+
declare module '@deepseek-ai/dsh-jobs' {
|
|
11
|
+
interface JobKindMap {
|
|
12
|
+
'media-video': 'media-video';
|
|
13
|
+
'media-audio': 'media-audio';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** How a media input may be given, for parameter descriptions. */
|
|
17
|
+
export declare const SOURCE_HELP = "a workspace file path, an http(s) link, or chat:1 for the most recent matching file the user attached in this conversation (chat:2 the one before)";
|
|
18
|
+
/**
|
|
19
|
+
* A prompt excerpt for labels.
|
|
20
|
+
* @param prompt - the prompt.
|
|
21
|
+
* @param max - the longest excerpt.
|
|
22
|
+
* @returns the excerpt.
|
|
23
|
+
*/
|
|
24
|
+
export declare function excerpt(prompt: string | undefined, max?: number): string;
|
|
25
|
+
/**
|
|
26
|
+
* The charge line of a finished task.
|
|
27
|
+
* @param record - the task.
|
|
28
|
+
* @returns `Charged ¥4.95.`, an estimate, or the empty string.
|
|
29
|
+
*/
|
|
30
|
+
export declare function moneyLine(record: TaskRecord): string;
|
|
31
|
+
/**
|
|
32
|
+
* The model-facing account of a task's current state.
|
|
33
|
+
* @param runtime - for display paths.
|
|
34
|
+
* @param exec - the tool call, for workspace-relative paths; optional after a restart.
|
|
35
|
+
* @param record - the task.
|
|
36
|
+
* @returns the text.
|
|
37
|
+
*/
|
|
38
|
+
export declare function describeTask(runtime: MediaRuntime, exec: ToolRunContext | undefined, record: TaskRecord): string;
|
|
39
|
+
/**
|
|
40
|
+
* Report a submitted task through a background job owned by the calling
|
|
41
|
+
* session, so the agent hears when it ends. Stopping the job stops the report,
|
|
42
|
+
* not the task: the gateway has no cancel, so the task still finishes, is saved
|
|
43
|
+
* and is charged.
|
|
44
|
+
* @param runtime - the media runtime.
|
|
45
|
+
* @param exec - the submitting tool call.
|
|
46
|
+
* @param record - the accepted task.
|
|
47
|
+
* @returns the job id, or undefined when the host has no job registry or refused the job.
|
|
48
|
+
*/
|
|
49
|
+
export declare function startTaskJob(runtime: MediaRuntime, exec: ToolRunContext, record: TaskRecord): string | undefined;
|
|
50
|
+
/** A submitted task and how it is reported. */
|
|
51
|
+
export interface Submitted {
|
|
52
|
+
readonly record: TaskRecord;
|
|
53
|
+
/** The background job reporting it, when the host has a job registry. */
|
|
54
|
+
readonly jobId?: string;
|
|
55
|
+
/** The gateway did not confirm the submission; it is being resent under the same key. */
|
|
56
|
+
readonly unconfirmed: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Submit a task and start its report. An unconfirmed submission is not an
|
|
60
|
+
* error here: the agent must not resubmit it, so it is reported like any
|
|
61
|
+
* other task while the tracker resends it under the same key.
|
|
62
|
+
* @param runtime - the media runtime.
|
|
63
|
+
* @param exec - the tool call.
|
|
64
|
+
* @param draft - the task to submit.
|
|
65
|
+
* @returns the task and its job.
|
|
66
|
+
*/
|
|
67
|
+
export declare function submitTask(runtime: MediaRuntime, exec: ToolRunContext, draft: TaskRecord): Promise<Submitted>;
|
|
68
|
+
/** The sentence about an unconfirmed submission. */
|
|
69
|
+
export declare const UNCONFIRMED_NOTE: string;
|
|
70
|
+
/**
|
|
71
|
+
* Wait for a task in the tool call itself, for hosts without background jobs.
|
|
72
|
+
* @param runtime - the media runtime.
|
|
73
|
+
* @param exec - the tool call; aborting stops waiting, not the task.
|
|
74
|
+
* @param record - the accepted task.
|
|
75
|
+
* @returns the task when it ended, or as it stands when the wait was cut short.
|
|
76
|
+
*/
|
|
77
|
+
export declare function waitForTask(runtime: MediaRuntime, exec: ToolRunContext, record: TaskRecord): Promise<TaskRecord>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `image_generate`: generate images, or edit/derive from reference images,
|
|
3
|
+
* save them in the workspace and show them to the model.
|
|
4
|
+
* @module dsh-vibedev/tools/image
|
|
5
|
+
*/
|
|
6
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
7
|
+
import type { MediaCall, MediaRuntime } from '../runtime.js';
|
|
8
|
+
/** One image request, as the tool and host callers make it. */
|
|
9
|
+
export interface ImageRequest {
|
|
10
|
+
readonly prompt: string;
|
|
11
|
+
readonly model?: string;
|
|
12
|
+
/** `WIDTHxHEIGHT` or `auto`. */
|
|
13
|
+
readonly size?: string;
|
|
14
|
+
readonly quality?: string;
|
|
15
|
+
/** 1-4. */
|
|
16
|
+
readonly n?: number;
|
|
17
|
+
/** Images to edit or draw from: paths, links, data URLs or `chat:` references. */
|
|
18
|
+
readonly references?: readonly string[];
|
|
19
|
+
}
|
|
20
|
+
/** One saved image. */
|
|
21
|
+
export interface GeneratedImage {
|
|
22
|
+
readonly absolutePath: string;
|
|
23
|
+
readonly mediaType: string;
|
|
24
|
+
readonly bytes: number;
|
|
25
|
+
readonly data: Uint8Array;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Generate images and save them: model choice, reference checks, the spending
|
|
29
|
+
* confirmation, the gateway call and the files.
|
|
30
|
+
* @param runtime - the media runtime.
|
|
31
|
+
* @param call - the tool call or host call.
|
|
32
|
+
* @param request - what to generate.
|
|
33
|
+
* @param save - where: the folder and the file-name stem (`-2`, `-3`... for more than one).
|
|
34
|
+
* @returns the model, the saved images, the estimate and a revised prompt.
|
|
35
|
+
*/
|
|
36
|
+
export declare function generateImages(runtime: MediaRuntime, call: MediaCall, request: ImageRequest, save: {
|
|
37
|
+
readonly folder: string;
|
|
38
|
+
readonly stem: string;
|
|
39
|
+
}): Promise<{
|
|
40
|
+
model: string;
|
|
41
|
+
images: GeneratedImage[];
|
|
42
|
+
estimatedCny?: string;
|
|
43
|
+
revisedPrompt?: string;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Build the tool.
|
|
47
|
+
* @param runtime - the media runtime.
|
|
48
|
+
* @returns the tool definition.
|
|
49
|
+
*/
|
|
50
|
+
export declare function imageGenerateTool(runtime: MediaRuntime): ToolDefinition;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `media_models`: the media models this VibeDev account can use, with prices
|
|
3
|
+
* and, for video, what each generation mode accepts.
|
|
4
|
+
* @module dsh-vibedev/tools/models
|
|
5
|
+
*/
|
|
6
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
7
|
+
import type { MediaRuntime } from '../runtime.js';
|
|
8
|
+
/**
|
|
9
|
+
* Build the tool.
|
|
10
|
+
* @param runtime - the media runtime.
|
|
11
|
+
* @returns the tool definition.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mediaModelsTool(runtime: MediaRuntime): ToolDefinition;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `media_tasks`: the video and audio tasks dsh-vibedev is following or has
|
|
3
|
+
* finished, newest first.
|
|
4
|
+
* @module dsh-vibedev/tools/tasks
|
|
5
|
+
*/
|
|
6
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
7
|
+
import type { MediaRuntime } from '../runtime.js';
|
|
8
|
+
/**
|
|
9
|
+
* Build the tool.
|
|
10
|
+
* @param runtime - the media runtime.
|
|
11
|
+
* @returns the tool definition.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mediaTasksTool(runtime: MediaRuntime): ToolDefinition;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `audio_transcribe`: speech to text with a VibeDev transcription model.
|
|
3
|
+
* Short files answer directly; long ones become a task that is polled here.
|
|
4
|
+
* @module dsh-vibedev/tools/transcribe
|
|
5
|
+
*/
|
|
6
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
7
|
+
import type { MediaRuntime } from '../runtime.js';
|
|
8
|
+
/**
|
|
9
|
+
* The length of a PCM WAV file from its header.
|
|
10
|
+
* @param data - the file bytes.
|
|
11
|
+
* @returns seconds, or undefined when the header cannot be read.
|
|
12
|
+
*/
|
|
13
|
+
export declare function wavSeconds(data: Uint8Array): number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Build the tool.
|
|
16
|
+
* @param runtime - the media runtime.
|
|
17
|
+
* @returns the tool definition.
|
|
18
|
+
*/
|
|
19
|
+
export declare function audioTranscribeTool(runtime: MediaRuntime): ToolDefinition;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `video_generate`: plan a video request against what the chosen model
|
|
3
|
+
* declares, upload every reference to the gateway media library, check the
|
|
4
|
+
* measured reference lengths, submit once under an idempotency key and report
|
|
5
|
+
* the result through a background job.
|
|
6
|
+
* @module dsh-vibedev/tools/video
|
|
7
|
+
*/
|
|
8
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
9
|
+
import type { MediaModel, VideoInput } from '../gateway/catalog.js';
|
|
10
|
+
import type { MediaCall, MediaRuntime } from '../runtime.js';
|
|
11
|
+
import type { TaskRecord } from '../tasks/store.js';
|
|
12
|
+
import type { VideoPlan, VideoRequestOptions } from '../video/plan.js';
|
|
13
|
+
/** One video request, as the tool and host callers make it. */
|
|
14
|
+
export interface VideoRequest extends VideoRequestOptions {
|
|
15
|
+
readonly model?: string;
|
|
16
|
+
}
|
|
17
|
+
/** A video request checked, uploaded and priced, ready to submit. */
|
|
18
|
+
export interface PreparedVideo {
|
|
19
|
+
readonly model: MediaModel;
|
|
20
|
+
readonly plan: VideoPlan;
|
|
21
|
+
/** The task to submit (status `submitting`). */
|
|
22
|
+
readonly draft: TaskRecord;
|
|
23
|
+
/** One entry per uploaded input, in request order. */
|
|
24
|
+
readonly inputs: readonly VideoInput[];
|
|
25
|
+
/** `5 s, 16:9, 720p`, for messages. */
|
|
26
|
+
readonly shape: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Everything before a video submission: choose a model that can serve the
|
|
30
|
+
* request, load and check every input, upload them all to the gateway media
|
|
31
|
+
* library, check the measured reference lengths, price it, confirm the
|
|
32
|
+
* spending, and build the task.
|
|
33
|
+
* @param runtime - the media runtime.
|
|
34
|
+
* @param call - the tool call or host call.
|
|
35
|
+
* @param request - what to generate.
|
|
36
|
+
* @param save - where the finished video goes: the folder and the file-name stem.
|
|
37
|
+
* @returns the prepared task.
|
|
38
|
+
*/
|
|
39
|
+
export declare function prepareVideoTask(runtime: MediaRuntime, call: MediaCall, request: VideoRequest, save: {
|
|
40
|
+
readonly folder: string;
|
|
41
|
+
readonly stem: string;
|
|
42
|
+
}): Promise<PreparedVideo>;
|
|
43
|
+
/**
|
|
44
|
+
* Build the tool.
|
|
45
|
+
* @param runtime - the media runtime.
|
|
46
|
+
* @returns the tool definition.
|
|
47
|
+
*/
|
|
48
|
+
export declare function videoGenerateTool(runtime: MediaRuntime): ToolDefinition;
|