Skip to content

Amey/typescript implementation extension#728

Open
Kamehameya wants to merge 18 commits intoapache:mainfrom
Kamehameya:amey/typescript-implementation-extension
Open

Amey/typescript implementation extension#728
Kamehameya wants to merge 18 commits intoapache:mainfrom
Kamehameya:amey/typescript-implementation-extension

Conversation

@Kamehameya
Copy link
Copy Markdown

[Short description explaining the high-level reason for the pull request]

Changes

How I tested this

Notes

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

Elijah ben Izzy and others added 18 commits December 23, 2025 13:39
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>
@@ -0,0 +1,102 @@
import { z } from "zod";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? otherwise needs apache license.

@skrawcz
Copy link
Copy Markdown
Contributor

skrawcz commented Apr 7, 2026

PR description? How can I run this locally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants