@databricks/appkit 0.71.0 → 0.73.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 +63 -0
- package/NOTICE.md +3 -2
- package/dist/appkit/package.js +1 -1
- package/dist/beta.d.ts +18 -3
- package/dist/beta.js +14 -1
- package/dist/cli/commands/agent/eval.js +120 -0
- package/dist/cli/commands/agent/eval.js.map +1 -0
- package/dist/cli/commands/agent/index.js +18 -0
- package/dist/cli/commands/agent/index.js.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/connectors/index.js +2 -0
- package/dist/connectors/mlflow/auth.d.ts +28 -0
- package/dist/connectors/mlflow/auth.d.ts.map +1 -0
- package/dist/connectors/mlflow/auth.js +70 -0
- package/dist/connectors/mlflow/auth.js.map +1 -0
- package/dist/connectors/mlflow/client.d.ts +51 -0
- package/dist/connectors/mlflow/client.d.ts.map +1 -0
- package/dist/connectors/mlflow/client.js +93 -0
- package/dist/connectors/mlflow/client.js.map +1 -0
- package/dist/connectors/mlflow/index.d.ts +2 -0
- package/dist/database/errors.js +15 -5
- package/dist/database/errors.js.map +1 -1
- package/dist/database/runtime/data-path.d.ts +7 -0
- package/dist/database/runtime/data-path.d.ts.map +1 -0
- package/dist/database/runtime/data-path.js.map +1 -1
- package/dist/database/runtime/engine/drizzle-data-path.js +7 -5
- package/dist/database/runtime/engine/drizzle-data-path.js.map +1 -1
- package/dist/database/schema-builder/define-schema.d.ts +1 -1
- package/dist/database/schema-builder/define-schema.js +1 -1
- package/dist/database/schema-builder/define-schema.js.map +1 -1
- package/dist/errors/database-validation.d.ts +23 -0
- package/dist/errors/database-validation.d.ts.map +1 -0
- package/dist/errors/database-validation.js +24 -0
- package/dist/errors/database-validation.js.map +1 -0
- package/dist/errors/index.js +1 -0
- package/dist/evals/dataset.d.ts +36 -0
- package/dist/evals/dataset.d.ts.map +1 -0
- package/dist/evals/dataset.js +36 -0
- package/dist/evals/dataset.js.map +1 -0
- package/dist/evals/define-eval.d.ts +26 -0
- package/dist/evals/define-eval.d.ts.map +1 -0
- package/dist/evals/define-eval.js +28 -0
- package/dist/evals/define-eval.js.map +1 -0
- package/dist/evals/discover.d.ts +20 -0
- package/dist/evals/discover.d.ts.map +1 -0
- package/dist/evals/discover.js +49 -0
- package/dist/evals/discover.js.map +1 -0
- package/dist/evals/http-driver.d.ts +33 -0
- package/dist/evals/http-driver.d.ts.map +1 -0
- package/dist/evals/http-driver.js +123 -0
- package/dist/evals/http-driver.js.map +1 -0
- package/dist/evals/index.d.ts +14 -0
- package/dist/evals/index.js +14 -0
- package/dist/evals/judge.d.ts +27 -0
- package/dist/evals/judge.d.ts.map +1 -0
- package/dist/evals/judge.js +77 -0
- package/dist/evals/judge.js.map +1 -0
- package/dist/evals/matchers.d.ts +12 -0
- package/dist/evals/matchers.d.ts.map +1 -0
- package/dist/evals/matchers.js +26 -0
- package/dist/evals/matchers.js.map +1 -0
- package/dist/evals/mlflow-report.d.ts +37 -0
- package/dist/evals/mlflow-report.d.ts.map +1 -0
- package/dist/evals/mlflow-report.js +161 -0
- package/dist/evals/mlflow-report.js.map +1 -0
- package/dist/evals/mlflow-run.d.ts +13 -0
- package/dist/evals/mlflow-run.d.ts.map +1 -0
- package/dist/evals/mlflow-run.js +101 -0
- package/dist/evals/mlflow-run.js.map +1 -0
- package/dist/evals/pool.js +24 -0
- package/dist/evals/pool.js.map +1 -0
- package/dist/evals/report.d.ts +25 -0
- package/dist/evals/report.d.ts.map +1 -0
- package/dist/evals/report.js +57 -0
- package/dist/evals/report.js.map +1 -0
- package/dist/evals/run-eval.d.ts +23 -0
- package/dist/evals/run-eval.d.ts.map +1 -0
- package/dist/evals/run-eval.js +152 -0
- package/dist/evals/run-eval.js.map +1 -0
- package/dist/evals/run-evals.d.ts +94 -0
- package/dist/evals/run-evals.d.ts.map +1 -0
- package/dist/evals/run-evals.js +257 -0
- package/dist/evals/run-evals.js.map +1 -0
- package/dist/evals/types.d.ts +163 -0
- package/dist/evals/types.d.ts.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/plugin.js +1 -1
- package/dist/plugin/plugin.js.map +1 -1
- package/dist/plugins/agents/agents.js +1 -1
- package/dist/plugins/database/crud/contract.js +17 -8
- package/dist/plugins/database/crud/contract.js.map +1 -1
- package/dist/plugins/database/crud/exposure.js +63 -22
- package/dist/plugins/database/crud/exposure.js.map +1 -1
- package/dist/plugins/database/crud/request.js +50 -0
- package/dist/plugins/database/crud/request.js.map +1 -0
- package/dist/plugins/database/crud/response.js +77 -0
- package/dist/plugins/database/crud/response.js.map +1 -0
- package/dist/plugins/database/crud/routes.js +71 -52
- package/dist/plugins/database/crud/routes.js.map +1 -1
- package/dist/plugins/database/database.d.ts +6 -4
- package/dist/plugins/database/database.d.ts.map +1 -1
- package/dist/plugins/database/database.js +46 -16
- package/dist/plugins/database/database.js.map +1 -1
- package/dist/plugins/database/defaults.js +5 -1
- package/dist/plugins/database/defaults.js.map +1 -1
- package/dist/plugins/database/entity-client.js +143 -10
- package/dist/plugins/database/entity-client.js.map +1 -1
- package/dist/plugins/database/entity-types.d.ts +1 -1
- package/dist/plugins/database/hooks.d.ts +38 -0
- package/dist/plugins/database/hooks.d.ts.map +1 -0
- package/dist/plugins/database/index.d.ts +3 -2
- package/dist/plugins/database/lifecycle.js +67 -28
- package/dist/plugins/database/lifecycle.js.map +1 -1
- package/dist/plugins/database/scope.js +58 -0
- package/dist/plugins/database/scope.js.map +1 -0
- package/dist/plugins/database/types.d.ts +40 -12
- package/dist/plugins/database/types.d.ts.map +1 -1
- package/docs/api/appkit/Class.AppKitError.md +1 -0
- package/docs/api/appkit/Class.DatabaseValidationError.md +191 -0
- package/docs/api/appkit/Class.MlflowClient.md +103 -0
- package/docs/api/appkit/Function.buildAssessments.md +16 -0
- package/docs/api/appkit/Function.configureJudge.md +18 -0
- package/docs/api/appkit/Function.createHttpDriver.md +18 -0
- package/docs/api/appkit/Function.defineEval.md +35 -0
- package/docs/api/appkit/Function.defineSchema.md +1 -1
- package/docs/api/appkit/Function.discoverEvalFiles.md +18 -0
- package/docs/api/appkit/Function.equals.md +18 -0
- package/docs/api/appkit/Function.evalGlyph.md +18 -0
- package/docs/api/appkit/Function.formatEvalDetail.md +18 -0
- package/docs/api/appkit/Function.formatEvalHeadline.md +18 -0
- package/docs/api/appkit/Function.formatEvalResults.md +18 -0
- package/docs/api/appkit/Function.formatSummaryLine.md +18 -0
- package/docs/api/appkit/Function.includes.md +18 -0
- package/docs/api/appkit/Function.isJudgeConfigured.md +10 -0
- package/docs/api/appkit/Function.matches.md +18 -0
- package/docs/api/appkit/Function.normalizeHost.md +18 -0
- package/docs/api/appkit/Function.readEvalDataset.md +21 -0
- package/docs/api/appkit/Function.reportToMlflow.md +23 -0
- package/docs/api/appkit/Function.resolveDatabricksAuth.md +16 -0
- package/docs/api/appkit/Function.resolveWorkspaceClient.md +18 -0
- package/docs/api/appkit/Function.runEval.md +19 -0
- package/docs/api/appkit/Function.runEvalsInDir.md +18 -0
- package/docs/api/appkit/Function.summarize.md +16 -0
- package/docs/api/appkit/Interface.AssertionHandle.md +54 -0
- package/docs/api/appkit/Interface.AssertionResult.md +48 -0
- package/docs/api/appkit/Interface.Assessment.md +83 -0
- package/docs/api/appkit/Interface.CustomJudgeSpec.md +30 -0
- package/docs/api/appkit/Interface.DatabaseValidationIssue.md +21 -0
- package/docs/api/appkit/Interface.DatabricksAuth.md +21 -0
- package/docs/api/appkit/Interface.DatasetRow.md +21 -0
- package/docs/api/appkit/Interface.DiscoveredEval.md +36 -0
- package/docs/api/appkit/Interface.DriveResult.md +58 -0
- package/docs/api/appkit/Interface.EntityMutationHooks.md +173 -0
- package/docs/api/appkit/Interface.EvalDefinition.md +74 -0
- package/docs/api/appkit/Interface.EvalDriver.md +37 -0
- package/docs/api/appkit/Interface.EvalResult.md +83 -0
- package/docs/api/appkit/Interface.EvalRunSummary.md +46 -0
- package/docs/api/appkit/Interface.EvalSummary.md +48 -0
- package/docs/api/appkit/Interface.HookApp.md +12 -0
- package/docs/api/appkit/Interface.HookContext.md +21 -0
- package/docs/api/appkit/Interface.HttpDriverOptions.md +67 -0
- package/docs/api/appkit/Interface.JudgeConfig.md +34 -0
- package/docs/api/appkit/Interface.JudgeScore.md +21 -0
- package/docs/api/appkit/Interface.MatchResult.md +34 -0
- package/docs/api/appkit/Interface.PostResult.md +30 -0
- package/docs/api/appkit/Interface.ReadEvalDatasetOptions.md +34 -0
- package/docs/api/appkit/Interface.ReadSerializerContext.md +21 -0
- package/docs/api/appkit/Interface.ReportOutcome.md +53 -0
- package/docs/api/appkit/Interface.ResolveDatabricksAuthOptions.md +34 -0
- package/docs/api/appkit/Interface.RunEvalOptions.md +45 -0
- package/docs/api/appkit/Interface.RunEvalsOptions.md +214 -0
- package/docs/api/appkit/Interface.TestContext.md +245 -0
- package/docs/api/appkit/TypeAlias.DatabaseApiConfig.md +53 -0
- package/docs/api/appkit/TypeAlias.DatabaseApiWriteOperation.md +8 -0
- package/docs/api/appkit/TypeAlias.DatabaseApiWritesConfig.md +49 -0
- package/docs/api/appkit/TypeAlias.DatabaseExports.md +3 -3
- package/docs/api/appkit/TypeAlias.EntityHooks.md +25 -0
- package/docs/api/appkit/TypeAlias.EvalProgress.md +26 -0
- package/docs/api/appkit/TypeAlias.IDatabaseConfig.md +16 -5
- package/docs/api/appkit/TypeAlias.Matcher.md +18 -0
- package/docs/api/appkit/TypeAlias.ReadSerializer.md +19 -0
- package/docs/api/appkit/TypeAlias.Severity.md +8 -0
- package/docs/api/appkit/TypeAlias.TransactionClient.md +19 -0
- package/docs/api/appkit.md +157 -95
- package/docs/plugins/database.md +144 -0
- package/llms.txt +63 -0
- package/package.json +3 -2
- package/sbom.cdx.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Type Alias: DatabaseApiWritesConfig\<TSchema>
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type DatabaseApiWritesConfig<TSchema> =
|
|
5
|
+
| boolean
|
|
6
|
+
| {
|
|
7
|
+
operations?: readonly DatabaseApiWriteOperation[];
|
|
8
|
+
tables?: readonly SchemaTableName<TSchema>[];
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
All writes by default; false keeps reads only, and an object narrows writes.
|
|
14
|
+
|
|
15
|
+
## Type Parameters[](#type-parameters "Direct link to Type Parameters")
|
|
16
|
+
|
|
17
|
+
| Type Parameter |
|
|
18
|
+
| --------------------------------------------------------------------------- |
|
|
19
|
+
| `TSchema` *extends* [`Schema`](./docs/api/appkit/Interface.Schema.md) |
|
|
20
|
+
|
|
21
|
+
## Type Declaration[](#type-declaration "Direct link to Type Declaration")
|
|
22
|
+
|
|
23
|
+
`boolean`
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
{
|
|
27
|
+
operations?: readonly DatabaseApiWriteOperation[];
|
|
28
|
+
tables?: readonly SchemaTableName<TSchema>[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### operations?[](#operations "Direct link to operations?")
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
readonly optional operations: readonly DatabaseApiWriteOperation[];
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Operations that remain enabled. Defaults to create, update, and delete.
|
|
41
|
+
|
|
42
|
+
### tables?[](#tables "Direct link to tables?")
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
readonly optional tables: readonly SchemaTableName<TSchema>[];
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Tables that remain writable. Defaults to every exposed table.
|
|
@@ -26,9 +26,9 @@ transaction<T>(callback: (tx: TransactionClient) => Promise<T>): Promise<T>;
|
|
|
26
26
|
|
|
27
27
|
#### Parameters[](#parameters "Direct link to Parameters")
|
|
28
28
|
|
|
29
|
-
| Parameter | Type
|
|
30
|
-
| ---------- |
|
|
31
|
-
| `callback` | (`tx`: `TransactionClient`) => `Promise`<`T`> |
|
|
29
|
+
| Parameter | Type |
|
|
30
|
+
| ---------- | ------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| `callback` | (`tx`: [`TransactionClient`](./docs/api/appkit/TypeAlias.TransactionClient.md)) => `Promise`<`T`> |
|
|
32
32
|
|
|
33
33
|
#### Returns[](#returns "Direct link to Returns")
|
|
34
34
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Type Alias: EntityHooks\<TTable>
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type EntityHooks<TTable> = EntityMutationHooks<TTable> & {
|
|
5
|
+
serialize?: ReadSerializer;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Response shaping and mutation lifecycle declared for one table.
|
|
11
|
+
|
|
12
|
+
## Type Declaration[](#type-declaration "Direct link to Type Declaration")
|
|
13
|
+
|
|
14
|
+
### serialize?[](#serialize "Direct link to serialize?")
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
readonly optional serialize: ReadSerializer;
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Type Parameters[](#type-parameters "Direct link to Type Parameters")
|
|
22
|
+
|
|
23
|
+
| Type Parameter | Default type |
|
|
24
|
+
| --------------------------- | ------------ |
|
|
25
|
+
| `TTable` *extends* `string` | `string` |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Type Alias: EvalProgress
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type EvalProgress =
|
|
5
|
+
| {
|
|
6
|
+
total: number;
|
|
7
|
+
type: "discovered";
|
|
8
|
+
}
|
|
9
|
+
| {
|
|
10
|
+
runId: string;
|
|
11
|
+
type: "run-created";
|
|
12
|
+
}
|
|
13
|
+
| {
|
|
14
|
+
id: string;
|
|
15
|
+
index: number;
|
|
16
|
+
total: number;
|
|
17
|
+
type: "start";
|
|
18
|
+
}
|
|
19
|
+
| {
|
|
20
|
+
index: number;
|
|
21
|
+
result: EvalResult;
|
|
22
|
+
total: number;
|
|
23
|
+
type: "result";
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
```
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
```ts
|
|
4
4
|
type IDatabaseConfig<TSchema> = {
|
|
5
|
-
|
|
6
|
-
hooks?: { readonly [TTable in SchemaTableName<TSchema>]?:
|
|
5
|
+
api?: DatabaseApiConfig<TSchema>;
|
|
6
|
+
hooks?: { readonly [TTable in SchemaTableName<TSchema>]?: EntityHooks<TTable> };
|
|
7
7
|
schema: TSchema;
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -19,10 +19,21 @@ Configuration for one schema-bound DatabasePlugin instance.
|
|
|
19
19
|
|
|
20
20
|
## Properties[](#properties "Direct link to Properties")
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### api?[](#api "Direct link to api?")
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
|
-
readonly optional
|
|
25
|
+
readonly optional api: DatabaseApiConfig<TSchema>;
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Generated HTTP CRUD is enabled for all tables by default, using the app's service principal. Every admitted caller receives the enabled operations; no per-user or per-row authorization is applied. This plugin does not support OBO. Use custom routes for application-specific authorization.
|
|
30
|
+
|
|
31
|
+
Set `false` to disable routes, `{ writes: false }` for reads only, or `{ tables: ["notes"] }` to expose only selected tables. To disable delete, use `{ writes: { operations: ["create", "update"] } }`.
|
|
32
|
+
|
|
33
|
+
#### Default Value[](#default-value "Direct link to Default Value")
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
true
|
|
26
37
|
|
|
27
38
|
```
|
|
28
39
|
|
|
@@ -31,7 +42,7 @@ readonly optional crudRoutes: CrudRoutesConfig<TSchema>;
|
|
|
31
42
|
### hooks?[](#hooks "Direct link to hooks?")
|
|
32
43
|
|
|
33
44
|
```ts
|
|
34
|
-
readonly optional hooks: { readonly [TTable in SchemaTableName<TSchema>]?:
|
|
45
|
+
readonly optional hooks: { readonly [TTable in SchemaTableName<TSchema>]?: EntityHooks<TTable> };
|
|
35
46
|
|
|
36
47
|
```
|
|
37
48
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Type Alias: Matcher()
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type Matcher = (value: string) => MatchResult;
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
A deterministic matcher: inspects a string value and returns a result.
|
|
9
|
+
|
|
10
|
+
## Parameters[](#parameters "Direct link to Parameters")
|
|
11
|
+
|
|
12
|
+
| Parameter | Type |
|
|
13
|
+
| --------- | -------- |
|
|
14
|
+
| `value` | `string` |
|
|
15
|
+
|
|
16
|
+
## Returns[](#returns "Direct link to Returns")
|
|
17
|
+
|
|
18
|
+
[`MatchResult`](./docs/api/appkit/Interface.MatchResult.md)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Type Alias: ReadSerializer()
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type ReadSerializer = (row: Record<string, unknown>, context: ReadSerializerContext) => Record<string, unknown>;
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Shape one already private-safe row before it reaches the wire. A `Promise` is not assignable to the return type, so an async callback fails to compile: serializers run inside the response path and must not add latency there.
|
|
9
|
+
|
|
10
|
+
## Parameters[](#parameters "Direct link to Parameters")
|
|
11
|
+
|
|
12
|
+
| Parameter | Type |
|
|
13
|
+
| --------- | ------------------------------------------------------------------------------------- |
|
|
14
|
+
| `row` | `Record`<`string`, `unknown`> |
|
|
15
|
+
| `context` | [`ReadSerializerContext`](./docs/api/appkit/Interface.ReadSerializerContext.md) |
|
|
16
|
+
|
|
17
|
+
## Returns[](#returns "Direct link to Returns")
|
|
18
|
+
|
|
19
|
+
`Record`<`string`, `unknown`>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Type Alias: TransactionClient
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type TransactionClient = { readonly [K in EntityName]: TypedEntityClient<K> } & {
|
|
5
|
+
sql: SqlTag;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Entity and SQL capabilities bound to one transaction.
|
|
11
|
+
|
|
12
|
+
## Type Declaration[](#type-declaration "Direct link to Type Declaration")
|
|
13
|
+
|
|
14
|
+
### sql[](#sql "Direct link to sql")
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
readonly sql: SqlTag;
|
|
18
|
+
|
|
19
|
+
```
|