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