diff --git a/packages/server/src/server/agent/agent-manager.ts b/packages/server/src/server/agent/agent-manager.ts index b88f2abdcc..ed0f5ffa08 100644 --- a/packages/server/src/server/agent/agent-manager.ts +++ b/packages/server/src/server/agent/agent-manager.ts @@ -154,6 +154,21 @@ interface TimeoutOptions { onLateError?: (error: unknown) => void; } +interface ImportProviderSessionInput { + provider: AgentProvider; + providerHandleId: string; + cwd: string; + workspaceId: string; + labels?: Record; + modeId?: string; +} + +interface UnarchiveSnapshotUpdates { + workspaceId?: string; + labels?: AgentLabelPatch; + modeId?: string; +} + function formatProviderList(providers: readonly string[]): string { return providers.length > 0 ? providers.join(", ") : "none"; } @@ -1351,25 +1366,13 @@ export class AgentManager { }); } - importProviderSession(input: { - provider: AgentProvider; - providerHandleId: string; - cwd: string; - workspaceId: string; - labels?: Record; - modeId?: string; - }): Promise { + importProviderSession(input: ImportProviderSessionInput): Promise { return this.trackAgentRegistrationOperation(this.importProviderSessionInternal(input)); } - private async importProviderSessionInternal(input: { - provider: AgentProvider; - providerHandleId: string; - cwd: string; - workspaceId: string; - labels?: Record; - modeId?: string; - }): Promise { + private async importProviderSessionInternal( + input: ImportProviderSessionInput, + ): Promise { this.assertAcceptingAgentRegistrations(); const resolvedAgentId = validateAgentId(this.idFactory(), "importProviderSession"); this.requireEnabledProvider(input.provider); @@ -2144,10 +2147,7 @@ export class AgentManager { return nextRecord; } - async unarchiveSnapshot( - agentId: string, - updates?: { workspaceId?: string; labels?: AgentLabelPatch; modeId?: string }, - ): Promise { + async unarchiveSnapshot(agentId: string, updates?: UnarchiveSnapshotUpdates): Promise { const registry = this.requireRegistry(); const record = await registry.get(agentId); if (!record || !record.archivedAt) {