@foggy-projects/deepseek-harness-plugin 0.4.2-rc.3 → 0.4.4-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +222 -173
- package/THIRD-PARTY-RUNTIME-NOTICES.md +16 -16
- package/cordis.patch.yml +6 -6
- package/docs/COMMUNITY-MARKETPLACES.md +64 -64
- package/docs/PUBLIC-BETA-READINESS.md +109 -109
- package/docs/RELEASE-CANDIDATE-0.4.0-RC.2.md +38 -38
- package/docs/RELEASE-CANDIDATE-0.4.0-RC.3.md +18 -18
- package/docs/RELEASE-CANDIDATE-0.4.1-DSH-0.1.5-RC.1.md +60 -60
- package/docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.1.md +62 -62
- package/docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.2.md +50 -50
- package/docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.3.md +34 -34
- package/docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.4.md +32 -0
- package/docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.5.md +27 -0
- package/docs/RELEASE-CANDIDATE-0.4.3-DSH-0.2.0-RC.1.md +96 -0
- package/docs/RELEASE-CANDIDATE-0.4.4-DSH-0.2.1-RC.1.md +135 -0
- package/docs/WINDOWS-BETA-ACCEPTANCE.md +113 -113
- package/experience/linux/README.md +53 -53
- package/experience/linux/prepare.sh +2 -2
- package/lib/atomic-json.js +41 -41
- package/lib/client.js +1222 -906
- package/lib/component-manager.js +164 -0
- package/lib/component-releases.js +363 -0
- package/lib/diagnostics.js +86 -86
- package/lib/index.js +764 -698
- package/lib/operation-lock.js +139 -0
- package/lib/python-runtime.js +339 -339
- package/lib/query-tool.js +134 -104
- package/lib/remote-descriptor.js +74 -59
- package/lib/remote.js +8 -8
- package/lib/runtime-settings.js +89 -89
- package/lib/skill-provider.js +116 -116
- package/lib/typert.js +9 -9
- package/lib/version.js +20 -20
- package/lib/viewer-preview.js +44 -27
- package/package.json +25 -15
- package/skills/foggy-deepseek-onboarding/SKILL.md +149 -143
- package/skills/foggy-deepseek-onboarding/assets/connection.schema.json +48 -48
- package/skills/foggy-deepseek-onboarding/assets/datasource.example.json +14 -14
- package/skills/foggy-deepseek-onboarding/assets/env.example +14 -14
- package/skills/foggy-deepseek-onboarding/assets/onboarding-state.schema.json +71 -71
- package/skills/foggy-deepseek-onboarding/assets/semantic-plan.example.json +8 -8
- package/skills/foggy-deepseek-onboarding/assets/semantic-plan.schema.json +21 -21
- package/skills/foggy-deepseek-onboarding/assets/versions.json +23 -23
- package/skills/foggy-deepseek-onboarding/references/onboarding-workflow.md +168 -168
- package/skills/foggy-deepseek-onboarding/scripts/doctor.ps1 +4 -4
- package/skills/foggy-deepseek-onboarding/scripts/install.ps1 +4 -4
- package/skills/foggy-deepseek-onboarding/scripts/invoke-onboarding.ps1 +32 -32
- package/skills/foggy-deepseek-onboarding/scripts/onboard.ps1 +4 -4
- package/skills/foggy-deepseek-onboarding/scripts/onboarding.py +3721 -3681
- package/skills/foggy-deepseek-onboarding/scripts/runtime-start.ps1 +4 -4
- package/skills/foggy-deepseek-onboarding/scripts/runtime-stop.ps1 +4 -4
- package/skills/foggy-deepseek-onboarding/scripts/uninstall.ps1 +4 -4
package/lib/client.js
CHANGED
|
@@ -1,906 +1,1222 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({
|
|
2
|
-
id: '@foggy-projects/deepseek-harness-plugin',
|
|
3
|
-
factory: (require) => {
|
|
4
|
-
const module = { exports: {} }
|
|
5
|
-
const exports = module.exports
|
|
6
|
-
const { jsx, jsxs } = require('react/jsx-runtime')
|
|
7
|
-
const { useCallback, useEffect, useState } = require('react')
|
|
8
|
-
|
|
9
|
-
const NS = 'settings.foggy'
|
|
10
|
-
const passthroughSchema = { parse: (value) => value }
|
|
11
|
-
const runtimeSettingsInputSchema = {
|
|
12
|
-
parse: (value) => {
|
|
13
|
-
const port = value?.port
|
|
14
|
-
if (!Number.isInteger(port) || port < 1024 || port > 65535 || Object.keys(value || {}).some((key) => key !== 'port')) {
|
|
15
|
-
throw new Error('Runtime port must be an integer between 1024 and 65535')
|
|
16
|
-
}
|
|
17
|
-
return { port }
|
|
18
|
-
},
|
|
19
|
-
}
|
|
20
|
-
const viewerPreviewInputSchema = {
|
|
21
|
-
parse: (value) => {
|
|
22
|
-
if (!value || typeof value.model !== 'string' || typeof value.namespace !== 'string'
|
|
23
|
-
|| !value.payload || typeof value.payload !== 'object' || Array.isArray(value.payload)) {
|
|
24
|
-
throw new Error('Invalid DataViewer preview request')
|
|
25
|
-
}
|
|
26
|
-
return value
|
|
27
|
-
},
|
|
28
|
-
}
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
descriptor('
|
|
63
|
-
name: 'input', wire: 'input', source: 'json',
|
|
64
|
-
codec: {
|
|
65
|
-
mode: 'strict',
|
|
66
|
-
typeSymbol: '@foggy-projects/deepseek-harness-plugin#
|
|
67
|
-
schema:
|
|
68
|
-
create: () =>
|
|
69
|
-
},
|
|
70
|
-
}]),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
]
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
jsxs('div', { children: [
|
|
503
|
-
jsx('
|
|
504
|
-
jsx('
|
|
505
|
-
] }),
|
|
506
|
-
jsx('
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
]
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
const
|
|
659
|
-
const
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
: ''
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
const
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
]
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
jsx('
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
] }),
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
const
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
})
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: '@foggy-projects/deepseek-harness-plugin',
|
|
3
|
+
factory: (require) => {
|
|
4
|
+
const module = { exports: {} }
|
|
5
|
+
const exports = module.exports
|
|
6
|
+
const { jsx, jsxs } = require('react/jsx-runtime')
|
|
7
|
+
const { useCallback, useEffect, useState } = require('react')
|
|
8
|
+
|
|
9
|
+
const NS = 'settings.foggy'
|
|
10
|
+
const passthroughSchema = { parse: (value) => value }
|
|
11
|
+
const runtimeSettingsInputSchema = {
|
|
12
|
+
parse: (value) => {
|
|
13
|
+
const port = value?.port
|
|
14
|
+
if (!Number.isInteger(port) || port < 1024 || port > 65535 || Object.keys(value || {}).some((key) => key !== 'port')) {
|
|
15
|
+
throw new Error('Runtime port must be an integer between 1024 and 65535')
|
|
16
|
+
}
|
|
17
|
+
return { port }
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
const viewerPreviewInputSchema = {
|
|
21
|
+
parse: (value) => {
|
|
22
|
+
if (!value || typeof value.model !== 'string' || typeof value.namespace !== 'string'
|
|
23
|
+
|| !value.payload || typeof value.payload !== 'object' || Array.isArray(value.payload)) {
|
|
24
|
+
throw new Error('Invalid DataViewer preview request')
|
|
25
|
+
}
|
|
26
|
+
return value
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
const componentVersionInputSchema = {
|
|
30
|
+
parse: (value) => {
|
|
31
|
+
if (!value || !['launcher', 'cli'].includes(value.component)
|
|
32
|
+
|| typeof value.version !== 'string' || !/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(value.version)
|
|
33
|
+
|| Object.keys(value).some((key) => !['component', 'version'].includes(key))) {
|
|
34
|
+
throw new Error('Select an official Launcher or CLI version')
|
|
35
|
+
}
|
|
36
|
+
return { component: value.component, version: value.version }
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
const descriptor = (method, parameters = []) => ({
|
|
40
|
+
id: `@foggy-projects/deepseek-harness-plugin#foggyIntegration/${method}`,
|
|
41
|
+
service: 'foggyIntegration',
|
|
42
|
+
namespace: 'foggyIntegration',
|
|
43
|
+
method,
|
|
44
|
+
invocation: { kind: 'direct' },
|
|
45
|
+
parameters,
|
|
46
|
+
result: {
|
|
47
|
+
mode: 'strict',
|
|
48
|
+
typeSymbol: '@foggy-projects/deepseek-harness-plugin#FoggyIntegrationResult',
|
|
49
|
+
schema: passthroughSchema,
|
|
50
|
+
create: () => passthroughSchema,
|
|
51
|
+
},
|
|
52
|
+
sourceLocation: { file: 'lib/index.js', line: 1, column: 1 },
|
|
53
|
+
})
|
|
54
|
+
const TYPERT_REMOTE = {
|
|
55
|
+
package: '@foggy-projects/deepseek-harness-plugin',
|
|
56
|
+
descriptors: [
|
|
57
|
+
...[
|
|
58
|
+
'status', 'plan', 'initialize', 'initializeAndStart', 'repair', 'updateComponents', 'repairPython', 'repairCli', 'repairLauncher', 'repairAnalysisSkill', 'repairSemanticQuerySkill',
|
|
59
|
+
'migrateProfiles', 'diagnostics', 'runtimeStart', 'runtimeStop',
|
|
60
|
+
'componentVersions', 'checkComponentVersions',
|
|
61
|
+
].map((method) => descriptor(method)),
|
|
62
|
+
descriptor('useComponentVersion', [{
|
|
63
|
+
name: 'input', wire: 'input', source: 'json',
|
|
64
|
+
codec: {
|
|
65
|
+
mode: 'strict',
|
|
66
|
+
typeSymbol: '@foggy-projects/deepseek-harness-plugin#FoggyComponentVersionInput',
|
|
67
|
+
schema: componentVersionInputSchema,
|
|
68
|
+
create: () => componentVersionInputSchema,
|
|
69
|
+
},
|
|
70
|
+
}]),
|
|
71
|
+
descriptor('saveRuntimeSettings', [{
|
|
72
|
+
name: 'input',
|
|
73
|
+
wire: 'input',
|
|
74
|
+
source: 'json',
|
|
75
|
+
codec: {
|
|
76
|
+
mode: 'strict',
|
|
77
|
+
typeSymbol: '@foggy-projects/deepseek-harness-plugin#FoggyRuntimeSettingsInput',
|
|
78
|
+
schema: runtimeSettingsInputSchema,
|
|
79
|
+
create: () => runtimeSettingsInputSchema,
|
|
80
|
+
},
|
|
81
|
+
}]),
|
|
82
|
+
descriptor('createViewerPreview', [{
|
|
83
|
+
name: 'input', wire: 'input', source: 'json',
|
|
84
|
+
codec: {
|
|
85
|
+
mode: 'strict',
|
|
86
|
+
typeSymbol: '@foggy-projects/deepseek-harness-plugin#FoggyViewerPreviewInput',
|
|
87
|
+
schema: viewerPreviewInputSchema,
|
|
88
|
+
create: () => viewerPreviewInputSchema,
|
|
89
|
+
},
|
|
90
|
+
}]),
|
|
91
|
+
],
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const zh = {
|
|
95
|
+
tab: 'Foggy 数据分析',
|
|
96
|
+
title: 'Foggy Java 数据分析引擎',
|
|
97
|
+
intro: '在 DeepSeek Harness 内管理 Foggy 私有 Python、CLI、Launcher、Skills 和本地 Runtime。自动检查官方组件版本,由你选择下载并使用。',
|
|
98
|
+
refresh: '刷新状态',
|
|
99
|
+
loading: '正在读取 Foggy 状态…',
|
|
100
|
+
failed: '暂时无法读取 Foggy 状态。',
|
|
101
|
+
retry: '重试',
|
|
102
|
+
notInstalled: '尚未初始化',
|
|
103
|
+
degraded: '需要修复',
|
|
104
|
+
ready: '已就绪',
|
|
105
|
+
running: 'Runtime 运行中',
|
|
106
|
+
cli: 'CLI',
|
|
107
|
+
launcher: 'Launcher',
|
|
108
|
+
analysisSkill: '分析 Skill',
|
|
109
|
+
semanticQuerySkill: '语义查询 Skill',
|
|
110
|
+
onboardingSkill: '引导 Skill',
|
|
111
|
+
skillRegistry: 'DSH Skill 注册',
|
|
112
|
+
python: 'Python',
|
|
113
|
+
java: 'Java',
|
|
114
|
+
installed: '已安装',
|
|
115
|
+
missing: '未安装',
|
|
116
|
+
upToDate: '已就绪',
|
|
117
|
+
updateAvailable: '有更新',
|
|
118
|
+
installedVersion: '当前版本',
|
|
119
|
+
targetVersion: '目标版本',
|
|
120
|
+
componentVersionsTitle: 'Launcher / CLI 版本',
|
|
121
|
+
componentVersionsHint: '自动检查官方发布。选择版本后手动下载并使用,已下载版本可再次选择以回退。',
|
|
122
|
+
componentVersionsCheck: '检查新版本',
|
|
123
|
+
componentVersionsChecking: '正在检查官方版本…',
|
|
124
|
+
componentVersionsChecked: '上次检查',
|
|
125
|
+
componentVersionsOffline: '暂时无法检查新版本。已保留缓存列表和本地版本。',
|
|
126
|
+
componentVersionsCached: '当前显示缓存的版本信息。',
|
|
127
|
+
componentVersionsEmpty: '暂无官方版本信息,请稍后重试。',
|
|
128
|
+
componentVersionsDetails: '查看检查详情',
|
|
129
|
+
componentVersionsWarning: '组件版本记录有提示,请查看详情。',
|
|
130
|
+
componentLatest: '上游最新',
|
|
131
|
+
componentBundled: '插件验证版',
|
|
132
|
+
componentChoose: '选择版本',
|
|
133
|
+
componentPrerelease: '预发布',
|
|
134
|
+
componentDownloaded: '已下载',
|
|
135
|
+
componentCurrent: '正在使用',
|
|
136
|
+
componentDownloadUse: '下载并使用',
|
|
137
|
+
componentUse: '使用此版本',
|
|
138
|
+
componentVersionUpdating: '更新组件版本',
|
|
139
|
+
componentVersionComplete: '组件版本已更新',
|
|
140
|
+
componentReleaseNotes: '发布说明',
|
|
141
|
+
componentInitializeFirst: '请先初始化 Foggy,再选择其他组件版本。',
|
|
142
|
+
componentStopFirst: '请先停止 Runtime,再下载或切换组件版本。',
|
|
143
|
+
componentUnavailable: '此版本不满足当前插件的安装要求。',
|
|
144
|
+
available: '可用',
|
|
145
|
+
unavailable: '不可用',
|
|
146
|
+
initialize: '初始化 Foggy',
|
|
147
|
+
initializeAndStart: '初始化并启动',
|
|
148
|
+
initializeAndStartDone: 'Foggy 已初始化,Runtime 已启动。',
|
|
149
|
+
updateComponents: '更新组件',
|
|
150
|
+
updateAndStart: '更新并启动',
|
|
151
|
+
updateAndStartDone: '组件已更新,Runtime 已启动。',
|
|
152
|
+
repair: '修复组件',
|
|
153
|
+
repairTitle: '高级修复',
|
|
154
|
+
repairPython: '检查 / 修复私有 Python',
|
|
155
|
+
repairCli: '检查 / 修复 CLI',
|
|
156
|
+
repairLauncher: '检查 / 修复 Launcher',
|
|
157
|
+
repairAnalysisSkill: '检查 / 修复分析 Skill',
|
|
158
|
+
repairSemanticQuerySkill: '检查 / 修复语义查询 Skill',
|
|
159
|
+
diagnostics: '导出诊断报告',
|
|
160
|
+
diagnosticsSaved: '诊断报告已保存',
|
|
161
|
+
start: '启动 Runtime',
|
|
162
|
+
stop: '停止 Runtime',
|
|
163
|
+
updateBlockedRunning: 'Runtime 运行中,停止后才能更新组件。',
|
|
164
|
+
updateReady: '检测到组件更新;可点击“更新并启动”一次完成更新。',
|
|
165
|
+
updateNone: '所有托管组件均为当前版本。',
|
|
166
|
+
operationTimeout: '操作等待超时,请刷新状态或导出诊断报告。',
|
|
167
|
+
resourceTitle: '文档与项目',
|
|
168
|
+
tutorial: '教程',
|
|
169
|
+
docs: '使用文档',
|
|
170
|
+
project: '插件项目',
|
|
171
|
+
releases: '版本记录',
|
|
172
|
+
runtimeProject: 'Runtime 项目',
|
|
173
|
+
openExternal: '在新标签页打开',
|
|
174
|
+
working: '操作进行中…',
|
|
175
|
+
progressWorking: '正在初始化 Foggy…',
|
|
176
|
+
progressPreflight: '检查运行环境',
|
|
177
|
+
progressPython: '准备私有 Python',
|
|
178
|
+
progressCli: '准备 CLI',
|
|
179
|
+
progressLauncher: '准备 Launcher',
|
|
180
|
+
progressAnalysis: '准备分析 Skill',
|
|
181
|
+
progressSemanticQuery: '准备语义查询 Skill',
|
|
182
|
+
progressSkills: '注册 DSH Skills',
|
|
183
|
+
progressState: '写入安装状态',
|
|
184
|
+
progressComplete: '初始化完成',
|
|
185
|
+
progressRuntimePreflight: '检查 Runtime 状态',
|
|
186
|
+
progressRuntimeLauncher: '启动 Java Launcher',
|
|
187
|
+
progressRuntimeReadiness: '等待 Runtime 就绪',
|
|
188
|
+
progressRuntimeCapabilities: '验证 Runtime 能力',
|
|
189
|
+
progressRuntimeState: '保存 Runtime 状态',
|
|
190
|
+
progressRuntimeComplete: 'Runtime 已就绪',
|
|
191
|
+
progressFiles: '文件',
|
|
192
|
+
progressElapsed: '已等待',
|
|
193
|
+
progressTimeout: '最长',
|
|
194
|
+
progressSeconds: '秒',
|
|
195
|
+
managedPrivate: 'Foggy 私有',
|
|
196
|
+
configuredOverride: '外部指定',
|
|
197
|
+
accepted: '操作已开始;页面会自动刷新状态。',
|
|
198
|
+
actionFailed: '操作失败',
|
|
199
|
+
roots: '本地目录',
|
|
200
|
+
installRoot: '组件目录',
|
|
201
|
+
dataRoot: '数据目录',
|
|
202
|
+
profileStore: 'CLI Profile',
|
|
203
|
+
profileMigrationTitle: '旧 Profile 迁移',
|
|
204
|
+
profileMigrationPending: '检测到旧版临时 Profile。迁移只转移连接元数据和密码环境变量引用,不复制密码值。',
|
|
205
|
+
profileMigrationConflict: '旧 Profile 存在冲突或格式问题,请先导出诊断报告。',
|
|
206
|
+
migrateProfiles: '迁移到持久目录',
|
|
207
|
+
onboardingProgress: '数据库与语义层进度',
|
|
208
|
+
noOnboarding: '尚无数据库引导记录;请在对话中调用 Foggy onboarding Skill。',
|
|
209
|
+
projectRoot: '工作区',
|
|
210
|
+
resumeInChat: '未完成步骤应回到对应工作区,在对话中继续。',
|
|
211
|
+
queryWarningTitle: '查询输入已自动兼容',
|
|
212
|
+
queryWarningSummary: 'Runtime 在 WARN 模式下忽略了未知的查询属性,查询仍已执行。请检查告警代码与证据后决定是否修正模型或请求。',
|
|
213
|
+
queryWarningCodes: '告警代码',
|
|
214
|
+
queryWarningEvidence: '证据目录',
|
|
215
|
+
queryCardTitle: 'Foggy DSL 查询',
|
|
216
|
+
queryCardRunning: '正在校验并执行…',
|
|
217
|
+
queryCardDone: '校验与查询成功',
|
|
218
|
+
queryCardFailed: '查询失败;可展开查看错误',
|
|
219
|
+
queryCardRows: '返回行数',
|
|
220
|
+
queryCardDetails: '查看 DSL 与执行结果',
|
|
221
|
+
queryCardOpen: '查看数据',
|
|
222
|
+
queryCardOpening: '正在生成预览链接…',
|
|
223
|
+
queryCardPreviewHint: '每次点击都会生成新的预览链接。',
|
|
224
|
+
queryCardLocalDevelopment: '本地开发预览不传递 MCP 授权;受保护查询需由服务端配置受控预览。',
|
|
225
|
+
queryCardComputedHint: 'DataViewer 可能不显示临时聚合列;请以本次执行结果为准。',
|
|
226
|
+
queryCardUnsupported: '当前查询不支持 DataViewer 预览,可继续查看查询结果。',
|
|
227
|
+
queryCardFilterRequired: '查看数据需要至少一个筛选条件。',
|
|
228
|
+
queryCardResults: 'Foggy 查询结果',
|
|
229
|
+
queryCardProvenance: 'Foggy 插件生成',
|
|
230
|
+
queryCardSource: '来自实际执行结果,非 AI 撰写',
|
|
231
|
+
queryCardShowAll: '显示全部 {count} 条查询',
|
|
232
|
+
queryCardShowLess: '收起至前 6 条',
|
|
233
|
+
queryCardShowResult: '查看结果',
|
|
234
|
+
queryCardHideResult: '收起结果',
|
|
235
|
+
queryCardRowUnit: '行',
|
|
236
|
+
queryCardDsl: 'DSL / SQL',
|
|
237
|
+
queryCardNoRows: '没有返回数据',
|
|
238
|
+
queryCardTableMore: '仅预览前 {count} 行',
|
|
239
|
+
stepPlanned: '规划',
|
|
240
|
+
stepDatasourceConfigured: '数据库连接',
|
|
241
|
+
stepDatasourceVerified: '连接验证',
|
|
242
|
+
stepSchemaDiscovered: 'Schema 发现',
|
|
243
|
+
stepSemanticDrafted: '语义层草拟',
|
|
244
|
+
stepSemanticValidated: '模型校验',
|
|
245
|
+
stepSemanticPublished: '发布',
|
|
246
|
+
stepSemanticVerified: '首次查询',
|
|
247
|
+
runtimeUrl: 'Runtime 地址',
|
|
248
|
+
runtimeSettingsTitle: 'Runtime 连接设置',
|
|
249
|
+
runtimePort: 'Runtime 端口',
|
|
250
|
+
runtimePortHint: '端口会持久保存,CLI 与 Skill 将使用同一个 Runtime 地址。',
|
|
251
|
+
configuredRuntimeUrl: '下次启动地址',
|
|
252
|
+
saveRuntimePort: '保存端口',
|
|
253
|
+
runtimePortSaved: 'Runtime 端口已保存',
|
|
254
|
+
stopToChangePort: 'Runtime 运行时不能修改端口,请先停止 Runtime。',
|
|
255
|
+
errorTitle: 'Foggy 操作失败',
|
|
256
|
+
portUnavailableTitle: 'Runtime 端口被占用',
|
|
257
|
+
portUnavailableMessage: '已被其他程序或 Windows 端口代理占用,Runtime 无法启动。',
|
|
258
|
+
portUnavailableHelp: '请更换端口后保存并重新启动;也可以先释放占用该端口的程序或 Windows 端口代理。',
|
|
259
|
+
portInvalidTitle: '端口配置无效',
|
|
260
|
+
portInvalidMessage: '当前值无法保存为 Runtime 端口。',
|
|
261
|
+
portInvalidHelp: '请输入 1024 到 65535 之间的整数端口。',
|
|
262
|
+
settingsInvalidTitle: 'Runtime 设置文件异常',
|
|
263
|
+
nextTitle: '后续配置',
|
|
264
|
+
nextCopy: 'Skills 已通过 DeepSeek Harness 原生注册表提供给所有工作区;每个会话直接使用自己的工作目录。Runtime 启动成功后,将继续进入数据库连接与语义层向导。',
|
|
265
|
+
beta: 'Beta',
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const en = {
|
|
269
|
+
tab: 'Foggy Data Analysis',
|
|
270
|
+
title: 'Foggy Java Data Analysis Engine',
|
|
271
|
+
intro: 'Manage Foggy private Python, CLI, Launcher, Skills, and the local Runtime inside DeepSeek Harness. Official component releases are checked automatically; you choose which version to download and use.',
|
|
272
|
+
refresh: 'Refresh status',
|
|
273
|
+
loading: 'Reading Foggy status…',
|
|
274
|
+
failed: 'Foggy status is temporarily unavailable.',
|
|
275
|
+
retry: 'Retry',
|
|
276
|
+
notInstalled: 'Not initialized',
|
|
277
|
+
degraded: 'Repair required',
|
|
278
|
+
ready: 'Ready',
|
|
279
|
+
running: 'Runtime running',
|
|
280
|
+
cli: 'CLI',
|
|
281
|
+
launcher: 'Launcher',
|
|
282
|
+
analysisSkill: 'Analysis Skill',
|
|
283
|
+
semanticQuerySkill: 'Semantic Query Skill',
|
|
284
|
+
onboardingSkill: 'Onboarding Skill',
|
|
285
|
+
skillRegistry: 'DSH Skill registry',
|
|
286
|
+
python: 'Python',
|
|
287
|
+
java: 'Java',
|
|
288
|
+
installed: 'Installed',
|
|
289
|
+
missing: 'Missing',
|
|
290
|
+
upToDate: 'Up to date',
|
|
291
|
+
updateAvailable: 'Update available',
|
|
292
|
+
installedVersion: 'Current',
|
|
293
|
+
targetVersion: 'Target',
|
|
294
|
+
componentVersionsTitle: 'Launcher / CLI versions',
|
|
295
|
+
componentVersionsHint: 'Official releases are checked automatically. Choose a version to download and use. Downloaded versions remain available for rollback.',
|
|
296
|
+
componentVersionsCheck: 'Check for updates',
|
|
297
|
+
componentVersionsChecking: 'Checking official releases…',
|
|
298
|
+
componentVersionsChecked: 'Last checked',
|
|
299
|
+
componentVersionsOffline: 'Unable to check for updates. Cached releases and local versions remain available.',
|
|
300
|
+
componentVersionsCached: 'Showing cached release information.',
|
|
301
|
+
componentVersionsEmpty: 'No official release information yet. Try again later.',
|
|
302
|
+
componentVersionsDetails: 'Check details',
|
|
303
|
+
componentVersionsWarning: 'Component version history has a notice. See details.',
|
|
304
|
+
componentLatest: 'Latest upstream',
|
|
305
|
+
componentBundled: 'Plugin-tested',
|
|
306
|
+
componentChoose: 'Choose version',
|
|
307
|
+
componentPrerelease: 'Pre-release',
|
|
308
|
+
componentDownloaded: 'Downloaded',
|
|
309
|
+
componentCurrent: 'In use',
|
|
310
|
+
componentDownloadUse: 'Download and use',
|
|
311
|
+
componentUse: 'Use this version',
|
|
312
|
+
componentVersionUpdating: 'Updating component version',
|
|
313
|
+
componentVersionComplete: 'Component version updated',
|
|
314
|
+
componentReleaseNotes: 'Release notes',
|
|
315
|
+
componentInitializeFirst: 'Initialize Foggy before choosing another component version.',
|
|
316
|
+
componentStopFirst: 'Stop Runtime before downloading or switching component versions.',
|
|
317
|
+
componentUnavailable: 'This version does not meet this plugin’s installation requirements.',
|
|
318
|
+
available: 'Available',
|
|
319
|
+
unavailable: 'Unavailable',
|
|
320
|
+
initialize: 'Initialize Foggy',
|
|
321
|
+
initializeAndStart: 'Initialize and start',
|
|
322
|
+
initializeAndStartDone: 'Foggy was initialized and Runtime started.',
|
|
323
|
+
updateComponents: 'Update components',
|
|
324
|
+
updateAndStart: 'Update and start',
|
|
325
|
+
updateAndStartDone: 'Components were updated and Runtime started.',
|
|
326
|
+
repair: 'Repair components',
|
|
327
|
+
repairTitle: 'Advanced repair',
|
|
328
|
+
repairPython: 'Check / repair private Python',
|
|
329
|
+
repairCli: 'Check / repair CLI',
|
|
330
|
+
repairLauncher: 'Check / repair Launcher',
|
|
331
|
+
repairAnalysisSkill: 'Check / repair analysis Skill',
|
|
332
|
+
repairSemanticQuerySkill: 'Check / repair semantic query Skill',
|
|
333
|
+
diagnostics: 'Export diagnostics',
|
|
334
|
+
diagnosticsSaved: 'Diagnostics saved',
|
|
335
|
+
start: 'Start Runtime',
|
|
336
|
+
stop: 'Stop Runtime',
|
|
337
|
+
updateBlockedRunning: 'Runtime is running. Stop it before updating components.',
|
|
338
|
+
updateReady: 'Component updates are available. Use “Update and start” to finish in one step.',
|
|
339
|
+
updateNone: 'All managed components are up to date.',
|
|
340
|
+
operationTimeout: 'The operation timed out. Refresh the status or export diagnostics.',
|
|
341
|
+
resourceTitle: 'Documentation and project',
|
|
342
|
+
tutorial: 'Tutorial',
|
|
343
|
+
docs: 'User documentation',
|
|
344
|
+
project: 'Plugin project',
|
|
345
|
+
releases: 'Releases',
|
|
346
|
+
runtimeProject: 'Runtime project',
|
|
347
|
+
openExternal: 'Opens in a new tab',
|
|
348
|
+
working: 'Operation in progress…',
|
|
349
|
+
progressWorking: 'Initializing Foggy…',
|
|
350
|
+
progressPreflight: 'Checking prerequisites',
|
|
351
|
+
progressPython: 'Preparing private Python',
|
|
352
|
+
progressCli: 'Preparing CLI',
|
|
353
|
+
progressLauncher: 'Preparing Launcher',
|
|
354
|
+
progressAnalysis: 'Preparing analysis Skill',
|
|
355
|
+
progressSemanticQuery: 'Preparing semantic query Skill',
|
|
356
|
+
progressSkills: 'Registering DSH Skills',
|
|
357
|
+
progressState: 'Writing install state',
|
|
358
|
+
progressComplete: 'Initialization complete',
|
|
359
|
+
progressRuntimePreflight: 'Checking Runtime state',
|
|
360
|
+
progressRuntimeLauncher: 'Starting Java Launcher',
|
|
361
|
+
progressRuntimeReadiness: 'Waiting for Runtime readiness',
|
|
362
|
+
progressRuntimeCapabilities: 'Verifying Runtime capabilities',
|
|
363
|
+
progressRuntimeState: 'Saving Runtime state',
|
|
364
|
+
progressRuntimeComplete: 'Runtime ready',
|
|
365
|
+
progressFiles: 'files',
|
|
366
|
+
progressElapsed: 'elapsed',
|
|
367
|
+
progressTimeout: 'timeout',
|
|
368
|
+
progressSeconds: 's',
|
|
369
|
+
managedPrivate: 'Foggy private',
|
|
370
|
+
configuredOverride: 'Configured override',
|
|
371
|
+
accepted: 'The operation started; this page will refresh automatically.',
|
|
372
|
+
actionFailed: 'Operation failed',
|
|
373
|
+
roots: 'Local directories',
|
|
374
|
+
installRoot: 'Components',
|
|
375
|
+
dataRoot: 'Data',
|
|
376
|
+
profileStore: 'CLI profiles',
|
|
377
|
+
profileMigrationTitle: 'Legacy profile migration',
|
|
378
|
+
profileMigrationPending: 'Legacy temporary profiles were found. Migration transfers connection metadata and password environment-variable references, never password values.',
|
|
379
|
+
profileMigrationConflict: 'A legacy profile has a conflict or invalid format. Export diagnostics before continuing.',
|
|
380
|
+
migrateProfiles: 'Move to persistent store',
|
|
381
|
+
onboardingProgress: 'Database and semantic-layer progress',
|
|
382
|
+
noOnboarding: 'No database onboarding record yet. Invoke the Foggy onboarding Skill in a conversation.',
|
|
383
|
+
projectRoot: 'Workspace',
|
|
384
|
+
resumeInChat: 'Resume incomplete steps from a conversation in the matching workspace.',
|
|
385
|
+
queryWarningTitle: 'Query input was normalized',
|
|
386
|
+
queryWarningSummary: 'In WARN mode, Runtime ignored unknown query properties and continued. Review the warning codes and evidence before deciding whether to change the model or request.',
|
|
387
|
+
queryWarningCodes: 'Warning codes',
|
|
388
|
+
queryWarningEvidence: 'Evidence directory',
|
|
389
|
+
queryCardTitle: 'Foggy DSL query',
|
|
390
|
+
queryCardRunning: 'Validating and executing…',
|
|
391
|
+
queryCardDone: 'Validation and query succeeded',
|
|
392
|
+
queryCardFailed: 'Query failed; expand for details',
|
|
393
|
+
queryCardRows: 'Rows',
|
|
394
|
+
queryCardDetails: 'Show DSL and execution result',
|
|
395
|
+
queryCardOpen: 'View data',
|
|
396
|
+
queryCardOpening: 'Creating preview link…',
|
|
397
|
+
queryCardPreviewHint: 'A fresh preview link is created on every click.',
|
|
398
|
+
queryCardLocalDevelopment: 'Local development previews do not forward MCP authorization. Protected queries require a controlled preview configured by the server.',
|
|
399
|
+
queryCardComputedHint: 'DataViewer may omit ad-hoc aggregate columns; use this execution result as the source of truth.',
|
|
400
|
+
queryCardUnsupported: 'DataViewer preview is unavailable for this query; the query result remains available.',
|
|
401
|
+
queryCardFilterRequired: 'View data requires at least one filter.',
|
|
402
|
+
queryCardResults: 'Foggy query results',
|
|
403
|
+
queryCardProvenance: 'Generated by Foggy plugin',
|
|
404
|
+
queryCardSource: 'From executed queries, not AI-written',
|
|
405
|
+
queryCardShowAll: 'Show all {count} queries',
|
|
406
|
+
queryCardShowLess: 'Show first 6',
|
|
407
|
+
queryCardShowResult: 'View result',
|
|
408
|
+
queryCardHideResult: 'Hide result',
|
|
409
|
+
queryCardRowUnit: 'rows',
|
|
410
|
+
queryCardDsl: 'DSL / SQL',
|
|
411
|
+
queryCardNoRows: 'No rows returned',
|
|
412
|
+
queryCardTableMore: 'Previewing first {count} rows',
|
|
413
|
+
stepPlanned: 'Plan',
|
|
414
|
+
stepDatasourceConfigured: 'Database connection',
|
|
415
|
+
stepDatasourceVerified: 'Connection test',
|
|
416
|
+
stepSchemaDiscovered: 'Schema discovery',
|
|
417
|
+
stepSemanticDrafted: 'Semantic draft',
|
|
418
|
+
stepSemanticValidated: 'Model validation',
|
|
419
|
+
stepSemanticPublished: 'Publish',
|
|
420
|
+
stepSemanticVerified: 'First query',
|
|
421
|
+
runtimeUrl: 'Runtime URL',
|
|
422
|
+
runtimeSettingsTitle: 'Runtime connection settings',
|
|
423
|
+
runtimePort: 'Runtime port',
|
|
424
|
+
runtimePortHint: 'The port is persisted so the CLI and Skills use one stable Runtime URL.',
|
|
425
|
+
configuredRuntimeUrl: 'Next startup URL',
|
|
426
|
+
saveRuntimePort: 'Save port',
|
|
427
|
+
runtimePortSaved: 'Runtime port saved',
|
|
428
|
+
stopToChangePort: 'Stop Runtime before changing its port.',
|
|
429
|
+
errorTitle: 'Foggy operation failed',
|
|
430
|
+
portUnavailableTitle: 'Runtime port is already in use',
|
|
431
|
+
portUnavailableMessage: 'is already used by another application or Windows port proxy, so Runtime cannot start.',
|
|
432
|
+
portUnavailableHelp: 'Save a different port and start again, or release the application or Windows port proxy using this port.',
|
|
433
|
+
portInvalidTitle: 'Invalid port setting',
|
|
434
|
+
portInvalidMessage: 'The current value cannot be saved as the Runtime port.',
|
|
435
|
+
portInvalidHelp: 'Enter an integer port between 1024 and 65535.',
|
|
436
|
+
settingsInvalidTitle: 'Runtime settings file is invalid',
|
|
437
|
+
nextTitle: 'Next configuration',
|
|
438
|
+
nextCopy: 'Skills are provided to every workspace through the native DeepSeek Harness registry, and each session uses its own working directory. After Runtime starts, the database connection and semantic-layer wizard comes next.',
|
|
439
|
+
beta: 'Beta',
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const css = `
|
|
443
|
+
.foggy-settings{width:100%;max-width:820px;color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:16px}
|
|
444
|
+
.foggy-hero{border:1px solid var(--dsw-alias-border-l2);background:linear-gradient(135deg,color-mix(in srgb,var(--dsw-alias-state-business-primary) 10%,var(--dsw-alias-bg-layer-3)),var(--dsw-alias-bg-layer-3));border-radius:12px;padding:18px}
|
|
445
|
+
.foggy-title-row{display:flex;align-items:center;gap:10px}.foggy-title-row h3{margin:0;font-size:18px;line-height:26px}.foggy-beta{font-size:11px;padding:2px 7px;border-radius:999px;background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 14%,transparent);color:var(--dsw-alias-state-business-primary)}
|
|
446
|
+
.foggy-intro{margin:8px 0 0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}.foggy-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.foggy-toolbar-main,.foggy-toolbar-secondary{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.foggy-toolbar-secondary{width:100%;padding-top:2px;border-top:1px solid var(--dsw-alias-border-l2)}
|
|
447
|
+
.foggy-state{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600}.foggy-dot{width:9px;height:9px;border-radius:50%;background:var(--dsw-alias-label-tertiary)}.foggy-dot[data-state=ready],.foggy-dot[data-state=running]{background:var(--dsw-alias-state-success-primary)}.foggy-dot[data-state=degraded]{background:var(--dsw-alias-state-error-primary)}
|
|
448
|
+
.foggy-actions{display:flex;gap:8px;flex-wrap:wrap}.foggy-button{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;border-radius:8px;padding:7px 12px;cursor:pointer;transition:background-color .15s ease,box-shadow .15s ease,transform .15s ease}.foggy-button:hover{background:var(--dsw-alias-interactive-bg-hover)}.foggy-button:active{transform:translateY(1px)}.foggy-button:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.foggy-button:disabled{opacity:.55;cursor:not-allowed}.foggy-button-primary{border-color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-state-business-primary);color:white}
|
|
449
|
+
.foggy-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.foggy-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;padding:13px 14px}.foggy-card-head{display:flex;justify-content:space-between;gap:8px}.foggy-card strong{font-size:13px}.foggy-badge{font-size:11px;color:var(--dsw-alias-label-secondary)}.foggy-card code{display:block;margin-top:8px;color:var(--dsw-alias-label-tertiary);font-size:11px;overflow-wrap:anywhere}
|
|
450
|
+
.foggy-progress{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;padding:13px 14px}.foggy-progress-head{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px}.foggy-progress-head strong{font-weight:600}.foggy-progress-percent{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums}.foggy-progress-track{height:8px;margin-top:10px;border-radius:999px;background:var(--dsw-alias-bg-layer-1);overflow:hidden}.foggy-progress-fill{height:100%;border-radius:inherit;background:var(--dsw-alias-state-business-primary);transition:width .25s ease}.foggy-progress-meta{display:flex;justify-content:flex-end;gap:12px;margin-top:8px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.foggy-progress-file{justify-content:flex-start;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
451
|
+
.foggy-runtime-settings{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;padding:14px}.foggy-runtime-settings h4{margin:0;font-size:13px}.foggy-runtime-settings-row{display:grid;grid-template-columns:minmax(150px,220px) minmax(0,1fr) auto;align-items:end;gap:10px;margin-top:10px}.foggy-field{display:flex;flex-direction:column;gap:6px}.foggy-field label{font-size:12px;font-weight:600}.foggy-input{width:100%;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-variant-numeric:tabular-nums;padding:8px 10px;outline:none}.foggy-input:focus{border-color:var(--dsw-alias-state-business-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-state-business-primary) 18%,transparent)}.foggy-input[aria-invalid=true]{border-color:var(--dsw-alias-state-error-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-state-error-primary) 14%,transparent)}.foggy-setting-meta{display:flex;flex-direction:column;gap:4px;min-width:0;color:var(--dsw-alias-label-tertiary);font-size:11px}.foggy-setting-meta code{overflow-wrap:anywhere;color:var(--dsw-alias-label-secondary)}
|
|
452
|
+
.foggy-update-banner{border:1px solid color-mix(in srgb,var(--dsw-alias-state-warning-primary) 55%,var(--dsw-alias-border-l2));background:color-mix(in srgb,var(--dsw-alias-state-warning-primary) 9%,transparent);border-radius:10px;padding:11px 13px;color:var(--dsw-alias-label-primary);font-size:12px;line-height:18px}.foggy-update-banner strong{color:var(--dsw-alias-state-warning-primary)}.foggy-update-list{margin:6px 0 0;padding-left:18px;color:var(--dsw-alias-label-secondary)}
|
|
453
|
+
.foggy-versions{border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:14px;background:var(--dsw-alias-bg-layer-3)}.foggy-versions-head{display:flex;justify-content:space-between;align-items:start;gap:12px;flex-wrap:wrap}.foggy-versions h4{margin:0;font-size:13px}.foggy-versions-intro{margin:6px 0 0;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.foggy-version-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:14px}.foggy-version-item{min-width:0;border-top:1px solid var(--dsw-alias-border-l2);padding-top:12px}.foggy-version-item h5{margin:0 0 8px;font-size:13px}.foggy-version-meta{display:grid;grid-template-columns:auto minmax(0,1fr);gap:5px 10px;margin:0 0 12px;font-size:11px;line-height:16px}.foggy-version-meta dt{color:var(--dsw-alias-label-tertiary)}.foggy-version-meta dd{margin:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.foggy-version-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:9px}.foggy-version-actions a{font-size:12px;color:var(--dsw-alias-state-business-primary);text-decoration:none}.foggy-version-actions a:hover{text-decoration:underline}.foggy-version-actions a:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:3px}.foggy-version-note{margin:9px 0 0;font-size:11px;line-height:17px;color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere}.foggy-version-note[data-error=true]{color:var(--dsw-alias-state-warning-primary)}.foggy-version-tag{font-size:10px;font-weight:400;margin-left:6px;padding:2px 6px;border-radius:999px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary)}
|
|
454
|
+
.foggy-resources{border-top:1px solid var(--dsw-alias-border-l2);padding-top:14px}.foggy-resources h4{margin:0 0 9px;font-size:13px}.foggy-resource-links{display:flex;gap:8px;flex-wrap:wrap}.foggy-resource-link{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:7px 10px;color:var(--dsw-alias-label-secondary);font-size:12px;text-decoration:none}.foggy-resource-link:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.foggy-resource-link:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
|
|
455
|
+
.foggy-error-panel{border:2px solid var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,var(--dsw-alias-bg-layer-3));border-radius:10px;padding:13px 14px;box-shadow:0 6px 18px color-mix(in srgb,var(--dsw-alias-state-error-primary) 13%,transparent)}.foggy-error-panel-head{display:flex;align-items:center;gap:8px;color:var(--dsw-alias-state-error-primary);font-size:14px;font-weight:700}.foggy-error-icon{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--dsw-alias-state-error-primary);color:white;font-size:14px}.foggy-error-panel p{margin:7px 0 0;color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;overflow-wrap:anywhere}.foggy-error-help{color:var(--dsw-alias-state-error-primary)!important;font-weight:600}
|
|
456
|
+
.foggy-message{margin:0;font-size:13px;line-height:20px;color:var(--dsw-alias-label-secondary)}.foggy-message[data-error=true]{color:var(--dsw-alias-state-error-primary)}.foggy-paths,.foggy-next,.foggy-section{border-top:1px solid var(--dsw-alias-border-l2);padding-top:14px}.foggy-paths h4,.foggy-next h4,.foggy-section h4{margin:0 0 8px;font-size:13px}.foggy-paths dl{display:grid;grid-template-columns:100px minmax(0,1fr);gap:6px 10px;margin:0}.foggy-paths dt{color:var(--dsw-alias-label-tertiary);font-size:12px}.foggy-paths dd{margin:0;min-width:0;overflow-wrap:anywhere;font-family:var(--ds-font-family-code);font-size:11px}.foggy-next p,.foggy-section p{margin:0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}.foggy-section-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.foggy-onboarding-head{display:flex;justify-content:space-between;gap:12px;align-items:start}.foggy-onboarding-head code{font-size:11px;color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere}.foggy-step-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-top:10px}.foggy-step{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:8px;font-size:11px;color:var(--dsw-alias-label-tertiary)}.foggy-step[data-state=completed]{border-color:color-mix(in srgb,var(--dsw-alias-state-success-primary) 45%,var(--dsw-alias-border-l2));color:var(--dsw-alias-state-success-primary)}.foggy-step[data-state=failed],.foggy-step[data-state=invalid]{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}.foggy-warning{border:1px solid color-mix(in srgb,var(--dsw-alias-state-warning-primary) 55%,var(--dsw-alias-border-l2));background:color-mix(in srgb,var(--dsw-alias-state-warning-primary) 8%,transparent);border-radius:10px;padding:12px}.foggy-query-warning{margin-top:10px}.foggy-query-warning p+p{margin-top:5px}.foggy-query-warning code{overflow-wrap:anywhere}
|
|
457
|
+
.foggy-turn-results{margin:10px 0 14px;max-width:100%;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-3);overflow:hidden;color:var(--dsw-alias-label-primary)}.foggy-turn-results-head{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--dsw-alias-border-l2);font-size:13px;font-weight:600;flex-wrap:wrap}.foggy-turn-results-provenance{padding:2px 7px;border-radius:999px;background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 12%,transparent);color:var(--dsw-alias-state-business-primary);font-size:11px;font-weight:600}.foggy-turn-results-source{color:var(--dsw-alias-label-secondary);font-size:11px;font-weight:400}.foggy-turn-results-count{font-weight:400;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums}.foggy-turn-result{padding:9px 12px}.foggy-turn-result+.foggy-turn-result{border-top:1px solid var(--dsw-alias-border-l2)}.foggy-turn-result-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.foggy-turn-result-name{min-width:0;overflow-wrap:anywhere;font-size:12px;font-weight:600}.foggy-turn-result-meta{margin-left:8px;color:var(--dsw-alias-label-tertiary);font-size:11px;font-weight:400}.foggy-turn-result-actions{display:flex;align-items:center;gap:8px}.foggy-turn-result-actions button,.foggy-turn-results-toggle{border:0;background:none;color:var(--dsw-alias-state-business-primary);font:inherit;font-size:12px;cursor:pointer;padding:3px 0}.foggy-turn-result-actions button:disabled{opacity:.55;cursor:not-allowed}.foggy-turn-result-actions button:focus-visible,.foggy-turn-results-toggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.foggy-turn-result-detail{margin-top:9px;overflow:auto;max-height:300px}.foggy-turn-result-detail table{border-collapse:collapse;width:100%;min-width:max-content;font-size:11px}.foggy-turn-result-detail th,.foggy-turn-result-detail td{border:1px solid var(--dsw-alias-border-l2);padding:5px 7px;text-align:left;max-width:240px;overflow-wrap:anywhere}.foggy-turn-result-detail th{background:var(--dsw-alias-bg-layer-2);font-weight:600}.foggy-turn-result-note{margin:6px 0 0;color:var(--dsw-alias-label-tertiary);font-size:11px}.foggy-turn-result-error{margin:6px 0 0;color:var(--dsw-alias-state-error-primary);font-size:11px}.foggy-turn-results-toggle{display:block;width:100%;padding:9px 12px;border-top:1px solid var(--dsw-alias-border-l2);text-align:left}
|
|
458
|
+
.foggy-turn-result-code{margin-top:9px;font-size:11px}.foggy-turn-result-code summary{cursor:pointer;color:var(--dsw-alias-label-secondary)}.foggy-turn-result-code pre{max-height:220px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;margin:7px 0;padding:8px;border-radius:6px;background:var(--dsw-alias-bg-layer-2)}
|
|
459
|
+
@media (width<=680px){.foggy-grid,.foggy-version-grid{grid-template-columns:minmax(0,1fr)}.foggy-runtime-settings-row{grid-template-columns:minmax(0,1fr)}.foggy-runtime-settings-row .foggy-button{width:100%}.foggy-toolbar-main{width:100%}.foggy-toolbar-main .foggy-button{flex:1}.foggy-resource-link{min-height:36px}}
|
|
460
|
+
`
|
|
461
|
+
|
|
462
|
+
if (typeof document !== 'undefined' && !document.querySelector('style[data-foggy-settings]')) {
|
|
463
|
+
const tag = document.createElement('style')
|
|
464
|
+
tag.dataset.foggySettings = 'true'
|
|
465
|
+
tag.textContent = css
|
|
466
|
+
document.head.appendChild(tag)
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function unwrap(response, method) {
|
|
470
|
+
if (!response?.ok) {
|
|
471
|
+
const error = response?.error
|
|
472
|
+
throw new Error(error ? `${error.code}: ${error.message}` : `${method} failed`)
|
|
473
|
+
}
|
|
474
|
+
return response.value
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function componentCard(label, component, kind, t) {
|
|
478
|
+
const available = kind === 'runtime' ? component?.installed : component?.available
|
|
479
|
+
const stateText = component?.updateAvailable
|
|
480
|
+
? t('updateAvailable')
|
|
481
|
+
: kind === 'runtime'
|
|
482
|
+
? t(available ? 'installed' : 'missing')
|
|
483
|
+
: t(available ? 'available' : 'unavailable')
|
|
484
|
+
const source = component?.source === 'managed'
|
|
485
|
+
? t('managedPrivate')
|
|
486
|
+
: component?.source === 'override'
|
|
487
|
+
? t('configuredOverride')
|
|
488
|
+
: null
|
|
489
|
+
const detail = [
|
|
490
|
+
component?.installedVersion
|
|
491
|
+
? `${t('installedVersion')} ${component.installedVersion}`
|
|
492
|
+
: component?.version || component?.output || '—',
|
|
493
|
+
component?.targetVersion && component?.targetVersion !== component?.installedVersion
|
|
494
|
+
? `${t('targetVersion')} ${component.targetVersion}`
|
|
495
|
+
: null,
|
|
496
|
+
component?.minimum ? `≥${component.minimum}` : null,
|
|
497
|
+
source,
|
|
498
|
+
].filter(Boolean).join(' · ')
|
|
499
|
+
return jsxs('div', {
|
|
500
|
+
className: 'foggy-card',
|
|
501
|
+
children: [
|
|
502
|
+
jsxs('div', { className: 'foggy-card-head', children: [
|
|
503
|
+
jsx('strong', { children: label }),
|
|
504
|
+
jsx('span', { className: 'foggy-badge', children: stateText }),
|
|
505
|
+
] }),
|
|
506
|
+
jsx('code', { children: detail }),
|
|
507
|
+
component?.path ? jsx('code', { title: component.path, children: component.path }) : null,
|
|
508
|
+
],
|
|
509
|
+
}, label)
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
const componentLabels = {
|
|
513
|
+
cli: 'cli',
|
|
514
|
+
launcher: 'launcher',
|
|
515
|
+
analysisSkill: 'analysisSkill',
|
|
516
|
+
semanticQuerySkill: 'semanticQuerySkill',
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
function updateSummary(status, t) {
|
|
520
|
+
return Object.entries(status?.components || {})
|
|
521
|
+
.filter(([key, component]) => componentLabels[key] && component?.updateAvailable)
|
|
522
|
+
.map(([key, component]) => `${t(componentLabels[key])}: ${component.installedVersion || '—'} → ${component.targetVersion}`)
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function ComponentVersionsPanel({ api, status, busy, onUse, t }) {
|
|
526
|
+
const [catalog, setCatalog] = useState(null)
|
|
527
|
+
const [checking, setChecking] = useState(true)
|
|
528
|
+
const [checkError, setCheckError] = useState('')
|
|
529
|
+
const [drafts, setDrafts] = useState({})
|
|
530
|
+
const checkVersions = useCallback(async (force = false, active = () => true) => {
|
|
531
|
+
if (active()) setChecking(true)
|
|
532
|
+
try {
|
|
533
|
+
const method = force ? 'checkComponentVersions' : 'componentVersions'
|
|
534
|
+
const next = unwrap(await api[method](), method)
|
|
535
|
+
if (active()) {
|
|
536
|
+
setCatalog(next)
|
|
537
|
+
setCheckError(typeof next.error === 'string' ? next.error : next.error?.message || '')
|
|
538
|
+
}
|
|
539
|
+
} catch (error) {
|
|
540
|
+
if (active()) setCheckError(String(error?.message || error))
|
|
541
|
+
} finally {
|
|
542
|
+
if (active()) setChecking(false)
|
|
543
|
+
}
|
|
544
|
+
}, [api])
|
|
545
|
+
|
|
546
|
+
useEffect(() => {
|
|
547
|
+
let mounted = true
|
|
548
|
+
const active = () => mounted
|
|
549
|
+
checkVersions(false, active)
|
|
550
|
+
const timer = setInterval(() => checkVersions(false, active), 15 * 60 * 1000)
|
|
551
|
+
return () => { mounted = false; clearInterval(timer) }
|
|
552
|
+
}, [checkVersions, status.components?.launcher?.installedVersion, status.components?.cli?.installedVersion])
|
|
553
|
+
|
|
554
|
+
const notices = (Array.isArray(catalog?.warnings) ? catalog.warnings : [])
|
|
555
|
+
.map((warning) => typeof warning === 'string' ? warning : warning?.message || '')
|
|
556
|
+
.filter(Boolean)
|
|
557
|
+
|
|
558
|
+
const componentVersionCard = (kind) => {
|
|
559
|
+
const component = catalog?.components?.[kind] || {}
|
|
560
|
+
const installedVersion = status.components?.[kind]?.installedVersion || component.installedVersion || null
|
|
561
|
+
const releases = new Map((component.releases || []).filter((release) => typeof release.version === 'string').map((release) => [release.version, release]))
|
|
562
|
+
if (installedVersion && !releases.has(installedVersion)) {
|
|
563
|
+
releases.set(installedVersion, { version: installedVersion, downloaded: true, installable: true })
|
|
564
|
+
}
|
|
565
|
+
const selectedVersion = drafts[kind] || component.selectedVersion || installedVersion || component.latestVersion || ''
|
|
566
|
+
const selected = releases.get(selectedVersion)
|
|
567
|
+
const current = Boolean(installedVersion && selectedVersion === installedVersion)
|
|
568
|
+
const initialized = status.state !== 'not-installed'
|
|
569
|
+
const canUse = initialized && !busy && !status.running && selected && selected.installable !== false && !current
|
|
570
|
+
const labels = (release) => [
|
|
571
|
+
release.version,
|
|
572
|
+
release.version === installedVersion ? t('componentCurrent') : null,
|
|
573
|
+
release.version === component.latestVersion ? t('componentLatest') : null,
|
|
574
|
+
release.version === component.bundledVersion ? t('componentBundled') : null,
|
|
575
|
+
release.prerelease ? t('componentPrerelease') : null,
|
|
576
|
+
release.downloaded ? t('componentDownloaded') : null,
|
|
577
|
+
].filter(Boolean).join(' · ')
|
|
578
|
+
const releaseUrl = typeof selected?.url === 'string' && /^https:\/\/github\.com\/foggy-projects\/(?:foggy-runtime-cli|foggy-data-mcp-bridge)\/releases\/tag\//.test(selected.url) ? selected.url : null
|
|
579
|
+
return jsxs('div', { className: 'foggy-version-item', children: [
|
|
580
|
+
jsxs('h5', { children: [t(kind), selected?.prerelease ? jsx('span', { className: 'foggy-version-tag', children: t('componentPrerelease') }) : null] }),
|
|
581
|
+
jsxs('dl', { className: 'foggy-version-meta', children: [
|
|
582
|
+
jsx('dt', { children: t('installedVersion') }), jsx('dd', { children: installedVersion || '—' }),
|
|
583
|
+
jsx('dt', { children: t('componentLatest') }), jsx('dd', { children: component.latestVersion || '—' }),
|
|
584
|
+
jsx('dt', { children: t('componentBundled') }), jsx('dd', { children: component.bundledVersion || '—' }),
|
|
585
|
+
] }),
|
|
586
|
+
jsxs('div', { className: 'foggy-field', children: [
|
|
587
|
+
jsx('label', { htmlFor: `foggy-${kind}-version`, children: t('componentChoose') }),
|
|
588
|
+
jsx('select', {
|
|
589
|
+
id: `foggy-${kind}-version`, className: 'foggy-input', value: selected ? selectedVersion : '',
|
|
590
|
+
disabled: busy || releases.size === 0,
|
|
591
|
+
onChange: (event) => setDrafts((currentDrafts) => ({ ...currentDrafts, [kind]: event.target.value })),
|
|
592
|
+
children: releases.size ? [...releases.values()].map((release) => jsx('option', { value: release.version, children: labels(release) }, release.version)) : jsx('option', { value: '', children: checking ? t('componentVersionsChecking') : t('componentVersionsEmpty') }),
|
|
593
|
+
}),
|
|
594
|
+
] }),
|
|
595
|
+
jsxs('div', { className: 'foggy-version-actions', children: [
|
|
596
|
+
jsx('button', {
|
|
597
|
+
type: 'button', className: 'foggy-button foggy-button-primary', disabled: !canUse,
|
|
598
|
+
title: status.running ? t('componentStopFirst') : !initialized ? t('componentInitializeFirst') : undefined,
|
|
599
|
+
onClick: () => onUse({ component: kind, version: selectedVersion }),
|
|
600
|
+
children: current ? t('componentCurrent') : selected?.downloaded ? t('componentUse') : t('componentDownloadUse'),
|
|
601
|
+
}),
|
|
602
|
+
releaseUrl ? jsx('a', { href: releaseUrl, target: '_blank', rel: 'noreferrer noopener', title: t('openExternal'), children: t('componentReleaseNotes') }) : null,
|
|
603
|
+
] }),
|
|
604
|
+
selected?.installable === false ? jsx('p', { className: 'foggy-version-note', children: selected.unavailableReason || t('componentUnavailable') }) : null,
|
|
605
|
+
] }, kind)
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
return jsxs('section', { className: 'foggy-versions', 'aria-label': t('componentVersionsTitle'), children: [
|
|
609
|
+
jsxs('div', { className: 'foggy-versions-head', children: [
|
|
610
|
+
jsxs('div', { children: [jsx('h4', { children: t('componentVersionsTitle') }), jsx('p', { className: 'foggy-versions-intro', children: t('componentVersionsHint') })] }),
|
|
611
|
+
jsx('button', { type: 'button', className: 'foggy-button', disabled: checking, onClick: () => checkVersions(true), children: checking ? t('componentVersionsChecking') : t('componentVersionsCheck') }),
|
|
612
|
+
] }),
|
|
613
|
+
jsx('div', { className: 'foggy-version-grid', children: ['launcher', 'cli'].map(componentVersionCard) }),
|
|
614
|
+
jsx('p', { className: 'foggy-version-note', role: 'status', 'data-error': Boolean(checkError), children: checkError ? t('componentVersionsOffline') : catalog?.stale ? t('componentVersionsCached') : checking ? t('componentVersionsChecking') : catalog?.checkedAt ? `${t('componentVersionsChecked')}: ${new Date(catalog.checkedAt).toLocaleString()}` : '' }),
|
|
615
|
+
notices.length ? jsx('p', { className: 'foggy-version-note', role: 'status', 'data-error': true, children: t('componentVersionsWarning') }) : null,
|
|
616
|
+
checkError || notices.length ? jsxs('details', { className: 'foggy-version-note', children: [
|
|
617
|
+
jsx('summary', { children: t('componentVersionsDetails') }),
|
|
618
|
+
checkError ? jsx('p', { children: checkError }) : null,
|
|
619
|
+
notices.length ? jsx('ul', { children: notices.map((notice, index) => jsx('li', { children: notice }, index)) }) : null,
|
|
620
|
+
] }) : null,
|
|
621
|
+
status.running ? jsx('p', { className: 'foggy-version-note', children: t('componentStopFirst') }) : status.state === 'not-installed' ? jsx('p', { className: 'foggy-version-note', children: t('componentInitializeFirst') }) : null,
|
|
622
|
+
] })
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
function progressPanel(progress, t) {
|
|
626
|
+
if (!progress) return null
|
|
627
|
+
const percent = Math.max(0, Math.min(100, Number(progress.percent) || 0))
|
|
628
|
+
const phaseKeys = {
|
|
629
|
+
preflight: 'progressPreflight',
|
|
630
|
+
python: 'progressPython',
|
|
631
|
+
cli: 'progressCli',
|
|
632
|
+
launcher: 'progressLauncher',
|
|
633
|
+
'analysis-skill': 'progressAnalysis',
|
|
634
|
+
'semantic-query-skill': 'progressSemanticQuery',
|
|
635
|
+
'workspace-skills': 'progressSkills',
|
|
636
|
+
state: 'progressState',
|
|
637
|
+
complete: 'progressComplete',
|
|
638
|
+
'runtime-preflight': 'progressRuntimePreflight',
|
|
639
|
+
'runtime-launcher': 'progressRuntimeLauncher',
|
|
640
|
+
'runtime-readiness': 'progressRuntimeReadiness',
|
|
641
|
+
'runtime-capabilities': 'progressRuntimeCapabilities',
|
|
642
|
+
'runtime-state': 'progressRuntimeState',
|
|
643
|
+
'runtime-complete': 'progressRuntimeComplete',
|
|
644
|
+
}
|
|
645
|
+
const phaseKey = phaseKeys[progress.phase]
|
|
646
|
+
const phase = t(phaseKey || 'progressWorking')
|
|
647
|
+
const versionUpdate = progress.kind === 'use-component-version'
|
|
648
|
+
const completedVersionUpdate = progress.state === 'succeeded' || progress.phase === 'complete' && progress.state !== 'failed'
|
|
649
|
+
const headline = versionUpdate
|
|
650
|
+
? t(completedVersionUpdate ? 'componentVersionComplete' : 'componentVersionUpdating')
|
|
651
|
+
: phaseKey ? phase : progress.message || phase
|
|
652
|
+
const step = progress.step?.index && progress.step?.total
|
|
653
|
+
? `${progress.step.index}/${progress.step.total}`
|
|
654
|
+
: ''
|
|
655
|
+
const files = progress.files?.total
|
|
656
|
+
? `${progress.files.completed || 0}/${progress.files.total} ${t('progressFiles')}`
|
|
657
|
+
: ''
|
|
658
|
+
const elapsed = Number(progress.timing?.elapsedSeconds)
|
|
659
|
+
const timeout = Number(progress.timing?.timeoutSeconds)
|
|
660
|
+
const timing = Number.isFinite(elapsed)
|
|
661
|
+
? `${t('progressElapsed')} ${elapsed}${t('progressSeconds')}${Number.isFinite(timeout) ? ` / ${t('progressTimeout')} ${timeout}${t('progressSeconds')}` : ''}`
|
|
662
|
+
: ''
|
|
663
|
+
const meta = [versionUpdate && phaseKey && !completedVersionUpdate ? phase : null, step, files, timing].filter(Boolean).join(' · ')
|
|
664
|
+
return jsxs('div', {
|
|
665
|
+
className: 'foggy-progress',
|
|
666
|
+
role: 'status',
|
|
667
|
+
'aria-live': 'polite',
|
|
668
|
+
children: [
|
|
669
|
+
jsxs('div', { className: 'foggy-progress-head', children: [
|
|
670
|
+
jsx('strong', { children: headline }),
|
|
671
|
+
jsx('span', { className: 'foggy-progress-percent', children: `${percent}%` }),
|
|
672
|
+
] }),
|
|
673
|
+
jsx('div', {
|
|
674
|
+
className: 'foggy-progress-track',
|
|
675
|
+
role: 'progressbar',
|
|
676
|
+
'aria-valuemin': 0,
|
|
677
|
+
'aria-valuemax': 100,
|
|
678
|
+
'aria-valuenow': percent,
|
|
679
|
+
'aria-label': versionUpdate ? headline : phase,
|
|
680
|
+
children: jsx('div', { className: 'foggy-progress-fill', style: { width: `${percent}%` } }),
|
|
681
|
+
}),
|
|
682
|
+
meta ? jsx('div', { className: 'foggy-progress-meta', children: meta }) : null,
|
|
683
|
+
progress.currentFile ? jsx('div', { className: 'foggy-progress-meta foggy-progress-file', title: progress.currentFile, children: progress.currentFile }) : null,
|
|
684
|
+
],
|
|
685
|
+
})
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
function onboardingPanel(onboarding, t) {
|
|
689
|
+
const profile = onboarding?.profiles?.[0]
|
|
690
|
+
if (!profile) return jsxs('div', { className: 'foggy-section', children: [
|
|
691
|
+
jsx('h4', { children: t('onboardingProgress') }),
|
|
692
|
+
jsx('p', { children: t('noOnboarding') }),
|
|
693
|
+
] }, 'onboarding')
|
|
694
|
+
const steps = [
|
|
695
|
+
['planned', 'stepPlanned'],
|
|
696
|
+
['datasourceConfigured', 'stepDatasourceConfigured'],
|
|
697
|
+
['datasourceVerified', 'stepDatasourceVerified'],
|
|
698
|
+
['schemaDiscovered', 'stepSchemaDiscovered'],
|
|
699
|
+
['semanticDrafted', 'stepSemanticDrafted'],
|
|
700
|
+
['semanticValidated', 'stepSemanticValidated'],
|
|
701
|
+
['semanticPublished', 'stepSemanticPublished'],
|
|
702
|
+
['semanticVerified', 'stepSemanticVerified'],
|
|
703
|
+
]
|
|
704
|
+
const percent = Math.round(((profile.completedSteps || 0) / Math.max(profile.totalSteps || 8, 1)) * 100)
|
|
705
|
+
return jsxs('div', { className: 'foggy-section', children: [
|
|
706
|
+
jsxs('div', { className: 'foggy-onboarding-head', children: [
|
|
707
|
+
jsxs('div', { children: [
|
|
708
|
+
jsx('h4', { children: `${t('onboardingProgress')} · ${profile.profile}` }),
|
|
709
|
+
jsx('code', { children: `${t('projectRoot')}: ${profile.projectRoot || '—'}` }),
|
|
710
|
+
] }),
|
|
711
|
+
jsx('span', { className: 'foggy-progress-percent', children: `${percent}%` }),
|
|
712
|
+
] }),
|
|
713
|
+
jsx('div', { className: 'foggy-step-list', children: steps.map(([name, label]) => jsx('div', {
|
|
714
|
+
className: 'foggy-step',
|
|
715
|
+
'data-state': profile.steps?.[name]?.status || 'pending',
|
|
716
|
+
title: profile.steps?.[name]?.status || 'pending',
|
|
717
|
+
children: t(label),
|
|
718
|
+
}, name)) }),
|
|
719
|
+
profile.warningCount > 0 ? jsxs('div', { className: 'foggy-warning foggy-query-warning', role: 'status', children: [
|
|
720
|
+
jsx('h4', { children: `${t('queryWarningTitle')} · ${profile.warningCount}` }),
|
|
721
|
+
jsx('p', { children: t('queryWarningSummary') }),
|
|
722
|
+
profile.warningCodes?.length ? jsxs('p', { children: [`${t('queryWarningCodes')}: `, jsx('code', { children: profile.warningCodes.join(', ') })] }) : null,
|
|
723
|
+
profile.warningEvidence ? jsxs('p', { children: [`${t('queryWarningEvidence')}: `, jsx('code', { children: profile.warningEvidence })] }) : null,
|
|
724
|
+
] }) : null,
|
|
725
|
+
profile.next?.status !== 'completed' ? jsx('p', { style: { marginTop: '9px' }, children: t('resumeInChat') }) : null,
|
|
726
|
+
] }, 'onboarding')
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
function errorPanel(title, message, help) {
|
|
730
|
+
if (!message) return null
|
|
731
|
+
return jsxs('div', {
|
|
732
|
+
className: 'foggy-error-panel',
|
|
733
|
+
role: 'alert',
|
|
734
|
+
'aria-live': 'assertive',
|
|
735
|
+
children: [
|
|
736
|
+
jsxs('div', { className: 'foggy-error-panel-head', children: [
|
|
737
|
+
jsx('span', { className: 'foggy-error-icon', 'aria-hidden': true, children: '!' }),
|
|
738
|
+
jsx('strong', { children: title }),
|
|
739
|
+
] }),
|
|
740
|
+
jsx('p', { children: message }),
|
|
741
|
+
help ? jsx('p', { className: 'foggy-error-help', children: help }) : null,
|
|
742
|
+
],
|
|
743
|
+
})
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
function FoggySettingsTab({ api, t }) {
|
|
747
|
+
const [view, setView] = useState({ phase: 'loading', status: null, message: '', error: false, errorCode: null })
|
|
748
|
+
const [portDraft, setPortDraft] = useState('')
|
|
749
|
+
const [portDirty, setPortDirty] = useState(false)
|
|
750
|
+
const [sequenceBusy, setSequenceBusy] = useState(false)
|
|
751
|
+
|
|
752
|
+
const refresh = useCallback(async () => {
|
|
753
|
+
setView((current) => ({ ...current, phase: current.status ? 'ready' : 'loading', error: false }))
|
|
754
|
+
try {
|
|
755
|
+
const status = unwrap(await api.status(), 'status')
|
|
756
|
+
setView((current) => ({
|
|
757
|
+
...current,
|
|
758
|
+
phase: 'ready',
|
|
759
|
+
status,
|
|
760
|
+
error: false,
|
|
761
|
+
message: current.message === t('accepted') && status.operation?.state !== 'running' ? '' : current.message,
|
|
762
|
+
}))
|
|
763
|
+
if (!portDirty) setPortDraft(String(status.runtimeSettings?.port ?? 18166))
|
|
764
|
+
} catch (error) {
|
|
765
|
+
setView((current) => ({ ...current, phase: current.status ? 'ready' : 'error', message: String(error.message || error), error: true }))
|
|
766
|
+
}
|
|
767
|
+
}, [api, portDirty, t])
|
|
768
|
+
|
|
769
|
+
useEffect(() => { refresh() }, [refresh])
|
|
770
|
+
useEffect(() => {
|
|
771
|
+
if (view.status?.operation?.state !== 'running') return undefined
|
|
772
|
+
const timer = setInterval(refresh, 2000)
|
|
773
|
+
return () => clearInterval(timer)
|
|
774
|
+
}, [refresh, view.status?.operation?.state])
|
|
775
|
+
|
|
776
|
+
const run = async (method, input) => {
|
|
777
|
+
setSequenceBusy(true)
|
|
778
|
+
setView((current) => ({ ...current, message: t('working'), error: false, errorCode: null }))
|
|
779
|
+
try {
|
|
780
|
+
const result = unwrap(await api[method](...(input === undefined ? [] : [input])), method)
|
|
781
|
+
const message = result.accepted
|
|
782
|
+
? t('accepted')
|
|
783
|
+
: result.path
|
|
784
|
+
? `${t('diagnosticsSaved')}: ${result.path}`
|
|
785
|
+
: result.error?.message || ''
|
|
786
|
+
setView((current) => ({ ...current, message, error: result.success === false, errorCode: result.error?.code || null }))
|
|
787
|
+
await refresh()
|
|
788
|
+
} catch (error) {
|
|
789
|
+
setView((current) => ({ ...current, message: `${t('actionFailed')}: ${String(error.message || error)}`, error: true, errorCode: 'REMOTE_ERROR' }))
|
|
790
|
+
} finally {
|
|
791
|
+
setSequenceBusy(false)
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
const waitForOperation = async (operationId) => {
|
|
796
|
+
for (let attempt = 0; attempt < 900; attempt += 1) {
|
|
797
|
+
const status = unwrap(await api.status(), 'status')
|
|
798
|
+
const operation = status.operation
|
|
799
|
+
if (operation?.id === operationId) {
|
|
800
|
+
setView((current) => ({ ...current, phase: 'ready', status }))
|
|
801
|
+
if (operation.state !== 'running') return status
|
|
802
|
+
}
|
|
803
|
+
await new Promise((resolve) => setTimeout(resolve, 1000))
|
|
804
|
+
}
|
|
805
|
+
throw new Error(t('operationTimeout'))
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
const runSequence = async (methods, successMessage) => {
|
|
809
|
+
setSequenceBusy(true)
|
|
810
|
+
setView((current) => ({ ...current, message: t('working'), error: false, errorCode: null }))
|
|
811
|
+
try {
|
|
812
|
+
for (const method of methods) {
|
|
813
|
+
const result = unwrap(await api[method](), method)
|
|
814
|
+
if (result.success === false) {
|
|
815
|
+
setView((current) => ({ ...current, message: result.error?.message || t('actionFailed'), error: true, errorCode: result.error?.code || null }))
|
|
816
|
+
return
|
|
817
|
+
}
|
|
818
|
+
if (result.accepted && result.operation?.id) {
|
|
819
|
+
const completed = await waitForOperation(result.operation.id)
|
|
820
|
+
if (completed.operation?.state === 'failed') {
|
|
821
|
+
throw new Error(completed.operation.error || completed.operation.result?.error?.message || t('actionFailed'))
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
setView((current) => ({ ...current, message: successMessage, error: false, errorCode: null }))
|
|
826
|
+
} catch (error) {
|
|
827
|
+
setView((current) => ({ ...current, message: `${t('actionFailed')}: ${String(error.message || error)}`, error: true, errorCode: 'REMOTE_ERROR' }))
|
|
828
|
+
} finally {
|
|
829
|
+
setSequenceBusy(false)
|
|
830
|
+
await refresh()
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
const saveRuntimePort = async () => {
|
|
835
|
+
const port = Number(portDraft)
|
|
836
|
+
if (!Number.isInteger(port) || port < 1024 || port > 65535) {
|
|
837
|
+
setView((current) => ({ ...current, message: t('portInvalidMessage'), error: true, errorCode: 'RUNTIME_PORT_INVALID' }))
|
|
838
|
+
return
|
|
839
|
+
}
|
|
840
|
+
setView((current) => ({ ...current, message: t('working'), error: false, errorCode: null }))
|
|
841
|
+
try {
|
|
842
|
+
const result = unwrap(await api.saveRuntimeSettings({ port }), 'saveRuntimeSettings')
|
|
843
|
+
if (result.success === false) {
|
|
844
|
+
setView((current) => ({ ...current, message: result.error?.message || t('actionFailed'), error: true, errorCode: result.error?.code || null }))
|
|
845
|
+
return
|
|
846
|
+
}
|
|
847
|
+
setPortDirty(false)
|
|
848
|
+
setPortDraft(String(result.settings.port))
|
|
849
|
+
setView((current) => ({ ...current, message: `${t('runtimePortSaved')}: ${result.settings.runtimeUrl}`, error: false, errorCode: null }))
|
|
850
|
+
await refresh()
|
|
851
|
+
} catch (error) {
|
|
852
|
+
setView((current) => ({ ...current, message: `${t('actionFailed')}: ${String(error.message || error)}`, error: true, errorCode: 'REMOTE_ERROR' }))
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
if (view.phase === 'loading') return jsx('p', { className: 'foggy-message', children: t('loading') })
|
|
857
|
+
if (view.phase === 'error') return jsxs('div', { className: 'foggy-settings', children: [
|
|
858
|
+
jsx('p', { className: 'foggy-message', 'data-error': true, children: `${t('failed')} ${view.message}` }),
|
|
859
|
+
jsx('button', { className: 'foggy-button', type: 'button', onClick: refresh, children: t('retry') }),
|
|
860
|
+
] })
|
|
861
|
+
|
|
862
|
+
const status = view.status
|
|
863
|
+
const busy = sequenceBusy || status.operation?.state === 'running'
|
|
864
|
+
const portNumber = Number(portDraft)
|
|
865
|
+
const portValid = Number.isInteger(portNumber) && portNumber >= 1024 && portNumber <= 65535
|
|
866
|
+
const operationError = status.operation?.state === 'failed'
|
|
867
|
+
? status.operation.error || status.operation.result?.error?.message || t('actionFailed')
|
|
868
|
+
: ''
|
|
869
|
+
const operationErrorCode = status.operation?.state === 'failed' ? status.operation.result?.error?.code || null : null
|
|
870
|
+
const settingsError = status.runtimeSettings?.valid === false
|
|
871
|
+
? status.runtimeSettings.error || t('settingsInvalidTitle')
|
|
872
|
+
: ''
|
|
873
|
+
const portConflict = status.runtimeSettings?.conflictApplies ? status.runtimeSettings.lastConflict : null
|
|
874
|
+
const validationError = portDirty && !portValid ? t('portInvalidMessage') : ''
|
|
875
|
+
const rawAlertMessage = validationError || (view.error ? view.message : '') || operationError || settingsError || portConflict?.message || ''
|
|
876
|
+
const alertCode = validationError
|
|
877
|
+
? 'RUNTIME_PORT_INVALID'
|
|
878
|
+
: view.error
|
|
879
|
+
? view.errorCode
|
|
880
|
+
: operationErrorCode || (settingsError ? 'RUNTIME_SETTINGS_INVALID' : portConflict ? 'RUNTIME_PORT_UNAVAILABLE' : null)
|
|
881
|
+
const alertTitle = alertCode === 'RUNTIME_PORT_UNAVAILABLE'
|
|
882
|
+
? t('portUnavailableTitle')
|
|
883
|
+
: alertCode === 'RUNTIME_PORT_INVALID'
|
|
884
|
+
? t('portInvalidTitle')
|
|
885
|
+
: alertCode === 'RUNTIME_SETTINGS_INVALID'
|
|
886
|
+
? t('settingsInvalidTitle')
|
|
887
|
+
: t('errorTitle')
|
|
888
|
+
const alertMessage = alertCode === 'RUNTIME_PORT_UNAVAILABLE'
|
|
889
|
+
? `${t('runtimePort')} ${portConflict?.port ?? status.runtimeSettings?.port ?? portNumber} ${t('portUnavailableMessage')}`
|
|
890
|
+
: rawAlertMessage
|
|
891
|
+
const alertHelp = alertCode === 'RUNTIME_PORT_UNAVAILABLE'
|
|
892
|
+
? t('portUnavailableHelp')
|
|
893
|
+
: alertCode === 'RUNTIME_PORT_INVALID'
|
|
894
|
+
? t('portInvalidHelp')
|
|
895
|
+
: alertCode === 'RUNTIME_RUNNING_UPDATE_REQUIRES_STOP'
|
|
896
|
+
? t('updateBlockedRunning')
|
|
897
|
+
: ''
|
|
898
|
+
const progress = busy ? progressPanel(status.operation?.progress, t) : null
|
|
899
|
+
const pendingUpdates = updateSummary(status, t)
|
|
900
|
+
const hasPendingUpdates = pendingUpdates.length > 0
|
|
901
|
+
const stateLabels = { 'not-installed': 'notInstalled', degraded: 'degraded', ready: 'ready', running: 'running' }
|
|
902
|
+
return jsxs('section', { className: 'foggy-settings', children: [
|
|
903
|
+
jsxs('div', { className: 'foggy-hero', children: [
|
|
904
|
+
jsxs('div', { className: 'foggy-title-row', children: [jsx('h3', { children: t('title') }), jsx('span', { className: 'foggy-beta', children: t('beta') })] }),
|
|
905
|
+
jsx('p', { className: 'foggy-intro', children: t('intro') }),
|
|
906
|
+
] }),
|
|
907
|
+
jsxs('div', { className: 'foggy-resources', children: [
|
|
908
|
+
jsx('h4', { children: t('resourceTitle') }),
|
|
909
|
+
jsxs('div', { className: 'foggy-resource-links', children: [
|
|
910
|
+
jsx('a', { className: 'foggy-resource-link', href: 'https://ai-data.qlfloor.com/', target: '_blank', rel: 'noreferrer noopener', title: t('openExternal'), children: t('tutorial') }),
|
|
911
|
+
jsx('a', { className: 'foggy-resource-link', href: 'https://github.com/foggy-projects/foggy-deepseek-harness-plugin#readme', target: '_blank', rel: 'noreferrer noopener', title: t('openExternal'), children: t('docs') }),
|
|
912
|
+
jsx('a', { className: 'foggy-resource-link', href: 'https://github.com/foggy-projects/foggy-deepseek-harness-plugin', target: '_blank', rel: 'noreferrer noopener', title: t('openExternal'), children: t('project') }),
|
|
913
|
+
jsx('a', { className: 'foggy-resource-link', href: 'https://github.com/foggy-projects/foggy-deepseek-harness-plugin/releases', target: '_blank', rel: 'noreferrer noopener', title: t('openExternal'), children: t('releases') }),
|
|
914
|
+
jsx('a', { className: 'foggy-resource-link', href: 'https://github.com/foggy-projects/foggy-data-mcp-bridge', target: '_blank', rel: 'noreferrer noopener', title: t('openExternal'), children: t('runtimeProject') }),
|
|
915
|
+
] }),
|
|
916
|
+
] }),
|
|
917
|
+
jsxs('div', { className: 'foggy-toolbar', children: [
|
|
918
|
+
jsxs('div', { className: 'foggy-state', children: [jsx('span', { className: 'foggy-dot', 'data-state': status.state }), jsx('span', { children: `${t(stateLabels[status.state] || 'notInstalled')}${hasPendingUpdates ? ` · ${t('updateAvailable')}` : ''}` })] }),
|
|
919
|
+
jsxs('div', { className: 'foggy-toolbar-main', children: [
|
|
920
|
+
status.state === 'not-installed'
|
|
921
|
+
? jsx('button', { className: 'foggy-button foggy-button-primary', type: 'button', disabled: busy, onClick: () => runSequence(['initializeAndStart'], t('initializeAndStartDone')), children: t('initializeAndStart') })
|
|
922
|
+
: status.running
|
|
923
|
+
? jsx('button', { className: 'foggy-button', type: 'button', disabled: busy, onClick: () => run('runtimeStop'), children: t('stop') })
|
|
924
|
+
: hasPendingUpdates && status.components.java.available
|
|
925
|
+
? jsx('button', { className: 'foggy-button foggy-button-primary', type: 'button', disabled: busy, onClick: () => runSequence(['updateComponents', 'runtimeStart'], t('updateAndStartDone')), children: t('updateAndStart') })
|
|
926
|
+
: status.installed && status.components.java.available
|
|
927
|
+
? jsx('button', { className: 'foggy-button foggy-button-primary', type: 'button', disabled: busy, onClick: () => run('runtimeStart'), children: t('start') })
|
|
928
|
+
: jsx('button', { className: 'foggy-button foggy-button-primary', type: 'button', disabled: busy, onClick: () => run('updateComponents'), children: t('updateComponents') }),
|
|
929
|
+
] }),
|
|
930
|
+
jsxs('div', { className: 'foggy-toolbar-secondary', children: [
|
|
931
|
+
jsx('button', { className: 'foggy-button', type: 'button', disabled: busy, onClick: refresh, children: t('refresh') }),
|
|
932
|
+
jsx('button', { className: 'foggy-button', type: 'button', disabled: busy, onClick: () => run('diagnostics'), children: t('diagnostics') }),
|
|
933
|
+
status.state !== 'not-installed' && !status.running && hasPendingUpdates
|
|
934
|
+
? jsx('button', { className: 'foggy-button', type: 'button', disabled: busy, onClick: () => run('updateComponents'), children: t('updateComponents') })
|
|
935
|
+
: null,
|
|
936
|
+
] }),
|
|
937
|
+
] }),
|
|
938
|
+
errorPanel(alertTitle, alertMessage, alertHelp),
|
|
939
|
+
progress,
|
|
940
|
+
busy ? jsx('p', { className: 'foggy-message', children: t('working') }) : null,
|
|
941
|
+
!busy && view.message && !view.error && !operationError ? jsx('p', { className: 'foggy-message', children: view.message }) : null,
|
|
942
|
+
!busy && hasPendingUpdates ? jsxs('div', { className: 'foggy-update-banner', role: 'status', children: [
|
|
943
|
+
jsx('strong', { children: t('updateAvailable') }),
|
|
944
|
+
jsx('span', { children: ` · ${status.running ? t('updateBlockedRunning') : t('updateReady')}` }),
|
|
945
|
+
jsx('ul', { className: 'foggy-update-list', children: pendingUpdates.map((item) => jsx('li', { children: item }, item)) }),
|
|
946
|
+
] }) : null,
|
|
947
|
+
jsx(ComponentVersionsPanel, { api, status, busy, onUse: (input) => run('useComponentVersion', input), t }),
|
|
948
|
+
jsxs('div', { className: 'foggy-runtime-settings', children: [
|
|
949
|
+
jsx('h4', { children: t('runtimeSettingsTitle') }),
|
|
950
|
+
jsxs('div', { className: 'foggy-runtime-settings-row', children: [
|
|
951
|
+
jsxs('div', { className: 'foggy-field', children: [
|
|
952
|
+
jsx('label', { htmlFor: 'foggy-runtime-port', children: t('runtimePort') }),
|
|
953
|
+
jsx('input', {
|
|
954
|
+
id: 'foggy-runtime-port',
|
|
955
|
+
className: 'foggy-input',
|
|
956
|
+
type: 'number',
|
|
957
|
+
min: 1024,
|
|
958
|
+
max: 65535,
|
|
959
|
+
step: 1,
|
|
960
|
+
value: portDraft,
|
|
961
|
+
disabled: busy || status.running,
|
|
962
|
+
'aria-invalid': portDirty && !portValid ? 'true' : undefined,
|
|
963
|
+
onChange: (event) => {
|
|
964
|
+
setPortDraft(event.target.value)
|
|
965
|
+
setPortDirty(true)
|
|
966
|
+
setView((current) => ({ ...current, message: '', error: false, errorCode: null }))
|
|
967
|
+
},
|
|
968
|
+
}),
|
|
969
|
+
] }),
|
|
970
|
+
jsxs('div', { className: 'foggy-setting-meta', children: [
|
|
971
|
+
jsx('span', { children: t('runtimePortHint') }),
|
|
972
|
+
jsx('code', { children: `${t('configuredRuntimeUrl')}: http://127.0.0.1:${portValid ? portNumber : '—'}` }),
|
|
973
|
+
status.running ? jsx('span', { children: t('stopToChangePort') }) : null,
|
|
974
|
+
] }),
|
|
975
|
+
jsx('button', {
|
|
976
|
+
className: 'foggy-button foggy-button-primary',
|
|
977
|
+
type: 'button',
|
|
978
|
+
disabled: busy || status.running || !portDirty || !portValid,
|
|
979
|
+
onClick: saveRuntimePort,
|
|
980
|
+
children: t('saveRuntimePort'),
|
|
981
|
+
}),
|
|
982
|
+
] }),
|
|
983
|
+
] }),
|
|
984
|
+
jsxs('div', { className: 'foggy-grid', children: [
|
|
985
|
+
componentCard(t('python'), status.components.python, 'tool', t),
|
|
986
|
+
componentCard(t('java'), status.components.java, 'tool', t),
|
|
987
|
+
componentCard(t('cli'), status.components.cli, 'runtime', t),
|
|
988
|
+
componentCard(t('launcher'), status.components.launcher, 'runtime', t),
|
|
989
|
+
componentCard(t('analysisSkill'), status.components.analysisSkill, 'runtime', t),
|
|
990
|
+
componentCard(t('semanticQuerySkill'), status.components.semanticQuerySkill, 'runtime', t),
|
|
991
|
+
componentCard(t('onboardingSkill'), status.components.onboardingSkill, 'runtime', t),
|
|
992
|
+
componentCard(t('skillRegistry'), { installed: status.components.onboardingSkill?.provider === 'foggy-managed-skills', version: 'native' }, 'runtime', t),
|
|
993
|
+
] }),
|
|
994
|
+
jsxs('div', { className: 'foggy-section', children: [
|
|
995
|
+
jsx('h4', { children: t('repairTitle') }),
|
|
996
|
+
jsxs('div', { className: 'foggy-section-actions', children: [
|
|
997
|
+
jsx('button', { className: 'foggy-button', type: 'button', disabled: busy || status.running, title: status.running ? t('updateBlockedRunning') : undefined, onClick: () => run('repairPython'), children: t('repairPython') }),
|
|
998
|
+
jsx('button', { className: 'foggy-button', type: 'button', disabled: busy || status.running, title: status.running ? t('updateBlockedRunning') : undefined, onClick: () => run('repairCli'), children: t('repairCli') }),
|
|
999
|
+
jsx('button', { className: 'foggy-button', type: 'button', disabled: busy || status.running, title: status.running ? t('updateBlockedRunning') : undefined, onClick: () => run('repairLauncher'), children: t('repairLauncher') }),
|
|
1000
|
+
jsx('button', { className: 'foggy-button', type: 'button', disabled: busy || status.running, title: status.running ? t('updateBlockedRunning') : undefined, onClick: () => run('repairAnalysisSkill'), children: t('repairAnalysisSkill') }),
|
|
1001
|
+
jsx('button', { className: 'foggy-button', type: 'button', disabled: busy || status.running, title: status.running ? t('updateBlockedRunning') : undefined, onClick: () => run('repairSemanticQuerySkill'), children: t('repairSemanticQuerySkill') }),
|
|
1002
|
+
] }),
|
|
1003
|
+
] }),
|
|
1004
|
+
status.profileMigration?.pendingCount || status.profileMigration?.conflictCount ? jsxs('div', { className: 'foggy-warning', children: [
|
|
1005
|
+
jsx('h4', { children: t('profileMigrationTitle') }),
|
|
1006
|
+
jsx('p', { children: status.profileMigration.conflictCount ? t('profileMigrationConflict') : t('profileMigrationPending') }),
|
|
1007
|
+
!status.profileMigration.conflictCount ? jsx('div', { className: 'foggy-section-actions', children: jsx('button', {
|
|
1008
|
+
className: 'foggy-button foggy-button-primary', type: 'button', disabled: busy,
|
|
1009
|
+
onClick: () => run('migrateProfiles'), children: t('migrateProfiles'),
|
|
1010
|
+
}) }) : null,
|
|
1011
|
+
] }) : null,
|
|
1012
|
+
onboardingPanel(status.onboarding, t),
|
|
1013
|
+
jsxs('div', { className: 'foggy-paths', children: [
|
|
1014
|
+
jsx('h4', { children: t('roots') }),
|
|
1015
|
+
jsxs('dl', { children: [
|
|
1016
|
+
jsx('dt', { children: t('installRoot') }), jsx('dd', { children: status.roots.installRoot }),
|
|
1017
|
+
jsx('dt', { children: t('dataRoot') }), jsx('dd', { children: status.roots.dataRoot }),
|
|
1018
|
+
jsx('dt', { children: t('profileStore') }), jsx('dd', { children: status.roots.profileStore }),
|
|
1019
|
+
status.runtimeUrl ? jsx('dt', { children: t('runtimeUrl') }) : null,
|
|
1020
|
+
status.runtimeUrl ? jsx('dd', { children: status.runtimeUrl }) : null,
|
|
1021
|
+
] }),
|
|
1022
|
+
] }),
|
|
1023
|
+
jsxs('div', { className: 'foggy-next', children: [jsx('h4', { children: t('nextTitle') }), jsx('p', { children: t('nextCopy') })] }),
|
|
1024
|
+
] })
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
function queryPreviewSupported(args, result) {
|
|
1028
|
+
const payload = args?.payload
|
|
1029
|
+
return Boolean(result?.execution?.success) && payload && Array.isArray(payload.columns) && payload.columns.length > 0
|
|
1030
|
+
&& Array.isArray(payload.slice) && payload.slice.length > 0
|
|
1031
|
+
&& !('executable_plan' in payload) && !('executablePlan' in payload) && payload.route !== 'DSL_CTE'
|
|
1032
|
+
&& Object.keys(payload).every((key) => ['columns', 'slice', 'having', 'groupBy', 'orderBy', 'calculatedFields', 'extData', 'start', 'limit', 'returnTotal'].includes(key))
|
|
1033
|
+
&& ['slice', 'having', 'calculatedFields'].every((key) => !payload[key] || Array.isArray(payload[key]) && payload[key].every((item) => item && typeof item === 'object' && !Array.isArray(item)))
|
|
1034
|
+
&& ['groupBy', 'orderBy'].every((key) => !payload[key] || Array.isArray(payload[key]) && payload[key].every((item) => typeof item === 'string' && item.trim() || item && typeof item === 'object' && !Array.isArray(item)))
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
function queryPreviewUnavailableHint(args, t) {
|
|
1038
|
+
const filterRequired = !Array.isArray(args?.payload?.slice) || args.payload.slice.length === 0
|
|
1039
|
+
return [t('queryCardUnsupported'), filterRequired ? t('queryCardFilterRequired') : null].filter(Boolean).join(' ')
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
function useViewerPreview(api) {
|
|
1043
|
+
const [preview, setPreview] = useState({ loading: false, error: '', authorizationMode: null })
|
|
1044
|
+
async function openViewer(args) {
|
|
1045
|
+
const pendingTab = window.open('about:blank', '_blank')
|
|
1046
|
+
setPreview({ loading: true, error: '', authorizationMode: null })
|
|
1047
|
+
try {
|
|
1048
|
+
const value = unwrap(await api.createViewerPreview({ model: args.model, namespace: args.namespace, payload: args.payload }), 'createViewerPreview')
|
|
1049
|
+
if (pendingTab) pendingTab.location.replace(value.url)
|
|
1050
|
+
else throw new Error('Browser blocked the DataViewer tab')
|
|
1051
|
+
setPreview({ loading: false, error: '', authorizationMode: value.authorizationMode || null })
|
|
1052
|
+
} catch (error) {
|
|
1053
|
+
if (pendingTab) pendingTab.close()
|
|
1054
|
+
setPreview({ loading: false, error: String(error?.message || error), authorizationMode: null })
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
return { preview, openViewer }
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
function readSuccessfulQuery(block) {
|
|
1061
|
+
if (block?.kind !== 'tool-result' || block.isError || block.call?.name !== 'foggy_query') return null
|
|
1062
|
+
try {
|
|
1063
|
+
const args = JSON.parse(block.call.argsRaw)
|
|
1064
|
+
const text = block.content?.find((item) => item.type === 'text')?.text
|
|
1065
|
+
const result = JSON.parse(text)
|
|
1066
|
+
if (!result?.execution?.success || !args?.model || !args?.namespace || !Array.isArray(result.execution.data?.items)) return null
|
|
1067
|
+
return { callId: block.callId, args, result }
|
|
1068
|
+
} catch { return null }
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
function cellText(value) {
|
|
1072
|
+
const raw = value === null || value === undefined ? '—' : typeof value === 'object' ? JSON.stringify(value) : String(value)
|
|
1073
|
+
return raw.length > 160 ? `${raw.slice(0, 157)}…` : raw
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
function FoggyTurnQuery({ query, api, t }) {
|
|
1077
|
+
const [expanded, setExpanded] = useState(false)
|
|
1078
|
+
const { preview, openViewer } = useViewerPreview(api)
|
|
1079
|
+
const rows = query.result.execution.data.items
|
|
1080
|
+
const fields = rows.length && rows[0] && typeof rows[0] === 'object' ? Object.keys(rows[0]) : []
|
|
1081
|
+
const supported = queryPreviewSupported(query.args, query.result)
|
|
1082
|
+
return jsxs('div', { className: 'foggy-turn-result', children: [
|
|
1083
|
+
jsxs('div', { className: 'foggy-turn-result-head', children: [
|
|
1084
|
+
jsxs('div', { className: 'foggy-turn-result-name', children: [
|
|
1085
|
+
query.args.model,
|
|
1086
|
+
jsx('span', { className: 'foggy-turn-result-meta', children: `${query.args.namespace} · ${rows.length} ${t('queryCardRowUnit')}` }),
|
|
1087
|
+
] }),
|
|
1088
|
+
jsxs('div', { className: 'foggy-turn-result-actions', children: [
|
|
1089
|
+
jsx('button', { type: 'button', 'aria-expanded': expanded, onClick: () => setExpanded((current) => !current), children: t(expanded ? 'queryCardHideResult' : 'queryCardShowResult') }),
|
|
1090
|
+
supported ? jsx('button', { type: 'button', disabled: preview.loading, onClick: () => openViewer(query.args), children: preview.loading ? t('queryCardOpening') : t('queryCardOpen') }) : null,
|
|
1091
|
+
] }),
|
|
1092
|
+
] }),
|
|
1093
|
+
!supported ? jsx('p', { className: 'foggy-turn-result-note', children: queryPreviewUnavailableHint(query.args, t) }) : null,
|
|
1094
|
+
expanded ? jsxs('div', { className: 'foggy-turn-result-detail', children: [
|
|
1095
|
+
rows.length && fields.length ? jsxs('table', { children: [
|
|
1096
|
+
jsx('thead', { children: jsx('tr', { children: fields.map((field) => jsx('th', { scope: 'col', children: field }, field)) }) }),
|
|
1097
|
+
jsx('tbody', { children: rows.slice(0, 5).map((row, index) => jsx('tr', { children: fields.map((field) => jsx('td', { children: cellText(row[field]) }, field)) }, index)) }),
|
|
1098
|
+
] }) : jsx('p', { className: 'foggy-turn-result-note', children: t('queryCardNoRows') }),
|
|
1099
|
+
rows.length > 5 ? jsx('p', { className: 'foggy-turn-result-note', children: t('queryCardTableMore', { count: 5 }) }) : null,
|
|
1100
|
+
jsxs('details', { className: 'foggy-turn-result-code', children: [
|
|
1101
|
+
jsx('summary', { children: t('queryCardDsl') }),
|
|
1102
|
+
jsx('pre', { children: JSON.stringify(query.args.payload, null, 2) }),
|
|
1103
|
+
query.result.execution.data.debug?.extra?.sql ? jsx('pre', { children: query.result.execution.data.debug.extra.sql }) : null,
|
|
1104
|
+
] }),
|
|
1105
|
+
] }) : null,
|
|
1106
|
+
preview.error ? jsx('p', { className: 'foggy-turn-result-error', role: 'alert', children: preview.error }) : null,
|
|
1107
|
+
preview.authorizationMode === 'local-development' ? jsx('p', { className: 'foggy-turn-result-note', role: 'status', children: t('queryCardLocalDevelopment') }) : null,
|
|
1108
|
+
] })
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
function FoggyTurnResults({ turn, useQueryCalls, api, t }) {
|
|
1112
|
+
const [showAll, setShowAll] = useState(false)
|
|
1113
|
+
const calls = useQueryCalls(String(turn.turn)) || []
|
|
1114
|
+
const queries = calls.map((item) => readSuccessfulQuery(item.root)).filter(Boolean)
|
|
1115
|
+
if (!queries.length) return null
|
|
1116
|
+
const visible = showAll ? queries : queries.slice(0, 6)
|
|
1117
|
+
return jsxs('section', { className: 'foggy-turn-results', 'aria-label': t('queryCardResults'), children: [
|
|
1118
|
+
jsxs('div', { className: 'foggy-turn-results-head', children: [
|
|
1119
|
+
t('queryCardResults'), jsx('span', { className: 'foggy-turn-results-count', children: queries.length }),
|
|
1120
|
+
jsx('span', { className: 'foggy-turn-results-provenance', children: t('queryCardProvenance') }),
|
|
1121
|
+
jsx('span', { className: 'foggy-turn-results-source', children: t('queryCardSource') }),
|
|
1122
|
+
] }),
|
|
1123
|
+
...visible.map((query) => jsx(FoggyTurnQuery, { query, api, t }, query.callId)),
|
|
1124
|
+
queries.length > 6 ? jsx('button', {
|
|
1125
|
+
className: 'foggy-turn-results-toggle', type: 'button', 'aria-expanded': showAll,
|
|
1126
|
+
onClick: () => setShowAll((current) => !current),
|
|
1127
|
+
children: showAll ? t('queryCardShowLess') : t('queryCardShowAll', { count: queries.length }),
|
|
1128
|
+
}) : null,
|
|
1129
|
+
] })
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
function FoggyQueryCard({ phase, block, api, t }) {
|
|
1133
|
+
const { preview, openViewer } = useViewerPreview(api)
|
|
1134
|
+
let args = null
|
|
1135
|
+
let result = null
|
|
1136
|
+
let outputText = ''
|
|
1137
|
+
try {
|
|
1138
|
+
const raw = phase === 'result' ? block.call?.argsRaw : phase === 'start' ? block.argsRaw : null
|
|
1139
|
+
if (raw) args = JSON.parse(raw)
|
|
1140
|
+
if (phase === 'result') {
|
|
1141
|
+
outputText = block.content?.find((item) => item.type === 'text')?.text || ''
|
|
1142
|
+
if (outputText) result = JSON.parse(outputText)
|
|
1143
|
+
}
|
|
1144
|
+
} catch {}
|
|
1145
|
+
const success = phase === 'result' && !block.isError && Boolean(result?.execution?.success)
|
|
1146
|
+
const rows = result?.execution?.data?.items?.length
|
|
1147
|
+
const sql = result?.execution?.data?.debug?.extra?.sql
|
|
1148
|
+
const payload = args?.payload
|
|
1149
|
+
const hasAdHocColumns = payload?.columns?.some((column) => typeof column === 'string' && /\bas\b|\(/i.test(column))
|
|
1150
|
+
const supported = success && queryPreviewSupported(args, result)
|
|
1151
|
+
const box = { border: '1px solid var(--dsw-alias-border-l2)', borderRadius: 10, padding: 12, margin: '8px 0', fontSize: 13 }
|
|
1152
|
+
return jsxs('section', { style: box, children: [
|
|
1153
|
+
jsx('strong', { children: `${t('queryCardTitle')}${args?.model ? ` · ${args.model}` : ''}` }),
|
|
1154
|
+
jsx('p', { style: { margin: '6px 0', color: 'var(--dsw-alias-label-secondary)' }, children: success ? `${t('queryCardDone')}${Number.isInteger(rows) ? ` · ${t('queryCardRows')} ${rows}` : ''}` : phase === 'result' ? t('queryCardFailed') : t('queryCardRunning') }),
|
|
1155
|
+
args?.namespace ? jsx('code', { children: `namespace: ${args.namespace}` }) : null,
|
|
1156
|
+
success ? jsxs('details', { style: { marginTop: 8 }, children: [
|
|
1157
|
+
jsx('summary', { style: { cursor: 'pointer' }, children: t('queryCardDetails') }),
|
|
1158
|
+
sql ? jsx('pre', { style: { maxHeight: 180, overflow: 'auto', whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }, children: sql }) : null,
|
|
1159
|
+
jsx('pre', { style: { maxHeight: 260, overflow: 'auto', whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }, children: JSON.stringify({ dsl: payload, validation: result.validation, execution: result.execution }, null, 2).slice(0, 30000) }),
|
|
1160
|
+
] }) : null,
|
|
1161
|
+
phase === 'result' && !success ? jsxs('details', { style: { marginTop: 8 }, children: [
|
|
1162
|
+
jsx('summary', { style: { cursor: 'pointer' }, children: t('queryCardFailed') }),
|
|
1163
|
+
jsx('pre', { style: { maxHeight: 260, overflow: 'auto', whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }, children: (outputText || JSON.stringify(block)).slice(0, 6000) }),
|
|
1164
|
+
] }) : null,
|
|
1165
|
+
supported ? jsxs('div', { style: { marginTop: 10 }, children: [
|
|
1166
|
+
jsx('button', { type: 'button', disabled: preview.loading, onClick: () => openViewer(args), children: preview.loading ? t('queryCardOpening') : t('queryCardOpen') }),
|
|
1167
|
+
jsx('p', { style: { margin: '5px 0', color: 'var(--dsw-alias-label-tertiary)', fontSize: 11 }, children: t('queryCardPreviewHint') }),
|
|
1168
|
+
hasAdHocColumns ? jsx('p', { style: { margin: '5px 0', color: 'var(--dsw-alias-state-warning-primary)', fontSize: 11 }, children: t('queryCardComputedHint') }) : null,
|
|
1169
|
+
preview.error ? jsx('p', { role: 'alert', style: { color: 'var(--dsw-alias-state-error-primary)' }, children: preview.error }) : null,
|
|
1170
|
+
preview.authorizationMode === 'local-development' ? jsx('p', { role: 'status', style: { margin: '5px 0', color: 'var(--dsw-alias-label-tertiary)', fontSize: 11 }, children: t('queryCardLocalDevelopment') }) : null,
|
|
1171
|
+
] }) : success ? jsx('p', { style: { margin: '8px 0 0', color: 'var(--dsw-alias-label-tertiary)' }, children: queryPreviewUnavailableHint(args, t) }) : null,
|
|
1172
|
+
] })
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
const inject = ['slots', 'locale', 'remote', 'sessions', 'uiConversation']
|
|
1176
|
+
|
|
1177
|
+
async function apply(ctx) {
|
|
1178
|
+
const disposeRemote = await ctx.remote.$mount(TYPERT_REMOTE)
|
|
1179
|
+
ctx.effect(() => disposeRemote, 'foggy: remote contribution')
|
|
1180
|
+
ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'foggy: settings dictionaries')
|
|
1181
|
+
const t = ctx.locale.bind(NS)
|
|
1182
|
+
ctx.inject(['remote.foggyIntegration'], (remoteCtx) => {
|
|
1183
|
+
const api = remoteCtx.remote.foggyIntegration
|
|
1184
|
+
remoteCtx.slots.inject('tool.call.toolview', () => remoteCtx.slots.register({
|
|
1185
|
+
name: 'tool.call.toolview',
|
|
1186
|
+
key: 'foggy_query',
|
|
1187
|
+
inject: () => ({ api, t }),
|
|
1188
|
+
}, FoggyQueryCard))
|
|
1189
|
+
remoteCtx.slots.inject('conversation.chat.turnTail', () => remoteCtx.slots.register({
|
|
1190
|
+
name: 'conversation.chat.turnTail',
|
|
1191
|
+
id: 'foggy-query-results',
|
|
1192
|
+
inject: (sessionId) => {
|
|
1193
|
+
const binding = remoteCtx.sessions.binding(sessionId)
|
|
1194
|
+
if (!binding) throw new Error(`Foggy: unknown session ${sessionId}`)
|
|
1195
|
+
const chat = remoteCtx.uiConversation.binding(binding).target('chat')
|
|
1196
|
+
return {
|
|
1197
|
+
api, t,
|
|
1198
|
+
keyedHooks: { queryCalls: (turn) => {
|
|
1199
|
+
const snapshot = chat.getSnapshot()
|
|
1200
|
+
if (!snapshot) throw new Error('Foggy: chat target is unavailable')
|
|
1201
|
+
return snapshot.nodes.turnDataSource(Number(turn), 'tool-call')
|
|
1202
|
+
} },
|
|
1203
|
+
}
|
|
1204
|
+
},
|
|
1205
|
+
}, FoggyTurnResults))
|
|
1206
|
+
remoteCtx.slots.inject('settings.plugins.tab', () => remoteCtx.slots.register({
|
|
1207
|
+
name: 'settings.plugins.tab',
|
|
1208
|
+
id: 'foggy',
|
|
1209
|
+
order: 5,
|
|
1210
|
+
label: () => t('tab'),
|
|
1211
|
+
locale: NS,
|
|
1212
|
+
inject: () => ({ api, t }),
|
|
1213
|
+
}, FoggySettingsTab))
|
|
1214
|
+
})
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
exports.NS = NS
|
|
1218
|
+
exports.inject = inject
|
|
1219
|
+
exports.apply = apply
|
|
1220
|
+
return module.exports
|
|
1221
|
+
},
|
|
1222
|
+
})
|