@clagentic/console 1.1.0 → 1.1.1-beta.1

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.
@@ -2,27 +2,15 @@ var _iconTimer = null;
2
2
  var _iconTimerScoped = null;
3
3
 
4
4
  // refreshIcons() — no scope: deferred full-document icon scan (one per frame)
5
- // refreshIcons(el) — scoped: immediate scan limited to el subtree, skipped if
6
- // a full scan is already queued (the full scan will cover it anyway).
5
+ // refreshIcons(el) — scoped: synchronous scan of el subtree only; also cancels
6
+ // any pending deferred scan since the sync pass covers the whole visible need.
7
7
  export function refreshIcons(scope) {
8
8
  if (scope) {
9
- // If a full-document refresh is already pending, it will handle this scope.
10
- if (_iconTimer) return;
11
- if (_iconTimerScoped) {
12
- // Already have a scoped pending — upgrade to full scan so both are covered.
13
- cancelAnimationFrame(_iconTimerScoped);
14
- _iconTimerScoped = null;
15
- _iconTimer = requestAnimationFrame(function () {
16
- _iconTimer = null;
17
- lucide.createIcons();
18
- });
19
- return;
20
- }
21
- _iconTimerScoped = requestAnimationFrame(function () {
22
- _iconTimerScoped = null;
23
- // lucide.createIcons accepts { nodes } to limit scope
24
- lucide.createIcons({ nodes: [scope] });
25
- });
9
+ // Cancel any pending deferred scans — the synchronous pass below covers them.
10
+ if (_iconTimerScoped) { cancelAnimationFrame(_iconTimerScoped); _iconTimerScoped = null; }
11
+ if (_iconTimer) { cancelAnimationFrame(_iconTimer); _iconTimer = null; }
12
+ // Resolve icons immediately so no paint can occur with unresolved placeholders.
13
+ lucide.createIcons({ root: scope });
26
14
  return;
27
15
  }
28
16
  // Full-document scan — cancel any pending scoped scan (redundant)
@@ -1324,6 +1324,10 @@ export function renderSessionList(sessions) {
1324
1324
  stickyTop.appendChild(renderSessionTopActions());
1325
1325
  stickyTop.appendChild(favoritesContainer);
1326
1326
  stickyTop.appendChild(divider);
1327
+ // Resolve top-action icons synchronously before the first paint so they
1328
+ // never appear as blank placeholders. The deferred refreshIcons() at the
1329
+ // end of this function covers the rest of the list.
1330
+ lucide.createIcons({ root: stickyTop });
1327
1331
  getSessionListEl().appendChild(stickyTop);
1328
1332
 
1329
1333
  var currentGroup = "";
package/lib/sdk-bridge.js CHANGED
@@ -884,6 +884,19 @@ function createSDKBridge(opts) {
884
884
  } catch (e) {}
885
885
  session.queryInstance = null;
886
886
  }
887
+ // lr-b61b: In the in-process path, close() ends the messageQueue but the
888
+ // underlying claude child process may survive in epoll_wait on its stdin
889
+ // socket. Aborting via the AbortController signals the SDK to terminate
890
+ // the child process. We always abort our own controller — even if the
891
+ // session.abortController reference was already replaced by a newer query
892
+ // (e.g. after a rewind), myAbortController is our local capture and
893
+ // aborting it only affects this query's child, not the newer one.
894
+ if (myAbortController && typeof myAbortController.abort === "function") {
895
+ try {
896
+ myAbortController.abort();
897
+ console.log("[sdk-bridge] processQueryStream finally: aborted AbortController for session " + session.localId);
898
+ } catch (e) {}
899
+ }
887
900
  session.messageQueue = null;
888
901
  if (session.abortController === myAbortController) session.abortController = null;
889
902
  session.taskStopRequested = false;
@@ -1343,6 +1356,18 @@ function createSDKBridge(opts) {
1343
1356
  // Push initial user message through the QueryHandle
1344
1357
  console.log("[sdk-bridge] pushing initial message via handle.pushMessage...");
1345
1358
  handle.pushMessage(text, images);
1359
+
1360
+ // lr-b61b: Flush any messages that arrived between turns (after the previous
1361
+ // finally block nulled queryInstance and before this startQuery call).
1362
+ if (session.pendingMessages && session.pendingMessages.length > 0) {
1363
+ console.log("[sdk-bridge] startQuery: flushing " + session.pendingMessages.length + " buffered pending message(s) for session " + session.localId);
1364
+ for (var pi = 0; pi < session.pendingMessages.length; pi++) {
1365
+ var pm = session.pendingMessages[pi];
1366
+ handle.pushMessage(pm.text, pm.images);
1367
+ }
1368
+ session.pendingMessages = [];
1369
+ }
1370
+
1346
1371
  console.log("[sdk-bridge] pushMessage done, starting processQueryStream...");
1347
1372
 
1348
1373
  // For single-turn sessions (Ralph Loop), end the message queue so the SDK
@@ -1366,6 +1391,13 @@ function createSDKBridge(opts) {
1366
1391
  // Route through QueryHandle (works for both in-process and worker paths)
1367
1392
  if (session.queryInstance && typeof session.queryInstance.pushMessage === "function") {
1368
1393
  session.queryInstance.pushMessage(text, images);
1394
+ } else {
1395
+ // lr-b61b: queryInstance is null between turns (finally block has run but
1396
+ // startQuery has not been called yet). Buffer the message so it is not
1397
+ // silently dropped; startQuery will flush it after the handle is created.
1398
+ if (!session.pendingMessages) session.pendingMessages = [];
1399
+ session.pendingMessages.push({ text: text, images: images });
1400
+ console.log("[sdk-bridge] pushMessage: queryInstance null, buffered message for session " + session.localId + " (pending=" + session.pendingMessages.length + ")");
1369
1401
  }
1370
1402
  }
1371
1403
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.1.0",
6
+ "version": "1.1.1-beta.1",
7
7
  "description": "Self-hosted console for Claude Code and Codex. Multi-user, browser-based, persistent AI sessions.",
8
8
  "bin": {
9
9
  "clagentic": "./bin/cli.js",