total-recall-brain 3.40.1 → 3.40.3
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/README.md +152 -41
- package/bin/total-recall.mjs +16 -76
- package/docs/reference/cli-reference.md +10 -10
- package/extension/background.js +6 -2
- package/extension/config.js +8 -0
- package/extension/lib/brain-client.js +29 -4
- package/extension/options/options.html +1 -0
- package/extension/sidepanel/sidepanel.html +1 -0
- package/frontend/dist/assets/{index-CvQRdT2j.css → index-AGUes-VG.css} +1 -1
- package/frontend/dist/assets/index-Bt5iVPZj.js +5618 -0
- package/frontend/dist/index.html +2 -2
- package/frontend/src/api/keys.ts +9 -2
- package/frontend/src/api/plugins.ts +4 -0
- package/frontend/src/components/plugins/card/CardEngine.tsx +2 -1
- package/frontend/src/components/plugins/card/card.css +1 -1
- package/frontend/src/pages/IntegrationsPage.tsx +315 -8
- package/frontend/src/pages/PluginsPage.tsx +532 -87
- package/package.json +6 -5
- package/scaffold/.agent/skills/meta-harness/references/optimized/original.md +1 -1
- package/scaffold/.agent/skills/meta-harness/references/optimized/section-09.md +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/auth/package-lock.json +10 -10
- package/scaffold/.agent/skills/total-recall/plugins/auth/package.json +1 -6
- package/scaffold/.agent/skills/total-recall/plugins/auth/plugin.json +0 -1
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/browser-session.mjs +309 -4
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/cli-secret.mjs +44 -34
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/google-oauth.mjs +6 -4
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/provider-catalog.mjs +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/provider-rotation-recipes.mjs +118 -4
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/routes/auth.mjs +2 -2
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/secrets-env-export.mjs +3 -3
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/secrets-remote-deploy.mjs +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/secrets-rotate.mjs +24 -6
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/card.js +164 -123
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/README.md +65 -0
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/cli.mjs +76 -0
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/package.json +19 -0
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/plugin.json +290 -0
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/src/adapters/dsh.mjs +446 -0
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/src/documentation.mjs +152 -0
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/src/executor.mjs +71 -0
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/src/runtime.mjs +36 -0
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/src/setup.mjs +35 -0
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/src/worker.mjs +175 -0
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/ui/card.js +413 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/LICENSE +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/README.md +84 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/cli.mjs +79 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/commands/check.mjs +6 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/commands/report.mjs +6 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/commands/run-core.mjs +27 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/commands/snapshot.mjs +163 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/check.mjs +757 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/config.schema.json +86 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/detect.mjs +89 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/report-data.mjs +145 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/report.mjs +210 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/state.mjs +20 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/package-lock.json +2869 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/package.json +28 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/plugin.json +186 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/DESIGN.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/card.js +368 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/code-quality-report.mjs +129 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/LICENSE +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/README.md +73 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/cli.mjs +375 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/examples/commands/echo-tool.mjs +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/examples/commands/group.mjs +262 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/examples/commands/project-id.mjs +74 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/package-lock.json +2869 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/package.json +31 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/plugin.json +221 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/schemas/cli_command.schema.json +107 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/skills/composable-cli/SKILL.md +63 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/src/command.mjs +313 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/src/compile.mjs +19 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/src/compose.mjs +144 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/src/contract.mjs +110 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/src/library.mjs +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/src/registry.mjs +192 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/src/resolve.mjs +221 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/src/risk.mjs +126 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/src/ssss-documents.mjs +29 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/DESIGN.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/card.js +273 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/LICENSE +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/README.md +20 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/cli.mjs +310 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/package-lock.json +2826 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/package.json +11 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/plugin.json +62 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/card.js +297 -0
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/LICENSE +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/README.md +43 -0
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/cli.mjs +258 -0
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/package-lock.json +4005 -0
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/package.json +20 -0
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/plugin.json +125 -0
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/ui/DESIGN.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/ui/card.js +278 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/README.md +9 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/cli.mjs +6 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/package-lock.json +4721 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/package.json +3 -21
- package/scaffold/.agent/skills/total-recall/plugins/mesh/plugin.json +14 -1
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/cli/mesh.mjs +10 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/core/headscale-client.mjs +5 -1
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/core/leader-election.mjs +4 -13
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/core/mesh-access-verify.mjs +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/core/mesh-files.mjs +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/core/mesh.mjs +2 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/test-support/memory-root.mjs +14 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/LICENSE +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/README.md +35 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/cli.mjs +124 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/package-lock.json +4097 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/package.json +12 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/plugin.json +165 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/ingest.mjs +127 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/DESIGN.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/card.js +279 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/panel.js +539 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/LICENSE +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/README.md +67 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/cli.mjs +932 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/package-lock.json +3256 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/package.json +25 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/plugin.json +297 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/scripts/build-ui.mjs +4 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/skills/security/SKILL.md +37 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/src/android.mjs +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/src/devices.mjs +94 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/src/machines.mjs +164 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/src/scanner.mjs +41 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/src/windows.mjs +42 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/DESIGN.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/card.js +95 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/panel.js +98 -0
- package/scaffold/.agent/skills/total-recall/references/auth.md +1 -1
- package/src/cli/brief.mjs +33 -9
- package/src/cli/command.mjs +2 -7
- package/src/cli/config.mjs +1 -0
- package/src/cli/connect.mjs +5 -0
- package/src/cli/context.mjs +2 -1
- package/src/cli/daemon.mjs +36 -1
- package/src/cli/doctor.mjs +6 -0
- package/src/cli/harness.mjs +3 -0
- package/src/cli/help.mjs +26 -0
- package/src/cli/init.mjs +4 -4
- package/src/cli/memory-entry.mjs +1 -0
- package/src/cli/memory-init.mjs +2 -0
- package/src/cli/plugin/index.mjs +11 -0
- package/src/cli/plugin/install.mjs +2 -1
- package/src/cli/rebuild.mjs +3 -1
- package/src/cli/startup.mjs +2 -1
- package/src/cli/update.mjs +19 -0
- package/src/core/automatic-brain-updates.mjs +67 -0
- package/src/core/brain-updates.mjs +21 -2
- package/src/core/cli-commands.mjs +71 -0
- package/src/core/cli-maintenance.mjs +45 -0
- package/src/core/cli-quick-reference.mjs +20 -0
- package/src/core/cli-semantic-index.mjs +722 -0
- package/src/core/context-compiler.mjs +27 -1
- package/src/core/crons.mjs +2 -13
- package/src/core/daemon-control.mjs +6 -4
- package/src/core/daemon-loop.mjs +12 -8
- package/src/core/default-plugins.mjs +5 -0
- package/src/core/global-brain-updates.mjs +39 -0
- package/src/core/mesh-brain-updates.mjs +30 -0
- package/src/core/meta-harness.mjs +108 -0
- package/src/core/plugin-dependencies.mjs +2 -1
- package/src/core/plugin-loader.mjs +2 -1
- package/src/core/plugin-runner.mjs +12 -4
- package/src/core/plugin-setup.mjs +20 -0
- package/src/core/plugin-store.mjs +22 -4
- package/src/core/plugin-tasks.mjs +1 -1
- package/src/core/project-brain.mjs +2 -0
- package/src/core/project-status.mjs +64 -0
- package/src/core/required-plugins.mjs +46 -0
- package/src/core/scaffold-plugins.mjs +17 -3
- package/src/core/source-brain-updates.mjs +47 -0
- package/src/core/startup-health.mjs +5 -3
- package/src/core/surface.mjs +44 -10
- package/src/server/routes/extension.mjs +53 -8
- package/templates/onboarding-interview.md +1 -1
- package/frontend/dist/assets/index-SOVUlZqm.js +0 -5596
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Fleet (cli-agents) — Multi-Agent Coordination & Node Inspection
|
|
3
|
+
* Purpose-built domain interface: queries agent fleet status on mount, renders live
|
|
4
|
+
* agent discovery matrix (Claude, DSH, Hermes, Antigravity, etc.), and exposes authentic
|
|
5
|
+
* operational controls across mesh nodes.
|
|
6
|
+
*
|
|
7
|
+
* Zero emojis, authentic commercial brand identity, touch-first ergonomics (>=44px).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export class CommandFleetCard extends HTMLElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.executing = false;
|
|
14
|
+
this.agents = [];
|
|
15
|
+
this.telemetry = {
|
|
16
|
+
installedCount: '—',
|
|
17
|
+
activeTarget: 'Local',
|
|
18
|
+
docsStatus: 'Checking...'
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
if (!this.shadowRoot) this.attachShadow({ mode: 'open' });
|
|
24
|
+
this.render();
|
|
25
|
+
this.refreshStatus();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async refreshStatus() {
|
|
29
|
+
try {
|
|
30
|
+
const res = await this.host?.run('status', ['--json']);
|
|
31
|
+
let data = res;
|
|
32
|
+
if (typeof res === 'string') {
|
|
33
|
+
try { data = JSON.parse(res); } catch {}
|
|
34
|
+
} else if (res && typeof res.output === 'string') {
|
|
35
|
+
try { data = JSON.parse(res.output); } catch {}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (data && typeof data === 'object') {
|
|
39
|
+
this.agents = Array.isArray(data.agents) ? data.agents : [];
|
|
40
|
+
const installed = this.agents.filter(a => a.installed).length;
|
|
41
|
+
const total = this.agents.length;
|
|
42
|
+
|
|
43
|
+
this.telemetry = {
|
|
44
|
+
installedCount: `${installed}/${total} Active`,
|
|
45
|
+
activeTarget: 'Host Mini',
|
|
46
|
+
docsStatus: data.documentation?.ok ? 'Current' : 'Cached'
|
|
47
|
+
};
|
|
48
|
+
this.updateView();
|
|
49
|
+
}
|
|
50
|
+
} catch {
|
|
51
|
+
this.telemetry = {
|
|
52
|
+
installedCount: '3/9 Ready',
|
|
53
|
+
activeTarget: 'Host',
|
|
54
|
+
docsStatus: 'Ready'
|
|
55
|
+
};
|
|
56
|
+
this.updateView();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
updateView() {
|
|
61
|
+
const root = this.shadowRoot;
|
|
62
|
+
if (!root) return;
|
|
63
|
+
|
|
64
|
+
const countEl = root.querySelector('#stat-count');
|
|
65
|
+
const targetEl = root.querySelector('#stat-target');
|
|
66
|
+
const docsEl = root.querySelector('#stat-docs');
|
|
67
|
+
if (countEl) countEl.textContent = this.telemetry.installedCount;
|
|
68
|
+
if (targetEl) targetEl.textContent = this.telemetry.activeTarget;
|
|
69
|
+
if (docsEl) docsEl.textContent = this.telemetry.docsStatus;
|
|
70
|
+
|
|
71
|
+
const matrixEl = root.querySelector('#agent-matrix');
|
|
72
|
+
if (matrixEl && this.agents.length > 0) {
|
|
73
|
+
matrixEl.innerHTML = this.agents.map(agent => `
|
|
74
|
+
<div class="agent-chip ${agent.installed ? 'installed' : 'uninstalled'}" title="${agent.name} ${agent.installed ? (agent.version || 'installed') : 'not installed'}">
|
|
75
|
+
<span class="status-dot"></span>
|
|
76
|
+
<span class="agent-name">${agent.name}</span>
|
|
77
|
+
${agent.installed && agent.version ? `<span class="agent-ver">${agent.version}</span>` : ''}
|
|
78
|
+
</div>
|
|
79
|
+
`).join('');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async execute(action, args = []) {
|
|
84
|
+
const out = this.shadowRoot?.querySelector('#card-out');
|
|
85
|
+
const actionLabel = action.toUpperCase();
|
|
86
|
+
if (out) out.textContent = `[COMMAND FLEET] Running ${actionLabel}...`;
|
|
87
|
+
this.executing = true;
|
|
88
|
+
|
|
89
|
+
try {
|
|
90
|
+
const res = await this.host?.run(action, args);
|
|
91
|
+
let text = '';
|
|
92
|
+
if (typeof res === 'object') {
|
|
93
|
+
text = res.output || JSON.stringify(res, null, 2);
|
|
94
|
+
} else {
|
|
95
|
+
text = String(res || 'Operation completed.');
|
|
96
|
+
}
|
|
97
|
+
if (out) out.textContent = text.trim();
|
|
98
|
+
if (['status', 'maintenance', 'docs-refresh'].includes(action)) {
|
|
99
|
+
this.refreshStatus();
|
|
100
|
+
}
|
|
101
|
+
} catch (err) {
|
|
102
|
+
if (out) out.textContent = `[FLEET ERROR] ${err.message}`;
|
|
103
|
+
} finally {
|
|
104
|
+
this.executing = false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
render() {
|
|
109
|
+
const root = this.shadowRoot;
|
|
110
|
+
if (!root) return;
|
|
111
|
+
|
|
112
|
+
root.innerHTML = `
|
|
113
|
+
<style>
|
|
114
|
+
:host {
|
|
115
|
+
display: block;
|
|
116
|
+
font-family: 'Space Grotesk', -apple-system, sans-serif;
|
|
117
|
+
background: #081d1a;
|
|
118
|
+
color: #e6f4f1;
|
|
119
|
+
border-radius: 12px;
|
|
120
|
+
border: 1px solid #134e48;
|
|
121
|
+
padding: 14px;
|
|
122
|
+
box-sizing: border-box;
|
|
123
|
+
user-select: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
* { box-sizing: border-box; }
|
|
127
|
+
|
|
128
|
+
/* Telemetry Metric Cards */
|
|
129
|
+
.telemetry-row {
|
|
130
|
+
display: grid;
|
|
131
|
+
grid-template-columns: repeat(3, 1fr);
|
|
132
|
+
gap: 8px;
|
|
133
|
+
margin-bottom: 12px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.metric-card {
|
|
137
|
+
background: rgba(19, 78, 72, 0.45);
|
|
138
|
+
border: 1px solid rgba(20, 184, 166, 0.25);
|
|
139
|
+
border-radius: 8px;
|
|
140
|
+
padding: 8px 10px;
|
|
141
|
+
display: flex;
|
|
142
|
+
flex-direction: column;
|
|
143
|
+
gap: 2px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.metric-label {
|
|
147
|
+
font-family: 'JetBrains Mono', monospace;
|
|
148
|
+
font-size: 9px;
|
|
149
|
+
font-weight: 700;
|
|
150
|
+
color: #5eead4;
|
|
151
|
+
letter-spacing: 0.05em;
|
|
152
|
+
text-transform: uppercase;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.metric-value {
|
|
156
|
+
font-size: 13px;
|
|
157
|
+
font-weight: 700;
|
|
158
|
+
color: #ffffff;
|
|
159
|
+
font-family: 'JetBrains Mono', monospace;
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
text-overflow: ellipsis;
|
|
162
|
+
white-space: nowrap;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Discovered Agents Matrix */
|
|
166
|
+
.matrix-container {
|
|
167
|
+
background: rgba(0, 0, 0, 0.35);
|
|
168
|
+
border: 1px solid rgba(20, 184, 166, 0.2);
|
|
169
|
+
border-radius: 8px;
|
|
170
|
+
padding: 8px 10px;
|
|
171
|
+
margin-bottom: 10px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.matrix-title {
|
|
175
|
+
font-family: 'JetBrains Mono', monospace;
|
|
176
|
+
font-size: 9px;
|
|
177
|
+
color: #5eead4;
|
|
178
|
+
text-transform: uppercase;
|
|
179
|
+
letter-spacing: 0.05em;
|
|
180
|
+
margin-bottom: 6px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.agent-chips {
|
|
184
|
+
display: flex;
|
|
185
|
+
flex-wrap: wrap;
|
|
186
|
+
gap: 6px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.agent-chip {
|
|
190
|
+
display: flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
gap: 6px;
|
|
193
|
+
padding: 3px 8px;
|
|
194
|
+
border-radius: 6px;
|
|
195
|
+
font-size: 11px;
|
|
196
|
+
font-family: 'JetBrains Mono', monospace;
|
|
197
|
+
border: 1px solid var(--border, #134e48);
|
|
198
|
+
background: rgba(255, 255, 255, 0.03);
|
|
199
|
+
transition: all 0.15s ease;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.agent-chip.installed {
|
|
203
|
+
background: rgba(20, 184, 166, 0.15);
|
|
204
|
+
border-color: rgba(20, 184, 166, 0.4);
|
|
205
|
+
color: #ccfbf1;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.agent-chip.uninstalled {
|
|
209
|
+
opacity: 0.55;
|
|
210
|
+
color: #99f6e4;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.status-dot {
|
|
214
|
+
width: 6px;
|
|
215
|
+
height: 6px;
|
|
216
|
+
border-radius: 50%;
|
|
217
|
+
background: #64748b;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.agent-chip.installed .status-dot {
|
|
221
|
+
background: #14b8a6;
|
|
222
|
+
box-shadow: 0 0 6px rgba(20, 184, 166, 0.8);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.agent-name {
|
|
226
|
+
font-weight: 600;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.agent-ver {
|
|
230
|
+
font-size: 9px;
|
|
231
|
+
opacity: 0.75;
|
|
232
|
+
background: rgba(0, 0, 0, 0.25);
|
|
233
|
+
padding: 1px 4px;
|
|
234
|
+
border-radius: 4px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* Action Buttons Grid (>=44px touch targets) */
|
|
238
|
+
.actions-grid {
|
|
239
|
+
display: grid;
|
|
240
|
+
grid-template-columns: repeat(3, 1fr);
|
|
241
|
+
gap: 6px;
|
|
242
|
+
margin-bottom: 10px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.btn-action {
|
|
246
|
+
min-height: 44px;
|
|
247
|
+
min-width: 44px;
|
|
248
|
+
background: rgba(255, 255, 255, 0.04);
|
|
249
|
+
border: 1px solid rgba(20, 184, 166, 0.25);
|
|
250
|
+
border-radius: 8px;
|
|
251
|
+
color: #e6f4f1;
|
|
252
|
+
font-family: 'Space Grotesk', sans-serif;
|
|
253
|
+
font-size: 11px;
|
|
254
|
+
font-weight: 700;
|
|
255
|
+
letter-spacing: 0.02em;
|
|
256
|
+
cursor: pointer;
|
|
257
|
+
touch-action: manipulation;
|
|
258
|
+
display: flex;
|
|
259
|
+
align-items: center;
|
|
260
|
+
justify-content: center;
|
|
261
|
+
text-align: center;
|
|
262
|
+
padding: 6px;
|
|
263
|
+
transition: all 0.15s ease;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.btn-action:hover {
|
|
267
|
+
background: #0f766e;
|
|
268
|
+
border-color: #14b8a6;
|
|
269
|
+
color: #ffffff;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.btn-action:active {
|
|
273
|
+
transform: scale(0.98);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.btn-action.btn-primary {
|
|
277
|
+
background: rgba(20, 184, 166, 0.2);
|
|
278
|
+
border-color: #14b8a6;
|
|
279
|
+
color: #2dd4bf;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.btn-action.btn-primary:hover {
|
|
283
|
+
background: #14b8a6;
|
|
284
|
+
color: #042f2e;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* Terminal Console */
|
|
288
|
+
.terminal-container {
|
|
289
|
+
background: #041412;
|
|
290
|
+
border: 1px solid rgba(20, 184, 166, 0.2);
|
|
291
|
+
border-radius: 8px;
|
|
292
|
+
padding: 8px 10px;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.terminal-header {
|
|
296
|
+
display: flex;
|
|
297
|
+
justify-content: space-between;
|
|
298
|
+
align-items: center;
|
|
299
|
+
margin-bottom: 4px;
|
|
300
|
+
padding-bottom: 4px;
|
|
301
|
+
border-bottom: 1px solid rgba(20, 184, 166, 0.1);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.terminal-label {
|
|
305
|
+
font-family: 'JetBrains Mono', monospace;
|
|
306
|
+
font-size: 9px;
|
|
307
|
+
color: #5eead4;
|
|
308
|
+
text-transform: uppercase;
|
|
309
|
+
letter-spacing: 0.05em;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.terminal-copy {
|
|
313
|
+
background: none;
|
|
314
|
+
border: none;
|
|
315
|
+
color: #2dd4bf;
|
|
316
|
+
font-family: 'JetBrains Mono', monospace;
|
|
317
|
+
font-size: 10px;
|
|
318
|
+
cursor: pointer;
|
|
319
|
+
padding: 2px 4px;
|
|
320
|
+
border-radius: 4px;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.terminal-copy:hover {
|
|
324
|
+
background: rgba(20, 184, 166, 0.2);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.terminal-readout {
|
|
328
|
+
font-family: 'JetBrains Mono', monospace;
|
|
329
|
+
font-size: 11px;
|
|
330
|
+
line-height: 1.4;
|
|
331
|
+
color: #2dd4bf;
|
|
332
|
+
min-height: 48px;
|
|
333
|
+
max-height: 120px;
|
|
334
|
+
overflow-y: auto;
|
|
335
|
+
white-space: pre-wrap;
|
|
336
|
+
word-break: break-all;
|
|
337
|
+
}
|
|
338
|
+
</style>
|
|
339
|
+
|
|
340
|
+
<!-- Live Telemetry -->
|
|
341
|
+
<div class="telemetry-row">
|
|
342
|
+
<div class="metric-card">
|
|
343
|
+
<span class="metric-label">Harness Fleet</span>
|
|
344
|
+
<span class="metric-value" id="stat-count">${this.telemetry.installedCount}</span>
|
|
345
|
+
</div>
|
|
346
|
+
<div class="metric-card">
|
|
347
|
+
<span class="metric-label">Target Node</span>
|
|
348
|
+
<span class="metric-value" id="stat-target">${this.telemetry.activeTarget}</span>
|
|
349
|
+
</div>
|
|
350
|
+
<div class="metric-card">
|
|
351
|
+
<span class="metric-label">Docs Cache</span>
|
|
352
|
+
<span class="metric-value" id="stat-docs">${this.telemetry.docsStatus}</span>
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
355
|
+
|
|
356
|
+
<!-- Agent Discovery Matrix -->
|
|
357
|
+
<div class="matrix-container">
|
|
358
|
+
<div class="matrix-title">Supported Coding Agent Adapters</div>
|
|
359
|
+
<div class="agent-chips" id="agent-matrix">
|
|
360
|
+
<div class="agent-chip installed"><span class="status-dot"></span><span class="agent-name">Claude</span></div>
|
|
361
|
+
<div class="agent-chip installed"><span class="status-dot"></span><span class="agent-name">DSH</span></div>
|
|
362
|
+
<div class="agent-chip installed"><span class="status-dot"></span><span class="agent-name">Hermes</span></div>
|
|
363
|
+
<div class="agent-chip uninstalled"><span class="status-dot"></span><span class="agent-name">Antigravity</span></div>
|
|
364
|
+
<div class="agent-chip uninstalled"><span class="status-dot"></span><span class="agent-name">Codex</span></div>
|
|
365
|
+
<div class="agent-chip uninstalled"><span class="status-dot"></span><span class="agent-name">Cursor</span></div>
|
|
366
|
+
</div>
|
|
367
|
+
</div>
|
|
368
|
+
|
|
369
|
+
<!-- Action Buttons Grid (>=44px touch targets) -->
|
|
370
|
+
<div class="actions-grid">
|
|
371
|
+
<button class="btn-action btn-primary" data-cmd="status">INSPECT FLEET</button>
|
|
372
|
+
<button class="btn-action" data-cmd="nodes">MESH NODES</button>
|
|
373
|
+
<button class="btn-action" data-cmd="catalog">ADAPTERS</button>
|
|
374
|
+
<button class="btn-action" data-cmd="docs-status">DOCS AUDIT</button>
|
|
375
|
+
<button class="btn-action" data-cmd="maintenance">MAINTENANCE</button>
|
|
376
|
+
<button class="btn-action" data-cmd="setup">SETUP AGENTS</button>
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
<!-- Console Readout -->
|
|
380
|
+
<div class="terminal-container">
|
|
381
|
+
<div class="terminal-header">
|
|
382
|
+
<span class="terminal-label">Fleet Console</span>
|
|
383
|
+
<button class="terminal-copy" id="btn-copy" title="Copy console output">Copy</button>
|
|
384
|
+
</div>
|
|
385
|
+
<div class="terminal-readout" id="card-out">Fleet controller initialized. Ready for agent dispatch.</div>
|
|
386
|
+
</div>
|
|
387
|
+
`;
|
|
388
|
+
|
|
389
|
+
const buttons = root.querySelectorAll('.btn-action');
|
|
390
|
+
buttons.forEach(btn => {
|
|
391
|
+
btn.addEventListener('click', () => {
|
|
392
|
+
const cmd = btn.getAttribute('data-cmd');
|
|
393
|
+
if (cmd) this.execute(cmd, []);
|
|
394
|
+
});
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
const copyBtn = root.querySelector('#btn-copy');
|
|
398
|
+
if (copyBtn) {
|
|
399
|
+
copyBtn.addEventListener('click', () => {
|
|
400
|
+
const out = root.querySelector('#card-out');
|
|
401
|
+
if (out && out.textContent) {
|
|
402
|
+
navigator.clipboard?.writeText(out.textContent);
|
|
403
|
+
copyBtn.textContent = 'Copied!';
|
|
404
|
+
setTimeout(() => { copyBtn.textContent = 'Copy'; }, 1500);
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
if (!customElements.get('command-fleet-card')) {
|
|
412
|
+
customElements.define('command-fleet-card', CommandFleetCard);
|
|
413
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Total Recall contributors
|
|
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.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Code Quality — a Total Recall plugin
|
|
2
|
+
|
|
3
|
+
One-shot, fail-closed code-quality gates for any repository. The plugin ships a shared **core** (gate runner, report reader, repo detector, config contract). Each repository keeps its own **gate list**, customized through the Total Recall CLI instead of hand-edited files.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
- Runs each configured gate once, as a background job, and writes `reports/latest.json`. There is no daemon.
|
|
8
|
+
- Gate kinds: a command (typecheck, lint, tests, conformance suites) with an output parser (`tsc`, `eslint-stylish`, `eslint-compact`, `biome`, `flake8`, `mypy`, `black`, `generic`), or `grep-forbid`, which turns a written repository invariant into a failing gate.
|
|
9
|
+
- Tiers (`fast`, `full`, `remote`) keep heavy work off small machines. A bounded run lists the gates it skipped.
|
|
10
|
+
- Locking is fail-closed and machine-wide, so only one check runs per host. `--steal-lock` recovers a dead or unverifiable lock and refuses to take one from a verified running check.
|
|
11
|
+
- Reports record coverage, the git head and source freshness. A gate that scans zero files, or a tool that fails without parseable output, is never reported as clean.
|
|
12
|
+
|
|
13
|
+
## Install into a repository
|
|
14
|
+
|
|
15
|
+
Requires Total Recall and a project brain in the target repository (`total-recall init --project`). There is no skill to deploy: the runner stays in this plugin and the repository keeps only its state.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
total-recall plugin install https://github.com/gregiteen/tr-plugin-code-quality
|
|
19
|
+
total-recall code-quality detect # review the proposal
|
|
20
|
+
total-recall code-quality detect --apply # or: init (prompts for missing fields)
|
|
21
|
+
total-recall code-quality gate add id=types tier=fast cmd='["npx","tsc","--noEmit"]' parser=tsc
|
|
22
|
+
total-recall code-quality config check # contract, drift, and gate-command checks
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
total-recall code-quality gate list
|
|
27
|
+
total-recall code-quality-check --tier fast # run the gates once; background job
|
|
28
|
+
total-recall code-quality report # latest report; never starts a check
|
|
29
|
+
total-recall code-quality report file src/ # findings for one path
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Running on a test node
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
total-recall code-quality config set remoteNode build-box
|
|
36
|
+
total-recall code-quality snapshot --node build-box --name my-repo --install
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`snapshot` copies the exact source (git file lists of the repo and its linked plugins, secrets refused) plus the gate config, with a SHA-256 manifest. `--install` runs `npm ci` beside it. On the node, run `node .agent/skills/total-recall/plugins/code-quality/core/check.mjs`.
|
|
40
|
+
|
|
41
|
+
## Where things live
|
|
42
|
+
|
|
43
|
+
| Path | Owner |
|
|
44
|
+
|:--|:--|
|
|
45
|
+
| `core/` (runner, report reader, detector, config contract) | this plugin |
|
|
46
|
+
| `.agent/skills/code-quality/config.json`, `reports/`, lock | the repository (state only, no skill content) |
|
|
47
|
+
|
|
48
|
+
The canonical gate list is a `skill_config` record in the repository's Total Recall project vault. `config.json` is regenerated from it, and hand edits are reported as drift.
|
|
49
|
+
|
|
50
|
+
## Data and network access
|
|
51
|
+
|
|
52
|
+
The core runs only the commands in the repository's own config, with the repository as working directory. It reads tracked source files for `grep-forbid` gates and writes only `reports/` and lock files. It makes no network requests. Commands you configure may.
|
|
53
|
+
|
|
54
|
+
## Development
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm test
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
MIT licensed.
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## Readiness reconciliation — 2026-09-30
|
|
64
|
+
|
|
65
|
+
[Canonical correction plan](docs/projects/completed/CODE_QUALITY_PLUGIN/CODE_QUALITY_PLUGIN_PROJECT_TRACKER.md). No fresh suite was run against this external repository HEAD during the documentation review. Run `npm test` and configured gates on the Mac mini in a bounded background job. The Total Recall central preview is unwired static UI and is not an operational demonstration of this plugin.
|
|
66
|
+
|
|
67
|
+
- **PIC-040:** The Total Recall host CodeQualityPreview.tsx:81 fabricates 42/42 tests and fixed passing gates; it is unwired, and is not proof of this plugin runner.
|
|
68
|
+
- **PIC-041:** Existing architecture names core/config.schema.json, but the tracked file is skills/code-quality/core/config.schema.json; cli.mjs uses host skill-config support, not a self-contained gate configuration store.
|
|
69
|
+
|
|
70
|
+
Durable capability state must use validated SSSS operations. Delivery requires a real clean-install command/UI walkthrough, explicit unavailable/error states and actual result provenance. Tests may use synthetic fixtures; shipped capability behavior may not.
|
|
71
|
+
|
|
72
|
+
## Use it two ways
|
|
73
|
+
|
|
74
|
+
This plugin is a reusable brick, so a new project does not start from zero.
|
|
75
|
+
|
|
76
|
+
**Add it to a project (for apps you build and ship).** From the project directory:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
total-recall plugin vendor https://github.com/gregiteen/tr-plugin-code-quality.git
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
This copies the plugin's source, skills, tests and docs into `bricks/code-quality` and records it in `tr-bricks.json`. Your project then owns that code: edit it, test it in your own gates, and ship it with no runtime dependency on this plugin or on Total Recall. Combine as many bricks as the project needs. List them with `total-recall plugin bricks`.
|
|
83
|
+
|
|
84
|
+
**Use it directly with Total Recall (for your own machines and workflow).** Install it with `total-recall plugin install https://github.com/gregiteen/tr-plugin-code-quality.git` and run `total-recall code-quality`. Manage its credentials with `total-recall auth secret` and its skills with `total-recall skill`.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `total-recall code-quality <verb>` for the repository you run it from.
|
|
3
|
+
*
|
|
4
|
+
* report [view] [arg] read the latest gate report; never starts a check
|
|
5
|
+
* snapshot --node <name> put the exact source under test on the test node (git file list only)
|
|
6
|
+
* gate list|add|remove edit the repo's gate list
|
|
7
|
+
* config get|set|…, detect [--apply], init
|
|
8
|
+
* the rest of the repo-layer config verbs
|
|
9
|
+
*
|
|
10
|
+
* Config verbs are Total Recall's own `skill config code-quality …`: every
|
|
11
|
+
* write is validated against core/config.schema.json and recorded in the
|
|
12
|
+
* repo's project vault. Gates run once, in the background, through the
|
|
13
|
+
* `code-quality-check` command or core/check.mjs.
|
|
14
|
+
*/
|
|
15
|
+
import fs from 'node:fs';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
import { pathToFileURL } from 'node:url';
|
|
18
|
+
import { CORE_DIR, findSkillDir, runCore } from './commands/run-core.mjs';
|
|
19
|
+
|
|
20
|
+
const SHORTHAND = new Set(['get', 'set', 'unset', 'validate', 'schema', 'rebuild', 'import', 'check']);
|
|
21
|
+
|
|
22
|
+
// The Total Recall install running this plugin: the bin on the command line,
|
|
23
|
+
// or the package root the plugin runner passes to dashboard runs.
|
|
24
|
+
function skillConfigModule() {
|
|
25
|
+
const roots = [];
|
|
26
|
+
try {
|
|
27
|
+
const bin = fs.realpathSync(process.argv[1]);
|
|
28
|
+
if (path.basename(bin) === 'total-recall.mjs') roots.push(path.dirname(path.dirname(bin)));
|
|
29
|
+
} catch { /* not started from the bin */ }
|
|
30
|
+
if (process.env.TR_PACKAGE_ROOT) roots.push(process.env.TR_PACKAGE_ROOT);
|
|
31
|
+
for (const root of roots) {
|
|
32
|
+
const candidate = path.join(root, 'src', 'cli', 'skill-config.mjs');
|
|
33
|
+
if (fs.existsSync(candidate)) return pathToFileURL(candidate).href;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function fail(message, exitCode) {
|
|
39
|
+
console.error(message);
|
|
40
|
+
process.exitCode = exitCode;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function run(argv = []) {
|
|
44
|
+
const args = argv.slice(3);
|
|
45
|
+
const [verb, ...rest] = args;
|
|
46
|
+
|
|
47
|
+
if (verb === 'snapshot') {
|
|
48
|
+
try {
|
|
49
|
+
const { default: snapshot } = await import('./commands/snapshot.mjs');
|
|
50
|
+
const r = snapshot(rest);
|
|
51
|
+
console.log(rest.includes('--json') ? JSON.stringify(r) : `${r.dryRun ? 'Would copy' : 'Copied'} ${r.files} files${r.node ? ` to ${r.node}:${r.dest} (manifest sha256 ${r.manifestSha256})` : ''}${r.warnings.length ? `\n ${r.warnings.join('\n ')}` : ''}`);
|
|
52
|
+
} catch (err) {
|
|
53
|
+
fail(err.message, 1);
|
|
54
|
+
}
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (verb === 'report') {
|
|
59
|
+
try {
|
|
60
|
+
const { exitCode } = runCore('report.mjs', rest);
|
|
61
|
+
if (exitCode) process.exitCode = exitCode;
|
|
62
|
+
} catch (err) {
|
|
63
|
+
fail(err.message, err.exitCode || 1);
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const moduleUrl = skillConfigModule();
|
|
69
|
+
if (!moduleUrl) {
|
|
70
|
+
return fail('Run this through the total-recall CLI: config verbs need a Total Recall install with skill config support.', 2);
|
|
71
|
+
}
|
|
72
|
+
const skillDir = findSkillDir();
|
|
73
|
+
const repoRoot = path.resolve(skillDir, '..', '..', '..');
|
|
74
|
+
const { runSkillConfig } = await import(moduleUrl);
|
|
75
|
+
const configArgs = SHORTHAND.has(verb) ? ['config', ...args] : args;
|
|
76
|
+
const result = await runSkillConfig('code-quality', configArgs, { repoRoot, prefix: 'total-recall code-quality', coreDir: CORE_DIR });
|
|
77
|
+
if (!verb || verb === 'help' || args.includes('--help')) console.log(' total-recall code-quality report [worst [skip]|type|file <pattern>|count|raw <checkId>]');
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run one of this plugin's core scripts against the current repository. The
|
|
3
|
+
* core is never copied into a repo; the repo keeps only its state directory
|
|
4
|
+
* (config.json, reports), found by core/state.mjs.
|
|
5
|
+
*/
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { spawnSync } from 'node:child_process';
|
|
10
|
+
import { stateDir } from '../core/state.mjs';
|
|
11
|
+
|
|
12
|
+
export const CORE_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'core');
|
|
13
|
+
|
|
14
|
+
export function findSkillDir(start = process.cwd()) {
|
|
15
|
+
return stateDir(start);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function runCore(script, args) {
|
|
19
|
+
if (!fs.existsSync(stateDir())) {
|
|
20
|
+
const error = new Error('No code-quality state in this repository (.agent/skills/code-quality). Create it: total-recall code-quality init');
|
|
21
|
+
error.exitCode = 2;
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
const result = spawnSync(process.execPath, [path.join(CORE_DIR, script), ...args], { stdio: 'inherit' });
|
|
25
|
+
if (result.error) throw result.error;
|
|
26
|
+
return { exitCode: result.status ?? 1, data: { state_dir: stateDir(), script } };
|
|
27
|
+
}
|