@lifeaitools/rdc-skills 0.24.8 → 0.24.10
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rdc",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.10",
|
|
4
4
|
"description": "RDC typed-agent dispatch skill suite for Claude Code — plan, build, review, overnight unattended builds with work-item tracking and TDD enforcement.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "LIFEAI",
|
package/git-sha.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifeaitools/rdc-skills",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.10",
|
|
4
4
|
"description": "RDC typed-agent dispatch skill suite for Claude Code - plan, build, review, overnight builds",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
"test:truth-gate": "node tests/run-evidence-gate.test.mjs && node tests/work-item-exit-gate-l2.test.mjs && node tests/work-item-exit-gate-l3.test.mjs && node tests/require-work-item-on-commit.test.mjs && node tests/harness-gates.test.mjs",
|
|
38
38
|
"test:mcp": "node tests/mcp.test.mjs",
|
|
39
39
|
"test:mcp:remote": "node tests/mcp.test.mjs --remote",
|
|
40
|
+
"test:channel-formatter": "node tests/channel-formatter.contract.test.mjs",
|
|
41
|
+
"test:channel-formatter:remote": "node tests/channel-formatter.contract.test.mjs --remote",
|
|
40
42
|
"mcp": "node bin/rdc-skills-mcp.mjs",
|
|
41
43
|
"rebuild-mcp": "node scripts/rebuild-mcp.mjs",
|
|
42
44
|
"prepack": "node scripts/prepack.mjs"
|
|
@@ -88,6 +88,9 @@ const projectRoot = projectRootArg || codexRoot || detectedLifeaiRoot;
|
|
|
88
88
|
|
|
89
89
|
const PLUGIN_KEY = 'rdc-skills@rdc-skills';
|
|
90
90
|
const MARKETPLACE = 'rdc-skills';
|
|
91
|
+
const NPM_PACKAGE = '@lifeaitools/rdc-skills';
|
|
92
|
+
const MCP_NAME = 'rdc-skills-mcp';
|
|
93
|
+
const MCP_PORT = '3110';
|
|
91
94
|
|
|
92
95
|
// ── Logging ───────────────────────────────────────────────────────────────────
|
|
93
96
|
const ok = msg => console.log(` \x1b[32m✓\x1b[0m ${msg}`);
|
|
@@ -95,6 +98,10 @@ const info = msg => console.log(` \x1b[36m→\x1b[0m ${msg}`);
|
|
|
95
98
|
const warn = msg => console.log(` \x1b[33m⚠\x1b[0m ${msg}`);
|
|
96
99
|
const fail = msg => console.log(` \x1b[31m✗\x1b[0m ${msg}`);
|
|
97
100
|
|
|
101
|
+
function run(cmd, options = {}) {
|
|
102
|
+
return execSync(cmd, { encoding: 'utf8', stdio: 'pipe', ...options }).trim();
|
|
103
|
+
}
|
|
104
|
+
|
|
98
105
|
// ── Filesystem helpers ────────────────────────────────────────────────────────
|
|
99
106
|
function copyDir(src, dst, ext) {
|
|
100
107
|
if (!fs.existsSync(src)) { warn(`Source not found: ${src}`); return 0; }
|
|
@@ -248,6 +255,76 @@ function buildPluginCache(cacheDir, version, gitSha) {
|
|
|
248
255
|
}
|
|
249
256
|
}
|
|
250
257
|
|
|
258
|
+
function getPm2Process(name) {
|
|
259
|
+
try {
|
|
260
|
+
const list = JSON.parse(run('pm2 jlist'));
|
|
261
|
+
return Array.isArray(list) ? list.find((p) => p.name === name) || null : null;
|
|
262
|
+
} catch {
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function isGlobalNpmRdcSkillsPath(scriptPath) {
|
|
268
|
+
if (!scriptPath) return false;
|
|
269
|
+
const normalized = scriptPath.replace(/\\/g, '/').toLowerCase();
|
|
270
|
+
return normalized.includes('/node_modules/@lifeaitools/rdc-skills/');
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function packageRootFromMcpScript(scriptPath) {
|
|
274
|
+
return scriptPath ? path.resolve(path.dirname(scriptPath), '..') : null;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function readInstalledPackageVersion(scriptPath) {
|
|
278
|
+
const packageRoot = packageRootFromMcpScript(scriptPath);
|
|
279
|
+
if (!packageRoot) return null;
|
|
280
|
+
return readJson(path.join(packageRoot, 'package.json'), {}).version || null;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function syncGlobalMcpInstall(version) {
|
|
284
|
+
const proc = getPm2Process(MCP_NAME);
|
|
285
|
+
if (!proc) {
|
|
286
|
+
info('[2.9] MCP pkg — PM2 process not registered yet; start handled below');
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
const scriptPath = proc.pm2_env?.pm_exec_path || proc.pm_exec_path || '';
|
|
291
|
+
if (!isGlobalNpmRdcSkillsPath(scriptPath)) {
|
|
292
|
+
info(`[2.9] MCP pkg — PM2 uses source checkout, not global npm (${scriptPath || 'unknown path'})`);
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const installedVersion = readInstalledPackageVersion(scriptPath);
|
|
297
|
+
if (installedVersion === version) {
|
|
298
|
+
ok(`[2.9] MCP pkg — global ${NPM_PACKAGE}@${version} already installed`);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
let stopped = false;
|
|
303
|
+
let installed = false;
|
|
304
|
+
try {
|
|
305
|
+
info(`[2.9] MCP pkg — updating global ${NPM_PACKAGE} ${installedVersion || '?'} → ${version}`);
|
|
306
|
+
run(`pm2 stop ${MCP_NAME}`);
|
|
307
|
+
stopped = true;
|
|
308
|
+
run(`npm install -g ${NPM_PACKAGE}@${version}`);
|
|
309
|
+
installed = true;
|
|
310
|
+
ok(`[2.9] MCP pkg — installed global ${NPM_PACKAGE}@${version}`);
|
|
311
|
+
} catch (e) {
|
|
312
|
+
warn(`[2.9] MCP pkg — global install failed (${String(e.message || e).split('\n')[0]})`);
|
|
313
|
+
if (String(e.message || '').includes('EBUSY')) {
|
|
314
|
+
info(' PM2 was stopped first; if EBUSY persists, another Node/npm process still holds the package directory.');
|
|
315
|
+
}
|
|
316
|
+
} finally {
|
|
317
|
+
if (stopped) {
|
|
318
|
+
try {
|
|
319
|
+
run(`pm2 restart ${MCP_NAME} --update-env`, { env: { ...process.env, PORT: MCP_PORT } });
|
|
320
|
+
ok(`[2.9] MCP pkg — pm2 restarted ${MCP_NAME}${installed ? '' : ' (previous install restored)'}`);
|
|
321
|
+
} catch (e) {
|
|
322
|
+
warn(`[2.9] MCP pkg — pm2 restart failed (${String(e.message || e).split('\n')[0]})`);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
251
328
|
// ── User-skills cleanup ───────────────────────────────────────────────────────
|
|
252
329
|
// Older installer versions wrote skill files directly to ~/.claude/skills/user/.
|
|
253
330
|
// Claude Code loads that directory AND the plugin cache, so any rdc skills left
|
|
@@ -753,8 +830,6 @@ function buildHooksConfig(hooksDir, profile = 'core') {
|
|
|
753
830
|
// under PM2 as `rdc-skills-mcp` on PORT=3110, and prints the claude.ai connector
|
|
754
831
|
// line. Every failure here WARNs — it must never abort the installer.
|
|
755
832
|
function registerMcpServer() {
|
|
756
|
-
const MCP_NAME = 'rdc-skills-mcp';
|
|
757
|
-
const MCP_PORT = '3110';
|
|
758
833
|
const binPath = path.join(repoRoot, 'bin', 'rdc-skills-mcp.mjs');
|
|
759
834
|
const connector = 'https://rdc-skills.regendevcorp.com/mcp';
|
|
760
835
|
|
|
@@ -907,12 +982,6 @@ async function main() {
|
|
|
907
982
|
info(` created settings.json`);
|
|
908
983
|
}
|
|
909
984
|
|
|
910
|
-
// Read version + git SHA once
|
|
911
|
-
const pkg = readJson(path.join(repoRoot, 'package.json'));
|
|
912
|
-
const version = pkg.version || '0.7.0';
|
|
913
|
-
let gitSha = '';
|
|
914
|
-
try { gitSha = execSync('git rev-parse HEAD', { cwd: repoRoot, encoding: 'utf8', stdio: 'pipe' }).trim(); } catch {}
|
|
915
|
-
|
|
916
985
|
// 0. Pull latest
|
|
917
986
|
try {
|
|
918
987
|
const before = execSync('git rev-parse HEAD', { cwd: repoRoot, encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
@@ -923,6 +992,13 @@ async function main() {
|
|
|
923
992
|
warn('[0/6] git pull failed — installing from local copy');
|
|
924
993
|
}
|
|
925
994
|
|
|
995
|
+
// Read version + git SHA after pull so plugin caches and the MCP install do
|
|
996
|
+
// not stamp the pre-update checkout.
|
|
997
|
+
const pkg = readJson(path.join(repoRoot, 'package.json'));
|
|
998
|
+
const version = pkg.version || '0.7.0';
|
|
999
|
+
let gitSha = '';
|
|
1000
|
+
try { gitSha = execSync('git rev-parse HEAD', { cwd: repoRoot, encoding: 'utf8', stdio: 'pipe' }).trim(); } catch {}
|
|
1001
|
+
|
|
926
1002
|
// 0.5a. User-skills cleanup — remove any rdc: skills from ~/.claude/skills/user/
|
|
927
1003
|
// (older installer versions wrote there; plugin cache is the only authoritative source)
|
|
928
1004
|
{
|
|
@@ -1000,6 +1076,11 @@ async function main() {
|
|
|
1000
1076
|
info('[2.6] MCP — rdc-skills endpoint already registered (claude + codex)');
|
|
1001
1077
|
}
|
|
1002
1078
|
|
|
1079
|
+
// If the live MCP is served from the global npm package, update that exact
|
|
1080
|
+
// install before restarting PM2. Windows otherwise holds the package tree open
|
|
1081
|
+
// and `npm install -g` can fail with EBUSY.
|
|
1082
|
+
syncGlobalMcpInstall(version);
|
|
1083
|
+
|
|
1003
1084
|
// 2.7. Symlinks in regen-root/.claude/skills/ (FS MCP + claude.ai access)
|
|
1004
1085
|
if (codexRoot) {
|
|
1005
1086
|
const skillsLinkDir = path.join(codexRoot, '.claude', 'skills');
|
|
@@ -107,6 +107,12 @@ skills named in the scope boundary.
|
|
|
107
107
|
> doc" → **`rdc:convert`**. "format this content the Word way / write it for LinkedIn" →
|
|
108
108
|
> this skill. The Word/DOCX and PDF sections below describe target structure only; producing
|
|
109
109
|
> the actual `.docx`/`.pdf` artifact is `rdc:convert` / `rdc:brochure`, not channel-formatter.
|
|
110
|
+
>
|
|
111
|
+
> Specialist routing:
|
|
112
|
+
> - Office/Markdown file conversion → `rdc:convert`
|
|
113
|
+
> - HTML/folder/zip/URL to PDF brochure rendering → `rdc:brochure`
|
|
114
|
+
> - Brochurify orchestration jobs → `rdc:brochurify`
|
|
115
|
+
> - Brochure JSX using `@lifeai/brochure-kit` → `lifeai-brochure-author`
|
|
110
116
|
|
|
111
117
|
---
|
|
112
118
|
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Contract/system test for rdc:channel-formatter content repurposing.
|
|
4
|
+
*
|
|
5
|
+
* This does not test LLM prose generation. rdc:channel-formatter is an
|
|
6
|
+
* instruction skill served by the MCP, not an executable formatter function.
|
|
7
|
+
* What this test proves is that local and live MCP discovery return the
|
|
8
|
+
* expected skill and that the served skill body contains the required
|
|
9
|
+
* social-pack, campaign-pack, and source-fidelity contracts an agent must obey.
|
|
10
|
+
*
|
|
11
|
+
* Every MCP call is written to a JSONL audit log under .rdc/reports/.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { spawn } from 'node:child_process';
|
|
15
|
+
import fs from 'node:fs';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
import { fileURLToPath } from 'node:url';
|
|
18
|
+
|
|
19
|
+
import { getSkillBody, listSkills, searchSkills } from '../lib/catalog.mjs';
|
|
20
|
+
|
|
21
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
22
|
+
const REPO_ROOT = path.resolve(__dirname, '..');
|
|
23
|
+
const BIN = path.join(REPO_ROOT, 'bin', 'rdc-skills-mcp.mjs');
|
|
24
|
+
const TEST_PORT = parseInt(process.env.TEST_PORT || '3198', 10);
|
|
25
|
+
const LOCAL = `http://127.0.0.1:${TEST_PORT}/mcp`;
|
|
26
|
+
const LOCAL_HEALTH = `http://127.0.0.1:${TEST_PORT}/health`;
|
|
27
|
+
const REMOTE = 'https://rdc-skills.regendevcorp.com/mcp';
|
|
28
|
+
const REPORT_DIR = path.join(REPO_ROOT, '.rdc', 'reports');
|
|
29
|
+
const REPORT_FILE = path.join(
|
|
30
|
+
REPORT_DIR,
|
|
31
|
+
`channel-formatter-contract-${new Date().toISOString().replace(/[:.]/g, '-')}.jsonl`,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
fs.mkdirSync(REPORT_DIR, { recursive: true });
|
|
35
|
+
|
|
36
|
+
let pass = 0;
|
|
37
|
+
let fail = 0;
|
|
38
|
+
const failures = [];
|
|
39
|
+
|
|
40
|
+
function log(event) {
|
|
41
|
+
fs.appendFileSync(REPORT_FILE, `${JSON.stringify({ ts: new Date().toISOString(), ...event })}\n`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function check(name, condition, detail = '') {
|
|
45
|
+
if (condition) {
|
|
46
|
+
pass++;
|
|
47
|
+
log({ kind: 'assertion', name, status: 'pass', detail });
|
|
48
|
+
} else {
|
|
49
|
+
fail++;
|
|
50
|
+
failures.push(`${name}${detail ? ` - ${detail}` : ''}`);
|
|
51
|
+
log({ kind: 'assertion', name, status: 'fail', detail });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function resultText(json) {
|
|
56
|
+
return json?.result?.content?.[0]?.text || '';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function summarizeText(text) {
|
|
60
|
+
return {
|
|
61
|
+
length: text.length,
|
|
62
|
+
hasChannelFormatter: text.includes('channel-formatter'),
|
|
63
|
+
hasSocialPack: text.includes('social-pack'),
|
|
64
|
+
hasCampaignPack: text.includes('campaign-pack'),
|
|
65
|
+
hasStrictFormat: text.includes('strict-format'),
|
|
66
|
+
hasSourceFidelity: text.includes('Source-Fidelity'),
|
|
67
|
+
hasUnsupportedClaims: text.includes('unsupported claims') || text.includes('Do not invent statistics'),
|
|
68
|
+
hasChannelPackUsage: text.includes('<channel|pack>'),
|
|
69
|
+
hasLinkedIn: text.includes('LinkedIn'),
|
|
70
|
+
hasTwitterThread: text.includes('Twitter/X thread'),
|
|
71
|
+
hasSlack: text.includes('Slack/Teams'),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async function mcp(url, label, body) {
|
|
76
|
+
const request = {
|
|
77
|
+
method: body.method,
|
|
78
|
+
tool: body.params?.name || null,
|
|
79
|
+
arguments: body.params?.arguments || null,
|
|
80
|
+
};
|
|
81
|
+
const res = await fetch(url, {
|
|
82
|
+
method: 'POST',
|
|
83
|
+
headers: {
|
|
84
|
+
'Content-Type': 'application/json',
|
|
85
|
+
Accept: 'application/json, text/event-stream',
|
|
86
|
+
'User-Agent': 'rdc-channel-formatter-contract-test',
|
|
87
|
+
},
|
|
88
|
+
body: JSON.stringify(body),
|
|
89
|
+
});
|
|
90
|
+
const raw = await res.text();
|
|
91
|
+
let json = null;
|
|
92
|
+
if (raw.includes('data:')) {
|
|
93
|
+
for (const line of raw.split('\n')) {
|
|
94
|
+
if (line.startsWith('data:')) json = JSON.parse(line.slice(5).trim());
|
|
95
|
+
}
|
|
96
|
+
} else if (raw.trim()) {
|
|
97
|
+
json = JSON.parse(raw);
|
|
98
|
+
}
|
|
99
|
+
const text = resultText(json);
|
|
100
|
+
log({
|
|
101
|
+
kind: 'mcp_call',
|
|
102
|
+
label,
|
|
103
|
+
url,
|
|
104
|
+
request,
|
|
105
|
+
status: res.status,
|
|
106
|
+
response: {
|
|
107
|
+
hasError: Boolean(json?.error),
|
|
108
|
+
text: summarizeText(text),
|
|
109
|
+
resultKeys: json?.result ? Object.keys(json.result) : [],
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
return { status: res.status, json, text };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
async function waitHealth(url) {
|
|
116
|
+
for (let i = 0; i < 40; i++) {
|
|
117
|
+
try {
|
|
118
|
+
const res = await fetch(url);
|
|
119
|
+
if (res.ok) return await res.json();
|
|
120
|
+
} catch {
|
|
121
|
+
// wait and retry
|
|
122
|
+
}
|
|
123
|
+
await new Promise((resolve) => setTimeout(resolve, 150));
|
|
124
|
+
}
|
|
125
|
+
throw new Error(`health check timed out: ${url}`);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function inspectFormatterBody(body, prefix) {
|
|
129
|
+
const required = [
|
|
130
|
+
['usage <channel|pack>', '<channel|pack>'],
|
|
131
|
+
['social-pack mode', 'social-pack'],
|
|
132
|
+
['campaign-pack mode', 'campaign-pack'],
|
|
133
|
+
['exec-pack mode', 'exec-pack'],
|
|
134
|
+
['launch-pack mode', 'launch-pack'],
|
|
135
|
+
['strict-format mode', 'strict-format'],
|
|
136
|
+
['long-source extraction', 'Long-Source Extraction'],
|
|
137
|
+
['source-fidelity rules', 'Source-Fidelity'],
|
|
138
|
+
['unsupported-claims guard', 'unsupported claims'],
|
|
139
|
+
['LinkedIn pack output', 'LinkedIn thought-leadership post'],
|
|
140
|
+
['Twitter thread pack output', 'Twitter/X thread'],
|
|
141
|
+
['Slack pack output', 'Slack/Teams internal share'],
|
|
142
|
+
['convert delegate', 'rdc:convert'],
|
|
143
|
+
['brochure delegate', 'rdc:brochure'],
|
|
144
|
+
['brochurify delegate', 'rdc:brochurify'],
|
|
145
|
+
['brochure author delegate', 'lifeai-brochure-author'],
|
|
146
|
+
];
|
|
147
|
+
for (const [name, needle] of required) {
|
|
148
|
+
check(`${prefix}: body contains ${name}`, body.includes(needle), needle);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function unitChecks() {
|
|
153
|
+
const names = listSkills().map((skill) => skill.name);
|
|
154
|
+
check('unit: channel-formatter in local catalog', names.includes('channel-formatter'));
|
|
155
|
+
for (const specialist of ['convert', 'brochure', 'rdc-brochurify', 'lifeai-brochure-author']) {
|
|
156
|
+
check(`unit: specialist present ${specialist}`, names.includes(specialist));
|
|
157
|
+
}
|
|
158
|
+
const results = searchSkills('turn this article into social posts');
|
|
159
|
+
check('unit: search top hit is channel-formatter', results[0]?.name === 'channel-formatter', results[0]?.name || 'none');
|
|
160
|
+
inspectFormatterBody(getSkillBody('channel-formatter') || '', 'unit');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
async function endpointChecks(url, label) {
|
|
164
|
+
await mcp(url, label, {
|
|
165
|
+
jsonrpc: '2.0',
|
|
166
|
+
id: `${label}-init`,
|
|
167
|
+
method: 'initialize',
|
|
168
|
+
params: {
|
|
169
|
+
protocolVersion: '2024-11-05',
|
|
170
|
+
capabilities: {},
|
|
171
|
+
clientInfo: { name: 'rdc-channel-formatter-contract-test', version: '1' },
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
const list = await mcp(url, label, {
|
|
176
|
+
jsonrpc: '2.0',
|
|
177
|
+
id: `${label}-list`,
|
|
178
|
+
method: 'tools/call',
|
|
179
|
+
params: { name: 'rdc_skill_list', arguments: {} },
|
|
180
|
+
});
|
|
181
|
+
const catalog = JSON.parse(list.text || '{"skills":[]}');
|
|
182
|
+
const names = catalog.skills.map((skill) => skill.name);
|
|
183
|
+
check(`${label}: list includes channel-formatter`, names.includes('channel-formatter'));
|
|
184
|
+
for (const specialist of ['convert', 'brochure', 'rdc-brochurify', 'lifeai-brochure-author']) {
|
|
185
|
+
check(`${label}: list includes ${specialist}`, names.includes(specialist));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const search = await mcp(url, label, {
|
|
189
|
+
jsonrpc: '2.0',
|
|
190
|
+
id: `${label}-search-social`,
|
|
191
|
+
method: 'tools/call',
|
|
192
|
+
params: { name: 'rdc_skill_search', arguments: { query: 'turn this article into social posts' } },
|
|
193
|
+
});
|
|
194
|
+
const searchPayload = JSON.parse(search.text || '{"results":[]}');
|
|
195
|
+
check(
|
|
196
|
+
`${label}: article-to-social search routes to channel-formatter`,
|
|
197
|
+
searchPayload.results[0]?.name === 'channel-formatter',
|
|
198
|
+
searchPayload.results[0]?.name || 'none',
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
const get = await mcp(url, label, {
|
|
202
|
+
jsonrpc: '2.0',
|
|
203
|
+
id: `${label}-get-formatter`,
|
|
204
|
+
method: 'tools/call',
|
|
205
|
+
params: { name: 'rdc_skill_get', arguments: { name: 'channel-formatter', variant: 'cli' } },
|
|
206
|
+
});
|
|
207
|
+
inspectFormatterBody(get.text, label);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
async function main() {
|
|
211
|
+
log({ kind: 'test_start', reportFile: REPORT_FILE });
|
|
212
|
+
unitChecks();
|
|
213
|
+
|
|
214
|
+
const proc = spawn('node', [BIN], {
|
|
215
|
+
env: { ...process.env, PORT: String(TEST_PORT) },
|
|
216
|
+
stdio: 'ignore',
|
|
217
|
+
});
|
|
218
|
+
try {
|
|
219
|
+
const health = await waitHealth(LOCAL_HEALTH);
|
|
220
|
+
log({ kind: 'health', label: 'integration', health });
|
|
221
|
+
check('integration: local test server healthy', health.status === 'ok');
|
|
222
|
+
await endpointChecks(LOCAL, 'integration');
|
|
223
|
+
} finally {
|
|
224
|
+
proc.kill();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (process.env.REMOTE || process.argv.includes('--remote')) {
|
|
228
|
+
const health = await (await fetch('https://rdc-skills.regendevcorp.com/health')).json();
|
|
229
|
+
log({ kind: 'health', label: 'systems', health });
|
|
230
|
+
check('systems: remote version is at least 0.24.8', /^0\.(2[4-9]|[3-9]\d)\./.test(health.version), health.version);
|
|
231
|
+
check('systems: remote skill count includes full catalog', health.skills >= 29, String(health.skills));
|
|
232
|
+
await endpointChecks(REMOTE, 'systems');
|
|
233
|
+
} else {
|
|
234
|
+
log({ kind: 'systems_skipped', reason: 'set REMOTE=1 or pass --remote' });
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
log({ kind: 'test_end', pass, fail, failures });
|
|
238
|
+
console.log(`channel-formatter contract: ${pass} passed, ${fail} failed`);
|
|
239
|
+
console.log(`audit log: ${REPORT_FILE}`);
|
|
240
|
+
if (fail) {
|
|
241
|
+
for (const failure of failures) console.log(`FAIL: ${failure}`);
|
|
242
|
+
process.exit(1);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
main().catch((error) => {
|
|
247
|
+
log({ kind: 'fatal', message: error?.message || String(error), stack: error?.stack || '' });
|
|
248
|
+
console.error(error);
|
|
249
|
+
process.exit(1);
|
|
250
|
+
});
|
|
251
|
+
|