repoburg 1.3.326 → 1.3.327

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.
@@ -41780,6 +41780,12 @@ function v4(options, buf, offset) {
41780
41780
  }
41781
41781
  var v4_default = v4;
41782
41782
 
41783
+ // ../shared/turn-dividers.ts
41784
+ var TURN_DIVIDER_ITEM_TYPES = ["context_compaction", "peer_message"];
41785
+ function isTurnDivider(type) {
41786
+ return TURN_DIVIDER_ITEM_TYPES.includes(type);
41787
+ }
41788
+
41783
41789
  // src/db/item-summary.ts
41784
41790
  var DEFERRED_ITEM_TYPES = ["command_execution", "mcp_tool_call", "file_change", "web_search", "reasoning"];
41785
41791
  var LIVE_ITEM_LIMIT = 200;
@@ -41827,14 +41833,27 @@ function loadItemSummary(db2, sessionId, upToCreatedAt) {
41827
41833
  ORDER BY created_at ASC`
41828
41834
  ).all(upToCreatedAt === null ? { sessionId } : { sessionId, upToCreatedAt });
41829
41835
  const summary = { rows: [], deferred: /* @__PURE__ */ new Map() };
41836
+ const lastDivider = /* @__PURE__ */ new Map();
41830
41837
  for (const { deferred, ...row } of rows) {
41831
41838
  if (!deferred) {
41832
41839
  summary.rows.push(row);
41840
+ if (isTurnDivider(row.type)) lastDivider.set(row.turn_id, row.id);
41833
41841
  continue;
41834
41842
  }
41835
- const counts = summary.deferred.get(row.turn_id) ?? { items: 0, toolCalls: 0 };
41843
+ const counts = summary.deferred.get(row.turn_id) ?? { items: 0, toolCalls: 0, blocks: [] };
41844
+ const after = lastDivider.get(row.turn_id) ?? null;
41845
+ let block = counts.blocks[counts.blocks.length - 1];
41846
+ if (!block || block.after !== after) {
41847
+ block = { after, items: 0, tool_calls: 0 };
41848
+ counts.blocks.push(block);
41849
+ }
41850
+ const toolCall = row.type !== "reasoning";
41836
41851
  counts.items += 1;
41837
- if (row.type !== "reasoning") counts.toolCalls += 1;
41852
+ block.items += 1;
41853
+ if (toolCall) {
41854
+ counts.toolCalls += 1;
41855
+ block.tool_calls += 1;
41856
+ }
41838
41857
  summary.deferred.set(row.turn_id, counts);
41839
41858
  }
41840
41859
  return summary;
@@ -42194,7 +42213,7 @@ async function registerSessionRoutes(fastify) {
42194
42213
  attachments: row.attachments ? JSON.parse(row.attachments) : null,
42195
42214
  runtime_input_ids: row.runtime_input_ids ? JSON.parse(row.runtime_input_ids) : null,
42196
42215
  items: itemsByTurn.get(row.id) ?? [],
42197
- ...deferred ? { deferred_item_count: deferred.items, deferred_tool_calls: deferred.toolCalls } : {}
42216
+ ...deferred ? { deferred_item_count: deferred.items, deferred_tool_calls: deferred.toolCalls, deferred_blocks: deferred.blocks } : {}
42198
42217
  };
42199
42218
  };
42200
42219
  const mainTurns = turnRows.filter((row) => row.thread_id == null).map(hydrateTurn);
@@ -41763,6 +41763,12 @@ function v4(options, buf, offset) {
41763
41763
  }
41764
41764
  var v4_default = v4;
41765
41765
 
41766
+ // ../shared/turn-dividers.ts
41767
+ var TURN_DIVIDER_ITEM_TYPES = ["context_compaction", "peer_message"];
41768
+ function isTurnDivider(type) {
41769
+ return TURN_DIVIDER_ITEM_TYPES.includes(type);
41770
+ }
41771
+
41766
41772
  // src/db/item-summary.ts
41767
41773
  var DEFERRED_ITEM_TYPES = ["command_execution", "mcp_tool_call", "file_change", "web_search", "reasoning"];
41768
41774
  var LIVE_ITEM_LIMIT = 200;
@@ -41810,14 +41816,27 @@ function loadItemSummary(db2, sessionId, upToCreatedAt) {
41810
41816
  ORDER BY created_at ASC`
41811
41817
  ).all(upToCreatedAt === null ? { sessionId } : { sessionId, upToCreatedAt });
41812
41818
  const summary = { rows: [], deferred: /* @__PURE__ */ new Map() };
41819
+ const lastDivider = /* @__PURE__ */ new Map();
41813
41820
  for (const { deferred, ...row } of rows) {
41814
41821
  if (!deferred) {
41815
41822
  summary.rows.push(row);
41823
+ if (isTurnDivider(row.type)) lastDivider.set(row.turn_id, row.id);
41816
41824
  continue;
41817
41825
  }
41818
- const counts = summary.deferred.get(row.turn_id) ?? { items: 0, toolCalls: 0 };
41826
+ const counts = summary.deferred.get(row.turn_id) ?? { items: 0, toolCalls: 0, blocks: [] };
41827
+ const after = lastDivider.get(row.turn_id) ?? null;
41828
+ let block = counts.blocks[counts.blocks.length - 1];
41829
+ if (!block || block.after !== after) {
41830
+ block = { after, items: 0, tool_calls: 0 };
41831
+ counts.blocks.push(block);
41832
+ }
41833
+ const toolCall = row.type !== "reasoning";
41819
41834
  counts.items += 1;
41820
- if (row.type !== "reasoning") counts.toolCalls += 1;
41835
+ block.items += 1;
41836
+ if (toolCall) {
41837
+ counts.toolCalls += 1;
41838
+ block.tool_calls += 1;
41839
+ }
41821
41840
  summary.deferred.set(row.turn_id, counts);
41822
41841
  }
41823
41842
  return summary;
@@ -42177,7 +42196,7 @@ async function registerSessionRoutes(fastify) {
42177
42196
  attachments: row.attachments ? JSON.parse(row.attachments) : null,
42178
42197
  runtime_input_ids: row.runtime_input_ids ? JSON.parse(row.runtime_input_ids) : null,
42179
42198
  items: itemsByTurn.get(row.id) ?? [],
42180
- ...deferred ? { deferred_item_count: deferred.items, deferred_tool_calls: deferred.toolCalls } : {}
42199
+ ...deferred ? { deferred_item_count: deferred.items, deferred_tool_calls: deferred.toolCalls, deferred_blocks: deferred.blocks } : {}
42181
42200
  };
42182
42201
  };
42183
42202
  const mainTurns = turnRows.filter((row) => row.thread_id == null).map(hydrateTurn);
@@ -1,4 +1,4 @@
1
- var en=Object.defineProperty;var tn=(e,t,i)=>t in e?en(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Ye=(e,t,i)=>tn(e,typeof t!="symbol"?t+"":t,i);import{c as sn,b as rn,u as gi,r as lt,j as Ee,R as nn,X as on}from"./index-7TAUiBlb.js";/**
1
+ var en=Object.defineProperty;var tn=(e,t,i)=>t in e?en(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Ye=(e,t,i)=>tn(e,typeof t!="symbol"?t+"":t,i);import{c as sn,b as rn,u as gi,r as lt,j as Ee,R as nn,X as on}from"./index-Da4RH5fp.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.