@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.
- package/README.md +14 -7
- package/app/api/fresh-start/route.ts +3 -1
- package/app/globals.css +7 -0
- package/components/Chat/ChatPanel.tsx +96 -66
- package/components/Chat/Code.tsx +4 -1
- package/components/Chat/Messages.tsx +2 -2
- package/components/Chat/copy-selection.ts +82 -0
- package/components/Chat/stick-to-bottom.test.ts +65 -5
- package/components/Chat/stick-to-bottom.ts +46 -16
- package/components/Chat/timeline-selection.test.ts +146 -0
- package/components/Workspaces/FreshStartForm.tsx +21 -9
- package/lib/chat/compact-context.ts +55 -0
- package/lib/chat/copy-selection.ts +58 -0
- package/lib/chat/driver.ts +4 -0
- package/lib/chat/drivers/claude-approvals.ts +32 -0
- package/lib/chat/drivers/claude.ts +4 -0
- package/lib/chat/refresh.ts +19 -6
- package/lib/chat/stale.ts +5 -4
- package/lib/chat/worker/host.ts +9 -1
- package/lib/chat/working-state.ts +111 -0
- package/lib/db/migrations.ts +13 -0
- package/lib/usage/turns.ts +11 -4
- package/package.json +1 -2
package/lib/usage/turns.ts
CHANGED
|
@@ -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),
|
|
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.
|
|
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",
|