import type {
  ChronicleActivitySegment,
  ChroniclePipelineRun,
} from '../use-chronicle'

export const chronicleActivitySegmentFixtures: ChronicleActivitySegment[] = [
  {
    id: 'segment-work',
    sessionId: 'session-1',
    startedAt: '2026-07-23T09:40:00.000Z',
    startedAtUnix: 1_753_264_800,
    endedAt: '2026-07-23T10:22:00.000Z',
    endedAtUnix: 1_753_267_320,
    durationSeconds: 2_520,
    segmentType: 'work',
    frontApp: 'Visual Studio Code',
    title: 'Extract Chronicle rendering seams',
    summary: 'Separated runtime actions from the activity cards and added fixture-driven Storybook coverage.',
    sourceCounts: {
      snapshotIds: 18,
      messageIds: 4,
      audioRawSegmentIds: 0,
      audioTranscriptIds: 1,
      memoryIds: 2,
    },
    sourceRefs: {},
    pipelineStatus: 'triaged',
    isCrystallized: false,
    metadata: {},
  },
  {
    id: 'segment-meeting',
    sessionId: 'session-1',
    startedAt: '2026-07-23T10:30:00.000Z',
    startedAtUnix: 1_753_267_800,
    endedAt: '2026-07-23T11:10:00.000Z',
    endedAtUnix: 1_753_270_200,
    durationSeconds: 2_400,
    segmentType: 'meeting',
    frontApp: 'Slack',
    title: 'Product design review',
    summary: 'Reviewed the timeline filters, resource install states, and expected mobile behavior.',
    sourceCounts: {
      snapshotIds: 8,
      messageIds: 12,
      audioRawSegmentIds: 6,
      audioTranscriptIds: 2,
      memoryIds: 0,
    },
    sourceRefs: {},
    pipelineStatus: 'summarized',
    isCrystallized: false,
    metadata: {},
  },
  {
    id: 'segment-browsing',
    sessionId: 'session-1',
    startedAt: '2026-07-23T11:15:00.000Z',
    startedAtUnix: 1_753_270_500,
    endedAt: '2026-07-23T11:31:00.000Z',
    endedAtUnix: 1_753_271_460,
    durationSeconds: 960,
    segmentType: 'browsing',
    frontApp: 'Safari',
    title: null,
    summary: null,
    sourceCounts: {
      snapshotIds: 5,
    },
    sourceRefs: {},
    pipelineStatus: 'collecting',
    isCrystallized: false,
    metadata: {},
  },
]

export const chroniclePipelineRunFixtures: ChroniclePipelineRun[] = [
  {
    id: 'run-success',
    sessionId: 'session-1',
    segmentId: 'segment-work',
    trigger: 'manual',
    stage: 'summarization',
    status: 'success',
    startedAt: '2026-07-23T10:23:00.000Z',
    startedAtUnix: 1_753_267_380,
    endedAt: '2026-07-23T10:23:05.000Z',
    endedAtUnix: 1_753_267_385,
    errorMessage: null,
    snapshotsCount: 18,
    messagesCount: 4,
    audioTranscriptsCount: 1,
    audioRawSegmentsCount: 0,
    memoriesCount: 2,
    segmentsCount: 1,
    segmentIds: ['segment-work'],
    metadata: {},
  },
  {
    id: 'run-running',
    sessionId: 'session-1',
    segmentId: 'segment-meeting',
    trigger: 'audio-transcript',
    stage: 'triage',
    status: 'running',
    startedAt: '2026-07-23T11:12:00.000Z',
    startedAtUnix: 1_753_270_320,
    endedAt: null,
    endedAtUnix: null,
    errorMessage: null,
    snapshotsCount: 8,
    messagesCount: 12,
    audioTranscriptsCount: 2,
    audioRawSegmentsCount: 6,
    memoriesCount: 0,
    segmentsCount: 1,
    segmentIds: ['segment-meeting'],
    metadata: {},
  },
  {
    id: 'run-error',
    sessionId: 'session-1',
    segmentId: 'segment-browsing',
    trigger: 'snapshot',
    stage: 'crystallization',
    status: 'error',
    startedAt: '2026-07-23T11:33:00.000Z',
    startedAtUnix: 1_753_271_580,
    endedAt: '2026-07-23T11:33:02.000Z',
    endedAtUnix: 1_753_271_582,
    errorMessage: 'The selected model is unavailable. Choose another model and retry.',
    snapshotsCount: 5,
    messagesCount: 0,
    audioTranscriptsCount: 0,
    audioRawSegmentsCount: 0,
    memoriesCount: 0,
    segmentsCount: 1,
    segmentIds: ['segment-browsing'],
    metadata: {},
  },
]
