dify/api/services
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
..
auth chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
document_indexing_proxy feat: enable tenant isolation on duplicate document indexing tasks (#29080) 2025-12-08 17:54:57 +08:00
enterprise refactor(api): tighten types for Tenant.custom_config_dict and MCPToolProvider.headers (#34698) 2026-04-08 01:36:42 +00:00
entities refactor(api): remove duplicated RAG entities from services layer (#34689) 2026-04-07 23:36:59 +00:00
errors fix: enterprise API error handling and license enforcement (#33044) 2026-03-15 20:59:41 -07:00
plugin refactor: migrate session.query to select API in sync task and services (#34619) 2026-04-07 04:23:14 +00:00
rag_pipeline refactor: select in rag_pipeline (#34495) 2026-04-03 03:42:01 +00:00
recommend_app refactor: select in 13 small service files (#34371) 2026-04-01 04:00:05 +00:00
retention refactor(api): type workflow run related counts with RelatedCountsDict TypedDict (#34530) 2026-04-06 13:17:01 +00:00
sandbox feat(api): port Sandbox + VirtualEnvironment + Skill system from feat/support-agent-sandbox (Phase 5-6) 2026-04-08 17:39:02 +08:00
tools refactor(api): replace json.loads with Pydantic validation in security and tools layers (#34380) 2026-04-07 12:11:51 +00:00
trigger refactor(api): type webhook validation result and workflow inputs with TypedDict (#34645) 2026-04-07 05:57:02 +00:00
workflow feat(api): add Agent V2 node and new Agent app type (Phase 1-3) 2026-04-08 12:31:23 +08:00
__init__.py chore(api/services): apply ruff reformatting (#7599) 2024-08-26 13:43:57 +08:00
account_service.py refactor(api): type invitation detail with InvitationDetailDict TypedDict (#34613) 2026-04-07 01:03:31 +00:00
advanced_prompt_template_service.py refactor: convert AppMode if/elif to match/case in service files (#30001) (#34562) 2026-04-05 10:22:11 +00:00
agent_service.py refactor: select in 10 service files (#34373) 2026-04-01 08:03:49 +00:00
annotation_service.py refactor: select in annotation_service (#34503) 2026-04-03 22:47:22 +00:00
api_based_extension_service.py refactor: select in 10 service files (#34373) 2026-04-01 08:03:49 +00:00
api_token_service.py fix: redis for api token (#31861) 2026-02-06 16:25:27 +08:00
app_asset_service.py feat(api): port Sandbox + VirtualEnvironment + Skill system from feat/support-agent-sandbox (Phase 5-6) 2026-04-08 17:39:02 +08:00
app_bundle_service.py feat(api): port Sandbox + VirtualEnvironment + Skill system from feat/support-agent-sandbox (Phase 5-6) 2026-04-08 17:39:02 +08:00
app_dsl_service.py feat(api): add Agent V2 node and new Agent app type (Phase 1-3) 2026-04-08 12:31:23 +08:00
app_generate_service.py fix(api): resolve Agent V2 node E2E runtime issues 2026-04-08 16:21:12 +08:00
app_model_config_service.py refactor: convert AppMode if/elif to match/case in service files (#30001) (#34562) 2026-04-05 10:22:11 +00:00
app_service.py feat(api): add Agent V2 node and new Agent app type (Phase 1-3) 2026-04-08 12:31:23 +08:00
app_task_service.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
async_workflow_service.py refactor(api): replace dict/Mapping with TypedDict in trigger.py and workflow.py (#33562) 2026-03-17 13:14:42 +09:00
attachment_service.py refactor: migrate session.query to select API in sync task and services (#34619) 2026-04-07 04:23:14 +00:00
audio_service.py refactor: select in 13 small service files (#34371) 2026-04-01 04:00:05 +00:00
billing_service.py refactor(api): migrate dict returns to TypedDicts in billing service (#34649) 2026-04-07 05:56:02 +00:00
clear_free_plan_tenant_expired_logs.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
code_based_extension_service.py remove bare list, dict, Sequence, None, Any (#25058) 2025-09-06 03:32:23 +08:00
conversation_service.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
conversation_variable_updater.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
credit_pool_service.py refactor: select in 13 small service files (#34371) 2026-04-01 04:00:05 +00:00
dataset_service.py refactor(api): type dataset service dicts with TypedDict (#34625) 2026-04-07 02:10:52 +00:00
datasource_provider_service.py refactor: select in datasource_provider_service (#34548) 2026-04-05 00:12:15 +00:00
end_user_service.py refactor: migrate session.query to select API in end_user_service and small tasks (#34620) 2026-04-07 04:25:55 +00:00
external_knowledge_service.py refactor(api): migrate consumers to shared RAG domain entities from core/rag/entities/ (#34692) 2026-04-07 23:22:56 +00:00
feature_service.py fix: enterprise API error handling and license enforcement (#33044) 2026-03-15 20:59:41 -07:00
feedback_service.py refactor: select in 10 service files (#34373) 2026-04-01 08:03:49 +00:00
file_service.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
hit_testing_service.py refactor(api): remove duplicated RAG entities from services layer (#34689) 2026-04-07 23:36:59 +00:00
human_input_delivery_test_service.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
human_input_service.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
knowledge_service.py refactor: replace dict with BedrockRetrievalSetting BaseModel in knowledge_service (#34080) 2026-03-25 21:33:24 +09:00
message_service.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
metadata_service.py refactor: select in metadata_service (#34479) 2026-04-02 12:34:38 +00:00
model_load_balancing_service.py refactor(api): type load balancing config dicts with TypedDict (#34639) 2026-04-07 05:58:10 +00:00
model_provider_service.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
oauth_server.py use deco to avoid current_user (#26077) 2025-10-16 15:45:51 +09:00
operation_service.py more httpx (#25651) 2025-09-22 23:07:09 +08:00
ops_service.py refactor(api): type OpsTraceProviderConfigMap with TracingProviderCon… (#34424) 2026-04-02 01:47:08 +00:00
recommended_app_service.py refactor: select in 10 service files (#34373) 2026-04-01 08:03:49 +00:00
saved_message_service.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
summary_index_service.py refactor(api): type document summary status detail with TypedDict (#34610) 2026-04-07 01:00:39 +00:00
tag_service.py refactor: replace dict params with BaseModel payloads in TagService (#34422) 2026-04-07 04:20:02 +00:00
variable_truncator.py test: add unit tests for services and tasks part-4 (#33223) 2026-04-02 08:35:46 +00:00
vector_service.py refactor(api): remove duplicated RAG entities from services layer (#34689) 2026-04-07 23:36:59 +00:00
web_conversation_service.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
webapp_auth_service.py refactor: select in 13 small service files (#34371) 2026-04-01 04:00:05 +00:00
website_service.py refactor(api): type crawl status dicts with CrawlStatusDict TypedDict (#34611) 2026-04-07 01:01:04 +00:00
workflow_app_service.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
workflow_draft_variable_service.py chore: normalize frozenset literals and myscale typing (#34327) 2026-03-31 08:21:22 +00:00
workflow_event_snapshot_service.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
workflow_restore.py fix: adding a restore API for version control on workflow draft (#33582) 2026-03-20 14:54:23 +08:00
workflow_run_service.py feat(api): Introduce workflow pause state management (#27298) 2025-10-30 14:41:09 +08:00
workflow_service.py fix(api): allow AGENT mode in workflow features validation 2026-04-08 13:19:59 +08:00
workspace_service.py refactor: select in 13 small service files (#34371) 2026-04-01 04:00:05 +00:00