Implement durable-streams with Node.js runtime#35
Open
jonastemplestein wants to merge 15 commits intomainfrom
Open
Implement durable-streams with Node.js runtime#35jonastemplestein wants to merge 15 commits intomainfrom
jonastemplestein wants to merge 15 commits intomainfrom
Conversation
Complete durable-streams implementation with three layers: - Stream (persistence, append/subscribe) - StreamManager (multi-stream coordination) - HTTP routes (REST + SSE endpoints) Migrate from Bun to Node.js: - Use @effect/platform-node for HTTP server - Use tsx for TypeScript execution - Add native fetch e2e tests alongside Effect tests 38 tests passing (stream, manager, Effect HTTP, native fetch e2e). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Remove bun.lock, add pnpm-lock.yaml - Update scripts to use pnpm instead of npm/bun - Remove @effect/platform-bun dependency - Update CLAUDE.md docs with pnpm commands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- New daemon.ts: DaemonService for process management (start/stop/restart/status) - New client.ts: HTTP client with SSE parsing and auto-daemon support - New README.md: Design docs, architecture, CLI reference, tmux testing guide - Rewrite cli.ts with server and stream subcommand groups - Update main.ts with proper layer composition CLI structure: server run/start/stop/restart/status stream subscribe/append/list/delete 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Storage.FileSystem adapter for persistent event storage - Events stored in .iterate/streams/*.json - Each stream gets its own JSON file - Update daemon to use .iterate/ for all runtime files - PID, port, and log files now in .iterate/ - Add stream get CLI command for fetching historic events - One-shot fetch (vs subscribe which waits for live events) - Supports --offset and --limit options - Add GET /streams/:name/events HTTP endpoint - Returns historic events without SSE streaming - Supports offset and limit query params - Add StreamManagerService.Live layer - Properly injects Storage dependency - FileSystem storage used in production server - Write e2e test proving persistence across server restarts - Events survive server stop/start - Offsets continue monotonically after restart - Update README with new commands and file locations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@effect/cli requires options to come before positional arguments. Updated all CLI examples in Stream Commands and tmux sections. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Server commands now accept --storage [memory|fs] (default: fs): - memory: Volatile in-memory storage for testing - fs: Persistent file-based storage in .iterate/streams/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All stream commands now use -n/--name for stream name: stream append -n mystream -m "hello" stream get -n mystream stream subscribe -n mystream stream delete -n mystream Also changed limit option from -n to -l to avoid conflict. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes CI failures by replacing all Bun-specific platform imports with Node.js equivalents: - BunContext → NodeContext - BunRuntime → NodeRuntime - BunHttpServer → NodeHttpServer - BunStream → native Node.js stdin handling Test files updated to use `npx tsx` instead of `bun` for CLI execution. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The body property can be undefined, but with exactOptionalPropertyTypes enabled, we can't pass undefined to fetch()'s body. Fix by conditionally spreading the body property only when defined. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add proper server ready polling with timeout instead of fixed sleep - Fix script path resolution using import.meta.url for daemon spawn - Better error messages for connection failures 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add comprehensive architecture-sketch.md documenting: - Event design with source-based namespacing - Harness bridge architecture (hooks-based, not translation) - Concrete bridge implementations for OpenCode, Claude Code, Pi - 24 open questions with multiple solutions per domain - Recommendations summary table - Add hooks system to durable-streams: - BeforeAppendHook and AfterAppendHook interfaces - withHooks() wrapper for stream composition - StreamFactory for creating hooked streams - Tests for hook behavior Bridge implementations cover: - OpenCode: HTTP/SSE server, SDK client - Claude Code: CLI subprocess, SDK async generator, global hooks - Pi: stdin/stdout RPC, JSONL sessions Open questions organized into: - Session management & concurrency - Event streaming & format - Process lifecycle & supervision - TUI compatibility & handoff - Tool injection & routing - Error recovery & state - Storage architecture 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
||
| # Agent runtime data (contexts, logs) | ||
| .mini-agent/ | ||
| opensrc/ |
There was a problem hiding this comment.
Unexplained gitignore entry for opensrc/ directory
Low Severity
The opensrc/ directory is added to .gitignore without any explanatory comment and doesn't appear anywhere else in the codebase. Unlike .iterate/ which has a descriptive comment and is documented in src/durable-streams/README.md, there's no documentation or code referencing opensrc/. This appears to be an accidentally committed personal or local directory ignore entry that isn't related to the PR's stated purpose of implementing durable-streams.
- Add agent-wrapper package for wrapping Pi coding agent with durable streams - Pi adapter connects Pi SDK sessions to event streams - Use file-based SessionManager.create() for Pi CLI interop - Sessions stored in ~/.pi/agent/sessions/ (Pi's default location) - Use INIT_CWD env var to preserve shell working directory - Add CLI commands: start, prompt, abort, subscribe, list - Add e2e test for full session flow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with Claude Code
Note
Introduces an agent-wrapper that connects the Pi coding agent to durable streams and provides a small CLI for session control.
agent-wrappermodule:AdapterRunnerService(manage adapters),runPiAdapter(Pi SDK integration),cli.tswith commands:start,prompt,abort,subscribe,list, and entrymain.tsStreamClientServiceandDaemonServiceto create streams, subscribe to events, and append resultssrc/agent-wrapper/e2e-test.tsto exercise start→prompt end-to-end and validate persisted events in.iterate/streamsCLAUDE.md, updatepackage.jsonscripts (tsx, doppler), extend.gitignorewithopensrc/and.iterate/Written by Cursor Bugbot for commit 2941a18. This will update automatically on new commits. Configure here.