mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-19 17:04:41 +00:00
Add timestamp to messages
This commit is contained in:
parent
ef09efaac9
commit
55dc0b6e08
24 changed files with 388 additions and 220 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import type { AgentState } from "../../agent/agent.js";
|
||||
import { Store } from "../store.js";
|
||||
import type { SessionData, SessionMetadata, StoreConfig } from "../types.js";
|
||||
|
||||
|
|
@ -82,7 +83,12 @@ export class SessionsStore extends Store {
|
|||
}
|
||||
|
||||
// Alias methods for backward compatibility
|
||||
async saveSession(id: string, state: any, metadata: SessionMetadata | undefined, title?: string): Promise<void> {
|
||||
async saveSession(
|
||||
id: string,
|
||||
state: AgentState,
|
||||
metadata: SessionMetadata | undefined,
|
||||
title?: string,
|
||||
): Promise<void> {
|
||||
// If metadata is provided, use it; otherwise create it from state
|
||||
const meta: SessionMetadata = metadata || {
|
||||
id,
|
||||
|
|
@ -90,7 +96,7 @@ export class SessionsStore extends Store {
|
|||
createdAt: new Date().toISOString(),
|
||||
lastModified: new Date().toISOString(),
|
||||
messageCount: state.messages?.length || 0,
|
||||
usage: state.usage || {
|
||||
usage: {
|
||||
input: 0,
|
||||
output: 0,
|
||||
cacheRead: 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue