diff --git a/src/types.ts b/src/types.ts index bcd9f554..dbee6b59 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1536,3 +1536,44 @@ export interface PaneInfo { // ========== Plan Orchestrator Re-exports ========== export type { PlanItem } from './plan-orchestrator.js'; + +// ========== Agent Teams Types ========== + +/** Team configuration from ~/.claude/teams/{name}/config.json */ +export interface TeamConfig { + name: string; + leadSessionId: string; + members: TeamMember[]; +} + +/** A single team member (lead or teammate) */ +export interface TeamMember { + agentId: string; + name: string; + agentType: 'team-lead' | 'general-purpose' | string; + color?: string; + backendType?: string; + prompt?: string; + tmuxPaneId?: string; +} + +/** A task from ~/.claude/tasks/{team-name}/{N}.json */ +export interface TeamTask { + id: string; + subject: string; + description?: string; + activeForm?: string; + status: 'pending' | 'in_progress' | 'completed' | string; + blocks: string[]; + blockedBy: string[]; + owner?: string; + metadata?: Record; +} + +/** An inbox message from ~/.claude/teams/{name}/inboxes/{member}.json */ +export interface InboxMessage { + from: string; + text: string; + timestamp: string; + read?: boolean; +} diff --git a/src/web/server.ts b/src/web/server.ts index 204120ac..72e94735 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -14,16 +14,15 @@ import Fastify, { FastifyInstance, FastifyReply } from 'fastify'; import fastifyStatic from '@fastify/static'; import path, { join, dirname, resolve, relative, isAbsolute } from 'node:path'; import { fileURLToPath } from 'node:url'; -import { existsSync, mkdirSync, mkdtempSync, writeFileSync, readdirSync, readFileSync, rmSync, unlinkSync } from 'node:fs'; +import { existsSync, mkdirSync, writeFileSync, readdirSync, readFileSync, rmSync } from 'node:fs'; import fs from 'node:fs/promises'; -import { execSync, spawn, type ChildProcess } from 'node:child_process'; -import { homedir, tmpdir, totalmem, freemem, loadavg, cpus } from 'node:os'; +import { execSync } from 'node:child_process'; +import { homedir, totalmem, freemem, loadavg, cpus } from 'node:os'; import { EventEmitter } from 'node:events'; import { Session, ClaudeMessage, type BackgroundTask, type RalphTrackerState, type RalphTodoItem, type ActiveBashTool } from '../session.js'; import { fileStreamManager } from '../file-stream-manager.js'; import { RespawnController, RespawnConfig, RespawnState } from '../respawn-controller.js'; import type { TerminalMultiplexer } from '../mux-interface.js'; -import { TmuxManager } from '../tmux-manager.js'; import { createMultiplexer } from '../mux-factory.js'; import { getStore } from '../state-store.js'; import { generateClaudeMd } from '../templates/claude-md.js';