codehere 0.3.4 → 0.5.0-alpha.2

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.
@@ -437,10 +437,24 @@ export function startMCPServer(options = {}) {
437
437
  // ── E2 · Per-agent readiness (onboarding surface) ─────────────────────────
438
438
  // Full registry snapshot: install state + auth state + hints. Powers the
439
439
  // setup-aware agent dropdown and the one-click swap flow on auth errors.
440
+ //
441
+ // Apr 29: Conductor moved to a separate `auto` field. The web UI IS the
442
+ // Conductor surface — exposing "conductor" as a peer in the agents array
443
+ // is the "Gmail asks you to pick 'email' before composing" anti-pattern.
444
+ // But Conductor's readiness state IS the Auto option's readiness, so the
445
+ // UI needs it preserved (codex Round 1 caught: fresh install with no
446
+ // specialists installed would otherwise lose the setup prompt — Auto
447
+ // gets selected by default, submission fails at /api/task because
448
+ // conductor.isInstalled() returns false). The separate `auto` field
449
+ // keeps the setup hint plumbing intact while preventing the dropdown
450
+ // from showing Conductor as a peer choice.
440
451
  if (req.method === 'GET' && req.url === '/api/readiness/agents') {
441
452
  try {
453
+ const all = readinessForAllAgents();
454
+ const auto = all.find((a) => a.id === 'conductor');
455
+ const agents = all.filter((a) => a.id !== 'conductor');
442
456
  res.writeHead(200, { 'Content-Type': 'application/json' });
443
- res.end(JSON.stringify({ agents: readinessForAllAgents() }));
457
+ res.end(JSON.stringify({ agents, auto }));
444
458
  }
445
459
  catch (e) {
446
460
  res.writeHead(500, { 'Content-Type': 'application/json' });
@@ -485,9 +499,22 @@ export function startMCPServer(options = {}) {
485
499
  // log/spawn. Stops log injection (`agent: "claude-code\n[FAKE]"`),
486
500
  // future-proofs against partial-match exploits, and fails fast
487
501
  // with a clear 400 instead of letting SessionManager.spawn throw.
502
+ //
503
+ // Apr 29: default flipped from 'claude-code' to 'conductor'. The web
504
+ // UI is the Conductor surface; tasks submitted without an explicit
505
+ // agent route through the supervisor (rule-based routing today,
506
+ // LLM classifier in v0.6). Empty string is treated like undefined
507
+ // so the form submitting `agent: ""` (Auto option) hits the same
508
+ // path. Specialists remain explicit overrides via the dropdown.
509
+ // Type-check is preserved: non-string non-undefined values still 400.
510
+ if (agent !== undefined && agent !== null && typeof agent !== 'string') {
511
+ res.writeHead(400, { 'Content-Type': 'application/json' });
512
+ res.end(JSON.stringify({ error: 'agent must be a string or omitted' }));
513
+ return;
514
+ }
488
515
  const validAgentIds = new Set(allAdapters().map((a) => a.id));
489
- const agentId = agent ?? 'claude-code';
490
- if (typeof agentId !== 'string' || !validAgentIds.has(agentId)) {
516
+ const agentId = (typeof agent === 'string' && agent.length > 0) ? agent : 'conductor';
517
+ if (!validAgentIds.has(agentId)) {
491
518
  res.writeHead(400, { 'Content-Type': 'application/json' });
492
519
  res.end(JSON.stringify({
493
520
  error: `Unknown agent: ${typeof agentId === 'string' ? agentId.slice(0, 64) : '<non-string>'}`,