agent-sandbox-backends 0.1.0__tar.gz
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.
- agent_sandbox_backends-0.1.0/.editorconfig +21 -0
- agent_sandbox_backends-0.1.0/.env.example +15 -0
- agent_sandbox_backends-0.1.0/.gitattributes +12 -0
- agent_sandbox_backends-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +93 -0
- agent_sandbox_backends-0.1.0/.github/ISSUE_TEMPLATE/config.yml +2 -0
- agent_sandbox_backends-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +64 -0
- agent_sandbox_backends-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +34 -0
- agent_sandbox_backends-0.1.0/.github/workflows/ci.yml +38 -0
- agent_sandbox_backends-0.1.0/.github/workflows/release.yml +79 -0
- agent_sandbox_backends-0.1.0/.gitignore +17 -0
- agent_sandbox_backends-0.1.0/CHANGELOG.md +14 -0
- agent_sandbox_backends-0.1.0/CODE_OF_CONDUCT.md +27 -0
- agent_sandbox_backends-0.1.0/CONTRIBUTING.md +35 -0
- agent_sandbox_backends-0.1.0/GITHUB_PYPI_RELEASE_GUIDE.md +449 -0
- agent_sandbox_backends-0.1.0/LICENSE +201 -0
- agent_sandbox_backends-0.1.0/OPENSANDBOX_MULTI_FILE_TEST_GUIDE.md +368 -0
- agent_sandbox_backends-0.1.0/PKG-INFO +294 -0
- agent_sandbox_backends-0.1.0/README.md +272 -0
- agent_sandbox_backends-0.1.0/SECURITY.md +21 -0
- agent_sandbox_backends-0.1.0/SUPPORT.md +35 -0
- agent_sandbox_backends-0.1.0/backend-sdk-design.md +1687 -0
- agent_sandbox_backends-0.1.0/docs/architecture.md +540 -0
- agent_sandbox_backends-0.1.0/docs/implementation-plan.md +193 -0
- agent_sandbox_backends-0.1.0/docs/release-checklist.md +31 -0
- agent_sandbox_backends-0.1.0/docs/requirements-matrix.md +22 -0
- agent_sandbox_backends-0.1.0/docs/technology-stack.md +275 -0
- agent_sandbox_backends-0.1.0/pyproject.toml +65 -0
- agent_sandbox_backends-0.1.0/scripts/deepagents_opensandbox_smoke.py +308 -0
- agent_sandbox_backends-0.1.0/scripts/generate_sbom.py +61 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/__init__.py +97 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/_internal/__init__.py +1 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/_internal/bounded_output.py +50 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/_internal/ids.py +38 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/api.py +528 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/application/__init__.py +1 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/application/allocator.py +135 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/application/backend.py +677 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/application/command_handle.py +64 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/application/operation_pipeline.py +280 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/application/output_writer.py +169 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/concurrency/__init__.py +12 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/concurrency/activity.py +51 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/concurrency/keyed_rw_lock.py +135 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/concurrency/lease.py +114 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/concurrency/limiter.py +41 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/config/__init__.py +23 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/config/command.py +20 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/config/concurrency.py +36 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/config/models.py +12 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/config/retry.py +19 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/config/upload.py +37 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/domain/__init__.py +1 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/domain/base.py +5 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/domain/capabilities.py +58 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/domain/commands.py +72 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/domain/context.py +55 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/domain/errors.py +172 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/domain/files.py +33 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/domain/identity.py +14 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/domain/operations.py +38 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/domain/sandbox.py +40 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/domain/uploads.py +71 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/helper/__init__.py +13 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/helper/build.py +72 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/helper/source/__init__.py +1 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/helper/source/history_helper.py +1465 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/helper/source/upload_helper.py +311 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/history/__init__.py +18 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/history/bootstrap_outbox.py +214 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/history/config.py +98 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/history/encoding.py +217 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/history/memory.py +36 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/history/none.py +17 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/history/provider_transport.py +240 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/history/sandbox.py +319 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/history/sqlalchemy.py +623 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/history/sqlite.py +255 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/integrations/__init__.py +1 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/integrations/deepagents/__init__.py +17 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/integrations/deepagents/adapter.py +413 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/integrations/deepagents/compatibility.py +88 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/integrations/deepagents/runtime.py +66 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/ports/__init__.py +1 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/ports/history_store.py +18 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/ports/history_transport.py +26 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/ports/lease_store.py +21 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/ports/provider.py +64 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/providers/__init__.py +3 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/providers/mock/__init__.py +3 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/providers/mock/provider.py +412 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/providers/opensandbox/__init__.py +3 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/providers/opensandbox/provider.py +664 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/providers/registry.py +52 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/py.typed +0 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/security/__init__.py +14 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/security/archive.py +110 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/security/upload_scanner.py +228 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/upload/__init__.py +10 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/upload/archive.py +77 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/upload/provider_transport.py +204 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/upload/service.py +243 -0
- agent_sandbox_backends-0.1.0/src/agent_sandbox_backends/version.py +2 -0
- agent_sandbox_backends-0.1.0/uv.lock +1736 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
end_of_line = lf
|
|
6
|
+
insert_final_newline = true
|
|
7
|
+
trim_trailing_whitespace = true
|
|
8
|
+
|
|
9
|
+
[*.py]
|
|
10
|
+
indent_style = space
|
|
11
|
+
indent_size = 4
|
|
12
|
+
|
|
13
|
+
[*.{yml,yaml,toml,json}]
|
|
14
|
+
indent_style = space
|
|
15
|
+
indent_size = 2
|
|
16
|
+
|
|
17
|
+
[*.md]
|
|
18
|
+
trim_trailing_whitespace = false
|
|
19
|
+
|
|
20
|
+
[*.ps1]
|
|
21
|
+
end_of_line = crlf
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# OpenSandbox Service 根地址,不要填写 Web Console 地址,也不要添加 /v1。
|
|
2
|
+
OPENSANDBOX_URL=http://127.0.0.1:8080
|
|
3
|
+
|
|
4
|
+
# OpenSandbox Service 开启鉴权时填写;未开启鉴权时保持为空。
|
|
5
|
+
# OPENSANDBOX_API_KEY=
|
|
6
|
+
|
|
7
|
+
# true: 文件、命令和健康检查通过 OpenSandbox Service 代理。
|
|
8
|
+
# 客户端无法直接访问 Docker Sandbox 私有端点时必须开启。
|
|
9
|
+
OPENSANDBOX_USE_SERVER_PROXY=true
|
|
10
|
+
|
|
11
|
+
# 四个测试创建 Sandbox 时使用的镜像。
|
|
12
|
+
OPENSANDBOX_IMAGE=python:3.12
|
|
13
|
+
|
|
14
|
+
# false: 测试结束自动删除;true: 保留文件和历史供 Web Console 查看。
|
|
15
|
+
OPENSANDBOX_KEEP_CREATED=false
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: 报告可复现的 SDK、OpenSandbox 或 History 问题
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels:
|
|
5
|
+
- bug
|
|
6
|
+
body:
|
|
7
|
+
- type: markdown
|
|
8
|
+
attributes:
|
|
9
|
+
value: |
|
|
10
|
+
感谢反馈。请先移除 API Key、Token、密码、私网地址和 Sandbox 中的敏感数据。
|
|
11
|
+
|
|
12
|
+
- type: input
|
|
13
|
+
id: package_version
|
|
14
|
+
attributes:
|
|
15
|
+
label: agent-sandbox-backends 版本
|
|
16
|
+
description: 可通过 `python -c "import agent_sandbox_backends; print(agent_sandbox_backends.__version__)"` 查看。
|
|
17
|
+
placeholder: 0.1.0
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
|
|
21
|
+
- type: input
|
|
22
|
+
id: python_version
|
|
23
|
+
attributes:
|
|
24
|
+
label: Python 版本
|
|
25
|
+
placeholder: Python 3.12.3
|
|
26
|
+
validations:
|
|
27
|
+
required: true
|
|
28
|
+
|
|
29
|
+
- type: input
|
|
30
|
+
id: opensandbox_version
|
|
31
|
+
attributes:
|
|
32
|
+
label: OpenSandbox 版本
|
|
33
|
+
description: 可通过 `python -c "import importlib.metadata; print(importlib.metadata.version('opensandbox'))"` 查看。
|
|
34
|
+
placeholder: 0.1.14
|
|
35
|
+
validations:
|
|
36
|
+
required: true
|
|
37
|
+
|
|
38
|
+
- type: dropdown
|
|
39
|
+
id: deployment
|
|
40
|
+
attributes:
|
|
41
|
+
label: OpenSandbox 部署方式
|
|
42
|
+
options:
|
|
43
|
+
- Docker
|
|
44
|
+
- Kubernetes
|
|
45
|
+
- 本机进程
|
|
46
|
+
- 其他
|
|
47
|
+
validations:
|
|
48
|
+
required: true
|
|
49
|
+
|
|
50
|
+
- type: dropdown
|
|
51
|
+
id: server_proxy
|
|
52
|
+
attributes:
|
|
53
|
+
label: 是否启用 use_server_proxy
|
|
54
|
+
options:
|
|
55
|
+
- "true"
|
|
56
|
+
- "false"
|
|
57
|
+
- 不确定
|
|
58
|
+
validations:
|
|
59
|
+
required: true
|
|
60
|
+
|
|
61
|
+
- type: textarea
|
|
62
|
+
id: description
|
|
63
|
+
attributes:
|
|
64
|
+
label: 问题描述
|
|
65
|
+
description: 说明预期行为和实际行为。
|
|
66
|
+
validations:
|
|
67
|
+
required: true
|
|
68
|
+
|
|
69
|
+
- type: textarea
|
|
70
|
+
id: reproduction
|
|
71
|
+
attributes:
|
|
72
|
+
label: 最小复现步骤
|
|
73
|
+
description: 提供尽可能短的代码和操作步骤,不要包含真实凭证。
|
|
74
|
+
render: python
|
|
75
|
+
validations:
|
|
76
|
+
required: true
|
|
77
|
+
|
|
78
|
+
- type: textarea
|
|
79
|
+
id: logs
|
|
80
|
+
attributes:
|
|
81
|
+
label: 错误和日志
|
|
82
|
+
description: 请先删除 API Key、Token、密码、私网地址、文件内容和 Sandbox 数据。
|
|
83
|
+
render: shell
|
|
84
|
+
|
|
85
|
+
- type: checkboxes
|
|
86
|
+
id: safety
|
|
87
|
+
attributes:
|
|
88
|
+
label: 安全确认
|
|
89
|
+
options:
|
|
90
|
+
- label: 我已经确认内容中不包含真实凭证、私网地址或敏感 Sandbox 数据。
|
|
91
|
+
required: true
|
|
92
|
+
- label: 如果这是安全漏洞,我不会创建公开 Issue,而会按照 SECURITY.md 私下报告。
|
|
93
|
+
required: true
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: 提议新的 SDK、History、Web Console 数据或 OpenSandbox 能力
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels:
|
|
5
|
+
- enhancement
|
|
6
|
+
body:
|
|
7
|
+
- type: markdown
|
|
8
|
+
attributes:
|
|
9
|
+
value: |
|
|
10
|
+
第一版只支持 OpenSandbox。请优先说明真实使用场景,而不只是建议增加配置项。
|
|
11
|
+
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: problem
|
|
14
|
+
attributes:
|
|
15
|
+
label: 要解决的问题
|
|
16
|
+
description: 目前什么场景无法完成,或者使用成本过高?
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: proposal
|
|
22
|
+
attributes:
|
|
23
|
+
label: 建议方案
|
|
24
|
+
description: 描述期望的公共 API、默认行为和示例。
|
|
25
|
+
validations:
|
|
26
|
+
required: true
|
|
27
|
+
|
|
28
|
+
- type: dropdown
|
|
29
|
+
id: area
|
|
30
|
+
attributes:
|
|
31
|
+
label: 涉及范围
|
|
32
|
+
multiple: true
|
|
33
|
+
options:
|
|
34
|
+
- Backend 创建与生命周期
|
|
35
|
+
- 文件上传、下载和查看
|
|
36
|
+
- 命令执行
|
|
37
|
+
- Sandbox SQLite History
|
|
38
|
+
- Deep Agents 适配
|
|
39
|
+
- 并发与取消
|
|
40
|
+
- 安全与权限
|
|
41
|
+
- GitHub、PyPI 与文档
|
|
42
|
+
validations:
|
|
43
|
+
required: true
|
|
44
|
+
|
|
45
|
+
- type: textarea
|
|
46
|
+
id: compatibility
|
|
47
|
+
attributes:
|
|
48
|
+
label: 兼容性影响
|
|
49
|
+
description: 是否会改变 History Schema、Web Console 读取方式或现有用户代码?
|
|
50
|
+
|
|
51
|
+
- type: textarea
|
|
52
|
+
id: alternatives
|
|
53
|
+
attributes:
|
|
54
|
+
label: 已考虑的替代方案
|
|
55
|
+
|
|
56
|
+
- type: checkboxes
|
|
57
|
+
id: checks
|
|
58
|
+
attributes:
|
|
59
|
+
label: 提交确认
|
|
60
|
+
options:
|
|
61
|
+
- label: 该需求以 OpenSandbox 第一版定位为基础。
|
|
62
|
+
required: true
|
|
63
|
+
- label: 我没有在内容中提交真实凭证或敏感数据。
|
|
64
|
+
required: true
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
## 变更说明
|
|
2
|
+
|
|
3
|
+
说明本次修改解决的问题及选择该方案的原因。
|
|
4
|
+
|
|
5
|
+
## 影响范围
|
|
6
|
+
|
|
7
|
+
- [ ] Backend 创建与生命周期
|
|
8
|
+
- [ ] 文件上传、下载和查看
|
|
9
|
+
- [ ] 命令执行
|
|
10
|
+
- [ ] Sandbox SQLite History
|
|
11
|
+
- [ ] Deep Agents 适配
|
|
12
|
+
- [ ] 并发、取消或异常处理
|
|
13
|
+
- [ ] 安全边界
|
|
14
|
+
- [ ] 文档、CI 或发布
|
|
15
|
+
|
|
16
|
+
## 验证结果
|
|
17
|
+
|
|
18
|
+
- [ ] `uv run ruff check .`
|
|
19
|
+
- [ ] `uv run pyright`
|
|
20
|
+
- [ ] `uv run pytest -q`
|
|
21
|
+
- [ ] `uv build`
|
|
22
|
+
- [ ] 如涉及真实 OpenSandbox,已运行对应手动测试
|
|
23
|
+
|
|
24
|
+
## 兼容性检查
|
|
25
|
+
|
|
26
|
+
- [ ] 公共 API 变更已更新 README 和类型定义
|
|
27
|
+
- [ ] History Schema 或字段变更已确认 Web Console 兼容性
|
|
28
|
+
- [ ] 上传修改保留 allowed roots、敏感文件排除和路径安全检查
|
|
29
|
+
- [ ] 命令与 History 内容中没有加入 API Key、Token 或密码
|
|
30
|
+
- [ ] 没有提交 `.env`、私网地址、Sandbox 数据或生成文件
|
|
31
|
+
|
|
32
|
+
## 补充信息
|
|
33
|
+
|
|
34
|
+
如有迁移步骤、性能影响或后续工作,请在此说明。
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
quality:
|
|
10
|
+
strategy:
|
|
11
|
+
fail-fast: false
|
|
12
|
+
matrix:
|
|
13
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
14
|
+
python: ["3.11", "3.12", "3.13", "3.14"]
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: astral-sh/setup-uv@v6
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python }}
|
|
21
|
+
enable-cache: true
|
|
22
|
+
- run: uv sync --all-extras --dev --locked
|
|
23
|
+
- run: uv run ruff check .
|
|
24
|
+
- run: uv run pyright
|
|
25
|
+
- run: uv build
|
|
26
|
+
|
|
27
|
+
supply-chain:
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
- uses: astral-sh/setup-uv@v6
|
|
32
|
+
with:
|
|
33
|
+
python-version: "3.13"
|
|
34
|
+
- run: uv sync --all-extras --dev --locked
|
|
35
|
+
- run: >-
|
|
36
|
+
uv export --all-extras --no-dev --no-hashes --no-emit-project
|
|
37
|
+
--format requirements-txt --output-file audit-requirements.txt
|
|
38
|
+
- run: uvx pip-audit -r audit-requirements.txt
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
concurrency:
|
|
8
|
+
group: pypi-${{ github.event.release.tag_name }}
|
|
9
|
+
cancel-in-progress: false
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
name: Check and build distributions
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout release source
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
persist-credentials: false
|
|
23
|
+
|
|
24
|
+
- name: Install uv and Python
|
|
25
|
+
uses: astral-sh/setup-uv@v6
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.12"
|
|
28
|
+
enable-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: uv sync --all-extras --dev --locked
|
|
32
|
+
|
|
33
|
+
- name: Verify release tag
|
|
34
|
+
shell: bash
|
|
35
|
+
run: |
|
|
36
|
+
PACKAGE_VERSION="$(uv run python -c 'from agent_sandbox_backends import __version__; print(__version__)')"
|
|
37
|
+
if [ "v${PACKAGE_VERSION}" != "${{ github.event.release.tag_name }}" ]; then
|
|
38
|
+
echo "Release tag must be v${PACKAGE_VERSION}, got ${{ github.event.release.tag_name }}"
|
|
39
|
+
exit 1
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
- name: Run quality checks
|
|
43
|
+
run: |
|
|
44
|
+
uv run ruff check .
|
|
45
|
+
uv run pyright
|
|
46
|
+
|
|
47
|
+
- name: Build wheel and source distribution
|
|
48
|
+
run: uv build
|
|
49
|
+
|
|
50
|
+
- name: Upload distributions
|
|
51
|
+
uses: actions/upload-artifact@v4
|
|
52
|
+
with:
|
|
53
|
+
name: python-package-distributions
|
|
54
|
+
path: |
|
|
55
|
+
dist/*.whl
|
|
56
|
+
dist/*.tar.gz
|
|
57
|
+
if-no-files-found: error
|
|
58
|
+
|
|
59
|
+
publish:
|
|
60
|
+
name: Publish distributions to PyPI
|
|
61
|
+
needs: [build]
|
|
62
|
+
runs-on: ubuntu-latest
|
|
63
|
+
environment:
|
|
64
|
+
name: pypi
|
|
65
|
+
url: https://pypi.org/project/agent-sandbox-backends/
|
|
66
|
+
permissions:
|
|
67
|
+
id-token: write
|
|
68
|
+
|
|
69
|
+
steps:
|
|
70
|
+
- name: Download distributions
|
|
71
|
+
uses: actions/download-artifact@v4
|
|
72
|
+
with:
|
|
73
|
+
name: python-package-distributions
|
|
74
|
+
path: dist/
|
|
75
|
+
|
|
76
|
+
- name: Publish to PyPI
|
|
77
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
78
|
+
with:
|
|
79
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
本项目遵循语义化版本号。正式版本发布后,同一版本号不会重复构建或覆盖。
|
|
4
|
+
|
|
5
|
+
## 0.1.0 - 2026-07-20
|
|
6
|
+
|
|
7
|
+
- 首次公开版本,只支持 OpenSandbox Provider。
|
|
8
|
+
- 提供 `create_opensandbox_backend()` 高层入口。
|
|
9
|
+
- 默认使用 `python:3.12` 镜像和 Sandbox SQLite History。
|
|
10
|
+
- 支持生命周期、文件、命令、上传、下载和 Deep Agents Backend 适配。
|
|
11
|
+
- 支持 Actor、Thread、Run、Correlation 标识及 Web Console History 数据。
|
|
12
|
+
- 支持用户级多 Agent 并发限制、生命周期 Gate 和文件读写锁。
|
|
13
|
+
- 支持本地上传根目录限制、敏感文件排除、路径逃逸和归档安全检查。
|
|
14
|
+
- 支持 OpenSandbox 原生 Sandbox TTL 和独立 SDK 延迟清理 TTL。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## 参与原则
|
|
4
|
+
|
|
5
|
+
本项目欢迎不同经验、背景和观点的参与者。所有参与者都应:
|
|
6
|
+
|
|
7
|
+
- 使用尊重、清晰且针对问题本身的语言。
|
|
8
|
+
- 接受建设性反馈,并说明技术判断所依据的事实。
|
|
9
|
+
- 尊重隐私,不公开他人的凭证、私网信息、日志和 Sandbox 数据。
|
|
10
|
+
- 避免骚扰、歧视、威胁、人身攻击和持续干扰讨论。
|
|
11
|
+
- 在安全问题中优先保护用户,避免公开可直接利用的细节。
|
|
12
|
+
|
|
13
|
+
## 适用范围
|
|
14
|
+
|
|
15
|
+
该准则适用于仓库的 Issue、Pull Request、Discussion、Release、代码评审以及代表本项目进行的
|
|
16
|
+
其他公开或私下交流。
|
|
17
|
+
|
|
18
|
+
## 处理方式
|
|
19
|
+
|
|
20
|
+
维护者可以编辑或删除不符合准则的内容,限制参与者继续互动,或在必要时向 GitHub 平台报告。
|
|
21
|
+
处理时会尽量说明原因,并优先保护报告者和受影响用户的隐私。
|
|
22
|
+
|
|
23
|
+
## 报告问题
|
|
24
|
+
|
|
25
|
+
行为问题应通过仓库所有者 GitHub 主页提供的私下联系方式报告,不要在公开 Issue 中披露个人
|
|
26
|
+
信息。安全漏洞应按照 `SECURITY.md` 使用 Private vulnerability reporting 或 Security
|
|
27
|
+
Advisory 报告。
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
感谢参与 Agent Sandbox Backends 的开发。
|
|
4
|
+
|
|
5
|
+
## 开发环境
|
|
6
|
+
|
|
7
|
+
```powershell
|
|
8
|
+
uv sync --all-extras --dev
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 提交前检查
|
|
12
|
+
|
|
13
|
+
```powershell
|
|
14
|
+
uv run ruff check .
|
|
15
|
+
uv run pyright
|
|
16
|
+
uv run pytest -q
|
|
17
|
+
uv build
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
涉及 OpenSandbox 行为的修改还应运行:
|
|
21
|
+
|
|
22
|
+
```powershell
|
|
23
|
+
python scripts\deepagents_opensandbox_smoke.py
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
该脚本需要自行部署的 OpenSandbox Service,不应把真实 `.env`、API Key、私网地址或
|
|
27
|
+
Sandbox 数据提交到仓库。
|
|
28
|
+
|
|
29
|
+
## 修改原则
|
|
30
|
+
|
|
31
|
+
- 第一版只维护 OpenSandbox Provider。
|
|
32
|
+
- 优先修复根因,避免改变无关行为。
|
|
33
|
+
- 公共 API 变更必须补充类型、测试和 README。
|
|
34
|
+
- History Schema 变更必须同时确认 Web Console 的读取兼容性。
|
|
35
|
+
- 新增本地文件上传能力时必须保留默认拒绝和路径安全边界。
|