@mcp-use/inspector 20.0.0-beta.0 → 20.0.0-beta.2
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 +5 -0
- package/dist/cdn/{AnimatePresence-B4HhIdgq.js → AnimatePresence-Dcw-FOy8.js} +50 -50
- package/dist/cdn/ChatTab-DBl6dHVH.js +6744 -0
- package/dist/cdn/{CheckboxIndicator-BF2cKfbA.js → CheckboxIndicator-Bt4IICtv.js} +77 -77
- package/dist/cdn/{ConnectionSettingsForm-iwNW86ZU.js → ConnectionSettingsForm-BFsZpwK4.js} +348 -292
- package/dist/cdn/ConnectionSettingsTab-DDk06dhT.js +150 -0
- package/dist/cdn/{ElicitationTab-upPXq2q7.js → ElicitationTab-CL1KJ0bz.js} +39 -39
- package/dist/cdn/{FormContext-Cl51-7O7.js → FormContext-tmgN_Vdr.js} +1 -1
- package/dist/cdn/{InspectorContext-DzXtgyTx.js → InspectorContext-UjtEbNod.js} +1 -21
- package/dist/cdn/{JSONDisplay-D3RcyO9z.js → JSONDisplay-BFxf5oEu.js} +18 -18
- package/dist/cdn/{ListTabHeader-8lULn-90.js → ListTabHeader-Cv-GmtGF.js} +19 -19
- package/dist/cdn/{ManufactOAuthCallback-DEM8mhWD.js → ManufactOAuthCallback-B98kSYCj.js} +1 -1
- package/dist/cdn/MarkdownRenderer-DQflNTGo.js +3610 -0
- package/dist/cdn/{NotificationsTab-CWopTIzT.js → NotificationsTab-CeImSrhx.js} +13 -13
- package/dist/cdn/{OAuthCallback-BxuOVgdb.js → OAuthCallback-C4n2hqKU.js} +1 -1
- package/dist/cdn/PromptsTab-C84YLTSM.js +901 -0
- package/dist/cdn/{ResourcesTab-BczUMFil.js → ResourcesTab-CCa5bIHE.js} +35 -55
- package/dist/cdn/{SamplingTab-6u5s845G.js → SamplingTab-Bt9z8yQ2.js} +35 -35
- package/dist/cdn/{ServerMetadataTab-DS0eiyyD.js → ServerMetadataTab-CvrKX8fz.js} +12 -12
- package/dist/cdn/{StatusIcon-BGXOEU2u.js → StatusIcon-D0-ARyOh.js} +6 -6
- package/dist/cdn/{ToolsTab-CUhwP4rZ.js → ToolsTab-v9zgWmM6.js} +103 -137
- package/dist/cdn/{ViewPreview-CxJc1Kht.js → ViewPreview-DsPwZAwO.js} +2 -2
- package/dist/cdn/{WidgetWrapper-BJJtLqMb.js → WidgetWrapper-CwlpDv17.js} +529 -530
- package/dist/cdn/card-DgiYnSg-.js +41 -0
- package/dist/cdn/{checkbox-B4oUG6Rr.js → checkbox-By0FklhG.js} +6 -6
- package/dist/cdn/{dialog-Dnl-pZsY.js → dialog-BsDpuJd3.js} +151 -151
- package/dist/cdn/{dist-mRDqCgKU.js → dist-B0eL32Gb.js} +114 -113
- package/dist/cdn/{dist-DjXr_YO3.js → dist-DaMB0Su9.js} +1 -1
- package/dist/cdn/{index-browser-CVUwR-Bu.js → index-browser-QDjRGsPo.js} +1 -1
- package/dist/cdn/{input-BLxOA7V-.js → input-C2OBd4PJ.js} +4787 -2842
- package/dist/cdn/inspector.css +1 -1
- package/dist/cdn/inspector.js +7424 -7443
- package/dist/cdn/{label-CBvG613A.js → label-B9Jmm9be.js} +10 -10
- package/dist/cdn/{manufact-auth-0TVxpeTA.js → manufact-auth-BQMHhbLV.js} +142 -106
- package/dist/cdn/{not-found-BcNNsTjS.js → not-found-DEtSM_Wd.js} +7 -7
- package/dist/cdn/providerMeta-BQIfHuNL.js +379 -0
- package/dist/cdn/{react-yUi9mVK4.js → react-Dn8PWXwP.js} +33 -27
- package/dist/cdn/{select-BZ_IoKxg.js → select-DDdiIPR2.js} +726 -726
- package/dist/cdn/{shared-uMiV6Fx1.js → shared-DaILIQPP.js} +29 -29
- package/dist/cdn/{popover-C_SSrXT0.js → sheet-Br_l2kry.js} +694 -622
- package/dist/cdn/{spinner-CWcJhIY_.js → spinner-jQtC7EBj.js} +5 -5
- package/dist/cdn/{switch-DtQOLb9R.js → switch-C3IyQuid.js} +104 -104
- package/dist/cdn/{tabs-subtle-C5cy35sY.js → tabs-subtle-CkdI6Mac.js} +147 -147
- package/dist/cdn/{telemetry-Ct6pVkM1.js → telemetry-DGoIGfIS.js} +3 -3
- package/dist/cdn/{textarea-Bj-CT7hC.js → textarea-DSbwcFVt.js} +6 -6
- package/dist/cdn/{useAriaLabelledBy-Bm9qHGK6.js → useAriaLabelledBy-DqAdnppm.js} +1 -1
- package/dist/cdn/{useCompositeItem-CNJ6MXdi.js → useCompositeItem-BRqEzYh-.js} +2 -2
- package/dist/cdn/{useConfig-CwxZ6Quj.js → useConfig-CTb6GZbt.js} +73 -46
- package/dist/cdn/{useViewHostProps-C7vjco2m.js → useViewHostProps-DIIlz3tJ.js} +1 -1
- package/dist/cli.js +141 -25
- package/dist/client/auth/manufact-auth.d.ts +3 -1
- package/dist/client/auth/manufact-auth.d.ts.map +1 -1
- package/dist/client/components/ChatTab.d.ts +1 -8
- package/dist/client/components/ChatTab.d.ts.map +1 -1
- package/dist/client/components/ResourcesTab.d.ts.map +1 -1
- package/dist/client/components/chat/ChatHeader.d.ts +7 -2
- package/dist/client/components/chat/ChatHeader.d.ts.map +1 -1
- package/dist/client/components/chat/ChatLandingForm.d.ts +4 -2
- package/dist/client/components/chat/ChatLandingForm.d.ts.map +1 -1
- package/dist/client/components/chat/ChatManagedNotice.d.ts +10 -0
- package/dist/client/components/chat/ChatManagedNotice.d.ts.map +1 -0
- package/dist/client/components/chat/ChatScrollTopFade.d.ts +7 -0
- package/dist/client/components/chat/ChatScrollTopFade.d.ts.map +1 -0
- package/dist/client/components/chat/ConfigurationDialog.d.ts +11 -9
- package/dist/client/components/chat/ConfigurationDialog.d.ts.map +1 -1
- package/dist/client/components/chat/ConfigureEmptyState.d.ts +1 -6
- package/dist/client/components/chat/ConfigureEmptyState.d.ts.map +1 -1
- package/dist/client/components/chat/StreamingAssistantContent.d.ts.map +1 -1
- package/dist/client/components/chat/chatModeStorage.d.ts +11 -0
- package/dist/client/components/chat/chatModeStorage.d.ts.map +1 -0
- package/dist/client/components/chat/managedChatNotice.d.ts +16 -0
- package/dist/client/components/chat/managedChatNotice.d.ts.map +1 -0
- package/dist/client/components/chat/providerMeta.d.ts +11 -0
- package/dist/client/components/chat/providerMeta.d.ts.map +1 -1
- package/dist/client/components/chat/useChatMessages.d.ts +7 -5
- package/dist/client/components/chat/useChatMessages.d.ts.map +1 -1
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts +4 -6
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts.map +1 -1
- package/dist/client/components/chat/useChatScrollToBottom.d.ts +1 -0
- package/dist/client/components/chat/useChatScrollToBottom.d.ts.map +1 -1
- package/dist/client/components/chat/useConfig.d.ts +1 -1
- package/dist/client/components/chat/useConfig.d.ts.map +1 -1
- package/dist/client/components/chat/useHostedChatMode.d.ts +1 -1
- package/dist/client/components/chat/useHostedChatMode.d.ts.map +1 -1
- package/dist/client/components/shared/MarkdownRenderer.d.ts +2 -1
- package/dist/client/components/shared/MarkdownRenderer.d.ts.map +1 -1
- package/dist/client/components/tools/useToolsTabNavigation.d.ts.map +1 -1
- package/dist/client/components/ui/MeshGradientCanvas.d.ts +13 -0
- package/dist/client/components/ui/MeshGradientCanvas.d.ts.map +1 -0
- package/dist/client/components/ui/chat-message.d.ts +1 -1
- package/dist/client/components/ui/chat-message.d.ts.map +1 -1
- package/dist/client/components/ui/file-thumbnail.d.ts.map +1 -1
- package/dist/client/components/ui/mesh-tab-background.d.ts +3 -1
- package/dist/client/components/ui/mesh-tab-background.d.ts.map +1 -1
- package/dist/client/context/InspectorContext.d.ts.map +1 -1
- package/dist/client/index.js +2577 -2165
- package/dist/client/telemetry/utils.d.ts.map +1 -1
- package/dist/server/asset-urls.d.ts +18 -0
- package/dist/server/asset-urls.d.ts.map +1 -0
- package/dist/server/asset-urls.js +17 -0
- package/dist/server/cdn-shell.d.ts +3 -3
- package/dist/server/cdn-shell.d.ts.map +1 -1
- package/dist/server/cdn-shell.js +5 -3
- package/dist/server/chunk-H6ZCIKBS.js +63 -0
- package/dist/server/{chunk-ESODOPDD.js → chunk-J4FNYLBF.js} +4 -0
- package/dist/server/{chunk-TPHRVELX.js → chunk-K2DPKTIS.js} +27 -9
- package/dist/server/{chunk-THQ67TSE.js → chunk-LIM6NAUS.js} +2 -9
- package/dist/server/chunk-M5TZA42I.js +54 -0
- package/dist/server/{chunk-K2V2SDQD.js → chunk-OWR2BIBW.js} +1 -1
- package/dist/server/{chunk-J67FVPHF.js → chunk-R6RQMIXL.js} +2 -2
- package/dist/server/{chunk-5B3SXGZP.js → chunk-UJLXHNQP.js} +1 -1
- package/dist/server/{chunk-6XWDZEFF.js → chunk-XCNS5CIW.js} +8 -3
- package/dist/server/cli.js +8 -6
- package/dist/server/create-dev-api-app.js +3 -3
- package/dist/server/dev-callback-redirect.d.ts +3 -0
- package/dist/server/dev-callback-redirect.d.ts.map +1 -0
- package/dist/server/dev-callback-redirect.js +18 -0
- package/dist/server/favicon-static.d.ts.map +1 -1
- package/dist/server/favicon-static.js +1 -1
- package/dist/server/index.js +9 -7
- package/dist/server/middleware.js +9 -7
- package/dist/server/proxy/index.js +1 -1
- package/dist/server/proxy/mcp-proxy.d.ts +2 -0
- package/dist/server/proxy/mcp-proxy.d.ts.map +1 -1
- package/dist/server/proxy/mcp-proxy.js +3 -1
- package/dist/server/proxy-routes.js +2 -2
- package/dist/server/server.js +3 -3
- package/dist/server/static-assets.d.ts +5 -0
- package/dist/server/static-assets.d.ts.map +1 -0
- package/dist/server/static-assets.js +9 -0
- package/dist/server/version.js +1 -1
- package/dist/server/vite-dev-api-plugin.js +3 -3
- package/dist/web/assets/{AnimatePresence-CthXziG2.js → AnimatePresence-C5p0yiY1.js} +2 -2
- package/dist/web/assets/ChatTab-C2FtENBM.js +18 -0
- package/dist/web/assets/ConnectionSettingsTab-B2sUjytG.js +1 -0
- package/dist/web/assets/ElicitationTab-DwH08kDC.js +1 -0
- package/dist/web/assets/{FormContext-Cqc_A12u.js → FormContext-DH2caWKO.js} +1 -1
- package/dist/web/assets/ListTabHeader-R17w_JsB.js +1 -0
- package/dist/web/assets/{ManufactOAuthCallback-B-tdkUA2.js → ManufactOAuthCallback-Btu4B6u6.js} +1 -1
- package/dist/web/assets/MarkdownRenderer-DpIEt9wb.js +47 -0
- package/dist/web/assets/{NotificationsTab-BgLjxuos.js → NotificationsTab-CHB8mtSz.js} +1 -1
- package/dist/web/assets/{OAuthCallback-Bp-jLoQs.js → OAuthCallback-DV4MgX4Z.js} +1 -1
- package/dist/web/assets/PromptsTab-0GIapoSs.js +15 -0
- package/dist/web/assets/ResourcesTab-N9xjsI_b.js +2 -0
- package/dist/web/assets/SamplingTab-Dw0vpi4t.js +1 -0
- package/dist/web/assets/ServerMetadataTab-D-eQpLBF.js +1 -0
- package/dist/web/assets/ToolsTab-BMrMJ5JV.js +8 -0
- package/dist/web/assets/ViewPreview-N_cpEO0W.js +1 -0
- package/dist/web/assets/WidgetWrapper-pDgNVq9y.js +34 -0
- package/dist/web/assets/checkbox-CrnXSMh2.js +1 -0
- package/dist/web/assets/dist-CeWSydFI.js +21 -0
- package/dist/web/assets/index-Cfuv_gb3.js +475 -0
- package/dist/web/assets/index-fBX3akc8.css +1 -0
- package/dist/web/assets/input-CLYhA7PK.js +1 -0
- package/dist/web/assets/{label-B5Q_Zr8M.js → label-Cdim77Jw.js} +1 -1
- package/dist/web/assets/select-CJ57-Bor.js +1 -0
- package/dist/web/assets/shared-B1GD9FMm.js +1 -0
- package/dist/web/assets/{tabs-subtle-Dxgism9f.js → tabs-subtle-CG5cjC_N.js} +1 -1
- package/dist/web/assets/textarea-DLAmNVf_.js +1 -0
- package/dist/web/assets/useConfig-BTp15Lle.js +1 -0
- package/dist/web/assets/{useViewHostProps-BgsQ2yYl.js → useViewHostProps-BQlaFC2Q.js} +1 -1
- package/dist/web/index.html +8 -9
- package/package.json +5 -12
- package/dist/cdn/ChatTab-5ya_YTFV.js +0 -13218
- package/dist/cdn/ConnectionSettingsTab-CeK83dxn.js +0 -145
- package/dist/cdn/PromptsTab-Cspfnl6n.js +0 -4400
- package/dist/cdn/bundle-mjs-B0nmHDtp.js +0 -1953
- package/dist/cdn/card-DqjqAq0o.js +0 -41
- package/dist/cdn/chunk-BO2N2NFS-Cy167e0X.js +0 -17500
- package/dist/cdn/highlighted-body-OFNGDK62-CoReNbTX.js +0 -36
- package/dist/cdn/mermaid-GHXKKRXX-DgVIbk-D.js +0 -2
- package/dist/cdn/pdf-CxFT9FER.js +0 -16291
- package/dist/cdn/sheet-CerCdhxz.js +0 -78
- package/dist/cdn/useHostedSession-BA39Aegc.js +0 -153
- package/dist/cdn/useMCPPrompts-D3_Hla_z.js +0 -104
- package/dist/client/components/chat/streamdown-code-slim.d.ts +0 -4
- package/dist/client/components/chat/streamdown-code-slim.d.ts.map +0 -1
- package/dist/web/assets/ChatTab-CiAqtqhj.js +0 -460
- package/dist/web/assets/ConnectionSettingsTab-CTh6MFKE.js +0 -1
- package/dist/web/assets/ElicitationTab-B3Eg0_Jm.js +0 -1
- package/dist/web/assets/ListTabHeader-G-nQX18m.js +0 -1
- package/dist/web/assets/PromptsTab-CA-SZs43.js +0 -61
- package/dist/web/assets/ResourcesTab-DdMIW_af.js +0 -2
- package/dist/web/assets/SamplingTab-DjyDG01W.js +0 -1
- package/dist/web/assets/ServerMetadataTab-Q4PlqP_B.js +0 -1
- package/dist/web/assets/ToolsTab-BHk8GCmd.js +0 -8
- package/dist/web/assets/ViewPreview-DWtmwzCb.js +0 -1
- package/dist/web/assets/WidgetWrapper-B43lqbld.js +0 -34
- package/dist/web/assets/bundle-mjs-8puS6ou7.js +0 -1
- package/dist/web/assets/checkbox-_GzEPQic.js +0 -1
- package/dist/web/assets/chunk-BO2N2NFS-BdIeB5Lr.js +0 -131
- package/dist/web/assets/dist-DQjEDTKs.js +0 -21
- package/dist/web/assets/highlighted-body-OFNGDK62-Dp3e1QHL.js +0 -1
- package/dist/web/assets/index-Bbn-6QR2.js +0 -475
- package/dist/web/assets/index-BjH-Qp85.css +0 -1
- package/dist/web/assets/input-CjmxOFr6.js +0 -1
- package/dist/web/assets/mermaid-GHXKKRXX-yq1lkD3x.js +0 -1
- package/dist/web/assets/pdf-C3cfS_Ha.js +0 -54
- package/dist/web/assets/select-C0xlfLAa.js +0 -1
- package/dist/web/assets/shared-Dfwy7nyg.js +0 -1
- package/dist/web/assets/sheet-CRPrEqAa.js +0 -1
- package/dist/web/assets/textarea-Ci09-en6.js +0 -1
- package/dist/web/assets/useConfig-b1f_iVFH.js +0 -1
- package/dist/web/assets/useMCPPrompts-CPskz9af.js +0 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { s as e, t } from "./react-BIs9pQ3H.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Cr as n, Rr as r } from "./input-C2OBd4PJ.js";
|
|
3
|
+
import { t as i } from "./jsx-runtime-CIxvMpEo.js";
|
|
4
4
|
//#region ../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/utils/useControlled.mjs
|
|
5
5
|
var a = /* @__PURE__ */ e(t(), 1);
|
|
6
|
-
function o({ controlled: e, default: t, name:
|
|
6
|
+
function o({ controlled: e, default: t, name: r, state: i = "value" }) {
|
|
7
7
|
let { current: o } = a.useRef(e !== void 0), [c, l] = a.useState(t), u = o ? e : c;
|
|
8
8
|
if (process.env.NODE_ENV !== "production") {
|
|
9
9
|
a.useEffect(() => {
|
|
10
|
-
o !== (e !== void 0) &&
|
|
11
|
-
`A component is changing the ${o ? "" : "un"}controlled ${i} state of ${
|
|
10
|
+
o !== (e !== void 0) && n([
|
|
11
|
+
`A component is changing the ${o ? "" : "un"}controlled ${i} state of ${r} to be ${o ? "un" : ""}controlled.`,
|
|
12
12
|
"Elements should not switch from uncontrolled to controlled (or vice versa).",
|
|
13
|
-
`Decide between using a controlled or uncontrolled ${
|
|
13
|
+
`Decide between using a controlled or uncontrolled ${r} element for the lifetime of the component.`,
|
|
14
14
|
"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",
|
|
15
15
|
"More info: https://fb.me/react-controlled-components"
|
|
16
16
|
].join("\n"));
|
|
17
17
|
}, [
|
|
18
18
|
i,
|
|
19
|
-
|
|
19
|
+
r,
|
|
20
20
|
e
|
|
21
21
|
]);
|
|
22
22
|
let { current: c } = a.useRef(t);
|
|
23
23
|
a.useEffect(() => {
|
|
24
|
-
!o && s(c) !== s(t) &&
|
|
24
|
+
!o && s(c) !== s(t) && n([`A component is changing the default ${i} state of an uncontrolled ${r} after being initialized. To suppress this warning opt to use a controlled ${r}.`].join("\n"));
|
|
25
25
|
}, [t]);
|
|
26
26
|
}
|
|
27
27
|
return [u, a.useCallback((e) => {
|
|
@@ -48,11 +48,11 @@ function s(e) {
|
|
|
48
48
|
}
|
|
49
49
|
//#endregion
|
|
50
50
|
//#region src/client/components/ui/label.tsx
|
|
51
|
-
var c =
|
|
51
|
+
var c = i();
|
|
52
52
|
function l({ className: e, ...t }) {
|
|
53
53
|
return /* @__PURE__ */ (0, c.jsx)("label", {
|
|
54
54
|
"data-slot": "label",
|
|
55
|
-
className:
|
|
55
|
+
className: r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", e),
|
|
56
56
|
...t
|
|
57
57
|
});
|
|
58
58
|
}
|
|
@@ -7,8 +7,16 @@ var r = /* @__PURE__ */ e(t(), 1), i = "openid profile email offline_access", a
|
|
|
7
7
|
accessToken: null,
|
|
8
8
|
user: null,
|
|
9
9
|
mode: null
|
|
10
|
-
}, c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
11
|
-
|
|
10
|
+
}, c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), f = null, p = !1;
|
|
11
|
+
typeof window < "u" && window.addEventListener("message", (e) => {
|
|
12
|
+
if (e.data?.type !== "manufact:invalidate-oauth-client") return;
|
|
13
|
+
for (let e of c.keys()) h()?.removeItem(x(e, "client"));
|
|
14
|
+
let t = f;
|
|
15
|
+
!t || p || (p = !0, U(t, { isRetry: !0 }).finally(() => {
|
|
16
|
+
p = !1;
|
|
17
|
+
}));
|
|
18
|
+
});
|
|
19
|
+
function m(e) {
|
|
12
20
|
let t = c.get(e);
|
|
13
21
|
if (t) return t;
|
|
14
22
|
let n = {
|
|
@@ -17,86 +25,114 @@ function f(e) {
|
|
|
17
25
|
};
|
|
18
26
|
return c.set(e, n), n;
|
|
19
27
|
}
|
|
20
|
-
function
|
|
28
|
+
function h() {
|
|
21
29
|
return typeof window > "u" ? null : window.localStorage;
|
|
22
30
|
}
|
|
23
|
-
function
|
|
31
|
+
function g(e) {
|
|
24
32
|
return new URL(e).origin;
|
|
25
33
|
}
|
|
26
|
-
function
|
|
34
|
+
function _(e, t) {
|
|
27
35
|
let n = new URL(e), r = new URL(t), i = new Set(["localhost", "127.0.0.1"]);
|
|
28
36
|
return i.has(n.hostname) && i.has(r.hostname) ? n.origin === r.origin : (n.hostname === "manufact.com" || n.hostname.endsWith(".manufact.com")) && (r.hostname === "manufact.com" || r.hostname.endsWith(".manufact.com"));
|
|
29
37
|
}
|
|
30
|
-
function
|
|
38
|
+
function v(e) {
|
|
31
39
|
let t = window.__MANUFACT_LOGIN_URL__;
|
|
32
40
|
if (t) return new URL(t).origin;
|
|
33
41
|
let n = new URL(e);
|
|
34
42
|
return n.hostname === "localhost" || n.hostname === "127.0.0.1" ? `${n.protocol}//${n.hostname}:3000` : `${n.protocol}//manufact.com`;
|
|
35
43
|
}
|
|
36
|
-
function
|
|
37
|
-
return `${
|
|
38
|
-
}
|
|
39
|
-
function v(e) {
|
|
40
|
-
return `${g(e)}/auth/embedded-sign-out`;
|
|
41
|
-
}
|
|
42
|
-
function y(e, t) {
|
|
43
|
-
return `${a}:${t}:${e}`;
|
|
44
|
+
function y(e) {
|
|
45
|
+
return `${v(e)}/login`;
|
|
44
46
|
}
|
|
45
47
|
function b(e) {
|
|
46
|
-
return
|
|
48
|
+
return `${v(e)}/auth/embedded-sign-out`;
|
|
47
49
|
}
|
|
48
50
|
function x(e, t) {
|
|
49
|
-
|
|
50
|
-
t ? p()?.setItem(n, "1") : p()?.removeItem(n);
|
|
51
|
+
return `${a}:${t}:${e}`;
|
|
51
52
|
}
|
|
52
53
|
function S(e) {
|
|
54
|
+
return h()?.getItem(x(e, "skip-session")) === "1";
|
|
55
|
+
}
|
|
56
|
+
function C(e, t) {
|
|
57
|
+
let n = x(e, "skip-session");
|
|
58
|
+
t ? h()?.setItem(n, "1") : h()?.removeItem(n);
|
|
59
|
+
}
|
|
60
|
+
function w(e) {
|
|
53
61
|
return `${a}:state:${e}`;
|
|
54
62
|
}
|
|
55
|
-
function
|
|
56
|
-
let t =
|
|
63
|
+
function T(e) {
|
|
64
|
+
let t = h()?.getItem(e);
|
|
57
65
|
if (!t) return null;
|
|
58
66
|
try {
|
|
59
67
|
return JSON.parse(t);
|
|
60
68
|
} catch {
|
|
61
|
-
return
|
|
69
|
+
return h()?.removeItem(e), null;
|
|
62
70
|
}
|
|
63
71
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
72
|
+
function E(e, t) {
|
|
73
|
+
h()?.setItem(e, JSON.stringify(t));
|
|
66
74
|
}
|
|
67
|
-
function
|
|
75
|
+
function D(e, t) {
|
|
68
76
|
c.set(e, {
|
|
69
77
|
...c.get(e) ?? s,
|
|
70
78
|
...t
|
|
71
79
|
}), l.forEach((e) => e()), window.dispatchEvent(new CustomEvent(o));
|
|
72
80
|
}
|
|
73
|
-
function
|
|
81
|
+
function O(e) {
|
|
74
82
|
let t = "";
|
|
75
83
|
return e.forEach((e) => {
|
|
76
84
|
t += String.fromCharCode(e);
|
|
77
85
|
}), btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
78
86
|
}
|
|
79
|
-
function
|
|
87
|
+
function k(e = 32) {
|
|
80
88
|
let t = new Uint8Array(e);
|
|
81
|
-
return crypto.getRandomValues(t),
|
|
89
|
+
return crypto.getRandomValues(t), O(t);
|
|
82
90
|
}
|
|
83
|
-
async function
|
|
91
|
+
async function A(e) {
|
|
84
92
|
let t = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(e));
|
|
85
|
-
return
|
|
93
|
+
return O(new Uint8Array(t));
|
|
86
94
|
}
|
|
87
|
-
async function
|
|
95
|
+
async function j(e) {
|
|
88
96
|
let t = await fetch(`${e}/api/auth/.well-known/openid-configuration`);
|
|
89
97
|
if (!t.ok) throw Error("Manufact OAuth discovery failed");
|
|
90
98
|
return await t.json();
|
|
91
99
|
}
|
|
92
|
-
function
|
|
100
|
+
function M() {
|
|
93
101
|
return `${window.location.origin}${n()}/auth/callback`;
|
|
94
102
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
103
|
+
function N(e) {
|
|
104
|
+
return e === "localhost" || e === "127.0.0.1";
|
|
105
|
+
}
|
|
106
|
+
function P(e) {
|
|
107
|
+
try {
|
|
108
|
+
let t = new URL(e).hostname, n = typeof window < "u" ? new URL(window.location.href).hostname : "";
|
|
109
|
+
return N(t) && N(n);
|
|
110
|
+
} catch {
|
|
111
|
+
return !1;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function F(e, t, n) {
|
|
115
|
+
let r = new URL(`${e}/api/auth/oauth2/authorize`);
|
|
116
|
+
r.searchParams.set("response_type", "code"), r.searchParams.set("client_id", t), r.searchParams.set("redirect_uri", n), r.searchParams.set("scope", i), r.searchParams.set("code_challenge", await A(k(32))), r.searchParams.set("code_challenge_method", "S256"), r.searchParams.set("state", "client-probe"), r.searchParams.set("prompt", "none");
|
|
117
|
+
try {
|
|
118
|
+
let e = await fetch(r.toString(), {
|
|
119
|
+
method: "GET",
|
|
120
|
+
redirect: "manual",
|
|
121
|
+
credentials: "include"
|
|
122
|
+
}), t = e.headers.get("location") ?? "";
|
|
123
|
+
return t.includes("/auth/error") && t.includes("invalid_client") ? !1 : e.status >= 300 && e.status < 400 || e.type === "opaqueredirect" ? !!t && !t.includes("/auth/error") : !0;
|
|
124
|
+
} catch {
|
|
125
|
+
return !1;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
async function I(e, t) {
|
|
129
|
+
let n = M(), r = x(e, "client"), a = T(r), o = P(e);
|
|
130
|
+
if (!o && a?.client_id && a.redirect_uri === n) {
|
|
131
|
+
if (await F(e, a.client_id, n)) return a;
|
|
132
|
+
h()?.removeItem(r);
|
|
133
|
+
} else o && a?.client_id && h()?.removeItem(r);
|
|
98
134
|
if (!t.registration_endpoint) throw Error("Manufact OAuth registration is unavailable");
|
|
99
|
-
let
|
|
135
|
+
let s = await fetch(t.registration_endpoint, {
|
|
100
136
|
method: "POST",
|
|
101
137
|
headers: { "Content-Type": "application/json" },
|
|
102
138
|
body: JSON.stringify({
|
|
@@ -108,16 +144,16 @@ async function j(e, t) {
|
|
|
108
144
|
scope: i
|
|
109
145
|
})
|
|
110
146
|
});
|
|
111
|
-
if (!
|
|
112
|
-
let
|
|
113
|
-
if (!
|
|
114
|
-
let
|
|
115
|
-
...
|
|
147
|
+
if (!s.ok) throw Error("Could not register Inspector with Manufact");
|
|
148
|
+
let c = await s.json();
|
|
149
|
+
if (!c.client_id) throw Error("Manufact returned no OAuth client ID");
|
|
150
|
+
let l = {
|
|
151
|
+
...c,
|
|
116
152
|
redirect_uri: n
|
|
117
153
|
};
|
|
118
|
-
return
|
|
154
|
+
return E(r, l), l;
|
|
119
155
|
}
|
|
120
|
-
async function
|
|
156
|
+
async function L(e, t) {
|
|
121
157
|
let n = await fetch(e, {
|
|
122
158
|
method: "POST",
|
|
123
159
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
@@ -131,15 +167,15 @@ async function M(e, t) {
|
|
|
131
167
|
expires_at: Date.now() + (r.expires_in ?? 3600) * 1e3
|
|
132
168
|
};
|
|
133
169
|
}
|
|
134
|
-
async function
|
|
170
|
+
async function R(e, t) {
|
|
135
171
|
if (!t.refresh_token) return null;
|
|
136
172
|
let n = d.get(e);
|
|
137
173
|
if (n) return n;
|
|
138
174
|
let r = (async () => {
|
|
139
175
|
try {
|
|
140
|
-
let n = await
|
|
176
|
+
let n = await j(e), r = T(x(e, "client"));
|
|
141
177
|
if (!r?.client_id) return null;
|
|
142
|
-
let i = await
|
|
178
|
+
let i = await L(n.token_endpoint, {
|
|
143
179
|
grant_type: "refresh_token",
|
|
144
180
|
refresh_token: t.refresh_token,
|
|
145
181
|
client_id: r.client_id
|
|
@@ -147,21 +183,21 @@ async function N(e, t) {
|
|
|
147
183
|
...i,
|
|
148
184
|
refresh_token: i.refresh_token ?? t.refresh_token
|
|
149
185
|
};
|
|
150
|
-
return
|
|
186
|
+
return E(x(e, "tokens"), a), a;
|
|
151
187
|
} catch {
|
|
152
|
-
return
|
|
188
|
+
return h()?.removeItem(x(e, "tokens")), null;
|
|
153
189
|
} finally {
|
|
154
190
|
d.delete(e);
|
|
155
191
|
}
|
|
156
192
|
})();
|
|
157
193
|
return d.set(e, r), r;
|
|
158
194
|
}
|
|
159
|
-
async function
|
|
160
|
-
let t =
|
|
161
|
-
return t?.access_token ? t.expires_at > Date.now() + 3e4 ? t :
|
|
195
|
+
async function z(e) {
|
|
196
|
+
let t = T(x(e, "tokens"));
|
|
197
|
+
return t?.access_token ? t.expires_at > Date.now() + 3e4 ? t : R(e, t) : null;
|
|
162
198
|
}
|
|
163
|
-
async function
|
|
164
|
-
let n = await
|
|
199
|
+
async function B(e, t) {
|
|
200
|
+
let n = await j(e);
|
|
165
201
|
if (!n.userinfo_endpoint) return null;
|
|
166
202
|
let r = await fetch(n.userinfo_endpoint, { headers: { Authorization: `Bearer ${t}` } });
|
|
167
203
|
if (!r.ok) return null;
|
|
@@ -173,7 +209,7 @@ async function F(e, t) {
|
|
|
173
209
|
image: i.picture
|
|
174
210
|
} : null;
|
|
175
211
|
}
|
|
176
|
-
async function
|
|
212
|
+
async function V(e) {
|
|
177
213
|
try {
|
|
178
214
|
let t = await fetch(`${e}/api/auth/get-session`, { credentials: "include" });
|
|
179
215
|
return t.ok ? (await t.json())?.user ?? null : null;
|
|
@@ -181,7 +217,7 @@ async function I(e) {
|
|
|
181
217
|
return null;
|
|
182
218
|
}
|
|
183
219
|
}
|
|
184
|
-
async function
|
|
220
|
+
async function H(e) {
|
|
185
221
|
let t = u.get(e);
|
|
186
222
|
if (t) return t;
|
|
187
223
|
c.set(e, {
|
|
@@ -190,9 +226,9 @@ async function L(e) {
|
|
|
190
226
|
});
|
|
191
227
|
let n = (async () => {
|
|
192
228
|
try {
|
|
193
|
-
let t =
|
|
229
|
+
let t = _(typeof window < "u" ? window.location.href : e, e), n = S(e), r = await z(e), i = r ? await B(e, r.access_token) : null;
|
|
194
230
|
if (i && r) {
|
|
195
|
-
|
|
231
|
+
C(e, !1), D(e, {
|
|
196
232
|
loaded: !0,
|
|
197
233
|
accessToken: r.access_token,
|
|
198
234
|
user: i,
|
|
@@ -200,10 +236,10 @@ async function L(e) {
|
|
|
200
236
|
});
|
|
201
237
|
return;
|
|
202
238
|
}
|
|
203
|
-
r && !i &&
|
|
204
|
-
let a = t && !n ? await
|
|
239
|
+
r && !i && h()?.removeItem(x(e, "tokens"));
|
|
240
|
+
let a = t && !n ? await V(e) : null;
|
|
205
241
|
if (a) {
|
|
206
|
-
|
|
242
|
+
D(e, {
|
|
207
243
|
loaded: !0,
|
|
208
244
|
accessToken: null,
|
|
209
245
|
user: a,
|
|
@@ -211,14 +247,14 @@ async function L(e) {
|
|
|
211
247
|
});
|
|
212
248
|
return;
|
|
213
249
|
}
|
|
214
|
-
|
|
250
|
+
D(e, {
|
|
215
251
|
loaded: !0,
|
|
216
252
|
accessToken: null,
|
|
217
253
|
user: null,
|
|
218
254
|
mode: null
|
|
219
255
|
});
|
|
220
256
|
} catch {
|
|
221
|
-
|
|
257
|
+
D(e, {
|
|
222
258
|
loaded: !0,
|
|
223
259
|
accessToken: null,
|
|
224
260
|
user: null,
|
|
@@ -228,63 +264,63 @@ async function L(e) {
|
|
|
228
264
|
})().finally(() => u.delete(e));
|
|
229
265
|
return u.set(e, n), n;
|
|
230
266
|
}
|
|
231
|
-
async function
|
|
232
|
-
let
|
|
233
|
-
|
|
234
|
-
let
|
|
235
|
-
if (!
|
|
236
|
-
if (
|
|
237
|
-
|
|
267
|
+
async function U(e, t) {
|
|
268
|
+
let n = g(e);
|
|
269
|
+
f = e, C(n, !1);
|
|
270
|
+
let r = window.open("", "manufact-oauth", "width=600,height=700,resizable=yes,scrollbars=yes");
|
|
271
|
+
if (!r) throw Error("Allow popups to sign in with Manufact");
|
|
272
|
+
if (D(n, { authorizing: !0 }), _(window.location.href, n)) {
|
|
273
|
+
r.location.href = y(n);
|
|
238
274
|
let e = window.setInterval(async () => {
|
|
239
|
-
if (
|
|
240
|
-
window.clearInterval(e),
|
|
275
|
+
if (r.closed) {
|
|
276
|
+
window.clearInterval(e), D(n, { authorizing: !1 });
|
|
241
277
|
return;
|
|
242
278
|
}
|
|
243
|
-
let
|
|
244
|
-
|
|
279
|
+
let t = await V(n);
|
|
280
|
+
t && (window.clearInterval(e), r.close(), D(n, {
|
|
245
281
|
loaded: !0,
|
|
246
282
|
authorizing: !1,
|
|
247
283
|
accessToken: null,
|
|
248
|
-
user:
|
|
284
|
+
user: t,
|
|
249
285
|
mode: "session"
|
|
250
286
|
}));
|
|
251
287
|
}, 1e3);
|
|
252
288
|
return;
|
|
253
289
|
}
|
|
254
290
|
try {
|
|
255
|
-
let e = await
|
|
256
|
-
w(
|
|
257
|
-
authOrigin:
|
|
258
|
-
clientId:
|
|
291
|
+
let e = await j(n), t = await I(n, e), a = k(64), o = k(), s = M();
|
|
292
|
+
E(w(o), {
|
|
293
|
+
authOrigin: n,
|
|
294
|
+
clientId: t.client_id,
|
|
259
295
|
redirectUri: s,
|
|
260
296
|
codeVerifier: a,
|
|
261
297
|
expiresAt: Date.now() + 600 * 1e3
|
|
262
298
|
});
|
|
263
299
|
let c = new URL(e.authorization_endpoint);
|
|
264
|
-
c.searchParams.set("response_type", "code"), c.searchParams.set("client_id",
|
|
300
|
+
c.searchParams.set("response_type", "code"), c.searchParams.set("client_id", t.client_id), c.searchParams.set("redirect_uri", s), c.searchParams.set("scope", i), c.searchParams.set("state", o), c.searchParams.set("code_challenge", await A(a)), c.searchParams.set("code_challenge_method", "S256"), c.searchParams.set("prompt", "consent"), r.location.href = c.toString();
|
|
265
301
|
let l = window.setInterval(() => {
|
|
266
|
-
|
|
302
|
+
r.closed && (window.clearInterval(l), H(n).finally(() => D(n, { authorizing: !1 })));
|
|
267
303
|
}, 500);
|
|
268
304
|
} catch (e) {
|
|
269
|
-
throw
|
|
305
|
+
throw r.close(), D(n, { authorizing: !1 }), e;
|
|
270
306
|
}
|
|
271
307
|
}
|
|
272
|
-
async function
|
|
308
|
+
async function W(e = new URL(window.location.href)) {
|
|
273
309
|
let t = e.searchParams.get("state"), n = e.searchParams.get("code"), r = e.searchParams.get("error_description") ?? e.searchParams.get("error");
|
|
274
310
|
if (r) throw Error(r);
|
|
275
311
|
if (!t || !n) throw Error("Missing OAuth code or state");
|
|
276
|
-
let i =
|
|
277
|
-
if (
|
|
278
|
-
let o = await
|
|
312
|
+
let i = w(t), a = T(i);
|
|
313
|
+
if (h()?.removeItem(i), !a || a.expiresAt < Date.now()) throw Error("OAuth state is invalid or expired");
|
|
314
|
+
let o = await L((await j(a.authOrigin)).token_endpoint, {
|
|
279
315
|
grant_type: "authorization_code",
|
|
280
316
|
code: n,
|
|
281
317
|
redirect_uri: a.redirectUri,
|
|
282
318
|
client_id: a.clientId,
|
|
283
319
|
code_verifier: a.codeVerifier
|
|
284
320
|
});
|
|
285
|
-
|
|
286
|
-
let s = await
|
|
287
|
-
|
|
321
|
+
E(x(a.authOrigin, "tokens"), o), C(a.authOrigin, !1);
|
|
322
|
+
let s = await B(a.authOrigin, o.access_token);
|
|
323
|
+
D(a.authOrigin, {
|
|
288
324
|
loaded: !0,
|
|
289
325
|
authorizing: !1,
|
|
290
326
|
accessToken: o.access_token,
|
|
@@ -295,9 +331,9 @@ async function z(e = new URL(window.location.href)) {
|
|
|
295
331
|
authOrigin: a.authOrigin
|
|
296
332
|
}, window.location.origin);
|
|
297
333
|
}
|
|
298
|
-
function
|
|
299
|
-
let t =
|
|
300
|
-
|
|
334
|
+
function G(e) {
|
|
335
|
+
let t = g(e);
|
|
336
|
+
h()?.removeItem(x(t, "tokens")), D(t, {
|
|
301
337
|
loaded: !0,
|
|
302
338
|
authorizing: !1,
|
|
303
339
|
accessToken: null,
|
|
@@ -305,11 +341,11 @@ function B(e) {
|
|
|
305
341
|
mode: null
|
|
306
342
|
});
|
|
307
343
|
}
|
|
308
|
-
async function
|
|
309
|
-
let t =
|
|
344
|
+
async function K(e) {
|
|
345
|
+
let t = T(x(e, "tokens")), n = T(x(e, "client")), r = t?.refresh_token ?? t?.access_token;
|
|
310
346
|
if (!n?.client_id || !r) return null;
|
|
311
347
|
try {
|
|
312
|
-
let i = (await
|
|
348
|
+
let i = (await j(e)).revocation_endpoint ?? `${e}/api/auth/oauth2/revoke`;
|
|
313
349
|
return (await fetch(i, {
|
|
314
350
|
method: "POST",
|
|
315
351
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
@@ -323,8 +359,8 @@ async function V(e) {
|
|
|
323
359
|
return -1;
|
|
324
360
|
}
|
|
325
361
|
}
|
|
326
|
-
async function
|
|
327
|
-
let t =
|
|
362
|
+
async function q(e) {
|
|
363
|
+
let t = v(e), n = window.open(b(e), "manufact-sign-out", "width=420,height=320");
|
|
328
364
|
return n ? new Promise((r) => {
|
|
329
365
|
let i = !1, a = (e) => {
|
|
330
366
|
i || (i = !0, window.clearTimeout(o), window.clearInterval(c), window.removeEventListener("message", s), r(e));
|
|
@@ -341,7 +377,7 @@ async function H(e) {
|
|
|
341
377
|
signOutStatus: 200
|
|
342
378
|
});
|
|
343
379
|
}, c = window.setInterval(() => {
|
|
344
|
-
n.closed &&
|
|
380
|
+
n.closed && V(e).then((e) => {
|
|
345
381
|
a({
|
|
346
382
|
attempted: !0,
|
|
347
383
|
signOutOk: !e,
|
|
@@ -356,19 +392,19 @@ async function H(e) {
|
|
|
356
392
|
signOutStatus: null
|
|
357
393
|
};
|
|
358
394
|
}
|
|
359
|
-
async function
|
|
360
|
-
let n =
|
|
361
|
-
t === "oauth" || r ? (await
|
|
395
|
+
async function J(e, t) {
|
|
396
|
+
let n = g(e), r = !!T(x(n, "tokens"))?.access_token;
|
|
397
|
+
t === "oauth" || r ? (await K(n), C(n, !0)) : t === "session" && (await q(n), C(n, !1)), G(e);
|
|
362
398
|
}
|
|
363
|
-
function
|
|
364
|
-
let t = e ?
|
|
399
|
+
function Y(e) {
|
|
400
|
+
let t = e ? g(e) : null, n = (0, r.useSyncExternalStore)((0, r.useCallback)((e) => (l.add(e), () => l.delete(e)), []), (0, r.useCallback)(() => t ? m(t) : s, [t]), () => s);
|
|
365
401
|
return (0, r.useEffect)(() => {
|
|
366
402
|
if (!t) return;
|
|
367
|
-
|
|
403
|
+
H(t);
|
|
368
404
|
let e = (e) => {
|
|
369
|
-
e.origin === window.location.origin && e.data?.type === "manufact:oauth-complete" && e.data.authOrigin === t &&
|
|
405
|
+
e.origin === window.location.origin && e.data?.type === "manufact:oauth-complete" && e.data.authOrigin === t && H(t).finally(() => D(t, { authorizing: !1 }));
|
|
370
406
|
}, n = (e) => {
|
|
371
|
-
e.key !==
|
|
407
|
+
e.key !== x(t, "tokens") || !e.newValue || H(t).finally(() => D(t, { authorizing: !1 }));
|
|
372
408
|
};
|
|
373
409
|
return window.addEventListener("message", e), window.addEventListener("storage", n), () => {
|
|
374
410
|
window.removeEventListener("message", e), window.removeEventListener("storage", n);
|
|
@@ -376,12 +412,12 @@ function W(e) {
|
|
|
376
412
|
}, [t]), {
|
|
377
413
|
...n,
|
|
378
414
|
authorize: (0, r.useCallback)(async () => {
|
|
379
|
-
e && await
|
|
415
|
+
e && await U(e);
|
|
380
416
|
}, [e]),
|
|
381
417
|
logout: (0, r.useCallback)(async () => {
|
|
382
|
-
e && await
|
|
418
|
+
e && await J(e, n.mode);
|
|
383
419
|
}, [e, n.mode])
|
|
384
420
|
};
|
|
385
421
|
}
|
|
386
422
|
//#endregion
|
|
387
|
-
export {
|
|
423
|
+
export { Y as n, W as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Rr as e } from "./input-C2OBd4PJ.js";
|
|
2
|
+
import { t } from "./jsx-runtime-CIxvMpEo.js";
|
|
3
3
|
//#region src/client/components/ui/not-found.tsx
|
|
4
|
-
var n =
|
|
5
|
-
function r({ message:
|
|
4
|
+
var n = t();
|
|
5
|
+
function r({ message: t, className: r = "", vertical: i, noBorder: a }) {
|
|
6
6
|
return /* @__PURE__ */ (0, n.jsx)("div", {
|
|
7
|
-
className:
|
|
7
|
+
className: e(`mt-2 rounded-md p-6 ${r}`, !a && "border"),
|
|
8
8
|
children: /* @__PURE__ */ (0, n.jsxs)("p", {
|
|
9
|
-
className:
|
|
9
|
+
className: e("text-sm text-muted-foreground flex items-center gap-4", i && "flex-col"),
|
|
10
10
|
children: [/* @__PURE__ */ (0, n.jsxs)("svg", {
|
|
11
11
|
width: "40",
|
|
12
12
|
height: "40",
|
|
@@ -26,7 +26,7 @@ function r({ message: e, className: r = "", vertical: i, noBorder: a }) {
|
|
|
26
26
|
}),
|
|
27
27
|
/* @__PURE__ */ (0, n.jsx)("path", { d: "M500 100.426C500 155.889 455.037 200.851 399.574 200.851C344.11 200.851 299.148 155.889 299.148 100.426C299.148 44.962 344.11 0 399.574 0C455.037 0 500 44.962 500 100.426Z" })
|
|
28
28
|
]
|
|
29
|
-
}),
|
|
29
|
+
}), t]
|
|
30
30
|
})
|
|
31
31
|
});
|
|
32
32
|
}
|