@dsh-edge/dsh-edge-agent 0.0.0-stage → 0.1.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/CHANGELOG.md +142 -0
- package/LICENSE +21 -0
- package/README.md +372 -2
- package/config/edge.example.json +179 -0
- package/config/privacy-policy.json +202 -0
- package/cordis.desktop-safe.patch.yml +129 -0
- package/cordis.patch.yml +382 -0
- package/cordis.yml +374 -0
- package/lib/attestation.d.ts +2 -0
- package/lib/attestation.d.ts.map +1 -0
- package/lib/attestation.js +2 -0
- package/lib/audit-log.d.ts +2 -0
- package/lib/audit-log.d.ts.map +1 -0
- package/lib/audit-log.js +2 -0
- package/lib/client.js +87 -0
- package/lib/cloud-llm-adapter.d.ts +2 -0
- package/lib/cloud-llm-adapter.d.ts.map +1 -0
- package/lib/cloud-llm-adapter.js +2 -0
- package/lib/dsh-adapter/attestation.d.ts +42 -0
- package/lib/dsh-adapter/attestation.d.ts.map +1 -0
- package/lib/dsh-adapter/attestation.js +40 -0
- package/lib/dsh-adapter/audit-log.d.ts +139 -0
- package/lib/dsh-adapter/audit-log.d.ts.map +1 -0
- package/lib/dsh-adapter/audit-log.js +376 -0
- package/lib/dsh-adapter/cloud-egress.d.ts +181 -0
- package/lib/dsh-adapter/cloud-egress.d.ts.map +1 -0
- package/lib/dsh-adapter/cloud-egress.js +257 -0
- package/lib/dsh-adapter/cloud-llm-adapter.d.ts +416 -0
- package/lib/dsh-adapter/cloud-llm-adapter.d.ts.map +1 -0
- package/lib/dsh-adapter/cloud-llm-adapter.js +1472 -0
- package/lib/dsh-adapter/contract.d.ts +80 -0
- package/lib/dsh-adapter/contract.d.ts.map +1 -0
- package/lib/dsh-adapter/contract.js +194 -0
- package/lib/dsh-adapter/desktop-cookie-janitor.d.ts +214 -0
- package/lib/dsh-adapter/desktop-cookie-janitor.d.ts.map +1 -0
- package/lib/dsh-adapter/desktop-cookie-janitor.js +409 -0
- package/lib/dsh-adapter/dsh-edge-agent.d.ts +48 -0
- package/lib/dsh-adapter/dsh-edge-agent.d.ts.map +1 -0
- package/lib/dsh-adapter/dsh-edge-agent.js +64 -0
- package/lib/dsh-adapter/edge-config.d.ts +484 -0
- package/lib/dsh-adapter/edge-config.d.ts.map +1 -0
- package/lib/dsh-adapter/edge-config.js +898 -0
- package/lib/dsh-adapter/edge-context-view.d.ts +184 -0
- package/lib/dsh-adapter/edge-context-view.d.ts.map +1 -0
- package/lib/dsh-adapter/edge-context-view.js +483 -0
- package/lib/dsh-adapter/effective-model.d.ts +85 -0
- package/lib/dsh-adapter/effective-model.d.ts.map +1 -0
- package/lib/dsh-adapter/effective-model.js +171 -0
- package/lib/dsh-adapter/etscli-shell-guard.d.ts +244 -0
- package/lib/dsh-adapter/etscli-shell-guard.d.ts.map +1 -0
- package/lib/dsh-adapter/etscli-shell-guard.js +420 -0
- package/lib/dsh-adapter/etscli-tools.d.ts +112 -0
- package/lib/dsh-adapter/etscli-tools.d.ts.map +1 -0
- package/lib/dsh-adapter/etscli-tools.js +393 -0
- package/lib/dsh-adapter/file-logger.d.ts +294 -0
- package/lib/dsh-adapter/file-logger.d.ts.map +1 -0
- package/lib/dsh-adapter/file-logger.js +564 -0
- package/lib/dsh-adapter/function-call-external.d.ts +357 -0
- package/lib/dsh-adapter/function-call-external.d.ts.map +1 -0
- package/lib/dsh-adapter/function-call-external.js +1005 -0
- package/lib/dsh-adapter/host-egress-guard.d.ts +161 -0
- package/lib/dsh-adapter/host-egress-guard.d.ts.map +1 -0
- package/lib/dsh-adapter/host-egress-guard.js +213 -0
- package/lib/dsh-adapter/host-llm-trace.d.ts +198 -0
- package/lib/dsh-adapter/host-llm-trace.d.ts.map +1 -0
- package/lib/dsh-adapter/host-llm-trace.js +344 -0
- package/lib/dsh-adapter/http-api-routes.d.ts +61 -0
- package/lib/dsh-adapter/http-api-routes.d.ts.map +1 -0
- package/lib/dsh-adapter/http-api-routes.js +79 -0
- package/lib/dsh-adapter/http-api-sessions.d.ts +105 -0
- package/lib/dsh-adapter/http-api-sessions.d.ts.map +1 -0
- package/lib/dsh-adapter/http-api-sessions.js +173 -0
- package/lib/dsh-adapter/http-api.d.ts +221 -0
- package/lib/dsh-adapter/http-api.d.ts.map +1 -0
- package/lib/dsh-adapter/http-api.js +1811 -0
- package/lib/dsh-adapter/index.d.ts +62 -0
- package/lib/dsh-adapter/index.d.ts.map +1 -0
- package/lib/dsh-adapter/index.js +97 -0
- package/lib/dsh-adapter/input-guard-messages.d.ts +56 -0
- package/lib/dsh-adapter/input-guard-messages.d.ts.map +1 -0
- package/lib/dsh-adapter/input-guard-messages.js +136 -0
- package/lib/dsh-adapter/input-guard.d.ts +508 -0
- package/lib/dsh-adapter/input-guard.d.ts.map +1 -0
- package/lib/dsh-adapter/input-guard.js +2174 -0
- package/lib/dsh-adapter/intent-prompts.d.ts +77 -0
- package/lib/dsh-adapter/intent-prompts.d.ts.map +1 -0
- package/lib/dsh-adapter/intent-prompts.js +97 -0
- package/lib/dsh-adapter/intent-router.d.ts +710 -0
- package/lib/dsh-adapter/intent-router.d.ts.map +1 -0
- package/lib/dsh-adapter/intent-router.js +2802 -0
- package/lib/dsh-adapter/intent-signals.d.ts +208 -0
- package/lib/dsh-adapter/intent-signals.d.ts.map +1 -0
- package/lib/dsh-adapter/intent-signals.js +391 -0
- package/lib/dsh-adapter/invariant-install.d.ts +16 -0
- package/lib/dsh-adapter/invariant-install.d.ts.map +1 -0
- package/lib/dsh-adapter/invariant-install.js +15 -0
- package/lib/dsh-adapter/invariant.d.ts +16 -0
- package/lib/dsh-adapter/invariant.d.ts.map +1 -0
- package/lib/dsh-adapter/invariant.js +22 -0
- package/lib/dsh-adapter/llm-adapters.d.ts +19 -0
- package/lib/dsh-adapter/llm-adapters.d.ts.map +1 -0
- package/lib/dsh-adapter/llm-adapters.js +16 -0
- package/lib/dsh-adapter/llm-internal-caller.d.ts +92 -0
- package/lib/dsh-adapter/llm-internal-caller.d.ts.map +1 -0
- package/lib/dsh-adapter/llm-internal-caller.js +100 -0
- package/lib/dsh-adapter/llm-max-turns.d.ts +55 -0
- package/lib/dsh-adapter/llm-max-turns.d.ts.map +1 -0
- package/lib/dsh-adapter/llm-max-turns.js +127 -0
- package/lib/dsh-adapter/llm-trace-store.d.ts +131 -0
- package/lib/dsh-adapter/llm-trace-store.d.ts.map +1 -0
- package/lib/dsh-adapter/llm-trace-store.js +205 -0
- package/lib/dsh-adapter/llm-trace.d.ts +450 -0
- package/lib/dsh-adapter/llm-trace.d.ts.map +1 -0
- package/lib/dsh-adapter/llm-trace.js +463 -0
- package/lib/dsh-adapter/local-llm-adapter.d.ts +141 -0
- package/lib/dsh-adapter/local-llm-adapter.d.ts.map +1 -0
- package/lib/dsh-adapter/local-llm-adapter.js +787 -0
- package/lib/dsh-adapter/local-storage.d.ts +96 -0
- package/lib/dsh-adapter/local-storage.d.ts.map +1 -0
- package/lib/dsh-adapter/local-storage.js +198 -0
- package/lib/dsh-adapter/model-router.d.ts +79 -0
- package/lib/dsh-adapter/model-router.d.ts.map +1 -0
- package/lib/dsh-adapter/model-router.js +107 -0
- package/lib/dsh-adapter/ohttp-gateway.d.ts +49 -0
- package/lib/dsh-adapter/ohttp-gateway.d.ts.map +1 -0
- package/lib/dsh-adapter/ohttp-gateway.js +32 -0
- package/lib/dsh-adapter/openai-sse.d.ts +85 -0
- package/lib/dsh-adapter/openai-sse.d.ts.map +1 -0
- package/lib/dsh-adapter/openai-sse.js +462 -0
- package/lib/dsh-adapter/pii-utils.d.ts +96 -0
- package/lib/dsh-adapter/pii-utils.d.ts.map +1 -0
- package/lib/dsh-adapter/pii-utils.js +324 -0
- package/lib/dsh-adapter/plugin-host.d.ts +38 -0
- package/lib/dsh-adapter/plugin-host.d.ts.map +1 -0
- package/lib/dsh-adapter/plugin-host.js +38 -0
- package/lib/dsh-adapter/plugin.d.ts +46 -0
- package/lib/dsh-adapter/plugin.d.ts.map +1 -0
- package/lib/dsh-adapter/plugin.js +100 -0
- package/lib/dsh-adapter/privacy-policy.d.ts +237 -0
- package/lib/dsh-adapter/privacy-policy.d.ts.map +1 -0
- package/lib/dsh-adapter/privacy-policy.js +391 -0
- package/lib/dsh-adapter/prompt-guard.d.ts +152 -0
- package/lib/dsh-adapter/prompt-guard.d.ts.map +1 -0
- package/lib/dsh-adapter/prompt-guard.js +872 -0
- package/lib/dsh-adapter/realm-skill-bridge.d.ts +365 -0
- package/lib/dsh-adapter/realm-skill-bridge.d.ts.map +1 -0
- package/lib/dsh-adapter/realm-skill-bridge.js +1180 -0
- package/lib/dsh-adapter/sanitizer-pipeline.d.ts +140 -0
- package/lib/dsh-adapter/sanitizer-pipeline.d.ts.map +1 -0
- package/lib/dsh-adapter/sanitizer-pipeline.js +431 -0
- package/lib/dsh-adapter/secure-bridge.d.ts +47 -0
- package/lib/dsh-adapter/secure-bridge.d.ts.map +1 -0
- package/lib/dsh-adapter/secure-bridge.js +35 -0
- package/lib/dsh-adapter/session-attribution.d.ts +70 -0
- package/lib/dsh-adapter/session-attribution.d.ts.map +1 -0
- package/lib/dsh-adapter/session-attribution.js +76 -0
- package/lib/dsh-adapter/sessions.d.ts +86 -0
- package/lib/dsh-adapter/sessions.d.ts.map +1 -0
- package/lib/dsh-adapter/sessions.js +179 -0
- package/lib/dsh-adapter/tcm.d.ts +55 -0
- package/lib/dsh-adapter/tcm.d.ts.map +1 -0
- package/lib/dsh-adapter/tcm.js +94 -0
- package/lib/dsh-adapter/td-bus.d.ts +87 -0
- package/lib/dsh-adapter/td-bus.d.ts.map +1 -0
- package/lib/dsh-adapter/td-bus.js +196 -0
- package/lib/dsh-adapter/tool-runner.d.ts +185 -0
- package/lib/dsh-adapter/tool-runner.d.ts.map +1 -0
- package/lib/dsh-adapter/tool-runner.js +271 -0
- package/lib/dsh-adapter/tools.d.ts +118 -0
- package/lib/dsh-adapter/tools.d.ts.map +1 -0
- package/lib/dsh-adapter/tools.js +292 -0
- package/lib/dsh-adapter/types.d.ts +23 -0
- package/lib/dsh-adapter/types.d.ts.map +1 -0
- package/lib/dsh-adapter/types.js +16 -0
- package/lib/dsh-adapter/voice-input.d.ts +30 -0
- package/lib/dsh-adapter/voice-input.d.ts.map +1 -0
- package/lib/dsh-adapter/voice-input.js +34 -0
- package/lib/dsh-adapter/web-search-tavily-bocha.d.ts +152 -0
- package/lib/dsh-adapter/web-search-tavily-bocha.d.ts.map +1 -0
- package/lib/dsh-adapter/web-search-tavily-bocha.js +289 -0
- package/lib/http-api.d.ts +2 -0
- package/lib/http-api.d.ts.map +1 -0
- package/lib/http-api.js +2 -0
- package/lib/index.d.ts +48 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +49 -0
- package/lib/intent-router.d.ts +2 -0
- package/lib/intent-router.d.ts.map +1 -0
- package/lib/intent-router.js +2 -0
- package/lib/llm-adapters.d.ts +2 -0
- package/lib/llm-adapters.d.ts.map +1 -0
- package/lib/llm-adapters.js +2 -0
- package/lib/local-llm-adapter.d.ts +2 -0
- package/lib/local-llm-adapter.d.ts.map +1 -0
- package/lib/local-llm-adapter.js +2 -0
- package/lib/local-storage.d.ts +2 -0
- package/lib/local-storage.d.ts.map +1 -0
- package/lib/local-storage.js +2 -0
- package/lib/model-router.d.ts +2 -0
- package/lib/model-router.d.ts.map +1 -0
- package/lib/model-router.js +2 -0
- package/lib/ohttp-gateway.d.ts +2 -0
- package/lib/ohttp-gateway.d.ts.map +1 -0
- package/lib/ohttp-gateway.js +2 -0
- package/lib/plugin-host.d.ts +2 -0
- package/lib/plugin-host.d.ts.map +1 -0
- package/lib/plugin-host.js +2 -0
- package/lib/privacy-policy.d.ts +2 -0
- package/lib/privacy-policy.d.ts.map +1 -0
- package/lib/privacy-policy.js +2 -0
- package/lib/prompt-guard.d.ts +2 -0
- package/lib/prompt-guard.d.ts.map +1 -0
- package/lib/prompt-guard.js +2 -0
- package/lib/sanitizer-pipeline.d.ts +2 -0
- package/lib/sanitizer-pipeline.d.ts.map +1 -0
- package/lib/sanitizer-pipeline.js +2 -0
- package/lib/secure-bridge.d.ts +2 -0
- package/lib/secure-bridge.d.ts.map +1 -0
- package/lib/secure-bridge.js +2 -0
- package/lib/sessions.d.ts +2 -0
- package/lib/sessions.d.ts.map +1 -0
- package/lib/sessions.js +2 -0
- package/lib/tcm.d.ts +2 -0
- package/lib/tcm.d.ts.map +1 -0
- package/lib/tcm.js +2 -0
- package/lib/td-bus.d.ts +2 -0
- package/lib/td-bus.d.ts.map +1 -0
- package/lib/td-bus.js +2 -0
- package/lib/tools.d.ts +2 -0
- package/lib/tools.d.ts.map +1 -0
- package/lib/tools.js +2 -0
- package/lib/voice-input.d.ts +2 -0
- package/lib/voice-input.d.ts.map +1 -0
- package/lib/voice-input.js +2 -0
- package/package.json +341 -3
- package/presets/agent-preset-edge.json +50 -0
- package/presets/edge.desktop-safe.patch.yml +503 -0
- package/presets/edge.patch.yml +557 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "dsh-edge-agent 配置模板(tracked)。§7.182(2026-11-11)起,运行时只认两个落点:①装好后的插件目录里的 config/edge.json(顺位 1 —— 打开插件目录就能看到能改的那个);②~/.dsh-edge-agent/edge.json(顺位 2 —— 重装/删 profile 都活着,跨 npm/git/tarball 三条通道通用)。仓库的 config/ 目录不再放活配置(明文 API key 不该待在 git checkout 里)。本文件本身不再是运行时候选(模板里的部署值已并入代码默认值),它只是给你抄的那份模板:cp config/edge.example.json ~/.dsh-edge-agent/edge.json,然后填真实端点与 key。",
|
|
3
|
+
"secrets": {
|
|
4
|
+
"_comment": "HTTP API 鉴权 + 各 LLM 池的直连凭据。直连模式下写入 Authorization 头。",
|
|
5
|
+
"edgeApiKey": "",
|
|
6
|
+
"deepseekApiKey": "",
|
|
7
|
+
"dashscopeApiKey": "",
|
|
8
|
+
"minimaxApiKey": "",
|
|
9
|
+
"aliyuntokenplanApiKey": "",
|
|
10
|
+
"tavilyApiKey": "",
|
|
11
|
+
"bochaApiKey": "",
|
|
12
|
+
"bailianApiKey": ""
|
|
13
|
+
},
|
|
14
|
+
"http": {
|
|
15
|
+
"_comment": "http-api 监听入口。",
|
|
16
|
+
"host": "127.0.0.1",
|
|
17
|
+
"port": 21017
|
|
18
|
+
},
|
|
19
|
+
"llm": {
|
|
20
|
+
"_comment": "§7.100 / §7.171:两个池的 baseUrl 都留空 = DELEGATE 到宿主 profile 已配置的模型提供商(桌面 GUI 选的模型 / dsh-base 默认 deepseek-official),凭据全归宿主 adapter,edge 侧不碰任何 secret。",
|
|
21
|
+
"local": {
|
|
22
|
+
"_comment": "留空 = DELEGATE 模式(转发宿主提供商,与 llm.cloud 对称)。要 edge 自有直连池时填 baseUrl + model + keyRef。baseUrl 必须含 /v1 —— adapter 只追加 /chat/completions(local-llm-adapter.ts)。delegate=false = kill switch,回到 opt-in 语义(不注册 local-llm 路由,意图分类 / guard 检测自动降级到关键词 / 正则规则档)。reasoningEffortNone:ollama 池必开 —— ollama 的 /v1 层静默丢弃 chat_template_kwargs 和顶层 think:false,只有 reasoning_effort:\"none\" 生效(实测 <你的内网主机>:11434)。不加它,thinking 吃满 max_tokens → content 空 → json-parse-failed → 攻击检测静默落回正则档(24.6s → 6.5s)。严格网关(OpenAI 官方风格)不认这个参数会 400,保持 false。",
|
|
23
|
+
"baseUrl": "",
|
|
24
|
+
"model": "",
|
|
25
|
+
"keyRef": "",
|
|
26
|
+
"stripTools": false,
|
|
27
|
+
"enableThinking": false,
|
|
28
|
+
"reasoningEffortNone": false,
|
|
29
|
+
"delegate": true,
|
|
30
|
+
"delegateProvider": "",
|
|
31
|
+
"delegateModel": ""
|
|
32
|
+
},
|
|
33
|
+
"cloud": {
|
|
34
|
+
"_comment": "留空 = DELEGATE 模式(转发宿主提供商)。要 edge 自有直连云池时填 baseUrl + model + keyRef。",
|
|
35
|
+
"baseUrl": "",
|
|
36
|
+
"model": "",
|
|
37
|
+
"keyRef": "",
|
|
38
|
+
"delegate": true,
|
|
39
|
+
"delegateProvider": "",
|
|
40
|
+
"delegateModel": ""
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"stages": {
|
|
44
|
+
"_comment": "★ 隐私不变式(用户仲裁 2026-10-18):分类 / guard 检测只吃本地模型 —— 送进云池等于把「待检测的用户原文」上行,违背端侧私密定位。留空 = 用 plugin Schema 默认 local-llm;本地端点不可达时 intent-router / prompt-guard 自动降级到关键词 / 正则规则档,绝不借用宿主云模型。",
|
|
45
|
+
"guard": {
|
|
46
|
+
"provider": "local-llm",
|
|
47
|
+
"model": "",
|
|
48
|
+
"enabled": true,
|
|
49
|
+
"timeoutMs": 60000,
|
|
50
|
+
"maxInput": 2000
|
|
51
|
+
},
|
|
52
|
+
"intent": {
|
|
53
|
+
"provider": "local-llm",
|
|
54
|
+
"model": "",
|
|
55
|
+
"defaultCategory": "LOCAL",
|
|
56
|
+
"timeoutMs": 60000,
|
|
57
|
+
"confidenceThreshold": 0.6,
|
|
58
|
+
"maxInput": 2000,
|
|
59
|
+
"recentLimit": 3,
|
|
60
|
+
"cloudKeywords": [],
|
|
61
|
+
"localEntities": [],
|
|
62
|
+
"fallbackKeywords": [],
|
|
63
|
+
"deviceCommands": {
|
|
64
|
+
"_comment": "§7.124 家庭设备操作正则层(Tier-0)的扩展词表 —— 追加到内置词表(灯/空调/电视/窗帘…)。加一个新电器名只改这里一行,不用改代码。devices = 设备名词,actions = 动作词。",
|
|
65
|
+
"devices": [],
|
|
66
|
+
"actions": []
|
|
67
|
+
},
|
|
68
|
+
"llmFallback": true,
|
|
69
|
+
"_comment": " §7.115:llmFallback=false = 决策模型 only 模式(jev skip 直接落规则层,LLM 分类器不再运行)。"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"jev": {
|
|
73
|
+
"_comment": "§7.92.3 jev 意图识别(toggle,§7.182 主人裁决:**默认 OFF** —— 它是可选加速器,需要本地 :8001 的决策模型服务;没有它时 classify() 完全跳过 jev 路径;开 → 在 LLM classifier 之前先跑)。Toggle=false 时 classify() 完全跳过 jev 路径(无 network call)。高置信 (>=confidenceThreshold) + 低风险 (<riskThreshold) → 直接采纳;否则 fall through 到 LLM。 §7.112(2026-10-25):provider 可选 local(默认,ONNX /predict)| bailian-decision(阿里 decision-model /systemone——questions 从 categories 自动生成,model 填 decision-model-preview,apiKeyRef 指向 secrets 里的百炼 MaaS key,authScheme raw=Authorization: <key> / bearer=Bearer 前缀)。§7.114:决策模型是配置文件绑定的外部服务——path 默认 /systemone(MaaS 部署);本地 MLX serve 同一契约时 url 指 http://127.0.0.1:11017/v1、path 改 /classify(它有 /health,探针自动恢复)。 §7.115:localAdoptFloor=方向分闸——LOCAL 倾向判决 ≥ 该值直接采纳(默认本地,不落 LLM),非 LOCAL 仍走 confidenceThreshold。",
|
|
74
|
+
"enabled": false,
|
|
75
|
+
"url": "http://127.0.0.1:8001",
|
|
76
|
+
"timeoutMs": 2500,
|
|
77
|
+
"confidenceThreshold": 0.85,
|
|
78
|
+
"riskThreshold": 0.7,
|
|
79
|
+
"breakerTtlMs": 30000,
|
|
80
|
+
"bootProbeEnabled": true,
|
|
81
|
+
"bootProbeTimeoutMs": 2000,
|
|
82
|
+
"breakerProbeMs": 5000,
|
|
83
|
+
"probeTimeoutMs": 1000,
|
|
84
|
+
"provider": "local",
|
|
85
|
+
"model": "decision-model-preview",
|
|
86
|
+
"_apiKeyRef": "§7.182:默认档(provider=local,ONNX 决策模型)不需要 key —— 故意不写 apiKeyRef。写了就会在启动时报「配置里的密钥引用指向不存在的槽位」(槽位为空也算不存在,edge-config.ts danglingSecretRefs())。要换百炼决策模型才把这一行加回来:\"apiKeyRef\": \"bailianApiKey\",同时在 secrets 里填上那个槽位的真实 key。",
|
|
87
|
+
"authScheme": "raw",
|
|
88
|
+
"path": "/systemone",
|
|
89
|
+
"localAdoptFloor": 0.5
|
|
90
|
+
},
|
|
91
|
+
"functionCallExternal": {
|
|
92
|
+
"_comment": "§7.93.1 ExternalToolCaller(纯 client,外部维护)。契约 GET /health + POST /extract {query,tools,system?,max_new_tokens?}。CLOUD intent 不走 caller;caller 不可达 / 低置信 fall through 到 LLM 自提取。",
|
|
93
|
+
"enabled": false,
|
|
94
|
+
"url": "http://127.0.0.1:8081",
|
|
95
|
+
"timeoutMs": 15000,
|
|
96
|
+
"confidenceThreshold": 0.5,
|
|
97
|
+
"breakerTtlMs": 30000,
|
|
98
|
+
"bootProbeEnabled": true,
|
|
99
|
+
"bootProbeTimeoutMs": 2000,
|
|
100
|
+
"breakerProbeMs": 5000,
|
|
101
|
+
"probeTimeoutMs": 1000
|
|
102
|
+
},
|
|
103
|
+
"privacy": {
|
|
104
|
+
"_comment": "Input-Guard / Privacy-Policy / Realm-Bridge 开关。policyPath/realmConfigPath 留空 = ~/.dsh-edge-agent/ 下同名文件。",
|
|
105
|
+
"inputGuardEnabled": true,
|
|
106
|
+
"rejectPolicyEnabled": true,
|
|
107
|
+
"sanitizeDowngradeEnabled": true,
|
|
108
|
+
"realmHotReload": true,
|
|
109
|
+
"realmWatchMs": 5000,
|
|
110
|
+
"policyPath": "",
|
|
111
|
+
"realmConfigPath": "",
|
|
112
|
+
"policyHotReload": true,
|
|
113
|
+
"policyWatchMs": 5000,
|
|
114
|
+
"sanTtlMs": 900000,
|
|
115
|
+
"sanMaxSessions": 1000,
|
|
116
|
+
"sanSweepMs": 60000
|
|
117
|
+
},
|
|
118
|
+
"resources": {
|
|
119
|
+
"_comment": "Session / Sanitizer / body 限制。",
|
|
120
|
+
"maxSessions": 100,
|
|
121
|
+
"maxBodyBytes": 1048576,
|
|
122
|
+
"sessionIdleMs": 1800000,
|
|
123
|
+
"sanMaxSessions": 1000,
|
|
124
|
+
"sanSweepMs": 60000,
|
|
125
|
+
"sanTtlMs": 900000
|
|
126
|
+
},
|
|
127
|
+
"audit": {
|
|
128
|
+
"_comment": "Audit / Ops Log 落盘。root/logRoot 留空 = ~/.dsh-edge-agent/audit 与 ~/.dsh-edge-agent/log。",
|
|
129
|
+
"minLevel": "info",
|
|
130
|
+
"flushMs": 1000,
|
|
131
|
+
"logLevel": "info",
|
|
132
|
+
"logMaxAgeDays": 1,
|
|
133
|
+
"logMaxRotated": 7,
|
|
134
|
+
"root": "",
|
|
135
|
+
"logRoot": "",
|
|
136
|
+
"llmTrace": {
|
|
137
|
+
"_comment": "§7.118 详细 LLM request/response 追踪(写进 ops log,info 级别默认可见)。enabled=false 全关;includeRequest/includeResponse 可各自单关;maxChars 是单字段字符上限(截断会以 …[+N chars] 显式标注,绝不静默);maxMessages 只保留最近 N 条 message;redactPii 走 pii-utils 10 类规则;redactSecrets 盖住厂商前缀密钥(sk-cp- / sk-ws- / tvly- …,pii-utils 的 api-key 规则盖不住)。",
|
|
138
|
+
"enabled": true,
|
|
139
|
+
"includeRequest": true,
|
|
140
|
+
"includeResponse": true,
|
|
141
|
+
"maxChars": 2000,
|
|
142
|
+
"maxMessages": 12,
|
|
143
|
+
"redactPii": true,
|
|
144
|
+
"redactSecrets": true
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"tee": {
|
|
148
|
+
"_comment": "TEE 后端选择(simulated / trustzone / keystone / sgx);平台自动探测时可留空。storageRoot 留空 = ~/.dsh-edge-agent。",
|
|
149
|
+
"type": "simulated",
|
|
150
|
+
"storageRoot": "",
|
|
151
|
+
"keyStorePath": ""
|
|
152
|
+
},
|
|
153
|
+
"storage": {
|
|
154
|
+
"_comment": "local-storage 明文 JSONL KV 根目录;留空 = ~/.dsh-edge-agent/storage。",
|
|
155
|
+
"root": ""
|
|
156
|
+
},
|
|
157
|
+
"etscli": {
|
|
158
|
+
"_comment": "etscli 只读工具 wrapper(§7.98)。bin 留空 = ~/.local/bin/etscli。",
|
|
159
|
+
"bin": "",
|
|
160
|
+
"timeoutMs": 30000
|
|
161
|
+
},
|
|
162
|
+
"threat": {
|
|
163
|
+
"_comment": "td-bus 阈值。cloudRate = 每分钟云请求数上限(0 = 不限)。",
|
|
164
|
+
"cloudRate": 20,
|
|
165
|
+
"blockLevel": "critical"
|
|
166
|
+
},
|
|
167
|
+
"webSearch": {
|
|
168
|
+
"_comment": "Phase 5 web-search providers(§7.82)三级链:Tavily → 博查 AI → DeepSeek。任一可用即可,任一失败自动 fallback;不写 key 就跳过该 tier。§7.182 主人裁决:Tavily / 博查两档**默认关闭** ⇒ 出厂只有 DeepSeek 档在链上(secrets.deepseekApiKey);要开就把对应开关写 true。",
|
|
169
|
+
"tavilyEnabled": false,
|
|
170
|
+
"bochaEnabled": false
|
|
171
|
+
},
|
|
172
|
+
"agent": {
|
|
173
|
+
"_comment": "agent persona + 工具权限。",
|
|
174
|
+
"persona": "You are edge-agent, a privacy-first AI assistant running on the user's device.",
|
|
175
|
+
"localToolsWritable": true,
|
|
176
|
+
"localToolsAllowlist": "/tmp",
|
|
177
|
+
"permissionMode": "workspace-write"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.9.0",
|
|
3
|
+
"_comment": "sanitizationRules 的 pattern 必须与 src/dsh-adapter/pii-utils.ts 的 PII_PATTERNS 保持一致(tests/unit/pii-utils.test.ts 有一致性断言)。已移除 replacement 字段:占位符由 sanitizer-pipeline 自行生成为 [<PIITYPE>_<seq>],该字段历史上不生效。",
|
|
4
|
+
"_categories_comment": "§7.110(默认本地,类别简并):categories 只需要**肯定式定义例外**——CLOUD(需要公网信息)和 REJECT(危险请求);其余一切(本地操作、日常问答、含 PII 的本地处理)都是默认 LOCAL,不设行。SANITIZED 不再单列:CLOUD 路径本来必经 sanitizer(fail-closed,脱不了敏不上云),含敏感数据的操作另有 PII LOCAL 正则护栏兜底。 jevIntents 同步收敛:只保留无歧义的 CLOUD/REJECT 信号标签(知识问答/通用咨询属日常问答 → 默认 LOCAL,不再进 CLOUD)。intent-router 在 policy 无 LOCAL 行时自动补 catch-all 提示行并放行 LOCAL 输出。",
|
|
5
|
+
"_stages_comment": "§7.109(语义优先裁决):路由以 jev/LLM 的语义判决为主——stages.intent.semanticCloudMinConfidence 是操作者对分类器的信任阈值,语义判 CLOUD 且置信度 ≥ 阈值即出网(无需关键词佐证)。关键词/正则只作护栏与零成本快路径(REJECT 危险操作、PII LOCAL 安全网、内置新闻/天气类信号),不再为领域扩词——子串匹配易误命中(如「游戏攻略」)。stages.intent.cloudKeywords/localEntities/fallbackKeywords 仍是可用的扩展面(追加/替换语义见 §7.108),但默认为空。全部热重载。",
|
|
6
|
+
"categories": [
|
|
7
|
+
{
|
|
8
|
+
"id": "CLOUD",
|
|
9
|
+
"description": "需要检索公网上信息的任务:新闻、天气、行情、搜索引擎,以及旅游攻略、景点推荐、行程规划等需要实时公网信息的任务",
|
|
10
|
+
"examples": [
|
|
11
|
+
"今天北京天气",
|
|
12
|
+
"查一下最新的AI新闻",
|
|
13
|
+
"准备一个杭州游玩的攻略",
|
|
14
|
+
"规划一个西湖一日游"
|
|
15
|
+
],
|
|
16
|
+
"jevIntents": [
|
|
17
|
+
"天气",
|
|
18
|
+
"新闻",
|
|
19
|
+
"搜索",
|
|
20
|
+
"旅游攻略",
|
|
21
|
+
"景点推荐",
|
|
22
|
+
"行程规划",
|
|
23
|
+
"weather",
|
|
24
|
+
"news",
|
|
25
|
+
"search",
|
|
26
|
+
"travel",
|
|
27
|
+
"travel_planning",
|
|
28
|
+
"attraction"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "REJECT",
|
|
33
|
+
"description": "高危 / 违法 / 违规请求(危险系统操作、破坏性命令、投诉、法务)",
|
|
34
|
+
"examples": [
|
|
35
|
+
"rm -rf /",
|
|
36
|
+
"drop table users",
|
|
37
|
+
"我要投诉"
|
|
38
|
+
],
|
|
39
|
+
"jevIntents": [
|
|
40
|
+
"投诉",
|
|
41
|
+
"法务咨询",
|
|
42
|
+
"complaint",
|
|
43
|
+
"legal"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"routingRules": [
|
|
48
|
+
{
|
|
49
|
+
"pattern": "(导出|删除|清空|格式化).*(数据库|系统|磁盘|全部数据)",
|
|
50
|
+
"realm": "REJECT",
|
|
51
|
+
"confidence": 0.9,
|
|
52
|
+
"rationale": "危险系统操作"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"pattern": "(drop\\s+table|rm\\s+-rf|format\\s+[a-z]:|del\\s+/[fs])",
|
|
56
|
+
"realm": "REJECT",
|
|
57
|
+
"confidence": 0.95,
|
|
58
|
+
"rationale": "破坏性命令特征"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"pattern": "(本地|local|文件|file|计算|calculate|读取|写入)",
|
|
62
|
+
"realm": "LOCAL",
|
|
63
|
+
"confidence": 0.8,
|
|
64
|
+
"rationale": "本地操作不出设备"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"pattern": "(密码|password|secret|密钥|private.?key|token)",
|
|
68
|
+
"realm": "LOCAL",
|
|
69
|
+
"confidence": 0.9,
|
|
70
|
+
"rationale": "敏感凭据不得离开设备"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"pattern": "(身份证号|id.?card|银行卡|bank.?card|信用卡|credit.?card)",
|
|
74
|
+
"realm": "LOCAL",
|
|
75
|
+
"confidence": 0.95,
|
|
76
|
+
"rationale": "金融/身份类 PII 必须留在本地"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"pattern": "(手机号|电话号码|手机.{0,5}号|phone.?number|mobile.?number)",
|
|
80
|
+
"realm": "LOCAL",
|
|
81
|
+
"confidence": 0.95,
|
|
82
|
+
"rationale": "手机号 PII 必须留在本地"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"pattern": "(邮箱|电邮|email.?address|e-?mail)",
|
|
86
|
+
"realm": "LOCAL",
|
|
87
|
+
"confidence": 0.95,
|
|
88
|
+
"rationale": "邮箱 PII 必须留在本地"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"pattern": "(IP\\s*地址|服务器.{0,8}(IP|地址)|server\\s+IP|局域网.{0,8}(IP|地址))",
|
|
92
|
+
"realm": "LOCAL",
|
|
93
|
+
"confidence": 0.9,
|
|
94
|
+
"rationale": "IP 地址 PII 必须留在本地"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"pattern": "(家庭住址|住址|home\\s+address|通信地址)",
|
|
98
|
+
"realm": "LOCAL",
|
|
99
|
+
"confidence": 0.85,
|
|
100
|
+
"rationale": "家庭住址 PII 必须留在本地"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"pattern": "(联网|上网|网上查|搜索引擎|搜索一下网上|web search|search the web|look up online|weather forecast|天气预报|实时行情|股价|汇率|current price)",
|
|
104
|
+
"realm": "CLOUD",
|
|
105
|
+
"confidence": 0.8,
|
|
106
|
+
"rationale": "需要检索公网上的信息 → 才允许走云端 LLM"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"stages": {
|
|
110
|
+
"intent": {
|
|
111
|
+
"_semantic_comment": "§7.123 (2026-10-27): raised 0.75 → 0.95. The bailian decision-model answers a `choice` question and frequently reports NO numeric confidence; the decoder then substitutes a synthetic 0.9 ('decisive-by-construction'). At 0.75 that placeholder was always >= threshold, so EVERY CLOUD verdict from that provider left the device with no public-web signal — the §7.107 gate was inert on the one path that talks to a cloud service. 0.95 sits above the synthetic placeholder so only a MEASURED high confidence can unlock the semantic path. §7.123 also added a provenance guard in code (Intent.confidenceReported): a synthetic confidence can never satisfy this threshold at all. Lower it only if your classifier genuinely reports calibrated confidences; 0.95 is the safe floor for a choice-style model.",
|
|
112
|
+
"semanticCloudMinConfidence": 0.95,
|
|
113
|
+
"deviceCommands": {
|
|
114
|
+
"_comment": "家庭设备操作正则层的扩展词表 —— 追加到内置词表(灯/空调/电视/窗帘…)。devices = 设备名词,actions = 动作词。改这里即时生效(热重载),不用重启 App。",
|
|
115
|
+
"devices": [],
|
|
116
|
+
"actions": []
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"sanitizationRules": [
|
|
121
|
+
{
|
|
122
|
+
"pattern": "\\b[1-9]\\d{5}(?:19|20)\\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]\\b",
|
|
123
|
+
"dataClass": "secret",
|
|
124
|
+
"piiType": "id-card",
|
|
125
|
+
"keepPrefix": 6
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"pattern": "\\b\\d{16,19}\\b",
|
|
129
|
+
"dataClass": "secret",
|
|
130
|
+
"piiType": "bank-card"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"pattern": "\\b1[3-9]\\d{9}\\b",
|
|
134
|
+
"dataClass": "confidential",
|
|
135
|
+
"piiType": "phone",
|
|
136
|
+
"keepPrefix": 7
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"pattern": "[\\w.-]+@[\\w.-]+\\.\\w+",
|
|
140
|
+
"dataClass": "confidential",
|
|
141
|
+
"piiType": "email"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"pattern": "(?:sk-(?:proj-|ant-|live-|test-|org-)?[a-zA-Z0-9]{20,}|key-[a-zA-Z0-9]{16,}|api[_-]?key[_-]?[a-zA-Z0-9]{16,})",
|
|
145
|
+
"dataClass": "secret",
|
|
146
|
+
"piiType": "api-key"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"pattern": "(?:密码|口令|用户名|账号|账户|passwd|password|pwd|username|account|secret|access[ _-]?token|token|api[ _-]?key)[\"' ]{0,2}(?:[::=]|是|为|\\s+is\\s+)[\"' ]?[^\\s\"',,;;<>()()]{3,64}",
|
|
150
|
+
"dataClass": "secret",
|
|
151
|
+
"piiType": "credential",
|
|
152
|
+
"replacement": "<PII_CREDENTIAL_n>"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"pattern": "(?<![vV\\d.])(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)(?!\\.?\\d)",
|
|
156
|
+
"dataClass": "confidential",
|
|
157
|
+
"piiType": "ip-address"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"pattern": "(?:[0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}",
|
|
161
|
+
"dataClass": "confidential",
|
|
162
|
+
"piiType": "mac-address"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"pattern": "\\b(?:E[0-9A-Z]\\d{7}|G\\d{8})\\b",
|
|
166
|
+
"dataClass": "secret",
|
|
167
|
+
"piiType": "passport"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"pattern": "[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤川青藏琼][A-Z][A-HJ-NP-Z0-9]{5}",
|
|
171
|
+
"dataClass": "confidential",
|
|
172
|
+
"piiType": "license-plate"
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"dataClassifications": [
|
|
176
|
+
{
|
|
177
|
+
"class": "public",
|
|
178
|
+
"defaultRealm": "CLOUD",
|
|
179
|
+
"ttlSeconds": 3600
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"class": "internal",
|
|
183
|
+
"defaultRealm": "SANITIZED",
|
|
184
|
+
"ttlSeconds": 1800
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"class": "confidential",
|
|
188
|
+
"defaultRealm": "LOCAL",
|
|
189
|
+
"ttlSeconds": 900
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"class": "secret",
|
|
193
|
+
"defaultRealm": "LOCAL",
|
|
194
|
+
"ttlSeconds": 300
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"globalConstraints": {
|
|
198
|
+
"maxCloudRequestsPerMinute": 20,
|
|
199
|
+
"requireAttestation": false,
|
|
200
|
+
"blockIfTcbCompromised": true
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# dsh-edge-agent — desktop-safe overlay
|
|
2
|
+
#
|
|
3
|
+
# This patch is intended for loading the bundle into an existing DSH Desktop /
|
|
4
|
+
# Web profile through the Plugins page. Unlike the production `cordis.patch.yml`,
|
|
5
|
+
# it **only inserts** the edge privacy stack. It does not rewrite host defaults:
|
|
6
|
+
#
|
|
7
|
+
# - no system-prompt/persona override
|
|
8
|
+
# - no agent-default-model override
|
|
9
|
+
# - no approval/sandbox override
|
|
10
|
+
# - no session-root override
|
|
11
|
+
# - no http-api listener
|
|
12
|
+
# - no upstream tool/subagent/workflow disables
|
|
13
|
+
#
|
|
14
|
+
# What it does mount:
|
|
15
|
+
# - durable ops log + audit log
|
|
16
|
+
# - TCM stub + threat bus
|
|
17
|
+
# - Realm-aware skill/tool bridge
|
|
18
|
+
# - privacy policy + PII sanitizer
|
|
19
|
+
# - prompt guard + intent router + input guard orchestrator
|
|
20
|
+
# - §7.100 / §7.171 LLM routes: BOTH pools are DELEGATE adapters by default
|
|
21
|
+
# (they forward to the host profile's own configured model provider — the
|
|
22
|
+
# Desktop GUI's model picker — with host-side credential resolution; the
|
|
23
|
+
# bundle never reads any secret). A pool becomes a DIRECT (edge-owned) one
|
|
24
|
+
# only when its own endpoint is configured in config/edge.json
|
|
25
|
+
# (llm.local.baseUrl / llm.cloud.baseUrl).
|
|
26
|
+
#
|
|
27
|
+
# Notes:
|
|
28
|
+
# - §7.171 (2026-11-10) made llm.local symmetric with llm.cloud: with no
|
|
29
|
+
# `llm.local.baseUrl` the local route still registers, but forwards to the
|
|
30
|
+
# host provider. Consequence to be aware of: the internal LLM stages
|
|
31
|
+
# (intent classification / guard model-detection) are pinned to
|
|
32
|
+
# `local-llm`, so with no local endpoint they now run on the host's model
|
|
33
|
+
# and the text under inspection rides along. The 2026-10-18 ruling
|
|
34
|
+
# ("internal LLM calls must never borrow the host's cloud model") is
|
|
35
|
+
# therefore honoured only when a local endpoint IS configured — or when
|
|
36
|
+
# `llm.local.delegate=false`, which leaves the route unregistered and
|
|
37
|
+
# sends the stages back to their keyword/regex tier.
|
|
38
|
+
# - SANITIZED/CLOUD answers egress through the host's own provider — the
|
|
39
|
+
# same destination plain Desktop use already picks — after PII
|
|
40
|
+
# placeholder sanitization.
|
|
41
|
+
# - LLM-based guard/intent detection config comes from config/edge.json
|
|
42
|
+
# (stages.guard.* / stages.intent.*): both are ON by default, both point
|
|
43
|
+
# at `local-llm`, and intent-router falls back to keyword/policy rules
|
|
44
|
+
# when its classifier provider is unavailable.
|
|
45
|
+
# - The privacy pipeline still intercepts every agent step. That is expected:
|
|
46
|
+
# this is what makes it an edge-agent. If you want zero behavior change,
|
|
47
|
+
# set DSH_EDGE_INPUT_GUARD=false before starting/restarting the profile.
|
|
48
|
+
|
|
49
|
+
- id: tool-web
|
|
50
|
+
disabled: false
|
|
51
|
+
config:
|
|
52
|
+
search: true
|
|
53
|
+
fetch: true
|
|
54
|
+
searchMaxResults: 8
|
|
55
|
+
searchTimeoutMs: 30000
|
|
56
|
+
fetchTimeoutMs: 30000
|
|
57
|
+
- id: web
|
|
58
|
+
config:
|
|
59
|
+
searchProvider: tavily-bocha-fallback
|
|
60
|
+
fetchProvider: http
|
|
61
|
+
- id: web-search-deepseek
|
|
62
|
+
disabled: true
|
|
63
|
+
|
|
64
|
+
# ── 本 bundle 留在宿主树的三行(§7.136)──────────────────────────────────
|
|
65
|
+
# 理由见 scripts/_isolate-edge-group.mjs 的文件头:
|
|
66
|
+
# dsh-edge-agent(裸包名)—— 宿主 client-modules 只扫宿主 Loader 的 entries,
|
|
67
|
+
# preset 树不在其中 ⇒ Edge tab 的浏览器半边只能从这里被发现;
|
|
68
|
+
# audit-log / file-logger —— 裸包名行 inject auditLog,且它的 installFileLogger
|
|
69
|
+
# 会先占住 fileLogger 服务名 ⇒ 两者必须在 root realm,且 file-logger 行要更早装载。
|
|
70
|
+
- insert:
|
|
71
|
+
# §7.101.x (2026-10-20, fix #5) + §7.136: the BARE-package host-half row.
|
|
72
|
+
# The webview client-module system (@deepseek-ai/dsh-client-modules) scans
|
|
73
|
+
# LOADER ENTRY NAMES for a `dsh.client` declaration — and its package
|
|
74
|
+
# locator only accepts bare package-root specifiers (`exactPackageSpecifier`),
|
|
75
|
+
# so subpath rows like '@scope/pkg/audit-log' can never surface the
|
|
76
|
+
# bundle's browser half. dsh-context shows the working shape: one bare
|
|
77
|
+
# row (`name: dsh-context`) whose main entry IS the plugin AND whose
|
|
78
|
+
# manifest carries `dsh.client.platform: "web"`.
|
|
79
|
+
#
|
|
80
|
+
# §7.136: this row must stay in the HOST tree. client-modules scans
|
|
81
|
+
# `ctx.loader.entries()` — the host Loader's entries — while a preset's
|
|
82
|
+
# plugin list lives in its own EntryTree, outside that enumeration. A bare
|
|
83
|
+
# row inside the preset would therefore never surface the browser half and
|
|
84
|
+
# the Edge tab would vanish in every work mode.
|
|
85
|
+
- id: dsh-edge-agent
|
|
86
|
+
name: '@dsh-edge/dsh-edge-agent'
|
|
87
|
+
|
|
88
|
+
# Ops log exporter. Mount first so later plugin logs land on disk.
|
|
89
|
+
- id: file-logger
|
|
90
|
+
name: '@dsh-edge/dsh-edge-agent/file-logger'
|
|
91
|
+
config:
|
|
92
|
+
# §7.102 "one config file": only profile-specific statics live here.
|
|
93
|
+
# root / level / rotation come from config/edge.json (audit.*);
|
|
94
|
+
# no process.env reads — the desktop GUI never had them.
|
|
95
|
+
filename: dsh-edge-agent-desktop.log
|
|
96
|
+
flushIntervalMs: 1000
|
|
97
|
+
queueCapacity: 10000
|
|
98
|
+
maxFileSizeBytes: 52428800
|
|
99
|
+
|
|
100
|
+
# Security ledger. Default root stays isolated under ~/.dsh-edge-agent.
|
|
101
|
+
- id: audit-log
|
|
102
|
+
name: '@dsh-edge/dsh-edge-agent/audit-log'
|
|
103
|
+
config:
|
|
104
|
+
# §7.102 "one config file": minLevel / flush / root come from
|
|
105
|
+
# config/edge.json (audit.*). Only static wiring stays here.
|
|
106
|
+
ringBufferSize: 512
|
|
107
|
+
filename: audit.plain.jsonl
|
|
108
|
+
enablePIIRedaction: true
|
|
109
|
+
maxFileSizeBytes: 10485760
|
|
110
|
+
maxFileAgeDays: 7
|
|
111
|
+
maxRotatedFiles: 5
|
|
112
|
+
|
|
113
|
+
# §7.145: 桌面版「起不来」的根因修复(431)。
|
|
114
|
+
#
|
|
115
|
+
# 这一行**必须**留在宿主树(不是 preset)—— 它修的不是 Edge 行为,而是
|
|
116
|
+
# **宿主自己的启动**:Electron 外壳的 welcome 握手带着 Chromium cookie jar
|
|
117
|
+
# 出发,cookie 越攒越多 ⇒ 请求头爆 16 KB ⇒ 431 ⇒ 外壳拆宿主 ⇒
|
|
118
|
+
# 「DeepSeek Harness is unavailable」。握手发生在**任何工作方式选定之前**
|
|
119
|
+
# ⇒ 修它的插件也必须在 preset 之外。
|
|
120
|
+
#
|
|
121
|
+
# 它自带 `process.versions.electron` 判据 ⇒ headless profile 里直接跳过。
|
|
122
|
+
- id: desktop-cookie-janitor
|
|
123
|
+
name: '@dsh-edge/dsh-edge-agent/desktop-cookie-janitor'
|
|
124
|
+
config:
|
|
125
|
+
enabled: true
|
|
126
|
+
# 宿主 web 服务是裸 createServer(16 KB 头上限);抬到 64 KB 让
|
|
127
|
+
# 一个已经攒胖的 cookie jar 也不会打死启动。
|
|
128
|
+
maxHeaderBytes: 65536
|
|
129
|
+
|