@parallelworks/tandem-web 0.177.0 → 0.178.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_virtual/_virtual_i18n/en/common.js +4 -1
- package/_virtual/_virtual_i18n/es/common.js +4 -1
- package/_virtual/_virtual_i18n/ja/common.js +4 -1
- package/_virtual/_virtual_i18n/ko/common.js +4 -1
- package/_virtual/_virtual_i18n/zh/common.js +4 -1
- package/components/AgentWork.js +275 -263
- package/package.json +1 -1
- package/routes/_workspace/settings/runners2.js +104 -74
package/package.json
CHANGED
|
@@ -1,53 +1,67 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../../../api/client.js";
|
|
2
|
-
import { runnersQuery as n } from "../../../api/queries.js";
|
|
3
|
-
import { ComputeTargets as
|
|
4
|
-
import { InlineCommand as
|
|
5
|
-
import { WorkerIcon as
|
|
6
|
-
import { SettingsPage as
|
|
7
|
-
import { useConfirm as
|
|
8
|
-
import { copyItem as
|
|
9
|
-
import {
|
|
2
|
+
import { runnersQuery as n, workspaceRunsQuery as r } from "../../../api/queries.js";
|
|
3
|
+
import { ComputeTargets as i } from "../../../components/ComputeTargets.js";
|
|
4
|
+
import { InlineCommand as a } from "../../../components/InlineCommand.js";
|
|
5
|
+
import { WorkerIcon as o } from "../../../components/icons.js";
|
|
6
|
+
import { SettingsPage as s } from "../../../components/settings.js";
|
|
7
|
+
import { useConfirm as c } from "../../../lib/confirm.js";
|
|
8
|
+
import { copyItem as l } from "../../../lib/menus.js";
|
|
9
|
+
import { Link as ee } from "../../../lib/router.js";
|
|
10
|
+
import { useTime as te } from "../../../lib/time.js";
|
|
10
11
|
import { Route as u } from "./runners.js";
|
|
11
|
-
import { Callout as d, StatusDot as f, Table as p, menuDivider as m, useOpenMenu as
|
|
12
|
-
import { useMemo as
|
|
13
|
-
import { useFormatter as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import { useMutation as
|
|
16
|
-
import { ListCellText as
|
|
12
|
+
import { Callout as d, StatusDot as f, Table as p, menuDivider as m, useOpenMenu as ne } from "@parallelworks/ui";
|
|
13
|
+
import { useMemo as h } from "react";
|
|
14
|
+
import { useFormatter as g, useTranslations as _ } from "use-intl";
|
|
15
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
16
|
+
import { useMutation as re, useQuery as ie, useQueryClient as ae, useSuspenseQuery as b } from "@tanstack/react-query";
|
|
17
|
+
import { ListCellText as x, ListColumns as S, ListPage as C, ListRow as w, ListToolbar as T, NameCell as E, listTableProps as D, useListNavigate as O, useListSearch as k, useListView as A } from "@parallelworks/ui/list";
|
|
17
18
|
// src/routes/$workspace/settings/runners.tsx?tsr-split=component
|
|
18
|
-
var
|
|
19
|
+
var j = {
|
|
19
20
|
default: "runnerModeDefault",
|
|
20
21
|
"accept-edits": "runnerModeAcceptEdits",
|
|
21
22
|
auto: "runnerModeAuto",
|
|
22
23
|
bypass: "runnerModeBypass"
|
|
23
24
|
};
|
|
24
|
-
function
|
|
25
|
+
function M() {
|
|
25
26
|
let { workspace: e } = u.useParams();
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ v(N, { workspace: e });
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
let { data:
|
|
29
|
+
function N({ workspace: u }) {
|
|
30
|
+
let { data: M } = b(n(u)), { data: N = [] } = ie(r(u, {
|
|
31
|
+
live: !0,
|
|
32
|
+
limit: 200
|
|
33
|
+
})), P = /* @__PURE__ */ new Map();
|
|
34
|
+
for (let e of N) e.state === "working" && e.runnerId && P.set(e.runnerId, [...P.get(e.runnerId) ?? [], e]);
|
|
35
|
+
let F = _("account"), I = g(), L = _("common"), R = te(), z = ae(), B = k(), V = O(), H = ne(), U = re({
|
|
30
36
|
mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/runners/{runnerId}", { params: { path: {
|
|
31
37
|
workspace: u,
|
|
32
38
|
runnerId: n
|
|
33
39
|
} } })),
|
|
34
40
|
onSettled: () => z.invalidateQueries({ queryKey: n(u).queryKey })
|
|
35
|
-
}), { confirm: W, dialog: G } =
|
|
41
|
+
}), { confirm: W, dialog: G } = c(), K = (e) => W({
|
|
36
42
|
title: F("revokeRunnerTitle"),
|
|
37
43
|
description: F("revokeRunnerDescription", { name: e.name }),
|
|
38
44
|
confirmLabel: F("revoke"),
|
|
39
45
|
onConfirm: () => U.mutateAsync(e.id)
|
|
40
|
-
}), q =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
}), q = h(() => [
|
|
47
|
+
{
|
|
48
|
+
key: "name",
|
|
49
|
+
label: L("name"),
|
|
50
|
+
headerClassName: "py-2",
|
|
51
|
+
alwaysVisible: !0
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
key: "working",
|
|
55
|
+
label: F("runnerColWorking"),
|
|
56
|
+
headerClassName: "py-2 w-48"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: "seen",
|
|
60
|
+
label: F("runnerColSeen"),
|
|
61
|
+
headerClassName: "py-2 w-40",
|
|
62
|
+
align: "end"
|
|
63
|
+
}
|
|
64
|
+
], [F, L]), J = h(() => [{
|
|
51
65
|
value: "name",
|
|
52
66
|
label: L("name"),
|
|
53
67
|
compare: (e, t) => e.name.localeCompare(t.name)
|
|
@@ -55,31 +69,31 @@ function F({ workspace: u }) {
|
|
|
55
69
|
value: "seen",
|
|
56
70
|
label: F("runnerColSeen"),
|
|
57
71
|
compare: (e, t) => (t.lastSeenAt ?? "").localeCompare(e.lastSeenAt ?? "")
|
|
58
|
-
}], [F, L]), Y =
|
|
72
|
+
}], [F, L]), Y = A({
|
|
59
73
|
storageKey: `tandem-runners-${u}`,
|
|
60
74
|
defaultShowColumnHeaders: !1,
|
|
61
75
|
columns: q,
|
|
62
76
|
orderBys: J,
|
|
63
77
|
defaultOrderBy: "name",
|
|
64
78
|
facets: []
|
|
65
|
-
}), X = B.filter.trim().toLowerCase(), Z =
|
|
79
|
+
}), X = B.filter.trim().toLowerCase(), Z = M.filter((e) => !X || [
|
|
66
80
|
e.name,
|
|
67
81
|
e.group ?? "",
|
|
68
82
|
...e.harnesses,
|
|
69
83
|
...e.labels
|
|
70
|
-
].some((e) => e.toLowerCase().includes(X))), Q =
|
|
71
|
-
return /* @__PURE__ */
|
|
84
|
+
].some((e) => e.toLowerCase().includes(X))), Q = M.filter((e) => e.sharingRefused), $ = M.filter((e) => e.sharingUnchecked);
|
|
85
|
+
return /* @__PURE__ */ y(s, {
|
|
72
86
|
wide: !0,
|
|
73
87
|
title: F("runners"),
|
|
74
|
-
description: F.rich("runnersDescription", { code: (e) => /* @__PURE__ */
|
|
75
|
-
toolbar:
|
|
88
|
+
description: F.rich("runnersDescription", { code: (e) => /* @__PURE__ */ v(a, { children: e }) }),
|
|
89
|
+
toolbar: M.length > 0 && /* @__PURE__ */ v(T, {
|
|
76
90
|
view: Y,
|
|
77
91
|
search: B,
|
|
78
92
|
searchLabel: F("runnerSearch"),
|
|
79
93
|
searchPlaceholder: F("runnerSearch")
|
|
80
94
|
}),
|
|
81
95
|
children: [
|
|
82
|
-
Q.length > 0 && /* @__PURE__ */
|
|
96
|
+
Q.length > 0 && /* @__PURE__ */ v(d, {
|
|
83
97
|
tone: "warning",
|
|
84
98
|
className: "mb-6",
|
|
85
99
|
children: F("runnerSharingRefused", {
|
|
@@ -87,7 +101,7 @@ function F({ workspace: u }) {
|
|
|
87
101
|
names: I.list(Q.map((e) => e.name), { type: "conjunction" })
|
|
88
102
|
})
|
|
89
103
|
}),
|
|
90
|
-
$.length > 0 && /* @__PURE__ */
|
|
104
|
+
$.length > 0 && /* @__PURE__ */ v(d, {
|
|
91
105
|
tone: "muted",
|
|
92
106
|
className: "mb-6",
|
|
93
107
|
children: F("runnerSharingUnchecked", {
|
|
@@ -95,11 +109,11 @@ function F({ workspace: u }) {
|
|
|
95
109
|
names: I.list($.map((e) => e.name), { type: "conjunction" })
|
|
96
110
|
})
|
|
97
111
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ v("div", {
|
|
99
113
|
className: "border-t border-border",
|
|
100
|
-
children: /* @__PURE__ */
|
|
114
|
+
children: /* @__PURE__ */ v(C, {
|
|
101
115
|
view: Y,
|
|
102
|
-
total:
|
|
116
|
+
total: M.length,
|
|
103
117
|
matches: Z.length,
|
|
104
118
|
count: {
|
|
105
119
|
filterActive: B.filter.trim() !== "",
|
|
@@ -107,19 +121,19 @@ function F({ workspace: u }) {
|
|
|
107
121
|
nounPlural: F("runnerNounPlural")
|
|
108
122
|
},
|
|
109
123
|
empty: {
|
|
110
|
-
icon: /* @__PURE__ */
|
|
124
|
+
icon: /* @__PURE__ */ v(o, {}),
|
|
111
125
|
title: F("noRunners")
|
|
112
126
|
},
|
|
113
127
|
noMatches: F("runnerNoMatches"),
|
|
114
|
-
children: /* @__PURE__ */
|
|
115
|
-
...
|
|
116
|
-
children: [/* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ y(p, {
|
|
129
|
+
...D,
|
|
130
|
+
children: [/* @__PURE__ */ v(S, { view: Y }), Y.applyOrder(Z).map((e) => /* @__PURE__ */ y(w, {
|
|
117
131
|
href: null,
|
|
118
132
|
goTo: V,
|
|
119
133
|
openMenu: H,
|
|
120
134
|
items: [
|
|
121
|
-
|
|
122
|
-
|
|
135
|
+
l(F("copyRunnerId"), e.id),
|
|
136
|
+
l(L("copyName"), e.name),
|
|
123
137
|
m,
|
|
124
138
|
{
|
|
125
139
|
label: F("revoke"),
|
|
@@ -127,37 +141,53 @@ function F({ workspace: u }) {
|
|
|
127
141
|
onClick: () => K(e)
|
|
128
142
|
}
|
|
129
143
|
],
|
|
130
|
-
children: [
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
className: "
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ v(E, {
|
|
146
|
+
icon: /* @__PURE__ */ v(o, {}),
|
|
147
|
+
iconTile: !0,
|
|
148
|
+
name: e.name,
|
|
149
|
+
subtitle: I.list([
|
|
150
|
+
...e.group ? [F("runnerSharedWith", { group: e.group })] : [],
|
|
151
|
+
...e.sharingRefused ? [F("runnerNotTakingRuns")] : [],
|
|
152
|
+
...e.sharingUnchecked ? [F("runnerSharingUnknown")] : [],
|
|
153
|
+
...e.permissionMode ? [F(j[e.permissionMode])] : [],
|
|
154
|
+
...e.harnesses,
|
|
155
|
+
...e.labels
|
|
156
|
+
], { type: "unit" }),
|
|
157
|
+
href: null
|
|
158
|
+
}),
|
|
159
|
+
Y.isVisible("working") && /* @__PURE__ */ v(p.Item, {
|
|
160
|
+
className: "py-2.5",
|
|
161
|
+
children: /* @__PURE__ */ v(x, { children: (P.get(e.id) ?? []).length > 0 ? (P.get(e.id) ?? []).map((e, t) => /* @__PURE__ */ y("span", { children: [t > 0 && ", ", /* @__PURE__ */ v(ee, {
|
|
162
|
+
to: "/$workspace/issues/$identifier",
|
|
163
|
+
params: {
|
|
164
|
+
workspace: u,
|
|
165
|
+
identifier: e.identifier
|
|
166
|
+
},
|
|
167
|
+
className: "hover:underline",
|
|
168
|
+
title: e.issueTitle,
|
|
169
|
+
children: e.identifier
|
|
170
|
+
})] }, e.id)) : F("runnerIdle") })
|
|
171
|
+
}),
|
|
172
|
+
Y.isVisible("seen") && /* @__PURE__ */ y(p.Item, {
|
|
173
|
+
className: "py-2.5",
|
|
174
|
+
children: [/* @__PURE__ */ v(x, { children: e.lastSeenAt ? F("runnerSeen", { seen: R.relative(e.lastSeenAt) }) : F("runnerNeverConnected") }), e.isolation && /* @__PURE__ */ y("span", {
|
|
175
|
+
className: "flex items-center justify-end gap-1.5 text-xs text-muted-foreground",
|
|
176
|
+
title: e.isolation.failures.join("\n") || void 0,
|
|
177
|
+
children: [/* @__PURE__ */ v(f, {
|
|
178
|
+
variant: e.isolation.passed ? "success" : "error",
|
|
179
|
+
size: 8
|
|
180
|
+
}), e.isolation.passed ? F("runnerIsolated") : F("runnerNotIsolated", { count: e.isolation.failures.length })]
|
|
181
|
+
})]
|
|
182
|
+
})
|
|
183
|
+
]
|
|
154
184
|
}, e.id))]
|
|
155
185
|
})
|
|
156
186
|
})
|
|
157
187
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ v(i, { workspace: u }),
|
|
159
189
|
G
|
|
160
190
|
]
|
|
161
191
|
});
|
|
162
192
|
}
|
|
163
|
-
export {
|
|
193
|
+
export { M as component };
|