85bfdf2b56
New 'Recap' phase — turns speakers.json into a human-readable recap, leveraging recap-relay's proven logic/prompts but calling the Spark gateway's OpenAI-compatible /v1/chat/completions directly (same host/TLS as label-merge; Qwen3-35B). We start from already-named speakers (label-merge), so recap-relay's speaker clustering + name-inference are skipped entirely. - GatewayLLMClient: /v1/chat/completions (JSON mode), model discovery via /api/endpoints, TLS-skip reuse, 503 retry, sequential. - RecapAnalyzer: speakers.json → numbered [N] (MM:SS) Name: text transcript → time-windowed analyze (single window for short calls, 18min/2min overlap for long) → stitch/dedup topic sections → meeting extras (TLDR/decisions/action_items/ open_questions/key_quotes). Defensive JSON parsing of LLM output. - RecapRenderer: writes transcript.md + a self-contained dark-theme recap.html (topic sections w/ collapsible transcripts, extras panels, speaker color chips, full timestamped speaker-attributed transcript, print styles). - SessionController.buildRecap: best-effort after speakers.json (gated by settings.recapEnabled); surfaces recapURL → menu 'Open recap'. Skips silently if the gateway has no LLM. Settings toggle added. Validated END-TO-END on the real Meet session against the live gateway: dual-channel transcription → 3 topic sections + accurate TLDR + key quotes; 'Go Bitcoin' correctly attributed to the remote speaker. 46/46 XCTest (10 new).
39 lines
1.6 KiB
Swift
39 lines
1.6 KiB
Swift
import Foundation
|
|
|
|
/// One topic section: a contiguous run of transcript entries `[startIndex...endIndex]`
|
|
/// (inclusive, indices into the canonical entries array) with an LLM title + summary.
|
|
struct TopicSection: Equatable {
|
|
var title: String
|
|
var summary: String
|
|
var startIndex: Int
|
|
var endIndex: Int
|
|
}
|
|
|
|
/// Structured "meeting extras" extracted from the named transcript. Mirrors
|
|
/// recap-relay's schema; speakers are real names (we already have them from
|
|
/// label-merge), not anonymous cluster ids.
|
|
struct MeetingExtras: Equatable {
|
|
struct TLDR: Equatable { var summary: String; var primarySpeakers: [String] }
|
|
struct Decision: Equatable { var statement: String; var agreedBy: [String]; var supportingOffset: Int? }
|
|
struct ActionItem: Equatable { var description: String; var owner: String?; var dueHint: String?; var supportingOffset: Int? }
|
|
struct OpenQuestion: Equatable { var question: String; var raisedBy: String? }
|
|
struct KeyQuote: Equatable { var speaker: String?; var offset: Int?; var quote: String; var whyNotable: String }
|
|
|
|
var tldr: TLDR
|
|
var decisions: [Decision]
|
|
var actionItems: [ActionItem]
|
|
var openQuestions: [OpenQuestion]
|
|
var keyQuotes: [KeyQuote]
|
|
|
|
var isEmptyBeyondTLDR: Bool {
|
|
decisions.isEmpty && actionItems.isEmpty && openQuestions.isEmpty && keyQuotes.isEmpty
|
|
}
|
|
}
|
|
|
|
/// The assembled recap for one session: the topic sections + (optional) extras,
|
|
/// over the session's transcript. Rendered to `transcript.md` / `recap.html`.
|
|
struct RecapResult: Equatable {
|
|
var sections: [TopicSection]
|
|
var extras: MeetingExtras?
|
|
}
|