feat: implement ADR-007 subscription transport — PendingRequestMap.subscribe(), CallHandler dispatch, SSE AsyncGenerator handlers

Add remote subscription support so spokes can consume streaming operations
over pubsub transports (WebSocket, Redis). Extract checkAccess to access.ts
to break circular dep between call.ts and subscribe.ts.
This commit is contained in:
glm-5.1 committed 2026-05-16 06:03:21 +00:00
1 parent 5ec6c380a7
commit 92936f4232
14 files changed
+907 -106

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
---
status: draft
last_updated: 2026-05-11
status: stable
last_updated: 2026-05-16
---
# Adapters
+2 -2
View File
@@ -1,6 +1,6 @@
---
status: draft
last_updated: 2026-05-11
status: stable
last_updated: 2026-05-16
---
# API Surface
+2 -2
View File
@@ -1,6 +1,6 @@
---
status: draft
last_updated: 2026-05-11
status: stable
last_updated: 2026-05-16
---
# Call Protocol
@@ -1,6 +1,6 @@
---
status: draft
last_updated: 2026-05-13
status: accepted
last_updated: 2026-05-16
---
# ADR-007: Subscription Transport for SSE and Remote Streaming
+5 -5
View File
@@ -1,6 +1,6 @@
---
status: draft
last_updated: 2026-05-11
status: stable
last_updated: 2026-05-16
---
# Response Envelopes
@@ -514,9 +514,9 @@ The following **code** changes are pending:
| Code | Change | Status |
|------|--------|--------|
| `src/from_openapi.ts` | Generate `SubscriptionHandler` (AsyncGenerator) for SUBSCRIPTION operations, parse SSE stream, yield per-event | ❌ Not started |
| `src/call.ts` | Add `PendingRequestMap.subscribe()` method using Repeater from `@alkdev/pubsub` | ❌ Not started |
| `src/call.ts` | Update `CallHandler` to dispatch on operation type | ❌ Not started |
| `src/from_openapi.ts` | Generate `SubscriptionHandler` (AsyncGenerator) for SUBSCRIPTION operations, parse SSE stream, yield per-event | ✅ Implemented |
| `src/call.ts` | Add `PendingRequestMap.subscribe()` method using Repeater from `@alkdev/pubsub` | ✅ Implemented |
| `src/call.ts` | Update `CallHandler` to dispatch on operation type | ✅ Implemented |
| `src/subscribe.ts` | Ensure `subscribe()` handles `httpEnvelope` detection for SSE yields | ✅ Already handles envelopes |
## References