memindex 1.2.0 → 1.4.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.qoder-plugin/plugin.json +1 -1
- package/README.md +85 -41
- package/THIRD_PARTY_LICENSES +30 -0
- package/dist/bug-report/index.js +63 -63
- package/dist/npx-cli/index.js +417 -317
- package/dist/opencode-plugin/index.js +34 -34
- package/dist/pi-extension/index.js +6 -6
- package/integrations/dsh/lib/index.js +24 -24
- package/integrations/dsh/package.json +1 -1
- package/integrations/hermes/memindex/client.py +11 -6
- package/integrations/omp/hooks/memindex.ts +5 -1
- package/integrations/openclaw/TESTING.md +1 -1
- package/integrations/openclaw/dist/index.js +9 -9
- package/integrations/openclaw/e2e-verify.sh +8 -1
- package/integrations/openclaw/openclaw.plugin.json +1 -1
- package/integrations/openclaw/src/index.test.ts +3 -1
- package/integrations/openclaw/src/index.ts +15 -5
- package/package.json +2 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.qoder-plugin/plugin.json +1 -1
- package/plugin/hooks.json +1 -13
- package/plugin/package.json +1 -1
- package/plugin/scripts/context-generator.cjs +72 -60
- package/plugin/scripts/context-generator.cjs.map +3 -3
- package/plugin/scripts/mcp-server.cjs +68 -68
- package/plugin/scripts/mcp-server.cjs.map +3 -3
- package/plugin/scripts/statusline.cjs +1 -0
- package/plugin/scripts/transcript-watcher.cjs +35 -35
- package/plugin/scripts/transcript-watcher.cjs.map +3 -3
- package/plugin/scripts/worker-service.cjs +655 -595
- package/plugin/scripts/worker-service.cjs.map +3 -3
- package/plugin/skills/cloud-sync/SKILL.md +5 -2
- package/plugin/skills/mode-creator/SKILL.md +1 -1
- package/plugin/skills/timeline-report/SKILL.md +8 -5
- package/plugin/skills/weekly-digests/SKILL.md +5 -2
- package/plugin/sqlite/SessionStore.js +247 -229
- package/plugin/sqlite/SessionStore.js.map +3 -3
- package/plugin/ui/tv.html +55 -28
- package/plugin/ui/viewer-bundle.js +22 -15
- package/plugin/ui/viewer.html +72 -0
package/plugin/ui/tv.html
CHANGED
|
@@ -152,6 +152,13 @@
|
|
|
152
152
|
// Shared secret for remote (non-loopback) access. Loopback never needs it.
|
|
153
153
|
// Held by the bookmark only — deliberately never stored and never logged.
|
|
154
154
|
const TOKEN = params.get('token') || '';
|
|
155
|
+
// On this machine the page is opened from MemIndex with the install secret in the link's
|
|
156
|
+
// fragment (never sent to a server). The worker wants it on every read.
|
|
157
|
+
const SECRET = (() => {
|
|
158
|
+
const found = new URLSearchParams(location.hash.slice(1)).get('worker-secret') || '';
|
|
159
|
+
return /^[a-f0-9]{64}$/.test(found) ? found : '';
|
|
160
|
+
})();
|
|
161
|
+
const READ_HEADERS = SECRET ? { 'X-Memindex-Secret': SECRET } : {};
|
|
155
162
|
|
|
156
163
|
const els = {
|
|
157
164
|
stage: document.getElementById('stage'),
|
|
@@ -297,7 +304,7 @@
|
|
|
297
304
|
if (source) qs.set('platformSource', source);
|
|
298
305
|
if (TOKEN) qs.set('token', TOKEN);
|
|
299
306
|
try {
|
|
300
|
-
const res = await fetch('/api/observations?' + qs.toString(), { cache: 'no-store' });
|
|
307
|
+
const res = await fetch('/api/observations?' + qs.toString(), { cache: 'no-store', headers: READ_HEADERS });
|
|
301
308
|
if (!res.ok) return;
|
|
302
309
|
const body = await res.json();
|
|
303
310
|
// The API returns newest first; the TV plays oldest first so the backlog
|
|
@@ -308,34 +315,54 @@
|
|
|
308
315
|
}
|
|
309
316
|
}
|
|
310
317
|
|
|
311
|
-
function
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
318
|
+
function handleStreamMessage(text) {
|
|
319
|
+
let data;
|
|
320
|
+
try {
|
|
321
|
+
data = JSON.parse(text);
|
|
322
|
+
} catch {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
if (data.type !== 'new_observation' || !data.observation) return;
|
|
326
|
+
if (!matchesFilter(data.observation)) return;
|
|
327
|
+
const item = normalize(data.observation);
|
|
328
|
+
if (!item) return;
|
|
329
|
+
live.push(item);
|
|
330
|
+
replay.push(item);
|
|
331
|
+
if (replay.length > 100) replay.shift();
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// EventSource cannot send the install secret header, so the stream is read with fetch.
|
|
335
|
+
// A remote stream carries its token in the query string instead.
|
|
336
|
+
async function connect() {
|
|
337
|
+
try {
|
|
338
|
+
const res = await fetch('/stream' + (TOKEN ? '?token=' + encodeURIComponent(TOKEN) : ''), {
|
|
339
|
+
headers: { Accept: 'text/event-stream', ...READ_HEADERS },
|
|
340
|
+
});
|
|
341
|
+
if (!res.ok || !res.body) throw new Error('stream ' + res.status);
|
|
342
|
+
els.dot.classList.add('live');
|
|
343
|
+
const reader = res.body.getReader();
|
|
344
|
+
const decoder = new TextDecoder();
|
|
345
|
+
let buffer = '';
|
|
346
|
+
for (;;) {
|
|
347
|
+
const { done, value } = await reader.read();
|
|
348
|
+
if (done) break;
|
|
349
|
+
buffer += decoder.decode(value, { stream: true }).replace(/\r\n?/g, '\n');
|
|
350
|
+
let end = buffer.indexOf('\n\n');
|
|
351
|
+
while (end !== -1) {
|
|
352
|
+
const text = buffer.slice(0, end).split('\n')
|
|
353
|
+
.filter(line => line.startsWith('data:'))
|
|
354
|
+
.map(line => line.slice(5).replace(/^ /, ''))
|
|
355
|
+
.join('\n');
|
|
356
|
+
buffer = buffer.slice(end + 2);
|
|
357
|
+
if (text) handleStreamMessage(text);
|
|
358
|
+
end = buffer.indexOf('\n\n');
|
|
359
|
+
}
|
|
330
360
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
replay.push(item);
|
|
337
|
-
if (replay.length > 100) replay.shift();
|
|
338
|
-
};
|
|
361
|
+
} catch {
|
|
362
|
+
// Fall through to the reconnect below.
|
|
363
|
+
}
|
|
364
|
+
els.dot.classList.remove('live');
|
|
365
|
+
setTimeout(connect, 3000);
|
|
339
366
|
}
|
|
340
367
|
|
|
341
368
|
/* Picture-in-picture, two routes and no library. Document PiP (Chromium)
|