@botlearn-course/daemon 0.0.28-beta.5 → 0.0.28-beta.7

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/README.md CHANGED
@@ -186,6 +186,14 @@ major、minor 或 prerelease 时才填写精确 SemVer(例如 `1.0.0` 或 `1.1
186
186
 
187
187
  ## 托管 Codewhale 代理凭据
188
188
 
189
+ `deepseek-tui` 流式事件解析同时支持 0.8.39 和 0.9.12,以及既有平铺事件格式。
190
+ 0.9.12 的外层 `kind` 表示事件名;推理类型从内层 `payload.kind` 或
191
+ `payload.item.kind` 读取。推理增量持续推送并按段保存,完成摘要不重复追加正文。
192
+
193
+ 托管启动前为 DeepSeek 0.8 的 `.deepseek` 与 Codewhale 0.9 的 `.codewhale`
194
+ 准备状态目录。目录通过 `1770` 权限允许运行组创建任务状态;临时配置根目录保持
195
+ `0750`,配置文件保持 `0640`。重复初始化保留已有状态,不改写课程进度或工作区文件。
196
+
189
197
  托管 `deepseek-tui` 每轮从 activation 的 `DEEPSEEK_BASE_URL` 生成临时
190
198
  `[providers.deepseek]` 路由,并用 `api_key_env = "DEEPSEEK_API_KEY"` 显式绑定当轮凭据。
191
199
  子进程不再接收 URL 环境覆盖,避免 Codewhale 0.9.12 将其判定为未绑定的新路由。
@@ -47,9 +47,10 @@ export interface MaterializeCourseSkillsOptions {
47
47
  export declare function skillDirectoryName(entry: RuntimeSkillCatalogEntry): string;
48
48
  export declare function skillSetFingerprint(refs: readonly string[]): string;
49
49
  /**
50
- * Prepare the DeepSeek state directory before the server starts.
50
+ * Prepare the supported runtime state directories before the server starts.
51
51
  *
52
- * DeepSeek creates its own task and automation subdirectories below `.deepseek`, so the
52
+ * DeepSeek 0.8 uses `.deepseek`; Codewhale 0.9 uses `.codewhale`. Both create task and
53
+ * automation subdirectories under their state home, so the
53
54
  * runtime group needs write access there. The sticky bit prevents that separate UID from
54
55
  * replacing the control-process-owned `skills` entry.
55
56
  */
@@ -47,17 +47,20 @@ export function skillSetFingerprint(refs) {
47
47
  return [...refs].sort().join(",");
48
48
  }
49
49
  /**
50
- * Prepare the DeepSeek state directory before the server starts.
50
+ * Prepare the supported runtime state directories before the server starts.
51
51
  *
52
- * DeepSeek creates its own task and automation subdirectories below `.deepseek`, so the
52
+ * DeepSeek 0.8 uses `.deepseek`; Codewhale 0.9 uses `.codewhale`. Both create task and
53
+ * automation subdirectories under their state home, so the
53
54
  * runtime group needs write access there. The sticky bit prevents that separate UID from
54
55
  * replacing the control-process-owned `skills` entry.
55
56
  */
56
57
  export function prepareRuntimeSkillsHome(profileRoot, managed) {
57
58
  const deepseekHome = path.join(profileRoot, ".deepseek");
58
59
  const mode = managed ? DEEPSEEK_HOME_MODE_MANAGED : DIR_MODE_PRIVATE;
59
- mkdirSync(deepseekHome, { recursive: true, mode });
60
- chmodSync(deepseekHome, mode);
60
+ for (const stateHome of [deepseekHome, path.join(profileRoot, ".codewhale")]) {
61
+ mkdirSync(stateHome, { recursive: true, mode });
62
+ chmodSync(stateHome, mode);
63
+ }
61
64
  return deepseekHome;
62
65
  }
63
66
  /**
@@ -1366,10 +1366,11 @@ function deepseekItemId(payload) {
1366
1366
  ?? stringField(payload?.payload?.item, "id"));
1367
1367
  }
1368
1368
  function isDeepseekReasoningEvent(eventName, payload) {
1369
- const kind = (stringField(payload, "kind")
1370
- ?? stringField(payload?.item, "kind")
1371
- ?? stringField(payload?.payload, "kind")
1372
- ?? stringField(payload?.payload?.item, "kind"));
1369
+ // Codewhale 0.9.x uses envelope.kind for the event name (e.g. item.delta).
1370
+ // The semantic kind lives inside payload; older flat events carry it directly.
1371
+ const itemPayload = payload?.payload ?? payload;
1372
+ const kind = (stringField(itemPayload, "kind")
1373
+ ?? stringField(itemPayload?.item, "kind"));
1373
1374
  return (kind === "agent_reasoning"
1374
1375
  && (eventName === "item.started" || eventName === "item.delta" || eventName === "item.completed"));
1375
1376
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botlearn-course/daemon",
3
- "version": "0.0.28-beta.5",
3
+ "version": "0.0.28-beta.7",
4
4
  "description": "Lightweight BotLearn Course daemon: run course tasks on your own machine with your own agent runtime (BYOA).",
5
5
  "type": "module",
6
6
  "bin": {