@korso/shepherd-ui 0.5.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib/index.js CHANGED
@@ -1,99 +1,99 @@
1
- import { u as A, d as I, f as O, D as G } from "./Dashboard-qipRa5MO.js";
2
- import { E as ce, S as de, a as ue, c as he } from "./Dashboard-qipRa5MO.js";
3
- import { jsxs as n, jsx as e, Fragment as F } from "react/jsx-runtime";
4
- import { useId as B, useRef as P, useState as a, useEffect as U, useCallback as K } from "react";
5
- function D(i) {
6
- return (i.trim()[0] ?? "?").toUpperCase();
1
+ import { u as B, d as R, S as H, f as O, D as K } from "./Dashboard-D7tbhMwK.js";
2
+ import { E as he, a as me, c as pe } from "./Dashboard-D7tbhMwK.js";
3
+ import { jsxs as n, jsx as e, Fragment as P } from "react/jsx-runtime";
4
+ import { useId as $, useRef as U, useState as i, useEffect as A, useCallback as Y } from "react";
5
+ function F(t) {
6
+ return (t.trim()[0] ?? "?").toUpperCase();
7
7
  }
8
- function Y({
9
- workspaces: i,
10
- selected: t,
11
- onSelect: d,
12
- onChanged: v,
13
- onMembersChanged: o
8
+ function J({
9
+ workspaces: t,
10
+ selected: a,
11
+ onSelect: o,
12
+ onChanged: u,
13
+ onMembersChanged: l
14
14
  }) {
15
- const h = A(), m = B(), p = P(null), [l, y] = a(!1), [b, w] = a("menu"), [g, N] = a(""), [u, C] = a(""), [E, r] = a(null), [k, _] = a(!1);
16
- function S() {
17
- y(!1), w("menu"), N(""), C(""), r(null);
15
+ const m = B(), c = $(), b = U(null), [r, y] = i(!1), [p, v] = i("menu"), [g, k] = i(""), [h, _] = i(""), [E, s] = i(null), [N, I] = i(!1);
16
+ function C() {
17
+ y(!1), v("menu"), k(""), _(""), s(null);
18
18
  }
19
- U(() => {
20
- if (!l) return;
21
- function s($) {
22
- p.current && !p.current.contains($.target) && S();
19
+ A(() => {
20
+ if (!r) return;
21
+ function d(j) {
22
+ b.current && !b.current.contains(j.target) && C();
23
23
  }
24
- function R($) {
25
- $.key === "Escape" && S();
24
+ function x(j) {
25
+ j.key === "Escape" && C();
26
26
  }
27
- return document.addEventListener("mousedown", s), document.addEventListener("keydown", R), () => {
28
- document.removeEventListener("mousedown", s), document.removeEventListener("keydown", R);
27
+ return document.addEventListener("mousedown", d), document.addEventListener("keydown", x), () => {
28
+ document.removeEventListener("mousedown", d), document.removeEventListener("keydown", x);
29
29
  };
30
- }, [l]);
31
- async function x() {
32
- if (!(!g.trim() || k)) {
33
- _(!0), r(null);
30
+ }, [r]);
31
+ async function S() {
32
+ if (!(!g.trim() || N)) {
33
+ I(!0), s(null);
34
34
  try {
35
- const s = await h.createWorkspace({ name: g.trim() });
36
- d(s.id), v(), S();
37
- } catch (s) {
38
- r(I(s));
35
+ const d = await m.createWorkspace({ name: g.trim() });
36
+ o(d.id), u(), C();
37
+ } catch (d) {
38
+ s(R(d));
39
39
  } finally {
40
- _(!1);
40
+ I(!1);
41
41
  }
42
42
  }
43
43
  }
44
- async function L() {
45
- if (!(!u.trim() || k)) {
46
- _(!0), r(null);
44
+ async function T() {
45
+ if (!(!h.trim() || N)) {
46
+ I(!0), s(null);
47
47
  try {
48
- const s = await h.redeemInvite(u.trim());
49
- d(s.workspace.id), v(), o == null || o(), S();
50
- } catch (s) {
51
- r(I(s));
48
+ const d = await m.redeemInvite(h.trim());
49
+ o(d.workspace.id), u(), l == null || l(), C();
50
+ } catch (d) {
51
+ s(R(d));
52
52
  } finally {
53
- _(!1);
53
+ I(!1);
54
54
  }
55
55
  }
56
56
  }
57
- const f = t !== null, T = t ? t.name : "Get started";
58
- return /* @__PURE__ */ n("div", { className: "ws-switcher", ref: p, children: [
57
+ const w = a !== null, L = a ? a.name : "Get started";
58
+ return /* @__PURE__ */ n("div", { className: "ws-switcher", ref: b, children: [
59
59
  /* @__PURE__ */ n(
60
60
  "button",
61
61
  {
62
62
  type: "button",
63
- className: "ws-trig" + (f ? "" : " ws-trig--empty"),
63
+ className: "ws-trig" + (w ? "" : " ws-trig--empty"),
64
64
  "aria-haspopup": "menu",
65
- "aria-expanded": l,
66
- "aria-controls": l ? m : void 0,
67
- onClick: () => l ? S() : y(!0),
65
+ "aria-expanded": r,
66
+ "aria-controls": r ? c : void 0,
67
+ onClick: () => r ? C() : y(!0),
68
68
  children: [
69
- f ? /* @__PURE__ */ e("span", { className: "ws-avatar", "aria-hidden": "true", children: D(T) }) : /* @__PURE__ */ e("span", { className: "ws-plus", "aria-hidden": "true", children: "+" }),
70
- /* @__PURE__ */ e("span", { className: "ws-name", children: T }),
69
+ w ? /* @__PURE__ */ e("span", { className: "ws-avatar", "aria-hidden": "true", children: F(L) }) : /* @__PURE__ */ e("span", { className: "ws-plus", "aria-hidden": "true", children: "+" }),
70
+ /* @__PURE__ */ e("span", { className: "ws-name", children: L }),
71
71
  /* @__PURE__ */ e("span", { className: "ws-caret", "aria-hidden": "true", children: "▾" })
72
72
  ]
73
73
  }
74
74
  ),
75
- l && /* @__PURE__ */ n("div", { className: "ws-menu", id: m, role: "menu", children: [
76
- b === "menu" && /* @__PURE__ */ n(F, { children: [
77
- /* @__PURE__ */ e("p", { className: "ws-menu__head", children: f ? "Switch workspace" : "Your workspaces" }),
78
- i.length === 0 ? /* @__PURE__ */ e("p", { className: "ws-menu__none", children: "None yet" }) : /* @__PURE__ */ e("ul", { className: "ws-menu__list", children: i.map((s) => {
79
- const R = s.id === (t == null ? void 0 : t.id);
75
+ r && /* @__PURE__ */ n("div", { className: "ws-menu", id: c, role: "menu", children: [
76
+ p === "menu" && /* @__PURE__ */ n(P, { children: [
77
+ /* @__PURE__ */ e("p", { className: "ws-menu__head", children: w ? "Switch workspace" : "Your workspaces" }),
78
+ t.length === 0 ? /* @__PURE__ */ e("p", { className: "ws-menu__none", children: "None yet" }) : /* @__PURE__ */ e("ul", { className: "ws-menu__list", children: t.map((d) => {
79
+ const x = d.id === (a == null ? void 0 : a.id);
80
80
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ n(
81
81
  "button",
82
82
  {
83
83
  type: "button",
84
84
  role: "menuitemradio",
85
- "aria-checked": R,
86
- className: "ws-mi" + (R ? " ws-mi--on" : ""),
85
+ "aria-checked": x,
86
+ className: "ws-mi" + (x ? " ws-mi--on" : ""),
87
87
  onClick: () => {
88
- d(s.id), S();
88
+ o(d.id), C();
89
89
  },
90
90
  children: [
91
- /* @__PURE__ */ e("span", { className: "ws-avatar ws-avatar--sm", "aria-hidden": "true", children: D(s.name) }),
92
- /* @__PURE__ */ e("span", { className: "ws-mi__name", children: s.name }),
93
- R && /* @__PURE__ */ e("span", { className: "ws-mi__check", "aria-hidden": "true", children: "✓" })
91
+ /* @__PURE__ */ e("span", { className: "ws-avatar ws-avatar--sm", "aria-hidden": "true", children: F(d.name) }),
92
+ /* @__PURE__ */ e("span", { className: "ws-mi__name", children: d.name }),
93
+ x && /* @__PURE__ */ e("span", { className: "ws-mi__check", "aria-hidden": "true", children: "✓" })
94
94
  ]
95
95
  }
96
- ) }, s.id);
96
+ ) }, d.id);
97
97
  }) }),
98
98
  /* @__PURE__ */ n("div", { className: "ws-menu__actions", children: [
99
99
  /* @__PURE__ */ e(
@@ -103,7 +103,7 @@ function Y({
103
103
  role: "menuitem",
104
104
  className: "ws-action",
105
105
  onClick: () => {
106
- r(null), w("create");
106
+ s(null), v("create");
107
107
  },
108
108
  children: "+ Create workspace"
109
109
  }
@@ -115,63 +115,63 @@ function Y({
115
115
  role: "menuitem",
116
116
  className: "ws-action",
117
117
  onClick: () => {
118
- r(null), w("join");
118
+ s(null), v("join");
119
119
  },
120
120
  children: "⎘ Join with a code"
121
121
  }
122
122
  )
123
123
  ] })
124
124
  ] }),
125
- b === "create" && /* @__PURE__ */ n(
125
+ p === "create" && /* @__PURE__ */ n(
126
126
  "form",
127
127
  {
128
128
  className: "ws-form",
129
- onSubmit: (s) => {
130
- s.preventDefault(), x();
129
+ onSubmit: (d) => {
130
+ d.preventDefault(), S();
131
131
  },
132
132
  children: [
133
- /* @__PURE__ */ e("label", { htmlFor: `${m}-name`, children: "New workspace name" }),
133
+ /* @__PURE__ */ e("label", { htmlFor: `${c}-name`, children: "New workspace name" }),
134
134
  /* @__PURE__ */ e(
135
135
  "input",
136
136
  {
137
- id: `${m}-name`,
137
+ id: `${c}-name`,
138
138
  type: "text",
139
139
  placeholder: "e.g. Acme Engineering",
140
140
  value: g,
141
141
  autoFocus: !0,
142
- onChange: (s) => N(s.target.value)
142
+ onChange: (d) => k(d.target.value)
143
143
  }
144
144
  ),
145
145
  /* @__PURE__ */ n("div", { className: "ws-form__row", children: [
146
- /* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () => w("menu"), children: "Back" }),
147
- /* @__PURE__ */ e("button", { type: "submit", disabled: k || !g.trim(), children: "Create" })
146
+ /* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () => v("menu"), children: "Back" }),
147
+ /* @__PURE__ */ e("button", { type: "submit", disabled: N || !g.trim(), children: "Create" })
148
148
  ] })
149
149
  ]
150
150
  }
151
151
  ),
152
- b === "join" && /* @__PURE__ */ n(
152
+ p === "join" && /* @__PURE__ */ n(
153
153
  "form",
154
154
  {
155
155
  className: "ws-form",
156
- onSubmit: (s) => {
157
- s.preventDefault(), L();
156
+ onSubmit: (d) => {
157
+ d.preventDefault(), T();
158
158
  },
159
159
  children: [
160
- /* @__PURE__ */ e("label", { htmlFor: `${m}-code`, children: "Invite code" }),
160
+ /* @__PURE__ */ e("label", { htmlFor: `${c}-code`, children: "Invite code" }),
161
161
  /* @__PURE__ */ e(
162
162
  "input",
163
163
  {
164
- id: `${m}-code`,
164
+ id: `${c}-code`,
165
165
  type: "text",
166
166
  placeholder: "Paste an invite code",
167
- value: u,
167
+ value: h,
168
168
  autoFocus: !0,
169
- onChange: (s) => C(s.target.value)
169
+ onChange: (d) => _(d.target.value)
170
170
  }
171
171
  ),
172
172
  /* @__PURE__ */ n("div", { className: "ws-form__row", children: [
173
- /* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () => w("menu"), children: "Back" }),
174
- /* @__PURE__ */ e("button", { type: "submit", disabled: k || !u.trim(), children: "Join" })
173
+ /* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () => v("menu"), children: "Back" }),
174
+ /* @__PURE__ */ e("button", { type: "submit", disabled: N || !h.trim(), children: "Join" })
175
175
  ] })
176
176
  ]
177
177
  }
@@ -180,195 +180,314 @@ function Y({
180
180
  ] })
181
181
  ] });
182
182
  }
183
- function J({ workspace: i, onLeft: t }) {
184
- const d = A(), v = B(), [o, h] = a(null), [m, p] = a(!1);
185
- async function l() {
186
- if (!m) {
187
- p(!0), h(null);
183
+ function V({
184
+ workspaceName: t,
185
+ busy: a,
186
+ error: o,
187
+ onConfirm: u,
188
+ onCancel: l
189
+ }) {
190
+ const m = $(), c = $(), [b, r] = i(""), y = U(null);
191
+ A(() => {
192
+ var v;
193
+ (v = y.current) == null || v.focus();
194
+ }, []), A(() => {
195
+ function v(g) {
196
+ g.key === "Escape" && !a && l();
197
+ }
198
+ return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
199
+ }, [a, l]);
200
+ const p = b === t;
201
+ return /* @__PURE__ */ e(
202
+ "div",
203
+ {
204
+ className: "shepherd-modal__backdrop",
205
+ onClick: () => {
206
+ a || l();
207
+ },
208
+ children: /* @__PURE__ */ n(
209
+ "div",
210
+ {
211
+ className: "shepherd-modal",
212
+ role: "dialog",
213
+ "aria-modal": "true",
214
+ "aria-labelledby": m,
215
+ "aria-describedby": c,
216
+ onClick: (v) => v.stopPropagation(),
217
+ children: [
218
+ /* @__PURE__ */ e("h3", { id: m, children: "Delete workspace" }),
219
+ /* @__PURE__ */ n("p", { id: c, className: "shepherd-modal__body", children: [
220
+ "This permanently deletes ",
221
+ /* @__PURE__ */ e("b", { children: t }),
222
+ " and all of its data — agents, sessions, tasks, announcements, change history, tokens, invites, and members. This cannot be undone."
223
+ ] }),
224
+ /* @__PURE__ */ n("label", { htmlFor: `${m}-input`, className: "shepherd-modal__label", children: [
225
+ "Type ",
226
+ /* @__PURE__ */ e("b", { children: t }),
227
+ " to confirm"
228
+ ] }),
229
+ /* @__PURE__ */ e(
230
+ "input",
231
+ {
232
+ id: `${m}-input`,
233
+ ref: y,
234
+ type: "text",
235
+ value: b,
236
+ autoComplete: "off",
237
+ disabled: a,
238
+ onChange: (v) => r(v.target.value)
239
+ }
240
+ ),
241
+ o && /* @__PURE__ */ e("p", { role: "alert", children: o }),
242
+ /* @__PURE__ */ n("div", { className: "shepherd-modal__actions", children: [
243
+ /* @__PURE__ */ e("button", { type: "button", onClick: l, disabled: a, children: "Cancel" }),
244
+ /* @__PURE__ */ e(
245
+ "button",
246
+ {
247
+ type: "button",
248
+ className: "danger",
249
+ onClick: u,
250
+ disabled: !p || a,
251
+ children: a ? "Deleting…" : "Delete workspace"
252
+ }
253
+ )
254
+ ] })
255
+ ]
256
+ }
257
+ )
258
+ }
259
+ );
260
+ }
261
+ function M({ workspace: t, onLeft: a, onDeleted: o }) {
262
+ const u = B(), l = $(), [m, c] = i(null), [b, r] = i(!1), [y, p] = i(!1), [v, g] = i(!1), [k, h] = i(!1), [_, E] = i(null), s = t.role === "admin";
263
+ async function N() {
264
+ if (!b) {
265
+ r(!0), c(null), p(!1);
266
+ try {
267
+ await u.leave(t.id), a == null || a();
268
+ } catch (C) {
269
+ c(R(C)), C instanceof H && C.status === 409 && p(!0);
270
+ } finally {
271
+ r(!1);
272
+ }
273
+ }
274
+ }
275
+ async function I() {
276
+ if (!k) {
277
+ h(!0), E(null);
188
278
  try {
189
- await d.leave(i.id), t == null || t();
190
- } catch (y) {
191
- h(I(y));
279
+ await u.deleteWorkspace(t.id), g(!1), o == null || o();
280
+ } catch (C) {
281
+ E(R(C));
192
282
  } finally {
193
- p(!1);
283
+ h(!1);
194
284
  }
195
285
  }
196
286
  }
197
- return /* @__PURE__ */ n("section", { className: "shepherd-general", "aria-labelledby": v, children: [
287
+ return /* @__PURE__ */ n("section", { className: "shepherd-general", "aria-labelledby": l, children: [
198
288
  /* @__PURE__ */ n("div", { className: "card-head", children: [
199
- /* @__PURE__ */ e("h3", { id: v, children: "General" }),
289
+ /* @__PURE__ */ e("h3", { id: l, children: "General" }),
200
290
  /* @__PURE__ */ e("p", { className: "card-sub", children: "Your active workspace and its settings." })
201
291
  ] }),
202
292
  /* @__PURE__ */ n("div", { className: "card-body", children: [
203
- o && /* @__PURE__ */ e("p", { role: "alert", children: o }),
293
+ m && /* @__PURE__ */ e("p", { role: "alert", children: m }),
294
+ y && s && /* @__PURE__ */ e("p", { className: "helper", children: "You're the last admin, so you can't leave. To remove this workspace entirely, delete it below." }),
204
295
  /* @__PURE__ */ n("div", { className: "field", children: [
205
296
  /* @__PURE__ */ e("label", { children: "Workspace name" }),
206
- /* @__PURE__ */ e("p", { className: "readonly-value", children: i.name })
297
+ /* @__PURE__ */ e("p", { className: "readonly-value", children: t.name })
207
298
  ] }),
208
299
  /* @__PURE__ */ n("div", { className: "field", children: [
209
300
  /* @__PURE__ */ e("label", { children: "Your role" }),
210
- /* @__PURE__ */ e("p", { className: "readonly-value", children: i.role })
301
+ /* @__PURE__ */ e("p", { className: "readonly-value", children: t.role })
211
302
  ] }),
212
303
  /* @__PURE__ */ n("div", { className: "field leave", children: [
213
304
  /* @__PURE__ */ e("label", { children: "Leave workspace" }),
214
305
  /* @__PURE__ */ e("p", { className: "helper", children: "Remove yourself from this workspace. You'll need a new invite to rejoin." }),
215
- /* @__PURE__ */ e("button", { type: "button", className: "danger", onClick: () => void l(), disabled: m, children: "Leave workspace" })
306
+ /* @__PURE__ */ e("button", { type: "button", className: "danger", onClick: () => void N(), disabled: b, children: "Leave workspace" })
307
+ ] }),
308
+ s && /* @__PURE__ */ n("div", { className: "field delete", children: [
309
+ /* @__PURE__ */ e("label", { children: "Delete workspace" }),
310
+ /* @__PURE__ */ e("p", { className: "helper", children: "Permanently delete this workspace and all of its data. This cannot be undone." }),
311
+ /* @__PURE__ */ e(
312
+ "button",
313
+ {
314
+ type: "button",
315
+ className: "danger",
316
+ onClick: () => {
317
+ E(null), g(!0);
318
+ },
319
+ disabled: k,
320
+ children: "Delete workspace"
321
+ }
322
+ )
216
323
  ] })
217
- ] })
324
+ ] }),
325
+ v && /* @__PURE__ */ e(
326
+ V,
327
+ {
328
+ workspaceName: t.name,
329
+ busy: k,
330
+ error: _,
331
+ onConfirm: () => void I(),
332
+ onCancel: () => {
333
+ k || g(!1);
334
+ }
335
+ }
336
+ )
218
337
  ] });
219
338
  }
220
- function V({ workspaceId: i, refreshKey: t = 0, canRemove: d = !1 }) {
221
- const v = A(), o = B(), [h, m] = a([]), [p, l] = a(null), [y, b] = a(null), [w, g] = a(!0), [N, u] = a(null);
222
- async function C({ keepError: r = !1 } = {}) {
223
- r || l(null);
339
+ function X({ workspaceId: t, refreshKey: a = 0, canRemove: o = !1 }) {
340
+ const u = B(), l = $(), [m, c] = i([]), [b, r] = i(null), [y, p] = i(null), [v, g] = i(!0), [k, h] = i(null);
341
+ async function _({ keepError: s = !1 } = {}) {
342
+ s || r(null);
224
343
  try {
225
- const k = await v.listMembers(i);
226
- m(k.members);
227
- } catch (k) {
228
- l(I(k));
344
+ const N = await u.listMembers(t);
345
+ c(N.members);
346
+ } catch (N) {
347
+ r(R(N));
229
348
  } finally {
230
349
  g(!1);
231
350
  }
232
351
  }
233
- U(() => {
234
- g(!0), C();
235
- }, [v, i, t]);
236
- async function E(r, k) {
237
- if (!N) {
238
- u(r), l(null), b(null), m((_) => _.filter((S) => S.accountId !== r));
352
+ A(() => {
353
+ g(!0), _();
354
+ }, [u, t, a]);
355
+ async function E(s, N) {
356
+ if (!k) {
357
+ h(s), r(null), p(null), c((I) => I.filter((C) => C.accountId !== s));
239
358
  try {
240
- await v.removeMember(i, r), b(`Removed ${k}`);
241
- } catch (_) {
242
- l(I(_)), C({ keepError: !0 });
359
+ await u.removeMember(t, s), p(`Removed ${N}`);
360
+ } catch (I) {
361
+ r(R(I)), _({ keepError: !0 });
243
362
  } finally {
244
- u(null);
363
+ h(null);
245
364
  }
246
365
  }
247
366
  }
248
- return /* @__PURE__ */ n("section", { className: "shepherd-members", "aria-labelledby": o, children: [
249
- /* @__PURE__ */ e("div", { className: "card-head", children: /* @__PURE__ */ e("h3", { id: o, children: "Members" }) }),
367
+ return /* @__PURE__ */ n("section", { className: "shepherd-members", "aria-labelledby": l, children: [
368
+ /* @__PURE__ */ e("div", { className: "card-head", children: /* @__PURE__ */ e("h3", { id: l, children: "Members" }) }),
250
369
  /* @__PURE__ */ n("div", { className: "card-body", children: [
251
- p && /* @__PURE__ */ e("p", { role: "alert", children: p }),
370
+ b && /* @__PURE__ */ e("p", { role: "alert", children: b }),
252
371
  y && /* @__PURE__ */ e("p", { role: "status", children: y }),
253
- w ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) : h.length === 0 ? /* @__PURE__ */ e("p", { children: "No members." }) : /* @__PURE__ */ e("ul", { children: h.map((r) => {
254
- const k = r.displayName ?? r.githubLogin ?? r.email ?? r.accountId;
372
+ v ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) : m.length === 0 ? /* @__PURE__ */ e("p", { children: "No members." }) : /* @__PURE__ */ e("ul", { children: m.map((s) => {
373
+ const N = s.displayName ?? s.githubLogin ?? s.email ?? s.accountId;
255
374
  return /* @__PURE__ */ n("li", { children: [
256
- /* @__PURE__ */ e("span", { children: k }),
257
- /* @__PURE__ */ e("span", { className: "role", children: r.role }),
258
- d && /* @__PURE__ */ e(
375
+ /* @__PURE__ */ e("span", { children: N }),
376
+ /* @__PURE__ */ e("span", { className: "role", children: s.role }),
377
+ o && /* @__PURE__ */ e(
259
378
  "button",
260
379
  {
261
380
  type: "button",
262
- "aria-label": `Remove ${k}`,
263
- onClick: () => void E(r.accountId, k),
264
- disabled: N === r.accountId,
381
+ "aria-label": `Remove ${N}`,
382
+ onClick: () => void E(s.accountId, N),
383
+ disabled: k === s.accountId,
265
384
  children: "Remove"
266
385
  }
267
386
  )
268
- ] }, r.accountId);
387
+ ] }, s.accountId);
269
388
  }) })
270
389
  ] })
271
390
  ] });
272
391
  }
273
- function X({ workspaceId: i, onMembersChanged: t }) {
274
- const d = A(), v = B(), [o, h] = a(null), [m, p] = a(null), [l, y] = a(!1), [b, w] = a(""), [g, N] = a(null), [u, C] = a(!1), [E, r] = a(null);
275
- U(() => {
276
- h(null), N(null);
277
- }, [i]);
278
- async function k() {
279
- if (!l) {
280
- y(!0), p(null);
392
+ function q({ workspaceId: t, onMembersChanged: a }) {
393
+ const o = B(), u = $(), [l, m] = i(null), [c, b] = i(null), [r, y] = i(!1), [p, v] = i(""), [g, k] = i(null), [h, _] = i(!1), [E, s] = i(null);
394
+ A(() => {
395
+ m(null), k(null);
396
+ }, [t]);
397
+ async function N() {
398
+ if (!r) {
399
+ y(!0), b(null);
281
400
  try {
282
- const f = await d.createInvite(i, {});
283
- h(f), t == null || t();
284
- } catch (f) {
285
- p(I(f));
401
+ const w = await o.createInvite(t, {});
402
+ m(w), a == null || a();
403
+ } catch (w) {
404
+ b(R(w));
286
405
  } finally {
287
406
  y(!1);
288
407
  }
289
408
  }
290
409
  }
291
- async function _() {
292
- if (!(!o || l)) {
293
- y(!0), p(null);
410
+ async function I() {
411
+ if (!(!l || r)) {
412
+ y(!0), b(null);
294
413
  try {
295
- await d.revokeInvite(i, o.code), h(null);
296
- } catch (f) {
297
- p(I(f));
414
+ await o.revokeInvite(t, l.code), m(null);
415
+ } catch (w) {
416
+ b(R(w));
298
417
  } finally {
299
418
  y(!1);
300
419
  }
301
420
  }
302
421
  }
303
- async function S() {
304
- if (!(!b.trim() || u)) {
305
- C(!0), N(null);
422
+ async function C() {
423
+ if (!(!p.trim() || h)) {
424
+ _(!0), k(null);
306
425
  try {
307
- const f = await d.inviteByEmail(i, b.trim());
308
- N(`Invite sent to ${f.email}.`), w(""), t == null || t();
309
- } catch (f) {
310
- N(I(f));
426
+ const w = await o.inviteByEmail(t, p.trim());
427
+ k(`Invite sent to ${w.email}.`), v(""), a == null || a();
428
+ } catch (w) {
429
+ k(R(w));
311
430
  } finally {
312
- C(!1);
431
+ _(!1);
313
432
  }
314
433
  }
315
434
  }
316
- const x = o ? `${window.location.origin}/shepherd/join/${encodeURIComponent(o.code)}` : null;
317
- async function L(f, T) {
318
- await navigator.clipboard.writeText(T), r(f), setTimeout(() => r((s) => s === f ? null : s), 2e3);
435
+ const S = l ? `${window.location.origin}/shepherd/join/${encodeURIComponent(l.code)}` : null;
436
+ async function T(w, L) {
437
+ await navigator.clipboard.writeText(L), s(w), setTimeout(() => s((d) => d === w ? null : d), 2e3);
319
438
  }
320
- return /* @__PURE__ */ n("section", { className: "shepherd-invites", "aria-labelledby": v, children: [
439
+ return /* @__PURE__ */ n("section", { className: "shepherd-invites", "aria-labelledby": u, children: [
321
440
  /* @__PURE__ */ n("div", { className: "card-head", children: [
322
- /* @__PURE__ */ e("h3", { id: v, children: "Invite people" }),
441
+ /* @__PURE__ */ e("h3", { id: u, children: "Invite people" }),
323
442
  /* @__PURE__ */ e("p", { className: "card-sub", children: "Share a code, or send a one-time join link by email." })
324
443
  ] }),
325
444
  /* @__PURE__ */ n("div", { className: "card-body", children: [
326
- m && /* @__PURE__ */ e("p", { role: "alert", children: m }),
445
+ c && /* @__PURE__ */ e("p", { role: "alert", children: c }),
327
446
  /* @__PURE__ */ n("div", { className: "field invites", children: [
328
447
  /* @__PURE__ */ e("label", { children: "Invite by code" }),
329
448
  /* @__PURE__ */ e("p", { className: "helper", children: "Anyone with the code can join this workspace." }),
330
- o && /* @__PURE__ */ n("div", { className: "invite-result", children: [
449
+ l && /* @__PURE__ */ n("div", { className: "invite-result", children: [
331
450
  /* @__PURE__ */ n("div", { className: "invite-result__head", children: [
332
451
  /* @__PURE__ */ e("span", { className: "invite-result__eyebrow", children: "Invite code" }),
333
- /* @__PURE__ */ e("span", { className: "invite-uses", children: o.maxUses === null ? `${o.useCount} uses` : `${o.useCount} / ${o.maxUses} uses` }),
452
+ /* @__PURE__ */ e("span", { className: "invite-uses", children: l.maxUses === null ? `${l.useCount} uses` : `${l.useCount} / ${l.maxUses} uses` }),
334
453
  /* @__PURE__ */ e(
335
454
  "button",
336
455
  {
337
456
  type: "button",
338
457
  className: "link-btn",
339
458
  "aria-label": "Revoke invite",
340
- onClick: () => void _(),
341
- disabled: l,
459
+ onClick: () => void I(),
460
+ disabled: r,
342
461
  children: "Revoke"
343
462
  }
344
463
  )
345
464
  ] }),
346
465
  /* @__PURE__ */ n("div", { className: "invite-result__copyrow", children: [
347
- /* @__PURE__ */ e("code", { children: o.code }),
466
+ /* @__PURE__ */ e("code", { children: l.code }),
348
467
  /* @__PURE__ */ e(
349
468
  "button",
350
469
  {
351
470
  type: "button",
352
471
  className: "copy-btn",
353
- onClick: () => void L("code", o.code),
472
+ onClick: () => void T("code", l.code),
354
473
  children: E === "code" ? "Copied" : "Copy"
355
474
  }
356
475
  )
357
476
  ] }),
358
- x && /* @__PURE__ */ n("div", { className: "invite-result__copyrow invite-result__copyrow--link", children: [
359
- /* @__PURE__ */ e("a", { href: x, children: x }),
477
+ S && /* @__PURE__ */ n("div", { className: "invite-result__copyrow invite-result__copyrow--link", children: [
478
+ /* @__PURE__ */ e("a", { href: S, children: S }),
360
479
  /* @__PURE__ */ e(
361
480
  "button",
362
481
  {
363
482
  type: "button",
364
483
  className: "copy-btn",
365
- onClick: () => void L("link", x),
484
+ onClick: () => void T("link", S),
366
485
  children: E === "link" ? "Copied" : "Copy link"
367
486
  }
368
487
  )
369
488
  ] })
370
489
  ] }),
371
- /* @__PURE__ */ e("button", { type: "button", onClick: () => void k(), disabled: l, children: "Create invite" })
490
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => void N(), disabled: r, children: "Create invite" })
372
491
  ] }),
373
492
  /* @__PURE__ */ n("div", { className: "field email-invite", children: [
374
493
  /* @__PURE__ */ e("label", { htmlFor: "invite-email", children: "Invite by email" }),
@@ -380,98 +499,105 @@ function X({ workspaceId: i, onMembersChanged: t }) {
380
499
  id: "invite-email",
381
500
  type: "email",
382
501
  placeholder: "name@example.com",
383
- value: b,
384
- onChange: (f) => w(f.target.value)
502
+ value: p,
503
+ onChange: (w) => v(w.target.value)
385
504
  }
386
505
  ),
387
- /* @__PURE__ */ e("button", { type: "button", onClick: () => void S(), disabled: u, children: "Send invite" })
506
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => void C(), disabled: h, children: "Send invite" })
388
507
  ] }),
389
508
  g && /* @__PURE__ */ e("p", { className: "email-invite__status", children: g })
390
509
  ] })
391
510
  ] })
392
511
  ] });
393
512
  }
394
- const q = [
513
+ const z = [
395
514
  { id: "claude", label: "Claude Code" },
396
515
  { id: "codex", label: "Codex" },
397
516
  { id: "pi", label: "Pi" },
517
+ { id: "cursor", label: "Cursor" },
398
518
  { id: "generic", label: "Generic (JSON)" }
399
- ], z = "shp_<paste-after-generating>", Q = {
519
+ ], Q = "shp_<paste-after-generating>", Z = {
400
520
  claude: "claude mcp add shepherd -s user",
401
- codex: "codex mcp add shepherd",
402
- pi: "pi mcp add shepherd"
521
+ codex: "codex mcp add shepherd"
522
+ }, ee = {
523
+ claude: "-e",
524
+ codex: "--env"
403
525
  };
404
- function Z(i, t) {
405
- const d = `created ${O(i.createdAt, t)}`, v = i.lastUsedAt ? `last used ${O(i.lastUsedAt, t)}` : "never used";
406
- return `${d} · ${v}`;
526
+ function ne(t, a) {
527
+ const o = `created ${O(t.createdAt, a)}`, u = t.lastUsedAt ? `last used ${O(t.lastUsedAt, a)}` : "never used";
528
+ return `${o} · ${u}`;
407
529
  }
408
- function M(i, t, d) {
409
- return i === "generic" ? JSON.stringify(
410
- {
411
- mcpServers: {
412
- shepherd: {
413
- command: "npx",
414
- args: ["-y", "@korso/shepherd"],
415
- env: { HUB_URL: t, SHEPHERD_TOKEN: d }
530
+ function te(t, a, o) {
531
+ if (t === "generic" || t === "pi" || t === "cursor") {
532
+ const m = { HUB_URL: a, SHEPHERD_TOKEN: o };
533
+ return t !== "generic" && (m.PROGRAM = t), JSON.stringify(
534
+ {
535
+ mcpServers: {
536
+ shepherd: {
537
+ command: "npx",
538
+ args: ["-y", "--package=@korso/shepherd", "shepherd-mcp"],
539
+ env: m
540
+ }
416
541
  }
417
- }
418
- },
419
- null,
420
- 2
421
- ) : [
422
- Q[i],
423
- `-e HUB_URL=${t}`,
424
- `-e SHEPHERD_TOKEN=${d}`,
425
- "-- npx -y @korso/shepherd"
426
- ].join(" ");
542
+ },
543
+ null,
544
+ 2
545
+ );
546
+ }
547
+ const u = ee[t], l = [
548
+ Z[t],
549
+ `${u} HUB_URL=${a}`,
550
+ `${u} SHEPHERD_TOKEN=${o}`
551
+ ];
552
+ return t === "codex" && l.push(`${u} PROGRAM=codex`), l.push("-- npx -y --package=@korso/shepherd shepherd-mcp"), l.join(" ");
427
553
  }
428
- function ee({ hubUrl: i }) {
429
- const t = A(), d = i ?? t.baseUrl, v = B(), [o, h] = a("claude"), [m, p] = a(""), [l, y] = a(null), [b, w] = a([]), [g, N] = a(null), [u, C] = a(null), [E, r] = a(!1), [k, _] = a(!1), [S, x] = a(!0), [L, f] = a(null);
430
- async function T() {
554
+ function ae({ hubUrl: t }) {
555
+ const a = B(), o = t ?? a.baseUrl, u = $(), [l, m] = i("claude"), [c, b] = i(""), [r, y] = i(null), [p, v] = i([]), [g, k] = i(null), [h, _] = i(null), [E, s] = i(!1), [N, I] = i(!1), [C, S] = i(!0), [T, w] = i(null);
556
+ async function L() {
431
557
  try {
432
- const c = await t.listAccountTokens();
433
- w(c.tokens);
434
- } catch (c) {
435
- N(I(c));
558
+ const f = await a.listAccountTokens();
559
+ v(f.tokens);
560
+ } catch (f) {
561
+ k(R(f));
436
562
  } finally {
437
- x(!1);
563
+ S(!1);
438
564
  }
439
565
  }
440
- U(() => {
441
- x(!0), T();
442
- }, [t]);
443
- async function s() {
444
- r(!0), N(null);
566
+ A(() => {
567
+ S(!0), L();
568
+ }, [a]);
569
+ async function d() {
570
+ s(!0), k(null);
445
571
  try {
446
- const c = await t.mintAccountToken(
447
- m.trim() ? { name: m.trim() } : {}
572
+ const f = await a.mintAccountToken(
573
+ c.trim() ? { name: c.trim() } : {}
448
574
  );
449
- y(c.token), p(""), await T();
450
- } catch (c) {
451
- N(I(c));
575
+ y(f.token), b(""), await L();
576
+ } catch (f) {
577
+ k(R(f));
452
578
  } finally {
453
- r(!1);
579
+ s(!1);
454
580
  }
455
581
  }
456
- async function R(c) {
457
- if (!L) {
458
- f(c), N(null), C(null);
582
+ async function x(f) {
583
+ if (!T) {
584
+ w(f), k(null), _(null);
459
585
  try {
460
- await t.revokeAccountToken(c), w((j) => j.filter((W) => W.id !== c)), C("Token revoked");
461
- } catch (j) {
462
- N(I(j));
586
+ await a.revokeAccountToken(f), v((D) => D.filter((W) => W.id !== f)), _("Token revoked");
587
+ } catch (D) {
588
+ k(R(D));
463
589
  } finally {
464
- f(null);
590
+ w(null);
465
591
  }
466
592
  }
467
593
  }
468
- const $ = M(o, d, l ?? z);
469
- async function H() {
470
- await navigator.clipboard.writeText($), _(!0), setTimeout(() => _(!1), 2e3);
594
+ const j = te(l, o, r ?? Q);
595
+ async function G() {
596
+ await navigator.clipboard.writeText(j), I(!0), setTimeout(() => I(!1), 2e3);
471
597
  }
472
- return /* @__PURE__ */ n("section", { className: "shepherd-connect-agent", "aria-labelledby": v, children: [
598
+ return /* @__PURE__ */ n("section", { className: "shepherd-connect-agent", "aria-labelledby": u, children: [
473
599
  /* @__PURE__ */ n("div", { className: "card-head", children: [
474
- /* @__PURE__ */ e("h3", { id: v, children: "Connect your agent" }),
600
+ /* @__PURE__ */ e("h3", { id: u, children: "Connect your agent" }),
475
601
  /* @__PURE__ */ e("p", { className: "card-sub", children: "Generate a token — it works across all your workspaces — then paste the command into your coding tool." }),
476
602
  /* @__PURE__ */ e("p", { className: "card-sub", children: "The first time the agent opens a repo, it'll ask which workspace to coordinate that repo with." })
477
603
  ] }),
@@ -482,9 +608,9 @@ function ee({ hubUrl: i }) {
482
608
  "select",
483
609
  {
484
610
  id: "connect-tool",
485
- value: o,
486
- onChange: (c) => h(c.target.value),
487
- children: q.map((c) => /* @__PURE__ */ e("option", { value: c.id, children: c.label }, c.id))
611
+ value: l,
612
+ onChange: (f) => m(f.target.value),
613
+ children: z.map((f) => /* @__PURE__ */ e("option", { value: f.id, children: f.label }, f.id))
488
614
  }
489
615
  )
490
616
  ] }),
@@ -496,28 +622,28 @@ function ee({ hubUrl: i }) {
496
622
  {
497
623
  id: "token-name",
498
624
  type: "text",
499
- value: m,
500
- onChange: (c) => p(c.target.value),
625
+ value: c,
626
+ onChange: (f) => b(f.target.value),
501
627
  placeholder: "e.g. laptop"
502
628
  }
503
629
  ),
504
- /* @__PURE__ */ e("button", { type: "button", onClick: () => void s(), disabled: E, children: "Generate token" })
630
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => void d(), disabled: E, children: "Generate token" })
505
631
  ] })
506
632
  ] }),
507
633
  g && /* @__PURE__ */ e("p", { role: "alert", children: g }),
508
- u && /* @__PURE__ */ e("p", { role: "status", children: u }),
509
- l && /* @__PURE__ */ e("p", { className: "token-once", role: "status", children: "Copy this token now — it won't be shown again." }),
634
+ h && /* @__PURE__ */ e("p", { role: "status", children: h }),
635
+ r && /* @__PURE__ */ e("p", { className: "token-once", role: "status", children: "Copy this token now — it won't be shown again." }),
510
636
  /* @__PURE__ */ n("div", { className: "install-command", children: [
511
- /* @__PURE__ */ e("pre", { "data-testid": "install-command", children: $ }),
637
+ /* @__PURE__ */ e("pre", { "data-testid": "install-command", children: j }),
512
638
  /* @__PURE__ */ e(
513
639
  "button",
514
640
  {
515
641
  type: "button",
516
642
  className: "install-command__copy",
517
- "aria-label": k ? "Copied" : "Copy command",
518
- title: k ? "Copied" : "Copy",
519
- onClick: () => void H(),
520
- children: k ? /* @__PURE__ */ e(
643
+ "aria-label": N ? "Copied" : "Copy command",
644
+ title: N ? "Copied" : "Copy",
645
+ onClick: () => void G(),
646
+ children: N ? /* @__PURE__ */ e(
521
647
  "svg",
522
648
  {
523
649
  width: "15",
@@ -553,111 +679,113 @@ function ee({ hubUrl: i }) {
553
679
  )
554
680
  ] }),
555
681
  /* @__PURE__ */ e("h4", { children: "Existing tokens" }),
556
- S ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) : b.length === 0 ? /* @__PURE__ */ e("p", { children: "No tokens yet." }) : /* @__PURE__ */ e("ul", { children: b.map((c) => {
557
- const j = c.name ?? c.id;
682
+ C ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) : p.length === 0 ? /* @__PURE__ */ e("p", { children: "No tokens yet." }) : /* @__PURE__ */ e("ul", { children: p.map((f) => {
683
+ const D = f.name ?? f.id;
558
684
  return /* @__PURE__ */ n("li", { children: [
559
- /* @__PURE__ */ e("span", { children: j }),
560
- /* @__PURE__ */ e("span", { className: "token-meta", children: Z(c, Date.now()) }),
561
- c.revokedAt ? /* @__PURE__ */ e("span", { className: "revoked", children: "revoked" }) : /* @__PURE__ */ e(
685
+ /* @__PURE__ */ e("span", { children: D }),
686
+ /* @__PURE__ */ e("span", { className: "token-meta", children: ne(f, Date.now()) }),
687
+ f.revokedAt ? /* @__PURE__ */ e("span", { className: "revoked", children: "revoked" }) : /* @__PURE__ */ e(
562
688
  "button",
563
689
  {
564
690
  type: "button",
565
- "aria-label": `Revoke token ${j}`,
566
- onClick: () => void R(c.id),
567
- disabled: L === c.id,
691
+ "aria-label": `Revoke token ${D}`,
692
+ onClick: () => void x(f.id),
693
+ disabled: T === f.id,
568
694
  children: "Revoke"
569
695
  }
570
696
  )
571
- ] }, c.id);
697
+ ] }, f.id);
572
698
  }) })
573
699
  ] })
574
700
  ] });
575
701
  }
576
- const ne = [
702
+ const ie = [
577
703
  { id: "general", label: "General" },
578
704
  { id: "members", label: "Members" },
579
705
  { id: "agent", label: "Agent" }
580
706
  ];
581
- function te({
582
- workspace: i,
583
- hubUrl: t,
584
- membersRefreshKey: d,
585
- onMembersChanged: v,
586
- onLeft: o
707
+ function le({
708
+ workspace: t,
709
+ hubUrl: a,
710
+ membersRefreshKey: o,
711
+ onMembersChanged: u,
712
+ onLeft: l,
713
+ onDeleted: m
587
714
  }) {
588
- const [h, m] = a("general"), p = i.role === "admin";
715
+ const [c, b] = i("general"), r = t.role === "admin";
589
716
  return /* @__PURE__ */ n("div", { className: "config-layout", children: [
590
- /* @__PURE__ */ e("nav", { className: "config-nav", "aria-label": "Configuration sections", children: ne.map(({ id: l, label: y }) => /* @__PURE__ */ e(
717
+ /* @__PURE__ */ e("nav", { className: "config-nav", "aria-label": "Configuration sections", children: ie.map(({ id: y, label: p }) => /* @__PURE__ */ e(
591
718
  "button",
592
719
  {
593
720
  type: "button",
594
- className: "config-nav__item" + (h === l ? " config-nav__item--on" : ""),
595
- "aria-current": h === l ? "page" : void 0,
596
- onClick: () => m(l),
597
- children: y
721
+ className: "config-nav__item" + (c === y ? " config-nav__item--on" : ""),
722
+ "aria-current": c === y ? "page" : void 0,
723
+ onClick: () => b(y),
724
+ children: p
598
725
  },
599
- l
726
+ y
600
727
  )) }),
601
728
  /* @__PURE__ */ n("div", { className: "config-panel", children: [
602
- h === "general" && /* @__PURE__ */ e(J, { workspace: i, onLeft: o }),
603
- h === "members" && /* @__PURE__ */ n(F, { children: [
729
+ c === "general" && /* @__PURE__ */ e(M, { workspace: t, onLeft: l, onDeleted: m }),
730
+ c === "members" && /* @__PURE__ */ n(P, { children: [
604
731
  /* @__PURE__ */ e(
605
- V,
732
+ X,
606
733
  {
607
- workspaceId: i.id,
608
- refreshKey: d,
609
- canRemove: p
734
+ workspaceId: t.id,
735
+ refreshKey: o,
736
+ canRemove: r
610
737
  }
611
738
  ),
612
- p && /* @__PURE__ */ e(X, { workspaceId: i.id, onMembersChanged: v })
739
+ r && /* @__PURE__ */ e(q, { workspaceId: t.id, onMembersChanged: u })
613
740
  ] }),
614
- h === "agent" && /* @__PURE__ */ e(ee, { hubUrl: t })
741
+ c === "agent" && /* @__PURE__ */ e(ae, { hubUrl: a })
615
742
  ] })
616
743
  ] });
617
744
  }
618
- function re({ hubUrl: i }) {
619
- const t = A(), [d, v] = a({ status: "loading" }), [o, h] = a(null), [m, p] = a(0), l = K(async () => {
745
+ function ce({ hubUrl: t }) {
746
+ const a = B(), [o, u] = i({ status: "loading" }), [l, m] = i(null), [c, b] = i(0), r = Y(async () => {
620
747
  try {
621
- const u = await t.listWorkspaces();
622
- v({ status: "ready", workspaces: u.workspaces }), h(
623
- (C) => {
748
+ const h = await a.listWorkspaces();
749
+ u({ status: "ready", workspaces: h.workspaces }), m(
750
+ (_) => {
624
751
  var E;
625
- return C && u.workspaces.some((r) => r.id === C) ? C : ((E = u.workspaces[0]) == null ? void 0 : E.id) ?? null;
752
+ return _ && h.workspaces.some((s) => s.id === _) ? _ : ((E = h.workspaces[0]) == null ? void 0 : E.id) ?? null;
626
753
  }
627
754
  );
628
- } catch (u) {
629
- v({ status: "error", message: I(u) });
755
+ } catch (h) {
756
+ u({ status: "error", message: R(h) });
630
757
  }
631
- }, [t]);
632
- U(() => {
633
- l();
634
- }, [l]);
635
- const y = d.status === "ready" ? d.workspaces : [], b = y.find((u) => u.id === o) ?? null;
636
- if (d.status === "loading")
758
+ }, [a]);
759
+ A(() => {
760
+ r();
761
+ }, [r]);
762
+ const y = o.status === "ready" ? o.workspaces : [], p = y.find((h) => h.id === l) ?? null;
763
+ if (o.status === "loading")
637
764
  return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) });
638
- if (d.status === "error")
639
- return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "alert", children: d.message }) });
640
- const w = y.length > 0, g = /* @__PURE__ */ e(
641
- Y,
765
+ if (o.status === "error")
766
+ return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "alert", children: o.message }) });
767
+ const v = y.length > 0, g = /* @__PURE__ */ e(
768
+ J,
642
769
  {
643
770
  workspaces: y,
644
- selected: b,
645
- onSelect: h,
771
+ selected: p,
772
+ onSelect: m,
646
773
  onChanged: () => {
647
- l();
774
+ r();
648
775
  },
649
- onMembersChanged: () => p((u) => u + 1)
776
+ onMembersChanged: () => b((h) => h + 1)
650
777
  }
651
- ), N = /* @__PURE__ */ n("section", { className: "shepherd-config", "aria-labelledby": "config-heading", children: [
778
+ ), k = /* @__PURE__ */ n("section", { className: "shepherd-config", "aria-labelledby": "config-heading", children: [
652
779
  /* @__PURE__ */ e("h2", { id: "config-heading", children: "Configuration" }),
653
- b ? /* @__PURE__ */ e(
654
- te,
780
+ p ? /* @__PURE__ */ e(
781
+ le,
655
782
  {
656
- workspace: b,
657
- hubUrl: i,
658
- membersRefreshKey: m,
659
- onMembersChanged: () => p((u) => u + 1),
660
- onLeft: () => void l()
783
+ workspace: p,
784
+ hubUrl: t,
785
+ membersRefreshKey: c,
786
+ onMembersChanged: () => b((h) => h + 1),
787
+ onLeft: () => void r(),
788
+ onDeleted: () => void r()
661
789
  }
662
790
  ) : /* @__PURE__ */ n("p", { className: "config-none", children: [
663
791
  "You're not in a workspace yet. Use the ",
@@ -666,28 +794,28 @@ function re({ hubUrl: i }) {
666
794
  ] })
667
795
  ] });
668
796
  return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e(
669
- G,
797
+ K,
670
798
  {
671
- workspaceId: b == null ? void 0 : b.id,
672
- config: N,
799
+ workspaceId: p == null ? void 0 : p.id,
800
+ config: k,
673
801
  switcher: g,
674
- hasWorkspace: w
802
+ hasWorkspace: v
675
803
  }
676
804
  ) });
677
805
  }
678
806
  export {
679
- te as ConfigPanel,
680
- ee as ConnectAgent,
681
- G as Dashboard,
682
- ce as EmptyState,
683
- J as GeneralSettings,
684
- X as Invites,
685
- V as Members,
686
- de as ShepherdClientError,
687
- ue as ShepherdClientProvider,
688
- re as ShepherdRoot,
689
- Y as WorkspaceSwitcher,
690
- he as createShepherdClient,
691
- I as describeError,
692
- A as useShepherdClient
807
+ le as ConfigPanel,
808
+ ae as ConnectAgent,
809
+ K as Dashboard,
810
+ he as EmptyState,
811
+ M as GeneralSettings,
812
+ q as Invites,
813
+ X as Members,
814
+ H as ShepherdClientError,
815
+ me as ShepherdClientProvider,
816
+ ce as ShepherdRoot,
817
+ J as WorkspaceSwitcher,
818
+ pe as createShepherdClient,
819
+ R as describeError,
820
+ B as useShepherdClient
693
821
  };