@parallelworks/tandem-web 0.176.0 → 0.178.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,37 @@
1
+ import { Link as e } from "../lib/router.js";
2
+ import { CloudIcon as t, UsersIcon as n, WorkerIcon as r } from "./icons.js";
3
+ import { Tooltip as i, cx as a } from "@parallelworks/ui";
4
+ import { useTranslations as o } from "use-intl";
5
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
+ // src/components/RunnerBadge.tsx
7
+ var l = {
8
+ personal: r,
9
+ shared: n,
10
+ compute: t
11
+ };
12
+ function u({ workspace: t, name: n, kind: r, link: u = !0, className: d }) {
13
+ let f = o("runnerKind"), p = l[r ?? "personal"];
14
+ return u ? /* @__PURE__ */ s(i, {
15
+ content: f(r ?? "personal"),
16
+ children: /* @__PURE__ */ c(e, {
17
+ to: "/$workspace/settings/runners",
18
+ params: { workspace: t },
19
+ className: a("inline-flex min-w-0 items-center gap-1 hover:text-foreground hover:underline", d),
20
+ children: [/* @__PURE__ */ s(p, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ s("span", {
21
+ className: "truncate",
22
+ children: n
23
+ })]
24
+ })
25
+ }) : /* @__PURE__ */ c("span", {
26
+ className: a("inline-flex min-w-0 items-center gap-1", d),
27
+ title: f(r ?? "personal"),
28
+ children: [/* @__PURE__ */ s(p, {
29
+ className: "size-3.5 shrink-0",
30
+ "aria-label": f(r ?? "personal")
31
+ }), /* @__PURE__ */ s("span", {
32
+ className: "truncate",
33
+ children: n
34
+ })]
35
+ });
36
+ }
37
+ export { u as RunnerBadge };
package/lib/agents.js CHANGED
@@ -16,5 +16,11 @@ var e = {
16
16
  value: "codex",
17
17
  label: "Codex"
18
18
  }
19
- ];
20
- export { e as harnessNames, n as harnessOptions, t as runnableHarnesses };
19
+ ], r = 12e4;
20
+ function i(e, t, n = Date.now()) {
21
+ return t.filter((t) => t.harnesses.includes(e.harness) && e.runnerLabels.every((e) => t.labels.includes(e))).map((e) => ({
22
+ runner: e,
23
+ online: !!e.lastSeenAt && n - new Date(e.lastSeenAt).getTime() < 12e4
24
+ })).sort((e, t) => Number(t.online) - Number(e.online) || e.runner.name.localeCompare(t.runner.name));
25
+ }
26
+ export { e as harnessNames, n as harnessOptions, t as runnableHarnesses, r as runnerOnlineWithin, i as runnersFor };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.176.0",
3
+ "version": "0.178.0",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -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 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";
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 T = "block text-sm font-medium";
19
- function E() {
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, {
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 se(e) {
28
+ function le(e) {
27
29
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 63);
28
30
  }
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({
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: 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) => ({
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: u("modelsInWorkspace"),
43
+ label: l("modelsInWorkspace"),
42
44
  items: W
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
- name: N,
45
- description: P,
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
- }), $ = x({
56
- mutationFn: async () => t(c ? await e.PUT("/api/v1/workspaces/{workspace}/agents/{slug}", {
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: c.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: se(N),
67
+ slug: le(j),
66
68
  ...Q()
67
69
  }
68
70
  })),
69
71
  onMutate: () => Z(null),
70
72
  onSuccess: (e) => {
71
- j.invalidateQueries({ queryKey: r(o).queryKey }), oe.success(u(c ? "saved" : "created", { name: e.name })), M({
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(D(e))
80
- }), ye = x({
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: c?.slug ?? ""
85
+ slug: s?.slug ?? ""
84
86
  } } })),
85
87
  onSuccess: () => {
86
- j.invalidateQueries({ queryKey: r(o).queryKey }), M({
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__ */ b("div", {
94
+ return /* @__PURE__ */ E("div", {
93
95
  className: "flex h-full min-h-0 flex-col",
94
- children: [/* @__PURE__ */ y(m, {
96
+ children: [/* @__PURE__ */ T(ae, {
95
97
  heading: !1,
96
98
  breadcrumbs: [{
97
- label: E("agents"),
99
+ label: u("agents"),
98
100
  href: `/${o}/agents`
99
- }, { label: c ? c.name : u("newAgent") }]
100
- }), /* @__PURE__ */ y("div", {
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__ */ b("form", {
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__ */ b("div", { children: [/* @__PURE__ */ y("h1", {
110
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h1", {
109
111
  className: "text-xl font-semibold tracking-tight",
110
- children: c ? c.name : u("newAgent")
111
- }), c && /* @__PURE__ */ y("p", {
112
+ children: s ? s.name : l("newAgent")
113
+ }), s && /* @__PURE__ */ T("p", {
112
114
  className: "mt-1 text-sm text-muted-foreground",
113
- children: u("version", { version: c.version })
115
+ children: l("version", { version: s.version })
114
116
  })] }),
115
- /* @__PURE__ */ b("fieldset", {
116
- disabled: !A,
117
+ /* @__PURE__ */ E("fieldset", {
118
+ disabled: !g,
117
119
  className: "space-y-5",
118
120
  children: [
119
- /* @__PURE__ */ b("div", {
121
+ /* @__PURE__ */ E("div", {
120
122
  className: "grid gap-4 sm:grid-cols-2",
121
- children: [/* @__PURE__ */ b("label", {
123
+ children: [/* @__PURE__ */ E("label", {
122
124
  className: "block",
123
- children: [/* @__PURE__ */ y("span", {
124
- className: T,
125
- children: O("name")
126
- }), /* @__PURE__ */ y(f, {
125
+ children: [/* @__PURE__ */ T("span", {
126
+ className: A,
127
+ children: p("name")
128
+ }), /* @__PURE__ */ T(y, {
127
129
  required: !0,
128
- value: N,
129
- onChange: (e) => ce(e.target.value),
130
+ value: j,
131
+ onChange: (e) => M(e.target.value),
130
132
  className: "mt-1"
131
133
  })]
132
- }), /* @__PURE__ */ b("div", {
134
+ }), /* @__PURE__ */ E("div", {
133
135
  className: "block",
134
- children: [/* @__PURE__ */ y("span", {
135
- className: T,
136
- children: u("model")
137
- }), /* @__PURE__ */ y(ie, {
136
+ children: [/* @__PURE__ */ T("span", {
137
+ className: A,
138
+ children: l("model")
139
+ }), /* @__PURE__ */ T(re, {
138
140
  value: z,
139
- items: de,
141
+ items: fe,
140
142
  onValueChange: B,
141
- placeholder: u(L === "pw-code" ? "modelPlaceholder" : "modelHarnessDefault"),
142
- "aria-label": u("model"),
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__ */ b("label", {
149
+ /* @__PURE__ */ E("label", {
148
150
  className: "block",
149
- children: [/* @__PURE__ */ y("span", {
150
- className: T,
151
- children: O("description")
152
- }), /* @__PURE__ */ y(f, {
153
- value: P,
154
- onChange: (e) => le(e.target.value),
155
- placeholder: u("optional"),
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__ */ b("div", { children: [/* @__PURE__ */ y("span", {
160
- className: T,
161
- children: u("instructions")
162
- }), /* @__PURE__ */ y("div", {
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__ */ y(ee, {
166
+ children: /* @__PURE__ */ T(c, {
165
167
  value: F,
166
168
  onChange: I,
167
- editable: A,
168
- placeholder: u("instructionsPlaceholder"),
169
- label: u("instructions"),
169
+ editable: g,
170
+ placeholder: l("instructionsPlaceholder"),
171
+ label: l("instructions"),
170
172
  className: "min-h-32"
171
173
  })
172
174
  })] }),
173
- /* @__PURE__ */ b("div", {
175
+ /* @__PURE__ */ E("div", {
174
176
  className: "flex flex-wrap items-end gap-6",
175
177
  children: [
176
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("span", {
177
- className: T,
178
- children: u("harness")
179
- }), /* @__PURE__ */ y("div", {
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__ */ y(h, {
183
+ children: /* @__PURE__ */ T(S, {
182
184
  value: L,
183
- items: te.filter((e) => s.includes(e.value) || e.value === c?.harness).map((e) => s.includes(e.value) ? e : {
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: u("harnessNoRunner", { harness: e.label })
187
+ label: l("harnessNoRunner", { harness: e.label })
186
188
  }),
187
189
  onValueChange: (e) => R(e),
188
- "aria-label": u("harness"),
190
+ "aria-label": l("harness"),
189
191
  width: "content",
190
- disabled: !A
192
+ disabled: !g
191
193
  })
192
194
  })] }),
193
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("span", {
194
- className: T,
195
- children: u("access")
196
- }), /* @__PURE__ */ y("div", {
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__ */ y(h, {
200
+ children: /* @__PURE__ */ T(S, {
199
201
  value: K,
200
202
  items: [{
201
203
  value: "member",
202
- label: u("accessMember")
204
+ label: l("accessMember")
203
205
  }, {
204
206
  value: "viewer",
205
- label: u("accessViewer")
207
+ label: l("accessViewer")
206
208
  }],
207
- onValueChange: (e) => pe(e),
208
- "aria-label": u("access"),
209
+ onValueChange: (e) => me(e),
210
+ "aria-label": l("access"),
209
211
  width: "content",
210
- disabled: !A
212
+ disabled: !g
211
213
  })
212
214
  })] }),
213
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("span", {
214
- className: T,
215
- children: u("permissionMode")
216
- }), /* @__PURE__ */ y("div", {
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__ */ y(h, {
220
+ children: /* @__PURE__ */ T(S, {
219
221
  value: q,
220
222
  items: [
221
223
  {
222
224
  value: "default",
223
- label: u("permissionDefault")
225
+ label: l("permissionDefault")
224
226
  },
225
227
  {
226
228
  value: "accept-edits",
227
- label: u("permissionAcceptEdits")
229
+ label: l("permissionAcceptEdits")
228
230
  },
229
231
  {
230
232
  value: "auto",
231
- label: u("permissionAuto")
233
+ label: l("permissionAuto")
232
234
  },
233
235
  {
234
236
  value: "bypass",
235
- label: u("permissionBypass")
237
+ label: l("permissionBypass")
236
238
  }
237
239
  ],
238
- onValueChange: (e) => me(e),
239
- "aria-label": u("permissionMode"),
240
+ onValueChange: (e) => he(e),
241
+ "aria-label": l("permissionMode"),
240
242
  width: "content",
241
- disabled: !A || K === "viewer"
243
+ disabled: !g || K === "viewer"
242
244
  })
243
245
  })] }),
244
- /* @__PURE__ */ b("label", {
246
+ /* @__PURE__ */ E("label", {
245
247
  className: "block min-w-48 flex-1",
246
- children: [/* @__PURE__ */ y("span", {
247
- className: T,
248
- children: u("runnerLabels")
249
- }), /* @__PURE__ */ y(f, {
248
+ children: [/* @__PURE__ */ T("span", {
249
+ className: A,
250
+ children: l("runnerLabels")
251
+ }), /* @__PURE__ */ T(y, {
250
252
  value: G,
251
- onChange: (e) => fe(e.target.value),
252
- placeholder: u("runnerLabelsPlaceholder"),
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__ */ y("p", {
260
+ /* @__PURE__ */ T("p", {
259
261
  className: "-mt-2 text-xs text-muted-foreground",
260
- children: u("permissionModeHint")
262
+ children: l("permissionModeHint")
261
263
  }),
262
- H === !1 && c?.permissionMode === q && /* @__PURE__ */ y("p", {
264
+ H === !1 && s?.permissionMode === q && /* @__PURE__ */ T("p", {
263
265
  role: "status",
264
266
  className: "-mt-2 text-xs text-warning",
265
- children: u("modeNotAllowed", { mode: V(q) })
267
+ children: l("modeNotAllowed", { mode: V(q) })
266
268
  }),
267
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("span", {
268
- className: T,
269
- children: u("limits")
270
- }), /* @__PURE__ */ b("div", {
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__ */ b("label", {
275
+ /* @__PURE__ */ E("label", {
274
276
  className: "block text-sm",
275
- children: [u("turns"), /* @__PURE__ */ y(p, {
277
+ children: [l("turns"), /* @__PURE__ */ T(b, {
276
278
  min: 1,
277
279
  value: J,
278
- onValueChange: he,
279
- "aria-label": u("turns"),
280
- disabled: !A,
280
+ onValueChange: ge,
281
+ "aria-label": l("turns"),
282
+ disabled: !g,
281
283
  className: "mt-1"
282
284
  })]
283
285
  }),
284
- /* @__PURE__ */ b("label", {
286
+ /* @__PURE__ */ E("label", {
285
287
  className: "block text-sm",
286
- children: [u("minutes"), /* @__PURE__ */ y(p, {
288
+ children: [l("minutes"), /* @__PURE__ */ T(b, {
287
289
  min: 1,
288
290
  value: Y,
289
- onValueChange: ge,
290
- "aria-label": u("minutes"),
291
- disabled: !A,
291
+ onValueChange: _e,
292
+ "aria-label": l("minutes"),
293
+ disabled: !g,
292
294
  className: "mt-1"
293
295
  })]
294
296
  }),
295
- /* @__PURE__ */ b("label", {
297
+ /* @__PURE__ */ E("label", {
296
298
  className: "block text-sm",
297
- children: [u("cost"), /* @__PURE__ */ y(p, {
299
+ children: [l("cost"), /* @__PURE__ */ T(b, {
298
300
  min: .01,
299
301
  step: .01,
300
302
  value: X,
301
- onValueChange: _e,
302
- "aria-label": u("cost"),
303
- disabled: !A,
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__ */ y(d, {
313
+ /* @__PURE__ */ T(ie, {
312
314
  size: "md",
313
- children: ve
315
+ children: ye
314
316
  }),
315
- A && /* @__PURE__ */ b("div", {
317
+ g && /* @__PURE__ */ E("div", {
316
318
  className: "flex items-center gap-3",
317
- children: [/* @__PURE__ */ y(ae, {
319
+ children: [/* @__PURE__ */ T(v, {
318
320
  type: "submit",
319
321
  variant: "primary",
320
- disabled: !N.trim(),
322
+ disabled: !j.trim(),
321
323
  loading: $.isPending,
322
- children: c ? O("save") : u("create")
323
- }), c && !c.archivedAt && /* @__PURE__ */ y("button", {
324
+ children: s ? p("save") : l("create")
325
+ }), s && !s.archivedAt && /* @__PURE__ */ T("button", {
324
326
  type: "button",
325
- onClick: () => ye.mutate(),
327
+ onClick: () => be.mutate(),
326
328
  className: "h-9 rounded-md px-3 text-sm text-muted-foreground hover:text-danger",
327
- children: u("archive")
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
- export { E as component };
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 };