@ai-matrx/coding-sessions 0.1.166 → 0.3.0

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/engine/index.cjs +273 -59
  3. package/dist/engine/index.cjs.map +1 -1
  4. package/dist/engine/index.d.cts +1 -1
  5. package/dist/engine/index.d.ts +1 -1
  6. package/dist/engine/index.js +269 -58
  7. package/dist/engine/index.js.map +1 -1
  8. package/dist/{index-CDeDKQHe.d.cts → index-Bbe11HoB.d.cts} +108 -3
  9. package/dist/{index-CDeDKQHe.d.ts → index-Bbe11HoB.d.ts} +108 -3
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +30 -1
  12. package/dist/index.d.ts +30 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/react/index.cjs +47 -6
  15. package/dist/react/index.cjs.map +1 -1
  16. package/dist/react/index.d.cts +37 -0
  17. package/dist/react/index.d.ts +37 -0
  18. package/dist/react/index.js +47 -6
  19. package/dist/react/index.js.map +1 -1
  20. package/dist/server/index.cjs +241 -57
  21. package/dist/server/index.cjs.map +1 -1
  22. package/dist/server/index.d.cts +2 -2
  23. package/dist/server/index.d.ts +2 -2
  24. package/dist/server/index.js +241 -57
  25. package/dist/server/index.js.map +1 -1
  26. package/dist/sessions/index.cjs +360 -0
  27. package/dist/sessions/index.cjs.map +1 -0
  28. package/dist/sessions/index.d.cts +71 -0
  29. package/dist/sessions/index.d.ts +71 -0
  30. package/dist/sessions/index.js +337 -0
  31. package/dist/sessions/index.js.map +1 -0
  32. package/dist/titles-DjxUb0ji.d.cts +48 -0
  33. package/dist/titles-DjxUb0ji.d.ts +48 -0
  34. package/dist/ui/assets/index-BqzTnRFe.css +2 -0
  35. package/dist/ui/assets/{index-7eK8XQtL.js → index-U98AY8r-.js} +17 -17
  36. package/dist/ui/index.html +2 -2
  37. package/package.json +13 -3
  38. package/dist/ui/assets/index-BqpVx_My.css +0 -2
@@ -300,6 +300,7 @@ function sessionEntry(session, prefs) {
300
300
  updatedAt: session.updatedAt,
301
301
  pinned: pref.pinned === true,
302
302
  hidden: pref.hidden === true,
303
+ hiddenBy: pref.hidden === true ? "you" : null,
303
304
  session,
304
305
  discovered: null
305
306
  };
@@ -317,7 +318,9 @@ function discoveredEntry(d, prefs) {
317
318
  cwd: d.cwd,
318
319
  updatedAt: d.updatedAt,
319
320
  pinned: pref.pinned === true,
320
- hidden: pref.hidden === true,
321
+ // Archived chats and scheduled runs are hidden by default, as in Code › Chats; a pin shows them.
322
+ hidden: pref.hidden === true || pref.pinned !== true && (d.archived === true || d.scheduled === true),
323
+ hiddenBy: pref.hidden === true ? "you" : pref.pinned === true ? null : d.archived ? "archived" : d.scheduled ? "scheduled" : null,
321
324
  session: null,
322
325
  discovered: d
323
326
  };
@@ -1239,6 +1242,14 @@ function ChooseAgentDialog(props) {
1239
1242
  ] }) });
1240
1243
  }
1241
1244
 
1245
+ // src/sessions/titles.ts
1246
+ var DISPLAY_MAX = 100;
1247
+ var LEADING_NOISE = /^(?:\s*(?:\d{1,3}[.)]|[-*•]|#{1,6}|>)\s+|\s*["“'‘`]+)+/;
1248
+ function displayTitle(title, max = DISPLAY_MAX) {
1249
+ const stripped = title.replace(LEADING_NOISE, "").replace(/["”'’`]+$/, "").trim() || title.trim();
1250
+ return stripped.length > max ? `${stripped.slice(0, max - 1).trimEnd()}\u2026` : stripped;
1251
+ }
1252
+
1242
1253
  // src/react/sidebar.tsx
1243
1254
  var import_react7 = require("react");
1244
1255
  var import_design_system5 = require("@ai-matrx/design-system");
@@ -1338,7 +1349,7 @@ function Row(props) {
1338
1349
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "pointer-events-none mt-0.5 shrink-0", children: props.live ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SpinnerIcon, { size: 16, className: "text-primary" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProviderMark, { provider: entry.provider, size: 16 }) }),
1339
1350
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "cs-row__body", children: [
1340
1351
  renaming ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "pointer-events-auto relative z-10 block", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RenameInput, { initial: entry.title, onDone: rename }) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "flex items-center gap-1", children: [
1341
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "min-w-0 truncate text-[13px] font-medium leading-5", children: entry.title }),
1352
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "min-w-0 truncate text-[13px] font-medium leading-5", children: displayTitle(entry.title) }),
1342
1353
  entry.pinned ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PinIcon, { size: 11, className: "shrink-0 text-muted-foreground", "aria-label": "Pinned" }) : null
1343
1354
  ] }),
1344
1355
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "block truncate text-[11.5px] leading-4 text-muted-foreground", children: props.meta }),
@@ -1440,6 +1451,8 @@ function Sidebar(props) {
1440
1451
  const [search, searchMore] = useContentSearch(query);
1441
1452
  const [groupMode, setGroupMode] = (0, import_react7.useState)(() => readLocal("coding-sessions.group", ["date", "folder"], "date"));
1442
1453
  const [showHidden, setShowHidden] = (0, import_react7.useState)(false);
1454
+ const titlesProblem = state.titles?.problem ?? null;
1455
+ const titlesUpdating = !titlesProblem && state.discovered.data.some((d) => d.titlePending === true);
1443
1456
  const [takingOver, setTakingOver] = (0, import_react7.useState)(null);
1444
1457
  const [takeoverError, setTakeoverError] = (0, import_react7.useState)(null);
1445
1458
  const prefs = state.preferences;
@@ -1493,6 +1506,7 @@ function Sidebar(props) {
1493
1506
  "Running in ",
1494
1507
  PROVIDER_LABEL[entry.provider]
1495
1508
  ] });
1509
+ else if (d?.unavailable) meta = `${PROVIDER_LABEL[entry.provider]} \xB7 file missing \xB7 ${relativeTime(entry.updatedAt, now)}`;
1496
1510
  else {
1497
1511
  const status = run ? run.status === "failed" ? "Failed \xB7 " : run.status === "stopped" ? "Stopped \xB7 " : "" : "";
1498
1512
  const where = entry.cwd ? prettyPath2(entry.cwd) : "unknown folder";
@@ -1582,7 +1596,7 @@ function Sidebar(props) {
1582
1596
  ] }) : null,
1583
1597
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SectionLabel, { children: "Recent" }),
1584
1598
  state.sessions.loading && state.sessions.loadedAt === null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SidebarSkeleton, {}) : state.sessions.error ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "px-4 py-1 text-[12px] text-destructive", children: state.sessions.error }) : recent.length === 0 ? running.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "px-4 py-1 text-[12px] leading-5 text-muted-foreground", children: "Sessions you start or take over here will appear here." }) : null : recent.map((e) => renderEntry(e)),
1585
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1599
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1586
1600
  SectionLabel,
1587
1601
  {
1588
1602
  action: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "flex items-center gap-0.5", children: [
@@ -1610,7 +1624,15 @@ function Sidebar(props) {
1610
1624
  }
1611
1625
  )
1612
1626
  ] }),
1613
- children: "Your other chats"
1627
+ children: [
1628
+ "Your other chats",
1629
+ titlesUpdating ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ml-1 font-normal normal-case text-muted-foreground", "data-cs-titles": "updating", children: "\xB7 titles updating" }) : null,
1630
+ titlesProblem ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "ml-1 font-normal normal-case text-destructive", "data-cs-titles": "unavailable", title: titlesProblem, children: [
1631
+ "\xB7 app titles unavailable \u2014",
1632
+ " ",
1633
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "cs-link", onClick: () => void client.retryTitles(), children: "Retry" })
1634
+ ] }) : null
1635
+ ]
1614
1636
  }
1615
1637
  ),
1616
1638
  state.discovered.loading && state.discovered.loadedAt === null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SidebarSkeleton, {}) : state.discovered.error ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "px-4 py-1 text-[12px] text-destructive", children: state.discovered.error }) : otherList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "px-4 py-1 text-[12px] leading-5 text-muted-foreground", children: others.length > 0 ? "Every chat found here is pinned or hidden." : "No other Claude Code or Codex chats were found on this computer." }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
@@ -2077,7 +2099,8 @@ var CodingSessionsClient = class {
2077
2099
  folders: loadable([]),
2078
2100
  runs: {},
2079
2101
  preferences: {},
2080
- discoveredLimit: DISCOVERED_PAGE
2102
+ discoveredLimit: DISCOVERED_PAGE,
2103
+ titles: null
2081
2104
  };
2082
2105
  transport.onStatus((connection) => {
2083
2106
  const wasOpen = this.state.connection.state === "open";
@@ -2126,6 +2149,10 @@ var CodingSessionsClient = class {
2126
2149
  } else if (event.type === "preferences") {
2127
2150
  this.set({ preferences: event.preferences });
2128
2151
  return;
2152
+ } else if (event.type === "titles") {
2153
+ void this.refreshDiscovered();
2154
+ void this.refreshSessions();
2155
+ return;
2129
2156
  }
2130
2157
  const sessionId = event.type === "session" ? event.session.id : event.type === "run" ? event.run.sessionId : event.sessionId;
2131
2158
  this.transcripts.get(sessionId)?.onEvent(event);
@@ -2142,7 +2169,21 @@ var CodingSessionsClient = class {
2142
2169
  }
2143
2170
  }
2144
2171
  refreshProviders = () => this.load("providers", () => this.transport.call("providers"));
2145
- refreshDiscovered = () => this.load("discovered", () => this.transport.call("discoverSessions", { limit: this.state.discoveredLimit }));
2172
+ refreshDiscovered = async () => {
2173
+ void this.refreshTitleStatus();
2174
+ await this.load("discovered", () => this.transport.call("discoverSessions", { limit: this.state.discoveredLimit }));
2175
+ };
2176
+ refreshTitleStatus = async () => {
2177
+ try {
2178
+ this.set({ titles: await this.transport.call("titleStatus") });
2179
+ } catch {
2180
+ }
2181
+ };
2182
+ /** The Retry beside "app titles unavailable". */
2183
+ retryTitles = async () => {
2184
+ await this.transport.call("retryTitles").catch(() => void 0);
2185
+ await this.refreshTitleStatus();
2186
+ };
2146
2187
  /** List more of "Your other chats". */
2147
2188
  showMoreDiscovered = async () => {
2148
2189
  this.set({ discoveredLimit: this.state.discoveredLimit + DISCOVERED_PAGE });