Commit db67f51
committed
feat(appkit): shared agent types and Databricks adapter
Foundation layer for the agents feature. Adds the portable type surface
that every downstream layer builds on, plus the Databricks Model Serving
adapter so the agents plugin (later PR) can target workspace-hosted
models.
### Shared agent types
`packages/shared/src/agent.ts` — no behavior, just the type vocabulary:
`AgentAdapter`, `AgentEvent`, `AgentInput`, `AgentRunContext`,
`AgentToolDefinition`, `Message`, `Thread`, `ThreadStore`,
`ToolAnnotations`, `ToolCall`, `ToolProvider`, `ResponseStreamEvent`.
Exported from the shared barrel.
### Adapter
`packages/appkit/src/agents/databricks.ts` — `DatabricksAdapter`:
streams OpenAI-compatible completions against a Databricks Model
Serving endpoint (raw fetch + SSE, no vendor SDKs). Also ships
`createDatabricksModel`, a Vercel-AI-SDK helper that returns a model
object you can pass to `streamText`/`useChat`/etc. — handles URL
rewriting (`/chat/completions` -> `/invocations`), per-request auth
refresh, and tool-name sanitization.
`@ai-sdk/openai` is a devDependency consumed by `createDatabricksModel`
via dynamic `import()`; consumers who use that helper install it
alongside `@databricks/appkit`.1 parent 28155e2 commit db67f51
8 files changed
Lines changed: 1480 additions & 2 deletions
File tree
- packages
- appkit
- src/agents
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| 100 | + | |
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
| |||
0 commit comments