open-design/apps/daemon/tests/acp.test.ts
marco 5dd70b5016
Some checks failed
ci / Validate workspace (push) Successful in 12m32s
landing-page-ci / Validate landing page (push) Successful in 9m41s
landing-page-deploy / Deploy landing page (push) Failing after 5m23s
github-metrics / Generate repository metrics SVG (push) Failing after 2m3s
refresh-contributors-wall / Refresh contributors wall cache bust (push) Failing after 11s
Initial import: open-design source for helix-mind.ai distribution
This repository contains the open-design daemon CLI source code, built
and packaged at https://helix-mind.ai/cli/open-design/latest.tgz for use
by the HelixMind /design slash command.

Licenses: Apache-2.0 (root) + MIT (skills/*)
2026-05-06 20:50:24 +02:00

49 lines
1.7 KiB
TypeScript

// @ts-nocheck
import assert from 'node:assert/strict';
import path from 'node:path';
import { test } from 'vitest';
import { buildAcpSessionNewParams } from '../src/acp.js';
test('ACP session params do not require MCP servers by default', () => {
assert.deepEqual(buildAcpSessionNewParams('/tmp/od-project'), {
cwd: path.resolve('/tmp/od-project'),
mcpServers: [],
});
});
test('ACP session params do not request global MCP config mutation', () => {
const params = buildAcpSessionNewParams('/tmp/od-project');
assert.equal('mcpConfigPath' in params, false);
assert.equal('writeMcpConfig' in params, false);
assert.equal('installMcpServers' in params, false);
});
test('ACP session params normalize explicit MCP servers to ACP stdio shape', () => {
const mcpServers = [{ name: 'open-design-live-artifacts', command: 'od', args: ['mcp', 'live-artifacts'] }];
assert.deepEqual(buildAcpSessionNewParams('/tmp/od-project', { mcpServers }), {
cwd: path.resolve('/tmp/od-project'),
mcpServers: [
{
type: 'stdio',
name: 'open-design-live-artifacts',
command: 'od',
args: ['mcp', 'live-artifacts'],
env: [],
},
],
});
});
test('ACP session params preserve caller-provided type and env fields', () => {
const mcpServers = [
{ type: 'http', name: 'http-server', url: 'http://localhost:3000', headers: {}, env: [{ key: 'TOKEN', value: 'secret' }] },
];
const result = buildAcpSessionNewParams('/tmp/od-project', { mcpServers });
assert.equal(result.mcpServers[0].type, 'http');
assert.equal(result.mcpServers[0].name, 'http-server');
assert.deepEqual(result.mcpServers[0].env, [{ key: 'TOKEN', value: 'secret' }]);
});