dsh-image-gen 0.1.3 → 0.1.5

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.
@@ -3,6 +3,7 @@ import type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client
3
3
  import type { SettingsScope } from '@deepseek-ai/dsh-client-runtime/client';
4
4
  import type { InjectFace, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
5
5
  import { type ImageProvider } from '../shared.js';
6
+ import { type LocaleService } from './gallery-view.js';
6
7
  type Provider = ImageProvider;
7
8
  interface ImageSettings {
8
9
  provider?: Provider;
@@ -12,23 +13,22 @@ interface ImageSettings {
12
13
  openaiModel?: string;
13
14
  seedreamBaseURL?: string;
14
15
  seedreamModel?: string;
15
- }
16
- interface LocaleService {
17
- getSnapshot(): {
18
- active: string;
19
- };
20
- subscribe(fn: () => void): () => void;
16
+ dashscopeEndpoint?: string;
17
+ dashscopeModel?: string;
21
18
  }
22
19
  interface SettingsFace {
23
20
  scope: SettingsScope<ImageSettings>;
24
21
  credentials: ConnectionHandle['api']['credentials'];
25
22
  locale?: LocaleService | undefined;
26
23
  }
24
+ interface ImageCardFace {
25
+ locale?: LocaleService | undefined;
26
+ }
27
27
  type SettingsCardProps = PropsRuntime<'settings.plugin.item'> & InjectFace<SettingsFace>;
28
- type ImageCardProps = PropsRuntime<'tool.call.toolview'>;
28
+ type ImageCardProps = PropsRuntime<'tool.call.toolview'> & InjectFace<ImageCardFace>;
29
29
  /** Required browser services. */
30
30
  export declare const inject: string[];
31
- /** Mount the settings card and generated-image card. */
31
+ /** Mount the settings card, generated-image card, and native conversation gallery view. */
32
32
  export declare function apply(ctx: Context): void;
33
33
  /** Edit provider settings and its write-only API credential. */
34
34
  export declare function ImageGenerationSettingsCard(props: SettingsCardProps): import("react").JSX.Element;
@@ -1,13 +1,15 @@
1
1
  /** User-facing configuration for supported image providers. */
2
2
  import z from '@deepseek-ai/schemastery';
3
- import { DEFAULT_GOOGLE_ENDPOINT, DEFAULT_GOOGLE_MODEL, DEFAULT_OPENAI_BASE_URL, DEFAULT_OPENAI_MODEL, DEFAULT_SEEDREAM_BASE_URL, DEFAULT_SEEDREAM_MODEL, IMAGE_PROVIDERS, type ImageProvider } from './shared.js';
4
- export { DEFAULT_GOOGLE_ENDPOINT, DEFAULT_GOOGLE_MODEL, DEFAULT_OPENAI_BASE_URL, DEFAULT_OPENAI_MODEL, DEFAULT_SEEDREAM_BASE_URL, DEFAULT_SEEDREAM_MODEL, IMAGE_PROVIDERS, type ImageProvider, };
3
+ import { DEFAULT_DASHSCOPE_ENDPOINT, DEFAULT_DASHSCOPE_MODEL, DEFAULT_GOOGLE_ENDPOINT, DEFAULT_GOOGLE_MODEL, DEFAULT_OPENAI_BASE_URL, DEFAULT_OPENAI_MODEL, DEFAULT_SEEDREAM_BASE_URL, DEFAULT_SEEDREAM_MODEL, IMAGE_PROVIDERS, type ImageProvider } from './shared.js';
4
+ export { DEFAULT_DASHSCOPE_ENDPOINT, DEFAULT_DASHSCOPE_MODEL, DEFAULT_GOOGLE_ENDPOINT, DEFAULT_GOOGLE_MODEL, DEFAULT_OPENAI_BASE_URL, DEFAULT_OPENAI_MODEL, DEFAULT_SEEDREAM_BASE_URL, DEFAULT_SEEDREAM_MODEL, IMAGE_PROVIDERS, type ImageProvider, };
5
5
  /** Google API credential reference. */
6
6
  export declare const GOOGLE_API_KEY_ENV = "GEMINI_API_KEY";
7
7
  /** OpenAI Platform or compatible relay credential reference. */
8
8
  export declare const OPENAI_API_KEY_ENV = "OPENAI_API_KEY";
9
9
  /** Volcengine Ark credential reference. */
10
10
  export declare const SEEDREAM_API_KEY_ENV = "ARK_API_KEY";
11
+ /** DashScope credential reference. */
12
+ export declare const DASHSCOPE_API_KEY_ENV = "DASHSCOPE_API_KEY";
11
13
  /** Google tool-level controls. */
12
14
  export declare const ASPECT_RATIOS: readonly ["1:1", "3:2", "2:3", "4:3", "3:4", "16:9", "9:16"];
13
15
  export declare const IMAGE_SIZES: readonly ["1K", "2K", "4K"];
@@ -22,6 +24,8 @@ export interface Config {
22
24
  openaiModel?: string;
23
25
  seedreamBaseURL?: string;
24
26
  seedreamModel?: string;
27
+ dashscopeEndpoint?: string;
28
+ dashscopeModel?: string;
25
29
  }
26
30
  /** Cordis configuration schema. */
27
31
  export declare const Config: z<Config>;
@@ -45,4 +49,10 @@ export declare function resolveProvider(config: Config): {
45
49
  model: string;
46
50
  baseURL: string;
47
51
  imageSize: string;
52
+ } | {
53
+ provider: 'dashscope';
54
+ apiKeyEnv: string;
55
+ model: string;
56
+ endpoint: string;
57
+ imageSize: string;
48
58
  };
@@ -0,0 +1,16 @@
1
+ /** DashScope (Aliyun Wanx & Qwen-Image) image-generation protocol adapter. */
2
+ import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
3
+ export interface DashScopeImageOptions {
4
+ apiKey: string;
5
+ endpoint: string;
6
+ model: string;
7
+ prompt: string;
8
+ size?: string;
9
+ maxBytes: number;
10
+ signal?: AbortSignal;
11
+ }
12
+ /** Call DashScope image synthesis/generation API and handle both synchronous output & async task polling. */
13
+ export declare function generateDashScopeImage(options: DashScopeImageOptions): Promise<{
14
+ data: Uint8Array;
15
+ mediaType: ImageAttachmentRef['mediaType'];
16
+ }>;
@@ -4,15 +4,17 @@ export declare const IMAGE_ROUTE = "/plugins/dsh-image-gen/image";
4
4
  /** Namespace persisted through DSH Settings. */
5
5
  export declare const IMAGE_GENERATION_NAMESPACE = "image-generation";
6
6
  /** Supported providers. */
7
- export declare const IMAGE_PROVIDERS: readonly ["google", "openai", "seedream"];
7
+ export declare const IMAGE_PROVIDERS: readonly ["google", "openai", "seedream", "dashscope"];
8
8
  export type ImageProvider = typeof IMAGE_PROVIDERS[number];
9
9
  /** Default endpoints and base URLs. */
10
10
  export declare const DEFAULT_GOOGLE_ENDPOINT = "https://generativelanguage.googleapis.com/v1beta/interactions";
11
11
  export declare const DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
12
12
  export declare const DEFAULT_SEEDREAM_BASE_URL = "https://ark.cn-beijing.volces.com/api/v3";
13
+ export declare const DEFAULT_DASHSCOPE_ENDPOINT = "https://dashscope.aliyuncs.com/api/v1";
13
14
  /** Default model names. */
14
15
  export declare const DEFAULT_GOOGLE_MODEL = "gemini-3.1-flash-image";
15
16
  export declare const DEFAULT_OPENAI_MODEL = "gpt-image-2";
16
17
  export declare const DEFAULT_SEEDREAM_MODEL = "doubao-seedream-5-0-260128";
18
+ export declare const DEFAULT_DASHSCOPE_MODEL = "wanx2.1-t2i-turbo";
17
19
  export declare const DEFAULT_MODELS: Record<ImageProvider, string>;
18
20
  export declare const DEFAULT_BASE_URLS: Record<ImageProvider, string>;
package/package.json CHANGED
@@ -1,124 +1,128 @@
1
- {
2
- "name": "dsh-image-gen",
3
- "version": "0.1.3",
4
- "description": "Bring ChatGPT-like image generation to DeepSeek Harness — Gemini, OpenAI, Seedream & more.",
5
- "type": "module",
6
- "author": "shanliuling",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/shanliuling/dsh-image-gen.git"
10
- },
11
- "bugs": {
12
- "url": "https://github.com/shanliuling/dsh-image-gen/issues"
13
- },
14
- "homepage": "https://github.com/shanliuling/dsh-image-gen#readme",
15
- "main": "lib/index.js",
16
- "types": "lib/types/index.d.ts",
17
- "exports": {
18
- ".": {
19
- "types": "./lib/types/index.d.ts",
20
- "default": "./lib/index.js"
21
- },
22
- "./client": {
23
- "types": "./lib/types/client/index.d.ts",
24
- "default": "./lib/client.js"
25
- },
26
- "./package.json": "./package.json"
27
- },
28
- "files": [
29
- "lib/index.js",
30
- "lib/client.js",
31
- "lib/client.js.map",
32
- "lib/types/**/*.d.ts",
33
- "skills/**/*.md",
34
- "cordis.patch.yml",
35
- "README.md",
36
- "README.zh-CN.md",
37
- "LICENSE"
38
- ],
39
- "dsh": {
40
- "bundle": {
41
- "patch": "./cordis.patch.yml"
42
- },
43
- "client": {
44
- "inject": [
45
- "@deepseek-ai/dsh-client-connection",
46
- "@deepseek-ai/dsh-api-remotes",
47
- "@deepseek-ai/dsh-client-runtime",
48
- "@deepseek-ai/dsh-client-ui-settings",
49
- "@deepseek-ai/dsh-client-ui-settings-plugins",
50
- "@deepseek-ai/dsh-client-ui-tool",
51
- "@deepseek-ai/dsh-client-locale"
52
- ],
53
- "platform": "web"
54
- }
55
- },
56
- "scripts": {
57
- "typecheck": "tsc --noEmit",
58
- "build": "tsc && tsdown",
59
- "prepare": "pnpm run build",
60
- "test": "vitest run",
61
- "pack:check": "pnpm pack --dry-run"
62
- },
63
- "engines": {
64
- "node": "^22.19.0 || >=24.0.0"
65
- },
66
- "license": "MIT",
67
- "keywords": [
68
- "deepseek",
69
- "deepseek-harness",
70
- "dsh",
71
- "dsh-plugin",
72
- "ai-agent",
73
- "image-generation",
74
- "ai-image-generation",
75
- "multimodal",
76
- "gemini",
77
- "openai",
78
- "openai-compatible",
79
- "seedream",
80
- "volcengine",
81
- "byok",
82
- "cordis"
83
- ],
84
- "peerDependencies": {
85
- "@deepseek-ai/cordis": ">=4.0.0 <5",
86
- "@deepseek-ai/dsh-attachment": ">=0.1.0-rc.5 <0.2.0",
87
- "@deepseek-ai/dsh-api-remotes": ">=0.1.0-rc.5 <0.2.0",
88
- "@deepseek-ai/dsh-client-connection": ">=0.1.0-rc.5 <0.2.0",
89
- "@deepseek-ai/dsh-client-runtime": ">=0.1.0-rc.5 <0.2.0",
90
- "@deepseek-ai/dsh-client-ui-settings": ">=0.1.0-rc.5 <0.2.0",
91
- "@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.0-rc.5 <0.2.0",
92
- "@deepseek-ai/dsh-client-ui-slots": ">=0.1.0-rc.5 <0.2.0",
93
- "@deepseek-ai/dsh-client-ui-tool": ">=0.1.0-rc.5 <0.2.0",
94
- "@deepseek-ai/dsh-credentials": ">=0.1.0-rc.5 <0.2.0",
95
- "@deepseek-ai/dsh-host-webserver": ">=0.1.0-rc.5 <0.2.0",
96
- "@deepseek-ai/dsh-settings": ">=0.1.0-rc.5 <0.2.0",
97
- "@deepseek-ai/dsh-tools": ">=0.1.0-rc.5 <0.2.0",
98
- "@deepseek-ai/schemastery": ">=3.18.0 <4",
99
- "react": ">=18.2.0 <19"
100
- },
101
- "devDependencies": {
102
- "@deepseek-ai/cordis": "4.0.1",
103
- "@deepseek-ai/dsh-attachment": "0.1.0-rc.6",
104
- "@deepseek-ai/dsh-api-remotes": "0.1.0-rc.6",
105
- "@deepseek-ai/dsh-client-connection": "0.1.0-rc.6",
106
- "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.6",
107
- "@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.6",
108
- "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.0-rc.6",
109
- "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.6",
110
- "@deepseek-ai/dsh-client-ui-tool": "0.1.0-rc.6",
111
- "@deepseek-ai/dsh-credentials": "0.1.0-rc.6",
112
- "@deepseek-ai/dsh-host-webserver": "0.1.0-rc.6",
113
- "@deepseek-ai/dsh-settings": "0.1.0-rc.6",
114
- "@deepseek-ai/dsh-tools": "0.1.0-rc.6",
115
- "@deepseek-ai/schemastery": "3.18.1",
116
- "@types/node": "^22.20.0",
117
- "@types/react": "~18.3.1",
118
- "react": "^18.2.0",
119
- "tsdown": "^0.22.2",
120
- "typescript": "^6.0.3",
121
- "vitest": "^4.1.8"
122
- },
123
- "packageManager": "pnpm@11.7.0"
124
- }
1
+ {
2
+ "name": "dsh-image-gen",
3
+ "version": "0.1.5",
4
+ "description": "Bring ChatGPT-like image generation to DeepSeek Harness — Gemini, OpenAI, Seedream, DashScope & more.",
5
+ "type": "module",
6
+ "author": "shanliuling",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/shanliuling/dsh-image-gen.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/shanliuling/dsh-image-gen/issues"
13
+ },
14
+ "homepage": "https://github.com/shanliuling/dsh-image-gen#readme",
15
+ "main": "lib/index.js",
16
+ "types": "lib/types/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./lib/types/index.d.ts",
20
+ "default": "./lib/index.js"
21
+ },
22
+ "./client": {
23
+ "types": "./lib/types/client/index.d.ts",
24
+ "default": "./lib/client.js"
25
+ },
26
+ "./package.json": "./package.json"
27
+ },
28
+ "files": [
29
+ "lib/index.js",
30
+ "lib/client.js",
31
+ "lib/client.js.map",
32
+ "lib/types/**/*.d.ts",
33
+ "skills/**/*.md",
34
+ "cordis.patch.yml",
35
+ "README.md",
36
+ "README.zh-CN.md",
37
+ "LICENSE"
38
+ ],
39
+ "dsh": {
40
+ "bundle": {
41
+ "patch": "./cordis.patch.yml"
42
+ },
43
+ "client": {
44
+ "inject": [
45
+ "@deepseek-ai/dsh-client-connection",
46
+ "@deepseek-ai/dsh-api-remotes",
47
+ "@deepseek-ai/dsh-client-runtime",
48
+ "@deepseek-ai/dsh-client-ui-conversation",
49
+ "@deepseek-ai/dsh-client-ui-settings",
50
+ "@deepseek-ai/dsh-client-ui-settings-plugins",
51
+ "@deepseek-ai/dsh-client-ui-tool",
52
+ "@deepseek-ai/dsh-client-locale"
53
+ ],
54
+ "platform": "web"
55
+ }
56
+ },
57
+ "engines": {
58
+ "node": "^22.19.0 || >=24.0.0"
59
+ },
60
+ "license": "MIT",
61
+ "keywords": [
62
+ "deepseek",
63
+ "deepseek-harness",
64
+ "dsh",
65
+ "dsh-plugin",
66
+ "ai-agent",
67
+ "image-generation",
68
+ "ai-image-generation",
69
+ "multimodal",
70
+ "gemini",
71
+ "openai",
72
+ "openai-compatible",
73
+ "seedream",
74
+ "dashscope",
75
+ "wanx",
76
+ "aliyun",
77
+ "volcengine",
78
+ "byok",
79
+ "cordis"
80
+ ],
81
+ "peerDependencies": {
82
+ "@deepseek-ai/cordis": ">=4.0.0 <5",
83
+ "@deepseek-ai/dsh-attachment": ">=0.1.0-rc.5 <0.2.0",
84
+ "@deepseek-ai/dsh-api-remotes": ">=0.1.0-rc.5 <0.2.0",
85
+ "@deepseek-ai/dsh-client-connection": ">=0.1.0-rc.5 <0.2.0",
86
+ "@deepseek-ai/dsh-client-runtime": ">=0.1.0-rc.5 <0.2.0",
87
+ "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.0-rc.5 <0.2.0",
88
+ "@deepseek-ai/dsh-client-ui-settings": ">=0.1.0-rc.5 <0.2.0",
89
+ "@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.0-rc.5 <0.2.0",
90
+ "@deepseek-ai/dsh-client-ui-slots": ">=0.1.0-rc.5 <0.2.0",
91
+ "@deepseek-ai/dsh-client-ui-tool": ">=0.1.0-rc.5 <0.2.0",
92
+ "@deepseek-ai/dsh-credentials": ">=0.1.0-rc.5 <0.2.0",
93
+ "@deepseek-ai/dsh-host-webserver": ">=0.1.0-rc.5 <0.2.0",
94
+ "@deepseek-ai/dsh-settings": ">=0.1.0-rc.5 <0.2.0",
95
+ "@deepseek-ai/dsh-tools": ">=0.1.0-rc.5 <0.2.0",
96
+ "@deepseek-ai/schemastery": ">=3.18.0 <4",
97
+ "react": ">=18.2.0 <19"
98
+ },
99
+ "devDependencies": {
100
+ "@deepseek-ai/cordis": "4.0.1",
101
+ "@deepseek-ai/dsh-attachment": "0.1.0-rc.6",
102
+ "@deepseek-ai/dsh-api-remotes": "0.1.0-rc.6",
103
+ "@deepseek-ai/dsh-client-connection": "0.1.0-rc.6",
104
+ "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.6",
105
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.0-rc.6",
106
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.6",
107
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.0-rc.6",
108
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.6",
109
+ "@deepseek-ai/dsh-client-ui-tool": "0.1.0-rc.6",
110
+ "@deepseek-ai/dsh-credentials": "0.1.0-rc.6",
111
+ "@deepseek-ai/dsh-host-webserver": "0.1.0-rc.6",
112
+ "@deepseek-ai/dsh-settings": "0.1.0-rc.6",
113
+ "@deepseek-ai/dsh-tools": "0.1.0-rc.6",
114
+ "@deepseek-ai/schemastery": "3.18.1",
115
+ "@types/node": "^22.20.0",
116
+ "@types/react": "~18.3.1",
117
+ "react": "^18.2.0",
118
+ "tsdown": "^0.22.2",
119
+ "typescript": "^6.0.3",
120
+ "vitest": "^4.1.8"
121
+ },
122
+ "scripts": {
123
+ "typecheck": "tsc --noEmit",
124
+ "build": "tsc && tsdown",
125
+ "test": "vitest run",
126
+ "pack:check": "pnpm pack --dry-run"
127
+ }
128
+ }