@anionex/dsh-vision-toolkit 0.1.5 → 0.1.6
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/README.i18n.yaml +3 -3
- package/README.md +23 -8
- package/README.zh.md +23 -8
- package/docs/assets/vision-settings.png +0 -0
- package/docs/requirements-traceability/README.md +1 -1
- package/docs/requirements-traceability/README.zh.md +1 -1
- package/lib/client.js +338 -76
- package/lib/client.js.map +1 -1
- package/lib/config.js +18 -1
- package/lib/config.js.map +1 -1
- package/lib/runtime.js +18 -1
- package/lib/runtime.js.map +1 -1
- package/lib/types/client/index.d.ts +73 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/config.d.ts +12 -1
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/runtime.d.ts.map +1 -1
- package/lib/types/upstream.d.ts +3 -0
- package/lib/types/upstream.d.ts.map +1 -1
- package/lib/types/web.d.ts +1 -1
- package/lib/upstream.js +3 -0
- package/lib/upstream.js.map +1 -1
- package/lib/web.js +1 -1
- package/package.json +4 -4
- package/src/client/index.tsx +375 -102
- package/src/config.ts +29 -2
- package/src/runtime.ts +17 -1
- package/src/upstream.ts +6 -0
- package/src/web.ts +1 -1
- package/vendor/agent-vision-toolkit/CHANGELOG.md +13 -0
- package/vendor/agent-vision-toolkit/README.md +11 -6
- package/vendor/agent-vision-toolkit/UPSTREAM_MANIFEST.json +14 -9
- package/vendor/agent-vision-toolkit/tests/test_vision_client.py +396 -0
- package/vendor/agent-vision-toolkit/vision_client.py +134 -18
package/lib/client.js
CHANGED
|
@@ -17,15 +17,21 @@ const paste_images_tsx_1 = __load_("./paste-images.js");
|
|
|
17
17
|
const NS = 'vision-toolkit';
|
|
18
18
|
const SETTINGS_ROUTE = '/_dsh/vision-toolkit/settings';
|
|
19
19
|
const PRESENTATION_META_KEY = '$dshVisionToolkit';
|
|
20
|
+
const DEFAULT_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';
|
|
20
21
|
const en = {
|
|
21
22
|
nav: 'Vision',
|
|
22
23
|
settingsTitle: 'Vision Toolkit',
|
|
23
24
|
settingsIntro: 'Configure the pinned visual engineering runtime, its external vision endpoint, and local safety limits.',
|
|
24
25
|
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.',
|
|
25
26
|
provider: 'Vision service',
|
|
27
|
+
providerHint: 'Choose the API protocol, then provide the service address, model, and credential used by online vision features.',
|
|
26
28
|
baseUrl: 'Base URL',
|
|
27
29
|
credential: 'Credential reference',
|
|
28
30
|
model: 'Model',
|
|
31
|
+
protocol: 'API protocol',
|
|
32
|
+
anthropicThinking: 'Anthropic thinking',
|
|
33
|
+
anthropicThinkingHint: 'omit has the broadest compatibility. Use disabled or adaptive only when the selected model documents that mode; restore omit first after HTTP 400.',
|
|
34
|
+
userAgent: 'User-Agent',
|
|
29
35
|
language: 'Output language',
|
|
30
36
|
limits: 'Limits',
|
|
31
37
|
timeout: 'Request timeout (ms)',
|
|
@@ -46,16 +52,27 @@ const en = {
|
|
|
46
52
|
configured: 'Configured',
|
|
47
53
|
missing: 'Missing',
|
|
48
54
|
source: 'Source',
|
|
55
|
+
sourceHint: '{source}: {value}',
|
|
56
|
+
sourceEnv: 'Environment variable',
|
|
57
|
+
sourceFile: 'Credential file',
|
|
49
58
|
health: 'Health',
|
|
50
59
|
runHealth: 'Run health check',
|
|
51
60
|
testConnection: 'Test connection',
|
|
52
61
|
testing: 'Checking…',
|
|
53
62
|
connectionHint: 'Connection testing explicitly sends the configured credential to GET /models. It uploads no image and creates no completion.',
|
|
63
|
+
saveBeforeTesting: 'Save service changes before testing the connection.',
|
|
64
|
+
advanced: 'Advanced settings',
|
|
65
|
+
advancedHint: 'Provider compatibility, output language, resource limits, runtime source, Python, and additional readable directories.',
|
|
54
66
|
pluginVersion: 'Plugin',
|
|
55
67
|
upstreamVersion: 'Upstream',
|
|
56
68
|
activeGeneration: 'Runtime generation',
|
|
69
|
+
activeGenerationValue: 'Generation {generation}',
|
|
70
|
+
pluginKind: 'DSH native plugin',
|
|
57
71
|
runtimeUnavailable: 'Runtime unavailable',
|
|
58
72
|
runtimeCandidateRejected: 'Last runtime candidate was rejected; the active generation remains available.',
|
|
73
|
+
runtimeReady: 'Ready',
|
|
74
|
+
runtimeManaged: 'Managed',
|
|
75
|
+
runtimeExternal: 'External checkout',
|
|
59
76
|
retry: 'Retry',
|
|
60
77
|
open: 'Open file',
|
|
61
78
|
download: 'Download',
|
|
@@ -75,65 +92,189 @@ const en = {
|
|
|
75
92
|
healthy: 'Healthy',
|
|
76
93
|
degraded: 'Needs attention',
|
|
77
94
|
notTested: 'Not tested',
|
|
95
|
+
groundTitle: 'Ground',
|
|
96
|
+
detectTitle: 'Detect',
|
|
97
|
+
traceTitle: 'Trace SVG',
|
|
98
|
+
pixelDiffTitle: 'Pixel Diff',
|
|
99
|
+
cropTitle: 'Crop',
|
|
100
|
+
longOcrTitle: 'Long OCR',
|
|
101
|
+
extractForegroundTitle: 'Extract Foreground',
|
|
102
|
+
htmlScreenshotTitle: 'HTML Screenshot',
|
|
103
|
+
artifactTitle: 'Vision Artifact',
|
|
104
|
+
dominantColorsTitle: 'Dominant Colors',
|
|
105
|
+
artifactGroundPreview: 'Grounding bounding-box preview',
|
|
106
|
+
artifactDetectPreview: 'Detected-element bounding-box preview',
|
|
107
|
+
artifactCrop: 'Cropped image region',
|
|
108
|
+
artifactTrace: 'Traced vector geometry',
|
|
109
|
+
artifactDiffHeatmap: 'Pixel-difference heatmap',
|
|
110
|
+
artifactDiffReport: 'Structured pixel-difference report',
|
|
111
|
+
artifactLongManifest: 'Long-screenshot split and merge manifest',
|
|
112
|
+
artifactLongTranscript: 'Merged long-screenshot OCR transcript',
|
|
113
|
+
artifactLongAudit: 'Long-screenshot OCR boundary audit',
|
|
114
|
+
artifactLongChunk: 'Long-screenshot OCR chunk {index}',
|
|
115
|
+
artifactOcrSidecar: 'OCR sidecar for chunk {index}',
|
|
116
|
+
artifactForeground: 'Extracted transparent foreground',
|
|
117
|
+
artifactHtmlScreenshot: 'Headless browser screenshot of local HTML',
|
|
118
|
+
label: 'Label',
|
|
119
|
+
paths: 'paths',
|
|
120
|
+
healthPython: 'Python',
|
|
121
|
+
healthDependencies: 'Dependencies',
|
|
122
|
+
healthChrome: 'Browser',
|
|
123
|
+
healthCredential: 'Credential',
|
|
124
|
+
healthArtifactDirectory: 'Artifact directory',
|
|
125
|
+
healthTempDirectory: 'Temporary directory',
|
|
126
|
+
healthService: 'Vision service',
|
|
127
|
+
statusOk: 'OK',
|
|
128
|
+
statusWarning: 'Warning',
|
|
129
|
+
statusError: 'Error',
|
|
130
|
+
statusNotTested: 'Not tested',
|
|
131
|
+
positiveInteger: '{field} must be a positive integer.',
|
|
132
|
+
healthPythonDetail: '{version} via {path}',
|
|
133
|
+
healthChromeMissing: 'Chrome, Chromium, or Edge was not found; HTML Screenshot is unavailable.',
|
|
134
|
+
healthChromeProbeFailed: 'Could not check whether a supported browser is available.',
|
|
135
|
+
healthCredentialMissing: 'Credential {credential} is not configured.',
|
|
136
|
+
healthCredentialReady: 'Credential {credential} is available.',
|
|
137
|
+
healthCredentialFailed: 'Could not read credential {credential}.',
|
|
138
|
+
healthDirectoryWritable: '{directory} is writable: {path}',
|
|
139
|
+
healthDirectoryNotWritable: '{directory} is not writable: {path}',
|
|
140
|
+
healthArtifactDirectoryFailed: 'Could not prepare the artifact directory.',
|
|
141
|
+
healthConnectionNotTested: 'Connection not tested. Use Test connection to query /models.',
|
|
142
|
+
healthConnectionCredentialMissing: 'Connection test skipped because the credential is unavailable.',
|
|
143
|
+
healthServiceResponded: 'Service responded at {endpoint} (HTTP {status}).',
|
|
144
|
+
healthServiceRejectedCredential: 'Service rejected the configured credential (HTTP {status}).',
|
|
145
|
+
healthServiceNoModels: 'Service is reachable but does not support GET /models (HTTP {status}).',
|
|
146
|
+
healthServiceRateLimited: 'Service is reachable, but the connection test was rate-limited (HTTP 429).',
|
|
147
|
+
healthServiceHttpFailed: 'Connection test failed with HTTP {status}.',
|
|
148
|
+
healthServiceUnreachable: 'Could not reach {endpoint}.',
|
|
78
149
|
};
|
|
79
150
|
const zh = {
|
|
80
151
|
nav: '视觉工具',
|
|
81
|
-
settingsTitle: '
|
|
82
|
-
settingsIntro: '
|
|
83
|
-
externalNotice: '
|
|
84
|
-
provider: '
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
152
|
+
settingsTitle: '视觉工具箱',
|
|
153
|
+
settingsIntro: '在这里设置视觉模型服务、工具运行环境,以及图片和文件的本地访问范围。',
|
|
154
|
+
externalNotice: '使用图像理解、目标定位、界面检测或文字识别等在线功能时,所选图片会发送到下方配置的视觉服务。图片裁剪、轮廓描摹、像素对比、主色提取、前景提取和网页截图均在本机完成,不会上传图片。',
|
|
155
|
+
provider: '在线视觉服务',
|
|
156
|
+
providerHint: '选择接口协议后,填写在线视觉功能使用的 API 地址、模型名称和密钥名称。',
|
|
157
|
+
baseUrl: 'API 地址',
|
|
158
|
+
credential: 'API 密钥名称',
|
|
159
|
+
model: '模型名称',
|
|
160
|
+
protocol: 'API 协议',
|
|
161
|
+
anthropicThinking: 'Anthropic thinking',
|
|
162
|
+
anthropicThinkingHint: 'omit 兼容性最好。仅当所选模型明确支持时使用 disabled 或 adaptive;遇到 HTTP 400 时先恢复 omit。',
|
|
163
|
+
userAgent: 'User-Agent',
|
|
164
|
+
language: '结果语言',
|
|
165
|
+
limits: '资源与并发限制',
|
|
166
|
+
timeout: '单次请求超时(毫秒)',
|
|
167
|
+
maxBytes: '单张图片大小上限(字节)',
|
|
168
|
+
maxPixels: '单张图片最大像素数',
|
|
169
|
+
concurrency: '单个会话最多并发任务数',
|
|
170
|
+
runtime: '工具运行环境',
|
|
171
|
+
runtimeMode: '环境来源',
|
|
172
|
+
toolkitPath: 'agent-vision-toolkit 目录',
|
|
173
|
+
python: 'Python 解释器(可选)',
|
|
174
|
+
allowedDirs: '允许读取的其他目录',
|
|
175
|
+
allowedDirsHint: '每行填写一个目录。当前会话的工作目录始终可以读取,无需重复填写。',
|
|
176
|
+
save: '保存设置',
|
|
177
|
+
saving: '正在检查并应用…',
|
|
102
178
|
reload: '重新加载',
|
|
103
|
-
saved: '
|
|
104
|
-
readOnly: '
|
|
105
|
-
configured: '
|
|
106
|
-
missing: '
|
|
107
|
-
source: '
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
179
|
+
saved: '设置已保存并生效。',
|
|
180
|
+
readOnly: '当前设置由只读配置提供,无法在此修改。',
|
|
181
|
+
configured: '已就绪',
|
|
182
|
+
missing: '未配置',
|
|
183
|
+
source: '配置来源',
|
|
184
|
+
sourceHint: '{source}:{value}',
|
|
185
|
+
sourceEnv: '环境变量',
|
|
186
|
+
sourceFile: '凭据文件',
|
|
187
|
+
health: '运行检查',
|
|
188
|
+
runHealth: '检查本地环境',
|
|
189
|
+
testConnection: '测试服务连接',
|
|
111
190
|
testing: '检查中…',
|
|
112
|
-
connectionHint: '
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
191
|
+
connectionHint: '“检查本地环境”只检查本机依赖和目录;“测试服务连接”会携带已配置的 API 密钥请求 /models,但不会上传图片或调用模型。',
|
|
192
|
+
saveBeforeTesting: '修改服务配置后,请先保存,再测试连接。',
|
|
193
|
+
advanced: '高级设置',
|
|
194
|
+
advancedHint: '服务兼容参数、结果语言、资源限制、运行环境来源、Python 和额外可读目录。一般无需修改。',
|
|
195
|
+
pluginVersion: '插件版本',
|
|
196
|
+
upstreamVersion: '工具包版本',
|
|
197
|
+
activeGeneration: '本次运行已应用',
|
|
198
|
+
activeGenerationValue: '{generation} 次',
|
|
199
|
+
pluginKind: 'DSH 原生插件',
|
|
200
|
+
runtimeUnavailable: '运行环境尚未就绪',
|
|
201
|
+
runtimeCandidateRejected: '新设置未能生效,仍在使用上一次可用的设置。',
|
|
202
|
+
runtimeReady: '已就绪',
|
|
203
|
+
runtimeManaged: '自动安装',
|
|
204
|
+
runtimeExternal: '本地源码',
|
|
118
205
|
retry: '重试',
|
|
119
|
-
open: '
|
|
206
|
+
open: '在工作区中打开',
|
|
120
207
|
download: '下载',
|
|
121
|
-
previewUnavailable: '
|
|
208
|
+
previewUnavailable: '此页面无法直接预览该文件,请在工作区中打开。',
|
|
122
209
|
running: '运行中…',
|
|
123
|
-
failed: '
|
|
124
|
-
matches: '
|
|
210
|
+
failed: '运行失败',
|
|
211
|
+
matches: '处匹配',
|
|
125
212
|
elements: '个元素',
|
|
126
|
-
dimensions: '
|
|
213
|
+
dimensions: '图片尺寸',
|
|
127
214
|
coordinates: '坐标',
|
|
128
|
-
artifact: '
|
|
129
|
-
artifacts: '
|
|
130
|
-
difference: '
|
|
131
|
-
worstRegions: '
|
|
132
|
-
colors: '
|
|
133
|
-
noResult: '
|
|
134
|
-
healthy: '
|
|
135
|
-
degraded: '
|
|
136
|
-
notTested: '
|
|
215
|
+
artifact: '生成文件',
|
|
216
|
+
artifacts: '个生成文件',
|
|
217
|
+
difference: '像素差异',
|
|
218
|
+
worstRegions: '差异最大的区域',
|
|
219
|
+
colors: '种颜色',
|
|
220
|
+
noResult: '未能读取结果,请查看工具的原始输出。',
|
|
221
|
+
healthy: '一切正常',
|
|
222
|
+
degraded: '有项目需要处理',
|
|
223
|
+
notTested: '尚未检查',
|
|
224
|
+
groundTitle: '目标定位',
|
|
225
|
+
detectTitle: '界面元素识别',
|
|
226
|
+
traceTitle: '描摹为 SVG',
|
|
227
|
+
pixelDiffTitle: '像素对比',
|
|
228
|
+
cropTitle: '裁剪图片',
|
|
229
|
+
longOcrTitle: '长图文字识别',
|
|
230
|
+
extractForegroundTitle: '提取前景',
|
|
231
|
+
htmlScreenshotTitle: '网页截图',
|
|
232
|
+
artifactTitle: '视觉处理结果',
|
|
233
|
+
dominantColorsTitle: '主色提取',
|
|
234
|
+
artifactGroundPreview: '目标定位框预览',
|
|
235
|
+
artifactDetectPreview: '界面元素标注预览',
|
|
236
|
+
artifactCrop: '裁剪后的图片',
|
|
237
|
+
artifactTrace: '描摹得到的矢量图',
|
|
238
|
+
artifactDiffHeatmap: '像素差异热力图',
|
|
239
|
+
artifactDiffReport: '像素差异详细报告',
|
|
240
|
+
artifactLongManifest: '长图切分与合并记录',
|
|
241
|
+
artifactLongTranscript: '长图文字识别结果',
|
|
242
|
+
artifactLongAudit: '长图分块边界检查记录',
|
|
243
|
+
artifactLongChunk: '长图文字识别分块 {index}',
|
|
244
|
+
artifactOcrSidecar: '分块 {index} 的文字识别记录',
|
|
245
|
+
artifactForeground: '提取后的透明背景前景图',
|
|
246
|
+
artifactHtmlScreenshot: '本地网页截图',
|
|
247
|
+
label: '名称',
|
|
248
|
+
paths: '条路径',
|
|
249
|
+
healthPython: 'Python',
|
|
250
|
+
healthDependencies: 'Python 依赖',
|
|
251
|
+
healthChrome: '浏览器',
|
|
252
|
+
healthCredential: 'API 密钥',
|
|
253
|
+
healthArtifactDirectory: '输出目录',
|
|
254
|
+
healthTempDirectory: '临时目录',
|
|
255
|
+
healthService: '视觉服务',
|
|
256
|
+
statusOk: '正常',
|
|
257
|
+
statusWarning: '注意',
|
|
258
|
+
statusError: '异常',
|
|
259
|
+
statusNotTested: '未检查',
|
|
260
|
+
positiveInteger: '{field}必须填写正整数。',
|
|
261
|
+
healthPythonDetail: '版本 {version};解释器:{path}',
|
|
262
|
+
healthChromeMissing: '未找到 Chrome、Chromium 或 Edge,网页截图功能暂不可用。',
|
|
263
|
+
healthChromeProbeFailed: '无法检查浏览器是否可用。',
|
|
264
|
+
healthCredentialMissing: '尚未配置凭据 {credential}。',
|
|
265
|
+
healthCredentialReady: '已找到凭据 {credential}。',
|
|
266
|
+
healthCredentialFailed: '无法读取凭据 {credential}。',
|
|
267
|
+
healthDirectoryWritable: '{directory}可写:{path}',
|
|
268
|
+
healthDirectoryNotWritable: '{directory}不可写:{path}',
|
|
269
|
+
healthArtifactDirectoryFailed: '无法准备输出目录。',
|
|
270
|
+
healthConnectionNotTested: '尚未测试服务连接。点击“测试服务连接”可请求 /models。',
|
|
271
|
+
healthConnectionCredentialMissing: 'API 密钥不可用,未执行连接测试。',
|
|
272
|
+
healthServiceResponded: '服务已响应:{endpoint}(HTTP {status})。',
|
|
273
|
+
healthServiceRejectedCredential: '服务拒绝了当前 API 密钥(HTTP {status})。',
|
|
274
|
+
healthServiceNoModels: '服务可以访问,但不支持 GET /models(HTTP {status})。',
|
|
275
|
+
healthServiceRateLimited: '服务可以访问,但本次连接测试触发了限流(HTTP 429)。',
|
|
276
|
+
healthServiceHttpFailed: '连接测试失败(HTTP {status})。',
|
|
277
|
+
healthServiceUnreachable: '无法连接到 {endpoint}。',
|
|
137
278
|
};
|
|
138
279
|
function isRecord(value) {
|
|
139
280
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
@@ -261,21 +402,53 @@ function ArtifactActions({ artifact, grant, openFile, t }) {
|
|
|
261
402
|
}
|
|
262
403
|
function ArtifactPreview({ artifact, grant, openFile, t }) {
|
|
263
404
|
const canPreview = grant !== undefined && (artifact.kind === 'image' || artifact.kind === 'svg');
|
|
405
|
+
const description = artifactDescription(artifact.description, t);
|
|
264
406
|
return ((0, jsx_runtime_1.jsxs)("article", { className: "dvt-artifact", children: [canPreview
|
|
265
407
|
? artifact.kind === 'svg'
|
|
266
|
-
? (0, jsx_runtime_1.jsx)("iframe", { className: "dvt-preview dvt-svg", sandbox: "", src: grant.previewUrl, title:
|
|
267
|
-
: (0, jsx_runtime_1.jsx)("img", { className: "dvt-preview", src: grant.previewUrl, alt:
|
|
268
|
-
: null, (0, jsx_runtime_1.jsxs)("div", { className: "dvt-artifact-meta", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("strong", { children: artifact.filename }), (0, jsx_runtime_1.jsx)("span", { children:
|
|
408
|
+
? (0, jsx_runtime_1.jsx)("iframe", { className: "dvt-preview dvt-svg", sandbox: "", src: grant.previewUrl, title: description })
|
|
409
|
+
: (0, jsx_runtime_1.jsx)("img", { className: "dvt-preview", src: grant.previewUrl, alt: description, loading: "lazy" })
|
|
410
|
+
: null, (0, jsx_runtime_1.jsxs)("div", { className: "dvt-artifact-meta", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("strong", { children: artifact.filename }), (0, jsx_runtime_1.jsx)("span", { children: description }), (0, jsx_runtime_1.jsxs)("small", { children: [artifact.mimeType, " \u00B7 ", formatBytes(artifact.bytes)] })] }), (0, jsx_runtime_1.jsx)(ArtifactActions, { artifact: artifact, grant: grant, openFile: openFile, t: t })] }), !canPreview && grant === undefined ? (0, jsx_runtime_1.jsx)("p", { className: "dvt-muted", children: t('previewUnavailable') }) : null] }));
|
|
411
|
+
}
|
|
412
|
+
const ARTIFACT_DESCRIPTION_KEYS = {
|
|
413
|
+
'Grounding bounding-box preview': 'artifactGroundPreview',
|
|
414
|
+
'Detected-element bounding-box preview': 'artifactDetectPreview',
|
|
415
|
+
'Cropped image region': 'artifactCrop',
|
|
416
|
+
'Traced vector geometry': 'artifactTrace',
|
|
417
|
+
'Pixel-difference heatmap': 'artifactDiffHeatmap',
|
|
418
|
+
'Structured pixel-difference report': 'artifactDiffReport',
|
|
419
|
+
'Long-screenshot split and merge manifest': 'artifactLongManifest',
|
|
420
|
+
'Merged long-screenshot OCR transcript': 'artifactLongTranscript',
|
|
421
|
+
'Long-screenshot OCR boundary audit': 'artifactLongAudit',
|
|
422
|
+
'Extracted transparent foreground': 'artifactForeground',
|
|
423
|
+
'Headless browser screenshot of local HTML': 'artifactHtmlScreenshot',
|
|
424
|
+
};
|
|
425
|
+
function artifactDescription(description, t) {
|
|
426
|
+
const key = ARTIFACT_DESCRIPTION_KEYS[description];
|
|
427
|
+
if (key !== undefined) {
|
|
428
|
+
const translated = t(key);
|
|
429
|
+
return translated === key ? description : translated;
|
|
430
|
+
}
|
|
431
|
+
let match = /^Long-screenshot OCR chunk (\d+)$/u.exec(description);
|
|
432
|
+
if (match !== null) {
|
|
433
|
+
const translated = t('artifactLongChunk', { index: match[1] });
|
|
434
|
+
return translated === 'artifactLongChunk' ? description : translated;
|
|
435
|
+
}
|
|
436
|
+
match = /^OCR sidecar for chunk (\d+)$/u.exec(description);
|
|
437
|
+
if (match !== null) {
|
|
438
|
+
const translated = t('artifactOcrSidecar', { index: match[1] });
|
|
439
|
+
return translated === 'artifactOcrSidecar' ? description : translated;
|
|
440
|
+
}
|
|
441
|
+
return description;
|
|
269
442
|
}
|
|
270
443
|
function GroundView({ block, openFile, t = key => en[key] }) {
|
|
271
444
|
const value = decodeVisionResult(block);
|
|
272
445
|
const matches = Array.isArray(value?.matches) ? value.matches.filter(isRecord) : [];
|
|
273
|
-
const target = stringOf(value?.target) ?? '
|
|
446
|
+
const target = stringOf(value?.target) ?? t('groundTitle');
|
|
274
447
|
const width = numberOf(value?.imageWidth);
|
|
275
448
|
const height = numberOf(value?.imageHeight);
|
|
276
449
|
const preview = artifactFrom(value?.preview);
|
|
277
450
|
const grants = accessMap(value);
|
|
278
|
-
return ((0, jsx_runtime_1.jsx)(ToolShell, { block: block, title:
|
|
451
|
+
return ((0, jsx_runtime_1.jsx)(ToolShell, { block: block, title: t('groundTitle'), summary: matches.length > 0 ? `${target} · ${matches.length} ${t('matches')}` : target, icon: (0, jsx_runtime_1.jsx)(VisionIcon, { kind: "target" }), t: t, children: value === undefined ? (0, jsx_runtime_1.jsx)("p", { className: "dvt-muted", children: t('noResult') }) : ((0, jsx_runtime_1.jsxs)("div", { className: "dvt-stack", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dvt-metrics", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { children: t('dimensions') }), (0, jsx_runtime_1.jsxs)("strong", { children: [width ?? '—', " \u00D7 ", height ?? '—'] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { children: t('coordinates') }), (0, jsx_runtime_1.jsx)("strong", { children: matches[0] === undefined ? '—' : boxText(matches[0].box) })] })] }), matches.length > 1 ? ((0, jsx_runtime_1.jsx)("ol", { className: "dvt-list", children: matches.map((match, index) => (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("span", { children: stringOf(match.label) ?? `#${index + 1}` }), (0, jsx_runtime_1.jsx)("code", { children: boxText(match.box) })] }, index)) })) : null, preview === undefined ? null : (0, jsx_runtime_1.jsx)(ArtifactPreview, { artifact: preview, grant: grants.get(preview.path), openFile: openFile, t: t })] })) }));
|
|
279
452
|
}
|
|
280
453
|
function DetectView({ block, openFile, t = key => en[key] }) {
|
|
281
454
|
const value = decodeVisionResult(block);
|
|
@@ -284,15 +457,15 @@ function DetectView({ block, openFile, t = key => en[key] }) {
|
|
|
284
457
|
const height = numberOf(value?.imageHeight);
|
|
285
458
|
const preview = artifactFrom(value?.preview);
|
|
286
459
|
const grants = accessMap(value);
|
|
287
|
-
return ((0, jsx_runtime_1.jsx)(ToolShell, { block: block, title:
|
|
460
|
+
return ((0, jsx_runtime_1.jsx)(ToolShell, { block: block, title: t('detectTitle'), summary: `${elements.length} ${t('elements')}`, icon: (0, jsx_runtime_1.jsx)(VisionIcon, { kind: "layers" }), t: t, children: value === undefined ? (0, jsx_runtime_1.jsx)("p", { className: "dvt-muted", children: t('noResult') }) : ((0, jsx_runtime_1.jsxs)("div", { className: "dvt-stack", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dvt-metrics", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { children: t('dimensions') }), (0, jsx_runtime_1.jsxs)("strong", { children: [width ?? '—', " \u00D7 ", height ?? '—'] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { children: t('elements') }), (0, jsx_runtime_1.jsx)("strong", { children: elements.length })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "dvt-table-wrap", children: (0, jsx_runtime_1.jsxs)("table", { className: "dvt-table", children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { children: "#" }), (0, jsx_runtime_1.jsx)("th", { children: t('label') }), (0, jsx_runtime_1.jsx)("th", { children: t('coordinates') })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: elements.map((element, index) => (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { children: numberOf(element.index) ?? index + 1 }), (0, jsx_runtime_1.jsx)("td", { children: stringOf(element.label) ?? '—' }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)("code", { children: boxText(element.box) }) })] }, index)) })] }) }), preview === undefined ? null : (0, jsx_runtime_1.jsx)(ArtifactPreview, { artifact: preview, grant: grants.get(preview.path), openFile: openFile, t: t })] })) }));
|
|
288
461
|
}
|
|
289
462
|
function TraceView({ block, openFile, t = key => en[key] }) {
|
|
290
463
|
const value = decodeVisionResult(block);
|
|
291
464
|
const artifact = artifactFrom(value?.artifact);
|
|
292
465
|
const geometry = isRecord(value?.geometry) ? value.geometry : undefined;
|
|
293
|
-
const summary = geometry === undefined ? undefined : `${numberOf(geometry.pathCount) ?? 0} paths · ${formatBytes(numberOf(geometry.bytes) ?? 0)}`;
|
|
466
|
+
const summary = geometry === undefined ? undefined : `${numberOf(geometry.pathCount) ?? 0} ${t('paths')} · ${formatBytes(numberOf(geometry.bytes) ?? 0)}`;
|
|
294
467
|
const grants = accessMap(value);
|
|
295
|
-
return ((0, jsx_runtime_1.jsx)(ToolShell, { block: block, title:
|
|
468
|
+
return ((0, jsx_runtime_1.jsx)(ToolShell, { block: block, title: t('traceTitle'), summary: summary, icon: (0, jsx_runtime_1.jsx)(VisionIcon, { kind: "shape" }), t: t, children: artifact === undefined ? (0, jsx_runtime_1.jsx)("p", { className: "dvt-muted", children: t('noResult') }) : (0, jsx_runtime_1.jsx)(ArtifactPreview, { artifact: artifact, grant: grants.get(artifact.path), openFile: openFile, t: t }) }));
|
|
296
469
|
}
|
|
297
470
|
function PixelDiffView({ block, openFile, t = key => en[key] }) {
|
|
298
471
|
const value = decodeVisionResult(block);
|
|
@@ -301,24 +474,24 @@ function PixelDiffView({ block, openFile, t = key => en[key] }) {
|
|
|
301
474
|
const heatmap = artifactFrom(value?.heatmap);
|
|
302
475
|
const report = artifactFrom(value?.report);
|
|
303
476
|
const grants = accessMap(value);
|
|
304
|
-
return ((0, jsx_runtime_1.jsx)(ToolShell, { block: block, title:
|
|
477
|
+
return ((0, jsx_runtime_1.jsx)(ToolShell, { block: block, title: t('pixelDiffTitle'), summary: pct === undefined ? undefined : `${pct.toFixed(3)}%`, icon: (0, jsx_runtime_1.jsx)(VisionIcon, { kind: "diff" }), t: t, children: value === undefined ? (0, jsx_runtime_1.jsx)("p", { className: "dvt-muted", children: t('noResult') }) : ((0, jsx_runtime_1.jsxs)("div", { className: "dvt-stack", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dvt-diff-score", children: [(0, jsx_runtime_1.jsx)("span", { children: t('difference') }), (0, jsx_runtime_1.jsxs)("strong", { children: [pct?.toFixed(4) ?? '—', "%"] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("i", { style: { width: `${Math.min(100, Math.max(0, pct ?? 0))}%` } }) })] }), regions.length === 0 ? null : (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { children: t('worstRegions') }), (0, jsx_runtime_1.jsx)("ol", { className: "dvt-list", children: regions.map((region, index) => (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsxs)("span", { children: [(numberOf(region.differencePct) ?? 0).toFixed(3), "%"] }), (0, jsx_runtime_1.jsx)("code", { children: boxText(region.box) })] }, index)) })] }), heatmap === undefined ? null : (0, jsx_runtime_1.jsx)(ArtifactPreview, { artifact: heatmap, grant: grants.get(heatmap.path), openFile: openFile, t: t }), report === undefined ? null : (0, jsx_runtime_1.jsx)(ArtifactPreview, { artifact: report, grant: grants.get(report.path), openFile: openFile, t: t })] })) }));
|
|
305
478
|
}
|
|
306
479
|
function ArtifactView({ block, openFile, toolName, t = key => en[key] }) {
|
|
307
480
|
const value = decodeVisionResult(block);
|
|
308
481
|
const artifacts = collectArtifacts(value);
|
|
309
482
|
const grants = accessMap(value);
|
|
310
|
-
const title = toolName === 'vision_crop' ? '
|
|
311
|
-
: toolName === 'vision_long_screenshot_ocr' ? '
|
|
312
|
-
: toolName === 'vision_extract_foreground' ? '
|
|
313
|
-
: toolName === 'vision_html_screenshot' ? '
|
|
314
|
-
: '
|
|
483
|
+
const title = toolName === 'vision_crop' ? t('cropTitle')
|
|
484
|
+
: toolName === 'vision_long_screenshot_ocr' ? t('longOcrTitle')
|
|
485
|
+
: toolName === 'vision_extract_foreground' ? t('extractForegroundTitle')
|
|
486
|
+
: toolName === 'vision_html_screenshot' ? t('htmlScreenshotTitle')
|
|
487
|
+
: t('artifactTitle');
|
|
315
488
|
return ((0, jsx_runtime_1.jsx)(ToolShell, { block: block, title: title, summary: artifacts.length > 0 ? `${artifacts.length} ${t('artifacts')}` : undefined, icon: (0, jsx_runtime_1.jsx)(VisionIcon, {}), t: t, children: artifacts.length === 0 ? (0, jsx_runtime_1.jsx)("p", { className: "dvt-muted", children: t('noResult') }) : (0, jsx_runtime_1.jsx)("div", { className: "dvt-stack", children: artifacts.map(artifact => (0, jsx_runtime_1.jsx)(ArtifactPreview, { artifact: artifact, grant: grants.get(artifact.path), openFile: openFile, t: t }, artifact.path)) }) }));
|
|
316
489
|
}
|
|
317
490
|
function PaletteView({ block, t = key => en[key] }) {
|
|
318
491
|
const value = decodeVisionResult(block);
|
|
319
492
|
const analysis = isRecord(value?.analysis) ? value.analysis : undefined;
|
|
320
493
|
const colors = Array.isArray(analysis?.colors) ? analysis.colors.filter(isRecord) : [];
|
|
321
|
-
return ((0, jsx_runtime_1.jsx)(ToolShell, { block: block, title:
|
|
494
|
+
return ((0, jsx_runtime_1.jsx)(ToolShell, { block: block, title: t('dominantColorsTitle'), summary: `${colors.length} ${t('colors')}`, icon: (0, jsx_runtime_1.jsx)(VisionIcon, { kind: "palette" }), t: t, children: colors.length === 0 ? (0, jsx_runtime_1.jsx)("p", { className: "dvt-muted", children: t('noResult') }) : (0, jsx_runtime_1.jsx)("div", { className: "dvt-palette", children: colors.map((color, index) => {
|
|
322
495
|
const hex = stringOf(color.color) ?? '#000000';
|
|
323
496
|
const share = numberOf(color.sharePct);
|
|
324
497
|
return (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("i", { style: { background: hex } }), (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("strong", { children: hex }), (0, jsx_runtime_1.jsx)("small", { children: share === undefined ? '' : `${share.toFixed(2)}%` })] })] }, `${hex}-${index}`);
|
|
@@ -403,6 +576,9 @@ function draftOf(value) {
|
|
|
403
576
|
baseUrl: value.provider?.baseUrl ?? 'https://api.inferera.com/v1',
|
|
404
577
|
credential: value.provider?.credential ?? 'VISION_API_KEY',
|
|
405
578
|
model: value.provider?.model ?? 'gemini-3.6-flash',
|
|
579
|
+
protocol: value.provider?.protocol ?? 'openai',
|
|
580
|
+
anthropicThinking: value.provider?.anthropicThinking ?? 'omit',
|
|
581
|
+
userAgent: value.provider?.userAgent ?? DEFAULT_USER_AGENT,
|
|
406
582
|
language: value.language ?? 'zh',
|
|
407
583
|
timeoutMs: String(value.timeoutMs ?? 60000),
|
|
408
584
|
maxImageBytes: String(value.maxImageBytes ?? 10485760),
|
|
@@ -414,20 +590,27 @@ function draftOf(value) {
|
|
|
414
590
|
allowedDirs: (value.allowedDirs ?? []).join('\n'),
|
|
415
591
|
};
|
|
416
592
|
}
|
|
417
|
-
function positiveInteger(raw, label) {
|
|
593
|
+
function positiveInteger(raw, label, t) {
|
|
418
594
|
const value = Number(raw);
|
|
419
595
|
if (!Number.isSafeInteger(value) || value <= 0)
|
|
420
|
-
throw new Error(
|
|
596
|
+
throw new Error(t('positiveInteger', { field: label }));
|
|
421
597
|
return value;
|
|
422
598
|
}
|
|
423
|
-
function valueOf(draft) {
|
|
599
|
+
function valueOf(draft, t) {
|
|
424
600
|
return {
|
|
425
|
-
provider: {
|
|
601
|
+
provider: {
|
|
602
|
+
baseUrl: draft.baseUrl.trim(),
|
|
603
|
+
credential: draft.credential.trim(),
|
|
604
|
+
model: draft.model.trim(),
|
|
605
|
+
protocol: draft.protocol,
|
|
606
|
+
anthropicThinking: draft.anthropicThinking,
|
|
607
|
+
userAgent: draft.userAgent.trim(),
|
|
608
|
+
},
|
|
426
609
|
language: draft.language,
|
|
427
|
-
timeoutMs: positiveInteger(draft.timeoutMs, '
|
|
428
|
-
maxImageBytes: positiveInteger(draft.maxImageBytes, '
|
|
429
|
-
maxImagePixels: positiveInteger(draft.maxImagePixels, '
|
|
430
|
-
concurrency: positiveInteger(draft.concurrency, 'concurrency'),
|
|
610
|
+
timeoutMs: positiveInteger(draft.timeoutMs, t('timeout'), t),
|
|
611
|
+
maxImageBytes: positiveInteger(draft.maxImageBytes, t('maxBytes'), t),
|
|
612
|
+
maxImagePixels: positiveInteger(draft.maxImagePixels, t('maxPixels'), t),
|
|
613
|
+
concurrency: positiveInteger(draft.concurrency, t('concurrency'), t),
|
|
431
614
|
runtime: {
|
|
432
615
|
mode: draft.runtimeMode,
|
|
433
616
|
...(draft.runtimeMode === 'external' ? { agentVisionToolkitPath: draft.toolkitPath.trim() } : {}),
|
|
@@ -444,6 +627,84 @@ function SettingsSection({ controller, t }) {
|
|
|
444
627
|
return null;
|
|
445
628
|
return (0, jsx_runtime_1.jsx)(LoadedSettings, { controller: controller, t: t });
|
|
446
629
|
}
|
|
630
|
+
const HEALTH_NAME_KEYS = {
|
|
631
|
+
python: 'healthPython',
|
|
632
|
+
dependencies: 'healthDependencies',
|
|
633
|
+
chrome: 'healthChrome',
|
|
634
|
+
credential: 'healthCredential',
|
|
635
|
+
artifactDirectory: 'healthArtifactDirectory',
|
|
636
|
+
tempDirectory: 'healthTempDirectory',
|
|
637
|
+
service: 'healthService',
|
|
638
|
+
};
|
|
639
|
+
const HEALTH_STATUS_KEYS = {
|
|
640
|
+
ok: 'statusOk',
|
|
641
|
+
warning: 'statusWarning',
|
|
642
|
+
error: 'statusError',
|
|
643
|
+
not_tested: 'statusNotTested',
|
|
644
|
+
};
|
|
645
|
+
function healthDetail(name, detail, t) {
|
|
646
|
+
if (name === 'python') {
|
|
647
|
+
const match = /^(.+) via (.+)$/u.exec(detail);
|
|
648
|
+
if (match !== null)
|
|
649
|
+
return t('healthPythonDetail', { version: match[1], path: match[2] });
|
|
650
|
+
}
|
|
651
|
+
if (detail === 'Chrome/Chromium/Edge was not found; vision_html_screenshot is unavailable')
|
|
652
|
+
return t('healthChromeMissing');
|
|
653
|
+
if (detail === 'Chrome availability probe failed')
|
|
654
|
+
return t('healthChromeProbeFailed');
|
|
655
|
+
let match = /^credential (.+) is not configured$/u.exec(detail);
|
|
656
|
+
if (match !== null)
|
|
657
|
+
return t('healthCredentialMissing', { credential: match[1] });
|
|
658
|
+
match = /^credential (.+) is resolvable$/u.exec(detail);
|
|
659
|
+
if (match !== null)
|
|
660
|
+
return t('healthCredentialReady', { credential: match[1] });
|
|
661
|
+
match = /^credential (.+) could not be resolved$/u.exec(detail);
|
|
662
|
+
if (match !== null)
|
|
663
|
+
return t('healthCredentialFailed', { credential: match[1] });
|
|
664
|
+
match = /^(Artifact directory|Runtime temp directory) is writable: (.+)$/u.exec(detail);
|
|
665
|
+
if (match !== null)
|
|
666
|
+
return t('healthDirectoryWritable', {
|
|
667
|
+
directory: match[1] === 'Artifact directory' ? t('healthArtifactDirectory') : t('healthTempDirectory'),
|
|
668
|
+
path: match[2],
|
|
669
|
+
});
|
|
670
|
+
match = /^(Artifact directory|Runtime temp directory) is not writable: (.+)$/u.exec(detail);
|
|
671
|
+
if (match !== null)
|
|
672
|
+
return t('healthDirectoryNotWritable', {
|
|
673
|
+
directory: match[1] === 'Artifact directory' ? t('healthArtifactDirectory') : t('healthTempDirectory'),
|
|
674
|
+
path: match[2],
|
|
675
|
+
});
|
|
676
|
+
if (detail === 'Artifact directory could not be prepared')
|
|
677
|
+
return t('healthArtifactDirectoryFailed');
|
|
678
|
+
if (detail === 'Connection was not tested; pass testConnection=true to query the configured /models endpoint')
|
|
679
|
+
return t('healthConnectionNotTested');
|
|
680
|
+
if (detail === 'Connection test skipped because the configured credential is unavailable')
|
|
681
|
+
return t('healthConnectionCredentialMissing');
|
|
682
|
+
match = /^Service responded at (.+) \(HTTP (\d+)\)$/u.exec(detail);
|
|
683
|
+
if (match !== null)
|
|
684
|
+
return t('healthServiceResponded', { endpoint: match[1], status: match[2] });
|
|
685
|
+
match = /^Service rejected the configured credential \(HTTP (\d+)\)$/u.exec(detail);
|
|
686
|
+
if (match !== null)
|
|
687
|
+
return t('healthServiceRejectedCredential', { status: match[1] });
|
|
688
|
+
match = /^Service is reachable but does not expose GET \/models \(HTTP (\d+)\)$/u.exec(detail);
|
|
689
|
+
if (match !== null)
|
|
690
|
+
return t('healthServiceNoModels', { status: match[1] });
|
|
691
|
+
if (detail === 'Service is reachable but rate-limited the connection test (HTTP 429)')
|
|
692
|
+
return t('healthServiceRateLimited');
|
|
693
|
+
match = /^Service connection test failed with HTTP (\d+)$/u.exec(detail);
|
|
694
|
+
if (match !== null)
|
|
695
|
+
return t('healthServiceHttpFailed', { status: match[1] });
|
|
696
|
+
match = /^Service could not be reached at (.+)$/u.exec(detail);
|
|
697
|
+
if (match !== null)
|
|
698
|
+
return t('healthServiceUnreachable', { endpoint: match[1] });
|
|
699
|
+
return detail;
|
|
700
|
+
}
|
|
701
|
+
function credentialSource(source, t) {
|
|
702
|
+
if (source === 'env')
|
|
703
|
+
return t('sourceEnv');
|
|
704
|
+
if (source === 'file')
|
|
705
|
+
return t('sourceFile');
|
|
706
|
+
return source;
|
|
707
|
+
}
|
|
447
708
|
function LoadedSettings({ controller, t }) {
|
|
448
709
|
const state = (0, react_1.useSyncExternalStore)(controller.subscribe, controller.snapshot, controller.snapshot);
|
|
449
710
|
const snapshot = state.snapshot;
|
|
@@ -465,7 +726,7 @@ function LoadedSettings({ controller, t }) {
|
|
|
465
726
|
const save = () => {
|
|
466
727
|
try {
|
|
467
728
|
setDraftError(undefined);
|
|
468
|
-
void controller.save(valueOf(draft), snapshot.settings.revision);
|
|
729
|
+
void controller.save(valueOf(draft, t), snapshot.settings.revision);
|
|
469
730
|
}
|
|
470
731
|
catch (error) {
|
|
471
732
|
setDraftError(error instanceof Error ? error.message : String(error));
|
|
@@ -473,17 +734,18 @@ function LoadedSettings({ controller, t }) {
|
|
|
473
734
|
};
|
|
474
735
|
const busy = state.action !== undefined;
|
|
475
736
|
const runtimeErrorTitle = snapshot.runtime.ready ? t('runtimeCandidateRejected') : t('runtimeUnavailable');
|
|
476
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "dvt-settings", children: [(0, jsx_runtime_1.jsxs)("header", { className: "dvt-settings-header", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { className: "dvt-kicker", children: "DSH native plugin" }), (0, jsx_runtime_1.jsx)("h2", { children: t('settingsTitle') }), (0, jsx_runtime_1.jsx)("p", { children: t('settingsIntro') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-release", children: [(0, jsx_runtime_1.jsxs)("span", { children: [t('pluginVersion'), " ", (0, jsx_runtime_1.jsx)("strong", { children: snapshot.release.pluginVersion })] }), (0, jsx_runtime_1.jsxs)("span", { children: [t('upstreamVersion'), " ", (0, jsx_runtime_1.jsx)("strong", { children: snapshot.release.upstreamVersion })] }), (0, jsx_runtime_1.jsxs)("span", { children: [t('activeGeneration'), " ", (0, jsx_runtime_1.jsx)("strong", { children: snapshot.runtime.generation })] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "dvt-alert notice", children: t('externalNotice') }), !snapshot.writable ? (0, jsx_runtime_1.jsx)("div", { className: "dvt-alert warning", children: t('readOnly') }) : null, draftError === undefined ? null : (0, jsx_runtime_1.jsx)("div", { className: "dvt-alert error", children: draftError }), state.error === undefined ? null : (0, jsx_runtime_1.jsx)("div", { className: "dvt-alert error", children: state.error }), state.message === 'saved' ? (0, jsx_runtime_1.jsx)("div", { className: "dvt-alert success", children: t('saved') }) : null, snapshot.runtime.lastError === undefined ? null : (0, jsx_runtime_1.jsxs)("div", { className: "dvt-alert error", children: [(0, jsx_runtime_1.jsx)("strong", { children: runtimeErrorTitle }), (0, jsx_runtime_1.jsx)("span", { children: snapshot.runtime.lastError })] }), (0, jsx_runtime_1.jsxs)("section", { className: "dvt-panel", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dvt-panel-title", children: [(0, jsx_runtime_1.jsx)("h3", { children: t('provider') }), (0, jsx_runtime_1.jsx)("span", { className: `dvt-badge ${snapshot.credential.configured ? 'ok' : 'error'}`, children: snapshot.credential.configured ? t('configured') : t('missing') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-form-grid", children: [(0, jsx_runtime_1.jsx)(Field, { label: t('baseUrl'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { value: draft.baseUrl, onChange: (event) => { update('baseUrl', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('model'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { value: draft.model, onChange: (event) => { update('model', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('credential'), hint: snapshot.credential.source === undefined ? undefined : `${t('source')}: ${snapshot.credential.source}`, children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { value: draft.credential, onChange: (event) => { update('credential', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('language'), children: (0, jsx_runtime_1.jsxs)("select", { value: draft.language, onChange: (event) => { update('language', event.target.value); }, children: [(0, jsx_runtime_1.jsx)("option", { value: "zh", children: "\u4E2D\u6587" }), (0, jsx_runtime_1.jsx)("option", { value: "en", children: "English" })] }) })] })] }), (0, jsx_runtime_1.jsxs)("section", { className: "dvt-panel", children: [(0, jsx_runtime_1.jsx)("div", { className: "dvt-panel-title", children: (0, jsx_runtime_1.jsx)("h3", { children: t('limits') }) }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-form-grid", children: [(0, jsx_runtime_1.jsx)(Field, { label: t('timeout'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { inputMode: "numeric", value: draft.timeoutMs, onChange: (event) => { update('timeoutMs', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('maxBytes'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { inputMode: "numeric", value: draft.maxImageBytes, onChange: (event) => { update('maxImageBytes', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('maxPixels'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { inputMode: "numeric", value: draft.maxImagePixels, onChange: (event) => { update('maxImagePixels', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('concurrency'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { inputMode: "numeric", value: draft.concurrency, onChange: (event) => { update('concurrency', event.target.value); } }) })] })] }), (0, jsx_runtime_1.jsxs)("section", { className: "dvt-panel", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dvt-panel-title", children: [(0, jsx_runtime_1.jsx)("h3", { children: t('runtime') }), (0, jsx_runtime_1.jsx)("span", { className: `dvt-badge ${snapshot.runtime.ready ? 'ok' : 'error'}`, children: snapshot.runtime.ready ? snapshot.runtime.upstream?.source ?? 'ready' : t('runtimeUnavailable') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-form-grid", children: [(0, jsx_runtime_1.jsx)(Field, { label: t('runtimeMode'), children: (0, jsx_runtime_1.jsxs)("select", { value: draft.runtimeMode, onChange: (event) => { update('runtimeMode', event.target.value); }, children: [(0, jsx_runtime_1.jsx)("option", { value: "managed", children: "managed" }), (0, jsx_runtime_1.jsx)("option", { value: "external", children: "external" })] }) }), draft.runtimeMode === 'external' ? (0, jsx_runtime_1.jsx)(Field, { label: t('toolkitPath'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { value: draft.toolkitPath, onChange: (event) => { update('toolkitPath', event.target.value); } }) }) : null, (0, jsx_runtime_1.jsx)(Field, { label: t('python'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { placeholder: "python3", value: draft.python, onChange: (event) => { update('python', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('allowedDirs'), hint: t('allowedDirsHint'), children: (0, jsx_runtime_1.jsx)("textarea", { rows: 3, value: draft.allowedDirs, onChange: (event) => { update('allowedDirs', event.target.value); } }) })] }), snapshot.runtime.upstream === undefined ? null : (0, jsx_runtime_1.jsxs)("div", { className: "dvt-runtime-facts", children: [(0, jsx_runtime_1.jsx)("code", { children: snapshot.runtime.upstream.path }), (0, jsx_runtime_1.jsxs)("code", { children: [snapshot.runtime.upstream.python, " \u00B7 ", snapshot.runtime.upstream.pythonVersion] }), (0, jsx_runtime_1.jsx)("code", { children: snapshot.runtime.upstream.runtimeHome })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-save-row", children: [(0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Button, { variant: "primary", disabled: !snapshot.writable || busy, onClick: save, children: state.action === 'save' ? t('saving') : t('save') }), (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Button, { variant: "outline", disabled: busy, onClick: () => { void controller.load(); }, children: t('reload') })] }), (0, jsx_runtime_1.jsxs)("section", { className: "dvt-panel", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dvt-panel-title", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { children: t('health') }), (0, jsx_runtime_1.jsx)("p", { children: t('connectionHint') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-actions", children: [(0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Button, { size: "sm", variant: "outline", disabled: busy || !snapshot.runtime.ready, onClick: () => { void controller.runHealth(false); }, children: state.action === 'health' ? t('testing') : t('runHealth') }), (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Button, { size: "sm", variant: "primary", disabled: busy || !snapshot.runtime.ready, onClick: () => { void controller.runHealth(true); }, children: state.action === 'connection' ? t('testing') : t('testConnection') })] })] }), state.health === undefined ? (0, jsx_runtime_1.jsx)("p", { className: "dvt-muted", children: t('notTested') }) : (0, jsx_runtime_1.jsx)("div", { className: "dvt-health-grid", children: Object.entries(state.health.checks).map(([name, check]) => (0, jsx_runtime_1.jsxs)("div", { "data-status": check.status, children: [(0, jsx_runtime_1.jsx)("span", { children: name }), (0, jsx_runtime_1.jsx)("strong", { children: check.status }), (0, jsx_runtime_1.jsx)("p", { children: check.detail })] }, name)) })] })] }));
|
|
737
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "dvt-settings", children: [(0, jsx_runtime_1.jsx)("div", { className: "dvt-alert notice", children: t('externalNotice') }), !snapshot.writable ? (0, jsx_runtime_1.jsx)("div", { className: "dvt-alert warning", children: t('readOnly') }) : null, draftError === undefined ? null : (0, jsx_runtime_1.jsx)("div", { className: "dvt-alert error", children: draftError }), state.error === undefined ? null : (0, jsx_runtime_1.jsx)("div", { className: "dvt-alert error", children: state.error }), state.message === 'saved' ? (0, jsx_runtime_1.jsx)("div", { className: "dvt-alert success", children: t('saved') }) : null, snapshot.runtime.lastError === undefined ? null : (0, jsx_runtime_1.jsxs)("div", { className: "dvt-alert error", children: [(0, jsx_runtime_1.jsx)("strong", { children: runtimeErrorTitle }), (0, jsx_runtime_1.jsx)("span", { children: snapshot.runtime.lastError })] }), (0, jsx_runtime_1.jsxs)("section", { className: "dvt-panel dvt-essential", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dvt-panel-title", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { children: t('provider') }), (0, jsx_runtime_1.jsx)("p", { children: t('providerHint') })] }), (0, jsx_runtime_1.jsx)("span", { className: `dvt-badge ${snapshot.credential.configured ? 'ok' : 'error'}`, children: snapshot.credential.configured ? t('configured') : t('missing') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-form-grid", children: [(0, jsx_runtime_1.jsx)(Field, { label: t('protocol'), children: (0, jsx_runtime_1.jsxs)("select", { value: draft.protocol, onChange: (event) => { update('protocol', event.target.value); }, children: [(0, jsx_runtime_1.jsx)("option", { value: "openai", children: "OpenAI Chat Completions" }), (0, jsx_runtime_1.jsx)("option", { value: "anthropic", children: "Anthropic Messages" })] }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('baseUrl'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { value: draft.baseUrl, onChange: (event) => { update('baseUrl', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('model'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { value: draft.model, onChange: (event) => { update('model', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('credential'), hint: snapshot.credential.source === undefined ? undefined : t('sourceHint', { source: t('source'), value: credentialSource(snapshot.credential.source, t) }), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { value: draft.credential, onChange: (event) => { update('credential', event.target.value); } }) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-save-row", children: [(0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Button, { variant: "primary", disabled: !snapshot.writable || busy, onClick: save, children: state.action === 'save' ? t('saving') : t('save') }), (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Button, { variant: "outline", disabled: busy, onClick: () => { void controller.load(); }, children: t('reload') })] }), (0, jsx_runtime_1.jsxs)("section", { className: "dvt-panel", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dvt-panel-title", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { children: t('health') }), (0, jsx_runtime_1.jsx)("p", { children: t('connectionHint') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-actions", children: [(0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Button, { size: "sm", variant: "outline", disabled: busy || !snapshot.runtime.ready, onClick: () => { void controller.runHealth(false); }, children: state.action === 'health' ? t('testing') : t('runHealth') }), (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Button, { size: "sm", variant: "primary", disabled: busy || !snapshot.runtime.ready, onClick: () => { void controller.runHealth(true); }, children: state.action === 'connection' ? t('testing') : t('testConnection') })] })] }), (0, jsx_runtime_1.jsx)("p", { className: "dvt-muted", children: t('saveBeforeTesting') }), state.health === undefined ? (0, jsx_runtime_1.jsx)("p", { className: "dvt-muted", children: t('notTested') }) : (0, jsx_runtime_1.jsx)("div", { className: "dvt-health-grid", children: Object.entries(state.health.checks).map(([name, check]) => (0, jsx_runtime_1.jsxs)("div", { "data-status": check.status, children: [(0, jsx_runtime_1.jsx)("span", { children: t(HEALTH_NAME_KEYS[name] ?? 'health') }), (0, jsx_runtime_1.jsx)("strong", { children: t(HEALTH_STATUS_KEYS[check.status]) }), (0, jsx_runtime_1.jsx)("p", { children: healthDetail(name, check.detail, t) })] }, name)) })] }), (0, jsx_runtime_1.jsxs)("details", { className: "dvt-advanced", children: [(0, jsx_runtime_1.jsxs)("summary", { children: [(0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("strong", { children: t('advanced') }), (0, jsx_runtime_1.jsx)("small", { children: t('advancedHint') })] }), (0, jsx_runtime_1.jsx)("span", { className: "dvt-details-chevron", "aria-hidden": "true", children: "\u2304" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-advanced-body", children: [(0, jsx_runtime_1.jsxs)("section", { className: "dvt-panel", children: [(0, jsx_runtime_1.jsx)("div", { className: "dvt-panel-title", children: (0, jsx_runtime_1.jsx)("h3", { children: t('provider') }) }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-form-grid", children: [draft.protocol === 'anthropic' ? (0, jsx_runtime_1.jsx)(Field, { label: t('anthropicThinking'), hint: t('anthropicThinkingHint'), children: (0, jsx_runtime_1.jsxs)("select", { "aria-label": t('anthropicThinking'), value: draft.anthropicThinking, onChange: (event) => { update('anthropicThinking', event.target.value); }, children: [(0, jsx_runtime_1.jsx)("option", { value: "omit", children: "omit (widest compatibility)" }), (0, jsx_runtime_1.jsx)("option", { value: "disabled", children: "disabled (model support required)" }), (0, jsx_runtime_1.jsx)("option", { value: "adaptive", children: "adaptive (model support required)" })] }) }) : null, (0, jsx_runtime_1.jsx)(Field, { label: t('userAgent'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { value: draft.userAgent, onChange: (event) => { update('userAgent', event.target.value); } }) })] })] }), (0, jsx_runtime_1.jsxs)("section", { className: "dvt-panel", children: [(0, jsx_runtime_1.jsx)("div", { className: "dvt-panel-title", children: (0, jsx_runtime_1.jsx)("h3", { children: t('limits') }) }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-form-grid", children: [(0, jsx_runtime_1.jsx)(Field, { label: t('language'), children: (0, jsx_runtime_1.jsxs)("select", { value: draft.language, onChange: (event) => { update('language', event.target.value); }, children: [(0, jsx_runtime_1.jsx)("option", { value: "zh", children: "\u4E2D\u6587" }), (0, jsx_runtime_1.jsx)("option", { value: "en", children: "English" })] }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('timeout'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { inputMode: "numeric", value: draft.timeoutMs, onChange: (event) => { update('timeoutMs', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('maxBytes'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { inputMode: "numeric", value: draft.maxImageBytes, onChange: (event) => { update('maxImageBytes', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('maxPixels'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { inputMode: "numeric", value: draft.maxImagePixels, onChange: (event) => { update('maxImagePixels', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('concurrency'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { inputMode: "numeric", value: draft.concurrency, onChange: (event) => { update('concurrency', event.target.value); } }) })] })] }), (0, jsx_runtime_1.jsxs)("section", { className: "dvt-panel", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dvt-panel-title", children: [(0, jsx_runtime_1.jsx)("h3", { children: t('runtime') }), (0, jsx_runtime_1.jsx)("span", { className: `dvt-badge ${snapshot.runtime.ready ? 'ok' : 'error'}`, children: snapshot.runtime.ready ? snapshot.runtime.upstream?.source === 'managed' ? t('runtimeManaged') : snapshot.runtime.upstream?.source === 'external' ? t('runtimeExternal') : t('runtimeReady') : t('runtimeUnavailable') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-form-grid", children: [(0, jsx_runtime_1.jsx)(Field, { label: t('runtimeMode'), children: (0, jsx_runtime_1.jsxs)("select", { value: draft.runtimeMode, onChange: (event) => { update('runtimeMode', event.target.value); }, children: [(0, jsx_runtime_1.jsx)("option", { value: "managed", children: t('runtimeManaged') }), (0, jsx_runtime_1.jsx)("option", { value: "external", children: t('runtimeExternal') })] }) }), draft.runtimeMode === 'external' ? (0, jsx_runtime_1.jsx)(Field, { label: t('toolkitPath'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { value: draft.toolkitPath, onChange: (event) => { update('toolkitPath', event.target.value); } }) }) : null, (0, jsx_runtime_1.jsx)(Field, { label: t('python'), children: (0, jsx_runtime_1.jsx)(dsh_client_ui_primitives_1.Input, { placeholder: "python3", value: draft.python, onChange: (event) => { update('python', event.target.value); } }) }), (0, jsx_runtime_1.jsx)(Field, { label: t('allowedDirs'), hint: t('allowedDirsHint'), children: (0, jsx_runtime_1.jsx)("textarea", { rows: 3, value: draft.allowedDirs, onChange: (event) => { update('allowedDirs', event.target.value); } }) })] }), snapshot.runtime.upstream === undefined ? null : (0, jsx_runtime_1.jsxs)("div", { className: "dvt-runtime-facts", children: [(0, jsx_runtime_1.jsx)("code", { children: snapshot.runtime.upstream.path }), (0, jsx_runtime_1.jsxs)("code", { children: [snapshot.runtime.upstream.python, " \u00B7 ", snapshot.runtime.upstream.pythonVersion] }), (0, jsx_runtime_1.jsx)("code", { children: snapshot.runtime.upstream.runtimeHome })] })] })] })] }), (0, jsx_runtime_1.jsxs)("footer", { className: "dvt-settings-footer", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { className: "dvt-kicker", children: t('pluginKind') }), (0, jsx_runtime_1.jsx)("h2", { children: t('settingsTitle') }), (0, jsx_runtime_1.jsx)("p", { children: t('settingsIntro') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dvt-release", children: [(0, jsx_runtime_1.jsxs)("span", { children: [t('pluginVersion'), " ", (0, jsx_runtime_1.jsx)("strong", { children: snapshot.release.pluginVersion })] }), (0, jsx_runtime_1.jsxs)("span", { children: [t('upstreamVersion'), " ", (0, jsx_runtime_1.jsx)("strong", { children: snapshot.release.upstreamVersion })] }), (0, jsx_runtime_1.jsxs)("span", { children: [t('activeGeneration'), " ", (0, jsx_runtime_1.jsx)("strong", { children: t('activeGenerationValue', { generation: snapshot.runtime.generation }) })] })] })] })] }));
|
|
477
738
|
}
|
|
478
739
|
const CSS = `
|
|
479
740
|
.dvt-tool{margin:4px 0;border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-1);overflow:hidden;box-shadow:var(--dsw-shadow-lv1)}
|
|
480
741
|
.dvt-tool-head{width:100%;min-height:38px;display:flex;align-items:center;gap:7px;padding:8px 10px;border:0;background:transparent;color:inherit;text-align:left;cursor:pointer;font:inherit}.dvt-tool-head:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}.dvt-tool-icon{width:20px;height:20px;display:grid;place-items:center;border-radius:6px;color:var(--dsw-alias-state-business-primary);background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 12%,transparent);flex:none}.dvt-tool-title{font-size:12px;font-weight:650;white-space:nowrap}.dvt-tool-sep{opacity:.35}.dvt-tool-summary{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--dsw-alias-label-secondary)}.dvt-tool-status{margin-left:auto;font-size:11px;color:var(--dsw-alias-label-secondary);max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dvt-tool[data-state=error] .dvt-tool-status{color:var(--dsw-alias-state-error-primary)}.dvt-chevron{margin-left:auto;transition:transform .16s ease;opacity:.55}.dvt-chevron[data-open=true]{transform:rotate(180deg)}.dvt-tool-body{padding:0 10px 10px}.dvt-stack{display:grid;gap:10px}.dvt-muted{margin:0;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.5}
|
|
481
742
|
.dvt-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.dvt-metrics>div,.dvt-diff-score{padding:10px;border-radius:9px;background:var(--dsw-alias-bg-layer-2);display:grid;gap:4px}.dvt-metrics span,.dvt-diff-score span{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--dsw-alias-label-secondary)}.dvt-metrics strong,.dvt-diff-score strong{font-size:13px}.dvt-list{list-style:none;margin:0;padding:0;display:grid;gap:4px;max-height:160px;overflow:auto}.dvt-list li{display:flex;justify-content:space-between;gap:12px;padding:6px 8px;border-radius:7px;background:var(--dsw-alias-bg-layer-2);font-size:11px}.dvt-list code{color:var(--dsw-alias-state-business-primary)}.dvt-table-wrap{max-height:220px;overflow:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:9px}.dvt-table{width:100%;border-collapse:collapse;font-size:11px}.dvt-table th,.dvt-table td{padding:7px 8px;text-align:left;border-bottom:1px solid var(--dsw-alias-border-l1)}.dvt-table th{position:sticky;top:0;background:var(--dsw-alias-bg-layer-2);font-size:10px;text-transform:uppercase;letter-spacing:.05em}.dvt-table tr:last-child td{border-bottom:0}
|
|
482
743
|
.dvt-artifact{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;overflow:hidden;background:var(--dsw-alias-bg-layer-1)}.dvt-preview{display:block;width:100%;max-height:360px;object-fit:contain;background:repeating-conic-gradient(var(--dsw-alias-bg-module-platform) 0 25%,var(--dsw-alias-bg-layer-1) 0 50%) 50%/18px 18px;border:0}.dvt-svg{height:280px}.dvt-artifact-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px}.dvt-artifact-meta>div:first-child{min-width:0;display:grid;gap:2px}.dvt-artifact-meta strong{font-size:12px;overflow:hidden;text-overflow:ellipsis}.dvt-artifact-meta span,.dvt-artifact-meta small{font-size:10px;color:var(--dsw-alias-label-secondary)}.dvt-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.dvt-download{display:inline-flex;align-items:center;height:28px;padding:0 12px;border-radius:999px;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);text-decoration:none;font-size:12px;font-weight:600}.dvt-download:hover{background:var(--dsw-alias-button-primary-hover)}.dvt-download:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.dvt-artifact>.dvt-muted{padding:0 10px 10px}.dvt-diff-score>div{height:5px;border-radius:99px;background:var(--dsw-alias-border-l2);overflow:hidden}.dvt-diff-score i{display:block;height:100%;min-width:2px;background:linear-gradient(90deg,var(--dsw-alias-state-warn-primary),var(--dsw-alias-state-error-primary));border-radius:99px}.dvt-tool h4{font-size:11px;margin:0 0 6px}.dvt-palette{display:grid;grid-template-columns:repeat(auto-fit,minmax(112px,1fr));gap:7px}.dvt-palette>div{display:flex;align-items:center;gap:8px;padding:7px;border:1px solid var(--dsw-alias-border-l1);border-radius:9px}.dvt-palette i{width:28px;height:28px;border-radius:7px;box-shadow:inset 0 0 0 1px var(--dsw-alias-border-l2)}.dvt-palette span{display:grid}.dvt-palette strong{font-size:11px}.dvt-palette small{font-size:10px;color:var(--dsw-alias-label-secondary)}
|
|
483
|
-
.dvt-settings{display:grid;gap:14px;max-width:900px;padding:8px 2px 32px;color:var(--dsw-alias-label-primary)}.dvt-settings-
|
|
744
|
+
.dvt-settings{display:grid;gap:14px;max-width:900px;padding:8px 2px 32px;color:var(--dsw-alias-label-primary)}.dvt-settings-footer{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;padding:8px 2px}.dvt-settings-footer h2{font-size:25px;letter-spacing:-.025em;margin:3px 0 6px}.dvt-settings-footer p{max-width:620px;margin:0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.55}.dvt-kicker{font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:var(--dsw-alias-state-business-primary);font-weight:700}.dvt-release{display:grid;gap:4px;min-width:170px;padding:9px 11px;border-radius:10px;background:var(--dsw-alias-bg-layer-2);font-size:10px;color:var(--dsw-alias-label-secondary)}.dvt-release span{display:flex;justify-content:space-between;gap:12px}.dvt-release strong{color:var(--dsw-alias-label-primary)}.dvt-alert{padding:10px 12px;border-radius:10px;font-size:12px;line-height:1.5;display:grid;gap:3px}.dvt-alert.notice{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 10%,transparent);color:var(--dsw-alias-state-business-primary)}.dvt-alert.warning{background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 12%,transparent);color:var(--dsw-alias-state-warn-label)}.dvt-alert.error{background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);color:var(--dsw-alias-state-error-primary)}.dvt-alert.success{background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 10%,transparent);color:var(--dsw-alias-state-success-primary)}.dvt-panel{display:grid;gap:12px;padding:15px;border:1px solid var(--dsw-alias-border-l1);border-radius:14px;background:var(--dsw-alias-bg-layer-1);box-shadow:var(--dsw-shadow-lv1)}.dvt-panel-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.dvt-panel-title h3{font-size:14px;margin:0}.dvt-panel-title p{font-size:11px;line-height:1.45;color:var(--dsw-alias-label-secondary);margin:4px 0 0;max-width:620px}.dvt-badge{font-size:10px;padding:3px 7px;border-radius:999px;font-weight:650}.dvt-badge.ok{background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 12%,transparent);color:var(--dsw-alias-state-success-primary)}.dvt-badge.error{background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);color:var(--dsw-alias-state-error-primary)}.dvt-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.dvt-field{display:grid;gap:6px;align-content:start}.dvt-field>span{font-size:11px;font-weight:600}.dvt-field>small{font-size:10px;color:var(--dsw-alias-label-secondary);line-height:1.4}.dvt-field select,.dvt-field textarea{width:100%;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;padding:8px 10px}.dvt-field select{height:36px}.dvt-field textarea{resize:vertical;min-height:76px}.dvt-runtime-facts{display:grid;gap:4px;padding:9px 10px;border-radius:9px;background:var(--dsw-alias-bg-layer-2);overflow:auto}.dvt-runtime-facts code{font-size:10px;white-space:nowrap;color:var(--dsw-alias-label-secondary)}.dvt-save-row{display:flex;gap:8px;padding:2px 0}
|
|
745
|
+
.dvt-settings-footer{margin-top:8px;padding:20px 2px 4px;border-top:1px solid var(--dsw-alias-border-l1);opacity:.82}.dvt-settings-footer h2{font-size:18px;letter-spacing:-.015em;margin:3px 0 5px}.dvt-settings-footer p{font-size:11px;line-height:1.5}.dvt-release{min-width:220px}.dvt-release span{white-space:nowrap}.dvt-essential{border-color:color-mix(in srgb,var(--dsw-alias-state-business-primary) 30%,var(--dsw-alias-border-l1));box-shadow:var(--dsw-shadow-lv1),0 0 0 3px color-mix(in srgb,var(--dsw-alias-state-business-primary) 5%,transparent)}.dvt-advanced{border:1px solid var(--dsw-alias-border-l1);border-radius:14px;background:var(--dsw-alias-bg-layer-1);overflow:hidden}.dvt-advanced>summary{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 15px;cursor:pointer;list-style:none}.dvt-advanced>summary::-webkit-details-marker{display:none}.dvt-advanced>summary>span:first-child{display:grid;gap:3px}.dvt-advanced>summary strong{font-size:13px}.dvt-advanced>summary small{font-size:10px;line-height:1.45;color:var(--dsw-alias-label-secondary);font-weight:400}.dvt-details-chevron{font-size:15px;opacity:.55;transition:transform .16s ease}.dvt-advanced[open] .dvt-details-chevron{transform:rotate(180deg)}.dvt-advanced-body{display:grid;gap:12px;padding:0 12px 12px}.dvt-advanced-body>.dvt-panel{box-shadow:none}
|
|
484
746
|
.dvt-health-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}.dvt-health-grid>div{padding:9px 10px;border-radius:9px;background:var(--dsw-alias-bg-layer-2);border-left:3px solid var(--dsw-alias-border-l4)}.dvt-health-grid>div[data-status=ok]{border-left-color:var(--dsw-alias-state-success-primary)}.dvt-health-grid>div[data-status=warning],.dvt-health-grid>div[data-status=not_tested]{border-left-color:var(--dsw-alias-state-warn-primary)}.dvt-health-grid>div[data-status=error]{border-left-color:var(--dsw-alias-state-error-primary)}.dvt-health-grid span{font-size:10px;text-transform:capitalize}.dvt-health-grid strong{float:right;font-size:9px;text-transform:uppercase;color:var(--dsw-alias-label-secondary)}.dvt-health-grid p{clear:both;margin:5px 0 0;font-size:10px;line-height:1.4;color:var(--dsw-alias-label-secondary)}.dvt-loading{padding:24px;border-radius:12px;background:var(--dsw-alias-bg-layer-2);font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
485
747
|
.dvt-paste-dock{box-sizing:border-box;width:calc(100% - 32px);max-width:var(--dsh-composer-card-max-width,960px);margin:0 auto;display:flex;flex-wrap:wrap;gap:6px;padding:0 2px 6px}.dvt-paste-chip{max-width:100%;height:32px;box-sizing:border-box;display:flex;align-items:center;gap:7px;padding:0 6px 0 10px;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;background:var(--dsw-specific-tip);font-size:12px}.dvt-paste-chip[data-status=copying]{border-color:var(--dsw-alias-state-business-primary)}.dvt-paste-chip[data-status=error]{border-color:var(--dsw-alias-state-error-primary)}.dvt-paste-name{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dvt-paste-detail{color:var(--dsw-alias-label-caption);max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dvt-paste-chip[data-status=error] .dvt-paste-detail{color:var(--dsw-alias-state-error-primary)}.dvt-paste-chip button{width:20px;height:20px;display:grid;place-items:center;border:0;border-radius:50%;padding:0;background:transparent;color:var(--dsw-alias-label-caption);font:inherit;font-size:16px;cursor:pointer}.dvt-paste-chip button:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.dvt-paste-chip button:disabled{opacity:.4;cursor:default}
|
|
486
|
-
@media(max-width:720px){.dvt-settings-
|
|
748
|
+
@media(max-width:720px){.dvt-settings-footer{display:grid}.dvt-release{width:auto}.dvt-form-grid{grid-template-columns:1fr}.dvt-metrics{grid-template-columns:1fr}.dvt-artifact-meta{align-items:flex-start;flex-direction:column}.dvt-panel-title{flex-direction:column}}
|
|
487
749
|
`;
|
|
488
750
|
function installStyles() {
|
|
489
751
|
const id = '@anionex/dsh-vision-toolkit/client';
|