@pixelbyte-software/pixcode 1.52.4 → 1.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -10
- package/README.tr.md +1 -1
- package/dist/api-automation.html +1 -1
- package/dist/assets/index-Cz9BCbXv.css +32 -0
- package/dist/assets/index-yE2qL74i.js +816 -0
- package/dist/docs.html +10 -10
- package/dist/features.html +3 -3
- package/dist/index.html +2 -2
- package/dist/landing.html +16 -16
- package/dist/llms-full.txt +4 -4
- package/dist/llms.txt +3 -3
- package/dist/openapi.yaml +6 -6
- package/dist-server/server/index.js +8 -118
- package/dist-server/server/index.js.map +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/claude-code.adapter.js +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/claude-code.adapter.js.map +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/codex.adapter.js +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/codex.adapter.js.map +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/cursor.adapter.js +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/cursor.adapter.js.map +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/gemini.adapter.js +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/gemini.adapter.js.map +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/json-event.adapter.js +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/json-event.adapter.js.map +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/opencode.adapter.js +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/opencode.adapter.js.map +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/qwen.adapter.js +1 -1
- package/dist-server/server/modules/orchestration/a2a/adapters/qwen.adapter.js.map +1 -1
- package/dist-server/server/modules/orchestration/a2a/agent-card.js +4 -4
- package/dist-server/server/modules/orchestration/a2a/agent-card.js.map +1 -1
- package/dist-server/server/modules/orchestration/a2a/routes.js +2 -5
- package/dist-server/server/modules/orchestration/a2a/routes.js.map +1 -1
- package/dist-server/server/modules/orchestration/a2a/task-dispatcher.js +295 -0
- package/dist-server/server/modules/orchestration/a2a/task-dispatcher.js.map +1 -0
- package/dist-server/server/modules/orchestration/index.js +0 -2
- package/dist-server/server/modules/orchestration/index.js.map +1 -1
- package/dist-server/server/modules/orchestration/tasks/orchestration-task-store.js +2 -2
- package/dist-server/server/modules/orchestration/tasks/orchestration-task-store.js.map +1 -1
- package/dist-server/server/modules/orchestration/tasks/orchestration-task.routes.js +12 -0
- package/dist-server/server/modules/orchestration/tasks/orchestration-task.routes.js.map +1 -1
- package/dist-server/server/modules/orchestration/tasks/orchestration-task.service.js +19 -26
- package/dist-server/server/modules/orchestration/tasks/orchestration-task.service.js.map +1 -1
- package/dist-server/server/modules/orchestration/workflows/workflow-runner.js +47 -58
- package/dist-server/server/modules/orchestration/workflows/workflow-runner.js.map +1 -1
- package/dist-server/server/modules/orchestration/workflows/workflow-trace.js +2 -2
- package/dist-server/server/modules/orchestration/workflows/workflow-trace.js.map +1 -1
- package/dist-server/server/services/public-api-manifest.js +0 -9
- package/dist-server/server/services/public-api-manifest.js.map +1 -1
- package/package.json +1 -1
- package/server/index.js +7 -126
- package/server/modules/orchestration/a2a/adapters/claude-code.adapter.ts +1 -1
- package/server/modules/orchestration/a2a/adapters/codex.adapter.ts +1 -1
- package/server/modules/orchestration/a2a/adapters/cursor.adapter.ts +1 -1
- package/server/modules/orchestration/a2a/adapters/gemini.adapter.ts +1 -1
- package/server/modules/orchestration/a2a/adapters/json-event.adapter.ts +1 -1
- package/server/modules/orchestration/a2a/adapters/opencode.adapter.ts +1 -1
- package/server/modules/orchestration/a2a/adapters/qwen.adapter.ts +1 -1
- package/server/modules/orchestration/a2a/agent-card.ts +4 -4
- package/server/modules/orchestration/a2a/routes.ts +2 -6
- package/server/modules/orchestration/a2a/task-dispatcher.ts +345 -0
- package/server/modules/orchestration/index.ts +0 -2
- package/server/modules/orchestration/tasks/orchestration-task-store.ts +2 -2
- package/server/modules/orchestration/tasks/orchestration-task.routes.ts +17 -0
- package/server/modules/orchestration/tasks/orchestration-task.service.ts +19 -27
- package/server/modules/orchestration/tasks/orchestration-task.types.ts +2 -2
- package/server/modules/orchestration/tasks/task-run-graph.ts +1 -1
- package/server/modules/orchestration/workflows/workflow-runner.ts +52 -60
- package/server/modules/orchestration/workflows/workflow-trace.ts +2 -2
- package/server/modules/orchestration/workflows/workflow.types.ts +1 -1
- package/server/services/public-api-manifest.js +0 -9
- package/dist/assets/index-CapxXSc7.js +0 -816
- package/dist/assets/index-DkT6-Pja.css +0 -32
- package/dist/hermes-agent.png +0 -0
- package/dist-server/server/modules/orchestration/hermes/hermes.routes.js +0 -577
- package/dist-server/server/modules/orchestration/hermes/hermes.routes.js.map +0 -1
- package/dist-server/server/services/hermes-gateway.js +0 -1467
- package/dist-server/server/services/hermes-gateway.js.map +0 -1
- package/dist-server/server/services/hermes-install-jobs.js +0 -676
- package/dist-server/server/services/hermes-install-jobs.js.map +0 -1
- package/scripts/hermes/configure-pixcode-mcp.mjs +0 -165
- package/scripts/hermes/pixcode-mcp-server.mjs +0 -1009
- package/scripts/smoke/hermes-api-install.mjs +0 -56
- package/scripts/smoke/hermes-gateway-persistence.mjs +0 -104
- package/scripts/smoke/hermes-mcp-pixcode-roundtrip.mjs +0 -426
- package/scripts/smoke/hermes-rest-chat-api.mjs +0 -162
- package/scripts/smoke/hermes-rest-chat-live.mjs +0 -45
- package/scripts/smoke/hermes-rest-codex-launch.mjs +0 -209
- package/scripts/smoke/hermes-rest-gateway.mjs +0 -79
- package/scripts/smoke/hermes-rest-live.mjs +0 -42
- package/scripts/smoke/hermes-roundtrip.mjs +0 -167
- package/scripts/smoke/hermes-settings-commands.mjs +0 -349
- package/scripts/smoke/hermes-smoke-launcher-guard.mjs +0 -34
- package/server/modules/orchestration/hermes/hermes.routes.ts +0 -642
- package/server/services/hermes-gateway.js +0 -1562
- package/server/services/hermes-install-jobs.js +0 -729
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
|
|
6
|
-
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
7
|
-
|
|
8
|
-
const read = (relativePath) => fs.readFileSync(path.join(repoRoot, relativePath), 'utf8');
|
|
9
|
-
|
|
10
|
-
const hermesRoutes = read('server/modules/orchestration/hermes/hermes.routes.ts');
|
|
11
|
-
const hermesInstallJobs = fs.existsSync(path.join(repoRoot, 'server/services/hermes-install-jobs.js'))
|
|
12
|
-
? read('server/services/hermes-install-jobs.js')
|
|
13
|
-
: '';
|
|
14
|
-
const workbench = read('src/components/vscode-workbench/view/VSCodeWorkbench.tsx');
|
|
15
|
-
const serverIndex = read('server/index.js');
|
|
16
|
-
const smoke = read('scripts/smoke/pixcode-workbench-1-48.mjs');
|
|
17
|
-
|
|
18
|
-
assert.match(hermesRoutes, /createHermesInstallJob/, 'Hermes API should start backend install jobs.');
|
|
19
|
-
assert.match(hermesRoutes, /router\.post\('\/install'/, 'Hermes should expose POST /api/orchestration/hermes/install.');
|
|
20
|
-
assert.match(hermesRoutes, /router\.get\('\/install\/:jobId\/stream'/, 'Hermes install jobs should expose an EventSource stream.');
|
|
21
|
-
assert.match(hermesRoutes, /router\.delete\('\/install\/:jobId'/, 'Hermes install jobs should be cancellable.');
|
|
22
|
-
assert.match(hermesInstallJobs, /downloadHermesInstaller/, 'Hermes installer should be downloaded by backend code, not pasted into the terminal.');
|
|
23
|
-
assert.match(hermesInstallJobs, /--skip-setup/, 'POSIX Hermes API install should skip the interactive setup wizard.');
|
|
24
|
-
assert.match(hermesInstallJobs, /--skip-browser/, 'Hermes API install should skip browser downloads by default for reliable headless installs.');
|
|
25
|
-
assert.doesNotMatch(hermesInstallJobs, /curl -fsSL .* \| bash/, 'Hermes API install must not pipe curl directly into bash.');
|
|
26
|
-
assert.match(workbench, /\/api\/orchestration\/hermes\/install/, 'Workbench Hermes install button should call the Hermes install API.');
|
|
27
|
-
assert.doesNotMatch(workbench, /HERMES_AGENT_INSTALL_COMMAND/, 'Workbench should not launch Hermes install through a terminal command.');
|
|
28
|
-
assert.match(hermesInstallJobs, /formatHermesVersionOutput/, 'Hermes install status should collapse multi-line --version output before showing it in UI badges.');
|
|
29
|
-
assert.match(hermesInstallJobs, /repairHermesCommandLaunchers/, 'Hermes installer should repair stale or text launcher shims after install/status checks.');
|
|
30
|
-
assert.match(hermesInstallJobs, /hermes\.cmd/, 'Windows Hermes repair should create or prefer a hermes.cmd shim so typing hermes does not open the Python launcher as text.');
|
|
31
|
-
assert.match(hermesInstallJobs, /isUsableHermesCommand/, 'Hermes status should verify candidates before treating them as installed.');
|
|
32
|
-
assert.match(hermesInstallJobs, /isHermesSmokeCommandOutput/, 'Hermes status must reject smoke-test launchers before treating Hermes as installed.');
|
|
33
|
-
assert.match(hermesInstallJobs, /shouldRepairHermesLauncher/, 'Hermes status must not persist temporary HERMES_CLI_PATH launchers into user PATH shims.');
|
|
34
|
-
assert.match(hermesInstallJobs, /export function buildHermesPathEnv/, 'Hermes should expose a PATH-only shell env helper so normal project terminals can run hermes after repair.');
|
|
35
|
-
assert.match(hermesInstallJobs, /isWindowsEpermSpawnError/, 'Hermes install should recognize Windows spawn EPERM as a launcher failure.');
|
|
36
|
-
assert.match(hermesInstallJobs, /windowsCmdFallbackCommand/, 'Hermes install should retry Windows PowerShell installer launches through cmd.exe without requiring elevation.');
|
|
37
|
-
assert.match(hermesInstallJobs, /retrying through cmd\.exe without elevation/, 'Hermes install logs should explain the no-admin Windows EPERM fallback.');
|
|
38
|
-
assert.match(read('scripts/hermes/configure-pixcode-mcp.mjs'), /platform_toolsets/, 'Pixcode MCP config should enable the Pixcode toolset for Hermes API server runs.');
|
|
39
|
-
assert.match(read('scripts/hermes/configure-pixcode-mcp.mjs'), /api_server:[\s\S]+pixcode/, 'Hermes API server should see Pixcode MCP tools during /v1/runs.');
|
|
40
|
-
assert.match(read('scripts/hermes/configure-pixcode-mcp.mjs'), /const cliToolsets = \['hermes-cli', 'mcp-pixcode'\]/, 'Hermes CLI profile should keep the full Hermes toolset while adding Pixcode MCP.');
|
|
41
|
-
assert.match(serverIndex, /buildHermesPathEnv\(process\.env/, 'Shell PTYs should inherit Hermes bin directories so typing hermes in Pixcode terminal works on Windows.');
|
|
42
|
-
assert.match(serverIndex, /env: shellEnv/, 'Shell PTYs should use the augmented shell environment instead of raw process.env.');
|
|
43
|
-
assert.doesNotMatch(serverIndex, /pixcode:hermes:start/, 'Hermes H button should not depend on a shell sentinel.');
|
|
44
|
-
assert.doesNotMatch(serverIndex, /Hermes already installed:/, 'Hermes H launch should not leave a version/status banner stuck before the interactive prompt.');
|
|
45
|
-
assert.doesNotMatch(serverIndex, /if command -v hermes >\/dev\/null 2>&1; then command -v hermes; return 0; fi;/, 'POSIX Hermes start must not accept a stale PATH shim without testing it.');
|
|
46
|
-
assert.match(workbench, /HermesActivityButton/, 'Workbench activity rail should expose a dedicated Hermes H button under Terminal.');
|
|
47
|
-
assert.match(workbench, /command=\{hermesCommand\}/, 'Opening the Hermes H button should show the real Hermes terminal/TUI.');
|
|
48
|
-
assert.match(workbench, /bottomTerminalCommand/, 'Hermes settings should be able to launch Hermes subcommands in the bottom terminal.');
|
|
49
|
-
assert.match(workbench, /openBottomTerminal\('hermes'\)/, 'Opening Hermes should restore the Hermes terminal.');
|
|
50
|
-
assert.match(workbench, /openBottomTerminal\('hermes', \{[\s\S]*command: HERMES_DEFAULT_COMMAND,[\s\S]*forceNewSession: true,[\s\S]*\}\)/, 'The Hermes new-session action should reset the Hermes terminal session with the guarded default command.');
|
|
51
|
-
assert.match(workbench, /installLogRef/, 'Hermes install log panel should keep a scroll ref.');
|
|
52
|
-
assert.match(workbench, /scrollTop = installLogRef\.current\.scrollHeight/, 'Hermes install logs should auto-scroll to the latest line.');
|
|
53
|
-
assert.doesNotMatch(workbench, /suspendAutoConnect/, 'Right CLI launches should not be blocked by an open Hermes bottom terminal.');
|
|
54
|
-
assert.match(smoke, /hermes-api-install\.mjs/, 'Main workbench smoke should mention the dedicated Hermes API install smoke.');
|
|
55
|
-
|
|
56
|
-
console.log('hermes API install smoke passed');
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import os from 'node:os';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { fileURLToPath } from 'node:url';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
ensureHermesGateway,
|
|
9
|
-
stopHermesGateway,
|
|
10
|
-
} from '../../server/services/hermes-gateway.js';
|
|
11
|
-
|
|
12
|
-
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
13
|
-
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'pixcode-hermes-persist-'));
|
|
14
|
-
const fakeHermes = path.join(tempRoot, 'hermes');
|
|
15
|
-
const projectPath = path.join(tempRoot, 'project');
|
|
16
|
-
const hermesHome = path.join(tempRoot, 'home');
|
|
17
|
-
const startCountFile = path.join(tempRoot, 'starts.txt');
|
|
18
|
-
const failProbeFile = path.join(tempRoot, 'fail-probe');
|
|
19
|
-
|
|
20
|
-
await fs.mkdir(projectPath, { recursive: true });
|
|
21
|
-
await fs.writeFile(fakeHermes, `#!/usr/bin/env node
|
|
22
|
-
import fs from 'node:fs';
|
|
23
|
-
import http from 'node:http';
|
|
24
|
-
|
|
25
|
-
if (process.argv.includes('--version')) {
|
|
26
|
-
console.log('Hermes Agent v0.0.0 smoke');
|
|
27
|
-
process.exit(0);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
fs.appendFileSync(${JSON.stringify(startCountFile)}, '1\\n');
|
|
31
|
-
|
|
32
|
-
const host = process.env.API_SERVER_HOST || '127.0.0.1';
|
|
33
|
-
const port = Number(process.env.API_SERVER_PORT || 8642);
|
|
34
|
-
const key = process.env.API_SERVER_KEY || '';
|
|
35
|
-
const failProbeFile = ${JSON.stringify(failProbeFile)};
|
|
36
|
-
|
|
37
|
-
const server = http.createServer(async (req, res) => {
|
|
38
|
-
const url = new URL(req.url || '/', 'http://127.0.0.1');
|
|
39
|
-
res.setHeader('content-type', 'application/json');
|
|
40
|
-
if (url.pathname !== '/health' && req.headers.authorization !== \`Bearer \${key}\`) {
|
|
41
|
-
res.statusCode = 401;
|
|
42
|
-
res.end(JSON.stringify({ error: 'bad auth' }));
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (req.method === 'GET' && url.pathname === '/health') {
|
|
46
|
-
res.end(JSON.stringify({ ok: true }));
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (req.method === 'GET' && url.pathname === '/v1/capabilities') {
|
|
50
|
-
if (fs.existsSync(failProbeFile)) {
|
|
51
|
-
res.statusCode = 503;
|
|
52
|
-
res.end(JSON.stringify({ error: 'temporary probe failure' }));
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
res.end(JSON.stringify({ capabilities: ['chat'] }));
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (req.method === 'GET' && url.pathname === '/v1/models') {
|
|
59
|
-
res.end(JSON.stringify({ data: [{ id: 'hermes-agent' }] }));
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
res.statusCode = 404;
|
|
63
|
-
res.end(JSON.stringify({ error: url.pathname }));
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
server.listen(port, host);
|
|
67
|
-
`, { mode: 0o755 });
|
|
68
|
-
|
|
69
|
-
process.env.HERMES_CLI_PATH = fakeHermes;
|
|
70
|
-
|
|
71
|
-
try {
|
|
72
|
-
const first = await ensureHermesGateway({
|
|
73
|
-
appRoot: repoRoot,
|
|
74
|
-
projectPath,
|
|
75
|
-
hermesHome,
|
|
76
|
-
pixcodeBaseUrl: 'http://127.0.0.1:9',
|
|
77
|
-
pixcodeApiKey: 'px_persist_smoke_key',
|
|
78
|
-
port: 18772,
|
|
79
|
-
allowSmokeHermes: true,
|
|
80
|
-
repairLaunchers: false,
|
|
81
|
-
});
|
|
82
|
-
assert.equal(first.running, true, 'first gateway should start');
|
|
83
|
-
|
|
84
|
-
await fs.writeFile(failProbeFile, '1');
|
|
85
|
-
const second = await ensureHermesGateway({
|
|
86
|
-
appRoot: repoRoot,
|
|
87
|
-
projectPath,
|
|
88
|
-
hermesHome,
|
|
89
|
-
pixcodeBaseUrl: 'http://127.0.0.1:9',
|
|
90
|
-
pixcodeApiKey: 'px_persist_smoke_key',
|
|
91
|
-
port: 18772,
|
|
92
|
-
allowSmokeHermes: true,
|
|
93
|
-
repairLaunchers: false,
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
const starts = (await fs.readFile(startCountFile, 'utf8')).trim().split('\\n').filter(Boolean).length;
|
|
97
|
-
assert.equal(starts, 1, 'existing Hermes gateway must not be killed and relaunched for a transient probe failure');
|
|
98
|
-
assert.equal(second.baseUrl, first.baseUrl, 'existing Hermes gateway base URL should be reused');
|
|
99
|
-
assert.equal(second.running, true, 'existing Hermes gateway should still be reported as running');
|
|
100
|
-
console.log('hermes gateway persistence smoke passed');
|
|
101
|
-
} finally {
|
|
102
|
-
stopHermesGateway(projectPath);
|
|
103
|
-
delete process.env.HERMES_CLI_PATH;
|
|
104
|
-
}
|
|
@@ -1,426 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import { createServer } from 'node:http';
|
|
3
|
-
import { spawn } from 'node:child_process';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { fileURLToPath } from 'node:url';
|
|
6
|
-
|
|
7
|
-
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
8
|
-
const apiKey = 'px_smoke_key';
|
|
9
|
-
const seen = [];
|
|
10
|
-
const providerMcpUpserts = [];
|
|
11
|
-
const terminalLaunches = [];
|
|
12
|
-
const providerOutputReads = [];
|
|
13
|
-
const providerInputWrites = [];
|
|
14
|
-
const gatewayRequests = [];
|
|
15
|
-
|
|
16
|
-
function readJson(req) {
|
|
17
|
-
return new Promise((resolve, reject) => {
|
|
18
|
-
let body = '';
|
|
19
|
-
req.setEncoding('utf8');
|
|
20
|
-
req.on('data', (chunk) => { body += chunk; });
|
|
21
|
-
req.on('end', () => {
|
|
22
|
-
try {
|
|
23
|
-
resolve(body ? JSON.parse(body) : {});
|
|
24
|
-
} catch (error) {
|
|
25
|
-
reject(error);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const server = createServer(async (req, res) => {
|
|
32
|
-
const url = new URL(req.url || '/', 'http://127.0.0.1');
|
|
33
|
-
seen.push({
|
|
34
|
-
method: req.method,
|
|
35
|
-
path: url.pathname,
|
|
36
|
-
auth: req.headers.authorization,
|
|
37
|
-
});
|
|
38
|
-
res.setHeader('content-type', 'application/json');
|
|
39
|
-
|
|
40
|
-
if (req.headers.authorization !== `Bearer ${apiKey}`) {
|
|
41
|
-
res.statusCode = 401;
|
|
42
|
-
res.end(JSON.stringify({ error: 'bad auth' }));
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (req.method === 'GET' && url.pathname === '/api/projects') {
|
|
47
|
-
res.end(JSON.stringify([
|
|
48
|
-
{ name: 'pixcode', displayName: 'Pixcode', fullPath: '/root/pixcode', fileCount: 224 },
|
|
49
|
-
]));
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (req.method === 'GET' && url.pathname === '/api/public/manifest') {
|
|
54
|
-
res.end(JSON.stringify({
|
|
55
|
-
name: 'Pixcode Public API',
|
|
56
|
-
groups: [
|
|
57
|
-
{ id: 'projects', basePath: '/api/projects', scopes: ['projects:read', 'projects:write'] },
|
|
58
|
-
{ id: 'providers', basePath: '/api/providers', scopes: ['providers:read', 'providers:write'] },
|
|
59
|
-
],
|
|
60
|
-
}));
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (req.method === 'GET' && url.pathname === '/api/providers/codex/auth/status') {
|
|
65
|
-
res.end(JSON.stringify({ data: { provider: 'codex', installed: true, authenticated: true } }));
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (req.method === 'GET' && url.pathname === '/api/providers/qwen/auth/status') {
|
|
70
|
-
res.end(JSON.stringify({ data: { provider: 'qwen', installed: false, authenticated: false, error: 'Qwen Code CLI is not installed' } }));
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (req.method === 'POST' && url.pathname === '/api/providers/codex/mcp/servers') {
|
|
75
|
-
const body = await readJson(req);
|
|
76
|
-
providerMcpUpserts.push(body);
|
|
77
|
-
res.statusCode = 201;
|
|
78
|
-
res.end(JSON.stringify({ data: { server: { provider: 'codex', name: body.name, scope: body.scope, transport: body.transport } } }));
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (req.method === 'GET' && url.pathname === '/api/orchestration/hermes/gateway/status') {
|
|
83
|
-
res.end(JSON.stringify({ running: true, baseUrl: 'http://127.0.0.1:8642', projectPath: '/root/pixcode' }));
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (req.method === 'POST' && url.pathname === '/api/orchestration/hermes/gateway/probe') {
|
|
88
|
-
const body = await readJson(req);
|
|
89
|
-
res.end(JSON.stringify({
|
|
90
|
-
ok: true,
|
|
91
|
-
projectPath: body.projectPath || '/root/pixcode',
|
|
92
|
-
checks: {
|
|
93
|
-
health: { ok: true, status: 200 },
|
|
94
|
-
capabilities: { ok: true, status: 200 },
|
|
95
|
-
models: { ok: true, status: 200 },
|
|
96
|
-
},
|
|
97
|
-
}));
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (req.method === 'GET' && url.pathname === '/api/orchestration/hermes/diagnostics') {
|
|
102
|
-
res.end(JSON.stringify({
|
|
103
|
-
ok: true,
|
|
104
|
-
model: { provider: 'openai-codex', default: 'gpt-5.5' },
|
|
105
|
-
config: {
|
|
106
|
-
active: {
|
|
107
|
-
toolsets: ['hermes-cli', 'mcp-pixcode'],
|
|
108
|
-
pixcodeMcp: { toolCount: 12, missingTools: [] },
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
cron: { toolsetAvailable: true, gatewayJobsApi: { ok: true, status: 200 } },
|
|
112
|
-
issues: [],
|
|
113
|
-
}));
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (req.method === 'GET' && url.pathname === '/api/orchestration/hermes/control-plane') {
|
|
118
|
-
res.end(JSON.stringify({
|
|
119
|
-
ok: true,
|
|
120
|
-
homes: {
|
|
121
|
-
source: '/root/.hermes',
|
|
122
|
-
managed: '/root/.hermes/profiles/pixcode',
|
|
123
|
-
},
|
|
124
|
-
activeProfile: 'default',
|
|
125
|
-
profiles: [
|
|
126
|
-
{
|
|
127
|
-
name: 'default',
|
|
128
|
-
isActive: true,
|
|
129
|
-
sessions: { total: 3, exists: true },
|
|
130
|
-
cron: { total: 1, active: 1, exists: true },
|
|
131
|
-
tools: { pixcodeMcpReady: true, pixcodeMcpToolCount: 14, missingPixcodeMcpTools: [] },
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
capabilities: [
|
|
135
|
-
{ id: 'rest-gateway', label: 'Hermes REST gateway', ready: true },
|
|
136
|
-
{ id: 'pixcode-mcp', label: 'Pixcode MCP tools', ready: true },
|
|
137
|
-
],
|
|
138
|
-
recommendations: [],
|
|
139
|
-
}));
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (req.method === 'POST' && url.pathname === '/api/orchestration/hermes/control-plane/repair') {
|
|
144
|
-
const body = await readJson(req);
|
|
145
|
-
res.end(JSON.stringify({
|
|
146
|
-
ok: true,
|
|
147
|
-
gateway: { running: true, projectPath: body.projectPath || '/root/pixcode' },
|
|
148
|
-
controlPlane: {
|
|
149
|
-
ok: true,
|
|
150
|
-
profiles: [
|
|
151
|
-
{
|
|
152
|
-
name: 'pixcode',
|
|
153
|
-
tools: { pixcodeMcpReady: true, pixcodeMcpToolCount: 14, missingPixcodeMcpTools: [] },
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
},
|
|
157
|
-
}));
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (req.method === 'POST' && url.pathname === '/api/orchestration/hermes/gateway/request') {
|
|
162
|
-
const body = await readJson(req);
|
|
163
|
-
gatewayRequests.push(body);
|
|
164
|
-
res.end(JSON.stringify({
|
|
165
|
-
ok: true,
|
|
166
|
-
endpoint: body.endpoint,
|
|
167
|
-
body: {
|
|
168
|
-
jobs: [
|
|
169
|
-
{ job_id: 'job_1', name: 'Morning repo check', schedule: '0 9 * * *' },
|
|
170
|
-
],
|
|
171
|
-
},
|
|
172
|
-
}));
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
if (req.method === 'POST' && url.pathname === '/api/orchestration/hermes/terminal-launches') {
|
|
177
|
-
const body = await readJson(req);
|
|
178
|
-
terminalLaunches.push(body);
|
|
179
|
-
res.statusCode = 201;
|
|
180
|
-
res.end(JSON.stringify({
|
|
181
|
-
event: {
|
|
182
|
-
id: terminalLaunches.length,
|
|
183
|
-
provider: body.provider,
|
|
184
|
-
projectPath: body.projectPath,
|
|
185
|
-
prompt: body.prompt,
|
|
186
|
-
source: 'hermes-mcp',
|
|
187
|
-
},
|
|
188
|
-
}));
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (req.method === 'GET' && url.pathname === '/api/shell/sessions/provider-output') {
|
|
193
|
-
providerOutputReads.push({
|
|
194
|
-
provider: url.searchParams.get('provider'),
|
|
195
|
-
projectPath: url.searchParams.get('projectPath'),
|
|
196
|
-
launchId: url.searchParams.get('launchId'),
|
|
197
|
-
});
|
|
198
|
-
const outputs = [
|
|
199
|
-
{
|
|
200
|
-
active: true,
|
|
201
|
-
provider: 'codex',
|
|
202
|
-
projectPath: '/root/pixcode',
|
|
203
|
-
terminalState: 'busy',
|
|
204
|
-
output: 'OpenAI Codex\n› /init\n\n• Working (10s • esc to interrupt)\n',
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
active: true,
|
|
208
|
-
provider: 'codex',
|
|
209
|
-
projectPath: '/root/pixcode',
|
|
210
|
-
terminalState: 'busy',
|
|
211
|
-
output: 'OpenAI Codex\n› /init\n\n• Ran npm test\n• Working (30s • esc to interrupt)\n',
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
active: true,
|
|
215
|
-
provider: 'codex',
|
|
216
|
-
projectPath: '/root/pixcode',
|
|
217
|
-
terminalState: 'idle',
|
|
218
|
-
output: 'OpenAI Codex\n› /init\n\n• Ran npm test\n\n› Implement {feature}\n',
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
active: true,
|
|
222
|
-
provider: 'codex',
|
|
223
|
-
projectPath: '/root/pixcode',
|
|
224
|
-
terminalState: 'idle',
|
|
225
|
-
output: 'Baseline check passed: npm test reports 195 passing, 0 failing.\n\n› Use /skills to list available skills\n',
|
|
226
|
-
},
|
|
227
|
-
];
|
|
228
|
-
res.end(JSON.stringify(outputs[Math.min(providerOutputReads.length - 1, outputs.length - 1)]));
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
if (req.method === 'POST' && url.pathname === '/api/shell/sessions/provider-input') {
|
|
233
|
-
const body = await readJson(req);
|
|
234
|
-
providerInputWrites.push(body);
|
|
235
|
-
res.end(JSON.stringify({ ok: true, wrote: true, provider: body.provider, launchId: body.launchId }));
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
res.statusCode = 404;
|
|
240
|
-
res.end(JSON.stringify({ error: url.pathname }));
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
function listen() {
|
|
244
|
-
return new Promise((resolve) => {
|
|
245
|
-
server.listen(0, '127.0.0.1', () => {
|
|
246
|
-
const address = server.address();
|
|
247
|
-
resolve(`http://127.0.0.1:${address.port}`);
|
|
248
|
-
});
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
function callMcp(child, method, params = undefined) {
|
|
253
|
-
const id = callMcp.nextId;
|
|
254
|
-
callMcp.nextId += 1;
|
|
255
|
-
const payload = { jsonrpc: '2.0', id, method, ...(params ? { params } : {}) };
|
|
256
|
-
child.stdin.write(`${JSON.stringify(payload)}\n`);
|
|
257
|
-
return new Promise((resolve, reject) => {
|
|
258
|
-
const timeout = setTimeout(() => {
|
|
259
|
-
reject(new Error(`MCP call timed out: ${method}`));
|
|
260
|
-
}, 10000);
|
|
261
|
-
const onLine = (line) => {
|
|
262
|
-
if (!line.trim()) return;
|
|
263
|
-
const message = JSON.parse(line);
|
|
264
|
-
if (message.id !== id) return;
|
|
265
|
-
clearTimeout(timeout);
|
|
266
|
-
child.stdout.off('data', onData);
|
|
267
|
-
if (message.error) {
|
|
268
|
-
reject(new Error(message.error.message));
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
resolve(message.result);
|
|
272
|
-
};
|
|
273
|
-
const onData = (chunk) => {
|
|
274
|
-
callMcp.buffer += chunk.toString();
|
|
275
|
-
let index;
|
|
276
|
-
while ((index = callMcp.buffer.indexOf('\n')) !== -1) {
|
|
277
|
-
const line = callMcp.buffer.slice(0, index);
|
|
278
|
-
callMcp.buffer = callMcp.buffer.slice(index + 1);
|
|
279
|
-
onLine(line);
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
child.stdout.on('data', onData);
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
callMcp.nextId = 1;
|
|
286
|
-
callMcp.buffer = '';
|
|
287
|
-
|
|
288
|
-
const baseUrl = await listen();
|
|
289
|
-
const child = spawn(process.execPath, [path.join(repoRoot, 'scripts/hermes/pixcode-mcp-server.mjs')], {
|
|
290
|
-
cwd: repoRoot,
|
|
291
|
-
env: {
|
|
292
|
-
...process.env,
|
|
293
|
-
PIXCODE_BASE_URL: baseUrl,
|
|
294
|
-
PIXCODE_API_KEY: apiKey,
|
|
295
|
-
PIXCODE_MCP_READBACK_IDLE_STABLE_MS: '500',
|
|
296
|
-
},
|
|
297
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
try {
|
|
301
|
-
await callMcp(child, 'initialize', { protocolVersion: '2024-11-05' });
|
|
302
|
-
const tools = await callMcp(child, 'tools/list');
|
|
303
|
-
const toolNames = tools.tools.map((tool) => tool.name);
|
|
304
|
-
assert(toolNames.includes('pixcode_list_projects'), 'list projects tool missing');
|
|
305
|
-
assert(toolNames.includes('pixcode_get_provider_status'), 'provider status tool missing');
|
|
306
|
-
assert(toolNames.includes('pixcode_get_hermes_gateway_status'), 'Hermes gateway status tool missing');
|
|
307
|
-
assert(toolNames.includes('pixcode_probe_hermes_gateway'), 'Hermes gateway probe tool missing');
|
|
308
|
-
assert(toolNames.includes('pixcode_get_hermes_diagnostics'), 'Hermes diagnostics tool missing');
|
|
309
|
-
assert(toolNames.includes('pixcode_get_hermes_control_plane'), 'Hermes control-plane snapshot tool missing');
|
|
310
|
-
assert(toolNames.includes('pixcode_repair_hermes_control_plane'), 'Hermes control-plane repair tool missing');
|
|
311
|
-
assert(toolNames.includes('pixcode_get_api_manifest'), 'Pixcode API manifest tool missing');
|
|
312
|
-
assert(toolNames.includes('pixcode_api_request'), 'Pixcode generic API request tool missing');
|
|
313
|
-
assert(toolNames.includes('pixcode_hermes_gateway_request'), 'Hermes gateway request proxy tool missing');
|
|
314
|
-
assert(toolNames.includes('pixcode_manage_hermes_cron'), 'Hermes cron management tool missing');
|
|
315
|
-
assert(toolNames.includes('pixcode_send_cli_input'), 'Provider terminal input tool missing');
|
|
316
|
-
|
|
317
|
-
const projects = await callMcp(child, 'tools/call', { name: 'pixcode_list_projects', arguments: {} });
|
|
318
|
-
assert.match(projects.content[0].text, /224/, 'projects response should include file count');
|
|
319
|
-
|
|
320
|
-
const status = await callMcp(child, 'tools/call', { name: 'pixcode_get_hermes_gateway_status', arguments: {} });
|
|
321
|
-
assert.match(status.content[0].text, /127\.0\.0\.1:8642/, 'gateway status should return REST base URL');
|
|
322
|
-
|
|
323
|
-
const probe = await callMcp(child, 'tools/call', {
|
|
324
|
-
name: 'pixcode_probe_hermes_gateway',
|
|
325
|
-
arguments: { projectPath: '/root/pixcode' },
|
|
326
|
-
});
|
|
327
|
-
assert.match(probe.content[0].text, /"ok": true/, 'gateway probe should return ok');
|
|
328
|
-
|
|
329
|
-
const diagnostics = await callMcp(child, 'tools/call', {
|
|
330
|
-
name: 'pixcode_get_hermes_diagnostics',
|
|
331
|
-
arguments: { projectPath: '/root/pixcode' },
|
|
332
|
-
});
|
|
333
|
-
assert.match(diagnostics.content[0].text, /mcp-pixcode/, 'Hermes diagnostics should expose active toolsets.');
|
|
334
|
-
assert.match(diagnostics.content[0].text, /"toolsetAvailable": true/, 'Hermes diagnostics should expose cron toolset availability.');
|
|
335
|
-
|
|
336
|
-
const controlPlane = await callMcp(child, 'tools/call', {
|
|
337
|
-
name: 'pixcode_get_hermes_control_plane',
|
|
338
|
-
arguments: { projectPath: '/root/pixcode' },
|
|
339
|
-
});
|
|
340
|
-
assert.match(controlPlane.content[0].text, /Hermes REST gateway/, 'Hermes control-plane tool should expose capability state.');
|
|
341
|
-
assert.match(controlPlane.content[0].text, /"pixcodeMcpReady": true/, 'Hermes control-plane tool should expose MCP readiness.');
|
|
342
|
-
|
|
343
|
-
const repairedControlPlane = await callMcp(child, 'tools/call', {
|
|
344
|
-
name: 'pixcode_repair_hermes_control_plane',
|
|
345
|
-
arguments: { projectPath: '/root/pixcode', forceRestart: true },
|
|
346
|
-
});
|
|
347
|
-
assert.match(repairedControlPlane.content[0].text, /"ok": true/, 'Hermes control-plane repair tool should return repaired state.');
|
|
348
|
-
|
|
349
|
-
const manifest = await callMcp(child, 'tools/call', { name: 'pixcode_get_api_manifest', arguments: {} });
|
|
350
|
-
assert.match(manifest.content[0].text, /Pixcode Public API/, 'API manifest tool should expose Pixcode API docs to Hermes.');
|
|
351
|
-
|
|
352
|
-
const apiRequest = await callMcp(child, 'tools/call', {
|
|
353
|
-
name: 'pixcode_api_request',
|
|
354
|
-
arguments: { method: 'GET', path: '/api/projects' },
|
|
355
|
-
});
|
|
356
|
-
assert.match(apiRequest.content[0].text, /"name": "pixcode"/, 'generic Pixcode API tool should call allowlisted local API paths.');
|
|
357
|
-
|
|
358
|
-
const cronJobs = await callMcp(child, 'tools/call', {
|
|
359
|
-
name: 'pixcode_hermes_gateway_request',
|
|
360
|
-
arguments: { method: 'GET', endpoint: '/api/jobs', projectPath: '/root/pixcode' },
|
|
361
|
-
});
|
|
362
|
-
assert.match(cronJobs.content[0].text, /Morning repo check/, 'Hermes gateway request tool should expose API-server jobs/cron endpoints.');
|
|
363
|
-
assert.equal(gatewayRequests[0].endpoint, '/api/jobs', 'Gateway request should keep the requested Hermes endpoint.');
|
|
364
|
-
|
|
365
|
-
const cronList = await callMcp(child, 'tools/call', {
|
|
366
|
-
name: 'pixcode_manage_hermes_cron',
|
|
367
|
-
arguments: { action: 'list', projectPath: '/root/pixcode' },
|
|
368
|
-
});
|
|
369
|
-
assert.match(cronList.content[0].text, /Morning repo check/, 'Hermes cron helper should list managed Hermes jobs.');
|
|
370
|
-
|
|
371
|
-
const launch = await callMcp(child, 'tools/call', {
|
|
372
|
-
name: 'pixcode_open_cli_terminal',
|
|
373
|
-
arguments: { provider: 'codex', projectPath: '/root/pixcode', prompt: 'smoke' },
|
|
374
|
-
});
|
|
375
|
-
assert.match(launch.content[0].text, /hermes-mcp/, 'terminal launch should roundtrip through Pixcode API');
|
|
376
|
-
assert.match(launch.content[0].text, /"pixcodeMcpConfigured": true/, 'terminal launch should configure Pixcode MCP for the selected provider first');
|
|
377
|
-
assert.equal(providerMcpUpserts.length, 1, 'Codex launch should upsert a project-scoped Pixcode MCP server');
|
|
378
|
-
assert.equal(providerMcpUpserts[0].name, 'pixcode', 'Provider MCP server should be named pixcode');
|
|
379
|
-
|
|
380
|
-
providerOutputReads.length = 0;
|
|
381
|
-
const launchWithReadback = await callMcp(child, 'tools/call', {
|
|
382
|
-
name: 'pixcode_open_cli_terminal',
|
|
383
|
-
arguments: {
|
|
384
|
-
provider: 'codex',
|
|
385
|
-
projectPath: '/root/pixcode',
|
|
386
|
-
prompt: 'read final output',
|
|
387
|
-
startupInput: '/init',
|
|
388
|
-
waitForOutputMs: 7000,
|
|
389
|
-
},
|
|
390
|
-
});
|
|
391
|
-
assert(
|
|
392
|
-
providerOutputReads.length >= 5,
|
|
393
|
-
`readback should keep polling until the provider terminal is idle, reads=${providerOutputReads.length}`,
|
|
394
|
-
);
|
|
395
|
-
assert.match(
|
|
396
|
-
launchWithReadback.content[0].text,
|
|
397
|
-
/195 passing, 0 failing/,
|
|
398
|
-
'readback should return the final Codex output instead of the first working frame',
|
|
399
|
-
);
|
|
400
|
-
assert(
|
|
401
|
-
providerOutputReads.every((read) => read.launchId === '2'),
|
|
402
|
-
`readback should be tied to the Hermes terminal launch id, reads=${JSON.stringify(providerOutputReads)}`,
|
|
403
|
-
);
|
|
404
|
-
|
|
405
|
-
const blockedLaunch = await callMcp(child, 'tools/call', {
|
|
406
|
-
name: 'pixcode_open_cli_terminal',
|
|
407
|
-
arguments: { provider: 'qwen', projectPath: '/root/pixcode', prompt: 'smoke' },
|
|
408
|
-
});
|
|
409
|
-
assert.match(blockedLaunch.content[0].text, /"launched": false/, 'uninstalled providers should not create terminal launches');
|
|
410
|
-
assert.match(blockedLaunch.content[0].text, /"reason": "not_installed"/, 'uninstalled provider response should explain the block');
|
|
411
|
-
assert.equal(terminalLaunches.length, 2, 'Only installed Codex provider launches should be created');
|
|
412
|
-
|
|
413
|
-
const inputWrite = await callMcp(child, 'tools/call', {
|
|
414
|
-
name: 'pixcode_send_cli_input',
|
|
415
|
-
arguments: { provider: 'codex', projectPath: '/root/pixcode', input: 'selam', submit: true, launchId: 2 },
|
|
416
|
-
});
|
|
417
|
-
assert.match(inputWrite.content[0].text, /"wrote": true/, 'MCP should be able to submit input to an existing visible provider terminal.');
|
|
418
|
-
assert.equal(providerInputWrites[0].input, 'selam', 'Provider input body should preserve exact user input.');
|
|
419
|
-
assert.equal(providerInputWrites[0].submit, true, 'Provider input should submit by default when requested.');
|
|
420
|
-
|
|
421
|
-
assert(seen.every((entry) => entry.auth === `Bearer ${apiKey}`), 'all MCP calls should use the Pixcode bearer key');
|
|
422
|
-
console.log('hermes MCP Pixcode roundtrip smoke passed');
|
|
423
|
-
} finally {
|
|
424
|
-
child.kill();
|
|
425
|
-
await new Promise((resolve) => server.close(resolve));
|
|
426
|
-
}
|