trantor 0.18.106 → 0.18.107

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.106",
3
+ "version": "0.18.107",
4
4
  "description": "Trantor — the hub-world for AI agent crews: live message bus, presence, project Kanban/flow board + crew orchestration for independent AI coding agents (Claude, Codex, Gemini, Kimi, DeepSeek)",
5
5
  "mcpServers": {
6
6
  "relay": {
@@ -59,6 +59,7 @@ export function contextUsage(transcriptPath, conf = readConfig()) {
59
59
  let model = "";
60
60
  for (const line of lines) {
61
61
  let r; try { r = JSON.parse(line); } catch { continue; }
62
+ if (r?.type === "system" && r?.subtype === "compact_boundary") { rows.push("compact"); continue; }
62
63
  const u = r?.message?.usage;
63
64
  if (r?.type !== "assistant" || !u) continue;
64
65
  const tokens = (u.input_tokens || 0) + (u.cache_read_input_tokens || 0) + (u.cache_creation_input_tokens || 0);
@@ -78,6 +79,8 @@ export function guardContextTokens(rows) {
78
79
  let max = 0;
79
80
  const recent = [];
80
81
  for (const t of rows) {
82
+ // a compaction starts the session over: readings before it say nothing about the window now
83
+ if (t === "compact") { max = 0; recent.length = 0; continue; }
81
84
  if (!t || t <= 0) continue;
82
85
  recent.push(t);
83
86
  if (recent.length > 5) recent.shift();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.106",
3
+ "version": "0.18.107",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "trantor": "bin/cli.mjs"