@verdict-ai/sdk 0.1.0 → 0.2.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.
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Reads which rubric versions an environment runs, for a service that evaluates on its own machine with its own model
3
+ * keys (docs/design/control-plane.md §6). The whole environment arrives in one answer and is kept; after `refreshMs`
4
+ * the next call asks the server again — no timer runs, so this works in Workers. A check that fails or is slow never
5
+ * stops the service: it carries on with the versions it holds and says so in `source`.
6
+ */
7
+ import type { Rubric, RubricInput } from "@verdict-ai/core";
8
+ export interface EnvironmentOptions {
9
+ project: string;
10
+ environment: string;
11
+ /** How long an answer is used before the next call asks the server again. Default 60 s. */
12
+ refreshMs?: number;
13
+ /** How long a check may take before the versions already held are used instead. Default 2 s. */
14
+ timeoutMs?: number;
15
+ /** Rubrics to run, by name, while the server has given none: at a cold start it cannot answer, or before a first promotion. */
16
+ fallback?: Record<string, RubricInput>;
17
+ /** Told about every failed check. The reader carries on with what it holds. */
18
+ onError?: (error: unknown) => void;
19
+ /** Clock (tests). */
20
+ now?: () => number;
21
+ }
22
+ export interface EnvironmentRubric {
23
+ rubric: Rubric;
24
+ /** The version that will run — log it with each judgment. */
25
+ versionId: string;
26
+ /** `server`: confirmed by the last check. `stale`: the last check failed, this is what was held. `fallback`: the rubric given in code. */
27
+ source: "server" | "stale" | "fallback";
28
+ }
29
+ export interface EnvironmentReader {
30
+ /** The rubric this environment runs under `name`. Throws only when there is nothing to run: no answer yet and no fallback. */
31
+ rubric(name: string): Promise<EnvironmentRubric>;
32
+ /** Asks the server now, whatever `refreshMs` says. Resolves to whether the check succeeded. */
33
+ refresh(): Promise<boolean>;
34
+ }
35
+ /** GET `path` with these headers, giving up after `timeoutMs`. */
36
+ export type EnvironmentTransport = (path: string, headers: Record<string, string>, timeoutMs: number) => Promise<Response>;
37
+ export declare function environmentReader(send: EnvironmentTransport, options: EnvironmentOptions): EnvironmentReader;
@@ -0,0 +1,76 @@
1
+ import { VerdictError } from "./errors.js";
2
+ const DEFAULT_REFRESH_MS = 60_000;
3
+ const DEFAULT_TIMEOUT_MS = 2_000;
4
+ /** Freezes a document the way the server does; loaded on first use so clients that never read environments stay small. */
5
+ async function freeze(rubric) {
6
+ const { freezeRubric } = await import("@verdict-ai/core");
7
+ const version = await freezeRubric(rubric);
8
+ return { rubric: version.rubric, versionId: version.id };
9
+ }
10
+ /** Every document is used only if it freezes to the id the server named: a changed or cut-off answer is refused whole. */
11
+ async function verified(answer) {
12
+ const kept = new Map();
13
+ for (const pointer of answer.pointers ?? []) {
14
+ const frozen = await freeze(pointer.rubric);
15
+ if (frozen.versionId !== pointer.versionId)
16
+ throw new VerdictError(502, "integrity", `${pointer.name}: the server named ${pointer.versionId}, but the rubric it sent freezes to ${frozen.versionId}`);
17
+ kept.set(pointer.name, frozen);
18
+ }
19
+ return kept;
20
+ }
21
+ async function failure(res) {
22
+ const body = await res.json().catch(() => undefined);
23
+ return new VerdictError(res.status, body?.error?.type ?? "http", body?.error?.message ?? `HTTP ${res.status}`);
24
+ }
25
+ export function environmentReader(send, options) {
26
+ const { project, environment, refreshMs = DEFAULT_REFRESH_MS, timeoutMs = DEFAULT_TIMEOUT_MS, fallback = {}, onError, now = () => Date.now() } = options;
27
+ const path = `/v1/projects/${encodeURIComponent(project)}/environments/${encodeURIComponent(environment)}?include=rubrics`;
28
+ const spares = new Map();
29
+ let held;
30
+ let checkedAt = Number.NEGATIVE_INFINITY, confirmed = false, lastError, checking;
31
+ const check = async () => {
32
+ try {
33
+ const res = await send(path, held?.etag ? { "if-none-match": held.etag } : {}, timeoutMs);
34
+ if (!(res.status === 304 && held)) {
35
+ if (!res.ok)
36
+ throw await failure(res);
37
+ held = { etag: res.headers.get("etag"), rubrics: await verified(await res.json()) };
38
+ }
39
+ confirmed = true;
40
+ }
41
+ catch (error) {
42
+ confirmed = false;
43
+ lastError = error;
44
+ onError?.(error);
45
+ }
46
+ finally {
47
+ checkedAt = now();
48
+ }
49
+ };
50
+ // Calls that arrive during a check wait for that one check.
51
+ const checked = () => (checking ??= check().finally(() => { checking = undefined; }));
52
+ const spare = (name) => (name in fallback ? spares.get(name) ?? spares.set(name, freeze(fallback[name])).get(name) : undefined);
53
+ return {
54
+ async rubric(name) {
55
+ // With nothing to run for this name, waiting out the interval would only delay the error.
56
+ const nothingToRun = !held && !(name in fallback);
57
+ if (now() - checkedAt >= refreshMs || nothingToRun)
58
+ await checked();
59
+ const kept = held?.rubrics.get(name);
60
+ if (kept)
61
+ return { ...kept, source: confirmed ? "server" : "stale" };
62
+ const given = await spare(name);
63
+ if (given)
64
+ return { ...given, source: "fallback" };
65
+ if (held)
66
+ throw new VerdictError(404, "not_promoted", `${environment} in ${project} does not run ${name}, and no fallback rubric was given for it`);
67
+ const why = lastError instanceof Error ? lastError.message : String(lastError);
68
+ throw new VerdictError(lastError instanceof VerdictError ? lastError.status : 0, "environment_unavailable", `could not read ${environment} in ${project} and no fallback rubric was given for ${name}: ${why}`);
69
+ },
70
+ async refresh() {
71
+ await checked();
72
+ return confirmed;
73
+ },
74
+ };
75
+ }
76
+ //# sourceMappingURL=environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAsC3C,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC,0HAA0H;AAC1H,KAAK,UAAU,MAAM,CAAC,MAAe;IACnC,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;IAC3C,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;AAC3D,CAAC;A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C,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,yBAAyB,EAAE,kBAAkB,WAAW,OAAO,OAAO,yCAAyC,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC;QAClN,CAAC;QACD,KAAK,CAAC,OAAO;YACX,MAAM,OAAO,EAAE,CAAC;YAChB,OAAO,SAAS,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Carries transport status, error type and optional API issues for failed client requests. `details` is the API's
3
+ * whole error object: a refused promotion (`type: "pointer_conflict"`) lists where the pointers are in `details.current`.
4
+ */
5
+ export declare class VerdictError extends Error {
6
+ status: number;
7
+ type: string;
8
+ issues?: unknown | undefined;
9
+ details?: Record<string, unknown> | undefined;
10
+ constructor(status: number, type: string, message: string, issues?: unknown | undefined, details?: Record<string, unknown> | undefined);
11
+ }
package/dist/errors.js ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Carries transport status, error type and optional API issues for failed client requests. `details` is the API's
3
+ * whole error object: a refused promotion (`type: "pointer_conflict"`) lists where the pointers are in `details.current`.
4
+ */
5
+ export class VerdictError extends Error {
6
+ status;
7
+ type;
8
+ issues;
9
+ details;
10
+ constructor(status, type, message, issues, details) {
11
+ super(message);
12
+ this.status = status;
13
+ this.type = type;
14
+ this.issues = issues;
15
+ this.details = details;
16
+ }
17
+ }
18
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAClB;IAAuB;IAAsC;IAAyB;IAAzG,YAAmB,MAAc,EAAS,IAAY,EAAE,OAAe,EAAS,MAAgB,EAAS,OAAiC;QAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAA1I,WAAM,GAAN,MAAM,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAQ;QAA0B,WAAM,GAAN,MAAM,CAAU;QAAS,YAAO,GAAP,OAAO,CAA0B;IAAoB,CAAC;CAChK"}
package/dist/index.d.ts CHANGED
@@ -2,21 +2,33 @@
2
2
  * Provides a typed client for Verdict REST operations and polling.
3
3
  * Idempotency replay metadata is preserved; transport failures use VerdictError and Workers-safe fetch.
4
4
  */
5
- import type { CalibrationReport, Aggregation, Evaluation, Input, Rubric, RubricInput, Subject } from "@verdict-ai/core";
5
+ import type { CalibrationReport, Aggregation, ComparisonReport, ComparisonReportRequest, Environment, Evaluation, Input, Pointer, Project, ProjectVersion, PromotionEvent, PromotionRequest, Publication, PublicationIssue, PublicationRequest, PublicationResult, PublicListing, PublicPublication, PublicVersionEntry, RollbackRequest, Rubric, RubricInput, RubricName, RunReport, RunReportRequest, Subject, VersionUpload } from "@verdict-ai/core";
6
+ import { type EnvironmentOptions, type EnvironmentReader } from "./environment.js";
7
+ export { VerdictError } from "./errors.js";
8
+ export type { EnvironmentOptions, EnvironmentReader, EnvironmentRubric } from "./environment.js";
6
9
  export interface VerdictOptions {
7
10
  apiKey?: string;
8
11
  baseUrl?: string;
9
12
  fetch?: typeof fetch;
10
13
  /** Request timeout in ms (sync evaluations can take a while). Default 10 min. */
11
14
  timeoutMs?: number;
15
+ /** The organisation requests are about, on servers where one key reaches several (sent as `x-verdict-org`). Other servers ignore it. */
16
+ org?: string;
12
17
  }
13
- /** Carries transport status, error type and optional API issues for failed client requests. */
14
- export declare class VerdictError extends Error {
15
- status: number;
16
- type: string;
17
- issues?: unknown | undefined;
18
- constructor(status: number, type: string, message: string, issues?: unknown | undefined);
18
+ /** How a server signs people in from the CLI when it runs the approval itself. */
19
+ export interface BrowserSignIn {
20
+ kind: "browser";
21
+ start: string;
22
+ token: string;
19
23
  }
24
+ /** Documents as the control plane returns them: without the tenant they are stored under. */
25
+ export type ProjectView = Omit<Project, "tenantId">;
26
+ export type EnvironmentView = Omit<Environment, "tenantId">;
27
+ export type PointerView = Pick<Pointer, "name" | "versionId" | "updatedAt">;
28
+ export type VersionView = Omit<ProjectVersion, "tenantId">;
29
+ export type PromotionEventView = Omit<PromotionEvent, "tenantId">;
30
+ export type RunReportView = Omit<RunReport, "tenantId">;
31
+ export type ComparisonReportView = Omit<ComparisonReport, "tenantId">;
20
32
  export interface EvaluateParams {
21
33
  rubric: string | RubricInput;
22
34
  inputs?: Input[];
@@ -42,12 +54,21 @@ export declare class Verdict {
42
54
  private baseUrl;
43
55
  private f;
44
56
  private timeoutMs;
57
+ private org;
45
58
  constructor(opts?: VerdictOptions);
46
59
  request<T>(method: string, path: string, body?: unknown, contentType?: string, headers?: Record<string, string>): Promise<T>;
47
60
  requestWithMeta<T>(method: string, path: string, body?: unknown, contentType?: string, headers?: Record<string, string>): Promise<{
48
61
  data: T;
49
62
  replayed: boolean;
50
63
  }>;
64
+ /**
65
+ * What an environment runs, for a service that evaluates locally: `await verdict.environment({ project, environment }).rubric("intent")`
66
+ * resolves to `{ rubric, versionId, source }`. Keep one reader per environment: it holds the versions it received and
67
+ * asks the server again only after `refreshMs`.
68
+ */
69
+ environment(options: EnvironmentOptions): EnvironmentReader;
70
+ /** A GET that gives up after `timeoutMs`, whether or not the fetch in use honours the abort signal. */
71
+ private get;
51
72
  rubrics: {
52
73
  calibration: (id: string, options?: {
53
74
  target?: number;
@@ -99,6 +120,7 @@ export declare class Verdict {
99
120
  description: string;
100
121
  label?: string | undefined;
101
122
  }[] | undefined;
123
+ threshold?: number | undefined;
102
124
  judge?: import("@verdict-ai/core").JudgeSpec | import("@verdict-ai/core").JudgeSpec[] | undefined;
103
125
  rater?: "min" | "max" | "mean" | "median" | "majority" | "trimmed_mean" | undefined;
104
126
  inputs?: string[] | undefined;
@@ -140,6 +162,7 @@ export declare class Verdict {
140
162
  message?: string | undefined;
141
163
  }[] | undefined;
142
164
  checksJudge?: import("@verdict-ai/core").JudgeSpec | undefined;
165
+ inputSchema?: import("@verdict-ai/core").InputSchema | undefined;
143
166
  metadata?: Record<string, unknown> | undefined;
144
167
  } & {
145
168
  id: string;
@@ -194,6 +217,7 @@ export declare class Verdict {
194
217
  description: string;
195
218
  label?: string | undefined;
196
219
  }[] | undefined;
220
+ threshold?: number | undefined;
197
221
  judge?: import("@verdict-ai/core").JudgeSpec | import("@verdict-ai/core").JudgeSpec[] | undefined;
198
222
  rater?: "min" | "max" | "mean" | "median" | "majority" | "trimmed_mean" | undefined;
199
223
  inputs?: string[] | undefined;
@@ -235,6 +259,7 @@ export declare class Verdict {
235
259
  message?: string | undefined;
236
260
  }[] | undefined;
237
261
  checksJudge?: import("@verdict-ai/core").JudgeSpec | undefined;
262
+ inputSchema?: import("@verdict-ai/core").InputSchema | undefined;
238
263
  metadata?: Record<string, unknown> | undefined;
239
264
  } & {
240
265
  id: string;
@@ -289,6 +314,7 @@ export declare class Verdict {
289
314
  description: string;
290
315
  label?: string | undefined;
291
316
  }[] | undefined;
317
+ threshold?: number | undefined;
292
318
  judge?: import("@verdict-ai/core").JudgeSpec | import("@verdict-ai/core").JudgeSpec[] | undefined;
293
319
  rater?: "min" | "max" | "mean" | "median" | "majority" | "trimmed_mean" | undefined;
294
320
  inputs?: string[] | undefined;
@@ -330,6 +356,7 @@ export declare class Verdict {
330
356
  message?: string | undefined;
331
357
  }[] | undefined;
332
358
  checksJudge?: import("@verdict-ai/core").JudgeSpec | undefined;
359
+ inputSchema?: import("@verdict-ai/core").InputSchema | undefined;
333
360
  metadata?: Record<string, unknown> | undefined;
334
361
  } & {
335
362
  id: string;
@@ -395,6 +422,146 @@ export declare class Verdict {
395
422
  }>;
396
423
  }>;
397
424
  };
425
+ /** Hub sign-in: trade a GitHub token (device flow, run by the caller) for a hub API key bound to that account. */
426
+ hub: {
427
+ config: () => Promise<{
428
+ github: {
429
+ clientId: string;
430
+ } | null;
431
+ publishing: "github" | "tenant";
432
+ signIn?: BrowserSignIn;
433
+ }>;
434
+ login: (githubToken: string) => Promise<{
435
+ apiKey: string;
436
+ keyId: string;
437
+ handle: string;
438
+ tenantId: string;
439
+ }>;
440
+ me: () => Promise<{
441
+ tenantId: string | null;
442
+ handle: string | null;
443
+ github: {
444
+ id: number;
445
+ login: string;
446
+ } | null;
447
+ }>;
448
+ revokeKey: (id: string) => Promise<void>;
449
+ /** Public reads (no key): search cards, read one card at a version with its history, or one publication by id. */
450
+ search: (q?: {
451
+ q?: string;
452
+ domain?: string;
453
+ locale?: string;
454
+ type?: "score" | "noul" | "choice";
455
+ owner?: string;
456
+ limit?: number;
457
+ }) => Promise<{
458
+ data: PublicListing[];
459
+ }>;
460
+ card: (owner: string, slug: string, opts?: {
461
+ version?: string;
462
+ }) => Promise<{
463
+ publication: PublicPublication;
464
+ versions: PublicVersionEntry[];
465
+ }>;
466
+ publication: (id: string) => Promise<PublicPublication>;
467
+ };
468
+ /** Publishing to the public hub: preview shows exactly the document publish would store. */
469
+ publications: {
470
+ preview: (request: PublicationRequest) => Promise<PublicationResult>;
471
+ create: (request: PublicationRequest) => Promise<{
472
+ publication: Publication;
473
+ warnings: PublicationIssue[];
474
+ created: boolean;
475
+ }>;
476
+ list: (opts?: {
477
+ limit?: number;
478
+ }) => Promise<{
479
+ data: Publication[];
480
+ }>;
481
+ withdraw: (id: string) => Promise<void>;
482
+ };
483
+ /** Projects group environments and rubric versions (the control plane). Deleting repeats the name as confirmation. */
484
+ projects: {
485
+ create: (name: string) => Promise<ProjectView>;
486
+ list: () => Promise<{
487
+ data: ProjectView[];
488
+ }>;
489
+ delete: (name: string) => Promise<void>;
490
+ /** Pointer changes of a project, newest first. */
491
+ history: (project: string, q?: {
492
+ environment?: string;
493
+ name?: string;
494
+ limit?: number;
495
+ }) => Promise<{
496
+ data: PromotionEventView[];
497
+ }>;
498
+ };
499
+ /** Environments say which version of each rubric runs. A change names the version the caller saw (`expected`). */
500
+ environments: {
501
+ create: (project: string, name: string) => Promise<EnvironmentView>;
502
+ list: (project: string) => Promise<{
503
+ data: EnvironmentView[];
504
+ }>;
505
+ get: (project: string, name: string) => Promise<EnvironmentView & {
506
+ pointers: PointerView[];
507
+ }>;
508
+ delete: (project: string, name: string) => Promise<void>;
509
+ /** Moves pointers, all or none. `versionId: null` removes a pointer. A stale `expected` throws `pointer_conflict`. */
510
+ promote: (project: string, name: string, request: PromotionRequest) => Promise<{
511
+ events: PromotionEventView[];
512
+ }>;
513
+ /** Undoes the latest change of one pointer. */
514
+ rollback: (project: string, name: string, request: RollbackRequest) => Promise<{
515
+ event: PromotionEventView;
516
+ }>;
517
+ };
518
+ /** Immutable rubric versions kept in a project under the name services ask for. */
519
+ versions: {
520
+ names: (project: string) => Promise<{
521
+ data: RubricName[];
522
+ }>;
523
+ /** Uploads a frozen version; the server freezes the rubric again and refuses another id. */
524
+ push: (project: string, name: string, version: VersionUpload) => Promise<{
525
+ version: VersionView;
526
+ created: boolean;
527
+ }>;
528
+ list: (project: string, name: string, opts?: {
529
+ limit?: number;
530
+ }) => Promise<{
531
+ data: Array<Omit<VersionView, "rubric">>;
532
+ }>;
533
+ get: (project: string, name: string, id: string) => Promise<VersionView>;
534
+ /** Refused with `in_use` while an environment points at the version. */
535
+ delete: (project: string, name: string, id: string) => Promise<void>;
536
+ };
537
+ /** Numbers about runs made elsewhere (your CI). Build requests with `runReportRequest` / `comparisonReportRequest` from core: they copy counts only. */
538
+ reports: {
539
+ run: (project: string, request: RunReportRequest) => Promise<{
540
+ report: RunReportView;
541
+ created: boolean;
542
+ }>;
543
+ runs: (project: string, q?: {
544
+ name?: string;
545
+ versionId?: string;
546
+ dataset?: string;
547
+ limit?: number;
548
+ }) => Promise<{
549
+ data: RunReportView[];
550
+ }>;
551
+ getRun: (project: string, runId: string) => Promise<RunReportView>;
552
+ /** Both runs must have been reported first. */
553
+ comparison: (project: string, request: ComparisonReportRequest) => Promise<{
554
+ report: ComparisonReportView;
555
+ created: boolean;
556
+ }>;
557
+ comparisons: (project: string, q?: {
558
+ name?: string;
559
+ head?: string;
560
+ limit?: number;
561
+ }) => Promise<{
562
+ data: ComparisonReportView[];
563
+ }>;
564
+ };
398
565
  batches: {
399
566
  create: (params: BatchParams, opts?: {
400
567
  idempotencyKey?: string;
package/dist/index.js CHANGED
@@ -1,15 +1,6 @@
1
- /** Carries transport status, error type and optional API issues for failed client requests. */
2
- export class VerdictError extends Error {
3
- status;
4
- type;
5
- issues;
6
- constructor(status, type, message, issues) {
7
- super(message);
8
- this.status = status;
9
- this.type = type;
10
- this.issues = issues;
11
- }
12
- }
1
+ import { environmentReader } from "./environment.js";
2
+ import { VerdictError } from "./errors.js";
3
+ export { VerdictError } from "./errors.js";
13
4
  // why: synchronous judging can be slow; polling uses the same ten-minute default as individual requests.
14
5
  const DEFAULT_TIMEOUT_MS = 600_000;
15
6
  const DEFAULT_POLL_INTERVAL_MS = 1500;
@@ -25,7 +16,9 @@ export class Verdict {
25
16
  baseUrl;
26
17
  f;
27
18
  timeoutMs;
19
+ org;
28
20
  constructor(opts = {}) {
21
+ this.org = opts.org ? { "x-verdict-org": opts.org } : {};
29
22
  this.apiKey = opts.apiKey ?? globalThis.process?.env?.VERDICT_API_KEY;
30
23
  this.baseUrl = (opts.baseUrl ?? globalThis.process?.env?.VERDICT_API_URL ?? "http://localhost:8787").replace(/\/$/, "");
31
24
  this.f = opts.fetch ?? ((input, init) => globalThis.fetch(input, init)); // bound call: Workers reject a detached fetch
@@ -41,7 +34,7 @@ export class Verdict {
41
34
  const res = await this.f(`${this.baseUrl}${path}`, {
42
35
  method,
43
36
  signal: ctrl.signal,
44
- headers: { "content-type": contentType, ...(this.apiKey ? { authorization: `Bearer ${this.apiKey}` } : {}), ...headers },
37
+ headers: { "content-type": contentType, ...(this.apiKey ? { authorization: `Bearer ${this.apiKey}` } : {}), ...this.org, ...headers },
45
38
  body: body === undefined ? undefined : typeof body === "string" ? body : JSON.stringify(body),
46
39
  });
47
40
  // why: successful deletes have no JSON body to decode.
@@ -51,7 +44,7 @@ export class Verdict {
51
44
  const error = apiError(data);
52
45
  // The API returns failed evaluations with 422; these documents remain readable client results.
53
46
  if (!res.ok && !(res.status === 422 && !error))
54
- throw new VerdictError(res.status, error?.type ?? "http", error?.message ?? `HTTP ${res.status}`, error?.issues);
47
+ throw new VerdictError(res.status, error?.type ?? "http", error?.message ?? `HTTP ${res.status}`, error?.issues, error?.details);
55
48
  return { data: data, replayed: res.headers.get("Idempotency-Replayed") === "true" };
56
49
  }
57
50
  catch (error) {
@@ -63,6 +56,32 @@ export class Verdict {
63
56
  clearTimeout(t);
64
57
  }
65
58
  }
59
+ /**
60
+ * What an environment runs, for a service that evaluates locally: `await verdict.environment({ project, environment }).rubric("intent")`
61
+ * resolves to `{ rubric, versionId, source }`. Keep one reader per environment: it holds the versions it received and
62
+ * asks the server again only after `refreshMs`.
63
+ */
64
+ environment(options) {
65
+ return environmentReader((path, headers, timeoutMs) => this.get(path, headers, timeoutMs), options);
66
+ }
67
+ /** A GET that gives up after `timeoutMs`, whether or not the fetch in use honours the abort signal. */
68
+ async get(path, headers, timeoutMs) {
69
+ const ctrl = new AbortController();
70
+ let timer;
71
+ const late = new Promise((_, reject) => { timer = setTimeout(() => { ctrl.abort(); reject(new VerdictError(408, "timeout", `no answer from ${this.baseUrl} within ${timeoutMs} ms`)); }, timeoutMs); });
72
+ const asked = this.f(`${this.baseUrl}${path}`, { method: "GET", signal: ctrl.signal, headers: { ...(this.apiKey ? { authorization: `Bearer ${this.apiKey}` } : {}), ...this.org, ...headers } });
73
+ // An abort also rejects the fetch; that rejection has been answered by `late` already.
74
+ asked.catch(() => undefined);
75
+ try {
76
+ return await Promise.race([asked, late]);
77
+ }
78
+ catch (error) {
79
+ throw error instanceof VerdictError ? error : new VerdictError(0, "network", `Verdict request failed: ${error instanceof Error ? error.message : String(error)}`);
80
+ }
81
+ finally {
82
+ clearTimeout(timer);
83
+ }
84
+ }
66
85
  rubrics = {
67
86
  calibration: (id, options = {}) => this.request("GET", `/v1/rubrics/${encodeURIComponent(id)}/calibration?${new URLSearchParams(Object.entries(options).filter(([, v]) => v !== undefined).map(([k, v]) => [k, String(v)]))}`),
68
87
  create: (rubric) => typeof rubric === "string" ? this.request("POST", "/v1/rubrics", rubric, "application/yaml") : this.request("POST", "/v1/rubrics", rubric),
@@ -103,6 +122,62 @@ export class Verdict {
103
122
  tasks = {
104
123
  list: (rater) => this.request("GET", `/v1/tasks${rater ? `?rater=${encodeURIComponent(rater)}` : ""}`),
105
124
  };
125
+ /** Hub sign-in: trade a GitHub token (device flow, run by the caller) for a hub API key bound to that account. */
126
+ hub = {
127
+ config: () => this.request("GET", "/v1/hub/config"),
128
+ login: (githubToken) => this.request("POST", "/v1/hub/login", { githubToken }),
129
+ me: () => this.request("GET", "/v1/hub/me"),
130
+ revokeKey: (id) => this.request("DELETE", `/v1/hub/keys/${encodeURIComponent(id)}`),
131
+ /** Public reads (no key): search cards, read one card at a version with its history, or one publication by id. */
132
+ search: (q = {}) => this.request("GET", `/v1/public/rubrics?${new URLSearchParams(Object.entries(q).filter(([, v]) => v !== undefined).map(([k, v]) => [k, String(v)]))}`),
133
+ card: (owner, slug, opts = {}) => this.request("GET", `/v1/public/rubrics/${encodeURIComponent(owner)}/${encodeURIComponent(slug)}${opts.version ? `?version=${encodeURIComponent(opts.version)}` : ""}`),
134
+ publication: (id) => this.request("GET", `/v1/public/publications/${encodeURIComponent(id)}`),
135
+ };
136
+ /** Publishing to the public hub: preview shows exactly the document publish would store. */
137
+ publications = {
138
+ preview: (request) => this.request("POST", "/v1/publications/preview", request),
139
+ create: (request) => this.request("POST", "/v1/publications", request),
140
+ list: (opts = {}) => this.request("GET", `/v1/publications${opts.limit ? `?limit=${opts.limit}` : ""}`),
141
+ withdraw: (id) => this.request("DELETE", `/v1/publications/${encodeURIComponent(id)}`),
142
+ };
143
+ /** Projects group environments and rubric versions (the control plane). Deleting repeats the name as confirmation. */
144
+ projects = {
145
+ create: (name) => this.request("POST", "/v1/projects", { name }),
146
+ list: () => this.request("GET", "/v1/projects"),
147
+ delete: (name) => this.request("DELETE", `/v1/projects/${seg(name)}`, { confirm: name }),
148
+ /** Pointer changes of a project, newest first. */
149
+ history: (project, q = {}) => this.request("GET", `/v1/projects/${seg(project)}/history${query(q)}`),
150
+ };
151
+ /** Environments say which version of each rubric runs. A change names the version the caller saw (`expected`). */
152
+ environments = {
153
+ create: (project, name) => this.request("POST", `/v1/projects/${seg(project)}/environments`, { name }),
154
+ list: (project) => this.request("GET", `/v1/projects/${seg(project)}/environments`),
155
+ get: (project, name) => this.request("GET", `/v1/projects/${seg(project)}/environments/${seg(name)}`),
156
+ delete: (project, name) => this.request("DELETE", `/v1/projects/${seg(project)}/environments/${seg(name)}`, { confirm: name }),
157
+ /** Moves pointers, all or none. `versionId: null` removes a pointer. A stale `expected` throws `pointer_conflict`. */
158
+ promote: (project, name, request) => this.request("POST", `/v1/projects/${seg(project)}/environments/${seg(name)}/promotions`, request),
159
+ /** Undoes the latest change of one pointer. */
160
+ rollback: (project, name, request) => this.request("POST", `/v1/projects/${seg(project)}/environments/${seg(name)}/rollbacks`, request),
161
+ };
162
+ /** Immutable rubric versions kept in a project under the name services ask for. */
163
+ versions = {
164
+ names: (project) => this.request("GET", `/v1/projects/${seg(project)}/rubrics`),
165
+ /** Uploads a frozen version; the server freezes the rubric again and refuses another id. */
166
+ push: (project, name, version) => this.request("POST", `/v1/projects/${seg(project)}/rubrics/${seg(name)}/versions`, version),
167
+ list: (project, name, opts = {}) => this.request("GET", `/v1/projects/${seg(project)}/rubrics/${seg(name)}/versions${query(opts)}`),
168
+ get: (project, name, id) => this.request("GET", `/v1/projects/${seg(project)}/rubrics/${seg(name)}/versions/${seg(id)}`),
169
+ /** Refused with `in_use` while an environment points at the version. */
170
+ delete: (project, name, id) => this.request("DELETE", `/v1/projects/${seg(project)}/rubrics/${seg(name)}/versions/${seg(id)}`),
171
+ };
172
+ /** Numbers about runs made elsewhere (your CI). Build requests with `runReportRequest` / `comparisonReportRequest` from core: they copy counts only. */
173
+ reports = {
174
+ run: (project, request) => this.request("POST", `/v1/projects/${seg(project)}/reports/runs`, request),
175
+ runs: (project, q = {}) => this.request("GET", `/v1/projects/${seg(project)}/reports/runs${query(q)}`),
176
+ getRun: (project, runId) => this.request("GET", `/v1/projects/${seg(project)}/reports/runs/${seg(runId)}`),
177
+ /** Both runs must have been reported first. */
178
+ comparison: (project, request) => this.request("POST", `/v1/projects/${seg(project)}/reports/comparisons`, request),
179
+ comparisons: (project, q = {}) => this.request("GET", `/v1/projects/${seg(project)}/reports/comparisons${query(q)}`),
180
+ };
106
181
  batches = {
107
182
  create: (params, opts = {}) => this.request("POST", "/v1/batches", params, "application/json", keyHeaders(opts.idempotencyKey)),
108
183
  createIdempotent: async (params, key) => {
@@ -112,6 +187,11 @@ export class Verdict {
112
187
  };
113
188
  }
114
189
  export default Verdict;
190
+ const seg = encodeURIComponent;
191
+ function query(q) {
192
+ const entries = Object.entries(q).filter(([, v]) => v !== undefined).map(([k, v]) => [k, String(v)]);
193
+ return entries.length ? `?${new URLSearchParams(entries)}` : "";
194
+ }
115
195
  function keyHeaders(key) { return key === undefined ? {} : { "Idempotency-Key": key }; }
116
196
  async function responseBody(response) {
117
197
  try {
@@ -130,6 +210,6 @@ function apiError(data) {
130
210
  return undefined;
131
211
  if (typeof error.type !== "string" || typeof error.message !== "string")
132
212
  return undefined;
133
- return { type: error.type, message: error.message, issues: "issues" in error ? error.issues : undefined };
213
+ return { type: error.type, message: error.message, issues: "issues" in error ? error.issues : undefined, details: { ...error } };
134
214
  }
135
215
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,+FAA+F;AAC/F,MAAM,OAAO,YAAa,SAAQ,KAAK;IAClB;IAAuB;IAAsC;IAAhF,YAAmB,MAAc,EAAS,IAAY,EAAE,OAAe,EAAS,MAAgB;QAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAAhG,WAAM,GAAN,MAAM,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAQ;QAA0B,WA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9L,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,IAAa;IAC7B,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACzB,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,IAAI,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACzG,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC1F,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,CAAC;AACnI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdict-ai/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Verdict TypeScript SDK — a Resend-style client for the evaluation API.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -12,7 +12,7 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "@verdict-ai/core": "0.1.0"
15
+ "@verdict-ai/core": "0.2.0"
16
16
  },
17
17
  "license": "MIT",
18
18
  "repository": {