@akasecurity/cli 0.9.11 → 0.9.13
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/dist/cli.js +4334 -2752
- package/extension/background.js +1 -1
- package/extension/bridge.js +1 -0
- package/extension/content.js +1 -1
- package/extension/manifest.json +24 -1
- package/extension/popup.html +9 -0
- package/extension/popup.js +1 -1
- package/extension/tap.js +1 -0
- package/native-host/host.js +2320 -837
- package/native-host/scan-worker.js +441 -30
- package/native-host/sync.js +578 -92
- package/package.json +7 -7
- package/web-ui/web-ui/.next/BUILD_ID +1 -1
- package/web-ui/web-ui/.next/app-build-manifest.json +84 -84
- 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 +18 -18
- 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 +1 -1
- 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 +2 -2
- 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 +3 -3
- 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 +2 -2
- 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/(app)/vault/page.js +2 -2
- package/web-ui/web-ui/.next/server/app/(app)/vault/page.js.nft.json +1 -1
- package/web-ui/web-ui/.next/server/app/(app)/vault/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/121.js +1 -0
- package/web-ui/web-ui/.next/server/chunks/130.js +1026 -0
- package/web-ui/web-ui/.next/server/chunks/290.js +6 -0
- package/web-ui/web-ui/.next/server/chunks/3.js +1017 -0
- package/web-ui/web-ui/.next/server/chunks/300.js +1 -0
- package/web-ui/web-ui/.next/server/chunks/475.js +1 -1
- package/web-ui/web-ui/.next/server/chunks/589.js +1 -1
- package/web-ui/web-ui/.next/server/chunks/662.js +1 -0
- package/web-ui/web-ui/.next/server/chunks/70.js +1 -0
- package/web-ui/web-ui/.next/server/chunks/935.js +1 -1
- 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/421-cc967c01935826d1.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/{526-026c69b926a17dbb.js → 526-f0156de7831566b3.js} +1 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/activity/page-41fba0354cc950be.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/data-shares/page-d2e03c3ab61af01a.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/detections/page-566036afcc87e4c9.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/{error-dead9507fc349f26.js → error-4baae46bcee63009.js} +1 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/[id]/page-73dbcf0078b82ec4.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/new/{page-0695d0006518b2cb.js → page-8051503193da1baf.js} +1 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/page-32c8a853bc8b5d34.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/findings/page-dc8fadb56d6d1e77.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/page-9b49ef42350ea7bd.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/{layout-dc7ae7664dcdc3c5.js → layout-f5f361f817f90ac9.js} +1 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/policies/page-01b303adf3c8ee56.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/page-8db3b62245c333a3.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/security/page-7a4ba61626e0d130.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/page-0930b49f6ab951bc.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/updates/page-9b04f3441a1a3f96.js +1 -0
- package/web-ui/web-ui/.next/static/chunks/app/(app)/vault/{page-f37ab8e1edc67663.js → page-911a76e75f5a1419.js} +1 -1
- package/web-ui/web-ui/.next/static/css/298a651f6af38209.css +2 -0
- package/web-ui/web-ui/dist/scan-worker.js +441 -30
- package/web-ui/web-ui/.next/server/chunks/471.js +0 -950
- package/web-ui/web-ui/.next/server/chunks/7.js +0 -1
- package/web-ui/web-ui/.next/server/chunks/739.js +0 -1
- package/web-ui/web-ui/.next/server/chunks/766.js +0 -6
- package/web-ui/web-ui/.next/server/chunks/851.js +0 -1
- package/web-ui/web-ui/.next/server/chunks/905.js +0 -959
- package/web-ui/web-ui/.next/static/chunks/907-2ba9428e7818b656.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/activity/page-c5a55618d187c906.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/data-shares/page-b1c76b8c00e1ae2a.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/detections/page-159167b47a005b33.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/[id]/page-5e872a82af85ef64.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/page-adec99f2f4bbc180.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/findings/page-d013384d2ddb3036.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/page-42c1b48a01fdecb0.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/policies/page-9b6d7cc4ce9fb33e.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/page-f3ee9ecde06df153.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/security/page-24a003c709776317.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/page-4ea49ce2e765fffb.js +0 -1
- package/web-ui/web-ui/.next/static/chunks/app/(app)/updates/page-6c7b94b070de8986.js +0 -1
- package/web-ui/web-ui/.next/static/css/c6954dd65f2115e6.css +0 -2
- /package/web-ui/web-ui/.next/static/{osEmGZG6yEV-XkQlklt-B → pkVZ1_T311YNkJgZOLTx5}/_buildManifest.js +0 -0
- /package/web-ui/web-ui/.next/static/{osEmGZG6yEV-XkQlklt-B → pkVZ1_T311YNkJgZOLTx5}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=300,exports.ids=[300],exports.modules={53220:(a,b,c)=>{c.d(b,{W:()=>d});function d(){return Date.now()}},56673:(a,b,c)=>{c.d(b,{Vz:()=>o,hZ:()=>s});let d="api[_-]?key|apikey|private[_-]?key|access[_-]?key|access[_-]?token|token|secret|credentials?|password|passwd|pwd|authorization|sig|signature|sas|assertion",e="Bearer|Basic|Token|Digest|ApiKey|SSWS|AWS4-HMAC-SHA256";function f(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}RegExp(`((?:${d})['"\`]?\\s*[:=]\\s*['"\`]?)(?!(?:${e})[\\s'"\`])[^\\s'"\`&]+`,"gi"),RegExp(`((?:${d})['"\`]?\\s*[:=]\\s*['"\`]?)(${e})\\s+[^\\s'"\`]+`,"gi"),RegExp(`(https?://(?:${[{hosts:["hooks.slack.com"],prefix:"/services/"},{hosts:["discord.com","discordapp.com","ptb.discord.com","canary.discord.com"],prefix:"/api/webhooks/"},{hosts:["hooks.zapier.com"],prefix:"/hooks/"},{hosts:["outlook.office.com","outlook.office365.com"],prefix:"/webhook/"}].flatMap(a=>a.hosts.map(b=>`${f(b)}${f(a.prefix)}`)).join("|")}))[^\\s'"\`<>()[\\]{},;]+`,"gi");let g=new WeakMap,h=new WeakMap,i=new WeakMap;class j{match(a,b){if("keyword"!==b.matcher.type)return[];let{keywords:c,caseSensitive:d}=b.matcher,e=[];for(let f of function(a,b,c){let d="keyword"===a?h:i,e=d.get(b);if(void 0!==e){if(e.stateful)for(let a of e.entries)void 0!==a&&(a.lastIndex=0);return e.entries}let f=c();return d.set(b,{entries:f,stateful:f.some(a=>void 0!==a&&(a.global||a.sticky))}),f}("keyword",b.matcher,()=>c.map(a=>{if(0!==a.length)return new RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d?"gu":"giu")}))){let b;if(void 0!==f){if(e.length>=1e4)break;for(;null!==(b=f.exec(a))&&(e.push({start:b.index,end:b.index+b[0].length}),!(e.length>=1e4)););}}return e}}class k{match(a,b){let c;if("regex"!==b.matcher.type)return[];let{pattern:d,flags:e,captureGroup:f}=b.matcher,h=function(a,b){let c=g.get(a);if(void 0!==c)return c.lastIndex=0,c;let d=b();return g.set(a,d),d}(b.matcher,()=>new RegExp(d,e.includes("d")?e:`${e}d`)),i=a.length>2e5?a.slice(0,2e5):a,j=[],k=i.length+1,l=0;for(;null!==(c=h.exec(i))&&!(++l>k);){let a=null!=f?c[f]:c[0];if(0===c[0].length&&h.lastIndex++,a&&j.length<1e4){let b=null!=f?c.indices?.[f]:void 0,d=b?b[0]:c.index;j.push({start:d,end:d+a.length})}if(!e.includes("g")||j.length>=1e4)break}return j}}new j,new k;var l=c(58438);let m=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:[...m]}),JSON.stringify({kind:"hook-external-egress",pattern:/\b(curl|wget|nc|ncat|netcat|ssh|scp|rsync)\b|https?:\/\//.source});let n=new Set(["blind","degraded"]),o={ruleId:"web-capture-drift",version:"1",name:"Web chat capture is not reading the site",category:"config",severity:"medium",definition:JSON.stringify({kind:"web-capture-drift",states:[...n],minParseFailures:2})};function p(a){return void 0===a?"unreported":0===a.conversationEndpoints?"standby":a.patched?a.blind?"blind":a.shapeMisses.length>0||a.parseFailures>=2?"degraded":a.live?"active":"idle":"unpatched"}let q={blind:0,degraded:1,unpatched:2,idle:3,standby:4,active:5,unreported:6},r={active:{headline:"turns are being observed on this site"},unreported:{headline:`no report in the last ${String(l.oz)} days — open the site in Chrome with the extension loaded`},standby:{headline:"this build declares no endpoints for the site, so nothing is observed yet"},unpatched:{headline:"the page tap captured neither fetch nor XHR — it may not have installed; reload the extension at chrome://extensions"},idle:{headline:"watching; no turn has been observed yet"},blind:{headline:"messages were sent in the page that the network capture never saw",remediation:"reload the tab. If it persists after `aka update` and reloading the extension at chrome://extensions, the site's send path has changed and needs a new extension build."},degraded:{headline:"the site's payloads no longer carry the fields the extension reads",remediation:"run `aka update`, then reload the extension at chrome://extensions. If it stays degraded after an update, the site's contract has changed and needs a new extension build."}};function s(a){return l.AKh.options.map(b=>{let c=function(a){let b,c="";for(let b of a)b.lastReportAt>c&&(c=b.lastReportAt);let d=a.filter(a=>!(a=>{if(a.closed)return!0;let b=Date.parse(c)-Date.parse(a.lastReportAt);return Number.isFinite(b)&&b>l.q6i})(a));for(let c of d.some(a=>(0,l.RbK)(a.status))?d:a)(void 0===b||function(a,b){let c=q[p(a.status)],d=q[p(b.status)];return c!==d?c<d:a.observedAt!==b.observedAt?a.observedAt>b.observedAt:(a.rootSessionId??"")>(b.rootSessionId??"")}(c,b))&&(b=c);return b}(a.filter(a=>a.tool===b)),d=p(c?.status),e=r[d];return{tool:b,state:d,headline:e.headline,...void 0!==e.remediation?{remediation:e.remediation}:{},drift:n.has(d),...void 0!==c?{observedAt:c.observedAt}:{}}})}["a","0"," ","x","ab","a.","a-","a_","a@","a/","a:","a=","a;","aA0"," "].flatMap(a=>[23,25].map(b=>a.repeat(Math.ceil(b/a.length)).slice(0,b)+"!")),["abc-","a.","a ","a=","x","0","a@","a/","ab"].map(a=>a.repeat(1e4).slice(0,4e4)+"!")}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=475,exports.ids=[475],exports.modules={19524:(a,b,c)=>{c.d(b,{db:()=>f});var d=c(
|
|
1
|
+
"use strict";exports.id=475,exports.ids=[475],exports.modules={19524:(a,b,c)=>{c.d(b,{db:()=>f});var d=c(23130);let e=globalThis;function f(){if(e.__akaDb)return e.__akaDb;let a=(0,d.Ji)((0,d.KS)());return a.purgeSampleData(),e.__akaDb=a,a}},32625:(a,b,c)=>{c.d(b,{Zs:()=>t,cm:()=>s,h2:()=>u,h6:()=>w,oP:()=>v});var d=c(15644);c(33898);var e=c(48161),f=c(96662),g=c(23130),h=c(75046),i=c(69585),j=c(19524),k=c(90550);let l="Could not read the local store (~/.aka/data/aka.db).";function m(a){return null===a.field?"The request did not arrive in the expected shape — reload the page and try again.":a.wrongType?`The '${a.field}' field did not arrive as text — reload the page and try again.`:`The '${a.field}' field was not in the expected form — reload the page and try again.`}let n=`${l} The fingerprint key cannot be minted until it is readable, because a key that reused a stored version would produce grants that never match.`;function o(a){let b=a?.code;return"floor-unreadable"===b?n:"string"==typeof b?"Could not access the exception key file — check the permissions on ~/.aka/data. Do not delete exception.key to work around this; that invalidates every existing grant.":"The exception key file is corrupt. Delete ~/.aka/data/exception.key to mint a new key (this invalidates existing grants)."}function p(){try{return(0,e.userInfo)().username}catch{return"unknown"}}function q(a){try{return(0,h.N6N)(a)}catch(a){return{error:a instanceof Error?a.message:"invalid scope"}}}function r(a){return(0,j.db)().exceptions.create(a).then(()=>((0,i.revalidatePath)("/exceptions"),{ok:!0})).catch(a=>a instanceof g.qA?{ok:!1,error:"An active exception for this value already exists — revoke it first."}:{ok:!1,error:"Could not create the exception."})}async function s(a){let b,c,d=(0,h.K7s)(h.QcD,a);if(!d.ok)return{ok:!1,error:m(d)};let e=d.data,f=e.reason.trim();if(""===f)return{ok:!1,error:"A reason is required — it is the audit trail."};let i=q(e.scope);if("error"in i)return{ok:!1,error:i.error};try{b=(await (0,j.db)().exceptions.recentBlocked(g.WR)).find(a=>a.reference===e.reference)}catch{return{ok:!1,error:l}}if(!b)return{ok:!1,error:"That blocked detection has expired from the ledger — trigger it again."};try{c=(0,g.y9)((0,g.KS)())}catch(a){return{ok:!1,error:o(a)}}return(0,g.Dg)(c,b.keyVersion)?"permanent"===i.scope&&e.confirmation!==b.maskedValue?{ok:!1,error:"Permanent grants require retyping the masked value exactly as shown."}:r({ruleId:b.ruleId,category:b.category,valueFingerprint:b.valueFingerprint,keyVersion:b.keyVersion,maskedValue:b.maskedValue,...i,justification:f,conditions:null,createdBy:p(),createdVia:"web-approve"}):{ok:!1,error:null===c?"The exception key file is missing, so the fingerprint recorded for this detection can no longer be matched. Trigger the detection again.":`That detection was blocked under fingerprint key v${String(b.keyVersion)}; the key is now v${String(c.version)}, so a grant from it could never match. Trigger the detection again.`}}async function t(a){let b,c,d=(0,h.K7s)(h.Nh0,a);if(!d.ok)return{ok:!1,error:m(d)};let e=d.data,i=e.reason.trim();if(""===i)return{ok:!1,error:"A reason is required — it is the audit trail."};let k=q(e.scope);if("error"in k)return{ok:!1,error:k.error};if(""===e.value)return{ok:!1,error:"No value supplied — nothing to except."};if("permanent"===k.scope&&e.confirmation!==e.value)return{ok:!1,error:"Permanent grants require retyping the value exactly."};try{({rules:b}=(0,j.db)().installedPacks.installedRuleset())}catch{return{ok:!1,error:l}}let n=b.find(a=>a.id===e.ruleId);if(!n)return{ok:!1,error:`Unknown or disabled rule '${e.ruleId}'.`};let s=(0,f.SQ)(e.value,b).filter(a=>a.ruleId===e.ruleId);if(0===s.length)return{ok:!1,error:`The value does not match rule ${e.ruleId} — a grant for it would never apply.`};let t=[...new Set(s.map(a=>a.rawMatch))],u=t[0];if(t.length>1||void 0===u)return{ok:!1,error:`The input contains ${String(t.length)} distinct values matching ${e.ruleId} — supply exactly one.`};try{c=(0,g.Rd)((0,g.KS)())}catch(a){return{ok:!1,error:o(a)}}let v={valueFingerprint:(0,g._2)(c,u),keyVersion:c.version,maskedValue:(0,f.sE)(u)};return r({ruleId:n.id,category:n.category,...v,...k,justification:i,conditions:null,createdBy:p(),createdVia:"web-add"})}async function u(a){let b,c,d=(0,h.K7s)(h.agn,a);if(!d.ok)return{ok:!1,error:m(d)};let e=d.data,f=e.justification.trim();if(""===f)return{ok:!1,error:"A justification is required — it is the audit trail."};let k=q(e.scope);if("error"in k)return{ok:!1,error:k.error};let l=h.jUf.safeParse(e.pointer.trim());if(!l.success)return{ok:!1,error:"Not a vault pointer — paste the full [[aka:...]] token."};try{let a=new g.Pi({repo:(0,j.db)().secretVault,keys:(0,g.Ru)((0,g.xR)().vaultKeyCustody,(0,g.Wo)()),isConsented:()=>(0,h.hds)((0,g.xR)().vaultConsent)});b=await a.resolvePointerIdentity(l.data),c=null===b?null:await a.describePointer(l.data)}catch{b=null,c=null}if(null===b)return{ok:!1,error:"The pointer could not be resolved — it is not one this machine issued, or its entry was purged."};let n=c?.category??function(a){let b=a.slice(6).split(":")[0]??"",c=h.gbA.safeParse(b);return c.success?c.data:null}(l.data);if(null===n)return{ok:!1,error:"Not a vault pointer — paste the full [[aka:...]] token."};if("permanent"===k.scope){if(null===c)return{ok:!1,error:"A permanent reveal needs the value preview to confirm against — use a time-limited scope."};if(e.confirmation!==c.maskedMatch)return{ok:!1,error:`A permanent reveal must be confirmed by retyping the masked value (${c.maskedMatch}).`}}try{let a=await (0,j.db)().exceptions.create({ruleId:b.ruleId,category:n,valueFingerprint:b.valueFingerprint,keyVersion:b.fingerprintKeyVersion,maskedValue:c?.maskedMatch??"\xb7\xb7\xb7",capability:"reveal_to_model",...k,justification:f,conditions:null,createdBy:"dashboard",createdVia:"web-approve"});return(0,i.revalidatePath)("/exceptions"),{ok:!0,grantIdPrefix:a.id.slice(0,8)}}catch(a){if(a instanceof g.qA)return{ok:!1,error:"An active exception for this value already exists — revoke it first."};return{ok:!1,error:"Could not create the reveal grant."}}}async function v(a,b){let c,d=(0,h.K7s)(h.eYL,{id:a,reason:b});if(!d.ok)return{ok:!1,error:m(d)};let e=d.data,f=e.reason.trim();try{c=await (0,j.db)().exceptions.revoke(e.id,p(),""===f?void 0:f)}catch{return{ok:!1,error:l}}return c?((0,i.revalidatePath)("/exceptions"),(0,i.revalidatePath)(`/exceptions/${e.id}`),{ok:!0}):{ok:!1,error:"No active exception with that id."}}async function w(a){let b,c=(0,h.K7s)(h.JJC,{confirmation:a});if(!c.ok)return{ok:!1,error:m(c)};if("rotate"!==c.data.confirmation)return{ok:!1,error:'Type "rotate" to confirm.'};try{b=(0,g.v5)((0,g.KS)())}catch(a){return{ok:!1,error:`Could not rotate the fingerprint key. ${o(a)}`}}try{let a=new g.Pi({repo:(0,j.db)().secretVault,keys:(0,g.Ru)((0,g.xR)().vaultKeyCustody,(0,g.Wo)()),isConsented:()=>(0,h.hds)((0,g.xR)().vaultConsent)});await a.refreshFingerprints(b)}catch{}return(0,i.revalidatePath)("/exceptions"),{ok:!0}}(0,k.D)([s,t,u,v,w]),(0,d.A)(s,"402da59eb285ce333d669295a58c2d20e8b2d25907",null),(0,d.A)(t,"40f920da95ac506d7f19406e6bdc5ff3d930463e55",null),(0,d.A)(u,"40c3ba7176e00620f1c56ed50f7c277c5dbaaa0fcc",null),(0,d.A)(v,"605074bd16cf178b96988f9e1e99f3a63797d417bd",null),(0,d.A)(w,"4057df99c38a146082b5c7305815d1142233a9fac5",null)},60667:(a,b,c)=>{c.d(b,{db:()=>f});var d=c(9578);let e=globalThis;function f(){if(e.__akaDb)return e.__akaDb;let a=(0,d.Ji)((0,d.KS)());return a.purgeSampleData(),e.__akaDb=a,a}}};
|