PageSourceSearch

https://enki.ai/_next/static/chunks/6496-84a4ca0998c87eec.js

js enki.ai collected 2026-10-05 13:43:14 UTC 13,275 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[517,6496],{16807:(e,t,a)=>{a.d(t,{A:()=>r});let r={log:function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a]},error:function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a]},warn:function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a]},info:function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a]},debug:function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a]}}},20517:(e,t,a)=>{a.d(t,{J1:()=>h,apiRequest:()=>f,sU:()=>c});var r=a(16807),n=a(45372);let o="https://api.enki.ai",i=["/api/jarvis-core/","/api/jarvis/","/api/email/","/api/calendar/","/api/messaging/","/api/files/","/api/cad/","/api/programs/","/control/"],s=["/api/jarvis-core/workspace/","/api/jarvis-core/security/","/api/jarvis-core/memories","/api/jarvis-core/memory/"];function c(e){return e?e.startsWith("http://")||e.startsWith("https://")?e:"".concat(o).concat(e.startsWith("/")?"":"/").concat(e):null}function l(){return window.__JARVIS_SANDBOX?sessionStorage:localStorage}let d=[/\/api\/deploy/i,/\/api\/publish/i,/\/api\/git\/push/i,/\/api\/websites?\/.*\/deploy/i,/\/api\/companies\/\d+\/apps\/.*\/publish/i,/\/api\/releases/i,/\/control\/request-rebuild/i],u=!1,p=[];function m(e){p.forEach(t=>t(e)),p=[]}async function h(){try{let e=await fetch("".concat(o,"/api/auth/refresh"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}});if(!e.ok)throw Error("Token refresh failed");let t=await e.json();if(t.success&&t.data&&t.data.accessToken)return l().setItem("accessToken",t.data.accessToken),t.data.accessToken;throw Error("Invalid refresh response")}catch(e){throw l().removeItem("accessToken"),l().removeItem("user"),document.cookie="refreshToken=; path=/; max-age=0",window.location.href="/login",e}}async function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!window.__JARVIS_SANDBOX)return!1;let a=(t||"GET").toUpperCase();return"GET"!==a&&"HEAD"!==a&&"OPTIONS"!==a&&d.some(t=>t.test(e))}(e,t.method))throw Error("Blocked in sandbox: ".concat(t.method||"POST"," ").concat(e));if(window.__ENKI_TRAINING_DEMO__){let a=window.__ENKI_TRAINING_DEMO__.handle(e,t);if(void 0!==a)return a}let a=l().getItem("accessToken"),c={};t.headers&&"Content-Type"in t.headers?t.headers["Content-Type"]&&(c["Content-Type"]=t.headers["Content-Type"]):t.body instanceof FormData||(c["Content-Type"]="application/json");let{"Content-Type":f,...g}=t.headers||{};if(Object.assign(c,g),a&&(c.Authorization="Bearer ".concat(a)),!c["X-Company-Id"]&&!c["x-company-id"]&&!(/[?&]companyId=/.test(e)||/\/(?:companies|company)\/\d+/.test(e))){let e=l().getItem("selectedCompanyId");e&&(c["X-Company-Id"]=String(e))}let v=async a=>{let r={...c};a&&(r.Authorization="Bearer ".concat(a));let d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(!e||s.some(t=>e.startsWith(t)))&&i.some(t=>e.startsWith(t))){let e=t["X-Company-Id"]||t["x-company-id"];if(e&&1){let t=null;try{t=l().getItem("selectedCompanyId")}catch(e){t=null}if(t&&String(e)!==String(t))return o}return(0,n.activeTenantApiUrl)()}return o}(e,c),u="".concat(d).concat(e);if(t.params){let e=new URLSearchParams(t.params).toString();u="".concat(u,"?").concat(e)}let{params:p,...m}=t;return fetch(u,{...m,headers:r,credentials:"include"})},y=await v(a),b=(t.method||"GET").toUpperCase();for(let t=0;503===y.status&&"GET"===b&&t<3;t++){let n=await y.clone().json().catch(()=>null);if((null==n?void 0:n.error)!=="container_restarting")break;let o=1e3*Math.min(Number(n.retry_after)||3,5);r.A.warn("[API Client] workspace restarting, retrying ".concat(e," in ").concat(o/1e3,"s (attempt ").concat(t+1,"/").concat(3,")")),await new Promise(e=>setTimeout(e,o)),y=await v(a)}if(401===y.status){var x;let e=await y.json().catch(()=>({}));if("Token expired"===e.error||"Token expired"===e.message||(null==(x=e.message)?void 0:x.includes("expired")))if(u){let e=await new Promise(e=>{p.push(t=>{e(t)})});if(!e)throw Error("Session expired. Please login again.");y=await v(e)}else{u=!0;try{let e=await h();u=!1,m(e),y=await v(e)}catch(e){throw u=!1,m(null),Error("Session expired. Please login again.")}}else throw Error(e.error||e.message||"Unauthorized")}if(!y.ok){let t,a=await y.text();try{t=JSON.parse(a)}catch(e){t={error:a||"Request failed"}}if(503===y.status&&"container_restarting"===t.error){r.A.warn("[API Client] workspace restarting: ".concat(e));let a=Error(t.message||"Your workspace is restarting. Please try again in a moment.");throw a.code="container_restarting",a.status=503,a.retryAfter=Number(t.retry_after)||10,a}y.status>=500&&r.A.error("[API Client] Server error:",{endpoint:e,status:y.status,statusText:y.statusText,responseText:a});let n=Error(t.error||t.message||a||"Request failed");throw n.status=y.status,n.code="string"==typeof t.error?t.error:void 0,n.data=t,n}return y.json()}},20636:(e,t,a)=>{a.d(t,{Cj:()=>p,EN:()=>x,Ht:()=>i,LM:()=>d,Me:()=>E,Od:()=>f,QQ:()=>
1k,VZ:()=>w,Yn:()=>S,__:()=>_,dv:()=>b,g1:()=>v,hi:()=>m,is:()=>j,jQ:()=>N,pt:()=>u,rD:()=>y,tf:()=>T,vq:()=>h,wU:()=>g,zI:()=>l});var r=a(20517);let n="/api/developer",o=e=>encodeURIComponent(String(e)),i=()=>globalThis.crypto.randomUUID();function s(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e?(0,r.apiRequest)("".concat(n).concat(t),{...a,headers:{...a.headers,"X-Company-Id":String(e)}}):Promise.reject(Error("Select your developer company first."))}function c(e,t,a,r){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i();return s(e,t,{method:a,body:void 0===r?void 0:JSON.stringify(r),headers:{"Idempotency-Key":n}})}let l=e=>s(e,"/me"),d=(e,t,a)=>s(e,t,{signal:a}),u=(e,t,a)=>c(e,"/profile","PATCH",t,a),p=(e,t,a,r)=>c(e,"/collaborators/".concat(o(t)),"PUT",a,r),m=(e,t,a,r)=>c(e,"/collaborators/".concat(o(t)),"DELETE",{expected_revision:a},r),h=(e,t,a)=>c(e,"/cli-authorizations/".concat(o(t)),"DELETE",void 0,a),f=(e,t,a,r,n)=>{if(!["provision","reset","suspend","resume"].includes(a))throw Error("Unsupported sandbox action.");return c(e,"/sandboxes/".concat("provision"===a?"default":o(t),"/").concat(a),"POST",r,n)},g=(e,t,a,r)=>c(e,"/releases/".concat(o(t),"/publication-requests"),"POST",{expected_revision:a},r),v=(e,t,a,r)=>c(e,"/submissions/".concat(o(t),"/appeals"),"POST",a,r),y=(e,t,a)=>c(e,"/partner/link","POST",{partner_id:t},a),b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"7d",{companyId:a=null,signal:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c="/listings/".concat(o(e),"/health?window=").concat("30d"===t?"30d":"7d");return a?s(a,c,{signal:i}):(0,r.apiRequest)("".concat(n).concat(c),{signal:i})},x=function(){let{companyId:e=null,signal:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e?s(e,"/accounts/me/health",{signal:t}):(0,r.apiRequest)("".concat(n,"/accounts/me/health"),{signal:t})},w=e=>(0,r.apiRequest)("".concat(n,"/bootstrap"),{signal:e,cache:"no-store"}),_=e=>(0,r.apiRequest)("/api/public/developers/invitations/".concat(o(e)),{referrerPolicy:"no-referrer"}),T=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i();return(0,r.apiRequest)("/api/public/developers/applications",{method:"POST",body:JSON.stringify(e),headers:{"Idempotency-Key":t}})},j=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i(),a=arguments.length>2?arguments[2]:void 0;return(0,r.apiRequest)("".concat(n,"/applications"),{method:"POST",body:JSON.stringify(e),headers:{"Idempotency-Key":t},signal:a})},S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i(),t=arguments.length>1?arguments[1]:void 0;return(0,r.apiRequest)("".concat(n,"/applications/activate"),{method:"POST",body:"{}",headers:{"Idempotency-Key":e},signal:t})},k=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i();return(0,r.apiRequest)("".concat(n,"/onboarding"),{method:"POST",body:JSON.stringify(e),headers:{"Idempotency-Key":t},referrerPolicy:"no-referrer"})},E=e=>(0,r.apiRequest)("".concat(n,"/oauth/device/request?user_code=").concat(o(e)),{referrerPolicy:"no-referrer"}),N=(e,t,a)=>c(e,"/oauth/device/decision","POST",t,a)},66496:(e,t,a)=>{a.d(t,{A:()=>c});var r=a(95155),n=a(12115),o=a(20636);let i=["submitted","under_review","approved","changes_requested","rejected","invited"];function s(e){let{children:t,title:a}=e;return(0,r.jsxs)("label",{className:"block space-y-2 text-sm",children:[(0,r.jsx)("span",{children:a}),t]})}function c(e){let{embedded:t=!1,initialValues:a={},resubmitting:c=!1,onSubmitted:l}
1=e,[d,u]=(0,n.useState)(()=>({contact_name:a.contact_name||"",contact_email:a.contact_email||"",business_name:a.business_name||"",use_case:a.use_case||"",website:""})),[p,m]=(0,n.useState)(!1),[h,f]=(0,n.useState)(null),[g,v]=(0,n.useState)(!1),y=(0,n.useRef)(!1),b=(0,n.useRef)(null),x=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e={active:!0,controller:new AbortController};return x.current=e,()=>{e.active=!1,e.controller.abort()}},[]);let w=t?"w-full rounded-lg border border-[var(--color-surface-border)] bg-[var(--color-surface-bg)] px-3 py-2.5 text-sm text-[var(--color-text-primary)] outline-none focus:ring-2 focus:ring-[var(--color-primary)] disabled:opacity-50":"w-full rounded-lg border border-[var(--pub-border-strong)] bg-[var(--pub-card)] px-3 py-3 text-sm outline-none focus:ring-2 focus:ring-[var(--pub-link)] disabled:opacity-50",_=t?"border-[var(--color-surface-border)]":"border-[var(--pub-border-strong)]",T=t?"text-[var(--color-text-secondary)]":"opacity-75",j=async e=>{var r,n;e.preventDefault();let s=x.current;if(y.current||!(null==s?void 0:s.active))return;y.current=!0,m(!0),f(null);let c=t?{...d,contact_email:a.contact_email||""}:d,u=JSON.stringify(c);(null==(r=b.current)?void 0:r.hash)!==u&&(b.current={hash:u,key:(0,o.Ht)()});try{let e=t?await (0,o.is)(c,b.current.key,s.controller.signal):await (0,o.tf)(c,b.current.key);if((null==e?void 0:e.accepted)!==!0||t&&(!(null==(n=e.application)?void 0:n.id)||!i.includes(e.application.status)))throw Error("Your application was not confirmed. Please try again.");if(!s.active)return;v(!0),null==l||l(e.application)}catch(e){s.active&&f(e)}finally{y.current=!1,s.active&&m(!1)}};return g?(0,r.jsxs)("div",{role:"status",className:"space-y-3 rounded-xl border ".concat(_," p-5"),children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Application received"}),(0,r.jsx)("p",{className:"text-sm leading-relaxed ".concat(T),children:t?"The team will review your application. Once approved, your developer workspace will be available here.":"The team will review your application. Once approved, sign in to Enki using this email and open Developer to access the program."}),t?(0,r.jsx)("p",{className:"text-sm leading-relaxed ".concat(T),children:"You can keep using Enki while your application is reviewed."}):(0,r.jsx)("a",{className:"pub-btn-secondary pub-btn-sm",href:"/developers",children:"Back to the Developer Program"})]}):(0,r.jsxs)("form",{className:"max-w-xl space-y-5",onSubmit:j,"aria-label":"Developer application",children:[(0,r.jsxs)("div",{className:"grid gap-5 sm:grid-cols-2",children:[(0,r.jsx)(s,{title:"Your name",children:(0,r.jsx)("input",{required:!0,disabled:p,autoComplete:"name",maxLength:120,className:w,value:d.contact_name,onChange:e=>u({...d,contact_name:e.target.value})})}),(0,r.jsx)(s,{title:t?(0,r.jsxs)(r.Fragment,{children:["Email ",(0,r.jsx)("span",{className:T,children:"(your Enki account)"})]}):"Email",children:(0,r.jsx)("input",{"aria-label":"Email",required:!0,readOnly:t,disabled:p,type:"email",autoComplete:"email",maxLength:160,className:w,value:t?a.contact_email||"":d.contact_email,onChange:e=>{t||u({...d,contact_email:e.target.value})}})})]}),(0,r.jsx)(s,{title:"Business name (optional)",children:(0,r.jsx)("input",{disabled:p,autoComplete:"organization",maxLength:160,className:w,value:d.business_name,onChange:e=>u({...d,business_name:e.target.value})})}),(0,r.jsx)(s,{title:"What would you like to build?",children:(0,r.jsx)("textarea",{required:!0,disabled:p,rows:4,maxLength:4e3,className:w,value:d.use_case,onChange:e=>u({...d,use_case:e.target.value})})}),(0,r.jsx)("div",{"aria-hidden":"true",className:"hidden",children:(0,r.jsxs)("label",{children:["Website",(0,r.jsx)("input",{tabIndex:-1,autoComplete:"off",value:d.website,onChange:e=>u({...d,website:e.target.value})})]})}),h&&(0,r.jsx)("p",{role:"alert",className:"rounded-lg border ".concat(_," p-3 text-sm ").concat(t?"text-[var(--color-error)]":""),children:h.message||"Your application could not be sent. Please try again."}),(0,r.jsx)("button",{className:t?"rounded-lg px-4 py-2.5 text-sm font-semibold focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:opacity-50":"pub-btn-primary disabled:opacity-50",style:t?{background:"var(--color-btn-primary-bg)",color:"var(--color-btn-primary-text)"}:void 0,disabled:p,type:"submit",children:p?"Sending…":c?"Resubmit application":"Send application"}),(0,r.jsx)("p",{className:"text-xs leading-relaxed ".concat(T),children:"Applications are reviewed before developer access is granted."})]})}}}]);

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.