Skip to content

feat: migrate to runtime executeTask API #31

@foo-ogawa

Description

@foo-ogawa

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

  1. Replace local createAdapter + runTask + createProgressSink with executeTask()
  2. Remove RUNTIME_PKG variable and esbuild rewrite plugin
  3. Use dsl: resolvedDsl (already available via static import from generated/dsl/dsl-data.js)
  4. Replace silent empty fallback for DSL import failure with a proper error
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions