@drewpayment/mink 0.5.1 → 0.6.0

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.
Files changed (125) hide show
  1. package/README.md +21 -0
  2. package/dashboard/out/404.html +1 -1
  3. package/dashboard/out/_next/static/Dw8C--0lGz5BIGsnG-e5H/_buildManifest.js +1 -0
  4. package/dashboard/out/_next/static/chunks/189-fe789442321eb5eb.js +1 -0
  5. package/dashboard/out/_next/static/chunks/255-6b79f309a27fb98b.js +1 -0
  6. package/dashboard/out/_next/static/chunks/4bd1b696-c023c6e3521b1417.js +1 -0
  7. package/dashboard/out/_next/static/chunks/738-11c31dcbdbb98d77.js +1 -0
  8. package/dashboard/out/_next/static/chunks/926-6421b9e9b03abc7b.js +1 -0
  9. package/dashboard/out/_next/static/chunks/app/(panels)/action-log/page-1f507b433af52d16.js +1 -0
  10. package/dashboard/out/_next/static/chunks/app/(panels)/activity/page-096a97ba539d5323.js +1 -0
  11. package/dashboard/out/_next/static/chunks/app/(panels)/bugs/page-449d31c133432458.js +1 -0
  12. package/dashboard/out/_next/static/chunks/app/(panels)/capture/page-c6617aa0a8a7333e.js +1 -0
  13. package/dashboard/out/_next/static/chunks/app/(panels)/config/page-aa0a0623b3fdd0d8.js +1 -0
  14. package/dashboard/out/_next/static/chunks/app/(panels)/daemon/page-7cd3fac2f5d87a0d.js +1 -0
  15. package/dashboard/out/_next/static/chunks/app/(panels)/design/page-5304675c96b6793b.js +1 -0
  16. package/dashboard/out/_next/static/chunks/app/(panels)/discord/page-9940dde80ba2a69e.js +1 -0
  17. package/dashboard/out/_next/static/chunks/app/(panels)/file-index/page-ecd8a753614e981e.js +1 -0
  18. package/dashboard/out/_next/static/chunks/app/(panels)/insights/page-7909d8beb8d8ef7a.js +1 -0
  19. package/dashboard/out/_next/static/chunks/app/(panels)/learning/page-b766adc79099adb4.js +1 -0
  20. package/dashboard/out/_next/static/chunks/app/(panels)/overview/page-7a9e86dcde67d6a9.js +1 -0
  21. package/dashboard/out/_next/static/chunks/app/(panels)/scheduler/page-a88f93204c9742a1.js +1 -0
  22. package/dashboard/out/_next/static/chunks/app/(panels)/sync/page-8a9ad4c36aa6cb65.js +1 -0
  23. package/dashboard/out/_next/static/chunks/app/(panels)/tokens/page-8dac7d50d4db2756.js +1 -0
  24. package/dashboard/out/_next/static/chunks/app/(panels)/waste/page-bcf56144faf7d133.js +1 -0
  25. package/dashboard/out/_next/static/chunks/app/(panels)/wiki/page-a32fdbd0bf58b30b.js +1 -0
  26. package/dashboard/out/_next/static/chunks/app/_not-found/page-dc2312ec30d73c4e.js +1 -0
  27. package/dashboard/out/_next/static/chunks/app/layout-782cd26e0ccc4514.js +1 -0
  28. package/dashboard/out/_next/static/chunks/app/page-6aca8457abc5d313.js +1 -0
  29. package/dashboard/out/_next/static/chunks/framework-050c1f32293f7182.js +1 -0
  30. package/dashboard/out/_next/static/chunks/main-app-c2dc0acf542ec1c6.js +1 -0
  31. package/dashboard/out/_next/static/chunks/main-ed79d05490604b83.js +1 -0
  32. package/dashboard/out/_next/static/chunks/pages/_app-7d307437aca18ad4.js +1 -0
  33. package/dashboard/out/_next/static/chunks/pages/_error-cb2a52f75f2162e2.js +1 -0
  34. package/dashboard/out/_next/static/chunks/webpack-4e3139a490df1cfe.js +1 -0
  35. package/dashboard/out/_next/static/css/5e43917ea49c5b3e.css +1 -0
  36. package/dashboard/out/_next/static/media/0aa834ed78bf6d07-s.woff2 +0 -0
  37. package/dashboard/out/_next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
  38. package/dashboard/out/_next/static/media/21350d82a1f187e9-s.woff2 +0 -0
  39. package/dashboard/out/_next/static/media/67957d42bae0796d-s.woff2 +0 -0
  40. package/dashboard/out/_next/static/media/886030b0b59bc5a7-s.woff2 +0 -0
  41. package/dashboard/out/_next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
  42. package/dashboard/out/_next/static/media/939c4f875ee75fbb-s.woff2 +0 -0
  43. package/dashboard/out/_next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
  44. package/dashboard/out/_next/static/media/bb3ef058b751a6ad-s.p.woff2 +0 -0
  45. package/dashboard/out/_next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
  46. package/dashboard/out/_next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
  47. package/dashboard/out/_next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
  48. package/dashboard/out/_next/static/media/f911b923c6adde36-s.woff2 +0 -0
  49. package/dashboard/out/action-log.html +1 -1
  50. package/dashboard/out/action-log.txt +23 -22
  51. package/dashboard/out/activity.html +1 -1
  52. package/dashboard/out/activity.txt +23 -22
  53. package/dashboard/out/bugs.html +1 -1
  54. package/dashboard/out/bugs.txt +23 -22
  55. package/dashboard/out/capture.html +1 -0
  56. package/dashboard/out/capture.txt +24 -0
  57. package/dashboard/out/config.html +1 -0
  58. package/dashboard/out/config.txt +24 -0
  59. package/dashboard/out/daemon.html +1 -0
  60. package/dashboard/out/daemon.txt +24 -0
  61. package/dashboard/out/design.html +1 -1
  62. package/dashboard/out/design.txt +23 -22
  63. package/dashboard/out/discord.html +1 -0
  64. package/dashboard/out/discord.txt +24 -0
  65. package/dashboard/out/file-index.html +1 -1
  66. package/dashboard/out/file-index.txt +23 -22
  67. package/dashboard/out/index.html +1 -1
  68. package/dashboard/out/index.txt +23 -22
  69. package/dashboard/out/insights.html +1 -1
  70. package/dashboard/out/insights.txt +23 -22
  71. package/dashboard/out/learning.html +1 -1
  72. package/dashboard/out/learning.txt +23 -22
  73. package/dashboard/out/overview.html +1 -1
  74. package/dashboard/out/overview.txt +23 -22
  75. package/dashboard/out/scheduler.html +1 -1
  76. package/dashboard/out/scheduler.txt +23 -22
  77. package/dashboard/out/sync.html +1 -0
  78. package/dashboard/out/sync.txt +24 -0
  79. package/dashboard/out/tokens.html +1 -1
  80. package/dashboard/out/tokens.txt +23 -22
  81. package/dashboard/out/waste.html +1 -0
  82. package/dashboard/out/waste.txt +24 -0
  83. package/dashboard/out/wiki.html +1 -0
  84. package/dashboard/out/wiki.txt +24 -0
  85. package/dist/cli.js +1695 -892
  86. package/package.json +1 -1
  87. package/src/core/daemon.ts +5 -3
  88. package/src/core/dashboard-api.ts +764 -1
  89. package/src/core/dashboard-server.ts +270 -0
  90. package/src/core/runtime.ts +7 -4
  91. package/src/core/vault.ts +4 -4
  92. package/src/types/config.ts +9 -1
  93. package/src/types/dashboard.ts +84 -1
  94. package/dashboard/out/_next/static/1wsj8DdMTS0IF2Rk9fkxV/_buildManifest.js +0 -1
  95. package/dashboard/out/_next/static/chunks/160-3e240a3c66269b3f.js +0 -1
  96. package/dashboard/out/_next/static/chunks/212-0f603e7affd3ee2a.js +0 -4
  97. package/dashboard/out/_next/static/chunks/255-b047925426c4e4ba.js +0 -1
  98. package/dashboard/out/_next/static/chunks/4bd1b696-409494caf8c83275.js +0 -1
  99. package/dashboard/out/_next/static/chunks/55-079130502e972d37.js +0 -1
  100. package/dashboard/out/_next/static/chunks/692-9c8d44014aa1813d.js +0 -1
  101. package/dashboard/out/_next/static/chunks/717-3d920b69f8c31178.js +0 -1
  102. package/dashboard/out/_next/static/chunks/752-8a8e79b1a2a3b489.js +0 -1
  103. package/dashboard/out/_next/static/chunks/83-ddf005b52ec7bd16.js +0 -1
  104. package/dashboard/out/_next/static/chunks/845-bed7bdd2fed7ff76.js +0 -1
  105. package/dashboard/out/_next/static/chunks/app/(panels)/action-log/page-c52cf3851d9d92d5.js +0 -1
  106. package/dashboard/out/_next/static/chunks/app/(panels)/activity/page-25a84ac9ddbbc077.js +0 -1
  107. package/dashboard/out/_next/static/chunks/app/(panels)/bugs/page-7de0b71150a91377.js +0 -1
  108. package/dashboard/out/_next/static/chunks/app/(panels)/design/page-a2153b4f18533187.js +0 -1
  109. package/dashboard/out/_next/static/chunks/app/(panels)/file-index/page-b37bdd2344d3f81c.js +0 -1
  110. package/dashboard/out/_next/static/chunks/app/(panels)/insights/page-b9cea601167e83d1.js +0 -1
  111. package/dashboard/out/_next/static/chunks/app/(panels)/learning/page-faa4afcf1473c9e5.js +0 -1
  112. package/dashboard/out/_next/static/chunks/app/(panels)/overview/page-354f274bc72789a8.js +0 -1
  113. package/dashboard/out/_next/static/chunks/app/(panels)/scheduler/page-fc11b7fbbd04a4d7.js +0 -1
  114. package/dashboard/out/_next/static/chunks/app/(panels)/tokens/page-c08c102aa883500a.js +0 -1
  115. package/dashboard/out/_next/static/chunks/app/_not-found/page-88217a29323e3700.js +0 -1
  116. package/dashboard/out/_next/static/chunks/app/layout-93083f9f140da937.js +0 -1
  117. package/dashboard/out/_next/static/chunks/app/page-0e7a5cffcfa1d064.js +0 -1
  118. package/dashboard/out/_next/static/chunks/framework-1a308e28e19f1a97.js +0 -1
  119. package/dashboard/out/_next/static/chunks/main-7c6d83fa0f7c5e5b.js +0 -1
  120. package/dashboard/out/_next/static/chunks/main-app-2f83d483d67187ef.js +0 -1
  121. package/dashboard/out/_next/static/chunks/pages/_app-5addca2b3b969fde.js +0 -1
  122. package/dashboard/out/_next/static/chunks/pages/_error-022e4ac7bbb9914f.js +0 -1
  123. package/dashboard/out/_next/static/chunks/webpack-ee71d9ae9be3609d.js +0 -1
  124. package/dashboard/out/_next/static/css/cfd58816f9a2afb9.css +0 -1
  125. /package/dashboard/out/_next/static/{1wsj8DdMTS0IF2Rk9fkxV → Dw8C--0lGz5BIGsnG-e5H}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[769],{1044:(e,n,t)=>{"use strict";t.d(n,{I:()=>i});var s=t(5155);let a={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function i(e){let{name:n,size:t=14,stroke:i=1.7,className:l=""}=e,c=a[n];return c?(0,s.jsx)("svg",{className:"icn ".concat(l).trim(),width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:c})}):null}},2327:(e,n,t)=>{"use strict";async function s(e,n){let t=n?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(n)):e,s=await fetch(t);if(!s.ok)throw Error("API error ".concat(s.status,": ").concat(e));return s.json()}function a(){return s("/api/projects")}function i(e){return s("/api/overview",e)}function l(e){return s("/api/token-ledger",e)}function c(e){return s("/api/file-index",e)}function r(e){return s("/api/scheduler",e)}function o(e){return s("/api/learning-memory",e)}function d(e){return s("/api/action-log",e)}function h(e){return s("/api/bugs",e)}function u(e){return s("/api/design",e)}async function m(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function p(e,n){let t=n?"?project=".concat(encodeURIComponent(n)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(t),{method:"POST"})).json()}async function v(e,n){let t=n?"?project=".concat(encodeURIComponent(n)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(t),{method:"POST"})).json()}async function f(e){let n=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(n),{method:"POST"})).json()}async function g(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function j(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function y(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function x(){return s("/api/config")}async function M(e,n){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:n})})).json()}async function N(e,n){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:n})})).json()}function b(){return s("/api/sync")}async function w(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function k(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function S(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function z(){return s("/api/channel")}async function P(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function O(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function L(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new URLSearchParams;null!=e.limit&&n.set("limit",String(e.limit)),e.category&&n.set("category",e.category);let t=n.toString();return s("/api/wiki".concat(t?"?".concat(t):""))}function I(e){return s("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function T(e){let n={"Content-Type":"application/json"};return e&&(n["X-Mink-Dedup-Key"]=e),n}async function V(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:T(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function H(e,n){return(await fetch("/api/wiki/daily",{method:"POST",headers:T(n),body:JSON.stringify({content:e})})).json()}async function D(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:T(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}t.d(n,{$Z:()=>L,Aq:()=>S,D:()=>C,Dz:()=>x,EP:()=>i,FW:()=>N,G1:()=>z,Gs:()=>b,Iw:()=>H,MP:()=>h,On:()=>P,P:()=>p,Vo:()=>l,WH:()=>O,Z4:()=>v,ZN:()=>I,ab:()=>y,co:()=>o,e2:()=>r,fX:()=>g,hD:()=>f,hY:()=>u,jm:()=>w,kH:()=>k,p4:()=>V,pu:()=>d,tf:()=>D,vj:()=>a,vo:()=>j,xl:()=>c,yJ:()=>M,yP:()=>m})},3742:(e,n,t)=>{"use strict";t.d(n,{Z:()=>a});var s=t(5155);function a(e){let{title:n,sub:t,tools:a,flush:i,className:l="",style:c,children:r}=e,o=null!=n||null!=a;return(0,s.jsxs)("div",{className:"card ".concat(l).trim(),style:c,children:[o&&(0,s.jsxs)("div",{className:"card-head",children:[null!=n&&("string"==typeof n?(0,s.jsx)("h3",{children:n}):n),null!=t&&(0,s.jsx)("span",{className:"sub",children:t}),null!=a&&(0,s.jsx)("div",{className:"tools",children:a})]}),(0,s.jsx)("div",{className:"card-body ".concat(i?"flush":"").trim(),children:r})]})}},3928:(e,n,t)=>{"use strict";t.d(n,{f:()=>s});let s=(0,t(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:n=>e({connected:n}),setProjects:(n,t)=>e({projects:n,activeProjectId:t}),setActiveProject:n=>e({activeProjectId:n,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:n=>e({overview:n}),setLedger:n=>{var t;return e({ledger:n,wasteFlags:null!=(t=n.wasteFlags)?t:[]})},setFileIndex:n=>e({fileIndex:n}),setScheduler:(n,t,s)=>e({tasks:n,taskDefinitions:t,deadLetters:s}),setHealth:n=>e({health:n}),setLearningMemory:n=>e({learningMemory:n}),setActionLog:n=>e({actionLog:n}),setBugs:n=>e({bugs:n}),setWasteFlags:n=>e({wasteFlags:n}),setDesignImages:n=>e({designImages:n}),setConfig:n=>e({config:n}),setSync:n=>e({sync:n}),setChannel:n=>e({channel:n}),setWiki:n=>e({wiki:n}),setWikiNote:n=>e({wikiNote:n})}))},4239:(e,n,t)=>{"use strict";t.d(n,{l:()=>a});var s=t(5155);function a(e){let{on:n,onChange:t,className:a="",ariaLabel:i}=e;return(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":n,"aria-label":i,className:"toggle ".concat(n?"on":""," ").concat(a).trim(),onClick:()=>null==t?void 0:t(!n)})}},5959:(e,n,t)=>{"use strict";t.d(n,{v:()=>l});var s=t(2115);let a=e=>{let n,t=new Set,s=(e,s)=>{let a="function"==typeof e?e(n):e;if(!Object.is(a,n)){let e=n;n=(null!=s?s:"object"!=typeof a||null===a)?a:Object.assign({},n,a),t.forEach(t=>t(n,e))}},a=()=>n,i={setState:s,getState:a,getInitialState:()=>l,subscribe:e=>(t.add(e),()=>t.delete(e))},l=n=e(s,a,i);return i},i=e=>{let n=(e=>e?a(e):a)(e),t=e=>(function(e,n=e=>e){let t=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>n(e.getState()),[e,n]),s.useCallback(()=>n(e.getInitialState()),[e,n]));return s.useDebugValue(t),t})(n,e);return Object.assign(t,n),t},l=e=>e?i(e):i},6845:(e,n,t)=>{"use strict";t.d(n,{t:()=>i});var s=t(5155),a=t(1044);function i(e){let{icon:n,variant:t,size:i,className:l="",children:c,...r}=e,o=["btn"];return t&&o.push(t),i&&o.push(i),l&&o.push(l),(0,s.jsxs)("button",{className:o.join(" "),...r,children:[n&&(0,s.jsx)(a.I,{name:n}),c]})}},7125:(e,n,t)=>{"use strict";t.d(n,{v:()=>a});var s=t(5155);function a(e){let{tone:n="",children:t,className:a=""}=e;return(0,s.jsx)("span",{className:"chip ".concat(n," ").concat(a).trim(),children:t})}},7808:(e,n,t)=>{Promise.resolve().then(t.bind(t,8375))},8375:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>p});var s=t(5155),a=t(2115),i=t(3742),l=t(7125),c=t(6845),r=t(4239),o=t(3928),d=t(2327);function h(e){if(!e)return"—";try{let n=new Date(e);if(Number.isNaN(n.getTime()))return e;return n.toLocaleString(void 0,{hour:"2-digit",minute:"2-digit",day:"2-digit",month:"short"})}catch(n){return e}}function u(){return(0,s.jsxs)("div",{className:"page",children:[(0,s.jsx)("div",{className:"page-head",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"page-title",children:"Sync"}),(0,s.jsx)("p",{className:"page-sub",children:"Git-backed sync of ~/.mink across machines"})]})}),(0,s.jsx)(i.Z,{title:"Not connected",children:(0,s.jsxs)("div",{className:"vstack",style:{padding:"12px 0"},children:[(0,s.jsx)("p",{className:"muted",style:{fontSize:12},children:"Cross-device sync is not set up yet. Initialize it from the CLI:"}),(0,s.jsx)("pre",{className:"mono inset",style:{padding:"10px 12px",fontSize:12},children:"mink sync init git@github.com:you/mink-backup.git"}),(0,s.jsx)("p",{className:"muted",style:{fontSize:11},children:"Once initialized, ~/.mink will pull on session start and push on session stop."})]})})]})}function m(){let e=(0,o.f)(e=>e.sync),[n,t]=(0,a.useState)(null),[m,p]=(0,a.useState)(null);if(!e)return(0,s.jsx)("div",{className:"page",children:(0,s.jsx)(i.Z,{title:"Sync",children:(0,s.jsx)("div",{className:"empty",children:(0,s.jsx)("h4",{children:"Loading…"})})})});if(!e.initialized)return(0,s.jsx)(u,{});async function v(e,n){t(e),p(null);try{var s;let t=await n();t.success||p(null!=(s=t.error)?s:"Failed to ".concat(e))}catch(e){p(e instanceof Error?e.message:String(e))}finally{t(null)}}return(0,s.jsxs)("div",{className:"page",children:[(0,s.jsxs)("div",{className:"page-head",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"page-title",children:"Sync"}),(0,s.jsx)("p",{className:"page-sub",children:"Git-backed sync of ~/.mink across machines — auto pull on start, auto push on stop"})]}),(0,s.jsxs)("div",{className:"page-actions",children:[(0,s.jsx)(c.t,{icon:"arrowDown",variant:"ghost",disabled:null!==n,onClick:()=>v("pull",d.jm),children:"pull"===n?"Pulling…":"Pull"}),(0,s.jsx)(c.t,{icon:"arrowUp",variant:"primary",disabled:null!==n,onClick:()=>v("push",d.kH),children:"push"===n?"Pushing…":"Push"})]})]}),m&&(0,s.jsxs)("div",{className:"kpi",style:{marginBottom:14,borderColor:"var(--danger, #c33)"},children:[(0,s.jsx)("div",{className:"label",style:{color:"var(--danger, #c33)"},children:"Error"}),(0,s.jsx)("div",{className:"value",style:{fontSize:12,whiteSpace:"pre-wrap"},children:m})]}),(0,s.jsxs)("div",{className:"grid g-4",style:{marginBottom:14},children:[(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Status"}),(0,s.jsx)("div",{className:"value",style:{fontSize:14},children:e.enabled?"● Connected":"○ Paused"}),(0,s.jsx)("div",{className:"delta",children:e.branch||"—"})]}),(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Ahead / Behind"}),(0,s.jsxs)("div",{className:"value mono",children:["↑",e.ahead," ↓",e.behind]}),(0,s.jsxs)("div",{className:"delta",children:["vs origin/",e.branch||"main"]})]}),(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Last push"}),(0,s.jsx)("div",{className:"value mono",style:{fontSize:14},children:h(e.lastPush)})]}),(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Last pull"}),(0,s.jsx)("div",{className:"value mono",style:{fontSize:14},children:h(e.lastPull)})]})]}),(0,s.jsxs)("div",{className:"grid g-2",children:[(0,s.jsx)(i.Z,{title:"Remote",children:(0,s.jsxs)("div",{className:"vstack",children:[(0,s.jsxs)("div",{className:"field",children:[(0,s.jsx)("label",{children:"Remote URL"}),(0,s.jsx)("input",{value:e.remote||"",className:"mono",readOnly:!0})]}),(0,s.jsxs)("div",{className:"field",children:[(0,s.jsx)("label",{children:"Branch"}),(0,s.jsx)("input",{value:e.branch||"",className:"mono",readOnly:!0})]}),(0,s.jsxs)("div",{className:"row",style:{padding:"4px 0"},children:[(0,s.jsxs)("div",{style:{flex:1},children:[(0,s.jsx)("div",{style:{fontSize:12,color:"var(--fg-0)"},children:"Auto-pull on session start"}),(0,s.jsx)("div",{className:"muted",style:{fontSize:11},children:"rebase-based, preserves local work"})]}),(0,s.jsx)(r.l,{on:e.enabled})]}),(0,s.jsxs)("div",{className:"row",style:{padding:"4px 0"},children:[(0,s.jsxs)("div",{style:{flex:1},children:[(0,s.jsx)("div",{style:{fontSize:12,color:"var(--fg-0)"},children:"Auto-push on session stop"}),(0,s.jsx)("div",{className:"muted",style:{fontSize:11},children:"commits changed state files"})]}),(0,s.jsx)(r.l,{on:e.enabled})]}),(0,s.jsx)("div",{className:"divider"}),(0,s.jsx)(c.t,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{if(window.confirm("Disconnect sync? This removes .git/ and clears sync config. Your data stays."))return v("disconnect",d.Aq)},disabled:null!==n,children:"disconnect"===n?"Disconnecting…":"Disconnect sync"})]})}),(0,s.jsx)(i.Z,{title:"Pending changes (".concat(e.pending.length,")"),sub:"ready to push",flush:!0,children:0===e.pending.length?(0,s.jsxs)("div",{className:"empty",children:[(0,s.jsx)("h4",{children:"Nothing to push"}),(0,s.jsx)("span",{children:"working tree clean"})]}):(0,s.jsxs)("table",{className:"tbl",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Op"}),(0,s.jsx)("th",{children:"File"})]})}),(0,s.jsx)("tbody",{children:e.pending.map(e=>{var n;return(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:(0,s.jsx)(l.v,{tone:"A"===(n=e.op)?"accent":"D"===n?"red":"?"===n?"amber":"blue",children:e.op})}),(0,s.jsx)("td",{className:"mono",style:{fontSize:11},children:e.file})]},e.file)})})]})})]}),(0,s.jsx)("div",{style:{height:14}}),(0,s.jsx)(i.Z,{title:"Conflict handling",sub:"what happens when things go wrong",children:(0,s.jsx)("div",{className:"grid g-3",style:{gap:10},children:[["Pull conflict","Rebase is aborted. You're warned to resolve manually. Auto-sync pauses until resolved."],["Push failure","Local commit is preserved. It will be included in the next push."],["Timeout (>15s)","Operation cancelled. Sync never blocks your Claude session."]].map(e=>{let[n,t]=e;return(0,s.jsxs)("div",{className:"inset",style:{padding:"10px 12px"},children:[(0,s.jsx)("div",{className:"strong",style:{color:"var(--fg-0)",fontSize:12,marginBottom:4,fontFamily:"var(--font-inter)"},children:n}),(0,s.jsx)("div",{className:"muted",style:{fontSize:11,fontFamily:"var(--font-inter)"},children:t})]},n)})})})]})}function p(){return(0,s.jsx)(m,{})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=7808)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[288],{1044:(e,t,l)=>{"use strict";l.d(t,{I:()=>n});var s=l(5155);let a={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function n(e){let{name:t,size:l=14,stroke:n=1.7,className:i=""}=e,r=a[t];return r?(0,s.jsx)("svg",{className:"icn ".concat(i).trim(),width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:r})}):null}},1392:(e,t,l)=>{Promise.resolve().then(l.bind(l,8932))},3742:(e,t,l)=>{"use strict";l.d(t,{Z:()=>a});var s=l(5155);function a(e){let{title:t,sub:l,tools:a,flush:n,className:i="",style:r,children:o}=e,c=null!=t||null!=a;return(0,s.jsxs)("div",{className:"card ".concat(i).trim(),style:r,children:[c&&(0,s.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,s.jsx)("h3",{children:t}):t),null!=l&&(0,s.jsx)("span",{className:"sub",children:l}),null!=a&&(0,s.jsx)("div",{className:"tools",children:a})]}),(0,s.jsx)("div",{className:"card-body ".concat(n?"flush":"").trim(),children:o})]})}},3928:(e,t,l)=>{"use strict";l.d(t,{f:()=>s});let s=(0,l(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,l)=>e({projects:t,activeProjectId:l}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var l;return e({ledger:t,wasteFlags:null!=(l=t.wasteFlags)?l:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,l,s)=>e({tasks:t,taskDefinitions:l,deadLetters:s}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},5959:(e,t,l)=>{"use strict";l.d(t,{v:()=>i});var s=l(2115);let a=e=>{let t,l=new Set,s=(e,s)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=s?s:"object"!=typeof a||null===a)?a:Object.assign({},t,a),l.forEach(l=>l(t,e))}},a=()=>t,n={setState:s,getState:a,getInitialState:()=>i,subscribe:e=>(l.add(e),()=>l.delete(e))},i=t=e(s,a,n);return n},n=e=>{let t=(e=>e?a(e):a)(e),l=e=>(function(e,t=e=>e){let l=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>t(e.getState()),[e,t]),s.useCallback(()=>t(e.getInitialState()),[e,t]));return s.useDebugValue(l),l})(t,e);return Object.assign(l,t),l},i=e=>e?n(e):n},6845:(e,t,l)=>{"use strict";l.d(t,{t:()=>n});var s=l(5155),a=l(1044);function n(e){let{icon:t,variant:l,size:n,className:i="",children:r,...o}=e,c=["btn"];return l&&c.push(l),n&&c.push(n),i&&c.push(i),(0,s.jsxs)("button",{className:c.join(" "),...o,children:[t&&(0,s.jsx)(a.I,{name:t}),r]})}},6970:(e,t,l)=>{"use strict";l.d(t,{y:()=>a});var s=l(5155);function a(e){let{value:t,max:l=100,tone:a="",className:n=""}=e,i=Math.max(0,Math.min(100,t/l*100));return(0,s.jsx)("div",{className:"bar ".concat(a," ").concat(n).trim(),children:(0,s.jsx)("span",{style:{width:"".concat(i,"%")}})})}},7e3:(e,t,l)=>{"use strict";function s(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":String(e)}function a(e){if(!e||e<=0)return"—";let t=Math.floor(e/1e3),l=Math.floor(t/60),s=Math.floor(l/60);return s>0?s+"h "+l%60+"m":l>0?l+"m "+t%60+"s":t+"s"}function n(e){if(!e)return"—";try{let t=new Date(e);return t.toLocaleDateString()+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}}l.d(t,{Y0:()=>a,aT:()=>s,r6:()=>n})},8932:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>m});var s=l(5155),a=l(2115),n=l(3928),i=l(3742),r=l(9503),o=l(6970),c=l(6845);function d(e){let{bars:t,width:l=720,height:a=140}=e;if(!t.length)return(0,s.jsx)("div",{className:"empty",style:{height:a,display:"grid",placeItems:"center"},children:(0,s.jsx)("div",{children:(0,s.jsx)("h4",{children:"No data yet"})})});let n=l-36-12,i=a-10-22,r=1.15*Math.max(...t.map(e=>e.value))||1,o=n/t.length*.62,c=n/t.length-o;return(0,s.jsxs)("svg",{width:l,height:a,style:{display:"block",maxWidth:"100%"},children:[[0,.25,.5,.75,1].map((e,t)=>(0,s.jsx)("line",{x1:36,x2:l-12,y1:10+i-e*i,y2:10+i-e*i,stroke:"var(--line-1)",strokeDasharray:"2 3"},t)),t.map((e,t)=>{let l=e.value/r*i,n=36+t*(o+c)+c/2;return(0,s.jsxs)("g",{children:[(0,s.jsx)("rect",{x:n,y:10+i-l,width:o,height:l,rx:"2",fill:e.color||"var(--accent)",opacity:"0.85"}),(0,s.jsx)("text",{x:n+o/2,y:a-6,textAnchor:"middle",fontSize:"9",fontFamily:"var(--font-mono), monospace",fill:"var(--fg-3)",children:e.label})]},t)})]})}var h=l(7e3);function u(){var e,t,l,u,m,v,x,M,g;let j=(0,n.f)(e=>e.ledger),f=null!=(e=null==j?void 0:j.sessions)?e:[],p=null==j?void 0:j.lifetime,y=(0,a.useMemo)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,l=Date.now(),s={},a=[];for(let e=t-1;e>=0;e--){let t=new Date(l-864e5*e).toLocaleDateString(void 0,{month:"short",day:"numeric"});s[t]=0,a.push(t)}for(let t of e){var n,i;let e=function(e){try{return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch(t){return e.slice(0,10)}}(t.startTimestamp);e in s&&(s[e]+=null!=(i=null==(n=t.totals)?void 0:n.estimatedTokens)?i:0)}return a.map(e=>({label:e,value:s[e],color:"var(--fg-2)"}))})(f,7),[f]),N=y.reduce((e,t)=>e+t.value,0),k=f.filter(e=>{let t=new Date(e.startTimestamp).getTime();return Date.now()-t<6048e5}).reduce((e,t)=>{var l;return e+(null!=(l=t.estimatedSavings)?l:0)},0),w=N>0?(k/(N+k)*100).toFixed(1):"0.0";return(0,s.jsxs)("div",{className:"page",children:[(0,s.jsxs)("div",{className:"page-head",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"page-title",children:"Token ledger"}),(0,s.jsx)("p",{className:"page-sub",children:"Persistent usage history — per session, per day"})]}),(0,s.jsx)("div",{className:"page-actions",children:(0,s.jsx)(c.t,{icon:"download",variant:"ghost",disabled:!0,title:"CSV export coming soon",children:"Export CSV"})})]}),(0,s.jsxs)("div",{className:"grid g-4",style:{marginBottom:14},children:[(0,s.jsx)(r.h,{label:"Lifetime tokens",value:(0,h.aT)(null!=(t=null==p?void 0:p.totalTokens)?t:0)}),(0,s.jsx)(r.h,{label:"Lifetime reads",value:(0,h.aT)(null!=(l=null==p?void 0:p.totalReads)?l:0)}),(0,s.jsx)(r.h,{label:"Lifetime writes",value:(0,h.aT)(null!=(u=null==p?void 0:p.totalWrites)?u:0)}),(0,s.jsx)(r.h,{label:"Lifetime saved",value:(0,h.aT)(null!=(m=null==p?void 0:p.totalEstimatedSavings)?m:0),deltaTone:"up",delta:"▲ savings"})]}),(0,s.jsxs)("div",{className:"grid g-2",children:[(0,s.jsx)(i.Z,{title:"Daily usage",sub:"last 7 days \xb7 tokens",children:(0,s.jsx)(d,{bars:y,width:560,height:180})}),(0,s.jsx)(i.Z,{title:"7-day savings",sub:"ratio ".concat(w,"%"),children:(0,s.jsxs)("div",{className:"vstack",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"row",style:{marginBottom:3},children:[(0,s.jsx)("span",{style:{fontSize:12},children:"Tokens processed"}),(0,s.jsx)("span",{className:"mono muted",style:{marginLeft:"auto",fontSize:11},children:(0,h.aT)(N)})]}),(0,s.jsx)(o.y,{value:N,max:Math.max(N+k,1)})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"row",style:{marginBottom:3},children:[(0,s.jsx)("span",{style:{fontSize:12},children:"Tokens saved"}),(0,s.jsx)("span",{className:"mono muted",style:{marginLeft:"auto",fontSize:11},children:(0,h.aT)(k)})]}),(0,s.jsx)(o.y,{value:k,max:Math.max(N+k,1),tone:"amber"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"row",style:{marginBottom:3},children:[(0,s.jsx)("span",{style:{fontSize:12},children:"File-index hits"}),(0,s.jsx)("span",{className:"mono muted",style:{marginLeft:"auto",fontSize:11},children:(0,h.aT)(null!=(v=null==p?void 0:p.totalFileIndexHits)?v:0)})]}),(0,s.jsx)(o.y,{value:null!=(x=null==p?void 0:p.totalFileIndexHits)?x:0,max:Math.max(1,(null!=(M=null==p?void 0:p.totalFileIndexHits)?M:0)+(null!=(g=null==p?void 0:p.totalFileIndexMisses)?g:0))})]})]})})]}),(0,s.jsx)("div",{style:{height:14}}),(0,s.jsx)(i.Z,{title:"Per-session breakdown",sub:"".concat(f.length," sessions"),flush:!0,children:0===f.length?(0,s.jsx)("div",{className:"empty",children:(0,s.jsx)("h4",{children:"No sessions yet"})}):(0,s.jsxs)("table",{className:"tbl",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Session"}),(0,s.jsx)("th",{children:"Started"}),(0,s.jsx)("th",{className:"right",children:"Reads"}),(0,s.jsx)("th",{className:"right",children:"Writes"}),(0,s.jsx)("th",{className:"right",children:"Tokens"}),(0,s.jsx)("th",{className:"right",children:"Saved"}),(0,s.jsx)("th",{children:"Ratio"})]})}),(0,s.jsx)("tbody",{children:[...f].reverse().slice(0,30).map(e=>{var t,l,a,n,i,r,c;let d=null!=(n=null==(t=e.totals)?void 0:t.estimatedTokens)?n:0,u=null!=(i=e.estimatedSavings)?i:0,m=d>0?u/(d+u)*100:0;return(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{className:"mono",children:e.sessionId}),(0,s.jsx)("td",{children:e.startTimestamp?new Date(e.startTimestamp).toLocaleString():"—"}),(0,s.jsx)("td",{className:"right num",children:null!=(r=null==(l=e.totals)?void 0:l.readCount)?r:0}),(0,s.jsx)("td",{className:"right num",children:null!=(c=null==(a=e.totals)?void 0:a.writeCount)?c:0}),(0,s.jsx)("td",{className:"right num",children:(0,h.aT)(d)}),(0,s.jsx)("td",{className:"right num strong",children:(0,h.aT)(u)}),(0,s.jsx)("td",{style:{width:160},children:(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)(o.y,{value:m,max:100}),(0,s.jsxs)("span",{className:"mono muted",style:{fontSize:10},children:[m.toFixed(0),"%"]})]})})]},e.sessionId)})})]})})]})}function m(){return(0,s.jsx)(u,{})}},9503:(e,t,l)=>{"use strict";l.d(t,{h:()=>n});var s=l(5155);function a(e){let{data:t,width:l=60,height:a=22,tone:n=""}=e;if(!t.length)return null;let i=Math.min(...t),r=Math.max(...t)-i||1,o=t.map((e,s)=>{let n=1===t.length?0:s/(t.length-1)*l,o=a-(e-i)/r*a;return"".concat(n.toFixed(1),",").concat(o.toFixed(1))}).join(" ");return(0,s.jsx)("svg",{width:l,height:a,className:"spark",children:(0,s.jsx)("polyline",{points:o,fill:"none",stroke:"accent"===n?"var(--accent)":"red"===n?"var(--red)":"var(--fg-2)",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function n(e){let{label:t,value:l,delta:n,deltaTone:i="",spark:r,sparkTone:o,live:c,className:d="",style:h}=e;return(0,s.jsxs)("div",{className:"kpi ".concat(d).trim(),style:h,children:[(0,s.jsx)("div",{className:"label",children:t}),(0,s.jsx)("div",{className:"value mono ".concat(c?"live-num":"").trim(),children:l}),n&&(0,s.jsx)("div",{className:"delta ".concat(i).trim(),children:n}),r&&(0,s.jsx)("div",{className:"spark",children:(0,s.jsx)(a,{data:r,tone:o})})]})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=1392)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[488],{314:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(5155),l=s(3928),n=s(3742),i=s(9503),r=s(7125),c=s(6970),h=s(6845),d=s(7e3);function o(e){let t=e.estimatedTokensWasted;return t>=1e4?"high":t>=2e3?"med":"low"}function u(){var e;let t=(0,l.f)(e=>e.wasteFlags),s=t.reduce((e,t)=>e+t.estimatedTokensWasted,0),u=t.reduce((e,t)=>{let s=o(t);return e[s]+=1,e},{high:0,med:0,low:0});return(0,a.jsxs)("div",{className:"page",children:[(0,a.jsxs)("div",{className:"page-head",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"page-title",children:"Waste detection"}),(0,a.jsx)("p",{className:"page-sub",children:"Token waste patterns — redundancies, oversized scans, stale caches"})]}),(0,a.jsx)("div",{className:"page-actions",children:(0,a.jsx)(h.t,{icon:"refresh",disabled:!0,title:"Detection runs on the daemon's waste-detect cron",children:"Re-scan"})})]}),(0,a.jsxs)("div",{className:"grid g-4",style:{marginBottom:14},children:[(0,a.jsx)(i.h,{label:"Wasted (tok)",value:(0,d.aT)(s)}),(0,a.jsx)(i.h,{label:"Patterns",value:t.length,delta:"".concat(u.high," high \xb7 ").concat(u.med," med \xb7 ").concat(u.low," low")}),(0,a.jsx)(i.h,{label:"Est. $ lost",value:"$".concat((s/1e6*3).toFixed(2)),delta:"@ $3 / Mtok"}),(0,a.jsx)(i.h,{label:"Last scan",value:t[0]&&null!=(e=(0,d.r6)(t[0].detectedAt).split(" ")[1])?e:"—"})]}),(0,a.jsx)(n.Z,{title:"Detected patterns",sub:"sorted by impact",flush:!0,children:0===t.length?(0,a.jsxs)("div",{className:"empty",children:[(0,a.jsx)("h4",{children:"No waste patterns detected"}),(0,a.jsx)("span",{children:"waste-detect cron will populate this when patterns emerge."})]}):(0,a.jsxs)("table",{className:"tbl",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Severity"}),(0,a.jsx)("th",{children:"Pattern"}),(0,a.jsx)("th",{children:"Description"}),(0,a.jsx)("th",{className:"right",children:"Loss (tok)"}),(0,a.jsx)("th",{className:"right",children:"Impact"}),(0,a.jsx)("th",{})]})}),(0,a.jsx)("tbody",{children:[...t].sort((e,t)=>t.estimatedTokensWasted-e.estimatedTokensWasted).map((e,t)=>{let l=o(e);return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:(0,a.jsx)(r.v,{tone:"high"===l?"red":"med"===l?"amber":"",children:l})}),(0,a.jsx)("td",{className:"mono",style:{fontSize:11},children:e.pattern.replaceAll("-"," ")}),(0,a.jsx)("td",{children:e.description}),(0,a.jsx)("td",{className:"right num strong",children:(0,d.aT)(e.estimatedTokensWasted)}),(0,a.jsx)("td",{className:"right",style:{width:160},children:(0,a.jsx)(c.y,{value:e.estimatedTokensWasted,max:Math.max(s||1,e.estimatedTokensWasted),tone:"high"===l?"red":"med"===l?"amber":""})}),(0,a.jsx)("td",{className:"right",children:(0,a.jsx)(h.t,{size:"sm",variant:"ghost",title:e.suggestion,children:"Suggestion"})})]},"".concat(e.pattern,"-").concat(t))})})]})})]})}function m(){return(0,a.jsx)(u,{})}},1044:(e,t,s)=>{"use strict";s.d(t,{I:()=>n});var a=s(5155);let l={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function n(e){let{name:t,size:s=14,stroke:n=1.7,className:i=""}=e,r=l[t];return r?(0,a.jsx)("svg",{className:"icn ".concat(i).trim(),width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:r})}):null}},3742:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var a=s(5155);function l(e){let{title:t,sub:s,tools:l,flush:n,className:i="",style:r,children:c}=e,h=null!=t||null!=l;return(0,a.jsxs)("div",{className:"card ".concat(i).trim(),style:r,children:[h&&(0,a.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,a.jsx)("h3",{children:t}):t),null!=s&&(0,a.jsx)("span",{className:"sub",children:s}),null!=l&&(0,a.jsx)("div",{className:"tools",children:l})]}),(0,a.jsx)("div",{className:"card-body ".concat(n?"flush":"").trim(),children:c})]})}},3928:(e,t,s)=>{"use strict";s.d(t,{f:()=>a});let a=(0,s(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,s)=>e({projects:t,activeProjectId:s}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var s;return e({ledger:t,wasteFlags:null!=(s=t.wasteFlags)?s:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,s,a)=>e({tasks:t,taskDefinitions:s,deadLetters:a}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},5959:(e,t,s)=>{"use strict";s.d(t,{v:()=>i});var a=s(2115);let l=e=>{let t,s=new Set,a=(e,a)=>{let l="function"==typeof e?e(t):e;if(!Object.is(l,t)){let e=t;t=(null!=a?a:"object"!=typeof l||null===l)?l:Object.assign({},t,l),s.forEach(s=>s(t,e))}},l=()=>t,n={setState:a,getState:l,getInitialState:()=>i,subscribe:e=>(s.add(e),()=>s.delete(e))},i=t=e(a,l,n);return n},n=e=>{let t=(e=>e?l(e):l)(e),s=e=>(function(e,t=e=>e){let s=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),a.useCallback(()=>t(e.getInitialState()),[e,t]));return a.useDebugValue(s),s})(t,e);return Object.assign(s,t),s},i=e=>e?n(e):n},6845:(e,t,s)=>{"use strict";s.d(t,{t:()=>n});var a=s(5155),l=s(1044);function n(e){let{icon:t,variant:s,size:n,className:i="",children:r,...c}=e,h=["btn"];return s&&h.push(s),n&&h.push(n),i&&h.push(i),(0,a.jsxs)("button",{className:h.join(" "),...c,children:[t&&(0,a.jsx)(l.I,{name:t}),r]})}},6970:(e,t,s)=>{"use strict";s.d(t,{y:()=>l});var a=s(5155);function l(e){let{value:t,max:s=100,tone:l="",className:n=""}=e,i=Math.max(0,Math.min(100,t/s*100));return(0,a.jsx)("div",{className:"bar ".concat(l," ").concat(n).trim(),children:(0,a.jsx)("span",{style:{width:"".concat(i,"%")}})})}},7e3:(e,t,s)=>{"use strict";function a(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":String(e)}function l(e){if(!e||e<=0)return"—";let t=Math.floor(e/1e3),s=Math.floor(t/60),a=Math.floor(s/60);return a>0?a+"h "+s%60+"m":s>0?s+"m "+t%60+"s":t+"s"}function n(e){if(!e)return"—";try{let t=new Date(e);return t.toLocaleDateString()+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}}s.d(t,{Y0:()=>l,aT:()=>a,r6:()=>n})},7125:(e,t,s)=>{"use strict";s.d(t,{v:()=>l});var a=s(5155);function l(e){let{tone:t="",children:s,className:l=""}=e;return(0,a.jsx)("span",{className:"chip ".concat(t," ").concat(l).trim(),children:s})}},9503:(e,t,s)=>{"use strict";s.d(t,{h:()=>n});var a=s(5155);function l(e){let{data:t,width:s=60,height:l=22,tone:n=""}=e;if(!t.length)return null;let i=Math.min(...t),r=Math.max(...t)-i||1,c=t.map((e,a)=>{let n=1===t.length?0:a/(t.length-1)*s,c=l-(e-i)/r*l;return"".concat(n.toFixed(1),",").concat(c.toFixed(1))}).join(" ");return(0,a.jsx)("svg",{width:s,height:l,className:"spark",children:(0,a.jsx)("polyline",{points:c,fill:"none",stroke:"accent"===n?"var(--accent)":"red"===n?"var(--red)":"var(--fg-2)",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function n(e){let{label:t,value:s,delta:n,deltaTone:i="",spark:r,sparkTone:c,live:h,className:d="",style:o}=e;return(0,a.jsxs)("div",{className:"kpi ".concat(d).trim(),style:o,children:[(0,a.jsx)("div",{className:"label",children:t}),(0,a.jsx)("div",{className:"value mono ".concat(h?"live-num":"").trim(),children:s}),n&&(0,a.jsx)("div",{className:"delta ".concat(i).trim(),children:n}),r&&(0,a.jsx)("div",{className:"spark",children:(0,a.jsx)(l,{data:r,tone:c})})]})}},9757:(e,t,s)=>{Promise.resolve().then(s.bind(s,314))}},e=>{e.O(0,[441,255,358],()=>e(e.s=9757)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[386],{1044:(e,t,n)=>{"use strict";n.d(t,{I:()=>i});var a=n(5155);let s={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function i(e){let{name:t,size:n=14,stroke:i=1.7,className:l=""}=e,r=s[t];return r?(0,a.jsx)("svg",{className:"icn ".concat(l).trim(),width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:r})}):null}},2327:(e,t,n)=>{"use strict";async function a(e,t){let n=t?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(t)):e,a=await fetch(n);if(!a.ok)throw Error("API error ".concat(a.status,": ").concat(e));return a.json()}function s(){return a("/api/projects")}function i(e){return a("/api/overview",e)}function l(e){return a("/api/token-ledger",e)}function r(e){return a("/api/file-index",e)}function c(e){return a("/api/scheduler",e)}function o(e){return a("/api/learning-memory",e)}function d(e){return a("/api/action-log",e)}function h(e){return a("/api/bugs",e)}function u(e){return a("/api/design",e)}async function m(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function p(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(n),{method:"POST"})).json()}async function f(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(n),{method:"POST"})).json()}async function g(e){let t=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(t),{method:"POST"})).json()}async function v(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function j(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function y(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function M(){return a("/api/config")}async function x(e,t){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:t})})).json()}async function N(e,t){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:t})})).json()}function w(){return a("/api/sync")}async function b(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function k(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function S(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function z(){return a("/api/channel")}async function P(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function O(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function L(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;null!=e.limit&&t.set("limit",String(e.limit)),e.category&&t.set("category",e.category);let n=t.toString();return a("/api/wiki".concat(n?"?".concat(n):""))}function T(e){return a("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function I(e){let t={"Content-Type":"application/json"};return e&&(t["X-Mink-Dedup-Key"]=e),t}async function V(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:I(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function H(e,t){return(await fetch("/api/wiki/daily",{method:"POST",headers:I(t),body:JSON.stringify({content:e})})).json()}async function D(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:I(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}n.d(t,{$Z:()=>L,Aq:()=>S,D:()=>C,Dz:()=>M,EP:()=>i,FW:()=>N,G1:()=>z,Gs:()=>w,Iw:()=>H,MP:()=>h,On:()=>P,P:()=>p,Vo:()=>l,WH:()=>O,Z4:()=>f,ZN:()=>T,ab:()=>y,co:()=>o,e2:()=>c,fX:()=>v,hD:()=>g,hY:()=>u,jm:()=>b,kH:()=>k,p4:()=>V,pu:()=>d,tf:()=>D,vj:()=>s,vo:()=>j,xl:()=>r,yJ:()=>x,yP:()=>m})},3191:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var a=n(5155),s=n(2115),i=n(3742),l=n(7125),r=n(6845),c=n(1044),o=n(3928),d=n(2327);let h=["all","inbox","projects","areas","resources","archives"];function u(){let e=(0,o.f)(e=>e.wiki),t=(0,o.f)(e=>e.wikiNote),n=(0,o.f)(e=>e.setWikiNote),[u,m]=(0,s.useState)("all"),[p,f]=(0,s.useState)(null),[g,v]=(0,s.useState)(null);if((0,s.useEffect)(()=>{!p&&e&&e.recent.length>0&&f(e.recent[0].filePath)},[p,e]),(0,s.useEffect)(()=>{if(!p){n(null),v(null);return}v(null),(0,d.ZN)(p).then(n).catch(e=>{n(null),v(e instanceof Error?e.message:String(e))})},[p,n]),!e)return(0,a.jsx)("div",{className:"page",children:(0,a.jsx)(i.Z,{title:"Wiki",children:(0,a.jsx)("div",{className:"empty",children:(0,a.jsx)("h4",{children:"Loading…"})})})});if(!e.initialized)return(0,a.jsxs)("div",{className:"page",children:[(0,a.jsx)("div",{className:"page-head",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"page-title",children:"Vault"}),(0,a.jsx)("p",{className:"page-sub",children:e.vaultPath})]})}),(0,a.jsx)(i.Z,{title:"Wiki not initialized",children:(0,a.jsxs)("div",{className:"vstack",style:{padding:"12px 0"},children:[(0,a.jsx)("p",{className:"muted",style:{fontSize:12},children:"Initialize the vault from the CLI:"}),(0,a.jsx)("pre",{className:"mono inset",style:{padding:"10px 12px",fontSize:12},children:"mink wiki init"})]})})]});let j="all"===u?e.recent:e.recent.filter(e=>e.category===u);return(0,a.jsxs)("div",{className:"page",children:[(0,a.jsxs)("div",{className:"page-head",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"page-title",children:"Vault"}),(0,a.jsxs)("p",{className:"page-sub",children:[e.totalNotes," notes \xb7 inbox ",e.inboxCount," \xb7 ",e.vaultPath]})]}),(0,a.jsx)("div",{className:"page-actions",children:(0,a.jsx)(r.t,{icon:"plus",variant:"primary",disabled:!0,title:"Capture panel handles writes (PR 6)",children:"New note"})})]}),(0,a.jsxs)("div",{className:"grid",style:{gridTemplateColumns:"220px 1fr 380px",gap:14},children:[(0,a.jsx)(i.Z,{title:"Tree",flush:!0,children:(0,a.jsx)("div",{className:"tree",style:{padding:8,maxHeight:520,overflowY:"auto"},children:0===e.tree.length?(0,a.jsx)("div",{className:"muted",style:{fontSize:11,padding:6},children:"Vault is empty."}):e.tree.map(e=>(0,a.jsxs)("div",{className:"tree-row dir",style:{paddingLeft:10+14*e.depth},children:[(0,a.jsx)(c.I,{name:"folder",size:11}),(0,a.jsx)("span",{className:"fn",children:e.name}),(0,a.jsx)("span",{className:"meta",children:e.count})]},e.path))})}),(0,a.jsx)(i.Z,{title:(0,a.jsxs)("div",{className:"row",style:{flex:1},children:[(0,a.jsx)("span",{children:"Notes"}),(0,a.jsx)("div",{className:"seg",style:{marginLeft:10},children:h.map(e=>(0,a.jsx)("button",{type:"button",className:u===e?"on":"",onClick:()=>m(e),children:e},e))})]}),flush:!0,children:0===j.length?(0,a.jsx)("div",{className:"empty",children:(0,a.jsx)("h4",{children:"No notes"})}):(0,a.jsxs)("table",{className:"tbl",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Title"}),(0,a.jsx)("th",{children:"Tags"}),(0,a.jsx)("th",{children:"Category"}),(0,a.jsx)("th",{className:"right",children:"When"})]})}),(0,a.jsx)("tbody",{children:j.map(e=>(0,a.jsxs)("tr",{onClick:()=>f(e.filePath),style:{cursor:"pointer",background:p===e.filePath?"var(--bg-2)":void 0},children:[(0,a.jsxs)("td",{children:[(0,a.jsx)("div",{className:"strong",children:e.title}),(0,a.jsx)("div",{className:"mono muted",style:{fontSize:10},children:e.filePath})]}),(0,a.jsx)("td",{children:(0,a.jsx)("div",{className:"row tight",children:e.tags.map(e=>(0,a.jsxs)(l.v,{children:["#",e]},e))})}),(0,a.jsx)("td",{children:(0,a.jsx)(l.v,{tone:"inbox"===e.category?"amber":"projects"===e.category?"accent":"",children:e.category})}),(0,a.jsx)("td",{className:"right mono muted",children:function(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{hour:"2-digit",minute:"2-digit",day:"2-digit",month:"short"})}(e.lastModified)})]},e.filePath))})]})}),(0,a.jsxs)(i.Z,{title:t?t.frontmatter.title||t.path:"Select a note",sub:null==t?void 0:t.path,tools:(0,a.jsx)("div",{className:"row tight",children:(0,a.jsx)(r.t,{size:"sm",variant:"ghost",icon:"copy",disabled:!0,children:"Copy link"})}),children:[g&&(0,a.jsx)("div",{style:{color:"var(--danger, #c33)",fontSize:11},children:g}),!t&&!g&&(0,a.jsx)("div",{className:"muted",style:{fontSize:11},children:"No note selected."}),t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"inset",style:{fontFamily:"var(--font-inter)",fontSize:12,lineHeight:1.55,maxHeight:360,overflowY:"auto"},children:[Object.keys(t.frontmatter).length>0&&(0,a.jsxs)("div",{className:"muted mono",style:{fontSize:10.5,marginBottom:8},children:["---",Object.entries(t.frontmatter).map(e=>{let[t,n]=e;return(0,a.jsxs)("div",{children:[t,": ",Array.isArray(n)?"[".concat(n.join(", "),"]"):String(n)]},t)}),"---"]}),(0,a.jsx)("div",{style:{color:"var(--fg-1)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:t.body})]}),(0,a.jsx)("div",{className:"divider"}),(0,a.jsxs)("div",{className:"muted",style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:6},children:["Backlinks (",t.backlinks.length,")"]}),(0,a.jsx)("div",{className:"vstack",style:{gap:4},children:0===t.backlinks.length?(0,a.jsx)("div",{className:"muted",style:{fontSize:11},children:"No backlinks yet."}):t.backlinks.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>f(e.path),className:"mono",style:{background:"transparent",border:0,color:"var(--accent)",cursor:"pointer",fontSize:11,textAlign:"left",padding:0},children:[e.title," ",(0,a.jsxs)("span",{className:"muted",children:["(",e.path,")"]})]},e.path))})]})]})]})]})}function m(){return(0,a.jsx)(u,{})}},3742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var a=n(5155);function s(e){let{title:t,sub:n,tools:s,flush:i,className:l="",style:r,children:c}=e,o=null!=t||null!=s;return(0,a.jsxs)("div",{className:"card ".concat(l).trim(),style:r,children:[o&&(0,a.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,a.jsx)("h3",{children:t}):t),null!=n&&(0,a.jsx)("span",{className:"sub",children:n}),null!=s&&(0,a.jsx)("div",{className:"tools",children:s})]}),(0,a.jsx)("div",{className:"card-body ".concat(i?"flush":"").trim(),children:c})]})}},3928:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});let a=(0,n(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,n)=>e({projects:t,activeProjectId:n}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var n;return e({ledger:t,wasteFlags:null!=(n=t.wasteFlags)?n:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,n,a)=>e({tasks:t,taskDefinitions:n,deadLetters:a}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},4581:(e,t,n)=>{Promise.resolve().then(n.bind(n,3191))},5959:(e,t,n)=>{"use strict";n.d(t,{v:()=>l});var a=n(2115);let s=e=>{let t,n=new Set,a=(e,a)=>{let s="function"==typeof e?e(t):e;if(!Object.is(s,t)){let e=t;t=(null!=a?a:"object"!=typeof s||null===s)?s:Object.assign({},t,s),n.forEach(n=>n(t,e))}},s=()=>t,i={setState:a,getState:s,getInitialState:()=>l,subscribe:e=>(n.add(e),()=>n.delete(e))},l=t=e(a,s,i);return i},i=e=>{let t=(e=>e?s(e):s)(e),n=e=>(function(e,t=e=>e){let n=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),a.useCallback(()=>t(e.getInitialState()),[e,t]));return a.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},l=e=>e?i(e):i},6845:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var a=n(5155),s=n(1044);function i(e){let{icon:t,variant:n,size:i,className:l="",children:r,...c}=e,o=["btn"];return n&&o.push(n),i&&o.push(i),l&&o.push(l),(0,a.jsxs)("button",{className:o.join(" "),...c,children:[t&&(0,a.jsx)(s.I,{name:t}),r]})}},7125:(e,t,n)=>{"use strict";n.d(t,{v:()=>s});var a=n(5155);function s(e){let{tone:t="",children:n,className:s=""}=e;return(0,a.jsx)("span",{className:"chip ".concat(t," ").concat(s).trim(),children:n})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=4581)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[492],{436:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return l(9520)}])},4585:(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)},8886:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessErrorFallback",{enumerable:!0,get:function(){return o}});let r=l(5155),n=l(4585);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)},9520:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=l(5155),n=l(8886),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)}},e=>{e.O(0,[441,255,358],()=>e(e.s=436)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{1044:(e,n,t)=>{"use strict";t.d(n,{I:()=>i});var s=t(5155);let a={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function i(e){let{name:n,size:t=14,stroke:i=1.7,className:l=""}=e,c=a[n];return c?(0,s.jsx)("svg",{className:"icn ".concat(l).trim(),width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:c})}):null}},1290:()=>{},2301:(e,n,t)=>{"use strict";t.d(n,{g:()=>o,h:()=>r});var s=t(2115),a=t(3928),i=t(2327);function l(e){var n;let t=[];for(let s of null!=(n=null==e?void 0:e.sessions)?n:[])for(let e of(s.content||"").split("\n")){if(!e.startsWith("|")||e.includes("---"))continue;let n=e.split("|").map(e=>e.trim()).filter(Boolean);n.length>=5&&"Time"!==n[0]&&t.push({time:n[0],action:n[1],files:n[2],outcome:n[3],tokens:n[4]})}return t}function c(e){let n=e.tasks||[],t=n.map(e=>e.state).filter(Boolean),s=n.map(e=>e.definition).filter(Boolean),i=e.deadLetterQueue||[];a.f.getState().setScheduler(t,s,i)}function o(){var e;let n=a.f.getState(),t=null!=(e=n.activeProjectId)?e:void 0;(0,i.EP)(t).then(e=>{var t,s;n.setOverview(e),(null==(t=e.daemon)?void 0:t.running)?n.setHealth({uptimeMs:null!=(s=e.daemon.uptimeMs)?s:0}):n.setHealth(null)}).catch(console.warn),(0,i.Vo)(t).then(n.setLedger).catch(console.warn),(0,i.xl)(t).then(n.setFileIndex).catch(console.warn),(0,i.e2)(t).then(c).catch(console.warn),(0,i.co)(t).then(n.setLearningMemory).catch(console.warn),(0,i.pu)(t).then(e=>n.setActionLog(l(e))).catch(console.warn),(0,i.MP)(t).then(e=>n.setBugs(e.entries||[])).catch(console.warn),(0,i.hY)(t).then(e=>n.setDesignImages(e.images)).catch(console.warn),(0,i.Dz)().then(n.setConfig).catch(console.warn),(0,i.Gs)().then(n.setSync).catch(console.warn),(0,i.G1)().then(n.setChannel).catch(console.warn),(0,i.D)().then(n.setWiki).catch(console.warn)}function r(){let e=(0,s.useRef)(1e3),n=(0,s.useRef)(null),t=(0,s.useRef)(null);(0,s.useEffect)(()=>((function s(){t.current&&t.current.close();let r=new EventSource("/api/events");t.current=r,r.onopen=()=>{e.current=1e3,a.f.getState().setConnected(!0),(0,i.vj)().then(e=>{a.f.getState().setProjects(e.projects,e.activeProjectId),o()}).catch(e=>{console.warn("[mink] Failed to fetch projects:",e),o()})},r.onmessage=e=>{try{let n=JSON.parse(e.data);if("keepalive"===n.type)return;!function(e){var n;let t=a.f.getState(),s=e.fileId||e.type,r=null!=(n=t.activeProjectId)?n:void 0;if("project-switched"===s&&e.projectId){t.activeProjectId!==e.projectId&&(t.setActiveProject(e.projectId),o());return}switch(s){case"token-ledger":(0,i.Vo)(r).then(t.setLedger).catch(console.warn);break;case"file-index":(0,i.xl)(r).then(t.setFileIndex).catch(console.warn);break;case"scheduler-manifest":(0,i.e2)(r).then(c).catch(console.warn);break;case"learning-memory":(0,i.co)(r).then(t.setLearningMemory).catch(console.warn);break;case"action-log":(0,i.pu)(r).then(e=>t.setActionLog(l(e))).catch(console.warn);break;case"bug-memory":(0,i.MP)(r).then(e=>t.setBugs(e.entries||[])).catch(console.warn);break;case"session":case"daemon-status":(0,i.EP)(r).then(e=>{var n,s;t.setOverview(e),(null==(n=e.daemon)?void 0:n.running)?t.setHealth({uptimeMs:null!=(s=e.daemon.uptimeMs)?s:0}):t.setHealth(null)}).catch(console.warn);break;case"design-report":(0,i.hY)(r).then(e=>t.setDesignImages(e.images)).catch(console.warn);break;case"config-changed":(0,i.Dz)().then(t.setConfig).catch(console.warn);break;case"sync-status":(0,i.Gs)().then(t.setSync).catch(console.warn);break;case"channel-status":case"channel-logs":(0,i.G1)().then(t.setChannel).catch(console.warn);break;case"vault-index":(0,i.D)().then(t.setWiki).catch(console.warn);break;default:o()}}(n)}catch(e){console.warn("[mink] SSE parse error:",e)}},r.onerror=()=>{a.f.getState().setConnected(!1),r.close(),t.current=null,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{e.current=Math.min(2*e.current,3e4),s()},e.current)}})(),()=>{t.current&&(t.current.close(),t.current=null),n.current&&clearTimeout(n.current)}),[])}},2327:(e,n,t)=>{"use strict";async function s(e,n){let t=n?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(n)):e,s=await fetch(t);if(!s.ok)throw Error("API error ".concat(s.status,": ").concat(e));return s.json()}function a(){return s("/api/projects")}function i(e){return s("/api/overview",e)}function l(e){return s("/api/token-ledger",e)}function c(e){return s("/api/file-index",e)}function o(e){return s("/api/scheduler",e)}function r(e){return s("/api/learning-memory",e)}function d(e){return s("/api/action-log",e)}function h(e){return s("/api/bugs",e)}function u(e){return s("/api/design",e)}async function m(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function p(e,n){let t=n?"?project=".concat(encodeURIComponent(n)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(t),{method:"POST"})).json()}async function v(e,n){let t=n?"?project=".concat(encodeURIComponent(n)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(t),{method:"POST"})).json()}async function f(e){let n=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(n),{method:"POST"})).json()}async function g(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function j(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function x(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function y(){return s("/api/config")}async function b(e,n){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:n})})).json()}async function w(e,n){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:n})})).json()}function k(){return s("/api/sync")}async function M(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function N(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function S(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function z(){return s("/api/channel")}async function P(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function I(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function L(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new URLSearchParams;null!=e.limit&&n.set("limit",String(e.limit)),e.category&&n.set("category",e.category);let t=n.toString();return s("/api/wiki".concat(t?"?".concat(t):""))}function O(e){return s("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function T(e){let n={"Content-Type":"application/json"};return e&&(n["X-Mink-Dedup-Key"]=e),n}async function D(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:T(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function F(e,n){return(await fetch("/api/wiki/daily",{method:"POST",headers:T(n),body:JSON.stringify({content:e})})).json()}async function H(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:T(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}t.d(n,{$Z:()=>L,Aq:()=>S,D:()=>C,Dz:()=>y,EP:()=>i,FW:()=>w,G1:()=>z,Gs:()=>k,Iw:()=>F,MP:()=>h,On:()=>P,P:()=>p,Vo:()=>l,WH:()=>I,Z4:()=>v,ZN:()=>O,ab:()=>x,co:()=>r,e2:()=>o,fX:()=>g,hD:()=>f,hY:()=>u,jm:()=>M,kH:()=>N,p4:()=>D,pu:()=>d,tf:()=>H,vj:()=>a,vo:()=>j,xl:()=>c,yJ:()=>b,yP:()=>m})},2800:(e,n,t)=>{"use strict";t.d(n,{SSEProvider:()=>a});var s=t(2301);function a(){return(0,s.h)(),null}},3928:(e,n,t)=>{"use strict";t.d(n,{f:()=>s});let s=(0,t(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:n=>e({connected:n}),setProjects:(n,t)=>e({projects:n,activeProjectId:t}),setActiveProject:n=>e({activeProjectId:n,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:n=>e({overview:n}),setLedger:n=>{var t;return e({ledger:n,wasteFlags:null!=(t=n.wasteFlags)?t:[]})},setFileIndex:n=>e({fileIndex:n}),setScheduler:(n,t,s)=>e({tasks:n,taskDefinitions:t,deadLetters:s}),setHealth:n=>e({health:n}),setLearningMemory:n=>e({learningMemory:n}),setActionLog:n=>e({actionLog:n}),setBugs:n=>e({bugs:n}),setWasteFlags:n=>e({wasteFlags:n}),setDesignImages:n=>e({designImages:n}),setConfig:n=>e({config:n}),setSync:n=>e({sync:n}),setChannel:n=>e({channel:n}),setWiki:n=>e({wiki:n}),setWikiNote:n=>e({wikiNote:n})}))},4658:(e,n,t)=>{Promise.resolve().then(t.t.bind(t,1290,23)),Promise.resolve().then(t.bind(t,7758)),Promise.resolve().then(t.bind(t,2800)),Promise.resolve().then(t.bind(t,5379)),Promise.resolve().then(t.t.bind(t,369,23)),Promise.resolve().then(t.t.bind(t,7770,23))},6845:(e,n,t)=>{"use strict";t.d(n,{t:()=>i});var s=t(5155),a=t(1044);function i(e){let{icon:n,variant:t,size:i,className:l="",children:c,...o}=e,r=["btn"];return t&&r.push(t),i&&r.push(i),l&&r.push(l),(0,s.jsxs)("button",{className:r.join(" "),...o,children:[n&&(0,s.jsx)(a.I,{name:n}),c]})}},7758:(e,n,t)=>{"use strict";t.d(n,{AppShell:()=>L});var s=t(5155),a=t(2115),i=t(63),l=t(5379),c=t(2619),o=t.n(c),r=t(1044),d=t(3928),h=t(2327),u=t(2301),m=t(6845);function p(e){let{onClose:n}=e,t=(0,d.f)(e=>e.projects),a=(0,d.f)(e=>e.activeProjectId),i=(0,d.f)(e=>e.setActiveProject);async function l(e){if(e===a)return void n();i(e),await (0,h.yP)(e),(0,u.g)(),n()}return(0,s.jsxs)("div",{role:"menu",onMouseLeave:n,style:{position:"fixed",top:92,left:12,width:320,zIndex:80,background:"var(--bg-1)",border:"1px solid var(--line-1)",borderRadius:10,boxShadow:"var(--shadow-pop)",overflow:"hidden"},children:[(0,s.jsxs)("div",{style:{padding:"8px 12px",borderBottom:"1px solid var(--line-1)",fontSize:10.5,textTransform:"uppercase",letterSpacing:"0.08em",color:"var(--fg-3)",fontWeight:600},children:["Projects \xb7 ",t.length]}),t.map(e=>(0,s.jsxs)("div",{role:"menuitem",onClick:()=>l(e.id),className:"row",style:{padding:"8px 12px",cursor:"pointer",background:a===e.id?"var(--bg-2)":void 0,borderBottom:"1px solid var(--line-1)"},children:[(0,s.jsx)(r.I,{name:"folder",size:12}),(0,s.jsxs)("div",{style:{flex:1,minWidth:0,marginLeft:8},children:[(0,s.jsx)("div",{style:{color:"var(--fg-0)",fontSize:12},children:e.name}),(0,s.jsx)("div",{className:"mono muted",style:{fontSize:10},children:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:36;return e.length<=n?e:"..."+e.slice(e.length-n+3)}(e.cwd)})]}),a===e.id&&(0,s.jsx)("span",{className:"dot",style:{width:6,height:6,borderRadius:3,background:"var(--accent)"}})]},e.id)),0===t.length&&(0,s.jsx)("div",{className:"empty",style:{padding:16},children:(0,s.jsx)("div",{children:"No projects registered"})}),(0,s.jsx)("div",{style:{padding:8,background:"var(--bg-2)"},children:(0,s.jsx)(m.t,{size:"sm",icon:"plus",variant:"ghost",disabled:!0,title:"Preview — run `mink init` in a repo",children:"Add project"})})]})}let v=[{group:"Overview",items:[{id:"sessions",href:"/overview",label:"Sessions",icon:"activity",showDot:!0},{id:"activity",href:"/activity",label:"Activity log",icon:"pulse"},{id:"tokens",href:"/tokens",label:"Token ledger",icon:"chart"},{id:"waste",href:"/waste",label:"Waste detect",icon:"alert",countKey:"waste"}]},{group:"Knowledge",items:[{id:"files",href:"/file-index",label:"File index",icon:"file"},{id:"memory",href:"/learning",label:"Learning",icon:"brain"},{id:"bugs",href:"/bugs",label:"Bug memory",icon:"bug",countKey:"bugs"}]},{group:"Notes & Wiki",items:[{id:"wiki",href:"/wiki",label:"Vault",icon:"book"},{id:"capture",href:"/capture",label:"Capture",icon:"plus",countKey:"capture"}]},{group:"Operations",items:[{id:"scheduler",href:"/scheduler",label:"Scheduler",icon:"clock",countKey:"scheduler"},{id:"discord",href:"/discord",label:"Discord",icon:"discord"},{id:"sync",href:"/sync",label:"Sync",icon:"git"}]},{group:"System",items:[{id:"daemon",href:"/daemon",label:"Daemon",icon:"power"},{id:"config",href:"/config",label:"Configuration",icon:"settings"}]}];function f(){let e=(0,i.usePathname)(),[n,t]=(0,a.useState)(!1),l=(0,d.f)(e=>e.activeProjectId),c=(0,d.f)(e=>e.projects),h=(0,d.f)(e=>{var n,t;return null==(t=e.overview)||null==(n=t.project)?void 0:n.name}),u=(0,d.f)(e=>e.wasteFlags.length),m=(0,d.f)(e=>e.bugs.filter(e=>{var n;return!(null==(n=e.fixDescription)?void 0:n.trim())}).length),f=(0,d.f)(e=>e.deadLetters.length),g=(0,d.f)(e=>{var n,t,s;return null!=(s=null==(t=e.overview)||null==(n=t.daemon)?void 0:n.running)&&s}),j={capture:0,waste:u,bugs:m,scheduler:f},x=c.find(e=>e.id===l),y=(null==x?void 0:x.name)||h||"Mink",b=(null==x?void 0:x.id)||(null==x?void 0:x.cwd)||"";return(0,s.jsxs)("aside",{className:"sidebar",children:[(0,s.jsxs)("div",{className:"sb-head",children:[(0,s.jsx)("div",{className:"sb-logo",children:"M"}),(0,s.jsx)("div",{className:"sb-title",children:"Mink"}),(0,s.jsx)("div",{className:"sb-sub",children:"v1"})]}),(0,s.jsxs)("div",{className:"sb-project",onClick:()=>t(e=>!e),children:[(0,s.jsx)(r.I,{name:"folder",size:13}),(0,s.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,s.jsx)("div",{className:"pname",children:y}),(0,s.jsx)("div",{className:"pslug",children:b})]}),(0,s.jsx)(r.I,{name:"chevDown",size:12,className:"pchev"})]}),v.map(n=>(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"sb-group",children:n.group}),n.items.map(n=>{let t=e===n.href||"/overview"===n.href&&"/"===e,a=n.countKey?j[n.countKey]:0;return(0,s.jsxs)(o(),{href:n.href,"aria-current":t?"page":void 0,className:"sb-item ".concat(t?"active":"").trim(),children:[(0,s.jsx)(r.I,{name:n.icon,size:13}),(0,s.jsx)("span",{children:n.label}),n.showDot&&g&&(0,s.jsx)("span",{className:"dot"}),a>0&&(0,s.jsx)("span",{className:"count",children:a})]},n.id)})]},n.group)),(0,s.jsx)("div",{style:{height:20}}),n&&(0,s.jsx)(p,{onClose:()=>t(!1)})]})}var g=t(5959),j=t(9863);let x=(0,g.v)()((0,j.Zr)(e=>({accent:"green",density:"compact",liveFeel:!0,tweaksOpen:!1,setAccent:n=>e({accent:n}),setDensity:n=>e({density:n}),setLiveFeel:n=>e({liveFeel:n}),setTweaksOpen:n=>e({tweaksOpen:n})}),{name:"mink-preferences",storage:(0,j.KU)(()=>localStorage),partialize:e=>({accent:e.accent,density:e.density,liveFeel:e.liveFeel})}));function y(){var e;let n=(0,i.usePathname)(),t=(0,d.f)(e=>{var n,t,s;return null!=(s=null==(t=e.overview)||null==(n=t.daemon)?void 0:n.running)&&s}),a=x(e=>e.setTweaksOpen),l=(0,d.f)(e=>e.projects.find(n=>n.id===e.activeProjectId)),c=null!=(e=null==l?void 0:l.name)?e:"Mink",o=function(e){for(let n of v)for(let t of n.items)if(t.href===e||"/overview"===t.href&&"/"===e)return{group:n.group,label:t.label};return{group:"Overview",label:"Sessions"}}(n||"/");return(0,s.jsxs)("header",{className:"topbar",children:[(0,s.jsxs)("div",{className:"tb-section",children:[(0,s.jsx)("span",{className:"muted",children:c}),(0,s.jsx)("span",{className:"sep",children:"/"}),(0,s.jsx)("span",{className:"muted",children:o.group}),(0,s.jsx)("span",{className:"sep",children:"/"}),(0,s.jsx)("span",{className:"crumb",children:o.label})]}),(0,s.jsx)("div",{className:"tb-spacer"}),(0,s.jsxs)("div",{className:"cmdk",title:"Command palette (coming soon)",children:[(0,s.jsx)(r.I,{name:"search",size:12}),(0,s.jsx)("span",{children:"Search files, notes, bugs…"}),(0,s.jsx)("kbd",{children:"⌘K"})]}),(0,s.jsxs)("span",{className:"daemon-pill",title:"Daemon ".concat(t?"online":"offline"),children:[(0,s.jsx)("span",{className:"pulse"}),(0,s.jsx)("span",{className:"mono",style:{fontSize:10.5},children:t?"daemon \xb7 online":"daemon \xb7 offline"})]}),(0,s.jsx)("button",{type:"button",className:"tb-icon-btn",title:"Refresh data",onClick:()=>location.reload(),children:(0,s.jsx)(r.I,{name:"refresh",size:13})}),(0,s.jsx)("button",{type:"button",className:"tb-icon-btn",title:"Tweaks",onClick:()=>a(!0),children:(0,s.jsx)(r.I,{name:"wand",size:13})}),(0,s.jsx)("button",{type:"button",className:"tb-icon-btn",title:"More","aria-label":"More",children:(0,s.jsx)(r.I,{name:"dots",size:14})})]})}function b(){var e,n,t,a;let i=(0,d.f)(e=>e.overview),l=(0,d.f)(e=>e.connected),c=(0,d.f)(e=>e.deadLetters.length),o=(0,d.f)(e=>e.tasks.length),r=null!=(t=null==i||null==(e=i.daemon)?void 0:e.running)&&t,h=null==i||null==(n=i.daemon)?void 0:n.pid,u=null==i?void 0:i.summary;return(0,s.jsxs)("footer",{className:"statusbar",children:[(0,s.jsxs)("span",{className:"sb-stat daemon-stat",children:[(0,s.jsx)("span",{className:"dot-mini"}),(0,s.jsx)("span",{className:"k",children:"daemon"}),(0,s.jsx)("span",{className:"v",children:r?h?"online \xb7 pid ".concat(h):"online":"offline"})]}),r&&(0,s.jsxs)(s.Fragment,{children:[u&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"sb-stat",children:[(0,s.jsx)("span",{className:"k",children:"sessions"}),(0,s.jsx)("span",{className:"v",children:u.totalSessions})]}),(0,s.jsxs)("span",{className:"sb-stat",children:[(0,s.jsx)("span",{className:"k",children:"reads"}),(0,s.jsx)("span",{className:"v",children:u.totalReads})]}),(0,s.jsxs)("span",{className:"sb-stat",children:[(0,s.jsx)("span",{className:"k",children:"writes"}),(0,s.jsx)("span",{className:"v",children:u.totalWrites})]}),(0,s.jsxs)("span",{className:"sb-stat",children:[(0,s.jsx)("span",{className:"k",children:"saved"}),(0,s.jsx)("span",{className:"v",children:(a=u.estimatedSavings)?a<1e3?String(a):"".concat((a/1e3).toFixed(1),"k"):"0"})]})]}),(0,s.jsx)("span",{style:{flex:1}}),(0,s.jsxs)("span",{className:"sb-stat",children:[(0,s.jsx)("span",{className:"k",children:"cron"}),(0,s.jsxs)("span",{className:"v",children:[o," tasks",c>0?" \xb7 ".concat(c," DLQ"):""]})]}),(0,s.jsxs)("span",{className:"sb-stat",children:[(0,s.jsx)("span",{className:"k",children:"sse"}),(0,s.jsx)("span",{className:"v",children:l?"connected":"reconnecting"})]})]}),!r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{style:{flex:1}}),(0,s.jsxs)("span",{className:"sb-stat",children:[(0,s.jsx)("span",{className:"k",children:"run"}),(0,s.jsx)("span",{className:"v",children:"mink daemon start"})]})]})]})}let w={Read:{type:"read",verb:"Read"},Create:{type:"write",verb:"Create"},Edit:{type:"write",verb:"Edit"},"Session start":{type:"session",verb:"Session started"},"Session end":{type:"session",verb:"Session ended"}};function k(){let e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,n=(0,d.f)(e=>e.actionLog),t=x(e=>e.liveFeel),[s,i]=(0,a.useState)(0);return(0,a.useEffect)(()=>{if(!t)return;let e=setInterval(()=>i(e=>e+1),4e3);return()=>clearInterval(e)},[t]),n.slice().reverse().slice(0,e).map((e,n)=>(function(e,n){var t,s,a;let i=null!=(s=w[e.action])?s:{type:"other",verb:e.action},l=null!=(a=null==(t=e.outcome)?void 0:t.toLowerCase())?a:"",c=l.includes("hit")||l.includes("saved")?"hit":l.includes("miss")||l.includes("blocked")?"warn":i.flavor;return{t:e.time,type:i.type,msg:i.verb,tgt:e.files||"—",meta:e.tokens&&"—"!==e.tokens?"".concat(e.tokens," tok"):e.outcome,flavor:c,id:"al-".concat(n,"-").concat(e.time,"-").concat(e.files)}})(e,n))}(24);return(0,s.jsxs)("aside",{className:"rail",children:[(0,s.jsxs)("div",{className:"rail-head",children:[(0,s.jsx)(r.I,{name:"activity",size:13}),(0,s.jsx)("h4",{children:"Live activity"}),(0,s.jsxs)("span",{className:"live",children:[(0,s.jsx)("span",{className:"d"})," streaming"]})]}),(0,s.jsxs)("div",{children:[0===e.length&&(0,s.jsxs)("div",{className:"empty",children:[(0,s.jsx)("h4",{children:"Waiting for events"}),(0,s.jsx)("span",{children:"activity will stream here as the daemon reports hook events."})]}),e.map((e,n)=>(0,s.jsxs)("div",{className:"evt ".concat(n<2?"fresh":"").trim(),children:[(0,s.jsx)("span",{className:"t",children:e.t}),(0,s.jsxs)("span",{className:"c",children:[(0,s.jsx)("b",{children:e.msg})," ",(0,s.jsx)("code",{children:e.tgt}),e.meta&&(0,s.jsx)("div",{className:"hit"===e.flavor?"hit":"muted",style:{marginTop:2,fontSize:10.5,fontFamily:"var(--font-mono), monospace"},children:e.meta})]})]},e.id))]})]})}let M=[["green","oklch(0.76 0.14 155)"],["amber","oklch(0.80 0.15 75)"],["blue","oklch(0.72 0.14 245)"],["violet","oklch(0.72 0.14 295)"]],N=[["compact","S"],["comfortable","M"],["spacious","L"]];function S(){var e;let n=x(e=>e.tweaksOpen),t=x(e=>e.setTweaksOpen),{theme:a,setTheme:i,resolvedTheme:c}=(0,l.D)(),o=null!=(e="system"===a?c:a)?e:"dark",r=x(e=>e.accent),d=x(e=>e.setAccent),h=x(e=>e.density),u=x(e=>e.setDensity),m=x(e=>e.liveFeel),p=x(e=>e.setLiveFeel);return n?(0,s.jsxs)("div",{className:"tweaks",role:"dialog","aria-label":"Tweaks",children:[(0,s.jsxs)("div",{className:"row",style:{marginBottom:6},children:[(0,s.jsx)("h4",{style:{margin:0},children:"Tweaks"}),(0,s.jsx)("button",{type:"button",className:"tb-icon-btn",style:{marginLeft:"auto"},onClick:()=>t(!1),"aria-label":"Close tweaks",children:(0,s.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:(0,s.jsx)("path",{d:"M6 6l12 12M6 18L18 6"})})})]}),(0,s.jsxs)("div",{className:"tw-row",children:[(0,s.jsx)("span",{className:"label",children:"Theme"}),(0,s.jsx)("div",{className:"seg",children:["light","dark"].map(e=>(0,s.jsx)("button",{type:"button",className:o===e?"on":"",onClick:()=>i(e),children:e},e))})]}),(0,s.jsxs)("div",{className:"tw-row",children:[(0,s.jsx)("span",{className:"label",children:"Accent"}),(0,s.jsx)("div",{className:"swatches",children:M.map(e=>{let[n,t]=e;return(0,s.jsx)("button",{type:"button",className:"sw ".concat(r===n?"on":"").trim(),style:{background:t},title:n,"aria-label":"Accent ".concat(n),onClick:()=>d(n)},n)})})]}),(0,s.jsxs)("div",{className:"tw-row",children:[(0,s.jsx)("span",{className:"label",children:"Density"}),(0,s.jsx)("div",{className:"seg",children:N.map(e=>{let[n,t]=e;return(0,s.jsx)("button",{type:"button",className:h===n?"on":"",onClick:()=>u(n),children:t},n)})})]}),(0,s.jsxs)("div",{className:"tw-row",children:[(0,s.jsx)("span",{className:"label",children:"Live indicators"}),(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":m,className:"toggle ".concat(m?"on":"").trim(),onClick:()=>p(!m)})]})]}):null}let z=[{done:!0,t:"Install mink",d:"bun add -g @drewpayment/mink"},{done:!0,t:"Initialize project",d:"mink init in your repo — registers Claude Code hooks"},{done:!1,t:"Start the daemon",d:"Runs scheduled tasks and streams live events to this UI"},{done:!1,t:"Optional — set up sync",d:"Git-backed sync of ~/.mink across machines"},{done:!1,t:"Optional — Discord bot",d:"DM your bot to capture, search, summarize from anywhere"}];function P(){let[e,n]=(0,a.useState)(!1);function t(){var e;null==(e=navigator.clipboard)||e.writeText("mink daemon start").then(()=>{n(!0),setTimeout(()=>n(!1),1600)})}return(0,s.jsx)("div",{className:"onboard",children:(0,s.jsxs)("div",{className:"onboard-card",children:[(0,s.jsxs)("div",{className:"row",style:{marginBottom:12},children:[(0,s.jsx)("div",{className:"sb-logo",style:{width:28,height:28,fontSize:14},children:"M"}),(0,s.jsxs)("div",{style:{marginLeft:10},children:[(0,s.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"var(--fg-0)"},children:"Mink"}),(0,s.jsx)("div",{className:"muted",style:{fontSize:11},children:"command center"})]}),(0,s.jsx)("span",{style:{marginLeft:"auto"},className:"chip",children:"daemon \xb7 offline"})]}),(0,s.jsx)("h2",{children:"Welcome back"}),(0,s.jsx)("p",{className:"sub",children:"The daemon isn't running. Start it to unlock the full command center — live sessions, scheduler, activity feed, and sync."}),(0,s.jsxs)("button",{type:"button",className:"cmd",onClick:t,title:"Click to copy",style:{textAlign:"left",width:"100%"},children:[(0,s.jsx)("span",{className:"prompt",children:"$"}),(0,s.jsx)("span",{children:"mink daemon start"}),(0,s.jsx)("span",{className:"copy",children:e?"copied!":"click to copy"})]}),(0,s.jsxs)("div",{className:"row tight",style:{marginBottom:14},children:[(0,s.jsx)(m.t,{variant:"primary",icon:"play",onClick:t,children:"Copy start command"}),(0,s.jsx)(m.t,{variant:"ghost",icon:"book",onClick:()=>window.open("https://github.com/drewpayment/mink","_blank"),children:"Read docs"})]}),(0,s.jsx)("div",{children:z.map((e,n)=>(0,s.jsxs)("div",{className:"onboard-step ".concat(e.done?"done":"").trim(),children:[(0,s.jsx)("div",{className:"n",children:e.done?(0,s.jsx)(r.I,{name:"check",size:11}):n+1}),(0,s.jsxs)("div",{className:"body",children:[(0,s.jsx)("div",{className:"t",children:e.t}),(0,s.jsx)("div",{className:"d",children:e.d})]})]},n))})]})})}let I=new Set(["/","/overview","/activity","/tokens","/waste","/scheduler","/daemon"]);function L(e){let{children:n}=e,t=(0,i.usePathname)(),{resolvedTheme:c}=(0,l.D)(),o=x(e=>e.accent),r=x(e=>e.density),h=x(e=>e.liveFeel),u=(0,d.f)(e=>{var n,t,s;return null!=(s=null==(t=e.overview)||null==(n=t.daemon)?void 0:n.running)&&s}),m=(0,d.f)(e=>null!=e.overview);(0,a.useEffect)(()=>{let e=document.body;e.dataset.theme="light"===c?"light":"dark",e.dataset.accent=o,e.dataset.density=r,e.dataset.live=h?"on":"off",e.dataset.daemon=u?"online":"offline"},[c,o,r,h,u]);let p=u&&I.has(null!=t?t:"/"),v=!u&&m&&("/"===t||"/overview"===t);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{id:"app-root",children:(0,s.jsxs)("div",{className:"shell ".concat(p?"with-rail":"").trim(),children:[(0,s.jsx)(f,{}),(0,s.jsx)(y,{}),(0,s.jsx)("main",{className:"main",children:v?(0,s.jsx)(P,{}):n}),p&&(0,s.jsx)(k,{}),(0,s.jsx)(b,{})]})}),(0,s.jsx)(S,{})]})}}},e=>{e.O(0,[718,189,441,255,358],()=>e(e.s=4658)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{63:(e,u,t)=>{"use strict";var r=t(7260);t.o(r,"usePathname")&&t.d(u,{usePathname:function(){return r.usePathname}}),t.o(r,"useRouter")&&t.d(u,{useRouter:function(){return r.useRouter}})},2365:(e,u,t)=>{Promise.resolve().then(t.bind(t,7322))},7322:(e,u,t)=>{"use strict";t.r(u),t.d(u,{default:()=>n});var r=t(2115),s=t(63);function n(){let e=(0,s.useRouter)();return(0,r.useEffect)(()=>{e.replace("/overview")},[e]),null}}},e=>{e.O(0,[441,255,358],()=>e(e.s=2365)),_N_E=e.O()}]);