@botlearn-course/daemon 0.0.20-beta.9 → 0.0.21-beta.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/README.md +5 -5
- package/dist/agent-service-sandbox.d.ts +9 -2
- package/dist/agent-service-sandbox.js +94 -322
- package/dist/agent-service-ws-protocol.d.ts +1 -1
- package/dist/agent-service-ws-protocol.js +2 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/redaction.js +2 -0
- package/dist/run-dispatcher.js +4 -3
- package/dist/runtime-env.d.ts +1 -1
- package/dist/runtime-env.js +1 -1
- package/dist/runtimes/deepseek-tui-base-prompt.d.ts +4 -0
- package/dist/runtimes/deepseek-tui-base-prompt.js +86 -0
- package/dist/runtimes/deepseek-tui.js +19 -1
- package/dist/runtimes/engine.d.ts +2 -0
- package/dist/runtimes/engine.js +1 -0
- package/dist/sandbox-supervisor.js +1 -1
- package/dist/tool-observation.js +2 -0
- package/dist/workspace-filesystem.d.ts +0 -1
- package/dist/workspace-filesystem.js +0 -10
- package/dist/workspace-snapshot-control.js +0 -25
- package/dist/workspace-snapshot-policy.d.ts +1 -1
- package/dist/workspace-snapshot-policy.js +4 -2
- package/dist/workspace.d.ts +10 -66
- package/dist/workspace.js +44 -594
- package/package.json +1 -1
- package/dist/workspace-materialization.d.ts +0 -16
- package/dist/workspace-materialization.js +0 -136
- package/dist/workspace-quota.d.ts +0 -4
- package/dist/workspace-quota.js +0 -42
- package/dist/workspace-restore.d.ts +0 -42
- package/dist/workspace-restore.js +0 -347
package/README.md
CHANGED
|
@@ -36,22 +36,22 @@ npx --yes --package @botlearn-course/daemon@latest botlearn-course-daemon course
|
|
|
36
36
|
| `course doctor` | 打印 Auth 状态(不含 token)与 runtime 探测表(安装路径 / 版本 / 登录状态 / 安装提示)。 |
|
|
37
37
|
| `--help` / `--version` | 帮助与版本。 |
|
|
38
38
|
|
|
39
|
-
包内还包含供 BotLearn 托管
|
|
39
|
+
包内还包含供 BotLearn 托管 sandbox 使用的内部命令
|
|
40
40
|
`botlearn-sandbox-supervisor agent-service session`。它不是 BYOA 用户入口:生产环境只允许由
|
|
41
|
-
Agent Service 以固定 argv 启动,通过 stdin 接收一次性 bootstrap。
|
|
41
|
+
Agent Service 以固定 argv 启动,通过 stdin 接收一次性 bootstrap。sandbox 中 daemon/runtime 分别
|
|
42
42
|
降权到 `botlearn-control`/`user` UID;继承 `NoNewPrivs=1`、无法使用 sudo 的平台保留 root control
|
|
43
43
|
daemon,由 root-owned 固定 launcher 清空附加组后直接降权为 `user`。两条路径都为 DeepSeek
|
|
44
44
|
设置 `no_new_privs`,runtime 用户本身没有 sudo 权限。托管启动链只执行
|
|
45
|
-
`/opt` 下的固定 Node、supervisor、daemon、launcher 与 DeepSeek 文件,不信任
|
|
45
|
+
`/opt` 下的固定 Node、supervisor、daemon、launcher 与 DeepSeek 文件,不信任 provider 会开放给 runtime
|
|
46
46
|
写入的 `/usr/local/bin`。
|
|
47
47
|
`agent-service session --bootstrap-stdin` 同样属于受 supervisor 保护的内部协议,不应直接暴露给
|
|
48
48
|
课程任务或 workspace shell。
|
|
49
49
|
|
|
50
50
|
veFaaS Origin 的托管 workspace 使用用户级 NAS backing image。root bootstrap 完成 NFS、marker、
|
|
51
|
-
ext4
|
|
51
|
+
ext4、`fuse2fs` mount 和固定 3 GiB 校验后,daemon 才发送 `sandbox.ready`。RuntimeSession 使用稳定路径
|
|
52
52
|
`/workspace/sessions/{runtime_session_id}/workspace`,Sandbox generation 只参与写入隔离。磁盘写满
|
|
53
53
|
统一上报 `workspace_user_quota_exceeded`。pause 和 cleanup 进入 drain 后,daemon 先停止 runtime
|
|
54
|
-
writer,再通过 root launcher 执行 ext4 sync
|
|
54
|
+
writer,再通过 root launcher 执行 ext4 sync、`fuse2fs` unmount、backing image 和 NFS parent fsync;完成后
|
|
55
55
|
才发送 `sandbox.drained` 并退出。
|
|
56
56
|
|
|
57
57
|
## 支持的 runtime
|
|
@@ -3,6 +3,13 @@ import type { WorkspaceScanMeasurement } from "./file-candidates.js";
|
|
|
3
3
|
import { type RuntimeSkillProviderFactory } from "./runtime-skills.js";
|
|
4
4
|
import { type PersistentSessionExecution, type PreparedPersistentTurn, type RunReportingClient } from "./run-dispatcher.js";
|
|
5
5
|
import type { CourseRuntime, CourseRuntimeProfile, RunEvent, RunEventReceipt, RunFileCandidate, RunFileRecord, RunStartPayload } from "./types.js";
|
|
6
|
+
export declare function workspaceDurabilityCapabilities(): string[];
|
|
7
|
+
/**
|
|
8
|
+
* NAS 是运行时 workspace 的唯一持久事实来源,committed snapshot 只供前端查看。
|
|
9
|
+
* 任何 restore payload 都意味着对端仍在下发已删除的 S3 回写指令,必须 fail closed,
|
|
10
|
+
* 否则可能用落后的派生快照覆盖 NAS 中较新的内容。
|
|
11
|
+
*/
|
|
12
|
+
export declare function assertWorkspaceRestoreAllowed(requestedRestore: unknown): void;
|
|
6
13
|
export interface AgentServiceSandboxOptions {
|
|
7
14
|
wsUrl: string;
|
|
8
15
|
sandboxId: string;
|
|
@@ -97,8 +104,8 @@ export declare class AgentServiceSandboxClient implements RunReportingClient, Pe
|
|
|
97
104
|
private handleTurnStart;
|
|
98
105
|
private handleTurnCancel;
|
|
99
106
|
/**
|
|
100
|
-
* 幂等关闭一个 runtime session:终止其 runtime
|
|
101
|
-
*
|
|
107
|
+
* 幂等关闭一个 runtime session:终止其 runtime 子进程并清空 session-local state。
|
|
108
|
+
* Durable Workspace 由独立身份拥有,关闭执行上下文不会删除学员文件。
|
|
102
109
|
*/
|
|
103
110
|
private closeSession;
|
|
104
111
|
private reconcileInterruptedCommand;
|