@databricks/appkit 0.72.0 → 0.74.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.
Files changed (156) hide show
  1. package/CLAUDE.md +24 -0
  2. package/NOTICE.md +1 -0
  3. package/dist/appkit/package.js +1 -1
  4. package/dist/beta.d.ts +11 -8
  5. package/dist/beta.js +7 -6
  6. package/dist/cli/commands/agent/eval.js +85 -16
  7. package/dist/cli/commands/agent/eval.js.map +1 -1
  8. package/dist/connectors/index.js +1 -1
  9. package/dist/connectors/mlflow/auth.d.ts +11 -1
  10. package/dist/connectors/mlflow/auth.d.ts.map +1 -1
  11. package/dist/connectors/mlflow/auth.js +22 -2
  12. package/dist/connectors/mlflow/auth.js.map +1 -1
  13. package/dist/connectors/mlflow/index.d.ts +2 -0
  14. package/dist/database/errors.js +15 -5
  15. package/dist/database/errors.js.map +1 -1
  16. package/dist/database/runtime/data-path.d.ts +7 -0
  17. package/dist/database/runtime/data-path.d.ts.map +1 -0
  18. package/dist/database/runtime/data-path.js.map +1 -1
  19. package/dist/database/runtime/engine/drizzle-data-path.js +7 -5
  20. package/dist/database/runtime/engine/drizzle-data-path.js.map +1 -1
  21. package/dist/database/schema-builder/define-schema.d.ts +1 -1
  22. package/dist/database/schema-builder/define-schema.js +1 -1
  23. package/dist/database/schema-builder/define-schema.js.map +1 -1
  24. package/dist/errors/database-validation.d.ts +23 -0
  25. package/dist/errors/database-validation.d.ts.map +1 -0
  26. package/dist/errors/database-validation.js +24 -0
  27. package/dist/errors/database-validation.js.map +1 -0
  28. package/dist/errors/index.js +1 -0
  29. package/dist/evals/dataset.d.ts +49 -0
  30. package/dist/evals/dataset.d.ts.map +1 -0
  31. package/dist/evals/dataset.js +51 -0
  32. package/dist/evals/dataset.js.map +1 -0
  33. package/dist/evals/define-eval.d.ts +4 -2
  34. package/dist/evals/define-eval.d.ts.map +1 -1
  35. package/dist/evals/define-eval.js +5 -1
  36. package/dist/evals/define-eval.js.map +1 -1
  37. package/dist/evals/discover.d.ts +15 -1
  38. package/dist/evals/discover.d.ts.map +1 -1
  39. package/dist/evals/discover.js +26 -2
  40. package/dist/evals/discover.js.map +1 -1
  41. package/dist/evals/http-driver.d.ts.map +1 -1
  42. package/dist/evals/http-driver.js +82 -55
  43. package/dist/evals/http-driver.js.map +1 -1
  44. package/dist/evals/index.d.ts +14 -0
  45. package/dist/evals/index.js +6 -5
  46. package/dist/evals/judge.d.ts +1 -0
  47. package/dist/evals/judge.d.ts.map +1 -1
  48. package/dist/evals/mlflow-report.d.ts +1 -0
  49. package/dist/evals/mlflow-report.d.ts.map +1 -1
  50. package/dist/evals/mlflow-run.d.ts +2 -0
  51. package/dist/evals/mlflow-run.d.ts.map +1 -1
  52. package/dist/evals/report.d.ts +16 -1
  53. package/dist/evals/report.d.ts.map +1 -1
  54. package/dist/evals/report.js +64 -2
  55. package/dist/evals/report.js.map +1 -1
  56. package/dist/evals/run-eval.d.ts +8 -0
  57. package/dist/evals/run-eval.d.ts.map +1 -1
  58. package/dist/evals/run-eval.js +54 -5
  59. package/dist/evals/run-eval.js.map +1 -1
  60. package/dist/evals/run-evals.d.ts +41 -3
  61. package/dist/evals/run-evals.d.ts.map +1 -1
  62. package/dist/evals/run-evals.js +215 -34
  63. package/dist/evals/run-evals.js.map +1 -1
  64. package/dist/evals/types.d.ts +80 -6
  65. package/dist/evals/types.d.ts.map +1 -1
  66. package/dist/index.d.ts +2 -1
  67. package/dist/index.js +2 -1
  68. package/dist/plugin/plugin.d.ts.map +1 -1
  69. package/dist/plugin/plugin.js +1 -1
  70. package/dist/plugin/plugin.js.map +1 -1
  71. package/dist/plugins/database/crud/contract.js +17 -8
  72. package/dist/plugins/database/crud/contract.js.map +1 -1
  73. package/dist/plugins/database/crud/exposure.js +63 -22
  74. package/dist/plugins/database/crud/exposure.js.map +1 -1
  75. package/dist/plugins/database/crud/request.js +50 -0
  76. package/dist/plugins/database/crud/request.js.map +1 -0
  77. package/dist/plugins/database/crud/response.js +77 -0
  78. package/dist/plugins/database/crud/response.js.map +1 -0
  79. package/dist/plugins/database/crud/routes.js +71 -52
  80. package/dist/plugins/database/crud/routes.js.map +1 -1
  81. package/dist/plugins/database/database.d.ts +6 -4
  82. package/dist/plugins/database/database.d.ts.map +1 -1
  83. package/dist/plugins/database/database.js +46 -16
  84. package/dist/plugins/database/database.js.map +1 -1
  85. package/dist/plugins/database/defaults.js +5 -1
  86. package/dist/plugins/database/defaults.js.map +1 -1
  87. package/dist/plugins/database/entity-client.js +143 -10
  88. package/dist/plugins/database/entity-client.js.map +1 -1
  89. package/dist/plugins/database/entity-types.d.ts +1 -1
  90. package/dist/plugins/database/hooks.d.ts +38 -0
  91. package/dist/plugins/database/hooks.d.ts.map +1 -0
  92. package/dist/plugins/database/index.d.ts +3 -2
  93. package/dist/plugins/database/lifecycle.js +67 -28
  94. package/dist/plugins/database/lifecycle.js.map +1 -1
  95. package/dist/plugins/database/scope.js +58 -0
  96. package/dist/plugins/database/scope.js.map +1 -0
  97. package/dist/plugins/database/types.d.ts +40 -12
  98. package/dist/plugins/database/types.d.ts.map +1 -1
  99. package/dist/plugins/server/index.js +2 -2
  100. package/dist/plugins/server/index.js.map +1 -1
  101. package/dist/plugins/server/remote-tunnel/remote-tunnel-manager.js +3 -3
  102. package/dist/plugins/server/remote-tunnel/remote-tunnel-manager.js.map +1 -1
  103. package/dist/plugins/server/static-server.js +3 -3
  104. package/dist/plugins/server/static-server.js.map +1 -1
  105. package/dist/plugins/server/utils.js +3 -3
  106. package/dist/plugins/server/utils.js.map +1 -1
  107. package/dist/plugins/server/vite-dev-server.js +4 -4
  108. package/dist/plugins/server/vite-dev-server.js.map +1 -1
  109. package/dist/shared/src/schemas/manifest.d.ts +87 -87
  110. package/dist/type-generator/database/generate.js +3 -3
  111. package/dist/type-generator/database/generate.js.map +1 -1
  112. package/dist/type-generator/migration.js +2 -2
  113. package/dist/type-generator/migration.js.map +1 -1
  114. package/dist/type-generator/serving/server-file-extractor.js +3 -3
  115. package/dist/type-generator/serving/server-file-extractor.js.map +1 -1
  116. package/docs/api/appkit/Class.AppKitError.md +1 -0
  117. package/docs/api/appkit/Class.DatabaseValidationError.md +191 -0
  118. package/docs/api/appkit/Function.defineEvalConfig.md +18 -0
  119. package/docs/api/appkit/Function.defineSchema.md +1 -1
  120. package/docs/api/appkit/Function.discoverEvalConfigs.md +18 -0
  121. package/docs/api/appkit/Function.formatResultsJUnit.md +18 -0
  122. package/docs/api/appkit/Function.formatResultsJson.md +18 -0
  123. package/docs/api/appkit/Function.readEvalDataset.md +21 -0
  124. package/docs/api/appkit/Function.resolveWorkspaceClient.md +18 -0
  125. package/docs/api/appkit/Function.runWithRetries.md +28 -0
  126. package/docs/api/appkit/Function.userTurns.md +20 -0
  127. package/docs/api/appkit/Interface.AssertionHandle.md +1 -1
  128. package/docs/api/appkit/Interface.DatabaseValidationIssue.md +21 -0
  129. package/docs/api/appkit/Interface.DatasetRow.md +21 -0
  130. package/docs/api/appkit/Interface.DiscoveredEvalConfig.md +25 -0
  131. package/docs/api/appkit/Interface.DriveResult.md +28 -0
  132. package/docs/api/appkit/Interface.EntityMutationHooks.md +173 -0
  133. package/docs/api/appkit/Interface.EvalDefinition.md +50 -0
  134. package/docs/api/appkit/Interface.EvalDriver.md +26 -5
  135. package/docs/api/appkit/Interface.EvalResult.md +11 -0
  136. package/docs/api/appkit/Interface.EvalSummary.md +11 -0
  137. package/docs/api/appkit/Interface.HookApp.md +12 -0
  138. package/docs/api/appkit/Interface.HookContext.md +21 -0
  139. package/docs/api/appkit/Interface.ReadEvalDatasetOptions.md +34 -0
  140. package/docs/api/appkit/Interface.ReadSerializerContext.md +21 -0
  141. package/docs/api/appkit/Interface.RunEvalOptions.md +22 -0
  142. package/docs/api/appkit/Interface.RunEvalsOptions.md +45 -1
  143. package/docs/api/appkit/Interface.TestContext.md +67 -8
  144. package/docs/api/appkit/TypeAlias.DatabaseApiConfig.md +53 -0
  145. package/docs/api/appkit/TypeAlias.DatabaseApiWriteOperation.md +8 -0
  146. package/docs/api/appkit/TypeAlias.DatabaseApiWritesConfig.md +49 -0
  147. package/docs/api/appkit/TypeAlias.DatabaseExports.md +3 -3
  148. package/docs/api/appkit/TypeAlias.EntityHooks.md +25 -0
  149. package/docs/api/appkit/TypeAlias.IDatabaseConfig.md +16 -5
  150. package/docs/api/appkit/TypeAlias.ReadSerializer.md +19 -0
  151. package/docs/api/appkit/TypeAlias.TransactionClient.md +19 -0
  152. package/docs/api/appkit.md +142 -119
  153. package/docs/plugins/database.md +144 -0
  154. package/llms.txt +24 -0
  155. package/package.json +2 -2
  156. package/sbom.cdx.json +1 -1
@@ -0,0 +1,144 @@
1
+ # Database plugin
2
+
3
+ Beta plugin
4
+
5
+ This plugin is currently **beta**. APIs may change between minor releases. Import from `@databricks/appkit/beta`. See [Plugin Stability Tiers](./docs/plugins/stability.md).
6
+
7
+ Declare a schema and use `database({ schema })` to get generated HTTP CRUD and a server-side database client. CRUD is enabled for every declared table by default. Use `api` to restrict the generated routes without disabling server-side access.
8
+
9
+ Shared application access
10
+
11
+ This plugin uses the app's service principal in deployed Databricks Apps. It does not support OBO and does not apply per-user or per-row authorization. Every caller who can reach the generated API can perform every enabled operation on every exposed row, including delete.
12
+
13
+ Restrict access to the app and grant its service principal only the database permissions it needs. If users need different permissions or row ownership checks, disable the relevant generated routes and implement authorization in custom server routes. App admission alone does not provide row-level isolation.
14
+
15
+ ## Basic usage[​](#basic-usage "Direct link to Basic usage")
16
+
17
+ Configure a Lakebase `postgres` resource and its connection environment variables as described in [Lakebase configuration](./docs/plugins/lakebase.md#environment-variables). The database tables must already exist and match the declared schema. This plugin checks connectivity during setup; it does not create or migrate tables.
18
+
19
+ ```ts
20
+ import { createApp, server } from "@databricks/appkit";
21
+ import { database, defineSchema, id, text } from "@databricks/appkit/beta";
22
+
23
+ const schema = defineSchema((builder) => ({
24
+ notes: builder.table("notes", {
25
+ id: id(),
26
+ body: text().notNull(),
27
+ }),
28
+ }));
29
+
30
+ const AppKit = await createApp({
31
+ plugins: [server(), database({ schema })],
32
+ });
33
+
34
+ ```
35
+
36
+ With the server plugin enabled, this registers:
37
+
38
+ | Method | Path | Operation |
39
+ | ------ | ------------------------- | ------------ |
40
+ | GET | `/api/database/notes` | List rows |
41
+ | GET | `/api/database/notes/:id` | Find one row |
42
+ | POST | `/api/database/notes` | Create a row |
43
+ | PATCH | `/api/database/notes/:id` | Update a row |
44
+ | DELETE | `/api/database/notes/:id` | Delete a row |
45
+
46
+ A table without a public primary key supports list and create only. `upsert` is available to server code but has no generated HTTP route.
47
+
48
+ ## Restrict the generated API[​](#restrict-the-generated-api "Direct link to Restrict the generated API")
49
+
50
+ Omitting `api`, or setting it to `true` or `{}`, enables full CRUD. Restrictions are optional. There is no separate write opt-in.
51
+
52
+ ```ts
53
+ // No generated HTTP routes. The server-side client still works.
54
+ database({ schema, api: false });
55
+
56
+ // Read-only routes for every table.
57
+ database({ schema, api: { writes: false } });
58
+
59
+ // Full CRUD for selected tables only.
60
+ database({ schema, api: { tables: ["notes"] } });
61
+
62
+ // Allow reads, create, and update, but not delete.
63
+ database({
64
+ schema,
65
+ api: { writes: { operations: ["create", "update"] } },
66
+ });
67
+
68
+ // Read every table, but allow writes only to notes.
69
+ database({
70
+ schema,
71
+ api: { writes: { tables: ["notes"] } },
72
+ });
73
+
74
+ ```
75
+
76
+ | Option | Default | Effect |
77
+ | ----------------------- | ---------------------------- | ----------------------------------------- |
78
+ | `api` | `true` | `false` disables all generated routes |
79
+ | `api.tables` | All declared tables | Limits which tables have routes |
80
+ | `api.writes` | `true` | `false` keeps only read routes |
81
+ | `api.writes.tables` | All exposed tables | Limits which exposed tables accept writes |
82
+ | `api.writes.operations` | `create`, `update`, `delete` | Limits which writes are enabled |
83
+
84
+ `api.tables: []` disables all generated routes. An empty write-table or write-operation list keeps reads and disables writes. Tables omitted from `api.tables` also cannot be included through relations on exposed tables. These restrictions apply to HTTP only, not to the server-side client or hooks.
85
+
86
+ An omitted restriction uses its default. A malformed restriction fails setup. For example, `{ api: { write: false } }` is an error, not permission to generate all writes. Unknown tables, duplicate names, and unsupported operations also fail setup before the plugin creates a connection pool.
87
+
88
+ Replace the former `crudRoutes` option with `api`. The old name is rejected at runtime so an old opt-out cannot silently enable the API. To preserve read-only behavior, specify `api: { writes: false }`.
89
+
90
+ ### Table names and setup errors[​](#table-names-and-setup-errors "Direct link to Table names and setup errors")
91
+
92
+ Generated route names must:
93
+
94
+ * Start with an ASCII letter.
95
+ * Contain only ASCII letters, digits, underscores, or hyphens.
96
+ * Be at most 64 characters long.
97
+ * Be unique without regard to case, because Express routes are case-insensitive.
98
+
99
+ The default API validates every declared table. A table such as `_events` fails setup instead of being silently omitted. The error names the table and suggests renaming it, excluding it with `api.tables`, or disabling routes with `api: false`. An excluded table remains available to server code.
100
+
101
+ Configuration errors include actionable details in the server-side error message. Client-facing messages do not expose those details.
102
+
103
+ ## Validation and private columns[​](#validation-and-private-columns "Direct link to Validation and private columns")
104
+
105
+ The generated API validates request bodies and rejects unknown or read-only fields. Columns marked `.private()` are not available through generated routes. Database-generated primary keys, including `uuid().primaryKey().defaultRandom()`, cannot be supplied by HTTP callers. A natural primary key may be supplied on create, but primary keys cannot be updated through HTTP.
106
+
107
+ Validation is not authorization. A valid request can still read or change any exposed row. Use custom authorized routes when that is not the desired access model.
108
+
109
+ ## Mutation hooks[​](#mutation-hooks "Direct link to Mutation hooks")
110
+
111
+ A table can declare `beforeCreate`, `afterCreate`, `beforeUpdate`, `afterUpdate`, `beforeUpsert`, `afterUpsert`, `beforeDelete`, and `afterDelete`. Hooks and the mutation run in one database transaction. Related writes through `ctx.app.database` join that same transaction. This does not make writes through other plugins or external services transactional.
112
+
113
+ ```ts
114
+ import { DatabaseValidationError } from "@databricks/appkit";
115
+
116
+ database({
117
+ schema,
118
+ hooks: {
119
+ notes: {
120
+ beforeCreate(values) {
121
+ if (typeof values.body === "string" && values.body.length > 5_000) {
122
+ throw new DatabaseValidationError("Note too long", [
123
+ { path: ["body"], message: "Must be at most 5000 characters" },
124
+ ]);
125
+ }
126
+ },
127
+ },
128
+ },
129
+ });
130
+
131
+ ```
132
+
133
+ A `before*` hook can return replacement values, which are validated again before persistence. `DatabaseValidationError` produces HTTP 422 with issues limited to public columns. Other hook failures return an opaque server error.
134
+
135
+ Keep hooks short and await all database work. A transaction has a 30-second callback deadline, a shared budget of 100 database operations, and a maximum mutation nesting depth of 8. Repeating the same entity and mutation operation in a nested hook chain is rejected. PostgreSQL also enforces a 30-second `statement_timeout` and a 30-second `idle_in_transaction_session_timeout`.
136
+
137
+ The callback deadline does not cancel arbitrary JavaScript, HTTP requests, or other external side effects. Avoid putting external side effects in hooks that need database rollback semantics.
138
+
139
+ ## API reference[​](#api-reference "Direct link to API reference")
140
+
141
+ * [`database`](./docs/api/appkit/Function.database.md)
142
+ * [`IDatabaseConfig`](./docs/api/appkit/TypeAlias.IDatabaseConfig.md)
143
+ * [`DatabaseApiConfig`](./docs/api/appkit/TypeAlias.DatabaseApiConfig.md)
144
+ * [`EntityHooks`](./docs/api/appkit/TypeAlias.EntityHooks.md)
package/llms.txt CHANGED
@@ -48,6 +48,7 @@ npx @databricks/appkit docs <query>
48
48
  - [Analytics plugin](./docs/plugins/analytics.md): Enables SQL query execution against Databricks SQL Warehouses.
49
49
  - [Caching](./docs/plugins/caching.md): AppKit provides both global and plugin-level caching capabilities.
50
50
  - [Creating custom plugins](./docs/plugins/custom-plugins.md): If you need custom API routes or background logic, implement an AppKit plugin. The fastest way is to use the CLI:
51
+ - [Database plugin](./docs/plugins/database.md): This plugin is currently beta. APIs may change between minor releases. Import from @databricks/appkit/beta. See Plugin Stability Tiers.
51
52
  - [Execution context](./docs/plugins/execution-context.md): AppKit manages Databricks authentication via two contexts:
52
53
  - [Files plugin](./docs/plugins/files.md): File operations against Databricks Unity Catalog Volumes. Supports listing, reading, downloading, uploading, deleting, and previewing files with built-in caching, retry, and timeout handling via the execution interceptor pipeline.
53
54
  - [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.
@@ -68,6 +69,7 @@ npx @databricks/appkit docs <query>
68
69
  - [Class: AuthenticationError](./docs/api/appkit/Class.AuthenticationError.md): Error thrown when authentication fails.
69
70
  - [Class: ConfigurationError](./docs/api/appkit/Class.ConfigurationError.md): Error thrown when configuration is missing or invalid.
70
71
  - [Class: ConnectionError](./docs/api/appkit/Class.ConnectionError.md): Error thrown when a connection or network operation fails.
72
+ - [Class: DatabaseValidationError](./docs/api/appkit/Class.DatabaseValidationError.md): Deliberate validation failure raised by a database mutation hook. Generated
71
73
  - [Class: DatabricksAdapter](./docs/api/appkit/Class.DatabricksAdapter.md): Adapter that talks directly to Databricks Model Serving /invocations endpoint.
72
74
  - [Class: ExecutionError](./docs/api/appkit/Class.ExecutionError.md): Error thrown when an operation execution fails.
73
75
  - [Class: InitializationError](./docs/api/appkit/Class.InitializationError.md): Error thrown when a service or component is not properly initialized.
@@ -97,9 +99,11 @@ npx @databricks/appkit docs <query>
97
99
  - [Function: createWorkspaceClient()](./docs/api/appkit/Function.createWorkspaceClient.md): Construct an AppKit workspace client.
98
100
  - [Function: database()](./docs/api/appkit/Function.database.md): Create a typed database plugin registration for a finalized schema.
99
101
  - [Function: defineEval()](./docs/api/appkit/Function.defineEval.md): Define an agent eval. Default-export the result from a
102
+ - [Function: defineEvalConfig()](./docs/api/appkit/Function.defineEvalConfig.md): Define per-directory eval config. Default-export from evals.config.ts.
100
103
  - [Function: defineManifest()](./docs/api/appkit/Function.defineManifest.md): Validates a raw manifest (typically a manifest.json import) against the
101
104
  - [Function: defineSchema()](./docs/api/appkit/Function.defineSchema.md): Compile one declared schema. The returned type keeps the table names the
102
105
  - [Function: defineTool()](./docs/api/appkit/Function.defineTool.md): Defines a single tool entry for a plugin's internal registry.
106
+ - [Function: discoverEvalConfigs()](./docs/api/appkit/Function.discoverEvalConfigs.md): Discover the per-agent evals.config.ts (from defineEvalConfig) at
103
107
  - [Function: discoverEvalFiles()](./docs/api/appkit/Function.discoverEvalFiles.md): Discover evals under /server/agents//evals/ — co-located
104
108
  - [Function: enumColumn()](./docs/api/appkit/Function.enumColumn.md): Parameters
105
109
  - [Function: equals()](./docs/api/appkit/Function.equals.md): Passes when the value equals expected exactly.
@@ -111,6 +115,8 @@ npx @databricks/appkit docs <query>
111
115
  - [Function: formatEvalDetail()](./docs/api/appkit/Function.formatEvalDetail.md): Indented detail lines for a failing eval (error + failing assertions).
112
116
  - [Function: formatEvalHeadline()](./docs/api/appkit/Function.formatEvalHeadline.md): The one-line header for a single eval result (no failure detail).
113
117
  - [Function: formatEvalResults()](./docs/api/appkit/Function.formatEvalResults.md): Render all results as a human-readable console report (non-streaming).
118
+ - [Function: formatResultsJson()](./docs/api/appkit/Function.formatResultsJson.md): Render results as a machine-readable JSON report (2-space indented):
119
+ - [Function: formatResultsJUnit()](./docs/api/appkit/Function.formatResultsJUnit.md): Render results as JUnit XML for standard CI test reporters: a single
114
120
  - [Function: formatSummaryLine()](./docs/api/appkit/Function.formatSummaryLine.md): The final PASS/FAIL summary line.
115
121
  - [Function: fromSupervisorApi()](./docs/api/appkit/Function.fromSupervisorApi.md): Creates an AgentAdapter backed by the Databricks AI Gateway
116
122
  - [Function: functionToolToDefinition()](./docs/api/appkit/Function.functionToolToDefinition.md): Parameters
@@ -138,17 +144,21 @@ npx @databricks/appkit docs <query>
138
144
  - [Function: mcpServer()](./docs/api/appkit/Function.mcpServer.md): Factory for declaring a custom MCP server tool.
139
145
  - [Function: normalizeHost()](./docs/api/appkit/Function.normalizeHost.md): Ensure the host has a scheme (Databricks env often lacks https://).
140
146
  - [Function: parseTextToolCalls()](./docs/api/appkit/Function.parseTextToolCalls.md): Parses text-based tool calls from model output.
147
+ - [Function: readEvalDataset()](./docs/api/appkit/Function.readEvalDataset.md): Read a Databricks managed evaluation dataset (a Unity Catalog table with
141
148
  - [Function: reportToMlflow()](./docs/api/appkit/Function.reportToMlflow.md): Write one pass/fail assessment per eval result to the Databricks MLflow REST
142
149
  - [Function: resolveDatabricksAuth()](./docs/api/appkit/Function.resolveDatabricksAuth.md): Parameters
143
150
  - [Function: resolveHostedTools()](./docs/api/appkit/Function.resolveHostedTools.md): Parameters
151
+ - [Function: resolveWorkspaceClient()](./docs/api/appkit/Function.resolveWorkspaceClient.md): Construct a Databricks WorkspaceClient for the eval runner — the object the
144
152
  - [Function: runAgent()](./docs/api/appkit/Function.runAgent.md): Standalone agent execution without createApp. Resolves the adapter, binds
145
153
  - [Function: runEval()](./docs/api/appkit/Function.runEval.md): Run a single eval against a driver. Never throws for assertion or agent
146
154
  - [Function: runEvalsInDir()](./docs/api/appkit/Function.runEvalsInDir.md): Discover, load, and run every eval under each agent's evals/ dir, driving
155
+ - [Function: runWithRetries()](./docs/api/appkit/Function.runWithRetries.md): Run attempt up to 1 + retries times, stopping as soon as it returns a
147
156
  - [Function: summarize()](./docs/api/appkit/Function.summarize.md): Parameters
148
157
  - [Function: text()](./docs/api/appkit/Function.text.md): Returns
149
158
  - [Function: timestamp()](./docs/api/appkit/Function.timestamp.md): Parameters
150
159
  - [Function: tool()](./docs/api/appkit/Function.tool.md): Factory for defining function tools with Zod schemas.
151
160
  - [Function: toolsFromRegistry()](./docs/api/appkit/Function.toolsFromRegistry.md): Produces the AgentToolDefinition[] a ToolProvider exposes to the LLM,
161
+ - [Function: userTurns()](./docs/api/appkit/Function.userTurns.md): Extract every user-message content, in order, from an MLflow
152
162
  - [Function: uuid()](./docs/api/appkit/Function.uuid.md): Returns
153
163
  - [Function: varchar()](./docs/api/appkit/Function.varchar.md): Parameters
154
164
  - [Interface: AgentAdapter](./docs/api/appkit/Interface.AgentAdapter.md): Properties
@@ -166,10 +176,14 @@ npx @databricks/appkit docs <query>
166
176
  - [Interface: CustomJudgeSpec](./docs/api/appkit/Interface.CustomJudgeSpec.md): A custom LLM-judge definition: a prompt template and choice→score mapping.
167
177
  - [Interface: DatabaseCredential](./docs/api/appkit/Interface.DatabaseCredential.md): Database credentials with OAuth token for Postgres connection
168
178
  - [Interface: DatabaseRegistry](./docs/api/appkit/Interface.DatabaseRegistry.md): CANONICAL augmentation target. Empty by default; the generated database.d.ts
179
+ - [Interface: DatabaseValidationIssue](./docs/api/appkit/Interface.DatabaseValidationIssue.md): One rejected field; path names public columns, never their values.
169
180
  - [Interface: DatabricksAuth](./docs/api/appkit/Interface.DatabricksAuth.md): Resolved Databricks host + bearer token for the eval runner's REST calls.
181
+ - [Interface: DatasetRow](./docs/api/appkit/Interface.DatasetRow.md): One row of a managed evaluation dataset. inputs are the kwargs passed to the
170
182
  - [Interface: DiscoveredEval](./docs/api/appkit/Interface.DiscoveredEval.md): An eval file found under server/agents//evals/.
183
+ - [Interface: DiscoveredEvalConfig](./docs/api/appkit/Interface.DiscoveredEvalConfig.md): A per-agent evals.config.ts found under server/agents//evals/.
171
184
  - [Interface: DriveResult](./docs/api/appkit/Interface.DriveResult.md): What a driver returns for a single t.send.
172
185
  - [Interface: EndpointConfig](./docs/api/appkit/Interface.EndpointConfig.md): Properties
186
+ - [Interface: EntityMutationHooks<TTable>](./docs/api/appkit/Interface.EntityMutationHooks.md): Mutation lifecycle for one entity. A before hook may return a replacement
173
187
  - [Interface: EvalDefinition](./docs/api/appkit/Interface.EvalDefinition.md): A single eval, default-exported from a *.eval.ts file.
174
188
  - [Interface: EvalDriver](./docs/api/appkit/Interface.EvalDriver.md): Abstraction over how the agent is driven. The HTTP driver posts to a running
175
189
  - [Interface: EvalResult](./docs/api/appkit/Interface.EvalResult.md): The outcome of running one eval.
@@ -180,6 +194,8 @@ npx @databricks/appkit docs <query>
180
194
  - [Interface: FunctionTool](./docs/api/appkit/Interface.FunctionTool.md): Properties
181
195
  - [Interface: GenerateDatabaseCredentialRequest](./docs/api/appkit/Interface.GenerateDatabaseCredentialRequest.md): Request parameters for generating database OAuth credentials
182
196
  - [Interface: GenerationParams](./docs/api/appkit/Interface.GenerationParams.md): Optional generation parameters forwarded to the OpenAI-compatible serving
197
+ - [Interface: HookApp](./docs/api/appkit/Interface.HookApp.md): The only capability a hook receives: entities bound to its transaction.
198
+ - [Interface: HookContext](./docs/api/appkit/Interface.HookContext.md): Which entity is being mutated, and the surface a hook may write through.
183
199
  - [Interface: HostedSupervisorTool](./docs/api/appkit/Interface.HostedSupervisorTool.md): Tagged record returned by every supervisorTools factory. The
184
200
  - [Interface: HttpDriverOptions](./docs/api/appkit/Interface.HttpDriverOptions.md): Properties
185
201
  - [Interface: IAiSearchConfig](./docs/api/appkit/Interface.IAiSearchConfig.md): Base configuration interface for AppKit plugins
@@ -201,6 +217,8 @@ npx @databricks/appkit docs <query>
201
217
  - [Interface: PluginToolkitProvider](./docs/api/appkit/Interface.PluginToolkitProvider.md): Minimum shape every entry in the Plugins map must expose. Core
202
218
  - [Interface: PostResult](./docs/api/appkit/Interface.PostResult.md): Structured result for a best-effort POST that must not throw.
203
219
  - [Interface: PromptContext](./docs/api/appkit/Interface.PromptContext.md): Context passed to baseSystemPrompt callbacks.
220
+ - [Interface: ReadEvalDatasetOptions](./docs/api/appkit/Interface.ReadEvalDatasetOptions.md): Properties
221
+ - [Interface: ReadSerializerContext](./docs/api/appkit/Interface.ReadSerializerContext.md): Which entity and generated operation produced the row being shaped.
204
222
  - [Interface: RegisteredAgent](./docs/api/appkit/Interface.RegisteredAgent.md): Properties
205
223
  - [Interface: ReportOutcome](./docs/api/appkit/Interface.ReportOutcome.md): Properties
206
224
  - [Interface: RequestedClaims](./docs/api/appkit/Interface.RequestedClaims.md): Optional claims for fine-grained Unity Catalog table permissions
@@ -242,7 +260,11 @@ npx @databricks/appkit docs <query>
242
260
  - [Type Alias: AgentToolsFn()](./docs/api/appkit/TypeAlias.AgentToolsFn.md): Function form of AgentDefinition.tools. Receives the typed
243
261
  - [Type Alias: BaseSystemPromptOption](./docs/api/appkit/TypeAlias.BaseSystemPromptOption.md)
244
262
  - [Type Alias: ConfigSchema](./docs/api/appkit/TypeAlias.ConfigSchema.md): Configuration schema definition for plugin config.
263
+ - [Type Alias: DatabaseApiConfig<TSchema>](./docs/api/appkit/TypeAlias.DatabaseApiConfig.md): Full generated CRUD for every declared table by default. Set false to disable
264
+ - [Type Alias: DatabaseApiWriteOperation](./docs/api/appkit/TypeAlias.DatabaseApiWriteOperation.md): Generated HTTP write operations.
265
+ - [Type Alias: DatabaseApiWritesConfig<TSchema>](./docs/api/appkit/TypeAlias.DatabaseApiWritesConfig.md): All writes by default; false keeps reads only, and an object narrows writes.
245
266
  - [Type Alias: DatabaseExports](./docs/api/appkit/TypeAlias.DatabaseExports.md): Typed database API published by the plugin.
267
+ - [Type Alias: EntityHooks<TTable>](./docs/api/appkit/TypeAlias.EntityHooks.md): Response shaping and mutation lifecycle declared for one table.
246
268
  - [Type Alias: EvalProgress](./docs/api/appkit/TypeAlias.EvalProgress.md)
247
269
  - [Type Alias: ExecutionResult<T>](./docs/api/appkit/TypeAlias.ExecutionResult.md): Discriminated union for plugin execution results.
248
270
  - [Type Alias: FileAction](./docs/api/appkit/TypeAlias.FileAction.md): Every action the files plugin can perform.
@@ -254,6 +276,7 @@ npx @databricks/appkit docs <query>
254
276
  - [Type Alias: Matcher()](./docs/api/appkit/TypeAlias.Matcher.md): A deterministic matcher: inspects a string value and returns a result.
255
277
  - [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().
256
278
  - [Type Alias: Plugins](./docs/api/appkit/TypeAlias.Plugins.md): Plugin map passed to the function form of AgentDefinition.tools.
279
+ - [Type Alias: ReadSerializer()](./docs/api/appkit/TypeAlias.ReadSerializer.md): Shape one already private-safe row before it reaches the wire. A Promise
257
280
  - [Type Alias: ResolvedToolEntry](./docs/api/appkit/TypeAlias.ResolvedToolEntry.md): Internal tool-index entry after a tool record has been resolved to a dispatchable form.
258
281
  - [Type Alias: ResourceFieldEntry](./docs/api/appkit/TypeAlias.ResourceFieldEntry.md)
259
282
  - [Type Alias: ResourcePermission](./docs/api/appkit/TypeAlias.ResourcePermission.md): Union of all possible permission levels across all resource types.
@@ -263,6 +286,7 @@ npx @databricks/appkit docs <query>
263
286
  - [Type Alias: SupervisorTool](./docs/api/appkit/TypeAlias.SupervisorTool.md): Tools supported by the Databricks AI Gateway Responses API. The shapes match
264
287
  - [Type Alias: ToolRegistry](./docs/api/appkit/TypeAlias.ToolRegistry.md)
265
288
  - [Type Alias: ToPlugin()<T, U, N>](./docs/api/appkit/TypeAlias.ToPlugin.md): Factory function type returned by toPlugin(). Accepts optional config and returns a PluginData tuple.
289
+ - [Type Alias: TransactionClient](./docs/api/appkit/TypeAlias.TransactionClient.md): Entity and SQL capabilities bound to one transaction.
266
290
  - [Variable: agents](./docs/api/appkit/Variable.agents.md): Plugin factory for the agents plugin. Discovers agents from
267
291
  - [Variable: aiSearch](./docs/api/appkit/Variable.aiSearch.md)
268
292
  - [Variable: READ_ACTIONS](./docs/api/appkit/Variable.READ_ACTIONS.md): Actions that only read data.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@databricks/appkit",
3
3
  "type": "module",
4
- "version": "0.72.0",
4
+ "version": "0.74.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "bin": {
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@ast-grep/napi": "0.37.0",
59
- "@databricks/lakebase": "0.5.0",
59
+ "@databricks/lakebase": "0.6.0",
60
60
  "@databricks/sdk-experimental": "0.17.0",
61
61
  "@mlflow/core": "0.4.0",
62
62
  "@opentelemetry/api": "1.9.0",