tr-plugin-meta-harness 0.3.0 → 0.5.26
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/DESIGN.md +86 -0
- package/README.md +257 -11
- package/capability/BRICK.md +1 -1
- package/capability/index.mjs +154 -13
- package/cli.mjs +426 -41
- package/package.json +15 -3
- package/plugin.json +1457 -119
- package/skills/meta-harness/SKILL.md +63 -25
- package/src/adoption.mjs +102 -0
- package/src/agent-user.mjs +194 -0
- package/src/alerts.mjs +220 -14
- package/src/cascade.mjs +185 -0
- package/src/chat.mjs +80 -0
- package/src/codex-models.mjs +54 -0
- package/src/compat-harness.mjs +114 -0
- package/src/control.mjs +145 -0
- package/src/coordinator.mjs +267 -358
- package/src/dispatch-request.mjs +76 -0
- package/src/dispatch.mjs +119 -0
- package/src/documentation-authority.mjs +57 -0
- package/src/documentation.mjs +120 -32
- package/src/executor.mjs +101 -22
- package/src/gate-adapters/agy.mjs +155 -0
- package/src/gate-adapters/claude.mjs +303 -0
- package/src/gate-adapters/cline.mjs +111 -0
- package/src/gate-adapters/codex.mjs +164 -0
- package/src/gate-adapters/cursor.mjs +164 -0
- package/src/gate-adapters/devin.mjs +116 -0
- package/src/gate-adapters/dsh.mjs +284 -0
- package/src/gate-adapters/grok.mjs +112 -0
- package/src/gate-adapters/hermes.mjs +217 -0
- package/src/gate-adapters/hook-files.mjs +156 -0
- package/src/gate-adapters/index.mjs +131 -0
- package/src/gate-adapters/openclaw-plugin/gate-client.js +205 -0
- package/src/gate-adapters/openclaw-plugin/index.js +25 -0
- package/src/gate-adapters/openclaw-plugin/openclaw.plugin.json +9 -0
- package/src/gate-adapters/openclaw-plugin/package.json +15 -0
- package/src/gate-adapters/openclaw.mjs +288 -0
- package/src/gate-adapters/pi.mjs +146 -0
- package/src/gate.mjs +18 -0
- package/src/harness-updates.mjs +170 -0
- package/src/included-usage.mjs +344 -0
- package/src/jobs.mjs +135 -0
- package/src/json-reply.mjs +22 -0
- package/src/learner.mjs +97 -67
- package/src/maintenance.mjs +18 -0
- package/src/mcp-server.mjs +228 -0
- package/src/model-catalog.mjs +195 -0
- package/src/model-selection.mjs +67 -0
- package/src/paths.mjs +23 -0
- package/src/pool.mjs +69 -0
- package/src/process-manager.mjs +246 -0
- package/src/process-worker.mjs +18 -0
- package/src/reasoning.mjs +231 -0
- package/src/remote-operation.mjs +76 -0
- package/src/review.mjs +241 -0
- package/src/reviews.mjs +25 -0
- package/src/router-benchmark-corpus.mjs +16 -0
- package/src/router-benchmark.mjs +208 -0
- package/src/router.mjs +265 -346
- package/src/runtime.mjs +30 -8
- package/src/session/claude.mjs +358 -0
- package/src/session/codex.mjs +501 -0
- package/src/session/result.mjs +90 -0
- package/src/session/resume.mjs +393 -0
- package/src/session/run.mjs +258 -0
- package/src/session-jobs.mjs +77 -0
- package/src/setup.mjs +6 -3
- package/src/ssss-store.mjs +20 -0
- package/src/telemetry.mjs +267 -0
- package/src/termination.mjs +28 -0
- package/src/threads.mjs +150 -0
- package/src/usage-queue.mjs +137 -0
- package/src/verify-ssss.mjs +102 -0
- package/src/worker.mjs +955 -84
- package/src/worktree.mjs +244 -0
- package/ui/chunks/adapter-docs-freshness.md +16 -0
- package/ui/chunks/chat-handoff.md +26 -0
- package/ui/chunks/fleet-maintenance.md +21 -0
- package/ui/chunks/harness-inventory.md +21 -0
- package/ui/chunks/included-access.md +18 -0
- package/ui/chunks/included-usage-verification.md +15 -0
- package/ui/chunks/independent-review.md +17 -0
- package/ui/chunks/managed-execution.md +20 -0
- package/ui/chunks/official-documentation.md +18 -0
- package/ui/chunks/quota-recovery.md +21 -0
- package/ui/chunks/review-routing-decision.md +16 -0
- package/ui/chunks/route-work.md +18 -0
- package/ui/chunks/routing-evidence.md +18 -0
- package/ui/chunks/run-ledger.md +18 -0
- package/ui/chunks/session-controls.md +16 -0
- package/ui/home.js +198 -0
- package/ui/DESIGN.md +0 -32
- package/ui/card.js +0 -845
package/ui/home.js
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
const template = document.createElement('template');
|
|
2
|
+
template.innerHTML = `
|
|
3
|
+
<style>
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
color: var(--color-text, #f1f5f9);
|
|
7
|
+
font: 14px/1.5 var(--typography-body-font-family, system-ui, sans-serif);
|
|
8
|
+
}
|
|
9
|
+
* { box-sizing: border-box; }
|
|
10
|
+
.home {
|
|
11
|
+
background: var(--color-canvas, #0c1427);
|
|
12
|
+
border: 1px solid var(--color-line, #334155);
|
|
13
|
+
border-radius: var(--radius-frame, 8px);
|
|
14
|
+
padding: var(--spacing-inset, 16px);
|
|
15
|
+
}
|
|
16
|
+
header, .actions {
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
align-items: start;
|
|
20
|
+
flex-wrap: wrap;
|
|
21
|
+
gap: var(--spacing-row, 12px);
|
|
22
|
+
}
|
|
23
|
+
h2 {
|
|
24
|
+
font-size: var(--typography-title-font-size, 18px);
|
|
25
|
+
font-weight: var(--typography-title-font-weight, 650);
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
p { margin: 0.25rem 0; }
|
|
29
|
+
.route {
|
|
30
|
+
margin-block: var(--spacing-row, 12px);
|
|
31
|
+
border-inline-start: 2px solid var(--color-signal, #38bdf8);
|
|
32
|
+
background: var(--color-surface, #1e293b);
|
|
33
|
+
padding: 0.6rem 0.75rem;
|
|
34
|
+
}
|
|
35
|
+
.label {
|
|
36
|
+
color: var(--color-signal, #38bdf8);
|
|
37
|
+
font: 600 11px/1.4 var(--typography-label-font-family, ui-monospace, monospace);
|
|
38
|
+
letter-spacing: 0.08em;
|
|
39
|
+
text-transform: uppercase;
|
|
40
|
+
}
|
|
41
|
+
.subtle { color: var(--color-muted, #94a3b8); }
|
|
42
|
+
[data-error] { color: var(--color-danger, #ef4444); }
|
|
43
|
+
.fields {
|
|
44
|
+
display: grid;
|
|
45
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
|
|
46
|
+
gap: var(--spacing-row, 12px);
|
|
47
|
+
}
|
|
48
|
+
label { display: block; font-weight: 600; }
|
|
49
|
+
input, select, button {
|
|
50
|
+
background: var(--color-surface, #1e293b);
|
|
51
|
+
border: 1px solid var(--color-line, #334155);
|
|
52
|
+
border-radius: var(--radius-frame, 8px);
|
|
53
|
+
color: inherit;
|
|
54
|
+
font: inherit;
|
|
55
|
+
min-height: 44px;
|
|
56
|
+
padding: 0.4rem 0.7rem;
|
|
57
|
+
}
|
|
58
|
+
input, select { width: 100%; min-width: 0; margin-top: 0.3rem; }
|
|
59
|
+
button { cursor: pointer; }
|
|
60
|
+
button:disabled { cursor: default; opacity: 0.55; }
|
|
61
|
+
button:focus-visible, input:focus-visible, select:focus-visible {
|
|
62
|
+
outline: 2px solid var(--color-signal, #38bdf8);
|
|
63
|
+
outline-offset: 2px;
|
|
64
|
+
}
|
|
65
|
+
.actions { align-items: center; margin-top: var(--spacing-row, 12px); }
|
|
66
|
+
#save { border-color: var(--color-signal, #38bdf8); }
|
|
67
|
+
@media (max-width: 530px) { .fields { grid-template-columns: 1fr; } }
|
|
68
|
+
</style>
|
|
69
|
+
<section class="home" aria-labelledby="default-title">
|
|
70
|
+
<header>
|
|
71
|
+
<div>
|
|
72
|
+
<h2 id="default-title">Default Chat harness</h2>
|
|
73
|
+
<p class="subtle">Use this destination with any brain selection in the Chat drawer.</p>
|
|
74
|
+
</div>
|
|
75
|
+
<button type="button" id="refresh">Reload settings</button>
|
|
76
|
+
</header>
|
|
77
|
+
<div class="route" aria-live="polite">
|
|
78
|
+
<div class="label">Saved handoff</div>
|
|
79
|
+
<strong id="saved">Reading Chat settings…</strong>
|
|
80
|
+
<p class="subtle" id="mode"></p>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="fields">
|
|
83
|
+
<label>Registered harness
|
|
84
|
+
<select id="adapter" disabled><option value="">Choose a harness</option></select>
|
|
85
|
+
</label>
|
|
86
|
+
<label>Optional launch URL
|
|
87
|
+
<input id="url" type="text" inputmode="url" autocomplete="off" maxlength="2048" disabled>
|
|
88
|
+
</label>
|
|
89
|
+
</div>
|
|
90
|
+
<p class="subtle">Use a trusted HTTPS page or a supported native Chat link.</p>
|
|
91
|
+
<div class="actions">
|
|
92
|
+
<p id="notice" class="subtle" role="status"></p>
|
|
93
|
+
<button type="button" id="save" disabled>Save default</button>
|
|
94
|
+
</div>
|
|
95
|
+
</section>
|
|
96
|
+
`;
|
|
97
|
+
|
|
98
|
+
const adapterId = /^[a-z][a-z0-9-]{0,63}$/;
|
|
99
|
+
const nativeDraft = /^codex:\/\/threads\/new(?:\?|$)/;
|
|
100
|
+
|
|
101
|
+
class MetaharnessHome extends HTMLElement {
|
|
102
|
+
#target = null;
|
|
103
|
+
#working = false;
|
|
104
|
+
|
|
105
|
+
constructor() {
|
|
106
|
+
super();
|
|
107
|
+
this.attachShadow({ mode: 'open' }).append(template.content.cloneNode(true));
|
|
108
|
+
this.#field('refresh').addEventListener('click', () => void this.load());
|
|
109
|
+
this.#field('save').addEventListener('click', () => void this.#save());
|
|
110
|
+
this.#field('adapter').addEventListener('change', () => {
|
|
111
|
+
this.#fillUrl();
|
|
112
|
+
this.#syncControls();
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
#field(id) {
|
|
117
|
+
return this.shadowRoot.getElementById(id);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
#notice(text, error = false) {
|
|
121
|
+
const notice = this.#field('notice');
|
|
122
|
+
notice.textContent = text;
|
|
123
|
+
notice.toggleAttribute('data-error', error);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
#syncControls() {
|
|
127
|
+
const adapter = this.#field('adapter');
|
|
128
|
+
const locked = this.#working || !this.#target;
|
|
129
|
+
adapter.disabled = locked;
|
|
130
|
+
this.#field('url').disabled = locked || !adapter.value;
|
|
131
|
+
this.#field('save').disabled = locked || !adapter.value;
|
|
132
|
+
this.#field('refresh').disabled = this.#working;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
#fillUrl() {
|
|
136
|
+
const { harness, href } = this.#target || {};
|
|
137
|
+
this.#field('url').value = harness?.id === this.#field('adapter').value && typeof href === 'string' && !nativeDraft.test(href)
|
|
138
|
+
? href : '';
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
#showTarget(target) {
|
|
142
|
+
if (target?.ok !== true || typeof target.configured !== 'boolean' || !Array.isArray(target.choices)) throw new Error('Invalid Chat target');
|
|
143
|
+
const choices = target.choices.filter(choice => typeof choice?.id === 'string' &&
|
|
144
|
+
adapterId.test(choice.id) && typeof choice.name === 'string');
|
|
145
|
+
const selected = choices.find(choice => choice.id === target.harness?.id);
|
|
146
|
+
if (target.configured && !selected) throw new Error('Invalid saved Chat adapter');
|
|
147
|
+
this.#target = { choices, harness: selected, href: target.href };
|
|
148
|
+
const picker = this.#field('adapter');
|
|
149
|
+
picker.replaceChildren(new Option('Choose a harness', ''), ...choices.map(choice => new Option(choice.name, choice.id)));
|
|
150
|
+
picker.value = selected?.id || '';
|
|
151
|
+
this.#fillUrl();
|
|
152
|
+
this.#field('saved').textContent = selected?.name || 'Choose a default harness';
|
|
153
|
+
this.#field('mode').textContent = !selected
|
|
154
|
+
? target.warning || `${choices.length} registered harnesses`
|
|
155
|
+
: nativeDraft.test(target.href) ? 'Opens a reviewable native draft'
|
|
156
|
+
: target.href ? 'Opens the saved destination' : 'Copy context from the Chat drawer';
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
async load() {
|
|
160
|
+
if (this.#working) return;
|
|
161
|
+
this.#working = true;
|
|
162
|
+
this.#syncControls();
|
|
163
|
+
this.#notice('Reading Chat settings…');
|
|
164
|
+
try {
|
|
165
|
+
this.#showTarget(await this.host.run('chat-target'));
|
|
166
|
+
this.#notice('');
|
|
167
|
+
} catch {
|
|
168
|
+
this.#target = null;
|
|
169
|
+
this.#field('saved').textContent = 'Chat settings unavailable';
|
|
170
|
+
this.#field('mode').textContent = '';
|
|
171
|
+
this.#notice('Reload to try the owner read again.', true);
|
|
172
|
+
} finally {
|
|
173
|
+
this.#working = false;
|
|
174
|
+
this.#syncControls();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
async #save() {
|
|
179
|
+
const id = this.#field('adapter').value;
|
|
180
|
+
if (this.#working || !this.#target?.choices.some(choice => choice.id === id)) return;
|
|
181
|
+
const url = this.#field('url').value.trim();
|
|
182
|
+
this.#working = true;
|
|
183
|
+
this.#syncControls();
|
|
184
|
+
this.#notice('Saving Chat default…');
|
|
185
|
+
try {
|
|
186
|
+
const target = await this.host.run('chat-default', [id, ...(url ? ['--url', url] : [])]);
|
|
187
|
+
this.#showTarget(target);
|
|
188
|
+
this.#notice('Chat default saved.');
|
|
189
|
+
} catch {
|
|
190
|
+
this.#notice('Could not save the default. Check the harness and launch URL.', true);
|
|
191
|
+
} finally {
|
|
192
|
+
this.#working = false;
|
|
193
|
+
this.#syncControls();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (!customElements.get('tr-metaharness-home')) customElements.define('tr-metaharness-home', MetaharnessHome);
|
package/ui/DESIGN.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# DESIGN.md — Meta Harness
|
|
2
|
-
|
|
3
|
-
```yaml
|
|
4
|
-
tokens:
|
|
5
|
-
brand-name: "Meta Harness"
|
|
6
|
-
wordmark: "META HARNESS"
|
|
7
|
-
color-primary: "#3b82f6"
|
|
8
|
-
color-background: "#0c1427"
|
|
9
|
-
color-surface: "#1e293b"
|
|
10
|
-
color-accent: "#38bdf8"
|
|
11
|
-
color-ok: "#10b981"
|
|
12
|
-
color-warn: "#f59e0b"
|
|
13
|
-
color-danger: "#ef4444"
|
|
14
|
-
color-text: "#f1f5f9"
|
|
15
|
-
color-muted: "#94a3b8"
|
|
16
|
-
color-line: "#1e293b"
|
|
17
|
-
badge: "Agent Runtime Matrix"
|
|
18
|
-
font-mono: "'JetBrains Mono', 'Fira Code', monospace"
|
|
19
|
-
border-radius: "8px"
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Brand & Typographic Wordmark
|
|
23
|
-
- **Name**: Meta Harness
|
|
24
|
-
- **Wordmark Logo**: `META HARNESS` (clean typographic badge, no invented cyber delimiters)
|
|
25
|
-
- **Palette**: Primary `#3b82f6`, Surface `#0c1427`, Secondary Surface `#1e293b`, Accent `#38bdf8`, Line `#1e293b`, Text `#f1f5f9`.
|
|
26
|
-
- **States**: Verified Pass `#10b981`, Warning `#f59e0b`, Danger `#ef4444`.
|
|
27
|
-
|
|
28
|
-
## Interface Architecture
|
|
29
|
-
1. **Header**: Descriptive typographic badge, mesh target chip, total verified agent counter.
|
|
30
|
-
2. **Mesh Node Switcher**: Dynamic toggle buttons querying registered mesh nodes.
|
|
31
|
-
3. **Multi-Agent Matrix**: Grid of supported CLI agents with binary status, auth badge, and version.
|
|
32
|
-
4. **Structured Fleet Inspector**: Interactive inspector displaying permissions, primary model, and doc freshness.
|