recappi 0.1.10 → 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 +41 -6
- 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
|
}
|