@korso/shepherd-ui 0.10.0 → 0.11.1
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/README.md +3 -0
- package/dist/ShepherdRoot.d.ts +6 -1
- package/dist/ShepherdRoot.js +4 -3
- package/dist/components/Chat.js +1 -1
- package/dist/components/Composer.js +1 -1
- package/dist/components/Dashboard.d.ts +6 -1
- package/dist/components/Dashboard.js +2 -2
- package/dist/components/DoneList.js +1 -1
- package/dist/config/ConfigPanel.d.ts +6 -1
- package/dist/config/ConfigPanel.js +3 -2
- package/dist/config/ConfirmDeleteWorkspace.js +1 -1
- package/dist/config/ConnectAgent.js +2 -2
- package/dist/config/SignOutAction.d.ts +7 -0
- package/dist/config/SignOutAction.js +7 -0
- package/dist/lib/{Dashboard-BSGZuM-A.js → Dashboard-DNr0hdbW.js} +604 -561
- package/dist/lib/index.d.ts +18 -3
- package/dist/lib/index.js +390 -371
- package/dist/lib/selfhost.js +32 -32
- package/dist/lib/styles.css +12 -0
- package/dist/selfhost/assets/index-DLumdd7Z.js +40 -0
- package/dist/selfhost/assets/index-Do2kYzi3.css +1 -0
- package/dist/selfhost/index.html +2 -2
- package/dist/selfhost.js +14 -13
- package/package.json +1 -1
- package/dist/selfhost/assets/index-BQL_SpLG.js +0 -40
- package/dist/selfhost/assets/index-CGncP2MD.css +0 -1
package/dist/lib/index.js
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { E as
|
|
3
|
-
import { jsxs as n, jsx as e, Fragment as
|
|
4
|
-
import { useId as
|
|
1
|
+
import { u as L, d as x, S as M, f as W, D as V } from "./Dashboard-DNr0hdbW.js";
|
|
2
|
+
import { E as ye, a as be, c as ke } from "./Dashboard-DNr0hdbW.js";
|
|
3
|
+
import { jsxs as n, jsx as e, Fragment as $ } from "react/jsx-runtime";
|
|
4
|
+
import { useId as j, useRef as B, useState as s, useEffect as T, useCallback as G } from "react";
|
|
5
5
|
function F(t) {
|
|
6
6
|
return (t.trim()[0] ?? "?").toUpperCase();
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function q({
|
|
9
9
|
workspaces: t,
|
|
10
10
|
selected: a,
|
|
11
|
-
onSelect:
|
|
12
|
-
onChanged:
|
|
11
|
+
onSelect: h,
|
|
12
|
+
onChanged: r,
|
|
13
13
|
onMembersChanged: i
|
|
14
14
|
}) {
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
|
|
15
|
+
const p = L(), u = j(), c = B(null), [d, m] = s(!1), [y, l] = s("menu"), [N, g] = s(""), [_, b] = s(""), [C, o] = s(null), [k, E] = s(!1);
|
|
16
|
+
function S() {
|
|
17
|
+
m(!1), l("menu"), g(""), b(""), o(null);
|
|
18
18
|
}
|
|
19
19
|
T(() => {
|
|
20
|
-
if (!
|
|
21
|
-
function
|
|
22
|
-
|
|
20
|
+
if (!d) return;
|
|
21
|
+
function v(D) {
|
|
22
|
+
c.current && !c.current.contains(D.target) && S();
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
24
|
+
function R(D) {
|
|
25
|
+
D.key === "Escape" && S();
|
|
26
26
|
}
|
|
27
|
-
return document.addEventListener("mousedown",
|
|
28
|
-
document.removeEventListener("mousedown",
|
|
27
|
+
return document.addEventListener("mousedown", v), document.addEventListener("keydown", R), () => {
|
|
28
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", R);
|
|
29
29
|
};
|
|
30
|
-
}, [
|
|
31
|
-
async function
|
|
32
|
-
if (!(!N.trim() ||
|
|
33
|
-
|
|
30
|
+
}, [d]);
|
|
31
|
+
async function I() {
|
|
32
|
+
if (!(!N.trim() || k)) {
|
|
33
|
+
E(!0), o(null);
|
|
34
34
|
try {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
} catch (
|
|
38
|
-
|
|
35
|
+
const v = await p.createWorkspace({ name: N.trim() });
|
|
36
|
+
h(v.id), r(), S();
|
|
37
|
+
} catch (v) {
|
|
38
|
+
o(x(v));
|
|
39
39
|
} finally {
|
|
40
|
-
|
|
40
|
+
E(!1);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
async function
|
|
45
|
-
if (!(!
|
|
46
|
-
|
|
44
|
+
async function A() {
|
|
45
|
+
if (!(!_.trim() || k)) {
|
|
46
|
+
E(!0), o(null);
|
|
47
47
|
try {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
} catch (
|
|
51
|
-
|
|
48
|
+
const v = await p.redeemInvite(_.trim());
|
|
49
|
+
h(v.workspace.id), r(), i == null || i(), S();
|
|
50
|
+
} catch (v) {
|
|
51
|
+
o(x(v));
|
|
52
52
|
} finally {
|
|
53
|
-
|
|
53
|
+
E(!1);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
const w = a !== null,
|
|
58
|
-
return /* @__PURE__ */ n("div", { className: "ws-switcher", ref:
|
|
57
|
+
const w = a !== null, O = a ? a.name : "Get started";
|
|
58
|
+
return /* @__PURE__ */ n("div", { className: "ws-switcher", ref: c, children: [
|
|
59
59
|
/* @__PURE__ */ n(
|
|
60
60
|
"button",
|
|
61
61
|
{
|
|
62
62
|
type: "button",
|
|
63
63
|
className: "ws-trig" + (w ? "" : " ws-trig--empty"),
|
|
64
64
|
"aria-haspopup": "menu",
|
|
65
|
-
"aria-expanded":
|
|
66
|
-
"aria-controls":
|
|
67
|
-
onClick: () =>
|
|
65
|
+
"aria-expanded": d,
|
|
66
|
+
"aria-controls": d ? u : void 0,
|
|
67
|
+
onClick: () => d ? S() : m(!0),
|
|
68
68
|
children: [
|
|
69
|
-
w ? /* @__PURE__ */ e("span", { className: "ws-avatar", "aria-hidden": "true", children: F(
|
|
70
|
-
/* @__PURE__ */ e("span", { className: "ws-name", children:
|
|
69
|
+
w ? /* @__PURE__ */ e("span", { className: "ws-avatar", "aria-hidden": "true", children: F(O) }) : /* @__PURE__ */ e("span", { className: "ws-plus", "aria-hidden": "true", children: "+" }),
|
|
70
|
+
/* @__PURE__ */ e("span", { className: "ws-name", children: O }),
|
|
71
71
|
/* @__PURE__ */ e("span", { className: "ws-caret", "aria-hidden": "true", children: "▾" })
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
|
|
76
|
-
y === "menu" && /* @__PURE__ */ n(
|
|
75
|
+
d && /* @__PURE__ */ n("div", { className: "ws-menu", id: u, role: "menu", children: [
|
|
76
|
+
y === "menu" && /* @__PURE__ */ n($, { children: [
|
|
77
77
|
/* @__PURE__ */ e("p", { className: "ws-menu__head", children: w ? "Switch workspace" : "Your workspaces" }),
|
|
78
|
-
t.length === 0 ? /* @__PURE__ */ e("p", { className: "ws-menu__none", children: "None yet" }) : /* @__PURE__ */ e("ul", { className: "ws-menu__list", children: t.map((
|
|
79
|
-
const
|
|
78
|
+
t.length === 0 ? /* @__PURE__ */ e("p", { className: "ws-menu__none", children: "None yet" }) : /* @__PURE__ */ e("ul", { className: "ws-menu__list", children: t.map((v) => {
|
|
79
|
+
const R = v.id === (a == null ? void 0 : a.id);
|
|
80
80
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ n(
|
|
81
81
|
"button",
|
|
82
82
|
{
|
|
83
83
|
type: "button",
|
|
84
84
|
role: "menuitemradio",
|
|
85
|
-
"aria-checked":
|
|
86
|
-
className: "ws-mi" + (
|
|
85
|
+
"aria-checked": R,
|
|
86
|
+
className: "ws-mi" + (R ? " ws-mi--on" : ""),
|
|
87
87
|
onClick: () => {
|
|
88
|
-
|
|
88
|
+
h(v.id), S();
|
|
89
89
|
},
|
|
90
90
|
children: [
|
|
91
|
-
/* @__PURE__ */ e("span", { className: "ws-avatar ws-avatar--sm", "aria-hidden": "true", children: F(
|
|
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(v.name) }),
|
|
92
|
+
/* @__PURE__ */ e("span", { className: "ws-mi__name", children: v.name }),
|
|
93
|
+
R && /* @__PURE__ */ e("span", { className: "ws-mi__check", "aria-hidden": "true", children: "✓" })
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
|
-
) },
|
|
96
|
+
) }, v.id);
|
|
97
97
|
}) }),
|
|
98
98
|
/* @__PURE__ */ n("div", { className: "ws-menu__actions", children: [
|
|
99
99
|
/* @__PURE__ */ e(
|
|
@@ -103,7 +103,7 @@ function V({
|
|
|
103
103
|
role: "menuitem",
|
|
104
104
|
className: "ws-action",
|
|
105
105
|
onClick: () => {
|
|
106
|
-
|
|
106
|
+
o(null), l("create");
|
|
107
107
|
},
|
|
108
108
|
children: "+ Create workspace"
|
|
109
109
|
}
|
|
@@ -115,7 +115,7 @@ function V({
|
|
|
115
115
|
role: "menuitem",
|
|
116
116
|
className: "ws-action",
|
|
117
117
|
onClick: () => {
|
|
118
|
-
|
|
118
|
+
o(null), l("join");
|
|
119
119
|
},
|
|
120
120
|
children: "⎘ Join with a code"
|
|
121
121
|
}
|
|
@@ -126,25 +126,25 @@ function V({
|
|
|
126
126
|
"form",
|
|
127
127
|
{
|
|
128
128
|
className: "ws-form",
|
|
129
|
-
onSubmit: (
|
|
130
|
-
|
|
129
|
+
onSubmit: (v) => {
|
|
130
|
+
v.preventDefault(), I();
|
|
131
131
|
},
|
|
132
132
|
children: [
|
|
133
|
-
/* @__PURE__ */ e("label", { htmlFor: `${
|
|
133
|
+
/* @__PURE__ */ e("label", { htmlFor: `${u}-name`, children: "New workspace name" }),
|
|
134
134
|
/* @__PURE__ */ e(
|
|
135
135
|
"input",
|
|
136
136
|
{
|
|
137
|
-
id: `${
|
|
137
|
+
id: `${u}-name`,
|
|
138
138
|
type: "text",
|
|
139
139
|
placeholder: "e.g. Acme Engineering",
|
|
140
140
|
value: N,
|
|
141
141
|
autoFocus: !0,
|
|
142
|
-
onChange: (
|
|
142
|
+
onChange: (v) => g(v.target.value)
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
145
|
/* @__PURE__ */ n("div", { className: "ws-form__row", children: [
|
|
146
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () =>
|
|
147
|
-
/* @__PURE__ */ e("button", { type: "submit", disabled:
|
|
146
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () => l("menu"), children: "Back" }),
|
|
147
|
+
/* @__PURE__ */ e("button", { type: "submit", disabled: k || !N.trim(), children: "Create" })
|
|
148
148
|
] })
|
|
149
149
|
]
|
|
150
150
|
}
|
|
@@ -153,51 +153,51 @@ function V({
|
|
|
153
153
|
"form",
|
|
154
154
|
{
|
|
155
155
|
className: "ws-form",
|
|
156
|
-
onSubmit: (
|
|
157
|
-
|
|
156
|
+
onSubmit: (v) => {
|
|
157
|
+
v.preventDefault(), A();
|
|
158
158
|
},
|
|
159
159
|
children: [
|
|
160
|
-
/* @__PURE__ */ e("label", { htmlFor: `${
|
|
160
|
+
/* @__PURE__ */ e("label", { htmlFor: `${u}-code`, children: "Invite code" }),
|
|
161
161
|
/* @__PURE__ */ e(
|
|
162
162
|
"input",
|
|
163
163
|
{
|
|
164
|
-
id: `${
|
|
164
|
+
id: `${u}-code`,
|
|
165
165
|
type: "text",
|
|
166
166
|
placeholder: "Paste an invite code",
|
|
167
|
-
value:
|
|
167
|
+
value: _,
|
|
168
168
|
autoFocus: !0,
|
|
169
|
-
onChange: (
|
|
169
|
+
onChange: (v) => b(v.target.value)
|
|
170
170
|
}
|
|
171
171
|
),
|
|
172
172
|
/* @__PURE__ */ n("div", { className: "ws-form__row", children: [
|
|
173
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () =>
|
|
174
|
-
/* @__PURE__ */ e("button", { type: "submit", disabled:
|
|
173
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ws-form__back", onClick: () => l("menu"), children: "Back" }),
|
|
174
|
+
/* @__PURE__ */ e("button", { type: "submit", disabled: k || !_.trim(), children: "Join" })
|
|
175
175
|
] })
|
|
176
176
|
]
|
|
177
177
|
}
|
|
178
178
|
),
|
|
179
|
-
|
|
179
|
+
C && /* @__PURE__ */ e("p", { className: "ws-menu__error", role: "alert", children: C })
|
|
180
180
|
] })
|
|
181
181
|
] });
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function X({
|
|
184
184
|
workspaceName: t,
|
|
185
185
|
busy: a,
|
|
186
|
-
error:
|
|
187
|
-
onConfirm:
|
|
186
|
+
error: h,
|
|
187
|
+
onConfirm: r,
|
|
188
188
|
onCancel: i
|
|
189
189
|
}) {
|
|
190
|
-
const
|
|
190
|
+
const p = j(), u = j(), [c, d] = s(""), m = B(null);
|
|
191
191
|
T(() => {
|
|
192
|
-
var
|
|
193
|
-
(
|
|
192
|
+
var l;
|
|
193
|
+
(l = m.current) == null || l.focus();
|
|
194
194
|
}, []), T(() => {
|
|
195
|
-
function
|
|
195
|
+
function l(N) {
|
|
196
196
|
N.key === "Escape" && !a && i();
|
|
197
197
|
}
|
|
198
|
-
return document.addEventListener("keydown",
|
|
198
|
+
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
199
199
|
}, [a, i]);
|
|
200
|
-
const y =
|
|
200
|
+
const y = c === t;
|
|
201
201
|
return /* @__PURE__ */ e(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
@@ -211,17 +211,17 @@ function q({
|
|
|
211
211
|
className: "shepherd-modal",
|
|
212
212
|
role: "dialog",
|
|
213
213
|
"aria-modal": "true",
|
|
214
|
-
"aria-labelledby":
|
|
215
|
-
"aria-describedby":
|
|
216
|
-
onClick: (
|
|
214
|
+
"aria-labelledby": p,
|
|
215
|
+
"aria-describedby": u,
|
|
216
|
+
onClick: (l) => l.stopPropagation(),
|
|
217
217
|
children: [
|
|
218
|
-
/* @__PURE__ */ e("h3", { id:
|
|
219
|
-
/* @__PURE__ */ n("p", { id:
|
|
218
|
+
/* @__PURE__ */ e("h3", { id: p, children: "Delete workspace" }),
|
|
219
|
+
/* @__PURE__ */ n("p", { id: u, className: "shepherd-modal__body", children: [
|
|
220
220
|
"This permanently deletes ",
|
|
221
221
|
/* @__PURE__ */ e("b", { children: t }),
|
|
222
|
-
" and all of its data
|
|
222
|
+
" and all of its data: agents, sessions, tasks, announcements, change history, tokens, invites, and members. This cannot be undone."
|
|
223
223
|
] }),
|
|
224
|
-
/* @__PURE__ */ n("label", { htmlFor: `${
|
|
224
|
+
/* @__PURE__ */ n("label", { htmlFor: `${p}-input`, className: "shepherd-modal__label", children: [
|
|
225
225
|
"Type ",
|
|
226
226
|
/* @__PURE__ */ e("b", { children: t }),
|
|
227
227
|
" to confirm"
|
|
@@ -229,16 +229,16 @@ function q({
|
|
|
229
229
|
/* @__PURE__ */ e(
|
|
230
230
|
"input",
|
|
231
231
|
{
|
|
232
|
-
id: `${
|
|
233
|
-
ref:
|
|
232
|
+
id: `${p}-input`,
|
|
233
|
+
ref: m,
|
|
234
234
|
type: "text",
|
|
235
|
-
value:
|
|
235
|
+
value: c,
|
|
236
236
|
autoComplete: "off",
|
|
237
237
|
disabled: a,
|
|
238
|
-
onChange: (
|
|
238
|
+
onChange: (l) => d(l.target.value)
|
|
239
239
|
}
|
|
240
240
|
),
|
|
241
|
-
|
|
241
|
+
h && /* @__PURE__ */ e("p", { role: "alert", children: h }),
|
|
242
242
|
/* @__PURE__ */ n("div", { className: "shepherd-modal__actions", children: [
|
|
243
243
|
/* @__PURE__ */ e("button", { type: "button", onClick: i, disabled: a, children: "Cancel" }),
|
|
244
244
|
/* @__PURE__ */ e(
|
|
@@ -246,7 +246,7 @@ function q({
|
|
|
246
246
|
{
|
|
247
247
|
type: "button",
|
|
248
248
|
className: "danger",
|
|
249
|
-
onClick:
|
|
249
|
+
onClick: r,
|
|
250
250
|
disabled: !y || a,
|
|
251
251
|
children: a ? "Deleting…" : "Delete workspace"
|
|
252
252
|
}
|
|
@@ -258,29 +258,29 @@ function q({
|
|
|
258
258
|
}
|
|
259
259
|
);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
const
|
|
263
|
-
async function
|
|
264
|
-
if (!
|
|
265
|
-
|
|
261
|
+
function z({ workspace: t, onLeft: a, onDeleted: h }) {
|
|
262
|
+
const r = L(), i = j(), [p, u] = s(null), [c, d] = s(!1), [m, y] = s(!1), [l, N] = s(!1), [g, _] = s(!1), [b, C] = s(null), o = t.role === "admin";
|
|
263
|
+
async function k() {
|
|
264
|
+
if (!c) {
|
|
265
|
+
d(!0), u(null), y(!1);
|
|
266
266
|
try {
|
|
267
|
-
await
|
|
268
|
-
} catch (
|
|
269
|
-
|
|
267
|
+
await r.leave(t.id), a == null || a();
|
|
268
|
+
} catch (S) {
|
|
269
|
+
u(x(S)), S instanceof M && S.status === 409 && y(!0);
|
|
270
270
|
} finally {
|
|
271
|
-
|
|
271
|
+
d(!1);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
async function
|
|
276
|
-
if (!
|
|
277
|
-
|
|
275
|
+
async function E() {
|
|
276
|
+
if (!g) {
|
|
277
|
+
_(!0), C(null);
|
|
278
278
|
try {
|
|
279
|
-
await
|
|
280
|
-
} catch (
|
|
281
|
-
|
|
279
|
+
await r.deleteWorkspace(t.id), N(!1), h == null || h();
|
|
280
|
+
} catch (S) {
|
|
281
|
+
C(x(S));
|
|
282
282
|
} finally {
|
|
283
|
-
|
|
283
|
+
_(!1);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
}
|
|
@@ -290,8 +290,8 @@ function X({ workspace: t, onLeft: a, onDeleted: l }) {
|
|
|
290
290
|
/* @__PURE__ */ e("p", { className: "card-sub", children: "Your active workspace and its settings." })
|
|
291
291
|
] }),
|
|
292
292
|
/* @__PURE__ */ n("div", { className: "card-body", children: [
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
p && /* @__PURE__ */ e("p", { role: "alert", children: p }),
|
|
294
|
+
m && o && /* @__PURE__ */ e("p", { className: "helper", children: "You're the last admin, so you can't leave. To remove this workspace entirely, delete it below." }),
|
|
295
295
|
/* @__PURE__ */ n("div", { className: "field", children: [
|
|
296
296
|
/* @__PURE__ */ e("label", { children: "Workspace name" }),
|
|
297
297
|
/* @__PURE__ */ e("p", { className: "readonly-value", children: t.name })
|
|
@@ -303,9 +303,9 @@ function X({ workspace: t, onLeft: a, onDeleted: l }) {
|
|
|
303
303
|
/* @__PURE__ */ n("div", { className: "field leave", children: [
|
|
304
304
|
/* @__PURE__ */ e("label", { children: "Leave workspace" }),
|
|
305
305
|
/* @__PURE__ */ e("p", { className: "helper", children: "Remove yourself from this workspace. You'll need a new invite to rejoin." }),
|
|
306
|
-
/* @__PURE__ */ e("button", { type: "button", className: "danger", onClick: () => void
|
|
306
|
+
/* @__PURE__ */ e("button", { type: "button", className: "danger", onClick: () => void k(), disabled: c, children: "Leave workspace" })
|
|
307
307
|
] }),
|
|
308
|
-
|
|
308
|
+
o && /* @__PURE__ */ n("div", { className: "field delete", children: [
|
|
309
309
|
/* @__PURE__ */ e("label", { children: "Delete workspace" }),
|
|
310
310
|
/* @__PURE__ */ e("p", { className: "helper", children: "Permanently delete this workspace and all of its data. This cannot be undone." }),
|
|
311
311
|
/* @__PURE__ */ e(
|
|
@@ -314,135 +314,135 @@ function X({ workspace: t, onLeft: a, onDeleted: l }) {
|
|
|
314
314
|
type: "button",
|
|
315
315
|
className: "danger",
|
|
316
316
|
onClick: () => {
|
|
317
|
-
|
|
317
|
+
C(null), N(!0);
|
|
318
318
|
},
|
|
319
|
-
disabled:
|
|
319
|
+
disabled: g,
|
|
320
320
|
children: "Delete workspace"
|
|
321
321
|
}
|
|
322
322
|
)
|
|
323
323
|
] })
|
|
324
324
|
] }),
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
l && /* @__PURE__ */ e(
|
|
326
|
+
X,
|
|
327
327
|
{
|
|
328
328
|
workspaceName: t.name,
|
|
329
|
-
busy:
|
|
330
|
-
error:
|
|
331
|
-
onConfirm: () => void
|
|
329
|
+
busy: g,
|
|
330
|
+
error: b,
|
|
331
|
+
onConfirm: () => void E(),
|
|
332
332
|
onCancel: () => {
|
|
333
|
-
|
|
333
|
+
g || N(!1);
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
)
|
|
337
337
|
] });
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
const
|
|
341
|
-
async function
|
|
342
|
-
|
|
339
|
+
function Q({ workspaceId: t, refreshKey: a = 0, canRemove: h = !1 }) {
|
|
340
|
+
const r = L(), i = j(), [p, u] = s([]), [c, d] = s(null), [m, y] = s(null), [l, N] = s(!0), [g, _] = s(null);
|
|
341
|
+
async function b({ keepError: o = !1 } = {}) {
|
|
342
|
+
o || d(null);
|
|
343
343
|
try {
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
} catch (
|
|
347
|
-
|
|
344
|
+
const k = await r.listMembers(t);
|
|
345
|
+
u(k.members);
|
|
346
|
+
} catch (k) {
|
|
347
|
+
d(x(k));
|
|
348
348
|
} finally {
|
|
349
349
|
N(!1);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
T(() => {
|
|
353
|
-
N(!0),
|
|
354
|
-
}, [
|
|
355
|
-
async function
|
|
356
|
-
if (!
|
|
357
|
-
|
|
353
|
+
N(!0), b();
|
|
354
|
+
}, [r, t, a]);
|
|
355
|
+
async function C(o, k) {
|
|
356
|
+
if (!g) {
|
|
357
|
+
_(o), d(null), y(null), u((E) => E.filter((S) => S.accountId !== o));
|
|
358
358
|
try {
|
|
359
|
-
await
|
|
360
|
-
} catch (
|
|
361
|
-
|
|
359
|
+
await r.removeMember(t, o), y(`Removed ${k}`);
|
|
360
|
+
} catch (E) {
|
|
361
|
+
d(x(E)), b({ keepError: !0 });
|
|
362
362
|
} finally {
|
|
363
|
-
|
|
363
|
+
_(null);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
return /* @__PURE__ */ n("section", { className: "shepherd-members", "aria-labelledby": i, children: [
|
|
368
368
|
/* @__PURE__ */ e("div", { className: "card-head", children: /* @__PURE__ */ e("h3", { id: i, children: "Members" }) }),
|
|
369
369
|
/* @__PURE__ */ n("div", { className: "card-body", children: [
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
const
|
|
370
|
+
c && /* @__PURE__ */ e("p", { role: "alert", children: c }),
|
|
371
|
+
m && /* @__PURE__ */ e("p", { role: "status", children: m }),
|
|
372
|
+
l ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) : p.length === 0 ? /* @__PURE__ */ e("p", { children: "No members." }) : /* @__PURE__ */ e("ul", { children: p.map((o) => {
|
|
373
|
+
const k = o.displayName ?? o.githubLogin ?? o.email ?? o.accountId;
|
|
374
374
|
return /* @__PURE__ */ n("li", { children: [
|
|
375
|
-
/* @__PURE__ */ e("span", { children:
|
|
376
|
-
/* @__PURE__ */ e("span", { className: "role", children:
|
|
377
|
-
|
|
375
|
+
/* @__PURE__ */ e("span", { children: k }),
|
|
376
|
+
/* @__PURE__ */ e("span", { className: "role", children: o.role }),
|
|
377
|
+
h && /* @__PURE__ */ e(
|
|
378
378
|
"button",
|
|
379
379
|
{
|
|
380
380
|
type: "button",
|
|
381
|
-
"aria-label": `Remove ${
|
|
382
|
-
onClick: () => void
|
|
383
|
-
disabled:
|
|
381
|
+
"aria-label": `Remove ${k}`,
|
|
382
|
+
onClick: () => void C(o.accountId, k),
|
|
383
|
+
disabled: g === o.accountId,
|
|
384
384
|
children: "Remove"
|
|
385
385
|
}
|
|
386
386
|
)
|
|
387
|
-
] },
|
|
387
|
+
] }, o.accountId);
|
|
388
388
|
}) })
|
|
389
389
|
] })
|
|
390
390
|
] });
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
const
|
|
392
|
+
function Z({ workspaceId: t, onMembersChanged: a }) {
|
|
393
|
+
const h = L(), r = j(), [i, p] = s(null), [u, c] = s(null), [d, m] = s(!1), [y, l] = s(""), [N, g] = s(null), [_, b] = s(!1), [C, o] = s(null);
|
|
394
394
|
T(() => {
|
|
395
|
-
|
|
395
|
+
p(null), g(null);
|
|
396
396
|
}, [t]);
|
|
397
|
-
async function
|
|
398
|
-
if (!
|
|
399
|
-
|
|
397
|
+
async function k() {
|
|
398
|
+
if (!d) {
|
|
399
|
+
m(!0), c(null);
|
|
400
400
|
try {
|
|
401
|
-
const w = await
|
|
402
|
-
|
|
401
|
+
const w = await h.createInvite(t, {});
|
|
402
|
+
p(w), a == null || a();
|
|
403
403
|
} catch (w) {
|
|
404
|
-
|
|
404
|
+
c(x(w));
|
|
405
405
|
} finally {
|
|
406
|
-
|
|
406
|
+
m(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
async function
|
|
411
|
-
if (!(!i ||
|
|
412
|
-
|
|
410
|
+
async function E() {
|
|
411
|
+
if (!(!i || d)) {
|
|
412
|
+
m(!0), c(null);
|
|
413
413
|
try {
|
|
414
|
-
await
|
|
414
|
+
await h.revokeInvite(t, i.code), p(null);
|
|
415
415
|
} catch (w) {
|
|
416
|
-
|
|
416
|
+
c(x(w));
|
|
417
417
|
} finally {
|
|
418
|
-
|
|
418
|
+
m(!1);
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
async function
|
|
423
|
-
if (!(!y.trim() ||
|
|
424
|
-
|
|
422
|
+
async function S() {
|
|
423
|
+
if (!(!y.trim() || _)) {
|
|
424
|
+
b(!0), g(null);
|
|
425
425
|
try {
|
|
426
|
-
const w = await
|
|
427
|
-
|
|
426
|
+
const w = await h.inviteByEmail(t, y.trim());
|
|
427
|
+
g(`Invite sent to ${w.email}.`), l(""), a == null || a();
|
|
428
428
|
} catch (w) {
|
|
429
|
-
|
|
429
|
+
g(x(w));
|
|
430
430
|
} finally {
|
|
431
|
-
|
|
431
|
+
b(!1);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
async function
|
|
437
|
-
await navigator.clipboard.writeText(
|
|
435
|
+
const I = i ? `${window.location.origin}/shepherd/join/${encodeURIComponent(i.code)}` : null;
|
|
436
|
+
async function A(w, O) {
|
|
437
|
+
await navigator.clipboard.writeText(O), o(w), setTimeout(() => o((v) => v === w ? null : v), 2e3);
|
|
438
438
|
}
|
|
439
|
-
return /* @__PURE__ */ n("section", { className: "shepherd-invites", "aria-labelledby":
|
|
439
|
+
return /* @__PURE__ */ n("section", { className: "shepherd-invites", "aria-labelledby": r, children: [
|
|
440
440
|
/* @__PURE__ */ n("div", { className: "card-head", children: [
|
|
441
|
-
/* @__PURE__ */ e("h3", { id:
|
|
441
|
+
/* @__PURE__ */ e("h3", { id: r, children: "Invite people" }),
|
|
442
442
|
/* @__PURE__ */ e("p", { className: "card-sub", children: "Share a code, or send a one-time join link by email." })
|
|
443
443
|
] }),
|
|
444
444
|
/* @__PURE__ */ n("div", { className: "card-body", children: [
|
|
445
|
-
|
|
445
|
+
u && /* @__PURE__ */ e("p", { role: "alert", children: u }),
|
|
446
446
|
/* @__PURE__ */ n("div", { className: "field invites", children: [
|
|
447
447
|
/* @__PURE__ */ e("label", { children: "Invite by code" }),
|
|
448
448
|
/* @__PURE__ */ e("p", { className: "helper", children: "Anyone with the code can join this workspace." }),
|
|
@@ -456,8 +456,8 @@ function Q({ workspaceId: t, onMembersChanged: a }) {
|
|
|
456
456
|
type: "button",
|
|
457
457
|
className: "link-btn",
|
|
458
458
|
"aria-label": "Revoke invite",
|
|
459
|
-
onClick: () => void
|
|
460
|
-
disabled:
|
|
459
|
+
onClick: () => void E(),
|
|
460
|
+
disabled: d,
|
|
461
461
|
children: "Revoke"
|
|
462
462
|
}
|
|
463
463
|
)
|
|
@@ -469,25 +469,25 @@ function Q({ workspaceId: t, onMembersChanged: a }) {
|
|
|
469
469
|
{
|
|
470
470
|
type: "button",
|
|
471
471
|
className: "copy-btn",
|
|
472
|
-
onClick: () => void
|
|
473
|
-
children:
|
|
472
|
+
onClick: () => void A("code", i.code),
|
|
473
|
+
children: C === "code" ? "Copied" : "Copy"
|
|
474
474
|
}
|
|
475
475
|
)
|
|
476
476
|
] }),
|
|
477
|
-
|
|
478
|
-
/* @__PURE__ */ e("a", { href:
|
|
477
|
+
I && /* @__PURE__ */ n("div", { className: "invite-result__copyrow invite-result__copyrow--link", children: [
|
|
478
|
+
/* @__PURE__ */ e("a", { href: I, children: I }),
|
|
479
479
|
/* @__PURE__ */ e(
|
|
480
480
|
"button",
|
|
481
481
|
{
|
|
482
482
|
type: "button",
|
|
483
483
|
className: "copy-btn",
|
|
484
|
-
onClick: () => void
|
|
485
|
-
children:
|
|
484
|
+
onClick: () => void A("link", I),
|
|
485
|
+
children: C === "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 k(), disabled: d, children: "Create invite" })
|
|
491
491
|
] }),
|
|
492
492
|
/* @__PURE__ */ n("div", { className: "field email-invite", children: [
|
|
493
493
|
/* @__PURE__ */ e("label", { htmlFor: "invite-email", children: "Invite by email" }),
|
|
@@ -500,38 +500,38 @@ function Q({ workspaceId: t, onMembersChanged: a }) {
|
|
|
500
500
|
type: "email",
|
|
501
501
|
placeholder: "name@example.com",
|
|
502
502
|
value: y,
|
|
503
|
-
onChange: (w) =>
|
|
503
|
+
onChange: (w) => l(w.target.value)
|
|
504
504
|
}
|
|
505
505
|
),
|
|
506
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => void
|
|
506
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => void S(), disabled: _, 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 ee = [
|
|
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
|
+
], ne = "shp_<paste-after-generating>", te = {
|
|
520
520
|
claude: "claude mcp add shepherd -s user",
|
|
521
521
|
codex: "codex mcp add shepherd"
|
|
522
|
-
},
|
|
522
|
+
}, ae = {
|
|
523
523
|
claude: "-e",
|
|
524
524
|
codex: "--env"
|
|
525
|
-
},
|
|
526
|
-
function
|
|
525
|
+
}, H = "npx -y --package=@korso/shepherd shepherd-inbox-hook";
|
|
526
|
+
function ie(t) {
|
|
527
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: H }] }],
|
|
533
533
|
PreToolUse: [
|
|
534
|
-
{ matcher: "*", hooks: [{ type: "command", command:
|
|
534
|
+
{ matcher: "*", hooks: [{ type: "command", command: H }] }
|
|
535
535
|
]
|
|
536
536
|
}
|
|
537
537
|
},
|
|
@@ -557,7 +557,7 @@ function ae(t) {
|
|
|
557
557
|
{
|
|
558
558
|
version: 1,
|
|
559
559
|
hooks: {
|
|
560
|
-
beforeSubmitPrompt: [{ command:
|
|
560
|
+
beforeSubmitPrompt: [{ command: H }]
|
|
561
561
|
}
|
|
562
562
|
},
|
|
563
563
|
null,
|
|
@@ -565,20 +565,20 @@ function ae(t) {
|
|
|
565
565
|
)
|
|
566
566
|
} : null;
|
|
567
567
|
}
|
|
568
|
-
function
|
|
569
|
-
const
|
|
570
|
-
return `${
|
|
568
|
+
function se(t, a) {
|
|
569
|
+
const h = `created ${W(t.createdAt, a)}`, r = t.lastUsedAt ? `last used ${W(t.lastUsedAt, a)}` : "never used";
|
|
570
|
+
return `${h} · ${r}`;
|
|
571
571
|
}
|
|
572
|
-
function re(t, a,
|
|
572
|
+
function re(t, a, h) {
|
|
573
573
|
if (t === "generic" || t === "pi" || t === "cursor") {
|
|
574
|
-
const
|
|
575
|
-
return t !== "generic" && (
|
|
574
|
+
const p = { HUB_URL: a, SHEPHERD_TOKEN: h };
|
|
575
|
+
return t !== "generic" && (p.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: p
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
},
|
|
@@ -586,62 +586,62 @@ function re(t, a, l) {
|
|
|
586
586
|
2
|
|
587
587
|
);
|
|
588
588
|
}
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
`${
|
|
592
|
-
`${
|
|
589
|
+
const r = ae[t], i = [
|
|
590
|
+
te[t],
|
|
591
|
+
`${r} HUB_URL=${a}`,
|
|
592
|
+
`${r} SHEPHERD_TOKEN=${h}`
|
|
593
593
|
];
|
|
594
|
-
return t === "codex" && i.push(`${
|
|
594
|
+
return t === "codex" && i.push(`${r} 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 le({ hubUrl: t }) {
|
|
597
|
+
const a = L(), h = t ?? a.baseUrl, r = j(), [i, p] = s("claude"), [u, c] = s(""), [d, m] = s(null), [y, l] = s([]), [N, g] = s(null), [_, b] = s(null), [C, o] = s(!1), [k, E] = s(!1), [S, I] = s(!0), [A, w] = s(null);
|
|
598
|
+
async function O() {
|
|
599
599
|
try {
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
} catch (
|
|
603
|
-
|
|
600
|
+
const f = await a.listAccountTokens();
|
|
601
|
+
l(f.tokens);
|
|
602
|
+
} catch (f) {
|
|
603
|
+
g(x(f));
|
|
604
604
|
} finally {
|
|
605
|
-
|
|
605
|
+
I(!1);
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
T(() => {
|
|
609
|
-
|
|
609
|
+
I(!0), O();
|
|
610
610
|
}, [a]);
|
|
611
|
-
async function
|
|
612
|
-
|
|
611
|
+
async function v() {
|
|
612
|
+
o(!0), g(null), b(null);
|
|
613
613
|
try {
|
|
614
|
-
const
|
|
615
|
-
|
|
614
|
+
const f = await a.mintAccountToken(
|
|
615
|
+
u.trim() ? { name: u.trim() } : {}
|
|
616
616
|
);
|
|
617
|
-
|
|
618
|
-
} catch (
|
|
619
|
-
|
|
617
|
+
m(f.token), c(""), await O();
|
|
618
|
+
} catch (f) {
|
|
619
|
+
g(x(f));
|
|
620
620
|
} finally {
|
|
621
|
-
|
|
621
|
+
o(!1);
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
async function
|
|
625
|
-
if (!
|
|
626
|
-
w(
|
|
624
|
+
async function R(f) {
|
|
625
|
+
if (!A) {
|
|
626
|
+
w(f), g(null), b(null);
|
|
627
627
|
try {
|
|
628
|
-
await a.revokeAccountToken(
|
|
629
|
-
} catch (
|
|
630
|
-
|
|
628
|
+
await a.revokeAccountToken(f), l((P) => P.filter((Y) => Y.id !== f)), b("Token revoked");
|
|
629
|
+
} catch (P) {
|
|
630
|
+
g(x(P));
|
|
631
631
|
} finally {
|
|
632
632
|
w(null);
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
const
|
|
637
|
-
async function
|
|
638
|
-
await navigator.clipboard.writeText(
|
|
636
|
+
const D = re(i, h, d ?? ne), U = ie(i);
|
|
637
|
+
async function J() {
|
|
638
|
+
await navigator.clipboard.writeText(D), E(!0), setTimeout(() => E(!1), 2e3);
|
|
639
639
|
}
|
|
640
|
-
return /* @__PURE__ */ n("section", { className: "shepherd-connect-agent", "aria-labelledby":
|
|
640
|
+
return /* @__PURE__ */ n("section", { className: "shepherd-connect-agent", "aria-labelledby": r, children: [
|
|
641
641
|
/* @__PURE__ */ n("div", { className: "card-head", children: [
|
|
642
|
-
/* @__PURE__ */ e("h3", { id:
|
|
643
|
-
/* @__PURE__ */ e("p", { className: "card-sub", children: "Generate a token
|
|
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
|
|
642
|
+
/* @__PURE__ */ e("h3", { id: r, children: "Connect your agent" }),
|
|
643
|
+
/* @__PURE__ */ e("p", { className: "card-sub", children: "Generate a token; it works across all your workspaces, so paste the command into your coding tool." }),
|
|
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
646
|
/* @__PURE__ */ n("div", { className: "card-body", children: [
|
|
647
647
|
/* @__PURE__ */ n("div", { className: "field", children: [
|
|
@@ -651,8 +651,8 @@ function se({ hubUrl: t }) {
|
|
|
651
651
|
{
|
|
652
652
|
id: "connect-tool",
|
|
653
653
|
value: i,
|
|
654
|
-
onChange: (
|
|
655
|
-
children:
|
|
654
|
+
onChange: (f) => p(f.target.value),
|
|
655
|
+
children: ee.map((f) => /* @__PURE__ */ e("option", { value: f.id, children: f.label }, f.id))
|
|
656
656
|
}
|
|
657
657
|
)
|
|
658
658
|
] }),
|
|
@@ -664,31 +664,31 @@ function se({ hubUrl: t }) {
|
|
|
664
664
|
{
|
|
665
665
|
id: "token-name",
|
|
666
666
|
type: "text",
|
|
667
|
-
value:
|
|
668
|
-
onChange: (
|
|
669
|
-
onKeyDown: (
|
|
670
|
-
|
|
667
|
+
value: u,
|
|
668
|
+
onChange: (f) => c(f.target.value),
|
|
669
|
+
onKeyDown: (f) => {
|
|
670
|
+
f.key === "Enter" && !C && (f.preventDefault(), v());
|
|
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 v(), disabled: C, children: "Generate token" })
|
|
676
676
|
] })
|
|
677
677
|
] }),
|
|
678
678
|
N && /* @__PURE__ */ e("p", { role: "alert", children: N }),
|
|
679
|
-
|
|
680
|
-
|
|
679
|
+
_ && /* @__PURE__ */ e("p", { role: "status", children: _ }),
|
|
680
|
+
d && /* @__PURE__ */ e("p", { className: "token-once", role: "status", children: "Copy this token now; it won't be shown again." }),
|
|
681
681
|
/* @__PURE__ */ n("div", { className: "install-command", children: [
|
|
682
|
-
/* @__PURE__ */ e("pre", { "data-testid": "install-command", children:
|
|
682
|
+
/* @__PURE__ */ e("pre", { "data-testid": "install-command", children: D }),
|
|
683
683
|
/* @__PURE__ */ e(
|
|
684
684
|
"button",
|
|
685
685
|
{
|
|
686
686
|
type: "button",
|
|
687
687
|
className: "install-command__copy",
|
|
688
|
-
"aria-label":
|
|
689
|
-
title:
|
|
690
|
-
onClick: () => void
|
|
691
|
-
children:
|
|
688
|
+
"aria-label": k ? "Copied" : "Copy command",
|
|
689
|
+
title: k ? "Copied" : "Copy",
|
|
690
|
+
onClick: () => void J(),
|
|
691
|
+
children: k ? /* @__PURE__ */ e(
|
|
692
692
|
"svg",
|
|
693
693
|
{
|
|
694
694
|
width: "15",
|
|
@@ -723,183 +723,202 @@ function se({ hubUrl: t }) {
|
|
|
723
723
|
}
|
|
724
724
|
)
|
|
725
725
|
] }),
|
|
726
|
-
|
|
726
|
+
U && /* @__PURE__ */ n("div", { className: "hook-setup", children: [
|
|
727
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: U.target }),
|
|
730
|
+
" ",
|
|
731
|
+
"automatically. It delivers teammate announcements and reminds the agent to link each repo before its first write. This happens at most once; set",
|
|
730
732
|
" ",
|
|
731
|
-
"automatically — it delivers teammate announcements and reminds the agent to link each repo before its first write. Happens at most once; set ",
|
|
732
733
|
/* @__PURE__ */ e("code", { children: "SHEPHERD_NO_AUTO_HOOKS=1" }),
|
|
733
734
|
" to opt out."
|
|
734
735
|
] }),
|
|
735
|
-
|
|
736
|
+
U.snippet && /* @__PURE__ */ n("details", { className: "hook-reference", children: [
|
|
736
737
|
/* @__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:
|
|
738
|
+
/* @__PURE__ */ e("div", { className: "install-command", children: /* @__PURE__ */ e("pre", { "data-testid": "hook-snippet", children: U.snippet }) })
|
|
738
739
|
] })
|
|
739
740
|
] }),
|
|
740
741
|
/* @__PURE__ */ e("h4", { children: "Existing tokens" }),
|
|
741
|
-
|
|
742
|
-
const
|
|
742
|
+
S ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) : y.length === 0 ? /* @__PURE__ */ e("p", { children: "No tokens yet." }) : /* @__PURE__ */ e("ul", { children: y.map((f) => {
|
|
743
|
+
const P = f.name ?? f.id;
|
|
743
744
|
return /* @__PURE__ */ n("li", { children: [
|
|
744
|
-
/* @__PURE__ */ e("span", { children:
|
|
745
|
-
/* @__PURE__ */ e("span", { className: "token-meta", children:
|
|
746
|
-
|
|
745
|
+
/* @__PURE__ */ e("span", { children: P }),
|
|
746
|
+
/* @__PURE__ */ e("span", { className: "token-meta", children: se(f, Date.now()) }),
|
|
747
|
+
f.revokedAt ? /* @__PURE__ */ e("span", { className: "revoked", children: "revoked" }) : /* @__PURE__ */ e(
|
|
747
748
|
"button",
|
|
748
749
|
{
|
|
749
750
|
type: "button",
|
|
750
|
-
"aria-label": `Revoke token ${
|
|
751
|
-
onClick: () => void
|
|
752
|
-
disabled:
|
|
751
|
+
"aria-label": `Revoke token ${P}`,
|
|
752
|
+
onClick: () => void R(f.id),
|
|
753
|
+
disabled: A === f.id,
|
|
753
754
|
children: "Revoke"
|
|
754
755
|
}
|
|
755
756
|
)
|
|
756
|
-
] },
|
|
757
|
+
] }, f.id);
|
|
757
758
|
}) })
|
|
758
759
|
] })
|
|
759
760
|
] });
|
|
760
761
|
}
|
|
761
|
-
|
|
762
|
+
function K({ onLogout: t }) {
|
|
763
|
+
const a = j();
|
|
764
|
+
return /* @__PURE__ */ n("section", { className: "config-signout", "aria-labelledby": a, children: [
|
|
765
|
+
/* @__PURE__ */ e("div", { className: "card-head", children: /* @__PURE__ */ e("h3", { id: a, children: "Session" }) }),
|
|
766
|
+
/* @__PURE__ */ n("div", { className: "card-body", children: [
|
|
767
|
+
/* @__PURE__ */ e("p", { className: "helper", children: "Sign out of this Shepherd dashboard session." }),
|
|
768
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: t, children: "Sign out" })
|
|
769
|
+
] })
|
|
770
|
+
] });
|
|
771
|
+
}
|
|
772
|
+
const oe = [
|
|
762
773
|
{ id: "general", label: "General" },
|
|
763
774
|
{ id: "members", label: "Members" },
|
|
764
775
|
{ id: "agent", label: "Agent" }
|
|
765
776
|
];
|
|
766
|
-
function
|
|
777
|
+
function ce({
|
|
767
778
|
workspace: t,
|
|
768
779
|
hubUrl: a,
|
|
769
|
-
membersRefreshKey:
|
|
770
|
-
onMembersChanged:
|
|
780
|
+
membersRefreshKey: h,
|
|
781
|
+
onMembersChanged: r,
|
|
771
782
|
onLeft: i,
|
|
772
|
-
onDeleted:
|
|
783
|
+
onDeleted: p,
|
|
784
|
+
onLogout: u
|
|
773
785
|
}) {
|
|
774
|
-
const [c,
|
|
775
|
-
return /* @__PURE__ */ n(
|
|
776
|
-
/* @__PURE__ */
|
|
777
|
-
"
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
/* @__PURE__ */
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
786
|
+
const [c, d] = s("general"), m = t.role === "admin";
|
|
787
|
+
return /* @__PURE__ */ n($, { children: [
|
|
788
|
+
/* @__PURE__ */ n("div", { className: "config-layout", children: [
|
|
789
|
+
/* @__PURE__ */ e("nav", { className: "config-nav", "aria-label": "Configuration sections", children: oe.map(({ id: y, label: l }) => /* @__PURE__ */ e(
|
|
790
|
+
"button",
|
|
791
|
+
{
|
|
792
|
+
type: "button",
|
|
793
|
+
className: "config-nav__item" + (c === y ? " config-nav__item--on" : ""),
|
|
794
|
+
"aria-current": c === y ? "page" : void 0,
|
|
795
|
+
onClick: () => d(y),
|
|
796
|
+
children: l
|
|
797
|
+
},
|
|
798
|
+
y
|
|
799
|
+
)) }),
|
|
800
|
+
/* @__PURE__ */ n("div", { className: "config-panel", children: [
|
|
801
|
+
c === "general" && /* @__PURE__ */ e(z, { workspace: t, onLeft: i, onDeleted: p }),
|
|
802
|
+
c === "members" && /* @__PURE__ */ n($, { children: [
|
|
803
|
+
/* @__PURE__ */ e(
|
|
804
|
+
Q,
|
|
805
|
+
{
|
|
806
|
+
workspaceId: t.id,
|
|
807
|
+
refreshKey: h,
|
|
808
|
+
canRemove: m
|
|
809
|
+
}
|
|
810
|
+
),
|
|
811
|
+
m && /* @__PURE__ */ e(Z, { workspaceId: t.id, onMembersChanged: r })
|
|
812
|
+
] }),
|
|
813
|
+
c === "agent" && /* @__PURE__ */ e(le, { hubUrl: a })
|
|
814
|
+
] })
|
|
815
|
+
] }),
|
|
816
|
+
u && /* @__PURE__ */ e(K, { onLogout: u })
|
|
802
817
|
] });
|
|
803
818
|
}
|
|
804
|
-
function
|
|
805
|
-
const
|
|
819
|
+
function me({ hubUrl: t, onLogout: a }) {
|
|
820
|
+
const h = L(), [r, i] = s({ status: "loading" }), [p, u] = s(null), [c, d] = s(0), m = G(async () => {
|
|
806
821
|
try {
|
|
807
|
-
const
|
|
808
|
-
|
|
809
|
-
(
|
|
810
|
-
var
|
|
811
|
-
return
|
|
822
|
+
const b = await h.listWorkspaces();
|
|
823
|
+
i({ status: "ready", workspaces: b.workspaces }), u(
|
|
824
|
+
(C) => {
|
|
825
|
+
var o;
|
|
826
|
+
return C && b.workspaces.some((k) => k.id === C) ? C : ((o = b.workspaces[0]) == null ? void 0 : o.id) ?? null;
|
|
812
827
|
}
|
|
813
828
|
);
|
|
814
|
-
} catch (
|
|
815
|
-
|
|
829
|
+
} catch (b) {
|
|
830
|
+
i({ status: "error", message: x(b) });
|
|
816
831
|
}
|
|
817
|
-
}, [
|
|
832
|
+
}, [h]);
|
|
818
833
|
T(() => {
|
|
819
|
-
|
|
820
|
-
}, [
|
|
821
|
-
const
|
|
822
|
-
if (
|
|
834
|
+
m();
|
|
835
|
+
}, [m]);
|
|
836
|
+
const y = r.status === "ready" ? r.workspaces : [], l = y.find((b) => b.id === p) ?? null;
|
|
837
|
+
if (r.status === "loading")
|
|
823
838
|
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
|
|
827
|
-
|
|
839
|
+
if (r.status === "error")
|
|
840
|
+
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "alert", children: r.message }) });
|
|
841
|
+
const N = y.length > 0, g = /* @__PURE__ */ e(
|
|
842
|
+
q,
|
|
828
843
|
{
|
|
829
|
-
workspaces:
|
|
830
|
-
selected:
|
|
831
|
-
onSelect:
|
|
844
|
+
workspaces: y,
|
|
845
|
+
selected: l,
|
|
846
|
+
onSelect: u,
|
|
832
847
|
onChanged: () => {
|
|
833
|
-
|
|
848
|
+
m();
|
|
834
849
|
},
|
|
835
|
-
onMembersChanged: () =>
|
|
850
|
+
onMembersChanged: () => d((b) => b + 1)
|
|
836
851
|
}
|
|
837
|
-
),
|
|
852
|
+
), _ = /* @__PURE__ */ n("section", { className: "shepherd-config", "aria-labelledby": "config-heading", children: [
|
|
838
853
|
/* @__PURE__ */ e("h2", { id: "config-heading", children: "Configuration" }),
|
|
839
|
-
|
|
840
|
-
|
|
854
|
+
l ? /* @__PURE__ */ e(
|
|
855
|
+
ce,
|
|
841
856
|
{
|
|
842
|
-
workspace:
|
|
857
|
+
workspace: l,
|
|
843
858
|
hubUrl: t,
|
|
844
859
|
membersRefreshKey: c,
|
|
845
|
-
onMembersChanged: () =>
|
|
846
|
-
onLeft: () => void
|
|
847
|
-
onDeleted: () => void
|
|
860
|
+
onMembersChanged: () => d((b) => b + 1),
|
|
861
|
+
onLeft: () => void m(),
|
|
862
|
+
onDeleted: () => void m(),
|
|
863
|
+
onLogout: a
|
|
848
864
|
}
|
|
849
|
-
) : /* @__PURE__ */ n(
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
865
|
+
) : /* @__PURE__ */ n($, { children: [
|
|
866
|
+
/* @__PURE__ */ n("p", { className: "config-none", children: [
|
|
867
|
+
"You're not in a workspace yet. Use the ",
|
|
868
|
+
/* @__PURE__ */ e("b", { children: "Get started ▾" }),
|
|
869
|
+
" menu at the top to create one or join with an invite code."
|
|
870
|
+
] }),
|
|
871
|
+
a && /* @__PURE__ */ e(K, { onLogout: a })
|
|
853
872
|
] })
|
|
854
873
|
] });
|
|
855
874
|
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e(
|
|
856
|
-
|
|
875
|
+
V,
|
|
857
876
|
{
|
|
858
|
-
workspaceId:
|
|
859
|
-
config:
|
|
860
|
-
switcher:
|
|
861
|
-
hasWorkspace:
|
|
877
|
+
workspaceId: l == null ? void 0 : l.id,
|
|
878
|
+
config: _,
|
|
879
|
+
switcher: g,
|
|
880
|
+
hasWorkspace: N
|
|
862
881
|
}
|
|
863
882
|
) });
|
|
864
883
|
}
|
|
865
|
-
function
|
|
866
|
-
const
|
|
867
|
-
|
|
868
|
-
const
|
|
869
|
-
|
|
884
|
+
function pe({ code: t, onJoined: a }) {
|
|
885
|
+
const h = L(), r = j(), [i, p] = s({ status: "joining" }), u = B(a);
|
|
886
|
+
u.current = a;
|
|
887
|
+
const c = G(async () => {
|
|
888
|
+
p({ status: "joining" });
|
|
870
889
|
try {
|
|
871
|
-
const
|
|
872
|
-
|
|
873
|
-
} catch (
|
|
874
|
-
|
|
890
|
+
const m = await h.redeemInvite(t);
|
|
891
|
+
p({ status: "joined", workspace: m.workspace }), u.current(m.workspace);
|
|
892
|
+
} catch (m) {
|
|
893
|
+
p({ status: "error", message: x(m) });
|
|
875
894
|
}
|
|
876
|
-
}, [
|
|
895
|
+
}, [h, t]), d = B(!1);
|
|
877
896
|
return T(() => {
|
|
878
|
-
|
|
879
|
-
}, [
|
|
897
|
+
d.current || (d.current = !0, c());
|
|
898
|
+
}, [c]), /* @__PURE__ */ e("section", { className: "shepherd-join", "aria-labelledby": r, children: /* @__PURE__ */ n("div", { className: "shepherd-join__card", children: [
|
|
880
899
|
/* @__PURE__ */ e("p", { className: "shepherd-join__brand", children: "Shepherd" }),
|
|
881
|
-
i.status === "joining" && /* @__PURE__ */ n(
|
|
882
|
-
/* @__PURE__ */ e("h1", { id:
|
|
900
|
+
i.status === "joining" && /* @__PURE__ */ n($, { children: [
|
|
901
|
+
/* @__PURE__ */ e("h1", { id: r, children: "Joining workspace…" }),
|
|
883
902
|
/* @__PURE__ */ e("p", { className: "shepherd-join__copy", role: "status", children: "Hold on while we add you to the team." }),
|
|
884
903
|
/* @__PURE__ */ e("div", { className: "shepherd-join__spinner", "aria-hidden": "true" })
|
|
885
904
|
] }),
|
|
886
|
-
i.status === "joined" && /* @__PURE__ */ n(
|
|
887
|
-
/* @__PURE__ */ e("h1", { id:
|
|
905
|
+
i.status === "joined" && /* @__PURE__ */ n($, { children: [
|
|
906
|
+
/* @__PURE__ */ e("h1", { id: r, children: "You’re in" }),
|
|
888
907
|
/* @__PURE__ */ n("p", { className: "shepherd-join__copy", role: "status", children: [
|
|
889
908
|
"Joined ",
|
|
890
909
|
/* @__PURE__ */ e("strong", { children: i.workspace.name }),
|
|
891
910
|
". Taking you to the board…"
|
|
892
911
|
] })
|
|
893
912
|
] }),
|
|
894
|
-
i.status === "error" && /* @__PURE__ */ n(
|
|
895
|
-
/* @__PURE__ */ e("h1", { id:
|
|
913
|
+
i.status === "error" && /* @__PURE__ */ n($, { children: [
|
|
914
|
+
/* @__PURE__ */ e("h1", { id: r, children: "Couldn’t join the workspace" }),
|
|
896
915
|
/* @__PURE__ */ e("p", { className: "shepherd-join__error", role: "alert", children: i.message }),
|
|
897
916
|
/* @__PURE__ */ e(
|
|
898
917
|
"button",
|
|
899
918
|
{
|
|
900
919
|
type: "button",
|
|
901
920
|
className: "shepherd-join__retry",
|
|
902
|
-
onClick: () => void
|
|
921
|
+
onClick: () => void c(),
|
|
903
922
|
children: "Try again"
|
|
904
923
|
}
|
|
905
924
|
)
|
|
@@ -907,19 +926,19 @@ function me({ code: t, onJoined: a }) {
|
|
|
907
926
|
] }) });
|
|
908
927
|
}
|
|
909
928
|
export {
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
929
|
+
ce as ConfigPanel,
|
|
930
|
+
le as ConnectAgent,
|
|
931
|
+
V as Dashboard,
|
|
932
|
+
ye as EmptyState,
|
|
933
|
+
z as GeneralSettings,
|
|
934
|
+
Z as Invites,
|
|
935
|
+
pe as JoinWorkspace,
|
|
936
|
+
Q as Members,
|
|
937
|
+
M as ShepherdClientError,
|
|
938
|
+
be as ShepherdClientProvider,
|
|
939
|
+
me as ShepherdRoot,
|
|
940
|
+
q as WorkspaceSwitcher,
|
|
941
|
+
ke as createShepherdClient,
|
|
923
942
|
x as describeError,
|
|
924
|
-
|
|
943
|
+
L as useShepherdClient
|
|
925
944
|
};
|