@ducci/jarvis 1.0.80 → 1.0.81

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ducci/jarvis",
3
- "version": "1.0.80",
3
+ "version": "1.0.81",
4
4
  "description": "A fully automated agent system that lives on a server.",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -278,15 +278,19 @@ export async function startTelegramChannel(config) {
278
278
  return;
279
279
  }
280
280
 
281
- const msgCount = Math.max(0, session.messages.length - 1); // exclude system prompt
282
- const estimatedTokens = Math.round(JSON.stringify(session.messages).length / 4);
281
+ const totalMessages = Math.max(0, session.messages.length - 1); // exclude system prompt
282
+ const windowed = session.messages.length <= config.contextWindow + 1
283
+ ? session.messages
284
+ : [session.messages[0], ...session.messages.slice(-config.contextWindow)];
285
+ const inContext = Math.max(0, windowed.length - 1);
286
+ const estimatedTokens = Math.round(JSON.stringify(windowed).length / 4);
283
287
  const model = config.selectedModel || 'unknown';
284
288
  const contextWindow = config.modelContextWindow || lookupContextWindow(model);
285
289
 
286
290
  let lines = [
287
291
  `<b>Context — Slot ${slot}</b>`,
288
292
  `Model: <code>${escapeHtml(model)}</code>`,
289
- `Messages in history: ${msgCount}`,
293
+ `Messages on disk: ${totalMessages} | in context: ${inContext}`,
290
294
  `Estimated tokens: ~${estimatedTokens.toLocaleString()}`,
291
295
  ];
292
296