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