@mengruo/dsh-vision-toolkit 0.0.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.i18n.yaml +6 -0
- package/README.md +356 -0
- package/README.zh.md +354 -0
- package/assets/community-group-qr.png +0 -0
- package/assets/dsh-conversation-artifact.png +0 -0
- package/assets/dsh-conversation-image-qa-top.png +0 -0
- package/assets/dsh-conversation-image-qa.png +0 -0
- package/assets/dsh-conversation-pixel-diff.png +0 -0
- package/assets/dsh-conversation-screenshot-debugging-top.png +0 -0
- package/assets/dsh-conversation-screenshot-debugging.png +0 -0
- package/assets/dsh-conversation-tool-call.png +0 -0
- package/assets/dsh-conversation-vision-trace.png +0 -0
- package/assets/dsh-view-example.png +0 -0
- package/assets/hero-v2.png +0 -0
- package/assets/logo_aihubmix.png +0 -0
- package/assets/python-bootstrap.json +48 -0
- package/assets/skill/SKILL.md +329 -0
- package/assets/skill/UPSTREAM.json +71 -0
- package/assets/skill/references/gui.md +88 -0
- package/assets/skill/references/long-screenshot-ocr.md +77 -0
- package/assets/skill/references/restore-graphic.md +84 -0
- package/assets/skill/references/restore-structure.md +45 -0
- package/assets/skill/references/restore-ui.md +202 -0
- package/assets/social-preview.png +0 -0
- package/assets/upstream/README.md +18 -0
- package/assets/upstream/focus-hint-comparison-1.webp +0 -0
- package/assets/upstream/focus-hint-comparison-2.webp +0 -0
- package/assets/upstream/infographic-reference.webp +0 -0
- package/assets/upstream/infographic-result.webp +0 -0
- package/assets/upstream/ui-fast-restore-reference.webp +0 -0
- package/assets/upstream/ui-fast-restore-result.webp +0 -0
- package/assets/upstream/ui-result.webp +0 -0
- package/assets/upstream/ui-sketch.webp +0 -0
- package/assets/vision-model-test.png +0 -0
- package/assets/vision-settings.png +0 -0
- package/assets/wechat-reward.png +0 -0
- package/cordis.patch.yml +6 -0
- package/docs/aihubmix-gemini-vision.i18n.yaml +6 -0
- package/docs/aihubmix-gemini-vision.md +138 -0
- package/docs/aihubmix-gemini-vision.zh.md +138 -0
- package/docs/assets/aihubmix-api-keys.png +0 -0
- package/docs/assets/aihubmix-create-key.png +0 -0
- package/docs/assets/aihubmix-free-vision-model.png +0 -0
- package/docs/assets/aihubmix-home.png +0 -0
- package/docs/assets/aihubmix-sign-up.png +0 -0
- package/docs/assets/groq-console-home.png +0 -0
- package/docs/assets/groq-console-keys-login.png +0 -0
- package/docs/assets/groq-docs-quickstart.png +0 -0
- package/docs/assets/groq-docs-qwen3.6.png +0 -0
- package/docs/assets/groq-docs-vision.png +0 -0
- package/docs/assets/vision-settings.png +0 -0
- package/docs/dsh-desktop-install.md +67 -0
- package/docs/dsh-desktop-install.zh.md +67 -0
- package/docs/groq-qwen3.6-vision.i18n.yaml +6 -0
- package/docs/groq-qwen3.6-vision.md +236 -0
- package/docs/groq-qwen3.6-vision.zh.md +236 -0
- package/docs/python-runtime.i18n.yaml +6 -0
- package/docs/python-runtime.md +89 -0
- package/docs/python-runtime.zh.md +89 -0
- package/docs/requirements-traceability/README.i18n.yaml +6 -0
- package/docs/requirements-traceability/README.md +75 -0
- package/docs/requirements-traceability/README.zh.md +75 -0
- package/examples/ui-restoration/README.i18n.yaml +6 -0
- package/examples/ui-restoration/README.md +70 -0
- package/examples/ui-restoration/README.zh.md +70 -0
- package/examples/ui-restoration/assets/final-heatmap.png +0 -0
- package/examples/ui-restoration/assets/final-report.json +83 -0
- package/examples/ui-restoration/assets/implementation.png +0 -0
- package/examples/ui-restoration/assets/initial-heatmap.png +0 -0
- package/examples/ui-restoration/assets/initial-report.json +83 -0
- package/examples/ui-restoration/assets/initial.png +0 -0
- package/examples/ui-restoration/assets/metrics.json +12 -0
- package/examples/ui-restoration/assets/reference.png +0 -0
- package/examples/ui-restoration/implementation.html +94 -0
- package/examples/ui-restoration/initial.html +57 -0
- package/lib/artifact-access.js +369 -0
- package/lib/artifact-access.js.map +1 -0
- package/lib/artifacts.js +56 -0
- package/lib/artifacts.js.map +1 -0
- package/lib/client.js +2099 -0
- package/lib/client.js.map +1 -0
- package/lib/config.js +172 -0
- package/lib/config.js.map +1 -0
- package/lib/defaults.js +6 -0
- package/lib/defaults.js.map +1 -0
- package/lib/errors.js +56 -0
- package/lib/errors.js.map +1 -0
- package/lib/evidence-cache.js +350 -0
- package/lib/evidence-cache.js.map +1 -0
- package/lib/exposure.js +247 -0
- package/lib/exposure.js.map +1 -0
- package/lib/image-input-variants.js +882 -0
- package/lib/image-input-variants.js.map +1 -0
- package/lib/index.js +105 -0
- package/lib/index.js.map +1 -0
- package/lib/paste-images.js +217 -0
- package/lib/paste-images.js.map +1 -0
- package/lib/paths.js +354 -0
- package/lib/paths.js.map +1 -0
- package/lib/plugin-update.js +1003 -0
- package/lib/plugin-update.js.map +1 -0
- package/lib/runtime-install.js +964 -0
- package/lib/runtime-install.js.map +1 -0
- package/lib/runtime-manager.js +133 -0
- package/lib/runtime-manager.js.map +1 -0
- package/lib/runtime.js +1678 -0
- package/lib/runtime.js.map +1 -0
- package/lib/skill.js +25 -0
- package/lib/skill.js.map +1 -0
- package/lib/tools.js +549 -0
- package/lib/tools.js.map +1 -0
- package/lib/types/artifact-access.d.ts +61 -0
- package/lib/types/artifact-access.d.ts.map +1 -0
- package/lib/types/artifacts.d.ts +42 -0
- package/lib/types/artifacts.d.ts.map +1 -0
- package/lib/types/client/display-config.d.ts +24 -0
- package/lib/types/client/display-config.d.ts.map +1 -0
- package/lib/types/client/index.d.ts +350 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/model-variants-hider.d.ts +40 -0
- package/lib/types/client/model-variants-hider.d.ts.map +1 -0
- package/lib/types/client/paste-images.d.ts +126 -0
- package/lib/types/client/paste-images.d.ts.map +1 -0
- package/lib/types/config.d.ts +123 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/defaults.d.ts +6 -0
- package/lib/types/defaults.d.ts.map +1 -0
- package/lib/types/errors.d.ts +35 -0
- package/lib/types/errors.d.ts.map +1 -0
- package/lib/types/evidence-cache.d.ts +91 -0
- package/lib/types/evidence-cache.d.ts.map +1 -0
- package/lib/types/exposure.d.ts +50 -0
- package/lib/types/exposure.d.ts.map +1 -0
- package/lib/types/image-input-variants.d.ts +144 -0
- package/lib/types/image-input-variants.d.ts.map +1 -0
- package/lib/types/index.d.ts +19 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/paste-images.d.ts +73 -0
- package/lib/types/paste-images.d.ts.map +1 -0
- package/lib/types/paths.d.ts +117 -0
- package/lib/types/paths.d.ts.map +1 -0
- package/lib/types/plugin-update.d.ts +119 -0
- package/lib/types/plugin-update.d.ts.map +1 -0
- package/lib/types/runtime-install.d.ts +92 -0
- package/lib/types/runtime-install.d.ts.map +1 -0
- package/lib/types/runtime-manager.d.ts +60 -0
- package/lib/types/runtime-manager.d.ts.map +1 -0
- package/lib/types/runtime.d.ts +412 -0
- package/lib/types/runtime.d.ts.map +1 -0
- package/lib/types/skill.d.ts +14 -0
- package/lib/types/skill.d.ts.map +1 -0
- package/lib/types/tools.d.ts +35 -0
- package/lib/types/tools.d.ts.map +1 -0
- package/lib/types/upstream.d.ts +233 -0
- package/lib/types/upstream.d.ts.map +1 -0
- package/lib/types/version.d.ts +15 -0
- package/lib/types/version.d.ts.map +1 -0
- package/lib/types/web-request.d.ts +11 -0
- package/lib/types/web-request.d.ts.map +1 -0
- package/lib/types/web.d.ts +118 -0
- package/lib/types/web.d.ts.map +1 -0
- package/lib/upstream.js +860 -0
- package/lib/upstream.js.map +1 -0
- package/lib/version.js +18 -0
- package/lib/version.js.map +1 -0
- package/lib/web-request.js +29 -0
- package/lib/web-request.js.map +1 -0
- package/lib/web.js +462 -0
- package/lib/web.js.map +1 -0
- package/package.json +149 -0
- package/patches/vision-tools-dsh.patch +970 -0
- package/runtime/requirements.lock +3 -0
- package/src/artifact-access.ts +386 -0
- package/src/artifacts.ts +85 -0
- package/src/client/display-config.ts +62 -0
- package/src/client/index.tsx +1580 -0
- package/src/client/model-variants-hider.ts +159 -0
- package/src/client/paste-images.tsx +747 -0
- package/src/config.ts +290 -0
- package/src/defaults.ts +5 -0
- package/src/errors.ts +62 -0
- package/src/evidence-cache.ts +418 -0
- package/src/exposure.ts +265 -0
- package/src/image-input-variants.ts +996 -0
- package/src/index.ts +141 -0
- package/src/paste-images.ts +286 -0
- package/src/paths.ts +383 -0
- package/src/plugin-update.ts +1143 -0
- package/src/runtime-install.ts +1161 -0
- package/src/runtime-manager.ts +174 -0
- package/src/runtime.ts +2189 -0
- package/src/skill.ts +35 -0
- package/src/tools.ts +691 -0
- package/src/upstream.ts +1078 -0
- package/src/version.ts +37 -0
- package/src/web-request.ts +27 -0
- package/src/web.ts +594 -0
- package/vendor/agent-vision-toolkit/CHANGELOG.md +30 -0
- package/vendor/agent-vision-toolkit/LICENSE +21 -0
- package/vendor/agent-vision-toolkit/README.md +405 -0
- package/vendor/agent-vision-toolkit/UPSTREAM_MANIFEST.json +94 -0
- package/vendor/agent-vision-toolkit/bin/crop +90 -0
- package/vendor/agent-vision-toolkit/bin/detect +13 -0
- package/vendor/agent-vision-toolkit/bin/glance +93 -0
- package/vendor/agent-vision-toolkit/bin/ground +13 -0
- package/vendor/agent-vision-toolkit/bin/trace +129 -0
- package/vendor/agent-vision-toolkit/detect.py +60 -0
- package/vendor/agent-vision-toolkit/ground.py +267 -0
- package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/dominant_colors.py +224 -0
- package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/extract_fg.py +278 -0
- package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/html_shot.py +420 -0
- package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/long_screenshot_ocr.py +1245 -0
- package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/pixel_diff.py +88 -0
- package/vendor/agent-vision-toolkit/tests/test_vision_client.py +450 -0
- package/vendor/agent-vision-toolkit/vision_client.py +310 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/** Clipboard-only multi-image input for DSH Web. */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
|
|
4
|
+
import type { InputTriggerSource } from '@deepseek-ai/dsh-client-ui-input-trigger/client';
|
|
5
|
+
import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
6
|
+
export declare const PASTE_IMAGES_ROUTE = "/_dsh/vision-toolkit/paste-images";
|
|
7
|
+
export declare const PASTE_POLICY_ROUTE = "/_dsh/vision-toolkit/paste-policy";
|
|
8
|
+
interface PasteRecord {
|
|
9
|
+
ref: string;
|
|
10
|
+
file: File;
|
|
11
|
+
batch: PasteBatch;
|
|
12
|
+
status: 'ready' | 'copying' | 'copied' | 'error';
|
|
13
|
+
error?: string | undefined;
|
|
14
|
+
absolutePath?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
interface PasteBatch {
|
|
17
|
+
sessionId: string;
|
|
18
|
+
records: PasteRecord[];
|
|
19
|
+
inflight?: Promise<void> | undefined;
|
|
20
|
+
unsubscribe?: (() => void) | undefined;
|
|
21
|
+
}
|
|
22
|
+
interface PasteOccurrence {
|
|
23
|
+
occurrenceId: number;
|
|
24
|
+
source: string;
|
|
25
|
+
ref: string;
|
|
26
|
+
offset: number;
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
29
|
+
type PasteDockProps = PropsRuntime<'conversation.input.dock'> & {
|
|
30
|
+
controller: PasteImageController;
|
|
31
|
+
remove: (occurrence: PasteOccurrence) => void;
|
|
32
|
+
};
|
|
33
|
+
/** Owns browser File objects until DSH serializes the corresponding text references. */
|
|
34
|
+
export declare class PasteImageController {
|
|
35
|
+
private readonly ctx;
|
|
36
|
+
private readonly records;
|
|
37
|
+
private readonly listeners;
|
|
38
|
+
private revision;
|
|
39
|
+
private readonly verdicts;
|
|
40
|
+
/** Guards the synthetic replay paste from re-entering capture interception. */
|
|
41
|
+
private replaying;
|
|
42
|
+
constructor(ctx: ClientContext);
|
|
43
|
+
subscribe: (listener: () => void) => (() => void);
|
|
44
|
+
snapshot: () => number;
|
|
45
|
+
private changed;
|
|
46
|
+
source(): InputTriggerSource;
|
|
47
|
+
recordsFor(occurrences: readonly PasteOccurrence[]): PasteRecord[];
|
|
48
|
+
private inputFor;
|
|
49
|
+
private insertText;
|
|
50
|
+
private insertRecords;
|
|
51
|
+
/**
|
|
52
|
+
* The host's verdict for one Session and selector label, when fresh. The
|
|
53
|
+
* last CONFIRMED answer is authoritative while a background refresh is in
|
|
54
|
+
* flight (the paste acts on what the host last said; the refresh only
|
|
55
|
+
* covers the next paste). A label that changed since the confirmation
|
|
56
|
+
* answers undefined, so the native attachment flow stays the default.
|
|
57
|
+
* @param sessionId - the live Session the paste belongs to.
|
|
58
|
+
* @param modelLabel - the model-selector label currently shown.
|
|
59
|
+
* @returns the fresh confirmed verdict, or undefined when unconfirmed.
|
|
60
|
+
*/
|
|
61
|
+
private verdictFor;
|
|
62
|
+
/**
|
|
63
|
+
* The exact model route the live model catalog reports for one Session.
|
|
64
|
+
* Unreadable routes answer undefined, so the verdict falls back to the
|
|
65
|
+
* selector label alone.
|
|
66
|
+
* @param sessionId - the live Session id.
|
|
67
|
+
* @returns the current provider/model selection, when readable.
|
|
68
|
+
*/
|
|
69
|
+
private readSelection;
|
|
70
|
+
/**
|
|
71
|
+
* Ask the host what to do with a paste for the current model, and cache the
|
|
72
|
+
* answer per Session and selector label. A model switch changes the label,
|
|
73
|
+
* which changes the cache key, so a stale verdict never outlives the model
|
|
74
|
+
* it described. The exact selection rides along when the live model catalog
|
|
75
|
+
* is readable, so the host can answer with an auto-switch route; a 404
|
|
76
|
+
* simply leaves the verdict unconfirmed; the next focus or paste retries.
|
|
77
|
+
* @param sessionId - the live Session to ask about.
|
|
78
|
+
* @param modelLabel - the model-selector label currently shown.
|
|
79
|
+
*/
|
|
80
|
+
refreshVerdict(sessionId: string, modelLabel: string): void;
|
|
81
|
+
/**
|
|
82
|
+
* Switch one Session to the route the host validated, through the same
|
|
83
|
+
* model-directory seat the selector uses when present (so the shared UI
|
|
84
|
+
* state moves with the session), falling back to the raw RPC.
|
|
85
|
+
* @param sessionId - the live Session id.
|
|
86
|
+
* @param route - the validated variant route.
|
|
87
|
+
*/
|
|
88
|
+
private switchModel;
|
|
89
|
+
/**
|
|
90
|
+
* Replay a swallowed paste as a synthetic clipboard event so the composer's
|
|
91
|
+
* own intake (limits, thumbnails, keyboard) runs with the captured files.
|
|
92
|
+
* @returns false when the environment cannot construct a clipboard payload.
|
|
93
|
+
*/
|
|
94
|
+
private replayPaste;
|
|
95
|
+
/**
|
|
96
|
+
* Auto-switch flow: switch the Session to the image-input variant, announce
|
|
97
|
+
* it, then replay the paste into the composer's native intake. A failed
|
|
98
|
+
* switch, or an environment that cannot replay clipboard bytes, degrades to
|
|
99
|
+
* the path takeover with the same files.
|
|
100
|
+
* @param sessionId - the live Session id.
|
|
101
|
+
* @param target - the composer textarea the paste landed on.
|
|
102
|
+
* @param files - the captured image files.
|
|
103
|
+
* @param text - same-paste text, replayed alongside the files.
|
|
104
|
+
* @param route - the validated variant route to switch to.
|
|
105
|
+
*/
|
|
106
|
+
private autoSwitchPaste;
|
|
107
|
+
/**
|
|
108
|
+
* Path-takeover flow: insert the same-paste text and every image as a text
|
|
109
|
+
* reference that serializes to the image's workspace path on send.
|
|
110
|
+
* @param sessionId - the live Session id.
|
|
111
|
+
* @param target - the composer textarea the paste landed on.
|
|
112
|
+
* @param files - the captured image files.
|
|
113
|
+
* @param text - same-paste text.
|
|
114
|
+
*/
|
|
115
|
+
private takeoverPaste;
|
|
116
|
+
handlePaste(event: ClipboardEvent): boolean;
|
|
117
|
+
remove(sessionId: string, occurrence: PasteOccurrence): void;
|
|
118
|
+
private upload;
|
|
119
|
+
private serialize;
|
|
120
|
+
}
|
|
121
|
+
/** Minimal per-image progress, failure, and removal feedback above the composer. */
|
|
122
|
+
export declare function PasteImageDock(props: PasteDockProps): ReactNode;
|
|
123
|
+
/** Install capture interception, the text-reference codec, and composer feedback. */
|
|
124
|
+
export declare function installPasteImages(ctx: ClientContext): void;
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=paste-images.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paste-images.d.ts","sourceRoot":"","sources":["../../../src/client/paste-images.tsx"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAE3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAA;AACzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAIpE,eAAO,MAAM,kBAAkB,sCAAsC,CAAA;AACrE,eAAO,MAAM,kBAAkB,sCAAsC,CAAA;AAQrE,UAAU,WAAW;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,UAAU,CAAA;IACjB,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;IAChD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAClC;AAED,UAAU,UAAU;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAA;IACpC,WAAW,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;CACvC;AAsBD,UAAU,eAAe;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd;AAED,KAAK,c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DN,SAAS;CAOxB;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAyB/D;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAkD3D"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin configuration: provider endpoint and credential reference, output
|
|
3
|
+
* language, limits, and the external upstream runtime location. Secrets never
|
|
4
|
+
* live here — `provider.credential` is a DSH Credential reference resolved per
|
|
5
|
+
* operation through `ctx.credentials`.
|
|
6
|
+
* @module dsh-vision-toolkit/config
|
|
7
|
+
*/
|
|
8
|
+
import type Schema from '@deepseek-ai/schemastery';
|
|
9
|
+
import { type CredentialRef } from '@deepseek-ai/dsh-credentials';
|
|
10
|
+
export { BUILT_IN_FREE_VISION_BASE_URL, BUILT_IN_FREE_VISION_CREDENTIAL, BUILT_IN_FREE_VISION_KEY, BUILT_IN_FREE_VISION_MODEL, } from './defaults.ts';
|
|
11
|
+
/** Settings document namespace owned by this plugin. */
|
|
12
|
+
export declare const VISION_TOOLKIT_SETTINGS_NAMESPACE: import("@deepseek-ai/dsh-settings").SettingsNamespace;
|
|
13
|
+
/** Browser-compatible default shared with the vendored Python client. */
|
|
14
|
+
export declare const DEFAULT_VISION_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36";
|
|
15
|
+
/** Full user-facing configuration; every field defaults at the schema boundary. */
|
|
16
|
+
export interface VisionToolkitConfig {
|
|
17
|
+
provider?: {
|
|
18
|
+
/** Provider API base URL. */
|
|
19
|
+
baseUrl?: string;
|
|
20
|
+
/** DSH Credential reference holding the API key (an environment-style name). */
|
|
21
|
+
credential?: string;
|
|
22
|
+
/** Multimodal model name. */
|
|
23
|
+
model?: string;
|
|
24
|
+
/** Vision request protocol: OpenAI Chat Completions or Anthropic Messages. */
|
|
25
|
+
protocol?: 'openai' | 'anthropic';
|
|
26
|
+
/** Anthropic thinking field behavior; `omit` leaves model defaults untouched. */
|
|
27
|
+
anthropicThinking?: 'omit' | 'disabled' | 'adaptive';
|
|
28
|
+
/** Outbound User-Agent for provider requests and connection tests. */
|
|
29
|
+
userAgent?: string;
|
|
30
|
+
};
|
|
31
|
+
/** Vision output language (`zh` or `en`). */
|
|
32
|
+
language?: 'zh' | 'en';
|
|
33
|
+
/** Single remote/upstream call budget in milliseconds. */
|
|
34
|
+
timeoutMs?: number;
|
|
35
|
+
/** Maximum input image size in bytes; larger images are auto-compressed (lossless first). */
|
|
36
|
+
maxImageBytes?: number;
|
|
37
|
+
/** Maximum decoded pixel count per input image; larger images are auto-downscaled to fit. */
|
|
38
|
+
maxImagePixels?: number;
|
|
39
|
+
/** In-flight tool execution cap per session. */
|
|
40
|
+
concurrency?: number;
|
|
41
|
+
runtime?: {
|
|
42
|
+
/** `managed` uses the packaged snapshot and isolated venv; `external` uses a clean pinned checkout. */
|
|
43
|
+
mode?: 'managed' | 'external';
|
|
44
|
+
/** Required path to the clean pinned checkout when `mode` is `external`. */
|
|
45
|
+
agentVisionToolkitPath?: string;
|
|
46
|
+
/** Optional Python 3.11+ bootstrap/interpreter override. */
|
|
47
|
+
python?: string;
|
|
48
|
+
};
|
|
49
|
+
/** Extra directories (besides the workspace) inputs may come from. */
|
|
50
|
+
allowedDirs?: string[];
|
|
51
|
+
/**
|
|
52
|
+
* Image-input variants: sibling model-selector entries for every model the
|
|
53
|
+
* host positively declares text-only. A variant declares image input, so
|
|
54
|
+
* pasted images keep the native attachment flow (composer thumbnail and
|
|
55
|
+
* durable session image), and the plugin rewrites image blocks into Vision
|
|
56
|
+
* Toolkit descriptions only on the wire to the model.
|
|
57
|
+
*/
|
|
58
|
+
imageInputVariants?: {
|
|
59
|
+
/** Whether variant routes are registered at all (default true). */
|
|
60
|
+
enabled?: boolean;
|
|
61
|
+
/** Restrict wrapped upstream routes by provider id; empty wraps every eligible route. */
|
|
62
|
+
providers?: string[];
|
|
63
|
+
/**
|
|
64
|
+
* Whether the browser paste integration automatically switches the Session
|
|
65
|
+
* to the image-input variant of a text-only model before the paste, so
|
|
66
|
+
* pasted images keep the native attachment flow with no manual model
|
|
67
|
+
* change. The variant still exposes a workspace path to the model; off
|
|
68
|
+
* keeps the path-only takeover instead (default true).
|
|
69
|
+
*/
|
|
70
|
+
autoSwitch?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Transparent routing: variant routes keep the upstream provider and model
|
|
73
|
+
* display names, and the browser integration hides the upstream text-only
|
|
74
|
+
* entries that have a variant twin, so the model selector shows one entry
|
|
75
|
+
* per model and sessions stay on the image-capable variant without users
|
|
76
|
+
* seeing or switching a `(Vision Toolkit)` route. On by default; disable
|
|
77
|
+
* to restore the explicit sibling entries.
|
|
78
|
+
*/
|
|
79
|
+
hidden?: boolean;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/** Configuration schema with the documented P0 defaults. */
|
|
83
|
+
export declare const Config: Schema<VisionToolkitConfig>;
|
|
84
|
+
/** Configuration after static validation, with every default materialized. */
|
|
85
|
+
export interface ResolvedVisionToolkitConfig {
|
|
86
|
+
provider: {
|
|
87
|
+
baseUrl: string;
|
|
88
|
+
credential: CredentialRef;
|
|
89
|
+
model: string;
|
|
90
|
+
protocol: 'openai' | 'anthropic';
|
|
91
|
+
anthropicThinking: 'omit' | 'disabled' | 'adaptive';
|
|
92
|
+
userAgent: string;
|
|
93
|
+
};
|
|
94
|
+
language: 'zh' | 'en';
|
|
95
|
+
timeoutMs: number;
|
|
96
|
+
maxImageBytes: number;
|
|
97
|
+
maxImagePixels: number;
|
|
98
|
+
concurrency: number;
|
|
99
|
+
runtime: {
|
|
100
|
+
mode: 'managed' | 'external';
|
|
101
|
+
agentVisionToolkitPath?: string;
|
|
102
|
+
python?: string;
|
|
103
|
+
};
|
|
104
|
+
allowedDirs: string[];
|
|
105
|
+
imageInputVariants: {
|
|
106
|
+
enabled: boolean;
|
|
107
|
+
providers: string[];
|
|
108
|
+
autoSwitch: boolean;
|
|
109
|
+
hidden: boolean;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Validate and normalize a config object (partial inputs receive the same
|
|
114
|
+
* defaults the schemastery schema applies). Configuration mistakes fail loud
|
|
115
|
+
* at plugin load (the earliest resolvable point); runtime availability is a
|
|
116
|
+
* separate, later concern.
|
|
117
|
+
* @param config - parsed config with defaults applied.
|
|
118
|
+
* @returns the fully defaulted, validated configuration.
|
|
119
|
+
*/
|
|
120
|
+
export declare function resolveConfig(config?: VisionToolkitConfig): ResolvedVisionToolkitConfig;
|
|
121
|
+
/** Whether a resolved provider should use the bundled public key instead of DSH credentials. */
|
|
122
|
+
export declare function isBuiltInFreeVisionProvider(provider: ResolvedVisionToolkitConfig['provider']): boolean;
|
|
123
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAShF,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,eAAe,CAAA;AAEtB,wDAAwD;AACxD,eAAO,MAAM,iCAAiC,uDAAsC,CAAA;AAEpF,yEAAyE;AACzE,eAAO,MAAM,yBAAyB,oHAAoH,CAAA;AAgB1J,mFAAmF;AACnF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE;QACT,6BAA6B;QAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,gFAAgF;QAChF,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,6BAA6B;QAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,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A;QACb,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAA;QAChC,iBAAiB,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAA;QACnD,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE;QACP,IAAI,EAAE,SAAS,GAAG,UAAU,CAAA;QAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAA;QAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,kBAAkB,EAAE;QAClB,OAAO,EAAE,OAAO,CAAA;QAChB,SAAS,EAAE,MAAM,EAAE,CAAA;QACnB,UAAU,EAAE,OAAO,CAAA;QACnB,MAAM,EAAE,OAAO,CAAA;KAChB,CAAA;CACF;AAOD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,mBAAwB,GAAG,2BAA2B,CAgG3F;AAED,gGAAgG;AAChG,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,GAAG,OAAO,CAKtG"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Public free vision service defaults shared by server and browser settings. */
|
|
2
|
+
export declare const BUILT_IN_FREE_VISION_BASE_URL = "https://vision.anionex.me/v1";
|
|
3
|
+
export declare const BUILT_IN_FREE_VISION_CREDENTIAL = "ANIONEX_FREE_VISION";
|
|
4
|
+
export declare const BUILT_IN_FREE_VISION_KEY = "https://agent-vision.anionex.me";
|
|
5
|
+
export declare const BUILT_IN_FREE_VISION_MODEL = "gemini-3.7-flash";
|
|
6
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/defaults.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,eAAO,MAAM,6BAA6B,iCAAiC,CAAA;AAC3E,eAAO,MAAM,+BAA+B,wBAAwB,CAAA;AACpE,eAAO,MAAM,wBAAwB,oCAAoC,CAAA;AACzE,eAAO,MAAM,0BAA0B,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable error vocabulary shared by the runtime, upstream adapter, and tools.
|
|
3
|
+
* Every failure reaching the model carries one of these codes and a message
|
|
4
|
+
* that never contains credentials or raw upstream stack traces.
|
|
5
|
+
* @module dsh-vision-toolkit/errors
|
|
6
|
+
*/
|
|
7
|
+
/** Discriminant tag for every Vision Toolkit failure. */
|
|
8
|
+
export declare const VISION_TOOLKIT_ERROR_CODES: readonly ["config", "input", "capacity", "service", "runtime", "output", "timeout", "cancelled", "path"];
|
|
9
|
+
/** Stable machine-readable error category. */
|
|
10
|
+
export type VisionToolkitErrorCode = typeof VISION_TOOLKIT_ERROR_CODES[number];
|
|
11
|
+
/** Error with a stable category; safe to surface to the model. */
|
|
12
|
+
export declare class VisionToolkitError extends Error {
|
|
13
|
+
readonly code: VisionToolkitErrorCode;
|
|
14
|
+
constructor(code: VisionToolkitErrorCode, message: string, options?: {
|
|
15
|
+
cause?: unknown;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Replace every known secret occurrence in untrusted text. Used before
|
|
20
|
+
* upstream stderr, exit messages, or trace reports enter logs or results.
|
|
21
|
+
* @param text - text that may embed a secret.
|
|
22
|
+
* @param secrets - values that must never be surfaced.
|
|
23
|
+
* @returns text with each secret replaced by a fixed marker.
|
|
24
|
+
*/
|
|
25
|
+
export declare function redactText(text: string, secrets: readonly string[]): string;
|
|
26
|
+
/**
|
|
27
|
+
* Build a model-safe upstream failure line: the tool prefix plus the
|
|
28
|
+
* redacted stderr tail, never a JavaScript stack.
|
|
29
|
+
* @param tool - upstream CLI name.
|
|
30
|
+
* @param stderr - captured upstream stderr.
|
|
31
|
+
* @param secrets - values to redact.
|
|
32
|
+
* @returns one-line safe message.
|
|
33
|
+
*/
|
|
34
|
+
export declare function upstreamFailureMessage(tool: string, stderr: string, secrets: readonly string[]): string;
|
|
35
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,yDAAyD;AACzD,eAAO,MAAM,0BAA0B,0GAU7B,CAAA;AAEV,8CAA8C;AAC9C,MAAM,MAAM,sBAAsB,GAAG,OAAO,0BAA0B,CAAC,MAAM,CAAC,CAAA;AAE9E,kEAAkE;AAClE,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAA;gBAEzB,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAKzF;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAO3E;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAGvG"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** Durable, Session-scoped cache for image descriptions used by model variants. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { ContentBlock } from '@deepseek-ai/dsh-llm';
|
|
4
|
+
import type { ResolvedVisionToolkitConfig } from './config.ts';
|
|
5
|
+
/** Bump only when the model-visible evidence contract changes incompatibly. */
|
|
6
|
+
export declare const EVIDENCE_CONTRACT_VERSION = 1;
|
|
7
|
+
type EvidenceRecordKey = string & {
|
|
8
|
+
readonly __evidenceRecordKey: unique symbol;
|
|
9
|
+
};
|
|
10
|
+
/** Plugin-owned sidecar domain; the host backend handles atomicity and file safety. */
|
|
11
|
+
export declare const evidenceCacheDomainSpec: {
|
|
12
|
+
name: string;
|
|
13
|
+
version: number;
|
|
14
|
+
tables: {
|
|
15
|
+
evidence: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec<EvidenceRecordKey, string>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
/** Stable metadata for one description lookup. Raw focus prompts are never persisted. */
|
|
19
|
+
export interface EvidenceCacheKey {
|
|
20
|
+
readonly digest: string;
|
|
21
|
+
readonly contractVersion: number;
|
|
22
|
+
readonly sessionId?: string;
|
|
23
|
+
readonly sessionCreatedAt?: number;
|
|
24
|
+
readonly sessionCwd?: string;
|
|
25
|
+
readonly attachmentId: string;
|
|
26
|
+
readonly promptHash: string;
|
|
27
|
+
readonly runtimeHash: string;
|
|
28
|
+
}
|
|
29
|
+
/** Optional durable layer behind the process-local promise/LRU cache. */
|
|
30
|
+
export interface EvidencePersistence {
|
|
31
|
+
read(key: EvidenceCacheKey): Promise<ContentBlock | undefined>;
|
|
32
|
+
write(key: EvidenceCacheKey, block: ContentBlock): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
/** Fingerprint every runtime setting that can change the generated description. */
|
|
35
|
+
export declare function evidenceRuntimeFingerprint(config: ResolvedVisionToolkitConfig, credentialSha256?: string, sslVerify?: string): string;
|
|
36
|
+
/** Build a non-secret cache key from the Session, attachment, focus, and runtime contract. */
|
|
37
|
+
export declare function createEvidenceCacheKey(input: {
|
|
38
|
+
sessionId?: string;
|
|
39
|
+
sessionIdentity?: SessionIdentity;
|
|
40
|
+
attachmentId: string;
|
|
41
|
+
prompt: string;
|
|
42
|
+
runtimeHash: string;
|
|
43
|
+
}): EvidenceCacheKey;
|
|
44
|
+
/** Bounded promise cache; concurrent readers join one load and rejected loads are evicted. */
|
|
45
|
+
export declare class EvidenceCache {
|
|
46
|
+
private readonly limit;
|
|
47
|
+
private readonly persistence?;
|
|
48
|
+
private readonly entries;
|
|
49
|
+
constructor(limit: number, persistence?: EvidencePersistence | undefined);
|
|
50
|
+
/** Read a memory/durable hit or compute and persist one model-visible result. */
|
|
51
|
+
read(key: string | EvidenceCacheKey, load: () => Promise<ContentBlock>): Promise<ContentBlock>;
|
|
52
|
+
/** Drop process-local descriptions; durable rows stay versioned by their runtime fingerprint. */
|
|
53
|
+
clear(): void;
|
|
54
|
+
}
|
|
55
|
+
interface SessionIdentity {
|
|
56
|
+
createdAt: number;
|
|
57
|
+
cwd?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface SessionEvidenceStoreOptions {
|
|
60
|
+
maxEntries?: number;
|
|
61
|
+
maxBytes?: number;
|
|
62
|
+
maxEntryBytes?: number;
|
|
63
|
+
now?: () => number;
|
|
64
|
+
}
|
|
65
|
+
/** Official DSH storage-domain sidecar used to survive Profile restarts. */
|
|
66
|
+
export declare class SessionEvidenceStore implements EvidencePersistence {
|
|
67
|
+
private readonly ctx;
|
|
68
|
+
private storage;
|
|
69
|
+
private storageFiber;
|
|
70
|
+
private storageReady;
|
|
71
|
+
private mutationTail;
|
|
72
|
+
private readonly flushes;
|
|
73
|
+
private warned;
|
|
74
|
+
private readonly maxEntries;
|
|
75
|
+
private readonly maxBytes;
|
|
76
|
+
private readonly maxEntryBytes;
|
|
77
|
+
private readonly now;
|
|
78
|
+
constructor(ctx: Context, options?: SessionEvidenceStoreOptions);
|
|
79
|
+
/** Release the optional storage binding with the owning variant lifecycle. */
|
|
80
|
+
dispose(): void;
|
|
81
|
+
read(key: EvidenceCacheKey): Promise<ContentBlock | undefined>;
|
|
82
|
+
write(key: EvidenceCacheKey, block: ContentBlock): Promise<void>;
|
|
83
|
+
private sessionFor;
|
|
84
|
+
private prepareStorage;
|
|
85
|
+
private enqueueMutation;
|
|
86
|
+
private flushSession;
|
|
87
|
+
private prune;
|
|
88
|
+
private warnOnce;
|
|
89
|
+
}
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=evidence-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-cache.d.ts","sourceRoot":"","sources":["../../src/evidence-cache.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAGnF,OAAO,KAAK,EAAE,OAAO,EAAS,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAG9D,+EAA+E;AAC/E,eAAO,MAAM,yBAAyB,IAAI,CAAA;AA0B1C,KAAK,iBAAiB,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,mBAAmB,EAAE,OAAO,MAAM,CAAA;CAAE,CAAA;AAEjF,uFAAuF;AACvF,eAAO,MAAM,uBAAuB;;;;;;CASlC,CAAA;AAEF,yFAAyF;AACzF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,yEAAyE;AACzE,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAA;IAC9D,KAAK,CAAC,GAAG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AC,QAAQ,CAAC,GAAG;IAZtB,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,YAAY,CAA0C;IAC9D,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,YAAY,CAAmC;IACvD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsC;IAC9D,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAQ;IACtC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAc;gBAGf,GAAG,EAAE,OAAO,EAC7B,OAAO,GAAE,2BAAgC;IA8B3C,8EAA8E;IAC9E,OAAO,IAAI,IAAI;IAOT,IAAI,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAc9D,KAAK,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BtE,OAAO,CAAC,UAAU;YAWJ,cAAc;IAO5B,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,YAAY;YAWN,KAAK;IAwBnB,OAAO,CAAC,QAAQ;CAQjB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent-scoped progressive exposure for the model-facing visual tools.
|
|
3
|
+
* Runtime readiness is global, while tool schemas enter only an Agent through
|
|
4
|
+
* the matching Skill or its bootstrap tool; administrative diagnostics stay on
|
|
5
|
+
* the Web seam.
|
|
6
|
+
* @module dsh-vision-toolkit/exposure
|
|
7
|
+
*/
|
|
8
|
+
import { type ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
9
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
10
|
+
/** Small bootstrap tool retained only until the current Agent gains visual tools. */
|
|
11
|
+
export declare const VISION_TOOLKIT_ACTIVATE = "vision_toolkit_activate";
|
|
12
|
+
/** Skill name used by releases before the rename to vision-skills. */
|
|
13
|
+
export declare const LEGACY_VISION_TOOLS_SKILL_NAME = "vision-tools";
|
|
14
|
+
/** Unique pre-rename line in bundled instructions, kept for Session restore. */
|
|
15
|
+
export declare const LEGACY_VISION_TOOLS_SKILL_MARKER = "If this content arrived through a direct `/vision-tools` invocation and the";
|
|
16
|
+
/** Result returned by the one-shot activation transport. */
|
|
17
|
+
export interface VisionToolkitActivationResult {
|
|
18
|
+
activated: boolean;
|
|
19
|
+
tools: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Owns one progressive-exposure generation for a ready Vision Toolkit runtime.
|
|
23
|
+
* The bootstrap tool is global; visual definitions are created and registered
|
|
24
|
+
* in an Agent scope after the Skill load is durable, just succeeded, or the
|
|
25
|
+
* model explicitly invokes the bootstrap fallback.
|
|
26
|
+
*/
|
|
27
|
+
export declare class VisionToolExposure {
|
|
28
|
+
private readonly ctx;
|
|
29
|
+
private readonly createTools;
|
|
30
|
+
readonly activationTool: ToolDefinition;
|
|
31
|
+
private readonly states;
|
|
32
|
+
private installed;
|
|
33
|
+
/**
|
|
34
|
+
* @param ctx - Plugin context with Tool and Agent registries.
|
|
35
|
+
* @param createTools - Fresh definitions bound to the current runtime generation.
|
|
36
|
+
*/
|
|
37
|
+
constructor(ctx: Context, createTools: () => ToolDefinition[]);
|
|
38
|
+
/** Install lifecycle listeners and adopt Agents that already exist. */
|
|
39
|
+
install(): () => void;
|
|
40
|
+
private attach;
|
|
41
|
+
private activate;
|
|
42
|
+
/** Whether the session is attached to the live SessionStore (production). */
|
|
43
|
+
private isLiveSession;
|
|
44
|
+
private applyHideActivationForSession;
|
|
45
|
+
private applyHideActivation;
|
|
46
|
+
private detach;
|
|
47
|
+
private disposeStates;
|
|
48
|
+
private disposeState;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=exposure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exposure.d.ts","sourceRoot":"","sources":["../../src/exposure.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD,qFAAqF;AACrF,eAAO,MAAM,uBAAuB,4BAA4B,CAAA;AAEhE,sEAAsE;AACtE,eAAO,MAAM,8BAA8B,iBAAiB,CAAA;AAE5D,gFAAgF;AAChF,eAAO,MAAM,gCAAgC,gFAAgF,CAAA;AAS7H,4DAA4D;AAC5D,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AA8ED;;;;;GAKG;AACH,qBAAa,kBAAkB;IAU3B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAV9B,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkC;IACzD,OAAO,CAAC,SAAS,CAAQ;IAEzB;;;OAGG;gBAEgB,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,MAAM,cAAc,EAAE;IA6BtD,uEAAuE;IACvE,OAAO,IAAI,MAAM,IAAI;IAoCrB,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,QAAQ;IA0BhB,6EAA6E;IAC7E,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,6BAA6B;IAQrC,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,YAAY;CAIrB"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Image-input variants: sibling model-selector entries for every model the
|
|
3
|
+
* host positively declares text-only. A variant declares image input, so
|
|
4
|
+
* pasted images keep the native attachment flow — composer thumbnail and the
|
|
5
|
+
* durable session image — while the variant's stream rewrites every image
|
|
6
|
+
* block into a workspace path plus a Vision Toolkit description before
|
|
7
|
+
* delegating to the original route. The durable log is untouched; only the
|
|
8
|
+
* wire carries the evidence text.
|
|
9
|
+
* @module dsh-vision-toolkit/image-input-variants
|
|
10
|
+
*/
|
|
11
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
12
|
+
import LlmService, { LlmAdapter } from '@deepseek-ai/dsh-llm';
|
|
13
|
+
import type { GenerateOptions, LlmModelInfo, LlmProviderInfo, LlmResolvedModelInfo, Message, ResolvedRetryPolicy, StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
14
|
+
import type { ResolvedVisionToolkitConfig } from './config.ts';
|
|
15
|
+
import { EvidenceCache } from './evidence-cache.ts';
|
|
16
|
+
import { type PasteSelectionQuery, type PasteVerdict } from './paste-images.ts';
|
|
17
|
+
import type { CapturedEvidenceRuntime, VisionToolkitRuntime } from './runtime.ts';
|
|
18
|
+
export { EvidenceCache } from './evidence-cache.ts';
|
|
19
|
+
/** Provider-id prefix for the variant routes this plugin registers. */
|
|
20
|
+
export declare const VARIANT_PROVIDER_PREFIX = "vision-toolkit-";
|
|
21
|
+
/** Display suffix shared by variant provider names and variant model names. */
|
|
22
|
+
export declare const VARIANT_SUFFIX = " (Vision Toolkit)";
|
|
23
|
+
/** The variant provider route minted for one upstream route. */
|
|
24
|
+
export declare function variantProviderId(upstream: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether one model earns an image-input variant: the host must positively
|
|
27
|
+
* declare it text-only. A model with unknown modalities is left alone — its
|
|
28
|
+
* native channel is the safe default, and the variant would degrade it.
|
|
29
|
+
* @param info - model metadata from the host catalog.
|
|
30
|
+
* @returns true when the model is confirmed text-only.
|
|
31
|
+
*/
|
|
32
|
+
export declare function shouldWrapModel(info: Pick<LlmModelInfo, 'inputModalities'>): boolean;
|
|
33
|
+
/** Whether a content block list carries an image at any depth (tool-result nesting included). */
|
|
34
|
+
export { contentHasImage } from '@deepseek-ai/dsh-llm';
|
|
35
|
+
/**
|
|
36
|
+
* Wait on a shared promise without inheriting its lifetime: the caller's
|
|
37
|
+
* abort rejects this wait immediately, while the underlying read keeps
|
|
38
|
+
* running and lands in the cache for the retry.
|
|
39
|
+
* @param promise - the shared computation.
|
|
40
|
+
* @param signal - the caller's cancellation, or undefined to wait unconditionally.
|
|
41
|
+
* @returns the computed value, unless the caller aborted first.
|
|
42
|
+
*/
|
|
43
|
+
export declare function abortableWait<T>(promise: Promise<T>, signal: AbortSignal | undefined): Promise<T>;
|
|
44
|
+
/**
|
|
45
|
+
* Rewrite image blocks in one message list into description text blocks.
|
|
46
|
+
* The original messages are returned untouched when nothing carries an image;
|
|
47
|
+
* converted messages are new objects, so the durable request stays immutable.
|
|
48
|
+
* @param ctx - plugin context for the attachments service.
|
|
49
|
+
* @param runtime - the immutable runtime snapshot captured for this conversion.
|
|
50
|
+
* @param cache - shared process/durable description cache.
|
|
51
|
+
* @param messages - the assembled request messages.
|
|
52
|
+
* @param signal - the caller's cancellation for this conversion pass.
|
|
53
|
+
* @param sessionId - the live Session identity, when available.
|
|
54
|
+
* @param runtimeHash - stable fingerprint of the vision provider and evidence runtime.
|
|
55
|
+
* @returns the rewritten message list.
|
|
56
|
+
*/
|
|
57
|
+
export declare function convertImagesToEvidence(ctx: Context, runtime: () => CapturedEvidenceRuntime | undefined, cache: EvidenceCache, messages: readonly Message[], signal?: AbortSignal, sessionId?: string, runtimeHash?: string): Promise<Message[]>;
|
|
58
|
+
/**
|
|
59
|
+
* The adapter behind one variant route: model metadata declares image input,
|
|
60
|
+
* and every stream rewrites image blocks before delegating to the upstream
|
|
61
|
+
* route through the host service (so the upstream route's own middleware,
|
|
62
|
+
* retry policy, and replay handling still apply).
|
|
63
|
+
*/
|
|
64
|
+
export declare class ImageInputVariantAdapter extends LlmAdapter {
|
|
65
|
+
private readonly ctx;
|
|
66
|
+
private readonly llm;
|
|
67
|
+
private readonly upstream;
|
|
68
|
+
private readonly upstreamName;
|
|
69
|
+
private readonly runtime;
|
|
70
|
+
private readonly cache;
|
|
71
|
+
private readonly hidden;
|
|
72
|
+
constructor(ctx: Context, llm: LlmService, upstream: string, upstreamName: string, runtime: () => VisionToolkitRuntime | undefined, cache: EvidenceCache, hidden?: () => boolean);
|
|
73
|
+
providerInfo(provider: string): LlmProviderInfo;
|
|
74
|
+
listModels(provider: string): Promise<readonly LlmModelInfo[]>;
|
|
75
|
+
resolveModel(provider: string, model: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
76
|
+
/**
|
|
77
|
+
* Keep the variant route aligned with the configured upstream route's retry
|
|
78
|
+
* policy. This route is a wire-only facade; without this delegation it would
|
|
79
|
+
* silently fall back to the host default policy when selected for images.
|
|
80
|
+
*/
|
|
81
|
+
providerRetryPolicy(): ResolvedRetryPolicy | undefined;
|
|
82
|
+
stream(options: GenerateOptions): AsyncGenerator<StreamChunk>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Whether the plugin should take a paste over for one live Session: true only
|
|
86
|
+
* when the current model is positively declared text-only. The model-selector
|
|
87
|
+
* label is the authoritative source when supplied — the Session's persisted
|
|
88
|
+
* route header only updates on a request, so a model switch would otherwise be
|
|
89
|
+
* invisible until the next turn — with a fallback to that header. Unknown
|
|
90
|
+
* routes answer false: the native attachment flow is the safe default, and a
|
|
91
|
+
* text-only model merely keeps its ordinary image-admission error.
|
|
92
|
+
* @param ctx - plugin context with `sessions` and `llm`.
|
|
93
|
+
* @param sessionId - the live Session id the paste belongs to.
|
|
94
|
+
* @param modelLabel - the model-selector label the client currently shows, if any.
|
|
95
|
+
* @returns true when pastes should become workspace paths instead of attachments.
|
|
96
|
+
*/
|
|
97
|
+
export declare function sessionPasteTakeover(ctx: Context, sessionId: string, modelLabel?: string): Promise<boolean>;
|
|
98
|
+
/**
|
|
99
|
+
* Resolve the takeover verdict from the Session's last requested route header.
|
|
100
|
+
* @param ctx - plugin context with `sessions` and `llm`.
|
|
101
|
+
* @param sessionId - the live Session id.
|
|
102
|
+
* @returns true when the persisted route is positively text-only.
|
|
103
|
+
*/
|
|
104
|
+
export declare function sessionHeaderTakeover(ctx: Context, sessionId: string): Promise<boolean>;
|
|
105
|
+
/**
|
|
106
|
+
* Resolve the takeover verdict from a model-selector label alone. Every model
|
|
107
|
+
* whose name or id appears in the label votes: any image-capable (or unknown-
|
|
108
|
+
* capability) match vetoes the takeover, and at least one positively text-only
|
|
109
|
+
* match confirms it. A route whose catalog cannot be read also vetoes — the
|
|
110
|
+
* unreadable route is exactly where an image-capable twin could hide, so a
|
|
111
|
+
* label match on a half-read catalog must not confirm a takeover. The label
|
|
112
|
+
* carries no provider id, so no picking is attempted: the answer is decisive
|
|
113
|
+
* only when the whole catalog was walkable and every match agrees.
|
|
114
|
+
* @param ctx - plugin context with the `llm` service.
|
|
115
|
+
* @param label - the selector label the browser shows.
|
|
116
|
+
* @returns true (take over), false (native), or undefined when nothing matched.
|
|
117
|
+
*/
|
|
118
|
+
export declare function labelTakeoverVerdict(ctx: Context, label: string): Promise<boolean | undefined>;
|
|
119
|
+
/**
|
|
120
|
+
* Paste-policy resolver with a short cache. The exact route is the live fact
|
|
121
|
+
* (the browser re-reads it per paste), and the host catalog only changes on
|
|
122
|
+
* topology events, so a brief cache is safe; every `llm/adapters-updated`
|
|
123
|
+
* notification empties it — including the sweep that registers a variant
|
|
124
|
+
* after the first sweep, so a stale "no variant" verdict cannot outlive the
|
|
125
|
+
* route it described.
|
|
126
|
+
* @param ctx - plugin context with the `llm` service.
|
|
127
|
+
* @param getConfig - resolves the current plugin configuration per verdict.
|
|
128
|
+
* @returns the cached verdict resolver for the Web paste-policy route.
|
|
129
|
+
*/
|
|
130
|
+
export declare function createPasteTakeoverResolver(ctx: Context, getConfig: () => ResolvedVisionToolkitConfig): (sessionId: string, selection?: PasteSelectionQuery, modelLabel?: string) => Promise<PasteVerdict>;
|
|
131
|
+
/**
|
|
132
|
+
* Register and maintain one variant route per eligible upstream route. Routes
|
|
133
|
+
* that later vanish are released; routes that gain eligible models later are
|
|
134
|
+
* picked up by the next sweep (host topology notifications included).
|
|
135
|
+
* @param ctx - plugin context with the `llm` service.
|
|
136
|
+
* @param getConfig - resolves the current plugin configuration per sweep.
|
|
137
|
+
* @param getRuntime - the currently serving Vision Toolkit runtime, if ready.
|
|
138
|
+
* @returns the disposer and a manual re-sweep trigger (settings changes).
|
|
139
|
+
*/
|
|
140
|
+
export declare function installImageInputVariants(ctx: Context, getConfig: () => ResolvedVisionToolkitConfig, getRuntime: () => VisionToolkitRuntime | undefined): {
|
|
141
|
+
dispose: () => void;
|
|
142
|
+
reconcile: () => void;
|
|
143
|
+
};
|
|
144
|
+
//# sourceMappingURL=image-input-variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-input-variants.d.ts","sourceRoot":"","sources":["../../src/image-input-variants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,UAAU,EAAE,EAAE,UAAU,EAAmB,MAAM,sBAAsB,CAAA;AAC9E,OAAO,KAAK,EAEV,eAAe,EAEf,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,OAAO,EACP,mBAAmB,EACnB,WAAW,EACZ,MAAM,sBAAsB,CAAA;AAI7B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,EAEL,aAAa,EAEd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAoB,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACjG,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,oBAAoB,CAAA;AAExD,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AAM,oBAAoB,GAAG,SAAS,GACjD;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,IAAI,CAAA;CAAE,CA0KhD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @mengruo/dsh-vision-toolkit — DSH Vision Toolkit profile bundle.
|
|
3
|
+
*
|
|
4
|
+
* Plugin lifecycle follows the documented readiness chain: verify the pinned
|
|
5
|
+
* upstream checkout, publish the vision-skills Skill and its one-shot bootstrap,
|
|
6
|
+
* then mount the execution tools only in Agents that load that Skill or invoke
|
|
7
|
+
* the bootstrap. Any
|
|
8
|
+
* failure leaves no model capability behind, and disposal unregisters every
|
|
9
|
+
* global and Agent-scoped contribution the plugin mounted.
|
|
10
|
+
* @module @mengruo/dsh-vision-toolkit
|
|
11
|
+
*/
|
|
12
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
13
|
+
import { Config, type VisionToolkitConfig } from './config.ts';
|
|
14
|
+
export declare const name = "@mengruo/dsh-vision-toolkit";
|
|
15
|
+
export { Config };
|
|
16
|
+
export declare const inject: string[];
|
|
17
|
+
/** Plugin entry: validate configuration synchronously, then mount asynchronously. */
|
|
18
|
+
export declare function apply(ctx: Context, config?: VisionToolkitConfig): Promise<() => void>;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO,EACL,MAAM,EAGN,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAA;AAUpB,eAAO,MAAM,IAAI,gCAAgC,CAAA;AAEjD,OAAO,EAAE,MAAM,EAAE,CAAA;AAEjB,eAAO,MAAM,MAAM,UAAqF,CAAA;AAExG,qFAAqF;AACrF,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,mBAAwB,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAqG/F"}
|