{"_id":"@drew-foxall/a2a-js-taskstore-upstash-redis","name":"@drew-foxall/a2a-js-taskstore-upstash-redis","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@drew-foxall/a2a-js-taskstore-upstash-redis","version":"0.1.0","description":"Upstash Redis (HTTP-based) task store adapter for A2A SDK","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"dependencies":{"@drew-foxall/a2a-js-taskstore-core":"0.1.0"},"peerDependencies":{"@upstash/redis":"^1.28.0"},"devDependencies":{"@upstash/redis":"^1.34.3","typescript":"^5.3.0"},"keywords":["a2a","agent2agent","taskstore","redis","upstash","edge","serverless"],"repository":{"type":"git","url":"git+https://github.com/drew-foxall/a2a-js-taskstore-adapters.git","directory":"packages/upstash-redis"},"license":"MIT","author":{"name":"Drew Foxall"},"gitHead":"c29e6995c6f6268c2c89c57bb212cba7cfb51125","_id":"@drew-foxall/a2a-js-taskstore-upstash-redis@0.1.0","bugs":{"url":"https://github.com/drew-foxall/a2a-js-taskstore-adapters/issues"},"homepage":"https://github.com/drew-foxall/a2a-js-taskstore-adapters#readme","_nodeVersion":"22.16.0","_npmVersion":"11.6.4","dist":{"integrity":"sha512-zOdjDSfDkuksAipaLk18pCUbiWAGHonbfvKjkNkIKt8jWKtk/gBnZtC1eWew8llOC+fm2R85XJt33NKQV5n46Q==","shasum":"95e47844f85b438fffeb11c6bfad28170de430ae","tarball":"https://registry.npmjs.org/@drew-foxall/a2a-js-taskstore-upstash-redis/-/a2a-js-taskstore-upstash-redis-0.1.0.tgz","fileCount":18,"unpackedSize":23370,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAsPt0wG6i7LT3XiUz9CaEOeyK69O1PqL0H801JTTXXZAiEAnyKLVPuRNnPFleIxof2XLWPIfM6GDBRX7f0gUkPthxE="}]},"_npmUser":{"name":"drew-foxall","email":"drew@foxalltogether.com"},"directories":{},"maintainers":[{"name":"drew-foxall","email":"drew@foxalltogether.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/a2a-js-taskstore-upstash-redis_0.1.0_1764769798789_0.04564537181939854"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-03T13:49:58.703Z","0.1.0":"2025-12-03T13:49:58.960Z","modified":"2025-12-03T13:49:59.249Z"},"maintainers":[{"name":"drew-foxall","email":"drew@foxalltogether.com"}],"description":"Upstash Redis (HTTP-based) task store adapter for A2A SDK","homepage":"https://github.com/drew-foxall/a2a-js-taskstore-adapters#readme","keywords":["a2a","agent2agent","taskstore","redis","upstash","edge","serverless"],"repository":{"type":"git","url":"git+https://github.com/drew-foxall/a2a-js-taskstore-adapters.git","directory":"packages/upstash-redis"},"author":{"name":"Drew Foxall"},"bugs":{"url":"https://github.com/drew-foxall/a2a-js-taskstore-adapters/issues"},"license":"MIT","readme":"# @drew-foxall/a2a-js-taskstore-upstash-redis\n\nUpstash Redis (HTTP-based) task store adapter for A2A SDK.\n\n## Installation\n\n```bash\npnpm add @drew-foxall/a2a-js-taskstore-upstash-redis @upstash/redis\n```\n\n## Features\n\n- **Edge-compatible**: HTTP-based Redis, works everywhere (Cloudflare Workers, Vercel Edge, Deno Deploy)\n- **No TCP required**: Uses REST API instead of TCP connections\n- **Global replication**: Upstash provides global read replicas\n- **TTL support**: Automatic expiration of entries\n- **Efficient storage**: Uses Redis Hash for push configs\n\n## Characteristics\n\n| Feature | Value |\n|---------|-------|\n| Consistency | Strong (single region), Eventual (global) |\n| Query flexibility | Medium |\n| Setup complexity | Low |\n| Best for | High-throughput, edge deployments |\n\n## Setup\n\n### 1. Create Upstash Redis Database\n\n1. Go to [Upstash Console](https://console.upstash.com/)\n2. Create a new Redis database\n3. Copy the REST URL and token\n\n### 2. Set Environment Variables\n\n```bash\nUPSTASH_REDIS_REST_URL=https://your-db.upstash.io\nUPSTASH_REDIS_REST_TOKEN=your-token\n```\n\n## Usage\n\n### Basic Setup\n\n```typescript\nimport { Redis } from '@upstash/redis';\nimport { UpstashRedisTaskStore, UpstashRedisPushNotificationStore } from '@drew-foxall/a2a-js-taskstore-upstash-redis';\n\nconst redis = new Redis({\n  url: process.env.UPSTASH_REDIS_REST_URL!,\n  token: process.env.UPSTASH_REDIS_REST_TOKEN!,\n});\n\nconst taskStore = new UpstashRedisTaskStore({ client: redis });\nconst pushStore = new UpstashRedisPushNotificationStore({ client: redis });\n```\n\n### With Hono on Cloudflare Workers\n\n```typescript\nimport { Hono } from 'hono';\nimport { Redis } from '@upstash/redis';\nimport { UpstashRedisTaskStore } from '@drew-foxall/a2a-js-taskstore-upstash-redis';\n\ntype Bindings = {\n  UPSTASH_REDIS_REST_URL: string;\n  UPSTASH_REDIS_REST_TOKEN: string;\n};\n\nconst app = new Hono<{ Bindings: Bindings }>();\n\napp.all('/a2a/*', async (c) => {\n  const redis = new Redis({\n    url: c.env.UPSTASH_REDIS_REST_URL,\n    token: c.env.UPSTASH_REDIS_REST_TOKEN,\n  });\n\n  const taskStore = new UpstashRedisTaskStore({ client: redis });\n\n  // Use with A2A SDK...\n});\n\nexport default app;\n```\n\n### With TTL\n\n```typescript\nconst taskStore = new UpstashRedisTaskStore({\n  client: redis,\n  ttlSeconds: 86400, // 24 hours\n});\n\nconst pushStore = new UpstashRedisPushNotificationStore({\n  client: redis,\n  ttlSeconds: 86400 * 7, // 7 days\n});\n```\n\n### With Custom Prefix\n\n```typescript\nconst taskStore = new UpstashRedisTaskStore({\n  client: redis,\n  prefix: 'myapp:prod:', // Results in keys like 'myapp:prod:task:123'\n});\n```\n\n## API Reference\n\n### UpstashRedisTaskStore\n\n```typescript\nclass UpstashRedisTaskStore implements TaskStore {\n  constructor(options: UpstashRedisTaskStoreOptions);\n\n  save(task: Task): Promise<void>;\n  load(taskId: string): Promise<Task | undefined>;\n  delete(taskId: string): Promise<void>;\n  exists(taskId: string): Promise<boolean>;\n  touch(taskId: string, ttlSeconds?: number): Promise<boolean>;\n  getTtl(taskId: string): Promise<number>;\n}\n```\n\n### UpstashRedisPushNotificationStore\n\n```typescript\nclass UpstashRedisPushNotificationStore implements PushNotificationStore {\n  constructor(options: UpstashRedisPushNotificationStoreOptions);\n\n  save(taskId: string, config: PushNotificationConfig): Promise<void>;\n  load(taskId: string): Promise<PushNotificationConfig[]>;\n  delete(taskId: string, configId?: string): Promise<void>;\n  deleteAll(taskId: string): Promise<void>;\n  count(taskId: string): Promise<number>;\n  exists(taskId: string, configId: string): Promise<boolean>;\n}\n```\n\n## Configuration Options\n\n```typescript\ninterface UpstashRedisTaskStoreOptions {\n  // Required\n  client: Redis;\n\n  // Optional\n  prefix?: string;      // Default: 'a2a:'\n  ttlSeconds?: number;  // TTL for entries\n}\n```\n\n## Redis Key Structure\n\n### Tasks\n- Key: `{prefix}task:{taskId}`\n- Type: String (JSON)\n\n### Push Notifications\n- Key: `{prefix}push:{taskId}`\n- Type: Hash\n- Fields: `{configId}` → JSON config\n\n## License\n\nMIT\n\n","readmeFilename":"README.md","_rev":"1-ee323bf337ec2a5f9f24934c7ee6b440"}