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