@dexterai/connect 0.25.0 → 0.25.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/dist/react.d.ts +2 -1
- package/dist/react.js +147 -35
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -268,7 +268,8 @@ interface AppInstallButtonsProps {
|
|
|
268
268
|
declare function cursorInstallUrl(name: string, mcpUrl: string): string;
|
|
269
269
|
declare function vscodeInstallUrl(name: string, mcpUrl: string): string;
|
|
270
270
|
declare function hermesInstallCommand(name: string, mcpUrl: string): string;
|
|
271
|
+
declare function hermesOpenUrl(name: string): string;
|
|
271
272
|
declare function claudeCodeInstallCommand(name: string, mcpUrl: string): string;
|
|
272
273
|
declare function AppInstallButtons(props: AppInstallButtonsProps): ReactElement;
|
|
273
274
|
|
|
274
|
-
export { AllowanceChips, type AllowanceChipsProps, AppInstallButtons, type AppInstallButtonsProps, type ConnectStatus, CreateWalletPanel, type CreateWalletPanelProps, DexterButton, type DexterButtonProps, DexterMark, DexterWalletChip, type DexterWalletChipProps, DexterWalletMenu, type DexterWalletMenuProps, type InstallApp, RecoverOutcome, SignInWithDexter, type SignInWithDexterProps, type UseDexterWallet, type UseIdentityConfig, type UseSignInWithDexter, type UseSignInWithDexterConfig, claudeCodeInstallCommand, cursorInstallUrl, hermesInstallCommand, useDexterWallet, useIdentity, useSignInWithDexter, vscodeInstallUrl };
|
|
275
|
+
export { AllowanceChips, type AllowanceChipsProps, AppInstallButtons, type AppInstallButtonsProps, type ConnectStatus, CreateWalletPanel, type CreateWalletPanelProps, DexterButton, type DexterButtonProps, DexterMark, DexterWalletChip, type DexterWalletChipProps, DexterWalletMenu, type DexterWalletMenuProps, type InstallApp, RecoverOutcome, SignInWithDexter, type SignInWithDexterProps, type UseDexterWallet, type UseIdentityConfig, type UseSignInWithDexter, type UseSignInWithDexterConfig, claudeCodeInstallCommand, cursorInstallUrl, hermesInstallCommand, hermesOpenUrl, useDexterWallet, useIdentity, useSignInWithDexter, vscodeInstallUrl };
|
package/dist/react.js
CHANGED
|
@@ -683,7 +683,7 @@ function CreateWalletPanel(props) {
|
|
|
683
683
|
}
|
|
684
684
|
|
|
685
685
|
// src/AppInstallButtons.tsx
|
|
686
|
-
import { useEffect as useEffect8,
|
|
686
|
+
import { useEffect as useEffect8, useId, useState as useState6 } from "react";
|
|
687
687
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
688
688
|
var STYLE_ID3 = "dexter-connect-appinstall-styles";
|
|
689
689
|
var APPINSTALL_CSS = `
|
|
@@ -691,22 +691,70 @@ var APPINSTALL_CSS = `
|
|
|
691
691
|
.dx-appinstall--block{ flex-direction:column; }
|
|
692
692
|
.dx-appbtn{
|
|
693
693
|
display:inline-flex; align-items:center; gap:10px;
|
|
694
|
-
padding:10px 16px; border:1px solid var(--dx-appbtn-border, rgba(255,255,255,.14));
|
|
694
|
+
min-height:44px; padding:10px 16px; border:1px solid var(--dx-appbtn-border, rgba(255,255,255,.14));
|
|
695
695
|
border-radius:var(--dx-radius,0px);
|
|
696
696
|
background:var(--dx-appbtn-bg, rgba(8,8,8,.55));
|
|
697
697
|
color:var(--dx-appbtn-fg, #f4ece0); font:inherit; font-weight:600; font-size:.84rem;
|
|
698
698
|
cursor:pointer; text-decoration:none; -webkit-tap-highlight-color:transparent;
|
|
699
|
-
transition:border-color .
|
|
699
|
+
transition:border-color .1s ease-out, background-color .1s ease-out, transform .1s ease-out;
|
|
700
|
+
}
|
|
701
|
+
.dx-appbtn:active{ transform:translateY(1px); }
|
|
702
|
+
.dx-appbtn:disabled{ cursor:wait; opacity:.72; transform:none; }
|
|
703
|
+
.dx-appbtn:focus-visible{
|
|
704
|
+
outline:2px solid var(--dx-ember,#f26c18); outline-offset:3px;
|
|
700
705
|
}
|
|
701
|
-
.dx-appbtn:hover{ border-color:color-mix(in srgb,var(--dx-ember,#f26c18) 55%,transparent); transform:translateY(-1px); }
|
|
702
|
-
.dx-appbtn:active{ transform:translateY(0); }
|
|
703
|
-
.dx-appbtn:focus-visible{ outline:none; box-shadow:0 0 0 3px color-mix(in srgb,var(--dx-ember,#f26c18) 38%,transparent); }
|
|
704
706
|
.dx-appbtn--block{ width:100%; justify-content:flex-start; }
|
|
705
707
|
.dx-appbtn__logo{
|
|
706
708
|
width:22px; height:22px; display:block; flex:none; box-sizing:border-box;
|
|
707
709
|
background:#fff; padding:3px; border-radius:var(--dx-radius,0px);
|
|
708
710
|
}
|
|
709
711
|
.dx-appbtn__copied{ color:var(--dx-ember,#f26c18); }
|
|
712
|
+
.dx-appinstall__notice{
|
|
713
|
+
flex-basis:100%; display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px;
|
|
714
|
+
color:var(--dx-appbtn-fg,#f4ece0); font:inherit; font-size:.82rem; line-height:1.45;
|
|
715
|
+
}
|
|
716
|
+
.dx-appinstall__notice p{ margin:0; }
|
|
717
|
+
.dx-appinstall__open{
|
|
718
|
+
display:inline-flex; align-items:center; min-height:44px; padding:0 10px;
|
|
719
|
+
color:var(--dx-ember,#f26c18); font-weight:700; text-underline-offset:3px;
|
|
720
|
+
}
|
|
721
|
+
.dx-appinstall__open:focus-visible{
|
|
722
|
+
outline:2px solid var(--dx-ember,#f26c18); outline-offset:3px;
|
|
723
|
+
}
|
|
724
|
+
.dx-appinstall__error{
|
|
725
|
+
flex-basis:100%; display:grid; gap:8px; margin:0;
|
|
726
|
+
color:var(--dx-danger,#e5552e); font:inherit; font-size:.82rem; line-height:1.45;
|
|
727
|
+
}
|
|
728
|
+
.dx-appinstall__error label{ font-weight:700; }
|
|
729
|
+
.dx-appinstall__command{
|
|
730
|
+
width:100%; min-height:44px; box-sizing:border-box; padding:10px 12px;
|
|
731
|
+
border:1px solid color-mix(in srgb,var(--dx-danger,#e5552e) 55%,transparent);
|
|
732
|
+
border-radius:var(--dx-radius,0px); background:var(--dx-appbtn-bg,rgba(8,8,8,.55));
|
|
733
|
+
color:var(--dx-appbtn-fg,#f4ece0); font:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
|
|
734
|
+
font-size:.78rem;
|
|
735
|
+
}
|
|
736
|
+
.dx-appinstall__command:focus-visible{
|
|
737
|
+
outline:2px solid var(--dx-ember,#f26c18); outline-offset:3px;
|
|
738
|
+
}
|
|
739
|
+
.dx-appinstall__sr-only{
|
|
740
|
+
position:absolute; width:1px; height:1px; padding:0; margin:-1px;
|
|
741
|
+
overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
|
|
742
|
+
}
|
|
743
|
+
@media (hover:hover) and (pointer:fine){
|
|
744
|
+
.dx-appbtn:hover{
|
|
745
|
+
border-color:color-mix(in srgb,var(--dx-ember,#f26c18) 55%,transparent);
|
|
746
|
+
transform:translateY(-1px);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
@media (max-width:560px){
|
|
750
|
+
.dx-appinstall{ display:grid; grid-template-columns:minmax(0,1fr); }
|
|
751
|
+
.dx-appbtn{ width:100%; justify-content:flex-start; }
|
|
752
|
+
.dx-appinstall__notice,.dx-appinstall__error{ min-width:0; }
|
|
753
|
+
}
|
|
754
|
+
@media (prefers-reduced-motion:reduce){
|
|
755
|
+
.dx-appbtn{ transition:none; }
|
|
756
|
+
.dx-appbtn:hover,.dx-appbtn:active{ transform:none; }
|
|
757
|
+
}
|
|
710
758
|
`;
|
|
711
759
|
function ensureAppInstallStyles() {
|
|
712
760
|
if (typeof document === "undefined") return;
|
|
@@ -731,10 +779,13 @@ function vscodeInstallUrl(name, mcpUrl) {
|
|
|
731
779
|
return `vscode:mcp/install?${encodeURIComponent(JSON.stringify({ name, type: "http", url: mcpUrl }))}`;
|
|
732
780
|
}
|
|
733
781
|
function hermesInstallCommand(name, mcpUrl) {
|
|
734
|
-
return `hermes mcp add ${name} --url ${mcpUrl}`;
|
|
782
|
+
return `hermes mcp add ${name} --url ${mcpUrl} --auth oauth`;
|
|
783
|
+
}
|
|
784
|
+
function hermesOpenUrl(name) {
|
|
785
|
+
return `hermes://open/${encodeURIComponent(name)}`;
|
|
735
786
|
}
|
|
736
787
|
function claudeCodeInstallCommand(name, mcpUrl) {
|
|
737
|
-
return `claude mcp add --transport http ${name} ${mcpUrl}`;
|
|
788
|
+
return `claude mcp add --scope user --transport http ${name} ${mcpUrl}`;
|
|
738
789
|
}
|
|
739
790
|
async function copyText(text) {
|
|
740
791
|
try {
|
|
@@ -744,23 +795,9 @@ async function copyText(text) {
|
|
|
744
795
|
return false;
|
|
745
796
|
}
|
|
746
797
|
}
|
|
747
|
-
function
|
|
748
|
-
const [
|
|
749
|
-
|
|
750
|
-
useEffect8(
|
|
751
|
-
() => () => {
|
|
752
|
-
if (timer.current) clearTimeout(timer.current);
|
|
753
|
-
},
|
|
754
|
-
[]
|
|
755
|
-
);
|
|
756
|
-
return [
|
|
757
|
-
copied,
|
|
758
|
-
() => {
|
|
759
|
-
setCopied(true);
|
|
760
|
-
if (timer.current) clearTimeout(timer.current);
|
|
761
|
-
timer.current = setTimeout(() => setCopied(false), 2600);
|
|
762
|
-
}
|
|
763
|
-
];
|
|
798
|
+
function useCopyStatus() {
|
|
799
|
+
const [status, setStatus] = useState6("idle");
|
|
800
|
+
return [status, (next) => setStatus(next)];
|
|
764
801
|
}
|
|
765
802
|
function appCx(block) {
|
|
766
803
|
return block ? "dx-appbtn dx-appbtn--block" : "dx-appbtn";
|
|
@@ -775,8 +812,13 @@ function AppInstallButtons(props) {
|
|
|
775
812
|
onAction
|
|
776
813
|
} = props;
|
|
777
814
|
useEffect8(ensureAppInstallStyles, []);
|
|
778
|
-
const
|
|
779
|
-
const
|
|
815
|
+
const statusId = useId();
|
|
816
|
+
const hermesCommand = hermesInstallCommand(serverName, mcpUrl);
|
|
817
|
+
const claudeCommand = claudeCodeInstallCommand(serverName, mcpUrl);
|
|
818
|
+
const [hermesStatus, markHermes] = useCopyStatus();
|
|
819
|
+
const [claudeStatus, markClaude] = useCopyStatus();
|
|
820
|
+
const hermesErrorId = `${statusId}-hermes-error`;
|
|
821
|
+
const claudeErrorId = `${statusId}-claude-error`;
|
|
780
822
|
const buttons = {
|
|
781
823
|
cursor: /* @__PURE__ */ jsxs6(
|
|
782
824
|
"a",
|
|
@@ -809,16 +851,21 @@ function AppInstallButtons(props) {
|
|
|
809
851
|
{
|
|
810
852
|
type: "button",
|
|
811
853
|
className: appCx(block),
|
|
854
|
+
disabled: hermesStatus === "copying",
|
|
855
|
+
"aria-busy": hermesStatus === "copying",
|
|
856
|
+
"aria-describedby": hermesStatus === "failed" ? hermesErrorId : void 0,
|
|
812
857
|
onClick: async () => {
|
|
813
|
-
|
|
814
|
-
|
|
858
|
+
markHermes("copying");
|
|
859
|
+
if (await copyText(hermesCommand)) {
|
|
860
|
+
markHermes("copied");
|
|
815
861
|
onAction?.("hermes", "copied");
|
|
862
|
+
} else {
|
|
863
|
+
markHermes("failed");
|
|
816
864
|
}
|
|
817
|
-
window.location.href = `hermes://open/${encodeURIComponent(serverName)}`;
|
|
818
865
|
},
|
|
819
866
|
children: [
|
|
820
867
|
/* @__PURE__ */ jsx6("img", { className: "dx-appbtn__logo", src: HERMES_MARK, alt: "", "aria-hidden": true }),
|
|
821
|
-
|
|
868
|
+
hermesStatus === "copied" ? /* @__PURE__ */ jsx6("span", { className: "dx-appbtn__copied", children: "Copied. Run it in your terminal" }) : hermesStatus === "copying" ? "Copying OAuth setup\u2026" : hermesStatus === "failed" ? "Try copying for Hermes" : "Copy OAuth setup for Hermes"
|
|
822
869
|
]
|
|
823
870
|
},
|
|
824
871
|
"hermes"
|
|
@@ -828,21 +875,85 @@ function AppInstallButtons(props) {
|
|
|
828
875
|
{
|
|
829
876
|
type: "button",
|
|
830
877
|
className: appCx(block),
|
|
878
|
+
disabled: claudeStatus === "copying",
|
|
879
|
+
"aria-busy": claudeStatus === "copying",
|
|
880
|
+
"aria-describedby": claudeStatus === "failed" ? claudeErrorId : void 0,
|
|
831
881
|
onClick: async () => {
|
|
832
|
-
|
|
833
|
-
|
|
882
|
+
markClaude("copying");
|
|
883
|
+
if (await copyText(claudeCommand)) {
|
|
884
|
+
markClaude("copied");
|
|
834
885
|
onAction?.("claude-code", "copied");
|
|
886
|
+
} else {
|
|
887
|
+
markClaude("failed");
|
|
835
888
|
}
|
|
836
889
|
},
|
|
837
890
|
children: [
|
|
838
891
|
/* @__PURE__ */ jsx6("img", { className: "dx-appbtn__logo", src: CLAUDE_MARK, alt: "", "aria-hidden": true }),
|
|
839
|
-
|
|
892
|
+
claudeStatus === "copied" ? /* @__PURE__ */ jsx6("span", { className: "dx-appbtn__copied", children: "Copied. Run it in your terminal" }) : claudeStatus === "copying" ? "Copying setup\u2026" : claudeStatus === "failed" ? "Try copying for Claude Code" : "Copy for Claude Code"
|
|
840
893
|
]
|
|
841
894
|
},
|
|
842
895
|
"claude-code"
|
|
843
896
|
)
|
|
844
897
|
};
|
|
845
|
-
return /* @__PURE__ */
|
|
898
|
+
return /* @__PURE__ */ jsxs6(
|
|
899
|
+
"div",
|
|
900
|
+
{
|
|
901
|
+
className: ["dx-appinstall", block ? "dx-appinstall--block" : "", className ?? ""].filter(Boolean).join(" "),
|
|
902
|
+
role: "group",
|
|
903
|
+
"aria-label": `Add ${serverName} to an agent app`,
|
|
904
|
+
children: [
|
|
905
|
+
apps.map((app) => buttons[app] ?? null),
|
|
906
|
+
/* @__PURE__ */ jsx6("span", { className: "dx-appinstall__sr-only", "aria-live": "polite", "aria-atomic": "true", children: [
|
|
907
|
+
hermesStatus === "copied" ? "Hermes OAuth setup command copied." : "",
|
|
908
|
+
claudeStatus === "copied" ? "Claude Code setup command copied." : ""
|
|
909
|
+
].filter(Boolean).join(" ") }),
|
|
910
|
+
hermesStatus === "copied" ? /* @__PURE__ */ jsxs6("div", { className: "dx-appinstall__notice", children: [
|
|
911
|
+
/* @__PURE__ */ jsx6("p", { children: "Run the command in your terminal. It adds the hosted MCP with OAuth." }),
|
|
912
|
+
/* @__PURE__ */ jsx6(
|
|
913
|
+
"a",
|
|
914
|
+
{
|
|
915
|
+
className: "dx-appinstall__open",
|
|
916
|
+
href: hermesOpenUrl(serverName),
|
|
917
|
+
tabIndex: 0,
|
|
918
|
+
onClick: () => onAction?.("hermes", "deeplink"),
|
|
919
|
+
children: "Open Hermes"
|
|
920
|
+
}
|
|
921
|
+
)
|
|
922
|
+
] }) : null,
|
|
923
|
+
hermesStatus === "failed" ? /* @__PURE__ */ jsxs6("div", { id: hermesErrorId, className: "dx-appinstall__error", role: "alert", children: [
|
|
924
|
+
/* @__PURE__ */ jsx6("label", { htmlFor: `${hermesErrorId}-command`, children: "Couldn't copy. Select this Hermes command and run it in your terminal." }),
|
|
925
|
+
/* @__PURE__ */ jsx6(
|
|
926
|
+
"input",
|
|
927
|
+
{
|
|
928
|
+
id: `${hermesErrorId}-command`,
|
|
929
|
+
className: "dx-appinstall__command",
|
|
930
|
+
readOnly: true,
|
|
931
|
+
value: hermesCommand,
|
|
932
|
+
onFocus: (event) => event.currentTarget.select()
|
|
933
|
+
}
|
|
934
|
+
)
|
|
935
|
+
] }) : null,
|
|
936
|
+
claudeStatus === "copied" ? /* @__PURE__ */ jsx6("div", { className: "dx-appinstall__notice", children: /* @__PURE__ */ jsxs6("p", { children: [
|
|
937
|
+
"Run the command in your terminal. If sign-in is required, finish it from Claude Code's ",
|
|
938
|
+
/* @__PURE__ */ jsx6("code", { children: "/mcp" }),
|
|
939
|
+
" menu."
|
|
940
|
+
] }) }) : null,
|
|
941
|
+
claudeStatus === "failed" ? /* @__PURE__ */ jsxs6("div", { id: claudeErrorId, className: "dx-appinstall__error", role: "alert", children: [
|
|
942
|
+
/* @__PURE__ */ jsx6("label", { htmlFor: `${claudeErrorId}-command`, children: "Couldn't copy. Select this Claude Code command and run it in your terminal." }),
|
|
943
|
+
/* @__PURE__ */ jsx6(
|
|
944
|
+
"input",
|
|
945
|
+
{
|
|
946
|
+
id: `${claudeErrorId}-command`,
|
|
947
|
+
className: "dx-appinstall__command",
|
|
948
|
+
readOnly: true,
|
|
949
|
+
value: claudeCommand,
|
|
950
|
+
onFocus: (event) => event.currentTarget.select()
|
|
951
|
+
}
|
|
952
|
+
)
|
|
953
|
+
] }) : null
|
|
954
|
+
]
|
|
955
|
+
}
|
|
956
|
+
);
|
|
846
957
|
}
|
|
847
958
|
export {
|
|
848
959
|
AllowanceChips,
|
|
@@ -856,6 +967,7 @@ export {
|
|
|
856
967
|
claudeCodeInstallCommand,
|
|
857
968
|
cursorInstallUrl,
|
|
858
969
|
hermesInstallCommand,
|
|
970
|
+
hermesOpenUrl,
|
|
859
971
|
useDexterWallet,
|
|
860
972
|
useIdentity,
|
|
861
973
|
useSignInWithDexter,
|