@korso/shepherd-ui 0.9.1 → 0.10.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/JoinWorkspace.d.ts +12 -0
- package/dist/JoinWorkspace.js +34 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/lib/index.d.ts +13 -0
- package/dist/lib/index.js +382 -337
- package/dist/lib/styles.css +30 -0
- package/dist/selfhost/assets/{index-0s8wNrl-.css → index-CGncP2MD.css} +1 -1
- package/dist/selfhost/index.html +2 -2
- package/package.json +1 -1
- /package/dist/selfhost/assets/{index-BK1xPf0V.js → index-BQL_SpLG.js} +0 -0
package/dist/lib/index.js
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { E as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useId as
|
|
5
|
-
function
|
|
6
|
-
return (
|
|
1
|
+
import { u as A, d as x, S as Y, f as W, D as M } from "./Dashboard-BSGZuM-A.js";
|
|
2
|
+
import { E as fe, a as ye, c as be } from "./Dashboard-BSGZuM-A.js";
|
|
3
|
+
import { jsxs as n, jsx as e, Fragment as P } from "react/jsx-runtime";
|
|
4
|
+
import { useId as R, useRef as U, useState as r, useEffect as T, useCallback as G } from "react";
|
|
5
|
+
function F(t) {
|
|
6
|
+
return (t.trim()[0] ?? "?").toUpperCase();
|
|
7
7
|
}
|
|
8
8
|
function V({
|
|
9
|
-
workspaces:
|
|
9
|
+
workspaces: t,
|
|
10
10
|
selected: a,
|
|
11
|
-
onSelect:
|
|
12
|
-
onChanged:
|
|
13
|
-
onMembersChanged:
|
|
11
|
+
onSelect: l,
|
|
12
|
+
onChanged: o,
|
|
13
|
+
onMembersChanged: i
|
|
14
14
|
}) {
|
|
15
|
-
const
|
|
15
|
+
const h = A(), c = R(), v = U(null), [s, u] = r(!1), [y, b] = r("menu"), [N, k] = r(""), [f, _] = r(""), [E, d] = r(null), [g, S] = r(!1);
|
|
16
16
|
function C() {
|
|
17
|
-
|
|
17
|
+
u(!1), b("menu"), k(""), _(""), d(null);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
if (!
|
|
21
|
-
function
|
|
22
|
-
|
|
19
|
+
T(() => {
|
|
20
|
+
if (!s) return;
|
|
21
|
+
function m(O) {
|
|
22
|
+
v.current && !v.current.contains(O.target) && C();
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function I(O) {
|
|
25
25
|
O.key === "Escape" && C();
|
|
26
26
|
}
|
|
27
|
-
return document.addEventListener("mousedown",
|
|
28
|
-
document.removeEventListener("mousedown",
|
|
27
|
+
return document.addEventListener("mousedown", m), document.addEventListener("keydown", I), () => {
|
|
28
|
+
document.removeEventListener("mousedown", m), document.removeEventListener("keydown", I);
|
|
29
29
|
};
|
|
30
|
-
}, [
|
|
31
|
-
async function
|
|
30
|
+
}, [s]);
|
|
31
|
+
async function j() {
|
|
32
32
|
if (!(!N.trim() || g)) {
|
|
33
|
-
S(!0),
|
|
33
|
+
S(!0), d(null);
|
|
34
34
|
try {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
} catch (
|
|
38
|
-
|
|
35
|
+
const m = await h.createWorkspace({ name: N.trim() });
|
|
36
|
+
l(m.id), o(), C();
|
|
37
|
+
} catch (m) {
|
|
38
|
+
d(x(m));
|
|
39
39
|
} finally {
|
|
40
40
|
S(!1);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
async function
|
|
45
|
-
if (!(!
|
|
46
|
-
S(!0),
|
|
44
|
+
async function L() {
|
|
45
|
+
if (!(!f.trim() || g)) {
|
|
46
|
+
S(!0), d(null);
|
|
47
47
|
try {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
} catch (
|
|
51
|
-
|
|
48
|
+
const m = await h.redeemInvite(f.trim());
|
|
49
|
+
l(m.workspace.id), o(), i == null || i(), C();
|
|
50
|
+
} catch (m) {
|
|
51
|
+
d(x(m));
|
|
52
52
|
} finally {
|
|
53
53
|
S(!1);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
const w = a !== null,
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
57
|
+
const w = a !== null, $ = a ? a.name : "Get started";
|
|
58
|
+
return /* @__PURE__ */ n("div", { className: "ws-switcher", ref: v, children: [
|
|
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 ? C() : u(!0),
|
|
68
68
|
children: [
|
|
69
|
-
w ? /* @__PURE__ */ e("span", { className: "ws-avatar", "aria-hidden": "true", children:
|
|
70
|
-
/* @__PURE__ */ e("span", { className: "ws-name", children:
|
|
69
|
+
w ? /* @__PURE__ */ e("span", { className: "ws-avatar", "aria-hidden": "true", children: F($) }) : /* @__PURE__ */ e("span", { className: "ws-plus", "aria-hidden": "true", children: "+" }),
|
|
70
|
+
/* @__PURE__ */ e("span", { className: "ws-name", children: $ }),
|
|
71
71
|
/* @__PURE__ */ e("span", { className: "ws-caret", "aria-hidden": "true", children: "▾" })
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
s && /* @__PURE__ */ n("div", { className: "ws-menu", id: c, role: "menu", children: [
|
|
76
|
+
y === "menu" && /* @__PURE__ */ n(P, { 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
|
+
t.length === 0 ? /* @__PURE__ */ e("p", { className: "ws-menu__none", children: "None yet" }) : /* @__PURE__ */ e("ul", { className: "ws-menu__list", children: t.map((m) => {
|
|
79
|
+
const I = m.id === (a == null ? void 0 : a.id);
|
|
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": I,
|
|
86
|
+
className: "ws-mi" + (I ? " ws-mi--on" : ""),
|
|
87
87
|
onClick: () => {
|
|
88
|
-
|
|
88
|
+
l(m.id), C();
|
|
89
89
|
},
|
|
90
90
|
children: [
|
|
91
|
-
/* @__PURE__ */ e("span", { className: "ws-avatar ws-avatar--sm", "aria-hidden": "true", children:
|
|
92
|
-
/* @__PURE__ */ e("span", { className: "ws-mi__name", children:
|
|
93
|
-
|
|
91
|
+
/* @__PURE__ */ e("span", { className: "ws-avatar ws-avatar--sm", "aria-hidden": "true", children: F(m.name) }),
|
|
92
|
+
/* @__PURE__ */ e("span", { className: "ws-mi__name", children: m.name }),
|
|
93
|
+
I && /* @__PURE__ */ e("span", { className: "ws-mi__check", "aria-hidden": "true", children: "✓" })
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
|
-
) },
|
|
96
|
+
) }, m.id);
|
|
97
97
|
}) }),
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ n("div", { className: "ws-menu__actions", children: [
|
|
99
99
|
/* @__PURE__ */ e(
|
|
100
100
|
"button",
|
|
101
101
|
{
|
|
@@ -103,7 +103,7 @@ function V({
|
|
|
103
103
|
role: "menuitem",
|
|
104
104
|
className: "ws-action",
|
|
105
105
|
onClick: () => {
|
|
106
|
-
|
|
106
|
+
d(null), b("create");
|
|
107
107
|
},
|
|
108
108
|
children: "+ Create workspace"
|
|
109
109
|
}
|
|
@@ -115,19 +115,19 @@ function V({
|
|
|
115
115
|
role: "menuitem",
|
|
116
116
|
className: "ws-action",
|
|
117
117
|
onClick: () => {
|
|
118
|
-
|
|
118
|
+
d(null), b("join");
|
|
119
119
|
},
|
|
120
120
|
children: "⎘ Join with a code"
|
|
121
121
|
}
|
|
122
122
|
)
|
|
123
123
|
] })
|
|
124
124
|
] }),
|
|
125
|
-
|
|
125
|
+
y === "create" && /* @__PURE__ */ n(
|
|
126
126
|
"form",
|
|
127
127
|
{
|
|
128
128
|
className: "ws-form",
|
|
129
|
-
onSubmit: (
|
|
130
|
-
|
|
129
|
+
onSubmit: (m) => {
|
|
130
|
+
m.preventDefault(), j();
|
|
131
131
|
},
|
|
132
132
|
children: [
|
|
133
133
|
/* @__PURE__ */ e("label", { htmlFor: `${c}-name`, children: "New workspace name" }),
|
|
@@ -139,22 +139,22 @@ function V({
|
|
|
139
139
|
placeholder: "e.g. Acme Engineering",
|
|
140
140
|
value: N,
|
|
141
141
|
autoFocus: !0,
|
|
142
|
-
onChange: (
|
|
142
|
+
onChange: (m) => k(m.target.value)
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () =>
|
|
145
|
+
/* @__PURE__ */ n("div", { className: "ws-form__row", children: [
|
|
146
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () => b("menu"), children: "Back" }),
|
|
147
147
|
/* @__PURE__ */ e("button", { type: "submit", disabled: g || !N.trim(), children: "Create" })
|
|
148
148
|
] })
|
|
149
149
|
]
|
|
150
150
|
}
|
|
151
151
|
),
|
|
152
|
-
|
|
152
|
+
y === "join" && /* @__PURE__ */ n(
|
|
153
153
|
"form",
|
|
154
154
|
{
|
|
155
155
|
className: "ws-form",
|
|
156
|
-
onSubmit: (
|
|
157
|
-
|
|
156
|
+
onSubmit: (m) => {
|
|
157
|
+
m.preventDefault(), L();
|
|
158
158
|
},
|
|
159
159
|
children: [
|
|
160
160
|
/* @__PURE__ */ e("label", { htmlFor: `${c}-code`, children: "Invite code" }),
|
|
@@ -164,14 +164,14 @@ function V({
|
|
|
164
164
|
id: `${c}-code`,
|
|
165
165
|
type: "text",
|
|
166
166
|
placeholder: "Paste an invite code",
|
|
167
|
-
value:
|
|
167
|
+
value: f,
|
|
168
168
|
autoFocus: !0,
|
|
169
|
-
onChange: (
|
|
169
|
+
onChange: (m) => _(m.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: g || !
|
|
172
|
+
/* @__PURE__ */ n("div", { className: "ws-form__row", children: [
|
|
173
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () => b("menu"), children: "Back" }),
|
|
174
|
+
/* @__PURE__ */ e("button", { type: "submit", disabled: g || !f.trim(), children: "Join" })
|
|
175
175
|
] })
|
|
176
176
|
]
|
|
177
177
|
}
|
|
@@ -181,73 +181,73 @@ function V({
|
|
|
181
181
|
] });
|
|
182
182
|
}
|
|
183
183
|
function q({
|
|
184
|
-
workspaceName:
|
|
184
|
+
workspaceName: t,
|
|
185
185
|
busy: a,
|
|
186
|
-
error:
|
|
187
|
-
onConfirm:
|
|
188
|
-
onCancel:
|
|
186
|
+
error: l,
|
|
187
|
+
onConfirm: o,
|
|
188
|
+
onCancel: i
|
|
189
189
|
}) {
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
var
|
|
193
|
-
(
|
|
194
|
-
}, []),
|
|
195
|
-
function
|
|
196
|
-
N.key === "Escape" && !a &&
|
|
190
|
+
const h = R(), c = R(), [v, s] = r(""), u = U(null);
|
|
191
|
+
T(() => {
|
|
192
|
+
var b;
|
|
193
|
+
(b = u.current) == null || b.focus();
|
|
194
|
+
}, []), T(() => {
|
|
195
|
+
function b(N) {
|
|
196
|
+
N.key === "Escape" && !a && i();
|
|
197
197
|
}
|
|
198
|
-
return document.addEventListener("keydown",
|
|
199
|
-
}, [a,
|
|
200
|
-
const
|
|
198
|
+
return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
|
|
199
|
+
}, [a, i]);
|
|
200
|
+
const y = v === t;
|
|
201
201
|
return /* @__PURE__ */ e(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
204
204
|
className: "shepherd-modal__backdrop",
|
|
205
205
|
onClick: () => {
|
|
206
|
-
a ||
|
|
206
|
+
a || i();
|
|
207
207
|
},
|
|
208
|
-
children: /* @__PURE__ */
|
|
208
|
+
children: /* @__PURE__ */ n(
|
|
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": h,
|
|
215
215
|
"aria-describedby": c,
|
|
216
|
-
onClick: (
|
|
216
|
+
onClick: (b) => b.stopPropagation(),
|
|
217
217
|
children: [
|
|
218
|
-
/* @__PURE__ */ e("h3", { id:
|
|
219
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ e("h3", { id: h, children: "Delete workspace" }),
|
|
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__ */
|
|
224
|
+
/* @__PURE__ */ n("label", { htmlFor: `${h}-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: `${h}-input`,
|
|
233
|
+
ref: u,
|
|
234
234
|
type: "text",
|
|
235
|
-
value:
|
|
235
|
+
value: v,
|
|
236
236
|
autoComplete: "off",
|
|
237
237
|
disabled: a,
|
|
238
|
-
onChange: (
|
|
238
|
+
onChange: (b) => s(b.target.value)
|
|
239
239
|
}
|
|
240
240
|
),
|
|
241
|
-
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
/* @__PURE__ */ e("button", { type: "button", onClick:
|
|
241
|
+
l && /* @__PURE__ */ e("p", { role: "alert", children: l }),
|
|
242
|
+
/* @__PURE__ */ n("div", { className: "shepherd-modal__actions", children: [
|
|
243
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: i, 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: o,
|
|
250
|
+
disabled: !y || a,
|
|
251
251
|
children: a ? "Deleting…" : "Delete workspace"
|
|
252
252
|
}
|
|
253
253
|
)
|
|
@@ -258,54 +258,54 @@ function q({
|
|
|
258
258
|
}
|
|
259
259
|
);
|
|
260
260
|
}
|
|
261
|
-
function X({ workspace:
|
|
262
|
-
const
|
|
261
|
+
function X({ workspace: t, onLeft: a, onDeleted: l }) {
|
|
262
|
+
const o = A(), i = R(), [h, c] = r(null), [v, s] = r(!1), [u, y] = r(!1), [b, N] = r(!1), [k, f] = r(!1), [_, E] = r(null), d = t.role === "admin";
|
|
263
263
|
async function g() {
|
|
264
|
-
if (!
|
|
265
|
-
|
|
264
|
+
if (!v) {
|
|
265
|
+
s(!0), c(null), y(!1);
|
|
266
266
|
try {
|
|
267
|
-
await
|
|
267
|
+
await o.leave(t.id), a == null || a();
|
|
268
268
|
} catch (C) {
|
|
269
|
-
c(x(C)), C instanceof
|
|
269
|
+
c(x(C)), C instanceof Y && C.status === 409 && y(!0);
|
|
270
270
|
} finally {
|
|
271
|
-
|
|
271
|
+
s(!1);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
async function S() {
|
|
276
276
|
if (!k) {
|
|
277
|
-
|
|
277
|
+
f(!0), E(null);
|
|
278
278
|
try {
|
|
279
|
-
await
|
|
279
|
+
await o.deleteWorkspace(t.id), N(!1), l == null || l();
|
|
280
280
|
} catch (C) {
|
|
281
281
|
E(x(C));
|
|
282
282
|
} finally {
|
|
283
|
-
|
|
283
|
+
f(!1);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
return /* @__PURE__ */
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */ e("h3", { id:
|
|
287
|
+
return /* @__PURE__ */ n("section", { className: "shepherd-general", "aria-labelledby": i, children: [
|
|
288
|
+
/* @__PURE__ */ n("div", { className: "card-head", children: [
|
|
289
|
+
/* @__PURE__ */ e("h3", { id: i, children: "General" }),
|
|
290
290
|
/* @__PURE__ */ e("p", { className: "card-sub", children: "Your active workspace and its settings." })
|
|
291
291
|
] }),
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ n("div", { className: "card-body", children: [
|
|
293
|
+
h && /* @__PURE__ */ e("p", { role: "alert", children: h }),
|
|
294
|
+
u && d && /* @__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__ */ 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
|
-
/* @__PURE__ */
|
|
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
|
-
/* @__PURE__ */
|
|
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 g(), disabled:
|
|
306
|
+
/* @__PURE__ */ e("button", { type: "button", className: "danger", onClick: () => void g(), disabled: v, children: "Leave workspace" })
|
|
307
307
|
] }),
|
|
308
|
-
|
|
308
|
+
d && /* @__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(
|
|
@@ -322,10 +322,10 @@ function X({ workspace: n, onLeft: a, onDeleted: o }) {
|
|
|
322
322
|
)
|
|
323
323
|
] })
|
|
324
324
|
] }),
|
|
325
|
-
|
|
325
|
+
b && /* @__PURE__ */ e(
|
|
326
326
|
q,
|
|
327
327
|
{
|
|
328
|
-
workspaceName:
|
|
328
|
+
workspaceName: t.name,
|
|
329
329
|
busy: k,
|
|
330
330
|
error: _,
|
|
331
331
|
onConfirm: () => void S(),
|
|
@@ -336,95 +336,95 @@ function X({ workspace: n, onLeft: a, onDeleted: o }) {
|
|
|
336
336
|
)
|
|
337
337
|
] });
|
|
338
338
|
}
|
|
339
|
-
function z({ workspaceId:
|
|
340
|
-
const
|
|
341
|
-
async function _({ keepError:
|
|
342
|
-
|
|
339
|
+
function z({ workspaceId: t, refreshKey: a = 0, canRemove: l = !1 }) {
|
|
340
|
+
const o = A(), i = R(), [h, c] = r([]), [v, s] = r(null), [u, y] = r(null), [b, N] = r(!0), [k, f] = r(null);
|
|
341
|
+
async function _({ keepError: d = !1 } = {}) {
|
|
342
|
+
d || s(null);
|
|
343
343
|
try {
|
|
344
|
-
const g = await
|
|
344
|
+
const g = await o.listMembers(t);
|
|
345
345
|
c(g.members);
|
|
346
346
|
} catch (g) {
|
|
347
|
-
|
|
347
|
+
s(x(g));
|
|
348
348
|
} finally {
|
|
349
349
|
N(!1);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
|
|
352
|
+
T(() => {
|
|
353
353
|
N(!0), _();
|
|
354
|
-
}, [
|
|
355
|
-
async function E(
|
|
354
|
+
}, [o, t, a]);
|
|
355
|
+
async function E(d, g) {
|
|
356
356
|
if (!k) {
|
|
357
|
-
|
|
357
|
+
f(d), s(null), y(null), c((S) => S.filter((C) => C.accountId !== d));
|
|
358
358
|
try {
|
|
359
|
-
await
|
|
359
|
+
await o.removeMember(t, d), y(`Removed ${g}`);
|
|
360
360
|
} catch (S) {
|
|
361
|
-
|
|
361
|
+
s(x(S)), _({ keepError: !0 });
|
|
362
362
|
} finally {
|
|
363
|
-
|
|
363
|
+
f(null);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
return /* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */ e("div", { className: "card-head", children: /* @__PURE__ */ e("h3", { id:
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
const g =
|
|
374
|
-
return /* @__PURE__ */
|
|
367
|
+
return /* @__PURE__ */ n("section", { className: "shepherd-members", "aria-labelledby": i, children: [
|
|
368
|
+
/* @__PURE__ */ e("div", { className: "card-head", children: /* @__PURE__ */ e("h3", { id: i, children: "Members" }) }),
|
|
369
|
+
/* @__PURE__ */ n("div", { className: "card-body", children: [
|
|
370
|
+
v && /* @__PURE__ */ e("p", { role: "alert", children: v }),
|
|
371
|
+
u && /* @__PURE__ */ e("p", { role: "status", children: u }),
|
|
372
|
+
b ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) : h.length === 0 ? /* @__PURE__ */ e("p", { children: "No members." }) : /* @__PURE__ */ e("ul", { children: h.map((d) => {
|
|
373
|
+
const g = d.displayName ?? d.githubLogin ?? d.email ?? d.accountId;
|
|
374
|
+
return /* @__PURE__ */ n("li", { children: [
|
|
375
375
|
/* @__PURE__ */ e("span", { children: g }),
|
|
376
|
-
/* @__PURE__ */ e("span", { className: "role", children:
|
|
377
|
-
|
|
376
|
+
/* @__PURE__ */ e("span", { className: "role", children: d.role }),
|
|
377
|
+
l && /* @__PURE__ */ e(
|
|
378
378
|
"button",
|
|
379
379
|
{
|
|
380
380
|
type: "button",
|
|
381
381
|
"aria-label": `Remove ${g}`,
|
|
382
|
-
onClick: () => void E(
|
|
383
|
-
disabled: k ===
|
|
382
|
+
onClick: () => void E(d.accountId, g),
|
|
383
|
+
disabled: k === d.accountId,
|
|
384
384
|
children: "Remove"
|
|
385
385
|
}
|
|
386
386
|
)
|
|
387
|
-
] },
|
|
387
|
+
] }, d.accountId);
|
|
388
388
|
}) })
|
|
389
389
|
] })
|
|
390
390
|
] });
|
|
391
391
|
}
|
|
392
|
-
function Q({ workspaceId:
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}, [
|
|
392
|
+
function Q({ workspaceId: t, onMembersChanged: a }) {
|
|
393
|
+
const l = A(), o = R(), [i, h] = r(null), [c, v] = r(null), [s, u] = r(!1), [y, b] = r(""), [N, k] = r(null), [f, _] = r(!1), [E, d] = r(null);
|
|
394
|
+
T(() => {
|
|
395
|
+
h(null), k(null);
|
|
396
|
+
}, [t]);
|
|
397
397
|
async function g() {
|
|
398
|
-
if (!
|
|
399
|
-
|
|
398
|
+
if (!s) {
|
|
399
|
+
u(!0), v(null);
|
|
400
400
|
try {
|
|
401
|
-
const w = await
|
|
402
|
-
|
|
401
|
+
const w = await l.createInvite(t, {});
|
|
402
|
+
h(w), a == null || a();
|
|
403
403
|
} catch (w) {
|
|
404
|
-
|
|
404
|
+
v(x(w));
|
|
405
405
|
} finally {
|
|
406
|
-
|
|
406
|
+
u(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
async function S() {
|
|
411
|
-
if (!(!
|
|
412
|
-
|
|
411
|
+
if (!(!i || s)) {
|
|
412
|
+
u(!0), v(null);
|
|
413
413
|
try {
|
|
414
|
-
await
|
|
414
|
+
await l.revokeInvite(t, i.code), h(null);
|
|
415
415
|
} catch (w) {
|
|
416
|
-
|
|
416
|
+
v(x(w));
|
|
417
417
|
} finally {
|
|
418
|
-
|
|
418
|
+
u(!1);
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
async function C() {
|
|
423
|
-
if (!(!
|
|
423
|
+
if (!(!y.trim() || f)) {
|
|
424
424
|
_(!0), k(null);
|
|
425
425
|
try {
|
|
426
|
-
const w = await
|
|
427
|
-
k(`Invite sent to ${w.email}.`),
|
|
426
|
+
const w = await l.inviteByEmail(t, y.trim());
|
|
427
|
+
k(`Invite sent to ${w.email}.`), b(""), a == null || a();
|
|
428
428
|
} catch (w) {
|
|
429
429
|
k(x(w));
|
|
430
430
|
} finally {
|
|
@@ -432,24 +432,24 @@ function Q({ workspaceId: n, onMembersChanged: a }) {
|
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
async function
|
|
437
|
-
await navigator.clipboard.writeText(
|
|
435
|
+
const j = i ? `${window.location.origin}/shepherd/join/${encodeURIComponent(i.code)}` : null;
|
|
436
|
+
async function L(w, $) {
|
|
437
|
+
await navigator.clipboard.writeText($), d(w), setTimeout(() => d((m) => m === w ? null : m), 2e3);
|
|
438
438
|
}
|
|
439
|
-
return /* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */ e("h3", { id:
|
|
439
|
+
return /* @__PURE__ */ n("section", { className: "shepherd-invites", "aria-labelledby": o, children: [
|
|
440
|
+
/* @__PURE__ */ n("div", { className: "card-head", children: [
|
|
441
|
+
/* @__PURE__ */ e("h3", { id: o, 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__ */ n("div", { className: "card-body", children: [
|
|
445
445
|
c && /* @__PURE__ */ e("p", { role: "alert", children: c }),
|
|
446
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
450
|
-
/* @__PURE__ */
|
|
449
|
+
i && /* @__PURE__ */ n("div", { className: "invite-result", children: [
|
|
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: i.maxUses === null ? `${i.useCount} uses` : `${i.useCount} / ${i.maxUses} uses` }),
|
|
453
453
|
/* @__PURE__ */ e(
|
|
454
454
|
"button",
|
|
455
455
|
{
|
|
@@ -457,53 +457,53 @@ function Q({ workspaceId: n, onMembersChanged: a }) {
|
|
|
457
457
|
className: "link-btn",
|
|
458
458
|
"aria-label": "Revoke invite",
|
|
459
459
|
onClick: () => void S(),
|
|
460
|
-
disabled:
|
|
460
|
+
disabled: s,
|
|
461
461
|
children: "Revoke"
|
|
462
462
|
}
|
|
463
463
|
)
|
|
464
464
|
] }),
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
/* @__PURE__ */ e("code", { children:
|
|
465
|
+
/* @__PURE__ */ n("div", { className: "invite-result__copyrow", children: [
|
|
466
|
+
/* @__PURE__ */ e("code", { children: i.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 L("code", i.code),
|
|
473
473
|
children: E === "code" ? "Copied" : "Copy"
|
|
474
474
|
}
|
|
475
475
|
)
|
|
476
476
|
] }),
|
|
477
|
-
|
|
478
|
-
/* @__PURE__ */ e("a", { href:
|
|
477
|
+
j && /* @__PURE__ */ n("div", { className: "invite-result__copyrow invite-result__copyrow--link", children: [
|
|
478
|
+
/* @__PURE__ */ e("a", { href: j, children: j }),
|
|
479
479
|
/* @__PURE__ */ e(
|
|
480
480
|
"button",
|
|
481
481
|
{
|
|
482
482
|
type: "button",
|
|
483
483
|
className: "copy-btn",
|
|
484
|
-
onClick: () => void
|
|
484
|
+
onClick: () => void L("link", j),
|
|
485
485
|
children: E === "link" ? "Copied" : "Copy link"
|
|
486
486
|
}
|
|
487
487
|
)
|
|
488
488
|
] })
|
|
489
489
|
] }),
|
|
490
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => void g(), disabled:
|
|
490
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => void g(), disabled: s, children: "Create invite" })
|
|
491
491
|
] }),
|
|
492
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ n("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__ */ n("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: y,
|
|
503
|
+
onChange: (w) => b(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: f, children: "Send invite" })
|
|
507
507
|
] }),
|
|
508
508
|
N && /* @__PURE__ */ e("p", { className: "email-invite__status", children: N })
|
|
509
509
|
] })
|
|
@@ -522,23 +522,23 @@ const Z = [
|
|
|
522
522
|
}, te = {
|
|
523
523
|
claude: "-e",
|
|
524
524
|
codex: "--env"
|
|
525
|
-
},
|
|
526
|
-
function ae(
|
|
527
|
-
return
|
|
525
|
+
}, B = "npx -y --package=@korso/shepherd shepherd-inbox-hook";
|
|
526
|
+
function ae(t) {
|
|
527
|
+
return t === "claude" ? {
|
|
528
528
|
target: "~/.claude/settings.json",
|
|
529
529
|
snippet: JSON.stringify(
|
|
530
530
|
{
|
|
531
531
|
hooks: {
|
|
532
|
-
SessionStart: [{ hooks: [{ type: "command", command:
|
|
532
|
+
SessionStart: [{ hooks: [{ type: "command", command: B }] }],
|
|
533
533
|
PreToolUse: [
|
|
534
|
-
{ matcher: "*", hooks: [{ type: "command", command:
|
|
534
|
+
{ matcher: "*", hooks: [{ type: "command", command: B }] }
|
|
535
535
|
]
|
|
536
536
|
}
|
|
537
537
|
},
|
|
538
538
|
null,
|
|
539
539
|
2
|
|
540
540
|
)
|
|
541
|
-
} :
|
|
541
|
+
} : t === "codex" ? {
|
|
542
542
|
target: "~/.codex/config.toml",
|
|
543
543
|
snippet: [
|
|
544
544
|
"[features]",
|
|
@@ -548,16 +548,16 @@ function ae(n) {
|
|
|
548
548
|
'command = ["npx", "-y", "--package=@korso/shepherd", "shepherd-inbox-hook"]'
|
|
549
549
|
].join(`
|
|
550
550
|
`)
|
|
551
|
-
} :
|
|
551
|
+
} : t === "pi" ? {
|
|
552
552
|
target: "~/.pi/agent/extensions/shepherd-inbox.js",
|
|
553
553
|
snippet: null
|
|
554
|
-
} :
|
|
554
|
+
} : t === "cursor" ? {
|
|
555
555
|
target: "~/.cursor/hooks.json",
|
|
556
556
|
snippet: JSON.stringify(
|
|
557
557
|
{
|
|
558
558
|
version: 1,
|
|
559
559
|
hooks: {
|
|
560
|
-
beforeSubmitPrompt: [{ command:
|
|
560
|
+
beforeSubmitPrompt: [{ command: B }]
|
|
561
561
|
}
|
|
562
562
|
},
|
|
563
563
|
null,
|
|
@@ -565,20 +565,20 @@ function ae(n) {
|
|
|
565
565
|
)
|
|
566
566
|
} : null;
|
|
567
567
|
}
|
|
568
|
-
function ie(
|
|
569
|
-
const
|
|
570
|
-
return `${
|
|
568
|
+
function ie(t, a) {
|
|
569
|
+
const l = `created ${W(t.createdAt, a)}`, o = t.lastUsedAt ? `last used ${W(t.lastUsedAt, a)}` : "never used";
|
|
570
|
+
return `${l} · ${o}`;
|
|
571
571
|
}
|
|
572
|
-
function
|
|
573
|
-
if (
|
|
574
|
-
const
|
|
575
|
-
return
|
|
572
|
+
function re(t, a, l) {
|
|
573
|
+
if (t === "generic" || t === "pi" || t === "cursor") {
|
|
574
|
+
const h = { HUB_URL: a, SHEPHERD_TOKEN: l };
|
|
575
|
+
return t !== "generic" && (h.PROGRAM = t), JSON.stringify(
|
|
576
576
|
{
|
|
577
577
|
mcpServers: {
|
|
578
578
|
shepherd: {
|
|
579
579
|
command: "npx",
|
|
580
580
|
args: ["-y", "--package=@korso/shepherd", "shepherd-mcp"],
|
|
581
|
-
env:
|
|
581
|
+
env: h
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
},
|
|
@@ -586,99 +586,99 @@ function se(n, a, o) {
|
|
|
586
586
|
2
|
|
587
587
|
);
|
|
588
588
|
}
|
|
589
|
-
const
|
|
590
|
-
ne[
|
|
591
|
-
`${
|
|
592
|
-
`${
|
|
589
|
+
const o = te[t], i = [
|
|
590
|
+
ne[t],
|
|
591
|
+
`${o} HUB_URL=${a}`,
|
|
592
|
+
`${o} SHEPHERD_TOKEN=${l}`
|
|
593
593
|
];
|
|
594
|
-
return
|
|
594
|
+
return t === "codex" && i.push(`${o} PROGRAM=codex`), i.push("-- npx -y --package=@korso/shepherd shepherd-mcp"), i.join(" ");
|
|
595
595
|
}
|
|
596
|
-
function
|
|
597
|
-
const a =
|
|
598
|
-
async function
|
|
596
|
+
function se({ hubUrl: t }) {
|
|
597
|
+
const a = A(), l = t ?? a.baseUrl, o = R(), [i, h] = r("claude"), [c, v] = r(""), [s, u] = r(null), [y, b] = r([]), [N, k] = r(null), [f, _] = r(null), [E, d] = r(!1), [g, S] = r(!1), [C, j] = r(!0), [L, w] = r(null);
|
|
598
|
+
async function $() {
|
|
599
599
|
try {
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
} catch (
|
|
603
|
-
k(x(
|
|
600
|
+
const p = await a.listAccountTokens();
|
|
601
|
+
b(p.tokens);
|
|
602
|
+
} catch (p) {
|
|
603
|
+
k(x(p));
|
|
604
604
|
} finally {
|
|
605
|
-
|
|
605
|
+
j(!1);
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
|
|
609
|
-
|
|
608
|
+
T(() => {
|
|
609
|
+
j(!0), $();
|
|
610
610
|
}, [a]);
|
|
611
|
-
async function
|
|
612
|
-
|
|
611
|
+
async function m() {
|
|
612
|
+
d(!0), k(null), _(null);
|
|
613
613
|
try {
|
|
614
|
-
const
|
|
614
|
+
const p = await a.mintAccountToken(
|
|
615
615
|
c.trim() ? { name: c.trim() } : {}
|
|
616
616
|
);
|
|
617
|
-
|
|
618
|
-
} catch (
|
|
619
|
-
k(x(
|
|
617
|
+
u(p.token), v(""), await $();
|
|
618
|
+
} catch (p) {
|
|
619
|
+
k(x(p));
|
|
620
620
|
} finally {
|
|
621
|
-
|
|
621
|
+
d(!1);
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
async function
|
|
625
|
-
if (!
|
|
626
|
-
w(
|
|
624
|
+
async function I(p) {
|
|
625
|
+
if (!L) {
|
|
626
|
+
w(p), k(null), _(null);
|
|
627
627
|
try {
|
|
628
|
-
await a.revokeAccountToken(
|
|
629
|
-
} catch (
|
|
630
|
-
k(x(
|
|
628
|
+
await a.revokeAccountToken(p), b((D) => D.filter((J) => J.id !== p)), _("Token revoked");
|
|
629
|
+
} catch (D) {
|
|
630
|
+
k(x(D));
|
|
631
631
|
} finally {
|
|
632
632
|
w(null);
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
const O =
|
|
637
|
-
async function
|
|
636
|
+
const O = re(i, l, s ?? ee), H = ae(i);
|
|
637
|
+
async function K() {
|
|
638
638
|
await navigator.clipboard.writeText(O), S(!0), setTimeout(() => S(!1), 2e3);
|
|
639
639
|
}
|
|
640
|
-
return /* @__PURE__ */
|
|
641
|
-
/* @__PURE__ */
|
|
642
|
-
/* @__PURE__ */ e("h3", { id:
|
|
640
|
+
return /* @__PURE__ */ n("section", { className: "shepherd-connect-agent", "aria-labelledby": o, children: [
|
|
641
|
+
/* @__PURE__ */ n("div", { className: "card-head", children: [
|
|
642
|
+
/* @__PURE__ */ e("h3", { id: o, children: "Connect your agent" }),
|
|
643
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." }),
|
|
644
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." })
|
|
645
645
|
] }),
|
|
646
|
-
/* @__PURE__ */
|
|
647
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ n("div", { className: "card-body", children: [
|
|
647
|
+
/* @__PURE__ */ n("div", { className: "field", children: [
|
|
648
648
|
/* @__PURE__ */ e("label", { htmlFor: "connect-tool", children: "Tool" }),
|
|
649
649
|
/* @__PURE__ */ e(
|
|
650
650
|
"select",
|
|
651
651
|
{
|
|
652
652
|
id: "connect-tool",
|
|
653
|
-
value:
|
|
654
|
-
onChange: (
|
|
655
|
-
children: Z.map((
|
|
653
|
+
value: i,
|
|
654
|
+
onChange: (p) => h(p.target.value),
|
|
655
|
+
children: Z.map((p) => /* @__PURE__ */ e("option", { value: p.id, children: p.label }, p.id))
|
|
656
656
|
}
|
|
657
657
|
)
|
|
658
658
|
] }),
|
|
659
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ n("div", { className: "field generate", children: [
|
|
660
660
|
/* @__PURE__ */ e("label", { htmlFor: "token-name", children: "Token name (optional)" }),
|
|
661
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ n("div", { className: "field__row", children: [
|
|
662
662
|
/* @__PURE__ */ e(
|
|
663
663
|
"input",
|
|
664
664
|
{
|
|
665
665
|
id: "token-name",
|
|
666
666
|
type: "text",
|
|
667
667
|
value: c,
|
|
668
|
-
onChange: (
|
|
669
|
-
onKeyDown: (
|
|
670
|
-
|
|
668
|
+
onChange: (p) => v(p.target.value),
|
|
669
|
+
onKeyDown: (p) => {
|
|
670
|
+
p.key === "Enter" && !E && (p.preventDefault(), m());
|
|
671
671
|
},
|
|
672
672
|
placeholder: "e.g. laptop"
|
|
673
673
|
}
|
|
674
674
|
),
|
|
675
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => void
|
|
675
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => void m(), disabled: E, children: "Generate token" })
|
|
676
676
|
] })
|
|
677
677
|
] }),
|
|
678
678
|
N && /* @__PURE__ */ e("p", { role: "alert", children: N }),
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
/* @__PURE__ */
|
|
679
|
+
f && /* @__PURE__ */ e("p", { role: "status", children: f }),
|
|
680
|
+
s && /* @__PURE__ */ e("p", { className: "token-once", role: "status", children: "Copy this token now — it won't be shown again." }),
|
|
681
|
+
/* @__PURE__ */ n("div", { className: "install-command", children: [
|
|
682
682
|
/* @__PURE__ */ e("pre", { "data-testid": "install-command", children: O }),
|
|
683
683
|
/* @__PURE__ */ e(
|
|
684
684
|
"button",
|
|
@@ -687,7 +687,7 @@ function re({ hubUrl: n }) {
|
|
|
687
687
|
className: "install-command__copy",
|
|
688
688
|
"aria-label": g ? "Copied" : "Copy command",
|
|
689
689
|
title: g ? "Copied" : "Copy",
|
|
690
|
-
onClick: () => void
|
|
690
|
+
onClick: () => void K(),
|
|
691
691
|
children: g ? /* @__PURE__ */ e(
|
|
692
692
|
"svg",
|
|
693
693
|
{
|
|
@@ -702,7 +702,7 @@ function re({ hubUrl: n }) {
|
|
|
702
702
|
"aria-hidden": "true",
|
|
703
703
|
children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" })
|
|
704
704
|
}
|
|
705
|
-
) : /* @__PURE__ */
|
|
705
|
+
) : /* @__PURE__ */ n(
|
|
706
706
|
"svg",
|
|
707
707
|
{
|
|
708
708
|
width: "15",
|
|
@@ -723,37 +723,37 @@ function re({ hubUrl: n }) {
|
|
|
723
723
|
}
|
|
724
724
|
)
|
|
725
725
|
] }),
|
|
726
|
-
|
|
727
|
-
/* @__PURE__ */
|
|
726
|
+
H && /* @__PURE__ */ n("div", { className: "hook-setup", children: [
|
|
727
|
+
/* @__PURE__ */ n("p", { className: "card-sub", children: [
|
|
728
728
|
"Message delivery sets itself up: the first time the agent runs, Shepherd adds its inbox hook to ",
|
|
729
|
-
/* @__PURE__ */ e("code", { children:
|
|
729
|
+
/* @__PURE__ */ e("code", { children: H.target }),
|
|
730
730
|
" ",
|
|
731
731
|
"automatically — it delivers teammate announcements and reminds the agent to link each repo before its first write. Happens at most once; set ",
|
|
732
732
|
/* @__PURE__ */ e("code", { children: "SHEPHERD_NO_AUTO_HOOKS=1" }),
|
|
733
733
|
" to opt out."
|
|
734
734
|
] }),
|
|
735
|
-
|
|
735
|
+
H.snippet && /* @__PURE__ */ n("details", { className: "hook-reference", children: [
|
|
736
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:
|
|
737
|
+
/* @__PURE__ */ e("div", { className: "install-command", children: /* @__PURE__ */ e("pre", { "data-testid": "hook-snippet", children: H.snippet }) })
|
|
738
738
|
] })
|
|
739
739
|
] }),
|
|
740
740
|
/* @__PURE__ */ e("h4", { children: "Existing tokens" }),
|
|
741
|
-
C ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) :
|
|
742
|
-
const
|
|
743
|
-
return /* @__PURE__ */
|
|
744
|
-
/* @__PURE__ */ e("span", { children:
|
|
745
|
-
/* @__PURE__ */ e("span", { className: "token-meta", children: ie(
|
|
746
|
-
|
|
741
|
+
C ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) : y.length === 0 ? /* @__PURE__ */ e("p", { children: "No tokens yet." }) : /* @__PURE__ */ e("ul", { children: y.map((p) => {
|
|
742
|
+
const D = p.name ?? p.id;
|
|
743
|
+
return /* @__PURE__ */ n("li", { children: [
|
|
744
|
+
/* @__PURE__ */ e("span", { children: D }),
|
|
745
|
+
/* @__PURE__ */ e("span", { className: "token-meta", children: ie(p, Date.now()) }),
|
|
746
|
+
p.revokedAt ? /* @__PURE__ */ e("span", { className: "revoked", children: "revoked" }) : /* @__PURE__ */ e(
|
|
747
747
|
"button",
|
|
748
748
|
{
|
|
749
749
|
type: "button",
|
|
750
|
-
"aria-label": `Revoke token ${
|
|
751
|
-
onClick: () => void
|
|
752
|
-
disabled:
|
|
750
|
+
"aria-label": `Revoke token ${D}`,
|
|
751
|
+
onClick: () => void I(p.id),
|
|
752
|
+
disabled: L === p.id,
|
|
753
753
|
children: "Revoke"
|
|
754
754
|
}
|
|
755
755
|
)
|
|
756
|
-
] },
|
|
756
|
+
] }, p.id);
|
|
757
757
|
}) })
|
|
758
758
|
] })
|
|
759
759
|
] });
|
|
@@ -764,117 +764,162 @@ const le = [
|
|
|
764
764
|
{ id: "agent", label: "Agent" }
|
|
765
765
|
];
|
|
766
766
|
function oe({
|
|
767
|
-
workspace:
|
|
767
|
+
workspace: t,
|
|
768
768
|
hubUrl: a,
|
|
769
|
-
membersRefreshKey:
|
|
770
|
-
onMembersChanged:
|
|
771
|
-
onLeft:
|
|
772
|
-
onDeleted:
|
|
769
|
+
membersRefreshKey: l,
|
|
770
|
+
onMembersChanged: o,
|
|
771
|
+
onLeft: i,
|
|
772
|
+
onDeleted: h
|
|
773
773
|
}) {
|
|
774
|
-
const [c,
|
|
775
|
-
return /* @__PURE__ */
|
|
776
|
-
/* @__PURE__ */ e("nav", { className: "config-nav", "aria-label": "Configuration sections", children: le.map(({ id:
|
|
774
|
+
const [c, v] = r("general"), s = t.role === "admin";
|
|
775
|
+
return /* @__PURE__ */ n("div", { className: "config-layout", children: [
|
|
776
|
+
/* @__PURE__ */ e("nav", { className: "config-nav", "aria-label": "Configuration sections", children: le.map(({ id: u, label: y }) => /* @__PURE__ */ e(
|
|
777
777
|
"button",
|
|
778
778
|
{
|
|
779
779
|
type: "button",
|
|
780
|
-
className: "config-nav__item" + (c ===
|
|
781
|
-
"aria-current": c ===
|
|
782
|
-
onClick: () =>
|
|
783
|
-
children:
|
|
780
|
+
className: "config-nav__item" + (c === u ? " config-nav__item--on" : ""),
|
|
781
|
+
"aria-current": c === u ? "page" : void 0,
|
|
782
|
+
onClick: () => v(u),
|
|
783
|
+
children: y
|
|
784
784
|
},
|
|
785
|
-
|
|
785
|
+
u
|
|
786
786
|
)) }),
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
c === "general" && /* @__PURE__ */ e(X, { workspace:
|
|
789
|
-
c === "members" && /* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ n("div", { className: "config-panel", children: [
|
|
788
|
+
c === "general" && /* @__PURE__ */ e(X, { workspace: t, onLeft: i, onDeleted: h }),
|
|
789
|
+
c === "members" && /* @__PURE__ */ n(P, { children: [
|
|
790
790
|
/* @__PURE__ */ e(
|
|
791
791
|
z,
|
|
792
792
|
{
|
|
793
|
-
workspaceId:
|
|
794
|
-
refreshKey:
|
|
795
|
-
canRemove:
|
|
793
|
+
workspaceId: t.id,
|
|
794
|
+
refreshKey: l,
|
|
795
|
+
canRemove: s
|
|
796
796
|
}
|
|
797
797
|
),
|
|
798
|
-
|
|
798
|
+
s && /* @__PURE__ */ e(Q, { workspaceId: t.id, onMembersChanged: o })
|
|
799
799
|
] }),
|
|
800
|
-
c === "agent" && /* @__PURE__ */ e(
|
|
800
|
+
c === "agent" && /* @__PURE__ */ e(se, { hubUrl: a })
|
|
801
801
|
] })
|
|
802
802
|
] });
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
const a =
|
|
804
|
+
function ue({ hubUrl: t }) {
|
|
805
|
+
const a = A(), [l, o] = r({ status: "loading" }), [i, h] = r(null), [c, v] = r(0), s = G(async () => {
|
|
806
806
|
try {
|
|
807
|
-
const
|
|
808
|
-
|
|
807
|
+
const f = await a.listWorkspaces();
|
|
808
|
+
o({ status: "ready", workspaces: f.workspaces }), h(
|
|
809
809
|
(_) => {
|
|
810
810
|
var E;
|
|
811
|
-
return _ &&
|
|
811
|
+
return _ && f.workspaces.some((d) => d.id === _) ? _ : ((E = f.workspaces[0]) == null ? void 0 : E.id) ?? null;
|
|
812
812
|
}
|
|
813
813
|
);
|
|
814
|
-
} catch (
|
|
815
|
-
|
|
814
|
+
} catch (f) {
|
|
815
|
+
o({ status: "error", message: x(f) });
|
|
816
816
|
}
|
|
817
817
|
}, [a]);
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
}, [
|
|
821
|
-
const
|
|
822
|
-
if (
|
|
818
|
+
T(() => {
|
|
819
|
+
s();
|
|
820
|
+
}, [s]);
|
|
821
|
+
const u = l.status === "ready" ? l.workspaces : [], y = u.find((f) => f.id === i) ?? null;
|
|
822
|
+
if (l.status === "loading")
|
|
823
823
|
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) });
|
|
824
|
-
if (
|
|
825
|
-
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "alert", children:
|
|
826
|
-
const
|
|
824
|
+
if (l.status === "error")
|
|
825
|
+
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "alert", children: l.message }) });
|
|
826
|
+
const b = u.length > 0, N = /* @__PURE__ */ e(
|
|
827
827
|
V,
|
|
828
828
|
{
|
|
829
|
-
workspaces:
|
|
830
|
-
selected:
|
|
831
|
-
onSelect:
|
|
829
|
+
workspaces: u,
|
|
830
|
+
selected: y,
|
|
831
|
+
onSelect: h,
|
|
832
832
|
onChanged: () => {
|
|
833
|
-
|
|
833
|
+
s();
|
|
834
834
|
},
|
|
835
|
-
onMembersChanged: () =>
|
|
835
|
+
onMembersChanged: () => v((f) => f + 1)
|
|
836
836
|
}
|
|
837
|
-
), k = /* @__PURE__ */
|
|
837
|
+
), k = /* @__PURE__ */ n("section", { className: "shepherd-config", "aria-labelledby": "config-heading", children: [
|
|
838
838
|
/* @__PURE__ */ e("h2", { id: "config-heading", children: "Configuration" }),
|
|
839
|
-
|
|
839
|
+
y ? /* @__PURE__ */ e(
|
|
840
840
|
oe,
|
|
841
841
|
{
|
|
842
|
-
workspace:
|
|
843
|
-
hubUrl:
|
|
842
|
+
workspace: y,
|
|
843
|
+
hubUrl: t,
|
|
844
844
|
membersRefreshKey: c,
|
|
845
|
-
onMembersChanged: () =>
|
|
846
|
-
onLeft: () => void
|
|
847
|
-
onDeleted: () => void
|
|
845
|
+
onMembersChanged: () => v((f) => f + 1),
|
|
846
|
+
onLeft: () => void s(),
|
|
847
|
+
onDeleted: () => void s()
|
|
848
848
|
}
|
|
849
|
-
) : /* @__PURE__ */
|
|
849
|
+
) : /* @__PURE__ */ n("p", { className: "config-none", children: [
|
|
850
850
|
"You're not in a workspace yet. Use the ",
|
|
851
851
|
/* @__PURE__ */ e("b", { children: "Get started ▾" }),
|
|
852
852
|
" menu at the top to create one or join with an invite code."
|
|
853
853
|
] })
|
|
854
854
|
] });
|
|
855
855
|
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e(
|
|
856
|
-
|
|
856
|
+
M,
|
|
857
857
|
{
|
|
858
|
-
workspaceId:
|
|
858
|
+
workspaceId: y == null ? void 0 : y.id,
|
|
859
859
|
config: k,
|
|
860
860
|
switcher: N,
|
|
861
|
-
hasWorkspace:
|
|
861
|
+
hasWorkspace: b
|
|
862
862
|
}
|
|
863
863
|
) });
|
|
864
864
|
}
|
|
865
|
+
function me({ code: t, onJoined: a }) {
|
|
866
|
+
const l = A(), o = R(), [i, h] = r({ status: "joining" }), c = U(a);
|
|
867
|
+
c.current = a;
|
|
868
|
+
const v = G(async () => {
|
|
869
|
+
h({ status: "joining" });
|
|
870
|
+
try {
|
|
871
|
+
const u = await l.redeemInvite(t);
|
|
872
|
+
h({ status: "joined", workspace: u.workspace }), c.current(u.workspace);
|
|
873
|
+
} catch (u) {
|
|
874
|
+
h({ status: "error", message: x(u) });
|
|
875
|
+
}
|
|
876
|
+
}, [l, t]), s = U(!1);
|
|
877
|
+
return T(() => {
|
|
878
|
+
s.current || (s.current = !0, v());
|
|
879
|
+
}, [v]), /* @__PURE__ */ e("section", { className: "shepherd-join", "aria-labelledby": o, children: /* @__PURE__ */ n("div", { className: "shepherd-join__card", children: [
|
|
880
|
+
/* @__PURE__ */ e("p", { className: "shepherd-join__brand", children: "Shepherd" }),
|
|
881
|
+
i.status === "joining" && /* @__PURE__ */ n(P, { children: [
|
|
882
|
+
/* @__PURE__ */ e("h1", { id: o, children: "Joining workspace…" }),
|
|
883
|
+
/* @__PURE__ */ e("p", { className: "shepherd-join__copy", role: "status", children: "Hold on while we add you to the team." }),
|
|
884
|
+
/* @__PURE__ */ e("div", { className: "shepherd-join__spinner", "aria-hidden": "true" })
|
|
885
|
+
] }),
|
|
886
|
+
i.status === "joined" && /* @__PURE__ */ n(P, { children: [
|
|
887
|
+
/* @__PURE__ */ e("h1", { id: o, children: "You’re in" }),
|
|
888
|
+
/* @__PURE__ */ n("p", { className: "shepherd-join__copy", role: "status", children: [
|
|
889
|
+
"Joined ",
|
|
890
|
+
/* @__PURE__ */ e("strong", { children: i.workspace.name }),
|
|
891
|
+
". Taking you to the board…"
|
|
892
|
+
] })
|
|
893
|
+
] }),
|
|
894
|
+
i.status === "error" && /* @__PURE__ */ n(P, { children: [
|
|
895
|
+
/* @__PURE__ */ e("h1", { id: o, children: "Couldn’t join the workspace" }),
|
|
896
|
+
/* @__PURE__ */ e("p", { className: "shepherd-join__error", role: "alert", children: i.message }),
|
|
897
|
+
/* @__PURE__ */ e(
|
|
898
|
+
"button",
|
|
899
|
+
{
|
|
900
|
+
type: "button",
|
|
901
|
+
className: "shepherd-join__retry",
|
|
902
|
+
onClick: () => void v(),
|
|
903
|
+
children: "Try again"
|
|
904
|
+
}
|
|
905
|
+
)
|
|
906
|
+
] })
|
|
907
|
+
] }) });
|
|
908
|
+
}
|
|
865
909
|
export {
|
|
866
910
|
oe as ConfigPanel,
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
911
|
+
se as ConnectAgent,
|
|
912
|
+
M as Dashboard,
|
|
913
|
+
fe as EmptyState,
|
|
870
914
|
X as GeneralSettings,
|
|
871
915
|
Q as Invites,
|
|
916
|
+
me as JoinWorkspace,
|
|
872
917
|
z as Members,
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
918
|
+
Y as ShepherdClientError,
|
|
919
|
+
ye as ShepherdClientProvider,
|
|
920
|
+
ue as ShepherdRoot,
|
|
876
921
|
V as WorkspaceSwitcher,
|
|
877
|
-
|
|
922
|
+
be as createShepherdClient,
|
|
878
923
|
x as describeError,
|
|
879
|
-
|
|
924
|
+
A as useShepherdClient
|
|
880
925
|
};
|