@oscharko-dev/keiko 0.2.7 → 0.2.8
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/ui/csp-hashes.json +15 -15
- package/dist/ui/static/404.html +1 -1
- package/dist/ui/static/__next.__PAGE__.txt +2 -2
- package/dist/ui/static/__next._full.txt +3 -3
- package/dist/ui/static/__next._head.txt +1 -1
- package/dist/ui/static/__next._index.txt +2 -2
- package/dist/ui/static/__next._tree.txt +2 -2
- package/dist/ui/static/_next/static/chunks/8776.8b33803959adfdcf.js +3 -0
- package/dist/ui/static/_next/static/chunks/8824-1b90854002e51dae.js +98 -0
- package/dist/ui/static/_next/static/chunks/{8835-d642f66c1962fa68.js → 8835-7a3269c7abf41dca.js} +1 -1
- package/dist/ui/static/_next/static/chunks/9385.6543855a745f1347.js +1 -0
- package/dist/ui/static/_next/static/chunks/webpack-b38f050528b4d7a7.js +1 -0
- package/dist/ui/static/_next/static/css/a1d25933a2ce4659.css +3 -0
- package/dist/ui/static/_not-found/__next._full.txt +2 -2
- package/dist/ui/static/_not-found/__next._head.txt +1 -1
- package/dist/ui/static/_not-found/__next._index.txt +2 -2
- package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/ui/static/_not-found/__next._not-found.txt +1 -1
- package/dist/ui/static/_not-found/__next._tree.txt +2 -2
- package/dist/ui/static/_not-found.html +1 -1
- package/dist/ui/static/_not-found.txt +2 -2
- package/dist/ui/static/index.html +1 -1
- package/dist/ui/static/index.txt +3 -3
- package/dist/ui/static/launch/__next._full.txt +3 -3
- package/dist/ui/static/launch/__next._head.txt +1 -1
- package/dist/ui/static/launch/__next._index.txt +2 -2
- package/dist/ui/static/launch/__next._tree.txt +2 -2
- package/dist/ui/static/launch/__next.launch.__PAGE__.txt +2 -2
- package/dist/ui/static/launch/__next.launch.txt +1 -1
- package/dist/ui/static/launch.html +1 -1
- package/dist/ui/static/launch.txt +3 -3
- package/dist/ui/static/local-knowledge/__next._full.txt +3 -3
- package/dist/ui/static/local-knowledge/__next._head.txt +1 -1
- package/dist/ui/static/local-knowledge/__next._index.txt +2 -2
- package/dist/ui/static/local-knowledge/__next._tree.txt +2 -2
- package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +2 -2
- package/dist/ui/static/local-knowledge/__next.local-knowledge.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._full.txt +3 -3
- package/dist/ui/static/local-knowledge/capsule/__next._head.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._index.txt +2 -2
- package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +2 -2
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +2 -2
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule.html +1 -1
- package/dist/ui/static/local-knowledge/capsule.txt +3 -3
- package/dist/ui/static/local-knowledge.html +1 -1
- package/dist/ui/static/local-knowledge.txt +3 -3
- package/dist/ui/static/memoriaviva/__next._full.txt +2 -2
- package/dist/ui/static/memoriaviva/__next._head.txt +1 -1
- package/dist/ui/static/memoriaviva/__next._index.txt +2 -2
- package/dist/ui/static/memoriaviva/__next._tree.txt +2 -2
- package/dist/ui/static/memoriaviva/__next.memoriaviva.__PAGE__.txt +1 -1
- package/dist/ui/static/memoriaviva/__next.memoriaviva.txt +1 -1
- package/dist/ui/static/memoriaviva/consolidation/__next._full.txt +2 -2
- package/dist/ui/static/memoriaviva/consolidation/__next._head.txt +1 -1
- package/dist/ui/static/memoriaviva/consolidation/__next._index.txt +2 -2
- package/dist/ui/static/memoriaviva/consolidation/__next._tree.txt +2 -2
- package/dist/ui/static/memoriaviva/consolidation/__next.memoriaviva.consolidation.__PAGE__.txt +1 -1
- package/dist/ui/static/memoriaviva/consolidation/__next.memoriaviva.consolidation.txt +1 -1
- package/dist/ui/static/memoriaviva/consolidation/__next.memoriaviva.txt +1 -1
- package/dist/ui/static/memoriaviva/consolidation.html +1 -1
- package/dist/ui/static/memoriaviva/consolidation.txt +2 -2
- package/dist/ui/static/memoriaviva/detail/__next._full.txt +2 -2
- package/dist/ui/static/memoriaviva/detail/__next._head.txt +1 -1
- package/dist/ui/static/memoriaviva/detail/__next._index.txt +2 -2
- package/dist/ui/static/memoriaviva/detail/__next._tree.txt +2 -2
- package/dist/ui/static/memoriaviva/detail/__next.memoriaviva.detail.__PAGE__.txt +1 -1
- package/dist/ui/static/memoriaviva/detail/__next.memoriaviva.detail.txt +1 -1
- package/dist/ui/static/memoriaviva/detail/__next.memoriaviva.txt +1 -1
- package/dist/ui/static/memoriaviva/detail.html +1 -1
- package/dist/ui/static/memoriaviva/detail.txt +2 -2
- package/dist/ui/static/memoriaviva/review-queue/__next._full.txt +2 -2
- package/dist/ui/static/memoriaviva/review-queue/__next._head.txt +1 -1
- package/dist/ui/static/memoriaviva/review-queue/__next._index.txt +2 -2
- package/dist/ui/static/memoriaviva/review-queue/__next._tree.txt +2 -2
- package/dist/ui/static/memoriaviva/review-queue/__next.memoriaviva.review-queue.__PAGE__.txt +1 -1
- package/dist/ui/static/memoriaviva/review-queue/__next.memoriaviva.review-queue.txt +1 -1
- package/dist/ui/static/memoriaviva/review-queue/__next.memoriaviva.txt +1 -1
- package/dist/ui/static/memoriaviva/review-queue.html +1 -1
- package/dist/ui/static/memoriaviva/review-queue.txt +2 -2
- package/dist/ui/static/memoriaviva.html +1 -1
- package/dist/ui/static/memoriaviva.txt +2 -2
- package/node_modules/@oscharko-dev/keiko-cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/package.json +14 -14
- package/node_modules/@oscharko-dev/keiko-contracts/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/bff-wire.d.ts +53 -19
- package/node_modules/@oscharko-dev/keiko-contracts/dist/bff-wire.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.js +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/prompt-enhancer-analyzer.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/prompt-enhancer-analyzer.js +198 -22
- package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-evidence/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
- package/node_modules/@oscharko-dev/keiko-harness/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/package.json +6 -6
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/promptEnhancer/generator.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/promptEnhancer/generator.js +417 -14
- package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-sdk/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-security/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/files.d.ts +18 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/files.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/files.js +174 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts +6 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.js +624 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.js +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/index.js +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.js +11 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/routes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/routes.js +5 -10
- package/node_modules/@oscharko-dev/keiko-server/dist/run-handlers.d.ts +0 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/run-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/run-handlers.js +0 -217
- package/node_modules/@oscharko-dev/keiko-server/dist/store/db.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/db.js +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/messages.d.ts +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/messages.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/messages.js +46 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/store/schema.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/schema.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/schema.js +7 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/types.d.ts +3 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/store/types.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/package.json +19 -19
- package/node_modules/@oscharko-dev/keiko-tools/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-verification/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-workflows/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
- package/node_modules/@oscharko-dev/keiko-workspace/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/package.json +3 -3
- package/package.json +22 -22
- package/dist/ui/static/_next/static/chunks/8776.140362f8c6f4d7f1.js +0 -3
- package/dist/ui/static/_next/static/chunks/8824-87c539abddefabd6.js +0 -98
- package/dist/ui/static/_next/static/chunks/9385.4cf1f094775e2625.js +0 -1
- package/dist/ui/static/_next/static/chunks/webpack-cb574cb028380487.js +0 -1
- package/dist/ui/static/_next/static/css/04e93b3f30b67861.css +0 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-handoff.d.ts +0 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-handoff.d.ts.map +0 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-handoff.js +0 -445
- /package/dist/ui/static/_next/static/{GYCj4qCpIh2_0CNX8YDA0 → V6PH3CS6q84y0pJQupf9J}/_buildManifest.js +0 -0
- /package/dist/ui/static/_next/static/{GYCj4qCpIh2_0CNX8YDA0 → V6PH3CS6q84y0pJQupf9J}/_ssgManifest.js +0 -0
package/dist/ui/static/_next/static/chunks/{8835-d642f66c1962fa68.js → 8835-7a3269c7abf41dca.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8835],{4503:(e,t,n)=>{n.d(t,{$Q:()=>x,ty:()=>l,Vp:()=>o,eg:()=>s,IF:()=>a,gr:()=>r,lc:()=>i,eQ:()=>g,pk:()=>m,nP:()=>u,S_:()=>d});let l={maxConnectedSources:16,maxLocalKnowledgeSources:16,maxPromptReferences:8,maxExcerptChars:900,referenceBudget:10,hybridMaxCandidates:24,hybridMaxExcerptBytes:131072};l.maxConnectedSources,l.maxLocalKnowledgeSources;let s="1",a="1",r="1",i="1",o="1";function d(e){return"chat"===e.kind;}let c={embedding:"embedding-only","ocr-vision":"ocr-vision-only"};function u(e){if("chat"!==e.kind)return c[e.kind];}function h(e){return void 0===e||!Number.isFinite(e)||e<=0?0:Math.floor(e);}function p(e){return"u">typeof TextEncoder?new TextEncoder().encode(e).length:e.length;}function m(e){let t=h(e.modelContextWindow),n=h(e.modelMaxOutputTokens),l=Math.max(0,t-n),s=p(e.userDraftText),a=function(e){let t=0;for(let n of e)t+=p(n.role),t+=p(n.content);return t;}(e.conversationHistory),r=function(e){if(void 0===e)return 0;let t=0;for(let n of e)t+=h(n.extractedBytes);return t;}(e.documentContext),i=h(e.repoContextPackBytes),o=h(e.knowledgeCapsuleBytes),d=h(e.memoryContextBytes),c=s+a+r+i+o+d,u=Math.ceil(c/4),m=function(e,t){if(t<=0)return"exceeded";let n=e/t;return n>.95?"exceeded":n>.75?"high":n>.5?"moderate":"low";}(u,l);return{approximateBytes:c,approximateTokens:u,contextWindowTokens:t,reservedOutputTokens:n,availableInputTokens:l,pressure:m,breakdown:{draftBytes:s,historyBytes:a,documentBytes:r,repoContextBytes:i,knowledgeBytes:o,memoryBytes:d}};}let x=["run:started","state:transition","model:call:started","model:call:completed","model:call:failed","tool:call:started","tool:call:completed","tool:call:failed","reasoning:trace","patch:proposed","verification:result","run:completed","run:cancelled","run:failed","command:executed","sandbox:configured","patch:applied","browser:session-opened","browser:navigated","browser:screenshot-captured","browser:page-content-captured","browser:session-closed","browser:trust-warning","browser:error","workflow:started","conventions:detected","context:selected","workflow:model:call:started","workflow:model:call:completed","patch:validated","workflow:patch:applied","workflow:verification:result","workflow:completed","workflow:failed","bug:started","bug:failure:parsed","bug:context:selected","bug:model:call:started","bug:model:call:completed","bug:rootcause:proposed","bug:patch:validated","bug:patch:applied","bug:verification:result","bug:completed","bug:failed","ready"],g=new Set(["run:completed","run:cancelled","run:failed","workflow:completed","workflow:failed","bug:completed","bug:failed"]);},19217:(e,t,n)=>{n.d(t,{i:()=>s});var l=n(7620);function s(){let{active:e=!0,initialFocusRef:t,restoreFocus:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,l.useEffect)(()=>{var l,s;if(!e)return;let a=document.documentElement,r=n?document.activeElement:null,i=Number(null!=(l=a.dataset.keikoModalOpenCount)?l:"0");return a.dataset.keikoModalOpenCount=String(i+1),a.setAttribute("data-keiko-modal-open","true"),null==t||null==(s=t.current)||s.focus(),()=>{var e,t;let l=Math.max(0,Number(null!=(e=a.dataset.keikoModalOpenCount)?e:"1")-1);0===l?(delete a.dataset.keikoModalOpenCount,a.removeAttribute("data-keiko-modal-open")):a.dataset.keikoModalOpenCount=String(l),n&&(null==r||null==(t=r.focus)||t.call(r));};},[e,t,n]);}},23934:(e,t,n)=>{n.d(t,{W:()=>s});var l=n(73599);function s(e){return e instanceof l.hD?e.message.trim().length>0?`${e.message} (${e.code})`:`Something went wrong. Try again. (${e.code})`:e instanceof Error&&e.message.trim().length>0?e.message:"An unexpected error occurred.";}},25780:(e,t,n)=>{n.d(t,{Z:()=>l});let l={draft:"Draft",indexing:"Indexing",ready:"Indexed",stale:"Stale",deleting:"Deleting",error:"Failed"};},29464:(e,t,n)=>{n.d(t,{FG:()=>m,H9:()=>f,KS:()=>j,QI:()=>v,Qi:()=>x,R3:()=>o,Tq:()=>p,WM:()=>c,qY:()=>d,r:()=>h,rw:()=>g,xY:()=>y,xr:()=>i,yN:()=>u});var l=n(73599);function s(e,t){let n={Accept:"application/json"},l="GET"!==e&&"HEAD"!==e;return(l||null!=t)&&(n["Content-Type"]="application/json"),l&&(n["X-Keiko-CSRF"]="1"),n;}async function a(e){try{let t=await e.json();return{code:t.error.code,message:t.error.message};}catch{return{code:"INTERNAL",message:`The server returned an unexpected error (HTTP ${e.status.toString()}). Try again.`};}}async function r(e,t){var n;let r=(null!=(n=null==t?void 0:t.method)?n:"GET").toUpperCase(),i=await fetch(e,{...t,headers:s(r,null==t?void 0:t.body)});if(!i.ok){let{code:e,message:t}=await a(i);throw new l.hD(e,t,i.status);}if(204!==i.status)return i.json();}async function i(){return r("/api/local-knowledge/capsules");}async function o(){return r("/api/local-knowledge/capsule-sets");}async function d(e){return r("/api/local-knowledge/capsules",{method:"POST",body:JSON.stringify(e)});}async function c(e){return r("/api/local-knowledge/capsule-sets",{method:"POST",body:JSON.stringify(e)});}async function u(e,t){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)});}async function h(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/index`,{method:"POST",body:JSON.stringify({confirm:!0})});}async function p(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/index`,{method:"DELETE",body:JSON.stringify({confirm:!0})});}async function m(e,t,n){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/connection`,{method:"POST",body:JSON.stringify({scope:t,displayName:n})});}async function x(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/connection`,{method:"DELETE",body:JSON.stringify({confirm:!0})});}async function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fetch,n=`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,r=await t(n,{headers:s("GET",void 0)});if(!r.ok){let{code:e,message:t}=await a(r);throw new l.hD(e,t,r.status);}return r.json();}async function f(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,{method:"DELETE",body:JSON.stringify({capsuleId:e,deleteIndex:!0,deleteSources:!1})});}async function j(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/reindex`,{method:"POST",body:JSON.stringify({capsuleId:e,mode:"changed-files"})});}async function y(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/reindex`,{method:"POST",body:JSON.stringify({capsuleId:e,mode:"repair-failed"})});}async function v(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/reindex`,{method:"POST",body:JSON.stringify({capsuleId:e,mode:"resume"})});}},65538:(e,t,n)=>{function l(e){return e<1024?`${e.toString()} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(1)} GB`;}function s(e){if(e<1e3)return`${e.toString()} ms`;if(e<6e4)return`${(e/1e3).toFixed(1)} s`;let t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t.toString()}m ${n.toString()}s`;}function a(e){switch(e){case"low":return"Low cost";case"medium":return"Medium cost";case"high":return"High cost";case"unknown":return"Unknown cost";}}function r(e){var t;return null!=(t={running:"Running",completed:"Completed","dry-run":"Dry run",rejected:"Rejected",cancelled:"Cancelled",failed:"Failed","fix-applied":"Fix applied","fix-proposed":"Fix proposed","investigation-only":"Investigation only"}[e])?t:e;}function i(e){return e<1e3?e.toString():`${(e/1e3).toFixed(1)}k`;}function o(e){try{return new Date(e).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});}catch{return"string"==typeof e?e:e.toString();}}function d(e){switch(e){case"fix-applied":return"Fix applied";case"fix-proposed":return"Fix proposed (dry-run)";case"investigation-only":return"Investigation only";case"limit-exceeded":return"Limit exceeded";case"dry-run":return"Dry-run";default:return e.charAt(0).toUpperCase()+e.slice(1);}}n.d(t,{FR:()=>d,Kb:()=>a,Yq:()=>o,_V:()=>s,_y:()=>i,az:()=>r,z3:()=>l});},68835:(e,t,n)=>{n.d(t,{CapsuleDetail:()=>el});var l=n(54568),s=n(7620),a=n(79748);Object.freeze({maxRawFileBytes:0x40000000,maxExtractedTextBytes:0x10000000,maxParserUnits:2e5,maxParserObjects:25e6,maxChunkCount:2e6,maxEmbeddingBatchCount:1e5,maxWallClockMs:36e5,cancellationDeadlineMs:15e3,maxRetryCount:3,maxPersistedStorageGrowthBytes:0x20000000,largeFileThresholdBytes:0x4000000,extractionWindowPages:16});let r=["complete","cancelled","failed"];Object.freeze({ocr:"unavailable",multimodal:"unavailable"}),Object.freeze({PARTIAL_COVERAGE:"PARTIAL_COVERAGE",OCR_CAPABILITY_UNAVAILABLE:"OCR_CAPABILITY_UNAVAILABLE",MULTIMODAL_CAPABILITY_UNAVAILABLE:"MULTIMODAL_CAPABILITY_UNAVAILABLE",CONVERTER_UNAVAILABLE:"CONVERTER_UNAVAILABLE",RESOURCE_POLICY_EXCEEDED:"RESOURCE_POLICY_EXCEEDED",CHECKPOINT_INCOMPATIBLE:"CHECKPOINT_INCOMPATIBLE",EXTRACTION_RESUMED:"EXTRACTION_RESUMED",EXTRACTION_PROGRESS:"EXTRACTION_PROGRESS"});var i=n(29464),o=n(65587),d=n.n(o),c=n(25780),u=n(23934),h=n(97509),p=n(65538),m=n(19217),x=n(76308),g=n(75571);function f(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%";}function j(e){if(!Number.isFinite(e)||e<=0)return"0s";let t=Math.round(e/1e3),n=Math.floor(t/60),l=t%60;return 0===n?`${l.toString()}s`:`${n.toString()}m ${l.toString().padStart(2,"0")}s`;}function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return{detail:null,startedAt:e,now:e,pollError:null};}function v(){return`Maximum single file size: ${(0,p.z3)(0x40000000)}. Parser budget: ${25e6.toLocaleString("en-US")} objects, ${function(){let e=Math.round(60);if(e<60)return`${e.toString()} min`;let t=e/60;return`${t.toString()} h`;}()} per document.`;}function k(e){return"file"===e.kind&&e.sizeBytes>0x40000000;}function b(e){return Array.from(new Set(e.split(/\r?\n/u).map(e=>e.trim()).filter(e=>e.length>0)));}function N(e){return k(e)?`File is ${(0,p.z3)(e.sizeBytes)}; maximum is ${(0,p.z3)(0x40000000)}.`:e.readable?void 0:"File is not readable.";}function S(e){let t=k(e);return(0,l.jsxs)(l.Fragment,{children:[(0,p.z3)(e.sizeBytes),t?" \xb7 too large":""]});}function w(e){let{capsuleId:t,onConnected:n,connectImpl:a=i.FG}=e,[r,o]=(0,s.useState)("folder"),[d,c]=(0,s.useState)(""),[h,p]=(0,s.useState)(""),[m,f]=(0,s.useState)(!1),[j,y]=(0,s.useState)(null),[w,C]=(0,s.useState)(!1),M=function(e,t,n){let l=t.trim();if(""===l)return null;if("folder"===e)return{kind:"folder",rootPath:l,recursive:!0};if("repository"===e)return{kind:"repository",repositoryRoot:l};let s=b(n);return 0===s.length?null:{kind:"files",rootPath:l,files:s};}(r,d,h);async function A(){if(null!==M&&!m){f(!0),y(null);try{await a(t,M),c(""),p(""),n();}catch(e){y((0,u.W)(e));}finally{f(!1);}}}return(0,l.jsxs)("div",{className:"lkd-connect-form","aria-label":"Connect a source",children:[(0,l.jsx)("label",{htmlFor:"lkd-connect-kind",className:"lkd-connect-label",children:"Connect source"}),(0,l.jsx)("div",{className:"lkd-connect-row",children:(0,l.jsxs)("span",{className:"dlg-selwrap",children:[(0,l.jsxs)("select",{id:"lkd-connect-kind",className:"dlg-input",value:r,disabled:m,onChange:e=>{o(e.target.value),y(null);},children:[(0,l.jsx)("option",{value:"folder",children:"Folder"}),(0,l.jsx)("option",{value:"repository",children:"Repository"}),(0,l.jsx)("option",{value:"files",children:"Files"})]}),(0,l.jsx)("span",{className:"dlg-selchev",children:(0,l.jsx)(g.F.chevron,{size:15})})]})}),(0,l.jsxs)("div",{className:"lkd-connect-row",children:[(0,l.jsx)("label",{htmlFor:"lkd-connect-path-input",className:"dlg-label",children:"repository"===r?"Absolute repository path to connect":"files"===r?"Absolute root path for the selected files":"Absolute folder path to connect"}),(0,l.jsxs)("div",{className:"lkd-connect-path-group",children:[(0,l.jsx)("input",{id:"lkd-connect-path-input",type:"text",className:"dlg-input lkd-connect-input",value:d,disabled:m,placeholder:"repository"===r?"/absolute/path/to/repository":"files"===r?"/absolute/path/to/root":"/absolute/path/to/folder",autoComplete:"off",onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&"files"!==r&&A();}}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:m,onClick:()=>C(!0),children:"Browse"})]})]}),"files"===r?(0,l.jsxs)("div",{className:"lkd-connect-row",children:[(0,l.jsx)("label",{htmlFor:"lkd-connect-files-input",className:"dlg-label",children:"Relative files to connect"}),(0,l.jsx)("textarea",{id:"lkd-connect-files-input",className:"dlg-input lkd-connect-input",value:h,disabled:m,placeholder:"src/app.ts\nREADME.md",rows:4,onChange:e=>p(e.target.value)})]}):null,(0,l.jsx)("div",{className:"lkd-connect-row",children:(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:m||null===M,"aria-busy":m,onClick:()=>void A(),children:m?"Connecting…":"Connect"})}),null!==j?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:j}):null,w?(0,l.jsx)(x.c2,{mode:"files"===r?"files":"folder-or-files",title:"Choose local source",description:`Select a local ${"files"===r?"file or files":"folder"} for this capsule.`,note:v(),initialRootPath:d,initialFiles:b(h),isFileDisabled:k,fileDisabledReason:N,fileMeta:S,onApply:e=>{e.files.length>0?(o("files"),c(e.rootPath),p(e.files.join("\n"))):(c(e.folderPath),"files"!==r&&p("")),y(null),C(!1);},onCancel:()=>C(!1)}):null]});}function C(e){var t,n,s,a,r,i;let{kind:o,progress:d}=e,c=d.detail,u=null==c?void 0:c.indexingJobs[0],h=null!=(t=null!=(n=null==u?void 0:u.totalDocuments)?n:null==c?void 0:c.health.documentCount)?t:0,p=void 0===u?0:u.processedDocuments+u.failedDocuments+u.skippedDocuments,m=h>0?p/h:0,x=null!=(s=null==c?void 0:c.health.chunkCount)?s:0,g=null!=(a=null==c?void 0:c.health.vectorCount)?a:0,f=x>0?g/x:0,y=d.now-d.startedAt,v=p>0?p/Math.max(y,1):0,k=v>0?Math.max(0,h-p)/v:0,b=null!=(r=null!=(i=null==u?void 0:u.status)?i:null==c?void 0:c.capsule.lifecycleState)?r:"starting",N=v>0&&h>p?`Estimated remaining ${j(k)}`:"Estimating remaining time";return(0,l.jsxs)("div",{className:"lkd-action-progress",role:"status","aria-live":"polite",children:[(0,l.jsxs)("div",{className:"lkd-action-progress-head",children:[(0,l.jsx)("span",{children:"index"===o?"Indexing documents":"refresh"===o?"Refreshing changed files":"Repairing failed files"}),(0,l.jsx)("span",{children:b})]}),(0,l.jsxs)("div",{className:"lkd-action-progress-note",children:["Still working. Elapsed ",j(y),". ",N,"."]}),(0,l.jsxs)("div",{className:"lkd-status-bars",children:[(0,l.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,l.jsx)("span",{children:"Documents"}),(0,l.jsx)(M,{value:m,label:"Action document progress"}),(0,l.jsxs)("span",{children:[p.toString()," / ",h.toString()]})]}),(0,l.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,l.jsx)("span",{children:"Vectors"}),(0,l.jsx)(M,{value:f,label:"Action vector progress"}),(0,l.jsxs)("span",{children:[g.toString()," / ",x.toString()]})]})]}),null!==d.pollError?(0,l.jsxs)("div",{className:"lkd-action-progress-note",children:["Progress refresh is delayed: ",d.pollError]}):null]});}function M(e){let{value:t,label:n}=e;return(0,l.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${n}: ${f(t)}`,children:(0,l.jsx)("span",{className:"lkd-progress-fill","data-tone":"ok",style:{width:f(t)}})});}function A(e){let{kind:t,capsuleDisplayName:n,nameInput:a,busy:r,error:i,progress:o,onNameChange:d,onConfirm:c,onCancel:u}=e,p=(0,s.useRef)(null),x=(0,s.useRef)(null);(0,m.i)(),(0,s.useEffect)(()=>{0;let e=document.activeElement;return()=>{var t;return null==e||null==(t=e.focus)?void 0:t.call(e);};},[!0]),(0,s.useEffect)(()=>{0;let e=p.current;if(null===e)return;let t=e.querySelector("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])");function n(t){if("Escape"===t.key){t.preventDefault(),u();return;}if("Tab"!==t.key)return;let n=Array.from(e.querySelectorAll("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"));if(0===n.length)return void t.preventDefault();let l=n[0],s=n[n.length-1];t.shiftKey&&document.activeElement===l?(t.preventDefault(),s.focus()):t.shiftKey||document.activeElement!==s||(t.preventDefault(),l.focus());}return null==t||t.focus(),e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n);},[!0,p,u]),(0,s.useEffect)(()=>{"delete"===t&&null!==x.current&&x.current.focus();},[t]);let g=(0,s.useRef)(!1);(0,s.useEffect)(()=>{let e=p.current;if(null!==e){if(r)g.current=!0,e.focus();else if(g.current){var t;g.current=!1,null==(t=e.querySelector("button:not([disabled]),input:not([disabled])"))||t.focus();}}},[r]);let f="delete"===t,j=!r&&(!f||a===n),y="lkd-confirm-title",v="lkd-confirm-desc";return(0,h.createPortal)((0,l.jsx)("div",{className:"dlg-overlay in",role:"presentation",onClick:e=>{e.target===e.currentTarget&&u();},children:(0,l.jsxs)("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":y,"aria-describedby":v,className:"dlg",tabIndex:-1,children:[(0,l.jsx)("div",{className:"dlg-head",children:(0,l.jsxs)("div",{className:"dlg-htext",children:[(0,l.jsx)("div",{id:y,className:"dlg-title",children:"delete"===t?"Delete capsule":"refresh"===t?"Refresh changed files":"Repair failed files"}),(0,l.jsx)("div",{id:v,className:"dlg-sub",children:"delete"===t?`This permanently deletes the capsule index. The source files on disk are NOT deleted. Type "${n}" to confirm.`:"refresh"===t?"This runs an incremental refresh. Unchanged files stay in place, changed files are re-indexed, and removed files are cleaned up.":"This retries files that previously failed indexing and also picks up any newly changed files in the same incremental pass."})]})}),f?(0,l.jsxs)("div",{className:"dlg-body",children:[(0,l.jsxs)("div",{className:"dlg-field",children:[(0,l.jsx)("label",{htmlFor:"lkd-confirm-name-input",className:"dlg-label",children:"Type the capsule name to confirm"}),(0,l.jsx)("input",{id:"lkd-confirm-name-input",type:"text",className:"dlg-input",value:a,autoComplete:"off",ref:x,disabled:r,placeholder:n,onChange:e=>d(e.target.value)})]}),null!==i?(0,l.jsx)("div",{role:"alert",className:"lk-alert",style:{marginTop:4},children:i}):null]}):(0,l.jsxs)("div",{className:"dlg-body",children:[r&&null!==o?(0,l.jsx)(C,{kind:t,progress:o}):null,null!==i?(0,l.jsx)("div",{role:"alert",className:"lk-alert",children:i}):null]}),(0,l.jsxs)("div",{className:"dlg-foot",children:[(0,l.jsx)("button",{type:"button",className:"dlg-btn",disabled:r,onClick:u,children:"Cancel"}),(0,l.jsx)("button",{type:"button",className:"dlg-btn lkd-btn-destructive",disabled:!j,"aria-disabled":!j,onClick:c,children:r?"Working…":"delete"===t?"Delete":"refresh"===t?"Refresh":"Repair"})]})]})}),document.body);}function E(e){let{capsuleId:t,capsuleDisplayName:n,sourceCount:a,lifecycleState:r,onActionComplete:o,onDeleted:d,connectCapsuleSourceImpl:c=i.FG,deleteCapsuleImpl:h=i.H9,refreshCapsuleImpl:p=i.KS,repairCapsuleImpl:m=i.xY,startIndexingImpl:x=i.r,fetchCapsuleDetailImpl:g=i.rw}=e,[f,j]=(0,s.useState)(null),[k,b]=(0,s.useState)(!1),[N,S]=(0,s.useState)(null),[M,E]=(0,s.useState)(!1),[L,$]=(0,s.useState)(null),[T,O]=(0,s.useState)(null),D=null!==T&&(M||k&&null!==f&&"delete"!==f.kind);async function I(){if(!M){O(y()),E(!0),$(null);try{await x(t),O(null),o();}catch(e){$((0,u.W)(e));}finally{E(!1);}}}function R(e){S(null),O(null),j({kind:e,nameInput:""});}async function P(e,t){"delete"!==e&&O(y()),b(!0),S(null);try{let n=await t();O(null),j(null),"delete"===e&&void 0!==d?d(n):o();}catch(e){S((0,u.W)(e));}finally{b(!1);}}return(0,s.useEffect)(()=>{if(!D)return;let e=window.setInterval(()=>{O(e=>null===e?e:{...e,now:Date.now()});},1e3);return()=>window.clearInterval(e);},[D]),(0,s.useEffect)(()=>{if(!D)return;let e=!1;async function n(){try{let n=await g(t);if(e)return;O(e=>null===e?{detail:n,startedAt:Date.now(),now:Date.now(),pollError:null}:{...e,detail:n,now:Date.now(),pollError:null});}catch(t){if(e)return;O(e=>null===e?e:{...e,now:Date.now(),pollError:(0,u.W)(t)});}}n();let l=window.setInterval(()=>{n();},2e3);return()=>{e=!0,window.clearInterval(l);};},[t,g,D]),(0,l.jsxs)("section",{className:"lkd-tools","aria-label":"Capsule tools",children:[(0,l.jsx)(w,{capsuleId:t,onConnected:o,connectImpl:c}),(0,l.jsx)("p",{className:"lkd-limit-note",children:v()}),a>0&&"ready"!==r?(0,l.jsxs)("div",{className:"lkd-index-row",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Index this capsule now","aria-busy":M,disabled:M,onClick:()=>void I(),children:M?"Indexing…":"Index now"}),null!==L?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:L}):null,M&&null!==T?(0,l.jsx)(C,{kind:"index",progress:T}):null]}):null,(0,l.jsxs)("div",{role:"group","aria-label":`Actions for capsule ${n}`,className:"lkd-actions-group",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Refresh changed files for capsule ${n}`,onClick:()=>R("refresh"),children:"Refresh changed files"}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Repair failed files for capsule ${n}`,onClick:()=>R("repair"),children:"Repair failed files"}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger","aria-label":`Delete capsule ${n}`,onClick:()=>R("delete"),children:"Delete"})]}),null!==f?(0,l.jsx)(A,{kind:f.kind,capsuleDisplayName:n,nameInput:f.nameInput,busy:k,error:N,progress:T,onNameChange:function(e){j(t=>null!==t?{...t,nameInput:e}:null);},onConfirm:function(){if(null===f||k)return;let{kind:e}=f;"delete"===e?P(e,()=>h(t)):"refresh"===e?P(e,()=>p(t)):P(e,()=>m(t));},onCancel:function(){k||(j(null),S(null),O(null));}}):null]});}function L(e){let{name:t,description:n,busy:a,error:r,nameInputRef:i,onNameChange:o,onDescriptionChange:d,onCancel:c,onSubmit:u}=e,h=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=e=>{if("Escape"!==e.key||a)return;let t=h.current;null!==t&&t.contains(document.activeElement)&&c();};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e);};},[a,c]),(0,l.jsxs)("form",{className:"lkd-rename-form","aria-label":"Rename capsule",onSubmit:u,ref:h,children:[(0,l.jsxs)("div",{className:"dlg-field",children:[(0,l.jsx)("label",{htmlFor:"lkd-rename-name",className:"dlg-label",children:"Display name"}),(0,l.jsx)("input",{id:"lkd-rename-name",type:"text",className:"dlg-input",ref:i,value:t,disabled:a,autoComplete:"off","aria-label":"Capsule display name",onChange:e=>o(e.target.value)})]}),(0,l.jsxs)("div",{className:"dlg-field",children:[(0,l.jsx)("label",{htmlFor:"lkd-rename-desc",className:"dlg-label",children:"Description"}),(0,l.jsx)("input",{id:"lkd-rename-desc",type:"text",className:"dlg-input",value:n,disabled:a,autoComplete:"off","aria-label":"Capsule description",onChange:e=>d(e.target.value)})]}),null!==r?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:r}):null,(0,l.jsxs)("div",{className:"lkd-rename-actions",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:a,onClick:c,children:"Cancel"}),(0,l.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:a,"aria-busy":a,children:a?"Saving…":"Save"})]})]});}function $(e){let{capsuleId:t,displayName:n,description:a,onRenamed:r,renameImpl:o=i.yN}=e,[d,c]=(0,s.useState)(!1),[h,p]=(0,s.useState)(n),[m,x]=(0,s.useState)(null!=a?a:""),[g,f]=(0,s.useState)(!1),[j,y]=(0,s.useState)(null),v=(0,s.useRef)(null),k=(0,s.useRef)(null),b=(0,s.useRef)(!1);async function N(e){let l,s;e.preventDefault();let i=h.trim();if(0===i.length)return void y("Display name is required.");let d=(l={},i!==n&&(l.displayName=i),((s=m.trim())!==(null!=a?a:"")&&(l.description=s),void 0===l.displayName&&void 0===l.description)?null:l);if(null===d)return void c(!1);f(!0),y(null);try{await o(t,d),c(!1),r();}catch(e){y((0,u.W)(e));}finally{f(!1);}}return(0,s.useEffect)(()=>{var e,t;d?null==(e=v.current)||e.focus():b.current&&(null==(t=k.current)||t.focus()),b.current=d;},[d]),d?(0,l.jsx)(L,{name:h,description:m,busy:g,error:j,nameInputRef:v,onNameChange:p,onDescriptionChange:x,onCancel:function(){g||(c(!1),y(null));},onSubmit:e=>void N(e)}):(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Rename capsule ${n}`,ref:k,onClick:function(){p(n),x(null!=a?a:""),y(null),c(!0);},children:"Rename"});}function T(e){return new Date(e).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"});}function O(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%";}function D(e){if(!Number.isFinite(e)||e<=0)return"0s";let t=Math.round(e/1e3),n=Math.floor(t/60),l=t%60;return 0===n?`${l.toString()}s`:`${n.toString()}m ${l.toString().padStart(2,"0")}s`;}function I(e){return e.indexingJobs[0];}function R(e){return{width:O(e)};}function P(e){let{children:t}=e;return(0,l.jsx)("h2",{className:"lk-section-head",children:t});}function H(e){let[t,n]=(0,s.useState)(!1);return{visibleCount:t?e:Math.min(25,e),showAll:t,setShowAll:n};}function V(e){let{hiddenCount:t,showAll:n,onToggle:s,noun:a}=e;return!n&&t<=0?null:(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:s,children:n?`Show fewer ${a}`:`Show ${t.toString()} more ${a}`});}function U(e){let{label:t,value:n,meta:s,tone:a="neutral"}=e;return(0,l.jsxs)("div",{className:"lkd-metric-card","data-tone":a,children:[(0,l.jsx)("span",{className:"lkd-metric-label",children:t}),(0,l.jsx)("strong",{className:"lkd-metric-value",children:n}),(0,l.jsx)("span",{className:"lkd-metric-meta",children:s})]});}function F(e){let{value:t,label:n,tone:s="ok"}=e;return(0,l.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${n}: ${O(t)}`,children:(0,l.jsx)("span",{className:"lkd-progress-fill","data-tone":s,style:R(t)})});}function B(e){var t,n,s;let a,{data:r}=e,i=I(r),o=null!=(t=null==i?void 0:i.totalDocuments)?t:r.health.documentCount,d=void 0===i?0:i.processedDocuments+i.failedDocuments+i.skippedDocuments,c=Math.max(0,r.health.documentCount-r.health.failedDocuments-r.health.skippedDocuments),u=o>0?d/o:0,h=r.health.chunkCount>0?r.health.vectorCount/r.health.chunkCount:0,p=Math.max(0,r.health.chunkCount-r.health.vectorCount),m=void 0!==i?D((null!=(n=i.finishedAt)?n:Date.now())-i.startedAt):"No job recorded",x=void 0!==i?Math.max(Date.now()-i.startedAt,1):0,g=d>0?d/x:0,f=g>0?Math.max(0,o-d)/g:0,j=(null==i?void 0:i.status)==="running"&&o>0&&d>0?`ETA ${D(f)}`:m,y=p>0||r.health.failedDocuments>0?(null==i?void 0:i.lastError)!==void 0?"danger":"warn":"ok";return(0,l.jsxs)("section",{"aria-labelledby":"lkd-index-status-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-index-status-heading",children:"Index status"})}),(0,l.jsx)("span",{className:"lkd-live-note","aria-live":"polite",children:(null==i?void 0:i.status)==="running"?"Updating every 2s":"Latest run"})]}),(0,l.jsxs)("div",{className:"lkd-metric-grid",children:[(0,l.jsx)(U,{label:"Indexed documents",value:`${c.toString()} / ${r.health.documentCount.toString()}`,meta:`${r.health.failedDocuments.toString()} failed, ${r.health.skippedDocuments.toString()} skipped`,tone:r.health.failedDocuments>0?"danger":r.health.skippedDocuments>0?"warn":"ok"}),(0,l.jsx)(U,{label:"Vectors",value:`${r.health.vectorCount.toString()} / ${r.health.chunkCount.toString()}`,meta:p>0?`${p.toString()} chunks missing vectors`:"All chunks embedded",tone:p>0?"danger":"ok"}),(0,l.jsx)(U,{label:"Latest job",value:void 0!==i?Y[i.status]:"Not indexed",meta:j,tone:(null==i?void 0:i.status)==="failed"?"danger":(null==i?void 0:i.status)==="running"?"warn":"neutral"})]}),(0,l.jsxs)("div",{className:"lkd-status-bars",children:[(0,l.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,l.jsx)("span",{children:"Discovery progress"}),(0,l.jsx)(F,{value:u,label:"Document discovery progress"}),(0,l.jsx)("span",{children:O(u)})]}),(0,l.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,l.jsx)("span",{children:"Retrieval coverage"}),(0,l.jsx)(F,{value:h,label:"Vector retrieval coverage",tone:p>0?"danger":"ok"}),(0,l.jsx)("span",{children:O(h)})]})]}),(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":y,children:(a=r.health.chunkCount-r.health.vectorCount,(null==i||null==(s=i.lastError)?void 0:s.code)==="EMBEDDING_ADAPTER_FAILED"?`Embedding stopped early: ${i.lastError.message}. ${a.toString()} chunks still need vectors.`:a>0?`${a.toString()} chunks still need vectors before retrieval can cover the full source.`:r.health.unsupportedDocuments>0?`${r.health.unsupportedDocuments.toString()} documents need a different extraction path before they can be indexed.`:"Index and vectors are aligned for the current source set.")})]});}function J(e){let{label:t,value:n}=e;return(0,l.jsxs)("div",{className:"lkd-row",children:[(0,l.jsx)("dt",{className:"lkd-label",children:t}),(0,l.jsx)("dd",{className:"lkd-value",children:n})]});}function _(e){var t;let{data:n}=e,{capsule:s,health:a}=n,r=s.embeddingModelIdentity;return(0,l.jsxs)("section",{"aria-labelledby":"lkd-overview-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-overview-heading",children:"Overview"})}),(0,l.jsxs)("dl",{className:"lkd-dl",children:[(0,l.jsx)(J,{label:"Name",value:s.displayName}),void 0!==s.description?(0,l.jsx)(J,{label:"Description",value:s.description}):null,s.tags.length>0?(0,l.jsx)(J,{label:"Tags",value:(0,l.jsx)("ul",{className:"lkd-tags","aria-label":"Capsule tags",children:s.tags.map(e=>(0,l.jsx)("li",{className:"lkd-tag",children:e},e))})}):null,(0,l.jsx)(J,{label:"Status",value:(0,l.jsx)("span",{className:"lk-badge","data-state":s.lifecycleState,role:"status","aria-label":`Status: ${c.Z[s.lifecycleState]}`,children:c.Z[s.lifecycleState]})}),(0,l.jsx)(J,{label:"Embedding model",value:`${r.provider} / ${r.modelId} (${r.vectorDimensions.toString()}d, ${r.vectorMetric})`}),(0,l.jsx)(J,{label:"Storage size",value:(t=a.storageSizeBytes)<1024?`${t.toString()} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}),(0,l.jsx)(J,{label:"Unsupported documents",value:a.unsupportedDocuments.toString()}),void 0!==a.lastIndexedAt?(0,l.jsx)(J,{label:"Last indexed",value:T(a.lastIndexedAt)}):null,(0,l.jsx)(J,{label:"Vector compatible",value:a.vectorCompatible?"Yes":"No — re-index required"}),a.staleReasons.length>0?(0,l.jsx)(J,{label:"Stale reasons",value:(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Stale reasons",children:a.staleReasons.map(e=>(0,l.jsx)("li",{children:e},e))})}):null,a.unsupportedGuidance.length>0?(0,l.jsx)(J,{label:"Next steps",value:(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Unsupported document guidance",children:a.unsupportedGuidance.map(e=>(0,l.jsx)("li",{children:e},e))})}):null]})]});}function q(e){let{sources:t}=e;return 0===t.length?(0,l.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,l.jsx)("p",{className:"lkd-empty-note",children:"No sources attached to this capsule."})]}):(0,l.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,l.jsx)("ul",{className:"lkd-list lkd-source-list","aria-label":"Capsule sources",children:t.map(e=>{var t;let n=e.indexedCount+e.failedCount+e.skippedCount,s="folder"===(t=e.scope).kind?t.rootPath:"repository"===t.kind?t.repositoryRoot:`${t.rootPath} (${t.files.length.toString()} selected files)`;return(0,l.jsxs)("li",{className:"lkd-source-card",children:[(0,l.jsxs)("div",{className:"lkd-source-card-head",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"lkd-source-name",title:e.displayName,children:e.displayName}),(0,l.jsx)("div",{className:"lkd-source-path",title:s,children:s})]}),(0,l.jsx)("span",{className:"lkd-source-scope",children:e.scope.kind})]}),(0,l.jsxs)("div",{className:"lkd-source-coverage",role:"img","aria-label":"Source document coverage",children:[(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-ok",style:R(n>0?e.indexedCount/n:0)}),(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-fail",style:R(n>0?e.failedCount/n:0)}),(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-skip",style:R(n>0?e.skippedCount/n:0)})]}),(0,l.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,l.jsxs)("span",{className:"lkd-count lkd-count-ok",children:[e.indexedCount.toString()," indexed"]}),(0,l.jsxs)("span",{className:"lkd-count lkd-count-fail",children:[e.failedCount.toString()," failed"]}),(0,l.jsxs)("span",{className:"lkd-count lkd-count-skip",children:[e.skippedCount.toString()," skipped"]})]})]},e.sourceId);})})]});}function z(){return(0,l.jsxs)("section",{"aria-labelledby":"lkd-privacy-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-privacy-heading",children:"Privacy and deletion"})}),(0,l.jsxs)("ul",{className:"lkd-list","aria-label":"Privacy and deletion details",children:[(0,l.jsx)("li",{className:"lkd-source-row",children:"Indexed text, vectors, diagnostics, and job history stay in Keiko's local runtime state on this machine."}),(0,l.jsx)("li",{className:"lkd-source-row",children:"Selected chunks may be sent through the configured Model Gateway for embeddings during indexing and for grounded answers when you ask questions against this capsule."}),(0,l.jsx)("li",{className:"lkd-source-row",children:"Deleting a capsule removes its local index data and capsule-set memberships. Source files on disk are not deleted."})]})]});}let K={info:"Info",warning:"Warning",error:"Error"};function G(e){let{group:t}=e;return(0,l.jsxs)("li",{className:"lkd-diag-group","data-severity":t.severity,"aria-label":`${K[t.severity]}: ${t.code} (${t.count.toString()}x)`,children:[(0,l.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:K[t.severity]}),(0,l.jsxs)("span",{className:"lkd-diag-group-count",children:[t.count.toString(),"x"]}),(0,l.jsx)("span",{className:"lkd-diag-code",children:t.code}),(0,l.jsx)("span",{className:"lkd-diag-message",children:t.message})]});}function W(e){let{diag:t}=e;return(0,l.jsxs)("li",{className:"lkd-diag-row","data-severity":t.severity,"aria-label":`${K[t.severity]}: ${t.code}`,children:[(0,l.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:K[t.severity]}),(0,l.jsx)("span",{className:"lkd-diag-code",children:t.code}),(0,l.jsx)("span",{className:"lkd-diag-message",children:t.message}),void 0!==t.pageNumber?(0,l.jsxs)("span",{className:"lkd-diag-page",children:["p.",t.pageNumber.toString()]}):null]});}function Z(e){let{diagnostics:t}=e,{visibleCount:n,showAll:s,setShowAll:a}=H(t.length),r=t.slice(0,n),i=t.length-r.length,o=function(e){let t=new Map();for(let l of e){var n;let e=`${l.severity}\u0000${l.code}\u0000${l.message}`,s=t.get(e);t.set(e,{key:e,severity:l.severity,code:l.code,message:l.message,count:(null!=(n=null==s?void 0:s.count)?n:0)+1});}return[...t.values()].sort((e,t)=>t.count-e.count||e.code.localeCompare(t.code));}(t).slice(0,8);return(0,l.jsxs)("section",{"aria-labelledby":"lkd-diag-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-diag-heading",children:"Health Diagnostics"})}),0===t.length?(0,l.jsx)("p",{className:"lkd-empty-note","data-testid":"diag-empty",children:"No parser diagnostics — all documents processed cleanly."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("ul",{className:"lkd-list lkd-diag-group-list","aria-label":"Grouped parser diagnostics",children:o.map(e=>(0,l.jsx)(G,{group:e},e.key))}),(0,l.jsx)("ul",{className:"lkd-list lkd-diag-list","aria-label":"Parser diagnostics",children:r.map((e,t)=>(0,l.jsx)(W,{diag:e},`${e.code}-${t.toString()}`))}),(0,l.jsx)(V,{hiddenCount:i,noun:"diagnostics",showAll:s,onToggle:()=>a(!s)})]})]});}let Y={queued:"Queued",running:"Running",succeeded:"Succeeded",failed:"Failed",cancelled:"Cancelled"};function X(e){let{job:t}=e,n=void 0!==t.finishedAt?D(t.finishedAt-t.startedAt):"In progress";return(0,l.jsxs)("li",{className:"lkd-job-row","aria-label":`Job ${t.id}: ${Y[t.status]}`,children:[(0,l.jsx)("span",{className:"lkd-job-status","data-status":t.status,children:Y[t.status]}),(0,l.jsxs)("span",{className:"lkd-job-dates",children:[(0,l.jsx)("time",{dateTime:new Date(t.startedAt).toISOString(),children:T(t.startedAt)}),void 0!==t.finishedAt?(0,l.jsxs)(l.Fragment,{children:[" — ",(0,l.jsx)("time",{dateTime:new Date(t.finishedAt).toISOString(),children:T(t.finishedAt)})]}):null]}),(0,l.jsx)("span",{className:"lkd-job-duration",children:n}),(0,l.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,l.jsxs)("span",{className:"lkd-count lkd-count-ok",children:[t.processedDocuments.toString()," processed"]}),(0,l.jsxs)("span",{className:"lkd-count lkd-count-fail",children:[t.failedDocuments.toString()," failed"]}),(0,l.jsxs)("span",{className:"lkd-count lkd-count-skip",children:[t.skippedDocuments.toString()," skipped"]})]}),void 0!==t.lastError?(0,l.jsxs)("div",{className:"lkd-job-error",children:[(0,l.jsx)("span",{children:t.lastError.code}),(0,l.jsx)("span",{children:t.lastError.message})]}):null]});}function Q(e){let{jobs:t}=e,{visibleCount:n,showAll:s,setShowAll:a}=H(t.length),r=t.slice(0,n),i=t.length-r.length;return(0,l.jsxs)("section",{"aria-labelledby":"lkd-jobs-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-jobs-heading",children:"Indexing Job History"})}),0===t.length?(0,l.jsx)("p",{className:"lkd-empty-note",children:"No indexing jobs recorded yet."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("ul",{className:"lkd-list","aria-label":"Indexing job history",children:r.map(e=>(0,l.jsx)(X,{job:e},e.id))}),(0,l.jsx)(V,{hiddenCount:i,noun:"jobs",showAll:s,onToggle:()=>a(!s)})]})]});}let ee={preflight:"Preflight",extracting:"Extracting",extracted:"Extracted",chunking:"Chunking",chunked:"Chunked",embedding:"Embedding",embedded:"Embedded",complete:"Complete",cancelled:"Cancelled",failed:"Failed"};function et(e){var t;let{progress:n}=e;return(0,l.jsxs)("li",{className:"lkd-source-card",children:[(0,l.jsxs)("div",{className:"lkd-source-card-head",children:[(0,l.jsx)("div",{className:"lkd-source-name",title:n.safeDisplayName,children:n.safeDisplayName}),(0,l.jsx)("span",{className:"lkd-source-scope",children:ee[n.phase]})]}),(0,l.jsxs)("div",{className:"lkd-metric-meta",children:[(0,l.jsxs)("span",{"data-tone":"complete"===(t=n.coverage)?"ok":"none"===t?"danger":"warn",children:[n.coverage," coverage"]})," \xb7 ",n.processedPages.toString()," pages "," \xb7 ",n.embeddedChunkCount.toString(),"/",n.chunkCount.toString()," chunks embedded",n.resumable?" \xb7 resumable":""]})]});}function en(e){let{capsuleId:t,health:n,onActionComplete:a,jobActive:o,resumeImpl:d}=e,[c,u]=(0,s.useState)(!1),[h,p]=(0,s.useState)(null);if(0===n.progress.length)return null;let m=n.progress.filter(e=>{var t;return t=e.phase,!r.includes(t);}).map(e=>ee[e.phase]);async function x(){u(!0),p(null);try{await(null!=d?d:i.QI)(t),a();}catch(e){p(e instanceof Error?e.message:"Resume failed.");}finally{u(!1);}}return(0,l.jsxs)("section",{"aria-labelledby":"lkd-large-doc-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-large-doc-heading",children:"Large documents"})}),(0,l.jsx)("span",{className:"lkd-live-note",role:"status","aria-live":"polite",children:m.length>0?`In progress: ${m.join(", ")}`:"Idle"})]}),n.partialCoverageDocuments>0?(0,l.jsxs)("p",{className:"lkd-status-callout","data-tone":"warn",children:[n.partialCoverageDocuments.toString()," document",1===n.partialCoverageDocuments?"":"s"," indexed with partial coverage. The pipeline is stable; retrieval quality is limited for these documents."]}):null,(0,l.jsx)("ul",{className:"lkd-list lkd-source-list","aria-label":"Large-document progress",children:n.progress.map(e=>(0,l.jsx)(et,{progress:e},e.documentId))}),n.qualityWarnings.length>0?(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Retrieval quality warnings",children:n.qualityWarnings.map(e=>(0,l.jsx)("li",{children:e},e))}):null,n.resumableDocuments.length>0?(0,l.jsx)("button",{type:"button",onClick:()=>{x();},disabled:c||o,"aria-label":"Resume interrupted large-document indexing",className:"lk-action-button",children:c?"Resuming…":`Resume ${n.resumableDocuments.length.toString()} document${1===n.resumableDocuments.length?"":"s"}`}):null,null!==h?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:h}):null]});}function el(){var e,t,n;let{capsuleId:r,onDeleted:o,fetchDetailImpl:c,resumeImpl:h}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},p=(0,a.useSearchParams)(),m=(0,a.useRouter)(),x=null!=r?r:null!=(e=p.get("capsuleId"))?e:"",{data:g,loadStatus:f,loadError:j,reload:y}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.rw,[n,l]=(0,s.useState)(null),[a,r]=(0,s.useState)("loading"),[o,d]=(0,s.useState)(null),c=(0,s.useCallback)(async function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(""===e){l(null),d("No capsule selected."),r("error");return;}!0!==n.quiet&&(r("loading"),d(null));try{let n=await t(e);l(n),r("ready");}catch(e){if(!0===n.quiet)return;d((0,u.W)(e)),r("error");}},[e,t]);return(0,s.useEffect)(()=>{c();},[c]),(0,s.useEffect)(()=>{let e=null==n?void 0:n.indexingJobs[0];if((null==n?void 0:n.capsule.lifecycleState)!=="indexing"&&(null==e?void 0:e.status)!=="queued"&&(null==e?void 0:e.status)!=="running")return;let t=window.setInterval(()=>{c({quiet:!0});},2e3);return()=>window.clearInterval(t);},[null==n?void 0:n.capsule.lifecycleState,null==n?void 0:n.indexingJobs,c]),{data:n,loadStatus:a,loadError:o,reload:function(){c();}};}(x,c);return"loading"===f?(0,l.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading capsule…"}):"error"===f||null===g?""===x?(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:["No capsule selected. Open a capsule from the Local Knowledge overview.",(0,l.jsx)(d(),{href:"/local-knowledge",className:"lk-alert-retry",children:"Back to Local Knowledge"})]}):(null==j?void 0:j.includes("NOT_FOUND"))===!0||(null==j?void 0:j.toLowerCase().includes("not found"))===!0?(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:["This capsule no longer exists. Return to the Local Knowledge overview.",(0,l.jsx)(d(),{href:"/local-knowledge",className:"lk-alert-retry",children:"Back to capsules"})]}):(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[null!=j?j:"Failed to load capsule.",(0,l.jsx)("button",{type:"button",onClick:y,"aria-label":"Retry loading capsule detail",className:"lk-alert-retry",children:"Retry"})]}):(0,l.jsxs)("div",{className:"lkd-content",children:[(0,l.jsxs)("header",{className:"lk-header",children:[(0,l.jsx)("h1",{className:"lk-title",children:g.capsule.displayName}),(0,l.jsx)($,{capsuleId:x,displayName:g.capsule.displayName,...(void 0!==g.capsule.description?{description:g.capsule.description}:{}),onRenamed:y})]}),(0,l.jsx)(E,{capsuleId:x,capsuleDisplayName:g.capsule.displayName,sourceCount:g.sources.length,lifecycleState:g.capsule.lifecycleState,onActionComplete:y,onDeleted:function(e){void 0!==o?o(e):m.push("/local-knowledge");}}),(0,l.jsx)(B,{data:g}),void 0!==g.largeDocumentHealth?(0,l.jsx)(en,{capsuleId:x,health:g.largeDocumentHealth,onActionComplete:y,jobActive:"indexing"===g.capsule.lifecycleState||(null==(t=I(g))?void 0:t.status)==="running"||(null==(n=I(g))?void 0:n.status)==="queued",...(void 0!==h?{resumeImpl:h}:{})}):null,(0,l.jsx)(_,{data:g}),(0,l.jsx)(z,{}),(0,l.jsx)(q,{sources:g.sources}),(0,l.jsx)(Z,{diagnostics:g.parserDiagnostics}),(0,l.jsx)(Q,{jobs:g.indexingJobs})]});}},73599:(e,t,n)=>{let l,s;n.d(t,{AD:()=>h,Cp:()=>w,Dz:()=>d,Is:()=>x,KD:()=>I,Mr:()=>S,Oz:()=>b,Qe:()=>f,Su:()=>g,T$:()=>C,T7:()=>o,Um:()=>_,Wk:()=>Y,YT:()=>U,ZC:()=>c,ZF:()=>L,_A:()=>K,fG:()=>p,gA:()=>k,hD:()=>r,iS:()=>H,jv:()=>B,mG:()=>Z,mU:()=>F,mj:()=>M,nk:()=>O,pp:()=>z,q7:()=>R,qU:()=>j,qV:()=>m,qe:()=>u,r$:()=>W,rX:()=>V,rp:()=>q,tA:()=>A,tZ:()=>y,vj:()=>v,wi:()=>N,xe:()=>D,xp:()=>E,y0:()=>G,z4:()=>P});var a=n(4503);class r extends Error{constructor(e,t,n){super(t),this.code=e,this.status=n,this.name="ApiError";}}async function i(e,t){var n,l;let s=(null!=(n=null==t?void 0:t.method)?n:"GET").toUpperCase(),a="GET"!==s&&"HEAD"!==s,i=await fetch(e,{...t,headers:{Accept:"application/json",...(a?{"Content-Type":"application/json"}:{}),...(a?{"X-Keiko-CSRF":"1"}:{}),...(null!=(l=null==t?void 0:t.headers)?l:{})}});if(!i.ok){let e="INTERNAL",t=`HTTP ${i.status.toString()}`;try{let n=await i.json();e=n.error.code,t=n.error.message;}catch{}throw new r(e,t,i.status);}if(204!==i.status)return i.json();}async function o(){return i("/api/health");}async function d(){var e;let t=await i("/api/config");return{config:t.config,configPresent:t.configPresent,effectiveGroundingLimits:null!=(e=t.effectiveGroundingLimits)?e:a.ty};}async function c(){return null!=l||(l=i("/api/models").catch(e=>{throw l=void 0,e;})),l;}async function u(e){let t=await i("/api/gateway/setup",{method:"POST",body:JSON.stringify(e)});return l=void 0,t;}async function h(e){return i("/api/runs",{method:"POST",body:JSON.stringify(e)});}async function p(e,t){return i("/api/prompt-enhancement",{method:"POST",body:JSON.stringify(e),...(void 0===t?{}:{signal:t})});}async function m(e){return i("/api/chats/runs",{method:"POST",body:JSON.stringify(e)});}async function x(e){return i("/api/chats/messages/grounded/handoff",{method:"POST",body:JSON.stringify(e)});}async function g(e){return i(`/api/runs/${encodeURIComponent(e)}/cancel`,{method:"POST",body:JSON.stringify({confirm:!0})});}async function f(e){return i(`/api/runs/${encodeURIComponent(e)}`);}async function j(e){return i(`/api/runs/${encodeURIComponent(e)}/apply`,{method:"POST",body:JSON.stringify({confirm:!0})});}async function y(e){return i(`/api/evidence/${encodeURIComponent(e)}`);}async function v(){return null!=s||(s=i("/api/projects").finally(()=>{s=void 0;})),s;}async function k(e){return i("/api/projects",{method:"POST",body:JSON.stringify(e)});}async function b(e){return i(`/api/chats?projectPath=${encodeURIComponent(e)}`);}async function N(e,t){return i(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)});}async function S(e,t){return i(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({connectedScopes:t})});}async function w(e,t){return i(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({localKnowledgeScopes:t})});}async function C(e,t){let n=new URLSearchParams();return n.set("chatId",e),n.set("projectPath",t),i(`/api/chats/messages?${n.toString()}`);}async function M(e,t,n,l){let s=new URLSearchParams();return s.set("id",e),s.set("chatId",t),s.set("projectPath",n),i(`/api/chats/messages?${s.toString()}`,{method:"PATCH",body:JSON.stringify(l)});}async function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i("/api/desktop/chats",{method:"POST",body:JSON.stringify(e)});}async function E(e,t){return i("/api/desktop/chat",{method:"POST",body:JSON.stringify(e),signal:null!=t?t:null});}class L extends Error{constructor(e,t){super(t),this.code=e,this.name="StreamingUnavailableError";}}function $(e,t,n){let l=t;for(let t of e){let e=t.trimEnd();if(e.startsWith("event:"))l=e.slice(6).trim();else if(e.startsWith("data:")){let t,s=e.slice(5).trim();try{t=JSON.parse(s);}catch{continue;}!function(e,t,n){switch(e){case"token":{let e=function(e){if("object"==typeof e&&null!==e&&"text"in e&&"string"==typeof e.text)return e;}(t);void 0!==e&&n.onToken(e.text);break;}case"done":{let e=function(e){if("object"==typeof e&&null!==e&&"chat"in e&&"messages"in e)return e;}(t);void 0!==e&&n.onDone(e);break;}case"error":{let e=function(e){if("object"==typeof e&&null!==e&&"code"in e&&"message"in e&&"string"==typeof e.code&&"string"==typeof e.message)return e;}(t);void 0!==e&&n.onError(e);break;}case"cancelled":n.onCancelled();}}(l,t,n),l=void 0;}else""===e&&(l=void 0);}return l;}async function T(e,t,n){let l,s=e.getReader(),a=new TextDecoder(),r="",i=!1;try{for(;!t.aborted;){var o;let e=await s.read();if(e.done){i=!0;break;}let t=(r+=a.decode(e.value,{stream:!0})).split("\n");r=null!=(o=t.pop())?o:"",l=$(t,l,n);}i&&""!==r&&$([r],l,n);}finally{s.releaseLock();}}async function O(e,t,n){var l,s,a,r,i;let o=await fetch("/api/desktop/chat/stream",{method:"POST",headers:{Accept:"text/event-stream","Content-Type":"application/json","X-Keiko-CSRF":"1"},body:JSON.stringify(e),signal:t});if(!(null!=(l=o.headers.get("content-type"))?l:"").includes("text/event-stream")){let e="STREAMING_UNSUPPORTED",t=`HTTP ${o.status.toString()}`;try{let n=await o.json();e=null!=(s=null==(r=n.error)?void 0:r.code)?s:e,t=null!=(a=null==(i=n.error)?void 0:i.message)?a:t;}catch{}throw new L(e,t);}if(null===o.body)throw new L("STREAMING_UNSUPPORTED","Response body was null.");await T(o.body,t,n);}async function D(e,t){let n=new URLSearchParams();return n.set("root",e),void 0!==t&&t.length>0&&n.set("path",t),i(`/api/files/directories?${n.toString()}`);}async function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=new URLSearchParams();return n.set("root",e),t.length>0&&n.set("path",t),i(`/api/files/tree?${n.toString()}`);}async function R(e,t){let n=new URLSearchParams();return n.set("root",e),n.set("path",t),i(`/api/files/preview?${n.toString()}`);}async function P(e,t){let n=new URLSearchParams();return n.set("root",e),n.set("path",t),i(`/api/files/content?${n.toString()}`);}async function H(e){return i("/api/files/content",{method:"PATCH",body:JSON.stringify(e)});}async function V(e,t){return i("/api/editor/completion",{method:"POST",body:JSON.stringify({schemaVersion:a.eg,root:e.root,document:{path:e.path,languageId:e.languageId,text:e.text},position:e.position,triggerKind:e.triggerKind,...(void 0===e.triggerCharacter?{}:{triggerCharacter:e.triggerCharacter}),contextBudgetBytes:e.contextBudgetBytes,...(void 0===e.context?{}:{context:e.context}),...(void 0===e.maxCostClass?{}:{maxCostClass:e.maxCostClass})}),...(void 0===t?{}:{signal:t})});}async function U(e,t){return i("/api/editor/inline-completion",{method:"POST",body:JSON.stringify({schemaVersion:a.IF,root:e.root,document:{path:e.path,languageId:e.languageId,text:e.text},position:e.position,triggerKind:e.triggerKind,contextBudgetBytes:e.contextBudgetBytes,...(void 0===e.context?{}:{context:e.context}),...(void 0===e.maxCostClass?{}:{maxCostClass:e.maxCostClass}),...(void 0===e.maxOutputTokens?{}:{maxOutputTokens:e.maxOutputTokens})}),...(void 0===t?{}:{signal:t})});}async function F(e){let t={schemaVersion:a.gr,root:e.root,offered:e.offered,shown:e.shown,accepted:e.accepted,rejected:e.rejected,ignored:e.ignored,partiallyAccepted:e.partiallyAccepted,requestCount:e.requestCount,requestLatencyMsP50:e.requestLatencyMsP50,requestLatencyMsP95:e.requestLatencyMsP95};await i("/api/editor/inline-completion/telemetry",{method:"POST",body:JSON.stringify(t)});}async function B(e,t){return i("/api/editor/test-generation",{method:"POST",body:JSON.stringify({schemaVersion:a.lc,root:e.root,target:e.target,contextBudgetBytes:e.contextBudgetBytes,...(void 0===e.context?{}:{context:e.context})}),...(void 0===t?{}:{signal:t})});}function J(e){return{path:e.path,languageId:e.languageId,text:e.text};}async function _(){return i("/api/editor/language/capabilities");}async function q(e,t){return(await i("/api/editor/language",{method:"POST",body:JSON.stringify({operation:"diagnostics",root:e.root,document:J(e)}),...(void 0===t?{}:{signal:t})})).result;}async function z(e,t){return(await i("/api/editor/language",{method:"POST",body:JSON.stringify({operation:"hover",root:e.root,document:J(e),position:e.position}),...(void 0===t?{}:{signal:t})})).result;}async function K(e,t){return(await i("/api/editor/language",{method:"POST",body:JSON.stringify({operation:"symbols",root:e.root,document:J(e)}),...(void 0===t?{}:{signal:t})})).result;}async function G(e,t){return(await i("/api/editor/language",{method:"POST",body:JSON.stringify({operation:"formatting",root:e.root,document:J(e),...(void 0===e.options?{}:{options:e.options})}),...(void 0===t?{}:{signal:t})})).result;}async function W(e){return i("/api/editor/agent/snapshot",{method:"POST",body:JSON.stringify({schemaVersion:e.schemaVersion,kind:"snapshot",snapshot:e})});}async function Z(e){return i("/api/editor/agent/actions",{method:"POST",body:JSON.stringify(e)});}async function Y(e,t){return i("/api/chats/messages/grounded",{method:"POST",body:JSON.stringify(e),signal:null!=t?t:null});}},75571:(e,t,n)=>{n.d(t,{F:()=>a});var l=n(54568);function s(e){let{size:t=18,sw:n=1.6,vb:s=24,fill:a,className:r,style:i,children:o,d}=e,c=void 0!==a;return(0,l.jsx)("svg",{className:r,width:t,height:t,viewBox:`0 0 ${String(s)} ${String(s)}`,fill:c?a:"none",stroke:c?"none":"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",style:i,"aria-hidden":"true",children:void 0!==d?(0,l.jsx)("path",{d:d}):o});}let a={newChat:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M4 6 H12.5"}),(0,l.jsx)("path",{d:"M4 9.5 H9.5"}),(0,l.jsx)("path",{d:"M14.4 13.6 l4-4 a1.6 1.6 0 0 1 2.3 2.3 l-6.2 6.2 -3 .7 .7 -3 z"})]}),search:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M12.25 4.76 A6 6 0 1 1 8.75 4.76"}),(0,l.jsx)("path",{d:"M14.7 14.7 L20 20"})]}),plugins:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("rect",{x:"4",y:"4",width:"6.5",height:"6.5",rx:"1.5"}),(0,l.jsx)("rect",{x:"13.5",y:"4",width:"6.5",height:"6.5",rx:"1.5"}),(0,l.jsx)("rect",{x:"4",y:"13.5",width:"6.5",height:"6.5",rx:"1.5"}),(0,l.jsx)("rect",{x:"13.5",y:"13.5",width:"6.5",height:"6.5",rx:"1.5"})]}),automations:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"12",cy:"12",r:"8"}),(0,l.jsx)("path",{d:"M12 7.5V12l3 2"})]}),mobile:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("rect",{x:"7",y:"3",width:"10",height:"18",rx:"2.5"}),(0,l.jsx)("path",{d:"M11 18h2"})]}),folder:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M3.6 7.4 V6.3 a1.5 1.5 0 0 1 1.5-1.5 H8 a1.5 1.5 0 0 1 1.1 .48 L10.3 7.4"}),(0,l.jsx)("path",{d:"M13.50 7.40 H18.00 A2.4 2.4 0 0 1 20.40 9.80 V16.00 A2.4 2.4 0 0 1 18.00 18.40 H6.00 A2.4 2.4 0 0 1 3.60 16.00 V9.80 A2.4 2.4 0 0 1 6.00 7.40 H10.50"})]}),settings:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M 13.02 3.36 L 13.21 3.38 L 13.66 5.82 L 15.20 6.46 L 17.24 5.05 L 18.95 6.76 L 17.54 8.80 L 18.18 10.34 L 20.62 10.79 L 20.62 13.21 L 18.18 13.66 L 17.54 15.20 L 18.95 17.24 L 17.24 18.95 L 15.20 17.54 L 13.66 18.18 L 13.21 20.62 L 10.79 20.62 L 10.34 18.18 L 8.80 17.54 L 6.76 18.95 L 5.05 17.24 L 6.46 15.20 L 5.82 13.66 L 3.38 13.21 L 3.38 10.79 L 5.82 10.34 L 6.46 8.80 L 5.05 6.76 L 6.76 5.05 L 8.80 6.46 L 10.34 5.82 L 10.79 3.38 L 10.98 3.36"}),(0,l.jsx)("circle",{cx:"12",cy:"12",r:"2.7"})]}),files:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M5.5 8 V5.5 a1.9 1.9 0 0 1 1.9-1.9 H12.8 L18.5 8.8 V18.5 a1.9 1.9 0 0 1-1.9 1.9 H7.4 a1.9 1.9 0 0 1-1.9-1.9 V11"}),(0,l.jsx)("path",{d:"M12.8 3.6 V7.4 a1.4 1.4 0 0 0 1.4 1.4 H18.5"})]}),browser:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"12",cy:"12",r:"8.5"}),(0,l.jsx)("path",{d:"M3.5 12h17M12 3.5c2.3 2.3 2.3 14.7 0 17M12 3.5c-2.3 2.3-2.3 14.7 0 17"})]}),review:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M9 12l2 2 4-4"}),(0,l.jsx)("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"})]}),terminal:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.70 5.00 H17.50 A2.5 2.5 0 0 1 20.00 7.50 V16.50 A2.5 2.5 0 0 1 17.50 19.00 H6.50 A2.5 2.5 0 0 1 4.00 16.50 V7.50 A2.5 2.5 0 0 1 6.50 5.00 H10.30"}),(0,l.jsx)("path",{d:"M8 9.6 L11 12.6 L8 15.6"}),(0,l.jsx)("path",{d:"M12.8 15.6 H16.4"})]}),agents:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("rect",{x:"5",y:"7",width:"14",height:"11",rx:"3"}),(0,l.jsx)("path",{d:"M12 7V4M9 12h.01M15 12h.01M2.5 12.5v2M21.5 12.5v2"})]}),git:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"6",cy:"6",r:"2.5"}),(0,l.jsx)("circle",{cx:"6",cy:"18",r:"2.5"}),(0,l.jsx)("circle",{cx:"17",cy:"9",r:"2.5"}),(0,l.jsx)("path",{d:"M6 8.5v7M17 11.5c0 3-3 3.5-6 4"})]}),plus:e=>(0,l.jsx)(s,{...e,d:"M12 5v14M5 12h14"}),chevron:e=>(0,l.jsx)(s,{...e,d:"M6 9l6 6 6-6"}),chevronR:e=>(0,l.jsx)(s,{...e,d:"M9 6l6 6-6 6"}),mic:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M12 3.2 a3 3 0 0 1 3 3 V11 a3 3 0 0 1 -6 0 V6.2 a3 3 0 0 1 2 -2.8"}),(0,l.jsx)("path",{d:"M5.5 11.5 a6.5 6.5 0 0 0 13 0 M12 18 v3"})]}),arrowUp:e=>(0,l.jsx)(s,{...e,d:"M12 19V5M6 11l6-6 6 6"}),spark:e=>(0,l.jsx)(s,{...e,d:"M13.2 3.6 L19 10 l-5.2 1.4 L12 17 l-1.8 -5.6 L5 10 l5.2 -1.4 z"}),pin:e=>(0,l.jsx)(s,{...e,d:"M9 3h6l-1 5 3 3-5 1-1 8-1-8-5-1 3-3z"}),brain:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z"}),(0,l.jsx)("path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z"})]}),brainSlash:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z"}),(0,l.jsx)("path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z"}),(0,l.jsx)("path",{d:"M3.2 20.4 20.8 3.6"})]}),archive:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.20 5.00 H19.50 A1 1 0 0 1 20.50 6.00 V8.00 A1 1 0 0 1 19.50 9.00 H4.50 A1 1 0 0 1 3.50 8.00 V6.00 A1 1 0 0 1 4.50 5.00 H10.80"}),(0,l.jsx)("path",{d:"M5 9 v8 a2 2 0 0 0 2 2 h10 a2 2 0 0 0 2-2 V9"}),(0,l.jsx)("path",{d:"M10 13 h4"})]}),sidebar:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,l.jsx)("path",{d:"M9.5 5 V19"})]}),minimize:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M7 14 H10.4"}),(0,l.jsx)("path",{d:"M13.6 14 H17"})]}),expand:e=>(0,l.jsx)(s,{...e,d:"M4 9V4h5M20 15v5h-5M20 9V4h-5M4 15v5h5"}),back:e=>(0,l.jsx)(s,{...e,d:"M15 6l-6 6 6 6"}),fwd:e=>(0,l.jsx)(s,{...e,d:"M9 6l6 6-6 6"}),drag:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"9",cy:"6",r:"1.1",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"15",cy:"6",r:"1.1",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"9",cy:"12",r:"1.1",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"15",cy:"12",r:"1.1",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"9",cy:"18",r:"1.1",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"15",cy:"18",r:"1.1",fill:"currentColor",stroke:"none"})]}),close:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M7 7 L10.4 10.4"}),(0,l.jsx)("path",{d:"M17 7 L13.6 10.4"}),(0,l.jsx)("path",{d:"M7 17 L10.4 13.6"}),(0,l.jsx)("path",{d:"M17 17 L13.6 13.6"})]}),dots:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"6",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"12",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"18",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"})]}),check:e=>(0,l.jsx)(s,{...e,d:"M5 12.5l4.5 4.5L19 6.5"}),info:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M14.51 4.96 A8.6 8.6 0 1 1 9.49 4.96"}),(0,l.jsx)("path",{d:"M12 8.2 h.01"}),(0,l.jsx)("path",{d:"M12 11.3 V16.3"})]}),edit:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M4.5 6.5 H13"}),(0,l.jsx)("path",{d:"M4.5 10 H10"}),(0,l.jsx)("path",{d:"M14.4 13.6 l4-4 a1.6 1.6 0 0 1 2.3 2.3 l-6.2 6.2 -3 .7 .7 -3 z"})]}),trash:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M5 7 H19"}),(0,l.jsx)("path",{d:"M9 7 V5.6 A1.6 1.6 0 0 1 10.6 4 H13.4 A1.6 1.6 0 0 1 15 5.6 V7"}),(0,l.jsx)("path",{d:"M17.5 10 L16.8 18.2 A2 2 0 0 1 14.8 20 H9.2 A2 2 0 0 1 7.2 18.2 L6.5 10"}),(0,l.jsx)("path",{d:"M10 11.5 V17"}),(0,l.jsx)("path",{d:"M14 11.5 V17"})]}),reset:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M4 12a8 8 0 1 1 2.3 5.6"}),(0,l.jsx)("path",{d:"M4 20v-4h4"})]}),file:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M5.5 8 V5.5 a1.9 1.9 0 0 1 1.9-1.9 H12.8 L18.5 8.8 V18.5 a1.9 1.9 0 0 1-1.9 1.9 H7.4 a1.9 1.9 0 0 1-1.9-1.9 V11"}),(0,l.jsx)("path",{d:"M12.8 3.6 V7.4 a1.4 1.4 0 0 0 1.4 1.4 H18.5"})]}),diff:e=>(0,l.jsx)(s,{...e,d:"M12 4v6M9 7h6M5 17h14"}),branch:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M7.63 4.97 A2.3 2.3 0 1 1 4.37 4.97"}),(0,l.jsx)("circle",{cx:"6",cy:"17.4",r:"2.3"}),(0,l.jsx)("circle",{cx:"17.4",cy:"8.6",r:"2.3"}),(0,l.jsx)("path",{d:"M6 8.9 V15.1"}),(0,l.jsx)("path",{d:"M17.4 10.9 c0 4 -4 3.7 -7 4.7"})]}),cube:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9z"}),(0,l.jsx)("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5"})]}),maximize:e=>(0,l.jsx)(s,{...e,d:"M13.50 7.00 H15.00 A2 2 0 0 1 17.00 9.00 V15.00 A2 2 0 0 1 15.00 17.00 H9.00 A2 2 0 0 1 7.00 15.00 V9.00 A2 2 0 0 1 9.00 7.00 H10.50"}),restore:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M9 9 V8 a2 2 0 0 1 2 -2 h6 a2 2 0 0 1 2 2 v6 a2 2 0 0 1 -2 2 h-1"}),(0,l.jsx)("path",{d:"M11.50 9.00 H13.00 A2 2 0 0 1 15.00 11.00 V17.00 A2 2 0 0 1 13.00 19.00 H7.00 A2 2 0 0 1 5.00 17.00 V11.00 A2 2 0 0 1 7.00 9.00 H8.50"})]}),split:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,l.jsx)("path",{d:"M12 5 V19"})]}),tile:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M8.10 4.50 H9.00 A1.5 1.5 0 0 1 10.50 6.00 V10.00 A1.5 1.5 0 0 1 9.00 11.50 H5.00 A1.5 1.5 0 0 1 3.50 10.00 V6.00 A1.5 1.5 0 0 1 5.00 4.50 H5.90"}),(0,l.jsx)("path",{d:"M15.00 4.50 H19.00 A1.5 1.5 0 0 1 20.50 6.00 V10.00 A1.5 1.5 0 0 1 19.00 11.50 H15.00 A1.5 1.5 0 0 1 13.50 10.00 V6.00 A1.5 1.5 0 0 1 15.00 4.50 Z"}),(0,l.jsx)("path",{d:"M5.00 13.50 H9.00 A1.5 1.5 0 0 1 10.50 15.00 V19.00 A1.5 1.5 0 0 1 9.00 20.50 H5.00 A1.5 1.5 0 0 1 3.50 19.00 V15.00 A1.5 1.5 0 0 1 5.00 13.50 Z"}),(0,l.jsx)("path",{d:"M15.00 13.50 H19.00 A1.5 1.5 0 0 1 20.50 15.00 V19.00 A1.5 1.5 0 0 1 19.00 20.50 H15.00 A1.5 1.5 0 0 1 13.50 19.00 V15.00 A1.5 1.5 0 0 1 15.00 13.50 Z"})]}),cascade:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("rect",{x:"4",y:"4",width:"12",height:"12",rx:"2"}),(0,l.jsx)("path",{d:"M20 8v10a2 2 0 0 1-2 2H8"})]}),editor:e=>(0,l.jsx)(s,{...e,children:(0,l.jsx)("path",{d:"M8 9l-3 3 3 3M16 9l3 3-3 3M13.5 6l-3 12"})}),gear:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"12",cy:"12",r:"2.6"}),(0,l.jsx)("path",{d:"M12 3.5v2M12 18.5v2M20.5 12h-2M5.5 12h-2M18 6l-1.4 1.4M7.4 16.6 6 18M18 18l-1.4-1.4M7.4 7.4 6 6"})]}),panelRight:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,l.jsx)("path",{d:"M14.5 5 V19"})]}),layers:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.4 4.55 L19.6 8 L12 12.2 L4.4 8 L10.6 4.55"}),(0,l.jsx)("path",{d:"M4.4 12 L12 16.2 L19.6 12"}),(0,l.jsx)("path",{d:"M4.4 16 L12 20.2 L19.6 16"})]}),tokens:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"9",cy:"9",r:"4.5"}),(0,l.jsx)("path",{d:"M14 9.5a4.5 4.5 0 1 1-4 6.9"})]}),bolt:e=>(0,l.jsx)(s,{...e,d:"M13 3 5 13h5l-1 8 8-10h-5z"}),add:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"3.5"}),(0,l.jsx)("path",{d:"M12 8.5v7M8.5 12h7"})]}),bell:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M9.8 4.6 a5.5 5.5 0 0 1 7.7 4.4 c0 4.5 2 5.5 2 5.5 H4.5 s2 -1 2 -5.5 a5.5 5.5 0 0 1 1.1 -3.3"}),(0,l.jsx)("path",{d:"M10 19 a2 2 0 0 0 4 0"})]}),sun:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.17 8.17 A4 4 0 1 1 10.83 8.17"}),(0,l.jsx)("path",{d:"M12 2.5 V5 M12 19 V21.5 M2.5 12 H5 M19 12 H21.5 M5.1 5.1 L6.9 6.9 M17.1 17.1 l1.8 1.8 M18.9 5.1 L17.1 6.9 M6.9 17.1 L5.1 18.9"})]}),moon:e=>(0,l.jsx)(s,{...e,d:"M19.5 13.5 A8 8 0 1 1 10.5 4.2 a6.5 6.5 0 0 0 9.3 9.1"}),zoomOut:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"11",cy:"11",r:"6.5"}),(0,l.jsx)("path",{d:"M20 20l-4.2-4.2M8.3 11h5.4"})]}),zoomIn:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"11",cy:"11",r:"6.5"}),(0,l.jsx)("path",{d:"M20 20l-4.2-4.2M11 8.3v5.4M8.3 11h5.4"})]}),activity:e=>(0,l.jsx)(s,{...e,d:"M3 12h3l2.5-7 5 14 2.5-7H21"}),user:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.35 4.66 A3.6 3.6 0 1 1 10.65 4.66"}),(0,l.jsx)("path",{d:"M5.5 20 c.9 -3.7 3.4 -5.5 6.5 -5.5 s5.6 1.8 6.5 5.5"})]}),localKnowledge:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M4 19V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12"}),(0,l.jsx)("path",{d:"M4 19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2"}),(0,l.jsx)("path",{d:"M9 7v14M9 11h6"})]}),server:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.30 4.50 H18.30 A1.7 1.7 0 0 1 20.00 6.20 V8.80 A1.7 1.7 0 0 1 18.30 10.50 H5.70 A1.7 1.7 0 0 1 4.00 8.80 V6.20 A1.7 1.7 0 0 1 5.70 4.50 H10.70"}),(0,l.jsx)("path",{d:"M5.70 13.50 H18.30 A1.7 1.7 0 0 1 20.00 15.20 V17.80 A1.7 1.7 0 0 1 18.30 19.50 H5.70 A1.7 1.7 0 0 1 4.00 17.80 V15.20 A1.7 1.7 0 0 1 5.70 13.50 Z"}),(0,l.jsx)("path",{d:"M7.4 7.5 h.01 M7.4 16.5 h.01 M12 7.5 H16 M12 16.5 H16"})]})};},76308:(e,t,n)=>{n.d(t,{$e:()=>u,c2:()=>h,pD:()=>c});var l=n(54568),s=n(7620),a=n(97509),r=n(73599),i=n(19217),o=n(75571);let d="Der Ordner konnte nicht geladen werden.";function c(e){let t=e.trim().replace(/[/\\]+$/u,""),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0?t.startsWith("/")?"/":"":t.slice(0,n);}function u(e,t){if(null===t||0===t.length)return e;let n=e.includes("\\")&&!e.includes("/")?"\\":"/";return`${e.replace(/[/\\]+$/u,"")}${n}${t.replace(/\//gu,n)}`;}function h(e){var t;let{mode:n,title:c,description:h,note:p,initialRootPath:m,initialFiles:x=[],fetchProjectsImpl:g=r.vj,fetchFilesTreeImpl:f=r.KD,isFileDisabled:j,fileDisabledReason:y,fileMeta:v,onApply:k,onCancel:b}=e,N=(0,s.useRef)(null);(0,i.i)(),(0,s.useEffect)(()=>{var e,t;null==(t=N.current)||null==(e=t.querySelector("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"))||e.focus();},[!0,N]),(0,s.useEffect)(()=>{0;let e=N.current;if(null!==e)return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t);function t(t){if("Escape"===t.key){t.preventDefault(),b();return;}if("Tab"!==t.key)return;let n=Array.from(e.querySelectorAll("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"));if(0===n.length)return void t.preventDefault();let l=n[0],s=n[n.length-1];t.shiftKey&&document.activeElement===l?(t.preventDefault(),s.focus()):t.shiftKey||document.activeElement!==s||(t.preventDefault(),l.focus());}},[!0,N,b]);let[S,w]=(0,s.useState)([]),[C,M]=(0,s.useState)(m.trim()),[A,E]=(0,s.useState)(m.trim()),[L,$]=(0,s.useState)(null),[T,O]=(0,s.useState)([]),[D,I]=(0,s.useState)(()=>new Set(x)),[R,P]=(0,s.useState)(!1),[H,V]=(0,s.useState)(null);function U(e){let t=e.trim();0!==t.length&&(I(new Set()),$(null),M(t),E(t));}(0,s.useEffect)(()=>{let e=!1;return g().then(t=>{if(e)return;let n=t.projects.filter(e=>e.available);w(n),0===C.length&&void 0!==n[0]&&(M(n[0].path),E(n[0].path));}).catch(()=>{e||w([]);}),()=>{e=!0;};},[C.length,g]),(0,s.useEffect)(()=>{if(0===C.length){O([]),V(null);return;}let e=!1;return P(!0),V(null),f(C,null!=L?L:"").then(t=>{if(e)return;O(t.entries),M(t.root),E(t.root);let n=t.path.length>0?t.path:null;L!==n&&$(n);}).catch(t=>{e||(O([]),V(function(e){if(e instanceof r.hD){let t=e.message.trim();return t.length>0?`${t} (${e.code})`:`${d} (${e.code})`;}if(e instanceof Error)return e.message.trim().length>0?e.message:d;let t=String(e).trim();return t.length>0?t:d;}(t)));}).finally(()=>{e||P(!1);}),()=>{e=!0;};},[C,L,f]);let F=u(C,L),B=Array.from(D),J=1===B.length?u(C,null!=(t=B[0])?t:null):"",_=0!==C.length&&("folder"===n||("file"===n?1===D.size:"files"!==n||D.size>0)),q="file"===n||"files"===n||"folder-or-files"===n,z="local-file-browser-title",K="local-file-browser-desc";return(0,a.createPortal)((0,l.jsx)("div",{className:"dlg-overlay in",role:"presentation",onClick:e=>{e.target===e.currentTarget&&b();},children:(0,l.jsxs)("div",{ref:N,role:"dialog","aria-modal":"true","aria-labelledby":z,"aria-describedby":K,className:"dlg lkd-source-picker",tabIndex:-1,children:[(0,l.jsx)("div",{className:"dlg-head",children:(0,l.jsxs)("div",{className:"dlg-htext",children:[(0,l.jsx)("div",{id:z,className:"dlg-title",children:c}),(0,l.jsx)("div",{id:K,className:"dlg-sub",children:h}),void 0!==p?(0,l.jsx)("div",{className:"dlg-sub",children:p}):null]})}),(0,l.jsxs)("div",{className:"dlg-body lkd-source-picker-body",children:[S.length>0?(0,l.jsx)("div",{className:"lkd-picker-projects","aria-label":"Registered project folders",children:S.map(e=>{var t;return(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:()=>{U(e.path);},children:null!=(t=e.name)?t:e.path},e.path);})}):null,(0,l.jsxs)("form",{className:"lkd-picker-root",onSubmit:e=>{e.preventDefault(),U(A);},children:[(0,l.jsx)("label",{htmlFor:"local-file-browser-root",className:"dlg-label",children:"Folder root"}),(0,l.jsx)("input",{id:"local-file-browser-root",type:"text",className:"dlg-input lkd-connect-input",value:A,placeholder:"/absolute/path/to/folder",onChange:e=>E(e.target.value)}),(0,l.jsx)("button",{type:"submit",className:"lk-btn lk-btn-ghost",children:"Open"})]}),(0,l.jsxs)("div",{className:"lkd-picker-current",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null===L,onClick:()=>{I(new Set()),$(function(e){if(null===e||0===e.length)return null;let t=e.replace(/\/+$/u,""),n=t.lastIndexOf("/");if(n<0)return null;let l=t.slice(0,n);return l.length>0?l:null;}(L));},children:"Up"}),(0,l.jsx)("span",{className:"mono",title:F,children:F||"No folder selected"})]}),null!==H?(0,l.jsx)("div",{role:"alert",className:"lk-alert",children:H}):null,R?(0,l.jsx)("p",{role:"status",className:"lk-loading",children:"Loading folder..."}):(0,l.jsxs)("ul",{className:"lkd-picker-list","aria-label":"Local source browser",children:[T.map(e=>{var t,s,a,r;let i="file"===e.kind&&!e.symlink,d="directory"!==e.kind&&(!i||!q||!e.readable||null!=(t=null==j?void 0:j(e))&&t),c="directory"!==e.kind&&d?e.symlink||"symlink"===e.kind?"Symbolic links cannot be selected.":null!=(s=null==y?void 0:y(e))?s:"File cannot be selected.":void 0,u=D.has(e.path);return(0,l.jsx)("li",{className:"lkd-picker-entry",children:"directory"===e.kind?(0,l.jsxs)("button",{type:"button",className:"lkd-picker-row",disabled:!e.readable,onClick:()=>{var t;return t=e.path,void(I(new Set()),$(t));},children:[(0,l.jsx)(o.F.folder,{size:14}),(0,l.jsx)("span",{children:e.name})]}):"file"===n?(0,l.jsxs)("button",{type:"button",className:"lkd-picker-row",disabled:d,"aria-pressed":u,title:c,onClick:()=>{I(new Set([e.path]));},children:[(0,l.jsx)(o.F.files,{size:14}),(0,l.jsx)("span",{children:e.name}),(0,l.jsx)("span",{className:"lkd-picker-meta",children:null!=(a=null==v?void 0:v(e,u))?a:u?"selected":""})]}):(0,l.jsxs)("label",{className:"lkd-picker-row","data-disabled":String(d),title:c,children:[(0,l.jsx)("input",{type:"checkbox",disabled:d,checked:u,onChange:()=>{var t;return t=e.path,void I(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n;});}}),(0,l.jsx)("span",{children:e.name}),(0,l.jsx)("span",{className:"lkd-picker-meta",children:null!=(r=null==v?void 0:v(e,u))?r:u?"selected":""})]})},e.path);}),!R&&0===T.length&&C.length>0?(0,l.jsx)("li",{className:"lkd-picker-empty",children:"No entries in this folder."}):null]}),"file"===n&&1===B.length?(0,l.jsxs)("p",{className:"qi-source-picker-selection",title:J,children:["Selected file: ",(0,l.jsx)("span",{className:"qi-monospace",children:J})]}):null]}),(0,l.jsxs)("div",{className:"dlg-foot",children:[(0,l.jsx)("button",{type:"button",className:"dlg-btn",onClick:b,children:"Cancel"}),(0,l.jsx)("button",{type:"button",className:"dlg-btn primary",disabled:!_,onClick:function(){k({rootPath:C,folderPath:F,files:B});},children:"Use selection"})]})]})}),document.body);}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8835],{4503:(e,t,n)=>{n.d(t,{$Q:()=>x,ty:()=>l,Vp:()=>o,eg:()=>s,IF:()=>a,gr:()=>r,lc:()=>i,eQ:()=>g,pk:()=>m,nP:()=>u,S_:()=>d});let l={maxConnectedSources:16,maxLocalKnowledgeSources:16,maxPromptReferences:8,maxExcerptChars:900,referenceBudget:10,hybridMaxCandidates:24,hybridMaxExcerptBytes:131072};l.maxConnectedSources,l.maxLocalKnowledgeSources;let s="1",a="1",r="1",i="1",o="1";function d(e){return"chat"===e.kind;}let c={embedding:"embedding-only","ocr-vision":"ocr-vision-only"};function u(e){if("chat"!==e.kind)return c[e.kind];}function h(e){return void 0===e||!Number.isFinite(e)||e<=0?0:Math.floor(e);}function p(e){return"u">typeof TextEncoder?new TextEncoder().encode(e).length:e.length;}function m(e){let t=h(e.modelContextWindow),n=h(e.modelMaxOutputTokens),l=Math.max(0,t-n),s=p(e.userDraftText),a=function(e){let t=0;for(let n of e)t+=p(n.role),t+=p(n.content);return t;}(e.conversationHistory),r=function(e){if(void 0===e)return 0;let t=0;for(let n of e)t+=h(n.extractedBytes);return t;}(e.documentContext),i=h(e.repoContextPackBytes),o=h(e.knowledgeCapsuleBytes),d=h(e.memoryContextBytes),c=s+a+r+i+o+d,u=Math.ceil(c/4),m=function(e,t){if(t<=0)return"exceeded";let n=e/t;return n>.95?"exceeded":n>.75?"high":n>.5?"moderate":"low";}(u,l);return{approximateBytes:c,approximateTokens:u,contextWindowTokens:t,reservedOutputTokens:n,availableInputTokens:l,pressure:m,breakdown:{draftBytes:s,historyBytes:a,documentBytes:r,repoContextBytes:i,knowledgeBytes:o,memoryBytes:d}};}let x=["run:started","state:transition","model:call:started","model:call:completed","model:call:failed","tool:call:started","tool:call:completed","tool:call:failed","reasoning:trace","patch:proposed","verification:result","run:completed","run:cancelled","run:failed","command:executed","sandbox:configured","patch:applied","browser:session-opened","browser:navigated","browser:screenshot-captured","browser:page-content-captured","browser:session-closed","browser:trust-warning","browser:error","workflow:started","conventions:detected","context:selected","workflow:model:call:started","workflow:model:call:completed","patch:validated","workflow:patch:applied","workflow:verification:result","workflow:completed","workflow:failed","bug:started","bug:failure:parsed","bug:context:selected","bug:model:call:started","bug:model:call:completed","bug:rootcause:proposed","bug:patch:validated","bug:patch:applied","bug:verification:result","bug:completed","bug:failed","ready"],g=new Set(["run:completed","run:cancelled","run:failed","workflow:completed","workflow:failed","bug:completed","bug:failed"]);},19217:(e,t,n)=>{n.d(t,{i:()=>s});var l=n(7620);function s(){let{active:e=!0,initialFocusRef:t,restoreFocus:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,l.useEffect)(()=>{var l,s;if(!e)return;let a=document.documentElement,r=n?document.activeElement:null,i=Number(null!=(l=a.dataset.keikoModalOpenCount)?l:"0");return a.dataset.keikoModalOpenCount=String(i+1),a.setAttribute("data-keiko-modal-open","true"),null==t||null==(s=t.current)||s.focus(),()=>{var e,t;let l=Math.max(0,Number(null!=(e=a.dataset.keikoModalOpenCount)?e:"1")-1);0===l?(delete a.dataset.keikoModalOpenCount,a.removeAttribute("data-keiko-modal-open")):a.dataset.keikoModalOpenCount=String(l),n&&(null==r||null==(t=r.focus)||t.call(r));};},[e,t,n]);}},23934:(e,t,n)=>{n.d(t,{W:()=>s});var l=n(73599);function s(e){return e instanceof l.hD?e.message.trim().length>0?`${e.message} (${e.code})`:`Something went wrong. Try again. (${e.code})`:e instanceof Error&&e.message.trim().length>0?e.message:"An unexpected error occurred.";}},25780:(e,t,n)=>{n.d(t,{Z:()=>l});let l={draft:"Draft",indexing:"Indexing",ready:"Indexed",stale:"Stale",deleting:"Deleting",error:"Failed"};},29464:(e,t,n)=>{n.d(t,{FG:()=>m,H9:()=>f,KS:()=>j,QI:()=>v,Qi:()=>x,R3:()=>o,Tq:()=>p,WM:()=>c,qY:()=>d,r:()=>h,rw:()=>g,xY:()=>y,xr:()=>i,yN:()=>u});var l=n(73599);function s(e,t){let n={Accept:"application/json"},l="GET"!==e&&"HEAD"!==e;return(l||null!=t)&&(n["Content-Type"]="application/json"),l&&(n["X-Keiko-CSRF"]="1"),n;}async function a(e){try{let t=await e.json();return{code:t.error.code,message:t.error.message};}catch{return{code:"INTERNAL",message:`The server returned an unexpected error (HTTP ${e.status.toString()}). Try again.`};}}async function r(e,t){var n;let r=(null!=(n=null==t?void 0:t.method)?n:"GET").toUpperCase(),i=await fetch(e,{...t,headers:s(r,null==t?void 0:t.body)});if(!i.ok){let{code:e,message:t}=await a(i);throw new l.hD(e,t,i.status);}if(204!==i.status)return i.json();}async function i(){return r("/api/local-knowledge/capsules");}async function o(){return r("/api/local-knowledge/capsule-sets");}async function d(e){return r("/api/local-knowledge/capsules",{method:"POST",body:JSON.stringify(e)});}async function c(e){return r("/api/local-knowledge/capsule-sets",{method:"POST",body:JSON.stringify(e)});}async function u(e,t){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)});}async function h(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/index`,{method:"POST",body:JSON.stringify({confirm:!0})});}async function p(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/index`,{method:"DELETE",body:JSON.stringify({confirm:!0})});}async function m(e,t,n){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/connection`,{method:"POST",body:JSON.stringify({scope:t,displayName:n})});}async function x(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/connection`,{method:"DELETE",body:JSON.stringify({confirm:!0})});}async function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fetch,n=`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,r=await t(n,{headers:s("GET",void 0)});if(!r.ok){let{code:e,message:t}=await a(r);throw new l.hD(e,t,r.status);}return r.json();}async function f(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,{method:"DELETE",body:JSON.stringify({capsuleId:e,deleteIndex:!0,deleteSources:!1})});}async function j(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/reindex`,{method:"POST",body:JSON.stringify({capsuleId:e,mode:"changed-files"})});}async function y(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/reindex`,{method:"POST",body:JSON.stringify({capsuleId:e,mode:"repair-failed"})});}async function v(e){return r(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/reindex`,{method:"POST",body:JSON.stringify({capsuleId:e,mode:"resume"})});}},65538:(e,t,n)=>{function l(e){return e<1024?`${e.toString()} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(1)} GB`;}function s(e){if(e<1e3)return`${e.toString()} ms`;if(e<6e4)return`${(e/1e3).toFixed(1)} s`;let t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t.toString()}m ${n.toString()}s`;}function a(e){switch(e){case"low":return"Low cost";case"medium":return"Medium cost";case"high":return"High cost";case"unknown":return"Unknown cost";}}function r(e){var t;return null!=(t={running:"Running",completed:"Completed","dry-run":"Dry run",rejected:"Rejected",cancelled:"Cancelled",failed:"Failed","fix-applied":"Fix applied","fix-proposed":"Fix proposed","investigation-only":"Investigation only"}[e])?t:e;}function i(e){return e<1e3?e.toString():`${(e/1e3).toFixed(1)}k`;}function o(e){try{return new Date(e).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});}catch{return"string"==typeof e?e:e.toString();}}function d(e){switch(e){case"fix-applied":return"Fix applied";case"fix-proposed":return"Fix proposed (dry-run)";case"investigation-only":return"Investigation only";case"limit-exceeded":return"Limit exceeded";case"dry-run":return"Dry-run";default:return e.charAt(0).toUpperCase()+e.slice(1);}}n.d(t,{FR:()=>d,Kb:()=>a,Yq:()=>o,_V:()=>s,_y:()=>i,az:()=>r,z3:()=>l});},68835:(e,t,n)=>{n.d(t,{CapsuleDetail:()=>el});var l=n(54568),s=n(7620),a=n(79748);Object.freeze({maxRawFileBytes:0x40000000,maxExtractedTextBytes:0x10000000,maxParserUnits:2e5,maxParserObjects:25e6,maxChunkCount:2e6,maxEmbeddingBatchCount:1e5,maxWallClockMs:36e5,cancellationDeadlineMs:15e3,maxRetryCount:3,maxPersistedStorageGrowthBytes:0x20000000,largeFileThresholdBytes:0x4000000,extractionWindowPages:16});let r=["complete","cancelled","failed"];Object.freeze({ocr:"unavailable",multimodal:"unavailable"}),Object.freeze({PARTIAL_COVERAGE:"PARTIAL_COVERAGE",OCR_CAPABILITY_UNAVAILABLE:"OCR_CAPABILITY_UNAVAILABLE",MULTIMODAL_CAPABILITY_UNAVAILABLE:"MULTIMODAL_CAPABILITY_UNAVAILABLE",CONVERTER_UNAVAILABLE:"CONVERTER_UNAVAILABLE",RESOURCE_POLICY_EXCEEDED:"RESOURCE_POLICY_EXCEEDED",CHECKPOINT_INCOMPATIBLE:"CHECKPOINT_INCOMPATIBLE",EXTRACTION_RESUMED:"EXTRACTION_RESUMED",EXTRACTION_PROGRESS:"EXTRACTION_PROGRESS"});var i=n(29464),o=n(65587),d=n.n(o),c=n(25780),u=n(23934),h=n(97509),p=n(65538),m=n(19217),x=n(76308),g=n(75571);function f(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%";}function j(e){if(!Number.isFinite(e)||e<=0)return"0s";let t=Math.round(e/1e3),n=Math.floor(t/60),l=t%60;return 0===n?`${l.toString()}s`:`${n.toString()}m ${l.toString().padStart(2,"0")}s`;}function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return{detail:null,startedAt:e,now:e,pollError:null};}function v(){return`Maximum single file size: ${(0,p.z3)(0x40000000)}. Parser budget: ${25e6.toLocaleString("en-US")} objects, ${function(){let e=Math.round(60);if(e<60)return`${e.toString()} min`;let t=e/60;return`${t.toString()} h`;}()} per document.`;}function k(e){return"file"===e.kind&&e.sizeBytes>0x40000000;}function b(e){return Array.from(new Set(e.split(/\r?\n/u).map(e=>e.trim()).filter(e=>e.length>0)));}function N(e){return k(e)?`File is ${(0,p.z3)(e.sizeBytes)}; maximum is ${(0,p.z3)(0x40000000)}.`:e.readable?void 0:"File is not readable.";}function S(e){let t=k(e);return(0,l.jsxs)(l.Fragment,{children:[(0,p.z3)(e.sizeBytes),t?" \xb7 too large":""]});}function w(e){let{capsuleId:t,onConnected:n,connectImpl:a=i.FG}=e,[r,o]=(0,s.useState)("folder"),[d,c]=(0,s.useState)(""),[h,p]=(0,s.useState)(""),[m,f]=(0,s.useState)(!1),[j,y]=(0,s.useState)(null),[w,C]=(0,s.useState)(!1),M=function(e,t,n){let l=t.trim();if(""===l)return null;if("folder"===e)return{kind:"folder",rootPath:l,recursive:!0};if("repository"===e)return{kind:"repository",repositoryRoot:l};let s=b(n);return 0===s.length?null:{kind:"files",rootPath:l,files:s};}(r,d,h);async function A(){if(null!==M&&!m){f(!0),y(null);try{await a(t,M),c(""),p(""),n();}catch(e){y((0,u.W)(e));}finally{f(!1);}}}return(0,l.jsxs)("div",{className:"lkd-connect-form","aria-label":"Connect a source",children:[(0,l.jsx)("label",{htmlFor:"lkd-connect-kind",className:"lkd-connect-label",children:"Connect source"}),(0,l.jsx)("div",{className:"lkd-connect-row",children:(0,l.jsxs)("span",{className:"dlg-selwrap",children:[(0,l.jsxs)("select",{id:"lkd-connect-kind",className:"dlg-input",value:r,disabled:m,onChange:e=>{o(e.target.value),y(null);},children:[(0,l.jsx)("option",{value:"folder",children:"Folder"}),(0,l.jsx)("option",{value:"repository",children:"Repository"}),(0,l.jsx)("option",{value:"files",children:"Files"})]}),(0,l.jsx)("span",{className:"dlg-selchev",children:(0,l.jsx)(g.F.chevron,{size:15})})]})}),(0,l.jsxs)("div",{className:"lkd-connect-row",children:[(0,l.jsx)("label",{htmlFor:"lkd-connect-path-input",className:"dlg-label",children:"repository"===r?"Absolute repository path to connect":"files"===r?"Absolute root path for the selected files":"Absolute folder path to connect"}),(0,l.jsxs)("div",{className:"lkd-connect-path-group",children:[(0,l.jsx)("input",{id:"lkd-connect-path-input",type:"text",className:"dlg-input lkd-connect-input",value:d,disabled:m,placeholder:"repository"===r?"/absolute/path/to/repository":"files"===r?"/absolute/path/to/root":"/absolute/path/to/folder",autoComplete:"off",onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&"files"!==r&&A();}}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:m,onClick:()=>C(!0),children:"Browse"})]})]}),"files"===r?(0,l.jsxs)("div",{className:"lkd-connect-row",children:[(0,l.jsx)("label",{htmlFor:"lkd-connect-files-input",className:"dlg-label",children:"Relative files to connect"}),(0,l.jsx)("textarea",{id:"lkd-connect-files-input",className:"dlg-input lkd-connect-input",value:h,disabled:m,placeholder:"src/app.ts\nREADME.md",rows:4,onChange:e=>p(e.target.value)})]}):null,(0,l.jsx)("div",{className:"lkd-connect-row",children:(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:m||null===M,"aria-busy":m,onClick:()=>void A(),children:m?"Connecting…":"Connect"})}),null!==j?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:j}):null,w?(0,l.jsx)(x.c2,{mode:"files"===r?"files":"folder-or-files",title:"Choose local source",description:`Select a local ${"files"===r?"file or files":"folder"} for this capsule.`,note:v(),initialRootPath:d,initialFiles:b(h),isFileDisabled:k,fileDisabledReason:N,fileMeta:S,onApply:e=>{e.files.length>0?(o("files"),c(e.rootPath),p(e.files.join("\n"))):(c(e.folderPath),"files"!==r&&p("")),y(null),C(!1);},onCancel:()=>C(!1)}):null]});}function C(e){var t,n,s,a,r,i;let{kind:o,progress:d}=e,c=d.detail,u=null==c?void 0:c.indexingJobs[0],h=null!=(t=null!=(n=null==u?void 0:u.totalDocuments)?n:null==c?void 0:c.health.documentCount)?t:0,p=void 0===u?0:u.processedDocuments+u.failedDocuments+u.skippedDocuments,m=h>0?p/h:0,x=null!=(s=null==c?void 0:c.health.chunkCount)?s:0,g=null!=(a=null==c?void 0:c.health.vectorCount)?a:0,f=x>0?g/x:0,y=d.now-d.startedAt,v=p>0?p/Math.max(y,1):0,k=v>0?Math.max(0,h-p)/v:0,b=null!=(r=null!=(i=null==u?void 0:u.status)?i:null==c?void 0:c.capsule.lifecycleState)?r:"starting",N=v>0&&h>p?`Estimated remaining ${j(k)}`:"Estimating remaining time";return(0,l.jsxs)("div",{className:"lkd-action-progress",role:"status","aria-live":"polite",children:[(0,l.jsxs)("div",{className:"lkd-action-progress-head",children:[(0,l.jsx)("span",{children:"index"===o?"Indexing documents":"refresh"===o?"Refreshing changed files":"Repairing failed files"}),(0,l.jsx)("span",{children:b})]}),(0,l.jsxs)("div",{className:"lkd-action-progress-note",children:["Still working. Elapsed ",j(y),". ",N,"."]}),(0,l.jsxs)("div",{className:"lkd-status-bars",children:[(0,l.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,l.jsx)("span",{children:"Documents"}),(0,l.jsx)(M,{value:m,label:"Action document progress"}),(0,l.jsxs)("span",{children:[p.toString()," / ",h.toString()]})]}),(0,l.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,l.jsx)("span",{children:"Vectors"}),(0,l.jsx)(M,{value:f,label:"Action vector progress"}),(0,l.jsxs)("span",{children:[g.toString()," / ",x.toString()]})]})]}),null!==d.pollError?(0,l.jsxs)("div",{className:"lkd-action-progress-note",children:["Progress refresh is delayed: ",d.pollError]}):null]});}function M(e){let{value:t,label:n}=e;return(0,l.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${n}: ${f(t)}`,children:(0,l.jsx)("span",{className:"lkd-progress-fill","data-tone":"ok",style:{width:f(t)}})});}function A(e){let{kind:t,capsuleDisplayName:n,nameInput:a,busy:r,error:i,progress:o,onNameChange:d,onConfirm:c,onCancel:u}=e,p=(0,s.useRef)(null),x=(0,s.useRef)(null);(0,m.i)(),(0,s.useEffect)(()=>{0;let e=document.activeElement;return()=>{var t;return null==e||null==(t=e.focus)?void 0:t.call(e);};},[!0]),(0,s.useEffect)(()=>{0;let e=p.current;if(null===e)return;let t=e.querySelector("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])");function n(t){if("Escape"===t.key){t.preventDefault(),u();return;}if("Tab"!==t.key)return;let n=Array.from(e.querySelectorAll("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"));if(0===n.length)return void t.preventDefault();let l=n[0],s=n[n.length-1];t.shiftKey&&document.activeElement===l?(t.preventDefault(),s.focus()):t.shiftKey||document.activeElement!==s||(t.preventDefault(),l.focus());}return null==t||t.focus(),e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n);},[!0,p,u]),(0,s.useEffect)(()=>{"delete"===t&&null!==x.current&&x.current.focus();},[t]);let g=(0,s.useRef)(!1);(0,s.useEffect)(()=>{let e=p.current;if(null!==e){if(r)g.current=!0,e.focus();else if(g.current){var t;g.current=!1,null==(t=e.querySelector("button:not([disabled]),input:not([disabled])"))||t.focus();}}},[r]);let f="delete"===t,j=!r&&(!f||a===n),y="lkd-confirm-title",v="lkd-confirm-desc";return(0,h.createPortal)((0,l.jsx)("div",{className:"dlg-overlay in",role:"presentation",onClick:e=>{e.target===e.currentTarget&&u();},children:(0,l.jsxs)("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":y,"aria-describedby":v,className:"dlg",tabIndex:-1,children:[(0,l.jsx)("div",{className:"dlg-head",children:(0,l.jsxs)("div",{className:"dlg-htext",children:[(0,l.jsx)("div",{id:y,className:"dlg-title",children:"delete"===t?"Delete capsule":"refresh"===t?"Refresh changed files":"Repair failed files"}),(0,l.jsx)("div",{id:v,className:"dlg-sub",children:"delete"===t?`This permanently deletes the capsule index. The source files on disk are NOT deleted. Type "${n}" to confirm.`:"refresh"===t?"This runs an incremental refresh. Unchanged files stay in place, changed files are re-indexed, and removed files are cleaned up.":"This retries files that previously failed indexing and also picks up any newly changed files in the same incremental pass."})]})}),f?(0,l.jsxs)("div",{className:"dlg-body",children:[(0,l.jsxs)("div",{className:"dlg-field",children:[(0,l.jsx)("label",{htmlFor:"lkd-confirm-name-input",className:"dlg-label",children:"Type the capsule name to confirm"}),(0,l.jsx)("input",{id:"lkd-confirm-name-input",type:"text",className:"dlg-input",value:a,autoComplete:"off",ref:x,disabled:r,placeholder:n,onChange:e=>d(e.target.value)})]}),null!==i?(0,l.jsx)("div",{role:"alert",className:"lk-alert",style:{marginTop:4},children:i}):null]}):(0,l.jsxs)("div",{className:"dlg-body",children:[r&&null!==o?(0,l.jsx)(C,{kind:t,progress:o}):null,null!==i?(0,l.jsx)("div",{role:"alert",className:"lk-alert",children:i}):null]}),(0,l.jsxs)("div",{className:"dlg-foot",children:[(0,l.jsx)("button",{type:"button",className:"dlg-btn",disabled:r,onClick:u,children:"Cancel"}),(0,l.jsx)("button",{type:"button",className:"dlg-btn lkd-btn-destructive",disabled:!j,"aria-disabled":!j,onClick:c,children:r?"Working…":"delete"===t?"Delete":"refresh"===t?"Refresh":"Repair"})]})]})}),document.body);}function E(e){let{capsuleId:t,capsuleDisplayName:n,sourceCount:a,lifecycleState:r,onActionComplete:o,onDeleted:d,connectCapsuleSourceImpl:c=i.FG,deleteCapsuleImpl:h=i.H9,refreshCapsuleImpl:p=i.KS,repairCapsuleImpl:m=i.xY,startIndexingImpl:x=i.r,fetchCapsuleDetailImpl:g=i.rw}=e,[f,j]=(0,s.useState)(null),[k,b]=(0,s.useState)(!1),[N,S]=(0,s.useState)(null),[M,E]=(0,s.useState)(!1),[L,$]=(0,s.useState)(null),[T,D]=(0,s.useState)(null),I=null!==T&&(M||k&&null!==f&&"delete"!==f.kind);async function O(){if(!M){D(y()),E(!0),$(null);try{await x(t),D(null),o();}catch(e){$((0,u.W)(e));}finally{E(!1);}}}function R(e){S(null),D(null),j({kind:e,nameInput:""});}async function P(e,t){"delete"!==e&&D(y()),b(!0),S(null);try{let n=await t();D(null),j(null),"delete"===e&&void 0!==d?d(n):o();}catch(e){S((0,u.W)(e));}finally{b(!1);}}return(0,s.useEffect)(()=>{if(!I)return;let e=window.setInterval(()=>{D(e=>null===e?e:{...e,now:Date.now()});},1e3);return()=>window.clearInterval(e);},[I]),(0,s.useEffect)(()=>{if(!I)return;let e=!1;async function n(){try{let n=await g(t);if(e)return;D(e=>null===e?{detail:n,startedAt:Date.now(),now:Date.now(),pollError:null}:{...e,detail:n,now:Date.now(),pollError:null});}catch(t){if(e)return;D(e=>null===e?e:{...e,now:Date.now(),pollError:(0,u.W)(t)});}}n();let l=window.setInterval(()=>{n();},2e3);return()=>{e=!0,window.clearInterval(l);};},[t,g,I]),(0,l.jsxs)("section",{className:"lkd-tools","aria-label":"Capsule tools",children:[(0,l.jsx)(w,{capsuleId:t,onConnected:o,connectImpl:c}),(0,l.jsx)("p",{className:"lkd-limit-note",children:v()}),a>0&&"ready"!==r?(0,l.jsxs)("div",{className:"lkd-index-row",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Index this capsule now","aria-busy":M,disabled:M,onClick:()=>void O(),children:M?"Indexing…":"Index now"}),null!==L?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:L}):null,M&&null!==T?(0,l.jsx)(C,{kind:"index",progress:T}):null]}):null,(0,l.jsxs)("div",{role:"group","aria-label":`Actions for capsule ${n}`,className:"lkd-actions-group",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Refresh changed files for capsule ${n}`,onClick:()=>R("refresh"),children:"Refresh changed files"}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Repair failed files for capsule ${n}`,onClick:()=>R("repair"),children:"Repair failed files"}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger","aria-label":`Delete capsule ${n}`,onClick:()=>R("delete"),children:"Delete"})]}),null!==f?(0,l.jsx)(A,{kind:f.kind,capsuleDisplayName:n,nameInput:f.nameInput,busy:k,error:N,progress:T,onNameChange:function(e){j(t=>null!==t?{...t,nameInput:e}:null);},onConfirm:function(){if(null===f||k)return;let{kind:e}=f;"delete"===e?P(e,()=>h(t)):"refresh"===e?P(e,()=>p(t)):P(e,()=>m(t));},onCancel:function(){k||(j(null),S(null),D(null));}}):null]});}function L(e){let{name:t,description:n,busy:a,error:r,nameInputRef:i,onNameChange:o,onDescriptionChange:d,onCancel:c,onSubmit:u}=e,h=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=e=>{if("Escape"!==e.key||a)return;let t=h.current;null!==t&&t.contains(document.activeElement)&&c();};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e);};},[a,c]),(0,l.jsxs)("form",{className:"lkd-rename-form","aria-label":"Rename capsule",onSubmit:u,ref:h,children:[(0,l.jsxs)("div",{className:"dlg-field",children:[(0,l.jsx)("label",{htmlFor:"lkd-rename-name",className:"dlg-label",children:"Display name"}),(0,l.jsx)("input",{id:"lkd-rename-name",type:"text",className:"dlg-input",ref:i,value:t,disabled:a,autoComplete:"off","aria-label":"Capsule display name",onChange:e=>o(e.target.value)})]}),(0,l.jsxs)("div",{className:"dlg-field",children:[(0,l.jsx)("label",{htmlFor:"lkd-rename-desc",className:"dlg-label",children:"Description"}),(0,l.jsx)("input",{id:"lkd-rename-desc",type:"text",className:"dlg-input",value:n,disabled:a,autoComplete:"off","aria-label":"Capsule description",onChange:e=>d(e.target.value)})]}),null!==r?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:r}):null,(0,l.jsxs)("div",{className:"lkd-rename-actions",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:a,onClick:c,children:"Cancel"}),(0,l.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:a,"aria-busy":a,children:a?"Saving…":"Save"})]})]});}function $(e){let{capsuleId:t,displayName:n,description:a,onRenamed:r,renameImpl:o=i.yN}=e,[d,c]=(0,s.useState)(!1),[h,p]=(0,s.useState)(n),[m,x]=(0,s.useState)(null!=a?a:""),[g,f]=(0,s.useState)(!1),[j,y]=(0,s.useState)(null),v=(0,s.useRef)(null),k=(0,s.useRef)(null),b=(0,s.useRef)(!1);async function N(e){let l,s;e.preventDefault();let i=h.trim();if(0===i.length)return void y("Display name is required.");let d=(l={},i!==n&&(l.displayName=i),((s=m.trim())!==(null!=a?a:"")&&(l.description=s),void 0===l.displayName&&void 0===l.description)?null:l);if(null===d)return void c(!1);f(!0),y(null);try{await o(t,d),c(!1),r();}catch(e){y((0,u.W)(e));}finally{f(!1);}}return(0,s.useEffect)(()=>{var e,t;d?null==(e=v.current)||e.focus():b.current&&(null==(t=k.current)||t.focus()),b.current=d;},[d]),d?(0,l.jsx)(L,{name:h,description:m,busy:g,error:j,nameInputRef:v,onNameChange:p,onDescriptionChange:x,onCancel:function(){g||(c(!1),y(null));},onSubmit:e=>void N(e)}):(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Rename capsule ${n}`,ref:k,onClick:function(){p(n),x(null!=a?a:""),y(null),c(!0);},children:"Rename"});}function T(e){return new Date(e).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"});}function D(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%";}function I(e){if(!Number.isFinite(e)||e<=0)return"0s";let t=Math.round(e/1e3),n=Math.floor(t/60),l=t%60;return 0===n?`${l.toString()}s`:`${n.toString()}m ${l.toString().padStart(2,"0")}s`;}function O(e){return e.indexingJobs[0];}function R(e){return{width:D(e)};}function P(e){let{children:t}=e;return(0,l.jsx)("h2",{className:"lk-section-head",children:t});}function H(e){let[t,n]=(0,s.useState)(!1);return{visibleCount:t?e:Math.min(25,e),showAll:t,setShowAll:n};}function V(e){let{hiddenCount:t,showAll:n,onToggle:s,noun:a}=e;return!n&&t<=0?null:(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:s,children:n?`Show fewer ${a}`:`Show ${t.toString()} more ${a}`});}function U(e){let{label:t,value:n,meta:s,tone:a="neutral"}=e;return(0,l.jsxs)("div",{className:"lkd-metric-card","data-tone":a,children:[(0,l.jsx)("span",{className:"lkd-metric-label",children:t}),(0,l.jsx)("strong",{className:"lkd-metric-value",children:n}),(0,l.jsx)("span",{className:"lkd-metric-meta",children:s})]});}function F(e){let{value:t,label:n,tone:s="ok"}=e;return(0,l.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${n}: ${D(t)}`,children:(0,l.jsx)("span",{className:"lkd-progress-fill","data-tone":s,style:R(t)})});}function B(e){var t,n,s;let a,{data:r}=e,i=O(r),o=null!=(t=null==i?void 0:i.totalDocuments)?t:r.health.documentCount,d=void 0===i?0:i.processedDocuments+i.failedDocuments+i.skippedDocuments,c=Math.max(0,r.health.documentCount-r.health.failedDocuments-r.health.skippedDocuments),u=o>0?d/o:0,h=r.health.chunkCount>0?r.health.vectorCount/r.health.chunkCount:0,p=Math.max(0,r.health.chunkCount-r.health.vectorCount),m=void 0!==i?I((null!=(n=i.finishedAt)?n:Date.now())-i.startedAt):"No job recorded",x=void 0!==i?Math.max(Date.now()-i.startedAt,1):0,g=d>0?d/x:0,f=g>0?Math.max(0,o-d)/g:0,j=(null==i?void 0:i.status)==="running"&&o>0&&d>0?`ETA ${I(f)}`:m,y=p>0||r.health.failedDocuments>0?(null==i?void 0:i.lastError)!==void 0?"danger":"warn":"ok";return(0,l.jsxs)("section",{"aria-labelledby":"lkd-index-status-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-index-status-heading",children:"Index status"})}),(0,l.jsx)("span",{className:"lkd-live-note","aria-live":"polite",children:(null==i?void 0:i.status)==="running"?"Updating every 2s":"Latest run"})]}),(0,l.jsxs)("div",{className:"lkd-metric-grid",children:[(0,l.jsx)(U,{label:"Indexed documents",value:`${c.toString()} / ${r.health.documentCount.toString()}`,meta:`${r.health.failedDocuments.toString()} failed, ${r.health.skippedDocuments.toString()} skipped`,tone:r.health.failedDocuments>0?"danger":r.health.skippedDocuments>0?"warn":"ok"}),(0,l.jsx)(U,{label:"Vectors",value:`${r.health.vectorCount.toString()} / ${r.health.chunkCount.toString()}`,meta:p>0?`${p.toString()} chunks missing vectors`:"All chunks embedded",tone:p>0?"danger":"ok"}),(0,l.jsx)(U,{label:"Latest job",value:void 0!==i?Y[i.status]:"Not indexed",meta:j,tone:(null==i?void 0:i.status)==="failed"?"danger":(null==i?void 0:i.status)==="running"?"warn":"neutral"})]}),(0,l.jsxs)("div",{className:"lkd-status-bars",children:[(0,l.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,l.jsx)("span",{children:"Discovery progress"}),(0,l.jsx)(F,{value:u,label:"Document discovery progress"}),(0,l.jsx)("span",{children:D(u)})]}),(0,l.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,l.jsx)("span",{children:"Retrieval coverage"}),(0,l.jsx)(F,{value:h,label:"Vector retrieval coverage",tone:p>0?"danger":"ok"}),(0,l.jsx)("span",{children:D(h)})]})]}),(0,l.jsx)("p",{className:"lkd-status-callout","data-tone":y,children:(a=r.health.chunkCount-r.health.vectorCount,(null==i||null==(s=i.lastError)?void 0:s.code)==="EMBEDDING_ADAPTER_FAILED"?`Embedding stopped early: ${i.lastError.message}. ${a.toString()} chunks still need vectors.`:a>0?`${a.toString()} chunks still need vectors before retrieval can cover the full source.`:r.health.unsupportedDocuments>0?`${r.health.unsupportedDocuments.toString()} documents need a different extraction path before they can be indexed.`:"Index and vectors are aligned for the current source set.")})]});}function J(e){let{label:t,value:n}=e;return(0,l.jsxs)("div",{className:"lkd-row",children:[(0,l.jsx)("dt",{className:"lkd-label",children:t}),(0,l.jsx)("dd",{className:"lkd-value",children:n})]});}function _(e){var t;let{data:n}=e,{capsule:s,health:a}=n,r=s.embeddingModelIdentity;return(0,l.jsxs)("section",{"aria-labelledby":"lkd-overview-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-overview-heading",children:"Overview"})}),(0,l.jsxs)("dl",{className:"lkd-dl",children:[(0,l.jsx)(J,{label:"Name",value:s.displayName}),void 0!==s.description?(0,l.jsx)(J,{label:"Description",value:s.description}):null,s.tags.length>0?(0,l.jsx)(J,{label:"Tags",value:(0,l.jsx)("ul",{className:"lkd-tags","aria-label":"Capsule tags",children:s.tags.map(e=>(0,l.jsx)("li",{className:"lkd-tag",children:e},e))})}):null,(0,l.jsx)(J,{label:"Status",value:(0,l.jsx)("span",{className:"lk-badge","data-state":s.lifecycleState,role:"status","aria-label":`Status: ${c.Z[s.lifecycleState]}`,children:c.Z[s.lifecycleState]})}),(0,l.jsx)(J,{label:"Embedding model",value:`${r.provider} / ${r.modelId} (${r.vectorDimensions.toString()}d, ${r.vectorMetric})`}),(0,l.jsx)(J,{label:"Storage size",value:(t=a.storageSizeBytes)<1024?`${t.toString()} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}),(0,l.jsx)(J,{label:"Unsupported documents",value:a.unsupportedDocuments.toString()}),void 0!==a.lastIndexedAt?(0,l.jsx)(J,{label:"Last indexed",value:T(a.lastIndexedAt)}):null,(0,l.jsx)(J,{label:"Vector compatible",value:a.vectorCompatible?"Yes":"No — re-index required"}),a.staleReasons.length>0?(0,l.jsx)(J,{label:"Stale reasons",value:(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Stale reasons",children:a.staleReasons.map(e=>(0,l.jsx)("li",{children:e},e))})}):null,a.unsupportedGuidance.length>0?(0,l.jsx)(J,{label:"Next steps",value:(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Unsupported document guidance",children:a.unsupportedGuidance.map(e=>(0,l.jsx)("li",{children:e},e))})}):null]})]});}function q(e){let{sources:t}=e;return 0===t.length?(0,l.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,l.jsx)("p",{className:"lkd-empty-note",children:"No sources attached to this capsule."})]}):(0,l.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,l.jsx)("ul",{className:"lkd-list lkd-source-list","aria-label":"Capsule sources",children:t.map(e=>{var t;let n=e.indexedCount+e.failedCount+e.skippedCount,s="folder"===(t=e.scope).kind?t.rootPath:"repository"===t.kind?t.repositoryRoot:`${t.rootPath} (${t.files.length.toString()} selected files)`;return(0,l.jsxs)("li",{className:"lkd-source-card",children:[(0,l.jsxs)("div",{className:"lkd-source-card-head",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"lkd-source-name",title:e.displayName,children:e.displayName}),(0,l.jsx)("div",{className:"lkd-source-path",title:s,children:s})]}),(0,l.jsx)("span",{className:"lkd-source-scope",children:e.scope.kind})]}),(0,l.jsxs)("div",{className:"lkd-source-coverage",role:"img","aria-label":"Source document coverage",children:[(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-ok",style:R(n>0?e.indexedCount/n:0)}),(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-fail",style:R(n>0?e.failedCount/n:0)}),(0,l.jsx)("span",{className:"lkd-source-segment lkd-source-segment-skip",style:R(n>0?e.skippedCount/n:0)})]}),(0,l.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,l.jsxs)("span",{className:"lkd-count lkd-count-ok",children:[e.indexedCount.toString()," indexed"]}),(0,l.jsxs)("span",{className:"lkd-count lkd-count-fail",children:[e.failedCount.toString()," failed"]}),(0,l.jsxs)("span",{className:"lkd-count lkd-count-skip",children:[e.skippedCount.toString()," skipped"]})]})]},e.sourceId);})})]});}function z(){return(0,l.jsxs)("section",{"aria-labelledby":"lkd-privacy-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-privacy-heading",children:"Privacy and deletion"})}),(0,l.jsxs)("ul",{className:"lkd-list","aria-label":"Privacy and deletion details",children:[(0,l.jsx)("li",{className:"lkd-source-row",children:"Indexed text, vectors, diagnostics, and job history stay in Keiko's local runtime state on this machine."}),(0,l.jsx)("li",{className:"lkd-source-row",children:"Selected chunks may be sent through the configured Model Gateway for embeddings during indexing and for grounded answers when you ask questions against this capsule."}),(0,l.jsx)("li",{className:"lkd-source-row",children:"Deleting a capsule removes its local index data and capsule-set memberships. Source files on disk are not deleted."})]})]});}let K={info:"Info",warning:"Warning",error:"Error"};function G(e){let{group:t}=e;return(0,l.jsxs)("li",{className:"lkd-diag-group","data-severity":t.severity,"aria-label":`${K[t.severity]}: ${t.code} (${t.count.toString()}x)`,children:[(0,l.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:K[t.severity]}),(0,l.jsxs)("span",{className:"lkd-diag-group-count",children:[t.count.toString(),"x"]}),(0,l.jsx)("span",{className:"lkd-diag-code",children:t.code}),(0,l.jsx)("span",{className:"lkd-diag-message",children:t.message})]});}function W(e){let{diag:t}=e;return(0,l.jsxs)("li",{className:"lkd-diag-row","data-severity":t.severity,"aria-label":`${K[t.severity]}: ${t.code}`,children:[(0,l.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:K[t.severity]}),(0,l.jsx)("span",{className:"lkd-diag-code",children:t.code}),(0,l.jsx)("span",{className:"lkd-diag-message",children:t.message}),void 0!==t.pageNumber?(0,l.jsxs)("span",{className:"lkd-diag-page",children:["p.",t.pageNumber.toString()]}):null]});}function Z(e){let{diagnostics:t}=e,{visibleCount:n,showAll:s,setShowAll:a}=H(t.length),r=t.slice(0,n),i=t.length-r.length,o=function(e){let t=new Map();for(let l of e){var n;let e=`${l.severity}\u0000${l.code}\u0000${l.message}`,s=t.get(e);t.set(e,{key:e,severity:l.severity,code:l.code,message:l.message,count:(null!=(n=null==s?void 0:s.count)?n:0)+1});}return[...t.values()].sort((e,t)=>t.count-e.count||e.code.localeCompare(t.code));}(t).slice(0,8);return(0,l.jsxs)("section",{"aria-labelledby":"lkd-diag-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-diag-heading",children:"Health Diagnostics"})}),0===t.length?(0,l.jsx)("p",{className:"lkd-empty-note","data-testid":"diag-empty",children:"No parser diagnostics — all documents processed cleanly."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("ul",{className:"lkd-list lkd-diag-group-list","aria-label":"Grouped parser diagnostics",children:o.map(e=>(0,l.jsx)(G,{group:e},e.key))}),(0,l.jsx)("ul",{className:"lkd-list lkd-diag-list","aria-label":"Parser diagnostics",children:r.map((e,t)=>(0,l.jsx)(W,{diag:e},`${e.code}-${t.toString()}`))}),(0,l.jsx)(V,{hiddenCount:i,noun:"diagnostics",showAll:s,onToggle:()=>a(!s)})]})]});}let Y={queued:"Queued",running:"Running",succeeded:"Succeeded",failed:"Failed",cancelled:"Cancelled"};function X(e){let{job:t}=e,n=void 0!==t.finishedAt?I(t.finishedAt-t.startedAt):"In progress";return(0,l.jsxs)("li",{className:"lkd-job-row","aria-label":`Job ${t.id}: ${Y[t.status]}`,children:[(0,l.jsx)("span",{className:"lkd-job-status","data-status":t.status,children:Y[t.status]}),(0,l.jsxs)("span",{className:"lkd-job-dates",children:[(0,l.jsx)("time",{dateTime:new Date(t.startedAt).toISOString(),children:T(t.startedAt)}),void 0!==t.finishedAt?(0,l.jsxs)(l.Fragment,{children:[" — ",(0,l.jsx)("time",{dateTime:new Date(t.finishedAt).toISOString(),children:T(t.finishedAt)})]}):null]}),(0,l.jsx)("span",{className:"lkd-job-duration",children:n}),(0,l.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,l.jsxs)("span",{className:"lkd-count lkd-count-ok",children:[t.processedDocuments.toString()," processed"]}),(0,l.jsxs)("span",{className:"lkd-count lkd-count-fail",children:[t.failedDocuments.toString()," failed"]}),(0,l.jsxs)("span",{className:"lkd-count lkd-count-skip",children:[t.skippedDocuments.toString()," skipped"]})]}),void 0!==t.lastError?(0,l.jsxs)("div",{className:"lkd-job-error",children:[(0,l.jsx)("span",{children:t.lastError.code}),(0,l.jsx)("span",{children:t.lastError.message})]}):null]});}function Q(e){let{jobs:t}=e,{visibleCount:n,showAll:s,setShowAll:a}=H(t.length),r=t.slice(0,n),i=t.length-r.length;return(0,l.jsxs)("section",{"aria-labelledby":"lkd-jobs-heading",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-jobs-heading",children:"Indexing Job History"})}),0===t.length?(0,l.jsx)("p",{className:"lkd-empty-note",children:"No indexing jobs recorded yet."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("ul",{className:"lkd-list","aria-label":"Indexing job history",children:r.map(e=>(0,l.jsx)(X,{job:e},e.id))}),(0,l.jsx)(V,{hiddenCount:i,noun:"jobs",showAll:s,onToggle:()=>a(!s)})]})]});}let ee={preflight:"Preflight",extracting:"Extracting",extracted:"Extracted",chunking:"Chunking",chunked:"Chunked",embedding:"Embedding",embedded:"Embedded",complete:"Complete",cancelled:"Cancelled",failed:"Failed"};function et(e){var t;let{progress:n}=e;return(0,l.jsxs)("li",{className:"lkd-source-card",children:[(0,l.jsxs)("div",{className:"lkd-source-card-head",children:[(0,l.jsx)("div",{className:"lkd-source-name",title:n.safeDisplayName,children:n.safeDisplayName}),(0,l.jsx)("span",{className:"lkd-source-scope",children:ee[n.phase]})]}),(0,l.jsxs)("div",{className:"lkd-metric-meta",children:[(0,l.jsxs)("span",{"data-tone":"complete"===(t=n.coverage)?"ok":"none"===t?"danger":"warn",children:[n.coverage," coverage"]})," \xb7 ",n.processedPages.toString()," pages "," \xb7 ",n.embeddedChunkCount.toString(),"/",n.chunkCount.toString()," chunks embedded",n.resumable?" \xb7 resumable":""]})]});}function en(e){let{capsuleId:t,health:n,onActionComplete:a,jobActive:o,resumeImpl:d}=e,[c,u]=(0,s.useState)(!1),[h,p]=(0,s.useState)(null);if(0===n.progress.length)return null;let m=n.progress.filter(e=>{var t;return t=e.phase,!r.includes(t);}).map(e=>ee[e.phase]);async function x(){u(!0),p(null);try{await(null!=d?d:i.QI)(t),a();}catch(e){p(e instanceof Error?e.message:"Resume failed.");}finally{u(!1);}}return(0,l.jsxs)("section",{"aria-labelledby":"lkd-large-doc-heading",className:"lkd-status-section",children:[(0,l.jsxs)("div",{className:"lkd-section-title-row",children:[(0,l.jsx)(P,{children:(0,l.jsx)("span",{id:"lkd-large-doc-heading",children:"Large documents"})}),(0,l.jsx)("span",{className:"lkd-live-note",role:"status","aria-live":"polite",children:m.length>0?`In progress: ${m.join(", ")}`:"Idle"})]}),n.partialCoverageDocuments>0?(0,l.jsxs)("p",{className:"lkd-status-callout","data-tone":"warn",children:[n.partialCoverageDocuments.toString()," document",1===n.partialCoverageDocuments?"":"s"," indexed with partial coverage. The pipeline is stable; retrieval quality is limited for these documents."]}):null,(0,l.jsx)("ul",{className:"lkd-list lkd-source-list","aria-label":"Large-document progress",children:n.progress.map(e=>(0,l.jsx)(et,{progress:e},e.documentId))}),n.qualityWarnings.length>0?(0,l.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Retrieval quality warnings",children:n.qualityWarnings.map(e=>(0,l.jsx)("li",{children:e},e))}):null,n.resumableDocuments.length>0?(0,l.jsx)("button",{type:"button",onClick:()=>{x();},disabled:c||o,"aria-label":"Resume interrupted large-document indexing",className:"lk-action-button",children:c?"Resuming…":`Resume ${n.resumableDocuments.length.toString()} document${1===n.resumableDocuments.length?"":"s"}`}):null,null!==h?(0,l.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:h}):null]});}function el(){var e,t,n;let{capsuleId:r,onDeleted:o,fetchDetailImpl:c,resumeImpl:h}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},p=(0,a.useSearchParams)(),m=(0,a.useRouter)(),x=null!=r?r:null!=(e=p.get("capsuleId"))?e:"",{data:g,loadStatus:f,loadError:j,reload:y}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.rw,[n,l]=(0,s.useState)(null),[a,r]=(0,s.useState)("loading"),[o,d]=(0,s.useState)(null),c=(0,s.useCallback)(async function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(""===e){l(null),d("No capsule selected."),r("error");return;}!0!==n.quiet&&(r("loading"),d(null));try{let n=await t(e);l(n),r("ready");}catch(e){if(!0===n.quiet)return;d((0,u.W)(e)),r("error");}},[e,t]);return(0,s.useEffect)(()=>{c();},[c]),(0,s.useEffect)(()=>{let e=null==n?void 0:n.indexingJobs[0];if((null==n?void 0:n.capsule.lifecycleState)!=="indexing"&&(null==e?void 0:e.status)!=="queued"&&(null==e?void 0:e.status)!=="running")return;let t=window.setInterval(()=>{c({quiet:!0});},2e3);return()=>window.clearInterval(t);},[null==n?void 0:n.capsule.lifecycleState,null==n?void 0:n.indexingJobs,c]),{data:n,loadStatus:a,loadError:o,reload:function(){c();}};}(x,c);return"loading"===f?(0,l.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading capsule…"}):"error"===f||null===g?""===x?(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:["No capsule selected. Open a capsule from the Local Knowledge overview.",(0,l.jsx)(d(),{href:"/local-knowledge",className:"lk-alert-retry",children:"Back to Local Knowledge"})]}):(null==j?void 0:j.includes("NOT_FOUND"))===!0||(null==j?void 0:j.toLowerCase().includes("not found"))===!0?(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:["This capsule no longer exists. Return to the Local Knowledge overview.",(0,l.jsx)(d(),{href:"/local-knowledge",className:"lk-alert-retry",children:"Back to capsules"})]}):(0,l.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[null!=j?j:"Failed to load capsule.",(0,l.jsx)("button",{type:"button",onClick:y,"aria-label":"Retry loading capsule detail",className:"lk-alert-retry",children:"Retry"})]}):(0,l.jsxs)("div",{className:"lkd-content",children:[(0,l.jsxs)("header",{className:"lk-header",children:[(0,l.jsx)("h1",{className:"lk-title",children:g.capsule.displayName}),(0,l.jsx)($,{capsuleId:x,displayName:g.capsule.displayName,...(void 0!==g.capsule.description?{description:g.capsule.description}:{}),onRenamed:y})]}),(0,l.jsx)(E,{capsuleId:x,capsuleDisplayName:g.capsule.displayName,sourceCount:g.sources.length,lifecycleState:g.capsule.lifecycleState,onActionComplete:y,onDeleted:function(e){void 0!==o?o(e):m.push("/local-knowledge");}}),(0,l.jsx)(B,{data:g}),void 0!==g.largeDocumentHealth?(0,l.jsx)(en,{capsuleId:x,health:g.largeDocumentHealth,onActionComplete:y,jobActive:"indexing"===g.capsule.lifecycleState||(null==(t=O(g))?void 0:t.status)==="running"||(null==(n=O(g))?void 0:n.status)==="queued",...(void 0!==h?{resumeImpl:h}:{})}):null,(0,l.jsx)(_,{data:g}),(0,l.jsx)(z,{}),(0,l.jsx)(q,{sources:g.sources}),(0,l.jsx)(Z,{diagnostics:g.parserDiagnostics}),(0,l.jsx)(Q,{jobs:g.indexingJobs})]});}},73599:(e,t,n)=>{let l,s;n.d(t,{AD:()=>p,Cp:()=>S,Dz:()=>d,Gb:()=>O,IN:()=>h,KD:()=>I,Mr:()=>N,Oz:()=>k,Qe:()=>g,Su:()=>x,T$:()=>w,T7:()=>o,Um:()=>_,Wk:()=>Y,YT:()=>U,ZC:()=>c,ZF:()=>E,_A:()=>K,fG:()=>m,gA:()=>v,hD:()=>r,iS:()=>H,jv:()=>B,mG:()=>Z,mU:()=>F,mj:()=>C,nk:()=>T,pp:()=>z,q7:()=>R,qU:()=>f,qe:()=>u,r$:()=>W,rX:()=>V,rp:()=>q,tA:()=>M,tZ:()=>j,vj:()=>y,wi:()=>b,xe:()=>D,xp:()=>A,y0:()=>G,z4:()=>P});var a=n(4503);class r extends Error{constructor(e,t,n){super(t),this.code=e,this.status=n,this.name="ApiError";}}async function i(e,t){var n,l;let s=(null!=(n=null==t?void 0:t.method)?n:"GET").toUpperCase(),a="GET"!==s&&"HEAD"!==s,i=await fetch(e,{...t,headers:{Accept:"application/json",...(a?{"Content-Type":"application/json"}:{}),...(a?{"X-Keiko-CSRF":"1"}:{}),...(null!=(l=null==t?void 0:t.headers)?l:{})}});if(!i.ok){let e="INTERNAL",t=`HTTP ${i.status.toString()}`;try{let n=await i.json();e=n.error.code,t=n.error.message;}catch{}throw new r(e,t,i.status);}if(204!==i.status)return i.json();}async function o(){return i("/api/health");}async function d(){var e;let t=await i("/api/config");return{config:t.config,configPresent:t.configPresent,effectiveGroundingLimits:null!=(e=t.effectiveGroundingLimits)?e:a.ty};}async function c(){return null!=l||(l=i("/api/models").catch(e=>{throw l=void 0,e;})),l;}async function u(e){let t=await i("/api/gateway/setup",{method:"POST",body:JSON.stringify(e)});return l=void 0,t;}async function h(e,t){return i("/api/gateway/readiness",{method:"POST",body:JSON.stringify({...(void 0===e?{}:{modelId:e}),...(void 0===t?{}:{options:t})})});}async function p(e){return i("/api/runs",{method:"POST",body:JSON.stringify(e)});}async function m(e,t){return i("/api/prompt-enhancement",{method:"POST",body:JSON.stringify(e),...(void 0===t?{}:{signal:t})});}async function x(e){return i(`/api/runs/${encodeURIComponent(e)}/cancel`,{method:"POST",body:JSON.stringify({confirm:!0})});}async function g(e){return i(`/api/runs/${encodeURIComponent(e)}`);}async function f(e){return i(`/api/runs/${encodeURIComponent(e)}/apply`,{method:"POST",body:JSON.stringify({confirm:!0})});}async function j(e){return i(`/api/evidence/${encodeURIComponent(e)}`);}async function y(){return null!=s||(s=i("/api/projects").finally(()=>{s=void 0;})),s;}async function v(e){return i("/api/projects",{method:"POST",body:JSON.stringify(e)});}async function k(e){return i(`/api/chats?projectPath=${encodeURIComponent(e)}`);}async function b(e,t){return i(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)});}async function N(e,t){return i(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({connectedScopes:t})});}async function S(e,t){return i(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({localKnowledgeScopes:t})});}async function w(e,t){let n=new URLSearchParams();return n.set("chatId",e),n.set("projectPath",t),i(`/api/chats/messages?${n.toString()}`);}async function C(e,t,n,l){let s=new URLSearchParams();return s.set("id",e),s.set("chatId",t),s.set("projectPath",n),i(`/api/chats/messages?${s.toString()}`,{method:"PATCH",body:JSON.stringify(l)});}async function M(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i("/api/desktop/chats",{method:"POST",body:JSON.stringify(e)});}async function A(e,t){return i("/api/desktop/chat",{method:"POST",body:JSON.stringify(e),signal:null!=t?t:null});}class E extends Error{constructor(e,t){super(t),this.code=e,this.name="StreamingUnavailableError";}}function L(e,t,n){let l=t;for(let t of e){let e=t.trimEnd();if(e.startsWith("event:"))l=e.slice(6).trim();else if(e.startsWith("data:")){let t,s=e.slice(5).trim();try{t=JSON.parse(s);}catch{continue;}!function(e,t,n){switch(e){case"token":{let e=function(e){if("object"==typeof e&&null!==e&&"text"in e&&"string"==typeof e.text)return e;}(t);void 0!==e&&n.onToken(e.text);break;}case"done":{let e=function(e){if("object"==typeof e&&null!==e&&"chat"in e&&"messages"in e)return e;}(t);void 0!==e&&n.onDone(e);break;}case"error":{let e=function(e){if("object"==typeof e&&null!==e&&"code"in e&&"message"in e&&"string"==typeof e.code&&"string"==typeof e.message)return e;}(t);void 0!==e&&n.onError(e);break;}case"cancelled":n.onCancelled();}}(l,t,n),l=void 0;}else""===e&&(l=void 0);}return l;}async function $(e,t,n){let l,s=e.getReader(),a=new TextDecoder(),r="",i=!1;try{for(;!t.aborted;){var o;let e=await s.read();if(e.done){i=!0;break;}let t=(r+=a.decode(e.value,{stream:!0})).split("\n");r=null!=(o=t.pop())?o:"",l=L(t,l,n);}i&&""!==r&&L([r],l,n);}finally{s.releaseLock();}}async function T(e,t,n){var l,s,a,r,i;let o=await fetch("/api/desktop/chat/stream",{method:"POST",headers:{Accept:"text/event-stream","Content-Type":"application/json","X-Keiko-CSRF":"1"},body:JSON.stringify(e),signal:t});if(!(null!=(l=o.headers.get("content-type"))?l:"").includes("text/event-stream")){let e="STREAMING_UNSUPPORTED",t=`HTTP ${o.status.toString()}`;try{let n=await o.json();e=null!=(s=null==(r=n.error)?void 0:r.code)?s:e,t=null!=(a=null==(i=n.error)?void 0:i.message)?a:t;}catch{}throw new E(e,t);}if(null===o.body)throw new E("STREAMING_UNSUPPORTED","Response body was null.");await $(o.body,t,n);}async function D(e,t){let n=new URLSearchParams();return n.set("root",e),void 0!==t&&t.length>0&&n.set("path",t),i(`/api/files/directories?${n.toString()}`);}async function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=new URLSearchParams();return n.set("root",e),t.length>0&&n.set("path",t),i(`/api/files/tree?${n.toString()}`);}async function O(e,t,n){let l=new URLSearchParams();return l.set("root",e),l.set("q",t),void 0!==n&&l.set("limit",String(n)),i(`/api/files/search?${l.toString()}`);}async function R(e,t){let n=new URLSearchParams();return n.set("root",e),n.set("path",t),i(`/api/files/preview?${n.toString()}`);}async function P(e,t){let n=new URLSearchParams();return n.set("root",e),n.set("path",t),i(`/api/files/content?${n.toString()}`);}async function H(e){return i("/api/files/content",{method:"PATCH",body:JSON.stringify(e)});}async function V(e,t){return i("/api/editor/completion",{method:"POST",body:JSON.stringify({schemaVersion:a.eg,root:e.root,document:{path:e.path,languageId:e.languageId,text:e.text},position:e.position,triggerKind:e.triggerKind,...(void 0===e.triggerCharacter?{}:{triggerCharacter:e.triggerCharacter}),contextBudgetBytes:e.contextBudgetBytes,...(void 0===e.context?{}:{context:e.context}),...(void 0===e.maxCostClass?{}:{maxCostClass:e.maxCostClass})}),...(void 0===t?{}:{signal:t})});}async function U(e,t){return i("/api/editor/inline-completion",{method:"POST",body:JSON.stringify({schemaVersion:a.IF,root:e.root,document:{path:e.path,languageId:e.languageId,text:e.text},position:e.position,triggerKind:e.triggerKind,contextBudgetBytes:e.contextBudgetBytes,...(void 0===e.context?{}:{context:e.context}),...(void 0===e.maxCostClass?{}:{maxCostClass:e.maxCostClass}),...(void 0===e.maxOutputTokens?{}:{maxOutputTokens:e.maxOutputTokens})}),...(void 0===t?{}:{signal:t})});}async function F(e){let t={schemaVersion:a.gr,root:e.root,offered:e.offered,shown:e.shown,accepted:e.accepted,rejected:e.rejected,ignored:e.ignored,partiallyAccepted:e.partiallyAccepted,requestCount:e.requestCount,requestLatencyMsP50:e.requestLatencyMsP50,requestLatencyMsP95:e.requestLatencyMsP95};await i("/api/editor/inline-completion/telemetry",{method:"POST",body:JSON.stringify(t)});}async function B(e,t){return i("/api/editor/test-generation",{method:"POST",body:JSON.stringify({schemaVersion:a.lc,root:e.root,target:e.target,contextBudgetBytes:e.contextBudgetBytes,...(void 0===e.context?{}:{context:e.context})}),...(void 0===t?{}:{signal:t})});}function J(e){return{path:e.path,languageId:e.languageId,text:e.text};}async function _(){return i("/api/editor/language/capabilities");}async function q(e,t){return(await i("/api/editor/language",{method:"POST",body:JSON.stringify({operation:"diagnostics",root:e.root,document:J(e)}),...(void 0===t?{}:{signal:t})})).result;}async function z(e,t){return(await i("/api/editor/language",{method:"POST",body:JSON.stringify({operation:"hover",root:e.root,document:J(e),position:e.position}),...(void 0===t?{}:{signal:t})})).result;}async function K(e,t){return(await i("/api/editor/language",{method:"POST",body:JSON.stringify({operation:"symbols",root:e.root,document:J(e)}),...(void 0===t?{}:{signal:t})})).result;}async function G(e,t){return(await i("/api/editor/language",{method:"POST",body:JSON.stringify({operation:"formatting",root:e.root,document:J(e),...(void 0===e.options?{}:{options:e.options})}),...(void 0===t?{}:{signal:t})})).result;}async function W(e){return i("/api/editor/agent/snapshot",{method:"POST",body:JSON.stringify({schemaVersion:e.schemaVersion,kind:"snapshot",snapshot:e})});}async function Z(e){return i("/api/editor/agent/actions",{method:"POST",body:JSON.stringify(e)});}async function Y(e,t){return i("/api/chats/messages/grounded",{method:"POST",body:JSON.stringify(e),signal:null!=t?t:null});}},75571:(e,t,n)=>{n.d(t,{F:()=>a});var l=n(54568);function s(e){let{size:t=18,sw:n=1.6,vb:s=24,fill:a,className:r,style:i,children:o,d}=e,c=void 0!==a;return(0,l.jsx)("svg",{className:r,width:t,height:t,viewBox:`0 0 ${String(s)} ${String(s)}`,fill:c?a:"none",stroke:c?"none":"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",style:i,"aria-hidden":"true",children:void 0!==d?(0,l.jsx)("path",{d:d}):o});}let a={newChat:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M4 6 H12.5"}),(0,l.jsx)("path",{d:"M4 9.5 H9.5"}),(0,l.jsx)("path",{d:"M14.4 13.6 l4-4 a1.6 1.6 0 0 1 2.3 2.3 l-6.2 6.2 -3 .7 .7 -3 z"})]}),search:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M12.25 4.76 A6 6 0 1 1 8.75 4.76"}),(0,l.jsx)("path",{d:"M14.7 14.7 L20 20"})]}),plugins:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("rect",{x:"4",y:"4",width:"6.5",height:"6.5",rx:"1.5"}),(0,l.jsx)("rect",{x:"13.5",y:"4",width:"6.5",height:"6.5",rx:"1.5"}),(0,l.jsx)("rect",{x:"4",y:"13.5",width:"6.5",height:"6.5",rx:"1.5"}),(0,l.jsx)("rect",{x:"13.5",y:"13.5",width:"6.5",height:"6.5",rx:"1.5"})]}),automations:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"12",cy:"12",r:"8"}),(0,l.jsx)("path",{d:"M12 7.5V12l3 2"})]}),mobile:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("rect",{x:"7",y:"3",width:"10",height:"18",rx:"2.5"}),(0,l.jsx)("path",{d:"M11 18h2"})]}),folder:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M3.6 7.4 V6.3 a1.5 1.5 0 0 1 1.5-1.5 H8 a1.5 1.5 0 0 1 1.1 .48 L10.3 7.4"}),(0,l.jsx)("path",{d:"M13.50 7.40 H18.00 A2.4 2.4 0 0 1 20.40 9.80 V16.00 A2.4 2.4 0 0 1 18.00 18.40 H6.00 A2.4 2.4 0 0 1 3.60 16.00 V9.80 A2.4 2.4 0 0 1 6.00 7.40 H10.50"})]}),settings:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M 13.02 3.36 L 13.21 3.38 L 13.66 5.82 L 15.20 6.46 L 17.24 5.05 L 18.95 6.76 L 17.54 8.80 L 18.18 10.34 L 20.62 10.79 L 20.62 13.21 L 18.18 13.66 L 17.54 15.20 L 18.95 17.24 L 17.24 18.95 L 15.20 17.54 L 13.66 18.18 L 13.21 20.62 L 10.79 20.62 L 10.34 18.18 L 8.80 17.54 L 6.76 18.95 L 5.05 17.24 L 6.46 15.20 L 5.82 13.66 L 3.38 13.21 L 3.38 10.79 L 5.82 10.34 L 6.46 8.80 L 5.05 6.76 L 6.76 5.05 L 8.80 6.46 L 10.34 5.82 L 10.79 3.38 L 10.98 3.36"}),(0,l.jsx)("circle",{cx:"12",cy:"12",r:"2.7"})]}),files:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M5.5 8 V5.5 a1.9 1.9 0 0 1 1.9-1.9 H12.8 L18.5 8.8 V18.5 a1.9 1.9 0 0 1-1.9 1.9 H7.4 a1.9 1.9 0 0 1-1.9-1.9 V11"}),(0,l.jsx)("path",{d:"M12.8 3.6 V7.4 a1.4 1.4 0 0 0 1.4 1.4 H18.5"})]}),browser:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"12",cy:"12",r:"8.5"}),(0,l.jsx)("path",{d:"M3.5 12h17M12 3.5c2.3 2.3 2.3 14.7 0 17M12 3.5c-2.3 2.3-2.3 14.7 0 17"})]}),review:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M9 12l2 2 4-4"}),(0,l.jsx)("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"})]}),terminal:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.70 5.00 H17.50 A2.5 2.5 0 0 1 20.00 7.50 V16.50 A2.5 2.5 0 0 1 17.50 19.00 H6.50 A2.5 2.5 0 0 1 4.00 16.50 V7.50 A2.5 2.5 0 0 1 6.50 5.00 H10.30"}),(0,l.jsx)("path",{d:"M8 9.6 L11 12.6 L8 15.6"}),(0,l.jsx)("path",{d:"M12.8 15.6 H16.4"})]}),agents:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("rect",{x:"5",y:"7",width:"14",height:"11",rx:"3"}),(0,l.jsx)("path",{d:"M12 7V4M9 12h.01M15 12h.01M2.5 12.5v2M21.5 12.5v2"})]}),git:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"6",cy:"6",r:"2.5"}),(0,l.jsx)("circle",{cx:"6",cy:"18",r:"2.5"}),(0,l.jsx)("circle",{cx:"17",cy:"9",r:"2.5"}),(0,l.jsx)("path",{d:"M6 8.5v7M17 11.5c0 3-3 3.5-6 4"})]}),plus:e=>(0,l.jsx)(s,{...e,d:"M12 5v14M5 12h14"}),chevron:e=>(0,l.jsx)(s,{...e,d:"M6 9l6 6 6-6"}),chevronR:e=>(0,l.jsx)(s,{...e,d:"M9 6l6 6-6 6"}),mic:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M12 3.2 a3 3 0 0 1 3 3 V11 a3 3 0 0 1 -6 0 V6.2 a3 3 0 0 1 2 -2.8"}),(0,l.jsx)("path",{d:"M5.5 11.5 a6.5 6.5 0 0 0 13 0 M12 18 v3"})]}),arrowUp:e=>(0,l.jsx)(s,{...e,d:"M12 19V5M6 11l6-6 6 6"}),spark:e=>(0,l.jsx)(s,{...e,d:"M13.2 3.6 L19 10 l-5.2 1.4 L12 17 l-1.8 -5.6 L5 10 l5.2 -1.4 z"}),pin:e=>(0,l.jsx)(s,{...e,d:"M9 3h6l-1 5 3 3-5 1-1 8-1-8-5-1 3-3z"}),brain:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z"}),(0,l.jsx)("path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z"})]}),brainSlash:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z"}),(0,l.jsx)("path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z"}),(0,l.jsx)("path",{d:"M3.2 20.4 20.8 3.6"})]}),archive:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.20 5.00 H19.50 A1 1 0 0 1 20.50 6.00 V8.00 A1 1 0 0 1 19.50 9.00 H4.50 A1 1 0 0 1 3.50 8.00 V6.00 A1 1 0 0 1 4.50 5.00 H10.80"}),(0,l.jsx)("path",{d:"M5 9 v8 a2 2 0 0 0 2 2 h10 a2 2 0 0 0 2-2 V9"}),(0,l.jsx)("path",{d:"M10 13 h4"})]}),sidebar:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,l.jsx)("path",{d:"M9.5 5 V19"})]}),minimize:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M7 14 H10.4"}),(0,l.jsx)("path",{d:"M13.6 14 H17"})]}),expand:e=>(0,l.jsx)(s,{...e,d:"M4 9V4h5M20 15v5h-5M20 9V4h-5M4 15v5h5"}),back:e=>(0,l.jsx)(s,{...e,d:"M15 6l-6 6 6 6"}),fwd:e=>(0,l.jsx)(s,{...e,d:"M9 6l6 6-6 6"}),drag:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"9",cy:"6",r:"1.1",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"15",cy:"6",r:"1.1",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"9",cy:"12",r:"1.1",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"15",cy:"12",r:"1.1",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"9",cy:"18",r:"1.1",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"15",cy:"18",r:"1.1",fill:"currentColor",stroke:"none"})]}),close:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M7 7 L10.4 10.4"}),(0,l.jsx)("path",{d:"M17 7 L13.6 10.4"}),(0,l.jsx)("path",{d:"M7 17 L10.4 13.6"}),(0,l.jsx)("path",{d:"M17 17 L13.6 13.6"})]}),dots:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"6",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"12",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"}),(0,l.jsx)("circle",{cx:"18",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"})]}),check:e=>(0,l.jsx)(s,{...e,d:"M5 12.5l4.5 4.5L19 6.5"}),copy:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("rect",{x:"8",y:"8",width:"10",height:"10",rx:"2"}),(0,l.jsx)("path",{d:"M6 14 H5.8 A1.8 1.8 0 0 1 4 12.2 V6.8 A1.8 1.8 0 0 1 5.8 5 H11.2 A1.8 1.8 0 0 1 13 6.8 V7"})]}),info:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M14.51 4.96 A8.6 8.6 0 1 1 9.49 4.96"}),(0,l.jsx)("path",{d:"M12 8.2 h.01"}),(0,l.jsx)("path",{d:"M12 11.3 V16.3"})]}),edit:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M4.5 6.5 H13"}),(0,l.jsx)("path",{d:"M4.5 10 H10"}),(0,l.jsx)("path",{d:"M14.4 13.6 l4-4 a1.6 1.6 0 0 1 2.3 2.3 l-6.2 6.2 -3 .7 .7 -3 z"})]}),trash:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M5 7 H19"}),(0,l.jsx)("path",{d:"M9 7 V5.6 A1.6 1.6 0 0 1 10.6 4 H13.4 A1.6 1.6 0 0 1 15 5.6 V7"}),(0,l.jsx)("path",{d:"M17.5 10 L16.8 18.2 A2 2 0 0 1 14.8 20 H9.2 A2 2 0 0 1 7.2 18.2 L6.5 10"}),(0,l.jsx)("path",{d:"M10 11.5 V17"}),(0,l.jsx)("path",{d:"M14 11.5 V17"})]}),reset:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M4 12a8 8 0 1 1 2.3 5.6"}),(0,l.jsx)("path",{d:"M4 20v-4h4"})]}),file:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M5.5 8 V5.5 a1.9 1.9 0 0 1 1.9-1.9 H12.8 L18.5 8.8 V18.5 a1.9 1.9 0 0 1-1.9 1.9 H7.4 a1.9 1.9 0 0 1-1.9-1.9 V11"}),(0,l.jsx)("path",{d:"M12.8 3.6 V7.4 a1.4 1.4 0 0 0 1.4 1.4 H18.5"})]}),diff:e=>(0,l.jsx)(s,{...e,d:"M12 4v6M9 7h6M5 17h14"}),branch:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M7.63 4.97 A2.3 2.3 0 1 1 4.37 4.97"}),(0,l.jsx)("circle",{cx:"6",cy:"17.4",r:"2.3"}),(0,l.jsx)("circle",{cx:"17.4",cy:"8.6",r:"2.3"}),(0,l.jsx)("path",{d:"M6 8.9 V15.1"}),(0,l.jsx)("path",{d:"M17.4 10.9 c0 4 -4 3.7 -7 4.7"})]}),cube:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9z"}),(0,l.jsx)("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5"})]}),maximize:e=>(0,l.jsx)(s,{...e,d:"M13.50 7.00 H15.00 A2 2 0 0 1 17.00 9.00 V15.00 A2 2 0 0 1 15.00 17.00 H9.00 A2 2 0 0 1 7.00 15.00 V9.00 A2 2 0 0 1 9.00 7.00 H10.50"}),restore:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M9 9 V8 a2 2 0 0 1 2 -2 h6 a2 2 0 0 1 2 2 v6 a2 2 0 0 1 -2 2 h-1"}),(0,l.jsx)("path",{d:"M11.50 9.00 H13.00 A2 2 0 0 1 15.00 11.00 V17.00 A2 2 0 0 1 13.00 19.00 H7.00 A2 2 0 0 1 5.00 17.00 V11.00 A2 2 0 0 1 7.00 9.00 H8.50"})]}),split:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,l.jsx)("path",{d:"M12 5 V19"})]}),tile:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M8.10 4.50 H9.00 A1.5 1.5 0 0 1 10.50 6.00 V10.00 A1.5 1.5 0 0 1 9.00 11.50 H5.00 A1.5 1.5 0 0 1 3.50 10.00 V6.00 A1.5 1.5 0 0 1 5.00 4.50 H5.90"}),(0,l.jsx)("path",{d:"M15.00 4.50 H19.00 A1.5 1.5 0 0 1 20.50 6.00 V10.00 A1.5 1.5 0 0 1 19.00 11.50 H15.00 A1.5 1.5 0 0 1 13.50 10.00 V6.00 A1.5 1.5 0 0 1 15.00 4.50 Z"}),(0,l.jsx)("path",{d:"M5.00 13.50 H9.00 A1.5 1.5 0 0 1 10.50 15.00 V19.00 A1.5 1.5 0 0 1 9.00 20.50 H5.00 A1.5 1.5 0 0 1 3.50 19.00 V15.00 A1.5 1.5 0 0 1 5.00 13.50 Z"}),(0,l.jsx)("path",{d:"M15.00 13.50 H19.00 A1.5 1.5 0 0 1 20.50 15.00 V19.00 A1.5 1.5 0 0 1 19.00 20.50 H15.00 A1.5 1.5 0 0 1 13.50 19.00 V15.00 A1.5 1.5 0 0 1 15.00 13.50 Z"})]}),cascade:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("rect",{x:"4",y:"4",width:"12",height:"12",rx:"2"}),(0,l.jsx)("path",{d:"M20 8v10a2 2 0 0 1-2 2H8"})]}),editor:e=>(0,l.jsx)(s,{...e,children:(0,l.jsx)("path",{d:"M8 9l-3 3 3 3M16 9l3 3-3 3M13.5 6l-3 12"})}),gear:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"12",cy:"12",r:"2.6"}),(0,l.jsx)("path",{d:"M12 3.5v2M12 18.5v2M20.5 12h-2M5.5 12h-2M18 6l-1.4 1.4M7.4 16.6 6 18M18 18l-1.4-1.4M7.4 7.4 6 6"})]}),panelRight:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,l.jsx)("path",{d:"M14.5 5 V19"})]}),layers:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.4 4.55 L19.6 8 L12 12.2 L4.4 8 L10.6 4.55"}),(0,l.jsx)("path",{d:"M4.4 12 L12 16.2 L19.6 12"}),(0,l.jsx)("path",{d:"M4.4 16 L12 20.2 L19.6 16"})]}),tokens:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"9",cy:"9",r:"4.5"}),(0,l.jsx)("path",{d:"M14 9.5a4.5 4.5 0 1 1-4 6.9"})]}),bolt:e=>(0,l.jsx)(s,{...e,d:"M13 3 5 13h5l-1 8 8-10h-5z"}),add:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"3.5"}),(0,l.jsx)("path",{d:"M12 8.5v7M8.5 12h7"})]}),bell:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M9.8 4.6 a5.5 5.5 0 0 1 7.7 4.4 c0 4.5 2 5.5 2 5.5 H4.5 s2 -1 2 -5.5 a5.5 5.5 0 0 1 1.1 -3.3"}),(0,l.jsx)("path",{d:"M10 19 a2 2 0 0 0 4 0"})]}),sun:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.17 8.17 A4 4 0 1 1 10.83 8.17"}),(0,l.jsx)("path",{d:"M12 2.5 V5 M12 19 V21.5 M2.5 12 H5 M19 12 H21.5 M5.1 5.1 L6.9 6.9 M17.1 17.1 l1.8 1.8 M18.9 5.1 L17.1 6.9 M6.9 17.1 L5.1 18.9"})]}),moon:e=>(0,l.jsx)(s,{...e,d:"M19.5 13.5 A8 8 0 1 1 10.5 4.2 a6.5 6.5 0 0 0 9.3 9.1"}),zoomOut:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"11",cy:"11",r:"6.5"}),(0,l.jsx)("path",{d:"M20 20l-4.2-4.2M8.3 11h5.4"})]}),zoomIn:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("circle",{cx:"11",cy:"11",r:"6.5"}),(0,l.jsx)("path",{d:"M20 20l-4.2-4.2M11 8.3v5.4M8.3 11h5.4"})]}),activity:e=>(0,l.jsx)(s,{...e,d:"M3 12h3l2.5-7 5 14 2.5-7H21"}),user:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.35 4.66 A3.6 3.6 0 1 1 10.65 4.66"}),(0,l.jsx)("path",{d:"M5.5 20 c.9 -3.7 3.4 -5.5 6.5 -5.5 s5.6 1.8 6.5 5.5"})]}),localKnowledge:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M4 19V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12"}),(0,l.jsx)("path",{d:"M4 19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2"}),(0,l.jsx)("path",{d:"M9 7v14M9 11h6"})]}),server:e=>(0,l.jsxs)(s,{...e,children:[(0,l.jsx)("path",{d:"M13.30 4.50 H18.30 A1.7 1.7 0 0 1 20.00 6.20 V8.80 A1.7 1.7 0 0 1 18.30 10.50 H5.70 A1.7 1.7 0 0 1 4.00 8.80 V6.20 A1.7 1.7 0 0 1 5.70 4.50 H10.70"}),(0,l.jsx)("path",{d:"M5.70 13.50 H18.30 A1.7 1.7 0 0 1 20.00 15.20 V17.80 A1.7 1.7 0 0 1 18.30 19.50 H5.70 A1.7 1.7 0 0 1 4.00 17.80 V15.20 A1.7 1.7 0 0 1 5.70 13.50 Z"}),(0,l.jsx)("path",{d:"M7.4 7.5 h.01 M7.4 16.5 h.01 M12 7.5 H16 M12 16.5 H16"})]})};},76308:(e,t,n)=>{n.d(t,{$e:()=>u,c2:()=>h,pD:()=>c});var l=n(54568),s=n(7620),a=n(97509),r=n(73599),i=n(19217),o=n(75571);let d="Der Ordner konnte nicht geladen werden.";function c(e){let t=e.trim().replace(/[/\\]+$/u,""),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0?t.startsWith("/")?"/":"":t.slice(0,n);}function u(e,t){if(null===t||0===t.length)return e;let n=e.includes("\\")&&!e.includes("/")?"\\":"/";return`${e.replace(/[/\\]+$/u,"")}${n}${t.replace(/\//gu,n)}`;}function h(e){var t;let{mode:n,title:c,description:h,note:p,initialRootPath:m,initialFiles:x=[],fetchProjectsImpl:g=r.vj,fetchFilesTreeImpl:f=r.KD,isFileDisabled:j,fileDisabledReason:y,fileMeta:v,onApply:k,onCancel:b}=e,N=(0,s.useRef)(null);(0,i.i)(),(0,s.useEffect)(()=>{var e,t;null==(t=N.current)||null==(e=t.querySelector("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"))||e.focus();},[!0,N]),(0,s.useEffect)(()=>{0;let e=N.current;if(null!==e)return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t);function t(t){if("Escape"===t.key){t.preventDefault(),b();return;}if("Tab"!==t.key)return;let n=Array.from(e.querySelectorAll("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"));if(0===n.length)return void t.preventDefault();let l=n[0],s=n[n.length-1];t.shiftKey&&document.activeElement===l?(t.preventDefault(),s.focus()):t.shiftKey||document.activeElement!==s||(t.preventDefault(),l.focus());}},[!0,N,b]);let[S,w]=(0,s.useState)([]),[C,M]=(0,s.useState)(m.trim()),[A,E]=(0,s.useState)(m.trim()),[L,$]=(0,s.useState)(null),[T,D]=(0,s.useState)([]),[I,O]=(0,s.useState)(()=>new Set(x)),[R,P]=(0,s.useState)(!1),[H,V]=(0,s.useState)(null);function U(e){let t=e.trim();0!==t.length&&(O(new Set()),$(null),M(t),E(t));}(0,s.useEffect)(()=>{let e=!1;return g().then(t=>{if(e)return;let n=t.projects.filter(e=>e.available);w(n),0===C.length&&void 0!==n[0]&&(M(n[0].path),E(n[0].path));}).catch(()=>{e||w([]);}),()=>{e=!0;};},[C.length,g]),(0,s.useEffect)(()=>{if(0===C.length){D([]),V(null);return;}let e=!1;return P(!0),V(null),f(C,null!=L?L:"").then(t=>{if(e)return;D(t.entries),M(t.root),E(t.root);let n=t.path.length>0?t.path:null;L!==n&&$(n);}).catch(t=>{e||(D([]),V(function(e){if(e instanceof r.hD){let t=e.message.trim();return t.length>0?`${t} (${e.code})`:`${d} (${e.code})`;}if(e instanceof Error)return e.message.trim().length>0?e.message:d;let t=String(e).trim();return t.length>0?t:d;}(t)));}).finally(()=>{e||P(!1);}),()=>{e=!0;};},[C,L,f]);let F=u(C,L),B=Array.from(I),J=1===B.length?u(C,null!=(t=B[0])?t:null):"",_=0!==C.length&&("folder"===n||("file"===n?1===I.size:"files"!==n||I.size>0)),q="file"===n||"files"===n||"folder-or-files"===n,z="local-file-browser-title",K="local-file-browser-desc";return(0,a.createPortal)((0,l.jsx)("div",{className:"dlg-overlay in",role:"presentation",onClick:e=>{e.target===e.currentTarget&&b();},children:(0,l.jsxs)("div",{ref:N,role:"dialog","aria-modal":"true","aria-labelledby":z,"aria-describedby":K,className:"dlg lkd-source-picker",tabIndex:-1,children:[(0,l.jsx)("div",{className:"dlg-head",children:(0,l.jsxs)("div",{className:"dlg-htext",children:[(0,l.jsx)("div",{id:z,className:"dlg-title",children:c}),(0,l.jsx)("div",{id:K,className:"dlg-sub",children:h}),void 0!==p?(0,l.jsx)("div",{className:"dlg-sub",children:p}):null]})}),(0,l.jsxs)("div",{className:"dlg-body lkd-source-picker-body",children:[S.length>0?(0,l.jsx)("div",{className:"lkd-picker-projects","aria-label":"Registered project folders",children:S.map(e=>{var t;return(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:()=>{U(e.path);},children:null!=(t=e.name)?t:e.path},e.path);})}):null,(0,l.jsxs)("form",{className:"lkd-picker-root",onSubmit:e=>{e.preventDefault(),U(A);},children:[(0,l.jsx)("label",{htmlFor:"local-file-browser-root",className:"dlg-label",children:"Folder root"}),(0,l.jsx)("input",{id:"local-file-browser-root",type:"text",className:"dlg-input lkd-connect-input",value:A,placeholder:"/absolute/path/to/folder",onChange:e=>E(e.target.value)}),(0,l.jsx)("button",{type:"submit",className:"lk-btn lk-btn-ghost",children:"Open"})]}),(0,l.jsxs)("div",{className:"lkd-picker-current",children:[(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null===L,onClick:()=>{O(new Set()),$(function(e){if(null===e||0===e.length)return null;let t=e.replace(/\/+$/u,""),n=t.lastIndexOf("/");if(n<0)return null;let l=t.slice(0,n);return l.length>0?l:null;}(L));},children:"Up"}),(0,l.jsx)("span",{className:"mono",title:F,children:F||"No folder selected"})]}),null!==H?(0,l.jsx)("div",{role:"alert",className:"lk-alert",children:H}):null,R?(0,l.jsx)("p",{role:"status",className:"lk-loading",children:"Loading folder..."}):(0,l.jsxs)("ul",{className:"lkd-picker-list","aria-label":"Local source browser",children:[T.map(e=>{var t,s,a,r;let i="file"===e.kind&&!e.symlink,d="directory"!==e.kind&&(!i||!q||!e.readable||null!=(t=null==j?void 0:j(e))&&t),c="directory"!==e.kind&&d?e.symlink||"symlink"===e.kind?"Symbolic links cannot be selected.":null!=(s=null==y?void 0:y(e))?s:"File cannot be selected.":void 0,u=I.has(e.path);return(0,l.jsx)("li",{className:"lkd-picker-entry",children:"directory"===e.kind?(0,l.jsxs)("button",{type:"button",className:"lkd-picker-row",disabled:!e.readable,onClick:()=>{var t;return t=e.path,void(O(new Set()),$(t));},children:[(0,l.jsx)(o.F.folder,{size:14}),(0,l.jsx)("span",{children:e.name})]}):"file"===n?(0,l.jsxs)("button",{type:"button",className:"lkd-picker-row",disabled:d,"aria-pressed":u,title:c,onClick:()=>{O(new Set([e.path]));},children:[(0,l.jsx)(o.F.files,{size:14}),(0,l.jsx)("span",{children:e.name}),(0,l.jsx)("span",{className:"lkd-picker-meta",children:null!=(a=null==v?void 0:v(e,u))?a:u?"selected":""})]}):(0,l.jsxs)("label",{className:"lkd-picker-row","data-disabled":String(d),title:c,children:[(0,l.jsx)("input",{type:"checkbox",disabled:d,checked:u,onChange:()=>{var t;return t=e.path,void O(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n;});}}),(0,l.jsx)("span",{children:e.name}),(0,l.jsx)("span",{className:"lkd-picker-meta",children:null!=(r=null==v?void 0:v(e,u))?r:u?"selected":""})]})},e.path);}),!R&&0===T.length&&C.length>0?(0,l.jsx)("li",{className:"lkd-picker-empty",children:"No entries in this folder."}):null]}),"file"===n&&1===B.length?(0,l.jsxs)("p",{className:"qi-source-picker-selection",title:J,children:["Selected file: ",(0,l.jsx)("span",{className:"qi-monospace",children:J})]}):null]}),(0,l.jsxs)("div",{className:"dlg-foot",children:[(0,l.jsx)("button",{type:"button",className:"dlg-btn",onClick:b,children:"Cancel"}),(0,l.jsx)("button",{type:"button",className:"dlg-btn primary",disabled:!_,onClick:function(){k({rootPath:C,folderPath:F,files:B});},children:"Use selection"})]})]})}),document.body);}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9385],{19385:(e,t,n)=>{n.r(t),n.d(t,{default:()=>eT});var a=n(54568),r=n(42925),i=n(7620),l=n(57511);let s=l.OM,o={kind:"idle"};function d(e,t){switch(t.type){case"request":return{kind:"requesting",requestId:t.requestId};case"resolve":var n,a;return(n=t.outcome,"requesting"===e.kind&&n.request.requestId===e.requestId)?"disabled"===(a=t.outcome).status?{kind:"disabled",reason:a.reason}:"deferred"===a.status?{kind:"deferred",reason:a.reason,funnel:a.funnel}:"generated"===a.status?{kind:"preview",result:a.result,funnel:a.funnel,assurance:a.assurance,...(void 0===a.reason?{}:{reason:a.reason})}:{kind:"failed",reason:a.reason}:e;case"error":return"requesting"===e.kind?{kind:"failed",reason:t.reason.length>0?t.reason:"Test generation failed. The editor is still usable."}:e;case"cancel":return"requesting"===e.kind?{kind:"cancelled"}:e;case"dismiss":return o;default:return e;}}function u(e){return"requesting"===e.kind;}let c={idle:"",requesting:"Generating tests…",preview:"Review the generated tests before applying them.",cancelled:"Test generation was cancelled. The editor is still usable.",disabled:"",deferred:"",failed:""};function v(e,t){return void 0===t?void 0:`${e} ${t.toString()}`;}var g=n(30403);function f(e){return"object"==typeof e&&null!==e&&!Array.isArray(e);}function p(e){return"string"==typeof e&&e.length>0;}function m(e){return"string"==typeof e&&/^[a-f0-9]{64}$/u.test(e);}function h(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0;}function b(e,t){return null===e||t(e);}function y(e){return f(e)&&h(e.sizeBytes)&&h(e.modifiedAt)&&m(e.contentHash);}function x(e){return!!f(e)&&[1===e.schemaVersion,p(e.workspaceRoot),p(e.relativePath),"string"==typeof e.content,b(e.baseVersion,y),m(e.contentHash),b(e.savedContentHash,m),h(e.updatedAt),p(e.paneId),p(e.windowId)].every(Boolean);}function w(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6048e5;return e.updatedAt+n<t;}var S=n(20147),C=n(81806),k=n(87266);class q extends Error{constructor(e){super(e),this.name="OverlappingPatchEditError";}}function j(e){let t=[0];for(let n=0;n<e.length;n+=1)10===e.charCodeAt(n)&&t.push(n+1);return t;}function T(e,t,n){var a;if(n.line<0)return 0;if(n.line>=t.length)return e.length;let r=null!=(a=t[n.line])?a:e.length,i=t[n.line+1],l=void 0===i?e.length:i-1;return Math.min(r+(n.column<0?0:n.column),l);}function I(e,t,n){let a=T(e,t,n.range.start);return{start:a,end:Math.max(a,T(e,t,n.range.end)),newText:n.newText};}function $(e,t,n,a){if(a.truncated||0===t.length)return;if(n<=a.bytes){a.truncated=!0;return;}let r=0;for(let l=0;l<t.length;){var i;let s=null!=(i=t.codePointAt(l))?i:0,o=s>65535?2:1,d=s<=127?1:s<=2047?2:s<=65535?3:4;if(a.bytes+d>n){r>0&&e.push(t.slice(0,r)),a.truncated=!0;return;}a.bytes+=d,r=l+o,l+=o;}e.push(t);}function R(e,t,n){let a={bytes:0,truncated:!1};if(0===t.length){let t=[];return $(t,e,n,a),{text:t.join(""),truncated:a.truncated};}let r=j(e),i=t.map(t=>I(e,r,t)).sort((e,t)=>e.start!==t.start?e.start-t.start:e.end-t.end),l=[],s=0;for(let t of i){if(t.start<s)throw new q("patch contains overlapping edits");$(l,e.slice(s,t.start),n,a),$(l,t.newText,n,a),s=t.end;}return $(l,e.slice(s),n,a),{text:l.join(""),truncated:a.truncated};}let B={maxFiles:400,maxBytesPerFile:262144,maxTotalBytes:524288};function E(e){return new TextEncoder().encode(e).length;}function N(e,t){if(t<=0)return{text:"",truncated:e.length>0};let n=0,a=0;for(let i=0;i<e.length;){var r;let l=null!=(r=e.codePointAt(i))?r:0,s=l>65535?2:1,o=l<=127?1:l<=2047?2:l<=65535?3:4;if(n+o>t)return{text:e.slice(0,a),truncated:!0};n+=o,a=i+s,i+=s;}return{text:e,truncated:!1};}function L(e,t){return e.filter(e=>e.status===t).length;}let M={canApply:!1,canReject:!0,canRunVerification:!1},A={typescript:"TypeScript",javascript:"JavaScript",json:"JSON",css:"CSS",scss:"SCSS",less:"Less",html:"HTML",markdown:"Markdown",yaml:"YAML",python:"Python",java:"Java",go:"Go",rust:"Rust",sql:"SQL",shell:"Shell",plaintext:"Plain Text"};function O(e,t){return`${String(e)} ${t}${1===e?"":"s"}`;}function P(e,t){null!==t&&e.push(t);}function V(e,t){return e.filter(e=>e.live&&e.assertive===t).map(e=>e.ariaLabel).join(". ");}let D={default:"",accent:"ed-sb-accent",warn:"ed-sb-warn",error:"ed-sb-error"};function K(e){let{viewModel:t}=e;return(0,a.jsxs)("div",{className:"ed-statusbar",role:"group","aria-label":"Editor status","data-testid":"editor-status-bar",children:[t.fields.map(e=>{let t=D[e.tone];return(0,a.jsx)("span",{className:t.length>0?`ed-sb-field ${t}`:"ed-sb-field","data-field":e.id,"aria-label":e.ariaLabel,title:e.ariaLabel,children:e.label},e.id);}),(0,a.jsx)("span",{className:"ed-sb-live",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":"editor-status-bar-live",children:t.liveSummary}),(0,a.jsx)("span",{className:"ed-sb-live",role:"alert","aria-live":"assertive","aria-atomic":"true","data-testid":"editor-status-bar-alert",children:t.alertSummary})]});}var F=n(73599);let z=/^[0-9a-f]{64}$/u,G={text:"text",method:"method",function:"function",constructor:"constructor",field:"field",variable:"variable",class:"class",interface:"interface",module:"module",property:"property",value:"variable",enum:"interface",keyword:"keyword",snippet:"snippet",constant:"variable",struct:"class",typeParameter:"variable"},H=/^[0-9a-f]{64}$/u,U="Test generation could not be completed. The editor is still usable.";function Q(e){var t;return{range:{start:{line:(t=e.range).start.line,column:t.start.character},end:{line:t.end.line,column:t.end.character}},newText:e.newText};}function _(e){return{uri:e.path,edits:e.edits.map(Q),isNewFile:"added"===e.changeKind,isDeletion:"deleted"===e.changeKind};}function J(e){return{executionEnabled:e.executionEnabled,candidatesGenerated:e.candidatesGenerated,candidatesSurfaced:e.candidatesSurfaced,stabilityRunsRequired:e.stabilityRunsRequired,build:e.build,pass:e.pass,stability:e.stability,coverage:e.coverage,mutation:e.mutation,antiTautology:e.antiTautology,...(void 0===e.coverageLineDelta?{}:{coverageLineDelta:e.coverageLineDelta}),...(void 0===e.coverageBranchDelta?{}:{coverageBranchDelta:e.coverageBranchDelta}),...(void 0===e.mutantsKilled?{}:{mutantsKilled:e.mutantsKilled}),...(void 0===e.mutantsTotal?{}:{mutantsTotal:e.mutantsTotal})};}function X(e,t){if(void 0===t.context)return;let n=t.context.entries.map(e=>({sourceKind:e.sourceKind,id:e.id,score:e.score,rank:e.rank,...(void 0===e.citationRef?{}:{citationRef:e.citationRef}),byteCount:e.byteCount,truncated:e.truncated})),a=t.context.omissions.map(e=>({sourceKind:e.sourceKind,reason:e.reason}));return{request:e,entries:n,usedBytes:t.context.usedBytes,budgetBytes:t.context.budgetBytes,droppedForBudget:t.context.droppedForBudget,omissions:a};}function Y(e){return{start:{line:e.start.line,column:e.start.character},end:{line:e.end.line,column:e.end.character}};}function Z(e){return{range:Y(e.range),severity:e.severity,message:e.message,source:e.source,...(void 0===e.code?{}:{code:e.code})};}function W(e){return{name:e.name,kind:e.kind,range:Y(e.range),...(void 0===e.detail?{}:{detail:e.detail}),...(void 0===e.containerName?{}:{containerName:e.containerName})};}function ee(e){return{range:Y(e.range),newText:e.newText};}var et=n(4503),en=n(75571),ea=n(55176);let er="snapshots";function ei(e,t){return`${e}\u0000${t}`;}function el(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>{var t;return n(null!=(t=e.error)?t:Error("IndexedDB request failed."));};});}function es(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onerror=()=>{var t;return n(null!=(t=e.error)?t:Error("IndexedDB transaction failed."));},e.onabort=()=>{var t;return n(null!=(t=e.error)?t:Error("IndexedDB transaction aborted."));};});}async function eo(){return"u"<typeof indexedDB?null:new Promise((e,t)=>{let n=indexedDB.open("keiko-editor-hot-exit",1);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(er)||e.createObjectStore(er);},n.onsuccess=()=>e(n.result),n.onerror=()=>{var e;return t(null!=(e=n.error)?e:Error("IndexedDB open failed."));};}).catch(()=>null);}function ed(e){return new TextEncoder().encode(JSON.stringify(e)).length;}async function eu(e){let t=e.transaction(er,"readonly"),n=await el(t.objectStore(er).getAll());return await es(t),n.filter(x);}async function ec(e,t){let n=await eu(e),a=n.filter(e=>w(e,t));if(a.length>0){let t=e.transaction(er,"readwrite");for(let e of a)t.objectStore(er).delete(ei(e.workspaceRoot,e.relativePath));await es(t);}let r=n.filter(e=>!w(e,t)).sort((e,t)=>e.updatedAt-t.updatedAt),i=r.reduce((e,t)=>e+ed(t),0);if(i<=8388608)return;let l=e.transaction(er,"readwrite");for(let e of r){if(i<=8388608)break;l.objectStore(er).delete(ei(e.workspaceRoot,e.relativePath)),i-=ed(e);}await es(l);}async function ev(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=await eo();if(null===a)return null;try{let r=a.transaction(er,"readonly"),i=await el(r.objectStore(er).get(ei(e,t)));if(await es(r),!x(i)||w(i,n))return null;return i;}finally{a.close();}}async function eg(e){if(1!==e.schemaVersion)return;let t=await eo();if(null!==t)try{await ec(t,e.updatedAt);let n=t.transaction(er,"readwrite");n.objectStore(er).put(e,ei(e.workspaceRoot,e.relativePath)),await es(n);}finally{t.close();}}async function ef(e,t){let n=await eo();if(null!==n)try{let a=n.transaction(er,"readwrite");a.objectStore(er).delete(ei(e,t)),await es(a);}finally{n.close();}}let ep=(0,r.default)(()=>Promise.all([n.e(651),n.e(5957),n.e(6218),n.e(8363),n.e(2107),n.e(3170),n.e(3868),n.e(8776)]).then(n.bind(n,48776)),{loadableGenerated:{webpack:()=>[48776]},ssr:!1,loading:()=>(0,a.jsx)("div",{className:"ed-host-loading","aria-hidden":"true"})}),em=(0,r.default)(()=>Promise.all([n.e(651),n.e(5957),n.e(6218),n.e(8363),n.e(2107),n.e(3170),n.e(3868),n.e(7573)]).then(n.bind(n,17573)),{loadableGenerated:{webpack:()=>[17573]},ssr:!1,loading:()=>(0,a.jsx)("div",{className:"ed-host-loading","aria-hidden":"true"})}),eh={schemaVersion:"1",providers:[{id:"typescript",languages:["typescript","typescriptreact","javascript","javascriptreact"],operations:["diagnostics","completion","hover","symbols","formatting"],availability:"available"}]};function eb(e){return e instanceof F.hD||e instanceof Error?e.message:"The file could not be loaded.";}function ey(e){let t=e.replace(/[^A-Za-z0-9_-]/gu,"-");return t.length>0?t:"editor";}function ex(e){let t=0x811c9dc5;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,0x1000193)>>>0;return t.toString(16).padStart(8,"0");}function ew(e,t){return`keiko-editor://workspace/${ex(e)}/${t.split(/[\\/]+/).map(encodeURIComponent).join("/")}`;}function eS(e,t){return`${e}\u0000${t}`;}async function eC(e){let t=globalThis.crypto;if((null==t?void 0:t.subtle)!==void 0)return[...new Uint8Array(await t.subtle.digest("SHA-256",new TextEncoder().encode(e)))].map(e=>e.toString(16).padStart(2,"0")).join("");let n=0x811c9dc5;for(let t=0;t<e.length;t+=1)n^=e.charCodeAt(t),n=Math.imul(n,0x1000193)>>>0;return n.toString(16).padStart(8,"0").repeat(8).slice(0,64);}function ek(e){var t,n,a,r,i,l;let s,o={},d=(a=e.text,r=e.line,i=e.character,(s=(null!=(l=a.split("\n")[r])?l:"").slice(0,Math.max(0,i)).replace(/[^A-Za-z0-9_.$/-]+/g," ").trim().slice(-160).trim()).length>0?s:void 0);void 0!==d&&(o.queryText=d),e.linkedRoot===e.root&&void 0!==e.linkedFilePath&&e.linkedFilePath.length>0&&e.linkedFilePath!==e.file&&(o.changedFiles=[e.linkedFilePath]);let u=null==(t=e.linkedCapsuleIds)?void 0:t[0],c=null==(n=e.linkedCapsuleSetIds)?void 0:n[0];return void 0!==u?o.capsuleId=u:void 0!==c&&(o.capsuleSetId=c),Object.keys(o).length>0?o:void 0;}function eq(e,t){var n;return null===e||void 0===t?null:null!=(n=e.providers.find(e=>e.languages.includes(t)))?n:null;}function ej(e,t){return null!==e&&"available"===e.availability&&e.operations.includes(t);}function eT(e){var t,n,r,f,p,m,h;let b,y,{windowId:x,paneId:w,activePaneId:T,layoutPanes:$,root:D,file:Q,revealLineStart:er,revealLineEnd:ei,revealRequestId:el,openFiles:es,dirtyFiles:eo,onSelectOpenFile:ed,onCloseOpenFile:eu,onDirtyChange:ec,externalSaveRequest:eT,onExternalSaveComplete:eI,renderTabHandle:e$,toolbarExtras:eR,linkedRoot:eB,linkedFilePath:eE,linkedCapsuleIds:eN,linkedCapsuleSetIds:eL}=e,eM=void 0!==D&&D.length>0&&void 0!==Q&&Q.length>0,eA=(0,i.useId)(),eO=(0,i.useMemo)(()=>`ed-${ey(null!=x?x:eA)}`,[eA,x]),eP=`${eO}-active-tab`,eV=`${eO}-tabpanel`,eD=(0,i.useMemo)(()=>{let e=[];for(let t of null!=es?es:[])t.length>0&&!e.includes(t)&&e.push(t);return void 0!==Q&&Q.length>0&&!e.includes(Q)&&e.push(Q),e;},[Q,es]),[eK,eF]=(0,i.useState)(""),[ez,eG]=(0,i.useState)(null),[eH,eU]=(0,i.useState)(null),[eQ,e_]=(0,i.useState)(null),[eJ,eX]=(0,i.useState)(null),[eY,eZ]=(0,i.useState)(eM?{status:"loading"}:{status:"ready"}),[eW,e0]=(0,i.useState)("idle"),[e1,e8]=(0,i.useState)(void 0),[e5,e6]=(0,i.useState)(0),[e7,e2]=(0,i.useReducer)(d,o),e3=(0,i.useRef)(0),e4=(0,i.useRef)(null),[e9,te]=(0,i.useState)(null),[tt,tn]=(0,i.useState)(null),[ta,tr]=(0,i.useState)(null),[ti,tl]=(0,i.useState)(eh),[ts,to]=(0,i.useState)(null),[td,tu]=(0,i.useState)(null),[tc,tv]=(0,i.useState)(null),tg=(0,i.useRef)(new Map()),tf=(0,i.useRef)(null);tf.current=void 0!==D&&void 0!==Q&&D.length>0&&Q.length>0?eS(D,Q):null;let tp=(0,i.useRef)(null);tp.current=eQ;let tm=(0,i.useRef)(!1);tm.current="saving"===eW;let th=(0,i.useRef)("");th.current=eK,(0,i.useEffect)(()=>{te(null),tn(null),tr(null),tu(null);},[Q,D]),(0,i.useEffect)(()=>{let e=!1;return eC(eK).then(t=>{e||tv(t);}),()=>{e=!0;};},[eK]),(0,i.useEffect)(()=>{let e=!1;return(0,F.Um)().then(t=>{e||tl(t);}).catch(()=>{}),()=>{e=!0;};},[]),(0,i.useEffect)(()=>()=>{var e;null==(e=e4.current)||e.abort();},[]);let tb=eM&&void 0!==D&&void 0!==Q?ew(D,Q):null,ty=null!==ez&&null!==tb&&ez.identity.uri===tb,tx=ty&&(0,g.IB)(ez),tw=(0,i.useRef)(!1);tw.current=tx,(0,i.useEffect)(()=>{void 0!==Q&&0!==Q.length&&(null==ec||ec(Q,tx));},[tx,Q,ec]),(0,i.useEffect)(()=>{if(!eM||void 0===D||void 0===Q||!ty)return;if(!tx)return void ef(D,Q);let e=new TextEncoder().encode(eK).length;if(null!==eJ&&e>eJ)return;let t=!1;return eC(eK).then(e=>{var n;t||eg({schemaVersion:1,workspaceRoot:D,relativePath:Q,content:eK,baseVersion:eQ,contentHash:e,savedContentHash:null!=(n=null==eQ?void 0:eQ.contentHash)?n:null,updatedAt:Date.now(),paneId:null!=w?w:"pane-1",windowId:null!=x?x:"editor"});}),()=>{t=!0;};},[eK,tx,Q,ty,eM,eJ,w,D,eQ,x]),(0,i.useEffect)(()=>{eM&&void 0!==D&&void 0!==Q&&0!==D.length&&0!==Q.length&&ty&&tg.current.set(eS(D,Q),{content:eK,fileModel:ez,modifiedAt:eH,version:eQ,maxBytes:eJ,loadState:eY,saveStatus:eW,saveError:e1,cursor:tt,currentSelection:e9,diagnosticsSummary:ta});},[eK,e9,tt,ta,Q,ez,ty,eM,eY,eJ,eH,D,e1,eW,eQ]);let tS=function(){let[e,t]=(0,i.useState)("dark");return(0,i.useEffect)(()=>{let e=()=>{t(function(){if("u"<typeof document)return"dark";let e="light"===document.documentElement.dataset.theme?"light":"dark";return"function"==typeof window.matchMedia&&(window.matchMedia("(prefers-contrast: more)").matches||window.matchMedia("(forced-colors: active)").matches)&&"dark"===e?"high-contrast":e;}());};e();let n=new MutationObserver(e);n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});let a=window.matchMedia("(prefers-contrast: more)"),r=window.matchMedia("(forced-colors: active)");return a.addEventListener("change",e),r.addEventListener("change",e),()=>{n.disconnect(),a.removeEventListener("change",e),r.removeEventListener("change",e);};},[]),e;}(),tC=(0,i.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!eM){eF(""),eG(null),eU(null),e_(null),eX(null),eZ({status:"ready"}),e0("idle"),e8(void 0);return;}let n=eS(D,Q),a=!0===t.bypassCache?void 0:tg.current.get(n);if(void 0!==a){eF(a.content),eG(a.fileModel),eU(a.modifiedAt),e_(a.version),eX(a.maxBytes),eZ(a.loadState),e0(a.saveStatus),e8(a.saveError),tn(a.cursor),te(a.currentSelection),tr(a.diagnosticsSummary);return;}eZ({status:"loading"}),e0("idle"),e8(void 0),(0,F.z4)(D,Q).then(async t=>{let n;if(e.cancelled)return;let a={uri:ew(D,Q),language:(n=(0,l.PK)(Q),s.includes(n))?n:"plaintext",version:0},r=await ev(D,Q);e.cancelled||(eF(t.content),eG((0,g.kv)(a)),eU(t.modifiedAt),e_(t.session.version),eX(t.maxBytes),eZ({status:"ready"}),null!==r&&r.content!==t.content&&r.contentHash!==t.session.version.contentHash?to(r):to(null));}).catch(t=>{e.cancelled||eZ({status:"error",message:eb(t)});});},[eM,D,Q]);(0,i.useEffect)(()=>{let e={cancelled:!1};return tC(e),()=>{e.cancelled=!0;};},[tC]);let tk=(0,i.useCallback)(()=>{tC({cancelled:!1},{bypassCache:!0});},[tC]),tq=(0,i.useCallback)(async e=>{var t,n,a,r,i,l,s,o,d,u,c,v,f,p,m,h;if(!eM||tm.current)return!1;let b=eS(D,Q),y=e!==th.current;if(!tw.current&&!y)return!0;y&&(th.current=e,eF(e),eG(e=>null===e?e:(0,g.V8)(e,{type:"edited",origin:"human"}))),tm.current=!0,e0(e=>(0,S.Q0)(e,{type:"request"})),e8(void 0);try{let o=await(0,F.iS)({root:D,path:Q,content:e,baseVersion:null!=(t=tp.current)?t:void 0});if(tf.current!==b){let t=tg.current.get(b),d=null!=(n=null==t?void 0:t.content)?n:e,u=null!=(a=null==t?void 0:t.fileModel)?a:null;return tg.current.set(b,{content:d===e?o.content:d,fileModel:null===u?u:(0,g.V8)(u,{type:d===e?"saved":"edited",origin:"human"}),modifiedAt:o.modifiedAt,version:o.session.version,maxBytes:o.maxBytes,loadState:null!=(r=null==t?void 0:t.loadState)?r:{status:"ready"},saveStatus:d===e?"saved":"idle",saveError:void 0,cursor:null!=(i=null==t?void 0:t.cursor)?i:null,currentSelection:null!=(l=null==t?void 0:t.currentSelection)?l:null,diagnosticsSummary:null!=(s=null==t?void 0:t.diagnosticsSummary)?s:null}),await ef(D,Q),!0;}return eU(o.modifiedAt),e_(o.session.version),eX(o.maxBytes),th.current===e?(eF(o.content),eG(e=>null===e?e:(0,g.V8)(e,{type:"saved"})),e0(e=>(0,S.Q0)(e,{type:"succeeded"}))):e0(e=>(0,S.Q0)((0,S.Q0)(e,{type:"succeeded"}),{type:"edited"})),await ef(D,Q),!0;}catch(t){if(tf.current!==b){let n=tg.current.get(b);return tg.current.set(b,{content:null!=(o=null==n?void 0:n.content)?o:e,fileModel:null!=(d=null==n?void 0:n.fileModel)?d:ez,modifiedAt:null!=(u=null==n?void 0:n.modifiedAt)?u:eH,version:null!=(c=null==n?void 0:n.version)?c:tp.current,maxBytes:null!=(v=null==n?void 0:n.maxBytes)?v:eJ,loadState:null!=(f=null==n?void 0:n.loadState)?f:{status:"ready"},saveStatus:t instanceof F.hD&&409===t.status?"conflict":"error",saveError:t instanceof F.hD&&409===t.status?void 0:eb(t),cursor:null!=(p=null==n?void 0:n.cursor)?p:null,currentSelection:null!=(m=null==n?void 0:n.currentSelection)?m:null,diagnosticsSummary:null!=(h=null==n?void 0:n.diagnosticsSummary)?h:null}),!1;}return t instanceof F.hD&&409===t.status?e0(e=>(0,S.Q0)(e,{type:"conflicted"})):(e8(eb(t)),e0(e=>(0,S.Q0)(e,{type:"failed"}))),!1;}finally{tm.current=!1;}},[Q,ez,eM,eJ,eH,D]),tj=(0,i.useCallback)((e,t)=>{eF(e.text),eG(e=>null===e?e:(0,g.V8)(e,{type:"edited",origin:"human"})),e0(e=>(0,S.Q0)(e,{type:"edited"}));},[]),tT=(0,i.useCallback)(e=>{tq(e.content.text);},[tq]),tI=(0,i.useRef)(null);(0,i.useEffect)(()=>{void 0!==eT&&tI.current!==eT.id&&Q===eT.file&&(tI.current=eT.id,tq(th.current).then(e=>{null==eI||eI(eT.id,eT.paneId,eT.file,e);}));},[eT,Q,eI,tq]);let t$=(0,i.useCallback)(e=>{console.warn(`Keiko editor runtime notice: ${e}`);},[]),tR=(0,i.useCallback)(()=>{null!==ts&&null!==ez&&(eF(ts.content),eG((0,g.V8)(ez,{type:"edited",origin:"human"})),e0(e=>(0,S.Q0)(e,{type:"edited"})),to(null),tu(null));},[ez,ts]),tB=(0,i.useCallback)(()=>{void 0!==D&&void 0!==Q&&ef(D,Q),to(null),tu(null);},[Q,D]),tE=(0,i.useCallback)(()=>{tu("Recovery content differs from disk. Keep local to restore it, or use disk.");},[]),tN=(0,i.useCallback)(async(e,t)=>{var n,a;if(!eM||void 0===D||void 0===Q)return{request:e.request.request,items:[],isIncomplete:!1,provenance:{sources:[],modelMode:"deterministic"}};let r=await(0,F.rX)({root:D,path:Q,languageId:e.request.document.language,text:e.documentText,position:{line:e.request.position.line,character:e.request.position.column},triggerKind:e.request.triggerKind,...(void 0===e.request.triggerCharacter?{}:{triggerCharacter:e.request.triggerCharacter}),contextBudgetBytes:e.request.contextBudgetBytes,context:ek({root:D,file:Q,text:e.documentText,line:e.request.position.line,character:e.request.position.column,linkedRoot:eB,linkedFilePath:eE,linkedCapsuleIds:eN,linkedCapsuleSetIds:eL})},t);return n=e.request.request,a=Date.now(),{request:n,items:r.items.map(e=>{let t;return null===(t=function(e,t,n){if("deterministic"===t)return{origin:"deterministic-completion"};let{modelId:a,gatewayPolicyVersion:r,promptHash:i}=e.provenance;return void 0!==a&&0!==a.length&&void 0!==r&&0!==r.length&&void 0!==i&&z.test(i)?{origin:"ai-completion",model:{modelId:a,gatewayPolicyVersion:r,promptHash:i,producedAt:n}}:null;}(r,e.origin,a))?null:{label:e.label,kind:G[e.kind],insertText:e.insertText,provenance:t,...(void 0===e.detail?{}:{detail:e.detail}),...(void 0===e.sortText?{}:{sortText:e.sortText})};}).filter(e=>null!==e),isIncomplete:r.isIncomplete,provenance:{sources:r.provenance.sources,modelMode:r.provenance.modelMode,...(void 0===r.provenance.degradeReason?{}:{degradeReason:r.provenance.degradeReason})}};},[Q,eM,eN,eL,eE,eB,D]),tL=(0,i.useCallback)(async(e,t)=>{var n,a,r;if(!eM||void 0===D||void 0===Q)return{request:e.request.request,items:[]};let i=await(0,F.YT)({root:D,path:Q,languageId:e.request.document.language,text:e.documentText,position:{line:e.request.position.line,character:e.request.position.column},triggerKind:e.request.triggerKind,contextBudgetBytes:e.request.contextBudgetBytes,context:ek({root:D,file:Q,text:e.documentText,line:e.request.position.line,character:e.request.position.column,linkedRoot:eB,linkedFilePath:eE,linkedCapsuleIds:eN,linkedCapsuleSetIds:eL})},t);return n=e.request.request,a=e.request.position,r=Date.now(),{request:n,items:i.items.map(e=>{let t;return null===(t=function(e,t){let{modelId:n,gatewayPolicyVersion:a,promptHash:r}=e.provenance;return void 0!==n&&0!==n.length&&void 0!==a&&0!==a.length&&void 0!==r&&H.test(r)?{origin:"ai-inline-completion",model:{modelId:n,gatewayPolicyVersion:a,promptHash:r,producedAt:t}}:null;}(i,r))?null:{insertText:e.insertText,range:function(e,t){if(void 0===e.range)return{start:t,end:t};return{start:{line:e.range.start.line,column:e.range.start.character},end:{line:e.range.end.line,column:e.range.end.character}};}(e,a),provenance:t};}).filter(e=>null!==e),provenance:{sources:i.provenance.sources,modelMode:i.provenance.modelMode,...(void 0===i.provenance.degradeReason?{}:{degradeReason:i.provenance.degradeReason})}};},[Q,eM,eN,eL,eE,eB,D]),tM=(0,i.useCallback)(e=>{eM&&void 0!==D&&(0,F.mU)({root:D,...e}).catch(()=>{});},[eM,D]),tA=(0,i.useCallback)(()=>{var e;null==(e=e4.current)||e.abort(),e4.current=null,e2({type:"cancel"});},[]),tO=(0,i.useCallback)(()=>{var e;if(!eM||void 0===D||void 0===Q||null===ez||"ready"!==eY.status||u(e7)||!ej(eq(ti,ez.identity.language),"completion"))return;null==(e=e4.current)||e.abort();let t=new AbortController();e4.current=t;let n=e3.current+=1,a={requestId:(0,C.sV)(),streamId:"editor-test-generation",sequence:n},r={path:Q,languageId:ez.identity.language,text:th.current},i=null===e9?{kind:"file",document:r}:{kind:"selection",document:r,range:{start:{line:e9.start.line,character:e9.start.column},end:{line:e9.end.line,character:e9.end.column}}},l=ek({root:D,file:Q,text:th.current,line:0,character:0,linkedRoot:eB,linkedFilePath:eE,linkedCapsuleIds:eN,linkedCapsuleSetIds:eL});e2({type:"request",requestId:a.requestId}),(0,F.jv)({root:D,target:i,contextBudgetBytes:65536,...(void 0===l?{}:{context:l})},t.signal).then(e=>{e2({type:"resolve",outcome:function(e,t){var n,a,r;if("disabled"===t.status)return{status:"disabled",request:e,reason:null!=(n=t.reason)?n:"Editor-driven test generation is disabled in this build."};if("failed"===t.status)return{status:"failed",request:e,reason:null!=(a=t.reason)?a:U};if("deferred"===t.status){let n=X(e,t);return{status:"deferred",request:e,reason:null!=(r=t.reason)?r:U,funnel:J(t.funnel),...(void 0===n?{}:{context:n})};}return function(e,t){var n,a,r,i;if(void 0===t.patch||void 0===t.provenance)return{status:"failed",request:e,reason:null!=(a=t.reason)?a:U};let l={origin:"generated-test",model:{modelId:(r=t.provenance).modelId,gatewayPolicyVersion:r.gatewayPolicyVersion,promptHash:r.promptHash,producedAt:r.producedAt}},s={request:e,patch:(i=t.patch,{patchId:i.patchId,changes:i.files.map(_),status:"previewed",provenance:l}),provenance:l},o=null!=(n=t.assurance)?n:"unverified",d=X(e,t);return{status:"generated",request:e,result:s,funnel:J(t.funnel),assurance:o,...("unverified"===o&&void 0!==t.reason?{reason:t.reason}:{}),...(void 0===d?{}:{context:d})};}(e,t);}(a,e)});}).catch(()=>{t.signal.aborted?e2({type:"cancel"}):e2({type:"error",reason:"Test generation could not be reached. The editor is still usable."});}).finally(()=>{e4.current===t&&(e4.current=null);});},[e9,Q,ez,eM,ti,eN,eL,eE,eB,eY.status,D,e7]),tP=(0,i.useCallback)(async(e,t)=>{if(!eM||void 0===D||void 0===Q)return{request:e.request.request,diagnostics:[]};let n=await(0,F.rp)({root:D,path:Q,languageId:e.request.document.language,text:e.documentText},t);return{request:e.request.request,diagnostics:n.diagnostics.map(Z)};},[Q,eM,D]),tV=(0,i.useCallback)(async(e,t)=>{if(!eM||void 0===D||void 0===Q)return{request:e.request.request,hover:{contents:null}};let n=await(0,F.pp)({root:D,path:Q,languageId:e.request.document.language,text:e.documentText,position:{line:e.request.position.line,character:e.request.position.column}},t);return{request:e.request.request,hover:{contents:n.contents,...(void 0===n.range?{}:{range:Y(n.range)})}};},[Q,eM,D]),tD=(0,i.useCallback)(async(e,t)=>{if(!eM||void 0===D||void 0===Q)return{request:e.request.request,symbols:[]};let n=await(0,F._A)({root:D,path:Q,languageId:e.request.document.language,text:e.documentText},t);return{request:e.request.request,symbols:n.symbols.map(W)};},[Q,eM,D]),tK=(0,i.useCallback)(async(e,t)=>{if(!eM||void 0===D||void 0===Q)return{request:e.request.request,edits:[]};let n=await(0,F.y0)({root:D,path:Q,languageId:e.request.document.language,text:e.documentText,options:{tabSize:e.request.options.tabSize,insertSpaces:e.request.options.insertSpaces}},t);return{request:e.request.request,edits:n.edits.map(ee)};},[Q,eM,D]),tF=(0,i.useMemo)(()=>new TextEncoder().encode(eK).length,[eK]),tz=(0,i.useMemo)(()=>(0,k.Ou)({sizeBytes:tF,text:eK}),[eK,tF]),tG="degraded"===tz,tH=eq(ti,null==ez?void 0:ez.identity.language),tU=ej(tH,"completion")&&!tG,tQ=ej(tH,"diagnostics")&&!tG,t_=ej(tH,"hover")&&!tG,tJ=ej(tH,"symbols")&&!tG,tX=ej(tH,"formatting")&&!tG,tY=`${null!=tS?tS:"dark"}:${null!=(t=null==tH?void 0:tH.id)?t:"none"}:${tz}`,tZ=eM&&tx&&"saving"!==eW&&"ready"===eY.status,tW=eM&&"ready"===eY.status&&tX,t0=u(e7),t1=eM&&tU&&"ready"===eY.status&&!t0,t8=function(e){if("disabled"===e.kind||"deferred"===e.kind||"failed"===e.kind)return e.reason;if("preview"===e.kind){var t;let n,a,r,i=(n=[v("lines",(t=e.funnel).coverageLineDelta),v("branches",t.coverageBranchDelta)].filter(e=>void 0!==e).join(", "),a=void 0===t.mutantsKilled||void 0===t.mutantsTotal?void 0:`mutation ${t.mutantsKilled.toString()}/${t.mutantsTotal.toString()} killed`,r=[n.length>0?`coverage delta ${n}`:void 0,a].filter(e=>void 0!==e).join("; "),`Funnel: ${t.candidatesGenerated.toString()} generated, ${t.candidatesSurfaced.toString()} surfaced; build ${t.build}; pass ${t.pass}; stability ${t.stability} (${t.stabilityRunsRequired.toString()} runs); coverage ${t.coverage}; mutation ${t.mutation}`+(r.length>0?`; ${r}.`:"."));if("assured"===e.assurance)return`Generated tests passed the assured pre-filter (build, pass, stability, coverage, mutation); review before applying. ${i}`;let l=void 0!==e.reason&&e.reason.length>0?e.reason:"Generated tests are not apply-ready: they did not pass the assured pre-filter and are shown as untrusted evidence only.";return`${l} ${i}`;}return c[e.kind];}(e7),t5=(0,i.useMemo)(()=>null!==ez&&ty?{language:ez.identity.language,readOnly:tG,content:{relativePath:null!=Q?Q:"",text:eK,sizeBytes:tF,truncated:!1}}:null,[eK,tF,Q,ez,ty,tG]),t6="preview"===e7.kind&&null!==t5?{model:function(e){var t,n;let a={...B,...e.limits},r=null!=(t=e.sources)?t:{},i=e.patch.changes.length,s={files:[],totalBytes:0};for(let t of e.patch.changes){if(s.files.length>=a.maxFiles)break;let e=function(e,t,n){var a,r;let i=null!=(a=null==t?void 0:t.content.relativePath)?a:e.uri,s=function(e,t,n){var a;if((null==(a=t)?void 0:a.binary)===!0||void 0!==a&&a.content.text.includes("\0"))return{status:"binary",original:"",modified:"",originalTruncated:!1,modifiedTruncated:!1,note:"Binary file — preview unavailable."};if(e.isDeletion){if(void 0===t)return{status:"deleted",diffable:!1,original:"",modified:"",originalTruncated:!1,modifiedTruncated:!1,note:"Original content unavailable — deleted-file preview cannot be rendered."};if(t.content.truncated)return{status:"deleted",diffable:!1,original:"",modified:"",originalTruncated:!1,modifiedTruncated:!1,note:"Original file is truncated — deleted-file preview unavailable."};let e=N(t.content.text,n);return{status:"deleted",original:e.text,modified:"",originalTruncated:e.truncated,modifiedTruncated:!1};}if(e.isNewFile){let t=R("",e.edits,n);return{status:"created",original:"",modified:t.text,originalTruncated:!1,modifiedTruncated:t.truncated};}if(void 0===t)return{status:"unsupported",original:"",modified:"",originalTruncated:!1,modifiedTruncated:!1,note:"Original content unavailable — preview cannot be rendered."};if(t.content.truncated)return{status:"unsupported",original:"",modified:"",originalTruncated:!1,modifiedTruncated:!1,note:"Original file is truncated — diff preview unavailable."};let r=t.content.text;try{let t=N(r,n),a=R(r,e.edits,n);return{status:"modified",original:t.text,modified:a.text,originalTruncated:t.truncated,modifiedTruncated:a.truncated};}catch(e){if(e instanceof q)return{status:"unsupported",original:"",modified:"",originalTruncated:!1,modifiedTruncated:!1,note:"Patch edits could not be applied to the original — preview unavailable."};throw e;}}(e,t,n),o=null!=(r=s.diffable)?r:"binary"!==s.status&&"unsupported"!==s.status,d=s.originalTruncated||s.modifiedTruncated,u=d?[s.note,"Content truncated to the display limit."].filter(Boolean).join(" "):s.note;return{uri:e.uri,displayPath:i,status:s.status,diffable:o,original:s.original,modified:s.modified,language:(0,l.PK)(i),hasChanges:o&&s.original!==s.modified,truncated:d,note:void 0===u||""===u?void 0:u};}(t,Object.hasOwn(r,n=t.uri)?r[n]:void 0,a.maxBytesPerFile);if(!function(e,t,n){let a=E(t.original)+E(t.modified);return(!(e.files.length>0)||!(e.totalBytes+a>n))&&(e.totalBytes+=a,!0);}(s,e,a.maxTotalBytes))break;s.files.push(e);}let o=i-s.files.length;return{patchId:e.patch.patchId,status:e.patch.status,provenance:e.patch.provenance,verification:e.patch.verification,files:s.files,fileCount:s.files.length,totalFileCount:i,omittedFileCount:o,createdCount:L(s.files,"created"),modifiedCount:L(s.files,"modified"),deletedCount:L(s.files,"deleted"),binaryCount:L(s.files,"binary"),unsupportedCount:L(s.files,"unsupported"),truncated:o>0||s.files.some(e=>e.truncated)};}({patch:(n={result:e7.result,assurance:e7.assurance,sources:{[t5.content.relativePath]:{content:t5.content}}}).result.patch,...(void 0===n.sources?{}:{sources:n.sources}),...(void 0===n.limits?{}:{limits:n.limits})}),actions:M,assurance:n.assurance}:null,t7=null===e9?void 0:e9.end.line-e9.start.line+1,t2=t8.length>0?{label:t8,busy:t0}:void 0,t3=null===ez?null:(r={languageId:ez.identity.language,cursor:tt,...(void 0===t7?{}:{selectedLineCount:t7}),saveStatus:eW,dirty:tx,completionsEnabled:tU,largeFileMode:tz,diagnostics:tQ?ta:null,languageService:null===tH?{providerId:null,available:!1,unavailableReason:"No provider configured"}:{providerId:tH.id,available:"available"===tH.availability,unavailableReason:tH.unavailableReason},readOnly:tG,...(void 0===t2?{}:{run:t2})},(b=[]).push({id:"language",label:A[h=r.languageId],ariaLabel:`Language: ${A[h]}`,tone:"default",live:!1,assertive:!1}),P(b,!0!==r.readOnly?null:{id:"readonly",label:"Read-only",ariaLabel:"Read-only document",tone:"warn",live:!0,assertive:!1}),b.push({id:"completions",label:(f=r.completionsEnabled)?"Completions on":"Completions off",ariaLabel:f?"Governed completions enabled":"Governed completions unavailable for this file type",tone:"default",live:!1,assertive:!1}),P(b,"degraded"!==r.largeFileMode?null:{id:"large-file",label:"Large file mode",ariaLabel:"Large file mode: completions and analysis disabled",tone:"warn",live:!0,assertive:!1}),P(b,function(e){if(null===e)return null;let{errors:t,warnings:n,infos:a}=e;if(0===t&&0===n&&0===a)return{id:"problems",label:"No problems",ariaLabel:"No problems",tone:"default",live:!0,assertive:!1};let r=t>0?"error":n>0?"warn":"default",i=[];t>0&&i.push(O(t,"error")),n>0&&i.push(O(n,"warning")),a>0&&i.push(O(a,"info"));let l=`Problems: ${i.join(", ")}`;return{id:"problems",label:`${String(t)} ⚠ ${String(n)}`,ariaLabel:l,tone:r,live:!0,assertive:!1};}(r.diagnostics)),P(b,void 0===(p=r.languageService)?null:p.available?{id:"language-service",label:null===p.providerId?"Language ready":`${p.providerId} ready`,ariaLabel:null===p.providerId?"Language provider available":`Language provider available: ${p.providerId}`,tone:"default",live:!1,assertive:!1}:{id:"language-service",label:"LSP unavailable",ariaLabel:void 0===p.unavailableReason?"Language provider unavailable":`Language provider unavailable: ${p.unavailableReason}`,tone:"warn",live:!1,assertive:!1}),P(b,void 0===(m=r.run)?null:{id:"run",label:m.label,ariaLabel:m.label,tone:m.busy?"accent":"default",live:!0,assertive:!1}),b.push(function(e){if(null===e)return{id:"cursor",label:"Ln —, Col —",ariaLabel:"Cursor position unavailable",tone:"default",live:!1,assertive:!1};let t=e.line+1,n=e.column+1;return{id:"cursor",label:`Ln ${String(t)}, Col ${String(n)}`,ariaLabel:`Line ${String(t)}, column ${String(n)}`,tone:"default",live:!1,assertive:!1};}(r.cursor)),P(b,function(e){if(void 0===e||e<=1)return null;let t=`${String(e)} lines selected`;return{id:"selection",label:t,ariaLabel:t,tone:"default",live:!1,assertive:!1};}(r.selectedLineCount)),b.push(function(e){let t={id:"save",live:!0};switch(e.saveStatus){case"saving":return{...t,label:"Saving…",ariaLabel:"Saving",tone:"accent",assertive:!1};case"error":return{...t,label:"Save failed",ariaLabel:"Save failed",tone:"error",assertive:!0};case"conflict":return{...t,label:"Conflict",ariaLabel:"Save conflict: the file changed elsewhere",tone:"warn",assertive:!0};}return e.dirty?{...t,label:"Unsaved",ariaLabel:"Unsaved changes",tone:"accent",assertive:!1}:{...t,label:"Saved",ariaLabel:"All changes saved",tone:"default",assertive:!1};}(r)),{fields:b,liveSummary:V(b,!1),alertSummary:V(b,!0)}),t4=null===t6&&eM&&"ready"===eY.status&&null!==t5&&null!==ez&&null!==t3,t9=(0,i.useMemo)(()=>{let e=new Set(null!=eo?eo:[]);return void 0!==Q&&tx&&e.add(Q),e;},[tx,eo,Q]),ne=(0,i.useCallback)(e=>{e!==Q&&"saving"!==eW&&(null==ed||ed(e));},[Q,ed,eW]),nt=(0,i.useCallback)(async e=>{if(void 0!==D){let t=tg.current.get(eS(D,e));if(e===Q&&"saving"===eW||(null==t?void 0:t.saveStatus)==="saving")return;}!1!==(await(null==eu?void 0:eu(e)))&&void 0!==D&&tg.current.delete(eS(D,e));},[Q,eu,D,eW]),nn=(0,i.useMemo)(()=>`${ey(null!=x?x:eA)}:${ex(null!=D?D:"")}`,[eA,D,x]);(0,i.useEffect)(()=>{var e;eM&&void 0!==D&&void 0!==Q&&null!==tc&&(0,F.r$)({schemaVersion:et.Vp,sessionId:nn,windowId:null!=x?x:"editor",workspaceRoot:D,activePaneId:null!=(e=null!=T?T:w)?e:null,panes:null!=$?$:[{paneId:null!=w?w:"pane-1",activeFile:Q,openFiles:eD}],dirtyFiles:t9.size>0?[...t9]:[],activeFile:Q,cursor:null===tt?null:{line:tt.line,character:tt.column},selection:null===e9?null:{start:{line:e9.start.line,character:e9.start.column},end:{line:e9.end.line,character:e9.end.column}},diagnosticsSummary:ta,...(null===eQ?{}:{documentVersion:eQ}),activeFileContentHash:tc,textMode:"none",updatedAt:Date.now()}).catch(()=>{});},[T,tc,nn,e9,tt,ta,eD,t9,Q,eM,$,w,D,eQ,x]);let na=(0,i.useCallback)((e,t,n)=>{let a={schemaVersion:et.Vp,kind:"result",result:{schemaVersion:et.Vp,actionId:e.actionId,sessionId:e.sessionId,status:t,...(void 0===n?{}:{message:n})}};(0,F.mG)(a).catch(()=>{});},[]),nr=(0,i.useCallback)(e=>{if(e.sessionId===nn)try{switch(e.type){case"openFile":case"focusTab":var t;if((null==(t=e.target)?void 0:t.file)===void 0)return void na(e,"failed","Missing target file.");null==ed||ed(e.target.file),na(e,"succeeded");return;case"format":if(!tX)return void na(e,"failed","Formatting is unavailable for this language.");e6(e=>e+1),na(e,"succeeded");return;case"save":tq(th.current).then(t=>{na(e,t?"succeeded":"failed",t?void 0:"Save failed.");});return;case"applyTextEdits":if(void 0===e.textEdits)return void na(e,"failed","Missing text edits.");eF(t=>{var n,a;return function(e,t){if(0===t.length)return e;let n=j(e),a=t.map(t=>I(e,n,t)).sort((e,t)=>e.start!==t.start?e.start-t.start:e.end-t.end),r=[],i=0;for(let t of a){if(t.start<i)throw new q("patch contains overlapping edits");r.push(e.slice(i,t.start),t.newText),i=t.end;}return r.push(e.slice(i)),r.join("");}(t,null!=(n=null==(a=e.textEdits)?void 0:a.map(e=>({range:{start:{line:e.range.start.line,column:e.range.start.character},end:{line:e.range.end.line,column:e.range.end.character}},newText:e.newText})))?n:[]);}),eG(e=>null===e?e:(0,g.V8)(e,{type:"edited",origin:"applied-patch"})),e0(e=>(0,S.Q0)(e,{type:"edited"})),na(e,"succeeded");return;case"moveTab":case"splitPane":case"setSelection":case"applyPatch":na(e,"failed","Action must be executed by the editor layout controller.");return;}}catch(t){na(e,"failed",t instanceof Error?t.message:"Action failed.");}},[nn,tX,ed,tq,na]);(0,i.useEffect)(()=>{if("u"<typeof EventSource)return;let e=new EventSource("/api/editor/agent/events"),t=e=>{try{let t=JSON.parse(e.data);void 0!==t.action&&nr(t.action);}catch{}};return e.addEventListener("editor-agent:action",t),()=>{e.removeEventListener("editor-agent:action",t),e.close();};},[nr]);let ni=null!==ts&&null!==ts.savedContentHash&&null!==eQ&&ts.savedContentHash!==eQ.contentHash;return y=null!==t6?(0,a.jsx)(em,{model:t6.model,loadState:{status:"ready"},themeVariant:tS,actions:t6.actions,onReject:()=>{e2({type:"dismiss"});}}):eM&&"error"===eY.status?(0,a.jsxs)("div",{className:"ed-host-loading",role:"alert",children:[(0,a.jsx)("span",{children:`Editor failed to load: ${eY.message}`}),(0,a.jsx)("button",{type:"button",className:"ed-reload",onClick:tk,children:"Retry"})]}):eM&&null!==t5&&null!==ez?(0,a.jsx)(ep,{buffer:t5,fileModel:ez,fileLoadState:eY,saveStatus:eW,saveError:e1,modifiedAt:null!=eH?eH:void 0,maxSizeBytes:null!=eJ?eJ:void 0,themeVariant:tS,ariaLabel:void 0!==D&&void 0!==Q?`Editor: ${Q} in ${D}`:void 0,onContentChange:tj,onSaveRequested:tT,onRuntimeError:t$,provideCompletions:tU?tN:void 0,completionTriggerCharacters:C.x7,provideInlineCompletions:tU?tL:void 0,onInlineCompletionTelemetry:tU?tM:void 0,provideDiagnostics:tQ?tP:void 0,provideHover:t_?tV:void 0,provideSymbols:tJ?tD:void 0,provideFormatting:tX?tK:void 0,formatRequestNonce:e5,onSelectionChange:te,onCursorChange:tn,revealRequest:void 0===er?void 0:{id:null!=el?el:`${null!=Q?Q:"file"}:${String(er)}:${String(null!=ei?ei:er)}`,range:{start:{line:Math.max(0,Math.floor(er)-1),column:0},end:{line:Math.max(Math.max(0,Math.floor(er)-1),Math.floor(null!=ei?ei:er)-1),column:0}}},onDiagnosticsSummary:tQ?tr:void 0,onGenerateTests:tU?tO:void 0,showStatusFooter:!1},tY):eM?(0,a.jsx)("div",{className:"ed-host-loading",role:"status",children:"Loading file…"}):(0,a.jsx)("div",{className:"ed-empty",role:"note",children:"Choose a file from the project tree to start editing."}),(0,a.jsxs)("div",{className:"editor",children:[(0,a.jsxs)("div",{className:"ed-tabs mono",children:[(0,a.jsx)("div",{className:"ed-tablist",role:"tablist","aria-label":"Open documents",children:eD.length>0?eD.map(e=>{let t=e===Q,n=t?eP:`${eO}-tab-${ey(e)}`,r=t9.has(e),i=null==e$?void 0:e$(e,t,r);return(0,a.jsxs)("span",{className:`ed-tab${t?" active":""}`,"data-dirty":r?"true":"false",children:[(0,a.jsxs)("button",{type:"button",className:"ed-tab-hit",draggable:null==i?void 0:i.draggable,role:"tab",id:n,"aria-selected":t?"true":"false","aria-controls":eV,tabIndex:t?0:-1,title:e,onDragStart:null==i?void 0:i.onDragStart,onDragEnd:null==i?void 0:i.onDragEnd,onKeyDown:null==i?void 0:i.onKeyDown,onClick:()=>ne(e),children:[(0,a.jsx)(ea.o,{name:e}),(0,a.jsx)("span",{className:"ed-tab-label",children:e}),r?(0,a.jsx)("span",{className:"ed-dirty","aria-hidden":"true",title:"Unsaved changes",children:"●"}):null]}),void 0!==eu?(0,a.jsx)("button",{type:"button",className:"ed-tab-close","aria-label":`Close ${e}`,title:`Close ${e}`,onClick:()=>void nt(e),children:"\xd7"}):null]},e);}):(0,a.jsx)("span",{className:"ed-tab active","data-dirty":"false",children:(0,a.jsxs)("span",{className:"ed-tab-hit",role:"tab",id:eP,"aria-selected":"true","aria-controls":eV,tabIndex:0,title:"Editor",children:[(0,a.jsx)(en.F.editor,{size:12}),(0,a.jsx)("span",{className:"ed-tab-label",children:"Editor"})]})})}),(0,a.jsx)("span",{className:"spacer"}),eR,eM&&tU?(0,a.jsx)("button",{type:"button",className:"ed-save",onClick:()=>{t1&&tO();},"aria-disabled":!t1,title:"Generate unit tests for this file",children:t0?"Generating…":"Generate Tests"}):null,t0?(0,a.jsx)("button",{type:"button",className:"ed-reload",onClick:tA,children:"Cancel"}):null,eM?(0,a.jsx)("button",{type:"button",className:"ed-save",onClick:()=>{tW&&e6(e=>e+1);},"aria-disabled":tW?"false":"true",title:"Format document",children:"Format"}):null,eM&&"conflict"===eW?(0,a.jsx)("button",{type:"button",className:"ed-reload",onClick:tk,children:"Reload"}):null,eM?(0,a.jsx)("button",{type:"button",className:"ed-save",onClick:()=>{tZ&&tq(eK);},"aria-disabled":!tZ,children:"saving"===eW?"Saving…":"Save"}):null]}),null!==ts?(0,a.jsxs)("div",{className:"ed-recovery",role:"status",children:[(0,a.jsx)("span",{children:ni?"Recovered editor changes are available, and the disk file changed.":"Recovered unsaved editor changes are available."}),(0,a.jsx)("span",{className:"spacer"}),ni?(0,a.jsx)("button",{type:"button",className:"ed-reload",onClick:tE,children:"Compare"}):null,(0,a.jsx)("button",{type:"button",className:"ed-save",onClick:tR,children:ni?"Keep local":"Restore unsaved changes"}),(0,a.jsx)("button",{type:"button",className:"ed-reload",onClick:tB,children:ni?"Use disk":"Discard"}),ni?(0,a.jsx)("button",{type:"button",className:"ed-icon-action",onClick:()=>to(null),children:"Cancel"}):null,null!==td?(0,a.jsx)("span",{children:td}):null]}):null,(0,a.jsx)("div",{className:"ed-host",id:eV,role:"tabpanel","aria-labelledby":eP,children:y}),t4&&null!==t3?(0,a.jsx)(K,{viewModel:t3}):null]});}},20147:(e,t,n)=>{n.d(t,{EP:()=>l,JX:()=>i,Ne:()=>s,Q0:()=>r});let a={request:()=>"saving",succeeded:e=>"saving"===e?"saved":e,failed:e=>"saving"===e?"error":e,conflicted:e=>"saving"===e?"conflict":e,retry:e=>"error"===e||"conflict"===e?"saving":e,reloaded:e=>"conflict"===e?"idle":e,edited:e=>"saved"===e?"idle":e};function r(e,t){return a[t.type](e);}function i(e,t,n,a){let r={relativePath:n,sizeBytes:new TextEncoder().encode(t).length,text:t,truncated:!1};return void 0===a?{identity:e,content:r}:{identity:e,expectedSavedVersion:a,content:r};}function l(e){return e.modelReadOnly||e.bufferReadOnly||!0===e.override||e.truncated||e.overLimit||e.notReady;}function s(e,t){return e.truncated||e.sizeBytes>t;}},30403:(e,t,n)=>{function a(e,t){var n;return{identity:e,savedVersion:e.version,dirty:!1,readOnly:null!=(n=null==t?void 0:t.readOnly)&&n,lastChangeOrigin:null};}function r(e,t){switch(t.type){case"edited":return{identity:{...e.identity,version:e.identity.version+1},savedVersion:e.savedVersion,dirty:!0,readOnly:e.readOnly,lastChangeOrigin:t.origin};case"saved":return{identity:e.identity,savedVersion:e.identity.version,dirty:!1,readOnly:e.readOnly,lastChangeOrigin:e.lastChangeOrigin};case"reloaded":return a(t.identity,{readOnly:e.readOnly});case"set-read-only":return{identity:e.identity,savedVersion:e.savedVersion,dirty:e.dirty,readOnly:t.readOnly,lastChangeOrigin:e.lastChangeOrigin};}}function i(e){return e.identity.version!==e.savedVersion;}n.d(t,{IB:()=>i,V8:()=>r,kv:()=>a});},57511:(e,t,n)=>{n.d(t,{OM:()=>a,PK:()=>l});let a=["typescript","javascript","json","css","scss","less","html","markdown","yaml","python","java","go","rust","sql","shell","plaintext"],r="plaintext",i={ts:"typescript",mts:"typescript",cts:"typescript",tsx:"typescript",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"javascript",json:"json",jsonc:"json",css:"css",scss:"scss",less:"less",html:"html",htm:"html",md:"markdown",markdown:"markdown",yaml:"yaml",yml:"yaml",py:"python",pyi:"python",java:"java",go:"go",rs:"rust",sql:"sql",sh:"shell",bash:"shell",zsh:"shell"};function l(e){var t,n;let a,l,s,o=(s=(l=(null!=(n=(a=e.split(/[/\\]/))[a.length-1])?n:e).trim()).lastIndexOf("."))<=0||s===l.length-1?"":l.slice(s+1).toLowerCase();return""===o?r:null!=(t=i[o])?t:r;}},78320:(e,t,n)=>{n.d(t,{ju:()=>a});function a(e,t){return e.requestId!==t.requestId||e.streamId!==t.streamId||e.sequence!==t.sequence;}},81806:(e,t,n)=>{n.d(t,{Gz:()=>o,Hb:()=>u,bA:()=>c,hX:()=>l,jz:()=>r,sV:()=>g,x7:()=>d});var a=n(78320);function r(e){return{line:e.lineNumber-1,column:e.column-1};}let i={text:"Text",method:"Method",function:"Function",constructor:"Constructor",field:"Field",variable:"Variable",class:"Class",interface:"Interface",module:"Module",property:"Property",keyword:"Keyword",snippet:"Snippet"};function l(e){return{startLineNumber:e.start.line+1,startColumn:e.start.column+1,endLineNumber:e.end.line+1,endColumn:e.end.column+1};}let s={suggestions:[],incomplete:!1};function o(e){var t;return t=e.documentLanguages.map(t=>{var n;let o,d,u,c=(n={resolve:e.resolve,languages:e.languages,triggerCharacters:e.triggerCharacters,documentLanguage:t,contextBudgetBytes:e.contextBudgetBytes,streamId:`${e.streamId}:${t}`,newRequestId:e.newRequestId},o=0,d=null,u=null,{triggerCharacters:n.triggerCharacters,async provideCompletionItems(e,t,c,v){var g,f,p,m;let h;o+=1;let b=(g=o,f=n.languages.CompletionTriggerKind,h=c.triggerKind===f.TriggerCharacter?{triggerKind:"trigger-character",...("string"==typeof c.triggerCharacter?{triggerCharacter:c.triggerCharacter}:{})}:c.triggerKind===f.TriggerForIncompleteCompletions?{triggerKind:"incomplete"}:{triggerKind:"invoked"},{request:{requestId:n.newRequestId(),streamId:n.streamId,sequence:g},document:{uri:e.uri.toString(),language:n.documentLanguage,version:g},position:r(t),triggerKind:h.triggerKind,...(void 0===h.triggerCharacter?{}:{triggerCharacter:h.triggerCharacter}),contextBudgetBytes:n.contextBudgetBytes});d=b.request,null==u||u.abort();let y=new AbortController();u=y,v.isCancellationRequested&&y.abort();let x=v.onCancellationRequested(()=>{y.abort();});try{let r,o=await n.resolve({request:b,documentText:e.getValue()},y.signal);if((0,a.ju)(o.request,d))return s;return r=e.getWordUntilPosition(t),p={startLineNumber:t.lineNumber,startColumn:r.startColumn,endLineNumber:t.lineNumber,endColumn:r.endColumn},m=n.languages.CompletionItemKind,{suggestions:o.items.map(e=>({label:e.label,kind:m[i[e.kind]],insertText:e.insertText,range:void 0===e.range?p:l(e.range),...(void 0===e.detail?{}:{detail:e.detail}),...(void 0===e.sortText?{}:{sortText:e.sortText})})),incomplete:o.isIncomplete};}catch{return s;}finally{x.dispose(),u===y&&(u=null);}}});return e.languages.registerCompletionItemProvider(t,c);}),{dispose(){for(let e of t)e.dispose();}};}let d=[".",'"',"'","`","/","@","<","#"],u=["typescript","javascript"],c=32768,v=0;function g(){let e=globalThis.crypto;return"function"==typeof(null==e?void 0:e.randomUUID)?e.randomUUID():(v+=1,`kreq-${v.toString(36)}`);}},87266:(e,t,n)=>{n.d(t,{Ou:()=>a});function a(e){return e.sizeBytes>5e5?"degraded":!function(e){let t=0;for(let n=0;n<e.length;n+=1)if(10===e.charCodeAt(n)&&(t+=1)>=1e4)return!0;return!1;}(e.text)?"normal":"degraded";}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e,t,r,a,o,n,f,d,i,c={},l={};function u(e){var t=l[e];if(void 0!==t)return t.exports;var r=l[e]={exports:{}},a=!0;try{c[e](r,r.exports,u),a=!1;}finally{a&&delete l[e];}return r.exports;}u.m=c,e=[],u.O=(t,r,a,o)=>{if(r){o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[r,a,o];return;}for(var f=1/0,n=0;n<e.length;n++){for(var[r,a,o]=e[n],d=!0,i=0;i<r.length;i++)(!1&o||f>=o)&&Object.keys(u.O).every(e=>u.O[e](r[i]))?r.splice(i--,1):(d=!1,o<f&&(f=o));if(d){e.splice(n--,1);var c=a();void 0!==c&&(t=c);}}return t;},u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t;},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,u.t=function(e,a){if(1&a&&(e=this(e)),8&a||"object"==typeof e&&e&&(4&a&&e.__esModule||16&a&&"function"==typeof e.then))return e;var o=Object.create(null);u.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var f=2&a&&e;"object"==typeof f&&!~t.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach(t=>n[t]=()=>e[t]);return n.default=()=>e,u.d(o,n),o;},u.d=(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]});},u.f={},u.e=e=>Promise.all(Object.keys(u.f).reduce((t,r)=>(u.f[r](e,t),t),[])),u.u=e=>"static/chunks/"+(8363===e?"7f819917":e)+"."+{1562:"a7c2497354300cf6",1587:"33fc772cb66c38d7",1688:"1b48974d4820565a",1994:"32d7f1649e15081f",2063:"a7cd2441b60aa093",2107:"c1ff3a39fd003d88",3170:"e25f90ed08f303e3",3294:"024505d0744fef2a",3740:"84a20b2730a97a3a",3868:"ea5f0ddf5e222dba",3883:"f8e3dc3fea7fdbe1",3968:"55fa02cd74fb96b3",4444:"46b9cfb85257a381",4690:"6bc5c7d6c119aa54",4905:"73672d3d0c642e75",5272:"bca1ad25a75d8d0a",6028:"7deb9c5d26bfce83",6774:"52093bc8b0ffabc8",7301:"501daea6a309d3f5",7573:"103bcab7ad9ec4f4",7732:"a6e5df401d584efd",8363:"631f7e51d345e84c",8556:"4f751fdef390f050",8776:"8b33803959adfdcf",8948:"a434bd4eee007dec",9385:"6543855a745f1347",9580:"c45199468eff0333",9682:"d5b8d9ce8cb80519",9976:"5970067ee5af21ee"}[e]+".js",u.miniCssF=e=>"static/css/"+{651:"1ab47b3e78ccc975",5957:"5adfb34e72f5c7db",6218:"29c9f45818b0ee66"}[e]+".css",u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")();}catch(e){if("object"==typeof window)return window;}}(),u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},u.l=(e,t,r,o)=>{if(a[e])return void a[e].push(t);if(void 0!==r)for(var n,f,d=document.getElementsByTagName("script"),i=0;i<d.length;i++){var c=d[i];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")=="_N_E:"+r){n=c;break;}}n||(f=!0,(n=document.createElement("script")).charset="utf-8",n.timeout=120,u.nc&&n.setAttribute("nonce",u.nc),n.setAttribute("data-webpack","_N_E:"+r),n.src=u.tu(e)),a[e]=[t];var l=(t,r)=>{n.onerror=n.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach(e=>e(r)),t)return t(r);},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=l.bind(null,n.onerror),n.onload=l.bind(null,n.onload),f&&document.head.appendChild(n);},u.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},u.tt=()=>(void 0===o&&(o={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(o=trustedTypes.createPolicy("nextjs#bundler",o))),o),u.tu=e=>u.tt().createScriptURL(e),u.p="/_next/",n={8068:0},u.f.miniCss=(e,t)=>{if(n[e])t.push(n[e]);else 0!==n[e]&&{651:1,5957:1,6218:1}[e]&&t.push(n[e]=new Promise((t,r)=>{var a=u.miniCssF(e),o=u.p+a;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),a=0;a<r.length;a++){var o=r[a],n=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(n===e||n===t))return o;}for(var f=document.getElementsByTagName("style"),a=0;a<f.length;a++){var o=f[a],n=o.getAttribute("data-href");if(n===e||n===t)return o;}})(a,o))return t();((e,t,r,a)=>{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=n=>{if(o.onerror=o.onload=null,"load"===n.type)r();else{var f=n&&("load"===n.type?"missing":n.type),d=n&&n.target&&n.target.href||t,i=Error("Loading CSS chunk "+e+" failed.\n("+d+")");i.code="CSS_CHUNK_LOAD_FAILED",i.type=f,i.request=d,o.parentNode.removeChild(o),a(i);}},o.href=t;if("function"==typeof _N_E_STYLE_LOAD){var n=o.href,f=o.onload,d=o.onerror;_N_E_STYLE_LOAD(0===n.indexOf(window.location.origin)?new URL(n).pathname:n).then(function(){f&&f.call(o,{type:"load"});},function(){d&&d.call(o,{});});}else document.head.appendChild(o);})(e,o,t,r);}).then(()=>{n[e]=0;},t=>{throw delete n[e],t;}));},u.b=document.baseURI||self.location.href,f={8068:0,9306:0},u.f.j=(e,t)=>{var r=u.o(f,e)?f[e]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(5957|6218|651|8068|9306)$/.test(e))f[e]=0;else{var a=new Promise((t,a)=>r=f[e]=[t,a]);t.push(r[2]=a);var o=u.p+u.u(e),n=Error();u.l(o,t=>{if(u.o(f,e)&&(0!==(r=f[e])&&(f[e]=void 0),r)){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;n.message="Loading chunk "+e+" failed.\n("+a+": "+o+")",n.name="ChunkLoadError",n.type=a,n.request=o,r[1](n);}},"chunk-"+e,e);}},u.O.j=e=>0===f[e],d=(e,t)=>{var r,a,[o,n,d]=t,i=0;if(o.some(e=>0!==f[e])){for(r in n)u.o(n,r)&&(u.m[r]=n[r]);if(d)var c=d(u);}for(e&&e(t);i<o.length;i++)a=o[i],u.o(f,a)&&f[a]&&f[a][0](),f[a]=0;return u.O(c);},(i=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(d.bind(null,0)),i.push=d.bind(null,i.push.bind(i));})();
|