Files
Codeman/test/run-button-mode-colours.test.ts
T
Devvyn c5de8383e7 feat(cli-registry): GitHub Copilot CLI as a run mode
Copilot (`copilot`, npm @github/copilot) as a stock CLI entry with the same launch options as the other agent CLIs: model (--model), resume (--resume), continue (--continue) and allow-all (--yolo, clamped off for non-granted multi-user owners). Adds a resolver and GET /api/copilot/status probe, the agent-image package, Run-menu/mobile/logo entries, skill docs and tests.
2026-10-18 00:47:46 +08:00

28 lines
1.1 KiB
TypeScript

import { describe, it, expect } from 'vitest';
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { STOCK_CLIS } from '../src/config/cli-registry/stock.js';
const publicDir = resolve(import.meta.dirname, '../src/web/public');
const styles = readFileSync(resolve(publicDir, 'styles.css'), 'utf8');
// An agent CLI whose Run button has no `mode-<id>` rule falls back to the default button
// colours, so it reads as a different button from every other CLI's. The Run button, its
// gear, the phone toolbar and the light skins each carry their own rule.
const AGENT_IDS = STOCK_CLIS.filter((c) => c.kind === 'agent').map((c) => c.id as string);
describe('Run button colours for every stock agent CLI', () => {
it('lists agent CLIs (anti-vacuity)', () => {
expect(AGENT_IDS).toContain('copilot');
expect(AGENT_IDS.length).toBeGreaterThan(5);
});
for (const id of AGENT_IDS) {
it(`${id} has a Run button rule`, () => {
expect(styles, `${id} has no .btn-run.mode-${id} rule in styles.css`).toContain(
`.btn-toolbar.btn-run.mode-${id}`
);
});
}
});