@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,173 @@
1
+ # Interface: EntityMutationHooks\<TTable>
2
+
3
+ Mutation lifecycle for one entity. A before hook may return a replacement payload, which is revalidated against the trusted schema before it is persisted. Every hook, the mutation, and any write a hook issues through `ctx.app.database` share one transaction, so a rejection anywhere rolls all of them back. Throw `DatabaseValidationError` to answer a generated route with `422`; any other failure stays an opaque server error.
4
+
5
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
6
+
7
+ | Type Parameter | Default type |
8
+ | --------------------------- | ------------ |
9
+ | `TTable` *extends* `string` | `string` |
10
+
11
+ ## Methods[​](#methods "Direct link to Methods")
12
+
13
+ ### afterCreate()?[​](#aftercreate "Direct link to afterCreate()?")
14
+
15
+ ```ts
16
+ optional afterCreate(row: FacetOf<TTable, "row">, context: HookContext): MaybePromise<void>;
17
+
18
+ ```
19
+
20
+ #### Parameters[​](#parameters "Direct link to Parameters")
21
+
22
+ | Parameter | Type |
23
+ | --------- | ----------------------------------------------------------------- |
24
+ | `row` | `FacetOf`<`TTable`, `"row"`> |
25
+ | `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
26
+
27
+ #### Returns[​](#returns "Direct link to Returns")
28
+
29
+ `MaybePromise`<`void`>
30
+
31
+ ***
32
+
33
+ ### afterDelete()?[​](#afterdelete "Direct link to afterDelete()?")
34
+
35
+ ```ts
36
+ optional afterDelete(id: IdValue, context: HookContext): MaybePromise<void>;
37
+
38
+ ```
39
+
40
+ #### Parameters[​](#parameters-1 "Direct link to Parameters")
41
+
42
+ | Parameter | Type |
43
+ | --------- | ----------------------------------------------------------------- |
44
+ | `id` | `IdValue` |
45
+ | `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
46
+
47
+ #### Returns[​](#returns-1 "Direct link to Returns")
48
+
49
+ `MaybePromise`<`void`>
50
+
51
+ ***
52
+
53
+ ### afterUpdate()?[​](#afterupdate "Direct link to afterUpdate()?")
54
+
55
+ ```ts
56
+ optional afterUpdate(row: FacetOf<TTable, "row">, context: HookContext): MaybePromise<void>;
57
+
58
+ ```
59
+
60
+ #### Parameters[​](#parameters-2 "Direct link to Parameters")
61
+
62
+ | Parameter | Type |
63
+ | --------- | ----------------------------------------------------------------- |
64
+ | `row` | `FacetOf`<`TTable`, `"row"`> |
65
+ | `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
66
+
67
+ #### Returns[​](#returns-2 "Direct link to Returns")
68
+
69
+ `MaybePromise`<`void`>
70
+
71
+ ***
72
+
73
+ ### afterUpsert()?[​](#afterupsert "Direct link to afterUpsert()?")
74
+
75
+ ```ts
76
+ optional afterUpsert(row: FacetOf<TTable, "row">, context: HookContext): MaybePromise<void>;
77
+
78
+ ```
79
+
80
+ #### Parameters[​](#parameters-3 "Direct link to Parameters")
81
+
82
+ | Parameter | Type |
83
+ | --------- | ----------------------------------------------------------------- |
84
+ | `row` | `FacetOf`<`TTable`, `"row"`> |
85
+ | `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
86
+
87
+ #### Returns[​](#returns-3 "Direct link to Returns")
88
+
89
+ `MaybePromise`<`void`>
90
+
91
+ ***
92
+
93
+ ### beforeCreate()?[​](#beforecreate "Direct link to beforeCreate()?")
94
+
95
+ ```ts
96
+ optional beforeCreate(values: FacetOf<TTable, "insert">, context: HookContext): MaybePromise<void | FacetOf<TTable, "insert">>;
97
+
98
+ ```
99
+
100
+ #### Parameters[​](#parameters-4 "Direct link to Parameters")
101
+
102
+ | Parameter | Type |
103
+ | --------- | ----------------------------------------------------------------- |
104
+ | `values` | `FacetOf`<`TTable`, `"insert"`> |
105
+ | `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
106
+
107
+ #### Returns[​](#returns-4 "Direct link to Returns")
108
+
109
+ `MaybePromise`<`void` | `FacetOf`<`TTable`, `"insert"`>>
110
+
111
+ ***
112
+
113
+ ### beforeDelete()?[​](#beforedelete "Direct link to beforeDelete()?")
114
+
115
+ ```ts
116
+ optional beforeDelete(id: IdValue, context: HookContext): MaybePromise<void>;
117
+
118
+ ```
119
+
120
+ #### Parameters[​](#parameters-5 "Direct link to Parameters")
121
+
122
+ | Parameter | Type |
123
+ | --------- | ----------------------------------------------------------------- |
124
+ | `id` | `IdValue` |
125
+ | `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
126
+
127
+ #### Returns[​](#returns-5 "Direct link to Returns")
128
+
129
+ `MaybePromise`<`void`>
130
+
131
+ ***
132
+
133
+ ### beforeUpdate()?[​](#beforeupdate "Direct link to beforeUpdate()?")
134
+
135
+ ```ts
136
+ optional beforeUpdate(
137
+ id: IdValue,
138
+ values: FacetOf<TTable, "update">,
139
+ context: HookContext): MaybePromise<void | FacetOf<TTable, "update">>;
140
+
141
+ ```
142
+
143
+ #### Parameters[​](#parameters-6 "Direct link to Parameters")
144
+
145
+ | Parameter | Type |
146
+ | --------- | ----------------------------------------------------------------- |
147
+ | `id` | `IdValue` |
148
+ | `values` | `FacetOf`<`TTable`, `"update"`> |
149
+ | `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
150
+
151
+ #### Returns[​](#returns-6 "Direct link to Returns")
152
+
153
+ `MaybePromise`<`void` | `FacetOf`<`TTable`, `"update"`>>
154
+
155
+ ***
156
+
157
+ ### beforeUpsert()?[​](#beforeupsert "Direct link to beforeUpsert()?")
158
+
159
+ ```ts
160
+ optional beforeUpsert(values: FacetOf<TTable, "insert">, context: HookContext): MaybePromise<void | FacetOf<TTable, "insert">>;
161
+
162
+ ```
163
+
164
+ #### Parameters[​](#parameters-7 "Direct link to Parameters")
165
+
166
+ | Parameter | Type |
167
+ | --------- | ----------------------------------------------------------------- |
168
+ | `values` | `FacetOf`<`TTable`, `"insert"`> |
169
+ | `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
170
+
171
+ #### Returns[​](#returns-7 "Direct link to Returns")
172
+
173
+ `MaybePromise`<`void` | `FacetOf`<`TTable`, `"insert"`>>
@@ -15,6 +15,34 @@ Target agent id. Defaults to the eval's parent `server/agents/<id>` dir.
15
15
 
16
16
  ***
17
17
 
18
+ ### dataset?[​](#dataset "Direct link to dataset?")
19
+
20
+ ```ts
21
+ optional dataset: {
22
+ limit?: number;
23
+ table: string;
24
+ };
25
+
26
+ ```
27
+
28
+ Run this eval once per row of a Databricks managed evaluation dataset (a Unity Catalog `catalog.schema.table` with `inputs`/`expectations` columns). Each row is bound to `t.input`/`t.expected`. Requires the runner to have a workspace client + warehouse (`--warehouse-id`). Omit for a single-run eval.
29
+
30
+ #### limit?[​](#limit "Direct link to limit?")
31
+
32
+ ```ts
33
+ optional limit: number;
34
+
35
+ ```
36
+
37
+ #### table[​](#table "Direct link to table")
38
+
39
+ ```ts
40
+ table: string;
41
+
42
+ ```
43
+
44
+ ***
45
+
18
46
  ### description?[​](#description "Direct link to description?")
19
47
 
20
48
  ```ts
@@ -24,6 +52,28 @@ optional description: string;
24
52
 
25
53
  Short human description, shown in reports.
26
54
 
55
+ ***
56
+
57
+ ### tags?[​](#tags "Direct link to tags?")
58
+
59
+ ```ts
60
+ optional tags: string[];
61
+
62
+ ```
63
+
64
+ Free-form tags for filtering (see the runner's `tags` / `--tag` option).
65
+
66
+ ***
67
+
68
+ ### timeoutMs?[​](#timeoutms "Direct link to timeoutMs?")
69
+
70
+ ```ts
71
+ optional timeoutMs: number;
72
+
73
+ ```
74
+
75
+ Per-eval timeout (ms): `runEval` races the test against it and records a non-passing result instead of hanging. Overrides the runner/CLI default.
76
+
27
77
  ## Methods[​](#methods "Direct link to Methods")
28
78
 
29
79
  ### test()[​](#test "Direct link to test()")
@@ -4,19 +4,40 @@ Abstraction over how the agent is driven. The HTTP driver posts to a running app
4
4
 
5
5
  ## Methods[​](#methods "Direct link to Methods")
6
6
 
7
+ ### reset()?[​](#reset "Direct link to reset()?")
8
+
9
+ ```ts
10
+ optional reset(): void;
11
+
12
+ ```
13
+
14
+ Drop the current conversation so the next `send` starts a fresh thread. Optional: drivers without a session concept omit it.
15
+
16
+ #### Returns[​](#returns "Direct link to Returns")
17
+
18
+ `void`
19
+
20
+ ***
21
+
7
22
  ### send()[​](#send "Direct link to send()")
8
23
 
9
24
  ```ts
10
- send(message: string): Promise<DriveResult>;
25
+ send(message: string, options?: {
26
+ signal?: AbortSignal;
27
+ }): Promise<DriveResult>;
11
28
 
12
29
  ```
13
30
 
31
+ Drive one turn. `options.signal`, when provided, aborts the in-flight turn: the runner passes its per-eval timeout signal so a timed-out eval cancels the request instead of leaking a live stream.
32
+
14
33
  #### Parameters[​](#parameters "Direct link to Parameters")
15
34
 
16
- | Parameter | Type |
17
- | --------- | -------- |
18
- | `message` | `string` |
35
+ | Parameter | Type |
36
+ | ----------------- | ----------------------------- |
37
+ | `message` | `string` |
38
+ | `options?` | { `signal?`: `AbortSignal`; } |
39
+ | `options.signal?` | `AbortSignal` |
19
40
 
20
- #### Returns[​](#returns "Direct link to Returns")
41
+ #### Returns[​](#returns-1 "Direct link to Returns")
21
42
 
22
43
  `Promise`<[`DriveResult`](./docs/api/appkit/Interface.DriveResult.md)>
@@ -42,6 +42,17 @@ id: string;
42
42
 
43
43
  ***
44
44
 
45
+ ### infraFailure?[​](#infrafailure "Direct link to infraFailure?")
46
+
47
+ ```ts
48
+ optional infraFailure: boolean;
49
+
50
+ ```
51
+
52
+ A turn failed at the transport/agent level (`succeeded: false`), not on an assertion — a retryable infra flake, distinct from `error`.
53
+
54
+ ***
55
+
45
56
  ### passed[​](#passed "Direct link to passed")
46
57
 
47
58
  ```ts
@@ -31,6 +31,17 @@ passed: number;
31
31
 
32
32
  ***
33
33
 
34
+ ### passRate[​](#passrate "Direct link to passRate")
35
+
36
+ ```ts
37
+ passRate: number;
38
+
39
+ ```
40
+
41
+ Fraction of scored (non-skipped) evals that passed, 0..1 (1 when none scored).
42
+
43
+ ***
44
+
34
45
  ### skipped[​](#skipped "Direct link to skipped")
35
46
 
36
47
  ```ts
@@ -0,0 +1,12 @@
1
+ # Interface: HookApp
2
+
3
+ The only capability a hook receives: entities bound to its transaction.
4
+
5
+ ## Properties[​](#properties "Direct link to Properties")
6
+
7
+ ### database[​](#database "Direct link to database")
8
+
9
+ ```ts
10
+ readonly database: TransactionClient;
11
+
12
+ ```
@@ -0,0 +1,21 @@
1
+ # Interface: HookContext
2
+
3
+ Which entity is being mutated, and the surface a hook may write through.
4
+
5
+ ## Properties[​](#properties "Direct link to Properties")
6
+
7
+ ### app[​](#app "Direct link to app")
8
+
9
+ ```ts
10
+ readonly app: HookApp;
11
+
12
+ ```
13
+
14
+ ***
15
+
16
+ ### entity[​](#entity "Direct link to entity")
17
+
18
+ ```ts
19
+ readonly entity: string;
20
+
21
+ ```
@@ -0,0 +1,34 @@
1
+ # Interface: ReadEvalDatasetOptions
2
+
3
+ ## Properties[​](#properties "Direct link to Properties")
4
+
5
+ ### limit?[​](#limit "Direct link to limit?")
6
+
7
+ ```ts
8
+ optional limit: number;
9
+
10
+ ```
11
+
12
+ Optional row cap.
13
+
14
+ ***
15
+
16
+ ### table[​](#table "Direct link to table")
17
+
18
+ ```ts
19
+ table: string;
20
+
21
+ ```
22
+
23
+ Fully-qualified UC table: `catalog.schema.table`.
24
+
25
+ ***
26
+
27
+ ### warehouseId[​](#warehouseid "Direct link to warehouseId")
28
+
29
+ ```ts
30
+ warehouseId: string;
31
+
32
+ ```
33
+
34
+ SQL warehouse id to run the read against.
@@ -0,0 +1,21 @@
1
+ # Interface: ReadSerializerContext
2
+
3
+ Which entity and generated operation produced the row being shaped.
4
+
5
+ ## Properties[​](#properties "Direct link to Properties")
6
+
7
+ ### entity[​](#entity "Direct link to entity")
8
+
9
+ ```ts
10
+ readonly entity: string;
11
+
12
+ ```
13
+
14
+ ***
15
+
16
+ ### operation[​](#operation "Direct link to operation")
17
+
18
+ ```ts
19
+ readonly operation: "detail" | "list";
20
+
21
+ ```
@@ -24,6 +24,17 @@ Stable id for the eval (e.g. its file path relative to the evals dir).
24
24
 
25
25
  ***
26
26
 
27
+ ### row?[​](#row "Direct link to row?")
28
+
29
+ ```ts
30
+ optional row: DatasetRow;
31
+
32
+ ```
33
+
34
+ Dataset row bound to `t.input`/`t.expected` for dataset-driven evals.
35
+
36
+ ***
37
+
27
38
  ### strict?[​](#strict "Direct link to strict?")
28
39
 
29
40
  ```ts
@@ -32,3 +43,14 @@ optional strict: boolean;
32
43
  ```
33
44
 
34
45
  When true, soft assertion failures also fail the eval.
46
+
47
+ ***
48
+
49
+ ### timeoutMs?[​](#timeoutms "Direct link to timeoutMs?")
50
+
51
+ ```ts
52
+ optional timeoutMs: number;
53
+
54
+ ```
55
+
56
+ Runner-level default per-eval timeout (ms). `def.timeoutMs` wins over this; when both are unset the eval runs unbounded (current behavior).
@@ -160,6 +160,17 @@ Progress callback, invoked as evals are discovered, started, and finished.
160
160
 
161
161
  ***
162
162
 
163
+ ### retries?[​](#retries "Direct link to retries?")
164
+
165
+ ```ts
166
+ optional retries: number;
167
+
168
+ ```
169
+
170
+ Re-run an eval up to this many extra times when it fails on infrastructure — a thrown error/timeout (`result.error`) or a transport/agent turn failure (`result.infraFailure`). Assertion failures are never retried. Defaults to `0`.
171
+
172
+ ***
173
+
163
174
  ### rootDir?[​](#rootdir "Direct link to rootDir?")
164
175
 
165
176
  ```ts
@@ -182,6 +193,17 @@ Soft assertion failures also fail the eval.
182
193
 
183
194
  ***
184
195
 
196
+ ### tags?[​](#tags "Direct link to tags?")
197
+
198
+ ```ts
199
+ optional tags: string[];
200
+
201
+ ```
202
+
203
+ Only run evals whose `tags` intersect this list. Empty/undefined runs all. Tags live on the eval def, so filtering happens after each file is loaded.
204
+
205
+ ***
206
+
185
207
  ### timeoutMs?[​](#timeoutms "Direct link to timeoutMs?")
186
208
 
187
209
  ```ts
@@ -189,4 +211,26 @@ optional timeoutMs: number;
189
211
 
190
212
  ```
191
213
 
192
- Per-turn wall-clock timeout (ms) before a turn is failed. Defaults to 120s.
214
+ Default per-eval timeout (ms): `runEval` races the whole test against it and it also caps each driver turn. A per-eval `def.timeoutMs` overrides it, and it wins over an agent's `evals.config.ts` `timeoutMs`. Unbounded when unset.
215
+
216
+ ***
217
+
218
+ ### warehouseId?[​](#warehouseid "Direct link to warehouseId?")
219
+
220
+ ```ts
221
+ optional warehouseId: string;
222
+
223
+ ```
224
+
225
+ SQL warehouse id used to read managed evaluation datasets.
226
+
227
+ ***
228
+
229
+ ### workspaceClient?[​](#workspaceclient "Direct link to workspaceClient?")
230
+
231
+ ```ts
232
+ optional workspaceClient: WorkspaceClient;
233
+
234
+ ```
235
+
236
+ Workspace client used to read managed evaluation datasets (for evals that declare `dataset`). Required alongside [warehouseId](#warehouseid) for those evals.
@@ -4,6 +4,28 @@ The `t` context passed to an eval's `test` function.
4
4
 
5
5
  ## Properties[​](#properties "Direct link to Properties")
6
6
 
7
+ ### expected[​](#expected "Direct link to expected")
8
+
9
+ ```ts
10
+ readonly expected: Record<string, unknown> | undefined;
11
+
12
+ ```
13
+
14
+ The current dataset row's `expectations` (ground truth / guidelines), or `undefined` when the row has none or the eval isn't dataset-driven.
15
+
16
+ ***
17
+
18
+ ### input[​](#input "Direct link to input")
19
+
20
+ ```ts
21
+ readonly input: Record<string, unknown>;
22
+
23
+ ```
24
+
25
+ The current dataset row's `inputs` when the eval is dataset-driven (see [EvalDefinition.dataset](./docs/api/appkit/Interface.EvalDefinition.md#dataset)); `{}` for a plain single-run eval.
26
+
27
+ ***
28
+
7
29
  ### judge[​](#judge "Direct link to judge")
8
30
 
9
31
  ```ts
@@ -15,7 +37,7 @@ judge: {
15
37
 
16
38
  ```
17
39
 
18
- LLM-as-judge scoring of the last reply (via autoevals → a Databricks judge model). Each returns a scored, soft-by-default assertion; chain `.atLeast(n)` to set the pass threshold or `.gate()` to make it a hard gate. Requires the judge to be configured (`--judge-model`).
40
+ LLM-as-judge scoring of the last reply (via autoevals → a Databricks judge model). Each returns a scored assertion that gates by default (a miss fails the eval); chain `.atLeast(n)` to change the pass threshold or `.soft()` to demote to a tracked-only metric. Requires the judge to be configured (`--judge-model`).
19
41
 
20
42
  #### closedQA()[​](#closedqa "Direct link to closedQA()")
21
43
 
@@ -130,6 +152,28 @@ Assert a tool was called during the run (gate by default).
130
152
 
131
153
  ***
132
154
 
155
+ ### calledToolWith()[​](#calledtoolwith "Direct link to calledToolWith()")
156
+
157
+ ```ts
158
+ calledToolWith(name: string, expected: Record<string, unknown>): AssertionHandle;
159
+
160
+ ```
161
+
162
+ Assert a tool was called with arguments that deep-contain `expected`: every key in `expected` must equal the actual argument (recursively for nested objects; arrays match element-for-element), so extra arguments are ignored. Gate by default.
163
+
164
+ #### Parameters[​](#parameters-4 "Direct link to Parameters")
165
+
166
+ | Parameter | Type |
167
+ | ---------- | ----------------------------- |
168
+ | `name` | `string` |
169
+ | `expected` | `Record`<`string`, `unknown`> |
170
+
171
+ #### Returns[​](#returns-4 "Direct link to Returns")
172
+
173
+ [`AssertionHandle`](./docs/api/appkit/Interface.AssertionHandle.md)
174
+
175
+ ***
176
+
133
177
  ### check()[​](#check "Direct link to check()")
134
178
 
135
179
  ```ts
@@ -139,19 +183,34 @@ check(value: string, matcher: Matcher): AssertionHandle;
139
183
 
140
184
  Assert a value against a matcher, e.g. `t.check(t.reply, includes("Sunny"))`.
141
185
 
142
- #### Parameters[​](#parameters-4 "Direct link to Parameters")
186
+ #### Parameters[​](#parameters-5 "Direct link to Parameters")
143
187
 
144
188
  | Parameter | Type |
145
189
  | --------- | --------------------------------------------------------- |
146
190
  | `value` | `string` |
147
191
  | `matcher` | [`Matcher`](./docs/api/appkit/TypeAlias.Matcher.md) |
148
192
 
149
- #### Returns[​](#returns-4 "Direct link to Returns")
193
+ #### Returns[​](#returns-5 "Direct link to Returns")
150
194
 
151
195
  [`AssertionHandle`](./docs/api/appkit/Interface.AssertionHandle.md)
152
196
 
153
197
  ***
154
198
 
199
+ ### reset()[​](#reset "Direct link to reset()")
200
+
201
+ ```ts
202
+ reset(): void;
203
+
204
+ ```
205
+
206
+ Start a fresh conversation: the next `send` opens a new thread with no history. Use to run several independent one-shot checks in one test. Consecutive `send`s (without a `reset`) stay in one multi-turn conversation.
207
+
208
+ #### Returns[​](#returns-6 "Direct link to Returns")
209
+
210
+ `void`
211
+
212
+ ***
213
+
155
214
  ### send()[​](#send "Direct link to send()")
156
215
 
157
216
  ```ts
@@ -161,13 +220,13 @@ send(message: string): Promise<void>;
161
220
 
162
221
  Send a user message to the agent and capture its response.
163
222
 
164
- #### Parameters[​](#parameters-5 "Direct link to Parameters")
223
+ #### Parameters[​](#parameters-6 "Direct link to Parameters")
165
224
 
166
225
  | Parameter | Type |
167
226
  | --------- | -------- |
168
227
  | `message` | `string` |
169
228
 
170
- #### Returns[​](#returns-5 "Direct link to Returns")
229
+ #### Returns[​](#returns-7 "Direct link to Returns")
171
230
 
172
231
  `Promise`<`void`>
173
232
 
@@ -182,13 +241,13 @@ skip(reason?: string): never;
182
241
 
183
242
  Skip this eval with an optional reason.
184
243
 
185
- #### Parameters[​](#parameters-6 "Direct link to Parameters")
244
+ #### Parameters[​](#parameters-7 "Direct link to Parameters")
186
245
 
187
246
  | Parameter | Type |
188
247
  | --------- | -------- |
189
248
  | `reason?` | `string` |
190
249
 
191
- #### Returns[​](#returns-6 "Direct link to Returns")
250
+ #### Returns[​](#returns-8 "Direct link to Returns")
192
251
 
193
252
  `never`
194
253
 
@@ -203,6 +262,6 @@ succeeded(): AssertionHandle;
203
262
 
204
263
  Assert the last turn completed successfully (gate by default).
205
264
 
206
- #### Returns[​](#returns-7 "Direct link to Returns")
265
+ #### Returns[​](#returns-9 "Direct link to Returns")
207
266
 
208
267
  [`AssertionHandle`](./docs/api/appkit/Interface.AssertionHandle.md)