@korso/shepherd-ui 0.7.0 → 0.9.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/components/Chat.js +4 -1
- package/dist/config/ConnectAgent.js +70 -1
- package/dist/lib/{Dashboard-D7tbhMwK.js → Dashboard-BSGZuM-A.js} +216 -199
- package/dist/lib/index.d.ts +5 -0
- package/dist/lib/index.js +365 -306
- package/dist/lib/selfhost.js +1 -1
- package/dist/selfhost/assets/{index--_PPE03M.js → index-Sqcr2ekx.js} +7 -7
- package/dist/selfhost/index.html +1 -1
- package/package.json +1 -1
package/dist/lib/index.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { E as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useId as $, useRef as
|
|
5
|
-
function
|
|
6
|
-
return (
|
|
1
|
+
import { u as D, d as x, S as J, f as B, D as Y } from "./Dashboard-BSGZuM-A.js";
|
|
2
|
+
import { E as ve, a as fe, c as ye } from "./Dashboard-BSGZuM-A.js";
|
|
3
|
+
import { jsxs as t, jsx as e, Fragment as F } from "react/jsx-runtime";
|
|
4
|
+
import { useId as $, useRef as W, useState as i, useEffect as A, useCallback as M } from "react";
|
|
5
|
+
function H(n) {
|
|
6
|
+
return (n.trim()[0] ?? "?").toUpperCase();
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
workspaces:
|
|
8
|
+
function V({
|
|
9
|
+
workspaces: n,
|
|
10
10
|
selected: a,
|
|
11
11
|
onSelect: o,
|
|
12
|
-
onChanged:
|
|
13
|
-
onMembersChanged:
|
|
12
|
+
onChanged: h,
|
|
13
|
+
onMembersChanged: s
|
|
14
14
|
}) {
|
|
15
|
-
const
|
|
15
|
+
const p = D(), c = $(), b = W(null), [r, y] = i(!1), [v, f] = i("menu"), [N, k] = i(""), [m, _] = i(""), [E, l] = i(null), [g, S] = i(!1);
|
|
16
16
|
function C() {
|
|
17
|
-
y(!1),
|
|
17
|
+
y(!1), f("menu"), k(""), _(""), l(null);
|
|
18
18
|
}
|
|
19
19
|
A(() => {
|
|
20
20
|
if (!r) return;
|
|
21
|
-
function d(
|
|
22
|
-
b.current && !b.current.contains(
|
|
21
|
+
function d(O) {
|
|
22
|
+
b.current && !b.current.contains(O.target) && C();
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
24
|
+
function R(O) {
|
|
25
|
+
O.key === "Escape" && C();
|
|
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
30
|
}, [r]);
|
|
31
|
-
async function
|
|
32
|
-
if (!(!
|
|
33
|
-
|
|
31
|
+
async function I() {
|
|
32
|
+
if (!(!N.trim() || g)) {
|
|
33
|
+
S(!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(), C();
|
|
37
37
|
} catch (d) {
|
|
38
|
-
|
|
38
|
+
l(x(d));
|
|
39
39
|
} finally {
|
|
40
|
-
|
|
40
|
+
S(!1);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
async function T() {
|
|
45
|
-
if (!(!
|
|
46
|
-
|
|
45
|
+
if (!(!m.trim() || g)) {
|
|
46
|
+
S(!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(), s == null || s(), C();
|
|
50
50
|
} catch (d) {
|
|
51
|
-
|
|
51
|
+
l(x(d));
|
|
52
52
|
} finally {
|
|
53
|
-
|
|
53
|
+
S(!1);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
const w = a !== null, L = a ? a.name : "Get started";
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ t("div", { className: "ws-switcher", ref: b, children: [
|
|
59
|
+
/* @__PURE__ */ t(
|
|
60
60
|
"button",
|
|
61
61
|
{
|
|
62
62
|
type: "button",
|
|
@@ -66,36 +66,36 @@ function J({
|
|
|
66
66
|
"aria-controls": r ? c : void 0,
|
|
67
67
|
onClick: () => r ? C() : y(!0),
|
|
68
68
|
children: [
|
|
69
|
-
w ? /* @__PURE__ */ e("span", { className: "ws-avatar", "aria-hidden": "true", children:
|
|
69
|
+
w ? /* @__PURE__ */ e("span", { className: "ws-avatar", "aria-hidden": "true", children: H(L) }) : /* @__PURE__ */ e("span", { className: "ws-plus", "aria-hidden": "true", children: "+" }),
|
|
70
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
|
-
r && /* @__PURE__ */
|
|
76
|
-
|
|
75
|
+
r && /* @__PURE__ */ t("div", { className: "ws-menu", id: c, role: "menu", children: [
|
|
76
|
+
v === "menu" && /* @__PURE__ */ t(F, { children: [
|
|
77
77
|
/* @__PURE__ */ e("p", { className: "ws-menu__head", children: w ? "Switch workspace" : "Your workspaces" }),
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
78
|
+
n.length === 0 ? /* @__PURE__ */ e("p", { className: "ws-menu__none", children: "None yet" }) : /* @__PURE__ */ e("ul", { className: "ws-menu__list", children: n.map((d) => {
|
|
79
|
+
const R = d.id === (a == null ? void 0 : a.id);
|
|
80
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ t(
|
|
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
88
|
o(d.id), C();
|
|
89
89
|
},
|
|
90
90
|
children: [
|
|
91
|
-
/* @__PURE__ */ e("span", { className: "ws-avatar ws-avatar--sm", "aria-hidden": "true", children:
|
|
91
|
+
/* @__PURE__ */ e("span", { className: "ws-avatar ws-avatar--sm", "aria-hidden": "true", children: H(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);
|
|
97
97
|
}) }),
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ t("div", { className: "ws-menu__actions", children: [
|
|
99
99
|
/* @__PURE__ */ e(
|
|
100
100
|
"button",
|
|
101
101
|
{
|
|
@@ -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__ */ t(
|
|
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,19 +137,19 @@ 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
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () =>
|
|
147
|
-
/* @__PURE__ */ e("button", { type: "submit", disabled:
|
|
145
|
+
/* @__PURE__ */ t("div", { className: "ws-form__row", children: [
|
|
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__ */ t(
|
|
153
153
|
"form",
|
|
154
154
|
{
|
|
155
155
|
className: "ws-form",
|
|
@@ -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
169
|
onChange: (d) => _(d.target.value)
|
|
170
170
|
}
|
|
171
171
|
),
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () =>
|
|
174
|
-
/* @__PURE__ */ e("button", { type: "submit", disabled:
|
|
172
|
+
/* @__PURE__ */ t("div", { className: "ws-form__row", children: [
|
|
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,74 +180,74 @@ function J({
|
|
|
180
180
|
] })
|
|
181
181
|
] });
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
workspaceName:
|
|
183
|
+
function q({
|
|
184
|
+
workspaceName: n,
|
|
185
185
|
busy: a,
|
|
186
186
|
error: o,
|
|
187
|
-
onConfirm:
|
|
188
|
-
onCancel:
|
|
187
|
+
onConfirm: h,
|
|
188
|
+
onCancel: s
|
|
189
189
|
}) {
|
|
190
|
-
const
|
|
190
|
+
const p = $(), c = $(), [b, r] = 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 && s();
|
|
197
197
|
}
|
|
198
|
-
return document.addEventListener("keydown",
|
|
199
|
-
}, [a,
|
|
200
|
-
const
|
|
198
|
+
return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
|
|
199
|
+
}, [a, s]);
|
|
200
|
+
const v = b === n;
|
|
201
201
|
return /* @__PURE__ */ e(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
204
204
|
className: "shepherd-modal__backdrop",
|
|
205
205
|
onClick: () => {
|
|
206
|
-
a ||
|
|
206
|
+
a || s();
|
|
207
207
|
},
|
|
208
|
-
children: /* @__PURE__ */
|
|
208
|
+
children: /* @__PURE__ */ t(
|
|
209
209
|
"div",
|
|
210
210
|
{
|
|
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:
|
|
219
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ e("h3", { id: p, children: "Delete workspace" }),
|
|
219
|
+
/* @__PURE__ */ t("p", { id: c, className: "shepherd-modal__body", children: [
|
|
220
220
|
"This permanently deletes ",
|
|
221
|
-
/* @__PURE__ */ e("b", { children:
|
|
221
|
+
/* @__PURE__ */ e("b", { children: n }),
|
|
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__ */
|
|
224
|
+
/* @__PURE__ */ t("label", { htmlFor: `${p}-input`, className: "shepherd-modal__label", children: [
|
|
225
225
|
"Type ",
|
|
226
|
-
/* @__PURE__ */ e("b", { children:
|
|
226
|
+
/* @__PURE__ */ e("b", { children: n }),
|
|
227
227
|
" to confirm"
|
|
228
228
|
] }),
|
|
229
229
|
/* @__PURE__ */ e(
|
|
230
230
|
"input",
|
|
231
231
|
{
|
|
232
|
-
id: `${
|
|
232
|
+
id: `${p}-input`,
|
|
233
233
|
ref: y,
|
|
234
234
|
type: "text",
|
|
235
235
|
value: b,
|
|
236
236
|
autoComplete: "off",
|
|
237
237
|
disabled: a,
|
|
238
|
-
onChange: (
|
|
238
|
+
onChange: (f) => r(f.target.value)
|
|
239
239
|
}
|
|
240
240
|
),
|
|
241
241
|
o && /* @__PURE__ */ e("p", { role: "alert", children: o }),
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
/* @__PURE__ */ e("button", { type: "button", onClick:
|
|
242
|
+
/* @__PURE__ */ t("div", { className: "shepherd-modal__actions", children: [
|
|
243
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: s, 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: !
|
|
249
|
+
onClick: h,
|
|
250
|
+
disabled: !v || a,
|
|
251
251
|
children: a ? "Deleting…" : "Delete workspace"
|
|
252
252
|
}
|
|
253
253
|
)
|
|
@@ -258,54 +258,54 @@ function V({
|
|
|
258
258
|
}
|
|
259
259
|
);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
const
|
|
263
|
-
async function
|
|
261
|
+
function X({ workspace: n, onLeft: a, onDeleted: o }) {
|
|
262
|
+
const h = D(), s = $(), [p, c] = i(null), [b, r] = i(!1), [y, v] = i(!1), [f, N] = i(!1), [k, m] = i(!1), [_, E] = i(null), l = n.role === "admin";
|
|
263
|
+
async function g() {
|
|
264
264
|
if (!b) {
|
|
265
|
-
r(!0), c(null),
|
|
265
|
+
r(!0), c(null), v(!1);
|
|
266
266
|
try {
|
|
267
|
-
await
|
|
267
|
+
await h.leave(n.id), a == null || a();
|
|
268
268
|
} catch (C) {
|
|
269
|
-
c(
|
|
269
|
+
c(x(C)), C instanceof J && C.status === 409 && v(!0);
|
|
270
270
|
} finally {
|
|
271
271
|
r(!1);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
async function
|
|
275
|
+
async function S() {
|
|
276
276
|
if (!k) {
|
|
277
|
-
|
|
277
|
+
m(!0), E(null);
|
|
278
278
|
try {
|
|
279
|
-
await
|
|
279
|
+
await h.deleteWorkspace(n.id), N(!1), o == null || o();
|
|
280
280
|
} catch (C) {
|
|
281
|
-
E(
|
|
281
|
+
E(x(C));
|
|
282
282
|
} finally {
|
|
283
|
-
|
|
283
|
+
m(!1);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
return /* @__PURE__ */
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */ e("h3", { id:
|
|
287
|
+
return /* @__PURE__ */ t("section", { className: "shepherd-general", "aria-labelledby": s, children: [
|
|
288
|
+
/* @__PURE__ */ t("div", { className: "card-head", children: [
|
|
289
|
+
/* @__PURE__ */ e("h3", { id: s, children: "General" }),
|
|
290
290
|
/* @__PURE__ */ e("p", { className: "card-sub", children: "Your active workspace and its settings." })
|
|
291
291
|
] }),
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
|
|
294
|
-
y &&
|
|
295
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ t("div", { className: "card-body", children: [
|
|
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
|
+
/* @__PURE__ */ t("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: n.name })
|
|
298
298
|
] }),
|
|
299
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ t("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: n.role })
|
|
302
302
|
] }),
|
|
303
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ t("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__ */ t("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 M({ workspace: t, onLeft: a, 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,221 +322,263 @@ function M({ workspace: t, onLeft: a, onDeleted: o }) {
|
|
|
322
322
|
)
|
|
323
323
|
] })
|
|
324
324
|
] }),
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
f && /* @__PURE__ */ e(
|
|
326
|
+
q,
|
|
327
327
|
{
|
|
328
|
-
workspaceName:
|
|
328
|
+
workspaceName: n.name,
|
|
329
329
|
busy: k,
|
|
330
330
|
error: _,
|
|
331
|
-
onConfirm: () => void
|
|
331
|
+
onConfirm: () => void S(),
|
|
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 _({ keepError:
|
|
342
|
-
|
|
339
|
+
function z({ workspaceId: n, refreshKey: a = 0, canRemove: o = !1 }) {
|
|
340
|
+
const h = D(), s = $(), [p, c] = i([]), [b, r] = i(null), [y, v] = i(null), [f, N] = i(!0), [k, m] = i(null);
|
|
341
|
+
async function _({ keepError: l = !1 } = {}) {
|
|
342
|
+
l || r(null);
|
|
343
343
|
try {
|
|
344
|
-
const
|
|
345
|
-
c(
|
|
346
|
-
} catch (
|
|
347
|
-
r(
|
|
344
|
+
const g = await h.listMembers(n);
|
|
345
|
+
c(g.members);
|
|
346
|
+
} catch (g) {
|
|
347
|
+
r(x(g));
|
|
348
348
|
} finally {
|
|
349
|
-
|
|
349
|
+
N(!1);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
A(() => {
|
|
353
|
-
|
|
354
|
-
}, [
|
|
355
|
-
async function E(
|
|
353
|
+
N(!0), _();
|
|
354
|
+
}, [h, n, a]);
|
|
355
|
+
async function E(l, g) {
|
|
356
356
|
if (!k) {
|
|
357
|
-
|
|
357
|
+
m(l), r(null), v(null), c((S) => S.filter((C) => C.accountId !== l));
|
|
358
358
|
try {
|
|
359
|
-
await
|
|
360
|
-
} catch (
|
|
361
|
-
r(
|
|
359
|
+
await h.removeMember(n, l), v(`Removed ${g}`);
|
|
360
|
+
} catch (S) {
|
|
361
|
+
r(x(S)), _({ keepError: !0 });
|
|
362
362
|
} finally {
|
|
363
|
-
|
|
363
|
+
m(null);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
return /* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */ e("div", { className: "card-head", children: /* @__PURE__ */ e("h3", { id:
|
|
369
|
-
/* @__PURE__ */
|
|
367
|
+
return /* @__PURE__ */ t("section", { className: "shepherd-members", "aria-labelledby": s, children: [
|
|
368
|
+
/* @__PURE__ */ e("div", { className: "card-head", children: /* @__PURE__ */ e("h3", { id: s, children: "Members" }) }),
|
|
369
|
+
/* @__PURE__ */ t("div", { className: "card-body", children: [
|
|
370
370
|
b && /* @__PURE__ */ e("p", { role: "alert", children: b }),
|
|
371
371
|
y && /* @__PURE__ */ e("p", { role: "status", children: y }),
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
return /* @__PURE__ */
|
|
375
|
-
/* @__PURE__ */ e("span", { children:
|
|
376
|
-
/* @__PURE__ */ e("span", { className: "role", children:
|
|
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
|
+
return /* @__PURE__ */ t("li", { 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: n, onMembersChanged: a }) {
|
|
393
|
+
const o = D(), h = $(), [s, p] = i(null), [c, b] = i(null), [r, y] = i(!1), [v, f] = i(""), [N, k] = i(null), [m, _] = i(!1), [E, l] = i(null);
|
|
394
394
|
A(() => {
|
|
395
|
-
|
|
396
|
-
}, [
|
|
397
|
-
async function
|
|
395
|
+
p(null), k(null);
|
|
396
|
+
}, [n]);
|
|
397
|
+
async function g() {
|
|
398
398
|
if (!r) {
|
|
399
399
|
y(!0), b(null);
|
|
400
400
|
try {
|
|
401
|
-
const w = await o.createInvite(
|
|
402
|
-
|
|
401
|
+
const w = await o.createInvite(n, {});
|
|
402
|
+
p(w), a == null || a();
|
|
403
403
|
} catch (w) {
|
|
404
|
-
b(
|
|
404
|
+
b(x(w));
|
|
405
405
|
} finally {
|
|
406
406
|
y(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
async function
|
|
411
|
-
if (!(!
|
|
410
|
+
async function S() {
|
|
411
|
+
if (!(!s || r)) {
|
|
412
412
|
y(!0), b(null);
|
|
413
413
|
try {
|
|
414
|
-
await o.revokeInvite(
|
|
414
|
+
await o.revokeInvite(n, s.code), p(null);
|
|
415
415
|
} catch (w) {
|
|
416
|
-
b(
|
|
416
|
+
b(x(w));
|
|
417
417
|
} finally {
|
|
418
418
|
y(!1);
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
async function C() {
|
|
423
|
-
if (!(!
|
|
423
|
+
if (!(!v.trim() || m)) {
|
|
424
424
|
_(!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(n, v.trim());
|
|
427
|
+
k(`Invite sent to ${w.email}.`), f(""), a == null || a();
|
|
428
428
|
} catch (w) {
|
|
429
|
-
k(
|
|
429
|
+
k(x(w));
|
|
430
430
|
} finally {
|
|
431
431
|
_(!1);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
-
const
|
|
435
|
+
const I = s ? `${window.location.origin}/shepherd/join/${encodeURIComponent(s.code)}` : null;
|
|
436
436
|
async function T(w, L) {
|
|
437
|
-
await navigator.clipboard.writeText(L),
|
|
437
|
+
await navigator.clipboard.writeText(L), l(w), setTimeout(() => l((d) => d === w ? null : d), 2e3);
|
|
438
438
|
}
|
|
439
|
-
return /* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */ e("h3", { id:
|
|
439
|
+
return /* @__PURE__ */ t("section", { className: "shepherd-invites", "aria-labelledby": h, children: [
|
|
440
|
+
/* @__PURE__ */ t("div", { className: "card-head", children: [
|
|
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
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ t("div", { className: "card-body", children: [
|
|
445
445
|
c && /* @__PURE__ */ e("p", { role: "alert", children: c }),
|
|
446
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ t("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
|
-
|
|
450
|
-
/* @__PURE__ */
|
|
449
|
+
s && /* @__PURE__ */ t("div", { className: "invite-result", children: [
|
|
450
|
+
/* @__PURE__ */ t("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: s.maxUses === null ? `${s.useCount} uses` : `${s.useCount} / ${s.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
|
|
459
|
+
onClick: () => void S(),
|
|
460
460
|
disabled: r,
|
|
461
461
|
children: "Revoke"
|
|
462
462
|
}
|
|
463
463
|
)
|
|
464
464
|
] }),
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
/* @__PURE__ */ e("code", { children:
|
|
465
|
+
/* @__PURE__ */ t("div", { className: "invite-result__copyrow", children: [
|
|
466
|
+
/* @__PURE__ */ e("code", { children: s.code }),
|
|
467
467
|
/* @__PURE__ */ e(
|
|
468
468
|
"button",
|
|
469
469
|
{
|
|
470
470
|
type: "button",
|
|
471
471
|
className: "copy-btn",
|
|
472
|
-
onClick: () => void T("code",
|
|
472
|
+
onClick: () => void T("code", s.code),
|
|
473
473
|
children: E === "code" ? "Copied" : "Copy"
|
|
474
474
|
}
|
|
475
475
|
)
|
|
476
476
|
] }),
|
|
477
|
-
|
|
478
|
-
/* @__PURE__ */ e("a", { href:
|
|
477
|
+
I && /* @__PURE__ */ t("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 T("link",
|
|
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: r, children: "Create invite" })
|
|
491
491
|
] }),
|
|
492
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ t("div", { className: "field email-invite", children: [
|
|
493
493
|
/* @__PURE__ */ e("label", { htmlFor: "invite-email", children: "Invite by email" }),
|
|
494
494
|
/* @__PURE__ */ e("p", { className: "helper", children: "Send a one-time-use join link directly to someone's inbox." }),
|
|
495
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ t("div", { className: "field__row", children: [
|
|
496
496
|
/* @__PURE__ */ e(
|
|
497
497
|
"input",
|
|
498
498
|
{
|
|
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 C(), disabled:
|
|
506
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => void C(), 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
517
|
{ id: "cursor", label: "Cursor" },
|
|
518
518
|
{ id: "generic", label: "Generic (JSON)" }
|
|
519
|
-
],
|
|
519
|
+
], ee = "shp_<paste-after-generating>", ne = {
|
|
520
520
|
claude: "claude mcp add shepherd -s user",
|
|
521
521
|
codex: "codex mcp add shepherd"
|
|
522
|
-
},
|
|
522
|
+
}, te = {
|
|
523
523
|
claude: "-e",
|
|
524
524
|
codex: "--env"
|
|
525
|
-
};
|
|
526
|
-
function
|
|
527
|
-
|
|
528
|
-
|
|
525
|
+
}, U = "npx -y --package=@korso/shepherd shepherd-inbox-hook";
|
|
526
|
+
function ae(n) {
|
|
527
|
+
return n === "claude" ? {
|
|
528
|
+
target: "~/.claude/settings.json",
|
|
529
|
+
snippet: JSON.stringify(
|
|
530
|
+
{
|
|
531
|
+
hooks: {
|
|
532
|
+
SessionStart: [{ hooks: [{ type: "command", command: U }] }],
|
|
533
|
+
PreToolUse: [
|
|
534
|
+
{ matcher: "*", hooks: [{ type: "command", command: U }] }
|
|
535
|
+
]
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
null,
|
|
539
|
+
2
|
|
540
|
+
)
|
|
541
|
+
} : n === "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
|
+
} : n === "pi" ? {
|
|
552
|
+
target: "~/.pi/agent/extensions/shepherd-inbox.js",
|
|
553
|
+
snippet: null
|
|
554
|
+
} : n === "cursor" ? {
|
|
555
|
+
target: "~/.cursor/hooks.json",
|
|
556
|
+
snippet: JSON.stringify(
|
|
557
|
+
{
|
|
558
|
+
version: 1,
|
|
559
|
+
hooks: {
|
|
560
|
+
beforeSubmitPrompt: [{ command: U }]
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
null,
|
|
564
|
+
2
|
|
565
|
+
)
|
|
566
|
+
} : null;
|
|
567
|
+
}
|
|
568
|
+
function ie(n, a) {
|
|
569
|
+
const o = `created ${B(n.createdAt, a)}`, h = n.lastUsedAt ? `last used ${B(n.lastUsedAt, a)}` : "never used";
|
|
570
|
+
return `${o} · ${h}`;
|
|
529
571
|
}
|
|
530
|
-
function
|
|
531
|
-
if (
|
|
532
|
-
const
|
|
533
|
-
return
|
|
572
|
+
function se(n, a, o) {
|
|
573
|
+
if (n === "generic" || n === "pi" || n === "cursor") {
|
|
574
|
+
const p = { HUB_URL: a, SHEPHERD_TOKEN: o };
|
|
575
|
+
return n !== "generic" && (p.PROGRAM = n), JSON.stringify(
|
|
534
576
|
{
|
|
535
577
|
mcpServers: {
|
|
536
578
|
shepherd: {
|
|
537
579
|
command: "npx",
|
|
538
580
|
args: ["-y", "--package=@korso/shepherd", "shepherd-mcp"],
|
|
539
|
-
env:
|
|
581
|
+
env: p
|
|
540
582
|
}
|
|
541
583
|
}
|
|
542
584
|
},
|
|
@@ -544,106 +586,109 @@ function te(t, a, o) {
|
|
|
544
586
|
2
|
|
545
587
|
);
|
|
546
588
|
}
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
`${
|
|
550
|
-
`${
|
|
589
|
+
const h = te[n], s = [
|
|
590
|
+
ne[n],
|
|
591
|
+
`${h} HUB_URL=${a}`,
|
|
592
|
+
`${h} SHEPHERD_TOKEN=${o}`
|
|
551
593
|
];
|
|
552
|
-
return
|
|
594
|
+
return n === "codex" && s.push(`${h} PROGRAM=codex`), s.push("-- npx -y --package=@korso/shepherd shepherd-mcp"), s.join(" ");
|
|
553
595
|
}
|
|
554
|
-
function
|
|
555
|
-
const a =
|
|
596
|
+
function re({ hubUrl: n }) {
|
|
597
|
+
const a = D(), o = n ?? a.baseUrl, h = $(), [s, p] = i("claude"), [c, b] = i(""), [r, y] = i(null), [v, f] = i([]), [N, k] = i(null), [m, _] = i(null), [E, l] = i(!1), [g, S] = i(!1), [C, I] = i(!0), [T, w] = i(null);
|
|
556
598
|
async function L() {
|
|
557
599
|
try {
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
} catch (
|
|
561
|
-
k(
|
|
600
|
+
const u = await a.listAccountTokens();
|
|
601
|
+
f(u.tokens);
|
|
602
|
+
} catch (u) {
|
|
603
|
+
k(x(u));
|
|
562
604
|
} finally {
|
|
563
|
-
|
|
605
|
+
I(!1);
|
|
564
606
|
}
|
|
565
607
|
}
|
|
566
608
|
A(() => {
|
|
567
|
-
|
|
609
|
+
I(!0), L();
|
|
568
610
|
}, [a]);
|
|
569
611
|
async function d() {
|
|
570
|
-
|
|
612
|
+
l(!0), k(null), _(null);
|
|
571
613
|
try {
|
|
572
|
-
const
|
|
614
|
+
const u = await a.mintAccountToken(
|
|
573
615
|
c.trim() ? { name: c.trim() } : {}
|
|
574
616
|
);
|
|
575
|
-
y(
|
|
576
|
-
} catch (
|
|
577
|
-
k(
|
|
617
|
+
y(u.token), b(""), await L();
|
|
618
|
+
} catch (u) {
|
|
619
|
+
k(x(u));
|
|
578
620
|
} finally {
|
|
579
|
-
|
|
621
|
+
l(!1);
|
|
580
622
|
}
|
|
581
623
|
}
|
|
582
|
-
async function
|
|
624
|
+
async function R(u) {
|
|
583
625
|
if (!T) {
|
|
584
|
-
w(
|
|
626
|
+
w(u), k(null), _(null);
|
|
585
627
|
try {
|
|
586
|
-
await a.revokeAccountToken(
|
|
587
|
-
} catch (
|
|
588
|
-
k(
|
|
628
|
+
await a.revokeAccountToken(u), f((j) => j.filter((K) => K.id !== u)), _("Token revoked");
|
|
629
|
+
} catch (j) {
|
|
630
|
+
k(x(j));
|
|
589
631
|
} finally {
|
|
590
632
|
w(null);
|
|
591
633
|
}
|
|
592
634
|
}
|
|
593
635
|
}
|
|
594
|
-
const
|
|
636
|
+
const O = se(s, o, r ?? ee), P = ae(s);
|
|
595
637
|
async function G() {
|
|
596
|
-
await navigator.clipboard.writeText(
|
|
638
|
+
await navigator.clipboard.writeText(O), S(!0), setTimeout(() => S(!1), 2e3);
|
|
597
639
|
}
|
|
598
|
-
return /* @__PURE__ */
|
|
599
|
-
/* @__PURE__ */
|
|
600
|
-
/* @__PURE__ */ e("h3", { id:
|
|
640
|
+
return /* @__PURE__ */ t("section", { className: "shepherd-connect-agent", "aria-labelledby": h, children: [
|
|
641
|
+
/* @__PURE__ */ t("div", { className: "card-head", children: [
|
|
642
|
+
/* @__PURE__ */ e("h3", { id: h, children: "Connect your agent" }),
|
|
601
643
|
/* @__PURE__ */ e("p", { className: "card-sub", children: "Generate a token — it works across all your workspaces — then paste the command into your coding tool." }),
|
|
602
|
-
/* @__PURE__ */ e("p", { className: "card-sub", children: "The first time the agent
|
|
644
|
+
/* @__PURE__ */ e("p", { className: "card-sub", children: "The first time the agent changes files in a repo, Shepherd asks which workspace to coordinate that repo with — once per repo, right in your tool." })
|
|
603
645
|
] }),
|
|
604
|
-
/* @__PURE__ */
|
|
605
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ t("div", { className: "card-body", children: [
|
|
647
|
+
/* @__PURE__ */ t("div", { className: "field", children: [
|
|
606
648
|
/* @__PURE__ */ e("label", { htmlFor: "connect-tool", children: "Tool" }),
|
|
607
649
|
/* @__PURE__ */ e(
|
|
608
650
|
"select",
|
|
609
651
|
{
|
|
610
652
|
id: "connect-tool",
|
|
611
|
-
value:
|
|
612
|
-
onChange: (
|
|
613
|
-
children:
|
|
653
|
+
value: s,
|
|
654
|
+
onChange: (u) => p(u.target.value),
|
|
655
|
+
children: Z.map((u) => /* @__PURE__ */ e("option", { value: u.id, children: u.label }, u.id))
|
|
614
656
|
}
|
|
615
657
|
)
|
|
616
658
|
] }),
|
|
617
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ t("div", { className: "field generate", children: [
|
|
618
660
|
/* @__PURE__ */ e("label", { htmlFor: "token-name", children: "Token name (optional)" }),
|
|
619
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ t("div", { className: "field__row", children: [
|
|
620
662
|
/* @__PURE__ */ e(
|
|
621
663
|
"input",
|
|
622
664
|
{
|
|
623
665
|
id: "token-name",
|
|
624
666
|
type: "text",
|
|
625
667
|
value: c,
|
|
626
|
-
onChange: (
|
|
668
|
+
onChange: (u) => b(u.target.value),
|
|
669
|
+
onKeyDown: (u) => {
|
|
670
|
+
u.key === "Enter" && !E && (u.preventDefault(), d());
|
|
671
|
+
},
|
|
627
672
|
placeholder: "e.g. laptop"
|
|
628
673
|
}
|
|
629
674
|
),
|
|
630
675
|
/* @__PURE__ */ e("button", { type: "button", onClick: () => void d(), disabled: E, children: "Generate token" })
|
|
631
676
|
] })
|
|
632
677
|
] }),
|
|
633
|
-
|
|
634
|
-
|
|
678
|
+
N && /* @__PURE__ */ e("p", { role: "alert", children: N }),
|
|
679
|
+
m && /* @__PURE__ */ e("p", { role: "status", children: m }),
|
|
635
680
|
r && /* @__PURE__ */ e("p", { className: "token-once", role: "status", children: "Copy this token now — it won't be shown again." }),
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */ e("pre", { "data-testid": "install-command", children:
|
|
681
|
+
/* @__PURE__ */ t("div", { className: "install-command", children: [
|
|
682
|
+
/* @__PURE__ */ e("pre", { "data-testid": "install-command", children: O }),
|
|
638
683
|
/* @__PURE__ */ e(
|
|
639
684
|
"button",
|
|
640
685
|
{
|
|
641
686
|
type: "button",
|
|
642
687
|
className: "install-command__copy",
|
|
643
|
-
"aria-label":
|
|
644
|
-
title:
|
|
688
|
+
"aria-label": g ? "Copied" : "Copy command",
|
|
689
|
+
title: g ? "Copied" : "Copy",
|
|
645
690
|
onClick: () => void G(),
|
|
646
|
-
children:
|
|
691
|
+
children: g ? /* @__PURE__ */ e(
|
|
647
692
|
"svg",
|
|
648
693
|
{
|
|
649
694
|
width: "15",
|
|
@@ -657,7 +702,7 @@ function ae({ hubUrl: t }) {
|
|
|
657
702
|
"aria-hidden": "true",
|
|
658
703
|
children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" })
|
|
659
704
|
}
|
|
660
|
-
) : /* @__PURE__ */
|
|
705
|
+
) : /* @__PURE__ */ t(
|
|
661
706
|
"svg",
|
|
662
707
|
{
|
|
663
708
|
width: "15",
|
|
@@ -678,144 +723,158 @@ function ae({ hubUrl: t }) {
|
|
|
678
723
|
}
|
|
679
724
|
)
|
|
680
725
|
] }),
|
|
726
|
+
P && /* @__PURE__ */ t("div", { className: "hook-setup", children: [
|
|
727
|
+
/* @__PURE__ */ t("p", { className: "card-sub", children: [
|
|
728
|
+
"Message delivery sets itself up: the first time the agent runs, Shepherd adds its inbox hook to ",
|
|
729
|
+
/* @__PURE__ */ e("code", { children: P.target }),
|
|
730
|
+
" ",
|
|
731
|
+
"automatically — it delivers teammate announcements and reminds the agent to link each repo before its first write. Happens at most once; set ",
|
|
732
|
+
/* @__PURE__ */ e("code", { children: "SHEPHERD_NO_AUTO_HOOKS=1" }),
|
|
733
|
+
" to opt out."
|
|
734
|
+
] }),
|
|
735
|
+
P.snippet && /* @__PURE__ */ t("details", { className: "hook-reference", children: [
|
|
736
|
+
/* @__PURE__ */ e("summary", { children: "What gets added (manual equivalent)" }),
|
|
737
|
+
/* @__PURE__ */ e("div", { className: "install-command", children: /* @__PURE__ */ e("pre", { "data-testid": "hook-snippet", children: P.snippet }) })
|
|
738
|
+
] })
|
|
739
|
+
] }),
|
|
681
740
|
/* @__PURE__ */ e("h4", { children: "Existing tokens" }),
|
|
682
|
-
C ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) :
|
|
683
|
-
const
|
|
684
|
-
return /* @__PURE__ */
|
|
685
|
-
/* @__PURE__ */ e("span", { children:
|
|
686
|
-
/* @__PURE__ */ e("span", { className: "token-meta", children:
|
|
687
|
-
|
|
741
|
+
C ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) : v.length === 0 ? /* @__PURE__ */ e("p", { children: "No tokens yet." }) : /* @__PURE__ */ e("ul", { children: v.map((u) => {
|
|
742
|
+
const j = u.name ?? u.id;
|
|
743
|
+
return /* @__PURE__ */ t("li", { children: [
|
|
744
|
+
/* @__PURE__ */ e("span", { children: j }),
|
|
745
|
+
/* @__PURE__ */ e("span", { className: "token-meta", children: ie(u, Date.now()) }),
|
|
746
|
+
u.revokedAt ? /* @__PURE__ */ e("span", { className: "revoked", children: "revoked" }) : /* @__PURE__ */ e(
|
|
688
747
|
"button",
|
|
689
748
|
{
|
|
690
749
|
type: "button",
|
|
691
|
-
"aria-label": `Revoke token ${
|
|
692
|
-
onClick: () => void
|
|
693
|
-
disabled: T ===
|
|
750
|
+
"aria-label": `Revoke token ${j}`,
|
|
751
|
+
onClick: () => void R(u.id),
|
|
752
|
+
disabled: T === u.id,
|
|
694
753
|
children: "Revoke"
|
|
695
754
|
}
|
|
696
755
|
)
|
|
697
|
-
] },
|
|
756
|
+
] }, u.id);
|
|
698
757
|
}) })
|
|
699
758
|
] })
|
|
700
759
|
] });
|
|
701
760
|
}
|
|
702
|
-
const
|
|
761
|
+
const le = [
|
|
703
762
|
{ id: "general", label: "General" },
|
|
704
763
|
{ id: "members", label: "Members" },
|
|
705
764
|
{ id: "agent", label: "Agent" }
|
|
706
765
|
];
|
|
707
|
-
function
|
|
708
|
-
workspace:
|
|
766
|
+
function oe({
|
|
767
|
+
workspace: n,
|
|
709
768
|
hubUrl: a,
|
|
710
769
|
membersRefreshKey: o,
|
|
711
|
-
onMembersChanged:
|
|
712
|
-
onLeft:
|
|
713
|
-
onDeleted:
|
|
770
|
+
onMembersChanged: h,
|
|
771
|
+
onLeft: s,
|
|
772
|
+
onDeleted: p
|
|
714
773
|
}) {
|
|
715
|
-
const [c, b] = i("general"), r =
|
|
716
|
-
return /* @__PURE__ */
|
|
717
|
-
/* @__PURE__ */ e("nav", { className: "config-nav", "aria-label": "Configuration sections", children:
|
|
774
|
+
const [c, b] = i("general"), r = n.role === "admin";
|
|
775
|
+
return /* @__PURE__ */ t("div", { className: "config-layout", children: [
|
|
776
|
+
/* @__PURE__ */ e("nav", { className: "config-nav", "aria-label": "Configuration sections", children: le.map(({ id: y, label: v }) => /* @__PURE__ */ e(
|
|
718
777
|
"button",
|
|
719
778
|
{
|
|
720
779
|
type: "button",
|
|
721
780
|
className: "config-nav__item" + (c === y ? " config-nav__item--on" : ""),
|
|
722
781
|
"aria-current": c === y ? "page" : void 0,
|
|
723
782
|
onClick: () => b(y),
|
|
724
|
-
children:
|
|
783
|
+
children: v
|
|
725
784
|
},
|
|
726
785
|
y
|
|
727
786
|
)) }),
|
|
728
|
-
/* @__PURE__ */
|
|
729
|
-
c === "general" && /* @__PURE__ */ e(
|
|
730
|
-
c === "members" && /* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ t("div", { className: "config-panel", children: [
|
|
788
|
+
c === "general" && /* @__PURE__ */ e(X, { workspace: n, onLeft: s, onDeleted: p }),
|
|
789
|
+
c === "members" && /* @__PURE__ */ t(F, { children: [
|
|
731
790
|
/* @__PURE__ */ e(
|
|
732
|
-
|
|
791
|
+
z,
|
|
733
792
|
{
|
|
734
|
-
workspaceId:
|
|
793
|
+
workspaceId: n.id,
|
|
735
794
|
refreshKey: o,
|
|
736
795
|
canRemove: r
|
|
737
796
|
}
|
|
738
797
|
),
|
|
739
|
-
r && /* @__PURE__ */ e(
|
|
798
|
+
r && /* @__PURE__ */ e(Q, { workspaceId: n.id, onMembersChanged: h })
|
|
740
799
|
] }),
|
|
741
|
-
c === "agent" && /* @__PURE__ */ e(
|
|
800
|
+
c === "agent" && /* @__PURE__ */ e(re, { hubUrl: a })
|
|
742
801
|
] })
|
|
743
802
|
] });
|
|
744
803
|
}
|
|
745
|
-
function
|
|
746
|
-
const a =
|
|
804
|
+
function he({ hubUrl: n }) {
|
|
805
|
+
const a = D(), [o, h] = i({ status: "loading" }), [s, p] = i(null), [c, b] = i(0), r = M(async () => {
|
|
747
806
|
try {
|
|
748
|
-
const
|
|
749
|
-
|
|
807
|
+
const m = await a.listWorkspaces();
|
|
808
|
+
h({ status: "ready", workspaces: m.workspaces }), p(
|
|
750
809
|
(_) => {
|
|
751
810
|
var E;
|
|
752
|
-
return _ &&
|
|
811
|
+
return _ && m.workspaces.some((l) => l.id === _) ? _ : ((E = m.workspaces[0]) == null ? void 0 : E.id) ?? null;
|
|
753
812
|
}
|
|
754
813
|
);
|
|
755
|
-
} catch (
|
|
756
|
-
|
|
814
|
+
} catch (m) {
|
|
815
|
+
h({ status: "error", message: x(m) });
|
|
757
816
|
}
|
|
758
817
|
}, [a]);
|
|
759
818
|
A(() => {
|
|
760
819
|
r();
|
|
761
820
|
}, [r]);
|
|
762
|
-
const y = o.status === "ready" ? o.workspaces : [],
|
|
821
|
+
const y = o.status === "ready" ? o.workspaces : [], v = y.find((m) => m.id === s) ?? null;
|
|
763
822
|
if (o.status === "loading")
|
|
764
823
|
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) });
|
|
765
824
|
if (o.status === "error")
|
|
766
825
|
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "alert", children: o.message }) });
|
|
767
|
-
const
|
|
768
|
-
|
|
826
|
+
const f = y.length > 0, N = /* @__PURE__ */ e(
|
|
827
|
+
V,
|
|
769
828
|
{
|
|
770
829
|
workspaces: y,
|
|
771
|
-
selected:
|
|
772
|
-
onSelect:
|
|
830
|
+
selected: v,
|
|
831
|
+
onSelect: p,
|
|
773
832
|
onChanged: () => {
|
|
774
833
|
r();
|
|
775
834
|
},
|
|
776
|
-
onMembersChanged: () => b((
|
|
835
|
+
onMembersChanged: () => b((m) => m + 1)
|
|
777
836
|
}
|
|
778
|
-
), k = /* @__PURE__ */
|
|
837
|
+
), k = /* @__PURE__ */ t("section", { className: "shepherd-config", "aria-labelledby": "config-heading", children: [
|
|
779
838
|
/* @__PURE__ */ e("h2", { id: "config-heading", children: "Configuration" }),
|
|
780
|
-
|
|
781
|
-
|
|
839
|
+
v ? /* @__PURE__ */ e(
|
|
840
|
+
oe,
|
|
782
841
|
{
|
|
783
|
-
workspace:
|
|
784
|
-
hubUrl:
|
|
842
|
+
workspace: v,
|
|
843
|
+
hubUrl: n,
|
|
785
844
|
membersRefreshKey: c,
|
|
786
|
-
onMembersChanged: () => b((
|
|
845
|
+
onMembersChanged: () => b((m) => m + 1),
|
|
787
846
|
onLeft: () => void r(),
|
|
788
847
|
onDeleted: () => void r()
|
|
789
848
|
}
|
|
790
|
-
) : /* @__PURE__ */
|
|
849
|
+
) : /* @__PURE__ */ t("p", { className: "config-none", children: [
|
|
791
850
|
"You're not in a workspace yet. Use the ",
|
|
792
851
|
/* @__PURE__ */ e("b", { children: "Get started ▾" }),
|
|
793
852
|
" menu at the top to create one or join with an invite code."
|
|
794
853
|
] })
|
|
795
854
|
] });
|
|
796
855
|
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e(
|
|
797
|
-
|
|
856
|
+
Y,
|
|
798
857
|
{
|
|
799
|
-
workspaceId:
|
|
858
|
+
workspaceId: v == null ? void 0 : v.id,
|
|
800
859
|
config: k,
|
|
801
|
-
switcher:
|
|
802
|
-
hasWorkspace:
|
|
860
|
+
switcher: N,
|
|
861
|
+
hasWorkspace: f
|
|
803
862
|
}
|
|
804
863
|
) });
|
|
805
864
|
}
|
|
806
865
|
export {
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
866
|
+
oe as ConfigPanel,
|
|
867
|
+
re as ConnectAgent,
|
|
868
|
+
Y as Dashboard,
|
|
869
|
+
ve as EmptyState,
|
|
870
|
+
X as GeneralSettings,
|
|
871
|
+
Q as Invites,
|
|
872
|
+
z as Members,
|
|
873
|
+
J as ShepherdClientError,
|
|
874
|
+
fe as ShepherdClientProvider,
|
|
875
|
+
he as ShepherdRoot,
|
|
876
|
+
V as WorkspaceSwitcher,
|
|
877
|
+
ye as createShepherdClient,
|
|
878
|
+
x as describeError,
|
|
879
|
+
D as useShepherdClient
|
|
821
880
|
};
|