@agent-factory-platform/agent-react 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,164 +1,164 @@
1
- var Be = Object.defineProperty;
2
- var Te = (e) => {
1
+ var Oe = Object.defineProperty;
2
+ var Ee = (e) => {
3
3
  throw TypeError(e);
4
4
  };
5
- var Le = (e, l, s) => l in e ? Be(e, l, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[l] = s;
6
- var pe = (e, l, s) => Le(e, typeof l != "symbol" ? l + "" : l, s), ge = (e, l, s) => l.has(e) || Te("Cannot " + s);
7
- var _ = (e, l, s) => (ge(e, l, "read from private field"), s ? s.call(e) : l.get(e)), K = (e, l, s) => l.has(e) ? Te("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(e) : l.set(e, s), Re = (e, l, s, r) => (ge(e, l, "write to private field"), r ? r.call(e, s) : l.set(e, s), s), te = (e, l, s) => (ge(e, l, "access private method"), s);
8
- import { useSyncExternalStore as je, useState as T, useEffect as Oe, useMemo as Ue } from "react";
9
- import { jsx as a, jsxs as t, Fragment as me } from "react/jsx-runtime";
10
- import { create as m } from "@bufbuild/protobuf";
11
- import { agentV1 as v } from "@agent-factory-platform/client";
12
- import { AgentSessionModel as ja } from "@agent-factory-platform/client";
13
- import { Card as V, CardLabel as N, CardTitle as P, Tag as y, Button as S, AvatarBadge as ve, StateView as z, Input as x, Textarea as re, NativeSelect as fe, Switch as D } from "@agent-factory-platform/ui-kit";
14
- import { Wrench as Je, Sparkles as Fe, Check as Ke, Bot as qe, Paperclip as Ge, CircleStop as Ve, Send as He, MessageSquarePlus as Ye, ChevronRight as We, Trash2 as Qe, PackageCheck as Xe, Network as $e, BookOpen as Ze, Brain as ea, GitFork as aa } from "lucide-react";
15
- function na(e) {
16
- return je(e.subscribe, e.getSnapshot, e.getSnapshot);
5
+ var Ue = (e, n, l) => n in e ? Oe(e, n, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[n] = l;
6
+ var $ = (e, n, l) => Ue(e, typeof n != "symbol" ? n + "" : n, l), fe = (e, n, l) => n.has(e) || Ee("Cannot " + l);
7
+ var P = (e, n, l) => (fe(e, n, "read from private field"), l ? l.call(e) : n.get(e)), G = (e, n, l) => n.has(e) ? Ee("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(e) : n.set(e, l), Te = (e, n, l, s) => (fe(e, n, "write to private field"), s ? s.call(e, l) : n.set(e, l), l), le = (e, n, l) => (fe(e, n, "access private method"), l);
8
+ import { useSyncExternalStore as ve, useState as x, useEffect as We, useMemo as Fe } from "react";
9
+ import { jsx as a, jsxs as t, Fragment as ke } from "react/jsx-runtime";
10
+ import { create as v } from "@bufbuild/protobuf";
11
+ import { agentV1 as k, workflowV1 as se } from "@agent-factory-platform/client";
12
+ import { AgentSessionModel as Va } from "@agent-factory-platform/client";
13
+ import { Card as R, CardLabel as y, CardTitle as C, Tag as S, Button as p, AvatarBadge as Se, StateView as A, Input as z, Textarea as ce, NativeSelect as me, Switch as L } from "@agent-factory-platform/ui-kit";
14
+ import { Wrench as Ke, Sparkles as Ge, Check as Ve, Bot as Le, Paperclip as Ye, CircleStop as He, Send as Qe, MessageSquarePlus as Xe, ChevronRight as Ze, Trash2 as ea, PackageCheck as aa, Network as De, BookOpen as na, Brain as ta, GitFork as ia, Activity as la, GitBranch as sa, Pause as ra, Play as ca, Square as oa, RotateCcw as da } from "lucide-react";
15
+ function ha(e) {
16
+ return ve(e.subscribe, e.getSnapshot, e.getSnapshot);
17
17
  }
18
- var B, L, G, se, O, ie;
19
- class _a {
18
+ var J, O, V, oe, U, re;
19
+ class Da {
20
20
  constructor() {
21
- K(this, O);
22
- K(this, B, /* @__PURE__ */ new Map());
23
- K(this, L, /* @__PURE__ */ new Map());
24
- K(this, G, /* @__PURE__ */ new Set());
25
- K(this, se, 0);
26
- pe(this, "getSnapshot", () => _(this, se));
27
- pe(this, "subscribe", (l) => (_(this, G).add(l), () => _(this, G).delete(l)));
21
+ G(this, U);
22
+ G(this, J, /* @__PURE__ */ new Map());
23
+ G(this, O, /* @__PURE__ */ new Map());
24
+ G(this, V, /* @__PURE__ */ new Set());
25
+ G(this, oe, 0);
26
+ $(this, "getSnapshot", () => P(this, oe));
27
+ $(this, "subscribe", (n) => (P(this, V).add(n), () => P(this, V).delete(n)));
28
28
  }
29
- register(l, s) {
30
- const r = s;
31
- return _(this, B).set(l, r), te(this, O, ie).call(this), () => {
32
- if (_(this, B).get(l) !== r) return !1;
33
- const n = _(this, B).delete(l);
34
- return n && te(this, O, ie).call(this), n;
29
+ register(n, l) {
30
+ const s = l;
31
+ return P(this, J).set(n, s), le(this, U, re).call(this), () => {
32
+ if (P(this, J).get(n) !== s) return !1;
33
+ const i = P(this, J).delete(n);
34
+ return i && le(this, U, re).call(this), i;
35
35
  };
36
36
  }
37
- registerData(l, s, r) {
38
- const n = { decode: s, renderer: r };
39
- return _(this, L).set(l, n), te(this, O, ie).call(this), () => {
40
- if (_(this, L).get(l) !== n) return !1;
41
- const o = _(this, L).delete(l);
42
- return o && te(this, O, ie).call(this), o;
37
+ registerData(n, l, s) {
38
+ const i = { decode: l, renderer: s };
39
+ return P(this, O).set(n, i), le(this, U, re).call(this), () => {
40
+ if (P(this, O).get(n) !== i) return !1;
41
+ const c = P(this, O).delete(n);
42
+ return c && le(this, U, re).call(this), c;
43
43
  };
44
44
  }
45
- render(l, s) {
46
- if (l === "data") {
47
- const n = s, o = _(this, L).get(n.name);
48
- if (!o) return be(n.name, "unknown");
45
+ render(n, l) {
46
+ if (n === "data") {
47
+ const i = l, c = P(this, O).get(i.name);
48
+ if (!c) return be(i.name, "unknown");
49
49
  try {
50
- const c = { ...n, value: o.decode(n.value) }, d = o.renderer;
51
- return /* @__PURE__ */ a(d, { value: c });
50
+ const o = { ...i, value: c.decode(i.value) }, d = c.renderer;
51
+ return /* @__PURE__ */ a(d, { value: o });
52
52
  } catch {
53
- return be(n.name, "malformed");
53
+ return be(i.name, "malformed");
54
54
  }
55
55
  }
56
- const r = _(this, B).get(l);
57
- return r ? /* @__PURE__ */ a(r, { value: s }) : null;
56
+ const s = P(this, J).get(n);
57
+ return s ? /* @__PURE__ */ a(s, { value: l }) : null;
58
58
  }
59
59
  }
60
- B = new WeakMap(), L = new WeakMap(), G = new WeakMap(), se = new WeakMap(), O = new WeakSet(), ie = function() {
61
- Re(this, se, _(this, se) + 1), _(this, G).forEach((l) => l());
60
+ J = new WeakMap(), O = new WeakMap(), V = new WeakMap(), oe = new WeakMap(), U = new WeakSet(), re = function() {
61
+ Te(this, oe, P(this, oe) + 1), P(this, V).forEach((n) => n());
62
62
  };
63
- function be(e, l) {
64
- return /* @__PURE__ */ t("span", { "data-agent-data-fallback": l, children: [
65
- l === "malformed" ? "Invalid" : "Unsupported",
63
+ function be(e, n) {
64
+ return /* @__PURE__ */ t("span", { "data-agent-data-fallback": n, children: [
65
+ n === "malformed" ? "Invalid" : "Unsupported",
66
66
  " data slot: ",
67
67
  e || "(unnamed)"
68
68
  ] });
69
69
  }
70
- const la = () => () => {
71
- }, Ie = () => 0;
72
- function ce(e) {
73
- je(
74
- (e == null ? void 0 : e.subscribe) ?? la,
75
- (e == null ? void 0 : e.getSnapshot) ?? Ie,
76
- (e == null ? void 0 : e.getSnapshot) ?? Ie
70
+ const ua = () => () => {
71
+ }, $e = () => 0;
72
+ function de(e) {
73
+ ve(
74
+ (e == null ? void 0 : e.subscribe) ?? ua,
75
+ (e == null ? void 0 : e.getSnapshot) ?? $e,
76
+ (e == null ? void 0 : e.getSnapshot) ?? $e
77
77
  );
78
78
  }
79
- function ta({
79
+ function pa({
80
80
  items: e,
81
- label: l = "Execution",
82
- registry: s
81
+ label: n = "Execution",
82
+ registry: l
83
83
  }) {
84
- return ce(s), e.length ? /* @__PURE__ */ t("details", { className: "af-agent-trace", children: [
84
+ return de(l), e.length ? /* @__PURE__ */ t("details", { className: "af-agent-trace", children: [
85
85
  /* @__PURE__ */ t("summary", { children: [
86
- /* @__PURE__ */ a(Fe, { size: 14, "aria-hidden": !0 }),
87
- l,
88
- /* @__PURE__ */ a(y, { size: "micro", tone: "cool", children: e.length })
86
+ /* @__PURE__ */ a(Ge, { size: 14, "aria-hidden": !0 }),
87
+ n,
88
+ /* @__PURE__ */ a(S, { size: "micro", tone: "cool", children: e.length })
89
89
  ] }),
90
- /* @__PURE__ */ a("ol", { children: e.map((r) => /* @__PURE__ */ a("li", { "data-category": r.category, children: (s == null ? void 0 : s.render("trace-item", r)) ?? /* @__PURE__ */ t(me, { children: [
90
+ /* @__PURE__ */ a("ol", { children: e.map((s) => /* @__PURE__ */ a("li", { "data-category": s.category, children: (l == null ? void 0 : l.render("trace-item", s)) ?? /* @__PURE__ */ t(ke, { children: [
91
91
  /* @__PURE__ */ t("span", { children: [
92
- /* @__PURE__ */ a(Ke, { size: 13, "aria-hidden": !0 }),
93
- r.kind
92
+ /* @__PURE__ */ a(Ve, { size: 13, "aria-hidden": !0 }),
93
+ s.kind
94
94
  ] }),
95
- /* @__PURE__ */ a("span", { children: [r.status, r.detail].filter(Boolean).join(" · ") })
96
- ] }) }, r.anchorSeq.toString())) })
95
+ /* @__PURE__ */ a("span", { children: [s.status, s.detail].filter(Boolean).join(" · ") })
96
+ ] }) }, s.anchorSeq.toString())) })
97
97
  ] }) : null;
98
98
  }
99
- function ia({
99
+ function ga({
100
100
  interaction: e,
101
- onResolve: l
101
+ onResolve: n
102
102
  }) {
103
- const [s, r] = T(!1), [n, o] = T(""), c = async (u) => {
104
- r(!0), o("");
103
+ const [l, s] = x(!1), [i, c] = x(""), o = async (u) => {
104
+ s(!0), c("");
105
105
  try {
106
- await l(u);
107
- } catch (f) {
108
- o(f instanceof Error ? f.message : String(f));
106
+ await n(u);
107
+ } catch (m) {
108
+ c(m instanceof Error ? m.message : String(m));
109
109
  } finally {
110
- r(!1);
110
+ s(!1);
111
111
  }
112
112
  }, d = e.resolvedAt ? new Date(Number(e.resolvedAt.seconds) * 1e3).toLocaleString() : "";
113
- return /* @__PURE__ */ t(V, { as: "article", tone: "warm", className: "af-agent-action", children: [
113
+ return /* @__PURE__ */ t(R, { as: "article", tone: "warm", className: "af-agent-action", children: [
114
114
  /* @__PURE__ */ t("div", { children: [
115
- /* @__PURE__ */ t(N, { children: [
116
- /* @__PURE__ */ a(Je, { size: 14, "aria-hidden": !0 }),
115
+ /* @__PURE__ */ t(y, { children: [
116
+ /* @__PURE__ */ a(Ke, { size: 14, "aria-hidden": !0 }),
117
117
  " Approval required"
118
118
  ] }),
119
- /* @__PURE__ */ a(P, { children: e.kind }),
119
+ /* @__PURE__ */ a(C, { children: e.kind }),
120
120
  d && /* @__PURE__ */ t("p", { children: [
121
121
  "Resolved ",
122
122
  d
123
123
  ] })
124
124
  ] }),
125
- /* @__PURE__ */ a(y, { tone: e.status === "pending" ? "warning" : "neutral", children: e.status }),
125
+ /* @__PURE__ */ a(S, { tone: e.status === "pending" ? "warning" : "neutral", children: e.status }),
126
126
  e.status === "pending" && /* @__PURE__ */ t("div", { className: "af-agent-action__buttons", children: [
127
127
  /* @__PURE__ */ a(
128
- S,
128
+ p,
129
129
  {
130
130
  size: "compact",
131
- disabled: s,
132
- onClick: () => void c("confirmed"),
133
- children: s ? "Resolving…" : "Confirm"
131
+ disabled: l,
132
+ onClick: () => void o("confirmed"),
133
+ children: l ? "Resolving…" : "Confirm"
134
134
  }
135
135
  ),
136
136
  /* @__PURE__ */ a(
137
- S,
137
+ p,
138
138
  {
139
139
  size: "compact",
140
140
  variant: "secondary",
141
- disabled: s,
142
- onClick: () => void c("rejected"),
141
+ disabled: l,
142
+ onClick: () => void o("rejected"),
143
143
  children: "Reject"
144
144
  }
145
145
  )
146
146
  ] }),
147
- n && /* @__PURE__ */ a("p", { role: "alert", children: n })
147
+ i && /* @__PURE__ */ a("p", { role: "alert", children: i })
148
148
  ] });
149
149
  }
150
- function ra({
150
+ function fa({
151
151
  item: e
152
152
  }) {
153
- return /* @__PURE__ */ t(V, { as: "article", children: [
153
+ return /* @__PURE__ */ t(R, { as: "article", children: [
154
154
  /* @__PURE__ */ t("div", { children: [
155
- /* @__PURE__ */ t(N, { children: [
155
+ /* @__PURE__ */ t(y, { children: [
156
156
  "Tool · ",
157
157
  e.phase
158
158
  ] }),
159
- /* @__PURE__ */ a(P, { children: e.name || e.callId })
159
+ /* @__PURE__ */ a(C, { children: e.name || e.callId })
160
160
  ] }),
161
- /* @__PURE__ */ a(y, { tone: e.error ? "warning" : "cool", children: e.error ? "failed" : e.phase }),
161
+ /* @__PURE__ */ a(S, { tone: e.error ? "warning" : "cool", children: e.error ? "failed" : e.phase }),
162
162
  e.arguments !== void 0 && /* @__PURE__ */ t("details", { children: [
163
163
  /* @__PURE__ */ a("summary", { children: "Arguments" }),
164
164
  /* @__PURE__ */ a("pre", { children: JSON.stringify(e.arguments, null, 2) })
@@ -169,90 +169,90 @@ function ra({
169
169
  ] })
170
170
  ] });
171
171
  }
172
- function sa({
172
+ function ma({
173
173
  items: e,
174
- registry: l,
175
- onResolveInteraction: s
174
+ registry: n,
175
+ onResolveInteraction: l
176
176
  }) {
177
- ce(l);
178
- const r = e.filter(
179
- (n) => n.slot !== "trace-item" && (n.slot !== "message-content" || n.text.length > 0)
177
+ de(n);
178
+ const s = e.filter(
179
+ (i) => i.slot !== "trace-item" && (i.slot !== "message-content" || i.text.length > 0)
180
180
  );
181
- return /* @__PURE__ */ a(me, { children: r.map(
182
- (n) => n.slot === "message-content" ? /* @__PURE__ */ t(
181
+ return /* @__PURE__ */ a(ke, { children: s.map(
182
+ (i) => i.slot === "message-content" ? /* @__PURE__ */ t(
183
183
  "article",
184
184
  {
185
185
  className: "af-agent-message",
186
- "data-role": n.role,
187
- "data-anchor-seq": n.anchorSeq.toString(),
188
- "data-last-updated-seq": n.lastUpdatedSeq.toString(),
186
+ "data-role": i.role,
187
+ "data-anchor-seq": i.anchorSeq.toString(),
188
+ "data-last-updated-seq": i.lastUpdatedSeq.toString(),
189
189
  children: [
190
190
  /* @__PURE__ */ a(
191
- ve,
191
+ Se,
192
192
  {
193
- initials: n.role === "user" ? "You" : "AF",
193
+ initials: i.role === "user" ? "You" : "AF",
194
194
  size: 30
195
195
  }
196
196
  ),
197
197
  /* @__PURE__ */ t("div", { className: "af-agent-message__body", children: [
198
- /* @__PURE__ */ a("strong", { children: n.role === "user" ? "You" : "Agent" }),
199
- /* @__PURE__ */ a("div", { className: "af-agent-message__content", children: (l == null ? void 0 : l.render("message-content", n)) ?? n.text })
198
+ /* @__PURE__ */ a("strong", { children: i.role === "user" ? "You" : "Agent" }),
199
+ /* @__PURE__ */ a("div", { className: "af-agent-message__content", children: (n == null ? void 0 : n.render("message-content", i)) ?? i.text })
200
200
  ] })
201
201
  ]
202
202
  },
203
- `message-${n.anchorSeq}`
203
+ `message-${i.anchorSeq}`
204
204
  ) : /* @__PURE__ */ a(
205
205
  "div",
206
206
  {
207
207
  className: "af-agent-surface",
208
- "data-slot": n.slot,
209
- "data-anchor-seq": n.anchorSeq.toString(),
210
- "data-last-updated-seq": n.lastUpdatedSeq.toString(),
211
- children: n.slot === "tool-card" ? (l == null ? void 0 : l.render("tool-card", n)) ?? /* @__PURE__ */ a(ra, { item: n }) : n.slot === "action" ? (l == null ? void 0 : l.render("action", n)) ?? (s ? /* @__PURE__ */ a(
212
- ia,
208
+ "data-slot": i.slot,
209
+ "data-anchor-seq": i.anchorSeq.toString(),
210
+ "data-last-updated-seq": i.lastUpdatedSeq.toString(),
211
+ children: i.slot === "tool-card" ? (n == null ? void 0 : n.render("tool-card", i)) ?? /* @__PURE__ */ a(fa, { item: i }) : i.slot === "action" ? (n == null ? void 0 : n.render("action", i)) ?? (l ? /* @__PURE__ */ a(
212
+ ga,
213
213
  {
214
214
  interaction: {
215
- id: n.interactionId,
216
- kind: Me(n),
217
- status: n.phase === "requested" ? "pending" : "resolved"
215
+ id: i.interactionId,
216
+ kind: Me(i),
217
+ status: i.phase === "requested" ? "pending" : "resolved"
218
218
  },
219
- onResolve: (o) => s(n.interactionId, o)
219
+ onResolve: (c) => l(i.interactionId, c)
220
220
  }
221
- ) : /* @__PURE__ */ t(y, { tone: "warning", children: [
222
- Me(n),
221
+ ) : /* @__PURE__ */ t(S, { tone: "warning", children: [
222
+ Me(i),
223
223
  " · ",
224
- n.phase
225
- ] })) : n.slot === "citation" ? (l == null ? void 0 : l.render("citation", n)) ?? /* @__PURE__ */ a(y, { children: n.resourceId }) : l ? l.render("data", n) : be(n.name, "unknown")
224
+ i.phase
225
+ ] })) : i.slot === "citation" ? (n == null ? void 0 : n.render("citation", i)) ?? /* @__PURE__ */ a(S, { children: i.resourceId }) : n ? n.render("data", i) : be(i.name, "unknown")
226
226
  },
227
- n.slot === "tool-card" ? `tool-${n.callId}` : n.slot === "action" ? `action-${n.interactionId}` : `${n.slot}-${n.anchorSeq}-${n.blockIndex}`
227
+ i.slot === "tool-card" ? `tool-${i.callId}` : i.slot === "action" ? `action-${i.interactionId}` : `${i.slot}-${i.anchorSeq}-${i.blockIndex}`
228
228
  )
229
229
  ) });
230
230
  }
231
231
  function Me(e) {
232
- const l = e.payload && typeof e.payload == "object" && !Array.isArray(e.payload) ? e.payload.action : void 0;
233
- return l && typeof l == "object" && !Array.isArray(l) && typeof l.kind == "string" ? l.kind : e.kind;
232
+ const n = e.payload && typeof e.payload == "object" && !Array.isArray(e.payload) ? e.payload.action : void 0;
233
+ return n && typeof n == "object" && !Array.isArray(n) && typeof n.kind == "string" ? n.kind : e.kind;
234
234
  }
235
- function ca({
235
+ function ba({
236
236
  revision: e,
237
- onChange: l,
238
- onSave: s,
239
- saving: r = !1,
240
- showSave: n = !0,
241
- registry: o
237
+ onChange: n,
238
+ onSave: l,
239
+ saving: s = !1,
240
+ showSave: i = !0,
241
+ registry: c
242
242
  }) {
243
- ce(o);
244
- const c = o == null ? void 0 : o.render("profile-editor", { revision: e, onChange: l });
245
- return c || /* @__PURE__ */ t(
243
+ de(c);
244
+ const o = c == null ? void 0 : c.render("profile-editor", { revision: e, onChange: n });
245
+ return o || /* @__PURE__ */ t(
246
246
  "form",
247
247
  {
248
248
  className: "af-agent-persona",
249
249
  onSubmit: (d) => {
250
- d.preventDefault(), s();
250
+ d.preventDefault(), l();
251
251
  },
252
252
  children: [
253
253
  /* @__PURE__ */ t("div", { className: "af-agent-persona__intro", children: [
254
254
  /* @__PURE__ */ a(
255
- ve,
255
+ Se,
256
256
  {
257
257
  initials: e.name || "AF",
258
258
  src: e.avatar || void 0,
@@ -260,75 +260,75 @@ function ca({
260
260
  }
261
261
  ),
262
262
  /* @__PURE__ */ t("div", { children: [
263
- /* @__PURE__ */ t(N, { children: [
264
- /* @__PURE__ */ a(qe, { size: 14, "aria-hidden": !0 }),
263
+ /* @__PURE__ */ t(y, { children: [
264
+ /* @__PURE__ */ a(Le, { size: 14, "aria-hidden": !0 }),
265
265
  " Agent Profile"
266
266
  ] }),
267
- /* @__PURE__ */ a(P, { children: e.name || "Untitled Agent" })
267
+ /* @__PURE__ */ a(C, { children: e.name || "Untitled Agent" })
268
268
  ] })
269
269
  ] }),
270
270
  /* @__PURE__ */ t("label", { children: [
271
271
  /* @__PURE__ */ a("span", { children: "Name" }),
272
272
  /* @__PURE__ */ a(
273
- x,
273
+ z,
274
274
  {
275
275
  required: !0,
276
276
  value: e.name,
277
- onChange: (d) => l({ ...e, name: d.target.value })
277
+ onChange: (d) => n({ ...e, name: d.target.value })
278
278
  }
279
279
  )
280
280
  ] }),
281
281
  /* @__PURE__ */ t("label", { children: [
282
282
  /* @__PURE__ */ a("span", { children: "Description" }),
283
283
  /* @__PURE__ */ a(
284
- x,
284
+ z,
285
285
  {
286
286
  value: e.description,
287
- onChange: (d) => l({ ...e, description: d.target.value })
287
+ onChange: (d) => n({ ...e, description: d.target.value })
288
288
  }
289
289
  )
290
290
  ] }),
291
291
  /* @__PURE__ */ t("label", { children: [
292
292
  /* @__PURE__ */ a("span", { children: "Avatar URL" }),
293
293
  /* @__PURE__ */ a(
294
- x,
294
+ z,
295
295
  {
296
296
  type: "url",
297
297
  value: e.avatar,
298
- onChange: (d) => l({ ...e, avatar: d.target.value })
298
+ onChange: (d) => n({ ...e, avatar: d.target.value })
299
299
  }
300
300
  )
301
301
  ] }),
302
302
  /* @__PURE__ */ t("label", { children: [
303
303
  /* @__PURE__ */ a("span", { children: "Persona" }),
304
304
  /* @__PURE__ */ a(
305
- re,
305
+ ce,
306
306
  {
307
307
  required: !0,
308
308
  rows: 5,
309
309
  value: e.persona,
310
- onChange: (d) => l({ ...e, persona: d.target.value })
310
+ onChange: (d) => n({ ...e, persona: d.target.value })
311
311
  }
312
312
  )
313
313
  ] }),
314
314
  /* @__PURE__ */ t("label", { children: [
315
315
  /* @__PURE__ */ a("span", { children: "Purpose" }),
316
316
  /* @__PURE__ */ a(
317
- re,
317
+ ce,
318
318
  {
319
319
  required: !0,
320
320
  rows: 3,
321
321
  value: e.purpose,
322
- onChange: (d) => l({ ...e, purpose: d.target.value })
322
+ onChange: (d) => n({ ...e, purpose: d.target.value })
323
323
  }
324
324
  )
325
325
  ] }),
326
- n && /* @__PURE__ */ a(S, { type: "submit", disabled: r, children: r ? "Saving…" : "Save revision" })
326
+ i && /* @__PURE__ */ a(p, { type: "submit", disabled: s, children: s ? "Saving…" : "Save revision" })
327
327
  ]
328
328
  }
329
329
  );
330
330
  }
331
- const da = (e) => e ? `${e} warning${e === 1 ? "" : "s"}` : "Ready", oa = (e) => ({
331
+ const va = (e) => e ? `${e} warning${e === 1 ? "" : "s"}` : "Ready", ka = (e) => ({
332
332
  capability_not_installed: "Capability is not installed",
333
333
  capability_version_unavailable: "Capability version is unavailable",
334
334
  mcp_disabled: "MCP server is disabled",
@@ -338,18 +338,18 @@ const da = (e) => e ? `${e} warning${e === 1 ? "" : "s"}` : "Ready", oa = (e) =>
338
338
  plugin_unavailable: "Plugin is unavailable",
339
339
  skill_provider_unavailable: "Skill provider is unavailable"
340
340
  })[e] ?? e.replaceAll("_", " ");
341
- function Na({
341
+ function $a({
342
342
  composition: e,
343
- loading: l = !1,
344
- error: s = ""
343
+ loading: n = !1,
344
+ error: l = ""
345
345
  }) {
346
- return l ? /* @__PURE__ */ a(z, { size: "sm", title: "Inspecting composition…" }) : s ? /* @__PURE__ */ a(
347
- z,
346
+ return n ? /* @__PURE__ */ a(A, { size: "sm", title: "Inspecting composition…" }) : l ? /* @__PURE__ */ a(
347
+ A,
348
348
  {
349
349
  size: "sm",
350
350
  variant: "error",
351
351
  title: "Composition unavailable",
352
- description: s
352
+ description: l
353
353
  }
354
354
  ) : e != null && e.items.length ? /* @__PURE__ */ t(
355
355
  "section",
@@ -359,72 +359,72 @@ function Na({
359
359
  children: [
360
360
  /* @__PURE__ */ t("header", { children: [
361
361
  /* @__PURE__ */ t("div", { children: [
362
- /* @__PURE__ */ a(N, { children: "Effective composition" }),
363
- /* @__PURE__ */ a(P, { children: e.model || "No model selected" })
362
+ /* @__PURE__ */ a(y, { children: "Effective composition" }),
363
+ /* @__PURE__ */ a(C, { children: e.model || "No model selected" })
364
364
  ] }),
365
- /* @__PURE__ */ a(y, { tone: e.issues.length ? "warning" : "success", children: da(e.issues.length) })
365
+ /* @__PURE__ */ a(S, { tone: e.issues.length ? "warning" : "success", children: va(e.issues.length) })
366
366
  ] }),
367
367
  e.issues.length > 0 && /* @__PURE__ */ a(
368
368
  "ul",
369
369
  {
370
370
  className: "af-agent-composition__issues",
371
371
  "aria-label": "Composition warnings",
372
- children: e.issues.map((r) => /* @__PURE__ */ t("li", { children: [
373
- /* @__PURE__ */ a("strong", { children: oa(r.code) }),
372
+ children: e.issues.map((s) => /* @__PURE__ */ t("li", { children: [
373
+ /* @__PURE__ */ a("strong", { children: ka(s.code) }),
374
374
  " ",
375
- r.message
376
- ] }, `${r.code}:${r.message}`))
375
+ s.message
376
+ ] }, `${s.code}:${s.message}`))
377
377
  }
378
378
  ),
379
- /* @__PURE__ */ a("div", { className: "af-agent-composition__items", children: e.items.map((r) => /* @__PURE__ */ t(
380
- V,
379
+ /* @__PURE__ */ a("div", { className: "af-agent-composition__items", children: e.items.map((s) => /* @__PURE__ */ t(
380
+ R,
381
381
  {
382
382
  as: "article",
383
383
  children: [
384
384
  /* @__PURE__ */ t("div", { children: [
385
- /* @__PURE__ */ t(N, { children: [
386
- r.kind,
385
+ /* @__PURE__ */ t(y, { children: [
386
+ s.kind,
387
387
  " · ",
388
- r.source
388
+ s.source
389
389
  ] }),
390
- /* @__PURE__ */ a(P, { children: r.id })
390
+ /* @__PURE__ */ a(C, { children: s.id })
391
391
  ] }),
392
392
  /* @__PURE__ */ a(
393
- y,
393
+ S,
394
394
  {
395
- tone: r.status === "unavailable" ? "warning" : ["allowed", "enabled", "selected"].includes(r.status) ? "success" : "neutral",
396
- children: r.status
395
+ tone: s.status === "unavailable" ? "warning" : ["allowed", "enabled", "selected"].includes(s.status) ? "success" : "neutral",
396
+ children: s.status
397
397
  }
398
398
  ),
399
- r.version && /* @__PURE__ */ t("p", { children: [
399
+ s.version && /* @__PURE__ */ t("p", { children: [
400
400
  "Version ",
401
- r.version
401
+ s.version
402
402
  ] }),
403
- r.reasoningEfforts.length > 0 && /* @__PURE__ */ t("p", { children: [
403
+ s.reasoningEfforts.length > 0 && /* @__PURE__ */ t("p", { children: [
404
404
  "Reasoning: ",
405
- r.reasoningEfforts.join(", ")
405
+ s.reasoningEfforts.join(", ")
406
406
  ] }),
407
- r.inputModalities.length > 0 && /* @__PURE__ */ t("p", { children: [
407
+ s.inputModalities.length > 0 && /* @__PURE__ */ t("p", { children: [
408
408
  "Input: ",
409
- r.inputModalities.join(", ")
409
+ s.inputModalities.join(", ")
410
410
  ] }),
411
- r.permissions.length > 0 && /* @__PURE__ */ t("p", { children: [
411
+ s.permissions.length > 0 && /* @__PURE__ */ t("p", { children: [
412
412
  "Permissions: ",
413
- r.permissions.join(", ")
413
+ s.permissions.join(", ")
414
414
  ] }),
415
- r.dependencies.length > 0 && /* @__PURE__ */ t("p", { children: [
415
+ s.dependencies.length > 0 && /* @__PURE__ */ t("p", { children: [
416
416
  "Dependencies: ",
417
- r.dependencies.join(", ")
417
+ s.dependencies.join(", ")
418
418
  ] }),
419
- r.reason && /* @__PURE__ */ a("p", { role: r.status === "available" ? void 0 : "alert", children: r.reason })
419
+ s.reason && /* @__PURE__ */ a("p", { role: s.status === "available" ? void 0 : "alert", children: s.reason })
420
420
  ]
421
421
  },
422
- `${r.kind}:${r.id}:${r.version}:${r.source}`
422
+ `${s.kind}:${s.id}:${s.version}:${s.source}`
423
423
  )) })
424
424
  ]
425
425
  }
426
426
  ) : /* @__PURE__ */ a(
427
- z,
427
+ A,
428
428
  {
429
429
  size: "sm",
430
430
  title: "No deployed capabilities",
@@ -432,65 +432,65 @@ function Na({
432
432
  }
433
433
  );
434
434
  }
435
- function Pa({
435
+ function Ma({
436
436
  revision: e,
437
- composition: l,
438
- onChange: s,
439
- onSave: r
437
+ composition: n,
438
+ onChange: l,
439
+ onSave: s
440
440
  }) {
441
- var H, J, R, Y, W, k, E, A, Q, j, Se, ke, ye, Ce, we, _e, Ne, Pe, Ae, ze;
442
- const [n, o] = T(e), [c, d] = T(
441
+ var Y, F, E, H, Q, w, q, I, X, j, ye, Ce, we, Ne, _e, Pe, Ae, Ie, ze, xe;
442
+ const [i, c] = x(e), [o, d] = x(
443
443
  "idle"
444
- ), [u, f] = T(""), g = (l == null ? void 0 : l.items.filter(
445
- (i) => i.kind === "skill" || i.kind === "skill_pack" || i.kind === "plugin" || i.kind === "mcp"
446
- )) ?? [], C = (l == null ? void 0 : l.items.filter(
447
- (i) => i.kind === "model" && i.status !== "unavailable"
448
- )) ?? [], b = (l == null ? void 0 : l.items.filter((i) => i.kind === "tool")) ?? [], w = (i) => s({
444
+ ), [u, m] = x(""), f = (n == null ? void 0 : n.items.filter(
445
+ (r) => r.kind === "skill" || r.kind === "skill_pack" || r.kind === "plugin" || r.kind === "mcp"
446
+ )) ?? [], N = (n == null ? void 0 : n.items.filter(
447
+ (r) => r.kind === "model" && r.status !== "unavailable"
448
+ )) ?? [], b = (n == null ? void 0 : n.items.filter((r) => r.kind === "tool")) ?? [], _ = (r) => l({
449
449
  ...e,
450
450
  runtimePolicy: {
451
- ...m(v.RuntimePolicySchema),
451
+ ...v(k.RuntimePolicySchema),
452
452
  ...e.runtimePolicy,
453
- ...i
453
+ ...r
454
454
  }
455
- }), M = (i, h) => {
456
- var p;
457
- return w({
455
+ }), M = (r, h) => {
456
+ var g;
457
+ return _({
458
458
  limits: {
459
- ...m(v.ProfileLimitsSchema),
460
- ...(p = e.runtimePolicy) == null ? void 0 : p.limits,
461
- [i]: i === "maxTokens" ? BigInt(h || 0) : Number(h || 0)
459
+ ...v(k.ProfileLimitsSchema),
460
+ ...(g = e.runtimePolicy) == null ? void 0 : g.limits,
461
+ [r]: r === "maxTokens" ? BigInt(h || 0) : Number(h || 0)
462
462
  }
463
463
  });
464
- }, U = (i, h) => {
465
- if (i.kind === "skill" || i.kind === "skill_pack") {
466
- const p = i.kind === "skill" ? { ...e.skills } : { ...e.skillPacks };
467
- h ? p[i.id] = i.version : delete p[i.id], s(
468
- i.kind === "skill" ? { ...e, skills: p } : { ...e, skillPacks: p }
464
+ }, W = (r, h) => {
465
+ if (r.kind === "skill" || r.kind === "skill_pack") {
466
+ const g = r.kind === "skill" ? { ...e.skills } : { ...e.skillPacks };
467
+ h ? g[r.id] = r.version : delete g[r.id], l(
468
+ r.kind === "skill" ? { ...e, skills: g } : { ...e, skillPacks: g }
469
469
  );
470
470
  }
471
- if (i.kind === "plugin" || i.kind === "mcp") {
472
- const p = { ...e.plugins };
473
- h ? p[i.id] = m(v.PluginConfigSchema, {
474
- version: i.version
475
- }) : delete p[i.id], s({ ...e, plugins: p });
471
+ if (r.kind === "plugin" || r.kind === "mcp") {
472
+ const g = { ...e.plugins };
473
+ h ? g[r.id] = v(k.PluginConfigSchema, {
474
+ version: r.version
475
+ }) : delete g[r.id], l({ ...e, plugins: g });
476
476
  }
477
- }, oe = async () => {
478
- d("pending"), f("");
477
+ }, ue = async () => {
478
+ d("pending"), m("");
479
479
  try {
480
- const i = await r(e);
481
- o(i ?? e), i && s(i), d("success");
482
- } catch (i) {
483
- s(n), f(i instanceof Error ? i.message : String(i)), d("error");
480
+ const r = await s(e);
481
+ c(r ?? e), r && l(r), d("success");
482
+ } catch (r) {
483
+ l(i), m(r instanceof Error ? r.message : String(r)), d("error");
484
484
  }
485
485
  };
486
486
  return /* @__PURE__ */ t("div", { className: "af-agent-settings", children: [
487
487
  /* @__PURE__ */ a(
488
- ca,
488
+ ba,
489
489
  {
490
490
  revision: e,
491
- onChange: s,
492
- onSave: () => void oe(),
493
- saving: c === "pending",
491
+ onChange: l,
492
+ onSave: () => void ue(),
493
+ saving: o === "pending",
494
494
  showSave: !1
495
495
  }
496
496
  ),
@@ -499,22 +499,22 @@ function Pa({
499
499
  /* @__PURE__ */ t("label", { children: [
500
500
  /* @__PURE__ */ a("span", { children: "Preferred model" }),
501
501
  /* @__PURE__ */ a(
502
- fe,
502
+ me,
503
503
  {
504
504
  label: "Model",
505
- value: ((J = (H = e.runtimePolicy) == null ? void 0 : H.model) == null ? void 0 : J.preferred) ?? "",
506
- options: C.map((i) => ({
507
- value: i.id,
508
- label: `${i.id} · ${i.source}`
505
+ value: ((F = (Y = e.runtimePolicy) == null ? void 0 : Y.model) == null ? void 0 : F.preferred) ?? "",
506
+ options: N.map((r) => ({
507
+ value: r.id,
508
+ label: `${r.id} · ${r.source}`
509
509
  })),
510
- onChange: (i) => {
511
- var p, $, I;
512
- const h = new Set(($ = (p = e.runtimePolicy) == null ? void 0 : p.model) == null ? void 0 : $.allowed);
513
- h.add(i), w({
510
+ onChange: (r) => {
511
+ var g, T, D;
512
+ const h = new Set((T = (g = e.runtimePolicy) == null ? void 0 : g.model) == null ? void 0 : T.allowed);
513
+ h.add(r), _({
514
514
  model: {
515
- ...m(v.ModelPolicySchema),
516
- ...(I = e.runtimePolicy) == null ? void 0 : I.model,
517
- preferred: i,
515
+ ...v(k.ModelPolicySchema),
516
+ ...(D = e.runtimePolicy) == null ? void 0 : D.model,
517
+ preferred: r,
518
518
  allowed: [...h]
519
519
  }
520
520
  });
@@ -527,27 +527,27 @@ function Pa({
527
527
  {
528
528
  className: "af-agent-settings__checklist",
529
529
  "aria-label": "Allowed models",
530
- children: C.map((i) => {
531
- var h, p, $, I;
530
+ children: N.map((r) => {
531
+ var h, g, T, D;
532
532
  return /* @__PURE__ */ a(
533
- D,
533
+ L,
534
534
  {
535
- label: `Allow ${i.id}`,
536
- checked: ((p = (h = e.runtimePolicy) == null ? void 0 : h.model) == null ? void 0 : p.allowed.includes(i.id)) ?? !1,
537
- disabled: i.id === ((I = ($ = e.runtimePolicy) == null ? void 0 : $.model) == null ? void 0 : I.preferred),
538
- onCheckedChange: (he) => {
539
- var X, Z, ee;
540
- const F = new Set((Z = (X = e.runtimePolicy) == null ? void 0 : X.model) == null ? void 0 : Z.allowed);
541
- he ? F.add(i.id) : F.delete(i.id), w({
535
+ label: `Allow ${r.id}`,
536
+ checked: ((g = (h = e.runtimePolicy) == null ? void 0 : h.model) == null ? void 0 : g.allowed.includes(r.id)) ?? !1,
537
+ disabled: r.id === ((D = (T = e.runtimePolicy) == null ? void 0 : T.model) == null ? void 0 : D.preferred),
538
+ onCheckedChange: (pe) => {
539
+ var Z, ee, ae;
540
+ const K = new Set((ee = (Z = e.runtimePolicy) == null ? void 0 : Z.model) == null ? void 0 : ee.allowed);
541
+ pe ? K.add(r.id) : K.delete(r.id), _({
542
542
  model: {
543
- ...m(v.ModelPolicySchema),
544
- ...(ee = e.runtimePolicy) == null ? void 0 : ee.model,
545
- allowed: [...F]
543
+ ...v(k.ModelPolicySchema),
544
+ ...(ae = e.runtimePolicy) == null ? void 0 : ae.model,
545
+ allowed: [...K]
546
546
  }
547
547
  });
548
548
  }
549
549
  },
550
- i.id
550
+ r.id
551
551
  );
552
552
  })
553
553
  }
@@ -555,22 +555,22 @@ function Pa({
555
555
  /* @__PURE__ */ t("label", { children: [
556
556
  /* @__PURE__ */ a("span", { children: "Reasoning" }),
557
557
  /* @__PURE__ */ a(
558
- fe,
558
+ me,
559
559
  {
560
560
  label: "Reasoning",
561
- value: ((R = e.runtimePolicy) == null ? void 0 : R.reasoning) ?? "medium",
562
- options: ((Y = C.find(
563
- (i) => {
564
- var h, p;
565
- return i.id === ((p = (h = e.runtimePolicy) == null ? void 0 : h.model) == null ? void 0 : p.preferred);
561
+ value: ((E = e.runtimePolicy) == null ? void 0 : E.reasoning) ?? "medium",
562
+ options: ((H = N.find(
563
+ (r) => {
564
+ var h, g;
565
+ return r.id === ((g = (h = e.runtimePolicy) == null ? void 0 : h.model) == null ? void 0 : g.preferred);
566
566
  }
567
- )) != null && Y.reasoningEfforts.length ? C.find(
568
- (i) => {
569
- var h, p;
570
- return i.id === ((p = (h = e.runtimePolicy) == null ? void 0 : h.model) == null ? void 0 : p.preferred);
567
+ )) != null && H.reasoningEfforts.length ? N.find(
568
+ (r) => {
569
+ var h, g;
570
+ return r.id === ((g = (h = e.runtimePolicy) == null ? void 0 : h.model) == null ? void 0 : g.preferred);
571
571
  }
572
- ).reasoningEfforts : ["low", "medium", "high"]).map((i) => ({ value: i, label: i })),
573
- onChange: (i) => w({ reasoning: i })
572
+ ).reasoningEfforts : ["low", "medium", "high"]).map((r) => ({ value: r, label: r })),
573
+ onChange: (r) => _({ reasoning: r })
574
574
  }
575
575
  )
576
576
  ] }),
@@ -578,39 +578,39 @@ function Pa({
578
578
  /* @__PURE__ */ t("label", { children: [
579
579
  /* @__PURE__ */ a("span", { children: "Max steps" }),
580
580
  /* @__PURE__ */ a(
581
- x,
581
+ z,
582
582
  {
583
583
  "aria-label": "Max steps",
584
584
  type: "number",
585
585
  min: "1",
586
- value: ((k = (W = e.runtimePolicy) == null ? void 0 : W.limits) == null ? void 0 : k.maxSteps) || "",
587
- onChange: (i) => M("maxSteps", i.target.value)
586
+ value: ((w = (Q = e.runtimePolicy) == null ? void 0 : Q.limits) == null ? void 0 : w.maxSteps) || "",
587
+ onChange: (r) => M("maxSteps", r.target.value)
588
588
  }
589
589
  )
590
590
  ] }),
591
591
  /* @__PURE__ */ t("label", { children: [
592
592
  /* @__PURE__ */ a("span", { children: "Max tool calls" }),
593
593
  /* @__PURE__ */ a(
594
- x,
594
+ z,
595
595
  {
596
596
  "aria-label": "Max tool calls",
597
597
  type: "number",
598
598
  min: "0",
599
- value: ((A = (E = e.runtimePolicy) == null ? void 0 : E.limits) == null ? void 0 : A.maxToolCalls) || "",
600
- onChange: (i) => M("maxToolCalls", i.target.value)
599
+ value: ((I = (q = e.runtimePolicy) == null ? void 0 : q.limits) == null ? void 0 : I.maxToolCalls) || "",
600
+ onChange: (r) => M("maxToolCalls", r.target.value)
601
601
  }
602
602
  )
603
603
  ] }),
604
604
  /* @__PURE__ */ t("label", { children: [
605
605
  /* @__PURE__ */ a("span", { children: "Max tokens" }),
606
606
  /* @__PURE__ */ a(
607
- x,
607
+ z,
608
608
  {
609
609
  "aria-label": "Max tokens",
610
610
  type: "number",
611
611
  min: "1",
612
- value: ((Se = (j = (Q = e.runtimePolicy) == null ? void 0 : Q.limits) == null ? void 0 : j.maxTokens) == null ? void 0 : Se.toString()) ?? "",
613
- onChange: (i) => M("maxTokens", i.target.value)
612
+ value: ((ye = (j = (X = e.runtimePolicy) == null ? void 0 : X.limits) == null ? void 0 : j.maxTokens) == null ? void 0 : ye.toString()) ?? "",
613
+ onChange: (r) => M("maxTokens", r.target.value)
614
614
  }
615
615
  )
616
616
  ] })
@@ -619,84 +619,84 @@ function Pa({
619
619
  /* @__PURE__ */ t("fieldset", { children: [
620
620
  /* @__PURE__ */ a("legend", { children: "Tool policy" }),
621
621
  /* @__PURE__ */ a(
622
- D,
622
+ L,
623
623
  {
624
624
  label: "Allow every deployed tool",
625
- checked: ((ye = (ke = e.runtimePolicy) == null ? void 0 : ke.tools) == null ? void 0 : ye.allowAll) ?? !1,
626
- onCheckedChange: (i) => {
625
+ checked: ((we = (Ce = e.runtimePolicy) == null ? void 0 : Ce.tools) == null ? void 0 : we.allowAll) ?? !1,
626
+ onCheckedChange: (r) => {
627
627
  var h;
628
- return w({
628
+ return _({
629
629
  tools: {
630
- ...m(v.ToolPolicySchema),
630
+ ...v(k.ToolPolicySchema),
631
631
  ...(h = e.runtimePolicy) == null ? void 0 : h.tools,
632
- allowAll: i
632
+ allowAll: r
633
633
  }
634
634
  });
635
635
  }
636
636
  }
637
637
  ),
638
- b.map((i) => {
639
- var $, I, he, F, X, Z, ee, xe;
640
- const h = ((I = ($ = e.runtimePolicy) == null ? void 0 : $.tools) == null ? void 0 : I.allowAll) || ((F = (he = e.runtimePolicy) == null ? void 0 : he.tools) == null ? void 0 : F.allowed.includes(i.id)), p = (Z = (X = e.runtimePolicy) == null ? void 0 : X.tools) == null ? void 0 : Z.requireConfirmation.includes(
641
- i.id
638
+ b.map((r) => {
639
+ var T, D, pe, K, Z, ee, ae, Re;
640
+ const h = ((D = (T = e.runtimePolicy) == null ? void 0 : T.tools) == null ? void 0 : D.allowAll) || ((K = (pe = e.runtimePolicy) == null ? void 0 : pe.tools) == null ? void 0 : K.allowed.includes(r.id)), g = (ee = (Z = e.runtimePolicy) == null ? void 0 : Z.tools) == null ? void 0 : ee.requireConfirmation.includes(
641
+ r.id
642
642
  );
643
643
  return /* @__PURE__ */ t("div", { className: "af-agent-settings__tool", children: [
644
644
  /* @__PURE__ */ a(
645
- D,
645
+ L,
646
646
  {
647
- label: i.id,
647
+ label: r.id,
648
648
  checked: !!h,
649
- disabled: (xe = (ee = e.runtimePolicy) == null ? void 0 : ee.tools) == null ? void 0 : xe.allowAll,
650
- onCheckedChange: (ue) => {
651
- var ae, ne, le;
652
- const q = new Set(
653
- (ne = (ae = e.runtimePolicy) == null ? void 0 : ae.tools) == null ? void 0 : ne.allowed
649
+ disabled: (Re = (ae = e.runtimePolicy) == null ? void 0 : ae.tools) == null ? void 0 : Re.allowAll,
650
+ onCheckedChange: (ge) => {
651
+ var ne, te, ie;
652
+ const B = new Set(
653
+ (te = (ne = e.runtimePolicy) == null ? void 0 : ne.tools) == null ? void 0 : te.allowed
654
654
  );
655
- ue ? q.add(i.id) : q.delete(i.id), w({
655
+ ge ? B.add(r.id) : B.delete(r.id), _({
656
656
  tools: {
657
- ...m(v.ToolPolicySchema),
658
- ...(le = e.runtimePolicy) == null ? void 0 : le.tools,
659
- allowed: [...q]
657
+ ...v(k.ToolPolicySchema),
658
+ ...(ie = e.runtimePolicy) == null ? void 0 : ie.tools,
659
+ allowed: [...B]
660
660
  }
661
661
  });
662
662
  }
663
663
  }
664
664
  ),
665
665
  /* @__PURE__ */ a(
666
- D,
666
+ L,
667
667
  {
668
668
  label: "Require confirmation",
669
- checked: !!p,
669
+ checked: !!g,
670
670
  disabled: !h,
671
- onCheckedChange: (ue) => {
672
- var ae, ne, le;
673
- const q = new Set(
674
- (ne = (ae = e.runtimePolicy) == null ? void 0 : ae.tools) == null ? void 0 : ne.requireConfirmation
671
+ onCheckedChange: (ge) => {
672
+ var ne, te, ie;
673
+ const B = new Set(
674
+ (te = (ne = e.runtimePolicy) == null ? void 0 : ne.tools) == null ? void 0 : te.requireConfirmation
675
675
  );
676
- ue ? q.add(i.id) : q.delete(i.id), w({
676
+ ge ? B.add(r.id) : B.delete(r.id), _({
677
677
  tools: {
678
- ...m(v.ToolPolicySchema),
679
- ...(le = e.runtimePolicy) == null ? void 0 : le.tools,
680
- requireConfirmation: [...q]
678
+ ...v(k.ToolPolicySchema),
679
+ ...(ie = e.runtimePolicy) == null ? void 0 : ie.tools,
680
+ requireConfirmation: [...B]
681
681
  }
682
682
  });
683
683
  }
684
684
  }
685
685
  )
686
- ] }, i.id);
686
+ ] }, r.id);
687
687
  })
688
688
  ] }),
689
689
  /* @__PURE__ */ t("fieldset", { children: [
690
690
  /* @__PURE__ */ a("legend", { children: "Capabilities" }),
691
- g.length ? g.map((i) => /* @__PURE__ */ a(
692
- D,
691
+ f.length ? f.map((r) => /* @__PURE__ */ a(
692
+ L,
693
693
  {
694
- label: `${i.kind} · ${i.id} (${i.version})`,
695
- checked: i.kind === "skill" ? i.id in e.skills : i.kind === "skill_pack" ? i.id in e.skillPacks : i.id in e.plugins,
696
- disabled: i.status === "unavailable",
697
- onCheckedChange: (h) => U(i, h)
694
+ label: `${r.kind} · ${r.id} (${r.version})`,
695
+ checked: r.kind === "skill" ? r.id in e.skills : r.kind === "skill_pack" ? r.id in e.skillPacks : r.id in e.plugins,
696
+ disabled: r.status === "unavailable",
697
+ onCheckedChange: (h) => W(r, h)
698
698
  },
699
- `${i.kind}:${i.id}`
699
+ `${r.kind}:${r.id}`
700
700
  )) : /* @__PURE__ */ a("p", { children: "No deployed Skills or Plugins." })
701
701
  ] }),
702
702
  /* @__PURE__ */ t("fieldset", { children: [
@@ -704,20 +704,20 @@ function Pa({
704
704
  /* @__PURE__ */ t("label", { children: [
705
705
  /* @__PURE__ */ a("span", { children: "Memory" }),
706
706
  /* @__PURE__ */ a(
707
- fe,
707
+ me,
708
708
  {
709
709
  label: "Memory",
710
- value: ((Ce = e.memory) == null ? void 0 : Ce.mode) ?? "disabled",
711
- options: ["disabled", "session", "subject"].map((i) => ({
712
- value: i,
713
- label: i
710
+ value: ((Ne = e.memory) == null ? void 0 : Ne.mode) ?? "disabled",
711
+ options: ["disabled", "session", "subject"].map((r) => ({
712
+ value: r,
713
+ label: r
714
714
  })),
715
- onChange: (i) => s({
715
+ onChange: (r) => l({
716
716
  ...e,
717
717
  memory: {
718
- ...m(v.MemoryPolicySchema),
718
+ ...v(k.MemoryPolicySchema),
719
719
  ...e.memory,
720
- mode: i
720
+ mode: r
721
721
  }
722
722
  })
723
723
  }
@@ -726,18 +726,18 @@ function Pa({
726
726
  /* @__PURE__ */ t("label", { children: [
727
727
  /* @__PURE__ */ a("span", { children: "Memory TTL days" }),
728
728
  /* @__PURE__ */ a(
729
- x,
729
+ z,
730
730
  {
731
731
  "aria-label": "Memory TTL days",
732
732
  type: "number",
733
733
  min: "0",
734
- value: ((_e = (we = e.memory) == null ? void 0 : we.ttlDays) == null ? void 0 : _e.toString()) ?? "",
735
- onChange: (i) => s({
734
+ value: ((Pe = (_e = e.memory) == null ? void 0 : _e.ttlDays) == null ? void 0 : Pe.toString()) ?? "",
735
+ onChange: (r) => l({
736
736
  ...e,
737
737
  memory: {
738
- ...m(v.MemoryPolicySchema),
738
+ ...v(k.MemoryPolicySchema),
739
739
  ...e.memory,
740
- ttlDays: BigInt(i.target.value || 0)
740
+ ttlDays: BigInt(r.target.value || 0)
741
741
  }
742
742
  })
743
743
  }
@@ -746,17 +746,17 @@ function Pa({
746
746
  /* @__PURE__ */ t("label", { children: [
747
747
  /* @__PURE__ */ a("span", { children: "Knowledge space IDs" }),
748
748
  /* @__PURE__ */ a(
749
- re,
749
+ ce,
750
750
  {
751
751
  "aria-label": "Knowledge space IDs",
752
752
  rows: 2,
753
- value: e.knowledgeBindings.map((i) => i.resourceId).join(`
753
+ value: e.knowledgeBindings.map((r) => r.resourceId).join(`
754
754
  `),
755
- onChange: (i) => s({
755
+ onChange: (r) => l({
756
756
  ...e,
757
- knowledgeBindings: i.target.value.split(`
757
+ knowledgeBindings: r.target.value.split(`
758
758
  `).map((h) => h.trim()).filter(Boolean).map(
759
- (h) => m(v.KnowledgeBindingSchema, {
759
+ (h) => v(k.KnowledgeBindingSchema, {
760
760
  resourceId: h,
761
761
  role: "reader"
762
762
  })
@@ -766,16 +766,16 @@ function Pa({
766
766
  )
767
767
  ] }),
768
768
  /* @__PURE__ */ a(
769
- D,
769
+ L,
770
770
  {
771
771
  label: "Subagents",
772
- checked: ((Ne = e.subagent) == null ? void 0 : Ne.enabled) ?? !1,
773
- onCheckedChange: (i) => s({
772
+ checked: ((Ae = e.subagent) == null ? void 0 : Ae.enabled) ?? !1,
773
+ onCheckedChange: (r) => l({
774
774
  ...e,
775
775
  subagent: {
776
- ...m(v.CapabilityPolicySchema),
776
+ ...v(k.CapabilityPolicySchema),
777
777
  ...e.subagent,
778
- enabled: i
778
+ enabled: r
779
779
  }
780
780
  })
781
781
  }
@@ -783,32 +783,32 @@ function Pa({
783
783
  /* @__PURE__ */ t("label", { children: [
784
784
  /* @__PURE__ */ a("span", { children: "Subagent providers" }),
785
785
  /* @__PURE__ */ a(
786
- x,
786
+ z,
787
787
  {
788
788
  "aria-label": "Subagent providers",
789
- value: ((Pe = e.subagent) == null ? void 0 : Pe.providers.join(", ")) ?? "",
790
- onChange: (i) => s({
789
+ value: ((Ie = e.subagent) == null ? void 0 : Ie.providers.join(", ")) ?? "",
790
+ onChange: (r) => l({
791
791
  ...e,
792
792
  subagent: {
793
- ...m(v.CapabilityPolicySchema),
793
+ ...v(k.CapabilityPolicySchema),
794
794
  ...e.subagent,
795
- providers: Ee(i.target.value)
795
+ providers: qe(r.target.value)
796
796
  }
797
797
  })
798
798
  }
799
799
  )
800
800
  ] }),
801
801
  /* @__PURE__ */ a(
802
- D,
802
+ L,
803
803
  {
804
804
  label: "Collaboration",
805
- checked: ((Ae = e.collaboration) == null ? void 0 : Ae.enabled) ?? !1,
806
- onCheckedChange: (i) => s({
805
+ checked: ((ze = e.collaboration) == null ? void 0 : ze.enabled) ?? !1,
806
+ onCheckedChange: (r) => l({
807
807
  ...e,
808
808
  collaboration: {
809
- ...m(v.CapabilityPolicySchema),
809
+ ...v(k.CapabilityPolicySchema),
810
810
  ...e.collaboration,
811
- enabled: i
811
+ enabled: r
812
812
  }
813
813
  })
814
814
  }
@@ -816,97 +816,97 @@ function Pa({
816
816
  /* @__PURE__ */ t("label", { children: [
817
817
  /* @__PURE__ */ a("span", { children: "Collaboration providers" }),
818
818
  /* @__PURE__ */ a(
819
- x,
819
+ z,
820
820
  {
821
821
  "aria-label": "Collaboration providers",
822
- value: ((ze = e.collaboration) == null ? void 0 : ze.providers.join(", ")) ?? "",
823
- onChange: (i) => s({
822
+ value: ((xe = e.collaboration) == null ? void 0 : xe.providers.join(", ")) ?? "",
823
+ onChange: (r) => l({
824
824
  ...e,
825
825
  collaboration: {
826
- ...m(v.CapabilityPolicySchema),
826
+ ...v(k.CapabilityPolicySchema),
827
827
  ...e.collaboration,
828
- providers: Ee(i.target.value)
828
+ providers: qe(r.target.value)
829
829
  }
830
830
  })
831
831
  }
832
832
  )
833
833
  ] }),
834
834
  /* @__PURE__ */ a(
835
- ha,
835
+ Sa,
836
836
  {
837
837
  value: e.outputPolicy,
838
- onChange: (i) => s({ ...e, outputPolicy: i })
838
+ onChange: (r) => l({ ...e, outputPolicy: r })
839
839
  }
840
840
  )
841
841
  ] }),
842
842
  /* @__PURE__ */ t("div", { className: "af-agent-settings__save", children: [
843
843
  /* @__PURE__ */ a(
844
- S,
844
+ p,
845
845
  {
846
846
  type: "button",
847
- onClick: () => void oe(),
848
- disabled: c === "pending",
849
- children: c === "pending" ? "Saving…" : "Save Profile"
847
+ onClick: () => void ue(),
848
+ disabled: o === "pending",
849
+ children: o === "pending" ? "Saving…" : "Save Profile"
850
850
  }
851
851
  ),
852
- c === "success" && /* @__PURE__ */ t("span", { role: "status", children: [
852
+ o === "success" && /* @__PURE__ */ t("span", { role: "status", children: [
853
853
  "Saved revision ",
854
- n.revision.toString(),
854
+ i.revision.toString(),
855
855
  ". Existing sessions keep their pinned revision."
856
856
  ] }),
857
- c === "error" && /* @__PURE__ */ t("span", { role: "alert", children: [
857
+ o === "error" && /* @__PURE__ */ t("span", { role: "alert", children: [
858
858
  "Save failed: ",
859
859
  u
860
860
  ] })
861
861
  ] })
862
862
  ] });
863
863
  }
864
- const Ee = (e) => [
864
+ const qe = (e) => [
865
865
  ...new Set(
866
- e.split(",").map((l) => l.trim()).filter(Boolean)
866
+ e.split(",").map((n) => n.trim()).filter(Boolean)
867
867
  )
868
868
  ].sort();
869
- function ha({
869
+ function Sa({
870
870
  value: e,
871
- onChange: l
871
+ onChange: n
872
872
  }) {
873
- const s = JSON.stringify(e ?? {}, null, 2), [r, n] = T(s), [o, c] = T("");
874
- return Oe(() => n(s), [s]), /* @__PURE__ */ t("label", { children: [
873
+ const l = JSON.stringify(e ?? {}, null, 2), [s, i] = x(l), [c, o] = x("");
874
+ return We(() => i(l), [l]), /* @__PURE__ */ t("label", { children: [
875
875
  /* @__PURE__ */ a("span", { children: "Output policy JSON" }),
876
876
  /* @__PURE__ */ a(
877
- re,
877
+ ce,
878
878
  {
879
879
  "aria-label": "Output policy JSON",
880
880
  rows: 4,
881
- value: r,
882
- onChange: (u) => n(u.target.value),
881
+ value: s,
882
+ onChange: (u) => i(u.target.value),
883
883
  onBlur: () => {
884
884
  try {
885
- const u = JSON.parse(r);
885
+ const u = JSON.parse(s);
886
886
  if (!u || typeof u != "object" || Array.isArray(u))
887
887
  throw new Error("Output policy must be a JSON object");
888
- c(""), l(
888
+ o(""), n(
889
889
  u
890
890
  );
891
891
  } catch (u) {
892
- c(u instanceof Error ? u.message : String(u));
892
+ o(u instanceof Error ? u.message : String(u));
893
893
  }
894
894
  }
895
895
  }
896
896
  ),
897
- o && /* @__PURE__ */ a("span", { role: "alert", children: o })
897
+ c && /* @__PURE__ */ a("span", { role: "alert", children: c })
898
898
  ] });
899
899
  }
900
- function Aa({
900
+ function qa({
901
901
  editor: e,
902
- preview: l
902
+ preview: n
903
903
  }) {
904
904
  return /* @__PURE__ */ t("div", { className: "af-agent-studio", children: [
905
905
  /* @__PURE__ */ a("section", { "aria-label": "Agent configuration", children: e }),
906
- /* @__PURE__ */ a("section", { "aria-label": "Agent preview", children: l })
906
+ /* @__PURE__ */ a("section", { "aria-label": "Agent preview", children: n })
907
907
  ] });
908
908
  }
909
- const De = {
909
+ const Je = {
910
910
  assistant: "Assistant",
911
911
  newSession: "New conversation",
912
912
  sessions: "Conversations",
@@ -918,30 +918,30 @@ const De = {
918
918
  retry: "Retry",
919
919
  execution: "Execution",
920
920
  explicitSkill: "Invoke skill"
921
- }, de = (e) => ({
922
- ...De,
921
+ }, he = (e) => ({
922
+ ...Je,
923
923
  ...e
924
924
  });
925
- function ua({
925
+ function ya({
926
926
  sessions: e,
927
- activeSessionId: l,
928
- onSelect: s,
929
- onNew: r,
930
- onDelete: n,
931
- labels: o
927
+ activeSessionId: n,
928
+ onSelect: l,
929
+ onNew: s,
930
+ onDelete: i,
931
+ labels: c
932
932
  }) {
933
- const c = de(o);
934
- return /* @__PURE__ */ t("aside", { className: "af-agent-threads", "aria-label": c.sessions, children: [
933
+ const o = he(c);
934
+ return /* @__PURE__ */ t("aside", { className: "af-agent-threads", "aria-label": o.sessions, children: [
935
935
  /* @__PURE__ */ t("div", { className: "af-agent-threads__header", children: [
936
- /* @__PURE__ */ a("strong", { children: c.sessions }),
936
+ /* @__PURE__ */ a("strong", { children: o.sessions }),
937
937
  /* @__PURE__ */ a(
938
- S,
938
+ p,
939
939
  {
940
940
  size: "icon",
941
941
  variant: "ghost",
942
- onClick: r,
943
- "aria-label": c.newSession,
944
- children: /* @__PURE__ */ a(Ye, { size: 17, "aria-hidden": !0 })
942
+ onClick: s,
943
+ "aria-label": o.newSession,
944
+ children: /* @__PURE__ */ a(Xe, { size: 17, "aria-hidden": !0 })
945
945
  }
946
946
  )
947
947
  ] }),
@@ -949,28 +949,28 @@ function ua({
949
949
  "div",
950
950
  {
951
951
  className: "af-agent-thread-row",
952
- "data-active": d.id === l || void 0,
952
+ "data-active": d.id === n || void 0,
953
953
  children: [
954
954
  /* @__PURE__ */ t(
955
955
  "button",
956
956
  {
957
957
  type: "button",
958
958
  className: "af-agent-thread-row__select",
959
- onClick: () => s(d.id),
959
+ onClick: () => l(d.id),
960
960
  children: [
961
961
  /* @__PURE__ */ a("span", { children: d.profileRevisionId }),
962
- /* @__PURE__ */ a(We, { size: 14, "aria-hidden": !0 })
962
+ /* @__PURE__ */ a(Ze, { size: 14, "aria-hidden": !0 })
963
963
  ]
964
964
  }
965
965
  ),
966
- n && /* @__PURE__ */ a(
966
+ i && /* @__PURE__ */ a(
967
967
  "button",
968
968
  {
969
969
  type: "button",
970
970
  className: "af-agent-icon-button",
971
- onClick: () => n(d.id),
971
+ onClick: () => i(d.id),
972
972
  "aria-label": `Delete ${d.id}`,
973
- children: /* @__PURE__ */ a(Qe, { size: 14, "aria-hidden": !0 })
973
+ children: /* @__PURE__ */ a(ea, { size: 14, "aria-hidden": !0 })
974
974
  }
975
975
  )
976
976
  ]
@@ -979,54 +979,54 @@ function ua({
979
979
  )) })
980
980
  ] });
981
981
  }
982
- function pa({
982
+ function Ca({
983
983
  profileRevisionId: e,
984
- explicitSkillSlug: l,
985
- onExplicitSkillChange: s,
986
- labels: r,
987
- registry: n
984
+ explicitSkillSlug: n,
985
+ onExplicitSkillChange: l,
986
+ labels: s,
987
+ registry: i
988
988
  }) {
989
- ce(n);
990
- const o = n == null ? void 0 : n.render("resource-bar", {
989
+ de(i);
990
+ const c = i == null ? void 0 : i.render("resource-bar", {
991
991
  profileRevisionId: e,
992
- explicitSkillSlug: l,
993
- setExplicitSkillSlug: s
992
+ explicitSkillSlug: n,
993
+ setExplicitSkillSlug: l
994
994
  });
995
- if (o) return o;
996
- const c = de(r);
995
+ if (c) return c;
996
+ const o = he(s);
997
997
  return /* @__PURE__ */ t("div", { className: "af-agent-resources", "aria-label": "Agent resources", children: [
998
- /* @__PURE__ */ a(y, { tone: "cool", children: e }),
998
+ /* @__PURE__ */ a(S, { tone: "cool", children: e }),
999
999
  /* @__PURE__ */ a(
1000
- x,
1000
+ z,
1001
1001
  {
1002
- "aria-label": c.explicitSkill,
1003
- placeholder: c.explicitSkill,
1004
- value: l,
1005
- onChange: (d) => s(d.target.value)
1002
+ "aria-label": o.explicitSkill,
1003
+ placeholder: o.explicitSkill,
1004
+ value: n,
1005
+ onChange: (d) => l(d.target.value)
1006
1006
  }
1007
1007
  )
1008
1008
  ] });
1009
1009
  }
1010
- function ga({
1010
+ function wa({
1011
1011
  value: e,
1012
- onChange: l,
1013
- onSubmit: s,
1014
- running: r,
1015
- onStop: n,
1016
- onInject: o,
1017
- onAttachResource: c,
1012
+ onChange: n,
1013
+ onSubmit: l,
1014
+ running: s,
1015
+ onStop: i,
1016
+ onInject: c,
1017
+ onAttachResource: o,
1018
1018
  resources: d = [],
1019
1019
  onRemoveResource: u,
1020
- labels: f
1020
+ labels: m
1021
1021
  }) {
1022
- const g = de(f);
1022
+ const f = he(m);
1023
1023
  return /* @__PURE__ */ t(
1024
1024
  "form",
1025
1025
  {
1026
1026
  className: "af-agent-composer",
1027
- "data-running": r || void 0,
1027
+ "data-running": s || void 0,
1028
1028
  onSubmit: (b) => {
1029
- b.preventDefault(), e.trim() && s();
1029
+ b.preventDefault(), e.trim() && l();
1030
1030
  },
1031
1031
  children: [
1032
1032
  d.length > 0 && /* @__PURE__ */ a(
@@ -1034,7 +1034,7 @@ function ga({
1034
1034
  {
1035
1035
  className: "af-agent-composer__resources",
1036
1036
  "aria-label": "Attached resources",
1037
- children: d.map((b) => /* @__PURE__ */ t(y, { tone: "cool", children: [
1037
+ children: d.map((b) => /* @__PURE__ */ t(S, { tone: "cool", children: [
1038
1038
  b.label,
1039
1039
  u && /* @__PURE__ */ a(
1040
1040
  "button",
@@ -1049,60 +1049,60 @@ function ga({
1049
1049
  }
1050
1050
  ),
1051
1051
  /* @__PURE__ */ a(
1052
- re,
1052
+ ce,
1053
1053
  {
1054
1054
  rows: 2,
1055
1055
  variant: "bare",
1056
1056
  value: e,
1057
- onChange: (b) => l(b.target.value),
1058
- "aria-label": g.composer,
1059
- placeholder: r ? "Steer the active run" : g.composer,
1057
+ onChange: (b) => n(b.target.value),
1058
+ "aria-label": f.composer,
1059
+ placeholder: s ? "Steer the active run" : f.composer,
1060
1060
  onKeyDown: (b) => {
1061
- b.key === "Enter" && !b.shiftKey && (b.preventDefault(), e.trim() && s());
1061
+ b.key === "Enter" && !b.shiftKey && (b.preventDefault(), e.trim() && l());
1062
1062
  }
1063
1063
  }
1064
1064
  ),
1065
1065
  /* @__PURE__ */ t("div", { className: "af-agent-composer__actions", children: [
1066
- c && /* @__PURE__ */ a(
1067
- S,
1066
+ o && /* @__PURE__ */ a(
1067
+ p,
1068
1068
  {
1069
1069
  type: "button",
1070
1070
  size: "icon",
1071
1071
  variant: "ghost",
1072
- onClick: c,
1072
+ onClick: o,
1073
1073
  "aria-label": "Attach document",
1074
- children: /* @__PURE__ */ a(Ge, { size: 17, "aria-hidden": !0 })
1074
+ children: /* @__PURE__ */ a(Ye, { size: 17, "aria-hidden": !0 })
1075
1075
  }
1076
1076
  ),
1077
- r && o && /* @__PURE__ */ a(
1078
- S,
1077
+ s && c && /* @__PURE__ */ a(
1078
+ p,
1079
1079
  {
1080
1080
  type: "button",
1081
1081
  size: "compact",
1082
1082
  variant: "ghost",
1083
1083
  disabled: !e.trim(),
1084
- onClick: o,
1084
+ onClick: c,
1085
1085
  children: "Inject"
1086
1086
  }
1087
1087
  ),
1088
- r ? /* @__PURE__ */ a(
1089
- S,
1088
+ s ? /* @__PURE__ */ a(
1089
+ p,
1090
1090
  {
1091
1091
  type: "button",
1092
1092
  size: "icon",
1093
1093
  variant: "secondary",
1094
- onClick: n,
1095
- "aria-label": g.stop,
1096
- children: /* @__PURE__ */ a(Ve, { size: 17, "aria-hidden": !0 })
1094
+ onClick: i,
1095
+ "aria-label": f.stop,
1096
+ children: /* @__PURE__ */ a(He, { size: 17, "aria-hidden": !0 })
1097
1097
  }
1098
1098
  ) : /* @__PURE__ */ a(
1099
- S,
1099
+ p,
1100
1100
  {
1101
1101
  type: "submit",
1102
1102
  size: "icon",
1103
1103
  disabled: !e.trim(),
1104
- "aria-label": g.send,
1105
- children: /* @__PURE__ */ a(He, { size: 17, "aria-hidden": !0 })
1104
+ "aria-label": f.send,
1105
+ children: /* @__PURE__ */ a(Qe, { size: 17, "aria-hidden": !0 })
1106
1106
  }
1107
1107
  )
1108
1108
  ] })
@@ -1110,42 +1110,42 @@ function ga({
1110
1110
  }
1111
1111
  );
1112
1112
  }
1113
- function fa({
1113
+ function Na({
1114
1114
  model: e,
1115
- explicitSkillSlug: l = "",
1116
- resources: s = [],
1117
- onRemoveResource: r,
1118
- onAttachResource: n,
1119
- registry: o,
1120
- header: c,
1115
+ explicitSkillSlug: n = "",
1116
+ resources: l = [],
1117
+ onRemoveResource: s,
1118
+ onAttachResource: i,
1119
+ registry: c,
1120
+ header: o,
1121
1121
  labels: d,
1122
1122
  onError: u
1123
1123
  }) {
1124
- var Y, W;
1125
- ce(o);
1126
- const f = de(d), g = na(e), [C, b] = T(""), [w, M] = T(""), U = g.status === "submitting" || g.status === "queued" || g.status === "running" || g.status === "waiting_for_input", oe = g.projection.items.filter(
1127
- (k) => k.slot === "trace-item"
1128
- ), H = g.projection.items.filter(
1129
- (k) => k.slot !== "trace-item" && (k.slot !== "message-content" || k.text.length > 0)
1130
- ), J = (k) => u == null ? void 0 : u(k instanceof Error ? k : new Error(String(k))), R = async (k, E = U ? "steer" : "followup") => {
1131
- var Q;
1132
- const A = k.trim();
1133
- if (A) {
1134
- b(""), M(A);
1124
+ var H, Q;
1125
+ de(c);
1126
+ const m = he(d), f = ha(e), [N, b] = x(""), [_, M] = x(""), W = f.status === "submitting" || f.status === "queued" || f.status === "running" || f.status === "waiting_for_input", ue = f.projection.items.filter(
1127
+ (w) => w.slot === "trace-item"
1128
+ ), Y = f.projection.items.filter(
1129
+ (w) => w.slot !== "trace-item" && (w.slot !== "message-content" || w.text.length > 0)
1130
+ ), F = (w) => u == null ? void 0 : u(w instanceof Error ? w : new Error(String(w))), E = async (w, q = W ? "steer" : "followup") => {
1131
+ var X;
1132
+ const I = w.trim();
1133
+ if (I) {
1134
+ b(""), M(I);
1135
1135
  try {
1136
- E === "steer" ? await e.steerText(A) : E === "inject" ? await e.injectText(A) : await e.submitContent(
1136
+ q === "steer" ? await e.steerText(I) : q === "inject" ? await e.injectText(I) : await e.submitContent(
1137
1137
  [
1138
- m(v.ContentBlockSchema, {
1138
+ v(k.ContentBlockSchema, {
1139
1139
  block: {
1140
1140
  case: "text",
1141
- value: m(v.TextBlockSchema, { text: A })
1141
+ value: v(k.TextBlockSchema, { text: I })
1142
1142
  }
1143
1143
  }),
1144
- ...s.map(
1145
- (j) => m(v.ContentBlockSchema, {
1144
+ ...l.map(
1145
+ (j) => v(k.ContentBlockSchema, {
1146
1146
  block: {
1147
1147
  case: "resource",
1148
- value: m(v.ResourceBlockSchema, {
1148
+ value: v(k.ResourceBlockSchema, {
1149
1149
  resourceId: j.resourceId,
1150
1150
  mediaType: j.mediaType ?? "application/vnd.agentfactory.document"
1151
1151
  })
@@ -1153,342 +1153,545 @@ function fa({
1153
1153
  })
1154
1154
  )
1155
1155
  ],
1156
- l
1156
+ n
1157
1157
  );
1158
1158
  } catch (j) {
1159
- b(((Q = e.getSnapshot().retryDraft) == null ? void 0 : Q.text) ?? A), J(j);
1159
+ b(((X = e.getSnapshot().retryDraft) == null ? void 0 : X.text) ?? I), F(j);
1160
1160
  }
1161
1161
  }
1162
1162
  };
1163
- return /* @__PURE__ */ t("section", { className: "af-agent-conversation", "aria-label": f.assistant, children: [
1164
- c && /* @__PURE__ */ a("header", { className: "af-agent-conversation__header", children: c }),
1163
+ return /* @__PURE__ */ t("section", { className: "af-agent-conversation", "aria-label": m.assistant, children: [
1164
+ o && /* @__PURE__ */ a("header", { className: "af-agent-conversation__header", children: o }),
1165
1165
  /* @__PURE__ */ t("div", { className: "af-agent-messages", "aria-live": "polite", children: [
1166
- !H.length && g.status === "idle" && /* @__PURE__ */ a(
1167
- z,
1166
+ !Y.length && f.status === "idle" && /* @__PURE__ */ a(
1167
+ A,
1168
1168
  {
1169
1169
  size: "md",
1170
- title: f.emptyTitle,
1171
- description: f.emptyDescription,
1172
- icon: /* @__PURE__ */ a(qe, { size: 24, "aria-hidden": !0 })
1170
+ title: m.emptyTitle,
1171
+ description: m.emptyDescription,
1172
+ icon: /* @__PURE__ */ a(Le, { size: 24, "aria-hidden": !0 })
1173
1173
  }
1174
1174
  ),
1175
1175
  /* @__PURE__ */ a(
1176
- sa,
1176
+ ma,
1177
1177
  {
1178
- items: H,
1179
- registry: o,
1180
- onResolveInteraction: async (k, E) => {
1178
+ items: Y,
1179
+ registry: c,
1180
+ onResolveInteraction: async (w, q) => {
1181
1181
  try {
1182
- await e.resolveInteraction(k, E);
1183
- } catch (A) {
1184
- throw J(A), A;
1182
+ await e.resolveInteraction(w, q);
1183
+ } catch (I) {
1184
+ throw F(I), I;
1185
1185
  }
1186
1186
  }
1187
1187
  }
1188
1188
  ),
1189
- g.status !== "waiting_for_input" && U && /* @__PURE__ */ a("span", { className: "af-agent-thinking", children: "Thinking…" }),
1190
- g.status === "disconnected" && /* @__PURE__ */ a(
1191
- z,
1189
+ f.status !== "waiting_for_input" && W && /* @__PURE__ */ a("span", { className: "af-agent-thinking", children: "Thinking…" }),
1190
+ f.status === "disconnected" && /* @__PURE__ */ a(
1191
+ A,
1192
1192
  {
1193
1193
  variant: "error",
1194
1194
  size: "sm",
1195
- title: ((Y = g.error) == null ? void 0 : Y.message) ?? "Disconnected",
1195
+ title: ((H = f.error) == null ? void 0 : H.message) ?? "Disconnected",
1196
1196
  action: {
1197
- label: f.retry,
1198
- onClick: () => void e.retry().catch(J)
1197
+ label: m.retry,
1198
+ onClick: () => void e.retry().catch(F)
1199
1199
  }
1200
1200
  }
1201
1201
  ),
1202
- g.status === "failed" && /* @__PURE__ */ a(
1203
- z,
1202
+ f.status === "failed" && /* @__PURE__ */ a(
1203
+ A,
1204
1204
  {
1205
1205
  variant: "error",
1206
1206
  size: "sm",
1207
- title: ((W = g.error) == null ? void 0 : W.message) ?? "Run failed",
1208
- action: { label: f.retry, onClick: () => void R(w) }
1207
+ title: ((Q = f.error) == null ? void 0 : Q.message) ?? "Run failed",
1208
+ action: { label: m.retry, onClick: () => void E(_) }
1209
1209
  }
1210
1210
  ),
1211
- g.status === "max_steps_reached" && /* @__PURE__ */ a(
1212
- z,
1211
+ f.status === "max_steps_reached" && /* @__PURE__ */ a(
1212
+ A,
1213
1213
  {
1214
1214
  variant: "error",
1215
1215
  size: "sm",
1216
1216
  title: "Maximum steps reached",
1217
- action: { label: f.retry, onClick: () => void R(w) }
1217
+ action: { label: m.retry, onClick: () => void E(_) }
1218
1218
  }
1219
1219
  ),
1220
1220
  /* @__PURE__ */ a(
1221
- ta,
1221
+ pa,
1222
1222
  {
1223
- items: oe,
1224
- registry: o,
1225
- label: f.execution
1223
+ items: ue,
1224
+ registry: c,
1225
+ label: m.execution
1226
1226
  }
1227
1227
  )
1228
1228
  ] }),
1229
- (o == null ? void 0 : o.render("composer", {
1230
- draft: C,
1231
- running: U,
1232
- submit: () => void R(C),
1229
+ (c == null ? void 0 : c.render("composer", {
1230
+ draft: N,
1231
+ running: W,
1232
+ submit: () => void E(N),
1233
1233
  stop: () => void e.cancel(),
1234
1234
  setDraft: b
1235
1235
  })) ?? /* @__PURE__ */ a(
1236
- ga,
1236
+ wa,
1237
1237
  {
1238
- value: C,
1238
+ value: N,
1239
1239
  onChange: b,
1240
- onSubmit: () => void R(C),
1241
- running: U,
1240
+ onSubmit: () => void E(N),
1241
+ running: W,
1242
1242
  onStop: () => void e.cancel(),
1243
- onInject: () => void R(C, "inject"),
1244
- onAttachResource: n,
1245
- resources: s,
1246
- onRemoveResource: r,
1247
- labels: f
1243
+ onInject: () => void E(N, "inject"),
1244
+ onAttachResource: i,
1245
+ resources: l,
1246
+ onRemoveResource: s,
1247
+ labels: m
1248
1248
  }
1249
1249
  )
1250
1250
  ] });
1251
1251
  }
1252
- function za({
1252
+ function ja({
1253
1253
  model: e,
1254
- title: l = De.assistant,
1255
- subtitle: s,
1256
- profileRevisionId: r,
1257
- sessions: n,
1258
- activeSessionId: o,
1259
- onSelectSession: c,
1254
+ title: n = Je.assistant,
1255
+ subtitle: l,
1256
+ profileRevisionId: s,
1257
+ sessions: i,
1258
+ activeSessionId: c,
1259
+ onSelectSession: o,
1260
1260
  onNewSession: d,
1261
1261
  onDeleteSession: u,
1262
- registry: f,
1263
- labels: g
1262
+ registry: m,
1263
+ labels: f
1264
1264
  }) {
1265
- const [C, b] = T(""), w = de(g), M = Ue(
1266
- () => /* @__PURE__ */ t(me, { children: [
1265
+ const [N, b] = x(""), _ = he(f), M = Fe(
1266
+ () => /* @__PURE__ */ t(ke, { children: [
1267
1267
  /* @__PURE__ */ t("div", { className: "af-agent-title", children: [
1268
- /* @__PURE__ */ a(ve, { initials: "AF", size: 36 }),
1268
+ /* @__PURE__ */ a(Se, { initials: "AF", size: 36 }),
1269
1269
  /* @__PURE__ */ t("div", { children: [
1270
- /* @__PURE__ */ a("strong", { children: l }),
1271
- s && /* @__PURE__ */ a("span", { children: s })
1270
+ /* @__PURE__ */ a("strong", { children: n }),
1271
+ l && /* @__PURE__ */ a("span", { children: l })
1272
1272
  ] })
1273
1273
  ] }),
1274
1274
  /* @__PURE__ */ a(
1275
- pa,
1275
+ Ca,
1276
1276
  {
1277
- profileRevisionId: r,
1278
- explicitSkillSlug: C,
1277
+ profileRevisionId: s,
1278
+ explicitSkillSlug: N,
1279
1279
  onExplicitSkillChange: b,
1280
- registry: f,
1281
- labels: w
1280
+ registry: m,
1281
+ labels: _
1282
1282
  }
1283
1283
  )
1284
1284
  ] }),
1285
- [l, s, r, C, f, w]
1285
+ [n, l, s, N, m, _]
1286
1286
  );
1287
1287
  return /* @__PURE__ */ t("div", { className: "af-agent-chat", "data-testid": "agent-chat", children: [
1288
- n && c && d && /* @__PURE__ */ a(
1289
- ua,
1288
+ i && o && d && /* @__PURE__ */ a(
1289
+ ya,
1290
1290
  {
1291
- sessions: n,
1292
- activeSessionId: o,
1293
- onSelect: c,
1291
+ sessions: i,
1292
+ activeSessionId: c,
1293
+ onSelect: o,
1294
1294
  onNew: d,
1295
1295
  onDelete: u,
1296
- labels: w
1296
+ labels: _
1297
1297
  }
1298
1298
  ),
1299
1299
  /* @__PURE__ */ a(
1300
- fa,
1300
+ Na,
1301
1301
  {
1302
1302
  model: e,
1303
- explicitSkillSlug: C,
1304
- registry: f,
1303
+ explicitSkillSlug: N,
1304
+ registry: m,
1305
1305
  header: M,
1306
- labels: w
1306
+ labels: _
1307
1307
  }
1308
1308
  )
1309
1309
  ] });
1310
1310
  }
1311
- function xa({ skills: e, installed: l, busy: s = "", completeness: r = "complete", onInstall: n, onUninstall: o }) {
1311
+ function Ba({ skills: e, installed: n, busy: l = "", completeness: s = "complete", onInstall: i, onUninstall: c }) {
1312
1312
  return e.length ? /* @__PURE__ */ t("section", { className: "af-agent-manager", "aria-label": "Skill and SkillPack catalog", children: [
1313
1313
  /* @__PURE__ */ t("header", { children: [
1314
1314
  /* @__PURE__ */ t("div", { children: [
1315
- /* @__PURE__ */ t(N, { children: [
1316
- /* @__PURE__ */ a(Xe, { size: 14, "aria-hidden": !0 }),
1315
+ /* @__PURE__ */ t(y, { children: [
1316
+ /* @__PURE__ */ a(aa, { size: 14, "aria-hidden": !0 }),
1317
1317
  " Capability catalog"
1318
1318
  ] }),
1319
- /* @__PURE__ */ t(P, { children: [
1319
+ /* @__PURE__ */ t(C, { children: [
1320
1320
  e.length,
1321
1321
  " deployed definitions"
1322
1322
  ] })
1323
1323
  ] }),
1324
- /* @__PURE__ */ a(y, { tone: r === "complete" ? "success" : "warning", children: r })
1324
+ /* @__PURE__ */ a(S, { tone: s === "complete" ? "success" : "warning", children: s })
1325
1325
  ] }),
1326
- /* @__PURE__ */ a("div", { className: "af-agent-manager__list", children: e.map((c) => {
1327
- const d = ba(c), u = l.has(d);
1328
- return /* @__PURE__ */ t(V, { as: "article", children: [
1326
+ /* @__PURE__ */ a("div", { className: "af-agent-manager__list", children: e.map((o) => {
1327
+ const d = _a(o), u = n.has(d);
1328
+ return /* @__PURE__ */ t(R, { as: "article", children: [
1329
1329
  /* @__PURE__ */ t("div", { children: [
1330
- /* @__PURE__ */ t(N, { children: [
1331
- c.kind,
1330
+ /* @__PURE__ */ t(y, { children: [
1331
+ o.kind,
1332
1332
  " · ",
1333
- c.provider
1333
+ o.provider
1334
1334
  ] }),
1335
- /* @__PURE__ */ a(P, { children: c.title || c.slug }),
1336
- /* @__PURE__ */ a("p", { children: c.description || `${c.slug}@${c.version}` })
1335
+ /* @__PURE__ */ a(C, { children: o.title || o.slug }),
1336
+ /* @__PURE__ */ a("p", { children: o.description || `${o.slug}@${o.version}` })
1337
1337
  ] }),
1338
1338
  /* @__PURE__ */ t("div", { className: "af-agent-manager__actions", children: [
1339
- /* @__PURE__ */ a(y, { tone: u ? "success" : "neutral", children: u ? "Installed" : c.trust || "Available" }),
1340
- /* @__PURE__ */ a(S, { size: "compact", variant: u ? "secondary" : "primary", disabled: s === d, onClick: () => void (u ? o(c) : n(c)), children: s === d ? "Updating…" : u ? "Uninstall" : "Install" })
1339
+ /* @__PURE__ */ a(S, { tone: u ? "success" : "neutral", children: u ? "Installed" : o.trust || "Available" }),
1340
+ /* @__PURE__ */ a(p, { size: "compact", variant: u ? "secondary" : "primary", disabled: l === d, onClick: () => void (u ? c(o) : i(o)), children: l === d ? "Updating…" : u ? "Uninstall" : "Install" })
1341
1341
  ] })
1342
1342
  ] }, d);
1343
1343
  }) })
1344
- ] }) : /* @__PURE__ */ a(z, { size: "sm", title: "No Skills available", description: "The configured providers returned an empty catalog." });
1344
+ ] }) : /* @__PURE__ */ a(A, { size: "sm", title: "No Skills available", description: "The configured providers returned an empty catalog." });
1345
1345
  }
1346
- function Ta({ memories: e, busy: l = "", onConfirm: s, onDelete: r }) {
1346
+ function La({ memories: e, busy: n = "", onConfirm: l, onDelete: s }) {
1347
1347
  return /* @__PURE__ */ t("section", { className: "af-agent-manager", "aria-label": "Memory center", children: [
1348
1348
  /* @__PURE__ */ a("header", { children: /* @__PURE__ */ t("div", { children: [
1349
- /* @__PURE__ */ t(N, { children: [
1350
- /* @__PURE__ */ a(ea, { size: 14, "aria-hidden": !0 }),
1349
+ /* @__PURE__ */ t(y, { children: [
1350
+ /* @__PURE__ */ a(ta, { size: 14, "aria-hidden": !0 }),
1351
1351
  " Governed memory"
1352
1352
  ] }),
1353
- /* @__PURE__ */ t(P, { children: [
1353
+ /* @__PURE__ */ t(C, { children: [
1354
1354
  e.length,
1355
1355
  " records"
1356
1356
  ] })
1357
1357
  ] }) }),
1358
- e.length ? /* @__PURE__ */ a("div", { className: "af-agent-manager__list", children: e.map((n) => /* @__PURE__ */ t(V, { as: "article", children: [
1358
+ e.length ? /* @__PURE__ */ a("div", { className: "af-agent-manager__list", children: e.map((i) => /* @__PURE__ */ t(R, { as: "article", children: [
1359
1359
  /* @__PURE__ */ t("div", { children: [
1360
- /* @__PURE__ */ t(N, { children: [
1361
- n.status,
1360
+ /* @__PURE__ */ t(y, { children: [
1361
+ i.status,
1362
1362
  " · ",
1363
- n.risk || "unrated"
1363
+ i.risk || "unrated"
1364
1364
  ] }),
1365
- /* @__PURE__ */ a(P, { children: n.content }),
1365
+ /* @__PURE__ */ a(C, { children: i.content }),
1366
1366
  /* @__PURE__ */ t("p", { children: [
1367
1367
  "Source ",
1368
- n.sourceSessionId || "unknown",
1368
+ i.sourceSessionId || "unknown",
1369
1369
  " · event ",
1370
- n.sourceEventSeq.toString()
1370
+ i.sourceEventSeq.toString()
1371
1371
  ] })
1372
1372
  ] }),
1373
1373
  /* @__PURE__ */ t("div", { className: "af-agent-manager__actions", children: [
1374
- /* @__PURE__ */ a(y, { tone: n.status === "confirmed" ? "success" : "warning", children: n.status }),
1375
- n.status !== "confirmed" && /* @__PURE__ */ a(S, { size: "compact", disabled: l === n.id, onClick: () => void s(n), children: "Confirm" }),
1376
- /* @__PURE__ */ a(S, { size: "compact", variant: "ghost", disabled: l === n.id, onClick: () => void r(n), children: "Delete" })
1374
+ /* @__PURE__ */ a(S, { tone: i.status === "confirmed" ? "success" : "warning", children: i.status }),
1375
+ i.status !== "confirmed" && /* @__PURE__ */ a(p, { size: "compact", disabled: n === i.id, onClick: () => void l(i), children: "Confirm" }),
1376
+ /* @__PURE__ */ a(p, { size: "compact", variant: "ghost", disabled: n === i.id, onClick: () => void s(i), children: "Delete" })
1377
1377
  ] })
1378
- ] }, n.id)) }) : /* @__PURE__ */ a(z, { size: "sm", title: "No retained memories", description: "Candidates appear here with source, risk and consent state." })
1378
+ ] }, i.id)) }) : /* @__PURE__ */ a(A, { size: "sm", title: "No retained memories", description: "Candidates appear here with source, risk and consent state." })
1379
1379
  ] });
1380
1380
  }
1381
- function Ra({ collaboration: e, tasks: l, busy: s = !1, onCancel: r }) {
1381
+ function Ja({ collaboration: e, tasks: n, busy: l = !1, onCancel: s }) {
1382
1382
  return e ? /* @__PURE__ */ t("section", { className: "af-agent-manager", "aria-label": "Collaboration tasks", children: [
1383
1383
  /* @__PURE__ */ t("header", { children: [
1384
1384
  /* @__PURE__ */ t("div", { children: [
1385
- /* @__PURE__ */ t(N, { children: [
1386
- /* @__PURE__ */ a($e, { size: 14, "aria-hidden": !0 }),
1385
+ /* @__PURE__ */ t(y, { children: [
1386
+ /* @__PURE__ */ a(De, { size: 14, "aria-hidden": !0 }),
1387
1387
  " Collaboration"
1388
1388
  ] }),
1389
- /* @__PURE__ */ a(P, { children: e.id })
1389
+ /* @__PURE__ */ a(C, { children: e.id })
1390
1390
  ] }),
1391
1391
  /* @__PURE__ */ t("div", { className: "af-agent-manager__actions", children: [
1392
- /* @__PURE__ */ a(y, { tone: e.status === "completed" ? "success" : "cool", children: e.status }),
1393
- r && e.status !== "completed" && /* @__PURE__ */ a(S, { size: "compact", variant: "secondary", disabled: s, onClick: () => void r(), children: s ? "Cancelling…" : "Cancel" })
1392
+ /* @__PURE__ */ a(S, { tone: e.status === "completed" ? "success" : "cool", children: e.status }),
1393
+ s && e.status !== "completed" && /* @__PURE__ */ a(p, { size: "compact", variant: "secondary", disabled: l, onClick: () => void s(), children: l ? "Cancelling…" : "Cancel" })
1394
1394
  ] })
1395
1395
  ] }),
1396
- /* @__PURE__ */ a("ol", { className: "af-agent-task-tree", children: l.map((n) => /* @__PURE__ */ t("li", { children: [
1396
+ /* @__PURE__ */ a("ol", { className: "af-agent-task-tree", children: n.map((i) => /* @__PURE__ */ t("li", { children: [
1397
1397
  /* @__PURE__ */ a("span", { "aria-hidden": !0 }),
1398
1398
  /* @__PURE__ */ t("div", { children: [
1399
- /* @__PURE__ */ a("strong", { children: n.objective }),
1399
+ /* @__PURE__ */ a("strong", { children: i.objective }),
1400
1400
  /* @__PURE__ */ t("p", { children: [
1401
- n.provider,
1401
+ i.provider,
1402
1402
  " · ",
1403
- n.status,
1403
+ i.status,
1404
1404
  " · attempt ",
1405
- n.attempts
1405
+ i.attempts
1406
1406
  ] }),
1407
- n.result && /* @__PURE__ */ a("p", { children: n.result })
1407
+ i.result && /* @__PURE__ */ a("p", { children: i.result })
1408
1408
  ] }),
1409
- /* @__PURE__ */ a(y, { tone: n.status === "completed" ? "success" : n.status === "failed" ? "warning" : "cool", children: n.status })
1410
- ] }, n.id)) })
1411
- ] }) : /* @__PURE__ */ a(z, { size: "sm", title: "No active collaboration", description: "Subagent and collaboration runs will expose their task tree here.", icon: /* @__PURE__ */ a($e, { size: 22, "aria-hidden": !0 }) });
1409
+ /* @__PURE__ */ a(S, { tone: i.status === "completed" ? "success" : i.status === "failed" ? "warning" : "cool", children: i.status })
1410
+ ] }, i.id)) })
1411
+ ] }) : /* @__PURE__ */ a(A, { size: "sm", title: "No active collaboration", description: "Subagent and collaboration runs will expose their task tree here.", icon: /* @__PURE__ */ a(De, { size: 22, "aria-hidden": !0 }) });
1412
1412
  }
1413
- function $a({ documents: e, onBind: l, onAttach: s, onOpen: r }) {
1413
+ function Oa({ documents: e, onBind: n, onAttach: l, onOpen: s }) {
1414
1414
  return /* @__PURE__ */ t("section", { className: "af-agent-manager", "aria-label": "Agent document library", children: [
1415
1415
  /* @__PURE__ */ a("header", { children: /* @__PURE__ */ t("div", { children: [
1416
- /* @__PURE__ */ t(N, { children: [
1417
- /* @__PURE__ */ a(Ze, { size: 14, "aria-hidden": !0 }),
1416
+ /* @__PURE__ */ t(y, { children: [
1417
+ /* @__PURE__ */ a(na, { size: 14, "aria-hidden": !0 }),
1418
1418
  " Agent and Docs"
1419
1419
  ] }),
1420
- /* @__PURE__ */ t(P, { children: [
1420
+ /* @__PURE__ */ t(C, { children: [
1421
1421
  e.length,
1422
1422
  " accessible documents"
1423
1423
  ] })
1424
1424
  ] }) }),
1425
- e.length ? /* @__PURE__ */ a("div", { className: "af-agent-manager__list", children: e.map((n) => /* @__PURE__ */ t(V, { as: "article", children: [
1425
+ e.length ? /* @__PURE__ */ a("div", { className: "af-agent-manager__list", children: e.map((i) => /* @__PURE__ */ t(R, { as: "article", children: [
1426
1426
  /* @__PURE__ */ t("div", { children: [
1427
- /* @__PURE__ */ t(N, { children: [
1428
- n.space,
1427
+ /* @__PURE__ */ t(y, { children: [
1428
+ i.space,
1429
1429
  " · revision ",
1430
- n.revision
1430
+ i.revision
1431
1431
  ] }),
1432
- /* @__PURE__ */ a(P, { children: n.title }),
1433
- /* @__PURE__ */ a("p", { children: n.availability || "Ready for grounded context and document actions" })
1432
+ /* @__PURE__ */ a(C, { children: i.title }),
1433
+ /* @__PURE__ */ a("p", { children: i.availability || "Ready for grounded context and document actions" })
1434
1434
  ] }),
1435
1435
  /* @__PURE__ */ t("div", { className: "af-agent-manager__actions", children: [
1436
- /* @__PURE__ */ a(y, { tone: n.bound ? "success" : "neutral", children: n.bound ? "Space in Profile knowledge" : "Space not bound" }),
1437
- /* @__PURE__ */ a(S, { size: "compact", variant: "secondary", onClick: () => l(n), children: n.bound ? "Unbind space" : "Bind space" }),
1438
- /* @__PURE__ */ a(S, { size: "compact", variant: n.attached ? "secondary" : "primary", onClick: () => s(n), children: n.attached ? "Remove from prompt" : "Use in prompt" }),
1439
- r && /* @__PURE__ */ a(S, { size: "compact", variant: "ghost", onClick: () => r(n), children: "Open editor" })
1436
+ /* @__PURE__ */ a(S, { tone: i.bound ? "success" : "neutral", children: i.bound ? "Space in Profile knowledge" : "Space not bound" }),
1437
+ /* @__PURE__ */ a(p, { size: "compact", variant: "secondary", onClick: () => n(i), children: i.bound ? "Unbind space" : "Bind space" }),
1438
+ /* @__PURE__ */ a(p, { size: "compact", variant: i.attached ? "secondary" : "primary", onClick: () => l(i), children: i.attached ? "Remove from prompt" : "Use in prompt" }),
1439
+ s && /* @__PURE__ */ a(p, { size: "compact", variant: "ghost", onClick: () => s(i), children: "Open editor" })
1440
1440
  ] })
1441
- ] }, n.id)) }) : /* @__PURE__ */ a(z, { size: "sm", title: "No accessible documents", description: "Create or share a Docs space, then bind its knowledge to this Profile or attach one document to a prompt." })
1441
+ ] }, i.id)) }) : /* @__PURE__ */ a(A, { size: "sm", title: "No accessible documents", description: "Create or share a Docs space, then bind its knowledge to this Profile or attach one document to a prompt." })
1442
1442
  ] });
1443
1443
  }
1444
- function Ia({ revisions: e, currentId: l, onFork: s }) {
1444
+ function Ua({ revisions: e, currentId: n, onFork: l }) {
1445
1445
  return /* @__PURE__ */ t("section", { className: "af-agent-manager", "aria-label": "Profile revision history", children: [
1446
1446
  /* @__PURE__ */ a("header", { children: /* @__PURE__ */ t("div", { children: [
1447
- /* @__PURE__ */ t(N, { children: [
1448
- /* @__PURE__ */ a(aa, { size: 14, "aria-hidden": !0 }),
1447
+ /* @__PURE__ */ t(y, { children: [
1448
+ /* @__PURE__ */ a(ia, { size: 14, "aria-hidden": !0 }),
1449
1449
  " Revision history"
1450
1450
  ] }),
1451
- /* @__PURE__ */ t(P, { children: [
1451
+ /* @__PURE__ */ t(C, { children: [
1452
1452
  e.length,
1453
1453
  " immutable revisions"
1454
1454
  ] })
1455
1455
  ] }) }),
1456
- /* @__PURE__ */ a("ol", { className: "af-agent-revisions", children: [...e].sort((r, n) => Number(n.revision - r.revision)).map((r) => /* @__PURE__ */ t("li", { children: [
1456
+ /* @__PURE__ */ a("ol", { className: "af-agent-revisions", children: [...e].sort((s, i) => Number(i.revision - s.revision)).map((s) => /* @__PURE__ */ t("li", { children: [
1457
+ /* @__PURE__ */ t("div", { children: [
1458
+ /* @__PURE__ */ t("strong", { children: [
1459
+ "Revision ",
1460
+ s.revision.toString()
1461
+ ] }),
1462
+ /* @__PURE__ */ a("p", { children: s.id })
1463
+ ] }),
1464
+ /* @__PURE__ */ a(S, { tone: s.id === n ? "success" : "neutral", children: s.id === n ? "Current" : "Pinned" }),
1465
+ l && /* @__PURE__ */ a(p, { size: "compact", variant: "ghost", onClick: () => l(s), children: "Start session" })
1466
+ ] }, s.id)) })
1467
+ ] });
1468
+ }
1469
+ const _a = (e) => `${e.kind}:${e.slug}@${e.version}`, je = {
1470
+ definitions: [],
1471
+ instances: [],
1472
+ revisions: [],
1473
+ runs: [],
1474
+ steps: [],
1475
+ actionFacts: [],
1476
+ capabilities: [],
1477
+ nodeSchemas: [],
1478
+ loading: !1
1479
+ };
1480
+ class Wa {
1481
+ constructor(n, l = "") {
1482
+ $(this, "state");
1483
+ $(this, "listeners", /* @__PURE__ */ new Set());
1484
+ $(this, "generation", 0);
1485
+ $(this, "getSnapshot", () => this.state);
1486
+ $(this, "subscribe", (n) => (this.listeners.add(n), () => this.listeners.delete(n)));
1487
+ this.transport = n, this.state = { ...je, scope: l };
1488
+ }
1489
+ setScope(n) {
1490
+ n !== this.state.scope && (this.generation += 1, this.state = { ...je, scope: n }, this.listeners.forEach((l) => l()));
1491
+ }
1492
+ async refresh() {
1493
+ return this.run(async () => {
1494
+ const [n, l, s] = await Promise.all([
1495
+ this.transport.getCatalog({}),
1496
+ this.transport.listDefinitions({}),
1497
+ this.transport.listInstances({})
1498
+ ]);
1499
+ return { capabilities: n.capabilities, nodeSchemas: n.nodeSchemas, definitions: l.items, instances: s.items };
1500
+ });
1501
+ }
1502
+ async openDefinition(n) {
1503
+ return this.run(async () => {
1504
+ const l = await this.transport.listRevisions({ definitionId: n });
1505
+ return { selectedDefinitionId: n, revisions: l.items };
1506
+ });
1507
+ }
1508
+ async openInstance(n) {
1509
+ const l = this.state.scope;
1510
+ return this.run(async () => {
1511
+ const [s, i, c, o] = await Promise.all([
1512
+ this.transport.listRuns({ instanceId: n }),
1513
+ this.transport.listActionFacts({ instanceId: n, kind: "intent" }),
1514
+ this.transport.inspectInstance({ instanceId: n }),
1515
+ this.transport.explainInstance({ instanceId: n })
1516
+ ]), d = l === this.state.scope && s.items[0] ? (await this.transport.listSteps({ runId: s.items[0].runId })).items : [];
1517
+ return {
1518
+ selectedInstanceId: n,
1519
+ runs: s.items,
1520
+ steps: d,
1521
+ actionFacts: i.items,
1522
+ inspection: Be(c.inspectionJson),
1523
+ explanation: Be(o.explanationJson)
1524
+ };
1525
+ });
1526
+ }
1527
+ async control(n, l = "user requested", s) {
1528
+ const i = this.state.selectedInstanceId;
1529
+ if (!i) throw new Error("select an instance before controlling it");
1530
+ await this.run(async () => (await this.transport.controlInstance({ instanceId: i, action: n, reason: l, actionId: s }), {})), this.state.selectedInstanceId === i && await this.openInstance(i);
1531
+ }
1532
+ async run(n) {
1533
+ const l = this.generation;
1534
+ this.update({ loading: !0, error: void 0 });
1535
+ try {
1536
+ const s = await n();
1537
+ return l === this.generation && this.update({ ...s, loading: !1 }), s;
1538
+ } catch (s) {
1539
+ const i = s instanceof Error ? s : new Error(String(s));
1540
+ throw l === this.generation && this.update({ loading: !1, error: i }), i;
1541
+ }
1542
+ }
1543
+ update(n) {
1544
+ this.state = { ...this.state, ...n }, this.listeners.forEach((l) => l());
1545
+ }
1546
+ }
1547
+ const Pa = (e) => ve(e.subscribe, e.getSnapshot, e.getSnapshot);
1548
+ function Fa({ controller: e }) {
1549
+ const n = Pa(e), [l, s] = x(""), i = n.instances.find((c) => c.instanceId === n.selectedInstanceId);
1550
+ return n.error && !n.definitions.length && !n.instances.length ? /* @__PURE__ */ a(A, { title: "Workflow unavailable", description: n.error.message, action: { label: "Retry", onClick: () => void e.refresh() } }) : /* @__PURE__ */ t("section", { className: "af-agent-manager", "aria-label": "Workflow workbench", children: [
1551
+ /* @__PURE__ */ t("header", { children: [
1552
+ /* @__PURE__ */ t("div", { children: [
1553
+ /* @__PURE__ */ t(y, { children: [
1554
+ /* @__PURE__ */ a(la, { size: 14, "aria-hidden": !0 }),
1555
+ " Workflow runtime"
1556
+ ] }),
1557
+ /* @__PURE__ */ t(C, { children: [
1558
+ n.instances.length,
1559
+ " instances · ",
1560
+ n.definitions.length,
1561
+ " definitions"
1562
+ ] }),
1563
+ /* @__PURE__ */ t("p", { children: [
1564
+ n.capabilities.length,
1565
+ " capabilities · ",
1566
+ n.nodeSchemas.length,
1567
+ " authoring schemas"
1568
+ ] })
1569
+ ] }),
1570
+ /* @__PURE__ */ a(p, { size: "compact", variant: "secondary", disabled: n.loading, onClick: () => void e.refresh(), children: n.loading ? "Loading…" : "Refresh" })
1571
+ ] }),
1572
+ !n.instances.length && !n.definitions.length ? /* @__PURE__ */ a(A, { size: "sm", title: "No workflows", description: "Published definitions and their runtime instances appear here." }) : /* @__PURE__ */ t("div", { className: "af-agent-manager__list", children: [
1573
+ n.definitions.map((c) => /* @__PURE__ */ t(R, { as: "article", children: [
1574
+ /* @__PURE__ */ t("div", { children: [
1575
+ /* @__PURE__ */ a(y, { children: "Definition · revision history" }),
1576
+ /* @__PURE__ */ a(C, { children: c.name || c.definitionId }),
1577
+ /* @__PURE__ */ a("p", { children: c.definitionId })
1578
+ ] }),
1579
+ /* @__PURE__ */ t("div", { className: "af-agent-manager__actions", children: [
1580
+ /* @__PURE__ */ a(S, { tone: c.archived ? "warning" : "success", children: c.archived ? "Archived" : "Active" }),
1581
+ /* @__PURE__ */ t(p, { size: "compact", variant: "ghost", onClick: () => void e.openDefinition(c.definitionId), children: [
1582
+ /* @__PURE__ */ a(sa, { size: 14, "aria-hidden": !0 }),
1583
+ " Revisions"
1584
+ ] })
1585
+ ] })
1586
+ ] }, c.definitionId)),
1587
+ n.instances.map((c) => /* @__PURE__ */ t(R, { as: "article", children: [
1588
+ /* @__PURE__ */ t("div", { children: [
1589
+ /* @__PURE__ */ t(y, { children: [
1590
+ c.status,
1591
+ " · revision ",
1592
+ c.revision.toString()
1593
+ ] }),
1594
+ /* @__PURE__ */ a(C, { children: c.name || c.instanceId }),
1595
+ /* @__PURE__ */ t("p", { children: [
1596
+ c.instanceId,
1597
+ c.lastError ? ` · ${c.lastError}` : ""
1598
+ ] })
1599
+ ] }),
1600
+ /* @__PURE__ */ t("div", { className: "af-agent-manager__actions", children: [
1601
+ /* @__PURE__ */ a(S, { tone: c.status === "failed" ? "warning" : "cool", children: c.controlMode || c.status }),
1602
+ /* @__PURE__ */ a(p, { size: "compact", onClick: () => void e.openInstance(c.instanceId), children: "Inspect" })
1603
+ ] })
1604
+ ] }, c.instanceId))
1605
+ ] }),
1606
+ n.revisions.length > 0 && /* @__PURE__ */ a("ol", { className: "af-agent-revisions", "aria-label": "Workflow revisions", children: n.revisions.map((c) => /* @__PURE__ */ t("li", { children: [
1457
1607
  /* @__PURE__ */ t("div", { children: [
1458
1608
  /* @__PURE__ */ t("strong", { children: [
1459
1609
  "Revision ",
1460
- r.revision.toString()
1610
+ c.revision.toString()
1461
1611
  ] }),
1462
- /* @__PURE__ */ a("p", { children: r.id })
1612
+ /* @__PURE__ */ a("p", { children: c.contentDigest }),
1613
+ /* @__PURE__ */ a("pre", { children: new TextDecoder().decode(c.contractJson) })
1614
+ ] }),
1615
+ /* @__PURE__ */ a(S, { tone: "neutral", children: "Pinned" })
1616
+ ] }, `${c.definitionId}:${c.revision}`)) }),
1617
+ i && /* @__PURE__ */ t(R, { as: "section", children: [
1618
+ /* @__PURE__ */ t("header", { children: [
1619
+ /* @__PURE__ */ a(y, { children: "Selected instance" }),
1620
+ /* @__PURE__ */ a(C, { children: i.name || i.instanceId })
1463
1621
  ] }),
1464
- /* @__PURE__ */ a(y, { tone: r.id === l ? "success" : "neutral", children: r.id === l ? "Current" : "Pinned" }),
1465
- s && /* @__PURE__ */ a(S, { size: "compact", variant: "ghost", onClick: () => s(r), children: "Start session" })
1466
- ] }, r.id)) })
1622
+ /* @__PURE__ */ t("div", { className: "af-agent-manager__actions", children: [
1623
+ /* @__PURE__ */ t(p, { size: "compact", variant: "secondary", onClick: () => void e.control(se.InstanceControlAction.PAUSE), children: [
1624
+ /* @__PURE__ */ a(ra, { size: 14, "aria-hidden": !0 }),
1625
+ " Pause"
1626
+ ] }),
1627
+ /* @__PURE__ */ t(p, { size: "compact", variant: "secondary", onClick: () => void e.control(se.InstanceControlAction.RESUME), children: [
1628
+ /* @__PURE__ */ a(ca, { size: 14, "aria-hidden": !0 }),
1629
+ " Resume"
1630
+ ] }),
1631
+ /* @__PURE__ */ t(p, { size: "compact", variant: "secondary", onClick: () => void e.control(se.InstanceControlAction.CANCEL), children: [
1632
+ /* @__PURE__ */ a(oa, { size: 14, "aria-hidden": !0 }),
1633
+ " Cancel"
1634
+ ] }),
1635
+ /* @__PURE__ */ t(p, { size: "compact", variant: "ghost", onClick: () => void e.openInstance(i.instanceId), children: [
1636
+ /* @__PURE__ */ a(da, { size: 14, "aria-hidden": !0 }),
1637
+ " Reload diagnostics"
1638
+ ] })
1639
+ ] }),
1640
+ /* @__PURE__ */ t("p", { children: [
1641
+ n.runs.length,
1642
+ " runs · ",
1643
+ n.steps.length,
1644
+ " steps · ",
1645
+ n.actionFacts.length,
1646
+ " action intents"
1647
+ ] }),
1648
+ /* @__PURE__ */ a("ol", { className: "af-agent-task-tree", "aria-label": "Workflow steps", children: n.steps.map((c) => /* @__PURE__ */ t("li", { children: [
1649
+ /* @__PURE__ */ a("span", { "aria-hidden": !0 }),
1650
+ /* @__PURE__ */ t("div", { children: [
1651
+ /* @__PURE__ */ a("strong", { children: c.nodeId }),
1652
+ /* @__PURE__ */ t("p", { children: [
1653
+ c.nodeType,
1654
+ " · ",
1655
+ c.status,
1656
+ c.exitReason ? ` · ${c.exitReason}` : ""
1657
+ ] })
1658
+ ] })
1659
+ ] }, c.stepId)) }),
1660
+ /* @__PURE__ */ t("div", { className: "af-agent-manager__actions", children: [
1661
+ /* @__PURE__ */ a(z, { "aria-label": "Action ID", value: l, onChange: (c) => s(c.target.value), placeholder: "Action ID for retry or reconcile" }),
1662
+ /* @__PURE__ */ a(p, { size: "compact", disabled: !l, onClick: () => void e.control(se.InstanceControlAction.RETRY, "", l), children: "Retry action" }),
1663
+ /* @__PURE__ */ a(p, { size: "compact", variant: "secondary", disabled: !l, onClick: () => void e.control(se.InstanceControlAction.RECONCILE, "", l), children: "Reconcile action" })
1664
+ ] }),
1665
+ n.error && /* @__PURE__ */ a("p", { role: "alert", children: n.error.message })
1666
+ ] })
1467
1667
  ] });
1468
1668
  }
1469
- const ba = (e) => `${e.kind}:${e.slug}@${e.version}`;
1669
+ const Be = (e) => e.length ? JSON.parse(new TextDecoder().decode(e)) : void 0;
1470
1670
  export {
1471
- ia as AgentActionCard,
1472
- xa as AgentCapabilityCatalog,
1473
- za as AgentChat,
1474
- Ra as AgentCollaborationCenter,
1475
- ga as AgentComposer,
1476
- Na as AgentCompositionPanel,
1477
- fa as AgentConversation,
1478
- $a as AgentDocumentLibrary,
1479
- ta as AgentExecutionTrace,
1480
- Ta as AgentMemoryCenter,
1481
- ca as AgentProfileEditor,
1482
- Pa as AgentProfileSettings,
1483
- pa as AgentResourceBar,
1484
- Ia as AgentRevisionHistory,
1485
- ua as AgentSessionList,
1486
- ja as AgentSessionModel,
1487
- _a as AgentSlotRegistry,
1488
- Aa as AgentStudio,
1489
- De as DEFAULT_AGENT_UI_LABELS,
1490
- ba as capabilityKey,
1491
- da as compositionIssueLabel,
1671
+ ga as AgentActionCard,
1672
+ Ba as AgentCapabilityCatalog,
1673
+ ja as AgentChat,
1674
+ Ja as AgentCollaborationCenter,
1675
+ wa as AgentComposer,
1676
+ $a as AgentCompositionPanel,
1677
+ Na as AgentConversation,
1678
+ Oa as AgentDocumentLibrary,
1679
+ pa as AgentExecutionTrace,
1680
+ La as AgentMemoryCenter,
1681
+ ba as AgentProfileEditor,
1682
+ Ma as AgentProfileSettings,
1683
+ Ca as AgentResourceBar,
1684
+ Ua as AgentRevisionHistory,
1685
+ ya as AgentSessionList,
1686
+ Va as AgentSessionModel,
1687
+ Da as AgentSlotRegistry,
1688
+ qa as AgentStudio,
1689
+ Je as DEFAULT_AGENT_UI_LABELS,
1690
+ Fa as WorkflowWorkbench,
1691
+ Wa as WorkflowWorkbenchController,
1692
+ _a as capabilityKey,
1693
+ va as compositionIssueLabel,
1492
1694
  be as dataFallback,
1493
- na as useAgentSession
1695
+ ha as useAgentSession,
1696
+ Pa as useWorkflowWorkbench
1494
1697
  };