Background
agent-contracts-runtime v0.36.1 now provides high-level executeTask() and executeWorkflow() APIs that encapsulate the common boilerplate: adapter creation, DSL context loading, progress sink setup, and task/workflow invocation.
agent-contracts and artifact-contracts have already migrated to these APIs.
Current state
src/agents/orchestrator.ts contains:
RUNTIME_PKG = ["agent-contracts", "runtime"].join("-") obfuscation pattern
- Local
createAdapter(runtimePkg, name, config) switch with 4 adapter cases
- Manual
runTask + createProgressSink wiring
- DSL registries loaded via dynamic import with silent empty fallback on failure
- esbuild plugin in
esbuild.bundle.mjs that rewrites RUNTIME_PKG via regex
Required changes
- Replace local
createAdapter + runTask + createProgressSink with executeTask()
- Remove
RUNTIME_PKG variable and esbuild rewrite plugin
- Use
dsl: resolvedDsl (already available via static import from generated/dsl/dsl-data.js)
- Replace silent empty fallback for DSL import failure with a proper error
- Update
agent-contracts-runtime devDependency to ^0.36.1
Reference implementation
See artifact-contracts PR #33 or agent-contracts PR #115 for the migration pattern.
Background
agent-contracts-runtimev0.36.1 now provides high-levelexecuteTask()andexecuteWorkflow()APIs that encapsulate the common boilerplate: adapter creation, DSL context loading, progress sink setup, and task/workflow invocation.agent-contractsandartifact-contractshave already migrated to these APIs.Current state
src/agents/orchestrator.tscontains:RUNTIME_PKG = ["agent-contracts", "runtime"].join("-")obfuscation patterncreateAdapter(runtimePkg, name, config)switch with 4 adapter casesrunTask+createProgressSinkwiringesbuild.bundle.mjsthat rewritesRUNTIME_PKGvia regexRequired changes
createAdapter+runTask+createProgressSinkwithexecuteTask()RUNTIME_PKGvariable and esbuild rewrite plugindsl: resolvedDsl(already available via static import fromgenerated/dsl/dsl-data.js)agent-contracts-runtimedevDependency to^0.36.1Reference implementation
See
artifact-contractsPR #33 oragent-contractsPR #115 for the migration pattern.