dsh-qqbot-muu 0.1.15 → 0.1.21

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.
Files changed (171) hide show
  1. package/CHANGELOG.md +168 -85
  2. package/client/qqbot-settings.js +13401 -12024
  3. package/config/modules.json +212 -0
  4. package/dist/channel-tools.js +21 -10
  5. package/dist/config.d.ts +14 -0
  6. package/dist/config.js +573 -449
  7. package/dist/features/contextless-store.js +247 -247
  8. package/dist/features/contextless-trim.js +455 -34
  9. package/dist/features/four-source.js +338 -336
  10. package/dist/features/group-join-request.js +289 -287
  11. package/dist/features/local-models.js +1494 -0
  12. package/dist/features/rotate-summarizer.js +438 -0
  13. package/dist/features/scenario-detect.js +321 -0
  14. package/dist/features/scheduler.js +8 -1
  15. package/dist/features/session-rotate.js +499 -0
  16. package/dist/features/session-title.js +199 -0
  17. package/dist/features/style-layer.js +501 -0
  18. package/dist/features/thinking-log.js +71 -69
  19. package/dist/gateway/bootstrap.js +1704 -1388
  20. package/dist/gateway/data-root.js +77 -3
  21. package/dist/gateway/middleware-setup.js +6 -3
  22. package/dist/index.js +4 -2
  23. package/dist/model/settings-reader.js +193 -102
  24. package/dist/session/session-manager.js +1730 -1587
  25. package/dist/shared/paths.js +128 -0
  26. package/dist/shared/settings-io.js +79 -0
  27. package/dist/transport/inbound.js +20 -1
  28. package/dist/transport/outbound.js +56 -4
  29. package/docs/RELEASE_CHECKLIST.md +24 -2
  30. package/dshqqbot/.qqbot-extensions/hooks/interview-panel.mjs +41 -1
  31. package/dshqqbot/.qqbot-extensions/inbound/00-vision.mjs +111 -0
  32. package/dshqqbot/.qqbot-extensions/inbound/aa-memory-recall.mjs +802 -689
  33. package/dshqqbot/.qqbot-extensions/inbound/ac-image-see.mjs +1 -1
  34. package/dshqqbot/.qqbot-extensions/inbound/az-feedback.mjs +113 -115
  35. package/dshqqbot/.qqbot-extensions/inbound/local-answer.mjs +689 -568
  36. package/dshqqbot/.qqbot-extensions/lib/.pet-form.json +1 -1
  37. package/dshqqbot/.qqbot-extensions/lib/draw-core.mjs +238 -7
  38. package/dshqqbot/.qqbot-extensions/lib/local-llm.mjs +455 -394
  39. package/dshqqbot/.qqbot-extensions/lib/memory-agent.mjs +930 -928
  40. package/dshqqbot/.qqbot-extensions/lib/memory-core.mjs +537 -537
  41. package/dshqqbot/.qqbot-extensions/lib/memory-db.mjs +2476 -2245
  42. package/dshqqbot/.qqbot-extensions/lib/memory-hippo.mjs +18 -0
  43. package/dshqqbot/.qqbot-extensions/lib/memory.mjs +191 -186
  44. package/dshqqbot/.qqbot-extensions/lib/plugin-dir.mjs +14 -4
  45. package/dshqqbot/.qqbot-extensions/lib/scope-util.mjs +84 -0
  46. package/dshqqbot/.qqbot-extensions/lib/vision.mjs +1 -1
  47. package/dshqqbot/.qqbot-extensions/outbound/aa-sanitize.mjs +158 -154
  48. package/dshqqbot/.qqbot-extensions/outbound/ac-media-fix.mjs +5 -1
  49. package/dshqqbot/.qqbot-extensions/outbound/memory-agent.mjs +121 -130
  50. package/dshqqbot/.qqbot-extensions/outbound/split-reply.mjs +18 -2
  51. package/dshqqbot/.qqbot-extensions/outbound/turn-memory.mjs +92 -101
  52. package/dshqqbot/.qqbot-extensions/tools/draw.mjs +22 -1
  53. package/dshqqbot/.qqbot-extensions/tools/memory.mjs +178 -120
  54. package/dshqqbot/.qqbot-extensions/tools/pet_card.mjs +3 -2
  55. package/dshqqbot/.qqbot-extensions/tools/storyboard.mjs +3 -1
  56. package/dshqqbot/.qqbot-extensions/vendor/abogus/test-abogus.mjs +128 -126
  57. package/package.json +119 -111
  58. package/scripts/__pycache__/fan-mode.cpython-311.pyc +0 -0
  59. package/scripts/__pycache__/memory-audit.cpython-311.pyc +0 -0
  60. package/scripts/__pycache__/qq-ip-sync.cpython-311.pyc +0 -0
  61. package/scripts/__pycache__/qq-whitelist.cpython-311.pyc +0 -0
  62. package/scripts/_add_maintenance_cfg.py +20 -0
  63. package/scripts/_bench_keeplease.sh +10 -0
  64. package/scripts/_dbg_purge.py +15 -0
  65. package/scripts/_elev.sh +6 -0
  66. package/scripts/_fix_all_admin.cmd +16 -0
  67. package/scripts/_livecheck-image.mjs +33 -0
  68. package/scripts/_livecheck-llm.mjs +34 -0
  69. package/scripts/_livecheck-tts.mjs +37 -0
  70. package/scripts/_patch_curve.py +88 -0
  71. package/scripts/_patch_fan_thermal.py +24 -0
  72. package/scripts/_tag_tmp.py +13 -0
  73. package/scripts/adb-broker-client.mjs +87 -0
  74. package/scripts/adb-broker.mjs +205 -0
  75. package/scripts/ai-mode.cmd +6 -0
  76. package/scripts/ai-mode.py +387 -0
  77. package/scripts/ai-toolkit.py +607 -0
  78. package/scripts/apply-fan-gpu45.py +51 -0
  79. package/scripts/bench-fans.py +515 -0
  80. package/scripts/bench-load-direct.py +63 -0
  81. package/scripts/boot-tasks-hidden.vbs +20 -0
  82. package/scripts/boot-tasks.cmd +277 -0
  83. package/scripts/chat-archive/__pycache__/build-sft-v4.cpython-311.pyc +0 -0
  84. package/scripts/chat-archive/__pycache__/build-sft.cpython-311.pyc +0 -0
  85. package/scripts/chat-archive/build-sft-v4.py +566 -0
  86. package/scripts/chat-archive/build-sft.py +390 -0
  87. package/scripts/chat-archive/eval-sft.py +155 -0
  88. package/scripts/chat-archive/extract-memory.py +143 -0
  89. package/scripts/chat-archive/inventory.py +182 -0
  90. package/scripts/chat-archive/merge-sft.py +114 -0
  91. package/scripts/chat-archive/qce-pull.py +217 -0
  92. package/scripts/chat-archive/qqheader.py +110 -0
  93. package/scripts/chat-archive/qqkey2.py +113 -0
  94. package/scripts/chat-archive/qqprobe.py +153 -0
  95. package/scripts/chat-archive/screen-collect.py +163 -0
  96. package/scripts/chat-archive/sqlcipher_probe.py +444 -0
  97. package/scripts/comfy_gen.py +209 -0
  98. package/scripts/compose-video.py +168 -0
  99. package/scripts/dl_models.py +45 -0
  100. package/scripts/draw-now.cmd +18 -0
  101. package/scripts/dsh-instance-guard.mjs +20 -2
  102. package/scripts/elev-extra.cmd +25 -0
  103. package/scripts/episode.py +529 -0
  104. package/scripts/fan-curve.py +218 -0
  105. package/scripts/fan-guard.cmd +8 -0
  106. package/scripts/fan-mode.py +380 -0
  107. package/scripts/fan_manual_safe.py +33 -0
  108. package/scripts/fan_restore_manual.py +46 -0
  109. package/scripts/fc_curves.py +359 -0
  110. package/scripts/fix-fan-and-timers.cmd +39 -0
  111. package/scripts/fix_admin_all.py +94 -0
  112. package/scripts/flows.mjs +224 -0
  113. package/scripts/gateway.cmd +126 -0
  114. package/scripts/gen-image.py +420 -0
  115. package/scripts/gen-video.py +186 -0
  116. package/scripts/git-askpass.cmd +2 -2
  117. package/scripts/gpu-mode.py +195 -0
  118. package/scripts/hw-profile.py +175 -0
  119. package/scripts/install-schedule.cmd +37 -0
  120. package/scripts/install-watch.cmd +29 -0
  121. package/scripts/matte-cutout.py +106 -0
  122. package/scripts/media-enhance.py +402 -0
  123. package/scripts/memory-audit.py +581 -0
  124. package/scripts/migrate-scope.mjs +140 -139
  125. package/scripts/model-registry.py +519 -0
  126. package/scripts/openid-audit.mjs +219 -0
  127. package/scripts/pull-gguf.py +127 -0
  128. package/scripts/purge-standby.py +151 -0
  129. package/scripts/qq-connect-login.py +133 -0
  130. package/scripts/qq-ip-sync-hidden.vbs +5 -0
  131. package/scripts/qq-ip-sync.py +300 -0
  132. package/scripts/qq-login-once.cmd +20 -0
  133. package/scripts/qq-login-qr.py +72 -0
  134. package/scripts/qq-whitelist-fix.cmd +27 -0
  135. package/scripts/qq-whitelist-login.cmd +26 -0
  136. package/scripts/qq-whitelist.cmd +12 -0
  137. package/scripts/qq-whitelist.py +1452 -0
  138. package/scripts/quality-compare.py +134 -0
  139. package/scripts/release-all.mjs +636 -430
  140. package/scripts/release-check.mjs +244 -226
  141. package/scripts/resume-coder.cmd +38 -0
  142. package/scripts/secure-room/index.html +334 -0
  143. package/scripts/secure-room/server.py +582 -0
  144. package/scripts/security-check.mjs +164 -0
  145. package/scripts/selftest-local-llm.mjs +20 -0
  146. package/scripts/selftest-local-models.mjs +754 -0
  147. package/scripts/selftest-rotate-style.mjs +308 -0
  148. package/scripts/shutdown-s5-optional.cmd +21 -0
  149. package/scripts/sleep-2325.cmd +75 -0
  150. package/scripts/start-comfyui.cmd +5 -0
  151. package/scripts/start-strata.cmd +17 -0
  152. package/scripts/start-strata.vbs +11 -0
  153. package/scripts/start-watch-hidden.vbs +3 -0
  154. package/scripts/stickers/auto-tag.mjs +161 -0
  155. package/scripts/storage.mjs +236 -0
  156. package/scripts/sync-plugin-copies.mjs +98 -23
  157. package/scripts/tests/test-qq-whitelist.py +192 -0
  158. package/scripts/train/__pycache__/train-lora.cpython-311.pyc +0 -0
  159. package/scripts/train/gguf-quantize.py +92 -0
  160. package/scripts/train/gguf-to-hf.py +112 -0
  161. package/scripts/train/merge-lora.py +51 -0
  162. package/scripts/train/probe-mirrors.sh +12 -0
  163. package/scripts/train/probe-mirrors2.sh +20 -0
  164. package/scripts/train/setup-wsl.sh +23 -0
  165. package/scripts/train/setup-wsl2.sh +25 -0
  166. package/scripts/train/setup-wsl3.sh +22 -0
  167. package/scripts/train/setup-wsl4.sh +22 -0
  168. package/scripts/train/train-lora.py +319 -0
  169. package/scripts/vram-free.py +104 -0
  170. package/scripts/wechat-full-pull.mjs +1 -1
  171. package/settings-host.js +1047 -12
@@ -0,0 +1,359 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """fc_curves.py — 把 FanControl 的手动固定值换成真正的温度曲线。
4
+
5
+ 必须用管理员权限运行(userConfig.json 在 Program Files 下)。
6
+
7
+ 用法:
8
+ python fc_curves.py show # 只看当前曲线/绑定
9
+ python fc_curves.py apply # 写入两条 Linear 曲线并绑定风扇
10
+ python fc_curves.py apply --points-obj # 同上,但 Points 用 {"X":..,"Y":..} 形式(schema 试探)
11
+ python fc_curves.py restore # 恢复到手动手动固定值(GPU 15% / CPU 30% / 机箱 24-30%)
12
+ python fc_curves.py gpu off|manual15|manual35
13
+ python fc_curves.py swap-sensor 1 # 改 CPU 曲线绑定的温度传感器索引(试探用)
14
+
15
+ 每次写入前都会备份到 F:\\qqbot\\backups\\fancontrol\\userConfig.json.bak-<ts>。
16
+ """
17
+ import glob
18
+ import io
19
+ import json
20
+ import os
21
+ import shutil
22
+ import sys
23
+ import time
24
+
25
+ CFG = r"C:\Program Files (x86)\FanControl\Configurations\userConfig.json"
26
+ BAKDIR = r"F:\qqbot\backups\fancontrol"
27
+
28
+ # NCT6797D 的温度通道(LibreHardwareMonitor 标识 /lpc/nct6797d/temperature/<n>)
29
+ CPU_SENSOR = "/lpc/nct6797d/temperature/1" # 通常为 CPU / CPU Socket
30
+ CASE_SENSOR = "/lpc/nct6797d/temperature/0" # 通常为 System / 主板
31
+
32
+ CPU_CURVE = {
33
+ "Name": "CPU 温度曲线",
34
+ "IsHidden": False,
35
+ "CommandMode": 1, # 1 = 线性
36
+ "SelectedTempSensor": CPU_SENSOR,
37
+ "MinimumPercent": 25,
38
+ "MaximumPercent": 100,
39
+ "Points": [[45, 30], [60, 45], [72, 65], [82, 90], [88, 100]],
40
+ }
41
+
42
+ CASE_CURVE = {
43
+ "Name": "机箱 温度曲线",
44
+ "IsHidden": False,
45
+ "CommandMode": 1,
46
+ "SelectedTempSensor": CASE_SENSOR,
47
+ "MinimumPercent": 25,
48
+ "MaximumPercent": 100,
49
+ "Points": [[38, 30], [50, 40], [62, 60], [72, 85], [80, 100]],
50
+ }
51
+
52
+ CPU_FAN = "/lpc/nct6797d/control/1"
53
+ INTAKE = "/lpc/nct6797d/control/3" # SYS_FAN2 进风
54
+ EXHAUST = "/lpc/nct6797d/control/5" # SYS_FAN4 出风
55
+ GPU_CTL = "NVApiWrapper/0-TU102-A/control/0"
56
+
57
+
58
+ def load():
59
+ with io.open(CFG, encoding="utf-8") as f:
60
+ return json.load(f)
61
+
62
+
63
+ def normalize_points(obj):
64
+ """FanControl 的 Points 是 System.Windows.Point 列表,Newtonsoft 按字符串 "x,y" 反序列化。"""
65
+ for c in obj.get("FanCurves", []):
66
+ pts = c.get("Points")
67
+ if not isinstance(pts, list):
68
+ continue
69
+ out = []
70
+ for p in pts:
71
+ if isinstance(p, str):
72
+ out.append(p)
73
+ elif isinstance(p, (list, tuple)):
74
+ out.append("%s,%s" % (p[0], p[1]))
75
+ elif isinstance(p, dict):
76
+ out.append("%s,%s" % (p.get("X", p.get("x")), p.get("Y", p.get("y"))))
77
+ c["Points"] = out
78
+ return obj
79
+
80
+
81
+ def save(d, tag):
82
+ os.makedirs(BAKDIR, exist_ok=True)
83
+ ts = time.strftime("%Y%m%d-%H%M%S")
84
+ bak = os.path.join(BAKDIR, "userConfig.json.bak-%s-%s" % (ts, tag))
85
+ shutil.copy2(CFG, bak)
86
+ normalize_points(d.get("FanControl", {}))
87
+ with io.open(CFG, "w", encoding="utf-8") as f:
88
+ f.write(json.dumps(d, ensure_ascii=False, indent=4))
89
+ print("backup ->", bak)
90
+
91
+
92
+ def curves_by_name(fc):
93
+ return {c.get("Name"): c for c in fc["FanCurves"]}
94
+
95
+
96
+ def show(d):
97
+ fc = d["FanControl"]
98
+ print("TemperatureSensors:", json.dumps(fc["TemperatureSensors"], ensure_ascii=False))
99
+ for c in fc["FanCurves"]:
100
+ print(" curve:", json.dumps(c, ensure_ascii=False))
101
+ for c in fc["Controls"]:
102
+ print(
103
+ " ctl %-32s nick=%-14s en=%-5s curve=%-14r manual=%-5s val=%s"
104
+ % (
105
+ c.get("Identifier"),
106
+ c.get("NickName"),
107
+ c.get("Enable"),
108
+ c.get("SelectedFanCurve"),
109
+ c.get("ManualControl"),
110
+ c.get("ManualControlValue"),
111
+ )
112
+ )
113
+
114
+
115
+ def put_curve(fc, curve, as_obj=False):
116
+ cur = dict(curve)
117
+ if as_obj:
118
+ cur["Points"] = [{"X": p[0], "Y": p[1]} for p in curve["Points"]]
119
+ for c in fc["FanCurves"]:
120
+ if c.get("Name") == cur["Name"]:
121
+ c.clear()
122
+ c.update(cur)
123
+ return
124
+ fc["FanCurves"].append(cur)
125
+
126
+
127
+ def bind(fc, ctl_id, curve_name):
128
+ for c in fc["Controls"]:
129
+ if c.get("Identifier") == ctl_id:
130
+ c["Enable"] = True
131
+ c["ManualControl"] = False
132
+ c["SelectedFanCurve"] = curve_name
133
+ return c
134
+ return None
135
+
136
+
137
+ def main():
138
+ mode = sys.argv[1] if len(sys.argv) > 1 else "show"
139
+ d = load()
140
+ fc = d["FanControl"]
141
+
142
+ if mode == "show":
143
+ show(d)
144
+ return
145
+
146
+ if mode == "apply":
147
+ as_obj = "--points-obj" in sys.argv
148
+ # 修掉历史脚本留下的乱码曲线名
149
+ for c in fc["FanCurves"]:
150
+ if c.get("Name") != c.get("Name").encode("utf-8", "ignore").decode("utf-8", "ignore"):
151
+ pass
152
+ put_curve(fc, CPU_CURVE, as_obj)
153
+ put_curve(fc, CASE_CURVE, as_obj)
154
+ fc["FanCurves"] = [c for c in fc["FanCurves"] if c.get("Name") in
155
+ (CPU_CURVE["Name"], CASE_CURVE["Name"])]
156
+ bind(fc, CPU_FAN, CPU_CURVE["Name"])
157
+ bind(fc, INTAKE, CASE_CURVE["Name"])
158
+ bind(fc, EXHAUST, CASE_CURVE["Name"])
159
+ save(d, "curves")
160
+
161
+ elif mode == "restore":
162
+ for c in fc["FanCurves"]:
163
+ c["SelectedTempSensor"] = None
164
+ fc["FanCurves"] = [c for c in fc["FanCurves"] if c.get("Name") == "固定值"]
165
+ if not fc["FanCurves"]:
166
+ fc["FanCurves"] = [{"Name": "固定值", "IsHidden": False,
167
+ "CommandMode": 0, "Percent": 40}]
168
+ for c in fc["Controls"]:
169
+ c["ManualControl"] = True
170
+ c["SelectedFanCurve"] = None
171
+ for tid, val, en in ((CPU_FAN, 30, True), (INTAKE, 30, True),
172
+ (EXHAUST, 30, True), (GPU_CTL, 15, True)):
173
+ for c in fc["Controls"]:
174
+ if c.get("Identifier") == tid:
175
+ c["ManualControlValue"] = val
176
+ c["Enable"] = en
177
+ save(d, "restore")
178
+
179
+ elif mode == "gpu":
180
+ arg = sys.argv[2] if len(sys.argv) > 2 else "manual15"
181
+ for c in fc["Controls"]:
182
+ if c.get("Identifier") == GPU_CTL:
183
+ if arg == "off":
184
+ c["Enable"] = False # 交给驱动自己管
185
+ else:
186
+ c["Enable"] = True
187
+ c["SelectedFanCurve"] = None
188
+ c["ManualControl"] = True
189
+ c["ManualControlValue"] = 15 if arg == "manual15" else 35
190
+ save(d, "gpu-" + arg)
191
+
192
+
193
+ elif mode == "probe":
194
+ # 为 0..5 每个温度通道建一条同样的曲线,界面上会显示各自读数 -> 用来确定通道含义
195
+ fc["FanCurves"] = []
196
+ for i in range(6):
197
+ fc["FanCurves"].append({
198
+ "Name": "T%d" % i,
199
+ "IsHidden": False,
200
+ "CommandMode": 1,
201
+ "SelectedTempSensor": "/lpc/nct6797d/temperature/%d" % i,
202
+ "MinimumPercent": 25,
203
+ "MaximumPercent": 100,
204
+ "Points": [[40, 30], [60, 45], [75, 70], [85, 100]],
205
+ })
206
+ for c in fc["Controls"]:
207
+ c["ManualControl"] = True
208
+ c["SelectedFanCurve"] = None
209
+ for tid, val in ((CPU_FAN, 30), (INTAKE, 30), (EXHAUST, 30), (GPU_CTL, 15)):
210
+ for c in fc["Controls"]:
211
+ if c.get("Identifier") == tid:
212
+ c["ManualControlValue"] = val
213
+ c["Enable"] = True
214
+ save(d, "probe")
215
+
216
+
217
+ elif mode == "probe2":
218
+ ids = ["/amdcpu/0/temperature/%d" % i for i in range(6)] + ["/lpc/nct6797d/temperature/%d" % i for i in range(7)]
219
+ fc["FanCurves"] = []
220
+ for i, ident in enumerate(ids):
221
+ fc["FanCurves"].append({
222
+ "Name": "C%02d" % i,
223
+ "IsHidden": False,
224
+ "CommandMode": 1,
225
+ "SelectedTempSensor": ident,
226
+ "MinimumPercent": 25,
227
+ "MaximumPercent": 100,
228
+ "Points": ["40,30", "60,45", "75,70", "85,100"],
229
+ })
230
+ for c in fc["Controls"]:
231
+ c["ManualControl"] = True
232
+ c["SelectedFanCurve"] = None
233
+ save(d, "probe2")
234
+ print(" probe2 curves:", len(fc["FanCurves"]))
235
+
236
+
237
+ elif mode == "probe3":
238
+ fields = ["SelectedTempSensor", "SelectedSensor", "SelectedTempSource", "SensorIdentifier", "SelectedSensorIdentifier"]
239
+ ident = "/amdcpu/0/temperature/2"
240
+ base = {
241
+ "IsHidden": False,
242
+ "CommandMode": 1,
243
+ "MinimumPercent": 25,
244
+ "MaximumPercent": 100,
245
+ "Points": ["40,30", "60,45", "75,70", "85,100"],
246
+ }
247
+ fc["FanCurves"] = []
248
+ for i, f in enumerate(fields):
249
+ cur = {"Name": "F%d" % (i + 1), f: ident}
250
+ cur.update(base)
251
+ fc["FanCurves"].append(cur)
252
+ for c in fc["Controls"]:
253
+ c["ManualControl"] = True
254
+ c["SelectedFanCurve"] = None
255
+ save(d, "probe3")
256
+ print(" probe3 fields:", fields)
257
+
258
+
259
+ elif mode == "probe4":
260
+ ids = ["/amdcpu/0/temperature/2", "/amdcpu/0/temperature/0", "/lpc/nct6797d/temperature/3"]
261
+ base = {
262
+ "IsHidden": False,
263
+ "CommandMode": 1,
264
+ "MinimumPercent": 25,
265
+ "MaximumPercent": 100,
266
+ "Points": ["40,30", "60,45", "75,70", "85,100"],
267
+ }
268
+ fc["FanCurves"] = []
269
+ for i, ident in enumerate(ids):
270
+ cur = {"Name": "P%d" % (i + 1), "SelectedTempSource": {"Identifier": ident}}
271
+ cur.update(base)
272
+ fc["FanCurves"].append(cur)
273
+ for c in fc["Controls"]:
274
+ c["ManualControl"] = True
275
+ c["SelectedFanCurve"] = None
276
+ save(d, "probe4")
277
+ print(" probe4 ids:", ids)
278
+
279
+
280
+ elif mode == "probe5":
281
+ base = {
282
+ "IsHidden": False,
283
+ "CommandMode": 1,
284
+ "MinimumPercent": 25,
285
+ "MaximumPercent": 100,
286
+ "Points": ["40,30", "60,45", "75,70", "85,100"],
287
+ }
288
+ fc["FanCurves"] = []
289
+ for i in range(8):
290
+ cur = {"Name": "A%d" % i, "SelectedTempSource": {"Identifier": "/amdcpu/0/temperature/%d" % i}}
291
+ cur.update(base)
292
+ fc["FanCurves"].append(cur)
293
+ for i in range(7):
294
+ cur = {"Name": "B%d" % i, "SelectedTempSource": {"Identifier": "/lpc/nct6797d/temperature/%d" % i}}
295
+ cur.update(base)
296
+ fc["FanCurves"].append(cur)
297
+ for c in fc["Controls"]:
298
+ c["ManualControl"] = True
299
+ c["SelectedFanCurve"] = None
300
+ save(d, "probe5")
301
+ print(" probe5 curves: 8 amd + 7 lpc")
302
+
303
+
304
+ elif mode == "final":
305
+ CPU_TEMP = "/amdcpu/0/temperature/2" # Core (Tctl/Tdie)
306
+ CASE_TEMP = "/lpc/nct6797d/temperature/3" # VRM MOS
307
+ fc["FanCurves"] = [
308
+ {
309
+ "Name": "CPU 温度曲线",
310
+ "IsHidden": False,
311
+ "CommandMode": 1,
312
+ "SelectedTempSource": {"Identifier": CPU_TEMP},
313
+ "MinimumPercent": 25,
314
+ "MaximumPercent": 100,
315
+ "Points": ["50,30", "62,42", "72,58", "80,78", "88,100"],
316
+ },
317
+ {
318
+ "Name": "机箱 温度曲线",
319
+ "IsHidden": False,
320
+ "CommandMode": 1,
321
+ "SelectedTempSource": {"Identifier": CASE_TEMP},
322
+ "MinimumPercent": 25,
323
+ "MaximumPercent": 100,
324
+ "Points": ["44,30", "54,40", "64,60", "72,85", "80,100"],
325
+ },
326
+ ]
327
+ bind = {
328
+ "/lpc/nct6797d/control/1": "CPU 温度曲线",
329
+ "/lpc/nct6797d/control/2": "机箱 温度曲线",
330
+ "/lpc/nct6797d/control/3": "机箱 温度曲线",
331
+ "/lpc/nct6797d/control/4": "机箱 温度曲线",
332
+ "/lpc/nct6797d/control/5": "机箱 温度曲线",
333
+ }
334
+ for c in fc["Controls"]:
335
+ ident = c.get("Identifier")
336
+ if ident in bind:
337
+ c["SelectedFanCurve"] = bind[ident]
338
+ c["ManualControl"] = False
339
+ else:
340
+ c["SelectedFanCurve"] = None
341
+ c["ManualControl"] = True
342
+ save(d, "final")
343
+ print(" final: CPU curve ->", CPU_TEMP, "; case curve ->", CASE_TEMP)
344
+
345
+ elif mode == "swap-sensor":
346
+ idx = sys.argv[2]
347
+ for c in fc["FanCurves"]:
348
+ if c.get("Name") == CPU_CURVE["Name"]:
349
+ c["SelectedTempSensor"] = "/lpc/nct6797d/temperature/%s" % idx
350
+ save(d, "sensor-" + idx)
351
+
352
+ else:
353
+ print("unknown mode", mode)
354
+ return
355
+ show(d)
356
+
357
+
358
+ if __name__ == "__main__":
359
+ main()
@@ -0,0 +1,39 @@
1
+ @echo off
2
+ REM ============================================================================
3
+ REM One-click repair: FanControl autostart + QQ boot/sleep tasks + ISLC
4
+ REM 2026-12-01 rewritten (the old file was 283 bytes of NUL and did nothing).
5
+ REM Needs Administrator: it will re-launch itself elevated (UAC).
6
+ REM Log: F:\qqbot\logs\fan-tasks-repair.log
7
+ REM ============================================================================
8
+ setlocal
9
+ set "LOG=F:\qqbot\logs\fan-tasks-repair.log"
10
+
11
+ net session >nul 2>&1
12
+ if not "%errorlevel%"=="0" (
13
+ echo Requesting administrator privileges...
14
+ powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
15
+ exit /b 0
16
+ )
17
+
18
+ echo ==== start %DATE% %TIME% ==== >> "%LOG%"
19
+
20
+ echo [1] register FanControlQuiet / ISLC / QQ tasks >> "%LOG%"
21
+ powershell -NoProfile -ExecutionPolicy Bypass -File "F:\qqbot\scripts\fix_admin_tasks.ps1" >> "%LOG%" 2>&1
22
+
23
+ echo [2] restore fan curve (GPU only) >> "%LOG%"
24
+ if exist "E:\Anaconda\envs\ai25\python.exe" (
25
+ "E:\Anaconda\envs\ai25\python.exe" "F:\qqbot\scripts\fan_restore_manual.py" >> "%LOG%" 2>&1
26
+ ) else (
27
+ echo skip: E:\Anaconda\envs\ai25\python.exe not found >> "%LOG%"
28
+ )
29
+
30
+ echo [3] make sure FanControl is running >> "%LOG%"
31
+ powershell -NoProfile -ExecutionPolicy Bypass -Command "if (-not (Get-Process FanControl -ErrorAction SilentlyContinue)) { Start-Process 'C:\Program Files (x86)\FanControl\FanControl.exe' -WindowStyle Hidden }" >> "%LOG%" 2>&1
32
+
33
+ echo [4] verify >> "%LOG%"
34
+ powershell -NoProfile -Command "foreach($n in @('QQBootWake','FanControlQuiet','ISLCWatcher','ISLCResident')){ $t=Get-ScheduledTask -TaskName $n -ErrorAction SilentlyContinue; if($t){ $n+' = '+$t.State } else { $n+' = MISSING' } }" >> "%LOG%" 2>&1
35
+
36
+ echo ==== end %DATE% %TIME% ==== >> "%LOG%"
37
+ echo Done. Log: %LOG%
38
+ timeout /t 6 >nul
39
+ endlocal
@@ -0,0 +1,94 @@
1
+ # -*- coding: utf-8 -*-
2
+ """管理员侧修复脚本(需提权):
3
+ 1) FanControl 配置 —— 只接管 GPU 风扇,其余全部交回 BIOS;结构合法(SelectedFanCurve=null)
4
+ 2) ISLC 配置 —— 常驻、最小化、待机列表/空闲内存阈值自动清理
5
+ 不改任何别的文件。
6
+ """
7
+ import io, json, os, shutil, subprocess, time, datetime
8
+
9
+ FC_DIR = r"C:\Program Files (x86)\FanControl\Configurations"
10
+ FC = os.path.join(FC_DIR, "userConfig.json")
11
+ FC_SRC = os.path.join(FC_DIR, "userConfig.json.bak-gpu45-20261125-225709")
12
+ ISLC = r"F:\ISLC\ISLC v1.0.4.5\config.json"
13
+
14
+ ts = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
15
+ rep = []
16
+
17
+
18
+ def backup(path):
19
+ if os.path.exists(path):
20
+ b = path + ".bak-fixall-" + ts
21
+ shutil.copy2(path, b)
22
+ rep.append("backup " + b)
23
+
24
+
25
+ # ---------- 1. FanControl ----------
26
+ backup(FC)
27
+ src = FC_SRC if os.path.exists(FC_SRC) else FC
28
+ d = json.load(io.open(src, encoding="utf-8"))
29
+ fc = d["FanControl"]
30
+ fc["FanCurves"] = []
31
+ kept = []
32
+ for c in fc.get("Controls", []):
33
+ ident = c.get("Identifier") or ""
34
+ c["SelectedFanCurve"] = None
35
+ if "NVApiWrapper" in ident:
36
+ c["Enable"] = True
37
+ c["ManualControl"] = True
38
+ c["ManualControlValue"] = 20
39
+ c["MinimumPercent"] = 0
40
+ c["MaximumPercent"] = 100
41
+ kept.append("GPU 20%")
42
+ else:
43
+ c["Enable"] = False
44
+ c["ManualControl"] = True
45
+ io.open(FC, "w", encoding="utf-8", newline="\n").write(json.dumps(d, ensure_ascii=False, indent=2))
46
+ rep.append("fan config: only GPU enabled, others -> BIOS; " + ",".join(kept))
47
+
48
+ # ---------- 2. ISLC ----------
49
+ backup(ISLC)
50
+ islc = {
51
+ "StandbyListValue": "4096",
52
+ "FreeMemoryValue": "2048",
53
+ "StartMinimized": True,
54
+ "AlwaysOnTop": False,
55
+ "CustomTimer": False,
56
+ "WantedResolution": 1.0,
57
+ "PollingRateSTR": "5000",
58
+ "ExclusionList": [],
59
+ "DarkMode": False,
60
+ "HotkeyEnabled": False,
61
+ "HotkeyModifiers": 3,
62
+ "HotkeyVKey": 80,
63
+ }
64
+ io.open(ISLC, "w", encoding="utf-8", newline="\n").write(json.dumps(islc, ensure_ascii=False, indent=2))
65
+ rep.append("islc config: standby>4096MB / free<2048MB, poll 5s, minimized")
66
+
67
+ # ---------- 3. restart fancontrol ----------
68
+ subprocess.run(["taskkill", "/IM", "FanControl.exe", "/F"], capture_output=True)
69
+ time.sleep(2)
70
+ exe = r"C:\Program Files (x86)\FanControl\FanControl.exe"
71
+ if os.path.exists(exe):
72
+ subprocess.Popen([exe])
73
+ rep.append("FanControl restarted")
74
+ time.sleep(8)
75
+
76
+ # ---------- 4. start islc ----------
77
+ islc_exe = r"F:\ISLC\ISLC v1.0.4.5\Intelligent standby list cleaner ISLC.exe"
78
+ subprocess.run(["taskkill", "/IM", "Intelligent standby list cleaner ISLC.exe", "/F"], capture_output=True)
79
+ time.sleep(1)
80
+ if os.path.exists(islc_exe):
81
+ subprocess.Popen([islc_exe])
82
+ rep.append("ISLC started")
83
+ time.sleep(3)
84
+
85
+ try:
86
+ out = subprocess.run(["nvidia-smi", "--query-gpu=fan.speed,temperature.gpu,power.draw",
87
+ "--format=csv,noheader"], capture_output=True, text=True).stdout.strip()
88
+ rep.append("gpu: " + out)
89
+ except Exception as e:
90
+ rep.append("nvidia-smi failed " + str(e))
91
+
92
+ line = " | ".join(rep)
93
+ print(line)
94
+ io.open(r"F:\qqbot\logs\fix-all-py.log", "w", encoding="utf-8").write(line + "\n")