@babav/knowledge-core-client 0.57.0 → 0.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -79,6 +79,7 @@ export interface VisualOverrides {
79
79
  claims_check_model?: string;
80
80
  vision_judge_model?: string;
81
81
  image_gen_model?: string;
82
+ html_advisory_judge?: boolean;
82
83
  }
83
84
  /** Per-request visual control. Absent => mode resolves from the profile default. All visual
84
85
  * PROCESSING is server-side; the client only displays the result. */
@@ -544,6 +545,7 @@ export interface QueryProfile {
544
545
  visual_image_gen_model: string | null;
545
546
  visual_max_revisions: number | null;
546
547
  visual_combine_generation_and_concept: boolean | null;
548
+ visual_html_advisory_judge: boolean | null;
547
549
  concept_model_mode: string | null;
548
550
  scoring_status: "no_score" | "queued" | "running" | "scored" | null;
549
551
  scoring_progress_done: number | null;
@@ -672,6 +674,28 @@ export interface VisualComparison {
672
674
  note: string | null;
673
675
  arms: VisualArm[];
674
676
  }
677
+ /** One citation configuration measured in the citation benchmark. */
678
+ export interface CitationArm {
679
+ arm: string;
680
+ generation_model: string | null;
681
+ citation_model: string | null;
682
+ mechanism: string | null;
683
+ precision: number | null;
684
+ avg_citations_per_answer: number | null;
685
+ zero_citation_rate: number | null;
686
+ avg_cost_per_query_usd: number | null;
687
+ p50_ms: number | null;
688
+ n_questions: number | null;
689
+ note: string | null;
690
+ }
691
+ /** Citation-benchmark leaderboard (GET /v1/benchmark/citations) — per configuration: citation
692
+ * precision + yield + cost + latency. Native citations (~1.0 by construction) vs post-hoc (lower
693
+ * ceiling); each arm's `mechanism` says which. `arms` empty if no citation benchmark has run. */
694
+ export interface CitationComparison {
695
+ eval_version: string;
696
+ note: string | null;
697
+ arms: CitationArm[];
698
+ }
675
699
  export interface Tenant {
676
700
  id: UUID;
677
701
  name: string;
@@ -1154,6 +1178,14 @@ export declare class KnowledgeCoreClient extends HttpBase {
1154
1178
  visuals: (q?: {
1155
1179
  eval_version?: string;
1156
1180
  }) => Promise<VisualComparison>;
1181
+ /** Citation-benchmark leaderboard — per configuration (arm): citation precision, yield
1182
+ * (citations/answer, zero-citation rate), cost, latency. NATIVE-citation arms (Anthropic gen)
1183
+ * score ~1.0 by construction (verbatim inline quotes); POST-HOC arms (non-native gen + an
1184
+ * attributor) have a much lower ceiling regardless of attributor — see each arm's `mechanism`
1185
+ * and `note`. Read-only, tenant-anonymous. `arms` empty when no citation benchmark has run. */
1186
+ citations: (q?: {
1187
+ eval_version?: string;
1188
+ }) => Promise<CitationComparison>;
1157
1189
  /** Kick the sweep as the BENCHMARK TENANT (this client's own key — no admin key). The benchmark
1158
1190
  * tenant owns the bench corpora + eval-set; the sweep FULL-scores the sensible config set and
1159
1191
  * populates the leaderboard. Runs in the background — returns 202 immediately. */
package/dist/index.js CHANGED
@@ -493,6 +493,12 @@ export class KnowledgeCoreClient extends HttpBase {
493
493
  * vision judge — a Gemini-family concept model (Flash) may be self-flattered, so cross-family arms
494
494
  * (Opus) are the cleaner quality figure (see each arm's `quality_caveat`). */
495
495
  visuals: (q) => this.request("GET", "/v1/benchmark/visuals", { query: q }),
496
+ /** Citation-benchmark leaderboard — per configuration (arm): citation precision, yield
497
+ * (citations/answer, zero-citation rate), cost, latency. NATIVE-citation arms (Anthropic gen)
498
+ * score ~1.0 by construction (verbatim inline quotes); POST-HOC arms (non-native gen + an
499
+ * attributor) have a much lower ceiling regardless of attributor — see each arm's `mechanism`
500
+ * and `note`. Read-only, tenant-anonymous. `arms` empty when no citation benchmark has run. */
501
+ citations: (q) => this.request("GET", "/v1/benchmark/citations", { query: q }),
496
502
  /** Kick the sweep as the BENCHMARK TENANT (this client's own key — no admin key). The benchmark
497
503
  * tenant owns the bench corpora + eval-set; the sweep FULL-scores the sensible config set and
498
504
  * populates the leaderboard. Runs in the background — returns 202 immediately. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babav/knowledge-core-client",
3
- "version": "0.57.0",
3
+ "version": "0.59.0",
4
4
  "description": "TypeScript client for the Babav Knowledge Core API (Deno + Node 18+, zero deps). Includes the babav.visual grammar TYPES at the ./visual subpath (types only; all visual rendering is server-side).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -101,6 +101,7 @@ export interface VisualOverrides {
101
101
  claims_check_model?: string;
102
102
  vision_judge_model?: string;
103
103
  image_gen_model?: string; // scenic image generator (profile field: visual_image_gen_model)
104
+ html_advisory_judge?: boolean; // measure-only vision judge on shipped HTML figures (profile: visual_html_advisory_judge)
104
105
  }
105
106
 
106
107
  /** Per-request visual control. Absent => mode resolves from the profile default. All visual
@@ -511,6 +512,11 @@ export interface QueryProfile {
511
512
  visual_image_gen_model: string | null; // Vertex Gemini image-gen model (scenic register)
512
513
  visual_max_revisions: number | null;
513
514
  visual_combine_generation_and_concept: boolean | null;
515
+ // Measure-only vision judge on shipped conceptual (HTML) figures (null => on). When on, every
516
+ // shipped HTML figure is scored by the vision judge OFF the critical path — it's logged/counted
517
+ // server-side to reveal how often a figure would be flagged, but NEVER revises or drops it (zero
518
+ // added latency). A pure quality-telemetry knob; it does not change what the client receives.
519
+ visual_html_advisory_judge: boolean | null;
514
520
  concept_model_mode: string | null; // "reasoning" | "standard"; overrules gen mode when combining
515
521
  // --- score-my-profile status/progress (READ-only; not settable) ---------------------------------
516
522
  // Durable on the profile so a client can kick scoring, leave, and see the status/result on any later
@@ -637,6 +643,28 @@ export interface VisualComparison {
637
643
  note: string | null;
638
644
  arms: VisualArm[];
639
645
  }
646
+ /** One citation configuration measured in the citation benchmark. */
647
+ export interface CitationArm {
648
+ arm: string; // e.g. "opus_native" | "flash_self" | "flash_opus"
649
+ generation_model: string | null;
650
+ citation_model: string | null; // post-hoc attributor; null/native for Anthropic gen
651
+ mechanism: string | null; // "native" (inline, verbatim) | "posthoc" (attributor pass)
652
+ precision: number | null; // 0..1 — cited source actually supports the claim
653
+ avg_citations_per_answer: number | null;
654
+ zero_citation_rate: number | null; // fraction of answers with no citation
655
+ avg_cost_per_query_usd: number | null;
656
+ p50_ms: number | null;
657
+ n_questions: number | null;
658
+ note: string | null;
659
+ }
660
+ /** Citation-benchmark leaderboard (GET /v1/benchmark/citations) — per configuration: citation
661
+ * precision + yield + cost + latency. Native citations (~1.0 by construction) vs post-hoc (lower
662
+ * ceiling); each arm's `mechanism` says which. `arms` empty if no citation benchmark has run. */
663
+ export interface CitationComparison {
664
+ eval_version: string;
665
+ note: string | null;
666
+ arms: CitationArm[];
667
+ }
640
668
 
641
669
  export interface Tenant {
642
670
  id: UUID;
@@ -1290,6 +1318,13 @@ export class KnowledgeCoreClient extends HttpBase {
1290
1318
  * (Opus) are the cleaner quality figure (see each arm's `quality_caveat`). */
1291
1319
  visuals: (q?: { eval_version?: string }) =>
1292
1320
  this.request<VisualComparison>("GET", "/v1/benchmark/visuals", { query: q }),
1321
+ /** Citation-benchmark leaderboard — per configuration (arm): citation precision, yield
1322
+ * (citations/answer, zero-citation rate), cost, latency. NATIVE-citation arms (Anthropic gen)
1323
+ * score ~1.0 by construction (verbatim inline quotes); POST-HOC arms (non-native gen + an
1324
+ * attributor) have a much lower ceiling regardless of attributor — see each arm's `mechanism`
1325
+ * and `note`. Read-only, tenant-anonymous. `arms` empty when no citation benchmark has run. */
1326
+ citations: (q?: { eval_version?: string }) =>
1327
+ this.request<CitationComparison>("GET", "/v1/benchmark/citations", { query: q }),
1293
1328
  /** Kick the sweep as the BENCHMARK TENANT (this client's own key — no admin key). The benchmark
1294
1329
  * tenant owns the bench corpora + eval-set; the sweep FULL-scores the sensible config set and
1295
1330
  * populates the leaderboard. Runs in the background — returns 202 immediately. */