storage Package

Durable state-store client for AgentServer.

Classes

DeletedStateStore

Response for deleteStateStore (spec §4.1.5). Idempotent.

DeletedStateStoreItem

Response for deleteItem (spec §4.2.4). Idempotent.

FoundryStateStore

Note

This is an experimental class, and may change at any time.

Developer-facing client for one explicit Foundry state store.

The instance is bound to a single caller-chosen store name. Session or conversation scoping is expressed by encoding that identity into the store name itself (for example checkpoints/<conversation-id>), matching spec PR 247's removal of built-in session isolation.

Prefer get_or_create over the constructor: it resolves (or creates) the store's server-side resource in one call, so you never need a separate lifecycle step before reading or writing items:


   store = await FoundryStateStore.get_or_create("checkpoints/thread-abc")
   await store.set_item("step-1", {"done": False})

Store-level operations (get, update, delete) act on the bound store itself. The explicit *_item methods (create_item, get_item, set_item, delete_item, list_keys) act on individual items within it.

Create a store-bound durable state-store client.

Prefer get_or_create, which also resolves the server-side store resource; use the constructor directly only when you already know the store exists and want to skip that round trip.

FoundryStorageApiError

Note

This is an experimental class, and may change at any time.

Raised for all other non-success HTTP responses.

FoundryStorageBadRequestError

Note

This is an experimental class, and may change at any time.

Raised for invalid-request errors (HTTP 400).

FoundryStorageClient

Note

This is an experimental class, and may change at any time.

Base HTTP client for the Foundry storage API.

FoundryStorageConflictError

Note

This is an experimental class, and may change at any time.

Raised when the requested create/update conflicts with an existing resource (HTTP 409).

FoundryStorageEndpoint

Note

This is an experimental class, and may change at any time.

Immutable Foundry storage endpoint configuration.

FoundryStorageError

Note

This is an experimental class, and may change at any time.

Base class for errors returned by the Foundry storage API.

FoundryStorageNotFoundError

Note

This is an experimental class, and may change at any time.

Raised when the requested resource does not exist (HTTP 404).

FoundryStoragePreconditionError

Note

This is an experimental class, and may change at any time.

Raised when an If-Match precondition fails on a single-item write.

StateStore

A first-class, explicitly-created durable key-value store (spec §2, §4.1).

StateStoreItem

A single key -> value record within a state store (spec §2, §4.2).

StateStoreItemKey

A keys-only projection entry returned by listKeys (spec §4.2.5) – never includes value.

StateStoreItemKeyPage

A page of keys returned by list_keys.

A hand-written convenience wrapper (not itself part of the wire contract) over the generated ListResponseStateStoreItemKey envelope, exposing its data array as keys to match this client's naming.

StateStoreItemRef

Response for createItem / putItem (spec §4.2.1/§4.2.2) — server metadata only, no value echoed back.