openwolf-enhanced 1.22.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +22 -2
  3. package/dist/dashboard/assets/{AISuggestions-Cpup2r93.js → AISuggestions-CxUalxra.js} +1 -1
  4. package/dist/dashboard/assets/{ActivityLog-vc08HmGa.js → ActivityLog-DYmmCNbe.js} +1 -1
  5. package/dist/dashboard/assets/{ActivityTimeline-fatU3zUR.js → ActivityTimeline-ROR1OtgM.js} +1 -1
  6. package/dist/dashboard/assets/{AnatomyBrowser-CMsbTK8b.js → AnatomyBrowser-ia3I9Nxd.js} +1 -1
  7. package/dist/dashboard/assets/{BugLog-s5Pex7fA.js → BugLog-ChMhMpQ_.js} +1 -1
  8. package/dist/dashboard/assets/{CerebrumViewer-D5i0Yd88.js → CerebrumViewer-CNi1v636.js} +1 -1
  9. package/dist/dashboard/assets/{CronStatus-3S4D9sES.js → CronStatus-CLg98w_6.js} +1 -1
  10. package/dist/dashboard/assets/{DesignQC-CeR_JqlS.js → DesignQC-XRxnlPnF.js} +1 -1
  11. package/dist/dashboard/assets/{LinkGraph-BTiwJzrc.js → LinkGraph-_m7MFyVJ.js} +1 -1
  12. package/dist/dashboard/assets/{MemoryViewer-QOXI9jv8.js → MemoryViewer-eP7iW-aq.js} +1 -1
  13. package/dist/dashboard/assets/{NativeMemory-CoSRp5Q2.js → NativeMemory-CnEsnOyW.js} +1 -1
  14. package/dist/dashboard/assets/{ProjectOverview-G0xzHTJm.js → ProjectOverview-CMZSTm1v.js} +1 -1
  15. package/dist/dashboard/assets/{ProjectsAggregate-BGn850vY.js → ProjectsAggregate-DJZyw66S.js} +1 -1
  16. package/dist/dashboard/assets/{StatusBadge-DxWVdzKK.js → StatusBadge-Du4IbMH3.js} +1 -1
  17. package/dist/dashboard/assets/{TokenUsage-BTTrcgDP.js → TokenUsage-6jPFUeu_.js} +1 -1
  18. package/dist/dashboard/assets/{index-CCxQQi4q.js → index-DQE5H-ct.js} +3 -3
  19. package/dist/dashboard/index.html +1 -1
  20. package/dist/src/cli/distill-cmd.js +57 -0
  21. package/dist/src/cli/distill-cmd.js.map +1 -0
  22. package/dist/src/cli/index.js +20 -0
  23. package/dist/src/cli/index.js.map +1 -1
  24. package/dist/src/cli/lint-cmd.js +83 -0
  25. package/dist/src/cli/lint-cmd.js.map +1 -0
  26. package/dist/src/cli/recall-cmd.js +27 -11
  27. package/dist/src/cli/recall-cmd.js.map +1 -1
  28. package/dist/src/utils/distill.js +104 -0
  29. package/dist/src/utils/distill.js.map +1 -0
  30. package/dist/src/utils/kb-lint.js +289 -0
  31. package/dist/src/utils/kb-lint.js.map +1 -0
  32. package/dist/src/utils/link-graph.js +10 -0
  33. package/dist/src/utils/link-graph.js.map +1 -1
  34. package/dist/src/utils/semantic-recall.js +63 -0
  35. package/dist/src/utils/semantic-recall.js.map +1 -1
  36. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,63 @@ This is a fork of [OpenWolf](https://github.com/cytostack/openwolf) by Cytostack
6
6
  Pvt Ltd. Versions ≤ 1.0.4 refer to the upstream project; `1.1.0` is the first
7
7
  release of this fork.
8
8
 
9
+ ## [1.23.0] — 2026-08-20
10
+
11
+ Prompted by a side-by-side comparison against a hand-curated, cross-project agent knowledge tree.
12
+ Two of its criticisms were fair and are addressed here: the knowledge base had no lifecycle and
13
+ nothing ever checked it, and the strongest retrieval stopped at the repository boundary.
14
+
15
+ ### Added
16
+
17
+ - ✅ **`openwolf lint`** — checks the knowledge base against the protocol it promises: the four
18
+ cerebrum sections, dated Do-Not-Repeat entries, buglog records carrying `root_cause` and `fix`,
19
+ references that resolve. Reports an **item-weighted** compliance percentage (weighting by rule
20
+ would make the number swing with the count of rules rather than the state of the corpus), and
21
+ says plainly what it cannot see. `--strict` turns warnings into a non-zero exit for pre-commit
22
+ and CI; `--json` for tooling; `--skip-links` skips the slow part.
23
+
24
+ This replaces a guess. The README used to state adherence as "~85–90%" — a number nobody had
25
+ ever measured. On this project's own year-old knowledge base `lint` reads **86.7%** across 1,612
26
+ checkable items. The proximity is a coincidence, not a vindication.
27
+
28
+ Its first run found **8 duplicate bug ids** in a 234-entry buglog: three separate batches had
29
+ restarted numbering, so `openwolf bug <id>` answers with whichever record comes first and the
30
+ other is unreachable.
31
+
32
+ - 🧪 **`openwolf distill`** — files a drifted `cerebrum.md` back under its four sections. Measured
33
+ before building it: a 126-line project still matched the template exactly, while a year-old one
34
+ had grown to 1,006 lines and 52 headings, 44 of them dated one-offs, with 47% of the file past
35
+ the last section the template knows — including a literal `## Do-Not-Repeat (Forts.)`. Structure
36
+ erodes with age, not at birth, because nothing ever objected.
37
+
38
+ It **moves text and never rewrites it**, splitting at heading level 3 (where the drift actually
39
+ put the classification) and proving the result is lossless before writing — refusing entirely if
40
+ a single content line would change. Deliberately not an LLM pass: this project already logged the
41
+ opposite as a critical bug, when a scheduled AI task overwrote a file it had only seen part of.
42
+
43
+ - ⏳ **Entry maturity** — content-addressed ids make "how long has this been true?" answerable, so
44
+ settled knowledge stops looking as provisional as yesterday's note. The run that creates the
45
+ baseline says so instead of reporting "0 settled" as though it were a finding.
46
+
47
+ - 🌍 **`recall --semantic --all` / `--hybrid --all`** — semantic search across every registered
48
+ project, which previously fell back to keyword search with a one-line note. Two constraints
49
+ shaped it: it never builds an index behind your back (projects without one are skipped **and
50
+ named**, so "absent from the results" cannot silently mean "never searched"), and it does not
51
+ invent a common ranking — per-project lists are fused by rank (RRF), because cosine similarities
52
+ from separately built indexes share a scale but not a distribution.
53
+
54
+ ### Fixed
55
+
56
+ - 🔗 **The link graph reported live bug ids as dead links.** `[[bug-209]]`-style references resolve
57
+ now: buglog records had block ids but no address of their own, so 4 of the first run's 10
58
+ dangling links pointed at bugs that exist. A checker whose false positives point at the checker
59
+ is worse than no checker.
60
+ - 🩺 **`recall --all` conflated "no index" with "search failed."** The first run reported five
61
+ projects "skipped without an embeddings index" — one of which had a 24,855-entry index and had
62
+ merely failed to reach the endpoint. Failures are now listed separately, with their reason.
63
+ - 🔇 **`lint` on a directory without `.wolf` printed "nothing checkable" and "everything holds"**
64
+ in the same breath.
65
+
9
66
  ## [1.22.0] — 2026-08-20
10
67
 
11
68
  **Contains a privacy fix. If you run the background daemon with an API key exported, read the
package/README.md CHANGED
@@ -84,7 +84,15 @@ Everything upstream does, plus the following. Details for each live in the
84
84
  | 🔎 **`openwolf find`** | Symbol and file lookup from the existing index — with exact line ranges, so you read one function instead of the file. Also `--json` and the MCP tool `openwolf_find`. |
85
85
  | 🧭 **Import-graph importance** | Ties break on PageRank over your own imports, stored as a rank percentile. The biggest file is rarely the most important one. |
86
86
  | 🌳 **tree-sitter ranges** *(optional)* | Real symbol boundaries from the syntax tree instead of "the line before the next one" — which was wrong for 97 % of symbols. Optional dependency; falls back cleanly and says why. |
87
- | 🧠 **Searchable memory** | `recall <query>` over STATUS / cerebrum / memory / buglog **and** Claude's native Auto Memory, BM25-ranked, each hit with a stable citation id. `--semantic` ranks by meaning via local embeddings; `--hybrid` fuses both. |
87
+ | 🧠 **Searchable memory** | `recall <query>` over STATUS / cerebrum / memory / buglog **and** Claude's native Auto Memory, BM25-ranked, each hit with a stable citation id. `--semantic` ranks by meaning via local embeddings; `--hybrid` fuses both. `--all` extends either across every registered project — fusing the per-project lists by rank, skipping (and naming) projects without an index rather than quietly building one. |
88
+
89
+ **Keeping it honest**
90
+
91
+ | | |
92
+ |---|---|
93
+ | ✅ **`openwolf lint`** | Checks the knowledge base against the protocol it promises — the four sections, dated Do-Not-Repeat entries, buglog records carrying `root_cause` and `fix`, references that resolve — and prints an item-weighted compliance percentage. Exit code for pre-commit and CI (`--strict`). On its first run here it found 8 duplicate bug ids, each making one of two records unreachable. |
94
+ | 🧪 **`openwolf distill`** | A cerebrum that grew for a year drifts: 52 headings, 47 % of the file past the last section the template knows. This files it back under the four — **moving text, never rewriting it**, and refusing to write at all if a single content line would change. |
95
+ | ⏳ **Entry maturity** | Content-addressed ids make "how long has this been true?" answerable, so settled knowledge stops looking as provisional as yesterday's note. |
88
96
 
89
97
  **Knowing what it costs**
90
98
 
@@ -266,8 +274,12 @@ openwolf init Initialize .wolf/ and register hooks
266
274
  openwolf status Show health, stats, .wolf/ footprint, size warnings
267
275
  openwolf doctor Report + compact .wolf/, suggest .wolfignore [--dry-run]
268
276
  openwolf consolidate LLM-merge near-duplicate cerebrum entries [--dry-run] [--threshold N]
277
+ openwolf lint Check the knowledge base against the protocol; prints a measured
278
+ compliance number [--strict] [--json] [--skip-links]
279
+ openwolf distill File a drifted cerebrum.md back under its four sections [--dry-run]
269
280
  openwolf recall <query> Keyword-search .wolf + native memory; ids per hit [--limit N] [--full] [--all] [--json]
270
281
  [--semantic] rank by meaning (local embeddings) · [--hybrid] fuse keyword + semantic
282
+ both work with [--all]: rank-fused across projects that already have an index
271
283
  openwolf recall --id <id> Expand a citation id to its full entry (second disclosure layer)
272
284
  openwolf find <query> Locate a symbol or file — ranked, with exact line ranges [--limit N] [--json]
273
285
  openwolf link Link to a remote workspace [--url URL --token TOKEN] [--status] [--unlink]
@@ -386,7 +398,15 @@ No. Hooks are small Node scripts with short timeouts; they update the index and
386
398
 
387
399
  - Claude Code hooks are a relatively new feature. OpenWolf falls back to `CLAUDE.md` instructions when hooks don't fire.
388
400
  - Token tracking is estimation-based (character-to-token ratio), not exact API counts. Accurate to within ~15%.
389
- - `cerebrum.md` depends on Claude following instructions to update it after corrections. Compliance is ~85–90%, not 100%.
401
+ - `cerebrum.md` depends on Claude following instructions to update it after corrections, so it drifts.
402
+ Run `openwolf lint` for a measured number instead of a guess: it checks the conventions that are
403
+ mechanically checkable (the four sections, dated Do-Not-Repeat entries, buglog records that carry
404
+ `root_cause` and `fix`, references that resolve) and reports an item-weighted percentage. On this
405
+ project's own year-old knowledge base it reads **86.7%**. What it cannot see is whether the right
406
+ thing was learned — that stays unmeasurable, and the output says so.
407
+ - Structure erodes with age rather than at birth: a young project still matched the template exactly
408
+ while a year-old one had grown to 52 headings with 47% of the file past the last section the
409
+ template knows. `openwolf distill` files it back — moving text and never rewriting it.
390
410
 
391
411
  ## Credits
392
412
 
@@ -1,4 +1,4 @@
1
- import{a as e,c as t,r as n}from"./index-CCxQQi4q.js";import{i as r}from"./utils-BqE_aDxV.js";var i=t(e(),1),a=n(),o=new Set(`ts.tsx.js.jsx.mjs.cjs.py.rs.go.java.rb.php.cs.cpp.cc.c.h.hpp.swift.kt.vue.svelte.json.md.mdx.yml.yaml.toml.css.scss.html.sh.sql.prisma.graphql`.split(`.`)),s=/([A-Za-z0-9_.\-/]+\.[A-Za-z][A-Za-z0-9]{0,7})/g;function c(e,t){if(!t)return e;let n=[],r=0,i;for(s.lastIndex=0;(i=s.exec(e))!==null;){let s=i[1],c=s.slice(s.lastIndexOf(`.`)+1).toLowerCase();(s.includes(`/`)||o.has(c))&&(i.index>r&&n.push(e.slice(r,i.index)),n.push((0,a.jsx)(`button`,{onClick:()=>t(s),className:`font-mono underline decoration-dotted underline-offset-2`,style:{color:`var(--accent)`},title:`Jump to ${s} in Anatomy`,children:s},`${i.index}-${s}`)),r=i.index+s.length)}return r<e.length&&n.push(e.slice(r)),n.length?n:e}var l=[{key:`achievements`,title:`Achievements`,icon:`🏆`,color:`#059669`},{key:`improvements`,title:`Improvements`,icon:`✨`,color:`#3b82f6`},{key:`next_tasks`,title:`Next Tasks`,icon:`📋`,color:`#d97706`},{key:`risks`,title:`Risks & Tech Debt`,icon:`🛡`,color:`#dc2626`}],u=`Analyze this project and write a JSON file to .wolf/suggestions.json with this exact structure:
1
+ import{a as e,c as t,r as n}from"./index-DQE5H-ct.js";import{i as r}from"./utils-BqE_aDxV.js";var i=t(e(),1),a=n(),o=new Set(`ts.tsx.js.jsx.mjs.cjs.py.rs.go.java.rb.php.cs.cpp.cc.c.h.hpp.swift.kt.vue.svelte.json.md.mdx.yml.yaml.toml.css.scss.html.sh.sql.prisma.graphql`.split(`.`)),s=/([A-Za-z0-9_.\-/]+\.[A-Za-z][A-Za-z0-9]{0,7})/g;function c(e,t){if(!t)return e;let n=[],r=0,i;for(s.lastIndex=0;(i=s.exec(e))!==null;){let s=i[1],c=s.slice(s.lastIndexOf(`.`)+1).toLowerCase();(s.includes(`/`)||o.has(c))&&(i.index>r&&n.push(e.slice(r,i.index)),n.push((0,a.jsx)(`button`,{onClick:()=>t(s),className:`font-mono underline decoration-dotted underline-offset-2`,style:{color:`var(--accent)`},title:`Jump to ${s} in Anatomy`,children:s},`${i.index}-${s}`)),r=i.index+s.length)}return r<e.length&&n.push(e.slice(r)),n.length?n:e}var l=[{key:`achievements`,title:`Achievements`,icon:`🏆`,color:`#059669`},{key:`improvements`,title:`Improvements`,icon:`✨`,color:`#3b82f6`},{key:`next_tasks`,title:`Next Tasks`,icon:`📋`,color:`#d97706`},{key:`risks`,title:`Risks & Tech Debt`,icon:`🛡`,color:`#dc2626`}],u=`Analyze this project and write a JSON file to .wolf/suggestions.json with this exact structure:
2
2
  {
3
3
  "generated_at": "<ISO timestamp>",
4
4
  "achievements": ["..."],
@@ -1,2 +1,2 @@
1
- import{a as e,c as t,r as n}from"./index-CCxQQi4q.js";var r=t(e(),1),i=n();function a(e){return e.split(`
1
+ import{a as e,c as t,r as n}from"./index-DQE5H-ct.js";var r=t(e(),1),i=n();function a(e){return e.split(`
2
2
  `).filter(e=>e.trim().length>0).map(e=>{let t=/ → error$/.test(e),n=e.replace(/ → error$/,``),r=n.match(/^(\d{1,2}:\d{2})\s+(.*)$/);return r?{time:r[1],cmd:r[2],failed:t}:{time:``,cmd:n,failed:t}}).reverse()}function o({label:e,value:t,accent:n}){return(0,i.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:e}),(0,i.jsx)(`p`,{className:`text-2xl font-bold mt-1`,style:{color:n?`var(--danger)`:`var(--text-primary)`},children:t})]})}function s({data:e}){let[t,n]=(0,r.useState)(``),[s,c]=(0,r.useState)(!1),l=(0,r.useMemo)(()=>a(e.activityLog||``),[e.activityLog]),u=l.filter(e=>e.failed).length,d=l.filter(e=>(!s||e.failed)&&(!t||e.cmd.toLowerCase().includes(t.toLowerCase())));if(l.length===0)return(0,i.jsxs)(`div`,{className:`rounded-xl p-6`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsx)(`h3`,{className:`font-medium mb-2`,style:{color:`var(--text-secondary)`},children:`No shell activity captured`}),(0,i.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:[`Passive Bash capture is `,(0,i.jsx)(`strong`,{children:`opt-in`}),`. Enable it in `,(0,i.jsx)(`code`,{className:`px-1 rounded text-xs`,style:{background:`var(--bg-base)`},children:`.wolf/config.json`}),` — set `,(0,i.jsx)(`code`,{className:`px-1 rounded text-xs`,style:{background:`var(--bg-base)`},children:`openwolf.capture.enabled = true`}),` — and notable commands (commits, installs, tests, builds) plus any failures land in `,(0,i.jsx)(`code`,{children:`.wolf/activity.log`}),`, redacted, and feed the next session's resume digest.`]})]});let f={color:`var(--text-secondary)`,padding:`0.5rem 0.75rem`,borderTop:`1px solid var(--border)`},p={color:`var(--text-muted)`,fontWeight:500,textAlign:`left`,padding:`0.5rem 0.75rem`};return(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 gap-4 mb-4`,children:[(0,i.jsx)(o,{label:`Captured commands`,value:String(l.length)}),(0,i.jsx)(o,{label:`Failures`,value:String(u),accent:u>0}),(0,i.jsx)(o,{label:`Showing`,value:String(d.length)})]}),(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 mb-3`,children:[(0,i.jsx)(`input`,{type:`text`,placeholder:`Filter commands…`,value:t,onChange:e=>n(e.target.value),className:`rounded-lg px-3 py-2 text-sm flex-1 min-w-[200px] focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}}),(0,i.jsx)(`button`,{onClick:()=>c(e=>!e),className:`px-3 py-2 text-xs rounded-lg transition-colors`,style:{background:s?`var(--danger-subtle)`:`var(--bg-surface)`,border:`1px solid var(--border)`,color:s?`var(--danger)`:`var(--text-muted)`},children:s?`Showing failures only`:`Failures only`})]}),(0,i.jsx)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:(0,i.jsx)(`div`,{className:`overflow-x-auto`,style:{maxHeight:520},children:(0,i.jsxs)(`table`,{className:`w-full text-sm`,style:{borderCollapse:`collapse`},children:[(0,i.jsx)(`thead`,{children:(0,i.jsxs)(`tr`,{children:[(0,i.jsx)(`th`,{style:{...p,width:64},children:`Time`}),(0,i.jsxs)(`th`,{style:p,children:[`Command (`,d.length,`)`]})]})}),(0,i.jsx)(`tbody`,{children:d.map((e,t)=>(0,i.jsxs)(`tr`,{style:{background:e.failed?`var(--danger-subtle)`:`transparent`},children:[(0,i.jsx)(`td`,{style:{...f,color:`var(--text-faint)`,whiteSpace:`nowrap`},children:e.time||`—`}),(0,i.jsxs)(`td`,{style:{...f,color:e.failed?`var(--danger)`:`var(--text-primary)`},className:`font-mono`,children:[e.cmd,e.failed&&(0,i.jsx)(`span`,{className:`text-xs ml-2`,style:{color:`var(--danger)`},children:`error`})]})]},t))})]})})}),(0,i.jsxs)(`p`,{className:`text-xs mt-3`,style:{color:`var(--text-faint)`},children:[`Secrets are redacted before capture; the newest commands feed the resume digest. Read-only view of `,(0,i.jsx)(`code`,{children:`.wolf/activity.log`}),`.`]})]})}export{s as ActivityLog};
@@ -1 +1 @@
1
- import{a as e,c as t,r as n}from"./index-CCxQQi4q.js";var r=t(e(),1),i=n();function a({data:e}){let{memory:t}=e,[n,a]=(0,r.useState)(`all`),[o,s]=(0,r.useState)(``),[c,l]=(0,r.useState)(!0),u=(0,r.useMemo)(()=>{let e=t;if(n===`today`){let t=new Date().toISOString().slice(0,10);e=e.filter(e=>e.date===t)}else if(n===`week`){let t=new Date(Date.now()-7*864e5).toISOString().slice(0,10);e=e.filter(e=>e.date>=t)}if(o){let t=o.toLowerCase();e=e.map(e=>({...e,entries:e.entries.filter(e=>e.action.toLowerCase().includes(t)||e.files.toLowerCase().includes(t))})).filter(e=>e.entries.length>0)}return e},[t,n,o]);return(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 mb-4`,children:[(0,i.jsx)(`div`,{className:`flex gap-1 rounded-lg p-1`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[`all`,`today`,`week`].map(e=>(0,i.jsx)(`button`,{onClick:()=>a(e),className:`px-3 py-1 text-xs rounded-md transition-colors`,style:{background:n===e?`var(--bg-surface-hover)`:`transparent`,color:n===e?`var(--text-primary)`:`var(--text-muted)`},children:e===`all`?`All`:e===`today`?`Today`:`This Week`},e))}),(0,i.jsx)(`input`,{type:`text`,placeholder:`Search actions...`,value:o,onChange:e=>s(e.target.value),className:`rounded-lg px-3 py-1.5 text-sm flex-1 min-w-[200px] focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}}),(0,i.jsx)(`button`,{onClick:()=>l(!c),className:`px-3 py-1.5 text-xs rounded-lg`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-muted)`},children:c?`Flat view`:`Group by session`})]}),u.length===0?(0,i.jsx)(`div`,{className:`text-center py-12`,style:{color:`var(--text-muted)`},children:`No activity found.`}):c?u.map((e,t)=>(0,i.jsxs)(`div`,{className:`mb-4`,children:[(0,i.jsxs)(`div`,{className:`text-sm font-medium mb-2`,style:{color:`var(--text-muted)`},children:[e.date,` `,e.time,` — `,e.entries.length,` actions`]}),(0,i.jsx)(`div`,{className:`rounded-xl`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:e.entries.map((t,n)=>(0,i.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3`,style:{borderBottom:n<e.entries.length-1?`1px solid var(--border)`:`none`},children:[(0,i.jsx)(`span`,{className:`text-xs font-mono w-12 shrink-0`,style:{color:`var(--text-faint)`},children:t.time}),(0,i.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0 ${t.action.includes(`Created`)?`bg-emerald-500`:t.action.includes(`Edited`)?`bg-blue-500`:``}`,style:{background:!t.action.includes(`Created`)&&!t.action.includes(`Edited`)?`var(--text-faint)`:void 0}}),(0,i.jsx)(`span`,{className:`text-sm flex-1`,style:{color:`var(--text-secondary)`},children:t.action}),(0,i.jsx)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:t.tokens})]},n))})]},t)):(0,i.jsx)(`div`,{className:`rounded-xl`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:u.flatMap(e=>e.entries.map((t,n)=>(0,i.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3`,style:{borderBottom:`1px solid var(--border)`},children:[(0,i.jsx)(`span`,{className:`text-xs font-mono w-20 shrink-0`,style:{color:`var(--text-faint)`},children:e.date}),(0,i.jsx)(`span`,{className:`text-xs font-mono w-12 shrink-0`,style:{color:`var(--text-faint)`},children:t.time}),(0,i.jsx)(`span`,{className:`text-sm flex-1`,style:{color:`var(--text-secondary)`},children:t.action}),(0,i.jsx)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:t.tokens})]},`${e.date}-${n}`)))})]})}export{a as ActivityTimeline};
1
+ import{a as e,c as t,r as n}from"./index-DQE5H-ct.js";var r=t(e(),1),i=n();function a({data:e}){let{memory:t}=e,[n,a]=(0,r.useState)(`all`),[o,s]=(0,r.useState)(``),[c,l]=(0,r.useState)(!0),u=(0,r.useMemo)(()=>{let e=t;if(n===`today`){let t=new Date().toISOString().slice(0,10);e=e.filter(e=>e.date===t)}else if(n===`week`){let t=new Date(Date.now()-7*864e5).toISOString().slice(0,10);e=e.filter(e=>e.date>=t)}if(o){let t=o.toLowerCase();e=e.map(e=>({...e,entries:e.entries.filter(e=>e.action.toLowerCase().includes(t)||e.files.toLowerCase().includes(t))})).filter(e=>e.entries.length>0)}return e},[t,n,o]);return(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 mb-4`,children:[(0,i.jsx)(`div`,{className:`flex gap-1 rounded-lg p-1`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[`all`,`today`,`week`].map(e=>(0,i.jsx)(`button`,{onClick:()=>a(e),className:`px-3 py-1 text-xs rounded-md transition-colors`,style:{background:n===e?`var(--bg-surface-hover)`:`transparent`,color:n===e?`var(--text-primary)`:`var(--text-muted)`},children:e===`all`?`All`:e===`today`?`Today`:`This Week`},e))}),(0,i.jsx)(`input`,{type:`text`,placeholder:`Search actions...`,value:o,onChange:e=>s(e.target.value),className:`rounded-lg px-3 py-1.5 text-sm flex-1 min-w-[200px] focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}}),(0,i.jsx)(`button`,{onClick:()=>l(!c),className:`px-3 py-1.5 text-xs rounded-lg`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-muted)`},children:c?`Flat view`:`Group by session`})]}),u.length===0?(0,i.jsx)(`div`,{className:`text-center py-12`,style:{color:`var(--text-muted)`},children:`No activity found.`}):c?u.map((e,t)=>(0,i.jsxs)(`div`,{className:`mb-4`,children:[(0,i.jsxs)(`div`,{className:`text-sm font-medium mb-2`,style:{color:`var(--text-muted)`},children:[e.date,` `,e.time,` — `,e.entries.length,` actions`]}),(0,i.jsx)(`div`,{className:`rounded-xl`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:e.entries.map((t,n)=>(0,i.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3`,style:{borderBottom:n<e.entries.length-1?`1px solid var(--border)`:`none`},children:[(0,i.jsx)(`span`,{className:`text-xs font-mono w-12 shrink-0`,style:{color:`var(--text-faint)`},children:t.time}),(0,i.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0 ${t.action.includes(`Created`)?`bg-emerald-500`:t.action.includes(`Edited`)?`bg-blue-500`:``}`,style:{background:!t.action.includes(`Created`)&&!t.action.includes(`Edited`)?`var(--text-faint)`:void 0}}),(0,i.jsx)(`span`,{className:`text-sm flex-1`,style:{color:`var(--text-secondary)`},children:t.action}),(0,i.jsx)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:t.tokens})]},n))})]},t)):(0,i.jsx)(`div`,{className:`rounded-xl`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:u.flatMap(e=>e.entries.map((t,n)=>(0,i.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3`,style:{borderBottom:`1px solid var(--border)`},children:[(0,i.jsx)(`span`,{className:`text-xs font-mono w-20 shrink-0`,style:{color:`var(--text-faint)`},children:e.date}),(0,i.jsx)(`span`,{className:`text-xs font-mono w-12 shrink-0`,style:{color:`var(--text-faint)`},children:t.time}),(0,i.jsx)(`span`,{className:`text-sm flex-1`,style:{color:`var(--text-secondary)`},children:t.action}),(0,i.jsx)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:t.tokens})]},`${e.date}-${n}`)))})]})}export{a as ActivityTimeline};
@@ -1 +1 @@
1
- import{a as e,c as t,r as n}from"./index-CCxQQi4q.js";import{r,t as i}from"./utils-BqE_aDxV.js";var a=t(e(),1),o=n();function s({tokens:e,className:t}){return(0,o.jsxs)(`span`,{className:i(`font-mono text-xs`,e<200?`text-emerald-400`:e<1e3?`text-amber-400`:`text-red-400`,t),children:[`~`,r(e),` tok`]})}function c(e){let t={name:`.`,path:`.`,children:[],files:[]},n=new Map;n.set(`./`,t);for(let r of e){let e=r.section;if(!n.has(e)){let r=e.replace(/\/$/,``).split(`/`),i=t,a=``;for(let e of r){a=a?`${a}/${e}`:e;let t=`${a}/`;if(!n.has(t)){let r={name:e,path:t,children:[],files:[]};i.children.push(r),n.set(t,r)}i=n.get(t)}}n.get(e).files.push({file:r.file,description:r.description,tokens:r.tokens})}return t}function l({node:e,search:t,depth:n=0}){let[r,i]=(0,a.useState)(n<2),c=t.toLowerCase(),f=e.files.filter(e=>!t||e.file.toLowerCase().includes(c)||e.description.toLowerCase().includes(c)),p=e.children.some(e=>d(e,c));return t&&f.length===0&&!p?null:(0,o.jsxs)(`div`,{className:`ml-3`,children:[e.name!==`.`&&(0,o.jsxs)(`button`,{onClick:()=>i(!r),className:`flex items-center gap-1.5 py-1 text-sm transition-colors`,style:{color:`var(--text-secondary)`},children:[(0,o.jsx)(`span`,{className:`w-4 text-center`,style:{color:`var(--text-faint)`},children:r?`▼`:`▶`}),(0,o.jsx)(`span`,{className:`text-amber-400`,children:`📁`}),(0,o.jsxs)(`span`,{children:[e.name,`/`]}),(0,o.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[u(e),` files`]})]}),(r||e.name===`.`)&&(0,o.jsxs)(`div`,{className:e.name===`.`?``:`ml-4`,children:[f.sort((e,t)=>e.file.localeCompare(t.file)).map(e=>(0,o.jsxs)(`div`,{className:`flex items-center gap-2 py-1 pl-5`,children:[(0,o.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`📄`}),(0,o.jsx)(`span`,{className:`text-sm font-mono`,style:{color:`var(--text-primary)`},children:e.file}),e.description&&(0,o.jsxs)(`span`,{className:`text-xs truncate max-w-xs`,style:{color:`var(--text-faint)`},children:[`— `,e.description]}),(0,o.jsx)(s,{tokens:e.tokens,className:`ml-auto shrink-0`})]},e.file)),e.children.sort((e,t)=>e.name.localeCompare(t.name)).map(e=>(0,o.jsx)(l,{node:e,search:t,depth:n+1},e.path))]})]})}function u(e){return e.files.length+e.children.reduce((e,t)=>e+u(t),0)}function d(e,t){return e.files.some(e=>e.file.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))?!0:e.children.some(e=>d(e,t))}function f({data:e,initialFile:t}){let{anatomy:n}=e,[r,i]=(0,a.useState)(t??``),[s,u]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&i(t)},[t]);let d=(0,a.useMemo)(()=>c(n.entries),[n.entries]),f=(0,a.useMemo)(()=>{let e=n.entries.map(e=>e.tokens);return{total:n.entries.length,avg:e.length>0?Math.round(e.reduce((e,t)=>e+t,0)/e.length):0,largest:e.length>0?Math.max(...e):0}},[n.entries]);return(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 mb-4`,children:[(0,o.jsx)(`input`,{type:`text`,placeholder:`Search files...`,value:r,onChange:e=>i(e.target.value),className:`flex-1 min-w-[200px] rounded-lg px-3 py-2 text-sm focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}}),(0,o.jsx)(`button`,{onClick:()=>u(!s),className:`px-3 py-2 text-xs rounded-lg`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-muted)`},children:s?`Sort: Size`:`Sort: A-Z`})]}),(0,o.jsxs)(`div`,{className:`flex gap-4 mb-4 text-sm`,style:{color:`var(--text-muted)`},children:[(0,o.jsxs)(`span`,{children:[f.total,` files tracked`]}),(0,o.jsxs)(`span`,{children:[`Avg: `,f.avg,` tok/file`]}),(0,o.jsxs)(`span`,{children:[`Largest: `,f.largest,` tok`]})]}),(0,o.jsx)(`div`,{className:`rounded-xl p-4`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:n.entries.length===0?(0,o.jsxs)(`div`,{className:`text-center py-12`,style:{color:`var(--text-muted)`},children:[(0,o.jsx)(`p`,{className:`text-2xl mb-2`,children:`📂`}),(0,o.jsxs)(`p`,{children:[`No anatomy data. Run `,(0,o.jsx)(`code`,{style:{color:`var(--text-secondary)`},children:`openwolf scan`}),` to index your project.`]})]}):(0,o.jsx)(l,{node:d,search:r})})]})}export{f as AnatomyBrowser};
1
+ import{a as e,c as t,r as n}from"./index-DQE5H-ct.js";import{r,t as i}from"./utils-BqE_aDxV.js";var a=t(e(),1),o=n();function s({tokens:e,className:t}){return(0,o.jsxs)(`span`,{className:i(`font-mono text-xs`,e<200?`text-emerald-400`:e<1e3?`text-amber-400`:`text-red-400`,t),children:[`~`,r(e),` tok`]})}function c(e){let t={name:`.`,path:`.`,children:[],files:[]},n=new Map;n.set(`./`,t);for(let r of e){let e=r.section;if(!n.has(e)){let r=e.replace(/\/$/,``).split(`/`),i=t,a=``;for(let e of r){a=a?`${a}/${e}`:e;let t=`${a}/`;if(!n.has(t)){let r={name:e,path:t,children:[],files:[]};i.children.push(r),n.set(t,r)}i=n.get(t)}}n.get(e).files.push({file:r.file,description:r.description,tokens:r.tokens})}return t}function l({node:e,search:t,depth:n=0}){let[r,i]=(0,a.useState)(n<2),c=t.toLowerCase(),f=e.files.filter(e=>!t||e.file.toLowerCase().includes(c)||e.description.toLowerCase().includes(c)),p=e.children.some(e=>d(e,c));return t&&f.length===0&&!p?null:(0,o.jsxs)(`div`,{className:`ml-3`,children:[e.name!==`.`&&(0,o.jsxs)(`button`,{onClick:()=>i(!r),className:`flex items-center gap-1.5 py-1 text-sm transition-colors`,style:{color:`var(--text-secondary)`},children:[(0,o.jsx)(`span`,{className:`w-4 text-center`,style:{color:`var(--text-faint)`},children:r?`▼`:`▶`}),(0,o.jsx)(`span`,{className:`text-amber-400`,children:`📁`}),(0,o.jsxs)(`span`,{children:[e.name,`/`]}),(0,o.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[u(e),` files`]})]}),(r||e.name===`.`)&&(0,o.jsxs)(`div`,{className:e.name===`.`?``:`ml-4`,children:[f.sort((e,t)=>e.file.localeCompare(t.file)).map(e=>(0,o.jsxs)(`div`,{className:`flex items-center gap-2 py-1 pl-5`,children:[(0,o.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`📄`}),(0,o.jsx)(`span`,{className:`text-sm font-mono`,style:{color:`var(--text-primary)`},children:e.file}),e.description&&(0,o.jsxs)(`span`,{className:`text-xs truncate max-w-xs`,style:{color:`var(--text-faint)`},children:[`— `,e.description]}),(0,o.jsx)(s,{tokens:e.tokens,className:`ml-auto shrink-0`})]},e.file)),e.children.sort((e,t)=>e.name.localeCompare(t.name)).map(e=>(0,o.jsx)(l,{node:e,search:t,depth:n+1},e.path))]})]})}function u(e){return e.files.length+e.children.reduce((e,t)=>e+u(t),0)}function d(e,t){return e.files.some(e=>e.file.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))?!0:e.children.some(e=>d(e,t))}function f({data:e,initialFile:t}){let{anatomy:n}=e,[r,i]=(0,a.useState)(t??``),[s,u]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&i(t)},[t]);let d=(0,a.useMemo)(()=>c(n.entries),[n.entries]),f=(0,a.useMemo)(()=>{let e=n.entries.map(e=>e.tokens);return{total:n.entries.length,avg:e.length>0?Math.round(e.reduce((e,t)=>e+t,0)/e.length):0,largest:e.length>0?Math.max(...e):0}},[n.entries]);return(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 mb-4`,children:[(0,o.jsx)(`input`,{type:`text`,placeholder:`Search files...`,value:r,onChange:e=>i(e.target.value),className:`flex-1 min-w-[200px] rounded-lg px-3 py-2 text-sm focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}}),(0,o.jsx)(`button`,{onClick:()=>u(!s),className:`px-3 py-2 text-xs rounded-lg`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-muted)`},children:s?`Sort: Size`:`Sort: A-Z`})]}),(0,o.jsxs)(`div`,{className:`flex gap-4 mb-4 text-sm`,style:{color:`var(--text-muted)`},children:[(0,o.jsxs)(`span`,{children:[f.total,` files tracked`]}),(0,o.jsxs)(`span`,{children:[`Avg: `,f.avg,` tok/file`]}),(0,o.jsxs)(`span`,{children:[`Largest: `,f.largest,` tok`]})]}),(0,o.jsx)(`div`,{className:`rounded-xl p-4`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:n.entries.length===0?(0,o.jsxs)(`div`,{className:`text-center py-12`,style:{color:`var(--text-muted)`},children:[(0,o.jsx)(`p`,{className:`text-2xl mb-2`,children:`📂`}),(0,o.jsxs)(`p`,{children:[`No anatomy data. Run `,(0,o.jsx)(`code`,{style:{color:`var(--text-secondary)`},children:`openwolf scan`}),` to index your project.`]})]}):(0,o.jsx)(l,{node:d,search:r})})]})}export{f as AnatomyBrowser};
@@ -1 +1 @@
1
- import{a as e,c as t,r as n}from"./index-CCxQQi4q.js";var r=t(e(),1),i=n();function a({data:e}){let{buglog:t}=e,[n,a]=(0,r.useState)(``),[o,s]=(0,r.useState)(null),c=n?t.bugs.filter(e=>e.error_message.toLowerCase().includes(n.toLowerCase())||e.root_cause.toLowerCase().includes(n.toLowerCase())||e.fix.toLowerCase().includes(n.toLowerCase())||e.tags.some(e=>e.toLowerCase().includes(n.toLowerCase()))):t.bugs;if(t.bugs.length===0)return(0,i.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,i.jsx)(`div`,{className:`text-4xl mb-3`,children:`🐛`}),(0,i.jsx)(`h3`,{className:`font-medium mb-1`,style:{color:`var(--text-secondary)`},children:`No bugs logged yet`}),(0,i.jsx)(`p`,{className:`text-sm max-w-sm`,style:{color:`var(--text-muted)`},children:`When you encounter and fix bugs, they'll appear here for future reference.`})]});let l=t.bugs.flatMap(e=>e.tags),u=new Map;for(let e of l)u.set(e,(u.get(e)||0)+1);let d=[...u.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5);return(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 mb-4`,children:[(0,i.jsx)(`input`,{type:`text`,placeholder:`Search bugs...`,value:n,onChange:e=>a(e.target.value),className:`flex-1 min-w-[200px] rounded-lg px-3 py-2 text-sm focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}}),(0,i.jsxs)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:[t.bugs.length,` bugs logged`]})]}),d.length>0&&(0,i.jsx)(`div`,{className:`flex flex-wrap gap-2 mb-4`,children:d.map(([e,t])=>(0,i.jsxs)(`button`,{onClick:()=>a(e),className:`px-2 py-1 text-xs rounded-full`,style:{background:`var(--bg-surface-hover)`,border:`1px solid var(--border-subtle)`,color:`var(--text-muted)`},children:[e,` (`,t,`)`]},e))}),(0,i.jsx)(`div`,{className:`space-y-3`,children:c.map(e=>{let t=o===e.id;return(0,i.jsxs)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsxs)(`button`,{onClick:()=>s(t?null:e.id),className:`w-full flex items-start gap-3 px-5 py-3 transition-colors text-left`,onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsx)(`span`,{className:`text-sm mt-0.5`,style:{color:`var(--text-faint)`},children:t?`▼`:`▶`}),(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsx)(`p`,{className:`text-sm truncate`,style:{color:`var(--text-primary)`},children:e.error_message}),(0,i.jsxs)(`div`,{className:`flex items-center gap-3 mt-1`,children:[(0,i.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:e.file}),(0,i.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:e.timestamp?.slice(0,10)})]})]}),e.occurrences>1&&(0,i.jsxs)(`span`,{className:`shrink-0 px-2 py-0.5 rounded-full text-xs`,style:{background:`var(--warning-subtle)`,color:`var(--warning)`},children:[`Seen `,e.occurrences,`x`]})]}),t&&(0,i.jsxs)(`div`,{className:`px-5 py-4 space-y-3`,style:{borderTop:`1px solid var(--border)`},children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`p`,{className:`text-xs uppercase mb-1`,style:{color:`var(--text-faint)`},children:`Error Message`}),(0,i.jsx)(`pre`,{className:`text-sm rounded-lg p-3 overflow-x-auto font-mono`,style:{color:`var(--danger)`,background:`var(--danger-subtle)`},children:e.error_message})]}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`p`,{className:`text-xs uppercase mb-1`,style:{color:`var(--text-faint)`},children:`Root Cause`}),(0,i.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-secondary)`},children:e.root_cause})]}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`p`,{className:`text-xs uppercase mb-1`,style:{color:`var(--text-faint)`},children:`Fix`}),(0,i.jsx)(`pre`,{className:`text-sm rounded-lg p-3 overflow-x-auto font-mono`,style:{color:`var(--accent)`,background:`var(--accent-subtle)`},children:e.fix})]}),(0,i.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.tags.map(e=>(0,i.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full`,style:{background:`var(--bg-surface-hover)`,border:`1px solid var(--border-subtle)`,color:`var(--text-muted)`},children:e},e))})]})]},e.id)})})]})}export{a as BugLog};
1
+ import{a as e,c as t,r as n}from"./index-DQE5H-ct.js";var r=t(e(),1),i=n();function a({data:e}){let{buglog:t}=e,[n,a]=(0,r.useState)(``),[o,s]=(0,r.useState)(null),c=n?t.bugs.filter(e=>e.error_message.toLowerCase().includes(n.toLowerCase())||e.root_cause.toLowerCase().includes(n.toLowerCase())||e.fix.toLowerCase().includes(n.toLowerCase())||e.tags.some(e=>e.toLowerCase().includes(n.toLowerCase()))):t.bugs;if(t.bugs.length===0)return(0,i.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,i.jsx)(`div`,{className:`text-4xl mb-3`,children:`🐛`}),(0,i.jsx)(`h3`,{className:`font-medium mb-1`,style:{color:`var(--text-secondary)`},children:`No bugs logged yet`}),(0,i.jsx)(`p`,{className:`text-sm max-w-sm`,style:{color:`var(--text-muted)`},children:`When you encounter and fix bugs, they'll appear here for future reference.`})]});let l=t.bugs.flatMap(e=>e.tags),u=new Map;for(let e of l)u.set(e,(u.get(e)||0)+1);let d=[...u.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5);return(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 mb-4`,children:[(0,i.jsx)(`input`,{type:`text`,placeholder:`Search bugs...`,value:n,onChange:e=>a(e.target.value),className:`flex-1 min-w-[200px] rounded-lg px-3 py-2 text-sm focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}}),(0,i.jsxs)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:[t.bugs.length,` bugs logged`]})]}),d.length>0&&(0,i.jsx)(`div`,{className:`flex flex-wrap gap-2 mb-4`,children:d.map(([e,t])=>(0,i.jsxs)(`button`,{onClick:()=>a(e),className:`px-2 py-1 text-xs rounded-full`,style:{background:`var(--bg-surface-hover)`,border:`1px solid var(--border-subtle)`,color:`var(--text-muted)`},children:[e,` (`,t,`)`]},e))}),(0,i.jsx)(`div`,{className:`space-y-3`,children:c.map(e=>{let t=o===e.id;return(0,i.jsxs)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsxs)(`button`,{onClick:()=>s(t?null:e.id),className:`w-full flex items-start gap-3 px-5 py-3 transition-colors text-left`,onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsx)(`span`,{className:`text-sm mt-0.5`,style:{color:`var(--text-faint)`},children:t?`▼`:`▶`}),(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsx)(`p`,{className:`text-sm truncate`,style:{color:`var(--text-primary)`},children:e.error_message}),(0,i.jsxs)(`div`,{className:`flex items-center gap-3 mt-1`,children:[(0,i.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:e.file}),(0,i.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:e.timestamp?.slice(0,10)})]})]}),e.occurrences>1&&(0,i.jsxs)(`span`,{className:`shrink-0 px-2 py-0.5 rounded-full text-xs`,style:{background:`var(--warning-subtle)`,color:`var(--warning)`},children:[`Seen `,e.occurrences,`x`]})]}),t&&(0,i.jsxs)(`div`,{className:`px-5 py-4 space-y-3`,style:{borderTop:`1px solid var(--border)`},children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`p`,{className:`text-xs uppercase mb-1`,style:{color:`var(--text-faint)`},children:`Error Message`}),(0,i.jsx)(`pre`,{className:`text-sm rounded-lg p-3 overflow-x-auto font-mono`,style:{color:`var(--danger)`,background:`var(--danger-subtle)`},children:e.error_message})]}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`p`,{className:`text-xs uppercase mb-1`,style:{color:`var(--text-faint)`},children:`Root Cause`}),(0,i.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-secondary)`},children:e.root_cause})]}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`p`,{className:`text-xs uppercase mb-1`,style:{color:`var(--text-faint)`},children:`Fix`}),(0,i.jsx)(`pre`,{className:`text-sm rounded-lg p-3 overflow-x-auto font-mono`,style:{color:`var(--accent)`,background:`var(--accent-subtle)`},children:e.fix})]}),(0,i.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.tags.map(e=>(0,i.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full`,style:{background:`var(--bg-surface-hover)`,border:`1px solid var(--border-subtle)`,color:`var(--text-muted)`},children:e},e))})]})]},e.id)})})]})}export{a as BugLog};
@@ -1 +1 @@
1
- import{a as e,c as t,r as n}from"./index-CCxQQi4q.js";var r=t(e(),1),i=n();function a({data:e}){let{cerebrum:t}=e,[n,a]=(0,r.useState)(``),[o,s]=(0,r.useState)({preferences:!0,learnings:!0,doNotRepeat:!0,decisions:!1}),c=e=>s(t=>({...t,[e]:!t[e]})),l=e=>!n||e.toLowerCase().includes(n.toLowerCase());return(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,i.jsxs)(`div`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:[`Last updated: `,t.lastUpdated||`—`,` ·`,t.preferences.length+t.learnings.length+t.doNotRepeat.length+t.decisions.length,` entries`]})}),(0,i.jsx)(`input`,{type:`text`,placeholder:`Search cerebrum...`,value:n,onChange:e=>a(e.target.value),className:`w-full rounded-lg px-3 py-2 text-sm mb-4 focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}}),(0,i.jsxs)(`div`,{className:`rounded-xl mb-4 overflow-hidden`,style:{background:`var(--danger-subtle)`,border:`1px solid rgba(220, 38, 38, 0.2)`},children:[(0,i.jsxs)(`button`,{onClick:()=>c(`doNotRepeat`),className:`w-full flex items-center justify-between px-5 py-3 transition-colors`,onMouseEnter:e=>e.currentTarget.style.background=`rgba(220, 38, 38, 0.08)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`span`,{style:{color:`var(--danger)`},children:`⊘`}),(0,i.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--danger)`},children:`Do-Not-Repeat`}),(0,i.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full`,style:{background:`rgba(220, 38, 38, 0.1)`,color:`var(--danger)`},children:t.doNotRepeat.length})]}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:o.doNotRepeat?`▼`:`▶`})]}),o.doNotRepeat&&(0,i.jsxs)(`div`,{className:`px-5 pb-4 space-y-2`,children:[t.doNotRepeat.filter(e=>l(e.text)).map((e,t)=>(0,i.jsxs)(`div`,{className:`rounded-lg p-3`,style:{background:`rgba(220, 38, 38, 0.05)`,border:`1px solid rgba(220, 38, 38, 0.1)`},children:[e.date&&(0,i.jsxs)(`span`,{className:`text-xs font-mono mr-2`,style:{color:`rgba(220, 38, 38, 0.6)`},children:[`[`,e.date,`]`]}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-secondary)`},children:e.text})]},t)),t.doNotRepeat.length===0&&(0,i.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No entries yet.`})]})]}),(0,i.jsxs)(`div`,{className:`rounded-xl mb-4 overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsxs)(`button`,{onClick:()=>c(`preferences`),className:`w-full flex items-center justify-between px-5 py-3 transition-colors`,onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`span`,{className:`text-blue-400`,children:`◈`}),(0,i.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`User Preferences`}),(0,i.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:t.preferences.length})]}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:o.preferences?`▼`:`▶`})]}),o.preferences&&(0,i.jsxs)(`div`,{className:`px-5 pb-4`,children:[t.preferences.filter(l).map((e,t)=>(0,i.jsxs)(`div`,{className:`flex items-start gap-2 py-1.5`,children:[(0,i.jsx)(`span`,{className:`mt-1`,style:{color:`var(--text-faint)`},children:`•`}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-secondary)`},children:e})]},t)),t.preferences.length===0&&(0,i.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No preferences recorded yet.`})]})]}),(0,i.jsxs)(`div`,{className:`rounded-xl mb-4 overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsxs)(`button`,{onClick:()=>c(`learnings`),className:`w-full flex items-center justify-between px-5 py-3 transition-colors`,onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`span`,{style:{color:`var(--accent)`},children:`◎`}),(0,i.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Key Learnings`}),(0,i.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:t.learnings.length})]}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:o.learnings?`▼`:`▶`})]}),o.learnings&&(0,i.jsxs)(`div`,{className:`px-5 pb-4 space-y-2`,children:[t.learnings.filter(l).map((e,t)=>(0,i.jsx)(`div`,{className:`rounded-lg p-3 text-sm`,style:{background:`var(--bg-surface-hover)`,color:`var(--text-secondary)`},children:e},t)),t.learnings.length===0&&(0,i.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No learnings recorded yet.`})]})]}),(0,i.jsxs)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsxs)(`button`,{onClick:()=>c(`decisions`),className:`w-full flex items-center justify-between px-5 py-3 transition-colors`,onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`span`,{className:`text-amber-400`,children:`⚖`}),(0,i.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Decision Log`}),(0,i.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:t.decisions.length})]}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:o.decisions?`▼`:`▶`})]}),o.decisions&&(0,i.jsxs)(`div`,{className:`px-5 pb-4 space-y-2`,children:[t.decisions.filter(l).map((e,t)=>(0,i.jsx)(`div`,{className:`rounded-lg p-3 text-sm`,style:{background:`var(--bg-surface-hover)`,color:`var(--text-secondary)`},children:e},t)),t.decisions.length===0&&(0,i.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No decisions logged yet.`})]})]})]})}export{a as CerebrumViewer};
1
+ import{a as e,c as t,r as n}from"./index-DQE5H-ct.js";var r=t(e(),1),i=n();function a({data:e}){let{cerebrum:t}=e,[n,a]=(0,r.useState)(``),[o,s]=(0,r.useState)({preferences:!0,learnings:!0,doNotRepeat:!0,decisions:!1}),c=e=>s(t=>({...t,[e]:!t[e]})),l=e=>!n||e.toLowerCase().includes(n.toLowerCase());return(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,i.jsxs)(`div`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:[`Last updated: `,t.lastUpdated||`—`,` ·`,t.preferences.length+t.learnings.length+t.doNotRepeat.length+t.decisions.length,` entries`]})}),(0,i.jsx)(`input`,{type:`text`,placeholder:`Search cerebrum...`,value:n,onChange:e=>a(e.target.value),className:`w-full rounded-lg px-3 py-2 text-sm mb-4 focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}}),(0,i.jsxs)(`div`,{className:`rounded-xl mb-4 overflow-hidden`,style:{background:`var(--danger-subtle)`,border:`1px solid rgba(220, 38, 38, 0.2)`},children:[(0,i.jsxs)(`button`,{onClick:()=>c(`doNotRepeat`),className:`w-full flex items-center justify-between px-5 py-3 transition-colors`,onMouseEnter:e=>e.currentTarget.style.background=`rgba(220, 38, 38, 0.08)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`span`,{style:{color:`var(--danger)`},children:`⊘`}),(0,i.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--danger)`},children:`Do-Not-Repeat`}),(0,i.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full`,style:{background:`rgba(220, 38, 38, 0.1)`,color:`var(--danger)`},children:t.doNotRepeat.length})]}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:o.doNotRepeat?`▼`:`▶`})]}),o.doNotRepeat&&(0,i.jsxs)(`div`,{className:`px-5 pb-4 space-y-2`,children:[t.doNotRepeat.filter(e=>l(e.text)).map((e,t)=>(0,i.jsxs)(`div`,{className:`rounded-lg p-3`,style:{background:`rgba(220, 38, 38, 0.05)`,border:`1px solid rgba(220, 38, 38, 0.1)`},children:[e.date&&(0,i.jsxs)(`span`,{className:`text-xs font-mono mr-2`,style:{color:`rgba(220, 38, 38, 0.6)`},children:[`[`,e.date,`]`]}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-secondary)`},children:e.text})]},t)),t.doNotRepeat.length===0&&(0,i.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No entries yet.`})]})]}),(0,i.jsxs)(`div`,{className:`rounded-xl mb-4 overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsxs)(`button`,{onClick:()=>c(`preferences`),className:`w-full flex items-center justify-between px-5 py-3 transition-colors`,onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`span`,{className:`text-blue-400`,children:`◈`}),(0,i.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`User Preferences`}),(0,i.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:t.preferences.length})]}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:o.preferences?`▼`:`▶`})]}),o.preferences&&(0,i.jsxs)(`div`,{className:`px-5 pb-4`,children:[t.preferences.filter(l).map((e,t)=>(0,i.jsxs)(`div`,{className:`flex items-start gap-2 py-1.5`,children:[(0,i.jsx)(`span`,{className:`mt-1`,style:{color:`var(--text-faint)`},children:`•`}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-secondary)`},children:e})]},t)),t.preferences.length===0&&(0,i.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No preferences recorded yet.`})]})]}),(0,i.jsxs)(`div`,{className:`rounded-xl mb-4 overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsxs)(`button`,{onClick:()=>c(`learnings`),className:`w-full flex items-center justify-between px-5 py-3 transition-colors`,onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`span`,{style:{color:`var(--accent)`},children:`◎`}),(0,i.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Key Learnings`}),(0,i.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:t.learnings.length})]}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:o.learnings?`▼`:`▶`})]}),o.learnings&&(0,i.jsxs)(`div`,{className:`px-5 pb-4 space-y-2`,children:[t.learnings.filter(l).map((e,t)=>(0,i.jsx)(`div`,{className:`rounded-lg p-3 text-sm`,style:{background:`var(--bg-surface-hover)`,color:`var(--text-secondary)`},children:e},t)),t.learnings.length===0&&(0,i.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No learnings recorded yet.`})]})]}),(0,i.jsxs)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsxs)(`button`,{onClick:()=>c(`decisions`),className:`w-full flex items-center justify-between px-5 py-3 transition-colors`,onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`span`,{className:`text-amber-400`,children:`⚖`}),(0,i.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Decision Log`}),(0,i.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:t.decisions.length})]}),(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:o.decisions?`▼`:`▶`})]}),o.decisions&&(0,i.jsxs)(`div`,{className:`px-5 pb-4 space-y-2`,children:[t.decisions.filter(l).map((e,t)=>(0,i.jsx)(`div`,{className:`rounded-lg p-3 text-sm`,style:{background:`var(--bg-surface-hover)`,color:`var(--text-secondary)`},children:e},t)),t.decisions.length===0&&(0,i.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No decisions logged yet.`})]})]})]})}export{a as CerebrumViewer};
@@ -1 +1 @@
1
- import{a as e,c as t,r as n,t as r}from"./index-CCxQQi4q.js";import{i,n as a}from"./utils-BqE_aDxV.js";import{t as o}from"./StatusBadge-DxWVdzKK.js";var s=t(e(),1),c=n();function l({data:e}){let{cronManifest:t,cronState:n,client:l}=e,[u,d]=(0,s.useState)(!0),[f,p]=(0,s.useState)(!1),[m,h]=(0,s.useState)({}),g=e=>n.dead_letter_queue.some(t=>t.task_id===e)?`failed`:n.execution_log.filter(t=>t.task_id===e).sort((e,t)=>t.timestamp.localeCompare(e.timestamp))[0]?.status||`ok`,_=e=>{let t=n.execution_log.filter(t=>t.task_id===e).sort((e,t)=>t.timestamp.localeCompare(e.timestamp))[0];return t?i(t.timestamp):`never`},v=e=>{h(t=>({...t,[e]:`running`})),r(`/api/cron/run/${encodeURIComponent(e)}`,{method:`POST`}).then(t=>{h(n=>({...n,[e]:t.ok?`ok`:`error`})),setTimeout(()=>h(t=>{let n={...t};return delete n[e],n}),3e3)}).catch(()=>{h(t=>({...t,[e]:`error`})),setTimeout(()=>h(t=>{let n={...t};return delete n[e],n}),3e3)})},y=e=>{l?.send({type:`retry_dead_letter`,task_id:e})};return(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`div`,{className:`rounded-xl overflow-hidden mb-6`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:(0,c.jsxs)(`table`,{className:`w-full`,children:[(0,c.jsx)(`thead`,{children:(0,c.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border)`},children:[(0,c.jsx)(`th`,{className:`text-left px-4 py-3 text-xs font-medium uppercase`,style:{color:`var(--text-faint)`},children:`Status`}),(0,c.jsx)(`th`,{className:`text-left px-4 py-3 text-xs font-medium uppercase`,style:{color:`var(--text-faint)`},children:`Task`}),(0,c.jsx)(`th`,{className:`text-left px-4 py-3 text-xs font-medium uppercase hidden md:table-cell`,style:{color:`var(--text-faint)`},children:`Schedule`}),(0,c.jsx)(`th`,{className:`text-left px-4 py-3 text-xs font-medium uppercase hidden md:table-cell`,style:{color:`var(--text-faint)`},children:`Last Run`}),(0,c.jsx)(`th`,{className:`text-right px-4 py-3 text-xs font-medium uppercase`,style:{color:`var(--text-faint)`},children:`Actions`})]})}),(0,c.jsx)(`tbody`,{children:t.tasks.map(e=>(0,c.jsxs)(`tr`,{className:`transition-colors`,style:{borderBottom:`1px solid var(--border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,c.jsx)(`td`,{className:`px-4 py-3`,children:(0,c.jsx)(o,{status:e.enabled?g(e.id):`disabled`})}),(0,c.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,c.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-primary)`},children:e.name}),(0,c.jsx)(`p`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:e.description})]}),(0,c.jsx)(`td`,{className:`px-4 py-3 hidden md:table-cell text-sm`,style:{color:`var(--text-muted)`},children:a(e.schedule)}),(0,c.jsx)(`td`,{className:`px-4 py-3 hidden md:table-cell text-sm`,style:{color:`var(--text-faint)`},children:_(e.id)}),(0,c.jsx)(`td`,{className:`px-4 py-3 text-right`,children:(()=>{let t=m[e.id];return(0,c.jsx)(`button`,{onClick:()=>v(e.id),disabled:t===`running`,className:`px-3 py-1 text-xs rounded-md transition-colors`,style:{background:`var(--bg-surface-hover)`,border:`1px solid var(--border-subtle)`,color:t===`ok`?`var(--accent)`:t===`error`?`var(--danger)`:`var(--text-secondary)`,opacity:t===`running`?.6:1},children:t===`running`?`Running…`:t===`ok`?`Triggered ✓`:t===`error`?`Failed ✗`:`Run Now`})})()})]},e.id))})]})}),(0,c.jsxs)(`div`,{className:`rounded-xl p-5 mb-6`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,c.jsxs)(`button`,{onClick:()=>d(!u),className:`flex items-center gap-2 w-full text-left`,children:[(0,c.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:u?`▼`:`▶`}),(0,c.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Dead Letter Queue`}),(0,c.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[`(`,n.dead_letter_queue.length,`)`]})]}),u&&(n.dead_letter_queue.length===0?(0,c.jsx)(`div`,{className:`text-center py-6 text-sm mt-2`,style:{color:`var(--text-muted)`},children:`No dead letters — all systems healthy`}):(0,c.jsx)(`div`,{className:`space-y-3 mt-3`,children:n.dead_letter_queue.map((e,t)=>(0,c.jsx)(`div`,{className:`rounded-lg p-4`,style:{background:`var(--danger-subtle)`,border:`1px solid rgba(220, 38, 38, 0.2)`},children:(0,c.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`p`,{className:`text-sm font-medium`,style:{color:`var(--danger)`},children:e.task_id}),(0,c.jsx)(`p`,{className:`text-xs mt-1`,style:{color:`var(--text-muted)`},children:e.error}),(0,c.jsxs)(`p`,{className:`text-xs mt-1`,style:{color:`var(--text-faint)`},children:[i(e.timestamp),` · `,e.attempts,` attempts`]})]}),(0,c.jsx)(`button`,{onClick:()=>y(e.task_id),className:`px-3 py-1 text-xs rounded-md`,style:{background:`var(--bg-surface-hover)`,border:`1px solid var(--border-subtle)`,color:`var(--text-secondary)`},children:`Retry`})]})},t))}))]}),(0,c.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,c.jsxs)(`button`,{onClick:()=>p(!f),className:`flex items-center gap-2 w-full text-left`,children:[(0,c.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:f?`▼`:`▶`}),(0,c.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Execution History`})]}),f&&(0,c.jsxs)(`div`,{className:`mt-3`,children:[n.execution_log.slice(-30).reverse().map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-4 py-2`,style:{borderBottom:`1px solid var(--border)`},children:[(0,c.jsx)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:e.timestamp?.slice(11,16)}),(0,c.jsx)(`span`,{className:`text-sm flex-1`,style:{color:`var(--text-secondary)`},children:e.task_id}),(0,c.jsxs)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:[e.duration_ms,`ms`]}),(0,c.jsx)(o,{status:e.status})]},t)),n.execution_log.length===0&&(0,c.jsx)(`p`,{className:`text-sm py-4 text-center`,style:{color:`var(--text-muted)`},children:`No executions yet.`})]})]})]})}export{l as CronStatus};
1
+ import{a as e,c as t,r as n,t as r}from"./index-DQE5H-ct.js";import{i,n as a}from"./utils-BqE_aDxV.js";import{t as o}from"./StatusBadge-Du4IbMH3.js";var s=t(e(),1),c=n();function l({data:e}){let{cronManifest:t,cronState:n,client:l}=e,[u,d]=(0,s.useState)(!0),[f,p]=(0,s.useState)(!1),[m,h]=(0,s.useState)({}),g=e=>n.dead_letter_queue.some(t=>t.task_id===e)?`failed`:n.execution_log.filter(t=>t.task_id===e).sort((e,t)=>t.timestamp.localeCompare(e.timestamp))[0]?.status||`ok`,_=e=>{let t=n.execution_log.filter(t=>t.task_id===e).sort((e,t)=>t.timestamp.localeCompare(e.timestamp))[0];return t?i(t.timestamp):`never`},v=e=>{h(t=>({...t,[e]:`running`})),r(`/api/cron/run/${encodeURIComponent(e)}`,{method:`POST`}).then(t=>{h(n=>({...n,[e]:t.ok?`ok`:`error`})),setTimeout(()=>h(t=>{let n={...t};return delete n[e],n}),3e3)}).catch(()=>{h(t=>({...t,[e]:`error`})),setTimeout(()=>h(t=>{let n={...t};return delete n[e],n}),3e3)})},y=e=>{l?.send({type:`retry_dead_letter`,task_id:e})};return(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`div`,{className:`rounded-xl overflow-hidden mb-6`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:(0,c.jsxs)(`table`,{className:`w-full`,children:[(0,c.jsx)(`thead`,{children:(0,c.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border)`},children:[(0,c.jsx)(`th`,{className:`text-left px-4 py-3 text-xs font-medium uppercase`,style:{color:`var(--text-faint)`},children:`Status`}),(0,c.jsx)(`th`,{className:`text-left px-4 py-3 text-xs font-medium uppercase`,style:{color:`var(--text-faint)`},children:`Task`}),(0,c.jsx)(`th`,{className:`text-left px-4 py-3 text-xs font-medium uppercase hidden md:table-cell`,style:{color:`var(--text-faint)`},children:`Schedule`}),(0,c.jsx)(`th`,{className:`text-left px-4 py-3 text-xs font-medium uppercase hidden md:table-cell`,style:{color:`var(--text-faint)`},children:`Last Run`}),(0,c.jsx)(`th`,{className:`text-right px-4 py-3 text-xs font-medium uppercase`,style:{color:`var(--text-faint)`},children:`Actions`})]})}),(0,c.jsx)(`tbody`,{children:t.tasks.map(e=>(0,c.jsxs)(`tr`,{className:`transition-colors`,style:{borderBottom:`1px solid var(--border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,c.jsx)(`td`,{className:`px-4 py-3`,children:(0,c.jsx)(o,{status:e.enabled?g(e.id):`disabled`})}),(0,c.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,c.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-primary)`},children:e.name}),(0,c.jsx)(`p`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:e.description})]}),(0,c.jsx)(`td`,{className:`px-4 py-3 hidden md:table-cell text-sm`,style:{color:`var(--text-muted)`},children:a(e.schedule)}),(0,c.jsx)(`td`,{className:`px-4 py-3 hidden md:table-cell text-sm`,style:{color:`var(--text-faint)`},children:_(e.id)}),(0,c.jsx)(`td`,{className:`px-4 py-3 text-right`,children:(()=>{let t=m[e.id];return(0,c.jsx)(`button`,{onClick:()=>v(e.id),disabled:t===`running`,className:`px-3 py-1 text-xs rounded-md transition-colors`,style:{background:`var(--bg-surface-hover)`,border:`1px solid var(--border-subtle)`,color:t===`ok`?`var(--accent)`:t===`error`?`var(--danger)`:`var(--text-secondary)`,opacity:t===`running`?.6:1},children:t===`running`?`Running…`:t===`ok`?`Triggered ✓`:t===`error`?`Failed ✗`:`Run Now`})})()})]},e.id))})]})}),(0,c.jsxs)(`div`,{className:`rounded-xl p-5 mb-6`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,c.jsxs)(`button`,{onClick:()=>d(!u),className:`flex items-center gap-2 w-full text-left`,children:[(0,c.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:u?`▼`:`▶`}),(0,c.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Dead Letter Queue`}),(0,c.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[`(`,n.dead_letter_queue.length,`)`]})]}),u&&(n.dead_letter_queue.length===0?(0,c.jsx)(`div`,{className:`text-center py-6 text-sm mt-2`,style:{color:`var(--text-muted)`},children:`No dead letters — all systems healthy`}):(0,c.jsx)(`div`,{className:`space-y-3 mt-3`,children:n.dead_letter_queue.map((e,t)=>(0,c.jsx)(`div`,{className:`rounded-lg p-4`,style:{background:`var(--danger-subtle)`,border:`1px solid rgba(220, 38, 38, 0.2)`},children:(0,c.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`p`,{className:`text-sm font-medium`,style:{color:`var(--danger)`},children:e.task_id}),(0,c.jsx)(`p`,{className:`text-xs mt-1`,style:{color:`var(--text-muted)`},children:e.error}),(0,c.jsxs)(`p`,{className:`text-xs mt-1`,style:{color:`var(--text-faint)`},children:[i(e.timestamp),` · `,e.attempts,` attempts`]})]}),(0,c.jsx)(`button`,{onClick:()=>y(e.task_id),className:`px-3 py-1 text-xs rounded-md`,style:{background:`var(--bg-surface-hover)`,border:`1px solid var(--border-subtle)`,color:`var(--text-secondary)`},children:`Retry`})]})},t))}))]}),(0,c.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,c.jsxs)(`button`,{onClick:()=>p(!f),className:`flex items-center gap-2 w-full text-left`,children:[(0,c.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:f?`▼`:`▶`}),(0,c.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Execution History`})]}),f&&(0,c.jsxs)(`div`,{className:`mt-3`,children:[n.execution_log.slice(-30).reverse().map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-4 py-2`,style:{borderBottom:`1px solid var(--border)`},children:[(0,c.jsx)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:e.timestamp?.slice(11,16)}),(0,c.jsx)(`span`,{className:`text-sm flex-1`,style:{color:`var(--text-secondary)`},children:e.task_id}),(0,c.jsxs)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:[e.duration_ms,`ms`]}),(0,c.jsx)(o,{status:e.status})]},t)),n.execution_log.length===0&&(0,c.jsx)(`p`,{className:`text-sm py-4 text-center`,style:{color:`var(--text-muted)`},children:`No executions yet.`})]})]})]})}export{l as CronStatus};
@@ -1 +1 @@
1
- import{a as e,c as t,n,r,t as i}from"./index-CCxQQi4q.js";var a=t(e(),1),o=r(),s=e=>n(`/api/designqc/capture/${encodeURIComponent(e)}`);function c({data:e}){let{designqcReport:t,project:n}=e,[r,c]=(0,a.useState)(`idle`),[l,u]=(0,a.useState)(null),[d,f]=(0,a.useState)(null),p=t&&t.captures&&t.captures.length>0;return(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`div`,{className:`rounded-xl px-4 py-3 mb-6 flex items-start gap-3`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,o.jsx)(`span`,{style:{color:`var(--text-faint)`,marginTop:1},children:`ℹ`}),(0,o.jsxs)(`div`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:[`Works with `,(0,o.jsx)(`span`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`any accessible URL`}),` — local or deployed. The URL is auto-detected from `,(0,o.jsx)(`code`,{className:`px-1 rounded text-xs`,style:{background:`var(--bg-base)`},children:`package.json`}),` homepage, env files, or a running dev server.`,n?.root&&(0,o.jsxs)(`span`,{children:[` Scanning `,(0,o.jsx)(`code`,{className:`px-1 rounded text-xs`,style:{background:`var(--bg-base)`},children:n.root}),`.`]})]})]}),(0,o.jsxs)(`div`,{className:`rounded-xl p-5 mb-6`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,o.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Capture Screenshots`}),(0,o.jsx)(`button`,{onClick:()=>{c(`running`),u(null),i(`/api/designqc/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`}).then(async e=>{if(!e.ok){let t=await e.json().catch(()=>({error:e.statusText}));throw Error(t.error||e.statusText)}c(`idle`)}).catch(e=>{c(`error`),u(e.message)})},disabled:r===`running`,className:`px-4 py-1.5 text-sm rounded-lg transition-colors`,style:{background:r===`error`?`var(--danger-subtle)`:`var(--accent-subtle)`,border:`1px solid ${r===`error`?`rgba(220,38,38,0.3)`:`var(--accent)`}`,color:r===`error`?`var(--danger)`:`var(--accent)`,opacity:r===`running`?.6:1},children:r===`running`?`Capturing…`:r===`error`?`Retry Capture`:`Run Capture`})]}),r===`running`&&(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Auto-detecting URL, launching browser, capturing screenshots… this takes ~15–30s.`}),r===`error`&&l&&(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--danger)`},children:l}),r===`idle`&&(0,o.jsxs)(`div`,{className:`space-y-1.5 text-sm`,style:{color:`var(--text-muted)`},children:[(0,o.jsxs)(`p`,{children:[`Detects your URL automatically from `,(0,o.jsx)(`code`,{className:`px-1 rounded text-xs`,style:{background:`var(--bg-base)`},children:`package.json`}),`, env files, or a running dev server.`]}),(0,o.jsxs)(`p`,{children:[`After capture, ask Claude: `,(0,o.jsx)(`span`,{className:`italic`,children:`"Read .wolf/designqc-captures/ and evaluate the design"`})]})]})]}),(0,o.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,o.jsx)(`h3`,{className:`font-medium mb-3`,style:{color:`var(--text-secondary)`},children:`Last Capture`}),p?(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`div`,{className:`flex gap-4 text-sm mb-4`,children:[(0,o.jsxs)(`span`,{style:{color:`var(--text-faint)`},children:[`Captured: `,t.captured_at||`—`]}),(0,o.jsxs)(`span`,{style:{color:`var(--text-faint)`},children:[`Size: `,t.total_size_kb||0,`KB`]}),(0,o.jsxs)(`span`,{style:{color:`var(--text-faint)`},children:[`Est. tokens: ~`,t.estimated_tokens||0]})]}),(0,o.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 gap-4`,children:t.captures.map((e,t)=>(0,o.jsxs)(`button`,{onClick:()=>f(e.file),className:`text-left rounded-lg overflow-hidden transition-transform hover:-translate-y-0.5`,style:{background:`var(--bg-base)`,border:`1px solid var(--border)`},title:`Klicken zum Vergrößern`,children:[(0,o.jsx)(`img`,{src:s(e.file),alt:`${e.viewport} · ${e.route}`,loading:`lazy`,className:`w-full block`,style:{maxHeight:200,objectFit:`cover`,objectPosition:`top`,background:`var(--bg-surface)`}}),(0,o.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,o.jsx)(`div`,{className:`text-sm truncate`,style:{color:`var(--text-primary)`},children:e.file}),(0,o.jsxs)(`div`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[e.viewport,` · `,e.route]})]})]},t))})]}):(0,o.jsx)(`div`,{className:`text-center py-8`,children:(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No screenshots captured yet.`})})]}),d&&(0,o.jsxs)(`div`,{onClick:()=>f(null),className:`fixed inset-0 z-50 flex items-center justify-center p-6`,style:{background:`rgba(0,0,0,0.8)`},children:[(0,o.jsx)(`div`,{className:`relative max-w-6xl max-h-[90vh] overflow-auto rounded-lg`,onClick:e=>e.stopPropagation(),children:(0,o.jsx)(`img`,{src:s(d),alt:d,className:`block`,style:{maxWidth:`100%`}})}),(0,o.jsx)(`button`,{onClick:()=>f(null),className:`absolute top-4 right-4 w-9 h-9 rounded-full flex items-center justify-center text-lg`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`},"aria-label":`Schließen`,children:`✕`})]})]})}export{c as DesignQC};
1
+ import{a as e,c as t,n,r,t as i}from"./index-DQE5H-ct.js";var a=t(e(),1),o=r(),s=e=>n(`/api/designqc/capture/${encodeURIComponent(e)}`);function c({data:e}){let{designqcReport:t,project:n}=e,[r,c]=(0,a.useState)(`idle`),[l,u]=(0,a.useState)(null),[d,f]=(0,a.useState)(null),p=t&&t.captures&&t.captures.length>0;return(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`div`,{className:`rounded-xl px-4 py-3 mb-6 flex items-start gap-3`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,o.jsx)(`span`,{style:{color:`var(--text-faint)`,marginTop:1},children:`ℹ`}),(0,o.jsxs)(`div`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:[`Works with `,(0,o.jsx)(`span`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`any accessible URL`}),` — local or deployed. The URL is auto-detected from `,(0,o.jsx)(`code`,{className:`px-1 rounded text-xs`,style:{background:`var(--bg-base)`},children:`package.json`}),` homepage, env files, or a running dev server.`,n?.root&&(0,o.jsxs)(`span`,{children:[` Scanning `,(0,o.jsx)(`code`,{className:`px-1 rounded text-xs`,style:{background:`var(--bg-base)`},children:n.root}),`.`]})]})]}),(0,o.jsxs)(`div`,{className:`rounded-xl p-5 mb-6`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,o.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Capture Screenshots`}),(0,o.jsx)(`button`,{onClick:()=>{c(`running`),u(null),i(`/api/designqc/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`}).then(async e=>{if(!e.ok){let t=await e.json().catch(()=>({error:e.statusText}));throw Error(t.error||e.statusText)}c(`idle`)}).catch(e=>{c(`error`),u(e.message)})},disabled:r===`running`,className:`px-4 py-1.5 text-sm rounded-lg transition-colors`,style:{background:r===`error`?`var(--danger-subtle)`:`var(--accent-subtle)`,border:`1px solid ${r===`error`?`rgba(220,38,38,0.3)`:`var(--accent)`}`,color:r===`error`?`var(--danger)`:`var(--accent)`,opacity:r===`running`?.6:1},children:r===`running`?`Capturing…`:r===`error`?`Retry Capture`:`Run Capture`})]}),r===`running`&&(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Auto-detecting URL, launching browser, capturing screenshots… this takes ~15–30s.`}),r===`error`&&l&&(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--danger)`},children:l}),r===`idle`&&(0,o.jsxs)(`div`,{className:`space-y-1.5 text-sm`,style:{color:`var(--text-muted)`},children:[(0,o.jsxs)(`p`,{children:[`Detects your URL automatically from `,(0,o.jsx)(`code`,{className:`px-1 rounded text-xs`,style:{background:`var(--bg-base)`},children:`package.json`}),`, env files, or a running dev server.`]}),(0,o.jsxs)(`p`,{children:[`After capture, ask Claude: `,(0,o.jsx)(`span`,{className:`italic`,children:`"Read .wolf/designqc-captures/ and evaluate the design"`})]})]})]}),(0,o.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,o.jsx)(`h3`,{className:`font-medium mb-3`,style:{color:`var(--text-secondary)`},children:`Last Capture`}),p?(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`div`,{className:`flex gap-4 text-sm mb-4`,children:[(0,o.jsxs)(`span`,{style:{color:`var(--text-faint)`},children:[`Captured: `,t.captured_at||`—`]}),(0,o.jsxs)(`span`,{style:{color:`var(--text-faint)`},children:[`Size: `,t.total_size_kb||0,`KB`]}),(0,o.jsxs)(`span`,{style:{color:`var(--text-faint)`},children:[`Est. tokens: ~`,t.estimated_tokens||0]})]}),(0,o.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 gap-4`,children:t.captures.map((e,t)=>(0,o.jsxs)(`button`,{onClick:()=>f(e.file),className:`text-left rounded-lg overflow-hidden transition-transform hover:-translate-y-0.5`,style:{background:`var(--bg-base)`,border:`1px solid var(--border)`},title:`Klicken zum Vergrößern`,children:[(0,o.jsx)(`img`,{src:s(e.file),alt:`${e.viewport} · ${e.route}`,loading:`lazy`,className:`w-full block`,style:{maxHeight:200,objectFit:`cover`,objectPosition:`top`,background:`var(--bg-surface)`}}),(0,o.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,o.jsx)(`div`,{className:`text-sm truncate`,style:{color:`var(--text-primary)`},children:e.file}),(0,o.jsxs)(`div`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[e.viewport,` · `,e.route]})]})]},t))})]}):(0,o.jsx)(`div`,{className:`text-center py-8`,children:(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No screenshots captured yet.`})})]}),d&&(0,o.jsxs)(`div`,{onClick:()=>f(null),className:`fixed inset-0 z-50 flex items-center justify-center p-6`,style:{background:`rgba(0,0,0,0.8)`},children:[(0,o.jsx)(`div`,{className:`relative max-w-6xl max-h-[90vh] overflow-auto rounded-lg`,onClick:e=>e.stopPropagation(),children:(0,o.jsx)(`img`,{src:s(d),alt:d,className:`block`,style:{maxWidth:`100%`}})}),(0,o.jsx)(`button`,{onClick:()=>f(null),className:`absolute top-4 right-4 w-9 h-9 rounded-full flex items-center justify-center text-lg`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`},"aria-label":`Schließen`,children:`✕`})]})]})}export{c as DesignQC};
@@ -1 +1 @@
1
- import{a as e,c as t,r as n,t as r}from"./index-CCxQQi4q.js";var i=t(e(),1),a=n();function o(e,t,n,r){let i=new Map(e.map((e,t)=>[e.key,t])),a=e.length,o=new Float64Array(a),s=new Float64Array(a);for(let e=0;e<a;e++){let t=e*2.399963%(Math.PI*2),i=Math.sqrt((e+.5)/a)*Math.min(n,r)*.42;o[e]=n/2+Math.cos(t)*i,s[e]=r/2+Math.sin(t)*i}let c=t.map(e=>[i.get(e.from),i.get(e.to)]).filter(e=>e[0]!==void 0&&e[1]!==void 0);for(let e=0;e<220;e++){let t=1-e/220;for(let e=0;e<a;e++)for(let n=e+1;n<a;n++){let r=o[e]-o[n],i=s[e]-s[n],a=r*r+i*i;if(a<1&&(a=1,r=e-n||1,i=1),a>9e4)continue;let c=420/a*t,l=Math.sqrt(a);o[e]+=r/l*c,s[e]+=i/l*c,o[n]-=r/l*c,s[n]-=i/l*c}for(let[e,n]of c){let r=o[n]-o[e],i=s[n]-s[e],a=Math.max(1,Math.hypot(r,i)),c=(a-72)*.02*t;o[e]+=r/a*c,s[e]+=i/a*c,o[n]-=r/a*c,s[n]-=i/a*c}for(let e=0;e<a;e++)o[e]=Math.max(14,Math.min(n-14,o[e])),s[e]=Math.max(14,Math.min(r-14,s[e]))}return{x:o,y:s,idx:i}}function s(){let[e,t]=(0,i.useState)(null),[n,s]=(0,i.useState)(null),c=(0,i.useRef)(null);(0,i.useEffect)(()=>{r(`/api/link-graph`).then(e=>e.json()).then(t).catch(()=>t({available:!1,error:`not reachable`}))},[]);let l=(0,i.useMemo)(()=>(e?.nodes??[]).filter(e=>e.in+e.out>0),[e]),u=(0,i.useMemo)(()=>[...l].sort((e,t)=>t.in+t.out-(e.in+e.out)).slice(0,90),[l]),d=(0,i.useMemo)(()=>new Set(u.map(e=>e.key)),[u]),f=(0,i.useMemo)(()=>(e?.edges??[]).filter(e=>d.has(e.from)&&d.has(e.to)),[e,d]),p=(e?.nodes?.length??0)-l.length;if((0,i.useEffect)(()=>{let t=c.current;if(!t||!e?.available||u.length===0)return;let r=t.width,i=t.height,{x:a,y:s,idx:l}=o(u,f,r,i),d=t.getContext(`2d`);if(!d)return;d.clearRect(0,0,r,i),d.strokeStyle=`rgba(148,163,184,0.22)`,d.lineWidth=1;for(let e of f){let t=l.get(e.from),n=l.get(e.to);t===void 0||n===void 0||(d.beginPath(),d.moveTo(a[t],s[t]),d.lineTo(a[n],s[n]),d.stroke())}let p=Math.max(1,...u.map(e=>e.in));u.forEach((e,t)=>{let r=3+Math.sqrt(e.in/p)*9;d.beginPath(),d.arc(a[t],s[t],r,0,Math.PI*2),d.fillStyle=e.key===n?`#fbbf24`:e.in>0?`#34d399`:`#64748b`,d.fill()}),d.fillStyle=`rgba(226,232,240,0.85)`,d.font=`11px ui-monospace, monospace`,[...u].sort((e,t)=>t.in-e.in).slice(0,8).forEach(e=>{let t=l.get(e.key);d.fillText(e.title.replace(/\.md$/,``).slice(0,26),a[t]+10,s[t]+4)})},[e,u,f,n]),!e)return(0,a.jsx)(`div`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Loading…`});if(!e.available)return(0,a.jsxs)(`div`,{className:`rounded-xl p-5 text-sm`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-muted)`},children:[`No link graph available`,e.error?` — ${e.error}`:``,`.`]});let m=[...e.nodes??[]].sort((e,t)=>t.in-e.in).filter(e=>e.in>0).slice(0,12);return(0,a.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-[1.4fr_1fr]`,children:[(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsxs)(`div`,{className:`mb-3 flex items-baseline justify-between`,children:[(0,a.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Link graph`}),(0,a.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[u.length,` of `,l.length,` linked shown · `,p,` isolated · `,e.edges?.length??0,` links`]})]}),(0,a.jsx)(`canvas`,{ref:c,width:760,height:460,className:`w-full rounded-lg`,style:{background:`var(--bg-base)`,border:`1px solid var(--border)`}}),(0,a.jsxs)(`p`,{className:`mt-3 text-xs`,style:{color:`var(--text-faint)`},children:[`The `,90,` best-connected notes; dot size follows how often a note is referenced. Drawing all `,l.length,` produced a hairball, so the rest is counted rather than drawn —`,e.stats?.blocks.toLocaleString(`en-US`),` blocks sit behind these `,e.stats?.files,` files.`]})]}),(0,a.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`h3`,{className:`mb-3 font-medium`,style:{color:`var(--text-secondary)`},children:`Most referenced`}),m.length===0?(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Nothing links to anything yet.`}):(0,a.jsx)(`ul`,{className:`flex flex-col gap-1.5 text-sm`,children:m.map(e=>(0,a.jsx)(`li`,{children:(0,a.jsxs)(`button`,{onClick:()=>s(e.key===n?null:e.key),className:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-left hover:bg-white/5`,style:{color:e.key===n?`var(--accent)`:`var(--text-primary)`},children:[(0,a.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,style:{color:`var(--text-faint)`},children:String(e.in).padStart(2,` `)}),(0,a.jsx)(`span`,{className:`truncate`,children:e.title.replace(/\.md$/,``)})]})},e.key))})]}),(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsxs)(`h3`,{className:`mb-1 font-medium`,style:{color:`var(--text-secondary)`},children:[`Dead references `,e.dangling?.length?`(${e.dangling.length})`:``]}),(0,a.jsx)(`p`,{className:`mb-3 text-xs`,style:{color:`var(--text-faint)`},children:`A link whose target does not exist. Named rather than swallowed — each one is a note that was meant to be written, or a link that was mistyped.`}),(e.dangling?.length??0)===0?(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--accent)`},children:`None. Every reference resolves.`}):(0,a.jsx)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:e.dangling.slice(0,12).map((e,t)=>(0,a.jsxs)(`li`,{className:`leading-snug`,children:[(0,a.jsx)(`code`,{className:`text-xs`,style:{color:`#f87171`},children:e.target}),(0,a.jsxs)(`div`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[`from `,e.fromSrc.replace(/^native\//,``)]})]},t))})]})]})]})}export{s as LinkGraph};
1
+ import{a as e,c as t,r as n,t as r}from"./index-DQE5H-ct.js";var i=t(e(),1),a=n();function o(e,t,n,r){let i=new Map(e.map((e,t)=>[e.key,t])),a=e.length,o=new Float64Array(a),s=new Float64Array(a);for(let e=0;e<a;e++){let t=e*2.399963%(Math.PI*2),i=Math.sqrt((e+.5)/a)*Math.min(n,r)*.42;o[e]=n/2+Math.cos(t)*i,s[e]=r/2+Math.sin(t)*i}let c=t.map(e=>[i.get(e.from),i.get(e.to)]).filter(e=>e[0]!==void 0&&e[1]!==void 0);for(let e=0;e<220;e++){let t=1-e/220;for(let e=0;e<a;e++)for(let n=e+1;n<a;n++){let r=o[e]-o[n],i=s[e]-s[n],a=r*r+i*i;if(a<1&&(a=1,r=e-n||1,i=1),a>9e4)continue;let c=420/a*t,l=Math.sqrt(a);o[e]+=r/l*c,s[e]+=i/l*c,o[n]-=r/l*c,s[n]-=i/l*c}for(let[e,n]of c){let r=o[n]-o[e],i=s[n]-s[e],a=Math.max(1,Math.hypot(r,i)),c=(a-72)*.02*t;o[e]+=r/a*c,s[e]+=i/a*c,o[n]-=r/a*c,s[n]-=i/a*c}for(let e=0;e<a;e++)o[e]=Math.max(14,Math.min(n-14,o[e])),s[e]=Math.max(14,Math.min(r-14,s[e]))}return{x:o,y:s,idx:i}}function s(){let[e,t]=(0,i.useState)(null),[n,s]=(0,i.useState)(null),c=(0,i.useRef)(null);(0,i.useEffect)(()=>{r(`/api/link-graph`).then(e=>e.json()).then(t).catch(()=>t({available:!1,error:`not reachable`}))},[]);let l=(0,i.useMemo)(()=>(e?.nodes??[]).filter(e=>e.in+e.out>0),[e]),u=(0,i.useMemo)(()=>[...l].sort((e,t)=>t.in+t.out-(e.in+e.out)).slice(0,90),[l]),d=(0,i.useMemo)(()=>new Set(u.map(e=>e.key)),[u]),f=(0,i.useMemo)(()=>(e?.edges??[]).filter(e=>d.has(e.from)&&d.has(e.to)),[e,d]),p=(e?.nodes?.length??0)-l.length;if((0,i.useEffect)(()=>{let t=c.current;if(!t||!e?.available||u.length===0)return;let r=t.width,i=t.height,{x:a,y:s,idx:l}=o(u,f,r,i),d=t.getContext(`2d`);if(!d)return;d.clearRect(0,0,r,i),d.strokeStyle=`rgba(148,163,184,0.22)`,d.lineWidth=1;for(let e of f){let t=l.get(e.from),n=l.get(e.to);t===void 0||n===void 0||(d.beginPath(),d.moveTo(a[t],s[t]),d.lineTo(a[n],s[n]),d.stroke())}let p=Math.max(1,...u.map(e=>e.in));u.forEach((e,t)=>{let r=3+Math.sqrt(e.in/p)*9;d.beginPath(),d.arc(a[t],s[t],r,0,Math.PI*2),d.fillStyle=e.key===n?`#fbbf24`:e.in>0?`#34d399`:`#64748b`,d.fill()}),d.fillStyle=`rgba(226,232,240,0.85)`,d.font=`11px ui-monospace, monospace`,[...u].sort((e,t)=>t.in-e.in).slice(0,8).forEach(e=>{let t=l.get(e.key);d.fillText(e.title.replace(/\.md$/,``).slice(0,26),a[t]+10,s[t]+4)})},[e,u,f,n]),!e)return(0,a.jsx)(`div`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Loading…`});if(!e.available)return(0,a.jsxs)(`div`,{className:`rounded-xl p-5 text-sm`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-muted)`},children:[`No link graph available`,e.error?` — ${e.error}`:``,`.`]});let m=[...e.nodes??[]].sort((e,t)=>t.in-e.in).filter(e=>e.in>0).slice(0,12);return(0,a.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-[1.4fr_1fr]`,children:[(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsxs)(`div`,{className:`mb-3 flex items-baseline justify-between`,children:[(0,a.jsx)(`h3`,{className:`font-medium`,style:{color:`var(--text-secondary)`},children:`Link graph`}),(0,a.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[u.length,` of `,l.length,` linked shown · `,p,` isolated · `,e.edges?.length??0,` links`]})]}),(0,a.jsx)(`canvas`,{ref:c,width:760,height:460,className:`w-full rounded-lg`,style:{background:`var(--bg-base)`,border:`1px solid var(--border)`}}),(0,a.jsxs)(`p`,{className:`mt-3 text-xs`,style:{color:`var(--text-faint)`},children:[`The `,90,` best-connected notes; dot size follows how often a note is referenced. Drawing all `,l.length,` produced a hairball, so the rest is counted rather than drawn —`,e.stats?.blocks.toLocaleString(`en-US`),` blocks sit behind these `,e.stats?.files,` files.`]})]}),(0,a.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`h3`,{className:`mb-3 font-medium`,style:{color:`var(--text-secondary)`},children:`Most referenced`}),m.length===0?(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Nothing links to anything yet.`}):(0,a.jsx)(`ul`,{className:`flex flex-col gap-1.5 text-sm`,children:m.map(e=>(0,a.jsx)(`li`,{children:(0,a.jsxs)(`button`,{onClick:()=>s(e.key===n?null:e.key),className:`flex w-full items-center gap-2 rounded px-1.5 py-1 text-left hover:bg-white/5`,style:{color:e.key===n?`var(--accent)`:`var(--text-primary)`},children:[(0,a.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,style:{color:`var(--text-faint)`},children:String(e.in).padStart(2,` `)}),(0,a.jsx)(`span`,{className:`truncate`,children:e.title.replace(/\.md$/,``)})]})},e.key))})]}),(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsxs)(`h3`,{className:`mb-1 font-medium`,style:{color:`var(--text-secondary)`},children:[`Dead references `,e.dangling?.length?`(${e.dangling.length})`:``]}),(0,a.jsx)(`p`,{className:`mb-3 text-xs`,style:{color:`var(--text-faint)`},children:`A link whose target does not exist. Named rather than swallowed — each one is a note that was meant to be written, or a link that was mistyped.`}),(e.dangling?.length??0)===0?(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--accent)`},children:`None. Every reference resolves.`}):(0,a.jsx)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:e.dangling.slice(0,12).map((e,t)=>(0,a.jsxs)(`li`,{className:`leading-snug`,children:[(0,a.jsx)(`code`,{className:`text-xs`,style:{color:`#f87171`},children:e.target}),(0,a.jsxs)(`div`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[`from `,e.fromSrc.replace(/^native\//,``)]})]},t))})]})]})]})}export{s as LinkGraph};
@@ -1 +1 @@
1
- import{a as e,c as t,r as n}from"./index-CCxQQi4q.js";var r=t(e(),1),i=n();function a({data:e}){let{memory:t}=e,[n,a]=(0,r.useState)(0),[o,s]=(0,r.useState)(``),c=o?t.filter(e=>e.entries.some(e=>e.action.toLowerCase().includes(o.toLowerCase())||e.files.toLowerCase().includes(o.toLowerCase()))):t;return(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`flex items-center gap-3 mb-4`,children:(0,i.jsx)(`input`,{type:`text`,placeholder:`Search memory...`,value:o,onChange:e=>s(e.target.value),className:`flex-1 rounded-lg px-3 py-2 text-sm focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}})}),c.length===0?(0,i.jsx)(`div`,{className:`text-center py-12`,style:{color:`var(--text-muted)`},children:`No sessions found.`}):(0,i.jsx)(`div`,{className:`space-y-3`,children:c.map((e,t)=>{let r=n===t,o=e.entries.reduce((e,t)=>e+(parseInt(t.tokens.replace(/[^0-9]/g,``))||0),0);return(0,i.jsxs)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsxs)(`button`,{onClick:()=>a(r?-1:t),className:`w-full flex items-center justify-between px-5 py-3 transition-colors`,onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:r?`▼`:`▶`}),(0,i.jsxs)(`span`,{className:`text-sm font-medium`,style:{color:`var(--text-primary)`},children:[e.date,` `,e.time]}),(0,i.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[e.entries.length,` actions`]})]}),o>0&&(0,i.jsxs)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:[`~`,o,` tok`]})]}),r&&e.entries.length>0&&(0,i.jsx)(`div`,{style:{borderTop:`1px solid var(--border)`},children:(0,i.jsxs)(`table`,{className:`w-full`,children:[(0,i.jsx)(`thead`,{children:(0,i.jsxs)(`tr`,{className:`text-xs uppercase`,style:{color:`var(--text-faint)`},children:[(0,i.jsx)(`th`,{className:`text-left px-4 py-2 w-16`,children:`Time`}),(0,i.jsx)(`th`,{className:`text-left px-4 py-2`,children:`Action`}),(0,i.jsx)(`th`,{className:`text-left px-4 py-2 hidden md:table-cell`,children:`Files`}),(0,i.jsx)(`th`,{className:`text-left px-4 py-2 hidden md:table-cell`,children:`Outcome`}),(0,i.jsx)(`th`,{className:`text-right px-4 py-2 w-20`,children:`Tokens`})]})}),(0,i.jsx)(`tbody`,{children:e.entries.map((e,t)=>(0,i.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsx)(`td`,{className:`px-4 py-2 text-xs font-mono`,style:{color:`var(--text-faint)`},children:e.time}),(0,i.jsx)(`td`,{className:`px-4 py-2 text-sm`,style:{color:`var(--text-secondary)`},children:e.action}),(0,i.jsx)(`td`,{className:`px-4 py-2 text-sm hidden md:table-cell`,style:{color:`var(--text-muted)`},children:e.files}),(0,i.jsx)(`td`,{className:`px-4 py-2 text-sm hidden md:table-cell`,style:{color:`var(--text-muted)`},children:e.outcome}),(0,i.jsx)(`td`,{className:`px-4 py-2 text-xs font-mono text-right`,style:{color:`var(--text-faint)`},children:e.tokens})]},t))})]})})]},t)})})]})}export{a as MemoryViewer};
1
+ import{a as e,c as t,r as n}from"./index-DQE5H-ct.js";var r=t(e(),1),i=n();function a({data:e}){let{memory:t}=e,[n,a]=(0,r.useState)(0),[o,s]=(0,r.useState)(``),c=o?t.filter(e=>e.entries.some(e=>e.action.toLowerCase().includes(o.toLowerCase())||e.files.toLowerCase().includes(o.toLowerCase()))):t;return(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`flex items-center gap-3 mb-4`,children:(0,i.jsx)(`input`,{type:`text`,placeholder:`Search memory...`,value:o,onChange:e=>s(e.target.value),className:`flex-1 rounded-lg px-3 py-2 text-sm focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}})}),c.length===0?(0,i.jsx)(`div`,{className:`text-center py-12`,style:{color:`var(--text-muted)`},children:`No sessions found.`}):(0,i.jsx)(`div`,{className:`space-y-3`,children:c.map((e,t)=>{let r=n===t,o=e.entries.reduce((e,t)=>e+(parseInt(t.tokens.replace(/[^0-9]/g,``))||0),0);return(0,i.jsxs)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,i.jsxs)(`button`,{onClick:()=>a(r?-1:t),className:`w-full flex items-center justify-between px-5 py-3 transition-colors`,onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`span`,{className:`text-sm`,style:{color:`var(--text-faint)`},children:r?`▼`:`▶`}),(0,i.jsxs)(`span`,{className:`text-sm font-medium`,style:{color:`var(--text-primary)`},children:[e.date,` `,e.time]}),(0,i.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[e.entries.length,` actions`]})]}),o>0&&(0,i.jsxs)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:[`~`,o,` tok`]})]}),r&&e.entries.length>0&&(0,i.jsx)(`div`,{style:{borderTop:`1px solid var(--border)`},children:(0,i.jsxs)(`table`,{className:`w-full`,children:[(0,i.jsx)(`thead`,{children:(0,i.jsxs)(`tr`,{className:`text-xs uppercase`,style:{color:`var(--text-faint)`},children:[(0,i.jsx)(`th`,{className:`text-left px-4 py-2 w-16`,children:`Time`}),(0,i.jsx)(`th`,{className:`text-left px-4 py-2`,children:`Action`}),(0,i.jsx)(`th`,{className:`text-left px-4 py-2 hidden md:table-cell`,children:`Files`}),(0,i.jsx)(`th`,{className:`text-left px-4 py-2 hidden md:table-cell`,children:`Outcome`}),(0,i.jsx)(`th`,{className:`text-right px-4 py-2 w-20`,children:`Tokens`})]})}),(0,i.jsx)(`tbody`,{children:e.entries.map((e,t)=>(0,i.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border)`},onMouseEnter:e=>e.currentTarget.style.background=`var(--bg-surface-hover)`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,children:[(0,i.jsx)(`td`,{className:`px-4 py-2 text-xs font-mono`,style:{color:`var(--text-faint)`},children:e.time}),(0,i.jsx)(`td`,{className:`px-4 py-2 text-sm`,style:{color:`var(--text-secondary)`},children:e.action}),(0,i.jsx)(`td`,{className:`px-4 py-2 text-sm hidden md:table-cell`,style:{color:`var(--text-muted)`},children:e.files}),(0,i.jsx)(`td`,{className:`px-4 py-2 text-sm hidden md:table-cell`,style:{color:`var(--text-muted)`},children:e.outcome}),(0,i.jsx)(`td`,{className:`px-4 py-2 text-xs font-mono text-right`,style:{color:`var(--text-faint)`},children:e.tokens})]},t))})]})})]},t)})})]})}export{a as MemoryViewer};
@@ -1 +1 @@
1
- import{a as e,c as t,r as n,t as r}from"./index-CCxQQi4q.js";import{i}from"./utils-BqE_aDxV.js";var a=t(e(),1),o=n();function s(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function c({label:e,value:t,accent:n}){return(0,o.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:e}),(0,o.jsx)(`p`,{className:`text-2xl font-bold mt-1`,style:{color:n?`var(--accent)`:`var(--text-primary)`},children:t})]})}var l=2160*60*60*1e3;function u({scope:e,setScope:t}){return(0,o.jsx)(`div`,{className:`inline-flex rounded-lg mb-4 p-0.5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[{id:`project`,label:`This project`},{id:`all`,label:`All projects`}].map(n=>(0,o.jsx)(`button`,{onClick:()=>t(n.id),className:`text-sm px-3 py-1.5 rounded-md transition-colors`,style:{background:e===n.id?`var(--accent)`:`transparent`,color:e===n.id?`#fff`:`var(--text-muted)`},children:n.label},n.id))})}function d({data:e}){let[t,n]=(0,a.useState)(`project`);return(0,o.jsxs)(`div`,{children:[(0,o.jsx)(u,{scope:t,setScope:n}),t===`project`?(0,o.jsx)(f,{data:e}):(0,o.jsx)(p,{data:e})]})}function f(e){let[t,n]=(0,a.useState)(null),[u,d]=(0,a.useState)(null),[f,p]=(0,a.useState)(``),[m,h]=(0,a.useState)(null),[g,_]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=!1;return r(`/api/native-memory`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(t=>{e||n(t)}).catch(t=>{e||d(String(t?.message||t))}),()=>{e=!0}},[]);let v=e=>{_(!0),h({name:e,content:``}),r(`/api/native-memory/file?name=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(t=>h({name:e,content:t.content??``})).catch(()=>h({name:e,content:`(could not load file)`})).finally(()=>_(!1))};if(u)return(0,o.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--danger)`},children:[`Could not load native memory: `,u]});if(!t)return(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Loading…`});if(!t.available)return(0,o.jsxs)(`div`,{className:`rounded-xl p-6`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,o.jsx)(`h3`,{className:`font-medium mb-2`,style:{color:`var(--text-secondary)`},children:`No native memory found`}),(0,o.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:[`Claude Code's native Auto Memory isn't present for this project (expected at`,(0,o.jsx)(`code`,{className:`px-1 mx-1 rounded text-xs`,style:{background:`var(--bg-base)`},children:`~/.claude/projects/<project>/memory/`}),`). It appears once Auto Memory has written notes. OpenWolf falls back to its own `,(0,o.jsx)(`code`,{children:`.wolf/`}),` memory.`]})]});let y=t.health,b=Date.now(),x=(t.files??[]).filter(e=>!f||e.name.toLowerCase().includes(f.toLowerCase())),S={color:`var(--text-secondary)`,padding:`0.5rem 0.75rem`,borderTop:`1px solid var(--border)`},C={color:`var(--text-muted)`,fontWeight:500,textAlign:`left`,padding:`0.5rem 0.75rem`};return(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 mb-4`,children:[(0,o.jsx)(c,{label:`Topic files`,value:String(y.topicFiles)}),(0,o.jsx)(c,{label:`In index`,value:`${y.indexedCount}`,accent:!0}),(0,o.jsx)(c,{label:`Not indexed`,value:String(y.orphanCount)}),(0,o.jsx)(c,{label:`Footprint`,value:s(y.footprintBytes)})]}),(y.indexCutoffExceeded||y.orphanCount>0||y.deadLinks.length>0)&&(0,o.jsxs)(`div`,{className:`rounded-xl px-4 py-3 mb-4 text-sm space-y-1`,style:{background:`var(--danger-subtle)`,border:`1px solid rgba(220,38,38,0.3)`,color:`var(--text-secondary)`},children:[y.indexCutoffExceeded&&(0,o.jsxs)(`div`,{children:[`⚠ `,(0,o.jsxs)(`strong`,{children:[`MEMORY.md is `,y.indexLines,` lines`]}),` — only the first 200 load at session start; the rest is invisible until trimmed.`]}),y.orphanCount>0&&(0,o.jsxs)(`div`,{children:[`⚠ `,(0,o.jsxs)(`strong`,{children:[y.orphanCount,` topic files aren't in the index`]}),` → they never surface on resume. They're still searchable via `,(0,o.jsx)(`code`,{children:`openwolf recall`}),` and below.`]}),y.deadLinks.length>0&&(0,o.jsxs)(`div`,{children:[`⚠ `,(0,o.jsxs)(`strong`,{children:[y.deadLinks.length,` dead index link(s)`]}),`: `,y.deadLinks.slice(0,5).join(`, `),y.deadLinks.length>5?`…`:``]})]}),(0,o.jsx)(`input`,{type:`text`,placeholder:`Filter topic files…`,value:f,onChange:e=>p(e.target.value),className:`w-full mb-3 rounded-lg px-3 py-2 text-sm focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}}),(0,o.jsx)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:(0,o.jsx)(`div`,{className:`overflow-x-auto`,style:{maxHeight:460},children:(0,o.jsxs)(`table`,{className:`w-full text-sm`,style:{borderCollapse:`collapse`},children:[(0,o.jsx)(`thead`,{children:(0,o.jsxs)(`tr`,{children:[(0,o.jsxs)(`th`,{style:C,children:[`Topic file (`,x.length,`)`]}),(0,o.jsx)(`th`,{style:C,children:`Index`}),(0,o.jsx)(`th`,{style:{...C,textAlign:`right`},children:`Size`}),(0,o.jsx)(`th`,{style:C,children:`Modified`})]})}),(0,o.jsx)(`tbody`,{children:x.map(e=>{let t=b-new Date(e.mtime).getTime()>l;return(0,o.jsxs)(`tr`,{style:{cursor:`pointer`},onClick:()=>v(e.name),children:[(0,o.jsx)(`td`,{style:{...S,color:`var(--text-primary)`},className:`font-mono`,children:e.name}),(0,o.jsx)(`td`,{style:S,children:e.indexed?(0,o.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded`,style:{background:`var(--accent-subtle)`,color:`var(--accent)`},children:`indexed`}):(0,o.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded`,style:{background:`var(--bg-base)`,color:`var(--text-faint)`},children:`orphan`})}),(0,o.jsx)(`td`,{style:{...S,textAlign:`right`},children:s(e.bytes)}),(0,o.jsxs)(`td`,{style:{...S,color:t?`var(--text-faint)`:`var(--text-muted)`},children:[i(e.mtime),t?` · stale`:``]})]},e.name)})})]})})}),m&&(0,o.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,style:{background:`rgba(0,0,0,0.5)`},onClick:()=>h(null),children:(0,o.jsxs)(`div`,{className:`rounded-xl w-full max-w-3xl max-h-[80vh] flex flex-col`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},onClick:e=>e.stopPropagation(),children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2`,style:{borderBottom:`1px solid var(--border)`},children:[(0,o.jsx)(`span`,{className:`font-mono text-sm`,style:{color:`var(--text-primary)`},children:m.name}),(0,o.jsx)(`button`,{onClick:()=>h(null),className:`text-sm px-2 py-1 rounded`,style:{color:`var(--text-muted)`},children:`✕`})]}),(0,o.jsx)(`pre`,{className:`text-xs px-4 py-3 overflow-auto whitespace-pre-wrap`,style:{color:`var(--text-secondary)`},children:g?`Loading…`:m.content})]})}),(0,o.jsx)(`p`,{className:`text-xs mt-3`,style:{color:`var(--text-faint)`},children:`Read-only view of Claude Code's native Auto Memory. OpenWolf never writes here — Claude's own Auto Dream owns consolidation.`})]})}function p({data:e}){let[t,n]=(0,a.useState)(null),[i,l]=(0,a.useState)(null),u=e.project.root;(0,a.useEffect)(()=>{let e=!1;return r(`/api/native-memory/aggregate`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(t=>{e||n(t.projects||[])}).catch(t=>{e||l(String(t?.message||t))}),()=>{e=!0}},[]);let d=e=>{r(`/api/switch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({root:e})}).then(e=>{e.ok&&location.reload()})};if(i)return(0,o.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--danger)`},children:[`Could not load projects: `,i]});if(!t)return(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Loading projects…`});let f=t.filter(e=>e.available&&e.health),p=[...t].sort((e,t)=>e.available===t.available?(t.health?.topicFiles??0)-(e.health?.topicFiles??0):e.available?-1:1),m=f.reduce((e,t)=>({topics:e.topics+t.health.topicFiles,orphans:e.orphans+t.health.orphanCount,footprint:e.footprint+t.health.footprintBytes}),{topics:0,orphans:0,footprint:0}),h={color:`var(--text-muted)`,fontWeight:500,textAlign:`left`,padding:`0.5rem 0.75rem`},g={color:`var(--text-secondary)`,padding:`0.5rem 0.75rem`,borderTop:`1px solid var(--border)`};return(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 mb-6`,children:[(0,o.jsx)(c,{label:`With native memory`,value:`${f.length}/${t.length}`}),(0,o.jsx)(c,{label:`Total topic files`,value:String(m.topics),accent:!0}),(0,o.jsx)(c,{label:`Total orphaned`,value:String(m.orphans)}),(0,o.jsx)(c,{label:`Total footprint`,value:s(m.footprint)})]}),(0,o.jsx)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:(0,o.jsx)(`div`,{className:`overflow-x-auto`,children:(0,o.jsxs)(`table`,{className:`w-full text-sm`,style:{borderCollapse:`collapse`},children:[(0,o.jsx)(`thead`,{children:(0,o.jsxs)(`tr`,{children:[(0,o.jsx)(`th`,{style:h,children:`Project`}),(0,o.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Topic files`}),(0,o.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Indexed`}),(0,o.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Orphaned`}),(0,o.jsx)(`th`,{style:h,children:`MEMORY.md`}),(0,o.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Footprint`}),(0,o.jsx)(`th`,{style:h})]})}),(0,o.jsx)(`tbody`,{children:p.map(e=>{let t=u&&e.root===u,n=e.health;return(0,o.jsxs)(`tr`,{style:{background:t?`var(--bg-surface-hover)`:`transparent`},children:[(0,o.jsxs)(`td`,{style:g,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{style:{color:`var(--text-primary)`,fontWeight:500},children:e.name}),t&&(0,o.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded`,style:{background:`var(--accent)`,color:`#fff`},children:`current`}),!e.available&&(0,o.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:`no native memory`})]}),(0,o.jsx)(`div`,{className:`text-xs truncate`,style:{color:`var(--text-faint)`,maxWidth:320},title:e.root,children:e.root})]}),(0,o.jsx)(`td`,{style:{...g,textAlign:`right`,color:n?`var(--text-primary)`:`var(--text-faint)`},children:n?n.topicFiles:`—`}),(0,o.jsx)(`td`,{style:{...g,textAlign:`right`,color:`var(--accent)`},children:n?n.indexedCount:`—`}),(0,o.jsx)(`td`,{style:{...g,textAlign:`right`,color:n&&n.orphanCount>0?`var(--text-primary)`:`var(--text-faint)`},children:n?n.orphanCount:`—`}),(0,o.jsxs)(`td`,{style:g,children:[n?n.indexCutoffExceeded?(0,o.jsxs)(`span`,{className:`text-xs px-1.5 py-0.5 rounded`,style:{background:`var(--danger-subtle)`,color:`var(--danger)`},title:`Only the first 200 lines load at session start`,children:[n.indexLines,` lines · over cutoff`]}):(0,o.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-muted)`},children:[n.indexLines,` lines`]}):(0,o.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:`—`}),n&&n.deadLinks.length>0&&(0,o.jsxs)(`span`,{className:`text-xs ml-2`,style:{color:`var(--danger)`},title:n.deadLinks.slice(0,8).join(`, `),children:[n.deadLinks.length,` dead`]})]}),(0,o.jsx)(`td`,{style:{...g,textAlign:`right`,color:`var(--text-muted)`},children:n?s(n.footprintBytes):`—`}),(0,o.jsx)(`td`,{style:g,children:!t&&e.available&&(0,o.jsx)(`button`,{onClick:()=>d(e.root),className:`text-xs px-2 py-1 rounded-md transition-colors`,style:{background:`var(--bg-base)`,border:`1px solid var(--border)`,color:`var(--text-secondary)`},children:`Open`})})]},e.root)})})]})})}),(0,o.jsx)(`p`,{className:`text-xs mt-3`,style:{color:`var(--text-faint)`},children:`Native Auto Memory health across all registered OpenWolf projects. "Open" switches the daemon to that project — then "This project" browses its files. Read-only.`})]})}export{d as NativeMemory};
1
+ import{a as e,c as t,r as n,t as r}from"./index-DQE5H-ct.js";import{i}from"./utils-BqE_aDxV.js";var a=t(e(),1),o=n();function s(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function c({label:e,value:t,accent:n}){return(0,o.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:e}),(0,o.jsx)(`p`,{className:`text-2xl font-bold mt-1`,style:{color:n?`var(--accent)`:`var(--text-primary)`},children:t})]})}var l=2160*60*60*1e3;function u({scope:e,setScope:t}){return(0,o.jsx)(`div`,{className:`inline-flex rounded-lg mb-4 p-0.5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[{id:`project`,label:`This project`},{id:`all`,label:`All projects`}].map(n=>(0,o.jsx)(`button`,{onClick:()=>t(n.id),className:`text-sm px-3 py-1.5 rounded-md transition-colors`,style:{background:e===n.id?`var(--accent)`:`transparent`,color:e===n.id?`#fff`:`var(--text-muted)`},children:n.label},n.id))})}function d({data:e}){let[t,n]=(0,a.useState)(`project`);return(0,o.jsxs)(`div`,{children:[(0,o.jsx)(u,{scope:t,setScope:n}),t===`project`?(0,o.jsx)(f,{data:e}):(0,o.jsx)(p,{data:e})]})}function f(e){let[t,n]=(0,a.useState)(null),[u,d]=(0,a.useState)(null),[f,p]=(0,a.useState)(``),[m,h]=(0,a.useState)(null),[g,_]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=!1;return r(`/api/native-memory`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(t=>{e||n(t)}).catch(t=>{e||d(String(t?.message||t))}),()=>{e=!0}},[]);let v=e=>{_(!0),h({name:e,content:``}),r(`/api/native-memory/file?name=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(t=>h({name:e,content:t.content??``})).catch(()=>h({name:e,content:`(could not load file)`})).finally(()=>_(!1))};if(u)return(0,o.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--danger)`},children:[`Could not load native memory: `,u]});if(!t)return(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Loading…`});if(!t.available)return(0,o.jsxs)(`div`,{className:`rounded-xl p-6`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,o.jsx)(`h3`,{className:`font-medium mb-2`,style:{color:`var(--text-secondary)`},children:`No native memory found`}),(0,o.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:[`Claude Code's native Auto Memory isn't present for this project (expected at`,(0,o.jsx)(`code`,{className:`px-1 mx-1 rounded text-xs`,style:{background:`var(--bg-base)`},children:`~/.claude/projects/<project>/memory/`}),`). It appears once Auto Memory has written notes. OpenWolf falls back to its own `,(0,o.jsx)(`code`,{children:`.wolf/`}),` memory.`]})]});let y=t.health,b=Date.now(),x=(t.files??[]).filter(e=>!f||e.name.toLowerCase().includes(f.toLowerCase())),S={color:`var(--text-secondary)`,padding:`0.5rem 0.75rem`,borderTop:`1px solid var(--border)`},C={color:`var(--text-muted)`,fontWeight:500,textAlign:`left`,padding:`0.5rem 0.75rem`};return(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 mb-4`,children:[(0,o.jsx)(c,{label:`Topic files`,value:String(y.topicFiles)}),(0,o.jsx)(c,{label:`In index`,value:`${y.indexedCount}`,accent:!0}),(0,o.jsx)(c,{label:`Not indexed`,value:String(y.orphanCount)}),(0,o.jsx)(c,{label:`Footprint`,value:s(y.footprintBytes)})]}),(y.indexCutoffExceeded||y.orphanCount>0||y.deadLinks.length>0)&&(0,o.jsxs)(`div`,{className:`rounded-xl px-4 py-3 mb-4 text-sm space-y-1`,style:{background:`var(--danger-subtle)`,border:`1px solid rgba(220,38,38,0.3)`,color:`var(--text-secondary)`},children:[y.indexCutoffExceeded&&(0,o.jsxs)(`div`,{children:[`⚠ `,(0,o.jsxs)(`strong`,{children:[`MEMORY.md is `,y.indexLines,` lines`]}),` — only the first 200 load at session start; the rest is invisible until trimmed.`]}),y.orphanCount>0&&(0,o.jsxs)(`div`,{children:[`⚠ `,(0,o.jsxs)(`strong`,{children:[y.orphanCount,` topic files aren't in the index`]}),` → they never surface on resume. They're still searchable via `,(0,o.jsx)(`code`,{children:`openwolf recall`}),` and below.`]}),y.deadLinks.length>0&&(0,o.jsxs)(`div`,{children:[`⚠ `,(0,o.jsxs)(`strong`,{children:[y.deadLinks.length,` dead index link(s)`]}),`: `,y.deadLinks.slice(0,5).join(`, `),y.deadLinks.length>5?`…`:``]})]}),(0,o.jsx)(`input`,{type:`text`,placeholder:`Filter topic files…`,value:f,onChange:e=>p(e.target.value),className:`w-full mb-3 rounded-lg px-3 py-2 text-sm focus:outline-none`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`,color:`var(--text-primary)`}}),(0,o.jsx)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:(0,o.jsx)(`div`,{className:`overflow-x-auto`,style:{maxHeight:460},children:(0,o.jsxs)(`table`,{className:`w-full text-sm`,style:{borderCollapse:`collapse`},children:[(0,o.jsx)(`thead`,{children:(0,o.jsxs)(`tr`,{children:[(0,o.jsxs)(`th`,{style:C,children:[`Topic file (`,x.length,`)`]}),(0,o.jsx)(`th`,{style:C,children:`Index`}),(0,o.jsx)(`th`,{style:{...C,textAlign:`right`},children:`Size`}),(0,o.jsx)(`th`,{style:C,children:`Modified`})]})}),(0,o.jsx)(`tbody`,{children:x.map(e=>{let t=b-new Date(e.mtime).getTime()>l;return(0,o.jsxs)(`tr`,{style:{cursor:`pointer`},onClick:()=>v(e.name),children:[(0,o.jsx)(`td`,{style:{...S,color:`var(--text-primary)`},className:`font-mono`,children:e.name}),(0,o.jsx)(`td`,{style:S,children:e.indexed?(0,o.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded`,style:{background:`var(--accent-subtle)`,color:`var(--accent)`},children:`indexed`}):(0,o.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded`,style:{background:`var(--bg-base)`,color:`var(--text-faint)`},children:`orphan`})}),(0,o.jsx)(`td`,{style:{...S,textAlign:`right`},children:s(e.bytes)}),(0,o.jsxs)(`td`,{style:{...S,color:t?`var(--text-faint)`:`var(--text-muted)`},children:[i(e.mtime),t?` · stale`:``]})]},e.name)})})]})})}),m&&(0,o.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,style:{background:`rgba(0,0,0,0.5)`},onClick:()=>h(null),children:(0,o.jsxs)(`div`,{className:`rounded-xl w-full max-w-3xl max-h-[80vh] flex flex-col`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},onClick:e=>e.stopPropagation(),children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2`,style:{borderBottom:`1px solid var(--border)`},children:[(0,o.jsx)(`span`,{className:`font-mono text-sm`,style:{color:`var(--text-primary)`},children:m.name}),(0,o.jsx)(`button`,{onClick:()=>h(null),className:`text-sm px-2 py-1 rounded`,style:{color:`var(--text-muted)`},children:`✕`})]}),(0,o.jsx)(`pre`,{className:`text-xs px-4 py-3 overflow-auto whitespace-pre-wrap`,style:{color:`var(--text-secondary)`},children:g?`Loading…`:m.content})]})}),(0,o.jsx)(`p`,{className:`text-xs mt-3`,style:{color:`var(--text-faint)`},children:`Read-only view of Claude Code's native Auto Memory. OpenWolf never writes here — Claude's own Auto Dream owns consolidation.`})]})}function p({data:e}){let[t,n]=(0,a.useState)(null),[i,l]=(0,a.useState)(null),u=e.project.root;(0,a.useEffect)(()=>{let e=!1;return r(`/api/native-memory/aggregate`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(t=>{e||n(t.projects||[])}).catch(t=>{e||l(String(t?.message||t))}),()=>{e=!0}},[]);let d=e=>{r(`/api/switch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({root:e})}).then(e=>{e.ok&&location.reload()})};if(i)return(0,o.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--danger)`},children:[`Could not load projects: `,i]});if(!t)return(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Loading projects…`});let f=t.filter(e=>e.available&&e.health),p=[...t].sort((e,t)=>e.available===t.available?(t.health?.topicFiles??0)-(e.health?.topicFiles??0):e.available?-1:1),m=f.reduce((e,t)=>({topics:e.topics+t.health.topicFiles,orphans:e.orphans+t.health.orphanCount,footprint:e.footprint+t.health.footprintBytes}),{topics:0,orphans:0,footprint:0}),h={color:`var(--text-muted)`,fontWeight:500,textAlign:`left`,padding:`0.5rem 0.75rem`},g={color:`var(--text-secondary)`,padding:`0.5rem 0.75rem`,borderTop:`1px solid var(--border)`};return(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 mb-6`,children:[(0,o.jsx)(c,{label:`With native memory`,value:`${f.length}/${t.length}`}),(0,o.jsx)(c,{label:`Total topic files`,value:String(m.topics),accent:!0}),(0,o.jsx)(c,{label:`Total orphaned`,value:String(m.orphans)}),(0,o.jsx)(c,{label:`Total footprint`,value:s(m.footprint)})]}),(0,o.jsx)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:(0,o.jsx)(`div`,{className:`overflow-x-auto`,children:(0,o.jsxs)(`table`,{className:`w-full text-sm`,style:{borderCollapse:`collapse`},children:[(0,o.jsx)(`thead`,{children:(0,o.jsxs)(`tr`,{children:[(0,o.jsx)(`th`,{style:h,children:`Project`}),(0,o.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Topic files`}),(0,o.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Indexed`}),(0,o.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Orphaned`}),(0,o.jsx)(`th`,{style:h,children:`MEMORY.md`}),(0,o.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Footprint`}),(0,o.jsx)(`th`,{style:h})]})}),(0,o.jsx)(`tbody`,{children:p.map(e=>{let t=u&&e.root===u,n=e.health;return(0,o.jsxs)(`tr`,{style:{background:t?`var(--bg-surface-hover)`:`transparent`},children:[(0,o.jsxs)(`td`,{style:g,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{style:{color:`var(--text-primary)`,fontWeight:500},children:e.name}),t&&(0,o.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded`,style:{background:`var(--accent)`,color:`#fff`},children:`current`}),!e.available&&(0,o.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:`no native memory`})]}),(0,o.jsx)(`div`,{className:`text-xs truncate`,style:{color:`var(--text-faint)`,maxWidth:320},title:e.root,children:e.root})]}),(0,o.jsx)(`td`,{style:{...g,textAlign:`right`,color:n?`var(--text-primary)`:`var(--text-faint)`},children:n?n.topicFiles:`—`}),(0,o.jsx)(`td`,{style:{...g,textAlign:`right`,color:`var(--accent)`},children:n?n.indexedCount:`—`}),(0,o.jsx)(`td`,{style:{...g,textAlign:`right`,color:n&&n.orphanCount>0?`var(--text-primary)`:`var(--text-faint)`},children:n?n.orphanCount:`—`}),(0,o.jsxs)(`td`,{style:g,children:[n?n.indexCutoffExceeded?(0,o.jsxs)(`span`,{className:`text-xs px-1.5 py-0.5 rounded`,style:{background:`var(--danger-subtle)`,color:`var(--danger)`},title:`Only the first 200 lines load at session start`,children:[n.indexLines,` lines · over cutoff`]}):(0,o.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-muted)`},children:[n.indexLines,` lines`]}):(0,o.jsx)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:`—`}),n&&n.deadLinks.length>0&&(0,o.jsxs)(`span`,{className:`text-xs ml-2`,style:{color:`var(--danger)`},title:n.deadLinks.slice(0,8).join(`, `),children:[n.deadLinks.length,` dead`]})]}),(0,o.jsx)(`td`,{style:{...g,textAlign:`right`,color:`var(--text-muted)`},children:n?s(n.footprintBytes):`—`}),(0,o.jsx)(`td`,{style:g,children:!t&&e.available&&(0,o.jsx)(`button`,{onClick:()=>d(e.root),className:`text-xs px-2 py-1 rounded-md transition-colors`,style:{background:`var(--bg-base)`,border:`1px solid var(--border)`,color:`var(--text-secondary)`},children:`Open`})})]},e.root)})})]})})}),(0,o.jsx)(`p`,{className:`text-xs mt-3`,style:{color:`var(--text-faint)`},children:`Native Auto Memory health across all registered OpenWolf projects. "Open" switches the daemon to that project — then "This project" browses its files. Read-only.`})]})}export{d as NativeMemory};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./index-CCxQQi4q.js";import{i as n,r}from"./utils-BqE_aDxV.js";import{t as i}from"./StatusBadge-DxWVdzKK.js";e();var a=t();function o({data:e}){let{identity:t,health:o,cronState:s,tokenLedger:c,anatomy:l,memory:u,project:d}=e,f=c.lifetime,p=d.name||t.name,m=d.description||``;return(0,a.jsxs)(`div`,{children:[(0,a.jsxs)(`div`,{className:`rounded-xl p-6 mb-6`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`h2`,{className:`text-3xl font-bold`,style:{color:`var(--text-primary)`},children:p}),m&&(0,a.jsx)(`p`,{className:`mt-1`,style:{color:`var(--text-muted)`},children:m}),(0,a.jsxs)(`div`,{className:`flex items-center gap-4 mt-3`,children:[(0,a.jsx)(i,{status:s.engine_status}),o.uptime_seconds>0&&(0,a.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[`Uptime: `,Math.floor(o.uptime_seconds/3600),`h `,Math.floor(o.uptime_seconds%3600/60),`m`]}),s.last_heartbeat&&(0,a.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[`Last heartbeat: `,n(s.last_heartbeat)]})]})]}),(0,a.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4 mb-6`,children:[(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Files Tracked`}),(0,a.jsx)(`p`,{className:`text-2xl font-bold mt-1`,style:{color:`var(--text-primary)`},children:l.metadata.files})]}),(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Sessions`}),(0,a.jsx)(`p`,{className:`text-2xl font-bold mt-1`,style:{color:`var(--text-primary)`},children:f.total_sessions})]}),(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Tokens Saved`}),(0,a.jsxs)(`p`,{className:`text-2xl font-bold mt-1`,style:{color:`var(--accent)`},children:[`~`,r(f.estimated_savings_vs_bare_cli)]}),f.total_tokens_estimated>0&&(0,a.jsxs)(`p`,{className:`text-xs mt-1`,style:{color:`var(--text-faint)`},children:[Math.round(f.estimated_savings_vs_bare_cli/(f.total_tokens_estimated+f.estimated_savings_vs_bare_cli)*100),`% savings`]})]})]}),(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`h3`,{className:`font-medium mb-3`,style:{color:`var(--text-secondary)`},children:`Recent Activity`}),u.length===0?(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No activity yet. Start a Claude Code session to see activity here.`}):(0,a.jsx)(`div`,{className:`space-y-2`,children:u.slice(0,3).flatMap(e=>e.entries.slice(-5).reverse().map((t,n)=>(0,a.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,style:{borderBottom:`1px solid var(--border)`},children:[(0,a.jsx)(`span`,{className:`text-xs font-mono w-12`,style:{color:`var(--text-faint)`},children:t.time}),(0,a.jsx)(`span`,{className:`text-sm flex-1`,style:{color:`var(--text-secondary)`},children:t.action}),(0,a.jsx)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:t.tokens})]},`${e.date}-${n}`))).slice(0,5)})]})]})}export{o as ProjectOverview};
1
+ import{a as e,r as t}from"./index-DQE5H-ct.js";import{i as n,r}from"./utils-BqE_aDxV.js";import{t as i}from"./StatusBadge-Du4IbMH3.js";e();var a=t();function o({data:e}){let{identity:t,health:o,cronState:s,tokenLedger:c,anatomy:l,memory:u,project:d}=e,f=c.lifetime,p=d.name||t.name,m=d.description||``;return(0,a.jsxs)(`div`,{children:[(0,a.jsxs)(`div`,{className:`rounded-xl p-6 mb-6`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`h2`,{className:`text-3xl font-bold`,style:{color:`var(--text-primary)`},children:p}),m&&(0,a.jsx)(`p`,{className:`mt-1`,style:{color:`var(--text-muted)`},children:m}),(0,a.jsxs)(`div`,{className:`flex items-center gap-4 mt-3`,children:[(0,a.jsx)(i,{status:s.engine_status}),o.uptime_seconds>0&&(0,a.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[`Uptime: `,Math.floor(o.uptime_seconds/3600),`h `,Math.floor(o.uptime_seconds%3600/60),`m`]}),s.last_heartbeat&&(0,a.jsxs)(`span`,{className:`text-xs`,style:{color:`var(--text-faint)`},children:[`Last heartbeat: `,n(s.last_heartbeat)]})]})]}),(0,a.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4 mb-6`,children:[(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Files Tracked`}),(0,a.jsx)(`p`,{className:`text-2xl font-bold mt-1`,style:{color:`var(--text-primary)`},children:l.metadata.files})]}),(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Sessions`}),(0,a.jsx)(`p`,{className:`text-2xl font-bold mt-1`,style:{color:`var(--text-primary)`},children:f.total_sessions})]}),(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Tokens Saved`}),(0,a.jsxs)(`p`,{className:`text-2xl font-bold mt-1`,style:{color:`var(--accent)`},children:[`~`,r(f.estimated_savings_vs_bare_cli)]}),f.total_tokens_estimated>0&&(0,a.jsxs)(`p`,{className:`text-xs mt-1`,style:{color:`var(--text-faint)`},children:[Math.round(f.estimated_savings_vs_bare_cli/(f.total_tokens_estimated+f.estimated_savings_vs_bare_cli)*100),`% savings`]})]})]}),(0,a.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,a.jsx)(`h3`,{className:`font-medium mb-3`,style:{color:`var(--text-secondary)`},children:`Recent Activity`}),u.length===0?(0,a.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`No activity yet. Start a Claude Code session to see activity here.`}):(0,a.jsx)(`div`,{className:`space-y-2`,children:u.slice(0,3).flatMap(e=>e.entries.slice(-5).reverse().map((t,n)=>(0,a.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,style:{borderBottom:`1px solid var(--border)`},children:[(0,a.jsx)(`span`,{className:`text-xs font-mono w-12`,style:{color:`var(--text-faint)`},children:t.time}),(0,a.jsx)(`span`,{className:`text-sm flex-1`,style:{color:`var(--text-secondary)`},children:t.action}),(0,a.jsx)(`span`,{className:`text-xs font-mono`,style:{color:`var(--text-faint)`},children:t.tokens})]},`${e.date}-${n}`))).slice(0,5)})]})]})}export{o as ProjectOverview};
@@ -1 +1 @@
1
- import{a as e,c as t,r as n,t as r}from"./index-CCxQQi4q.js";import{i,r as a}from"./utils-BqE_aDxV.js";var o=t(e(),1),s=n();function c({label:e,value:t,accent:n}){return(0,s.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,s.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:e}),(0,s.jsx)(`p`,{className:`text-2xl font-bold mt-1`,style:{color:n?`var(--accent)`:`var(--text-primary)`},children:t})]})}function l({data:e}){let[t,n]=(0,o.useState)(null),[l,u]=(0,o.useState)(null),d=e.project.root;(0,o.useEffect)(()=>{let e=!1;return r(`/api/aggregate`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(t=>{e||n(t.projects||[])}).catch(t=>{e||u(String(t?.message||t))}),()=>{e=!0}},[]);let f=e=>{r(`/api/switch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({root:e})}).then(e=>{e.ok&&location.reload()})};if(l)return(0,s.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--danger)`},children:[`Could not load projects: `,l]});if(!t)return(0,s.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Loading projects…`});let p=[...t].sort((e,t)=>(t.last_activity||``).localeCompare(e.last_activity||``)),m=t.reduce((e,t)=>({sessions:e.sessions+t.total_sessions,saved:e.saved+t.estimated_savings,bugs:e.bugs+t.open_bugs}),{sessions:0,saved:0,bugs:0}),h={color:`var(--text-muted)`,fontWeight:500,textAlign:`left`,padding:`0.5rem 0.75rem`},g={color:`var(--text-secondary)`,padding:`0.5rem 0.75rem`,borderTop:`1px solid var(--border)`};return(0,s.jsxs)(`div`,{children:[(0,s.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4 mb-6`,children:[(0,s.jsx)(c,{label:`Projects`,value:String(t.length)}),(0,s.jsx)(c,{label:`Total Sessions`,value:String(m.sessions)}),(0,s.jsx)(c,{label:`Tokens Saved`,value:`~${a(m.saved)}`,accent:!0}),(0,s.jsx)(c,{label:`Open Bugs`,value:String(m.bugs)})]}),(0,s.jsx)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:(0,s.jsx)(`div`,{className:`overflow-x-auto`,children:(0,s.jsxs)(`table`,{className:`w-full text-sm`,style:{borderCollapse:`collapse`},children:[(0,s.jsx)(`thead`,{children:(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`th`,{style:h,children:`Project`}),(0,s.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Sessions`}),(0,s.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Tokens`}),(0,s.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Saved`}),(0,s.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Bugs`}),(0,s.jsx)(`th`,{style:h,children:`Last activity`}),(0,s.jsx)(`th`,{style:h})]})}),(0,s.jsx)(`tbody`,{children:p.map(e=>{let t=d&&e.root===d;return(0,s.jsxs)(`tr`,{style:{background:t?`var(--bg-surface-hover)`:`transparent`},children:[(0,s.jsxs)(`td`,{style:g,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsx)(`span`,{style:{color:`var(--text-primary)`,fontWeight:500},children:e.name}),t&&(0,s.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded`,style:{background:`var(--accent)`,color:`#fff`},children:`current`}),!e.exists&&(0,s.jsx)(`span`,{className:`text-xs`,style:{color:`var(--danger)`},children:`missing`})]}),(0,s.jsx)(`div`,{className:`text-xs truncate`,style:{color:`var(--text-faint)`,maxWidth:320},title:e.root,children:e.root})]}),(0,s.jsx)(`td`,{style:{...g,textAlign:`right`},children:e.total_sessions}),(0,s.jsx)(`td`,{style:{...g,textAlign:`right`},children:a(e.total_tokens_estimated)}),(0,s.jsxs)(`td`,{style:{...g,textAlign:`right`,color:`var(--accent)`},children:[`~`,a(e.estimated_savings)]}),(0,s.jsx)(`td`,{style:{...g,textAlign:`right`,color:e.open_bugs>0?`var(--text-primary)`:`var(--text-faint)`},children:e.open_bugs}),(0,s.jsx)(`td`,{style:{...g,color:`var(--text-muted)`},children:e.last_activity?i(e.last_activity):`—`}),(0,s.jsx)(`td`,{style:g,children:!t&&e.exists&&(0,s.jsx)(`button`,{onClick:()=>f(e.root),className:`text-xs px-2 py-1 rounded-md transition-colors`,style:{background:`var(--bg-base)`,border:`1px solid var(--border)`,color:`var(--text-secondary)`},children:`Open`})})]},e.root)})})]})})}),(0,s.jsx)(`p`,{className:`text-xs mt-3`,style:{color:`var(--text-faint)`},children:`Aggregated across all registered OpenWolf projects. "Open" switches the daemon to that project.`})]})}export{l as ProjectsAggregate};
1
+ import{a as e,c as t,r as n,t as r}from"./index-DQE5H-ct.js";import{i,r as a}from"./utils-BqE_aDxV.js";var o=t(e(),1),s=n();function c({label:e,value:t,accent:n}){return(0,s.jsxs)(`div`,{className:`rounded-xl p-5`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:[(0,s.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:e}),(0,s.jsx)(`p`,{className:`text-2xl font-bold mt-1`,style:{color:n?`var(--accent)`:`var(--text-primary)`},children:t})]})}function l({data:e}){let[t,n]=(0,o.useState)(null),[l,u]=(0,o.useState)(null),d=e.project.root;(0,o.useEffect)(()=>{let e=!1;return r(`/api/aggregate`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(t=>{e||n(t.projects||[])}).catch(t=>{e||u(String(t?.message||t))}),()=>{e=!0}},[]);let f=e=>{r(`/api/switch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({root:e})}).then(e=>{e.ok&&location.reload()})};if(l)return(0,s.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--danger)`},children:[`Could not load projects: `,l]});if(!t)return(0,s.jsx)(`p`,{className:`text-sm`,style:{color:`var(--text-muted)`},children:`Loading projects…`});let p=[...t].sort((e,t)=>(t.last_activity||``).localeCompare(e.last_activity||``)),m=t.reduce((e,t)=>({sessions:e.sessions+t.total_sessions,saved:e.saved+t.estimated_savings,bugs:e.bugs+t.open_bugs}),{sessions:0,saved:0,bugs:0}),h={color:`var(--text-muted)`,fontWeight:500,textAlign:`left`,padding:`0.5rem 0.75rem`},g={color:`var(--text-secondary)`,padding:`0.5rem 0.75rem`,borderTop:`1px solid var(--border)`};return(0,s.jsxs)(`div`,{children:[(0,s.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4 mb-6`,children:[(0,s.jsx)(c,{label:`Projects`,value:String(t.length)}),(0,s.jsx)(c,{label:`Total Sessions`,value:String(m.sessions)}),(0,s.jsx)(c,{label:`Tokens Saved`,value:`~${a(m.saved)}`,accent:!0}),(0,s.jsx)(c,{label:`Open Bugs`,value:String(m.bugs)})]}),(0,s.jsx)(`div`,{className:`rounded-xl overflow-hidden`,style:{background:`var(--bg-surface)`,border:`1px solid var(--border)`},children:(0,s.jsx)(`div`,{className:`overflow-x-auto`,children:(0,s.jsxs)(`table`,{className:`w-full text-sm`,style:{borderCollapse:`collapse`},children:[(0,s.jsx)(`thead`,{children:(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`th`,{style:h,children:`Project`}),(0,s.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Sessions`}),(0,s.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Tokens`}),(0,s.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Saved`}),(0,s.jsx)(`th`,{style:{...h,textAlign:`right`},children:`Bugs`}),(0,s.jsx)(`th`,{style:h,children:`Last activity`}),(0,s.jsx)(`th`,{style:h})]})}),(0,s.jsx)(`tbody`,{children:p.map(e=>{let t=d&&e.root===d;return(0,s.jsxs)(`tr`,{style:{background:t?`var(--bg-surface-hover)`:`transparent`},children:[(0,s.jsxs)(`td`,{style:g,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsx)(`span`,{style:{color:`var(--text-primary)`,fontWeight:500},children:e.name}),t&&(0,s.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded`,style:{background:`var(--accent)`,color:`#fff`},children:`current`}),!e.exists&&(0,s.jsx)(`span`,{className:`text-xs`,style:{color:`var(--danger)`},children:`missing`})]}),(0,s.jsx)(`div`,{className:`text-xs truncate`,style:{color:`var(--text-faint)`,maxWidth:320},title:e.root,children:e.root})]}),(0,s.jsx)(`td`,{style:{...g,textAlign:`right`},children:e.total_sessions}),(0,s.jsx)(`td`,{style:{...g,textAlign:`right`},children:a(e.total_tokens_estimated)}),(0,s.jsxs)(`td`,{style:{...g,textAlign:`right`,color:`var(--accent)`},children:[`~`,a(e.estimated_savings)]}),(0,s.jsx)(`td`,{style:{...g,textAlign:`right`,color:e.open_bugs>0?`var(--text-primary)`:`var(--text-faint)`},children:e.open_bugs}),(0,s.jsx)(`td`,{style:{...g,color:`var(--text-muted)`},children:e.last_activity?i(e.last_activity):`—`}),(0,s.jsx)(`td`,{style:g,children:!t&&e.exists&&(0,s.jsx)(`button`,{onClick:()=>f(e.root),className:`text-xs px-2 py-1 rounded-md transition-colors`,style:{background:`var(--bg-base)`,border:`1px solid var(--border)`,color:`var(--text-secondary)`},children:`Open`})})]},e.root)})})]})})}),(0,s.jsx)(`p`,{className:`text-xs mt-3`,style:{color:`var(--text-faint)`},children:`Aggregated across all registered OpenWolf projects. "Open" switches the daemon to that project.`})]})}export{l as ProjectsAggregate};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./index-CCxQQi4q.js";import{t as n}from"./utils-BqE_aDxV.js";e();var r=t(),i={healthy:`bg-emerald-500/20 text-emerald-400 border-emerald-500/30`,running:`bg-emerald-500/20 text-emerald-400 border-emerald-500/30`,success:`bg-emerald-500/20 text-emerald-400 border-emerald-500/30`,ok:`bg-emerald-500/20 text-emerald-400 border-emerald-500/30`,enabled:`bg-emerald-500/20 text-emerald-400 border-emerald-500/30`,warning:`bg-amber-500/20 text-amber-400 border-amber-500/30`,retrying:`bg-amber-500/20 text-amber-400 border-amber-500/30`,degraded:`bg-amber-500/20 text-amber-400 border-amber-500/30`,error:`bg-red-500/20 text-red-400 border-red-500/30`,failed:`bg-red-500/20 text-red-400 border-red-500/30`,stopped:`bg-red-500/20 text-red-400 border-red-500/30`,disabled:`bg-zinc-500/20 text-zinc-400 border-zinc-500/30`,unknown:`bg-zinc-500/20 text-zinc-400 border-zinc-500/30`,initialized:`bg-blue-500/20 text-blue-400 border-blue-500/30`};function a({status:e,className:t}){return(0,r.jsxs)(`span`,{className:n(`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border`,i[e.toLowerCase()]||i.unknown,t),children:[e===`running`||e===`healthy`?(0,r.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-emerald-400 mr-1.5 pulse-green`}):null,e.charAt(0).toUpperCase()+e.slice(1)]})}export{a as t};
1
+ import{a as e,r as t}from"./index-DQE5H-ct.js";import{t as n}from"./utils-BqE_aDxV.js";e();var r=t(),i={healthy:`bg-emerald-500/20 text-emerald-400 border-emerald-500/30`,running:`bg-emerald-500/20 text-emerald-400 border-emerald-500/30`,success:`bg-emerald-500/20 text-emerald-400 border-emerald-500/30`,ok:`bg-emerald-500/20 text-emerald-400 border-emerald-500/30`,enabled:`bg-emerald-500/20 text-emerald-400 border-emerald-500/30`,warning:`bg-amber-500/20 text-amber-400 border-amber-500/30`,retrying:`bg-amber-500/20 text-amber-400 border-amber-500/30`,degraded:`bg-amber-500/20 text-amber-400 border-amber-500/30`,error:`bg-red-500/20 text-red-400 border-red-500/30`,failed:`bg-red-500/20 text-red-400 border-red-500/30`,stopped:`bg-red-500/20 text-red-400 border-red-500/30`,disabled:`bg-zinc-500/20 text-zinc-400 border-zinc-500/30`,unknown:`bg-zinc-500/20 text-zinc-400 border-zinc-500/30`,initialized:`bg-blue-500/20 text-blue-400 border-blue-500/30`};function a({status:e,className:t}){return(0,r.jsxs)(`span`,{className:n(`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border`,i[e.toLowerCase()]||i.unknown,t),children:[e===`running`||e===`healthy`?(0,r.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-emerald-400 mr-1.5 pulse-green`}):null,e.charAt(0).toUpperCase()+e.slice(1)]})}export{a as t};