Skip to content

Commit eb19da1

Browse files
committed
chore: plugin manifest definition
chore: make plugin manifest required All plugins must now declare a static manifest property with their metadata and resource requirements. This simplifies the manifest loader and provides better error messages.
1 parent 2e1be40 commit eb19da1

23 files changed

+1110
-3
lines changed

docs/docs/api/appkit/Class.Plugin.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
11
# Abstract Class: Plugin\<TConfig\>
22

3-
Base abstract class for creating AppKit plugins
3+
Base abstract class for creating AppKit plugins.
4+
5+
Plugins can optionally declare their resource requirements through:
6+
1. A static `manifest` property - recommended for all plugins
7+
2. A static `getResourceRequirements()` method - for dynamic requirements
8+
9+
## Example
10+
11+
```typescript
12+
import { Plugin, toPlugin, PluginManifest, ResourceType } from '@databricks/appkit';
13+
14+
// Define manifest
15+
const myManifest: PluginManifest = {
16+
name: 'myPlugin',
17+
displayName: 'My Plugin',
18+
description: 'Does something awesome',
19+
resources: {
20+
required: [
21+
{
22+
type: ResourceType.SQL_WAREHOUSE,
23+
alias: 'warehouse',
24+
description: 'SQL Warehouse for queries',
25+
permission: 'CAN_USE',
26+
env: 'DATABRICKS_WAREHOUSE_ID'
27+
}
28+
],
29+
optional: []
30+
}
31+
};
32+
33+
class MyPlugin extends Plugin<MyConfig> {
34+
static manifest = myManifest;
35+
// ... implementation
36+
}
37+
```
438

539
## Type Parameters
640

@@ -86,6 +120,8 @@ protected isReady: boolean = false;
86120
name: string;
87121
```
88122

123+
Plugin name identifier.
124+
89125
#### Implementation of
90126

91127
```ts
@@ -116,6 +152,11 @@ protected telemetry: ITelemetry;
116152
static phase: PluginPhase = "normal";
117153
```
118154

155+
Plugin initialization phase.
156+
- 'core': Initialized first (e.g., config plugins)
157+
- 'normal': Initialized second (most plugins)
158+
- 'deferred': Initialized last (e.g., server plugin)
159+
119160
## Methods
120161

121162
### abortActiveOperations()
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Enumeration: ResourceType
2+
3+
Supported Databricks resource types that plugins can depend on.
4+
5+
## Enumeration Members
6+
7+
### JOB
8+
9+
```ts
10+
JOB: "job";
11+
```
12+
13+
Databricks Job for scheduled or triggered workflows
14+
15+
***
16+
17+
### LAKEBASE
18+
19+
```ts
20+
LAKEBASE: "lakebase";
21+
```
22+
23+
Lakebase instance for persistent caching or data storage
24+
25+
***
26+
27+
### SECRET\_SCOPE
28+
29+
```ts
30+
SECRET_SCOPE: "secret-scope";
31+
```
32+
33+
Secret scope for secure credential storage
34+
35+
***
36+
37+
### SERVING\_ENDPOINT
38+
39+
```ts
40+
SERVING_ENDPOINT: "serving-endpoint";
41+
```
42+
43+
Model serving endpoint for ML inference
44+
45+
***
46+
47+
### SQL\_WAREHOUSE
48+
49+
```ts
50+
SQL_WAREHOUSE: "sql-warehouse";
51+
```
52+
53+
Databricks SQL Warehouse for query execution
54+
55+
***
56+
57+
### UNITY\_CATALOG
58+
59+
```ts
60+
UNITY_CATALOG: "unity-catalog";
61+
```
62+
63+
Unity Catalog for data governance and metadata
64+
65+
***
66+
67+
### VECTOR\_SEARCH\_INDEX
68+
69+
```ts
70+
VECTOR_SEARCH_INDEX: "vector-search-index";
71+
```
72+
73+
Vector search index for similarity search
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Interface: ConfigSchema
2+
3+
Configuration schema definition for plugin config.
4+
Uses JSON Schema format for validation and documentation.
5+
6+
## Indexable
7+
8+
```ts
9+
[key: string]: unknown
10+
```
11+
12+
Allow additional JSON Schema properties
13+
14+
## Properties
15+
16+
### additionalProperties?
17+
18+
```ts
19+
optional additionalProperties: boolean;
20+
```
21+
22+
***
23+
24+
### items?
25+
26+
```ts
27+
optional items: ConfigSchema;
28+
```
29+
30+
***
31+
32+
### properties?
33+
34+
```ts
35+
optional properties: Record<string, ConfigSchemaProperty>;
36+
```
37+
38+
***
39+
40+
### required?
41+
42+
```ts
43+
optional required: string[];
44+
```
45+
46+
***
47+
48+
### type
49+
50+
```ts
51+
type: "string" | "number" | "boolean" | "object" | "array";
52+
```
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Interface: ConfigSchemaProperty
2+
3+
Individual property definition in a config schema.
4+
5+
## Properties
6+
7+
### default?
8+
9+
```ts
10+
optional default: unknown;
11+
```
12+
13+
***
14+
15+
### description?
16+
17+
```ts
18+
optional description: string;
19+
```
20+
21+
***
22+
23+
### enum?
24+
25+
```ts
26+
optional enum: unknown[];
27+
```
28+
29+
***
30+
31+
### items?
32+
33+
```ts
34+
optional items: ConfigSchemaProperty;
35+
```
36+
37+
***
38+
39+
### maximum?
40+
41+
```ts
42+
optional maximum: number;
43+
```
44+
45+
***
46+
47+
### maxLength?
48+
49+
```ts
50+
optional maxLength: number;
51+
```
52+
53+
***
54+
55+
### minimum?
56+
57+
```ts
58+
optional minimum: number;
59+
```
60+
61+
***
62+
63+
### minLength?
64+
65+
```ts
66+
optional minLength: number;
67+
```
68+
69+
***
70+
71+
### properties?
72+
73+
```ts
74+
optional properties: Record<string, ConfigSchemaProperty>;
75+
```
76+
77+
***
78+
79+
### type
80+
81+
```ts
82+
type: "string" | "number" | "boolean" | "object" | "array";
83+
```
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Interface: PluginManifest
2+
3+
Plugin manifest that declares metadata and resource requirements.
4+
Attached to plugin classes as a static property.
5+
6+
## Properties
7+
8+
### author?
9+
10+
```ts
11+
optional author: string;
12+
```
13+
14+
Optional metadata for community plugins
15+
16+
***
17+
18+
### config?
19+
20+
```ts
21+
optional config: {
22+
schema: ConfigSchema;
23+
};
24+
```
25+
26+
Configuration schema for the plugin.
27+
Defines the shape and validation rules for plugin config.
28+
29+
#### schema
30+
31+
```ts
32+
schema: ConfigSchema;
33+
```
34+
35+
***
36+
37+
### description
38+
39+
```ts
40+
description: string;
41+
```
42+
43+
Brief description of what the plugin does
44+
45+
***
46+
47+
### displayName
48+
49+
```ts
50+
displayName: string;
51+
```
52+
53+
Human-readable display name for UI/CLI
54+
55+
***
56+
57+
### keywords?
58+
59+
```ts
60+
optional keywords: string[];
61+
```
62+
63+
***
64+
65+
### license?
66+
67+
```ts
68+
optional license: string;
69+
```
70+
71+
***
72+
73+
### name
74+
75+
```ts
76+
name: string;
77+
```
78+
79+
Plugin identifier (matches plugin.name)
80+
81+
***
82+
83+
### repository?
84+
85+
```ts
86+
optional repository: string;
87+
```
88+
89+
***
90+
91+
### resources
92+
93+
```ts
94+
resources: {
95+
optional: Omit<ResourceRequirement, "required">[];
96+
required: Omit<ResourceRequirement, "required">[];
97+
};
98+
```
99+
100+
Resource requirements declaration
101+
102+
#### optional
103+
104+
```ts
105+
optional: Omit<ResourceRequirement, "required">[];
106+
```
107+
108+
Resources that enhance functionality but are not mandatory
109+
110+
#### required
111+
112+
```ts
113+
required: Omit<ResourceRequirement, "required">[];
114+
```
115+
116+
Resources that must be available for the plugin to function
117+
118+
***
119+
120+
### version?
121+
122+
```ts
123+
optional version: string;
124+
```

0 commit comments

Comments
 (0)