@parallelworks/tandem-web 0.171.0 → 0.171.2
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 +1 -0
- package/_virtual/_virtual_i18n/es/common.js +1 -0
- package/_virtual/_virtual_i18n/ja/common.js +1 -0
- package/_virtual/_virtual_i18n/ko/common.js +1 -0
- package/_virtual/_virtual_i18n/zh/common.js +1 -0
- package/components/AccessGrants.js +6 -6
- package/components/ActivityTimeline.js +57 -57
- package/components/ActorAvatar.js +4 -4
- package/components/AgentWork.js +494 -494
- package/components/AppLauncher.js +7 -7
- package/components/AreaLink.js +13 -13
- package/components/AreaTiles.js +13 -13
- package/components/AreaWork.js +22 -22
- package/components/Attachments.js +29 -29
- package/components/BlockHandle.js +3 -3
- package/components/BugRotation.js +8 -8
- package/components/CodeHostSettings.js +38 -38
- package/components/CollabEditor.js +13 -13
- package/components/CommandPalette.js +206 -206
- package/components/CustomFields.js +95 -95
- package/components/CustomerRequests.js +11 -11
- package/components/DashboardPanel.js +23 -23
- package/components/DateChip.js +21 -21
- package/components/DocHistory.js +14 -14
- package/components/DocIcon.js +4 -4
- package/components/DocIconPicker.js +4 -4
- package/components/DocLinkPicker.js +22 -22
- package/components/DocLook.js +16 -16
- package/components/DocProperties.js +81 -81
- package/components/DocTable.js +53 -53
- package/components/DocsTree.js +179 -179
- package/components/Editor.js +69 -69
- package/components/FavoritesNav.js +78 -78
- package/components/GitHub.js +87 -87
- package/components/Graph.js +14 -14
- package/components/HostActions.js +21 -21
- package/components/HostPanel.js +6 -6
- package/components/HoverCards.js +74 -74
- package/components/IssueBoard.js +13 -10
- package/components/IssueBreakdown.js +31 -31
- package/components/IssueCode.js +19 -19
- package/components/IssueEvent.js +12 -12
- package/components/IssueFilters.js +103 -99
- package/components/IssueGroup.js +16 -16
- package/components/IssueImport.js +13 -13
- package/components/IssueInsights.js +20 -20
- package/components/IssueListBlock.js +81 -81
- package/components/IssueRelations.js +34 -34
- package/components/IssueRow.js +31 -31
- package/components/IssueSentry.js +4 -4
- package/components/IssueTemplates.js +23 -23
- package/components/IssueTypes.js +40 -40
- package/components/MarkdownTransfer.js +10 -10
- package/components/MentionPicker.js +19 -19
- package/components/NewIssueDialog.js +53 -53
- package/components/NewProjectDialog.js +82 -82
- package/components/PersonActivity.js +13 -13
- package/components/PersonHoverCard.js +44 -44
- package/components/Planning.js +16 -16
- package/components/Reports.js +8 -8
- package/components/SettingsNav.js +15 -15
- package/components/ShareDialog.js +8 -8
- package/components/SharedViewer.js +23 -23
- package/components/SlashMenu.js +26 -26
- package/components/SubPages.js +10 -10
- package/components/TeamForm.js +9 -9
- package/components/TeamRepositories.js +21 -21
- package/components/TeamWorkflow.js +6 -6
- package/components/UnlinkedMentions.js +29 -29
- package/components/Updates.js +8 -8
- package/components/Widgets.js +4 -4
- package/components/WorkCounts.js +12 -12
- package/components/cycleCrumb.js +8 -8
- package/components/editorPlugins.js +101 -101
- package/components/settings.js +6 -6
- package/components/video.js +7 -7
- package/hostedApp.js +24 -24
- package/index.js +18 -18
- package/lib/assigneeOrder.js +6 -0
- package/lib/assignees.js +24 -20
- package/lib/attachments.js +12 -12
- package/lib/boardMove.js +27 -27
- package/lib/collab.js +1 -1
- package/lib/docs.js +115 -115
- package/lib/githubLink.js +7 -7
- package/lib/issueList.js +51 -51
- package/lib/issueMenu.js +117 -117
- package/lib/knowledge.js +134 -134
- package/lib/live.js +38 -38
- package/lib/notifications.js +47 -47
- package/lib/views.js +31 -31
- package/package.json +24 -24
- package/pages/area.js +64 -64
- package/pages/areas.js +199 -199
- package/pages/decisions.js +51 -51
- package/pages/issues.js +120 -120
- package/pages/projects.js +238 -238
- package/pages/triage.js +109 -109
- package/routes/_workspace/agents/_slug2.js +127 -127
- package/routes/_workspace/agents/index2.js +22 -22
- package/routes/_workspace/dashboards/_dashboardId2.js +84 -84
- package/routes/_workspace/dashboards/index2.js +34 -34
- package/routes/_workspace/docs/_doc2.js +267 -267
- package/routes/_workspace/docs/space2._space.js +31 -31
- package/routes/_workspace/docs2.js +4 -4
- package/routes/_workspace/graph2.js +11 -11
- package/routes/_workspace/graph3.js +11 -11
- package/routes/_workspace/issues/_identifier2.js +477 -477
- package/routes/_workspace/issues/index.js +13 -13
- package/routes/_workspace/knowledge/_term2.js +175 -175
- package/routes/_workspace/knowledge/_term3.js +4 -4
- package/routes/_workspace/knowledge/index.js +12 -12
- package/routes/_workspace/knowledge/index2.js +117 -117
- package/routes/_workspace/measures2.js +8 -8
- package/routes/_workspace/measures3.js +29 -29
- package/routes/_workspace/notifications2.js +263 -263
- package/routes/_workspace/people/_username.js +10 -10
- package/routes/_workspace/people/_username2.js +41 -41
- package/routes/_workspace/projects/_projectId3.js +303 -303
- package/routes/_workspace/projects/_projectId4.js +4 -4
- package/routes/_workspace/projects/_projectId_3.milestones._milestoneId.js +28 -28
- package/routes/_workspace/projects/_projectId_4.milestones._milestoneId.js +4 -4
- package/routes/_workspace/projects/index.js +8 -8
- package/routes/_workspace/settings/account2.js +8 -8
- package/routes/_workspace/settings/audit-log2.js +8 -8
- package/routes/_workspace/settings/audit-log3.js +155 -155
- package/routes/_workspace/settings/connections2.js +4 -4
- package/routes/_workspace/settings/fields2.js +5 -5
- package/routes/_workspace/settings/github2.js +11 -11
- package/routes/_workspace/settings/gitlab2.js +5 -5
- package/routes/_workspace/settings/groups2.js +52 -52
- package/routes/_workspace/settings/import2.js +39 -39
- package/routes/_workspace/settings/index2.js +5 -5
- package/routes/_workspace/settings/intercom2.js +11 -11
- package/routes/_workspace/settings/labels2.js +33 -33
- package/routes/_workspace/settings/members2.js +81 -81
- package/routes/_workspace/settings/notifications2.js +46 -46
- package/routes/_workspace/settings/parallelworks2.js +20 -20
- package/routes/_workspace/settings/roles2.js +41 -41
- package/routes/_workspace/settings/runners2.js +15 -15
- package/routes/_workspace/settings/sentry2.js +15 -15
- package/routes/_workspace/settings/sessions2.js +9 -9
- package/routes/_workspace/settings/sessions3.js +4 -4
- package/routes/_workspace/settings/slack2.js +12 -12
- package/routes/_workspace/settings/sso2.js +37 -37
- package/routes/_workspace/settings/sso3.js +7 -7
- package/routes/_workspace/settings/teams2.js +29 -29
- package/routes/_workspace/settings/tokens2.js +32 -32
- package/routes/_workspace/settings/tokens3.js +4 -4
- package/routes/_workspace/settings/webhooks2.js +41 -41
- package/routes/_workspace/settings/zendesk2.js +11 -11
- package/routes/_workspace/teams/_key/cycles/_number2.js +33 -33
- package/routes/_workspace/teams/_key/cycles/_number3.js +7 -7
- package/routes/_workspace/teams/_key/cycles/index2.js +37 -37
- package/routes/_workspace/teams/_key/issues.js +10 -10
- package/routes/_workspace/teams/_key/projects.js +6 -6
- package/routes/_workspace/teams/_key/settings2.js +396 -396
- package/routes/_workspace2.js +308 -308
- package/routes/_workspace3.js +8 -8
- package/routes/device2.js +4 -4
- package/routes/device3.js +4 -4
- package/routes/docs/_tag/_endpoint2.js +3 -3
- package/routes/docs/_tag/index2.js +3 -3
- package/routes/docs/route2.js +7 -7
- package/routes/index2.js +5 -5
- package/routes/login2.js +10 -10
- package/routes/new2.js +12 -12
- package/routes/new3.js +5 -5
- package/routes/request2._token.js +6 -6
- package/routes/share2._secret.js +4 -4
|
@@ -1,46 +1,46 @@
|
|
|
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 {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { Autocomplete as
|
|
12
|
-
import { useState as
|
|
13
|
-
import { useErrorMessage as
|
|
14
|
-
import { useTranslations as
|
|
15
|
-
import { jsx as
|
|
16
|
-
import { useMutation as
|
|
2
|
+
import { agentQuery as n, agentsQuery as r, meQuery as i, myModelsQuery as a } from "../../../api/queries.js";
|
|
3
|
+
import { Editor as ee } from "../../../components/Editor.js";
|
|
4
|
+
import { NotFound as o } from "../../../components/status.js";
|
|
5
|
+
import { harnessOptions as te, runnableHarnesses as s } from "../../../lib/agents.js";
|
|
6
|
+
import { usePageTitle as c } from "../../../lib/pageTitle.js";
|
|
7
|
+
import { usePermissionModeName as ne } from "../../../lib/permissionModes.js";
|
|
8
|
+
import { may as l } from "../../../lib/roles.js";
|
|
9
|
+
import { useNavigate as re } from "../../../lib/router.js";
|
|
10
|
+
import { Route as u } from "./_slug.js";
|
|
11
|
+
import { Autocomplete as ie, Button as ae, ErrorText as d, Input as f, NumberInput as p, PageHeader as m, Select as h, toast as oe } from "@parallelworks/ui";
|
|
12
|
+
import { useState as g } from "react";
|
|
13
|
+
import { useErrorMessage as _ } from "@parallelworks/problem/react";
|
|
14
|
+
import { useTranslations as v } from "use-intl";
|
|
15
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
16
|
+
import { useMutation as x, useQuery as S, useQueryClient as C, useSuspenseQuery as w } from "@tanstack/react-query";
|
|
17
17
|
// src/routes/$workspace/agents/$slug.tsx?tsr-split=component
|
|
18
18
|
var T = "block text-sm font-medium";
|
|
19
19
|
function E() {
|
|
20
|
-
let { workspace: e, slug: t } =
|
|
21
|
-
return
|
|
20
|
+
let { workspace: e, slug: t } = u.useParams(), { data: n } = w(r(e)), i = n.find((e) => e.slug === t), a = v("agent");
|
|
21
|
+
return c(i ? i.name : a("newAgent")), t !== "new" && !i ? /* @__PURE__ */ y(o, { title: a("notFound") }) : /* @__PURE__ */ y(D, {
|
|
22
22
|
workspace: e,
|
|
23
|
-
agent:
|
|
24
|
-
},
|
|
23
|
+
agent: i
|
|
24
|
+
}, i?.id ?? "new");
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function se(e) {
|
|
27
27
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 63);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
let
|
|
31
|
-
...
|
|
32
|
-
enabled: !!
|
|
33
|
-
}).data?.modeAllowed, U =
|
|
34
|
-
...
|
|
29
|
+
function D({ workspace: o, agent: c }) {
|
|
30
|
+
let u = v("agent"), E = v("workspace"), D = _(), O = v("common"), { data: k } = w(i), A = l(k, o, "manage_agents"), j = C(), M = re(), [N, ce] = g(c?.name ?? ""), [P, le] = g(c?.description ?? ""), [F, I] = g(c?.instructions ?? ""), [L, R] = g(c?.harness ?? "pw-code"), [z, B] = g(c?.model ?? ""), V = ne(), H = S({
|
|
31
|
+
...n(o, c?.slug ?? ""),
|
|
32
|
+
enabled: !!c
|
|
33
|
+
}).data?.modeAllowed, U = S({
|
|
34
|
+
...a,
|
|
35
35
|
enabled: L === "pw-code"
|
|
36
|
-
}).data ?? [], { data: ue } = w(o
|
|
36
|
+
}).data ?? [], { data: ue } = w(r(o)), W = [...new Set(ue.filter((e) => e.harness === L && e.model && e.id !== c?.id).map((e) => e.model))].filter((e) => !U.some((t) => t.id === e)), de = [...U.map((e) => ({
|
|
37
37
|
value: e.id,
|
|
38
38
|
label: e.name || e.id,
|
|
39
39
|
...e.name && e.name !== e.id && { description: e.id }
|
|
40
40
|
})), ...W.length > 0 ? [{
|
|
41
|
-
label:
|
|
41
|
+
label: u("modelsInWorkspace"),
|
|
42
42
|
items: W
|
|
43
|
-
}] : []], [G, fe] =
|
|
43
|
+
}] : []], [G, fe] = g(c?.runnerLabels.join(", ") ?? ""), [K, pe] = g(c?.maxRole ?? "member"), [q, me] = g(c?.permissionMode ?? "accept-edits"), [J, he] = g(c?.maxTurns ?? 200), [Y, ge] = g(c?.maxMinutes ?? 120), [X, _e] = g((c?.maxCostMicros ?? 2e7) / 1e6), [ve, Z] = g(null), Q = () => ({
|
|
44
44
|
name: N,
|
|
45
45
|
description: P,
|
|
46
46
|
instructions: F,
|
|
@@ -52,254 +52,254 @@ function O({ workspace: n, agent: r }) {
|
|
|
52
52
|
maxTurns: J ?? 0,
|
|
53
53
|
maxMinutes: Y ?? 0,
|
|
54
54
|
maxCostMicros: Math.round((X ?? 0) * 1e6)
|
|
55
|
-
}), $ =
|
|
56
|
-
mutationFn: async () => t(
|
|
55
|
+
}), $ = x({
|
|
56
|
+
mutationFn: async () => t(c ? await e.PUT("/api/v1/workspaces/{workspace}/agents/{slug}", {
|
|
57
57
|
params: { path: {
|
|
58
|
-
workspace:
|
|
59
|
-
slug:
|
|
58
|
+
workspace: o,
|
|
59
|
+
slug: c.slug
|
|
60
60
|
} },
|
|
61
61
|
body: Q()
|
|
62
62
|
}) : await e.POST("/api/v1/workspaces/{workspace}/agents", {
|
|
63
|
-
params: { path: { workspace:
|
|
63
|
+
params: { path: { workspace: o } },
|
|
64
64
|
body: {
|
|
65
|
-
slug:
|
|
65
|
+
slug: se(N),
|
|
66
66
|
...Q()
|
|
67
67
|
}
|
|
68
68
|
})),
|
|
69
69
|
onMutate: () => Z(null),
|
|
70
70
|
onSuccess: (e) => {
|
|
71
|
-
j.invalidateQueries({ queryKey: o
|
|
71
|
+
j.invalidateQueries({ queryKey: r(o).queryKey }), oe.success(u(c ? "saved" : "created", { name: e.name })), M({
|
|
72
72
|
to: "/$workspace/agents/$slug",
|
|
73
73
|
params: {
|
|
74
|
-
workspace:
|
|
74
|
+
workspace: o,
|
|
75
75
|
slug: e.slug
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
},
|
|
79
|
-
onError: (e) => Z(
|
|
80
|
-
}), ye =
|
|
79
|
+
onError: (e) => Z(D(e))
|
|
80
|
+
}), ye = x({
|
|
81
81
|
mutationFn: async () => t(await e.DELETE("/api/v1/workspaces/{workspace}/agents/{slug}", { params: { path: {
|
|
82
|
-
workspace:
|
|
83
|
-
slug:
|
|
82
|
+
workspace: o,
|
|
83
|
+
slug: c?.slug ?? ""
|
|
84
84
|
} } })),
|
|
85
85
|
onSuccess: () => {
|
|
86
|
-
j.invalidateQueries({ queryKey: o
|
|
86
|
+
j.invalidateQueries({ queryKey: r(o).queryKey }), M({
|
|
87
87
|
to: "/$workspace/agents",
|
|
88
|
-
params: { workspace:
|
|
88
|
+
params: { workspace: o }
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ b("div", {
|
|
93
93
|
className: "flex h-full min-h-0 flex-col",
|
|
94
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ y(m, {
|
|
95
95
|
heading: !1,
|
|
96
96
|
breadcrumbs: [{
|
|
97
97
|
label: E("agents"),
|
|
98
|
-
href: `/${
|
|
99
|
-
}, { label:
|
|
100
|
-
}), /* @__PURE__ */
|
|
98
|
+
href: `/${o}/agents`
|
|
99
|
+
}, { label: c ? c.name : u("newAgent") }]
|
|
100
|
+
}), /* @__PURE__ */ y("div", {
|
|
101
101
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
102
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ b("form", {
|
|
103
103
|
className: "w-full space-y-6 px-4 py-6 md:px-8 md:py-8",
|
|
104
104
|
onSubmit: (e) => {
|
|
105
105
|
e.preventDefault(), $.mutate();
|
|
106
106
|
},
|
|
107
107
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h1", {
|
|
109
109
|
className: "text-xl font-semibold tracking-tight",
|
|
110
|
-
children:
|
|
111
|
-
}),
|
|
110
|
+
children: c ? c.name : u("newAgent")
|
|
111
|
+
}), c && /* @__PURE__ */ y("p", {
|
|
112
112
|
className: "mt-1 text-sm text-muted-foreground",
|
|
113
|
-
children:
|
|
113
|
+
children: u("version", { version: c.version })
|
|
114
114
|
})] }),
|
|
115
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ b("fieldset", {
|
|
116
116
|
disabled: !A,
|
|
117
117
|
className: "space-y-5",
|
|
118
118
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ b("div", {
|
|
120
120
|
className: "grid gap-4 sm:grid-cols-2",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
121
|
+
children: [/* @__PURE__ */ b("label", {
|
|
122
122
|
className: "block",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ y("span", {
|
|
124
124
|
className: T,
|
|
125
|
-
children:
|
|
126
|
-
}), /* @__PURE__ */
|
|
125
|
+
children: O("name")
|
|
126
|
+
}), /* @__PURE__ */ y(f, {
|
|
127
127
|
required: !0,
|
|
128
128
|
value: N,
|
|
129
129
|
onChange: (e) => ce(e.target.value),
|
|
130
130
|
className: "mt-1"
|
|
131
131
|
})]
|
|
132
|
-
}), /* @__PURE__ */
|
|
132
|
+
}), /* @__PURE__ */ b("div", {
|
|
133
133
|
className: "block",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
134
|
+
children: [/* @__PURE__ */ y("span", {
|
|
135
135
|
className: T,
|
|
136
|
-
children:
|
|
137
|
-
}), /* @__PURE__ */
|
|
136
|
+
children: u("model")
|
|
137
|
+
}), /* @__PURE__ */ y(ie, {
|
|
138
138
|
value: z,
|
|
139
139
|
items: de,
|
|
140
140
|
onValueChange: B,
|
|
141
|
-
placeholder:
|
|
142
|
-
"aria-label":
|
|
141
|
+
placeholder: u(L === "pw-code" ? "modelPlaceholder" : "modelHarnessDefault"),
|
|
142
|
+
"aria-label": u("model"),
|
|
143
143
|
className: "mt-1"
|
|
144
144
|
})]
|
|
145
145
|
})]
|
|
146
146
|
}),
|
|
147
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ b("label", {
|
|
148
148
|
className: "block",
|
|
149
|
-
children: [/* @__PURE__ */
|
|
149
|
+
children: [/* @__PURE__ */ y("span", {
|
|
150
150
|
className: T,
|
|
151
|
-
children:
|
|
152
|
-
}), /* @__PURE__ */
|
|
151
|
+
children: O("description")
|
|
152
|
+
}), /* @__PURE__ */ y(f, {
|
|
153
153
|
value: P,
|
|
154
154
|
onChange: (e) => le(e.target.value),
|
|
155
|
-
placeholder:
|
|
155
|
+
placeholder: u("optional"),
|
|
156
156
|
className: "mt-1"
|
|
157
157
|
})]
|
|
158
158
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("span", {
|
|
160
160
|
className: T,
|
|
161
|
-
children:
|
|
162
|
-
}), /* @__PURE__ */
|
|
161
|
+
children: u("instructions")
|
|
162
|
+
}), /* @__PURE__ */ y("div", {
|
|
163
163
|
className: "mt-1 rounded-md border border-border bg-card px-3 py-2",
|
|
164
|
-
children: /* @__PURE__ */
|
|
164
|
+
children: /* @__PURE__ */ y(ee, {
|
|
165
165
|
value: F,
|
|
166
166
|
onChange: I,
|
|
167
167
|
editable: A,
|
|
168
|
-
placeholder:
|
|
169
|
-
label:
|
|
168
|
+
placeholder: u("instructionsPlaceholder"),
|
|
169
|
+
label: u("instructions"),
|
|
170
170
|
className: "min-h-32"
|
|
171
171
|
})
|
|
172
172
|
})] }),
|
|
173
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ b("div", {
|
|
174
174
|
className: "flex flex-wrap items-end gap-6",
|
|
175
175
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("span", {
|
|
177
177
|
className: T,
|
|
178
|
-
children:
|
|
179
|
-
}), /* @__PURE__ */
|
|
178
|
+
children: u("harness")
|
|
179
|
+
}), /* @__PURE__ */ y("div", {
|
|
180
180
|
className: "mt-1",
|
|
181
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ y(h, {
|
|
182
182
|
value: L,
|
|
183
|
-
items: te.filter((e) =>
|
|
183
|
+
items: te.filter((e) => s.includes(e.value) || e.value === c?.harness).map((e) => s.includes(e.value) ? e : {
|
|
184
184
|
...e,
|
|
185
|
-
label:
|
|
185
|
+
label: u("harnessNoRunner", { harness: e.label })
|
|
186
186
|
}),
|
|
187
187
|
onValueChange: (e) => R(e),
|
|
188
|
-
"aria-label":
|
|
188
|
+
"aria-label": u("harness"),
|
|
189
189
|
width: "content",
|
|
190
190
|
disabled: !A
|
|
191
191
|
})
|
|
192
192
|
})] }),
|
|
193
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("span", {
|
|
194
194
|
className: T,
|
|
195
|
-
children:
|
|
196
|
-
}), /* @__PURE__ */
|
|
195
|
+
children: u("access")
|
|
196
|
+
}), /* @__PURE__ */ y("div", {
|
|
197
197
|
className: "mt-1",
|
|
198
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ y(h, {
|
|
199
199
|
value: K,
|
|
200
200
|
items: [{
|
|
201
201
|
value: "member",
|
|
202
|
-
label:
|
|
202
|
+
label: u("accessMember")
|
|
203
203
|
}, {
|
|
204
204
|
value: "viewer",
|
|
205
|
-
label:
|
|
205
|
+
label: u("accessViewer")
|
|
206
206
|
}],
|
|
207
207
|
onValueChange: (e) => pe(e),
|
|
208
|
-
"aria-label":
|
|
208
|
+
"aria-label": u("access"),
|
|
209
209
|
width: "content",
|
|
210
210
|
disabled: !A
|
|
211
211
|
})
|
|
212
212
|
})] }),
|
|
213
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("span", {
|
|
214
214
|
className: T,
|
|
215
|
-
children:
|
|
216
|
-
}), /* @__PURE__ */
|
|
215
|
+
children: u("permissionMode")
|
|
216
|
+
}), /* @__PURE__ */ y("div", {
|
|
217
217
|
className: "mt-1",
|
|
218
|
-
children: /* @__PURE__ */
|
|
218
|
+
children: /* @__PURE__ */ y(h, {
|
|
219
219
|
value: q,
|
|
220
220
|
items: [
|
|
221
221
|
{
|
|
222
222
|
value: "default",
|
|
223
|
-
label:
|
|
223
|
+
label: u("permissionDefault")
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
226
|
value: "accept-edits",
|
|
227
|
-
label:
|
|
227
|
+
label: u("permissionAcceptEdits")
|
|
228
228
|
},
|
|
229
229
|
{
|
|
230
230
|
value: "auto",
|
|
231
|
-
label:
|
|
231
|
+
label: u("permissionAuto")
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
234
|
value: "bypass",
|
|
235
|
-
label:
|
|
235
|
+
label: u("permissionBypass")
|
|
236
236
|
}
|
|
237
237
|
],
|
|
238
238
|
onValueChange: (e) => me(e),
|
|
239
|
-
"aria-label":
|
|
239
|
+
"aria-label": u("permissionMode"),
|
|
240
240
|
width: "content",
|
|
241
241
|
disabled: !A || K === "viewer"
|
|
242
242
|
})
|
|
243
243
|
})] }),
|
|
244
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ b("label", {
|
|
245
245
|
className: "block min-w-48 flex-1",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ y("span", {
|
|
247
247
|
className: T,
|
|
248
|
-
children:
|
|
249
|
-
}), /* @__PURE__ */
|
|
248
|
+
children: u("runnerLabels")
|
|
249
|
+
}), /* @__PURE__ */ y(f, {
|
|
250
250
|
value: G,
|
|
251
251
|
onChange: (e) => fe(e.target.value),
|
|
252
|
-
placeholder:
|
|
252
|
+
placeholder: u("runnerLabelsPlaceholder"),
|
|
253
253
|
className: "mt-1"
|
|
254
254
|
})]
|
|
255
255
|
})
|
|
256
256
|
]
|
|
257
257
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ y("p", {
|
|
259
259
|
className: "-mt-2 text-xs text-muted-foreground",
|
|
260
|
-
children:
|
|
260
|
+
children: u("permissionModeHint")
|
|
261
261
|
}),
|
|
262
|
-
H === !1 &&
|
|
262
|
+
H === !1 && c?.permissionMode === q && /* @__PURE__ */ y("p", {
|
|
263
263
|
role: "status",
|
|
264
264
|
className: "-mt-2 text-xs text-warning",
|
|
265
|
-
children:
|
|
265
|
+
children: u("modeNotAllowed", { mode: V(q) })
|
|
266
266
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("span", {
|
|
268
268
|
className: T,
|
|
269
|
-
children:
|
|
270
|
-
}), /* @__PURE__ */
|
|
269
|
+
children: u("limits")
|
|
270
|
+
}), /* @__PURE__ */ b("div", {
|
|
271
271
|
className: "mt-2 grid gap-4 sm:grid-cols-3",
|
|
272
272
|
children: [
|
|
273
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ b("label", {
|
|
274
274
|
className: "block text-sm",
|
|
275
|
-
children: [
|
|
275
|
+
children: [u("turns"), /* @__PURE__ */ y(p, {
|
|
276
276
|
min: 1,
|
|
277
277
|
value: J,
|
|
278
278
|
onValueChange: he,
|
|
279
|
-
"aria-label":
|
|
279
|
+
"aria-label": u("turns"),
|
|
280
280
|
disabled: !A,
|
|
281
281
|
className: "mt-1"
|
|
282
282
|
})]
|
|
283
283
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ b("label", {
|
|
285
285
|
className: "block text-sm",
|
|
286
|
-
children: [
|
|
286
|
+
children: [u("minutes"), /* @__PURE__ */ y(p, {
|
|
287
287
|
min: 1,
|
|
288
288
|
value: Y,
|
|
289
289
|
onValueChange: ge,
|
|
290
|
-
"aria-label":
|
|
290
|
+
"aria-label": u("minutes"),
|
|
291
291
|
disabled: !A,
|
|
292
292
|
className: "mt-1"
|
|
293
293
|
})]
|
|
294
294
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ b("label", {
|
|
296
296
|
className: "block text-sm",
|
|
297
|
-
children: [
|
|
297
|
+
children: [u("cost"), /* @__PURE__ */ y(p, {
|
|
298
298
|
min: .01,
|
|
299
299
|
step: .01,
|
|
300
300
|
value: X,
|
|
301
301
|
onValueChange: _e,
|
|
302
|
-
"aria-label":
|
|
302
|
+
"aria-label": u("cost"),
|
|
303
303
|
disabled: !A,
|
|
304
304
|
className: "mt-1"
|
|
305
305
|
})]
|
|
@@ -308,23 +308,23 @@ function O({ workspace: n, agent: r }) {
|
|
|
308
308
|
})] })
|
|
309
309
|
]
|
|
310
310
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ y(d, {
|
|
312
312
|
size: "md",
|
|
313
313
|
children: ve
|
|
314
314
|
}),
|
|
315
|
-
A && /* @__PURE__ */
|
|
315
|
+
A && /* @__PURE__ */ b("div", {
|
|
316
316
|
className: "flex items-center gap-3",
|
|
317
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ y(ae, {
|
|
318
318
|
type: "submit",
|
|
319
319
|
variant: "primary",
|
|
320
320
|
disabled: !N.trim(),
|
|
321
321
|
loading: $.isPending,
|
|
322
|
-
children:
|
|
323
|
-
}),
|
|
322
|
+
children: c ? O("save") : u("create")
|
|
323
|
+
}), c && !c.archivedAt && /* @__PURE__ */ y("button", {
|
|
324
324
|
type: "button",
|
|
325
325
|
onClick: () => ye.mutate(),
|
|
326
326
|
className: "h-9 rounded-md px-3 text-sm text-muted-foreground hover:text-danger",
|
|
327
|
-
children:
|
|
327
|
+
children: u("archive")
|
|
328
328
|
})]
|
|
329
329
|
})
|
|
330
330
|
]
|
|
@@ -1,28 +1,28 @@
|
|
|
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 {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { agentsQuery as n, meQuery as r } from "../../../api/queries.js";
|
|
3
|
+
import { AgentIcon as i } from "../../../components/icons.js";
|
|
4
|
+
import { harnessNames as a } from "../../../lib/agents.js";
|
|
5
|
+
import { useConfirm as o } from "../../../lib/confirm.js";
|
|
6
|
+
import { copyItem as s, useLinkItems as c } from "../../../lib/menus.js";
|
|
7
|
+
import { usePageTitle as l } from "../../../lib/pageTitle.js";
|
|
8
|
+
import { may as u } from "../../../lib/roles.js";
|
|
9
|
+
import { Link as d, useNavigate as f } from "../../../lib/router.js";
|
|
10
|
+
import { Route as p } from "./index.js";
|
|
11
11
|
import { Avatar as m, Card as h, EmptyState as g, buttonClasses as _, menuDivider as v, useOpenMenu as y } from "@parallelworks/ui";
|
|
12
12
|
import { useTranslations as b } from "use-intl";
|
|
13
13
|
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 } = p.useParams(), D = b("agents"), O = b("common"), k = c(), { data: A } = T(n(E));
|
|
18
|
+
l(D("title"));
|
|
19
|
+
let { data: j } = T(r), M = u(j, E, "manage_agents"), N = y(), P = f(), 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:
|
|
25
|
-
}), { confirm: L, dialog: R } =
|
|
24
|
+
onSettled: () => F.invalidateQueries({ queryKey: n(E).queryKey })
|
|
25
|
+
}), { confirm: L, dialog: R } = o(), z = (e) => [
|
|
26
26
|
{
|
|
27
27
|
label: O("open"),
|
|
28
28
|
onClick: () => P({
|
|
@@ -34,7 +34,7 @@ function E() {
|
|
|
34
34
|
})
|
|
35
35
|
},
|
|
36
36
|
...k(`/${E}/agents/${e.slug}`),
|
|
37
|
-
|
|
37
|
+
s(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(d, {
|
|
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(d, {
|
|
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(i, {}),
|
|
78
78
|
title: D("empty"),
|
|
79
79
|
description: D("emptyDescription"),
|
|
80
|
-
...M && { action: /* @__PURE__ */ x(
|
|
80
|
+
...M && { action: /* @__PURE__ */ x(d, {
|
|
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(d, {
|
|
98
98
|
to: "/$workspace/agents/$slug",
|
|
99
99
|
params: {
|
|
100
100
|
workspace: E,
|
|
@@ -125,9 +125,9 @@ function E() {
|
|
|
125
125
|
/* @__PURE__ */ x("span", {
|
|
126
126
|
className: "text-xs text-muted-foreground",
|
|
127
127
|
children: e.model ? D("harnessWithModel", {
|
|
128
|
-
harness:
|
|
128
|
+
harness: a[e.harness] ?? e.harness,
|
|
129
129
|
model: e.model
|
|
130
|
-
}) :
|
|
130
|
+
}) : a[e.harness]
|
|
131
131
|
})
|
|
132
132
|
]
|
|
133
133
|
}) }, e.id))
|