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