@ai-matrx/agents 0.59.176 → 0.59.177

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,1302 @@
1
+ "use client";
2
+
3
+ // versions/react/AgentDiffViewer.tsx
4
+ import { useMemo } from "react";
5
+ import {
6
+ BooleanFieldAdapter,
7
+ createAdapterRegistry,
8
+ DiffViewerShell,
9
+ JsonObjectAdapter,
10
+ TagsFieldAdapter,
11
+ TextFieldAdapter
12
+ } from "@ai-matrx/diff/react";
13
+
14
+ // versions/compare.ts
15
+ import { computeDiff } from "@ai-matrx/diff/structural";
16
+
17
+ // versions/constants.ts
18
+ var AGENT_EXCLUDE_PATHS = /* @__PURE__ */ new Set([
19
+ "id",
20
+ "userId",
21
+ "organizationId",
22
+ "taskId",
23
+ "createdAt",
24
+ "updatedAt",
25
+ "isVersion",
26
+ "parentAgentId",
27
+ "sourceAgentId",
28
+ "sourceSnapshotAt",
29
+ // Lineage and record bookkeeping: who made the row and which version it was
30
+ // copied from never change what the agent does, so a copy never "differs" here.
31
+ "sourceVersion",
32
+ "followsSource",
33
+ "createdBy",
34
+ "runCounts",
35
+ "isOwner",
36
+ "accessLevel",
37
+ "sharedByEmail",
38
+ "agentType",
39
+ "version",
40
+ "changeNote",
41
+ "changedAt"
42
+ ]);
43
+ var AGENT_IDENTITY_KEYS = {
44
+ variableDefinitions: "name",
45
+ contextPolicies: "key",
46
+ customTools: "name"
47
+ };
48
+ var AGENT_DIFF_OPTIONS = {
49
+ excludePaths: AGENT_EXCLUDE_PATHS,
50
+ identityKeys: AGENT_IDENTITY_KEYS,
51
+ // Output-schema property order is authored behavior: model providers often
52
+ // emit fields in schema order, so a reorder must be visible in version diffs.
53
+ orderSensitiveObjectPaths: /* @__PURE__ */ new Set(["outputSchema"]),
54
+ // Agent configuration is executable data. `_`/`__` keys (especially
55
+ // output-schema `__kind`) are contract fields, never hidden metadata.
56
+ skipUnderscorePrefix: false
57
+ };
58
+
59
+ // versions/compare.ts
60
+ var AGENT_PROFILE_FIELDS = /* @__PURE__ */ new Set(["name", "description", "category", "tags"]);
61
+ var AGENT_LOCAL_STATE_FIELDS = /* @__PURE__ */ new Set([
62
+ "isActive",
63
+ "isArchived",
64
+ "isFavorite"
65
+ ]);
66
+ function toComparableAgentRecord(agent) {
67
+ return Object.fromEntries(
68
+ Object.entries(agent).filter(([key]) => !key.startsWith("_"))
69
+ );
70
+ }
71
+ function compareAgentDefinitions(systemAgent, personalAgent) {
72
+ const systemRecord = toComparableAgentRecord(systemAgent);
73
+ const personalRecord = toComparableAgentRecord(personalAgent);
74
+ const diffResult = computeDiff(
75
+ systemRecord,
76
+ personalRecord,
77
+ AGENT_DIFF_OPTIONS
78
+ );
79
+ const changedFields = diffResult.root.filter(
80
+ (node) => node.changeType !== "unchanged"
81
+ );
82
+ const profileFields = changedFields.filter(
83
+ (node) => AGENT_PROFILE_FIELDS.has(node.key)
84
+ );
85
+ const localStateFields = changedFields.filter(
86
+ (node) => AGENT_LOCAL_STATE_FIELDS.has(node.key)
87
+ );
88
+ const behaviorFields = changedFields.filter(
89
+ (node) => !AGENT_PROFILE_FIELDS.has(node.key) && !AGENT_LOCAL_STATE_FIELDS.has(node.key)
90
+ );
91
+ return {
92
+ diffResult,
93
+ changedFields,
94
+ behaviorFields,
95
+ profileFields,
96
+ localStateFields,
97
+ behaviorMatches: behaviorFields.length === 0,
98
+ comparedConfigurationMatches: !diffResult.hasChanges
99
+ };
100
+ }
101
+
102
+ // versions/react/adapters/ContextPoliciesAdapter.tsx
103
+ import { cn } from "@ai-matrx/design-system";
104
+
105
+ // versions/react/icons.tsx
106
+ import { jsx, jsxs } from "react/jsx-runtime";
107
+ function Glyph({ children, className, ...rest }) {
108
+ return /* @__PURE__ */ jsx(
109
+ "svg",
110
+ {
111
+ xmlns: "http://www.w3.org/2000/svg",
112
+ viewBox: "0 0 24 24",
113
+ fill: "none",
114
+ stroke: "currentColor",
115
+ strokeWidth: 2,
116
+ strokeLinecap: "round",
117
+ strokeLinejoin: "round",
118
+ "aria-hidden": "true",
119
+ focusable: "false",
120
+ className: className ?? "h-4 w-4",
121
+ ...rest,
122
+ children
123
+ }
124
+ );
125
+ }
126
+ var MessageSquare = ({ className }) => /* @__PURE__ */ jsx(Glyph, { className, children: /* @__PURE__ */ jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
127
+ var Webhook = ({ className }) => /* @__PURE__ */ jsxs(Glyph, { className, children: [
128
+ /* @__PURE__ */ jsx("path", { d: "M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2" }),
129
+ /* @__PURE__ */ jsx("path", { d: "m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06" }),
130
+ /* @__PURE__ */ jsx("path", { d: "m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8" })
131
+ ] });
132
+ var Layers = ({ className }) => /* @__PURE__ */ jsxs(Glyph, { className, children: [
133
+ /* @__PURE__ */ jsx("path", { d: "m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z" }),
134
+ /* @__PURE__ */ jsx("path", { d: "m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65" }),
135
+ /* @__PURE__ */ jsx("path", { d: "m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65" })
136
+ ] });
137
+ var Layers3 = Layers;
138
+ var Hammer = ({ className }) => /* @__PURE__ */ jsxs(Glyph, { className, children: [
139
+ /* @__PURE__ */ jsx("path", { d: "m15 12-8.5 8.5c-.83.83-2.17.83-3 0 0 0 0 0 0 0a2.12 2.12 0 0 1 0-3L12 9" }),
140
+ /* @__PURE__ */ jsx("path", { d: "M17.64 15 22 10.64" }),
141
+ /* @__PURE__ */ jsx("path", { d: "m20.91 11.7-1.25-1.25c-.6-.6-.93-1.4-.93-2.25v-.86L16.01 4.6a5.56 5.56 0 0 0-3.94-1.64H9l.92.82A6.18 6.18 0 0 1 12 8.4v1.56l2 2h2.47l2.26 1.91" })
142
+ ] });
143
+ var Server = ({ className }) => /* @__PURE__ */ jsxs(Glyph, { className, children: [
144
+ /* @__PURE__ */ jsx("rect", { width: "20", height: "8", x: "2", y: "2", rx: "2", ry: "2" }),
145
+ /* @__PURE__ */ jsx("rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", ry: "2" }),
146
+ /* @__PURE__ */ jsx("line", { x1: "6", x2: "6.01", y1: "6", y2: "6" }),
147
+ /* @__PURE__ */ jsx("line", { x1: "6", x2: "6.01", y1: "18", y2: "18" })
148
+ ] });
149
+ var Variable = ({ className }) => /* @__PURE__ */ jsxs(Glyph, { className, children: [
150
+ /* @__PURE__ */ jsx("path", { d: "M8 21s-4-3-4-9 4-9 4-9" }),
151
+ /* @__PURE__ */ jsx("path", { d: "M16 3s4 3 4 9-4 9-4 9" }),
152
+ /* @__PURE__ */ jsx("line", { x1: "15", x2: "9", y1: "9", y2: "15" }),
153
+ /* @__PURE__ */ jsx("line", { x1: "9", x2: "15", y1: "9", y2: "15" })
154
+ ] });
155
+ var Wrench = ({ className }) => /* @__PURE__ */ jsx(Glyph, { className, children: /* @__PURE__ */ jsx("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" }) });
156
+ var Settings = ({ className }) => /* @__PURE__ */ jsxs(Glyph, { className, children: [
157
+ /* @__PURE__ */ jsx("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
158
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" })
159
+ ] });
160
+ var Atom = ({ className }) => /* @__PURE__ */ jsxs(Glyph, { className, children: [
161
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "1" }),
162
+ /* @__PURE__ */ jsx("path", { d: "M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z" }),
163
+ /* @__PURE__ */ jsx("path", { d: "M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z" })
164
+ ] });
165
+ var ShieldAlert = ({ className }) => /* @__PURE__ */ jsxs(Glyph, { className, children: [
166
+ /* @__PURE__ */ jsx("path", { d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }),
167
+ /* @__PURE__ */ jsx("path", { d: "M12 8v4" }),
168
+ /* @__PURE__ */ jsx("path", { d: "M12 16h.01" })
169
+ ] });
170
+ var AlertTriangle = ({ className }) => /* @__PURE__ */ jsxs(Glyph, { className, children: [
171
+ /* @__PURE__ */ 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" }),
172
+ /* @__PURE__ */ jsx("path", { d: "M12 9v4" }),
173
+ /* @__PURE__ */ jsx("path", { d: "M12 17h.01" })
174
+ ] });
175
+ var LoaderSpin = ({ className }) => /* @__PURE__ */ jsx(Glyph, { className: `animate-spin ${className ?? "h-8 w-8"}`, children: /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
176
+
177
+ // versions/react/adapters/ContextPoliciesAdapter.tsx
178
+ import { InlineTextDiff } from "@ai-matrx/diff/react";
179
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
180
+ function formatPolicy(policy) {
181
+ if (!policy) return "\u2014";
182
+ const parts = [policy.key];
183
+ if (policy.type) parts.push(`[${policy.type}]`);
184
+ if (policy.label) parts.push(`"${policy.label}"`);
185
+ if (policy.description) parts.push(`
186
+ ${policy.description}`);
187
+ return parts.join(" ");
188
+ }
189
+ function ContextPoliciesDiffRenderer({ node }) {
190
+ if (!node.children || node.children.length === 0) {
191
+ const oldJson = node.oldValue != null ? JSON.stringify(node.oldValue, null, 2) : "\u2014";
192
+ const newJson = node.newValue != null ? JSON.stringify(node.newValue, null, 2) : "\u2014";
193
+ return /* @__PURE__ */ jsxs2("div", { className: "grid grid-cols-[200px_1fr_1fr] type-secondary", children: [
194
+ /* @__PURE__ */ jsx2("div", { className: "border-r border-border" }),
195
+ /* @__PURE__ */ jsx2("div", { className: "px-3 py-2 border-r border-border", children: /* @__PURE__ */ jsx2("pre", { className: "font-mono type-meta text-foreground/70", children: oldJson }) }),
196
+ /* @__PURE__ */ jsx2("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsx2("pre", { className: "font-mono type-meta text-foreground/70", children: newJson }) })
197
+ ] });
198
+ }
199
+ return /* @__PURE__ */ jsx2(Fragment, { children: node.children.map((child, i) => {
200
+ const oldPolicy = child.oldValue;
201
+ const newPolicy = child.newValue;
202
+ const policyKey = newPolicy?.key ?? oldPolicy?.key ?? child.key;
203
+ if (child.changeType === "modified" && oldPolicy && newPolicy) {
204
+ const oldText = formatPolicy(oldPolicy);
205
+ const newText = formatPolicy(newPolicy);
206
+ if (oldText !== "" && newText !== "") {
207
+ return /* @__PURE__ */ jsxs2(
208
+ "div",
209
+ {
210
+ className: "grid grid-cols-[200px_1fr] type-secondary border-t border-border/30",
211
+ children: [
212
+ /* @__PURE__ */ jsx2("div", { className: "px-3 py-1.5 border-r border-border text-muted-foreground pl-8 font-mono", children: policyKey }),
213
+ /* @__PURE__ */ jsx2("div", { className: "min-w-0 overflow-x-auto", children: /* @__PURE__ */ jsx2(InlineTextDiff, { original: oldText, modified: newText }) })
214
+ ]
215
+ },
216
+ child.key ?? i
217
+ );
218
+ }
219
+ }
220
+ return /* @__PURE__ */ jsxs2(
221
+ "div",
222
+ {
223
+ className: "grid grid-cols-[200px_1fr_1fr] type-secondary border-t border-border/30",
224
+ children: [
225
+ /* @__PURE__ */ jsx2("div", { className: "px-3 py-1.5 border-r border-border text-muted-foreground pl-8 font-mono", children: policyKey }),
226
+ /* @__PURE__ */ jsx2(
227
+ "div",
228
+ {
229
+ className: cn(
230
+ "px-3 py-1.5 border-r border-border whitespace-pre-wrap",
231
+ child.changeType === "removed" || child.changeType === "modified" ? "bg-destructive/10 text-destructive-ink bg-destructive/15" : "text-foreground/80",
232
+ child.changeType === "added" ? "text-muted-foreground/50" : ""
233
+ ),
234
+ children: formatPolicy(oldPolicy)
235
+ }
236
+ ),
237
+ /* @__PURE__ */ jsx2(
238
+ "div",
239
+ {
240
+ className: cn(
241
+ "px-3 py-1.5 whitespace-pre-wrap",
242
+ child.changeType === "added" || child.changeType === "modified" ? "bg-success/10 text-success-ink bg-success/15" : "text-foreground/80",
243
+ child.changeType === "removed" ? "text-muted-foreground/50" : ""
244
+ ),
245
+ children: formatPolicy(newPolicy)
246
+ }
247
+ )
248
+ ]
249
+ },
250
+ child.key ?? i
251
+ );
252
+ }) });
253
+ }
254
+ var ContextPoliciesAdapter = {
255
+ label: "Context Policies",
256
+ icon: Layers,
257
+ renderDiff: ContextPoliciesDiffRenderer,
258
+ toSummaryText: (node) => {
259
+ if (!node.children) return "Context policies changed";
260
+ const changed = node.children.filter(
261
+ (c) => c.changeType !== "unchanged"
262
+ ).length;
263
+ return `${changed} policy${changed !== 1 ? "s" : ""} changed`;
264
+ }
265
+ };
266
+
267
+ // versions/react/adapters/CustomToolsAdapter.tsx
268
+ import { cn as cn2 } from "@ai-matrx/design-system";
269
+ import { InlineTextDiff as InlineTextDiff2 } from "@ai-matrx/diff/react";
270
+ import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
271
+ import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
272
+ function formatCustomTool(tool) {
273
+ if (!tool) return "\u2014";
274
+ const parts = [tool.name];
275
+ if (tool.description) parts.push(`
276
+ ${tool.description}`);
277
+ if (tool.input_schema)
278
+ parts.push(`
279
+ Schema: ${JSON.stringify(tool.input_schema, null, 2)}`);
280
+ return parts.join("");
281
+ }
282
+ function CustomToolsDiffRenderer({ node }) {
283
+ if (!node.children || node.children.length === 0) {
284
+ const oldJson = JSON.stringify(node.oldValue, null, 2) ?? "\u2014";
285
+ const newJson = JSON.stringify(node.newValue, null, 2) ?? "\u2014";
286
+ return /* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-[200px_1fr_1fr] type-secondary", children: [
287
+ /* @__PURE__ */ jsx3("div", { className: "border-r border-border" }),
288
+ /* @__PURE__ */ jsx3("div", { className: "px-3 py-2 border-r border-border", children: /* @__PURE__ */ jsx3("pre", { className: "font-mono type-meta text-foreground/70", children: oldJson }) }),
289
+ /* @__PURE__ */ jsx3("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsx3("pre", { className: "font-mono type-meta text-foreground/70", children: newJson }) })
290
+ ] });
291
+ }
292
+ return /* @__PURE__ */ jsx3(Fragment2, { children: node.children.map((child, i) => {
293
+ const oldTool = child.oldValue;
294
+ const newTool = child.newValue;
295
+ const toolName = newTool?.name ?? oldTool?.name ?? `Unknown custom tool (${child.key ?? "missing id"})`;
296
+ if (child.changeType === "modified" && oldTool && newTool) {
297
+ const oldText = formatCustomTool(oldTool);
298
+ const newText = formatCustomTool(newTool);
299
+ if (oldText !== "" && newText !== "") {
300
+ return /* @__PURE__ */ jsxs3(
301
+ "div",
302
+ {
303
+ className: "grid grid-cols-[200px_1fr] type-secondary border-t border-border/30",
304
+ children: [
305
+ /* @__PURE__ */ jsx3("div", { className: "px-3 py-1.5 border-r border-border text-muted-foreground pl-8", children: humanizeIdentifier(toolName) }),
306
+ /* @__PURE__ */ jsx3("div", { className: "min-w-0 overflow-x-auto", children: /* @__PURE__ */ jsx3(InlineTextDiff2, { original: oldText, modified: newText }) })
307
+ ]
308
+ },
309
+ child.key ?? i
310
+ );
311
+ }
312
+ }
313
+ return /* @__PURE__ */ jsxs3(
314
+ "div",
315
+ {
316
+ className: "grid grid-cols-[200px_1fr_1fr] type-secondary border-t border-border/30",
317
+ children: [
318
+ /* @__PURE__ */ jsx3("div", { className: "px-3 py-1.5 border-r border-border text-muted-foreground pl-8", children: humanizeIdentifier(toolName) }),
319
+ /* @__PURE__ */ jsx3(
320
+ "div",
321
+ {
322
+ className: cn2(
323
+ "px-3 py-1.5 border-r border-border whitespace-pre-wrap font-mono type-meta",
324
+ child.changeType === "removed" || child.changeType === "modified" ? "bg-destructive/10 text-destructive-ink bg-destructive/15" : "text-foreground/70",
325
+ child.changeType === "added" ? "text-muted-foreground/50" : ""
326
+ ),
327
+ children: formatCustomTool(oldTool)
328
+ }
329
+ ),
330
+ /* @__PURE__ */ jsx3(
331
+ "div",
332
+ {
333
+ className: cn2(
334
+ "px-3 py-1.5 whitespace-pre-wrap font-mono type-meta",
335
+ child.changeType === "added" || child.changeType === "modified" ? "bg-success/10 text-success-ink bg-success/15" : "text-foreground/70",
336
+ child.changeType === "removed" ? "text-muted-foreground/50" : ""
337
+ ),
338
+ children: formatCustomTool(newTool)
339
+ }
340
+ )
341
+ ]
342
+ },
343
+ child.key ?? i
344
+ );
345
+ }) });
346
+ }
347
+ var CustomToolsAdapter = {
348
+ label: "Custom Tools",
349
+ icon: Hammer,
350
+ renderDiff: CustomToolsDiffRenderer,
351
+ toSummaryText: (node) => {
352
+ if (!node.children) return "Custom tools changed";
353
+ const changed = node.children.filter((c) => c.changeType !== "unchanged");
354
+ const added = changed.filter((c) => c.changeType === "added").length;
355
+ const removed = changed.filter((c) => c.changeType === "removed").length;
356
+ const modified = changed.filter((c) => c.changeType === "modified").length;
357
+ const parts = [];
358
+ if (added > 0) parts.push(`${added} added`);
359
+ if (removed > 0) parts.push(`${removed} removed`);
360
+ if (modified > 0) parts.push(`${modified} modified`);
361
+ return parts.join(", ") || "Custom tools changed";
362
+ }
363
+ };
364
+
365
+ // versions/react/adapters/McpServersAdapter.tsx
366
+ import { cn as cn3 } from "@ai-matrx/design-system";
367
+ import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
368
+ function resolveMcp(id, enrichment) {
369
+ return enrichment?.resolveMcpServerId(id) ?? id;
370
+ }
371
+ function McpServersDiffRenderer({ node, enrichment }) {
372
+ const oldServers = Array.isArray(node.oldValue) ? node.oldValue : [];
373
+ const newServers = Array.isArray(node.newValue) ? node.newValue : [];
374
+ const allIds = [.../* @__PURE__ */ new Set([...oldServers, ...newServers])];
375
+ return /* @__PURE__ */ jsx4(Fragment3, { children: allIds.map((id) => {
376
+ const inOld = oldServers.includes(id);
377
+ const inNew = newServers.includes(id);
378
+ const name = resolveMcp(id, enrichment);
379
+ const status = inOld && inNew ? "unchanged" : inOld ? "removed" : "added";
380
+ return /* @__PURE__ */ jsxs4(
381
+ "div",
382
+ {
383
+ className: "grid grid-cols-[200px_1fr_1fr] type-secondary border-t border-border/30",
384
+ children: [
385
+ /* @__PURE__ */ jsx4("div", { className: "px-3 py-1.5 border-r border-border text-muted-foreground pl-8 font-mono truncate", children: name }),
386
+ /* @__PURE__ */ jsx4(
387
+ "div",
388
+ {
389
+ className: cn3(
390
+ "px-3 py-1.5 border-r border-border",
391
+ status === "removed" ? "bg-destructive/10 text-destructive-ink bg-destructive/15" : "",
392
+ status === "added" ? "text-muted-foreground/50" : "",
393
+ status === "unchanged" ? "text-foreground/80" : ""
394
+ ),
395
+ children: inOld ? name : "\u2014"
396
+ }
397
+ ),
398
+ /* @__PURE__ */ jsx4(
399
+ "div",
400
+ {
401
+ className: cn3(
402
+ "px-3 py-1.5",
403
+ status === "added" ? "bg-success/10 text-success-ink bg-success/15" : "",
404
+ status === "removed" ? "text-muted-foreground/50" : "",
405
+ status === "unchanged" ? "text-foreground/80" : ""
406
+ ),
407
+ children: inNew ? name : "\u2014"
408
+ }
409
+ )
410
+ ]
411
+ },
412
+ id
413
+ );
414
+ }) });
415
+ }
416
+ var McpServersAdapter = {
417
+ label: "MCP Servers",
418
+ icon: Server,
419
+ renderDiff: McpServersDiffRenderer,
420
+ toSummaryText: (node, ctx) => {
421
+ const oldArr = Array.isArray(node.oldValue) ? node.oldValue : [];
422
+ const newArr = Array.isArray(node.newValue) ? node.newValue : [];
423
+ const added = newArr.filter((s) => !oldArr.includes(s));
424
+ const removed = oldArr.filter((s) => !newArr.includes(s));
425
+ const parts = [];
426
+ if (added.length > 0)
427
+ parts.push(
428
+ `Added: ${added.map((id) => ctx?.resolveMcpServerId(id) ?? id).join(", ")}`
429
+ );
430
+ if (removed.length > 0)
431
+ parts.push(
432
+ `Removed: ${removed.map((id) => ctx?.resolveMcpServerId(id) ?? id).join(", ")}`
433
+ );
434
+ return parts.join("; ") || "MCP servers changed";
435
+ }
436
+ };
437
+
438
+ // versions/react/adapters/MessagesAdapter.tsx
439
+ import { Badge } from "@ai-matrx/design-system/controls";
440
+ import { cn as cn4 } from "@ai-matrx/design-system";
441
+ import { InlineTextDiff as InlineTextDiff3 } from "@ai-matrx/diff/react";
442
+ import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
443
+ function extractText(msg) {
444
+ if (typeof msg.content === "string") return msg.content;
445
+ if (!Array.isArray(msg.content)) return "";
446
+ return msg.content.filter(
447
+ (b) => b.type === "text" && !!b.text
448
+ ).map((b) => b.text).join("\n");
449
+ }
450
+ function MessagesDiffRenderer({ node }) {
451
+ const oldMessages = Array.isArray(node.oldValue) ? node.oldValue : [];
452
+ const newMessages = Array.isArray(node.newValue) ? node.newValue : [];
453
+ if (node.children && node.children.length > 0) {
454
+ return /* @__PURE__ */ jsx5(Fragment4, { children: node.children.map((child, i) => /* @__PURE__ */ jsx5(MessageRow, { child, index: i }, child.key ?? i)) });
455
+ }
456
+ const maxLen = Math.max(oldMessages.length, newMessages.length);
457
+ return /* @__PURE__ */ jsx5(Fragment4, { children: Array.from({ length: maxLen }, (_, i) => {
458
+ const oldMsg = oldMessages[i];
459
+ const newMsg = newMessages[i];
460
+ const oldT = oldMsg ? extractText(oldMsg) : "";
461
+ const newT = newMsg ? extractText(newMsg) : "";
462
+ const roleLabel = /* @__PURE__ */ jsxs5(Fragment4, { children: [
463
+ "#",
464
+ i + 1,
465
+ " ",
466
+ (newMsg?.role ?? oldMsg?.role ?? "").toUpperCase()
467
+ ] });
468
+ if (oldMsg && newMsg && oldT !== "" && newT !== "" && oldT !== newT) {
469
+ return /* @__PURE__ */ jsxs5(
470
+ "div",
471
+ {
472
+ className: "grid grid-cols-[200px_1fr] type-secondary border-t border-border/30",
473
+ children: [
474
+ /* @__PURE__ */ jsx5("div", { className: "px-3 py-2 border-r border-border text-muted-foreground pl-8", children: roleLabel }),
475
+ /* @__PURE__ */ jsx5("div", { className: "min-w-0 overflow-x-auto", children: /* @__PURE__ */ jsx5(InlineTextDiff3, { original: oldT, modified: newT }) })
476
+ ]
477
+ },
478
+ i
479
+ );
480
+ }
481
+ return /* @__PURE__ */ jsxs5(
482
+ "div",
483
+ {
484
+ className: "grid grid-cols-[200px_1fr_1fr] type-secondary border-t border-border/30",
485
+ children: [
486
+ /* @__PURE__ */ jsx5("div", { className: "px-3 py-2 border-r border-border text-muted-foreground pl-8", children: roleLabel }),
487
+ /* @__PURE__ */ jsx5(
488
+ "div",
489
+ {
490
+ className: cn4(
491
+ "px-3 py-2 border-r border-border whitespace-pre-wrap",
492
+ !oldMsg ? "text-muted-foreground/50" : oldMsg && newMsg && extractText(oldMsg) !== extractText(newMsg) ? "bg-destructive/10 text-destructive-ink bg-destructive/15" : "text-foreground/80"
493
+ ),
494
+ children: oldMsg ? extractText(oldMsg) : "\u2014"
495
+ }
496
+ ),
497
+ /* @__PURE__ */ jsx5(
498
+ "div",
499
+ {
500
+ className: cn4(
501
+ "px-3 py-2 whitespace-pre-wrap",
502
+ !newMsg ? "text-muted-foreground/50" : oldMsg && newMsg && extractText(oldMsg) !== extractText(newMsg) ? "bg-success/10 text-success-ink bg-success/15" : "text-foreground/80"
503
+ ),
504
+ children: newMsg ? extractText(newMsg) : "\u2014"
505
+ }
506
+ )
507
+ ]
508
+ },
509
+ i
510
+ );
511
+ }) });
512
+ }
513
+ function MessageRow({ child, index }) {
514
+ const oldMsg = child.oldValue;
515
+ const newMsg = child.newValue;
516
+ const role = (newMsg?.role ?? oldMsg?.role ?? "unknown").toUpperCase();
517
+ const oldText = oldMsg ? extractText(oldMsg) : "";
518
+ const newText = newMsg ? extractText(newMsg) : "";
519
+ const roleBadge = /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-1", children: [
520
+ /* @__PURE__ */ jsxs5("span", { children: [
521
+ "#",
522
+ index + 1
523
+ ] }),
524
+ /* @__PURE__ */ jsx5(
525
+ Badge,
526
+ {
527
+ tone: child.changeType === "added" ? "success" : child.changeType === "removed" ? "destructive" : "neutral",
528
+ children: role
529
+ }
530
+ )
531
+ ] });
532
+ if (child.changeType === "modified" && oldText !== "" && newText !== "") {
533
+ return /* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-[200px_1fr] type-secondary border-t border-border/30", children: [
534
+ /* @__PURE__ */ jsx5("div", { className: "px-3 py-2 border-r border-border text-muted-foreground pl-8", children: roleBadge }),
535
+ /* @__PURE__ */ jsx5("div", { className: "min-w-0 overflow-x-auto", children: /* @__PURE__ */ jsx5(InlineTextDiff3, { original: oldText, modified: newText }) })
536
+ ] });
537
+ }
538
+ return /* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-[200px_1fr_1fr] type-secondary border-t border-border/30", children: [
539
+ /* @__PURE__ */ jsx5("div", { className: "px-3 py-2 border-r border-border text-muted-foreground pl-8", children: roleBadge }),
540
+ /* @__PURE__ */ jsx5(
541
+ "div",
542
+ {
543
+ className: cn4(
544
+ "px-3 py-2 border-r border-border whitespace-pre-wrap break-words",
545
+ child.changeType === "removed" ? "bg-destructive/10 text-destructive-ink bg-destructive/15" : "",
546
+ child.changeType === "added" ? "text-muted-foreground/50" : "",
547
+ child.changeType === "unchanged" ? "text-foreground/80" : ""
548
+ ),
549
+ children: oldText !== "" ? oldText : "\u2014"
550
+ }
551
+ ),
552
+ /* @__PURE__ */ jsx5(
553
+ "div",
554
+ {
555
+ className: cn4(
556
+ "px-3 py-2 whitespace-pre-wrap break-words",
557
+ child.changeType === "added" ? "bg-success/10 text-success-ink bg-success/15" : "",
558
+ child.changeType === "removed" ? "text-muted-foreground/50" : "",
559
+ child.changeType === "unchanged" ? "text-foreground/80" : ""
560
+ ),
561
+ children: newText !== "" ? newText : "\u2014"
562
+ }
563
+ )
564
+ ] });
565
+ }
566
+ var MessagesAdapter = {
567
+ label: "Messages",
568
+ icon: MessageSquare,
569
+ renderDiff: MessagesDiffRenderer,
570
+ toSummaryText: (node) => {
571
+ const oldArr = Array.isArray(node.oldValue) ? node.oldValue : [];
572
+ const newArr = Array.isArray(node.newValue) ? node.newValue : [];
573
+ if (oldArr.length !== newArr.length) {
574
+ const diff = newArr.length - oldArr.length;
575
+ return diff > 0 ? `${diff} message${diff !== 1 ? "s" : ""} added` : `${Math.abs(diff)} message${Math.abs(diff) !== 1 ? "s" : ""} removed`;
576
+ }
577
+ if (node.children) {
578
+ const changed = node.children.filter(
579
+ (c) => c.changeType !== "unchanged"
580
+ ).length;
581
+ return `${changed} message${changed !== 1 ? "s" : ""} modified`;
582
+ }
583
+ return "Messages changed";
584
+ }
585
+ };
586
+
587
+ // versions/react/adapters/ModelAdapter.tsx
588
+ import { cn as cn5 } from "@ai-matrx/design-system";
589
+
590
+ // versions/react/refs.tsx
591
+ import { createContext, useContext } from "react";
592
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
593
+ function PlainRef({ id, name, showId, className }) {
594
+ const label = name && name !== id ? name : null;
595
+ return /* @__PURE__ */ jsxs6("span", { className, children: [
596
+ label ? /* @__PURE__ */ jsx6("span", { className: "font-medium", children: label }) : null,
597
+ label && showId ? " " : null,
598
+ !label || showId ? /* @__PURE__ */ jsx6("span", { className: "select-all break-all font-mono type-meta text-muted-foreground", children: id }) : null
599
+ ] });
600
+ }
601
+ var DefaultModelRef = ({ modelId, name, showId, className }) => /* @__PURE__ */ jsx6(PlainRef, { id: modelId, name, showId, className });
602
+ var DefaultToolRef = ({ toolId, name, showId, className }) => /* @__PURE__ */ jsx6(PlainRef, { id: toolId, name, showId, className });
603
+ var RefsContext = createContext({ ModelRef: DefaultModelRef, ToolRef: DefaultToolRef });
604
+ function AgentDiffRefsProvider({ refs, children }) {
605
+ return /* @__PURE__ */ jsx6(RefsContext.Provider, { value: { ModelRef: refs?.ModelRef ?? DefaultModelRef, ToolRef: refs?.ToolRef ?? DefaultToolRef }, children });
606
+ }
607
+ function useAgentDiffRefs() {
608
+ return useContext(RefsContext);
609
+ }
610
+
611
+ // versions/react/adapters/ModelAdapter.tsx
612
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
613
+ function ModelDiffRenderer({ node, enrichment }) {
614
+ const { ModelRef } = useAgentDiffRefs();
615
+ const oldId = typeof node.oldValue === "string" ? node.oldValue : null;
616
+ const newId = typeof node.newValue === "string" ? node.newValue : null;
617
+ const oldName = oldId ? enrichment?.resolveModelId(oldId) : null;
618
+ const newName = newId ? enrichment?.resolveModelId(newId) : null;
619
+ return /* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-[200px_1fr_1fr] type-secondary", children: [
620
+ /* @__PURE__ */ jsx7("div", { className: "border-r border-border" }),
621
+ /* @__PURE__ */ jsx7(
622
+ "div",
623
+ {
624
+ className: cn5(
625
+ "px-3 py-2 border-r border-border",
626
+ node.changeType !== "unchanged" ? "bg-destructive/10 bg-destructive/15" : ""
627
+ ),
628
+ children: oldId ? /* @__PURE__ */ jsx7(
629
+ ModelRef,
630
+ {
631
+ modelId: oldId,
632
+ name: oldName,
633
+ showId: true,
634
+ className: cn5(
635
+ node.changeType !== "unchanged" ? "text-destructive" : "text-foreground/80"
636
+ )
637
+ }
638
+ ) : /* @__PURE__ */ jsx7("span", { className: "text-muted-foreground", children: "Default" })
639
+ }
640
+ ),
641
+ /* @__PURE__ */ jsx7(
642
+ "div",
643
+ {
644
+ className: cn5(
645
+ "px-3 py-2",
646
+ node.changeType !== "unchanged" ? "bg-success/10 bg-success/15" : ""
647
+ ),
648
+ children: newId ? /* @__PURE__ */ jsx7(
649
+ ModelRef,
650
+ {
651
+ modelId: newId,
652
+ name: newName,
653
+ showId: true,
654
+ className: cn5(
655
+ node.changeType !== "unchanged" ? "text-success" : "text-foreground/80"
656
+ )
657
+ }
658
+ ) : /* @__PURE__ */ jsx7("span", { className: "text-muted-foreground", children: "Default" })
659
+ }
660
+ )
661
+ ] });
662
+ }
663
+ var ModelAdapter = {
664
+ label: "Model",
665
+ icon: Webhook,
666
+ renderDiff: ModelDiffRenderer,
667
+ toSummaryText: (node, ctx) => {
668
+ const oldId = typeof node.oldValue === "string" ? node.oldValue : null;
669
+ const newId = typeof node.newValue === "string" ? node.newValue : null;
670
+ const resolvedOld = oldId ? ctx?.resolveModelId(oldId) : null;
671
+ const resolvedNew = newId ? ctx?.resolveModelId(newId) : null;
672
+ const oldName = oldId ? resolvedOld && resolvedOld !== oldId ? resolvedOld : `Unknown AI model (${oldId})` : "Default";
673
+ const newName = newId ? resolvedNew && resolvedNew !== newId ? resolvedNew : `Unknown AI model (${newId})` : "Default";
674
+ return `${oldName} \u2192 ${newName}`;
675
+ }
676
+ };
677
+
678
+ // versions/react/adapters/ModelTiersAdapter.tsx
679
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
680
+ function isRecord(value) {
681
+ return typeof value === "object" && value !== null && !Array.isArray(value);
682
+ }
683
+ function readModelTierIdentities(value) {
684
+ if (!isRecord(value)) return [];
685
+ const identities = [];
686
+ if (typeof value.default === "string" && value.default.trim()) {
687
+ identities.push({ key: "default", role: "Default", modelId: value.default });
688
+ }
689
+ if (isRecord(value.tiers)) {
690
+ for (const [tierKey, rawTier] of Object.entries(value.tiers)) {
691
+ if (!isRecord(rawTier) || typeof rawTier.modelId !== "string") continue;
692
+ const label = typeof rawTier.label === "string" && rawTier.label.trim() ? rawTier.label : tierKey;
693
+ identities.push({ key: `tier:${tierKey}`, role: label, modelId: rawTier.modelId });
694
+ }
695
+ }
696
+ return identities;
697
+ }
698
+ function ModelTierIdentityList({ value }) {
699
+ const { ModelRef } = useAgentDiffRefs();
700
+ const identities = readModelTierIdentities(value);
701
+ if (identities.length === 0) {
702
+ return /* @__PURE__ */ jsx8("span", { className: "text-muted-foreground", children: "No model tiers" });
703
+ }
704
+ return /* @__PURE__ */ jsx8("span", { className: "flex flex-col gap-1.5", children: identities.map((identity) => /* @__PURE__ */ jsxs8("span", { className: "grid min-w-0 grid-cols-[5rem_minmax(0,1fr)] items-start gap-2", children: [
705
+ /* @__PURE__ */ jsx8("span", { className: "text-muted-foreground", children: identity.role }),
706
+ /* @__PURE__ */ jsx8(ModelRef, { modelId: identity.modelId, showId: true })
707
+ ] }, identity.key)) });
708
+ }
709
+ function ModelTiersDiffRenderer({ node }) {
710
+ return /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-[200px_1fr_1fr] type-secondary", children: [
711
+ /* @__PURE__ */ jsx8("div", { className: "border-r border-border" }),
712
+ /* @__PURE__ */ jsx8("div", { className: "border-r border-border px-3 py-2", children: /* @__PURE__ */ jsx8(ModelTierIdentityList, { value: node.oldValue }) }),
713
+ /* @__PURE__ */ jsx8("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsx8(ModelTierIdentityList, { value: node.newValue }) })
714
+ ] });
715
+ }
716
+ function summarizeTiers(value, enrichment) {
717
+ const identities = readModelTierIdentities(value);
718
+ if (identities.length === 0) return "none";
719
+ return identities.map(({ role, modelId }) => {
720
+ const name = enrichment?.resolveModelId(modelId);
721
+ return `${role}: ${name ?? `Unknown AI model (${modelId})`}`;
722
+ }).join(", ");
723
+ }
724
+ var ModelTiersAdapter = {
725
+ label: "Model Tiers",
726
+ icon: Layers3,
727
+ renderDiff: ModelTiersDiffRenderer,
728
+ toSummaryText: (node, enrichment) => `${summarizeTiers(node.oldValue, enrichment)} \u2192 ${summarizeTiers(node.newValue, enrichment)}`
729
+ };
730
+
731
+ // versions/react/adapters/SettingsAdapter.tsx
732
+ import { cn as cn6 } from "@ai-matrx/design-system";
733
+ import {
734
+ filterChanges,
735
+ formatValue
736
+ } from "@ai-matrx/diff/structural";
737
+ import { humanizeIdentifier as humanizeIdentifier2 } from "@ai-matrx/kit/text-case";
738
+ import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
739
+ function SettingsDiffRenderer({ node }) {
740
+ const entries = node.children ?? buildEntries();
741
+ function buildEntries() {
742
+ const oldSettings = node.oldValue ?? {};
743
+ const newSettings = node.newValue ?? {};
744
+ const allKeys = [
745
+ .../* @__PURE__ */ new Set([...Object.keys(oldSettings), ...Object.keys(newSettings)])
746
+ ];
747
+ return allKeys.map((key) => ({
748
+ path: [key],
749
+ key,
750
+ changeType: JSON.stringify(oldSettings[key]) === JSON.stringify(newSettings[key]) ? "unchanged" : "modified",
751
+ oldValue: oldSettings[key],
752
+ newValue: newSettings[key]
753
+ }));
754
+ }
755
+ return /* @__PURE__ */ jsx9(Fragment5, { children: entries.map((child) => {
756
+ const oldVal = child.oldValue != null ? formatValue(child.oldValue) : "\u2014";
757
+ const newVal = child.newValue != null ? formatValue(child.newValue) : "\u2014";
758
+ const changed = child.changeType !== "unchanged";
759
+ return /* @__PURE__ */ jsxs9(
760
+ "div",
761
+ {
762
+ className: "grid grid-cols-[200px_1fr_1fr] type-secondary border-t border-border/30",
763
+ children: [
764
+ /* @__PURE__ */ jsx9("div", { className: "px-3 py-1.5 border-r border-border text-muted-foreground pl-8", children: humanizeIdentifier2(child.key) }),
765
+ /* @__PURE__ */ jsx9(
766
+ "div",
767
+ {
768
+ className: cn6(
769
+ "px-3 py-1.5 border-r border-border",
770
+ changed && child.changeType !== "added" ? "bg-destructive/10 text-destructive-ink bg-destructive/15" : "text-foreground/80",
771
+ child.changeType === "added" ? "text-muted-foreground/50" : ""
772
+ ),
773
+ children: oldVal
774
+ }
775
+ ),
776
+ /* @__PURE__ */ jsx9(
777
+ "div",
778
+ {
779
+ className: cn6(
780
+ "px-3 py-1.5",
781
+ changed && child.changeType !== "removed" ? "bg-success/10 text-success-ink bg-success/15" : "text-foreground/80",
782
+ child.changeType === "removed" ? "text-muted-foreground/50" : ""
783
+ ),
784
+ children: newVal
785
+ }
786
+ )
787
+ ]
788
+ },
789
+ child.key
790
+ );
791
+ }) });
792
+ }
793
+ var SettingsAdapter = {
794
+ label: "Settings",
795
+ icon: Settings,
796
+ renderDiff: SettingsDiffRenderer,
797
+ toSummaryText: (node) => {
798
+ if (node.children) {
799
+ const changed = filterChanges(node.children);
800
+ if (changed.length === 1) {
801
+ const c = changed[0];
802
+ return `${c.key}: ${formatValue(c.oldValue)} \u2192 ${formatValue(c.newValue)}`;
803
+ }
804
+ return `${changed.length} setting${changed.length !== 1 ? "s" : ""} changed`;
805
+ }
806
+ return "Settings changed";
807
+ }
808
+ };
809
+
810
+ // versions/react/adapters/ToolsAdapter.tsx
811
+ import { cn as cn7 } from "@ai-matrx/design-system";
812
+ import { Fragment as Fragment6, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
813
+ function resolveTool(id, enrichment) {
814
+ return enrichment?.resolveToolId(id) ?? id;
815
+ }
816
+ function summarizeTool(id, enrichment) {
817
+ const name = enrichment?.resolveToolId(id);
818
+ return name && name !== id ? name : `Unknown tool (${id})`;
819
+ }
820
+ function ToolsDiffRenderer({ node, enrichment }) {
821
+ const { ToolRef } = useAgentDiffRefs();
822
+ const oldTools = Array.isArray(node.oldValue) ? node.oldValue : [];
823
+ const newTools = Array.isArray(node.newValue) ? node.newValue : [];
824
+ const allToolIds = [.../* @__PURE__ */ new Set([...oldTools, ...newTools])];
825
+ return /* @__PURE__ */ jsx10(Fragment6, { children: allToolIds.map((id) => {
826
+ const inOld = oldTools.includes(id);
827
+ const inNew = newTools.includes(id);
828
+ const name = resolveTool(id, enrichment);
829
+ const status = inOld && inNew ? "unchanged" : inOld ? "removed" : "added";
830
+ return /* @__PURE__ */ jsxs10(
831
+ "div",
832
+ {
833
+ className: "grid grid-cols-[200px_1fr_1fr] type-secondary border-t border-border/30",
834
+ children: [
835
+ /* @__PURE__ */ jsx10("div", { className: "px-3 py-1.5 border-r border-border text-muted-foreground pl-8 min-w-0", children: /* @__PURE__ */ jsx10(ToolRef, { toolId: id, name: name === id ? void 0 : name, showId: true }) }),
836
+ /* @__PURE__ */ jsx10(
837
+ "div",
838
+ {
839
+ className: cn7(
840
+ "px-3 py-1.5 border-r border-border",
841
+ status === "removed" ? "bg-destructive/10 text-destructive-ink bg-destructive/15" : "",
842
+ status === "added" ? "text-muted-foreground/50" : "",
843
+ status === "unchanged" ? "text-foreground/80" : ""
844
+ ),
845
+ children: inOld ? /* @__PURE__ */ jsx10(ToolRef, { toolId: id, name: name === id ? void 0 : name }) : "\u2014"
846
+ }
847
+ ),
848
+ /* @__PURE__ */ jsx10(
849
+ "div",
850
+ {
851
+ className: cn7(
852
+ "px-3 py-1.5",
853
+ status === "added" ? "bg-success/10 text-success-ink bg-success/15" : "",
854
+ status === "removed" ? "text-muted-foreground/50" : "",
855
+ status === "unchanged" ? "text-foreground/80" : ""
856
+ ),
857
+ children: inNew ? /* @__PURE__ */ jsx10(ToolRef, { toolId: id, name: name === id ? void 0 : name }) : "\u2014"
858
+ }
859
+ )
860
+ ]
861
+ },
862
+ id
863
+ );
864
+ }) });
865
+ }
866
+ var ToolsAdapter = {
867
+ label: "Tools",
868
+ icon: Wrench,
869
+ renderDiff: ToolsDiffRenderer,
870
+ toSummaryText: (node, ctx) => {
871
+ const oldArr = Array.isArray(node.oldValue) ? node.oldValue : [];
872
+ const newArr = Array.isArray(node.newValue) ? node.newValue : [];
873
+ const added = newArr.filter((t) => !oldArr.includes(t));
874
+ const removed = oldArr.filter((t) => !newArr.includes(t));
875
+ const parts = [];
876
+ if (added.length > 0)
877
+ parts.push(
878
+ `Added: ${added.map((id) => summarizeTool(id, ctx)).join(", ")}`
879
+ );
880
+ if (removed.length > 0)
881
+ parts.push(
882
+ `Removed: ${removed.map((id) => summarizeTool(id, ctx)).join(", ")}`
883
+ );
884
+ return parts.join("; ") || "Tools changed";
885
+ }
886
+ };
887
+
888
+ // versions/react/adapters/VariablesAdapter.tsx
889
+ import { cn as cn8 } from "@ai-matrx/design-system";
890
+ import {
891
+ formatValue as formatValue2
892
+ } from "@ai-matrx/diff/structural";
893
+ import { InlineTextDiff as InlineTextDiff4 } from "@ai-matrx/diff/react";
894
+ import { Fragment as Fragment7, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
895
+ function formatVar(v) {
896
+ if (!v) return "\u2014";
897
+ const parts = [`{{${v.name}}}`];
898
+ if (v.type) parts.push(`[${v.type}]`);
899
+ if (v.defaultValue !== void 0)
900
+ parts.push(`= ${formatValue2(v.defaultValue)}`);
901
+ if (v.required) parts.push("(required)");
902
+ if (v.helpText) parts.push(`
903
+ ${v.helpText}`);
904
+ return parts.join(" ");
905
+ }
906
+ function VariablesDiffRenderer({ node }) {
907
+ if (node.children && node.children.length > 0) {
908
+ return /* @__PURE__ */ jsx11(Fragment7, { children: node.children.map((child, i) => /* @__PURE__ */ jsx11(VariableRow, { child }, child.key ?? i)) });
909
+ }
910
+ const oldVars = Array.isArray(node.oldValue) ? node.oldValue : [];
911
+ const newVars = Array.isArray(node.newValue) ? node.newValue : [];
912
+ const maxLen = Math.max(oldVars.length, newVars.length);
913
+ return /* @__PURE__ */ jsx11(Fragment7, { children: Array.from({ length: maxLen }, (_, i) => {
914
+ const oldVar = oldVars[i];
915
+ const newVar = newVars[i];
916
+ const changed = JSON.stringify(oldVar) !== JSON.stringify(newVar);
917
+ return /* @__PURE__ */ jsxs11(
918
+ "div",
919
+ {
920
+ className: "grid grid-cols-[200px_1fr_1fr] type-secondary border-t border-border/30",
921
+ children: [
922
+ /* @__PURE__ */ jsx11("div", { className: "px-3 py-1.5 border-r border-border text-muted-foreground pl-8 font-mono", children: newVar?.name ?? oldVar?.name ?? `#${i + 1}` }),
923
+ /* @__PURE__ */ jsx11(
924
+ "div",
925
+ {
926
+ className: cn8(
927
+ "px-3 py-1.5 border-r border-border whitespace-pre-wrap",
928
+ changed && oldVar ? "bg-destructive/10 text-destructive-ink bg-destructive/15" : "text-foreground/80",
929
+ !oldVar ? "text-muted-foreground/50" : ""
930
+ ),
931
+ children: formatVar(oldVar)
932
+ }
933
+ ),
934
+ /* @__PURE__ */ jsx11(
935
+ "div",
936
+ {
937
+ className: cn8(
938
+ "px-3 py-1.5 whitespace-pre-wrap",
939
+ changed && newVar ? "bg-success/10 text-success-ink bg-success/15" : "text-foreground/80",
940
+ !newVar ? "text-muted-foreground/50" : ""
941
+ ),
942
+ children: formatVar(newVar)
943
+ }
944
+ )
945
+ ]
946
+ },
947
+ i
948
+ );
949
+ }) });
950
+ }
951
+ function VariableRow({ child }) {
952
+ const oldVar = child.oldValue;
953
+ const newVar = child.newValue;
954
+ const varName = newVar?.name ?? oldVar?.name ?? child.key;
955
+ if (child.changeType === "modified" && oldVar && newVar) {
956
+ const oldText = formatVar(oldVar);
957
+ const newText = formatVar(newVar);
958
+ if (oldText !== "" && newText !== "") {
959
+ return /* @__PURE__ */ jsxs11("div", { className: "grid grid-cols-[200px_1fr] type-secondary border-t border-border/30", children: [
960
+ /* @__PURE__ */ jsx11("div", { className: "px-3 py-1.5 border-r border-border text-muted-foreground pl-8 font-mono", children: "{{" + varName + "}}" }),
961
+ /* @__PURE__ */ jsx11("div", { className: "min-w-0 overflow-x-auto", children: /* @__PURE__ */ jsx11(InlineTextDiff4, { original: oldText, modified: newText }) })
962
+ ] });
963
+ }
964
+ }
965
+ return /* @__PURE__ */ jsxs11("div", { className: "grid grid-cols-[200px_1fr_1fr] type-secondary border-t border-border/30", children: [
966
+ /* @__PURE__ */ jsx11("div", { className: "px-3 py-1.5 border-r border-border text-muted-foreground pl-8 font-mono", children: "{{" + varName + "}}" }),
967
+ /* @__PURE__ */ jsx11(
968
+ "div",
969
+ {
970
+ className: cn8(
971
+ "px-3 py-1.5 border-r border-border whitespace-pre-wrap",
972
+ child.changeType === "removed" ? "bg-destructive/10 text-destructive-ink bg-destructive/15" : "",
973
+ child.changeType === "modified" ? "bg-destructive/10 text-destructive-ink bg-destructive/15" : "",
974
+ child.changeType === "added" ? "text-muted-foreground/50" : "",
975
+ child.changeType === "unchanged" ? "text-foreground/80" : ""
976
+ ),
977
+ children: formatVar(oldVar)
978
+ }
979
+ ),
980
+ /* @__PURE__ */ jsx11(
981
+ "div",
982
+ {
983
+ className: cn8(
984
+ "px-3 py-1.5 whitespace-pre-wrap",
985
+ child.changeType === "added" ? "bg-success/10 text-success-ink bg-success/15" : "",
986
+ child.changeType === "modified" ? "bg-success/10 text-success-ink bg-success/15" : "",
987
+ child.changeType === "removed" ? "text-muted-foreground/50" : "",
988
+ child.changeType === "unchanged" ? "text-foreground/80" : ""
989
+ ),
990
+ children: formatVar(newVar)
991
+ }
992
+ )
993
+ ] });
994
+ }
995
+ var VariablesAdapter = {
996
+ label: "Variables",
997
+ icon: Variable,
998
+ renderDiff: VariablesDiffRenderer,
999
+ toSummaryText: (node) => {
1000
+ if (!node.children) return "Variables changed";
1001
+ const changed = node.children.filter((c) => c.changeType !== "unchanged");
1002
+ const added = changed.filter((c) => c.changeType === "added").length;
1003
+ const removed = changed.filter((c) => c.changeType === "removed").length;
1004
+ const modified = changed.filter((c) => c.changeType === "modified").length;
1005
+ const parts = [];
1006
+ if (added > 0) parts.push(`${added} added`);
1007
+ if (removed > 0) parts.push(`${removed} removed`);
1008
+ if (modified > 0) parts.push(`${modified} modified`);
1009
+ return parts.join(", ") || "Variables changed";
1010
+ }
1011
+ };
1012
+
1013
+ // versions/react/AgentDiffViewer.tsx
1014
+ import { jsx as jsx12 } from "react/jsx-runtime";
1015
+ function buildAgentAdapterRegistry() {
1016
+ const registry = createAdapterRegistry();
1017
+ registry.register("messages", MessagesAdapter);
1018
+ registry.register("modelId", ModelAdapter);
1019
+ registry.register("tools", ToolsAdapter);
1020
+ registry.register("settings", SettingsAdapter);
1021
+ registry.register("variableDefinitions", VariablesAdapter);
1022
+ registry.register("contextPolicies", ContextPoliciesAdapter);
1023
+ registry.register("customTools", CustomToolsAdapter);
1024
+ registry.register("mcpServers", McpServersAdapter);
1025
+ registry.register("name", { ...TextFieldAdapter, label: "Name" });
1026
+ registry.register("description", { ...TextFieldAdapter, label: "Description" });
1027
+ registry.register("category", { ...TextFieldAdapter, label: "Category" });
1028
+ registry.register("tags", { ...TagsFieldAdapter, label: "Tags" });
1029
+ registry.register("isActive", { ...BooleanFieldAdapter, label: "Active" });
1030
+ registry.register("isArchived", { ...BooleanFieldAdapter, label: "Archived" });
1031
+ registry.register("isFavorite", { ...BooleanFieldAdapter, label: "Favorite" });
1032
+ registry.register("autoToolsDisabled", { ...BooleanFieldAdapter, label: "Automatic Tool Injection Disabled" });
1033
+ registry.register("version", { ...TextFieldAdapter, label: "Version" });
1034
+ registry.register("changeNote", { ...TextFieldAdapter, label: "Change Note" });
1035
+ registry.register("defaultRagBoost", { ...TextFieldAdapter, label: "Default Knowledge Boost" });
1036
+ registry.register("ragAwarenessMode", { ...TextFieldAdapter, label: "Knowledge Awareness Mode" });
1037
+ registry.register("modelTiers", ModelTiersAdapter);
1038
+ registry.register("outputSchema", { ...JsonObjectAdapter, label: "Output Schema" });
1039
+ registry.register("skillConfig", { ...JsonObjectAdapter, label: "Skill Configuration" });
1040
+ registry.register("uiGates", { ...JsonObjectAdapter, label: "UI Gates" });
1041
+ registry.register("matrxDirectives", { ...JsonObjectAdapter, label: "Matrx Directives" });
1042
+ return registry;
1043
+ }
1044
+ function AgentDiffViewer({
1045
+ oldAgent,
1046
+ newAgent,
1047
+ oldLabel,
1048
+ newLabel,
1049
+ temporalMetadata,
1050
+ defaultMode = "changes-only",
1051
+ className,
1052
+ enrichment,
1053
+ refs
1054
+ }) {
1055
+ const adapters = useMemo(() => buildAgentAdapterRegistry(), []);
1056
+ const diffResult = useMemo(() => compareAgentDefinitions(oldAgent, newAgent).diffResult, [oldAgent, newAgent]);
1057
+ return /* @__PURE__ */ jsx12(AgentDiffRefsProvider, { refs, children: /* @__PURE__ */ jsx12(
1058
+ DiffViewerShell,
1059
+ {
1060
+ diffResult,
1061
+ oldValue: oldAgent,
1062
+ newValue: newAgent,
1063
+ oldLabel,
1064
+ newLabel,
1065
+ adapters,
1066
+ ...enrichment ? { enrichment } : {},
1067
+ ...temporalMetadata ? { temporalMetadata } : {},
1068
+ defaultMode,
1069
+ ...className ? { className } : {}
1070
+ }
1071
+ ) });
1072
+ }
1073
+
1074
+ // versions/react/VersionHistoryTimeline.tsx
1075
+ import { useState } from "react";
1076
+ import { Badge as Badge2, Button, Chip, ChipSet } from "@ai-matrx/design-system/controls";
1077
+ import {
1078
+ DropdownMenu,
1079
+ DropdownMenuContent,
1080
+ DropdownMenuItem,
1081
+ DropdownMenuTrigger
1082
+ } from "@ai-matrx/design-system";
1083
+ import {
1084
+ MatrxVersionTimeline
1085
+ } from "@ai-matrx/design-system/data-table";
1086
+ import { RecordId } from "@ai-matrx/design-system";
1087
+ import { humanizeIdentifier as humanizeIdentifier3 } from "@ai-matrx/kit/text-case";
1088
+ import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1089
+ var SILENT = { success: () => {
1090
+ }, error: () => {
1091
+ } };
1092
+ function VersionHistoryTimeline({
1093
+ agentId,
1094
+ versions,
1095
+ currentVersion,
1096
+ onCompare,
1097
+ history,
1098
+ onDeclareContractBreak,
1099
+ notify = SILENT,
1100
+ rowActions,
1101
+ footer = null,
1102
+ ErrorMenu
1103
+ }) {
1104
+ const {
1105
+ enrichedVersions,
1106
+ loading: enrichLoading,
1107
+ progress,
1108
+ failedVersions,
1109
+ failureReason,
1110
+ fetchEnrichedHistory,
1111
+ fetchGap
1112
+ } = history;
1113
+ const breakPorts = { onDeclare: onDeclareContractBreak, notify };
1114
+ const hasEnrichedData = enrichedVersions.some((v) => v.diffSummary);
1115
+ const entries = (enriched) => enrichedVersions.map((version) => {
1116
+ const changedFields = version.diffSummary?.root.filter((n) => n.changeType !== "unchanged") ?? [];
1117
+ return {
1118
+ number: version.version_number,
1119
+ versionId: version.version_id,
1120
+ idCell: /* @__PURE__ */ jsx13(RecordId, { value: version.version_id, label: "Version" }),
1121
+ at: version.changed_at,
1122
+ note: version.change_note ?? null,
1123
+ loaded: enriched ? version.snapshotLoaded : false,
1124
+ changes: enriched ? /* @__PURE__ */ jsx13(VersionChanges, { version, ports: breakPorts }) : /* @__PURE__ */ jsxs12("div", { className: "space-y-1", children: [
1125
+ /* @__PURE__ */ jsx13(ContractBreak, { version, ports: breakPorts }),
1126
+ /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "Not loaded" })
1127
+ ] }),
1128
+ changesText: changedFields.map((n) => humanizeIdentifier3(n.key) || n.key).join(", ") || null
1129
+ };
1130
+ });
1131
+ const timeline = (enriched) => /* @__PURE__ */ jsx13(
1132
+ MatrxVersionTimeline,
1133
+ {
1134
+ tableId: `agent.${agentId}.versions`,
1135
+ versions: entries(enriched),
1136
+ currentNumber: currentVersion,
1137
+ onCompare,
1138
+ ...enriched ? { onLoad: (numbers) => void fetchGap(numbers) } : {},
1139
+ ...rowActions ? { rowActions } : {},
1140
+ emptyState: { title: "No version history" }
1141
+ }
1142
+ );
1143
+ if (versions.length === 0) {
1144
+ return /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center py-12 type-body text-muted-foreground", children: "No version history" });
1145
+ }
1146
+ if (!hasEnrichedData && !enrichLoading) {
1147
+ return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-center justify-center py-16 gap-4", children: [
1148
+ /* @__PURE__ */ jsxs12("div", { className: "text-center", children: [
1149
+ /* @__PURE__ */ jsxs12("div", { className: "type-title mb-1", children: [
1150
+ versions.length,
1151
+ " version",
1152
+ versions.length !== 1 ? "s" : "",
1153
+ " ",
1154
+ "available"
1155
+ ] }),
1156
+ /* @__PURE__ */ jsx13("p", { className: "type-secondary text-muted-foreground max-w-[320px]", children: "Load history to see what changed in each version" })
1157
+ ] }),
1158
+ failedVersions.length > 0 && /* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-2 max-w-[420px] px-3 py-2 rounded-md border border-destructive/30 bg-destructive/10 type-secondary text-destructive-ink", children: [
1159
+ /* @__PURE__ */ jsx13(AlertTriangle, { className: "w-3.5 h-3.5 mt-0.5 shrink-0" }),
1160
+ /* @__PURE__ */ jsxs12("span", { children: [
1161
+ failedVersions.length,
1162
+ " of ",
1163
+ progress.total,
1164
+ " snapshot",
1165
+ failedVersions.length !== 1 ? "s" : "",
1166
+ " could not be read",
1167
+ failureReason ? `: ${failureReason}` : ".",
1168
+ " Retrying loads the ones that are readable."
1169
+ ] }),
1170
+ ErrorMenu ? /* @__PURE__ */ jsx13(ErrorMenu, {}) : null
1171
+ ] }),
1172
+ /* @__PURE__ */ jsx13(
1173
+ Button,
1174
+ {
1175
+ icon: /* @__PURE__ */ jsx13(Atom, {}),
1176
+ variant: "primary",
1177
+ onClick: () => void fetchEnrichedHistory(),
1178
+ children: "Load Full History"
1179
+ }
1180
+ ),
1181
+ /* @__PURE__ */ jsx13("div", { className: "w-full mt-4 border-t border-border pt-4 px-4", children: timeline(false) }),
1182
+ footer
1183
+ ] });
1184
+ }
1185
+ if (enrichLoading) {
1186
+ return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-center justify-center py-16 gap-3", children: [
1187
+ /* @__PURE__ */ jsx13(LoaderSpin, { className: "h-8 w-8 text-primary" }),
1188
+ /* @__PURE__ */ jsxs12("div", { className: "type-body text-muted-foreground", children: [
1189
+ "Loading version details... ",
1190
+ progress.fetched,
1191
+ "/",
1192
+ progress.total
1193
+ ] }),
1194
+ /* @__PURE__ */ jsx13("div", { className: "w-48 h-1.5 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsx13(
1195
+ "div",
1196
+ {
1197
+ className: "h-full bg-primary rounded-full transition-all duration-300",
1198
+ style: {
1199
+ width: `${progress.total > 0 ? progress.fetched / progress.total * 100 : 0}%`
1200
+ }
1201
+ }
1202
+ ) })
1203
+ ] });
1204
+ }
1205
+ return /* @__PURE__ */ jsxs12("div", { className: "px-4 py-3", children: [
1206
+ /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-between mb-3 pb-3 border-b border-border", children: /* @__PURE__ */ jsxs12("div", { className: "type-secondary text-muted-foreground", children: [
1207
+ enrichedVersions.filter((v) => v.snapshotLoaded).length,
1208
+ " of",
1209
+ " ",
1210
+ versions.length,
1211
+ " versions loaded",
1212
+ failedVersions.length > 0 && /* @__PURE__ */ jsxs12("span", { className: "text-destructive", children: [
1213
+ " ",
1214
+ "\xB7 ",
1215
+ failedVersions.length,
1216
+ " could not be read",
1217
+ ErrorMenu ? /* @__PURE__ */ jsx13(ErrorMenu, { error: failureReason ?? "Some version snapshots could not be read" }) : null
1218
+ ] })
1219
+ ] }) }),
1220
+ timeline(true),
1221
+ /* @__PURE__ */ jsx13("div", { className: "h-[50dvh]" }),
1222
+ footer
1223
+ ] });
1224
+ }
1225
+ function VersionChanges({ version, ports }) {
1226
+ const diff = version.diffSummary;
1227
+ const changedFields = diff?.root.filter((n) => n.changeType !== "unchanged") ?? [];
1228
+ return /* @__PURE__ */ jsxs12("div", { className: "space-y-1", children: [
1229
+ /* @__PURE__ */ jsx13(ContractBreak, { version, ports }),
1230
+ diff && changedFields.length > 0 ? /* @__PURE__ */ jsx13(ChipSet, { children: changedFields.map((n) => /* @__PURE__ */ jsx13(
1231
+ Chip,
1232
+ {
1233
+ tone: n.changeType === "added" ? "success" : n.changeType === "removed" ? "destructive" : "warning",
1234
+ label: `${humanizeIdentifier3(n.key) || n.key}${n.changeType === "added" ? " +" : n.changeType === "removed" ? " \u2212" : ""}`
1235
+ },
1236
+ n.key
1237
+ )) }) : diff && changedFields.length === 0 ? /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "No changes" }) : !version.snapshotLoaded ? (
1238
+ // An unread snapshot says so — never a lone contract-break button where the
1239
+ // changes belong (walk-core 2026-10-18: v9–v2 showed only the shield).
1240
+ /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "Not loaded" })
1241
+ ) : /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "First version" })
1242
+ ] });
1243
+ }
1244
+ function ContractBreak({ version, ports }) {
1245
+ const [declared, setDeclared] = useState(
1246
+ version.contract_break_declared ?? null
1247
+ );
1248
+ async function declareBreak(kind) {
1249
+ if (!ports.onDeclare) return;
1250
+ const previous = declared;
1251
+ setDeclared(kind);
1252
+ try {
1253
+ await ports.onDeclare(version.version_number, kind);
1254
+ } catch (error) {
1255
+ setDeclared(previous);
1256
+ ports.notify.error(`Couldn't record the contract break: ${error instanceof Error ? error.message : String(error)}`);
1257
+ return;
1258
+ }
1259
+ {
1260
+ ports.notify.success(
1261
+ kind ? `v${version.version_number} marked as a ${kind} contract break.` : `Contract-break declaration cleared for v${version.version_number}.`
1262
+ );
1263
+ }
1264
+ }
1265
+ const autoChange = version.contract_change || null;
1266
+ const effectiveChange = declared ?? autoChange;
1267
+ return /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center gap-1", children: [
1268
+ effectiveChange && /* @__PURE__ */ jsx13(
1269
+ Badge2,
1270
+ {
1271
+ tone: "warning",
1272
+ title: declared ? "Manually declared: the way this agent is used could break at this version." : "The declared input/output structure changed at this version \u2014 pinned callers and saved sample inputs may no longer fit.",
1273
+ children: `Contract: ${effectiveChange}${declared ? " (declared)" : ""}`
1274
+ }
1275
+ ),
1276
+ ports.onDeclare ? /* @__PURE__ */ jsxs12(DropdownMenu, { children: [
1277
+ /* @__PURE__ */ jsx13(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx13(
1278
+ Button,
1279
+ {
1280
+ icon: /* @__PURE__ */ jsx13(ShieldAlert, {}),
1281
+ "aria-label": "Mark this version as a contract break the hashes cannot see (e.g. a prompt-level output change)",
1282
+ variant: "quiet",
1283
+ title: "Mark this version as a contract break the hashes cannot see (e.g. a prompt-level output change)"
1284
+ }
1285
+ ) }),
1286
+ /* @__PURE__ */ jsxs12(DropdownMenuContent, { align: "start", children: [
1287
+ /* @__PURE__ */ jsx13(DropdownMenuItem, { onClick: () => void declareBreak("input"), children: "Declare input break" }),
1288
+ /* @__PURE__ */ jsx13(DropdownMenuItem, { onClick: () => void declareBreak("output"), children: "Declare output break" }),
1289
+ /* @__PURE__ */ jsx13(DropdownMenuItem, { onClick: () => void declareBreak("both"), children: "Declare input + output break" }),
1290
+ declared && /* @__PURE__ */ jsx13(DropdownMenuItem, { onClick: () => void declareBreak(null), children: "Clear declaration" })
1291
+ ] })
1292
+ ] }) : null
1293
+ ] });
1294
+ }
1295
+ export {
1296
+ AgentDiffRefsProvider,
1297
+ AgentDiffViewer,
1298
+ VersionHistoryTimeline,
1299
+ buildAgentAdapterRegistry,
1300
+ readModelTierIdentities,
1301
+ useAgentDiffRefs
1302
+ };