@foggy-projects/deepseek-harness-plugin 0.4.5-rc.1 → 0.4.5-rc.2

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 CHANGED
@@ -10,7 +10,7 @@ when the plugin package is upgraded.
10
10
  The Foggy settings tab includes a **Tutorial** entry linking to
11
11
  [Foggy AI Data tutorials](https://ai-data.qlfloor.com/).
12
12
 
13
- The `0.4.5-rc.1` compatibility candidate targets DeepSeek Harness `0.2.2-rc.3`
13
+ The `0.4.5-rc.2` compatibility candidate targets DeepSeek Harness `0.2.2-rc.3`
14
14
  and requires a system Node.js `>=24.9.0`. Foggy's Java Launcher uses a system
15
15
  Java 17+. Foggy manages its own pinned Python 3.12 runtime
16
16
  inside the per-user component directory; it does not require a system Python,
@@ -20,7 +20,7 @@ modify `PATH`, or register Python globally. Advanced users may explicitly set
20
20
  ## Local release-candidate installation
21
21
 
22
22
  ```powershell
23
- dsh plugin --profile web add --workspace-root ./foggy-projects-deepseek-harness-plugin-0.4.5-rc.1.tgz
23
+ dsh plugin --profile web add --workspace-root ./foggy-projects-deepseek-harness-plugin-0.4.5-rc.2.tgz
24
24
  ```
25
25
 
26
26
  Restart `dsh web`, use the browser it opens (or the complete printed URL,
@@ -31,7 +31,7 @@ After the version is available on npm, install the exact DSH 0.2.2-rc.3
31
31
  compatibility candidate so the stable `beta` channel is not changed:
32
32
 
33
33
  ```powershell
34
- dsh plugin --profile web add --workspace-root @foggy-projects/deepseek-harness-plugin@0.4.5-rc.1
34
+ dsh plugin --profile web add --workspace-root @foggy-projects/deepseek-harness-plugin@0.4.5-rc.2
35
35
  ```
36
36
 
37
37
  DSH 0.2.2 candidates use the `dsh022` npm dist-tag. Check that the tag resolves
@@ -196,8 +196,14 @@ rollback plan.
196
196
 
197
197
  See [`docs/PUBLIC-BETA-READINESS.md`](./docs/PUBLIC-BETA-READINESS.md) for the
198
198
  tested public Beta scope, release gates, and stable-release blockers.
199
+ Initialization downloads the pinned private Python archive before the CLI,
200
+ Launcher, and Skills. Network failures now show the sanitized download URL,
201
+ available failing-host and network-code details, and conditional proxy/VPN
202
+ guidance. HTTP errors include the response status so users can distinguish a
203
+ blocked connection from a missing or denied release asset.
204
+
199
205
  The current DSH 0.2.2-rc.3 compatibility candidate is documented in
200
- [`docs/RELEASE-CANDIDATE-0.4.5-DSH-0.2.2-RC.1.md`](./docs/RELEASE-CANDIDATE-0.4.5-DSH-0.2.2-RC.1.md).
206
+ [`docs/RELEASE-CANDIDATE-0.4.5-DSH-0.2.2-RC.2.md`](./docs/RELEASE-CANDIDATE-0.4.5-DSH-0.2.2-RC.2.md).
201
207
  The previous DSH 0.2.1-rc.2 compatibility candidate is documented in
202
208
  [`docs/RELEASE-CANDIDATE-0.4.4-DSH-0.2.1-RC.1.md`](./docs/RELEASE-CANDIDATE-0.4.4-DSH-0.2.1-RC.1.md).
203
209
  The previous DSH 0.1.7-rc.2 candidate is documented in
@@ -0,0 +1,40 @@
1
+ # Foggy DeepSeek Harness plugin 0.4.5-rc.2
2
+
3
+ This follow-up candidate keeps the DeepSeek Harness `0.2.2-rc.3` compatibility
4
+ target and adds actionable network diagnostics for initialization and component
5
+ release checks. It supersedes `0.4.5-rc.1` for users who need help diagnosing
6
+ download failures.
7
+
8
+ Managed Python downloads now report the sanitized asset URL, the network error
9
+ code, and the failing redirect host when the HTTP client exposes it. Launcher,
10
+ CLI, and Skills downloads report the requested URL and any redirected HTTP
11
+ error URL. Version-check failures identify the GitHub API or release asset
12
+ address. HTTP status errors are distinct from DNS, timeout, TLS, and connection
13
+ failures. Error messages explain when proxy/VPN settings may help; they do not
14
+ present a VPN as a universal fix. URL credentials, query strings, and fragments
15
+ are removed from displayed diagnostics.
16
+
17
+ The compatibility target remains DeepSeek Harness `0.2.2-rc.3`, with system
18
+ Node.js `>=24.9.0`, Java 17+, managed Python `3.12.13`, Launcher `0.1.46`, CLI
19
+ `0.1.25`, and Foggy Skills `0.1.18`.
20
+
21
+ Install the packed candidate in a clean Harness profile:
22
+
23
+ ```powershell
24
+ dsh plugin --profile web add --workspace-root ./foggy-projects-deepseek-harness-plugin-0.4.5-rc.2.tgz
25
+ ```
26
+
27
+ Or install the exact npm candidate:
28
+
29
+ ```powershell
30
+ dsh plugin --profile web add --workspace-root @foggy-projects/deepseek-harness-plugin@0.4.5-rc.2
31
+ ```
32
+
33
+ For the DSH `0.2.2-rc.3` compatibility channel, `@dsh022` points to this
34
+ candidate after publication.
35
+
36
+ ## Verification
37
+
38
+ This document records the source change only. Do not treat the candidate as
39
+ accepted until package and compatibility checks are run on the target Harness
40
+ version and a clean Windows initialization confirms the new diagnostic text.
@@ -3,7 +3,7 @@ set -euo pipefail
3
3
 
4
4
  DSH_VERSION="0.2.2-rc.3"
5
5
  PNPM_VERSION="11.7.0"
6
- PLUGIN_VERSION="0.4.5-rc.1"
6
+ PLUGIN_VERSION="0.4.5-rc.2"
7
7
  PLUGIN_REF="v${PLUGIN_VERSION}"
8
8
  PLUGIN_REPOSITORY="https://github.com/foggy-projects/foggy-deepseek-harness-plugin.git"
9
9
 
@@ -2,6 +2,7 @@ import { createHash } from 'node:crypto'
2
2
  import { readFile } from 'node:fs/promises'
3
3
  import { join } from 'node:path'
4
4
  import { writeJsonAtomic } from './atomic-json.js'
5
+ import { httpFailureMessage, networkFailureMessage } from './network-errors.js'
5
6
 
6
7
  const CACHE_SCHEMA = 'foggy-component-releases/v1'
7
8
  const CACHE_TTL = 6 * 60 * 60_000
@@ -187,17 +188,20 @@ async function requestText(url, { fetchImpl = globalThis.fetch, timeoutMs = 10_0
187
188
  redirect: api ? 'error' : 'follow',
188
189
  headers: { Accept: api ? 'application/vnd.github+json' : 'application/octet-stream', 'User-Agent': 'Foggy-DeepSeek-Harness-Plugin', ...(api ? { 'X-GitHub-Api-Version': '2022-11-28' } : {}) },
189
190
  })
190
- } catch {
191
- fail('COMPONENT_RELEASE_NETWORK', 'Cannot reach the official component release service; check your network and try again.')
191
+ } catch (error) {
192
+ fail('COMPONENT_RELEASE_NETWORK', networkFailureMessage('检查 Launcher/CLI 发布版本', url, error))
192
193
  }
193
194
  if (!response.ok) {
194
- fail('COMPONENT_RELEASE_HTTP', response.status === 403 || response.status === 429
195
- ? 'GitHub release checks are temporarily rate limited; try again later.'
196
- : `Official component release request failed (HTTP ${response.status}).`)
195
+ fail('COMPONENT_RELEASE_HTTP', httpFailureMessage('检查 Launcher/CLI 发布版本', url, response.status))
197
196
  }
198
197
  const length = Number(response.headers?.get?.('content-length'))
199
198
  if (length > maxBytes) fail('COMPONENT_RELEASE_TOO_LARGE', 'Official release metadata exceeds the supported size.')
200
- const bytes = new Uint8Array(await response.arrayBuffer())
199
+ let bytes
200
+ try {
201
+ bytes = new Uint8Array(await response.arrayBuffer())
202
+ } catch (error) {
203
+ fail('COMPONENT_RELEASE_NETWORK', networkFailureMessage('读取 Launcher/CLI 发布信息', url, error))
204
+ }
201
205
  if (bytes.byteLength > maxBytes) fail('COMPONENT_RELEASE_TOO_LARGE', 'Official release metadata exceeds the supported size.')
202
206
  return { text: new TextDecoder('utf-8', { fatal: true }).decode(bytes), bytes }
203
207
  }
@@ -0,0 +1,58 @@
1
+ export function safeNetworkUrl(value) {
2
+ try {
3
+ const url = new URL(value)
4
+ url.username = ''
5
+ url.password = ''
6
+ url.search = ''
7
+ url.hash = ''
8
+ return url.toString()
9
+ } catch {
10
+ return String(value).replace(/[?#].*$/, '')
11
+ }
12
+ }
13
+
14
+ function parsedHost(value) {
15
+ if (typeof value !== 'string' || !value) return null
16
+ try { return new URL(value.includes('://') ? value : `https://${value}`).hostname } catch { return null }
17
+ }
18
+
19
+ function networkDetails(error) {
20
+ const seen = new Set()
21
+ let current = error
22
+ let code = null
23
+ let host = null
24
+ while (current && typeof current === 'object' && !seen.has(current)) {
25
+ seen.add(current)
26
+ const candidateCode = current.code ?? current.errno
27
+ if (!code && (typeof candidateCode === 'string' || typeof candidateCode === 'number')) {
28
+ code = String(candidateCode).slice(0, 80)
29
+ }
30
+ if (!host) host = parsedHost(current.hostname) ?? parsedHost(current.host)
31
+ if (!host && typeof current.message === 'string') {
32
+ host = current.message.match(/(?:ENOTFOUND|getaddrinfo|name or service not known)\s+([a-z0-9.-]+\.[a-z]{2,})/i)?.[1] ?? null
33
+ }
34
+ current = current.cause
35
+ }
36
+ if (!code && error?.name === 'AbortError') code = 'TIMEOUT'
37
+ return { code: code ?? 'FETCH_FAILED', host }
38
+ }
39
+
40
+ export function networkFailureMessage(action, value, error) {
41
+ const target = safeNetworkUrl(value)
42
+ const targetHost = parsedHost(target)
43
+ const { code, host } = networkDetails(error)
44
+ const failedHost = host ?? targetHost ?? 'the requested host'
45
+ const redirect = host && targetHost && host !== targetHost
46
+ ? `检测到连接失败主机:${host}。`
47
+ : ''
48
+ return `${action}失败。请求地址:${target}。${redirect}网络错误码:${code}。请检查网络、代理和防火墙是否允许访问 ${failedHost};如果当前网络限制 GitHub,可能需要配置代理/VPN 或切换到可访问该域名的网络。`
49
+ }
50
+
51
+ export function httpFailureMessage(action, value, status) {
52
+ const target = safeNetworkUrl(value)
53
+ const host = parsedHost(target) ?? 'the requested host'
54
+ const advice = status === 403 || status === 429
55
+ ? '服务端拒绝访问或触发了限流,请稍后重试并检查访问策略。只有当前网络限制该域名时,才需要代理/VPN。'
56
+ : '网络已连接到服务端;请检查链接和发布资源状态。若该网络有访问限制,再检查代理/VPN 设置。'
57
+ return `${action}失败,服务器返回 HTTP ${status}。请求地址:${target}。${advice}(${host})`
58
+ }
@@ -15,6 +15,7 @@ import { constants as fsConstants } from 'node:fs'
15
15
  import { dirname, isAbsolute, join } from 'node:path'
16
16
  import { promisify } from 'node:util'
17
17
  import { compatible, versionParts } from './version.js'
18
+ import { httpFailureMessage, networkFailureMessage, safeNetworkUrl } from './network-errors.js'
18
19
 
19
20
  const execFileAsync = promisify(execFile)
20
21
  const MARKER_SCHEMA = 'foggy-managed-python/v1'
@@ -203,8 +204,14 @@ async function materializeAsset(asset, destination, cacheDirs, onProgress) {
203
204
  const timeout = setTimeout(() => controller.abort(), 20 * 60_000)
204
205
  try {
205
206
  const headers = resumeBytes > 0 ? { Range: `bytes=${resumeBytes}-` } : undefined
206
- const response = await fetch(asset.url, { redirect: 'follow', signal: controller.signal, headers })
207
- if (!response.ok || !response.body) throw new Error(`Managed Python download failed: HTTP ${response.status}`)
207
+ let response
208
+ try {
209
+ response = await fetch(asset.url, { redirect: 'follow', signal: controller.signal, headers })
210
+ } catch (error) {
211
+ throw new Error(networkFailureMessage(`下载托管 Python ${asset.file}`, asset.url, error), { cause: error })
212
+ }
213
+ if (!response.ok) throw new Error(httpFailureMessage(`下载托管 Python ${asset.file}`, asset.url, response.status))
214
+ if (!response.body) throw new Error(`下载托管 Python ${asset.file} 失败:服务器返回了空响应。请求地址:${safeNetworkUrl(asset.url)}`)
208
215
  const resumed = resumeBytes > 0 && response.status === 206
209
216
  if (!resumed) {
210
217
  await rm(temporary, { force: true })
@@ -216,7 +223,13 @@ async function materializeAsset(asset, destination, cacheDirs, onProgress) {
216
223
  try {
217
224
  const reader = response.body.getReader()
218
225
  while (true) {
219
- const { done, value } = await reader.read()
226
+ let chunkResult
227
+ try {
228
+ chunkResult = await reader.read()
229
+ } catch (error) {
230
+ throw new Error(networkFailureMessage(`下载托管 Python ${asset.file}`, asset.url, error), { cause: error })
231
+ }
232
+ const { done, value } = chunkResult
220
233
  if (done) break
221
234
  const chunk = Buffer.from(value)
222
235
  await file.write(chunk)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foggy-projects/deepseek-harness-plugin",
3
- "version": "0.4.5-rc.1",
3
+ "version": "0.4.5-rc.2",
4
4
  "description": "Foggy Java data analysis engine integration for DeepSeek Harness",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -51,7 +51,8 @@
51
51
  "README.md",
52
52
  "docs/RELEASE-CANDIDATE-0.4.3-DSH-0.2.0-RC.1.md",
53
53
  "docs/RELEASE-CANDIDATE-0.4.4-DSH-0.2.1-RC.1.md",
54
- "docs/RELEASE-CANDIDATE-0.4.5-DSH-0.2.2-RC.1.md"
54
+ "docs/RELEASE-CANDIDATE-0.4.5-DSH-0.2.2-RC.1.md",
55
+ "docs/RELEASE-CANDIDATE-0.4.5-DSH-0.2.2-RC.2.md"
55
56
  ],
56
57
  "license": "Apache-2.0",
57
58
  "engines": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "foggy-deepseek-onboarding-versions/v1",
3
- "packageVersion": "0.4.5-rc.1",
4
- "validatedAt": "2026-11-14",
3
+ "packageVersion": "0.4.5-rc.2",
4
+ "validatedAt": "2026-11-15",
5
5
  "components": {
6
6
  "deepseekHarness": {
7
7
  "version": "0.2.2-rc.3",
@@ -7,6 +7,7 @@ import argparse
7
7
  import datetime as dt
8
8
  import errno
9
9
  import hashlib
10
+ import http.client
10
11
  import json
11
12
  import os
12
13
  from pathlib import Path, PurePosixPath
@@ -20,6 +21,7 @@ import tempfile
20
21
  import time
21
22
  import urllib.error
22
23
  import urllib.request
24
+ from urllib.parse import urlsplit, urlunsplit
23
25
  import venv
24
26
  import zipfile
25
27
 
@@ -507,6 +509,54 @@ def cached_asset(name: str, expected: str, cache_dirs: list[Path]) -> Path | Non
507
509
  return None
508
510
 
509
511
 
512
+ def safe_remote_url(value: object) -> str:
513
+ raw = str(value)
514
+ try:
515
+ parsed = urlsplit(raw)
516
+ host = parsed.hostname
517
+ if not parsed.scheme or not host:
518
+ return re.sub(r"[?#].*$", "", raw)
519
+ if ":" in host and not host.startswith("["):
520
+ host = f"[{host}]"
521
+ port = f":{parsed.port}" if parsed.port else ""
522
+ return urlunsplit((parsed.scheme, f"{host}{port}", parsed.path, "", ""))
523
+ except (TypeError, ValueError):
524
+ return re.sub(r"[?#].*$", "", raw)
525
+
526
+
527
+ def download_network_error(asset: dict, url: str, error: BaseException) -> str:
528
+ original_url = safe_remote_url(url)
529
+ failed_url = safe_remote_url(getattr(error, "url", None) or url)
530
+ reason = getattr(error, "reason", error)
531
+ code = getattr(reason, "code", None) or getattr(reason, "errno", None) or getattr(reason, "winerror", None)
532
+ error_kind = "TIMEOUT" if isinstance(reason, TimeoutError) else type(reason).__name__
533
+ if code is not None:
534
+ error_kind += f" ({code})"
535
+ redirect = f" 实际失败地址(跳转后):{failed_url}。" if failed_url != original_url else ""
536
+ host = urlsplit(failed_url).hostname or urlsplit(original_url).hostname or "目标域名"
537
+ return (
538
+ f"下载组件文件 {asset.get('file', 'asset')} 失败,无法连接下载服务。"
539
+ f"下载地址:{original_url}。{redirect}连接错误:{error_kind}。"
540
+ f"请检查网络、代理和防火墙是否允许访问 {host};如果当前网络限制 GitHub,"
541
+ "可能需要配置代理/VPN 或切换到可访问该域名的网络。"
542
+ )
543
+
544
+
545
+ def download_http_error(asset: dict, url: str, error: urllib.error.HTTPError) -> str:
546
+ original_url = safe_remote_url(url)
547
+ failed_url = safe_remote_url(error.url or url)
548
+ redirect = f" 实际响应地址(跳转后):{failed_url}。" if failed_url != original_url else ""
549
+ advice = (
550
+ "服务端拒绝访问或触发限流,请稍后重试并检查访问策略;只有当前网络限制该域名时,才需要代理/VPN。"
551
+ if error.code in (403, 429)
552
+ else "网络已连接到服务端,请检查下载链接和发布资源状态;如当前网络存在访问限制,再检查代理/VPN 设置。"
553
+ )
554
+ return (
555
+ f"下载组件文件 {asset.get('file', 'asset')} 失败,服务器返回 HTTP {error.code}。"
556
+ f"下载地址:{original_url}。{redirect}{advice}"
557
+ )
558
+
559
+
510
560
  def materialize(
511
561
  asset: dict,
512
562
  destination: Path,
@@ -551,7 +601,12 @@ def materialize(
551
601
  completed_files=progress_index, total_files=progress_total,
552
602
  )
553
603
 
554
- urllib.request.urlretrieve(asset["url"], temporary, reporthook=reporthook)
604
+ try:
605
+ urllib.request.urlretrieve(asset["url"], temporary, reporthook=reporthook)
606
+ except urllib.error.HTTPError as exc:
607
+ raise OnboardingError(download_http_error(asset, asset["url"], exc)) from exc
608
+ except (urllib.error.URLError, TimeoutError, ConnectionError, http.client.HTTPException) as exc:
609
+ raise OnboardingError(download_network_error(asset, asset["url"], exc)) from exc
555
610
  source = "network"
556
611
  verify_asset(temporary, asset["sha256"])
557
612
  if destination.is_file():