@databricks/appkit 0.37.0 → 0.38.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 +3 -2
- package/dist/appkit/package.js +1 -1
- package/dist/cache/index.js +1 -2
- package/dist/cache/index.js.map +1 -1
- package/dist/cache/storage/persistent.js +1 -2
- package/dist/cache/storage/persistent.js.map +1 -1
- package/dist/cli/commands/plugin/add-resource/add-resource.js.map +1 -1
- package/dist/cli/commands/plugin/create/resource-defaults.js +2 -1
- package/dist/cli/commands/plugin/create/resource-defaults.js.map +1 -1
- package/dist/cli/commands/plugin/schema-resources.js +34 -51
- package/dist/cli/commands/plugin/schema-resources.js.map +1 -1
- package/dist/cli/commands/plugin/sync/sync.js +20 -6
- package/dist/cli/commands/plugin/sync/sync.js.map +1 -1
- package/dist/cli/commands/plugin/validate/validate-manifest.js +71 -157
- package/dist/cli/commands/plugin/validate/validate-manifest.js.map +1 -1
- package/dist/cli/commands/plugin/validate/validate.js +2 -2
- package/dist/cli/commands/plugin/validate/validate.js.map +1 -1
- package/dist/cli/commands/setup.js +2 -2
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/connectors/index.js +0 -1
- package/dist/connectors/jobs/client.js +1 -2
- package/dist/connectors/jobs/client.js.map +1 -1
- package/dist/connectors/lakebase/routing-pool.js +1 -2
- package/dist/connectors/lakebase/routing-pool.js.map +1 -1
- package/dist/connectors/sql-warehouse/client.js +1 -2
- package/dist/connectors/sql-warehouse/client.js.map +1 -1
- package/dist/context/execution-context.js +9 -13
- package/dist/context/execution-context.js.map +1 -1
- package/dist/context/index.js +3 -13
- package/dist/context/service-context.js +137 -136
- package/dist/context/service-context.js.map +1 -1
- package/dist/context/user-context.js +1 -5
- package/dist/context/user-context.js.map +1 -1
- package/dist/core/agent/create-agent.js +1 -2
- package/dist/core/agent/create-agent.js.map +1 -1
- package/dist/core/appkit.js +1 -2
- package/dist/core/appkit.js.map +1 -1
- package/dist/errors/authentication.js +44 -40
- package/dist/errors/authentication.js.map +1 -1
- package/dist/errors/base.js +86 -70
- package/dist/errors/base.js.map +1 -1
- package/dist/errors/configuration.js +70 -66
- package/dist/errors/configuration.js.map +1 -1
- package/dist/errors/connection.js +50 -46
- package/dist/errors/connection.js.map +1 -1
- package/dist/errors/execution.js +47 -43
- package/dist/errors/execution.js.map +1 -1
- package/dist/errors/index.js +10 -27
- package/dist/errors/initialization.js +38 -34
- package/dist/errors/initialization.js.map +1 -1
- package/dist/errors/server.js +34 -31
- package/dist/errors/server.js.map +1 -1
- package/dist/errors/tunnel.js +47 -43
- package/dist/errors/tunnel.js.map +1 -1
- package/dist/errors/validation.js +41 -37
- package/dist/errors/validation.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -9
- package/dist/plugin/dev-reader.js +1 -2
- package/dist/plugin/dev-reader.js.map +1 -1
- package/dist/plugin/interceptors/retry.js +1 -2
- package/dist/plugin/interceptors/retry.js.map +1 -1
- package/dist/plugin/interceptors/telemetry.js +1 -2
- package/dist/plugin/interceptors/telemetry.js.map +1 -1
- package/dist/plugin/plugin.js +2 -4
- package/dist/plugin/plugin.js.map +1 -1
- package/dist/plugins/analytics/analytics.js +1 -2
- package/dist/plugins/analytics/analytics.js.map +1 -1
- package/dist/plugins/analytics/manifest.js +9 -1
- package/dist/plugins/analytics/query.js +2 -4
- package/dist/plugins/analytics/query.js.map +1 -1
- package/dist/plugins/files/manifest.js +7 -1
- package/dist/plugins/files/plugin.js +3 -6
- package/dist/plugins/files/plugin.js.map +1 -1
- package/dist/plugins/genie/genie.js +1 -2
- package/dist/plugins/genie/genie.js.map +1 -1
- package/dist/plugins/genie/manifest.js +7 -1
- package/dist/plugins/jobs/plugin.js +2 -4
- package/dist/plugins/jobs/plugin.js.map +1 -1
- package/dist/plugins/lakebase/lakebase.js +1 -2
- package/dist/plugins/lakebase/lakebase.js.map +1 -1
- package/dist/plugins/lakebase/manifest.js +26 -4
- package/dist/plugins/server/index.js +1 -2
- package/dist/plugins/server/index.js.map +1 -1
- package/dist/plugins/server/vite-dev-server.js +1 -2
- package/dist/plugins/server/vite-dev-server.js.map +1 -1
- package/dist/plugins/serving/serving.js +1 -2
- package/dist/plugins/serving/serving.js.map +1 -1
- package/dist/registry/index.d.ts +1 -1
- package/dist/registry/manifest-loader.d.ts +4 -4
- package/dist/registry/manifest-loader.d.ts.map +1 -1
- package/dist/registry/manifest-loader.js +1 -2
- package/dist/registry/manifest-loader.js.map +1 -1
- package/dist/registry/resource-registry.js +1 -2
- package/dist/registry/resource-registry.js.map +1 -1
- package/dist/registry/types.d.ts +21 -7
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.generated.d.ts +1 -1
- package/dist/registry/types.generated.js +1 -1
- package/dist/registry/types.generated.js.map +1 -1
- package/dist/registry/types.js +3 -3
- package/dist/registry/types.js.map +1 -1
- package/dist/schemas/manifest.d.ts +1139 -0
- package/dist/schemas/manifest.d.ts.map +1 -0
- package/dist/schemas/manifest.js +524 -0
- package/dist/schemas/manifest.js.map +1 -0
- package/dist/shared/src/index.d.ts +1 -1
- package/dist/shared/src/plugin.d.ts +38 -7
- package/dist/shared/src/plugin.d.ts.map +1 -1
- package/dist/shared/src/schemas/manifest.d.ts +1110 -0
- package/dist/shared/src/schemas/manifest.d.ts.map +1 -0
- package/dist/stream/arrow-stream-processor.js +1 -2
- package/dist/stream/arrow-stream-processor.js.map +1 -1
- package/dist/stream/buffers.js +1 -2
- package/dist/stream/buffers.js.map +1 -1
- package/docs/api/appkit/Enumeration.ResourceType.md +1 -1
- package/docs/api/appkit/Interface.PluginManifest.md +57 -3
- package/docs/api/appkit/Interface.ResourceEntry.md +6 -4
- package/docs/api/appkit/Interface.ResourceRequirement.md +7 -61
- package/docs/api/appkit/TypeAlias.ResourceFieldEntry.md +6 -0
- package/docs/api/appkit.md +6 -6
- package/docs/app-management.md +1 -1
- package/docs/development/ai-assisted-development.md +2 -2
- package/docs/development/local-development.md +1 -1
- package/docs/development/remote-bridge.md +1 -1
- package/docs/development/templates.md +118 -12
- package/docs/development.md +1 -1
- package/docs/plugins/custom-plugins.md +33 -23
- package/docs/plugins/lakebase.md +1 -1
- package/docs/plugins/manifest.md +293 -0
- package/docs.md +2 -2
- package/llms.txt +3 -2
- package/package.json +3 -3
- package/sbom.cdx.json +1 -1
- package/dist/_virtual/_rolldown/runtime.js +0 -7
- package/dist/connectors/lakebase-v1/client.js +0 -15
- package/dist/connectors/lakebase-v1/client.js.map +0 -1
- package/dist/connectors/lakebase-v1/index.js +0 -3
- package/dist/context/index.js.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/schemas/plugin-manifest.generated.d.ts +0 -182
- package/dist/schemas/plugin-manifest.generated.d.ts.map +0 -1
- package/dist/schemas/plugin-manifest.schema.json +0 -489
- package/dist/schemas/template-plugins.schema.json +0 -113
- package/dist/shared/src/schemas/plugin-manifest.generated.d.ts +0 -182
- package/dist/shared/src/schemas/plugin-manifest.generated.d.ts.map +0 -1
- package/docs/api/appkit/Interface.ResourceFieldEntry.md +0 -82
package/docs/development.md
CHANGED
|
@@ -5,7 +5,7 @@ AppKit provides multiple development workflows to suit different needs: local de
|
|
|
5
5
|
## Prerequisites[](#prerequisites "Direct link to Prerequisites")
|
|
6
6
|
|
|
7
7
|
* [Node.js](https://nodejs.org) v22+ environment with `npm`
|
|
8
|
-
* Databricks CLI (
|
|
8
|
+
* Databricks CLI (v1.0.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
|
|
9
9
|
* A new Databricks app with AppKit installed. See [Bootstrap a new Databricks app](./docs.md#quick-start-options) for more details.
|
|
10
10
|
|
|
11
11
|
## Development flows[](#development-flows "Direct link to Development flows")
|
|
@@ -15,34 +15,42 @@ For a deeper understanding of the plugin structure, read on.
|
|
|
15
15
|
|
|
16
16
|
## Basic plugin example[](#basic-plugin-example "Direct link to Basic plugin example")
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Author the manifest as JSON, import it, and attach it to a [`Plugin`](./docs/api/appkit/Class.Plugin.md) subclass via `static manifest`. Export with `toPlugin()`:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
// my-plugin/manifest.json
|
|
22
|
+
{
|
|
23
|
+
"$schema": "https://databricks.github.io/appkit/schemas/plugin-manifest.schema.json",
|
|
24
|
+
"name": "my-plugin",
|
|
25
|
+
"displayName": "My Plugin",
|
|
26
|
+
"description": "A custom plugin",
|
|
27
|
+
"resources": {
|
|
28
|
+
"required": [
|
|
29
|
+
{
|
|
30
|
+
"type": "secret",
|
|
31
|
+
"alias": "apiKey",
|
|
32
|
+
"resourceKey": "api-key",
|
|
33
|
+
"description": "API key for external service",
|
|
34
|
+
"permission": "READ",
|
|
35
|
+
"fields": {
|
|
36
|
+
"scope": { "env": "MY_SECRET_SCOPE", "description": "Secret scope" },
|
|
37
|
+
"key": { "env": "MY_API_KEY", "description": "Secret key name" }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"optional": []
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
```
|
|
19
46
|
|
|
20
47
|
```typescript
|
|
48
|
+
// my-plugin/index.ts
|
|
21
49
|
import { Plugin, toPlugin, type PluginManifest } from "@databricks/appkit";
|
|
22
|
-
import
|
|
50
|
+
import manifest from "./manifest.json";
|
|
23
51
|
|
|
24
52
|
class MyPlugin extends Plugin {
|
|
25
|
-
static manifest =
|
|
26
|
-
name: "myPlugin",
|
|
27
|
-
displayName: "My Plugin",
|
|
28
|
-
description: "A custom plugin",
|
|
29
|
-
resources: {
|
|
30
|
-
required: [
|
|
31
|
-
{
|
|
32
|
-
type: "secret",
|
|
33
|
-
alias: "apiKey",
|
|
34
|
-
resourceKey: "apiKey",
|
|
35
|
-
description: "API key for external service",
|
|
36
|
-
permission: "READ",
|
|
37
|
-
fields: {
|
|
38
|
-
scope: { env: "MY_SECRET_SCOPE", description: "Secret scope" },
|
|
39
|
-
key: { env: "MY_API_KEY", description: "Secret key name" }
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
optional: []
|
|
44
|
-
}
|
|
45
|
-
} satisfies PluginManifest<"myPlugin">;
|
|
53
|
+
static manifest = manifest as PluginManifest<"my-plugin">;
|
|
46
54
|
|
|
47
55
|
async setup() {
|
|
48
56
|
// Initialize your plugin
|
|
@@ -67,6 +75,8 @@ export const myPlugin = toPlugin(MyPlugin);
|
|
|
67
75
|
|
|
68
76
|
```
|
|
69
77
|
|
|
78
|
+
JSON is the canonical authoring surface — it is what `appkit plugin sync` reads when aggregating manifests for templates. For the full v2.0 manifest contract (resources, discovery descriptors, scaffolding rules), see [Plugin manifest](./docs/plugins/manifest.md).
|
|
79
|
+
|
|
70
80
|
## Config-dependent resources[](#config-dependent-resources "Direct link to Config-dependent resources")
|
|
71
81
|
|
|
72
82
|
The manifest defines resources as either `required` (always needed) or `optional` (may be needed). For resources that become required based on plugin configuration, implement a static `getResourceRequirements(config)` method:
|
package/docs/plugins/lakebase.md
CHANGED
|
@@ -17,7 +17,7 @@ The easiest way to get started with the Lakebase plugin is to use the Databricks
|
|
|
17
17
|
### Prerequisites[](#prerequisites "Direct link to Prerequisites")
|
|
18
18
|
|
|
19
19
|
* [Node.js](https://nodejs.org) v22+ environment with `npm`
|
|
20
|
-
* Databricks CLI (
|
|
20
|
+
* Databricks CLI (v1.0.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
|
|
21
21
|
* A new Databricks app with AppKit installed. See [Bootstrap a new Databricks app](./docs.md#quick-start-options) for more details.
|
|
22
22
|
|
|
23
23
|
### Steps[](#steps "Direct link to Steps")
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
# Plugin manifest
|
|
2
|
+
|
|
3
|
+
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:
|
|
4
|
+
|
|
5
|
+
* **Authoring** — `import manifest from "./manifest.json"` and attach it to the `Plugin` subclass via `static manifest`.
|
|
6
|
+
* **Sync** — `appkit plugin sync --write` aggregates manifests from installed packages and local plugins into `appkit.plugins.json`.
|
|
7
|
+
* **Init** — `databricks apps init` reads `appkit.plugins.json` to drive plugin selection, resource prompts, and `.env` / `databricks.yml` / `app.yaml` generation.
|
|
8
|
+
|
|
9
|
+
This page documents the **v2.0** manifest contract. JSON Schema is published at `https://databricks.github.io/appkit/schemas/plugin-manifest.schema.json`; reference it via `$schema` for editor validation.
|
|
10
|
+
|
|
11
|
+
## Recommended pattern[](#recommended-pattern "Direct link to Recommended pattern")
|
|
12
|
+
|
|
13
|
+
Author the manifest as JSON, import it into the plugin module, and assert the type:
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
// packages/my-plugin/src/index.ts
|
|
17
|
+
import { Plugin, toPlugin } from "@databricks/appkit";
|
|
18
|
+
import type { PluginManifest } from "@databricks/appkit";
|
|
19
|
+
import manifest from "./manifest.json";
|
|
20
|
+
|
|
21
|
+
class MyPlugin extends Plugin {
|
|
22
|
+
static manifest = manifest as PluginManifest<"my-plugin">;
|
|
23
|
+
// ...
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const myPlugin = toPlugin(MyPlugin);
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
// packages/my-plugin/src/manifest.json
|
|
32
|
+
{
|
|
33
|
+
"$schema": "https://databricks.github.io/appkit/schemas/plugin-manifest.schema.json",
|
|
34
|
+
"name": "my-plugin",
|
|
35
|
+
"displayName": "My Plugin",
|
|
36
|
+
"description": "A custom plugin",
|
|
37
|
+
"resources": {
|
|
38
|
+
"required": [],
|
|
39
|
+
"optional": []
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
JSON is the canonical authoring surface — it is what `appkit plugin sync` reads. JS manifests (`manifest.js` / `manifest.cjs`) are ignored by default and require `--allow-js-manifest` to opt in (executes plugin code; trust required). For end-to-end CLI behavior, see [Plugin management](./docs/plugins/plugin-management.md).
|
|
46
|
+
|
|
47
|
+
## Required fields[](#required-fields "Direct link to Required fields")
|
|
48
|
+
|
|
49
|
+
| Field | Type | Notes |
|
|
50
|
+
| -------------------- | ----------------------- | --------------------------------------------------------------------- |
|
|
51
|
+
| `name` | `string` | Plugin identifier. Lowercase, starts with a letter, `[a-z0-9-]` only. |
|
|
52
|
+
| `displayName` | `string` | Shown in UI and CLI prompts. |
|
|
53
|
+
| `description` | `string` | Brief summary. |
|
|
54
|
+
| `resources.required` | `ResourceRequirement[]` | Resources the plugin cannot run without. |
|
|
55
|
+
| `resources.optional` | `ResourceRequirement[]` | Resources that enhance behavior but are not mandatory. |
|
|
56
|
+
|
|
57
|
+
## Resources[](#resources "Direct link to Resources")
|
|
58
|
+
|
|
59
|
+
A resource requirement declares one Databricks resource the plugin depends on. The shape is keyed by `type`; each type fixes its valid `permission` values (validated by the schema as a discriminated union):
|
|
60
|
+
|
|
61
|
+
| `type` | Permissions |
|
|
62
|
+
| --------------------- | ----------------------------------------------- |
|
|
63
|
+
| `secret` | `READ`, `WRITE`, `MANAGE` |
|
|
64
|
+
| `job` | `CAN_VIEW`, `CAN_MANAGE_RUN`, `CAN_MANAGE` |
|
|
65
|
+
| `sql_warehouse` | `CAN_USE`, `CAN_MANAGE` |
|
|
66
|
+
| `serving_endpoint` | `CAN_VIEW`, `CAN_QUERY`, `CAN_MANAGE` |
|
|
67
|
+
| `volume` | `READ_VOLUME`, `WRITE_VOLUME` |
|
|
68
|
+
| `vector_search_index` | `SELECT` |
|
|
69
|
+
| `uc_function` | `EXECUTE` |
|
|
70
|
+
| `uc_connection` | `USE_CONNECTION` |
|
|
71
|
+
| `database` | `CAN_CONNECT_AND_CREATE` |
|
|
72
|
+
| `postgres` | `CAN_CONNECT_AND_CREATE` |
|
|
73
|
+
| `genie_space` | `CAN_VIEW`, `CAN_RUN`, `CAN_EDIT`, `CAN_MANAGE` |
|
|
74
|
+
| `experiment` | `CAN_READ`, `CAN_EDIT`, `CAN_MANAGE` |
|
|
75
|
+
| `app` | `CAN_USE` |
|
|
76
|
+
|
|
77
|
+
Every requirement has:
|
|
78
|
+
|
|
79
|
+
* `alias` — human-readable label used in UI / CLI output.
|
|
80
|
+
* `resourceKey` — stable machine key (`[a-z][a-z0-9-]*`). Used for deduplication, env naming, and references in `app.yaml`. **Identity is keyed on `resourceKey`, not `alias`.**
|
|
81
|
+
* `description` — explains *why* this resource is needed; surfaces in interactive prompts.
|
|
82
|
+
* `fields` — map of field name → field entry (see below). At least one entry when present.
|
|
83
|
+
* `permission` — must match the type's allowed enum.
|
|
84
|
+
|
|
85
|
+
Single-value resource types (e.g. `sql_warehouse`) typically declare one field (`id`). Multi-value types (e.g. `secret`, `database`) declare several (`scope` + `key`, `instance_name` + `database_name`).
|
|
86
|
+
|
|
87
|
+
### Field entry[](#field-entry "Direct link to Field entry")
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"id": {
|
|
92
|
+
"env": "DATABRICKS_WAREHOUSE_ID",
|
|
93
|
+
"description": "SQL Warehouse ID",
|
|
94
|
+
"examples": ["1234abcd5678efgh"],
|
|
95
|
+
"discovery": { "type": "kind", "resourceKind": "warehouse" }
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
| Property | Description |
|
|
102
|
+
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
103
|
+
| `env` | Environment variable name written to `.env` and `app.yaml`. Must match `^[A-Z][A-Z0-9_]*$`. |
|
|
104
|
+
| `description` | Shown in interactive prompts and bundle variable descriptions. |
|
|
105
|
+
| `examples` | Sample values shown in field descriptions. |
|
|
106
|
+
| `localOnly` | When `true`, the field is generated for local `.env` only — the Databricks Apps platform auto-injects it at deploy time, so it is excluded from `app.yaml` and `databricks.yml`. |
|
|
107
|
+
| `bundleIgnore` | Excluded from `databricks.yml` variables (still written to `.env`). |
|
|
108
|
+
| `value` | Static default value. |
|
|
109
|
+
| `resolve` | CLI-side resolver name, formatted `<resource_type>:<field>` (e.g. `postgres:host`). The CLI populates the value from API calls during init. |
|
|
110
|
+
| `discovery` | Describes how the CLI lists candidate values — see below. |
|
|
111
|
+
|
|
112
|
+
### Configuration-dependent resources[](#configuration-dependent-resources "Direct link to Configuration-dependent resources")
|
|
113
|
+
|
|
114
|
+
The manifest distinguishes `required` from `optional` for static analysis. When a resource only becomes required based on the plugin's runtime config, list it under `optional` in the manifest and override at runtime via a static `getResourceRequirements(config)` method on the plugin class. See [Creating custom plugins](./docs/plugins/custom-plugins.md#config-dependent-resources).
|
|
115
|
+
|
|
116
|
+
## Resource discovery[](#resource-discovery "Direct link to Resource discovery")
|
|
117
|
+
|
|
118
|
+
Discovery describes how the CLI offers candidate values for a field during interactive init. There are two variants under `discovery`, discriminated by `type`:
|
|
119
|
+
|
|
120
|
+
### `kind` variant (preferred)[](#kind-variant-preferred "Direct link to kind-variant-preferred")
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"discovery": {
|
|
125
|
+
"type": "kind",
|
|
126
|
+
"resourceKind": "warehouse"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The `kind` variant references a well-known Databricks resource kind for which AppKit owns the listing command and response shape. This is the preferred form for first-party Databricks resources — plugin authors declare *what* to list, and AppKit owns *how* to list it.
|
|
133
|
+
|
|
134
|
+
Supported `resourceKind` values:
|
|
135
|
+
|
|
136
|
+
| `resourceKind` | Listed via |
|
|
137
|
+
| ------------------- | --------------------------------------------- |
|
|
138
|
+
| `warehouse` | `databricks warehouses list` |
|
|
139
|
+
| `genie_space` | `databricks genie list-spaces` |
|
|
140
|
+
| `volume` | `databricks volumes list {catalog} {schema}` |
|
|
141
|
+
| `postgres_project` | `databricks postgres list-projects` |
|
|
142
|
+
| `postgres_branch` | `databricks postgres list-branches {project}` |
|
|
143
|
+
| `postgres_database` | `databricks postgres list-databases {branch}` |
|
|
144
|
+
|
|
145
|
+
Supported options on the `kind` variant:
|
|
146
|
+
|
|
147
|
+
| Property | Description |
|
|
148
|
+
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
149
|
+
| `select` | Field name in the parsed CLI response used as the selected value (e.g. `"id"`, `"name"`, `"full_name"`). Defaults to the kind's natural identifier. |
|
|
150
|
+
| `display` | Field name shown to the user during selection. Defaults to `select`. |
|
|
151
|
+
| `dependsOn` | Name of a sibling field within the same resource that must resolve first (see [Field dependencies](#field-dependencies)). |
|
|
152
|
+
| `shortcut` | Single-value fast-path command that returns exactly one value, skipping interactive selection. |
|
|
153
|
+
|
|
154
|
+
### `cli` variant (escape hatch)[](#cli-variant-escape-hatch "Direct link to cli-variant-escape-hatch")
|
|
155
|
+
|
|
156
|
+
For resources outside the `kind` map, fall back to the `cli` variant:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"discovery": {
|
|
161
|
+
"type": "cli",
|
|
162
|
+
"cliCommand": "databricks custom-resource list --profile <PROFILE> --output json",
|
|
163
|
+
"selectField": ".id",
|
|
164
|
+
"displayField": ".name"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
| Property | Description |
|
|
171
|
+
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
172
|
+
| `cliCommand` | Full Databricks CLI command. **Must include the literal `<PROFILE>` placeholder** — the runner substitutes the user's CLI profile. Shell metacharacters (`;`, `\|`, `&`, `` ` ``, `$`, newlines) are rejected — executors pass arguments via argv, never `shell-exec` the string. |
|
|
173
|
+
| `selectField` | jq-style path to the field used as the selected value (e.g. `.id`, `.name`). |
|
|
174
|
+
| `displayField` | jq-style path to the field shown to the user. Defaults to `selectField`. |
|
|
175
|
+
| `dependsOn` | Sibling field that must resolve first. |
|
|
176
|
+
| `shortcut` | Single-value fast-path command. Same metacharacter restriction as `cliCommand`. |
|
|
177
|
+
|
|
178
|
+
The `cli` variant is intentionally minimal and may tighten in future versions. **Prefer the `kind` variant** for any resource AppKit knows about; it gives you a single source of truth for command + unwrap rules and guarantees forward-compat as AppKit refines the discovery contract.
|
|
179
|
+
|
|
180
|
+
### Field dependencies[](#field-dependencies "Direct link to Field dependencies")
|
|
181
|
+
|
|
182
|
+
When listing one resource depends on another (e.g. listing volumes requires a catalog and schema; listing Postgres branches requires a project), use `dependsOn` to declare ordering:
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"fields": {
|
|
187
|
+
"project": {
|
|
188
|
+
"discovery": { "type": "kind", "resourceKind": "postgres_project", "select": "name" }
|
|
189
|
+
},
|
|
190
|
+
"branch": {
|
|
191
|
+
"discovery": {
|
|
192
|
+
"type": "kind",
|
|
193
|
+
"resourceKind": "postgres_branch",
|
|
194
|
+
"select": "name",
|
|
195
|
+
"dependsOn": "project"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
`dependsOn` references a sibling field name within the same resource. The CLI prompts in dependency order and substitutes the resolved value into the parent command (e.g. `{project}` in `databricks postgres list-branches {project}`).
|
|
204
|
+
|
|
205
|
+
The schema validates the dependency graph at parse time:
|
|
206
|
+
|
|
207
|
+
* Dangling references (`dependsOn` pointing at a non-existent sibling) are rejected.
|
|
208
|
+
* Cycles are rejected with the chain listed (`a → b → a`).
|
|
209
|
+
|
|
210
|
+
### Transient prompts (`parents`)[](#transient-prompts-parents "Direct link to transient-prompts-parents")
|
|
211
|
+
|
|
212
|
+
Some `kind`-variant commands need values that are **not** sibling fields on the resource — they are query inputs the runner collects once and discards. AppKit declares these on the `kind` itself via a `parents` array on `RESOURCE_KIND_COMMANDS`.
|
|
213
|
+
|
|
214
|
+
The only kind that uses `parents` today is `volume`:
|
|
215
|
+
|
|
216
|
+
```text
|
|
217
|
+
volume → parents: ["catalog", "schema"]
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Before invoking `databricks volumes list {catalog} {schema} --profile <PROFILE> --output json`, the runner prompts the user for each `parents` entry as free text and substitutes the value into the matching `{name}` placeholder. Unlike `dependsOn`, the collected values are **not** persisted as resource fields — they exist only for the duration of the listing call.
|
|
222
|
+
|
|
223
|
+
Plugin authors do not declare `parents` in their manifest; it is part of the AppKit-owned `kind` contract and surfaces in the published JSON Schema alongside each kind's command template.
|
|
224
|
+
|
|
225
|
+
## Scaffolding rules[](#scaffolding-rules "Direct link to Scaffolding rules")
|
|
226
|
+
|
|
227
|
+
`scaffolding.rules` is the plugin-level handoff to scaffolding agents (LLM-driven runners, custom CLI workflows, the `databricks-apps` skill). It carries up to three short directive lists — `must`, `should`, `never` — that the agent honors when invoking `databricks apps init` with this plugin selected.
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"scaffolding": {
|
|
232
|
+
"rules": {
|
|
233
|
+
"should": [
|
|
234
|
+
"After init, run any database migrations for your chosen ORM before first request",
|
|
235
|
+
"After init, verify Lakebase connectivity with 'psql $PGHOST -c \"select 1\"'"
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
| Bucket | Semantics |
|
|
244
|
+
| -------- | ----------------------------------------------------- |
|
|
245
|
+
| `must` | The agent must perform the action. |
|
|
246
|
+
| `should` | Recommended action — agent applies unless overridden. |
|
|
247
|
+
| `never` | The agent must not perform the action. |
|
|
248
|
+
|
|
249
|
+
### Authoring contract[](#authoring-contract "Direct link to Authoring contract")
|
|
250
|
+
|
|
251
|
+
* Each entry is a single short directive, **capped at 120 characters** by the schema. Long prose fails validation; split it into discrete actionable items.
|
|
252
|
+
* The schema enforces both **per-bucket dedup** (no two entries with the same text inside one of `must` / `should` / `never`) and **cross-bucket dedup** (one entry cannot belong to two buckets at once).
|
|
253
|
+
* Use the `Before init` / `After init` prefix convention when ordering matters so consumers can sequence directives consistently.
|
|
254
|
+
|
|
255
|
+
### Substitutability gate[](#substitutability-gate "Direct link to Substitutability gate")
|
|
256
|
+
|
|
257
|
+
A rule belongs in the manifest **only if it cannot be expressed as structured data** somewhere else — a resource permission, a `discovery` descriptor, a `dependsOn` chain, a `requiredByTemplate` flag, a config field, or the field's `env` / `value` / `resolve` slot.
|
|
258
|
+
|
|
259
|
+
Examples of what **does** survive the gate:
|
|
260
|
+
|
|
261
|
+
* `"After init, run any database migrations for your chosen ORM before first request"` — runtime sequencing, not derivable from any resource shape.
|
|
262
|
+
* `"After init, configure the 'spaces' map in plugin config with alias-to-Space-ID mappings"` — config-population guidance the schema cannot encode.
|
|
263
|
+
|
|
264
|
+
Examples of what does **not** survive (and should be modeled instead):
|
|
265
|
+
|
|
266
|
+
* "Plugin X requires `READ_VOLUME` on its volume" → already encoded in the resource's `permission` field.
|
|
267
|
+
* "The runner must list Postgres branches after a project is chosen" → already encoded via `dependsOn`.
|
|
268
|
+
* "Prompt the user for catalog and schema before listing volumes" → already encoded via `RESOURCE_KIND_COMMANDS.volume.parents`.
|
|
269
|
+
|
|
270
|
+
If you find yourself writing prose that the schema could capture, extend the schema instead.
|
|
271
|
+
|
|
272
|
+
The rules block is propagated unchanged from the plugin manifest into the synced template manifest. See [Templates — `scaffolding.rules` propagation](./docs/development/templates.md#scaffoldingrules-propagation) for how the CLI merges plugin-level rules with the template-level rules block.
|
|
273
|
+
|
|
274
|
+
## Optional fields[](#optional-fields "Direct link to Optional fields")
|
|
275
|
+
|
|
276
|
+
| Field | Description |
|
|
277
|
+
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
278
|
+
| `author` | Author name or organization. |
|
|
279
|
+
| `version` | Plugin version, semver format (`X.Y.Z` or `X.Y.Z-prerelease`). |
|
|
280
|
+
| `repository` | URL to the plugin source. |
|
|
281
|
+
| `keywords` | Discovery keywords. |
|
|
282
|
+
| `license` | SPDX identifier. |
|
|
283
|
+
| `onSetupMessage` | One-shot message displayed after init. Use for short hints; prefer `scaffolding.rules` for actionable directives an agent must enforce. |
|
|
284
|
+
| `hidden` | When `true`, the plugin is excluded from the synced template manifest. |
|
|
285
|
+
| `stability` | `"beta"` or `"ga"`. Beta plugins may break across minor releases — see [Plugin stability tiers](./docs/plugins/stability.md). |
|
|
286
|
+
| `config.schema` | JSON Schema for the plugin's runtime config (used by the type generator and for validation). |
|
|
287
|
+
|
|
288
|
+
## See also[](#see-also "Direct link to See also")
|
|
289
|
+
|
|
290
|
+
* [Creating custom plugins](./docs/plugins/custom-plugins.md) — building a plugin from scratch.
|
|
291
|
+
* [Plugin management](./docs/plugins/plugin-management.md) — `appkit plugin sync`, `create`, `validate`, `add-resource`.
|
|
292
|
+
* [Templates](./docs/development/templates.md) — how the synced template manifest drives `databricks apps init`.
|
|
293
|
+
* [`PluginManifest` API reference](./docs/api/appkit/Interface.PluginManifest.md) — TypeScript type.
|
package/docs.md
CHANGED
|
@@ -19,7 +19,7 @@ AppKit simplifies building data applications on Databricks by providing:
|
|
|
19
19
|
## Prerequisites[](#prerequisites "Direct link to Prerequisites")
|
|
20
20
|
|
|
21
21
|
* [Node.js](https://nodejs.org) v22+ environment with `npm`
|
|
22
|
-
* Databricks CLI (
|
|
22
|
+
* Databricks CLI (v1.0.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
|
|
23
23
|
|
|
24
24
|
## Quick start options[](#quick-start-options "Direct link to Quick start options")
|
|
25
25
|
|
|
@@ -37,7 +37,7 @@ Databricks AppKit is designed to work with AI coding assistants through Agent Sk
|
|
|
37
37
|
Install Agent Skills and configure it for use with your preferred AI assistant:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
databricks
|
|
40
|
+
databricks aitools install
|
|
41
41
|
|
|
42
42
|
```
|
|
43
43
|
|
package/llms.txt
CHANGED
|
@@ -52,6 +52,7 @@ npx @databricks/appkit docs <query>
|
|
|
52
52
|
- [Genie plugin](./docs/plugins/genie.md): Integrates Databricks AI/BI Genie spaces into your AppKit application, enabling natural language data queries via a conversational interface.
|
|
53
53
|
- [Jobs plugin](./docs/plugins/jobs.md): Trigger and monitor Databricks Lakeflow Jobs from your AppKit application.
|
|
54
54
|
- [Lakebase plugin](./docs/plugins/lakebase.md): Provides a PostgreSQL connection pool for Databricks Lakebase Autoscaling with automatic OAuth token refresh.
|
|
55
|
+
- [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:
|
|
55
56
|
- [Model Serving plugin](./docs/plugins/model-serving.md): Provides an authenticated proxy to Databricks Model Serving endpoints, with invoke and streaming support.
|
|
56
57
|
- [Plugin management](./docs/plugins/plugin-management.md): AppKit includes a CLI for managing plugins. All commands are available under npx @databricks/appkit plugin.
|
|
57
58
|
- [Server plugin](./docs/plugins/server.md): Provides HTTP server capabilities with development and production modes.
|
|
@@ -76,7 +77,7 @@ npx @databricks/appkit docs <query>
|
|
|
76
77
|
- [Class: TunnelError](./docs/api/appkit/Class.TunnelError.md): Error thrown when remote tunnel operations fail.
|
|
77
78
|
- [Class: ValidationError](./docs/api/appkit/Class.ValidationError.md): Error thrown when input validation fails.
|
|
78
79
|
- [Enumeration: RequestedClaimsPermissionSet](./docs/api/appkit/Enumeration.RequestedClaimsPermissionSet.md): Permission set for Unity Catalog table access
|
|
79
|
-
- [Enumeration: ResourceType](./docs/api/appkit/Enumeration.ResourceType.md): Resource types from
|
|
80
|
+
- [Enumeration: ResourceType](./docs/api/appkit/Enumeration.ResourceType.md): Resource types from resourceTypeSchema.options
|
|
80
81
|
- [Function: agentIdFromMarkdownPath()](./docs/api/appkit/Function.agentIdFromMarkdownPath.md): Derives the logical agent id from a markdown path. When the file is named
|
|
81
82
|
- [Function: appKitServingTypesPlugin()](./docs/api/appkit/Function.appKitServingTypesPlugin.md): Vite plugin to generate TypeScript types for AppKit serving endpoints.
|
|
82
83
|
- [Function: appKitTypesPlugin()](./docs/api/appkit/Function.appKitTypesPlugin.md): Vite plugin to generate types for AppKit queries.
|
|
@@ -141,7 +142,6 @@ npx @databricks/appkit docs <query>
|
|
|
141
142
|
- [Interface: RequestedClaims](./docs/api/appkit/Interface.RequestedClaims.md): Optional claims for fine-grained Unity Catalog table permissions
|
|
142
143
|
- [Interface: RequestedResource](./docs/api/appkit/Interface.RequestedResource.md): Resource to request permissions for in Unity Catalog
|
|
143
144
|
- [Interface: ResourceEntry](./docs/api/appkit/Interface.ResourceEntry.md): Internal representation of a resource in the registry.
|
|
144
|
-
- [Interface: ResourceFieldEntry](./docs/api/appkit/Interface.ResourceFieldEntry.md): Defines a single field for a resource. Each field has its own environment variable and optional description. Single-value types use one key (e.g. id); multi-value types (database, secret) use multiple (e.g. instancename, databasename or scope, key).
|
|
145
145
|
- [Interface: ResourceRequirement](./docs/api/appkit/Interface.ResourceRequirement.md): Declares a resource requirement for a plugin.
|
|
146
146
|
- [Interface: RunAgentInput](./docs/api/appkit/Interface.RunAgentInput.md): Properties
|
|
147
147
|
- [Interface: RunAgentResult](./docs/api/appkit/Interface.RunAgentResult.md): Properties
|
|
@@ -174,6 +174,7 @@ npx @databricks/appkit docs <query>
|
|
|
174
174
|
- [Type Alias: PluginData<T, U, N>](./docs/api/appkit/TypeAlias.PluginData.md): Tuple of plugin class, config, and name. Created by toPlugin() and passed to createApp().
|
|
175
175
|
- [Type Alias: Plugins](./docs/api/appkit/TypeAlias.Plugins.md): Plugin map passed to the function form of AgentDefinition.tools.
|
|
176
176
|
- [Type Alias: ResolvedToolEntry](./docs/api/appkit/TypeAlias.ResolvedToolEntry.md): Internal tool-index entry after a tool record has been resolved to a dispatchable form.
|
|
177
|
+
- [Type Alias: ResourceFieldEntry](./docs/api/appkit/TypeAlias.ResourceFieldEntry.md)
|
|
177
178
|
- [Type Alias: ResourcePermission](./docs/api/appkit/TypeAlias.ResourcePermission.md): Union of all possible permission levels across all resource types.
|
|
178
179
|
- [Type Alias: ServingFactory](./docs/api/appkit/TypeAlias.ServingFactory.md): Factory function returned by AppKit.serving.
|
|
179
180
|
- [Type Alias: ToolRegistry](./docs/api/appkit/TypeAlias.ToolRegistry.md)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/appkit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.38.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"clean": "rm -rf dist tmp",
|
|
42
42
|
"dist": "tsx ../../tools/dist-appkit.ts",
|
|
43
43
|
"tarball": "rm -rf tmp && pnpm dist && npm pack ./tmp --pack-destination ./tmp",
|
|
44
|
+
"tarball:prerelease": "rm -rf tmp && SHORTSHA=$(git rev-parse --short HEAD) && pnpm dist --prerelease $SHORTSHA && npm pack ./tmp --pack-destination ./tmp",
|
|
44
45
|
"typecheck": "tsc --noEmit",
|
|
45
46
|
"postinstall": "node scripts/postinstall.js"
|
|
46
47
|
},
|
|
@@ -76,8 +77,7 @@
|
|
|
76
77
|
"vite": "npm:rolldown-vite@7.1.14",
|
|
77
78
|
"ws": "8.18.3",
|
|
78
79
|
"zod": "4.3.6",
|
|
79
|
-
"
|
|
80
|
-
"ajv-formats": "3.0.1",
|
|
80
|
+
"@standard-schema/spec": "1.1.0",
|
|
81
81
|
"@clack/prompts": "1.0.1",
|
|
82
82
|
"commander": "12.1.0"
|
|
83
83
|
},
|