recappi 0.1.9 → 0.1.11
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 +51 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1297,6 +1297,29 @@ var init_TranscriptView = __esm({
|
|
|
1297
1297
|
import { useCallback, useEffect as useEffect2, useState as useState5 } from "react";
|
|
1298
1298
|
import { Box as Box13, Text as Text13, useApp, useInput as useInput5 } from "ink";
|
|
1299
1299
|
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1300
|
+
function recordErrorCopy(code, message) {
|
|
1301
|
+
switch (code) {
|
|
1302
|
+
case "record.helper_unavailable":
|
|
1303
|
+
return {
|
|
1304
|
+
title: "Live recording isn't available on this machine yet.",
|
|
1305
|
+
detail: "The recorder helper isn't installed for your platform.",
|
|
1306
|
+
tone: "yellow"
|
|
1307
|
+
};
|
|
1308
|
+
case "record.unsupported_platform":
|
|
1309
|
+
return {
|
|
1310
|
+
title: "Live recording isn't supported on this platform yet.",
|
|
1311
|
+
tone: "yellow"
|
|
1312
|
+
};
|
|
1313
|
+
case "record.capture_unavailable":
|
|
1314
|
+
return {
|
|
1315
|
+
title: "Live recording isn't ready yet.",
|
|
1316
|
+
detail: "The on-device recorder is still being finished \u2014 coming soon.",
|
|
1317
|
+
tone: "yellow"
|
|
1318
|
+
};
|
|
1319
|
+
default:
|
|
1320
|
+
return { title: "Couldn't start recording.", detail: message, tone: "red" };
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1300
1323
|
function AppShell({
|
|
1301
1324
|
fetchJobs,
|
|
1302
1325
|
fetchTranscript,
|
|
@@ -1362,7 +1385,11 @@ function AppShell({
|
|
|
1362
1385
|
useEffect2(() => {
|
|
1363
1386
|
if (screen.kind !== "record") return;
|
|
1364
1387
|
if (!startLiveRecord) {
|
|
1365
|
-
setLiveRecord({
|
|
1388
|
+
setLiveRecord({
|
|
1389
|
+
kind: "error",
|
|
1390
|
+
code: "record.helper_unavailable",
|
|
1391
|
+
message: "Live recording is not available"
|
|
1392
|
+
});
|
|
1366
1393
|
return;
|
|
1367
1394
|
}
|
|
1368
1395
|
let cancelled = false;
|
|
@@ -1375,7 +1402,12 @@ function AppShell({
|
|
|
1375
1402
|
setLiveRecord({ kind: "live", session });
|
|
1376
1403
|
}).catch((error51) => {
|
|
1377
1404
|
if (!cancelled) {
|
|
1378
|
-
|
|
1405
|
+
const code = error51 && typeof error51 === "object" && "code" in error51 ? String(error51.code) : void 0;
|
|
1406
|
+
setLiveRecord({
|
|
1407
|
+
kind: "error",
|
|
1408
|
+
code,
|
|
1409
|
+
message: error51 instanceof Error ? error51.message : String(error51)
|
|
1410
|
+
});
|
|
1379
1411
|
}
|
|
1380
1412
|
});
|
|
1381
1413
|
return () => {
|
|
@@ -1641,10 +1673,13 @@ function AppShell({
|
|
|
1641
1673
|
}
|
|
1642
1674
|
return /* @__PURE__ */ jsxs12(Box13, { flexDirection: "column", height: size.rows, paddingX: 1, children: [
|
|
1643
1675
|
/* @__PURE__ */ jsx15(Header, { active: "record" }),
|
|
1644
|
-
/* @__PURE__ */ jsx15(Box13, { flexGrow: 1, flexDirection: "column", paddingX: 1, paddingTop: 1, children: liveRecord?.kind === "error" ?
|
|
1645
|
-
|
|
1646
|
-
/* @__PURE__ */
|
|
1647
|
-
|
|
1676
|
+
/* @__PURE__ */ jsx15(Box13, { flexGrow: 1, flexDirection: "column", paddingX: 1, paddingTop: 1, children: liveRecord?.kind === "error" ? (() => {
|
|
1677
|
+
const copy = recordErrorCopy(liveRecord.code, liveRecord.message);
|
|
1678
|
+
return /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
1679
|
+
/* @__PURE__ */ jsx15(Text13, { color: copy.tone, children: copy.title }),
|
|
1680
|
+
copy.detail ? /* @__PURE__ */ jsx15(Text13, { dimColor: true, children: copy.detail }) : null
|
|
1681
|
+
] });
|
|
1682
|
+
})() : /* @__PURE__ */ jsx15(Text13, { dimColor: true, children: "Starting live recording\u2026" }) }),
|
|
1648
1683
|
/* @__PURE__ */ jsx15(Footer, { keys: "q / esc / \u2190 back" })
|
|
1649
1684
|
] });
|
|
1650
1685
|
}
|
|
@@ -16361,6 +16396,9 @@ var cliErrorCodeSchema = external_exports.enum([
|
|
|
16361
16396
|
"input.unsupported_audio",
|
|
16362
16397
|
"input.duration_unavailable",
|
|
16363
16398
|
"input.partial_failure",
|
|
16399
|
+
"record.helper_unavailable",
|
|
16400
|
+
"record.unsupported_platform",
|
|
16401
|
+
"record.capture_unavailable",
|
|
16364
16402
|
"cloud.conflict.upload_in_progress",
|
|
16365
16403
|
"cloud.recording_not_ready",
|
|
16366
16404
|
"cloud.job_failed",
|
|
@@ -16852,6 +16890,9 @@ var DEFAULT_EXIT_CODES = {
|
|
|
16852
16890
|
"input.duration_unavailable": 4,
|
|
16853
16891
|
"input.partial_failure": 1,
|
|
16854
16892
|
// always overridden with the worst per-file exit code
|
|
16893
|
+
"record.helper_unavailable": 2,
|
|
16894
|
+
"record.unsupported_platform": 2,
|
|
16895
|
+
"record.capture_unavailable": 2,
|
|
16855
16896
|
"cloud.conflict.upload_in_progress": 5,
|
|
16856
16897
|
"cloud.recording_not_ready": 5,
|
|
16857
16898
|
"cloud.job_failed": 5,
|
|
@@ -19675,7 +19716,7 @@ function assertSidecarCapabilities(handshake, opts) {
|
|
|
19675
19716
|
missing.push("live_captions.stream");
|
|
19676
19717
|
}
|
|
19677
19718
|
if (missing.length === 0) return;
|
|
19678
|
-
throw cliError("
|
|
19719
|
+
throw cliError("record.capture_unavailable", "Recappi recording helper cannot capture yet.", {
|
|
19679
19720
|
hint: `Found ${handshake.sidecar.name} ${handshake.sidecar.version}, but it did not advertise ${missing.join(
|
|
19680
19721
|
", "
|
|
19681
19722
|
)}. Upgrade recappi when a helper build with native recording support ships, or set ${SIDECAR_COMMAND_ENV} to a compatible helper.`
|
|
@@ -19688,11 +19729,11 @@ function resolveSidecarCommand(opts) {
|
|
|
19688
19729
|
if (bundled && existsSync(bundled)) return ensureBundledHelperExecutable(bundled);
|
|
19689
19730
|
const platform = `${process.platform}-${process.arch}`;
|
|
19690
19731
|
if (bundled) {
|
|
19691
|
-
throw cliError("
|
|
19732
|
+
throw cliError("record.helper_unavailable", "Recappi recording helper is not available.", {
|
|
19692
19733
|
hint: `Expected bundled helper for ${platform} at ${bundled}. Reinstall recappi, or set ${SIDECAR_COMMAND_ENV} to a compatible helper.`
|
|
19693
19734
|
});
|
|
19694
19735
|
}
|
|
19695
|
-
throw cliError("
|
|
19736
|
+
throw cliError("record.unsupported_platform", "Recappi recording is not supported on this platform yet.", {
|
|
19696
19737
|
hint: `No bundled helper is registered for ${platform}. Set ${SIDECAR_COMMAND_ENV} to a compatible helper when one is available.`
|
|
19697
19738
|
});
|
|
19698
19739
|
}
|
|
@@ -19704,7 +19745,7 @@ function ensureBundledHelperExecutable(path6) {
|
|
|
19704
19745
|
chmodSync(path6, mode | 493);
|
|
19705
19746
|
} catch (error51) {
|
|
19706
19747
|
const message = error51 instanceof Error ? error51.message : String(error51);
|
|
19707
|
-
throw cliError("
|
|
19748
|
+
throw cliError("record.helper_unavailable", "Recappi recording helper is not executable.", {
|
|
19708
19749
|
hint: `Could not make bundled helper executable at ${path6}: ${message}. Reinstall recappi, or set ${SIDECAR_COMMAND_ENV} to a compatible helper.`
|
|
19709
19750
|
});
|
|
19710
19751
|
}
|