Skip to content

feat(appkit): migrate agent-app and docs to the new agents() plugin#295

Closed
MarioCadenas wants to merge 1 commit intoagent/5b-agents-pluginfrom
agent/5c-migrate-agent-app-docs
Closed

feat(appkit): migrate agent-app and docs to the new agents() plugin#295
MarioCadenas wants to merge 1 commit intoagent/5b-agents-pluginfrom
agent/5c-migrate-agent-app-docs

Conversation

@MarioCadenas
Copy link
Copy Markdown
Collaborator

@MarioCadenas MarioCadenas commented Apr 21, 2026

Summary

Cuts over the reference application and documentation to the agents() plugin API introduced in PR #294.

Apps

  • apps/agent-app/server.ts — rewritten from the deprecated createAgent({ plugins, tools, port }) app-shortcut to createApp({ plugins: [server(), analytics(), files(), agents({ agents: { support } })] }). The support agent is a code-defined createAgent(def) that spreads tools from the analytics and files plugins via .toolkit() and mixes in inline tool() + mcpServer() helpers.
  • apps/agent-app/config/agents/assistant.md — rewritten to the new YAML frontmatter schema (proper --- delimiters, endpoint: / default: keys).

Docs

  • docs/docs/plugins/agents.md — full guide for the new plugin. Covers the five progressive levels (markdown-only → frontmatter scoping → code-defined agents → sub-agents → standalone runAgent). Includes the configuration reference and the full frontmatter schema table.
  • docs/docs/guides/migrating-to-agents-plugin.md — migration guide from the old createAgent shortcut to createApp + agents(). Covers name changes, frontmatter format differences, code migration examples.
  • Docs sidebar + regenerated typedoc API reference.

CLI template

  • template/appkit.plugins.json — plugin registry synced to include agents for databricks apps init --features agents scaffolding.

PR Stack

  1. Shared types + Adapters — feat(appkit): add shared agent types and LLM adapter implementations #282
  2. Tool types + MCP client — feat(appkit): add FunctionTool, HostedTool types and MCP client #283
  3. Agent plugin core + ToolProvider implementations — feat(appkit): add agent plugin core and ToolProvider implementations #284
  4. PluginContext mediator — feat(appkit): add PluginContext mediator for inter-plugin communication #285
  5. createAgent + agent-app + docs (v1) — feat(appkit): add createAgent wrapper, agent-app, and API docs #286
  6. Plugin context-binding separation — refactor(appkit): separate plugin context binding from plugin construction #293
  7. agents() plugin + createAgent(def) + .toolkit()feat(appkit): add agents() plugin, createAgent() factory, and .toolkit() #294
  8. agent-app + docs migrated to agents() (this PR)
  9. Relocate shared agent utilities — refactor(appkit): relocate shared agent utilities into plugins/agents #296
  10. preparePlugins forwards eager instance — refactor(appkit): forward eager plugin instance through preparePlugins #297
  11. fromPlugin() API — feat(appkit): add fromPlugin() for referencing plugin tools in code-defined agents #298
  12. Retire deprecated agent() + createAgentAppchore(appkit): remove deprecated agent() plugin and createAgentApp shortcut #299
  13. Retire toPluginWithInstance + bug fixes — refactor(appkit): retire toPluginWithInstance; consolidate on fromPlugin + fix schema/routing bugs #300

Test plan

  • agent-app boots, registers both the code-defined support agent and the markdown-loaded assistant agent, streams responses
  • Docs build clean (pnpm docs:build)
  • Typecheck clean

- apps/agent-app/server.ts rewritten to use createApp({ plugins: [
  server, analytics, files, agents({...}) ] }) with createAgent() for
  the code-defined support agent and mcpServer() entries inline. Uses
  the appkit.agent runtime handle (the agents() plugin registers
  under the singular name so routes mount at /api/agent/*).
- apps/dev-playground/server/index.ts swapped from the deprecated
  agent() to agents(). Route prefix, client code, and runtime handle
  are unchanged; the singular "agent" manifest name is preserved in
  the new plugin so /api/agent/* keeps working.
- Normalize assistant.md (both apps) and autocomplete.md frontmatter
  to proper YAML. The old flat parser tolerated '## key: value'
  markdown-heading markers and missing closing '---'; the new js-yaml
  parser requires real YAML. Without this fix, the dev-playground
  assistant agent silently failed to load and chat requests routed
  to the autocomplete text-completion model, which rejected them
  with upstream 400s.
- New docs/plugins/agents.md covering all shapes: level 1 (drop a
  markdown file), level 2 (scope tools in frontmatter), level 3
  (code-defined agents), level 4 (sub-agents), level 5 (standalone
  runAgent). Includes config reference and frontmatter schema table.
- New docs/guides/migrating-to-agents-plugin.md with side-by-side
  before/after for the deprecated createAgent() shortcut and a gradual
  migration path using the @deprecated aliases.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
@MarioCadenas
Copy link
Copy Markdown
Collaborator Author

Superseded by the v2 6-PR stack:

  1. Shared agent types + LLM adapters — feat(appkit): shared agent types and LLM adapter implementations #301
  2. Tool primitives + ToolProvider surfaces — feat(appkit): tool primitives and ToolProvider surfaces on core plugins #302
  3. Plugin infrastructure (attachContext + PluginContext) — feat(appkit): plugin infrastructure — attachContext + PluginContext mediator #303
  4. agents() plugin + createAgent(def) + markdown-driven agents — feat(appkit): agents() plugin, createAgent(def), and markdown-driven agents #304
  5. fromPlugin() DX + runAgent plugins arg + toolkit-resolver — feat(appkit): fromPlugin() DX, runAgent plugins arg, shared toolkit-resolver #305
  6. Reference app + dev-playground + docs — feat(appkit): reference agent-app, dev-playground chat UI, docs, and template #306

The v2 stack reorganizes the same work so no PR ships API that a later PR deletes. Start at #301 for the new entry point. Branches from this older stack are preserved unchanged.

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