Amey/typescript implementation extension#728
Open
Kamehameya wants to merge 3 commits intoapache:mainfrom
Open
Conversation
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 PR has been inactive for 19 days after receiving review feedback. Please mark it as ready for review when you have addressed the comments. |
c37b9a2 to
2fdf61c
Compare
Author
Added the description Testing: Run the integration test specifically (mirrors Python's tests/integration_tests/test_app.py): Run the hello-world counter demo (port of examples/hello-world-counter/application.py): |
Ground-up TypeScript port of Burr's core runtime: state machine engine, actions, graph, application execution, and cross-cutting concerns (lifecycle hooks, persistence, streaming, tracing, parallelism). Uses Zod schemas for runtime validation and TypeScript generics for compile-time safety. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2fdf61c to
e739ccc
Compare
- GitHub Actions workflow for lint, typecheck, unit/integration tests (Node 18/20/22), compile-time type tests, and build verification - README TODO for npm publishing workflow Co-Authored-By: Claude Opus 4.6 (1M context) <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.
TypeScript implementation of
@apache-burr/coreGround-up TypeScript port of Burr's core runtime — state machine engine, actions, graph, application execution, and all cross-cutting concerns (lifecycle hooks, persistence, streaming, tracing, parallelism). Uses Zod schemas for runtime validation and TypeScript generics for compile-time safety.
Changes
state.ts): Immutable, Zod-validated container with three-schema design (main/readable/writable). Operations pattern forupdate,append,extend,increment,subset,merge. Copy-on-write viastructuredClone.action.ts): Two-phaserun()→update()pattern with schema-validated reads/writes/inputs/result. Factory function with overloads for full and update-only actions.graph.ts):GraphBuilderwith fluent API, unconditional/conditional/terminal transitions. Type-level accumulation of action state schemas.application.ts,application-builder.ts): Fork→Launch→Gather→Commit four-phase execution.step(),run(),iterate(),streamStep(). Framework metadata (appMetadata/executionMetadata) injected into state. Immutable builder with compile-time graph/state compatibility checks.lifecycle.ts): 11 async hook types mirroring Python'sburr/lifecycle/base.py.LifecycleAdapterSetdispatcher with duck-typed dispatch.streaming.ts):StreamingActionwithAsyncGenerator-basedstreamRun().StreamingResultContainerfor buffered iteration + finalization.persistence.ts):StateLoader/StateSaver/StatePersisterinterfaces.InMemoryPersisterfor testing.PersisterHooklifecycle integration.initializeFrom()for state resumption.serde.ts): Tagged-value convention for non-JSON types (Date, Map, Set, RegExp, BigInt). Extensible via custom serializers/deserializers.tracing.ts):ActionSpan/ActionSpanTracer/TracerFactorywithAsyncLocalStoragecontext propagation.parallelism.ts):RunnableGraph,SubGraphTask,TaskBasedParallelAction,MapActions,MapStates,MapActionsAndStates.Promise.all()execution.type-utils.ts,schema-utils.ts): Advanced type machinery for compile-time safety + runtime schema extension helpers.typescript/, ESLint, Prettier, Jest config, pre-commit hook update.How I tested this
scratch-examples/counter-hw.tsTo run locally:
Notes
README.mdupdated with comprehensive feature parity tables vs Pythonstate.wipe(), action tags, graph validation/cycle detection,visualize(), concrete persistence backends (SQLite, Postgres, etc.), tracking clientsinitializeFromresume logicChecklist