Amey/typescript implementation extension#728
Open
Kamehameya wants to merge 18 commits intoapache:mainfrom
Open
Amey/typescript implementation extension#728Kamehameya wants to merge 18 commits intoapache:mainfrom
Kamehameya wants to merge 18 commits intoapache:mainfrom
Conversation
This uses some type-safety to make it more user-friendly. Otherwise we implement a subset of features.
1. Adds type-checking for state updates 2. Cascades schema changes 3. Tracks read/write limitations to enable compile-time type-checks
These ensure appropriate error handling of typescript types i.e. state updates, etc...
This has type-checking based on actions, accrues the types/unions. Has some compatibility in state with graph, etc...
This allows us to create it with zod defaults -- this is less safe, power user mode
A lot of generics math -- this basically allows the action definitions to work properly.
This is simpler. We will also have streamingAction later. But that's it.
This also does some refactors to make typing cleaner/more centralized -- a lot of complex typing logic.
… any> This ensures we don't bypass typing for now.
See README: 1. We have each one in it's own file 2. We have a simple metadata definition 3. It's easy enough for an LLM to generate/debug
State schema is required -- things can be optional
- Add runStep() with 4-phase execution (fork/launch/gather/commit) - Make State.subset() strict (throws on missing keys) - Add defense-in-depth validation at phase boundaries - Remove underscore prefix from private methods (idiomatic TS) - Remove 4 redundant E2E tests, add 5 subset validation unit tests - Application validates inputs (reads), Action validates outputs (result/writes)
…ming, tracing, parallelism Closes the 5 feature gaps identified in requirements.md to achieve full parity with the Python Burr implementation: - Lifecycle hooks: all 11 hook types (PreRunStep, PostRunStep, PostApplicationCreate, PreStartSpan, PostEndSpan, DoLogAttribute, PreExecuteCall, PostExecuteCall, PreStartStream, PostStreamItem, PostEndStream) with generic dispatch - Persistence: StateLoader/StateSaver interfaces, PersisterHook, InMemoryPersister, initializeFrom for resume/fork, serde utilities for Date/Map/Set/RegExp/BigInt - Streaming: StreamingAction, streamingAction() factory, StreamingResultContainer with iterate + .get() + passThrough, Application.streamStep() - Tracing: ActionSpan hierarchy, TracerFactory, trace() wrapper, AsyncLocalStorage context, span hooks integrated into lifecycle system - Parallelism: RunnableGraph, SubGraphTask with persistence cascading, TaskBasedParallelAction, MapActions, MapStates, MapActionsAndStates convenience classes, CascadeBehavior for cascade/null/instance control 243 tests passing across 14 test suites (82 new tests added). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
skrawcz
reviewed
Apr 7, 2026
| @@ -0,0 +1,102 @@ | |||
| import { z } from "zod"; | |||
Contributor
There was a problem hiding this comment.
? otherwise needs apache license.
Contributor
|
PR description? How can I run this locally? |
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.
[Short description explaining the high-level reason for the pull request]
Changes
How I tested this
Notes
Checklist