Skip to content

Add TypeScript Task SDK#67908

Open
shivaam wants to merge 6 commits into
apache:mainfrom
shivaam:feat/add-ts-sdk
Open

Add TypeScript Task SDK#67908
shivaam wants to merge 6 commits into
apache:mainfrom
shivaam:feat/add-ts-sdk

Conversation

@shivaam
Copy link
Copy Markdown
Contributor

@shivaam shivaam commented Jun 2, 2026

Add `ts-sdk/` — a TypeScript SDK for authoring and running Airflow tasks in Node.js. Supports two execution modes:

Coordinator mode (AIP-108): spawned as a one-shot subprocess per task by `TypescriptCoordinator` (companion PR); communicates over TCP with the Airflow supervisor using the same 4-byte length-prefixed msgpack protocol as the Python and Java SDKs. Supports all 13 `TaskClient` APIs (Variables, XCom, Connections, Dag operations, secret masking) and DAG serialization.

Edge Worker mode (AIP-69/72): long-lived HTTPS worker using JWT authentication; picks up tasks from the edge executor queue.

Both modes share `registerTask()` and the same `TaskClient` interface — handlers are mode-agnostic.

What's included

  • `ts-sdk/src/` — full source (coordinator + edge + shared client interface)
  • `ts-sdk/tests/` — 180 unit tests (vitest)
  • `ts-sdk/integration/` — integration test workers and Python test scripts
  • `ts-sdk/schema/supervisor-schema.json` — vendored supervisor wire schema (PR Add schema migration to supervisor-child comm #67235, api_version `2026-06-16`)
  • `ts-sdk/scripts/generate-supervisor.mjs` — regenerates types from schema

What's deferred (follow-up PRs)

  • CI workflow and pre-commit hooks for `ts-sdk/`
  • `TypescriptCoordinator` Python-side wiring (companion PR)
  • Structured log forwarding for edge mode (`TODO(pr4)` in `worker.ts`)
  • Per-task token refresh and subprocess isolation for edge mode

Testing

```bash
cd ts-sdk
pnpm install
pnpm test # 180 tests, all pass
pnpm run typecheck
```


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Sonnet 4.6)

Generated-by: Claude Code (Sonnet 4.6) following the guidelines


Drafted-by: Claude Code (Sonnet 4.6) (no human review before posting)

shivaam added 6 commits June 2, 2026 10:01
Adds `ts-sdk/` — a TypeScript SDK for authoring and running Airflow tasks
in Node.js. Supports two execution modes:

- **Coordinator mode** (AIP-108): spawned as a subprocess by
  `TypescriptCoordinator`; communicates over TCP with the Airflow supervisor
  using the same 4-byte length-prefixed msgpack protocol as the Python and
  Java SDKs. Supports all 13 `TaskClient` APIs (Variables, XCom,
  Connections, Dag operations, secret masking) and DAG serialization.

- **Edge Worker mode** (AIP-69/72): long-lived HTTPS worker using JWT
  authentication; picks up tasks from the edge executor queue.

Wire types are generated from the supervisor schema (introduced in
PR apache#67235) at `ts-sdk/schema/supervisor-schema.json`, pinned to
`SUPERVISOR_API_VERSION = "2026-06-16"`.

Includes unit tests (180 tests) and integration test workers.
- Remove references to internal dev notes (COORDINATOR.md, TESTING.md,
  SDK_COMPARISON.md, REVIEW_OBSERVATIONS.md, REFACTOR_NOTES.md) that
  are not part of this PR
- Add esbuild bundling command and coordinator config example
- Add mode-limitation table documenting which TaskClient methods are
  edge-only vs coordinator-only
- Add logging section explaining coordinator structured logs vs edge stdout
- Add @throws JSDoc to 5 coordinator-only TaskClient methods so IDEs
  surface the limitation on hover
…ing docs

Update the default provider version fallback from 3.5.0 to 3.7.0 to match
current breeze/Airflow releases; set via AIRFLOW__EDGE__PROVIDER_VERSION if
your deployment uses a different version.

Expand edge-mode E2E testing docs with required env vars, per-scenario worker
commands, and a breeze-specific note about the is_stale scheduler gate that
can strand queued runs when DAG files are freshly copied.
@shivaam
Copy link
Copy Markdown
Contributor Author

shivaam commented Jun 3, 2026

@jason810496 @uranusjr Appreciate your feedback

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.

1 participant