@foggy-projects/deepseek-harness-plugin 0.4.2-rc.2 → 0.4.2-rc.3
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 +15 -4
- package/docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.3.md +34 -0
- package/docs/WINDOWS-BETA-ACCEPTANCE.md +4 -4
- package/experience/linux/prepare.sh +1 -1
- package/lib/client.js +99 -0
- package/lib/index.js +10 -1
- package/lib/query-tool.js +104 -0
- package/lib/remote-descriptor.js +11 -0
- package/lib/viewer-preview.js +27 -0
- package/package.json +8 -4
- package/skills/foggy-deepseek-onboarding/SKILL.md +6 -0
- package/skills/foggy-deepseek-onboarding/assets/versions.json +16 -16
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ are downloaded only when the user selects **Initialize and start** (or the
|
|
|
7
7
|
equivalent component action). Existing installations are not silently changed
|
|
8
8
|
when the plugin package is upgraded.
|
|
9
9
|
|
|
10
|
-
The `0.4.2-rc.
|
|
10
|
+
The `0.4.2-rc.3` compatibility candidate targets DeepSeek Harness `0.1.7-rc.2`
|
|
11
11
|
and requires a system Node.js `>=24.0.0`. Foggy's Java Launcher uses a system
|
|
12
12
|
Java 17+. Foggy manages its own pinned Python 3.12 runtime
|
|
13
13
|
inside the per-user component directory; it does not require a system Python,
|
|
@@ -17,7 +17,7 @@ modify `PATH`, or register Python globally. Advanced users may explicitly set
|
|
|
17
17
|
## Local release-candidate installation
|
|
18
18
|
|
|
19
19
|
```powershell
|
|
20
|
-
dsh plugin --profile web add --workspace-root ./foggy-projects-deepseek-harness-plugin-0.4.2-rc.
|
|
20
|
+
dsh plugin --profile web add --workspace-root ./foggy-projects-deepseek-harness-plugin-0.4.2-rc.3.tgz
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Restart `dsh web`, use the browser it opens (or the complete printed URL,
|
|
@@ -28,11 +28,11 @@ Install the exact DSH 0.1.7-rc.2 compatibility candidate
|
|
|
28
28
|
so the stable `beta` channel is not changed:
|
|
29
29
|
|
|
30
30
|
```powershell
|
|
31
|
-
dsh plugin --profile web add --workspace-root @foggy-projects/deepseek-harness-plugin@0.4.2-rc.
|
|
31
|
+
dsh plugin --profile web add --workspace-root @foggy-projects/deepseek-harness-plugin@0.4.2-rc.3
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
The `dsh017` npm dist-tag points to the most recently published DSH 0.1.7
|
|
35
|
-
candidate (`0.4.2-rc.
|
|
35
|
+
candidate (`0.4.2-rc.3` at this release). Check the resolved version before
|
|
36
36
|
using this moving tag:
|
|
37
37
|
|
|
38
38
|
```powershell
|
|
@@ -130,6 +130,15 @@ same wildcard binding used by the Java server, so a conflicting application or W
|
|
|
130
130
|
port proxy produces an immediate, high-visibility error instead of a readiness timeout.
|
|
131
131
|
The CLI and Skills resolve the resulting stable Runtime URL from managed state.
|
|
132
132
|
|
|
133
|
+
For a successful standard QueryModel DSL call made through the native
|
|
134
|
+
`foggy_query` tool, Harness shows a query card with the model, namespace,
|
|
135
|
+
row count, DSL, and execution result. Its **Open DataViewer** action creates
|
|
136
|
+
a local preview URL only when clicked; the query itself does not create one.
|
|
137
|
+
The preview re-executes the DSL against the current model and data rather than
|
|
138
|
+
freezing the original rows. In the lite Runtime the preview cache is bounded,
|
|
139
|
+
process-local, and lost on restart. CTE calls are not included in this first
|
|
140
|
+
DataViewer integration.
|
|
141
|
+
|
|
133
142
|
This beta remains a local dev/test integration. It does not automatically extend
|
|
134
143
|
local credentials or approvals into a formal environment. Production model
|
|
135
144
|
publication should use a separate manual or dedicated deployment workflow with
|
|
@@ -139,6 +148,8 @@ rollback plan.
|
|
|
139
148
|
See [`docs/PUBLIC-BETA-READINESS.md`](./docs/PUBLIC-BETA-READINESS.md) for the
|
|
140
149
|
tested public Beta scope, release gates, and stable-release blockers.
|
|
141
150
|
The DSH 0.1.7-rc.2 compatibility candidate is documented in
|
|
151
|
+
[`docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.3.md`](./docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.3.md).
|
|
152
|
+
The previous DSH 0.1.7-rc.2 candidate is documented in
|
|
142
153
|
[`docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.2.md`](./docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.2.md).
|
|
143
154
|
The earlier DSH 0.1.5-rc.2 candidate is documented in
|
|
144
155
|
[`docs/RELEASE-CANDIDATE-0.4.1-DSH-0.1.5-RC.1.md`](./docs/RELEASE-CANDIDATE-0.4.1-DSH-0.1.5-RC.1.md).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Foggy DeepSeek Harness plugin 0.4.2-rc.3
|
|
2
|
+
|
|
3
|
+
This pre-release targets DeepSeek Harness `0.1.7-rc.2` on the `dsh017` npm
|
|
4
|
+
channel. It keeps the `beta`, `rc`, and `dsh015` channels unchanged.
|
|
5
|
+
|
|
6
|
+
## Changes since 0.4.2-rc.2
|
|
7
|
+
|
|
8
|
+
- Add a native `foggy_query` tool for bounded, read-only standard QueryModel DSL
|
|
9
|
+
validation and execution. Successful calls render a Harness card with the
|
|
10
|
+
model, namespace, row count, DSL, SQL, and result.
|
|
11
|
+
- Create a DataViewer preview URL only when the card's **Open DataViewer**
|
|
12
|
+
action is clicked. Links are short-lived local development previews, not
|
|
13
|
+
frozen result snapshots. An expired link can be regenerated from the card.
|
|
14
|
+
- Update the managed Launcher to `0.1.22`. Its lite profile serves the existing
|
|
15
|
+
DataViewer UI using a bounded in-memory cache without MongoDB, and its start
|
|
16
|
+
scripts bind to loopback. Runtime restarts invalidate preview links.
|
|
17
|
+
- Do not claim CTE preview support in this release. Existing CTE execution
|
|
18
|
+
remains available through its prior CLI path without a DataViewer card.
|
|
19
|
+
|
|
20
|
+
## Acceptance scope
|
|
21
|
+
|
|
22
|
+
- Plugin checks: `npm run check`, Node tests, Python onboarding tests, and an
|
|
23
|
+
isolated DSH `0.1.7-rc.2` web boot with the Foggy settings tab visible.
|
|
24
|
+
- Launcher: formal release gate, default and Analytics Console smokes, six
|
|
25
|
+
GitHub assets, and SHA-256 verification.
|
|
26
|
+
- End-to-end DSL: an isolated Java Runtime with SQLite demo data validates and
|
|
27
|
+
executes a QueryModel query. A click-generated DataViewer link shows actual
|
|
28
|
+
columns and six rows in the browser.
|
|
29
|
+
|
|
30
|
+
Install the exact version with:
|
|
31
|
+
|
|
32
|
+
```powershell
|
|
33
|
+
dsh plugin --profile web add --workspace-root @foggy-projects/deepseek-harness-plugin@0.4.2-rc.3
|
|
34
|
+
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Native Windows Beta acceptance
|
|
2
2
|
|
|
3
3
|
This runbook validates DeepSeek Harness `0.1.7-rc.2` with Foggy plugin
|
|
4
|
-
`0.4.2-rc.
|
|
4
|
+
`0.4.2-rc.3` on a clean 64-bit Windows 10 or Windows 11 machine. Use a local
|
|
5
5
|
directory that is not synchronized by OneDrive.
|
|
6
6
|
|
|
7
7
|
## Prerequisites
|
|
@@ -29,7 +29,7 @@ Set-Location C:\FoggyAcceptance
|
|
|
29
29
|
|
|
30
30
|
npx --yes --package=@deepseek-ai/dsh@0.1.7-rc.2 --package=pnpm@11.7.0 `
|
|
31
31
|
dsh plugin --profile web add --workspace-root `
|
|
32
|
-
"@foggy-projects/deepseek-harness-plugin@0.4.2-rc.
|
|
32
|
+
"@foggy-projects/deepseek-harness-plugin@0.4.2-rc.3"
|
|
33
33
|
|
|
34
34
|
npx --yes --package=@deepseek-ai/dsh@0.1.7-rc.2 --package=pnpm@11.7.0 dsh web
|
|
35
35
|
```
|
|
@@ -66,9 +66,9 @@ Expected component state:
|
|
|
66
66
|
|
|
67
67
|
- Python 3.12.13, source `Foggy private`;
|
|
68
68
|
- CLI 0.1.23;
|
|
69
|
-
- Launcher 0.1.
|
|
69
|
+
- Launcher 0.1.22;
|
|
70
70
|
- analysis/query Skills 0.1.18;
|
|
71
|
-
- onboarding Skill 0.4.2-rc.
|
|
71
|
+
- onboarding Skill 0.4.2-rc.3;
|
|
72
72
|
- Java 17+ available;
|
|
73
73
|
- native DSH Skill registration available.
|
|
74
74
|
|
package/lib/client.js
CHANGED
|
@@ -17,6 +17,15 @@ window.__ModuleLoader__.load({
|
|
|
17
17
|
return { port }
|
|
18
18
|
},
|
|
19
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
|
+
}
|
|
20
29
|
const descriptor = (method, parameters = []) => ({
|
|
21
30
|
id: `@foggy-projects/deepseek-harness-plugin#foggyIntegration/${method}`,
|
|
22
31
|
service: 'foggyIntegration',
|
|
@@ -50,6 +59,15 @@ window.__ModuleLoader__.load({
|
|
|
50
59
|
create: () => runtimeSettingsInputSchema,
|
|
51
60
|
},
|
|
52
61
|
}]),
|
|
62
|
+
descriptor('createViewerPreview', [{
|
|
63
|
+
name: 'input', wire: 'input', source: 'json',
|
|
64
|
+
codec: {
|
|
65
|
+
mode: 'strict',
|
|
66
|
+
typeSymbol: '@foggy-projects/deepseek-harness-plugin#FoggyViewerPreviewInput',
|
|
67
|
+
schema: viewerPreviewInputSchema,
|
|
68
|
+
create: () => viewerPreviewInputSchema,
|
|
69
|
+
},
|
|
70
|
+
}]),
|
|
53
71
|
],
|
|
54
72
|
}
|
|
55
73
|
|
|
@@ -149,6 +167,16 @@ window.__ModuleLoader__.load({
|
|
|
149
167
|
queryWarningSummary: 'Runtime 在 WARN 模式下忽略了未知的查询属性,查询仍已执行。请检查告警代码与证据后决定是否修正模型或请求。',
|
|
150
168
|
queryWarningCodes: '告警代码',
|
|
151
169
|
queryWarningEvidence: '证据目录',
|
|
170
|
+
queryCardTitle: 'Foggy DSL 查询',
|
|
171
|
+
queryCardRunning: '正在校验并执行…',
|
|
172
|
+
queryCardDone: '校验与查询成功',
|
|
173
|
+
queryCardFailed: '查询失败;可展开查看错误',
|
|
174
|
+
queryCardRows: '返回行数',
|
|
175
|
+
queryCardDetails: '查看 DSL 与执行结果',
|
|
176
|
+
queryCardOpen: '打开 DataViewer 数据页',
|
|
177
|
+
queryCardOpening: '正在生成预览链接…',
|
|
178
|
+
queryCardPreviewHint: '链接仅在点击时生成,默认有效期 60 分钟;Runtime 重启后失效。这是开发预览,非结果快照。',
|
|
179
|
+
queryCardUnsupported: '当前查询不支持 DataViewer 预览,可继续查看查询结果。',
|
|
152
180
|
stepPlanned: '规划',
|
|
153
181
|
stepDatasourceConfigured: '数据库连接',
|
|
154
182
|
stepDatasourceVerified: '连接验证',
|
|
@@ -274,6 +302,16 @@ window.__ModuleLoader__.load({
|
|
|
274
302
|
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.',
|
|
275
303
|
queryWarningCodes: 'Warning codes',
|
|
276
304
|
queryWarningEvidence: 'Evidence directory',
|
|
305
|
+
queryCardTitle: 'Foggy DSL query',
|
|
306
|
+
queryCardRunning: 'Validating and executing…',
|
|
307
|
+
queryCardDone: 'Validation and query succeeded',
|
|
308
|
+
queryCardFailed: 'Query failed; expand for details',
|
|
309
|
+
queryCardRows: 'Rows',
|
|
310
|
+
queryCardDetails: 'Show DSL and execution result',
|
|
311
|
+
queryCardOpen: 'Open DataViewer',
|
|
312
|
+
queryCardOpening: 'Creating preview link…',
|
|
313
|
+
queryCardPreviewHint: 'The link is created on click, expires after 60 minutes or a Runtime restart, and is a development preview rather than a result snapshot.',
|
|
314
|
+
queryCardUnsupported: 'DataViewer preview is unavailable for this query; the query result remains available.',
|
|
277
315
|
stepPlanned: 'Plan',
|
|
278
316
|
stepDatasourceConfigured: 'Database connection',
|
|
279
317
|
stepDatasourceVerified: 'Connection test',
|
|
@@ -779,6 +817,62 @@ window.__ModuleLoader__.load({
|
|
|
779
817
|
] })
|
|
780
818
|
}
|
|
781
819
|
|
|
820
|
+
function FoggyQueryCard({ phase, block, api, t }) {
|
|
821
|
+
const [preview, setPreview] = useState({ loading: false, url: '', expiresAt: 0, error: '' })
|
|
822
|
+
let args = null
|
|
823
|
+
let result = null
|
|
824
|
+
let outputText = ''
|
|
825
|
+
try {
|
|
826
|
+
const raw = phase === 'result' ? block.call?.argsRaw : phase === 'start' ? block.argsRaw : null
|
|
827
|
+
if (raw) args = JSON.parse(raw)
|
|
828
|
+
if (phase === 'result') {
|
|
829
|
+
outputText = block.content?.find((item) => item.type === 'text')?.text || ''
|
|
830
|
+
if (outputText) result = JSON.parse(outputText)
|
|
831
|
+
}
|
|
832
|
+
} catch {}
|
|
833
|
+
const success = phase === 'result' && !block.isError && Boolean(result?.execution?.success)
|
|
834
|
+
const rows = result?.execution?.data?.items?.length
|
|
835
|
+
const sql = result?.execution?.data?.debug?.extra?.sql
|
|
836
|
+
const payload = args?.payload
|
|
837
|
+
const supported = success && payload && Array.isArray(payload.columns) && payload.columns.length > 0
|
|
838
|
+
&& !('executable_plan' in payload) && !('executablePlan' in payload) && payload.route !== 'DSL_CTE'
|
|
839
|
+
&& Object.keys(payload).every((key) => ['columns', 'slice', 'groupBy', 'orderBy', 'calculatedFields', 'extData', 'start', 'limit', 'returnTotal'].includes(key))
|
|
840
|
+
&& ['slice', 'groupBy', 'orderBy', 'calculatedFields'].every((key) => !payload[key] || Array.isArray(payload[key]) && payload[key].every((item) => item && typeof item === 'object' && !Array.isArray(item)))
|
|
841
|
+
async function openViewer() {
|
|
842
|
+
const pendingTab = window.open('about:blank', '_blank')
|
|
843
|
+
setPreview({ loading: true, url: '', expiresAt: 0, error: '' })
|
|
844
|
+
try {
|
|
845
|
+
const value = unwrap(await api.createViewerPreview({ model: args.model, namespace: args.namespace, payload }), 'createViewerPreview')
|
|
846
|
+
setPreview({ loading: false, url: value.url, expiresAt: Date.now() + value.expiresInMinutes * 60_000, error: '' })
|
|
847
|
+
if (pendingTab) pendingTab.location.replace(value.url)
|
|
848
|
+
} catch (error) {
|
|
849
|
+
if (pendingTab) pendingTab.close()
|
|
850
|
+
setPreview({ loading: false, url: '', expiresAt: 0, error: String(error?.message || error) })
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
const box = { border: '1px solid var(--dsw-alias-border-l2)', borderRadius: 10, padding: 12, margin: '8px 0', fontSize: 13 }
|
|
854
|
+
return jsxs('section', { style: box, children: [
|
|
855
|
+
jsx('strong', { children: `${t('queryCardTitle')}${args?.model ? ` · ${args.model}` : ''}` }),
|
|
856
|
+
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') }),
|
|
857
|
+
args?.namespace ? jsx('code', { children: `namespace: ${args.namespace}` }) : null,
|
|
858
|
+
success ? jsxs('details', { style: { marginTop: 8 }, children: [
|
|
859
|
+
jsx('summary', { style: { cursor: 'pointer' }, children: t('queryCardDetails') }),
|
|
860
|
+
sql ? jsx('pre', { style: { maxHeight: 180, overflow: 'auto', whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }, children: sql }) : null,
|
|
861
|
+
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) }),
|
|
862
|
+
] }) : null,
|
|
863
|
+
phase === 'result' && !success ? jsxs('details', { style: { marginTop: 8 }, children: [
|
|
864
|
+
jsx('summary', { style: { cursor: 'pointer' }, children: t('queryCardFailed') }),
|
|
865
|
+
jsx('pre', { style: { maxHeight: 260, overflow: 'auto', whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }, children: (outputText || JSON.stringify(block)).slice(0, 6000) }),
|
|
866
|
+
] }) : null,
|
|
867
|
+
supported ? jsxs('div', { style: { marginTop: 10 }, children: [
|
|
868
|
+
jsx('button', { type: 'button', disabled: preview.loading, onClick: openViewer, children: preview.loading ? t('queryCardOpening') : t('queryCardOpen') }),
|
|
869
|
+
jsx('p', { style: { margin: '5px 0', color: 'var(--dsw-alias-label-tertiary)', fontSize: 11 }, children: t('queryCardPreviewHint') }),
|
|
870
|
+
preview.url && Date.now() < preview.expiresAt ? jsx('a', { href: preview.url, target: '_blank', rel: 'noopener noreferrer', children: preview.url }) : null,
|
|
871
|
+
preview.error ? jsx('p', { role: 'alert', style: { color: 'var(--dsw-alias-state-error-primary)' }, children: preview.error }) : null,
|
|
872
|
+
] }) : success ? jsx('p', { style: { margin: '8px 0 0', color: 'var(--dsw-alias-label-tertiary)' }, children: t('queryCardUnsupported') }) : null,
|
|
873
|
+
] })
|
|
874
|
+
}
|
|
875
|
+
|
|
782
876
|
const inject = ['slots', 'locale', 'remote']
|
|
783
877
|
|
|
784
878
|
async function apply(ctx) {
|
|
@@ -788,6 +882,11 @@ window.__ModuleLoader__.load({
|
|
|
788
882
|
const t = ctx.locale.bind(NS)
|
|
789
883
|
ctx.inject(['remote.foggyIntegration'], (remoteCtx) => {
|
|
790
884
|
const api = remoteCtx.remote.foggyIntegration
|
|
885
|
+
remoteCtx.slots.inject('tool.call.toolview', () => remoteCtx.slots.register({
|
|
886
|
+
name: 'tool.call.toolview',
|
|
887
|
+
key: 'foggy_query',
|
|
888
|
+
inject: () => ({ api, t }),
|
|
889
|
+
}, FoggyQueryCard))
|
|
791
890
|
remoteCtx.slots.inject('settings.plugins.tab', () => remoteCtx.slots.register({
|
|
792
891
|
name: 'settings.plugins.tab',
|
|
793
892
|
id: 'foggy',
|
package/lib/index.js
CHANGED
|
@@ -10,6 +10,8 @@ import { writeJsonAtomic } from './atomic-json.js'
|
|
|
10
10
|
import { ensurePythonRuntime, probePythonRuntime } from './python-runtime.js'
|
|
11
11
|
import { compatible, compatibleNode } from './version.js'
|
|
12
12
|
import { enrichRuntimeStartFailure } from './diagnostics.js'
|
|
13
|
+
import { createFoggyQueryTool, managedConnection } from './query-tool.js'
|
|
14
|
+
import { createViewerPreview } from './viewer-preview.js'
|
|
13
15
|
import {
|
|
14
16
|
DEFAULT_RUNTIME_PORT,
|
|
15
17
|
readRuntimeSettings,
|
|
@@ -210,7 +212,7 @@ function operationView(operation) {
|
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
export class FoggyIntegrationGateway extends TypertRemoteService {
|
|
213
|
-
static inject = ['skills']
|
|
215
|
+
static inject = ['skills', 'tools']
|
|
214
216
|
|
|
215
217
|
operation = null
|
|
216
218
|
skillProviderControl = null
|
|
@@ -222,9 +224,15 @@ export class FoggyIntegrationGateway extends TypertRemoteService {
|
|
|
222
224
|
this.skillProviderControl = control
|
|
223
225
|
return createFoggySkillProvider({ installRoot: roots.installRoot, versionsFile })
|
|
224
226
|
})
|
|
227
|
+
ctx.tools.register(createFoggyQueryTool(roots))
|
|
225
228
|
for (const initialize of markerInitializers) initialize.call(this)
|
|
226
229
|
}
|
|
227
230
|
|
|
231
|
+
async createViewerPreview(input) {
|
|
232
|
+
const { runtimeUrl } = await managedConnection(defaultRoots())
|
|
233
|
+
return createViewerPreview(input, runtimeUrl)
|
|
234
|
+
}
|
|
235
|
+
|
|
228
236
|
async status() {
|
|
229
237
|
const roots = defaultRoots()
|
|
230
238
|
const statePath = join(roots.installRoot, 'install-state.json')
|
|
@@ -672,6 +680,7 @@ for (const method of [
|
|
|
672
680
|
'status', 'plan', 'initialize', 'initializeAndStart', 'repair', 'updateComponents', 'repairPython', 'repairCli', 'repairLauncher', 'repairAnalysisSkill', 'repairSemanticQuerySkill',
|
|
673
681
|
'migrateProfiles', 'diagnostics', 'runtimeStart', 'runtimeStop',
|
|
674
682
|
'saveRuntimeSettings',
|
|
683
|
+
'createViewerPreview',
|
|
675
684
|
]) {
|
|
676
685
|
Remote(method)(FoggyIntegrationGateway.prototype[method], {
|
|
677
686
|
kind: 'method',
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process'
|
|
2
|
+
import { mkdtemp, readFile, rmdir, unlink, writeFile } from 'node:fs/promises'
|
|
3
|
+
import { tmpdir } from 'node:os'
|
|
4
|
+
import { join } from 'node:path'
|
|
5
|
+
import { promisify } from 'node:util'
|
|
6
|
+
import { defineTool } from '@deepseek-ai/dsh-tools'
|
|
7
|
+
|
|
8
|
+
const execFileAsync = promisify(execFile)
|
|
9
|
+
const identifier = /^[A-Za-z0-9_.-]{1,128}$/
|
|
10
|
+
|
|
11
|
+
export function assertStandardDsl(payload) {
|
|
12
|
+
if (!payload || typeof payload !== 'object' || Array.isArray(payload)) throw new Error('Query DSL must be a JSON object')
|
|
13
|
+
if (payload.route === 'DSL_CTE' || 'executable_plan' in payload || 'executablePlan' in payload) {
|
|
14
|
+
throw new Error('CTE preview is not supported in this release; use a standard QM DSL query')
|
|
15
|
+
}
|
|
16
|
+
if (!Array.isArray(payload.columns) || payload.columns.length === 0 || !payload.columns.every((item) => typeof item === 'string')) {
|
|
17
|
+
throw new Error('Standard QM DSL requires non-empty columns')
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function previewPayload(payload) {
|
|
22
|
+
assertStandardDsl(payload)
|
|
23
|
+
const supported = new Set(['columns', 'slice', 'groupBy', 'orderBy', 'calculatedFields', 'extData'])
|
|
24
|
+
const unsupported = Object.keys(payload).filter((key) => !supported.has(key) && !['start', 'limit', 'returnTotal'].includes(key))
|
|
25
|
+
if (unsupported.length) throw new Error(`DataViewer preview does not support: ${unsupported.join(', ')}`)
|
|
26
|
+
for (const key of ['slice', 'groupBy', 'orderBy', 'calculatedFields']) {
|
|
27
|
+
if (payload[key] !== undefined && (!Array.isArray(payload[key]) || payload[key].some((item) => !item || typeof item !== 'object' || Array.isArray(item)))) {
|
|
28
|
+
throw new Error(`DataViewer preview requires object-form ${key} entries`)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return Object.fromEntries([...supported].filter((key) => payload[key] !== undefined).map((key) => [key, payload[key]]))
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function safeRuntimeUrl(value) {
|
|
35
|
+
const url = new URL(value)
|
|
36
|
+
if (url.protocol !== 'http:' || !['127.0.0.1', 'localhost', '[::1]'].includes(url.hostname)
|
|
37
|
+
|| url.username || url.password || url.pathname !== '/' || url.search || url.hash) {
|
|
38
|
+
throw new Error('Managed Runtime URL must be a plain loopback HTTP origin')
|
|
39
|
+
}
|
|
40
|
+
return url.origin
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function managedConnection(roots) {
|
|
44
|
+
const install = JSON.parse(await readFile(join(roots.installRoot, 'install-state.json'), 'utf8'))
|
|
45
|
+
const runtime = JSON.parse(await readFile(join(roots.dataRoot, 'runtime-state.json'), 'utf8'))
|
|
46
|
+
if (!install.cli?.command) throw new Error('Foggy CLI is not installed')
|
|
47
|
+
return { cli: install.cli.command, runtimeUrl: safeRuntimeUrl(runtime.runtimeUrl) }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function cliJson(cli, runtimeUrl, namespace, command, signal) {
|
|
51
|
+
const { stdout } = await execFileAsync(cli, ['--base-url', runtimeUrl, '--namespace', namespace, '--output', 'json', ...command], {
|
|
52
|
+
signal,
|
|
53
|
+
windowsHide: true,
|
|
54
|
+
timeout: 120_000,
|
|
55
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
56
|
+
})
|
|
57
|
+
const value = JSON.parse(stdout.trim())
|
|
58
|
+
if (value?.success !== true) throw new Error(value?.error?.message || value?.error?.code || 'Foggy query failed')
|
|
59
|
+
return value
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function createFoggyQueryTool(roots) {
|
|
63
|
+
return defineTool({
|
|
64
|
+
name: 'foggy_query',
|
|
65
|
+
description: 'Validate and execute a bounded, read-only standard Foggy QueryModel DSL query against the managed local Runtime. On success Harness shows a query card; its DataViewer preview link is created only if the user clicks Open DataViewer. CTE is not supported here.',
|
|
66
|
+
parameters: {
|
|
67
|
+
model: { type: 'string', required: true, description: 'Published Foggy QueryModel name' },
|
|
68
|
+
namespace: { type: 'string', required: true, description: 'Foggy namespace' },
|
|
69
|
+
payload: { type: 'object', additionalProperties: true, required: true, description: 'Standard QueryModel DSL, including explicit columns and bounded limit' },
|
|
70
|
+
},
|
|
71
|
+
output: {
|
|
72
|
+
schema: { type: 'object', additionalProperties: false, properties: {
|
|
73
|
+
model: { type: 'string', required: true },
|
|
74
|
+
namespace: { type: 'string', required: true },
|
|
75
|
+
validation: { type: 'json', required: true },
|
|
76
|
+
execution: { type: 'json', required: true },
|
|
77
|
+
} },
|
|
78
|
+
render: (_args, value) => [{ type: 'text', text: JSON.stringify(value) }],
|
|
79
|
+
},
|
|
80
|
+
timeoutMs: 150_000,
|
|
81
|
+
async execute({ model, namespace, payload }, exec) {
|
|
82
|
+
if (!identifier.test(model) || !identifier.test(namespace)) throw new Error('Invalid model or namespace')
|
|
83
|
+
assertStandardDsl(payload)
|
|
84
|
+
if (!Number.isInteger(payload.limit) || payload.limit < 1 || payload.limit > 100) {
|
|
85
|
+
throw new Error('Query DSL limit must be an integer from 1 to 100')
|
|
86
|
+
}
|
|
87
|
+
const { cli, runtimeUrl } = await managedConnection(roots)
|
|
88
|
+
const directory = await mkdtemp(join(tmpdir(), 'foggy-dsh-query-'))
|
|
89
|
+
const payloadPath = join(directory, 'query.json')
|
|
90
|
+
try {
|
|
91
|
+
await writeFile(payloadPath, JSON.stringify(payload), { encoding: 'utf8', flag: 'wx' })
|
|
92
|
+
const validation = await cliJson(cli, runtimeUrl, namespace, ['query', 'validate', model, '--payload', payloadPath], exec.signal)
|
|
93
|
+
const execution = await cliJson(cli, runtimeUrl, namespace, ['query', 'execute', model, '--payload', payloadPath], exec.signal)
|
|
94
|
+
return { model, namespace, validation, execution }
|
|
95
|
+
} finally {
|
|
96
|
+
await unlink(payloadPath).catch(() => {})
|
|
97
|
+
await rmdir(directory).catch(() => {})
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
presentCall({ model }) {
|
|
101
|
+
return { card: 'generic', title: `Foggy DSL · ${model}`, kind: 'read' }
|
|
102
|
+
},
|
|
103
|
+
})
|
|
104
|
+
}
|
package/lib/remote-descriptor.js
CHANGED
|
@@ -4,6 +4,11 @@ const resultSchema = z.unknown()
|
|
|
4
4
|
const runtimeSettingsInputSchema = z.object({
|
|
5
5
|
port: z.number().int().min(1024).max(65535),
|
|
6
6
|
}).strict()
|
|
7
|
+
const viewerPreviewInputSchema = z.object({
|
|
8
|
+
model: z.string(),
|
|
9
|
+
namespace: z.string(),
|
|
10
|
+
payload: z.record(z.string(), z.unknown()),
|
|
11
|
+
}).strict()
|
|
7
12
|
|
|
8
13
|
function strictCodec(typeSymbol, schema) {
|
|
9
14
|
return {
|
|
@@ -45,4 +50,10 @@ export const descriptors = [
|
|
|
45
50
|
source: 'json',
|
|
46
51
|
codec: strictCodec('@foggy-projects/deepseek-harness-plugin#FoggyRuntimeSettingsInput', runtimeSettingsInputSchema),
|
|
47
52
|
}]),
|
|
53
|
+
descriptor('createViewerPreview', [{
|
|
54
|
+
name: 'input',
|
|
55
|
+
wire: 'input',
|
|
56
|
+
source: 'json',
|
|
57
|
+
codec: strictCodec('@foggy-projects/deepseek-harness-plugin#FoggyViewerPreviewInput', viewerPreviewInputSchema),
|
|
58
|
+
}]),
|
|
48
59
|
]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { previewPayload, safeRuntimeUrl } from './query-tool.js'
|
|
2
|
+
|
|
3
|
+
const identifier = /^[A-Za-z0-9_.-]{1,128}$/
|
|
4
|
+
|
|
5
|
+
export async function createViewerPreview({ model, namespace, payload }, runtimeUrl, fetcher = fetch) {
|
|
6
|
+
if (!identifier.test(model) || !identifier.test(namespace)) throw new Error('Invalid model or namespace')
|
|
7
|
+
const origin = safeRuntimeUrl(runtimeUrl)
|
|
8
|
+
const body = { model, namespace, title: `${model} · Harness preview`, payload: previewPayload(payload) }
|
|
9
|
+
const response = await fetcher(`${origin}/data-viewer/api/query/create`, {
|
|
10
|
+
method: 'POST',
|
|
11
|
+
headers: { 'content-type': 'application/json' },
|
|
12
|
+
body: JSON.stringify(body),
|
|
13
|
+
signal: AbortSignal.timeout(12_000),
|
|
14
|
+
})
|
|
15
|
+
if (!response.ok) throw new Error(`DataViewer unavailable (HTTP ${response.status}); update and restart the managed Runtime`)
|
|
16
|
+
const envelope = await response.json()
|
|
17
|
+
const result = envelope?.data
|
|
18
|
+
if (envelope?.code !== 200 || result?.success !== true || typeof result.viewerUrl !== 'string') {
|
|
19
|
+
throw new Error(envelope?.msg || result?.error || 'DataViewer did not return a preview link')
|
|
20
|
+
}
|
|
21
|
+
const url = new URL(result.viewerUrl, origin)
|
|
22
|
+
if (url.origin !== origin || !url.pathname.startsWith(`/data-viewer/view/${encodeURIComponent(model)}/`)
|
|
23
|
+
|| url.username || url.password || url.search || url.hash) {
|
|
24
|
+
throw new Error('DataViewer returned an unexpected preview URL')
|
|
25
|
+
}
|
|
26
|
+
return { success: true, url: url.href, queryId: result.queryId, expiresInMinutes: 60 }
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foggy-projects/deepseek-harness-plugin",
|
|
3
|
-
"version": "0.4.2-rc.
|
|
3
|
+
"version": "0.4.2-rc.3",
|
|
4
4
|
"description": "Foggy Java data analysis engine integration for DeepSeek Harness",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"docs/RELEASE-CANDIDATE-0.4.0-RC.3.md",
|
|
42
42
|
"docs/RELEASE-CANDIDATE-0.4.1-DSH-0.1.5-RC.1.md",
|
|
43
43
|
"docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.2.md",
|
|
44
|
+
"docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.3.md",
|
|
44
45
|
"docs/RELEASE-CANDIDATE-0.4.2-DSH-0.1.7-RC.1.md",
|
|
45
46
|
"docs/COMMUNITY-MARKETPLACES.md",
|
|
46
47
|
"docs/WINDOWS-BETA-ACCEPTANCE.md",
|
|
@@ -61,11 +62,13 @@
|
|
|
61
62
|
"@deepseek-ai/dsh-api-remotes",
|
|
62
63
|
"@deepseek-ai/dsh-client-locale",
|
|
63
64
|
"@deepseek-ai/dsh-client-ui-settings",
|
|
64
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins"
|
|
65
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins",
|
|
66
|
+
"@deepseek-ai/dsh-client-ui-tool"
|
|
65
67
|
]
|
|
66
68
|
}
|
|
67
69
|
},
|
|
68
70
|
"dependencies": {
|
|
71
|
+
"@deepseek-ai/dsh-tools": "0.1.7-rc.2",
|
|
69
72
|
"zod": "^4.4.3"
|
|
70
73
|
},
|
|
71
74
|
"peerDependencies": {
|
|
@@ -74,11 +77,12 @@
|
|
|
74
77
|
"@deepseek-ai/dsh-client-locale": "^0.1.7-rc.2",
|
|
75
78
|
"@deepseek-ai/dsh-client-ui-settings": "^0.1.7-rc.2",
|
|
76
79
|
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.7-rc.2",
|
|
80
|
+
"@deepseek-ai/dsh-client-ui-tool": "^0.1.7-rc.2",
|
|
77
81
|
"@deepseek-ai/dsh-skill": "^0.1.7-rc.2",
|
|
78
82
|
"@deepseek-ai/dsh-typert-protocol": "^0.1.7-rc.2"
|
|
79
83
|
},
|
|
80
84
|
"scripts": {
|
|
81
|
-
"check": "node --check lib/index.js && node --check lib/atomic-json.js && node --check lib/diagnostics.js && node --check lib/python-runtime.js && node --check lib/runtime-settings.js && node --check lib/skill-provider.js && node --check lib/client.js && node --check lib/typert.js && node --check lib/remote.js",
|
|
82
|
-
"test": "node --test test/package.test.js && node test/run-onboarding-tests.js"
|
|
85
|
+
"check": "node --check lib/index.js && node --check lib/query-tool.js && node --check lib/viewer-preview.js && node --check lib/atomic-json.js && node --check lib/diagnostics.js && node --check lib/python-runtime.js && node --check lib/runtime-settings.js && node --check lib/skill-provider.js && node --check lib/client.js && node --check lib/typert.js && node --check lib/remote.js",
|
|
86
|
+
"test": "node --test test/package.test.js test/viewer-preview.test.js && node test/run-onboarding-tests.js"
|
|
83
87
|
}
|
|
84
88
|
}
|
|
@@ -60,6 +60,12 @@ are authoritative; do not copy the Skill into the current workspace.
|
|
|
60
60
|
6. Iterate through model validation, Bundle registration/update, model refresh/describe, query
|
|
61
61
|
validation, and bounded query execution. Development publication means making the local model
|
|
62
62
|
directory effective in this local Runtime; it is not a production release.
|
|
63
|
+
For the final user-facing standard DSL query in Harness, use the native `foggy_query` tool when
|
|
64
|
+
available (explicit namespace, published QM, `columns`, and `limit` of 1–100). It validates and
|
|
65
|
+
executes, then displays a query card. The card creates a DataViewer preview link only if the user
|
|
66
|
+
clicks its button; never pre-create links for every query. This first version does not support
|
|
67
|
+
`DSL_CTE` or `executable_plan` in the native tool. Continue using the documented CLI route for
|
|
68
|
+
CTE queries and do not claim they have a DataViewer preview.
|
|
63
69
|
A successful response may still contain Runtime `warnings`. Preserve and report their stable facts
|
|
64
70
|
(`code`, `path`, `message`, `suggestedNextAction`, `safeToAutoRepair`, `normalizedFragment`,
|
|
65
71
|
`docsRef`, and `details.allowedProperties`)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "foggy-deepseek-onboarding-versions/v1",
|
|
3
|
-
"packageVersion": "0.4.2-rc.
|
|
4
|
-
"validatedAt": "2026-09-
|
|
3
|
+
"packageVersion": "0.4.2-rc.3",
|
|
4
|
+
"validatedAt": "2026-09-28",
|
|
5
5
|
"components": {
|
|
6
6
|
"deepseekHarness": {
|
|
7
7
|
"version": "0.1.7-rc.2",
|
|
@@ -66,39 +66,39 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"launcher": {
|
|
69
|
-
"version": "0.1.
|
|
69
|
+
"version": "0.1.22",
|
|
70
70
|
"minimumJavaVersion": "17.0.0",
|
|
71
71
|
"runtimeApiContract": "foggy-runtime-api/v1",
|
|
72
72
|
"assets": [
|
|
73
73
|
{
|
|
74
|
-
"file": "foggy-runtime-launcher-0.1.
|
|
75
|
-
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.
|
|
76
|
-
"sha256": "
|
|
74
|
+
"file": "foggy-runtime-launcher-0.1.22.jar",
|
|
75
|
+
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.22/foggy-runtime-launcher-0.1.22.jar",
|
|
76
|
+
"sha256": "c26d21ff50323d6adc3124e084462f8381407c6f79802cefac90f4ddafa00dca"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"file": "start-foggy-runtime.ps1",
|
|
80
|
-
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.
|
|
81
|
-
"sha256": "
|
|
80
|
+
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.22/start-foggy-runtime.ps1",
|
|
81
|
+
"sha256": "dcfaa3d4e512e72f16e6d44dda00ae27f0cfc164763cac73c0ee63fd4b7236bc"
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"file": "start-foggy-runtime.sh",
|
|
85
|
-
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.
|
|
86
|
-
"sha256": "
|
|
85
|
+
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.22/start-foggy-runtime.sh",
|
|
86
|
+
"sha256": "fa304f66679f0323157ea7948fd95fb1082264f115b9b4d688b1995c24b3c1d7"
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
"file": "README-foggy-runtime-launcher.md",
|
|
90
|
-
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.
|
|
91
|
-
"sha256": "
|
|
90
|
+
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.22/README-foggy-runtime-launcher.md",
|
|
91
|
+
"sha256": "43711229b425f13fa242d58916ef17cbd3dcebe4fc18b951aa9bf4befc056c26"
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
"file": "runtime-launcher-manifest.json",
|
|
95
|
-
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.
|
|
96
|
-
"sha256": "
|
|
95
|
+
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.22/runtime-launcher-manifest.json",
|
|
96
|
+
"sha256": "2b9efb82e8f954f2407f36ae419984068d384e1e0b86796ccfad0981dc7b2a30"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"file": "SHA256SUMS",
|
|
100
|
-
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.
|
|
101
|
-
"sha256": "
|
|
100
|
+
"url": "https://github.com/foggy-projects/foggy-data-mcp-bridge/releases/download/foggy-runtime-launcher-v0.1.22/SHA256SUMS",
|
|
101
|
+
"sha256": "51dc530e275bc1c9e9c73e9fce13d236fd0c5e3bfcebd9b03b837c5bc05e59f8"
|
|
102
102
|
}
|
|
103
103
|
]
|
|
104
104
|
},
|