tool timeline in sidebar + compact chat tools + scroll fixes
- SessionDigest now includes live tool timeline, plan steps, knowledge - ToolCallGroup compact: single-line with collapsible names only (no JSON) - Activity bar moved to bottom of messages, smart scroll respects user position - setGoal now sets status=executing (removed stuck planning state) - PlanProgress merged into SessionDigest, removed from TaskContextPanel - New toolTimeline derived store in chat.ts
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { writable, get } from 'svelte/store'
|
||||
import { writable, derived, get } from 'svelte/store'
|
||||
import { streamChat, fetchSessions, fetchMessages, deleteSession as apiDeleteSession } from '$lib/api'
|
||||
import type { ChatEvent, Session, Message } from '$lib/api'
|
||||
|
||||
@@ -81,6 +81,36 @@ export function addChatError(message: string, action?: string) {
|
||||
chatErrors.update((e) => [...e, { id: crypto.randomUUID(), message, action }])
|
||||
}
|
||||
|
||||
// ToolTimelineEntry — one tool call from the chat transcript, flattened for
|
||||
// the sidebar activity timeline. Derived from messages in real time.
|
||||
export interface ToolTimelineEntry {
|
||||
id: string
|
||||
name: string
|
||||
args?: any
|
||||
result?: any
|
||||
error?: string
|
||||
type: 'tool_use' | 'tool_result'
|
||||
msgIndex: number // which message this tool belongs to
|
||||
}
|
||||
|
||||
export const toolTimeline = derived(messages, ($msgs) => {
|
||||
const entries: ToolTimelineEntry[] = []
|
||||
for (let i = 0; i < $msgs.length; i++) {
|
||||
for (const t of $msgs[i].tools) {
|
||||
entries.push({
|
||||
id: t.id ?? crypto.randomUUID(),
|
||||
name: t.name,
|
||||
args: t.args,
|
||||
result: t.result,
|
||||
error: t.error,
|
||||
type: t.type,
|
||||
msgIndex: i
|
||||
})
|
||||
}
|
||||
}
|
||||
return entries
|
||||
})
|
||||
|
||||
// Per-session controller tracking. Multiple tasks can stream concurrently
|
||||
// (see sendMessage's session guard above this used to be a single global
|
||||
// `activeController`, which meant cancelStream()/newChat() always aborted
|
||||
|
||||
Reference in New Issue
Block a user