@akasecurity/cli 0.9.0-rc1 → 0.9.1
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/README.md +3 -3
- package/dist/cli.js +2559 -546
- package/package.json +4 -4
- package/web-ui/web-ui/.next/BUILD_ID +1 -1
- package/web-ui/web-ui/.next/app-build-manifest.json +58 -58
- package/web-ui/web-ui/.next/app-path-routes-manifest.json +7 -7
- package/web-ui/web-ui/.next/build-manifest.json +2 -2
- package/web-ui/web-ui/.next/prerender-manifest.json +3 -3
- package/web-ui/web-ui/.next/server/app/(app)/activity/page.js +2 -2
- package/web-ui/web-ui/.next/server/app/(app)/activity/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/activity/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/data-shares/page.js +2 -2
- package/web-ui/web-ui/.next/server/app/(app)/data-shares/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/data-shares/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/detections/page.js +2 -2
- package/web-ui/web-ui/.next/server/app/(app)/detections/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/detections/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page.js +2 -2
- package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page.js +2 -2
- package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/exceptions/page.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/exceptions/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/exceptions/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/findings/page.js +2 -2
- package/web-ui/web-ui/.next/server/app/(app)/findings/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/findings/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/inventory/page.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/inventory/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/inventory/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/policies/page.js +2 -2
- package/web-ui/web-ui/.next/server/app/(app)/policies/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/policies/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/scan/page.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/scan/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/scan/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/security/page.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/security/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/security/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/settings/page.js +2 -2
- package/web-ui/web-ui/.next/server/app/(app)/settings/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/settings/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/updates/page.js +2 -2
- package/web-ui/web-ui/.next/server/app/(app)/updates/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/updates/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app/_not-found.html +1 -1
- package/web-ui/web-ui/.next/server/app/_not-found.rsc +2 -2
- package/web-ui/web-ui/.next/server/app/index.html +1 -1
- package/web-ui/web-ui/.next/server/app/index.rsc +2 -2
- package/web-ui/web-ui/.next/server/app/page_client-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/app-paths-manifest.json +7 -7
- package/web-ui/web-ui/.next/server/chunks/{366.js → 244.js} +92 -25
- package/web-ui/web-ui/.next/server/chunks/264.js +1 -0
- package/web-ui/web-ui/.next/server/chunks/291.js +647 -0
- package/web-ui/web-ui/.next/server/chunks/45.js +1 -1
- package/web-ui/web-ui/.next/server/chunks/461.js +5 -5
- package/web-ui/web-ui/.next/server/chunks/773.js +4 -4
- package/web-ui/web-ui/.next/server/chunks/983.js +2 -0
- package/web-ui/web-ui/.next/server/functions-config-manifest.json +5 -5
- package/web-ui/web-ui/.next/server/middleware-manifest.json +5 -5
- package/web-ui/web-ui/.next/server/pages/404.html +1 -1
- package/web-ui/web-ui/.next/server/pages/500.html +1 -1
- package/web-ui/web-ui/.next/server/server-reference-manifest.js +1 -1
- package/web-ui/web-ui/.next/server/server-reference-manifest.json +1 -1
- package/web-ui/web-ui/.next/static/chunks/{24-55b96836aea5ce23.js → 24-d36fb6bd72e29537.js} +2 -2
- package/web-ui/web-ui/.next/static/chunks/561-52ad6ae6bf64b471.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/activity/{page-0c208c8b275a69ac.js → page-797e2ce43b8db7e1.js} +1 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/data-shares/{page-041187c76bd42461.js → page-d9e9023871035a2d.js} +1 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/detections/page-5bd8e04955058e46.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/[id]/page-a254c9fc7cc27b97.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/new/{page-2cfe42c3dd4833c3.js → page-622151ff8e6960c8.js} +1 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/page-c1221106bd6ba356.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/findings/{page-d33f3999e89c7e77.js → page-fc68b0fb9b669a03.js} +1 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/page-68418378cfb10a0f.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/page-2b9ea3e95dbe82fb.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/page-315b8b57329d5eb6.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/updates/page-77adb595bb447040.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/{layout-40fea3e270a8e120.js → layout-8b19b03146218dc7.js} +1 -1
- package/web-ui/web-ui/.next/static/css/{43f95c94ecc1bd17.css → 500a1c2bf0fc64fb.css} +1 -1
- package/web-ui/web-ui/.next/server/chunks/484.js +0 -580
- package/web-ui/web-ui/.next/server/chunks/900.js +0 -1
- package/web-ui/web-ui/.next/server/chunks/918.js +0 -2
- package/web-ui/web-ui/.next/static/chunks/561-c3388f066f813e17.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/detections/page-481fedcbfb474cef.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/[id]/page-a20e7d7a2f0ad507.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/page-849d66cc2cd77cb6.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/page-76edd10592ba3cb1.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/page-50b604f229747240.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/page-92d1086c8e8ed3bf.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/updates/page-c3c1671d32547619.js +0 -1
- /package/web-ui/web-ui/.next/static/{unUYwnPVSRwxtrUFgSAxr → ez8SLWYcUCScGuFekZ-G_}/_buildManifest.js +0 -0
- /package/web-ui/web-ui/.next/static/{unUYwnPVSRwxtrUFgSAxr → ez8SLWYcUCScGuFekZ-G_}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=900,exports.ids=[900],exports.modules={48900:(a,b,c)=>{function d(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}c.d(b,{sE:()=>o,E$:()=>n,SQ:()=>l});class e{match(a,b){if("keyword"!==b.matcher.type)return[];let{keywords:c,caseSensitive:e}=b.matcher,f=[];for(let b of c){let c;if(0===b.length)continue;if(f.length>=1e4)break;let g=new RegExp(d(b),e?"gu":"giu");for(;null!==(c=g.exec(a))&&(f.push({start:c.index,end:c.index+c[0].length}),!(f.length>=1e4)););}return f}}class f{match(a,b){let c;if("regex"!==b.matcher.type)return[];let{pattern:d,flags:e,captureGroup:f}=b.matcher,g=new RegExp(d,e.includes("d")?e:`${e}d`),h=[];for(;null!==(c=g.exec(a));){let a=null!=f?c[f]:c[0];if(0===c[0].length&&g.lastIndex++,a&&h.length<1e4){let b=null!=f?c.indices?.[f]:void 0,d=b?b[0]:c.index;h.push({start:d,end:d+a.length})}if(!e.includes("g")||h.length>=1e4)break}return h}}let g=new e,h=new f,i=new Map,j={entropy:(a,b)=>(function(a,b=3.5,c=20){return a.length>=c&&function(a){let b={};for(let c of a)b[c]=(b[c]??0)+1;let c=0;for(let d of Object.values(b)){let b=d/a.length;c-=b*Math.log2(b)}return c}(a)>=b})(a,k(b,"threshold"),k(b,"minLength")),luhn:a=>(function(a){let b=a.replace(/\D/g,"");if(b.length<13)return!1;let c=0,d=!0;for(let a=b.length-1;a>=0;a--){let e=parseInt(b[a]??"0",10);!d&&(e*=2)>9&&(e-=9),c+=e,d=!d}return c%10==0})(a)};function k(a,b){let c=a?.[b];return"number"==typeof c&&Number.isFinite(c)?c:void 0}function l(a,b,c){let e=b??[...i.values()].flatMap(a=>a.rules),f=c?.filePath?function(a){let b=a.slice(Math.max(a.lastIndexOf("/"),a.lastIndexOf("\\"))+1),c=b.lastIndexOf(".");return c>0?b.slice(c).toLowerCase():void 0}(c.filePath):void 0,k=[];for(let b of e){let c;if(function(a,b){return!a.appliesTo||void 0===b||a.appliesTo.extensions.some(a=>a.toLowerCase()===b)}(b,f)){if("keyword"===b.matcher.type)c=g.match(a,b);else{if("regex"!==b.matcher.type)continue;c=h.match(a,b)}for(let d of c){let c=a.slice(d.start,d.end);(function(a,b){let c=a.postValidators;if(!c||0===c.length)return!0;for(let a of c){let c="string"==typeof a?a:a.name,d="string"==typeof a?void 0:a.config,e=j[c];if(e&&!e(b,d))return!1}return!0})(b,c)&&k.push({rule:b,match:{ruleId:b.id,category:b.category,severity:b.severity,span:d,rawMatch:c,confidence:.9}})}}}let l=[];for(let b of k){let c=b.rule.requiresNearby;if(!c){l.push(b.match);continue}if(!function(a,b,c){let e=a.rule.requiresNearby;if(!e)return!0;let f=e.windowChars,{start:g,end:h}=a.match.span,i=g-f,j=h+f,k=e.categories,l=e.ruleIds;if(k?.length||l?.length)for(let c of b){if(c===a)continue;let b=c.match.span;if(!(b.end<i)&&!(b.start>j)&&(c.match.ruleId!==a.match.ruleId&&k?.includes(c.match.category)||l?.includes(c.match.ruleId)))return!0}let m=e.labels;if(m&&m.length>0){let a=c.slice(Math.max(0,i),j);for(let b of m){let c=b.trim();if(0!==c.length&&RegExp(`(?<![A-Za-z0-9])${d(c)}(?![A-Za-z0-9])`,"i").test(a))return!0}}return!1}(b,k,a))continue;let e=c.confidenceBoost;l.push(e?{...b.match,confidence:Math.min(.99,b.match.confidence+e)}:b.match)}return l}let m={critical:3,high:2,medium:1,low:0};function n(a,b){if(0===b.length)return a;let c=[...b].sort((a,b)=>a.span.start-b.span.start||a.span.end-b.span.end),d=[];for(let a of c){let b=m[a.severity],c=d[d.length-1];c&&a.span.start<c.end?(c.end=Math.max(c.end,a.span.end),b>c.rank&&(c.rank=b,c.category=a.category)):d.push({start:a.span.start,end:a.span.end,category:a.category,rank:b})}let e=a;for(let a of[...d].reverse()){let b=`[REDACTED:${a.category.toUpperCase()}]`;e=e.slice(0,a.start)+b+e.slice(a.end)}return e}function o(a){if(a.length<=5)return"***";let b=a.indexOf("@");if(b>0&&b<a.length-1){let c=a.slice(b+1);if(c.includes(".")){let d=a.slice(0,b),e=d.length<=1?d:d.charAt(0)+"*".repeat(d.length-1);return`${e}@${c}`}}return`${a.charAt(0)}${"*".repeat(6)}${a.charAt(a.length-1)}`}let p=new Set(["prettier","eslint","biome","black","ruff","gofmt","rustfmt","node","npx","npm","pnpm","yarn","make","git","jq","echo"]);JSON.stringify({kind:"hook-conflict",mutation:/(--write|--fix|\s-w\b|\s-i\b|(?<![\d&>])>\s?\S)/.source,note:"two hooks on the same event with overlapping matchers, both mutating the tool target"}),JSON.stringify({kind:"hook-unknown",knownTools:[...p]}),JSON.stringify({kind:"hook-external-egress",pattern:/\b(curl|wget|nc|ncat|netcat|ssh|scp|rsync)\b|https?:\/\//.source})}};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
exports.id=918,exports.ids=[918],exports.modules={44507:a=>{function b(a){return Array.isArray(a)?a:[a]}let c=void 0,d=/^\s+$/,e=/(?:[^\\]|^)\\$/,f=/^\\!/,g=/^\\#/,h=/\r?\n/g,i=/^\.{0,2}\/|^\.{1,2}$/,j=/\/$/,k="node-ignore";"undefined"!=typeof Symbol&&(k=Symbol.for("node-ignore"));let l=k,m=(a,b,c)=>(Object.defineProperty(a,b,{value:c}),c),n=/([0-z])-([0-z])/g,o=()=>!1,p=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(a,b,c)=>b+(0===c.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(a,b)=>{let{length:c}=b;return b.slice(0,c-c%2)+" "}],[/[\\$.|*+(){^]/g,a=>`\\${a}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*(?:\\\*\\\*\\\/)+/,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(a,b,c)=>b+6<c.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(a,b,c)=>b+c.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(a,b,c,d,e)=>"\\"===b?`\\[${c}${(a=>{let{length:b}=a;return a.slice(0,b-b%2)})(d)}${e}`:"]"===e&&d.length%2==0?`[${(a=>a.startsWith("!")||a.startsWith("\\^")?`^${a.slice("!"===a[0]?1:2)}`:a)(c.replace(n,(a,b,c)=>b.charCodeAt(0)<=c.charCodeAt(0)?a:""))}${d}]`:"[]"],[/(?:[^*])$/,a=>/\/$/.test(a)?`${a}$`:`${a}(?=$|\\/$)`]],q=/(^|\\\/)?\\\*$/,r="regex",s="checkRegex",t={[r](a,b){let c=b?`${b}[^/]+`:"[^/]*";return`${c}(?=$|\\/$)`},[s](a,b){let c=b?`${b}[^/]*`:"[^/]*";return`${c}(?=$|\\/$)`}};class u{constructor(a,b,c,d,e,f){this.pattern=a,this.mark=b,this.negative=e,m(this,"body",c),m(this,"ignoreCase",d),m(this,"regexPrefix",f)}get regex(){let a="_"+r;return this[a]?this[a]:this._make(r,a)}get checkRegex(){let a="_"+s;return this[a]?this[a]:this._make(s,a)}_make(a,b){let c=this.regexPrefix.replace(q,t[a]);return m(this,b,this.ignoreCase?RegExp(c,"i"):new RegExp(c))}}class v{constructor(a){this._ignoreCase=a,this._rules=[]}_add(a){let b;if(a&&a[l]){this._rules=this._rules.concat(a._rules._rules),this._added=!0;return}if("string"==typeof a&&(a={pattern:a}),(b=a.pattern)&&"string"==typeof b&&!d.test(b)&&!e.test(b)&&0!==b.indexOf("#")){let b=(({pattern:a,mark:b},c)=>{let d,e=!1,h=a;0===h.indexOf("!")&&(e=!0,h=h.substr(1));let i=(d=h=h.replace(f,"!").replace(g,"#"),p.reduce((a,[b,c])=>a.replace(b,c.bind(d)),d));return new u(a,b,h,c,e,i)})(a,this._ignoreCase);this._added=!0,this._rules.push(b)}}add(a){return this._added=!1,b("string"==typeof a?a.split(h).filter(Boolean):a).forEach(this._add,this),this._added}test(a,b,d){let e,f=!1,g=!1;this._rules.forEach(h=>{let{negative:i}=h;(g!==i||f===g)&&(!i||f||g||b)&&h[d].test(a)&&(f=!i,g=i,e=i?c:h)});let h={ignored:f,unignored:g};return e&&(h.rule=e),h}}let w=(a,b)=>{throw new b(a)},x=(a,b,c)=>"string"!=typeof a?c(`path must be a string, but got \`${b}\``,TypeError):a?!x.isNotRelative(a)||c(`path should be a \`path.relative()\`d string, but got "${b}"`,RangeError):c("path must not be empty",TypeError),y=a=>i.test(a);x.isNotRelative=y,x.convert=a=>a;class z{constructor({ignorecase:a=!0,ignoreCase:b=a,allowRelativePaths:c=!1}={}){m(this,l,!0),this._rules=new v(b),this._strictPathCheck=!c,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(a){return this._rules.add(a)&&this._initCache(),this}addPattern(a){return this.add(a)}_test(a,b,c,d){let e=a&&x.convert(a);return x(e,a,this._strictPathCheck?w:o),this._t(e,b,c,d)}checkIgnore(a){if(!j.test(a))return this.test(a);let b=a.split("/").filter(Boolean);if(b.pop(),b.length){let a=this._t(b.join("/")+"/",this._testCache,!0,b);if(a.ignored)return a}return this._rules.test(a,!1,s)}_t(a,b,c,d){if(a in b)return b[a];if(d||(d=a.split("/").filter(Boolean)),d.pop(),!d.length)return b[a]=this._rules.test(a,c,r);let e=this._t(d.join("/")+"/",b,c,d);return b[a]=e.ignored?e:this._rules.test(a,c,r)}ignores(a){return this._test(a,this._ignoreCache,!1).ignored}createFilter(){return a=>!this.ignores(a)}filter(a){return b(a).filter(this.createFilter())}test(a){return this._test(a,this._testCache,!0)}}let A=a=>new z(a),B=()=>{x.convert=a=>/^\\\\\?\\/.test(a)||/["<>|\u0000-\u001F]+/u.test(a)?a:a.replace(/\\/g,"/");let a=/^[a-z]:\//i;x.isNotRelative=b=>a.test(b)||y(b)};"undefined"!=typeof process&&"win32"===process.platform&&B(),a.exports=A,A.default=A,a.exports.isPathValid=a=>x(a&&x.convert(a),a,o),m(a.exports,Symbol.for("setupWindows"),B)},61918:(a,b,c)=>{"use strict";c.d(b,{S1:()=>u,tq:()=>w,IL:()=>$,UE:()=>x,f2:()=>Y,u5:()=>_,OF:()=>G});var d=c(31421),e=c(48161);let f="win32"===process.platform,g="win32"===process.platform?{cwd:(0,e.homedir)()}:{};function h(a,b,c=15e3){try{let e=(0,d.execFileSync)(a,b,{encoding:"utf8",timeout:c,stdio:["ignore","pipe","pipe"],shell:f,...g});return{ok:!0,stdout:e.trim(),stderr:""}}catch(a){return{ok:!1,stdout:"string"==typeof a.stdout?a.stdout.trim():"",stderr:"string"==typeof a.stderr?a.stderr.trim():""}}}function i(a){h("claude",["plugin","marketplace","add",a],6e4)}let j=[{id:"claude-code",name:"Claude Code",sourceTool:"claude-code",description:"Hooks Claude Code sessions to detect + redact sensitive data in prompts, responses, and file writes.",npmPackage:"@akasecurity/ai-tc-claude-code",pluginName:"ai-tc",marketplace:"akasecurity",marketplaceSource:"akasecurity/marketplace"}];function k(a){if(a.pluginName&&a.marketplace)return`${a.pluginName}@${a.marketplace}`}var l=c(73024),m=c(76760),n=c(73136);function o(a){let b=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-.]+))?$/.exec(a.trim());return b?{core:[Number(b[1]),Number(b[2]),Number(b[3])],pre:b[4]?b[4].split("."):[]}:null}function p(a,b){return function(a,b){let c=o(a),d=o(b);if(!c||!d)return 0;for(let a=0;a<3;a++){let b=c.core[a]??0,e=d.core[a]??0;if(b!==e)return b<e?-1:1}return function(a,b){if(0===a.length&&0===b.length)return 0;if(0===a.length)return 1;if(0===b.length)return -1;let c=Math.min(a.length,b.length);for(let d=0;d<c;d++){let c=a[d]??"",e=b[d]??"";if(c===e)continue;let f=/^\d+$/.test(c),g=/^\d+$/.test(e);if(f&&!g)return -1;if(!f&&g)return 1;if(f&&g)return Number(c)<Number(e)?-1:1;return c<e?-1:1}return a.length===b.length?0:a.length<b.length?-1:1}(c.pre,d.pre)}(a,b)>0}let q="@akasecurity/cli";function r(a){return"object"==typeof a&&null!==a}function s(a){let b=h("npm",["view",a,"version"],15e3);if(!b.ok||!b.stdout)return null;let c=b.stdout.split("\n").pop()?.trim();return c&&/^\d/.test(c)?c:null}function t(a,b,c){if("inherit"===c)return{ok:function(a,b){try{return(0,d.execFileSync)(a,b,{stdio:"inherit",shell:f,...g}),!0}catch{return!1}}(a,b),output:""};let e=h(a,b,6e5);return{ok:e.ok,output:[e.stdout,e.stderr].filter(Boolean).join("\n")}}function u(a="capture"){return t("npm",["install","-g",`${q}@latest`],a)}function v(a){let b=j.find(b=>b.id===a);if(!b)return{ok:!1,output:`unknown agent '${a}'`};let c=k(b);return c?!function(){var a="claude";let b="win32"===process.platform?"where":"command",c="win32"===process.platform?[a]:["-v",a];try{let a=(0,d.spawnSync)(b,c,{stdio:"ignore",shell:"win32"!==process.platform,...g});return 0===a.status}catch{return!1}}()?{ok:!1,output:`the \`claude\` CLI isn't on your PATH — install Claude Code, then run \`claude plugin install ${c}\` (or update with \`claude plugin update ${c}\`).`}:{ref:c,marketplaceSource:b.marketplaceSource}:{ok:!1,output:`${b.name} has no automated install path yet.`}}function w(a,b="capture"){let c=v(a);return"ok"in c?c:(c.marketplaceSource&&i(c.marketplaceSource),t("claude",["plugin","update",c.ref],b))}function x(a,b="capture"){let c=v(a);return"ok"in c?c:(c.marketplaceSource&&i(c.marketplaceSource),t("claude",["plugin","install",c.ref],b))}var y=c(77598),z=c(48900),A=c(85674),B=c(44507),C=c.n(B);let D=new Set(["node_modules",".git","dist",".next","coverage",".turbo","build","out"]);function E(a,b){try{let c=(0,l.readFileSync)((0,m.join)(a,b),"utf8");return{base:a,matcher:C()().add(c)}}catch{return}}function F(a,b,c){let d="unmatched";for(let e of a){let a=(0,m.relative)(e.base,b).split(m.sep).join("/")+(c?"/":""),f=e.matcher.test(a);f.ignored?d="ignored":f.unignored&&(d="unignored")}return d}function G(a,b,c={}){let d=0,e=0,f=[];for(let{path:g,gitignored:h}of function*(a){let b;try{b=(0,l.statSync)(a)}catch{return}if(b.isFile()){b.size<=1e6&&(yield{path:a,gitignored:!1});return}b.isDirectory()&&(yield*function* a(b,c,d,e){let f=e?void 0:E(b,".gitignore"),g=f?[...c,f]:c,h=E(b,".akaignore"),i=h?[...d,h]:d;for(let c of(0,l.readdirSync)(b,{withFileTypes:!0})){let d=(0,m.join)(b,c.name);if(c.isDirectory()){let b=F(i,d,!0);if("unignored"!==b&&(D.has(c.name)||c.name.startsWith(".")||"ignored"===b))continue;let f=e||"ignored"===F(g,d,!0);yield*a(d,g,i,f)}else if(c.isFile()){let a;if("ignored"===F(i,d,!1))continue;try{a=(0,l.statSync)(d).size}catch{continue}if(a>1e6)continue;yield{path:d,gitignored:e||"ignored"===F(g,d,!1)}}}}(a,[],[],!1))}(b)){let b;try{b=(0,l.readFileSync)(g,"utf8")}catch{continue}d++;let i=(0,z.SQ)(b,c.rules);if(0===i.length)continue;let j=(0,y.randomUUID)(),k={filePath:g};h&&(k.gitignored=!0);let m={id:j,sourceTool:c.sourceTool??"cli",kind:"code_change",occurredAt:new Date().toISOString(),contentHash:(0,y.createHash)("sha256").update(b).digest("hex"),content:(0,z.E$)(b,i),metadata:k},n=i.map(a=>({id:(0,y.randomUUID)(),eventId:j,ruleId:a.ruleId,category:a.category,severity:a.severity,span:a.span,maskedMatch:(0,z.sE)(a.rawMatch),actionTaken:c.ruleActions?.get(a.ruleId)??A.unw[a.category],confidence:a.confidence}));a.recordCapture(m,n),f.push({path:g,gitignored:h,findings:n}),e+=n.length}return{scanned:d,findings:e,files:f}}var H=c(78366),I=c(96046);let J=I.Yj().optional().transform(a=>{if(void 0===a)return;let b=a.trim().toLowerCase();return""!==b&&"false"!==b&&"0"!==b}).catch(void 0),K=I.vk(a=>{if("string"!=typeof a||""!==a.trim())return a},I.Yj().optional()).catch(void 0);function L(a){try{return N(a)}catch{return}}function M(a){try{let b=N(a);if(!b)return;return O(b)?.headRoot??b}catch{return}}function N(a){let b=a;for(;;){if((0,l.existsSync)((0,m.join)(b,".git")))return b;let a=(0,m.dirname)(b);if(a===b)return;b=a}}function O(a){let b=(0,m.join)(a,".git");try{if((0,l.statSync)(b).isDirectory())return{configPath:(0,m.join)(b,"config"),headRoot:a}}catch{return}let c=/^gitdir:\s*(.+?)\s*$/m.exec(P(b)??"")?.[1];if(!c)return;let d=(0,m.isAbsolute)(c)?c:(0,m.join)(a,c);if((0,l.existsSync)((0,m.join)(d,"config")))return{configPath:(0,m.join)(d,"config"),headRoot:a};let e=P((0,m.join)(d,"commondir"))?.trim();if(!e)return;let f=(0,m.isAbsolute)(e)?e:(0,m.join)(d,e),g=".git"===(0,m.basename)(f)?(0,m.dirname)(f):a;return{configPath:(0,m.join)(f,"config"),headRoot:g}}function P(a){try{return(0,l.readFileSync)(a,"utf8")}catch{return}}I.Ik({CLAUDE_CODE_USE_BEDROCK:J,CLAUDE_CODE_USE_VERTEX:J,ANTHROPIC_BASE_URL:K});let Q=new Set([".git","node_modules",".pnpm-store",".venv","venv","__pycache__",".next",".turbo","dist","build","out","coverage","target",".cache"]);function R(a,b,c){let d=!1;for(let e of a){let a=(0,m.relative)(e.base,b).split(m.sep).join("/")+(c?"/":""),f=e.matcher.test(a);f.ignored?d=!0:f.unignored&&(d=!1)}return d}let S=new Set(["pnpm-lock.yaml","package-lock.json","yarn.lock","cargo.lock","poetry.lock","gemfile.lock","composer.lock","go.sum"]),T=new Set([".yml",".yaml",".toml",".ini",".properties",".conf"]),U=new Set([".md",".mdx",".rst",".adoc",".txt"]),V=new Set(["cmakelists.txt","constraints.txt","robots.txt"]),W=new Set([".csv",".tsv",".parquet",".sql",".jsonl",".ndjson"]),X=new Set(["package.json","dockerfile","makefile","justfile",".gitignore",".gitattributes",".npmrc",".nvmrc",".editorconfig",".akaignore"]);function Y(a,b){try{let c=(0,m.resolve)(b);(0,l.statSync)(c);let d=function(a){try{let b=N(a);if(!b)return;let c=O(b),d=c?.headRoot??b,e=c?function(a){let b=P(a.configPath);if(void 0===b)return;let c=function(a){let b,c={};for(let d of a.split("\n")){let a=d.trim(),e=/^\[remote "([^"]+)"\]$/.exec(a);if(e){b=e[1];continue}if(a.startsWith("[")){b=void 0;continue}if(b&&!(b in c)){let d=/^url\s*=\s*(.+)$/.exec(a)?.[1];d&&(c[b]=d.trim())}}return c}(b);return c.origin??Object.values(c)[0]}(c):void 0;return{url:e??d.split(m.sep).join("/"),name:(e?function(a){let b=a.replace(/\.git$/,"").split(/[/:]/).filter(Boolean).pop();return b&&b.length>0?b:void 0}(e):void 0)??(0,m.basename)(d)}}catch{return}}(c);if(!d)return null;let e=a.sourceProject.upsert({url:d.url,name:d.name,attributes:{}}),f=function(a){try{let b=L(a);if(!b)return;let c=M(a)!==b,d=[],e={lostSubtree:!1},f=function a(c,f){let g;try{g=(0,l.readdirSync)(c,{withFileTypes:!0,encoding:"utf8"})}catch{return e.lostSubtree=!0,!1}let h=function(a){try{let b=(0,l.readFileSync)((0,m.join)(a,".gitignore"),"utf8");return{base:a,matcher:C()().add(b)}}catch{return}}(c),i=h?[...f,h]:f;for(let e of g){let f=(0,m.join)(c,e.name);if(e.isDirectory()){if(Q.has(e.name)||R(i,f,!0)||(0,l.existsSync)((0,m.join)(f,".git")))continue;if(a(f,i))return!0;continue}if(!e.isFile()||".git"===e.name||R(i,f,!1))continue;if(d.length>=2e4)return!0;let g=(0,m.relative)(b,f).split(m.sep).join("/");d.push({path:g,name:(0,m.basename)(e.name),origin:function(a,b){let c=b.toLowerCase(),d=c.lastIndexOf("."),e=d>0?c.slice(d):"",f=a.split("/");return S.has(c)||c.includes(".generated.")||f.includes("__generated__")||f.includes("generated")||".map"===e||c.endsWith(".min.js")||c.endsWith(".min.css")?"generated":f.includes("vendor")||f.includes("third_party")?"vendored":V.has(c)||".txt"===e&&c.startsWith("requirements")?"config":U.has(e)||c.startsWith("license")||"docs"===f[0]?"docs":W.has(e)||f.includes("fixtures")||f.includes("__fixtures__")?"data":X.has(c)||T.has(e)||c.startsWith(".")||c.includes(".config.")||c.startsWith("tsconfig")?"config":"source"}(g,e.name),defaultAccess:"approved"})}return!1}(b,[])||e.lostSubtree||c;if(0===d.length)return;return d.sort((a,b)=>a.path.localeCompare(b.path)),{files:d,truncated:f,scannedAt:new Date().toISOString()}}catch{return}}(c);f&&a.recordProjectFiles(e,f);let g=M(c),h=L(c);return g&&h&&a.reconcileWorktreeProjects(e,g,h),{projectId:e,name:d.name,url:d.url,fileCount:f?.files.length??0,truncated:f?.truncated??!1}}catch{return null}}function Z(a){return(0,m.join)((0,H.KS)(a),"update-check.json")}function $(a){try{(0,l.rmSync)(Z(a),{force:!0})}catch{}}function _(a){let b=function(a){let b=Z(a);if(!(0,l.existsSync)(b))return null;try{let a=JSON.parse((0,l.readFileSync)(b,"utf8"));if(!r(a)||"number"!=typeof a.checkedAt||!r(a.report))return null;return a}catch{return null}}(a);var c={checkedAt:Date.now(),report:function(a){let b=a.viewVersion(q),c=[{id:"cli",name:"aka CLI",kind:"cli",installed:a.cliInstalled,latest:b,updateAvailable:null!==a.cliInstalled&&null!==b&&p(b,a.cliInstalled)}],d=[];for(let b of j){let e=k(b);if(!e||!b.npmPackage)continue;let f=a.viewVersion(b.npmPackage),g=a.installed.get(e)??null;if(null===g){d.push({id:b.id,name:b.name,latest:f});continue}c.push({id:b.id,name:b.name,kind:"plugin",installed:g,latest:f,updateAvailable:null!==f&&p(f,g)})}return{statuses:c,availablePlugins:d}}({viewVersion:s,installed:function(a=(0,m.join)((0,e.homedir)(),".claude")){let b,c=new Map,d=(0,m.join)(a,"plugins","installed_plugins.json");if(!(0,l.existsSync)(d))return c;try{b=JSON.parse((0,l.readFileSync)(d,"utf8"))}catch{return c}if(!r(b)||!r(b.plugins))return c;for(let[a,d]of Object.entries(b.plugins)){if(!Array.isArray(d)||0===d.length)continue;let b=d.find(a=>r(a)&&"user"===a.scope)??d.find(a=>r(a));b&&"string"==typeof b.version&&c.set(a,b.version)}return c}(),cliInstalled:function(a){let b=(void 0)??(0,m.dirname)((0,n.fileURLToPath)("file:///home/runner/work/ai-tc/ai-tc/packages/local-ops/src/updates.ts"));for(let a=0;a<6;a++){let a=(0,m.join)(b,"package.json");if((0,l.existsSync)(a))try{let b=JSON.parse((0,l.readFileSync)(a,"utf8"));if(r(b)&&b.name===q&&"string"==typeof b.version)return b.version}catch{}let c=(0,m.dirname)(b);if(c===b)break;b=c}return null}()}),notifiedPluginIds:b?.notifiedPluginIds??[]};if((0,l.existsSync)((0,H.KS)(a)))try{(0,l.writeFileSync)(Z(a),`${JSON.stringify(c,null,2)}
|
|
2
|
-
`)}catch{}}}};
|