recappi 0.1.10 → 0.1.12

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
@@ -1297,6 +1297,30 @@ 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: "This CLI install is missing its local recorder.",
1305
+ detail: "Run npm install -g recappi@latest, or use npx -y recappi@latest.",
1306
+ tone: "yellow"
1307
+ };
1308
+ case "record.unsupported_platform":
1309
+ return {
1310
+ title: "CLI recording isn't supported on this platform yet.",
1311
+ detail: "Use Recappi Mini on macOS to record for now.",
1312
+ tone: "yellow"
1313
+ };
1314
+ case "record.capture_unavailable":
1315
+ return {
1316
+ title: "CLI recording isn't ready yet.",
1317
+ detail: "Use the Recappi Mini app to record for now; CLI recording is coming soon.",
1318
+ tone: "yellow"
1319
+ };
1320
+ default:
1321
+ return { title: "Couldn't start recording.", detail: message, tone: "red" };
1322
+ }
1323
+ }
1300
1324
  function AppShell({
1301
1325
  fetchJobs,
1302
1326
  fetchTranscript,
@@ -1362,7 +1386,11 @@ function AppShell({
1362
1386
  useEffect2(() => {
1363
1387
  if (screen.kind !== "record") return;
1364
1388
  if (!startLiveRecord) {
1365
- setLiveRecord({ kind: "error", message: "Live recording is not available" });
1389
+ setLiveRecord({
1390
+ kind: "error",
1391
+ code: "record.helper_unavailable",
1392
+ message: "Live recording is not available"
1393
+ });
1366
1394
  return;
1367
1395
  }
1368
1396
  let cancelled = false;
@@ -1375,7 +1403,12 @@ function AppShell({
1375
1403
  setLiveRecord({ kind: "live", session });
1376
1404
  }).catch((error51) => {
1377
1405
  if (!cancelled) {
1378
- setLiveRecord({ kind: "error", message: error51 instanceof Error ? error51.message : String(error51) });
1406
+ const code = error51 && typeof error51 === "object" && "code" in error51 ? String(error51.code) : void 0;
1407
+ setLiveRecord({
1408
+ kind: "error",
1409
+ code,
1410
+ message: error51 instanceof Error ? error51.message : String(error51)
1411
+ });
1379
1412
  }
1380
1413
  });
1381
1414
  return () => {
@@ -1641,10 +1674,13 @@ function AppShell({
1641
1674
  }
1642
1675
  return /* @__PURE__ */ jsxs12(Box13, { flexDirection: "column", height: size.rows, paddingX: 1, children: [
1643
1676
  /* @__PURE__ */ jsx15(Header, { active: "record" }),
1644
- /* @__PURE__ */ jsx15(Box13, { flexGrow: 1, flexDirection: "column", paddingX: 1, paddingTop: 1, children: liveRecord?.kind === "error" ? /* @__PURE__ */ jsxs12(Fragment4, { children: [
1645
- /* @__PURE__ */ jsx15(Text13, { color: "red", children: "Couldn't start live recording" }),
1646
- /* @__PURE__ */ jsx15(Text13, { dimColor: true, children: liveRecord.message })
1647
- ] }) : /* @__PURE__ */ jsx15(Text13, { dimColor: true, children: "Starting live recording\u2026" }) }),
1677
+ /* @__PURE__ */ jsx15(Box13, { flexGrow: 1, flexDirection: "column", paddingX: 1, paddingTop: 1, children: liveRecord?.kind === "error" ? (() => {
1678
+ const copy = recordErrorCopy(liveRecord.code, liveRecord.message);
1679
+ return /* @__PURE__ */ jsxs12(Fragment4, { children: [
1680
+ /* @__PURE__ */ jsx15(Text13, { color: copy.tone, children: copy.title }),
1681
+ copy.detail ? /* @__PURE__ */ jsx15(Text13, { dimColor: true, children: copy.detail }) : null
1682
+ ] });
1683
+ })() : /* @__PURE__ */ jsx15(Text13, { dimColor: true, children: "Starting live recording\u2026" }) }),
1648
1684
  /* @__PURE__ */ jsx15(Footer, { keys: "q / esc / \u2190 back" })
1649
1685
  ] });
1650
1686
  }