PageSourceSearch

https://app.vibenetwork.ai/assets/OAuthConsentPage-T393dbLJ.js

js vibenetwork.ai collected 2026-10-05 14:01:34 UTC 5,968 bytes, 1 lines download raw bytes

1import{o as A,b as a,c as E,j as e,L as p}from"./vendor-De2NIrSl.js";import{bu as y,i as q,v as R,a1 as B,B as v,S as L,j as I}from"./index-BNKu6i1-.js";import{d as O}from"./useMonkey-DgvtzD-W.js";function $(){var k,C;const[r]=A(),s=r.get("client_id")??"",i=r.get("redirect_uri")??"",u=r.get("code_challenge")??"",T=r.get("state"),n=r.get("connector")??"",[l,M]=a.useState(""),[d,j]=a.useState(null),[f,w]=a.useState(null),h=a.useRef(!1),c=E({queryKey:["oauth-client",s],queryFn:()=>I.get(`/oauth/clients/${encodeURIComponent(s)}`),enabled:s.length>0,retry:!1}),m=O(),P=a.useMemo(()=>!s||!i||!u,[s,i,u]),b=a.useMemo(()=>{try{return new URL(i).host}catch{return null}},[i]),N=async t=>{if(!h.current){h.current=!0,j(t?"allow":"deny"),w(null);try{const z=await I.post("/oauth/consent",{approve:t,client_id:s,redirect_uri:i,code_challenge:u,state:T,...t?n?{connector:n}:{project_id:l}:{}});window.location.assign(z.redirectTo)}catch{h.current=!1,j(null),w(t?"Could not complete the connection. Nothing was authorized. Try again.":"Could not send the refusal. Close this tab; nothing was authorized.")}}};if(P||c.isError&&!c.isLoading)return e.jsxs("article",{className:"mx-auto max-w-2xl py-8",children:[e.jsx("p",{className:"font-mono text-xs font-semibold uppercase tracking-[0.09em] text-muted-foreground",children:y.service}),e.jsx("h1",{className:"mt-2 text-2xl font-semibold tracking-tight",children:"This connection request is not valid"}),e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"The link that brought you here is missing information or names an app we don't recognize. Nothing was authorized and nothing was shared. If you were trying to connect an app to Code Monkey, start the connection again from that app."})]});const x=(k=c.data)==null?void 0:k.client_name,g=((C=m.data)==null?void 0:C.items)??[],o=n?g.find(t=>t.mcpConnectorId===n)??null:null,S=n.length>0&&!m.isLoading&&!o,_=n?(o==null?void 0:o.id)??"":l;return e.jsxs("article",{className:"mx-auto max-w-2xl py-8",children:[e.jsx("p",{className:"font-mono text-xs font-semibold uppercase tracking-[0.09em] text-muted-foreground",children:y.service}),e.jsx("h1",{className:"mt-2 text-2xl font-semibold tracking-tight",children:c.isLoading?"Checking who is asking…":`${x} wants to work as your Code Monkey agent`}),b&&e.jsxs("div",{className:"mt-3 rounded-lg border border-input bg-muted/40 p-3 text-xs text-muted-foreground",children:["After you allow this, an authorization code is sent to ",e.jsx("span",{className:"font-mono font-medium text-foreground",children:b}),". Only continue if you recognize that as the app you are connecting. Anyone can register an app under any name, so trust the destination, not the name."]}),e.jsxs("section",{className:"mt-4 space-y-3 rounded-lg border border-border bg-card p-4",children:[e.jsxs("h2",{className:"text-sm font-semibold",children:["If you allow this, ",x??"the app"," will be able to"]}),e.jsxs("ul",{className:"list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Check in as the agent on the project shown below, and see its tasks and rules"}),e.jsx("li",{children:"Claim, work, and complete tasks, and suggest new ones for your approval"}),e.jsx("li",{children:"Read and change that project's tech stack and repository during setup"}),e.jsx("li",{children:"Ask you questions and reply to messages you send it"})]}),e.jsx("h2",{className:"pt-1 text-sm font-semibold",children:"It will not be able to"}),e.jsxs("ul",{className:"list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Touch any other project or change your account settings"}),e.jsx("li",{children:"See your password or sign in as you"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Check-ins from this connection count toward your daily allowance, exactly like any other agent. You can disconnect it any time from"," ",e.jsx(p,{to:"/settings/account?tab=Connected%20agents",className:"font-medium text-primary hover:underline",children:"account settings"}),"."]})]}),e.jsxs("section",{className:"mt-4 space-y-3 rounded-lg border border-border bg-card p-4",children:[e.jsx("h2",{className:"text-sm font-semibold",children:n?"Project it will work on":"Which project should it work on?"}),m.isLoading?e.jsx(q,{className:"min-h-16"}):n?o?e.jsxs("p",{className:"text-sm",children:["This connects ",e.jsx("span",{className:"font-medium text-foreground",children:o.name}),". The app was pointed at this project by its address, so there is nothing to choose."]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection address does not match any project on your account. Make sure you are signed in to the right account, then start the connection again from the app."}):g.length===0?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You don't have a Code Monkey project yet, so there is nothing to connect. Press Deny below to let ",x??"the app"," know (otherwise it sits waiting), then create a project at ",e.jsx("span",{className:"font-medium",children:"/code-monkey/new"})," and start the connection again from the app."]}):e.jsx("div",{className:"flex flex-wrap gap-2",children:g.map(t=>e.jsx("button",{type:"button",className:R(l===t.id),"aria-pressed":l===t.id,onClick:()=>M(t.id),children:t.name},t.id))})]}),f&&e.jsx(B,{message:f,className:"mt-3"}),e.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[e.jsx(v,{disabled:!_||S||d!==null||c.isLoading,onClick:()=>void N(!0),children:d==="allow"?e.jsx(L,{}):"Allow"}),e.jsx(v,{variant:"secondary",disabled:d!==null,onClick:()=>void N(!1),children:d==="deny"?e.jsx(L,{}):"Deny"})]}),e.jsxs("p",{className:"mt-3 text-xs text-muted-foreground",children:["Operated by ",y.entity,". ",e.jsx(p,{to:"/privacy",className:"hover:underline",children:"Privacy"})," ·"," ",e.jsx(p,{to:"/terms",className:"hover:underline",children:"Terms"})]})]})}export{$ as OAuthConsentPage};

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.