@parallelworks/tandem-web 0.150.3 → 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.
- package/_virtual/_virtual_i18n/en/common.js +32 -3
- package/_virtual/_virtual_i18n/es/common.js +32 -3
- package/_virtual/_virtual_i18n/ja/common.js +32 -3
- package/_virtual/_virtual_i18n/ko/common.js +32 -3
- package/_virtual/_virtual_i18n/zh/common.js +32 -3
- package/api/queries.js +88 -77
- package/components/AccessGrants.js +6 -6
- package/components/ActivityTimeline.js +4 -4
- package/components/AgentWork.js +111 -111
- package/components/AreaLink.js +32 -0
- package/components/AreaTiles.js +10 -13
- package/components/AreaWork.js +25 -1
- package/components/BugRotation.js +3 -3
- package/components/CodeHostSettings.js +30 -30
- package/components/CommandPalette.js +53 -53
- package/components/CustomFields.js +116 -116
- package/components/DateChip.js +11 -11
- package/components/DocButton.js +6 -6
- package/components/DocHistory.js +4 -4
- package/components/DocLinkPicker.js +8 -8
- package/components/DocProperties.js +15 -15
- package/components/DocTable.js +15 -15
- package/components/DocsTree.js +80 -80
- package/components/Editor.js +35 -35
- package/components/FavoritesNav.js +53 -53
- package/components/GitHub.js +18 -18
- package/components/Graph.js +15 -15
- package/components/HostActions.js +21 -21
- package/components/HostPanel.js +6 -6
- package/components/HoverCards.js +38 -38
- package/components/IssueBoard.js +4 -4
- package/components/IssueCode.js +14 -14
- package/components/IssueEvent.js +3 -3
- package/components/IssueFilters.js +71 -71
- package/components/IssueListBlock.js +32 -32
- package/components/IssueRow.js +21 -21
- package/components/IssueTemplates.js +118 -118
- package/components/IssueTypes.js +40 -40
- package/components/NewIssueDialog.js +76 -76
- package/components/NewProjectDialog.js +145 -145
- package/components/PersonActivity.js +4 -4
- package/components/SharedViewer.js +5 -5
- package/components/SlashMenu.js +29 -29
- package/components/TeamRepositories.js +51 -51
- package/components/TeamWorkflow.js +6 -6
- package/components/UnlinkedMentions.js +20 -20
- package/components/Updates.js +3 -3
- package/components/Widgets.js +20 -20
- package/components/columns.js +17 -17
- package/components/editorPlugins.js +80 -80
- package/components/mathDiagrams.js +17 -17
- package/lib/boardMove.js +5 -5
- package/lib/issueList.js +58 -58
- package/lib/issueMenu.js +27 -27
- package/lib/knowledge.js +106 -106
- package/lib/views.js +9 -9
- package/package.json +1 -1
- package/pages/area.js +291 -0
- package/pages/areas.js +258 -287
- package/pages/decisions.js +21 -21
- package/pages/issues.js +52 -52
- package/pages/projects.js +125 -125
- package/pages/triage.js +12 -12
- package/routeTree.gen.js +186 -180
- package/routes/_workspace/agents/_slug2.js +11 -11
- package/routes/_workspace/agents/index2.js +10 -10
- package/routes/_workspace/areas/_area.js +7 -8
- package/routes/_workspace/areas/_area2.js +3 -290
- package/routes/_workspace/areas/_area3.js +7 -8
- package/routes/_workspace/docs/_doc2.js +230 -230
- package/routes/_workspace/docs/space2._space.js +27 -27
- package/routes/_workspace/issues/_identifier2.js +222 -224
- package/routes/_workspace/knowledge/_term2.js +43 -43
- package/routes/_workspace/knowledge/index.js +6 -6
- package/routes/_workspace/knowledge/index2.js +15 -15
- package/routes/_workspace/measures3.js +70 -72
- package/routes/_workspace/notifications2.js +150 -150
- package/routes/_workspace/people/_username2.js +10 -10
- package/routes/_workspace/projects/_projectId3.js +276 -276
- package/routes/_workspace/settings/audit-log3.js +136 -138
- package/routes/_workspace/settings/fields2.js +11 -11
- package/routes/_workspace/settings/github2.js +6 -6
- package/routes/_workspace/settings/groups2.js +26 -26
- package/routes/_workspace/settings/import2.js +398 -147
- package/routes/_workspace/settings/import3.js +7 -3
- package/routes/_workspace/settings/index2.js +6 -6
- package/routes/_workspace/settings/labels2.js +21 -21
- package/routes/_workspace/settings/members2.js +27 -27
- package/routes/_workspace/settings/notifications2.js +8 -8
- package/routes/_workspace/settings/parallelworks2.js +32 -32
- package/routes/_workspace/settings/roles2.js +24 -24
- package/routes/_workspace/settings/runners2.js +15 -15
- package/routes/_workspace/settings/sessions2.js +17 -17
- package/routes/_workspace/settings/slack2.js +7 -7
- package/routes/_workspace/settings/sso2.js +31 -31
- package/routes/_workspace/settings/teams2.js +25 -25
- package/routes/_workspace/settings/tokens2.js +12 -12
- package/routes/_workspace/settings/webhooks2.js +13 -13
- package/routes/_workspace/teams/_key/areas/_area.js +8 -0
- package/routes/_workspace/teams/_key/areas/_area2.js +4 -0
- package/routes/_workspace/teams/_key/areas/_area3.js +9 -0
- package/routes/_workspace/teams/_key/areas/index.js +6 -0
- package/routes/_workspace/teams/_key/areas/index2.js +4 -0
- package/routes/_workspace/teams/_key/{areas3.js → areas/index3.js} +2 -2
- package/routes/_workspace/teams/_key/cycles/_number2.js +27 -27
- package/routes/_workspace/teams/_key/cycles/index2.js +24 -24
- package/routes/_workspace/teams/_key/settings2.js +29 -29
- package/routes/_workspace2.js +368 -368
- package/routes/_workspace/teams/_key/areas.js +0 -6
- 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 {
|
|
4
|
-
import {
|
|
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(
|
|
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
|
-
...
|
|
140
|
+
...I(n.kind),
|
|
141
141
|
name: o(n),
|
|
142
142
|
src: s(n.kind, n.handle),
|
|
143
143
|
size: "xs"
|
package/components/AgentWork.js
CHANGED
|
@@ -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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { useRunPanel as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { usePermissionModeName as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
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(),
|
|
62
|
-
|
|
63
|
-
},
|
|
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:
|
|
72
|
-
}), [
|
|
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:
|
|
93
|
-
}), F =
|
|
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:
|
|
104
|
-
allowed:
|
|
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 =
|
|
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: () =>
|
|
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: () =>
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
238
|
-
asked:
|
|
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:
|
|
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) =>
|
|
286
|
+
onSubmit: (e) => E.mutate({
|
|
287
287
|
state: "queued",
|
|
288
288
|
budget: e
|
|
289
289
|
}, { onSuccess: () => L(!1) })
|
|
290
290
|
}),
|
|
291
|
-
|
|
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(
|
|
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 && !
|
|
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: () =>
|
|
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
|
-
|
|
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: () =>
|
|
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:
|
|
362
|
-
maxCost:
|
|
363
|
-
when:
|
|
361
|
+
cost: _(o.costMicros),
|
|
362
|
+
maxCost: _(o.budget.maxCostMicros),
|
|
363
|
+
when: h.relative(o.updatedAt)
|
|
364
364
|
})
|
|
365
365
|
}),
|
|
366
|
-
(
|
|
366
|
+
(E.isError || P.isError) && /* @__PURE__ */ H(ae, {
|
|
367
367
|
className: "w-full",
|
|
368
|
-
children: u(
|
|
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 =
|
|
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 =
|
|
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:
|
|
565
|
+
doc: v(t)
|
|
566
566
|
},
|
|
567
567
|
className: "inline-flex items-center gap-1 hover:underline",
|
|
568
|
-
children: [/* @__PURE__ */ H(
|
|
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(
|
|
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:
|
|
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:
|
|
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(
|
|
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(
|
|
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 =
|
|
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 :
|
|
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 =
|
|
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(""),
|
|
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
|
-
}),
|
|
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: () =>
|
|
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\"]") ||
|
|
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
|
-
|
|
829
|
+
b ? /* @__PURE__ */ U("div", { children: [
|
|
830
830
|
/* @__PURE__ */ H("p", {
|
|
831
831
|
className: "text-sm font-medium",
|
|
832
|
-
children:
|
|
832
|
+
children: b.agent ? c("approveCommandFor", { agent: b.agent }) : c("approveCommand")
|
|
833
833
|
}),
|
|
834
834
|
/* @__PURE__ */ H(j, {
|
|
835
|
-
text:
|
|
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
|
-
|
|
840
|
+
b.reason && /* @__PURE__ */ H("p", {
|
|
841
841
|
className: "mt-1.5 text-xs text-muted-foreground",
|
|
842
|
-
children:
|
|
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) =>
|
|
856
|
-
busy:
|
|
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 && (
|
|
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:
|
|
869
|
-
onClick: () =>
|
|
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: [
|
|
882
|
+
children: [S.map((e, t) => {
|
|
883
883
|
let n = e.id === a.recommendation, r = /* @__PURE__ */ U(A, {
|
|
884
884
|
size: "sm",
|
|
885
|
-
variant:
|
|
886
|
-
disabled:
|
|
887
|
-
onClick: () =>
|
|
888
|
-
className: n && !(
|
|
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 && !
|
|
895
|
+
}), a.allowText && !v && /* @__PURE__ */ H("button", {
|
|
896
896
|
type: "button",
|
|
897
|
-
onClick: () =>
|
|
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 && (
|
|
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(
|
|
904
|
+
children: [/* @__PURE__ */ H(k, {
|
|
905
905
|
value: "",
|
|
906
906
|
onChange: m,
|
|
907
|
-
onSubmit: () => p.trim() &&
|
|
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
|
-
},
|
|
911
|
+
autofocus: v
|
|
912
|
+
}, h), /* @__PURE__ */ U("div", {
|
|
913
913
|
className: "flex justify-end gap-2",
|
|
914
|
-
children: [
|
|
914
|
+
children: [v && !x && /* @__PURE__ */ H(A, {
|
|
915
915
|
size: "sm",
|
|
916
916
|
variant: "ghost",
|
|
917
|
-
onClick: () =>
|
|
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:
|
|
924
|
-
onClick: () =>
|
|
923
|
+
loading: C.isPending,
|
|
924
|
+
onClick: () => C.mutate(void 0),
|
|
925
925
|
children: c("answer")
|
|
926
926
|
})]
|
|
927
927
|
})]
|
|
928
928
|
}),
|
|
929
|
-
|
|
929
|
+
C.isError && /* @__PURE__ */ H(ae, {
|
|
930
930
|
className: "mt-2",
|
|
931
|
-
children: s(
|
|
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(
|
|
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:
|
|
957
|
+
doc: v(a)
|
|
958
958
|
},
|
|
959
959
|
className: "flex min-w-0 items-center gap-1 hover:text-foreground",
|
|
960
|
-
children: [/* @__PURE__ */ H(
|
|
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(
|
|
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 =
|
|
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 =
|
|
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:
|
|
1077
|
+
onClick: C
|
|
1078
1078
|
}],
|
|
1079
|
-
...
|
|
1079
|
+
...ee,
|
|
1080
1080
|
oe,
|
|
1081
1081
|
...p(n(e, t.identifier))
|
|
1082
|
-
]),
|
|
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:
|
|
1134
|
+
onClick: C,
|
|
1135
1135
|
children: l("saveAsDecision")
|
|
1136
1136
|
})
|
|
1137
1137
|
}),
|
|
1138
|
-
|
|
1138
|
+
g && /* @__PURE__ */ H(ce, { children: /* @__PURE__ */ H(w, {
|
|
1139
1139
|
workspace: e,
|
|
1140
1140
|
mode: {
|
|
1141
1141
|
kind: "create",
|
|
1142
|
-
defaults:
|
|
1142
|
+
defaults: h(t, (e) => l("decisionDefinition", e))
|
|
1143
1143
|
},
|
|
1144
|
-
onClose: () =>
|
|
1144
|
+
onClose: () => v(!1)
|
|
1145
1145
|
}) })
|
|
1146
1146
|
] });
|
|
1147
1147
|
return s ? /* @__PURE__ */ H("article", {
|
|
1148
|
-
onContextMenu:
|
|
1148
|
+
onContextMenu: E,
|
|
1149
1149
|
"aria-label": l("answeredLabel"),
|
|
1150
1150
|
className: "text-sm",
|
|
1151
|
-
children:
|
|
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:
|
|
1156
|
+
onContextMenu: E,
|
|
1157
1157
|
"aria-label": l("answeredLabel")
|
|
1158
1158
|
}),
|
|
1159
|
-
children:
|
|
1159
|
+
children: ne
|
|
1160
1160
|
});
|
|
1161
1161
|
}
|
|
1162
1162
|
export { _e as AgentWork, ke as AnsweredDecision, $ as DecisionCard, ge as useMoney, q as useOptionLabel };
|