Skip to content

feat(appkit): reference agent-app, dev-playground chat UI, docs, and template#306

Open
MarioCadenas wants to merge 2 commits intoagent/v2/5-fromplugin-runagentfrom
agent/v2/6-apps-docs
Open

feat(appkit): reference agent-app, dev-playground chat UI, docs, and template#306
MarioCadenas wants to merge 2 commits intoagent/v2/5-fromplugin-runagentfrom
agent/v2/6-apps-docs

Conversation

@MarioCadenas
Copy link
Copy Markdown
Collaborator

@MarioCadenas MarioCadenas commented Apr 21, 2026

Final layer of the agents feature stack. Everything needed to
exercise, demonstrate, and learn the feature.

Reference application: agent-app

apps/agent-app/ — a standalone app purpose-built around the agents
feature. Ships with:

  • server.ts — full example of code-defined agents via fromPlugin:
    const support = createAgent({
      instructions: "…",
      tools: {
        ...fromPlugin(analytics),
        ...fromPlugin(files),
        get_weather,
        "mcp.vector-search": mcpServer("vector-search", "https://…"),
      },
    });
    
    await createApp({
      plugins: [server({ port }), analytics(), files(), agents({ agents: { support } })],
    });
  • config/agents/assistant.md — markdown-driven agent alongside the
    code-defined one, showing the asymmetric auto-inherit default.
  • Vite + React 19 + TailwindCSS frontend with a chat UI.
  • Databricks deployment config (databricks.yml, app.yaml) and
    deploy scripts.

dev-playground chat UI + demo agent

apps/dev-playground/client/src/routes/agent.route.tsx — chat UI with
inline autocomplete (hits the autocomplete markdown agent) and a
full threaded conversation panel (hits the default agent).

apps/dev-playground/server/index.ts — adds a code-defined helper
agent using fromPlugin(analytics) alongside the markdown-driven
autocomplete agent in config/agents/. Exercises the mixed-style
setup (markdown + code) against the same plugin list.

apps/dev-playground/config/agents/*.md — both agents defined with
valid YAML frontmatter.

Docs

docs/docs/plugins/agents.md — progressive five-level guide:

  1. Drop a markdown file → it just works.
  2. Scope tools via toolkits: / tools: frontmatter.
  3. Code-defined agents with fromPlugin().
  4. Sub-agents.
  5. Standalone runAgent() (no createApp or HTTP).

Plus a configuration reference, runtime API reference, and frontmatter
schema table.

docs/docs/api/appkit/ — regenerated typedoc for the new public
surface (fromPlugin, runAgent, AgentDefinition, AgentsPluginConfig,
ToolkitEntry, ToolkitOptions, all adapter types, and the agents
plugin factory).

Template

template/appkit.plugins.json — adds the agent plugin entry so
npx @databricks/appkit init --features agent scaffolds the plugin
correctly.

Test plan

  • Full appkit vitest suite: 1311 tests passing
  • Typecheck clean across all 8 workspace projects
  • pnpm docs:build clean (no broken links)
  • pnpm --filter=@databricks/appkit build:package clean, publint
    clean

Signed-off-by: MarioCadenas MarioCadenas@users.noreply.github.com

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 (this PR)

This 6-PR stack is a redesign of the earlier 13-PR stack (#282-#286, #293-#300), reorganized to eliminate mid-stack API churn. Reviewers never see code in this stack that later PRs delete. The old 13 PRs have been closed with references back here.

This was referenced Apr 21, 2026
@MarioCadenas MarioCadenas force-pushed the agent/v2/5-fromplugin-runagent branch from 162e970 to 29e3534 Compare April 21, 2026 20:41
@MarioCadenas MarioCadenas force-pushed the agent/v2/6-apps-docs branch from 57cc1e4 to 4a441d2 Compare April 21, 2026 20:41
@MarioCadenas MarioCadenas force-pushed the agent/v2/5-fromplugin-runagent branch from 29e3534 to b462716 Compare April 22, 2026 08:45
@MarioCadenas MarioCadenas force-pushed the agent/v2/6-apps-docs branch 2 times, most recently from d16cdd5 to e81d8bb Compare April 22, 2026 09:24
@MarioCadenas MarioCadenas force-pushed the agent/v2/5-fromplugin-runagent branch 2 times, most recently from 539487e to dac73b5 Compare April 22, 2026 09:46
@MarioCadenas MarioCadenas force-pushed the agent/v2/6-apps-docs branch from e81d8bb to 829ad13 Compare April 22, 2026 09:46
@MarioCadenas MarioCadenas force-pushed the agent/v2/5-fromplugin-runagent branch from dac73b5 to 624f2a0 Compare April 22, 2026 09:59
@MarioCadenas MarioCadenas force-pushed the agent/v2/6-apps-docs branch 2 times, most recently from 3386200 to 263f587 Compare April 22, 2026 10:21
@MarioCadenas MarioCadenas force-pushed the agent/v2/5-fromplugin-runagent branch 2 times, most recently from 0dd07a4 to becc889 Compare April 22, 2026 10:49
@MarioCadenas MarioCadenas force-pushed the agent/v2/6-apps-docs branch from 263f587 to 17a50bf Compare April 22, 2026 10:50
@MarioCadenas MarioCadenas force-pushed the agent/v2/5-fromplugin-runagent branch from becc889 to f290fe5 Compare April 22, 2026 12:20
@MarioCadenas MarioCadenas force-pushed the agent/v2/6-apps-docs branch from 17a50bf to d46dcca Compare April 22, 2026 12:20
@MarioCadenas MarioCadenas force-pushed the agent/v2/5-fromplugin-runagent branch from f290fe5 to a02bacf Compare April 22, 2026 15:49
@MarioCadenas MarioCadenas force-pushed the agent/v2/6-apps-docs branch from 993b21c to df55f4f Compare April 22, 2026 15:49
…template

Final layer of the agents feature stack. Everything needed to
exercise, demonstrate, and learn the feature.

`apps/agent-app/` — a standalone app purpose-built around the agents
feature. Ships with:

- `server.ts` — full example of code-defined agents via `fromPlugin`:
  ```ts
  const support = createAgent({
    instructions: "…",
    tools: {
      ...fromPlugin(analytics),
      ...fromPlugin(files),
      get_weather,
      "mcp.vector-search": mcpServer("vector-search", "https://…"),
    },
  });

  await createApp({
    plugins: [server({ port }), analytics(), files(), agents({ agents: { support } })],
  });
  ```
- `config/agents/assistant.md` — markdown-driven agent alongside the
  code-defined one, showing the asymmetric auto-inherit default.
- Vite + React 19 + TailwindCSS frontend with a chat UI.
- Databricks deployment config (`databricks.yml`, `app.yaml`) and
  deploy scripts.

`apps/dev-playground/client/src/routes/agent.route.tsx` — chat UI with
inline autocomplete (hits the `autocomplete` markdown agent) and a
full threaded conversation panel (hits the default agent).

`apps/dev-playground/server/index.ts` — adds a code-defined `helper`
agent using `fromPlugin(analytics)` alongside the markdown-driven
`autocomplete` agent in `config/agents/`. Exercises the mixed-style
setup (markdown + code) against the same plugin list.

`apps/dev-playground/config/agents/*.md` — both agents defined with
valid YAML frontmatter.

`docs/docs/plugins/agents.md` — progressive five-level guide:

1. Drop a markdown file → it just works.
2. Scope tools via `toolkits:` / `tools:` frontmatter.
3. Code-defined agents with `fromPlugin()`.
4. Sub-agents.
5. Standalone `runAgent()` (no `createApp` or HTTP).

Plus a configuration reference, runtime API reference, and frontmatter
schema table.

`docs/docs/api/appkit/` — regenerated typedoc for the new public
surface (fromPlugin, runAgent, AgentDefinition, AgentsPluginConfig,
ToolkitEntry, ToolkitOptions, all adapter types, and the agents
plugin factory).

`template/appkit.plugins.json` — adds the `agent` plugin entry so
`npx @databricks/appkit init --features agent` scaffolds the plugin
correctly.

- Full appkit vitest suite: 1311 tests passing
- Typecheck clean across all 8 workspace projects
- `pnpm docs:build` clean (no broken links)
- `pnpm --filter=@databricks/appkit build:package` clean, publint
  clean

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>

Documents the new `mcp` configuration block and the rules it enforces:
same-origin-only by default, explicit `trustedHosts` for external MCP
servers, plaintext `http://` refused outside localhost-in-dev, and
DNS-level blocking of private / link-local IP ranges (covers cloud
metadata services). See PR #302 for the policy implementation and
PR #304 for the `AgentsPluginConfig.mcp` wiring.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>

- `docs/docs/plugins/agents.md`: new "SQL agent tools" subsection
  covering `analytics.query` readOnly enforcement, `lakebase.query`
  opt-in via `exposeAsAgentTool`, and the approval flow. New
  "Human-in-the-loop approval for destructive tools" subsection
  documents the config, SSE event shape, and `POST /chat/approve`
  contract.

- `apps/agent-app`: approval-card component rendered inline in the
  chat stream whenever an `appkit.approval_pending` event arrives.
  Destructive badge + Approve/Deny buttons POST to
  `/api/agent/approve` with the carried `streamId`/`approvalId`.

- `apps/dev-playground/client`: matching approval-card on the agent
  route, using the existing appkit-ui `Button` component and
  Tailwind utility classes.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>

Updates `docs/docs/plugins/agents.md` to document the new
two-key auto-inherit model introduced in PR #302 (per-tool
`autoInheritable` flag) and PR #304 (safe-by-default
`autoInheritTools: { file: false, code: false }`). Adds an
"Auto-inherit posture" subsection explaining that the developer
must opt into `autoInheritTools` AND the plugin author must mark
each tool `autoInheritable: true` for a tool to spread without
explicit wiring.

Includes a table documenting the `autoInheritable` marking on each
core plugin tool, plus an example of the setup-time audit log so
operators can see exactly what's inherited vs. skipped.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>

- **Reference app no longer ships hardcoded dogfood URLs.** The three
  `https://e2-dogfood.staging.cloud.databricks.com/...` and
  `https://mario-mcp-hello-*.staging.aws.databricksapps.com/...` MCP
  URLs in `apps/agent-app/server.ts` are replaced with optional
  env-driven `VECTOR_SEARCH_MCP_URL` / `CUSTOM_MCP_URL` config. When
  set, their hostnames are auto-added to `agents({ mcp: { trustedHosts
  } })`. `.env.example` uses placeholder values the reader can replace
  instead of another team's workspace.

- **`appkit.agent` → `appkit.agents` in the reference app.** The
  prior `appkit.agent as { list, getDefault }` cast papered over the
  plugin-name mismatch fixed in PR #304. The runtime key now matches
  the docs, the manifest, and the factory name; the cast is gone.

- **Auto-inherit opt-in added to the reference config.** Since the
  defaults flipped to `{ file: false, code: false }` (PR #304, S-3),
  the reference now explicitly enables `autoInheritTools: { file:
  true }` so the markdown agents that ship alongside the code-defined
  one still pick up the analytics / files read-only tools. This is the
  pattern a real deployment should follow — opt in deliberately.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>

- `apps/dev-playground/config/agents/autocomplete.md` sets
  `ephemeral: true`. Each debounced autocomplete keystroke no longer
  leaves an orphan thread in `InMemoryThreadStore` — the server now
  deletes the thread in the stream's `finally` (PR #304). Closes R1
  from the MVP re-review.
- `docs/docs/plugins/agents.md` documents the new `ephemeral`
  frontmatter key alongside the other AgentDefinition knobs.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>

Documents the MVP resource caps landed in PR #304: the static
request-body caps (enforced by the Zod schemas) and the three
configurable runtime limits (`maxConcurrentStreamsPerUser`,
`maxToolCalls`, `maxSubAgentDepth`). Includes the config-block
shape in the main reference and a new "Resource limits" subsection
under the Configuration section explaining the intent and per-user
semantics of each cap.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
The agents plugin's manifest `name` is `agents` (plural), so routes mount
at `/api/agents/*` and its client config is keyed as `agents` — but three
call sites still referenced the old singular `agent`:

- apps/agent-app/src/App.tsx: /api/agent/{info,chat,approve} returned an
  Express 404 HTML page, which the client then tried to JSON.parse,
  producing "Unexpected token '<', <!DOCTYPE ...". Swap to /api/agents/*.
- apps/dev-playground/client/src/routes/agent.route.tsx: same three
  paths, plus getPluginClientConfig("agent") returned {} so
  hasAutocomplete was false and the autocomplete hook short-circuited
  before ever firing a request. Swap the lookup key to "agents".
- template/appkit.plugins.json: the scaffolded plugin descriptor still
  used the singular name/key, which would have broken fresh apps the
  same way. Align with the plugin's real manifest name.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
@MarioCadenas MarioCadenas force-pushed the agent/v2/5-fromplugin-runagent branch from a02bacf to a15aa42 Compare April 22, 2026 16:19
@MarioCadenas MarioCadenas force-pushed the agent/v2/6-apps-docs branch from df55f4f to 52715e9 Compare April 22, 2026 16:19
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