dsh-snowbreak-heimdall 3.5.2 → 3.7.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/package.json CHANGED
@@ -1,46 +1,46 @@
1
- {
2
- "name": "dsh-snowbreak-heimdall",
3
- "version": "3.5.2",
4
- "description": "《尘白禁区》海姆达尔终端 / 世界树公司源码级皮肤:加载画面、双主题、菜单/侧栏/图标,插件仅在加载后播放启动动画。Windows / DSH 0.2.2-rc.x。",
5
- "type": "module",
6
- "license": "MIT",
7
- "engines": {
8
- "dsh": ">=0.2.2-rc.1 <0.3.0-0"
9
- },
10
- "os": [
11
- "win32"
12
- ],
13
- "cpu": [
14
- "x64"
15
- ],
16
- "exports": {
17
- ".": "./lib/index.js",
18
- "./client": "./lib/client.js",
19
- "./locale/*.json": "./locale/*.json",
20
- "./icon": "./icon.svg"
21
- },
22
- "files": [
23
- "lib/index.js",
24
- "lib/client.js",
25
- "cordis.patch.yml",
26
- "locale/*.json",
27
- "icon.svg",
28
- "LICENSE",
29
- "README.md",
30
- "TEST-REPORT.md",
31
- "SHA256SUMS.txt",
32
- "patch",
33
- "assets",
34
- "vendor",
35
- "tools"
36
- ],
37
- "dsh": {
38
- "bundle": {
39
- "patch": "./cordis.patch.yml"
40
- },
41
- "client": {
42
- "platform": "web",
43
- "immediately": true
44
- }
45
- }
46
- }
1
+ {
2
+ "name": "dsh-snowbreak-heimdall",
3
+ "version": "3.7.2",
4
+ "description": "《尘白禁区》海姆达尔终端 / 世界树公司源码级皮肤:加载画面、双主题、菜单/侧栏/图标,插件仅在加载后播放启动动画。Windows / DSH 0.2.2-rc.x。",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "engines": {
8
+ "dsh": ">=0.2.2-rc.1 <0.3.0-0"
9
+ },
10
+ "os": [
11
+ "win32"
12
+ ],
13
+ "cpu": [
14
+ "x64"
15
+ ],
16
+ "exports": {
17
+ ".": "./lib/index.js",
18
+ "./client": "./lib/client.js",
19
+ "./locale/*.json": "./locale/*.json",
20
+ "./icon": "./icon.svg"
21
+ },
22
+ "files": [
23
+ "lib/index.js",
24
+ "lib/client.js",
25
+ "cordis.patch.yml",
26
+ "locale/*.json",
27
+ "icon.svg",
28
+ "LICENSE",
29
+ "README.md",
30
+ "TEST-REPORT.md",
31
+ "SHA256SUMS.txt",
32
+ "patch",
33
+ "assets",
34
+ "vendor",
35
+ "tools"
36
+ ],
37
+ "dsh": {
38
+ "bundle": {
39
+ "patch": "./cordis.patch.yml"
40
+ },
41
+ "client": {
42
+ "platform": "web",
43
+ "immediately": true
44
+ }
45
+ }
46
+ }
package/patch/patcher.py CHANGED
@@ -33,6 +33,9 @@ MENU_FILES = ("lib/preload-app.cjs", "lib/main.js", "lib/preload-welcome.cjs")
33
33
  STATE_JSON = "state.json"
34
34
  LOG_NAME = "heimdall.log"
35
35
  MARKER = "HEIMDALL-SOURCE-V1"
36
+ # Written into index.html so the boot layer can report the real source layer
37
+ # version instead of a decorative string.
38
+ LAYER_VERSION = "unknown"
36
39
 
37
40
  DEFAULT_TARGET = os.path.join(
38
41
  os.environ.get("LOCALAPPDATA", ""), "Programs", "DeepSeek Harness",
@@ -271,6 +274,14 @@ UI_TEXT = {
271
274
  ("新建会话", "建立接入"),
272
275
  ("工作区", "作业区"),
273
276
  ("会话", "接入"),
277
+ # 上下文占用 → 零区污染度(先长后短,避免半截替换)
278
+ ("上下文已用 {percent}", "零区污染度 {percent}"),
279
+ ("上下文已用", "零区污染度"),
280
+ ("上下文溢出", "污染溢出"),
281
+ ("上下文", "污染度"),
282
+ ("系统提示词", "抑制协议"),
283
+ ("工具定义", "模块定义"),
284
+ ("对话消息", "通讯记录"),
274
285
  ],
275
286
  "dsh/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js": [
276
287
  ("新会话", "建立接入"),
@@ -286,9 +297,29 @@ UI_TEXT = {
286
297
  ("新会话", "新接入"),
287
298
  ("会话", "接入"),
288
299
  ],
300
+ # 模型选择器 → 战术模块(整个命名空间统一换词)
301
+ "dsh/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js": [
302
+ ("推理等级", "算力等级"),
303
+ ("模型", "战术模块"),
304
+ ],
305
+ # 审批 → 世界树授权
306
+ "dsh/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/client.js": [
307
+ ("等待审批", "等待授权"),
308
+ ("审批详情", "授权详情"),
309
+ ("工具 {toolName} 请求越权执行", "模块 {toolName} 请求越权执行"),
310
+ ("允许一次", "批准本次"),
311
+ ("始终允许", "长期批准"),
312
+ ("拒绝", "驳回"),
313
+ ("允许", "批准"),
314
+ ],
289
315
  "dsh/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js": [
290
- ('name: "DeepSeek-V4.1-Flash"', 'name: "世界树-V4.1-Flash"'),
291
- ('name: "DeepSeek-V4-Pro"', 'name: "世界树-V4-Pro"'),
316
+ ('name: "DeepSeek-V4.1-Flash"', 'name: "优格-V4.1-Flash"'),
317
+ ('name: "DeepSeek-V4-Pro"', 'name: "优格-V4-Pro"'),
318
+ # A successful /models listing supplies its own display name and wins over
319
+ # the bundled catalog, which silently undid the two renames above.
320
+ ('...entry.name === void 0 ? {} : { name: entry.name },',
321
+ '...entry.name === void 0 ? {} : { name: String(entry.name)'
322
+ '.replace(/^(?:DeepSeek|WorldTree|世界树)-/, "优格-") },'),
292
323
  ],
293
324
  }
294
325
 
@@ -297,14 +328,27 @@ def now():
297
328
  return time.strftime("%Y-%m-%dT%H:%M:%S%z")
298
329
 
299
330
 
300
- def configure(target, state_dir=None, profile_dir=None, test_mode=False, auto_restart=False):
331
+ def configure(target, state_dir=None, profile_dir=None, test_mode=False, auto_restart=False,
332
+ layer_version=None):
301
333
  global STATE_DIR, LOG_FILE, BACKUP_ROOT, PROFILE_DIR, TEST_MODE, APP_EXE, AUTO_RESTART
334
+ global LAYER_VERSION
335
+ if layer_version:
336
+ LAYER_VERSION = str(layer_version)
302
337
  TEST_MODE = bool(test_mode)
303
338
  AUTO_RESTART = bool(auto_restart)
304
339
  resources = os.path.dirname(os.path.abspath(target))
305
340
  APP_EXE = os.path.join(os.path.dirname(resources), "DeepSeek Harness.exe")
306
341
  STATE_DIR = os.path.abspath(state_dir or os.environ.get("HEIMDALL_STATE_DIR")
307
342
  or os.path.join(resources, "HeimdallTerminal"))
343
+ if not layer_version and LAYER_VERSION == "unknown":
344
+ # Recovery scripts run without the plugin's CLI argument; the staged
345
+ # runtime carries the package metadata for them.
346
+ try:
347
+ with open(os.path.join(STATE_DIR, "runtime", "package.json"),
348
+ "r", encoding="utf-8") as handle:
349
+ LAYER_VERSION = str(json.load(handle).get("version") or "unknown")
350
+ except (OSError, ValueError):
351
+ pass
308
352
  LOG_FILE = os.path.join(STATE_DIR, LOG_NAME)
309
353
  BACKUP_ROOT = os.path.join(STATE_DIR, "backup")
310
354
  PROFILE_DIR = os.path.abspath(profile_dir or os.environ.get("DSH_PROFILE_DIR") or "")
@@ -587,13 +631,16 @@ def compose_index(index_text):
587
631
  meta = (
588
632
  ' <meta name="theme-color" content="#070A0F" />\n'
589
633
  ' <meta name="description" content="世界树公司 · 海姆达尔部队 · 零区战术终端 HM-04" />\n'
634
+ ' <meta name="hm-layer" content="v' + LAYER_VERSION + '" />\n'
590
635
  )
591
636
  if '<link rel="manifest"' in html:
592
637
  html = html.replace(' <link rel="manifest"', meta + ' <link rel="manifest"', 1)
593
638
  else:
594
639
  html = html.replace("</head>", meta + "</head>", 1)
640
+ extras_css = read_asset(SOURCE, "extras.css").decode("utf-8")
595
641
  critical = (
596
- ' <style id="hm-boot-style">\n/* ' + MARKER + ' */\n' + loading_css + "\n </style>\n"
642
+ ' <style id="hm-boot-style">\n/* ' + MARKER + ' */\n' + loading_css +
643
+ "\n/* heimdall extras */\n" + extras_css + "\n </style>\n"
597
644
  )
598
645
  html = html.replace("</head>", critical + " </head>", 1)
599
646
  body_open = re.search(r"<body([^>]*)>", html)
@@ -608,7 +655,8 @@ def compose_index(index_text):
608
655
  if "</body>" not in html:
609
656
  raise RuntimeError("index closing body anchor missing")
610
657
  html = html.replace("</body>",
611
- ' <script defer src="./assets/heimdall-shell.js"></script>\n </body>', 1)
658
+ ' <script defer src="./assets/heimdall-shell.js"></script>\n'
659
+ ' <script defer src="./assets/heimdall-extras.js"></script>\n </body>', 1)
612
660
  if 'id="root"' not in html or "hm-boot-style" not in html:
613
661
  raise RuntimeError("index composition failed")
614
662
  return html
@@ -661,6 +709,7 @@ def compose_tree(tree, target):
661
709
  }
662
710
  additions = {
663
711
  FRONTEND + "/assets/heimdall-shell.js": read_asset(SOURCE, "shell.js"),
712
+ FRONTEND + "/assets/heimdall-extras.js": read_asset(SOURCE, "extras.js"),
664
713
  FRONTEND + "/assets/hm-mark-light.png": read_asset(SOURCE, "hm-mark-light.png"),
665
714
  FRONTEND + "/assets/hm-mark-blue.png": read_asset(SOURCE, "hm-mark-blue.png"),
666
715
  "renderer/assets/welcome-mark-light.png": read_asset(SOURCE, "welcome-mark-light.png"),
@@ -1313,8 +1362,10 @@ def main():
1313
1362
  parser.add_argument("--test-mode", action="store_true")
1314
1363
  parser.add_argument("--wait-pid", type=int, default=0)
1315
1364
  parser.add_argument("--auto-restart", action="store_true")
1365
+ parser.add_argument("--layer-version", default=None)
1316
1366
  args = parser.parse_args()
1317
- configure(args.target, args.state_dir, args.profile_dir, args.test_mode, args.auto_restart)
1367
+ configure(args.target, args.state_dir, args.profile_dir, args.test_mode, args.auto_restart,
1368
+ args.layer_version)
1318
1369
  if args.mode == "check":
1319
1370
  print(json.dumps(check_target(args.target), ensure_ascii=False))
1320
1371
  return 0