@korso/shepherd-ui 0.2.0 → 0.2.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 +47 -47
- package/dist/ShepherdRoot.js +15 -57
- package/dist/components/Dashboard.d.ts +16 -2
- package/dist/components/Dashboard.js +76 -5
- package/dist/config/EmptyState.js +5 -1
- package/dist/lib/{Dashboard-CG6KeFQ3.js → Dashboard-B7nioe5N.js} +529 -457
- package/dist/lib/index.d.ts +15 -1
- package/dist/lib/index.js +196 -279
- package/dist/lib/selfhost.js +1 -1
- package/dist/lib/styles.css +217 -209
- package/dist/selfhost/assets/index-D6rTsbVM.js +40 -0
- package/dist/selfhost/assets/{index-BZmImfYZ.css → index-DnhlP_lc.css} +1 -1
- package/dist/selfhost/index.html +13 -13
- package/dist/useLandscapePolling.d.ts +7 -0
- package/dist/useLandscapePolling.js +6 -1
- package/package.json +67 -67
- package/dist/ShepherdProvider.d.ts +0 -12
- package/dist/ShepherdProvider.js +0 -33
- package/dist/ShepherdProvider.test.d.ts +0 -1
- package/dist/ShepherdProvider.test.js +0 -47
- package/dist/ShepherdRoot.routing.test.d.ts +0 -1
- package/dist/ShepherdRoot.routing.test.js +0 -61
- package/dist/ShepherdRoot.test.d.ts +0 -1
- package/dist/ShepherdRoot.test.js +0 -37
- package/dist/app/assets/index-CDOCIg6s.js +0 -11
- package/dist/app/index.html +0 -12
- package/dist/client.test.d.ts +0 -1
- package/dist/client.test.js +0 -298
- package/dist/config/ConnectAgent.test.d.ts +0 -1
- package/dist/config/ConnectAgent.test.js +0 -92
- package/dist/config/EmptyState.test.d.ts +0 -1
- package/dist/config/EmptyState.test.js +0 -32
- package/dist/config/Members.test.d.ts +0 -1
- package/dist/config/Members.test.js +0 -66
- package/dist/config/Workspaces.test.d.ts +0 -1
- package/dist/config/Workspaces.test.js +0 -90
- package/dist/index.cjs +0 -5289
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -149
- package/dist/index.js.map +0 -1
- package/dist/selfhost/assets/index-CS268KSw.js +0 -40
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/setup.js +0 -2
- package/dist/views/Chat.d.ts +0 -5
- package/dist/views/Chat.js +0 -60
- package/dist/views/Chat.test.d.ts +0 -1
- package/dist/views/Chat.test.js +0 -92
- package/dist/views/Config.d.ts +0 -12
- package/dist/views/Config.js +0 -6
- package/dist/views/Tasks.d.ts +0 -5
- package/dist/views/Tasks.js +0 -75
- package/dist/views/Tasks.test.d.ts +0 -1
- package/dist/views/Tasks.test.js +0 -115
- package/dist/views/useLandscape.d.ts +0 -14
- package/dist/views/useLandscape.js +0 -74
- package/dist/views/useLandscape.test.d.ts +0 -1
- package/dist/views/useLandscape.test.js +0 -101
- package/dist/views/wallboard.d.ts +0 -46
- package/dist/views/wallboard.js +0 -209
- package/dist/views/wallboard.test.d.ts +0 -1
- package/dist/views/wallboard.test.js +0 -143
package/dist/lib/index.js
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { S as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useId as
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
async function
|
|
8
|
-
|
|
1
|
+
import { u as O, d as N, D as $ } from "./Dashboard-B7nioe5N.js";
|
|
2
|
+
import { E as Y, S as Z, a as ee, c as ne } from "./Dashboard-B7nioe5N.js";
|
|
3
|
+
import { jsxs as y, jsx as e } from "react/jsx-runtime";
|
|
4
|
+
import { useId as U, useState as a, useEffect as H, useCallback as F } from "react";
|
|
5
|
+
function K({ workspaceId: c, refreshKey: t = 0, canRemove: i = !1, onLeft: k }) {
|
|
6
|
+
const m = O(), C = U(), [g, b] = a([]), [u, p] = a(null), [h, o] = a(null), [w, d] = a(!0), [s, v] = a(null), [R, S] = a(!1);
|
|
7
|
+
async function I({ keepError: l = !1 } = {}) {
|
|
8
|
+
l || p(null);
|
|
9
9
|
try {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
} catch (
|
|
13
|
-
|
|
10
|
+
const f = await m.listMembers(c);
|
|
11
|
+
b(f.members);
|
|
12
|
+
} catch (f) {
|
|
13
|
+
p(N(f));
|
|
14
14
|
} finally {
|
|
15
15
|
d(!1);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
H(() => {
|
|
19
|
-
d(!0),
|
|
20
|
-
}, [
|
|
21
|
-
async function
|
|
22
|
-
if (!
|
|
23
|
-
|
|
19
|
+
d(!0), I();
|
|
20
|
+
}, [m, c, t]);
|
|
21
|
+
async function L(l, f) {
|
|
22
|
+
if (!s) {
|
|
23
|
+
v(l), p(null), o(null), b((E) => E.filter((r) => r.accountId !== l));
|
|
24
24
|
try {
|
|
25
|
-
await
|
|
26
|
-
} catch (
|
|
27
|
-
|
|
25
|
+
await m.removeMember(c, l), o(`Removed ${f}`);
|
|
26
|
+
} catch (E) {
|
|
27
|
+
p(N(E)), I({ keepError: !0 });
|
|
28
28
|
} finally {
|
|
29
|
-
|
|
29
|
+
v(null);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
async function x() {
|
|
34
|
-
if (!
|
|
35
|
-
|
|
34
|
+
if (!R) {
|
|
35
|
+
S(!0), p(null), o(null);
|
|
36
36
|
try {
|
|
37
|
-
await
|
|
38
|
-
} catch (
|
|
39
|
-
|
|
37
|
+
await m.leave(c), o("Left workspace"), k == null || k();
|
|
38
|
+
} catch (l) {
|
|
39
|
+
p(N(l));
|
|
40
40
|
} finally {
|
|
41
|
-
|
|
41
|
+
S(!1);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */ e("h3", { id:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */ e("span", { children:
|
|
53
|
-
/* @__PURE__ */ e("span", { className: "role", children:
|
|
54
|
-
|
|
45
|
+
return /* @__PURE__ */ y("section", { className: "shepherd-members", "aria-labelledby": C, children: [
|
|
46
|
+
/* @__PURE__ */ e("h3", { id: C, children: "Members" }),
|
|
47
|
+
u && /* @__PURE__ */ e("p", { role: "alert", children: u }),
|
|
48
|
+
h && /* @__PURE__ */ e("p", { role: "status", children: h }),
|
|
49
|
+
w ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) : g.length === 0 ? /* @__PURE__ */ e("p", { children: "No members." }) : /* @__PURE__ */ e("ul", { children: g.map((l) => {
|
|
50
|
+
const f = l.displayName ?? l.githubLogin ?? l.accountId;
|
|
51
|
+
return /* @__PURE__ */ y("li", { children: [
|
|
52
|
+
/* @__PURE__ */ e("span", { children: f }),
|
|
53
|
+
/* @__PURE__ */ e("span", { className: "role", children: l.role }),
|
|
54
|
+
i && /* @__PURE__ */ e(
|
|
55
55
|
"button",
|
|
56
56
|
{
|
|
57
57
|
type: "button",
|
|
58
|
-
"aria-label": `Remove ${
|
|
59
|
-
onClick: () => void
|
|
60
|
-
disabled:
|
|
58
|
+
"aria-label": `Remove ${f}`,
|
|
59
|
+
onClick: () => void L(l.accountId, f),
|
|
60
|
+
disabled: s === l.accountId,
|
|
61
61
|
children: "Remove"
|
|
62
62
|
}
|
|
63
63
|
)
|
|
64
|
-
] },
|
|
64
|
+
] }, l.accountId);
|
|
65
65
|
}) }),
|
|
66
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => void x(), disabled:
|
|
66
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => void x(), disabled: R, children: "Leave workspace" })
|
|
67
67
|
] });
|
|
68
68
|
}
|
|
69
|
-
function M({ workspaces: c, selected: t, onChanged:
|
|
70
|
-
const
|
|
71
|
-
async function
|
|
72
|
-
if (!(!
|
|
73
|
-
|
|
69
|
+
function M({ workspaces: c, selected: t, onChanged: i, onSelect: k }) {
|
|
70
|
+
const m = O(), C = U(), [g, b] = a(""), [u, p] = a(""), [h, o] = a(null), [w, d] = a(null), [s, v] = a(!1), [R, S] = a(0), I = (t == null ? void 0 : t.role) === "admin";
|
|
71
|
+
async function L() {
|
|
72
|
+
if (!(!g.trim() || s)) {
|
|
73
|
+
v(!0), d(null);
|
|
74
74
|
try {
|
|
75
|
-
await
|
|
75
|
+
await m.createWorkspace({ name: g.trim() }), b(""), i();
|
|
76
76
|
} catch (r) {
|
|
77
|
-
d(
|
|
77
|
+
d(N(r));
|
|
78
78
|
} finally {
|
|
79
|
-
|
|
79
|
+
v(!1);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
async function x() {
|
|
84
|
-
if (!(!
|
|
85
|
-
|
|
84
|
+
if (!(!u.trim() || s)) {
|
|
85
|
+
v(!0), d(null);
|
|
86
86
|
try {
|
|
87
|
-
await
|
|
87
|
+
await m.redeemInvite(u.trim()), p(""), i(), S((r) => r + 1);
|
|
88
88
|
} catch (r) {
|
|
89
|
-
d(
|
|
89
|
+
d(N(r));
|
|
90
90
|
} finally {
|
|
91
|
-
|
|
91
|
+
v(!1);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
async function
|
|
96
|
-
if (!(!t ||
|
|
97
|
-
|
|
95
|
+
async function l() {
|
|
96
|
+
if (!(!t || s)) {
|
|
97
|
+
v(!0), d(null);
|
|
98
98
|
try {
|
|
99
|
-
const r = await
|
|
100
|
-
|
|
99
|
+
const r = await m.createInvite(t.id, {});
|
|
100
|
+
o(r), S((j) => j + 1);
|
|
101
101
|
} catch (r) {
|
|
102
|
-
d(
|
|
102
|
+
d(N(r));
|
|
103
103
|
} finally {
|
|
104
|
-
|
|
104
|
+
v(!1);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
async function
|
|
109
|
-
if (!(!t || !
|
|
110
|
-
|
|
108
|
+
async function f() {
|
|
109
|
+
if (!(!t || !h || s)) {
|
|
110
|
+
v(!0), d(null);
|
|
111
111
|
try {
|
|
112
|
-
await
|
|
112
|
+
await m.revokeInvite(t.id, h.code), o(null);
|
|
113
113
|
} catch (r) {
|
|
114
|
-
d(
|
|
114
|
+
d(N(r));
|
|
115
115
|
} finally {
|
|
116
|
-
|
|
116
|
+
v(!1);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
H(() => {
|
|
121
|
-
|
|
121
|
+
o(null);
|
|
122
122
|
}, [t == null ? void 0 : t.id]);
|
|
123
|
-
const
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */ e("h3", { id:
|
|
126
|
-
|
|
127
|
-
c.length > 1 && k && /* @__PURE__ */
|
|
123
|
+
const E = h ? `${window.location.origin}/join/${encodeURIComponent(h.code)}` : null;
|
|
124
|
+
return /* @__PURE__ */ y("section", { className: "shepherd-workspaces", "aria-labelledby": C, children: [
|
|
125
|
+
/* @__PURE__ */ e("h3", { id: C, children: "Workspace management" }),
|
|
126
|
+
w && /* @__PURE__ */ e("p", { role: "alert", children: w }),
|
|
127
|
+
c.length > 1 && k && /* @__PURE__ */ y("div", { className: "switcher", children: [
|
|
128
128
|
/* @__PURE__ */ e("label", { htmlFor: "ws-switcher", children: "Active workspace" }),
|
|
129
129
|
/* @__PURE__ */ e(
|
|
130
130
|
"select",
|
|
@@ -136,53 +136,53 @@ function M({ workspaces: c, selected: t, onChanged: l, onSelect: k }) {
|
|
|
136
136
|
}
|
|
137
137
|
)
|
|
138
138
|
] }),
|
|
139
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ y("div", { className: "create", children: [
|
|
140
140
|
/* @__PURE__ */ e("label", { htmlFor: "ws-name", children: "Workspace name" }),
|
|
141
141
|
/* @__PURE__ */ e(
|
|
142
142
|
"input",
|
|
143
143
|
{
|
|
144
144
|
id: "ws-name",
|
|
145
145
|
type: "text",
|
|
146
|
-
value:
|
|
147
|
-
onChange: (r) =>
|
|
146
|
+
value: g,
|
|
147
|
+
onChange: (r) => b(r.target.value)
|
|
148
148
|
}
|
|
149
149
|
),
|
|
150
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => void
|
|
150
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => void L(), disabled: s, children: "Create workspace" })
|
|
151
151
|
] }),
|
|
152
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ y("div", { className: "join", children: [
|
|
153
153
|
/* @__PURE__ */ e("label", { htmlFor: "invite-code", children: "Invite code" }),
|
|
154
154
|
/* @__PURE__ */ e(
|
|
155
155
|
"input",
|
|
156
156
|
{
|
|
157
157
|
id: "invite-code",
|
|
158
158
|
type: "text",
|
|
159
|
-
value:
|
|
160
|
-
onChange: (r) =>
|
|
159
|
+
value: u,
|
|
160
|
+
onChange: (r) => p(r.target.value)
|
|
161
161
|
}
|
|
162
162
|
),
|
|
163
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => void x(), disabled:
|
|
163
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => void x(), disabled: s, children: "Join" })
|
|
164
164
|
] }),
|
|
165
|
-
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => void
|
|
168
|
-
|
|
169
|
-
/* @__PURE__ */ e("code", { children:
|
|
170
|
-
/* @__PURE__ */ e("a", { href:
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
|
|
165
|
+
I && t && /* @__PURE__ */ y("div", { className: "admin", children: [
|
|
166
|
+
/* @__PURE__ */ y("div", { className: "invites", children: [
|
|
167
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => void l(), disabled: s, children: "Create invite" }),
|
|
168
|
+
h && /* @__PURE__ */ y("div", { className: "invite-result", children: [
|
|
169
|
+
/* @__PURE__ */ e("code", { children: h.code }),
|
|
170
|
+
/* @__PURE__ */ e("a", { href: E ?? void 0, children: E }),
|
|
171
|
+
/* @__PURE__ */ y("span", { className: "invite-uses", children: [
|
|
172
|
+
h.useCount,
|
|
173
173
|
" / ",
|
|
174
|
-
|
|
174
|
+
h.maxUses,
|
|
175
175
|
" uses"
|
|
176
176
|
] }),
|
|
177
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => void
|
|
177
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => void f(), disabled: s, children: "Revoke invite" })
|
|
178
178
|
] })
|
|
179
179
|
] }),
|
|
180
180
|
/* @__PURE__ */ e(
|
|
181
|
-
|
|
181
|
+
K,
|
|
182
182
|
{
|
|
183
183
|
workspaceId: t.id,
|
|
184
|
-
refreshKey:
|
|
185
|
-
onLeft:
|
|
184
|
+
refreshKey: R,
|
|
185
|
+
onLeft: i,
|
|
186
186
|
canRemove: !0
|
|
187
187
|
}
|
|
188
188
|
)
|
|
@@ -194,264 +194,181 @@ const P = [
|
|
|
194
194
|
{ id: "codex", label: "Codex" },
|
|
195
195
|
{ id: "pi", label: "Pi" },
|
|
196
196
|
{ id: "generic", label: "Generic (JSON)" }
|
|
197
|
-
],
|
|
197
|
+
], A = "shp_<paste-after-generating>", D = {
|
|
198
198
|
claude: "claude mcp add shepherd -s user \\",
|
|
199
199
|
codex: "codex mcp add shepherd \\",
|
|
200
200
|
pi: "pi mcp add shepherd \\"
|
|
201
201
|
};
|
|
202
|
-
function
|
|
202
|
+
function B(c, t, i) {
|
|
203
203
|
return c === "generic" ? JSON.stringify(
|
|
204
204
|
{
|
|
205
205
|
mcpServers: {
|
|
206
206
|
shepherd: {
|
|
207
207
|
command: "npx",
|
|
208
208
|
args: ["-y", "@korso/shepherd"],
|
|
209
|
-
env: { HUB_URL: t, SHEPHERD_TOKEN:
|
|
209
|
+
env: { HUB_URL: t, SHEPHERD_TOKEN: i }
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
213
|
null,
|
|
214
214
|
2
|
|
215
215
|
) : [
|
|
216
|
-
|
|
216
|
+
D[c],
|
|
217
217
|
` -e HUB_URL=${t} \\`,
|
|
218
|
-
` -e SHEPHERD_TOKEN=${
|
|
218
|
+
` -e SHEPHERD_TOKEN=${i} \\`,
|
|
219
219
|
" -- npx -y @korso/shepherd"
|
|
220
220
|
].join(`
|
|
221
221
|
`);
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
const
|
|
225
|
-
async function
|
|
223
|
+
function J({ workspaceId: c, hubUrl: t }) {
|
|
224
|
+
const i = O(), k = t ?? i.baseUrl, m = U(), [C, g] = a("claude"), [b, u] = a(""), [p, h] = a(null), [o, w] = a([]), [d, s] = a(null), [v, R] = a(null), [S, I] = a(!1), [L, x] = a(!0), [l, f] = a(null);
|
|
225
|
+
async function E() {
|
|
226
226
|
try {
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
} catch (
|
|
230
|
-
|
|
227
|
+
const n = await i.listTokens(c);
|
|
228
|
+
w(n.tokens);
|
|
229
|
+
} catch (n) {
|
|
230
|
+
s(N(n));
|
|
231
231
|
} finally {
|
|
232
232
|
x(!1);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
H(() => {
|
|
236
|
-
x(!0),
|
|
237
|
-
}, [
|
|
238
|
-
|
|
236
|
+
x(!0), E();
|
|
237
|
+
}, [i, c]), H(() => {
|
|
238
|
+
h(null);
|
|
239
239
|
}, [c]);
|
|
240
240
|
async function r() {
|
|
241
|
-
|
|
241
|
+
I(!0), s(null);
|
|
242
242
|
try {
|
|
243
|
-
const
|
|
243
|
+
const n = await i.mintToken(
|
|
244
244
|
c,
|
|
245
|
-
|
|
245
|
+
b.trim() ? { name: b.trim() } : {}
|
|
246
246
|
);
|
|
247
|
-
|
|
248
|
-
} catch (
|
|
249
|
-
|
|
247
|
+
h(n.token), u(""), await E();
|
|
248
|
+
} catch (n) {
|
|
249
|
+
s(N(n));
|
|
250
250
|
} finally {
|
|
251
|
-
|
|
251
|
+
I(!1);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
async function j(
|
|
255
|
-
if (!
|
|
256
|
-
|
|
254
|
+
async function j(n) {
|
|
255
|
+
if (!l) {
|
|
256
|
+
f(n), s(null), R(null);
|
|
257
257
|
try {
|
|
258
|
-
await
|
|
259
|
-
} catch (
|
|
260
|
-
|
|
258
|
+
await i.revokeToken(c, n), w((T) => T.filter((_) => _.id !== n)), R("Token revoked");
|
|
259
|
+
} catch (T) {
|
|
260
|
+
s(N(T));
|
|
261
261
|
} finally {
|
|
262
|
-
|
|
262
|
+
f(null);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
const W =
|
|
267
|
-
return /* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */ e("h3", { id:
|
|
266
|
+
const W = B(C, k, p ?? A);
|
|
267
|
+
return /* @__PURE__ */ y("section", { className: "shepherd-connect-agent", "aria-labelledby": m, children: [
|
|
268
|
+
/* @__PURE__ */ e("h3", { id: m, children: "Connect your agent" }),
|
|
269
269
|
/* @__PURE__ */ e("label", { htmlFor: "connect-tool", children: "Tool" }),
|
|
270
270
|
/* @__PURE__ */ e(
|
|
271
271
|
"select",
|
|
272
272
|
{
|
|
273
273
|
id: "connect-tool",
|
|
274
|
-
value:
|
|
275
|
-
onChange: (
|
|
276
|
-
children: P.map((
|
|
274
|
+
value: C,
|
|
275
|
+
onChange: (n) => g(n.target.value),
|
|
276
|
+
children: P.map((n) => /* @__PURE__ */ e("option", { value: n.id, children: n.label }, n.id))
|
|
277
277
|
}
|
|
278
278
|
),
|
|
279
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ y("div", { className: "generate", children: [
|
|
280
280
|
/* @__PURE__ */ e("label", { htmlFor: "token-name", children: "Token name (optional)" }),
|
|
281
281
|
/* @__PURE__ */ e(
|
|
282
282
|
"input",
|
|
283
283
|
{
|
|
284
284
|
id: "token-name",
|
|
285
285
|
type: "text",
|
|
286
|
-
value:
|
|
287
|
-
onChange: (
|
|
286
|
+
value: b,
|
|
287
|
+
onChange: (n) => u(n.target.value),
|
|
288
288
|
placeholder: "e.g. laptop"
|
|
289
289
|
}
|
|
290
290
|
),
|
|
291
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => void r(), disabled:
|
|
291
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => void r(), disabled: S, children: "Generate token" })
|
|
292
292
|
] }),
|
|
293
293
|
d && /* @__PURE__ */ e("p", { role: "alert", children: d }),
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
v && /* @__PURE__ */ e("p", { role: "status", children: v }),
|
|
295
|
+
p && /* @__PURE__ */ e("p", { className: "token-once", role: "status", children: "Copy this token now — it won't be shown again." }),
|
|
296
296
|
/* @__PURE__ */ e("pre", { "data-testid": "install-command", children: W }),
|
|
297
297
|
/* @__PURE__ */ e("h4", { children: "Existing tokens" }),
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
return /* @__PURE__ */
|
|
301
|
-
/* @__PURE__ */ e("span", { children:
|
|
302
|
-
|
|
298
|
+
L ? /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) : o.length === 0 ? /* @__PURE__ */ e("p", { children: "No tokens yet." }) : /* @__PURE__ */ e("ul", { children: o.map((n) => {
|
|
299
|
+
const T = n.name ?? n.id;
|
|
300
|
+
return /* @__PURE__ */ y("li", { children: [
|
|
301
|
+
/* @__PURE__ */ e("span", { children: T }),
|
|
302
|
+
n.revokedAt ? /* @__PURE__ */ e("span", { className: "revoked", children: "revoked" }) : /* @__PURE__ */ e(
|
|
303
303
|
"button",
|
|
304
304
|
{
|
|
305
305
|
type: "button",
|
|
306
|
-
"aria-label": `Revoke token ${
|
|
307
|
-
onClick: () => void j(
|
|
308
|
-
disabled:
|
|
306
|
+
"aria-label": `Revoke token ${T}`,
|
|
307
|
+
onClick: () => void j(n.id),
|
|
308
|
+
disabled: l === n.id,
|
|
309
309
|
children: "Revoke"
|
|
310
310
|
}
|
|
311
311
|
)
|
|
312
|
-
] },
|
|
312
|
+
] }, n.id);
|
|
313
313
|
}) })
|
|
314
314
|
] });
|
|
315
315
|
}
|
|
316
|
-
function
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
{ id: "config", label: "Config" }
|
|
331
|
-
];
|
|
332
|
-
function Y({ hubUrl: c }) {
|
|
333
|
-
const t = $(), [l, k] = i({ status: "loading" }), [f, R] = i(null), [w, v] = i("board"), N = _([]), y = D(
|
|
334
|
-
(n, o) => {
|
|
335
|
-
var S;
|
|
336
|
-
const m = K.length - 1;
|
|
337
|
-
let s = null;
|
|
338
|
-
switch (n.key) {
|
|
339
|
-
case "ArrowRight":
|
|
340
|
-
s = o === m ? 0 : o + 1;
|
|
341
|
-
break;
|
|
342
|
-
case "ArrowLeft":
|
|
343
|
-
s = o === 0 ? m : o - 1;
|
|
344
|
-
break;
|
|
345
|
-
case "Home":
|
|
346
|
-
s = 0;
|
|
347
|
-
break;
|
|
348
|
-
case "End":
|
|
349
|
-
s = m;
|
|
350
|
-
break;
|
|
351
|
-
default:
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
n.preventDefault(), v(K[s].id), (S = N.current[s]) == null || S.focus();
|
|
355
|
-
},
|
|
356
|
-
[]
|
|
357
|
-
), p = D(
|
|
358
|
-
async (n) => {
|
|
359
|
-
try {
|
|
360
|
-
const o = await t.listWorkspaces();
|
|
361
|
-
k({ status: "ready", workspaces: o.workspaces }), R(
|
|
362
|
-
(m) => {
|
|
363
|
-
var s;
|
|
364
|
-
return m && o.workspaces.some((S) => S.id === m) ? m : ((s = o.workspaces[0]) == null ? void 0 : s.id) ?? null;
|
|
365
|
-
}
|
|
366
|
-
), n && v(o.workspaces.length === 0 ? "config" : "board");
|
|
367
|
-
} catch (o) {
|
|
368
|
-
k({
|
|
369
|
-
status: "error",
|
|
370
|
-
message: I(o)
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
},
|
|
374
|
-
[t]
|
|
375
|
-
);
|
|
316
|
+
function z({ hubUrl: c }) {
|
|
317
|
+
const t = O(), [i, k] = a({ status: "loading" }), [m, C] = a(null), g = F(async () => {
|
|
318
|
+
try {
|
|
319
|
+
const o = await t.listWorkspaces();
|
|
320
|
+
k({ status: "ready", workspaces: o.workspaces }), C(
|
|
321
|
+
(w) => {
|
|
322
|
+
var d;
|
|
323
|
+
return w && o.workspaces.some((s) => s.id === w) ? w : ((d = o.workspaces[0]) == null ? void 0 : d.id) ?? null;
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
} catch (o) {
|
|
327
|
+
k({ status: "error", message: N(o) });
|
|
328
|
+
}
|
|
329
|
+
}, [t]);
|
|
376
330
|
H(() => {
|
|
377
|
-
|
|
378
|
-
}, []);
|
|
379
|
-
const
|
|
380
|
-
if (
|
|
331
|
+
g();
|
|
332
|
+
}, [g]);
|
|
333
|
+
const b = i.status === "ready" ? i.workspaces : [], u = b.find((o) => o.id === m) ?? null;
|
|
334
|
+
if (i.status === "loading")
|
|
381
335
|
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "status", children: "Loading…" }) });
|
|
382
|
-
if (
|
|
383
|
-
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "alert", children:
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
},
|
|
394
|
-
type: "button",
|
|
395
|
-
role: "tab",
|
|
396
|
-
id: `tab-${n}`,
|
|
397
|
-
"aria-controls": `panel-${n}`,
|
|
398
|
-
"aria-selected": w === n,
|
|
399
|
-
tabIndex: w === n ? 0 : -1,
|
|
400
|
-
onClick: () => v(n),
|
|
401
|
-
onKeyDown: (s) => y(s, m),
|
|
402
|
-
children: o
|
|
336
|
+
if (i.status === "error")
|
|
337
|
+
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e("p", { role: "alert", children: i.message }) });
|
|
338
|
+
const p = b.length > 0, h = /* @__PURE__ */ y("section", { className: "shepherd-config", "aria-labelledby": "config-heading", children: [
|
|
339
|
+
/* @__PURE__ */ e("h2", { id: "config-heading", children: "Configuration" }),
|
|
340
|
+
/* @__PURE__ */ e(
|
|
341
|
+
M,
|
|
342
|
+
{
|
|
343
|
+
workspaces: b,
|
|
344
|
+
selected: u,
|
|
345
|
+
onChanged: () => {
|
|
346
|
+
g();
|
|
403
347
|
},
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
w === "board" && /* @__PURE__ */ e(
|
|
409
|
-
"div",
|
|
410
|
-
{
|
|
411
|
-
role: "tabpanel",
|
|
412
|
-
id: "panel-board",
|
|
413
|
-
"aria-labelledby": "tab-board",
|
|
414
|
-
tabIndex: 0,
|
|
415
|
-
children: u && d ? /* @__PURE__ */ e(U, { workspaceId: d.id }) : /* @__PURE__ */ e(X, { onGetStarted: () => v("config") })
|
|
416
|
-
}
|
|
417
|
-
),
|
|
418
|
-
w === "config" && /* @__PURE__ */ e(
|
|
419
|
-
"div",
|
|
420
|
-
{
|
|
421
|
-
role: "tabpanel",
|
|
422
|
-
id: "panel-config",
|
|
423
|
-
"aria-labelledby": "tab-config",
|
|
424
|
-
tabIndex: 0,
|
|
425
|
-
children: /* @__PURE__ */ b("section", { className: "shepherd-config", "aria-labelledby": "config-heading", children: [
|
|
426
|
-
/* @__PURE__ */ e("h2", { id: "config-heading", children: "Configuration" }),
|
|
427
|
-
/* @__PURE__ */ e(
|
|
428
|
-
M,
|
|
429
|
-
{
|
|
430
|
-
workspaces: E,
|
|
431
|
-
selected: d,
|
|
432
|
-
onChanged: () => {
|
|
433
|
-
C();
|
|
434
|
-
},
|
|
435
|
-
onSelect: R
|
|
436
|
-
}
|
|
437
|
-
),
|
|
438
|
-
d && /* @__PURE__ */ e(V, { workspaceId: d.id, hubUrl: c })
|
|
439
|
-
] })
|
|
440
|
-
}
|
|
441
|
-
)
|
|
442
|
-
] })
|
|
348
|
+
onSelect: C
|
|
349
|
+
}
|
|
350
|
+
),
|
|
351
|
+
u && /* @__PURE__ */ e(J, { workspaceId: u.id, hubUrl: c })
|
|
443
352
|
] });
|
|
353
|
+
return /* @__PURE__ */ e("div", { className: "shepherd-root", children: /* @__PURE__ */ e(
|
|
354
|
+
$,
|
|
355
|
+
{
|
|
356
|
+
workspaceId: u == null ? void 0 : u.id,
|
|
357
|
+
config: h,
|
|
358
|
+
hasWorkspace: p
|
|
359
|
+
}
|
|
360
|
+
) });
|
|
444
361
|
}
|
|
445
362
|
export {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
363
|
+
J as ConnectAgent,
|
|
364
|
+
$ as Dashboard,
|
|
365
|
+
Y as EmptyState,
|
|
366
|
+
K as Members,
|
|
367
|
+
Z as ShepherdClientError,
|
|
368
|
+
ee as ShepherdClientProvider,
|
|
369
|
+
z as ShepherdRoot,
|
|
453
370
|
M as Workspaces,
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
371
|
+
ne as createShepherdClient,
|
|
372
|
+
N as describeError,
|
|
373
|
+
O as useShepherdClient
|
|
457
374
|
};
|