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