dsh-a2a-server 0.3.0 → 0.4.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 +39 -28
- package/CHANGELOG.zh-CN.md +39 -28
- package/README.md +36 -16
- package/README.zh-CN.md +36 -13
- package/docker/Dockerfile +5 -0
- package/docs/visitor-isolation.en.md +51 -0
- package/docs/visitor-isolation.md +75 -0
- package/lib/config.d.ts +8 -4
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +4 -0
- package/lib/config.js.map +1 -1
- package/lib/docker-executor.d.ts +11 -0
- package/lib/docker-executor.d.ts.map +1 -0
- package/lib/docker-executor.js +115 -0
- package/lib/docker-executor.js.map +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +55 -12
- package/lib/index.js.map +1 -1
- package/lib/isolation.d.ts +21 -0
- package/lib/isolation.d.ts.map +1 -0
- package/lib/isolation.js +108 -0
- package/lib/isolation.js.map +1 -0
- package/lib/management.d.ts.map +1 -1
- package/lib/management.js +2 -1
- package/lib/management.js.map +1 -1
- package/lib/microsandbox-executor.d.ts +39 -0
- package/lib/microsandbox-executor.d.ts.map +1 -0
- package/lib/microsandbox-executor.js +316 -0
- package/lib/microsandbox-executor.js.map +1 -0
- package/lib/microsandbox-runtime.d.ts +28 -0
- package/lib/microsandbox-runtime.d.ts.map +1 -0
- package/lib/microsandbox-runtime.js +164 -0
- package/lib/microsandbox-runtime.js.map +1 -0
- package/lib/router.d.ts +2 -0
- package/lib/router.d.ts.map +1 -1
- package/lib/router.js +13 -2
- package/lib/router.js.map +1 -1
- package/lib/sandbox-files.d.ts +16 -0
- package/lib/sandbox-files.d.ts.map +1 -0
- package/lib/sandbox-files.js +168 -0
- package/lib/sandbox-files.js.map +1 -0
- package/lib/sandbox-lifecycle.d.ts +48 -0
- package/lib/sandbox-lifecycle.d.ts.map +1 -0
- package/lib/sandbox-lifecycle.js +125 -0
- package/lib/sandbox-lifecycle.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/visitor-read.d.ts +4 -0
- package/lib/visitor-read.d.ts.map +1 -0
- package/lib/visitor-read.js +20 -0
- package/lib/visitor-read.js.map +1 -0
- package/lib/visitor-worker.d.ts +2 -0
- package/lib/visitor-worker.d.ts.map +1 -0
- package/lib/visitor-worker.js +18 -0
- package/lib/visitor-worker.js.map +1 -0
- package/lib/visitor-worker.mjs +14686 -0
- package/lib/visitor-worker.py +78 -0
- package/package.json +12 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
[English](CHANGELOG.md) · [简体中文](CHANGELOG.zh-CN.md)
|
|
4
|
-
|
|
5
|
-
## 0.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
[English](CHANGELOG.md) · [简体中文](CHANGELOG.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
## 0.4.0 (2026-11-04)
|
|
6
|
+
|
|
7
|
+
- Exclude nested `node_modules` from Microsandbox public projections without following dependency links or changing host projects. Other links, private imports and Docker mounts remain strictly checked.
|
|
8
|
+
|
|
9
|
+
- Add owner-only local IPC `prepare-stop` to drain tasks and persist guest disks before Portal/CLI terminates the backend. Real-model Relay testing exposed lost recent writes when Windows terminated the process tree without this step.
|
|
10
|
+
|
|
11
|
+
- Add automatically prepared Microsandbox 0.7.11 execution: one VM per authenticated visitor, read-only public projections and independent persistent private disks.
|
|
12
|
+
- Pause after 30 idle seconds and stop after 10 idle minutes; serialize visitor tools, bound resident VMs, preserve files on stop/restart and recover abandoned instances.
|
|
13
|
+
- Keep conversations and credentials outside guest mounts. Migrate old private files outside public roots; reject links and unsafe directory layouts. Only read_file remains exposed to visitors.
|
|
14
|
+
- Verify native Python mutation boundaries, lifecycle, restart persistence, automatic preparation and Portal startup progress. See [isolation guide](docs/visitor-isolation.en.md).
|
|
15
|
+
|
|
16
|
+
## 0.3.0
|
|
17
|
+
|
|
18
|
+
Requires DeepSeek Harness `>=0.2.1-rc.2 <0.3.0` and speaks A2A 1.0 JSON-RPC.
|
|
19
|
+
|
|
20
|
+
- Restrict visitors to chat and `read_file` within the owner's selected data directory. Block path escapes, links, private plugin state and other tools; separate public prompt context from the owner's runtime context.
|
|
21
|
+
- Move owner RPC and monitoring to authenticated local IPC. Public HTTP accepts visitor credentials only. An empty `trustedPeers` list denies all visitors.
|
|
22
|
+
- Bound concurrent tasks, daily admission, execution time, model calls, outputs and stream buffers. Prevent concurrent tasks in one context from mixing answers; clean up disconnected SSE subscriptions.
|
|
23
|
+
- Persist task results and idle conversation history across eviction and restart within the retention window. Fail interrupted work without replaying it.
|
|
24
|
+
- Add the optional Portal-configured automatic briefing loop: default-on hourly updates, a persistent switch, restart-safe timing, and direct publication to `.hop/handoff.md`.
|
|
25
|
+
- Declare required runtime packages and verify imports without development dependencies. Preserve the guard against malformed Unicode from upstream streaming decoders.
|
|
26
|
+
|
|
27
|
+
Validation: 217 tests in 15 files, TypeScript checking, build and declared-runtime package import check. Models are deterministic test adapters; real-model and cross-network deployment verification remain separate.
|
|
28
|
+
|
|
29
|
+
### Upgrade
|
|
30
|
+
|
|
31
|
+
Stop the agent, update dsh if needed, then install into the existing profile:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
dsh plugin --profile YOUR_PROFILE add dsh-a2a-server@0.3.0
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Replace `YOUR_PROFILE` with the saved profile name and restart the agent. Upgrade the companion [Talk2MyAgent Portal](https://github.com/huangjuhua-aigc/Talk2MyAgent) for the private management endpoint and automatic briefing settings. Do not recreate an existing profile with `--from-default-profile` during an upgrade.
|
|
38
|
+
|
|
39
|
+
Old HTTP owner/monitoring integrations must migrate to local IPC. Review visitor admission and the selected data directory before exposing the service. [Migration details](https://github.com/huangjuhua-aigc/dsh-a2a/blob/main/docs/public-access-hardening.en.md).
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
|
-
# 更新日志
|
|
2
|
-
|
|
3
|
-
[English](CHANGELOG.md) · [简体中文](CHANGELOG.zh-CN.md)
|
|
4
|
-
|
|
5
|
-
## 0.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
# 更新日志
|
|
2
|
+
|
|
3
|
+
[English](CHANGELOG.md) · [简体中文](CHANGELOG.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
## 0.4.0(2026-11-04)
|
|
6
|
+
|
|
7
|
+
- Microsandbox 公共资料副本排除各层级的 `node_modules`,不跟随依赖链接,也不修改宿主项目。其他链接、私有文件导入和 Docker 挂载仍保持严格检查。
|
|
8
|
+
|
|
9
|
+
- 增加仅本机主人可用的 `prepare-stop`,收尾任务并停止沙箱、保留磁盘后,Portal/CLI 才结束后端。真实模型中继测试发现,Windows 直接结束进程树会丢失尚未写盘的近期文件,现已修复正常停止流程。
|
|
10
|
+
|
|
11
|
+
- 自动准备 Microsandbox 0.7.11;每位已认证访客独立 VM,公共资料副本只读、私有磁盘可读写并持久保存。
|
|
12
|
+
- 工具完成后空闲 30 秒暂停、10 分钟停止;同访客工具串行,限制驻留数量,停止/重启保留文件,并回收遗留实例。
|
|
13
|
+
- 聊天记录和凭据不挂入沙箱;旧私有文件迁出公共目录,拒绝链接及不安全目录结构。访客仍只开放 read_file。
|
|
14
|
+
- 增加真实 Python 隔离、生命周期、重启持久化、自动准备与 Portal 启动进度测试,详见[隔离指南](docs/visitor-isolation.md)。
|
|
15
|
+
|
|
16
|
+
## 0.3.0
|
|
17
|
+
|
|
18
|
+
要求 DeepSeek Harness `>=0.2.1-rc.2 <0.3.0`,使用 A2A 1.0 JSON-RPC。
|
|
19
|
+
|
|
20
|
+
- 访客可以聊天,并通过 `read_file` 读取主人指定的资料目录。拦截路径越界、链接、插件私有状态及其他工具;公共模型提示与主人运行时上下文分离。
|
|
21
|
+
- 主人 RPC 和监控迁到需要认证的本机 IPC;公网 HTTP 仅接受访客凭据。空白名单 `trustedPeers: []` 拒绝全部访客。
|
|
22
|
+
- 限制并发、每日任务数、执行时限、模型调用、输出和流缓冲;同一 context 的并发请求不会串答,SSE 断开后释放订阅。
|
|
23
|
+
- 在保留期内持久化任务结果与空闲对话,支持驱逐和重启后的恢复。重启中断的任务标记失败,不自动重放。
|
|
24
|
+
- 增加由 Portal 配置的自动简报循环:默认每小时更新、一个持久化开关、重启去重,完成后直接写入 `.hop/handoff.md`。
|
|
25
|
+
- 补齐运行依赖声明,验证脱离开发依赖后可导入。保留上游流式解码异常的 Unicode 防护。
|
|
26
|
+
|
|
27
|
+
验证:15 个文件共 217 项测试、类型检查、构建和仅使用声明运行依赖的包导入检查。测试使用确定性模型;真实模型与跨网络部署需要单独验收。
|
|
28
|
+
|
|
29
|
+
### 升级
|
|
30
|
+
|
|
31
|
+
停止 agent,必要时升级 dsh,然后更新原有 profile 中的插件:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
dsh plugin --profile YOUR_PROFILE add dsh-a2a-server@0.3.0
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
将 `YOUR_PROFILE` 替换为已保存的 profile 名称,安装后重新启动。配套 [Talk2MyAgent Portal](https://github.com/huangjuhua-aigc/Talk2MyAgent) 也需要更新,以使用私有管理入口和自动简报开关。升级已有 profile 时不要再次使用 `--from-default-profile`。
|
|
38
|
+
|
|
39
|
+
原来的 HTTP 主人/监控调用必须迁移至本机 IPC。部署前检查访客许可与资料目录,详见[迁移指南](https://github.com/huangjuhua-aigc/dsh-a2a/blob/main/docs/public-access-hardening.md)。
|
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ for visitor permissions, automatic briefings, private owner access and Tailscale
|
|
|
38
38
|
## Install
|
|
39
39
|
|
|
40
40
|
```sh
|
|
41
|
-
dsh plugin --profile web add dsh-a2a-server@0.
|
|
41
|
+
dsh plugin --profile web add dsh-a2a-server@0.4.0
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
`dsh plugin` forwards to pnpm inside the profile directory and appends this
|
|
@@ -65,10 +65,10 @@ ships in `dsh-web-app` rather than `dsh-base`, so a `headless` profile needs
|
|
|
65
65
|
`@deepseek-ai/dsh-host-webserver` mounted before this bundle serves anything.
|
|
66
66
|
`dsh --profile <name> --dump-config` prints the composed rows.
|
|
67
67
|
|
|
68
|
-
### Upgrading
|
|
68
|
+
### Upgrading to 0.4.0
|
|
69
69
|
|
|
70
|
-
Version 0.
|
|
71
|
-
`dsh-a2a-server@0.
|
|
70
|
+
Version 0.4.0 requires DSH `>=0.2.1-rc.2 <0.3.0`. Stop the agent, install
|
|
71
|
+
`dsh-a2a-server@0.4.0` into its existing profile, then restart it. Owner RPC and
|
|
72
72
|
monitoring now use authenticated local IPC; update the companion Portal as well.
|
|
73
73
|
Visitors retain chat and scoped workspace reads, while other tools are denied.
|
|
74
74
|
An empty `trustedPeers: []` denies all visitors. Task results persist across
|
|
@@ -77,7 +77,7 @@ restart within the configured retention window.
|
|
|
77
77
|
The current [Talk2MyAgent Portal](https://github.com/huangjuhua-aigc/Talk2MyAgent)
|
|
78
78
|
configures default-on hourly briefings with one persistent switch. The plugin
|
|
79
79
|
alone does not enable automatic briefing without its `briefing` configuration.
|
|
80
|
-
See the [0.
|
|
80
|
+
Portal automatically prepares Microsandbox for per-visitor isolation. Public data is copied read-only, excluding `node_modules`; private files persist on independent visitor disks. Idle VMs pause after 30 seconds and stop after 10 minutes. Existing standalone configurations keep their selected execution mode; installing the plugin alone does not enable a VM. See the [sandbox guide](docs/visitor-isolation.en.md) and [0.4.0 release notes](https://github.com/huangjuhua-aigc/dsh-a2a/blob/main/CHANGELOG.md).
|
|
81
81
|
|
|
82
82
|
## Quick start
|
|
83
83
|
|
|
@@ -125,7 +125,7 @@ curl -s http://127.0.0.1:9922/a2a \
|
|
|
125
125
|
| `A2A_PEERS` | `alice` | `name[:token]` list; a token is required for each |
|
|
126
126
|
| `A2A_PORT` | `9900` | Listening port |
|
|
127
127
|
| `A2A_SEND_MODE` | `block` | `block` or `immediate` |
|
|
128
|
-
| `A2A_WORKSPACE_ROOT` | temp dir |
|
|
128
|
+
| `A2A_WORKSPACE_ROOT` | temp dir | Shared public data; visitor workspaces live outside this root |
|
|
129
129
|
| `DEEPSEEK_MODEL` | `deepseek-v4-flash` | Model id requested from the adapter |
|
|
130
130
|
|
|
131
131
|
A one-shot probe runs 67 checks against a live server and exits non-zero on any
|
|
@@ -144,6 +144,7 @@ node example/probe.mjs http://127.0.0.1:9922 demo123
|
|
|
144
144
|
| `/.well-known/agent.json` | GET | Public by default |
|
|
145
145
|
| `{basePath}` (default `/a2a`) | POST | Bearer required |
|
|
146
146
|
| `{basePath}/admin/contexts[/<id>]` | GET | Local IPC only + admin token; never registered on public HTTP |
|
|
147
|
+
| `{basePath}/admin/prepare-stop` | POST | Local IPC + admin token; drain tasks and stop sandboxes before terminating DSH |
|
|
147
148
|
|
|
148
149
|
| JSON-RPC method | Status |
|
|
149
150
|
| --- | --- |
|
|
@@ -266,9 +267,11 @@ another peer answers exactly as an absent one.
|
|
|
266
267
|
| `storage.directory` | `~/.dsh-a2a/<deployment-key>` | Private checkpoints; one process per directory |
|
|
267
268
|
| `storage.retentionMs` / `storage.maxContexts` | `86400000` / `256` | Retention after last activity, and maximum stored contexts |
|
|
268
269
|
| `storage.maxContextBytes` | `4000000` | Maximum checkpoint bytes per context |
|
|
269
|
-
| `isolation.workspaceMode` | `per-peer` |
|
|
270
|
-
| `isolation.workspaceRoot` | — | Required;
|
|
271
|
-
| `isolation.peerWorkspaces` | `{}` |
|
|
270
|
+
| `isolation.workspaceMode` | `per-peer` | Legacy migration field; visitors now have an external private cwd |
|
|
271
|
+
| `isolation.workspaceRoot` | — | Required; shared public read-only data root |
|
|
272
|
+
| `isolation.peerWorkspaces` | `{}` | Legacy per-identity read-root override |
|
|
273
|
+
| `isolation.privateRoot` | deployment-specific home directory | Private workspace parent, outside public data |
|
|
274
|
+
| `isolation.execution` | `read-only` | Select `microsandbox` for per-visitor VMs (Portal default); legacy `docker` also supported |
|
|
272
275
|
| `preamble.files` | `[".hop/handoff.md"]` | Host briefing files (**agent-level**: resolved against the workspace root and shared by every visitor; absolute paths pass through), merged into each context's first message; absent files are skipped |
|
|
273
276
|
| `briefing.prompt` | — | Optional single-update instruction executed as the bounded local owner at startup and hourly; configured by Portal, requires owner administration |
|
|
274
277
|
| `briefing.settingsFile` | — | Absolute path to a JSON `{ "enabled": boolean }` preference; absent file means enabled, observed every 5 seconds. Disabling preserves the current briefing and lets active work finish; restart timing is persisted |
|
|
@@ -312,13 +315,12 @@ identities.
|
|
|
312
315
|
| Tooling | Only the scoped `read_file` is available; no writes, shell, network or cross-session tools | Inherited-tool masking, scoped reader, and execution guard |
|
|
313
316
|
| Prompt context | Public agents have a dedicated system prompt and suppress optional host runtime context | Scoped complete prompt and context suppression |
|
|
314
317
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
accordingly. The A2A checkpoint directory is always excluded.
|
|
318
|
+
Visitor working directories now live outside `workspaceRoot`. The selected root
|
|
319
|
+
contains public data; `read_file` defaults to it and accepts `root: "workspace"`
|
|
320
|
+
for the current visitor's files. Portal automatically prepares Microsandbox:
|
|
321
|
+
one VM per visitor, read-only public projections and persistent private disks.
|
|
322
|
+
Idle VMs pause after 30 seconds and stop after 10 minutes, retaining files.
|
|
323
|
+
Backend conversation storage is not mounted. See [setup and limits](docs/visitor-isolation.en.md).
|
|
322
324
|
|
|
323
325
|
`read_file({"path":"."})` lists the root's entries. A file path reads UTF-8 text;
|
|
324
326
|
`offset` (1-based) and `limit` page lines or directory entries. Reads are bounded
|
|
@@ -446,3 +448,21 @@ If the code has expired, open an issue and we will refresh it.
|
|
|
446
448
|
## License
|
|
447
449
|
|
|
448
450
|
MIT
|
|
451
|
+
## Public relay integration
|
|
452
|
+
|
|
453
|
+
Talk2MyAgent Portal now supports automatic relay registration, a background Connector, publication controls and visitor invitations. This plugin continues to provide the local A2A service with its existing workspace and briefing rules. Relay is deployed independently. See [implementation and tests](docs/a2a-relay-implementation.zh-CN.md) and [Portal English guide](https://github.com/huangjuhua-aigc/Talk2MyAgent/blob/main/docs/relay.en.md).
|
|
454
|
+
|
|
455
|
+
### Relay integration test
|
|
456
|
+
|
|
457
|
+
`tests/relay.integration.spec.ts` is skipped unless **both** variables point at local checkouts:
|
|
458
|
+
|
|
459
|
+
- `A2A_RELAY_SOURCE` — the [a2a-relay-server](https://github.com/huangjuhua-aigc/a2a-relay-server) repository root
|
|
460
|
+
- `A2A_CONNECTOR_SOURCE` — Talk2MyAgent's `packages/a2a-connector` directory (run `pnpm install` in Talk2MyAgent first)
|
|
461
|
+
|
|
462
|
+
```sh
|
|
463
|
+
A2A_RELAY_SOURCE=/path/to/a2a-relay-server \
|
|
464
|
+
A2A_CONNECTOR_SOURCE=/path/to/Talk2MyAgent/packages/a2a-connector \
|
|
465
|
+
pnpm vitest run tests/relay.integration.spec.ts
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
It uses a stub model, temporary data and dynamic ports; no API key or DSH install is needed.
|
package/README.zh-CN.md
CHANGED
|
@@ -34,7 +34,7 @@ subagent provider。它是 `ctx.agents` 之上的传输适配层,不是能力
|
|
|
34
34
|
访客读取权限、自动简报、主人 IPC 与 Tailscale 部署详见[部署与迁移指南](https://github.com/huangjuhua-aigc/dsh-a2a/blob/main/docs/public-access-hardening.md)。
|
|
35
35
|
|
|
36
36
|
```sh
|
|
37
|
-
dsh plugin --profile web add dsh-a2a-server@0.
|
|
37
|
+
dsh plugin --profile web add dsh-a2a-server@0.4.0
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
`dsh plugin` 会在 profile 目录里转发给 pnpm,并把这个 bundle 追加进
|
|
@@ -59,17 +59,19 @@ dsh plugin --profile web add ./path/to/dsh-a2a-server
|
|
|
59
59
|
`dsh-base` 中,因此 `headless` profile 需要先挂载 `@deepseek-ai/dsh-host-webserver`。
|
|
60
60
|
`dsh --profile <name> --dump-config` 可以打印组合出来的配置行。
|
|
61
61
|
|
|
62
|
-
###
|
|
62
|
+
### 升级到 0.4.0
|
|
63
63
|
|
|
64
|
-
0.
|
|
65
|
-
`dsh-a2a-server@0.
|
|
64
|
+
0.4.0 适配 DSH `>=0.2.1-rc.2 <0.3.0`。先停止 agent,将
|
|
65
|
+
`dsh-a2a-server@0.4.0` 安装到原有 profile,再重新启动;配套 Portal 也需更新。
|
|
66
66
|
主人 RPC 和监控已改为需要认证的本机 IPC,公网 HTTP 不接受主人凭据。
|
|
67
67
|
访客可聊天并读取授权目录,其他工具关闭;空白名单 `trustedPeers: []` 拒绝所有访客。
|
|
68
68
|
任务结果与空闲会话在保留期内可跨驱逐和重启恢复。
|
|
69
69
|
|
|
70
70
|
新版 [Talk2MyAgent Portal](https://github.com/huangjuhua-aigc/Talk2MyAgent) 默认开启每小时简报更新,
|
|
71
71
|
用一个开关控制,完成后直接写入 `.hop/handoff.md`。单独安装协议插件而未配置 `briefing`
|
|
72
|
-
|
|
72
|
+
不会自动执行简报任务。
|
|
73
|
+
|
|
74
|
+
Portal 自动准备 Microsandbox,为每位访客提供独立沙箱。公共资料使用只读副本并排除 `node_modules`,私有文件保存在独立持久磁盘;空闲 30 秒暂停、10 分钟停止。独立 DSH 的旧配置保留原执行模式,安装插件本身不会自动启用 VM。详见[沙箱指南](docs/visitor-isolation.md)和 [0.4.0 发布说明](https://github.com/huangjuhua-aigc/dsh-a2a/blob/main/CHANGELOG.zh-CN.md)。
|
|
73
75
|
|
|
74
76
|
## 快速开始
|
|
75
77
|
|
|
@@ -116,7 +118,7 @@ curl -s http://127.0.0.1:9922/a2a \
|
|
|
116
118
|
| `A2A_PEERS` | `alice` | `名字[:token]` 列表;每个 peer 都必须有 token |
|
|
117
119
|
| `A2A_PORT` | `9900` | 监听端口 |
|
|
118
120
|
| `A2A_SEND_MODE` | `block` | `block` 或 `immediate` |
|
|
119
|
-
| `A2A_WORKSPACE_ROOT` | 临时目录 |
|
|
121
|
+
| `A2A_WORKSPACE_ROOT` | 临时目录 | 公共资料目录;访客工作区在此目录之外 |
|
|
120
122
|
| `DEEPSEEK_MODEL` | `deepseek-v4-flash` | 向适配器请求的模型 id |
|
|
121
123
|
|
|
122
124
|
一次性探针会对运行中的服务执行 67 项检查,任何一项不符即以非零码退出:
|
|
@@ -134,6 +136,7 @@ node example/probe.mjs http://127.0.0.1:9922 demo123
|
|
|
134
136
|
| `/.well-known/agent.json` | GET | 默认公开 |
|
|
135
137
|
| `{basePath}`(默认 `/a2a`) | POST | 必须携带 Bearer |
|
|
136
138
|
| `{basePath}/admin/contexts[/<id>]` | GET | 仅本机 IPC + admin token,公网 HTTP 不挂载 |
|
|
139
|
+
| `{basePath}/admin/prepare-stop` | POST | 仅本机 IPC + admin token;收尾任务、停止沙箱后确认可结束 DSH |
|
|
137
140
|
|
|
138
141
|
| JSON-RPC 方法 | 状态 |
|
|
139
142
|
| --- | --- |
|
|
@@ -238,9 +241,11 @@ part 是被**删除**而不是做了别名:本服务写出的每一个回包
|
|
|
238
241
|
| `blockTimeoutMs` | `60000` | 最长阻塞等待;到期返回任务当前状态,客户端可继续查询 |
|
|
239
242
|
| `contextIdleTtlMs` | `1800000` | context 的 agent 被释放前的空闲时长 |
|
|
240
243
|
| `maxResidentContexts` | `64` | 常驻 context 数量上限 |
|
|
241
|
-
| `isolation.workspaceMode` | `per-peer` |
|
|
242
|
-
| `isolation.workspaceRoot` | — |
|
|
243
|
-
| `isolation.peerWorkspaces` | `{}` |
|
|
244
|
+
| `isolation.workspaceMode` | `per-peer` | 旧配置迁移字段;访客均使用外置私有 cwd |
|
|
245
|
+
| `isolation.workspaceRoot` | — | 必填;只放公共资料 |
|
|
246
|
+
| `isolation.peerWorkspaces` | `{}` | 旧版按访客覆盖读取根目录 |
|
|
247
|
+
| `isolation.privateRoot` | 用户主目录下按部署分隔 | 公共资料之外的私有工作区父目录 |
|
|
248
|
+
| `isolation.execution` | `read-only` | 设为 `microsandbox` 使用独立访客 VM(Portal 默认);兼容 `docker` |
|
|
244
249
|
| `preamble.files` | `[".hop/handoff.md"]` | 主人背景简报文件(**agent 级**:相对工作区根目录解析,全体访客共用一份;绝对路径直通),合并进每个 context 的首条访客消息;文件不存在则跳过 |
|
|
245
250
|
| `briefing.prompt` | — | 可选的单次简报更新指令,由 Portal 配置,通过有执行预算的主人 agent 每小时运行 |
|
|
246
251
|
| `briefing.settingsFile` | — | 绝对路径;读取 `{ "enabled": boolean }` 设置,缺省开启,每 5 秒检查 |
|
|
@@ -281,10 +286,10 @@ refs:
|
|
|
281
286
|
| 工具层 | 仅提供受控 `read_file`,不开放写入、命令、联网或跨会话工具 | 屏蔽继承工具、专用读取工具、执行校验 |
|
|
282
287
|
| 提示词 | 访客不继承可选的主人个性化提示与运行时上下文 | 独立的公共系统提示词 |
|
|
283
288
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
289
|
+
访客 cwd 现在放在 `workspaceRoot` 之外。所选目录只放公共资料,`read_file` 默认读取它,
|
|
290
|
+
传入 `root: "workspace"` 则读取自己的私有工作区。Portal 自动准备 Microsandbox,每位访客独立 VM,
|
|
291
|
+
公共资料副本只读、自己的持久化磁盘可写;空闲 30 秒暂停、10 分钟停止,文件保留,不挂后端聊天记录。
|
|
292
|
+
详见[安装、迁移与隔离边界](docs/visitor-isolation.md)。
|
|
288
293
|
|
|
289
294
|
`read_file({"path":"."})` 列出资料目录;文件支持 UTF-8 文本,按 `offset`/`limit`
|
|
290
295
|
分页。单文件上限 2 MiB,单次最多 32000 字符、500 行/项,目录扫描最多 1000 项。
|
|
@@ -389,3 +394,21 @@ peer 依赖来表达:安装预检会拒绝任何插件未曾适配过的组合
|
|
|
389
394
|
## 许可
|
|
390
395
|
|
|
391
396
|
MIT
|
|
397
|
+
## 公网中继集成
|
|
398
|
+
|
|
399
|
+
Talk2MyAgent Portal 已实现自动注册 Relay、后台 Connector、发布开关和访客邀请。插件仍提供本地 A2A 接口,文件权限和公开简报逻辑保持原样。中继服务单独部署;实现状态与测试命令见 [中继实现记录](docs/a2a-relay-implementation.zh-CN.md)。
|
|
400
|
+
|
|
401
|
+
### 中继集成测试
|
|
402
|
+
|
|
403
|
+
`tests/relay.integration.spec.ts` 需要**同时**设置以下两个变量才会运行,否则跳过:
|
|
404
|
+
|
|
405
|
+
- `A2A_RELAY_SOURCE`:[a2a-relay-server](https://github.com/huangjuhua-aigc/a2a-relay-server) 仓库根目录
|
|
406
|
+
- `A2A_CONNECTOR_SOURCE`:Talk2MyAgent 的 `packages/a2a-connector` 目录(先在 Talk2MyAgent 执行 `pnpm install`)
|
|
407
|
+
|
|
408
|
+
```sh
|
|
409
|
+
A2A_RELAY_SOURCE=/path/to/a2a-relay-server \
|
|
410
|
+
A2A_CONNECTOR_SOURCE=/path/to/Talk2MyAgent/packages/a2a-connector \
|
|
411
|
+
pnpm vitest run tests/relay.integration.spec.ts
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
测试使用桩模型、临时数据和动态端口,无需 API 密钥或安装 DSH。
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Per-visitor sandboxes (0.4.0)
|
|
2
|
+
|
|
3
|
+
Portal defaults to local Microsandbox 0.7.11 microVMs. DSH remains the trusted orchestrator for authentication, model requests and conversation storage. Only read_file is exposed to visitors today; Python, shell and write tools are not automatically enabled. Real Python tests verify private read/write capability for future tool integrations.
|
|
4
|
+
|
|
5
|
+
## Automatic preparation
|
|
6
|
+
|
|
7
|
+
Click Start in Portal. It checks/upgrades the plugin, downloads a pinned SDK and a digest-pinned Python image, and reports progress. Components are cached in the user directory; no manual Microsandbox or Docker installation is needed. Plain chat creates no visitor VM. The first tool call creates one; later calls reuse it.
|
|
8
|
+
|
|
9
|
+
Supported targets are Windows x64/ARM64 with WHP, Linux x64/ARM64 with KVM, and Apple Silicon macOS with ARM64 Node.js. Node.js 22+ is required. Only Windows x64 has been tested locally; macOS and Linux still need acceptance testing. Intel Macs are unsupported.
|
|
10
|
+
|
|
11
|
+
Enabling Windows Hypervisor Platform may require a user action and restart. Linux requires access to /dev/kvm. Administrator privileges, firmware settings and OS restarts cannot be silently arranged. Preparation failures are visible and retryable; tools never fall back to host execution.
|
|
12
|
+
|
|
13
|
+
Portal installs dsh-a2a-server@^0.4.0 from npm. For local development, build the dsh-a2a checkout with pnpm install and pnpm build, then set A2A_PLUGIN_SOURCE to its absolute path in the terminal launching Portal. The npm release does not need this override. Standalone configurations select isolation.execution: microsandbox. Existing configs without that field retain read-only mode, which has no VM boundary. The docker backend remains available for compatibility.
|
|
14
|
+
|
|
15
|
+
## File boundaries and persistence
|
|
16
|
+
|
|
17
|
+
| Data | Inside the VM | Local persistence |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| Selected public data | /source, read-only copy | Original host directory is never mounted |
|
|
20
|
+
| Current visitor files | /work, read/write | Exclusive persistent virtual disk |
|
|
21
|
+
| Other visitors | Not mounted | Separate disks |
|
|
22
|
+
| Sessions, protocol state, credentials | Not mounted | Trusted backend storage |
|
|
23
|
+
|
|
24
|
+
Public data includes .hop/handoff.md. Before each tool call it is validated and copied; changes stop that visitor VM before replacing its public projection, then restart with the same private disk. Trees are capped at 512 MiB and 100000 entries, so large datasets increase tool latency. Microsandbox public projections exclude entries named node_modules at any depth, case-insensitively, including dependency links. Their contents are never traversed; the original project's dependencies are neither moved nor deleted. Other symlinks, junctions, hard links, special files and nested filesystems remain rejected. Private workspace imports and Docker raw mounts do not use this exclusion and still reject all links.
|
|
25
|
+
|
|
26
|
+
Portal stores VM mappings at ~/.a2a/workspaces/<agent>/.microsandbox/<peer>/record.json and read-only public projections beside them. Existing <peer>/ files are imported on first boot and retained as migration sources. New /work files persist in the virtual disk; they are **not synchronized back to the old host folder**. A generated-file download/export interface has not been added.
|
|
27
|
+
|
|
28
|
+
The SDK, native state and VM disks live under ~/.a2a/sandbox-runtime, overridable with A2A_SANDBOX_HOME before startup. Back up both the private mapping directory and runtime state. Do not delete either or run destroy/remove on user VMs; those actions delete disks. Removing a peer credential does not automatically delete its files.
|
|
29
|
+
|
|
30
|
+
Identity is agent + authenticated peer, not conversation or message. Multiple contexts for one peer share a VM and private files. People sharing a token share this identity; issue independent credentials.
|
|
31
|
+
|
|
32
|
+
## Lifecycle and quotas
|
|
33
|
+
|
|
34
|
+
After the last tool finishes, 30 idle seconds pause the VM; 10 idle minutes stop it. Pausing retains memory. Stopping releases runtime resources and keeps disks. New tool calls resume a paused VM or restart a stopped VM with its original disk. Active or queued work prevents idle transitions, and calls for one visitor are serialized.
|
|
35
|
+
|
|
36
|
+
Each backend allows four resident VMs including paused ones. At capacity, the oldest idle VM stops early; if every VM is busy, new tool work is rejected. Normal backend shutdown stops its VMs. A new controller reclaims recorded instances abandoned by a previous controller, without destroying disks. Abrupt power loss or forced termination can still lose unflushed writes.
|
|
37
|
+
|
|
38
|
+
VMs have one CPU, 512 MiB RAM, a 256 MiB root disk and 512 MiB private disk. Networking is disabled. Tools run as UID 1000 with a 30-second execution timeout and 256 KB output cap. The public projection is read-only/noexec/nosuid/nodev; private disks are nosuid/nodev. The host user, hypervisor and pinned image remain trusted; this is not an absolute defense against virtualization vulnerabilities.
|
|
39
|
+
|
|
40
|
+
read_file defaults to public data; root: workspace selects the current visitor's disk. Text reads remain bounded to UTF-8 files up to 2 MiB, 32000 returned characters and 500 lines/entries per call. Backend conversation records are not tool-readable.
|
|
41
|
+
|
|
42
|
+
## Migration and verification
|
|
43
|
+
|
|
44
|
+
Stop the old agent and start with the new Portal. It copies current visitors' legacy directories outside public data, verifies the copy and removes the old source. Conflicting destinations are never overwritten. First VM boot imports that visitor's private files and refuses conflicting content. Archive private leftovers for removed visitors outside public data manually.
|
|
45
|
+
|
|
46
|
+
Automatic public briefings still update .hop/handoff.md and appear in Portal. Trusted owner maintenance runs on the host, outside the visitor sandbox.
|
|
47
|
+
|
|
48
|
+
Run pnpm typecheck, pnpm test, pnpm test:package and pnpm test:microsandbox. The last command automatically prepares real microVMs and synthetic files to exercise public mutation denial, private CRUD, peer separation, link attacks, network/credential isolation, cancellation, lifecycle, persistence and abandoned-instance recovery.
|
|
49
|
+
|
|
50
|
+
Set A2A_MSB_WALLCLOCK=1 for a full ten-minute wall-clock lifecycle test. Otherwise controlled time triggers actual native VM transitions. A2A_MSB_TEST_RUNTIME optionally reuses a test runtime cache. Legacy Docker validation remains pnpm test:docker and requires a local Linux Docker engine plus the image built from docker/Dockerfile.
|
|
51
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# 访客独立沙箱(0.4.0)
|
|
2
|
+
|
|
3
|
+
Portal 默认使用 Microsandbox 0.7.11,本机运行微型虚拟机。DSH 后端负责认证、模型调用和聊天记录;工具运行在访客沙箱中。当前模型仍只开放 `read_file`,没有自动开放 Python、Shell 或写入工具。私有目录读写能力已经由真实 Python 测试验证,可供以后受控开放的工具使用。
|
|
4
|
+
|
|
5
|
+
## 启动体验
|
|
6
|
+
|
|
7
|
+
点击 Portal「启动」即可自动检查/更新插件、下载固定版本的沙箱组件和固定摘要的 Python 镜像,页面显示进度。组件安装到用户目录并缓存,不需要手动安装 Microsandbox 或 Docker。纯聊天不创建访客 VM;首次工具调用才创建,后续调用复用。
|
|
8
|
+
|
|
9
|
+
支持的宿主环境:Windows x64/ARM64 + WHP、Linux x64/ARM64 + KVM、Apple Silicon macOS + ARM64 Node.js;Node.js 22 以上。当前只在 Windows x64 实测,其他平台需要单独验收。Intel Mac 暂不支持。
|
|
10
|
+
|
|
11
|
+
Windows 未启用“Windows 虚拟机监控程序平台”时,需要用户启用系统功能并重启。Linux 需要 /dev/kvm 访问权限。管理员权限、BIOS 设置和系统重启无法静默代办。准备失败会显示原因,重试复用已下载内容,绝不退回宿主机执行工具。
|
|
12
|
+
|
|
13
|
+
Portal 使用 npm 插件 `dsh-a2a-server@^0.4.0`。仅在测试本地源码时:
|
|
14
|
+
|
|
15
|
+
```powershell
|
|
16
|
+
# D:\code\dsh-a2a
|
|
17
|
+
pnpm install
|
|
18
|
+
pnpm build
|
|
19
|
+
# 在启动 Portal 的同一个终端里指定源码包位置
|
|
20
|
+
$env:A2A_PLUGIN_SOURCE='D:\code\dsh-a2a'
|
|
21
|
+
# 然后启动 Talk2MyAgent Portal
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
使用 npm 版本无需设置这个开发变量。独立 DSH 配置使用 `isolation.execution: microsandbox`;旧配置未填写时仍是 `read-only`,仅有受限读取器,没有 VM 边界。`docker` 作为兼容选项保留。
|
|
25
|
+
|
|
26
|
+
## 目录与持久化
|
|
27
|
+
|
|
28
|
+
| 内容 | 沙箱可见范围 | 本地保存 |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| 用户指定公共资料 | /source,只读副本 | 原始目录不挂入 VM;包括公开简报 .hop/handoff.md |
|
|
31
|
+
| 当前访客的文件 | /work,可增加、修改、重命名、删除 | 每个访客独享持久化虚拟磁盘 |
|
|
32
|
+
| 其他访客的文件 | 不挂载 | 各自独立磁盘 |
|
|
33
|
+
| 聊天记录、协议状态、凭据 | 不挂载 | 可信 DSH 后端独立保存 |
|
|
34
|
+
|
|
35
|
+
Portal 的私有根在 `~/.a2a/workspaces/<agent>`。其 `.microsandbox/<peer>/record.json` 保存访客到 VM 的稳定映射,`public/` 保存公共资料副本;原有 `<peer>/` 文件作为首次导入源保留。以后 /work 中的新文件保存在虚拟磁盘中,**不会同步回旧的宿主机普通文件夹**。
|
|
36
|
+
|
|
37
|
+
运行组件与所有 VM 磁盘默认保存在 `~/.a2a/sandbox-runtime`;可在启动前通过 `A2A_SANDBOX_HOME` 指定。备份需同时包含私有根的映射和 runtime 的 state 目录。不要清除这些目录,或对用户 VM 执行 destroy/remove;这些操作会删除磁盘。用户生成文件的独立下载/导出入口尚未增加。
|
|
38
|
+
|
|
39
|
+
公共资料会在工具调用前验证并复制;内容更新时停止该访客旧 VM、更新只读副本,然后以原私有磁盘启动。复制最多 512 MiB、100000 项,大目录会增加调用耗时。Microsandbox 的公共资料副本自动排除各层级的 `node_modules`(不区分大小写),包括同名依赖链接;不会遍历其内容,也不会移动或删除原项目的依赖。其他硬链接、符号链接/junction、特殊文件和嵌套文件系统仍被拒绝,避免通过别名访问宿主机其他资料。私有工作区导入和 Docker 原目录挂载不使用此排除规则,仍拒绝所有链接。
|
|
40
|
+
|
|
41
|
+
隔离单位是 **agent + 已认证 peer**,不是每轮消息或 contextId。不同聊天共享同一 peer 的文件;多人共用访客令牌也会共用沙箱。每人应分配独立凭据。删除凭据不会自动删除旧文件。
|
|
42
|
+
|
|
43
|
+
## 生命周期
|
|
44
|
+
|
|
45
|
+
- 第一次调用工具:创建该访客 VM;聊天本身不创建。
|
|
46
|
+
- 工具完成后空闲 30 秒:暂停,保留进程和内存;暂停不释放主要内存。
|
|
47
|
+
- 自最后一次工具完成空闲 10 分钟:停止 VM,释放运行资源;磁盘与文件保留。
|
|
48
|
+
- 暂停期间来新工具请求:恢复原 VM;停止后再来:用原磁盘重新启动。
|
|
49
|
+
- 有工具执行或排队时不暂停;同一访客工具串行,不同访客各用自己的 VM。
|
|
50
|
+
- 每个后端最多 4 个驻留 VM(包括暂停的);满额先停止最久未使用的空闲 VM。都忙时拒绝新增工具,已有文件不丢失。
|
|
51
|
+
- 正常关闭后端会停止其 VM;控制进程意外退出后,下次启动回收其记录的遗留实例。不会销毁用户磁盘。机器断电/强杀与普通磁盘一样可能丢失未落盘写入。
|
|
52
|
+
|
|
53
|
+
每个 VM 为 1 CPU、512 MiB 内存、256 MiB 根磁盘、512 MiB 私有工作盘,无网络,工具以 UID 1000 运行,单次执行限时 30 秒、输出 256 KB。公共副本只读且 noexec/nosuid/nodev;私有盘 nosuid/nodev。宿主用户、虚拟化实现与受信镜像仍属于可信边界,这不是对虚拟化漏洞的绝对保证。
|
|
54
|
+
|
|
55
|
+
`read_file({"path":"info.txt"})` 读公共资料;`read_file({"root":"workspace","path":"."})` 读自己的工作区。文件限 UTF-8 文本、2 MiB、单次 32000 字符与 500 行/项。后端聊天记录不作为可读工具目录。
|
|
56
|
+
|
|
57
|
+
## 旧数据迁移
|
|
58
|
+
|
|
59
|
+
停止旧 agent,再用新版 Portal 启动。Portal 把公共目录中的当前访客旧目录复制到独立私有根,校验后移除旧目录;目标已存在则拒绝覆盖。首次 VM 启动再导入自己的私有文件,冲突拒绝覆盖。已删除访客留下的历史私有文件需要主人移出公共资料目录。
|
|
60
|
+
|
|
61
|
+
公开简报继续默认定时更新到 .hop/handoff.md 并显示在 Portal。主人简报任务是可信后端任务,仍在宿主机执行,不属于访客沙箱。
|
|
62
|
+
|
|
63
|
+
## 测试
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
pnpm typecheck
|
|
67
|
+
pnpm test
|
|
68
|
+
pnpm test:package
|
|
69
|
+
pnpm test:microsandbox
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
最后一项会自动准备真实 Microsandbox,使用合成文件测试只读公共资料、私有 CRUD、跨访客隔离、链接攻击、网络/凭据隔离、取消、暂停/恢复/停止、重启和遗留实例回收。不会读取真实用户资料。
|
|
73
|
+
|
|
74
|
+
设置 `A2A_MSB_WALLCLOCK=1` 再运行,可执行完整 10 分钟真实计时测试;否则通过可控时钟触发真实 VM 的生命周期转换。`A2A_MSB_TEST_RUNTIME` 可复用一个测试 runtime 缓存。Docker 兼容验证仍用 `pnpm test:docker`(需本地 Linux Docker 和 docker/Dockerfile 构建的镜像)。
|
|
75
|
+
|
package/lib/config.d.ts
CHANGED
|
@@ -18,14 +18,18 @@ export interface PeerConfig {
|
|
|
18
18
|
/** Working directories and the data roots exposed through the scoped reader. */
|
|
19
19
|
export interface IsolationConfig {
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Legacy field retained for checkpoint migration. Every visitor now has a
|
|
22
|
+
* private cwd outside public data, including old `shared` configurations.
|
|
23
23
|
*/
|
|
24
24
|
workspaceMode: 'per-peer' | 'shared';
|
|
25
|
-
/** Shared
|
|
25
|
+
/** Shared public data. Never the parent of new visitor workspaces. */
|
|
26
26
|
workspaceRoot: string;
|
|
27
|
-
/**
|
|
27
|
+
/** Legacy per-peer public-data overrides; no longer control runtime cwd. */
|
|
28
28
|
peerWorkspaces: Record<string, string>;
|
|
29
|
+
/** Private runtime parent, disjoint from all public-data directories. */
|
|
30
|
+
privateRoot?: string;
|
|
31
|
+
/** Native mode only permits the bounded reader; isolated runtimes never fall back. */
|
|
32
|
+
execution?: 'read-only' | 'docker' | 'microsandbox';
|
|
29
33
|
}
|
|
30
34
|
/** One declared skill, as it appears on the Agent Card. */
|
|
31
35
|
export interface SkillConfig {
|
package/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAS7C,6DAA6D;AAC7D,MAAM,WAAW,UAAU;IACzB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B;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AAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,CAAA;IAClG,SAAS,EAAE,eAAe,CAAA;IAC1B,QAAQ,EAAE,cAAc,CAAA;IACxB,sFAAsF;IACtF,QAAQ,CAAC,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IACnD;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,IAAI,EAAE,UAAU,CAAA;CACjB;AAWD,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,eAAe,CA0FzC,CAAA;AAEF,oEAAoE;AACpE,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAgElE"}
|
package/lib/config.js
CHANGED
|
@@ -84,6 +84,8 @@ export const Config = Schema.object({
|
|
|
84
84
|
workspaceMode: Schema.union(['per-peer', 'shared']).default('per-peer'),
|
|
85
85
|
workspaceRoot: Schema.string().required(),
|
|
86
86
|
peerWorkspaces: Schema.dict(Schema.string()).default({}),
|
|
87
|
+
privateRoot: Schema.string(),
|
|
88
|
+
execution: Schema.union(['read-only', 'docker', 'microsandbox']).default('read-only'),
|
|
87
89
|
}).required(),
|
|
88
90
|
preamble: Schema.object({
|
|
89
91
|
files: Schema.array(Schema.string()).default(['.hop/handoff.md']),
|
|
@@ -121,6 +123,8 @@ export class A2AConfigError extends Error {
|
|
|
121
123
|
* @throws {A2AConfigError} when a peer name, credential reference, or path is unusable.
|
|
122
124
|
*/
|
|
123
125
|
export function assertConfigCoherent(config) {
|
|
126
|
+
if (config.isolation.privateRoot !== undefined && !isAbsolute(config.isolation.privateRoot))
|
|
127
|
+
throw new A2AConfigError('isolation.privateRoot must be absolute');
|
|
124
128
|
if (config.briefing?.prompt || config.briefing?.settingsFile) {
|
|
125
129
|
if (!config.admin?.tokenEnv || !config.briefing.prompt.trim() || !isAbsolute(config.briefing.settingsFile)) {
|
|
126
130
|
throw new A2AConfigError('automatic briefing requires owner administration, a prompt, and an absolute settingsFile');
|
package/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC,0EAA0E;AAC1E,MAAM,cAAc,GAAG,0BAA0B,CAAA;AAEjD,6EAA6E;AAC7E,MAAM,SAAS,GAAG,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC,0EAA0E;AAC1E,MAAM,cAAc,GAAG,0BAA0B,CAAA;AAEjD,6EAA6E;AAC7E,MAAM,SAAS,GAAG,6BAA6B,CAAA;AA0I/C;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,MAAM,GAA4B,MAAM,CAAC,MAAM,CAAC;IAC3D,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;IAC1B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;IAEtB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC;QAC5C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,8CAA8C,CAAC;QACpF,MAAM,EAAE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AAC,QAAQ,KAAK,QAAQ;WACzC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QACrC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAA;IACzB,IAAI,aAAa,KAAK,SAAS,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;QACvE,MAAM,IAAI,cAAc,CACtB,uDAAuD,MAAM,CAAC,cAAc,CAAC,sBAAsB,CACpG,CAAA;IACH,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,cAAc,CAAC,iCAAiC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC9E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
2
|
+
export declare const VISITOR_IMAGE = "talk2myagent/visitor-runtime:0.1.0";
|
|
3
|
+
export declare const MAX_VISITOR_CONTAINERS = 4;
|
|
4
|
+
/** Per backend process, shared by all its visitor contexts. No unbounded queue. */
|
|
5
|
+
export declare function reserveContainer(): () => void;
|
|
6
|
+
export declare function docker(args: string[], input?: string, signal?: AbortSignal, timeoutMs?: number): Promise<string>;
|
|
7
|
+
export declare function requireDocker(): Promise<void>;
|
|
8
|
+
export declare function containerArgs(name: string, dataRoot: string, workRoot: string, worker: string): Promise<string[]>;
|
|
9
|
+
/** The model supplies only read arguments; never Docker flags, mounts or commands. */
|
|
10
|
+
export declare function dockerReadTool(definition: ToolDefinition, dataRoot: string, workRoot: string, verify: () => Promise<void>): ToolDefinition;
|
|
11
|
+
//# sourceMappingURL=docker-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docker-executor.d.ts","sourceRoot":"","sources":["../src/docker-executor.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAG5D,eAAO,MAAM,aAAa,uCAAuC,CAAA;AACjE,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAGvC,mFAAmF;AACnF,wBAAgB,gBAAgB,IAAI,MAAM,IAAI,CAK7C;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,SAAK,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,SAAS,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBlH;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAUnD;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAYvH;AAED,sFAAsF;AACtF,wBAAgB,cAAc,CAAC,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,cAAc,CAuB1I"}
|