dify/api/core/zip_sandbox
Harry 65e89520c0 refactor: unify download item types and eliminate extension-based branching
Merge AssetDownloadItem, AssetInlineItem into SandboxDownloadItem with
optional 'content' field. All consumers now follow a clean pipeline:
  get items → accessor.resolve_items() → AppAssetService.to_download_items() → download

Key changes:
- SandboxDownloadItem gains content: bytes | None (entities.py)
- ZipSandbox.download_items() handles both inline (base64 heredoc) and
  remote (curl) via a single pipeline — no structural branching
- AssetDownloadService.build_download_script() takes unified list
- CachedContentAccessor.resolve_items() batch-enriches items from DB
  (extension-agnostic, no 'if md' checks needed)
- AppAssetService.to_download_items() converts AssetItem → SandboxDownloadItem
- DraftAppAssetsInitializer, package_and_upload, export_bundle simplified
- file_upload/node.py switched to SandboxDownloadItem
- Deleted AssetDownloadItem and AssetInlineItem classes
2026-03-10 17:12:15 +08:00
..
__init__.py refactor: unify download item types and eliminate extension-based branching 2026-03-10 17:12:15 +08:00
cli_strategy.py feat(sandbox-zip-service): using sandbox to zip files 2026-01-27 14:19:27 +08:00
entities.py refactor: unify download item types and eliminate extension-based branching 2026-03-10 17:12:15 +08:00
node_strategy.py feat(sandbox-zip-service): using sandbox to zip files 2026-01-27 14:19:27 +08:00
python_strategy.py feat(sandbox-zip-service): using sandbox to zip files 2026-01-27 14:19:27 +08:00
strategy.py feat(sandbox-zip-service): using sandbox to zip files 2026-01-27 14:19:27 +08:00
zip_sandbox.py refactor: unify download item types and eliminate extension-based branching 2026-03-10 17:12:15 +08:00