dify/api/libs
Yansong Zhang 0c7e7e0c4e feat(api): port Sandbox + VirtualEnvironment + Skill system from feat/support-agent-sandbox (Phase 5-6)
Port the complete infrastructure for agent sandbox execution and skill system:

Sandbox & Virtual Environment (core/sandbox/, core/virtual_environment/):
- Sandbox entity with lifecycle management (ready/failed/cancelled states)
- SandboxBuilder with fluent API for configuring providers
- 5 VM providers: Local, SSH, Docker, E2B, AWS CodeInterpreter
- VirtualEnvironment base with command execution, file transfer, transport layers
- Channel transport: pipe, queue, socket implementations
- Bash session management and DifyCli binary integration
- Storage: archive storage, file storage, noop storage, presign storage
- Initializers: DifyCli, AppAssets, DraftAppAssets, Skills
- Inspector: file browser, archive/runtime source, script utils
- Security: encryption utils, debug helpers

Skill & App Assets (core/skill/, core/app_assets/, core/app_bundle/):
- Skill entity and manager
- App asset accessor, builder pipeline (file, skill builders)
- App bundle source zip extractor
- Storage and converter utilities

API Endpoints:
- CLI API blueprint (controllers/cli_api/) for sandbox callback
- Sandbox provider management (workspace/sandbox_providers)
- Sandbox file browser (console/sandbox_files)
- App asset management (console/app/app_asset)
- Skill management (console/app/skills)
- Storage file endpoints (controllers/files/storage_files)

Services:
- Sandbox service, provider service, file service
- App asset service, app bundle service

Config:
- CliApiConfig, CreatorsPlatformConfig, CollaborationConfig
- FILES_API_URL for sandbox file access

Note: Controller route registration temporarily commented out (marked TODO)
pending resolution of deep dependency chains (socketio, workflow_comment,
command node, etc.). Core sandbox modules are fully ported and syntax-validated.
110 files changed, 10,549 insertions.

Made-with: Cursor
2026-04-08 17:39:02 +08:00
..
broadcast_channel fix(api): fix concurrency issues in StreamsBroadcastChannel (#34061) 2026-03-25 15:47:31 +08:00
__init__.py chore: apply ruff rules on tests and app.py (#3605) 2024-04-18 20:24:05 +08:00
archive_storage.py feat: archive workflow run logs backend (#31310) 2026-01-23 13:11:56 +08:00
attr_map.py feat(api): port Sandbox + VirtualEnvironment + Skill system from feat/support-agent-sandbox (Phase 5-6) 2026-04-08 17:39:02 +08:00
collection_utils.py chore: normalize frozenset literals and myscale typing (#34327) 2026-03-31 08:21:22 +00:00
custom_inputs.py Feat/add status filter to workflow runs (#26850) 2025-10-18 12:15:29 +08:00
datetime_utils.py refactor(api): continue decoupling dify_graph from API concerns (#33580) 2026-03-25 20:32:24 +08:00
db_migration_lock.py fix(api): make DB migration Redis lock TTL configurable and prevent LockNotOwnedError from masking failures (#32299) 2026-02-14 14:55:05 +08:00
email_i18n.py chore: use from __future__ import annotations (#30254) 2026-01-06 23:57:20 +09:00
email_template_renderer.py feat: Human Input Node (#32060) 2026-02-09 14:57:23 +08:00
encryption.py fix: Login secret text transmission (#29659) 2025-12-16 16:55:51 +08:00
exception.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
external_api.py feat(refactoring): Support Structured Logging (JSON) (#30170) 2026-01-04 11:46:46 +08:00
file_utils.py refactor: define the Dify project version in pyproject.toml (#20910) 2025-07-01 12:07:24 +08:00
flask_utils.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
gmpy2_pkcs10aep_cipher.py chore(typing): reduce ty excludes for A1 (#31721) 2026-01-30 02:38:57 +08:00
helper.py refactor(api): replace json.loads with Pydantic validation in security and tools layers (#34380) 2026-04-07 12:11:51 +00:00
infinite_scroll_pagination.py chore(api/libs): Apply ruff format. (#7301) 2024-08-15 17:53:12 +08:00
json_in_md_parser.py Fix json in md when use quesion classifier node (#26992) 2025-10-18 11:58:40 +08:00
login.py refactor(api): tighten login and wrapper typing (#34447) 2026-04-02 09:36:58 +00:00
module_loading.py refactor(api): tighten phase 1 shared type contracts (#33453) 2026-03-17 17:50:51 +08:00
oauth_data_source.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
oauth.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
orjson.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
passport.py chore: apply ty checks on api code with script and ci action (#24653) 2025-09-02 16:05:13 +08:00
password.py Feat/new login (#8120) 2024-10-21 10:03:40 +08:00
pyrefly_diagnostics.py fix(ci): make pyrefly diff comments focus on diagnostics (#32778) 2026-03-02 10:11:23 +08:00
rsa.py fix: resolve Windows path separator issue in Huawei OBS operations (#23475) 2025-08-07 21:17:46 +08:00
schedule_utils.py refactor(api): continue decoupling dify_graph from API concerns (#33580) 2026-03-25 20:32:24 +08:00
sendgrid.py rm type ignore (#25715) 2025-10-21 11:26:58 +08:00
smtp.py feat: allow pass hostname in docker env (#30975) 2026-01-14 19:30:37 +08:00
time_parser.py Feat/add status filter to workflow runs (#26850) 2025-10-18 12:15:29 +08:00
token.py feat: allow admin api key to bypass csrf validation (#29139) 2025-12-08 10:22:57 +08:00
typing.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
uuid_utils.py feat(api): add UUIDv7 implementation in SQL and Python (#22058) 2025-07-16 13:07:08 +08:00
validators.py Exclude tests directory from pyright type checking (#26496) 2025-10-02 18:51:36 +08:00
workspace_permission.py feat: implement workspace permission checks for member invitations an… (#31202) 2026-01-18 19:35:50 -08:00