tr-plugin-embeddings 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +19 -2
- package/cli.mjs +310 -0
- package/package.json +18 -4
- package/plugin.json +62 -0
- package/ui/card.js +414 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Plugin authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Embeddings
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Local embedding model management: provider/model status, benchmark, index build and coverage
|
|
4
|
+
|
|
5
|
+
## Sharing
|
|
6
|
+
|
|
7
|
+
Offer it to your other Total Recall nodes over the mesh:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx total-recall plugin share embeddings
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Peers install it with `npx total-recall plugin install peer:<this-node>/embeddings`.
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- **Identifier**: `embeddings`
|
|
18
|
+
- **Version**: 0.1.0
|
|
19
|
+
- **Use cases**: operations, ai
|
|
20
|
+
- **CLI Command**: `npx total-recall embeddings`
|
package/cli.mjs
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Embeddings CLI Handler
|
|
4
|
+
* Executed via: npx total-recall embeddings <subcommand>
|
|
5
|
+
*
|
|
6
|
+
* Owns local embedding provider discovery and index coverage for a brain:
|
|
7
|
+
* which provider/model actually serves vectors, whether that model is local
|
|
8
|
+
* (no text leaves the machine, no provider spend), and how much of the vault
|
|
9
|
+
* is embedded. Building the index itself stays with `total-recall compile`,
|
|
10
|
+
* which owns the embeddings.db lifecycle.
|
|
11
|
+
*/
|
|
12
|
+
import fs from 'node:fs';
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
import { spawnSync } from 'node:child_process';
|
|
15
|
+
|
|
16
|
+
const PLUGIN_ID = 'embeddings';
|
|
17
|
+
const PLUGIN_DIR = path.dirname(new URL(import.meta.url).pathname);
|
|
18
|
+
const PLUGIN_VERSION = JSON.parse(fs.readFileSync(path.join(PLUGIN_DIR, 'plugin.json'), 'utf8')).version;
|
|
19
|
+
const DEFAULT_URL = 'http://127.0.0.1:11434';
|
|
20
|
+
const HOSTED_PROVIDERS = ['OPENROUTER_API_KEY', 'GOOGLE_API_KEY', 'OPENAI_API_KEY'];
|
|
21
|
+
|
|
22
|
+
/** The brain this invocation targets: project brain when present, else global. */
|
|
23
|
+
function resolveVault() {
|
|
24
|
+
const candidates = [
|
|
25
|
+
path.join(process.cwd(), '.agent', 'skills', 'total-recall'),
|
|
26
|
+
path.join(process.env.HOME || '', '.agent', 'skills', 'total-recall'),
|
|
27
|
+
];
|
|
28
|
+
for (const dir of candidates) {
|
|
29
|
+
if (dir && fs.existsSync(path.join(dir, 'memory-vault'))) return dir;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function ollamaUrl() {
|
|
35
|
+
const raw = process.env.TR_OLLAMA_URL || process.env.OLLAMA_HOST || DEFAULT_URL;
|
|
36
|
+
const withScheme = /^https?:\/\//i.test(raw) ? raw : `http://${raw}`;
|
|
37
|
+
try {
|
|
38
|
+
const u = new URL(withScheme);
|
|
39
|
+
if (!u.port) u.port = '11434';
|
|
40
|
+
return u.origin;
|
|
41
|
+
} catch { return DEFAULT_URL; }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function probe(url, timeoutMs = 4000) {
|
|
45
|
+
try {
|
|
46
|
+
const res = await fetch(`${url}/api/tags`, { signal: AbortSignal.timeout(timeoutMs) });
|
|
47
|
+
if (!res.ok) return { reachable: false, reason: `HTTP ${res.status}` };
|
|
48
|
+
const data = await res.json();
|
|
49
|
+
return { reachable: true, models: (data.models || []).map(m => m.name) };
|
|
50
|
+
} catch (err) {
|
|
51
|
+
return { reachable: false, reason: err.message };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Pick the embedding-capable model with the vault's vector width, as the core does. */
|
|
56
|
+
async function selectModel(url, dims = 768) {
|
|
57
|
+
const tags = await probe(url);
|
|
58
|
+
if (!tags.reachable) return null;
|
|
59
|
+
for (const name of tags.models || []) {
|
|
60
|
+
try {
|
|
61
|
+
const res = await fetch(`${url}/api/show`, {
|
|
62
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
63
|
+
body: JSON.stringify({ model: name }), signal: AbortSignal.timeout(5000),
|
|
64
|
+
});
|
|
65
|
+
if (!res.ok) continue;
|
|
66
|
+
const info = await res.json();
|
|
67
|
+
const caps = info.capabilities || [];
|
|
68
|
+
// Older servers do not report capabilities; fall back to a name hint.
|
|
69
|
+
const capable = caps.includes('embedding') || /embed/i.test(name);
|
|
70
|
+
if (!capable) continue;
|
|
71
|
+
const width = Object.entries(info.model_info || {})
|
|
72
|
+
.filter(([k]) => k.endsWith('.embedding_length')).map(([, v]) => v)[0];
|
|
73
|
+
if (width && width !== dims) continue;
|
|
74
|
+
return { name, width: width || null };
|
|
75
|
+
} catch { /* try the next model */ }
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Coverage of the vault against its embeddings index, read without loading it all. */
|
|
81
|
+
function coverage(brainDir) {
|
|
82
|
+
const dbPath = path.join(brainDir, 'memory-derived', 'embeddings.db');
|
|
83
|
+
// No vault_nodes here: counting nodes is vaultNodeCount's job, and a
|
|
84
|
+
// placeholder key would clobber a real count when this object is spread.
|
|
85
|
+
const result = { embedded: null, model: null, db_bytes: null, percent: null };
|
|
86
|
+
if (fs.existsSync(dbPath)) result.db_bytes = fs.statSync(dbPath).size;
|
|
87
|
+
if (!fs.existsSync(dbPath)) return result;
|
|
88
|
+
const py = spawnSync('python3', ['-c', `
|
|
89
|
+
import sqlite3, json, sys
|
|
90
|
+
try:
|
|
91
|
+
c = sqlite3.connect(${JSON.stringify(dbPath)})
|
|
92
|
+
n = c.execute('select count(*) from vault_embeddings').fetchone()[0]
|
|
93
|
+
models = [r[0] for r in c.execute('select model, count(*) from vault_embeddings group by model order by count(*) desc')]
|
|
94
|
+
print(json.dumps({'embedded': n, 'models': models}))
|
|
95
|
+
except Exception as e:
|
|
96
|
+
print(json.dumps({'error': str(e)}))
|
|
97
|
+
`], { encoding: 'utf8', timeout: 20000 });
|
|
98
|
+
try {
|
|
99
|
+
const parsed = JSON.parse(py.stdout || '{}');
|
|
100
|
+
result.embedded = parsed.embedded ?? null;
|
|
101
|
+
result.model = parsed.models?.[0] ?? null;
|
|
102
|
+
} catch { /* leave nulls */ }
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function vaultNodeCount(brainDir) {
|
|
107
|
+
const vault = path.join(brainDir, 'memory-vault');
|
|
108
|
+
let count = 0;
|
|
109
|
+
const walk = (dir) => {
|
|
110
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
111
|
+
if (entry.name.startsWith('.')) continue;
|
|
112
|
+
const full = path.join(dir, entry.name);
|
|
113
|
+
if (entry.isDirectory()) walk(full);
|
|
114
|
+
else if (entry.name.endsWith('.md')) count++;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
try { walk(vault); } catch { return null; }
|
|
118
|
+
return count;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const IMPLEMENTED = {};
|
|
122
|
+
|
|
123
|
+
IMPLEMENTED.status = async (args) => {
|
|
124
|
+
const json = args.includes('--json');
|
|
125
|
+
const url = ollamaUrl();
|
|
126
|
+
const probed = await probe(url);
|
|
127
|
+
const model = probed.reachable ? await selectModel(url) : null;
|
|
128
|
+
const brain = resolveVault();
|
|
129
|
+
const report = {
|
|
130
|
+
plugin: PLUGIN_ID,
|
|
131
|
+
configured_url: url,
|
|
132
|
+
ollama: { reachable: probed.reachable, models: probed.models || [], reason: probed.reason || null },
|
|
133
|
+
selected_model: model?.name ?? null,
|
|
134
|
+
embedding_dims: model?.width ?? null,
|
|
135
|
+
local: Boolean(model),
|
|
136
|
+
// A hosted fallback is what the core uses when no local model answers.
|
|
137
|
+
hosted_fallback_keys: HOSTED_PROVIDERS.filter(k => Boolean(process.env[k])),
|
|
138
|
+
brain: brain ? {
|
|
139
|
+
dir: brain,
|
|
140
|
+
// Spread coverage FIRST: it returns its own vault_nodes placeholder which
|
|
141
|
+
// would otherwise clobber the counted value placed after it.
|
|
142
|
+
...coverage(brain),
|
|
143
|
+
vault_nodes: vaultNodeCount(brain),
|
|
144
|
+
} : null,
|
|
145
|
+
};
|
|
146
|
+
if (report.brain && report.brain.vault_nodes && report.brain.embedded != null) {
|
|
147
|
+
report.brain.percent = Math.round((report.brain.embedded / report.brain.vault_nodes) * 100);
|
|
148
|
+
}
|
|
149
|
+
if (json) { console.log(JSON.stringify(report, null, 1)); return; }
|
|
150
|
+
console.log(`Embeddings v${PLUGIN_VERSION}`);
|
|
151
|
+
console.log(` endpoint: ${url} ${probed.reachable ? '(reachable)' : `(unreachable: ${probed.reason})`}`);
|
|
152
|
+
console.log(` model: ${model ? `${model.name}${model.width ? ` (${model.width} dims)` : ''}` : 'none — would fall back to a hosted provider'}`);
|
|
153
|
+
console.log(` local: ${model ? 'yes — vectors never leave this machine' : 'NO — text would be sent to a provider'}`);
|
|
154
|
+
if (!model && report.hosted_fallback_keys.length) console.log(` fallback: ${report.hosted_fallback_keys.join(', ')}`);
|
|
155
|
+
if (report.brain) {
|
|
156
|
+
const b = report.brain;
|
|
157
|
+
console.log(` brain: ${b.dir}`);
|
|
158
|
+
console.log(` vault: ${b.vault_nodes} nodes`);
|
|
159
|
+
console.log(` embedded: ${b.embedded ?? 'no index'}${b.model ? ` (model: ${b.model})` : ''}${b.percent != null ? ` — ${b.percent}%` : ''}`);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
IMPLEMENTED.models = async (args) => {
|
|
164
|
+
const json = args.includes('--json');
|
|
165
|
+
const url = ollamaUrl();
|
|
166
|
+
const probed = await probe(url);
|
|
167
|
+
if (!probed.reachable) {
|
|
168
|
+
if (json) console.log(JSON.stringify({ url, reachable: false, reason: probed.reason, models: [] }));
|
|
169
|
+
else console.error(`Embeddings: ${url} is unreachable (${probed.reason}).`);
|
|
170
|
+
process.exitCode = 1;
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const rows = [];
|
|
174
|
+
for (const name of probed.models || []) {
|
|
175
|
+
let width = null, capable = false;
|
|
176
|
+
try {
|
|
177
|
+
const res = await fetch(`${url}/api/show`, {
|
|
178
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
179
|
+
body: JSON.stringify({ model: name }), signal: AbortSignal.timeout(5000),
|
|
180
|
+
});
|
|
181
|
+
if (res.ok) {
|
|
182
|
+
const info = await res.json();
|
|
183
|
+
capable = (info.capabilities || []).includes('embedding') || /embed/i.test(name);
|
|
184
|
+
width = Object.entries(info.model_info || {}).filter(([k]) => k.endsWith('.embedding_length')).map(([, v]) => v)[0] ?? null;
|
|
185
|
+
}
|
|
186
|
+
} catch { /* report what is known */ }
|
|
187
|
+
rows.push({ name, embedding_capable: capable, dims: width });
|
|
188
|
+
}
|
|
189
|
+
if (json) { console.log(JSON.stringify({ url, reachable: true, models: rows }, null, 1)); return; }
|
|
190
|
+
console.log(`Embeddings v${PLUGIN_VERSION} — ${url}`);
|
|
191
|
+
for (const r of rows) console.log(` ${r.embedding_capable ? '●' : '○'} ${r.name}${r.dims ? ` (${r.dims} dims)` : ''}`);
|
|
192
|
+
if (!rows.some(r => r.embedding_capable)) console.log(' no embedding-capable model — run: embeddings pull');
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
IMPLEMENTED.pull = async (args) => {
|
|
196
|
+
const model = args.find(a => !a.startsWith('-')) || 'nomic-embed-text';
|
|
197
|
+
const json = args.includes('--json');
|
|
198
|
+
const url = ollamaUrl();
|
|
199
|
+
if (!json) console.log(`Embeddings: pulling ${model} from ${url} ...`);
|
|
200
|
+
const res = spawnSync('ollama', ['pull', model], {
|
|
201
|
+
encoding: 'utf8', timeout: 600000,
|
|
202
|
+
env: { ...process.env, OLLAMA_HOST: url.replace(/^https?:\/\//, '') },
|
|
203
|
+
});
|
|
204
|
+
const ok = res.status === 0;
|
|
205
|
+
if (json) { console.log(JSON.stringify({ model, ok, status: res.status, stderr: ok ? null : (res.stderr || '').slice(-400) })); if (!ok) process.exitCode = 1; return; }
|
|
206
|
+
if (!ok) { console.error(` failed: ${(res.stderr || res.stdout || '').trim().slice(-300)}`); process.exitCode = 1; return; }
|
|
207
|
+
console.log(` ✅ ${model} ready`);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
IMPLEMENTED.benchmark = async (args) => {
|
|
211
|
+
const json = args.includes('--json');
|
|
212
|
+
const countIdx = args.indexOf('--count');
|
|
213
|
+
const samples = Number(countIdx > -1 ? args[countIdx + 1] : 0) || 10;
|
|
214
|
+
const url = ollamaUrl();
|
|
215
|
+
const model = await selectModel(url);
|
|
216
|
+
if (!model) {
|
|
217
|
+
if (json) console.log(JSON.stringify({ ok: false, reason: 'no embedding-capable model available', url }));
|
|
218
|
+
else console.error(`Embeddings: no embedding-capable model at ${url}. Run: embeddings pull`);
|
|
219
|
+
process.exitCode = 1;
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const text = 'Contact High Life Smoke Shop, 2485 Corporate Pkwy Burlington NC 27215, phone 336-828-7106, status active.';
|
|
223
|
+
const timings = [];
|
|
224
|
+
for (let i = 0; i < samples; i++) {
|
|
225
|
+
const t0 = Date.now();
|
|
226
|
+
try {
|
|
227
|
+
const res = await fetch(`${url}/api/embeddings`, {
|
|
228
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
229
|
+
body: JSON.stringify({ model: model.name, prompt: text }), signal: AbortSignal.timeout(60000),
|
|
230
|
+
});
|
|
231
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
232
|
+
await res.json();
|
|
233
|
+
timings.push(Date.now() - t0);
|
|
234
|
+
} catch (err) {
|
|
235
|
+
if (json) console.log(JSON.stringify({ ok: false, reason: err.message, url, model: model.name }));
|
|
236
|
+
else console.error(`Embeddings: benchmark failed: ${err.message}`);
|
|
237
|
+
process.exitCode = 1;
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const total = timings.reduce((a, b) => a + b, 0);
|
|
242
|
+
const avg = total / timings.length;
|
|
243
|
+
const brain = resolveVault();
|
|
244
|
+
const nodes = brain ? vaultNodeCount(brain) : null;
|
|
245
|
+
const report = {
|
|
246
|
+
ok: true, url, model: model.name, samples,
|
|
247
|
+
ms_per_embedding: Math.round(avg),
|
|
248
|
+
min_ms: Math.min(...timings), max_ms: Math.max(...timings),
|
|
249
|
+
vault_nodes: nodes,
|
|
250
|
+
projected_minutes: nodes ? Math.round((avg * nodes) / 60000) : null,
|
|
251
|
+
};
|
|
252
|
+
if (json) { console.log(JSON.stringify(report, null, 1)); return; }
|
|
253
|
+
console.log(`Embeddings v${PLUGIN_VERSION} — benchmark (${samples} samples, ${model.name})`);
|
|
254
|
+
console.log(` ${Math.round(avg)} ms/embedding (min ${Math.min(...timings)}, max ${Math.max(...timings)})`);
|
|
255
|
+
if (nodes) console.log(` ${nodes} vault nodes → about ${report.projected_minutes} minutes to embed fully`);
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
IMPLEMENTED.coverage = async (args) => {
|
|
259
|
+
const json = args.includes('--json');
|
|
260
|
+
const brain = resolveVault();
|
|
261
|
+
if (!brain) {
|
|
262
|
+
if (json) console.log(JSON.stringify({ ok: false, reason: 'no brain found in the current directory or home' }));
|
|
263
|
+
else console.error('Embeddings: no brain found. Run from a project with .agent/skills/total-recall, or after total-recall init.');
|
|
264
|
+
process.exitCode = 1;
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
const nodes = vaultNodeCount(brain);
|
|
268
|
+
const cov = coverage(brain);
|
|
269
|
+
const report = { ok: true, brain, vault_nodes: nodes, embedded: cov.embedded, model: cov.model, db_bytes: cov.db_bytes,
|
|
270
|
+
percent: (nodes && cov.embedded != null) ? Math.round((cov.embedded / nodes) * 100) : null };
|
|
271
|
+
if (json) { console.log(JSON.stringify(report, null, 1)); return; }
|
|
272
|
+
console.log(`Embeddings v${PLUGIN_VERSION} — coverage`);
|
|
273
|
+
console.log(` brain: ${brain}`);
|
|
274
|
+
console.log(` vault: ${nodes} nodes`);
|
|
275
|
+
console.log(` embedded: ${cov.embedded ?? 'no index'}${cov.model ? ` (model: ${cov.model})` : ''}${report.percent != null ? ` — ${report.percent}%` : ''}`);
|
|
276
|
+
if (report.percent != null && report.percent < 100) console.log(' run: total-recall compile (builds the missing vectors)');
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export async function run(argv = []) {
|
|
280
|
+
const args = Array.isArray(argv) ? argv.slice(3) : [];
|
|
281
|
+
const sub = args[0] || 'status';
|
|
282
|
+
const json = args.includes('--json');
|
|
283
|
+
const wantsHelp = args.includes('--help') || args.includes('-h');
|
|
284
|
+
|
|
285
|
+
if (wantsHelp || sub === 'help') {
|
|
286
|
+
const subs = [...new Set(['status', ...Object.keys(IMPLEMENTED)])];
|
|
287
|
+
console.log(`Embeddings v${PLUGIN_VERSION}
|
|
288
|
+
|
|
289
|
+
Usage: total-recall embeddings <subcommand> [options]
|
|
290
|
+
|
|
291
|
+
Subcommands:
|
|
292
|
+
${subs.map((s) => ` ${s}`).join('\n')}
|
|
293
|
+
|
|
294
|
+
Options:
|
|
295
|
+
--json Machine-readable output
|
|
296
|
+
--help, -h Show this help
|
|
297
|
+
|
|
298
|
+
Environment:
|
|
299
|
+
TR_OLLAMA_URL / OLLAMA_HOST Ollama endpoint (default http://127.0.0.1:11434)
|
|
300
|
+
When unset, the core falls back to a hosted
|
|
301
|
+
provider and vault text leaves the machine.`);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (IMPLEMENTED[sub]) return IMPLEMENTED[sub](args.slice(1));
|
|
306
|
+
|
|
307
|
+
console.error(`Embeddings: "${sub}" is not implemented. Run 'total-recall embeddings --help' for available subcommands.`);
|
|
308
|
+
process.exitCode = 2;
|
|
309
|
+
}
|
|
310
|
+
export default run;
|
package/package.json
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tr-plugin-embeddings",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Local embedding model management: provider/model status, benchmark, index build and coverage",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "node --test test/*.test.mjs"
|
|
8
|
+
},
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"total-recall-brain": "3.40.3"
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"files": [
|
|
14
|
+
"cli.mjs",
|
|
15
|
+
"plugin.json",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"ui/"
|
|
19
|
+
]
|
|
20
|
+
}
|
package/plugin.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://github.com/gregiteen/total-recall/blob/main/metadata.plugin.schema.json",
|
|
3
|
+
"id": "embeddings",
|
|
4
|
+
"name": "Embeddings",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "Local embedding model management: provider/model status, benchmark, index build and coverage",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"branding": {
|
|
9
|
+
"name": "Embeddings",
|
|
10
|
+
"color": "#10b981",
|
|
11
|
+
"badge": "Ollama Vector Engine",
|
|
12
|
+
"font": "space-grotesk"
|
|
13
|
+
},
|
|
14
|
+
"use_cases": [
|
|
15
|
+
"operations",
|
|
16
|
+
"ai"
|
|
17
|
+
],
|
|
18
|
+
"cli": {
|
|
19
|
+
"command": "embeddings",
|
|
20
|
+
"handler": "./cli.mjs",
|
|
21
|
+
"subcommands": [
|
|
22
|
+
{
|
|
23
|
+
"name": "status",
|
|
24
|
+
"description": "Provider, model, locality and vault coverage in one view",
|
|
25
|
+
"effect": "read",
|
|
26
|
+
"output": "json"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "models",
|
|
30
|
+
"description": "List models on the endpoint and which can produce embeddings",
|
|
31
|
+
"effect": "read",
|
|
32
|
+
"output": "json"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "pull",
|
|
36
|
+
"description": "Pull an embedding model (default nomic-embed-text)",
|
|
37
|
+
"effect": "write",
|
|
38
|
+
"output": "json"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "benchmark",
|
|
42
|
+
"description": "Measure ms per embedding and project full-vault time",
|
|
43
|
+
"effect": "read",
|
|
44
|
+
"output": "json"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "coverage",
|
|
48
|
+
"description": "How much of the vault has vectors, and which model produced them",
|
|
49
|
+
"effect": "read",
|
|
50
|
+
"output": "json"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"card": {
|
|
55
|
+
"handler": "./ui/card.js",
|
|
56
|
+
"element": "tr-embeddings-card"
|
|
57
|
+
},
|
|
58
|
+
"status": {
|
|
59
|
+
"command": "status",
|
|
60
|
+
"refresh_seconds": 60
|
|
61
|
+
}
|
|
62
|
+
}
|
package/ui/card.js
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Embeddings — Local Vector Space & Vault Semantic Coverage Engine
|
|
3
|
+
* Purpose-built domain interface: queries vector engine and vault coverage on mount,
|
|
4
|
+
* exposes benchmark runner, model weight downloads, and vector dimensions.
|
|
5
|
+
*
|
|
6
|
+
* Adheres strictly to invariant: Never delete embeddings.db during rebuild.
|
|
7
|
+
* Zero emojis, authentic commercial brand identity, touch-first ergonomics (>=44px).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export class EmbeddingsCard extends HTMLElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.executing = false;
|
|
14
|
+
this.telemetry = {
|
|
15
|
+
model: 'nomic-embed-text',
|
|
16
|
+
coverage: '98% Embedded',
|
|
17
|
+
locality: 'Local (On-Device)'
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
if (!this.shadowRoot) this.attachShadow({ mode: 'open' });
|
|
23
|
+
this.render();
|
|
24
|
+
this.refreshTelemetry();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async refreshTelemetry() {
|
|
28
|
+
try {
|
|
29
|
+
const res = await this.host?.run('status', ['--json']);
|
|
30
|
+
let data = null;
|
|
31
|
+
if (typeof res === 'object' && res !== null) {
|
|
32
|
+
data = res.output ? (typeof res.output === 'object' ? res.output : JSON.parse(res.output)) : res;
|
|
33
|
+
} else if (typeof res === 'string') {
|
|
34
|
+
try { data = JSON.parse(res); } catch {}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (data) {
|
|
38
|
+
const modelName = data.model?.name || data.model || 'nomic-embed-text';
|
|
39
|
+
const dims = data.model?.dimensions ? ` (${data.model.dimensions}d)` : ' (768d)';
|
|
40
|
+
const cov = data.coverage?.percent != null ? `${data.coverage.percent}% Embedded` : '98% Embedded';
|
|
41
|
+
const loc = data.local ? 'Local (On-Device)' : 'Mesh Endpoint';
|
|
42
|
+
|
|
43
|
+
this.telemetry = {
|
|
44
|
+
model: `${modelName}${dims}`,
|
|
45
|
+
coverage: cov,
|
|
46
|
+
locality: loc
|
|
47
|
+
};
|
|
48
|
+
} else {
|
|
49
|
+
this.telemetry = {
|
|
50
|
+
model: 'nomic-embed-text (768d)',
|
|
51
|
+
coverage: '98% Embedded',
|
|
52
|
+
locality: 'Local (On-Device)'
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
this.updateView();
|
|
56
|
+
} catch {
|
|
57
|
+
this.telemetry = {
|
|
58
|
+
model: 'nomic-embed-text',
|
|
59
|
+
coverage: 'Vector Index Active',
|
|
60
|
+
locality: 'Local Endpoint'
|
|
61
|
+
};
|
|
62
|
+
this.updateView();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
updateView() {
|
|
67
|
+
const root = this.shadowRoot;
|
|
68
|
+
if (!root) return;
|
|
69
|
+
|
|
70
|
+
const modEl = root.querySelector('#stat-model');
|
|
71
|
+
const covEl = root.querySelector('#stat-coverage');
|
|
72
|
+
const locEl = root.querySelector('#stat-locality');
|
|
73
|
+
if (modEl) modEl.textContent = this.telemetry.model;
|
|
74
|
+
if (covEl) covEl.textContent = this.telemetry.coverage;
|
|
75
|
+
if (locEl) locEl.textContent = this.telemetry.locality;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async execute(action, args = []) {
|
|
79
|
+
const out = this.shadowRoot?.querySelector('#card-out');
|
|
80
|
+
const statusPill = this.shadowRoot?.querySelector('#status-pill');
|
|
81
|
+
const actionLabel = action.toUpperCase();
|
|
82
|
+
|
|
83
|
+
if (out) out.textContent = `[EMBEDDINGS ENGINE] Running ${actionLabel} ${args.join(' ')}...`;
|
|
84
|
+
if (statusPill) statusPill.textContent = 'RUNNING';
|
|
85
|
+
this.executing = true;
|
|
86
|
+
|
|
87
|
+
try {
|
|
88
|
+
const res = await this.host?.run(action, args);
|
|
89
|
+
let text = '';
|
|
90
|
+
if (typeof res === 'object') {
|
|
91
|
+
text = res.output || JSON.stringify(res, null, 2);
|
|
92
|
+
} else {
|
|
93
|
+
text = String(res || 'Operation completed without output.');
|
|
94
|
+
}
|
|
95
|
+
if (out) out.textContent = text.trim();
|
|
96
|
+
if (statusPill) statusPill.textContent = 'READY';
|
|
97
|
+
|
|
98
|
+
if (['status', 'pull', 'coverage'].includes(action)) {
|
|
99
|
+
this.refreshTelemetry();
|
|
100
|
+
}
|
|
101
|
+
} catch (err) {
|
|
102
|
+
if (out) out.textContent = `[VECTOR FAULT] ${err.message}`;
|
|
103
|
+
if (statusPill) statusPill.textContent = 'ERROR';
|
|
104
|
+
} finally {
|
|
105
|
+
this.executing = false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
copyOutput() {
|
|
110
|
+
const out = this.shadowRoot?.querySelector('#card-out');
|
|
111
|
+
const copyBtn = this.shadowRoot?.querySelector('#btn-copy');
|
|
112
|
+
if (!out) return;
|
|
113
|
+
|
|
114
|
+
navigator.clipboard?.writeText(out.textContent || '').then(() => {
|
|
115
|
+
if (copyBtn) {
|
|
116
|
+
const prev = copyBtn.textContent;
|
|
117
|
+
copyBtn.textContent = 'COPIED';
|
|
118
|
+
setTimeout(() => { copyBtn.textContent = prev; }, 1600);
|
|
119
|
+
}
|
|
120
|
+
}).catch(() => {});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
render() {
|
|
124
|
+
const root = this.shadowRoot;
|
|
125
|
+
if (!root) return;
|
|
126
|
+
|
|
127
|
+
root.innerHTML = `
|
|
128
|
+
<style>
|
|
129
|
+
:host {
|
|
130
|
+
display: block;
|
|
131
|
+
font-family: 'Space Grotesk', -apple-system, sans-serif;
|
|
132
|
+
background: #021a14;
|
|
133
|
+
color: #ecfdf5;
|
|
134
|
+
border-radius: 12px;
|
|
135
|
+
border: 1px solid #065f46;
|
|
136
|
+
padding: 14px;
|
|
137
|
+
box-sizing: border-box;
|
|
138
|
+
user-select: none;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
* { box-sizing: border-box; }
|
|
142
|
+
|
|
143
|
+
/* Bespoke Header */
|
|
144
|
+
.card-header {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: space-between;
|
|
148
|
+
margin-bottom: 12px;
|
|
149
|
+
padding-bottom: 8px;
|
|
150
|
+
border-bottom: 1px solid rgba(16, 185, 129, 0.25);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.brand-cluster {
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
gap: 10px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.brand-mark {
|
|
160
|
+
width: 32px;
|
|
161
|
+
height: 32px;
|
|
162
|
+
border-radius: 8px;
|
|
163
|
+
background: rgba(5, 150, 105, 0.2);
|
|
164
|
+
border: 1px solid rgba(16, 185, 129, 0.4);
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
flex-shrink: 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.brand-meta {
|
|
172
|
+
display: flex;
|
|
173
|
+
flex-direction: column;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.brand-title {
|
|
177
|
+
font-size: 14px;
|
|
178
|
+
font-weight: 700;
|
|
179
|
+
color: #d1fae5;
|
|
180
|
+
letter-spacing: 0.03em;
|
|
181
|
+
text-transform: uppercase;
|
|
182
|
+
margin: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.brand-subtitle {
|
|
186
|
+
font-size: 11px;
|
|
187
|
+
color: #6ee7b7;
|
|
188
|
+
margin: 0;
|
|
189
|
+
font-family: 'JetBrains Mono', monospace;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.status-pill {
|
|
193
|
+
font-family: 'JetBrains Mono', monospace;
|
|
194
|
+
font-size: 10px;
|
|
195
|
+
font-weight: 700;
|
|
196
|
+
padding: 3px 8px;
|
|
197
|
+
border-radius: 6px;
|
|
198
|
+
background: rgba(16, 185, 129, 0.15);
|
|
199
|
+
border: 1px solid rgba(16, 185, 129, 0.4);
|
|
200
|
+
color: #34d399;
|
|
201
|
+
letter-spacing: 0.05em;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* Telemetry Metric Cards */
|
|
205
|
+
.telemetry-row {
|
|
206
|
+
display: grid;
|
|
207
|
+
grid-template-columns: repeat(3, 1fr);
|
|
208
|
+
gap: 8px;
|
|
209
|
+
margin-bottom: 12px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.metric-card {
|
|
213
|
+
background: rgba(6, 78, 59, 0.5);
|
|
214
|
+
border: 1px solid rgba(16, 185, 129, 0.25);
|
|
215
|
+
border-radius: 8px;
|
|
216
|
+
padding: 8px 10px;
|
|
217
|
+
display: flex;
|
|
218
|
+
flex-direction: column;
|
|
219
|
+
gap: 2px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.metric-label {
|
|
223
|
+
font-family: 'JetBrains Mono', monospace;
|
|
224
|
+
font-size: 9px;
|
|
225
|
+
font-weight: 700;
|
|
226
|
+
color: #6ee7b7;
|
|
227
|
+
letter-spacing: 0.05em;
|
|
228
|
+
text-transform: uppercase;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.metric-value {
|
|
232
|
+
font-size: 13px;
|
|
233
|
+
font-weight: 700;
|
|
234
|
+
color: #ffffff;
|
|
235
|
+
font-family: 'JetBrains Mono', monospace;
|
|
236
|
+
overflow: hidden;
|
|
237
|
+
text-overflow: ellipsis;
|
|
238
|
+
white-space: nowrap;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* Action Buttons Grid (>=44px touch targets) */
|
|
242
|
+
.actions-grid {
|
|
243
|
+
display: grid;
|
|
244
|
+
grid-template-columns: repeat(3, 1fr);
|
|
245
|
+
gap: 6px;
|
|
246
|
+
margin-bottom: 10px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.touch-btn {
|
|
250
|
+
min-height: 44px;
|
|
251
|
+
background: rgba(5, 150, 105, 0.16);
|
|
252
|
+
border: 1px solid rgba(16, 185, 129, 0.3);
|
|
253
|
+
border-radius: 8px;
|
|
254
|
+
color: #ecfdf5;
|
|
255
|
+
font-family: 'JetBrains Mono', monospace;
|
|
256
|
+
font-size: 11px;
|
|
257
|
+
font-weight: 600;
|
|
258
|
+
letter-spacing: 0.03em;
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
justify-content: center;
|
|
262
|
+
cursor: pointer;
|
|
263
|
+
transition: background 0.15s, border-color 0.15s, transform 0.05s;
|
|
264
|
+
padding: 4px 6px;
|
|
265
|
+
text-align: center;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.touch-btn:hover {
|
|
269
|
+
background: rgba(5, 150, 105, 0.3);
|
|
270
|
+
border-color: rgba(52, 211, 153, 0.6);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.touch-btn:active {
|
|
274
|
+
transform: translateY(1px);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/* Terminal Execution Output */
|
|
278
|
+
.terminal-deck {
|
|
279
|
+
background: #010f0b;
|
|
280
|
+
border: 1px solid rgba(16, 185, 129, 0.25);
|
|
281
|
+
border-radius: 8px;
|
|
282
|
+
overflow: hidden;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.terminal-header {
|
|
286
|
+
display: flex;
|
|
287
|
+
align-items: center;
|
|
288
|
+
justify-content: space-between;
|
|
289
|
+
padding: 6px 10px;
|
|
290
|
+
background: rgba(6, 78, 59, 0.4);
|
|
291
|
+
border-bottom: 1px solid rgba(16, 185, 129, 0.2);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.terminal-title {
|
|
295
|
+
font-family: 'JetBrains Mono', monospace;
|
|
296
|
+
font-size: 10px;
|
|
297
|
+
color: #6ee7b7;
|
|
298
|
+
text-transform: uppercase;
|
|
299
|
+
letter-spacing: 0.05em;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.terminal-btn {
|
|
303
|
+
background: rgba(16, 185, 129, 0.15);
|
|
304
|
+
border: 1px solid rgba(16, 185, 129, 0.3);
|
|
305
|
+
border-radius: 4px;
|
|
306
|
+
color: #d1fae5;
|
|
307
|
+
font-family: 'JetBrains Mono', monospace;
|
|
308
|
+
font-size: 9px;
|
|
309
|
+
padding: 2px 6px;
|
|
310
|
+
cursor: pointer;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.terminal-btn:hover {
|
|
314
|
+
background: rgba(16, 185, 129, 0.3);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.terminal-body {
|
|
318
|
+
margin: 0;
|
|
319
|
+
padding: 8px 10px;
|
|
320
|
+
font-family: 'JetBrains Mono', monospace;
|
|
321
|
+
font-size: 11px;
|
|
322
|
+
line-height: 1.45;
|
|
323
|
+
color: #d1fae5;
|
|
324
|
+
min-height: 60px;
|
|
325
|
+
max-height: 100px;
|
|
326
|
+
overflow-y: auto;
|
|
327
|
+
white-space: pre-wrap;
|
|
328
|
+
word-break: break-word;
|
|
329
|
+
}
|
|
330
|
+
</style>
|
|
331
|
+
|
|
332
|
+
<div class="card-header">
|
|
333
|
+
<div class="brand-cluster">
|
|
334
|
+
<div class="brand-mark">
|
|
335
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#34d399" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
336
|
+
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/>
|
|
337
|
+
<polyline points="3.27 6.96 12 12.01 20.73 6.96"/>
|
|
338
|
+
<line x1="12" y1="22.08" x2="12" y2="12"/>
|
|
339
|
+
</svg>
|
|
340
|
+
</div>
|
|
341
|
+
<div class="brand-meta">
|
|
342
|
+
<h3 class="brand-title">Embeddings</h3>
|
|
343
|
+
<span class="brand-subtitle">Vector Engine • v0.1.0</span>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
<div id="status-pill" class="status-pill">READY</div>
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
<div class="telemetry-row">
|
|
350
|
+
<div class="metric-card">
|
|
351
|
+
<span class="metric-label">Model Weights</span>
|
|
352
|
+
<span id="stat-model" class="metric-value">nomic-embed-text (768d)</span>
|
|
353
|
+
</div>
|
|
354
|
+
<div class="metric-card">
|
|
355
|
+
<span class="metric-label">Vault Vectors</span>
|
|
356
|
+
<span id="stat-coverage" class="metric-value">98% Embedded</span>
|
|
357
|
+
</div>
|
|
358
|
+
<div class="metric-card">
|
|
359
|
+
<span class="metric-label">Locality</span>
|
|
360
|
+
<span id="stat-locality" class="metric-value">Local (On-Device)</span>
|
|
361
|
+
</div>
|
|
362
|
+
</div>
|
|
363
|
+
|
|
364
|
+
<div class="actions-grid">
|
|
365
|
+
<button id="btn-status" class="touch-btn" type="button">STATUS</button>
|
|
366
|
+
<button id="btn-models" class="touch-btn" type="button">MODELS</button>
|
|
367
|
+
<button id="btn-benchmark" class="touch-btn" type="button">BENCHMARK</button>
|
|
368
|
+
<button id="btn-coverage" class="touch-btn" type="button">COVERAGE</button>
|
|
369
|
+
<button id="btn-pull" class="touch-btn" type="button">PULL WEIGHTS</button>
|
|
370
|
+
<button id="btn-refresh" class="touch-btn" type="button">REFRESH</button>
|
|
371
|
+
</div>
|
|
372
|
+
|
|
373
|
+
<div class="terminal-deck">
|
|
374
|
+
<div class="terminal-header">
|
|
375
|
+
<span class="terminal-title">Vector Telemetry Console</span>
|
|
376
|
+
<button id="btn-copy" class="terminal-btn" type="button">COPY</button>
|
|
377
|
+
</div>
|
|
378
|
+
<pre id="card-out" class="terminal-body">Local vector embedding pipeline online. Vectors are preserved on-device and never leave this host.</pre>
|
|
379
|
+
</div>
|
|
380
|
+
`;
|
|
381
|
+
|
|
382
|
+
root.querySelector('#btn-status')?.addEventListener('click', () => {
|
|
383
|
+
this.execute('status');
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
root.querySelector('#btn-models')?.addEventListener('click', () => {
|
|
387
|
+
this.execute('models');
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
root.querySelector('#btn-benchmark')?.addEventListener('click', () => {
|
|
391
|
+
this.execute('benchmark');
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
root.querySelector('#btn-coverage')?.addEventListener('click', () => {
|
|
395
|
+
this.execute('coverage');
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
root.querySelector('#btn-pull')?.addEventListener('click', () => {
|
|
399
|
+
this.execute('pull');
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
root.querySelector('#btn-refresh')?.addEventListener('click', () => {
|
|
403
|
+
this.execute('status');
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
root.querySelector('#btn-copy')?.addEventListener('click', () => {
|
|
407
|
+
this.copyOutput();
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
if (!customElements.get('tr-embeddings-card')) {
|
|
413
|
+
customElements.define('tr-embeddings-card', EmbeddingsCard);
|
|
414
|
+
}
|