@oscharko-dev/keiko 0.2.0-beta.0 → 0.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/dist/ui/csp-hashes.json +20 -20
- package/dist/ui/static/404.html +1 -1
- package/dist/ui/static/_next/static/chunks/{422-70c16ea4b1f77f2e.js → 923-4141696576191bc0.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/_not-found/page-03d642dcd0f15b52.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/launch/page-c725ff0c02b50663.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/layout-aadefe615729db05.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/local-knowledge/capsule/{page-0dc74e194a1f0092.js → page-4a7f242906e19a07.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/local-knowledge/page-3361769b8964e659.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/consolidation/{page-dc6c6bd180bc47a3.js → page-44b3f4fa3e10085f.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/detail/{page-659e308e68ab2b1e.js → page-0cdfb3eeb659daeb.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/{page-d6ba78f54207b69f.js → page-e78e0cd2876fec41.js} +1 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/review-queue/page-e32fe86466827484.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/page-9ad91065d05ddfa0.js +1 -0
- package/dist/ui/static/_next/static/chunks/{main-app-5b043f6c611974ae.js → main-app-b52a8fa1d8127a5f.js} +1 -1
- package/dist/ui/static/apple-touch-icon.png +0 -0
- package/dist/ui/static/favicon.ico +0 -0
- package/dist/ui/static/icon-192-maskable.png +0 -0
- package/dist/ui/static/icon-192.png +0 -0
- package/dist/ui/static/icon-512-maskable.png +0 -0
- package/dist/ui/static/icon-512.png +0 -0
- package/dist/ui/static/index.html +1 -1
- package/dist/ui/static/index.txt +3 -3
- package/dist/ui/static/launch.html +1 -1
- package/dist/ui/static/launch.txt +3 -3
- package/dist/ui/static/local-knowledge/capsule.html +1 -1
- package/dist/ui/static/local-knowledge/capsule.txt +2 -2
- package/dist/ui/static/local-knowledge.html +1 -1
- package/dist/ui/static/local-knowledge.txt +2 -2
- package/dist/ui/static/memoriaviva/consolidation.html +1 -1
- package/dist/ui/static/memoriaviva/consolidation.txt +2 -2
- 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.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 +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/.tsbuildinfo +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/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/pdf-parser.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/pdf-parser.js +2 -2
- package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-sdk/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-sdk/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-security/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-server/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/.tsbuildinfo +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/package.json +1 -1
- package/package.json +4 -3
- package/dist/ui/static/_next/static/chunks/app/_not-found/page-c4d800f366186be0.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/launch/page-08afd1a052e7662c.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/layout-0f75a39edc90325d.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/local-knowledge/page-48bd57c5e542349e.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/memoriaviva/review-queue/page-7186cd8b22efc78b.js +0 -1
- package/dist/ui/static/_next/static/chunks/app/page-f8386b8e05b3db03.js +0 -1
- package/node_modules/@napi-rs/canvas/LICENSE +0 -21
- package/node_modules/@napi-rs/canvas/README.md +0 -448
- package/node_modules/@napi-rs/canvas/geometry.js +0 -873
- package/node_modules/@napi-rs/canvas/index.d.ts +0 -1097
- package/node_modules/@napi-rs/canvas/index.js +0 -196
- package/node_modules/@napi-rs/canvas/js-binding.js +0 -464
- package/node_modules/@napi-rs/canvas/load-image.js +0 -156
- package/node_modules/@napi-rs/canvas/node-canvas.d.ts +0 -216
- package/node_modules/@napi-rs/canvas/node-canvas.js +0 -379
- package/node_modules/@napi-rs/canvas/package.json +0 -179
- package/node_modules/@napi-rs/canvas-linux-x64-gnu/README.md +0 -3
- package/node_modules/@napi-rs/canvas-linux-x64-gnu/package.json +0 -47
- package/node_modules/@napi-rs/canvas-linux-x64-gnu/skia.linux-x64-gnu.node +0 -0
- package/node_modules/@napi-rs/canvas-linux-x64-musl/README.md +0 -3
- package/node_modules/@napi-rs/canvas-linux-x64-musl/package.json +0 -47
- package/node_modules/@napi-rs/canvas-linux-x64-musl/skia.linux-x64-musl.node +0 -0
- /package/dist/ui/static/_next/static/{IZjQES_2JaG9qZ7_fkEPl → BNiyfCos3TiM2QdurajIZ}/_buildManifest.js +0 -0
- /package/dist/ui/static/_next/static/{IZjQES_2JaG9qZ7_fkEPl → BNiyfCos3TiM2QdurajIZ}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[492],{781:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return l(1193)}])},1193:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=l(4568),n=l(4137),o=function(){return(0,r.jsx)("html",{children:(0,r.jsx)("body",{children:(0,r.jsx)(n.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})})})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4137:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessErrorFallback",{enumerable:!0,get:function(){return o}});let r=l(4568),n=l(5592);function o(e){let{status:t,message:l}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:t+": "+l}),(0,r.jsx)("div",{style:n.styles.error,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,r.jsx)("h1",{className:"next-error-h1",style:n.styles.h1,children:t}),(0,r.jsx)("div",{style:n.styles.desc,children:(0,r.jsx)("h2",{style:n.styles.h2,children:l})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5592:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"styles",{enumerable:!0,get:function(){return l}});let l={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block"},h1:{display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:14,fontWeight:400,lineHeight:"49px",margin:0}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[587,18,358],()=>e(e.s=781)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[932],{},_=>{_.O(0,[664,982,923,587,18,358],()=>_(_.s=6923)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{8761:()=>{},8821:(e,s,_)=>{Promise.resolve().then(_.t.bind(_,8761,23))}},e=>{e.O(0,[950,587,18,358],()=>e(e.s=8821)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[79],{4499:(e,l,n)=>{Promise.resolve().then(n.bind(n,9929))},7541:(e,l,n)=>{"use strict";var a=n(3041);n.o(a,"useRouter")&&n.d(l,{useRouter:function(){return a.useRouter}}),n.o(a,"useSearchParams")&&n.d(l,{useSearchParams:function(){return a.useSearchParams}})},9389:(e,l,n)=>{"use strict";n.d(l,{FG:()=>m,H9:()=>x,KS:()=>b,Qi:()=>g,R3:()=>c,Tq:()=>h,WM:()=>d,qY:()=>o,r:()=>p,rw:()=>f,xY:()=>k,xr:()=>r,yN:()=>u});var a=n(2982);function t(e,l){let n={Accept:"application/json"};return null!=l&&(n["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(n["X-Keiko-CSRF"]="1"),n}async function s(e){try{let l=await e.json();return{code:l.error.code,message:l.error.message}}catch(l){return{code:"INTERNAL",message:"HTTP ".concat(e.status.toString())}}}async function i(e,l){var n;let i=(null!=(n=null==l?void 0:l.method)?n:"GET").toUpperCase(),r=await fetch(e,{...l,headers:t(i,null==l?void 0:l.body)});if(!r.ok){let{code:e,message:l}=await s(r);throw new a.hD(e,l,r.status)}if(204!==r.status)return r.json()}async function r(){return i("/api/local-knowledge/capsules")}async function c(){return i("/api/local-knowledge/capsule-sets")}async function o(e){return i("/api/local-knowledge/capsules",{method:"POST",body:JSON.stringify(e)})}async function d(e){return i("/api/local-knowledge/capsule-sets",{method:"POST",body:JSON.stringify(e)})}async function u(e,l){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e)),{method:"PATCH",body:JSON.stringify(l)})}async function p(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/index"),{method:"POST",body:JSON.stringify({confirm:!0})})}async function h(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/index"),{method:"DELETE",body:JSON.stringify({confirm:!0})})}async function m(e,l,n){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/connection"),{method:"POST",body:JSON.stringify({scope:l,displayName:n})})}async function g(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/connection"),{method:"DELETE",body:JSON.stringify({confirm:!0})})}async function f(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fetch,n="/api/local-knowledge/capsules/".concat(encodeURIComponent(e)),i=await l(n,{headers:t("GET",void 0)});if(!i.ok){let{code:e,message:l}=await s(i);throw new a.hD(e,l,i.status)}return i.json()}async function x(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e)),{method:"DELETE",body:JSON.stringify({deleteIndex:!0,deleteSources:!1})})}async function b(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/reindex"),{method:"POST",body:JSON.stringify({mode:"changed-files"})})}async function k(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/reindex"),{method:"POST",body:JSON.stringify({mode:"repair-failed"})})}},9929:(e,l,n)=>{"use strict";n.d(l,{CapsuleDetail:()=>R});var a=n(4568),t=n(7620),s=n(7541),i=n(9389),r=n(2982);function c(e){return e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred."}function o(e){let{capsuleId:l,onConnected:n,connectImpl:s=i.FG}=e,[r,o]=(0,t.useState)("folder"),[d,u]=(0,t.useState)(""),[p,h]=(0,t.useState)(""),[m,g]=(0,t.useState)(!1),[f,x]=(0,t.useState)(null),b=function(e,l,n){let a=l.trim();if(""===a)return null;if("folder"===e)return{kind:"folder",rootPath:a,recursive:!0};if("repository"===e)return{kind:"repository",repositoryRoot:a};let t=Array.from(new Set(n.split(/\r?\n/u).map(e=>e.trim()).filter(e=>e.length>0)));return 0===t.length?null:{kind:"files",rootPath:a,files:t}}(r,d,p);async function k(){if(null!==b&&!m){g(!0),x(null);try{await s(l,b),u(""),h(""),n()}catch(e){x(c(e))}finally{g(!1)}}}return(0,a.jsxs)("div",{className:"lkd-connect-form","aria-label":"Connect a source",children:[(0,a.jsx)("label",{htmlFor:"lkd-connect-kind",className:"lkd-connect-label",children:"Connect source"}),(0,a.jsx)("div",{className:"lkd-connect-row",style:{marginBottom:8},children:(0,a.jsxs)("select",{id:"lkd-connect-kind",className:"dlg-input",value:r,disabled:m,"aria-label":"Source scope kind",onChange:e=>{o(e.target.value),x(null)},children:[(0,a.jsx)("option",{value:"folder",children:"Folder"}),(0,a.jsx)("option",{value:"repository",children:"Repository"}),(0,a.jsx)("option",{value:"files",children:"Files"})]})}),(0,a.jsx)("div",{className:"lkd-connect-row",children:(0,a.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","aria-label":"repository"===r?"Absolute repository path to connect":"files"===r?"Absolute root path for the selected files":"Absolute folder path to connect",autoComplete:"off",onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&"files"!==r&&k()}})}),"files"===r?(0,a.jsx)("div",{className:"lkd-connect-row",style:{marginTop:8},children:(0,a.jsx)("textarea",{className:"dlg-input lkd-connect-input",value:p,disabled:m,placeholder:"src/app.ts\nREADME.md","aria-label":"Relative files to connect",rows:4,onChange:e=>h(e.target.value)})}):null,(0,a.jsx)("div",{className:"lkd-connect-row",style:{marginTop:8},children:(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:m||null===b,"aria-busy":m,onClick:()=>void k(),children:m?"Connecting…":"Connect"})}),null!==f?(0,a.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",style:{marginTop:4},children:f}):null]})}function d(e){let{kind:l,capsuleDisplayName:n,nameInput:s,busy:i,error:r,onNameChange:c,onConfirm:o,onCancel:d}=e,u=(0,t.useRef)(null),p=(0,t.useRef)(null);(0,t.useEffect)(()=>{0;let e=u.current;if(null===e)return;let l=e.querySelector("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])");function n(l){if("Escape"===l.key){l.preventDefault(),d();return}if("Tab"!==l.key)return;let n=Array.from(e.querySelectorAll("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"));if(0===n.length)return;let a=n[0],t=n[n.length-1];l.shiftKey&&document.activeElement===a?(l.preventDefault(),t.focus()):l.shiftKey||document.activeElement!==t||(l.preventDefault(),a.focus())}return null==l||l.focus(),e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[!0,u,d]),(0,t.useEffect)(()=>{"delete"===l&&null!==p.current&&p.current.focus()},[l]);let h="delete"===l,m=!i&&(!h||s===n),g="lkd-confirm-title",f="lkd-confirm-desc";return(0,a.jsx)("div",{className:"dlg-overlay in",role:"presentation",onClick:e=>{e.target===e.currentTarget&&d()},children:(0,a.jsxs)("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":f,className:"dlg",children:[(0,a.jsx)("div",{className:"dlg-head",children:(0,a.jsxs)("div",{className:"dlg-htext",children:[(0,a.jsx)("div",{id:g,className:"dlg-title",children:"delete"===l?"Delete capsule":"refresh"===l?"Refresh changed files":"Repair failed files"}),(0,a.jsx)("div",{id:f,className:"dlg-sub",children:"delete"===l?'This permanently deletes the capsule index. The source files on disk are NOT deleted. Type "'.concat(n,'" to confirm.'):"refresh"===l?"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."})]})}),h?(0,a.jsxs)("div",{className:"dlg-body",children:[(0,a.jsxs)("div",{className:"dlg-field",children:[(0,a.jsx)("label",{htmlFor:"lkd-confirm-name-input",className:"dlg-label",children:"Type the capsule name to confirm"}),(0,a.jsx)("input",{id:"lkd-confirm-name-input",type:"text",className:"dlg-input",value:s,autoComplete:"off",ref:p,disabled:i,placeholder:n,"aria-label":'Type "'.concat(n,'" to confirm deletion'),onChange:e=>c(e.target.value)})]}),null!==r?(0,a.jsx)("div",{role:"alert",className:"lk-alert",style:{marginTop:4},children:r}):null]}):(0,a.jsx)("div",{className:"dlg-body",children:null!==r?(0,a.jsx)("div",{role:"alert",className:"lk-alert",children:r}):null}),(0,a.jsxs)("div",{className:"dlg-foot",children:[(0,a.jsx)("button",{type:"button",className:"dlg-btn",disabled:i,onClick:d,children:"Cancel"}),(0,a.jsx)("button",{type:"button",className:"dlg-btn lkd-btn-destructive",disabled:!m,"aria-disabled":!m,onClick:o,children:i?"Working…":"delete"===l?"Delete":"refresh"===l?"Refresh":"Repair"})]})]})})}function u(e){let{capsuleId:l,capsuleDisplayName:n,sourceCount:s,lifecycleState:r,onActionComplete:u,connectCapsuleSourceImpl:p=i.FG,deleteCapsuleImpl:h=i.H9,refreshCapsuleImpl:m=i.KS,repairCapsuleImpl:g=i.xY,startIndexingImpl:f=i.r}=e,[x,b]=(0,t.useState)(null),[k,y]=(0,t.useState)(!1),[j,v]=(0,t.useState)(null),[N,S]=(0,t.useState)(!1),[w,C]=(0,t.useState)(null);async function D(){if(!N){S(!0),C(null);try{await f(l),u()}catch(e){C(c(e))}finally{S(!1)}}}function R(e){v(null),b({kind:e,nameInput:""})}async function T(e){y(!0),v(null);try{await e(),b(null),u()}catch(e){v(c(e))}finally{y(!1)}}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{capsuleId:l,onConnected:u,connectImpl:p}),s>0&&"ready"!==r?(0,a.jsxs)("div",{className:"lkd-index-row",children:[(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Index this capsule now","aria-busy":N,disabled:N,onClick:()=>void D(),children:N?"Indexing…":"Index now"}),null!==w?(0,a.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",style:{marginTop:4},children:w}):null]}):null,(0,a.jsxs)("div",{role:"group","aria-label":"Actions for capsule ".concat(n),className:"lkd-actions-group",children:[(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Refresh changed files for capsule ".concat(n),onClick:()=>R("refresh"),children:"Refresh changed files"}),(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Repair failed files for capsule ".concat(n),onClick:()=>R("repair"),children:"Repair failed files"}),(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger","aria-label":"Delete capsule ".concat(n),onClick:()=>R("delete"),children:"Delete"})]}),null!==x?(0,a.jsx)(d,{kind:x.kind,capsuleDisplayName:n,nameInput:x.nameInput,busy:k,error:j,onNameChange:function(e){b(l=>null!==l?{...l,nameInput:e}:null)},onConfirm:function(){if(null===x||k)return;let{kind:e}=x;"delete"===e?T(()=>h(l)):"refresh"===e?T(()=>m(l)):T(()=>g(l))},onCancel:function(){k||(b(null),v(null))}}):null]})}function p(e){let{name:l,description:n,busy:t,error:s,onNameChange:i,onDescriptionChange:r,onCancel:c,onSubmit:o}=e;return(0,a.jsxs)("form",{className:"lkd-rename-form","aria-label":"Rename capsule",onSubmit:o,children:[(0,a.jsxs)("div",{className:"dlg-field",children:[(0,a.jsx)("label",{htmlFor:"lkd-rename-name",className:"dlg-label",children:"Display name"}),(0,a.jsx)("input",{id:"lkd-rename-name",type:"text",className:"dlg-input",value:l,disabled:t,autoComplete:"off","aria-label":"Capsule display name",onChange:e=>i(e.target.value)})]}),(0,a.jsxs)("div",{className:"dlg-field",children:[(0,a.jsx)("label",{htmlFor:"lkd-rename-desc",className:"dlg-label",children:"Description"}),(0,a.jsx)("input",{id:"lkd-rename-desc",type:"text",className:"dlg-input",value:n,disabled:t,autoComplete:"off","aria-label":"Capsule description",onChange:e=>r(e.target.value)})]}),null!==s?(0,a.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:s}):null,(0,a.jsxs)("div",{className:"lkd-rename-actions",children:[(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:t,onClick:c,children:"Cancel"}),(0,a.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:t,"aria-busy":t,children:t?"Saving…":"Save"})]})]})}function h(e){let{capsuleId:l,displayName:n,description:s,onRenamed:c,renameImpl:o=i.yN}=e,[d,u]=(0,t.useState)(!1),[h,m]=(0,t.useState)(n),[g,f]=(0,t.useState)(null!=s?s:""),[x,b]=(0,t.useState)(!1),[k,y]=(0,t.useState)(null);async function j(e){e.preventDefault();let a=h.trim();if(0===a.length)return void y("Display name is required.");let t=function(e,l,n,a){let t={};e!==n&&(t.displayName=e);let s=l.trim();return(s!==(null!=a?a:"")&&(t.description=s),void 0===t.displayName&&void 0===t.description)?null:t}(a,g,n,s);if(null===t)return void u(!1);b(!0),y(null);try{await o(l,t),u(!1),c()}catch(e){y(e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred.")}finally{b(!1)}}return d?(0,a.jsx)(p,{name:h,description:g,busy:x,error:k,onNameChange:m,onDescriptionChange:f,onCancel:function(){x||(u(!1),y(null))},onSubmit:e=>void j(e)}):(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Rename capsule ".concat(n),onClick:function(){m(n),f(null!=s?s:""),y(null),u(!0)},children:"Rename"})}function m(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function g(e){let{children:l}=e;return(0,a.jsx)("h2",{className:"lk-section-head",children:l})}function f(e){let[l,n]=(0,t.useState)(!1);return{visibleCount:l?e:Math.min(25,e),showAll:l,setShowAll:n}}function x(e){let{hiddenCount:l,showAll:n,onToggle:t,noun:s}=e;return!n&&l<=0?null:(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:t,children:n?"Show fewer ".concat(s):"Show ".concat(l.toString()," more ").concat(s)})}function b(e){let{label:l,value:n}=e;return(0,a.jsxs)("div",{className:"lkd-row",children:[(0,a.jsx)("dt",{className:"lkd-label",children:l}),(0,a.jsx)("dd",{className:"lkd-value",children:n})]})}function k(e){var l;let{data:n}=e,{capsule:t,health:s}=n,i=t.embeddingModelIdentity;return(0,a.jsxs)("section",{"aria-labelledby":"lkd-overview-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-overview-heading",children:"Overview"})}),(0,a.jsxs)("dl",{className:"lkd-dl",children:[(0,a.jsx)(b,{label:"Name",value:t.displayName}),void 0!==t.description?(0,a.jsx)(b,{label:"Description",value:t.description}):null,t.tags.length>0?(0,a.jsx)(b,{label:"Tags",value:(0,a.jsx)("ul",{className:"lkd-tags","aria-label":"Capsule tags",children:t.tags.map(e=>(0,a.jsx)("li",{className:"lkd-tag",children:e},e))})}):null,(0,a.jsx)(b,{label:"Status",value:(0,a.jsx)("span",{className:"lk-badge","data-state":t.lifecycleState,role:"status","aria-label":"Status: ".concat(t.lifecycleState),children:t.lifecycleState})}),(0,a.jsx)(b,{label:"Embedding model",value:"".concat(i.provider," / ").concat(i.modelId," (").concat(i.vectorDimensions.toString(),"d, ").concat(i.vectorMetric,")")}),(0,a.jsx)(b,{label:"Storage size",value:(l=s.storageSizeBytes)<1024?"".concat(l.toString()," B"):l<1048576?"".concat((l/1024).toFixed(1)," KB"):"".concat((l/1048576).toFixed(1)," MB")}),(0,a.jsx)(b,{label:"Unsupported documents",value:s.unsupportedDocuments.toString()}),void 0!==s.lastIndexedAt?(0,a.jsx)(b,{label:"Last indexed",value:m(s.lastIndexedAt)}):null,(0,a.jsx)(b,{label:"Vector compatible",value:s.vectorCompatible?"Yes":"No — re-index required"}),s.staleReasons.length>0?(0,a.jsx)(b,{label:"Stale reasons",value:(0,a.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Stale reasons",children:s.staleReasons.map(e=>(0,a.jsx)("li",{children:e},e))})}):null,s.unsupportedGuidance.length>0?(0,a.jsx)(b,{label:"Next steps",value:(0,a.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Unsupported document guidance",children:s.unsupportedGuidance.map(e=>(0,a.jsx)("li",{children:e},e))})}):null]})]})}function y(e){let{sources:l}=e;return 0===l.length?(0,a.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,a.jsx)("p",{className:"lkd-empty-note",children:"No sources attached to this capsule."})]}):(0,a.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,a.jsx)("ul",{className:"lkd-list","aria-label":"Capsule sources",children:l.map(e=>(0,a.jsxs)("li",{className:"lkd-source-row",children:[(0,a.jsx)("div",{className:"lkd-source-name",children:e.displayName}),(0,a.jsx)("div",{className:"lkd-source-scope",children:e.scope.kind}),(0,a.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,a.jsxs)("span",{className:"lkd-count lkd-count-ok",title:"Indexed",children:[e.indexedCount.toString()," indexed"]}),(0,a.jsxs)("span",{className:"lkd-count lkd-count-fail",title:"Failed",children:[e.failedCount.toString()," failed"]}),(0,a.jsxs)("span",{className:"lkd-count lkd-count-skip",title:"Skipped",children:[e.skippedCount.toString()," skipped"]})]})]},e.sourceId))})]})}function j(){return(0,a.jsxs)("section",{"aria-labelledby":"lkd-privacy-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-privacy-heading",children:"Privacy and deletion"})}),(0,a.jsxs)("ul",{className:"lkd-list","aria-label":"Privacy and deletion details",children:[(0,a.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,a.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,a.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 v={info:"Info",warning:"Warning",error:"Error"};function N(e){let{diag:l}=e;return(0,a.jsxs)("li",{className:"lkd-diag-row","data-severity":l.severity,"aria-label":"".concat(v[l.severity],": ").concat(l.code),children:[(0,a.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:v[l.severity]}),(0,a.jsx)("span",{className:"lkd-diag-code",children:l.code}),(0,a.jsx)("span",{className:"lkd-diag-message",children:l.message}),void 0!==l.pageNumber?(0,a.jsxs)("span",{className:"lkd-diag-page",children:["p.",l.pageNumber.toString()]}):null]})}function S(e){let{diagnostics:l}=e,{visibleCount:n,showAll:t,setShowAll:s}=f(l.length),i=l.slice(0,n),r=l.length-i.length;return(0,a.jsxs)("section",{"aria-labelledby":"lkd-diag-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-diag-heading",children:"Health Diagnostics"})}),0===l.length?(0,a.jsx)("p",{className:"lkd-empty-note","data-testid":"diag-empty",children:"No parser diagnostics — all documents processed cleanly."}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("ul",{className:"lkd-list lkd-diag-list","aria-label":"Parser diagnostics",children:i.map((e,l)=>(0,a.jsx)(N,{diag:e},"".concat(e.code,"-").concat(l.toString())))}),(0,a.jsx)(x,{hiddenCount:r,noun:"diagnostics",showAll:t,onToggle:()=>s(!t)})]})]})}let w={queued:"Queued",running:"Running",succeeded:"Succeeded",failed:"Failed",cancelled:"Cancelled"};function C(e){let{job:l}=e;return(0,a.jsxs)("li",{className:"lkd-job-row","aria-label":"Job ".concat(l.id,": ").concat(w[l.status]),children:[(0,a.jsx)("span",{className:"lkd-job-status","data-status":l.status,children:w[l.status]}),(0,a.jsxs)("span",{className:"lkd-job-dates",children:[(0,a.jsx)("time",{dateTime:new Date(l.startedAt).toISOString(),children:m(l.startedAt)}),void 0!==l.finishedAt?(0,a.jsxs)(a.Fragment,{children:[" — ",(0,a.jsx)("time",{dateTime:new Date(l.finishedAt).toISOString(),children:m(l.finishedAt)})]}):null]}),(0,a.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,a.jsxs)("span",{className:"lkd-count lkd-count-ok",children:[l.processedDocuments.toString()," processed"]}),(0,a.jsxs)("span",{className:"lkd-count lkd-count-fail",children:[l.failedDocuments.toString()," failed"]}),(0,a.jsxs)("span",{className:"lkd-count lkd-count-skip",children:[l.skippedDocuments.toString()," skipped"]})]})]})}function D(e){let{jobs:l}=e,{visibleCount:n,showAll:t,setShowAll:s}=f(l.length),i=l.slice(0,n),r=l.length-i.length;return(0,a.jsxs)("section",{"aria-labelledby":"lkd-jobs-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-jobs-heading",children:"Indexing Job History"})}),0===l.length?(0,a.jsx)("p",{className:"lkd-empty-note",children:"No indexing jobs recorded yet."}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("ul",{className:"lkd-list","aria-label":"Indexing job history",children:i.map(e=>(0,a.jsx)(C,{job:e},e.id))}),(0,a.jsx)(x,{hiddenCount:r,noun:"jobs",showAll:t,onToggle:()=>s(!t)})]})]})}function R(){var e;let{fetchDetailImpl:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null!=(e=(0,s.useSearchParams)().get("capsuleId"))?e:"",{data:c,loadStatus:o,loadError:d,reload:p}=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.rw,[n,a]=(0,t.useState)(null),[s,c]=(0,t.useState)("loading"),[o,d]=(0,t.useState)(null),u=(0,t.useCallback)(async()=>{if(""===e){a(null),d("No capsule selected."),c("error");return}c("loading"),d(null);try{let n=await l(e);a(n),c("ready")}catch(e){d(e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred."),c("error")}},[e,l]);return(0,t.useEffect)(()=>{u()},[u]),{data:n,loadStatus:s,loadError:o,reload:function(){u()}}}(n,l);return"loading"===o?(0,a.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading capsule…"}):"error"===o||null===c?(0,a.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[null!=d?d:"Failed to load capsule.",(0,a.jsx)("button",{type:"button",onClick:p,"aria-label":"Retry loading capsule detail",className:"lk-alert-retry",children:"Retry"})]}):(0,a.jsxs)("div",{className:"lkd-content",children:[(0,a.jsxs)("header",{className:"lk-header",children:[(0,a.jsx)("h1",{className:"lk-title",children:c.capsule.displayName}),(0,a.jsx)(h,{capsuleId:n,displayName:c.capsule.displayName,...void 0!==c.capsule.description?{description:c.capsule.description}:{},onRenamed:p}),(0,a.jsx)(u,{capsuleId:n,capsuleDisplayName:c.capsule.displayName,sourceCount:c.sources.length,lifecycleState:c.capsule.lifecycleState,onActionComplete:p})]}),(0,a.jsx)(k,{data:c}),(0,a.jsx)(j,{}),(0,a.jsx)(y,{sources:c.sources}),(0,a.jsx)(S,{diagnostics:c.parserDiagnostics}),(0,a.jsx)(D,{jobs:c.indexingJobs})]})}}},e=>{e.O(0,[982,587,18,358],()=>e(e.s=4499)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[79],{7541:(e,l,n)=>{"use strict";var a=n(3041);n.o(a,"useRouter")&&n.d(l,{useRouter:function(){return a.useRouter}}),n.o(a,"useSearchParams")&&n.d(l,{useSearchParams:function(){return a.useSearchParams}})},8178:(e,l,n)=>{Promise.resolve().then(n.bind(n,9929))},9389:(e,l,n)=>{"use strict";n.d(l,{FG:()=>m,H9:()=>x,KS:()=>b,Qi:()=>g,R3:()=>c,Tq:()=>h,WM:()=>d,qY:()=>o,r:()=>p,rw:()=>f,xY:()=>k,xr:()=>r,yN:()=>u});var a=n(2982);function t(e,l){let n={Accept:"application/json"};return null!=l&&(n["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(n["X-Keiko-CSRF"]="1"),n}async function s(e){try{let l=await e.json();return{code:l.error.code,message:l.error.message}}catch(l){return{code:"INTERNAL",message:"HTTP ".concat(e.status.toString())}}}async function i(e,l){var n;let i=(null!=(n=null==l?void 0:l.method)?n:"GET").toUpperCase(),r=await fetch(e,{...l,headers:t(i,null==l?void 0:l.body)});if(!r.ok){let{code:e,message:l}=await s(r);throw new a.hD(e,l,r.status)}if(204!==r.status)return r.json()}async function r(){return i("/api/local-knowledge/capsules")}async function c(){return i("/api/local-knowledge/capsule-sets")}async function o(e){return i("/api/local-knowledge/capsules",{method:"POST",body:JSON.stringify(e)})}async function d(e){return i("/api/local-knowledge/capsule-sets",{method:"POST",body:JSON.stringify(e)})}async function u(e,l){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e)),{method:"PATCH",body:JSON.stringify(l)})}async function p(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/index"),{method:"POST",body:JSON.stringify({confirm:!0})})}async function h(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/index"),{method:"DELETE",body:JSON.stringify({confirm:!0})})}async function m(e,l,n){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/connection"),{method:"POST",body:JSON.stringify({scope:l,displayName:n})})}async function g(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/connection"),{method:"DELETE",body:JSON.stringify({confirm:!0})})}async function f(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fetch,n="/api/local-knowledge/capsules/".concat(encodeURIComponent(e)),i=await l(n,{headers:t("GET",void 0)});if(!i.ok){let{code:e,message:l}=await s(i);throw new a.hD(e,l,i.status)}return i.json()}async function x(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e)),{method:"DELETE",body:JSON.stringify({deleteIndex:!0,deleteSources:!1})})}async function b(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/reindex"),{method:"POST",body:JSON.stringify({mode:"changed-files"})})}async function k(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/reindex"),{method:"POST",body:JSON.stringify({mode:"repair-failed"})})}},9929:(e,l,n)=>{"use strict";n.d(l,{CapsuleDetail:()=>R});var a=n(4568),t=n(7620),s=n(7541),i=n(9389),r=n(2982);function c(e){return e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred."}function o(e){let{capsuleId:l,onConnected:n,connectImpl:s=i.FG}=e,[r,o]=(0,t.useState)("folder"),[d,u]=(0,t.useState)(""),[p,h]=(0,t.useState)(""),[m,g]=(0,t.useState)(!1),[f,x]=(0,t.useState)(null),b=function(e,l,n){let a=l.trim();if(""===a)return null;if("folder"===e)return{kind:"folder",rootPath:a,recursive:!0};if("repository"===e)return{kind:"repository",repositoryRoot:a};let t=Array.from(new Set(n.split(/\r?\n/u).map(e=>e.trim()).filter(e=>e.length>0)));return 0===t.length?null:{kind:"files",rootPath:a,files:t}}(r,d,p);async function k(){if(null!==b&&!m){g(!0),x(null);try{await s(l,b),u(""),h(""),n()}catch(e){x(c(e))}finally{g(!1)}}}return(0,a.jsxs)("div",{className:"lkd-connect-form","aria-label":"Connect a source",children:[(0,a.jsx)("label",{htmlFor:"lkd-connect-kind",className:"lkd-connect-label",children:"Connect source"}),(0,a.jsx)("div",{className:"lkd-connect-row",style:{marginBottom:8},children:(0,a.jsxs)("select",{id:"lkd-connect-kind",className:"dlg-input",value:r,disabled:m,"aria-label":"Source scope kind",onChange:e=>{o(e.target.value),x(null)},children:[(0,a.jsx)("option",{value:"folder",children:"Folder"}),(0,a.jsx)("option",{value:"repository",children:"Repository"}),(0,a.jsx)("option",{value:"files",children:"Files"})]})}),(0,a.jsx)("div",{className:"lkd-connect-row",children:(0,a.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","aria-label":"repository"===r?"Absolute repository path to connect":"files"===r?"Absolute root path for the selected files":"Absolute folder path to connect",autoComplete:"off",onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&"files"!==r&&k()}})}),"files"===r?(0,a.jsx)("div",{className:"lkd-connect-row",style:{marginTop:8},children:(0,a.jsx)("textarea",{className:"dlg-input lkd-connect-input",value:p,disabled:m,placeholder:"src/app.ts\nREADME.md","aria-label":"Relative files to connect",rows:4,onChange:e=>h(e.target.value)})}):null,(0,a.jsx)("div",{className:"lkd-connect-row",style:{marginTop:8},children:(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:m||null===b,"aria-busy":m,onClick:()=>void k(),children:m?"Connecting…":"Connect"})}),null!==f?(0,a.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",style:{marginTop:4},children:f}):null]})}function d(e){let{kind:l,capsuleDisplayName:n,nameInput:s,busy:i,error:r,onNameChange:c,onConfirm:o,onCancel:d}=e,u=(0,t.useRef)(null),p=(0,t.useRef)(null);(0,t.useEffect)(()=>{0;let e=u.current;if(null===e)return;let l=e.querySelector("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])");function n(l){if("Escape"===l.key){l.preventDefault(),d();return}if("Tab"!==l.key)return;let n=Array.from(e.querySelectorAll("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"));if(0===n.length)return;let a=n[0],t=n[n.length-1];l.shiftKey&&document.activeElement===a?(l.preventDefault(),t.focus()):l.shiftKey||document.activeElement!==t||(l.preventDefault(),a.focus())}return null==l||l.focus(),e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[!0,u,d]),(0,t.useEffect)(()=>{"delete"===l&&null!==p.current&&p.current.focus()},[l]);let h="delete"===l,m=!i&&(!h||s===n),g="lkd-confirm-title",f="lkd-confirm-desc";return(0,a.jsx)("div",{className:"dlg-overlay in",role:"presentation",onClick:e=>{e.target===e.currentTarget&&d()},children:(0,a.jsxs)("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":f,className:"dlg",children:[(0,a.jsx)("div",{className:"dlg-head",children:(0,a.jsxs)("div",{className:"dlg-htext",children:[(0,a.jsx)("div",{id:g,className:"dlg-title",children:"delete"===l?"Delete capsule":"refresh"===l?"Refresh changed files":"Repair failed files"}),(0,a.jsx)("div",{id:f,className:"dlg-sub",children:"delete"===l?'This permanently deletes the capsule index. The source files on disk are NOT deleted. Type "'.concat(n,'" to confirm.'):"refresh"===l?"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."})]})}),h?(0,a.jsxs)("div",{className:"dlg-body",children:[(0,a.jsxs)("div",{className:"dlg-field",children:[(0,a.jsx)("label",{htmlFor:"lkd-confirm-name-input",className:"dlg-label",children:"Type the capsule name to confirm"}),(0,a.jsx)("input",{id:"lkd-confirm-name-input",type:"text",className:"dlg-input",value:s,autoComplete:"off",ref:p,disabled:i,placeholder:n,"aria-label":'Type "'.concat(n,'" to confirm deletion'),onChange:e=>c(e.target.value)})]}),null!==r?(0,a.jsx)("div",{role:"alert",className:"lk-alert",style:{marginTop:4},children:r}):null]}):(0,a.jsx)("div",{className:"dlg-body",children:null!==r?(0,a.jsx)("div",{role:"alert",className:"lk-alert",children:r}):null}),(0,a.jsxs)("div",{className:"dlg-foot",children:[(0,a.jsx)("button",{type:"button",className:"dlg-btn",disabled:i,onClick:d,children:"Cancel"}),(0,a.jsx)("button",{type:"button",className:"dlg-btn lkd-btn-destructive",disabled:!m,"aria-disabled":!m,onClick:o,children:i?"Working…":"delete"===l?"Delete":"refresh"===l?"Refresh":"Repair"})]})]})})}function u(e){let{capsuleId:l,capsuleDisplayName:n,sourceCount:s,lifecycleState:r,onActionComplete:u,connectCapsuleSourceImpl:p=i.FG,deleteCapsuleImpl:h=i.H9,refreshCapsuleImpl:m=i.KS,repairCapsuleImpl:g=i.xY,startIndexingImpl:f=i.r}=e,[x,b]=(0,t.useState)(null),[k,y]=(0,t.useState)(!1),[j,v]=(0,t.useState)(null),[N,S]=(0,t.useState)(!1),[w,C]=(0,t.useState)(null);async function D(){if(!N){S(!0),C(null);try{await f(l),u()}catch(e){C(c(e))}finally{S(!1)}}}function R(e){v(null),b({kind:e,nameInput:""})}async function T(e){y(!0),v(null);try{await e(),b(null),u()}catch(e){v(c(e))}finally{y(!1)}}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{capsuleId:l,onConnected:u,connectImpl:p}),s>0&&"ready"!==r?(0,a.jsxs)("div",{className:"lkd-index-row",children:[(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Index this capsule now","aria-busy":N,disabled:N,onClick:()=>void D(),children:N?"Indexing…":"Index now"}),null!==w?(0,a.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",style:{marginTop:4},children:w}):null]}):null,(0,a.jsxs)("div",{role:"group","aria-label":"Actions for capsule ".concat(n),className:"lkd-actions-group",children:[(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Refresh changed files for capsule ".concat(n),onClick:()=>R("refresh"),children:"Refresh changed files"}),(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Repair failed files for capsule ".concat(n),onClick:()=>R("repair"),children:"Repair failed files"}),(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger","aria-label":"Delete capsule ".concat(n),onClick:()=>R("delete"),children:"Delete"})]}),null!==x?(0,a.jsx)(d,{kind:x.kind,capsuleDisplayName:n,nameInput:x.nameInput,busy:k,error:j,onNameChange:function(e){b(l=>null!==l?{...l,nameInput:e}:null)},onConfirm:function(){if(null===x||k)return;let{kind:e}=x;"delete"===e?T(()=>h(l)):"refresh"===e?T(()=>m(l)):T(()=>g(l))},onCancel:function(){k||(b(null),v(null))}}):null]})}function p(e){let{name:l,description:n,busy:t,error:s,onNameChange:i,onDescriptionChange:r,onCancel:c,onSubmit:o}=e;return(0,a.jsxs)("form",{className:"lkd-rename-form","aria-label":"Rename capsule",onSubmit:o,children:[(0,a.jsxs)("div",{className:"dlg-field",children:[(0,a.jsx)("label",{htmlFor:"lkd-rename-name",className:"dlg-label",children:"Display name"}),(0,a.jsx)("input",{id:"lkd-rename-name",type:"text",className:"dlg-input",value:l,disabled:t,autoComplete:"off","aria-label":"Capsule display name",onChange:e=>i(e.target.value)})]}),(0,a.jsxs)("div",{className:"dlg-field",children:[(0,a.jsx)("label",{htmlFor:"lkd-rename-desc",className:"dlg-label",children:"Description"}),(0,a.jsx)("input",{id:"lkd-rename-desc",type:"text",className:"dlg-input",value:n,disabled:t,autoComplete:"off","aria-label":"Capsule description",onChange:e=>r(e.target.value)})]}),null!==s?(0,a.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:s}):null,(0,a.jsxs)("div",{className:"lkd-rename-actions",children:[(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:t,onClick:c,children:"Cancel"}),(0,a.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:t,"aria-busy":t,children:t?"Saving…":"Save"})]})]})}function h(e){let{capsuleId:l,displayName:n,description:s,onRenamed:c,renameImpl:o=i.yN}=e,[d,u]=(0,t.useState)(!1),[h,m]=(0,t.useState)(n),[g,f]=(0,t.useState)(null!=s?s:""),[x,b]=(0,t.useState)(!1),[k,y]=(0,t.useState)(null);async function j(e){e.preventDefault();let a=h.trim();if(0===a.length)return void y("Display name is required.");let t=function(e,l,n,a){let t={};e!==n&&(t.displayName=e);let s=l.trim();return(s!==(null!=a?a:"")&&(t.description=s),void 0===t.displayName&&void 0===t.description)?null:t}(a,g,n,s);if(null===t)return void u(!1);b(!0),y(null);try{await o(l,t),u(!1),c()}catch(e){y(e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred.")}finally{b(!1)}}return d?(0,a.jsx)(p,{name:h,description:g,busy:x,error:k,onNameChange:m,onDescriptionChange:f,onCancel:function(){x||(u(!1),y(null))},onSubmit:e=>void j(e)}):(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Rename capsule ".concat(n),onClick:function(){m(n),f(null!=s?s:""),y(null),u(!0)},children:"Rename"})}function m(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function g(e){let{children:l}=e;return(0,a.jsx)("h2",{className:"lk-section-head",children:l})}function f(e){let[l,n]=(0,t.useState)(!1);return{visibleCount:l?e:Math.min(25,e),showAll:l,setShowAll:n}}function x(e){let{hiddenCount:l,showAll:n,onToggle:t,noun:s}=e;return!n&&l<=0?null:(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:t,children:n?"Show fewer ".concat(s):"Show ".concat(l.toString()," more ").concat(s)})}function b(e){let{label:l,value:n}=e;return(0,a.jsxs)("div",{className:"lkd-row",children:[(0,a.jsx)("dt",{className:"lkd-label",children:l}),(0,a.jsx)("dd",{className:"lkd-value",children:n})]})}function k(e){var l;let{data:n}=e,{capsule:t,health:s}=n,i=t.embeddingModelIdentity;return(0,a.jsxs)("section",{"aria-labelledby":"lkd-overview-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-overview-heading",children:"Overview"})}),(0,a.jsxs)("dl",{className:"lkd-dl",children:[(0,a.jsx)(b,{label:"Name",value:t.displayName}),void 0!==t.description?(0,a.jsx)(b,{label:"Description",value:t.description}):null,t.tags.length>0?(0,a.jsx)(b,{label:"Tags",value:(0,a.jsx)("ul",{className:"lkd-tags","aria-label":"Capsule tags",children:t.tags.map(e=>(0,a.jsx)("li",{className:"lkd-tag",children:e},e))})}):null,(0,a.jsx)(b,{label:"Status",value:(0,a.jsx)("span",{className:"lk-badge","data-state":t.lifecycleState,role:"status","aria-label":"Status: ".concat(t.lifecycleState),children:t.lifecycleState})}),(0,a.jsx)(b,{label:"Embedding model",value:"".concat(i.provider," / ").concat(i.modelId," (").concat(i.vectorDimensions.toString(),"d, ").concat(i.vectorMetric,")")}),(0,a.jsx)(b,{label:"Storage size",value:(l=s.storageSizeBytes)<1024?"".concat(l.toString()," B"):l<1048576?"".concat((l/1024).toFixed(1)," KB"):"".concat((l/1048576).toFixed(1)," MB")}),(0,a.jsx)(b,{label:"Unsupported documents",value:s.unsupportedDocuments.toString()}),void 0!==s.lastIndexedAt?(0,a.jsx)(b,{label:"Last indexed",value:m(s.lastIndexedAt)}):null,(0,a.jsx)(b,{label:"Vector compatible",value:s.vectorCompatible?"Yes":"No — re-index required"}),s.staleReasons.length>0?(0,a.jsx)(b,{label:"Stale reasons",value:(0,a.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Stale reasons",children:s.staleReasons.map(e=>(0,a.jsx)("li",{children:e},e))})}):null,s.unsupportedGuidance.length>0?(0,a.jsx)(b,{label:"Next steps",value:(0,a.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Unsupported document guidance",children:s.unsupportedGuidance.map(e=>(0,a.jsx)("li",{children:e},e))})}):null]})]})}function y(e){let{sources:l}=e;return 0===l.length?(0,a.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,a.jsx)("p",{className:"lkd-empty-note",children:"No sources attached to this capsule."})]}):(0,a.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,a.jsx)("ul",{className:"lkd-list","aria-label":"Capsule sources",children:l.map(e=>(0,a.jsxs)("li",{className:"lkd-source-row",children:[(0,a.jsx)("div",{className:"lkd-source-name",children:e.displayName}),(0,a.jsx)("div",{className:"lkd-source-scope",children:e.scope.kind}),(0,a.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,a.jsxs)("span",{className:"lkd-count lkd-count-ok",title:"Indexed",children:[e.indexedCount.toString()," indexed"]}),(0,a.jsxs)("span",{className:"lkd-count lkd-count-fail",title:"Failed",children:[e.failedCount.toString()," failed"]}),(0,a.jsxs)("span",{className:"lkd-count lkd-count-skip",title:"Skipped",children:[e.skippedCount.toString()," skipped"]})]})]},e.sourceId))})]})}function j(){return(0,a.jsxs)("section",{"aria-labelledby":"lkd-privacy-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-privacy-heading",children:"Privacy and deletion"})}),(0,a.jsxs)("ul",{className:"lkd-list","aria-label":"Privacy and deletion details",children:[(0,a.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,a.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,a.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 v={info:"Info",warning:"Warning",error:"Error"};function N(e){let{diag:l}=e;return(0,a.jsxs)("li",{className:"lkd-diag-row","data-severity":l.severity,"aria-label":"".concat(v[l.severity],": ").concat(l.code),children:[(0,a.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:v[l.severity]}),(0,a.jsx)("span",{className:"lkd-diag-code",children:l.code}),(0,a.jsx)("span",{className:"lkd-diag-message",children:l.message}),void 0!==l.pageNumber?(0,a.jsxs)("span",{className:"lkd-diag-page",children:["p.",l.pageNumber.toString()]}):null]})}function S(e){let{diagnostics:l}=e,{visibleCount:n,showAll:t,setShowAll:s}=f(l.length),i=l.slice(0,n),r=l.length-i.length;return(0,a.jsxs)("section",{"aria-labelledby":"lkd-diag-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-diag-heading",children:"Health Diagnostics"})}),0===l.length?(0,a.jsx)("p",{className:"lkd-empty-note","data-testid":"diag-empty",children:"No parser diagnostics — all documents processed cleanly."}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("ul",{className:"lkd-list lkd-diag-list","aria-label":"Parser diagnostics",children:i.map((e,l)=>(0,a.jsx)(N,{diag:e},"".concat(e.code,"-").concat(l.toString())))}),(0,a.jsx)(x,{hiddenCount:r,noun:"diagnostics",showAll:t,onToggle:()=>s(!t)})]})]})}let w={queued:"Queued",running:"Running",succeeded:"Succeeded",failed:"Failed",cancelled:"Cancelled"};function C(e){let{job:l}=e;return(0,a.jsxs)("li",{className:"lkd-job-row","aria-label":"Job ".concat(l.id,": ").concat(w[l.status]),children:[(0,a.jsx)("span",{className:"lkd-job-status","data-status":l.status,children:w[l.status]}),(0,a.jsxs)("span",{className:"lkd-job-dates",children:[(0,a.jsx)("time",{dateTime:new Date(l.startedAt).toISOString(),children:m(l.startedAt)}),void 0!==l.finishedAt?(0,a.jsxs)(a.Fragment,{children:[" — ",(0,a.jsx)("time",{dateTime:new Date(l.finishedAt).toISOString(),children:m(l.finishedAt)})]}):null]}),(0,a.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,a.jsxs)("span",{className:"lkd-count lkd-count-ok",children:[l.processedDocuments.toString()," processed"]}),(0,a.jsxs)("span",{className:"lkd-count lkd-count-fail",children:[l.failedDocuments.toString()," failed"]}),(0,a.jsxs)("span",{className:"lkd-count lkd-count-skip",children:[l.skippedDocuments.toString()," skipped"]})]})]})}function D(e){let{jobs:l}=e,{visibleCount:n,showAll:t,setShowAll:s}=f(l.length),i=l.slice(0,n),r=l.length-i.length;return(0,a.jsxs)("section",{"aria-labelledby":"lkd-jobs-heading",children:[(0,a.jsx)(g,{children:(0,a.jsx)("span",{id:"lkd-jobs-heading",children:"Indexing Job History"})}),0===l.length?(0,a.jsx)("p",{className:"lkd-empty-note",children:"No indexing jobs recorded yet."}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("ul",{className:"lkd-list","aria-label":"Indexing job history",children:i.map(e=>(0,a.jsx)(C,{job:e},e.id))}),(0,a.jsx)(x,{hiddenCount:r,noun:"jobs",showAll:t,onToggle:()=>s(!t)})]})]})}function R(){var e;let{fetchDetailImpl:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null!=(e=(0,s.useSearchParams)().get("capsuleId"))?e:"",{data:c,loadStatus:o,loadError:d,reload:p}=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.rw,[n,a]=(0,t.useState)(null),[s,c]=(0,t.useState)("loading"),[o,d]=(0,t.useState)(null),u=(0,t.useCallback)(async()=>{if(""===e){a(null),d("No capsule selected."),c("error");return}c("loading"),d(null);try{let n=await l(e);a(n),c("ready")}catch(e){d(e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred."),c("error")}},[e,l]);return(0,t.useEffect)(()=>{u()},[u]),{data:n,loadStatus:s,loadError:o,reload:function(){u()}}}(n,l);return"loading"===o?(0,a.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading capsule…"}):"error"===o||null===c?(0,a.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[null!=d?d:"Failed to load capsule.",(0,a.jsx)("button",{type:"button",onClick:p,"aria-label":"Retry loading capsule detail",className:"lk-alert-retry",children:"Retry"})]}):(0,a.jsxs)("div",{className:"lkd-content",children:[(0,a.jsxs)("header",{className:"lk-header",children:[(0,a.jsx)("h1",{className:"lk-title",children:c.capsule.displayName}),(0,a.jsx)(h,{capsuleId:n,displayName:c.capsule.displayName,...void 0!==c.capsule.description?{description:c.capsule.description}:{},onRenamed:p}),(0,a.jsx)(u,{capsuleId:n,capsuleDisplayName:c.capsule.displayName,sourceCount:c.sources.length,lifecycleState:c.capsule.lifecycleState,onActionComplete:p})]}),(0,a.jsx)(k,{data:c}),(0,a.jsx)(j,{}),(0,a.jsx)(y,{sources:c.sources}),(0,a.jsx)(S,{diagnostics:c.parserDiagnostics}),(0,a.jsx)(D,{jobs:c.indexingJobs})]})}}},e=>{e.O(0,[982,587,18,358],()=>e(e.s=8178)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[211],{419:(e,n,l)=>{Promise.resolve().then(l.bind(l,9460))},7541:(e,n,l)=>{"use strict";var a=l(3041);l.o(a,"useRouter")&&l.d(n,{useRouter:function(){return a.useRouter}}),l.o(a,"useSearchParams")&&l.d(n,{useSearchParams:function(){return a.useSearchParams}})},9389:(e,n,l)=>{"use strict";l.d(n,{FG:()=>b,H9:()=>g,KS:()=>y,Qi:()=>h,R3:()=>o,Tq:()=>m,WM:()=>d,qY:()=>r,r:()=>p,rw:()=>f,xY:()=>x,xr:()=>c,yN:()=>u});var a=l(2982);function t(e,n){let l={Accept:"application/json"};return null!=n&&(l["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(l["X-Keiko-CSRF"]="1"),l}async function s(e){try{let n=await e.json();return{code:n.error.code,message:n.error.message}}catch(n){return{code:"INTERNAL",message:"HTTP ".concat(e.status.toString())}}}async function i(e,n){var l;let i=(null!=(l=null==n?void 0:n.method)?l:"GET").toUpperCase(),c=await fetch(e,{...n,headers:t(i,null==n?void 0:n.body)});if(!c.ok){let{code:e,message:n}=await s(c);throw new a.hD(e,n,c.status)}if(204!==c.status)return c.json()}async function c(){return i("/api/local-knowledge/capsules")}async function o(){return i("/api/local-knowledge/capsule-sets")}async function r(e){return i("/api/local-knowledge/capsules",{method:"POST",body:JSON.stringify(e)})}async function d(e){return i("/api/local-knowledge/capsule-sets",{method:"POST",body:JSON.stringify(e)})}async function u(e,n){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e)),{method:"PATCH",body:JSON.stringify(n)})}async function p(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/index"),{method:"POST",body:JSON.stringify({confirm:!0})})}async function m(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/index"),{method:"DELETE",body:JSON.stringify({confirm:!0})})}async function b(e,n,l){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/connection"),{method:"POST",body:JSON.stringify({scope:n,displayName:l})})}async function h(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/connection"),{method:"DELETE",body:JSON.stringify({confirm:!0})})}async function f(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fetch,l="/api/local-knowledge/capsules/".concat(encodeURIComponent(e)),i=await n(l,{headers:t("GET",void 0)});if(!i.ok){let{code:e,message:n}=await s(i);throw new a.hD(e,n,i.status)}return i.json()}async function g(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e)),{method:"DELETE",body:JSON.stringify({deleteIndex:!0,deleteSources:!1})})}async function y(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/reindex"),{method:"POST",body:JSON.stringify({mode:"changed-files"})})}async function x(e){return i("/api/local-knowledge/capsules/".concat(encodeURIComponent(e),"/reindex"),{method:"POST",body:JSON.stringify({mode:"repair-failed"})})}},9460:(e,n,l)=>{"use strict";l.d(n,{ConnectorGraph:()=>E});var a=l(4568),t=l(7509),s=l(7620);let i={draft:"Draft",indexing:"Indexing",ready:"Indexed",stale:"Stale",deleting:"Deleting",error:"Failed"};var c=l(7541),o=l(9389),r=l(2982);function d(e){return e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred."}function u(e){return Array.from(e.querySelectorAll("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"))}function p(e){let{capsule:n,checked:l,disabled:t,onToggle:s}=e;return(0,a.jsx)("li",{className:"lk-compose-member",children:(0,a.jsxs)("label",{className:"lk-compose-member-label",children:[(0,a.jsx)("input",{type:"checkbox",checked:l,disabled:t,onChange:()=>s(n.id)}),(0,a.jsx)("span",{className:"lk-compose-member-name",children:n.displayName}),(0,a.jsx)("span",{className:"lk-badge","data-state":n.lifecycleState,children:n.lifecycleState})]})})}function m(e){let{capsules:n,onCancel:l,onCreated:i,createImpl:c=o.WM}=e,d=(0,s.useId)(),m=(0,s.useId)(),b=(0,s.useRef)(null),[h,f]=(0,s.useState)(""),[g,y]=(0,s.useState)(new Set),[x,k]=(0,s.useState)(!1),[j,v]=(0,s.useState)(null);function C(e){y(n=>{let l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),null!==j&&v(null)}async function N(e){var n;e.preventDefault();let l=(n=g.size,0===h.trim().length?"Set name is required.":0===n?"Select at least one capsule to combine.":n>16?"A set can hold at most ".concat("16"," capsules."):null);if(null!==l)return void v(l);k(!0),v(null);try{await c({displayName:h.trim(),capsuleIds:[...g]}),i()}catch(e){v(e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred.")}finally{k(!1)}}return(0,s.useEffect)(()=>{var e;let n=b.current;if(null===n)return;let a=document.activeElement;function t(e){if("Escape"===e.key&&!x){e.preventDefault(),l();return}if("Tab"!==e.key)return;let a=u(n);if(0===a.length)return;let t=a[0],s=a[a.length-1];e.shiftKey&&document.activeElement===t?(e.preventDefault(),null==s||s.focus()):e.shiftKey||document.activeElement!==s||(e.preventDefault(),null==t||t.focus())}return null==(e=u(n)[0])||e.focus(),n.addEventListener("keydown",t),()=>{var e;n.removeEventListener("keydown",t),null==a||null==(e=a.focus)||e.call(a)}},[b,x,l]),(0,t.createPortal)((0,a.jsx)("div",{className:"mc-dialog-backdrop",role:"presentation",children:(0,a.jsxs)("div",{ref:b,className:"mc-dialog",role:"dialog","aria-modal":"true","aria-labelledby":d,children:[(0,a.jsx)("h2",{id:d,className:"mc-dialog-title",children:"Combine capsules into a set"}),(0,a.jsxs)("form",{onSubmit:e=>void N(e),children:[(0,a.jsxs)("label",{className:"mc-dialog-field",htmlFor:m,children:[(0,a.jsx)("span",{className:"mc-dialog-label",children:"Set name"}),(0,a.jsx)("input",{id:m,className:"mc-dialog-input",value:h,disabled:x,autoComplete:"off",onChange:e=>{f(e.target.value),null!==j&&v(null)}})]}),(0,a.jsxs)("fieldset",{className:"lk-compose-fieldset",disabled:x,children:[(0,a.jsxs)("legend",{className:"mc-dialog-label",children:["Capsules (",g.size.toString(),"/","16",")"]}),0===n.length?(0,a.jsx)("p",{className:"lkd-empty-note",children:"No capsules available to combine."}):(0,a.jsx)("ul",{className:"lk-compose-member-list","aria-label":"Selectable capsules",children:n.map(e=>(0,a.jsx)(p,{capsule:e,checked:g.has(e.id),disabled:x,onToggle:C},e.id))})]}),null!==j?(0,a.jsx)("div",{role:"alert","aria-live":"assertive",className:"mc-dialog-error",children:j}):null,(0,a.jsxs)("div",{className:"mc-dialog-actions",children:[(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:x,onClick:l,children:"Cancel"}),(0,a.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:x,"aria-busy":x,children:x?"Combining…":"Create set"})]})]})]})}),document.body)}function b(e){let{message:n,onRetry:l}=e;return(0,a.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[n,void 0!==l?(0,a.jsx)("button",{type:"button",onClick:l,"aria-label":"Retry loading capsules",className:"lk-alert-retry",children:"Retry"}):null]})}function h(e){let{busy:n,error:l,onCancel:i,onSubmit:c}=e,o=(0,s.useId)(),r=(0,s.useId)(),d=(0,s.useId)(),u=(0,s.useRef)(null),p=(0,s.useRef)(null),m=(0,s.useRef)(null),[b,h]=(0,s.useState)(""),[f,g]=(0,s.useState)(null);async function y(e){e.preventDefault();let n=b.trim();if(0===n.length)return void g("Capsule display name is required.");g(null),await c(n)}(0,s.useEffect)(()=>{var e;return m.current=document.activeElement,null==(e=p.current)||e.focus(),()=>{var e,n;null==(n=m.current)||null==(e=n.focus)||e.call(n)}},[]),(0,s.useEffect)(()=>{let e=u.current;if(null===e)return;let l=l=>{if("Escape"===l.key&&!n){l.preventDefault(),i();return}if("Tab"!==l.key)return;let a=Array.from(e.querySelectorAll("button:not([disabled]),input:not([disabled]),textarea:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex='-1'])"));if(0===a.length)return;let t=a[0],s=a[a.length-1];l.shiftKey&&document.activeElement===t?(l.preventDefault(),null==s||s.focus()):l.shiftKey||document.activeElement!==s||(l.preventDefault(),null==t||t.focus())};return e.addEventListener("keydown",l),()=>e.removeEventListener("keydown",l)},[n,i]);let x=null!=f?f:l;return(0,t.createPortal)((0,a.jsx)("div",{className:"mc-dialog-backdrop",role:"presentation",children:(0,a.jsxs)("div",{ref:u,className:"mc-dialog",role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-describedby":r,children:[(0,a.jsx)("h2",{id:o,className:"mc-dialog-title",children:"Create capsule"}),(0,a.jsx)("p",{id:r,className:"mc-dialog-body",children:"Name the knowledge capsule before Keiko creates and indexes it."}),(0,a.jsxs)("form",{onSubmit:e=>void y(e),children:[(0,a.jsxs)("label",{className:"mc-dialog-field",htmlFor:d,children:[(0,a.jsx)("span",{className:"mc-dialog-label",children:"Capsule display name"}),(0,a.jsx)("input",{id:d,ref:p,className:"mc-dialog-input",value:b,disabled:n,autoComplete:"off",onChange:e=>{h(e.target.value),null!==f&&g(null)}})]}),null!==x?(0,a.jsx)("div",{className:"mc-dialog-error",children:x}):null,(0,a.jsxs)("div",{className:"mc-dialog-actions",children:[(0,a.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:n,onClick:i,children:"Cancel"}),(0,a.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:n,children:n?"Creating…":"Create capsule"})]})]})]})}),document.body)}function f(){return(0,a.jsx)("svg",{"aria-hidden":"true",focusable:"false",width:"40",height:"24",viewBox:"0 0 40 24",style:{flexShrink:0,alignSelf:"center"},children:(0,a.jsx)("path",{d:"M2 12 H32 M28 6 L38 12 L28 18",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:"0.7"})})}let g={"files-window":"\uD83D\uDCC2","local-knowledge":"\uD83E\uDDE0","capsule-pool":"⬡","conversation-center":"\uD83D\uDCAC"};function y(e){let{kind:n,label:l,sublabel:t,connected:s=!1}=e;return(0,a.jsxs)("div",{role:"listitem",className:"lk-node","data-connected":String(s),children:[(0,a.jsx)("span",{"aria-hidden":"true",className:"lk-node-icon",children:g[n]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"lk-node-label",children:l}),void 0!==t?(0,a.jsx)("div",{className:"lk-node-sub",children:t}):null]})]})}function x(e){var n;let{capsules:l,isLoading:t}=e,s=l.some(e=>"ready"===e.lifecycleState),i=l.length>0;return(0,a.jsx)("section",{"aria-label":"Connector pipeline diagram",style:{flexShrink:0},children:(0,a.jsxs)("div",{role:"list","aria-label":"Pipeline nodes",className:"lk-pipeline",children:[(0,a.jsx)(y,{kind:"files-window",label:"Files Window",sublabel:"Source",connected:i}),(0,a.jsx)(f,{}),(0,a.jsx)(y,{kind:"local-knowledge",label:"Local Knowledge",sublabel:"Connector",connected:i}),(0,a.jsx)(f,{}),(0,a.jsx)(y,{kind:"capsule-pool",label:"Capsules",sublabel:(n=l.length,t?"Loading…":0===n?"No capsules":"".concat(n.toString()," capsule").concat(1===n?"":"s")),connected:i}),(0,a.jsx)(f,{}),(0,a.jsx)(y,{kind:"conversation-center",label:"Conversation Center",sublabel:"Consumer",connected:s})]})})}function k(e){let{state:n}=e;return(0,a.jsx)("span",{role:"status","aria-live":"polite","aria-label":"Status: ".concat(i[n]),className:"lk-badge","data-state":n,children:i[n]})}function j(e){let{capsule:n,busy:l,onStart:t,onCancel:s}=e,{id:i,displayName:c,lifecycleState:o}=n;return"indexing"===o?(0,a.jsx)("button",{type:"button",disabled:l,"aria-label":"Cancel indexing for capsule ".concat(c),onClick:()=>{s(i)},className:"lk-btn lk-btn-ghost",children:"Cancel"}):(0,a.jsx)("button",{type:"button",disabled:l,"aria-label":"Start indexing capsule ".concat(c),onClick:()=>{t(i)},className:"lk-btn lk-btn-primary",children:"Index"})}function v(e){let{capsule:n,busy:l,onStart:t,onCancel:s,onDisconnect:i,onHealth:c}=e,{id:o,displayName:r}=n;return(0,a.jsxs)("div",{role:"group","aria-label":"Actions for capsule ".concat(r),className:"lk-capsule-actions",children:[(0,a.jsx)(j,{capsule:n,busy:l,onStart:t,onCancel:s}),(0,a.jsx)("button",{type:"button",disabled:l,"aria-label":"Open health view for capsule ".concat(r),onClick:()=>{c(o)},className:"lk-btn lk-btn-ghost",children:"Health"}),(0,a.jsx)("button",{type:"button",disabled:l,"aria-label":"Disconnect capsule ".concat(r),onClick:()=>{i(o)},className:"lk-btn lk-btn-danger",children:"Disconnect"})]})}function C(e){let{capsule:n,busy:l,onStart:t,onCancel:s,onDisconnect:i,onHealth:c}=e;return(0,a.jsxs)("article",{"aria-label":"Capsule: ".concat(n.displayName),className:"lk-capsule-row",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:"lk-capsule-icon",children:"⬡"}),(0,a.jsxs)("div",{className:"lk-capsule-info",children:[(0,a.jsx)("div",{className:"lk-capsule-name",children:n.displayName}),(0,a.jsx)(k,{state:n.lifecycleState})]}),(0,a.jsx)(v,{capsule:n,busy:l,onStart:t,onCancel:s,onDisconnect:i,onHealth:c})]})}function N(e){let{creating:n,onCreateCapsule:l}=e;return(0,a.jsxs)("div",{"data-testid":"empty-state",className:"lk-empty",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:"lk-empty-icon",children:"⬡"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"lk-empty-title",children:"No capsules yet"}),(0,a.jsx)("p",{className:"lk-empty-body",children:"Create a capsule to start indexing your local knowledge sources."})]}),(0,a.jsx)("button",{type:"button",disabled:n,"aria-label":"Create your first knowledge capsule",onClick:l,className:"lk-btn lk-btn-primary lk-btn-xl",children:n?"Creating…":"Create your first capsule"}),(0,a.jsx)("button",{type:"button",disabled:!0,"aria-label":"Connect to an existing capsule",title:"Existing-capsule connection is unavailable until the Local Knowledge BFF is wired.",className:"lk-btn lk-btn-ghost lk-btn-lg",children:"Connect to existing capsule"})]})}function S(e){let{capsules:n,isLoading:l,creating:t,actionBusy:s,onCreateCapsule:i,onStartIndexing:c,onCancelIndexing:o,onDisconnect:r,onOpenHealth:d}=e;return l?(0,a.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading capsules…"}):0===n.length?(0,a.jsx)(N,{creating:t,onCreateCapsule:i}):(0,a.jsx)("ul",{"aria-label":"Knowledge capsule list",style:{display:"flex",flexDirection:"column",gap:8,listStyle:"none",padding:0,margin:0},children:n.map(e=>(0,a.jsx)("li",{style:{display:"block"},children:(0,a.jsx)(C,{capsule:e,busy:s===e.id,onStart:c,onCancel:o,onDisconnect:r,onHealth:d})},e.id))})}function w(e){let{creating:n,createDialogOpen:l,combineDialogOpen:t,combineDisabled:s,loadStatus:i,loadError:c,actionError:o,createError:r,reload:d,onCreateCapsule:u,onCombineCapsules:p}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("header",{className:"lk-header",children:[(0,a.jsx)("h1",{className:"lk-title",children:"Local Knowledge Connector"}),(0,a.jsxs)("div",{className:"lk-header-actions",children:[(0,a.jsx)("button",{type:"button",disabled:s,"aria-label":"Combine capsules into a set","aria-haspopup":"dialog","aria-expanded":t,title:s?"Create capsules first, then combine them into a set.":void 0,onClick:p,className:"lk-btn lk-btn-ghost lk-btn-lg",children:"Combine capsules"}),(0,a.jsx)("button",{type:"button",disabled:n,"aria-label":"Create a new knowledge capsule","aria-haspopup":"dialog","aria-expanded":l,onClick:u,className:"lk-btn lk-btn-primary lk-btn-lg",children:n?"Creating…":"Create capsule"})]})]}),"error"===i&&null!==c?(0,a.jsx)(b,{message:c,onRetry:d}):null,null!==r?(0,a.jsx)(b,{message:r}):null,null!==o?(0,a.jsx)(b,{message:o}):null]})}function E(e){let{capsules:n,loadStatus:l,loadError:t,actionBusy:i,actionError:r,creating:u,createError:p,reload:b,handleStartIndexing:f,handleCancelIndexing:g,handleDisconnect:y,handleOpenHealth:k,handleCreateCapsule:j}=function(e){let{fetchCapsulesImpl:n=o.xr,createCapsuleImpl:l=o.qY,startIndexingImpl:a=o.r,cancelIndexingImpl:t=o.Tq,disconnectCapsuleImpl:i=o.Qi}=e,{capsules:r,loadStatus:u,loadError:p,reload:m}=function(e){let[n,l]=(0,s.useState)([]),[a,t]=(0,s.useState)("loading"),[i,c]=(0,s.useState)(null),o=(0,s.useCallback)(async()=>{t("loading"),c(null);try{let n=await e();l(n.capsules),t("ready")}catch(e){c(d(e)),t("error")}},[e]);return(0,s.useEffect)(()=>{o()},[o]),{capsules:n,loadStatus:a,loadError:i,reload:function(){o()}}}(n),{actionBusy:b,actionError:h,handleStartIndexing:f,handleCancelIndexing:g,handleDisconnect:y,handleOpenHealth:x}=function(e,n,l,a){let t=(0,c.useRouter)(),[i,o]=(0,s.useState)(null),[r,u]=(0,s.useState)(null);async function p(n,l){o(n),u(null);try{await l(),e()}catch(e){u(d(e))}finally{o(null)}}return{actionBusy:i,actionError:r,handleStartIndexing:function(e){p(e,()=>n(e))},handleCancelIndexing:function(e){p(e,()=>l(e))},handleDisconnect:function(e){p(e,()=>a(e))},handleOpenHealth:function(e){t.push("/local-knowledge/capsule?capsuleId=".concat(encodeURIComponent(e)))}}}(m,a,t,i),{creating:k,createError:j,handleCreateCapsule:v}=function(e,n){let[l,a]=(0,s.useState)(!1),[t,i]=(0,s.useState)(null);return{creating:l,createError:t,handleCreateCapsule:async function(l){a(!0),i(null);try{await e({displayName:l}),n()}catch(e){i(d(e))}finally{a(!1)}}}}(l,m);return{capsules:r,loadStatus:u,loadError:p,actionBusy:b,actionError:h,creating:k,createError:j,reload:m,handleStartIndexing:f,handleCancelIndexing:g,handleDisconnect:y,handleOpenHealth:x,handleCreateCapsule:v}}(e),v="loading"===l,[C,N]=(0,s.useState)(!1),[E,D]=(0,s.useState)(!1);async function I(e){try{await j(e),N(!1)}catch(e){}}return(0,a.jsxs)("div",{className:"lk-page",children:[(0,a.jsx)(w,{creating:u,createDialogOpen:C,combineDialogOpen:E,combineDisabled:v||0===n.length,loadStatus:l,loadError:t,actionError:r,createError:p,reload:b,onCreateCapsule:()=>N(!0),onCombineCapsules:()=>D(!0)}),(0,a.jsx)(x,{capsules:n,isLoading:v}),(0,a.jsxs)("section",{"aria-label":"Knowledge capsules","aria-live":"polite","aria-busy":v,style:{flex:1,minHeight:0,overflowY:"auto"},children:[(0,a.jsx)("h2",{className:"lk-section-head",children:"Knowledge Capsules"}),(0,a.jsx)(S,{capsules:n,isLoading:v,creating:u,actionBusy:i,onCreateCapsule:()=>N(!0),onStartIndexing:f,onCancelIndexing:g,onDisconnect:y,onOpenHealth:k})]}),C?(0,a.jsx)(h,{busy:u,error:p,onCancel:()=>N(!1),onSubmit:I}):null,E?(0,a.jsx)(m,{capsules:n,onCancel:()=>D(!1),onCreated:function(){D(!1),b()}}):null]})}}},e=>{e.O(0,[982,587,18,358],()=>e(e.s=419)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[976],{1352:(e,n,t)=>{"use strict";t.d(n,{Af:()=>o,CZ:()=>h,Ir:()=>a,RT:()=>b,Rx:()=>m,W_:()=>u,ax:()=>g,fC:()=>c,h0:()=>v,hz:()=>y,mc:()=>j,oW:()=>x,tR:()=>d,w0:()=>p,xr:()=>i});var l=t(2982);async function r(e){try{let n=await e.json();return{code:n.error.code,message:n.error.message}}catch(n){return{code:"INTERNAL",message:"HTTP ".concat(e.status.toString())}}}async function s(e,n){var t;let s=(null!=(t=null==n?void 0:n.method)?t:"GET").toUpperCase(),o=null==n?void 0:n.body,i=await fetch(e,{...n,headers:function(e,n){let t={Accept:"application/json"};return null!=n&&(t["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(t["X-Keiko-CSRF"]="1"),t}(s,o)});if(!i.ok){let{code:e,message:n}=await r(i);throw new l.hD(e,n,i.status)}return i.json()}async function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,t=new URLSearchParams;void 0!==e.scope&&e.scope.length>0&&t.set("scope",e.scope.join(",")),void 0!==e.type&&e.type.length>0&&t.set("type",e.type.join(",")),void 0!==e.status&&e.status.length>0&&t.set("status",e.status.join(",")),void 0!==e.sensitivity&&e.sensitivity.length>0&&t.set("sensitivity",e.sensitivity.join(",")),void 0!==e.limit&&t.set("limit",e.limit.toString()),void 0!==e.offset&&t.set("offset",e.offset.toString());let l=t.toString();return n("/api/memory".concat(l.length>0?"?".concat(l):""))}async function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return e("/api/memory/review-queue")}async function a(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/consolidation/jobs",{method:"POST",body:JSON.stringify({settings:e})})}async function d(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e)))}async function c(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e),"/cancel"),{method:"POST",body:"{}"})}async function u(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/".concat(encodeURIComponent(e)))}async function p(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return t("/api/memory/".concat(encodeURIComponent(e)),{method:"PATCH",body:JSON.stringify(n)})}async function m(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/".concat(encodeURIComponent(e),"/pin"),{method:"POST",body:"{}"})}async function h(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/".concat(encodeURIComponent(e),"/unpin"),{method:"POST",body:"{}"})}async function g(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return t("/api/memory/".concat(encodeURIComponent(e),"/archive"),{method:"POST",body:JSON.stringify({...void 0!==n?{reason:n}:{}})})}async function y(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return t("/api/memory/".concat(encodeURIComponent(e),"/forget"),{method:"POST",body:JSON.stringify({acknowledged:!0,...void 0!==n?{reason:n}:{}})})}async function v(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/".concat(encodeURIComponent(e)),{method:"DELETE",body:"{}"})}async function x(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return t("/api/memory/".concat(encodeURIComponent(e),"/correct"),{method:"POST",body:JSON.stringify({body:n})})}async function j(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/proposals/".concat(encodeURIComponent(e),"/accept"),{method:"POST",body:"{}"})}async function b(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return t("/api/memory/proposals/".concat(encodeURIComponent(e),"/reject"),{method:"POST",body:JSON.stringify({...void 0!==n?{reason:n}:{}})})}},4984:(e,n,t)=>{Promise.resolve().then(t.bind(t,9784))},9784:(e,n,t)=>{"use strict";t.d(n,{MemoryConsolidation:()=>h});var l=t(4568),r=t(7620),s=t(9664),o=t.n(s),i=t(1352),a=t(2982);let d={jaccardThreshold:.85,staleConfidenceThreshold:.3,maxAgeMs:7776e6,maxClustersPerRun:100};function c(e){return e instanceof a.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred."}function u(e){return"completed"===e||"failed"===e||"canceled"===e||"skipped"===e}function p(e){return void 0===e?"—":new Date(e).toLocaleString()}function m(e){let{label:n,name:t,value:r,min:s,max:o,step:i,help:a,disabled:d=!1,onChange:c}=e;return(0,l.jsxs)("label",{style:{display:"grid",gap:6},children:[(0,l.jsx)("span",{style:{fontWeight:600},children:n}),(0,l.jsx)("input",{type:"number",inputMode:"decimal",className:"lk-input",name:t,value:Number.isFinite(r)?r:"",min:s,max:o,step:i,disabled:d,onChange:e=>{c(t,Number(e.target.value))}}),(0,l.jsx)("span",{style:{color:"var(--muted)",fontSize:12},children:a})]})}function h(e){var n,t,s,a,h,g;let{startJobImpl:y=i.Ir,fetchJobImpl:v=i.tR,cancelJobImpl:x=i.fC,pollIntervalMs:j=2e3}=e,[b,f]=(0,r.useState)(d),[C,S]=(0,r.useState)(null),[k,w]=(0,r.useState)(!1),[N,R]=(0,r.useState)(!1),[I,T]=(0,r.useState)(!1),[P,A]=(0,r.useState)(null),[M,O]=(0,r.useState)(null),E=null!=(s=null==C?void 0:C.job)?s:null,U=null!==E&&!u(E.state),z=(0,r.useMemo)(()=>{var e,n,t;if(null===E)return null;let l=E.result;return{reviewCount:null!=(e=null==l?void 0:l.reviewItems.length)?e:0,staleCount:null!=(n=null==l?void 0:l.staleFlags.length)?n:0,edgeCount:null!=(t=null==l?void 0:l.edgesProposed.length)?t:0}},[E]),F=(0,r.useCallback)((e,n)=>{f(t=>({...t,[e]:n}))},[]),J=(0,r.useCallback)(async e=>{R(!0);try{let n=await v(e);S(n.job),O(null)}catch(e){O(c(e))}finally{R(!1)}},[v]);(0,r.useEffect)(()=>{if(null===E||u(E.state))return;let e=window.setInterval(()=>{J(E.id)},j);return()=>{window.clearInterval(e)}},[E,j,J]);let D=(0,r.useCallback)(async e=>{e.preventDefault(),w(!0),A(null),O(null);try{let e=await y(b);S(e.job)}catch(e){A(c(e))}finally{w(!1)}},[b,y]),_=(0,r.useCallback)(async()=>{if(null!==E){T(!0),O(null);try{let e=await x(E.id);S(e.job)}catch(e){O(c(e))}finally{T(!1)}}},[E,x]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("header",{className:"lk-header",children:[(0,l.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,l.jsx)("h1",{className:"lk-title",children:"MemoriaViva Consolidation"}),(0,l.jsx)("p",{style:{margin:0,color:"var(--muted)"},children:"Start a bounded consolidation job, inspect its output, and cancel it while it is still queued or running."})]}),(0,l.jsx)(o(),{href:"/memoriaviva",className:"lk-btn lk-btn-ghost lk-btn-lg",children:"Back to MemoriaViva"})]}),(0,l.jsx)("section",{"aria-label":"Consolidation settings",style:{display:"grid",gap:16,padding:16,border:"1px solid var(--border)",borderRadius:16,background:"var(--panel)"},children:(0,l.jsxs)("form",{onSubmit:D,style:{display:"grid",gap:16},children:[(0,l.jsxs)("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))"},children:[(0,l.jsx)(m,{label:"Jaccard threshold",name:"jaccardThreshold",value:b.jaccardThreshold,min:0,max:1,step:.01,disabled:k||U,help:"Similarity floor for near-duplicate detection.",onChange:F}),(0,l.jsx)(m,{label:"Stale confidence threshold",name:"staleConfidenceThreshold",value:b.staleConfidenceThreshold,min:0,max:1,step:.01,disabled:k||U,help:"Memories at or below this confidence are flagged stale.",onChange:F}),(0,l.jsx)(m,{label:"Max age (ms)",name:"maxAgeMs",value:b.maxAgeMs,min:0,step:1e3,disabled:k||U,help:"Current value: ".concat(function(e){let n=e/864e5;return Number.isInteger(n)?"".concat(n.toString()," days"):"".concat(n.toFixed(1)," days")}(b.maxAgeMs),"."),onChange:F}),(0,l.jsx)(m,{label:"Max clusters per run",name:"maxClustersPerRun",value:b.maxClustersPerRun,min:0,step:1,disabled:k||U,help:"Hard bound on duplicate clusters inspected in one run.",onChange:F})]}),null!==P?(0,l.jsx)("div",{role:"alert",className:"lk-alert",children:P}):null,(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:12},children:[(0,l.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:k||U,children:k?"Starting…":"Start consolidation"}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null===E||N,onClick:()=>{null!==E&&J(E.id)},children:N?"Refreshing…":"Refresh status"}),U?(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:I,onClick:()=>{_()},children:I?"Canceling…":"Cancel job"}):null]})]})}),(0,l.jsx)("section",{"aria-label":"Consolidation job status","aria-live":"polite",style:{display:"grid",gap:16,padding:16,border:"1px solid var(--border)",borderRadius:16,background:"var(--panel)"},children:null===E?(0,l.jsx)("p",{style:{margin:0,color:"var(--muted)"},children:"No consolidation job started yet."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))"},children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"State"}),(0,l.jsx)("div",{role:"status",style:{fontWeight:700,textTransform:"capitalize"},children:E.state})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Job ID"}),(0,l.jsx)("div",{style:{wordBreak:"break-all"},children:E.id})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Started"}),(0,l.jsx)("div",{children:p(E.startedAt)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Completed"}),(0,l.jsx)("div",{children:p(E.completedAt)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Clusters inspected"}),(0,l.jsx)("div",{children:null!=(a=null==(n=E.result)?void 0:n.clustersInspected)?a:0})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Elapsed (ms)"}),(0,l.jsx)("div",{children:null!=(h=null==(t=E.result)?void 0:t.elapsedMs)?h:0})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Memories loaded"}),(0,l.jsx)("div",{children:null!=(g=null==C?void 0:C.memoryCount)?g:0})]})]}),null!==M?(0,l.jsx)("div",{role:"alert",className:"lk-alert",children:M}):null,void 0!==E.error&&E.error.length>0?(0,l.jsx)("div",{role:"alert",className:"lk-alert",children:E.error}):null,null!==z?(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:12},children:[(0,l.jsxs)("span",{className:"mc-badge mc-badge-default",children:[z.reviewCount.toString()," review items"]}),(0,l.jsxs)("span",{className:"mc-badge mc-badge-default",children:[z.staleCount.toString()," stale flags"]}),(0,l.jsxs)("span",{className:"mc-badge mc-badge-default",children:[z.edgeCount.toString()," proposed edges"]})]}):null]})}),(null==E?void 0:E.result)!==void 0?(0,l.jsxs)("section",{"aria-label":"Consolidation results",style:{display:"grid",gap:16,gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))"},children:[(0,l.jsxs)("article",{style:{display:"grid",gap:12,padding:16,border:"1px solid var(--border)",borderRadius:16,background:"var(--panel)"},children:[(0,l.jsx)("h2",{style:{margin:0},children:"Review Items"}),0===E.result.reviewItems.length?(0,l.jsx)("p",{style:{margin:0,color:"var(--muted)"},children:"No review items returned."}):(0,l.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"grid",gap:12},children:E.result.reviewItems.map(e=>(0,l.jsxs)("li",{style:{display:"grid",gap:4},children:[(0,l.jsx)("strong",{style:{textTransform:"capitalize"},children:e.reason.replaceAll("-"," ")}),(0,l.jsx)("span",{children:e.relatedMemoryIds.join(", ")}),(0,l.jsx)("span",{style:{color:"var(--muted)"},children:void 0===e.proposedAction?"No automatic action proposed.":"merge"===e.proposedAction.kind?"Merge into ".concat(e.proposedAction.winner,"; replace ").concat(e.proposedAction.losers.join(", "),"."):"Supersede ".concat(e.proposedAction.older," with ").concat(e.proposedAction.newer,".")})]},e.id))})]}),(0,l.jsxs)("article",{style:{display:"grid",gap:12,padding:16,border:"1px solid var(--border)",borderRadius:16,background:"var(--panel)"},children:[(0,l.jsx)("h2",{style:{margin:0},children:"Stale Flags"}),0===E.result.staleFlags.length?(0,l.jsx)("p",{style:{margin:0,color:"var(--muted)"},children:"No stale flags returned."}):(0,l.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"grid",gap:12},children:E.result.staleFlags.map(e=>(0,l.jsx)("li",{children:"".concat(e.memoryId," — ").concat(e.reason)},"".concat(e.memoryId,":").concat(e.reason)))})]}),(0,l.jsxs)("article",{style:{display:"grid",gap:12,padding:16,border:"1px solid var(--border)",borderRadius:16,background:"var(--panel)"},children:[(0,l.jsx)("h2",{style:{margin:0},children:"Proposed Edges"}),0===E.result.edgesProposed.length?(0,l.jsx)("p",{style:{margin:0,color:"var(--muted)"},children:"No edges proposed."}):(0,l.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"grid",gap:12},children:E.result.edgesProposed.map(e=>(0,l.jsxs)("li",{style:{display:"grid",gap:4},children:[(0,l.jsx)("strong",{children:e.kind}),(0,l.jsxs)("span",{children:[e.fromMemoryId," → ",e.toMemoryId]}),void 0!==e.provenanceSummary?(0,l.jsx)("span",{style:{color:"var(--muted)"},children:e.provenanceSummary}):null]},e.id))})]})]}):null]})}}},e=>{e.O(0,[664,982,587,18,358],()=>e(e.s=4984)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[976],{1352:(e,n,t)=>{"use strict";t.d(n,{Af:()=>o,CZ:()=>h,Ir:()=>a,RT:()=>b,Rx:()=>m,W_:()=>u,ax:()=>g,fC:()=>c,h0:()=>v,hz:()=>y,mc:()=>j,oW:()=>x,tR:()=>d,w0:()=>p,xr:()=>i});var l=t(2982);async function r(e){try{let n=await e.json();return{code:n.error.code,message:n.error.message}}catch(n){return{code:"INTERNAL",message:"HTTP ".concat(e.status.toString())}}}async function s(e,n){var t;let s=(null!=(t=null==n?void 0:n.method)?t:"GET").toUpperCase(),o=null==n?void 0:n.body,i=await fetch(e,{...n,headers:function(e,n){let t={Accept:"application/json"};return null!=n&&(t["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(t["X-Keiko-CSRF"]="1"),t}(s,o)});if(!i.ok){let{code:e,message:n}=await r(i);throw new l.hD(e,n,i.status)}return i.json()}async function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,t=new URLSearchParams;void 0!==e.scope&&e.scope.length>0&&t.set("scope",e.scope.join(",")),void 0!==e.type&&e.type.length>0&&t.set("type",e.type.join(",")),void 0!==e.status&&e.status.length>0&&t.set("status",e.status.join(",")),void 0!==e.sensitivity&&e.sensitivity.length>0&&t.set("sensitivity",e.sensitivity.join(",")),void 0!==e.limit&&t.set("limit",e.limit.toString()),void 0!==e.offset&&t.set("offset",e.offset.toString());let l=t.toString();return n("/api/memory".concat(l.length>0?"?".concat(l):""))}async function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return e("/api/memory/review-queue")}async function a(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/consolidation/jobs",{method:"POST",body:JSON.stringify({settings:e})})}async function d(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e)))}async function c(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e),"/cancel"),{method:"POST",body:"{}"})}async function u(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/".concat(encodeURIComponent(e)))}async function p(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return t("/api/memory/".concat(encodeURIComponent(e)),{method:"PATCH",body:JSON.stringify(n)})}async function m(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/".concat(encodeURIComponent(e),"/pin"),{method:"POST",body:"{}"})}async function h(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/".concat(encodeURIComponent(e),"/unpin"),{method:"POST",body:"{}"})}async function g(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return t("/api/memory/".concat(encodeURIComponent(e),"/archive"),{method:"POST",body:JSON.stringify({...void 0!==n?{reason:n}:{}})})}async function y(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return t("/api/memory/".concat(encodeURIComponent(e),"/forget"),{method:"POST",body:JSON.stringify({acknowledged:!0,...void 0!==n?{reason:n}:{}})})}async function v(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/".concat(encodeURIComponent(e)),{method:"DELETE",body:"{}"})}async function x(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return t("/api/memory/".concat(encodeURIComponent(e),"/correct"),{method:"POST",body:JSON.stringify({body:n})})}async function j(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return n("/api/memory/proposals/".concat(encodeURIComponent(e),"/accept"),{method:"POST",body:"{}"})}async function b(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return t("/api/memory/proposals/".concat(encodeURIComponent(e),"/reject"),{method:"POST",body:JSON.stringify({...void 0!==n?{reason:n}:{}})})}},1601:(e,n,t)=>{Promise.resolve().then(t.bind(t,9784))},9784:(e,n,t)=>{"use strict";t.d(n,{MemoryConsolidation:()=>h});var l=t(4568),r=t(7620),s=t(9664),o=t.n(s),i=t(1352),a=t(2982);let d={jaccardThreshold:.85,staleConfidenceThreshold:.3,maxAgeMs:7776e6,maxClustersPerRun:100};function c(e){return e instanceof a.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred."}function u(e){return"completed"===e||"failed"===e||"canceled"===e||"skipped"===e}function p(e){return void 0===e?"—":new Date(e).toLocaleString()}function m(e){let{label:n,name:t,value:r,min:s,max:o,step:i,help:a,disabled:d=!1,onChange:c}=e;return(0,l.jsxs)("label",{style:{display:"grid",gap:6},children:[(0,l.jsx)("span",{style:{fontWeight:600},children:n}),(0,l.jsx)("input",{type:"number",inputMode:"decimal",className:"lk-input",name:t,value:Number.isFinite(r)?r:"",min:s,max:o,step:i,disabled:d,onChange:e=>{c(t,Number(e.target.value))}}),(0,l.jsx)("span",{style:{color:"var(--muted)",fontSize:12},children:a})]})}function h(e){var n,t,s,a,h,g;let{startJobImpl:y=i.Ir,fetchJobImpl:v=i.tR,cancelJobImpl:x=i.fC,pollIntervalMs:j=2e3}=e,[b,f]=(0,r.useState)(d),[C,S]=(0,r.useState)(null),[k,w]=(0,r.useState)(!1),[N,R]=(0,r.useState)(!1),[I,T]=(0,r.useState)(!1),[P,A]=(0,r.useState)(null),[M,O]=(0,r.useState)(null),E=null!=(s=null==C?void 0:C.job)?s:null,U=null!==E&&!u(E.state),z=(0,r.useMemo)(()=>{var e,n,t;if(null===E)return null;let l=E.result;return{reviewCount:null!=(e=null==l?void 0:l.reviewItems.length)?e:0,staleCount:null!=(n=null==l?void 0:l.staleFlags.length)?n:0,edgeCount:null!=(t=null==l?void 0:l.edgesProposed.length)?t:0}},[E]),F=(0,r.useCallback)((e,n)=>{f(t=>({...t,[e]:n}))},[]),J=(0,r.useCallback)(async e=>{R(!0);try{let n=await v(e);S(n.job),O(null)}catch(e){O(c(e))}finally{R(!1)}},[v]);(0,r.useEffect)(()=>{if(null===E||u(E.state))return;let e=window.setInterval(()=>{J(E.id)},j);return()=>{window.clearInterval(e)}},[E,j,J]);let D=(0,r.useCallback)(async e=>{e.preventDefault(),w(!0),A(null),O(null);try{let e=await y(b);S(e.job)}catch(e){A(c(e))}finally{w(!1)}},[b,y]),_=(0,r.useCallback)(async()=>{if(null!==E){T(!0),O(null);try{let e=await x(E.id);S(e.job)}catch(e){O(c(e))}finally{T(!1)}}},[E,x]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("header",{className:"lk-header",children:[(0,l.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,l.jsx)("h1",{className:"lk-title",children:"MemoriaViva Consolidation"}),(0,l.jsx)("p",{style:{margin:0,color:"var(--muted)"},children:"Start a bounded consolidation job, inspect its output, and cancel it while it is still queued or running."})]}),(0,l.jsx)(o(),{href:"/memoriaviva",className:"lk-btn lk-btn-ghost lk-btn-lg",children:"Back to MemoriaViva"})]}),(0,l.jsx)("section",{"aria-label":"Consolidation settings",style:{display:"grid",gap:16,padding:16,border:"1px solid var(--border)",borderRadius:16,background:"var(--panel)"},children:(0,l.jsxs)("form",{onSubmit:D,style:{display:"grid",gap:16},children:[(0,l.jsxs)("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))"},children:[(0,l.jsx)(m,{label:"Jaccard threshold",name:"jaccardThreshold",value:b.jaccardThreshold,min:0,max:1,step:.01,disabled:k||U,help:"Similarity floor for near-duplicate detection.",onChange:F}),(0,l.jsx)(m,{label:"Stale confidence threshold",name:"staleConfidenceThreshold",value:b.staleConfidenceThreshold,min:0,max:1,step:.01,disabled:k||U,help:"Memories at or below this confidence are flagged stale.",onChange:F}),(0,l.jsx)(m,{label:"Max age (ms)",name:"maxAgeMs",value:b.maxAgeMs,min:0,step:1e3,disabled:k||U,help:"Current value: ".concat(function(e){let n=e/864e5;return Number.isInteger(n)?"".concat(n.toString()," days"):"".concat(n.toFixed(1)," days")}(b.maxAgeMs),"."),onChange:F}),(0,l.jsx)(m,{label:"Max clusters per run",name:"maxClustersPerRun",value:b.maxClustersPerRun,min:0,step:1,disabled:k||U,help:"Hard bound on duplicate clusters inspected in one run.",onChange:F})]}),null!==P?(0,l.jsx)("div",{role:"alert",className:"lk-alert",children:P}):null,(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:12},children:[(0,l.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:k||U,children:k?"Starting…":"Start consolidation"}),(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null===E||N,onClick:()=>{null!==E&&J(E.id)},children:N?"Refreshing…":"Refresh status"}),U?(0,l.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:I,onClick:()=>{_()},children:I?"Canceling…":"Cancel job"}):null]})]})}),(0,l.jsx)("section",{"aria-label":"Consolidation job status","aria-live":"polite",style:{display:"grid",gap:16,padding:16,border:"1px solid var(--border)",borderRadius:16,background:"var(--panel)"},children:null===E?(0,l.jsx)("p",{style:{margin:0,color:"var(--muted)"},children:"No consolidation job started yet."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))"},children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"State"}),(0,l.jsx)("div",{role:"status",style:{fontWeight:700,textTransform:"capitalize"},children:E.state})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Job ID"}),(0,l.jsx)("div",{style:{wordBreak:"break-all"},children:E.id})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Started"}),(0,l.jsx)("div",{children:p(E.startedAt)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Completed"}),(0,l.jsx)("div",{children:p(E.completedAt)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Clusters inspected"}),(0,l.jsx)("div",{children:null!=(a=null==(n=E.result)?void 0:n.clustersInspected)?a:0})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Elapsed (ms)"}),(0,l.jsx)("div",{children:null!=(h=null==(t=E.result)?void 0:t.elapsedMs)?h:0})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{color:"var(--muted)",fontSize:12},children:"Memories loaded"}),(0,l.jsx)("div",{children:null!=(g=null==C?void 0:C.memoryCount)?g:0})]})]}),null!==M?(0,l.jsx)("div",{role:"alert",className:"lk-alert",children:M}):null,void 0!==E.error&&E.error.length>0?(0,l.jsx)("div",{role:"alert",className:"lk-alert",children:E.error}):null,null!==z?(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:12},children:[(0,l.jsxs)("span",{className:"mc-badge mc-badge-default",children:[z.reviewCount.toString()," review items"]}),(0,l.jsxs)("span",{className:"mc-badge mc-badge-default",children:[z.staleCount.toString()," stale flags"]}),(0,l.jsxs)("span",{className:"mc-badge mc-badge-default",children:[z.edgeCount.toString()," proposed edges"]})]}):null]})}),(null==E?void 0:E.result)!==void 0?(0,l.jsxs)("section",{"aria-label":"Consolidation results",style:{display:"grid",gap:16,gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))"},children:[(0,l.jsxs)("article",{style:{display:"grid",gap:12,padding:16,border:"1px solid var(--border)",borderRadius:16,background:"var(--panel)"},children:[(0,l.jsx)("h2",{style:{margin:0},children:"Review Items"}),0===E.result.reviewItems.length?(0,l.jsx)("p",{style:{margin:0,color:"var(--muted)"},children:"No review items returned."}):(0,l.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"grid",gap:12},children:E.result.reviewItems.map(e=>(0,l.jsxs)("li",{style:{display:"grid",gap:4},children:[(0,l.jsx)("strong",{style:{textTransform:"capitalize"},children:e.reason.replaceAll("-"," ")}),(0,l.jsx)("span",{children:e.relatedMemoryIds.join(", ")}),(0,l.jsx)("span",{style:{color:"var(--muted)"},children:void 0===e.proposedAction?"No automatic action proposed.":"merge"===e.proposedAction.kind?"Merge into ".concat(e.proposedAction.winner,"; replace ").concat(e.proposedAction.losers.join(", "),"."):"Supersede ".concat(e.proposedAction.older," with ").concat(e.proposedAction.newer,".")})]},e.id))})]}),(0,l.jsxs)("article",{style:{display:"grid",gap:12,padding:16,border:"1px solid var(--border)",borderRadius:16,background:"var(--panel)"},children:[(0,l.jsx)("h2",{style:{margin:0},children:"Stale Flags"}),0===E.result.staleFlags.length?(0,l.jsx)("p",{style:{margin:0,color:"var(--muted)"},children:"No stale flags returned."}):(0,l.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"grid",gap:12},children:E.result.staleFlags.map(e=>(0,l.jsx)("li",{children:"".concat(e.memoryId," — ").concat(e.reason)},"".concat(e.memoryId,":").concat(e.reason)))})]}),(0,l.jsxs)("article",{style:{display:"grid",gap:12,padding:16,border:"1px solid var(--border)",borderRadius:16,background:"var(--panel)"},children:[(0,l.jsx)("h2",{style:{margin:0},children:"Proposed Edges"}),0===E.result.edgesProposed.length?(0,l.jsx)("p",{style:{margin:0,color:"var(--muted)"},children:"No edges proposed."}):(0,l.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"grid",gap:12},children:E.result.edgesProposed.map(e=>(0,l.jsxs)("li",{style:{display:"grid",gap:4},children:[(0,l.jsx)("strong",{children:e.kind}),(0,l.jsxs)("span",{children:[e.fromMemoryId," → ",e.toMemoryId]}),void 0!==e.provenanceSummary?(0,l.jsx)("span",{style:{color:"var(--muted)"},children:e.provenanceSummary}):null]},e.id))})]})]}):null]})}}},e=>{e.O(0,[664,982,587,18,358],()=>e(e.s=1601)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[289],{1352:(e,t,l)=>{"use strict";l.d(t,{Af:()=>i,CZ:()=>h,Ir:()=>c,RT:()=>x,Rx:()=>b,W_:()=>u,ax:()=>y,fC:()=>d,h0:()=>g,hz:()=>p,mc:()=>v,oW:()=>f,tR:()=>r,w0:()=>m,xr:()=>o});var n=l(2982);async function a(e){try{let t=await e.json();return{code:t.error.code,message:t.error.message}}catch(t){return{code:"INTERNAL",message:"HTTP ".concat(e.status.toString())}}}async function s(e,t){var l;let s=(null!=(l=null==t?void 0:t.method)?l:"GET").toUpperCase(),i=null==t?void 0:t.body,o=await fetch(e,{...t,headers:function(e,t){let l={Accept:"application/json"};return null!=t&&(l["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(l["X-Keiko-CSRF"]="1"),l}(s,i)});if(!o.ok){let{code:e,message:t}=await a(o);throw new n.hD(e,t,o.status)}return o.json()}async function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,l=new URLSearchParams;void 0!==e.scope&&e.scope.length>0&&l.set("scope",e.scope.join(",")),void 0!==e.type&&e.type.length>0&&l.set("type",e.type.join(",")),void 0!==e.status&&e.status.length>0&&l.set("status",e.status.join(",")),void 0!==e.sensitivity&&e.sensitivity.length>0&&l.set("sensitivity",e.sensitivity.join(",")),void 0!==e.limit&&l.set("limit",e.limit.toString()),void 0!==e.offset&&l.set("offset",e.offset.toString());let n=l.toString();return t("/api/memory".concat(n.length>0?"?".concat(n):""))}async function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return e("/api/memory/review-queue")}async function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/consolidation/jobs",{method:"POST",body:JSON.stringify({settings:e})})}async function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e)))}async function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e),"/cancel"),{method:"POST",body:"{}"})}async function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/".concat(encodeURIComponent(e)))}async function m(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return l("/api/memory/".concat(encodeURIComponent(e)),{method:"PATCH",body:JSON.stringify(t)})}async function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/".concat(encodeURIComponent(e),"/pin"),{method:"POST",body:"{}"})}async function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/".concat(encodeURIComponent(e),"/unpin"),{method:"POST",body:"{}"})}async function y(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return l("/api/memory/".concat(encodeURIComponent(e),"/archive"),{method:"POST",body:JSON.stringify({...void 0!==t?{reason:t}:{}})})}async function p(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return l("/api/memory/".concat(encodeURIComponent(e),"/forget"),{method:"POST",body:JSON.stringify({acknowledged:!0,...void 0!==t?{reason:t}:{}})})}async function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/".concat(encodeURIComponent(e)),{method:"DELETE",body:"{}"})}async function f(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return l("/api/memory/".concat(encodeURIComponent(e),"/correct"),{method:"POST",body:JSON.stringify({body:t})})}async function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/proposals/".concat(encodeURIComponent(e),"/accept"),{method:"POST",body:"{}"})}async function x(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return l("/api/memory/proposals/".concat(encodeURIComponent(e),"/reject"),{method:"POST",body:JSON.stringify({...void 0!==t?{reason:t}:{}})})}},3149:(e,t,l)=>{"use strict";l.d(t,{MemoryDetailClient:()=>k});var n=l(4568),a=l(7541),s=l(7620),i=l(9664),o=l.n(i),c=l(1352),r=l(2982),d=l(8075);let u={public:"Public",confidential:"Confidential",restricted:"Restricted"};function m(e){let{record:t,mode:l="edit",onSave:a,onClose:i,editMemoryImpl:o=c.w0,correctMemoryImpl:m=c.oW}=e,[b,h]=(0,s.useState)(t.body),[y,p]=(0,s.useState)(t.tags.join(", ")),[g,f]=(0,s.useState)(t.provenance.sensitivity),[v,x]=(0,s.useState)(!1),[j,k]=(0,s.useState)(null),N=(0,s.useRef)(null),C=(0,s.useRef)(null),S=(0,s.useRef)(null),w=(0,s.useRef)(null),R=(0,s.useId)(),T="correct"===l;(0,s.useEffect)(()=>{var e;return w.current=document.activeElement instanceof HTMLElement?document.activeElement:null,null==(e=N.current)||e.focus(),()=>{var e;null==(e=w.current)||e.focus()}},[]);let E=(0,s.useCallback)(e=>{var t,l,n;if("Escape"===e.key)return void i();if("Tab"!==e.key)return;let a=null==(t=S.current)?void 0:t.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])');if(void 0===a||0===a.length){e.preventDefault(),null==(l=S.current)||l.focus();return}let s=a[0],o=a[a.length-1];if(void 0===s||void 0===o){e.preventDefault(),null==(n=S.current)||n.focus();return}let c=document.activeElement;e.shiftKey||c!==o?e.shiftKey&&c===s&&(e.preventDefault(),o.focus()):(e.preventDefault(),s.focus())},[i]),I=(0,s.useCallback)(e=>{e.target===C.current&&i()},[i]),D=(0,s.useCallback)(async()=>{let e=b.trim();if(0===e.length)return void k("Body cannot be empty.");let l=y.split(",").map(e=>e.trim()).filter(e=>e.length>0);x(!0),k(null);try{if(T){let l=await m(t.id,e);a(l.correction)}else{let n=await o(t.id,{body:e,tags:l,sensitivity:g});a(n.memory)}}catch(e){e instanceof r.hD?k("".concat(e.code,": ").concat(e.message)):e instanceof Error?k(e.message):k("An unexpected error occurred.")}finally{x(!1)}},[b,y,g,t.id,T,m,o,a]);return(0,n.jsx)("div",{ref:C,className:"mc-dialog-backdrop",role:"presentation",onClick:I,children:(0,n.jsxs)("div",{ref:S,role:"dialog","aria-modal":"true","aria-labelledby":R,tabIndex:-1,className:"mc-dialog",onKeyDown:E,children:[(0,n.jsx)("h2",{id:R,className:"mc-dialog-title",children:T?"Correct memory":"Edit memory"}),(0,n.jsxs)("div",{className:"mc-dialog-field",children:[(0,n.jsx)("label",{htmlFor:"edit-body",className:"mc-dialog-label",children:T?"Corrected body":"Body"}),(0,n.jsx)("textarea",{id:"edit-body",ref:N,className:"mc-dialog-textarea",value:b,rows:5,onChange:e=>{h(e.target.value)},disabled:v,"aria-required":"true"})]}),T?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mc-dialog-field",children:[(0,n.jsxs)("label",{htmlFor:"edit-tags",className:"mc-dialog-label",children:["Tags ",(0,n.jsx)("span",{className:"mc-dialog-hint",children:"(comma-separated)"})]}),(0,n.jsx)("input",{id:"edit-tags",type:"text",className:"mc-dialog-input",value:y,onChange:e=>{p(e.target.value)},disabled:v})]}),(0,n.jsxs)("div",{className:"mc-dialog-field",children:[(0,n.jsx)("label",{htmlFor:"edit-sensitivity",className:"mc-dialog-label",children:"Sensitivity"}),(0,n.jsx)("select",{id:"edit-sensitivity",className:"mc-dialog-select",value:g,onChange:e=>{f(e.target.value)},disabled:v,children:d.Iy.map(e=>(0,n.jsx)("option",{value:e,children:u[e]},e))})]})]}),null!==j?(0,n.jsx)("p",{role:"alert",className:"mc-dialog-error",children:j}):null,(0,n.jsxs)("div",{className:"mc-dialog-actions",children:[(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:i,disabled:v,children:"Cancel"}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",onClick:()=>{D()},disabled:v,"aria-busy":v,children:v?T?"Submitting…":"Saving…":T?"Submit correction":"Save"})]})]})})}function b(e){let{record:t,mode:l="forget",onComplete:a,onClose:i,forgetMemoryImpl:o=c.hz,deleteMemoryImpl:d=c.h0}=e,[u,m]=(0,s.useState)(!1),[b,h]=(0,s.useState)(null),y=(0,s.useRef)(null),p=(0,s.useRef)(null),g=(0,s.useRef)(null),f=(0,s.useRef)(null),v="delete"===l;(0,s.useEffect)(()=>{var e;return f.current=document.activeElement instanceof HTMLElement?document.activeElement:null,null==(e=y.current)||e.focus(),()=>{var e;null==(e=f.current)||e.focus()}},[]);let x=(0,s.useCallback)(e=>{var t,l,n;if("Escape"===e.key)return void i();if("Tab"!==e.key)return;let a=null==(t=g.current)?void 0:t.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])');if(void 0===a||0===a.length){e.preventDefault(),null==(l=g.current)||l.focus();return}let s=a[0],o=a[a.length-1];if(void 0===s||void 0===o){e.preventDefault(),null==(n=g.current)||n.focus();return}let c=document.activeElement;e.shiftKey||c!==o?e.shiftKey&&c===s&&(e.preventDefault(),o.focus()):(e.preventDefault(),s.focus())},[i]),j=(0,s.useCallback)(e=>{e.target===p.current&&i()},[i]),k=(0,s.useCallback)(async()=>{m(!0),h(null);try{v?await d(t.id):await o(t.id,"user-initiated forget from Memory Center"),a()}catch(e){e instanceof r.hD?h("".concat(e.code,": ").concat(e.message)):e instanceof Error?h(e.message):h("An unexpected error occurred."),m(!1)}},[d,o,v,a,t.id]);return(0,n.jsx)("div",{ref:p,className:"mc-dialog-backdrop",role:"presentation",onClick:j,children:(0,n.jsxs)("div",{ref:g,role:"dialog","aria-modal":"true","aria-labelledby":"forget-dialog-title","aria-describedby":"forget-dialog-desc",tabIndex:-1,className:"mc-dialog",onKeyDown:x,children:[(0,n.jsx)("h2",{id:"forget-dialog-title",className:"mc-dialog-title",children:v?"Delete this memory?":"Forget this memory?"}),(0,n.jsx)("p",{id:"forget-dialog-desc",className:"mc-dialog-body",children:v?(0,n.jsxs)(n.Fragment,{children:["This action is ",(0,n.jsx)("strong",{children:"permanent"}),". The memory will be hard-deleted without a tombstone audit record. You cannot undo this."]}):(0,n.jsxs)(n.Fragment,{children:["This action is ",(0,n.jsx)("strong",{children:"permanent"}),". The memory will be removed and a tombstone audit record will be created. You cannot undo this."]})}),(0,n.jsx)("blockquote",{className:"mc-dialog-quote","aria-label":"Memory content to be removed",children:t.body.length>120?"".concat(t.body.slice(0,120),"…"):t.body}),null!==b?(0,n.jsx)("p",{role:"alert",className:"mc-dialog-error",children:b}):null,(0,n.jsxs)("div",{className:"mc-dialog-actions",children:[(0,n.jsx)("button",{ref:y,type:"button",className:"lk-btn lk-btn-ghost",onClick:i,disabled:u,children:"Cancel"}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger",onClick:()=>{k()},disabled:u,"aria-busy":u,children:u?v?"Deleting…":"Forgetting…":v?"Delete permanently":"Forget permanently"})]})]})})}function h(e){let{record:t,onRecordChange:l,acceptImpl:a=c.mc,rejectImpl:i=c.RT,pinImpl:o=c.Rx,unpinImpl:d=c.CZ,archiveImpl:u=c.ax,deleteImpl:h=c.h0,correctImpl:y=c.oW}=e,[p,g]=(0,s.useState)(null),[f,v]=(0,s.useState)(null),[x,j]=(0,s.useState)(null),[k,N]=(0,s.useState)(!1),[C,S]=(0,s.useState)(!1),[w,R]=(0,s.useState)(!1),[T,E]=(0,s.useState)(!1),I=(0,s.useCallback)(async(e,t)=>{g(e),v(null),j(null);try{await t()}catch(e){v(e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred.")}finally{g(null)}},[]),D=(0,s.useCallback)(()=>{I("accept",async()=>{l((await a(t.id)).memory)})},[a,l,t.id,I]),P=(0,s.useCallback)(()=>{I("reject",async()=>{l((await i(t.id,"rejected by user in Memory Center")).memory)})},[l,t.id,i,I]),A=(0,s.useCallback)(()=>{I("pin",async()=>{l((await o(t.id)).memory)})},[l,o,t.id,I]),U=(0,s.useCallback)(()=>{I("unpin",async()=>{l((await d(t.id)).memory)})},[l,t.id,I,d]),F=(0,s.useCallback)(()=>{I("archive",async()=>{l((await u(t.id,"archived by user in Memory Center")).memory)})},[u,l,t.id,I]),O=(0,s.useCallback)(e=>{S(!1),j("Correction submitted for review: ".concat(e.body))},[]),M="proposed"===t.status,K="accepted"===t.status||"superseded"===t.status||"conflicted"===t.status||"expired"===t.status,_="forgotten"===t.status;return(0,n.jsxs)("div",{className:"mc-actions",role:"group","aria-label":"Memory actions",children:[M?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",disabled:null!==p,"aria-busy":"accept"===p,onClick:D,"aria-label":"Accept this memory proposal",children:"accept"===p?"Accepting…":"Accept"}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,"aria-busy":"reject"===p,onClick:P,"aria-label":"Reject this memory proposal",children:"reject"===p?"Rejecting…":"Reject"})]}):null,_?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,onClick:()=>{v(null),j(null),N(!0)},"aria-label":"Edit memory body, tags, or sensitivity",children:"Edit"}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,onClick:()=>{v(null),j(null),S(!0)},"aria-label":"Create a correction proposal for this memory",children:"Correct"})]}),_?null:t.pinned?(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,"aria-busy":"unpin"===p,onClick:U,"aria-label":"Unpin this memory",children:"unpin"===p?"Unpinning…":"Unpin"}):(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,"aria-busy":"pin"===p,onClick:A,"aria-label":"Pin this memory for priority retrieval",children:"pin"===p?"Pinning…":"Pin"}),K?(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,"aria-busy":"archive"===p,onClick:F,"aria-label":"Archive this memory",children:"archive"===p?"Archiving…":"Archive"}):null,_?null:(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger",disabled:null!==p,onClick:()=>{v(null),j(null),R(!0)},"aria-label":"Forget this memory permanently",children:"Forget"}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger",disabled:null!==p,onClick:()=>{v(null),j(null),E(!0)},"aria-label":"Hard-delete this memory record",children:"Delete"}),null!==f?(0,n.jsx)("p",{role:"alert","aria-live":"assertive",className:"mc-action-error",children:f}):null,null!==x?(0,n.jsx)("p",{role:"status","aria-live":"polite",className:"mc-action-notice",children:x}):null,k?(0,n.jsx)(m,{record:t,onSave:e=>{N(!1),l(e)},onClose:()=>{N(!1)}}):null,C?(0,n.jsx)(m,{mode:"correct",record:t,correctMemoryImpl:y,onSave:O,onClose:()=>{S(!1)}}):null,w?(0,n.jsx)(b,{record:t,onComplete:()=>{R(!1),l(null)},onClose:()=>{R(!1)}}):null,T?(0,n.jsx)(b,{mode:"delete",record:t,deleteMemoryImpl:h,onComplete:()=>{E(!1),l(null)},onClose:()=>{E(!1)}}):null]})}function y(e){return new Date(e).toLocaleString()}function p(e){let{label:t,value:l}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("dt",{className:"mc-meta-label",children:t}),(0,n.jsx)("dd",{className:"mc-meta-value",children:l})]})}function g(e){let{provenance:t}=e;return(0,n.jsxs)("section",{"aria-label":"Provenance",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Provenance"}),(0,n.jsxs)("dl",{className:"mc-meta",children:[(0,n.jsx)(p,{label:"Source kind",value:t.sourceKind}),(0,n.jsx)(p,{label:"Captured at",value:y(t.capturedAt)}),(0,n.jsx)(p,{label:"Confidence",value:"".concat((100*t.confidence).toFixed(0),"%")}),(0,n.jsx)(p,{label:"Sensitivity",value:t.sensitivity}),void 0!==t.captureRationale?(0,n.jsx)(p,{label:"Rationale",value:t.captureRationale}):null,void 0!==t.modelIdentity?(0,n.jsx)(p,{label:"Model",value:"".concat(t.modelIdentity.provider," / ").concat(t.modelIdentity.modelId)}):null]})]})}function f(e){let{validity:t}=e;return(0,n.jsxs)("section",{"aria-label":"Validity",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Validity"}),(0,n.jsxs)("dl",{className:"mc-meta",children:[(0,n.jsx)(p,{label:"Valid from",value:y(t.validFrom)}),(0,n.jsx)(p,{label:"Valid until",value:void 0!==t.validUntil?y(t.validUntil):"No expiry"})]})]})}function v(e){let{tags:t}=e;return 0===t.length?(0,n.jsx)("span",{className:"mc-meta-empty",children:"No tags"}):(0,n.jsx)("ul",{className:"mc-tags","aria-label":"Tags",children:t.map(e=>(0,n.jsx)("li",{className:"mc-tag",children:e},e))})}function x(e){let{record:t}=e;return(0,n.jsxs)("header",{className:"mc-detail-header",children:[(0,n.jsx)(o(),{href:"/memoriaviva",className:"mc-back-link lk-btn lk-btn-ghost","aria-label":"Back to MemoriaViva",children:"← Back"}),(0,n.jsxs)("div",{className:"mc-detail-title-row",children:[(0,n.jsxs)("h1",{className:"lk-title",style:{flex:1},children:[t.type.charAt(0).toUpperCase()+t.type.slice(1)," memory"]}),(0,n.jsx)("span",{role:"status","aria-label":"Status: ".concat(t.status),className:"mc-badge mc-badge-".concat(t.status),children:t.status}),t.pinned?(0,n.jsx)("span",{"aria-label":"Pinned",className:"mc-badge mc-badge-pinned",children:"Pinned"}):null]})]})}function j(e){let{id:t,fetchMemoryImpl:l=c.W_}=e,[a,i]=(0,s.useState)(null),[o,d]=(0,s.useState)(!0),[u,m]=(0,s.useState)(null),b=(0,s.useCallback)(async()=>{d(!0),m(null);try{let e=await l(t);i(e.memory)}catch(e){m(e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred.")}finally{d(!1)}},[t,l]);return((0,s.useEffect)(()=>{b()},[b]),o)?(0,n.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading memory…"}):null!==u?(0,n.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[u,(0,n.jsx)("button",{type:"button",className:"lk-alert-retry",onClick:()=>{b()},children:"Retry"})]}):null===a?(0,n.jsx)("div",{className:"lk-empty",children:(0,n.jsx)("p",{className:"lk-empty-title",children:"Memory not found"})}):(0,n.jsxs)("article",{"aria-label":"Memory record: ".concat(a.body.slice(0,60)),className:"mc-detail",children:[(0,n.jsx)(x,{record:a}),(0,n.jsxs)("section",{"aria-label":"Memory body",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Content"}),(0,n.jsx)("p",{className:"mc-body-text",children:a.body})]}),(0,n.jsxs)("section",{"aria-label":"Details",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Details"}),(0,n.jsxs)("dl",{className:"mc-meta",children:[(0,n.jsx)(p,{label:"ID",value:(0,n.jsx)("code",{className:"mc-code",children:a.id})}),(0,n.jsx)(p,{label:"Scope",value:function(e){switch(e.kind){case"user":return"user:".concat(e.userId);case"workspace":return"workspace:".concat(e.workspaceId);case"project":return"project:".concat(e.projectId);case"workflow":return"workflow:".concat(e.workflowDefinitionId);case"global":return"global";default:return"unknown"}}(a.scope)}),(0,n.jsx)(p,{label:"Type",value:a.type}),(0,n.jsx)(p,{label:"Created",value:y(a.createdAt)}),(0,n.jsx)(p,{label:"Updated",value:y(a.updatedAt)}),void 0!==a.staleReason?(0,n.jsx)(p,{label:"Stale reason",value:(0,n.jsx)("em",{children:a.staleReason})}):null]})]}),(0,n.jsx)(g,{provenance:a.provenance}),(0,n.jsx)(f,{validity:a.validity}),(0,n.jsxs)("section",{"aria-label":"Tags",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Tags"}),(0,n.jsx)(v,{tags:a.tags})]}),(0,n.jsxs)("section",{"aria-label":"Actions",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Actions"}),(0,n.jsx)(h,{record:a,onRecordChange:i})]})]})}function k(){var e;let t=null!=(e=(0,a.useSearchParams)().get("id"))?e:"";return""===t?(0,n.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"No memory id supplied."}):(0,n.jsx)(j,{id:t})}},4765:(e,t,l)=>{Promise.resolve().then(l.bind(l,3149))},7541:(e,t,l)=>{"use strict";var n=l(3041);l.o(n,"useRouter")&&l.d(t,{useRouter:function(){return n.useRouter}}),l.o(n,"useSearchParams")&&l.d(t,{useSearchParams:function(){return n.useSearchParams}})},8075:(e,t,l)=>{"use strict";l.d(t,{Iy:()=>s,f5:()=>i,he:()=>n,op:()=>a});let n=["user","workspace","project","workflow","global"],a=["episodic","semantic-fact","procedural","preference","correction","decision","negative","pinned"],s=["public","confidential","restricted"],i=["proposed","accepted","rejected","superseded","archived","forgotten","conflicted","expired"]}},e=>{e.O(0,[664,982,587,18,358],()=>e(e.s=4765)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[289],{1352:(e,t,l)=>{"use strict";l.d(t,{Af:()=>i,CZ:()=>h,Ir:()=>c,RT:()=>x,Rx:()=>b,W_:()=>u,ax:()=>y,fC:()=>d,h0:()=>g,hz:()=>p,mc:()=>v,oW:()=>f,tR:()=>r,w0:()=>m,xr:()=>o});var n=l(2982);async function a(e){try{let t=await e.json();return{code:t.error.code,message:t.error.message}}catch(t){return{code:"INTERNAL",message:"HTTP ".concat(e.status.toString())}}}async function s(e,t){var l;let s=(null!=(l=null==t?void 0:t.method)?l:"GET").toUpperCase(),i=null==t?void 0:t.body,o=await fetch(e,{...t,headers:function(e,t){let l={Accept:"application/json"};return null!=t&&(l["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(l["X-Keiko-CSRF"]="1"),l}(s,i)});if(!o.ok){let{code:e,message:t}=await a(o);throw new n.hD(e,t,o.status)}return o.json()}async function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,l=new URLSearchParams;void 0!==e.scope&&e.scope.length>0&&l.set("scope",e.scope.join(",")),void 0!==e.type&&e.type.length>0&&l.set("type",e.type.join(",")),void 0!==e.status&&e.status.length>0&&l.set("status",e.status.join(",")),void 0!==e.sensitivity&&e.sensitivity.length>0&&l.set("sensitivity",e.sensitivity.join(",")),void 0!==e.limit&&l.set("limit",e.limit.toString()),void 0!==e.offset&&l.set("offset",e.offset.toString());let n=l.toString();return t("/api/memory".concat(n.length>0?"?".concat(n):""))}async function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return e("/api/memory/review-queue")}async function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/consolidation/jobs",{method:"POST",body:JSON.stringify({settings:e})})}async function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e)))}async function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e),"/cancel"),{method:"POST",body:"{}"})}async function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/".concat(encodeURIComponent(e)))}async function m(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return l("/api/memory/".concat(encodeURIComponent(e)),{method:"PATCH",body:JSON.stringify(t)})}async function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/".concat(encodeURIComponent(e),"/pin"),{method:"POST",body:"{}"})}async function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/".concat(encodeURIComponent(e),"/unpin"),{method:"POST",body:"{}"})}async function y(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return l("/api/memory/".concat(encodeURIComponent(e),"/archive"),{method:"POST",body:JSON.stringify({...void 0!==t?{reason:t}:{}})})}async function p(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return l("/api/memory/".concat(encodeURIComponent(e),"/forget"),{method:"POST",body:JSON.stringify({acknowledged:!0,...void 0!==t?{reason:t}:{}})})}async function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/".concat(encodeURIComponent(e)),{method:"DELETE",body:"{}"})}async function f(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return l("/api/memory/".concat(encodeURIComponent(e),"/correct"),{method:"POST",body:JSON.stringify({body:t})})}async function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t("/api/memory/proposals/".concat(encodeURIComponent(e),"/accept"),{method:"POST",body:"{}"})}async function x(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return l("/api/memory/proposals/".concat(encodeURIComponent(e),"/reject"),{method:"POST",body:JSON.stringify({...void 0!==t?{reason:t}:{}})})}},3149:(e,t,l)=>{"use strict";l.d(t,{MemoryDetailClient:()=>k});var n=l(4568),a=l(7541),s=l(7620),i=l(9664),o=l.n(i),c=l(1352),r=l(2982),d=l(8075);let u={public:"Public",confidential:"Confidential",restricted:"Restricted"};function m(e){let{record:t,mode:l="edit",onSave:a,onClose:i,editMemoryImpl:o=c.w0,correctMemoryImpl:m=c.oW}=e,[b,h]=(0,s.useState)(t.body),[y,p]=(0,s.useState)(t.tags.join(", ")),[g,f]=(0,s.useState)(t.provenance.sensitivity),[v,x]=(0,s.useState)(!1),[j,k]=(0,s.useState)(null),N=(0,s.useRef)(null),C=(0,s.useRef)(null),S=(0,s.useRef)(null),w=(0,s.useRef)(null),R=(0,s.useId)(),T="correct"===l;(0,s.useEffect)(()=>{var e;return w.current=document.activeElement instanceof HTMLElement?document.activeElement:null,null==(e=N.current)||e.focus(),()=>{var e;null==(e=w.current)||e.focus()}},[]);let E=(0,s.useCallback)(e=>{var t,l,n;if("Escape"===e.key)return void i();if("Tab"!==e.key)return;let a=null==(t=S.current)?void 0:t.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])');if(void 0===a||0===a.length){e.preventDefault(),null==(l=S.current)||l.focus();return}let s=a[0],o=a[a.length-1];if(void 0===s||void 0===o){e.preventDefault(),null==(n=S.current)||n.focus();return}let c=document.activeElement;e.shiftKey||c!==o?e.shiftKey&&c===s&&(e.preventDefault(),o.focus()):(e.preventDefault(),s.focus())},[i]),I=(0,s.useCallback)(e=>{e.target===C.current&&i()},[i]),D=(0,s.useCallback)(async()=>{let e=b.trim();if(0===e.length)return void k("Body cannot be empty.");let l=y.split(",").map(e=>e.trim()).filter(e=>e.length>0);x(!0),k(null);try{if(T){let l=await m(t.id,e);a(l.correction)}else{let n=await o(t.id,{body:e,tags:l,sensitivity:g});a(n.memory)}}catch(e){e instanceof r.hD?k("".concat(e.code,": ").concat(e.message)):e instanceof Error?k(e.message):k("An unexpected error occurred.")}finally{x(!1)}},[b,y,g,t.id,T,m,o,a]);return(0,n.jsx)("div",{ref:C,className:"mc-dialog-backdrop",role:"presentation",onClick:I,children:(0,n.jsxs)("div",{ref:S,role:"dialog","aria-modal":"true","aria-labelledby":R,tabIndex:-1,className:"mc-dialog",onKeyDown:E,children:[(0,n.jsx)("h2",{id:R,className:"mc-dialog-title",children:T?"Correct memory":"Edit memory"}),(0,n.jsxs)("div",{className:"mc-dialog-field",children:[(0,n.jsx)("label",{htmlFor:"edit-body",className:"mc-dialog-label",children:T?"Corrected body":"Body"}),(0,n.jsx)("textarea",{id:"edit-body",ref:N,className:"mc-dialog-textarea",value:b,rows:5,onChange:e=>{h(e.target.value)},disabled:v,"aria-required":"true"})]}),T?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mc-dialog-field",children:[(0,n.jsxs)("label",{htmlFor:"edit-tags",className:"mc-dialog-label",children:["Tags ",(0,n.jsx)("span",{className:"mc-dialog-hint",children:"(comma-separated)"})]}),(0,n.jsx)("input",{id:"edit-tags",type:"text",className:"mc-dialog-input",value:y,onChange:e=>{p(e.target.value)},disabled:v})]}),(0,n.jsxs)("div",{className:"mc-dialog-field",children:[(0,n.jsx)("label",{htmlFor:"edit-sensitivity",className:"mc-dialog-label",children:"Sensitivity"}),(0,n.jsx)("select",{id:"edit-sensitivity",className:"mc-dialog-select",value:g,onChange:e=>{f(e.target.value)},disabled:v,children:d.Iy.map(e=>(0,n.jsx)("option",{value:e,children:u[e]},e))})]})]}),null!==j?(0,n.jsx)("p",{role:"alert",className:"mc-dialog-error",children:j}):null,(0,n.jsxs)("div",{className:"mc-dialog-actions",children:[(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:i,disabled:v,children:"Cancel"}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",onClick:()=>{D()},disabled:v,"aria-busy":v,children:v?T?"Submitting…":"Saving…":T?"Submit correction":"Save"})]})]})})}function b(e){let{record:t,mode:l="forget",onComplete:a,onClose:i,forgetMemoryImpl:o=c.hz,deleteMemoryImpl:d=c.h0}=e,[u,m]=(0,s.useState)(!1),[b,h]=(0,s.useState)(null),y=(0,s.useRef)(null),p=(0,s.useRef)(null),g=(0,s.useRef)(null),f=(0,s.useRef)(null),v="delete"===l;(0,s.useEffect)(()=>{var e;return f.current=document.activeElement instanceof HTMLElement?document.activeElement:null,null==(e=y.current)||e.focus(),()=>{var e;null==(e=f.current)||e.focus()}},[]);let x=(0,s.useCallback)(e=>{var t,l,n;if("Escape"===e.key)return void i();if("Tab"!==e.key)return;let a=null==(t=g.current)?void 0:t.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])');if(void 0===a||0===a.length){e.preventDefault(),null==(l=g.current)||l.focus();return}let s=a[0],o=a[a.length-1];if(void 0===s||void 0===o){e.preventDefault(),null==(n=g.current)||n.focus();return}let c=document.activeElement;e.shiftKey||c!==o?e.shiftKey&&c===s&&(e.preventDefault(),o.focus()):(e.preventDefault(),s.focus())},[i]),j=(0,s.useCallback)(e=>{e.target===p.current&&i()},[i]),k=(0,s.useCallback)(async()=>{m(!0),h(null);try{v?await d(t.id):await o(t.id,"user-initiated forget from Memory Center"),a()}catch(e){e instanceof r.hD?h("".concat(e.code,": ").concat(e.message)):e instanceof Error?h(e.message):h("An unexpected error occurred."),m(!1)}},[d,o,v,a,t.id]);return(0,n.jsx)("div",{ref:p,className:"mc-dialog-backdrop",role:"presentation",onClick:j,children:(0,n.jsxs)("div",{ref:g,role:"dialog","aria-modal":"true","aria-labelledby":"forget-dialog-title","aria-describedby":"forget-dialog-desc",tabIndex:-1,className:"mc-dialog",onKeyDown:x,children:[(0,n.jsx)("h2",{id:"forget-dialog-title",className:"mc-dialog-title",children:v?"Delete this memory?":"Forget this memory?"}),(0,n.jsx)("p",{id:"forget-dialog-desc",className:"mc-dialog-body",children:v?(0,n.jsxs)(n.Fragment,{children:["This action is ",(0,n.jsx)("strong",{children:"permanent"}),". The memory will be hard-deleted without a tombstone audit record. You cannot undo this."]}):(0,n.jsxs)(n.Fragment,{children:["This action is ",(0,n.jsx)("strong",{children:"permanent"}),". The memory will be removed and a tombstone audit record will be created. You cannot undo this."]})}),(0,n.jsx)("blockquote",{className:"mc-dialog-quote","aria-label":"Memory content to be removed",children:t.body.length>120?"".concat(t.body.slice(0,120),"…"):t.body}),null!==b?(0,n.jsx)("p",{role:"alert",className:"mc-dialog-error",children:b}):null,(0,n.jsxs)("div",{className:"mc-dialog-actions",children:[(0,n.jsx)("button",{ref:y,type:"button",className:"lk-btn lk-btn-ghost",onClick:i,disabled:u,children:"Cancel"}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger",onClick:()=>{k()},disabled:u,"aria-busy":u,children:u?v?"Deleting…":"Forgetting…":v?"Delete permanently":"Forget permanently"})]})]})})}function h(e){let{record:t,onRecordChange:l,acceptImpl:a=c.mc,rejectImpl:i=c.RT,pinImpl:o=c.Rx,unpinImpl:d=c.CZ,archiveImpl:u=c.ax,deleteImpl:h=c.h0,correctImpl:y=c.oW}=e,[p,g]=(0,s.useState)(null),[f,v]=(0,s.useState)(null),[x,j]=(0,s.useState)(null),[k,N]=(0,s.useState)(!1),[C,S]=(0,s.useState)(!1),[w,R]=(0,s.useState)(!1),[T,E]=(0,s.useState)(!1),I=(0,s.useCallback)(async(e,t)=>{g(e),v(null),j(null);try{await t()}catch(e){v(e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred.")}finally{g(null)}},[]),D=(0,s.useCallback)(()=>{I("accept",async()=>{l((await a(t.id)).memory)})},[a,l,t.id,I]),P=(0,s.useCallback)(()=>{I("reject",async()=>{l((await i(t.id,"rejected by user in Memory Center")).memory)})},[l,t.id,i,I]),A=(0,s.useCallback)(()=>{I("pin",async()=>{l((await o(t.id)).memory)})},[l,o,t.id,I]),U=(0,s.useCallback)(()=>{I("unpin",async()=>{l((await d(t.id)).memory)})},[l,t.id,I,d]),F=(0,s.useCallback)(()=>{I("archive",async()=>{l((await u(t.id,"archived by user in Memory Center")).memory)})},[u,l,t.id,I]),O=(0,s.useCallback)(e=>{S(!1),j("Correction submitted for review: ".concat(e.body))},[]),M="proposed"===t.status,K="accepted"===t.status||"superseded"===t.status||"conflicted"===t.status||"expired"===t.status,_="forgotten"===t.status;return(0,n.jsxs)("div",{className:"mc-actions",role:"group","aria-label":"Memory actions",children:[M?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",disabled:null!==p,"aria-busy":"accept"===p,onClick:D,"aria-label":"Accept this memory proposal",children:"accept"===p?"Accepting…":"Accept"}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,"aria-busy":"reject"===p,onClick:P,"aria-label":"Reject this memory proposal",children:"reject"===p?"Rejecting…":"Reject"})]}):null,_?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,onClick:()=>{v(null),j(null),N(!0)},"aria-label":"Edit memory body, tags, or sensitivity",children:"Edit"}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,onClick:()=>{v(null),j(null),S(!0)},"aria-label":"Create a correction proposal for this memory",children:"Correct"})]}),_?null:t.pinned?(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,"aria-busy":"unpin"===p,onClick:U,"aria-label":"Unpin this memory",children:"unpin"===p?"Unpinning…":"Unpin"}):(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,"aria-busy":"pin"===p,onClick:A,"aria-label":"Pin this memory for priority retrieval",children:"pin"===p?"Pinning…":"Pin"}),K?(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==p,"aria-busy":"archive"===p,onClick:F,"aria-label":"Archive this memory",children:"archive"===p?"Archiving…":"Archive"}):null,_?null:(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger",disabled:null!==p,onClick:()=>{v(null),j(null),R(!0)},"aria-label":"Forget this memory permanently",children:"Forget"}),(0,n.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger",disabled:null!==p,onClick:()=>{v(null),j(null),E(!0)},"aria-label":"Hard-delete this memory record",children:"Delete"}),null!==f?(0,n.jsx)("p",{role:"alert","aria-live":"assertive",className:"mc-action-error",children:f}):null,null!==x?(0,n.jsx)("p",{role:"status","aria-live":"polite",className:"mc-action-notice",children:x}):null,k?(0,n.jsx)(m,{record:t,onSave:e=>{N(!1),l(e)},onClose:()=>{N(!1)}}):null,C?(0,n.jsx)(m,{mode:"correct",record:t,correctMemoryImpl:y,onSave:O,onClose:()=>{S(!1)}}):null,w?(0,n.jsx)(b,{record:t,onComplete:()=>{R(!1),l(null)},onClose:()=>{R(!1)}}):null,T?(0,n.jsx)(b,{mode:"delete",record:t,deleteMemoryImpl:h,onComplete:()=>{E(!1),l(null)},onClose:()=>{E(!1)}}):null]})}function y(e){return new Date(e).toLocaleString()}function p(e){let{label:t,value:l}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("dt",{className:"mc-meta-label",children:t}),(0,n.jsx)("dd",{className:"mc-meta-value",children:l})]})}function g(e){let{provenance:t}=e;return(0,n.jsxs)("section",{"aria-label":"Provenance",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Provenance"}),(0,n.jsxs)("dl",{className:"mc-meta",children:[(0,n.jsx)(p,{label:"Source kind",value:t.sourceKind}),(0,n.jsx)(p,{label:"Captured at",value:y(t.capturedAt)}),(0,n.jsx)(p,{label:"Confidence",value:"".concat((100*t.confidence).toFixed(0),"%")}),(0,n.jsx)(p,{label:"Sensitivity",value:t.sensitivity}),void 0!==t.captureRationale?(0,n.jsx)(p,{label:"Rationale",value:t.captureRationale}):null,void 0!==t.modelIdentity?(0,n.jsx)(p,{label:"Model",value:"".concat(t.modelIdentity.provider," / ").concat(t.modelIdentity.modelId)}):null]})]})}function f(e){let{validity:t}=e;return(0,n.jsxs)("section",{"aria-label":"Validity",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Validity"}),(0,n.jsxs)("dl",{className:"mc-meta",children:[(0,n.jsx)(p,{label:"Valid from",value:y(t.validFrom)}),(0,n.jsx)(p,{label:"Valid until",value:void 0!==t.validUntil?y(t.validUntil):"No expiry"})]})]})}function v(e){let{tags:t}=e;return 0===t.length?(0,n.jsx)("span",{className:"mc-meta-empty",children:"No tags"}):(0,n.jsx)("ul",{className:"mc-tags","aria-label":"Tags",children:t.map(e=>(0,n.jsx)("li",{className:"mc-tag",children:e},e))})}function x(e){let{record:t}=e;return(0,n.jsxs)("header",{className:"mc-detail-header",children:[(0,n.jsx)(o(),{href:"/memoriaviva",className:"mc-back-link lk-btn lk-btn-ghost","aria-label":"Back to MemoriaViva",children:"← Back"}),(0,n.jsxs)("div",{className:"mc-detail-title-row",children:[(0,n.jsxs)("h1",{className:"lk-title",style:{flex:1},children:[t.type.charAt(0).toUpperCase()+t.type.slice(1)," memory"]}),(0,n.jsx)("span",{role:"status","aria-label":"Status: ".concat(t.status),className:"mc-badge mc-badge-".concat(t.status),children:t.status}),t.pinned?(0,n.jsx)("span",{"aria-label":"Pinned",className:"mc-badge mc-badge-pinned",children:"Pinned"}):null]})]})}function j(e){let{id:t,fetchMemoryImpl:l=c.W_}=e,[a,i]=(0,s.useState)(null),[o,d]=(0,s.useState)(!0),[u,m]=(0,s.useState)(null),b=(0,s.useCallback)(async()=>{d(!0),m(null);try{let e=await l(t);i(e.memory)}catch(e){m(e instanceof r.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred.")}finally{d(!1)}},[t,l]);return((0,s.useEffect)(()=>{b()},[b]),o)?(0,n.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading memory…"}):null!==u?(0,n.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[u,(0,n.jsx)("button",{type:"button",className:"lk-alert-retry",onClick:()=>{b()},children:"Retry"})]}):null===a?(0,n.jsx)("div",{className:"lk-empty",children:(0,n.jsx)("p",{className:"lk-empty-title",children:"Memory not found"})}):(0,n.jsxs)("article",{"aria-label":"Memory record: ".concat(a.body.slice(0,60)),className:"mc-detail",children:[(0,n.jsx)(x,{record:a}),(0,n.jsxs)("section",{"aria-label":"Memory body",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Content"}),(0,n.jsx)("p",{className:"mc-body-text",children:a.body})]}),(0,n.jsxs)("section",{"aria-label":"Details",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Details"}),(0,n.jsxs)("dl",{className:"mc-meta",children:[(0,n.jsx)(p,{label:"ID",value:(0,n.jsx)("code",{className:"mc-code",children:a.id})}),(0,n.jsx)(p,{label:"Scope",value:function(e){switch(e.kind){case"user":return"user:".concat(e.userId);case"workspace":return"workspace:".concat(e.workspaceId);case"project":return"project:".concat(e.projectId);case"workflow":return"workflow:".concat(e.workflowDefinitionId);case"global":return"global";default:return"unknown"}}(a.scope)}),(0,n.jsx)(p,{label:"Type",value:a.type}),(0,n.jsx)(p,{label:"Created",value:y(a.createdAt)}),(0,n.jsx)(p,{label:"Updated",value:y(a.updatedAt)}),void 0!==a.staleReason?(0,n.jsx)(p,{label:"Stale reason",value:(0,n.jsx)("em",{children:a.staleReason})}):null]})]}),(0,n.jsx)(g,{provenance:a.provenance}),(0,n.jsx)(f,{validity:a.validity}),(0,n.jsxs)("section",{"aria-label":"Tags",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Tags"}),(0,n.jsx)(v,{tags:a.tags})]}),(0,n.jsxs)("section",{"aria-label":"Actions",className:"mc-section",children:[(0,n.jsx)("h2",{className:"lk-section-head",children:"Actions"}),(0,n.jsx)(h,{record:a,onRecordChange:i})]})]})}function k(){var e;let t=null!=(e=(0,a.useSearchParams)().get("id"))?e:"";return""===t?(0,n.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"No memory id supplied."}):(0,n.jsx)(j,{id:t})}},7452:(e,t,l)=>{Promise.resolve().then(l.bind(l,3149))},7541:(e,t,l)=>{"use strict";var n=l(3041);l.o(n,"useRouter")&&l.d(t,{useRouter:function(){return n.useRouter}}),l.o(n,"useSearchParams")&&l.d(t,{useSearchParams:function(){return n.useSearchParams}})},8075:(e,t,l)=>{"use strict";l.d(t,{Iy:()=>s,f5:()=>i,he:()=>n,op:()=>a});let n=["user","workspace","project","workflow","global"],a=["episodic","semantic-fact","procedural","preference","correction","decision","negative","pinned"],s=["public","confidential","restricted"],i=["proposed","accepted","rejected","superseded","archived","forgotten","conflicted","expired"]}},e=>{e.O(0,[664,982,587,18,358],()=>e(e.s=7452)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[535],{1352:(e,t,n)=>{"use strict";n.d(t,{Af:()=>c,CZ:()=>h,Ir:()=>a,RT:()=>j,Rx:()=>u,W_:()=>m,ax:()=>y,fC:()=>d,h0:()=>g,hz:()=>f,mc:()=>b,oW:()=>v,tR:()=>l,w0:()=>p,xr:()=>r});var o=n(2982);async function s(e){try{let t=await e.json();return{code:t.error.code,message:t.error.message}}catch(t){return{code:"INTERNAL",message:"HTTP ".concat(e.status.toString())}}}async function i(e,t){var n;let i=(null!=(n=null==t?void 0:t.method)?n:"GET").toUpperCase(),c=null==t?void 0:t.body,r=await fetch(e,{...t,headers:function(e,t){let n={Accept:"application/json"};return null!=t&&(n["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(n["X-Keiko-CSRF"]="1"),n}(i,c)});if(!r.ok){let{code:e,message:t}=await s(r);throw new o.hD(e,t,r.status)}return r.json()}async function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,n=new URLSearchParams;void 0!==e.scope&&e.scope.length>0&&n.set("scope",e.scope.join(",")),void 0!==e.type&&e.type.length>0&&n.set("type",e.type.join(",")),void 0!==e.status&&e.status.length>0&&n.set("status",e.status.join(",")),void 0!==e.sensitivity&&e.sensitivity.length>0&&n.set("sensitivity",e.sensitivity.join(",")),void 0!==e.limit&&n.set("limit",e.limit.toString()),void 0!==e.offset&&n.set("offset",e.offset.toString());let o=n.toString();return t("/api/memory".concat(o.length>0?"?".concat(o):""))}async function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return e("/api/memory/review-queue")}async function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/consolidation/jobs",{method:"POST",body:JSON.stringify({settings:e})})}async function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e)))}async function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e),"/cancel"),{method:"POST",body:"{}"})}async function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/".concat(encodeURIComponent(e)))}async function p(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return n("/api/memory/".concat(encodeURIComponent(e)),{method:"PATCH",body:JSON.stringify(t)})}async function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/".concat(encodeURIComponent(e),"/pin"),{method:"POST",body:"{}"})}async function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/".concat(encodeURIComponent(e),"/unpin"),{method:"POST",body:"{}"})}async function y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return n("/api/memory/".concat(encodeURIComponent(e),"/archive"),{method:"POST",body:JSON.stringify({...void 0!==t?{reason:t}:{}})})}async function f(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return n("/api/memory/".concat(encodeURIComponent(e),"/forget"),{method:"POST",body:JSON.stringify({acknowledged:!0,...void 0!==t?{reason:t}:{}})})}async function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/".concat(encodeURIComponent(e)),{method:"DELETE",body:"{}"})}async function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return n("/api/memory/".concat(encodeURIComponent(e),"/correct"),{method:"POST",body:JSON.stringify({body:t})})}async function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/proposals/".concat(encodeURIComponent(e),"/accept"),{method:"POST",body:"{}"})}async function j(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return n("/api/memory/proposals/".concat(encodeURIComponent(e),"/reject"),{method:"POST",body:JSON.stringify({...void 0!==t?{reason:t}:{}})})}},2614:(e,t,n)=>{Promise.resolve().then(n.bind(n,7588))},7541:(e,t,n)=>{"use strict";var o=n(3041);n.o(o,"useRouter")&&n.d(t,{useRouter:function(){return o.useRouter}}),n.o(o,"useSearchParams")&&n.d(t,{useSearchParams:function(){return o.useSearchParams}})},7588:(e,t,n)=>{"use strict";n.d(t,{MemoryList:()=>N});var o=n(4568),s=n(7620),i=n(7541),c=n(9664),r=n.n(c),a=n(1352),l=n(2982),d=n(8075);let m={user:"User",workspace:"Workspace",project:"Project",workflow:"Workflow",global:"Global"},p={episodic:"Episodic","semantic-fact":"Fact",procedural:"Procedural",preference:"Preference",correction:"Correction",decision:"Decision",negative:"Negative",pinned:"Pinned"},u={proposed:"Proposed",accepted:"Accepted",rejected:"Rejected",superseded:"Superseded",archived:"Archived",forgotten:"Forgotten",conflicted:"Conflicted",expired:"Expired"},h={public:"Public",confidential:"Confidential",restricted:"Restricted"};function y(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function f(e){let{label:t,items:n,labels:s,active:i,onToggle:c}=e;return(0,o.jsxs)("div",{className:"mc-filter-row",role:"group","aria-label":"Filter by ".concat(t),children:[(0,o.jsx)("span",{className:"mc-filter-label",children:t}),(0,o.jsx)("div",{className:"mc-filter-chips",children:n.map(e=>{let t=i.includes(e);return(0,o.jsx)("button",{type:"button",className:"mc-chip","data-active":String(t),"aria-pressed":t,onClick:()=>{c(e)},children:s[e]},e)})})]})}function g(e){let{filters:t,onChange:n}=e;return(0,o.jsxs)("section",{className:"mc-filters","aria-label":"Memory filters",children:[(0,o.jsx)(f,{label:"Scope",items:d.he,labels:m,active:t.scope,onToggle:e=>{n({...t,scope:y(t.scope,e)})}}),(0,o.jsx)(f,{label:"Type",items:d.op,labels:p,active:t.type,onToggle:e=>{n({...t,type:y(t.type,e)})}}),(0,o.jsx)(f,{label:"Status",items:d.f5,labels:u,active:t.status,onToggle:e=>{n({...t,status:y(t.status,e)})}}),(0,o.jsx)(f,{label:"Sensitivity",items:d.Iy,labels:h,active:t.sensitivity,onToggle:e=>{n({...t,sensitivity:y(t.sensitivity,e)})}})]})}function v(e,t){return null===e||0===e.trim().length?[]:e.split(",").map(e=>e.trim()).filter(e=>t.includes(e))}let b={proposed:"mc-badge-proposed",accepted:"mc-badge-accepted",conflicted:"mc-badge-conflicted",rejected:"mc-badge-rejected",archived:"mc-badge-archived",forgotten:"mc-badge-forgotten",superseded:"mc-badge-superseded",expired:"mc-badge-expired"};function j(e){var t;let{status:n}=e,s=null!=(t=b[n])?t:"mc-badge-default";return(0,o.jsx)("span",{role:"status","aria-label":"Status: ".concat(n),className:"mc-badge ".concat(s),children:n})}function x(e){let{record:t}=e;return(0,o.jsx)("li",{children:(0,o.jsxs)(r(),{href:"/memoriaviva/detail?id=".concat(encodeURIComponent(t.id)),className:"mc-row",children:[(0,o.jsxs)("div",{className:"mc-row-main",children:[(0,o.jsx)("span",{className:"mc-row-body",children:t.body}),(0,o.jsxs)("div",{className:"mc-row-meta",children:[(0,o.jsx)("span",{className:"mc-row-type",children:t.type}),(0,o.jsx)("span",{className:"mc-row-scope",children:t.scope.kind}),t.pinned?(0,o.jsx)("span",{className:"mc-row-pinned","aria-label":"Pinned",children:"P"}):null]})]}),(0,o.jsx)(j,{status:t.status})]})})}function S(e){let{hasFilters:t}=e;return(0,o.jsx)("div",{"data-testid":"memory-empty-state",className:"lk-empty",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"lk-empty-title",children:"No memories found"}),(0,o.jsx)("p",{className:"lk-empty-body",children:t?"Try removing some filters to see more memories.":"Memories will appear here once the system captures them from your conversations and workflows."})]})})}function N(e){let{fetchMemoriesImpl:t=a.Af}=e,n=(0,i.useSearchParams)(),c=(0,i.useRouter)(),[,m]=(0,s.useTransition)(),[p,u]=(0,s.useState)([]),[h,y]=(0,s.useState)(!0),[f,b]=(0,s.useState)(null),j={scope:v(n.get("scope"),d.he),type:v(n.get("type"),d.op),status:v(n.get("status"),d.f5),sensitivity:v(n.get("sensitivity"),d.Iy)},N=j.scope.length>0||j.type.length>0||j.status.length>0||j.sensitivity.length>0,w=(0,s.useCallback)(async e=>{y(!0),b(null);try{let n=await t(e);u(n.memories)}catch(e){b(e instanceof l.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred.")}finally{y(!1)}},[t]);(0,s.useEffect)(()=>{w(j)},[n]);let k=(0,s.useCallback)(e=>{let t=(function(e){let t=new URLSearchParams;return e.scope.length>0&&t.set("scope",e.scope.join(",")),e.type.length>0&&t.set("type",e.type.join(",")),e.status.length>0&&t.set("status",e.status.join(",")),e.sensitivity.length>0&&t.set("sensitivity",e.sensitivity.join(",")),t})(e).toString();m(()=>{c.push("/memoriaviva".concat(t.length>0?"?".concat(t):""))})},[c]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("header",{className:"lk-header",children:[(0,o.jsx)("h1",{className:"lk-title",children:"MemoriaViva"}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[(0,o.jsx)(r(),{href:"/memoriaviva/consolidation",className:"lk-btn lk-btn-ghost lk-btn-lg",children:"Consolidation"}),(0,o.jsx)(r(),{href:"/memoriaviva/review-queue",className:"lk-btn lk-btn-ghost lk-btn-lg mc-queue-link",children:"Review queue"})]})]}),(0,o.jsx)(g,{filters:j,onChange:k}),(0,o.jsx)("section",{"aria-label":"Memory records","aria-live":"polite","aria-busy":h,style:{flex:1,minHeight:0,overflowY:"auto"},children:h?(0,o.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading memories…"}):null!==f?(0,o.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[f,(0,o.jsx)("button",{type:"button",className:"lk-alert-retry",onClick:()=>{w(j)},children:"Retry"})]}):0===p.length?(0,o.jsx)(S,{hasFilters:N}):(0,o.jsx)("ul",{"aria-label":"Memory list",style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4},children:p.map(e=>(0,o.jsx)(x,{record:e},e.id))})})]})}},8075:(e,t,n)=>{"use strict";n.d(t,{Iy:()=>i,f5:()=>c,he:()=>o,op:()=>s});let o=["user","workspace","project","workflow","global"],s=["episodic","semantic-fact","procedural","preference","correction","decision","negative","pinned"],i=["public","confidential","restricted"],c=["proposed","accepted","rejected","superseded","archived","forgotten","conflicted","expired"]}},e=>{e.O(0,[664,982,587,18,358],()=>e(e.s=2614)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[535],{1352:(e,t,n)=>{"use strict";n.d(t,{Af:()=>c,CZ:()=>h,Ir:()=>a,RT:()=>j,Rx:()=>u,W_:()=>m,ax:()=>y,fC:()=>d,h0:()=>g,hz:()=>f,mc:()=>b,oW:()=>v,tR:()=>l,w0:()=>p,xr:()=>r});var o=n(2982);async function s(e){try{let t=await e.json();return{code:t.error.code,message:t.error.message}}catch(t){return{code:"INTERNAL",message:"HTTP ".concat(e.status.toString())}}}async function i(e,t){var n;let i=(null!=(n=null==t?void 0:t.method)?n:"GET").toUpperCase(),c=null==t?void 0:t.body,r=await fetch(e,{...t,headers:function(e,t){let n={Accept:"application/json"};return null!=t&&(n["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(n["X-Keiko-CSRF"]="1"),n}(i,c)});if(!r.ok){let{code:e,message:t}=await s(r);throw new o.hD(e,t,r.status)}return r.json()}async function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,n=new URLSearchParams;void 0!==e.scope&&e.scope.length>0&&n.set("scope",e.scope.join(",")),void 0!==e.type&&e.type.length>0&&n.set("type",e.type.join(",")),void 0!==e.status&&e.status.length>0&&n.set("status",e.status.join(",")),void 0!==e.sensitivity&&e.sensitivity.length>0&&n.set("sensitivity",e.sensitivity.join(",")),void 0!==e.limit&&n.set("limit",e.limit.toString()),void 0!==e.offset&&n.set("offset",e.offset.toString());let o=n.toString();return t("/api/memory".concat(o.length>0?"?".concat(o):""))}async function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return e("/api/memory/review-queue")}async function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/consolidation/jobs",{method:"POST",body:JSON.stringify({settings:e})})}async function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e)))}async function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e),"/cancel"),{method:"POST",body:"{}"})}async function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/".concat(encodeURIComponent(e)))}async function p(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return n("/api/memory/".concat(encodeURIComponent(e)),{method:"PATCH",body:JSON.stringify(t)})}async function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/".concat(encodeURIComponent(e),"/pin"),{method:"POST",body:"{}"})}async function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/".concat(encodeURIComponent(e),"/unpin"),{method:"POST",body:"{}"})}async function y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return n("/api/memory/".concat(encodeURIComponent(e),"/archive"),{method:"POST",body:JSON.stringify({...void 0!==t?{reason:t}:{}})})}async function f(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return n("/api/memory/".concat(encodeURIComponent(e),"/forget"),{method:"POST",body:JSON.stringify({acknowledged:!0,...void 0!==t?{reason:t}:{}})})}async function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/".concat(encodeURIComponent(e)),{method:"DELETE",body:"{}"})}async function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return n("/api/memory/".concat(encodeURIComponent(e),"/correct"),{method:"POST",body:JSON.stringify({body:t})})}async function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return t("/api/memory/proposals/".concat(encodeURIComponent(e),"/accept"),{method:"POST",body:"{}"})}async function j(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return n("/api/memory/proposals/".concat(encodeURIComponent(e),"/reject"),{method:"POST",body:JSON.stringify({...void 0!==t?{reason:t}:{}})})}},1979:(e,t,n)=>{Promise.resolve().then(n.bind(n,7588))},7541:(e,t,n)=>{"use strict";var o=n(3041);n.o(o,"useRouter")&&n.d(t,{useRouter:function(){return o.useRouter}}),n.o(o,"useSearchParams")&&n.d(t,{useSearchParams:function(){return o.useSearchParams}})},7588:(e,t,n)=>{"use strict";n.d(t,{MemoryList:()=>N});var o=n(4568),s=n(7620),i=n(7541),c=n(9664),r=n.n(c),a=n(1352),l=n(2982),d=n(8075);let m={user:"User",workspace:"Workspace",project:"Project",workflow:"Workflow",global:"Global"},p={episodic:"Episodic","semantic-fact":"Fact",procedural:"Procedural",preference:"Preference",correction:"Correction",decision:"Decision",negative:"Negative",pinned:"Pinned"},u={proposed:"Proposed",accepted:"Accepted",rejected:"Rejected",superseded:"Superseded",archived:"Archived",forgotten:"Forgotten",conflicted:"Conflicted",expired:"Expired"},h={public:"Public",confidential:"Confidential",restricted:"Restricted"};function y(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function f(e){let{label:t,items:n,labels:s,active:i,onToggle:c}=e;return(0,o.jsxs)("div",{className:"mc-filter-row",role:"group","aria-label":"Filter by ".concat(t),children:[(0,o.jsx)("span",{className:"mc-filter-label",children:t}),(0,o.jsx)("div",{className:"mc-filter-chips",children:n.map(e=>{let t=i.includes(e);return(0,o.jsx)("button",{type:"button",className:"mc-chip","data-active":String(t),"aria-pressed":t,onClick:()=>{c(e)},children:s[e]},e)})})]})}function g(e){let{filters:t,onChange:n}=e;return(0,o.jsxs)("section",{className:"mc-filters","aria-label":"Memory filters",children:[(0,o.jsx)(f,{label:"Scope",items:d.he,labels:m,active:t.scope,onToggle:e=>{n({...t,scope:y(t.scope,e)})}}),(0,o.jsx)(f,{label:"Type",items:d.op,labels:p,active:t.type,onToggle:e=>{n({...t,type:y(t.type,e)})}}),(0,o.jsx)(f,{label:"Status",items:d.f5,labels:u,active:t.status,onToggle:e=>{n({...t,status:y(t.status,e)})}}),(0,o.jsx)(f,{label:"Sensitivity",items:d.Iy,labels:h,active:t.sensitivity,onToggle:e=>{n({...t,sensitivity:y(t.sensitivity,e)})}})]})}function v(e,t){return null===e||0===e.trim().length?[]:e.split(",").map(e=>e.trim()).filter(e=>t.includes(e))}let b={proposed:"mc-badge-proposed",accepted:"mc-badge-accepted",conflicted:"mc-badge-conflicted",rejected:"mc-badge-rejected",archived:"mc-badge-archived",forgotten:"mc-badge-forgotten",superseded:"mc-badge-superseded",expired:"mc-badge-expired"};function j(e){var t;let{status:n}=e,s=null!=(t=b[n])?t:"mc-badge-default";return(0,o.jsx)("span",{role:"status","aria-label":"Status: ".concat(n),className:"mc-badge ".concat(s),children:n})}function x(e){let{record:t}=e;return(0,o.jsx)("li",{children:(0,o.jsxs)(r(),{href:"/memoriaviva/detail?id=".concat(encodeURIComponent(t.id)),className:"mc-row",children:[(0,o.jsxs)("div",{className:"mc-row-main",children:[(0,o.jsx)("span",{className:"mc-row-body",children:t.body}),(0,o.jsxs)("div",{className:"mc-row-meta",children:[(0,o.jsx)("span",{className:"mc-row-type",children:t.type}),(0,o.jsx)("span",{className:"mc-row-scope",children:t.scope.kind}),t.pinned?(0,o.jsx)("span",{className:"mc-row-pinned","aria-label":"Pinned",children:"P"}):null]})]}),(0,o.jsx)(j,{status:t.status})]})})}function S(e){let{hasFilters:t}=e;return(0,o.jsx)("div",{"data-testid":"memory-empty-state",className:"lk-empty",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"lk-empty-title",children:"No memories found"}),(0,o.jsx)("p",{className:"lk-empty-body",children:t?"Try removing some filters to see more memories.":"Memories will appear here once the system captures them from your conversations and workflows."})]})})}function N(e){let{fetchMemoriesImpl:t=a.Af}=e,n=(0,i.useSearchParams)(),c=(0,i.useRouter)(),[,m]=(0,s.useTransition)(),[p,u]=(0,s.useState)([]),[h,y]=(0,s.useState)(!0),[f,b]=(0,s.useState)(null),j={scope:v(n.get("scope"),d.he),type:v(n.get("type"),d.op),status:v(n.get("status"),d.f5),sensitivity:v(n.get("sensitivity"),d.Iy)},N=j.scope.length>0||j.type.length>0||j.status.length>0||j.sensitivity.length>0,w=(0,s.useCallback)(async e=>{y(!0),b(null);try{let n=await t(e);u(n.memories)}catch(e){b(e instanceof l.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred.")}finally{y(!1)}},[t]);(0,s.useEffect)(()=>{w(j)},[n]);let k=(0,s.useCallback)(e=>{let t=(function(e){let t=new URLSearchParams;return e.scope.length>0&&t.set("scope",e.scope.join(",")),e.type.length>0&&t.set("type",e.type.join(",")),e.status.length>0&&t.set("status",e.status.join(",")),e.sensitivity.length>0&&t.set("sensitivity",e.sensitivity.join(",")),t})(e).toString();m(()=>{c.push("/memoriaviva".concat(t.length>0?"?".concat(t):""))})},[c]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("header",{className:"lk-header",children:[(0,o.jsx)("h1",{className:"lk-title",children:"MemoriaViva"}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[(0,o.jsx)(r(),{href:"/memoriaviva/consolidation",className:"lk-btn lk-btn-ghost lk-btn-lg",children:"Consolidation"}),(0,o.jsx)(r(),{href:"/memoriaviva/review-queue",className:"lk-btn lk-btn-ghost lk-btn-lg mc-queue-link",children:"Review queue"})]})]}),(0,o.jsx)(g,{filters:j,onChange:k}),(0,o.jsx)("section",{"aria-label":"Memory records","aria-live":"polite","aria-busy":h,style:{flex:1,minHeight:0,overflowY:"auto"},children:h?(0,o.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading memories…"}):null!==f?(0,o.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[f,(0,o.jsx)("button",{type:"button",className:"lk-alert-retry",onClick:()=>{w(j)},children:"Retry"})]}):0===p.length?(0,o.jsx)(S,{hasFilters:N}):(0,o.jsx)("ul",{"aria-label":"Memory list",style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4},children:p.map(e=>(0,o.jsx)(x,{record:e},e.id))})})]})}},8075:(e,t,n)=>{"use strict";n.d(t,{Iy:()=>i,f5:()=>c,he:()=>o,op:()=>s});let o=["user","workspace","project","workflow","global"],s=["episodic","semantic-fact","procedural","preference","correction","decision","negative","pinned"],i=["public","confidential","restricted"],c=["proposed","accepted","rejected","superseded","archived","forgotten","conflicted","expired"]}},e=>{e.O(0,[664,982,587,18,358],()=>e(e.s=1979)),_N_E=e.O()}]);
|
package/dist/ui/static/_next/static/chunks/app/memoriaviva/review-queue/page-e32fe86466827484.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[334],{1121:(e,t,n)=>{Promise.resolve().then(n.bind(n,8229))},1352:(e,t,n)=>{"use strict";n.d(t,{Af:()=>c,CZ:()=>y,Ir:()=>r,RT:()=>j,Rx:()=>p,W_:()=>u,ax:()=>h,fC:()=>d,h0:()=>v,hz:()=>g,mc:()=>f,oW:()=>b,tR:()=>l,w0:()=>m,xr:()=>s});var o=n(2982);async function i(e){try{let t=await e.json();return{code:t.error.code,message:t.error.message}}catch(t){return{code:"INTERNAL",message:"HTTP ".concat(e.status.toString())}}}async function a(e,t){var n;let a=(null!=(n=null==t?void 0:t.method)?n:"GET").toUpperCase(),c=null==t?void 0:t.body,s=await fetch(e,{...t,headers:function(e,t){let n={Accept:"application/json"};return null!=t&&(n["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(n["X-Keiko-CSRF"]="1"),n}(a,c)});if(!s.ok){let{code:e,message:t}=await i(s);throw new o.hD(e,t,s.status)}return s.json()}async function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,n=new URLSearchParams;void 0!==e.scope&&e.scope.length>0&&n.set("scope",e.scope.join(",")),void 0!==e.type&&e.type.length>0&&n.set("type",e.type.join(",")),void 0!==e.status&&e.status.length>0&&n.set("status",e.status.join(",")),void 0!==e.sensitivity&&e.sensitivity.length>0&&n.set("sensitivity",e.sensitivity.join(",")),void 0!==e.limit&&n.set("limit",e.limit.toString()),void 0!==e.offset&&n.set("offset",e.offset.toString());let o=n.toString();return t("/api/memory".concat(o.length>0?"?".concat(o):""))}async function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;return e("/api/memory/review-queue")}async function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return t("/api/memory/consolidation/jobs",{method:"POST",body:JSON.stringify({settings:e})})}async function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return t("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e)))}async function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return t("/api/memory/consolidation/jobs/".concat(encodeURIComponent(e),"/cancel"),{method:"POST",body:"{}"})}async function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return t("/api/memory/".concat(encodeURIComponent(e)))}async function m(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a;return n("/api/memory/".concat(encodeURIComponent(e)),{method:"PATCH",body:JSON.stringify(t)})}async function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return t("/api/memory/".concat(encodeURIComponent(e),"/pin"),{method:"POST",body:"{}"})}async function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return t("/api/memory/".concat(encodeURIComponent(e),"/unpin"),{method:"POST",body:"{}"})}async function h(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a;return n("/api/memory/".concat(encodeURIComponent(e),"/archive"),{method:"POST",body:JSON.stringify({...void 0!==t?{reason:t}:{}})})}async function g(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a;return n("/api/memory/".concat(encodeURIComponent(e),"/forget"),{method:"POST",body:JSON.stringify({acknowledged:!0,...void 0!==t?{reason:t}:{}})})}async function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return t("/api/memory/".concat(encodeURIComponent(e)),{method:"DELETE",body:"{}"})}async function b(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a;return n("/api/memory/".concat(encodeURIComponent(e),"/correct"),{method:"POST",body:JSON.stringify({body:t})})}async function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return t("/api/memory/proposals/".concat(encodeURIComponent(e),"/accept"),{method:"POST",body:"{}"})}async function j(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a;return n("/api/memory/proposals/".concat(encodeURIComponent(e),"/reject"),{method:"POST",body:JSON.stringify({...void 0!==t?{reason:t}:{}})})}},8229:(e,t,n)=>{"use strict";n.d(t,{ReviewQueue:()=>l});var o=n(4568),i=n(7620),a=n(1352),c=n(2982);function s(e){return e instanceof c.hD?"".concat(e.code,": ").concat(e.message):e instanceof Error?e.message:"An unexpected error occurred."}function r(e){let{record:t,busyAction:n,rowError:i,onAccept:a,onReject:c}=e,s="memory-review-body-".concat(t.id);return(0,o.jsx)("li",{children:(0,o.jsxs)("article",{className:"mc-review-row",children:[(0,o.jsxs)("div",{className:"mc-review-body",children:[(0,o.jsx)("p",{id:s,className:"mc-row-body",children:t.body}),(0,o.jsxs)("div",{className:"mc-row-meta",children:[(0,o.jsx)("span",{className:"mc-row-type",children:t.type}),(0,o.jsx)("span",{className:"mc-row-scope",children:t.scope.kind}),(0,o.jsx)("span",{role:"status","aria-label":"Status: ".concat(t.status),className:"mc-badge mc-badge-".concat(t.status),children:t.status})]}),null!==i?(0,o.jsx)("p",{role:"alert",className:"mc-action-error",children:i}):null]}),(0,o.jsx)("div",{className:"mc-review-actions",role:"group","aria-labelledby":s,children:"proposed"===t.status?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("button",{type:"button",className:"lk-btn lk-btn-primary",disabled:null!==n,"aria-busy":"accept"===n,onClick:()=>{a(t)},children:"accept"===n?"Accepting…":"Accept"}),(0,o.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==n,"aria-busy":"reject"===n,onClick:()=>{c(t)},children:"reject"===n?"Rejecting…":"Reject"})]}):(0,o.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null!==n,"aria-busy":"reject"===n,onClick:()=>{c(t)},children:"reject"===n?"Dismissing…":"Dismiss"})})]})})}function l(e){let{fetchQueueImpl:t=a.xr,acceptImpl:n=a.mc,rejectImpl:c=a.RT}=e,[l,d]=(0,i.useState)([]),[u,m]=(0,i.useState)(!0),[p,y]=(0,i.useState)(null),[h,g]=(0,i.useState)({}),[v,b]=(0,i.useState)({}),f=(0,i.useCallback)(async()=>{m(!0),y(null);try{let e=await t();d(e.memories),g({}),b({})}catch(e){y(s(e))}finally{m(!1)}},[t]);(0,i.useEffect)(()=>{f()},[f]);let j=(0,i.useCallback)(e=>{g(t=>{let n={...t};return delete n[e],n}),b(t=>{let n={...t};return delete n[e],n})},[]),w=(0,i.useCallback)(e=>{d(t=>t.filter(t=>t.id!==e)),j(e)},[j]),x=(0,i.useCallback)(async(e,t)=>{let o=e.id;g(e=>({...e,[o]:t})),b(e=>{let t={...e};return delete t[o],t});try{"accept"===t?await n(o):await c(o,"conflicted"===e.status?"dismissed conflict from review queue":"rejected from review queue"),w(o)}catch(e){b(t=>({...t,[o]:s(e)})),g(e=>{let t={...e};return delete t[o],t})}},[n,c,w]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("header",{className:"lk-header",children:[(0,o.jsx)("h1",{className:"lk-title",children:"Review Queue"}),(0,o.jsx)("span",{role:"status","aria-live":"polite","aria-label":"".concat(l.length.toString()," items awaiting review"),className:"mc-badge-count",children:l.length})]}),(0,o.jsx)("section",{"aria-label":"Memories awaiting review","aria-live":"polite","aria-busy":u,style:{flex:1,minHeight:0,overflowY:"auto"},children:u?(0,o.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading review queue…"}):null!==p?(0,o.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[p,(0,o.jsx)("button",{type:"button",className:"lk-alert-retry",onClick:()=>{f()},children:"Retry"})]}):0===l.length?(0,o.jsxs)("div",{"data-testid":"review-queue-empty",className:"lk-empty",children:[(0,o.jsx)("p",{className:"lk-empty-title",children:"Queue is clear"}),(0,o.jsx)("p",{className:"lk-empty-body",children:"No memories are waiting for review. Proposed and conflicted memories appear here."})]}):(0,o.jsx)("ul",{"aria-label":"Review queue",style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:8},children:l.map(e=>{var t,n;return(0,o.jsx)(r,{record:e,busyAction:null!=(t=h[e.id])?t:null,rowError:null!=(n=v[e.id])?n:null,onAccept:e=>{x(e,"accept")},onReject:e=>{x(e,"reject")}},e.id)})})})]})}}},e=>{e.O(0,[982,587,18,358],()=>e(e.s=1121)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{},_=>{_.O(0,[664,982,923,587,18,358],()=>_(_.s=6923)),_N_E=_.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{1669:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,4431,23)),Promise.resolve().then(n.t.bind(n,1012,23)),Promise.resolve().then(n.t.bind(n,540,23)),Promise.resolve().then(n.t.bind(n,5293,23)),Promise.resolve().then(n.t.bind(n,5341,23)),Promise.resolve().then(n.t.bind(n,7158,23)),Promise.resolve().then(n.t.bind(n,25,23)),Promise.resolve().then(n.t.bind(n,5104,23)),Promise.resolve().then(n.bind(n,6505))},3398:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[587,18],()=>(s(7449),s(1669))),_N_E=e.O()}]);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--BNiyfCos3TiM2QdurajIZ--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/51fdcfdc624e723d.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0cfe6f51555ca84e.js"/><script src="/_next/static/chunks/87c73c54-24122e7b92478d00.js" async=""></script><script src="/_next/static/chunks/18-ac3e3551b4e0ce8a.js" async=""></script><script src="/_next/static/chunks/main-app-b52a8fa1d8127a5f.js" async=""></script><script src="/_next/static/chunks/664-6d821dc1aacb6b48.js" async=""></script><script src="/_next/static/chunks/982-abc19630e6305864.js" async=""></script><script src="/_next/static/chunks/923-4141696576191bc0.js" async=""></script><script src="/_next/static/chunks/app/page-9ad91065d05ddfa0.js" async=""></script><meta name="theme-color" content="#4EBA87"/><meta name="color-scheme" content="dark light"/><title>Keiko | Ex experientia disco</title><meta name="description" content="Keiko local developer-assist workspace."/><link rel="manifest" href="/manifest.webmanifest"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="icon" href="/icon-192.png" sizes="192x192" type="image/png"/><link rel="icon" href="/icon-512.png" sizes="512x512" type="image/png"/><link rel="icon" href="/favicon.svg" type="image/svg+xml"/><link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180" type="image/png"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div class="app" aria-hidden="true"></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-0cfe6f51555ca84e.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[5341,[],\"\"]\n3:I[25,[],\"\"]\n4:I[1012,[],\"ClientPageRoot\"]\n5:I[4723,[\"664\",\"static/chunks/664-6d821dc1aacb6b48.js\",\"982\",\"static/chunks/982-abc19630e6305864.js\",\"923\",\"static/chunks/923-4141696576191bc0.js\",\"974\",\"static/chunks/app/page-9ad91065d05ddfa0.js\"],\"KeikoDesktop\"]\n8:I[5104,[],\"OutletBoundary\"]\na:I[7158,[],\"AsyncMetadataOutlet\"]\nc:I[5104,[],\"ViewportBoundary\"]\ne:I[5104,[],\"MetadataBoundary\"]\nf:\"$Sreact.suspense\"\n11:I[4431,[],\"\"]\n:HL[\"/_next/static/css/51fdcfdc624e723d.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"BNiyfCos3TiM2QdurajIZ\",\"p\":\"\",\"c\":[\"\",\"\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/51fdcfdc624e723d.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{\"Component\":\"$5\",\"searchParams\":{},\"params\":{},\"promises\":[\"$@6\",\"$@7\"]}],null,[\"$\",\"$L8\",null,{\"children\":[\"$L9\",[\"$\",\"$La\",null,{\"promise\":\"$@b\"}]]}]]}],{},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$Lc\",null,{\"children\":\"$Ld\"}],null],[\"$\",\"$Le\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$f\",null,{\"fallback\":null,\"children\":\"$L10\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$11\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"6:{}\n7:\"$0:f:0:1:2:children:1:props:children:0:props:params\"\n"])</script><script>self.__next_f.push([1,"d:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#4EBA87\"}],[\"$\",\"meta\",\"3\",{\"name\":\"color-scheme\",\"content\":\"dark light\"}]]\n9:null\n"])</script><script>self.__next_f.push([1,"12:I[6505,[],\"IconMark\"]\n"])</script><script>self.__next_f.push([1,"b:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Keiko | Ex experientia disco\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Keiko local developer-assist workspace.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"3\",{\"rel\":\"shortcut icon\",\"href\":\"/favicon.ico\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/icon-192.png\",\"sizes\":\"192x192\",\"type\":\"image/png\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"/icon-512.png\",\"sizes\":\"512x512\",\"type\":\"image/png\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/favicon.svg\",\"type\":\"image/svg+xml\"}],[\"$\",\"link\",\"7\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-touch-icon.png\",\"sizes\":\"180x180\",\"type\":\"image/png\"}],[\"$\",\"$L12\",\"8\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"10:\"$b:metadata\"\n"])</script></body></html>
|