@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/config/ConnectAgent.js +76 -12
- package/dist/lib/index.js +374 -329
- package/dist/lib/styles.css +12 -5
- package/dist/selfhost/assets/{index-C78oV7tm.css → index-dBmCZSQx.css} +1 -1
- package/dist/selfhost/index.html +2 -2
- package/package.json +1 -1
- /package/dist/selfhost/assets/{index-B_B7vc7a.js → index--_PPE03M.js} +0 -0
package/dist/lib/index.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { E as
|
|
3
|
-
import { jsxs as n, jsx as e, Fragment as
|
|
4
|
-
import { useId as $, useRef as
|
|
5
|
-
function U(
|
|
6
|
-
return (
|
|
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
|
|
9
|
-
workspaces:
|
|
10
|
-
selected:
|
|
8
|
+
function V({
|
|
9
|
+
workspaces: t,
|
|
10
|
+
selected: a,
|
|
11
11
|
onSelect: o,
|
|
12
|
-
onChanged:
|
|
13
|
-
onMembersChanged:
|
|
12
|
+
onChanged: h,
|
|
13
|
+
onMembersChanged: r
|
|
14
14
|
}) {
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
|
|
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 (!
|
|
21
|
-
function d(
|
|
22
|
-
|
|
20
|
+
if (!s) return;
|
|
21
|
+
function d(D) {
|
|
22
|
+
b.current && !b.current.contains(D.target) && _();
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
24
|
+
function R(D) {
|
|
25
|
+
D.key === "Escape" && _();
|
|
26
26
|
}
|
|
27
|
-
return document.addEventListener("mousedown", d), document.addEventListener("keydown",
|
|
28
|
-
document.removeEventListener("mousedown", d), document.removeEventListener("keydown",
|
|
27
|
+
return document.addEventListener("mousedown", d), document.addEventListener("keydown", R), () => {
|
|
28
|
+
document.removeEventListener("mousedown", d), document.removeEventListener("keydown", R);
|
|
29
29
|
};
|
|
30
|
-
}, [
|
|
31
|
-
async function
|
|
32
|
-
if (!(!
|
|
33
|
-
|
|
30
|
+
}, [s]);
|
|
31
|
+
async function I() {
|
|
32
|
+
if (!(!N.trim() || g)) {
|
|
33
|
+
x(!0), l(null);
|
|
34
34
|
try {
|
|
35
|
-
const d = await
|
|
36
|
-
o(d.id),
|
|
35
|
+
const d = await p.createWorkspace({ name: N.trim() });
|
|
36
|
+
o(d.id), h(), _();
|
|
37
37
|
} catch (d) {
|
|
38
|
-
|
|
38
|
+
l(S(d));
|
|
39
39
|
} finally {
|
|
40
|
-
|
|
40
|
+
x(!1);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
async function
|
|
45
|
-
if (!(!
|
|
46
|
-
|
|
44
|
+
async function T() {
|
|
45
|
+
if (!(!m.trim() || g)) {
|
|
46
|
+
x(!0), l(null);
|
|
47
47
|
try {
|
|
48
|
-
const d = await
|
|
49
|
-
o(d.workspace.id),
|
|
48
|
+
const d = await p.redeemInvite(m.trim());
|
|
49
|
+
o(d.workspace.id), h(), r == null || r(), _();
|
|
50
50
|
} catch (d) {
|
|
51
|
-
|
|
51
|
+
l(S(d));
|
|
52
52
|
} finally {
|
|
53
|
-
|
|
53
|
+
x(!1);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
const w =
|
|
58
|
-
return /* @__PURE__ */ n("div", { className: "ws-switcher", ref:
|
|
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":
|
|
66
|
-
"aria-controls":
|
|
67
|
-
onClick: () =>
|
|
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
|
-
|
|
76
|
-
|
|
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
|
-
|
|
79
|
-
const
|
|
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":
|
|
86
|
-
className: "ws-mi" + (
|
|
85
|
+
"aria-checked": R,
|
|
86
|
+
className: "ws-mi" + (R ? " ws-mi--on" : ""),
|
|
87
87
|
onClick: () => {
|
|
88
|
-
o(d.id),
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
118
|
+
l(null), f("join");
|
|
119
119
|
},
|
|
120
120
|
children: "⎘ Join with a code"
|
|
121
121
|
}
|
|
122
122
|
)
|
|
123
123
|
] })
|
|
124
124
|
] }),
|
|
125
|
-
|
|
125
|
+
v === "create" && /* @__PURE__ */ n(
|
|
126
126
|
"form",
|
|
127
127
|
{
|
|
128
128
|
className: "ws-form",
|
|
129
129
|
onSubmit: (d) => {
|
|
130
|
-
d.preventDefault(),
|
|
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:
|
|
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: () =>
|
|
147
|
-
/* @__PURE__ */ e("button", { type: "submit", disabled:
|
|
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
|
-
|
|
152
|
+
v === "join" && /* @__PURE__ */ n(
|
|
153
153
|
"form",
|
|
154
154
|
{
|
|
155
155
|
className: "ws-form",
|
|
156
156
|
onSubmit: (d) => {
|
|
157
|
-
d.preventDefault(),
|
|
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:
|
|
167
|
+
value: m,
|
|
168
168
|
autoFocus: !0,
|
|
169
|
-
onChange: (d) =>
|
|
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: () =>
|
|
174
|
-
/* @__PURE__ */ e("button", { type: "submit", disabled:
|
|
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
|
|
184
|
-
workspaceName:
|
|
185
|
-
busy:
|
|
183
|
+
function X({
|
|
184
|
+
workspaceName: t,
|
|
185
|
+
busy: a,
|
|
186
186
|
error: o,
|
|
187
|
-
onConfirm:
|
|
188
|
-
onCancel:
|
|
187
|
+
onConfirm: h,
|
|
188
|
+
onCancel: r
|
|
189
189
|
}) {
|
|
190
|
-
const
|
|
190
|
+
const p = $(), c = $(), [b, s] = i(""), y = W(null);
|
|
191
191
|
A(() => {
|
|
192
|
-
var
|
|
193
|
-
(
|
|
192
|
+
var f;
|
|
193
|
+
(f = y.current) == null || f.focus();
|
|
194
194
|
}, []), A(() => {
|
|
195
|
-
function
|
|
196
|
-
|
|
195
|
+
function f(N) {
|
|
196
|
+
N.key === "Escape" && !a && r();
|
|
197
197
|
}
|
|
198
|
-
return document.addEventListener("keydown",
|
|
199
|
-
}, [
|
|
200
|
-
const
|
|
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
|
-
|
|
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":
|
|
214
|
+
"aria-labelledby": p,
|
|
215
215
|
"aria-describedby": c,
|
|
216
|
-
onClick: (
|
|
216
|
+
onClick: (f) => f.stopPropagation(),
|
|
217
217
|
children: [
|
|
218
|
-
/* @__PURE__ */ e("h3", { id:
|
|
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:
|
|
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: `${
|
|
224
|
+
/* @__PURE__ */ n("label", { htmlFor: `${p}-input`, className: "shepherd-modal__label", children: [
|
|
225
225
|
"Type ",
|
|
226
|
-
/* @__PURE__ */ e("b", { children:
|
|
226
|
+
/* @__PURE__ */ e("b", { children: t }),
|
|
227
227
|
" to confirm"
|
|
228
228
|
] }),
|
|
229
229
|
/* @__PURE__ */ e(
|
|
230
230
|
"input",
|
|
231
231
|
{
|
|
232
|
-
id: `${
|
|
233
|
-
ref:
|
|
232
|
+
id: `${p}-input`,
|
|
233
|
+
ref: y,
|
|
234
234
|
type: "text",
|
|
235
|
-
value:
|
|
235
|
+
value: b,
|
|
236
236
|
autoComplete: "off",
|
|
237
|
-
disabled:
|
|
238
|
-
onChange: (
|
|
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:
|
|
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:
|
|
250
|
-
disabled: !
|
|
251
|
-
children:
|
|
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
|
|
262
|
-
const
|
|
263
|
-
async function
|
|
264
|
-
if (!
|
|
265
|
-
|
|
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
|
|
268
|
-
} catch (
|
|
269
|
-
c(S(
|
|
267
|
+
await h.leave(t.id), a == null || a();
|
|
268
|
+
} catch (_) {
|
|
269
|
+
c(S(_)), _ instanceof Y && _.status === 409 && v(!0);
|
|
270
270
|
} finally {
|
|
271
|
-
|
|
271
|
+
s(!1);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
async function
|
|
275
|
+
async function x() {
|
|
276
276
|
if (!k) {
|
|
277
|
-
|
|
277
|
+
m(!0), E(null);
|
|
278
278
|
try {
|
|
279
|
-
await
|
|
280
|
-
} catch (
|
|
281
|
-
E(S(
|
|
279
|
+
await h.deleteWorkspace(t.id), N(!1), o == null || o();
|
|
280
|
+
} catch (_) {
|
|
281
|
+
E(S(_));
|
|
282
282
|
} finally {
|
|
283
|
-
|
|
283
|
+
m(!1);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
return /* @__PURE__ */ n("section", { className: "shepherd-general", "aria-labelledby":
|
|
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:
|
|
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
|
-
|
|
294
|
-
|
|
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:
|
|
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:
|
|
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
|
|
306
|
+
/* @__PURE__ */ e("button", { type: "button", className: "danger", onClick: () => void g(), disabled: b, children: "Leave workspace" })
|
|
307
307
|
] }),
|
|
308
|
-
|
|
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),
|
|
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
|
-
|
|
326
|
-
|
|
325
|
+
f && /* @__PURE__ */ e(
|
|
326
|
+
X,
|
|
327
327
|
{
|
|
328
|
-
workspaceName:
|
|
328
|
+
workspaceName: t.name,
|
|
329
329
|
busy: k,
|
|
330
|
-
error:
|
|
331
|
-
onConfirm: () => void
|
|
330
|
+
error: C,
|
|
331
|
+
onConfirm: () => void x(),
|
|
332
332
|
onCancel: () => {
|
|
333
|
-
k ||
|
|
333
|
+
k || N(!1);
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
)
|
|
337
337
|
] });
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
const
|
|
341
|
-
async function
|
|
342
|
-
|
|
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
|
|
345
|
-
c(
|
|
346
|
-
} catch (
|
|
347
|
-
|
|
344
|
+
const g = await h.listMembers(t);
|
|
345
|
+
c(g.members);
|
|
346
|
+
} catch (g) {
|
|
347
|
+
s(S(g));
|
|
348
348
|
} finally {
|
|
349
|
-
|
|
349
|
+
N(!1);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
A(() => {
|
|
353
|
-
|
|
354
|
-
}, [
|
|
355
|
-
async function E(
|
|
353
|
+
N(!0), C();
|
|
354
|
+
}, [h, t, a]);
|
|
355
|
+
async function E(l, g) {
|
|
356
356
|
if (!k) {
|
|
357
|
-
|
|
357
|
+
m(l), s(null), v(null), c((x) => x.filter((_) => _.accountId !== l));
|
|
358
358
|
try {
|
|
359
|
-
await
|
|
360
|
-
} catch (
|
|
361
|
-
|
|
359
|
+
await h.removeMember(t, l), v(`Removed ${g}`);
|
|
360
|
+
} catch (x) {
|
|
361
|
+
s(S(x)), C({ keepError: !0 });
|
|
362
362
|
} finally {
|
|
363
|
-
|
|
363
|
+
m(null);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
return /* @__PURE__ */ n("section", { className: "shepherd-members", "aria-labelledby":
|
|
368
|
-
/* @__PURE__ */ e("div", { className: "card-head", children: /* @__PURE__ */ e("h3", { id:
|
|
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
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
const
|
|
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:
|
|
376
|
-
/* @__PURE__ */ e("span", { className: "role", children:
|
|
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 ${
|
|
382
|
-
onClick: () => void E(
|
|
383
|
-
disabled: k ===
|
|
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
|
-
] },
|
|
387
|
+
] }, l.accountId);
|
|
388
388
|
}) })
|
|
389
389
|
] })
|
|
390
390
|
] });
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
const o =
|
|
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
|
-
|
|
396
|
-
}, [
|
|
397
|
-
async function
|
|
398
|
-
if (!
|
|
399
|
-
|
|
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(
|
|
402
|
-
|
|
401
|
+
const w = await o.createInvite(t, {});
|
|
402
|
+
p(w), a == null || a();
|
|
403
403
|
} catch (w) {
|
|
404
|
-
|
|
404
|
+
b(S(w));
|
|
405
405
|
} finally {
|
|
406
|
-
|
|
406
|
+
y(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
async function
|
|
411
|
-
if (!(!
|
|
412
|
-
|
|
410
|
+
async function x() {
|
|
411
|
+
if (!(!r || s)) {
|
|
412
|
+
y(!0), b(null);
|
|
413
413
|
try {
|
|
414
|
-
await o.revokeInvite(
|
|
414
|
+
await o.revokeInvite(t, r.code), p(null);
|
|
415
415
|
} catch (w) {
|
|
416
|
-
|
|
416
|
+
b(S(w));
|
|
417
417
|
} finally {
|
|
418
|
-
|
|
418
|
+
y(!1);
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
async function
|
|
423
|
-
if (!(!
|
|
424
|
-
|
|
422
|
+
async function _() {
|
|
423
|
+
if (!(!v.trim() || m)) {
|
|
424
|
+
C(!0), k(null);
|
|
425
425
|
try {
|
|
426
|
-
const w = await o.inviteByEmail(
|
|
427
|
-
k(`Invite sent to ${w.email}.`),
|
|
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
|
-
|
|
431
|
+
C(!1);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
async function
|
|
437
|
-
await navigator.clipboard.writeText(L),
|
|
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":
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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
|
|
460
|
-
disabled:
|
|
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:
|
|
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
|
|
472
|
+
onClick: () => void T("code", r.code),
|
|
473
473
|
children: E === "code" ? "Copied" : "Copy"
|
|
474
474
|
}
|
|
475
475
|
)
|
|
476
476
|
] }),
|
|
477
|
-
|
|
478
|
-
/* @__PURE__ */ e("a", { href:
|
|
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
|
|
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
|
|
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:
|
|
503
|
-
onChange: (w) =>
|
|
502
|
+
value: v,
|
|
503
|
+
onChange: (w) => f(w.target.value)
|
|
504
504
|
}
|
|
505
505
|
),
|
|
506
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => void
|
|
506
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => void _(), disabled: m, children: "Send invite" })
|
|
507
507
|
] }),
|
|
508
|
-
|
|
508
|
+
N && /* @__PURE__ */ e("p", { className: "email-invite__status", children: N })
|
|
509
509
|
] })
|
|
510
510
|
] })
|
|
511
511
|
] });
|
|
512
512
|
}
|
|
513
|
-
const
|
|
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
|
-
],
|
|
519
|
+
], ee = "shp_<paste-after-generating>", ne = {
|
|
519
520
|
claude: "claude mcp add shepherd -s user",
|
|
520
|
-
codex: "codex mcp add shepherd"
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
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
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
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
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
]
|
|
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
|
|
548
|
-
const
|
|
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
|
|
552
|
-
|
|
553
|
-
} catch (
|
|
554
|
-
k(S(
|
|
585
|
+
const u = await a.listAccountTokens();
|
|
586
|
+
f(u.tokens);
|
|
587
|
+
} catch (u) {
|
|
588
|
+
k(S(u));
|
|
555
589
|
} finally {
|
|
556
|
-
|
|
590
|
+
I(!1);
|
|
557
591
|
}
|
|
558
592
|
}
|
|
559
593
|
A(() => {
|
|
560
|
-
|
|
561
|
-
}, [
|
|
594
|
+
I(!0), L();
|
|
595
|
+
}, [a]);
|
|
562
596
|
async function d() {
|
|
563
|
-
|
|
597
|
+
l(!0), k(null), C(null);
|
|
564
598
|
try {
|
|
565
|
-
const
|
|
599
|
+
const u = await a.mintAccountToken(
|
|
566
600
|
c.trim() ? { name: c.trim() } : {}
|
|
567
601
|
);
|
|
568
|
-
|
|
569
|
-
} catch (
|
|
570
|
-
k(S(
|
|
602
|
+
y(u.token), b(""), await L();
|
|
603
|
+
} catch (u) {
|
|
604
|
+
k(S(u));
|
|
571
605
|
} finally {
|
|
572
|
-
|
|
606
|
+
l(!1);
|
|
573
607
|
}
|
|
574
608
|
}
|
|
575
|
-
async function
|
|
576
|
-
if (!
|
|
577
|
-
w(
|
|
609
|
+
async function R(u) {
|
|
610
|
+
if (!T) {
|
|
611
|
+
w(u), k(null), C(null);
|
|
578
612
|
try {
|
|
579
|
-
await
|
|
580
|
-
} catch (
|
|
581
|
-
k(S(
|
|
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
|
|
588
|
-
async function
|
|
589
|
-
await navigator.clipboard.writeText(
|
|
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":
|
|
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:
|
|
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:
|
|
605
|
-
onChange: (
|
|
606
|
-
children:
|
|
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: (
|
|
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
|
-
|
|
627
|
-
|
|
628
|
-
|
|
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:
|
|
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":
|
|
637
|
-
title:
|
|
638
|
-
onClick: () => void
|
|
639
|
-
children:
|
|
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
|
-
|
|
676
|
-
const
|
|
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:
|
|
679
|
-
/* @__PURE__ */ e("span", { className: "token-meta", children:
|
|
680
|
-
|
|
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 ${
|
|
685
|
-
onClick: () => void
|
|
686
|
-
disabled:
|
|
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
|
-
] },
|
|
735
|
+
] }, u.id);
|
|
691
736
|
}) })
|
|
692
737
|
] })
|
|
693
738
|
] });
|
|
694
739
|
}
|
|
695
|
-
const
|
|
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
|
|
701
|
-
workspace:
|
|
702
|
-
hubUrl:
|
|
745
|
+
function oe({
|
|
746
|
+
workspace: t,
|
|
747
|
+
hubUrl: a,
|
|
703
748
|
membersRefreshKey: o,
|
|
704
|
-
onMembersChanged:
|
|
705
|
-
onLeft:
|
|
706
|
-
onDeleted:
|
|
749
|
+
onMembersChanged: h,
|
|
750
|
+
onLeft: r,
|
|
751
|
+
onDeleted: p
|
|
707
752
|
}) {
|
|
708
|
-
const [c,
|
|
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:
|
|
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 ===
|
|
715
|
-
"aria-current": c ===
|
|
716
|
-
onClick: () =>
|
|
717
|
-
children:
|
|
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
|
-
|
|
764
|
+
y
|
|
720
765
|
)) }),
|
|
721
766
|
/* @__PURE__ */ n("div", { className: "config-panel", children: [
|
|
722
|
-
c === "general" && /* @__PURE__ */ e(
|
|
723
|
-
c === "members" && /* @__PURE__ */ n(
|
|
767
|
+
c === "general" && /* @__PURE__ */ e(q, { workspace: t, onLeft: r, onDeleted: p }),
|
|
768
|
+
c === "members" && /* @__PURE__ */ n(G, { children: [
|
|
724
769
|
/* @__PURE__ */ e(
|
|
725
|
-
|
|
770
|
+
z,
|
|
726
771
|
{
|
|
727
|
-
workspaceId:
|
|
772
|
+
workspaceId: t.id,
|
|
728
773
|
refreshKey: o,
|
|
729
|
-
canRemove:
|
|
774
|
+
canRemove: s
|
|
730
775
|
}
|
|
731
776
|
),
|
|
732
|
-
|
|
777
|
+
s && /* @__PURE__ */ e(Q, { workspaceId: t.id, onMembersChanged: h })
|
|
733
778
|
] }),
|
|
734
|
-
c === "agent" && /* @__PURE__ */ e(
|
|
779
|
+
c === "agent" && /* @__PURE__ */ e(se, { hubUrl: a })
|
|
735
780
|
] })
|
|
736
781
|
] });
|
|
737
782
|
}
|
|
738
|
-
function
|
|
739
|
-
const
|
|
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
|
|
742
|
-
|
|
743
|
-
(
|
|
786
|
+
const m = await a.listWorkspaces();
|
|
787
|
+
h({ status: "ready", workspaces: m.workspaces }), p(
|
|
788
|
+
(C) => {
|
|
744
789
|
var E;
|
|
745
|
-
return
|
|
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 (
|
|
749
|
-
|
|
793
|
+
} catch (m) {
|
|
794
|
+
h({ status: "error", message: S(m) });
|
|
750
795
|
}
|
|
751
|
-
}, [
|
|
796
|
+
}, [a]);
|
|
752
797
|
A(() => {
|
|
753
|
-
|
|
754
|
-
}, [
|
|
755
|
-
const
|
|
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
|
|
761
|
-
|
|
805
|
+
const f = y.length > 0, N = /* @__PURE__ */ e(
|
|
806
|
+
V,
|
|
762
807
|
{
|
|
763
|
-
workspaces:
|
|
764
|
-
selected:
|
|
765
|
-
onSelect:
|
|
808
|
+
workspaces: y,
|
|
809
|
+
selected: v,
|
|
810
|
+
onSelect: p,
|
|
766
811
|
onChanged: () => {
|
|
767
|
-
|
|
812
|
+
s();
|
|
768
813
|
},
|
|
769
|
-
onMembersChanged: () =>
|
|
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
|
-
|
|
774
|
-
|
|
818
|
+
v ? /* @__PURE__ */ e(
|
|
819
|
+
oe,
|
|
775
820
|
{
|
|
776
|
-
workspace:
|
|
777
|
-
hubUrl:
|
|
821
|
+
workspace: v,
|
|
822
|
+
hubUrl: t,
|
|
778
823
|
membersRefreshKey: c,
|
|
779
|
-
onMembersChanged: () =>
|
|
780
|
-
onLeft: () => void
|
|
781
|
-
onDeleted: () => void
|
|
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
|
-
|
|
835
|
+
J,
|
|
791
836
|
{
|
|
792
|
-
workspaceId:
|
|
837
|
+
workspaceId: v == null ? void 0 : v.id,
|
|
793
838
|
config: k,
|
|
794
|
-
switcher:
|
|
795
|
-
hasWorkspace:
|
|
839
|
+
switcher: N,
|
|
840
|
+
hasWorkspace: f
|
|
796
841
|
}
|
|
797
842
|
) });
|
|
798
843
|
}
|
|
799
844
|
export {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
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
|
-
|
|
858
|
+
j as useShepherdClient
|
|
814
859
|
};
|