@babav/knowledge-core-client 0.30.0 → 0.31.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 +13 -3
- package/package.json +1 -1
- package/src/index.ts +12 -2
package/dist/index.d.ts
CHANGED
|
@@ -95,7 +95,15 @@ export interface QueryRequest {
|
|
|
95
95
|
* registers). */
|
|
96
96
|
export type VisualLayout = "linear-flow" | "ring-cycle" | "nesting" | "radial-hub" | "side-by-side" | "stacked-layers" | "two-state" | "free";
|
|
97
97
|
/** A visual attached to a response, anchored by char offsets into `answer` (SAME coordinate
|
|
98
|
-
* system as citations).
|
|
98
|
+
* system as citations).
|
|
99
|
+
*
|
|
100
|
+
* UNIFORM DELIVERY: every register (chart / structural / conceptual / scenic) carries `image` — a
|
|
101
|
+
* PNG served BY KC. To display it, GET `image.url` (resolve a relative path against your KC base
|
|
102
|
+
* URL) with your normal API key; the response body is the PNG bytes. The URL is a stable, non-
|
|
103
|
+
* expiring KC endpoint for persisted/conversational visuals (`expires_at` absent), so it works on
|
|
104
|
+
* reload/copy/export and on later conversation retrieval — the client never fetches GCS and never
|
|
105
|
+
* parses inline SVG. `rendered_svg` appears ONLY as a rare fail-soft fallback (server rasterization
|
|
106
|
+
* failed); prefer `image` and treat `rendered_svg` as a last resort. */
|
|
99
107
|
export interface Visual {
|
|
100
108
|
id: string;
|
|
101
109
|
anchor: {
|
|
@@ -107,13 +115,15 @@ export interface Visual {
|
|
|
107
115
|
payload: Record<string, unknown>;
|
|
108
116
|
/** Declared spatial arrangement (meaningful for `conceptual`; "free" otherwise). */
|
|
109
117
|
layout: VisualLayout;
|
|
110
|
-
|
|
118
|
+
/** PRIMARY: GET this (relative to your KC base, with your API key) -> PNG bytes. */
|
|
111
119
|
image?: {
|
|
112
120
|
url: string;
|
|
113
|
-
expires_at: number;
|
|
114
121
|
width: number;
|
|
115
122
|
height: number;
|
|
123
|
+
expires_at?: number;
|
|
116
124
|
};
|
|
125
|
+
/** Fail-soft fallback only (rasterize/store failed); normally absent. */
|
|
126
|
+
rendered_svg?: string;
|
|
117
127
|
}
|
|
118
128
|
/** Visual stage (streaming): generation has started. MAY be emitted twice — first with
|
|
119
129
|
* `pending: null` (started, count unknown), then again with the ACCURATE post-vet count before
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babav/knowledge-core-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.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
|
@@ -129,7 +129,15 @@ export type VisualLayout =
|
|
|
129
129
|
| "free";
|
|
130
130
|
|
|
131
131
|
/** A visual attached to a response, anchored by char offsets into `answer` (SAME coordinate
|
|
132
|
-
* system as citations).
|
|
132
|
+
* system as citations).
|
|
133
|
+
*
|
|
134
|
+
* UNIFORM DELIVERY: every register (chart / structural / conceptual / scenic) carries `image` — a
|
|
135
|
+
* PNG served BY KC. To display it, GET `image.url` (resolve a relative path against your KC base
|
|
136
|
+
* URL) with your normal API key; the response body is the PNG bytes. The URL is a stable, non-
|
|
137
|
+
* expiring KC endpoint for persisted/conversational visuals (`expires_at` absent), so it works on
|
|
138
|
+
* reload/copy/export and on later conversation retrieval — the client never fetches GCS and never
|
|
139
|
+
* parses inline SVG. `rendered_svg` appears ONLY as a rare fail-soft fallback (server rasterization
|
|
140
|
+
* failed); prefer `image` and treat `rendered_svg` as a last resort. */
|
|
133
141
|
export interface Visual {
|
|
134
142
|
id: string;
|
|
135
143
|
anchor: { start: number; end: number };
|
|
@@ -138,8 +146,10 @@ export interface Visual {
|
|
|
138
146
|
payload: Record<string, unknown>; // {kind: "grammar"|"vega_lite"|"svg"|"image", ...}
|
|
139
147
|
/** Declared spatial arrangement (meaningful for `conceptual`; "free" otherwise). */
|
|
140
148
|
layout: VisualLayout;
|
|
149
|
+
/** PRIMARY: GET this (relative to your KC base, with your API key) -> PNG bytes. */
|
|
150
|
+
image?: { url: string; width: number; height: number; expires_at?: number };
|
|
151
|
+
/** Fail-soft fallback only (rasterize/store failed); normally absent. */
|
|
141
152
|
rendered_svg?: string;
|
|
142
|
-
image?: { url: string; expires_at: number; width: number; height: number };
|
|
143
153
|
}
|
|
144
154
|
|
|
145
155
|
/** Visual stage (streaming): generation has started. MAY be emitted twice — first with
|