@anionex/dsh-vision-toolkit 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +383 -0
  4. package/README.zh.md +383 -0
  5. package/assets/dsh-conversation-artifact.png +0 -0
  6. package/assets/dsh-conversation-image-qa-top.png +0 -0
  7. package/assets/dsh-conversation-image-qa.png +0 -0
  8. package/assets/dsh-conversation-pixel-diff.png +0 -0
  9. package/assets/dsh-conversation-screenshot-debugging-top.png +0 -0
  10. package/assets/dsh-conversation-screenshot-debugging.png +0 -0
  11. package/assets/dsh-conversation-tool-call.png +0 -0
  12. package/assets/dsh-conversation-vision-trace.png +0 -0
  13. package/assets/hero.png +0 -0
  14. package/assets/social-preview.png +0 -0
  15. package/assets/upstream/README.md +16 -0
  16. package/assets/upstream/image-qa.webp +0 -0
  17. package/assets/upstream/infographic-reference.webp +0 -0
  18. package/assets/upstream/infographic-result.webp +0 -0
  19. package/assets/upstream/screenshot-debugging.webp +0 -0
  20. package/assets/upstream/ui-result.webp +0 -0
  21. package/assets/upstream/ui-sketch.webp +0 -0
  22. package/assets/vision-settings.png +0 -0
  23. package/cordis.patch.yml +6 -0
  24. package/docs/assets/vision-settings.png +0 -0
  25. package/docs/requirements-traceability/README.i18n.yaml +6 -0
  26. package/docs/requirements-traceability/README.md +75 -0
  27. package/docs/requirements-traceability/README.zh.md +75 -0
  28. package/examples/ui-restoration/README.i18n.yaml +6 -0
  29. package/examples/ui-restoration/README.md +70 -0
  30. package/examples/ui-restoration/README.zh.md +70 -0
  31. package/examples/ui-restoration/assets/final-heatmap.png +0 -0
  32. package/examples/ui-restoration/assets/final-report.json +83 -0
  33. package/examples/ui-restoration/assets/implementation.png +0 -0
  34. package/examples/ui-restoration/assets/initial-heatmap.png +0 -0
  35. package/examples/ui-restoration/assets/initial-report.json +83 -0
  36. package/examples/ui-restoration/assets/initial.png +0 -0
  37. package/examples/ui-restoration/assets/metrics.json +12 -0
  38. package/examples/ui-restoration/assets/reference.png +0 -0
  39. package/examples/ui-restoration/implementation.html +94 -0
  40. package/examples/ui-restoration/initial.html +57 -0
  41. package/lib/artifact-access.js +369 -0
  42. package/lib/artifact-access.js.map +1 -0
  43. package/lib/artifacts.js +56 -0
  44. package/lib/artifacts.js.map +1 -0
  45. package/lib/client.js +952 -0
  46. package/lib/client.js.map +1 -0
  47. package/lib/config.js +117 -0
  48. package/lib/config.js.map +1 -0
  49. package/lib/errors.js +56 -0
  50. package/lib/errors.js.map +1 -0
  51. package/lib/exposure.js +213 -0
  52. package/lib/exposure.js.map +1 -0
  53. package/lib/index.js +97 -0
  54. package/lib/index.js.map +1 -0
  55. package/lib/paste-images.js +199 -0
  56. package/lib/paste-images.js.map +1 -0
  57. package/lib/paths.js +325 -0
  58. package/lib/paths.js.map +1 -0
  59. package/lib/runtime-install.js +601 -0
  60. package/lib/runtime-install.js.map +1 -0
  61. package/lib/runtime-manager.js +126 -0
  62. package/lib/runtime-manager.js.map +1 -0
  63. package/lib/runtime.js +1344 -0
  64. package/lib/runtime.js.map +1 -0
  65. package/lib/skill.js +139 -0
  66. package/lib/skill.js.map +1 -0
  67. package/lib/tools.js +528 -0
  68. package/lib/tools.js.map +1 -0
  69. package/lib/types/artifact-access.d.ts +61 -0
  70. package/lib/types/artifact-access.d.ts.map +1 -0
  71. package/lib/types/artifacts.d.ts +42 -0
  72. package/lib/types/artifacts.d.ts.map +1 -0
  73. package/lib/types/client/index.d.ts +179 -0
  74. package/lib/types/client/index.d.ts.map +1 -0
  75. package/lib/types/client/paste-images.d.ts +57 -0
  76. package/lib/types/client/paste-images.d.ts.map +1 -0
  77. package/lib/types/config.d.ts +73 -0
  78. package/lib/types/config.d.ts.map +1 -0
  79. package/lib/types/errors.d.ts +35 -0
  80. package/lib/types/errors.d.ts.map +1 -0
  81. package/lib/types/exposure.d.ts +40 -0
  82. package/lib/types/exposure.d.ts.map +1 -0
  83. package/lib/types/index.d.ts +18 -0
  84. package/lib/types/index.d.ts.map +1 -0
  85. package/lib/types/paste-images.d.ts +21 -0
  86. package/lib/types/paste-images.d.ts.map +1 -0
  87. package/lib/types/paths.d.ts +107 -0
  88. package/lib/types/paths.d.ts.map +1 -0
  89. package/lib/types/runtime-install.d.ts +49 -0
  90. package/lib/types/runtime-install.d.ts.map +1 -0
  91. package/lib/types/runtime-manager.d.ts +60 -0
  92. package/lib/types/runtime-manager.d.ts.map +1 -0
  93. package/lib/types/runtime.d.ts +389 -0
  94. package/lib/types/runtime.d.ts.map +1 -0
  95. package/lib/types/skill.d.ts +15 -0
  96. package/lib/types/skill.d.ts.map +1 -0
  97. package/lib/types/tools.d.ts +22 -0
  98. package/lib/types/tools.d.ts.map +1 -0
  99. package/lib/types/upstream.d.ts +207 -0
  100. package/lib/types/upstream.d.ts.map +1 -0
  101. package/lib/types/version.d.ts +15 -0
  102. package/lib/types/version.d.ts.map +1 -0
  103. package/lib/types/web-request.d.ts +4 -0
  104. package/lib/types/web-request.d.ts.map +1 -0
  105. package/lib/types/web.d.ts +74 -0
  106. package/lib/types/web.d.ts.map +1 -0
  107. package/lib/upstream.js +675 -0
  108. package/lib/upstream.js.map +1 -0
  109. package/lib/version.js +18 -0
  110. package/lib/version.js.map +1 -0
  111. package/lib/web-request.js +20 -0
  112. package/lib/web-request.js.map +1 -0
  113. package/lib/web.js +244 -0
  114. package/lib/web.js.map +1 -0
  115. package/package.json +139 -0
  116. package/runtime/requirements.lock +3 -0
  117. package/src/artifact-access.ts +386 -0
  118. package/src/artifacts.ts +85 -0
  119. package/src/client/index.tsx +866 -0
  120. package/src/client/paste-images.tsx +426 -0
  121. package/src/config.ts +177 -0
  122. package/src/errors.ts +62 -0
  123. package/src/exposure.ts +227 -0
  124. package/src/index.ts +122 -0
  125. package/src/paste-images.ts +234 -0
  126. package/src/paths.ts +348 -0
  127. package/src/runtime-install.ts +723 -0
  128. package/src/runtime-manager.ts +166 -0
  129. package/src/runtime.ts +1783 -0
  130. package/src/skill.ts +143 -0
  131. package/src/tools.ts +668 -0
  132. package/src/upstream.ts +861 -0
  133. package/src/version.ts +37 -0
  134. package/src/web-request.ts +17 -0
  135. package/src/web.ts +329 -0
  136. package/vendor/agent-vision-toolkit/CHANGELOG.md +16 -0
  137. package/vendor/agent-vision-toolkit/LICENSE +21 -0
  138. package/vendor/agent-vision-toolkit/README.md +399 -0
  139. package/vendor/agent-vision-toolkit/UPSTREAM_MANIFEST.json +89 -0
  140. package/vendor/agent-vision-toolkit/bin/crop +90 -0
  141. package/vendor/agent-vision-toolkit/bin/detect +13 -0
  142. package/vendor/agent-vision-toolkit/bin/glance +93 -0
  143. package/vendor/agent-vision-toolkit/bin/ground +13 -0
  144. package/vendor/agent-vision-toolkit/bin/trace +129 -0
  145. package/vendor/agent-vision-toolkit/detect.py +56 -0
  146. package/vendor/agent-vision-toolkit/ground.py +216 -0
  147. package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/dominant_colors.py +224 -0
  148. package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/extract_fg.py +278 -0
  149. package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/html_shot.py +108 -0
  150. package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/long_screenshot_ocr.py +1245 -0
  151. package/vendor/agent-vision-toolkit/skills/vision-tools/scripts/pixel_diff.py +88 -0
  152. package/vendor/agent-vision-toolkit/vision_client.py +156 -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
@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AwE;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,179 @@
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 baseUrl: "Base URL";
13
+ readonly credential: "Credential reference";
14
+ readonly model: "Model";
15
+ readonly language: "Output language";
16
+ readonly limits: "Limits";
17
+ readonly timeout: "Request timeout (ms)";
18
+ readonly maxBytes: "Maximum image bytes";
19
+ readonly maxPixels: "Maximum image pixels";
20
+ readonly concurrency: "Concurrent calls per session";
21
+ readonly runtime: "Runtime";
22
+ readonly runtimeMode: "Runtime mode";
23
+ readonly toolkitPath: "Pinned checkout path";
24
+ readonly python: "Python override";
25
+ readonly allowedDirs: "Additional allowed directories";
26
+ readonly allowedDirsHint: "One path per line. The session workspace is always allowed.";
27
+ readonly save: "Save and apply";
28
+ readonly saving: "Validating runtime…";
29
+ readonly reload: "Reload";
30
+ readonly saved: "Settings validated and applied.";
31
+ readonly readOnly: "The active Settings provider is read-only.";
32
+ readonly configured: "Configured";
33
+ readonly missing: "Missing";
34
+ readonly source: "Source";
35
+ readonly health: "Health";
36
+ readonly runHealth: "Run health check";
37
+ readonly testConnection: "Test connection";
38
+ readonly testing: "Checking…";
39
+ readonly connectionHint: "Connection testing explicitly sends the configured credential to GET /models. It uploads no image and creates no completion.";
40
+ readonly pluginVersion: "Plugin";
41
+ readonly upstreamVersion: "Upstream";
42
+ readonly activeGeneration: "Runtime generation";
43
+ readonly runtimeUnavailable: "Runtime unavailable";
44
+ readonly runtimeCandidateRejected: "Last runtime candidate was rejected; the active generation remains available.";
45
+ readonly retry: "Retry";
46
+ readonly open: "Open file";
47
+ readonly download: "Download";
48
+ readonly previewUnavailable: "HTTP preview is unavailable in this host; use Open file.";
49
+ readonly running: "Running…";
50
+ readonly failed: "Failed";
51
+ readonly matches: "matches";
52
+ readonly elements: "elements";
53
+ readonly dimensions: "Dimensions";
54
+ readonly coordinates: "Coordinates";
55
+ readonly artifact: "Artifact";
56
+ readonly artifacts: "Artifacts";
57
+ readonly difference: "Overall difference";
58
+ readonly worstRegions: "Worst regions";
59
+ readonly colors: "Dominant colors";
60
+ readonly noResult: "Structured result unavailable; inspect the raw Tool result.";
61
+ readonly healthy: "Healthy";
62
+ readonly degraded: "Needs attention";
63
+ readonly notTested: "Not tested";
64
+ };
65
+ type LocaleKey = keyof typeof en;
66
+ interface ToolCallOwnerProps {
67
+ callId: string;
68
+ toolName: string;
69
+ block: ToolCallBlock;
70
+ cwd?: string | undefined;
71
+ openFile: (path: string) => void;
72
+ inspect?: (() => void) | undefined;
73
+ }
74
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
75
+ interface SlotMap {
76
+ /** Keyed atomic Tool call view, dispatched by wire Tool name. */
77
+ 'tool.call.toolview': {
78
+ kind: 'keyed';
79
+ scope: 'session';
80
+ owner: ToolCallOwnerProps;
81
+ };
82
+ }
83
+ interface LocaleNamespaceMap {
84
+ /** DSH Vision Toolkit Tool cards and Settings copy. */
85
+ 'vision-toolkit': LocaleKey;
86
+ }
87
+ }
88
+ interface HealthCheck {
89
+ status: 'ok' | 'warning' | 'error' | 'not_tested';
90
+ detail: string;
91
+ }
92
+ interface HealthResult {
93
+ pluginVersion: string;
94
+ checks: Record<string, HealthCheck>;
95
+ healthy: boolean;
96
+ connectionTested: boolean;
97
+ }
98
+ interface SettingsValue {
99
+ provider?: {
100
+ baseUrl?: string;
101
+ credential?: string;
102
+ model?: string;
103
+ };
104
+ language?: 'zh' | 'en';
105
+ timeoutMs?: number;
106
+ maxImageBytes?: number;
107
+ maxImagePixels?: number;
108
+ concurrency?: number;
109
+ runtime?: {
110
+ mode?: 'managed' | 'external';
111
+ agentVisionToolkitPath?: string;
112
+ python?: string;
113
+ };
114
+ allowedDirs?: string[];
115
+ }
116
+ interface SettingsSnapshot {
117
+ schemaVersion: 1;
118
+ writable: boolean;
119
+ settings: {
120
+ value: SettingsValue;
121
+ revision: number;
122
+ applies: 'live';
123
+ };
124
+ credential: {
125
+ ref: string;
126
+ configured: boolean;
127
+ source?: string;
128
+ writable: boolean;
129
+ };
130
+ runtime: {
131
+ ready: boolean;
132
+ generation: number;
133
+ activeConfig?: SettingsValue;
134
+ upstream?: {
135
+ source: 'managed' | 'external';
136
+ path: string;
137
+ runtimeHome: string;
138
+ python: string;
139
+ pythonVersion: string;
140
+ };
141
+ lastError?: string;
142
+ };
143
+ release: {
144
+ pluginVersion: string;
145
+ upstreamRepository: string;
146
+ upstreamVersion: string;
147
+ upstreamCommit: string;
148
+ };
149
+ artifactRouteAvailable: boolean;
150
+ }
151
+ /** Decode canonical presentation metadata with a JSON-text fallback. */
152
+ export declare function decodeVisionResult(block: ToolCallBlock): Record<string, unknown> | undefined;
153
+ interface SettingsState {
154
+ status: 'idle' | 'loading' | 'ready' | 'error';
155
+ snapshot?: SettingsSnapshot | undefined;
156
+ health?: HealthResult | undefined;
157
+ action?: 'save' | 'health' | 'connection' | undefined;
158
+ message?: string | undefined;
159
+ error?: string | undefined;
160
+ }
161
+ /** Small external store shared by the Settings route and pushed invalidations. */
162
+ export declare class VisionSettingsController {
163
+ private state;
164
+ private listeners;
165
+ private generation;
166
+ subscribe: (listener: () => void) => (() => void);
167
+ snapshot: () => SettingsState;
168
+ private set;
169
+ load(): Promise<void>;
170
+ refreshIfLoaded(): void;
171
+ save(value: SettingsValue, expectedRevision: number): Promise<void>;
172
+ runHealth(testConnection: boolean): Promise<void>;
173
+ }
174
+ /** Required client services. The pasted-image codec attaches to either trigger-service generation after load. */
175
+ export declare const inject: string[];
176
+ /** Register dedicated Tool views and the Vision Settings section. */
177
+ export declare function apply(ctx: ClientContext): void;
178
+ export {};
179
+ //# 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,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
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
+ interface PasteRecord {
8
+ ref: string;
9
+ file: File;
10
+ batch: PasteBatch;
11
+ status: 'ready' | 'copying' | 'copied' | 'error';
12
+ error?: string | undefined;
13
+ absolutePath?: string | undefined;
14
+ }
15
+ interface PasteBatch {
16
+ sessionId: string;
17
+ records: PasteRecord[];
18
+ inflight?: Promise<void> | undefined;
19
+ unsubscribe?: (() => void) | undefined;
20
+ }
21
+ interface PasteOccurrence {
22
+ occurrenceId: number;
23
+ source: string;
24
+ ref: string;
25
+ offset: number;
26
+ label: string;
27
+ }
28
+ type PasteDockProps = PropsRuntime<'conversation.input.dock'> & {
29
+ controller: PasteImageController;
30
+ remove: (occurrence: PasteOccurrence) => void;
31
+ };
32
+ /** Owns browser File objects until DSH serializes the corresponding text references. */
33
+ export declare class PasteImageController {
34
+ private readonly ctx;
35
+ private readonly records;
36
+ private readonly listeners;
37
+ private revision;
38
+ constructor(ctx: ClientContext);
39
+ subscribe: (listener: () => void) => (() => void);
40
+ snapshot: () => number;
41
+ private changed;
42
+ source(): InputTriggerSource;
43
+ recordsFor(occurrences: readonly PasteOccurrence[]): PasteRecord[];
44
+ private inputFor;
45
+ private insertText;
46
+ private insertRecords;
47
+ handlePaste(event: ClipboardEvent): boolean;
48
+ remove(sessionId: string, occurrence: PasteOccurrence): void;
49
+ private upload;
50
+ private serialize;
51
+ }
52
+ /** Minimal per-image progress, failure, and removal feedback above the composer. */
53
+ export declare function PasteImageDock(props: PasteDockProps): ReactNode;
54
+ /** Install capture interception, the text-reference codec, and composer feedback. */
55
+ export declare function installPasteImages(ctx: ClientContext): void;
56
+ export {};
57
+ //# sourceMappingURL=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kFD,wFAAwF;AACxF,qBAAa,oBAAoB;IAKnB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAJhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IACzD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAwB;IAClD,OAAO,CAAC,QAAQ,CAAI;gBAES,GAAG,EAAE,aAAa;IAE/C,SAAS,GAAI,UAAU,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAG/C;IAED,QAAQ,QAAO,MAAM,CAAiB;IAEtC,OAAO,CAAC,OAAO;IAKf,MAAM,IAAI,kBAAkB;IAc5B,UAAU,CAAC,WAAW,EAAE,SAAS,eAAe,EAAE,GAAG,WAAW,EAAE;IAOlE,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,aAAa;IAqDrB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO;IAiC3C,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI;YAuB9C,MAAM;YAsDN,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,CAyC3D"}
@@ -0,0 +1,73 @@
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
+ /** Settings document namespace owned by this plugin. */
11
+ export declare const VISION_TOOLKIT_SETTINGS_NAMESPACE: import("@deepseek-ai/dsh-settings").SettingsNamespace;
12
+ /** Full user-facing configuration; every field defaults at the schema boundary. */
13
+ export interface VisionToolkitConfig {
14
+ provider?: {
15
+ /** OpenAI-compatible chat/completions base URL. */
16
+ baseUrl?: string;
17
+ /** DSH Credential reference holding the API key (an environment-style name). */
18
+ credential?: string;
19
+ /** Multimodal model name. */
20
+ model?: string;
21
+ };
22
+ /** Vision output language (`zh` or `en`). */
23
+ language?: 'zh' | 'en';
24
+ /** Single remote/upstream call budget in milliseconds. */
25
+ timeoutMs?: number;
26
+ /** Maximum accepted input image size in bytes. */
27
+ maxImageBytes?: number;
28
+ /** Maximum decoded pixel count per input image. */
29
+ maxImagePixels?: number;
30
+ /** In-flight tool execution cap per session. */
31
+ concurrency?: number;
32
+ runtime?: {
33
+ /** `managed` uses the packaged snapshot and isolated venv; `external` uses a clean pinned checkout. */
34
+ mode?: 'managed' | 'external';
35
+ /** Required path to the clean pinned checkout when `mode` is `external`. */
36
+ agentVisionToolkitPath?: string;
37
+ /** Optional Python 3.11+ bootstrap/interpreter override. */
38
+ python?: string;
39
+ };
40
+ /** Extra directories (besides the workspace) inputs may come from. */
41
+ allowedDirs?: string[];
42
+ }
43
+ /** Configuration schema with the documented P0 defaults. */
44
+ export declare const Config: Schema<VisionToolkitConfig>;
45
+ /** Configuration after static validation, with every default materialized. */
46
+ export interface ResolvedVisionToolkitConfig {
47
+ provider: {
48
+ baseUrl: string;
49
+ credential: CredentialRef;
50
+ model: string;
51
+ };
52
+ language: 'zh' | 'en';
53
+ timeoutMs: number;
54
+ maxImageBytes: number;
55
+ maxImagePixels: number;
56
+ concurrency: number;
57
+ runtime: {
58
+ mode: 'managed' | 'external';
59
+ agentVisionToolkitPath?: string;
60
+ python?: string;
61
+ };
62
+ allowedDirs: string[];
63
+ }
64
+ /**
65
+ * Validate and normalize a config object (partial inputs receive the same
66
+ * defaults the schemastery schema applies). Configuration mistakes fail loud
67
+ * at plugin load (the earliest resolvable point); runtime availability is a
68
+ * separate, later concern.
69
+ * @param config - parsed config with defaults applied.
70
+ * @returns the fully defaulted, validated configuration.
71
+ */
72
+ export declare function resolveConfig(config?: VisionToolkitConfig): ResolvedVisionToolkitConfig;
73
+ //# 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;AAIhF,wDAAwD;AACxD,eAAO,MAAM,iCAAiC,uDAAsC,CAAA;AAEpF,mFAAmF;AACnF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE;QACT,mDAAmD;QACnD,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,gFAAgF;QAChF,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,6BAA6B;QAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACtB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE;QACR,uGAAuG;QACvG,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;QAC7B,4EAA4E;QAC5E,sBAAsB,CAAC,EAAE,MAAM,CAAA;QAC/B,4DAA4D;QAC5D,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB;AAED,4DAA4D;AAC5D,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,mBAAmB,CAiB7C,CAAA;AAEF,8EAA8E;AAC9E,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAA;QACf,UAAU,EAAE,aAAa,CAAA;QACzB,KAAK,EAAE,MAAM,CAAA;KACd,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;CACtB;AAOD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,mBAAwB,GAAG,2BAA2B,CA0E3F"}
@@ -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,40 @@
1
+ /**
2
+ * Agent-scoped progressive exposure for the model-facing visual tools.
3
+ * Runtime readiness is global, while tool schemas enter only an Agent that has
4
+ * loaded the matching Skill; administrative diagnostics stay on the Web seam.
5
+ * @module dsh-vision-toolkit/exposure
6
+ */
7
+ import { type ToolDefinition } from '@deepseek-ai/dsh-tools';
8
+ import type { Context } from '@deepseek-ai/cordis';
9
+ /** Small bootstrap tool retained only until the current Agent gains visual tools. */
10
+ export declare const VISION_TOOLKIT_ACTIVATE = "vision_toolkit_activate";
11
+ /** Result returned by the one-shot activation transport. */
12
+ export interface VisionToolkitActivationResult {
13
+ activated: boolean;
14
+ tools: string[];
15
+ }
16
+ /**
17
+ * Owns one progressive-exposure generation for a ready Vision Toolkit runtime.
18
+ * The bootstrap tool is global; visual definitions are created and registered
19
+ * in an Agent scope only after the Skill load is durable or just succeeded.
20
+ */
21
+ export declare class VisionToolExposure {
22
+ private readonly ctx;
23
+ private readonly createTools;
24
+ readonly activationTool: ToolDefinition;
25
+ private readonly states;
26
+ private installed;
27
+ /**
28
+ * @param ctx - Plugin context with Tool and Agent registries.
29
+ * @param createTools - Fresh definitions bound to the current runtime generation.
30
+ */
31
+ constructor(ctx: Context, createTools: () => ToolDefinition[]);
32
+ /** Install lifecycle listeners and adopt Agents that already exist. */
33
+ install(): () => void;
34
+ private attach;
35
+ private activate;
36
+ private detach;
37
+ private disposeStates;
38
+ private disposeState;
39
+ }
40
+ //# sourceMappingURL=exposure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exposure.d.ts","sourceRoot":"","sources":["../../src/exposure.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,qFAAqF;AACrF,eAAO,MAAM,uBAAuB,4BAA4B,CAAA;AAShE,4DAA4D;AAC5D,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAqED;;;;GAIG;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;IA+BtD,uEAAuE;IACvE,OAAO,IAAI,MAAM,IAAI;IAiCrB,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,QAAQ;IA0BhB,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,YAAY;CAIrB"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @anionex/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-tools Skill and its one-shot bootstrap,
6
+ * then mount the execution tools only in Agents that load that Skill. Any
7
+ * failure leaves no model capability behind, and disposal unregisters every
8
+ * global and Agent-scoped contribution the plugin mounted.
9
+ * @module @anionex/dsh-vision-toolkit
10
+ */
11
+ import type { Context } from '@deepseek-ai/cordis';
12
+ import { Config, type VisionToolkitConfig } from './config.ts';
13
+ export declare const name = "@anionex/dsh-vision-toolkit";
14
+ export { Config };
15
+ export declare const inject: string[];
16
+ /** Plugin entry: validate configuration synchronously, then mount asynchronously. */
17
+ export declare function apply(ctx: Context, config?: VisionToolkitConfig): Promise<() => void>;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO,EACL,MAAM,EAGN,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAA;AASpB,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,CAoF/F"}
@@ -0,0 +1,21 @@
1
+ /** Workspace-local storage for images pasted into the DSH Web composer. */
2
+ import type { IncomingMessage, ServerResponse } from 'node:http';
3
+ import type { Context } from '@deepseek-ai/cordis';
4
+ /** Exact route used by the browser paste integration. */
5
+ export declare const PASTE_IMAGES_ROUTE = "/_dsh/vision-toolkit/paste-images";
6
+ /** Convert an untrusted browser label into one portable leaf filename. */
7
+ export declare function safePastedImageName(raw: string, mediaType: string): string;
8
+ /** Reject a resolved path that is not rooted below the expected directory. */
9
+ export declare function ensurePathInside(root: string, target: string): void;
10
+ /** Runtime limit face kept separate for focused backend tests. */
11
+ export interface PasteImageRuntime {
12
+ maxImageBytes(): number;
13
+ }
14
+ /** Same-origin, live-Session-bound image upload endpoint. */
15
+ export declare class PastedImageBackend {
16
+ private readonly ctx;
17
+ private readonly runtime;
18
+ constructor(ctx: Context, runtime: PasteImageRuntime);
19
+ handle(req: IncomingMessage, res: ServerResponse): Promise<void>;
20
+ }
21
+ //# sourceMappingURL=paste-images.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paste-images.d.ts","sourceRoot":"","sources":["../../src/paste-images.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAI3E,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD,yDAAyD;AACzD,eAAO,MAAM,kBAAkB,sCAAsC,CAAA;AAuErE,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAiB1E;AAED,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAKnE;AAkFD,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,aAAa,IAAI,MAAM,CAAA;CACxB;AAED,6DAA6D;AAC7D,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,iBAAiB;IAGvC,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA+BvE"}