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