@vheins/local-memory-mcp 0.5.20 → 0.5.22

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 (41) hide show
  1. package/dist/dashboard/public/assets/{index-CUNSfwmD.js → index-BrV31hFu.js} +1 -1
  2. package/dist/dashboard/public/index.html +1 -1
  3. package/dist/mcp/prompts/definitions/create-task.md +3 -2
  4. package/dist/mcp/prompts/definitions/task-management-guidelines.md +18 -13
  5. package/dist/mcp/prompts/definitions/task-memory-executor.md +8 -4
  6. package/dist/mcp/prompts/registry.d.ts +5 -1
  7. package/dist/mcp/prompts/registry.d.ts.map +1 -1
  8. package/dist/mcp/prompts/registry.js +14 -6
  9. package/dist/mcp/prompts/registry.js.map +1 -1
  10. package/dist/mcp/router.d.ts.map +1 -1
  11. package/dist/mcp/router.js +11 -7
  12. package/dist/mcp/router.js.map +1 -1
  13. package/dist/mcp/storage/sqlite.d.ts.map +1 -1
  14. package/dist/mcp/storage/sqlite.js +4 -2
  15. package/dist/mcp/storage/sqlite.js.map +1 -1
  16. package/dist/mcp/tests/router.test.js +3 -4
  17. package/dist/mcp/tests/router.test.js.map +1 -1
  18. package/dist/mcp/tests/tasks-search.test.js +16 -14
  19. package/dist/mcp/tests/tasks-search.test.js.map +1 -1
  20. package/dist/mcp/tests/tasks.bulk.test.js +78 -3
  21. package/dist/mcp/tests/tasks.bulk.test.js.map +1 -1
  22. package/dist/mcp/tests/tasks.e2e.test.js +1 -1
  23. package/dist/mcp/tests/tasks.e2e.test.js.map +1 -1
  24. package/dist/mcp/tools/memory.search.d.ts.map +1 -1
  25. package/dist/mcp/tools/memory.search.js +0 -1
  26. package/dist/mcp/tools/memory.search.js.map +1 -1
  27. package/dist/mcp/tools/schemas.d.ts +277 -84
  28. package/dist/mcp/tools/schemas.d.ts.map +1 -1
  29. package/dist/mcp/tools/schemas.js +124 -52
  30. package/dist/mcp/tools/schemas.js.map +1 -1
  31. package/dist/mcp/tools/task.bulk-manage.d.ts.map +1 -1
  32. package/dist/mcp/tools/task.bulk-manage.js +78 -0
  33. package/dist/mcp/tools/task.bulk-manage.js.map +1 -1
  34. package/dist/mcp/tools/task.manage.d.ts +2 -0
  35. package/dist/mcp/tools/task.manage.d.ts.map +1 -1
  36. package/dist/mcp/tools/task.manage.js +77 -16
  37. package/dist/mcp/tools/task.manage.js.map +1 -1
  38. package/dist/mcp/utils/mcp-response.d.ts.map +1 -1
  39. package/dist/mcp/utils/mcp-response.js +0 -2
  40. package/dist/mcp/utils/mcp-response.js.map +1 -1
  41. package/package.json +1 -1
@@ -64,7 +64,7 @@ ${e}</tr>
64
64
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${as(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=os(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+as(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=os(e);if(i===null)return as(n);e=i;let a=`<img src="${e}" alt="${as(n)}"`;return t&&(a+=` title="${as(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:as(e.text)}},_s=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},vs=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ga,this.options.renderer=this.options.renderer||new gs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _s}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},ys=class{options;block;constructor(e){this.options=e||Ga}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?hs.lex:hs.lexInline}provideParser(e=this.block){return e?vs.parse:vs.parseInline}},bs=new class{defaults=Wa();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=vs;Renderer=gs;TextRenderer=_s;Lexer=hs;Tokenizer=ms;Hooks=ys;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new gs(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ms(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ys;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];ys.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&ys.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return hs.lex(e,t??this.defaults)}parser(e,t){return vs.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?hs.lex:hs.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?vs.parse:vs.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?hs.lex:hs.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?vs.parse:vs.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
65
65
  Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+as(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function xs(e,t){return bs.parse(e,t)}xs.options=xs.setOptions=function(e){return bs.setOptions(e),xs.defaults=bs.defaults,Ka(xs.defaults),xs},xs.getDefaults=Wa,xs.defaults=Ga,xs.use=function(...e){return bs.use(...e),xs.defaults=bs.defaults,Ka(xs.defaults),xs},xs.walkTokens=function(e,t){return bs.walkTokens(e,t)},xs.parseInline=bs.parseInline,xs.Parser=vs,xs.parser=vs.parse,xs.Renderer=gs,xs.TextRenderer=_s,xs.Lexer=hs,xs.lexer=hs.lex,xs.Tokenizer=ms,xs.Hooks=ys,xs.parse=xs,xs.options,xs.setOptions,xs.use,xs.walkTokens,xs.parseInline,vs.parse,hs.lex;var{entries:Ss,setPrototypeOf:Cs,isFrozen:ws,getPrototypeOf:Ts,getOwnPropertyDescriptor:Es}=Object,{freeze:Ds,seal:Os,create:ks}=Object,{apply:As,construct:js}=typeof Reflect<`u`&&Reflect;Ds||=function(e){return e},Os||=function(e){return e},As||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},js||=function(e){return new e(...[...arguments].slice(1))};var Ms=Ks(Array.prototype.forEach),Ns=Ks(Array.prototype.lastIndexOf),Ps=Ks(Array.prototype.pop),Fs=Ks(Array.prototype.push),Is=Ks(Array.prototype.splice),Ls=Ks(String.prototype.toLowerCase),Rs=Ks(String.prototype.toString),zs=Ks(String.prototype.match),Bs=Ks(String.prototype.replace),Vs=Ks(String.prototype.indexOf),Hs=Ks(String.prototype.trim),Us=Ks(Object.prototype.hasOwnProperty),Ws=Ks(RegExp.prototype.test),Gs=qs(TypeError);function Ks(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return As(e,t,n)}}function qs(e){return function(){return js(e,[...arguments])}}function Q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ls;Cs&&Cs(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ws(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Js(e){for(let t=0;t<e.length;t++)Us(e,t)||(e[t]=null);return e}function Ys(e){let t=ks(null);for(let[n,r]of Ss(e))Us(e,n)&&(Array.isArray(r)?t[n]=Js(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=Ys(r):t[n]=r);return t}function Xs(e,t){for(;e!==null;){let n=Es(e,t);if(n){if(n.get)return Ks(n.get);if(typeof n.value==`function`)return Ks(n.value)}e=Ts(e)}function n(){return null}return n}var Zs=Ds(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Qs=Ds(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),$s=Ds([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),ec=Ds([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),tc=Ds(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),nc=Ds([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),rc=Ds([`#text`]),ic=Ds(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot`.split(`.`)),ac=Ds(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),oc=Ds(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),sc=Ds([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),cc=Os(/\{\{[\w\W]*|[\w\W]*\}\}/gm),lc=Os(/<%[\w\W]*|[\w\W]*%>/gm),uc=Os(/\$\{[\w\W]*/gm),dc=Os(/^data-[\-\w.\u00B7-\uFFFF]+$/),fc=Os(/^aria-[\-\w]+$/),pc=Os(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mc=Os(/^(?:\w+script|data):/i),hc=Os(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gc=Os(/^html$/i),_c=Os(/^[a-z][.\w]*(-[.\w]+)+$/i),vc=Object.freeze({__proto__:null,ARIA_ATTR:fc,ATTR_WHITESPACE:hc,CUSTOM_ELEMENT:_c,DATA_ATTR:dc,DOCTYPE_NAME:gc,ERB_EXPR:lc,IS_ALLOWED_URI:pc,IS_SCRIPT_OR_DATA:mc,MUSTACHE_EXPR:cc,TMPLIT_EXPR:uc}),yc={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bc=function(){return typeof window>`u`?null:window},xc=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Sc=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Cc(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bc(),t=e=>Cc(e);if(t.version=`3.3.3`,t.removed=[],!e||!e.document||e.document.nodeType!==yc.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=Xs(m,`cloneNode`),g=Xs(m,`remove`),_=Xs(m,`nextSibling`),v=Xs(m,`childNodes`),y=Xs(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:C,createDocumentFragment:w,getElementsByTagName:T}=n,{importNode:E}=r,D=Sc();t.isSupported=typeof Ss==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ee,ERB_EXPR:te,TMPLIT_EXPR:ne,DATA_ATTR:re,ARIA_ATTR:ie,IS_SCRIPT_OR_DATA:ae,ATTR_WHITESPACE:oe,CUSTOM_ELEMENT:se}=vc,{IS_ALLOWED_URI:ce}=vc,le=null,ue=Q({},[...Zs,...Qs,...$s,...tc,...rc]),de=null,fe=Q({},[...ic,...ac,...oc,...sc]),pe=Object.seal(ks(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),me=null,he=null,ge=Object.seal(ks(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),_e=!0,ve=!0,ye=!1,be=!0,xe=!1,Se=!0,Ce=!1,we=!1,Te=!1,Ee=!1,De=!1,Oe=!1,ke=!0,O=!1,Ae=!0,k=!1,je={},Me=null,A=Q({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Ne=null,Pe=Q({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Fe=null,Ie=Q({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Le=`http://www.w3.org/1998/Math/MathML`,Re=`http://www.w3.org/2000/svg`,ze=`http://www.w3.org/1999/xhtml`,Be=ze,Ve=!1,He=null,Ue=Q({},[Le,Re,ze],Rs),We=Q({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ge=Q({},[`annotation-xml`]),Ke=Q({},[`title`,`style`,`font`,`a`,`script`]),qe=null,Je=[`application/xhtml+xml`,`text/html`],Ye=null,Xe=null,Ze=n.createElement(`form`),Qe=function(e){return e instanceof RegExp||e instanceof Function},$e=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Xe&&Xe===e)){if((!e||typeof e!=`object`)&&(e={}),e=Ys(e),qe=Je.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Ye=qe===`application/xhtml+xml`?Rs:Ls,le=Us(e,`ALLOWED_TAGS`)?Q({},e.ALLOWED_TAGS,Ye):ue,de=Us(e,`ALLOWED_ATTR`)?Q({},e.ALLOWED_ATTR,Ye):fe,He=Us(e,`ALLOWED_NAMESPACES`)?Q({},e.ALLOWED_NAMESPACES,Rs):Ue,Fe=Us(e,`ADD_URI_SAFE_ATTR`)?Q(Ys(Ie),e.ADD_URI_SAFE_ATTR,Ye):Ie,Ne=Us(e,`ADD_DATA_URI_TAGS`)?Q(Ys(Pe),e.ADD_DATA_URI_TAGS,Ye):Pe,Me=Us(e,`FORBID_CONTENTS`)?Q({},e.FORBID_CONTENTS,Ye):A,me=Us(e,`FORBID_TAGS`)?Q({},e.FORBID_TAGS,Ye):Ys({}),he=Us(e,`FORBID_ATTR`)?Q({},e.FORBID_ATTR,Ye):Ys({}),je=Us(e,`USE_PROFILES`)?e.USE_PROFILES:!1,_e=e.ALLOW_ARIA_ATTR!==!1,ve=e.ALLOW_DATA_ATTR!==!1,ye=e.ALLOW_UNKNOWN_PROTOCOLS||!1,be=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=e.SAFE_FOR_TEMPLATES||!1,Se=e.SAFE_FOR_XML!==!1,Ce=e.WHOLE_DOCUMENT||!1,Ee=e.RETURN_DOM||!1,De=e.RETURN_DOM_FRAGMENT||!1,Oe=e.RETURN_TRUSTED_TYPE||!1,Te=e.FORCE_BODY||!1,ke=e.SANITIZE_DOM!==!1,O=e.SANITIZE_NAMED_PROPS||!1,Ae=e.KEEP_CONTENT!==!1,k=e.IN_PLACE||!1,ce=e.ALLOWED_URI_REGEXP||pc,Be=e.NAMESPACE||ze,We=e.MATHML_TEXT_INTEGRATION_POINTS||We,Ge=e.HTML_INTEGRATION_POINTS||Ge,pe=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Qe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(pe.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Qe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(pe.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(pe.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xe&&(ve=!1),De&&(Ee=!0),je&&(le=Q({},rc),de=ks(null),je.html===!0&&(Q(le,Zs),Q(de,ic)),je.svg===!0&&(Q(le,Qs),Q(de,ac),Q(de,sc)),je.svgFilters===!0&&(Q(le,$s),Q(de,ac),Q(de,sc)),je.mathMl===!0&&(Q(le,tc),Q(de,oc),Q(de,sc))),Us(e,`ADD_TAGS`)||(ge.tagCheck=null),Us(e,`ADD_ATTR`)||(ge.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?ge.tagCheck=e.ADD_TAGS:(le===ue&&(le=Ys(le)),Q(le,e.ADD_TAGS,Ye))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?ge.attributeCheck=e.ADD_ATTR:(de===fe&&(de=Ys(de)),Q(de,e.ADD_ATTR,Ye))),e.ADD_URI_SAFE_ATTR&&Q(Fe,e.ADD_URI_SAFE_ATTR,Ye),e.FORBID_CONTENTS&&(Me===A&&(Me=Ys(Me)),Q(Me,e.FORBID_CONTENTS,Ye)),e.ADD_FORBID_CONTENTS&&(Me===A&&(Me=Ys(Me)),Q(Me,e.ADD_FORBID_CONTENTS,Ye)),Ae&&(le[`#text`]=!0),Ce&&Q(le,[`html`,`head`,`body`]),le.table&&(Q(le,[`tbody`]),delete me.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Gs(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Gs(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=xc(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));Ds&&Ds(e),Xe=e}},et=Q({},[...Qs,...$s,...ec]),tt=Q({},[...tc,...nc]),nt=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:Be,tagName:`template`});let n=Ls(e.tagName),r=Ls(t.tagName);return He[e.namespaceURI]?e.namespaceURI===Re?t.namespaceURI===ze?n===`svg`:t.namespaceURI===Le?n===`svg`&&(r===`annotation-xml`||We[r]):!!et[n]:e.namespaceURI===Le?t.namespaceURI===ze?n===`math`:t.namespaceURI===Re?n===`math`&&Ge[r]:!!tt[n]:e.namespaceURI===ze?t.namespaceURI===Re&&!Ge[r]||t.namespaceURI===Le&&!We[r]?!1:!tt[n]&&(Ke[n]||!et[n]):!!(qe===`application/xhtml+xml`&&He[e.namespaceURI]):!1},rt=function(e){Fs(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},it=function(e,n){try{Fs(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Fs(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Ee||De)try{rt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},at=function(e){let t=null,r=null;if(Te)e=`<remove></remove>`+e;else{let t=zs(e,/^[\r\n\t ]+/);r=t&&t[0]}qe===`application/xhtml+xml`&&Be===ze&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(Be===ze)try{t=new f().parseFromString(i,qe)}catch{}if(!t||!t.documentElement){t=S.createDocument(Be,`template`,null);try{t.documentElement.innerHTML=Ve?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Be===ze?T.call(t,Ce?`html`:`body`)[0]:Ce?t.documentElement:a},ot=function(e){return C.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},j=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},st=function(e){return typeof s==`function`&&e instanceof s};function M(e,n,r){Ms(e,e=>{e.call(t,n,r,Xe)})}let ct=function(e){let n=null;if(M(D.beforeSanitizeElements,e,null),j(e))return rt(e),!0;let r=Ye(e.nodeName);if(M(D.uponSanitizeElement,e,{tagName:r,allowedTags:le}),Se&&e.hasChildNodes()&&!st(e.firstElementChild)&&Ws(/<[/\w!]/g,e.innerHTML)&&Ws(/<[/\w!]/g,e.textContent)||e.nodeType===yc.progressingInstruction||Se&&e.nodeType===yc.comment&&Ws(/<[/\w]/g,e.data))return rt(e),!0;if(!(ge.tagCheck instanceof Function&&ge.tagCheck(r))&&(!le[r]||me[r])){if(!me[r]&&ut(r)&&(pe.tagNameCheck instanceof RegExp&&Ws(pe.tagNameCheck,r)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(r)))return!1;if(Ae&&!Me[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,_(e))}}}return rt(e),!0}return e instanceof c&&!nt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ws(/<\/no(script|embed|frames)/i,e.innerHTML)?(rt(e),!0):(xe&&e.nodeType===yc.text&&(n=e.textContent,Ms([ee,te,ne],e=>{n=Bs(n,e,` `)}),e.textContent!==n&&(Fs(t.removed,{element:e.cloneNode()}),e.textContent=n)),M(D.afterSanitizeElements,e,null),!1)},lt=function(e,t,r){if(he[t]||ke&&(t===`id`||t===`name`)&&(r in n||r in Ze))return!1;if(!(ve&&!he[t]&&Ws(re,t))&&!(_e&&Ws(ie,t))&&!(ge.attributeCheck instanceof Function&&ge.attributeCheck(t,e))){if(!de[t]||he[t]){if(!(ut(e)&&(pe.tagNameCheck instanceof RegExp&&Ws(pe.tagNameCheck,e)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(e))&&(pe.attributeNameCheck instanceof RegExp&&Ws(pe.attributeNameCheck,t)||pe.attributeNameCheck instanceof Function&&pe.attributeNameCheck(t,e))||t===`is`&&pe.allowCustomizedBuiltInElements&&(pe.tagNameCheck instanceof RegExp&&Ws(pe.tagNameCheck,r)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(r))))return!1}else if(!Fe[t]&&!Ws(ce,Bs(r,oe,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Vs(r,`data:`)===0&&Ne[e])&&!(ye&&!Ws(ae,Bs(r,oe,``)))&&r)return!1}return!0},ut=function(e){return e!==`annotation-xml`&&zs(e,se)},N=function(e){M(D.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||j(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:de,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=Ye(a),l=s,u=a===`value`?l:Hs(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,M(D.uponSanitizeAttribute,e,r),u=r.attrValue,O&&(c===`id`||c===`name`)&&(it(a,e),u=`user-content-`+u),Se&&Ws(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){it(a,e);continue}if(c===`attributename`&&zs(u,`href`)){it(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){it(a,e);continue}if(!be&&Ws(/\/>/i,u)){it(a,e);continue}xe&&Ms([ee,te,ne],e=>{u=Bs(u,e,` `)});let d=Ye(e.nodeName);if(!lt(d,c,u)){it(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),j(e)?rt(e):Ps(t.removed)}catch{it(a,e)}}M(D.afterSanitizeAttributes,e,null)},dt=function e(t){let n=null,r=ot(t);for(M(D.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)M(D.uponSanitizeShadowNode,n,null),ct(n),N(n),n.content instanceof a&&e(n.content);M(D.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(Ve=!e,Ve&&(e=`<!-->`),typeof e!=`string`&&!st(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw Gs(`dirty is not a string, aborting`)}else throw Gs(`toString is not a function`);if(!t.isSupported)return e;if(we||$e(n),t.removed=[],typeof e==`string`&&(k=!1),k){if(e.nodeName){let t=Ye(e.nodeName);if(!le[t]||me[t])throw Gs(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=at(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===yc.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!Ee&&!xe&&!Ce&&e.indexOf(`<`)===-1)return b&&Oe?b.createHTML(e):e;if(i=at(e),!i)return Ee?null:Oe?x:``}i&&Te&&rt(i.firstChild);let u=ot(k?e:i);for(;c=u.nextNode();)ct(c),N(c),c.content instanceof a&&dt(c.content);if(k)return e;if(Ee){if(De)for(l=w.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(de.shadowroot||de.shadowrootmode)&&(l=E.call(r,l,!0)),l}let d=Ce?i.outerHTML:i.innerHTML;return Ce&&le[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ws(gc,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
66
66
  `+d),xe&&Ms([ee,te,ne],e=>{d=Bs(d,e,` `)}),b&&Oe?b.createHTML(d):d},t.setConfig=function(){$e(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),we=!0},t.clearConfig=function(){Xe=null,we=!1},t.isValidAttribute=function(e,t,n){return Xe||$e({}),lt(Ye(e),Ye(t),n)},t.addHook=function(e,t){typeof t==`function`&&Fs(D[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Ns(D[e],t);return n===-1?void 0:Is(D[e],n,1)[0]}return Ps(D[e])},t.removeHooks=function(e){D[e]=[]},t.removeAllHooks=function(){D=Sc()},t}var wc=Cc();function Tc(e){let t=new Date(e),n=Math.floor((new Date().getTime()-t.getTime())/1e3);return n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<604800?`${Math.floor(n/86400)}d ago`:t.toLocaleDateString()}function Ec(e){return e?e>=1e6?(e/1e6).toFixed(1)+`M`:e>=1e3?(e/1e3).toFixed(1)+`k`:e.toString():`0`}function Dc(e){if(!e||e<=0)return`0m`;if(e<60)return`${Math.round(e)}s`;let t=e/60;if(t<60)return`${Math.round(t)}m`;let n=t/60;return n<24?`${Math.round(n)}h`:`${Math.round(n/24)}d`}function Oc(e){return e.split(/[\/\-_.]/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()||``).join(``).slice(0,2)||`RP`}function kc(e){return{backlog:`status-backlog`,pending:`status-pending`,in_progress:`status-inprogress`,completed:`status-completed`,blocked:`status-blocked`,canceled:`status-canceled`}[e]||`status-default`}function Ac(e){return{backlog:`Backlog`,pending:`To Do`,in_progress:`In Progress`,completed:`Completed`,blocked:`Blocked`,canceled:`Canceled`}[e]||e}function jc(e){return{1:`Low`,2:`Normal`,3:`Medium`,4:`High`,5:`Critical`}[e]||String(e)}function Mc(e){try{let t=xs.parse(e||``);return wc.sanitize(t)}catch{return e||``}}function Nc(e,t){let n=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t,i.click(),URL.revokeObjectURL(r)}function Pc(e,t){if(!e.length)return;let n=Object.keys(e[0]),r=[n.join(`,`),...e.map(e=>n.map(t=>JSON.stringify(e[t]??``)).join(`,`))].join(`
67
- `),i=new Blob([r],{type:`text/csv`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=t,o.click(),URL.revokeObjectURL(a)}function Fc(e,t){let n;return((...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)})}async function Ic(e){if(!e)return!1;try{return await navigator.clipboard.writeText(e),!0}catch(e){return console.error(`Failed to copy text: `,e),!1}}function Lc(e){let t=null;function n(t){ma.set(t),localStorage.setItem(`selectedRepo`,t),e&&e(t)}function r(e,t){t.preventDefault(),t.stopPropagation(),ga.update(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}function i(){ha.update(e=>!e)}function a(e,n){t=e,n.dataTransfer&&(n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,e)),n.currentTarget.classList.add(`opacity-50`)}function o(e,n){!t||t===e||(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect=`move`))}function s(e,n){n.preventDefault();let r=t||n.dataTransfer?.getData(`text/plain`);!r||r===e||(ga.update(t=>{let n=t.filter(e=>e!==r),i=n.indexOf(e);return n.splice(i,0,r),n}),t=null)}function c(e){t=null,e.currentTarget.classList.remove(`opacity-50`),document.querySelectorAll(`.repo-item.drag-over`).forEach(e=>e.classList.remove(`drag-over`))}return{selectRepo:n,togglePin:r,toggleCollapse:i,onDragStart:a,onDragOver:o,onDrop:s,onDragEnd:c,getRepoInitials:Oc}}var Rc=Yr(`<circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><path d="M12 17h.01"></path>`,1),zc=Yr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><!></svg>`);function $(e,t){let n=Z(t,`name`,8),r=Z(t,`size`,8,16),i=Z(t,`strokeWidth`,8,1.75),a=Z(t,`className`,8,``),o={brain:`<path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"/><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"/><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"/><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"/><path d="M3.477 10.896a4 4 0 0 1 .585-.396"/><path d="M19.938 10.5a4 4 0 0 1 .585.396"/><path d="M6 18a4 4 0 0 1-1.967-.516"/><path d="M19.967 17.484A4 4 0 0 1 18 18"/>`,"layout-dashboard":`<rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/>`,database:`<ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5V19A9 3 0 0 0 21 19V5"/><path d="M3 12A9 3 0 0 0 21 12"/>`,"clipboard-list":`<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="M12 11h4"/><path d="M12 16h4"/><path d="M8 11h.01"/><path d="M8 16h.01"/>`,"book-open":`<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/>`,"refresh-cw":`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>`,sun:`<circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/>`,moon:`<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>`,menu:`<line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/>`,"chevron-left":`<path d="m15 18-6-6 6-6"/>`,"chevron-right":`<path d="m9 18 6-6-6-6"/>`,"chevron-down":`<path d="m6 9 6 6 6-6"/>`,x:`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`,plus:`<path d="M5 12h14"/><path d="M12 5v14"/>`,search:`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>`,pin:`<path d="M12.586 2.586a2 2 0 0 1 2.828 0l2 2a2 2 0 0 1 0 2.828l-1.793 1.793-.914 4.57a1 1 0 0 1-.271.51l-1.414 1.414a1 1 0 0 1-1.414 0l-2.122-2.121-4.172 4.171a1 1 0 1 1-1.414-1.414l4.171-4.172-2.12-2.12a1 1 0 0 1 0-1.415l1.413-1.414a1 1 0 0 1 .51-.27l4.57-.915 1.792-1.793Z"/>`,star:`<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/>`,edit:`<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4Z"/>`,trash:`<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>`,copy:`<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>`,"external-link":`<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>`,filter:`<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/>`,sliders:`<line x1="4" x2="4" y1="21" y2="14"/><line x1="4" x2="4" y1="6" y2="3"/><line x1="12" x2="12" y1="21" y2="12"/><line x1="12" x2="12" y1="6" y2="3"/><line x1="20" x2="20" y1="21" y2="16"/><line x1="20" x2="20" y1="10" y2="3"/><line x1="1" x2="7" y1="14" y2="14"/><line x1="9" x2="15" y1="12" y2="12"/><line x1="17" x2="23" y1="16" y2="16"/>`,"circle-dot":`<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="1"/>`,"circle-check":`<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>`,"circle-x":`<circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/>`,"circle-pause":`<circle cx="12" cy="12" r="10"/><line x1="10" x2="10" y1="15" y2="9"/><line x1="14" x2="14" y1="15" y2="9"/>`,"circle-pause-alt":`<circle cx="12" cy="12" r="10"/><path d="M10 9v6"/><path d="M14 9v6"/>`,"triangle-alert":`<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/>`,check:`<path d="M20 6 9 17l-5-5"/>`,info:`<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>`,zap:`<path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"/>`,activity:`<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"/>`,memory:`<path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"/>`,"git-branch":`<line x1="6" x2="6" y1="3" y2="15"/><circle cx="18" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><path d="M18 9a9 9 0 0 1-9 9"/>`,tag:`<path d="M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"/><circle cx="7.5" cy="7.5" r=".5" fill="currentColor"/>`,user:`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>`,bot:`<path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M15 13v2"/><path d="M9 13v2"/>`,code:`<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>`,terminal:`<polyline points="4 17 10 11 4 5"/><line x1="12" x2="20" y1="19" y2="19"/>`,"file-text":`<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>`,layers:`<path d="m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"/><path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"/><path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"/>`,cpu:`<rect x="4" y="4" width="16" height="16" rx="2"/><rect x="9" y="9" width="6" height="6"/><path d="M15 2v2"/><path d="M15 20v2"/><path d="M2 15h2"/><path d="M2 9h2"/><path d="M20 15h2"/><path d="M20 9h2"/><path d="M9 2v2"/><path d="M9 20v2"/>`,clock:`<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>`,calendar:`<rect width="18" height="18" x="3" y="4" rx="2" ry="2"/><line x1="16" x2="16" y1="2" y2="6"/><line x1="8" x2="8" y1="2" y2="6"/><line x1="3" x2="21" y1="10" y2="10"/>`,"arrow-up":`<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>`,"arrow-down":`<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>`,"arrow-right":`<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>`,"trending-up":`<polyline points="22 7 13.5 15.5 8.5 10.5 2 17"/><polyline points="16 7 22 7 22 13"/>`,"bar-chart":`<line x1="12" x2="12" y1="20" y2="10"/><line x1="18" x2="18" y1="20" y2="4"/><line x1="6" x2="6" y1="20" y2="16"/>`,list:`<line x1="8" x2="21" y1="6" y2="6"/><line x1="8" x2="21" y1="12" y2="12"/><line x1="8" x2="21" y1="18" y2="18"/><line x1="3" x2="3.01" y1="6" y2="6"/><line x1="3" x2="3.01" y1="12" y2="12"/><line x1="3" x2="3.01" y1="18" y2="18"/>`,tool:`<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>`,columns:`<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="12" x2="12" y1="3" y2="21"/>`,sparkle:`<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>`,settings:`<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>`,wifi:`<path d="M5 12.55a11 11 0 0 1 14.08 0"/><path d="M1.42 9a16 16 0 0 1 21.16 0"/><path d="M8.53 16.11a6 6 0 0 1 6.95 0"/><line x1="12" x2="12.01" y1="20" y2="20"/>`,hash:`<line x1="4" x2="20" y1="9" y2="9"/><line x1="4" x2="20" y1="15" y2="15"/><line x1="10" x2="8" y1="3" y2="21"/><line x1="16" x2="14" y1="3" y2="21"/>`,inbox:`<polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>`,archive:`<rect width="20" height="5" x="2" y="3" rx="1"/><path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"/><path d="M10 12h4"/>`};var s=zc(),c=F(s),l=e=>{var t=Xr();di(I(t),()=>(U(n()),H(()=>o[n()])),void 0,!0),K(e,t)},u=e=>{var t=Rc();Ne(2),K(e,t)};J(c,e=>{U(n()),H(()=>o[n()])?e(l):e(u,-1)}),A(s),R(()=>{Wi(s,`width`,r()),Wi(s,`height`,r()),Wi(s,`stroke-width`,i()),Ai(s,0,wi(a()))}),K(e,s)}var Bc=G(`<div class="flex items-center gap-2"><div class="brand-icon svelte-vbr9x3"><!></div> <div><div class="font-bold text-sm" style="color:var(--color-text);letter-spacing:-0.02em;">Memory MCP</div> <div class="section-label" style="font-size:0.6rem;margin-top:0;">Dashboard</div></div></div>`),Vc=G(`<div class="brand-icon svelte-vbr9x3" style="margin:auto;"><!></div>`),Hc=G(`<div class="p-3" style="border-bottom: 1px solid var(--color-border);"><div class="search-wrapper svelte-vbr9x3"><span class="search-icon svelte-vbr9x3"><!></span> <input class="form-input search-input svelte-vbr9x3" type="text" placeholder="Search repos…"/></div></div>`),Uc=G(`<div class="repo-active-indicator"></div>`),Wc=G(`<span class="task-badge active svelte-vbr9x3"><!> </span>`),Gc=G(`<span class="task-badge todo svelte-vbr9x3"><!> </span>`),Kc=G(`<span class="task-badge blocked svelte-vbr9x3"><!> </span>`),qc=G(`<span class="task-badge backlog svelte-vbr9x3"><!> </span>`),Jc=G(`<div class="task-badges svelte-vbr9x3"><!> <!> <!> <!></div>`),Yc=G(`<div role="button" tabindex="0" draggable="true"><!> <div class="repo-avatar"> <span class="pin-star svelte-vbr9x3">★</span></div> <div class="min-w-0 flex-1"><div class="truncate font-semibold" style="font-size:0.82rem;color:var(--color-text);"> </div> <div class="truncate flex items-center gap-1" style="font-size:0.68rem;color:var(--color-text-muted);margin-bottom:2px;"><!> </div> <!></div> <button class="pin-btn svelte-vbr9x3" title="Unpin" aria-label="Unpin repository"><!></button></div>`),Xc=G(`<div class="group-label svelte-vbr9x3"><!> Pinned</div> <!>`,1),Zc=G(`<div class="group-label svelte-vbr9x3" style="margin-top:6px;"><!> All</div>`),Qc=G(`<div class="repo-active-indicator"></div>`),$c=G(`<span class="task-badge active svelte-vbr9x3"><!> </span>`),el=G(`<span class="task-badge todo svelte-vbr9x3"><!> </span>`),tl=G(`<span class="task-badge blocked svelte-vbr9x3"><!> </span>`),nl=G(`<span class="task-badge backlog svelte-vbr9x3"><!> </span>`),rl=G(`<div class="task-badges svelte-vbr9x3"><!> <!> <!> <!></div>`),il=G(`<div role="button" tabindex="0"><!> <div class="repo-avatar"> </div> <div class="min-w-0 flex-1"><div class="truncate font-semibold" style="font-size:0.82rem;color:var(--color-text);"> </div> <div class="truncate flex items-center gap-1" style="font-size:0.68rem;color:var(--color-text-muted);margin-bottom:2px;"><!> </div> <!></div> <button class="pin-btn svelte-vbr9x3" title="Pin" aria-label="Pin repository"><!></button></div>`),al=G(`<!> <!>`,1),ol=G(`<div style="text-align:center;padding:24px 16px;color:var(--color-text-muted);"><!> <div style="font-size:0.82rem;margin-top:8px;">No repositories found</div></div>`),sl=G(`<div class="flex items-center justify-between px-2 py-1 mb-1"><span class="section-label">Repositories</span> <span class="repo-count-chip svelte-vbr9x3"> </span></div> <!> <!> <!>`,1),cl=G(`<div class="repo-active-indicator"></div>`),ll=G(`<div role="button" tabindex="0"><!> <div class="repo-avatar" style="margin:auto;"> </div></div>`),ul=G(`<aside style="border-right: 1px solid var(--color-border);"><div class="sidebar-header svelte-vbr9x3" style="border-bottom: 1px solid var(--color-border);"><!> <button class="btn btn-ghost btn-icon btn-sm collapse-btn svelte-vbr9x3"><span><!></span></button></div> <!> <div class="overflow-y-auto flex-1 p-2" style="scrollbar-width: thin;"><!></div></aside>`);function dl(e,t){We(t,!1);let n=()=>N(ha,`$isRepoSidebarCollapsed`,s),r=()=>N(_a,`$repoSearchQuery`,s),i=()=>N(pa,`$availableRepos`,s),a=()=>N(La,`$orderedRepos`,s),o=()=>N(ma,`$currentRepo`,s),[s,c]=ft(),l=on(),u=Lc(Z(t,`onRepoSelect`,8,()=>{})());Un(()=>n(),()=>{sn(l,n())}),Wn(),na();var d=ul();let f;var p=F(d),m=F(p),h=e=>{var t=Bc(),n=F(t);$(F(n),{name:`brain`,size:14,strokeWidth:1.75}),A(n),Ne(2),A(t),K(e,t)},g=e=>{var t=Vc();$(F(t),{name:`brain`,size:14,strokeWidth:1.75}),A(t),K(e,t)};J(m,e=>{V(l)?e(g,-1):e(h)});var _=L(m,2),v=F(_);$(F(v),{name:`chevron-left`,size:14,strokeWidth:2}),A(v),A(_),A(p);var y=L(p,2),b=e=>{var t=Hc(),n=F(t),i=F(n);$(F(i),{name:`search`,size:13,strokeWidth:2}),A(i);var a=L(i,2);Vi(a),A(n),A(t),Ji(a,r,e=>dt(_a,e)),K(e,t)};J(y,e=>{V(l)||e(b)});var x=L(y,2),S=F(x),C=e=>{var t=sl(),n=I(t),r=L(F(n),2),s=F(r,!0);A(r),A(n);var c=L(n,2),l=e=>{var t=Xc(),n=I(t);$(F(n),{name:`star`,size:10,strokeWidth:2}),Ne(),A(n),X(L(n,2),1,()=>(a(),H(()=>a().pinned)),Y,(e,t)=>{var n=Yc();let r;var i=F(n),a=e=>{K(e,Uc())};J(i,e=>{o(),V(t),H(()=>o()===V(t).repo)&&e(a)});var s=L(i,2),c=F(s);Ne(),A(s);var l=L(s,2),d=F(l),f=F(d,!0);A(d);var p=L(d,2),m=F(p);$(m,{name:`database`,size:9,strokeWidth:2});var h=L(m);A(p);var g=L(p,2),_=e=>{var n=Jc(),r=F(n),i=e=>{var n=Wc(),r=F(n);$(r,{name:`zap`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).in_progress_count))??``}`)),K(e,n)};J(r,e=>{V(t),H(()=>V(t).in_progress_count)&&e(i)});var a=L(r,2),o=e=>{var n=Gc(),r=F(n);$(r,{name:`circle-dot`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).pending_count))??``}`)),K(e,n)};J(a,e=>{V(t),H(()=>V(t).pending_count)&&e(o)});var s=L(a,2),c=e=>{var n=Kc(),r=F(n);$(r,{name:`triangle-alert`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).blocked_count))??``}`)),K(e,n)};J(s,e=>{V(t),H(()=>V(t).blocked_count)&&e(c)});var l=L(s,2),u=e=>{var n=qc(),r=F(n);$(r,{name:`archive`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).backlog_count))??``}`)),K(e,n)};J(l,e=>{V(t),H(()=>V(t).backlog_count)&&e(u)}),A(n),K(e,n)};J(g,e=>{V(t),H(()=>(V(t).in_progress_count||0)+(V(t).pending_count||0)+(V(t).blocked_count||0)+(V(t).backlog_count||0)>0)&&e(_)}),A(l);var v=L(l,2);$(F(v),{name:`pin`,size:12,strokeWidth:1.75}),A(v),A(n),R(e=>{r=Ai(n,1,`repo-item svelte-vbr9x3`,null,r,{active:o()===V(t).repo}),Wi(n,`title`,`${(V(t),H(()=>V(t).repo))??``} • ${(V(t),H(()=>V(t).memory_count))??``} memories`),q(c,`${e??``} `),q(f,(V(t),H(()=>V(t).repo))),q(h,` ${(V(t),H(()=>V(t).memory_count))??``} memories`)},[()=>(V(t),H(()=>u.getRepoInitials(V(t).repo)))]),W(`click`,v,e=>u.togglePin(V(t).repo,e)),W(`click`,n,()=>u.selectRepo(V(t).repo)),W(`keydown`,n,e=>(e.key===`Enter`||e.key===` `)&&u.selectRepo(V(t).repo)),W(`dragstart`,n,e=>u.onDragStart(V(t).repo,e)),W(`dragover`,n,e=>u.onDragOver(V(t).repo,e)),W(`drop`,n,e=>u.onDrop(V(t).repo,e)),W(`dragend`,n,function(...e){u.onDragEnd?.apply(this,e)}),K(e,n)}),K(e,t)};J(c,e=>{a(),H(()=>a().pinned.length>0)&&e(l)});var d=L(c,2),f=e=>{var t=al(),n=I(t),r=e=>{var t=Zc();$(F(t),{name:`layers`,size:10,strokeWidth:2}),Ne(),A(t),K(e,t)};J(n,e=>{a(),H(()=>a().pinned.length>0)&&e(r)}),X(L(n,2),1,()=>(a(),H(()=>a().unpinned)),Y,(e,t)=>{var n=il();let r;var i=F(n),a=e=>{K(e,Qc())};J(i,e=>{o(),V(t),H(()=>o()===V(t).repo)&&e(a)});var s=L(i,2),c=F(s,!0);A(s);var l=L(s,2),d=F(l),f=F(d,!0);A(d);var p=L(d,2),m=F(p);$(m,{name:`database`,size:9,strokeWidth:2});var h=L(m);A(p);var g=L(p,2),_=e=>{var n=rl(),r=F(n),i=e=>{var n=$c(),r=F(n);$(r,{name:`zap`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).in_progress_count))??``}`)),K(e,n)};J(r,e=>{V(t),H(()=>V(t).in_progress_count)&&e(i)});var a=L(r,2),o=e=>{var n=el(),r=F(n);$(r,{name:`circle-dot`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).pending_count))??``}`)),K(e,n)};J(a,e=>{V(t),H(()=>V(t).pending_count)&&e(o)});var s=L(a,2),c=e=>{var n=tl(),r=F(n);$(r,{name:`triangle-alert`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).blocked_count))??``}`)),K(e,n)};J(s,e=>{V(t),H(()=>V(t).blocked_count)&&e(c)});var l=L(s,2),u=e=>{var n=nl(),r=F(n);$(r,{name:`archive`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).backlog_count))??``}`)),K(e,n)};J(l,e=>{V(t),H(()=>V(t).backlog_count)&&e(u)}),A(n),K(e,n)};J(g,e=>{V(t),H(()=>(V(t).in_progress_count||0)+(V(t).pending_count||0)+(V(t).blocked_count||0)+(V(t).backlog_count||0)>0)&&e(_)}),A(l);var v=L(l,2);$(F(v),{name:`pin`,size:12,strokeWidth:1.75}),A(v),A(n),R(e=>{r=Ai(n,1,`repo-item svelte-vbr9x3`,null,r,{active:o()===V(t).repo}),Wi(n,`title`,`${(V(t),H(()=>V(t).repo))??``} • ${(V(t),H(()=>V(t).memory_count))??``} memories`),q(c,e),q(f,(V(t),H(()=>V(t).repo))),q(h,` ${(V(t),H(()=>V(t).memory_count))??``} memories`)},[()=>(V(t),H(()=>u.getRepoInitials(V(t).repo)))]),W(`click`,v,e=>u.togglePin(V(t).repo,e)),W(`click`,n,()=>u.selectRepo(V(t).repo)),W(`keydown`,n,e=>(e.key===`Enter`||e.key===` `)&&u.selectRepo(V(t).repo)),K(e,n)}),K(e,t)};J(d,e=>{a(),H(()=>a().unpinned.length>0)&&e(f)});var p=L(d,2),m=e=>{var t=ol();$(F(t),{name:`inbox`,size:24,strokeWidth:1.5}),Ne(2),A(t),K(e,t)};J(p,e=>{i(),H(()=>i().length===0)&&e(m)}),R(()=>q(s,(i(),H(()=>i().length)))),K(e,t)},w=e=>{var t=Xr();X(I(t),1,i,Y,(e,t)=>{var n=ll();let r;var i=F(n),a=e=>{K(e,cl())};J(i,e=>{o(),V(t),H(()=>o()===V(t).repo)&&e(a)});var s=L(i,2),c=F(s,!0);A(s),A(n),R(e=>{r=Ai(n,1,`repo-item collapsed`,null,r,{active:o()===V(t).repo}),Wi(n,`title`,(V(t),H(()=>V(t).repo))),q(c,e)},[()=>(V(t),H(()=>u.getRepoInitials(V(t).repo)))]),W(`click`,n,()=>u.selectRepo(V(t).repo)),W(`keydown`,n,e=>(e.key===`Enter`||e.key===` `)&&u.selectRepo(V(t).repo)),K(e,n)}),K(e,t)};J(S,e=>{V(l)?e(w,-1):e(C)}),A(x),A(d),R(()=>{f=Ai(d,1,`sidebar glass-strong flex flex-col`,null,f,{collapsed:V(l)}),Wi(_,`title`,V(l)?`Expand sidebar`:`Collapse sidebar`),Wi(_,`aria-label`,V(l)?`Expand`:`Collapse`),Mi(v,`transition: transform 0.3s ease; display:inline-flex; transform: rotate(${V(l)?`180deg`:`0deg`})`)}),W(`click`,_,function(...e){u.toggleCollapse?.apply(this,e)}),K(e,d),Ge(),c()}var fl=`https://github.com/vheins/local-memory-mcp`,pl=`https://www.npmjs.com/package/@vheins/local-memory-mcp`;function ml(e){let t=j(30),n=j(!1),r=j(null),i=j(!0),a;function o(e){return e>=1e6?(e/1e6).toFixed(1)+`M`:e>=1e3?(e/1e3).toFixed(1)+`k`:String(e)}async function s(){try{let e=await fetch(`https://api.npmjs.org/downloads/point/last-month/@vheins/local-memory-mcp`);if(e.ok){let t=await e.json();r.set(t.downloads??null)}}catch{r.set(null)}finally{i.set(!1)}}function c(){da.update(e=>e===`dark`?`light`:`dark`)}function l(){clearInterval(a),t.set(30),a=setInterval(()=>{t.update(t=>t<=1?(e(),30):t-1)},1e3)}async function u(){n.set(!0),e(),l(),setTimeout(()=>n.set(!1),800)}function d(){clearInterval(a)}return{countdownSeconds:t,refreshing:n,npmDownloads:r,npmLoading:i,formatDownloads:o,fetchNpmDownloads:s,toggleTheme:c,startCountdown:l,manualRefresh:u,getRepoInitials:Oc,destroy:d}}var hl=G(`<div class="flex items-center gap-1 svelte-2va9hf" style="font-size:0.65rem;color:var(--color-text-muted);"><!> <span class="svelte-2va9hf"> </span></div>`),gl=G(`<div class="flex items-center gap-2 svelte-2va9hf"><div style="width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,#0ea5e9,#6366f1);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:11px;color:white;flex-shrink:0;box-shadow:0 4px 10px rgba(14,165,233,0.28);" class="svelte-2va9hf"> </div> <div class="svelte-2va9hf"><div class="font-semibold svelte-2va9hf" style="font-size:0.82rem;color:var(--color-text);max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"> </div> <!></div></div>`),_l=G(`<div style="font-size:0.85rem;color:var(--color-text-muted);" class="flex items-center gap-2 svelte-2va9hf"><!> <span class="svelte-2va9hf">Select a repository</span></div>`),vl=G(`<span class="ext-link-label npm-dl-skeleton svelte-2va9hf"></span>`),yl=G(`<span class="ext-link-label npm-dl-badge svelte-2va9hf"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="svelte-2va9hf"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3" class="svelte-2va9hf"></path></svg> </span>`),bl=G(`<span class="ext-link-label svelte-2va9hf">npm</span>`),xl=G(`<div class="flex items-center gap-2 svelte-2va9hf"><div class="status-dot status-dot-online svelte-2va9hf"></div> <span style="font-size:0.72rem;font-weight:600;color:var(--color-text-muted);" class="svelte-2va9hf">Online</span> <span style="font-size:0.65rem;color:var(--color-text-muted);background:rgba(100,116,139,0.1);padding:1px 6px;border-radius:9999px;border:1px solid rgba(100,116,139,0.15);" class="svelte-2va9hf"> </span></div>`),Sl=G(`<span class="flex items-center gap-1 svelte-2va9hf" style="font-size:0.65rem;color:var(--color-text-muted);max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"><!> </span>`),Cl=G(`<header class="top-bar glass-strong svelte-2va9hf" style="border-bottom: 1px solid var(--color-border); z-index: 30;"><div class="flex items-center justify-between svelte-2va9hf" style="padding: 10px 20px; min-height: 60px;"><div class="flex items-center gap-3 svelte-2va9hf"><button class="btn btn-ghost btn-icon svelte-2va9hf" aria-label="Toggle menu" style="display:none;" id="mobileMenuBtn"><!></button> <!></div> <div class="flex items-center gap-2 svelte-2va9hf"><div class="ext-links-group svelte-2va9hf"><a target="_blank" rel="noopener noreferrer" class="ext-link-btn svelte-2va9hf" title="View on GitHub" aria-label="GitHub repository" id="githubLink"><svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" class="svelte-2va9hf"><path d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" class="svelte-2va9hf"></path></svg> <span class="ext-link-label svelte-2va9hf">GitHub</span></a> <div class="ext-link-divider svelte-2va9hf"></div> <a target="_blank" rel="noopener noreferrer" class="ext-link-btn ext-link-star svelte-2va9hf" title="Star on GitHub" aria-label="Star on GitHub" id="githubStarBtn"><svg width="13" height="13" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" class="svelte-2va9hf"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" class="svelte-2va9hf"></path></svg> <span class="ext-link-label svelte-2va9hf">Star</span></a> <div class="ext-link-divider svelte-2va9hf"></div> <a target="_blank" rel="noopener noreferrer" class="ext-link-btn ext-link-npm svelte-2va9hf" title="View on npm" aria-label="npm package" id="npmLink"><svg width="18" height="11" viewBox="0 0 18 7" fill="currentColor" aria-hidden="true" class="svelte-2va9hf"><path d="M0 0h18v6H9V7H5V6H0V0zm1 5h2V1h1v4h1V1h1v5h4V1h1v4h1V1h1v4h1V1h2v5H1V5z" class="svelte-2va9hf"></path></svg> <!></a></div> <div style="width:1px;height:20px;background:var(--color-border);opacity:0.6;" class="svelte-2va9hf"></div> <!> <div class="flex items-center gap-2 svelte-2va9hf"><div class="countdown-bar svelte-2va9hf"><div class="countdown-track svelte-2va9hf"><div class="countdown-fill svelte-2va9hf"></div></div> <span class="countdown-label svelte-2va9hf"> </span></div> <button title="Refresh now" aria-label="Refresh"><span><!></span></button></div> <button class="btn btn-ghost btn-icon btn-sm svelte-2va9hf" title="Toggle theme" aria-label="Toggle theme"><!></button> <!></div></div></header>`);function wl(e,t){We(t,!1);let n=()=>N(_,`$countdownSeconds`,u),r=()=>N(pa,`$availableRepos`,u),i=()=>N(ma,`$currentRepo`,u),a=()=>N(b,`$npmLoading`,u),o=()=>N(y,`$npmDownloads`,u),s=()=>N(Ia,`$healthData`,u),c=()=>N(v,`$refreshing`,u),l=()=>N(da,`$theme`,u),[u,d]=ft(),f=on(),p=on(),m=on(),h=Z(t,`onRefresh`,8,()=>{}),g=Z(t,`onToggleMobileMenu`,8,()=>{}),{countdownSeconds:_,refreshing:v,npmDownloads:y,npmLoading:b,formatDownloads:x,fetchNpmDownloads:S,toggleTheme:C,startCountdown:w,manualRefresh:T,getRepoInitials:E,destroy:D}=ml(h());aa(()=>{w(),S()}),oa(()=>D()),Un(()=>n(),()=>{sn(f,n()/30*100)}),Un(()=>n(),()=>{sn(p,n()<=5?`#ef4444`:n()<=10?`#f97316`:`#0ea5e9`)}),Un(()=>(r(),i()),()=>{sn(m,r().find(e=>e.repo===i()))}),Wn(),na();var ee=Cl(),te=F(ee),ne=F(te),re=F(ne);$(F(re),{name:`menu`,size:18,strokeWidth:2}),A(re);var ie=L(re,2),ae=e=>{var t=gl(),n=F(t),r=F(n,!0);A(n);var a=L(n,2),o=F(a),s=F(o,!0);A(o);var c=L(o,2),l=e=>{var t=hl(),n=F(t);$(n,{name:`database`,size:10,strokeWidth:2});var r=L(n,2),i=F(r);A(r),A(t),R(()=>q(i,`${(V(m),H(()=>V(m).memory_count||0))??``} memories`)),K(e,t)};J(c,e=>{V(m)&&e(l)}),A(a),A(t),R(e=>{q(r,e),q(s,i())},[()=>(i(),H(()=>E(i())))]),K(e,t)},oe=e=>{var t=_l();$(F(t),{name:`brain`,size:14,strokeWidth:1.75}),Ne(2),A(t),K(e,t)};J(ie,e=>{i()?e(ae):e(oe,-1)}),A(ne);var se=L(ne,2),ce=F(se),le=F(ce),ue=L(le,4),de=L(ue,4),fe=L(F(de),2),pe=e=>{K(e,vl())},me=e=>{var t=yl(),n=L(F(t));A(t),R(e=>q(n,` ${e??``}/mo`),[()=>(o(),H(()=>x(o())))]),K(e,t)},he=e=>{K(e,bl())};J(fe,e=>{a()?e(pe):o()===null?e(he,-1):e(me,1)}),A(de),A(ce);var ge=L(ce,4),_e=e=>{var t=xl(),n=L(F(t),4),r=F(n);A(n),A(t),R(()=>q(r,`v${(s(),H(()=>s().version))??``}`)),K(e,t)};J(ge,e=>{s()&&e(_e)});var ve=L(ge,2),ye=F(ve),be=F(ye),xe=F(be);A(be);var Se=L(be,2),Ce=F(Se);A(Se),A(ye);var we=L(ye,2);let Te;var Ee=F(we);let De;$(F(Ee),{name:`refresh-cw`,size:14,strokeWidth:2.5}),A(Ee),A(we),A(ve);var Oe=L(ve,2),ke=F(Oe),O=e=>{$(e,{name:`sun`,size:16,strokeWidth:1.75})},Ae=e=>{$(e,{name:`moon`,size:16,strokeWidth:1.75})};J(ke,e=>{l()===`dark`?e(O):e(Ae,-1)}),A(Oe);var k=L(Oe,2),je=e=>{var t=Sl(),n=F(t);$(n,{name:`database`,size:10,strokeWidth:2});var r=L(n);A(t),R(e=>{Wi(t,`title`,(s(),H(()=>s().dbPath))),q(r,` ${e??``}`)},[()=>(s(),H(()=>s().dbPath.split(/[/\\]/).pop()))]),K(e,t)};J(k,e=>{s(),H(()=>s()?.dbPath)&&e(je)}),A(se),A(te),A(ee),R(()=>{Wi(le,`href`,fl),Wi(ue,`href`,`https://github.com/vheins/local-memory-mcp/stargazers`),Wi(de,`href`,pl),Mi(xe,`width:${V(f)??``}%;background:${V(p)??``};`),Mi(Se,`color:${n()<=5?`#ef4444`:`var(--color-text-muted)`};`),q(Ce,`${n()??``}s`),Te=Ai(we,1,`btn btn-ghost btn-icon btn-sm svelte-2va9hf`,null,Te,{refreshing:c()}),De=Ai(Ee,1,`svelte-2va9hf`,null,De,{"animate-spin":c()})}),W(`click`,re,function(...e){g()?.apply(this,e)}),W(`click`,we,T),W(`click`,Oe,C),K(e,ee),Ge(),d()}var Tl={1:`#94a3b8`,2:`#3b82f6`,3:`#f59e0b`,4:`#f97316`,5:`#ef4444`},El={backlog:`archive`,pending:`circle-dot`,in_progress:`zap`,completed:`circle-check`,blocked:`circle-x`,canceled:`circle-pause-alt`},Dl={backlog:`#64748b`,pending:`#0ea5e9`,in_progress:`#a855f7`,completed:`#10b981`,blocked:`#ef4444`,canceled:`#f59e0b`};function Ol(e){return e?e.replace(/<[^>]*>/g,``).replace(/!\[.*?\]\(.*?\)/g,``).replace(/\[([^\]]+)\]\(.*?\)/g,`$1`).replace(/```[\s\S]*?```/g,``).replace(/`([^`]+)`/g,`$1`).replace(/[#*~_-]/g,``).replace(/\s+/g,` `).trim():``}var kl=G(`<span class="phase-chip svelte-1797zcc"> </span>`),Al=G(`<div class="task-desc svelte-1797zcc"> </div>`),jl=G(`<div class="agent-row svelte-1797zcc"><div class="agent-avatar svelte-1797zcc"><!></div> <span class="agent-name svelte-1797zcc"> </span></div>`),Ml=G(`<span></span>`),Nl=G(`<div class="token-row svelte-1797zcc"><span class="token-badge svelte-1797zcc"><!> </span></div>`),Pl=G(`<div class="task-card animate-fade-in svelte-1797zcc" role="button" tabindex="0"><div class="priority-bar svelte-1797zcc"></div> <div class="card-header svelte-1797zcc"><div class="code-row svelte-1797zcc"><span class="status-icon-dot svelte-1797zcc"><!></span> <span class="task-code-text svelte-1797zcc"> </span></div> <!></div> <div class="task-title svelte-1797zcc"> </div> <!> <div class="card-footer svelte-1797zcc"><!> <div class="time-row svelte-1797zcc"><!> <span> </span></div></div> <!></div>`);function Fl(e,t){We(t,!1);let n=on(),r=on(),i=on(),a=on(),o=Z(t,`task`,8);Un(()=>U(o()),()=>{sn(n,Tl[o().priority]||`#94a3b8`)}),Un(()=>U(o()),()=>{sn(r,El[o().status]||`circle-dot`)}),Un(()=>U(o()),()=>{sn(i,Dl[o().status]||`#94a3b8`)}),Un(()=>U(o()),()=>{sn(a,Ol(o().description))}),Wn(),na();var s=Pl(),c=F(s),l=L(c,2),u=F(l),d=F(u);$(F(d),{get name(){return V(r)},size:11,strokeWidth:2.5}),A(d);var f=L(d,2),p=F(f,!0);A(f),A(u);var m=L(u,2),h=e=>{var t=kl(),n=F(t,!0);A(t),R(()=>q(n,(U(o()),H(()=>o().phase)))),K(e,t)};J(m,e=>{U(o()),H(()=>o().phase)&&e(h)}),A(l);var g=L(l,2),_=F(g,!0);A(g);var v=L(g,2),y=e=>{var t=Al(),n=F(t,!0);A(t),R(()=>q(n,V(a))),K(e,t)};J(v,e=>{V(a)&&e(y)});var b=L(v,2),x=F(b),S=e=>{var t=jl(),n=F(t);$(F(n),{name:`bot`,size:9,strokeWidth:2}),A(n);var r=L(n,2),i=F(r,!0);A(r),A(t),R(()=>q(i,(U(o()),H(()=>o().agent)))),K(e,t)},C=e=>{K(e,Ml())};J(x,e=>{U(o()),H(()=>o().agent)?e(S):e(C,-1)});var w=L(x,2),T=F(w);$(T,{name:`clock`,size:10,strokeWidth:2});var E=L(T,2),D=F(E,!0);A(E),A(w),A(b);var ee=L(b,2),te=e=>{var t=Nl(),n=F(t),r=F(n);$(r,{name:`cpu`,size:9,strokeWidth:2});var i=L(r);A(n),A(t),R(e=>q(i,` ~${e??``} tokens`),[()=>(U(o()),H(()=>o().est_tokens>=1e3?(o().est_tokens/1e3).toFixed(1)+`k`:o().est_tokens))]),K(e,t)};J(ee,e=>{U(o()),H(()=>o().est_tokens&&o().est_tokens>0)&&e(te)}),A(s),R(e=>{Mi(c,`background:${V(n)??``};`),Mi(d,`color:${V(i)??``};`),q(p,(U(o()),H(()=>o().task_code))),q(_,(U(o()),H(()=>o().title))),q(D,e)},[()=>(U(Tc),U(o()),H(()=>Tc(o().updated_at)))]),W(`click`,s,function(e){ia.call(this,t,e)}),W(`keydown`,s,function(e){ia.call(this,t,e)}),K(e,s),Ge()}var Il=[{status:`backlog`,label:`Backlog`,bg:`rgba(100,116,139,0.07)`,border:`rgba(100,116,139,0.18)`,icon:`archive`,color:`#64748b`},{status:`pending`,label:`To Do`,bg:`rgba(14,165,233,0.06)`,border:`rgba(14,165,233,0.18)`,icon:`circle-dot`,color:`#0ea5e9`},{status:`in_progress`,label:`In Progress`,bg:`rgba(168,85,247,0.07)`,border:`rgba(168,85,247,0.18)`,icon:`zap`,color:`#a855f7`},{status:`completed`,label:`Completed`,bg:`rgba(16,185,129,0.06)`,border:`rgba(16,185,129,0.18)`,icon:`circle-check`,color:`#10b981`}];function Ll(){let e={},t={};Il.forEach(n=>{e[n.status]={page:1,pageSize:20,hasMore:!0},t[n.status]=[]});let{subscribe:n,update:r}=j({loadingCols:new Set,pagination:e,columnTasks:t,draggedTask:null,sourceCol:null,dragOverCol:null});async function i(e,t,i){let a=M({subscribe:n});if(a.loadingCols.has(t))return;r(e=>{let n=new Set(e.loadingCols);return n.add(t),{...e,loadingCols:n}});let o=a.pagination[t];try{let n=await Va.tasks({repo:e,status:t,search:i,page:o.page,pageSize:o.pageSize});r(e=>{let r=o.page===1?n.tasks||[]:[...e.columnTasks[t]||[],...n.tasks||[]];return{...e,columnTasks:{...e.columnTasks,[t]:r},pagination:{...e.pagination,[t]:{...o,hasMore:(n.tasks?.length||0)>=o.pageSize}}}})}catch(e){console.error(`Failed to load ${t}:`,e)}finally{r(e=>{let n=new Set(e.loadingCols);return n.delete(t),{...e,loadingCols:n}})}}async function a(e,t){e&&(r(e=>{let t={...e.pagination},n={...e.columnTasks};return Il.forEach(e=>{t[e.status]={page:1,pageSize:20,hasMore:!0},n[e.status]=[]}),{...e,pagination:t,columnTasks:n}}),await Promise.all(Il.map(n=>i(e,n.status,t))))}async function o(e){let t=M(ma),n=M(ja);t&&(r(t=>({...t,pagination:{...t.pagination,[e]:{...t.pagination[e],page:t.pagination[e].page+1}}})),await i(t,e,n))}function s(e,t,n){e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.id)),r(e=>({...e,draggedTask:t,sourceCol:n}))}function c(e,t){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`);let i=M({subscribe:n});!i.draggedTask||i.sourceCol===t||r(e=>({...e,dragOverCol:t}))}function l(e){r(t=>t.dragOverCol===e?{...t,dragOverCol:null}:t)}async function u(e){let t=M(ma),i=M(ja),{draggedTask:o,sourceCol:s}=M({subscribe:n});if(r(e=>({...e,dragOverCol:null,draggedTask:null,sourceCol:null})),!(!o||!s||s===e)){r(t=>{let n={...t.columnTasks};return n[s]=n[s].filter(e=>e.id!==o.id),n[e]=[{...o,status:e},...n[e]||[]],{...t,columnTasks:n}});try{await Va.updateTask(o.id,{status:e})}catch(e){console.error(`Failed to move task:`,e),t&&a(t,i)}}}async function d(e){let t=M(ma);if(t)try{let n=await Va.export(t),r=`${t.replace(/\//g,`_`)}_tasks_export`;e===`json`?Nc(n.tasks||[],r+`.json`):Pc(n.tasks||[],r+`.csv`)}catch(e){alert(`Export failed: `+e.message)}}return aa(()=>{let e=!0,t=ma.subscribe(e=>{let t=M(ja);e&&a(e,t)}),n,r=ja.subscribe(t=>{if(e)return;let r=M(ma);r&&(clearTimeout(n),n=setTimeout(()=>{a(r,t)},150))});return e=!1,()=>{t(),r(),clearTimeout(n)}}),{subscribe:n,loadTasks:a,loadMore:o,handleDragStart:s,handleDragOver:c,handleDragLeave:l,handleDrop:u,handleExport:d}}var Rl=G(`<div class="skeleton" style="height:80px;border-radius:12px;"></div> <div class="skeleton" style="height:60px;border-radius:12px;"></div>`,1),zl=G(`<div class="empty-col svelte-173w724"><span><!></span> <div style="font-size:0.75rem;color:var(--color-text-muted);margin-top:6px;">No tasks</div></div>`),Bl=G(`<div draggable="true" style="cursor: grab;"><!></div>`),Vl=G(`<span class="animate-spin"><!></span>`),Hl=G(`<button class="btn btn-ghost btn-sm w-full" style="margin-top:4px;justify-content:center;"><!> </button>`),Ul=G(`<!> <!>`,1),Wl=G(`<div><div class="flex items-center gap-2 mb-3"><span><!></span> <span style="font-size:0.78rem;font-weight:700;color:var(--color-text);"> </span> <span class="col-count svelte-173w724"> </span></div> <div class="flex flex-col" style="gap:8px;overflow-y:auto;max-height:calc(100vh - 340px);padding-right:2px;"><!></div></div>`),Gl=G(`<div><div class="flex items-center justify-between mb-4"><div class="search-wrap svelte-173w724"><span class="search-icon-inner svelte-173w724"><!></span> <input class="form-input" style="padding-left:32px;width:220px;font-size:0.8rem;" type="text" placeholder="Search tasks…"/></div> <div class="flex gap-2"><div class="flex gap-1 mr-1"><button class="btn btn-ghost btn-sm" title="Export JSON"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> JSON</button> <button class="btn btn-ghost btn-sm" title="Export CSV"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> CSV</button></div> <div style="width:1px;height:24px;background:var(--color-border);margin:0 4px;"></div> <button class="btn btn-ghost btn-sm" title="Bulk Import"><!> Import</button> <button class="btn btn-accent btn-sm"><!> Add Task</button></div></div> <div class="kanban-board" style="padding-bottom:16px;"></div></div>`);function Kl(e,t){We(t,!1);let n=()=>N(ja,`$taskSearch`,i),r=()=>N(u,`$kanbanState`,i),[i,a]=ft(),o=Z(t,`onTaskClick`,8,()=>{}),s=Z(t,`onAddTask`,8,()=>{}),c=Z(t,`onBulkImport`,8,()=>{}),l=Ll(),u={subscribe:l.subscribe};na();var d=Gl(),f=F(d),p=F(f),m=F(p);$(F(m),{name:`search`,size:13,strokeWidth:2}),A(m);var h=L(m,2);Vi(h),A(p);var g=L(p,2),_=F(g),v=F(_),y=L(v,2);A(_);var b=L(_,4);$(F(b),{name:`upload`,size:14,strokeWidth:2.5}),Ne(),A(b);var x=L(b,2);$(F(x),{name:`plus`,size:14,strokeWidth:2.5}),Ne(),A(x),A(g),A(f);var S=L(f,2);X(S,5,()=>Il,Y,(e,t)=>{var n=Wl(),i=F(n),a=F(i);$(F(a),{get name(){return V(t),H(()=>V(t).icon)},size:13,strokeWidth:2}),A(a);var s=L(a,2),c=F(s,!0);A(s);var u=L(s,2),d=F(u);A(u),A(i);var f=L(i,2),p=F(f),m=e=>{var n=Xr(),i=I(n),a=e=>{var t=Rl();Ne(2),K(e,t)},o=Kt(()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status)))),s=e=>{var n=zl(),r=F(n);$(F(r),{get name(){return V(t),H(()=>V(t).icon)},size:22,strokeWidth:1.25}),A(r),Ne(2),A(n),R(()=>Mi(r,`color:${(V(t),H(()=>V(t).color))??``};opacity:0.5;`)),K(e,n)};J(i,e=>{V(o)?e(a):e(s,-1)}),K(e,n)},h=e=>{var n=Ul(),i=I(n);X(i,1,()=>(r(),V(t),H(()=>r().columnTasks[V(t).status])),e=>e.id,(e,n)=>{var r=Bl();Fl(F(r),{get task(){return V(n)},$$events:{click:()=>o()(V(n))}}),A(r),W(`dragstart`,r,e=>l.handleDragStart(e,V(n),V(t).status)),K(e,r)});var a=L(i,2),s=e=>{var n=Hl(),i=F(n),a=e=>{var t=Vl();$(F(t),{name:`refresh-cw`,size:12,strokeWidth:2}),A(t),K(e,t)},o=Kt(()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status)))),s=e=>{$(e,{name:`chevron-down`,size:12,strokeWidth:2})};J(i,e=>{V(o)?e(a):e(s,-1)});var c=L(i);A(n),R((e,t)=>{n.disabled=e,q(c,` ${t??``}`)},[()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status))),()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status)?`Loading…`:`Load more`))]),W(`click`,n,()=>l.loadMore(V(t).status)),K(e,n)};J(a,e=>{r(),V(t),H(()=>r().pagination[V(t).status]?.hasMore)&&e(s)}),K(e,n)};J(p,e=>{r(),V(t),H(()=>(r().columnTasks[V(t).status]||[]).length===0)?e(m):e(h,-1)}),A(f),A(n),R(()=>{Ai(n,1,`kanban-col ${(r(),V(t),H(()=>r().dragOverCol===V(t).status?`drag-over`:``))??``}`,`svelte-173w724`),Mi(n,`background:${(V(t),H(()=>V(t).bg))??``};border:1px solid ${(V(t),H(()=>V(t).border))??``};padding:12px;border-radius:16px;transition: border-color 0.2s;`),Mi(a,`color:${(V(t),H(()=>V(t).color))??``};display:flex;flex-shrink:0;`),q(c,(V(t),H(()=>V(t).label))),Mi(u,`margin-left:auto;background:${(V(t),H(()=>V(t).bg))??``};color:${(V(t),H(()=>V(t).color))??``};border:1px solid ${(V(t),H(()=>V(t).border))??``};`),q(d,`${(r(),V(t),H(()=>r().columnTasks[V(t).status]?.length||0))??``}${(r(),V(t),H(()=>r().pagination[V(t).status]?.hasMore?`+`:``))??``}`)}),W(`dragover`,n,e=>l.handleDragOver(e,V(t).status)),W(`dragleave`,n,()=>l.handleDragLeave(V(t).status)),W(`drop`,n,()=>l.handleDrop(V(t).status)),K(e,n)}),A(S),A(d),Ji(h,n,e=>dt(ja,e)),W(`click`,v,()=>l.handleExport(`json`)),W(`click`,y,()=>l.handleExport(`csv`)),W(`click`,b,function(...e){c()?.apply(this,e)}),W(`click`,x,function(...e){s()?.apply(this,e)}),K(e,d),Ge(),a()}var ql={code_fact:`#a855f7`,decision:`#3b82f6`,mistake:`#ef4444`,pattern:`#10b981`,agent_handoff:`#f97316`,agent_registered:`#84cc16`,file_claim:`#06b6d4`,task_archive:`#78716c`},Jl={code_fact:`Code Facts`,decision:`Decisions`,mistake:`Mistakes`,pattern:`Patterns`,agent_handoff:`Handoffs`,agent_registered:`Registered`,file_claim:`Claims`,task_archive:`Archives`};function Yl(){return{summaryItems:st(va,e=>[{label:`Total Memories`,val:e?.total??`—`,icon:`layers`,color:`#0ea5e9`,glow:`rgba(14,165,233,0.12)`},{label:`Avg Importance`,val:e?.avgImportance?Number(e.avgImportance).toFixed(1):`—`,icon:`star`,color:`#f59e0b`,glow:`rgba(245,158,11,0.12)`},{label:`Total Hits`,val:e?.totalHitCount??`—`,icon:`mouse-pointer-2`,color:`#10b981`,glow:`rgba(16,185,129,0.12)`},{label:`Expiring Soon`,val:e?.expiringSoon??`—`,icon:`clock`,color:`#ef4444`,glow:`rgba(239,68,68,0.12)`}]),byTypeStats:st(va,e=>e?.byType?Object.entries(e.byType).filter(([e,t])=>t>0).map(([e,t])=>({type:e,count:t,color:ql[e]||`#64748b`,label:Jl[e]||e})):[])}}var Xl=G(`<div class="stat-card svelte-1imzu92"><div class="svelte-1imzu92"><!></div> <div class="svelte-1imzu92"> </div> <div style="font-size:0.6rem;font-weight:700;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-top:2px;" class="svelte-1imzu92"> </div></div>`),Zl=G(`<div class="flex items-center gap-2 glassy-badge svelte-1imzu92"><div class="indicator-dot svelte-1imzu92"></div> <span class="count svelte-1imzu92"> </span> <span class="label svelte-1imzu92"> </span></div>`),Ql=G(`<div style="margin-top:4px;" class="svelte-1imzu92"><div class="stat-label svelte-1imzu92" style="font-size:0.6rem;margin-bottom:6px;">By Type</div> <div style="display:flex;flex-wrap:wrap;gap:8px;" class="svelte-1imzu92"></div></div>`),$l=G(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(130px, 1fr));gap:10px;margin-bottom:12px;" class="svelte-1imzu92"></div> <!>`,1);function eu(e,t){We(t,!1);let n=()=>N(o,`$summaryItems`,i),r=()=>N(s,`$byTypeStats`,i),[i,a]=ft(),{summaryItems:o,byTypeStats:s}=Yl();na();var c=$l(),l=I(c);X(l,5,n,Y,(e,t)=>{var n=Xl(),r=F(n);$(F(r),{get name(){return V(t).icon},size:14,strokeWidth:1.75}),A(r);var i=L(r,2),a=F(i,!0);A(i);var o=L(i,2),s=F(o,!0);A(o),A(n),R(()=>{Mi(n,`text-align:center;background:${V(t).glow??``};border:1px solid ${V(t).glow??``};padding:10px 8px;`),Mi(r,`display:flex;justify-content:center;margin-bottom:2px;color:${V(t).color??``};opacity:0.8;`),Mi(i,`font-size:1.25rem;font-weight:900;color:${V(t).color??``};line-height:1;letter-spacing:-0.03em;`),q(a,V(t).val),q(s,V(t).label)}),K(e,n)}),A(l);var u=L(l,2),d=e=>{var t=Ql(),n=L(F(t),2);X(n,5,r,Y,(e,t)=>{var n=Zl(),r=L(F(n),2),i=F(r,!0);A(r);var a=L(r,2),o=F(a,!0);A(a),A(n),R(()=>{Mi(n,`--badge-color: ${V(t).color??``};`),q(i,V(t).count),q(o,V(t).label)}),K(e,n)}),A(n),A(t),K(e,t)};J(u,e=>{r().length>0&&e(d)}),K(e,c),Ge(),a()}var tu=G(`<div class="stat-card"><div><!></div> <div> </div> <div style="font-size:0.6rem;font-weight:700;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-top:2px;"> </div></div>`),nu=G(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(120px, 1fr));gap:10px;width:100%;"></div>`);function ru(e,t){We(t,!1);let n=()=>N(va,`$dashboardStats`,r),[r,i]=ft(),a=on(),o=on();Un(()=>n(),()=>{sn(a,n()?.taskStats)}),Un(()=>V(a),()=>{sn(o,[{label:`Total`,val:V(a)?.total??0,icon:`layers`,color:`#6366f1`,glow:`rgba(99,102,241,0.12)`},{label:`Backlog`,val:V(a)?.backlog??0,icon:`inbox`,color:`#64748b`,glow:`rgba(100,116,139,0.12)`},{label:`To Do`,val:V(a)?.todo??0,icon:`circle-dot`,color:`#0ea5e9`,glow:`rgba(14,165,233,0.12)`},{label:`Active`,val:V(a)?.inProgress??0,icon:`zap`,color:`#a855f7`,glow:`rgba(168,85,247,0.12)`},{label:`Done`,val:V(a)?.completed??0,icon:`circle-check`,color:`#10b981`,glow:`rgba(16,185,129,0.12)`}])}),Wn(),na();var s=Xr(),c=I(s),l=e=>{var t=nu();X(t,5,()=>V(o),Y,(e,t)=>{var n=tu(),r=F(n);$(F(r),{get name(){return V(t),H(()=>V(t).icon)},size:14,strokeWidth:1.75}),A(r);var i=L(r,2),a=F(i,!0);A(i);var o=L(i,2),s=F(o,!0);A(o),A(n),R(()=>{Mi(n,`text-align:center;background:${(V(t),H(()=>V(t).glow))??``};border:1px solid ${(V(t),H(()=>V(t).glow))??``};padding:10px 8px;`),Mi(r,`display:flex;justify-content:center;margin-bottom:2px;color:${(V(t),H(()=>V(t).color))??``};opacity:0.8;`),Mi(i,`font-size:1.25rem;font-weight:900;color:${(V(t),H(()=>V(t).color))??``};line-height:1;letter-spacing:-0.03em;`),q(a,(V(t),H(()=>V(t).val))),q(s,(V(t),H(()=>V(t).label)))}),K(e,n)}),A(t),K(e,t)};J(c,e=>{V(a)&&e(l)}),K(e,s),Ge(),i()}var iu=[{key:`daily`,label:`Today`},{key:`weekly`,label:`Week`},{key:`monthly`,label:`Month`},{key:`overall`,label:`All`}];function au(){let e=j(`daily`),t=st([ya,e],([e,t])=>e?.[t]),n=st(t,e=>e?.history||[]);return{activePeriod:e,periodData:t,history:n,maxVal:st(n,e=>Math.max(1,...e.map(e=>Math.max(e.created||0,e.completed||0)))),setActivePeriod:t=>e.set(t)}}var ou=G(`<button style="padding:4px 10px;font-size:0.65rem;"> </button>`),su=G(`<div class="flex-1 flex flex-col items-center group relative" style="height:100%;"><div class="flex h-full w-full items-end justify-center gap-[2px]"><div class="bar created-bar"></div> <div class="bar completed-bar"></div></div> <div class="absolute bottom-full mb-1 bg-slate-800 text-white p-1.5 rounded text-[10px] hidden group-hover:block z-10 whitespace-nowrap shadow-lg"><div class="font-bold border-b border-slate-600 mb-1"> </div> <div> </div> <div> </div></div> <div class="absolute bottom-0 translate-y-[20px] text-[8px] text-slate-400 whitespace-nowrap overflow-hidden max-w-full"> </div></div>`),cu=G(`<div class="mt-4 pt-4 border-t border-dashed" style="border-color:var(--color-border);"><div class="flex items-center justify-between mb-3"><div style="font-size:0.65rem;font-weight:700;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:0.05em;">Throughput vs Inflow</div> <div class="flex gap-2"><div class="flex items-center gap-1"><div style="width:8px;height:8px;border-radius:2px;background:#10b981;"></div> <span style="font-size:0.6rem;color:var(--color-text-muted);">Created</span></div> <div class="flex items-center gap-1"><div style="width:8px;height:8px;border-radius:2px;background:#6366f1;"></div> <span style="font-size:0.6rem;color:var(--color-text-muted);">Completed</span></div></div></div> <div style="height:120px;display:flex;align-items:flex-end;gap:4px;padding-bottom:20px;position:relative;"></div></div>`),lu=G(`<div class="mt-4 pt-4 border-t border-dashed flex items-center justify-center" style="border-color:var(--color-border);height:140px;color:var(--color-text-muted);font-size:0.75rem;">No trend data available for this period</div>`),uu=G(`<div class="glass card animate-fade-in"><div class="flex items-center justify-between mb-3"><div><div style="font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;color:#6366f1;">Task Stats</div> <div style="font-size:0.75rem;color:var(--color-text-muted);">Performance over time</div></div> <div class="flex gap-1" style="background:rgba(241,245,249,0.8);padding:3px;border-radius:10px;"></div></div> <div style="display:grid;grid-template-columns:repeat(2,1fr);gap:10px;"><div style="background:rgba(99,102,241,0.08);border:1px solid rgba(99,102,241,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#6366f1;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Completed</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div> <div style="background:rgba(16,185,129,0.08);border:1px solid rgba(16,185,129,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#10b981;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Added</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div> <div style="background:rgba(56,189,248,0.08);border:1px solid rgba(56,189,248,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#0ea5e9;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Tokens</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div> <div style="background:rgba(245,158,11,0.08);border:1px solid rgba(245,158,11,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#f59e0b;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Avg Time</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div></div> <!></div>`);function du(e,t){We(t,!1);let n=()=>N(c,`$activePeriod`,o),r=()=>N(l,`$periodData`,o),i=()=>N(u,`$history`,o),a=()=>N(d,`$maxVal`,o),[o,s]=ft(),{activePeriod:c,periodData:l,history:u,maxVal:d,setActivePeriod:f}=au();na();var p=uu(),m=F(p),h=L(F(m),2);X(h,5,()=>iu,Y,(e,t)=>{var r=ou();let i;var a=F(r,!0);A(r),R(()=>{i=Ai(r,1,`tab-btn`,null,i,{active:n()===V(t).key}),q(a,V(t).label)}),W(`click`,r,()=>f(V(t).key)),K(e,r)}),A(h),A(m);var g=L(m,2),_=F(g),v=L(F(_),2),y=F(v,!0);A(v),A(_);var b=L(_,2),x=L(F(b),2),S=F(x,!0);A(x),A(b);var C=L(b,2),w=L(F(C),2),T=F(w,!0);A(w),A(C);var E=L(C,2),D=L(F(E),2),ee=F(D,!0);A(D),A(E),A(g);var te=L(g,2),ne=e=>{var t=cu(),n=L(F(t),2);X(n,5,i,Y,(e,t)=>{var n=su(),r=F(n),i=F(r),o=L(i,2);A(r);var s=L(r,2),c=F(s),l=F(c,!0);A(c);var u=L(c,2),d=F(u);A(u);var f=L(u,2),p=F(f);A(f),A(s);var m=L(s,2),h=F(m,!0);A(m),A(n),R(e=>{Mi(i,`width:35%; height:${(V(t).created||0)/a()*100}%; background:#10b981; border-radius:3px 3px 0 0; opacity:0.8; transition: height 0.3s ease;`),Mi(o,`width:35%; height:${(V(t).completed||0)/a()*100}%; background:#6366f1; border-radius:3px 3px 0 0; opacity:0.8; transition: height 0.3s ease;`),q(l,V(t).label),q(d,`Added: ${V(t).created??``}`),q(p,`Done: ${V(t).completed??``}`),q(h,e)},[()=>V(t).label.includes(`:00`)?V(t).label.split(`:`)[0]:V(t).label.replace(`2026-`,``).replace(`2025-`,``)]),K(e,n)}),A(n),A(t),K(e,t)},re=e=>{K(e,lu())};J(te,e=>{r()?.history&&r().history.length>0?e(ne):e(re,-1)}),A(p),R((e,t)=>{q(y,r()?.completed??`—`),q(S,r()?.added??`—`),q(T,e),q(ee,t)},[()=>r()?.tokens?Ec(r().tokens):`—`,()=>r()?.avgDuration?Dc(r().avgDuration):`—`]),K(e,p),Ge(),s()}function fu(){let e=!1;async function t(t=M(ma)){if(!t){ba.set([]);return}e=!0;try{let e=await Va.memories({repo:t,type:M(Ta)||void 0,search:M(wa)||void 0,minImportance:M(Ea)||void 0,maxImportance:M(Da)||void 0,sortBy:M(Oa),sortOrder:M(ka),page:M(Sa),pageSize:M(Ca)});ba.set(e.memories||[]),xa.set(e.pagination?.totalItems||0)}catch(e){console.error(`Failed to load memories:`,e)}finally{e=!1}}let n=Fc(()=>{Sa.set(1),t()},300);function r(){n()}function i(){Sa.set(1),t()}function a(e){let n=M(Ra);e<1||e>n||(Sa.set(e),t())}function o(e){M(Oa)===e?ka.update(e=>e===`desc`?`asc`:`desc`):(Oa.set(e),ka.set(`desc`)),t()}function s(e){Aa.update(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function c(){Aa.update(e=>{let t=M(ba);return e.size===t.length?new Set:new Set(t.map(e=>e.id))})}async function l(e,t=M(ma)){if(t)try{let n=await Va.export(t),r=`${t.replace(`/`,`_`)}_export`;e===`json`?Nc(n,r+`.json`):Pc(n.memories||[],r+`.csv`)}catch(e){console.error(`Export failed:`,e)}}async function u(e,n){if(n&&n.stopPropagation(),confirm(`Delete memory "${e.title}"?`))try{await Va.deleteMemory(e.id),t()}catch(e){alert(`Failed to delete: `+e.message)}}async function d(){let e=M(Aa);if(e.size!==0&&confirm(`Are you sure you want to delete ${e.size} memories?`))try{await Va.bulkMemoryAction(`delete`,Array.from(e)),Aa.set(new Set),t()}catch(e){alert(`Failed to delete: `+e.message)}}async function f(){let e=M(Aa);if(e.size!==0)try{await Va.bulkMemoryAction(`archive`,Array.from(e)),Aa.set(new Set),t()}catch(e){alert(`Failed to archive: `+e.message)}}return{get loading(){return e},loadMemories:t,onSearchInput:r,onFilterChange:i,goToPage:a,toggleSort:o,toggleSelect:s,toggleSelectAll:c,handleExport:l,handleDeleteRow:u,handleBulkDelete:d,handleBulkArchive:f}}var pu=[`code_fact`,`decision`,`mistake`,`pattern`,`agent_handoff`,`agent_registered`,`file_claim`,`task_archive`],mu={code_fact:`Code Fact`,decision:`Decision`,mistake:`Mistake`,pattern:`Pattern`,agent_handoff:`Handoff`,agent_registered:`Registered`,file_claim:`File Claim`,task_archive:`Task Archive`},hu={1:`#64748b`,2:`#3b82f6`,3:`#f59e0b`,4:`#f97316`,5:`#ef4444`},gu={1:`rgba(100,116,139,0.12)`,2:`rgba(59,130,246,0.12)`,3:`rgba(245,158,11,0.12)`,4:`rgba(249,115,22,0.12)`,5:`rgba(239,68,68,0.12)`},_u=G(`<option> </option>`),vu=G(`<option> </option>`),yu=G(`<option> </option>`),bu=G(`<tr><td colspan="7" class="mem-td svelte-83aj9g"><div class="skeleton" style="height:20px;border-radius:6px;"></div></td></tr>`),xu=G(`<tr><td colspan="7" class="mem-td svelte-83aj9g" style="padding:40px;text-align:center;color:var(--color-text-muted);"><div style="font-size:2rem;margin-bottom:8px;">🔍</div> No memories found</td></tr>`),Su=G(`<span style="font-size:0.6rem;background:rgba(99,102,241,0.1);color:#6366f1;padding:1px 5px;border-radius:9999px;"> </span>`),Cu=G(`<div style="margin-top:3px;display:flex;gap:4px;flex-wrap:wrap;"></div>`),wu=G(`<tr><td class="mem-td svelte-83aj9g"><input type="checkbox"/></td><td class="mem-td svelte-83aj9g" style="max-width:300px;"><div class="truncate font-semibold" style="font-size:0.82rem;color:var(--color-text);"> </div> <!></td><td class="mem-td svelte-83aj9g"><span> </span></td><td class="mem-td svelte-83aj9g" style="text-align:center;"><span> </span></td><td class="mem-td svelte-83aj9g" style="font-size:0.75rem;color:var(--color-text-muted);white-space:nowrap;"> </td><td class="mem-td svelte-83aj9g" style="text-align:center;font-size:0.75rem;font-weight:600;color:var(--color-text-muted);"> </td><td class="mem-td row-actions svelte-83aj9g"><button class="row-action-btn edit-btn svelte-83aj9g" title="Edit / View" aria-label="Edit memory"><!></button> <button class="row-action-btn delete-btn svelte-83aj9g" title="Delete" aria-label="Delete memory"><!></button></td></tr>`),Tu=G(`<button> </button>`),Eu=G(`<div class="flex items-center justify-between mt-3"><span style="font-size:0.75rem;color:var(--color-text-muted);"> </span> <div class="flex gap-1"><button class="btn btn-ghost btn-sm">«</button> <button class="btn btn-ghost btn-sm">‹</button> <!> <button class="btn btn-ghost btn-sm">›</button> <button class="btn btn-ghost btn-sm">»</button></div></div>`),Du=G(`<div class="bulk-actions-bar svelte-83aj9g"><span><b> </b> selected</span> <div style="width:12px;"></div> <button class="btn btn-sm" style="background:rgba(120,120,120,0.2);color:inherit;">Cancel</button> <button class="btn btn-sm" style="background:#52525b;color:white;border:none;">Archive</button> <button class="btn btn-sm btn-accent" style="background:#ef4444;color:white;border:none;">Delete</button></div>`),Ou=G(`<div><div class="flex items-center gap-2 mb-3" style="flex-wrap:wrap;"><div style="position:relative;flex:1;min-width:160px;"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--color-text-muted);"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg> <input class="form-input" style="padding-left:32px;font-size:0.8rem;" type="text" placeholder="Search memories..."/></div> <select class="form-select" style="width:140px;font-size:0.8rem;"><option>All Types</option><!></select> <select class="form-select" style="width:100px;font-size:0.8rem;"><option>Min Imp.</option><!></select> <select class="form-select" style="width:100px;font-size:0.8rem;"></select> <div class="flex gap-1"><button class="btn btn-ghost btn-sm" title="Export JSON"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> JSON</button> <button class="btn btn-ghost btn-sm" title="Export CSV"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> CSV</button> <div style="width:1px;height:14px;background:var(--color-border);margin:auto 4px;"></div> <button class="btn btn-ghost btn-sm" title="Bulk Import"><!> Import</button></div> <button class="btn btn-accent btn-sm" id="newMemoryBtn" style="margin-left:auto;"><!> New Memory</button></div> <div style="font-size:0.72rem;color:var(--color-text-muted);margin-bottom:8px;"> </div> <div class="mem-table-wrap svelte-83aj9g"><table class="mem-table svelte-83aj9g"><thead><tr class="mem-thead-row svelte-83aj9g"><th class="mem-th svelte-83aj9g" style="width:36px;"><input type="checkbox" aria-label="Select all"/></th><th class="mem-th sortable svelte-83aj9g"> </th><th class="mem-th svelte-83aj9g">Type</th><th class="mem-th svelte-83aj9g" style="text-align:center;cursor:pointer;"> </th><th class="mem-th sortable svelte-83aj9g"> </th><th class="mem-th svelte-83aj9g" style="text-align:center;">Hits</th><th class="mem-th svelte-83aj9g" style="width:80px;"></th></tr></thead><tbody><!></tbody></table></div> <!> <!></div>`);function ku(e,t){We(t,!1);let n=()=>N(ba,`$memories`,p),r=()=>N(Aa,`$selectedMemoryIds`,p),i=()=>N(wa,`$memoriesSearch`,p),a=()=>N(Ta,`$memoriesTypeFilter`,p),o=()=>N(Ea,`$memoriesImportanceMin`,p),s=()=>N(Ca,`$memoriesPageSize`,p),c=()=>N(xa,`$memoriesTotal`,p),l=()=>N(Oa,`$memoriesSortBy`,p),u=()=>N(ka,`$memoriesSortOrder`,p),d=()=>N(Ra,`$memoriesTotalPages`,p),f=()=>N(Sa,`$memoriesPage`,p),[p,m]=ft(),h=on(),g=Z(t,`onMemoryClick`,8,()=>{}),_=Z(t,`onNewMemory`,8,()=>{}),v=Z(t,`onBulkImport`,8,()=>{}),y=fu();function b(){y.loadMemories()}Un(()=>(n(),r()),()=>{sn(h,n().length>0&&r().size===n().length)}),Wn();var x={refresh:b};na();var S=Ou(),C=F(S),w=F(C),T=L(F(w),2);Vi(T),A(w);var E=L(w,2),D=F(E);D.value=D.__value=``,X(L(D),1,()=>pu,Y,(e,t)=>{var n=_u(),r=F(n,!0);A(n);var i={};R(()=>{q(r,(U(mu),V(t),H(()=>mu[V(t)]))),i!==(i=V(t))&&(n.value=(n.__value=V(t))??``)}),K(e,n)}),A(E);var ee=L(E,2),te=F(ee);te.value=(te.__value=null,``),X(L(te),0,()=>[1,2,3,4,5],Y,(e,t)=>{var n=vu(),r=F(n,!0);A(n);var i={};R(()=>{q(r,t),i!==(i=t)&&(n.value=(n.__value=t)??``)}),K(e,n)}),A(ee);var ne=L(ee,2);X(ne,4,()=>[10,25,50,100],Y,(e,t)=>{var n=yu(),r=F(n);A(n);var i={};R(()=>{q(r,`${t??``} / page`),i!==(i=t)&&(n.value=(n.__value=t)??``)}),K(e,n)}),A(ne);var re=L(ne,2),ie=F(re),ae=L(ie,2),oe=L(ae,4);$(F(oe),{name:`upload`,size:13,strokeWidth:2}),Ne(),A(oe),A(re);var se=L(re,2);$(F(se),{name:`plus`,size:13,strokeWidth:2.5}),Ne(),A(se),A(C);var ce=L(C,2),le=F(ce);A(ce);var ue=L(ce,2),de=F(ue),fe=F(de),pe=F(fe),me=F(pe),he=F(me);Vi(he),A(me);var ge=L(me),_e=F(ge);A(ge);var ve=L(ge,2),ye=F(ve);A(ve);var be=L(ve),xe=F(be);A(be),Ne(2),A(pe),A(fe);var Se=L(fe),Ce=F(Se),we=e=>{var t=Xr();X(I(t),0,()=>[,,,,,],Y,(e,t)=>{K(e,bu())}),K(e,t)},Te=e=>{K(e,xu())},Ee=e=>{var i=Xr();X(I(i),1,n,e=>e.id,(e,n)=>{var i=wu();let a;var o=F(i),s=F(o);Vi(s),A(o);var c=L(o),l=F(c),u=F(l,!0);A(l);var d=L(l,2),f=e=>{var t=Cu();X(t,5,()=>(V(n),H(()=>V(n).tags.slice(0,3))),Y,(e,t)=>{var n=Su(),r=F(n,!0);A(n),R(()=>q(r,V(t))),K(e,n)}),A(t),K(e,t)};J(d,e=>{V(n),H(()=>V(n).tags?.length)&&e(f)}),A(c);var p=L(c),m=F(p),h=F(m,!0);A(m),A(p);var _=L(p),v=F(_),b=F(v,!0);A(v),A(_);var x=L(_),S=F(x,!0);A(x);var C=L(x),w=F(C,!0);A(C);var T=L(C),E=F(T);$(F(E),{name:`edit-2`,size:13,strokeWidth:2}),A(E);var D=L(E,2);$(F(D),{name:`trash-2`,size:13,strokeWidth:2}),A(D),A(T),A(i),R((e,t,r)=>{a=Ai(i,1,`mem-row svelte-83aj9g`,null,a,e),Ui(s,t),q(u,(V(n),H(()=>V(n).title))),Ai(m,1,`type-chip type-${(V(n),H(()=>V(n).type))??``}`,`svelte-83aj9g`),q(h,(U(mu),V(n),H(()=>mu[V(n).type]||V(n).type))),Mi(v,`display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:8px;font-size:0.75rem;font-weight:700;background:${(U(gu),V(n),H(()=>gu[V(n).importance]||gu[1]))??``};color:${(U(hu),V(n),H(()=>hu[V(n).importance]||hu[1]))??``};`),q(b,(V(n),H(()=>V(n).importance))),q(S,r),q(w,(V(n),H(()=>V(n).hit_count??0)))},[()=>({selected:r().has(V(n).id)}),()=>(r(),V(n),H(()=>r().has(V(n).id))),()=>(U(Tc),V(n),H(()=>Tc(V(n).updated_at)))]),W(`change`,s,()=>y.toggleSelect(V(n).id)),W(`click`,o,ea(function(e){ia.call(this,t,e)})),W(`click`,E,()=>g()(V(n))),W(`click`,D,e=>y.handleDeleteRow(V(n),e)),W(`click`,T,ea(function(e){ia.call(this,t,e)})),W(`click`,i,()=>g()(V(n))),K(e,i)}),K(e,i)};J(Ce,e=>{H(()=>y.loading)?e(we):(n(),H(()=>n().length===0)?e(Te,1):e(Ee,-1))}),A(Se),A(de),A(ue);var De=L(ue,2),Oe=e=>{var t=Eu(),n=F(t),r=F(n);A(n);var i=L(n,2),a=F(i),o=L(a,2),s=L(o,2);X(s,1,()=>(d(),f(),H(()=>Array.from({length:Math.min(5,d())},(e,t)=>Math.max(1,Math.min(f()-2,d()-4))+t))),Y,(e,t)=>{var n=Tu();let r;var i=F(n,!0);A(n),R(()=>{r=Ai(n,1,`btn btn-sm`,null,r,{"btn-primary":V(t)===f(),"btn-ghost":V(t)!==f()}),q(i,V(t))}),W(`click`,n,()=>y.goToPage(V(t))),K(e,n)});var c=L(s,2),l=L(c,2);A(i),A(t),R(()=>{q(r,`Page ${f()??``} of ${d()??``}`),a.disabled=f()<=1,o.disabled=f()<=1,c.disabled=f()>=d(),l.disabled=f()>=d()}),W(`click`,a,()=>y.goToPage(1)),W(`click`,o,()=>y.goToPage(f()-1)),W(`click`,c,()=>y.goToPage(f()+1)),W(`click`,l,()=>y.goToPage(d())),K(e,t)};J(De,e=>{d()>1&&e(Oe)});var ke=L(De,2),O=e=>{var t=Du(),n=F(t),i=F(n),a=F(i,!0);A(i),Ne(),A(n);var o=L(n,4),s=L(o,2),c=L(s,2);A(t),R(()=>q(a,(r(),H(()=>r().size)))),W(`click`,o,()=>Aa.set(new Set)),W(`click`,s,()=>y.handleBulkArchive()),W(`click`,c,()=>y.handleBulkDelete()),K(e,t)};J(ke,e=>{r(),H(()=>r().size>0)&&e(O)}),A(S),R(()=>{q(le,`${c()??``} memories
67
+ `),i=new Blob([r],{type:`text/csv`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=t,o.click(),URL.revokeObjectURL(a)}function Fc(e,t){let n;return((...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)})}async function Ic(e){if(!e)return!1;try{return await navigator.clipboard.writeText(e),!0}catch(e){return console.error(`Failed to copy text: `,e),!1}}function Lc(e){let t=null;function n(t){ma.set(t),localStorage.setItem(`selectedRepo`,t),e&&e(t)}function r(e,t){t.preventDefault(),t.stopPropagation(),ga.update(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}function i(){ha.update(e=>!e)}function a(e,n){t=e,n.dataTransfer&&(n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,e)),n.currentTarget.classList.add(`opacity-50`)}function o(e,n){!t||t===e||(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect=`move`))}function s(e,n){n.preventDefault();let r=t||n.dataTransfer?.getData(`text/plain`);!r||r===e||(ga.update(t=>{let n=t.filter(e=>e!==r),i=n.indexOf(e);return n.splice(i,0,r),n}),t=null)}function c(e){t=null,e.currentTarget.classList.remove(`opacity-50`),document.querySelectorAll(`.repo-item.drag-over`).forEach(e=>e.classList.remove(`drag-over`))}return{selectRepo:n,togglePin:r,toggleCollapse:i,onDragStart:a,onDragOver:o,onDrop:s,onDragEnd:c,getRepoInitials:Oc}}var Rc=Yr(`<circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><path d="M12 17h.01"></path>`,1),zc=Yr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><!></svg>`);function $(e,t){let n=Z(t,`name`,8),r=Z(t,`size`,8,16),i=Z(t,`strokeWidth`,8,1.75),a=Z(t,`className`,8,``),o={brain:`<path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"/><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"/><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"/><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"/><path d="M3.477 10.896a4 4 0 0 1 .585-.396"/><path d="M19.938 10.5a4 4 0 0 1 .585.396"/><path d="M6 18a4 4 0 0 1-1.967-.516"/><path d="M19.967 17.484A4 4 0 0 1 18 18"/>`,"layout-dashboard":`<rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/>`,database:`<ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5V19A9 3 0 0 0 21 19V5"/><path d="M3 12A9 3 0 0 0 21 12"/>`,"clipboard-list":`<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="M12 11h4"/><path d="M12 16h4"/><path d="M8 11h.01"/><path d="M8 16h.01"/>`,"book-open":`<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/>`,"refresh-cw":`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>`,sun:`<circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/>`,moon:`<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>`,menu:`<line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/>`,"chevron-left":`<path d="m15 18-6-6 6-6"/>`,"chevron-right":`<path d="m9 18 6-6-6-6"/>`,"chevron-down":`<path d="m6 9 6 6 6-6"/>`,x:`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`,plus:`<path d="M5 12h14"/><path d="M12 5v14"/>`,search:`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>`,pin:`<path d="M12.586 2.586a2 2 0 0 1 2.828 0l2 2a2 2 0 0 1 0 2.828l-1.793 1.793-.914 4.57a1 1 0 0 1-.271.51l-1.414 1.414a1 1 0 0 1-1.414 0l-2.122-2.121-4.172 4.171a1 1 0 1 1-1.414-1.414l4.171-4.172-2.12-2.12a1 1 0 0 1 0-1.415l1.413-1.414a1 1 0 0 1 .51-.27l4.57-.915 1.792-1.793Z"/>`,star:`<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/>`,edit:`<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4Z"/>`,trash:`<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>`,copy:`<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>`,"external-link":`<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>`,filter:`<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/>`,sliders:`<line x1="4" x2="4" y1="21" y2="14"/><line x1="4" x2="4" y1="6" y2="3"/><line x1="12" x2="12" y1="21" y2="12"/><line x1="12" x2="12" y1="6" y2="3"/><line x1="20" x2="20" y1="21" y2="16"/><line x1="20" x2="20" y1="10" y2="3"/><line x1="1" x2="7" y1="14" y2="14"/><line x1="9" x2="15" y1="12" y2="12"/><line x1="17" x2="23" y1="16" y2="16"/>`,"circle-dot":`<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="1"/>`,"circle-check":`<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>`,"circle-x":`<circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/>`,"circle-pause":`<circle cx="12" cy="12" r="10"/><line x1="10" x2="10" y1="15" y2="9"/><line x1="14" x2="14" y1="15" y2="9"/>`,"circle-pause-alt":`<circle cx="12" cy="12" r="10"/><path d="M10 9v6"/><path d="M14 9v6"/>`,"triangle-alert":`<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/>`,check:`<path d="M20 6 9 17l-5-5"/>`,info:`<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>`,zap:`<path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"/>`,activity:`<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"/>`,memory:`<path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"/>`,"git-branch":`<line x1="6" x2="6" y1="3" y2="15"/><circle cx="18" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><path d="M18 9a9 9 0 0 1-9 9"/>`,tag:`<path d="M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"/><circle cx="7.5" cy="7.5" r=".5" fill="currentColor"/>`,user:`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>`,bot:`<path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M15 13v2"/><path d="M9 13v2"/>`,code:`<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>`,terminal:`<polyline points="4 17 10 11 4 5"/><line x1="12" x2="20" y1="19" y2="19"/>`,"file-text":`<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>`,layers:`<path d="m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"/><path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"/><path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"/>`,cpu:`<rect x="4" y="4" width="16" height="16" rx="2"/><rect x="9" y="9" width="6" height="6"/><path d="M15 2v2"/><path d="M15 20v2"/><path d="M2 15h2"/><path d="M2 9h2"/><path d="M20 15h2"/><path d="M20 9h2"/><path d="M9 2v2"/><path d="M9 20v2"/>`,clock:`<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>`,calendar:`<rect width="18" height="18" x="3" y="4" rx="2" ry="2"/><line x1="16" x2="16" y1="2" y2="6"/><line x1="8" x2="8" y1="2" y2="6"/><line x1="3" x2="21" y1="10" y2="10"/>`,"arrow-up":`<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>`,"arrow-down":`<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>`,"arrow-right":`<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>`,"trending-up":`<polyline points="22 7 13.5 15.5 8.5 10.5 2 17"/><polyline points="16 7 22 7 22 13"/>`,"bar-chart":`<line x1="12" x2="12" y1="20" y2="10"/><line x1="18" x2="18" y1="20" y2="4"/><line x1="6" x2="6" y1="20" y2="16"/>`,list:`<line x1="8" x2="21" y1="6" y2="6"/><line x1="8" x2="21" y1="12" y2="12"/><line x1="8" x2="21" y1="18" y2="18"/><line x1="3" x2="3.01" y1="6" y2="6"/><line x1="3" x2="3.01" y1="12" y2="12"/><line x1="3" x2="3.01" y1="18" y2="18"/>`,tool:`<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>`,columns:`<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="12" x2="12" y1="3" y2="21"/>`,sparkle:`<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>`,settings:`<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>`,wifi:`<path d="M5 12.55a11 11 0 0 1 14.08 0"/><path d="M1.42 9a16 16 0 0 1 21.16 0"/><path d="M8.53 16.11a6 6 0 0 1 6.95 0"/><line x1="12" x2="12.01" y1="20" y2="20"/>`,hash:`<line x1="4" x2="20" y1="9" y2="9"/><line x1="4" x2="20" y1="15" y2="15"/><line x1="10" x2="8" y1="3" y2="21"/><line x1="16" x2="14" y1="3" y2="21"/>`,inbox:`<polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>`,archive:`<rect width="20" height="5" x="2" y="3" rx="1"/><path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"/><path d="M10 12h4"/>`};var s=zc(),c=F(s),l=e=>{var t=Xr();di(I(t),()=>(U(n()),H(()=>o[n()])),void 0,!0),K(e,t)},u=e=>{var t=Rc();Ne(2),K(e,t)};J(c,e=>{U(n()),H(()=>o[n()])?e(l):e(u,-1)}),A(s),R(()=>{Wi(s,`width`,r()),Wi(s,`height`,r()),Wi(s,`stroke-width`,i()),Ai(s,0,wi(a()))}),K(e,s)}var Bc=G(`<div class="flex items-center gap-2"><div class="brand-icon svelte-vbr9x3"><!></div> <div><div class="font-bold text-sm" style="color:var(--color-text);letter-spacing:-0.02em;">Memory MCP</div> <div class="section-label" style="font-size:0.6rem;margin-top:0;">Dashboard</div></div></div>`),Vc=G(`<div class="brand-icon svelte-vbr9x3" style="margin:auto;"><!></div>`),Hc=G(`<div class="p-3" style="border-bottom: 1px solid var(--color-border);"><div class="search-wrapper svelte-vbr9x3"><span class="search-icon svelte-vbr9x3"><!></span> <input class="form-input search-input svelte-vbr9x3" type="text" placeholder="Search repos…"/></div></div>`),Uc=G(`<div class="repo-active-indicator"></div>`),Wc=G(`<span class="task-badge active svelte-vbr9x3"><!> </span>`),Gc=G(`<span class="task-badge todo svelte-vbr9x3"><!> </span>`),Kc=G(`<span class="task-badge blocked svelte-vbr9x3"><!> </span>`),qc=G(`<span class="task-badge backlog svelte-vbr9x3"><!> </span>`),Jc=G(`<div class="task-badges svelte-vbr9x3"><!> <!> <!> <!></div>`),Yc=G(`<div role="button" tabindex="0" draggable="true"><!> <div class="repo-avatar"> <span class="pin-star svelte-vbr9x3">★</span></div> <div class="min-w-0 flex-1"><div class="truncate font-semibold" style="font-size:0.82rem;color:var(--color-text);"> </div> <div class="truncate flex items-center gap-1" style="font-size:0.68rem;color:var(--color-text-muted);margin-bottom:2px;"><!> </div> <!></div> <button class="pin-btn svelte-vbr9x3" title="Unpin" aria-label="Unpin repository"><!></button></div>`),Xc=G(`<div class="group-label svelte-vbr9x3"><!> Pinned</div> <!>`,1),Zc=G(`<div class="group-label svelte-vbr9x3" style="margin-top:6px;"><!> All</div>`),Qc=G(`<div class="repo-active-indicator"></div>`),$c=G(`<span class="task-badge active svelte-vbr9x3"><!> </span>`),el=G(`<span class="task-badge todo svelte-vbr9x3"><!> </span>`),tl=G(`<span class="task-badge blocked svelte-vbr9x3"><!> </span>`),nl=G(`<span class="task-badge backlog svelte-vbr9x3"><!> </span>`),rl=G(`<div class="task-badges svelte-vbr9x3"><!> <!> <!> <!></div>`),il=G(`<div role="button" tabindex="0"><!> <div class="repo-avatar"> </div> <div class="min-w-0 flex-1"><div class="truncate font-semibold" style="font-size:0.82rem;color:var(--color-text);"> </div> <div class="truncate flex items-center gap-1" style="font-size:0.68rem;color:var(--color-text-muted);margin-bottom:2px;"><!> </div> <!></div> <button class="pin-btn svelte-vbr9x3" title="Pin" aria-label="Pin repository"><!></button></div>`),al=G(`<!> <!>`,1),ol=G(`<div style="text-align:center;padding:24px 16px;color:var(--color-text-muted);"><!> <div style="font-size:0.82rem;margin-top:8px;">No repositories found</div></div>`),sl=G(`<div class="flex items-center justify-between px-2 py-1 mb-1"><span class="section-label">Repositories</span> <span class="repo-count-chip svelte-vbr9x3"> </span></div> <!> <!> <!>`,1),cl=G(`<div class="repo-active-indicator"></div>`),ll=G(`<div role="button" tabindex="0"><!> <div class="repo-avatar" style="margin:auto;"> </div></div>`),ul=G(`<aside style="border-right: 1px solid var(--color-border);"><div class="sidebar-header svelte-vbr9x3" style="border-bottom: 1px solid var(--color-border);"><!> <button class="btn btn-ghost btn-icon btn-sm collapse-btn svelte-vbr9x3"><span><!></span></button></div> <!> <div class="overflow-y-auto flex-1 p-2" style="scrollbar-width: thin;"><!></div></aside>`);function dl(e,t){We(t,!1);let n=()=>N(ha,`$isRepoSidebarCollapsed`,s),r=()=>N(_a,`$repoSearchQuery`,s),i=()=>N(pa,`$availableRepos`,s),a=()=>N(La,`$orderedRepos`,s),o=()=>N(ma,`$currentRepo`,s),[s,c]=ft(),l=on(),u=Lc(Z(t,`onRepoSelect`,8,()=>{})());Un(()=>n(),()=>{sn(l,n())}),Wn(),na();var d=ul();let f;var p=F(d),m=F(p),h=e=>{var t=Bc(),n=F(t);$(F(n),{name:`brain`,size:14,strokeWidth:1.75}),A(n),Ne(2),A(t),K(e,t)},g=e=>{var t=Vc();$(F(t),{name:`brain`,size:14,strokeWidth:1.75}),A(t),K(e,t)};J(m,e=>{V(l)?e(g,-1):e(h)});var _=L(m,2),v=F(_);$(F(v),{name:`chevron-left`,size:14,strokeWidth:2}),A(v),A(_),A(p);var y=L(p,2),b=e=>{var t=Hc(),n=F(t),i=F(n);$(F(i),{name:`search`,size:13,strokeWidth:2}),A(i);var a=L(i,2);Vi(a),A(n),A(t),Ji(a,r,e=>dt(_a,e)),K(e,t)};J(y,e=>{V(l)||e(b)});var x=L(y,2),S=F(x),C=e=>{var t=sl(),n=I(t),r=L(F(n),2),s=F(r,!0);A(r),A(n);var c=L(n,2),l=e=>{var t=Xc(),n=I(t);$(F(n),{name:`star`,size:10,strokeWidth:2}),Ne(),A(n),X(L(n,2),1,()=>(a(),H(()=>a().pinned)),Y,(e,t)=>{var n=Yc();let r;var i=F(n),a=e=>{K(e,Uc())};J(i,e=>{o(),V(t),H(()=>o()===V(t).repo)&&e(a)});var s=L(i,2),c=F(s);Ne(),A(s);var l=L(s,2),d=F(l),f=F(d,!0);A(d);var p=L(d,2),m=F(p);$(m,{name:`database`,size:9,strokeWidth:2});var h=L(m);A(p);var g=L(p,2),_=e=>{var n=Jc(),r=F(n),i=e=>{var n=Wc(),r=F(n);$(r,{name:`zap`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).in_progress_count))??``}`)),K(e,n)};J(r,e=>{V(t),H(()=>V(t).in_progress_count)&&e(i)});var a=L(r,2),o=e=>{var n=Gc(),r=F(n);$(r,{name:`circle-dot`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).pending_count))??``}`)),K(e,n)};J(a,e=>{V(t),H(()=>V(t).pending_count)&&e(o)});var s=L(a,2),c=e=>{var n=Kc(),r=F(n);$(r,{name:`triangle-alert`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).blocked_count))??``}`)),K(e,n)};J(s,e=>{V(t),H(()=>V(t).blocked_count)&&e(c)});var l=L(s,2),u=e=>{var n=qc(),r=F(n);$(r,{name:`archive`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).backlog_count))??``}`)),K(e,n)};J(l,e=>{V(t),H(()=>V(t).backlog_count)&&e(u)}),A(n),K(e,n)};J(g,e=>{V(t),H(()=>(V(t).in_progress_count||0)+(V(t).pending_count||0)+(V(t).blocked_count||0)+(V(t).backlog_count||0)>0)&&e(_)}),A(l);var v=L(l,2);$(F(v),{name:`pin`,size:12,strokeWidth:1.75}),A(v),A(n),R(e=>{r=Ai(n,1,`repo-item svelte-vbr9x3`,null,r,{active:o()===V(t).repo}),Wi(n,`title`,`${(V(t),H(()=>V(t).repo))??``} • ${(V(t),H(()=>V(t).memory_count))??``} memories`),q(c,`${e??``} `),q(f,(V(t),H(()=>V(t).repo))),q(h,` ${(V(t),H(()=>V(t).memory_count))??``} memories`)},[()=>(V(t),H(()=>u.getRepoInitials(V(t).repo)))]),W(`click`,v,e=>u.togglePin(V(t).repo,e)),W(`click`,n,()=>u.selectRepo(V(t).repo)),W(`keydown`,n,e=>(e.key===`Enter`||e.key===` `)&&u.selectRepo(V(t).repo)),W(`dragstart`,n,e=>u.onDragStart(V(t).repo,e)),W(`dragover`,n,e=>u.onDragOver(V(t).repo,e)),W(`drop`,n,e=>u.onDrop(V(t).repo,e)),W(`dragend`,n,function(...e){u.onDragEnd?.apply(this,e)}),K(e,n)}),K(e,t)};J(c,e=>{a(),H(()=>a().pinned.length>0)&&e(l)});var d=L(c,2),f=e=>{var t=al(),n=I(t),r=e=>{var t=Zc();$(F(t),{name:`layers`,size:10,strokeWidth:2}),Ne(),A(t),K(e,t)};J(n,e=>{a(),H(()=>a().pinned.length>0)&&e(r)}),X(L(n,2),1,()=>(a(),H(()=>a().unpinned)),Y,(e,t)=>{var n=il();let r;var i=F(n),a=e=>{K(e,Qc())};J(i,e=>{o(),V(t),H(()=>o()===V(t).repo)&&e(a)});var s=L(i,2),c=F(s,!0);A(s);var l=L(s,2),d=F(l),f=F(d,!0);A(d);var p=L(d,2),m=F(p);$(m,{name:`database`,size:9,strokeWidth:2});var h=L(m);A(p);var g=L(p,2),_=e=>{var n=rl(),r=F(n),i=e=>{var n=$c(),r=F(n);$(r,{name:`zap`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).in_progress_count))??``}`)),K(e,n)};J(r,e=>{V(t),H(()=>V(t).in_progress_count)&&e(i)});var a=L(r,2),o=e=>{var n=el(),r=F(n);$(r,{name:`circle-dot`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).pending_count))??``}`)),K(e,n)};J(a,e=>{V(t),H(()=>V(t).pending_count)&&e(o)});var s=L(a,2),c=e=>{var n=tl(),r=F(n);$(r,{name:`triangle-alert`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).blocked_count))??``}`)),K(e,n)};J(s,e=>{V(t),H(()=>V(t).blocked_count)&&e(c)});var l=L(s,2),u=e=>{var n=nl(),r=F(n);$(r,{name:`archive`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).backlog_count))??``}`)),K(e,n)};J(l,e=>{V(t),H(()=>V(t).backlog_count)&&e(u)}),A(n),K(e,n)};J(g,e=>{V(t),H(()=>(V(t).in_progress_count||0)+(V(t).pending_count||0)+(V(t).blocked_count||0)+(V(t).backlog_count||0)>0)&&e(_)}),A(l);var v=L(l,2);$(F(v),{name:`pin`,size:12,strokeWidth:1.75}),A(v),A(n),R(e=>{r=Ai(n,1,`repo-item svelte-vbr9x3`,null,r,{active:o()===V(t).repo}),Wi(n,`title`,`${(V(t),H(()=>V(t).repo))??``} • ${(V(t),H(()=>V(t).memory_count))??``} memories`),q(c,e),q(f,(V(t),H(()=>V(t).repo))),q(h,` ${(V(t),H(()=>V(t).memory_count))??``} memories`)},[()=>(V(t),H(()=>u.getRepoInitials(V(t).repo)))]),W(`click`,v,e=>u.togglePin(V(t).repo,e)),W(`click`,n,()=>u.selectRepo(V(t).repo)),W(`keydown`,n,e=>(e.key===`Enter`||e.key===` `)&&u.selectRepo(V(t).repo)),K(e,n)}),K(e,t)};J(d,e=>{a(),H(()=>a().unpinned.length>0)&&e(f)});var p=L(d,2),m=e=>{var t=ol();$(F(t),{name:`inbox`,size:24,strokeWidth:1.5}),Ne(2),A(t),K(e,t)};J(p,e=>{i(),H(()=>i().length===0)&&e(m)}),R(()=>q(s,(i(),H(()=>i().length)))),K(e,t)},w=e=>{var t=Xr();X(I(t),1,i,Y,(e,t)=>{var n=ll();let r;var i=F(n),a=e=>{K(e,cl())};J(i,e=>{o(),V(t),H(()=>o()===V(t).repo)&&e(a)});var s=L(i,2),c=F(s,!0);A(s),A(n),R(e=>{r=Ai(n,1,`repo-item collapsed`,null,r,{active:o()===V(t).repo}),Wi(n,`title`,(V(t),H(()=>V(t).repo))),q(c,e)},[()=>(V(t),H(()=>u.getRepoInitials(V(t).repo)))]),W(`click`,n,()=>u.selectRepo(V(t).repo)),W(`keydown`,n,e=>(e.key===`Enter`||e.key===` `)&&u.selectRepo(V(t).repo)),K(e,n)}),K(e,t)};J(S,e=>{V(l)?e(w,-1):e(C)}),A(x),A(d),R(()=>{f=Ai(d,1,`sidebar glass-strong flex flex-col`,null,f,{collapsed:V(l)}),Wi(_,`title`,V(l)?`Expand sidebar`:`Collapse sidebar`),Wi(_,`aria-label`,V(l)?`Expand`:`Collapse`),Mi(v,`transition: transform 0.3s ease; display:inline-flex; transform: rotate(${V(l)?`180deg`:`0deg`})`)}),W(`click`,_,function(...e){u.toggleCollapse?.apply(this,e)}),K(e,d),Ge(),c()}var fl=`https://github.com/vheins/local-memory-mcp`,pl=`https://www.npmjs.com/package/@vheins/local-memory-mcp`;function ml(e){let t=j(30),n=j(!1),r=j(null),i=j(!0),a;function o(e){return e>=1e6?(e/1e6).toFixed(1)+`M`:e>=1e3?(e/1e3).toFixed(1)+`k`:String(e)}async function s(){try{let e=await fetch(`https://api.npmjs.org/downloads/point/last-month/@vheins/local-memory-mcp`);if(e.ok){let t=await e.json();r.set(t.downloads??null)}}catch{r.set(null)}finally{i.set(!1)}}function c(){da.update(e=>e===`dark`?`light`:`dark`)}function l(){clearInterval(a),t.set(30),a=setInterval(()=>{t.update(t=>t<=1?(e(),30):t-1)},1e3)}async function u(){n.set(!0),e(),l(),setTimeout(()=>n.set(!1),800)}function d(){clearInterval(a)}return{countdownSeconds:t,refreshing:n,npmDownloads:r,npmLoading:i,formatDownloads:o,fetchNpmDownloads:s,toggleTheme:c,startCountdown:l,manualRefresh:u,getRepoInitials:Oc,destroy:d}}var hl=G(`<div class="flex items-center gap-1 svelte-2va9hf" style="font-size:0.65rem;color:var(--color-text-muted);"><!> <span class="svelte-2va9hf"> </span></div>`),gl=G(`<div class="flex items-center gap-2 svelte-2va9hf"><div style="width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,#0ea5e9,#6366f1);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:11px;color:white;flex-shrink:0;box-shadow:0 4px 10px rgba(14,165,233,0.28);" class="svelte-2va9hf"> </div> <div class="svelte-2va9hf"><div class="font-semibold svelte-2va9hf" style="font-size:0.82rem;color:var(--color-text);max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"> </div> <!></div></div>`),_l=G(`<div style="font-size:0.85rem;color:var(--color-text-muted);" class="flex items-center gap-2 svelte-2va9hf"><!> <span class="svelte-2va9hf">Select a repository</span></div>`),vl=G(`<span class="ext-link-label npm-dl-skeleton svelte-2va9hf"></span>`),yl=G(`<span class="ext-link-label npm-dl-badge svelte-2va9hf"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="svelte-2va9hf"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3" class="svelte-2va9hf"></path></svg> </span>`),bl=G(`<span class="ext-link-label svelte-2va9hf">npm</span>`),xl=G(`<div class="flex items-center gap-2 svelte-2va9hf"><div class="status-dot status-dot-online svelte-2va9hf"></div> <span style="font-size:0.72rem;font-weight:600;color:var(--color-text-muted);" class="svelte-2va9hf">Online</span> <span style="font-size:0.65rem;color:var(--color-text-muted);background:rgba(100,116,139,0.1);padding:1px 6px;border-radius:9999px;border:1px solid rgba(100,116,139,0.15);" class="svelte-2va9hf"> </span></div>`),Sl=G(`<span class="flex items-center gap-1 svelte-2va9hf" style="font-size:0.65rem;color:var(--color-text-muted);max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"><!> </span>`),Cl=G(`<header class="top-bar glass-strong svelte-2va9hf" style="border-bottom: 1px solid var(--color-border); z-index: 30;"><div class="flex items-center justify-between svelte-2va9hf" style="padding: 10px 20px; min-height: 60px;"><div class="flex items-center gap-3 svelte-2va9hf"><button class="btn btn-ghost btn-icon svelte-2va9hf" aria-label="Toggle menu" style="display:none;" id="mobileMenuBtn"><!></button> <!></div> <div class="flex items-center gap-2 svelte-2va9hf"><div class="ext-links-group svelte-2va9hf"><a target="_blank" rel="noopener noreferrer" class="ext-link-btn svelte-2va9hf" title="View on GitHub" aria-label="GitHub repository" id="githubLink"><svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" class="svelte-2va9hf"><path d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" class="svelte-2va9hf"></path></svg> <span class="ext-link-label svelte-2va9hf">GitHub</span></a> <div class="ext-link-divider svelte-2va9hf"></div> <a target="_blank" rel="noopener noreferrer" class="ext-link-btn ext-link-star svelte-2va9hf" title="Star on GitHub" aria-label="Star on GitHub" id="githubStarBtn"><svg width="13" height="13" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" class="svelte-2va9hf"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" class="svelte-2va9hf"></path></svg> <span class="ext-link-label svelte-2va9hf">Star</span></a> <div class="ext-link-divider svelte-2va9hf"></div> <a target="_blank" rel="noopener noreferrer" class="ext-link-btn ext-link-npm svelte-2va9hf" title="View on npm" aria-label="npm package" id="npmLink"><svg width="18" height="11" viewBox="0 0 18 7" fill="currentColor" aria-hidden="true" class="svelte-2va9hf"><path d="M0 0h18v6H9V7H5V6H0V0zm1 5h2V1h1v4h1V1h1v5h4V1h1v4h1V1h1v4h1V1h2v5H1V5z" class="svelte-2va9hf"></path></svg> <!></a></div> <div style="width:1px;height:20px;background:var(--color-border);opacity:0.6;" class="svelte-2va9hf"></div> <!> <div class="flex items-center gap-2 svelte-2va9hf"><div class="countdown-bar svelte-2va9hf"><div class="countdown-track svelte-2va9hf"><div class="countdown-fill svelte-2va9hf"></div></div> <span class="countdown-label svelte-2va9hf"> </span></div> <button title="Refresh now" aria-label="Refresh"><span><!></span></button></div> <button class="btn btn-ghost btn-icon btn-sm svelte-2va9hf" title="Toggle theme" aria-label="Toggle theme"><!></button> <!></div></div></header>`);function wl(e,t){We(t,!1);let n=()=>N(_,`$countdownSeconds`,u),r=()=>N(pa,`$availableRepos`,u),i=()=>N(ma,`$currentRepo`,u),a=()=>N(b,`$npmLoading`,u),o=()=>N(y,`$npmDownloads`,u),s=()=>N(Ia,`$healthData`,u),c=()=>N(v,`$refreshing`,u),l=()=>N(da,`$theme`,u),[u,d]=ft(),f=on(),p=on(),m=on(),h=Z(t,`onRefresh`,8,()=>{}),g=Z(t,`onToggleMobileMenu`,8,()=>{}),{countdownSeconds:_,refreshing:v,npmDownloads:y,npmLoading:b,formatDownloads:x,fetchNpmDownloads:S,toggleTheme:C,startCountdown:w,manualRefresh:T,getRepoInitials:E,destroy:D}=ml(h());aa(()=>{w(),S()}),oa(()=>D()),Un(()=>n(),()=>{sn(f,n()/30*100)}),Un(()=>n(),()=>{sn(p,n()<=5?`#ef4444`:n()<=10?`#f97316`:`#0ea5e9`)}),Un(()=>(r(),i()),()=>{sn(m,r().find(e=>e.repo===i()))}),Wn(),na();var ee=Cl(),te=F(ee),ne=F(te),re=F(ne);$(F(re),{name:`menu`,size:18,strokeWidth:2}),A(re);var ie=L(re,2),ae=e=>{var t=gl(),n=F(t),r=F(n,!0);A(n);var a=L(n,2),o=F(a),s=F(o,!0);A(o);var c=L(o,2),l=e=>{var t=hl(),n=F(t);$(n,{name:`database`,size:10,strokeWidth:2});var r=L(n,2),i=F(r);A(r),A(t),R(()=>q(i,`${(V(m),H(()=>V(m).memory_count||0))??``} memories`)),K(e,t)};J(c,e=>{V(m)&&e(l)}),A(a),A(t),R(e=>{q(r,e),q(s,i())},[()=>(i(),H(()=>E(i())))]),K(e,t)},oe=e=>{var t=_l();$(F(t),{name:`brain`,size:14,strokeWidth:1.75}),Ne(2),A(t),K(e,t)};J(ie,e=>{i()?e(ae):e(oe,-1)}),A(ne);var se=L(ne,2),ce=F(se),le=F(ce),ue=L(le,4),de=L(ue,4),fe=L(F(de),2),pe=e=>{K(e,vl())},me=e=>{var t=yl(),n=L(F(t));A(t),R(e=>q(n,` ${e??``}/mo`),[()=>(o(),H(()=>x(o())))]),K(e,t)},he=e=>{K(e,bl())};J(fe,e=>{a()?e(pe):o()===null?e(he,-1):e(me,1)}),A(de),A(ce);var ge=L(ce,4),_e=e=>{var t=xl(),n=L(F(t),4),r=F(n);A(n),A(t),R(()=>q(r,`v${(s(),H(()=>s().version))??``}`)),K(e,t)};J(ge,e=>{s()&&e(_e)});var ve=L(ge,2),ye=F(ve),be=F(ye),xe=F(be);A(be);var Se=L(be,2),Ce=F(Se);A(Se),A(ye);var we=L(ye,2);let Te;var Ee=F(we);let De;$(F(Ee),{name:`refresh-cw`,size:14,strokeWidth:2.5}),A(Ee),A(we),A(ve);var Oe=L(ve,2),ke=F(Oe),O=e=>{$(e,{name:`sun`,size:16,strokeWidth:1.75})},Ae=e=>{$(e,{name:`moon`,size:16,strokeWidth:1.75})};J(ke,e=>{l()===`dark`?e(O):e(Ae,-1)}),A(Oe);var k=L(Oe,2),je=e=>{var t=Sl(),n=F(t);$(n,{name:`database`,size:10,strokeWidth:2});var r=L(n);A(t),R(e=>{Wi(t,`title`,(s(),H(()=>s().dbPath))),q(r,` ${e??``}`)},[()=>(s(),H(()=>s().dbPath.split(/[/\\]/).pop()))]),K(e,t)};J(k,e=>{s(),H(()=>s()?.dbPath)&&e(je)}),A(se),A(te),A(ee),R(()=>{Wi(le,`href`,fl),Wi(ue,`href`,`https://github.com/vheins/local-memory-mcp/stargazers`),Wi(de,`href`,pl),Mi(xe,`width:${V(f)??``}%;background:${V(p)??``};`),Mi(Se,`color:${n()<=5?`#ef4444`:`var(--color-text-muted)`};`),q(Ce,`${n()??``}s`),Te=Ai(we,1,`btn btn-ghost btn-icon btn-sm svelte-2va9hf`,null,Te,{refreshing:c()}),De=Ai(Ee,1,`svelte-2va9hf`,null,De,{"animate-spin":c()})}),W(`click`,re,function(...e){g()?.apply(this,e)}),W(`click`,we,T),W(`click`,Oe,C),K(e,ee),Ge(),d()}var Tl={1:`#94a3b8`,2:`#3b82f6`,3:`#f59e0b`,4:`#f97316`,5:`#ef4444`},El={backlog:`archive`,pending:`circle-dot`,in_progress:`zap`,completed:`circle-check`,blocked:`circle-x`,canceled:`circle-pause-alt`},Dl={backlog:`#64748b`,pending:`#0ea5e9`,in_progress:`#a855f7`,completed:`#10b981`,blocked:`#ef4444`,canceled:`#f59e0b`};function Ol(e){return e?e.replace(/<[^>]*>/g,``).replace(/!\[.*?\]\(.*?\)/g,``).replace(/\[([^\]]+)\]\(.*?\)/g,`$1`).replace(/```[\s\S]*?```/g,``).replace(/`([^`]+)`/g,`$1`).replace(/[#*~_-]/g,``).replace(/\s+/g,` `).trim():``}var kl=G(`<span class="phase-chip svelte-1797zcc"> </span>`),Al=G(`<div class="task-desc svelte-1797zcc"> </div>`),jl=G(`<div class="agent-row svelte-1797zcc"><div class="agent-avatar svelte-1797zcc"><!></div> <span class="agent-name svelte-1797zcc"> </span></div>`),Ml=G(`<span></span>`),Nl=G(`<div class="token-row svelte-1797zcc"><span class="token-badge svelte-1797zcc"><!> </span></div>`),Pl=G(`<div class="task-card animate-fade-in svelte-1797zcc" role="button" tabindex="0"><div class="priority-bar svelte-1797zcc"></div> <div class="card-header svelte-1797zcc"><div class="code-row svelte-1797zcc"><span class="status-icon-dot svelte-1797zcc"><!></span> <span class="task-code-text svelte-1797zcc"> </span></div> <!></div> <div class="task-title svelte-1797zcc"> </div> <!> <div class="card-footer svelte-1797zcc"><!> <div class="time-row svelte-1797zcc"><!> <span> </span></div></div> <!></div>`);function Fl(e,t){We(t,!1);let n=on(),r=on(),i=on(),a=on(),o=Z(t,`task`,8);Un(()=>U(o()),()=>{sn(n,Tl[o().priority]||`#94a3b8`)}),Un(()=>U(o()),()=>{sn(r,El[o().status]||`circle-dot`)}),Un(()=>U(o()),()=>{sn(i,Dl[o().status]||`#94a3b8`)}),Un(()=>U(o()),()=>{sn(a,Ol(o().description))}),Wn(),na();var s=Pl(),c=F(s),l=L(c,2),u=F(l),d=F(u);$(F(d),{get name(){return V(r)},size:11,strokeWidth:2.5}),A(d);var f=L(d,2),p=F(f,!0);A(f),A(u);var m=L(u,2),h=e=>{var t=kl(),n=F(t,!0);A(t),R(()=>q(n,(U(o()),H(()=>o().phase)))),K(e,t)};J(m,e=>{U(o()),H(()=>o().phase)&&e(h)}),A(l);var g=L(l,2),_=F(g,!0);A(g);var v=L(g,2),y=e=>{var t=Al(),n=F(t,!0);A(t),R(()=>q(n,V(a))),K(e,t)};J(v,e=>{V(a)&&e(y)});var b=L(v,2),x=F(b),S=e=>{var t=jl(),n=F(t);$(F(n),{name:`bot`,size:9,strokeWidth:2}),A(n);var r=L(n,2),i=F(r,!0);A(r),A(t),R(()=>q(i,(U(o()),H(()=>o().agent)))),K(e,t)},C=e=>{K(e,Ml())};J(x,e=>{U(o()),H(()=>o().agent)?e(S):e(C,-1)});var w=L(x,2),T=F(w);$(T,{name:`clock`,size:10,strokeWidth:2});var E=L(T,2),D=F(E,!0);A(E),A(w),A(b);var ee=L(b,2),te=e=>{var t=Nl(),n=F(t),r=F(n);$(r,{name:`cpu`,size:9,strokeWidth:2});var i=L(r);A(n),A(t),R(e=>q(i,` ~${e??``} tokens`),[()=>(U(o()),H(()=>o().est_tokens>=1e3?(o().est_tokens/1e3).toFixed(1)+`k`:o().est_tokens))]),K(e,t)};J(ee,e=>{U(o()),H(()=>o().est_tokens&&o().est_tokens>0)&&e(te)}),A(s),R(e=>{Mi(c,`background:${V(n)??``};`),Mi(d,`color:${V(i)??``};`),q(p,(U(o()),H(()=>o().task_code))),q(_,(U(o()),H(()=>o().title))),q(D,e)},[()=>(U(Tc),U(o()),H(()=>Tc(o().updated_at)))]),W(`click`,s,function(e){ia.call(this,t,e)}),W(`keydown`,s,function(e){ia.call(this,t,e)}),K(e,s),Ge()}var Il=[{status:`backlog`,label:`Backlog`,bg:`rgba(100,116,139,0.07)`,border:`rgba(100,116,139,0.18)`,icon:`archive`,color:`#64748b`},{status:`pending`,label:`To Do`,bg:`rgba(14,165,233,0.06)`,border:`rgba(14,165,233,0.18)`,icon:`circle-dot`,color:`#0ea5e9`},{status:`in_progress`,label:`In Progress`,bg:`rgba(168,85,247,0.07)`,border:`rgba(168,85,247,0.18)`,icon:`zap`,color:`#a855f7`},{status:`completed`,label:`Completed`,bg:`rgba(16,185,129,0.06)`,border:`rgba(16,185,129,0.18)`,icon:`circle-check`,color:`#10b981`}];function Ll(){let e={},t={};Il.forEach(n=>{e[n.status]={page:1,pageSize:20,hasMore:!0},t[n.status]=[]});let{subscribe:n,update:r}=j({loadingCols:new Set,pagination:e,columnTasks:t,draggedTask:null,sourceCol:null,dragOverCol:null});async function i(e,t,i){let a=M({subscribe:n});if(a.loadingCols.has(t))return;r(e=>{let n=new Set(e.loadingCols);return n.add(t),{...e,loadingCols:n}});let o=a.pagination[t];try{let n=await Va.tasks({repo:e,status:t,search:i,page:o.page,pageSize:o.pageSize});r(e=>{let r=o.page===1?n.tasks||[]:[...e.columnTasks[t]||[],...n.tasks||[]];return{...e,columnTasks:{...e.columnTasks,[t]:r},pagination:{...e.pagination,[t]:{...o,hasMore:(n.tasks?.length||0)>=o.pageSize}}}})}catch(e){console.error(`Failed to load ${t}:`,e)}finally{r(e=>{let n=new Set(e.loadingCols);return n.delete(t),{...e,loadingCols:n}})}}async function a(e,t){e&&(r(e=>{let t={...e.pagination},n={...e.columnTasks};return Il.forEach(e=>{t[e.status]={page:1,pageSize:20,hasMore:!0},n[e.status]=[]}),{...e,pagination:t,columnTasks:n}}),await Promise.all(Il.map(n=>i(e,n.status,t))))}async function o(e){let t=M(ma),n=M(ja);t&&(r(t=>({...t,pagination:{...t.pagination,[e]:{...t.pagination[e],page:t.pagination[e].page+1}}})),await i(t,e,n))}function s(e,t,n){e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.id)),r(e=>({...e,draggedTask:t,sourceCol:n}))}function c(e,t){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`);let i=M({subscribe:n});!i.draggedTask||i.sourceCol===t||r(e=>({...e,dragOverCol:t}))}function l(e){r(t=>t.dragOverCol===e?{...t,dragOverCol:null}:t)}async function u(e){let t=M(ma),i=M(ja),{draggedTask:o,sourceCol:s}=M({subscribe:n});if(r(e=>({...e,dragOverCol:null,draggedTask:null,sourceCol:null})),!(!o||!s||s===e)){r(t=>{let n={...t.columnTasks};return n[s]=n[s].filter(e=>e.id!==o.id),n[e]=[{...o,status:e},...n[e]||[]],{...t,columnTasks:n}});try{await Va.updateTask(o.id,{status:e})}catch(e){console.error(`Failed to move task:`,e),t&&a(t,i)}}}async function d(e){let t=M(ma);if(t)try{let n=await Va.export(t),r=`${t.replace(/\//g,`_`)}_tasks_export`;e===`json`?Nc(n.tasks||[],r+`.json`):Pc(n.tasks||[],r+`.csv`)}catch(e){alert(`Export failed: `+e.message)}}return aa(()=>{let e=!0,t=ma.subscribe(e=>{let t=M(ja);e&&a(e,t)}),n,r=ja.subscribe(t=>{if(e)return;let r=M(ma);r&&(clearTimeout(n),n=setTimeout(()=>{a(r,t)},150))});return e=!1,()=>{t(),r(),clearTimeout(n)}}),{subscribe:n,loadTasks:a,loadMore:o,handleDragStart:s,handleDragOver:c,handleDragLeave:l,handleDrop:u,handleExport:d}}var Rl=G(`<div class="skeleton" style="height:80px;border-radius:12px;"></div> <div class="skeleton" style="height:60px;border-radius:12px;"></div>`,1),zl=G(`<div class="empty-col svelte-173w724"><span><!></span> <div style="font-size:0.75rem;color:var(--color-text-muted);margin-top:6px;">No tasks</div></div>`),Bl=G(`<div draggable="true" style="cursor: grab;"><!></div>`),Vl=G(`<span class="animate-spin"><!></span>`),Hl=G(`<button class="btn btn-ghost btn-sm w-full" style="margin-top:4px;justify-content:center;"><!> </button>`),Ul=G(`<!> <!>`,1),Wl=G(`<div><div class="flex items-center gap-2 mb-3"><span><!></span> <span style="font-size:0.78rem;font-weight:700;color:var(--color-text);"> </span> <span class="col-count svelte-173w724"> </span></div> <div class="flex flex-col" style="gap:8px;overflow-y:auto;max-height:calc(100vh - 340px);padding-right:2px;"><!></div></div>`),Gl=G(`<div><div class="flex items-center justify-between mb-4"><div class="search-wrap svelte-173w724"><span class="search-icon-inner svelte-173w724"><!></span> <input class="form-input" style="padding-left:32px;width:220px;font-size:0.8rem;" type="text" placeholder="Search tasks…"/></div> <div class="flex gap-2"><div class="flex gap-1 mr-1"><button class="btn btn-ghost btn-sm" title="Export JSON"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> JSON</button> <button class="btn btn-ghost btn-sm" title="Export CSV"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> CSV</button></div> <div style="width:1px;height:24px;background:var(--color-border);margin:0 4px;"></div> <button class="btn btn-ghost btn-sm" title="Bulk Import"><!> Import</button> <button class="btn btn-accent btn-sm"><!> Add Task</button></div></div> <div class="kanban-board" style="padding-bottom:16px;"></div></div>`);function Kl(e,t){We(t,!1);let n=()=>N(ja,`$taskSearch`,i),r=()=>N(u,`$kanbanState`,i),[i,a]=ft(),o=Z(t,`onTaskClick`,8,()=>{}),s=Z(t,`onAddTask`,8,()=>{}),c=Z(t,`onBulkImport`,8,()=>{}),l=Ll(),u={subscribe:l.subscribe};function d(e){l.loadTasks(e,n())}var f={loadTasks:d};na();var p=Gl(),m=F(p),h=F(m),g=F(h);$(F(g),{name:`search`,size:13,strokeWidth:2}),A(g);var _=L(g,2);Vi(_),A(h);var v=L(h,2),y=F(v),b=F(y),x=L(b,2);A(y);var S=L(y,4);$(F(S),{name:`upload`,size:14,strokeWidth:2.5}),Ne(),A(S);var C=L(S,2);$(F(C),{name:`plus`,size:14,strokeWidth:2.5}),Ne(),A(C),A(v),A(m);var w=L(m,2);X(w,5,()=>Il,Y,(e,t)=>{var n=Wl(),i=F(n),a=F(i);$(F(a),{get name(){return V(t),H(()=>V(t).icon)},size:13,strokeWidth:2}),A(a);var s=L(a,2),c=F(s,!0);A(s);var u=L(s,2),d=F(u);A(u),A(i);var f=L(i,2),p=F(f),m=e=>{var n=Xr(),i=I(n),a=e=>{var t=Rl();Ne(2),K(e,t)},o=Kt(()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status)))),s=e=>{var n=zl(),r=F(n);$(F(r),{get name(){return V(t),H(()=>V(t).icon)},size:22,strokeWidth:1.25}),A(r),Ne(2),A(n),R(()=>Mi(r,`color:${(V(t),H(()=>V(t).color))??``};opacity:0.5;`)),K(e,n)};J(i,e=>{V(o)?e(a):e(s,-1)}),K(e,n)},h=e=>{var n=Ul(),i=I(n);X(i,1,()=>(r(),V(t),H(()=>r().columnTasks[V(t).status])),e=>e.id,(e,n)=>{var r=Bl();Fl(F(r),{get task(){return V(n)},$$events:{click:()=>o()(V(n))}}),A(r),W(`dragstart`,r,e=>l.handleDragStart(e,V(n),V(t).status)),K(e,r)});var a=L(i,2),s=e=>{var n=Hl(),i=F(n),a=e=>{var t=Vl();$(F(t),{name:`refresh-cw`,size:12,strokeWidth:2}),A(t),K(e,t)},o=Kt(()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status)))),s=e=>{$(e,{name:`chevron-down`,size:12,strokeWidth:2})};J(i,e=>{V(o)?e(a):e(s,-1)});var c=L(i);A(n),R((e,t)=>{n.disabled=e,q(c,` ${t??``}`)},[()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status))),()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status)?`Loading…`:`Load more`))]),W(`click`,n,()=>l.loadMore(V(t).status)),K(e,n)};J(a,e=>{r(),V(t),H(()=>r().pagination[V(t).status]?.hasMore)&&e(s)}),K(e,n)};J(p,e=>{r(),V(t),H(()=>(r().columnTasks[V(t).status]||[]).length===0)?e(m):e(h,-1)}),A(f),A(n),R(()=>{Ai(n,1,`kanban-col ${(r(),V(t),H(()=>r().dragOverCol===V(t).status?`drag-over`:``))??``}`,`svelte-173w724`),Mi(n,`background:${(V(t),H(()=>V(t).bg))??``};border:1px solid ${(V(t),H(()=>V(t).border))??``};padding:12px;border-radius:16px;transition: border-color 0.2s;`),Mi(a,`color:${(V(t),H(()=>V(t).color))??``};display:flex;flex-shrink:0;`),q(c,(V(t),H(()=>V(t).label))),Mi(u,`margin-left:auto;background:${(V(t),H(()=>V(t).bg))??``};color:${(V(t),H(()=>V(t).color))??``};border:1px solid ${(V(t),H(()=>V(t).border))??``};`),q(d,`${(r(),V(t),H(()=>r().columnTasks[V(t).status]?.length||0))??``}${(r(),V(t),H(()=>r().pagination[V(t).status]?.hasMore?`+`:``))??``}`)}),W(`dragover`,n,e=>l.handleDragOver(e,V(t).status)),W(`dragleave`,n,()=>l.handleDragLeave(V(t).status)),W(`drop`,n,()=>l.handleDrop(V(t).status)),K(e,n)}),A(w),A(p),Ji(_,n,e=>dt(ja,e)),W(`click`,b,()=>l.handleExport(`json`)),W(`click`,x,()=>l.handleExport(`csv`)),W(`click`,S,function(...e){c()?.apply(this,e)}),W(`click`,C,function(...e){s()?.apply(this,e)}),K(e,p),Zi(t,`loadTasks`,d);var T=Ge(f);return a(),T}var ql={code_fact:`#a855f7`,decision:`#3b82f6`,mistake:`#ef4444`,pattern:`#10b981`,agent_handoff:`#f97316`,agent_registered:`#84cc16`,file_claim:`#06b6d4`,task_archive:`#78716c`},Jl={code_fact:`Code Facts`,decision:`Decisions`,mistake:`Mistakes`,pattern:`Patterns`,agent_handoff:`Handoffs`,agent_registered:`Registered`,file_claim:`Claims`,task_archive:`Archives`};function Yl(){return{summaryItems:st(va,e=>[{label:`Total Memories`,val:e?.total??`—`,icon:`layers`,color:`#0ea5e9`,glow:`rgba(14,165,233,0.12)`},{label:`Avg Importance`,val:e?.avgImportance?Number(e.avgImportance).toFixed(1):`—`,icon:`star`,color:`#f59e0b`,glow:`rgba(245,158,11,0.12)`},{label:`Total Hits`,val:e?.totalHitCount??`—`,icon:`mouse-pointer-2`,color:`#10b981`,glow:`rgba(16,185,129,0.12)`},{label:`Expiring Soon`,val:e?.expiringSoon??`—`,icon:`clock`,color:`#ef4444`,glow:`rgba(239,68,68,0.12)`}]),byTypeStats:st(va,e=>e?.byType?Object.entries(e.byType).filter(([e,t])=>t>0).map(([e,t])=>({type:e,count:t,color:ql[e]||`#64748b`,label:Jl[e]||e})):[])}}var Xl=G(`<div class="stat-card svelte-1imzu92"><div class="svelte-1imzu92"><!></div> <div class="svelte-1imzu92"> </div> <div style="font-size:0.6rem;font-weight:700;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-top:2px;" class="svelte-1imzu92"> </div></div>`),Zl=G(`<div class="flex items-center gap-2 glassy-badge svelte-1imzu92"><div class="indicator-dot svelte-1imzu92"></div> <span class="count svelte-1imzu92"> </span> <span class="label svelte-1imzu92"> </span></div>`),Ql=G(`<div style="margin-top:4px;" class="svelte-1imzu92"><div class="stat-label svelte-1imzu92" style="font-size:0.6rem;margin-bottom:6px;">By Type</div> <div style="display:flex;flex-wrap:wrap;gap:8px;" class="svelte-1imzu92"></div></div>`),$l=G(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(130px, 1fr));gap:10px;margin-bottom:12px;" class="svelte-1imzu92"></div> <!>`,1);function eu(e,t){We(t,!1);let n=()=>N(o,`$summaryItems`,i),r=()=>N(s,`$byTypeStats`,i),[i,a]=ft(),{summaryItems:o,byTypeStats:s}=Yl();na();var c=$l(),l=I(c);X(l,5,n,Y,(e,t)=>{var n=Xl(),r=F(n);$(F(r),{get name(){return V(t).icon},size:14,strokeWidth:1.75}),A(r);var i=L(r,2),a=F(i,!0);A(i);var o=L(i,2),s=F(o,!0);A(o),A(n),R(()=>{Mi(n,`text-align:center;background:${V(t).glow??``};border:1px solid ${V(t).glow??``};padding:10px 8px;`),Mi(r,`display:flex;justify-content:center;margin-bottom:2px;color:${V(t).color??``};opacity:0.8;`),Mi(i,`font-size:1.25rem;font-weight:900;color:${V(t).color??``};line-height:1;letter-spacing:-0.03em;`),q(a,V(t).val),q(s,V(t).label)}),K(e,n)}),A(l);var u=L(l,2),d=e=>{var t=Ql(),n=L(F(t),2);X(n,5,r,Y,(e,t)=>{var n=Zl(),r=L(F(n),2),i=F(r,!0);A(r);var a=L(r,2),o=F(a,!0);A(a),A(n),R(()=>{Mi(n,`--badge-color: ${V(t).color??``};`),q(i,V(t).count),q(o,V(t).label)}),K(e,n)}),A(n),A(t),K(e,t)};J(u,e=>{r().length>0&&e(d)}),K(e,c),Ge(),a()}var tu=G(`<div class="stat-card"><div><!></div> <div> </div> <div style="font-size:0.6rem;font-weight:700;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-top:2px;"> </div></div>`),nu=G(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(120px, 1fr));gap:10px;width:100%;"></div>`);function ru(e,t){We(t,!1);let n=()=>N(va,`$dashboardStats`,r),[r,i]=ft(),a=on(),o=on();Un(()=>n(),()=>{sn(a,n()?.taskStats)}),Un(()=>V(a),()=>{sn(o,[{label:`Total`,val:V(a)?.total??0,icon:`layers`,color:`#6366f1`,glow:`rgba(99,102,241,0.12)`},{label:`Backlog`,val:V(a)?.backlog??0,icon:`inbox`,color:`#64748b`,glow:`rgba(100,116,139,0.12)`},{label:`To Do`,val:V(a)?.todo??0,icon:`circle-dot`,color:`#0ea5e9`,glow:`rgba(14,165,233,0.12)`},{label:`Active`,val:V(a)?.inProgress??0,icon:`zap`,color:`#a855f7`,glow:`rgba(168,85,247,0.12)`},{label:`Done`,val:V(a)?.completed??0,icon:`circle-check`,color:`#10b981`,glow:`rgba(16,185,129,0.12)`}])}),Wn(),na();var s=Xr(),c=I(s),l=e=>{var t=nu();X(t,5,()=>V(o),Y,(e,t)=>{var n=tu(),r=F(n);$(F(r),{get name(){return V(t),H(()=>V(t).icon)},size:14,strokeWidth:1.75}),A(r);var i=L(r,2),a=F(i,!0);A(i);var o=L(i,2),s=F(o,!0);A(o),A(n),R(()=>{Mi(n,`text-align:center;background:${(V(t),H(()=>V(t).glow))??``};border:1px solid ${(V(t),H(()=>V(t).glow))??``};padding:10px 8px;`),Mi(r,`display:flex;justify-content:center;margin-bottom:2px;color:${(V(t),H(()=>V(t).color))??``};opacity:0.8;`),Mi(i,`font-size:1.25rem;font-weight:900;color:${(V(t),H(()=>V(t).color))??``};line-height:1;letter-spacing:-0.03em;`),q(a,(V(t),H(()=>V(t).val))),q(s,(V(t),H(()=>V(t).label)))}),K(e,n)}),A(t),K(e,t)};J(c,e=>{V(a)&&e(l)}),K(e,s),Ge(),i()}var iu=[{key:`daily`,label:`Today`},{key:`weekly`,label:`Week`},{key:`monthly`,label:`Month`},{key:`overall`,label:`All`}];function au(){let e=j(`daily`),t=st([ya,e],([e,t])=>e?.[t]),n=st(t,e=>e?.history||[]);return{activePeriod:e,periodData:t,history:n,maxVal:st(n,e=>Math.max(1,...e.map(e=>Math.max(e.created||0,e.completed||0)))),setActivePeriod:t=>e.set(t)}}var ou=G(`<button style="padding:4px 10px;font-size:0.65rem;"> </button>`),su=G(`<div class="flex-1 flex flex-col items-center group relative" style="height:100%;"><div class="flex h-full w-full items-end justify-center gap-[2px]"><div class="bar created-bar"></div> <div class="bar completed-bar"></div></div> <div class="absolute bottom-full mb-1 bg-slate-800 text-white p-1.5 rounded text-[10px] hidden group-hover:block z-10 whitespace-nowrap shadow-lg"><div class="font-bold border-b border-slate-600 mb-1"> </div> <div> </div> <div> </div></div> <div class="absolute bottom-0 translate-y-[20px] text-[8px] text-slate-400 whitespace-nowrap overflow-hidden max-w-full"> </div></div>`),cu=G(`<div class="mt-4 pt-4 border-t border-dashed" style="border-color:var(--color-border);"><div class="flex items-center justify-between mb-3"><div style="font-size:0.65rem;font-weight:700;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:0.05em;">Throughput vs Inflow</div> <div class="flex gap-2"><div class="flex items-center gap-1"><div style="width:8px;height:8px;border-radius:2px;background:#10b981;"></div> <span style="font-size:0.6rem;color:var(--color-text-muted);">Created</span></div> <div class="flex items-center gap-1"><div style="width:8px;height:8px;border-radius:2px;background:#6366f1;"></div> <span style="font-size:0.6rem;color:var(--color-text-muted);">Completed</span></div></div></div> <div style="height:120px;display:flex;align-items:flex-end;gap:4px;padding-bottom:20px;position:relative;"></div></div>`),lu=G(`<div class="mt-4 pt-4 border-t border-dashed flex items-center justify-center" style="border-color:var(--color-border);height:140px;color:var(--color-text-muted);font-size:0.75rem;">No trend data available for this period</div>`),uu=G(`<div class="glass card animate-fade-in"><div class="flex items-center justify-between mb-3"><div><div style="font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;color:#6366f1;">Task Stats</div> <div style="font-size:0.75rem;color:var(--color-text-muted);">Performance over time</div></div> <div class="flex gap-1" style="background:rgba(241,245,249,0.8);padding:3px;border-radius:10px;"></div></div> <div style="display:grid;grid-template-columns:repeat(2,1fr);gap:10px;"><div style="background:rgba(99,102,241,0.08);border:1px solid rgba(99,102,241,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#6366f1;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Completed</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div> <div style="background:rgba(16,185,129,0.08);border:1px solid rgba(16,185,129,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#10b981;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Added</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div> <div style="background:rgba(56,189,248,0.08);border:1px solid rgba(56,189,248,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#0ea5e9;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Tokens</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div> <div style="background:rgba(245,158,11,0.08);border:1px solid rgba(245,158,11,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#f59e0b;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Avg Time</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div></div> <!></div>`);function du(e,t){We(t,!1);let n=()=>N(c,`$activePeriod`,o),r=()=>N(l,`$periodData`,o),i=()=>N(u,`$history`,o),a=()=>N(d,`$maxVal`,o),[o,s]=ft(),{activePeriod:c,periodData:l,history:u,maxVal:d,setActivePeriod:f}=au();na();var p=uu(),m=F(p),h=L(F(m),2);X(h,5,()=>iu,Y,(e,t)=>{var r=ou();let i;var a=F(r,!0);A(r),R(()=>{i=Ai(r,1,`tab-btn`,null,i,{active:n()===V(t).key}),q(a,V(t).label)}),W(`click`,r,()=>f(V(t).key)),K(e,r)}),A(h),A(m);var g=L(m,2),_=F(g),v=L(F(_),2),y=F(v,!0);A(v),A(_);var b=L(_,2),x=L(F(b),2),S=F(x,!0);A(x),A(b);var C=L(b,2),w=L(F(C),2),T=F(w,!0);A(w),A(C);var E=L(C,2),D=L(F(E),2),ee=F(D,!0);A(D),A(E),A(g);var te=L(g,2),ne=e=>{var t=cu(),n=L(F(t),2);X(n,5,i,Y,(e,t)=>{var n=su(),r=F(n),i=F(r),o=L(i,2);A(r);var s=L(r,2),c=F(s),l=F(c,!0);A(c);var u=L(c,2),d=F(u);A(u);var f=L(u,2),p=F(f);A(f),A(s);var m=L(s,2),h=F(m,!0);A(m),A(n),R(e=>{Mi(i,`width:35%; height:${(V(t).created||0)/a()*100}%; background:#10b981; border-radius:3px 3px 0 0; opacity:0.8; transition: height 0.3s ease;`),Mi(o,`width:35%; height:${(V(t).completed||0)/a()*100}%; background:#6366f1; border-radius:3px 3px 0 0; opacity:0.8; transition: height 0.3s ease;`),q(l,V(t).label),q(d,`Added: ${V(t).created??``}`),q(p,`Done: ${V(t).completed??``}`),q(h,e)},[()=>V(t).label.includes(`:00`)?V(t).label.split(`:`)[0]:V(t).label.replace(`2026-`,``).replace(`2025-`,``)]),K(e,n)}),A(n),A(t),K(e,t)},re=e=>{K(e,lu())};J(te,e=>{r()?.history&&r().history.length>0?e(ne):e(re,-1)}),A(p),R((e,t)=>{q(y,r()?.completed??`—`),q(S,r()?.added??`—`),q(T,e),q(ee,t)},[()=>r()?.tokens?Ec(r().tokens):`—`,()=>r()?.avgDuration?Dc(r().avgDuration):`—`]),K(e,p),Ge(),s()}function fu(){let e=!1;async function t(t=M(ma)){if(!t){ba.set([]);return}e=!0;try{let e=await Va.memories({repo:t,type:M(Ta)||void 0,search:M(wa)||void 0,minImportance:M(Ea)||void 0,maxImportance:M(Da)||void 0,sortBy:M(Oa),sortOrder:M(ka),page:M(Sa),pageSize:M(Ca)});ba.set(e.memories||[]),xa.set(e.pagination?.totalItems||0)}catch(e){console.error(`Failed to load memories:`,e)}finally{e=!1}}let n=Fc(()=>{Sa.set(1),t()},300);function r(){n()}function i(){Sa.set(1),t()}function a(e){let n=M(Ra);e<1||e>n||(Sa.set(e),t())}function o(e){M(Oa)===e?ka.update(e=>e===`desc`?`asc`:`desc`):(Oa.set(e),ka.set(`desc`)),t()}function s(e){Aa.update(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function c(){Aa.update(e=>{let t=M(ba);return e.size===t.length?new Set:new Set(t.map(e=>e.id))})}async function l(e,t=M(ma)){if(t)try{let n=await Va.export(t),r=`${t.replace(`/`,`_`)}_export`;e===`json`?Nc(n,r+`.json`):Pc(n.memories||[],r+`.csv`)}catch(e){console.error(`Export failed:`,e)}}async function u(e,n){if(n&&n.stopPropagation(),confirm(`Delete memory "${e.title}"?`))try{await Va.deleteMemory(e.id),t()}catch(e){alert(`Failed to delete: `+e.message)}}async function d(){let e=M(Aa);if(e.size!==0&&confirm(`Are you sure you want to delete ${e.size} memories?`))try{await Va.bulkMemoryAction(`delete`,Array.from(e)),Aa.set(new Set),t()}catch(e){alert(`Failed to delete: `+e.message)}}async function f(){let e=M(Aa);if(e.size!==0)try{await Va.bulkMemoryAction(`archive`,Array.from(e)),Aa.set(new Set),t()}catch(e){alert(`Failed to archive: `+e.message)}}return{get loading(){return e},loadMemories:t,onSearchInput:r,onFilterChange:i,goToPage:a,toggleSort:o,toggleSelect:s,toggleSelectAll:c,handleExport:l,handleDeleteRow:u,handleBulkDelete:d,handleBulkArchive:f}}var pu=[`code_fact`,`decision`,`mistake`,`pattern`,`agent_handoff`,`agent_registered`,`file_claim`,`task_archive`],mu={code_fact:`Code Fact`,decision:`Decision`,mistake:`Mistake`,pattern:`Pattern`,agent_handoff:`Handoff`,agent_registered:`Registered`,file_claim:`File Claim`,task_archive:`Task Archive`},hu={1:`#64748b`,2:`#3b82f6`,3:`#f59e0b`,4:`#f97316`,5:`#ef4444`},gu={1:`rgba(100,116,139,0.12)`,2:`rgba(59,130,246,0.12)`,3:`rgba(245,158,11,0.12)`,4:`rgba(249,115,22,0.12)`,5:`rgba(239,68,68,0.12)`},_u=G(`<option> </option>`),vu=G(`<option> </option>`),yu=G(`<option> </option>`),bu=G(`<tr><td colspan="7" class="mem-td svelte-83aj9g"><div class="skeleton" style="height:20px;border-radius:6px;"></div></td></tr>`),xu=G(`<tr><td colspan="7" class="mem-td svelte-83aj9g" style="padding:40px;text-align:center;color:var(--color-text-muted);"><div style="font-size:2rem;margin-bottom:8px;">🔍</div> No memories found</td></tr>`),Su=G(`<span style="font-size:0.6rem;background:rgba(99,102,241,0.1);color:#6366f1;padding:1px 5px;border-radius:9999px;"> </span>`),Cu=G(`<div style="margin-top:3px;display:flex;gap:4px;flex-wrap:wrap;"></div>`),wu=G(`<tr><td class="mem-td svelte-83aj9g"><input type="checkbox"/></td><td class="mem-td svelte-83aj9g" style="max-width:300px;"><div class="truncate font-semibold" style="font-size:0.82rem;color:var(--color-text);"> </div> <!></td><td class="mem-td svelte-83aj9g"><span> </span></td><td class="mem-td svelte-83aj9g" style="text-align:center;"><span> </span></td><td class="mem-td svelte-83aj9g" style="font-size:0.75rem;color:var(--color-text-muted);white-space:nowrap;"> </td><td class="mem-td svelte-83aj9g" style="text-align:center;font-size:0.75rem;font-weight:600;color:var(--color-text-muted);"> </td><td class="mem-td row-actions svelte-83aj9g"><button class="row-action-btn edit-btn svelte-83aj9g" title="Edit / View" aria-label="Edit memory"><!></button> <button class="row-action-btn delete-btn svelte-83aj9g" title="Delete" aria-label="Delete memory"><!></button></td></tr>`),Tu=G(`<button> </button>`),Eu=G(`<div class="flex items-center justify-between mt-3"><span style="font-size:0.75rem;color:var(--color-text-muted);"> </span> <div class="flex gap-1"><button class="btn btn-ghost btn-sm">«</button> <button class="btn btn-ghost btn-sm">‹</button> <!> <button class="btn btn-ghost btn-sm">›</button> <button class="btn btn-ghost btn-sm">»</button></div></div>`),Du=G(`<div class="bulk-actions-bar svelte-83aj9g"><span><b> </b> selected</span> <div style="width:12px;"></div> <button class="btn btn-sm" style="background:rgba(120,120,120,0.2);color:inherit;">Cancel</button> <button class="btn btn-sm" style="background:#52525b;color:white;border:none;">Archive</button> <button class="btn btn-sm btn-accent" style="background:#ef4444;color:white;border:none;">Delete</button></div>`),Ou=G(`<div><div class="flex items-center gap-2 mb-3" style="flex-wrap:wrap;"><div style="position:relative;flex:1;min-width:160px;"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--color-text-muted);"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg> <input class="form-input" style="padding-left:32px;font-size:0.8rem;" type="text" placeholder="Search memories..."/></div> <select class="form-select" style="width:140px;font-size:0.8rem;"><option>All Types</option><!></select> <select class="form-select" style="width:100px;font-size:0.8rem;"><option>Min Imp.</option><!></select> <select class="form-select" style="width:100px;font-size:0.8rem;"></select> <div class="flex gap-1"><button class="btn btn-ghost btn-sm" title="Export JSON"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> JSON</button> <button class="btn btn-ghost btn-sm" title="Export CSV"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> CSV</button> <div style="width:1px;height:14px;background:var(--color-border);margin:auto 4px;"></div> <button class="btn btn-ghost btn-sm" title="Bulk Import"><!> Import</button></div> <button class="btn btn-accent btn-sm" id="newMemoryBtn" style="margin-left:auto;"><!> New Memory</button></div> <div style="font-size:0.72rem;color:var(--color-text-muted);margin-bottom:8px;"> </div> <div class="mem-table-wrap svelte-83aj9g"><table class="mem-table svelte-83aj9g"><thead><tr class="mem-thead-row svelte-83aj9g"><th class="mem-th svelte-83aj9g" style="width:36px;"><input type="checkbox" aria-label="Select all"/></th><th class="mem-th sortable svelte-83aj9g"> </th><th class="mem-th svelte-83aj9g">Type</th><th class="mem-th svelte-83aj9g" style="text-align:center;cursor:pointer;"> </th><th class="mem-th sortable svelte-83aj9g"> </th><th class="mem-th svelte-83aj9g" style="text-align:center;">Hits</th><th class="mem-th svelte-83aj9g" style="width:80px;"></th></tr></thead><tbody><!></tbody></table></div> <!> <!></div>`);function ku(e,t){We(t,!1);let n=()=>N(ba,`$memories`,p),r=()=>N(Aa,`$selectedMemoryIds`,p),i=()=>N(wa,`$memoriesSearch`,p),a=()=>N(Ta,`$memoriesTypeFilter`,p),o=()=>N(Ea,`$memoriesImportanceMin`,p),s=()=>N(Ca,`$memoriesPageSize`,p),c=()=>N(xa,`$memoriesTotal`,p),l=()=>N(Oa,`$memoriesSortBy`,p),u=()=>N(ka,`$memoriesSortOrder`,p),d=()=>N(Ra,`$memoriesTotalPages`,p),f=()=>N(Sa,`$memoriesPage`,p),[p,m]=ft(),h=on(),g=Z(t,`onMemoryClick`,8,()=>{}),_=Z(t,`onNewMemory`,8,()=>{}),v=Z(t,`onBulkImport`,8,()=>{}),y=fu();function b(){y.loadMemories()}Un(()=>(n(),r()),()=>{sn(h,n().length>0&&r().size===n().length)}),Wn();var x={refresh:b};na();var S=Ou(),C=F(S),w=F(C),T=L(F(w),2);Vi(T),A(w);var E=L(w,2),D=F(E);D.value=D.__value=``,X(L(D),1,()=>pu,Y,(e,t)=>{var n=_u(),r=F(n,!0);A(n);var i={};R(()=>{q(r,(U(mu),V(t),H(()=>mu[V(t)]))),i!==(i=V(t))&&(n.value=(n.__value=V(t))??``)}),K(e,n)}),A(E);var ee=L(E,2),te=F(ee);te.value=(te.__value=null,``),X(L(te),0,()=>[1,2,3,4,5],Y,(e,t)=>{var n=vu(),r=F(n,!0);A(n);var i={};R(()=>{q(r,t),i!==(i=t)&&(n.value=(n.__value=t)??``)}),K(e,n)}),A(ee);var ne=L(ee,2);X(ne,4,()=>[10,25,50,100],Y,(e,t)=>{var n=yu(),r=F(n);A(n);var i={};R(()=>{q(r,`${t??``} / page`),i!==(i=t)&&(n.value=(n.__value=t)??``)}),K(e,n)}),A(ne);var re=L(ne,2),ie=F(re),ae=L(ie,2),oe=L(ae,4);$(F(oe),{name:`upload`,size:13,strokeWidth:2}),Ne(),A(oe),A(re);var se=L(re,2);$(F(se),{name:`plus`,size:13,strokeWidth:2.5}),Ne(),A(se),A(C);var ce=L(C,2),le=F(ce);A(ce);var ue=L(ce,2),de=F(ue),fe=F(de),pe=F(fe),me=F(pe),he=F(me);Vi(he),A(me);var ge=L(me),_e=F(ge);A(ge);var ve=L(ge,2),ye=F(ve);A(ve);var be=L(ve),xe=F(be);A(be),Ne(2),A(pe),A(fe);var Se=L(fe),Ce=F(Se),we=e=>{var t=Xr();X(I(t),0,()=>[,,,,,],Y,(e,t)=>{K(e,bu())}),K(e,t)},Te=e=>{K(e,xu())},Ee=e=>{var i=Xr();X(I(i),1,n,e=>e.id,(e,n)=>{var i=wu();let a;var o=F(i),s=F(o);Vi(s),A(o);var c=L(o),l=F(c),u=F(l,!0);A(l);var d=L(l,2),f=e=>{var t=Cu();X(t,5,()=>(V(n),H(()=>V(n).tags.slice(0,3))),Y,(e,t)=>{var n=Su(),r=F(n,!0);A(n),R(()=>q(r,V(t))),K(e,n)}),A(t),K(e,t)};J(d,e=>{V(n),H(()=>V(n).tags?.length)&&e(f)}),A(c);var p=L(c),m=F(p),h=F(m,!0);A(m),A(p);var _=L(p),v=F(_),b=F(v,!0);A(v),A(_);var x=L(_),S=F(x,!0);A(x);var C=L(x),w=F(C,!0);A(C);var T=L(C),E=F(T);$(F(E),{name:`edit-2`,size:13,strokeWidth:2}),A(E);var D=L(E,2);$(F(D),{name:`trash-2`,size:13,strokeWidth:2}),A(D),A(T),A(i),R((e,t,r)=>{a=Ai(i,1,`mem-row svelte-83aj9g`,null,a,e),Ui(s,t),q(u,(V(n),H(()=>V(n).title))),Ai(m,1,`type-chip type-${(V(n),H(()=>V(n).type))??``}`,`svelte-83aj9g`),q(h,(U(mu),V(n),H(()=>mu[V(n).type]||V(n).type))),Mi(v,`display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:8px;font-size:0.75rem;font-weight:700;background:${(U(gu),V(n),H(()=>gu[V(n).importance]||gu[1]))??``};color:${(U(hu),V(n),H(()=>hu[V(n).importance]||hu[1]))??``};`),q(b,(V(n),H(()=>V(n).importance))),q(S,r),q(w,(V(n),H(()=>V(n).hit_count??0)))},[()=>({selected:r().has(V(n).id)}),()=>(r(),V(n),H(()=>r().has(V(n).id))),()=>(U(Tc),V(n),H(()=>Tc(V(n).updated_at)))]),W(`change`,s,()=>y.toggleSelect(V(n).id)),W(`click`,o,ea(function(e){ia.call(this,t,e)})),W(`click`,E,()=>g()(V(n))),W(`click`,D,e=>y.handleDeleteRow(V(n),e)),W(`click`,T,ea(function(e){ia.call(this,t,e)})),W(`click`,i,()=>g()(V(n))),K(e,i)}),K(e,i)};J(Ce,e=>{H(()=>y.loading)?e(we):(n(),H(()=>n().length===0)?e(Te,1):e(Ee,-1))}),A(Se),A(de),A(ue);var De=L(ue,2),Oe=e=>{var t=Eu(),n=F(t),r=F(n);A(n);var i=L(n,2),a=F(i),o=L(a,2),s=L(o,2);X(s,1,()=>(d(),f(),H(()=>Array.from({length:Math.min(5,d())},(e,t)=>Math.max(1,Math.min(f()-2,d()-4))+t))),Y,(e,t)=>{var n=Tu();let r;var i=F(n,!0);A(n),R(()=>{r=Ai(n,1,`btn btn-sm`,null,r,{"btn-primary":V(t)===f(),"btn-ghost":V(t)!==f()}),q(i,V(t))}),W(`click`,n,()=>y.goToPage(V(t))),K(e,n)});var c=L(s,2),l=L(c,2);A(i),A(t),R(()=>{q(r,`Page ${f()??``} of ${d()??``}`),a.disabled=f()<=1,o.disabled=f()<=1,c.disabled=f()>=d(),l.disabled=f()>=d()}),W(`click`,a,()=>y.goToPage(1)),W(`click`,o,()=>y.goToPage(f()-1)),W(`click`,c,()=>y.goToPage(f()+1)),W(`click`,l,()=>y.goToPage(d())),K(e,t)};J(De,e=>{d()>1&&e(Oe)});var ke=L(De,2),O=e=>{var t=Du(),n=F(t),i=F(n),a=F(i,!0);A(i),Ne(),A(n);var o=L(n,4),s=L(o,2),c=L(s,2);A(t),R(()=>q(a,(r(),H(()=>r().size)))),W(`click`,o,()=>Aa.set(new Set)),W(`click`,s,()=>y.handleBulkArchive()),W(`click`,c,()=>y.handleBulkDelete()),K(e,t)};J(ke,e=>{r(),H(()=>r().size>0)&&e(O)}),A(S),R(()=>{q(le,`${c()??``} memories
68
68
  ${(r(),H(()=>r().size>0?`· ${r().size} selected`:``))??``}`),Ui(he,V(h)),q(_e,`Title ${l()===`title`?u()===`desc`?`↓`:`↑`:``}`),q(ye,`Imp. ${l()===`importance`?u()===`desc`?`↓`:`↑`:``}`),q(xe,`Updated ${l()===`updated_at`?u()===`desc`?`↓`:`↑`:``}`)}),Ji(T,i,e=>dt(wa,e)),W(`input`,T,()=>y.onSearchInput()),Fi(E,a,e=>dt(Ta,e)),W(`change`,E,()=>y.onFilterChange()),Fi(ee,o,e=>dt(Ea,e)),W(`change`,ee,()=>y.onFilterChange()),Fi(ne,s,e=>dt(Ca,e)),W(`change`,ne,()=>{Sa.set(1),y.loadMemories()}),W(`click`,ie,()=>y.handleExport(`json`)),W(`click`,ae,()=>y.handleExport(`csv`)),W(`click`,oe,function(...e){v()?.apply(this,e)}),W(`click`,se,function(...e){_()?.apply(this,e)}),W(`change`,he,()=>y.toggleSelectAll()),W(`click`,ge,()=>y.toggleSort(`title`)),W(`click`,ve,()=>y.toggleSort(`importance`)),W(`click`,be,()=>y.toggleSort(`updated_at`)),K(e,S),Zi(t,`refresh`,b);var Ae=Ge(x);return m(),Ae}function Au(e){let t=j({expandedResponses:new Set,isLoadingMore:!1,hasReachedStart:!1}),{subscribe:n,update:r}=t,i={search:{icon:`search`,label:`Search`,gradient:`linear-gradient(135deg,#3b82f6,#2563eb)`,color:`#3b82f6`,bgAlpha:`rgba(59,130,246,0.12)`},read:{icon:`book-open`,label:`Read`,gradient:`linear-gradient(135deg,#10b981,#059669)`,color:`#10b981`,bgAlpha:`rgba(16,185,129,0.12)`},write:{icon:`edit`,label:`Created`,gradient:`linear-gradient(135deg,#6366f1,#4f46e5)`,color:`#6366f1`,bgAlpha:`rgba(99,102,241,0.12)`},update:{icon:`refresh-cw`,label:`Updated`,gradient:`linear-gradient(135deg,#f59e0b,#d97706)`,color:`#f59e0b`,bgAlpha:`rgba(245,158,11,0.12)`},delete:{icon:`trash`,label:`Deleted`,gradient:`linear-gradient(135deg,#ef4444,#dc2626)`,color:`#ef4444`,bgAlpha:`rgba(239,68,68,0.12)`},agent_handoff:{icon:`bot`,label:`Handoff`,gradient:`linear-gradient(135deg,#0ea5e9,#6366f1)`,color:`#0ea5e9`,bgAlpha:`rgba(14,165,233,0.12)`},agent_registered:{icon:`sparkle`,label:`Registered`,gradient:`linear-gradient(135deg,#a855f7,#6366f1)`,color:`#a855f7`,bgAlpha:`rgba(168,85,247,0.12)`},list:{icon:`list`,label:`List`,gradient:`linear-gradient(135deg,#64748b,#475569)`,color:`#64748b`,bgAlpha:`rgba(100,116,139,0.12)`}};function a(e){return i[e]??{icon:`activity`,label:e,gradient:`linear-gradient(135deg,#64748b,#475569)`,color:`#64748b`,bgAlpha:`rgba(100,116,139,0.12)`}}function o(e){if(e.action===`search`)return{main:e.query?`"${e.query}"`:`Query`,sub:e.result_count==null?`Searching memories...`:`${e.result_count} result${e.result_count===1?``:`s`} found`};if(e.task_id){let t={write:`Created`,update:`Updated`,delete:`Deleted`};return{main:e.task_title||e.task_code||e.task_id.substring(0,8),sub:e.task_code?`${t[e.action]||e.action} Task · ${e.task_code}`:(t[e.action]||e.action)+` Task`}}let t={write:`Stored`,update:`Updated`,delete:`Deleted`,read:`Read`,agent_handoff:`Handoff`,agent_registered:`Registered`},n=e.memory_type?`[${e.memory_type}]`:``;return{main:e.memory_title||(e.memory_id?e.memory_id.substring(0,8)+`…`:`—`),sub:[t[e.action]||e.action,n].filter(Boolean).join(` `)}}function s(e){if(!e)return{text:``,isLong:!1};let t=e;try{let n=typeof e==`string`?JSON.parse(e):e;if(n.content&&Array.isArray(n.content))t=n.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
69
69
  `);else if(Array.isArray(n))if(n.length===0)t=`No items found.`;else{let e=n[0],r=e.task_code||e.task_id,i=e.memory_id||e.memory_type,a=r?`task`:i?`memory`:`item`;t=`Found ${n.length} ${a}${n.length>1?`s`:``}:\n`+n.slice(0,5).map(e=>`- ${e.title||e.task_code||e.name||e.id||`Untitled`}`).join(`
70
70
  `)+(n.length>5?`\n... and ${n.length-5} more`:``)}else if(n.tasks&&Array.isArray(n.tasks))t=`Found ${n.tasks.length} tasks:\n`+n.tasks.slice(0,5).map(e=>`- [${e.task_code}] ${e.title}`).join(`
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
10
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
11
- <script type="module" crossorigin src="/assets/index-CUNSfwmD.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-BrV31hFu.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-C8FB4maW.css">
13
13
  </head>
14
14
  <body>
@@ -30,7 +30,7 @@ You are **STRICTLY FORBIDDEN** from performing any of the following actions:
30
30
  * Read code and analyze context
31
31
  * Create tasks via `local-memory-mcp` MCP tools `task-create`
32
32
  * Record decisions via `local-memory-mcp` MCP tools `memory-store`
33
- * List tasks via `local-memory-mcp` MCP tools `task-list`
33
+ * List tasks via `local-memory-mcp` MCP tools `task-active` (navigation) or `task-list` (extended search)
34
34
  * Search memory via `local-memory-mcp` MCP tools `memory-search`
35
35
 
36
36
  ---
@@ -40,6 +40,7 @@ You are **STRICTLY FORBIDDEN** from performing any of the following actions:
40
40
  Your output MUST ONLY consist of calls to:
41
41
  * `local-memory-mcp` MCP tools `task-create`
42
42
  * `local-memory-mcp` MCP tools `memory-store`
43
+ * `local-memory-mcp` MCP tools `task-active`
43
44
  * `local-memory-mcp` MCP tools `task-list`
44
45
  * `local-memory-mcp` MCP tools `memory-search`
45
46
 
@@ -54,7 +55,7 @@ Your output MUST ONLY consist of calls to:
54
55
 
55
56
  Before creating tasks, you MUST:
56
57
  1. **Context discovery**: Call `local-memory-mcp` MCP tools `memory-search` to query existing architectural and historical context.
57
- 2. **Sync backlog**: Call `local-memory-mcp` MCP tools `task-list` to check existing tasks. **CRITICAL: Do NOT create a new task if a similar, redundant task already exists in `backlog` or `pending` status. If your new findings are distinct but related to an existing task, link them using `parent_id` or `depends_on` instead of creating an isolated task.**
58
+ 2. **Sync backlog**: Call `local-memory-mcp` MCP tools `task-active` first (returns compact table of active tasks). Then call `task-list` if you need to check backlog or completed tasks. **CRITICAL: Do NOT create a new task if a similar, redundant task already exists in `backlog` or `pending` status. If your new findings are distinct but related to an existing task, link them using `parent_id` or `depends_on` instead of creating an isolated task.**
58
59
 
59
60
  ---
60
61
 
@@ -6,19 +6,24 @@ agent: Project Manager
6
6
  ---
7
7
  Guidelines for Task Management:
8
8
 
9
- 1. task-manage:
10
- - Use 'create' to break down complex user requests into actionable steps at the start of a session.
11
- - Use 'phase' to group tasks (e.g., 'research', 'implementation', 'testing').
12
- - Use 'priority' (1-5) to highlight critical path items.
13
- - Use 'update' to mark progress (in_progress, completed, blocked).
14
- - Use 'metadata' to store technical debt notes or implementation details.
9
+ 1. task-active (PRIMARY NAVIGATION — USE FIRST):
10
+ - MANDATORY: Always call `local-memory-mcp` MCP tools `task-active` at the very start of a new session.
11
+ - Returns a compact table: columns = [id, title, status, priority]. Rows are pointers — NOT full tasks.
12
+ - Default behavior: returns `in_progress` tasks; auto-falls back to `pending` if none exist.
13
+ - Filter by status via the `status` param: `"in_progress"` or `"pending"` only.
14
+ - After selecting a task from the table, fetch its full context via `task://<id>`.
15
+ - DO NOT call task-active in a loop. Call it ONCE per session to navigate.
16
+ - DO NOT work on multiple tasks simultaneously.
15
17
 
16
- 2. Resource & Tool Usage:
17
- - MANDATORY: Always call `local-memory-mcp` MCP tools `task-list` at the very start of a new session to understand current progress and avoid duplicating work.
18
- - Resource: You can also read 'tasks://current' for a filtered view of active tasks for the current repository.
18
+ 2. task-list (SECONDARY USE ONLY WHEN NEEDED):
19
+ - Use `local-memory-mcp` MCP tools `task-list` ONLY for broader queries (completed, backlog, search, pagination).
20
+ - Do NOT use task-list as a replacement for task-active at session start.
19
21
  - Coordinate: If a task is already 'in_progress', do not attempt to work on it unless specifically asked to collaborate.
20
22
 
21
- 3. Workflow Integration:
22
- - Plan first: Create tasks for the entire lifecycle (Research -> Strategy -> Execution -> Validation).
23
- - Atomic Updates: Update the task status to 'in_progress' EXACTLY ONCE when you begin working on a task. Do NOT repeatedly update it to 'in_progress' before every tool call.
24
- - Finalize: Only mark a task as 'completed' after successful validation (tests passed). If validation fails, do NOT immediately mark it as 'blocked' or 'pending'. You MUST iterate and fix the issues while keeping the task 'in_progress'. Only mark as 'blocked' if there is a hard dependency issue that completely prevents further progress.
23
+ 3. Resource:
24
+ - You can also read `tasks://current` for a filtered view of active tasks for the current repository.
25
+
26
+ 4. Workflow Integration:
27
+ - Plan first: Create tasks for the entire lifecycle (Research → Strategy → Execution → Validation).
28
+ - Atomic Updates: Update the task status to 'in_progress' EXACTLY ONCE when you begin working on a task.
29
+ - Finalize: Only mark a task as 'completed' after successful validation (tests passed). If validation fails, iterate and fix while keeping the task 'in_progress'. Only mark as 'blocked' if there is a hard dependency issue.
@@ -19,9 +19,13 @@ description: Execute all pending tasks for the current repository
19
19
  Please follow this strict execution flow:
20
20
 
21
21
  1. **Identify Repository**: Determine the current repository name (e.g., from git config or workspace context).
22
- 2. **Fetch Tasks**: Call `local-memory-mcp` MCP tools `task-list` for the identified repository for statuses 'pending' and 'in_progress'.
23
- 3. **Filter Stale**: Identify 'in_progress' tasks that are **stale** (stale is defined as > 30 Minutes without update, often because an agent stopped or crashed).
22
+ 2. **Fetch Active Tasks**: Call `local-memory-mcp` MCP tools `task-active` for the identified repository.
23
+ - This returns a compact table: `columns = [id, title, status, priority]`, `rows` = task pointers.
24
+ - Default: returns `in_progress` tasks first; falls back to `pending` if none exist.
25
+ - DO NOT call task-active in a loop. Call it ONCE.
26
+ 3. **Filter Stale**: From the in_progress rows, identify tasks that are **stale** (stale = no update for > 30 minutes, often because an agent stopped or crashed). Fetch their full data via `task://<id>` to inspect timestamps.
24
27
  4. **Task Execution Loop**: You MUST process tasks EXACTLY ONE AT A TIME (STRICT). You are STRICTLY FORBIDDEN from spinning up parallel sub-agents or using parallel execution. For each task you select:
28
+ - **Hydrate**: Fetch full task context via `task://<id>` resource before starting work.
25
29
  - **Start**: Call `local-memory-mcp` MCP tools `task-update` to set status='in_progress' for this task ONLY. Provide current agent/role information in the metadata.
26
30
  - **Execute**: Perform the work described in the task title and description.
27
31
  - **Inspect Codebase Logic & Documentation First (MANDATORY)**: Before marking anything done, inspect the relevant code paths, call sites, configs, tests, and affected modules in the repository. Also read the relevant documentation, as it might need to be updated or fixed. Do not infer correctness from file presence alone.
@@ -31,8 +35,8 @@ Please follow this strict execution flow:
31
35
  - **Retrospective**: Invoke the `learning-retrospective` skill. If the skill is unavailable, use the `learning-retrospective` prompt from `local-memory-mcp` to extract and store durable knowledge (mistakes, decisions, patterns) from this task.
32
36
  - **Commit**: Perform an atomic git commit and push for the changes made in the task.
33
37
  - **Handoff**: Use `local-memory-mcp` MCP tools `task-update` to document **detailed fix steps**, milestones, project-specific knowledge gained during execution, and validation evidence. If complex, decompose into smaller tasks using `local-memory-mcp` MCP tools `task-create`.
34
- - **Next**: Repeat this loop for the next 'pending' or 'stale' task.
35
- 5. **Backlog Migration**: Once all 'pending' and 'in_progress' tasks are completed or blocked, fetch tasks with status='backlog'. If any exist, select up to 20 tasks (prioritizing by priority field) and update their status to 'pending' using `local-memory-mcp` MCP tools `task-update` to ensure the next agent has work ready.
38
+ - **Next**: Call `task-active` once more to get the next actionable task and repeat this loop.
39
+ 5. **Backlog Migration**: Once all 'pending' and 'in_progress' tasks are completed or blocked, call `local-memory-mcp` MCP tools `task-list` with status='backlog'. If any exist, select up to 20 tasks (prioritizing by priority field) and update their status to 'pending' using `local-memory-mcp` MCP tools `task-update` to ensure the next agent has work ready.
36
40
  6. **Report**: After processing all tasks, provide a summary of your progress.
37
41
 
38
42
  ## Mandatory Validation Rules
@@ -4,7 +4,10 @@ export declare const PROMPTS: Record<string, any>;
4
4
  /**
5
5
  * Handles MCP 'prompts/list'
6
6
  */
7
- export declare function listPrompts(db: SQLiteStore, session?: SessionContext, params?: any): Promise<{
7
+ export declare function listPrompts(db: SQLiteStore, session?: SessionContext, params?: {
8
+ cursor?: string;
9
+ limit?: number;
10
+ }): Promise<{
8
11
  prompts: {
9
12
  name: any;
10
13
  description: any;
@@ -13,6 +16,7 @@ export declare function listPrompts(db: SQLiteStore, session?: SessionContext, p
13
16
  agent: any;
14
17
  } | undefined;
15
18
  }[];
19
+ nextCursor: string | undefined;
16
20
  }>;
17
21
  /**
18
22
  * Handles MCP 'prompts/get'