@coffre/ui 0.2.0 → 0.4.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/chunks/audit-sentence-BhHmvQX_.js +660 -0
- package/dist/chunks/audit-sentence-BhHmvQX_.js.map +1 -0
- package/dist/chunks/delete-place-CRX7ntE8.js +206 -0
- package/dist/chunks/delete-place-CRX7ntE8.js.map +1 -0
- package/dist/chunks/{directory-CSjWWUQ1.js → directory-zr3ek7Mc.js} +175 -60
- package/dist/chunks/directory-zr3ek7Mc.js.map +1 -0
- package/dist/chunks/folders-DoBmCwOi.js +207 -0
- package/dist/chunks/folders-DoBmCwOi.js.map +1 -0
- package/dist/chunks/grants-Cw1FyGID.js +669 -0
- package/dist/chunks/grants-Cw1FyGID.js.map +1 -0
- package/dist/chunks/offboarding-CE6d7um1.js +305 -0
- package/dist/chunks/offboarding-CE6d7um1.js.map +1 -0
- package/dist/chunks/one-time-DXEl9hbg.js +35 -0
- package/dist/chunks/one-time-DXEl9hbg.js.map +1 -0
- package/dist/chunks/page-DvsgZ2Hd.js +391 -0
- package/dist/chunks/page-DvsgZ2Hd.js.map +1 -0
- package/dist/chunks/principal-BIN-xwZw.js +42 -0
- package/dist/chunks/principal-BIN-xwZw.js.map +1 -0
- package/dist/chunks/{principal-page-D_91OA0l.js → principal-page-DhjO76GH.js} +245 -251
- package/dist/chunks/principal-page-DhjO76GH.js.map +1 -0
- package/dist/chunks/project-page-SRCtRe2g.js +17 -0
- package/dist/chunks/project-page-SRCtRe2g.js.map +1 -0
- package/dist/chunks/{queries-CQ81o4so.js → queries-DVR_i3rA.js} +132 -30
- package/dist/chunks/queries-DVR_i3rA.js.map +1 -0
- package/dist/chunks/references-B6pLT1uQ.js +343 -0
- package/dist/chunks/references-B6pLT1uQ.js.map +1 -0
- package/dist/chunks/{row-state-0PsrEzOL.js → row-state-DOPUsjQK.js} +3 -3
- package/dist/chunks/{row-state-0PsrEzOL.js.map → row-state-DOPUsjQK.js.map} +1 -1
- package/dist/chunks/signin-errors--ykMFuqN.js +57 -0
- package/dist/chunks/signin-errors--ykMFuqN.js.map +1 -0
- package/dist/chunks/tabs-BmwKfUeK.js +22 -0
- package/dist/chunks/tabs-BmwKfUeK.js.map +1 -0
- package/dist/chunks/{theme-B2vQolVR.js → theme-DJuz-xLM.js} +3 -3
- package/dist/chunks/{theme-B2vQolVR.js.map → theme-DJuz-xLM.js.map} +1 -1
- package/dist/chunks/{ui-DixXLQvQ.js → ui-DJje3gST.js} +6 -3
- package/dist/chunks/ui-DJje3gST.js.map +1 -0
- package/dist/chunks/{use-change-c6CeLRin.js → use-change-DUiGO19U.js} +52 -21
- package/dist/chunks/use-change-DUiGO19U.js.map +1 -0
- package/dist/chunks/{use-shell-jxd7Tzd-.js → use-shell-rNKfGjdj.js} +3 -3
- package/dist/chunks/{use-shell-jxd7Tzd-.js.map → use-shell-rNKfGjdj.js.map} +1 -1
- package/dist/chunks/validation-D312_NLf.js +87 -0
- package/dist/chunks/validation-D312_NLf.js.map +1 -0
- package/dist/index.d.ts +361 -27
- package/dist/index.js +188 -98
- package/dist/index.js.map +1 -1
- package/dist/pages/account.d.ts +2 -2
- package/dist/pages/account.js +297 -135
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/approval.d.ts +9 -0
- package/dist/pages/approval.js +207 -0
- package/dist/pages/approval.js.map +1 -0
- package/dist/pages/audit.js +17 -542
- package/dist/pages/audit.js.map +1 -1
- package/dist/pages/device-login.js +2 -3
- package/dist/pages/device-login.js.map +1 -1
- package/dist/pages/environment.js +647 -257
- package/dist/pages/environment.js.map +1 -1
- package/dist/pages/login.js +18 -7
- package/dist/pages/login.js.map +1 -1
- package/dist/pages/oauth-authorize.d.ts +10 -0
- package/dist/pages/oauth-authorize.js +249 -0
- package/dist/pages/oauth-authorize.js.map +1 -0
- package/dist/pages/project-access.d.ts +6 -0
- package/dist/pages/project-access.js +370 -0
- package/dist/pages/project-access.js.map +1 -0
- package/dist/pages/project-environments.d.ts +4 -0
- package/dist/pages/project-environments.js +593 -0
- package/dist/pages/project-environments.js.map +1 -0
- package/dist/pages/project-settings.d.ts +4 -0
- package/dist/pages/project-settings.js +242 -0
- package/dist/pages/project-settings.js.map +1 -0
- package/dist/pages/project.d.ts +10 -2
- package/dist/pages/project.js +57 -934
- package/dist/pages/project.js.map +1 -1
- package/dist/pages/projects.js +53 -21
- package/dist/pages/projects.js.map +1 -1
- package/dist/pages/service-account.d.ts +10 -0
- package/dist/pages/{token.js → service-account.js} +115 -56
- package/dist/pages/service-account.js.map +1 -0
- package/dist/pages/service-accounts.d.ts +3 -0
- package/dist/pages/service-accounts.js +38 -0
- package/dist/pages/service-accounts.js.map +1 -0
- package/dist/pages/settings.d.ts +1 -0
- package/dist/pages/settings.js +104 -42
- package/dist/pages/settings.js.map +1 -1
- package/dist/pages/unregistered.js +2 -3
- package/dist/pages/unregistered.js.map +1 -1
- package/dist/pages/user.d.ts +6 -1
- package/dist/pages/user.js +18 -6
- package/dist/pages/user.js.map +1 -1
- package/dist/pages/users.js +6 -10
- package/dist/pages/users.js.map +1 -1
- package/package.json +3 -3
- package/src/components/actions-log.tsx +117 -0
- package/src/components/audit-sentence.tsx +55 -0
- package/src/components/command-palette.tsx +4 -4
- package/src/components/delete-place.tsx +180 -0
- package/src/components/directory.tsx +259 -110
- package/src/components/every-project.tsx +287 -0
- package/src/components/expiry-field.tsx +42 -0
- package/src/components/folders.tsx +219 -0
- package/src/components/grants.tsx +11 -4
- package/src/components/icons.tsx +2 -0
- package/src/components/missing.tsx +110 -0
- package/src/components/offboarding.tsx +61 -33
- package/src/components/page.tsx +4 -1
- package/src/components/principal-page.tsx +136 -106
- package/src/components/principal-picker.tsx +5 -5
- package/src/components/principal.tsx +4 -4
- package/src/components/references.tsx +323 -0
- package/src/components/service-tokens.tsx +115 -95
- package/src/components/shell.tsx +11 -32
- package/src/components/tabs.tsx +18 -0
- package/src/components/trusted-workloads.tsx +97 -79
- package/src/components/ui.tsx +8 -1
- package/src/index.ts +13 -2
- package/src/layout.tsx +2 -2
- package/src/lib/access-plan.ts +2 -2
- package/src/lib/audit-sentences.ts +161 -77
- package/src/lib/changes.ts +56 -5
- package/src/lib/coffre.ts +3 -2
- package/src/lib/one-time.ts +32 -0
- package/src/lib/project-access.ts +11 -23
- package/src/lib/project-page.ts +14 -0
- package/src/lib/queries.ts +126 -32
- package/src/lib/search.ts +25 -0
- package/src/lib/signin-errors.ts +45 -1
- package/src/lib/validation.ts +14 -0
- package/src/options.ts +187 -35
- package/src/pages/account.tsx +274 -129
- package/src/pages/approval.tsx +197 -0
- package/src/pages/audit.tsx +9 -61
- package/src/pages/environment.tsx +585 -286
- package/src/pages/login.tsx +8 -2
- package/src/pages/oauth-authorize.tsx +233 -0
- package/src/pages/project-access.tsx +219 -0
- package/src/pages/project-environments.tsx +582 -0
- package/src/pages/project-settings.tsx +259 -0
- package/src/pages/project.tsx +52 -879
- package/src/pages/projects.tsx +55 -18
- package/src/pages/service-account.tsx +50 -0
- package/src/pages/{tokens.tsx → service-accounts.tsx} +9 -6
- package/src/pages/settings.tsx +62 -8
- package/src/pages/user.tsx +16 -4
- package/src/pages/users.tsx +2 -2
- package/src/parity.ts +160 -0
- package/src/register.ts +58 -9
- package/src/router.tsx +4 -0
- package/src/shared/models.ts +6 -2
- package/src/styles/globals.css +536 -31
- package/dist/chunks/directory-CSjWWUQ1.js.map +0 -1
- package/dist/chunks/grants-saMQagmG.js +0 -160
- package/dist/chunks/grants-saMQagmG.js.map +0 -1
- package/dist/chunks/icons-D-PfAfnH.js +0 -203
- package/dist/chunks/icons-D-PfAfnH.js.map +0 -1
- package/dist/chunks/offboarding-C6l30DZR.js +0 -263
- package/dist/chunks/offboarding-C6l30DZR.js.map +0 -1
- package/dist/chunks/page-C5HcNqf2.js +0 -190
- package/dist/chunks/page-C5HcNqf2.js.map +0 -1
- package/dist/chunks/principal-page-D_91OA0l.js.map +0 -1
- package/dist/chunks/queries-CQ81o4so.js.map +0 -1
- package/dist/chunks/signin-errors-BEFlVDbQ.js +0 -30
- package/dist/chunks/signin-errors-BEFlVDbQ.js.map +0 -1
- package/dist/chunks/ui-DixXLQvQ.js.map +0 -1
- package/dist/chunks/use-action-CWsg_YWU.js +0 -49
- package/dist/chunks/use-action-CWsg_YWU.js.map +0 -1
- package/dist/chunks/use-change-c6CeLRin.js.map +0 -1
- package/dist/chunks/validation-BQtqPe2V.js +0 -29
- package/dist/chunks/validation-BQtqPe2V.js.map +0 -1
- package/dist/pages/token.d.ts +0 -3
- package/dist/pages/token.js.map +0 -1
- package/dist/pages/tokens.d.ts +0 -3
- package/dist/pages/tokens.js +0 -39
- package/dist/pages/tokens.js.map +0 -1
- package/dist/project-BqIy8gYR.d.ts +0 -5
- package/src/lib/instance.ts +0 -13
- package/src/pages/token.tsx +0 -34
package/dist/pages/account.js
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { a as ErrorLine, c as Notice, i as EmptyState, t as ConfirmButton, u as Timestamp } from "../chunks/ui-
|
|
2
|
-
import {
|
|
3
|
-
import { t as ThemeCards } from "../chunks/theme-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
1
|
+
import { a as ErrorLine, c as Notice, i as EmptyState, t as ConfirmButton, u as Timestamp } from "../chunks/ui-DJje3gST.js";
|
|
2
|
+
import { N as Link, Q as Terminal, R as Monitor, W as ProviderMark, Y as SignOut, i as PageHeader, it as X, r as Fact, t as Card, u as useCoffre } from "../chunks/page-DvsgZ2Hd.js";
|
|
3
|
+
import { t as ThemeCards } from "../chunks/theme-DJuz-xLM.js";
|
|
4
|
+
import { a as rowClass, i as RowPending, r as RowFailure } from "../chunks/row-state-DOPUsjQK.js";
|
|
5
|
+
import { p as queries } from "../chunks/queries-DVR_i3rA.js";
|
|
6
|
+
import { t as useShell } from "../chunks/use-shell-rNKfGjdj.js";
|
|
7
|
+
import { n as signinErrorMessage } from "../chunks/signin-errors--ykMFuqN.js";
|
|
8
|
+
import { T as unlinkIdentity, d as endSession, n as useChangeStatus, t as useChange, u as disconnectApp } from "../chunks/use-change-DUiGO19U.js";
|
|
9
|
+
import { n as InstanceRole } from "../chunks/directory-zr3ek7Mc.js";
|
|
10
|
+
import { t as useOneTime } from "../chunks/one-time-DXEl9hbg.js";
|
|
11
11
|
import { t as pageRoute } from "../chunks/page-route-Drfw7lmn.js";
|
|
12
12
|
import { Fragment } from "react";
|
|
13
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { useSuspenseQueries } from "@tanstack/react-query";
|
|
14
|
+
import { useSuspenseQueries, useSuspenseQuery } from "@tanstack/react-query";
|
|
15
|
+
import { MCP_SCOPE_INFO } from "@coffre/core/mcp";
|
|
15
16
|
//#region src/pages/account.tsx
|
|
16
17
|
var Route = pageRoute();
|
|
17
18
|
/**
|
|
18
19
|
* Your own settings: how coffre looks here, who it takes you for and, when
|
|
19
|
-
* coffre runs its own sign-in, which accounts you sign in with
|
|
20
|
-
* are signed in. The sidebar's Settings is the instance's; this page is
|
|
20
|
+
* coffre runs its own sign-in, which accounts you sign in with, where you
|
|
21
|
+
* are signed in, and the MCP clients you connected. The sidebar's Settings is the instance's; this page is
|
|
21
22
|
* reached from your account at the sidebar's foot.
|
|
22
23
|
*/
|
|
23
24
|
function AccountPage() {
|
|
24
|
-
const { principal, instanceRole, auth } = useShell();
|
|
25
|
+
const { principal, instanceRole, auth, features } = useShell();
|
|
25
26
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
26
27
|
/* @__PURE__ */ jsx(PageHeader, {
|
|
27
28
|
title: "Account",
|
|
@@ -67,7 +68,8 @@ function AccountPage() {
|
|
|
67
68
|
auth.signin !== null && principal?.type === "user" && /* @__PURE__ */ jsx(SignIn, {
|
|
68
69
|
email: principal.id,
|
|
69
70
|
providers: auth.signin.providers
|
|
70
|
-
})
|
|
71
|
+
}),
|
|
72
|
+
features.mcp && principal?.type === "user" && /* @__PURE__ */ jsx(ConnectedApps, {})
|
|
71
73
|
] });
|
|
72
74
|
}
|
|
73
75
|
/** Which accounts you sign in with, and where you are signed in. */
|
|
@@ -104,134 +106,129 @@ function providerLabel(providers, id) {
|
|
|
104
106
|
return providers.find((provider) => provider.id === id)?.label ?? id ?? "unknown";
|
|
105
107
|
}
|
|
106
108
|
function SigninAccounts({ email, providers, identities }) {
|
|
107
|
-
const { linked, error } = Route.useSearch();
|
|
109
|
+
const { linked, error } = useOneTime(Route.useSearch(), ["linked", "error"]);
|
|
108
110
|
const message = signinErrorMessage(error);
|
|
109
111
|
const change = unlinkIdentity(useCoffre());
|
|
110
112
|
const unlink = useChange(change);
|
|
111
113
|
const { status, dismiss } = useChangeStatus(change.list.queryKey);
|
|
112
|
-
return /* @__PURE__ */ jsxs(Card, {
|
|
114
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Card, {
|
|
113
115
|
labelledBy: "signin-accounts",
|
|
114
116
|
title: "Sign-in accounts",
|
|
115
117
|
description: "coffre recognises you by these accounts, never by an email address alone. A new account is linked here, while you are signed in.",
|
|
116
|
-
children: [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
118
|
+
children: [(linked !== void 0 || message !== null) && /* @__PURE__ */ jsxs("div", {
|
|
119
|
+
className: "card-body",
|
|
120
|
+
children: [linked !== void 0 && /* @__PURE__ */ jsxs(Notice, {
|
|
121
|
+
tone: "good",
|
|
122
|
+
children: [providerLabel(providers, linked), " account linked."]
|
|
123
|
+
}), /* @__PURE__ */ jsx(ErrorLine, { error: message })]
|
|
124
|
+
}), identities.length === 0 ? /* @__PURE__ */ jsxs(EmptyState, {
|
|
125
|
+
title: "No account linked",
|
|
126
|
+
children: [
|
|
127
|
+
"Your next sign-in with a verified ",
|
|
128
|
+
/* @__PURE__ */ jsx("span", {
|
|
129
|
+
className: "mono",
|
|
130
|
+
children: email
|
|
131
|
+
}),
|
|
132
|
+
" links that account."
|
|
133
|
+
]
|
|
134
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
135
|
+
className: "dt-wrap",
|
|
136
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
137
|
+
className: "dt stacks stacks-inline",
|
|
138
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
139
|
+
/* @__PURE__ */ jsx("th", { children: "Account" }),
|
|
140
|
+
/* @__PURE__ */ jsx("th", {
|
|
141
|
+
className: "col-shrink",
|
|
142
|
+
children: "Linked (UTC)"
|
|
131
143
|
}),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
className: "col-shrink",
|
|
142
|
-
children: "Linked (UTC)"
|
|
143
|
-
}),
|
|
144
|
-
/* @__PURE__ */ jsx("th", {
|
|
145
|
-
className: "col-shrink",
|
|
146
|
-
children: "Last sign-in"
|
|
147
|
-
}),
|
|
148
|
-
/* @__PURE__ */ jsx("th", {
|
|
149
|
-
className: "col-actions",
|
|
150
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
151
|
-
className: "visually-hidden",
|
|
152
|
-
children: "Actions"
|
|
153
|
-
})
|
|
144
|
+
/* @__PURE__ */ jsx("th", {
|
|
145
|
+
className: "col-shrink",
|
|
146
|
+
children: "Last sign-in"
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ jsx("th", {
|
|
149
|
+
className: "col-actions",
|
|
150
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
151
|
+
className: "visually-hidden",
|
|
152
|
+
children: "Actions"
|
|
154
153
|
})
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
154
|
+
})
|
|
155
|
+
] }) }), /* @__PURE__ */ jsx("tbody", { children: identities.map((identity) => {
|
|
156
|
+
const label = providerLabel(providers, identity.provider);
|
|
157
|
+
const brand = providers.find((p) => p.id === identity.provider)?.brand ?? "oidc";
|
|
158
|
+
const state = status(identity.id);
|
|
159
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("tr", {
|
|
160
|
+
className: rowClass(state),
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("span", {
|
|
163
|
+
className: "cell-account",
|
|
164
|
+
children: [/* @__PURE__ */ jsx(ProviderMark, { brand }), /* @__PURE__ */ jsxs("span", {
|
|
165
|
+
className: "cell-stack",
|
|
166
|
+
children: [/* @__PURE__ */ jsx("span", { children: label }), identity.email !== null && /* @__PURE__ */ jsx("small", {
|
|
167
|
+
className: "mono",
|
|
168
|
+
children: identity.email
|
|
170
169
|
})]
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
/* @__PURE__ */ jsx(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
170
|
+
})]
|
|
171
|
+
}) }),
|
|
172
|
+
/* @__PURE__ */ jsx("td", {
|
|
173
|
+
className: "nowrap",
|
|
174
|
+
"data-label": "Linked (UTC)",
|
|
175
|
+
children: /* @__PURE__ */ jsx(Timestamp, { iso: identity.createdAt })
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ jsx("td", {
|
|
178
|
+
className: "nowrap cell-muted",
|
|
179
|
+
"data-label": "Last sign-in",
|
|
180
|
+
children: identity.lastSignInAt === null ? "Never" : /* @__PURE__ */ jsx(Timestamp, {
|
|
181
|
+
iso: identity.lastSignInAt,
|
|
182
|
+
display: "relative"
|
|
183
|
+
})
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ jsx("td", {
|
|
186
|
+
className: "col-actions",
|
|
187
|
+
children: state.state === "pending" ? /* @__PURE__ */ jsx(RowPending, { status: state }) : /* @__PURE__ */ jsx(ConfirmButton, {
|
|
188
|
+
trigger: /* @__PURE__ */ jsxs("button", {
|
|
189
|
+
className: "act",
|
|
190
|
+
children: [/* @__PURE__ */ jsx(X, { size: 13 }), "Unlink"]
|
|
191
|
+
}),
|
|
192
|
+
title: `Unlink this ${label} account?`,
|
|
193
|
+
body: identities.length === 1 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
194
|
+
"It stops signing you in, and every session it opened ends now, this one included if you signed in with it. Your next sign-in with any account whose verified email is",
|
|
195
|
+
" ",
|
|
196
|
+
/* @__PURE__ */ jsx("span", {
|
|
197
|
+
className: "mono",
|
|
198
|
+
children: email
|
|
189
199
|
}),
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
children: email
|
|
197
|
-
}),
|
|
198
|
-
" links that account instead."
|
|
199
|
-
] }) : /* @__PURE__ */ jsx(Fragment$1, { children: "It stops signing you in, and every session it opened ends now, this one included if you signed in with it." }),
|
|
200
|
-
confirmLabel: "Unlink",
|
|
201
|
-
onConfirm: () => unlink({
|
|
202
|
-
...identity,
|
|
203
|
-
label
|
|
204
|
-
})
|
|
200
|
+
" links that account instead."
|
|
201
|
+
] }) : /* @__PURE__ */ jsx(Fragment$1, { children: "It stops signing you in, and every session it opened ends now, this one included if you signed in with it." }),
|
|
202
|
+
confirmLabel: "Unlink",
|
|
203
|
+
onConfirm: () => unlink({
|
|
204
|
+
...identity,
|
|
205
|
+
label
|
|
205
206
|
})
|
|
206
207
|
})
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}) })
|
|
214
|
-
})
|
|
215
|
-
}),
|
|
216
|
-
providers.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
217
|
-
className: "card-foot",
|
|
218
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
219
|
-
className: "hint",
|
|
220
|
-
children: "Link another account"
|
|
221
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
222
|
-
className: "link-providers",
|
|
223
|
-
children: providers.map((provider) => /* @__PURE__ */ jsxs("a", {
|
|
224
|
-
className: "btn btn-sm",
|
|
225
|
-
href: `/auth/signin/${encodeURIComponent(provider.id)}?link=1`,
|
|
226
|
-
children: [/* @__PURE__ */ jsx(ProviderMark, {
|
|
227
|
-
brand: provider.brand,
|
|
228
|
-
size: 14
|
|
229
|
-
}), provider.label]
|
|
230
|
-
}, provider.id))
|
|
231
|
-
})]
|
|
208
|
+
})
|
|
209
|
+
]
|
|
210
|
+
}), /* @__PURE__ */ jsx(RowFailure, {
|
|
211
|
+
status: state,
|
|
212
|
+
columns: 4,
|
|
213
|
+
onDismiss: () => state.state === "failed" && dismiss(state.mutationId)
|
|
214
|
+
})] }, identity.id);
|
|
215
|
+
}) })]
|
|
232
216
|
})
|
|
233
|
-
]
|
|
234
|
-
})
|
|
217
|
+
})]
|
|
218
|
+
}), providers.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
219
|
+
className: "table-actions",
|
|
220
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
221
|
+
className: "hint",
|
|
222
|
+
children: "Link another account"
|
|
223
|
+
}), providers.map((provider) => /* @__PURE__ */ jsxs("a", {
|
|
224
|
+
className: "btn",
|
|
225
|
+
href: `/auth/signin/${encodeURIComponent(provider.id)}?link=1`,
|
|
226
|
+
children: [/* @__PURE__ */ jsx(ProviderMark, {
|
|
227
|
+
brand: provider.brand,
|
|
228
|
+
size: 14
|
|
229
|
+
}), provider.label]
|
|
230
|
+
}, provider.id))]
|
|
231
|
+
})] });
|
|
235
232
|
}
|
|
236
233
|
function Sessions({ sessions, providers }) {
|
|
237
234
|
const change = endSession(useCoffre());
|
|
@@ -247,7 +244,7 @@ function Sessions({ sessions, providers }) {
|
|
|
247
244
|
}) : /* @__PURE__ */ jsx("div", {
|
|
248
245
|
className: "dt-wrap",
|
|
249
246
|
children: /* @__PURE__ */ jsxs("table", {
|
|
250
|
-
className: "dt",
|
|
247
|
+
className: "dt stacks stacks-inline",
|
|
251
248
|
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
252
249
|
/* @__PURE__ */ jsx("th", { children: "Where" }),
|
|
253
250
|
/* @__PURE__ */ jsx("th", {
|
|
@@ -279,7 +276,7 @@ function Sessions({ sessions, providers }) {
|
|
|
279
276
|
" ",
|
|
280
277
|
session.current && /* @__PURE__ */ jsx("span", {
|
|
281
278
|
className: "tag tag-blue",
|
|
282
|
-
children: "
|
|
279
|
+
children: "This browser"
|
|
283
280
|
})
|
|
284
281
|
] }), /* @__PURE__ */ jsxs("small", { children: [session.kind === "cli" ? "coffre login" : `via ${providerLabel(providers, session.provider)}`, session.lastUsedIp !== null && /* @__PURE__ */ jsxs(Fragment$1, { children: [" · ", /* @__PURE__ */ jsx("span", {
|
|
285
282
|
className: "mono",
|
|
@@ -289,6 +286,7 @@ function Sessions({ sessions, providers }) {
|
|
|
289
286
|
}) }),
|
|
290
287
|
/* @__PURE__ */ jsx("td", {
|
|
291
288
|
className: "nowrap cell-muted",
|
|
289
|
+
"data-label": "Last active",
|
|
292
290
|
children: /* @__PURE__ */ jsx(Timestamp, {
|
|
293
291
|
iso: session.lastUsedAt ?? session.createdAt,
|
|
294
292
|
display: "relative"
|
|
@@ -296,6 +294,7 @@ function Sessions({ sessions, providers }) {
|
|
|
296
294
|
}),
|
|
297
295
|
/* @__PURE__ */ jsx("td", {
|
|
298
296
|
className: "nowrap cell-muted",
|
|
297
|
+
"data-label": "Expires",
|
|
299
298
|
children: /* @__PURE__ */ jsx(Timestamp, {
|
|
300
299
|
iso: session.expiresAt,
|
|
301
300
|
display: "relative"
|
|
@@ -311,10 +310,32 @@ function Sessions({ sessions, providers }) {
|
|
|
311
310
|
type: "submit",
|
|
312
311
|
children: [/* @__PURE__ */ jsx(SignOut, { size: 13 }), "Sign out"]
|
|
313
312
|
})
|
|
314
|
-
}) : state.state === "pending" ? /* @__PURE__ */ jsx(RowPending, { status: state }) : /* @__PURE__ */
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
313
|
+
}) : state.state === "pending" ? /* @__PURE__ */ jsx(RowPending, { status: state }) : /* @__PURE__ */ jsx(ConfirmButton, {
|
|
314
|
+
trigger: /* @__PURE__ */ jsxs("button", {
|
|
315
|
+
className: "act",
|
|
316
|
+
children: [/* @__PURE__ */ jsx(X, { size: 13 }), "End"]
|
|
317
|
+
}),
|
|
318
|
+
title: `End this ${session.kind === "cli" ? "command line" : "browser"} session?`,
|
|
319
|
+
body: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
320
|
+
session.label ?? (session.kind === "cli" ? "The command line" : "The browser"),
|
|
321
|
+
session.lastUsedIp !== null && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
322
|
+
" ",
|
|
323
|
+
"at ",
|
|
324
|
+
/* @__PURE__ */ jsx("span", {
|
|
325
|
+
className: "mono",
|
|
326
|
+
children: session.lastUsedIp
|
|
327
|
+
})
|
|
328
|
+
] }),
|
|
329
|
+
", last active",
|
|
330
|
+
" ",
|
|
331
|
+
/* @__PURE__ */ jsx(Timestamp, {
|
|
332
|
+
iso: session.lastUsedAt ?? session.createdAt,
|
|
333
|
+
display: "relative"
|
|
334
|
+
}),
|
|
335
|
+
", is signed out at its next request."
|
|
336
|
+
] }),
|
|
337
|
+
confirmLabel: "End session",
|
|
338
|
+
onConfirm: () => end(session)
|
|
318
339
|
})
|
|
319
340
|
})
|
|
320
341
|
]
|
|
@@ -328,6 +349,147 @@ function Sessions({ sessions, providers }) {
|
|
|
328
349
|
})
|
|
329
350
|
});
|
|
330
351
|
}
|
|
352
|
+
/** The MCP clients you connected, such as Claude: each acts as you until it is disconnected or expires. */
|
|
353
|
+
function ConnectedApps() {
|
|
354
|
+
const client = useCoffre();
|
|
355
|
+
const { data: apps } = useSuspenseQuery(queries.apps(client));
|
|
356
|
+
const change = disconnectApp(client);
|
|
357
|
+
const disconnect = useChange(change);
|
|
358
|
+
const { status, dismiss } = useChangeStatus(change.list.queryKey);
|
|
359
|
+
return /* @__PURE__ */ jsx(Card, {
|
|
360
|
+
labelledBy: "apps",
|
|
361
|
+
title: "Connected apps",
|
|
362
|
+
description: "AI assistants and other MCP clients you connected. Each acts as you, never beyond your access, and every call it makes is in the audit log. Disconnecting one stops it at its next request.",
|
|
363
|
+
children: !apps.ok ? /* @__PURE__ */ jsx("div", {
|
|
364
|
+
className: "card-body",
|
|
365
|
+
children: /* @__PURE__ */ jsx(ErrorLine, { error: apps.error })
|
|
366
|
+
}) : apps.apps.length === 0 ? /* @__PURE__ */ jsxs(EmptyState, {
|
|
367
|
+
title: "No connected apps",
|
|
368
|
+
children: [
|
|
369
|
+
"An app such as Claude connects through coffre's MCP endpoint, at",
|
|
370
|
+
" ",
|
|
371
|
+
/* @__PURE__ */ jsx("span", {
|
|
372
|
+
className: "mono",
|
|
373
|
+
children: "/mcp"
|
|
374
|
+
}),
|
|
375
|
+
", after you approve it here."
|
|
376
|
+
]
|
|
377
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
378
|
+
className: "dt-wrap",
|
|
379
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
380
|
+
className: "dt stacks stacks-inline",
|
|
381
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
382
|
+
/* @__PURE__ */ jsx("th", { children: "App" }),
|
|
383
|
+
/* @__PURE__ */ jsx("th", { children: "May" }),
|
|
384
|
+
/* @__PURE__ */ jsx("th", {
|
|
385
|
+
className: "col-shrink",
|
|
386
|
+
children: "Last used"
|
|
387
|
+
}),
|
|
388
|
+
/* @__PURE__ */ jsx("th", {
|
|
389
|
+
className: "col-shrink",
|
|
390
|
+
children: "Expires"
|
|
391
|
+
}),
|
|
392
|
+
/* @__PURE__ */ jsx("th", {
|
|
393
|
+
className: "col-actions",
|
|
394
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
395
|
+
className: "visually-hidden",
|
|
396
|
+
children: "Actions"
|
|
397
|
+
})
|
|
398
|
+
})
|
|
399
|
+
] }) }), /* @__PURE__ */ jsx("tbody", { children: apps.apps.map((app) => {
|
|
400
|
+
const state = status(app.id);
|
|
401
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("tr", {
|
|
402
|
+
className: rowClass(state),
|
|
403
|
+
children: [
|
|
404
|
+
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("span", {
|
|
405
|
+
className: "cell-account",
|
|
406
|
+
children: [/* @__PURE__ */ jsx(Link, { size: 15 }), /* @__PURE__ */ jsxs("span", {
|
|
407
|
+
className: "cell-stack",
|
|
408
|
+
children: [/* @__PURE__ */ jsxs("span", { children: [
|
|
409
|
+
app.name,
|
|
410
|
+
" ",
|
|
411
|
+
app.registration === "dcr" && /* @__PURE__ */ jsx("span", {
|
|
412
|
+
className: "tag tag-amber",
|
|
413
|
+
title: "It registered itself: its name is its own claim",
|
|
414
|
+
children: "Unverified"
|
|
415
|
+
})
|
|
416
|
+
] }), /* @__PURE__ */ jsxs("small", { children: [
|
|
417
|
+
app.host === null ? "no website" : /* @__PURE__ */ jsx("span", {
|
|
418
|
+
className: "mono",
|
|
419
|
+
children: app.host
|
|
420
|
+
}),
|
|
421
|
+
" · connected ",
|
|
422
|
+
/* @__PURE__ */ jsx(Timestamp, {
|
|
423
|
+
iso: app.createdAt,
|
|
424
|
+
display: "relative"
|
|
425
|
+
})
|
|
426
|
+
] })]
|
|
427
|
+
})]
|
|
428
|
+
}) }),
|
|
429
|
+
/* @__PURE__ */ jsx("td", {
|
|
430
|
+
"data-label": "May",
|
|
431
|
+
children: scopeLabels(app)
|
|
432
|
+
}),
|
|
433
|
+
/* @__PURE__ */ jsx("td", {
|
|
434
|
+
className: "nowrap cell-muted",
|
|
435
|
+
"data-label": "Last used",
|
|
436
|
+
children: app.lastUsedAt === null ? "Never" : /* @__PURE__ */ jsx(Timestamp, {
|
|
437
|
+
iso: app.lastUsedAt,
|
|
438
|
+
display: "relative"
|
|
439
|
+
})
|
|
440
|
+
}),
|
|
441
|
+
/* @__PURE__ */ jsx("td", {
|
|
442
|
+
className: "nowrap cell-muted",
|
|
443
|
+
"data-label": "Expires",
|
|
444
|
+
children: /* @__PURE__ */ jsx(Timestamp, {
|
|
445
|
+
iso: app.expiresAt,
|
|
446
|
+
display: "relative"
|
|
447
|
+
})
|
|
448
|
+
}),
|
|
449
|
+
/* @__PURE__ */ jsx("td", {
|
|
450
|
+
className: "col-actions",
|
|
451
|
+
children: state.state === "pending" ? /* @__PURE__ */ jsx(RowPending, { status: state }) : /* @__PURE__ */ jsx(ConfirmButton, {
|
|
452
|
+
trigger: /* @__PURE__ */ jsxs("button", {
|
|
453
|
+
className: "act",
|
|
454
|
+
children: [/* @__PURE__ */ jsx(X, { size: 13 }), "Disconnect"]
|
|
455
|
+
}),
|
|
456
|
+
title: `Disconnect ${app.name}?`,
|
|
457
|
+
body: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
458
|
+
app.name,
|
|
459
|
+
app.host !== null && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
460
|
+
" ",
|
|
461
|
+
"at ",
|
|
462
|
+
/* @__PURE__ */ jsx("span", {
|
|
463
|
+
className: "mono",
|
|
464
|
+
children: app.host
|
|
465
|
+
})
|
|
466
|
+
] }),
|
|
467
|
+
", last used",
|
|
468
|
+
" ",
|
|
469
|
+
app.lastUsedAt === null ? "never" : /* @__PURE__ */ jsx(Timestamp, {
|
|
470
|
+
iso: app.lastUsedAt,
|
|
471
|
+
display: "relative"
|
|
472
|
+
}),
|
|
473
|
+
", stops at its next request. To use it again, connect it again."
|
|
474
|
+
] }),
|
|
475
|
+
confirmLabel: "Disconnect",
|
|
476
|
+
onConfirm: () => disconnect(app)
|
|
477
|
+
})
|
|
478
|
+
})
|
|
479
|
+
]
|
|
480
|
+
}), /* @__PURE__ */ jsx(RowFailure, {
|
|
481
|
+
status: state,
|
|
482
|
+
columns: 5,
|
|
483
|
+
onDismiss: () => state.state === "failed" && dismiss(state.mutationId)
|
|
484
|
+
})] }, app.id);
|
|
485
|
+
}) })]
|
|
486
|
+
})
|
|
487
|
+
})
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
function scopeLabels(app) {
|
|
491
|
+
return app.scopes.map((scope) => MCP_SCOPE_INFO[scope].label).join(", ");
|
|
492
|
+
}
|
|
331
493
|
//#endregion
|
|
332
494
|
export { AccountPage };
|
|
333
495
|
|