@parallelworks/tandem-web 0.139.0 → 0.139.1
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/AppRoot.js +9 -8
- package/components/settings.js +10 -10
- package/hostedApp.js +47 -45
- package/lib/pageTitle.js +22 -10
- package/package.json +1 -1
- package/pages/areas.js +112 -112
- package/pages/decisions.js +36 -36
- package/pages/issues.js +34 -34
- package/pages/projects.js +109 -109
- package/pages/triage.js +64 -64
- package/routes/_workspace/agents/_slug2.js +21 -21
- package/routes/_workspace/agents/index2.js +16 -16
- package/routes/_workspace/areas/_area2.js +105 -105
- package/routes/_workspace/docs/_doc2.js +185 -185
- package/routes/_workspace/graph3.js +8 -8
- package/routes/_workspace/issues/_identifier2.js +484 -484
- package/routes/_workspace/knowledge/_term2.js +166 -166
- package/routes/_workspace/knowledge/index2.js +33 -33
- package/routes/_workspace/measures3.js +18 -18
- package/routes/_workspace/notifications2.js +112 -112
- package/routes/_workspace/people/_username2.js +36 -36
- package/routes/_workspace/projects/_projectId3.js +215 -215
- package/routes/_workspace/teams/_key/cycles/_number2.js +16 -16
- package/routes/_workspace/teams/_key/cycles/index2.js +38 -38
- package/routes/_workspace/teams/_key/settings2.js +131 -131
- package/routes/docs/route2.js +5 -5
- package/routes/new2.js +8 -8
- package/routes/request2._token.js +4 -4
package/pages/triage.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 {
|
|
2
|
+
import { usePageTitle as n } from "../lib/pageTitle.js";
|
|
3
|
+
import { Link as r, useNavigate as i } from "../lib/router.js";
|
|
4
|
+
import { issueQuery as a, teamsQuery as o } from "../api/queries.js";
|
|
5
|
+
import { triageQuery as s } from "../lib/triage.js";
|
|
6
|
+
import { PriorityIcon as c, StatusIcon as l, TriageIcon as u, usePriorityNames as d } from "../components/icons.js";
|
|
7
|
+
import { useTime as f } from "../lib/time.js";
|
|
8
|
+
import { usePeople as p } from "../lib/people.js";
|
|
9
9
|
import { useCanTriage as m } from "../lib/roles.js";
|
|
10
10
|
import { EntityIcon as h } from "../components/EntityIcon.js";
|
|
11
11
|
import { actorAvatar as g } from "../lib/avatar.js";
|
|
@@ -20,11 +20,11 @@ import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
|
20
20
|
import { useMutation as F, useQuery as I, useQueryClient as L, useSuspenseQuery as R } from "@tanstack/react-query";
|
|
21
21
|
// src/pages/triage.tsx
|
|
22
22
|
function z() {
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
let
|
|
23
|
+
let r = j("triage"), { workspace: a, key: o } = w({ strict: !1 }), { issue: c } = T({ strict: !1 }), { data: l } = R(s(a, o));
|
|
24
|
+
n(r("title"));
|
|
25
|
+
let d = l.issues, f = A(), p = L(), [m, h] = k(/* @__PURE__ */ new Set()), [g, _] = k(/* @__PURE__ */ new Set()), y = E((e, t) => {
|
|
26
26
|
h((n) => n.has(e) === t ? n : t ? new Set(n).add(e) : V(n, e));
|
|
27
|
-
}, []), S =
|
|
27
|
+
}, []), S = d.filter((e) => m.has(e.id)), M = S.filter((e) => g.has(e.id)), I = i(), z = d.findIndex((e) => e.identifier === c?.toUpperCase()), W = O(null), G = d[z], K = (e) => I({
|
|
28
28
|
to: ".",
|
|
29
29
|
search: e ? { issue: e.identifier.toLowerCase() } : {},
|
|
30
30
|
replace: !0
|
|
@@ -32,17 +32,17 @@ function z() {
|
|
|
32
32
|
m.has(e.id) && _((t) => t.has(e.id) ? V(t, e.id) : new Set(t).add(e.id));
|
|
33
33
|
}, J = (e, t) => {
|
|
34
34
|
let [n, r] = e < t ? [e, t] : [t, e];
|
|
35
|
-
_(new Set(
|
|
35
|
+
_(new Set(d.slice(n, r + 1).filter((e) => m.has(e.id)).map((e) => e.id)));
|
|
36
36
|
}, Y = (e, t) => {
|
|
37
|
-
let n =
|
|
37
|
+
let n = d[t];
|
|
38
38
|
n && (e.metaKey || e.ctrlKey ? (e.preventDefault(), q(n), W.current = t) : e.shiftKey && (e.preventDefault(), J(W.current ?? (z >= 0 ? z : t), t)));
|
|
39
39
|
}, X = (e, t) => {
|
|
40
|
-
if (
|
|
41
|
-
let n = z < 0 ? 0 : Math.min(Math.max(z + e, 0),
|
|
42
|
-
t && ((W.current === null || g.size === 0) && (W.current = Math.max(z, 0)), J(W.current, n)), K(
|
|
40
|
+
if (d.length === 0) return;
|
|
41
|
+
let n = z < 0 ? 0 : Math.min(Math.max(z + e, 0), d.length - 1);
|
|
42
|
+
t && ((W.current === null || g.size === 0) && (W.current = Math.max(z, 0)), J(W.current, n)), K(d[n]);
|
|
43
43
|
}, Z = (e) => {
|
|
44
|
-
let t =
|
|
45
|
-
e.id === G?.id && K(
|
|
44
|
+
let t = d.findIndex((t) => t.id === e.id);
|
|
45
|
+
e.id === G?.id && K(d[t + 1] ?? d[t - 1]);
|
|
46
46
|
};
|
|
47
47
|
v({
|
|
48
48
|
j: () => X(1, !1),
|
|
@@ -57,7 +57,7 @@ function z() {
|
|
|
57
57
|
Enter: () => G && I({
|
|
58
58
|
to: "/$workspace/issues/$identifier",
|
|
59
59
|
params: {
|
|
60
|
-
workspace:
|
|
60
|
+
workspace: a,
|
|
61
61
|
identifier: G.identifier
|
|
62
62
|
}
|
|
63
63
|
}),
|
|
@@ -69,7 +69,7 @@ function z() {
|
|
|
69
69
|
let Q = F({
|
|
70
70
|
mutationFn: async (n) => (await Promise.allSettled(M.map(async (r) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
|
|
71
71
|
params: { path: {
|
|
72
|
-
workspace:
|
|
72
|
+
workspace: a,
|
|
73
73
|
identifier: r.identifier
|
|
74
74
|
} },
|
|
75
75
|
body: { decision: n }
|
|
@@ -77,18 +77,18 @@ function z() {
|
|
|
77
77
|
onSuccess: (e) => {
|
|
78
78
|
if (G && g.has(G.id)) {
|
|
79
79
|
let e = (e) => !g.has(e.id);
|
|
80
|
-
K(
|
|
80
|
+
K(d.slice(z + 1).find(e) ?? d.slice(0, z).findLast(e));
|
|
81
81
|
}
|
|
82
82
|
_(/* @__PURE__ */ new Set());
|
|
83
83
|
let t = e[0];
|
|
84
|
-
t && C.error(
|
|
84
|
+
t && C.error(r("bulkFailed", {
|
|
85
85
|
count: e.length,
|
|
86
|
-
reason:
|
|
86
|
+
reason: f(t.reason)
|
|
87
87
|
}));
|
|
88
88
|
},
|
|
89
|
-
onSettled: () =>
|
|
89
|
+
onSettled: () => p.invalidateQueries({ queryKey: [
|
|
90
90
|
"workspace",
|
|
91
|
-
|
|
91
|
+
a,
|
|
92
92
|
"issues"
|
|
93
93
|
] })
|
|
94
94
|
});
|
|
@@ -99,66 +99,66 @@ function z() {
|
|
|
99
99
|
children: [
|
|
100
100
|
/* @__PURE__ */ N("h1", {
|
|
101
101
|
className: "text-sm font-semibold",
|
|
102
|
-
children:
|
|
102
|
+
children: r("title")
|
|
103
103
|
}),
|
|
104
104
|
/* @__PURE__ */ N("span", {
|
|
105
105
|
className: "text-xs text-muted-foreground tabular-nums",
|
|
106
|
-
children:
|
|
106
|
+
children: d.length
|
|
107
107
|
}),
|
|
108
108
|
M.length > 0 && /* @__PURE__ */ P("div", {
|
|
109
109
|
className: "ml-auto flex items-center gap-2",
|
|
110
110
|
children: [
|
|
111
111
|
/* @__PURE__ */ N("span", {
|
|
112
112
|
className: "text-xs font-medium text-human",
|
|
113
|
-
children:
|
|
113
|
+
children: r("selected", { count: M.length })
|
|
114
114
|
}),
|
|
115
115
|
M.length < S.length && /* @__PURE__ */ N("button", {
|
|
116
116
|
type: "button",
|
|
117
117
|
onClick: () => _(new Set(S.map((e) => e.id))),
|
|
118
118
|
className: "text-xs hover:underline",
|
|
119
|
-
children:
|
|
119
|
+
children: r("selectAll")
|
|
120
120
|
}),
|
|
121
121
|
/* @__PURE__ */ N("button", {
|
|
122
122
|
type: "button",
|
|
123
123
|
onClick: () => _(/* @__PURE__ */ new Set()),
|
|
124
124
|
className: "text-xs hover:underline",
|
|
125
|
-
children:
|
|
125
|
+
children: r("clear")
|
|
126
126
|
}),
|
|
127
127
|
/* @__PURE__ */ N(b, {
|
|
128
128
|
variant: "outline",
|
|
129
129
|
size: "sm",
|
|
130
|
-
title:
|
|
130
|
+
title: r("declineHelp"),
|
|
131
131
|
loading: Q.isPending && Q.variables === "decline",
|
|
132
132
|
disabled: Q.isPending,
|
|
133
133
|
onClick: () => Q.mutate("decline"),
|
|
134
|
-
children:
|
|
134
|
+
children: r("declineCount", { count: M.length })
|
|
135
135
|
}),
|
|
136
136
|
/* @__PURE__ */ N(b, {
|
|
137
137
|
variant: "primary",
|
|
138
138
|
size: "sm",
|
|
139
|
-
title:
|
|
139
|
+
title: r("acceptHelp"),
|
|
140
140
|
loading: Q.isPending && Q.variables === "accept",
|
|
141
141
|
disabled: Q.isPending,
|
|
142
142
|
onClick: () => Q.mutate("accept"),
|
|
143
|
-
children:
|
|
143
|
+
children: r("acceptCount", { count: M.length })
|
|
144
144
|
})
|
|
145
145
|
]
|
|
146
146
|
})
|
|
147
147
|
]
|
|
148
|
-
}),
|
|
148
|
+
}), d.length === 0 ? /* @__PURE__ */ N("div", {
|
|
149
149
|
className: "min-h-0 flex-1 overflow-y-auto p-6",
|
|
150
150
|
children: /* @__PURE__ */ N(x, {
|
|
151
|
-
icon: /* @__PURE__ */ N(
|
|
152
|
-
title:
|
|
153
|
-
description:
|
|
151
|
+
icon: /* @__PURE__ */ N(u, {}),
|
|
152
|
+
title: r("empty"),
|
|
153
|
+
description: r("emptyDescription")
|
|
154
154
|
})
|
|
155
155
|
}) : /* @__PURE__ */ P("div", {
|
|
156
156
|
className: "flex min-h-0 flex-1",
|
|
157
157
|
children: [/* @__PURE__ */ N("ul", {
|
|
158
|
-
"aria-label":
|
|
158
|
+
"aria-label": r("title"),
|
|
159
159
|
className: B("min-h-0 min-w-0 flex-1 flex-col overflow-y-auto px-2 py-2 md:flex md:max-w-md md:border-r md:border-border", G ? "hidden" : "flex"),
|
|
160
|
-
children:
|
|
161
|
-
workspace:
|
|
160
|
+
children: d.map((e, t) => /* @__PURE__ */ N(H, {
|
|
161
|
+
workspace: a,
|
|
162
162
|
issue: e,
|
|
163
163
|
onEligible: y,
|
|
164
164
|
picked: g.has(e.id) && m.has(e.id),
|
|
@@ -168,15 +168,15 @@ function z() {
|
|
|
168
168
|
}), /* @__PURE__ */ N("div", {
|
|
169
169
|
className: B("min-w-0 flex-1 overflow-y-auto md:block", G ? "block" : "hidden"),
|
|
170
170
|
children: G ? /* @__PURE__ */ N(U, {
|
|
171
|
-
workspace:
|
|
171
|
+
workspace: a,
|
|
172
172
|
issue: G,
|
|
173
173
|
onBack: () => K(void 0),
|
|
174
174
|
onDecided: Z
|
|
175
175
|
}, G.id) : /* @__PURE__ */ N("div", {
|
|
176
176
|
className: "px-6 py-24",
|
|
177
177
|
children: /* @__PURE__ */ N(x, {
|
|
178
|
-
title:
|
|
179
|
-
description:
|
|
178
|
+
title: r("noneSelected"),
|
|
179
|
+
description: r("shortcuts")
|
|
180
180
|
})
|
|
181
181
|
})
|
|
182
182
|
})]
|
|
@@ -188,18 +188,18 @@ function V(e, t) {
|
|
|
188
188
|
let n = new Set(e);
|
|
189
189
|
return n.delete(t), n;
|
|
190
190
|
}
|
|
191
|
-
function H({ workspace: e, issue: t, onEligible:
|
|
192
|
-
let s = j("triage"), c =
|
|
193
|
-
D(() =>
|
|
194
|
-
|
|
191
|
+
function H({ workspace: e, issue: t, onEligible: n, picked: i, current: a, onClick: o }) {
|
|
192
|
+
let s = j("triage"), c = f(), { actorName: l, avatarOf: u } = p(e), d = m(e, t.teamId);
|
|
193
|
+
D(() => n(t.id, d), [
|
|
194
|
+
n,
|
|
195
195
|
t.id,
|
|
196
|
-
|
|
196
|
+
d
|
|
197
197
|
]);
|
|
198
198
|
let h = t.creator;
|
|
199
199
|
return /* @__PURE__ */ N("li", {
|
|
200
200
|
id: `triage-${t.id}`,
|
|
201
201
|
"data-picked": i || void 0,
|
|
202
|
-
children: /* @__PURE__ */ P(
|
|
202
|
+
children: /* @__PURE__ */ P(r, {
|
|
203
203
|
to: ".",
|
|
204
204
|
search: { issue: t.identifier.toLowerCase() },
|
|
205
205
|
replace: !0,
|
|
@@ -242,19 +242,19 @@ function H({ workspace: e, issue: t, onEligible: r, picked: i, current: a, onCli
|
|
|
242
242
|
})
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
function U({ workspace:
|
|
246
|
-
let v = j("triage"), x =
|
|
247
|
-
mutationFn: async (
|
|
245
|
+
function U({ workspace: n, issue: i, onBack: s, onDecided: u }) {
|
|
246
|
+
let v = j("triage"), x = f(), C = A(), w = L(), T = d(), { data: E } = R(o(n)), { data: D } = I(a(n, i.identifier)), O = D ?? i, { actorName: k, avatarOf: z } = p(n), B = E.find((e) => e.id === O.teamId), V = m(n, O.teamId), H = F({
|
|
247
|
+
mutationFn: async (r) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
|
|
248
248
|
params: { path: {
|
|
249
|
-
workspace:
|
|
249
|
+
workspace: n,
|
|
250
250
|
identifier: O.identifier
|
|
251
251
|
} },
|
|
252
|
-
body: { decision:
|
|
252
|
+
body: { decision: r }
|
|
253
253
|
})),
|
|
254
254
|
onSuccess: () => {
|
|
255
|
-
|
|
255
|
+
u(i), w.invalidateQueries({ queryKey: [
|
|
256
256
|
"workspace",
|
|
257
|
-
|
|
257
|
+
n,
|
|
258
258
|
"issues"
|
|
259
259
|
] });
|
|
260
260
|
}
|
|
@@ -264,7 +264,7 @@ function U({ workspace: r, issue: o, onBack: l, onDecided: p }) {
|
|
|
264
264
|
children: [
|
|
265
265
|
/* @__PURE__ */ N("button", {
|
|
266
266
|
type: "button",
|
|
267
|
-
onClick:
|
|
267
|
+
onClick: s,
|
|
268
268
|
className: "mb-3 text-xs text-muted-foreground hover:text-foreground md:hidden",
|
|
269
269
|
children: v("back")
|
|
270
270
|
}),
|
|
@@ -307,10 +307,10 @@ function U({ workspace: r, issue: o, onBack: l, onDecided: p }) {
|
|
|
307
307
|
}),
|
|
308
308
|
/* @__PURE__ */ N("h2", {
|
|
309
309
|
className: "mt-1 text-xl font-semibold text-balance",
|
|
310
|
-
children: /* @__PURE__ */ N(
|
|
310
|
+
children: /* @__PURE__ */ N(r, {
|
|
311
311
|
to: "/$workspace/issues/$identifier",
|
|
312
312
|
params: {
|
|
313
|
-
workspace:
|
|
313
|
+
workspace: n,
|
|
314
314
|
identifier: O.identifier
|
|
315
315
|
},
|
|
316
316
|
className: "hover:underline",
|
|
@@ -335,10 +335,10 @@ function U({ workspace: r, issue: o, onBack: l, onDecided: p }) {
|
|
|
335
335
|
disabled: H.isPending,
|
|
336
336
|
onClick: () => H.mutate("decline"),
|
|
337
337
|
children: v("decline")
|
|
338
|
-
})] }), /* @__PURE__ */ N(
|
|
338
|
+
})] }), /* @__PURE__ */ N(r, {
|
|
339
339
|
to: "/$workspace/issues/$identifier",
|
|
340
340
|
params: {
|
|
341
|
-
workspace:
|
|
341
|
+
workspace: n,
|
|
342
342
|
identifier: O.identifier
|
|
343
343
|
},
|
|
344
344
|
className: S({
|
|
@@ -361,11 +361,11 @@ function U({ workspace: r, issue: o, onBack: l, onDecided: p }) {
|
|
|
361
361
|
children: [
|
|
362
362
|
/* @__PURE__ */ P("span", {
|
|
363
363
|
className: "inline-flex items-center gap-1.5",
|
|
364
|
-
children: [/* @__PURE__ */ N(
|
|
364
|
+
children: [/* @__PURE__ */ N(l, { category: O.status.category }), O.status.name]
|
|
365
365
|
}),
|
|
366
366
|
/* @__PURE__ */ P("span", {
|
|
367
367
|
className: "inline-flex items-center gap-1.5",
|
|
368
|
-
children: [/* @__PURE__ */ N(
|
|
368
|
+
children: [/* @__PURE__ */ N(c, { priority: O.priority }), T[O.priority]]
|
|
369
369
|
}),
|
|
370
370
|
O.labels.map((e) => /* @__PURE__ */ P("span", {
|
|
371
371
|
className: "inline-flex items-center gap-1.5",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../../../api/client.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { usePageTitle as n } from "../../../lib/pageTitle.js";
|
|
3
|
+
import { useNavigate as r } from "../../../lib/router.js";
|
|
4
|
+
import { agentQuery as i, agentsQuery as a, meQuery as o, myModelsQuery as ee } from "../../../api/queries.js";
|
|
5
|
+
import { Route as s } from "./_slug.js";
|
|
6
6
|
import { may as c } from "../../../lib/roles.js";
|
|
7
7
|
import { Editor as te } from "../../../components/Editor.js";
|
|
8
8
|
import { harnessOptions as l, runnableHarnesses as u } from "../../../lib/agents.js";
|
|
@@ -16,26 +16,26 @@ import { useMutation as b, useQuery as x, useQueryClient as se, useSuspenseQuery
|
|
|
16
16
|
// src/routes/$workspace/agents/$slug.tsx?tsr-split=component
|
|
17
17
|
var C = "block text-sm font-medium";
|
|
18
18
|
function w() {
|
|
19
|
-
let { workspace: e, slug: t } =
|
|
20
|
-
return
|
|
19
|
+
let { workspace: e, slug: t } = s.useParams(), { data: r } = S(a(e)), i = r.find((e) => e.slug === t), o = _("agent");
|
|
20
|
+
return n(i ? i.name : o("newAgent")), t !== "new" && !i ? /* @__PURE__ */ v("p", {
|
|
21
21
|
className: "p-8 text-sm text-muted-foreground",
|
|
22
|
-
children:
|
|
22
|
+
children: o("notFound")
|
|
23
23
|
}) : /* @__PURE__ */ v(E, {
|
|
24
24
|
workspace: e,
|
|
25
|
-
agent:
|
|
26
|
-
},
|
|
25
|
+
agent: i
|
|
26
|
+
}, i?.id ?? "new");
|
|
27
27
|
}
|
|
28
28
|
function T(e) {
|
|
29
29
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 63);
|
|
30
30
|
}
|
|
31
|
-
function E({ workspace:
|
|
32
|
-
let w = _("agent"), E = _("workspace"), D = oe(), O = _("common"), { data: ce } = S(
|
|
33
|
-
...
|
|
31
|
+
function E({ workspace: n, agent: s }) {
|
|
32
|
+
let w = _("agent"), E = _("workspace"), D = oe(), O = _("common"), { data: ce } = S(o), k = c(ce, n, "manage_agents"), A = se(), j = r(), [M, le] = g(s?.name ?? ""), [N, P] = g(s?.description ?? ""), [F, I] = g(s?.instructions ?? ""), [L, R] = g(s?.harness ?? "pw-code"), [z, B] = g(s?.model ?? ""), V = d(), H = x({
|
|
33
|
+
...i(n, s?.slug ?? ""),
|
|
34
34
|
enabled: !!s
|
|
35
35
|
}).data?.modeAllowed, U = x({
|
|
36
36
|
...ee,
|
|
37
37
|
enabled: L === "pw-code"
|
|
38
|
-
}).data ?? [], { data: ue } = S(
|
|
38
|
+
}).data ?? [], { data: ue } = S(a(n)), W = [...new Set(ue.filter((e) => e.harness === L && e.model && e.id !== s?.id).map((e) => e.model))].filter((e) => !U.some((t) => t.id === e)), de = [...U.map((e) => ({
|
|
39
39
|
value: e.id,
|
|
40
40
|
label: e.name || e.id,
|
|
41
41
|
...e.name && e.name !== e.id && { description: e.id }
|
|
@@ -57,12 +57,12 @@ function E({ workspace: o, agent: s }) {
|
|
|
57
57
|
}), $ = b({
|
|
58
58
|
mutationFn: async () => t(s ? await e.PUT("/api/v1/workspaces/{workspace}/agents/{slug}", {
|
|
59
59
|
params: { path: {
|
|
60
|
-
workspace:
|
|
60
|
+
workspace: n,
|
|
61
61
|
slug: s.slug
|
|
62
62
|
} },
|
|
63
63
|
body: Q()
|
|
64
64
|
}) : await e.POST("/api/v1/workspaces/{workspace}/agents", {
|
|
65
|
-
params: { path: { workspace:
|
|
65
|
+
params: { path: { workspace: n } },
|
|
66
66
|
body: {
|
|
67
67
|
slug: T(M),
|
|
68
68
|
...Q()
|
|
@@ -70,10 +70,10 @@ function E({ workspace: o, agent: s }) {
|
|
|
70
70
|
})),
|
|
71
71
|
onMutate: () => Z(null),
|
|
72
72
|
onSuccess: (e) => {
|
|
73
|
-
A.invalidateQueries({ queryKey:
|
|
73
|
+
A.invalidateQueries({ queryKey: a(n).queryKey }), ae.success(w(s ? "saved" : "created", { name: e.name })), j({
|
|
74
74
|
to: "/$workspace/agents/$slug",
|
|
75
75
|
params: {
|
|
76
|
-
workspace:
|
|
76
|
+
workspace: n,
|
|
77
77
|
slug: e.slug
|
|
78
78
|
}
|
|
79
79
|
});
|
|
@@ -81,13 +81,13 @@ function E({ workspace: o, agent: s }) {
|
|
|
81
81
|
onError: (e) => Z(D(e))
|
|
82
82
|
}), ye = b({
|
|
83
83
|
mutationFn: async () => t(await e.DELETE("/api/v1/workspaces/{workspace}/agents/{slug}", { params: { path: {
|
|
84
|
-
workspace:
|
|
84
|
+
workspace: n,
|
|
85
85
|
slug: s?.slug ?? ""
|
|
86
86
|
} } })),
|
|
87
87
|
onSuccess: () => {
|
|
88
|
-
A.invalidateQueries({ queryKey:
|
|
88
|
+
A.invalidateQueries({ queryKey: a(n).queryKey }), j({
|
|
89
89
|
to: "/$workspace/agents",
|
|
90
|
-
params: { workspace:
|
|
90
|
+
params: { workspace: n }
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
});
|
|
@@ -97,7 +97,7 @@ function E({ workspace: o, agent: s }) {
|
|
|
97
97
|
heading: !1,
|
|
98
98
|
breadcrumbs: [{
|
|
99
99
|
label: E("agents"),
|
|
100
|
-
href: `/${
|
|
100
|
+
href: `/${n}/agents`
|
|
101
101
|
}, { label: s ? s.name : w("newAgent") }]
|
|
102
102
|
}), /* @__PURE__ */ v("div", {
|
|
103
103
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
@@ -1,10 +1,10 @@
|
|
|
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 {
|
|
2
|
+
import { usePageTitle as n } from "../../../lib/pageTitle.js";
|
|
3
|
+
import { Link as r, useNavigate as i } from "../../../lib/router.js";
|
|
4
|
+
import { agentsQuery as a, meQuery as o } from "../../../api/queries.js";
|
|
5
|
+
import { Route as s } from "./index.js";
|
|
6
|
+
import { AgentIcon as c } from "../../../components/icons.js";
|
|
7
|
+
import { copyItem as l, useLinkItems as u } from "../../../lib/menus.js";
|
|
8
8
|
import { may as d } from "../../../lib/roles.js";
|
|
9
9
|
import { useConfirm as f } from "../../../lib/confirm.js";
|
|
10
10
|
import { harnessNames as p } from "../../../lib/agents.js";
|
|
@@ -14,14 +14,14 @@ import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
|
14
14
|
import { useMutation as C, useQueryClient as w, useSuspenseQuery as T } from "@tanstack/react-query";
|
|
15
15
|
// src/routes/$workspace/agents/index.tsx?tsr-split=component
|
|
16
16
|
function E() {
|
|
17
|
-
let { workspace: E } =
|
|
18
|
-
|
|
19
|
-
let { data: j } = T(
|
|
17
|
+
let { workspace: E } = s.useParams(), D = b("agents"), O = b("common"), k = u(), { data: A } = T(a(E));
|
|
18
|
+
n(D("title"));
|
|
19
|
+
let { data: j } = T(o), M = d(j, E, "manage_agents"), N = y(), P = i(), F = w(), I = C({
|
|
20
20
|
mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/agents/{slug}", { params: { path: {
|
|
21
21
|
workspace: E,
|
|
22
22
|
slug: n
|
|
23
23
|
} } })),
|
|
24
|
-
onSettled: () => F.invalidateQueries({ queryKey:
|
|
24
|
+
onSettled: () => F.invalidateQueries({ queryKey: a(E).queryKey })
|
|
25
25
|
}), { confirm: L, dialog: R } = f(), z = (e) => [
|
|
26
26
|
{
|
|
27
27
|
label: O("open"),
|
|
@@ -34,7 +34,7 @@ function E() {
|
|
|
34
34
|
})
|
|
35
35
|
},
|
|
36
36
|
...k(`/${E}/agents/${e.slug}`),
|
|
37
|
-
|
|
37
|
+
l(D("copySlug"), e.slug),
|
|
38
38
|
...M && !e.archivedAt ? [v, {
|
|
39
39
|
label: D("archive"),
|
|
40
40
|
destructive: !0,
|
|
@@ -56,13 +56,13 @@ function E() {
|
|
|
56
56
|
className: "text-xl font-semibold tracking-tight",
|
|
57
57
|
children: D("title")
|
|
58
58
|
}) }),
|
|
59
|
-
A.length > 0 && /* @__PURE__ */ x(
|
|
59
|
+
A.length > 0 && /* @__PURE__ */ x(r, {
|
|
60
60
|
to: "/$workspace/measures",
|
|
61
61
|
params: { workspace: E },
|
|
62
62
|
className: `${_()} ml-auto mr-2`,
|
|
63
63
|
children: D("measures")
|
|
64
64
|
}),
|
|
65
|
-
M && A.length > 0 && /* @__PURE__ */ x(
|
|
65
|
+
M && A.length > 0 && /* @__PURE__ */ x(r, {
|
|
66
66
|
to: "/$workspace/agents/$slug",
|
|
67
67
|
params: {
|
|
68
68
|
workspace: E,
|
|
@@ -74,10 +74,10 @@ function E() {
|
|
|
74
74
|
]
|
|
75
75
|
}),
|
|
76
76
|
A.length === 0 ? /* @__PURE__ */ x(g, {
|
|
77
|
-
icon: /* @__PURE__ */ x(
|
|
77
|
+
icon: /* @__PURE__ */ x(c, {}),
|
|
78
78
|
title: D("empty"),
|
|
79
79
|
description: D("emptyDescription"),
|
|
80
|
-
...M && { action: /* @__PURE__ */ x(
|
|
80
|
+
...M && { action: /* @__PURE__ */ x(r, {
|
|
81
81
|
to: "/$workspace/agents/$slug",
|
|
82
82
|
params: {
|
|
83
83
|
workspace: E,
|
|
@@ -94,7 +94,7 @@ function E() {
|
|
|
94
94
|
interactive: !1,
|
|
95
95
|
render: /* @__PURE__ */ x("ul", {}),
|
|
96
96
|
className: "mt-8 overflow-hidden",
|
|
97
|
-
children: A.map((e) => /* @__PURE__ */ x("li", { children: /* @__PURE__ */ S(
|
|
97
|
+
children: A.map((e) => /* @__PURE__ */ x("li", { children: /* @__PURE__ */ S(r, {
|
|
98
98
|
to: "/$workspace/agents/$slug",
|
|
99
99
|
params: {
|
|
100
100
|
workspace: E,
|