@parallelworks/tandem-web 0.178.0 → 0.179.0

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