tr-plugin-embeddings 0.1.0 → 0.2.5

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/ui/home.js ADDED
@@ -0,0 +1,353 @@
1
+ /**
2
+ * Embeddings Home — the plugin's native page.
3
+ *
4
+ * Answers, from the plugin's own JSON operations: which provider serves
5
+ * vectors and whether text leaves this machine, how much of the vault has a
6
+ * usable vector, which models the endpoint offers, and how fast the selected
7
+ * model embeds. Reads `status` and `models` on open; benchmark and pull run
8
+ * only when the operator asks. Anything not reported renders as a dash.
9
+ */
10
+
11
+ const DASH = '—';
12
+ const BENCHMARK_MAX = 20;
13
+
14
+ function escapeHtml(value) {
15
+ return String(value).replace(/[&<>"']/g, c => ({
16
+ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;',
17
+ }[c]));
18
+ }
19
+
20
+ /** A reported value, or a dash when the operation did not report one. */
21
+ function shown(value) {
22
+ return value === null || value === undefined || value === '' ? DASH : escapeHtml(value);
23
+ }
24
+
25
+ function formatBytes(n) {
26
+ if (!Number.isFinite(n)) return DASH;
27
+ if (n < 1024) return `${n} B`;
28
+ if (n < 1024 ** 2) return `${(n / 1024).toFixed(1)} KB`;
29
+ if (n < 1024 ** 3) return `${(n / 1024 ** 2).toFixed(1)} MB`;
30
+ return `${(n / 1024 ** 3).toFixed(2)} GB`;
31
+ }
32
+
33
+ /** host.run may hand back parsed JSON, raw stdout, or a { stdout } envelope. */
34
+ export function parseResult(res) {
35
+ if (res && typeof res === 'object' && typeof res.stdout === 'string') return parseResult(res.stdout);
36
+ if (res && typeof res === 'object') return res;
37
+ if (typeof res === 'string' && res.trim().startsWith('{')) return JSON.parse(res);
38
+ throw new Error('the operation returned no JSON');
39
+ }
40
+
41
+ const LOCALITY = {
42
+ local: { tone: 'ok', label: 'Local', note: 'Text sent for embedding stays on this machine.' },
43
+ remote: { tone: 'warn', label: 'Remote', note: 'The endpoint or the selected model runs on another machine, so vault text leaves this host.' },
44
+ unknown: { tone: 'warn', label: 'Unknown', note: 'No local model qualifies. Total Recall may try a hosted provider, which would send vault text off this machine.' },
45
+ };
46
+
47
+ export class EmbeddingsHome extends HTMLElement {
48
+ constructor() {
49
+ super();
50
+ this.status = { phase: 'loading' };
51
+ this.models = { phase: 'loading' };
52
+ this.bench = { phase: 'idle' };
53
+ this.pull = { phase: 'idle' };
54
+ this.count = 10;
55
+ this.pullModel = '';
56
+ }
57
+
58
+ connectedCallback() {
59
+ if (!this.shadowRoot) this.attachShadow({ mode: 'open' });
60
+ this.render();
61
+ this.load();
62
+ }
63
+
64
+ async read(op, args) {
65
+ try {
66
+ return { phase: 'ready', data: parseResult(await this.host.run(op, args)) };
67
+ } catch (err) {
68
+ return { phase: 'unavailable', error: err?.message || String(err) };
69
+ }
70
+ }
71
+
72
+ async load() {
73
+ if (!this.host) {
74
+ const error = 'No Total Recall host is connected, so the plugin operations cannot run.';
75
+ this.status = { phase: 'unavailable', error };
76
+ this.models = { phase: 'unavailable', error };
77
+ this.render();
78
+ return;
79
+ }
80
+ this.status = { phase: 'loading' };
81
+ this.models = { phase: 'loading' };
82
+ this.render();
83
+ [this.status, this.models] = await Promise.all([
84
+ this.read('status', ['--json']),
85
+ this.read('models', ['--json']),
86
+ ]);
87
+ this.render();
88
+ }
89
+
90
+ /** Runs a user-triggered operation; a JSON body with ok:false is a failure. */
91
+ async act(slot, op, args) {
92
+ if (!this.host || this[slot].phase === 'running') return;
93
+ this[slot] = { phase: 'running' };
94
+ this.render();
95
+ const result = await this.read(op, args);
96
+ if (result.phase !== 'ready') this[slot] = { phase: 'failed', error: result.error };
97
+ else if (result.data.ok === false) this[slot] = { phase: 'failed', error: result.data.reason || 'the operation reported a failure', data: result.data };
98
+ else this[slot] = { phase: 'done', data: result.data };
99
+ this.render();
100
+ }
101
+
102
+ runBenchmark() {
103
+ const n = Number(this.count);
104
+ if (!Number.isInteger(n) || n < 1 || n > BENCHMARK_MAX) {
105
+ this.bench = { phase: 'failed', error: `Samples must be a whole number from 1 to ${BENCHMARK_MAX}.` };
106
+ this.render();
107
+ return;
108
+ }
109
+ this.act('bench', 'benchmark', ['--count', String(n), '--json']);
110
+ }
111
+
112
+ async runPull() {
113
+ const model = this.pullModel.trim();
114
+ if (!model) {
115
+ this.pull = { phase: 'failed', error: 'Type the exact model name to pull.' };
116
+ this.render();
117
+ return;
118
+ }
119
+ await this.act('pull', 'pull', [model, '--json']);
120
+ if (this.pull.phase === 'done') this.load();
121
+ }
122
+
123
+ renderProvider() {
124
+ const s = this.status;
125
+ if (s.phase === 'loading') return `<p class="notice" data-design-component="notice">Reading provider status${DASH}</p>`;
126
+ if (s.phase !== 'ready') return `<p class="notice bad" data-design-component="notice">Provider status unavailable: ${escapeHtml(s.error)}</p>`;
127
+ const d = s.data;
128
+ const loc = LOCALITY[d.locality] || { tone: 'warn', label: d.locality || 'Unreported', note: '' };
129
+ const attempts = Array.isArray(d.attempts) ? d.attempts : [];
130
+ return `
131
+ <div class="verdict">
132
+ <span class="chip ${loc.tone}" data-design-component="locality-chip">${escapeHtml(loc.label)}</span>
133
+ <span class="note">${escapeHtml(loc.note)}</span>
134
+ </div>
135
+ <dl class="facts">
136
+ <div><dt>Provider</dt><dd>${shown(d.provider)}</dd></div>
137
+ <div><dt>Endpoint</dt><dd class="mono">${shown(d.endpoint)}</dd></div>
138
+ <div><dt>Selected model</dt><dd class="mono">${shown(d.selected_model)}</dd></div>
139
+ <div><dt>Vector width</dt><dd class="mono">${d.embedding_dims ? `${escapeHtml(d.embedding_dims)} dims` : DASH}</dd></div>
140
+ </dl>
141
+ ${d.reason ? `<p class="notice" data-design-component="notice">${escapeHtml(d.reason)}</p>` : ''}
142
+ ${attempts.length ? `
143
+ <ul class="attempts">
144
+ ${attempts.map(a => `
145
+ <li class="mono ${a.reachable ? 'ok' : 'bad'}">${escapeHtml(a.url)} ${DASH} ${a.reachable ? 'reachable' : `unreachable: ${shown(a.reason)}`}</li>`).join('')}
146
+ </ul>` : ''}`;
147
+ }
148
+
149
+ renderCredentials() {
150
+ const fallback = this.status.phase === 'ready' ? this.status.data.hosted_fallback : null;
151
+ return `
152
+ <dl class="facts">
153
+ <div><dt>Hosted fallback</dt><dd class="mono">${shown(fallback)}</dd></div>
154
+ <div><dt>Credential owner</dt><dd>Auth</dd></div>
155
+ </dl>
156
+ <p class="notice" data-design-component="notice">Keys for hosted embedding providers are held by the Auth owner. This plugin does not read, list or display them, so their readiness is reported as unknown rather than guessed.</p>`;
157
+ }
158
+
159
+ renderCoverage() {
160
+ const s = this.status;
161
+ if (s.phase === 'loading') return `<p class="notice" data-design-component="notice">Counting vectors${DASH}</p>`;
162
+ if (s.phase !== 'ready') return `<p class="notice bad" data-design-component="notice">Coverage unavailable: ${escapeHtml(s.error)}</p>`;
163
+ const b = s.data.brain;
164
+ if (!b) return '<p class="notice" data-design-component="notice">No brain was found in the working directory or home, so there is no vault to measure.</p>';
165
+ if (b.state !== 'ok') {
166
+ return `
167
+ <p class="notice warn" data-design-component="notice">Index state <span class="mono">${shown(b.state)}</span>: ${shown(b.reason)}</p>
168
+ <dl class="facts">
169
+ <div><dt>Brain</dt><dd class="mono">${shown(b.dir)}</dd></div>
170
+ <div><dt>Vault nodes</dt><dd class="mono">${shown(b.vault_nodes)}</dd></div>
171
+ <div><dt>Missing a vector</dt><dd class="mono">${shown(b.missing)}</dd></div>
172
+ </dl>`;
173
+ }
174
+ const counts = [
175
+ ['Usable', b.embedded, 'ok'],
176
+ ['Stale', b.stale, b.stale ? 'warn' : ''],
177
+ ['Wrong width', b.mismatched, b.mismatched ? 'warn' : ''],
178
+ ['Missing', b.missing, b.missing ? 'warn' : ''],
179
+ ['Orphaned rows', b.orphaned, ''],
180
+ ];
181
+ return `
182
+ <div class="coverage">
183
+ <div class="figure" data-design-component="coverage-figure">${b.percent === null || b.percent === undefined ? DASH : `${escapeHtml(b.percent)}%`}</div>
184
+ <div class="figure-caption">${shown(b.embedded)} of ${shown(b.vault_nodes)} vault nodes have a current, correct-width vector</div>
185
+ </div>
186
+ <ul class="counts">
187
+ ${counts.map(([label, value, tone]) => `
188
+ <li class="count-row ${tone}" data-design-component="count-row"><span>${label}</span><span class="mono">${shown(value)}</span></li>`).join('')}
189
+ </ul>
190
+ <dl class="facts">
191
+ <div><dt>Indexed by</dt><dd class="mono">${shown(b.model)}</dd></div>
192
+ <div><dt>Index rows</dt><dd class="mono">${shown(b.rows)}</dd></div>
193
+ <div><dt>Index size</dt><dd class="mono">${formatBytes(b.db_bytes)}</dd></div>
194
+ <div><dt>Unparseable files</dt><dd class="mono">${shown(b.parse_errors)}</dd></div>
195
+ <div><dt>Brain</dt><dd class="mono">${shown(b.dir)}</dd></div>
196
+ </dl>
197
+ ${b.stale || b.mismatched || b.missing ? '<p class="notice" data-design-component="notice">Rebuild the unusable vectors with <span class="mono">total-recall compile</span>.</p>' : ''}`;
198
+ }
199
+
200
+ renderModels() {
201
+ const m = this.models;
202
+ if (m.phase === 'loading') return `<p class="notice" data-design-component="notice">Listing models${DASH}</p>`;
203
+ if (m.phase !== 'ready') return `<p class="notice bad" data-design-component="notice">Model list unavailable: ${escapeHtml(m.error)}</p>`;
204
+ const d = m.data;
205
+ if (d.reachable === false) return '<p class="notice bad" data-design-component="notice">No endpoint answered. The endpoints tried are listed under Provider.</p>';
206
+ const rows = Array.isArray(d.models) ? d.models : [];
207
+ if (!rows.length) return `<p class="notice" data-design-component="notice">${shown(d.url)} reports no models. Pull one below.</p>`;
208
+ return `
209
+ <p class="caption">${shown(d.url)} ${DASH} the vault needs ${shown(d.vault_dims)}-dim vectors</p>
210
+ <ul class="models">
211
+ ${rows.map(r => `
212
+ <li class="model-row${r.name === d.selected ? ' selected' : ''}" data-design-component="model-row">
213
+ <span class="mono name">${shown(r.name)}${r.name === d.selected ? ' <span class="tag ok">selected</span>' : ''}</span>
214
+ <span class="tags">
215
+ <span class="tag">${r.dims ? `${escapeHtml(r.dims)} dims` : 'width unknown'}</span>
216
+ <span class="tag ${r.embedding_capable ? 'ok' : ''}">${r.embedding_capable ? 'embeds' : 'no embedding'}</span>
217
+ <span class="tag ${r.compatible ? 'ok' : 'warn'}">${r.compatible ? 'vault-compatible' : 'not usable'}</span>
218
+ ${r.upstream ? '<span class="tag warn">upstream</span>' : ''}
219
+ </span>
220
+ </li>`).join('')}
221
+ </ul>`;
222
+ }
223
+
224
+ renderBenchmark() {
225
+ const b = this.bench;
226
+ const running = b.phase === 'running';
227
+ const d = b.data || {};
228
+ return `
229
+ <div class="action">
230
+ <label class="field">Samples
231
+ <input id="bench-count" type="number" min="1" max="${BENCHMARK_MAX}" step="1" value="${escapeHtml(this.count)}" ${running ? 'disabled' : ''}>
232
+ </label>
233
+ <button id="bench-run" type="button" class="primary" data-design-component="button-primary" ${running || !this.host ? 'disabled' : ''}>${running ? 'Measuring' : 'Run benchmark'}</button>
234
+ </div>
235
+ <p class="caption">Embeds a neutral sentence with the selected model, never vault text. Runs only against a local model.</p>
236
+ ${b.phase === 'failed' ? `<p class="notice bad" data-design-component="notice">Benchmark failed: ${escapeHtml(b.error)}</p>` : ''}
237
+ ${b.phase === 'done' ? `
238
+ <dl class="facts">
239
+ <div><dt>Per embedding</dt><dd class="mono">${shown(d.ms_per_embedding)} ms</dd></div>
240
+ <div><dt>Range</dt><dd class="mono">${shown(d.min_ms)}${DASH}${shown(d.max_ms)} ms</dd></div>
241
+ <div><dt>Samples</dt><dd class="mono">${shown(d.samples)} × ${shown(d.dims)} dims</dd></div>
242
+ <div><dt>Full vault</dt><dd class="mono">${d.projected_minutes === null || d.projected_minutes === undefined ? DASH : `about ${escapeHtml(d.projected_minutes)} min for ${shown(d.vault_nodes)} nodes`}</dd></div>
243
+ <div><dt>Measured</dt><dd class="mono">${shown(d.model)} on ${shown(d.url)}</dd></div>
244
+ </dl>` : ''}`;
245
+ }
246
+
247
+ renderPull() {
248
+ const p = this.pull;
249
+ const running = p.phase === 'running';
250
+ const d = p.data || {};
251
+ return `
252
+ <div class="action">
253
+ <label class="field grow">Model name
254
+ <input id="pull-model" type="text" spellcheck="false" autocomplete="off" value="${escapeHtml(this.pullModel)}" ${running ? 'disabled' : ''}>
255
+ </label>
256
+ <button id="pull-run" type="button" class="primary" data-design-component="button-primary" ${running || !this.host ? 'disabled' : ''}>${running ? 'Pulling' : 'Pull model'}</button>
257
+ </div>
258
+ <p class="caption">Downloads the named model to the configured loopback endpoint. Cloud and upstream models are refused. A pull can take several minutes.</p>
259
+ ${p.phase === 'failed' ? `<p class="notice bad" data-design-component="notice">Pull failed${d.model ? ` for <span class="mono">${escapeHtml(d.model)}</span>` : ''}: ${escapeHtml(p.error)}</p>` : ''}
260
+ ${p.phase === 'done' ? `<p class="notice ok" data-design-component="notice"><span class="mono">${shown(d.model)}</span> is ready on <span class="mono">${shown(d.url)}</span>.</p>` : ''}`;
261
+ }
262
+
263
+ render() {
264
+ const root = this.shadowRoot;
265
+ if (!root) return;
266
+ const loading = this.status.phase === 'loading' || this.models.phase === 'loading';
267
+ root.innerHTML = `
268
+ <style>
269
+ :host {
270
+ display: block;
271
+ box-sizing: border-box;
272
+ padding: var(--spacing-lg, 16px);
273
+ color: var(--colors-text, #ecfeff);
274
+ background: var(--colors-background, #07171d);
275
+ font-family: var(--typography-body-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
276
+ font-size: var(--typography-body-font-size, 13px);
277
+ }
278
+ *, *::before, *::after { box-sizing: border-box; }
279
+ @media (prefers-reduced-motion: reduce) {
280
+ *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
281
+ }
282
+ header { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-md, 12px); flex-wrap: wrap; margin-bottom: var(--spacing-lg, 16px); }
283
+ h1 { margin: 0; font-size: 18px; }
284
+ h1 + p { margin: 2px 0 0; color: var(--colors-muted, #67e8f9); font-size: var(--typography-label-font-size, 11px); }
285
+ h2 { margin: 0 0 var(--spacing-md, 12px); font-size: var(--typography-label-font-size, 11px); font-weight: var(--typography-label-font-weight, 700); letter-spacing: 0.05em; text-transform: uppercase; color: var(--colors-muted, #67e8f9); }
286
+ .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: var(--spacing-md, 12px); }
287
+ section { background: var(--colors-surface, #0e2a35); border: 1px solid var(--colors-line, #164e63); border-radius: var(--rounded-md, 6px); padding: var(--spacing-md, 12px); min-width: 0; }
288
+ .mono { font-family: var(--typography-mono-font-family, 'JetBrains Mono', 'Fira Code', monospace); font-size: var(--typography-mono-font-size, 12px); overflow-wrap: anywhere; }
289
+ .verdict { display: flex; align-items: center; gap: var(--spacing-sm, 8px); flex-wrap: wrap; margin-bottom: var(--spacing-md, 12px); }
290
+ .chip { font-size: var(--typography-label-font-size, 11px); font-weight: 700; text-transform: uppercase; padding: var(--spacing-xs, 4px) var(--spacing-sm, 8px); border-radius: var(--rounded-md, 6px); border: 1px solid currentColor; }
291
+ .note, .caption { color: var(--colors-muted, #67e8f9); font-size: var(--typography-label-font-size, 11px); }
292
+ .caption { margin: 0 0 var(--spacing-sm, 8px); }
293
+ .ok { color: var(--colors-ok, #10b981); }
294
+ .warn { color: var(--colors-warn, #f59e0b); }
295
+ .bad { color: var(--colors-danger, #ef4444); }
296
+ .muted { color: var(--colors-muted, #67e8f9); }
297
+ .facts { display: grid; gap: var(--spacing-xs, 4px); margin: 0; }
298
+ .facts div { display: flex; justify-content: space-between; gap: var(--spacing-md, 12px); }
299
+ dt { color: var(--colors-muted, #67e8f9); }
300
+ dt, dd { min-width: 0; }
301
+ dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
302
+ .notice { margin: var(--spacing-sm, 8px) 0 0; padding: var(--spacing-sm, 8px); background: var(--colors-background, #07171d); border-radius: var(--rounded-sm, 4px); }
303
+ .attempts, .counts, .models { list-style: none; margin: var(--spacing-sm, 8px) 0 0; padding: 0; display: grid; gap: var(--spacing-xs, 4px); }
304
+ .coverage { display: flex; align-items: baseline; gap: var(--spacing-md, 12px); flex-wrap: wrap; margin-bottom: var(--spacing-sm, 8px); }
305
+ .figure { font-family: var(--typography-figure-font-family, 'JetBrains Mono', monospace); font-size: var(--typography-figure-font-size, 28px); font-weight: var(--typography-figure-font-weight, 800); }
306
+ .figure-caption { color: var(--colors-muted, #67e8f9); }
307
+ .count-row { display: flex; justify-content: space-between; font-family: var(--typography-mono-font-family, 'JetBrains Mono', monospace); font-size: var(--typography-mono-font-size, 12px); }
308
+ .count-row:not(.ok):not(.warn) { color: var(--colors-muted, #67e8f9); }
309
+ .counts { margin-bottom: var(--spacing-md, 12px); }
310
+ .model-row { display: flex; justify-content: space-between; align-items: center; gap: var(--spacing-sm, 8px); flex-wrap: wrap; background: var(--colors-background, #07171d); border: 1px solid var(--colors-line, #164e63); border-radius: var(--rounded-sm, 4px); padding: var(--spacing-sm, 8px); }
311
+ .model-row.selected { border-color: var(--colors-primary, #06b6d4); }
312
+ .tags { display: flex; gap: var(--spacing-xs, 4px); flex-wrap: wrap; }
313
+ .tag { font-size: 10px; padding: 2px 6px; border-radius: var(--rounded-sm, 4px); border: 1px solid var(--colors-line, #164e63); color: var(--colors-muted, #67e8f9); }
314
+ .tag.ok { color: var(--colors-ok, #10b981); }
315
+ .tag.warn { color: var(--colors-warn, #f59e0b); }
316
+ .action { display: flex; align-items: flex-end; gap: var(--spacing-sm, 8px); flex-wrap: wrap; margin-bottom: var(--spacing-sm, 8px); }
317
+ .field { display: grid; gap: var(--spacing-xs, 4px); color: var(--colors-muted, #67e8f9); font-size: var(--typography-label-font-size, 11px); }
318
+ .field.grow { flex: 1 1 180px; }
319
+ input { min-height: 44px; padding: 0 var(--spacing-sm, 8px); color: var(--colors-text, #ecfeff); background: var(--colors-background, #07171d); border: 1px solid var(--colors-line, #164e63); border-radius: var(--rounded-sm, 4px); font-family: var(--typography-mono-font-family, 'JetBrains Mono', monospace); }
320
+ input[type=number] { width: 88px; }
321
+ button.primary { min-height: 44px; padding: 0 var(--spacing-lg, 16px); border: 0; border-radius: var(--rounded-sm, 4px); cursor: pointer; font-weight: 700; color: var(--colors-on-primary, #07171d); background: var(--colors-primary, #06b6d4); transition: background 0.15s ease; }
322
+ button.primary:hover:not(:disabled) { background: var(--colors-primary-hover, #22d3ee); }
323
+ button:disabled { opacity: 0.6; cursor: not-allowed; }
324
+ button.refresh { min-height: 44px; padding: 0 var(--spacing-md, 12px); color: var(--colors-text, #ecfeff); background: transparent; border: 1px solid var(--colors-line, #164e63); border-radius: var(--rounded-sm, 4px); cursor: pointer; }
325
+ button:focus-visible, input:focus-visible { outline: 2px solid var(--colors-primary-hover, #22d3ee); outline-offset: 2px; }
326
+ </style>
327
+ <header>
328
+ <div>
329
+ <h1>Embeddings</h1>
330
+ <p>Vectors behind Total Recall search for this brain</p>
331
+ </div>
332
+ <button id="refresh" type="button" class="refresh" ${loading || !this.host ? 'disabled' : ''}>${loading ? 'Reading' : 'Refresh'}</button>
333
+ </header>
334
+ <div class="grid">
335
+ <section data-design-component="section" aria-labelledby="h-provider"><h2 id="h-provider">Provider</h2>${this.renderProvider()}</section>
336
+ <section data-design-component="section" aria-labelledby="h-coverage"><h2 id="h-coverage">Vault coverage</h2>${this.renderCoverage()}</section>
337
+ <section data-design-component="section" aria-labelledby="h-models"><h2 id="h-models">Models on the endpoint</h2>${this.renderModels()}</section>
338
+ <section data-design-component="section" aria-labelledby="h-credentials"><h2 id="h-credentials">Credentials</h2>${this.renderCredentials()}</section>
339
+ <section data-design-component="section" aria-labelledby="h-benchmark"><h2 id="h-benchmark">Benchmark</h2>${this.renderBenchmark()}</section>
340
+ <section data-design-component="section" aria-labelledby="h-pull"><h2 id="h-pull">Pull a model</h2>${this.renderPull()}</section>
341
+ </div>`;
342
+
343
+ root.getElementById('refresh')?.addEventListener('click', () => this.load());
344
+ root.getElementById('bench-count')?.addEventListener('input', e => { this.count = e.target.value; });
345
+ root.getElementById('bench-run')?.addEventListener('click', () => this.runBenchmark());
346
+ root.getElementById('pull-model')?.addEventListener('input', e => { this.pullModel = e.target.value; });
347
+ root.getElementById('pull-run')?.addEventListener('click', () => this.runPull());
348
+ }
349
+ }
350
+
351
+ if (!customElements.get('tr-embeddings-home')) {
352
+ customElements.define('tr-embeddings-home', EmbeddingsHome);
353
+ }