PageSourceSearch

https://app.devin.ai/assets/blueprints-BB6Xr0k-.js

js devin.ai collected 2026-09-24 15:22:29 UTC 13,939 bytes, 1 lines download raw bytes

1import{n as e}from"./rolldown-runtime-BcKkbAw3.js";import{Mr as t,Pr as n}from"./helpers-BeqbCO8r.js";import{B as r,S as i,i as a,n as o,r as s,t as c,x as ee,z as l}from"./useMutation-CIlTDqXN.js";import{Er as u,Tr as d}from"./app-initial-CpJUq7Su.js";import{Dt as f,Et as p,Tt as m,jt as h,wt as te}from"./app-initial-G6Hps7M-.js";import{Lt as ne,Pt as g}from"./app-initial-Cx9yb9J1.js";import{K as _,q as v}from"./app-initial-DnPlz8I8.js";function y(e,t){t&&e.invalidateQueries({queryKey:[`author-sessions`,`current`,t]})}function b(e,t){t?.kind===`environment`&&e.invalidateQueries({queryKey:_(t.enterpriseId)})}async function re(e){return g.get(`${p(e)}/actions/catalog`).json()}async function x(e,t,n,r){let i=new URLSearchParams;t&&i.set(`repo_name`,t),r&&e.kind===`environment`&&i.set(`canonical_repo_id`,r),n&&i.set(`include_deleted`,`true`);let a=i.toString();return g.get(`${p(e)}/blueprints${a?`?${a}`:``}`).json()}async function S(e,t){return g.post(`${p(e)}/blueprints`,{json:t}).json()}async function ie(e,t,n){return g.put(`${p(e)}/blueprints/${t}/contents`,{json:n}).json()}async function ae(e,t){return g.delete(`${p(e)}/blueprints/${t}`).json()}async function oe(e,t,n){let r=n&&e.kind===`environment`?`?${new URLSearchParams({canonical_repo_id:n})}`:``;return g.delete(`${p(e)}/repos/${C(t)}/blueprints${r}`).json()}async function se(e,t,n={}){return g.post(`${e}/snapshot-setup/repos/${C(t)}/sync`,{json:{create_build:n.createBuild??!0,force_reattach:n.forceReattach??!1,force_reattach_scope:n.forceReattachScope??null}}).json()}async function ce(e,t){return g.delete(`${e}/snapshot-setup/blueprints/${t}/git`).json()}async function le(e,t,n){return g.post(`${e}/snapshot-setup/blueprints/${t}/prs`,{json:n}).json()}function C(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}async function ue(e,t){return g.get(`${p(e)}/repos/${C(t)}/settings`).json()}async function w(e,t,n){return g.put(`${p(e)}/repos/${C(t)}/settings`,{json:n}).json()}function T(e,t=!0){let n=h(),r=f(n);return a({queryKey:J.repoSettings(r,e),queryFn:()=>ue(n,e),enabled:!!n&&!!e&&t})}function E(e){let t=h(),n=f(t),r=i();return o({mutationFn:n=>w(t,e,n),onSuccess:t=>{r.setQueryData(J.repoSettings(n,e),t)}})}async function D(e,t){return g.get(`${p(e)}/blueprint-versions/${t}/contents`).json()}async function O(e,t,n,r){return g.get(`${p(e)}/builds/${t}/delta/blueprint-versions/${n}/contents`,r?{searchParams:{reference_build_id:r}}:void 0).json()}async function k(e,t,n){return g.get(`${p(e)}/builds/${t}/delta`,{...n?{searchParams:{reference_build_id:n}}:{}}).json()}async function A(e,t){return g.get(`${p(e)}/blueprints/${t}/versions`).json()}async function j(e){return g.get(`enterprise/${e}/snapshot-setup/blueprint/versions`).json()}async function M(e,t){return g.post(`${p(e)}/builds/${t}/cancel`).json()}async function N(e,t){await g.delete(`${p(e)}/builds/${t}`)}async function P(e,t={},n){let r=new URLSearchParams;return t.first!=null&&r.set(`first`,String(t.first)),t.after&&r.set(`after`,t.after),t.last!=null&&r.set(`last`,String(t.last)),t.before&&r.set(`before`,t.before),t.status&&r.set(`status`,t.status),t.defaultMachineConfigOnly&&r.set(`default_machine_config_only`,`true`),t.platform&&r.set(`platform`,t.platform),t.includePlatforms&&r.set(`include_platforms`,`true`),g.get(`${p(e)}/builds?${r}`,{signal:n}).json()}async function F(e,t,n){return g.get(e.kind===`organization`?`${p(e)}/build-jobs/${t}`:`${p(e)}/builds/${t}`,{signal:n}).json()}async function I(e,t){return g.get(`${p(e)}/builds/active`,{signal:t}).json()}async function L(e,t,n,r=!1){return g.get(`${p(e)}/builds/${t}/logs`,{signal:n,...r?{searchParams:{proxy:`true`}}:{}}).json()}function R(e){let t=h(),n=f(t);return a({queryKey:J.list(n),queryFn:()=>x(t),enabled:!!t&&(e?.enabled??!0)})}function z(e,t,n){let r=h(),i=f(r),o=r?.kind===`environment`?n:void 0;return a({queryKey:[...J.listByRepo(i,e,o),{includeDeleted:t}],queryFn:()=>x(r,e,t,o),enabled:!!r&&!!e})}function B(e){let t=h(),n=f(t);return a({queryKey:J.versionContents(n,e),queryFn:()=>D(t,e),enabled:!!t&&!!e})}function V(e,t){let n=h(),i=f(n),{data:o}=W(e);return a({queryKey:J.buildJobDelta(i,e,t),queryFn:()=>k(n,e,t),enabled:!!n&&!!e,placeholderData:r,refetchInterval:o&&Y.has(o.status)?!1:1e4})}function H(e){let t=h(),n=f(t);return a({queryKey:J.versions(n,e),queryFn:()=>A(t,e),enabled:!!t&&!!e})}function U(e){return a({queryKey:J.enterpriseVersions(e),queryFn:()=>j(e),enabled:!!e})}function de(e=!0){let t=h(),n=f(t);return a({queryKey:[...J.orgBuildJobs(n),`latest-default-machine-config`],queryFn:async({signal:e})=>(await P(t,{first:1,defaultMachineConfigOnly:!0},e)).data[0]??null,enabled:!!t&&e,refetchInterval:1e4})}function fe(e=!0){let t=h(),n=f(t);return a({queryKey:[...J.orgBuildJobs(n),`latest-completed-default-machine-config`],queryFn:async({signal:e})=>(await P(t,{first:10,defaultMachineConfigOnly:!0},e)).data.find(e=>X.has(e.status))??null,enabled:!!t&&e,refetchInterval:1e4})}function pe(e,t=10,n,i){let o=h(),s=f(o),c=i?.length?[...i].sort().join(`,`):void 0;return a({queryKey:[...J.orgBuildJobs(s),e,t,n??`all`,c??`all`],queryFn:({signal:r})=>P(o,{first:t,after:e,platform:n??void 0,status:c,includePlatforms:!0},r),enabled:!!o,refetchInterval:1e4,refetchOnMount:`always`,placeholderData:r})}function W(e){let t=h(),n=f(t);return a({queryKey:J.buildJob(n,e),queryFn:({signal:n})=>F(t,e,n),enabled:!!t&&!!e,refetchInterval:1e4})}function me(e){let t=h(),n=f(t),r=(e?.enabled??!0)&&!!t;return a({queryKey:J.activeBuildJob(n),queryFn:({signal:e})=>I(t,e),enabled:r,refetchInterval:r?1e4:!1,retry:!1})}function G(e){let t=h(),n=f(t);return a({queryKey:[...J.buildLogs(n,e),`url`],queryFn:({signal:n})=>L(t,e,n),enabled:!!t&&!!e,staleTime:3e5,gcTime:3e5})}function he(e,t=!0){let n=h(),r=f(n),{data:i}=G(t?e:void 0);return a({queryKey:[...J.buildLogs(r,e),`content`],queryFn:async()=>{let e=await fetch(i.url,{headers:i.headers});if(!e.ok)throw Error(`Failed to fetch build logs: ${e.status}`);return{logs:await e.text()}},enabled:!!i&&t,staleTime:1/0})}
1function ge(e,t=!1){let n=h(),r=f(n);return a({queryKey:[...J.buildLogs(r,e),`proxy-fallback`],queryFn:async({signal:t})=>{let r=await L(n,e,t,!0),i=await fetch(r.url,{headers:r.headers});if(!i.ok)throw Error(`Failed to fetch build logs: ${i.status}`);return{logs:await i.text()}},enabled:!!n&&!!e&&t,staleTime:1/0,retry:!1})}function _e(e){let t=h(),n=f(t),r=i(),a=e?.invalidateQueriesOnSuccess??!0;return o({mutationFn:e=>S(t,e),onSuccess:()=>{y(r,m(t)),a&&(r.invalidateQueries({queryKey:J.list(n)}),b(r,t))}})}function ve(){let e=h(),{data:t,...n}=R(),r=e?.kind===`environment`;return{data:t?.find(e=>(r||e.org_id!=null)&&e.repo_name==null&&(e.scope==null||e.scope===``))??null,...n}}async function ye(e,t){return g.post(`${p(e)}/blueprints/reorder`,{json:{blueprint_ids:t}}).json()}function be(){let e=h(),t=f(e),n=i();return o({mutationFn:t=>ye(e,t),onSuccess:()=>{n.invalidateQueries({queryKey:J.list(t)})}})}function xe(){let e=h(),t=f(e),n=i();return o({mutationFn:t=>ae(e,t),onSuccess:()=>{y(n,m(e)),n.invalidateQueries({queryKey:J.list(t)}),b(n,e)}})}function Se(){let e=h(),t=i();return o({mutationFn:t=>oe(e,t.repoName,t.canonicalRepoId),onSuccess:()=>{y(t,m(e)),t.invalidateQueries({queryKey:J.all}),b(t,e)}})}function Ce(){let{orgId:e}=u(),t=i();return o({mutationFn:t=>se(e,t.repoName,{createBuild:t.createBuild,forceReattach:t.forceReattach,forceReattachScope:t.forceReattachScope}),onSuccess:()=>{y(t,e),t.invalidateQueries({queryKey:J.all}),t.invalidateQueries({queryKey:J.orgBuildJobs(e)})}})}function we(){let{orgId:e}=u(),t=i();return o({mutationFn:t=>Promise.all(t.map(t=>ce(e,t))),onSettled:()=>{t.invalidateQueries({queryKey:J.all})}})}function Te(){let{orgId:e}=u();return o({mutationFn:({blueprintId:t,contents:n,title:r,body:i})=>le(e,t,{contents:n,title:r,body:i})})}function Ee(e){let t=h(),n=f(t),r=i();return o({mutationFn:n=>ie(t,e,n),onSuccess:(i,a)=>{r.setQueryData(J.versionContents(n,i.blueprint_version_id),{contents:a.contents}),y(r,m(t)),r.invalidateQueries({queryKey:J.list(n)}),r.invalidateQueries({queryKey:J.orgBuildJobs(n)}),r.invalidateQueries({queryKey:J.versions(n,e)})}})}function De(){let e=h(),n=f(e),r=i();return o({mutationFn:t=>g.post(`${p(e)}/builds`,{json:t?{build_kind:t}:void 0}).json(),onSuccess:()=>{y(r,m(e)),r.invalidateQueries({queryKey:J.orgBuildJobs(n)}),r.invalidateQueries({queryKey:[t,m(e)]})}})}function Oe(){let e=h(),n=f(e),r=i();return o({mutationFn:t=>M(e,t),onSuccess:()=>{y(r,m(e)),r.invalidateQueries({queryKey:J.orgBuildJobs(n)}),r.invalidateQueries({queryKey:[t,m(e)]})}})}async function ke(e,t){return g.post(`${e}/snapshot-setup/environment-suggestion/accept`,{json:t}).json()}async function Ae(e,t){return g.post(`${e}/snapshot-setup/skill-pr-suggestion/accept`,{json:t}).json()}function je(e){return a({queryKey:Z.detail(e),queryFn:()=>g.get(`enterprise/${e}/snapshot-setup/blueprint`).json(),enabled:!!e})}function Me(e,t){return a({queryKey:Z.versionContents(e,t),queryFn:()=>g.get(`enterprise/${e}/snapshot-setup/blueprint-versions/${t}/contents`).json(),enabled:!!e&&!!t})}function Ne(e){let t=i();return o({mutationFn:t=>g.post(`enterprise/${e}/snapshot-setup/blueprint`,{json:{contents:t}}).json(),onSuccess:()=>{t.invalidateQueries({queryKey:Z.detail(e)}),t.invalidateQueries({queryKey:J.enterpriseVersions(e)})}})}function Pe(e){let t=i();return o({mutationFn:t=>g.put(`enterprise/${e}/snapshot-setup/blueprint/contents`,{json:t}).json(),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:Z.detail(e)}),t.invalidateQueries({queryKey:J.enterpriseVersions(e)}),n&&t.setQueryData(Z.versionContents(e,n.blueprint_version_id),{contents:r.contents})}})}function Fe(e){let t=i();return o({mutationFn:()=>g.delete(`enterprise/${e}/snapshot-setup/blueprint`).json(),onSuccess:()=>{t.invalidateQueries({queryKey:Z.detail(e)}),t.invalidateQueries({queryKey:J.enterpriseVersions(e)})}})}async function Ie(e,t){return g.get(`${p(e)}/blueprints/${t}/files`).json()}async function Le(e,t,n,r){let i=new FormData;return i.append(`file`,r),g.post(`${p(e)}/blueprints/${t}/files?name=${encodeURIComponent(n)}`,{body:i}).json()}async function Re(e,t,n){return g.delete(`${p(e)}/blueprints/${t}/files/${n}`).json()}function ze(e){let t=h(),n=f(t);return a({queryKey:Q.list(n,e),queryFn:()=>Ie(t,e),enabled:!!t&&!!e})}function Be(e){let t=h(),n=f(t),r=i();return o({mutationFn:({name:n,file:r})=>Le(t,e,n,r),onSuccess:()=>{r.invalidateQueries({queryKey:Q.all}),r.invalidateQueries({queryKey:J.orgBuildJobs(n)})}})}function Ve(e){let t=h(),n=f(t),r=i();return o({mutationFn:n=>Re(t,e,n),onSuccess:()=>{r.invalidateQueries({queryKey:Q.all}),r.invalidateQueries({queryKey:J.orgBuildJobs(n)})}})}async function He(e){return g.get(`enterprise/${e}
1/snapshot-setup/blueprint/files`).json()}async function Ue(e,t,n){let r=new FormData;return r.append(`file`,n),g.post(`enterprise/${e}/snapshot-setup/blueprint/files?name=${encodeURIComponent(t)}`,{body:r}).json()}async function We(e,t){return g.delete(`enterprise/${e}/snapshot-setup/blueprint/files/${t}`).json()}function Ge(e){return a({queryKey:Q.enterpriseList(e),queryFn:()=>He(e),enabled:!!e})}function Ke(e){let t=i();return o({mutationFn:({name:t,file:n})=>Ue(e,t,n),onSuccess:()=>{t.invalidateQueries({queryKey:Q.all})}})}function qe(e){let t=i();return o({mutationFn:t=>We(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:Q.all})}})}async function Je(e,t){await g.put(`${p(e)}/pin`,{json:{build_job_id:t}})}async function K(e,t){let n={};t!==void 0&&(n.platform=t),await g.delete(`${p(e)}/pin`,{searchParams:n})}function Ye(){let e=h(),t=f(e),n=i();return o({mutationFn:t=>Je(e,t),onSuccess:()=>{n.invalidateQueries({queryKey:J.activeBuildJob(t)}),n.invalidateQueries({queryKey:J.orgBuildJobs(t)})}})}function Xe(){let e=h(),n=f(e),r=i();return o({mutationFn:t=>N(e,t),onSuccess:(i,a)=>{r.removeQueries({queryKey:J.buildJob(n,a)}),r.invalidateQueries({queryKey:J.activeBuildJob(n)}),r.invalidateQueries({queryKey:J.orgBuildJobs(n)}),r.invalidateQueries({queryKey:[t,m(e)]})}})}function q(){let e=h(),t=f(e);return a({queryKey:J.actionsCatalog(t),queryFn:()=>re(e),enabled:!!e,staleTime:3e5})}function Ze(){let{data:e}=q();return(e?.actions.length??0)>0}function Qe(){let e=h(),t=f(e),n=i();return o({mutationFn:t=>K(e,t),onSuccess:()=>{n.invalidateQueries({queryKey:J.activeBuildJob(t)}),n.invalidateQueries({queryKey:J.orgBuildJobs(t)})}})}var J,Y,X,Z,Q;function $(){return($=e((()=>{d(),n(),te(),l(),c(),s(),ee(),ne(),v(),J={all:[`blueprints`],list:e=>[...J.all,`list`,e],listByRepo:(e,t,n)=>[...J.all,`list`,e,`repo`,t,n??null],repoSettings:(e,t)=>[...J.all,`repo-settings`,e,t],detail:(e,t)=>[...J.all,`detail`,e,t],versions:(e,t)=>[...J.all,`versions`,e,t],enterpriseVersions:e=>[...J.all,`enterprise-versions`,e],versionContents:(e,t)=>[...J.all,`version-contents`,e,t],buildJobVersionContents:(e,t,n,r)=>[...J.all,`build-job-version-contents`,e,t,n,r],orgBuildJobs:e=>[...J.all,`org-build-jobs`,e],buildJob:(e,t)=>[...J.all,`build-job`,e,t],buildJobDelta:(e,t,n)=>[...J.all,`build-job-delta`,e,t,n],activeBuildJob:e=>[...J.all,`active-build-job`,e],buildLogs:(e,t)=>[...J.all,`build-logs`,e,t],actionsCatalog:e=>[...J.all,`actions-catalog`,e]},Y=new Set([`success`,`failed`,`partial`,`cancelled`]),X=new Set([`success`,`failed`,`partial`]),Z={all:[`enterprise-blueprints`],detail:e=>[...Z.all,`detail`,e],versionContents:(e,t)=>[...Z.all,`version-contents`,e,t]},Q={all:[`blueprint-files`],list:(e,t)=>[...Q.all,e,t],enterpriseList:e=>[...Q.all,`enterprise`,e]}})))()}export{we as A,Ye as B,Ne as C,Fe as D,Xe as E,U as F,Ze as G,T as H,de as I,Ee as J,De as K,fe as L,je as M,Ge as N,qe as O,Me as P,Ke as Q,ve as R,Te as S,Ve as T,z as U,be as V,Ce as W,E as X,Pe as Y,Be as Z,he as _,D as a,Oe as b,b as c,ze as d,B as f,V as g,W as h,S as i,q as j,Se as k,x as l,R as m,Ae as n,O as o,H as p,Qe as q,J as r,$ as s,ke as t,me as u,ge as v,xe as w,_e as x,G as y,pe as z};

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.