Skip to content
← Capabilities Overview Standard System Resources →

Resource Abstraction Model

(This document is a placeholder. It will detail the design of the base Resource class in Python, how resources are configured, their lifecycle within the SandboxContext, and the conventions for defining their methods to be callable from Dana.)

Key Aspects to Detail:

  • Base Resource Class (Python):
  • Core attributes (e.g., name, resource_type, status).
  • Initialization (__init__): How configuration is passed and processed.
  • Lifecycle methods (e.g., setup(), teardown(), health_check()).
  • Error handling and reporting mechanisms.
  • Abstract methods or conventions for exposing capabilities.
  • Resource Configuration:
  • How configuration data is provided (e.g., via SandboxContext system:resource_config scope, dedicated config files, environment variables).
  • Schema for resource configuration.
  • Handling of secrets (API keys, passwords).
  • Dynamic reconfiguration (if supported).
  • Resource Lifecycle and Management:
  • Registration of resources with the SandboxContext or a ResourceManager.
  • Instantiation: When and how resources are created (e.g., on-demand, at sandbox startup).
  • State management within a resource instance.
  • Scoping of resources (e.g., session-global, agent-specific).
  • Cleanup and release of resources.
  • Defining Resource Methods (Python functions callable from Dana):
  • Naming conventions for methods exposed to Dana.
  • Type handling: How Python types in method signatures map to Dana types (and vice-versa for return values).
  • Serialization/deserialization of complex data (e.g., Dana structs to Python dicts/objects).
  • Context passing: How/if the SandboxContext or a subset of it is available to resource methods.
  • Error propagation: How Python exceptions in resource methods are translated to Dana errors.
  • Decorators or other mechanisms for marking methods as Dana-callable and defining their Dana-facing signature (if different from Python signature).
  • Asynchronous Operations: How resources handle non-blocking calls (e.g., for I/O bound tasks like API requests).
  • Use of async/await in resource methods.
  • Interaction with Dana's concurrency model.
  • Resource Versioning (Future Consideration): How different versions of a resource or its provided capabilities are managed.