@parallelworks/tandem-web 0.150.2 → 0.151.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.
Files changed (110) hide show
  1. package/_virtual/_virtual_i18n/en/common.js +32 -3
  2. package/_virtual/_virtual_i18n/es/common.js +32 -3
  3. package/_virtual/_virtual_i18n/ja/common.js +32 -3
  4. package/_virtual/_virtual_i18n/ko/common.js +32 -3
  5. package/_virtual/_virtual_i18n/zh/common.js +32 -3
  6. package/api/queries.js +88 -77
  7. package/components/AccessGrants.js +6 -6
  8. package/components/ActivityTimeline.js +4 -4
  9. package/components/AgentWork.js +111 -111
  10. package/components/AreaLink.js +32 -0
  11. package/components/AreaTiles.js +10 -13
  12. package/components/AreaWork.js +25 -1
  13. package/components/BugRotation.js +3 -3
  14. package/components/CodeHostSettings.js +30 -30
  15. package/components/CommandPalette.js +53 -53
  16. package/components/CustomFields.js +116 -116
  17. package/components/DateChip.js +11 -11
  18. package/components/DocButton.js +6 -6
  19. package/components/DocHistory.js +4 -4
  20. package/components/DocLinkPicker.js +8 -8
  21. package/components/DocProperties.js +15 -15
  22. package/components/DocTable.js +15 -15
  23. package/components/DocsTree.js +80 -80
  24. package/components/Editor.js +35 -35
  25. package/components/FavoritesNav.js +53 -53
  26. package/components/GitHub.js +18 -18
  27. package/components/Graph.js +15 -15
  28. package/components/HostActions.js +21 -21
  29. package/components/HostPanel.js +6 -6
  30. package/components/HoverCards.js +38 -38
  31. package/components/IssueBoard.js +4 -4
  32. package/components/IssueCode.js +14 -14
  33. package/components/IssueEvent.js +3 -3
  34. package/components/IssueFilters.js +71 -71
  35. package/components/IssueListBlock.js +32 -32
  36. package/components/IssueRow.js +21 -21
  37. package/components/IssueTemplates.js +118 -118
  38. package/components/IssueTypes.js +40 -40
  39. package/components/NewIssueDialog.js +76 -76
  40. package/components/NewProjectDialog.js +145 -145
  41. package/components/PersonActivity.js +4 -4
  42. package/components/SharedViewer.js +5 -5
  43. package/components/SlashMenu.js +29 -29
  44. package/components/TeamRepositories.js +51 -51
  45. package/components/TeamWorkflow.js +6 -6
  46. package/components/UnlinkedMentions.js +20 -20
  47. package/components/Updates.js +3 -3
  48. package/components/Widgets.js +20 -20
  49. package/components/columns.js +17 -17
  50. package/components/editorPlugins.js +80 -80
  51. package/components/mathDiagrams.js +17 -17
  52. package/lib/boardMove.js +5 -5
  53. package/lib/issueList.js +58 -58
  54. package/lib/issueMenu.js +27 -27
  55. package/lib/knowledge.js +106 -106
  56. package/lib/views.js +9 -9
  57. package/package.json +2 -2
  58. package/pages/area.js +291 -0
  59. package/pages/areas.js +258 -287
  60. package/pages/decisions.js +21 -21
  61. package/pages/issues.js +52 -52
  62. package/pages/projects.js +125 -125
  63. package/pages/triage.js +12 -12
  64. package/routeTree.gen.js +186 -180
  65. package/routes/_workspace/agents/_slug2.js +11 -11
  66. package/routes/_workspace/agents/index2.js +10 -10
  67. package/routes/_workspace/areas/_area.js +7 -8
  68. package/routes/_workspace/areas/_area2.js +3 -290
  69. package/routes/_workspace/areas/_area3.js +7 -8
  70. package/routes/_workspace/docs/_doc2.js +230 -230
  71. package/routes/_workspace/docs/space2._space.js +27 -27
  72. package/routes/_workspace/issues/_identifier2.js +222 -224
  73. package/routes/_workspace/knowledge/_term2.js +43 -43
  74. package/routes/_workspace/knowledge/index.js +6 -6
  75. package/routes/_workspace/knowledge/index2.js +15 -15
  76. package/routes/_workspace/measures3.js +70 -72
  77. package/routes/_workspace/notifications2.js +150 -150
  78. package/routes/_workspace/people/_username2.js +10 -10
  79. package/routes/_workspace/projects/_projectId3.js +276 -276
  80. package/routes/_workspace/settings/audit-log3.js +136 -138
  81. package/routes/_workspace/settings/fields2.js +11 -11
  82. package/routes/_workspace/settings/github2.js +6 -6
  83. package/routes/_workspace/settings/groups2.js +26 -26
  84. package/routes/_workspace/settings/import2.js +398 -147
  85. package/routes/_workspace/settings/import3.js +7 -3
  86. package/routes/_workspace/settings/index2.js +6 -6
  87. package/routes/_workspace/settings/labels2.js +21 -21
  88. package/routes/_workspace/settings/members2.js +27 -27
  89. package/routes/_workspace/settings/notifications2.js +8 -8
  90. package/routes/_workspace/settings/parallelworks2.js +32 -32
  91. package/routes/_workspace/settings/roles2.js +24 -24
  92. package/routes/_workspace/settings/runners2.js +15 -15
  93. package/routes/_workspace/settings/sessions2.js +17 -17
  94. package/routes/_workspace/settings/slack2.js +7 -7
  95. package/routes/_workspace/settings/sso2.js +31 -31
  96. package/routes/_workspace/settings/teams2.js +25 -25
  97. package/routes/_workspace/settings/tokens2.js +12 -12
  98. package/routes/_workspace/settings/webhooks2.js +13 -13
  99. package/routes/_workspace/teams/_key/areas/_area.js +8 -0
  100. package/routes/_workspace/teams/_key/areas/_area2.js +4 -0
  101. package/routes/_workspace/teams/_key/areas/_area3.js +9 -0
  102. package/routes/_workspace/teams/_key/areas/index.js +6 -0
  103. package/routes/_workspace/teams/_key/areas/index2.js +4 -0
  104. package/routes/_workspace/teams/_key/{areas3.js → areas/index3.js} +2 -2
  105. package/routes/_workspace/teams/_key/cycles/_number2.js +27 -27
  106. package/routes/_workspace/teams/_key/cycles/index2.js +24 -24
  107. package/routes/_workspace/teams/_key/settings2.js +29 -29
  108. package/routes/_workspace2.js +368 -368
  109. package/routes/_workspace/teams/_key/areas.js +0 -6
  110. package/routes/_workspace/teams/_key/areas2.js +0 -4
@@ -1,7 +1,7 @@
1
1
  import { AddIcon as e, AddUserIcon as t, AgentIcon as n, ArchiveIcon as r, AreaIcon as i, AttachmentIcon as a, BranchIcon as o, CalendarIcon as s, CancelIcon as c, CommentIcon as l, CycleIcon as u, EditIcon as d, EstimateIcon as f, FileTextIcon as p, HistoryIcon as m, LibraryIcon as h, LinkIcon as g, MegaphoneIcon as _, PriorityIcon as v, ProjectIcon as y, PullRequestIcon as b, ReleaseIcon as x, RemoveUserIcon as S, RenameIcon as C, RestoreIcon as w, SettingsIcon as T, StatusIcon as E, SuccessIcon as D, SwapIcon as O, TagIcon as k, TrashIcon as A, TriageIcon as j, UnlinkIcon as M, UsersIcon as N, WorkerIcon as P } from "./icons.js";
2
2
  import { usePeople as F } from "../lib/people.js";
3
- import { PersonHoverCard as I } from "./PersonHoverCard.js";
4
- import { actorAvatar as L } from "../lib/avatar.js";
3
+ import { actorAvatar as I } from "../lib/avatar.js";
4
+ import { PersonHoverCard as L } from "./PersonHoverCard.js";
5
5
  import { Avatar as R, RelativeTime as z } from "@parallelworks/ui";
6
6
  import { jsx as B, jsxs as V } from "react/jsx-runtime";
7
7
  // src/components/ActivityTimeline.tsx
@@ -132,12 +132,12 @@ function W({ workspace: e, icon: t, actor: n, at: r, detail: i, children: a }) {
132
132
  className: "min-w-0",
133
133
  children: [n && /* @__PURE__ */ B("span", {
134
134
  className: "mr-1.5 inline-flex align-middle",
135
- children: /* @__PURE__ */ B(I, {
135
+ children: /* @__PURE__ */ B(L, {
136
136
  workspace: e,
137
137
  kind: n.kind,
138
138
  handle: n.handle,
139
139
  children: /* @__PURE__ */ B(R, {
140
- ...L(n.kind),
140
+ ...I(n.kind),
141
141
  name: o(n),
142
142
  src: s(n.kind, n.handle),
143
143
  size: "xs"
@@ -2,22 +2,22 @@ import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { issuePath as n } from "../lib/branch.js";
3
3
  import { Link as r, useNavigate as i } from "../lib/router.js";
4
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 { AreaIcon as f, FileTextIcon as p, LibraryIcon as m, PullRequestIcon as ee } from "./icons.js";
6
- import { copyItem as h, useLinkItems as g } from "../lib/menus.js";
7
- import { docRef as _ } from "../lib/docs.js";
8
- import { invalidateIssueViews as v } from "../api/mutations.js";
9
- import { useTime as y } from "../lib/time.js";
10
- import { usePeople as b } from "../lib/people.js";
11
- import { useNewIssue as x } from "../lib/newIssue.js";
12
- import { useRunPanel as S } from "../lib/hostPanel.js";
13
- import { EntryDialog as C, useTermRefs as w } from "../lib/knowledge.js";
14
- import { externalUrl as T } from "../lib/externalUrl.js";
15
- import { Editor as E } from "./Editor.js";
16
- import { harnessNames as D } from "../lib/agents.js";
17
- import { usePermissionModeName as te } from "../lib/permissionModes.js";
18
- import { parseApproval as ne } from "../lib/approval.js";
19
- import { decisionDefaults as O } from "../lib/decisionEntry.js";
20
- import { AgentPage as k } from "./AgentPage.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 { decisionDefaults as h } from "../lib/decisionEntry.js";
9
+ import { copyItem as g, useLinkItems as _ } from "../lib/menus.js";
10
+ import { docRef as v } from "../lib/docs.js";
11
+ import { externalUrl as y } from "../lib/externalUrl.js";
12
+ import { useRunPanel as b } from "../lib/hostPanel.js";
13
+ import { AreaIcon as x, FileTextIcon as S, LibraryIcon as C, PullRequestIcon as ee } from "./icons.js";
14
+ import { EntryDialog as w, useTermRefs as T } from "../lib/knowledge.js";
15
+ import { useNewIssue as E } from "../lib/newIssue.js";
16
+ import { usePeople as te } from "../lib/people.js";
17
+ import { usePermissionModeName as ne } from "../lib/permissionModes.js";
18
+ import { useTime as D } from "../lib/time.js";
19
+ import { AgentPage as O } from "./AgentPage.js";
20
+ import { Editor as k } from "./Editor.js";
21
21
  import { Avatar as re, Button as A, Card as ie, CopyCodeBlock as j, Disclosure as M, ErrorText as ae, NumberInput as N, RelativeTime as P, Tooltip as F, menuDivider as oe, useOpenMenu as se } from "@parallelworks/ui";
22
22
  import { useParams as I } from "@tanstack/react-router";
23
23
  import { Suspense as ce, useCallback as L, useEffect as le, useRef as R, useState as z } from "react";
@@ -58,9 +58,9 @@ function _e({ workspace: e, identifier: t }) {
58
58
  });
59
59
  }
60
60
  function ve({ workspace: n, identifier: r, run: o }) {
61
- let s = B("agentWork"), l = B("common"), u = ue(), f = te(), p = y(), m = ge(), g = (e) => s(`state.${e}`), { nameOf: _ } = b(n), x = pe(), [C, w] = z(o.state === "working"), ne = () => {
62
- x.invalidateQueries({ queryKey: d(n, r).queryKey }), v(x, n, r);
63
- }, O = fe({
61
+ let s = B("agentWork"), l = B("common"), u = ue(), m = ne(), h = D(), _ = ge(), v = (e) => s(`state.${e}`), { nameOf: x } = te(n), S = pe(), [C, w] = z(o.state === "working"), T = () => {
62
+ S.invalidateQueries({ queryKey: d(n, r).queryKey }), f(S, n, r);
63
+ }, E = fe({
64
64
  mutationFn: async (r) => t(await e.POST("/api/v1/workspaces/{workspace}/runs/{runId}/move", {
65
65
  params: { path: {
66
66
  workspace: n,
@@ -68,8 +68,8 @@ function ve({ workspace: n, identifier: r, run: o }) {
68
68
  } },
69
69
  body: r
70
70
  })),
71
- onSettled: ne
72
- }), [k, j] = z(!1), [M, N] = z(""), P = fe({
71
+ onSettled: T
72
+ }), [O, j] = z(!1), [M, N] = z(""), P = fe({
73
73
  mutationFn: async () => (t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/comments", {
74
74
  params: { path: {
75
75
  workspace: n,
@@ -89,8 +89,8 @@ function ve({ workspace: n, identifier: r, run: o }) {
89
89
  onSuccess: () => {
90
90
  j(!1), N("");
91
91
  },
92
- onSettled: ne
93
- }), F = O.isPending || P.isPending, I = xe(o), [ce, L] = z(!1), le = () => I ? L(!0) : O.mutate({ state: "queued" }), R = I && {
92
+ onSettled: T
93
+ }), F = E.isPending || P.isPending, I = xe(o), [ce, L] = z(!1), le = () => I ? L(!0) : E.mutate({ state: "queued" }), R = I && {
94
94
  turns: {
95
95
  used: o.turns,
96
96
  allowed: o.budget.maxTurns
@@ -100,17 +100,17 @@ function ve({ workspace: n, identifier: r, run: o }) {
100
100
  allowed: o.budget.maxMinutes
101
101
  },
102
102
  cost: {
103
- used: m(o.costMicros),
104
- allowed: m(o.budget.maxCostMicros)
103
+ used: _(o.costMicros),
104
+ allowed: _(o.budget.maxCostMicros)
105
105
  }
106
- }[I], de = !["closed", "stopped"].includes(o.state), G = o.state === "done_pending_verification", _e = se(), ve = i(), { data: be = [] } = W(a(n)), q = be.find((e) => e.id === o.agentId), { data: we = [] } = W(c(n, r)), J = we.find((e) => e.runId === o.id), Te = B("code"), Y = q?.slug, X = S(), Z = X && (o.harnessSession || o.runnerName) ? {
106
+ }[I], de = !["closed", "stopped"].includes(o.state), G = o.state === "done_pending_verification", _e = se(), ve = i(), { data: be = [] } = W(a(n)), q = be.find((e) => e.id === o.agentId), { data: we = [] } = W(c(n, r)), J = we.find((e) => e.runId === o.id), Te = B("code"), Y = q?.slug, X = b(), Z = X && (o.harnessSession || o.runnerName) ? {
107
107
  label: s("openRunIn", { name: X.action.label }),
108
108
  onClick: () => X.open(o)
109
109
  } : void 0, Q = () => [
110
110
  ...Z ? [Z] : [],
111
111
  ...G ? [{
112
112
  label: s("accept"),
113
- onClick: () => O.mutate({ state: "closed" })
113
+ onClick: () => E.mutate({ state: "closed" })
114
114
  }, {
115
115
  label: s("requestChanges"),
116
116
  onClick: () => j(!0)
@@ -122,7 +122,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
122
122
  ...de ? [{
123
123
  label: s("stop"),
124
124
  destructive: !0,
125
- onClick: () => O.mutate({ state: "stopped" })
125
+ onClick: () => E.mutate({ state: "stopped" })
126
126
  }] : [],
127
127
  oe,
128
128
  ...Y ? [{
@@ -135,7 +135,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
135
135
  }
136
136
  })
137
137
  }] : [],
138
- h(s("copyRunId"), o.id)
138
+ g(s("copyRunId"), o.id)
139
139
  ], $ = o.state === "working" || o.state === "queued";
140
140
  return o.state === "closed" ? /* @__PURE__ */ U("div", {
141
141
  onContextMenu: (e) => _e(e, Q()),
@@ -149,7 +149,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
149
149
  }),
150
150
  /* @__PURE__ */ H("span", { children: s.rich("accepted", {
151
151
  agent: o.agentName,
152
- when: p.relative(o.updatedAt),
152
+ when: h.relative(o.updatedAt),
153
153
  name: (e) => /* @__PURE__ */ H("span", {
154
154
  className: "font-medium text-foreground",
155
155
  children: e
@@ -170,7 +170,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
170
170
  render: /* @__PURE__ */ H("section", {
171
171
  "aria-label": s("runLabel", {
172
172
  agent: o.agentName,
173
- state: g(o.state)
173
+ state: v(o.state)
174
174
  }),
175
175
  onContextMenu: (e) => {
176
176
  e.target.closest(".ProseMirror[contenteditable=\"true\"]") || _e(e, Q());
@@ -192,7 +192,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
192
192
  }),
193
193
  /* @__PURE__ */ H("span", {
194
194
  className: "truncate text-muted-foreground",
195
- children: s("assignedBy", { name: _("user", o.assignedBy) })
195
+ children: s("assignedBy", { name: x("user", o.assignedBy) })
196
196
  }),
197
197
  /* @__PURE__ */ U("span", {
198
198
  className: K("ml-auto inline-flex shrink-0 items-center gap-1.5 text-xs font-medium", G || $ ? "text-agent" : "text-muted-foreground"),
@@ -202,7 +202,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
202
202
  "aria-hidden": "true",
203
203
  children: [o.state === "working" && /* @__PURE__ */ H("span", { className: "absolute inline-flex size-full animate-ping rounded-full bg-agent opacity-60 motion-reduce:hidden" }), /* @__PURE__ */ H("span", { className: "relative inline-flex size-1.5 rounded-full bg-agent" })]
204
204
  }),
205
- g(o.state),
205
+ v(o.state),
206
206
  o.state === "working" && o.runnerName && /* @__PURE__ */ H("span", {
207
207
  className: "font-normal text-muted-foreground",
208
208
  children: s("onRunner", { runner: o.runnerName })
@@ -226,16 +226,16 @@ function ve({ workspace: n, identifier: r, run: o }) {
226
226
  }),
227
227
  o.state === "queued" && q && !q.runnable ? /* @__PURE__ */ H("p", {
228
228
  className: "px-3 pt-1.5 text-pretty text-muted-foreground",
229
- children: s("noRunnerForHarness", { harness: D[q.harness] ?? q.harness })
229
+ children: s("noRunnerForHarness", { harness: p[q.harness] ?? q.harness })
230
230
  }) : o.state === "queued" && o.waiting && /* @__PURE__ */ H("p", {
231
231
  className: "px-3 pt-1.5 text-pretty text-muted-foreground",
232
- children: s(`waiting.${o.waiting}`, { name: _("user", o.assignedBy) })
232
+ children: s(`waiting.${o.waiting}`, { name: x("user", o.assignedBy) })
233
233
  }),
234
234
  o.permissionMode && o.permissionMode !== o.agentPermissionMode && /* @__PURE__ */ H("p", {
235
235
  className: "px-3 pt-1.5 text-pretty text-muted-foreground",
236
236
  children: s("modeLowered", {
237
- got: f(o.permissionMode),
238
- asked: f(o.agentPermissionMode)
237
+ got: m(o.permissionMode),
238
+ asked: m(o.agentPermissionMode)
239
239
  })
240
240
  }),
241
241
  o.state === "stopped" && I && R ? /* @__PURE__ */ H("p", {
@@ -260,7 +260,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
260
260
  children: [
261
261
  /* @__PURE__ */ H(ee, { className: "size-3.5 text-muted-foreground" }),
262
262
  /* @__PURE__ */ H("a", {
263
- href: T(J.url),
263
+ href: y(J.url),
264
264
  target: "_blank",
265
265
  rel: "noopener noreferrer",
266
266
  className: "hover:underline",
@@ -283,14 +283,14 @@ function ve({ workspace: n, identifier: r, run: o }) {
283
283
  run: o,
284
284
  busy: F,
285
285
  onCancel: () => L(!1),
286
- onSubmit: (e) => O.mutate({
286
+ onSubmit: (e) => E.mutate({
287
287
  state: "queued",
288
288
  budget: e
289
289
  }, { onSuccess: () => L(!1) })
290
290
  }),
291
- k && /* @__PURE__ */ H("div", {
291
+ O && /* @__PURE__ */ H("div", {
292
292
  className: "mx-3 mt-2.5 rounded-md border border-border px-2.5 py-1.5 focus-within:border-primary/60",
293
- children: /* @__PURE__ */ H(E, {
293
+ children: /* @__PURE__ */ H(k, {
294
294
  value: "",
295
295
  onChange: N,
296
296
  onSubmit: () => M.trim() && P.mutate(),
@@ -303,12 +303,12 @@ function ve({ workspace: n, identifier: r, run: o }) {
303
303
  /* @__PURE__ */ U("footer", {
304
304
  className: "flex flex-wrap items-center gap-2 px-3 pt-2.5 pb-2.5",
305
305
  children: [
306
- G && !k && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(A, {
306
+ G && !O && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(A, {
307
307
  variant: "primary",
308
308
  size: "sm",
309
309
  type: "button",
310
310
  disabled: F,
311
- onClick: () => O.mutate({ state: "closed" }),
311
+ onClick: () => E.mutate({ state: "closed" }),
312
312
  children: s("accept")
313
313
  }), /* @__PURE__ */ H(A, {
314
314
  size: "sm",
@@ -317,7 +317,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
317
317
  onClick: () => j(!0),
318
318
  children: s("requestChanges")
319
319
  })] }),
320
- k && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(A, {
320
+ O && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(A, {
321
321
  variant: "primary",
322
322
  size: "sm",
323
323
  type: "button",
@@ -341,7 +341,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
341
341
  size: "sm",
342
342
  type: "button",
343
343
  disabled: F,
344
- onClick: () => O.mutate({ state: "stopped" }),
344
+ onClick: () => E.mutate({ state: "stopped" }),
345
345
  children: s("stop")
346
346
  }),
347
347
  o.state !== "queued" && /* @__PURE__ */ H(A, {
@@ -358,14 +358,14 @@ function ve({ workspace: n, identifier: r, run: o }) {
358
358
  maxTurns: o.budget.maxTurns,
359
359
  minutes: Math.floor(o.seconds / 60),
360
360
  maxMinutes: o.budget.maxMinutes,
361
- cost: m(o.costMicros),
362
- maxCost: m(o.budget.maxCostMicros),
363
- when: p.relative(o.updatedAt)
361
+ cost: _(o.costMicros),
362
+ maxCost: _(o.budget.maxCostMicros),
363
+ when: h.relative(o.updatedAt)
364
364
  })
365
365
  }),
366
- (O.isError || P.isError) && /* @__PURE__ */ H(ae, {
366
+ (E.isError || P.isError) && /* @__PURE__ */ H(ae, {
367
367
  className: "w-full",
368
- children: u(O.error ?? P.error)
368
+ children: u(E.error ?? P.error)
369
369
  })
370
370
  ]
371
371
  }),
@@ -377,7 +377,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
377
377
  });
378
378
  }
379
379
  function ye({ workspace: e, run: t }) {
380
- let n = B("agentWork.activity"), r = y(), i = t.state === "working", { data: a, isPending: o, isError: s } = W(l(e, t.id, i)), c = R(null), u = R(!0), d = a?.length ?? 0;
380
+ let n = B("agentWork.activity"), r = D(), i = t.state === "working", { data: a, isPending: o, isError: s } = W(l(e, t.id, i)), c = R(null), u = R(!0), d = a?.length ?? 0;
381
381
  return le(() => {
382
382
  let e = c.current;
383
383
  e && u.current && d > 0 && (e.scrollTop = e.scrollHeight);
@@ -543,7 +543,7 @@ function Se({ run: e, busy: t, onSubmit: n, onCancel: r }) {
543
543
  }
544
544
  var K = (...e) => e.filter(Boolean).join(" ");
545
545
  function Ce({ workspace: e, run: t }) {
546
- let n = w(e), i = B("agentWork"), [a, o] = z(!1), { data: s } = W({
546
+ let n = T(e), i = B("agentWork"), [a, o] = z(!1), { data: s } = W({
547
547
  ...u(e, t.id),
548
548
  enabled: a
549
549
  });
@@ -562,10 +562,10 @@ function Ce({ workspace: e, run: t }) {
562
562
  to: "/$workspace/docs/$doc",
563
563
  params: {
564
564
  workspace: e,
565
- doc: _(t)
565
+ doc: v(t)
566
566
  },
567
567
  className: "inline-flex items-center gap-1 hover:underline",
568
- children: [/* @__PURE__ */ H(p, { className: "size-3.5 text-muted-foreground" }), t.title]
568
+ children: [/* @__PURE__ */ H(S, { className: "size-3.5 text-muted-foreground" }), t.title]
569
569
  }) }, t.id)), s.entries.map((t) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ U(r, {
570
570
  to: "/$workspace/knowledge/$term",
571
571
  params: {
@@ -573,7 +573,7 @@ function Ce({ workspace: e, run: t }) {
573
573
  term: n(t.id)
574
574
  },
575
575
  className: "inline-flex items-center gap-1 hover:underline",
576
- children: [/* @__PURE__ */ H(m, { className: "size-3.5 text-muted-foreground" }), t.name]
576
+ children: [/* @__PURE__ */ H(C, { className: "size-3.5 text-muted-foreground" }), t.name]
577
577
  }) }, t.id))]
578
578
  }))
579
579
  });
@@ -597,7 +597,7 @@ function we({ decision: e, className: t }) {
597
597
  }), i.deploymentId && /* @__PURE__ */ H("span", {
598
598
  className: "mt-1 block text-xs text-muted-foreground",
599
599
  children: i.deploymentUrl ? /* @__PURE__ */ H("a", {
600
- href: T(i.deploymentUrl),
600
+ href: y(i.deploymentUrl),
601
601
  target: "_blank",
602
602
  rel: "noopener noreferrer",
603
603
  className: "hover:underline",
@@ -609,7 +609,7 @@ function we({ decision: e, className: t }) {
609
609
  children: n.rich("mergePrompt", {
610
610
  sha: r.sha.slice(0, 7),
611
611
  pr: () => /* @__PURE__ */ U("a", {
612
- href: T(r.url),
612
+ href: y(r.url),
613
613
  target: "_blank",
614
614
  rel: "noopener noreferrer",
615
615
  className: "font-medium hover:underline",
@@ -624,7 +624,7 @@ function we({ decision: e, className: t }) {
624
624
  children: e
625
625
  })
626
626
  })
627
- }) : /* @__PURE__ */ H(E, {
627
+ }) : /* @__PURE__ */ H(k, {
628
628
  value: e.prompt,
629
629
  editable: !1,
630
630
  ...t && { className: t }
@@ -682,7 +682,7 @@ function Te({ workspace: e, decision: t, onAnswer: n, busy: r }) {
682
682
  }, [t.options]), d = s.find((e) => e.id === t.pageId), f = t.options.find((e) => e.id === c);
683
683
  return /* @__PURE__ */ U("div", {
684
684
  className: "mt-3 space-y-2",
685
- children: [/* @__PURE__ */ H(k, {
685
+ children: [/* @__PURE__ */ H(O, {
686
686
  attachmentId: t.pageId ?? "",
687
687
  name: d?.name ?? "",
688
688
  agent: t.agentName,
@@ -709,7 +709,7 @@ function Te({ workspace: e, decision: t, onAnswer: n, busy: r }) {
709
709
  });
710
710
  }
711
711
  function Y(e) {
712
- let t = B("agentWork"), n = q(), r = x(), { workspace: i } = I({ strict: !1 });
712
+ let t = B("agentWork"), n = q(), r = E(), { workspace: i } = I({ strict: !1 });
713
713
  if (i !== e.workspace) return [];
714
714
  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");
715
715
  return [{
@@ -723,7 +723,7 @@ function Y(e) {
723
723
  }];
724
724
  }
725
725
  function X(e) {
726
- return e.merge || e.release || !e.options.some((e) => e.id === "allow") ? null : ne(e.prompt);
726
+ return e.merge || e.release || !e.options.some((e) => e.id === "allow") ? null : m(e.prompt);
727
727
  }
728
728
  var Z = (e) => ({
729
729
  allow: 0,
@@ -738,7 +738,7 @@ function Q() {
738
738
  });
739
739
  }
740
740
  function $({ workspace: r, decision: a, showIssue: o = !1 }) {
741
- let s = ue(), c = B("agentWork"), l = q(), u = g(), d = pe(), f = B("common"), [p, m] = z(""), [ee, h] = z(0), [_, v] = z(!1), y = X(a), b = !y && a.options.some((e) => e.description), x = y ? [...a.options].sort((e, t) => Z(e.id) - Z(t.id)) : a.options, S = fe({
741
+ let s = ue(), c = B("agentWork"), l = q(), u = _(), d = pe(), f = B("common"), [p, m] = z(""), [h, g] = z(0), [v, y] = z(!1), b = X(a), x = !b && a.options.some((e) => e.description), S = b ? [...a.options].sort((e, t) => Z(e.id) - Z(t.id)) : a.options, C = fe({
742
742
  mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/decisions/{decisionId}/answer", {
743
743
  params: { path: {
744
744
  workspace: r,
@@ -750,7 +750,7 @@ function $({ workspace: r, decision: a, showIssue: o = !1 }) {
750
750
  }
751
751
  })),
752
752
  onSuccess: () => {
753
- m(""), v(!1), h((e) => e + 1), d.invalidateQueries({ queryKey: [
753
+ m(""), y(!1), g((e) => e + 1), d.invalidateQueries({ queryKey: [
754
754
  "workspace",
755
755
  r,
756
756
  "decisions"
@@ -761,12 +761,12 @@ function $({ workspace: r, decision: a, showIssue: o = !1 }) {
761
761
  a.identifier.toUpperCase()
762
762
  ] });
763
763
  }
764
- }), C = se(), w = i(), T = Y(a), D = () => [
764
+ }), ee = se(), w = i(), T = Y(a), E = () => [
765
765
  ...a.options.length > 0 ? [{
766
766
  label: c("answer"),
767
767
  items: a.options.map((e) => ({
768
768
  label: e.id === a.recommendation ? c("suggestedOption", { option: l(a, e) }) : l(a, e),
769
- onClick: () => S.mutate(e.id)
769
+ onClick: () => C.mutate(e.id)
770
770
  }))
771
771
  }, oe] : [],
772
772
  {
@@ -789,7 +789,7 @@ function $({ workspace: r, decision: a, showIssue: o = !1 }) {
789
789
  interactive: !1,
790
790
  render: /* @__PURE__ */ H("article", {
791
791
  onContextMenu: (e) => {
792
- e.target.closest(".ProseMirror[contenteditable=\"true\"]") || C(e, D());
792
+ e.target.closest(".ProseMirror[contenteditable=\"true\"]") || ee(e, E());
793
793
  },
794
794
  "aria-label": c("asking", { agent: a.agentName })
795
795
  }),
@@ -826,20 +826,20 @@ function $({ workspace: r, decision: a, showIssue: o = !1 }) {
826
826
  }), /* @__PURE__ */ U("div", {
827
827
  className: "px-3 py-2.5",
828
828
  children: [
829
- y ? /* @__PURE__ */ U("div", { children: [
829
+ b ? /* @__PURE__ */ U("div", { children: [
830
830
  /* @__PURE__ */ H("p", {
831
831
  className: "text-sm font-medium",
832
- children: y.agent ? c("approveCommandFor", { agent: y.agent }) : c("approveCommand")
832
+ children: b.agent ? c("approveCommandFor", { agent: b.agent }) : c("approveCommand")
833
833
  }),
834
834
  /* @__PURE__ */ H(j, {
835
- text: y.command,
835
+ text: b.command,
836
836
  label: c("command"),
837
837
  wrap: !0,
838
838
  className: "mt-2 [&_pre]:px-3 [&_pre]:py-2 [&_pre]:pr-10 [&_pre]:text-xs [&_pre]:leading-5"
839
839
  }),
840
- y.reason && /* @__PURE__ */ H("p", {
840
+ b.reason && /* @__PURE__ */ H("p", {
841
841
  className: "mt-1.5 text-xs text-muted-foreground",
842
- children: y.reason
842
+ children: b.reason
843
843
  })
844
844
  ] }) : /* @__PURE__ */ H("div", {
845
845
  className: "[&_.ProseMirror>:first-child]:mt-0",
@@ -852,21 +852,21 @@ function $({ workspace: r, decision: a, showIssue: o = !1 }) {
852
852
  a.pageId && /* @__PURE__ */ H(Te, {
853
853
  workspace: r,
854
854
  decision: a,
855
- onAnswer: (e) => S.mutate(e),
856
- busy: S.isPending
855
+ onAnswer: (e) => C.mutate(e),
856
+ busy: C.isPending
857
857
  }),
858
858
  /* @__PURE__ */ H(J, {
859
859
  workspace: r,
860
860
  decision: a
861
861
  }),
862
- a.options.length > 0 && (b ? /* @__PURE__ */ H("div", {
862
+ a.options.length > 0 && (x ? /* @__PURE__ */ H("div", {
863
863
  className: "mt-3 grid gap-1.5 sm:grid-cols-2",
864
864
  children: a.options.map((e) => {
865
865
  let t = e.id === a.recommendation;
866
866
  return /* @__PURE__ */ U("button", {
867
867
  type: "button",
868
- disabled: S.isPending,
869
- onClick: () => S.mutate(e.id),
868
+ disabled: C.isPending,
869
+ onClick: () => C.mutate(e.id),
870
870
  className: `rounded-md border px-3 py-2 text-left text-sm hover:bg-muted disabled:opacity-50 ${t ? "border-agent" : "border-border"}`,
871
871
  children: [/* @__PURE__ */ U("span", {
872
872
  className: "flex items-center gap-2 font-medium",
@@ -879,56 +879,56 @@ function $({ workspace: r, decision: a, showIssue: o = !1 }) {
879
879
  })
880
880
  }) : /* @__PURE__ */ U("div", {
881
881
  className: "mt-3 flex flex-wrap items-center gap-2",
882
- children: [x.map((e, t) => {
882
+ children: [S.map((e, t) => {
883
883
  let n = e.id === a.recommendation, r = /* @__PURE__ */ U(A, {
884
884
  size: "sm",
885
- variant: y && t === 0 ? "primary" : "secondary",
886
- disabled: S.isPending,
887
- onClick: () => S.mutate(e.id),
888
- className: n && !(y && t === 0) ? "border-agent" : void 0,
885
+ variant: b && t === 0 ? "primary" : "secondary",
886
+ disabled: C.isPending,
887
+ onClick: () => C.mutate(e.id),
888
+ className: n && !(b && t === 0) ? "border-agent" : void 0,
889
889
  children: [l(a, e), n && /* @__PURE__ */ H(Q, {})]
890
890
  }, e.id);
891
891
  return e.description ? /* @__PURE__ */ H(F, {
892
892
  content: e.description,
893
893
  children: r
894
894
  }, e.id) : r;
895
- }), a.allowText && !_ && /* @__PURE__ */ H("button", {
895
+ }), a.allowText && !v && /* @__PURE__ */ H("button", {
896
896
  type: "button",
897
- onClick: () => v(!0),
897
+ onClick: () => y(!0),
898
898
  className: "ml-1 text-xs text-muted-foreground hover:text-foreground",
899
899
  children: c("answerOwnWordsShort")
900
900
  })]
901
901
  })),
902
- a.allowText && (_ || a.options.length === 0 || b) && /* @__PURE__ */ U("div", {
902
+ a.allowText && (v || a.options.length === 0 || x) && /* @__PURE__ */ U("div", {
903
903
  className: "mt-3 rounded-md border border-border px-2.5 py-1.5 focus-within:border-primary/60",
904
- children: [/* @__PURE__ */ H(E, {
904
+ children: [/* @__PURE__ */ H(k, {
905
905
  value: "",
906
906
  onChange: m,
907
- onSubmit: () => p.trim() && S.mutate(void 0),
907
+ onSubmit: () => p.trim() && C.mutate(void 0),
908
908
  placeholder: a.options.length ? c("answerOwnWords") : c("answerPlaceholder"),
909
909
  label: c("answer"),
910
910
  className: "min-h-8",
911
- autofocus: _
912
- }, ee), /* @__PURE__ */ U("div", {
911
+ autofocus: v
912
+ }, h), /* @__PURE__ */ U("div", {
913
913
  className: "flex justify-end gap-2",
914
- children: [_ && !b && /* @__PURE__ */ H(A, {
914
+ children: [v && !x && /* @__PURE__ */ H(A, {
915
915
  size: "sm",
916
916
  variant: "ghost",
917
- onClick: () => v(!1),
917
+ onClick: () => y(!1),
918
918
  children: f("cancel")
919
919
  }), /* @__PURE__ */ H(A, {
920
920
  variant: "primary",
921
921
  size: "sm",
922
922
  disabled: !p.trim(),
923
- loading: S.isPending,
924
- onClick: () => S.mutate(void 0),
923
+ loading: C.isPending,
924
+ onClick: () => C.mutate(void 0),
925
925
  children: c("answer")
926
926
  })]
927
927
  })]
928
928
  }),
929
- S.isError && /* @__PURE__ */ H(ae, {
929
+ C.isError && /* @__PURE__ */ H(ae, {
930
930
  className: "mt-2",
931
- children: s(S.error)
931
+ children: s(C.error)
932
932
  })
933
933
  ]
934
934
  })]
@@ -949,15 +949,15 @@ function Ee({ workspace: e, decision: t }) {
949
949
  className: "mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",
950
950
  children: [i && /* @__PURE__ */ U("span", {
951
951
  className: "flex items-center gap-1",
952
- children: [/* @__PURE__ */ H(f, { className: "size-3.5" }), i.title]
952
+ children: [/* @__PURE__ */ H(x, { className: "size-3.5" }), i.title]
953
953
  }), a && /* @__PURE__ */ U(r, {
954
954
  to: "/$workspace/docs/$doc",
955
955
  params: {
956
956
  workspace: e,
957
- doc: _(a)
957
+ doc: v(a)
958
958
  },
959
959
  className: "flex min-w-0 items-center gap-1 hover:text-foreground",
960
- children: [/* @__PURE__ */ H(p, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ H("span", {
960
+ children: [/* @__PURE__ */ H(S, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ H("span", {
961
961
  className: "truncate",
962
962
  children: o ? n("docSection", {
963
963
  doc: a.title,
@@ -996,7 +996,7 @@ function Ee({ workspace: e, decision: t }) {
996
996
  summary: n("checked"),
997
997
  children: /* @__PURE__ */ H("div", {
998
998
  className: "mt-1 text-sm",
999
- children: /* @__PURE__ */ H(E, {
999
+ children: /* @__PURE__ */ H(k, {
1000
1000
  value: c,
1001
1001
  editable: !1
1002
1002
  })
@@ -1015,7 +1015,7 @@ function De(e) {
1015
1015
  };
1016
1016
  }
1017
1017
  function Oe({ workspace: e, decisions: t }) {
1018
- let n = B("agentWork"), r = y(), i = q();
1018
+ let n = B("agentWork"), r = D(), i = q();
1019
1019
  return /* @__PURE__ */ H(M, {
1020
1020
  defaultOpen: !0,
1021
1021
  className: "rounded-lg border border-border text-sm",
@@ -1062,7 +1062,7 @@ function Oe({ workspace: e, decisions: t }) {
1062
1062
  });
1063
1063
  }
1064
1064
  function ke({ workspace: e, decision: t, showIssue: a = !1, showWorkspace: o = !1, bare: s = !1 }) {
1065
- let c = w(e), l = B("agentWork"), u = y(), { person: d } = b(e), f = se(), p = g(), m = i(), [ee, h] = z(!1), _ = q(), v = t.options.find((e) => e.id === t.answer?.optionId), x = [v && _(t, v), t.answer?.text].filter(Boolean).join(". "), S = !!t.breakdown?.length || !!t.merge || !!t.release, T = () => h(!0), E = Y(t), D = (r) => f(r, [
1065
+ let c = T(e), l = B("agentWork"), u = D(), { person: d } = te(e), f = se(), p = _(), m = i(), [g, v] = z(!1), y = q(), b = t.options.find((e) => e.id === t.answer?.optionId), x = [b && y(t, b), t.answer?.text].filter(Boolean).join(". "), S = !!t.breakdown?.length || !!t.merge || !!t.release, C = () => v(!0), ee = Y(t), E = (r) => f(r, [
1066
1066
  ...S ? [] : [t.savedAs ? {
1067
1067
  label: l("savedAsDecision"),
1068
1068
  onClick: () => m({
@@ -1074,12 +1074,12 @@ function ke({ workspace: e, decision: t, showIssue: a = !1, showWorkspace: o = !
1074
1074
  })
1075
1075
  } : {
1076
1076
  label: l("saveAsDecision"),
1077
- onClick: T
1077
+ onClick: C
1078
1078
  }],
1079
- ...E,
1079
+ ...ee,
1080
1080
  oe,
1081
1081
  ...p(n(e, t.identifier))
1082
- ]), te = /* @__PURE__ */ U(V, { children: [
1082
+ ]), ne = /* @__PURE__ */ U(V, { children: [
1083
1083
  /* @__PURE__ */ U("p", {
1084
1084
  className: "flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground",
1085
1085
  children: [
@@ -1131,32 +1131,32 @@ function ke({ workspace: e, decision: t, showIssue: a = !1, showWorkspace: o = !
1131
1131
  children: l("savedAsDecision")
1132
1132
  }) : /* @__PURE__ */ H(A, {
1133
1133
  size: "sm",
1134
- onClick: T,
1134
+ onClick: C,
1135
1135
  children: l("saveAsDecision")
1136
1136
  })
1137
1137
  }),
1138
- ee && /* @__PURE__ */ H(ce, { children: /* @__PURE__ */ H(C, {
1138
+ g && /* @__PURE__ */ H(ce, { children: /* @__PURE__ */ H(w, {
1139
1139
  workspace: e,
1140
1140
  mode: {
1141
1141
  kind: "create",
1142
- defaults: O(t, (e) => l("decisionDefinition", e))
1142
+ defaults: h(t, (e) => l("decisionDefinition", e))
1143
1143
  },
1144
- onClose: () => h(!1)
1144
+ onClose: () => v(!1)
1145
1145
  }) })
1146
1146
  ] });
1147
1147
  return s ? /* @__PURE__ */ H("article", {
1148
- onContextMenu: D,
1148
+ onContextMenu: E,
1149
1149
  "aria-label": l("answeredLabel"),
1150
1150
  className: "text-sm",
1151
- children: te
1151
+ children: ne
1152
1152
  }) : /* @__PURE__ */ H(ie, {
1153
1153
  size: "fill",
1154
1154
  className: "text-sm",
1155
1155
  render: /* @__PURE__ */ H("article", {
1156
- onContextMenu: D,
1156
+ onContextMenu: E,
1157
1157
  "aria-label": l("answeredLabel")
1158
1158
  }),
1159
- children: te
1159
+ children: ne
1160
1160
  });
1161
1161
  }
1162
1162
  export { _e as AgentWork, ke as AnsweredDecision, $ as DecisionCard, ge as useMoney, q as useOptionLabel };