Improve connection selection and agent hydration reliability

This commit is contained in:
Mohamed Boudra
2026-02-14 11:31:57 +07:00
parent 21f191583f
commit c4bebb97ab
11 changed files with 523 additions and 59 deletions
+1 -17
View File
@@ -1,20 +1,5 @@
import type { AgentTimelineItem, DaemonClient } from '@getpaseo/server'
type TimelineFetchResult = {
entries: Array<{ item: AgentTimelineItem }>
}
type TimelineFetchClient = {
fetchAgentTimeline: (
agentId: string,
options: {
direction: 'tail'
limit: 0
projection: 'projected'
}
) => Promise<TimelineFetchResult>
}
type FetchProjectedTimelineItemsInput = {
client: DaemonClient
agentId: string
@@ -23,8 +8,7 @@ type FetchProjectedTimelineItemsInput = {
export async function fetchProjectedTimelineItems(
input: FetchProjectedTimelineItemsInput
): Promise<AgentTimelineItem[]> {
const timelineClient = input.client as unknown as TimelineFetchClient
const timeline = await timelineClient.fetchAgentTimeline(input.agentId, {
const timeline = await input.client.fetchAgentTimeline(input.agentId, {
direction: 'tail',
limit: 0,
projection: 'projected',