Improve connection selection and agent hydration reliability
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user