@phmotad/fire-code 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<a href="LICENSE">
|
|
9
9
|
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT">
|
|
10
10
|
</a>
|
|
11
|
-
<img src="https://img.shields.io/badge/version-0.2.
|
|
11
|
+
<img src="https://img.shields.io/badge/version-0.2.1-green.svg" alt="Version">
|
|
12
12
|
<img src="https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen.svg" alt="Node">
|
|
13
13
|
<img src="https://img.shields.io/badge/MCP-compatible-red.svg" alt="MCP">
|
|
14
14
|
<img src="https://img.shields.io/badge/Claude%20Code-plugin-orange.svg" alt="Claude Code Plugin">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DaemonServer.d.ts","sourceRoot":"","sources":["../../src/daemon/DaemonServer.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW,QAAQ,CAAC;AACjC,eAAO,MAAM,WAAW,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"DaemonServer.d.ts","sourceRoot":"","sources":["../../src/daemon/DaemonServer.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW,QAAQ,CAAC;AACjC,eAAO,MAAM,WAAW,cAAc,CAAC;AAsTvC,qBAAa,YAAY;IAKX,OAAO,CAAC,GAAG;IAJvB,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,SAAS,CAAc;gBAEX,GAAG,EAAE,MAAM;IAK/B,OAAO,CAAC,WAAW;IAgEb,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAW5B,IAAI,IAAI,IAAI;CAIb;AAID,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIpD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAE7D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKxD;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CASpD"}
|
|
@@ -19,98 +19,300 @@ const get_context_js_1 = require("../mcp/tools/get_context.js");
|
|
|
19
19
|
exports.DAEMON_PORT = 37778;
|
|
20
20
|
exports.DAEMON_HOST = '127.0.0.1';
|
|
21
21
|
// ── Web Dashboard HTML ─────────────────────────────────────────────────────
|
|
22
|
+
function esc(s) {
|
|
23
|
+
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
24
|
+
}
|
|
22
25
|
function buildDashboardHtml(db, project, cwd) {
|
|
23
|
-
const sessions = db.getSessions(project,
|
|
24
|
-
const observations = db.getObservations({ project, limit:
|
|
25
|
-
const corpusItems = db.getCorpus({ project, limit:
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
const sessionHtml = sessions.map(s => {
|
|
40
|
-
const start = new Date(s.started_at).toLocaleString();
|
|
41
|
-
const badge = s.status === 'active' ? '<span class="badge active">active</span>' : '<span class="badge">done</span>';
|
|
42
|
-
return `<li class="session">${badge} <strong>${s.id.slice(0, 8)}</strong> <small>${start}</small></li>`;
|
|
43
|
-
}).join('');
|
|
44
|
-
const corpusHtml = corpusItems.map(c => `<li class="corpus-item">
|
|
45
|
-
<strong>${c.title}</strong>
|
|
46
|
-
<small class="file">${c.source ?? ''}</small>
|
|
47
|
-
<p>${c.content.slice(0, 120)}…</p>
|
|
48
|
-
</li>`).join('') || '<li>No corpus items yet. Run <code>fire-code corpus build</code></li>';
|
|
26
|
+
const sessions = db.getSessions(project, 50);
|
|
27
|
+
const observations = db.getObservations({ project, limit: 100 });
|
|
28
|
+
const corpusItems = db.getCorpus({ project, limit: 50 });
|
|
29
|
+
const obsJson = JSON.stringify(observations.map(o => ({
|
|
30
|
+
id: o.id, type: o.type, summary: esc(o.summary),
|
|
31
|
+
file: o.file_path ? esc(o.file_path) : null,
|
|
32
|
+
date: new Date(o.created_at).toLocaleString(),
|
|
33
|
+
})));
|
|
34
|
+
const sessJson = JSON.stringify(sessions.map(s => ({
|
|
35
|
+
id: s.id.slice(0, 8), status: s.status,
|
|
36
|
+
start: new Date(s.started_at).toLocaleString(),
|
|
37
|
+
})));
|
|
38
|
+
const corpJson = JSON.stringify(corpusItems.map(c => ({
|
|
39
|
+
title: esc(c.title), source: c.source ? esc(c.source) : '',
|
|
40
|
+
preview: esc(c.content.slice(0, 150)),
|
|
41
|
+
})));
|
|
49
42
|
return `<!DOCTYPE html>
|
|
50
43
|
<html lang="en">
|
|
51
44
|
<head>
|
|
52
45
|
<meta charset="UTF-8">
|
|
53
46
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
54
|
-
<title>🔥 Fire Code — ${project}</title>
|
|
47
|
+
<title>🔥 Fire Code — ${esc(project)}</title>
|
|
55
48
|
<style>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
49
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
50
|
+
:root{
|
|
51
|
+
--bg:#0d1117;--surface:#161b22;--surface2:#1c2128;--border:#30363d;
|
|
52
|
+
--text:#c9d1d9;--muted:#8b949e;--accent:#ff6b35;--accent2:#e5531a;
|
|
53
|
+
--green:#3fb950;--blue:#58a6ff;--yellow:#d29922;--purple:#bc8cff;--red:#f85149;
|
|
54
|
+
}
|
|
55
|
+
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text);height:100vh;display:flex;flex-direction:column;overflow:hidden}
|
|
56
|
+
/* Header */
|
|
57
|
+
.header{display:flex;align-items:center;gap:12px;padding:12px 20px;background:var(--surface);border-bottom:1px solid var(--border);flex-shrink:0}
|
|
58
|
+
.logo{font-size:1.25rem;font-weight:700;color:var(--accent);letter-spacing:-.02em}
|
|
59
|
+
.project-badge{background:var(--surface2);border:1px solid var(--border);border-radius:20px;padding:3px 10px;font-size:.78rem;color:var(--muted)}
|
|
60
|
+
.header-right{margin-left:auto;display:flex;align-items:center;gap:8px}
|
|
61
|
+
.status-dot{width:7px;height:7px;border-radius:50%;background:var(--green);flex-shrink:0}
|
|
62
|
+
.status-label{font-size:.75rem;color:var(--muted)}
|
|
63
|
+
.btn{padding:5px 12px;border-radius:6px;border:1px solid var(--border);background:var(--surface2);color:var(--text);font-size:.78rem;cursor:pointer;transition:background .15s}
|
|
64
|
+
.btn:hover{background:var(--border)}
|
|
65
|
+
.btn.primary{background:var(--accent);border-color:var(--accent2);color:#fff}
|
|
66
|
+
.btn.primary:hover{background:var(--accent2)}
|
|
67
|
+
.btn.danger{border-color:#6e3737;color:var(--red)}
|
|
68
|
+
.btn.loading{opacity:.6;pointer-events:none}
|
|
69
|
+
/* Stats bar */
|
|
70
|
+
.stats-bar{display:flex;gap:0;border-bottom:1px solid var(--border);flex-shrink:0}
|
|
71
|
+
.stat{flex:1;padding:10px 16px;border-right:1px solid var(--border);font-size:.78rem;color:var(--muted)}
|
|
72
|
+
.stat:last-child{border-right:none}
|
|
73
|
+
.stat strong{display:block;font-size:1.1rem;color:var(--text);font-weight:600}
|
|
74
|
+
/* Layout */
|
|
75
|
+
.layout{display:flex;flex:1;overflow:hidden}
|
|
76
|
+
/* Sidebar */
|
|
77
|
+
.sidebar{width:180px;background:var(--surface);border-right:1px solid var(--border);padding:12px 0;flex-shrink:0}
|
|
78
|
+
.nav-item{display:flex;align-items:center;gap:8px;padding:8px 16px;font-size:.83rem;cursor:pointer;border-radius:0;color:var(--muted);transition:all .15s;border-left:2px solid transparent}
|
|
79
|
+
.nav-item:hover{color:var(--text);background:var(--surface2)}
|
|
80
|
+
.nav-item.active{color:var(--accent);background:var(--surface2);border-left-color:var(--accent)}
|
|
81
|
+
.nav-icon{font-size:.95rem;width:16px;text-align:center}
|
|
82
|
+
.nav-divider{height:1px;background:var(--border);margin:8px 0}
|
|
83
|
+
/* Main */
|
|
84
|
+
.main{flex:1;overflow-y:auto;padding:20px}
|
|
85
|
+
.panel{display:none}
|
|
86
|
+
.panel.active{display:block}
|
|
87
|
+
/* Search + filter */
|
|
88
|
+
.toolbar{display:flex;gap:8px;margin-bottom:16px;align-items:center}
|
|
89
|
+
.search-input{flex:1;padding:7px 12px;background:var(--surface);border:1px solid var(--border);border-radius:6px;color:var(--text);font-size:.83rem;outline:none}
|
|
90
|
+
.search-input:focus{border-color:var(--accent)}
|
|
91
|
+
.filter-btn{padding:5px 10px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--muted);font-size:.75rem;cursor:pointer;transition:all .15s}
|
|
92
|
+
.filter-btn:hover,.filter-btn.active{background:var(--surface2);color:var(--text);border-color:var(--accent)}
|
|
93
|
+
/* Cards */
|
|
94
|
+
.obs-list,.corpus-list,.session-list{display:flex;flex-direction:column;gap:2px}
|
|
95
|
+
.obs-card{display:flex;gap:10px;padding:10px 12px;background:var(--surface);border:1px solid var(--border);border-radius:7px;transition:border-color .15s}
|
|
96
|
+
.obs-card:hover{border-color:#444c56}
|
|
97
|
+
.obs-icon{font-size:1rem;flex-shrink:0;margin-top:1px;width:20px;text-align:center}
|
|
98
|
+
.obs-content{flex:1;min-width:0}
|
|
99
|
+
.obs-summary{font-size:.85rem;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
100
|
+
.obs-meta{display:flex;gap:8px;margin-top:3px;font-size:.72rem;color:var(--muted)}
|
|
101
|
+
.obs-file{color:var(--blue);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px}
|
|
102
|
+
.type-badge{padding:1px 6px;border-radius:10px;font-size:.68rem;font-weight:500;flex-shrink:0}
|
|
103
|
+
.type-change{background:#1a3048;color:var(--blue)}
|
|
104
|
+
.type-bugfix{background:#3d1a1a;color:var(--red)}
|
|
105
|
+
.type-feature{background:#1a3d1a;color:var(--green)}
|
|
106
|
+
.type-refactor{background:#2d1a3d;color:var(--purple)}
|
|
107
|
+
.type-decision{background:#3d2d1a;color:var(--yellow)}
|
|
108
|
+
.type-discovery{background:#1a2d3d;color:#79c0ff}
|
|
109
|
+
/* Corpus */
|
|
110
|
+
.corpus-card{padding:12px;background:var(--surface);border:1px solid var(--border);border-radius:7px;margin-bottom:2px}
|
|
111
|
+
.corpus-title{font-size:.88rem;font-weight:600;margin-bottom:4px}
|
|
112
|
+
.corpus-source{font-size:.72rem;color:var(--blue);margin-bottom:6px}
|
|
113
|
+
.corpus-preview{font-size:.78rem;color:var(--muted);line-height:1.5}
|
|
114
|
+
/* Sessions */
|
|
115
|
+
.session-card{display:flex;align-items:center;gap:10px;padding:8px 12px;background:var(--surface);border:1px solid var(--border);border-radius:7px}
|
|
116
|
+
.sess-id{font-family:monospace;font-size:.82rem}
|
|
117
|
+
.sess-status{padding:2px 7px;border-radius:10px;font-size:.68rem;font-weight:500}
|
|
118
|
+
.sess-active{background:#1a4731;color:var(--green)}
|
|
119
|
+
.sess-done{background:var(--surface2);color:var(--muted)}
|
|
120
|
+
.sess-time{margin-left:auto;font-size:.72rem;color:var(--muted)}
|
|
121
|
+
/* Empty */
|
|
122
|
+
.empty{text-align:center;padding:48px 24px;color:var(--muted);font-size:.85rem}
|
|
123
|
+
.empty-icon{font-size:2rem;margin-bottom:12px}
|
|
124
|
+
code{background:var(--surface2);border:1px solid var(--border);padding:2px 6px;border-radius:4px;font-size:.8rem;font-family:monospace}
|
|
125
|
+
/* Scrollbar */
|
|
126
|
+
::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
|
|
127
|
+
/* Toast */
|
|
128
|
+
.toast{position:fixed;bottom:20px;right:20px;background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:10px 16px;font-size:.82rem;box-shadow:0 4px 20px rgba(0,0,0,.5);transform:translateY(80px);opacity:0;transition:all .3s;z-index:999}
|
|
129
|
+
.toast.show{transform:translateY(0);opacity:1}
|
|
130
|
+
.toast.success{border-color:var(--green);color:var(--green)}
|
|
131
|
+
.toast.error{border-color:var(--red);color:var(--red)}
|
|
84
132
|
</style>
|
|
85
133
|
</head>
|
|
86
134
|
<body>
|
|
87
|
-
<
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
<div class="
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
135
|
+
<div class="header">
|
|
136
|
+
<span class="logo">🔥 Fire Code</span>
|
|
137
|
+
<span class="project-badge">${esc(project)}</span>
|
|
138
|
+
<div class="header-right">
|
|
139
|
+
<span class="status-dot" id="dot"></span>
|
|
140
|
+
<span class="status-label" id="statusLabel">running</span>
|
|
141
|
+
<button class="btn" onclick="doRefresh()" id="refreshBtn">↻ Refresh</button>
|
|
142
|
+
<button class="btn primary" onclick="doReindex()" id="reindexBtn">⚡ Re-index</button>
|
|
143
|
+
</div>
|
|
95
144
|
</div>
|
|
96
145
|
|
|
97
|
-
<div class="
|
|
98
|
-
<div class="
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
<
|
|
108
|
-
<
|
|
109
|
-
|
|
146
|
+
<div class="stats-bar">
|
|
147
|
+
<div class="stat"><strong id="statObs">${observations.length}</strong>Observations</div>
|
|
148
|
+
<div class="stat"><strong id="statSess">${sessions.length}</strong>Sessions</div>
|
|
149
|
+
<div class="stat"><strong id="statCorpus">${corpusItems.length}</strong>Corpus items</div>
|
|
150
|
+
<div class="stat"><strong id="statUptime">–</strong>Uptime</div>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<div class="layout">
|
|
154
|
+
<nav class="sidebar">
|
|
155
|
+
<div class="nav-item active" onclick="showPanel('obs',this)"><span class="nav-icon">👁</span>Observations</div>
|
|
156
|
+
<div class="nav-item" onclick="showPanel('corpus',this)"><span class="nav-icon">📚</span>Corpus</div>
|
|
157
|
+
<div class="nav-item" onclick="showPanel('sessions',this)"><span class="nav-icon">💬</span>Sessions</div>
|
|
158
|
+
<div class="nav-divider"></div>
|
|
159
|
+
<div class="nav-item" onclick="window.open('https://github.com/phmotad/fire-code','_blank')"><span class="nav-icon">★</span>GitHub</div>
|
|
160
|
+
<div class="nav-item" onclick="window.open('https://www.npmjs.com/package/@phmotad/fire-code','_blank')"><span class="nav-icon">📦</span>npm</div>
|
|
161
|
+
</nav>
|
|
162
|
+
|
|
163
|
+
<main class="main">
|
|
164
|
+
<!-- Observations panel -->
|
|
165
|
+
<div class="panel active" id="panel-obs">
|
|
166
|
+
<div class="toolbar">
|
|
167
|
+
<input class="search-input" placeholder="Search observations…" oninput="renderObs(this.value,activeType)" id="obsSearch">
|
|
168
|
+
<button class="filter-btn active" onclick="filterType('',this)">All</button>
|
|
169
|
+
<button class="filter-btn" onclick="filterType('feature',this)">✨ feature</button>
|
|
170
|
+
<button class="filter-btn" onclick="filterType('bugfix',this)">🐛 bugfix</button>
|
|
171
|
+
<button class="filter-btn" onclick="filterType('change',this)">✏️ change</button>
|
|
172
|
+
<button class="filter-btn" onclick="filterType('decision',this)">🧭 decision</button>
|
|
173
|
+
<button class="filter-btn" onclick="filterType('refactor',this)">♻️ refactor</button>
|
|
174
|
+
</div>
|
|
175
|
+
<div class="obs-list" id="obsList"></div>
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<!-- Corpus panel -->
|
|
179
|
+
<div class="panel" id="panel-corpus">
|
|
180
|
+
<div class="toolbar">
|
|
181
|
+
<input class="search-input" placeholder="Search corpus…" oninput="renderCorpus(this.value)" id="corpusSearch">
|
|
182
|
+
</div>
|
|
183
|
+
<div class="corpus-list" id="corpusList"></div>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<!-- Sessions panel -->
|
|
187
|
+
<div class="panel" id="panel-sessions">
|
|
188
|
+
<div class="session-list" id="sessionList"></div>
|
|
189
|
+
</div>
|
|
190
|
+
</main>
|
|
110
191
|
</div>
|
|
111
192
|
|
|
193
|
+
<div class="toast" id="toast"></div>
|
|
194
|
+
|
|
112
195
|
<script>
|
|
113
|
-
|
|
196
|
+
const OBS = ${obsJson};
|
|
197
|
+
const SESS = ${sessJson};
|
|
198
|
+
const CORPUS = ${corpJson};
|
|
199
|
+
const ICONS = {change:'✏️',bugfix:'🐛',feature:'✨',refactor:'♻️',decision:'🧭',discovery:'🔍'};
|
|
200
|
+
let activeType = '';
|
|
201
|
+
|
|
202
|
+
function showPanel(name, el) {
|
|
203
|
+
document.querySelectorAll('.panel').forEach(p => p.classList.remove('active'));
|
|
204
|
+
document.querySelectorAll('.nav-item').forEach(n => n.classList.remove('active'));
|
|
205
|
+
document.getElementById('panel-'+name).classList.add('active');
|
|
206
|
+
el.classList.add('active');
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function filterType(type, el) {
|
|
210
|
+
activeType = type;
|
|
211
|
+
document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
|
|
212
|
+
el.classList.add('active');
|
|
213
|
+
renderObs(document.getElementById('obsSearch').value, type);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function renderObs(q, type) {
|
|
217
|
+
const q2 = q.toLowerCase();
|
|
218
|
+
const filtered = OBS.filter(o =>
|
|
219
|
+
(!type || o.type === type) &&
|
|
220
|
+
(!q2 || o.summary.toLowerCase().includes(q2) || (o.file && o.file.toLowerCase().includes(q2)))
|
|
221
|
+
);
|
|
222
|
+
const el = document.getElementById('obsList');
|
|
223
|
+
if (!filtered.length) {
|
|
224
|
+
el.innerHTML = '<div class="empty"><div class="empty-icon">👁</div>No observations yet.<br>Claude will record changes automatically.</div>';
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
el.innerHTML = filtered.map(o => \`
|
|
228
|
+
<div class="obs-card">
|
|
229
|
+
<span class="obs-icon">\${ICONS[o.type]||'•'}</span>
|
|
230
|
+
<div class="obs-content">
|
|
231
|
+
<div class="obs-summary">\${o.summary}</div>
|
|
232
|
+
<div class="obs-meta">
|
|
233
|
+
<span class="type-badge type-\${o.type}">\${o.type}</span>
|
|
234
|
+
\${o.file ? \`<span class="obs-file">\${o.file}</span>\` : ''}
|
|
235
|
+
<span>\${o.date}</span>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
\`).join('');
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function renderCorpus(q) {
|
|
243
|
+
const q2 = q.toLowerCase();
|
|
244
|
+
const filtered = CORPUS.filter(c =>
|
|
245
|
+
!q2 || c.title.toLowerCase().includes(q2) || c.preview.toLowerCase().includes(q2)
|
|
246
|
+
);
|
|
247
|
+
const el = document.getElementById('corpusList');
|
|
248
|
+
if (!filtered.length) {
|
|
249
|
+
el.innerHTML = '<div class="empty"><div class="empty-icon">📚</div>No corpus items yet.<br>Run <code>fire-code corpus build</code></div>';
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
el.innerHTML = filtered.map(c => \`
|
|
253
|
+
<div class="corpus-card">
|
|
254
|
+
<div class="corpus-title">\${c.title}</div>
|
|
255
|
+
\${c.source ? \`<div class="corpus-source">\${c.source}</div>\` : ''}
|
|
256
|
+
<div class="corpus-preview">\${c.preview}\${c.preview.length >= 150 ? '…' : ''}</div>
|
|
257
|
+
</div>
|
|
258
|
+
\`).join('');
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function renderSessions() {
|
|
262
|
+
const el = document.getElementById('sessionList');
|
|
263
|
+
if (!SESS.length) {
|
|
264
|
+
el.innerHTML = '<div class="empty"><div class="empty-icon">💬</div>No sessions yet.</div>';
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
el.innerHTML = SESS.map(s => \`
|
|
268
|
+
<div class="session-card">
|
|
269
|
+
<span class="sess-id">\${s.id}</span>
|
|
270
|
+
<span class="sess-status \${s.status==='active'?'sess-active':'sess-done'}">\${s.status}</span>
|
|
271
|
+
<span class="sess-time">\${s.start}</span>
|
|
272
|
+
</div>
|
|
273
|
+
\`).join('');
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function toast(msg, type='success') {
|
|
277
|
+
const t = document.getElementById('toast');
|
|
278
|
+
t.textContent = msg; t.className = 'toast '+type+' show';
|
|
279
|
+
setTimeout(() => t.className = 'toast', 3000);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function doRefresh() {
|
|
283
|
+
const btn = document.getElementById('refreshBtn');
|
|
284
|
+
btn.classList.add('loading'); btn.textContent = '↻ Loading…';
|
|
285
|
+
location.reload();
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
async function doReindex() {
|
|
289
|
+
const btn = document.getElementById('reindexBtn');
|
|
290
|
+
btn.classList.add('loading'); btn.textContent = '⚡ Indexing…';
|
|
291
|
+
try {
|
|
292
|
+
const r = await fetch('/index', {method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({mode:'lazy'})});
|
|
293
|
+
const d = await r.json();
|
|
294
|
+
if (d.ok) toast('Re-index complete ✓'); else toast(d.error||'Error','error');
|
|
295
|
+
} catch(e) { toast('Daemon unreachable','error'); }
|
|
296
|
+
finally { btn.classList.remove('loading'); btn.textContent = '⚡ Re-index'; }
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
async function updateUptime() {
|
|
300
|
+
try {
|
|
301
|
+
const r = await fetch('/health');
|
|
302
|
+
const d = await r.json();
|
|
303
|
+
const s = Math.floor(d.uptime/1000);
|
|
304
|
+
const h = Math.floor(s/3600), m = Math.floor((s%3600)/60);
|
|
305
|
+
document.getElementById('statUptime').textContent = h ? h+'h '+m+'m' : m+'m '+s%60+'s';
|
|
306
|
+
} catch {}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Init
|
|
310
|
+
renderObs('', '');
|
|
311
|
+
renderCorpus('');
|
|
312
|
+
renderSessions();
|
|
313
|
+
updateUptime();
|
|
314
|
+
setInterval(updateUptime, 10000);
|
|
315
|
+
setTimeout(() => location.reload(), 60000);
|
|
114
316
|
</script>
|
|
115
317
|
</body>
|
|
116
318
|
</html>`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DaemonServer.js","sourceRoot":"","sources":["../../src/daemon/DaemonServer.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"DaemonServer.js","sourceRoot":"","sources":["../../src/daemon/DaemonServer.ts"],"names":[],"mappings":";;;;;;AA6ZA,4CAIC;AAED,wCAEC;AAED,sCAKC;AAED,0CASC;AAvbD,sDAA8B;AAC9B,+BAA0D;AAC1D,2BAAwE;AACxE,+BAA4B;AAC5B,kDAA4C;AAC5C,iEAA2D;AAC3D,gDAAmD;AACnD,gEAA6D;AAEhD,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,WAAW,GAAG,WAAW,CAAC;AAEvC,8EAA8E;AAE9E,SAAS,GAAG,CAAC,CAAS;IACpB,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACtG,C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MAAM,CAAC,CAAC;AAC5D,CAAC;AAED,SAAgB,aAAa,CAAC,GAAW;IACvC,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,CAAC,IAAA,eAAU,EAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAA,iBAAY,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;AACjC,CAAC;AAED,SAAgB,eAAe,CAAC,GAAW;IACzC,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phmotad/fire-code",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Intelligent MCP execution engine for AI coding agents — persistent memory, context-aware, Git-traceable",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"openai": "^4.67.0",
|
|
82
82
|
"ora": "^8.1.0",
|
|
83
83
|
"pino": "^9.5.0",
|
|
84
|
+
"pino-pretty": "^11.3.0",
|
|
84
85
|
"simple-git": "^3.27.0",
|
|
85
86
|
"tree-sitter": "^0.25.0",
|
|
86
87
|
"tree-sitter-go": "^0.25.0",
|
|
@@ -98,7 +99,6 @@
|
|
|
98
99
|
"@types/node": "^20.0.0",
|
|
99
100
|
"cross-env": "^10.1.0",
|
|
100
101
|
"jest": "^29.7.0",
|
|
101
|
-
"pino-pretty": "^11.3.0",
|
|
102
102
|
"ts-jest": "^29.2.0",
|
|
103
103
|
"ts-node": "^10.9.2",
|
|
104
104
|
"tsup": "^8.3.0",
|