@shundoo-ai/dsh-cosmic 1.0.4-alpha.0 → 1.0.4-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shundoo-ai/dsh-cosmic",
3
- "version": "1.0.4-alpha.0",
3
+ "version": "1.0.4-alpha.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  ".config",
@@ -131,7 +131,12 @@ pwsh -File {SKILL_DIR}\scripts\cosmic-hotdeploy.ps1 -Module <模块名> -WhatIf
131
131
  > ⚠️ **别直接用 preset 里的 `{SKILL_DIR}/assets/kd-reloadjar-agent.jar`** —— 先把 agent jar 复制到**机器级缓存**再用(`{AGENT}`,见下)。原因:Attacher 会把这个 jar **载入运行中的 cosmic JVM**,而 JVM 的 classloader 会**长期持有**该文件句柄;preset 一旦升级,包管理器要**整目录替换**(每个文件都得能删/改名)→ 必然在这个 jar 上失败(Windows 报 `os error 32`/拒绝访问)。
132
132
  >
133
133
  > `{AGENT}` = `$DSH_HOME/cache/cosmic/agent/kd-reloadjar-agent-<sha1前8位>.jar`(**带内容哈希命名**,所以新版永远不会覆盖可能已被 JVM 载入的旧副本)。`init-python.{sh,ps1}` 会预先复制;`cosmic-hotdeploy.ps1` 也会自动解析并复制。手工操作时:
134
-
134
+ >
135
+ > **平台差异(重要)**
136
+ > - **Windows:必须**这么做。JVM 持有句柄会**直接让 preset 升级失败**(`os error 32`/拒绝访问),必须重启 cosmic 服务才能解开。
137
+ > - **macOS/Linux:不是必须**。POSIX 允许替换/删除**已被打开**的文件,直接用原件也安全(升级不会失败)。
138
+ > - **但仍然统一用副本**,理由有二:① 两个平台同一条规则,少一处"看平台下菜"的判断题;② 万一漏了复制这一步,在 macOS 上**无害**,在 Windows 上却会重新引入死锁 —— 统一规则对两种平台都安全。
139
+ >
135
140
  ```bash
136
141
  # 先把 preset 里的原件复制到机器级缓存(哈希命名),再用缓存路径
137
142
  AGENT_DIR="${DSH_HOME:-$HOME/.dsh}/cache/cosmic/agent"