Skip to content

Commit ca18446

Browse files
fix: type errors
1 parent 0e9dc13 commit ca18446

File tree

1 file changed

+39
-10
lines changed

1 file changed

+39
-10
lines changed

core/control-plane/client.ts

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,39 @@ export interface RemoteSessionMetadata extends BaseSessionMetadata {
5555
remoteId: string;
5656
}
5757

58+
export interface AgentSessionMetadata {
59+
createdBy: string;
60+
github_repo: string;
61+
organizationId?: string;
62+
idempotencyKey?: string;
63+
source?: string;
64+
continueApiKeyId?: string;
65+
s3Url?: string;
66+
prompt?: string | null;
67+
createdBySlug?: string;
68+
}
69+
70+
export interface AgentSessionView {
71+
id: string;
72+
devboxId: string | null;
73+
name: string | null;
74+
icon: string | null;
75+
status: string;
76+
agentStatus: string | null;
77+
unread: boolean;
78+
state: string;
79+
metadata: AgentSessionMetadata;
80+
repoUrl: string;
81+
branch: string | null;
82+
pullRequestUrl: string | null;
83+
pullRequestStatus: string | null;
84+
tunnelUrl: string | null;
85+
createdAt: string;
86+
updatedAt: string;
87+
create_time_ms: string;
88+
end_time_ms: string;
89+
}
90+
5891
export class ControlPlaneClient {
5992
constructor(
6093
readonly sessionInfoPromise: Promise<ControlPlaneSessionInfo | undefined>,
@@ -546,23 +579,19 @@ export class ControlPlaneClient {
546579
});
547580

548581
const result = (await resp.json()) as {
549-
agents: any[];
582+
agents: AgentSessionView[];
550583
totalCount: number;
551584
};
552585

553586
return {
554-
agents: result.agents.map((agent: any) => ({
587+
agents: result.agents.map((agent) => ({
555588
id: agent.id,
556-
name: agent.name || agent.metadata?.name || null,
589+
name: agent.name,
557590
status: agent.status,
558-
repoUrl: agent.metadata?.repo_url || agent.repo_url || "",
559-
createdAt:
560-
agent.created_at || agent.create_time_ms
561-
? new Date(agent.created_at || agent.create_time_ms).toISOString()
562-
: new Date().toISOString(),
591+
repoUrl: agent.repoUrl,
592+
createdAt: agent.createdAt,
563593
metadata: {
564-
github_repo:
565-
agent.metadata?.github_repo || agent.metadata?.repo_url,
594+
github_repo: agent.metadata.github_repo,
566595
},
567596
})),
568597
totalCount: result.totalCount,

0 commit comments

Comments
 (0)