recappi 0.1.38 → 0.1.40

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
@@ -17171,7 +17171,8 @@ var sidecarCapabilitySchema = external_exports.enum([
17171
17171
  var sidecarAccountSchema = external_exports.object({
17172
17172
  backendOrigin: external_exports.string(),
17173
17173
  userId: external_exports.string(),
17174
- email: external_exports.string().optional()
17174
+ email: external_exports.string().optional(),
17175
+ authToken: external_exports.string().optional()
17175
17176
  });
17176
17177
  var sidecarClientInfoSchema = external_exports.object({
17177
17178
  name: external_exports.string(),
@@ -20478,7 +20479,7 @@ async function recordViaSidecar(opts) {
20478
20479
  source: session.source,
20479
20480
  sourceLabel: opts.includeSystemAudio === false ? "Microphone" : "System audio \xB7 all apps",
20480
20481
  micEnabled: opts.includeMicrophone !== false,
20481
- captionStreamEnabled: opts.live === true,
20482
+ captionStreamEnabled: session.captionStreamEnabled,
20482
20483
  renderApp: opts.runtime?.renderApp,
20483
20484
  now: opts.runtime?.now
20484
20485
  });
@@ -20517,7 +20518,7 @@ async function startLiveRecordSession(opts, selection = {
20517
20518
  });
20518
20519
  return {
20519
20520
  mode: "local",
20520
- captionStreamEnabled: true,
20521
+ captionStreamEnabled: session.captionStreamEnabled,
20521
20522
  source: session.source,
20522
20523
  stop: session.stop
20523
20524
  };
@@ -20567,7 +20568,7 @@ async function startRecordSessionOnce(opts) {
20567
20568
  const sidecarArgs = opts.sidecarArgs ?? [];
20568
20569
  const spawnSidecar = opts.runtime?.spawnSidecar ?? spawnMiniSidecar;
20569
20570
  const sidecar = spawnSidecar({ command, args: sidecarArgs, env: opts.env });
20570
- const account = requireAccountPartition(opts.account);
20571
+ const accountPartition = requireAccountPartition(opts.account);
20571
20572
  const artifacts = [];
20572
20573
  let handshake;
20573
20574
  let sessionId;
@@ -20605,17 +20606,18 @@ async function startRecordSessionOnce(opts) {
20605
20606
  handshake = await sidecar.client.handshake(
20606
20607
  defaultSidecarHandshakeParams({
20607
20608
  client: { name: "recappi-cli", version: opts.cliVersion },
20608
- account: opts.account,
20609
+ account: accountPartition,
20609
20610
  capabilities: opts.live ? ["recording.capture", "recording.upload", "live_captions.stream"] : ["recording.capture", "recording.upload"]
20610
20611
  })
20611
20612
  );
20613
+ const captionStreamEnabled = opts.live === true && handshake.capabilities.includes("live_captions.stream");
20612
20614
  assertSidecarCapabilities(handshake, opts);
20613
20615
  const recordingOptions = {
20614
20616
  includeSystemAudio: opts.includeSystemAudio ?? true,
20615
20617
  includeMicrophone: opts.includeMicrophone ?? true,
20616
20618
  ...opts.targetBundleId ? { targetBundleId: opts.targetBundleId } : {},
20617
20619
  ...opts.microphoneDeviceId ? { microphoneDeviceId: opts.microphoneDeviceId } : {},
20618
- liveCaptions: opts.live === true,
20620
+ liveCaptions: captionStreamEnabled,
20619
20621
  ...opts.translationLanguage ? { translationLanguage: opts.translationLanguage } : {},
20620
20622
  ...opts.transcriptionLanguage ? { transcriptionLanguage: opts.transcriptionLanguage } : {},
20621
20623
  ...opts.title ? { title: opts.title } : {}
@@ -20623,13 +20625,14 @@ async function startRecordSessionOnce(opts) {
20623
20625
  const preflight = await sidecar.client.getPermissionStatus({ options: recordingOptions });
20624
20626
  assertRecordingPermissions(preflight.permissions);
20625
20627
  const started = await sidecar.client.startRecording({
20626
- account,
20628
+ account: opts.account,
20627
20629
  options: recordingOptions
20628
20630
  });
20629
20631
  sessionId = started.sessionId;
20630
20632
  latestState = started.state;
20631
20633
  localSessionRef = started.localSessionRef;
20632
20634
  return {
20635
+ captionStreamEnabled,
20633
20636
  source: sidecar.client,
20634
20637
  stop: () => {
20635
20638
  stopPromise ??= (async () => {
@@ -20640,11 +20643,11 @@ async function startRecordSessionOnce(opts) {
20640
20643
  localSessionRef = stopped.localSessionRef ?? localSessionRef;
20641
20644
  artifacts.push(...stopped.artifacts ?? []);
20642
20645
  const uniqueArtifacts = dedupeArtifacts(artifacts);
20643
- persistArtifacts(uniqueArtifacts, account, opts);
20646
+ persistArtifacts(uniqueArtifacts, accountPartition, opts);
20644
20647
  return recordCommandDataSchema.parse({
20645
- origin: account.backendOrigin,
20646
- userId: account.userId,
20647
- live: opts.live === true,
20648
+ origin: accountPartition.backendOrigin,
20649
+ userId: accountPartition.userId,
20650
+ live: captionStreamEnabled,
20648
20651
  sessionId: stopped.sessionId,
20649
20652
  state: stopped.state,
20650
20653
  ...recordingId ? { recordingId } : {},
@@ -20730,7 +20733,7 @@ function assertSidecarCapabilities(handshake, opts) {
20730
20733
  const capabilities = new Set(handshake.capabilities);
20731
20734
  const missing = [];
20732
20735
  if (!capabilities.has("recording.capture")) missing.push("recording.capture");
20733
- if (opts.live && !capabilities.has("live_captions.stream")) {
20736
+ if (opts.requireLiveCaptions && !capabilities.has("live_captions.stream")) {
20734
20737
  missing.push("live_captions.stream");
20735
20738
  }
20736
20739
  if (missing.length === 0) return;
@@ -21081,6 +21084,7 @@ async function runCli(deps = {}) {
21081
21084
  account: {
21082
21085
  backendOrigin: auth.origin,
21083
21086
  userId: liveStatus.userId,
21087
+ authToken: requireToken(auth),
21084
21088
  ...liveStatus.email ? { email: liveStatus.email } : {}
21085
21089
  },
21086
21090
  cliVersion: CLI_VERSION,
@@ -21210,6 +21214,7 @@ async function runCli(deps = {}) {
21210
21214
  account: {
21211
21215
  backendOrigin: auth.origin,
21212
21216
  userId: status.userId,
21217
+ authToken: requireToken(auth),
21213
21218
  ...status.email ? { email: status.email } : {}
21214
21219
  },
21215
21220
  cliVersion: CLI_VERSION,
@@ -21224,6 +21229,7 @@ async function runCli(deps = {}) {
21224
21229
  sidecarCommand: parsed.sidecarCommand,
21225
21230
  renderLive: parsed.live === true && mode === "human" && isTTY,
21226
21231
  renderHero: parsed.live !== true && mode === "human" && isTTY,
21232
+ requireLiveCaptions: parsed.live === true,
21227
21233
  runtime: deps.recordRuntime
21228
21234
  });
21229
21235
  renderSuccess("record", data, render3);