@vibedev-si/dsh-vibedev 0.2.6 → 0.3.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/README.md +16 -2
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/client/client.js +127 -22
- package/lib/account/index.d.ts +3 -1
- package/lib/auth/credentials.d.ts +5 -3
- package/lib/auth/login.d.ts +12 -2
- package/lib/auth/sign-in-state.d.ts +21 -0
- package/lib/gateway/catalog.d.ts +7 -0
- package/lib/gateway/errors.d.ts +15 -0
- package/lib/gateway/http.d.ts +1 -1
- package/lib/gateway/origin.d.ts +10 -0
- package/lib/index.js +569 -198
- package/lib/tasks/tracker.d.ts +46 -18
- package/lib/tools/account.d.ts +0 -2
- package/lib/tools/common.d.ts +1 -1
- package/lib/video/plan.d.ts +5 -2
- package/package.json +1 -1
package/lib/tasks/tracker.d.ts
CHANGED
|
@@ -5,13 +5,21 @@
|
|
|
5
5
|
* background job, so a task keeps being followed after its job is stopped and
|
|
6
6
|
* after the host restarts.
|
|
7
7
|
*
|
|
8
|
-
* Money rules
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* and
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
8
|
+
* Money rules, and the rule that one operation creates at most one task:
|
|
9
|
+
*
|
|
10
|
+
* - A submission is settled by the gateway's structured verdict
|
|
11
|
+
* (`submission_state` and `retry_action`) first, and only by the HTTP status
|
|
12
|
+
* when it sends none. `rejected`/`retry_action: none` is final: the reason is
|
|
13
|
+
* saved and nothing is sent again — not by the tool, not by the background
|
|
14
|
+
* loop, not after a restart. `retryable` on its own never authorizes creating
|
|
15
|
+
* another task.
|
|
16
|
+
* - An unknown outcome keeps the record and settles it under the SAME key and
|
|
17
|
+
* the SAME body, which the gateway answers with the original task when there
|
|
18
|
+
* is one. A new key is minted only for a new request the user asks for.
|
|
19
|
+
* - Once a gateway task id is known the task is only polled; a failed poll
|
|
20
|
+
* never submits anything.
|
|
21
|
+
* - A refusal that left nothing under the key ends the record as failed with
|
|
22
|
+
* the gateway's own reason, so the person sees why.
|
|
15
23
|
* @module dsh-vibedev/tasks/tracker
|
|
16
24
|
*/
|
|
17
25
|
import type { GatewayHttp } from '../gateway/http.js';
|
|
@@ -27,13 +35,12 @@ export interface TrackerOptions {
|
|
|
27
35
|
readonly sleep?: (ms: number, signal: AbortSignal) => Promise<void>;
|
|
28
36
|
/** Give up on a task this long after it was created. Defaults to 3 hours. */
|
|
29
37
|
readonly maxAgeMs?: number;
|
|
30
|
-
/** An unconfirmed submission is resent until it is this old. Defaults to 5 minutes. */
|
|
31
|
-
readonly resendWindowMs?: number;
|
|
32
38
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
39
|
+
* How long an unconfirmed submission is reconciled under its own key before
|
|
40
|
+
* the task is given up. Defaults to 5 minutes: this settles what became of
|
|
41
|
+
* that one submission, it never creates another task.
|
|
35
42
|
*/
|
|
36
|
-
readonly
|
|
43
|
+
readonly resendWindowMs?: number;
|
|
37
44
|
/** Download attempts for a finished task before its links are reported instead. Defaults to 5. */
|
|
38
45
|
readonly downloadAttempts?: number;
|
|
39
46
|
/** The largest output downloaded. Defaults to 2 GiB. */
|
|
@@ -42,13 +49,34 @@ export interface TrackerOptions {
|
|
|
42
49
|
readonly claimStaleMs?: number;
|
|
43
50
|
}
|
|
44
51
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* `
|
|
52
|
+
* How a failed submission may be taken further.
|
|
53
|
+
*
|
|
54
|
+
* - `rejected`: the request is refused for good (a parameter refusal, a
|
|
55
|
+
* provider-side rejection, a key conflict); nothing exists under the key and
|
|
56
|
+
* nothing may be created again for this operation.
|
|
57
|
+
* - `reconcile`: the outcome is unknown — the same key and the same body are
|
|
58
|
+
* sent again only to settle what became of that one submission. This never
|
|
59
|
+
* mints a new key and never asks the provider for a new task.
|
|
60
|
+
* - `wait`: nothing was created and the same request may be sent later (busy,
|
|
61
|
+
* rate limited, no balance); the key stays the same.
|
|
62
|
+
*/
|
|
63
|
+
export type SubmissionRecovery = 'rejected' | 'reconcile' | 'wait';
|
|
64
|
+
/**
|
|
65
|
+
* What a failed submission means.
|
|
66
|
+
*
|
|
67
|
+
* The two STOP rules are read before anything that would keep the operation
|
|
68
|
+
* alive, so no verdict can talk the plugin into sending a refused request
|
|
69
|
+
* again: `retry_action: none` (the provider refused it) and
|
|
70
|
+
* `VIDEO_SUBMISSION_AMBIGUOUS` (the gateway's key answers this forever) end the
|
|
71
|
+
* operation even when the same answer also says the outcome is unknown.
|
|
72
|
+
*
|
|
73
|
+
* After those, the gateway's structured verdict decides, and only when it
|
|
74
|
+
* sends none do the HTTP status and the older codes. `retryable` says recovery
|
|
75
|
+
* is still needed; it never authorizes creating another task.
|
|
48
76
|
* @param error - the failure.
|
|
49
|
-
* @returns
|
|
77
|
+
* @returns how it may be taken further.
|
|
50
78
|
*/
|
|
51
|
-
export declare function
|
|
79
|
+
export declare function submissionRecovery(error: unknown): SubmissionRecovery;
|
|
52
80
|
/**
|
|
53
81
|
* The live progress line of a running task.
|
|
54
82
|
* @param task - the gateway's view.
|
|
@@ -122,6 +150,6 @@ export declare class TaskTracker {
|
|
|
122
150
|
* shutdown mid-download throws, so the task stays open and is resumed.
|
|
123
151
|
*/
|
|
124
152
|
private saveOutputs;
|
|
125
|
-
/**
|
|
153
|
+
/** Use a returned signed URL verbatim and without the app token; old gateways without a URL use `/content`. */
|
|
126
154
|
private fetchOutput;
|
|
127
155
|
}
|
package/lib/tools/account.d.ts
CHANGED
|
@@ -9,8 +9,6 @@ import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
|
9
9
|
import type { CredentialChain } from '../auth/credentials.js';
|
|
10
10
|
import type { PluginLogin } from '../auth/login.js';
|
|
11
11
|
import type { MediaRuntime } from '../runtime.js';
|
|
12
|
-
/** Where new users register. */
|
|
13
|
-
export declare const REGISTER_URL = "https://vibedev.jzsaas.com";
|
|
14
12
|
/**
|
|
15
13
|
* Build the tool.
|
|
16
14
|
* @param runtime - the media runtime.
|
package/lib/tools/common.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export interface Submitted {
|
|
|
58
58
|
/**
|
|
59
59
|
* Submit a task and start its report. An unconfirmed submission is not an
|
|
60
60
|
* error here: the agent must not resubmit it, so it is reported like any
|
|
61
|
-
* other task while the tracker
|
|
61
|
+
* other task while the tracker settles that one submission under the same key.
|
|
62
62
|
* @param runtime - the media runtime.
|
|
63
63
|
* @param exec - the tool call.
|
|
64
64
|
* @param draft - the task to submit.
|
package/lib/video/plan.d.ts
CHANGED
|
@@ -78,12 +78,15 @@ export declare function checkReferenceFile(model: MediaModel, input: VideoInput,
|
|
|
78
78
|
*/
|
|
79
79
|
export declare function referenceByteLimit(model: MediaModel, input: VideoInput): number;
|
|
80
80
|
/**
|
|
81
|
-
* Check reference
|
|
81
|
+
* Check the measured lengths of the reference media once the gateway has
|
|
82
|
+
* measured them. A reference's OWN length is what is checked — never the
|
|
83
|
+
* requested output duration — and only against the limits that model declares.
|
|
82
84
|
* @param model - the video model.
|
|
83
85
|
* @param videos - the uploaded reference videos, in order.
|
|
86
|
+
* @param audios - the uploaded reference audios, in order.
|
|
84
87
|
* @throws {@link MediaError} when a clip or the total is outside the model's limits.
|
|
85
88
|
*/
|
|
86
|
-
export declare function checkReferenceDurations(model: MediaModel, videos: readonly ReferenceMedia[]): void;
|
|
89
|
+
export declare function checkReferenceDurations(model: MediaModel, videos: readonly ReferenceMedia[], audios?: readonly ReferenceMedia[]): void;
|
|
87
90
|
/**
|
|
88
91
|
* The `/v1/videos` body for a plan whose inputs are uploaded. The gateway reads
|
|
89
92
|
* one vocabulary and translates it per provider.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibedev-si/dsh-vibedev",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "VibeDev 账号与模型:在 DeepSeek Harness 里登录 VibeDev,与 DeepSeek 账号并存,使用 VibeDev 网关的模型(Claude、GPT 等),并生成图片、视频、音乐和播客 · VibeDev account and models for DeepSeek Harness: sign in to VibeDev next to the DeepSeek account and use the VibeDev gateway's models (Claude, GPT and more), plus image, video, music and podcast generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|