@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,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability-gated HTTP delivery for managed Vision Toolkit artifacts.
|
|
3
|
+
* Signed tokens are durable across process restarts, expose no secret, and
|
|
4
|
+
* are accepted only for the exact artifact facts projected into a tool result.
|
|
5
|
+
* @module dsh-vision-toolkit/artifact-access
|
|
6
|
+
*/
|
|
7
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
8
|
+
import type { JsonValue } from '@deepseek-ai/dsh-tools';
|
|
9
|
+
import type { ArtifactDescriptor, ArtifactKind } from './artifacts.ts';
|
|
10
|
+
/** Prefix owned by the plugin's artifact capability route. */
|
|
11
|
+
export declare const ARTIFACT_ROUTE_PREFIX = "/_dsh/vision-toolkit/artifacts";
|
|
12
|
+
/** Presentation metadata key reserved by the browser half of this package. */
|
|
13
|
+
export declare const PRESENTATION_META_KEY = "$dshVisionToolkit";
|
|
14
|
+
interface ArtifactTokenPayload {
|
|
15
|
+
v: 1;
|
|
16
|
+
path: string;
|
|
17
|
+
filename: string;
|
|
18
|
+
mimeType: string;
|
|
19
|
+
kind: ArtifactKind;
|
|
20
|
+
bytes: number;
|
|
21
|
+
}
|
|
22
|
+
/** Browser-only access grant paired to one model-visible artifact descriptor. */
|
|
23
|
+
export interface ArtifactAccessGrant {
|
|
24
|
+
path: string;
|
|
25
|
+
previewUrl: string;
|
|
26
|
+
downloadUrl: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Load or atomically create the per-DSH-home signing key.
|
|
30
|
+
* @param root - state root override used by tests; defaults to the plugin cache.
|
|
31
|
+
* @returns the 32-byte signing key.
|
|
32
|
+
*/
|
|
33
|
+
export declare function prepareArtifactAccessKey(root?: string): Promise<Buffer>;
|
|
34
|
+
/** Signed-capability encoder and safe Artifact route handler. */
|
|
35
|
+
export declare class ArtifactAccessController {
|
|
36
|
+
private readonly key;
|
|
37
|
+
private routeCount;
|
|
38
|
+
constructor(key: Buffer);
|
|
39
|
+
/** Whether at least one HTTP carrier currently owns the route. */
|
|
40
|
+
get routeAvailable(): boolean;
|
|
41
|
+
/** Mark one route attachment; the returned disposer removes that attachment. */
|
|
42
|
+
attachRoute(): () => void;
|
|
43
|
+
/**
|
|
44
|
+
* Purely enrich a canonical tool-result value with browser access grants.
|
|
45
|
+
* @param value - schema-validated tool result.
|
|
46
|
+
* @returns the unchanged value when no route/artifact exists, otherwise a detached metadata envelope.
|
|
47
|
+
*/
|
|
48
|
+
presentationMeta(value: JsonValue): JsonValue;
|
|
49
|
+
/** Mint a deterministic, tamper-evident capability for one descriptor. */
|
|
50
|
+
sign(artifact: ArtifactDescriptor): string;
|
|
51
|
+
/** Verify and decode one capability without touching the filesystem. */
|
|
52
|
+
verify(token: string): ArtifactTokenPayload | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Serve one GET/HEAD capability request with MIME, CSP, and symlink checks.
|
|
55
|
+
* @param req - Node HTTP request matched under {@link ARTIFACT_ROUTE_PREFIX}.
|
|
56
|
+
* @param res - response owned by this handler.
|
|
57
|
+
*/
|
|
58
|
+
handle(req: IncomingMessage, res: ServerResponse): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=artifact-access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-access.d.ts","sourceRoot":"","sources":["../../src/artifact-access.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAItE,8DAA8D;AAC9D,eAAO,MAAM,qBAAqB,mCAAmC,CAAA;AAErE,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,sBAAsB,CAAA;AAExD,UAAU,oBAAoB;IAC5B,CAAC,EAAE,CAAC,CAAA;IACJ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,YAAY,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,iFAAiF;AACjF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;CACpB;AAkGD;;;;GAIG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,SAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,CAgB/F;AAmFD,iEAAiE;AACjE,qBAAa,wBAAwB;IAGvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAFhC,OAAO,CAAC,UAAU,CAAI;gBAEO,GAAG,EAAE,MAAM;IAIxC,kEAAkE;IAClE,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED,gFAAgF;IAChF,WAAW,IAAI,MAAM,IAAI;IAUzB;;;;OAIG;IACH,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS;IAc7C,0EAA0E;IAC1E,IAAI,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM;IAa1C,wEAAwE;IACxE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAkBvD;;;;OAIG;IACG,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA+DvE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable file-delivery descriptors owned by the plugin. DSH Core currently
|
|
3
|
+
* has no reusable Artifact service, so every file-producing tool returns this
|
|
4
|
+
* lossless contract and keeps the file inside the plugin-managed artifact
|
|
5
|
+
* directory for Web, Headless, and later tool calls alike.
|
|
6
|
+
* @module dsh-vision-toolkit/artifacts
|
|
7
|
+
*/
|
|
8
|
+
import { type PathPolicy } from './paths.ts';
|
|
9
|
+
/** Artifact payload family used by clients to select a safe renderer. */
|
|
10
|
+
export type ArtifactKind = 'image' | 'svg' | 'markdown' | 'json';
|
|
11
|
+
/** Intended default client action for one artifact. */
|
|
12
|
+
export type ArtifactPreviewIntent = 'image' | 'svg' | 'text' | 'download';
|
|
13
|
+
/** Stable descriptor returned by every file-producing Vision Toolkit tool. */
|
|
14
|
+
export interface ArtifactDescriptor {
|
|
15
|
+
path: string;
|
|
16
|
+
filename: string;
|
|
17
|
+
mimeType: string;
|
|
18
|
+
kind: ArtifactKind;
|
|
19
|
+
description: string;
|
|
20
|
+
sourceTool: string;
|
|
21
|
+
previewIntent: ArtifactPreviewIntent;
|
|
22
|
+
bytes: number;
|
|
23
|
+
}
|
|
24
|
+
/** Metadata needed to describe an already committed managed artifact. */
|
|
25
|
+
export interface ArtifactDescription {
|
|
26
|
+
mimeType: string;
|
|
27
|
+
kind: ArtifactKind;
|
|
28
|
+
description: string;
|
|
29
|
+
sourceTool: string;
|
|
30
|
+
previewIntent: ArtifactPreviewIntent;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Validate and describe one committed regular file under the active artifact
|
|
34
|
+
* root. Symbolic links are rejected even when their targets remain in-bounds,
|
|
35
|
+
* so a later preview/download can never be redirected after delivery.
|
|
36
|
+
* @param path - final managed artifact path.
|
|
37
|
+
* @param policy - active workspace path policy.
|
|
38
|
+
* @param description - stable type and presentation facts.
|
|
39
|
+
* @returns a complete descriptor with the committed byte size.
|
|
40
|
+
*/
|
|
41
|
+
export declare function describeArtifact(path: string, policy: PathPolicy, description: ArtifactDescription): Promise<ArtifactDescriptor>;
|
|
42
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,YAAY,CAAA;AAEtD,yEAAyE;AACzE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAA;AAEhE,uDAAuD;AACvD,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,CAAA;AAEzE,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,YAAY,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,qBAAqB,CAAA;IACpC,KAAK,EAAE,MAAM,CAAA;CACd;AAED,yEAAyE;AACzE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,YAAY,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,qBAAqB,CAAA;CACrC;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,mBAAmB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CA+B7B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-side display-mode flags for transparent variant routing. The paste
|
|
3
|
+
* integration uses a short-lived cache so it does not hammer the same-origin
|
|
4
|
+
* route on every paste. The model selector itself decides purely from DOM
|
|
5
|
+
* display names and does not read this route.
|
|
6
|
+
* @module dsh-vision-toolkit/display-config
|
|
7
|
+
*/
|
|
8
|
+
export declare const DISPLAY_CONFIG_ROUTE = "/_dsh/vision-toolkit/display-config";
|
|
9
|
+
/**
|
|
10
|
+
* Resolve the current transparent-routing flag, failing closed to non-hidden
|
|
11
|
+
* (explicit sibling entries) when the route is unreachable or the payload is
|
|
12
|
+
* malformed.
|
|
13
|
+
* @returns the display-mode flags observed from the host.
|
|
14
|
+
*/
|
|
15
|
+
export declare function readDisplayConfig(): Promise<{
|
|
16
|
+
hidden: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Drop the cached flag and invalidate in-flight responses (test seams,
|
|
20
|
+
* Settings saves, and connection-reset handling). An older request that
|
|
21
|
+
* resolves afterwards must not repopulate the cache with a stale flag.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resetDisplayConfigCache(): void;
|
|
24
|
+
//# sourceMappingURL=display-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-config.d.ts","sourceRoot":"","sources":["../../../src/client/display-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,oBAAoB,wCAAwC,CAAA;AAYzE;;;;;GAKG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,CAyBtE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAG9C"}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH Vision Toolkit browser plugin: dedicated Tool cards plus the Settings,
|
|
3
|
+
* health, connection-test, and safe Artifact preview experience.
|
|
4
|
+
*/
|
|
5
|
+
import type { ClientContext, ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client';
|
|
6
|
+
declare const en: {
|
|
7
|
+
readonly nav: "Vision";
|
|
8
|
+
readonly settingsTitle: "Vision Toolkit";
|
|
9
|
+
readonly settingsIntro: "Configure the pinned visual engineering runtime, its external vision endpoint, and local safety limits.";
|
|
10
|
+
readonly externalNotice: "Remote tools send the selected image bytes to the configured external vision API. Local crop, trace, pixel diff, palette, foreground extraction, and HTML rendering do not upload images.";
|
|
11
|
+
readonly provider: "Vision service";
|
|
12
|
+
readonly providerHint: "Choose the API protocol, then provide the service address, model, and API key used by online vision features.";
|
|
13
|
+
readonly aihubmixTutorial: "Need an AIHubMix key for free Gemini 3.7 Flash vision? Follow the signup guide →";
|
|
14
|
+
readonly baseUrl: "Base URL";
|
|
15
|
+
readonly apiKey: "API key";
|
|
16
|
+
readonly apiKeyPlaceholderMissing: "Paste the API key";
|
|
17
|
+
readonly apiKeyPlaceholderConfigured: "Saved; leave blank to keep it";
|
|
18
|
+
readonly apiKeyHint: "The key is stored in DSH Credentials and is never shown again after saving.";
|
|
19
|
+
readonly apiKeyLocked: "The current key comes from a read-only source and cannot be replaced here.";
|
|
20
|
+
readonly apiKeyBlank: "The API key cannot contain only spaces.";
|
|
21
|
+
readonly apiKeyInvalid: "Paste only the key, without a variable name, quotes, spaces, or line breaks.";
|
|
22
|
+
readonly credential: "Credential name";
|
|
23
|
+
readonly credentialHint: "The built-in free provider needs no user key. For a custom provider, this is the DSH credential reference used to store its key.";
|
|
24
|
+
readonly model: "Model";
|
|
25
|
+
readonly protocol: "API protocol";
|
|
26
|
+
readonly anthropicThinking: "Anthropic thinking";
|
|
27
|
+
readonly anthropicThinkingHint: "omit has the broadest compatibility. Use disabled or adaptive only when the selected model documents that mode; restore omit first after HTTP 400.";
|
|
28
|
+
readonly userAgent: "User-Agent";
|
|
29
|
+
readonly language: "Output language";
|
|
30
|
+
readonly limits: "Limits";
|
|
31
|
+
readonly timeout: "Request timeout (ms)";
|
|
32
|
+
readonly maxBytes: "Maximum image bytes";
|
|
33
|
+
readonly maxPixels: "Maximum image pixels";
|
|
34
|
+
readonly concurrency: "Concurrent calls per session";
|
|
35
|
+
readonly runtime: "Runtime";
|
|
36
|
+
readonly runtimeMode: "Runtime mode";
|
|
37
|
+
readonly toolkitPath: "Pinned checkout path";
|
|
38
|
+
readonly python: "Python override";
|
|
39
|
+
readonly allowedDirs: "Additional allowed directories";
|
|
40
|
+
readonly allowedDirsHint: "One path per line. The session workspace is always allowed.";
|
|
41
|
+
readonly save: "Save and apply";
|
|
42
|
+
readonly saving: "Validating runtime…";
|
|
43
|
+
readonly reload: "Reload";
|
|
44
|
+
readonly saved: "Settings validated and applied.";
|
|
45
|
+
readonly readOnly: "Service settings are read-only. A writable API key can still be saved.";
|
|
46
|
+
readonly configured: "Configured";
|
|
47
|
+
readonly missing: "Missing";
|
|
48
|
+
readonly source: "Source";
|
|
49
|
+
readonly sourceHint: "{source}: {value}";
|
|
50
|
+
readonly sourceEnv: "Environment variable";
|
|
51
|
+
readonly sourceFile: "Credential file";
|
|
52
|
+
readonly health: "Health";
|
|
53
|
+
readonly runHealth: "Run health check";
|
|
54
|
+
readonly testConnection: "Test API connection";
|
|
55
|
+
readonly testModel: "Test vision model";
|
|
56
|
+
readonly testing: "Checking…";
|
|
57
|
+
readonly testingModel: "Testing model…";
|
|
58
|
+
readonly connectionHint: "The API connection test only queries GET /models. The vision model test sends the bundled diagnostic image and verifies one real multimodal request.";
|
|
59
|
+
readonly saveBeforeTesting: "Save service changes before testing the connection.";
|
|
60
|
+
readonly advanced: "Advanced settings";
|
|
61
|
+
readonly advancedHint: "Credential name, provider compatibility, output language, resource limits, runtime source, Python, and additional readable directories.";
|
|
62
|
+
readonly imageInput: "Image input";
|
|
63
|
+
readonly hiddenVariants: "Transparent variant routing";
|
|
64
|
+
readonly hiddenVariantsLabel: "Keep the original model names and enable images automatically";
|
|
65
|
+
readonly hiddenVariantsHint: "Text-only models keep one model-selector entry with the original name while the session runs on the image-capable variant. Pasted images, image history, and the built-in read_image tool keep working; disable to restore the explicit (Vision Toolkit) entries.";
|
|
66
|
+
readonly pluginVersion: "Plugin";
|
|
67
|
+
readonly upstreamVersion: "Upstream";
|
|
68
|
+
readonly activeGeneration: "Runtime generation";
|
|
69
|
+
readonly activeGenerationValue: "Generation {generation}";
|
|
70
|
+
readonly updates: "Plugin updates";
|
|
71
|
+
readonly updatesHint: "Check npm for a newer release, install it into this DSH profile, and restart DSH Web automatically.";
|
|
72
|
+
readonly manualUpdate: "Manual update";
|
|
73
|
+
readonly manualUpdateHint: "Run this command in your terminal to install the latest release into this DSH profile.";
|
|
74
|
+
readonly copy: "Copy";
|
|
75
|
+
readonly copied: "Copied";
|
|
76
|
+
readonly checkUpdate: "Check for updates";
|
|
77
|
+
readonly checkingUpdate: "Checking for updates…";
|
|
78
|
+
readonly updateAvailable: "Update available";
|
|
79
|
+
readonly updateAvailableDetail: "Version {version} is available. It will restart DSH Web automatically when safe; otherwise you will be asked to restart it manually.";
|
|
80
|
+
readonly upToDate: "Up to date";
|
|
81
|
+
readonly upToDateDetail: "Version {version} is the latest release.";
|
|
82
|
+
readonly updateNow: "Install update";
|
|
83
|
+
readonly updatingPlugin: "Installing update…";
|
|
84
|
+
readonly updateConfirm: "Install Vision Toolkit {version} now? DSH Web will restart automatically when supported; otherwise a manual restart will be required.";
|
|
85
|
+
readonly restarting: "Version {version} was installed. Waiting for DSH Web to restart…";
|
|
86
|
+
readonly manualRestartRequired: "Version {version} was installed. Restart DSH Web through your usual command or process manager to activate it.";
|
|
87
|
+
readonly updateProfile: "Profile";
|
|
88
|
+
readonly updateInstalled: "Installed";
|
|
89
|
+
readonly updateLatest: "Latest";
|
|
90
|
+
readonly updateUnsupported: "In-app updates are unavailable for this installation.";
|
|
91
|
+
readonly updateReasonProfileNotFound: "The running plugin could not be matched to a DSH profile installation.";
|
|
92
|
+
readonly updateReasonNotDependency: "The plugin is not a direct dependency of this DSH profile.";
|
|
93
|
+
readonly updateReasonLocalSource: "This profile uses a local, workspace, URL, or git installation; update that source manually so local work is not overwritten.";
|
|
94
|
+
readonly updateReasonReadOnly: "The profile package manifest is read-only.";
|
|
95
|
+
readonly updateReasonPnpm: "pnpm is unavailable in the DSH execution environment.";
|
|
96
|
+
readonly updateReasonPlatform: "Automatic restart is unavailable on this operating system.";
|
|
97
|
+
readonly updateReasonRestartUnmanaged: "Detached self-restart is disabled. Use a supported process manager, or explicitly opt in with DSH_VISION_TOOLKIT_ALLOW_DETACHED_RESTART=1 for an unsupervised Web process.";
|
|
98
|
+
readonly updateReasonRestartAddress: "Automatic restart is unavailable when DSH Web uses an unknown or dynamically allocated port. Start it with a fixed --port value.";
|
|
99
|
+
readonly updateSaveFirst: "Save or discard the current Settings and API key changes before updating the plugin.";
|
|
100
|
+
readonly restartTimedOut: "DSH Web did not return with the target plugin version. Check the restart log and restart the Web profile through its original process manager.";
|
|
101
|
+
readonly restartRolledBack: "The new plugin did not become ready, so the previous version was restored. Check the restart log before trying again.";
|
|
102
|
+
readonly pluginKind: "DSH native plugin";
|
|
103
|
+
readonly runtimeUnavailable: "Runtime unavailable";
|
|
104
|
+
readonly runtimeCandidateRejected: "Last runtime candidate was rejected; the active generation remains available.";
|
|
105
|
+
readonly runtimeReady: "Ready";
|
|
106
|
+
readonly runtimeManaged: "Managed";
|
|
107
|
+
readonly runtimeExternal: "External checkout";
|
|
108
|
+
readonly retry: "Retry";
|
|
109
|
+
readonly open: "Open file";
|
|
110
|
+
readonly download: "Download";
|
|
111
|
+
readonly previewUnavailable: "HTTP preview is unavailable in this host; use Open file.";
|
|
112
|
+
readonly running: "Running…";
|
|
113
|
+
readonly failed: "Failed";
|
|
114
|
+
readonly matches: "matches";
|
|
115
|
+
readonly elements: "elements";
|
|
116
|
+
readonly dimensions: "Dimensions";
|
|
117
|
+
readonly coordinates: "Coordinates";
|
|
118
|
+
readonly artifact: "Artifact";
|
|
119
|
+
readonly artifacts: "Artifacts";
|
|
120
|
+
readonly difference: "Overall difference";
|
|
121
|
+
readonly worstRegions: "Worst regions";
|
|
122
|
+
readonly colors: "Dominant colors";
|
|
123
|
+
readonly noResult: "Structured result unavailable; inspect the raw Tool result.";
|
|
124
|
+
readonly healthy: "Healthy";
|
|
125
|
+
readonly degraded: "Needs attention";
|
|
126
|
+
readonly notTested: "Not tested";
|
|
127
|
+
readonly groundTitle: "Ground";
|
|
128
|
+
readonly detectTitle: "Detect";
|
|
129
|
+
readonly traceTitle: "Trace SVG";
|
|
130
|
+
readonly pixelDiffTitle: "Pixel Diff";
|
|
131
|
+
readonly cropTitle: "Crop";
|
|
132
|
+
readonly longOcrTitle: "Long OCR";
|
|
133
|
+
readonly extractForegroundTitle: "Extract Foreground";
|
|
134
|
+
readonly htmlScreenshotTitle: "HTML Screenshot";
|
|
135
|
+
readonly artifactTitle: "Vision Artifact";
|
|
136
|
+
readonly dominantColorsTitle: "Dominant Colors";
|
|
137
|
+
readonly artifactGroundPreview: "Grounding bounding-box preview";
|
|
138
|
+
readonly artifactDetectPreview: "Detected-element bounding-box preview";
|
|
139
|
+
readonly artifactCrop: "Cropped image region";
|
|
140
|
+
readonly artifactTrace: "Traced vector geometry";
|
|
141
|
+
readonly artifactDiffHeatmap: "Pixel-difference heatmap";
|
|
142
|
+
readonly artifactDiffReport: "Structured pixel-difference report";
|
|
143
|
+
readonly artifactLongManifest: "Long-screenshot split and merge manifest";
|
|
144
|
+
readonly artifactLongTranscript: "Merged long-screenshot OCR transcript";
|
|
145
|
+
readonly artifactLongAudit: "Long-screenshot OCR boundary audit";
|
|
146
|
+
readonly artifactLongChunk: "Long-screenshot OCR chunk {index}";
|
|
147
|
+
readonly artifactOcrSidecar: "OCR sidecar for chunk {index}";
|
|
148
|
+
readonly artifactForeground: "Extracted transparent foreground";
|
|
149
|
+
readonly artifactHtmlScreenshot: "Headless browser screenshot of local HTML";
|
|
150
|
+
readonly label: "Label";
|
|
151
|
+
readonly paths: "paths";
|
|
152
|
+
readonly healthPython: "Python";
|
|
153
|
+
readonly healthDependencies: "Dependencies";
|
|
154
|
+
readonly healthChrome: "Browser";
|
|
155
|
+
readonly healthCredential: "Credential";
|
|
156
|
+
readonly healthArtifactDirectory: "Artifact directory";
|
|
157
|
+
readonly healthTempDirectory: "Temporary directory";
|
|
158
|
+
readonly healthService: "Vision service";
|
|
159
|
+
readonly healthModel: "Vision model";
|
|
160
|
+
readonly statusOk: "OK";
|
|
161
|
+
readonly statusWarning: "Warning";
|
|
162
|
+
readonly statusError: "Error";
|
|
163
|
+
readonly statusNotTested: "Not tested";
|
|
164
|
+
readonly positiveInteger: "{field} must be a positive integer.";
|
|
165
|
+
readonly healthPythonDetail: "{version} via {path}";
|
|
166
|
+
readonly healthChromeMissing: "Chrome, Chromium, or Edge was not found; HTML Screenshot is unavailable.";
|
|
167
|
+
readonly healthChromeProbeFailed: "Could not check whether a supported browser is available.";
|
|
168
|
+
readonly healthCredentialMissing: "Credential {credential} is not configured.";
|
|
169
|
+
readonly healthCredentialReady: "Credential {credential} is available.";
|
|
170
|
+
readonly healthCredentialFailed: "Could not read credential {credential}.";
|
|
171
|
+
readonly healthDirectoryWritable: "{directory} is writable: {path}";
|
|
172
|
+
readonly healthDirectoryNotWritable: "{directory} is not writable: {path}";
|
|
173
|
+
readonly healthArtifactDirectoryFailed: "Could not prepare the artifact directory.";
|
|
174
|
+
readonly healthConnectionNotTested: "API connection not tested. Use Test API connection to query /models.";
|
|
175
|
+
readonly healthConnectionCredentialMissing: "Connection test skipped because the credential is unavailable.";
|
|
176
|
+
readonly healthServiceResponded: "Service responded at {endpoint} (HTTP {status}).";
|
|
177
|
+
readonly healthServiceRejectedCredential: "Service rejected the configured credential (HTTP {status}).";
|
|
178
|
+
readonly healthServiceForbidden: "Service is reachable, but GET /models is restricted (HTTP {status}). This is often an account or model-list permission limit, not an invalid key; you can ignore this warning when the vision-model test reports success.";
|
|
179
|
+
readonly healthServiceNoModels: "Service is reachable but does not support GET /models (HTTP {status}).";
|
|
180
|
+
readonly healthServiceRateLimited: "Service is reachable, but the connection test was rate-limited (HTTP 429).";
|
|
181
|
+
readonly healthServiceHttpFailed: "Connection test failed with HTTP {status}.";
|
|
182
|
+
readonly healthServiceUnreachable: "Could not reach {endpoint}.";
|
|
183
|
+
readonly healthModelNotTested: "Vision model not tested. Run Test vision model to make one real multimodal request.";
|
|
184
|
+
readonly healthModelCredentialMissing: "Vision model test skipped because the credential is unavailable.";
|
|
185
|
+
readonly healthModelReady: "Model {model} completed a real multimodal request.";
|
|
186
|
+
readonly healthModelFailed: "Real multimodal request failed: {detail}";
|
|
187
|
+
readonly modelTestVerifiedTag: "Verified";
|
|
188
|
+
readonly modelTestNotRunTag: "Not tested";
|
|
189
|
+
readonly modelTestFailedTag: "Test failed";
|
|
190
|
+
};
|
|
191
|
+
type LocaleKey = keyof typeof en;
|
|
192
|
+
interface ToolCallOwnerProps {
|
|
193
|
+
callId: string;
|
|
194
|
+
toolName: string;
|
|
195
|
+
block: ToolCallBlock;
|
|
196
|
+
cwd?: string | undefined;
|
|
197
|
+
openFile: (path: string) => void;
|
|
198
|
+
inspect?: (() => void) | undefined;
|
|
199
|
+
}
|
|
200
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
201
|
+
interface SlotMap {
|
|
202
|
+
/** Keyed atomic Tool call view, dispatched by wire Tool name. */
|
|
203
|
+
'tool.call.toolview': {
|
|
204
|
+
kind: 'keyed';
|
|
205
|
+
scope: 'session';
|
|
206
|
+
owner: ToolCallOwnerProps;
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
interface LocaleNamespaceMap {
|
|
210
|
+
/** DSH Vision Toolkit Tool cards and Settings copy. */
|
|
211
|
+
'vision-toolkit': LocaleKey;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
interface HealthCheck {
|
|
215
|
+
status: 'ok' | 'warning' | 'error' | 'not_tested';
|
|
216
|
+
detail: string;
|
|
217
|
+
}
|
|
218
|
+
interface HealthResult {
|
|
219
|
+
pluginVersion: string;
|
|
220
|
+
checks: Record<string, HealthCheck>;
|
|
221
|
+
healthy: boolean;
|
|
222
|
+
connectionTested: boolean;
|
|
223
|
+
modelTested: boolean;
|
|
224
|
+
}
|
|
225
|
+
interface SettingsValue {
|
|
226
|
+
provider?: {
|
|
227
|
+
baseUrl?: string;
|
|
228
|
+
credential?: string;
|
|
229
|
+
model?: string;
|
|
230
|
+
protocol?: 'openai' | 'anthropic';
|
|
231
|
+
anthropicThinking?: 'omit' | 'disabled' | 'adaptive';
|
|
232
|
+
userAgent?: string;
|
|
233
|
+
};
|
|
234
|
+
language?: 'zh' | 'en';
|
|
235
|
+
timeoutMs?: number;
|
|
236
|
+
maxImageBytes?: number;
|
|
237
|
+
maxImagePixels?: number;
|
|
238
|
+
concurrency?: number;
|
|
239
|
+
runtime?: {
|
|
240
|
+
mode?: 'managed' | 'external';
|
|
241
|
+
agentVisionToolkitPath?: string;
|
|
242
|
+
python?: string;
|
|
243
|
+
};
|
|
244
|
+
allowedDirs?: string[];
|
|
245
|
+
imageInputVariants?: {
|
|
246
|
+
enabled?: boolean;
|
|
247
|
+
providers?: string[];
|
|
248
|
+
autoSwitch?: boolean;
|
|
249
|
+
hidden?: boolean;
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
type PluginUpdateUnavailableReason = 'profile-not-found' | 'not-direct-dependency' | 'unsupported-install-source' | 'profile-read-only' | 'pnpm-unavailable' | 'unsupported-platform' | 'restart-unmanaged' | 'restart-address-unavailable';
|
|
253
|
+
interface PluginUpdateCapability {
|
|
254
|
+
supported: boolean;
|
|
255
|
+
checkSupported?: boolean;
|
|
256
|
+
profile?: string;
|
|
257
|
+
dependencySpec?: string;
|
|
258
|
+
reason?: PluginUpdateUnavailableReason;
|
|
259
|
+
}
|
|
260
|
+
interface PluginUpdateCheck extends PluginUpdateCapability {
|
|
261
|
+
currentVersion: string;
|
|
262
|
+
latestVersion?: string;
|
|
263
|
+
updateAvailable: boolean;
|
|
264
|
+
checkedAt: string;
|
|
265
|
+
}
|
|
266
|
+
type PluginUpdateResult = {
|
|
267
|
+
fromVersion: string;
|
|
268
|
+
toVersion: string;
|
|
269
|
+
profile: string;
|
|
270
|
+
restarting: true;
|
|
271
|
+
retryAfterMs: number;
|
|
272
|
+
manualRestartRequired?: false;
|
|
273
|
+
} | {
|
|
274
|
+
fromVersion: string;
|
|
275
|
+
toVersion: string;
|
|
276
|
+
profile: string;
|
|
277
|
+
restarting: false;
|
|
278
|
+
manualRestartRequired: true;
|
|
279
|
+
retryAfterMs?: undefined;
|
|
280
|
+
};
|
|
281
|
+
interface SettingsSnapshot {
|
|
282
|
+
schemaVersion: 1;
|
|
283
|
+
writable: boolean;
|
|
284
|
+
settings: {
|
|
285
|
+
value: SettingsValue;
|
|
286
|
+
revision: number;
|
|
287
|
+
applies: 'live';
|
|
288
|
+
};
|
|
289
|
+
credential: {
|
|
290
|
+
ref: string;
|
|
291
|
+
configured: boolean;
|
|
292
|
+
source?: string;
|
|
293
|
+
writable: boolean;
|
|
294
|
+
};
|
|
295
|
+
runtime: {
|
|
296
|
+
ready: boolean;
|
|
297
|
+
generation: number;
|
|
298
|
+
activeConfig?: SettingsValue;
|
|
299
|
+
upstream?: {
|
|
300
|
+
source: 'managed' | 'external';
|
|
301
|
+
path: string;
|
|
302
|
+
runtimeHome: string;
|
|
303
|
+
python: string;
|
|
304
|
+
pythonVersion: string;
|
|
305
|
+
};
|
|
306
|
+
lastError?: string;
|
|
307
|
+
};
|
|
308
|
+
release: {
|
|
309
|
+
pluginVersion: string;
|
|
310
|
+
upstreamRepository: string;
|
|
311
|
+
upstreamVersion: string;
|
|
312
|
+
upstreamCommit: string;
|
|
313
|
+
update: PluginUpdateCapability;
|
|
314
|
+
};
|
|
315
|
+
artifactRouteAvailable: boolean;
|
|
316
|
+
}
|
|
317
|
+
/** Decode canonical presentation metadata with a JSON-text fallback. */
|
|
318
|
+
export declare function decodeVisionResult(block: ToolCallBlock): Record<string, unknown> | undefined;
|
|
319
|
+
interface SettingsState {
|
|
320
|
+
status: 'idle' | 'loading' | 'ready' | 'error';
|
|
321
|
+
snapshot?: SettingsSnapshot | undefined;
|
|
322
|
+
health?: HealthResult | undefined;
|
|
323
|
+
update?: PluginUpdateCheck | undefined;
|
|
324
|
+
restart?: PluginUpdateResult | undefined;
|
|
325
|
+
action?: 'save' | 'health' | 'connection' | 'model' | 'check-update' | 'apply-update' | undefined;
|
|
326
|
+
message?: string | undefined;
|
|
327
|
+
error?: string | undefined;
|
|
328
|
+
}
|
|
329
|
+
/** Small external store shared by the Settings route and pushed invalidations. */
|
|
330
|
+
export declare class VisionSettingsController {
|
|
331
|
+
private state;
|
|
332
|
+
private listeners;
|
|
333
|
+
private generation;
|
|
334
|
+
subscribe: (listener: () => void) => (() => void);
|
|
335
|
+
snapshot: () => SettingsState;
|
|
336
|
+
private set;
|
|
337
|
+
load(): Promise<void>;
|
|
338
|
+
refreshIfLoaded(): void;
|
|
339
|
+
save(value: SettingsValue, expectedRevision: number, credentialValue: string | undefined, writeSettings: boolean): Promise<boolean>;
|
|
340
|
+
runHealth(mode: 'health' | 'connection' | 'model'): Promise<void>;
|
|
341
|
+
checkUpdate(): Promise<void>;
|
|
342
|
+
applyUpdate(expectedVersion: string): Promise<void>;
|
|
343
|
+
reportRestartTimeout(message: string): void;
|
|
344
|
+
}
|
|
345
|
+
/** Required client services. The pasted-image codec attaches to either trigger-service generation after load. */
|
|
346
|
+
export declare const inject: string[];
|
|
347
|
+
/** Register dedicated Tool views and the Vision Settings section. */
|
|
348
|
+
export declare function apply(ctx: ClientContext): void;
|
|
349
|
+
export {};
|
|
350
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAwB1F,QAAA,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwLE,CAAA;AAEV,KAAK,SAAS,GAAG,MAAM,OAAO,EAAE,CAAA;AA8LhC,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE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AoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAG5C;AAubD,iHAAiH;AACjH,eAAO,MAAM,MAAM,UAA4D,CAAA;AAE/E,qEAAqE;AACrE,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAkE9C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transparent routing for the host model selector: when `imageInputVariants.hidden`
|
|
3
|
+
* is enabled, variant routes keep the upstream provider/model display names and
|
|
4
|
+
* the browser hides the upstream text-only entries that have a variant twin.
|
|
5
|
+
* Users then see one entry per model — the original name — while the session
|
|
6
|
+
* actually runs on the image-capable variant, so pasted images, history with
|
|
7
|
+
* images, and the built-in `read_image` tool all keep working on text-only
|
|
8
|
+
* models without exposing `(Vision Toolkit)` routes.
|
|
9
|
+
*
|
|
10
|
+
* The host selector renders one `[role=group]` per provider whose group title
|
|
11
|
+
* id is `:<react-radix>:-<providerId>`, and one `[role=menuitemradio]` per
|
|
12
|
+
* model. We key groups by that provider id (variant routes carry the
|
|
13
|
+
* `vision-toolkit-` prefix) and hide every upstream entry whose display name
|
|
14
|
+
* matches a variant twin, collapsing fully-hidden upstream groups.
|
|
15
|
+
*
|
|
16
|
+
* The hiding decision is purely DOM-local: transparent mode is exactly the
|
|
17
|
+
* case where a variant twin keeps the upstream display name, while explicit
|
|
18
|
+
* mode appends `(Vision Toolkit)` and therefore never matches. No display-config
|
|
19
|
+
* round-trip is needed before the selector can be tidied, so the first paint
|
|
20
|
+
* of an opened menu already shows the merged list instead of flashing the
|
|
21
|
+
* duplicate upstream group.
|
|
22
|
+
* @module dsh-vision-toolkit/model-variants-hider
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Hide upstream text-only entries that have a variant twin. Group keys come
|
|
26
|
+
* from `aria-labelledby` ids so provider identity is reliable even when the
|
|
27
|
+
* variant provider name equals the upstream name (transparent mode).
|
|
28
|
+
*/
|
|
29
|
+
export declare function tidyModelSelector(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Install the transparent-routing integrator. It watches the document for
|
|
32
|
+
* model-selector renderings and re-tidies them whenever the host re-renders.
|
|
33
|
+
* Tidy runs in a microtask (before the browser paints) and is coalesced across
|
|
34
|
+
* the render batch, so opening the selector never shows the upstream twins.
|
|
35
|
+
* @returns the disposer that stops observation and restores hidden entries.
|
|
36
|
+
*/
|
|
37
|
+
export declare function installModelVariantsHider(): () => void;
|
|
38
|
+
/** Test seam: expose whether the integrator is currently installed. */
|
|
39
|
+
export declare function isModelVariantsHiderActive(): boolean;
|
|
40
|
+
//# sourceMappingURL=model-variants-hider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-variants-hider.d.ts","sourceRoot":"","sources":["../../../src/client/model-variants-hider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAuCH;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CA+CxC;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,IAAI,CA+BtD;AAED,uEAAuE;AACvE,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD"}
|