PageSourceSearch

https://black-ice.ai/assets/IntegrationsMcp-LfGK71qG.js

js black-ice.ai collected 2026-10-05 13:08:11 UTC 14,728 bytes, 1 lines download raw bytes

1import{j as e,r as s,L as t,k as a}from"./react-vendor-DhSP975V.js";import{H as r}from"./Header-Cs9IpE4J.js";import{u as i,B as c,a as n}from"./index-BRTDjk9K.js";import{u as o}from"./use-toast-VS3PAP1g.js";import{b as l,u as d,c as m}from"./query-vendor-n0_7bG_F.js";import{S as u}from"./switch-v4UFVtl2.js";import{L as p}from"./label-CGScN9or.js";import{s as x}from"./client-dIm-I_1l.js";import{u as h}from"./formatDistanceToNow-Dg-DDeOJ.js";import{u as g}from"./useWorkspaceRole-CpKppsdU.js";import{L as j,v as f,l as b,a6 as k,aM as _,au as v,aB as y,U as N,J as M,p as w}from"./icons-vendor-DGAlFwT6.js";import{T as K}from"./Trans-DnhvXxtZ.js";import{B as S}from"./badge-BM65uDYM.js";import{S as z}from"./skeleton-xarS4TZU.js";import"./input-CD1u45TZ.js";import"./useAuth-B7Ivpqlt.js";import"./ui-vendor-DdP2sx6P.js";import"./supabase-vendor-BlcNSqHb.js";import"./AppProtected-LVckdBot.js";import"./links-DS6srBkI.js";import"./useSubscription-B5rmSgxu.js";import"./dialog-BJz8_4t4.js";import"./select-DcZ5m3oV.js";import"./alert-dialog-DE5qkilm.js";import"./useWorkspaceMembers-CJUde1Hy.js";function A(){const{t:s}=i("integrations"),{toast:t}=o(),a=l(),{activeWorkspace:r}=h(),{canManage:c}=g(),n=(null==r?void 0:r.id)??null,j=["mcp-suggestions-enabled",n],{data:f=!1,isLoading:b}=d({queryKey:j,enabled:!!n,queryFn:async()=>{const{data:e,error:s}=await x.from("workspaces").select("mcp_candidate_suggestions_enabled").eq("id",n).maybeSingle();if(s)throw s;return!!(null==e?void 0:e.mcp_candidate_suggestions_enabled)}}),k=m({mutationFn:async e=>{const{error:s}=await x.rpc("set_mcp_candidate_suggestions",{_workspace_id:n,_enabled:e});if(s)throw s;return e},onSuccess:e=>{a.setQueryData(j,e),t({title:s(e?"claudeMcp.suggestions.turnedOn":"claudeMcp.suggestions.turnedOff")})},onError:e=>t({title:s("claudeMcp.suggestions.error"),description:e.message,variant:"destructive"})});return n?e.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-2",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"mcp-suggestions",className:"text-sm font-medium text-foreground",children:s("claudeMcp.suggestions.title")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("claudeMcp.suggestions.body")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s(f?"claudeMcp.suggestions.stateOn":"claudeMcp.suggestions.stateOff")}),!c&&e.jsx("p",{className:"text-xs text-muted-foreground italic",children:s("claudeMcp.suggestions.managersOnly")})]}),e.jsx(u,{id:"mcp-suggestions",checked:f,disabled:!c||b||k.isPending,onCheckedChange:e=>k.mutate(e)})]})}):null}function C({status:s,label:t,detail:a}){const r="pass"===s?f:"fail"===s?b:k,i="pass"===s?"text-primary":"fail"===s?"text-destructive":"text-muted-foreground";return e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(r,{className:`w-4 h-4 mt-0.5 shrink-0 ${i}`}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-foreground",children:t}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a})]})]})}function O(){const{t:t}=i("integrations"),{activeWorkspace:a}=h(),[r,n]=s.useState(!1),[o,l]=s.useState(null),[d,m]=s.useState(!1),u=null==a?void 0:a.id;if(!u)return null;const p=!!o&&(o.signIns>0||o.writeKeys>0),g=!!o&&o.enabled&&p,f=[];return o&&(o.enabled||f.push(t("claudeMcp.check.fix.turnOn")),p||f.push(o.readKeys>0?t("claudeMcp.check.fix.readOnlyKey"):t("claudeMcp.check.fix.connect")),f.push(t("claudeMcp.check.fix.role"),t("claudeMcp.check.fix.refresh"))),e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:t("claudeMcp.check.title")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("claudeMcp.check.body")})]}),e.jsxs(c,{size:"sm",variant:"outline",onClick:async()=>{var e;if(u){n(!0),m(!1);try{const[s,t,a]=await Promise.all([x.from("workspaces").select("mcp_candidate_suggestions_enabled").eq("id",u).maybeSingle(),x.from("mcp_oauth_tokens").select("id, refresh_expires_at").eq("workspace_id",u).is("revoked_at",null),x.from("workspace_api_keys").select("id, scope").eq("workspace_id",u)]);if(s.error||t.error||a.error)throw new Error("check failed");const r=Date.now(),i=(t.data??[]).filter(e=>!e.refresh_expires_at||new Date(e.refresh_expires_at).getTime()>r).length,c=(a.data??[]).filter(e=>"read_write"===e.scope).length,n=(a.data??[]).length-c;l({enabled:!!(null==(e=s.data)?void 0:e.mcp_candidate_suggestions_enabled),signIns:i,writeKeys:c,readKeys:n})}catch{m(!0),l(null)}finally{n(!1)}}},disabled:r,children:[r&&e.jsx(j,{className:"w-3 h-3 mr-1 animate-spin"}
1),t(o?"claudeMcp.check.rerun":"claudeMcp.check.run")]})]}),d&&e.jsx("p",{className:"text-xs text-destructive",children:t("claudeMcp.check.error")}),o&&e.jsxs(e.Fragment,{children:[e.jsxs("ul",{className:"space-y-2",children:[e.jsx(C,{status:o.enabled?"pass":"fail",label:t("claudeMcp.check.switchLabel"),detail:o.enabled?t("claudeMcp.check.switchOn"):t("claudeMcp.check.switchOff")}),e.jsx(C,{status:p?"pass":"fail",label:t("claudeMcp.check.credLabel"),detail:t("claudeMcp.check.credDetail",{signIns:o.signIns,writeKeys:o.writeKeys,readKeys:o.readKeys})})]}),e.jsx("p",{className:"text-sm font-medium "+(g?"text-primary":"text-destructive"),children:t(g?"claudeMcp.check.available":"claudeMcp.check.unavailable")}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-foreground",children:t(g?"claudeMcp.check.stillMissing":"claudeMcp.check.troubleshoot")}),e.jsx("ol",{className:"text-xs text-muted-foreground list-decimal pl-5 space-y-1",children:f.map(s=>e.jsx("li",{children:s},s))})]})]})]})}function q({onOpenApiKeys:s,onNavigate:a}){const{t:r}=i("integrations"),{toast:n}=o(),l="https://mcp.black-ice.ai/mcp?apikey=bice_YOUR_KEY_HERE",d=JSON.stringify({mcpServers:{"black-ice":{url:l}}},null,2),m=(e,s)=>{navigator.clipboard.writeText(e),n({title:r("claudeMcp.toasts.copiedLabel",{label:s})})};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:r("claudeMcp.endpoint.title")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-xs bg-muted px-2 py-1 rounded flex-1 truncate",children:l}),e.jsx(c,{variant:"ghost",size:"icon",onClick:()=>m(l,r("claudeMcp.toasts.endpoint")),children:e.jsx(_,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:e.jsx(K,{i18nKey:"claudeMcp.endpoint.description",ns:"integrations",components:[e.jsx("code",{className:"bg-muted px-1 rounded"},"0"),e.jsx("code",{className:"bg-muted px-1 rounded"},"1")]})})]}),e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-3",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:r("claudeMcp.quickStart.title")}),e.jsxs("ol",{className:"text-sm text-muted-foreground space-y-2 list-decimal pl-5",children:[e.jsx("li",{children:e.jsx(K,{i18nKey:"claudeMcp.quickStart.step1",ns:"integrations",components:[e.jsx("button",{className:"text-primary underline-offset-2 hover:underline",onClick:()=>{null==a||a(),s()}},"0")]})}),e.jsx("li",{children:e.jsx(K,{i18nKey:"claudeMcp.quickStart.step2",ns:"integrations",components:[e.jsx("strong",{},"0"),e.jsx("code",{className:"bg-muted px-1 rounded"},"1")]})}),e.jsx("li",{children:e.jsx(K,{i18nKey:"claudeMcp.quickStart.step3",ns:"integrations",components:[e.jsx("em",{},"0")]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1",children:e.jsx(K,{i18nKey:"claudeMcp.quickStart.otherClients",ns:"integrations",components:[e.jsx("strong",{},"0"),e.jsx("code",{className:"bg-muted px-1 rounded"},"1"),e.jsx("code",{className:"bg-muted px-1 rounded"},"2")]})})]}),e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-2",children:[e.jsxs("p",{className:"text-sm font-medium text-foreground flex items-center gap-1",children:[e.jsx(v,{className:"w-4 h-4"})," ",r("claudeMcp.config.title")]}),e.jsx("pre",{className:"text-xs bg-background border rounded p-2 overflow-x-auto whitespace-pre-wrap break-all",children:d}),e.jsxs(c,{variant:"ghost",size:"sm",className:"text-xs",onClick:()=>m(d,r("claudeMcp.toasts.config")),children:[e.jsx(_,{className:"w-3 h-3 mr-1"})," ",r("claudeMcp.config.copy")]})]}),e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:r("claudeMcp.tools.title")}),e.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1 list-disc pl-5",children:[e.jsx("li",{children:e.jsx(K,{i18nKey:"claudeMcp.tools.checkTerm",ns:"integrations",components:[e.jsx("code",{},"0")]})}),e.jsx("li",{children:e.jsx(K,{i18nKey:"claudeMcp.tools.validateTranslation",ns:"integrations",components:[e.jsx("code",{},"0")]})}),e.jsx("li",{children:e.jsx(K,{i18nKey:"claudeMcp.tools.checkMarketAvailability",ns:"integrations",components:[e.jsx("code",{},"0")]})}),e.jsx("li",{children:e.jsx(K,{i18nKey:"claudeMcp.tools.listConcepts",ns:"integrations",components:[e.jsx("code",{},"0")]})}),e.jsx("li",{children:e.jsx(K,{i18nKey:"claudeMcp.tools.listClasses",ns:"integrations",components:[e.jsx("code",{},"0")]})}),e.jsx("li",{children:e.jsx(K,{i18nKey:"claudeMcp.tools.listRelationships",ns:"integrations",components:[e.jsx("code",{},"0")]})}),e.jsx("li",{children:e.jsx(K,{i18nKey:"claudeMcp.tools.getMarketProfile",ns:"integrations",components:[e.jsx("code",{},"0")]})}),e.jsx("li",{children:e.jsx(K,{i18nKey:"claudeMcp.tools.suggestCandidates",ns:"integrations",components:[e.jsx("code",{},"0")]})})]})]}),e.jsx(A,{}),e.jsx(O,{}),e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:r("claudeMcp.rateLimits.title")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r("claudeMcp.rateLimits.body")}),e.jsxs(t,{to:"/docs/integrations/rate-limits",onClick:a,className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[e.jsx(y,{className:"w-3 h-3"}
1)," ",r("claudeMcp.rateLimits.link")]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(c,{asChild:!0,variant:"outline",size:"sm",children:e.jsxs(t,{to:"/docs/integrations/claude-desktop-mcp",onClick:a,children:[e.jsx(y,{className:"w-4 h-4 mr-1"})," ",r("claudeMcp.actions.readGuide")]})}),e.jsx(c,{size:"sm",onClick:()=>{null==a||a(),s()},children:r("claudeMcp.actions.manageKeys")})]})]})}function D(){const{t:t}=i("integrations"),{activeWorkspace:a}=h(),[r,o]=s.useState(null),[l,d]=s.useState(null),m=s.useCallback(async()=>{if(!a)return;o(null);const{data:e,error:s}=await x.from("mcp_oauth_tokens").select("id, client_id, scope, access_expires_at, refresh_expires_at, revoked_at, created_at, mcp_oauth_clients(client_name)").eq("workspace_id",a.id).is("revoked_at",null).order("created_at",{ascending:!1});if(s)return n.error(t("mcpAuthorizations.toasts.loadError")),void o([]);const r=Date.now(),i=(e??[]).map(e=>{var s;return{id:e.id,client_id:e.client_id,scope:e.scope,access_expires_at:e.access_expires_at,refresh_expires_at:e.refresh_expires_at,revoked_at:e.revoked_at,created_at:e.created_at,client_name:(null==(s=e.mcp_oauth_clients)?void 0:s.client_name)??null}}).filter(e=>!e.refresh_expires_at||new Date(e.refresh_expires_at).getTime()>r);o(i)},[a,t]);return s.useEffect(()=>{m()},[m]),a?e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{className:"w-4 h-4 text-primary"}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:t("mcpAuthorizations.title")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[r&&r.length>0&&e.jsx(c,{size:"sm",variant:"ghost",onClick:()=>{!async function(){if(!r||0===r.length)return;if(!confirm(t("mcpAuthorizations.confirmRevokeAll",{count:r.length})))return;d("all");const e=r.map(e=>e.id),{error:s}=await x.from("mcp_oauth_tokens").update({revoked_at:(new Date).toISOString()}).in("id",e);d(null),s?n.error(t("mcpAuthorizations.toasts.revokeError",{message:s.message})):(n.success(t("mcpAuthorizations.toasts.revokedAll")),m())}()},disabled:"all"===l,className:"text-destructive hover:text-destructive",children:t("mcpAuthorizations.revokeAll")}),e.jsx(c,{size:"sm",variant:"ghost",onClick:()=>{m()},children:t("mcpAuthorizations.refresh")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("mcpAuthorizations.description")}),null===r?e.jsx(z,{className:"h-16 w-full"}):0===r.length?e.jsx("p",{className:"text-xs text-muted-foreground italic",children:t("mcpAuthorizations.empty")}):e.jsx("ul",{className:"space-y-2",children:r.map(s=>e.jsxs("li",{className:"flex items-center justify-between gap-3 rounded border border-border bg-background p-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium truncate",children:s.client_name??s.client_id}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t("mcpAuthorizations.issued",{date:new Date(s.created_at).toLocaleDateString(),expires:new Date(s.refresh_expires_at??s.access_expires_at).toLocaleDateString()})})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx(S,{variant:"outline",children:s.scope}),e.jsxs(c,{size:"sm",variant:"ghost",onClick:()=>async function(e){d(e);const{error:s}=await x.from("mcp_oauth_tokens").update({revoked_at:(new Date).toISOString()}).eq("id",e);d(null),s?n.error(t("mcpAuthorizations.toasts.revokeError",{message:s.message})):(n.success(t("mcpAuthorizations.toasts.revoked")),m())}(s.id),disabled:l===s.id,children:[e.jsx(M,{className:"w-3.5 h-3.5 mr-1"}),t("mcpAuthorizations.revoke")]})]})]},s.id))})]}):null}function L(){const{t:s}=i("integrations"),n=a();return e.jsxs("div",{className:"page-container",children:[e.jsx(r,{title:s("mcpPage.title"),subtitle:s("mcpPage.subtitle")}),e.jsxs("div",{className:"p-6 max-w-4xl space-y-4",children:[e.jsx(c,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-2",children:e.jsxs(t,{to:"/integrations",children:[e.jsx(w,{className:"w-4 h-4 mr-1"})," ",s("mcpPage.back")]})}),e.jsx(q,{onOpenApiKeys:()=>n("/integrations/api-keys")}),e.jsx(D,{})]})]})}export{L as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.