@foggy-projects/deepseek-harness-plugin 0.4.5-rc.1 → 0.4.5-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 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.3` 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.3.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.3
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. Download diagnostics show the sanitized URL, available
201
+ failing-host and network-code details, and specific guidance for HTTPS
202
+ certificate verification failures. They distinguish certificate trust errors
203
+ from blocked connections and HTTP error responses.
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.3.md`](./docs/RELEASE-CANDIDATE-0.4.5-DSH-0.2.2-RC.3.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.
@@ -0,0 +1,36 @@
1
+ # Foggy DeepSeek Harness plugin 0.4.5-rc.3
2
+
3
+ This candidate keeps the DeepSeek Harness `0.2.2-rc.3` compatibility target and
4
+ clarifies TLS certificate errors reported during component downloads.
5
+
6
+ An `SSLCertVerificationError` is now described as a certificate trust failure,
7
+ not a generic network connection failure. The message identifies the download
8
+ URL and advises checking the system clock, HTTPS inspection by proxies or
9
+ security software, and the trusted CA chain. For Python downloads it explains
10
+ that `SSL_CERT_FILE` can point to an organization-provided PEM certificate; for
11
+ Node.js downloads it mentions `NODE_EXTRA_CA_CERTS`. It explicitly says that
12
+ changing networks or using a VPN only helps when it avoids the problematic TLS
13
+ inspection, and that certificate verification should not be disabled.
14
+
15
+ Other DNS, timeout, and connection errors continue to show the sanitized
16
+ request URL, available failing host, and network error code. HTTP responses
17
+ continue to display their status separately.
18
+
19
+ The compatibility target remains DeepSeek Harness `0.2.2-rc.3`, with system
20
+ Node.js `>=24.9.0`, Java 17+, managed Python `3.12.13`, Launcher `0.1.46`, CLI
21
+ `0.1.25`, and Foggy Skills `0.1.18`.
22
+
23
+ Install the exact candidate in a clean Harness profile:
24
+
25
+ ```powershell
26
+ dsh plugin --profile web add --workspace-root @foggy-projects/deepseek-harness-plugin@0.4.5-rc.3
27
+ ```
28
+
29
+ For the DSH `0.2.2-rc.3` channel, `@dsh022` points to this candidate after
30
+ publication.
31
+
32
+ ## Verification
33
+
34
+ This document records the source change only. Do not treat the candidate as
35
+ accepted until package and compatibility checks are run on the target Harness
36
+ version and a clean Windows initialization confirms the 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.3"
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,65 @@
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
+ let certificateVerification = false
25
+ while (current && typeof current === 'object' && !seen.has(current)) {
26
+ seen.add(current)
27
+ const candidateCode = current.code ?? current.errno
28
+ if (!code && (typeof candidateCode === 'string' || typeof candidateCode === 'number')) {
29
+ code = String(candidateCode).slice(0, 80)
30
+ }
31
+ if (/SSLCertVerificationError|CERTIFICATE_VERIFY|CERT_HAS_EXPIRED|SELF_SIGNED_CERT|UNABLE_TO_VERIFY|ERR_TLS_CERT_ALTNAME_INVALID|self[- ]signed|certificate.*(?:verify|chain|expired|authority|altname)|unable to verify/i.test(`${current.name ?? ''} ${current.code ?? ''} ${current.message ?? ''}`)) {
32
+ certificateVerification = true
33
+ }
34
+ if (!host) host = parsedHost(current.hostname) ?? parsedHost(current.host)
35
+ if (!host && typeof current.message === 'string') {
36
+ host = current.message.match(/(?:ENOTFOUND|getaddrinfo|name or service not known)\s+([a-z0-9.-]+\.[a-z]{2,})/i)?.[1] ?? null
37
+ }
38
+ current = current.cause
39
+ }
40
+ if (!code && error?.name === 'AbortError') code = 'TIMEOUT'
41
+ return { code: code ?? 'FETCH_FAILED', host, certificateVerification }
42
+ }
43
+
44
+ export function networkFailureMessage(action, value, error) {
45
+ const target = safeNetworkUrl(value)
46
+ const targetHost = parsedHost(target)
47
+ const { code, host, certificateVerification } = networkDetails(error)
48
+ const failedHost = host ?? targetHost ?? 'the requested host'
49
+ const redirect = host && targetHost && host !== targetHost
50
+ ? `检测到连接失败主机:${host}。`
51
+ : ''
52
+ if (certificateVerification) {
53
+ return `${action}失败。请求地址:${target}。${redirect}HTTPS 证书校验失败(${code}):客户端收到了证书,但无法验证证书链。请检查系统日期/时间,以及代理或杀毒软件是否在检查 HTTPS;需要时将可信根证书正确加入系统证书库,Node.js 也可用 NODE_EXTRA_CA_CERTS 指定 PEM 证书。只有切换网络/VPN 能避开错误的 HTTPS 检查时才有帮助;不要关闭证书校验。`
54
+ }
55
+ return `${action}失败。请求地址:${target}。${redirect}网络错误码:${code}。请检查网络、代理和防火墙是否允许访问 ${failedHost};如果当前网络限制 GitHub,可能需要配置代理/VPN 或切换到可访问该域名的网络。`
56
+ }
57
+
58
+ export function httpFailureMessage(action, value, status) {
59
+ const target = safeNetworkUrl(value)
60
+ const host = parsedHost(target) ?? 'the requested host'
61
+ const advice = status === 403 || status === 429
62
+ ? '服务端拒绝访问或触发了限流,请稍后重试并检查访问策略。只有当前网络限制该域名时,才需要代理/VPN。'
63
+ : '网络已连接到服务端;请检查链接和发布资源状态。若该网络有访问限制,再检查代理/VPN 设置。'
64
+ return `${action}失败,服务器返回 HTTP ${status}。请求地址:${target}。${advice}(${host})`
65
+ }
@@ -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.3",
4
4
  "description": "Foggy Java data analysis engine integration for DeepSeek Harness",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -51,7 +51,9 @@
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",
56
+ "docs/RELEASE-CANDIDATE-0.4.5-DSH-0.2.2-RC.3.md"
55
57
  ],
56
58
  "license": "Apache-2.0",
57
59
  "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.3",
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
@@ -14,12 +15,14 @@ import re
14
15
  import shutil
15
16
  import signal
16
17
  import socket
18
+ import ssl
17
19
  import subprocess
18
20
  import sys
19
21
  import tempfile
20
22
  import time
21
23
  import urllib.error
22
24
  import urllib.request
25
+ from urllib.parse import urlsplit, urlunsplit
23
26
  import venv
24
27
  import zipfile
25
28
 
@@ -507,6 +510,69 @@ def cached_asset(name: str, expected: str, cache_dirs: list[Path]) -> Path | Non
507
510
  return None
508
511
 
509
512
 
513
+ def safe_remote_url(value: object) -> str:
514
+ raw = str(value)
515
+ try:
516
+ parsed = urlsplit(raw)
517
+ host = parsed.hostname
518
+ if not parsed.scheme or not host:
519
+ return re.sub(r"[?#].*$", "", raw)
520
+ if ":" in host and not host.startswith("["):
521
+ host = f"[{host}]"
522
+ port = f":{parsed.port}" if parsed.port else ""
523
+ return urlunsplit((parsed.scheme, f"{host}{port}", parsed.path, "", ""))
524
+ except (TypeError, ValueError):
525
+ return re.sub(r"[?#].*$", "", raw)
526
+
527
+
528
+ def download_network_error(asset: dict, url: str, error: BaseException) -> str:
529
+ original_url = safe_remote_url(url)
530
+ failed_url = safe_remote_url(getattr(error, "url", None) or url)
531
+ reason = getattr(error, "reason", error)
532
+ code = getattr(reason, "code", None) or getattr(reason, "errno", None) or getattr(reason, "winerror", None)
533
+ error_kind = "TIMEOUT" if isinstance(reason, TimeoutError) else type(reason).__name__
534
+ if code is not None:
535
+ error_kind += f" ({code})"
536
+ redirect = f" 实际失败地址(跳转后):{failed_url}。" if failed_url != original_url else ""
537
+ host = urlsplit(failed_url).hostname or urlsplit(original_url).hostname or "目标域名"
538
+ certificate_failure = (
539
+ isinstance(reason, ssl.SSLCertVerificationError)
540
+ or getattr(reason, "verify_code", None) is not None
541
+ or "CERTIFICATE_VERIFY_FAILED" in str(reason).upper()
542
+ )
543
+ if certificate_failure:
544
+ verify_code = getattr(reason, "verify_code", None)
545
+ verify_detail = f"(verify code {verify_code})" if verify_code is not None else ""
546
+ return (
547
+ f"下载组件文件 {asset.get('file', 'asset')} 失败:HTTPS 证书校验失败。"
548
+ f"下载地址:{original_url}。{redirect}错误:SSLCertVerificationError{verify_detail}。"
549
+ f"客户端收到了 {host} 提供的证书,但无法验证其证书链。这通常与 DNS 或网络不通不同。"
550
+ "请检查系统日期/时间,以及代理或杀毒软件是否检查 HTTPS;必要时将可信根证书加入 Windows 受信任根证书,"
551
+ "或设置 SSL_CERT_FILE 指向该 CA 的 PEM 文件。代理/VPN 只有在能避开有问题的 HTTPS 检查时才可能有帮助;请勿关闭证书校验。"
552
+ )
553
+ return (
554
+ f"下载组件文件 {asset.get('file', 'asset')} 失败,无法连接下载服务。"
555
+ f"下载地址:{original_url}。{redirect}连接错误:{error_kind}。"
556
+ f"请检查网络、代理和防火墙是否允许访问 {host};如果当前网络限制 GitHub,"
557
+ "可能需要配置代理/VPN 或切换到可访问该域名的网络。"
558
+ )
559
+
560
+
561
+ def download_http_error(asset: dict, url: str, error: urllib.error.HTTPError) -> str:
562
+ original_url = safe_remote_url(url)
563
+ failed_url = safe_remote_url(error.url or url)
564
+ redirect = f" 实际响应地址(跳转后):{failed_url}。" if failed_url != original_url else ""
565
+ advice = (
566
+ "服务端拒绝访问或触发限流,请稍后重试并检查访问策略;只有当前网络限制该域名时,才需要代理/VPN。"
567
+ if error.code in (403, 429)
568
+ else "网络已连接到服务端,请检查下载链接和发布资源状态;如当前网络存在访问限制,再检查代理/VPN 设置。"
569
+ )
570
+ return (
571
+ f"下载组件文件 {asset.get('file', 'asset')} 失败,服务器返回 HTTP {error.code}。"
572
+ f"下载地址:{original_url}。{redirect}{advice}"
573
+ )
574
+
575
+
510
576
  def materialize(
511
577
  asset: dict,
512
578
  destination: Path,
@@ -551,7 +617,12 @@ def materialize(
551
617
  completed_files=progress_index, total_files=progress_total,
552
618
  )
553
619
 
554
- urllib.request.urlretrieve(asset["url"], temporary, reporthook=reporthook)
620
+ try:
621
+ urllib.request.urlretrieve(asset["url"], temporary, reporthook=reporthook)
622
+ except urllib.error.HTTPError as exc:
623
+ raise OnboardingError(download_http_error(asset, asset["url"], exc)) from exc
624
+ except (urllib.error.URLError, ssl.SSLError, TimeoutError, ConnectionError, http.client.HTTPException) as exc:
625
+ raise OnboardingError(download_network_error(asset, asset["url"], exc)) from exc
555
626
  source = "network"
556
627
  verify_asset(temporary, asset["sha256"])
557
628
  if destination.is_file():