/interview command with session prompt orchestration, interview markdown persistence, and a local HTTP interface.outputFolder,manager.ts is the composition root and returns:
registerCommandhandleCommandExecuteBeforehandleEventcreateInterviewService(ctx, interviewConfig) and selects mode via:
interview.dashboard === true || interview.port > 0.createInterviewService (service.ts)interviewsById, activeInterviewIds, sessionBusy, fileCache.resolveExistingInterviewPath, createInterview, resumeInterview.document.ts helpers, then notifies users with notifyInterviewUrl.syncInterview:
<interview_state> using parseAssistantState / findLatestAssistantState (parser.ts) with zod-backed validation,awaiting-agent, awaiting-user, completed, error, abandoned).submitAnswers validates active questions and injects answer prompts via session.promptAsync.handleNudgeAction injects either continuation questions or finalization directives.session.status updates sessionBusy,session.deleted marks active interview as abandoned and cleans the maps.createInterviewServer (server.ts)GET / and GET /api/interviews (dashboard list APIs)GET /interview/{id} (interview page)GET /api/interviews/{id}/statePOST /api/interviews/{id}/answersPOST /api/interviews/{id}/nudge400/404/409/500) and delegates rendering to ui.ts.dashboard.tscreateDashboardServer maintains:
.dashboard-<port>.json),rebuildFromFiles() reconstructs state from markdown when sessions rejoin,GET /api/health, /api/settings, /api/sessions, /api/files,POST /api/register, /api/interviews (create), /api/interviews/{id}/state,/pending and /nudge GET/POST paths for agent/browser sync.document.ts: path normalization, markdown creation/rewrite/read, and frontmatter/title/summary extraction.parser.ts: parseInterviewState + findLatestAssistantState state extraction pipeline.prompts.ts: command/answer/nudge prompt builders.helpers.ts: request parsing and HTTP response helpers.types.ts: domain contracts and zod schemas (InterviewRecord, InterviewState, InterviewStateEntry, RawInterviewStateSchema, RawQuestionSchema).src/index.ts initializes interview plugin integration through createInterviewManager(ctx, config).
Per-session mode (dashboard false / port=0):
interview.outputFolder,createInterviewServer({ port: 0 }),Dashboard mode (dashboard true or port > 0):
createInterviewManager calls tryBecomeDashboard.statePushCallback and setOnInterviewCreated,discoverSessionDirectories + refreshFiles,readDashboardAuthFile,POST /api/register,POST /api/interviews/{id}/state,POST /api/interviews,/pending and /nudge.handleCommandExecuteBefore:
handleEvent:
session.status.idle: consume pending dashboard actions then refresh state,session.deleted: unregister session and remove linked dashboard entries.src/index.ts.src/interview/*test.ts.