@kindgi/api 0.1.3 → 0.1.4-rc.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 (193) hide show
  1. package/dist/agent-binding.d.ts +18 -4
  2. package/dist/agent-binding.d.ts.map +1 -1
  3. package/dist/agent-pins.d.ts +48 -0
  4. package/dist/agent-pins.d.ts.map +1 -0
  5. package/dist/agent-pins.js +102 -0
  6. package/dist/agent-pins.js.map +1 -0
  7. package/dist/app.d.ts +22 -0
  8. package/dist/app.d.ts.map +1 -1
  9. package/dist/app.js +20 -2
  10. package/dist/app.js.map +1 -1
  11. package/dist/block-binding.d.ts +132 -0
  12. package/dist/block-binding.d.ts.map +1 -0
  13. package/dist/block-binding.js +4 -0
  14. package/dist/block-binding.js.map +1 -0
  15. package/dist/block-pins.d.ts +22 -0
  16. package/dist/block-pins.d.ts.map +1 -0
  17. package/dist/block-pins.js +112 -0
  18. package/dist/block-pins.js.map +1 -0
  19. package/dist/cost-binding.d.ts +20 -1
  20. package/dist/cost-binding.d.ts.map +1 -1
  21. package/dist/cost-binding.js +4 -0
  22. package/dist/cost-binding.js.map +1 -1
  23. package/dist/deploy-versions.d.ts +58 -0
  24. package/dist/deploy-versions.d.ts.map +1 -0
  25. package/dist/deploy-versions.js +91 -0
  26. package/dist/deploy-versions.js.map +1 -0
  27. package/dist/deployment-binding.d.ts +24 -3
  28. package/dist/deployment-binding.d.ts.map +1 -1
  29. package/dist/derive-agent-version.d.ts +69 -0
  30. package/dist/derive-agent-version.d.ts.map +1 -0
  31. package/dist/derive-agent-version.js +139 -0
  32. package/dist/derive-agent-version.js.map +1 -0
  33. package/dist/errors.d.ts.map +1 -1
  34. package/dist/errors.js +17 -0
  35. package/dist/errors.js.map +1 -1
  36. package/dist/eval-case-binding.d.ts +65 -0
  37. package/dist/eval-case-binding.d.ts.map +1 -0
  38. package/dist/eval-case-binding.js +4 -0
  39. package/dist/eval-case-binding.js.map +1 -0
  40. package/dist/eval-run-binding.d.ts +30 -0
  41. package/dist/eval-run-binding.d.ts.map +1 -1
  42. package/dist/eval-run-dispatcher.d.ts +38 -3
  43. package/dist/eval-run-dispatcher.d.ts.map +1 -1
  44. package/dist/eval-run-dispatcher.js +21 -15
  45. package/dist/eval-run-dispatcher.js.map +1 -1
  46. package/dist/eval-suite-binding.d.ts +1 -1
  47. package/dist/eval-suite-binding.d.ts.map +1 -1
  48. package/dist/eval-suite-binding.js +2 -0
  49. package/dist/eval-suite-binding.js.map +1 -1
  50. package/dist/flow-binding.d.ts +10 -4
  51. package/dist/flow-binding.d.ts.map +1 -1
  52. package/dist/flow-pins.d.ts +36 -0
  53. package/dist/flow-pins.d.ts.map +1 -0
  54. package/dist/flow-pins.js +81 -0
  55. package/dist/flow-pins.js.map +1 -0
  56. package/dist/index.d.ts +17 -6
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +8 -2
  59. package/dist/index.js.map +1 -1
  60. package/dist/judged-dispatcher.d.ts +134 -0
  61. package/dist/judged-dispatcher.d.ts.map +1 -0
  62. package/dist/judged-dispatcher.js +297 -0
  63. package/dist/judged-dispatcher.js.map +1 -0
  64. package/dist/judged-items.d.ts +86 -0
  65. package/dist/judged-items.d.ts.map +1 -0
  66. package/dist/judged-items.js +184 -0
  67. package/dist/judged-items.js.map +1 -0
  68. package/dist/judgment-binding.d.ts +316 -0
  69. package/dist/judgment-binding.d.ts.map +1 -0
  70. package/dist/judgment-binding.js +19 -0
  71. package/dist/judgment-binding.js.map +1 -0
  72. package/dist/openapi/generate.d.ts.map +1 -1
  73. package/dist/openapi/generate.js +4 -1
  74. package/dist/openapi/generate.js.map +1 -1
  75. package/dist/openapi/operations.d.ts.map +1 -1
  76. package/dist/openapi/operations.js +461 -7
  77. package/dist/openapi/operations.js.map +1 -1
  78. package/dist/openapi/schemas.d.ts +40 -0
  79. package/dist/openapi/schemas.d.ts.map +1 -1
  80. package/dist/openapi/schemas.js +843 -7
  81. package/dist/openapi/schemas.js.map +1 -1
  82. package/dist/provider-binding.d.ts +12 -7
  83. package/dist/provider-binding.d.ts.map +1 -1
  84. package/dist/routes/agents.d.ts +9 -1
  85. package/dist/routes/agents.d.ts.map +1 -1
  86. package/dist/routes/agents.js +175 -11
  87. package/dist/routes/agents.js.map +1 -1
  88. package/dist/routes/blocks.d.ts +19 -0
  89. package/dist/routes/blocks.d.ts.map +1 -0
  90. package/dist/routes/blocks.js +281 -0
  91. package/dist/routes/blocks.js.map +1 -0
  92. package/dist/routes/cost.d.ts.map +1 -1
  93. package/dist/routes/cost.js +47 -2
  94. package/dist/routes/cost.js.map +1 -1
  95. package/dist/routes/deployments.d.ts +3 -0
  96. package/dist/routes/deployments.d.ts.map +1 -1
  97. package/dist/routes/deployments.js +208 -55
  98. package/dist/routes/deployments.js.map +1 -1
  99. package/dist/routes/eval-comparison.d.ts +14 -0
  100. package/dist/routes/eval-comparison.d.ts.map +1 -0
  101. package/dist/routes/eval-comparison.js +87 -0
  102. package/dist/routes/eval-comparison.js.map +1 -0
  103. package/dist/routes/eval-runs.d.ts.map +1 -1
  104. package/dist/routes/eval-runs.js +8 -0
  105. package/dist/routes/eval-runs.js.map +1 -1
  106. package/dist/routes/flows.d.ts +13 -1
  107. package/dist/routes/flows.d.ts.map +1 -1
  108. package/dist/routes/flows.js +44 -3
  109. package/dist/routes/flows.js.map +1 -1
  110. package/dist/routes/hierarchy-errors.d.ts +35 -0
  111. package/dist/routes/hierarchy-errors.d.ts.map +1 -0
  112. package/dist/routes/hierarchy-errors.js +39 -0
  113. package/dist/routes/hierarchy-errors.js.map +1 -0
  114. package/dist/routes/judged-suites.d.ts +20 -0
  115. package/dist/routes/judged-suites.d.ts.map +1 -0
  116. package/dist/routes/judged-suites.js +272 -0
  117. package/dist/routes/judged-suites.js.map +1 -0
  118. package/dist/routes/judgment-context.d.ts +22 -0
  119. package/dist/routes/judgment-context.d.ts.map +1 -0
  120. package/dist/routes/judgment-context.js +88 -0
  121. package/dist/routes/judgment-context.js.map +1 -0
  122. package/dist/routes/judgment-flow-context.d.ts +32 -0
  123. package/dist/routes/judgment-flow-context.d.ts.map +1 -0
  124. package/dist/routes/judgment-flow-context.js +195 -0
  125. package/dist/routes/judgment-flow-context.js.map +1 -0
  126. package/dist/routes/judgments.d.ts +41 -0
  127. package/dist/routes/judgments.d.ts.map +1 -0
  128. package/dist/routes/judgments.js +566 -0
  129. package/dist/routes/judgments.js.map +1 -0
  130. package/dist/routes/orgs.d.ts +5 -2
  131. package/dist/routes/orgs.d.ts.map +1 -1
  132. package/dist/routes/orgs.js +38 -22
  133. package/dist/routes/orgs.js.map +1 -1
  134. package/dist/routes/policies.d.ts.map +1 -1
  135. package/dist/routes/policies.js +12 -1
  136. package/dist/routes/policies.js.map +1 -1
  137. package/dist/routes/projects.d.ts +10 -2
  138. package/dist/routes/projects.d.ts.map +1 -1
  139. package/dist/routes/projects.js +87 -79
  140. package/dist/routes/projects.js.map +1 -1
  141. package/dist/routes/providers.d.ts.map +1 -1
  142. package/dist/routes/providers.js +6 -1
  143. package/dist/routes/providers.js.map +1 -1
  144. package/dist/routes/runs.js +24 -3
  145. package/dist/routes/runs.js.map +1 -1
  146. package/dist/routes/teams.d.ts +6 -2
  147. package/dist/routes/teams.d.ts.map +1 -1
  148. package/dist/routes/teams.js +77 -73
  149. package/dist/routes/teams.js.map +1 -1
  150. package/openapi.json +13545 -10103
  151. package/package.json +21 -21
  152. package/src/agent-binding.ts +19 -4
  153. package/src/agent-pins.ts +147 -0
  154. package/src/app.ts +71 -2
  155. package/src/block-binding.ts +137 -0
  156. package/src/block-pins.ts +148 -0
  157. package/src/cost-binding.ts +21 -1
  158. package/src/deploy-versions.ts +157 -0
  159. package/src/deployment-binding.ts +27 -3
  160. package/src/derive-agent-version.ts +206 -0
  161. package/src/errors.ts +17 -0
  162. package/src/eval-case-binding.ts +71 -0
  163. package/src/eval-run-binding.ts +33 -0
  164. package/src/eval-run-dispatcher.ts +57 -16
  165. package/src/eval-suite-binding.ts +2 -0
  166. package/src/flow-binding.ts +11 -4
  167. package/src/flow-pins.ts +113 -0
  168. package/src/index.ts +85 -2
  169. package/src/judged-dispatcher.ts +507 -0
  170. package/src/judged-items.ts +263 -0
  171. package/src/judgment-binding.ts +349 -0
  172. package/src/openapi/generate.ts +7 -1
  173. package/src/openapi/operations.ts +523 -7
  174. package/src/openapi/schemas.ts +1009 -88
  175. package/src/provider-binding.ts +12 -7
  176. package/src/routes/agents.ts +243 -19
  177. package/src/routes/blocks.ts +362 -0
  178. package/src/routes/cost.ts +55 -1
  179. package/src/routes/deployments.ts +266 -56
  180. package/src/routes/eval-comparison.ts +101 -0
  181. package/src/routes/eval-runs.ts +11 -0
  182. package/src/routes/flows.ts +63 -5
  183. package/src/routes/hierarchy-errors.ts +51 -0
  184. package/src/routes/judged-suites.ts +363 -0
  185. package/src/routes/judgment-context.ts +128 -0
  186. package/src/routes/judgment-flow-context.ts +245 -0
  187. package/src/routes/judgments.ts +743 -0
  188. package/src/routes/orgs.ts +44 -27
  189. package/src/routes/policies.ts +19 -0
  190. package/src/routes/projects.ts +106 -95
  191. package/src/routes/providers.ts +5 -0
  192. package/src/routes/runs.ts +28 -3
  193. package/src/routes/teams.ts +96 -90
@@ -3,10 +3,13 @@
3
3
 
4
4
  import { randomUUID } from 'node:crypto';
5
5
 
6
- import type { RunId, TenantId, Timestamp } from '@kindgi/types';
6
+ import type { ReplayTurnReport } from '@kindgi/agents';
7
+ import type { RunReplayRef } from '@kindgi/runtime';
8
+ import type { ProjectId, RunId, TenantId, Timestamp } from '@kindgi/types';
7
9
 
8
10
  import type {
9
11
  AgentRef,
12
+ EvalComparison,
10
13
  EvalRun,
11
14
  EvalRunBinding,
12
15
  EvalRunCancelInput,
@@ -50,6 +53,16 @@ export interface EvalRunSubjectInvokeInput {
50
53
  readonly input: unknown;
51
54
  readonly dryRun: boolean;
52
55
  readonly abortSignal: AbortSignal;
56
+ /** The eval run's project: where the subject runs. */
57
+ readonly projectId?: ProjectId;
58
+ /**
59
+ * Set when the subject re-runs a past run (a comparison eval run): the
60
+ * run is a replay of `of` for the eval run, under the replay rules
61
+ * (`InvokeAgentInput.replay`).
62
+ */
63
+ readonly replay?: RunReplayRef;
64
+ /** The conversation before the past turn, oldest first: a replayed turn starts from it. */
65
+ readonly history?: readonly unknown[];
53
66
  }
54
67
 
55
68
  export interface EvalRunSubjectInvokeOutcome {
@@ -57,6 +70,22 @@ export interface EvalRunSubjectInvokeOutcome {
57
70
  readonly error?: string;
58
71
  readonly costUsd?: number;
59
72
  readonly durationMs?: number;
73
+ /** The run the subject ran in. */
74
+ readonly runId?: RunId;
75
+ /** A replay's report: each tool call and what happened to it (`AgentTurnResult.replay`). */
76
+ readonly replay?: ReplayTurnReport;
77
+ /** The provider and model that answered. */
78
+ readonly provider?: { readonly id: string; readonly model: string };
79
+ /**
80
+ * Set when a replayed flow stopped at a tool call the replay refused (a
81
+ * write the past run didn't make): no output, and what it would have
82
+ * done. Not an error: the replay did what it's meant to.
83
+ */
84
+ readonly stopped?: {
85
+ readonly toolId: string;
86
+ readonly arguments: unknown;
87
+ readonly reason?: string;
88
+ };
60
89
  }
61
90
 
62
91
  /**
@@ -100,6 +129,10 @@ export interface DispatchContext {
100
129
  readonly dryRun: boolean;
101
130
  readonly abortSignal: AbortSignal;
102
131
  readonly subject: EvalSubjectInvoker;
132
+ /** The eval run's project. */
133
+ readonly projectId?: ProjectId;
134
+ /** A comparison eval run's baseline, reads and repetitions. */
135
+ readonly comparison?: EvalComparison;
103
136
  onProgress(perCase: Readonly<Record<string, unknown>>): void;
104
137
  }
105
138
 
@@ -113,6 +146,7 @@ export interface EvalRunDispatcher {
113
146
  validate?(
114
147
  suite: EvalSuite,
115
148
  target: AgentRef | FlowRef,
149
+ comparison?: EvalComparison,
116
150
  ): { kind: 'ok' } | { kind: 'err'; message: string };
117
151
  dispatch(ctx: DispatchContext): Promise<DispatchResult>;
118
152
  }
@@ -311,26 +345,13 @@ export function createInProcessEvalRunBinding(
311
345
  };
312
346
  }
313
347
  if (dispatcher.validate !== undefined) {
314
- const v = dispatcher.validate(suite, target);
348
+ const v = dispatcher.validate(suite, target, input.comparison);
315
349
  if (v.kind === 'err') {
316
350
  return { kind: 'dispatcher-input-invalid', message: v.message };
317
351
  }
318
352
  }
319
353
  const runId = randomUUID() as unknown as RunId;
320
- const startedAt = now().toISOString() as unknown as Timestamp;
321
- const record: EvalRun = {
322
- runId,
323
- tenantId: input.tenantId,
324
- suiteId: suite.id,
325
- suiteVersion: suite.version,
326
- kind: suite.kind,
327
- ...(input.agentRef !== undefined && { agentRef: input.agentRef }),
328
- ...(input.flowRef !== undefined && { flowRef: input.flowRef }),
329
- status: 'running' as EvalRunStatus,
330
- dryRun: input.dryRun === true,
331
- startedAt,
332
- ...(input.correlationId !== undefined && { correlationId: input.correlationId }),
333
- };
354
+ const record = newRunRecord(input, suite, runId, now());
334
355
  setRun(record);
335
356
  const controller = new AbortController();
336
357
  controllers.set(runId as unknown as string, controller);
@@ -349,6 +370,8 @@ export function createInProcessEvalRunBinding(
349
370
  dryRun: input.dryRun === true,
350
371
  abortSignal: controller.signal,
351
372
  subject: options.subject,
373
+ projectId: input.projectId,
374
+ ...(input.comparison !== undefined && { comparison: input.comparison }),
352
375
  onProgress: (perCaseEntry: Readonly<Record<string, unknown>>) => {
353
376
  const current = runs.get(runId as unknown as string);
354
377
  if (current === undefined) return;
@@ -489,6 +512,24 @@ export function createInProcessEvalRunBinding(
489
512
  };
490
513
  }
491
514
 
515
+ /** A started run's row: `running`, with what it runs and how. */
516
+ function newRunRecord(input: EvalRunStartInput, suite: EvalSuite, runId: RunId, at: Date): EvalRun {
517
+ return {
518
+ runId,
519
+ tenantId: input.tenantId,
520
+ suiteId: suite.id,
521
+ suiteVersion: suite.version,
522
+ kind: suite.kind,
523
+ ...(input.agentRef !== undefined && { agentRef: input.agentRef }),
524
+ ...(input.flowRef !== undefined && { flowRef: input.flowRef }),
525
+ status: 'running',
526
+ dryRun: input.dryRun === true,
527
+ startedAt: at.toISOString() as unknown as Timestamp,
528
+ ...(input.correlationId !== undefined && { correlationId: input.correlationId }),
529
+ ...(input.comparison !== undefined && { comparison: input.comparison }),
530
+ };
531
+ }
532
+
492
533
  function isTerminal(status: EvalRunStatus): boolean {
493
534
  return status === 'completed' || status === 'failed' || status === 'cancelled';
494
535
  }
@@ -100,6 +100,8 @@ export const EVAL_KINDS = [
100
100
  'human-review',
101
101
  'benchmark',
102
102
  'custom',
103
+ /** Built from judgments of past runs: cases are copies of judged runs (`EvalCaseStoreBinding`). */
104
+ 'judged',
103
105
  ] as const;
104
106
  export type EvalKind = (typeof EVAL_KINDS)[number];
105
107
 
@@ -39,11 +39,12 @@ export interface FlowRegistryBinding {
39
39
  */
40
40
  get(input: FlowGetInput): Promise<Flow | null>;
41
41
  /**
42
- * Specific `(flowId, version)` lookup, or `null` if unknown.
43
- * Returns tombstoned versions too — provenance paths need to
44
- * resolve historical run references.
42
+ * Specific `(flowId, version)` lookup, or `null` if unknown. Returns
43
+ * unregistered (tombstoned) versions too, with `unregisteredAt` set:
44
+ * a resumed run and provenance read them, while a new run that names
45
+ * one is refused.
45
46
  */
46
- getVersion(input: FlowGetVersionInput): Promise<Flow | null>;
47
+ getVersion(input: FlowGetVersionInput): Promise<FlowVersionRecord | null>;
47
48
  /**
48
49
  * Head-row existence check. Lets `GET /v1/flows/{id}` distinguish
49
50
  * `410 gone` (identity exists, no active version) from `404 not-
@@ -79,6 +80,12 @@ export interface FlowRegistryBinding {
79
80
  reinstateVersion(input: FlowReinstateVersionInput): Promise<FlowReinstateVersionOutcome>;
80
81
  }
81
82
 
83
+ /** A flow version as `getVersion` reads it: `unregisteredAt` is set when it's unregistered. */
84
+ export type FlowVersionRecord = Flow & {
85
+ /** ISO-8601; present only on an unregistered version. */
86
+ readonly unregisteredAt?: string;
87
+ };
88
+
82
89
  export interface FlowListInput {
83
90
  readonly tenantId: TenantId;
84
91
  readonly limit: number;
@@ -0,0 +1,113 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // Copyright (C) 2026 Kindgi Inc.
3
+
4
+ import type { AgentId } from '@kindgi/agents';
5
+ import type { TupleEnqueueHook } from '@kindgi/authz';
6
+ import { type Flow, type FlowPins, flowPinsDigest, flowRefs } from '@kindgi/flow';
7
+ import { latestVersion } from '@kindgi/tools';
8
+ import type { Cursor, FlowId, ProjectId, TenantId, ToolId } from '@kindgi/types';
9
+
10
+ import type { AgentRegistryBinding } from './agent-binding.js';
11
+ import { type UnpinnableRef, activeToolVersions } from './agent-pins.js';
12
+ import { type DeployedVersionOutcome, deployVersion } from './deploy-versions.js';
13
+ import type { FlowRegistryBinding } from './flow-binding.js';
14
+ import type { ToolRegistryBinding } from './tool-binding.js';
15
+
16
+ export type FlowPinsOutcome =
17
+ | { readonly kind: 'ok'; readonly pins: FlowPins }
18
+ | { readonly kind: 'unpinnable'; readonly issues: readonly UnpinnableRef[] };
19
+
20
+ /**
21
+ * Pin a flow version when it's published: each tool it runs, and each
22
+ * agent it runs at no named version, to its latest active version now
23
+ * (what a run would have bound), so every run of the version uses those.
24
+ * A tool or agent with no published version makes the flow unpinnable:
25
+ * the caller refuses the publish, naming each, rather than store a
26
+ * partly pinned version.
27
+ */
28
+ export async function resolveFlowPins(
29
+ tools: ToolRegistryBinding,
30
+ agents: AgentRegistryBinding,
31
+ tenantId: TenantId,
32
+ flow: Flow,
33
+ ): Promise<FlowPinsOutcome> {
34
+ const refs = flowRefs(flow);
35
+ const pinned: { tools: Record<string, string>; agents: Record<string, string> } = {
36
+ tools: {},
37
+ agents: {},
38
+ };
39
+ const issues: UnpinnableRef[] = [];
40
+ for (const id of refs.tools) {
41
+ const latest = latestVersion(await activeToolVersions(tools, tenantId, id as ToolId));
42
+ if (latest !== undefined) pinned.tools[id] = latest;
43
+ else
44
+ issues.push({
45
+ path: '/nodes',
46
+ message: `tool "${id}" has no published version; publish the tool first`,
47
+ });
48
+ }
49
+ for (const id of refs.agents) {
50
+ const latest = await agents.get({ tenantId, agentId: id as AgentId });
51
+ if (latest !== null) pinned.agents[id] = latest.version as unknown as string;
52
+ else
53
+ issues.push({
54
+ path: '/nodes',
55
+ message: `agent "${id}" has no published version; publish the agent first`,
56
+ });
57
+ }
58
+ if (issues.length > 0) return { kind: 'unpinnable', issues };
59
+ return { kind: 'ok', pins: pinned };
60
+ }
61
+
62
+ export interface PublishDeployedFlowInput {
63
+ readonly flows: FlowRegistryBinding;
64
+ readonly tenantId: TenantId;
65
+ readonly projectId: ProjectId;
66
+ /** The flow as the pack defines it, with no pins. */
67
+ readonly flow: Flow;
68
+ readonly pins: FlowPins;
69
+ readonly enqueueTuples: TupleEnqueueHook;
70
+ }
71
+
72
+ /** Register a deployed flow with its pins, by the deploy rule (`deployVersion`). */
73
+ export async function publishDeployedFlow(
74
+ input: PublishDeployedFlowInput,
75
+ ): Promise<DeployedVersionOutcome> {
76
+ const { flows, tenantId, projectId, flow, pins, enqueueTuples } = input;
77
+ return deployVersion<Flow>({
78
+ label: `flow "${flow.id as unknown as string}"`,
79
+ definition: flow,
80
+ pins,
81
+ pinsDigest: flowPinsDigest(pins),
82
+ existing: await allFlowVersions(flows, tenantId, flow.id),
83
+ publish: async (version) => {
84
+ const outcome = await flows.publish({ tenantId, projectId, flow: version, enqueueTuples });
85
+ if (outcome.kind === 'ok') return 'ok';
86
+ return outcome.kind === 'project-not-found' ? 'skipped' : 'taken';
87
+ },
88
+ });
89
+ }
90
+
91
+ /** Page size for reading a flow's versions. */
92
+ const VERSIONS_PAGE = 200;
93
+
94
+ /** Every active version of a flow. */
95
+ async function allFlowVersions(
96
+ flows: FlowRegistryBinding,
97
+ tenantId: TenantId,
98
+ flowId: FlowId,
99
+ ): Promise<readonly Flow[]> {
100
+ const versions: Flow[] = [];
101
+ let cursor: Cursor | undefined;
102
+ do {
103
+ const page = await flows.listVersions({
104
+ tenantId,
105
+ flowId,
106
+ limit: VERSIONS_PAGE,
107
+ ...(cursor !== undefined && { cursor }),
108
+ });
109
+ versions.push(...page.data);
110
+ cursor = page.nextCursor;
111
+ } while (cursor !== undefined);
112
+ return versions;
113
+ }
package/src/index.ts CHANGED
@@ -233,6 +233,7 @@ export type {
233
233
  AgentPublishInput,
234
234
  AgentPublishOutcome,
235
235
  AgentRegistryBinding,
236
+ AgentVersionRecord,
236
237
  AgentReinstateVersionInput,
237
238
  AgentReinstateVersionOutcome,
238
239
  AgentUnregisterInput,
@@ -247,6 +248,7 @@ export type {
247
248
  FlowPublishInput,
248
249
  FlowPublishOutcome,
249
250
  FlowRegistryBinding,
251
+ FlowVersionRecord,
250
252
  FlowReinstateVersionInput,
251
253
  FlowReinstateVersionOutcome,
252
254
  FlowUnregisterInput,
@@ -309,7 +311,7 @@ export {
309
311
  stdioRefusal,
310
312
  } from './tenant-host-access.js';
311
313
  export type { HostReach, TenantHostAccess } from './tenant-host-access.js';
312
- export { POLICY_KINDS } from '@kindgi/policy-contract';
314
+ export { APPLIED_POLICY_KINDS, POLICY_KINDS } from '@kindgi/policy-contract';
313
315
  export type {
314
316
  Policy,
315
317
  PolicyGetInput,
@@ -328,6 +330,61 @@ export type {
328
330
  PolicyVersionPage,
329
331
  PolicyVersionRow,
330
332
  } from '@kindgi/policy-contract';
333
+ export { JUDGE_CLASS_SCOPE_KINDS, VERDICTS, judgeClassApplies } from './judgment-binding.js';
334
+ export type {
335
+ EvalCaseListInput,
336
+ EvalCasePage,
337
+ EvalCasePutInput,
338
+ EvalCaseStoreBinding,
339
+ JudgedEvalCase,
340
+ JudgedItemSummary,
341
+ } from './eval-case-binding.js';
342
+ export { MAX_JUDGED_CASES } from './routes/judged-suites.js';
343
+ export { MAX_JUDGED_HISTORY } from './routes/judgment-context.js';
344
+ export type {
345
+ JudgeClass,
346
+ JudgeClassCreateInput,
347
+ JudgeClassCreateOutcome,
348
+ JudgeClassGetInput,
349
+ JudgeClassListInput,
350
+ JudgeClassPage,
351
+ JudgeClassScope,
352
+ JudgeClassScopeKind,
353
+ JudgeClassUpdateInput,
354
+ JudgedItem,
355
+ JudgedFlowContext,
356
+ JudgedFlowStep,
357
+ JudgedRunContext,
358
+ JudgedToolCall,
359
+ JudgedRunCopy,
360
+ JudgedRunListInput,
361
+ JudgedRunPage,
362
+ JudgedRunWithJudgments,
363
+ JudgedSubject,
364
+ Judgment,
365
+ JudgmentAssertedBy,
366
+ JudgmentGetInput,
367
+ JudgmentListInput,
368
+ JudgmentPage,
369
+ JudgmentRecordInput,
370
+ JudgmentRegistryBinding,
371
+ JudgmentWithCopies,
372
+ Verdict,
373
+ } from './judgment-binding.js';
374
+ export { resolvePointer } from './routes/judgments.js';
375
+ export type {
376
+ BlockGetInput,
377
+ BlockGetVersionInput,
378
+ BlockListInput,
379
+ BlockListVersionsInput,
380
+ BlockPage,
381
+ BlockPublishInput,
382
+ BlockPublishOutcome,
383
+ BlockRecord,
384
+ BlockRegistryBinding,
385
+ BlockReinstateOutcome,
386
+ BlockVersionInput,
387
+ } from './block-binding.js';
331
388
  export { EVAL_KINDS } from './eval-suite-binding.js';
332
389
  export type {
333
390
  EvalKind,
@@ -348,6 +405,9 @@ export type {
348
405
  export { EVAL_RUN_STATUSES } from './eval-run-binding.js';
349
406
  export type {
350
407
  AgentRef,
408
+ EvalBaseline,
409
+ EvalComparison,
410
+ EvalReads,
351
411
  EvalRun,
352
412
  EvalRunBinding,
353
413
  EvalRunCancelInput,
@@ -379,7 +439,27 @@ export type {
379
439
  EvalSubjectInvoker,
380
440
  InProcessEvalRunBindingOptions,
381
441
  } from './eval-run-dispatcher.js';
382
- export { COST_GROUP_DIMENSIONS } from './cost-binding.js';
442
+ export { DEFAULT_COMPARISON, createJudgedDispatcher } from './judged-dispatcher.js';
443
+ export type {
444
+ ComparisonBaselineSummary,
445
+ ComparisonMetric,
446
+ JudgedCaseResult,
447
+ JudgedComparisonSummary,
448
+ JudgedDispatcherOptions,
449
+ } from './judged-dispatcher.js';
450
+ export { itemChanges, matchJudged, outputItems, scoreItems, valueAt } from './judged-items.js';
451
+ export type {
452
+ ItemChanges,
453
+ ItemJudgments,
454
+ MatchedItem,
455
+ OutputItem,
456
+ OutputScore,
457
+ } from './judged-items.js';
458
+ export {
459
+ COST_AGGREGATE_DEFAULT_LIMIT,
460
+ COST_AGGREGATE_MAX_LIMIT,
461
+ COST_GROUP_DIMENSIONS,
462
+ } from './cost-binding.js';
383
463
  export type {
384
464
  CostAggregateGroup,
385
465
  CostAggregateInput,
@@ -477,7 +557,10 @@ export type {
477
557
  DeploymentGetInput,
478
558
  DeploymentListInput,
479
559
  DeploymentPage,
560
+ DeployedAgent,
561
+ DeployedFlow,
480
562
  DeployedPrimitive,
563
+ DeployedVersion,
481
564
  DeploymentContents,
482
565
  DeploymentPrimitiveCounts,
483
566
  DeploymentRegisterInput,