openwolf-enhanced 1.19.2 → 1.20.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.
- package/CHANGELOG.md +46 -8
- package/README.md +2 -0
- package/dist/dashboard/assets/{AISuggestions-ByJakEO6.js → AISuggestions-75WddYbt.js} +1 -1
- package/dist/dashboard/assets/{ActivityLog-DSfbf3Y7.js → ActivityLog-B6By1sEc.js} +1 -1
- package/dist/dashboard/assets/{ActivityTimeline-COKzabf_.js → ActivityTimeline-DvYg5xT0.js} +1 -1
- package/dist/dashboard/assets/{AnatomyBrowser-CtwvWQhy.js → AnatomyBrowser-CSwa27Vi.js} +1 -1
- package/dist/dashboard/assets/{BugLog-B9Vd6-tR.js → BugLog-mBm25Pvv.js} +1 -1
- package/dist/dashboard/assets/{CerebrumViewer-6PqRD6jt.js → CerebrumViewer-Cz5pC4CY.js} +1 -1
- package/dist/dashboard/assets/{CronStatus-wbhU9J3E.js → CronStatus-B6lzWIhF.js} +1 -1
- package/dist/dashboard/assets/{DesignQC-CJ2hTDch.js → DesignQC-DNdtoJS7.js} +1 -1
- package/dist/dashboard/assets/{MemoryViewer-DH9JAKAk.js → MemoryViewer-Bwj9G_2g.js} +1 -1
- package/dist/dashboard/assets/{NativeMemory-BaxOcLxh.js → NativeMemory-VFafHz94.js} +1 -1
- package/dist/dashboard/assets/{ProjectOverview-BaagZDLq.js → ProjectOverview-D_oV0I_i.js} +1 -1
- package/dist/dashboard/assets/{ProjectsAggregate-CycQ5unj.js → ProjectsAggregate-D4cyc4SM.js} +1 -1
- package/dist/dashboard/assets/{StatusBadge-BcyhaVbu.js → StatusBadge-Cfs9aiVW.js} +1 -1
- package/dist/dashboard/assets/{TokenUsage-BrtsR1aL.js → TokenUsage-Vp1aAl1t.js} +1 -1
- package/dist/dashboard/assets/{index-DmU31a-B.js → index-DEjoYswR.js} +3 -3
- package/dist/dashboard/index.html +1 -1
- package/dist/src/cli/index.js +2 -0
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/recall-cmd.js +24 -1
- package/dist/src/cli/recall-cmd.js.map +1 -1
- package/dist/src/tracker/waste-detector.js +9 -3
- package/dist/src/tracker/waste-detector.js.map +1 -1
- package/dist/src/utils/embeddings.js.map +1 -1
- package/dist/src/utils/recall.js +18 -0
- package/dist/src/utils/recall.js.map +1 -1
- package/dist/src/utils/semantic-recall.js +172 -0
- package/dist/src/utils/semantic-recall.js.map +1 -0
- package/dist/src/utils/wolf-gitignore.js +2 -0
- package/dist/src/utils/wolf-gitignore.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,19 +6,57 @@ 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
|
-
## [
|
|
9
|
+
## [1.20.0] — 2026-07-21
|
|
10
10
|
|
|
11
11
|
### Added
|
|
12
12
|
|
|
13
13
|
- **Semantic recall (`openwolf recall --semantic` / `--hybrid`).** Alongside the lexical BM25 search,
|
|
14
14
|
recall can now rank by *meaning* using local embeddings — it finds conceptually related entries a
|
|
15
|
-
keyword match misses
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
semantic
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
keyword match misses (validated: "firewall rules ignored by containers" surfaces the
|
|
16
|
+
Docker-bypasses-UFW lesson at rank 1 where BM25 ranked it 6th, and German↔English queries cross
|
|
17
|
+
the language gap). `--semantic` ranks purely by cosine similarity; `--hybrid` fuses BM25 and
|
|
18
|
+
semantic rankings with Reciprocal Rank Fusion. Embeddings come from any OpenAI-compatible
|
|
19
|
+
`/embeddings` endpoint, defaulting to a **local LM Studio** server (keyless), so semantic memory
|
|
20
|
+
stays local. If the embeddings endpoint is unreachable, recall falls back to keyword search.
|
|
21
|
+
Config under `openwolf.recall.embeddings` (base_url / model). No vector database — the index is
|
|
22
|
+
two flat files in `.wolf/`, validated end-to-end on a 22,795-unit knowledge base (459 native
|
|
23
|
+
memory topic files): first build ~5 min against LM Studio, warm queries ~1.2 s.
|
|
24
|
+
|
|
25
|
+
- **Embedding index: binary sidecar, checkpointed, resumable.** Unit metadata lives in
|
|
26
|
+
`recall-embeddings.json` (~6.5 MB for 22k units), the raw Float32 vectors in
|
|
27
|
+
`recall-embeddings.vec` (~70 MB) — written atomically, checkpointed every 20 batches and on
|
|
28
|
+
failure, with a progress meter on stderr. An interrupted build resumes where it stopped (verified:
|
|
29
|
+
kill at 9.7k units → restart embedded only the remainder), and only new/changed units are
|
|
30
|
+
re-embedded per run. Both files are machine-local caches and are added to the managed
|
|
31
|
+
`.wolf/.gitignore`. A model change invalidates the cache.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- **The embedding index silently never persisted on real-world knowledge bases.** The original
|
|
36
|
+
design stored vectors inside the pretty-printed index JSON; at 22k units × 768 dims the ~544 MB
|
|
37
|
+
`JSON.stringify` output exceeds V8's maximum string length (~537 MB), the resulting `RangeError`
|
|
38
|
+
was swallowed by both write paths of `fs-safe.writeJSON`, and every semantic query re-embedded the
|
|
39
|
+
entire knowledge base from scratch (5+ minutes, with no error shown). Treacherous detail: with
|
|
40
|
+
synthetic `Math.random()` vectors the string lands ~4 % *under* the limit — only real embedding
|
|
41
|
+
values (~20–21 chars each) tip it over. The binary sidecar format above fixes this structurally,
|
|
42
|
+
and its write errors propagate instead of being swallowed.
|
|
43
|
+
|
|
44
|
+
- **RRF fusion constant retuned for two-list fusion (K=60 → K=2).** The textbook K=60 let an item
|
|
45
|
+
ranked mediocre in *both* lists (2/80) outscore the top hit of *one* list (1/61), making hybrid
|
|
46
|
+
*worse* than either method alone. Measured on a 14-query set (exact-keyword, paraphrase, and
|
|
47
|
+
cross-lingual DE↔EN) over the 22k-unit base: MRR 0.845 at K≤2 vs 0.627 at K=60 — beating pure
|
|
48
|
+
BM25 (0.726) and pure semantic (0.714). Override via `openwolf.recall.rrf_k`.
|
|
49
|
+
|
|
50
|
+
## [1.19.3] — 2026-07-20
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- **Waste detector double-counted a repeated, anatomy-described file.** 1.19.1 made both of the
|
|
55
|
+
detector's dead patterns reachable again (see 1.19.1's notes), but didn't make them mutually
|
|
56
|
+
exclusive: a file that was both read multiple times *and* had an anatomy description got charged
|
|
57
|
+
by Pattern 1 ((count-1) × tokens for the repeats) *and* Pattern 2 (a full `tokens` for "anatomy
|
|
58
|
+
would have sufficed") — summing to count × tokens, i.e. 100% of everything ever spent reading that
|
|
59
|
+
file flagged as waste. Pattern 2 now skips anything Pattern 1 already covers.
|
|
22
60
|
|
|
23
61
|
## [1.19.2] — 2026-07-20
|
|
24
62
|
|
package/README.md
CHANGED
|
@@ -50,6 +50,7 @@ Everything upstream does, plus — grouped by what it gives you:
|
|
|
50
50
|
| 🧭 **Smart session resume** | On session start a compact, token-bounded digest is injected — STATUS + Do-Not-Repeat inline, recent activity as a one-line headline, the rest as an *"Available on demand"* index — so the model continues without re-reading. |
|
|
51
51
|
| 📓 **Passive activity capture** *(opt-in)* | File edits are always journaled; enable `openwolf.capture` and a `PostToolUse:Bash` hook also appends notable commands (commits, installs, tests, builds, deploys) **and failures** to a size-capped `.wolf/activity.log` that feeds the next session's resume digest. Secrets are redacted; trivial read-only commands are dropped. Off by default. |
|
|
52
52
|
| 🔎 **Searchable memory + citations** | `openwolf recall <query>` keyword-searches STATUS / cerebrum / memory / buglog **and Claude's native Auto Memory**, **BM25-ranked** (rare terms weighted, length-normalized), returning a compact index where each hit has a stable citation id like `[c-3f9a]`. Expand one with `recall --id <id>` (or all inline with `--full`) — progressive disclosure, no database. Cite ids in notes to re-open them later; `recall --all` searches every registered project. |
|
|
53
|
+
| 🧲 **Semantic & hybrid recall** | `recall --semantic` ranks by *meaning* via local embeddings (any OpenAI-compatible `/embeddings` endpoint; defaults to keyless **LM Studio**, so memory stays local) — it finds paraphrases and crosses languages where keywords fail. `--hybrid` fuses BM25 + semantic with Reciprocal Rank Fusion; measured on a 22k-unit knowledge base it beats both alone. The vector index is two flat cache files in `.wolf/` — checkpointed, resumable, only changed entries re-embed; unreachable endpoint → clean fallback to keyword search. |
|
|
53
54
|
| 🧠 **Native-memory interop** | Reads Claude Code's own Auto Memory (read-only): `doctor` flags its blind spots (files the `MEMORY.md` index never loads, the 200-line cutoff, dead links), a dashboard panel browses it, and an **MCP server** (`openwolf mcp`) exposes recall/resume to **Claude Desktop** and other MCP clients — so OpenWolf works beyond Claude Code. |
|
|
54
55
|
| 🐝 **Beyond Claude Code** | `init`/`update` auto-detect **Codex CLI**, **Gemini CLI** and **OpenCode** and register OpenWolf's hooks there too. Codex & Gemini share Claude's hook model, so the session-start resume digest is injected and activity captured; OpenCode gets a JS-plugin adapter (compaction-time inject). Claude stays the primary target, unchanged. |
|
|
55
56
|
| 🔌 **Model-agnostic AI tasks** | The background cron engine's AI tasks default to the Anthropic API but can point at **any OpenAI-compatible endpoint** (OpenAI, Groq, Cerebras, Mistral, Qwen, a local server) via `openwolf.cron` config — `llm_provider` / `llm_base_url` / `llm_model` / `api_key_env`. No code change; existing setups keep running on Claude unchanged. |
|
|
@@ -202,6 +203,7 @@ openwolf status Show health, stats, .wolf/ footprint, size warning
|
|
|
202
203
|
openwolf doctor Report + compact .wolf/, suggest .wolfignore [--dry-run]
|
|
203
204
|
openwolf consolidate LLM-merge near-duplicate cerebrum entries [--dry-run] [--threshold N]
|
|
204
205
|
openwolf recall <query> Keyword-search .wolf + native memory; ids per hit [--limit N] [--full] [--all] [--json]
|
|
206
|
+
[--semantic] rank by meaning (local embeddings) · [--hybrid] fuse keyword + semantic
|
|
205
207
|
openwolf recall --id <id> Expand a citation id to its full entry (second disclosure layer)
|
|
206
208
|
openwolf link Link to a remote workspace [--url URL --token TOKEN] [--status] [--unlink]
|
|
207
209
|
openwolf push Offer learnings, decisions and bugs to the linked workspace [--dry-run]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,c as t,r as n}from"./index-
|
|
1
|
+
import{a as e,c as t,r as n}from"./index-DEjoYswR.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-
|
|
1
|
+
import{a as e,c as t,r as n}from"./index-DEjoYswR.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-
|
|
1
|
+
import{a as e,c as t,r as n}from"./index-DEjoYswR.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-
|
|
1
|
+
import{a as e,c as t,r as n}from"./index-DEjoYswR.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-
|
|
1
|
+
import{a as e,c as t,r as n}from"./index-DEjoYswR.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-
|
|
1
|
+
import{a as e,c as t,r as n}from"./index-DEjoYswR.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-
|
|
1
|
+
import{a as e,c as t,r as n,t as r}from"./index-DEjoYswR.js";import{i,n as a}from"./utils-BqE_aDxV.js";import{t as o}from"./StatusBadge-Cfs9aiVW.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-
|
|
1
|
+
import{a as e,c as t,n,r,t as i}from"./index-DEjoYswR.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}from"./index-
|
|
1
|
+
import{a as e,c as t,r as n}from"./index-DEjoYswR.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-DmU31a-B.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-DEjoYswR.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-
|
|
1
|
+
import{a as e,r as t}from"./index-DEjoYswR.js";import{i as n,r}from"./utils-BqE_aDxV.js";import{t as i}from"./StatusBadge-Cfs9aiVW.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};
|
package/dist/dashboard/assets/{ProjectsAggregate-CycQ5unj.js → ProjectsAggregate-D4cyc4SM.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,r as n,t as r}from"./index-
|
|
1
|
+
import{a as e,c as t,r as n,t as r}from"./index-DEjoYswR.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-
|
|
1
|
+
import{a as e,r as t}from"./index-DEjoYswR.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};
|