@anmol-srv/sigil 0.17.0 → 0.18.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/dist/cli.js +596 -408
- package/dist/daemon.js +298 -154
- package/dist/hooks/post-tool-use.js +25 -25
- package/dist/hooks/session-end.js +80 -69
- package/dist/hooks/stop.js +90 -79
- package/dist/hooks/user-prompt-submit.js +49 -49
- package/dist/server.js +47 -47
- package/package.json +2 -2
- package/prompts/chunk-context.md +12 -6
- package/prompts/graph-extraction.md +42 -0
- package/src/db/drivers/index.js +22 -4
- package/src/gui/web/app.css +308 -0
- package/src/gui/web/app.js +908 -15
- package/src/gui/web/index.html +77 -4
- package/src/gui/web/setup.js +12 -5
package/src/gui/web/index.html
CHANGED
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
<nav>
|
|
65
65
|
<a href="#health" data-route="health" class="active">Overview</a>
|
|
66
66
|
<a href="#kb" data-route="kb">Knowledge Base</a>
|
|
67
|
+
<a href="#graph" data-route="graph">Graph</a>
|
|
67
68
|
<a href="#devices" data-route="devices">Devices</a>
|
|
68
69
|
<a href="#activity" data-route="activity">Activity</a>
|
|
69
70
|
<a href="#setup" data-route="setup">Setup</a>
|
|
@@ -99,15 +100,87 @@
|
|
|
99
100
|
<div class="section-head">
|
|
100
101
|
<div class="title-block">
|
|
101
102
|
<h2>Knowledge Base</h2>
|
|
102
|
-
<p>
|
|
103
|
+
<p>Browse the facts, entities, and pods Sigil has stored. Select any row to inspect its provenance, links, and relations.</p>
|
|
103
104
|
</div>
|
|
104
105
|
<div class="actions"><button class="btn" id="kb-refresh">Refresh</button></div>
|
|
105
106
|
</div>
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
<!-- counts strip -->
|
|
109
|
+
<div class="kb-stats" id="kb-stats" aria-label="Knowledge base totals"></div>
|
|
108
110
|
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
+
<!-- section sub-nav -->
|
|
112
|
+
<div class="kb-subnav" role="tablist" aria-label="Knowledge base sections">
|
|
113
|
+
<button class="kb-tab active" type="button" role="tab" data-kbtab="facts" aria-selected="true">Facts</button>
|
|
114
|
+
<button class="kb-tab" type="button" role="tab" data-kbtab="entities" aria-selected="false">Entities</button>
|
|
115
|
+
<button class="kb-tab" type="button" role="tab" data-kbtab="pods" aria-selected="false">Pods</button>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<!-- FACTS -->
|
|
119
|
+
<div class="kb-panel" id="kb-tab-facts" role="tabpanel">
|
|
120
|
+
<div class="kb-browser">
|
|
121
|
+
<div class="kb-list-col">
|
|
122
|
+
<div class="kb-toolbar">
|
|
123
|
+
<input class="input kb-search" id="kb-fact-search" type="search" placeholder="Search facts…" aria-label="Search facts" autocomplete="off">
|
|
124
|
+
<span class="kb-count" id="kb-fact-count"></span>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="kb-filter-row" id="kb-fact-ns" aria-label="Namespace filter"></div>
|
|
127
|
+
<div class="kb-filter-row" id="kb-fact-cat" aria-label="Category filter"></div>
|
|
128
|
+
<div class="kb-list" id="kb-fact-list" role="listbox" aria-label="Facts"></div>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="kb-detail" id="kb-fact-detail" aria-live="polite"></div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<!-- ENTITIES -->
|
|
135
|
+
<div class="kb-panel" id="kb-tab-entities" role="tabpanel" hidden>
|
|
136
|
+
<div class="kb-browser">
|
|
137
|
+
<div class="kb-list-col">
|
|
138
|
+
<div class="kb-toolbar">
|
|
139
|
+
<input class="input kb-search" id="kb-entity-search" type="search" placeholder="Search entities by name…" aria-label="Search entities" autocomplete="off">
|
|
140
|
+
</div>
|
|
141
|
+
<div class="kb-filter-row" id="kb-entity-type" aria-label="Entity type filter"></div>
|
|
142
|
+
<div class="kb-list" id="kb-entity-list" role="listbox" aria-label="Entities"></div>
|
|
143
|
+
</div>
|
|
144
|
+
<div class="kb-detail" id="kb-entity-detail" aria-live="polite"></div>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<!-- PODS -->
|
|
149
|
+
<div class="kb-panel" id="kb-tab-pods" role="tabpanel" hidden>
|
|
150
|
+
<div class="kb-list kb-pod-list" id="kb-pod-list"></div>
|
|
151
|
+
</div>
|
|
152
|
+
</section>
|
|
153
|
+
|
|
154
|
+
<!-- ── Graph ────────────────────────────────────────────────── -->
|
|
155
|
+
<section id="view-graph" class="view">
|
|
156
|
+
<div class="section-head">
|
|
157
|
+
<div class="title-block">
|
|
158
|
+
<h2>Graph</h2>
|
|
159
|
+
<p>Every fact and entity in your memory, linked by what mentions what. Drag to explore, scroll to zoom, click a node to open it.</p>
|
|
160
|
+
</div>
|
|
161
|
+
<div class="actions">
|
|
162
|
+
<span class="graph-meta" id="graph-meta"></span>
|
|
163
|
+
<button class="btn" id="graph-relayout" title="Re-run the layout">Re-run layout</button>
|
|
164
|
+
<button class="btn" id="graph-refresh">Refresh</button>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div class="graph-stage" id="graph-stage">
|
|
169
|
+
<canvas id="graph-canvas"></canvas>
|
|
170
|
+
<div class="graph-legend" id="graph-legend" aria-hidden="true">
|
|
171
|
+
<span class="gl-item"><span class="gl-dot entity person"></span>Person</span>
|
|
172
|
+
<span class="gl-item"><span class="gl-dot entity topic"></span>Topic</span>
|
|
173
|
+
<span class="gl-item"><span class="gl-dot entity document"></span>Document</span>
|
|
174
|
+
<span class="gl-item"><span class="gl-dot fact"></span>Fact</span>
|
|
175
|
+
</div>
|
|
176
|
+
<div class="graph-zoom" role="group" aria-label="Zoom">
|
|
177
|
+
<button class="btn ghost small" id="graph-zoom-out" aria-label="Zoom out">−</button>
|
|
178
|
+
<button class="btn ghost small" id="graph-zoom-fit" aria-label="Fit to view">Fit</button>
|
|
179
|
+
<button class="btn ghost small" id="graph-zoom-in" aria-label="Zoom in">+</button>
|
|
180
|
+
</div>
|
|
181
|
+
<div class="graph-tooltip" id="graph-tooltip" hidden></div>
|
|
182
|
+
<div class="graph-overlay" id="graph-overlay"></div>
|
|
183
|
+
</div>
|
|
111
184
|
</section>
|
|
112
185
|
|
|
113
186
|
<!-- ── Devices ──────────────────────────────────────────────── -->
|
package/src/gui/web/setup.js
CHANGED
|
@@ -155,7 +155,7 @@ function renderComingSoon() {
|
|
|
155
155
|
async function renderDatabaseStep() {
|
|
156
156
|
shell({
|
|
157
157
|
title: 'Set up your database.',
|
|
158
|
-
lede: 'Sigil stores every fact and embedding in Postgres + pgvector.
|
|
158
|
+
lede: 'Sigil stores every fact and embedding in Postgres + pgvector. Use the built-in database (nothing to install), connect one you run, spin one up in Docker, or point it at a managed database.',
|
|
159
159
|
body: `<div id="setup-detect" class="setup-detect muted">Checking this machine…</div>
|
|
160
160
|
<div class="provider-card-grid" id="setup-db-modes"></div>
|
|
161
161
|
<div id="setup-fields" hidden></div>`,
|
|
@@ -166,13 +166,20 @@ async function renderDatabaseStep() {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
function renderDbModes() {
|
|
169
|
-
const det = dbDetect || { local: {}, docker: {} };
|
|
169
|
+
const det = dbDetect || { embedded: {}, local: {}, docker: {} };
|
|
170
170
|
const s = $('#setup-detect');
|
|
171
|
-
if (det.local?.running) s.innerHTML = `Found Postgres on <b>localhost:${det.local.port}</b> — pgvector ${det.local.pgvectorAvailable ? '<b>available ✓</b>' : '<b>not available</b>'}.`;
|
|
172
|
-
else if (det.local?.installed) s.
|
|
173
|
-
else s.
|
|
171
|
+
if (det.local?.running) s.innerHTML = `Found Postgres on <b>localhost:${det.local.port}</b> — pgvector ${det.local.pgvectorAvailable ? '<b>available ✓</b>' : '<b>not available</b>'}. The built-in database needs nothing installed.`;
|
|
172
|
+
else if (det.local?.installed) s.innerHTML = 'Postgres is installed but not running. The built-in database needs nothing installed.';
|
|
173
|
+
else s.innerHTML = 'No local Postgres detected — the built-in database below needs nothing installed.';
|
|
174
174
|
|
|
175
175
|
const cards = [];
|
|
176
|
+
// Embedded (PGlite) — the zero-prerequisite default. Always available: a full
|
|
177
|
+
// Postgres 17 + pgvector compiled to WASM, running in-process under ~/.sigil/db.
|
|
178
|
+
if (det.embedded?.available !== false) {
|
|
179
|
+
cards.push(card('mode', 'embedded',
|
|
180
|
+
'Use the built-in database <span class="badge info" style="margin-left:var(--s-2);">RECOMMENDED</span>',
|
|
181
|
+
'No install — Postgres + pgvector run inside Sigil, stored at ~/.sigil/db'));
|
|
182
|
+
}
|
|
176
183
|
if (det.local?.running) cards.push(card('mode', 'local', 'Connect to local Postgres', `localhost:${det.local.port} · reuse your running server`, { action: 'connect' }));
|
|
177
184
|
else if (det.local?.installed) cards.push(card('mode', 'local', 'Start & connect local Postgres', 'Start your installed Postgres, then set up', { action: 'start' }));
|
|
178
185
|
if (det.docker?.installed) {
|