lingshu-skill 5.69.0 → 5.71.0
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 +66 -0
- package/SKILL-lite.md +1 -1
- package/SKILL-tiny.md +1 -1
- package/SKILL.md +1 -1
- package/cordis-plugin/lingshu-cron/plugin.js +36 -14
- package/cordis-plugin/lingshu-im/plugin.js +67 -15
- package/manifest.json +43 -43
- package/package.json +1 -1
- package/scripts/assembler.py +8 -2
- package/scripts/astrbot_plugin_lingshu/CHECKSUMS.json +90 -18
- package/scripts/astrbot_plugin_lingshu/engine/CHANGELOG.md +66 -0
- package/scripts/astrbot_plugin_lingshu/engine/SKILL-lite.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL-tiny.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/scripts/assembler.py +8 -2
- package/scripts/astrbot_plugin_lingshu/engine/scripts/checkpoint.py +13 -2
- package/scripts/astrbot_plugin_lingshu/engine/scripts/desktop_shortcut.py +10 -1
- package/scripts/astrbot_plugin_lingshu/engine/scripts/dream.py +45 -0
- package/scripts/astrbot_plugin_lingshu/engine/scripts/emotion.py +13 -2
- package/scripts/astrbot_plugin_lingshu/engine/scripts/growth.py +5629 -5575
- package/scripts/astrbot_plugin_lingshu/engine/scripts/growth_parts.py +5 -1
- package/scripts/astrbot_plugin_lingshu/engine/scripts/memory.py +62 -6
- package/scripts/astrbot_plugin_lingshu/engine/scripts/panel_cloud.py +47 -1
- package/scripts/astrbot_plugin_lingshu/engine/scripts/panel_server.py +12 -2
- package/scripts/astrbot_plugin_lingshu/engine/scripts/persona.py +10 -4
- package/scripts/astrbot_plugin_lingshu/engine/scripts/safety.py +6 -1
- package/scripts/astrbot_plugin_lingshu/engine/scripts/session_import.py +6 -2
- package/scripts/astrbot_plugin_lingshu/engine/scripts/session_rag.py +68 -21
- package/scripts/astrbot_plugin_lingshu/make_checksums.py +8 -4
- package/scripts/checkpoint.py +13 -2
- package/scripts/desktop_shortcut.py +10 -1
- package/scripts/dream.py +45 -0
- package/scripts/emotion.py +13 -2
- package/scripts/growth.py +5629 -5575
- package/scripts/growth_parts.py +5 -1
- package/scripts/memory.py +62 -6
- package/scripts/panel_cloud.py +47 -1
- package/scripts/panel_server.py +12 -2
- package/scripts/persona.py +10 -4
- package/scripts/run_tests.py +240 -171
- package/scripts/safety.py +6 -1
- package/scripts/session_import.py +6 -2
- package/scripts/session_rag.py +68 -21
- package/scripts/update_dsh_copy.ps1 +42 -6
|
@@ -26,11 +26,19 @@ $src = Split-Path -Parent $PSScriptRoot # 仓库根目录(本脚本
|
|
|
26
26
|
$profilesRoot = Join-Path $env:USERPROFILE ".dsh\profiles"
|
|
27
27
|
|
|
28
28
|
function Get-CopyVersion($dir) {
|
|
29
|
+
# LS-139(v5.70):坏 package.json 必须失败而非返回 "?"!
|
|
30
|
+
# 旧实现 catch 一切返回 "?"——解析错误被当成"没版本",脚本继续跑、最终报成功,
|
|
31
|
+
# 但副本里的 package.json 已经损坏,DSH 加载必崩。
|
|
29
32
|
try {
|
|
30
33
|
$pkg = Get-Content -LiteralPath (Join-Path $dir "package.json") -Raw -Encoding UTF8 | ConvertFrom-Json
|
|
31
|
-
|
|
34
|
+
$v = [string]$pkg.version
|
|
35
|
+
if (-not $v) { throw "package.json 无 version 字段" }
|
|
36
|
+
return $v
|
|
32
37
|
} catch {
|
|
33
|
-
|
|
38
|
+
if (-not (Test-Path -LiteralPath (Join-Path $dir "package.json"))) {
|
|
39
|
+
return ""
|
|
40
|
+
}
|
|
41
|
+
throw "目标副本 package.json 解析失败(副本已损坏,拒绝在其上继续操作):$($_.Exception.Message)"
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
44
|
|
|
@@ -70,11 +78,27 @@ if ($files.Count -eq 0) {
|
|
|
70
78
|
}
|
|
71
79
|
|
|
72
80
|
# 3) 逐文件复制(不删除目标里多出来的旧文件,避免误删用户自装的东西)
|
|
81
|
+
# LS-140(v5.70):PowerShell 热同步具备事务与回滚!
|
|
82
|
+
# 旧实现直接 Copy-Item 覆盖——中途失败留下"一半新一半旧"的混合副本。
|
|
83
|
+
# 现在:先整目录备份,失败时整体回滚,绝不留混合树。
|
|
73
84
|
$hadFailure = $false
|
|
74
85
|
foreach ($dst in $targets) {
|
|
75
86
|
$before = Get-CopyVersion $dst
|
|
87
|
+
if (-not $before) {
|
|
88
|
+
Write-Host ("[跳过] {0}:副本尚未安装(package.json 不存在)" -f $dst) -ForegroundColor Yellow
|
|
89
|
+
continue
|
|
90
|
+
}
|
|
76
91
|
$copied = 0
|
|
77
92
|
$failed = @()
|
|
93
|
+
# —— 备份目标(事务回滚的退路)——
|
|
94
|
+
$backup = "$dst.bak-$(Get-Date -Format yyyyMMddHHmmss)"
|
|
95
|
+
try {
|
|
96
|
+
Copy-Item -LiteralPath $dst -Destination $backup -Recurse -Force
|
|
97
|
+
} catch {
|
|
98
|
+
Write-Host ("[错误] 无法备份目标副本 {0},拒绝在其上继续复制:{1}" -f $dst, $_.Exception.Message) -ForegroundColor Red
|
|
99
|
+
exit 1
|
|
100
|
+
}
|
|
101
|
+
$allOk = $true
|
|
78
102
|
foreach ($rel in $files) {
|
|
79
103
|
$relWin = $rel -replace '/', '\'
|
|
80
104
|
$s = Join-Path $src $relWin
|
|
@@ -89,16 +113,28 @@ foreach ($dst in $targets) {
|
|
|
89
113
|
$copied++
|
|
90
114
|
} catch {
|
|
91
115
|
$failed += ("{0} —— {1}" -f $rel, $_.Exception.Message)
|
|
116
|
+
$allOk = $false
|
|
92
117
|
}
|
|
93
118
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
119
|
+
if (-not $allOk) {
|
|
120
|
+
# LS-140:回滚——删除部分更新的副本,从备份恢复原状
|
|
121
|
+
Write-Host ("[回滚] {0}:复制失败,恢复备份状态" -f $dst) -ForegroundColor Yellow
|
|
122
|
+
try {
|
|
123
|
+
Remove-Item -LiteralPath $dst -Recurse -Force
|
|
124
|
+
Rename-Item -LiteralPath $backup -NewName (Split-Path -Leaf $dst)
|
|
125
|
+
} catch {
|
|
126
|
+
Write-Host ("[严重] 回滚失败!副本 {0} 处于混合状态,请手动从备份 {1} 恢复" -f $dst, $backup) -ForegroundColor Red
|
|
127
|
+
}
|
|
98
128
|
$hadFailure = $true
|
|
99
129
|
Write-Host (" 失败 {0} 个(多半是 DSH 正在占用文件,完全退出 DSH 后重跑):" -f $failed.Count) -ForegroundColor Yellow
|
|
100
130
|
$failed | Select-Object -First 5 | ForEach-Object { Write-Host (" - {0}" -f $_) -ForegroundColor Yellow }
|
|
131
|
+
continue
|
|
101
132
|
}
|
|
133
|
+
# 成功:清理备份
|
|
134
|
+
try { Remove-Item -LiteralPath $backup -Recurse -Force } catch {}
|
|
135
|
+
$after = Get-CopyVersion $dst
|
|
136
|
+
Write-Host ("[同步] {0}" -f $dst)
|
|
137
|
+
Write-Host (" 版本 {0} -> {1},复制 {2}/{3} 个文件" -f $before, $after, $copied, $files.Count) -ForegroundColor Green
|
|
102
138
|
}
|
|
103
139
|
|
|
104
140
|
if ($hadFailure) { exit 1 }
|