feat: experimental dynamic workflows — runtime, TUI, SDK, mode, autocomplete, docs - #2280
feat: experimental dynamic workflows — runtime, TUI, SDK, mode, autocomplete, docs#2280lucasfelipe24 wants to merge 24 commits into
Conversation
Register AI/ML, architecture, backend, database, debugging, design, DevOps, embedded, frontend, game dev, languages, project management, research writing, security, and testing skills as built-in bundles in both agent-core and agent-core-v2.
…ve bundle check
Code examples in domain skill .md files contained require('uuid'),
require('commander'), import('vue'), import ... from 'vue', and
import('./types/user.mjs') patterns that the native bundle checker
treated as real runtime dependencies.
# Conflicts: # apps/kimi-code/src/cli/commands.ts # docs/en/reference/kimi-command.md # docs/zh/reference/kimi-command.md
…tool usage in system prompt
…oading in system prompt
Restore the references/, rules/, and AGENTS.md files of the original domain skills into the built-in skill trees of both engines, and make them loadable at runtime: - SkillDefinition gains a resources map (skill-relative path to content), populated from ?raw imports in each bundle registration. - The Skill tool gains a resource parameter that returns a bundled resource file without invoking the skill (no activation, no depth). - The loaded skill block lists available resources under <bundled-resources>, and the system prompt documents the mechanism. - Escape require()/import() patterns in resource content so the native bundle check passes.
- Compare entry guards against pathToFileURL(argv[1]) so native build steps are not silently skipped when the checkout path contains spaces or non-ASCII characters (01-bundle.mjs, minidb server). - Use fileURLToPath instead of URL.pathname for MCP stdio fixtures and vis session fixtures, which broke under percent-encoded paths.
# Conflicts: # packages/agent-core-v2/src/app/agentProfileCatalog/system.md # packages/agent-core-v2/src/app/auth/webSearch/webSearchService.ts # packages/agent-core-v2/test/agent/loop/loop.test.ts # packages/agent-core-v2/test/tool/tool.test.ts
# Conflicts: # apps/kimi-code/src/tui/components/dialogs/api-key-input-dialog.ts
Drop the 16 domain expertise skill bundles (ai-ml, architecture, backend-frameworks, database, debugging, design, devops-infra, embedded-systems, find-skills, frontend-frameworks, game-developer, languages, project-management, research-writing, security, testing) from both engines, along with their SKILL.md files, sub-skills and bundled reference material. Revert the shared skill infrastructure to its prior state: the builtin registries, the SkillDefinition resources map, the Skill tool resource parameter, the loaded-block bundled-resources rendering, and the skill sections of both system prompts.
# Conflicts: # docs/en/configuration/config-files.md # docs/zh/configuration/config-files.md # packages/agent-core-v2/scripts/check-domain-layers.mjs # packages/agent-core-v2/src/app/auth/configSection.ts # packages/agent-core-v2/test/agent/mcp/stubs.ts # packages/agent-core/src/rpc/core-api.ts # packages/agent-core/src/rpc/core-impl.ts # packages/agent-core/test/harness/runtime.test.ts
# Conflicts: # packages/agent-core-v2/src/agent/tools/web-search/webSearchTool.ts # packages/agent-core-v2/src/app/auth/webSearch/webSearchService.ts # packages/agent-core-v2/src/index.ts
…omplete, docs Dynamic Workflows permitem orquestrar múltiplos subagentes a partir de scripts JS controlados (node:vm sandbox), com fases, fan-out paralelo, pipeline, saída estruturada validada por JSON Schema, logs/progresso e resultado final. Engine v1 (agent-core): - Workflow runtime sandbox (types, validate, script, runtime, discovery) - WorkflowRunManager + WorkflowBackgroundTask (kind workflow) - Descoberta em scopes: projeto (.kimi-code/workflows) → usuário → extra → builtin - Config section [workflows] (limites: concorrência, calls, duração, bytes) - Flag experimental 'dynamic-workflows' - Tool Workflow (proposal via model → approval → background run) - Permission policy workflow-run-review-ask (manual/yolo/auto) - WorkflowMode (modo ortogonal via system reminder) - argumentHint field na metadata Engine v2 (agent-core-v2): - IWorkflowCatalogService (App scope), IWorkflowRunService (Session scope) - Agent tool Workflow + approval + WorkflowModeService Protocol: - WorkflowTaskInfo, WorkflowPhaseInfo (+ zod schemas) - Eventos workflow.run.started/phase/log/agent_call/completed - Display kind workflow_run no ToolInputDisplay SDK (node-sdk): - listWorkflows, getWorkflow, reloadWorkflows, runWorkflow - listWorkflowRuns, getWorkflowRun, cancelWorkflowRun, saveWorkflow - setWorkflowMode TUI (kimi-code): - /workflow (alias /workflows) com subcomandos list/run/runs/show/cancel/save/reload/on/off - Autocomplete dinâmico: /workflow run <Tab> lista workflows disponíveis - Runs browser full-screen (status, fases, agend calls, logs, cancel, save, view script) - Workflow badge no footer ([N workflow(s) running]) - Painel de approval renderiza workflow_run display com script expansível - ProgressController + subagent suppression for cleaner transcript Builtin: - deep-research.js (5 fases: Scope/Search/Fetch/Verify/Synthesize, adversarial verification) Docs EN+ZH: - Páginas customization/workflows.md + seções em config-files, env-vars, slash-commands
🦋 Changeset detectedLatest commit: c64223e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: adc6853f73
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Thanks for the thorough review! Here are my responses: P1 — Sync loop blocking: Fixed in 3d57663. Added P1 — Builtin not bundled: Valid observation. The builtin P1 — Confirmation removed: This was an intentional design decision per user request. The P2 — WorkflowMode gate: Fixed in 3d57663. Added |
Engine v2 migration progressAs part of the ongoing migration to the v2 engine architecture (agent-core-v2), this PR now includes: kap-server REST routes (8 new endpoints)Built on top of klient contracts
TUI WorkflowV2Client
Tests
|
Problem
Kimi Code lacks a way to orchestrate multiple subagents with structured phases, parallel fan-out, pipelines, and validated outputs. Users who need multi-step research or complex automation must manually manage each subagent turn.
What changed
This PR adds Dynamic Workflows: an experimental feature that runs user-approved JavaScript scripts orchestrating subagents inside a restricted sandbox.
Engine v1 (packages/agent-core)
Engine v2 (packages/agent-core-v2)
Protocol
SDK (packages/node-sdk)
TUI (apps/kimi-code)
Builtin
Docs
Checklist