Update files

This commit is contained in:
Mohamed Boudra
2026-01-28 15:25:12 +07:00
parent 96b211a2cf
commit f7935f9cc1
23 changed files with 1336 additions and 856 deletions
@@ -100,6 +100,7 @@ describe("DaemonClientV2", () => {
isDirty: null,
baseRef: null,
aheadBehind: null,
aheadOfOrigin: null,
hasRemote: false,
remoteUrl: null,
},
@@ -131,7 +132,7 @@ describe("DaemonClientV2", () => {
);
await expect(p3).resolves.toMatchObject({
agentId: "agent-1",
cwd: "/tmp/project",
requestId: request2.message.requestId,
isGit: false,
});
@@ -841,6 +841,31 @@ export class DaemonClientV2 {
await response;
}
async archiveAgent(agentId: string): Promise<{ archivedAt: string }> {
const requestId = this.createRequestId();
const message = SessionInboundMessageSchema.parse({
type: "archive_agent_request",
agentId,
requestId,
});
const response = this.waitFor(
(msg) => {
if (msg.type !== "agent_archived") {
return null;
}
if (msg.payload.requestId !== requestId) {
return null;
}
return msg.payload;
},
10000,
{ skipQueue: true }
);
await this.sendSessionMessageOrThrow(message);
const result = await response;
return { archivedAt: result.archivedAt };
}
listAgents(): AgentSnapshotPayload[] {
return Array.from(this.agentIndex.values());
}