Update files
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user