recappi 0.1.53 → 0.1.54

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
@@ -2861,6 +2861,7 @@ async function runDashboard(deps) {
2861
2861
  startLiveRecord: deps.startLiveRecord,
2862
2862
  startRecordSetupPreview: deps.startRecordSetupPreview,
2863
2863
  transcribeRecordingArtifact: deps.transcribeRecordingArtifact,
2864
+ onRetranscribe: deps.retranscribeRecording,
2864
2865
  initialView: deps.initialView ?? "overview",
2865
2866
  openUrl,
2866
2867
  copyText
@@ -17838,6 +17839,13 @@ var uploadBatchDataSchema = external_exports.object({
17838
17839
  totalCount: external_exports.number().int().nonnegative(),
17839
17840
  attemptedCount: external_exports.number().int().nonnegative()
17840
17841
  });
17842
+ var recordingTranscribeDataSchema = external_exports.object({
17843
+ origin: external_exports.string(),
17844
+ recordingId: external_exports.string(),
17845
+ jobId: external_exports.string(),
17846
+ status: transcriptionJobStatusSchema,
17847
+ transcriptId: external_exports.string().nullable().optional()
17848
+ });
17841
17849
  var jobDataSchema = external_exports.object({
17842
17850
  jobId: external_exports.string(),
17843
17851
  recordingId: external_exports.string().optional(),
@@ -19088,6 +19096,62 @@ var RecappiApiClient = class {
19088
19096
  );
19089
19097
  return mapRecording(parsed, this.auth.origin);
19090
19098
  }
19099
+ async transcribeRecording(opts) {
19100
+ if (opts.scene && opts.scene !== "default") {
19101
+ throw cliError("usage.invalid_argument", `Unknown transcription scene '${opts.scene}'.`, {
19102
+ hint: "Only the default scene is available today; use --prompt for custom context."
19103
+ });
19104
+ }
19105
+ opts.onEvent?.({
19106
+ type: "started",
19107
+ command: "recordings retranscribe",
19108
+ recordingId: opts.recordingId,
19109
+ message: "Starting transcription"
19110
+ });
19111
+ const hasPrompt = Boolean(opts.prompt?.trim());
19112
+ const parsed = await this.postJson(
19113
+ `/api/recordings/${encodeURIComponent(opts.recordingId)}/transcribe`,
19114
+ {
19115
+ ...opts.language ? { language: opts.language } : {},
19116
+ ...opts.provider ? { provider: opts.provider } : {},
19117
+ ...opts.model ? { model: opts.model } : {},
19118
+ ...hasPrompt ? { prompt: opts.prompt } : { force: true }
19119
+ }
19120
+ );
19121
+ let result = recordingTranscribeDataSchema.parse({
19122
+ origin: this.auth.origin,
19123
+ recordingId: opts.recordingId,
19124
+ jobId: parsed.jobId,
19125
+ status: parsed.status,
19126
+ ...typeof parsed.transcriptId === "string" || parsed.transcriptId === null ? { transcriptId: parsed.transcriptId } : {}
19127
+ });
19128
+ opts.onEvent?.({
19129
+ type: "progress",
19130
+ command: "recordings retranscribe",
19131
+ recordingId: opts.recordingId,
19132
+ jobId: result.jobId,
19133
+ status: result.status,
19134
+ ...result.transcriptId ? { transcriptId: result.transcriptId } : {},
19135
+ message: result.status === "succeeded" ? "Transcription already ready" : "Transcription queued"
19136
+ });
19137
+ if (opts.wait && result.status !== "succeeded") {
19138
+ const waited = await this.waitForJob(result.jobId, {
19139
+ onEvent: (event) => opts.onEvent?.({
19140
+ ...event,
19141
+ command: "recordings retranscribe",
19142
+ recordingId: opts.recordingId
19143
+ })
19144
+ });
19145
+ result = recordingTranscribeDataSchema.parse({
19146
+ origin: this.auth.origin,
19147
+ recordingId: opts.recordingId,
19148
+ jobId: waited.jobId,
19149
+ status: waited.status,
19150
+ ...waited.transcriptId !== void 0 ? { transcriptId: waited.transcriptId } : {}
19151
+ });
19152
+ }
19153
+ return result;
19154
+ }
19091
19155
  async downloadRecordingAudio(recordingId, opts = {}) {
19092
19156
  const response = await this.request(
19093
19157
  "GET",
@@ -20045,6 +20109,29 @@ Next cursor: ${data.nextCursor}
20045
20109
  opts.stdout(`
20046
20110
  Next:
20047
20111
  recappi transcript get ${data.activeTranscriptId}
20112
+ `);
20113
+ }
20114
+ return;
20115
+ }
20116
+ if (command === "recordings retranscribe" && isRecord4(data)) {
20117
+ opts.stdout("Transcription started\n");
20118
+ if (typeof data.recordingId === "string") opts.stdout(` recordingId: ${data.recordingId}
20119
+ `);
20120
+ if (typeof data.jobId === "string") opts.stdout(` jobId: ${data.jobId}
20121
+ `);
20122
+ if (typeof data.status === "string") opts.stdout(` status: ${data.status}
20123
+ `);
20124
+ if (typeof data.transcriptId === "string") {
20125
+ opts.stdout(` transcriptId: ${data.transcriptId}
20126
+ `);
20127
+ opts.stdout(`
20128
+ Next:
20129
+ recappi transcript get ${data.transcriptId}
20130
+ `);
20131
+ } else if (typeof data.jobId === "string") {
20132
+ opts.stdout(`
20133
+ Next:
20134
+ recappi jobs wait ${data.jobId}
20048
20135
  `);
20049
20136
  }
20050
20137
  return;
@@ -20441,6 +20528,7 @@ var COMMAND_DATA_SCHEMAS = {
20441
20528
  record: recordCommandDataSchema,
20442
20529
  "recordings get": recordingDataSchema,
20443
20530
  "recordings list": recordingListDataSchema,
20531
+ "recordings retranscribe": recordingTranscribeDataSchema,
20444
20532
  "jobs list": jobListDataSchema,
20445
20533
  "jobs wait": jobDataSchema,
20446
20534
  "transcript get": transcriptDataSchema
@@ -21648,6 +21736,7 @@ async function runCli(deps = {}) {
21648
21736
  }
21649
21737
  return success2;
21650
21738
  },
21739
+ retranscribeRecording: (recordingId, options = {}) => client.transcribeRecording({ recordingId, ...options }),
21651
21740
  initialView: parsed.initialView
21652
21741
  });
21653
21742
  return 0;
@@ -21838,6 +21927,24 @@ async function runCli(deps = {}) {
21838
21927
  renderSuccess("recordings get", data, render3);
21839
21928
  return 0;
21840
21929
  }
21930
+ if (parsed.kind === "recordings-retranscribe") {
21931
+ const eventMode = parsed.options.mode === "jsonl" ? "jsonl" : "human";
21932
+ const data = await client.transcribeRecording({
21933
+ recordingId: parsed.recordingId,
21934
+ language: parsed.language,
21935
+ provider: parsed.provider,
21936
+ model: parsed.model,
21937
+ prompt: parsed.prompt,
21938
+ scene: parsed.scene,
21939
+ wait: parsed.wait,
21940
+ onEvent: parsed.wait || mode === "jsonl" ? (event) => renderEvent(event, {
21941
+ ...render3,
21942
+ mode: eventMode
21943
+ }) : void 0
21944
+ });
21945
+ renderSuccess("recordings retranscribe", data, render3);
21946
+ return 0;
21947
+ }
21841
21948
  if (parsed.kind === "dashboard-stats") {
21842
21949
  const data = await client.dashboardStats();
21843
21950
  renderSuccess("dashboard stats", data, render3);
@@ -22162,6 +22269,25 @@ Agent mode:
22162
22269
  });
22163
22270
  }
22164
22271
  );
22272
+ const recordingsRetranscribe = recordings.command("retranscribe <recordingId>").description("Start a fresh transcription job for an existing recording").option("--language <lang>", "transcription language hint", parseStringOption("--language")).option("--provider <name>", "transcription provider", parseStringOption("--provider")).option("--model <name>", "transcription model", parseStringOption("--model")).option("--prompt <text>", "custom transcription prompt/context", parseStringOption("--prompt")).option("--scene <id>", "transcription scene preset", parseStringOption("--scene")).option("--wait", "wait for the transcription job to reach a terminal state");
22273
+ addCommonOptions(recordingsRetranscribe);
22274
+ recordingsRetranscribe.action(
22275
+ (recordingId, _options, command) => {
22276
+ const opts = command.opts();
22277
+ onSelect({
22278
+ kind: "recordings-retranscribe",
22279
+ options: collectGlobalOptions(command),
22280
+ commandName: "recordings retranscribe",
22281
+ recordingId,
22282
+ ...typeof opts.language === "string" ? { language: opts.language } : {},
22283
+ ...typeof opts.provider === "string" ? { provider: opts.provider } : {},
22284
+ ...typeof opts.model === "string" ? { model: opts.model } : {},
22285
+ ...typeof opts.prompt === "string" ? { prompt: opts.prompt } : {},
22286
+ ...typeof opts.scene === "string" ? { scene: opts.scene } : {},
22287
+ ...opts.wait === true ? { wait: true } : {}
22288
+ });
22289
+ }
22290
+ );
22165
22291
  const transcript = program.command("transcript").description("Transcript commands");
22166
22292
  addCommonOptions(transcript);
22167
22293
  const transcriptGet = transcript.command("get <transcriptId>").description("Fetch a transcript by transcript id");
@@ -22285,7 +22411,9 @@ var VALUE_OPTIONS = /* @__PURE__ */ new Set([
22285
22411
  "--title",
22286
22412
  "--language",
22287
22413
  "--provider",
22414
+ "--model",
22288
22415
  "--prompt",
22416
+ "--scene",
22289
22417
  "--translation-language",
22290
22418
  "--transcription-language",
22291
22419
  "--sidecar-command",