@parallelworks/tandem-web 0.178.1 → 0.179.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 +3 -15
- package/_virtual/_virtual_i18n/es/common.js +3 -15
- package/_virtual/_virtual_i18n/ja/common.js +3 -15
- package/_virtual/_virtual_i18n/ko/common.js +3 -15
- package/_virtual/_virtual_i18n/zh/common.js +3 -15
- package/components/AgentWork.js +313 -308
- package/components/AreaWork.js +38 -43
- package/components/Graph.js +1 -1
- package/components/HoverCards.js +88 -111
- package/lib/knowledge.js +0 -6
- package/lib/permissionModes.js +7 -1
- package/package.json +1 -1
- package/routes/_workspace/agents/_slug2.js +202 -194
- package/routes/_workspace/graph.js +1 -5
- package/routes/_workspace/graph2.js +16 -17
- package/routes/_workspace/graph3.js +70 -82
- package/routes/_workspace/knowledge/_term2.js +126 -130
- package/routes/_workspace/knowledge/index2.js +125 -130
|
@@ -6,303 +6,311 @@ import { RunnerBadge as u } from "../../../components/RunnerBadge.js";
|
|
|
6
6
|
import { NotFound as d } from "../../../components/status.js";
|
|
7
7
|
import { harnessOptions as ee, runnableHarnesses as f, runnersFor as p } from "../../../lib/agents.js";
|
|
8
8
|
import { usePageTitle as m } from "../../../lib/pageTitle.js";
|
|
9
|
-
import { usePermissionModeName as
|
|
10
|
-
import { may as
|
|
11
|
-
import { Link as g, useNavigate as
|
|
9
|
+
import { modeBelow as te, runnerModeCommand as ne, usePermissionModeName as re } from "../../../lib/permissionModes.js";
|
|
10
|
+
import { may as h } from "../../../lib/roles.js";
|
|
11
|
+
import { Link as g, useNavigate as ie } from "../../../lib/router.js";
|
|
12
12
|
import { Route as _ } from "./_slug.js";
|
|
13
|
-
import { Autocomplete as
|
|
14
|
-
import { useState as
|
|
15
|
-
import { useErrorMessage as
|
|
16
|
-
import { useTranslations as
|
|
17
|
-
import { jsx as
|
|
18
|
-
import { useMutation as
|
|
13
|
+
import { Autocomplete as v, Button as ae, ErrorText as y, Input as b, NumberInput as x, PageHeader as oe, RelativeTime as S, Select as C, toast as se } from "@parallelworks/ui";
|
|
14
|
+
import { useState as w } from "react";
|
|
15
|
+
import { useErrorMessage as ce } from "@parallelworks/problem/react";
|
|
16
|
+
import { useTranslations as T } from "use-intl";
|
|
17
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
18
|
+
import { useMutation as O, useQuery as k, useQueryClient as le, useSuspenseQuery as A } from "@tanstack/react-query";
|
|
19
19
|
// src/routes/$workspace/agents/$slug.tsx?tsr-split=component
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
let { workspace: e, slug: t } = _.useParams(), { data: n } =
|
|
23
|
-
return m(i ? i.name : a("newAgent")), t !== "new" && !i ? /* @__PURE__ */
|
|
20
|
+
var j = "block text-sm font-medium";
|
|
21
|
+
function M() {
|
|
22
|
+
let { workspace: e, slug: t } = _.useParams(), { data: n } = A(r(e)), i = n.find((e) => e.slug === t), a = T("agent");
|
|
23
|
+
return m(i ? i.name : a("newAgent")), t !== "new" && !i ? /* @__PURE__ */ E(d, { title: a("notFound") }) : /* @__PURE__ */ E(N, {
|
|
24
24
|
workspace: e,
|
|
25
25
|
agent: i
|
|
26
26
|
}, i?.id ?? "new");
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function ue(e) {
|
|
29
29
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 63);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
let
|
|
33
|
-
...n(
|
|
34
|
-
enabled: !!
|
|
35
|
-
}).data?.modeAllowed,
|
|
31
|
+
function N({ workspace: s, agent: l }) {
|
|
32
|
+
let u = T("agent"), d = T("workspace"), p = ce(), m = T("common"), { data: g } = A(i), _ = h(g, s, "manage_agents"), S = le(), M = ie(), [N, fe] = w(l?.name ?? ""), [P, pe] = w(l?.description ?? ""), [F, I] = w(l?.instructions ?? ""), [L, R] = w(l?.harness ?? "pw-code"), [z, me] = w(l?.model ?? ""), B = re(), he = k({
|
|
33
|
+
...n(s, l?.slug ?? ""),
|
|
34
|
+
enabled: !!l
|
|
35
|
+
}).data?.modeAllowed, V = k({
|
|
36
36
|
...a,
|
|
37
37
|
enabled: L === "pw-code"
|
|
38
|
-
}).data ?? [], { data:
|
|
38
|
+
}).data ?? [], { data: ge = [] } = k(o(s)), { data: _e } = A(r(s)), H = [...new Set(_e.filter((e) => e.harness === L && e.model && e.id !== l?.id).map((e) => e.model))].filter((e) => !V.some((t) => t.id === e)), ve = [...V.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 }
|
|
42
|
-
})), ...
|
|
43
|
-
label:
|
|
44
|
-
items:
|
|
45
|
-
}] : []], [
|
|
46
|
-
name:
|
|
47
|
-
description:
|
|
42
|
+
})), ...H.length > 0 ? [{
|
|
43
|
+
label: u("modelsInWorkspace"),
|
|
44
|
+
items: H
|
|
45
|
+
}] : []], [U, ye] = w(l?.runnerLabels.join(", ") ?? ""), [W, be] = w(l?.maxRole ?? "member"), [G, xe] = w(l?.permissionMode ?? "accept-edits"), [K, Se] = w(l?.maxTurns ?? 200), [q, J] = w(l?.maxMinutes ?? 120), [Y, Ce] = w((l?.maxCostMicros ?? 2e7) / 1e6), [we, X] = w(null), Z = () => ({
|
|
46
|
+
name: N,
|
|
47
|
+
description: P,
|
|
48
48
|
instructions: F,
|
|
49
49
|
harness: L,
|
|
50
50
|
model: z,
|
|
51
|
-
runnerLabels:
|
|
52
|
-
maxRole:
|
|
53
|
-
permissionMode:
|
|
54
|
-
maxTurns:
|
|
55
|
-
maxMinutes:
|
|
56
|
-
maxCostMicros: Math.round((
|
|
57
|
-
}),
|
|
58
|
-
mutationFn: async () => t(
|
|
51
|
+
runnerLabels: U.split(",").map((e) => e.trim()).filter(Boolean),
|
|
52
|
+
maxRole: W,
|
|
53
|
+
permissionMode: G,
|
|
54
|
+
maxTurns: K ?? 0,
|
|
55
|
+
maxMinutes: q ?? 0,
|
|
56
|
+
maxCostMicros: Math.round((Y ?? 0) * 1e6)
|
|
57
|
+
}), Q = O({
|
|
58
|
+
mutationFn: async () => t(l ? await e.PUT("/api/v1/workspaces/{workspace}/agents/{slug}", {
|
|
59
59
|
params: { path: {
|
|
60
|
-
workspace:
|
|
61
|
-
slug:
|
|
60
|
+
workspace: s,
|
|
61
|
+
slug: l.slug
|
|
62
62
|
} },
|
|
63
|
-
body:
|
|
63
|
+
body: Z()
|
|
64
64
|
}) : await e.POST("/api/v1/workspaces/{workspace}/agents", {
|
|
65
|
-
params: { path: { workspace:
|
|
65
|
+
params: { path: { workspace: s } },
|
|
66
66
|
body: {
|
|
67
|
-
slug:
|
|
68
|
-
...
|
|
67
|
+
slug: ue(N),
|
|
68
|
+
...Z()
|
|
69
69
|
}
|
|
70
70
|
})),
|
|
71
|
-
onMutate: () =>
|
|
71
|
+
onMutate: () => X(null),
|
|
72
72
|
onSuccess: (e) => {
|
|
73
|
-
|
|
73
|
+
S.invalidateQueries({ queryKey: r(s).queryKey }), se.success(u(l ? "saved" : "created", { name: e.name })), M({
|
|
74
74
|
to: "/$workspace/agents/$slug",
|
|
75
75
|
params: {
|
|
76
|
-
workspace:
|
|
76
|
+
workspace: s,
|
|
77
77
|
slug: e.slug
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
},
|
|
81
|
-
onError: (e) =>
|
|
82
|
-
}),
|
|
81
|
+
onError: (e) => X(p(e))
|
|
82
|
+
}), Te = O({
|
|
83
83
|
mutationFn: async () => t(await e.DELETE("/api/v1/workspaces/{workspace}/agents/{slug}", { params: { path: {
|
|
84
|
-
workspace:
|
|
85
|
-
slug:
|
|
84
|
+
workspace: s,
|
|
85
|
+
slug: l?.slug ?? ""
|
|
86
86
|
} } })),
|
|
87
87
|
onSuccess: () => {
|
|
88
|
-
|
|
88
|
+
S.invalidateQueries({ queryKey: r(s).queryKey }), M({
|
|
89
89
|
to: "/$workspace/agents",
|
|
90
|
-
params: { workspace:
|
|
90
|
+
params: { workspace: s }
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
});
|
|
94
|
-
return /* @__PURE__ */
|
|
93
|
+
}), $ = ge.filter((e) => e.harnesses.includes(L) && e.permissionMode && te(e.permissionMode, G));
|
|
94
|
+
return /* @__PURE__ */ D("div", {
|
|
95
95
|
className: "flex h-full min-h-0 flex-col",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ E(oe, {
|
|
97
97
|
heading: !1,
|
|
98
98
|
breadcrumbs: [{
|
|
99
|
-
label:
|
|
100
|
-
href: `/${
|
|
101
|
-
}, { label:
|
|
102
|
-
}), /* @__PURE__ */
|
|
99
|
+
label: d("agents"),
|
|
100
|
+
href: `/${s}/agents`
|
|
101
|
+
}, { label: l ? l.name : u("newAgent") }]
|
|
102
|
+
}), /* @__PURE__ */ D("div", {
|
|
103
103
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
104
|
+
children: [/* @__PURE__ */ D("form", {
|
|
105
105
|
className: "w-full space-y-6 px-4 py-6 md:px-8 md:py-8",
|
|
106
106
|
onSubmit: (e) => {
|
|
107
|
-
e.preventDefault(),
|
|
107
|
+
e.preventDefault(), Q.mutate();
|
|
108
108
|
},
|
|
109
109
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("h1", {
|
|
111
111
|
className: "text-xl font-semibold tracking-tight",
|
|
112
|
-
children:
|
|
113
|
-
}),
|
|
112
|
+
children: l ? l.name : u("newAgent")
|
|
113
|
+
}), l && /* @__PURE__ */ E("p", {
|
|
114
114
|
className: "mt-1 text-sm text-muted-foreground",
|
|
115
|
-
children:
|
|
115
|
+
children: u("version", { version: l.version })
|
|
116
116
|
})] }),
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
disabled: !
|
|
117
|
+
/* @__PURE__ */ D("fieldset", {
|
|
118
|
+
disabled: !_,
|
|
119
119
|
className: "space-y-5",
|
|
120
120
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ D("div", {
|
|
122
122
|
className: "grid gap-4 sm:grid-cols-2",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ D("label", {
|
|
124
124
|
className: "block",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
126
|
-
className:
|
|
127
|
-
children:
|
|
128
|
-
}), /* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ E("span", {
|
|
126
|
+
className: j,
|
|
127
|
+
children: m("name")
|
|
128
|
+
}), /* @__PURE__ */ E(b, {
|
|
129
129
|
required: !0,
|
|
130
|
-
value:
|
|
131
|
-
onChange: (e) =>
|
|
130
|
+
value: N,
|
|
131
|
+
onChange: (e) => fe(e.target.value),
|
|
132
132
|
className: "mt-1"
|
|
133
133
|
})]
|
|
134
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ D("div", {
|
|
135
135
|
className: "block",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
137
|
-
className:
|
|
138
|
-
children:
|
|
139
|
-
}), /* @__PURE__ */
|
|
136
|
+
children: [/* @__PURE__ */ E("span", {
|
|
137
|
+
className: j,
|
|
138
|
+
children: u("model")
|
|
139
|
+
}), /* @__PURE__ */ E(v, {
|
|
140
140
|
value: z,
|
|
141
|
-
items:
|
|
142
|
-
onValueChange:
|
|
143
|
-
placeholder:
|
|
144
|
-
"aria-label":
|
|
141
|
+
items: ve,
|
|
142
|
+
onValueChange: me,
|
|
143
|
+
placeholder: u(L === "pw-code" ? "modelPlaceholder" : "modelHarnessDefault"),
|
|
144
|
+
"aria-label": u("model"),
|
|
145
145
|
className: "mt-1"
|
|
146
146
|
})]
|
|
147
147
|
})]
|
|
148
148
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ D("label", {
|
|
150
150
|
className: "block",
|
|
151
|
-
children: [/* @__PURE__ */
|
|
152
|
-
className:
|
|
153
|
-
children:
|
|
154
|
-
}), /* @__PURE__ */
|
|
155
|
-
value:
|
|
156
|
-
onChange: (e) =>
|
|
157
|
-
placeholder:
|
|
151
|
+
children: [/* @__PURE__ */ E("span", {
|
|
152
|
+
className: j,
|
|
153
|
+
children: m("description")
|
|
154
|
+
}), /* @__PURE__ */ E(b, {
|
|
155
|
+
value: P,
|
|
156
|
+
onChange: (e) => pe(e.target.value),
|
|
157
|
+
placeholder: u("optional"),
|
|
158
158
|
className: "mt-1"
|
|
159
159
|
})]
|
|
160
160
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
className:
|
|
163
|
-
children:
|
|
164
|
-
}), /* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("span", {
|
|
162
|
+
className: j,
|
|
163
|
+
children: u("instructions")
|
|
164
|
+
}), /* @__PURE__ */ E("div", {
|
|
165
165
|
className: "mt-1 rounded-md border border-border bg-card px-3 py-2",
|
|
166
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ E(c, {
|
|
167
167
|
value: F,
|
|
168
168
|
onChange: I,
|
|
169
|
-
editable:
|
|
170
|
-
placeholder:
|
|
171
|
-
label:
|
|
169
|
+
editable: _,
|
|
170
|
+
placeholder: u("instructionsPlaceholder"),
|
|
171
|
+
label: u("instructions"),
|
|
172
172
|
className: "min-h-32"
|
|
173
173
|
})
|
|
174
174
|
})] }),
|
|
175
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ D("div", {
|
|
176
176
|
className: "flex flex-wrap items-end gap-6",
|
|
177
177
|
children: [
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
className:
|
|
180
|
-
children:
|
|
181
|
-
}), /* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("span", {
|
|
179
|
+
className: j,
|
|
180
|
+
children: u("harness")
|
|
181
|
+
}), /* @__PURE__ */ E("div", {
|
|
182
182
|
className: "mt-1",
|
|
183
|
-
children: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ E(C, {
|
|
184
184
|
value: L,
|
|
185
|
-
items: ee.filter((e) => f.includes(e.value) || e.value ===
|
|
185
|
+
items: ee.filter((e) => f.includes(e.value) || e.value === l?.harness).map((e) => f.includes(e.value) ? e : {
|
|
186
186
|
...e,
|
|
187
|
-
label:
|
|
187
|
+
label: u("harnessNoRunner", { harness: e.label })
|
|
188
188
|
}),
|
|
189
189
|
onValueChange: (e) => R(e),
|
|
190
|
-
"aria-label":
|
|
190
|
+
"aria-label": u("harness"),
|
|
191
191
|
width: "content",
|
|
192
|
-
disabled: !
|
|
192
|
+
disabled: !_
|
|
193
193
|
})
|
|
194
194
|
})] }),
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
className:
|
|
197
|
-
children:
|
|
198
|
-
}), /* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("span", {
|
|
196
|
+
className: j,
|
|
197
|
+
children: u("access")
|
|
198
|
+
}), /* @__PURE__ */ E("div", {
|
|
199
199
|
className: "mt-1",
|
|
200
|
-
children: /* @__PURE__ */
|
|
201
|
-
value:
|
|
200
|
+
children: /* @__PURE__ */ E(C, {
|
|
201
|
+
value: W,
|
|
202
202
|
items: [{
|
|
203
203
|
value: "member",
|
|
204
|
-
label:
|
|
204
|
+
label: u("accessMember")
|
|
205
205
|
}, {
|
|
206
206
|
value: "viewer",
|
|
207
|
-
label:
|
|
207
|
+
label: u("accessViewer")
|
|
208
208
|
}],
|
|
209
|
-
onValueChange: (e) =>
|
|
210
|
-
"aria-label":
|
|
209
|
+
onValueChange: (e) => be(e),
|
|
210
|
+
"aria-label": u("access"),
|
|
211
211
|
width: "content",
|
|
212
|
-
disabled: !
|
|
212
|
+
disabled: !_
|
|
213
213
|
})
|
|
214
214
|
})] }),
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
className:
|
|
217
|
-
children:
|
|
218
|
-
}), /* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("span", {
|
|
216
|
+
className: j,
|
|
217
|
+
children: u("permissionMode")
|
|
218
|
+
}), /* @__PURE__ */ E("div", {
|
|
219
219
|
className: "mt-1",
|
|
220
|
-
children: /* @__PURE__ */
|
|
221
|
-
value:
|
|
220
|
+
children: /* @__PURE__ */ E(C, {
|
|
221
|
+
value: G,
|
|
222
222
|
items: [
|
|
223
223
|
{
|
|
224
224
|
value: "default",
|
|
225
|
-
label:
|
|
225
|
+
label: u("permissionDefault")
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
228
|
value: "accept-edits",
|
|
229
|
-
label:
|
|
229
|
+
label: u("permissionAcceptEdits")
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
232
|
value: "auto",
|
|
233
|
-
label:
|
|
233
|
+
label: u("permissionAuto")
|
|
234
234
|
},
|
|
235
235
|
{
|
|
236
236
|
value: "bypass",
|
|
237
|
-
label:
|
|
237
|
+
label: u("permissionBypass")
|
|
238
238
|
}
|
|
239
239
|
],
|
|
240
|
-
onValueChange: (e) =>
|
|
241
|
-
"aria-label":
|
|
240
|
+
onValueChange: (e) => xe(e),
|
|
241
|
+
"aria-label": u("permissionMode"),
|
|
242
242
|
width: "content",
|
|
243
|
-
disabled: !
|
|
243
|
+
disabled: !_ || W === "viewer"
|
|
244
244
|
})
|
|
245
245
|
})] }),
|
|
246
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ D("label", {
|
|
247
247
|
className: "block min-w-48 flex-1",
|
|
248
|
-
children: [/* @__PURE__ */
|
|
249
|
-
className:
|
|
250
|
-
children:
|
|
251
|
-
}), /* @__PURE__ */
|
|
252
|
-
value:
|
|
253
|
-
onChange: (e) =>
|
|
254
|
-
placeholder:
|
|
248
|
+
children: [/* @__PURE__ */ E("span", {
|
|
249
|
+
className: j,
|
|
250
|
+
children: u("runnerLabels")
|
|
251
|
+
}), /* @__PURE__ */ E(b, {
|
|
252
|
+
value: U,
|
|
253
|
+
onChange: (e) => ye(e.target.value),
|
|
254
|
+
placeholder: u("runnerLabelsPlaceholder"),
|
|
255
255
|
className: "mt-1"
|
|
256
256
|
})]
|
|
257
257
|
})
|
|
258
258
|
]
|
|
259
259
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ E("p", {
|
|
261
261
|
className: "-mt-2 text-xs text-muted-foreground",
|
|
262
|
-
children:
|
|
262
|
+
children: u("permissionModeHint")
|
|
263
263
|
}),
|
|
264
|
-
|
|
264
|
+
$.length > 0 && W !== "viewer" ? /* @__PURE__ */ E("p", {
|
|
265
|
+
role: "status",
|
|
266
|
+
className: "-mt-2 text-xs text-pretty text-warning",
|
|
267
|
+
children: u.rich("modeCappedBy", {
|
|
268
|
+
runners: $.map((e) => `${e.name} (${B(e.permissionMode ?? "")})`).join(", "),
|
|
269
|
+
mode: B(G),
|
|
270
|
+
code: () => /* @__PURE__ */ E("code", { children: ne(G) })
|
|
271
|
+
})
|
|
272
|
+
}) : he === !1 && l?.permissionMode === G && /* @__PURE__ */ E("p", {
|
|
265
273
|
role: "status",
|
|
266
274
|
className: "-mt-2 text-xs text-warning",
|
|
267
|
-
children:
|
|
275
|
+
children: u("modeNotAllowed", { mode: B(G) })
|
|
268
276
|
}),
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
className:
|
|
271
|
-
children:
|
|
272
|
-
}), /* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("span", {
|
|
278
|
+
className: j,
|
|
279
|
+
children: u("limits")
|
|
280
|
+
}), /* @__PURE__ */ D("div", {
|
|
273
281
|
className: "mt-2 grid gap-4 sm:grid-cols-3",
|
|
274
282
|
children: [
|
|
275
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ D("label", {
|
|
276
284
|
className: "block text-sm",
|
|
277
|
-
children: [
|
|
285
|
+
children: [u("turns"), /* @__PURE__ */ E(x, {
|
|
278
286
|
min: 1,
|
|
279
|
-
value:
|
|
280
|
-
onValueChange:
|
|
281
|
-
"aria-label":
|
|
282
|
-
disabled: !
|
|
287
|
+
value: K,
|
|
288
|
+
onValueChange: Se,
|
|
289
|
+
"aria-label": u("turns"),
|
|
290
|
+
disabled: !_,
|
|
283
291
|
className: "mt-1"
|
|
284
292
|
})]
|
|
285
293
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ D("label", {
|
|
287
295
|
className: "block text-sm",
|
|
288
|
-
children: [
|
|
296
|
+
children: [u("minutes"), /* @__PURE__ */ E(x, {
|
|
289
297
|
min: 1,
|
|
290
|
-
value:
|
|
291
|
-
onValueChange:
|
|
292
|
-
"aria-label":
|
|
293
|
-
disabled: !
|
|
298
|
+
value: q,
|
|
299
|
+
onValueChange: J,
|
|
300
|
+
"aria-label": u("minutes"),
|
|
301
|
+
disabled: !_,
|
|
294
302
|
className: "mt-1"
|
|
295
303
|
})]
|
|
296
304
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ D("label", {
|
|
298
306
|
className: "block text-sm",
|
|
299
|
-
children: [
|
|
307
|
+
children: [u("cost"), /* @__PURE__ */ E(x, {
|
|
300
308
|
min: .01,
|
|
301
309
|
step: .01,
|
|
302
|
-
value:
|
|
303
|
-
onValueChange:
|
|
304
|
-
"aria-label":
|
|
305
|
-
disabled: !
|
|
310
|
+
value: Y,
|
|
311
|
+
onValueChange: Ce,
|
|
312
|
+
"aria-label": u("cost"),
|
|
313
|
+
disabled: !_,
|
|
306
314
|
className: "mt-1"
|
|
307
315
|
})]
|
|
308
316
|
})
|
|
@@ -310,81 +318,81 @@ function M({ workspace: o, agent: s }) {
|
|
|
310
318
|
})] })
|
|
311
319
|
]
|
|
312
320
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ E(y, {
|
|
314
322
|
size: "md",
|
|
315
|
-
children:
|
|
323
|
+
children: we
|
|
316
324
|
}),
|
|
317
|
-
|
|
325
|
+
_ && /* @__PURE__ */ D("div", {
|
|
318
326
|
className: "flex items-center gap-3",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ E(ae, {
|
|
320
328
|
type: "submit",
|
|
321
329
|
variant: "primary",
|
|
322
|
-
disabled: !
|
|
323
|
-
loading:
|
|
324
|
-
children:
|
|
325
|
-
}),
|
|
330
|
+
disabled: !N.trim(),
|
|
331
|
+
loading: Q.isPending,
|
|
332
|
+
children: l ? m("save") : u("create")
|
|
333
|
+
}), l && !l.archivedAt && /* @__PURE__ */ E("button", {
|
|
326
334
|
type: "button",
|
|
327
|
-
onClick: () =>
|
|
335
|
+
onClick: () => Te.mutate(),
|
|
328
336
|
className: "h-9 rounded-md px-3 text-sm text-muted-foreground hover:text-danger",
|
|
329
|
-
children:
|
|
337
|
+
children: u("archive")
|
|
330
338
|
})]
|
|
331
339
|
})
|
|
332
340
|
]
|
|
333
|
-
}),
|
|
334
|
-
workspace:
|
|
335
|
-
agent:
|
|
341
|
+
}), l && /* @__PURE__ */ E(de, {
|
|
342
|
+
workspace: s,
|
|
343
|
+
agent: l
|
|
336
344
|
})]
|
|
337
345
|
})]
|
|
338
346
|
});
|
|
339
347
|
}
|
|
340
|
-
function
|
|
341
|
-
let n =
|
|
342
|
-
return /* @__PURE__ */
|
|
348
|
+
function de({ workspace: e, agent: t }) {
|
|
349
|
+
let n = T("agent"), r = T("agentWork.state"), { data: i = [] } = k(s(e, { agent: t.slug })), { data: a = [] } = k(o(e)), c = p(t, a).some((e) => e.online);
|
|
350
|
+
return /* @__PURE__ */ D("section", {
|
|
343
351
|
"aria-labelledby": "agent-runs",
|
|
344
352
|
className: "space-y-3 px-4 pb-8 md:px-8",
|
|
345
353
|
children: [
|
|
346
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ E("h2", {
|
|
347
355
|
id: "agent-runs",
|
|
348
356
|
className: "text-base font-semibold",
|
|
349
357
|
children: n("runs")
|
|
350
358
|
}),
|
|
351
|
-
!c && !t.archivedAt && /* @__PURE__ */
|
|
359
|
+
!c && !t.archivedAt && /* @__PURE__ */ D("p", {
|
|
352
360
|
className: "flex items-center gap-1.5 text-sm text-warning",
|
|
353
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ E(l, { className: "size-4" }), n("noRunnerOnline")]
|
|
354
362
|
}),
|
|
355
|
-
i.length === 0 ? /* @__PURE__ */
|
|
363
|
+
i.length === 0 ? /* @__PURE__ */ E("p", {
|
|
356
364
|
className: "text-sm text-muted-foreground",
|
|
357
365
|
children: n("noRuns")
|
|
358
|
-
}) : /* @__PURE__ */
|
|
366
|
+
}) : /* @__PURE__ */ E("ul", {
|
|
359
367
|
className: "divide-y divide-border rounded-lg border border-border",
|
|
360
|
-
children: i.map((t) => /* @__PURE__ */
|
|
368
|
+
children: i.map((t) => /* @__PURE__ */ D("li", {
|
|
361
369
|
className: "flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 text-sm",
|
|
362
370
|
children: [
|
|
363
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ D(g, {
|
|
364
372
|
to: "/$workspace/issues/$identifier",
|
|
365
373
|
params: {
|
|
366
374
|
workspace: e,
|
|
367
375
|
identifier: t.identifier
|
|
368
376
|
},
|
|
369
377
|
className: "min-w-0 flex-1 truncate hover:underline",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
378
|
+
children: [/* @__PURE__ */ E("span", {
|
|
371
379
|
className: "mr-2 tabular-nums text-muted-foreground",
|
|
372
380
|
children: t.identifier
|
|
373
381
|
}), t.issueTitle]
|
|
374
382
|
}),
|
|
375
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ E("span", {
|
|
376
384
|
className: "text-xs text-muted-foreground",
|
|
377
385
|
children: r(t.state)
|
|
378
386
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ E("span", {
|
|
380
388
|
className: "text-xs text-muted-foreground",
|
|
381
|
-
children: t.lastRunnerName ? /* @__PURE__ */
|
|
389
|
+
children: t.lastRunnerName ? /* @__PURE__ */ E(u, {
|
|
382
390
|
workspace: e,
|
|
383
391
|
name: t.lastRunnerName,
|
|
384
392
|
kind: t.runnerKind
|
|
385
393
|
}) : n("noRunnerYet")
|
|
386
394
|
}),
|
|
387
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ E(S, {
|
|
388
396
|
value: t.createdAt,
|
|
389
397
|
format: "compact",
|
|
390
398
|
className: "text-xs text-muted-foreground"
|
|
@@ -395,4 +403,4 @@ function ue({ workspace: e, agent: t }) {
|
|
|
395
403
|
]
|
|
396
404
|
});
|
|
397
405
|
}
|
|
398
|
-
export {
|
|
406
|
+
export { M as component };
|