refactor(skill): transition from artifact set to bundle structure

- Replaced SkillArtifactSet with SkillBundle across various components, enhancing the organization of skill dependencies and references.
- Updated SkillManager methods to load and save bundles instead of artifacts, improving clarity in asset management.
- Refactored SkillCompiler to compile skills into bundles, streamlining the dependency resolution process.
- Adjusted DifyCli and SandboxBashSession to utilize ToolDependencies, ensuring consistent handling of tool references.
- Introduced AssetReferences for better management of file dependencies within skill bundles.
This commit is contained in:
Harry
2026-01-22 20:25:28 +08:00
parent 17404e0956
commit a43efef9f0
17 changed files with 158 additions and 194 deletions

View File

@ -24,13 +24,20 @@ class SkillInitializer(SyncSandboxInitializer):
self._user_id = user_id
self._assets_id = assets_id
def initialize(self, env: Sandbox) -> None:
artifact_set = SkillManager.load_artifact(
def initialize(self, sandbox: Sandbox) -> None:
bundle = SkillManager.load_bundle(
self._tenant_id,
self._app_id,
self._assets_id,
)
env.attrs.set(
SkillAttrs.ARTIFACT_SET,
artifact_set,
if bundle is None:
raise ValueError(
f"No skill bundle found for tenant_id={self._tenant_id}, "
f"app_id={self._app_id}, "
f"assets_id={self._assets_id}"
)
sandbox.attrs.set(
SkillAttrs.BUNDLE,
bundle,
)