-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathindex.ts
More file actions
73 lines (66 loc) · 2.44 KB
/
index.ts
File metadata and controls
73 lines (66 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* @a2a-js/sdk/server/distributed
*
* Drop-in replacements for the default in-process components when deploying
* the A2A server across multiple instances (ECS Fargate, Kubernetes, etc.).
*
* This sub-path is intentionally kept separate from `@a2a-js/sdk/server` so
* that single-instance deployments incur zero AWS SDK dependency weight.
* Install the peer dependencies only when you use this sub-path:
*
* ```bash
* npm install @aws-sdk/client-dynamodb @aws-sdk/lib-dynamodb \
* @aws-sdk/client-sns @aws-sdk/client-sqs
* ```
*
* Typical wiring:
*
* ```typescript
* import {
* DynamoDBTaskStore,
* QueueLifecycleManager,
* SnsEventBusManager,
* } from '@a2a-js/sdk/server/distributed';
*
* const lifecycle = new QueueLifecycleManager({ snsTopicArn, sqsClient, snsClient });
* const { queueUrl, instanceId } = await lifecycle.provision();
*
* const eventBusManager = new SnsEventBusManager({
* snsTopicArn, sqsQueueUrl: queueUrl, instanceId, snsClient, sqsClient,
* });
* eventBusManager.start();
*
* const requestHandler = new DefaultRequestHandler(
* agentCard,
* new DynamoDBTaskStore({ client: dynamoDocClient, tableName }),
* executor,
* eventBusManager,
* );
* ```
*
* @module @a2a-js/sdk/server/distributed
*/
// ── Persistent task store (DynamoDB) ─────────────────────────────────────────
export { DynamoDBTaskStore } from '../store/dynamo_task_store.js';
export type { DynamoTaskStoreConfig } from '../store/dynamo_task_store.js';
// Typed error hierarchy — callers can catch by class and inspect `.retryable`
// to decide whether to surface the error or transparently retry upstream.
export {
TaskStoreError,
TaskNotFoundError,
TaskConflictError,
StoreUnavailableError,
} from '../store/errors.js';
// ── Per-instance queue lifecycle (SQS + SNS subscription) ────────────────────
export { QueueLifecycleManager } from '../events/queue_lifecycle_manager.js';
export type {
QueueLifecycleConfig,
QueueProvisionResult,
} from '../events/queue_lifecycle_manager.js';
// ── Distributed event bus manager (SNS fan-out → SQS per-instance delivery) ──
export {
SnsEventBusManager,
DistributedExecutionEventBus,
SqsEventPoller,
} from '../events/sns_sqs_event_bus_manager.js';
export type { SnsEventBusConfig } from '../events/sns_sqs_event_bus_manager.js';