@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,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Files the plugin writes: its state directory, output names in the
|
|
3
|
+
* workspace, and atomic writes of generated media. Content is written to a
|
|
4
|
+
* temporary file first and moved into place only when complete, so a crash
|
|
5
|
+
* never leaves a half-written or empty file under a final name.
|
|
6
|
+
* @module dsh-vibedev/util/files
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The harness home: `$DSH_HOME` when set (VibeDev sets it to its own home),
|
|
10
|
+
* else `~/.dsh`, the same rule the harness itself applies.
|
|
11
|
+
* @param env - the environment.
|
|
12
|
+
* @returns the absolute home directory.
|
|
13
|
+
*/
|
|
14
|
+
export declare function harnessHome(env?: Readonly<Record<string, string | undefined>>): string;
|
|
15
|
+
/**
|
|
16
|
+
* The plugin's own state directory: the configured one, else `<harness home>/dsh-media`
|
|
17
|
+
* (the plugin's former name, kept so an upgrade keeps its tasks and device id).
|
|
18
|
+
* @param configured - the `stateDir` setting; empty for the default.
|
|
19
|
+
* @param env - the environment.
|
|
20
|
+
* @returns the absolute directory.
|
|
21
|
+
*/
|
|
22
|
+
export declare function stateDirectory(configured: string, env?: Readonly<Record<string, string | undefined>>): string;
|
|
23
|
+
/**
|
|
24
|
+
* A file-name stem from free text: characters no file system accepts are
|
|
25
|
+
* dropped, whitespace becomes `-`, and the result is cut to `max` characters.
|
|
26
|
+
* @param text - a prompt or a requested name.
|
|
27
|
+
* @param max - the longest stem, in characters.
|
|
28
|
+
* @returns the stem, possibly empty.
|
|
29
|
+
*/
|
|
30
|
+
export declare function safeStem(text: string, max?: number): string;
|
|
31
|
+
/**
|
|
32
|
+
* A sortable local timestamp for file names (`20261003-165012`).
|
|
33
|
+
* @param date - the moment.
|
|
34
|
+
* @returns the timestamp.
|
|
35
|
+
*/
|
|
36
|
+
export declare function fileTimestamp(date: Date): string;
|
|
37
|
+
/**
|
|
38
|
+
* Rename, retrying the transient refusals Windows gives while a virus scanner
|
|
39
|
+
* or the indexer holds the file.
|
|
40
|
+
* @param from - the current path.
|
|
41
|
+
* @param to - the new path; an existing file is replaced.
|
|
42
|
+
*/
|
|
43
|
+
export declare function renameWithRetry(from: string, to: string): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Move a complete temporary file to the first free name `dir/stem.ext`
|
|
46
|
+
* (then `stem-2.ext`, ...), never replacing an existing file.
|
|
47
|
+
* @param temporary - the complete file.
|
|
48
|
+
* @param dir - the destination directory, created when missing.
|
|
49
|
+
* @param stem - the file-name stem.
|
|
50
|
+
* @param extension - the extension, without a dot.
|
|
51
|
+
* @returns the final path.
|
|
52
|
+
*/
|
|
53
|
+
export declare function placeFile(temporary: string, dir: string, stem: string, extension: string): Promise<string>;
|
|
54
|
+
/**
|
|
55
|
+
* Save bytes under the first free name `dir/stem.ext`.
|
|
56
|
+
* @param dir - the destination directory.
|
|
57
|
+
* @param stem - the file-name stem.
|
|
58
|
+
* @param extension - the extension, without a dot.
|
|
59
|
+
* @param data - the content.
|
|
60
|
+
* @returns the final path.
|
|
61
|
+
*/
|
|
62
|
+
export declare function saveNewFile(dir: string, stem: string, extension: string, data: Uint8Array): Promise<string>;
|
|
63
|
+
/**
|
|
64
|
+
* Write bytes atomically, replacing the file.
|
|
65
|
+
* @param path - the final path.
|
|
66
|
+
* @param data - the content.
|
|
67
|
+
* @param options - `mode` for a file only its owner may read.
|
|
68
|
+
*/
|
|
69
|
+
export declare function writeFileAtomic(path: string, data: Uint8Array, options?: {
|
|
70
|
+
mode?: number;
|
|
71
|
+
}): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Stream a response body into a temporary file, replacing what was there.
|
|
74
|
+
* @param response - a successful response whose body is unread.
|
|
75
|
+
* @param temporary - where to write; the caller moves it into place when this resolves.
|
|
76
|
+
* @param maxBytes - the largest accepted body.
|
|
77
|
+
* @param signal - cancels the download.
|
|
78
|
+
* @returns the number of bytes written.
|
|
79
|
+
*/
|
|
80
|
+
export declare function downloadTo(response: Response, temporary: string, maxBytes: number, signal?: AbortSignal): Promise<number>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video request planning: choose the generation mode, check every input and
|
|
3
|
+
* option against what the chosen model declares, and build the request body.
|
|
4
|
+
* Everything here runs before anything is uploaded or charged, so a request the
|
|
5
|
+
* model cannot serve fails with a message that lists what it can.
|
|
6
|
+
* @module dsh-vibedev/video/plan
|
|
7
|
+
*/
|
|
8
|
+
import type { MediaModel, VideoInput, VideoMode, VideoModeConstraint } from '../gateway/catalog.js';
|
|
9
|
+
/** What the caller asks for. Sources are workspace paths or URLs. */
|
|
10
|
+
export interface VideoRequestOptions {
|
|
11
|
+
readonly prompt: string;
|
|
12
|
+
readonly mode?: VideoMode;
|
|
13
|
+
readonly duration?: number;
|
|
14
|
+
readonly aspectRatio?: string;
|
|
15
|
+
readonly resolution?: string;
|
|
16
|
+
readonly generateAudio?: boolean;
|
|
17
|
+
readonly firstFrame?: string;
|
|
18
|
+
readonly lastFrame?: string;
|
|
19
|
+
readonly referenceImages?: readonly string[];
|
|
20
|
+
readonly referenceVideos?: readonly string[];
|
|
21
|
+
readonly referenceAudios?: readonly string[];
|
|
22
|
+
}
|
|
23
|
+
/** A checked request, ready for its inputs to be uploaded. */
|
|
24
|
+
export interface VideoPlan {
|
|
25
|
+
readonly mode: VideoMode;
|
|
26
|
+
readonly constraint: VideoModeConstraint;
|
|
27
|
+
readonly duration?: number;
|
|
28
|
+
readonly aspectRatio?: string;
|
|
29
|
+
readonly resolution?: string;
|
|
30
|
+
readonly generateAudio?: boolean;
|
|
31
|
+
/** Sources per input, in the caller's order. */
|
|
32
|
+
readonly inputs: Partial<Record<VideoInput, readonly string[]>>;
|
|
33
|
+
}
|
|
34
|
+
/** The media kind each input carries. */
|
|
35
|
+
export declare const INPUT_KIND: Readonly<Record<VideoInput, 'image' | 'video' | 'audio'>>;
|
|
36
|
+
/** The `video_generate` parameter each input arrives in; messages name inputs by it. */
|
|
37
|
+
export declare const INPUT_PARAM: Readonly<Record<VideoInput, string>>;
|
|
38
|
+
/** MIME types the gateway accepts for hosted references when the catalog names none. */
|
|
39
|
+
export declare const DEFAULT_REFERENCE_MIMES: Readonly<Record<'image' | 'video' | 'audio', readonly string[]>>;
|
|
40
|
+
/** The gateway media library's default per-file ceiling. */
|
|
41
|
+
export declare const MEDIA_LIBRARY_MAX_BYTES: number;
|
|
42
|
+
/**
|
|
43
|
+
* A one-paragraph account of what a video model accepts, for errors and model listings.
|
|
44
|
+
* @param model - the video model.
|
|
45
|
+
* @returns the description.
|
|
46
|
+
*/
|
|
47
|
+
export declare function describeVideoModel(model: MediaModel): string;
|
|
48
|
+
/**
|
|
49
|
+
* Check a request against the model and fix its mode and options.
|
|
50
|
+
* @param model - the chosen video model.
|
|
51
|
+
* @param options - prompt, mode, options and input sources.
|
|
52
|
+
* @returns the plan.
|
|
53
|
+
* @throws {@link MediaError} naming what the model supports.
|
|
54
|
+
*/
|
|
55
|
+
export declare function planVideo(model: MediaModel, options: VideoRequestOptions): VideoPlan;
|
|
56
|
+
/** One reference's facts, as loaded or uploaded. */
|
|
57
|
+
export interface ReferenceMedia {
|
|
58
|
+
readonly source: string;
|
|
59
|
+
readonly mime: string;
|
|
60
|
+
readonly bytes: number;
|
|
61
|
+
/** Measured duration of an uploaded audio or video, in milliseconds. */
|
|
62
|
+
readonly durationMs?: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Check one reference's format and size before it is uploaded.
|
|
66
|
+
* @param model - the video model.
|
|
67
|
+
* @param input - which input it fills.
|
|
68
|
+
* @param media - its type and size.
|
|
69
|
+
* @throws {@link MediaError} when the model or the gateway would refuse it.
|
|
70
|
+
*/
|
|
71
|
+
export declare function checkReferenceFile(model: MediaModel, input: VideoInput, media: ReferenceMedia): void;
|
|
72
|
+
/**
|
|
73
|
+
* The largest file one input may be: the model's per-kind limit, its asset
|
|
74
|
+
* limit and the media library ceiling, whichever is smallest.
|
|
75
|
+
* @param model - the video model.
|
|
76
|
+
* @param input - which input.
|
|
77
|
+
* @returns the limit in bytes.
|
|
78
|
+
*/
|
|
79
|
+
export declare function referenceByteLimit(model: MediaModel, input: VideoInput): number;
|
|
80
|
+
/**
|
|
81
|
+
* Check reference video durations once the gateway has measured them.
|
|
82
|
+
* @param model - the video model.
|
|
83
|
+
* @param videos - the uploaded reference videos, in order.
|
|
84
|
+
* @throws {@link MediaError} when a clip or the total is outside the model's limits.
|
|
85
|
+
*/
|
|
86
|
+
export declare function checkReferenceDurations(model: MediaModel, videos: readonly ReferenceMedia[]): void;
|
|
87
|
+
/**
|
|
88
|
+
* The `/v1/videos` body for a plan whose inputs are uploaded. The gateway reads
|
|
89
|
+
* one vocabulary and translates it per provider.
|
|
90
|
+
* @param model - the model id.
|
|
91
|
+
* @param prompt - the prompt.
|
|
92
|
+
* @param plan - the checked plan.
|
|
93
|
+
* @param urls - the gateway reference URL of every input, in order.
|
|
94
|
+
* @returns the request body.
|
|
95
|
+
*/
|
|
96
|
+
export declare function videoRequestBody(model: string, prompt: string, plan: VideoPlan, urls: Partial<Record<VideoInput, readonly string[]>>): Record<string, unknown>;
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "VibeDev Account & Models",
|
|
4
|
+
"description": "Sign in to VibeDev (next to the DeepSeek account) to use the VibeDev gateway's models (Claude, GPT and more) in the model picker, and let the agent generate images, videos, music and podcasts and transcribe speech; paid from your VibeDev balance."
|
|
5
|
+
}
|
|
6
|
+
}
|
package/locale/zh.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vibedev-si/dsh-vibedev",
|
|
3
|
+
"version": "0.2.1",
|
|
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
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"icon": "./icon.svg",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
|
+
"default": "./lib/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./client": "./client/client.js",
|
|
15
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
16
|
+
"./package.json": "./package.json",
|
|
17
|
+
"./locale/*.json": "./locale/*.json"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"lib",
|
|
21
|
+
"client",
|
|
22
|
+
"locale",
|
|
23
|
+
"icon.svg",
|
|
24
|
+
"cordis.patch.yml",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"THIRD-PARTY-NOTICES.txt"
|
|
28
|
+
],
|
|
29
|
+
"dsh": {
|
|
30
|
+
"bundle": {
|
|
31
|
+
"patch": "./cordis.patch.yml"
|
|
32
|
+
},
|
|
33
|
+
"client": {
|
|
34
|
+
"platform": "web",
|
|
35
|
+
"inject": [
|
|
36
|
+
"@deepseek-ai/dsh-client-locale",
|
|
37
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
38
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager",
|
|
39
|
+
"@deepseek-ai/dsh-client-ui-sidebar"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"dsh",
|
|
45
|
+
"dsh-plugin",
|
|
46
|
+
"deepseek-harness",
|
|
47
|
+
"vibedev",
|
|
48
|
+
"vibedev-account",
|
|
49
|
+
"llm",
|
|
50
|
+
"claude",
|
|
51
|
+
"gpt",
|
|
52
|
+
"image-generation",
|
|
53
|
+
"video-generation",
|
|
54
|
+
"music-generation",
|
|
55
|
+
"speech-to-text"
|
|
56
|
+
],
|
|
57
|
+
"homepage": "https://github.com/VibeDev-Si/dsh-vibedev#readme",
|
|
58
|
+
"repository": {
|
|
59
|
+
"type": "git",
|
|
60
|
+
"url": "git+https://github.com/VibeDev-Si/dsh-vibedev.git"
|
|
61
|
+
},
|
|
62
|
+
"bugs": {
|
|
63
|
+
"url": "https://github.com/VibeDev-Si/dsh-vibedev/issues"
|
|
64
|
+
},
|
|
65
|
+
"license": "MIT",
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">=20"
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"registry": "https://registry.npmjs.org/",
|
|
71
|
+
"access": "public"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"clean": "node scripts/clean.mjs",
|
|
75
|
+
"build": "npm run clean && npm run build:host && npm run build:types && npm run build:client && npm run build:notices",
|
|
76
|
+
"build:host": "tsdown -c tsdown.host.config.ts",
|
|
77
|
+
"build:types": "tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
78
|
+
"build:client": "tsdown && node scripts/normalize-client.mjs",
|
|
79
|
+
"build:notices": "node scripts/third-party-notices.mjs",
|
|
80
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json",
|
|
81
|
+
"test": "vitest run",
|
|
82
|
+
"check:package": "node scripts/check-package.mjs",
|
|
83
|
+
"prepack": "npm run build && npm run check:package"
|
|
84
|
+
},
|
|
85
|
+
"peerDependencies": {
|
|
86
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
87
|
+
"@deepseek-ai/dsh-attachment": ">=0.2.0-rc.2 <0.3.0",
|
|
88
|
+
"@deepseek-ai/dsh-brand": ">=0.2.0-rc.2 <0.3.0",
|
|
89
|
+
"@deepseek-ai/dsh-credentials": ">=0.2.0-rc.2 <0.3.0",
|
|
90
|
+
"@deepseek-ai/dsh-llm": ">=0.2.0-rc.2 <0.3.0",
|
|
91
|
+
"@deepseek-ai/dsh-timeout": ">=0.2.0-rc.2 <0.3.0",
|
|
92
|
+
"@deepseek-ai/dsh-tools": ">=0.2.0-rc.2 <0.3.0",
|
|
93
|
+
"@deepseek-ai/dsh-web": ">=0.2.0-rc.2 <0.3.0",
|
|
94
|
+
"@deepseek-ai/schemastery": "^3.18.2"
|
|
95
|
+
},
|
|
96
|
+
"devDependencies": {
|
|
97
|
+
"@deepseek-ai/cordis": "4.0.4",
|
|
98
|
+
"@deepseek-ai/dsh-agent": "0.2.0-rc.2",
|
|
99
|
+
"@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
|
|
100
|
+
"@deepseek-ai/dsh-brand": "0.2.0-rc.2",
|
|
101
|
+
"@deepseek-ai/dsh-client-connection": "0.2.0-rc.2",
|
|
102
|
+
"@deepseek-ai/dsh-client-store": "^0.2.0-rc.2",
|
|
103
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.2.0-rc.2",
|
|
104
|
+
"@deepseek-ai/dsh-credentials": "0.2.0-rc.2",
|
|
105
|
+
"@deepseek-ai/dsh-deepseek-account": "0.2.0-rc.2",
|
|
106
|
+
"@deepseek-ai/dsh-fs": "0.2.0-rc.2",
|
|
107
|
+
"@deepseek-ai/dsh-jobs": "0.2.0-rc.2",
|
|
108
|
+
"@deepseek-ai/dsh-llm": "0.2.0-rc.2",
|
|
109
|
+
"@deepseek-ai/dsh-session": "0.2.0-rc.2",
|
|
110
|
+
"@deepseek-ai/dsh-settings": "0.2.0-rc.2",
|
|
111
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
|
|
112
|
+
"@deepseek-ai/dsh-timeout": "0.2.0-rc.2",
|
|
113
|
+
"@deepseek-ai/dsh-tools": "0.2.0-rc.2",
|
|
114
|
+
"@deepseek-ai/dsh-user-approval": "0.2.0-rc.2",
|
|
115
|
+
"@deepseek-ai/dsh-web": "0.2.0-rc.2",
|
|
116
|
+
"@deepseek-ai/schemastery": "3.18.4",
|
|
117
|
+
"@earendil-works/pi-ai": "0.87.1",
|
|
118
|
+
"@types/node": "^22.10.0",
|
|
119
|
+
"@types/react": "^18.3.12",
|
|
120
|
+
"@types/react-dom": "^18.3.1",
|
|
121
|
+
"react": "^18.3.1",
|
|
122
|
+
"react-dom": "^18.3.1",
|
|
123
|
+
"tsdown": "^0.22.14",
|
|
124
|
+
"typescript": "~5.9.3",
|
|
125
|
+
"vitest": "^4.1.8"
|
|
126
|
+
}
|
|
127
|
+
}
|