@parallelworks/tandem-web 0.164.0 → 0.164.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,52 +5,51 @@ import { agentsQuery as a, attachmentsQuery as o, issueDecisionsQuery as s, pull
5
5
  import { invalidateIssueViews as f } from "../api/mutations.js";
6
6
  import { harnessNames as p } from "../lib/agents.js";
7
7
  import { parseApproval as m } from "../lib/approval.js";
8
- import { decisionDefaults as h } from "../lib/decisionEntry.js";
9
- import { copyItem as ee, useLinkItems as g } from "../lib/menus.js";
8
+ import { copyItem as h, useLinkItems as g } from "../lib/menus.js";
10
9
  import { docRef as _ } from "../lib/docs.js";
11
10
  import { externalUrl as v } from "../lib/externalUrl.js";
12
11
  import { useRunPanel as y } from "../lib/hostPanel.js";
13
- import { AreaIcon as b, CodeHostIcon as x, FileTextIcon as S, LibraryIcon as C, PullRequestIcon as w } from "./icons.js";
14
- import { EntryDialog as te, useTermRefs as T } from "../lib/knowledge.js";
15
- import { useNewIssue as E } from "../lib/newIssue.js";
12
+ import { AreaIcon as b, CodeHostIcon as x, FileTextIcon as S, LibraryIcon as C, PullRequestIcon as ee } from "./icons.js";
13
+ import { useTermRefs as w } from "../lib/knowledge.js";
14
+ import { useNewIssue as te } from "../lib/newIssue.js";
16
15
  import { usePeople as ne } from "../lib/people.js";
17
16
  import { usePermissionModeName as re } from "../lib/permissionModes.js";
18
- import { useTime as D } from "../lib/time.js";
19
- import { AgentPage as O } from "./AgentPage.js";
20
- import { Editor as k } from "./Editor.js";
21
- import { pullRequestNumber as ie } from "./IssueCode.js";
22
- import { Avatar as ae, Button as A, Card as oe, CopyCodeBlock as j, Disclosure as M, ErrorText as se, NumberInput as N, RelativeTime as P, Tooltip as F, menuDivider as ce, useOpenMenu as le } from "@parallelworks/ui";
23
- import { useParams as I } from "@tanstack/react-router";
24
- import { Suspense as ue, useCallback as L, useEffect as de, useRef as R, useState as z } from "react";
17
+ import { useTime as T } from "../lib/time.js";
18
+ import { AgentPage as ie } from "./AgentPage.js";
19
+ import { Editor as E } from "./Editor.js";
20
+ import { pullRequestNumber as ae } from "./IssueCode.js";
21
+ import { Avatar as oe, Button as D, Card as se, CopyCodeBlock as O, Disclosure as k, ErrorText as ce, NumberInput as A, RelativeTime as j, Tooltip as le, menuDivider as ue, useOpenMenu as de } from "@parallelworks/ui";
22
+ import { useParams as M } from "@tanstack/react-router";
23
+ import { useCallback as N, useEffect as P, useRef as F, useState as I } from "react";
25
24
  import { useErrorMessage as fe } from "@parallelworks/problem/react";
26
- import { useFormatter as pe, useTranslations as B } from "use-intl";
27
- import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
28
- import { useMutation as me, useQuery as W, useQueryClient as he, useSuspenseQuery as G } from "@tanstack/react-query";
29
- import { MoreButton as ge } from "@parallelworks/ui/list";
25
+ import { useFormatter as L, useTranslations as R } from "use-intl";
26
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
27
+ import { useMutation as pe, useQuery as H, useQueryClient as me, useSuspenseQuery as U } from "@tanstack/react-query";
28
+ import { MoreButton as he } from "@parallelworks/ui/list";
30
29
  // src/components/AgentWork.tsx
31
- var _e = "var(--agent-tone)";
32
- function ve() {
33
- let e = pe();
30
+ var ge = "var(--agent-tone)";
31
+ function _e() {
32
+ let e = L();
34
33
  return (t) => e.number(t / 1e6, {
35
34
  style: "currency",
36
35
  currency: "USD"
37
36
  });
38
37
  }
39
- function ye({ workspace: e, identifier: t }) {
40
- let { data: n } = G(d(e, t)), { data: r } = G(s(e, t)), i = r.filter((e) => !e.answer && !e.canceled), a = r.filter((e) => e.answer && !e.canceled), o = n.filter((e, t) => t === 0 || !["closed", "stopped"].includes(e.state)), c = B("agentWork");
41
- return n.length === 0 ? null : /* @__PURE__ */ U("section", {
38
+ function ve({ workspace: e, identifier: t }) {
39
+ let { data: n } = U(d(e, t)), { data: r } = U(s(e, t)), i = r.filter((e) => !e.answer && !e.canceled), a = r.filter((e) => e.answer && !e.canceled), o = n.filter((e, t) => t === 0 || !["closed", "stopped"].includes(e.state)), c = R("agentWork");
40
+ return n.length === 0 ? null : /* @__PURE__ */ V("section", {
42
41
  className: "mt-8 space-y-3",
43
42
  "aria-label": c("label"),
44
43
  children: [
45
- i.map((t) => /* @__PURE__ */ H($, {
44
+ i.map((t) => /* @__PURE__ */ B(Z, {
46
45
  workspace: e,
47
46
  decision: t
48
47
  }, t.id)),
49
- a.length > 0 && /* @__PURE__ */ H(Ae, {
48
+ a.length > 0 && /* @__PURE__ */ B(De, {
50
49
  workspace: e,
51
50
  decisions: a
52
51
  }),
53
- o.map((n) => /* @__PURE__ */ H(be, {
52
+ o.map((n) => /* @__PURE__ */ B(ye, {
54
53
  workspace: e,
55
54
  identifier: t,
56
55
  run: n
@@ -58,10 +57,10 @@ function ye({ workspace: e, identifier: t }) {
58
57
  ]
59
58
  });
60
59
  }
61
- function be({ workspace: n, identifier: r, run: o }) {
62
- let s = B("agentWork"), l = B("common"), u = fe(), m = re(), h = D(), g = ve(), _ = (e) => s(`state.${e}`), { nameOf: b } = ne(n), S = he(), [C, te] = z(o.state === "working"), T = () => {
63
- S.invalidateQueries({ queryKey: d(n, r).queryKey }), f(S, n, r);
64
- }, E = me({
60
+ function ye({ workspace: n, identifier: r, run: o }) {
61
+ let s = R("agentWork"), l = R("common"), u = fe(), m = re(), g = T(), _ = _e(), b = (e) => s(`state.${e}`), { nameOf: S } = ne(n), C = me(), [w, te] = I(o.state === "working"), ie = () => {
62
+ C.invalidateQueries({ queryKey: d(n, r).queryKey }), f(C, n, r);
63
+ }, O = pe({
65
64
  mutationFn: async (r) => t(await e.POST("/api/v1/workspaces/{workspace}/runs/{runId}/move", {
66
65
  params: { path: {
67
66
  workspace: n,
@@ -69,14 +68,14 @@ function be({ workspace: n, identifier: r, run: o }) {
69
68
  } },
70
69
  body: r
71
70
  })),
72
- onSettled: T
73
- }), [O, j] = z(!1), [M, N] = z(""), P = me({
71
+ onSettled: ie
72
+ }), [k, A] = I(!1), [j, le] = I(""), M = pe({
74
73
  mutationFn: async () => (t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/comments", {
75
74
  params: { path: {
76
75
  workspace: n,
77
76
  identifier: r
78
77
  } },
79
- body: { body: M }
78
+ body: { body: j }
80
79
  })), t(await e.POST("/api/v1/workspaces/{workspace}/runs/{runId}/move", {
81
80
  params: { path: {
82
81
  workspace: n,
@@ -88,10 +87,10 @@ function be({ workspace: n, identifier: r, run: o }) {
88
87
  }
89
88
  }))),
90
89
  onSuccess: () => {
91
- j(!1), N("");
90
+ A(!1), le("");
92
91
  },
93
- onSettled: T
94
- }), F = E.isPending || P.isPending, I = Ce(o), [ue, L] = z(!1), de = () => I ? L(!0) : E.mutate({ state: "queued" }), R = I && {
92
+ onSettled: ie
93
+ }), N = O.isPending || M.isPending, P = xe(o), [F, L] = I(!1), U = () => P ? L(!0) : O.mutate({ state: "queued" }), ve = P && {
95
94
  turns: {
96
95
  used: o.turns,
97
96
  allowed: o.budget.maxTurns
@@ -101,310 +100,310 @@ function be({ workspace: n, identifier: r, run: o }) {
101
100
  allowed: o.budget.maxMinutes
102
101
  },
103
102
  cost: {
104
- used: g(o.costMicros),
105
- allowed: g(o.budget.maxCostMicros)
103
+ used: _(o.costMicros),
104
+ allowed: _(o.budget.maxCostMicros)
106
105
  }
107
- }[I], pe = !["closed", "stopped"].includes(o.state), G = o.state === "done_pending_verification", ye = le(), be = i(), { data: Se = [] } = W(a(n)), q = Se.find((e) => e.id === o.agentId), { data: Ee = [] } = W(c(n, r)), J = Ee.find((e) => e.runId === o.id), De = B("code"), Y = q?.slug, X = y(), Z = X && (o.harnessSession || o.runnerName) ? {
108
- label: s("openRunIn", { name: X.action.label }),
109
- onClick: () => X.open(o)
110
- } : void 0, Q = () => [
111
- ...Z ? [Z] : [],
112
- ...G ? [{
106
+ }[P], ye = !["closed", "stopped"].includes(o.state), W = o.state === "done_pending_verification", K = de(), we = i(), { data: Te = [] } = H(a(n)), q = Te.find((e) => e.id === o.agentId), { data: Ee = [] } = H(c(n, r)), J = Ee.find((e) => e.runId === o.id), Y = R("code"), X = q?.slug, Z = y(), Q = Z && (o.harnessSession || o.runnerName) ? {
107
+ label: s("openRunIn", { name: Z.action.label }),
108
+ onClick: () => Z.open(o)
109
+ } : void 0, $ = () => [
110
+ ...Q ? [Q] : [],
111
+ ...W ? [{
113
112
  label: s("accept"),
114
- onClick: () => E.mutate({ state: "closed" })
113
+ onClick: () => O.mutate({ state: "closed" })
115
114
  }, {
116
115
  label: s("requestChanges"),
117
- onClick: () => j(!0)
116
+ onClick: () => A(!0)
118
117
  }] : [],
119
118
  ...o.state === "stopped" || o.state === "blocked_external" ? [{
120
119
  label: s("resume"),
121
- onClick: () => de()
120
+ onClick: () => U()
122
121
  }] : [],
123
- ...pe ? [{
122
+ ...ye ? [{
124
123
  label: s("stop"),
125
124
  destructive: !0,
126
- onClick: () => E.mutate({ state: "stopped" })
125
+ onClick: () => O.mutate({ state: "stopped" })
127
126
  }] : [],
128
- ce,
129
- ...Y ? [{
127
+ ue,
128
+ ...X ? [{
130
129
  label: s("openAgent"),
131
- onClick: () => be({
130
+ onClick: () => we({
132
131
  to: "/$workspace/agents/$slug",
133
132
  params: {
134
133
  workspace: n,
135
- slug: Y
134
+ slug: X
136
135
  }
137
136
  })
138
137
  }] : [],
139
- ee(s("copyRunId"), o.id)
140
- ], $ = o.state === "working" || o.state === "queued";
141
- return o.state === "closed" ? /* @__PURE__ */ U("div", {
142
- onContextMenu: (e) => ye(e, Q()),
138
+ h(s("copyRunId"), o.id)
139
+ ], De = o.state === "working" || o.state === "queued";
140
+ return o.state === "closed" ? /* @__PURE__ */ V("div", {
141
+ onContextMenu: (e) => K(e, $()),
143
142
  className: "group flex items-center gap-2 px-1 text-xs text-muted-foreground",
144
143
  children: [
145
- /* @__PURE__ */ H(ae, {
144
+ /* @__PURE__ */ B(oe, {
146
145
  kind: "agent",
147
146
  name: o.agentName,
148
147
  size: "xs",
149
148
  decorative: !0
150
149
  }),
151
- /* @__PURE__ */ H("span", { children: s.rich("accepted", {
150
+ /* @__PURE__ */ B("span", { children: s.rich("accepted", {
152
151
  agent: o.agentName,
153
- when: h.relative(o.updatedAt),
154
- name: (e) => /* @__PURE__ */ H("span", {
152
+ when: g.relative(o.updatedAt),
153
+ name: (e) => /* @__PURE__ */ B("span", {
155
154
  className: "font-medium text-foreground",
156
155
  children: e
157
156
  })
158
157
  }) }),
159
- /* @__PURE__ */ H(ge, {
160
- items: Q,
158
+ /* @__PURE__ */ B(he, {
159
+ items: $,
161
160
  label: l("moreActionsFor", { name: o.agentName }),
162
161
  className: "ml-auto"
163
162
  })
164
163
  ]
165
- }) : /* @__PURE__ */ U(oe, {
164
+ }) : /* @__PURE__ */ V(se, {
166
165
  size: "fill",
167
166
  padding: "none",
168
- tone: G ? _e : void 0,
167
+ tone: W ? ge : void 0,
169
168
  interactive: !1,
170
169
  className: "text-sm",
171
- render: /* @__PURE__ */ H("section", {
170
+ render: /* @__PURE__ */ B("section", {
172
171
  "aria-label": s("runLabel", {
173
172
  agent: o.agentName,
174
- state: _(o.state)
173
+ state: b(o.state)
175
174
  }),
176
175
  onContextMenu: (e) => {
177
- e.target.closest(".ProseMirror[contenteditable=\"true\"]") || ye(e, Q());
176
+ e.target.closest(".ProseMirror[contenteditable=\"true\"]") || K(e, $());
178
177
  }
179
178
  }),
180
179
  children: [
181
- /* @__PURE__ */ U("header", {
180
+ /* @__PURE__ */ V("header", {
182
181
  className: "flex items-center gap-2 px-3 pt-2.5",
183
182
  children: [
184
- /* @__PURE__ */ H(ae, {
183
+ /* @__PURE__ */ B(oe, {
185
184
  kind: "agent",
186
185
  name: o.agentName,
187
186
  size: "xs",
188
187
  decorative: !0
189
188
  }),
190
- /* @__PURE__ */ H("span", {
189
+ /* @__PURE__ */ B("span", {
191
190
  className: "font-medium",
192
191
  children: o.agentName
193
192
  }),
194
- /* @__PURE__ */ H("span", {
193
+ /* @__PURE__ */ B("span", {
195
194
  className: "truncate text-muted-foreground",
196
- children: s("assignedBy", { name: b("user", o.assignedBy) })
195
+ children: s("assignedBy", { name: S("user", o.assignedBy) })
197
196
  }),
198
- /* @__PURE__ */ U("span", {
199
- className: K("ml-auto inline-flex shrink-0 items-center gap-1.5 text-xs font-medium", G || $ ? "text-agent" : "text-muted-foreground"),
197
+ /* @__PURE__ */ V("span", {
198
+ className: G("ml-auto inline-flex shrink-0 items-center gap-1.5 text-xs font-medium", W || De ? "text-agent" : "text-muted-foreground"),
200
199
  children: [
201
- $ && /* @__PURE__ */ U("span", {
200
+ De && /* @__PURE__ */ V("span", {
202
201
  className: "relative flex size-1.5",
203
202
  "aria-hidden": "true",
204
- children: [o.state === "working" && /* @__PURE__ */ H("span", { className: "absolute inline-flex size-full animate-ping rounded-full bg-agent opacity-60 motion-reduce:hidden" }), /* @__PURE__ */ H("span", { className: "relative inline-flex size-1.5 rounded-full bg-agent" })]
203
+ children: [o.state === "working" && /* @__PURE__ */ B("span", { className: "absolute inline-flex size-full animate-ping rounded-full bg-agent opacity-60 motion-reduce:hidden" }), /* @__PURE__ */ B("span", { className: "relative inline-flex size-1.5 rounded-full bg-agent" })]
205
204
  }),
206
- _(o.state),
207
- o.state === "working" && o.runnerName && /* @__PURE__ */ H("span", {
205
+ b(o.state),
206
+ o.state === "working" && o.runnerName && /* @__PURE__ */ B("span", {
208
207
  className: "font-normal text-muted-foreground",
209
208
  children: s("onRunner", { runner: o.runnerName })
210
209
  })
211
210
  ]
212
211
  }),
213
- Z && o.state === "working" && /* @__PURE__ */ H(A, {
212
+ Q && o.state === "working" && /* @__PURE__ */ B(D, {
214
213
  size: "sm",
215
214
  variant: "ghost",
216
- onClick: Z.onClick,
215
+ onClick: Q.onClick,
217
216
  className: "-my-1",
218
- children: Z.label
217
+ children: Q.label
219
218
  }),
220
- /* @__PURE__ */ H(ge, {
221
- items: Q,
219
+ /* @__PURE__ */ B(he, {
220
+ items: $,
222
221
  label: l("moreActionsFor", { name: o.agentName }),
223
222
  visible: !0,
224
223
  className: "-my-1"
225
224
  })
226
225
  ]
227
226
  }),
228
- o.state === "queued" && q && !q.runnable ? /* @__PURE__ */ H("p", {
227
+ o.state === "queued" && q && !q.runnable ? /* @__PURE__ */ B("p", {
229
228
  className: "px-3 pt-1.5 text-pretty text-muted-foreground",
230
229
  children: s("noRunnerForHarness", { harness: p[q.harness] ?? q.harness })
231
- }) : o.state === "queued" && o.waiting && /* @__PURE__ */ H("p", {
230
+ }) : o.state === "queued" && o.waiting && /* @__PURE__ */ B("p", {
232
231
  className: "px-3 pt-1.5 text-pretty text-muted-foreground",
233
- children: s(`waiting.${o.waiting}`, { name: b("user", o.assignedBy) })
232
+ children: s(`waiting.${o.waiting}`, { name: S("user", o.assignedBy) })
234
233
  }),
235
- o.permissionMode && o.permissionMode !== o.agentPermissionMode && /* @__PURE__ */ H("p", {
234
+ o.permissionMode && o.permissionMode !== o.agentPermissionMode && /* @__PURE__ */ B("p", {
236
235
  className: "px-3 pt-1.5 text-pretty text-muted-foreground",
237
236
  children: s("modeLowered", {
238
237
  got: m(o.permissionMode),
239
238
  asked: m(o.agentPermissionMode)
240
239
  })
241
240
  }),
242
- o.state === "stopped" && I && R ? /* @__PURE__ */ H("p", {
241
+ o.state === "stopped" && P && ve ? /* @__PURE__ */ B("p", {
243
242
  className: "px-3 pt-1.5 text-pretty",
244
- children: s(`spent.${I}`, R)
245
- }) : o.stopReason && o.state !== "working" && o.state !== "queued" && /* @__PURE__ */ H("p", {
243
+ children: s(`spent.${P}`, ve)
244
+ }) : o.stopReason && o.state !== "working" && o.state !== "queued" && /* @__PURE__ */ B("p", {
246
245
  className: "px-3 pt-1.5 text-pretty",
247
246
  children: o.stopReason
248
247
  }),
249
- G && o.verification && /* @__PURE__ */ U("p", {
248
+ W && o.verification && /* @__PURE__ */ V("p", {
250
249
  className: "flex flex-wrap items-center gap-x-3 px-3 pt-1.5 text-xs",
251
- children: [/* @__PURE__ */ H("span", {
252
- className: K(o.verification.checks === "passing" && "text-success", o.verification.checks === "failing" && "text-danger", (o.verification.checks === "pending" || o.verification.checks === "none") && "text-muted-foreground"),
250
+ children: [/* @__PURE__ */ B("span", {
251
+ className: G(o.verification.checks === "passing" && "text-success", o.verification.checks === "failing" && "text-danger", (o.verification.checks === "pending" || o.verification.checks === "none") && "text-muted-foreground"),
253
252
  children: s(`verifyChecks.${o.verification.checks}`)
254
- }), /* @__PURE__ */ H("span", {
253
+ }), /* @__PURE__ */ B("span", {
255
254
  className: o.verification.objections ? "text-warning" : "text-success",
256
255
  children: s(o.verification.objections ? "verifyObjections" : "verifyNoObjections")
257
256
  })]
258
257
  }),
259
- J && /* @__PURE__ */ U("p", {
258
+ J && /* @__PURE__ */ V("p", {
260
259
  className: "flex flex-wrap items-center gap-x-2 px-3 pt-1.5",
261
260
  children: [
262
- /* @__PURE__ */ H(w, { className: "size-3.5 text-muted-foreground" }),
263
- /* @__PURE__ */ H(x, {
261
+ /* @__PURE__ */ B(ee, { className: "size-3.5 text-muted-foreground" }),
262
+ /* @__PURE__ */ B(x, {
264
263
  provider: J.provider,
265
264
  className: "size-3.5 text-muted-foreground"
266
265
  }),
267
- /* @__PURE__ */ H("a", {
266
+ /* @__PURE__ */ B("a", {
268
267
  href: v(J.url),
269
268
  target: "_blank",
270
269
  rel: "noopener noreferrer",
271
270
  className: "hover:underline",
272
- children: De("pullRequestRef", {
271
+ children: Y("pullRequestRef", {
273
272
  repository: J.repository,
274
- number: ie(J)
273
+ number: ae(J)
275
274
  })
276
275
  }),
277
- /* @__PURE__ */ H("span", {
276
+ /* @__PURE__ */ B("span", {
278
277
  className: "text-xs text-muted-foreground",
279
- children: De(`state.${J.state === "open" && J.draft ? "draft" : J.state}`)
278
+ children: Y(`state.${J.state === "open" && J.draft ? "draft" : J.state}`)
280
279
  })
281
280
  ]
282
281
  }),
283
- /* @__PURE__ */ H(Te, {
282
+ /* @__PURE__ */ B(Ce, {
284
283
  workspace: n,
285
284
  run: o
286
285
  }),
287
- ue && /* @__PURE__ */ H(we, {
286
+ F && /* @__PURE__ */ B(Se, {
288
287
  run: o,
289
- busy: F,
288
+ busy: N,
290
289
  onCancel: () => L(!1),
291
- onSubmit: (e) => E.mutate({
290
+ onSubmit: (e) => O.mutate({
292
291
  state: "queued",
293
292
  budget: e
294
293
  }, { onSuccess: () => L(!1) })
295
294
  }),
296
- O && /* @__PURE__ */ H("div", {
295
+ k && /* @__PURE__ */ B("div", {
297
296
  className: "mx-3 mt-2.5 rounded-md border border-border px-2.5 py-1.5 focus-within:border-primary/60",
298
- children: /* @__PURE__ */ H(k, {
297
+ children: /* @__PURE__ */ B(E, {
299
298
  value: "",
300
- onChange: N,
301
- onSubmit: () => M.trim() && P.mutate(),
299
+ onChange: le,
300
+ onSubmit: () => j.trim() && M.mutate(),
302
301
  placeholder: s("changesPlaceholder"),
303
302
  label: s("changesLabel"),
304
303
  className: "min-h-12",
305
304
  autofocus: !0
306
305
  })
307
306
  }),
308
- /* @__PURE__ */ U("footer", {
307
+ /* @__PURE__ */ V("footer", {
309
308
  className: "flex flex-wrap items-center gap-2 px-3 pt-2.5 pb-2.5",
310
309
  children: [
311
- G && !O && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(A, {
310
+ W && !k && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(D, {
312
311
  variant: "primary",
313
312
  size: "sm",
314
313
  type: "button",
315
- disabled: F,
316
- onClick: () => E.mutate({ state: "closed" }),
314
+ disabled: N,
315
+ onClick: () => O.mutate({ state: "closed" }),
317
316
  children: s("accept")
318
- }), /* @__PURE__ */ H(A, {
317
+ }), /* @__PURE__ */ B(D, {
319
318
  size: "sm",
320
319
  type: "button",
321
- disabled: F,
322
- onClick: () => j(!0),
320
+ disabled: N,
321
+ onClick: () => A(!0),
323
322
  children: s("requestChanges")
324
323
  })] }),
325
- O && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(A, {
324
+ k && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(D, {
326
325
  variant: "primary",
327
326
  size: "sm",
328
327
  type: "button",
329
- disabled: F || !M.trim(),
330
- onClick: () => P.mutate(),
328
+ disabled: N || !j.trim(),
329
+ onClick: () => M.mutate(),
331
330
  children: s("sendBack")
332
- }), /* @__PURE__ */ H(A, {
331
+ }), /* @__PURE__ */ B(D, {
333
332
  size: "sm",
334
333
  type: "button",
335
- disabled: F,
336
- onClick: () => j(!1),
334
+ disabled: N,
335
+ onClick: () => A(!1),
337
336
  children: l("cancel")
338
337
  })] }),
339
- (o.state === "stopped" || o.state === "blocked_external") && !ue && /* @__PURE__ */ H(A, {
338
+ (o.state === "stopped" || o.state === "blocked_external") && !F && /* @__PURE__ */ B(D, {
340
339
  size: "sm",
341
- disabled: F,
342
- onClick: () => de(),
340
+ disabled: N,
341
+ onClick: () => U(),
343
342
  children: s("resume")
344
343
  }),
345
- $ && /* @__PURE__ */ H(A, {
344
+ De && /* @__PURE__ */ B(D, {
346
345
  size: "sm",
347
346
  type: "button",
348
- disabled: F,
349
- onClick: () => E.mutate({ state: "stopped" }),
347
+ disabled: N,
348
+ onClick: () => O.mutate({ state: "stopped" }),
350
349
  children: s("stop")
351
350
  }),
352
- o.state !== "queued" && /* @__PURE__ */ H(A, {
351
+ o.state !== "queued" && /* @__PURE__ */ B(D, {
353
352
  size: "sm",
354
353
  type: "button",
355
- "aria-expanded": C,
354
+ "aria-expanded": w,
356
355
  onClick: () => te((e) => !e),
357
- children: s(C ? "activity.hide" : "activity.show")
356
+ children: s(w ? "activity.hide" : "activity.show")
358
357
  }),
359
- /* @__PURE__ */ H("span", {
358
+ /* @__PURE__ */ B("span", {
360
359
  className: "ml-auto text-xs text-muted-foreground tabular-nums",
361
360
  children: s("usage", {
362
361
  turns: o.turns,
363
362
  maxTurns: o.budget.maxTurns,
364
363
  minutes: Math.floor(o.seconds / 60),
365
364
  maxMinutes: o.budget.maxMinutes,
366
- cost: g(o.costMicros),
367
- maxCost: g(o.budget.maxCostMicros),
368
- when: h.relative(o.updatedAt)
365
+ cost: _(o.costMicros),
366
+ maxCost: _(o.budget.maxCostMicros),
367
+ when: g.relative(o.updatedAt)
369
368
  })
370
369
  }),
371
- (E.isError || P.isError) && /* @__PURE__ */ H(se, {
370
+ (O.isError || M.isError) && /* @__PURE__ */ B(ce, {
372
371
  className: "w-full",
373
- children: u(E.error ?? P.error)
372
+ children: u(O.error ?? M.error)
374
373
  })
375
374
  ]
376
375
  }),
377
- C && o.state !== "queued" && /* @__PURE__ */ H(xe, {
376
+ w && o.state !== "queued" && /* @__PURE__ */ B(be, {
378
377
  workspace: n,
379
378
  run: o
380
379
  })
381
380
  ]
382
381
  });
383
382
  }
384
- function xe({ workspace: e, run: t }) {
385
- let n = B("agentWork.activity"), r = D(), i = t.state === "working", { data: a, isPending: o, isError: s } = W(l(e, t.id, i)), c = R(null), u = R(!0), d = a?.length ?? 0;
386
- return de(() => {
383
+ function be({ workspace: e, run: t }) {
384
+ let n = R("agentWork.activity"), r = T(), i = t.state === "working", { data: a, isPending: o, isError: s } = H(l(e, t.id, i)), c = F(null), u = F(!0), d = a?.length ?? 0;
385
+ return P(() => {
387
386
  let e = c.current;
388
387
  e && u.current && d > 0 && (e.scrollTop = e.scrollHeight);
389
- }, [d]), /* @__PURE__ */ U("div", {
388
+ }, [d]), /* @__PURE__ */ V("div", {
390
389
  className: "border-t border-border",
391
- children: [/* @__PURE__ */ U("p", {
390
+ children: [/* @__PURE__ */ V("p", {
392
391
  className: "flex items-center gap-2 px-3 pt-2 text-xs text-muted-foreground",
393
- children: [i && /* @__PURE__ */ U("span", {
392
+ children: [i && /* @__PURE__ */ V("span", {
394
393
  className: "inline-flex items-center gap-1.5 font-medium text-agent",
395
- children: [/* @__PURE__ */ U("span", {
394
+ children: [/* @__PURE__ */ V("span", {
396
395
  className: "relative flex size-1.5",
397
396
  "aria-hidden": "true",
398
- children: [/* @__PURE__ */ H("span", { className: "absolute inline-flex size-full animate-ping rounded-full bg-agent opacity-60 motion-reduce:hidden" }), /* @__PURE__ */ H("span", { className: "relative inline-flex size-1.5 rounded-full bg-agent" })]
397
+ children: [/* @__PURE__ */ B("span", { className: "absolute inline-flex size-full animate-ping rounded-full bg-agent opacity-60 motion-reduce:hidden" }), /* @__PURE__ */ B("span", { className: "relative inline-flex size-1.5 rounded-full bg-agent" })]
399
398
  }), n("live")]
400
399
  }), n("count", { count: d })]
401
- }), s ? /* @__PURE__ */ H(se, {
400
+ }), s ? /* @__PURE__ */ B(ce, {
402
401
  className: "px-3 py-2",
403
402
  children: n("failedToLoad")
404
- }) : !o && d === 0 ? /* @__PURE__ */ H("p", {
403
+ }) : !o && d === 0 ? /* @__PURE__ */ B("p", {
405
404
  className: "px-3 py-2 text-xs text-muted-foreground",
406
405
  children: n(i ? "emptyLive" : "empty")
407
- }) : /* @__PURE__ */ H("ol", {
406
+ }) : /* @__PURE__ */ B("ol", {
408
407
  ref: c,
409
408
  "aria-live": i ? "polite" : "off",
410
409
  "aria-label": n("label"),
@@ -413,65 +412,65 @@ function xe({ workspace: e, run: t }) {
413
412
  u.current = t.scrollHeight - t.scrollTop - t.clientHeight < 24;
414
413
  },
415
414
  className: "mx-3 mt-1.5 mb-2.5 max-h-96 space-y-1 overflow-y-auto rounded-md border border-border bg-muted/40 p-2 font-mono text-[11.5px] leading-relaxed",
416
- children: a?.map((e) => /* @__PURE__ */ H(Se, {
415
+ children: a?.map((e) => /* @__PURE__ */ B(W, {
417
416
  entry: e,
418
417
  at: r.clock(e.at)
419
418
  }, e.seq))
420
419
  })]
421
420
  });
422
421
  }
423
- function Se({ entry: e, at: t }) {
424
- let n = B("agentWork.activity"), r = /* @__PURE__ */ H("span", {
422
+ function W({ entry: e, at: t }) {
423
+ let n = R("agentWork.activity"), r = /* @__PURE__ */ B("span", {
425
424
  className: "shrink-0 text-muted-foreground/70 tabular-nums",
426
425
  children: t
427
426
  });
428
427
  if (e.kind === "output" || e.kind === "failed") {
429
428
  let t = e.kind === "failed", i = e.text.split("\n", 1)[0] ?? "";
430
- return e.tool ? /* @__PURE__ */ U("li", {
429
+ return e.tool ? /* @__PURE__ */ V("li", {
431
430
  className: "flex gap-2",
432
- children: [r, /* @__PURE__ */ H(M, {
431
+ children: [r, /* @__PURE__ */ B(k, {
433
432
  className: "min-w-0 flex-1",
434
433
  summaryClassName: t ? "text-danger" : "text-muted-foreground",
435
- summary: /* @__PURE__ */ U("span", {
434
+ summary: /* @__PURE__ */ V("span", {
436
435
  className: "truncate",
437
- children: [n(t ? "toolFailed" : "toolOutput", { tool: e.tool }), i && /* @__PURE__ */ H("span", {
436
+ children: [n(t ? "toolFailed" : "toolOutput", { tool: e.tool }), i && /* @__PURE__ */ B("span", {
438
437
  className: "ml-1.5 opacity-80",
439
438
  children: i
440
439
  })]
441
440
  }),
442
- children: /* @__PURE__ */ H("pre", {
441
+ children: /* @__PURE__ */ B("pre", {
443
442
  className: "mt-1 max-h-60 overflow-auto rounded bg-card p-1.5 whitespace-pre-wrap break-words",
444
443
  children: e.text
445
444
  })
446
445
  })]
447
- }) : /* @__PURE__ */ U("li", {
446
+ }) : /* @__PURE__ */ V("li", {
448
447
  className: "flex gap-2",
449
- children: [r, /* @__PURE__ */ H("span", {
450
- className: K("min-w-0 whitespace-pre-wrap break-words", t && "text-danger"),
448
+ children: [r, /* @__PURE__ */ B("span", {
449
+ className: G("min-w-0 whitespace-pre-wrap break-words", t && "text-danger"),
451
450
  children: e.text
452
451
  })]
453
452
  });
454
453
  }
455
- return /* @__PURE__ */ U("li", {
454
+ return /* @__PURE__ */ V("li", {
456
455
  className: "flex gap-2",
457
- children: [r, /* @__PURE__ */ H("span", {
458
- className: K("min-w-0 whitespace-pre-wrap break-words", e.kind === "thinking" && "text-muted-foreground italic", e.kind === "status" && "text-muted-foreground", e.kind === "tool" && "text-foreground"),
459
- children: e.kind === "tool" ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("span", {
456
+ children: [r, /* @__PURE__ */ B("span", {
457
+ className: G("min-w-0 whitespace-pre-wrap break-words", e.kind === "thinking" && "text-muted-foreground italic", e.kind === "status" && "text-muted-foreground", e.kind === "tool" && "text-foreground"),
458
+ children: e.kind === "tool" ? /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("span", {
460
459
  className: "font-semibold text-agent",
461
460
  children: e.tool
462
- }), e.text && /* @__PURE__ */ H("span", {
461
+ }), e.text && /* @__PURE__ */ B("span", {
463
462
  className: "ml-1.5 text-muted-foreground",
464
463
  children: e.text
465
464
  })] }) : e.text
466
465
  })]
467
466
  });
468
467
  }
469
- function Ce(e) {
468
+ function xe(e) {
470
469
  return e.turns >= e.budget.maxTurns ? "turns" : e.seconds >= e.budget.maxMinutes * 60 ? "minutes" : e.costMicros >= e.budget.maxCostMicros ? "cost" : null;
471
470
  }
472
- function we({ run: e, busy: t, onSubmit: n, onCancel: r }) {
473
- let i = B("agentWork"), a = B("common"), o = Math.ceil(e.seconds / 60), [s, c] = z(Math.max(e.budget.maxTurns * 2, e.turns + 1)), [l, u] = z(Math.max(e.budget.maxMinutes * 2, o + 1)), [d, f] = z(Math.max(e.budget.maxCostMicros * 2, e.costMicros + 1e6) / 1e6);
474
- return /* @__PURE__ */ U("form", {
471
+ function Se({ run: e, busy: t, onSubmit: n, onCancel: r }) {
472
+ let i = R("agentWork"), a = R("common"), o = Math.ceil(e.seconds / 60), [s, c] = I(Math.max(e.budget.maxTurns * 2, e.turns + 1)), [l, u] = I(Math.max(e.budget.maxMinutes * 2, o + 1)), [d, f] = I(Math.max(e.budget.maxCostMicros * 2, e.costMicros + 1e6) / 1e6);
473
+ return /* @__PURE__ */ V("form", {
475
474
  className: "mx-3 mt-2.5 space-y-2 rounded-md border border-border px-2.5 py-2",
476
475
  onSubmit: (e) => {
477
476
  e.preventDefault(), n({
@@ -481,16 +480,16 @@ function we({ run: e, busy: t, onSubmit: n, onCancel: r }) {
481
480
  });
482
481
  },
483
482
  children: [
484
- /* @__PURE__ */ H("p", {
483
+ /* @__PURE__ */ B("p", {
485
484
  className: "text-sm font-medium",
486
485
  children: i("raiseBudget")
487
486
  }),
488
- /* @__PURE__ */ U("div", {
487
+ /* @__PURE__ */ V("div", {
489
488
  className: "flex flex-wrap gap-3 text-xs text-muted-foreground",
490
489
  children: [
491
- /* @__PURE__ */ U("label", {
490
+ /* @__PURE__ */ V("label", {
492
491
  className: "flex flex-col gap-1",
493
- children: [i("maxTurns"), /* @__PURE__ */ H(N, {
492
+ children: [i("maxTurns"), /* @__PURE__ */ B(A, {
494
493
  required: !0,
495
494
  min: e.turns + 1,
496
495
  value: s,
@@ -499,9 +498,9 @@ function we({ run: e, busy: t, onSubmit: n, onCancel: r }) {
499
498
  className: "w-28"
500
499
  })]
501
500
  }),
502
- /* @__PURE__ */ U("label", {
501
+ /* @__PURE__ */ V("label", {
503
502
  className: "flex flex-col gap-1",
504
- children: [i("maxMinutes"), /* @__PURE__ */ H(N, {
503
+ children: [i("maxMinutes"), /* @__PURE__ */ B(A, {
505
504
  required: !0,
506
505
  min: o + 1,
507
506
  value: l,
@@ -510,9 +509,9 @@ function we({ run: e, busy: t, onSubmit: n, onCancel: r }) {
510
509
  className: "w-28"
511
510
  })]
512
511
  }),
513
- /* @__PURE__ */ U("label", {
512
+ /* @__PURE__ */ V("label", {
514
513
  className: "flex flex-col gap-1",
515
- children: [i("maxCost"), /* @__PURE__ */ H(N, {
514
+ children: [i("maxCost"), /* @__PURE__ */ B(A, {
516
515
  required: !0,
517
516
  step: .01,
518
517
  min: (e.costMicros + 1e4) / 1e6,
@@ -528,15 +527,15 @@ function we({ run: e, busy: t, onSubmit: n, onCancel: r }) {
528
527
  })
529
528
  ]
530
529
  }),
531
- /* @__PURE__ */ U("div", {
530
+ /* @__PURE__ */ V("div", {
532
531
  className: "flex gap-2",
533
- children: [/* @__PURE__ */ H(A, {
532
+ children: [/* @__PURE__ */ B(D, {
534
533
  variant: "primary",
535
534
  size: "sm",
536
535
  type: "submit",
537
536
  disabled: t,
538
537
  children: i("resume")
539
- }), /* @__PURE__ */ H(A, {
538
+ }), /* @__PURE__ */ B(D, {
540
539
  size: "sm",
541
540
  disabled: t,
542
541
  onClick: r,
@@ -546,62 +545,62 @@ function we({ run: e, busy: t, onSubmit: n, onCancel: r }) {
546
545
  ]
547
546
  });
548
547
  }
549
- var K = (...e) => e.filter(Boolean).join(" ");
550
- function Te({ workspace: e, run: t }) {
551
- let n = T(e), i = B("agentWork"), [a, o] = z(!1), { data: s } = W({
548
+ var G = (...e) => e.filter(Boolean).join(" ");
549
+ function Ce({ workspace: e, run: t }) {
550
+ let n = w(e), i = R("agentWork"), [a, o] = I(!1), { data: s } = H({
552
551
  ...u(e, t.id),
553
552
  enabled: a
554
553
  });
555
- return /* @__PURE__ */ H(M, {
554
+ return /* @__PURE__ */ B(k, {
556
555
  className: "px-3 pt-1.5 text-xs",
557
556
  summaryClassName: "text-muted-foreground hover:text-foreground",
558
557
  summary: i("reads"),
559
558
  open: a,
560
559
  onOpenChange: o,
561
- children: s && (s.docs.length + s.entries.length === 0 ? /* @__PURE__ */ H("p", {
560
+ children: s && (s.docs.length + s.entries.length === 0 ? /* @__PURE__ */ B("p", {
562
561
  className: "mt-1 text-muted-foreground",
563
562
  children: i("readNothing")
564
- }) : /* @__PURE__ */ U("ul", {
563
+ }) : /* @__PURE__ */ V("ul", {
565
564
  className: "mt-1 flex flex-wrap gap-x-3 gap-y-1",
566
- children: [s.docs.map((t) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ U(r, {
565
+ children: [s.docs.map((t) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ V(r, {
567
566
  to: "/$workspace/docs/$doc",
568
567
  params: {
569
568
  workspace: e,
570
569
  doc: _(t)
571
570
  },
572
571
  className: "inline-flex items-center gap-1 hover:underline",
573
- children: [/* @__PURE__ */ H(S, { className: "size-3.5 text-muted-foreground" }), t.title]
574
- }) }, t.id)), s.entries.map((t) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ U(r, {
572
+ children: [/* @__PURE__ */ B(S, { className: "size-3.5 text-muted-foreground" }), t.title]
573
+ }) }, t.id)), s.entries.map((t) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ V(r, {
575
574
  to: "/$workspace/knowledge/$term",
576
575
  params: {
577
576
  workspace: e,
578
577
  term: n(t.id)
579
578
  },
580
579
  className: "inline-flex items-center gap-1 hover:underline",
581
- children: [/* @__PURE__ */ H(C, { className: "size-3.5 text-muted-foreground" }), t.name]
580
+ children: [/* @__PURE__ */ B(C, { className: "size-3.5 text-muted-foreground" }), t.name]
582
581
  }) }, t.id))]
583
582
  }))
584
583
  });
585
584
  }
586
- function q() {
587
- let e = B("agentWork");
585
+ function K() {
586
+ let e = R("agentWork");
588
587
  return (t, n) => t.merge ? e(n.id === "merge" ? "mergeApprove" : "mergeWait") : t.release ? e(n.id === "release" ? "releaseApprove" : "releaseWait") : t.breakdown?.length ? e(n.id === "approve" ? "breakdownApprove" : "breakdownRevise") : n.label;
589
588
  }
590
- function Ee({ decision: e, className: t }) {
591
- let n = B("agentWork"), r = e.merge, i = e.release;
592
- return i ? /* @__PURE__ */ U("p", {
593
- className: K("text-sm", t),
589
+ function we({ decision: e, className: t }) {
590
+ let n = R("agentWork"), r = e.merge, i = e.release;
591
+ return i ? /* @__PURE__ */ V("p", {
592
+ className: G("text-sm", t),
594
593
  children: [n.rich("releasePrompt", {
595
594
  repository: i.repository,
596
595
  sha: i.sha.slice(0, 7),
597
596
  targets: i.targets.join(", "),
598
- code: (e) => /* @__PURE__ */ H("code", {
597
+ code: (e) => /* @__PURE__ */ B("code", {
599
598
  className: "rounded bg-muted px-1 font-mono text-xs",
600
599
  children: e
601
600
  })
602
- }), i.deploymentId && /* @__PURE__ */ H("span", {
601
+ }), i.deploymentId && /* @__PURE__ */ B("span", {
603
602
  className: "mt-1 block text-xs text-muted-foreground",
604
- children: i.deploymentUrl ? /* @__PURE__ */ H("a", {
603
+ children: i.deploymentUrl ? /* @__PURE__ */ B("a", {
605
604
  href: v(i.deploymentUrl),
606
605
  target: "_blank",
607
606
  rel: "noopener noreferrer",
@@ -609,11 +608,11 @@ function Ee({ decision: e, className: t }) {
609
608
  children: n("deployment", { id: i.deploymentId })
610
609
  }) : n("deployment", { id: i.deploymentId })
611
610
  })]
612
- }) : r ? /* @__PURE__ */ H("p", {
613
- className: K("text-sm", t),
611
+ }) : r ? /* @__PURE__ */ B("p", {
612
+ className: G("text-sm", t),
614
613
  children: n.rich("mergePrompt", {
615
614
  sha: r.sha.slice(0, 7),
616
- pr: () => /* @__PURE__ */ U("a", {
615
+ pr: () => /* @__PURE__ */ V("a", {
617
616
  href: v(r.url),
618
617
  target: "_blank",
619
618
  rel: "noopener noreferrer",
@@ -624,27 +623,27 @@ function Ee({ decision: e, className: t }) {
624
623
  r.number
625
624
  ]
626
625
  }),
627
- code: (e) => /* @__PURE__ */ H("code", {
626
+ code: (e) => /* @__PURE__ */ B("code", {
628
627
  className: "rounded bg-muted px-1 font-mono text-xs",
629
628
  children: e
630
629
  })
631
630
  })
632
- }) : /* @__PURE__ */ H(k, {
631
+ }) : /* @__PURE__ */ B(E, {
633
632
  value: e.prompt,
634
633
  editable: !1,
635
634
  ...t && { className: t }
636
635
  });
637
636
  }
638
- function J({ workspace: e, decision: t }) {
639
- let n = B("agentWork");
640
- return t.subIssues.length > 0 ? /* @__PURE__ */ U("div", {
637
+ function Te({ workspace: e, decision: t }) {
638
+ let n = R("agentWork");
639
+ return t.subIssues.length > 0 ? /* @__PURE__ */ V("div", {
641
640
  className: "mt-2 text-sm",
642
- children: [/* @__PURE__ */ H("p", {
641
+ children: [/* @__PURE__ */ B("p", {
643
642
  className: "text-xs text-muted-foreground",
644
643
  children: n("subIssuesCreated")
645
- }), /* @__PURE__ */ H("ul", {
644
+ }), /* @__PURE__ */ B("ul", {
646
645
  className: "mt-1 space-y-0.5",
647
- children: t.subIssues.map((t) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ U(r, {
646
+ children: t.subIssues.map((t) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ V(r, {
648
647
  to: "/$workspace/issues/$identifier",
649
648
  params: {
650
649
  workspace: e,
@@ -652,7 +651,7 @@ function J({ workspace: e, decision: t }) {
652
651
  },
653
652
  className: "hover:underline",
654
653
  children: [
655
- /* @__PURE__ */ H("span", {
654
+ /* @__PURE__ */ B("span", {
656
655
  className: "text-muted-foreground",
657
656
  children: t.identifier
658
657
  }),
@@ -661,19 +660,19 @@ function J({ workspace: e, decision: t }) {
661
660
  ]
662
661
  }) }, t.id))
663
662
  })]
664
- }) : t.breakdown?.length ? /* @__PURE__ */ H("ol", {
663
+ }) : t.breakdown?.length ? /* @__PURE__ */ B("ol", {
665
664
  className: "mt-2 divide-y divide-border rounded-md border border-border text-sm",
666
- children: t.breakdown.map((e, t) => /* @__PURE__ */ U("li", {
665
+ children: t.breakdown.map((e, t) => /* @__PURE__ */ V("li", {
667
666
  className: "flex gap-2 px-3 py-2",
668
- children: [/* @__PURE__ */ H("span", {
667
+ children: [/* @__PURE__ */ B("span", {
669
668
  className: "w-4 shrink-0 text-right text-xs text-muted-foreground tabular-nums",
670
669
  children: t + 1
671
- }), /* @__PURE__ */ U("span", {
670
+ }), /* @__PURE__ */ V("span", {
672
671
  className: "min-w-0",
673
- children: [/* @__PURE__ */ H("span", {
672
+ children: [/* @__PURE__ */ B("span", {
674
673
  className: "font-medium",
675
674
  children: e.title
676
- }), e.body && /* @__PURE__ */ H("span", {
675
+ }), e.body && /* @__PURE__ */ B("span", {
677
676
  className: "mt-0.5 block text-xs text-muted-foreground",
678
677
  children: e.body
679
678
  })]
@@ -681,22 +680,22 @@ function J({ workspace: e, decision: t }) {
681
680
  }, t))
682
681
  }) : null;
683
682
  }
684
- function De({ workspace: e, decision: t, onAnswer: n, busy: r }) {
685
- let i = B("agentPage"), a = q(), { data: s = [] } = W(o(e, t.identifier)), [c, l] = z(null), u = L((e) => {
683
+ function q({ workspace: e, decision: t, onAnswer: n, busy: r }) {
684
+ let i = R("agentPage"), a = K(), { data: s = [] } = H(o(e, t.identifier)), [c, l] = I(null), u = N((e) => {
686
685
  t.options.some((t) => t.id === e) && l(e);
687
686
  }, [t.options]), d = s.find((e) => e.id === t.pageId), f = t.options.find((e) => e.id === c);
688
- return /* @__PURE__ */ U("div", {
687
+ return /* @__PURE__ */ V("div", {
689
688
  className: "mt-3 space-y-2",
690
- children: [/* @__PURE__ */ H(O, {
689
+ children: [/* @__PURE__ */ B(ie, {
691
690
  attachmentId: t.pageId ?? "",
692
691
  name: d?.name ?? "",
693
692
  agent: t.agentName,
694
693
  onChoose: u
695
- }), f && /* @__PURE__ */ U("div", {
694
+ }), f && /* @__PURE__ */ V("div", {
696
695
  className: "flex flex-wrap items-center gap-2 rounded-md border border-agent/50 bg-agent-soft/40 px-3 py-2 text-sm",
697
696
  children: [
698
- /* @__PURE__ */ H("span", { children: i("chose", { option: a(t, f) }) }),
699
- /* @__PURE__ */ H(A, {
697
+ /* @__PURE__ */ B("span", { children: i("chose", { option: a(t, f) }) }),
698
+ /* @__PURE__ */ B(D, {
700
699
  variant: "primary",
701
700
  size: "sm",
702
701
  disabled: r,
@@ -704,7 +703,7 @@ function De({ workspace: e, decision: t, onAnswer: n, busy: r }) {
704
703
  className: "ml-auto",
705
704
  children: i("answerWith")
706
705
  }),
707
- /* @__PURE__ */ H(A, {
706
+ /* @__PURE__ */ B(D, {
708
707
  size: "sm",
709
708
  onClick: () => l(null),
710
709
  children: i("dismiss")
@@ -713,8 +712,8 @@ function De({ workspace: e, decision: t, onAnswer: n, busy: r }) {
713
712
  })]
714
713
  });
715
714
  }
716
- function Y(e) {
717
- let t = B("agentWork"), n = q(), r = E(), { workspace: i } = I({ strict: !1 });
715
+ function Ee(e) {
716
+ let t = R("agentWork"), n = K(), r = te(), { workspace: i } = M({ strict: !1 });
718
717
  if (i !== e.workspace) return [];
719
718
  let a = e.options.find((t) => t.id === e.answer?.optionId), o = [a && n(e, a), e.answer?.text].filter(Boolean).join(". "), s = e.prompt.split("\n").map((e) => `> ${e}`).join("\n");
720
719
  return [{
@@ -727,23 +726,23 @@ function Y(e) {
727
726
  })
728
727
  }];
729
728
  }
730
- function X(e) {
729
+ function J(e) {
731
730
  return e.merge || e.release || !e.options.some((e) => e.id === "allow") ? null : m(e.prompt);
732
731
  }
733
- var Z = (e) => ({
732
+ var Y = (e) => ({
734
733
  allow: 0,
735
734
  "allow-run": 1,
736
735
  deny: 2
737
736
  })[e] ?? 1;
738
- function Q() {
739
- let e = B("agentWork");
740
- return /* @__PURE__ */ H("span", {
737
+ function X() {
738
+ let e = R("agentWork");
739
+ return /* @__PURE__ */ B("span", {
741
740
  className: "rounded bg-agent-soft px-1.5 text-[10px] font-medium text-agent",
742
741
  children: e("suggested")
743
742
  });
744
743
  }
745
- function $({ workspace: r, decision: a, showIssue: o = !1 }) {
746
- let s = fe(), c = B("agentWork"), l = q(), u = g(), d = he(), f = B("common"), [p, m] = z(""), [h, ee] = z(0), [_, v] = z(!1), y = X(a), b = !y && a.options.some((e) => e.description), x = y ? [...a.options].sort((e, t) => Z(e.id) - Z(t.id)) : a.options, S = me({
744
+ function Z({ workspace: r, decision: a, showIssue: o = !1 }) {
745
+ let s = fe(), c = R("agentWork"), l = K(), u = g(), d = me(), f = R("common"), [p, m] = I(""), [h, _] = I(0), [v, y] = I(!1), b = J(a), x = !b && a.options.some((e) => e.description), S = b ? [...a.options].sort((e, t) => Y(e.id) - Y(t.id)) : a.options, C = pe({
747
746
  mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/decisions/{decisionId}/answer", {
748
747
  params: { path: {
749
748
  workspace: r,
@@ -755,7 +754,7 @@ function $({ workspace: r, decision: a, showIssue: o = !1 }) {
755
754
  }
756
755
  })),
757
756
  onSuccess: () => {
758
- m(""), v(!1), ee((e) => e + 1), d.invalidateQueries({ queryKey: [
757
+ m(""), y(!1), _((e) => e + 1), d.invalidateQueries({ queryKey: [
759
758
  "workspace",
760
759
  r,
761
760
  "decisions"
@@ -766,14 +765,14 @@ function $({ workspace: r, decision: a, showIssue: o = !1 }) {
766
765
  a.identifier.toUpperCase()
767
766
  ] });
768
767
  }
769
- }), C = le(), w = i(), te = Y(a), T = () => [
768
+ }), ee = de(), w = i(), te = Ee(a), ne = () => [
770
769
  ...a.options.length > 0 ? [{
771
770
  label: c("answer"),
772
771
  items: a.options.map((e) => ({
773
772
  label: e.id === a.recommendation ? c("suggestedOption", { option: l(a, e) }) : l(a, e),
774
- onClick: () => S.mutate(e.id)
773
+ onClick: () => C.mutate(e.id)
775
774
  }))
776
- }, ce] : [],
775
+ }, ue] : [],
777
776
  {
778
777
  label: c("openIssue"),
779
778
  onClick: () => w({
@@ -787,182 +786,182 @@ function $({ workspace: r, decision: a, showIssue: o = !1 }) {
787
786
  ...te,
788
787
  ...u(n(r, a.identifier))
789
788
  ];
790
- return /* @__PURE__ */ U(oe, {
789
+ return /* @__PURE__ */ V(se, {
791
790
  size: "fill",
792
791
  padding: "none",
793
- tone: _e,
792
+ tone: ge,
794
793
  interactive: !1,
795
- render: /* @__PURE__ */ H("article", {
794
+ render: /* @__PURE__ */ B("article", {
796
795
  onContextMenu: (e) => {
797
- e.target.closest(".ProseMirror[contenteditable=\"true\"]") || C(e, T());
796
+ e.target.closest(".ProseMirror[contenteditable=\"true\"]") || ee(e, ne());
798
797
  },
799
798
  "aria-label": c("asking", { agent: a.agentName })
800
799
  }),
801
- children: [/* @__PURE__ */ U("header", {
800
+ children: [/* @__PURE__ */ V("header", {
802
801
  className: "flex items-center gap-2 border-b border-border px-3 py-2 text-xs",
803
802
  children: [
804
- /* @__PURE__ */ H(ae, {
803
+ /* @__PURE__ */ B(oe, {
805
804
  kind: "agent",
806
805
  name: a.agentName,
807
806
  size: "xs",
808
807
  decorative: !0
809
808
  }),
810
- /* @__PURE__ */ H("span", {
809
+ /* @__PURE__ */ B("span", {
811
810
  className: "font-medium",
812
811
  children: a.agentName
813
812
  }),
814
- /* @__PURE__ */ H("span", {
813
+ /* @__PURE__ */ B("span", {
815
814
  className: `shrink-0 text-muted-foreground ${o ? "max-sm:hidden" : ""}`,
816
815
  children: c("needsDecision")
817
816
  }),
818
- o && /* @__PURE__ */ H("span", {
817
+ o && /* @__PURE__ */ B("span", {
819
818
  className: "min-w-0 truncate text-muted-foreground",
820
819
  children: c("onIssue", {
821
820
  identifier: a.identifier,
822
821
  title: a.issueTitle
823
822
  })
824
823
  }),
825
- /* @__PURE__ */ H(P, {
824
+ /* @__PURE__ */ B(j, {
826
825
  value: a.createdAt,
827
826
  exact: "medium",
828
827
  className: "ml-auto shrink-0 whitespace-nowrap text-muted-foreground"
829
828
  })
830
829
  ]
831
- }), /* @__PURE__ */ U("div", {
830
+ }), /* @__PURE__ */ V("div", {
832
831
  className: "px-3 py-2.5",
833
832
  children: [
834
- y ? /* @__PURE__ */ U("div", { children: [
835
- /* @__PURE__ */ H("p", {
833
+ b ? /* @__PURE__ */ V("div", { children: [
834
+ /* @__PURE__ */ B("p", {
836
835
  className: "text-sm font-medium",
837
- children: y.agent ? c("approveCommandFor", { agent: y.agent }) : c("approveCommand")
836
+ children: b.agent ? c("approveCommandFor", { agent: b.agent }) : c("approveCommand")
838
837
  }),
839
- /* @__PURE__ */ H(j, {
840
- text: y.command,
838
+ /* @__PURE__ */ B(O, {
839
+ text: b.command,
841
840
  label: c("command"),
842
841
  wrap: !0,
843
842
  className: "mt-2 [&_pre]:px-3 [&_pre]:py-2 [&_pre]:pr-10 [&_pre]:text-xs [&_pre]:leading-5"
844
843
  }),
845
- y.reason && /* @__PURE__ */ H("p", {
844
+ b.reason && /* @__PURE__ */ B("p", {
846
845
  className: "mt-1.5 text-xs text-muted-foreground",
847
- children: y.reason
846
+ children: b.reason
848
847
  })
849
- ] }) : /* @__PURE__ */ H("div", {
848
+ ] }) : /* @__PURE__ */ B("div", {
850
849
  className: "[&_.ProseMirror>:first-child]:mt-0",
851
- children: /* @__PURE__ */ H(Ee, { decision: a })
850
+ children: /* @__PURE__ */ B(we, { decision: a })
852
851
  }),
853
- /* @__PURE__ */ H(Oe, {
852
+ /* @__PURE__ */ B(Q, {
854
853
  workspace: r,
855
854
  decision: a
856
855
  }),
857
- a.pageId && /* @__PURE__ */ H(De, {
856
+ a.pageId && /* @__PURE__ */ B(q, {
858
857
  workspace: r,
859
858
  decision: a,
860
- onAnswer: (e) => S.mutate(e),
861
- busy: S.isPending
859
+ onAnswer: (e) => C.mutate(e),
860
+ busy: C.isPending
862
861
  }),
863
- /* @__PURE__ */ H(J, {
862
+ /* @__PURE__ */ B(Te, {
864
863
  workspace: r,
865
864
  decision: a
866
865
  }),
867
- a.options.length > 0 && (b ? /* @__PURE__ */ H("div", {
866
+ a.options.length > 0 && (x ? /* @__PURE__ */ B("div", {
868
867
  className: "mt-3 grid gap-1.5 sm:grid-cols-2",
869
868
  children: a.options.map((e) => {
870
869
  let t = e.id === a.recommendation;
871
- return /* @__PURE__ */ U("button", {
870
+ return /* @__PURE__ */ V("button", {
872
871
  type: "button",
873
- disabled: S.isPending,
874
- onClick: () => S.mutate(e.id),
872
+ disabled: C.isPending,
873
+ onClick: () => C.mutate(e.id),
875
874
  className: `rounded-md border px-3 py-2 text-left text-sm hover:bg-muted disabled:opacity-50 ${t ? "border-agent" : "border-border"}`,
876
- children: [/* @__PURE__ */ U("span", {
875
+ children: [/* @__PURE__ */ V("span", {
877
876
  className: "flex items-center gap-2 font-medium",
878
- children: [l(a, e), t && /* @__PURE__ */ H(Q, {})]
879
- }), e.description && /* @__PURE__ */ H("span", {
877
+ children: [l(a, e), t && /* @__PURE__ */ B(X, {})]
878
+ }), e.description && /* @__PURE__ */ B("span", {
880
879
  className: "mt-0.5 block text-xs text-muted-foreground",
881
880
  children: e.description
882
881
  })]
883
882
  }, e.id);
884
883
  })
885
- }) : /* @__PURE__ */ U("div", {
884
+ }) : /* @__PURE__ */ V("div", {
886
885
  className: "mt-3 flex flex-wrap items-center gap-2",
887
- children: [x.map((e, t) => {
888
- let n = e.id === a.recommendation, r = /* @__PURE__ */ U(A, {
886
+ children: [S.map((e, t) => {
887
+ let n = e.id === a.recommendation, r = /* @__PURE__ */ V(D, {
889
888
  size: "sm",
890
- variant: y && t === 0 ? "primary" : "secondary",
891
- disabled: S.isPending,
892
- onClick: () => S.mutate(e.id),
893
- className: n && !(y && t === 0) ? "border-agent" : void 0,
894
- children: [l(a, e), n && /* @__PURE__ */ H(Q, {})]
889
+ variant: b && t === 0 ? "primary" : "secondary",
890
+ disabled: C.isPending,
891
+ onClick: () => C.mutate(e.id),
892
+ className: n && !(b && t === 0) ? "border-agent" : void 0,
893
+ children: [l(a, e), n && /* @__PURE__ */ B(X, {})]
895
894
  }, e.id);
896
- return e.description ? /* @__PURE__ */ H(F, {
895
+ return e.description ? /* @__PURE__ */ B(le, {
897
896
  content: e.description,
898
897
  children: r
899
898
  }, e.id) : r;
900
- }), a.allowText && !_ && /* @__PURE__ */ H("button", {
899
+ }), a.allowText && !v && /* @__PURE__ */ B("button", {
901
900
  type: "button",
902
- onClick: () => v(!0),
901
+ onClick: () => y(!0),
903
902
  className: "ml-1 text-xs text-muted-foreground hover:text-foreground",
904
903
  children: c("answerOwnWordsShort")
905
904
  })]
906
905
  })),
907
- a.allowText && (_ || a.options.length === 0 || b) && /* @__PURE__ */ U("div", {
906
+ a.allowText && (v || a.options.length === 0 || x) && /* @__PURE__ */ V("div", {
908
907
  className: "mt-3 rounded-md border border-border px-2.5 py-1.5 focus-within:border-primary/60",
909
- children: [/* @__PURE__ */ H(k, {
908
+ children: [/* @__PURE__ */ B(E, {
910
909
  value: "",
911
910
  onChange: m,
912
- onSubmit: () => p.trim() && S.mutate(void 0),
911
+ onSubmit: () => p.trim() && C.mutate(void 0),
913
912
  placeholder: a.options.length ? c("answerOwnWords") : c("answerPlaceholder"),
914
913
  label: c("answer"),
915
914
  className: "min-h-8",
916
- autofocus: _
917
- }, h), /* @__PURE__ */ U("div", {
915
+ autofocus: v
916
+ }, h), /* @__PURE__ */ V("div", {
918
917
  className: "flex justify-end gap-2",
919
- children: [_ && !b && /* @__PURE__ */ H(A, {
918
+ children: [v && !x && /* @__PURE__ */ B(D, {
920
919
  size: "sm",
921
920
  variant: "ghost",
922
- onClick: () => v(!1),
921
+ onClick: () => y(!1),
923
922
  children: f("cancel")
924
- }), /* @__PURE__ */ H(A, {
923
+ }), /* @__PURE__ */ B(D, {
925
924
  variant: "primary",
926
925
  size: "sm",
927
926
  disabled: !p.trim(),
928
- loading: S.isPending,
929
- onClick: () => S.mutate(void 0),
927
+ loading: C.isPending,
928
+ onClick: () => C.mutate(void 0),
930
929
  children: c("answer")
931
930
  })]
932
931
  })]
933
932
  }),
934
- S.isError && /* @__PURE__ */ H(se, {
933
+ C.isError && /* @__PURE__ */ B(ce, {
935
934
  className: "mt-2",
936
- children: s(S.error)
935
+ children: s(C.error)
937
936
  })
938
937
  ]
939
938
  })]
940
939
  });
941
940
  }
942
- function Oe({ workspace: e, decision: t }) {
943
- let n = B("agentWork"), { area: i, doc: a, section: o, cites: s, checked: c, context: l, unknownTerms: u } = t;
944
- return /* @__PURE__ */ U(V, { children: [
945
- l && /* @__PURE__ */ H("p", {
941
+ function Q({ workspace: e, decision: t }) {
942
+ let n = R("agentWork"), { area: i, doc: a, section: o, cites: s, checked: c, context: l, unknownTerms: u } = t;
943
+ return /* @__PURE__ */ V(z, { children: [
944
+ l && /* @__PURE__ */ B("p", {
946
945
  className: "mt-1.5 text-sm text-muted-foreground",
947
946
  children: l
948
947
  }),
949
- u.length > 0 && /* @__PURE__ */ H("p", {
948
+ u.length > 0 && /* @__PURE__ */ B("p", {
950
949
  className: "mt-2 text-xs text-warning",
951
950
  children: n("unknownTerms", { names: u.join(", ") })
952
951
  }),
953
- (i || a) && /* @__PURE__ */ U("p", {
952
+ (i || a) && /* @__PURE__ */ V("p", {
954
953
  className: "mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",
955
- children: [i && /* @__PURE__ */ U("span", {
954
+ children: [i && /* @__PURE__ */ V("span", {
956
955
  className: "flex items-center gap-1",
957
- children: [/* @__PURE__ */ H(b, { className: "size-3.5" }), i.title]
958
- }), a && /* @__PURE__ */ U(r, {
956
+ children: [/* @__PURE__ */ B(b, { className: "size-3.5" }), i.title]
957
+ }), a && /* @__PURE__ */ V(r, {
959
958
  to: "/$workspace/docs/$doc",
960
959
  params: {
961
960
  workspace: e,
962
961
  doc: _(a)
963
962
  },
964
963
  className: "flex min-w-0 items-center gap-1 hover:text-foreground",
965
- children: [/* @__PURE__ */ H(S, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ H("span", {
964
+ children: [/* @__PURE__ */ B(S, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ B("span", {
966
965
  className: "truncate",
967
966
  children: o ? n("docSection", {
968
967
  doc: a.title,
@@ -971,16 +970,16 @@ function Oe({ workspace: e, decision: t }) {
971
970
  })]
972
971
  })]
973
972
  }),
974
- s.length > 0 && /* @__PURE__ */ U("div", {
973
+ s.length > 0 && /* @__PURE__ */ V("div", {
975
974
  className: "mt-2 text-xs",
976
- children: [/* @__PURE__ */ H("p", {
975
+ children: [/* @__PURE__ */ B("p", {
977
976
  className: "text-muted-foreground",
978
977
  children: n("buildsOn")
979
- }), /* @__PURE__ */ H("ul", {
978
+ }), /* @__PURE__ */ B("ul", {
980
979
  className: "mt-1 space-y-0.5",
981
- children: s.map((t) => /* @__PURE__ */ U("li", {
980
+ children: s.map((t) => /* @__PURE__ */ V("li", {
982
981
  className: "flex min-w-0 gap-1.5",
983
- children: [/* @__PURE__ */ H(r, {
982
+ children: [/* @__PURE__ */ B(r, {
984
983
  to: "/$workspace/issues/$identifier",
985
984
  params: {
986
985
  workspace: e,
@@ -988,20 +987,20 @@ function Oe({ workspace: e, decision: t }) {
988
987
  },
989
988
  className: "shrink-0 text-muted-foreground hover:text-foreground",
990
989
  children: t.identifier
991
- }), /* @__PURE__ */ H("span", {
990
+ }), /* @__PURE__ */ B("span", {
992
991
  className: "truncate",
993
992
  children: t.prompt
994
993
  })]
995
994
  }, t.id))
996
995
  })]
997
996
  }),
998
- c && /* @__PURE__ */ H(M, {
997
+ c && /* @__PURE__ */ B(k, {
999
998
  className: "mt-2 text-xs",
1000
999
  summaryClassName: "text-muted-foreground hover:text-foreground",
1001
1000
  summary: n("checked"),
1002
- children: /* @__PURE__ */ H("div", {
1001
+ children: /* @__PURE__ */ B("div", {
1003
1002
  className: "mt-1 text-sm",
1004
- children: /* @__PURE__ */ H(k, {
1003
+ children: /* @__PURE__ */ B(E, {
1005
1004
  value: c,
1006
1005
  editable: !1
1007
1006
  })
@@ -1009,7 +1008,7 @@ function Oe({ workspace: e, decision: t }) {
1009
1008
  })
1010
1009
  ] });
1011
1010
  }
1012
- function ke(e) {
1011
+ function $(e) {
1013
1012
  let t = /```[^\n]*\n([^\n]*)/.exec(e);
1014
1013
  return t?.[1] ? {
1015
1014
  text: t[1],
@@ -1019,43 +1018,43 @@ function ke(e) {
1019
1018
  code: !1
1020
1019
  };
1021
1020
  }
1022
- function Ae({ workspace: e, decisions: t }) {
1023
- let n = B("agentWork"), r = D(), i = q();
1024
- return /* @__PURE__ */ H(M, {
1021
+ function De({ workspace: e, decisions: t }) {
1022
+ let n = R("agentWork"), r = T(), i = K();
1023
+ return /* @__PURE__ */ B(k, {
1025
1024
  defaultOpen: !0,
1026
1025
  className: "rounded-lg border border-border text-sm",
1027
1026
  summaryClassName: "px-3 py-2 text-xs font-medium text-muted-foreground hover:text-foreground",
1028
1027
  summary: n("answeredCount", { count: t.length }),
1029
- children: /* @__PURE__ */ H("ul", {
1028
+ children: /* @__PURE__ */ B("ul", {
1030
1029
  className: "divide-y divide-border border-t border-border",
1031
1030
  children: t.map((t) => {
1032
1031
  let a = t.options.find((e) => e.id === t.answer?.optionId), o = a && i(t, a) || t.answer?.text || "", s = t.merge || t.release ? {
1033
1032
  text: n("answeredLabel"),
1034
1033
  code: !1
1035
- } : ke(t.prompt);
1036
- return /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(M, {
1034
+ } : $(t.prompt);
1035
+ return /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(k, {
1037
1036
  summaryClassName: "w-full min-w-0 px-3 py-2 hover:bg-muted/50",
1038
- summary: /* @__PURE__ */ U("span", {
1037
+ summary: /* @__PURE__ */ V("span", {
1039
1038
  className: "flex min-w-0 flex-1 items-center gap-2",
1040
1039
  children: [
1041
- /* @__PURE__ */ H("span", {
1040
+ /* @__PURE__ */ B("span", {
1042
1041
  className: "shrink-0 font-medium",
1043
1042
  children: o
1044
1043
  }),
1045
- /* @__PURE__ */ H("span", {
1046
- className: K("min-w-0 flex-1 truncate text-muted-foreground", s.code && "font-mono text-xs"),
1044
+ /* @__PURE__ */ B("span", {
1045
+ className: G("min-w-0 flex-1 truncate text-muted-foreground", s.code && "font-mono text-xs"),
1047
1046
  children: s.text
1048
1047
  }),
1049
- t.answer && /* @__PURE__ */ H("time", {
1048
+ t.answer && /* @__PURE__ */ B("time", {
1050
1049
  dateTime: t.answer.at,
1051
1050
  className: "shrink-0 text-xs text-muted-foreground",
1052
1051
  children: r.relative(t.answer.at)
1053
1052
  })
1054
1053
  ]
1055
1054
  }),
1056
- children: /* @__PURE__ */ H("div", {
1055
+ children: /* @__PURE__ */ B("div", {
1057
1056
  className: "px-3 pb-3 pl-8",
1058
- children: /* @__PURE__ */ H(je, {
1057
+ children: /* @__PURE__ */ B(Oe, {
1059
1058
  workspace: e,
1060
1059
  decision: t,
1061
1060
  bare: !0
@@ -1066,102 +1065,65 @@ function Ae({ workspace: e, decisions: t }) {
1066
1065
  })
1067
1066
  });
1068
1067
  }
1069
- function je({ workspace: e, decision: t, showIssue: a = !1, showWorkspace: o = !1, bare: s = !1 }) {
1070
- let c = T(e), l = B("agentWork"), u = D(), { person: d } = ne(e), f = le(), p = g(), m = i(), [ee, _] = z(!1), v = q(), y = t.options.find((e) => e.id === t.answer?.optionId), b = [y && v(t, y), t.answer?.text].filter(Boolean).join(". "), x = !!t.breakdown?.length || !!t.merge || !!t.release, S = () => _(!0), C = Y(t), w = (r) => f(r, [
1071
- ...x ? [] : [t.savedAs ? {
1072
- label: l("savedAsDecision"),
1073
- onClick: () => m({
1074
- to: "/$workspace/knowledge/$term",
1075
- params: {
1076
- workspace: e,
1077
- term: c(t.savedAs ?? "")
1078
- }
1079
- })
1080
- } : {
1081
- label: l("saveAsDecision"),
1082
- onClick: S
1083
- }],
1084
- ...C,
1085
- ce,
1086
- ...p(n(e, t.identifier))
1087
- ]), E = /* @__PURE__ */ U(V, { children: [
1088
- /* @__PURE__ */ U("p", {
1068
+ function Oe({ workspace: e, decision: t, showIssue: r = !1, showWorkspace: i = !1, bare: a = !1 }) {
1069
+ let o = R("agentWork"), s = T(), { person: c } = ne(e), l = de(), u = g(), d = K(), f = t.options.find((e) => e.id === t.answer?.optionId), p = [f && d(t, f), t.answer?.text].filter(Boolean).join(". "), m = Ee(t), h = (r) => l(r, [
1070
+ ...m,
1071
+ ue,
1072
+ ...u(n(e, t.identifier))
1073
+ ]), _ = /* @__PURE__ */ V(z, { children: [
1074
+ /* @__PURE__ */ V("p", {
1089
1075
  className: "flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground",
1090
1076
  children: [
1091
- o && /* @__PURE__ */ H("span", {
1077
+ i && /* @__PURE__ */ B("span", {
1092
1078
  className: "rounded bg-muted px-1.5 py-0.5 font-medium text-foreground",
1093
1079
  children: t.workspaceName
1094
1080
  }),
1095
- a && /* @__PURE__ */ H("span", {
1081
+ r && /* @__PURE__ */ B("span", {
1096
1082
  className: "font-medium text-foreground",
1097
1083
  children: t.identifier
1098
1084
  }),
1099
- /* @__PURE__ */ H("span", { children: l("askedBy", { agent: t.agentName }) }),
1100
- t.answer && /* @__PURE__ */ H(F, {
1101
- content: u.full(t.answer.at),
1102
- children: /* @__PURE__ */ H("time", {
1085
+ /* @__PURE__ */ B("span", { children: o("askedBy", { agent: t.agentName }) }),
1086
+ t.answer && /* @__PURE__ */ B(le, {
1087
+ content: s.full(t.answer.at),
1088
+ children: /* @__PURE__ */ B("time", {
1103
1089
  dateTime: t.answer.at,
1104
- children: l("answeredBy", {
1105
- name: d(t.answer.by ?? "").name,
1106
- time: u.relative(t.answer.at)
1090
+ children: o("answeredBy", {
1091
+ name: c(t.answer.by ?? "").name,
1092
+ time: s.relative(t.answer.at)
1107
1093
  })
1108
1094
  })
1109
1095
  })
1110
1096
  ]
1111
1097
  }),
1112
- /* @__PURE__ */ H("div", {
1098
+ /* @__PURE__ */ B("div", {
1113
1099
  className: "mt-1.5",
1114
- children: /* @__PURE__ */ H(Ee, {
1100
+ children: /* @__PURE__ */ B(we, {
1115
1101
  decision: t,
1116
1102
  className: "text-sm"
1117
1103
  })
1118
1104
  }),
1119
- /* @__PURE__ */ H("p", {
1105
+ /* @__PURE__ */ B("p", {
1120
1106
  className: "mt-1 font-medium",
1121
- children: b
1107
+ children: p
1122
1108
  }),
1123
- /* @__PURE__ */ H(J, {
1109
+ /* @__PURE__ */ B(Te, {
1124
1110
  workspace: e,
1125
1111
  decision: t
1126
- }),
1127
- /* @__PURE__ */ H("div", {
1128
- className: x ? "hidden" : "mt-2",
1129
- children: t.savedAs ? /* @__PURE__ */ H(r, {
1130
- to: "/$workspace/knowledge/$term",
1131
- params: {
1132
- workspace: e,
1133
- term: c(t.savedAs)
1134
- },
1135
- className: "text-xs text-primary hover:underline",
1136
- children: l("savedAsDecision")
1137
- }) : /* @__PURE__ */ H(A, {
1138
- size: "sm",
1139
- onClick: S,
1140
- children: l("saveAsDecision")
1141
- })
1142
- }),
1143
- ee && /* @__PURE__ */ H(ue, { children: /* @__PURE__ */ H(te, {
1144
- workspace: e,
1145
- mode: {
1146
- kind: "create",
1147
- defaults: h(t, (e) => l("decisionDefinition", e))
1148
- },
1149
- onClose: () => _(!1)
1150
- }) })
1112
+ })
1151
1113
  ] });
1152
- return s ? /* @__PURE__ */ H("article", {
1153
- onContextMenu: w,
1154
- "aria-label": l("answeredLabel"),
1114
+ return a ? /* @__PURE__ */ B("article", {
1115
+ onContextMenu: h,
1116
+ "aria-label": o("answeredLabel"),
1155
1117
  className: "text-sm",
1156
- children: E
1157
- }) : /* @__PURE__ */ H(oe, {
1118
+ children: _
1119
+ }) : /* @__PURE__ */ B(se, {
1158
1120
  size: "fill",
1159
1121
  className: "text-sm",
1160
- render: /* @__PURE__ */ H("article", {
1161
- onContextMenu: w,
1162
- "aria-label": l("answeredLabel")
1122
+ render: /* @__PURE__ */ B("article", {
1123
+ onContextMenu: h,
1124
+ "aria-label": o("answeredLabel")
1163
1125
  }),
1164
- children: E
1126
+ children: _
1165
1127
  });
1166
1128
  }
1167
- export { ye as AgentWork, je as AnsweredDecision, $ as DecisionCard, ve as useMoney, q as useOptionLabel };
1129
+ export { ve as AgentWork, Oe as AnsweredDecision, Z as DecisionCard, _e as useMoney, K as useOptionLabel };