@andpipes/widget-sdk 0.1.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,494 @@
1
+ import { SupportedLocale } from '@andpipes/localization';
2
+ import { SchemaObject } from 'ajv';
3
+ export { W as WIDGET_RENDER_TOKEN_MAX_BYTES, a as WidgetRenderPayloadSizeInput, e as estimateWidgetRenderTokenBytes, i as isWidgetRenderPayloadWithinTokenLimit } from './render-token-limit-5gpQxyG-.cjs';
4
+
5
+ /**
6
+ * Widget payload の PII redaction helper (#88)。
7
+ *
8
+ * forbidden key を正規化 (小文字化 + 非英数字除去) で一致させ、object / array を再帰走査して
9
+ * 除去する。非破壊で新しい構造を返す。除去箇所は RedactionRecord に記録する。
10
+ *
11
+ * 限界 (重要): redaction は **key 名ベース** で判定する。forbidden に挙げた key 名以外の場所
12
+ * (例: ranking_table.cells の自由キー領域) に入った PII は除去されない。値ベースの検出は行わない。
13
+ * 呼び出し側は forbidden を拡張するか、自由キー領域へ PII を載せない構造を選ぶ責務がある。
14
+ *
15
+ * 安全性: 循環参照は "[Circular]" に置換してスタックオーバーフローを防ぐ。prototype 汚染を防ぐため
16
+ * 全 key を own enumerable property として複製する (__proto__ / constructor 等の特殊 key も値扱い)。
17
+ *
18
+ * tool-contract には依存しない: tool-contract は再利用可能な redactor を持たず
19
+ * (validatePiiPolicy は policy 検証のみ)、consumer-facing SDK を独立に保つため
20
+ * forbidden 集合をここに同居させる。
21
+ *
22
+ * SoT: blueprint §10.4 redaction。
23
+ */
24
+ interface RedactionRecord {
25
+ /** 除去した値の JSON path (例: cards[2].email)。 */
26
+ path: string;
27
+ /** 一致した元の key 名、または `field` descriptor の意味キー。 */
28
+ key: string;
29
+ }
30
+ interface RedactOptions {
31
+ /**
32
+ * 除去時に残す placeholder。null なら key 自体を落とす。
33
+ * 既定は "[REDACTED]" (mask 置換)。
34
+ */
35
+ placeholder?: string | null;
36
+ }
37
+ interface RedactResult<T> {
38
+ value: T;
39
+ redactions: RedactionRecord[];
40
+ }
41
+ /**
42
+ * data から forbidden な PII key を再帰除去する。非破壊で新構造を返す。
43
+ *
44
+ * @param data 走査対象 (object / array / primitive いずれも可)
45
+ * @param forbidden 除去する key 集合 (正規化して比較)
46
+ * @param options placeholder の挙動
47
+ */
48
+ declare function redactWidgetPayload<T>(data: T, forbidden?: readonly string[], options?: RedactOptions): RedactResult<T>;
49
+
50
+ /**
51
+ * Widget テンプレート名の権威タプル (#81)。envelope 検証 / fallback registry の key に使う。
52
+ * SoT: doc/origin/andpipe_implementation_blueprint.md §10.4、doc/specs/widget-and-config-mcp.md。
53
+ */
54
+ /** schema 1.0.0 から提供する初期5 template。 */
55
+ declare const LEGACY_WIDGET_TEMPLATES: readonly ["kpi_cards", "ranking_table", "trend_chart", "insight_list", "confirmation_panel"];
56
+ /** schema 1.1.0 で追加する advanced template。 */
57
+ declare const ADVANCED_WIDGET_TEMPLATES: readonly ["detail_card", "search_result_cards", "setup_draft_review"];
58
+ /** Widget v1で提供する8 templateの権威タプル。 */
59
+ declare const WIDGET_TEMPLATES: readonly ["kpi_cards", "ranking_table", "trend_chart", "insight_list", "confirmation_panel", "detail_card", "search_result_cards", "setup_draft_review"];
60
+ type WidgetTemplate = (typeof WIDGET_TEMPLATES)[number];
61
+ type LegacyWidgetTemplate = (typeof LEGACY_WIDGET_TEMPLATES)[number];
62
+ type AdvancedWidgetTemplate = (typeof ADVANCED_WIDGET_TEMPLATES)[number];
63
+ /** value が既知の widget テンプレートか判定する。 */
64
+ declare function isWidgetTemplate(value: unknown): value is WidgetTemplate;
65
+ declare function isAdvancedWidgetTemplate(value: unknown): value is AdvancedWidgetTemplate;
66
+
67
+ /**
68
+ * Widget response 共通 envelope の型・JSON Schema・schema version (#81)。
69
+ *
70
+ * 三層出力 (structuredContent / content[] / textFallback) と `_meta` を固定する。
71
+ * fallback 必須は schema の textFallback.minLength / content.minItems で担保する。
72
+ * envelope は host 拡張のため additionalProperties を閉じない (tool-contract 踏襲)。
73
+ *
74
+ * SoT: doc/origin/andpipe_implementation_blueprint.md §10.4。
75
+ */
76
+
77
+ /** 初期5 templateの互換version。 */
78
+ declare const WIDGET_SCHEMA_LEGACY_VERSION = "1.0.0";
79
+ /** advanced 3 template追加後のcurrent version。 */
80
+ declare const WIDGET_SCHEMA_VERSION = "1.1.0";
81
+ declare const WIDGET_SCHEMA_VERSIONS: readonly ["1.0.0", "1.1.0"];
82
+ type WidgetSchemaVersion = (typeof WIDGET_SCHEMA_VERSIONS)[number];
83
+ declare function isWidgetSchemaVersion(value: unknown): value is WidgetSchemaVersion;
84
+ /** template/version互換表。advanced templateをlegacy versionとして誤配信させない。 */
85
+ declare function isWidgetTemplateSupportedAtVersion(template: unknown, version: unknown): boolean;
86
+ /** semver (MAJOR.MINOR.PATCH) の最小 pattern。 */
87
+ declare const SEMVER_PATTERN = "^\\d+\\.\\d+\\.\\d+$";
88
+ /** MCP content block。textFallback を text として搬送する。 */
89
+ interface WidgetContentBlock {
90
+ type: "text";
91
+ text: string;
92
+ }
93
+ /** envelope の `_meta`。widget template / version と fallback 種別を持つ。 */
94
+ interface WidgetMeta {
95
+ widget: {
96
+ template: WidgetTemplate;
97
+ version: string;
98
+ };
99
+ fallback: {
100
+ type: "markdown";
101
+ };
102
+ }
103
+ /**
104
+ * Widget response envelope。
105
+ * structuredContent は redaction 済みデータ、content[] と textFallback に Markdown fallback を載せる。
106
+ */
107
+ interface WidgetEnvelope<T = unknown> {
108
+ structuredContent: T;
109
+ content: WidgetContentBlock[];
110
+ textFallback: string;
111
+ _meta: WidgetMeta;
112
+ }
113
+ /** envelope の JSON Schema (draft-07)。fallback 必須を minLength / minItems で担保する。 */
114
+ declare const WIDGET_ENVELOPE_V1_SCHEMA: {
115
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
116
+ readonly $id: "https://andpipe.dev/schema/widget-envelope/v1.json";
117
+ readonly title: "andpipe Widget envelope v1";
118
+ readonly type: "object";
119
+ readonly required: readonly ["structuredContent", "content", "textFallback", "_meta"];
120
+ readonly properties: {
121
+ readonly structuredContent: {
122
+ readonly type: "object";
123
+ };
124
+ readonly content: {
125
+ readonly type: "array";
126
+ readonly minItems: 1;
127
+ readonly items: {
128
+ readonly type: "object";
129
+ readonly required: readonly ["type", "text"];
130
+ readonly properties: {
131
+ readonly type: {
132
+ readonly const: "text";
133
+ };
134
+ readonly text: {
135
+ readonly type: "string";
136
+ readonly minLength: 1;
137
+ };
138
+ };
139
+ };
140
+ };
141
+ readonly textFallback: {
142
+ readonly type: "string";
143
+ readonly minLength: 1;
144
+ };
145
+ readonly _meta: {
146
+ readonly type: "object";
147
+ readonly required: readonly ["widget", "fallback"];
148
+ readonly properties: {
149
+ readonly widget: {
150
+ readonly type: "object";
151
+ readonly required: readonly ["template", "version"];
152
+ readonly properties: {
153
+ readonly template: {
154
+ readonly type: "string";
155
+ readonly enum: readonly ["kpi_cards", "ranking_table", "trend_chart", "insight_list", "confirmation_panel", "detail_card", "search_result_cards", "setup_draft_review"];
156
+ };
157
+ readonly version: {
158
+ readonly type: "string";
159
+ readonly enum: readonly ["1.0.0", "1.1.0"];
160
+ };
161
+ };
162
+ };
163
+ readonly fallback: {
164
+ readonly type: "object";
165
+ readonly required: readonly ["type"];
166
+ readonly properties: {
167
+ readonly type: {
168
+ readonly const: "markdown";
169
+ };
170
+ };
171
+ };
172
+ };
173
+ };
174
+ };
175
+ };
176
+ type WidgetEnvelopeV1Schema = typeof WIDGET_ENVELOPE_V1_SCHEMA;
177
+
178
+ /**
179
+ * Confirmation Panel widget の data 型と JSON Schema (#86)。template = "confirmation_panel"。
180
+ * 書き込み前確認 widget。SoT: blueprint §10.4、
181
+ * doc/specs/widget-and-config-mcp.md「Widget schema v1 / Confirmation Panel」。
182
+ */
183
+
184
+ type ConfirmationRisk = "low" | "medium" | "high";
185
+ interface ConfirmationChange {
186
+ field: string;
187
+ before?: string;
188
+ after?: string;
189
+ }
190
+ interface ConfirmationPanelData {
191
+ title: string;
192
+ action: string;
193
+ requiresConfirmation: boolean;
194
+ summary?: string;
195
+ risk?: ConfirmationRisk;
196
+ changes?: ConfirmationChange[];
197
+ }
198
+ declare const CONFIRMATION_PANEL_SCHEMA: SchemaObject;
199
+
200
+ type WidgetTone = "neutral" | "success" | "warning" | "danger";
201
+ interface WidgetBadge {
202
+ label: string;
203
+ tone: WidgetTone;
204
+ }
205
+ type WidgetScalar = string | number | boolean;
206
+
207
+ /** Detail Card data contract (#452)。meaning keyをfieldsのproperty名としてredaction可能にする。 */
208
+
209
+ interface DetailCardData {
210
+ title: string;
211
+ subtitle?: string;
212
+ description?: string;
213
+ fields: Record<string, WidgetScalar>;
214
+ fieldLabels?: Record<string, string>;
215
+ status?: WidgetBadge;
216
+ }
217
+ declare const DETAIL_CARD_SCHEMA: SchemaObject;
218
+
219
+ /**
220
+ * Insight List widget の data 型と JSON Schema (#85)。template = "insight_list"。
221
+ * SoT: blueprint §10.4、doc/specs/widget-and-config-mcp.md「Widget schema v1 / Insight List」。
222
+ */
223
+
224
+ type InsightSeverity = "info" | "warning" | "critical";
225
+ interface Insight {
226
+ severity: InsightSeverity;
227
+ message: string;
228
+ recommendation?: string;
229
+ }
230
+ interface InsightListData {
231
+ title?: string;
232
+ insights: Insight[];
233
+ }
234
+ declare const INSIGHT_LIST_SCHEMA: SchemaObject;
235
+
236
+ /**
237
+ * KPI Cards widget の data 型と JSON Schema (#82)。template = "kpi_cards"。
238
+ * SoT: blueprint §10.4、doc/specs/widget-and-config-mcp.md「Widget schema v1 / KPI Cards」。
239
+ */
240
+
241
+ type KpiDirection = "up" | "down" | "flat";
242
+ interface KpiDelta {
243
+ value: number;
244
+ direction: KpiDirection;
245
+ }
246
+ interface KpiCard {
247
+ label: string;
248
+ value: string | number;
249
+ unit?: string;
250
+ delta?: KpiDelta;
251
+ caption?: string;
252
+ }
253
+ interface KpiCardsData {
254
+ title?: string;
255
+ cards: KpiCard[];
256
+ }
257
+ declare const KPI_CARDS_SCHEMA: SchemaObject;
258
+
259
+ /**
260
+ * Ranking Table widget の data 型と JSON Schema (#83)。template = "ranking_table"。
261
+ * SoT: blueprint §10.4、doc/specs/widget-and-config-mcp.md「Widget schema v1 / Ranking Table」。
262
+ */
263
+
264
+ interface RankingColumn {
265
+ key: string;
266
+ label: string;
267
+ }
268
+ interface RankingRow {
269
+ rank?: number;
270
+ cells: Record<string, string | number>;
271
+ }
272
+ interface RankingTableData {
273
+ title?: string;
274
+ columns: RankingColumn[];
275
+ rows: RankingRow[];
276
+ }
277
+ declare const RANKING_TABLE_SCHEMA: SchemaObject;
278
+
279
+ /** Search Result Cards data contract (#452)。bounded card listとmeaning-key attributesを固定する。 */
280
+
281
+ interface SearchResultCard {
282
+ id: string;
283
+ title: string;
284
+ summary?: string;
285
+ attributes?: Record<string, WidgetScalar>;
286
+ attributeLabels?: Record<string, string>;
287
+ badge?: WidgetBadge;
288
+ }
289
+ interface SearchResultCardsData {
290
+ title?: string;
291
+ query?: string;
292
+ results: SearchResultCard[];
293
+ }
294
+ declare const SEARCH_RESULT_CARDS_SCHEMA: SchemaObject;
295
+
296
+ /** Setup Draft Review data contract (#452)。表示専用かつhuman confirmation必須。 */
297
+
298
+ type SetupDraftStatus = "draft" | "ready_for_review" | "blocked";
299
+ interface SetupDraftChange {
300
+ field: string;
301
+ before?: string;
302
+ after?: string;
303
+ }
304
+ interface SetupDraftSection {
305
+ title: string;
306
+ changes: SetupDraftChange[];
307
+ }
308
+ interface SetupDraftReviewData {
309
+ title: string;
310
+ action: string;
311
+ requiresConfirmation: true;
312
+ sections: SetupDraftSection[];
313
+ summary?: string;
314
+ status?: SetupDraftStatus;
315
+ warnings?: string[];
316
+ }
317
+ declare const SETUP_DRAFT_REVIEW_SCHEMA: SchemaObject;
318
+
319
+ /**
320
+ * Trend Chart widget の data 型と JSON Schema (#84)。template = "trend_chart"。
321
+ * SoT: blueprint §10.4、doc/specs/widget-and-config-mcp.md「Widget schema v1 / Trend Chart」。
322
+ */
323
+
324
+ interface TrendPoint {
325
+ x: string;
326
+ y: number;
327
+ }
328
+ interface TrendSeries {
329
+ name: string;
330
+ points: TrendPoint[];
331
+ }
332
+ interface TrendChartData {
333
+ title?: string;
334
+ unit?: string;
335
+ series: TrendSeries[];
336
+ }
337
+ declare const TREND_CHART_SCHEMA: SchemaObject;
338
+
339
+ /**
340
+ * Widget response builder (#87)。
341
+ *
342
+ * SoT §10.4 の pipeline 順序で三層 envelope を組み立てる:
343
+ * validate (data schema) -> redact (PII) -> map (textFallback 生成) -> generate (envelope)。
344
+ *
345
+ * textFallback 必須を型 (WidgetEnvelope.textFallback: string) と実行時 (非空 assert +
346
+ * envelope schema 検証) の二重で保証する。検証失敗時は WidgetSchemaError を throw する。
347
+ */
348
+
349
+ /** Widget build / 検証の失敗を表す error。 */
350
+ declare class WidgetSchemaError extends Error {
351
+ readonly template: string;
352
+ readonly issues: string[];
353
+ constructor(template: unknown, message: string, issues?: string[]);
354
+ }
355
+ interface BuildWidgetInput<T> {
356
+ template: WidgetTemplate;
357
+ /** RAW (redaction 前) の widget data。 */
358
+ data: T;
359
+ /** 除去する PII key。既定は DEFAULT_FORBIDDEN_PII。 */
360
+ forbidden?: readonly string[];
361
+ /** envelope に載せる schema version。既定は WIDGET_SCHEMA_VERSION。 */
362
+ version?: string;
363
+ /** textFallback の標準見出し・確認文 locale。既定は ja。 */
364
+ locale?: SupportedLocale;
365
+ }
366
+ interface BuildWidgetResult<T> {
367
+ envelope: WidgetEnvelope<T>;
368
+ redactions: RedactionRecord[];
369
+ }
370
+ type BuildOptions<T> = Omit<BuildWidgetInput<T>, "template" | "data">;
371
+ /**
372
+ * widget data を三層 envelope に変換する。
373
+ * data は redaction 前の RAW を渡す。redaction 済みデータだけが envelope に載る。
374
+ */
375
+ declare function buildWidgetResponse<T = unknown>(input: BuildWidgetInput<T>): BuildWidgetResult<T>;
376
+ /** KPI Cards の envelope を組み立てる。 */
377
+ declare function buildKpiCards(data: KpiCardsData, options?: BuildOptions<KpiCardsData>): BuildWidgetResult<KpiCardsData>;
378
+ /** Ranking Table の envelope を組み立てる。 */
379
+ declare function buildRankingTable(data: RankingTableData, options?: BuildOptions<RankingTableData>): BuildWidgetResult<RankingTableData>;
380
+ /** Trend Chart の envelope を組み立てる。 */
381
+ declare function buildTrendChart(data: TrendChartData, options?: BuildOptions<TrendChartData>): BuildWidgetResult<TrendChartData>;
382
+ /** Insight List の envelope を組み立てる。 */
383
+ declare function buildInsightList(data: InsightListData, options?: BuildOptions<InsightListData>): BuildWidgetResult<InsightListData>;
384
+ /** Confirmation Panel の envelope を組み立てる。 */
385
+ declare function buildConfirmationPanel(data: ConfirmationPanelData, options?: BuildOptions<ConfirmationPanelData>): BuildWidgetResult<ConfirmationPanelData>;
386
+ /** Detail Card の envelope を組み立てる。 */
387
+ declare function buildDetailCard(data: DetailCardData, options?: BuildOptions<DetailCardData>): BuildWidgetResult<DetailCardData>;
388
+ /** Search Result Cards の envelope を組み立てる。 */
389
+ declare function buildSearchResultCards(data: SearchResultCardsData, options?: BuildOptions<SearchResultCardsData>): BuildWidgetResult<SearchResultCardsData>;
390
+ /** Setup Draft Review の envelope を組み立てる。 */
391
+ declare function buildSetupDraftReview(data: SetupDraftReviewData, options?: BuildOptions<SetupDraftReviewData>): BuildWidgetResult<SetupDraftReviewData>;
392
+
393
+ /**
394
+ * Confirmation Panel の textFallback 生成 (#86)。書き込み前確認を Markdown で提示する。
395
+ */
396
+
397
+ /** Confirmation Panel data から非空 Markdown fallback を生成する。 */
398
+ declare function confirmationPanelFallback(data: ConfirmationPanelData, locale?: SupportedLocale): string;
399
+
400
+ /** Detail Cardを非Widget hostでも同じ情報量で読めるMarkdownへ変換する。 */
401
+ declare function detailCardFallback(data: DetailCardData, locale?: SupportedLocale): string;
402
+
403
+ /**
404
+ * Insight List の textFallback 生成 (#85)。
405
+ */
406
+
407
+ /** Insight List data から非空 Markdown fallback を生成する。 */
408
+ declare function insightListFallback(data: InsightListData, locale?: SupportedLocale): string;
409
+
410
+ /**
411
+ * KPI Cards の textFallback 生成 (#82)。redaction 後の data から非空 Markdown を返す。
412
+ */
413
+
414
+ /** KPI Cards data から非空 Markdown fallback を生成する。 */
415
+ declare function kpiCardsFallback(data: KpiCardsData, locale?: SupportedLocale): string;
416
+
417
+ /**
418
+ * Ranking Table の textFallback 生成 (#83)。Markdown table に degrade する。
419
+ */
420
+
421
+ /** Ranking Table data から非空 Markdown fallback を生成する。 */
422
+ declare function rankingTableFallback(data: RankingTableData, locale?: SupportedLocale): string;
423
+
424
+ /** Search Result Cardsを順序と属性を保ったMarkdownへ変換する。 */
425
+ declare function searchResultCardsFallback(data: SearchResultCardsData, locale?: SupportedLocale): string;
426
+
427
+ /** Setup Draft Reviewの差分と確認gateをMarkdownでも維持する。 */
428
+ declare function setupDraftReviewFallback(data: SetupDraftReviewData, locale?: SupportedLocale): string;
429
+
430
+ /**
431
+ * Trend Chart の textFallback 生成 (#84)。series ごとの値表に degrade する。
432
+ */
433
+
434
+ /** Trend Chart data から非空 Markdown fallback を生成する。 */
435
+ declare function trendChartFallback(data: TrendChartData, locale?: SupportedLocale): string;
436
+
437
+ /**
438
+ * Widget payload から除去する PII / secret カテゴリの既定集合 (#88 / #178)。
439
+ * Tool Contract の pii_policy.forbidden と概念整合 (phone / email / real_name / address / payment_info)。
440
+ * token / secret は PII ではないが、AI host へ返す widget envelope に載せてはいけないため既定除去する。
441
+ * SoT: blueprint §10.4 redaction、doc/security/tool-safety-privacy.md。
442
+ */
443
+ /** 既定の forbidden PII key。利用側は build 時に追加 key を合流できる。 */
444
+ declare const DEFAULT_FORBIDDEN_PII: readonly ["phone", "email", "real_name", "address", "payment_info", "token", "access_token", "refresh_token", "id_token", "session_token", "secret", "client_secret", "api_key", "authorization", "password", "private_key"];
445
+
446
+ /**
447
+ * Widget template registry (#87)。template -> { schema, fallback } を引く。
448
+ * builder と widget-data 検証が共有する。fallback は redaction + validate 済みの
449
+ * data を受ける前提で具体型へ絞り込む。
450
+ */
451
+
452
+ interface WidgetTemplateEntry {
453
+ schema: SchemaObject;
454
+ /** redaction + validate 済みの data から textFallback を生成する。 */
455
+ fallback: (data: unknown, locale?: SupportedLocale) => string;
456
+ }
457
+ declare const WIDGET_REGISTRY: Readonly<Record<WidgetTemplate, WidgetTemplateEntry>>;
458
+ /** unknown な template 入力を、prototype chain を踏まず既知 template entry に解決する。 */
459
+ declare function getWidgetTemplateEntry(template: unknown): WidgetTemplateEntry | undefined;
460
+
461
+ /**
462
+ * Widget envelope の JSON Schema 検証 (#81)。
463
+ * built envelope を {@link WIDGET_ENVELOPE_V1_SCHEMA} に照合し、違反を path 付きで報告する。
464
+ * fallback 必須 (textFallback.minLength / content.minItems) は schema 側で担保する。
465
+ */
466
+ interface WidgetValidationError {
467
+ path: string;
468
+ message: string;
469
+ }
470
+ interface WidgetValidationResult {
471
+ ok: boolean;
472
+ errors: WidgetValidationError[];
473
+ }
474
+ /** value が Widget envelope v1 に適合するか検証する。 */
475
+ declare function validateWidgetEnvelope(value: unknown): WidgetValidationResult;
476
+
477
+ /**
478
+ * Widget data の JSON Schema 検証 (#82-86)。
479
+ * template ごとの schema に data を照合する。validator は template 単位で cache する。
480
+ */
481
+
482
+ /** template の data schema に value が適合するか検証する。 */
483
+ declare function validateWidgetData(template: unknown, value: unknown): WidgetValidationResult;
484
+
485
+ /**
486
+ * @andpipes/widget-sdk — Widget schema v1 と fallback SDK (GitHub Issue #20、サブ #81–#90)。
487
+ *
488
+ * structuredContent / widgetTemplate / textFallback の三層出力を型と helper で固定し、
489
+ * redaction 済み payload だけを返す builder を提供する。
490
+ * SoT: doc/origin/andpipe_implementation_blueprint.md §10.4、doc/specs/widget-and-config-mcp.md。
491
+ */
492
+ declare const packageName: "@andpipes/widget-sdk";
493
+
494
+ export { ADVANCED_WIDGET_TEMPLATES, type AdvancedWidgetTemplate, type BuildWidgetInput, type BuildWidgetResult, CONFIRMATION_PANEL_SCHEMA, type ConfirmationChange, type ConfirmationPanelData, type ConfirmationRisk, DEFAULT_FORBIDDEN_PII, DETAIL_CARD_SCHEMA, type DetailCardData, INSIGHT_LIST_SCHEMA, type Insight, type InsightListData, type InsightSeverity, KPI_CARDS_SCHEMA, type KpiCard, type KpiCardsData, type KpiDelta, type KpiDirection, LEGACY_WIDGET_TEMPLATES, type LegacyWidgetTemplate, RANKING_TABLE_SCHEMA, type RankingColumn, type RankingRow, type RankingTableData, type RedactOptions, type RedactResult, type RedactionRecord, SEARCH_RESULT_CARDS_SCHEMA, SEMVER_PATTERN, SETUP_DRAFT_REVIEW_SCHEMA, type SearchResultCard, type SearchResultCardsData, type SetupDraftChange, type SetupDraftReviewData, type SetupDraftSection, type SetupDraftStatus, TREND_CHART_SCHEMA, type TrendChartData, type TrendPoint, type TrendSeries, WIDGET_ENVELOPE_V1_SCHEMA, WIDGET_REGISTRY, WIDGET_SCHEMA_LEGACY_VERSION, WIDGET_SCHEMA_VERSION, WIDGET_SCHEMA_VERSIONS, WIDGET_TEMPLATES, type WidgetBadge, type WidgetContentBlock, type WidgetEnvelope, type WidgetEnvelopeV1Schema, type WidgetMeta, type WidgetScalar, WidgetSchemaError, type WidgetSchemaVersion, type WidgetTemplate, type WidgetTemplateEntry, type WidgetTone, type WidgetValidationError, type WidgetValidationResult, buildConfirmationPanel, buildDetailCard, buildInsightList, buildKpiCards, buildRankingTable, buildSearchResultCards, buildSetupDraftReview, buildTrendChart, buildWidgetResponse, confirmationPanelFallback, detailCardFallback, getWidgetTemplateEntry, insightListFallback, isAdvancedWidgetTemplate, isWidgetSchemaVersion, isWidgetTemplate, isWidgetTemplateSupportedAtVersion, kpiCardsFallback, packageName, rankingTableFallback, redactWidgetPayload, searchResultCardsFallback, setupDraftReviewFallback, trendChartFallback, validateWidgetData, validateWidgetEnvelope };