recappi 0.1.75 → 0.1.76

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.
package/dist/index.js CHANGED
@@ -1252,7 +1252,7 @@ function RecordingDetailView({
1252
1252
  scrollable ? " \xB7 \u2191\u2193 scroll" : "",
1253
1253
  ready ? " \xB7 " : "",
1254
1254
  `o open \xB7 d download \xB7 f finder`,
1255
- " \xB7 T re-transcribe \xB7 s re-summarize",
1255
+ " \xB7 T re-transcribe \xB7 s re-summarize \xB7 e export",
1256
1256
  item.activeTranscriptId ? " \xB7 t full" : "",
1257
1257
  links.webUrl ? " \xB7 w web" : "",
1258
1258
  " \xB7 r refresh \xB7 esc back"
@@ -2005,6 +2005,9 @@ function AppShell({
2005
2005
  transcribeRecordingArtifact,
2006
2006
  onRetranscribe,
2007
2007
  onResummarize,
2008
+ onSyncRecordingText,
2009
+ onSyncRecordingAudio,
2010
+ onExportRecording,
2008
2011
  initialView = "overview",
2009
2012
  openUrl: openUrl2,
2010
2013
  copyText: copyText2,
@@ -2458,6 +2461,54 @@ function AppShell({
2458
2461
  },
2459
2462
  [onResummarize, refresh, recordings, now, refetchTranscript]
2460
2463
  );
2464
+ const syncedTextRef = useRef3(/* @__PURE__ */ new Set());
2465
+ const syncRecordingText2 = useCallback(
2466
+ async (recordingId, opts = {}) => {
2467
+ if (!onSyncRecordingText) return;
2468
+ if (opts.manual) setNotice("Syncing text locally\u2026");
2469
+ try {
2470
+ const data = await onSyncRecordingText(recordingId);
2471
+ syncedTextRef.current.add(recordingId);
2472
+ if (opts.manual) setNotice(`Text synced \xB7 ${data.sessionDir}`);
2473
+ } catch (error51) {
2474
+ if (opts.manual) setNotice(transcribeHandoffErrorCopy(error51));
2475
+ }
2476
+ },
2477
+ [onSyncRecordingText]
2478
+ );
2479
+ const syncRecordingAudio2 = useCallback(
2480
+ async (recordingId) => {
2481
+ if (!onSyncRecordingAudio) {
2482
+ setNotice("Audio sync is not available in this CLI session.");
2483
+ return;
2484
+ }
2485
+ setNotice("Downloading audio\u2026");
2486
+ try {
2487
+ const data = await onSyncRecordingAudio(recordingId);
2488
+ setNotice(`Audio saved \xB7 ${data.audioPath}`);
2489
+ } catch (error51) {
2490
+ setNotice(transcribeHandoffErrorCopy(error51));
2491
+ }
2492
+ },
2493
+ [onSyncRecordingAudio]
2494
+ );
2495
+ const exportRecordingForAgent = useCallback(
2496
+ async (recordingId) => {
2497
+ if (!onExportRecording) {
2498
+ setNotice("Export is not available in this CLI session.");
2499
+ return;
2500
+ }
2501
+ setNotice("Exporting\u2026");
2502
+ try {
2503
+ const data = await onExportRecording(recordingId);
2504
+ copyText2?.(data.textPath);
2505
+ setNotice(`Exported \xB7 ${data.textPath} (path copied)`);
2506
+ } catch (error51) {
2507
+ setNotice(transcribeHandoffErrorCopy(error51));
2508
+ }
2509
+ },
2510
+ [onExportRecording, copyText2]
2511
+ );
2461
2512
  useEffect4(() => {
2462
2513
  if (liveRecord?.kind !== "stopped") return;
2463
2514
  const artifact = liveRecord.artifact;
@@ -2602,6 +2653,11 @@ function AppShell({
2602
2653
  cancelled = true;
2603
2654
  };
2604
2655
  }, [detailTranscriptId, fetchTranscript]);
2656
+ const detailRecordingId = screen.kind === "recordingDetail" ? screen.recordingId : void 0;
2657
+ useEffect4(() => {
2658
+ if (!detailRecordingId || syncedTextRef.current.has(detailRecordingId)) return;
2659
+ void syncRecordingText2(detailRecordingId);
2660
+ }, [detailRecordingId, syncRecordingText2]);
2605
2661
  const setAudio = (recordingId, action) => setAudioCache((m) => new Map(m).set(recordingId, action));
2606
2662
  const runAudio = useCallback(
2607
2663
  async (recordingId, mode) => {
@@ -2708,6 +2764,7 @@ function AppShell({
2708
2764
  if (screen.kind === "recordingDetail") {
2709
2765
  const detailRec = recordings.find((r) => r.recordingId === screen.recordingId);
2710
2766
  if (detailRec?.activeTranscriptId) refetchTranscript(detailRec.activeTranscriptId);
2767
+ void syncRecordingText2(screen.recordingId, { manual: true });
2711
2768
  }
2712
2769
  return;
2713
2770
  }
@@ -2750,10 +2807,13 @@ function AppShell({
2750
2807
  const links = rec ? resolveRecordingLinks(rec.recordingId, rec.origin) : {};
2751
2808
  if (input === "T" && rec) void retranscribeExistingRecording(rec.recordingId);
2752
2809
  else if ((input === "s" || input === "S") && rec) void resummarizeExistingRecording(rec.recordingId);
2810
+ else if (input === "e" && rec) void exportRecordingForAgent(rec.recordingId);
2753
2811
  else if (input === "t" && rec?.activeTranscriptId) void openTranscript(rec.activeTranscriptId);
2754
2812
  else if (input === "o" && rec) void runAudio(rec.recordingId, "open");
2755
- else if (input === "d" && rec) void runAudio(rec.recordingId, "download");
2756
- else if (input === "f" && rec) void runAudio(rec.recordingId, "finder");
2813
+ else if (input === "d" && rec) {
2814
+ if (onSyncRecordingAudio) void syncRecordingAudio2(rec.recordingId);
2815
+ else void runAudio(rec.recordingId, "download");
2816
+ } else if (input === "f" && rec) void runAudio(rec.recordingId, "finder");
2757
2817
  else if (input === "w" && links.webUrl) openUrl2?.(links.webUrl);
2758
2818
  else if (input === "c" && links.webUrl) {
2759
2819
  copyText2?.(links.webUrl);