bundle_packager.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package bundle_packager
  2. import (
  3. "github.com/langgenius/dify-plugin-daemon/internal/types/entities/bundle_entities"
  4. "github.com/langgenius/dify-plugin-daemon/internal/types/entities/manifest_entities"
  5. )
  6. type BundlePackager interface {
  7. // Export exports the bundle to a zip byte array
  8. Export() ([]byte, error)
  9. // Save saves the bundle to the original source
  10. Save() error
  11. // Manifest returns the manifest of the bundle
  12. Manifest() (*bundle_entities.Bundle, error)
  13. // Remove removes a dependency from the bundle
  14. Remove(index int) error
  15. // Append Github Dependency appends a github dependency to the bundle
  16. AppendGithubDependency(repoPattern bundle_entities.GithubRepoPattern)
  17. // Append Marketplace Dependency appends a marketplace dependency to the bundle
  18. AppendMarketplaceDependency(marketplacePattern bundle_entities.MarketplacePattern)
  19. // Append Package Dependency appends a local package dependency to the bundle
  20. AppendPackageDependency(packagePath string) error
  21. // ListDependencies lists all the dependencies of the bundle
  22. ListDependencies() ([]bundle_entities.Dependency, error)
  23. // Regenerate regenerates the bundle, replace the basic information of the bundle like name, labels, description, icon, etc.
  24. Regenerate(bundle bundle_entities.Bundle) error
  25. // BumpVersion bumps the version of the bundle
  26. BumpVersion(targetVersion manifest_entities.Version)
  27. // FetchAsset fetches the asset of the bundle
  28. FetchAsset(path string) ([]byte, error)
  29. }