feat(vc): add recording event support#1369
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR adds three new VC event processors for recording lifecycle events: recording_started, recording_transcript_generated, and recording_ended. Each processor parses an envelope-structured payload, filters to recording_bean-sourced events, flattens the schema, converts millisecond timestamps to local RFC3339 format, and marshals the output. All three processors are registered as event key definitions with consistent auth and scope requirements, and comprehensive tests validate registration, processing logic, timestamp conversion, field mapping, filtering, and subscription lifecycle. ChangesVC Recording Event Processors
Sequence DiagramsequenceDiagram
participant RawEvent
participant Processor
participant Envelope
participant Output
RawEvent->>Processor: raw payload (JSON)
Processor->>Envelope: unmarshal envelope structure
alt envelope parsed successfully
Envelope->>Processor: header + event body
alt source == "recording_bean"
Processor->>Output: flatten & convert timestamps
Output->>Processor: flattened DTO
Processor->>RawEvent: marshal & return output
else non-recording_bean source
Processor->>RawEvent: return nil (drop event)
end
else envelope parse fails
Processor->>RawEvent: return original payload bytes
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1369 +/- ##
==========================================
+ Coverage 71.47% 71.94% +0.46%
==========================================
Files 688 694 +6
Lines 65483 65802 +319
==========================================
+ Hits 46807 47338 +531
+ Misses 15031 14808 -223
- Partials 3645 3656 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@3e9dd245c85dae856b6c78f66f3ffece89de9a77🧩 Skill updatenpx skills add larksuite/cli#feat/recording_event -y -g |
Summary
Add support for consuming recording open events through
lark-cli event consume. This PR covers recording started, recording transcript generated, and recording ended events, and outputs structured JSON that scripts and AI agents can process directly.This change only supports Recording Bean events. Other recording sources are intentionally filtered out for now.
New EventKeys
Apps need to enable the following open platform events:
vc.recording.recording_started_v1: recording startedvc.recording.recording_transcript_generated_v1: recording transcript items generatedvc.recording.recording_ended_v1: recording ended and uploaded successfullyCLI consume examples:
Permissions
These events are consumed with user authentication. The app needs:
uservc:recording:readOutput
This PR flattens the original event payload into stable fields so callers do not need to parse the raw open platform payload shape.
Recording started and recording ended events output:
typeevent_idevent_timeunique_keysourceRecording transcript generated events additionally output:
transcript_items[].speaker_nametranscript_items[].texttranscript_items[].start_timetranscript_items[].end_timetranscript_items[].sentence_idLimitations
Only Recording Bean events are supported in this PR. In the raw payload, this is represented as
source = recording_bean.recording_endedoutput does not exposeobject_typeorobject_id, so callers do not depend on non-core object metadata.event_time,start_time, andend_time; raw millisecond timestamp fields are not exposed.Changes
Test Plan
make unit-testlark-cli event consume <EventKey>recording event flow works as expectedRelated Issues
Summary by CodeRabbit
Release Notes
New Features
Tests