@declarion/react 0.182.0 → 0.185.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.
@@ -12,62 +12,83 @@ import { useSchema as u } from "../../hooks/useSchema.js";
12
12
  import { useParam as d } from "../../hooks/useParams.js";
13
13
  import { useText as f } from "../../hooks/useText.js";
14
14
  import { useTabNavigate as p } from "../../hooks/useTabNavigate.js";
15
- import { screenTitleForPath as m } from "../../types/schema.js";
16
- import { useEntity as h } from "../../hooks/useEntity.js";
17
- import { failureTitle as g } from "../../lib/failure.js";
15
+ import { screenTitleForPath as ee } from "../../types/schema.js";
16
+ import { useEntity as m } from "../../hooks/useEntity.js";
17
+ import { failureTitle as h } from "../../lib/failure.js";
18
+ import { formatOffsetTimestamp as g } from "../../lib/timestamp.js";
18
19
  import { pluralText as _, textWithNodes as v } from "../../lib/language.js";
19
20
  import { useFileSelection as y } from "../file-widgets/useFileSelection.js";
20
- import { ComposerAttachments as b, MessageAttachments as x, replyFilesVisible as S } from "./ChatAttachments.js";
21
- import { useEffect as C, useRef as w, useState as T } from "react";
22
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
23
- import { useLocation as ee } from "react-router";
24
- import te from "react-textarea-autosize";
21
+ import { ComposerAttachments as te, MessageAttachments as b, replyFilesVisible as ne } from "./ChatAttachments.js";
22
+ import { useEffect as x, useRef as S, useState as C } from "react";
23
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
24
+ import { useLocation as re } from "react-router";
25
+ import ie from "react-textarea-autosize";
25
26
  // src/components/agents/AgentChatPanel.impl.tsx
26
- var ne = 80, O = "/errors/";
27
- function k({ open: n, onClose: i, context: d, title: p = "", askOnOpen: h, docked: _ = !1 }) {
28
- let x = a();
29
- o(x.conversationId);
30
- let S = f(), { pathname: O } = ee(), { data: k } = u(), re = d ? m(S, O, k?.screens, k?.entities)?.title : void 0, ae = f("errors"), [j, M] = T(""), [N, P] = T(null), F = w(null), [I, L] = T(!1), R = w(null), z = y({
27
+ var ae = 80, E = "/errors/";
28
+ function oe({ open: n, onClose: i, context: d, title: p = "", askOnOpen: m, docked: g = !1 }) {
29
+ let _ = a();
30
+ o(_.conversationId);
31
+ let b = f(), { pathname: ne } = re(), { data: E } = u(), oe = d ? ee(b, ne, E?.screens, E?.entities)?.title : void 0, se = f("errors"), [O, k] = C(""), [A, j] = C(null), M = S(null), [me, N] = C(!1), P = S(null), F = y({
31
32
  entityCode: "agent_message",
32
33
  fieldCode: "attachments"
33
- }), B = w(null), V = w(null), H = w(!0), [U, W] = T(!1), de = () => {
34
- let e = V.current;
34
+ }), I = S(null), L = S(null), R = S(!0), [z, B] = C(!1), V = () => {
35
+ let e = L.current;
35
36
  if (!e) return;
36
- let t = e.scrollHeight - e.scrollTop - e.clientHeight <= ne;
37
- H.current = t, t && U && W(!1);
38
- }, G = (e = "smooth") => {
39
- let t = V.current;
37
+ let t = e.scrollHeight - e.scrollTop - e.clientHeight <= ae;
38
+ R.current = t, t && z && B(!1);
39
+ }, H = (e = "smooth") => {
40
+ let t = L.current;
40
41
  t && (t.scrollTo({
41
42
  top: t.scrollHeight,
42
43
  behavior: e
43
- }), H.current = !0, W(!1));
44
- };
45
- if (C(() => {
46
- H.current ? G("smooth") : W(!0);
47
- }, [x.messages]), C(() => {
48
- n && G("instant");
49
- }, [n]), C(() => {
50
- let e = h?.trim();
51
- n && e && F.current !== e && (F.current = e, R.current?.(e));
52
- }, [n, h]), !n) return null;
53
- let K = async (e) => {
54
- let t = z.readyFiles, n = z.selections.filter((e) => e.state === "ready").map((e) => e.localId);
55
- if ((e.trim() || t.length !== 0) && z.settled) {
56
- P(null), M("");
44
+ }), R.current = !0, B(!1));
45
+ }, U = _.openedConversation?.id, W = S(!0);
46
+ x(() => {
47
+ W.current = !0;
48
+ }, [n, U]), x(() => {
49
+ if (W.current && U && _.messages.length > 0) {
50
+ let e = requestAnimationFrame(() => H("instant"));
51
+ return () => cancelAnimationFrame(e);
52
+ }
53
+ R.current ? H("smooth") : B(!0);
54
+ }, [_.messages, U]);
55
+ let G = () => {
56
+ W.current = !0, requestAnimationFrame(() => H("instant"));
57
+ }, K = () => {
58
+ W.current = !1;
59
+ }, q = S(null);
60
+ if (x(() => {
61
+ let e = q.current;
62
+ if (!e || typeof ResizeObserver > "u") return;
63
+ let t = new ResizeObserver(() => {
64
+ W.current && H("instant");
65
+ });
66
+ return t.observe(e), () => t.disconnect();
67
+ }, []), x(() => {
68
+ n && H("instant");
69
+ }, [n]), x(() => {
70
+ let e = m?.trim();
71
+ n && e && M.current !== e && (M.current = e, P.current?.(e));
72
+ }, [n, m]), !n) return null;
73
+ let J = async (e) => {
74
+ let t = F.readyFiles, n = F.selections.filter((e) => e.state === "ready").map((e) => e.localId);
75
+ if ((e.trim() || t.length !== 0) && F.settled) {
76
+ j(null), k("");
57
77
  try {
58
- await x.send(e, d, t), z.release(n);
78
+ await _.send(e, d, t), F.release(n);
59
79
  } catch (t) {
60
- console.error("agent send failed", t), P(g(ae, t)), M(e);
80
+ console.error("agent send failed", t), j(h(se, t)), k(e);
61
81
  }
62
82
  }
63
83
  };
64
- R.current = K;
65
- let q = (e) => {
66
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), K(j));
67
- }, J = x.invocations.filter((e) => e.status === "pending_approval"), Y = x.invocations.filter((e) => e.kind === "input_request" && e.status === "pending_input"), X = x.turns.filter((e) => e.status === "queued" || e.status === "running" || e.status === "waiting" || e.status === "failed"), Z = x.invocations.filter((e) => e.status === "outcome_unknown"), fe = x.messages.length === 0 && !x.turn.streaming, me = J.length > 0 || Y.length > 0, Q = x.turn.streaming && !me || x.turns.some((e) => e.status === "running"), ge = x.messages.some((e) => e.role === "assistant" && e.streaming && e.content.length > 0), $ = (j.trim().length > 0 || z.readyFiles.length > 0) && z.settled;
68
- return /* @__PURE__ */ D("aside", {
84
+ P.current = J;
85
+ let Y = (e) => {
86
+ e.key === "Enter" && !e.shiftKey && (e.preventDefault(), J(O));
87
+ }, X = _.invocations.filter((e) => e.status === "pending_approval"), Z = _.invocations.filter((e) => e.kind === "input_request" && e.status === "pending_input"), Q = _.turns.filter((e) => e.status === "queued" || e.status === "running" || e.status === "waiting" || e.status === "failed"), ve = _.invocations.filter((e) => e.status === "outcome_unknown"), ye = _.messages.length === 0 && !_.turn.streaming, be = X.length > 0 || Z.length > 0, xe = _.turn.streaming && !be || _.turns.some((e) => e.status === "running"), Se = _.messages.some((e) => e.role === "assistant" && e.streaming && e.content.length > 0), $ = (O.trim().length > 0 || F.readyFiles.length > 0) && F.settled;
88
+ return /* @__PURE__ */ T("aside", {
89
+ "aria-label": b("shell.ai_assistant", "AI Assistant"),
69
90
  style: {
70
- ..._ ? {
91
+ ...g ? {
71
92
  gridArea: "assistant",
72
93
  minWidth: 0,
73
94
  minHeight: 0
@@ -86,7 +107,7 @@ function k({ open: n, onClose: i, context: d, title: p = "", askOnOpen: h, docke
86
107
  flexDirection: "column"
87
108
  },
88
109
  children: [
89
- /* @__PURE__ */ D("div", {
110
+ /* @__PURE__ */ T("div", {
90
111
  style: {
91
112
  display: "flex",
92
113
  alignItems: "center",
@@ -95,7 +116,7 @@ function k({ open: n, onClose: i, context: d, title: p = "", askOnOpen: h, docke
95
116
  borderBottom: "1px solid var(--divider)"
96
117
  },
97
118
  children: [
98
- /* @__PURE__ */ E("span", {
119
+ /* @__PURE__ */ w("span", {
99
120
  style: {
100
121
  width: 22,
101
122
  height: 22,
@@ -105,22 +126,22 @@ function k({ open: n, onClose: i, context: d, title: p = "", askOnOpen: h, docke
105
126
  alignItems: "center",
106
127
  justifyContent: "center"
107
128
  },
108
- children: /* @__PURE__ */ E(e.sparkle, {
129
+ children: /* @__PURE__ */ w(e.sparkle, {
109
130
  size: 13,
110
131
  style: { color: "var(--accent-foreground)" }
111
132
  })
112
133
  }),
113
- /* @__PURE__ */ D("div", {
134
+ /* @__PURE__ */ T("div", {
114
135
  style: { flex: 1 },
115
- children: [/* @__PURE__ */ E("div", {
136
+ children: [/* @__PURE__ */ w("div", {
116
137
  "data-conversation-agent": !0,
117
138
  style: {
118
139
  fontSize: 12.5,
119
140
  fontWeight: 600,
120
141
  color: "var(--text)"
121
142
  },
122
- children: x.conversations.find((e) => e.id === x.conversationId)?.agent || p
123
- }), /* @__PURE__ */ D("div", {
143
+ children: _.openedConversation && pe(b, _.openedConversation) || p
144
+ }), /* @__PURE__ */ T("div", {
124
145
  style: {
125
146
  fontSize: 10.5,
126
147
  color: "var(--text-3)",
@@ -128,116 +149,126 @@ function k({ open: n, onClose: i, context: d, title: p = "", askOnOpen: h, docke
128
149
  alignItems: "center",
129
150
  gap: 4
130
151
  },
131
- children: [/* @__PURE__ */ E("span", { style: {
152
+ children: [/* @__PURE__ */ w("span", { style: {
132
153
  width: 5,
133
154
  height: 5,
134
155
  background: "var(--success)",
135
156
  borderRadius: 999
136
- } }), v(S("agent.panel.context", "context: {context}"), { context: /* @__PURE__ */ E("span", { children: re || S("agent.panel.context_platform", "Platform") }) })]
157
+ } }), v(b("agent.panel.context", "context: {context}"), { context: /* @__PURE__ */ w("span", { children: oe || b("agent.panel.context_platform", "Platform") }) })]
137
158
  })]
138
159
  }),
139
- x.messages.length > 0 && /* @__PURE__ */ E(t, {
160
+ _.messages.length > 0 && /* @__PURE__ */ w(t, {
140
161
  size: 24,
141
- icon: /* @__PURE__ */ E(e.copy, { size: 12 }),
142
- onClick: () => void pe(S, x.messages),
143
- title: S("agent.panel.copy_all", "Copy entire conversation")
162
+ icon: /* @__PURE__ */ w(e.copy, { size: 12 }),
163
+ onClick: () => void ge(b, _.messages),
164
+ title: b("agent.panel.copy_all", "Copy entire conversation")
144
165
  }),
145
- /* @__PURE__ */ E(t, {
166
+ /* @__PURE__ */ w(t, {
146
167
  size: 24,
147
- icon: /* @__PURE__ */ E(e.clock, { size: 12 }),
168
+ icon: /* @__PURE__ */ w(e.clock, { size: 12 }),
148
169
  onClick: () => {
149
- L((e) => !e), x.refreshConversations();
170
+ N((e) => !e), _.refreshConversations();
150
171
  },
151
- title: S("agent.panel.earlier", "Earlier conversations")
172
+ title: b("agent.panel.earlier", "Earlier conversations")
152
173
  }),
153
- x.conversationId && /* @__PURE__ */ E(t, {
174
+ _.conversationId && /* @__PURE__ */ w(t, {
154
175
  size: 24,
155
- icon: /* @__PURE__ */ E(e.plus, { size: 12 }),
156
- onClick: x.startNew,
157
- title: S("agent.panel.new_conversation", "New conversation")
176
+ icon: /* @__PURE__ */ w(e.plus, { size: 12 }),
177
+ onClick: _.startNew,
178
+ title: b("agent.panel.new_conversation", "New conversation")
158
179
  }),
159
- /* @__PURE__ */ E(t, {
180
+ /* @__PURE__ */ w(t, {
160
181
  size: 24,
161
- icon: /* @__PURE__ */ E(e.settings, { size: 12 }),
162
- title: S("agent.panel.preferences", "Preferences")
182
+ icon: /* @__PURE__ */ w(e.settings, { size: 12 }),
183
+ title: b("agent.panel.preferences", "Preferences")
163
184
  }),
164
- /* @__PURE__ */ E(t, {
185
+ /* @__PURE__ */ w(t, {
165
186
  size: 24,
166
- icon: /* @__PURE__ */ E(e.x, { size: 13 }),
187
+ icon: /* @__PURE__ */ w(e.x, { size: 13 }),
167
188
  onClick: i,
168
- title: S("agent.panel.close", "Close")
189
+ title: b("agent.panel.close", "Close")
169
190
  })
170
191
  ]
171
192
  }),
172
- !x.conversationId && /* @__PURE__ */ E(c, {
173
- agents: x.agents,
174
- selectedId: x.selectedAgentId,
175
- onSelect: x.selectAgent,
176
- label: S("agent.panel.agent", "Agent")
193
+ !_.conversationId && /* @__PURE__ */ w(c, {
194
+ agents: _.agents,
195
+ selectedId: _.selectedAgentId,
196
+ onSelect: _.selectAgent,
197
+ label: b("agent.panel.agent", "Agent")
177
198
  }),
178
- I && /* @__PURE__ */ E(le, {
179
- conversations: x.conversations,
180
- currentId: x.conversationId,
199
+ me && /* @__PURE__ */ w(fe, {
200
+ conversations: _.conversations,
201
+ hasMore: _.moreConversations,
202
+ onShowMore: () => void _.showMoreConversations(),
203
+ currentId: _.conversationId,
181
204
  onPick: (e) => {
182
- x.setConversationId(e), L(!1);
205
+ _.setConversationId(e), N(!1), G();
183
206
  }
184
207
  }),
185
- /* @__PURE__ */ D("div", {
186
- ref: V,
187
- onScroll: de,
208
+ /* @__PURE__ */ w("div", {
209
+ ref: L,
210
+ onScroll: V,
211
+ onWheel: K,
212
+ onTouchMove: K,
213
+ onKeyDown: K,
188
214
  style: {
189
215
  flex: 1,
190
216
  overflowY: "auto",
191
217
  padding: "12px 14px",
192
- display: "flex",
193
- flexDirection: "column",
194
- gap: 12,
195
218
  position: "relative"
196
219
  },
197
- children: [
198
- fe && /* @__PURE__ */ E(A, { children: S("agent.panel.intro", "Hi — I can answer questions about your data, suggest actions, draft YAML definitions, and run allowed tools within your permissions. What would you like to do?") }),
199
- l(x.messages, x.invocations).map((e) => e.kind === "message" ? /* @__PURE__ */ E(ue, {
200
- message: e.message,
201
- delivered: e.delivered,
202
- turns: x.turns
203
- }, e.message.id) : /* @__PURE__ */ E(ce, { run: e }, e.id)),
204
- X.map((e) => /* @__PURE__ */ E(ie, { agentTurn: e }, e.id)),
205
- J.map((e) => /* @__PURE__ */ E(he, {
206
- tool: e,
207
- onApprove: async (t) => x.approve(e.id, t),
208
- onReject: async (t) => x.reject(e.id, t)
209
- }, e.id)),
210
- Y.map((e) => /* @__PURE__ */ E(s, {
211
- ...oe(S, e),
212
- onSubmit: (t) => void x.submitInput(e.id, t),
213
- onCancel: () => void x.cancelInput(e.id)
214
- }, e.id)),
215
- Z.map((e) => /* @__PURE__ */ E(se, { invocation: e }, e.id)),
216
- Q && !ge && /* @__PURE__ */ D("div", {
217
- style: {
218
- display: "flex",
219
- gap: 6,
220
- alignItems: "center",
221
- color: "var(--text-3)",
222
- fontSize: 11.5
223
- },
224
- children: [/* @__PURE__ */ E(r, { size: 12 }), S("agent.panel.thinking", "Thinking…")]
225
- }),
226
- N && /* @__PURE__ */ E("div", {
227
- style: {
228
- padding: "8px 10px",
229
- background: "var(--surface-2)",
230
- border: "1px solid var(--border)",
231
- borderRadius: "var(--radius-md)",
232
- fontSize: 11.5,
233
- color: "var(--text-2)"
234
- },
235
- children: /* @__PURE__ */ E("strong", { children: N })
236
- })
237
- ]
220
+ children: /* @__PURE__ */ T("div", {
221
+ ref: q,
222
+ style: {
223
+ display: "flex",
224
+ flexDirection: "column",
225
+ gap: 12
226
+ },
227
+ children: [
228
+ ye && /* @__PURE__ */ w(D, { children: b("agent.panel.intro", "Hi — I can answer questions about your data, suggest actions, draft YAML definitions, and run allowed tools within your permissions. What would you like to do?") }),
229
+ l(_.messages, _.invocations).map((e) => e.kind === "message" ? /* @__PURE__ */ w(he, {
230
+ message: e.message,
231
+ delivered: e.delivered,
232
+ turns: _.turns
233
+ }, e.message.id) : /* @__PURE__ */ w(de, { run: e }, e.id)),
234
+ Q.map((e) => /* @__PURE__ */ w(ce, { agentTurn: e }, e.id)),
235
+ X.map((e) => /* @__PURE__ */ w(_e, {
236
+ tool: e,
237
+ onApprove: async (t) => _.approve(e.id, t),
238
+ onReject: async (t) => _.reject(e.id, t)
239
+ }, e.id)),
240
+ Z.map((e) => /* @__PURE__ */ w(s, {
241
+ ...le(b, e),
242
+ onSubmit: (t) => void _.submitInput(e.id, t),
243
+ onCancel: () => void _.cancelInput(e.id)
244
+ }, e.id)),
245
+ ve.map((e) => /* @__PURE__ */ w(ue, { invocation: e }, e.id)),
246
+ xe && !Se && /* @__PURE__ */ T("div", {
247
+ style: {
248
+ display: "flex",
249
+ gap: 6,
250
+ alignItems: "center",
251
+ color: "var(--text-3)",
252
+ fontSize: 11.5
253
+ },
254
+ children: [/* @__PURE__ */ w(r, { size: 12 }), b("agent.panel.thinking", "Thinking…")]
255
+ }),
256
+ A && /* @__PURE__ */ w("div", {
257
+ style: {
258
+ padding: "8px 10px",
259
+ background: "var(--surface-2)",
260
+ border: "1px solid var(--border)",
261
+ borderRadius: "var(--radius-md)",
262
+ fontSize: 11.5,
263
+ color: "var(--text-2)"
264
+ },
265
+ children: /* @__PURE__ */ w("strong", { children: A })
266
+ })
267
+ ]
268
+ })
238
269
  }),
239
- U && /* @__PURE__ */ D("button", {
240
- onClick: () => G("smooth"),
270
+ z && /* @__PURE__ */ T("button", {
271
+ onClick: () => H("smooth"),
241
272
  style: {
242
273
  position: "absolute",
243
274
  right: 16,
@@ -256,30 +287,30 @@ function k({ open: n, onClose: i, context: d, title: p = "", askOnOpen: h, docke
256
287
  gap: 4,
257
288
  zIndex: 1
258
289
  },
259
- children: [/* @__PURE__ */ E(e.arrowDown, { size: 11 }), S("agent.panel.jump_latest", "Jump to latest")]
290
+ children: [/* @__PURE__ */ w(e.arrowDown, { size: 11 }), b("agent.panel.jump_latest", "Jump to latest")]
260
291
  }),
261
- /* @__PURE__ */ D("div", {
292
+ /* @__PURE__ */ T("div", {
262
293
  style: {
263
294
  padding: 10,
264
295
  borderTop: "1px solid var(--divider)",
265
296
  background: "var(--surface-2)"
266
297
  },
267
298
  children: [
268
- /* @__PURE__ */ E(b, {
269
- selections: z.selections,
270
- onCancel: z.cancel,
271
- onRemove: z.remove
299
+ /* @__PURE__ */ w(te, {
300
+ selections: F.selections,
301
+ onCancel: F.cancel,
302
+ onRemove: F.remove
272
303
  }),
273
- z.failed && /* @__PURE__ */ E("div", {
304
+ F.failed && /* @__PURE__ */ w("div", {
274
305
  role: "status",
275
306
  style: {
276
307
  fontSize: 11,
277
308
  color: "var(--destructive)",
278
309
  paddingBottom: 6
279
310
  },
280
- children: S("agent.panel.remove_failed_files", "Remove the files that failed to upload to send the message.")
311
+ children: b("agent.panel.remove_failed_files", "Remove the files that failed to upload to send the message.")
281
312
  }),
282
- /* @__PURE__ */ D("div", {
313
+ /* @__PURE__ */ T("div", {
283
314
  style: {
284
315
  display: "flex",
285
316
  alignItems: "flex-end",
@@ -290,11 +321,11 @@ function k({ open: n, onClose: i, context: d, title: p = "", askOnOpen: h, docke
290
321
  borderRadius: "var(--radius-md)"
291
322
  },
292
323
  children: [
293
- /* @__PURE__ */ E(te, {
294
- value: j,
295
- onChange: (e) => M(e.target.value),
296
- onKeyDown: q,
297
- placeholder: S("agent.panel.ask_placeholder", "Ask or describe what you want…"),
324
+ /* @__PURE__ */ w(ie, {
325
+ value: O,
326
+ onChange: (e) => k(e.target.value),
327
+ onKeyDown: Y,
328
+ placeholder: b("agent.panel.ask_placeholder", "Ask or describe what you want…"),
298
329
  minRows: 1,
299
330
  maxRows: 8,
300
331
  style: {
@@ -310,26 +341,26 @@ function k({ open: n, onClose: i, context: d, title: p = "", askOnOpen: h, docke
310
341
  fontFamily: "inherit"
311
342
  }
312
343
  }),
313
- /* @__PURE__ */ E("input", {
314
- ref: B,
344
+ /* @__PURE__ */ w("input", {
345
+ ref: I,
315
346
  type: "file",
316
347
  multiple: !0,
317
348
  hidden: !0,
318
349
  "data-testid": "agent-chat-file-input",
319
350
  onChange: (e) => {
320
- e.target.files && z.add(e.target.files), e.target.value = "";
351
+ e.target.files && F.add(e.target.files), e.target.value = "";
321
352
  }
322
353
  }),
323
- /* @__PURE__ */ E(t, {
354
+ /* @__PURE__ */ w(t, {
324
355
  size: 26,
325
- icon: /* @__PURE__ */ E(e.paperclip, { size: 12 }),
326
- onClick: () => B.current?.click(),
327
- title: S("agent.panel.attach_files", "Attach files")
356
+ icon: /* @__PURE__ */ w(e.paperclip, { size: 12 }),
357
+ onClick: () => I.current?.click(),
358
+ title: b("agent.panel.attach_files", "Attach files")
328
359
  }),
329
- Q ? /* @__PURE__ */ E("button", {
330
- onClick: () => void x.cancel(),
331
- "aria-label": S("agent.panel.stop", "Stop generating"),
332
- title: S("agent.panel.stop", "Stop generating"),
360
+ xe ? /* @__PURE__ */ w("button", {
361
+ onClick: () => void _.cancel(),
362
+ "aria-label": b("agent.panel.stop", "Stop generating"),
363
+ title: b("agent.panel.stop", "Stop generating"),
333
364
  style: {
334
365
  width: 26,
335
366
  height: 26,
@@ -342,11 +373,11 @@ function k({ open: n, onClose: i, context: d, title: p = "", askOnOpen: h, docke
342
373
  alignItems: "center",
343
374
  justifyContent: "center"
344
375
  },
345
- children: /* @__PURE__ */ E(e.x, { size: 13 })
346
- }) : /* @__PURE__ */ E("button", {
347
- onClick: () => void K(j),
376
+ children: /* @__PURE__ */ w(e.x, { size: 13 })
377
+ }) : /* @__PURE__ */ w("button", {
378
+ onClick: () => void J(O),
348
379
  disabled: !$,
349
- "aria-label": S("agent.panel.send", "Send"),
380
+ "aria-label": b("agent.panel.send", "Send"),
350
381
  style: {
351
382
  width: 26,
352
383
  height: 26,
@@ -359,11 +390,11 @@ function k({ open: n, onClose: i, context: d, title: p = "", askOnOpen: h, docke
359
390
  alignItems: "center",
360
391
  justifyContent: "center"
361
392
  },
362
- children: /* @__PURE__ */ E(e.arrowUp, { size: 13 })
393
+ children: /* @__PURE__ */ w(e.arrowUp, { size: 13 })
363
394
  })
364
395
  ]
365
396
  }),
366
- /* @__PURE__ */ D("div", {
397
+ /* @__PURE__ */ T("div", {
367
398
  style: {
368
399
  display: "flex",
369
400
  alignItems: "center",
@@ -372,15 +403,15 @@ function k({ open: n, onClose: i, context: d, title: p = "", askOnOpen: h, docke
372
403
  fontSize: 10.5,
373
404
  color: "var(--text-4)"
374
405
  },
375
- children: [/* @__PURE__ */ E(e.shield, { size: 10 }), /* @__PURE__ */ E("span", { children: S("agent.panel.footer", "Runs within your permissions. All actions audit-logged.") })]
406
+ children: [/* @__PURE__ */ w(e.shield, { size: 10 }), /* @__PURE__ */ w("span", { children: b("agent.panel.footer", "Runs within your permissions. All actions audit-logged.") })]
376
407
  })
377
408
  ]
378
409
  })
379
410
  ]
380
411
  });
381
412
  }
382
- function re() {
383
- return /* @__PURE__ */ E("span", {
413
+ function se() {
414
+ return /* @__PURE__ */ w("span", {
384
415
  "aria-hidden": !0,
385
416
  style: {
386
417
  display: "inline-block",
@@ -393,8 +424,8 @@ function re() {
393
424
  }
394
425
  });
395
426
  }
396
- function A({ children: t, dataMessageId: n, dataStreaming: r }) {
397
- return /* @__PURE__ */ D("div", {
427
+ function D({ children: t, dataMessageId: n, dataStreaming: r }) {
428
+ return /* @__PURE__ */ T("div", {
398
429
  "data-message-id": n,
399
430
  "data-streaming": r ? "true" : void 0,
400
431
  style: {
@@ -402,7 +433,7 @@ function A({ children: t, dataMessageId: n, dataStreaming: r }) {
402
433
  gap: 8,
403
434
  alignItems: "flex-start"
404
435
  },
405
- children: [/* @__PURE__ */ E("span", {
436
+ children: [/* @__PURE__ */ w("span", {
406
437
  style: {
407
438
  width: 20,
408
439
  height: 20,
@@ -415,8 +446,8 @@ function A({ children: t, dataMessageId: n, dataStreaming: r }) {
415
446
  flexShrink: 0,
416
447
  marginTop: 2
417
448
  },
418
- children: /* @__PURE__ */ E(e.sparkle, { size: 11 })
419
- }), /* @__PURE__ */ E("div", {
449
+ children: /* @__PURE__ */ w(e.sparkle, { size: 11 })
450
+ }), /* @__PURE__ */ w("div", {
420
451
  style: {
421
452
  flex: 1,
422
453
  minWidth: 0,
@@ -429,9 +460,9 @@ function A({ children: t, dataMessageId: n, dataStreaming: r }) {
429
460
  })]
430
461
  });
431
462
  }
432
- function ie({ agentTurn: e }) {
433
- let t = f(), n = f("errors"), r = h("agent_turn")?.fields.get("status"), i = e.status === "failed" ? ae(e) : void 0, a = i ? n(i.code, i.title || n("agents.turn_failed", "The assistant could not finish this turn.")) : void 0;
434
- return /* @__PURE__ */ D("div", {
463
+ function ce({ agentTurn: e }) {
464
+ let t = f(), n = f("errors"), r = m("agent_turn")?.fields.get("status"), i = e.status === "failed" ? O(e) : void 0, a = i ? n(i.code, i.title || n("agents.turn_failed", "The assistant could not finish this turn.")) : void 0;
465
+ return /* @__PURE__ */ T("div", {
435
466
  "data-agent-turn": e.id,
436
467
  "data-turn-status": e.status,
437
468
  style: {
@@ -446,28 +477,28 @@ function ie({ agentTurn: e }) {
446
477
  ]
447
478
  });
448
479
  }
449
- function ae(e) {
450
- let t = j(e.error_details) ? e.error_details.error : void 0, n = j(t) ? t : {}, r = typeof n.type == "string" ? n.type : "";
480
+ function O(e) {
481
+ let t = k(e.error_details) ? e.error_details.error : void 0, n = k(t) ? t : {}, r = typeof n.type == "string" ? n.type : "";
451
482
  return {
452
- code: r.startsWith(O) ? r.slice(8) : e.error_code ?? "",
483
+ code: r.startsWith(E) ? r.slice(8) : e.error_code ?? "",
453
484
  title: typeof n.title == "string" ? n.title : ""
454
485
  };
455
486
  }
456
- function oe(e, t) {
487
+ function le(e, t) {
457
488
  let n = e("agent.panel.input_needed", "Your response is needed."), r = t.question;
458
489
  if (r && (r.message || r.schema)) return {
459
490
  message: r.message || t.reason || n,
460
- schema: j(r.schema) ? r.schema : {}
491
+ schema: k(r.schema) ? r.schema : {}
461
492
  };
462
493
  let i = t.params ?? {};
463
494
  return {
464
495
  message: typeof i.message == "string" ? i.message : t.reason || n,
465
- schema: j(i.schema) ? i.schema : {}
496
+ schema: k(i.schema) ? i.schema : {}
466
497
  };
467
498
  }
468
- function se({ invocation: e }) {
499
+ function ue({ invocation: e }) {
469
500
  let t = f();
470
- return /* @__PURE__ */ E("div", {
501
+ return /* @__PURE__ */ w("div", {
471
502
  "data-agent-invocation": e.id,
472
503
  "data-invocation-status": "outcome_unknown",
473
504
  style: {
@@ -478,33 +509,33 @@ function se({ invocation: e }) {
478
509
  fontSize: 11.5,
479
510
  color: "var(--text-2)"
480
511
  },
481
- children: v(t("agent.panel.outcome_uncertain", "The outcome of {tool} is unknown. It was not retried automatically."), { tool: /* @__PURE__ */ E("span", {
512
+ children: v(t("agent.panel.outcome_uncertain", "The outcome of {tool} is unknown. It was not retried automatically."), { tool: /* @__PURE__ */ w("span", {
482
513
  className: "mono",
483
514
  children: e.tool_code
484
515
  }) })
485
516
  });
486
517
  }
487
- function j(e) {
518
+ function k(e) {
488
519
  return typeof e == "object" && !!e && !Array.isArray(e);
489
520
  }
490
- function ce({ run: e }) {
491
- let [t, n] = T(!1), r = M(), i = e.calls.filter((e) => e.isError).length, a = e.calls.filter((e) => !P(e.status)).length;
492
- return /* @__PURE__ */ D("div", {
521
+ function de({ run: e }) {
522
+ let [t, n] = C(!1), r = A(), i = e.calls.filter((e) => e.isError).length, a = e.calls.filter((e) => !M(e.status)).length;
523
+ return /* @__PURE__ */ T("div", {
493
524
  "data-activity-run": e.id,
494
525
  style: {
495
526
  display: "flex",
496
527
  gap: 8,
497
528
  alignItems: "flex-start"
498
529
  },
499
- children: [/* @__PURE__ */ E("span", { style: {
530
+ children: [/* @__PURE__ */ w("span", { style: {
500
531
  width: 20,
501
532
  flexShrink: 0
502
- } }), /* @__PURE__ */ D("div", {
533
+ } }), /* @__PURE__ */ T("div", {
503
534
  style: {
504
535
  flex: 1,
505
536
  minWidth: 0
506
537
  },
507
- children: [/* @__PURE__ */ D("button", {
538
+ children: [/* @__PURE__ */ T("button", {
508
539
  type: "button",
509
540
  onClick: () => n((e) => !e),
510
541
  "data-activity-toggle": !0,
@@ -522,23 +553,23 @@ function ce({ run: e }) {
522
553
  borderRadius: 999,
523
554
  cursor: "pointer"
524
555
  },
525
- children: [/* @__PURE__ */ E("span", {
556
+ children: [/* @__PURE__ */ w("span", {
526
557
  "aria-hidden": !0,
527
558
  children: t ? "▾" : "▸"
528
- }), /* @__PURE__ */ E("span", { children: r(e.calls.length, a, i) })]
529
- }), t && /* @__PURE__ */ E("div", {
559
+ }), /* @__PURE__ */ w("span", { children: r(e.calls.length, a, i) })]
560
+ }), t && /* @__PURE__ */ w("div", {
530
561
  style: {
531
562
  marginTop: 4,
532
563
  display: "flex",
533
564
  flexDirection: "column",
534
565
  gap: 3
535
566
  },
536
- children: e.calls.map((e) => /* @__PURE__ */ E(N, { call: e }, e.id))
567
+ children: e.calls.map((e) => /* @__PURE__ */ w(j, { call: e }, e.id))
537
568
  })]
538
569
  })]
539
570
  });
540
571
  }
541
- function M() {
572
+ function A() {
542
573
  let e = f();
543
574
  return (t, n, r) => {
544
575
  let i = [];
@@ -551,12 +582,12 @@ function M() {
551
582
  })), i.join(" · ") || e("agent.panel.worked", "worked");
552
583
  };
553
584
  }
554
- function N({ call: e }) {
555
- let [t, n] = T(!1), r = f(), i = I(e.name), a = h("agent_tool_invocation")?.fields.get("status"), o = e.status ?? "running", s = r(a?.values?.find((e) => e.code === o)?.name) || o, c = e.status === "outcome_unknown" ? "outcome_unknown" : e.isError ? "failed" : P(e.status) ? "ok" : "running";
556
- return /* @__PURE__ */ D("div", {
585
+ function j({ call: e }) {
586
+ let [t, n] = C(!1), r = f(), i = N(e.name), a = m("agent_tool_invocation")?.fields.get("status"), o = e.status ?? "running", s = r(a?.values?.find((e) => e.code === o)?.name) || o, c = e.status === "outcome_unknown" ? "outcome_unknown" : e.isError ? "failed" : M(e.status) ? "ok" : "running";
587
+ return /* @__PURE__ */ T("div", {
557
588
  "data-activity-call": e.name,
558
589
  "data-call-state": c,
559
- children: [/* @__PURE__ */ D("button", {
590
+ children: [/* @__PURE__ */ T("button", {
560
591
  type: "button",
561
592
  onClick: () => n((e) => !e),
562
593
  style: {
@@ -571,20 +602,20 @@ function N({ call: e }) {
571
602
  color: c === "failed" ? "var(--danger)" : "var(--text-2)"
572
603
  },
573
604
  children: [
574
- /* @__PURE__ */ E("span", {
605
+ /* @__PURE__ */ w("span", {
575
606
  "aria-hidden": !0,
576
607
  children: t ? "▾" : "▸"
577
608
  }),
578
- /* @__PURE__ */ E("span", {
609
+ /* @__PURE__ */ w("span", {
579
610
  className: "mono",
580
611
  children: i
581
612
  }),
582
- /* @__PURE__ */ E("span", {
613
+ /* @__PURE__ */ w("span", {
583
614
  style: { color: "var(--text-3)" },
584
615
  children: s
585
616
  })
586
617
  ]
587
- }), t && /* @__PURE__ */ E("pre", {
618
+ }), t && /* @__PURE__ */ w("pre", {
588
619
  style: {
589
620
  margin: "2px 0 0 18px",
590
621
  padding: 6,
@@ -605,78 +636,93 @@ function N({ call: e }) {
605
636
  })]
606
637
  });
607
638
  }
608
- function P(e) {
639
+ function M(e) {
609
640
  return e === "succeeded" || e === "failed" || e === "rejected" || e === "canceled" || e === "outcome_unknown";
610
641
  }
611
- function le({ conversations: e, currentId: t, onPick: n }) {
612
- let r = f();
613
- return e.length === 0 ? /* @__PURE__ */ E("div", {
642
+ function fe({ conversations: e, hasMore: t, onShowMore: n, currentId: r, onPick: i }) {
643
+ let a = f();
644
+ return e.length === 0 ? /* @__PURE__ */ w("div", {
614
645
  style: {
615
646
  padding: "8px 12px",
616
647
  fontSize: 11.5,
617
648
  color: "var(--text-3)"
618
649
  },
619
- children: r("agent.panel.no_earlier", "No earlier conversations.")
620
- }) : /* @__PURE__ */ E("div", {
650
+ children: a("agent.panel.no_earlier", "No earlier conversations.")
651
+ }) : /* @__PURE__ */ T("div", {
621
652
  "data-conversation-list": !0,
622
653
  style: {
623
654
  maxHeight: 200,
624
655
  overflowY: "auto",
625
656
  borderBottom: "1px solid var(--border)"
626
657
  },
627
- children: e.map((e) => /* @__PURE__ */ D("button", {
658
+ children: [e.map((e) => /* @__PURE__ */ T("button", {
628
659
  type: "button",
629
660
  "data-conversation-id": e.id,
630
- onClick: () => n(e.id),
661
+ onClick: () => i(e.id),
631
662
  style: {
632
663
  display: "block",
633
664
  width: "100%",
634
665
  textAlign: "left",
635
666
  padding: "6px 12px",
636
667
  fontSize: 12,
637
- background: e.id === t ? "var(--surface-2)" : "transparent",
668
+ background: e.id === r ? "var(--surface-2)" : "transparent",
638
669
  border: "none",
639
670
  cursor: "pointer",
640
671
  color: "var(--text)"
641
672
  },
642
- children: [/* @__PURE__ */ E("div", {
673
+ children: [/* @__PURE__ */ w("div", {
643
674
  style: { overflowWrap: "anywhere" },
644
- children: e.title?.trim() || r("agent.panel.untitled", "Untitled conversation")
645
- }), /* @__PURE__ */ E("div", {
675
+ children: e.title?.trim() || a("agent.panel.untitled", "Untitled conversation")
676
+ }), /* @__PURE__ */ w("div", {
646
677
  "data-conversation-facts": !0,
647
678
  style: {
648
679
  fontSize: 10.5,
649
680
  color: "var(--text-3)",
650
681
  overflowWrap: "anywhere"
651
682
  },
652
- children: F(r, e).join(" · ")
683
+ children: me(a, e).join(" · ")
653
684
  })]
654
- }, e.id))
685
+ }, e.id)), t && /* @__PURE__ */ w("button", {
686
+ type: "button",
687
+ "data-conversation-more": !0,
688
+ onClick: n,
689
+ style: {
690
+ display: "block",
691
+ width: "100%",
692
+ padding: "6px 12px",
693
+ fontSize: 11.5,
694
+ background: "transparent",
695
+ border: "none",
696
+ cursor: "pointer",
697
+ color: "var(--accent)"
698
+ },
699
+ children: a("agent.panel.show_more", "Show more")
700
+ })]
655
701
  });
656
702
  }
657
- function F(e, t) {
658
- let n = [];
659
- return t.agent && n.push(t.agent), t.chat_id && n.push(e("agent.panel.messenger_chat", "chat {chat}", { chat: H(t.chat_id) })), t.topic_id && n.push(e("agent.panel.messenger_topic", "topic {topic}", { topic: t.topic_id })), t.updated_at && n.push(new Date(t.updated_at).toLocaleString(e.language, {
660
- dateStyle: "medium",
661
- timeStyle: "short"
662
- })), n;
703
+ function pe(e, t) {
704
+ return t.agent_name && e(t.agent_name) || t.agent;
663
705
  }
664
- function I(e) {
706
+ function me(e, t) {
707
+ let n = [], r = pe(e, t);
708
+ return r && n.push(r), t.chat_id && !t.title?.includes(z(t.chat_id)) && n.push(e("agent.panel.messenger_chat", "chat {chat}", { chat: z(t.chat_id) })), t.topic_id && n.push(e("agent.panel.messenger_topic", "topic {topic}", { topic: t.topic_id })), t.updated_at && n.push(g(t.updated_at, { zone: e.timeZone })), n;
709
+ }
710
+ function N(e) {
665
711
  let t = f(), { value: n } = d("agents.transcript_names", "code"), { data: r } = u();
666
- return n === "display" && t(r?.actions?.[e]?.display?.name ?? L(r, e)) || e;
712
+ return n === "display" && t(r?.actions?.[e]?.display?.name ?? P(r, e)) || e;
667
713
  }
668
- function L(e, t) {
714
+ function P(e, t) {
669
715
  let n = t.indexOf(".");
670
716
  if (!(n < 0)) return e?.entities?.[t.slice(0, n)]?.actions?.[t.slice(n + 1)]?.display?.name;
671
717
  }
672
- function ue({ message: e, delivered: t, turns: n }) {
673
- let r = S(e, n) ? e.attachments : void 0;
718
+ function he({ message: e, delivered: t, turns: n }) {
719
+ let r = ne(e, n) ? e.attachments : void 0;
674
720
  if (e.role === "user") {
675
- let t = J(e.content);
676
- return e.content.some((e) => e.type !== "text" && e.type !== "location") ? /* @__PURE__ */ E(U, {
721
+ let t = K(e.content);
722
+ return e.content.some((e) => e.type !== "text" && e.type !== "location") ? /* @__PURE__ */ w(B, {
677
723
  message: e,
678
724
  files: r
679
- }) : /* @__PURE__ */ D("div", {
725
+ }) : /* @__PURE__ */ T("div", {
680
726
  style: {
681
727
  alignSelf: "flex-end",
682
728
  maxWidth: "80%",
@@ -688,34 +734,34 @@ function ue({ message: e, delivered: t, turns: n }) {
688
734
  "data-message-id": e.id,
689
735
  "data-streaming": e.streaming ? "true" : void 0,
690
736
  children: [
691
- t && /* @__PURE__ */ E(R, { text: t }),
692
- /* @__PURE__ */ E(x, {
737
+ t && /* @__PURE__ */ w(F, { text: t }),
738
+ /* @__PURE__ */ w(b, {
693
739
  files: r,
694
740
  align: "end"
695
741
  }),
696
- /* @__PURE__ */ E(V, { message: e })
742
+ /* @__PURE__ */ w(R, { message: e })
697
743
  ]
698
744
  });
699
745
  }
700
- return e.role === "tool" ? /* @__PURE__ */ E(U, { message: e }) : e.role === "system" ? e.content.some((e) => e.type === "decision") ? /* @__PURE__ */ E(U, { message: e }) : z(e) ? /* @__PURE__ */ E(B, { message: e }) : /* @__PURE__ */ D(A, {
746
+ return e.role === "tool" ? /* @__PURE__ */ w(B, { message: e }) : e.role === "system" ? e.content.some((e) => e.type === "decision") ? /* @__PURE__ */ w(B, { message: e }) : I(e) ? /* @__PURE__ */ w(L, { message: e }) : /* @__PURE__ */ T(D, {
701
747
  dataMessageId: e.id,
702
- children: [e.content.map((e, t) => /* @__PURE__ */ E(K, { block: e }, t)), /* @__PURE__ */ E(V, { message: e })]
703
- }) : e.content.length === 0 && !r?.length ? null : /* @__PURE__ */ D(A, {
748
+ children: [e.content.map((e, t) => /* @__PURE__ */ w(W, { block: e }, t)), /* @__PURE__ */ w(R, { message: e })]
749
+ }) : e.content.length === 0 && !r?.length ? null : /* @__PURE__ */ T(D, {
704
750
  dataMessageId: e.id,
705
751
  dataStreaming: e.streaming,
706
752
  children: [
707
- e.content.map((e, t) => /* @__PURE__ */ E(K, { block: e }, t)),
708
- e.streaming && /* @__PURE__ */ E(re, {}),
709
- /* @__PURE__ */ E(x, {
753
+ e.content.map((e, t) => /* @__PURE__ */ w(W, { block: e }, t)),
754
+ e.streaming && /* @__PURE__ */ w(se, {}),
755
+ /* @__PURE__ */ w(b, {
710
756
  files: r,
711
757
  align: "start"
712
758
  }),
713
- t && /* @__PURE__ */ E(V, { message: t })
759
+ t && /* @__PURE__ */ w(R, { message: t })
714
760
  ]
715
761
  });
716
762
  }
717
- function R({ text: e, dim: t }) {
718
- return /* @__PURE__ */ E("div", {
763
+ function F({ text: e, dim: t }) {
764
+ return /* @__PURE__ */ w("div", {
719
765
  style: {
720
766
  padding: "8px 12px",
721
767
  borderRadius: "var(--radius-lg)",
@@ -734,12 +780,12 @@ function R({ text: e, dim: t }) {
734
780
  children: e
735
781
  });
736
782
  }
737
- function z(e) {
783
+ function I(e) {
738
784
  return !e.bot_id || e.delivery_key ? !1 : e.content.some((e) => e.type === "reaction" || e.type === "text" && (!!e.callback_data || e.heard === !0));
739
785
  }
740
- function B({ message: e }) {
741
- let t = f(), n = e.content.some((e) => e.type === "text" && e.heard === !0), r = e.content.some((e) => e.type === "text" && !!e.callback_data), i = J(e.content), a = e.content.find((e) => e.type === "reaction"), o = a?.type === "reaction" ? a.emoji ?? "" : i, s = n ? t("agent.panel.heard_started_nothing", "Heard, started nothing") : r ? t("agent.panel.pressed_button", "Pressed a button") : "";
742
- return /* @__PURE__ */ D("div", {
786
+ function L({ message: e }) {
787
+ let t = f(), n = e.content.some((e) => e.type === "text" && e.heard === !0), r = e.content.some((e) => e.type === "text" && !!e.callback_data), i = K(e.content), a = e.content.find((e) => e.type === "reaction"), o = a?.type === "reaction" ? a.emoji ?? "" : i, s = n ? t("agent.panel.heard_started_nothing", "Heard, started nothing") : r ? t("agent.panel.pressed_button", "Pressed a button") : "";
788
+ return /* @__PURE__ */ T("div", {
743
789
  "data-message-id": e.id,
744
790
  "data-person-on-messenger": n ? "heard" : r ? "pressed" : "reacted",
745
791
  style: {
@@ -751,11 +797,11 @@ function B({ message: e }) {
751
797
  alignItems: "flex-end"
752
798
  },
753
799
  children: [
754
- o && /* @__PURE__ */ E(R, {
800
+ o && /* @__PURE__ */ w(F, {
755
801
  text: o,
756
802
  dim: n
757
803
  }),
758
- s && /* @__PURE__ */ E("div", {
804
+ s && /* @__PURE__ */ w("div", {
759
805
  "data-messenger-mark": !0,
760
806
  style: {
761
807
  fontSize: 10.5,
@@ -764,15 +810,15 @@ function B({ message: e }) {
764
810
  },
765
811
  children: s
766
812
  }),
767
- /* @__PURE__ */ E(V, { message: e })
813
+ /* @__PURE__ */ w(R, { message: e })
768
814
  ]
769
815
  });
770
816
  }
771
- function V({ message: e }) {
772
- let t = f(), n = h("agent_message")?.fields.get("delivery_status");
817
+ function R({ message: e }) {
818
+ let t = f(), n = m("agent_message")?.fields.get("delivery_status");
773
819
  if (!e.bot_id) return null;
774
820
  let r = [];
775
- return e.bot && r.push(e.bot), e.chat_id && r.push(t("agent.panel.messenger_chat", "chat {chat}", { chat: H(e.chat_id) })), e.topic_id && r.push(t("agent.panel.messenger_topic", "topic {topic}", { topic: e.topic_id })), !e.delivery_key && e.sender_external_id && r.push(t("agent.panel.messenger_from", "from {sender}", { sender: e.sender_user || H(e.sender_external_id) })), e.delivery_status && r.push(t(n?.values?.find((t) => t.code === e.delivery_status)?.name) || e.delivery_status), /* @__PURE__ */ E("div", {
821
+ return e.bot && r.push(e.bot), e.chat_id && r.push(t("agent.panel.messenger_chat", "chat {chat}", { chat: z(e.chat_id) })), e.topic_id && r.push(t("agent.panel.messenger_topic", "topic {topic}", { topic: e.topic_id })), !e.delivery_key && e.sender_external_id && (e.sender_user || z(e.sender_external_id) !== z(e.chat_id ?? "")) && r.push(t("agent.panel.messenger_from", "from {sender}", { sender: e.sender_user || z(e.sender_external_id) })), e.delivery_status && r.push(t(n?.values?.find((t) => t.code === e.delivery_status)?.name) || e.delivery_status), /* @__PURE__ */ w("div", {
776
822
  "data-messenger-facts": !0,
777
823
  "data-delivery-status": e.delivery_status ?? void 0,
778
824
  style: {
@@ -784,11 +830,11 @@ function V({ message: e }) {
784
830
  children: r.join(" · ")
785
831
  });
786
832
  }
787
- function H(e) {
833
+ function z(e) {
788
834
  return e.slice(e.indexOf(":") + 1);
789
835
  }
790
- function U({ message: e, files: t }) {
791
- return /* @__PURE__ */ D("div", {
836
+ function B({ message: e, files: t }) {
837
+ return /* @__PURE__ */ T("div", {
792
838
  "data-message-id": e.id,
793
839
  "data-streaming": e.streaming ? "true" : void 0,
794
840
  style: {
@@ -800,18 +846,18 @@ function U({ message: e, files: t }) {
800
846
  alignItems: "flex-end",
801
847
  overflowWrap: "anywhere"
802
848
  },
803
- children: [e.content.map((e, t) => /* @__PURE__ */ E(K, { block: e }, t)), /* @__PURE__ */ E(x, {
849
+ children: [e.content.map((e, t) => /* @__PURE__ */ w(W, { block: e }, t)), /* @__PURE__ */ w(b, {
804
850
  files: t,
805
851
  align: "end"
806
852
  })]
807
853
  });
808
854
  }
809
- function W({ href: e, children: t, ...n }) {
855
+ function V({ href: e, children: t, ...n }) {
810
856
  let r = p(), i = {
811
857
  color: "var(--accent-text)",
812
858
  textDecoration: "underline"
813
- }, a = de(e);
814
- return a ? /* @__PURE__ */ E("a", {
859
+ }, a = H(e);
860
+ return a ? /* @__PURE__ */ w("a", {
815
861
  ...n,
816
862
  href: e,
817
863
  style: i,
@@ -819,7 +865,7 @@ function W({ href: e, children: t, ...n }) {
819
865
  e.preventDefault(), r(a);
820
866
  },
821
867
  children: t
822
- }) : /* @__PURE__ */ E("a", {
868
+ }) : /* @__PURE__ */ w("a", {
823
869
  ...n,
824
870
  href: e,
825
871
  target: "_blank",
@@ -828,7 +874,7 @@ function W({ href: e, children: t, ...n }) {
828
874
  children: t
829
875
  });
830
876
  }
831
- function de(e) {
877
+ function H(e) {
832
878
  if (typeof e != "string") return null;
833
879
  let t;
834
880
  try {
@@ -838,10 +884,10 @@ function de(e) {
838
884
  }
839
885
  return t.origin === window.location.origin ? `${t.pathname}${t.search}${t.hash}` : null;
840
886
  }
841
- var G = {
842
- a: W,
887
+ var U = {
888
+ a: V,
843
889
  code({ node: e, inline: t, className: n, children: r, ...i }) {
844
- return t ? /* @__PURE__ */ E("code", {
890
+ return t ? /* @__PURE__ */ w("code", {
845
891
  ...i,
846
892
  style: {
847
893
  background: "var(--surface-2)",
@@ -851,7 +897,7 @@ var G = {
851
897
  fontSize: "0.92em"
852
898
  },
853
899
  children: r
854
- }) : /* @__PURE__ */ E("pre", {
900
+ }) : /* @__PURE__ */ w("pre", {
855
901
  style: {
856
902
  background: "var(--surface-2)",
857
903
  border: "1px solid var(--border)",
@@ -862,7 +908,7 @@ var G = {
862
908
  fontSize: 11.5,
863
909
  lineHeight: 1.5
864
910
  },
865
- children: /* @__PURE__ */ E("code", {
911
+ children: /* @__PURE__ */ w("code", {
866
912
  className: n,
867
913
  ...i,
868
914
  children: r
@@ -870,7 +916,7 @@ var G = {
870
916
  });
871
917
  },
872
918
  ul({ children: e, ...t }) {
873
- return /* @__PURE__ */ E("ul", {
919
+ return /* @__PURE__ */ w("ul", {
874
920
  ...t,
875
921
  style: {
876
922
  paddingLeft: 18,
@@ -880,7 +926,7 @@ var G = {
880
926
  });
881
927
  },
882
928
  ol({ children: e, ...t }) {
883
- return /* @__PURE__ */ E("ol", {
929
+ return /* @__PURE__ */ w("ol", {
884
930
  ...t,
885
931
  style: {
886
932
  paddingLeft: 20,
@@ -890,51 +936,51 @@ var G = {
890
936
  });
891
937
  },
892
938
  p({ children: e, ...t }) {
893
- return /* @__PURE__ */ E("p", {
939
+ return /* @__PURE__ */ w("p", {
894
940
  ...t,
895
941
  style: { margin: "4px 0" },
896
942
  children: e
897
943
  });
898
944
  }
899
945
  };
900
- function K({ block: e }) {
946
+ function W({ block: e }) {
901
947
  let t = f();
902
948
  switch (e.type) {
903
- case "text": return /* @__PURE__ */ E("div", {
949
+ case "text": return /* @__PURE__ */ w("div", {
904
950
  className: "agent-md",
905
- children: /* @__PURE__ */ E(i, {
951
+ children: /* @__PURE__ */ w(i, {
906
952
  content: e.text,
907
953
  plugins: "gfm",
908
954
  prose: !1,
909
955
  skipHtml: !1,
910
- components: G
956
+ components: U
911
957
  })
912
958
  });
913
959
  case "tool_use": {
914
- let n = Y(t, e.name, e.input);
915
- return /* @__PURE__ */ E(q, {
960
+ let n = q(t, e.name, e.input);
961
+ return /* @__PURE__ */ w(G, {
916
962
  kind: "call",
917
963
  label: n.label,
918
964
  sub: n.sub,
919
965
  body: e.input
920
966
  });
921
967
  }
922
- case "tool_result": return /* @__PURE__ */ E(q, {
968
+ case "tool_result": return /* @__PURE__ */ w(G, {
923
969
  kind: "result",
924
- label: X(t, e),
970
+ label: J(t, e),
925
971
  body: e.output,
926
972
  isError: !!e.is_error
927
973
  });
928
- case "elicit_response": return /* @__PURE__ */ E(q, {
974
+ case "elicit_response": return /* @__PURE__ */ w(G, {
929
975
  kind: "result",
930
976
  label: t("agent.panel.chip.answer", "answer"),
931
977
  body: e.data
932
978
  });
933
- case "decision": return /* @__PURE__ */ E(fe, { block: e });
979
+ case "decision": return /* @__PURE__ */ w(X, { block: e });
934
980
  case "location":
935
981
  case "thinking":
936
982
  case "redacted_thinking": return null;
937
- case "system": return /* @__PURE__ */ D("div", {
983
+ case "system": return /* @__PURE__ */ T("div", {
938
984
  style: {
939
985
  fontSize: 10.5,
940
986
  fontStyle: "italic",
@@ -942,7 +988,7 @@ function K({ block: e }) {
942
988
  },
943
989
  children: ["— ", e.reason]
944
990
  });
945
- case "summary": return /* @__PURE__ */ E("div", {
991
+ case "summary": return /* @__PURE__ */ w("div", {
946
992
  style: {
947
993
  fontSize: 10.5,
948
994
  fontStyle: "italic",
@@ -950,7 +996,7 @@ function K({ block: e }) {
950
996
  },
951
997
  children: e.text
952
998
  });
953
- case "attachment": return /* @__PURE__ */ E("pre", {
999
+ case "attachment": return /* @__PURE__ */ w("pre", {
954
1000
  className: "mono",
955
1001
  style: {
956
1002
  marginTop: 8,
@@ -966,8 +1012,8 @@ function K({ block: e }) {
966
1012
  default: return null;
967
1013
  }
968
1014
  }
969
- function q({ kind: e, label: t, sub: n, body: r, isError: i }) {
970
- return /* @__PURE__ */ D("details", {
1015
+ function G({ kind: e, label: t, sub: n, body: r, isError: i }) {
1016
+ return /* @__PURE__ */ T("details", {
971
1017
  style: {
972
1018
  marginTop: 6,
973
1019
  background: "var(--surface-2)",
@@ -980,7 +1026,7 @@ function q({ kind: e, label: t, sub: n, body: r, isError: i }) {
980
1026
  boxSizing: "border-box",
981
1027
  overflow: "hidden"
982
1028
  },
983
- children: [/* @__PURE__ */ D("summary", {
1029
+ children: [/* @__PURE__ */ T("summary", {
984
1030
  style: {
985
1031
  padding: "5px 8px",
986
1032
  cursor: "pointer",
@@ -992,7 +1038,7 @@ function q({ kind: e, label: t, sub: n, body: r, isError: i }) {
992
1038
  color: "var(--text-2)"
993
1039
  },
994
1040
  children: [
995
- /* @__PURE__ */ E("span", {
1041
+ /* @__PURE__ */ w("span", {
996
1042
  "aria-hidden": !0,
997
1043
  style: {
998
1044
  color: i ? "var(--destructive)" : "var(--text-3)",
@@ -1001,7 +1047,7 @@ function q({ kind: e, label: t, sub: n, body: r, isError: i }) {
1001
1047
  },
1002
1048
  children: e === "call" ? "→" : i ? "✗" : "✓"
1003
1049
  }),
1004
- /* @__PURE__ */ E("span", {
1050
+ /* @__PURE__ */ w("span", {
1005
1051
  className: "mono",
1006
1052
  style: {
1007
1053
  color: "var(--text-2)",
@@ -1013,7 +1059,7 @@ function q({ kind: e, label: t, sub: n, body: r, isError: i }) {
1013
1059
  },
1014
1060
  children: t
1015
1061
  }),
1016
- n && /* @__PURE__ */ E("span", {
1062
+ n && /* @__PURE__ */ w("span", {
1017
1063
  style: {
1018
1064
  fontSize: 10,
1019
1065
  color: "var(--text-4)",
@@ -1025,8 +1071,8 @@ function q({ kind: e, label: t, sub: n, body: r, isError: i }) {
1025
1071
  },
1026
1072
  children: n
1027
1073
  }),
1028
- /* @__PURE__ */ E("span", { style: { flex: 1 } }),
1029
- /* @__PURE__ */ E("span", {
1074
+ /* @__PURE__ */ w("span", { style: { flex: 1 } }),
1075
+ /* @__PURE__ */ w("span", {
1030
1076
  "aria-hidden": !0,
1031
1077
  style: {
1032
1078
  fontSize: 9,
@@ -1035,7 +1081,7 @@ function q({ kind: e, label: t, sub: n, body: r, isError: i }) {
1035
1081
  children: "▾"
1036
1082
  })
1037
1083
  ]
1038
- }), /* @__PURE__ */ E("pre", {
1084
+ }), /* @__PURE__ */ w("pre", {
1039
1085
  className: "mono",
1040
1086
  style: {
1041
1087
  margin: 0,
@@ -1051,10 +1097,10 @@ function q({ kind: e, label: t, sub: n, body: r, isError: i }) {
1051
1097
  })]
1052
1098
  });
1053
1099
  }
1054
- function J(e) {
1100
+ function K(e) {
1055
1101
  return e.map((e) => e.type === "text" ? e.text : "").join("");
1056
1102
  }
1057
- function Y(e, t, n) {
1103
+ function q(e, t, n) {
1058
1104
  if (t === "action.invoke") {
1059
1105
  let r = typeof n?.code == "string" ? n.code : "";
1060
1106
  if (r) return {
@@ -1064,15 +1110,15 @@ function Y(e, t, n) {
1064
1110
  }
1065
1111
  return { label: t };
1066
1112
  }
1067
- function X(e, t) {
1113
+ function J(e, t) {
1068
1114
  return t.name ? t.name : t.is_error ? e("agent.panel.chip.error", "error") : e("agent.panel.chip.result", "result");
1069
1115
  }
1070
- function Z(e, t) {
1116
+ function Y(e, t) {
1071
1117
  return t === "approved" ? e("agent.panel.decision.approve", "Approved") : e("agent.panel.decision.reject", "Rejected");
1072
1118
  }
1073
- function fe({ block: e }) {
1119
+ function X({ block: e }) {
1074
1120
  let t = f(), n = e.decision === "approved", r = n ? "var(--success)" : "var(--destructive)";
1075
- return /* @__PURE__ */ D("div", {
1121
+ return /* @__PURE__ */ T("div", {
1076
1122
  style: {
1077
1123
  marginTop: 6,
1078
1124
  padding: "5px 10px",
@@ -1088,7 +1134,7 @@ function fe({ block: e }) {
1088
1134
  },
1089
1135
  title: e.decided_at ? t("agent.panel.decided_at", "decided {time}", { time: e.decided_at }) : void 0,
1090
1136
  children: [
1091
- /* @__PURE__ */ E("span", {
1137
+ /* @__PURE__ */ w("span", {
1092
1138
  "aria-hidden": !0,
1093
1139
  style: {
1094
1140
  color: r,
@@ -1096,11 +1142,11 @@ function fe({ block: e }) {
1096
1142
  },
1097
1143
  children: n ? "✓" : "✗"
1098
1144
  }),
1099
- /* @__PURE__ */ E("span", {
1145
+ /* @__PURE__ */ w("span", {
1100
1146
  style: { fontWeight: 600 },
1101
- children: Z(t, e.decision)
1147
+ children: Y(t, e.decision)
1102
1148
  }),
1103
- /* @__PURE__ */ E("span", {
1149
+ /* @__PURE__ */ w("span", {
1104
1150
  className: "mono",
1105
1151
  style: {
1106
1152
  color: "var(--text-3)",
@@ -1108,7 +1154,7 @@ function fe({ block: e }) {
1108
1154
  },
1109
1155
  children: e.tool_code
1110
1156
  }),
1111
- e.note && /* @__PURE__ */ D("span", {
1157
+ e.note && /* @__PURE__ */ T("span", {
1112
1158
  style: {
1113
1159
  color: "var(--text-3)",
1114
1160
  fontStyle: "italic"
@@ -1118,10 +1164,10 @@ function fe({ block: e }) {
1118
1164
  ]
1119
1165
  });
1120
1166
  }
1121
- async function pe(e, t) {
1167
+ async function ge(e, t) {
1122
1168
  let n = [];
1123
1169
  for (let r of t) {
1124
- let t = `[${r.role}]`, i = r.content.map((t) => me(e, t)).filter((e) => e.length > 0).join("\n");
1170
+ let t = `[${r.role}]`, i = r.content.map((t) => Z(e, t)).filter((e) => e.length > 0).join("\n");
1125
1171
  i && n.push(`${t}\n${i}`);
1126
1172
  }
1127
1173
  let r = n.join("\n\n");
@@ -1131,16 +1177,16 @@ async function pe(e, t) {
1131
1177
  console.error("agent: copyTranscript failed", e);
1132
1178
  }
1133
1179
  }
1134
- function me(e, t) {
1180
+ function Z(e, t) {
1135
1181
  switch (t.type) {
1136
1182
  case "text": return t.text;
1137
1183
  case "tool_use": {
1138
- let n = Y(e, t.name, t.input);
1184
+ let n = q(e, t.name, t.input);
1139
1185
  return `${n.sub ? `→ ${n.label} (${n.sub})` : `→ ${n.label}`}\n${JSON.stringify(t.input, null, 2)}`;
1140
1186
  }
1141
- case "tool_result": return `${`${t.is_error ? "✗" : "✓"} ${X(e, t)}`}\n${JSON.stringify(t.output, null, 2)}`;
1187
+ case "tool_result": return `${`${t.is_error ? "✗" : "✓"} ${J(e, t)}`}\n${JSON.stringify(t.output, null, 2)}`;
1142
1188
  case "elicit_response": return `${e("agent.panel.chip.answer", "answer")}\n${JSON.stringify(t.data, null, 2)}`;
1143
- case "decision": return `${Z(e, t.decision)} ${t.tool_code}${t.note ? ` — ${t.note}` : ""}`;
1189
+ case "decision": return `${Y(e, t.decision)} ${t.tool_code}${t.note ? ` — ${t.note}` : ""}`;
1144
1190
  case "system": return `— ${t.reason}`;
1145
1191
  case "summary": return t.text;
1146
1192
  case "attachment": return t.content;
@@ -1150,27 +1196,27 @@ function me(e, t) {
1150
1196
  function Q(e, t) {
1151
1197
  return e("agent.panel.proposal", "Run {code}.", { code: t });
1152
1198
  }
1153
- function he({ tool: t, onApprove: r, onReject: i }) {
1154
- let a = f(), o = f("errors"), s = JSON.stringify(t.params ?? {}, null, 2), [c, l] = T(!1), [u, d] = T(!1), [p, m] = T(""), [h, _] = T(null), [v, y] = T(!1), b = async (e) => {
1155
- if (!v) {
1156
- y(!0);
1199
+ function _e({ tool: t, onApprove: r, onReject: i }) {
1200
+ let a = f(), o = f("errors"), s = JSON.stringify(t.params ?? {}, null, 2), [c, l] = C(!1), [u, d] = C(!1), [p, ee] = C(""), [m, g] = C(null), [_, v] = C(!1), y = async (e) => {
1201
+ if (!_) {
1202
+ v(!0);
1157
1203
  try {
1158
1204
  await r(e);
1159
1205
  } catch (e) {
1160
- _(g(o, e)), y(!1);
1206
+ g(h(o, e)), v(!1);
1161
1207
  }
1162
1208
  }
1163
- }, x = async () => {
1164
- if (!v) {
1165
- y(!0);
1209
+ }, te = async () => {
1210
+ if (!_) {
1211
+ v(!0);
1166
1212
  try {
1167
1213
  await i(p.trim() || void 0);
1168
1214
  } catch (e) {
1169
- _(g(o, e)), y(!1);
1215
+ g(h(o, e)), v(!1);
1170
1216
  }
1171
1217
  }
1172
- }, S = typeof t.confidence == "number" ? Math.round(Math.max(0, Math.min(1, t.confidence)) * 100) : null;
1173
- return /* @__PURE__ */ D("div", {
1218
+ }, b = typeof t.confidence == "number" ? Math.round(Math.max(0, Math.min(1, t.confidence)) * 100) : null;
1219
+ return /* @__PURE__ */ T("div", {
1174
1220
  style: {
1175
1221
  marginTop: 4,
1176
1222
  padding: "10px 12px",
@@ -1179,7 +1225,7 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1179
1225
  borderRadius: "var(--radius-md)"
1180
1226
  },
1181
1227
  children: [
1182
- /* @__PURE__ */ D("div", {
1228
+ /* @__PURE__ */ T("div", {
1183
1229
  style: {
1184
1230
  display: "flex",
1185
1231
  alignItems: "center",
@@ -1187,11 +1233,11 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1187
1233
  marginBottom: 6
1188
1234
  },
1189
1235
  children: [
1190
- /* @__PURE__ */ E(e.bolt, {
1236
+ /* @__PURE__ */ w(e.bolt, {
1191
1237
  size: 11,
1192
1238
  style: { color: "var(--accent)" }
1193
1239
  }),
1194
- /* @__PURE__ */ E("span", {
1240
+ /* @__PURE__ */ w("span", {
1195
1241
  style: {
1196
1242
  fontSize: 11.5,
1197
1243
  fontWeight: 600,
@@ -1199,7 +1245,7 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1199
1245
  },
1200
1246
  children: a("agent.panel.proposed", "AI proposed")
1201
1247
  }),
1202
- /* @__PURE__ */ E("span", {
1248
+ /* @__PURE__ */ w("span", {
1203
1249
  className: "mono",
1204
1250
  style: {
1205
1251
  fontSize: 10.5,
@@ -1207,8 +1253,8 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1207
1253
  },
1208
1254
  children: t.tool_code
1209
1255
  }),
1210
- S !== null && /* @__PURE__ */ E("span", {
1211
- title: a("agent.panel.confidence_title", "LLM confidence {percent}%", { percent: S }),
1256
+ b !== null && /* @__PURE__ */ w("span", {
1257
+ title: a("agent.panel.confidence_title", "LLM confidence {percent}%", { percent: b }),
1212
1258
  style: {
1213
1259
  marginLeft: "auto",
1214
1260
  fontSize: 10,
@@ -1217,11 +1263,11 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1217
1263
  border: "1px solid var(--border)",
1218
1264
  borderRadius: 999
1219
1265
  },
1220
- children: a("agent.panel.confidence", "{percent}% confident", { percent: S })
1266
+ children: a("agent.panel.confidence", "{percent}% confident", { percent: b })
1221
1267
  })
1222
1268
  ]
1223
1269
  }),
1224
- /* @__PURE__ */ E("div", {
1270
+ /* @__PURE__ */ w("div", {
1225
1271
  style: {
1226
1272
  fontSize: 12,
1227
1273
  lineHeight: 1.45,
@@ -1230,7 +1276,7 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1230
1276
  },
1231
1277
  children: t.question?.message?.trim() || Q(a, t.tool_code)
1232
1278
  }),
1233
- t.reason?.trim() && /* @__PURE__ */ E("div", {
1279
+ t.reason?.trim() && /* @__PURE__ */ w("div", {
1234
1280
  style: {
1235
1281
  fontSize: 11.5,
1236
1282
  lineHeight: 1.45,
@@ -1239,7 +1285,7 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1239
1285
  },
1240
1286
  children: t.reason.trim()
1241
1287
  }),
1242
- /* @__PURE__ */ D("button", {
1288
+ /* @__PURE__ */ T("button", {
1243
1289
  type: "button",
1244
1290
  onClick: () => l((e) => !e),
1245
1291
  style: {
@@ -1254,7 +1300,7 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1254
1300
  alignItems: "center",
1255
1301
  gap: 4
1256
1302
  },
1257
- children: [/* @__PURE__ */ E("span", {
1303
+ children: [/* @__PURE__ */ w("span", {
1258
1304
  style: {
1259
1305
  display: "inline-block",
1260
1306
  transform: c ? "rotate(90deg)" : "none",
@@ -1265,7 +1311,7 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1265
1311
  children: "▶"
1266
1312
  }), c ? a("agent.panel.hide_params", "Hide parameters") : a("agent.panel.view_params", "View parameters")]
1267
1313
  }),
1268
- c && /* @__PURE__ */ E("pre", {
1314
+ c && /* @__PURE__ */ w("pre", {
1269
1315
  className: "mono",
1270
1316
  style: {
1271
1317
  width: "100%",
@@ -1282,18 +1328,18 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1282
1328
  },
1283
1329
  children: s
1284
1330
  }),
1285
- h && /* @__PURE__ */ E("div", {
1331
+ m && /* @__PURE__ */ w("div", {
1286
1332
  style: {
1287
1333
  marginTop: 4,
1288
1334
  fontSize: 10.5,
1289
1335
  color: "var(--text-2)"
1290
1336
  },
1291
- children: h
1337
+ children: m
1292
1338
  }),
1293
- u && /* @__PURE__ */ E("input", {
1339
+ u && /* @__PURE__ */ w("input", {
1294
1340
  type: "text",
1295
1341
  value: p,
1296
- onChange: (e) => m(e.target.value),
1342
+ onChange: (e) => ee(e.target.value),
1297
1343
  placeholder: a("agent.panel.reject_note", "Why not? (optional) — then Send rejection"),
1298
1344
  autoFocus: !0,
1299
1345
  style: {
@@ -1307,7 +1353,7 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1307
1353
  color: "var(--text)"
1308
1354
  }
1309
1355
  }),
1310
- /* @__PURE__ */ D("div", {
1356
+ /* @__PURE__ */ T("div", {
1311
1357
  style: {
1312
1358
  display: "flex",
1313
1359
  gap: 6,
@@ -1315,32 +1361,32 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1315
1361
  justifyContent: "flex-end"
1316
1362
  },
1317
1363
  children: [
1318
- u ? /* @__PURE__ */ E(n, {
1364
+ u ? /* @__PURE__ */ w(n, {
1319
1365
  size: "xs",
1320
1366
  kind: "ghost",
1321
- onClick: x,
1322
- disabled: v,
1367
+ onClick: te,
1368
+ disabled: _,
1323
1369
  children: a("agent.panel.reject_send", "Send rejection")
1324
- }) : /* @__PURE__ */ E(n, {
1370
+ }) : /* @__PURE__ */ w(n, {
1325
1371
  size: "xs",
1326
1372
  kind: "ghost",
1327
1373
  onClick: () => d(!0),
1328
- disabled: v,
1374
+ disabled: _,
1329
1375
  children: a("agent.panel.reject", "Reject…")
1330
1376
  }),
1331
- t.confirmation_mode !== "always" && /* @__PURE__ */ E(n, {
1377
+ t.confirmation_mode !== "always" && /* @__PURE__ */ w(n, {
1332
1378
  size: "xs",
1333
1379
  kind: "ghost",
1334
- onClick: () => b("conversation"),
1335
- disabled: v,
1380
+ onClick: () => y("conversation"),
1381
+ disabled: _,
1336
1382
  children: a("agent.panel.approve_chat", "Approve for this chat")
1337
1383
  }),
1338
- /* @__PURE__ */ E(n, {
1384
+ /* @__PURE__ */ w(n, {
1339
1385
  size: "xs",
1340
1386
  kind: "primary",
1341
- icon: /* @__PURE__ */ E(e.check, { size: 11 }),
1342
- onClick: () => b("call"),
1343
- disabled: v,
1387
+ icon: /* @__PURE__ */ w(e.check, { size: 11 }),
1388
+ onClick: () => y("call"),
1389
+ disabled: _,
1344
1390
  children: a("agent.panel.approve_once", "Approve once")
1345
1391
  })
1346
1392
  ]
@@ -1348,4 +1394,4 @@ function he({ tool: t, onApprove: r, onReject: i }) {
1348
1394
  ]
1349
1395
  });
1350
1396
  }
1351
- export { k as AgentChatPanel, Q as proposalFallback };
1397
+ export { oe as AgentChatPanel, Q as proposalFallback };