feat(councils): add preflight, schema-driven outputs, and artifact reporting

This commit is contained in:
William Valentin
2026-02-22 15:56:30 -08:00
parent dafe9b4d3d
commit 44c7409a20
18 changed files with 1686 additions and 29 deletions
+12
View File
@@ -33,9 +33,16 @@ describe('parseCommand', () => {
it('parses /council command', () => {
expect(parseCommand('/council design backup plan')).toEqual({ type: 'council', task: 'design backup plan' });
expect(parseCommand('/council preflight')).toEqual({ type: 'council', task: 'preflight' });
expect(parseCommand('/council')).toEqual({ type: 'council', task: '' });
});
it('parses natural-language council shortcut', () => {
expect(parseCommand('run council design backup plan')).toEqual({ type: 'council', task: 'design backup plan' });
expect(parseCommand('yes run the council')).toEqual({ type: 'council', task: '' });
expect(parseCommand('Run council on #2')).toEqual({ type: 'council', task: '#2' });
});
it('parses /fullscreen command', () => {
expect(parseCommand('/fullscreen')).toEqual({ type: 'fullscreen' });
expect(parseCommand('/fs')).toEqual({ type: 'fullscreen' });
@@ -197,6 +204,11 @@ describe('getCommandCompletions', () => {
const completions = getCommandCompletions('/model fast x');
expect(completions).toEqual(['/model fast xai']);
});
it('completes /council preflight shortcut', () => {
const completions = getCommandCompletions('/council pre');
expect(completions).toEqual(['/council preflight']);
});
});
describe('isToolInventoryQuery', () => {
+15 -1
View File
@@ -88,6 +88,11 @@ export function parseCommand(input: string): Command | null {
if (trimmed === '/council') {
return { type: 'council', task: '' };
}
// Natural-language council shortcut for common flows.
const councilShortcut = trimmed.match(/^(?:yes\s+)?run\s+(?:the\s+)?council(?:\s+on)?(?:\s+(.+))?$/i);
if (councilShortcut) {
return { type: 'council', task: (councilShortcut[1] ?? '').trim() };
}
// Fullscreen
if (trimmed === '/fullscreen' || trimmed === '/fs') {
@@ -211,6 +216,7 @@ Commands:
/backend [provider] Show or switch local backend (ollama, llamacpp)
/research <task> Delegate a task to the configured research agent
/council <task> Run the councils pipeline for a task
/council preflight Check council tier routing, endpoint/auth mode, and probe latency
/login [provider] Authenticate with GitHub, OpenAI, Anthropic, or Z.AI
/pair List pending pairing codes and approved senders
/pair generate [label] Generate a new DM pairing code
@@ -275,7 +281,7 @@ export const COMMAND_TOOLTIPS: Record<string, string> = {
'/model': 'Show or switch model (local, default, fast, complex)',
'/backend': 'Show or switch local backend (ollama, llamacpp)',
'/research': 'Delegate a task to the configured research agent',
'/council': 'Run the councils pipeline for a task',
'/council': 'Run the councils pipeline for a task; use "/council preflight" for route/auth checks',
'/reset': 'Clear conversation history',
'/clear': 'Clear conversation history',
'/new': 'Start a new conversation',
@@ -319,6 +325,14 @@ export const MODEL_TOOLTIPS: Record<string, string> = {
export function getCommandCompletions(partial: string): string[] {
const trimmed = partial.trim();
if (trimmed.startsWith('/council ')) {
const suffix = trimmed.slice('/council '.length).toLowerCase();
if ('preflight'.startsWith(suffix)) {
return ['/council preflight'];
}
return [];
}
// Complete /model <tier> <provider/model>
if (trimmed.startsWith('/model ')) {
const args = trimmed.slice('/model '.length).trim();
+1 -1
View File
@@ -633,7 +633,7 @@ export function App({
case 'council': {
if (!command.task.trim()) {
pushAssistantMessage('Usage: /council <question or task>');
pushAssistantMessage('Usage: /council <question or task> | /council preflight');
return;
}
if (!onCouncil) {