@bbigbang/protocol 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.
- package/dist/agentSurface.d.ts +5 -0
- package/dist/agentSurface.js +11 -0
- package/dist/handoff.d.ts +45 -0
- package/dist/handoff.js +6 -0
- package/dist/index.d.ts +3685 -0
- package/dist/index.js +398 -0
- package/dist/panel.d.ts +823 -0
- package/dist/panel.js +2116 -0
- package/package.json +31 -0
package/dist/panel.d.ts
ADDED
|
@@ -0,0 +1,823 @@
|
|
|
1
|
+
export type Panel = {
|
|
2
|
+
id: string;
|
|
3
|
+
agentId: string;
|
|
4
|
+
conversationId: string;
|
|
5
|
+
ownerUserId?: string;
|
|
6
|
+
handle?: string | null;
|
|
7
|
+
scopeType: 'direct' | 'channel' | 'thread' | 'tool';
|
|
8
|
+
scopeId?: string;
|
|
9
|
+
toolId?: string;
|
|
10
|
+
surfaceProfile?: PanelSurfaceProfile;
|
|
11
|
+
surfaceFeatures?: PanelSurfaceFeatures;
|
|
12
|
+
component: string;
|
|
13
|
+
props?: Record<string, unknown>;
|
|
14
|
+
actions?: PanelAction[];
|
|
15
|
+
rowCount?: number;
|
|
16
|
+
rowCountKnown?: boolean;
|
|
17
|
+
datasetSource?: PanelDatasetSource;
|
|
18
|
+
status: PanelStatus;
|
|
19
|
+
progress?: Record<string, unknown> | null;
|
|
20
|
+
result?: Record<string, unknown> | null;
|
|
21
|
+
version: number;
|
|
22
|
+
createdByRunId?: string;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
archivedAt?: string | null;
|
|
26
|
+
};
|
|
27
|
+
export type PanelSurfaceProfile = 'panel' | 'tool';
|
|
28
|
+
export type PanelSurfaceFeatures = {
|
|
29
|
+
browseControls?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export type PanelRow = {
|
|
32
|
+
panelId: string;
|
|
33
|
+
rowIndex: number;
|
|
34
|
+
rowId?: string | null;
|
|
35
|
+
fields: Record<string, unknown>;
|
|
36
|
+
media: Record<string, {
|
|
37
|
+
kind: 'workspace_path' | 'asset';
|
|
38
|
+
value: string;
|
|
39
|
+
}>;
|
|
40
|
+
nodeId?: string;
|
|
41
|
+
cachedAssetIds?: Record<string, string>;
|
|
42
|
+
};
|
|
43
|
+
export type PanelState = {
|
|
44
|
+
panelId: string;
|
|
45
|
+
userId: string;
|
|
46
|
+
state: Record<string, unknown>;
|
|
47
|
+
updatedAt: string;
|
|
48
|
+
};
|
|
49
|
+
export type PanelActionMode = 'notify_agent' | 'platform_exec';
|
|
50
|
+
export type PanelActionToolKind = 'start' | 'stop' | 'status' | 'restart' | 'custom';
|
|
51
|
+
export type PanelActionParamInput = 'text' | 'number' | 'checkbox' | 'select';
|
|
52
|
+
export type PanelActionParamField = {
|
|
53
|
+
name: string;
|
|
54
|
+
label?: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
input?: PanelActionParamInput;
|
|
57
|
+
required?: boolean;
|
|
58
|
+
placeholder?: string;
|
|
59
|
+
defaultValue?: unknown;
|
|
60
|
+
min?: number;
|
|
61
|
+
max?: number;
|
|
62
|
+
options?: Array<{
|
|
63
|
+
label: string;
|
|
64
|
+
value: string;
|
|
65
|
+
}>;
|
|
66
|
+
};
|
|
67
|
+
export type PanelAction = {
|
|
68
|
+
id: string;
|
|
69
|
+
label: string;
|
|
70
|
+
mode?: PanelActionMode;
|
|
71
|
+
/**
|
|
72
|
+
* Promotion hint for panel-to-tool upgrades. Ignored by ordinary panel action execution.
|
|
73
|
+
* When present, direct promotion maps this to the Workspace Tool action kind.
|
|
74
|
+
*/
|
|
75
|
+
toolKind?: PanelActionToolKind;
|
|
76
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
77
|
+
description?: string;
|
|
78
|
+
command?: string;
|
|
79
|
+
cwd?: string;
|
|
80
|
+
/** Promotion hint copied to Workspace Tool action manifests. */
|
|
81
|
+
persistent?: boolean;
|
|
82
|
+
/** Promotion hint copied to persistent Workspace Tool start/restart actions. */
|
|
83
|
+
maxRunSeconds?: number;
|
|
84
|
+
/** Promotion hint copied to persistent Workspace Tool start/restart actions. */
|
|
85
|
+
idleTimeoutSeconds?: number;
|
|
86
|
+
/** Promotion hint copied to Workspace Tool action manifests. Not used by ordinary panel action execution. */
|
|
87
|
+
paramsSchema?: PanelActionParamField[];
|
|
88
|
+
/** @deprecated Use command. Retained for legacy stored panels. */
|
|
89
|
+
rpcCommand?: string;
|
|
90
|
+
/** @deprecated Use cwd. Retained for legacy stored panels. */
|
|
91
|
+
rpcCwd?: string;
|
|
92
|
+
};
|
|
93
|
+
export type PanelBadgeValueMapEntry = {
|
|
94
|
+
value: string | number | boolean | null;
|
|
95
|
+
label?: string;
|
|
96
|
+
variant?: 'default' | 'success' | 'warning' | 'danger';
|
|
97
|
+
};
|
|
98
|
+
export type PanelFormFieldOption = {
|
|
99
|
+
value: string | number | boolean;
|
|
100
|
+
label?: string;
|
|
101
|
+
};
|
|
102
|
+
export type PanelUploadedFileRef = {
|
|
103
|
+
assetId: string;
|
|
104
|
+
attachmentId?: string;
|
|
105
|
+
filename: string;
|
|
106
|
+
sizeBytes: number;
|
|
107
|
+
kind?: string;
|
|
108
|
+
scopeType?: string;
|
|
109
|
+
scopeId?: string;
|
|
110
|
+
};
|
|
111
|
+
export declare const DEFAULT_PANEL_PAGE_SIZE = 10;
|
|
112
|
+
export declare const MIN_PANEL_PAGE_SIZE = 1;
|
|
113
|
+
export declare const MAX_PANEL_PAGE_SIZE = 50;
|
|
114
|
+
export declare const MIN_PANEL_REFRESH_INTERVAL_MS = 1000;
|
|
115
|
+
export declare const MAX_PANEL_REFRESH_INTERVAL_MS = 60000;
|
|
116
|
+
export type ImageReviewGridProps = {
|
|
117
|
+
title?: string;
|
|
118
|
+
showScore?: boolean;
|
|
119
|
+
pageSize?: number;
|
|
120
|
+
refreshIntervalMs?: number;
|
|
121
|
+
};
|
|
122
|
+
export type PanelStatus = 'idle' | 'running' | 'completed' | 'failed';
|
|
123
|
+
export type PanelInputRow = {
|
|
124
|
+
rowId?: string;
|
|
125
|
+
fields: Record<string, unknown>;
|
|
126
|
+
media?: Record<string, {
|
|
127
|
+
kind: 'workspace_path' | 'asset';
|
|
128
|
+
value: string;
|
|
129
|
+
}>;
|
|
130
|
+
};
|
|
131
|
+
export type PanelPatchInput = {
|
|
132
|
+
panelId: string;
|
|
133
|
+
expectedVersion?: number;
|
|
134
|
+
props_patch?: Record<string, unknown>;
|
|
135
|
+
actions?: PanelAction[];
|
|
136
|
+
rows?: {
|
|
137
|
+
append?: PanelInputRow[];
|
|
138
|
+
upsert?: PanelInputRow[];
|
|
139
|
+
remove_row_ids?: string[];
|
|
140
|
+
};
|
|
141
|
+
status?: PanelStatus;
|
|
142
|
+
progress?: Record<string, unknown> | null;
|
|
143
|
+
result?: Record<string, unknown> | null;
|
|
144
|
+
};
|
|
145
|
+
export declare const INLINE_ROWS_MAX = 1000;
|
|
146
|
+
export type PanelApiJsonlDatasetSource = {
|
|
147
|
+
kind: 'api_jsonl';
|
|
148
|
+
url: string;
|
|
149
|
+
urls?: never;
|
|
150
|
+
auth?: PanelApiJsonlAuthProfile;
|
|
151
|
+
} | {
|
|
152
|
+
kind: 'api_jsonl';
|
|
153
|
+
urls: string[];
|
|
154
|
+
url?: never;
|
|
155
|
+
auth?: PanelApiJsonlAuthProfile;
|
|
156
|
+
};
|
|
157
|
+
export type PanelApiJsonlAuthProfile = {
|
|
158
|
+
profile: string;
|
|
159
|
+
};
|
|
160
|
+
export type PanelDatasetSource = {
|
|
161
|
+
kind: 'workspace_jsonl';
|
|
162
|
+
path: string;
|
|
163
|
+
} | {
|
|
164
|
+
kind: 'inline_rows';
|
|
165
|
+
rows: PanelInputRow[];
|
|
166
|
+
} | {
|
|
167
|
+
kind: 'attachment_manifest';
|
|
168
|
+
attachmentId?: string;
|
|
169
|
+
assetId?: string;
|
|
170
|
+
} | {
|
|
171
|
+
kind: 'query_handle';
|
|
172
|
+
handle: string;
|
|
173
|
+
} | PanelApiJsonlDatasetSource;
|
|
174
|
+
export declare const PANEL_API_JSONL_MAX_URLS = 16;
|
|
175
|
+
export declare const PANEL_MEDIA_FETCH_CONCURRENCY = 6;
|
|
176
|
+
export declare const PANEL_MEDIA_REMOTE_FETCH_TIMEOUT_MS = 10000;
|
|
177
|
+
export declare const PANEL_IMAGE_MEDIA_MAX_BYTES: number;
|
|
178
|
+
export declare const PANEL_TEXT_MEDIA_MAX_BYTES: number;
|
|
179
|
+
export type PanelApiJsonlUrlValidationResult = {
|
|
180
|
+
ok: true;
|
|
181
|
+
url: string;
|
|
182
|
+
origin: string;
|
|
183
|
+
defaultLoopback: boolean;
|
|
184
|
+
matchedAllowedPrefix: string | null;
|
|
185
|
+
} | {
|
|
186
|
+
ok: false;
|
|
187
|
+
reason: string;
|
|
188
|
+
};
|
|
189
|
+
export type PanelApiJsonlUrlListValidationResult = {
|
|
190
|
+
ok: true;
|
|
191
|
+
urls: string[];
|
|
192
|
+
authProfile: string | null;
|
|
193
|
+
} | {
|
|
194
|
+
ok: false;
|
|
195
|
+
reason: string;
|
|
196
|
+
missingField?: string;
|
|
197
|
+
};
|
|
198
|
+
export declare function normalizePanelApiJsonlAuthProfileName(rawProfile: string): string | null;
|
|
199
|
+
export declare function normalizePanelApiJsonlAuthProfileNames(rawProfiles: string | readonly string[] | null | undefined): string[];
|
|
200
|
+
export declare function validatePanelApiJsonlAuthProfile(rawAuth: unknown, options?: {
|
|
201
|
+
allowedAuthProfiles?: readonly string[];
|
|
202
|
+
}): {
|
|
203
|
+
ok: true;
|
|
204
|
+
authProfile: string | null;
|
|
205
|
+
} | {
|
|
206
|
+
ok: false;
|
|
207
|
+
reason: string;
|
|
208
|
+
};
|
|
209
|
+
export declare function normalizePanelApiJsonlAllowedOrigin(rawOrigin: string): string | null;
|
|
210
|
+
export declare function normalizePanelApiJsonlAllowedOrigins(rawOrigins: string | readonly string[] | null | undefined): string[];
|
|
211
|
+
export declare function normalizePanelApiJsonlAllowedUrlPrefix(rawPrefix: string): string | null;
|
|
212
|
+
export declare function normalizePanelApiJsonlAllowedUrlPrefixes(rawPrefixes: string | readonly string[] | null | undefined): string[];
|
|
213
|
+
export declare function matchPanelApiJsonlAllowedUrlPrefix(parsed: URL, rawPrefixes: string | readonly string[] | null | undefined): string | null;
|
|
214
|
+
export declare function isPanelApiJsonlDefaultLoopbackUrl(parsed: URL): boolean;
|
|
215
|
+
export declare function validatePanelApiJsonlUrl(rawUrl: string, options?: {
|
|
216
|
+
allowedOrigins?: readonly string[];
|
|
217
|
+
allowedUrlPrefixes?: readonly string[];
|
|
218
|
+
}): PanelApiJsonlUrlValidationResult;
|
|
219
|
+
export declare function validatePanelApiJsonlUrlList(source: {
|
|
220
|
+
url?: unknown;
|
|
221
|
+
urls?: unknown;
|
|
222
|
+
}, options?: {
|
|
223
|
+
allowedOrigins?: readonly string[];
|
|
224
|
+
allowedUrlPrefixes?: readonly string[];
|
|
225
|
+
allowedAuthProfiles?: readonly string[];
|
|
226
|
+
}): PanelApiJsonlUrlListValidationResult;
|
|
227
|
+
export type PanelDatasetInput = {
|
|
228
|
+
source: PanelDatasetSource;
|
|
229
|
+
rows?: never;
|
|
230
|
+
} | {
|
|
231
|
+
rows: string;
|
|
232
|
+
source?: never;
|
|
233
|
+
};
|
|
234
|
+
export type PanelSubmitKind = 'action' | 'form' | 'apply' | 'done';
|
|
235
|
+
export type PanelSubmitScope = {
|
|
236
|
+
type: 'direct';
|
|
237
|
+
conversationId: string;
|
|
238
|
+
} | {
|
|
239
|
+
type: 'channel';
|
|
240
|
+
conversationId: string;
|
|
241
|
+
channelId: string;
|
|
242
|
+
} | {
|
|
243
|
+
type: 'thread';
|
|
244
|
+
conversationId: string;
|
|
245
|
+
channelId: string;
|
|
246
|
+
threadRootId: string;
|
|
247
|
+
};
|
|
248
|
+
type PanelSubmitPayloadBase = {
|
|
249
|
+
panelId: string;
|
|
250
|
+
actor: {
|
|
251
|
+
userId: string;
|
|
252
|
+
username: string;
|
|
253
|
+
};
|
|
254
|
+
scope: PanelSubmitScope;
|
|
255
|
+
baseVersion: number;
|
|
256
|
+
submittedVersion: number;
|
|
257
|
+
concurrency?: {
|
|
258
|
+
staleBase: boolean;
|
|
259
|
+
latestVersion?: number;
|
|
260
|
+
};
|
|
261
|
+
viewState: {
|
|
262
|
+
filters?: Record<string, unknown>;
|
|
263
|
+
sort?: Record<string, unknown>;
|
|
264
|
+
activeTab?: string;
|
|
265
|
+
};
|
|
266
|
+
refs: {
|
|
267
|
+
selectedRowIndices?: number[];
|
|
268
|
+
selectedRowIds?: string[];
|
|
269
|
+
changedRowIndices?: number[];
|
|
270
|
+
changedRowIds?: string[];
|
|
271
|
+
};
|
|
272
|
+
delta: {
|
|
273
|
+
shared?: Record<string, unknown>;
|
|
274
|
+
perUser?: Record<string, unknown>;
|
|
275
|
+
form?: Record<string, {
|
|
276
|
+
from?: unknown;
|
|
277
|
+
to: unknown;
|
|
278
|
+
}>;
|
|
279
|
+
};
|
|
280
|
+
summary: {
|
|
281
|
+
selectedCount?: number;
|
|
282
|
+
changedFieldCount?: number;
|
|
283
|
+
truncated?: boolean;
|
|
284
|
+
};
|
|
285
|
+
preview?: {
|
|
286
|
+
rows?: Array<{
|
|
287
|
+
rowIndex: number;
|
|
288
|
+
fields: Record<string, unknown>;
|
|
289
|
+
}>;
|
|
290
|
+
};
|
|
291
|
+
metadata?: Record<string, unknown>;
|
|
292
|
+
};
|
|
293
|
+
export type PanelSubmitPayload = (PanelSubmitPayloadBase & {
|
|
294
|
+
submitKind: 'action';
|
|
295
|
+
actionId: string;
|
|
296
|
+
}) | (PanelSubmitPayloadBase & {
|
|
297
|
+
submitKind: Exclude<PanelSubmitKind, 'action'>;
|
|
298
|
+
actionId?: never;
|
|
299
|
+
});
|
|
300
|
+
export type DataModelKind = 'inline' | 'paged_rows';
|
|
301
|
+
export type DatasetFieldSchema = {
|
|
302
|
+
name: string;
|
|
303
|
+
label?: string;
|
|
304
|
+
type: 'string' | 'number' | 'boolean';
|
|
305
|
+
filterable?: boolean;
|
|
306
|
+
sortable?: boolean;
|
|
307
|
+
};
|
|
308
|
+
export type DatasetMediaSlotSchema = {
|
|
309
|
+
name: string;
|
|
310
|
+
kind: 'workspace_path' | 'asset';
|
|
311
|
+
displayType: 'img' | 'latex' | 'text';
|
|
312
|
+
};
|
|
313
|
+
export type DatasetSchema = {
|
|
314
|
+
fields: DatasetFieldSchema[];
|
|
315
|
+
mediaSlots: DatasetMediaSlotSchema[];
|
|
316
|
+
};
|
|
317
|
+
export type PanelTemplateGap = 'none' | 'sm' | 'md' | 'lg';
|
|
318
|
+
export type PanelVisibilityCondition = {
|
|
319
|
+
field: string;
|
|
320
|
+
op?: 'exists' | 'not_empty' | 'equals' | 'not_equals' | 'in' | 'not_in' | 'contains' | 'truthy' | 'falsy';
|
|
321
|
+
value?: unknown;
|
|
322
|
+
values?: unknown[];
|
|
323
|
+
};
|
|
324
|
+
export type PanelKeyValueTone = 'default' | 'success' | 'warning' | 'danger';
|
|
325
|
+
export type PanelKeyValueItem = {
|
|
326
|
+
label: string;
|
|
327
|
+
field?: string;
|
|
328
|
+
source?: string;
|
|
329
|
+
value?: unknown;
|
|
330
|
+
fallback?: string;
|
|
331
|
+
tone?: PanelKeyValueTone;
|
|
332
|
+
};
|
|
333
|
+
export type PanelTemplateNode = ({
|
|
334
|
+
type: 'Row' | 'Column';
|
|
335
|
+
children: PanelTemplateNode[];
|
|
336
|
+
gap?: PanelTemplateGap;
|
|
337
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
338
|
+
} | {
|
|
339
|
+
type: 'Card';
|
|
340
|
+
children: PanelTemplateNode[];
|
|
341
|
+
title?: string;
|
|
342
|
+
titleField?: string;
|
|
343
|
+
} | {
|
|
344
|
+
type: 'Tabs';
|
|
345
|
+
items: Array<{
|
|
346
|
+
label: string;
|
|
347
|
+
node: PanelTemplateNode;
|
|
348
|
+
}>;
|
|
349
|
+
defaultIndex?: number;
|
|
350
|
+
} | {
|
|
351
|
+
type: 'Stack';
|
|
352
|
+
children: PanelTemplateNode[];
|
|
353
|
+
direction?: 'vertical' | 'horizontal';
|
|
354
|
+
gap?: PanelTemplateGap;
|
|
355
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
356
|
+
wrap?: boolean;
|
|
357
|
+
} | {
|
|
358
|
+
type: 'Inline';
|
|
359
|
+
children: PanelTemplateNode[];
|
|
360
|
+
gap?: PanelTemplateGap;
|
|
361
|
+
align?: 'start' | 'center' | 'end';
|
|
362
|
+
wrap?: boolean;
|
|
363
|
+
} | {
|
|
364
|
+
type: 'Grid';
|
|
365
|
+
children: PanelTemplateNode[];
|
|
366
|
+
minColumnWidth?: number;
|
|
367
|
+
maxColumns?: number;
|
|
368
|
+
gap?: Exclude<PanelTemplateGap, 'none'>;
|
|
369
|
+
} | {
|
|
370
|
+
type: 'KeyValueList';
|
|
371
|
+
items: PanelKeyValueItem[];
|
|
372
|
+
} | {
|
|
373
|
+
type: 'TextField';
|
|
374
|
+
field: string;
|
|
375
|
+
label?: string;
|
|
376
|
+
fallback?: string;
|
|
377
|
+
} | {
|
|
378
|
+
type: 'LatexBlock';
|
|
379
|
+
field: string;
|
|
380
|
+
fallback?: string;
|
|
381
|
+
} | {
|
|
382
|
+
type: 'MarkdownField';
|
|
383
|
+
field: string;
|
|
384
|
+
fallback?: string;
|
|
385
|
+
} | {
|
|
386
|
+
type: 'CodeField';
|
|
387
|
+
field: string;
|
|
388
|
+
language?: string;
|
|
389
|
+
languageField?: string;
|
|
390
|
+
fallback?: string;
|
|
391
|
+
} | {
|
|
392
|
+
type: 'JsonField';
|
|
393
|
+
field: string;
|
|
394
|
+
expanded?: boolean;
|
|
395
|
+
fallback?: string;
|
|
396
|
+
} | {
|
|
397
|
+
type: 'DiffField';
|
|
398
|
+
leftField: string;
|
|
399
|
+
rightField: string;
|
|
400
|
+
mode?: 'line' | 'char';
|
|
401
|
+
title?: string;
|
|
402
|
+
} | {
|
|
403
|
+
type: 'Badge';
|
|
404
|
+
field: string;
|
|
405
|
+
label?: string;
|
|
406
|
+
variant?: 'default' | 'success' | 'warning' | 'danger';
|
|
407
|
+
valueMap?: PanelBadgeValueMapEntry[];
|
|
408
|
+
fallback?: string;
|
|
409
|
+
} | {
|
|
410
|
+
type: 'ComputedValue';
|
|
411
|
+
op: 'sum' | 'difference' | 'product' | 'ratio' | 'percent' | 'average' | 'weighted_sum' | 'concat';
|
|
412
|
+
fields: string[];
|
|
413
|
+
weights?: number[];
|
|
414
|
+
label?: string;
|
|
415
|
+
precision?: number;
|
|
416
|
+
prefix?: string;
|
|
417
|
+
suffix?: string;
|
|
418
|
+
separator?: string;
|
|
419
|
+
fallback?: string;
|
|
420
|
+
} | {
|
|
421
|
+
type: 'ImageSlot';
|
|
422
|
+
slot: string;
|
|
423
|
+
labelField?: string;
|
|
424
|
+
annotationsField?: string;
|
|
425
|
+
editable?: boolean;
|
|
426
|
+
newAnnotationLabel?: string;
|
|
427
|
+
shortcutLabels?: PanelAnnotationShortcut[];
|
|
428
|
+
} | {
|
|
429
|
+
type: 'MediaBlock';
|
|
430
|
+
slot: string;
|
|
431
|
+
labelField?: string;
|
|
432
|
+
displayType?: 'img' | 'text' | 'latex';
|
|
433
|
+
maxLines?: number;
|
|
434
|
+
annotationsField?: string;
|
|
435
|
+
editable?: boolean;
|
|
436
|
+
newAnnotationLabel?: string;
|
|
437
|
+
shortcutLabels?: PanelAnnotationShortcut[];
|
|
438
|
+
} | {
|
|
439
|
+
type: 'Checkbox';
|
|
440
|
+
label?: string;
|
|
441
|
+
} | {
|
|
442
|
+
type: 'FormField';
|
|
443
|
+
name: string;
|
|
444
|
+
label?: string;
|
|
445
|
+
field?: string;
|
|
446
|
+
input?: 'text' | 'number' | 'checkbox' | 'textarea' | 'select' | 'tags';
|
|
447
|
+
placeholder?: string;
|
|
448
|
+
options?: PanelFormFieldOption[];
|
|
449
|
+
} | {
|
|
450
|
+
type: 'ActionButton';
|
|
451
|
+
actionId: string;
|
|
452
|
+
label?: string;
|
|
453
|
+
help?: string;
|
|
454
|
+
showHelp?: boolean;
|
|
455
|
+
} | {
|
|
456
|
+
type: 'SubmitButton';
|
|
457
|
+
submitKind: Exclude<PanelSubmitKind, 'action'>;
|
|
458
|
+
label?: string;
|
|
459
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
460
|
+
help?: string;
|
|
461
|
+
showHelp?: boolean;
|
|
462
|
+
} | {
|
|
463
|
+
type: 'Sparkline';
|
|
464
|
+
field: string;
|
|
465
|
+
} | {
|
|
466
|
+
type: 'Accordion';
|
|
467
|
+
title: string;
|
|
468
|
+
children: PanelTemplateNode[];
|
|
469
|
+
expanded?: boolean;
|
|
470
|
+
} | {
|
|
471
|
+
type: 'Divider';
|
|
472
|
+
title?: string;
|
|
473
|
+
} | {
|
|
474
|
+
type: 'Callout';
|
|
475
|
+
calloutType: 'info' | 'warning' | 'success' | 'error';
|
|
476
|
+
title?: string;
|
|
477
|
+
content?: string;
|
|
478
|
+
} | {
|
|
479
|
+
type: 'Columns';
|
|
480
|
+
columns: Array<{
|
|
481
|
+
width?: string;
|
|
482
|
+
children: PanelTemplateNode[];
|
|
483
|
+
}>;
|
|
484
|
+
} | {
|
|
485
|
+
type: 'DiffView';
|
|
486
|
+
left: string;
|
|
487
|
+
right: string;
|
|
488
|
+
mode?: 'line' | 'char';
|
|
489
|
+
} | {
|
|
490
|
+
type: 'CodeBlock';
|
|
491
|
+
code: string;
|
|
492
|
+
language?: string;
|
|
493
|
+
} | {
|
|
494
|
+
type: 'JsonView';
|
|
495
|
+
data: unknown;
|
|
496
|
+
expanded?: boolean;
|
|
497
|
+
} | {
|
|
498
|
+
type: 'MarkdownText';
|
|
499
|
+
content: string;
|
|
500
|
+
}) & {
|
|
501
|
+
visibleWhen?: PanelVisibilityCondition;
|
|
502
|
+
};
|
|
503
|
+
export type PanelTemplateContainerNode = Extract<PanelTemplateNode, {
|
|
504
|
+
type: 'Row' | 'Column' | 'Card' | 'Tabs' | 'Accordion' | 'Columns' | 'Stack' | 'Inline' | 'Grid';
|
|
505
|
+
}>;
|
|
506
|
+
export type PanelTemplateNodeWalkContext = {
|
|
507
|
+
parent: PanelTemplateContainerNode | null;
|
|
508
|
+
depth: number;
|
|
509
|
+
index: number | null;
|
|
510
|
+
columnIndex?: number;
|
|
511
|
+
tabIndex?: number;
|
|
512
|
+
};
|
|
513
|
+
export type PanelTemplateNodeVisitor = (node: PanelTemplateNode, context: PanelTemplateNodeWalkContext) => void | false;
|
|
514
|
+
export type PanelTemplateUnsupportedNodePolicy = {
|
|
515
|
+
unsupportedTypes?: ReadonlySet<string> | readonly string[];
|
|
516
|
+
interactiveTypes?: ReadonlySet<string> | readonly string[];
|
|
517
|
+
allowInteractiveTypes?: boolean;
|
|
518
|
+
predicate?: (node: PanelTemplateNode) => boolean;
|
|
519
|
+
};
|
|
520
|
+
export type PanelSummaryDataSource = {
|
|
521
|
+
kind: 'inline';
|
|
522
|
+
data: unknown;
|
|
523
|
+
} | {
|
|
524
|
+
kind: 'panel_result';
|
|
525
|
+
path: string[];
|
|
526
|
+
} | {
|
|
527
|
+
kind: 'panel_progress';
|
|
528
|
+
path: string[];
|
|
529
|
+
};
|
|
530
|
+
export type PanelAnnotation = {
|
|
531
|
+
label: string;
|
|
532
|
+
box: {
|
|
533
|
+
x: number;
|
|
534
|
+
y: number;
|
|
535
|
+
w: number;
|
|
536
|
+
h: number;
|
|
537
|
+
};
|
|
538
|
+
detail?: string;
|
|
539
|
+
color?: string;
|
|
540
|
+
};
|
|
541
|
+
export type PanelAnnotationShortcut = {
|
|
542
|
+
key: string;
|
|
543
|
+
label: string;
|
|
544
|
+
color?: string;
|
|
545
|
+
};
|
|
546
|
+
export type PanelLevelNode = {
|
|
547
|
+
type: 'Section';
|
|
548
|
+
children: PanelLevelNode[];
|
|
549
|
+
} | {
|
|
550
|
+
type: 'ParameterFormSection';
|
|
551
|
+
children: PanelLevelNode[];
|
|
552
|
+
} | {
|
|
553
|
+
type: 'Card';
|
|
554
|
+
children: PanelLevelNode[];
|
|
555
|
+
title?: string;
|
|
556
|
+
} | {
|
|
557
|
+
type: 'Columns';
|
|
558
|
+
columns: Array<{
|
|
559
|
+
width?: string;
|
|
560
|
+
children: PanelLevelNode[];
|
|
561
|
+
}>;
|
|
562
|
+
} | {
|
|
563
|
+
type: 'Stack';
|
|
564
|
+
children: PanelLevelNode[];
|
|
565
|
+
direction?: 'vertical' | 'horizontal';
|
|
566
|
+
gap?: PanelTemplateGap;
|
|
567
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
568
|
+
wrap?: boolean;
|
|
569
|
+
} | {
|
|
570
|
+
type: 'Inline';
|
|
571
|
+
children: PanelLevelNode[];
|
|
572
|
+
gap?: PanelTemplateGap;
|
|
573
|
+
align?: 'start' | 'center' | 'end';
|
|
574
|
+
wrap?: boolean;
|
|
575
|
+
} | {
|
|
576
|
+
type: 'Grid';
|
|
577
|
+
children: PanelLevelNode[];
|
|
578
|
+
minColumnWidth?: number;
|
|
579
|
+
maxColumns?: number;
|
|
580
|
+
gap?: Exclude<PanelTemplateGap, 'none'>;
|
|
581
|
+
} | {
|
|
582
|
+
type: 'KeyValueList';
|
|
583
|
+
items: PanelKeyValueItem[];
|
|
584
|
+
} | {
|
|
585
|
+
type: 'MetricCard';
|
|
586
|
+
props: Record<string, unknown>;
|
|
587
|
+
} | {
|
|
588
|
+
type: 'AggregateValue';
|
|
589
|
+
op: 'count' | 'sum' | 'avg' | 'min' | 'max';
|
|
590
|
+
scope?: 'page' | 'dataset';
|
|
591
|
+
field?: string;
|
|
592
|
+
label?: string;
|
|
593
|
+
precision?: number;
|
|
594
|
+
prefix?: string;
|
|
595
|
+
suffix?: string;
|
|
596
|
+
fallback?: string;
|
|
597
|
+
} | {
|
|
598
|
+
type: 'BarChart' | 'LineChart' | 'PieChart' | 'Histogram';
|
|
599
|
+
props: Record<string, unknown>;
|
|
600
|
+
} | {
|
|
601
|
+
type: 'ProgressBar' | 'StatusBadge' | 'Timeline';
|
|
602
|
+
source?: string;
|
|
603
|
+
label?: string;
|
|
604
|
+
} | {
|
|
605
|
+
type: 'LogBlock';
|
|
606
|
+
source?: string;
|
|
607
|
+
title?: string;
|
|
608
|
+
maxLines?: number;
|
|
609
|
+
emptyText?: string;
|
|
610
|
+
} | {
|
|
611
|
+
type: 'RunStatusCard';
|
|
612
|
+
run?: 'latest' | {
|
|
613
|
+
id: string;
|
|
614
|
+
};
|
|
615
|
+
showTarget?: boolean;
|
|
616
|
+
showRevision?: boolean;
|
|
617
|
+
} | {
|
|
618
|
+
type: 'RunLogViewer';
|
|
619
|
+
run?: 'latest' | {
|
|
620
|
+
id: string;
|
|
621
|
+
};
|
|
622
|
+
maxLines?: number;
|
|
623
|
+
levels?: string[];
|
|
624
|
+
emptyText?: string;
|
|
625
|
+
} | {
|
|
626
|
+
type: 'ArtifactList';
|
|
627
|
+
run?: 'latest' | {
|
|
628
|
+
id: string;
|
|
629
|
+
};
|
|
630
|
+
kinds?: string[];
|
|
631
|
+
emptyText?: string;
|
|
632
|
+
} | {
|
|
633
|
+
type: 'TextInput' | 'TextArea' | 'NumberInput' | 'Checkbox' | 'Select' | 'MultiSelect' | 'TagInput' | 'Slider' | 'DatePicker' | 'FileUpload';
|
|
634
|
+
props: Record<string, unknown>;
|
|
635
|
+
} | {
|
|
636
|
+
type: 'ActionBar';
|
|
637
|
+
actionIds?: string[];
|
|
638
|
+
layout?: 'wrap' | 'stack';
|
|
639
|
+
title?: string;
|
|
640
|
+
showDescriptions?: boolean;
|
|
641
|
+
showHelp?: boolean;
|
|
642
|
+
} | {
|
|
643
|
+
type: 'Button';
|
|
644
|
+
props: Record<string, unknown>;
|
|
645
|
+
};
|
|
646
|
+
export type RowTemplateGridProps = {
|
|
647
|
+
title?: string;
|
|
648
|
+
pageSize?: number;
|
|
649
|
+
refreshIntervalMs?: number;
|
|
650
|
+
fields: DatasetFieldSchema[];
|
|
651
|
+
mediaSlots?: DatasetMediaSlotSchema[];
|
|
652
|
+
summary?: PanelLevelNode;
|
|
653
|
+
parameterForm?: PanelLevelNode;
|
|
654
|
+
template: PanelTemplateNode;
|
|
655
|
+
};
|
|
656
|
+
export type PanelLevelContainerNode = Extract<PanelLevelNode, {
|
|
657
|
+
type: 'Section' | 'ParameterFormSection' | 'Card' | 'Columns' | 'Stack' | 'Inline' | 'Grid';
|
|
658
|
+
}>;
|
|
659
|
+
export type PanelLevelActionBarNode = Extract<PanelLevelNode, {
|
|
660
|
+
type: 'ActionBar';
|
|
661
|
+
}>;
|
|
662
|
+
export type PanelLevelDatasetAggregateNode = Extract<PanelLevelNode, {
|
|
663
|
+
type: 'AggregateValue';
|
|
664
|
+
}>;
|
|
665
|
+
export type PanelLevelParameterInputNode = Extract<PanelLevelNode, {
|
|
666
|
+
type: 'TextInput' | 'TextArea' | 'NumberInput' | 'Checkbox' | 'Select' | 'MultiSelect' | 'TagInput' | 'Slider' | 'DatePicker' | 'FileUpload';
|
|
667
|
+
}>;
|
|
668
|
+
export type PanelLevelNodeWalkContext = {
|
|
669
|
+
parent: PanelLevelContainerNode | null;
|
|
670
|
+
depth: number;
|
|
671
|
+
index: number | null;
|
|
672
|
+
columnIndex?: number;
|
|
673
|
+
};
|
|
674
|
+
export type PanelLevelNodeVisitor = (node: PanelLevelNode, context: PanelLevelNodeWalkContext) => void | false;
|
|
675
|
+
export type PanelLevelNodeMapper = (node: PanelLevelNode, context: PanelLevelNodeWalkContext) => PanelLevelNode | null | undefined;
|
|
676
|
+
export type MapPanelLevelNodesOptions = {
|
|
677
|
+
pruneEmptyContainers?: boolean;
|
|
678
|
+
pruneEmptyColumns?: boolean;
|
|
679
|
+
collapseSingleChildContainers?: boolean;
|
|
680
|
+
};
|
|
681
|
+
export type PanelLevelUnsupportedNodePolicy = {
|
|
682
|
+
unsupportedTypes?: ReadonlySet<string> | readonly string[];
|
|
683
|
+
interactiveTypes?: ReadonlySet<string> | readonly string[];
|
|
684
|
+
allowInteractiveTypes?: boolean;
|
|
685
|
+
predicate?: (node: PanelLevelNode) => boolean;
|
|
686
|
+
};
|
|
687
|
+
export declare function isPanelTemplateContainerNode(node: PanelTemplateNode | null | undefined): node is PanelTemplateContainerNode;
|
|
688
|
+
export declare function walkPanelTemplateNodes(node: PanelTemplateNode | null | undefined, visitor: PanelTemplateNodeVisitor): void;
|
|
689
|
+
export declare function collectPanelTemplateUnsupportedNodes(node: PanelTemplateNode | null | undefined, policy?: PanelTemplateUnsupportedNodePolicy): PanelTemplateNode[];
|
|
690
|
+
export declare function isPanelLevelContainerNode(node: PanelLevelNode | null | undefined): node is PanelLevelContainerNode;
|
|
691
|
+
export declare function isPanelLevelActionBarNode(node: PanelLevelNode | null | undefined): node is PanelLevelActionBarNode;
|
|
692
|
+
export declare function isPanelLevelParameterInputNode(node: PanelLevelNode | null | undefined): node is PanelLevelParameterInputNode;
|
|
693
|
+
export declare function isPanelLevelDatasetAggregateNode(node: PanelLevelNode | null | undefined): node is PanelLevelDatasetAggregateNode;
|
|
694
|
+
export declare function walkPanelLevelNodes(node: PanelLevelNode | null | undefined, visitor: PanelLevelNodeVisitor): void;
|
|
695
|
+
export declare function mapPanelLevelNodes(node: PanelLevelNode | null | undefined, mapper: PanelLevelNodeMapper, options?: MapPanelLevelNodesOptions): PanelLevelNode | null;
|
|
696
|
+
export declare function collectPanelLevelActionBars(node: PanelLevelNode | null | undefined): PanelLevelActionBarNode[];
|
|
697
|
+
export declare function panelLevelNodeHasActionBar(node: PanelLevelNode | null | undefined): boolean;
|
|
698
|
+
export declare function collectPanelLevelParameterInputs(node: PanelLevelNode | null | undefined): PanelLevelParameterInputNode[];
|
|
699
|
+
export declare function collectDatasetAggregateNodes(node: PanelLevelNode | null | undefined): PanelLevelDatasetAggregateNode[];
|
|
700
|
+
export declare function panelLevelNodeUsesDatasetAggregate(node: PanelLevelNode | null | undefined): boolean;
|
|
701
|
+
export declare function panelLevelNodeContainsEmptyLayoutContainer(node: PanelLevelNode | null | undefined): boolean;
|
|
702
|
+
export declare function isPanelLevelNodeEffectivelyEmpty(node: PanelLevelNode | null | undefined): boolean;
|
|
703
|
+
export declare function collectPanelLevelUnsupportedNodes(node: PanelLevelNode | null | undefined, policy?: PanelLevelUnsupportedNodePolicy): PanelLevelNode[];
|
|
704
|
+
export type ClientInteraction = 'filter' | 'sort' | 'select' | 'hover' | 'zoom' | 'edit' | 'autosave';
|
|
705
|
+
export type SupportedActionSchema = {
|
|
706
|
+
id: string;
|
|
707
|
+
label: string;
|
|
708
|
+
description?: string;
|
|
709
|
+
};
|
|
710
|
+
export type ComponentContract = {
|
|
711
|
+
name: string;
|
|
712
|
+
displayName: string;
|
|
713
|
+
description: string;
|
|
714
|
+
dataModel: {
|
|
715
|
+
kind: DataModelKind;
|
|
716
|
+
};
|
|
717
|
+
propsSchema?: Record<string, unknown>;
|
|
718
|
+
datasetSchema?: DatasetSchema;
|
|
719
|
+
stateSchema?: Record<string, unknown>;
|
|
720
|
+
/** State keys that are shared across all users viewing this panel (e.g. selection). All other keys remain per-user. */
|
|
721
|
+
sharedStateKeys?: string[];
|
|
722
|
+
clientInteractions?: ClientInteraction[];
|
|
723
|
+
supportedActions?: SupportedActionSchema[];
|
|
724
|
+
};
|
|
725
|
+
export declare const COMPONENT_CONTRACTS: Record<string, ComponentContract>;
|
|
726
|
+
export declare function getComponentContract(name: string): ComponentContract;
|
|
727
|
+
export declare function listComponentContracts(): ComponentContract[];
|
|
728
|
+
export declare function validatePanelLevelNode(node: unknown, options: {
|
|
729
|
+
path: string;
|
|
730
|
+
depth: number;
|
|
731
|
+
errors: string[];
|
|
732
|
+
slotName: string;
|
|
733
|
+
actionIds?: Set<string>;
|
|
734
|
+
fieldNames?: Set<string>;
|
|
735
|
+
}): void;
|
|
736
|
+
export declare function getEffectiveDatasetSchema(componentOrContract: string | ComponentContract, props?: Record<string, unknown>): DatasetSchema | undefined;
|
|
737
|
+
export declare function validatePanelTemplateProps(componentOrContract: string | ComponentContract, props: Record<string, unknown>, actions?: Array<{
|
|
738
|
+
id: string;
|
|
739
|
+
}>): {
|
|
740
|
+
ok: true;
|
|
741
|
+
datasetSchema: DatasetSchema;
|
|
742
|
+
} | {
|
|
743
|
+
ok: false;
|
|
744
|
+
errors: string[];
|
|
745
|
+
};
|
|
746
|
+
export type PanelAuditEventType = 'created' | 'patched' | 'submitted' | 'actioned' | 'failed' | 'archived' | 'selection_committed' | 'annotation_saved' | 'state_saved';
|
|
747
|
+
export type PanelAuditEvent = {
|
|
748
|
+
id: number;
|
|
749
|
+
panelId: string;
|
|
750
|
+
event: PanelAuditEventType;
|
|
751
|
+
timestamp: number;
|
|
752
|
+
version: number;
|
|
753
|
+
changed?: string[];
|
|
754
|
+
submitKind?: string;
|
|
755
|
+
actionId?: string;
|
|
756
|
+
failureClass?: string;
|
|
757
|
+
actorType: 'agent' | 'user' | 'system';
|
|
758
|
+
actorId: string | null;
|
|
759
|
+
runId: string | null;
|
|
760
|
+
conversationId: string;
|
|
761
|
+
scopeType: 'direct' | 'channel' | 'thread' | 'tool';
|
|
762
|
+
scopeId: string | null;
|
|
763
|
+
metadataJson: string;
|
|
764
|
+
};
|
|
765
|
+
export type PanelSemanticEventWakePolicy = 'persisted' | 'agent_visible';
|
|
766
|
+
export type PanelSemanticEventRefs = {
|
|
767
|
+
selectedRowIndices?: number[];
|
|
768
|
+
selectedRowIds?: string[];
|
|
769
|
+
changedRowIndices?: number[];
|
|
770
|
+
changedRowIds?: string[];
|
|
771
|
+
};
|
|
772
|
+
export type PanelSemanticEvent = {
|
|
773
|
+
eventId: number;
|
|
774
|
+
panelId: string;
|
|
775
|
+
event: PanelAuditEventType;
|
|
776
|
+
label: string;
|
|
777
|
+
summary: string;
|
|
778
|
+
timestamp: number;
|
|
779
|
+
version: number;
|
|
780
|
+
wakePolicy: PanelSemanticEventWakePolicy;
|
|
781
|
+
changed?: string[];
|
|
782
|
+
submitKind?: string;
|
|
783
|
+
actionId?: string;
|
|
784
|
+
failureClass?: string;
|
|
785
|
+
actor: {
|
|
786
|
+
type: 'agent' | 'user' | 'system';
|
|
787
|
+
id: string | null;
|
|
788
|
+
runId: string | null;
|
|
789
|
+
};
|
|
790
|
+
conversationId: string;
|
|
791
|
+
scopeType: 'direct' | 'channel' | 'thread' | 'tool';
|
|
792
|
+
scopeId: string | null;
|
|
793
|
+
refs: PanelSemanticEventRefs;
|
|
794
|
+
metadataSummary: Record<string, unknown>;
|
|
795
|
+
};
|
|
796
|
+
export type ComponentProposalStatus = 'pending_review' | 'approved' | 'rejected';
|
|
797
|
+
export type ComponentProposalInput = {
|
|
798
|
+
name: string;
|
|
799
|
+
displayName: string;
|
|
800
|
+
description: string;
|
|
801
|
+
dataModel: {
|
|
802
|
+
kind: DataModelKind;
|
|
803
|
+
};
|
|
804
|
+
propsSchema: Record<string, unknown>;
|
|
805
|
+
datasetSchema: DatasetSchema;
|
|
806
|
+
rationale: string;
|
|
807
|
+
};
|
|
808
|
+
export type ComponentProposal = ComponentProposalInput & {
|
|
809
|
+
id: string;
|
|
810
|
+
status: ComponentProposalStatus;
|
|
811
|
+
submittedAt: number;
|
|
812
|
+
reviewedAt?: number;
|
|
813
|
+
};
|
|
814
|
+
export declare function validateComponentProposal(input: unknown, existingContractNames: Set<string>): {
|
|
815
|
+
ok: true;
|
|
816
|
+
} | {
|
|
817
|
+
ok: false;
|
|
818
|
+
errors: Array<{
|
|
819
|
+
field: string;
|
|
820
|
+
message: string;
|
|
821
|
+
}>;
|
|
822
|
+
};
|
|
823
|
+
export {};
|