dsh-image-gen 0.2.2 → 0.2.4

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.
@@ -0,0 +1,8 @@
1
+ /** Dual-path image attachment resolution for legacy rc.2 and modern DSH runtime blocks. */
2
+ import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
3
+ import type { ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client';
4
+ /**
5
+ * Extract the verified durable image attachment from a completed tool result block.
6
+ * Supports legacy rc.2 `resultView.content` and modern DSH `block.content`.
7
+ */
8
+ export declare function imageRef(block: ToolCallBlock): ImageAttachmentRef | undefined;
@@ -0,0 +1,53 @@
1
+ /** Modern DSH conversation node that keeps completed image artifacts outside Compact process folding. */
2
+ import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
3
+ export declare const IMAGE_RESULT_NODE_KIND = "dsh-image-result";
4
+ export interface ImageResultPresentation {
5
+ readonly attachment: ImageAttachmentRef;
6
+ readonly prompt: string;
7
+ readonly provider: string;
8
+ readonly model: string;
9
+ readonly output: string;
10
+ readonly savedTo?: string;
11
+ }
12
+ interface ImageResultState {
13
+ readonly turn: number;
14
+ readonly results: readonly (ImageResultPresentation & {
15
+ readonly seq: number;
16
+ })[];
17
+ readonly answerSeq?: number;
18
+ readonly endSeq?: number;
19
+ }
20
+ interface EventLike {
21
+ readonly type: string;
22
+ readonly seq: number;
23
+ readonly data: Record<string, unknown>;
24
+ }
25
+ interface MatchLike {
26
+ readonly event: EventLike;
27
+ readonly location: unknown;
28
+ }
29
+ interface ContextLike<State> {
30
+ readonly key: string;
31
+ readonly id: string;
32
+ readonly matches: readonly MatchLike[];
33
+ readonly start?: MatchLike;
34
+ readonly state?: State;
35
+ }
36
+ interface ConversationNodeDefinitionLike<State> {
37
+ readonly kind: string;
38
+ readonly target: 'chat';
39
+ match(event: EventLike): {
40
+ id: string;
41
+ role: 'start' | 'update';
42
+ } | null;
43
+ start(context: ContextLike<State>, match: MatchLike, reader: unknown): State;
44
+ update(context: ContextLike<State> & {
45
+ readonly state: State;
46
+ }, match: MatchLike): State;
47
+ buildViewNode(context: ContextLike<State>): Record<string, unknown> | null;
48
+ }
49
+ /** One image result row per Turn, re-anchored to Turn end after the final answer settles. */
50
+ export declare const imageResultDefinition: ConversationNodeDefinitionLike<ImageResultState>;
51
+ /** Parse the plugin-owned durable presentation metadata from a Tool result event. */
52
+ export declare function imageResultFromMeta(value: unknown): ImageResultPresentation | undefined;
53
+ export {};
@@ -3,6 +3,7 @@ import type { SettingsScope } from '@deepseek-ai/dsh-client-runtime/client';
3
3
  import type { InjectFace, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
4
4
  import { type ImageProvider } from '../shared.js';
5
5
  import { type LocaleService } from './gallery-view.js';
6
+ import { type ImageResultPresentation } from './image-result-node.js';
6
7
  type Provider = ImageProvider;
7
8
  interface ImageSettings {
8
9
  provider?: Provider;
@@ -45,15 +46,26 @@ interface SettingsFace {
45
46
  }
46
47
  interface ImageCardFace {
47
48
  locale?: LocaleService | undefined;
49
+ promoted: boolean;
48
50
  }
49
51
  type SettingsCardProps = PropsRuntime<'settings.plugin.item'> & InjectFace<SettingsFace>;
50
52
  type ImageCardProps = PropsRuntime<'tool.call.toolview'> & InjectFace<ImageCardFace>;
53
+ interface ImageResultNodeProps {
54
+ node: {
55
+ data: {
56
+ results: readonly ImageResultPresentation[];
57
+ };
58
+ };
59
+ locale?: LocaleService | undefined;
60
+ }
51
61
  /** Required browser services. */
52
62
  export declare const inject: string[];
53
63
  /** Mount the settings card, generated-image card, and native conversation gallery view. */
54
64
  export declare function apply(ctx: Context): void;
55
65
  /** Edit provider settings and its write-only API credential. */
56
66
  export declare function ImageGenerationSettingsCard(props: SettingsCardProps): import("react").JSX.Element;
57
- /** Render the durable attachment referenced by a completed image tool call. */
67
+ /** Keep the legacy Tool row for old DSH and hand modern results to the independent Chat node. */
58
68
  export declare function GeneratedImageCard(props: ImageCardProps): import("react").JSX.Element;
69
+ /** Render modern image artifacts as final conversation output instead of Tool process content. */
70
+ export declare function PromotedImageResultNode(props: ImageResultNodeProps): import("react").JSX.Element;
59
71
  export {};
package/package.json CHANGED
@@ -1,133 +1,133 @@
1
- {
2
- "name": "dsh-image-gen",
3
- "version": "0.2.2",
4
- "description": "Bring ChatGPT-like image generation to DeepSeek Harness — Gemini, OpenAI, Seedream, DashScope, local ComfyUI & 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
- "scripts": {
58
- "typecheck": "tsc --noEmit",
59
- "build": "tsc && tsdown",
60
- "prepare": "pnpm run build",
61
- "test": "vitest run",
62
- "pack:check": "pnpm pack --dry-run"
63
- },
64
- "engines": {
65
- "node": "^22.19.0 || >=24.0.0"
66
- },
67
- "license": "MIT",
68
- "keywords": [
69
- "deepseek",
70
- "deepseek-harness",
71
- "dsh",
72
- "dsh-plugin",
73
- "ai-agent",
74
- "image-generation",
75
- "ai-image-generation",
76
- "multimodal",
77
- "gemini",
78
- "openai",
79
- "openai-compatible",
80
- "seedream",
81
- "dashscope",
82
- "comfyui",
83
- "local-image-generation",
84
- "wanx",
85
- "aliyun",
86
- "volcengine",
87
- "byok",
88
- "cordis"
89
- ],
90
- "peerDependencies": {
91
- "@deepseek-ai/cordis": ">=4.0.0 <5",
92
- "@deepseek-ai/dsh-api-remotes": ">=0.1.1-rc.2 <0.2.0",
93
- "@deepseek-ai/dsh-attachment": ">=0.1.1-rc.2 <0.2.0",
94
- "@deepseek-ai/dsh-client-connection": ">=0.1.1-rc.2 <0.2.0",
95
- "@deepseek-ai/dsh-client-runtime": ">=0.1.1-rc.2 <0.2.0",
96
- "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.1-rc.2 <0.2.0",
97
- "@deepseek-ai/dsh-client-ui-settings": ">=0.1.1-rc.2 <0.2.0",
98
- "@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.1-rc.2 <0.2.0",
99
- "@deepseek-ai/dsh-client-ui-slots": ">=0.1.1-rc.2 <0.2.0",
100
- "@deepseek-ai/dsh-client-ui-tool": ">=0.1.1-rc.2 <0.2.0",
101
- "@deepseek-ai/dsh-credentials": ">=0.1.1-rc.2 <0.2.0",
102
- "@deepseek-ai/dsh-host-webserver": ">=0.1.1-rc.2 <0.2.0",
103
- "@deepseek-ai/dsh-settings": ">=0.1.1-rc.2 <0.2.0",
104
- "@deepseek-ai/dsh-tools": ">=0.1.1-rc.2 <0.2.0",
105
- "@deepseek-ai/schemastery": ">=3.18.0 <4",
106
- "react": ">=18.2.0 <19"
107
- },
108
- "devDependencies": {
109
- "@deepseek-ai/cordis": "4.0.1",
110
- "@deepseek-ai/dsh-api-remotes": "0.1.1-rc.2",
111
- "@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
112
- "@deepseek-ai/dsh-client-connection": "0.1.1-rc.2",
113
- "@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
114
- "@deepseek-ai/dsh-client-ui-conversation": "0.1.1-rc.2",
115
- "@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
116
- "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.1-rc.2",
117
- "@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
118
- "@deepseek-ai/dsh-client-ui-tool": "0.1.1-rc.2",
119
- "@deepseek-ai/dsh-credentials": "0.1.1-rc.2",
120
- "@deepseek-ai/dsh-host-webserver": "0.1.1-rc.2",
121
- "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
122
- "@deepseek-ai/dsh-settings": "0.1.1-rc.2",
123
- "@deepseek-ai/dsh-tools": "0.1.1-rc.2",
124
- "@deepseek-ai/schemastery": "3.18.1",
125
- "@types/node": "^22.20.0",
126
- "@types/react": "~18.3.1",
127
- "react": "^18.2.0",
128
- "tsdown": "^0.22.2",
129
- "typescript": "^6.0.3",
130
- "vitest": "^4.1.8"
131
- },
132
- "packageManager": "pnpm@11.7.0"
133
- }
1
+ {
2
+ "name": "dsh-image-gen",
3
+ "version": "0.2.4",
4
+ "description": "Bring ChatGPT-like image generation to DeepSeek Harness — Gemini, OpenAI, Seedream, DashScope, local ComfyUI & 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
+ "scripts": {
58
+ "typecheck": "tsc --noEmit",
59
+ "build": "tsc && tsdown",
60
+ "prepare": "pnpm run build",
61
+ "test": "vitest run",
62
+ "pack:check": "pnpm pack --dry-run"
63
+ },
64
+ "engines": {
65
+ "node": "^22.19.0 || >=24.0.0"
66
+ },
67
+ "license": "MIT",
68
+ "keywords": [
69
+ "deepseek",
70
+ "deepseek-harness",
71
+ "dsh",
72
+ "dsh-plugin",
73
+ "ai-agent",
74
+ "image-generation",
75
+ "ai-image-generation",
76
+ "multimodal",
77
+ "gemini",
78
+ "openai",
79
+ "openai-compatible",
80
+ "seedream",
81
+ "dashscope",
82
+ "comfyui",
83
+ "local-image-generation",
84
+ "wanx",
85
+ "aliyun",
86
+ "volcengine",
87
+ "byok",
88
+ "cordis"
89
+ ],
90
+ "peerDependencies": {
91
+ "@deepseek-ai/cordis": ">=4.0.0 <5",
92
+ "@deepseek-ai/dsh-api-remotes": ">=0.1.1-rc.2 <0.2.0",
93
+ "@deepseek-ai/dsh-attachment": ">=0.1.1-rc.2 <0.2.0",
94
+ "@deepseek-ai/dsh-client-connection": ">=0.1.1-rc.2 <0.2.0",
95
+ "@deepseek-ai/dsh-client-runtime": ">=0.1.1-rc.2 <0.2.0",
96
+ "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.1-rc.2 <0.2.0",
97
+ "@deepseek-ai/dsh-client-ui-settings": ">=0.1.1-rc.2 <0.2.0",
98
+ "@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.1-rc.2 <0.2.0",
99
+ "@deepseek-ai/dsh-client-ui-slots": ">=0.1.1-rc.2 <0.2.0",
100
+ "@deepseek-ai/dsh-client-ui-tool": ">=0.1.1-rc.2 <0.2.0",
101
+ "@deepseek-ai/dsh-credentials": ">=0.1.1-rc.2 <0.2.0",
102
+ "@deepseek-ai/dsh-host-webserver": ">=0.1.1-rc.2 <0.2.0",
103
+ "@deepseek-ai/dsh-settings": ">=0.1.1-rc.2 <0.2.0",
104
+ "@deepseek-ai/dsh-tools": ">=0.1.1-rc.2 <0.2.0",
105
+ "@deepseek-ai/schemastery": ">=3.18.0 <4",
106
+ "react": ">=18.2.0 <19"
107
+ },
108
+ "devDependencies": {
109
+ "@deepseek-ai/cordis": "4.0.1",
110
+ "@deepseek-ai/dsh-api-remotes": "0.1.1-rc.2",
111
+ "@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
112
+ "@deepseek-ai/dsh-client-connection": "0.1.1-rc.2",
113
+ "@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
114
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.1-rc.2",
115
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
116
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.1-rc.2",
117
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
118
+ "@deepseek-ai/dsh-client-ui-tool": "0.1.1-rc.2",
119
+ "@deepseek-ai/dsh-credentials": "0.1.1-rc.2",
120
+ "@deepseek-ai/dsh-host-webserver": "0.1.1-rc.2",
121
+ "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
122
+ "@deepseek-ai/dsh-settings": "0.1.1-rc.2",
123
+ "@deepseek-ai/dsh-tools": "0.1.1-rc.2",
124
+ "@deepseek-ai/schemastery": "3.18.1",
125
+ "@types/node": "^22.20.0",
126
+ "@types/react": "~18.3.1",
127
+ "react": "^18.2.0",
128
+ "tsdown": "^0.22.2",
129
+ "typescript": "^6.0.3",
130
+ "vitest": "^4.1.8"
131
+ },
132
+ "packageManager": "pnpm@11.7.0"
133
+ }
@@ -1,22 +1,22 @@
1
- ---
2
- name: install-dsh-image-gen
3
- description: Install, configure, verify, or remove the dsh-image-gen Bundle in a DeepSeek Harness Web profile. Use when a user wants Google, OpenAI-compatible relay, Seedream, DashScope, or local ComfyUI image generation in DSH, cannot find the Image generation settings card, or needs help testing generate_image.
4
- ---
5
-
6
- # Install DSH Image Gen
7
-
8
- 1. Confirm `dsh` runs and record `dsh --version`.
9
- 2. Ask which Web profile to change if the user did not name one. Default to `web` only when that profile already exists.
10
- 3. Install the pinned package or repository spec the user provides:
11
-
12
- ```sh
13
- dsh plugin --profile <profile> add <package-or-git-spec>
14
- ```
15
-
16
- 4. If pnpm blocks the Git dependency's `prepare` script, explain that the allowance executes repository code during installation. Add only the exact package key pnpm reports to the profile's `pnpm-workspace.yaml`, then retry after the user approves.
17
- 5. Verify `dsh --profile <profile> --dump-config` contains the `dsh-image-gen` layer and `image-gen` row.
18
- 6. Start the profile. If port 3080 is already in use, identify the existing DSH process before stopping anything.
19
- 7. In Settings > Plugins > Plugin configuration > Image generation, select a cloud Provider and save its API key, or select Local ComfyUI, enter its URL, and import a ComfyUI API Format workflow JSON containing `{{prompt}}`. Never print, read back, or commit a key.
20
- 8. Test with “生成一张戴墨镜的赛博朋克猫图片”. Confirm one `generate_image` call succeeds and its image renders in the conversation.
21
-
22
- For removal, run `dsh plugin --profile <profile> remove dsh-image-gen`. Do not delete the user's credentials unless they explicitly request it.
1
+ ---
2
+ name: install-dsh-image-gen
3
+ description: Install, configure, verify, or remove the dsh-image-gen Bundle in a DeepSeek Harness Web profile. Use when a user wants Google, OpenAI-compatible relay, Seedream, DashScope, or local ComfyUI image generation in DSH, cannot find the Image generation settings card, or needs help testing generate_image.
4
+ ---
5
+
6
+ # Install DSH Image Gen
7
+
8
+ 1. Confirm `dsh` runs and record `dsh --version`.
9
+ 2. Ask which Web profile to change if the user did not name one. Default to `web` only when that profile already exists.
10
+ 3. Install the pinned package or repository spec the user provides:
11
+
12
+ ```sh
13
+ dsh plugin --profile <profile> add <package-or-git-spec>
14
+ ```
15
+
16
+ 4. If pnpm blocks the Git dependency's `prepare` script, explain that the allowance executes repository code during installation. Add only the exact package key pnpm reports to the profile's `pnpm-workspace.yaml`, then retry after the user approves.
17
+ 5. Verify `dsh --profile <profile> --dump-config` contains the `dsh-image-gen` layer and `image-gen` row.
18
+ 6. Start the profile. If port 3080 is already in use, identify the existing DSH process before stopping anything.
19
+ 7. In Settings > Plugins > Plugin configuration > Image generation, select a cloud Provider and save its API key, or select Local ComfyUI, enter its URL, and import a ComfyUI API Format workflow JSON containing `{{prompt}}`. Never print, read back, or commit a key.
20
+ 8. Test with “生成一张戴墨镜的赛博朋克猫图片”. Confirm one `generate_image` call succeeds and its image renders in the conversation.
21
+
22
+ For removal, run `dsh plugin --profile <profile> remove dsh-image-gen`. Do not delete the user's credentials unless they explicitly request it.