Skip to content

Commit db67f51

Browse files
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

knip.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"docs"
88
],
99
"workspaces": {
10-
"packages/appkit": {},
1110
"packages/appkit-ui": {
1211
"ignoreDependencies": ["tailwindcss", "tw-animate-css"]
1312
}
@@ -17,6 +16,11 @@
1716
"**/*.example.tsx",
1817
"**/*.css",
1918
"packages/appkit/src/plugins/vector-search/**",
19+
"packages/appkit/src/plugin/index.ts",
20+
"packages/appkit/src/plugins/agents/index.ts",
21+
"packages/appkit/src/plugins/agents/tools/index.ts",
22+
"packages/appkit/src/plugins/agents/from-plugin.ts",
23+
"packages/appkit/src/plugins/agents/load-agents.ts",
2024
"template/**",
2125
"tools/**",
2226
"docs/**"

packages/appkit/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
"development": "./src/index.ts",
3030
"default": "./dist/index.js"
3131
},
32+
"./agents/databricks": {
33+
"development": "./src/agents/databricks.ts",
34+
"default": "./dist/agents/databricks.js"
35+
},
3236
"./type-generator": {
3337
"types": "./dist/type-generator/index.d.ts",
3438
"development": "./src/type-generator/index.ts",
@@ -93,6 +97,7 @@
9397
"publishConfig": {
9498
"exports": {
9599
".": "./dist/index.js",
100+
"./agents/databricks": "./dist/agents/databricks.js",
96101
"./dist/shared/src/plugin": "./dist/shared/src/plugin.d.ts",
97102
"./type-generator": "./dist/type-generator/index.js",
98103
"./package.json": "./package.json"

0 commit comments

Comments
 (0)