From 8ca6e5111fd2710cf56da1acb1dfd0bc986da2c8 Mon Sep 17 00:00:00 2001 From: Bhavik Agarwal Date: Wed, 16 Sep 2026 16:55:39 +0530 Subject: [PATCH 1/2] feat: add agent-agnostic dynamic workflows --- README.md | 2 + docs/dynamic-workflows-implementation-plan.md | 998 ++++++++++++ docs/dynamic-workflows.md | 79 + examples/workflows/bounded-repair.js | 20 + examples/workflows/isolated-migrations.js | 8 + examples/workflows/nested-synthesis.js | 8 + examples/workflows/review-and-verify.js | 11 + package.json | 7 +- pnpm-lock.yaml | 64 +- schema/v1/devspace.schema.json | 179 +++ skills/workflows/SKILL.md | 59 + src/cli.ts | 10 + src/config-schema.ts | 2 + src/config.ts | 3 + src/db/migrations.ts | 158 +- src/db/schema.ts | 161 +- src/local-agent-acp.test.ts | 49 +- src/local-agent-acp.ts | 129 +- src/local-agent-adapters.test.ts | 23 + src/local-agent-cancellation.test.ts | 137 ++ src/local-agent-catalog.ts | 1 + src/local-agent-claude.test.ts | 49 + src/local-agent-claude.ts | 155 +- src/local-agent-client.ts | 38 +- src/local-agent-codex.test.ts | 81 +- src/local-agent-codex.ts | 188 ++- src/local-agent-daemon-lifecycle.ts | 2 +- src/local-agent-daemon-main.ts | 86 +- src/local-agent-daemon-protocol.ts | 8 + src/local-agent-daemon.test.ts | 6 +- src/local-agent-daemon.ts | 28 +- src/local-agent-manager.ts | 349 +++- src/local-agent-opencode.test.ts | 95 +- src/local-agent-opencode.ts | 152 +- src/local-agent-pi.test.ts | 39 + src/local-agent-pi.ts | 143 +- src/local-agent-presentation.ts | 4 +- src/local-agent-profiles.test.ts | 2 + src/local-agent-profiles.ts | 14 + src/local-agent-runtime-pool.ts | 8 +- src/local-agent-runtime.test.ts | 22 +- src/local-agent-runtime.ts | 97 ++ src/local-agent-store.ts | 118 +- src/oauth-store.test.ts | 3 + src/server.test.ts | 15 + src/server.ts | 26 +- src/skills.ts | 63 +- src/test-support/config.test.ts | 2 + src/workflow-cli.ts | 133 ++ src/workflow-config.ts | 49 + src/workflow-daemon.test.ts | 43 + src/workflow-manager.test.ts | 464 ++++++ src/workflow-manager.ts | 1432 +++++++++++++++++ src/workflow-protocol.ts | 74 + src/workflow-registry.test.ts | 55 + src/workflow-registry.ts | 231 +++ src/workflow-runtime.test.ts | 339 ++++ src/workflow-runtime.ts | 412 +++++ src/workflow-schema.test.ts | 68 + src/workflow-schema.ts | 170 ++ src/workflow-script.test.ts | 41 + src/workflow-script.ts | 187 +++ src/workflow-security.test.ts | 35 + src/workflow-store.test.ts | 48 + src/workflow-store.ts | 693 ++++++++ src/workflow-tools.test.ts | 60 + src/workflow-tools.ts | 59 + src/workflow-types.ts | 178 ++ src/workflow-worker.ts | 662 ++++++++ test/workflow-cli-smoke.test.ts | 103 ++ 70 files changed, 9217 insertions(+), 220 deletions(-) create mode 100644 docs/dynamic-workflows-implementation-plan.md create mode 100644 docs/dynamic-workflows.md create mode 100644 examples/workflows/bounded-repair.js create mode 100644 examples/workflows/isolated-migrations.js create mode 100644 examples/workflows/nested-synthesis.js create mode 100644 examples/workflows/review-and-verify.js create mode 100644 skills/workflows/SKILL.md create mode 100644 src/local-agent-cancellation.test.ts create mode 100644 src/workflow-cli.ts create mode 100644 src/workflow-config.ts create mode 100644 src/workflow-daemon.test.ts create mode 100644 src/workflow-manager.test.ts create mode 100644 src/workflow-manager.ts create mode 100644 src/workflow-protocol.ts create mode 100644 src/workflow-registry.test.ts create mode 100644 src/workflow-registry.ts create mode 100644 src/workflow-runtime.test.ts create mode 100644 src/workflow-runtime.ts create mode 100644 src/workflow-schema.test.ts create mode 100644 src/workflow-schema.ts create mode 100644 src/workflow-script.test.ts create mode 100644 src/workflow-script.ts create mode 100644 src/workflow-security.test.ts create mode 100644 src/workflow-store.test.ts create mode 100644 src/workflow-store.ts create mode 100644 src/workflow-tools.test.ts create mode 100644 src/workflow-tools.ts create mode 100644 src/workflow-types.ts create mode 100644 src/workflow-worker.ts create mode 100644 test/workflow-cli-smoke.test.ts diff --git a/README.md b/README.md index d307e707f..c14b99d0a 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ DevSpace is a self-hosted MCP server that lets ChatGPT read, edit, search, and r The same `/mcp` endpoint serves the 2026-07-28 per-request protocol and automatically supports older 2025-era clients through stateless compatibility handling. There is no protocol mode to configure. +[Dynamic workflows](docs/dynamic-workflows.md) let a host write JavaScript to coordinate configured subagents in parallel, run pipelines, validate structured results, and inspect or control durable runs. + ## Sponsors and Special Thanks