Files
Codeman/src/types/index.ts
T
Codeman maintainer 161f1da2eb feat: Read My Mind phase 1, per-case intent profiles (capture + API + skill)
Per-case profiles of user intent (docs/readmymind-plan.md): user-stated goals
plus the user's recently submitted prompts, captured from the Claude session
transcript behind the new synced readMyMindEnabled setting (default OFF).

- intent-store.ts: keyed by owner + realpath(workingDir), FIFO/size caps,
  consecutive-dupe collapse, atomic 0600 writes to ~/.codeman/intents.json
- transcript-watcher.ts: new transcript:user_prompt event for typed user turns
  (tool_result-only entries stay silent); capture wiring in server.ts is
  claude-only and gated on the setting per event
- readmymind-routes.ts: GET/PUT/DELETE /api/sessions/:id/intent, ownership
  via findSessionOrFail, strict Zod schema
- agent skill: SKILL.md recipe + endpoints.md rows so agents can read and
  record intent (PUT replaces: read + merge; never delete unprompted)
- groundwork for the phase-2 predictor button; nothing is ever auto-sent

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-09 18:03:13 +02:00

75 lines
4.5 KiB
TypeScript

/**
* @fileoverview Barrel re-export for all Codeman type definitions.
*
* The type system is split into 13 domain modules for maintainability.
* Import from `'./types'` (or `'./types/index.js'`) to access any type:
*
* ```ts
* import type { SessionState, AppState, RespawnConfig } from './types';
* import { createErrorResponse, ApiErrorCode } from './types';
* ```
*
* ## Domain modules
*
* | Module | Key exports | Persistence / API |
* |--------------|-----------------------------------------------------------------------|-------------------------------------------------|
* | common | Disposable, BufferConfig, CleanupRegistration, NiceConfig, ProcessStats | In-memory only |
* | session | SessionState, SessionConfig, SessionStatus, SessionMode, ClaudeMode, OpenCodeConfig | `~/.codeman/state.json` → `GET /api/sessions` |
* | task | TaskDefinition, TaskState, TaskStatus | `~/.codeman/state.json` → `GET /api/tasks` |
* | app-state | AppState, AppConfig, GlobalStats, TokenStats, DEFAULT_CONFIG | `~/.codeman/state.json` → `GET /api/status` |
* | respawn | RespawnConfig, RespawnPreset, RespawnCycleMetrics, RalphLoopHealthScore, TimingHistory | Per-session in state.json → `GET /api/sessions/:id/respawn` |
* | ralph | RalphTrackerState, RalphTodoItem, CircuitBreakerStatus, RalphStatusBlock, RalphSessionState | Per-session → `GET /api/sessions/:id/ralph-state` |
* | api | ApiResponse, ApiErrorCode, HookEventType, CaseInfo, createErrorResponse, getErrorMessage | Used by all route handlers |
* | lifecycle | LifecycleEntry, LifecycleEventType | `~/.codeman/session-lifecycle.jsonl` (append-only) |
* | run-summary | RunSummary, RunSummaryEvent, RunSummaryStats | In-memory → `GET /api/sessions/:id/run-summary` |
* | tools | ActiveBashTool, ImageDetectedEvent | In-memory, broadcast via SSE |
* | teams | TeamConfig, TeamMember, TeamTask, InboxMessage, PaneInfo | `~/.claude/teams/`, `~/.claude/tasks/` → `GET /api/teams` |
* | push | PushSubscriptionRecord, VapidKeys | `~/.codeman/push-keys.json`, `~/.codeman/push-subscriptions.json` |
* | plan | PlanItem, PlanTaskStatus, TddPhase | In-memory → `GET /api/sessions/:id/plan/tasks` |
* | orchestrator | OrchestratorState, OrchestratorPlan, OrchestratorConfig, OrchestratorPersistState | `~/.codeman/state.json` → `GET /api/orchestrator/status` |
*
* ## Cross-domain relationship map
*
* ```
* AppState (app-state)
* ├── sessions: Record<id, SessionState> ← session domain
* │ ├── respawnConfig?: RespawnConfig ← respawn domain (per-session settings)
* │ ├── ralphEnabled?: boolean ← toggles ralph tracking
* │ └── id ← referenced by:
* │ ├── RalphSessionState.sessionId ← ralph domain
* │ ├── RunSummary.sessionId ← run-summary domain
* │ ├── ActiveBashTool.sessionId ← tools domain
* │ ├── RespawnCycleMetrics.sessionId ← respawn domain
* │ └── TeamConfig.leadSessionId ← teams domain
* ├── tasks: Record<id, TaskState> ← task domain
* │ └── assignedSessionId → SessionState.id
* ├── ralphLoop: RalphLoopState ← ralph domain (global loop state)
* └── config: AppConfig
* └── respawn: RespawnConfig ← respawn domain (global defaults)
*
* RalphLoopHealthScore (respawn)
* └── components.circuitBreaker ← derived from CircuitBreakerStatus (ralph)
* ```
*/
export * from './common.js';
export * from './session.js';
export * from './task.js';
export * from './app-state.js';
export * from './respawn.js';
export * from './ralph.js';
export * from './api.js';
export * from './lifecycle.js';
export * from './run-summary.js';
export * from './tools.js';
export * from './teams.js';
export * from './push.js';
export * from './plan.js';
export * from './orchestrator.js';
export * from './update.js';
export * from './workflow-run.js';
export * from './search.js';
export * from './user.js';
export * from './webview.js';
export * from './intent.js';