meetstream-migrate 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ """MeetStream Migration SDK — Recall.ai → MeetStream.ai"""
2
+ __version__ = "1.0.0"
@@ -0,0 +1,329 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ meetstream-migrate CLI (Python)
4
+
5
+ Usage:
6
+ meetstream-migrate [path] — Scan & migrate a project
7
+ meetstream-migrate scan [path] — Scan only (no changes)
8
+ meetstream-migrate test — Run API tests against MeetStream
9
+
10
+ Options:
11
+ --yes, -y Skip confirmation prompt
12
+ --dry-run Show what would change without writing
13
+ --api-key KEY MeetStream API key (for test command)
14
+ """
15
+ import sys
16
+ import os
17
+ import argparse
18
+
19
+ from rich.console import Console
20
+ from rich.table import Table
21
+ from rich.panel import Panel
22
+ from rich.text import Text
23
+ from rich import box
24
+
25
+ from .scanner import scan_project
26
+ from .transformer import transform_project
27
+ from .mappings import WEBHOOK_LIFECYCLE_EVENTS, WEBHOOK_POSTCALL_EVENTS, WEBHOOK_REALTIME_EVENTS
28
+
29
+ console = Console()
30
+
31
+
32
+ def show_logo():
33
+ logo = Text()
34
+ logo.append("MeetStream", style="bold cyan")
35
+ logo.append(" Migration SDK\n", style="white")
36
+ logo.append("Recall.ai → MeetStream.ai — One Command Migration", style="dim")
37
+ console.print(Panel(logo, border_style="cyan", padding=(1, 4)))
38
+
39
+
40
+ def show_scan_summary(results):
41
+ s = results["summary"]
42
+ console.print("\n[bold cyan]📊 Scan Summary[/]\n")
43
+ console.print(f" Project: {results['project_dir']}")
44
+ console.print(f" Files scanned: {results['total_files']}")
45
+ console.print(f" Files with Recall: [yellow bold]{s['files_with_findings']}[/]")
46
+ console.print(f" API calls found: [green bold]{s['total_api_calls']}[/]")
47
+ console.print(f" Field usages: [green bold]{s['total_field_usages']}[/]")
48
+ console.print(f" Webhook handlers: [green bold]{s['total_webhook_handlers']}[/]")
49
+ console.print(f" SDK imports: [green bold]{s['total_sdk_imports']}[/]")
50
+ console.print(f" Base URLs: [green bold]{s['total_base_urls']}[/]")
51
+
52
+
53
+ def show_endpoint_table(results):
54
+ breakdown = results["summary"]["endpoint_breakdown"]
55
+ if not breakdown:
56
+ console.print("\n [yellow]No specific API endpoints detected.[/]\n")
57
+ return
58
+
59
+ console.print("\n[bold cyan]🔄 API Endpoint Mapping[/]\n")
60
+ table = Table(box=box.ROUNDED, show_lines=True)
61
+ table.add_column("#", style="dim", width=3)
62
+ table.add_column("Category", style="cyan", width=13)
63
+ table.add_column("Recall.ai Endpoint", style="yellow", width=33)
64
+ table.add_column("MeetStream.ai Endpoint", style="green", width=33)
65
+ table.add_column("Count", justify="center", width=5)
66
+ table.add_column("Status", width=8)
67
+
68
+ for i, (name, ep) in enumerate(breakdown.items(), 1):
69
+ status = "[red]SKIP[/]" if ep.get("skipped") else "[green]✓ MAP[/]"
70
+ table.add_row(str(i), ep["category"], ep["recall"], ep["meetstream"], str(ep["count"]), status)
71
+
72
+ console.print(table)
73
+
74
+
75
+ def show_field_table(results):
76
+ fields = results["summary"]["field_changes"]
77
+ if not fields:
78
+ return
79
+
80
+ console.print("\n[bold cyan]📝 Field / Object Mapping[/]\n")
81
+ table = Table(box=box.ROUNDED, show_lines=True)
82
+ table.add_column("#", style="dim", width=3)
83
+ table.add_column("Type", width=8)
84
+ table.add_column("Recall.ai Field", style="yellow", width=38)
85
+ table.add_column("MeetStream.ai Field", style="green", width=38)
86
+
87
+ for i, f in enumerate(fields, 1):
88
+ t = "[blue]Field[/]" if f["type"] == "field" else "[magenta]Endpoint[/]"
89
+ table.add_row(str(i), t, f["recall"], f["meetstream"])
90
+
91
+ console.print(table)
92
+
93
+
94
+ def show_webhook_table():
95
+ console.print("\n[bold cyan]🔔 Webhook Event Mapping[/]\n")
96
+
97
+ # Two-layer model warning
98
+ console.print("[bold yellow] ⚠ IMPORTANT: MeetStream uses a TWO-LAYER event model:[/]")
99
+ console.print('[yellow] Layer 1: Check event → "bot.joining" | "bot.inmeeting" | "bot.stopped"[/]')
100
+ console.print('[yellow] Layer 2: Check bot_status → "Joining" | "InMeeting" | "Stopped" | "NotAllowed" | "Denied" | "Error"[/]')
101
+ console.print("[yellow] For bot.stopped, bot_status tells you WHY the bot stopped.[/]")
102
+ console.print("[yellow] Recall uses one event per status. MeetStream requires checking BOTH fields.[/]\n")
103
+
104
+ # Bot lifecycle events
105
+ console.print("[white bold] Bot Lifecycle Events:[/]")
106
+ lc_table = Table(box=box.ROUNDED, show_lines=True)
107
+ lc_table.add_column("Recall.ai Event", style="yellow", width=34)
108
+ lc_table.add_column("MeetStream event", style="green", width=14)
109
+ lc_table.add_column("bot_status", style="cyan", width=12)
110
+ lc_table.add_column("Description", width=28)
111
+
112
+ for ev in WEBHOOK_LIFECYCLE_EVENTS:
113
+ lc_table.add_row(ev["recall"], ev["ms_event"], ev["ms_status"], ev["desc"])
114
+
115
+ console.print(lc_table)
116
+
117
+ # Post-call processing events
118
+ console.print("\n[white bold] Post-Call Processing Events (MeetStream):[/]")
119
+ pc_table = Table(box=box.ROUNDED, show_lines=True)
120
+ pc_table.add_column("Recall.ai", style="yellow", width=28)
121
+ pc_table.add_column("MeetStream event", style="green", width=26)
122
+ pc_table.add_column("Description", width=28)
123
+
124
+ for ev in WEBHOOK_POSTCALL_EVENTS:
125
+ pc_table.add_row(ev["recall"], ev["ms_event"], ev["desc"])
126
+
127
+ console.print(pc_table)
128
+
129
+ # Real-time events
130
+ console.print("\n[white bold] Real-Time Events:[/]")
131
+ rt_table = Table(box=box.ROUNDED, show_lines=True)
132
+ rt_table.add_column("Recall.ai Event", style="yellow", width=28)
133
+ rt_table.add_column("MeetStream", style="green", width=30)
134
+ rt_table.add_column("Description", width=24)
135
+
136
+ for ev in WEBHOOK_REALTIME_EVENTS:
137
+ rt_table.add_row(ev["recall"], ev["ms_event"], ev["desc"])
138
+
139
+ console.print(rt_table)
140
+
141
+
142
+ def show_compatibility(results):
143
+ console.print("\n[bold cyan]🔍 Compatibility Check[/]\n")
144
+ breakdown = results["summary"]["endpoint_breakdown"]
145
+ compatible = manual = skipped = 0
146
+
147
+ for name, ep in breakdown.items():
148
+ if ep.get("skipped"):
149
+ skipped += 1
150
+ console.print(f" [red]✗ {name} — SKIPPED[/]")
151
+ elif ep.get("notes") and ("MANUAL" in ep["notes"] or "CRITICAL" in ep["notes"]):
152
+ manual += 1
153
+ console.print(f" [yellow]⚠ {name} — needs manual review[/]")
154
+ else:
155
+ compatible += 1
156
+ console.print(f" [green]✓ {name} — compatible[/]")
157
+
158
+ total = compatible + manual + skipped
159
+ pct = round((compatible / total) * 100) if total else 0
160
+ console.print(f"\n Auto-migrate: [green bold]{compatible}[/] endpoints")
161
+ console.print(f" Manual review: [yellow bold]{manual}[/] endpoints")
162
+ console.print(f" Skipped: [red bold]{skipped}[/] endpoints")
163
+ console.print(f"\n Auto-migration coverage: [bold]{pct}%[/]")
164
+
165
+
166
+ def show_transform_results(results):
167
+ console.print(f"\n[bold green]✅ Migration Complete[/]\n")
168
+ console.print(f" Files modified: [green bold]{results['files_changed']}[/]")
169
+ console.print(f" Total changes: [green bold]{results['total_changes']}[/]")
170
+
171
+ if results["warnings"]:
172
+ console.print("\n[bold yellow]⚠️ Warnings — Manual review required:[/]\n")
173
+ for w in results["warnings"]:
174
+ console.print(f" [yellow]{w['file']}[/]")
175
+ console.print(f" Rule: {w['rule']}")
176
+ console.print(f" {w['warning']}\n")
177
+
178
+ if results["file_results"]:
179
+ console.print("[bold cyan]📋 Changes by File[/]\n")
180
+ table = Table(box=box.ROUNDED)
181
+ table.add_column("File", width=42)
182
+ table.add_column("Changes", justify="center", width=8)
183
+ table.add_column("Categories", width=35)
184
+
185
+ for fr in results["file_results"]:
186
+ cats = ", ".join(set(c["category"] for c in fr["changes"]))
187
+ count = sum(c["count"] for c in fr["changes"])
188
+ table.add_row(fr["file"], str(count), cats)
189
+
190
+ console.print(table)
191
+
192
+
193
+ def show_checklist():
194
+ console.print("\n" + "═" * 58)
195
+ console.print(" [bold]📋 Post-Migration Checklist:[/]")
196
+ console.print("═" * 58)
197
+ console.print(" □ Set MEETSTREAM_API_KEY environment variable")
198
+ console.print(" □ Update .env file with MeetStream credentials")
199
+ console.print(" □ Review all ⚠️ warnings above")
200
+ console.print(" □ Update webhook handler to use numeric status_code")
201
+ console.print(" □ Store transcript_id from create_bot response")
202
+ console.print(" □ Test each endpoint with the test suite:")
203
+ console.print(" meetstream-migrate test --api-key YOUR_KEY")
204
+ console.print(" □ Verify recording_mode → video_required logic")
205
+ console.print(" □ Check bot_message handling (separate POST in Recall)")
206
+ console.print("═" * 58 + "\n")
207
+
208
+
209
+ def show_scan_footer(target_path):
210
+ console.print()
211
+ console.print(" [bold white on blue] ℹ This was a read-only scan — no files were modified. [/]")
212
+ console.print()
213
+ console.print(" [white]Next steps:[/]")
214
+ console.print(" [dim]1. Preview changes (no writes):[/]")
215
+ console.print(f" [cyan] meetstream-migrate migrate {target_path} --dry-run[/]")
216
+ console.print(" [dim]2. Run the full migration:[/]")
217
+ console.print(f" [cyan] meetstream-migrate migrate {target_path} --yes[/]")
218
+ console.print(" [dim]3. Test APIs after migration:[/]")
219
+ console.print(" [cyan] meetstream-migrate test --api-key YOUR_MEETSTREAM_API_KEY[/]")
220
+ console.print()
221
+
222
+
223
+ def cmd_scan(path):
224
+ show_logo()
225
+ console.print(f"\n Scanning {path}...\n")
226
+ results = scan_project(path)
227
+
228
+ if results["summary"]["files_with_findings"] == 0:
229
+ console.print(" No Recall.ai API calls found in this project.\n")
230
+ return
231
+
232
+ show_scan_summary(results)
233
+ show_endpoint_table(results)
234
+ show_field_table(results)
235
+ if results["summary"]["total_webhook_handlers"] > 0:
236
+ show_webhook_table()
237
+ show_compatibility(results)
238
+ show_scan_footer(path)
239
+
240
+
241
+ def cmd_migrate(path, yes=False, dry_run=False):
242
+ show_logo()
243
+ console.print(f"\n Scanning {path}...\n")
244
+ scan_results = scan_project(path)
245
+
246
+ if scan_results["summary"]["files_with_findings"] == 0:
247
+ console.print(" No Recall.ai API calls found.\n")
248
+ return
249
+
250
+ show_scan_summary(scan_results)
251
+ show_endpoint_table(scan_results)
252
+ show_field_table(scan_results)
253
+ if scan_results["summary"]["total_webhook_handlers"] > 0:
254
+ show_webhook_table()
255
+ show_compatibility(scan_results)
256
+
257
+ if not yes:
258
+ response = input("\n Proceed with migration? [y/N] ").strip().lower()
259
+ if response not in ("y", "yes"):
260
+ console.print("\n Migration cancelled.\n")
261
+ return
262
+
263
+ console.print("\n Applying transformations...\n")
264
+ transform_results = transform_project(scan_results, dry_run=dry_run)
265
+ show_transform_results(transform_results)
266
+ show_checklist()
267
+
268
+
269
+ def cmd_test(api_key, base_url="https://api.meetstream.ai"):
270
+ """Run API tests against MeetStream."""
271
+ import requests
272
+
273
+ console.print("\n[bold cyan]🧪 MeetStream API Test Suite[/]\n")
274
+ console.print(f" Base URL: {base_url}")
275
+ console.print(f" API Key: {api_key[:8]}..." if api_key else " API Key: NOT SET")
276
+
277
+ headers = {"Authorization": f"Token {api_key}", "Content-Type": "application/json"}
278
+ passed = failed = skipped = 0
279
+
280
+ tests = [
281
+ ("GET /api/v1/bots — List bots", "GET", "/api/v1/bots", None),
282
+ ("GET /api/v1/calendar — List calendars", "GET", "/api/v1/calendar", None),
283
+ ]
284
+
285
+ for name, method, path, body in tests:
286
+ try:
287
+ url = f"{base_url}{path}"
288
+ resp = requests.request(method, url, headers=headers, json=body, timeout=15)
289
+ if resp.status_code in (200, 201, 404, 400):
290
+ console.print(f" [green]✓ PASS[/] {name}")
291
+ passed += 1
292
+ elif resp.status_code == 401:
293
+ console.print(f" [red]✗ FAIL[/] {name} — Auth failed")
294
+ failed += 1
295
+ else:
296
+ console.print(f" [red]✗ FAIL[/] {name} — Status {resp.status_code}")
297
+ failed += 1
298
+ except Exception as e:
299
+ console.print(f" [red]✗ FAIL[/] {name} — {e}")
300
+ failed += 1
301
+
302
+ console.print(f"\n Results: [green]{passed} passed[/], [red]{failed} failed[/], [yellow]{skipped} skipped[/]\n")
303
+
304
+
305
+ def main():
306
+ parser = argparse.ArgumentParser(description="MeetStream Migration SDK")
307
+ parser.add_argument("command", nargs="?", default="migrate", choices=["migrate", "scan", "test"])
308
+ parser.add_argument("path", nargs="?", default=".")
309
+ parser.add_argument("--yes", "-y", action="store_true")
310
+ parser.add_argument("--dry-run", action="store_true")
311
+ parser.add_argument("--api-key", default=os.environ.get("MEETSTREAM_API_KEY", ""))
312
+ parser.add_argument("--base-url", default="https://api.meetstream.ai")
313
+
314
+ args = parser.parse_args()
315
+ path = os.path.abspath(args.path)
316
+
317
+ if args.command == "scan":
318
+ cmd_scan(path)
319
+ elif args.command == "test":
320
+ if not args.api_key:
321
+ console.print("[red]Error: --api-key required or set MEETSTREAM_API_KEY[/]")
322
+ sys.exit(1)
323
+ cmd_test(args.api_key, args.base_url)
324
+ else:
325
+ cmd_migrate(path, yes=args.yes, dry_run=args.dry_run)
326
+
327
+
328
+ if __name__ == "__main__":
329
+ main()
@@ -0,0 +1,190 @@
1
+ """
2
+ Core API & Field Mappings — Recall.ai → MeetStream.ai
3
+ """
4
+ import re
5
+
6
+ # ═══════════════════════════════════════════════════════════════════════
7
+ # ENDPOINT MAPPINGS
8
+ # ═══════════════════════════════════════════════════════════════════════
9
+
10
+ ENDPOINT_MAP = [
11
+ # Most specific first
12
+ {"recall_method": "POST", "recall_path": "/api/v1/bot/{id}/leave_call/", "pattern": r"/bot/[^/]*/leave_call", "ms_method": "GET", "ms_path": "/api/v1/bots/{bot_id}/remove_bot", "category": "Bot Lifecycle", "name": "Remove Bot (Leave Call)", "notes": "Method change: Recall POST → MeetStream GET.", "priority": 100},
13
+ {"recall_method": "GET", "recall_path": "/api/v1/bot/{id}/audio/", "pattern": r"/bot/[^/]*/audio", "ms_method": "GET", "ms_path": "/api/v1/bots/{bot_id}/get_audio", "category": "Media", "name": "Get Audio Recording", "notes": "Recall needs recording_id from webhook.", "priority": 90},
14
+ {"recall_method": "GET", "recall_path": "/api/v1/bot/{id}/video/", "pattern": r"/bot/[^/]*/video", "ms_method": "GET", "ms_path": "/api/v1/bots/{bot_id}/get_video", "category": "Media", "name": "Get Video Recording", "priority": 90},
15
+ {"recall_method": "GET", "recall_path": "/api/v1/bot/{id}/screenshots/", "pattern": r"/bot/[^/]*/screenshots", "ms_method": "GET", "ms_path": "/api/v1/bots/{bot_id}/get_screenshots", "category": "Media", "name": "Get Screenshots", "priority": 90},
16
+ {"recall_method": "GET", "recall_path": "/api/v1/bot/{id}/speaker_timeline/", "pattern": r"/bot/[^/]*/speaker_timeline", "ms_method": "GET", "ms_path": "/api/v1/bots/{bot_id}/get_speaker_timeline", "category": "Media", "name": "Get Speaker Timeline", "priority": 90},
17
+ {"recall_method": "GET", "recall_path": "/api/v1/bot/{id}/transcript/", "pattern": r"/bot/[^/]*/transcript", "ms_method": "GET", "ms_path": "/api/v1/transcript/{transcript_id}/get_transcript", "category": "Transcription", "name": "Get Transcript", "notes": "CRITICAL: Recall uses bot_id. MeetStream uses transcript_id.", "priority": 90},
18
+ {"recall_method": "GET", "recall_path": "/api/v1/bot/{id}/participants/", "pattern": r"/bot/[^/]*/participants", "ms_method": "GET", "ms_path": "/api/v1/bots/{bot_id}/get_participants", "category": "Participants", "name": "Get Participants", "priority": 90},
19
+ {"recall_method": "GET", "recall_path": "/api/v1/bot/{id}/chat_messages/", "pattern": r"/bot/[^/]*/chat_messages", "ms_method": "GET", "ms_path": "/api/v1/bots/{bot_id}/get_chats", "category": "Chat", "name": "Get Chat Messages", "priority": 90},
20
+ {"recall_method": "POST", "recall_path": "/api/v1/bot/{id}/send_chat_message/", "pattern": r"/bot/[^/]*/send_chat_message", "ms_method": "POST", "ms_path": "/api/v1/bots/create_bot (bot_message)", "category": "Chat", "name": "Send Chat Message", "notes": "MeetStream uses bot_message field on create_bot.", "priority": 90},
21
+ {"recall_method": "POST", "recall_path": "/api/v1/calendar/events/{id}/bot/", "pattern": r"/calendar/events/[^/]*/bot", "ms_method": "POST", "ms_path": "/api/v1/calendar/schedule/{event_id}", "category": "Calendar", "name": "Schedule Bot for Event", "priority": 80},
22
+ {"recall_method": "GET", "recall_path": "/api/v1/calendar/events/", "pattern": r"/calendar/events", "ms_method": "GET", "ms_path": "/api/v1/calendar/events", "category": "Calendar", "name": "Fetch/Sync Events", "priority": 70},
23
+ {"recall_method": "POST", "recall_path": "/api/v1/webhook/", "pattern": r"/api/v1/webhook", "ms_method": "N/A", "ms_path": "callback_url on create_bot", "category": "Webhooks", "name": "Register Webhook", "notes": "MeetStream uses per-bot callback_url.", "skipped": True, "priority": 50},
24
+ {"recall_method": "POST", "recall_path": "/api/v1/bot/", "pattern": r"\.post\([^)]*['\"/]bot/['\"]|requests\.post\([^)]*bot/", "ms_method": "POST", "ms_path": "/api/v1/bots/create_bot", "category": "Bot Lifecycle", "name": "Create Bot", "notes": "Core endpoint. Field names differ.", "priority": 30},
25
+ {"recall_method": "GET", "recall_path": "/api/v1/bot/", "pattern": r"\.get\([^)]*['\"/]bot/['\"]|requests\.get\([^)]*bot/", "ms_method": "GET", "ms_path": "/api/v1/bots", "category": "Bot Lifecycle", "name": "List Bots", "priority": 20},
26
+ {"recall_method": "DELETE", "recall_path": "/api/v1/bot/{id}/", "pattern": r"\.delete\([^)]*bot/|requests\.delete\([^)]*bot/", "ms_method": "DELETE", "ms_path": "/api/v1/bots/{bot_id}/delete", "category": "Bot Lifecycle", "name": "Delete Bot Data", "priority": 20},
27
+ ]
28
+
29
+ # ═══════════════════════════════════════════════════════════════════════
30
+ # FIELD MAPPINGS
31
+ # ═══════════════════════════════════════════════════════════════════════
32
+
33
+ FIELD_PATTERNS = [
34
+ {"pattern": r"meeting_url", "recall": "meeting_url", "meetstream": "meeting_link", "type": "field"},
35
+ {"pattern": r"recording_mode", "recall": "recording_mode", "meetstream": "video_required", "type": "field"},
36
+ {"pattern": r"transcription_options", "recall": "transcription_options", "meetstream": "recording_config.transcript", "type": "field"},
37
+ {"pattern": r"destination_url", "recall": "real_time_transcription.destination_url", "meetstream": "live_transcription_required.webhook_url", "type": "field"},
38
+ {"pattern": r"output_media", "recall": "output_media", "meetstream": "socket_connection_url / live_audio_required", "type": "field"},
39
+ {"pattern": r"['\"]metadata['\"]", "recall": "metadata", "meetstream": "custom_attributes", "type": "field"},
40
+ {"pattern": r"noone_joined_timeout", "recall": "noone_joined_timeout", "meetstream": "voice_inactivity_timeout", "type": "field"},
41
+ {"pattern": r"assembly_ai", "recall": "assembly_ai", "meetstream": "assemblyai", "type": "field"},
42
+ {"pattern": r"leave_call", "recall": "POST /leave_call/", "meetstream": "GET /remove_bot", "type": "endpoint"},
43
+ {"pattern": r"send_chat_message", "recall": "POST /send_chat_message/", "meetstream": "bot_message field on create_bot", "type": "endpoint"},
44
+ {"pattern": r"chat_messages", "recall": "GET /chat_messages/", "meetstream": "GET /get_chats", "type": "endpoint"},
45
+ {"pattern": r"speaker_timeline", "recall": "GET /speaker_timeline/", "meetstream": "GET /get_speaker_timeline", "type": "endpoint"},
46
+ ]
47
+
48
+ # ═══════════════════════════════════════════════════════════════════════
49
+ # WEBHOOK EVENT MAPPINGS
50
+ # ═══════════════════════════════════════════════════════════════════════
51
+
52
+ # MeetStream webhook payload format:
53
+ # {
54
+ # "event": "bot.joining", ← event type
55
+ # "bot_id": "uuid",
56
+ # "bot_status": "Joining", ← status detail
57
+ # "message": "human readable",
58
+ # "status_code": 200, ← always 200
59
+ # "timestamp": "ISO-8601",
60
+ # "custom_attributes": {}
61
+ # }
62
+
63
+ # Bot Lifecycle Events
64
+ WEBHOOK_LIFECYCLE_EVENTS = [
65
+ {"recall": "bot.joining_call", "ms_event": "bot.joining", "ms_status": "Joining", "desc": "Bot connecting to meeting"},
66
+ {"recall": "bot.in_waiting_room", "ms_event": "bot.joining", "ms_status": "Joining", "desc": "Bot in waiting room"},
67
+ {"recall": "bot.in_call_not_recording", "ms_event": "bot.inmeeting", "ms_status": "InMeeting", "desc": "Joined, not yet recording"},
68
+ {"recall": "bot.recording_permission_allowed", "ms_event": "bot.inmeeting", "ms_status": "InMeeting", "desc": "Recording allowed"},
69
+ {"recall": "bot.recording_permission_denied", "ms_event": "bot.stopped", "ms_status": "Denied", "desc": "Recording denied by host"},
70
+ {"recall": "bot.in_call_recording", "ms_event": "bot.inmeeting", "ms_status": "InMeeting", "desc": "In-call, recording"},
71
+ {"recall": "bot.call_ended", "ms_event": "bot.stopped", "ms_status": "Stopped", "desc": "Meeting ended / bot left"},
72
+ {"recall": "bot.call_ended (lobby_timeout)", "ms_event": "bot.stopped", "ms_status": "NotAllowed", "desc": "Bot could not join (lobby timeout)"},
73
+ {"recall": "bot.done", "ms_event": "bot.stopped", "ms_status": "Stopped", "desc": "Bot lifecycle ended"},
74
+ {"recall": "bot.fatal", "ms_event": "bot.stopped", "ms_status": "Error", "desc": "Unexpected error"},
75
+ ]
76
+
77
+ # Post-Call Processing Events (MeetStream-only — Recall uses bot.done then fetch)
78
+ WEBHOOK_POSTCALL_EVENTS = [
79
+ {"recall": "bot.done (then fetch)", "ms_event": "audio.processed", "desc": "Audio ready to fetch"},
80
+ {"recall": "bot.done (then fetch)", "ms_event": "transcription.processed", "desc": "Transcript ready to fetch"},
81
+ {"recall": "bot.done (then fetch)", "ms_event": "video.processed", "desc": "Video ready to fetch"},
82
+ {"recall": "(no equivalent)", "ms_event": "data_deletion", "desc": "Bot data deleted"},
83
+ ]
84
+
85
+ # Real-time Events
86
+ WEBHOOK_REALTIME_EVENTS = [
87
+ {"recall": "transcript.data", "ms_event": "live_transcription_required webhook", "desc": "Transcript utterance"},
88
+ {"recall": "transcript.partial_data", "ms_event": "live_transcription_required webhook", "desc": "Partial transcript"},
89
+ {"recall": "transcript.done", "ms_event": "transcription.processed", "desc": "Full transcript ready"},
90
+ {"recall": "participant_events.join", "ms_event": "realtime endpoint", "desc": "Participant joined"},
91
+ {"recall": "participant_events.leave", "ms_event": "realtime endpoint", "desc": "Participant left"},
92
+ ]
93
+
94
+ # Combined for backward compat (used by CLI display)
95
+ WEBHOOK_EVENTS = WEBHOOK_LIFECYCLE_EVENTS
96
+
97
+ # ═══════════════════════════════════════════════════════════════════════
98
+ # TRANSFORMATIONS
99
+ # ═══════════════════════════════════════════════════════════════════════
100
+
101
+ TRANSFORMATIONS = [
102
+ # Base URLs
103
+ {"name": "Base URL: us-east-1.recall.ai", "find": r"https?://us-east-1\.recall\.ai", "replace": "https://api.meetstream.ai", "category": "base_url"},
104
+ {"name": "Base URL: eu-west-1.recall.ai", "find": r"https?://eu-west-1\.recall\.ai", "replace": "https://api.meetstream.ai", "category": "base_url"},
105
+ {"name": "Base URL: api.recall.ai", "find": r"https?://api\.recall\.ai", "replace": "https://api.meetstream.ai", "category": "base_url"},
106
+
107
+ # Endpoint paths (most specific first)
108
+ {"name": "Endpoint: leave_call → remove_bot", "find": r"/api/v1/bot/([^/'\"}\s]+)/leave_call/?", "replace": r"/api/v1/bots/\1/remove_bot", "category": "endpoint", "warning": "Method changed: POST → GET"},
109
+ {"name": "Endpoint: send_chat_message", "find": r"/api/v1/bot/([^/'\"}\s]+)/send_chat_message/?", "replace": r"/api/v1/bots/\1/send_chat_message", "category": "endpoint", "warning": "MANUAL: MeetStream uses bot_message on create_bot"},
110
+ {"name": "Endpoint: audio", "find": r"/api/v1/bot/([^/'\"}\s]+)/audio/?", "replace": r"/api/v1/bots/\1/get_audio", "category": "endpoint"},
111
+ {"name": "Endpoint: video", "find": r"/api/v1/bot/([^/'\"}\s]+)/video/?", "replace": r"/api/v1/bots/\1/get_video", "category": "endpoint"},
112
+ {"name": "Endpoint: screenshots", "find": r"/api/v1/bot/([^/'\"}\s]+)/screenshots/?", "replace": r"/api/v1/bots/\1/get_screenshots", "category": "endpoint"},
113
+ {"name": "Endpoint: speaker_timeline", "find": r"/api/v1/bot/([^/'\"}\s]+)/speaker_timeline/?", "replace": r"/api/v1/bots/\1/get_speaker_timeline", "category": "endpoint"},
114
+ {"name": "Endpoint: transcript", "find": r"/api/v1/bot/([^/'\"}\s]+)/transcript/?", "replace": r"/api/v1/transcript/\1/get_transcript", "category": "endpoint", "warning": "CRITICAL: Recall uses bot_id. MeetStream uses transcript_id."},
115
+ {"name": "Endpoint: participants", "find": r"/api/v1/bot/([^/'\"}\s]+)/participants/?", "replace": r"/api/v1/bots/\1/get_participants", "category": "endpoint"},
116
+ {"name": "Endpoint: chat_messages", "find": r"/api/v1/bot/([^/'\"}\s]+)/chat_messages/?", "replace": r"/api/v1/bots/\1/get_chats", "category": "endpoint"},
117
+ {"name": "Endpoint: calendar events bot", "find": r"/api/v1/calendar/events/([^/'\"}\s]+)/bot/?", "replace": r"/api/v1/calendar/schedule/\1", "category": "endpoint"},
118
+
119
+ # Fields
120
+ {"name": "Field: meeting_url → meeting_link", "find": r"(['\"])meeting_url(['\"])", "replace": r"\1meeting_link\2", "category": "field"},
121
+ {"name": "Field: meeting_url (dot)", "find": r"\.meeting_url\b", "replace": ".meeting_link", "category": "field"},
122
+ {"name": "Field: metadata → custom_attributes", "find": r"(['\"])metadata(['\"])\s*:", "replace": r"\1custom_attributes\2:", "category": "field", "warning": "Only rename in Recall bot context."},
123
+ {"name": "Field: recording_mode → video_required", "find": r"(['\"])recording_mode(['\"])\s*:", "replace": r"\1video_required\2:", "category": "field", "warning": "Value transform needed: speaker_view/gallery_view → True, audio_only → False."},
124
+ {"name": "Field: transcription_options → recording_config", "find": r"(['\"])transcription_options(['\"])", "replace": r"\1recording_config\2", "category": "field", "warning": "MANUAL: Object structure differs."},
125
+ {"name": "Field: assembly_ai → assemblyai", "find": r"(['\"])assembly_ai(['\"])", "replace": r"\1assemblyai\2", "category": "field"},
126
+ {"name": "Field: noone_joined_timeout", "find": r"noone_joined_timeout", "replace": "voice_inactivity_timeout", "category": "field"},
127
+ {"name": "Field: destination_url → webhook_url", "find": r"(['\"])destination_url(['\"])", "replace": r"\1webhook_url\2", "category": "field"},
128
+
129
+ # Webhooks — CRITICAL: MeetStream uses a TWO-LAYER event model
130
+ # Layer 1: event → "bot.joining" | "bot.inmeeting" | "bot.stopped"
131
+ # Layer 2: bot_status → "Joining" | "InMeeting" | "Stopped" | "NotAllowed" | "Denied" | "Error"
132
+ # Recall uses a FLAT model (one event name per status). Migration requires rewriting switch/case logic.
133
+ # For bot.stopped especially, bot_status tells you WHY: Stopped (normal), NotAllowed (lobby timeout), Denied (host denied), Error (unexpected).
134
+ {"name": "Webhook: bot.status_change → event-based", "find": r"(['\"])bot\.status_change(['\"])", "replace": r"\1bot.joining\2", "category": "webhook", "warning": "CRITICAL: MeetStream uses TWO-LAYER event model. Check event (bot.joining/bot.inmeeting/bot.stopped) THEN check bot_status (Joining/InMeeting/Stopped/NotAllowed/Denied/Error). Rewrite your switch/case to handle both layers."},
135
+ {"name": "Webhook: joining_call → bot.joining", "find": r"(['\"])joining_call(['\"])", "replace": r"\1bot.joining\2", "category": "webhook", "warning": "MeetStream: event=\"bot.joining\", bot_status=\"Joining\". No sub-status needed for this event."},
136
+ {"name": "Webhook: in_call_recording → bot.inmeeting", "find": r"(['\"])in_call_recording(['\"])", "replace": r"\1bot.inmeeting\2", "category": "webhook", "warning": "MeetStream: event=\"bot.inmeeting\", bot_status=\"InMeeting\". No sub-status needed for this event."},
137
+ {"name": "Webhook: call_ended → bot.stopped", "find": r"(['\"])call_ended(['\"])", "replace": r"\1bot.stopped\2", "category": "webhook", "warning": "CRITICAL: MeetStream event=\"bot.stopped\" — you MUST also check bot_status to know WHY: \"Stopped\" (normal), \"NotAllowed\" (lobby timeout), \"Denied\" (host denied), \"Error\" (unexpected)."},
138
+ {"name": "Webhook: done → bot.stopped", "find": r"(['\"])done(['\"])", "replace": r"\1bot.stopped\2", "category": "webhook", "warning": "MeetStream event=\"bot.stopped\", bot_status=\"Stopped\". Also: post-call artifacts now arrive as separate events (audio.processed, transcription.processed, video.processed) — add handlers for those."},
139
+ {"name": "Webhook: fatal → bot.stopped", "find": r"(['\"])fatal(['\"])", "replace": r"\1bot.stopped\2", "category": "webhook", "warning": "MeetStream event=\"bot.stopped\", bot_status=\"Error\". Check bot_status to distinguish from normal stops."},
140
+
141
+ # Config / Env
142
+ {"name": "Env: RECALL_API_KEY → MEETSTREAM_API_KEY", "find": r"RECALL_API_KEY", "replace": "MEETSTREAM_API_KEY", "category": "config"},
143
+ {"name": "Env: RECALL_API_URL → MEETSTREAM_API_URL", "find": r"RECALL_API_URL", "replace": "MEETSTREAM_API_URL", "category": "config"},
144
+ {"name": "Env: RECALL_WEBHOOK_SECRET → MEETSTREAM_WEBHOOK_SECRET", "find": r"RECALL_WEBHOOK_SECRET", "replace": "MEETSTREAM_WEBHOOK_SECRET", "category": "config"},
145
+
146
+ # Imports
147
+ {"name": "Import: import recall → import meetstream", "find": r"import recall\b", "replace": "import meetstream", "category": "import"},
148
+ {"name": "Import: from recall import", "find": r"from recall import", "replace": "from meetstream import", "category": "import"},
149
+ ]
150
+
151
+ # Patterns for scanning
152
+ RECALL_URL_PATTERNS = [
153
+ r"recall\.ai/api/v1",
154
+ r"us-east-1\.recall\.ai",
155
+ r"eu-west-1\.recall\.ai",
156
+ r"api\.recall\.ai",
157
+ ]
158
+
159
+ RECALL_SDK_PATTERNS = [
160
+ r"recall[-_]?ai",
161
+ r"from\s+['\"]recall",
162
+ r"import\s+recall",
163
+ r"RecallAI",
164
+ r"RECALL_API",
165
+ r"recall\.ai",
166
+ ]
167
+
168
+ WEBHOOK_PATTERNS = [
169
+ r"bot\.status_change",
170
+ r"bot\.joining_call|bot\.in_waiting_room|bot\.in_call_not_recording",
171
+ r"bot\.recording_permission_allowed|bot\.recording_permission_denied",
172
+ r"bot\.in_call_recording|bot\.call_ended|bot\.done|bot\.fatal",
173
+ r"joining_call|in_call_recording|call_ended|done|fatal",
174
+ r"bot\.participant_join|bot\.participant_leave",
175
+ r"bot\.transcription|transcript\.data|transcript\.partial_data|transcript\.done",
176
+ r"participant_events\.join|participant_events\.leave|participant_events\.speech_on",
177
+ ]
178
+
179
+ # File extensions to scan
180
+ SCANNABLE_EXTENSIONS = {
181
+ '.py', '.pyw', '.js', '.ts', '.jsx', '.tsx', '.mjs', '.cjs',
182
+ '.go', '.rb', '.java', '.kt', '.rs', '.php', '.cs', '.swift',
183
+ '.env', '.yaml', '.yml', '.json', '.toml', '.ini', '.cfg',
184
+ }
185
+
186
+ SKIP_DIRS = {
187
+ 'node_modules', '.git', '.next', 'dist', 'build', '__pycache__',
188
+ '.venv', 'venv', 'env', '.tox', '.mypy_cache', '.pytest_cache',
189
+ 'vendor', 'target', '.gradle', 'coverage',
190
+ }
@@ -0,0 +1,164 @@
1
+ """Scanner — Finds all Recall.ai API calls in a codebase"""
2
+ import os
3
+ import re
4
+ from .mappings import (
5
+ ENDPOINT_MAP, FIELD_PATTERNS, RECALL_URL_PATTERNS,
6
+ RECALL_SDK_PATTERNS, WEBHOOK_PATTERNS,
7
+ SCANNABLE_EXTENSIONS, SKIP_DIRS,
8
+ )
9
+
10
+
11
+ def collect_files(directory):
12
+ """Recursively collect scannable files."""
13
+ files = []
14
+ for root, dirs, filenames in os.walk(directory):
15
+ dirs[:] = [d for d in dirs if d not in SKIP_DIRS and not d.startswith('.')]
16
+ for f in filenames:
17
+ ext = os.path.splitext(f)[1].lower()
18
+ if ext in SCANNABLE_EXTENSIONS:
19
+ files.append(os.path.join(root, f))
20
+ return files
21
+
22
+
23
+ def identify_endpoints(line):
24
+ """Match a line against known Recall.ai endpoint patterns."""
25
+ results = []
26
+ for ep in ENDPOINT_MAP:
27
+ if re.search(ep["pattern"], line, re.IGNORECASE):
28
+ results.append({
29
+ "recall": f"{ep['recall_method']} {ep['recall_path']}",
30
+ "meetstream": f"{ep['ms_method']} {ep['ms_path']}",
31
+ "category": ep["category"],
32
+ "name": ep["name"],
33
+ "notes": ep.get("notes", ""),
34
+ "skipped": ep.get("skipped", False),
35
+ "priority": ep.get("priority", 0),
36
+ })
37
+ # Return highest priority matches only
38
+ if results:
39
+ max_prio = max(r["priority"] for r in results)
40
+ results = [r for r in results if r["priority"] >= max_prio - 10]
41
+ return results
42
+
43
+
44
+ def scan_file(filepath, root_dir):
45
+ """Scan a single file for Recall.ai usage."""
46
+ try:
47
+ with open(filepath, "r", encoding="utf-8", errors="ignore") as f:
48
+ content = f.read()
49
+ except Exception:
50
+ return None
51
+
52
+ rel_path = os.path.relpath(filepath, root_dir)
53
+ lines = content.split("\n")
54
+ findings = {
55
+ "file": rel_path,
56
+ "api_calls": [],
57
+ "field_usages": [],
58
+ "sdk_imports": [],
59
+ "base_urls": [],
60
+ "webhook_handlers": [],
61
+ }
62
+ has_findings = False
63
+
64
+ for i, line in enumerate(lines):
65
+ line_num = i + 1
66
+
67
+ # Base URLs
68
+ for pat in RECALL_URL_PATTERNS:
69
+ if re.search(pat, line, re.IGNORECASE):
70
+ findings["base_urls"].append({"line": line_num, "text": line.strip()})
71
+ has_findings = True
72
+ break
73
+
74
+ # SDK imports
75
+ for pat in RECALL_SDK_PATTERNS:
76
+ if re.search(pat, line, re.IGNORECASE):
77
+ findings["sdk_imports"].append({"line": line_num, "text": line.strip()})
78
+ has_findings = True
79
+ break
80
+
81
+ # Endpoints
82
+ endpoints = identify_endpoints(line)
83
+ for ep in endpoints:
84
+ findings["api_calls"].append({"line": line_num, "text": line.strip(), **ep})
85
+ has_findings = True
86
+
87
+ # Fields
88
+ for fp in FIELD_PATTERNS:
89
+ if re.search(fp["pattern"], line):
90
+ findings["field_usages"].append({
91
+ "line": line_num,
92
+ "recall": fp["recall"],
93
+ "meetstream": fp["meetstream"],
94
+ "type": fp["type"],
95
+ })
96
+ has_findings = True
97
+
98
+ # Webhooks
99
+ for pat in WEBHOOK_PATTERNS:
100
+ if re.search(pat, line):
101
+ findings["webhook_handlers"].append({"line": line_num, "text": line.strip()})
102
+ has_findings = True
103
+ break
104
+
105
+ return findings if has_findings else None
106
+
107
+
108
+ def scan_project(project_dir):
109
+ """Scan entire project for Recall.ai API usage."""
110
+ files = collect_files(project_dir)
111
+ results = {
112
+ "project_dir": project_dir,
113
+ "total_files": len(files),
114
+ "findings": [],
115
+ "summary": {
116
+ "total_api_calls": 0,
117
+ "total_field_usages": 0,
118
+ "total_sdk_imports": 0,
119
+ "total_base_urls": 0,
120
+ "total_webhook_handlers": 0,
121
+ "files_with_findings": 0,
122
+ "endpoint_breakdown": {},
123
+ "field_changes": [],
124
+ },
125
+ }
126
+
127
+ for filepath in files:
128
+ finding = scan_file(filepath, project_dir)
129
+ if finding:
130
+ results["findings"].append(finding)
131
+ s = results["summary"]
132
+ s["files_with_findings"] += 1
133
+ s["total_api_calls"] += len(finding["api_calls"])
134
+ s["total_field_usages"] += len(finding["field_usages"])
135
+ s["total_sdk_imports"] += len(finding["sdk_imports"])
136
+ s["total_base_urls"] += len(finding["base_urls"])
137
+ s["total_webhook_handlers"] += len(finding["webhook_handlers"])
138
+
139
+ for call in finding["api_calls"]:
140
+ name = call["name"]
141
+ if name not in s["endpoint_breakdown"]:
142
+ s["endpoint_breakdown"][name] = {
143
+ "recall": call["recall"],
144
+ "meetstream": call["meetstream"],
145
+ "category": call["category"],
146
+ "count": 0,
147
+ "files": [],
148
+ "skipped": call.get("skipped", False),
149
+ "notes": call.get("notes", ""),
150
+ }
151
+ s["endpoint_breakdown"][name]["count"] += 1
152
+ if finding["file"] not in s["endpoint_breakdown"][name]["files"]:
153
+ s["endpoint_breakdown"][name]["files"].append(finding["file"])
154
+
155
+ for fu in finding["field_usages"]:
156
+ exists = any(fc["recall"] == fu["recall"] for fc in s["field_changes"])
157
+ if not exists:
158
+ s["field_changes"].append({
159
+ "recall": fu["recall"],
160
+ "meetstream": fu["meetstream"],
161
+ "type": fu["type"],
162
+ })
163
+
164
+ return results
@@ -0,0 +1,76 @@
1
+ """Transformer — Applies Recall→MeetStream code transformations"""
2
+ import os
3
+ import re
4
+ from .mappings import TRANSFORMATIONS
5
+
6
+
7
+ def transform_file(filepath, dry_run=True):
8
+ """Apply all transformations to a single file."""
9
+ try:
10
+ with open(filepath, "r", encoding="utf-8") as f:
11
+ content = f.read()
12
+ except Exception as e:
13
+ return {"error": str(e)}
14
+
15
+ original = content
16
+ transformed = content
17
+ changes = []
18
+
19
+ for rule in TRANSFORMATIONS:
20
+ matches = re.findall(rule["find"], transformed)
21
+ if matches:
22
+ transformed = re.sub(rule["find"], rule["replace"], transformed)
23
+ changes.append({
24
+ "rule": rule["name"],
25
+ "category": rule["category"],
26
+ "count": len(matches),
27
+ "warning": rule.get("warning"),
28
+ })
29
+
30
+ has_changes = original != transformed
31
+ if has_changes and not dry_run:
32
+ with open(filepath, "w", encoding="utf-8") as f:
33
+ f.write(transformed)
34
+
35
+ return {
36
+ "filepath": filepath,
37
+ "has_changes": has_changes,
38
+ "changes": changes,
39
+ }
40
+
41
+
42
+ def transform_project(scan_results, dry_run=True):
43
+ """Apply transformations to all files found in scan."""
44
+ results = {
45
+ "files_changed": 0,
46
+ "total_changes": 0,
47
+ "file_results": [],
48
+ "warnings": [],
49
+ "skipped": [],
50
+ }
51
+
52
+ for finding in scan_results["findings"]:
53
+ full_path = os.path.join(scan_results["project_dir"], finding["file"])
54
+ result = transform_file(full_path, dry_run=dry_run)
55
+
56
+ if "error" in result:
57
+ results["skipped"].append({"file": finding["file"], "reason": result["error"]})
58
+ continue
59
+
60
+ if result["has_changes"]:
61
+ results["files_changed"] += 1
62
+ results["total_changes"] += len(result["changes"])
63
+ results["file_results"].append({
64
+ "file": finding["file"],
65
+ "changes": result["changes"],
66
+ })
67
+
68
+ for change in result["changes"]:
69
+ if change.get("warning"):
70
+ results["warnings"].append({
71
+ "file": finding["file"],
72
+ "rule": change["rule"],
73
+ "warning": change["warning"],
74
+ })
75
+
76
+ return results
@@ -0,0 +1,250 @@
1
+ Metadata-Version: 2.4
2
+ Name: meetstream-migrate
3
+ Version: 1.0.0
4
+ Summary: One-command migration from Recall.ai to MeetStream.ai — scans your codebase, maps APIs, transforms code.
5
+ Home-page: https://github.com/meetstream/recall-meetstream-migration-kit
6
+ Author: MeetStream
7
+ Author-email: sid@meetstream.ai
8
+ License: MIT
9
+ Keywords: meetstream,recall,migration,meeting-bot,api
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Requires-Python: >=3.8
21
+ Description-Content-Type: text/markdown
22
+ Requires-Dist: rich>=13.0.0
23
+ Requires-Dist: requests>=2.28.0
24
+ Dynamic: author
25
+ Dynamic: author-email
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: home-page
30
+ Dynamic: keywords
31
+ Dynamic: license
32
+ Dynamic: requires-dist
33
+ Dynamic: requires-python
34
+ Dynamic: summary
35
+
36
+ # meetstream-migrate
37
+
38
+ One-command migration from [Recall.ai](https://recall.ai) to [MeetStream.ai](https://meetstream.ai). Scans your codebase, maps every API call, shows the diff, and migrates.
39
+
40
+ ## Why migrate?
41
+
42
+ - **~40% cheaper** — significantly lower per-hour bot and transcription costs
43
+ - **Agent-first architecture** — built for AI agents joining meetings, not just recording
44
+ - **Context layers** — real-time info fetching during calls
45
+ - **Migration CLI** — scan, preview, migrate, test in minutes
46
+
47
+ ## Quick Start
48
+
49
+ ```bash
50
+ pip install meetstream-migrate
51
+ meetstream-migrate scan ./your-recall-project
52
+ ```
53
+
54
+ Or run without installing:
55
+
56
+ ```bash
57
+ pipx run meetstream-migrate scan ./your-recall-project
58
+ ```
59
+
60
+ ## Commands
61
+
62
+ ### Scan (read-only)
63
+
64
+ Finds every Recall.ai reference in your codebase. **No files are modified.**
65
+
66
+ ```bash
67
+ meetstream-migrate scan ./your-project
68
+ ```
69
+
70
+ ### Dry Run (preview changes)
71
+
72
+ Shows exactly what would change — still no writes.
73
+
74
+ ```bash
75
+ meetstream-migrate migrate ./your-project --dry-run
76
+ ```
77
+
78
+ ### Migrate
79
+
80
+ Applies all transformations. Prompts for confirmation before writing.
81
+
82
+ ```bash
83
+ meetstream-migrate migrate ./your-project --yes
84
+ ```
85
+
86
+ ### Test APIs
87
+
88
+ Verifies your MeetStream API key works and endpoints are reachable.
89
+
90
+ ```bash
91
+ meetstream-migrate test --api-key YOUR_MEETSTREAM_API_KEY
92
+ ```
93
+
94
+ ## What It Detects
95
+
96
+ The scanner finds:
97
+
98
+ - **Base URLs** — `us-east-1.recall.ai`, `api.recall.ai`
99
+ - **API endpoints** — all 14 Recall endpoints mapped to MeetStream equivalents
100
+ - **Field names** — `meeting_url`, `recording_mode`, `metadata`, `transcription_options`, etc.
101
+ - **Webhook handlers** — `joining_call`, `in_call_recording`, `done`, `fatal`, etc.
102
+ - **SDK imports** — `import recall`, `from recall import`
103
+ - **Environment variables** — `RECALL_API_KEY`
104
+
105
+ Supported file types: `.js`, `.ts`, `.jsx`, `.tsx`, `.py`, `.go`, `.rb`, `.java`, `.env`, `.yaml`, `.json`
106
+
107
+ ## Endpoint Mapping
108
+
109
+ | Recall.ai | MeetStream.ai | Notes |
110
+ |-----------|---------------|-------|
111
+ | `POST /api/v1/bot/` | `POST /api/v1/bots/create_bot` | Field names differ |
112
+ | `GET /api/v1/bot/{id}/` | `GET /api/v1/bots/{id}/detail` | |
113
+ | `POST /api/v1/bot/{id}/leave_call/` | `GET /api/v1/bots/{id}/remove_bot` | Method change |
114
+ | `DELETE /api/v1/bot/{id}/` | `DELETE /api/v1/bots/{id}/delete` | |
115
+ | `GET /api/v1/bot/` | `GET /api/v1/bots` | List all |
116
+ | `GET /bot/{id}/audio/` | `GET /bots/{id}/get_audio` | |
117
+ | `GET /bot/{id}/video/` | `GET /bots/{id}/get_video` | |
118
+ | `GET /bot/{id}/transcript/` | `GET /transcript/{transcript_id}/get_transcript` | Uses transcript_id |
119
+ | `GET /bot/{id}/participants/` | `GET /bots/{id}/get_participants` | |
120
+ | `GET /bot/{id}/chat_messages/` | `GET /bots/{id}/get_chats` | |
121
+ | `POST /bot/{id}/send_chat_message/` | `bot_message` field on create_bot | Manual review |
122
+ | `GET /bot/{id}/screenshots/` | `GET /bots/{id}/get_screenshots` | |
123
+ | `GET /bot/{id}/speaker_timeline/` | `GET /bots/{id}/get_speaker_timeline` | |
124
+ | `POST /api/v1/webhook/` | `callback_url` on create_bot | Per-bot webhooks |
125
+
126
+ ## Field Mapping
127
+
128
+ | Recall.ai | MeetStream.ai |
129
+ |-----------|---------------|
130
+ | `meeting_url` | `meeting_link` |
131
+ | `recording_mode` (string) | `video_required` (boolean) |
132
+ | `metadata` | `custom_attributes` |
133
+ | `transcription_options` | `recording_config.transcript` |
134
+ | `noone_joined_timeout` | `voice_inactivity_timeout` |
135
+ | `destination_url` | `webhook_url` |
136
+ | `output_media.websocket.url` | `socket_connection_url.websocket_url` |
137
+
138
+ ## Webhook Event Mapping
139
+
140
+ **IMPORTANT:** MeetStream uses a **two-layer event model**, not a flat event list like Recall. You must check `event` first, then `bot_status` for detail — especially for `bot.stopped` where `bot_status` tells you *why* the bot stopped (normal exit, denied, lobby timeout, or error).
141
+
142
+ The webhook payload format is:
143
+ ```json
144
+ { "event": "bot.inmeeting", "bot_id": "...", "bot_status": "InMeeting", "message": "...", "status_code": 200, "timestamp": "...", "custom_attributes": {} }
145
+ ```
146
+
147
+ ### Bot Lifecycle Events
148
+
149
+ | Recall.ai Event | MeetStream `event` | `bot_status` | Description |
150
+ |----------------|-------------------|-------------|-------------|
151
+ | `bot.joining_call` | `bot.joining` | `Joining` | Bot connecting to meeting |
152
+ | `bot.in_waiting_room` | `bot.joining` | `Joining` | Bot in waiting room |
153
+ | `bot.in_call_not_recording` | `bot.inmeeting` | `InMeeting` | Joined, not yet recording |
154
+ | `bot.recording_permission_allowed` | `bot.inmeeting` | `InMeeting` | Recording allowed |
155
+ | `bot.recording_permission_denied` | `bot.stopped` | `Denied` | Recording denied by host |
156
+ | `bot.in_call_recording` | `bot.inmeeting` | `InMeeting` | In-call, recording |
157
+ | `bot.call_ended` | `bot.stopped` | `Stopped` | Meeting ended / bot left |
158
+ | `bot.call_ended` (lobby_timeout) | `bot.stopped` | `NotAllowed` | Bot could not join (lobby timeout) |
159
+ | `bot.done` | `bot.stopped` | `Stopped` | Bot lifecycle ended |
160
+ | `bot.fatal` | `bot.stopped` | `Error` | Unexpected error |
161
+
162
+ ### Post-Call Processing Events (MeetStream)
163
+
164
+ | Recall.ai | MeetStream `event` | Description |
165
+ |-----------|-------------------|-------------|
166
+ | `bot.done` (then fetch) | `audio.processed` | Audio ready to fetch |
167
+ | `bot.done` (then fetch) | `transcription.processed` | Transcript ready to fetch |
168
+ | `bot.done` (then fetch) | `video.processed` | Video ready to fetch |
169
+ | (no equivalent) | `data_deletion` | Bot data deleted |
170
+
171
+ ### Real-Time Events
172
+
173
+ | Recall.ai Event | MeetStream | Description |
174
+ |----------------|-----------|-------------|
175
+ | `transcript.data` | `live_transcription_required` webhook | Transcript utterance |
176
+ | `transcript.partial_data` | `live_transcription_required` webhook | Partial transcript |
177
+ | `transcript.done` | `transcription.processed` | Full transcript ready |
178
+ | `participant_events.join` | Realtime endpoint | Participant joined |
179
+ | `participant_events.leave` | Realtime endpoint | Participant left |
180
+
181
+ ### bot_status Reference
182
+
183
+ | `bot_status` | `event` | Meaning |
184
+ |-------------|---------|---------|
185
+ | `Joining` | `bot.joining` | Bot is connecting |
186
+ | `InMeeting` | `bot.inmeeting` | Bot is in the meeting and recording |
187
+ | `Stopped` | `bot.stopped` | Bot exited normally (meeting ended, removed via API, everyone left, voice timeout, etc.) |
188
+ | `NotAllowed` | `bot.stopped` | Bot could not join (commonly waiting room / lobby timeout) |
189
+ | `Denied` | `bot.stopped` | Host explicitly denied join or recording permission |
190
+ | `Error` | `bot.stopped` | Unexpected error during lifecycle |
191
+
192
+ ## Breaking Changes to Watch
193
+
194
+ These are flagged during migration and require manual review:
195
+
196
+ 1. **Transcript retrieval** — MeetStream uses `transcript_id` (returned in create_bot response), not `bot_id`
197
+ 2. **Recording mode** — Recall uses strings (`speaker_view`, `gallery_view`, `audio_only`), MeetStream uses a boolean `video_required`
198
+ 3. **Chat messages** — Recall has a separate `POST /send_chat_message/` endpoint, MeetStream uses the `bot_message` field on `create_bot`
199
+ 4. **Webhooks** — Recall registers webhooks globally via `POST /webhook/`, MeetStream uses `callback_url` per bot on creation
200
+ 5. **Webhook events** — Recall uses granular string events (`bot.joining_call`, `bot.in_call_recording`), MeetStream uses 3 lifecycle events (`bot.joining`, `bot.inmeeting`, `bot.stopped`) with `bot_status` for detail
201
+ 6. **Post-call processing** — Recall signals readiness via `bot.done`, MeetStream sends separate `audio.processed`, `transcription.processed`, and `video.processed` webhooks
202
+ 7. **Live transcription** — Recall uses `real_time_transcription.destination_url`, MeetStream uses `live_transcription_required.webhook_url` on create_bot
203
+
204
+ ## Post-Migration Checklist
205
+
206
+ After running the migration:
207
+
208
+ 1. Set `MEETSTREAM_API_KEY` in your `.env` file (get one at [app.meetstream.ai](https://app.meetstream.ai))
209
+ 2. Review all warnings from the migration output
210
+ 3. Update webhook handlers to use `event` + `bot_status` instead of Recall event names
211
+ 4. Store `transcript_id` from create_bot responses for transcript retrieval
212
+ 5. Add handlers for `audio.processed`, `transcription.processed`, `video.processed` webhooks
213
+ 6. Verify `recording_mode` → `video_required` boolean logic
214
+ 7. Run `meetstream-migrate test --api-key YOUR_KEY` to verify
215
+
216
+ ## CLI Options
217
+
218
+ ```
219
+ meetstream-migrate [command] [path] [options]
220
+
221
+ Commands:
222
+ scan [path] Scan only — show what would change
223
+ migrate [path] Scan & migrate a project (default)
224
+ test Run API tests against MeetStream.ai
225
+
226
+ Options:
227
+ --yes, -y Skip confirmation prompt
228
+ --dry-run Show changes without writing files
229
+ --api-key KEY MeetStream API key (for test command)
230
+ ```
231
+
232
+ ## Also available as an npm package
233
+
234
+ ```bash
235
+ npx @meetstream/migrate scan ./your-project
236
+ ```
237
+
238
+ See [@meetstream/migrate on npm](https://www.npmjs.com/package/@meetstream/migrate).
239
+
240
+ ## Requirements
241
+
242
+ - Python >= 3.8
243
+
244
+ ## License
245
+
246
+ MIT
247
+
248
+ ---
249
+
250
+ **Need help migrating?** Reach out at [meetstream.ai](https://meetstream.ai) — we'll walk you through it.
@@ -0,0 +1,10 @@
1
+ meetstream_migrate/__init__.py,sha256=8TSOPvLn-lcRK44-4xvJhDE6VhTbuPFCrMcKIHZJOCE,85
2
+ meetstream_migrate/cli.py,sha256=-jQE22sasHiC2g32VeNMznuJ3se8fk_dcOk1q3irKuA,13294
3
+ meetstream_migrate/mappings.py,sha256=-w-YTy9ojXvvZa5Dx8Cch1A_N8RUZvhyXjW3LMkaL9o,18975
4
+ meetstream_migrate/scanner.py,sha256=FfD37iAk5gFQdMlC7nK6Zehy3BX7vwLfC4QU3K8QmGc,5818
5
+ meetstream_migrate/transformer.py,sha256=TTt3awBvwpcJKbD7JLt2Nj7LdSm7NWRlNS3U__wPooU,2351
6
+ meetstream_migrate-1.0.0.dist-info/METADATA,sha256=aK_i9ej2dA4disAhkSnydzKAAItCZ_IY4F2SLfDBezM,10259
7
+ meetstream_migrate-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
8
+ meetstream_migrate-1.0.0.dist-info/entry_points.txt,sha256=rYtZ6jiNVQ7dUBA3yKq4aAYeRDVMmh_mqyt3dDtfI1s,67
9
+ meetstream_migrate-1.0.0.dist-info/top_level.txt,sha256=Hj71XWBTVLU8PqdYrXDr-uR4IO8hwcLN486U6RHxJ1A,19
10
+ meetstream_migrate-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ meetstream-migrate = meetstream_migrate.cli:main
@@ -0,0 +1 @@
1
+ meetstream_migrate