@preventive/triage 1.0.0-alpha.44 → 1.0.0-alpha.46
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/client/linked-findings.js +3 -0
- package/common/bundle-metadata.d.ts +1 -0
- package/common/bundle-metadata.js +1 -1
- package/common/bundle-sources.js +25 -2
- package/common/default-scan-models.ts +1 -1
- package/common/dependency-reviews.d.ts +0 -5
- package/common/dependency-reviews.js +0 -17
- package/common/line-diff.js +5 -4
- package/common/managed/agent-tasks.ts +292 -0
- package/common/managed/github-agents.ts +92 -0
- package/common/managed/github-logins.ts +49 -0
- package/common/managed/roles.ts +7 -0
- package/common/managed/routes.js +88 -7
- package/common/managed/team-app.d.ts +5 -2
- package/common/managed/team-app.js +2 -2
- package/common/server-info.ts +3 -0
- package/common/workspace-app.js +6 -3
- package/out/brotli-fallback.js +3 -3
- package/out/chunk-2XUEZHIP.js +18 -18
- package/out/chunk-2ZDZWLFY.js +1 -0
- package/out/chunk-3PS4KWD2.js +10 -0
- package/out/chunk-4HI2MSAV.js +17 -0
- package/out/chunk-4UFAMJAX.js +1 -0
- package/out/chunk-7C7DWL7I.js +1 -0
- package/out/chunk-7XRR4OFU.js +1 -0
- package/out/chunk-BC2UCLFJ.js +1 -0
- package/out/chunk-BOIXMUU5.js +3 -0
- package/out/chunk-C4Z6ZBXV.js +6 -6
- package/out/chunk-CC4OM6TZ.js +3 -0
- package/out/chunk-G24A42V6.js +2 -0
- package/out/chunk-GDPCLSOS.js +2 -0
- package/out/chunk-GO7FT4OD.js +1 -0
- package/out/chunk-I2MDGSQX.js +3 -0
- package/out/chunk-IYPY47MC.js +1 -0
- package/out/chunk-IZ7POWI3.js +18 -0
- package/out/chunk-JCIIBLKR.js +1 -1
- package/out/chunk-JKGQ3O7O.js +6 -0
- package/out/chunk-LE5ZWLG4.js +235 -0
- package/out/chunk-MSION3G4.js +36 -0
- package/out/chunk-NRPC74AM.js +1 -1
- package/out/chunk-OKRLLE5I.js +17 -0
- package/out/chunk-OOJM4CTU.js +1 -1
- package/out/chunk-PNHBZGDD.js +1 -1
- package/out/chunk-PXK7EU4V.js +1 -0
- package/out/chunk-QB4CBOX2.js +1 -0
- package/out/chunk-R3NZFXVR.js +1 -0
- package/out/chunk-R5O6FAW4.js +1 -1
- package/out/chunk-S6GIXWQW.js +52 -0
- package/out/chunk-SXV2T5C4.js +80 -0
- package/out/chunk-TUII34K2.js +1 -1
- package/out/chunk-V3KWNNMY.js +1 -0
- package/out/chunk-VFWMQ3LG.js +2 -0
- package/out/chunk-VH4XMZIW.js +2 -0
- package/out/chunk-WFYLMF6Z.js +10 -0
- package/out/chunk-WQ74ZBZF.js +7 -0
- package/out/client-managed-import.js +3 -3
- package/out/client-managed.js +31 -35
- package/out/client-sync.js +11 -11
- package/out/compare.js +35 -0
- package/out/dialogs.js +51 -0
- package/out/github-issue-authorized.html +1 -1
- package/out/github-issue-authorized.js +1 -1
- package/out/graph.js +17 -17
- package/out/index.html +30 -34
- package/out/prism.js +14 -14
- package/out/scan.js +2 -0
- package/out/terminal.js +294 -293
- package/out/view.css +1 -1
- package/out/view.js +16 -107
- package/package.json +53 -6
- package/risk/actions/findings.js +161 -0
- package/risk/actions/resolve.js +219 -0
- package/risk/actions/scripts/commands.js +182 -0
- package/risk/actions/scripts/grade.js +113 -0
- package/risk/actions/scripts/packages.js +123 -0
- package/risk/actions/scripts/shell.js +169 -0
- package/risk/actions/uses.js +76 -0
- package/risk/actions/workflow.js +110 -0
- package/risk/files/hosts.js +6 -6
- package/risk/files/readability.js +23 -17
- package/risk/files/runs-code.js +18 -6
- package/risk/files/script.js +7 -3
- package/risk/files/stamps.js +8 -7
- package/risk/index.d.ts +71 -1
- package/risk/index.js +6 -2
- package/risk/npm/assess.js +1 -1
- package/risk/npm/compare.js +34 -10
- package/risk/npm/files.js +413 -2
- package/risk/npm/tarball.js +56 -73
- package/server-e2e/app.ts +5 -4
- package/server-e2e/http.ts +5 -2
- package/server-managed/agent-merges.ts +198 -0
- package/server-managed/app-agents.ts +30 -0
- package/server-managed/avatar-store.ts +1 -0
- package/server-managed/bundle-cache.ts +7 -1
- package/server-managed/combined.ts +3 -2
- package/server-managed/commit-coauthors.ts +83 -0
- package/server-managed/commit-lockfiles.ts +72 -0
- package/server-managed/config.ts +6 -0
- package/server-managed/db-methods.ts +66 -19
- package/server-managed/db-neon.ts +89 -21
- package/server-managed/db-schema.ts +13 -2
- package/server-managed/db.ts +9 -1
- package/server-managed/dependabot-access.ts +60 -0
- package/server-managed/dependabot-alerts.ts +185 -0
- package/server-managed/dependency-review-comments.ts +97 -0
- package/server-managed/dependency-reviews.ts +78 -18
- package/server-managed/github-accounts.ts +33 -0
- package/server-managed/github-actions.ts +71 -0
- package/server-managed/github-app.ts +33 -13
- package/server-managed/github-errors.ts +2 -0
- package/server-managed/github-issue-links.ts +11 -5
- package/server-managed/github-link-oauth.ts +69 -0
- package/server-managed/github-links.ts +204 -0
- package/server-managed/github-oauth.ts +5 -2
- package/server-managed/github-pulls.ts +2 -2
- package/server-managed/github-requests.ts +39 -0
- package/server-managed/github-users.ts +30 -0
- package/server-managed/http-response.ts +10 -2
- package/server-managed/http.ts +1251 -97
- package/server-managed/index.ts +13 -8
- package/server-managed/kept-briefly.ts +37 -0
- package/server-managed/locked-packages.ts +37 -16
- package/server-managed/lockfile-scope.ts +49 -0
- package/server-managed/npm-delta-worker.js +23 -0
- package/server-managed/npm-delta.ts +178 -0
- package/server-managed/npm-insights.ts +20 -11
- package/server-managed/npm-kept.ts +83 -6
- package/server-managed/npm-loads.ts +114 -37
- package/server-managed/npm-packages.ts +110 -64
- package/server-managed/npm-risk.ts +4 -1
- package/server-managed/pretty-print.ts +67 -23
- package/server-managed/pull-comment-reviews.ts +161 -0
- package/server-managed/pull-dependencies.ts +300 -0
- package/server-managed/pull-dependency-reviews.ts +318 -0
- package/server-managed/pull-reviews.ts +205 -0
- package/server-managed/queue.ts +16 -0
- package/server-managed/release-commits.ts +84 -0
- package/server-managed/rename-diff.ts +22 -13
- package/server-managed/report-sources.ts +1 -1
- package/server-managed/report-store.ts +42 -9
- package/server-managed/repository-actions.ts +218 -0
- package/server-managed/repository-agents.ts +220 -0
- package/server-managed/repository-browser.ts +166 -37
- package/server-managed/repository-changes.ts +284 -0
- package/server-managed/repository-code.ts +52 -0
- package/server-managed/repository-dependency-reviews.ts +157 -0
- package/server-managed/repository-history.ts +461 -0
- package/server-managed/repository-issues.ts +181 -0
- package/server-managed/repository-pulse.ts +439 -0
- package/server-managed/repository-risk-audit.ts +13 -0
- package/server-managed/repository-risk-read.ts +170 -0
- package/server-managed/repository-risk.ts +133 -118
- package/server-managed/reviewed-dependencies.ts +149 -0
- package/server-managed/session.ts +27 -9
- package/server-managed/sql.ts +6 -3
- package/server-managed/storage-stores.ts +5 -0
- package/server-managed/storage.ts +4 -2
- package/server-managed/team-app.ts +19 -3
- package/server-managed/team-reports.ts +24 -12
- package/server-managed/upstream-cache.ts +12 -0
- package/server-managed/workspace-shares.ts +4 -1
- package/server.ts +25 -5
- package/out/chunk-2ABLKCOY.js +0 -46
- package/out/chunk-2KBF5TZ7.js +0 -2
- package/out/chunk-35VE6CDH.js +0 -2
- package/out/chunk-3BZ7JERB.js +0 -1
- package/out/chunk-4XCDFGDP.js +0 -10
- package/out/chunk-5LSXOLUS.js +0 -1
- package/out/chunk-5RCM2J63.js +0 -1
- package/out/chunk-7B6HB4D7.js +0 -1
- package/out/chunk-AJ4GTATZ.js +0 -3
- package/out/chunk-CH4UN6WK.js +0 -225
- package/out/chunk-CMQA4DM6.js +0 -1
- package/out/chunk-CVVJAXVY.js +0 -2
- package/out/chunk-DIJJNTRH.js +0 -10
- package/out/chunk-EDKLBQQN.js +0 -17
- package/out/chunk-F47DXCEV.js +0 -33
- package/out/chunk-FK3DZEKL.js +0 -1
- package/out/chunk-G6AJWENO.js +0 -1
- package/out/chunk-GJ4IUCNS.js +0 -1
- package/out/chunk-GNXOKIGP.js +0 -80
- package/out/chunk-GZ4MS3TE.js +0 -13
- package/out/chunk-GZWM7UQM.js +0 -2
- package/out/chunk-IU3CCINR.js +0 -3
- package/out/chunk-K3X5EJBQ.js +0 -2
- package/out/chunk-KEX2ATEW.js +0 -2
- package/out/chunk-KYCNJVB7.js +0 -1
- package/out/chunk-LPCTJYNA.js +0 -7
- package/out/chunk-O4RJY5TP.js +0 -2
- package/out/chunk-OD4LPN3H.js +0 -1
- package/out/chunk-QWDWTBM7.js +0 -1
- package/out/chunk-QYWKC557.js +0 -1
- package/out/chunk-R75XOKUP.js +0 -1
- package/out/chunk-SWTLADW5.js +0 -1
- package/out/chunk-T7OKH4VW.js +0 -1
- package/out/chunk-TZ5KB2Y5.js +0 -10
- package/out/chunk-UNTRGE26.js +0 -2
- package/out/chunk-UTR2LVME.js +0 -2
- package/out/chunk-UYAXVRVL.js +0 -1
- package/out/chunk-V3ME6FI5.js +0 -2
- package/out/chunk-V5O7M2YT.js +0 -1
- package/out/chunk-VIHGO77Y.js +0 -1
- package/out/chunk-W4J3MGLB.js +0 -1
- package/out/chunk-WGG7KQUH.js +0 -1
- package/out/chunk-XYFXXB2G.js +0 -10
- package/out/chunk-ZESLQCTF.js +0 -6
package/out/chunk-5LSXOLUS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as k,d as p}from"./chunk-IU3CCINR.js";import{f as y,g as R}from"./chunk-UYAXVRVL.js";import{i as S}from"./chunk-QYWKC557.js";import{J as C}from"./chunk-GNXOKIGP.js";async function f(e,n=null,r={}){let o;try{o=await p(e,{credentials:"same-origin",headers:{accept:"application/json"},...r})}catch{return n}if(o.status===401||o.status===403)return null;if(!o.ok)return n;try{return await o.json()}catch{return n}}async function P({fallback:e=null,sent:n}={}){let r=y()||k()!==null?void 0:await n;if(r===null)return null;let o=U(r);if(o!==void 0)return o;let s;try{let l=y(),i=await p(l?R(l):"/api/auth/session",{credentials:"same-origin",headers:{accept:"application/json"}});if(i.status===401||i.status===403)return null;if(!i.ok)return e;s=await i.json()}catch{return e}let a=U(s);return a===void 0?e:a}function U(e){let n=e?.user;if(n===null)return null;if(!(n===void 0||typeof n.login!="string"))return{id:n.id,login:n.login,name:typeof n.name=="string"?n.name:null,avatarUrl:typeof n.avatarUrl=="string"?n.avatarUrl:null,role:typeof n.role=="string"?n.role:"none",csrfToken:typeof e.csrfToken=="string"?e.csrfToken:null,...y()?{publicShare:!0}:{},...typeof e.viewer?.login=="string"?{viewer:{id:e.viewer.id,login:e.viewer.login,name:typeof e.viewer.name=="string"?e.viewer.name:null}}:{}}}function O(e){return e?.appMode===!1?{appMode:!1}:e?.appMode===!0&&Number.isSafeInteger(e.appFindings)&&e.appFindings>=0?{appMode:!0,appFindings:e.appFindings}:null}function b(e){if(typeof e?.sha!="string"||typeof e.github!="string"||!Array.isArray(e.tags))return null;let n=e.details,r=s=>typeof s=="string"?s:null,o=s=>Number.isSafeInteger(s)?s:null;return{sha:e.sha,github:e.github,tags:e.tags.filter(s=>typeof s=="string"),details:typeof n?.subject=="string"?{subject:n.subject,authorName:r(n.authorName),authorLogin:r(n.authorLogin),authoredAt:o(n.authoredAt),committedAt:o(n.committedAt)}:null}}async function M({fallback:e=[],signal:n,onRevision:r}={}){let o=y(),s=o?await f(R(o),null,{signal:n}):null,a=o?{teams:s?.team?[s.team]:[]}:await f("/api/teams",{teams:e},{signal:n}),l=a?.teams;return Array.isArray(l)?(r?.(typeof a.revision=="string"?a.revision:null),l.filter(i=>i!=null&&typeof i.id=="string"&&typeof i.name=="string").map(i=>({id:i.id,slug:i.slug,name:i.name,...!o&&i.dependencyReview===!0?{dependencyReview:!0}:{},...i.permissions?{permissions:{dependencies:i.permissions.dependencies===!0,security:i.permissions.security===!0}}:{},...typeof i.cacheKey=="string"?{cacheKey:i.cacheKey}:{},...O(i.app)?{app:O(i.app)}:{},reports:Array.isArray(i.reports)?i.reports.filter(t=>t!=null&&typeof t.id=="string"&&typeof t.filename=="string").map(t=>({id:t.id,slug:t.slug,filename:t.filename,visible:t.visible!==!1,...t.analyzer===null||typeof t.analyzer=="string"?{analyzer:t.analyzer}:{},repoFullName:typeof t.repoFullName=="string"?t.repoFullName:"",repoDirectory:typeof t.repoDirectory=="string"?t.repoDirectory:"",...typeof t.cacheKey=="string"?{cacheKey:t.cacheKey}:{}})):[],bundles:Array.isArray(i.bundles)?i.bundles.filter(t=>t!=null&&typeof t.id=="string"&&typeof t.filename=="string").map(t=>({id:t.id,slug:t.slug,integrity:t.integrity,byteSize:t.byteSize,repoId:t.repoId,filename:t.filename,kind:t.kind,visible:t.visible!==!1,summary:t.summary??null,summaryRetryAt:Number.isSafeInteger(t.summaryRetryAt)&&t.summaryRetryAt>0?t.summaryRetryAt:null,repoDirectory:typeof t.repoDirectory=="string"?t.repoDirectory:"",repoFullName:typeof t.repoFullName=="string"?t.repoFullName:"",commitInfo:b(t.commitInfo)})):[]}))):a==null?[]:e}function x(e){return e?.links===void 0?[]:Array.isArray(e.links)&&e.links.every(n=>Array.isArray(n)&&n.length>=2&&n.every(r=>typeof r=="string"))?e.links:null}function $(e){return C(e?.data)===null||typeof e.repo?.directory!="string"||e.repo.github!==null&&typeof e.repo.github!="string"||x(e)===null?null:{data:e.data,repo:e.repo,...e.links?{links:e.links}:{}}}async function D(e,{signal:n}={}){return $(await f(`/api/reports/${encodeURIComponent(e)}`,null,{signal:n}))}async function L(e,{signal:n}={}){let r=[...new Set(e)];if(r.length===0)return[];let o=await f("/api/reports/query",null,{method:"POST",signal:n,headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({ids:r})});if(!Array.isArray(o?.reports)||o.reports.length!==r.length)return null;let s=new Map;for(let l of o.reports){let i=$(l);if(!i||!r.includes(l.id)||s.has(l.id))return null;s.set(l.id,i)}let a=x(o);return a===null?null:e.map(l=>({...s.get(l),...a.length>0?{links:a}:{}}))}async function J(e,{signal:n,reportId:r=null}={}){let o=r===null?"":`?reportId=${encodeURIComponent(r)}`,s=await f(`/api/teams/${encodeURIComponent(e)}/reports${o}`,null,{signal:n});if(!Array.isArray(s?.reports))return null;let a=[],l=new Set;for(let t of s.reports){let d=$(t);if(!d||typeof t.id!="string"||typeof t.filename!="string"||l.has(t.id))return null;l.add(t.id),a.push({id:t.id,filename:t.filename,...d})}let i=x(s);return i===null?null:(Object.defineProperty(a,"links",{value:i}),a)}function w(e){return e?`?team=${encodeURIComponent(e)}`:""}async function z(e,{reportId:n,...r}={}){let o=n==null?"":`?reportId=${encodeURIComponent(n)}`,s=await f(`/api/teams/${encodeURIComponent(e)}/annotations${o}`,null,r),{reports:a,entries:l,comments:i,issues:t={}}=s??{};if(!a||typeof a!="object"||Array.isArray(a)||!l||typeof l!="object"||Array.isArray(l)||!Array.isArray(i)||!t||typeof t!="object"||Array.isArray(t)||Object.values(a).some(c=>!Array.isArray(c)||c.some(g=>typeof g!="string"))||i.some(c=>!c||typeof c.findingId!="string"))return null;let d=new Map;for(let[c,g]of i.entries()){let m=g.findingId,h=d.get(m)??[];h.push(c),d.set(m,h)}let j=new Map,A=new Map;return c=>{if(!Object.hasOwn(a,c))return null;if(A.has(c))return A.get(c);let g=JSON.stringify(a[c]),m=j.get(g);if(!m){let h=[...new Set(a[c])],v=h.flatMap(u=>d.get(u)??[]);m={entries:Object.fromEntries(h.filter(u=>Object.hasOwn(l,u)).map(u=>[u,l[u]])),comments:v.toSorted((u,I)=>u-I).map(u=>i[u]),issues:Object.fromEntries(h.filter(u=>Object.hasOwn(t,u)).map(u=>[u,t[u]]))},j.set(g,m)}return A.set(c,m),m}}async function K(e,n,r){let s=(await f(`/api/reports/${encodeURIComponent(e)}/triage${w(n)}`,null,r))?.entries;return s!=null&&typeof s=="object"&&!Array.isArray(s)?s:null}async function q(e,n,r=null){if(y())return[];let o=r===null?"":`?reportId=${encodeURIComponent(r)}`,s=await f(`/api/teams/${encodeURIComponent(e)}/fixes${o}`,null,{signal:n});return Array.isArray(s?.fixes)?s.fixes:null}async function H(e,n,r){let o=await f(`/api/reports/${encodeURIComponent(e)}/comments${w(n)}`,null,r);return Array.isArray(o?.comments)?o.comments:null}async function B(e,{findingId:n,body:r,commentId:o=null,version:s},a,l){let i=o==null?"":`/${encodeURIComponent(o)}`;try{let t=await p(`/api/reports/${encodeURIComponent(e)}/comments${i}${w(l)}`,{method:o==null?"POST":"PATCH",credentials:"same-origin",headers:{"content-type":"application/json",...a?{"x-csrf-token":a}:{}},body:JSON.stringify(o==null?{findingId:n,body:r}:{body:r,version:s})});return{status:t.status,comment:t.ok?(await t.json()).comment:null}}catch{return{status:0,comment:null}}}async function G(e,n,r,o,s){try{return(await p(`/api/reports/${encodeURIComponent(e)}/comments/${encodeURIComponent(n)}${w(s)}`,{method:"DELETE",credentials:"same-origin",headers:{"content-type":"application/json",...o?{"x-csrf-token":o}:{}},body:JSON.stringify({version:r})})).status}catch{return 0}}async function W(e,n,r,o){try{return(await p(`/api/reports/${encodeURIComponent(e)}/triage${w(o)}`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json",...r?{"x-csrf-token":r}:{}},body:JSON.stringify({entries:n})})).status}catch{return 0}}function _(e){e&&(location.href=e)}async function Q(e){if(y()){location.href="/";return}try{await p("/api/auth/logout",{method:"POST",credentials:"same-origin",headers:e?{"x-csrf-token":e}:{}})}catch{}location.reload()}async function V(e,n){let r=await p("/api/auth/view-as",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json",...n?{"x-csrf-token":n}:{}},body:JSON.stringify({userId:e})});if(!r.ok)throw new Error(`HTTP ${r.status}`);location.assign("/")}async function X(e){try{await p("/api/auth/view-as",{method:"DELETE",credentials:"same-origin",headers:e?{"x-csrf-token":e}:{}})}catch{}location.assign(S["admin-users"])}async function Y(e){let n=await p(`/api/teams/${encodeURIComponent(e)}/share`,{credentials:"same-origin"});if(!n.ok)throw new Error(`Could not load public links (${n.status})`);return(await n.json()).shares}async function Z(e,n,{id:r,revoke:o=!1,dependencies:s=!1,security:a=!1}={}){let l=r?`/${encodeURIComponent(r)}`:"",i=await p(`/api/teams/${encodeURIComponent(e)}/share${l}`,{method:o?"DELETE":r?"PATCH":"POST",credentials:"same-origin",headers:{"x-csrf-token":n,"content-type":"application/json"},...o?{}:{body:JSON.stringify({dependencies:s,security:a})}});if(!i.ok)throw new Error(`Could not ${o?"revoke":r?"update":"create"} public link (${i.status})`);return i.json()}async function ee(e,n){let r=await p(`/api/bundles/${encodeURIComponent(e)}/download`,{credentials:"same-origin"});if(!r.ok)throw new Error(`Could not download bundle (${r.status})`);let o=URL.createObjectURL(await r.blob()),s=document.createElement("a");s.href=o,s.download=n,s.click(),setTimeout(()=>URL.revokeObjectURL(o),6e4)}export{P as a,M as b,D as c,L as d,J as e,w as f,z as g,K as h,q as i,H as j,B as k,G as l,W as m,_ as n,Q as o,V as p,X as q,Y as r,Z as s,ee as t};
|
package/out/chunk-5RCM2J63.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Dc as a,Ec as b,Fc as c,Gc as d,Hc as e}from"./chunk-CH4UN6WK.js";import"./chunk-JCIIBLKR.js";import"./chunk-K3X5EJBQ.js";import"./chunk-CVVJAXVY.js";import"./chunk-VIHGO77Y.js";import"./chunk-SWTLADW5.js";import"./chunk-2ABLKCOY.js";import"./chunk-ZESLQCTF.js";import"./chunk-UYAXVRVL.js";import"./chunk-NRPC74AM.js";import"./chunk-LPCTJYNA.js";import"./chunk-W4J3MGLB.js";import"./chunk-GJ4IUCNS.js";import"./chunk-PNHBZGDD.js";import"./chunk-F47DXCEV.js";import"./chunk-R5O6FAW4.js";import"./chunk-CMQA4DM6.js";import"./chunk-AJ4GTATZ.js";import"./chunk-R75XOKUP.js";import"./chunk-OD4LPN3H.js";import"./chunk-4XCDFGDP.js";import"./chunk-3BZ7JERB.js";import"./chunk-TZ5KB2Y5.js";import"./chunk-XYFXXB2G.js";import"./chunk-DIJJNTRH.js";import"./chunk-QYWKC557.js";import"./chunk-GNXOKIGP.js";import"./chunk-C4Z6ZBXV.js";import"./chunk-2XUEZHIP.js";import"./chunk-TUII34K2.js";import"./chunk-V5O7M2YT.js";import"./chunk-OOJM4CTU.js";export{e as createManagedAnnotationRead,c as hydrateManagedReportTriage,a as initManagedTriagePush,d as refreshManagedReportTriage,b as resetManagedTriage};
|
package/out/chunk-7B6HB4D7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ke}from"./chunk-FK3DZEKL.js";import{c as G,d as Q,e as xe,h as ee,i as Se,j as te,m as ne,n as Oe,o as se}from"./chunk-GZWM7UQM.js";import{a as q,c as Y}from"./chunk-JCIIBLKR.js";import{n as be}from"./chunk-EDKLBQQN.js";import{k as we,o as X,p as J,t as V}from"./chunk-ZESLQCTF.js";import{a as Z}from"./chunk-OD4LPN3H.js";import"./chunk-3BZ7JERB.js";import"./chunk-GNXOKIGP.js";import"./chunk-TUII34K2.js";import"./chunk-OOJM4CTU.js";function oe(e){if(typeof e!="string")throw new TypeError(`a text must be a string, not ${typeof e}`);if(!e.isWellFormed())throw new TypeError("a text must be a well-formed string");return{proven:!1,reason:"unsupported",at:null}}var We=e=>e.subarray(0,8e3).includes(0),Me=(e,t)=>(e+Math.imul(t,97)>>>0)%107927,Be=e=>Uint8Array.from({length:256},(t,s)=>Number(s===10||e.includes(String.fromCodePoint(s)))),Xe=Be(""),Ae=Be(",;={}");function re(e,t=Xe){let s=!We(e),n=new Map,o=(f,l)=>n.set(f,(n.get(f)??0)+l),i=0,a=0,r=0;for(let f=0;f<e.length;f++){let l=e[f];if(s&&l===13&&e[f+1]===10)continue;let u=i;i=(i<<7^a>>>25)+l>>>0,a=(a<<7^u>>>25)>>>0,!(++r<64&&t[l]===0)&&(o(Me(i,a),r),r=0,i=0,a=0)}r>0&&o(Me(i,a),r);let c=Uint32Array.from(n.keys()).sort();return{hashes:c,bytes:Float64Array.from(c,f=>n.get(f)),total:n.values().reduce((f,l)=>f+l,0)}}function Je(e,t){let s=0;for(let n=0,o=0;n<e.hashes.length&&o<t.hashes.length;)e.hashes[n]<t.hashes[o]?n++:e.hashes[n]>t.hashes[o]?o++:s+=Math.min(e.bytes[n++],t.bytes[o++]);return s}function Ve(e,t,s){let n=0,o=e.total,i=t.total;for(let a=0,r=0;a<e.hashes.length&&r<t.hashes.length;)if(e.hashes[a]<t.hashes[r]?o-=e.bytes[a++]:(e.hashes[a]>t.hashes[r]||(n+=Math.min(e.bytes[a],t.bytes[r]),o-=e.bytes[a++]),i-=t.bytes[r++]),(n+Math.min(o,i))*6e4<s)return 0;return n}function ie(e,t,s,n,o=!1){if(e===null||t===null||t.length===0)return 0;let i=Math.abs(e.length-t.length),a=Math.max(e.length,t.length);if(a*(6e4-s)<i*6e4)return 0;let r=n(e),c=n(t),f=o?Ve(r,c,s*a):Je(r,c);return Math.trunc(f*6e4/a)}var $e=/^[\w-]{6,}$/u,ae=/[\dA-Z]/u;var Ze=/^(?:\.[\w-]+)+$/u,qe=/^[\w-]{8,32}$/u;function Ee(e){let t=[];for(let s=e.length-1;s>0;s--){if(e[s]!=="-"&&e[s]!==".")continue;let n=e.indexOf(".",s+1),o=e.slice(n),i=e.slice(s+1,n);n!==-1&&qe.test(i)&&Ze.test(o)&&/[A-Za-z]/u.test(i)&&ae.test(i)&&t.push([e.slice(0,s),i,o])}return t}var Te=e=>e.replaceAll(/\d/gu,"0").replaceAll(/[a-z]/gu,"a").replaceAll(/[A-Z]/gu,"A");function Ye(e,t){let s=Ee(t);for(let[n,o,i]of Ee(e)){let a=s.find(r=>r[2]===i);if(a&&a[1]!==o)return a[0]===n&&Te(a[1])!==Te(o)}return!1}function Ge(e){let t=e.lastIndexOf("/"),s=e.slice(t+1),n=s.lastIndexOf("."),o=n>0?s.slice(n):"";return{name:s,key:`${e.slice(0,t+1)}\0${o}\0${s.length}`}}function Qe(e,t){let s=e.length,n=0;for(;n<e.length&&e[n]===t[n];)n++;for(;s>n&&e[s-1]===t[s-1];)s--;for(;n>0&&!"-._".includes(e[n-1]);)n--;for(;s<e.length&&e[s]!==".";)s++;let o=e.slice(n,s),i=t.slice(n,s);return n>0&&$e.test(o)&&$e.test(i)&&(ae.test(o)||ae.test(i))}function Ce({sources:e,dests:t,pairs:s,used:n,record:o,punctuatedScoreOf:i},{remaining:a,open:r},c,f){let l=(w,$)=>new Map($.filter(A=>w[A].type==="file").map(A=>[A,Ge(w[A].path)])),u=l(t,r),p=l(e,a),h=Map.groupBy(p.keys(),w=>p.get(w).key),b=Map.groupBy(u.keys(),w=>u.get(w).key),m=[];for(let[w,$]of b){let A=h.get(w)??[];for(let C of $)for(let D of A)Qe(p.get(D).name,u.get(C).name)&&m.push({s:D,d:C})}let y=Map.groupBy(m,({d:w})=>w),d=Map.groupBy(m,({s:w})=>w),x=[];for(let{s:w,d:$}of m){let A=d.get(w).length===1&&y.get($).length===1&&Ye(p.get(w).name,u.get($).name),C=i(w,$,A?0:c);(A||C>=c)&&x.push({s:w,d:$,score:C})}let S=[],O=new Set,N=new Set;for(let w of x.sort(($,A)=>A.score-$.score))s.has(w.d)||n.has(w.s)||(N.has(w.s)||O.has(w.d)||f(w)?(S.push(w),N.add(w.s),O.add(w.d)):o(w.d,w.s,w.score));return S}function Fe(e,t){let s=e.length;if(s!==t.length)return!1;let n=0;if(s>=32&&(e.byteOffset&3)===(t.byteOffset&3)){for(let r=4-(e.byteOffset&3)&3;n<r;n++)if(e[n]!==t[n])return!1;let o=s-n>>>2,i=new Int32Array(e.buffer,e.byteOffset+n,o),a=new Int32Array(t.buffer,t.byteOffset+n,o);for(let r=0;r<o;r++)if(i[r]!==a[r])return!1;n+=o*4}for(;n<s;n++)if(e[n]!==t[n])return!1;return!0}var T=class extends Error{constructor(t,s,n){let o=n===void 0?"":` in the ${n} tree`;super(s===void 0?t:`${t}: ${JSON.stringify(s)}${o}`),this.name="CompareError",this.path=s,this.tree=n}};var et=new Set(["file","contiguous-file"]),tt=new Set(["fifo","character-device","block-device"]),nt=/(?:^|\/)\.{0,2}(?:\/|$)/u;function st(e){if(!Number.isInteger(e)||e<0||e>4095)throw new RangeError(`a mode must be an integer from 0 to 0o7777, not ${e}`)}function ot(e,t,s,n){if(typeof e!="string")throw new TypeError(`an entry's name must be a string, not ${typeof e}`);if(!(e==="."&&t==="directory")){if(n?e==="":nt.test(e))throw new T(n?"a name must not be empty":"a name must be a relative path with no empty, `.` or `..` segment",e,s);if(!e.isWellFormed())throw new T("a name must be well-formed Unicode",e,s)}}function rt(e,t,s){if(typeof e!="string"||e==="")throw new T("a link must name its target",t,s);if(!e.isWellFormed())throw new T("a link target must be well-formed Unicode",t,s);return e}function it(e){if(e===void 0)return new Uint8Array(0);if(e instanceof Uint8Array)return e;if(typeof e!="string")throw new TypeError(`a file's data must be a string or a Uint8Array, not ${typeof e}`);if(!e.isWellFormed())throw new TypeError("a file's text must be well-formed Unicode");return e}var K=e=>typeof e=="string"?be(e):e;function at(e,t,s){if(typeof e!="object"||e===null)throw new TypeError(`an entry must be an object, not ${e===null?"null":typeof e}`);let{name:n,type:o="file",mode:i,linkname:a,data:r}=e;if(ot(n,o,t,s),i!==void 0&&st(i),et.has(o))return{path:n,type:"file",mode:i??420,data:it(r)};if(o==="symlink"||o==="hardlink")return{path:n,type:o,target:rt(a,n,t)};if(o==="directory")return{path:n,type:o};throw tt.has(o)?new T(`a ${o} is neither a file nor a link`,n,t):new TypeError(`${JSON.stringify(o)} is not an entry type`)}function U(e,t){return e.type!==t.type?!1:e.type==="symlink"?e.target===t.target:e.data===t.data?!0:typeof e.data=="string"&&typeof t.data=="string"?!1:Fe(K(e.data),K(t.data))}function ct(e,t,s){let n=new Set([e.path]),o=t.get(e.target);for(;o?.type==="hardlink";){if(n.has(o.path))throw new T("a hard link leads back to itself",e.path,s);n.add(o.path),o=t.get(o.target)}if(o===void 0||o.type==="directory")throw new T("a hard link must name a file or a link in the tree",e.path,s);return{...o,path:e.path}}function ce(e,t,s){let n=new Map;for(let i of e){let a=at(i,t,s);if(!(a.type==="directory"&&a.path===".")){if(n.has(a.path))throw new T("a name is given twice",a.path,t);n.set(a.path,a)}}let o=new Map;for(let[i,a]of n){for(let r=s?-1:i.lastIndexOf("/");r>0;r=i.lastIndexOf("/",r-1)){let c=n.get(i.slice(0,r));if(c!==void 0&&c.type!=="directory")throw new T(`a path lies under a ${c.type==="symlink"?"link":"file"}`,i,t)}a.type==="hardlink"?o.set(i,ct(a,n,t)):a.type!=="directory"&&o.set(i,a)}return o}var lt=100,ft=4,Re=e=>e.slice(e.lastIndexOf("/")+1);function Ne(e,t){if(e.type==="symlink")return`l${e.target}`;let s=t(e);return`f${s.length}:${ke(s)}`}function ut({sources:e,dests:t,sourceNames:s,destNames:n,used:o,record:i,bytes:a}){let r=Map.groupBy(e.keys(),c=>Ne(e[c],a));for(let c=0;c<t.length;c++){let f=-1,l=lt;for(let u of r.get(Ne(t[c],a))??[])if(!(o.has(u)||!U(e[u],t[c]))&&((f===-1||s[u]===n[c])&&(f=u),s[u]===n[c]||--l===0))break;f!==-1&&i(c,f,6e4)}}var pt=new Map([[".ts",".js"],[".mts",".mjs"],[".cts",".cjs"],[".tsx",".jsx"]]),ht=new Map([...[".js",".mjs",".cjs",".jsx",".ts",".mts",".cts",".tsx"].map(e=>[e,"script"]),...[".css",".scss",".sass",".less"].map(e=>[e,"style"])]);function De(e){let t=e.split("/"),s=t.pop(),n=s.lastIndexOf(".");return n>0?{dirs:t,stem:s.slice(0,n),extension:s.slice(n)}:{dirs:t,stem:s,extension:""}}function Ie(e){let{dirs:t,stem:s,extension:n}=De(e);return JSON.stringify([t.map(o=>o==="lib"||o==="src"?null:o),s,pt.get(n)??n])}function dt(e){let{dirs:t,stem:s,extension:n}=De(e),o=[s,ht.get(n)??n],i=t.lastIndexOf("node_modules"),a=i===-1?0:i+(t[i+1]?.startsWith("@")?3:2),r=[JSON.stringify([...o,t])];for(let c=a;c<t.length;c++)r.push(JSON.stringify([...o,t.toSpliced(c,1,null)]));return r}var Le=(e,t)=>Math.max(t,e+Math.trunc((6e4-e)/2));function fe({pairs:e,used:t,scoreOf:s},{remaining:n,open:o},{s:i,d:a,score:r},c){let f=Le(r,c);return o.some(l=>l!==a&&!e.has(l)&&s(i,l,f)>=f)||n.some(l=>l!==i&&!t.has(l)&&s(l,a,f)>=f)}function yt(e,t,s,n){let{sources:o,dests:i,pairs:a,used:r,record:c,scoreOf:f}=e,l=Map.groupBy(t.remaining.filter(p=>o[p].type==="file"),p=>Ie(o[p].path)),u=t.open.filter(p=>i[p].type==="file").flatMap(p=>(l.get(Ie(i[p].path))??[]).map(h=>({s:h,d:p,score:f(h,p,0)})));for(let p of u.sort((h,b)=>b.score-h.score))!a.has(p.d)&&!r.has(p.s)&&!(s&&fe(e,t,p,n))&&c(p.d,p.s,p.score)}function mt(e,t,s,n){let{sources:o,dests:i,pairs:a,used:r,record:c,scoreOf:f}=e,l=new Map,u=(m,y,d)=>new Map(y.filter(x=>m[x].type==="file").map(x=>{let S=dt(m[x].path);for(let O of S)(l.get(O)??l.set(O,{sources:[],dests:[]}).get(O))[d].push(x);return[x,S]})),p=u(i,t.open.filter(m=>!a.has(m)),"dests"),h=u(o,t.remaining.filter(m=>!r.has(m)),"sources"),b=(m,y)=>{let d=new Set(m.flatMap(x=>l.get(x)[y]));return d.size===1?[...d][0]:-1};for(let[m,y]of h){let d=b(y,"dests");if(d===-1||b(p.get(d),"sources")!==m)continue;let x={s:m,d,score:f(m,d,0)};s&&fe(e,t,x,n)||c(d,m,x.score)}}function gt(e,t,s){let n=H(e),o=t<6e4&&n.remaining.length*n.open.length<=s*s;yt(e,n,o,t),mt(e,n,o,t)}function ve(e,t){let s=new Map;for(let n of t)s.set(e[n],s.has(e[n])?-1:n);return s}function wt({sourceNames:e,destNames:t,record:s,scoreOf:n},{remaining:o,open:i},a){let r=ve(t,i),c=ve(e,o);for(let f of o){let l=r.get(e[f]);if(l===void 0||l===-1||c.get(e[f])===-1)continue;let u=n(f,l,a);u>=a&&s(l,f,u)}}var le=(e,t)=>t.score-e.score||t.nameScore-e.nameScore;function bt(e,t){if(e.length<ft){e.push(t);return}let s=0;for(let n=1;n<e.length;n++)le(e[n],e[s])>0&&(s=n);le(e[s],t)>0&&(e[s]=t)}function kt({sourceNames:e,destNames:t,pairs:s,used:n,record:o,scoreOf:i},{remaining:a,open:r},c,f){let l=[];for(let h of r){let b=[];for(let m of a)bt(b,{score:i(m,h,c),nameScore:e[m]===t[h]?1:0,dst:h,src:m});l.push(...b)}let u=0,p=h=>{for(;u<f.length&&Le(f[u].score,c)>h;u++){let{s:b,d:m,score:y}=f[u];!s.has(m)&&!n.has(b)&&o(m,b,y)}};for(let{dst:h,src:b,score:m}of l.sort(le)){if(m<c)break;p(m),!s.has(h)&&!n.has(b)&&o(h,b,m)}p(-1/0)}var H=({sources:e,dests:t,pairs:s,used:n})=>({remaining:e.keys().filter(o=>!n.has(o)).toArray(),open:t.keys().filter(o=>!s.has(o)).toArray()}),Pe=e=>e+Math.trunc(.5*(6e4-e));function ue(e,t,{minimum:s,limit:n,byPath:o}){let i=new Map,a=new Set;if(e.length===0||t.length===0)return i;let r=new Map,c=new Map,f=new Map,l=y=>y.type==="file"?c.get(y)??c.set(y,K(y.data)).get(y):null,u=y=>r.get(y)??r.set(y,re(y)).get(y),p=y=>f.get(y)??f.set(y,re(y,Ae)).get(y),h={sources:e,dests:t,pairs:i,used:a,sourceNames:e.map(y=>Re(y.path)),destNames:t.map(y=>Re(y.path)),record(y,d,x){i.set(y,{source:d,score:x}),a.add(d)},bytes:l,scoreOf:(y,d,x)=>ie(l(e[y]),l(t[d]),x,u),punctuatedScoreOf:(y,d,x)=>ie(l(e[y]),l(t[d]),x,p,!0)};if(ut(h),o&>(h,s,n),s>=6e4)return i;wt(h,H(h),Pe(s));let b=H(h);if(b.remaining.length*b.open.length>n*n)return i;let m=o?Ce(h,b,Pe(s),y=>fe(h,b,y,s)):[];return kt(h,H(h),s,m),i}var xt=50,St=1e3;function pe(e,t){let s=Math.min(e.length,t.length);for(let n=0;n<s;n++)if(e[n]!==t[n])return e.codePointAt(n)-t.codePointAt(n);return e.length-t.length}function Ot(e){if(e===!1)return null;let t=e===!0?xt:e;if(typeof t!="number")throw new TypeError(`renames must be a boolean or a percentage, not ${typeof e}`);if(!(t>0&&t<=100))throw new RangeError(`renames must be a percentage above 0 and at most 100, not ${e}`);return Math.max(1,Math.trunc(6e4*t/100))}function Mt({renamesByPath:e,renameLimit:t,renameGroup:s,paths:n,lines:o}){if(typeof e!="boolean")throw new TypeError(`renamesByPath must be a boolean, not ${typeof e}`);if(t!==1/0&&!(Number.isSafeInteger(t)&&t>=0))throw new RangeError(`renameLimit must be a whole number or Infinity, not ${t}`);if(s!==null&&typeof s!="function")throw new TypeError(`renameGroup must be a function, not ${typeof s}`);if(n!=="tree"&&n!=="keys")throw new RangeError(`paths must be 'tree' or 'keys', not ${n}`);if(typeof o!="boolean")throw new TypeError(`lines must be a boolean, not ${typeof o}`)}var Bt=(e,t)=>U(e,t)&&(e.type!=="file"||e.mode===t.mode),_=(e,t,s,n=null)=>({status:e,old:t,new:s,similarity:n}),At=/\.d\.(?:[^./]+\.)?[cm]?ts$/u,Ue=e=>e.endsWith(".mts")?"module":e.endsWith(".cts")?"commonjs":null,$t=/^export\s*\{\s*\}\s*;?$/u;function _e(e){if(e===null)return{proven:!0,runtime:"",loads:!1};let t=G(e);try{return t===void 0?{proven:!1}:oe(t)}catch{return{proven:!1}}}function Et(e){if(![e.old,e.new].filter(o=>o!==null).every(o=>o.type==="file"&&At.test(o.path))||e.old&&e.new&&e.old.mode!==e.new.mode)return e;let s=_e(e.new),n=_e(e.old);return!n.proven||!s.proven||n.runtime!==s.runtime&&!(e.old===null&&$t.test(s.runtime))||n.loads&&e.old&&e.new&&e.old.path!==e.new.path&&Ue(e.old.path)!==Ue(e.new.path)?e:{...e,typeOnly:!0}}function Tt(e,t){let s=[],n=[],o=[];for(let[i,a]of e){let r=t.get(i);r===void 0?o.push(a):r.type!==a.type?n.push(_("type-changed",a,r)):Bt(a,r)||n.push(_("modified",a,r))}for(let[i,a]of t)e.has(i)||s.push(a);return o.sort((i,a)=>pe(i.path,a.path)),s.sort((i,a)=>pe(i.path,a.path)),{changes:n,deleted:o,added:s}}function Ct(e,t,{group:s,...n}){if(s===null)return ue(e,t,n);let o=new Map,i=r=>Map.groupBy(r.keys(),c=>s(r[c].path)),a=i(e);for(let[r,c]of i(t)){let f=a.get(r);if(f!==void 0)for(let[l,{source:u,score:p}]of ue(f.map(h=>e[h]),c.map(h=>t[h]),n))o.set(c[l],{source:f[u],score:p})}return o}function he(e,t,{renames:s=!0,renamesByPath:n=!0,renameLimit:o=St,renameGroup:i=null,paths:a="tree",lines:r=!0,horizon:c,whitespace:f,ignoreCase:l}={}){let u=Ot(s);Mt({renamesByPath:n,renameLimit:o,renameGroup:i,paths:a,lines:r});let p=Q({horizon:c,whitespace:f,ignoreCase:l}),h=a==="keys",{changes:b,deleted:m,added:y}=Tt(ce(e,"old",h),ce(t,"new",h)),d=u===null?new Map:Ct(m,y,{minimum:u,limit:o,byPath:n,group:i});for(let[S,O]of y.entries()){let N=d.get(S);b.push(N===void 0?_("added",null,O):_("renamed",m[N.source],O,Math.trunc(N.score*100/6e4)))}let x=new Set(d.values().map(({source:S})=>S));for(let[S,O]of m.entries())x.has(S)||b.push(_("deleted",O,null));return b.sort((S,O)=>pe((S.new??S.old).path,(O.new??O.old).path)),(r?b.map(S=>({...S,...xe(S.old,S.new,p)})):b).map(Et)}function de(e,t,s){let n=new Map,o=new Set,i=0;for(let r of e){let c=ee(s,r);c===null||!t.has(c)||(n.set(r,c),o.add(c),c!==r&&i++)}for(let r of e)n.has(r)||!t.has(r)||o.has(r)||(n.set(r,r),o.add(r));let a=n.size;for(let r of e){if(n.has(r))continue;let c=ee(s,r)??Se(s,r);for(;t.has(c)||o.has(c);)c=`../${c}`;n.set(r,c),o.add(c)}return{paths:n,paired:a,moved:i}}function Ft(e,t){let s=new Set(e),n=new Set(t),o=(r,c)=>{let f=new Map;for(let p of r)for(let h=p.indexOf("/");h!==-1;h=p.indexOf("/",h+1))c.has(p.slice(h+1))&&f.set(p.slice(0,h+1),(f.get(p.slice(0,h+1))??0)+1);let l=null,u=!1;for(let[p,h]of f)h>(f.get(l)??0)?[l,u]=[p,!1]:h===f.get(l)&&(u=!0);return u?null:l},i=de(s,n,null).paired,a=[[{base:"",other:o(n,s)},s],[{base:o(s,n),other:""},n]].filter(([r])=>r.base!==null&&r.other!==null).map(([r,c])=>({root:r,side:c,...de(s,n,r)})).filter(({side:r,paired:c,moved:f})=>c>i&&f*2>=r.size);return a.length===2&&a[0].paired===a[1].paired?null:a.toSorted((r,c)=>c.paired-r.paired)[0]?.root??null}function j(e,t){let s=[...e],n=new Set(t),o=Ft(s,n);return{root:o,paths:de(s,n,o).paths}}function ye(e,t,s){if(!e&&!t)return null;let n=Map.groupBy([...e??[]],([,i])=>i),o=new Map([...n].map(([i,a])=>[i,te(s,i,a.map(([r])=>r.slice(i.length+1)))]));return new Map([...[...e??[]].map(([i,a])=>[s.paths.get(i)??i,o.get(a)]),...t??[]])}function Ke(e,t,s=new Map,n=new Map,o=null){let i=r=>{let c=s.get(r)??n.get(r);return c===void 0?[...new Set([r,Pt(o,r)??r])]:[c]},a=[];for(let r of e.values()){let c=i(r.parent).map(f=>t.get(Oe(f,r.specifier,r.conditions,r.platform))).find(Boolean);if(c&&!i(r.target).includes(c.target)){let{target:f,...l}=c;a.push({...l,baseTarget:n.get(r.target)??r.target,otherTarget:f})}}return a.sort((r,c)=>r.key.localeCompare(c.key)),{changed:a,totalChanges:a.length}}function P(e){return we(e)??0}function je(e,t){return e===t||e?.format==="base64"&&t?.format==="base64"&&e.data===t.data||e?.format==="digest"&&t?.format==="digest"&&e.digest===t.digest}function me(e){if(e?.kind!=="stasis"||!e.bundle)return null;let{formats:t,executable:s,entries:n}=e.bundle;return o=>({format:t?.get(o),executable:s?.has(o)??!1,entry:n?.has(o)??!1})}function Rt(e,t){return!e||!t?[]:["format","executable","entry"].filter(s=>e[s]!==t[s]).map(s=>({field:s,from:e[s],to:t[s]}))}function ze(e){return(t,s)=>Math.abs(s.delta)-Math.abs(t.delta)||t[e].localeCompare(s[e])}function W(e){return(t,s)=>s.bytes-t.bytes||t[e].localeCompare(s[e])}function Nt(e,t){return typeof e=="string"?`\0text\0${e.toWellFormed()}`:e?.format==="base64"?`\0base64\0${e.data}`:e?.format==="digest"?`\0digest\0${e.digest}`:`\0none\0${t}`}var It=250;function vt(e,t,s,n,o){let i=(c,f,l)=>c.filter(({path:u})=>u!==""&&u.isWellFormed()).map(({path:u},p)=>({name:u,data:Nt(f.get(u),`${l}${p}`)})),a={paths:"keys",renameGroup:o,renameLimit:It,lines:!1},r=he(i(e,s,"a"),i(t,n,"b"),a);return new Map(r.filter(({status:c})=>c==="renamed").map(c=>[c.old.path,c.new.path]))}function Pt(e,t){return e?e.base===""?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}function Dt(){return{baseBytes:0,otherBytes:0,onlyBaseFiles:0,onlyOtherFiles:0,changedFiles:0}}function He(e,t,s,n=j(e.keys(),t.keys()),o=[]){let{root:i,paths:a}=n,r=new Map([...a].map(([k,g])=>[g,k]));e=new Map([...e].map(([k,g])=>[a.get(k),g]));let c=k=>r.get(k)===k?{}:{basePath:r.get(k)},f=(k,g)=>{let B=Rt(o[0]?.(k),o[1]?.(g));return B.length>0?{meta:B}:{}},l=[],u=[],p=[],h=0,b=0,m=0,y=0,d=0,x=0,S=new Map,O=k=>{let g=s(k),B=S.get(g);return B||(B=Dt(),S.set(g,B)),B},N=new Set([...e.keys(),...t.keys()]);for(let k of N){let g=e.has(k),B=t.has(k),E=O(k);if(g&&B){let M=e.get(k),L=t.get(k),F=je(M,L),v=f(r.get(k),k),R=P(M),z=F?R:P(L);if(h+=R,b+=z,E.baseBytes+=R,E.otherBytes+=z,F&&!v.meta)x++;else{let ge=z-R;p.push({path:k,...c(k),baseBytes:R,otherBytes:z,delta:ge,...v,...F?{modified:!1}:{}}),d+=ge,E.changedFiles++}}else if(g){let M=P(e.get(k));h+=M,m+=M,E.baseBytes+=M,E.onlyBaseFiles++,l.push({path:k,...c(k),bytes:M})}else{let M=P(t.get(k));b+=M,y+=M,E.otherBytes+=M,E.onlyOtherFiles++,u.push({path:k,bytes:M})}}let w=vt(l,u,e,t,s);if(w.size>0){let k=new Set(w.values());for(let[g,B]of w){let E=e.get(g),M=t.get(B),L=je(E,M),F=P(E),v=L?F:P(M);m-=F,y-=v,p.push({path:B,renamedFrom:g,basePath:r.get(g),baseBytes:F,otherBytes:v,delta:v-F,modified:!L,...f(r.get(g),B)}),d+=v-F;let R=O(g);R.onlyBaseFiles--,R.onlyOtherFiles--,R.changedFiles++}l.splice(0,l.length,...l.filter(g=>!w.has(g.path))),u.splice(0,u.length,...u.filter(g=>!k.has(g.path)))}let $=[],A=[],C=[],D=[];for(let[k,g]of S){let B=g.baseBytes>0||g.onlyBaseFiles>0||g.changedFiles>0,E=g.otherBytes>0||g.onlyOtherFiles>0||g.changedFiles>0,M=g.onlyBaseFiles+g.onlyOtherFiles+g.changedFiles;B&&!E?$.push({pkg:k,bytes:g.baseBytes}):E&&!B?A.push({pkg:k,bytes:g.otherBytes}):M>0||g.baseBytes!==g.otherBytes?C.push({pkg:k,baseBytes:g.baseBytes,otherBytes:g.otherBytes,delta:g.otherBytes-g.baseBytes}):D.push({pkg:k,bytes:g.baseBytes})}return l.sort(W("path")),u.sort(W("path")),p.sort(ze("path")),$.sort(W("pkg")),A.sort(W("pkg")),C.sort(ze("pkg")),{totals:{baseFiles:e.size,baseBytes:h,otherFiles:t.size,otherBytes:b,onlyBaseFiles:l.length,onlyBaseBytes:m,onlyOtherFiles:u.length,onlyOtherBytes:y,changedFiles:p.length,renamedFiles:w.size,changedDelta:d,unchangedFiles:x,fileDelta:t.size-e.size,byteDelta:b-h,identical:l.length===0&&u.length===0&&p.length===0},files:{onlyBase:l,onlyOther:u,changed:p,root:i,basePaths:a},packages:{onlyBase:$,onlyOther:A,changed:C,unchanged:D}}}function Lt(e,t,s=null){let[n,o]=[e,t],i=ne(n,s),a=ne(o,s),r=j(i.keys(),a.keys()),c=ye(X(n),X(o),r),l=He(i,a,d=>Z(d,{packageDir:c?.get(d)}),r,[me(n),me(o)]),u=V(n),p=V(o),h=(d,x)=>{let S=0;for(let O of x)S+=d.get(O)??0;return S};Object.assign(l.totals,{baseLines:h(u,i.keys()),otherLines:h(p,a.keys())});for(let d of l.files.onlyBase)d.lines=u.get(d.basePath??d.path)??0;for(let d of l.files.onlyOther)d.lines=p.get(d.path)??0;for(let d of l.files.changed)Object.assign(d,{baseLines:u.get(d.basePath??d.path)??0,otherLines:p.get(d.path)??0});l.resolutions=Ke(se(n,s),se(o,s),new Map(l.files.changed.filter(d=>d.renamedFrom!=null).map(d=>[d.basePath,d.path])),l.files.basePaths,l.files.root);let b=d=>Z("",{packageDir:d}),m=J(n,s?i.keys():null,b),y=J(o,s?a.keys():null,b);return l.versionUpdates=Y(m,y),l.packageRows=q(l.packages,m,y),l.scope=s??"",l}export{Lt as prepareComparison};
|
package/out/chunk-AJ4GTATZ.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{b as w,c as f,j as m,l as k}from"./chunk-QYWKC557.js";import{a as h}from"./chunk-TUII34K2.js";var x=3,y=4,H=/^[\w-]{4}$/u,_=/^[\w-]{8}$/u,u="AAAA",R={report:`deepview/finding-link/report/v1
|
|
2
|
-
`,workspace:`deepview/finding-link/workspace/v1
|
|
3
|
-
`},p=new Map;function $(t,e){return`${t}\0${e}`}function I(t){return typeof t=="string"&&H.test(t)}async function T(t,e){let n=R[t];if(!n||typeof e!="string"||!e)return null;let i=$(t,e),o=p.get(i);if(o!==void 0)return o;let r;try{let s=await crypto.subtle.digest("SHA-256",h(n+e));r=new Uint8Array(s).slice(0,x).toBase64({alphabet:"base64url",omitPadding:!0})}catch{return null}return p.set(i,r),r}function E(t,e){return typeof e!="string"||!e?null:p.get($(t,e))??null}function N(t,e){let n=[];for(let[i,o]of[["report",t],["workspace",e]]){if(o==null||o===""){n.push(u);continue}if(!I(o))throw new TypeError(`encodeFindingRef: ${i} must be a link hint token, not a name`);n.push(o)}return n.every(i=>i===u)?null:n[0]===u?`w${n[1]}`:n.join("")}function b(t){let e=[t.slice(0,y),t.slice(y)].map(n=>n===u?null:n);return{report:e[0],workspace:e[1]}}function a({id:t,report:e,workspace:n}={}){if(!f(t))throw new TypeError("encodeFindingRef: a persistent finding id is required");let i=[`finding=${encodeURIComponent(t)}`],o=N(e,n);return o&&i.push(`v=${o}`),i.join("&")}function O(t,e){let n=a(t);return typeof location>"u"?`${e??""}#${n}`:`${location.origin}${e??location.pathname}#${n}`}function A(t){let e=typeof t=="string"?t:typeof location>"u"?"":location.hash;if(!e)return null;let n=e.replace(/^#/u,"");if(!n)return null;let i={id:null,report:null,workspace:null};for(let o of n.split("&")){let r=o.indexOf("=");if(r<0)continue;let s=o.slice(0,r),c=o.slice(r+1);if(!c)continue;if(s==="v"){if(c.length===5&&c[0]==="w"&&I(c.slice(1))){let g=c.slice(1);Object.assign(i,{report:null,workspace:g===u?null:g});continue}if(!_.test(c))continue;Object.assign(i,b(c));continue}if(s!=="finding"||c.length>w*3)continue;let d;try{d=decodeURIComponent(c)}catch{continue}f(d)&&(i.id=d)}return i.id?i:null}function U(t,{managed:e=!1}={}){if(typeof location>"u")return null;let n;try{n=new URL(t)}catch{return null}if(n.href!==t||n.protocol!==location.protocol||n.host!==location.host||n.username||n.password)return null;let i=k(n);if(i?.finding)return{id:i.finding.id,fragment:a(i.finding),path:m(i)};if(e&&i?.view!=="home"&&!/\/(?:index|view)\.html$/u.test(n.pathname))return null;let o=A(n.hash);if(!o)return null;let r=a(o);return{id:o.id,fragment:r,path:`/#${r}`}}function l(t,e){if(typeof t!="string")return!1;let n=t.replaceAll("\\","/");return n.startsWith(`${e}/`)||n.includes(`/${e}/`)}function C(t){let e=!1;for(let n of t){for(let i of n.groups??[])for(let o of i){if(l(o.file,"node_modules"))return"node_modules";l(o.file,"vendor")&&(e=!0)}for(let i of Object.keys(n.tree??{})){if(l(i,"node_modules"))return"node_modules";l(i,"vendor")&&(e=!0)}}return e?"vendor":"dependencies"}export{l as a,C as b,T as c,E as d,a as e,O as f,A as g,U as h};
|