@parallelworks/tandem-web 0.171.1 → 0.171.2

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