@ai-matrx/agents 0.20.6 → 0.21.1

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,894 @@
1
+ "use client";
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // context/react/index.ts
32
+ var react_exports = {};
33
+ __export(react_exports, {
34
+ ContextRulesChip: () => ContextRulesChip,
35
+ ContextRulesPanelBody: () => ContextRulesPanelBody,
36
+ ContextRulesTable: () => ContextRulesTable,
37
+ InlineMaxInput: () => InlineMaxInput
38
+ });
39
+ module.exports = __toCommonJS(react_exports);
40
+
41
+ // context/react/ContextRulesTable.tsx
42
+ var import_design_system2 = require("@ai-matrx/design-system");
43
+
44
+ // context/index.ts
45
+ var DEFAULT_INLINE_MAX_CHARS = 200;
46
+ var DEFAULT_INLINE_CAP = 5e4;
47
+ var isNum = (v) => typeof v === "number" && Number.isFinite(v);
48
+ var isValidLimit = (v) => typeof v === "number" && Number.isInteger(v) && v >= 0;
49
+ function resolveContextRule(input) {
50
+ const agent = input.agent ?? null;
51
+ const surface = input.surface ?? null;
52
+ const user = input.user ?? null;
53
+ const cap = isNum(input.cap) ? input.cap : DEFAULT_INLINE_CAP;
54
+ const agentDeclared = agent?.declared === true;
55
+ let include = true;
56
+ let includeBy = "default";
57
+ if (surface?.declared === true && surface.auto_context === false) {
58
+ if (agentDeclared) {
59
+ include = true;
60
+ includeBy = "agent";
61
+ } else {
62
+ include = false;
63
+ includeBy = "page";
64
+ }
65
+ }
66
+ if (agent?.kill_switch === true && !agentDeclared) {
67
+ include = false;
68
+ includeBy = "agent";
69
+ }
70
+ if (user && typeof user.include === "boolean") {
71
+ include = user.include;
72
+ includeBy = "you";
73
+ }
74
+ let limit = isNum(input.default_max) ? input.default_max : DEFAULT_INLINE_MAX_CHARS;
75
+ let limitBy = "default";
76
+ const a = agentDeclared && isNum(agent?.max_inline_chars) ? agent.max_inline_chars : null;
77
+ const s = isNum(surface?.max_inline_chars) ? surface.max_inline_chars : null;
78
+ if (a !== null && s !== null) {
79
+ if (s < a) {
80
+ limit = s;
81
+ limitBy = "page";
82
+ } else {
83
+ limit = a;
84
+ limitBy = "agent";
85
+ }
86
+ } else if (a !== null) {
87
+ limit = a;
88
+ limitBy = "agent";
89
+ } else if (s !== null) {
90
+ limit = s;
91
+ limitBy = "page";
92
+ }
93
+ if (user && isValidLimit(user.max_inline_chars)) {
94
+ limit = user.max_inline_chars;
95
+ limitBy = "you";
96
+ }
97
+ const clamped = limit > cap;
98
+ limit = Math.min(limit, cap);
99
+ const chars = input.chars;
100
+ const delivery = !include ? "off" : chars === null || chars === void 0 || limit === 0 || chars > limit ? "on_request" : "inline";
101
+ return {
102
+ include,
103
+ max_inline_chars: limit,
104
+ delivery,
105
+ decided_by: { include: includeBy, max_inline_chars: limitBy },
106
+ clamped
107
+ };
108
+ }
109
+ function formatChars(n) {
110
+ if (n === null || n === void 0 || !Number.isFinite(n)) return "\u2014";
111
+ const abs = Math.abs(n);
112
+ const trim = (s) => s.replace(/\.0$/, "");
113
+ if (abs < 1e3) return String(Math.round(n));
114
+ if (abs < 1e5) return `${trim((n / 1e3).toFixed(1))}k`;
115
+ if (abs < 1e6) return `${Math.round(n / 1e3)}k`;
116
+ return `${trim((n / 1e6).toFixed(1))}M`;
117
+ }
118
+
119
+ // context/react/icons.tsx
120
+ var import_jsx_runtime = require("react/jsx-runtime");
121
+ function icon(children) {
122
+ return function Icon(props) {
123
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
124
+ "svg",
125
+ {
126
+ xmlns: "http://www.w3.org/2000/svg",
127
+ viewBox: "0 0 24 24",
128
+ fill: "none",
129
+ stroke: "currentColor",
130
+ strokeWidth: 2,
131
+ strokeLinecap: "round",
132
+ strokeLinejoin: "round",
133
+ "aria-hidden": "true",
134
+ ...props,
135
+ children
136
+ }
137
+ );
138
+ };
139
+ }
140
+ var EyeIcon = icon(
141
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }),
143
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "3" })
144
+ ] })
145
+ );
146
+ var EyeOffIcon = icon(
147
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
148
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }),
149
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242" }),
150
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }),
151
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m2 2 20 20" })
152
+ ] })
153
+ );
154
+ var RotateCcwIcon = icon(
155
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
156
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
157
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 3v5h5" })
158
+ ] })
159
+ );
160
+ var PanelRightIcon = icon(
161
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
162
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
163
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M15 3v18" })
164
+ ] })
165
+ );
166
+ var ChevronLeftIcon = icon(/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m15 18-6-6 6-6" }));
167
+ var TriangleAlertIcon = icon(
168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
169
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 9v4" }),
171
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 17h.01" })
172
+ ] })
173
+ );
174
+ var SearchIcon = icon(
175
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
176
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
177
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m21 21-4.3-4.3" })
178
+ ] })
179
+ );
180
+ var ArrowDownToLineIcon = icon(
181
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
182
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 17V3" }),
183
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m6 11 6 6 6-6" }),
184
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M19 21H5" })
185
+ ] })
186
+ );
187
+
188
+ // context/react/InlineMaxInput.tsx
189
+ var React = __toESM(require("react"), 1);
190
+ var import_design_system = require("@ai-matrx/design-system");
191
+
192
+ // context/react/shared.ts
193
+ var LAYER_LABEL = {
194
+ default: "Default",
195
+ page: "Page",
196
+ agent: "Agent",
197
+ you: "You"
198
+ };
199
+ var DELIVERY_LABEL = {
200
+ inline: "Inline",
201
+ on_request: "On request",
202
+ off: "Off"
203
+ };
204
+ function formatLimit(n) {
205
+ return n === 0 ? "Never" : String(n);
206
+ }
207
+ function inheritedLimit(row, cap) {
208
+ return resolveContextRule({ ...row.layers ?? {}, chars: row.chars, cap, user: null }).max_inline_chars;
209
+ }
210
+ function hasOverride(row) {
211
+ return row.userRule !== null && Object.keys(row.userRule).length > 0;
212
+ }
213
+ function withInclude(row, include) {
214
+ return { ...row.userRule ?? {}, include };
215
+ }
216
+ function withLimit(row, limit) {
217
+ const next = { ...row.userRule ?? {} };
218
+ if (limit === null) delete next.max_inline_chars;
219
+ else next.max_inline_chars = limit;
220
+ return Object.keys(next).length === 0 ? null : next;
221
+ }
222
+ function rowId(row) {
223
+ return `${row.surfaceKey}::${row.key}`;
224
+ }
225
+ function show(field, v) {
226
+ if (v === null || v === void 0) return "none";
227
+ if (typeof v === "boolean") return v ? "On" : "Off";
228
+ if (typeof v === "number") return formatLimit(v);
229
+ if (field === "delivery" || field === "missing") {
230
+ return DELIVERY_LABEL[v] ?? String(v);
231
+ }
232
+ if (typeof v === "object") {
233
+ const r = v;
234
+ const parts = [];
235
+ if (r.include !== void 0) parts.push(r.include ? "On" : "Off");
236
+ if (r.max_inline_chars !== void 0) parts.push(formatLimit(r.max_inline_chars));
237
+ return parts.join(", ") || "none";
238
+ }
239
+ return String(v);
240
+ }
241
+ var FIELD_LABEL = {
242
+ include: "Include",
243
+ max_inline_chars: "Inline max",
244
+ delivery: "Delivery",
245
+ user_rule: "Your rule",
246
+ missing: "Not sent"
247
+ };
248
+ function describeMismatches(list) {
249
+ const text = list.map(
250
+ (m) => m.field === "missing" ? "Missing from the server's receipt" : `${FIELD_LABEL[m.field]}: expected ${show(m.field, m.expected)}, got ${show(m.field, m.actual)}`
251
+ ).join(" \xB7 ");
252
+ return text.length > 140 ? `${text.slice(0, 139)}\u2026` : text;
253
+ }
254
+ function onRequestReason(row) {
255
+ if (row.chars === null) return "Size unknown \u2014 the agent reads it on request";
256
+ if (row.max_inline_chars === 0) return "Never inline \u2014 the agent reads it on request";
257
+ return "Over the limit \u2014 the agent reads it on request";
258
+ }
259
+
260
+ // context/react/InlineMaxInput.tsx
261
+ var import_jsx_runtime2 = require("react/jsx-runtime");
262
+ function InlineMaxInput({
263
+ value,
264
+ inherited,
265
+ cap,
266
+ onCommit,
267
+ disabled,
268
+ label,
269
+ comfortable
270
+ }) {
271
+ const [focused, setFocused] = React.useState(false);
272
+ const [draft, setDraft] = React.useState("");
273
+ const [notice, setNotice] = React.useState(false);
274
+ const skip = React.useRef(false);
275
+ React.useEffect(() => {
276
+ if (!notice) return;
277
+ const t = setTimeout(() => setNotice(false), 2e3);
278
+ return () => clearTimeout(t);
279
+ }, [notice]);
280
+ const commit = () => {
281
+ const text = draft.trim();
282
+ let next;
283
+ if (text === "") next = null;
284
+ else if (/^never$/i.test(text)) next = 0;
285
+ else if (/^\d+$/.test(text)) next = Number(text);
286
+ else return;
287
+ if (next !== null && next > cap) {
288
+ next = cap;
289
+ setNotice(true);
290
+ }
291
+ if (next !== value) onCommit(next);
292
+ };
293
+ const overridden = value !== null;
294
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex items-center justify-end gap-1", children: [
295
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
296
+ "span",
297
+ {
298
+ "aria-hidden": "true",
299
+ className: (0, import_design_system.cn)("h-1.5 w-1.5 shrink-0 rounded-full", overridden ? "bg-primary" : "bg-transparent")
300
+ }
301
+ ),
302
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_design_system.Tooltip, { open: notice, children: [
303
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_design_system.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
304
+ import_design_system.Input,
305
+ {
306
+ type: "text",
307
+ inputMode: "numeric",
308
+ "aria-label": `Inline max for ${label}`,
309
+ disabled,
310
+ value: focused ? draft : overridden ? formatLimit(value) : "",
311
+ placeholder: overridden ? void 0 : formatLimit(inherited),
312
+ onFocus: () => {
313
+ setDraft(overridden ? String(value) : "");
314
+ setFocused(true);
315
+ },
316
+ onChange: (e) => setDraft(e.target.value),
317
+ onBlur: () => {
318
+ setFocused(false);
319
+ if (skip.current) {
320
+ skip.current = false;
321
+ return;
322
+ }
323
+ commit();
324
+ },
325
+ onKeyDown: (e) => {
326
+ if (e.key === "Enter") e.currentTarget.blur();
327
+ else if (e.key === "Escape") {
328
+ e.stopPropagation();
329
+ skip.current = true;
330
+ e.currentTarget.blur();
331
+ }
332
+ },
333
+ className: (0, import_design_system.cn)(
334
+ "w-[6.5ch] min-w-0 rounded px-1 py-0 text-right tabular-nums shadow-none",
335
+ comfortable ? "h-8 text-base" : "h-6 text-xs"
336
+ )
337
+ }
338
+ ) }),
339
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_design_system.TooltipContent, { children: `Limit is ${cap}` })
340
+ ] }),
341
+ overridden && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_design_system.Tooltip, { children: [
342
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_design_system.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
343
+ "button",
344
+ {
345
+ type: "button",
346
+ "aria-label": `Reset inline max for ${label}`,
347
+ onClick: () => onCommit(null),
348
+ className: (0, import_design_system.cn)(
349
+ "inline-flex shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground",
350
+ comfortable ? "h-8 w-8" : "h-5 w-5"
351
+ ),
352
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RotateCcwIcon, { className: "h-3 w-3" })
353
+ }
354
+ ) }),
355
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_design_system.TooltipContent, { children: `Reset to ${formatLimit(inherited)}` })
356
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": "true", className: (0, import_design_system.cn)("shrink-0", comfortable ? "w-8" : "w-5") })
357
+ ] });
358
+ }
359
+
360
+ // context/react/ContextRulesTable.tsx
361
+ var import_jsx_runtime3 = require("react/jsx-runtime");
362
+ var GROUPS = [
363
+ { origin: "page", label: "Page" },
364
+ { origin: "attached", label: "Attached" },
365
+ { origin: "system", label: "System" }
366
+ ];
367
+ var GRID = {
368
+ compact: "grid grid-cols-[minmax(0,1fr)_2.75rem_4rem_6.5rem] items-center gap-x-2 px-2",
369
+ comfortable: "grid grid-cols-[minmax(0,1fr)_3rem_4.5rem_9rem] items-center gap-x-2 px-3"
370
+ };
371
+ function ContextRulesTable({
372
+ rows,
373
+ cap,
374
+ readOnly,
375
+ mismatches,
376
+ onChange,
377
+ onOpenRow,
378
+ density = "compact",
379
+ selectedKey,
380
+ className
381
+ }) {
382
+ const comfortable = density === "comfortable";
383
+ const present = GROUPS.filter((g) => rows.some((r) => r.origin === g.origin));
384
+ const grouped = present.length > 1;
385
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_design_system2.TooltipProvider, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { role: "table", "aria-label": "Context", "data-density": density, className: (0, import_design_system2.cn)("text-xs", className), children: [
386
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
387
+ "div",
388
+ {
389
+ role: "row",
390
+ className: (0, import_design_system2.cn)(
391
+ GRID[density],
392
+ "sticky top-0 z-10 h-7 border-b border-border bg-card font-medium text-muted-foreground"
393
+ ),
394
+ children: [
395
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "columnheader", children: "Item" }),
396
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "columnheader", className: "text-center", children: "Include" }),
397
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "columnheader", className: "text-right", children: "Chars" }),
398
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "columnheader", className: "pr-6 text-right", children: "Inline max" })
399
+ ]
400
+ }
401
+ ),
402
+ rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "px-2 py-3 text-center text-muted-foreground", children: "Nothing in context" }) : present.map((g) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { role: "rowgroup", "aria-label": grouped ? g.label : void 0, children: [
403
+ grouped ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
404
+ "div",
405
+ {
406
+ role: "row",
407
+ className: "flex h-6 items-center bg-muted/40 px-2 font-medium text-muted-foreground",
408
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "cell", children: g.label })
409
+ }
410
+ ) : null,
411
+ rows.filter((r) => r.origin === g.origin).map((row) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
412
+ ContextRuleRow,
413
+ {
414
+ row,
415
+ cap,
416
+ density,
417
+ readOnly,
418
+ selected: selectedKey === row.key,
419
+ mismatches: mismatches?.filter((m) => m.key === row.key) ?? [],
420
+ onChange,
421
+ onOpenRow,
422
+ comfortable
423
+ },
424
+ rowId(row)
425
+ ))
426
+ ] }, g.origin))
427
+ ] }) });
428
+ }
429
+ function ContextRuleRow({
430
+ row,
431
+ cap,
432
+ density,
433
+ comfortable,
434
+ readOnly,
435
+ selected,
436
+ mismatches,
437
+ onChange,
438
+ onOpenRow
439
+ }) {
440
+ const decided = `Include: ${LAYER_LABEL[row.decided_by.include]} \xB7 Limit: ${LAYER_LABEL[row.decided_by.max_inline_chars]}`;
441
+ const labelNode = onOpenRow ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
442
+ "button",
443
+ {
444
+ type: "button",
445
+ onClick: () => onOpenRow(row.key),
446
+ className: "min-w-0 truncate text-left hover:underline focus-visible:underline focus-visible:outline-none",
447
+ children: row.label
448
+ }
449
+ ) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "min-w-0 truncate", children: row.label });
450
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
451
+ "div",
452
+ {
453
+ role: "row",
454
+ "data-key": row.key,
455
+ "data-included": row.include ? "true" : "false",
456
+ "data-mismatch": mismatches.length > 0 ? "true" : void 0,
457
+ "aria-selected": selected || void 0,
458
+ className: (0, import_design_system2.cn)(
459
+ GRID[density],
460
+ "border-b border-border/50",
461
+ comfortable ? "min-h-11" : "h-7",
462
+ selected && "bg-accent"
463
+ ),
464
+ children: [
465
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { role: "cell", className: (0, import_design_system2.cn)("flex min-w-0 items-center gap-1.5", !row.include && "opacity-50"), children: [
466
+ mismatches.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_design_system2.Tooltip, { children: [
467
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_design_system2.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
468
+ "span",
469
+ {
470
+ role: "img",
471
+ "aria-label": "Mismatch",
472
+ className: "inline-flex shrink-0 text-warning",
473
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TriangleAlertIcon, { className: "h-3.5 w-3.5" })
474
+ }
475
+ ) }),
476
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_design_system2.TooltipContent, { children: describeMismatches(mismatches) })
477
+ ] }) : null,
478
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_design_system2.Tooltip, { children: [
479
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_design_system2.TooltipTrigger, { asChild: true, children: labelNode }),
480
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_design_system2.TooltipContent, { children: [
481
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: row.label }),
482
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "font-normal text-muted-foreground", children: decided })
483
+ ] })
484
+ ] }),
485
+ comfortable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "ml-auto shrink-0 rounded bg-muted px-1 text-[0.6875rem] leading-4 text-muted-foreground", children: LAYER_LABEL[row.decided_by.max_inline_chars] }) : null
486
+ ] }),
487
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { role: "cell", className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
488
+ import_design_system2.Switch,
489
+ {
490
+ size: "sm",
491
+ "aria-label": `Include ${row.label}`,
492
+ checked: row.include,
493
+ disabled: readOnly,
494
+ onCheckedChange: (next) => onChange(row.key, row.surfaceKey, withInclude(row, next))
495
+ }
496
+ ) }),
497
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
498
+ "div",
499
+ {
500
+ role: "cell",
501
+ className: (0, import_design_system2.cn)("flex items-center justify-end gap-1 tabular-nums", !row.include && "opacity-50"),
502
+ children: [
503
+ row.include && row.delivery === "on_request" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_design_system2.Tooltip, { children: [
504
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_design_system2.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "img", "aria-label": "On request", className: "inline-flex text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrowDownToLineIcon, { className: "h-3 w-3" }) }) }),
505
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_design_system2.TooltipContent, { children: onRequestReason(row) })
506
+ ] }) : null,
507
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: formatChars(row.chars) })
508
+ ]
509
+ }
510
+ ),
511
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { role: "cell", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
512
+ InlineMaxInput,
513
+ {
514
+ label: row.label,
515
+ value: row.userRule?.max_inline_chars ?? null,
516
+ inherited: inheritedLimit(row, cap),
517
+ cap,
518
+ disabled: readOnly,
519
+ comfortable,
520
+ onCommit: (next) => onChange(row.key, row.surfaceKey, withLimit(row, next))
521
+ }
522
+ ) })
523
+ ]
524
+ }
525
+ );
526
+ }
527
+
528
+ // context/react/ContextRulesChip.tsx
529
+ var React2 = __toESM(require("react"), 1);
530
+ var import_design_system3 = require("@ai-matrx/design-system");
531
+ var import_jsx_runtime4 = require("react/jsx-runtime");
532
+ function summarize(rows) {
533
+ let count = 0;
534
+ let chars = 0;
535
+ for (const r of rows) {
536
+ if (!r.include) continue;
537
+ count += 1;
538
+ chars += r.chars ?? 0;
539
+ }
540
+ return { count, chars };
541
+ }
542
+ function IconButton({
543
+ label,
544
+ onClick,
545
+ comfortable,
546
+ children
547
+ }) {
548
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_design_system3.Tooltip, { children: [
549
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system3.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
550
+ "button",
551
+ {
552
+ type: "button",
553
+ "aria-label": label,
554
+ onClick,
555
+ className: (0, import_design_system3.cn)(
556
+ "inline-flex shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",
557
+ comfortable ? "h-11 w-11" : "h-7 w-7"
558
+ ),
559
+ children
560
+ }
561
+ ) }),
562
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system3.TooltipContent, { children: label })
563
+ ] });
564
+ }
565
+ function ContextRulesChip({
566
+ label,
567
+ rows,
568
+ cap,
569
+ on,
570
+ onToggleAll,
571
+ onChange,
572
+ onResetAll,
573
+ onOpenFullView,
574
+ mismatchCount = 0,
575
+ mismatches,
576
+ onOpenRow,
577
+ isMobile,
578
+ readOnly,
579
+ open: openProp,
580
+ onOpenChange,
581
+ className
582
+ }) {
583
+ const [openState, setOpenState] = React2.useState(false);
584
+ const open = openProp ?? openState;
585
+ const setOpen = (next) => {
586
+ if (openProp === void 0) setOpenState(next);
587
+ onOpenChange?.(next);
588
+ };
589
+ const { count, chars } = summarize(rows);
590
+ const anyOverride = rows.some(hasOverride);
591
+ const warn = mismatchCount > 0;
592
+ const comfortable = !!isMobile;
593
+ const face = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
594
+ "button",
595
+ {
596
+ type: "button",
597
+ "aria-label": `Context: ${label}`,
598
+ "data-mismatch": warn ? "true" : void 0,
599
+ onClick: isMobile ? () => setOpen(true) : void 0,
600
+ className: (0, import_design_system3.cn)(
601
+ "inline-flex h-7 max-w-[14rem] items-center gap-1.5 rounded-full border border-border bg-card px-2 text-xs text-foreground hover:bg-accent",
602
+ !on && "text-muted-foreground",
603
+ warn && "border-warning/60 ring-1 ring-warning",
604
+ className
605
+ ),
606
+ children: [
607
+ on ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EyeIcon, { className: "h-3.5 w-3.5 shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EyeOffIcon, { className: "h-3.5 w-3.5 shrink-0" }),
608
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "min-w-0 truncate", children: label }),
609
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: count }),
610
+ warn ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "inline-flex shrink-0 items-center gap-0.5 tabular-nums text-warning", children: [
611
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TriangleAlertIcon, { className: "h-3 w-3" }),
612
+ mismatchCount
613
+ ] }) : null
614
+ ]
615
+ }
616
+ );
617
+ const body = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex min-h-0 flex-col", children: [
618
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
619
+ "div",
620
+ {
621
+ className: (0, import_design_system3.cn)(
622
+ "flex shrink-0 items-center gap-2 border-b border-border px-3",
623
+ comfortable ? "h-12" : "h-10"
624
+ ),
625
+ children: [
626
+ on ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EyeIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EyeOffIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
627
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "min-w-0 truncate text-sm font-medium", children: label }),
628
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: `${count} \xB7 ${formatChars(chars)} chars` }),
629
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "ml-auto flex shrink-0 items-center gap-0.5", children: [
630
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
631
+ import_design_system3.Switch,
632
+ {
633
+ size: "sm",
634
+ "aria-label": "Page context",
635
+ checked: on,
636
+ disabled: readOnly,
637
+ onCheckedChange: onToggleAll,
638
+ className: "mr-1"
639
+ }
640
+ ),
641
+ anyOverride && !readOnly ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconButton, { label: "Reset all", onClick: onResetAll, comfortable, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RotateCcwIcon, { className: "h-3.5 w-3.5" }) }) : null,
642
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
643
+ IconButton,
644
+ {
645
+ label: "Open full view",
646
+ comfortable,
647
+ onClick: () => {
648
+ setOpen(false);
649
+ onOpenFullView();
650
+ },
651
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PanelRightIcon, { className: "h-3.5 w-3.5" })
652
+ }
653
+ )
654
+ ] })
655
+ ]
656
+ }
657
+ ),
658
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_design_system3.cn)("min-h-0 overflow-y-auto", comfortable ? "max-h-[70dvh]" : "max-h-[min(24rem,60vh)]"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
659
+ ContextRulesTable,
660
+ {
661
+ rows,
662
+ cap,
663
+ readOnly,
664
+ density: comfortable ? "comfortable" : "compact",
665
+ onChange,
666
+ ...mismatches ? { mismatches } : {},
667
+ ...onOpenRow ? { onOpenRow } : {}
668
+ }
669
+ ) })
670
+ ] });
671
+ if (isMobile) {
672
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_design_system3.TooltipProvider, { delayDuration: 300, titleTooltips: false, children: [
673
+ face,
674
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system3.BottomSheet, { open, onOpenChange: setOpen, title: label, surface: "solid", children: body })
675
+ ] });
676
+ }
677
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system3.TooltipProvider, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_design_system3.Popover, { open, onOpenChange: setOpen, children: [
678
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system3.PopoverTrigger, { asChild: true, children: face }),
679
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
680
+ import_design_system3.PopoverContent,
681
+ {
682
+ align: "start",
683
+ className: "w-[26rem] max-w-[calc(100vw-1rem)] overflow-hidden p-0",
684
+ children: body
685
+ }
686
+ )
687
+ ] }) });
688
+ }
689
+
690
+ // context/react/ContextRulesPanelBody.tsx
691
+ var React3 = __toESM(require("react"), 1);
692
+ var import_design_system4 = require("@ai-matrx/design-system");
693
+ var import_jsx_runtime5 = require("react/jsx-runtime");
694
+ function layerCells(row) {
695
+ const { surface, agent, default_max } = row.layers ?? {};
696
+ const declared = agent?.declared === true;
697
+ const pageOff = surface?.declared === true && surface.auto_context === false;
698
+ const num = (n) => typeof n === "number" ? formatLimit(n) : "\u2014";
699
+ const rule = row.userRule;
700
+ return {
701
+ default: { include: "On", limit: formatLimit(default_max ?? DEFAULT_INLINE_MAX_CHARS) },
702
+ page: { include: pageOff ? "Off" : "\u2014", limit: num(surface?.max_inline_chars) },
703
+ agent: {
704
+ include: agent?.kill_switch && !declared ? "Off" : declared && pageOff ? "On" : "\u2014",
705
+ limit: declared ? num(agent?.max_inline_chars) : "\u2014"
706
+ },
707
+ you: {
708
+ include: rule?.include === void 0 ? "\u2014" : rule.include ? "On" : "Off",
709
+ limit: num(rule?.max_inline_chars)
710
+ }
711
+ };
712
+ }
713
+ var LAYERS = ["default", "page", "agent", "you"];
714
+ function LayerTable({ row }) {
715
+ const cells = layerCells(row);
716
+ const cell = (text, winning) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
717
+ "span",
718
+ {
719
+ role: "cell",
720
+ "data-winning": winning ? "true" : void 0,
721
+ className: (0, import_design_system4.cn)(
722
+ "rounded px-1.5 py-0.5 text-right tabular-nums",
723
+ winning ? "bg-primary/10 font-medium text-foreground" : "text-muted-foreground"
724
+ ),
725
+ children: text
726
+ }
727
+ );
728
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { role: "table", "aria-label": "Layers", className: "text-xs", children: [
729
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
730
+ "div",
731
+ {
732
+ role: "row",
733
+ className: "grid h-7 grid-cols-[1fr_5rem_5rem] items-center gap-x-2 border-b border-border font-medium text-muted-foreground",
734
+ children: [
735
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { role: "columnheader", children: "Layer" }),
736
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { role: "columnheader", className: "text-right", children: "Include" }),
737
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { role: "columnheader", className: "text-right", children: "Inline max" })
738
+ ]
739
+ }
740
+ ),
741
+ LAYERS.map((layer) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
742
+ "div",
743
+ {
744
+ role: "row",
745
+ className: "grid h-7 grid-cols-[1fr_5rem_5rem] items-center gap-x-2 border-b border-border/50",
746
+ children: [
747
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { role: "cell", children: LAYER_LABEL[layer] }),
748
+ cell(cells[layer].include, row.decided_by.include === layer),
749
+ cell(cells[layer].limit, row.decided_by.max_inline_chars === layer)
750
+ ]
751
+ },
752
+ layer
753
+ ))
754
+ ] });
755
+ }
756
+ function RowDetail({
757
+ row,
758
+ cap,
759
+ readOnly,
760
+ mismatches,
761
+ onChange,
762
+ renderDetail,
763
+ comfortable
764
+ }) {
765
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col gap-3 p-3", children: [
766
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex min-w-0 items-baseline gap-2", children: [
767
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h3", { className: "min-w-0 truncate text-sm font-medium", children: row.label }),
768
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: `${formatChars(row.chars)} chars \xB7 ${DELIVERY_LABEL[row.delivery]}` })
769
+ ] }),
770
+ mismatches.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-start gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-2 py-1.5 text-xs text-warning", children: [
771
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TriangleAlertIcon, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
772
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: describeMismatches(mismatches) })
773
+ ] }) : null,
774
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "grid grid-cols-[auto_1fr] items-center gap-x-4 gap-y-2 text-xs", children: [
775
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-muted-foreground", children: "Include" }),
776
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_design_system4.cn)("flex items-center", comfortable ? "h-11" : "h-7"), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
777
+ import_design_system4.Switch,
778
+ {
779
+ size: "sm",
780
+ "aria-label": `Include ${row.label}`,
781
+ checked: row.include,
782
+ disabled: readOnly,
783
+ onCheckedChange: (next) => onChange(row.key, row.surfaceKey, withInclude(row, next))
784
+ }
785
+ ) }),
786
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-muted-foreground", children: "Inline max" }),
787
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
788
+ InlineMaxInput,
789
+ {
790
+ label: row.label,
791
+ value: row.userRule?.max_inline_chars ?? null,
792
+ inherited: inheritedLimit(row, cap),
793
+ cap,
794
+ disabled: readOnly,
795
+ comfortable,
796
+ onCommit: (next) => onChange(row.key, row.surfaceKey, withLimit(row, next))
797
+ }
798
+ ) })
799
+ ] }),
800
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LayerTable, { row }),
801
+ renderDetail ? renderDetail(row) : null
802
+ ] });
803
+ }
804
+ function ContextRulesPanelBody({
805
+ rows,
806
+ cap,
807
+ mismatches,
808
+ readOnly,
809
+ onChange,
810
+ renderDetail,
811
+ isMobile,
812
+ selectedKey: selectedProp,
813
+ onSelectedKeyChange,
814
+ className
815
+ }) {
816
+ const [selectedState, setSelectedState] = React3.useState(null);
817
+ const [query, setQuery] = React3.useState("");
818
+ const selectedKey = selectedProp !== void 0 ? selectedProp : selectedState;
819
+ const select = (key) => {
820
+ if (selectedProp === void 0) setSelectedState(key);
821
+ onSelectedKeyChange?.(key);
822
+ };
823
+ const q = query.trim().toLowerCase();
824
+ const visible = q ? rows.filter((r) => r.label.toLowerCase().includes(q) || r.key.toLowerCase().includes(q)) : rows;
825
+ const selected = selectedKey ? rows.find((r) => r.key === selectedKey) ?? null : null;
826
+ const comfortable = !!isMobile;
827
+ const search = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "relative shrink-0 border-b border-border p-2", children: [
828
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SearchIcon, { className: "pointer-events-none absolute left-4 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
829
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
830
+ import_design_system4.Input,
831
+ {
832
+ type: "search",
833
+ "aria-label": "Search context",
834
+ placeholder: "Search",
835
+ value: query,
836
+ onChange: (e) => setQuery(e.target.value),
837
+ className: (0, import_design_system4.cn)("pl-7 shadow-none", comfortable ? "h-11 text-base" : "h-8 text-xs")
838
+ }
839
+ )
840
+ ] });
841
+ const table = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
842
+ ContextRulesTable,
843
+ {
844
+ rows: visible,
845
+ cap,
846
+ readOnly,
847
+ density: comfortable ? "comfortable" : "compact",
848
+ selectedKey,
849
+ onChange,
850
+ onOpenRow: (key) => select(key),
851
+ ...mismatches ? { mismatches } : {}
852
+ }
853
+ ) });
854
+ const detail = selected ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
855
+ RowDetail,
856
+ {
857
+ row: selected,
858
+ cap,
859
+ readOnly,
860
+ mismatches: mismatches?.filter((m) => m.key === selected.key) ?? [],
861
+ onChange,
862
+ renderDetail,
863
+ comfortable
864
+ }
865
+ ) : null;
866
+ if (isMobile) {
867
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system4.TooltipProvider, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_design_system4.cn)("flex h-full min-h-0 flex-col", className), children: selected ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
868
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex h-12 shrink-0 items-center border-b border-border px-1", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
869
+ "button",
870
+ {
871
+ type: "button",
872
+ onClick: () => select(null),
873
+ className: "inline-flex h-11 items-center gap-1 rounded-md px-2 text-sm text-muted-foreground hover:text-foreground",
874
+ children: [
875
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChevronLeftIcon, { className: "h-4 w-4" }),
876
+ "Back"
877
+ ]
878
+ }
879
+ ) }),
880
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", children: detail })
881
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
882
+ search,
883
+ table
884
+ ] }) }) });
885
+ }
886
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system4.TooltipProvider, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_design_system4.cn)("flex h-full min-h-0", className), children: [
887
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("aside", { className: "flex w-[22rem] shrink-0 flex-col border-r border-border", children: [
888
+ search,
889
+ table
890
+ ] }),
891
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("section", { className: "min-h-0 min-w-0 flex-1 overflow-y-auto", children: detail ?? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex h-full items-center justify-center text-xs text-muted-foreground", children: "Select an item" }) })
892
+ ] }) });
893
+ }
894
+ //# sourceMappingURL=index.cjs.map