feat(sdk/typescript): trigger system parity — dispatch, sugar, testing, demo - #796
Merged
santoshkumarradha merged 1 commit intoJul 19, 2026
Conversation
…g, demo (Agent-Field#510, Agent-Field#511, Agent-Field#512) Implements the three remaining sub-issues of the TypeScript SDK trigger parity epic (Agent-Field#507): Agent-Field#510 — Dispatch envelope unwrap + TriggerContext injection - New src/triggers/dispatch.ts: isTriggerEnvelope(), unwrapEnvelope(), applyTriggerTransform() — detects {event, _meta} envelope shape from the control plane dispatcher, constructs TriggerContext, applies the matched binding's transform - ReasonerContext gains trigger?: TriggerContext field - Agent.ts runReasoner() and local call() path wired to unwrap envelopes - Direct calls (no envelope) pass through unchanged Agent-Field#511 — onEvent/onSchedule sugar + test helpers + fixtures - Agent.ts: app.onEvent(spec, handler) and app.onSchedule(cron, handler) sugar methods that forward to app.reasoner() with triggers - New src/triggers/testing.ts: simulateTrigger(), simulateSchedule(), loadFixture() for unit testing without a control plane - Copied 6 fixture JSONs from Python SDK (stripe, github, slack, cron, generic_hmac, generic_bearer) Agent-Field#512 — examples/triggers-demo-ts + skill docs - New examples/triggers-demo-ts/: agent.ts (3 deterministic reasoners), Dockerfile, docker-compose.yml, README.md, fire-events.sh - New skills/agentfield-multi-reasoner-builder/references/triggers.md with Python + TypeScript scaffold reference Tests: 744 pass (75 files), including 74 new trigger-specific tests. Build: tsc clean, tsup ESM+DTS success.
Contributor
Performance
⚠ Regression detected:
|
Contributor
📊 Coverage gateThresholds from
✅ Gate passedNo surface regressed past the allowed threshold and the aggregate stayed above the floor. |
Contributor
📐 Patch coverage gateThreshold: 80% on lines this PR touches vs
✅ Patch gate passedEvery surface whose lines were touched by this PR has patch coverage at or above the threshold. |
santoshkumarradha
approved these changes
Jul 19, 2026
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
Brings the TypeScript SDK to trigger system feature parity with the Python SDK (#507). Implements:
TriggerContextinjectionapp.onEvent()/app.onSchedule()sugar + test helpers + fixturestriggers-demo-tsexample + skill scaffold docsType of Change
Test Plan
cd sdk/typescript && npx tsc --noEmit— TypeScript compilation cleancd sdk/typescript && npm run build— ESM + DTS build successcd sdk/typescript && npx vitest run— 744 tests pass (75 files), 0 failurescd sdk/typescript && npx vitest run tests/triggers_dispatch.test.ts tests/triggers_sugar.test.ts tests/triggers_testing.test.ts tests/triggers.test.ts— 74 trigger-specific tests passcd examples/triggers-demo-ts && docker compose up --build— control-plane + ts-agent start,fire-events.shdispatches successfully (manual, requires Docker)Test Coverage
coverage-baseline.jsonin this PR only if the removal caused a legitimate regression and I called it out in the summary above.New Test Files — 74 Tests Total
tests/triggers_dispatch.test.tstests/triggers_sugar.test.tsonEvent/onScheduleregistration parity, dispatchtests/triggers_testing.test.tssimulateTrigger,simulateSchedule,loadFixture, all 6 fixturestests/triggers.test.ts(existing)Checklist
CONTRIBUTING.md(if present) anddocs/DEVELOPMENT.md.Related Issues / PRs
TriggerContextinjectiononEvent/onSchedulesugar + test helpers + fixturesexamples/triggers-demo-tsend-to-end demo + skill docs