@databricks/appkit 0.81.0 → 0.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +1 -1
- package/dist/appkit/package.js +1 -1
- package/dist/cli/commands/plugin/create/create.js +20 -8
- package/dist/cli/commands/plugin/create/create.js.map +1 -1
- package/dist/cli/commands/plugin/create/scaffold.js +3 -1
- package/dist/cli/commands/plugin/create/scaffold.js.map +1 -1
- package/dist/cli/commands/registry/add.js +2 -7
- package/dist/cli/commands/registry/add.js.map +1 -1
- package/dist/cli/package-manager.js +65 -0
- package/dist/cli/package-manager.js.map +1 -0
- package/docs/development/templates.md +12 -11
- package/docs/plugins/agents.md +3 -1
- package/docs/plugins/execution-context.md +16 -0
- package/docs/plugins/model-serving.md +4 -0
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/sbom.cdx.json +1 -1
|
@@ -14,17 +14,18 @@ Files named with a `_` prefix are renamed to `.` prefix (e.g. `_gitignore` → `
|
|
|
14
14
|
|
|
15
15
|
### Template variables[](#template-variables "Direct link to Template variables")
|
|
16
16
|
|
|
17
|
-
| Variable | Description
|
|
18
|
-
| ----------------- |
|
|
19
|
-
| `.projectName` | Project name from `--name` or interactive prompt
|
|
20
|
-
| `.workspaceHost` | Databricks workspace URL
|
|
21
|
-
| `.profile` | Databricks CLI profile name (empty if using host-based auth)
|
|
22
|
-
| `.appDescription` | App description
|
|
23
|
-
| `.
|
|
24
|
-
| `.
|
|
25
|
-
| `.dotEnv.
|
|
26
|
-
| `.
|
|
27
|
-
| `.
|
|
17
|
+
| Variable | Description |
|
|
18
|
+
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| `.projectName` | Project name from `--name` or interactive prompt |
|
|
20
|
+
| `.workspaceHost` | Databricks workspace URL |
|
|
21
|
+
| `.profile` | Databricks CLI profile name (empty if using host-based auth) |
|
|
22
|
+
| `.appDescription` | App description |
|
|
23
|
+
| `.packageManager` | Selected package manager (`npm` or `pnpm`). Use `{{or .packageManager "pnpm"}}` to default to pnpm when an older CLI omits this variable. |
|
|
24
|
+
| `.plugins.<name>` | Non-nil for each selected plugin, enabling conditionals |
|
|
25
|
+
| `.dotEnv.content` | Generated `.env` content from plugin resources |
|
|
26
|
+
| `.dotEnv.example` | Generated `.env.example` content with placeholders |
|
|
27
|
+
| `.bundle.*` | Generated `databricks.yml` sections (variables, resources, target variables) |
|
|
28
|
+
| `.appEnv` | Generated `app.yaml` env entries |
|
|
28
29
|
|
|
29
30
|
### Conditional content[](#conditional-content "Direct link to Conditional content")
|
|
30
31
|
|
package/docs/plugins/agents.md
CHANGED
|
@@ -14,6 +14,8 @@ Streaming-capable serving endpoints only
|
|
|
14
14
|
|
|
15
15
|
The agents plugin drives the LLM over Server-Sent Events. Foundation Model APIs (Claude, Llama, GPT, etc.) and other chat-style endpoints support streaming and work out of the box. Custom model endpoints that return a single JSON response (e.g. typical `sklearn` or MLflow `pyfunc` deployments) do **not** stream — pointing an agent at one will fail with "Response body is null — streaming not supported" on the first turn. If you list a serving endpoint in `apps init`, pick one whose model implements the chat-completions streaming protocol; the agents plugin reads its name from `DATABRICKS_SERVING_ENDPOINT_NAME` whenever an agent doesn't pin `model:` itself.
|
|
16
16
|
|
|
17
|
+
`fromModelServing` (the serving-endpoint adapter) uses the OpenAI **chat-completions** streaming protocol, so it drives chat-completions serving endpoints (task type `agent/*/chat`) and Databricks foundation models. An endpoint on the Responses API (task type `agent/*/responses`, e.g. a `ResponsesAgent`) rejects a chat-completions request, so `fromModelServing` can't drive it.
|
|
18
|
+
|
|
17
19
|
For the non-streaming path against a custom endpoint, use the `serving` plugin's `/invoke` route with `useServingInvoke` instead.
|
|
18
20
|
|
|
19
21
|
Or skip serving-endpoint setup entirely with the managed [Supervisor API adapter](#managed-agents-the-supervisor-api-adapter) (beta).
|
|
@@ -163,7 +165,7 @@ Auto-inherit is **off for both origins by default** — a markdown or code agent
|
|
|
163
165
|
|
|
164
166
|
Deprecated: the `agents({ agents: { ... } })` map
|
|
165
167
|
|
|
166
|
-
Passing a hand-built agent map still works and is honored for backward compatibility, but it emits a one-time deprecation warning and will be removed in a future minor. It restates each agent's id (once in `createAgent`, once as the map key); discovery from `server/agents/` removes both the map and the restatement. Migrate by moving each `createAgent(...)` into its own `server/agents/<id>/agent.ts` (default or single named export) and dropping the map. If a discovered agent and a map entry share an id, discovery wins and the map entry is ignored (with a one-time warning). (Inline sub-agents — `createAgent({ agents: { ... } })` on a definition — are unaffected; only the plugin-level map is deprecated.)
|
|
168
|
+
Passing a hand-built agent map still works and is honored for backward compatibility, but it is deprecated as of 0.64.0: it emits a one-time deprecation warning and will be removed in a future minor. It restates each agent's id (once in `createAgent`, once as the map key); discovery from `server/agents/` removes both the map and the restatement. Migrate by moving each `createAgent(...)` into its own `server/agents/<id>/agent.ts` (default or single named export) and dropping the map. If a discovered agent and a map entry share an id, discovery wins and the map entry is ignored (with a one-time warning). (Inline sub-agents — `createAgent({ agents: { ... } })` on a definition — are unaffected; only the plugin-level map is deprecated.)
|
|
167
169
|
|
|
168
170
|
Some examples further down still pass agents inline via this map for snippet brevity — in a real app each of those `createAgent(...)` definitions lives in its own `server/agents/<id>/agent.ts` and needs no map.
|
|
169
171
|
|
|
@@ -30,6 +30,22 @@ router.post("/system/data", async (req, res) => {
|
|
|
30
30
|
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
## Which built-in surfaces run OBO vs service principal[](#which-built-in-surfaces-run-obo-vs-service-principal "Direct link to Which built-in surfaces run OBO vs service principal")
|
|
34
|
+
|
|
35
|
+
The default is the **service principal**: an operation runs on behalf of the user only when it goes through `asUser(req)`, which needs the forwarded user token. There is no global "OBO everywhere" mode, so identity is decided per surface:
|
|
36
|
+
|
|
37
|
+
| Surface | Runs as | Why |
|
|
38
|
+
| ----------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
39
|
+
| Genie routes | signed-in user (OBO) | the built-in route calls `asUser(req)` automatically |
|
|
40
|
+
| Files / Analytics ops via `asUser(req)` | signed-in user (OBO) | service principal by default; OBO only when you wrap the call in `asUser(req)` |
|
|
41
|
+
| Agents plugin `/chat` — the model (LLM) call | app service principal | the chat route does not call `asUser`, and the model adapter is built at startup with the service-principal client |
|
|
42
|
+
| Agents plugin — plugin-toolkit tool calls (`plugin:<name>`) | signed-in user (OBO) | dispatched through `asUser(req)` per call |
|
|
43
|
+
| Agents plugin — hand-rolled `tool({ execute })` | app service principal | receives only tool arguments, no `req`, so it can't opt into OBO |
|
|
44
|
+
| Standalone `runAgent` (no HTTP request) | app service principal | no request context, so neither the model nor any tool runs OBO |
|
|
45
|
+
| Serving plugin (deprecated) routes | signed-in user (OBO) | the built-in route calls `asUser(req)`; prefer the agents plugin |
|
|
46
|
+
|
|
47
|
+
So an agent's **model inference runs as the service principal**; only the plugin tools it calls over the built-in HTTP routes run on behalf of the user. See the [agents plugin](./docs/plugins/agents.md) for the tool-level detail.
|
|
48
|
+
|
|
33
49
|
## Context helper functions[](#context-helper-functions "Direct link to Context helper functions")
|
|
34
50
|
|
|
35
51
|
Exported from `@databricks/appkit`:
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Model Serving plugin
|
|
2
2
|
|
|
3
|
+
Deprecated in favor of the agents plugin
|
|
4
|
+
|
|
5
|
+
`serving()` (`useServingStream` / `useServingInvoke`) is deprecated as of AppKit 0.77.0; for chat and streaming, use the [agents plugin](./docs/plugins/agents.md) (`DatabricksAdapter.fromModelServing` + `useAgentChat`). The agents plugin drives only streaming chat-completions endpoints, so non-streaming custom model endpoints (`sklearn`/`pyfunc`) have no agents equivalent; `/invoke` still serves them until the plugin is removed.
|
|
6
|
+
|
|
3
7
|
Provides an authenticated proxy to [Databricks Model Serving](https://docs.databricks.com/aws/en/machine-learning/model-serving) endpoints, with invoke and streaming support.
|
|
4
8
|
|
|
5
9
|
**Key features:**
|
package/llms.txt
CHANGED
|
@@ -55,7 +55,7 @@ npx @databricks/appkit docs <query>
|
|
|
55
55
|
- [Jobs plugin](./docs/plugins/jobs.md): Trigger and monitor Databricks Lakeflow Jobs from your AppKit application.
|
|
56
56
|
- [Lakebase plugin](./docs/plugins/lakebase.md): Provides a PostgreSQL connection pool for Databricks Lakebase Autoscaling with automatic OAuth token refresh.
|
|
57
57
|
- [Plugin manifest](./docs/plugins/manifest.md): Every plugin ships a manifest.json next to its source code. The manifest declares plugin metadata, the Databricks resources the plugin needs, and any structured rules a scaffolding agent must honor when running databricks apps init. It is consumed at three stages:
|
|
58
|
-
- [Model Serving plugin](./docs/plugins/model-serving.md):
|
|
58
|
+
- [Model Serving plugin](./docs/plugins/model-serving.md): serving() (useServingStream / useServingInvoke) is deprecated as of AppKit 0.77.0; for chat and streaming, use the agents plugin (DatabricksAdapter.fromModelServing + useAgentChat). The agents plugin drives only streaming chat-completions endpoints, so non-streaming custom model endpoints (sklearn/pyfunc) have no agents equivalent; /invoke still serves them until the plugin is removed.
|
|
59
59
|
- [Plugin management](./docs/plugins/plugin-management.md): AppKit includes a CLI for managing plugins. All commands are available under npx @databricks/appkit plugin.
|
|
60
60
|
- [Server plugin](./docs/plugins/server.md): Provides HTTP server capabilities with development and production modes.
|
|
61
61
|
- [Plugin Stability Tiers](./docs/plugins/stability.md): AppKit plugins have a two-tier stability system that communicates API maturity and breaking-change expectations.
|