@saadnvd1/agent-os 0.3.481 → 0.3.483

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.
@@ -91,10 +91,16 @@ export function recordTurn(
91
91
  return totals;
92
92
  }
93
93
 
94
+ // When a compaction ran: "mid_turn" is the agent's own, at its auto-compact
95
+ // window, while it worked; the rest happen between turns.
96
+ export type CompactionPhase = "mid_turn" | "between_turns";
97
+ export const compactionPhase = (trigger: string): CompactionPhase =>
98
+ trigger === "auto" ? "mid_turn" : "between_turns";
99
+
94
100
  // Records one compaction: who ran it ("auto" is the agent's own, at its
95
101
  // auto-compact window; "threshold" and "stale" are AgentOS's before a
96
- // message; "manual" is a /compact someone typed), and the context before
97
- // and after when the agent said.
102
+ // message; "manual" is a /compact someone typed), which phase that was,
103
+ // and the context before and after when the agent said.
98
104
  export function recordCompaction(
99
105
  session: Pick<Session, "id" | "name" | "workspace_id">,
100
106
  c: { trigger: string; before?: number; after?: number },
@@ -106,14 +112,15 @@ export function recordCompaction(
106
112
  | { name: string; workspace_id: string | null }
107
113
  | undefined;
108
114
  db.prepare(
109
- `INSERT INTO chat_compactions (session_id, session_name, workspace_id, at, trigger, before_tokens, after_tokens)
110
- VALUES (?, ?, ?, ?, ?, ?, ?)`
115
+ `INSERT INTO chat_compactions (session_id, session_name, workspace_id, at, trigger, phase, before_tokens, after_tokens)
116
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)`
111
117
  ).run(
112
118
  session.id,
113
119
  current?.name ?? session.name,
114
120
  current?.workspace_id ?? session.workspace_id,
115
121
  at,
116
122
  c.trigger,
123
+ compactionPhase(c.trigger),
117
124
  c.before ?? null,
118
125
  c.after ?? null
119
126
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saadnvd1/agent-os",
3
- "version": "0.3.481",
3
+ "version": "0.3.483",
4
4
  "description": "Self-hosted web UI for managing Claude Code sessions",
5
5
  "bin": {
6
6
  "agent-os": "scripts/agent-os"
@@ -83,7 +83,6 @@
83
83
  "@codemirror/language": "^6.12.3",
84
84
  "@codemirror/state": "^6.6.0",
85
85
  "@codemirror/view": "^6.41.0",
86
- "@legendapp/list": "3.3.11",
87
86
  "@lezer/highlight": "^1.2.3",
88
87
  "@modelcontextprotocol/sdk": "^1.25.2",
89
88
  "@monaco-editor/react": "^4.7.0",