From 1d461a27a713212bb2f033046a71d47d3be21204 Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Tue, 10 Dec 2024 15:58:43 -0700 Subject: [PATCH] fix: retrieve GenAiPlugins too --- src/agent.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/agent.ts b/src/agent.ts index da8552d..83a3b2f 100644 --- a/src/agent.ts +++ b/src/agent.ts @@ -91,6 +91,14 @@ export class Agent implements SfAgent { await Lifecycle.getInstance().emit(AgentCreateLifecycleStages.RetrievingMetadata, {}); + const genAiPluginNames = ( + await this.connection.tooling.query<{ DeveloperName: string }>( + `SELECT DeveloperName FROM GenAiPluginDefinition WHERE DeveloperName LIKE 'p_${plannerId}%'` + ) + ).records; + // more MD types were created in the org, than were in the project when we started + genAiPluginNames.map((r) => cs.add({ fullName: r.DeveloperName, type: 'GenAiPlugin' })); + const retrieve = await cs.retrieve({ usernameOrConnection: this.connection, merge: true,