> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentium.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Durable delivery

> Public durable delivery signatures and configuration in @agentium/queue 4.0.0.

Import these **6 exports** from `@agentium/queue`. Read the [durable delivery guide](/queue/durable) for setup and behavior, or return to the [package reference](/api-reference/queue).

A `?` marks an optional field. These are declarations for lookup; run the examples in the linked guide. Follow related-type links for Agentium types and source links for imported dependency types.

## DurableAgentQueue

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/queue/src/durable.ts)

```typescript theme={null}
/** Queue delivery is a hint; Mongo/another atomic task store owns authoritative state.
 * Persistence precedes enqueue. If Redis fails, call wake() after retrying admission.
 * The stable task key prevents a delivery retry from creating a second execution.
 */
export declare class DurableAgentQueue {
    constructor(config: DurableQueueConfig);
    enqueue(task: DurableTaskInput): Promise<{
        taskId: string;
        deliveryId: string;
    }>;
    /** Explicit re-delivery after approval, reconciliation, or a failed initial enqueue. */
    wake(key: DurableTaskKey): Promise<{
        taskId: string;
        deliveryId: string;
    }>;
    cancel(key: DurableTaskKey, reason?: string): Promise<void>;
    close(): Promise<void>;
}
```

Related: [`DurableQueueConfig`](/api-reference/queue/durable#durablequeueconfig), [`DurableTaskInput`](/api-reference/core/durable#durabletaskinput), [`DurableTaskKey`](/api-reference/core/durable#durabletaskkey).

## DurableAgentWorker

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/queue/src/durable.ts)

```typescript theme={null}
export declare class DurableAgentWorker {
    constructor(config: DurableWorkerConfig);
    /** Drains owned work. Active durable cancellation is explicit through queue.cancel(). */
    stop(): Promise<void>;
}
```

Related: [`DurableWorkerConfig`](/api-reference/queue/durable#durableworkerconfig).

## DurableDriverRegistration

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/queue/src/durable.ts)

```typescript theme={null}
export interface DurableDriverRegistration {
    id: string;
    version: number;
    /** Explicit host assertion: resumes use stable action IDs and reconcile uncertain effects. */
    recoverable: true;
    execute: DurableTaskHandler;
}
```

Related: [`DurableTaskHandler`](/api-reference/core/durable#durabletaskhandler).

## DurableJobEnvelope

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/queue/src/durable.ts)

```typescript theme={null}
export interface DurableJobEnvelope {
    schemaVersion: 1;
    type: "durable";
    tenantId: string;
    taskId: string;
    inputDigest: string;
}
```

## DurableQueueConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/queue/src/durable.ts)

```typescript theme={null}
export interface DurableQueueConfig extends QueueConfig {
    supervisor: DurableTaskSupervisor;
    /** Verify identity, definition, policy and grants before writing any task/queue record. */
    admit: (task: Readonly<DurableTaskInput>) => Promise<void>;
}
```

Related: [`DurableTaskInput`](/api-reference/core/durable#durabletaskinput), [`DurableTaskSupervisor`](/api-reference/core/durable#durabletasksupervisor), [`QueueConfig`](/api-reference/queue/producer#queueconfig).

## DurableWorkerConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/queue/src/durable.ts)

```typescript theme={null}
export interface DurableWorkerConfig extends Omit<QueueConfig, "defaultJobOptions"> {
    supervisor: DurableTaskSupervisor;
    workerId?: string;
    concurrency?: number;
    drivers: readonly DurableDriverRegistration[];
    /** Revalidate policy/grants from authoritative host state; a payload is not authentication. */
    admit: (task: Readonly<DurableTaskRecord>) => Promise<void>;
    /** Observe delivery failures; durable task outcome remains available from the store. */
    onError?: (error: Error) => void;
}
```

Related: [`DurableDriverRegistration`](/api-reference/queue/durable#durabledriverregistration), [`DurableTaskRecord`](/api-reference/core/durable#durabletaskrecord), [`DurableTaskSupervisor`](/api-reference/core/durable#durabletasksupervisor), [`QueueConfig`](/api-reference/queue/producer#queueconfig).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.