Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into cd/deb
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Feb 6, 2025
2 parents 86fd805 + 68c3a4e commit bd67cf8
Show file tree
Hide file tree
Showing 17 changed files with 1,446 additions and 2,422 deletions.
2,199 changes: 459 additions & 1,740 deletions CHANGELOG.md

Large diffs are not rendered by default.

1,343 changes: 670 additions & 673 deletions METADATA_SUPPORT.md

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions src/registry/metadataRegistry.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@
"PublicKeyCertificate": "publickeycertificate",
"PublicKeyCertificateSet": "publickeycertificateset",
"aiEvaluationDefinition": "aievaluationdefinition",
"aiEvaluationTestSet": "aievaluationtestset",
"uaviz": "analyticsvisualization",
"uavizview": "analyticsvizviewdef",
"uawork": "analyticsworkspace"
Expand Down Expand Up @@ -4714,14 +4713,6 @@
"inFolder": false,
"strictDirectoryName": false
},
"aievaluationtestset": {
"id": "aievaluationtestset",
"name": "AiEvaluationTestSet",
"suffix": "aiEvaluationTestSet",
"directoryName": "aiEvaluationTestSets",
"inFolder": false,
"strictDirectoryName": false
},
"analyticsvisualization": {
"id": "analyticsvisualization",
"name": "AnalyticsVisualization",
Expand Down
1 change: 1 addition & 0 deletions src/utils/filePathGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export const filePathsFromMetadataComponent = (
['WaveTemplateBundle', [join(packageDirWithTypeDir, `${fullName}${sep}template-info.json`)]],
['LightningComponentBundle', [join(packageDirWithTypeDir, `${fullName}${sep}${fullName}.js${META_XML_SUFFIX}`)]],
['AuraDefinitionBundle', [join(packageDirWithTypeDir, `${fullName}${sep}${fullName}.cmp${META_XML_SUFFIX}`)]],
['GenAiFunction', [join(packageDirWithTypeDir, `${fullName}${sep}${fullName}.genAiFunction${META_XML_SUFFIX}`)]],
[
'AppFrameworkTemplateBundle',
[
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<GenAiFunction xmlns="http://soap.sforce.com/2006/04/metadata">
<description>Answers questions about company policies and procedures, troubleshooting steps, or product information. For example: “What is your return policy?” “How do I fix an issue?” or “What features does a product have?”</description>
<invocationTarget>knowledgeSearch</invocationTarget>
<invocationTargetType>standardInvocableAction</invocationTargetType>
<isConfirmationRequired>false</isConfirmationRequired>
<masterLabel>CustomKnowledgeAction_1738700253695</masterLabel>
</GenAiFunction>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"required": ["query"],
"unevaluatedProperties": false,
"properties": {
"query": {
"title": "Query",
"description": "Required. A string created by generative AI to be used in the knowledge article search.",
"const": "",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"citationsUrl": {
"title": "Citations Url",
"description": "The URL to use for citations for custom Agents.",
"const": "",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"ragFeatureConfigId": {
"title": "RAG Feature Configuration Id",
"description": "The RAG Feature ID to use for grounding this copilot action invocation.",
"const": "",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"citationsEnabled": {
"title": "Citations Enabled",
"description": "Whether or not citations are enabled.",
"const": false,
"lightning:type": "lightning__booleanType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"mode": {
"title": "The mode to run in.",
"description": "The mode to use (Professor/Smart/Basic). Determines which prompt template to use.",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": false
},
"retrieverMode": {
"title": "The retriever mode to use.",
"description": "The retriever mode to use (Simple/Augmented). Determines whether to do query regeneration",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": false
}
},
"lightning:type": "lightning__objectType"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"unevaluatedProperties": false,
"properties": {
"knowledgeSummary": {
"title": "Knowledge Summary",
"description": "A string formatted as rich text that includes a summary of the information retrieved from the knowledge articles and citations to those articles.",
"lightning:type": "lightning__richTextType",
"lightning:isPII": false,
"copilotAction:isDisplayable": true,
"copilotAction:isUsedByPlanner": true
}
},
"lightning:type": "lightning__objectType"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>force-app</members>
<name>GenAiFunction</name>
</types>
<version>59.0</version>
</Package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<GenAiFunction xmlns="http://soap.sforce.com/2006/04/metadata">
<description>Answers questions about company policies and procedures, troubleshooting steps, or product information. For example: “What is your return policy?” “How do I fix an issue?” or “What features does a product have?”</description>
<invocationTarget>knowledgeSearch</invocationTarget>
<invocationTargetType>standardInvocableAction</invocationTargetType>
<isConfirmationRequired>false</isConfirmationRequired>
<masterLabel>CustomKnowledgeAction_1738700253695</masterLabel>
</GenAiFunction>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"required": ["query"],
"unevaluatedProperties": false,
"properties": {
"query": {
"title": "Query",
"description": "Required. A string created by generative AI to be used in the knowledge article search.",
"const": "",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"citationsUrl": {
"title": "Citations Url",
"description": "The URL to use for citations for custom Agents.",
"const": "",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"ragFeatureConfigId": {
"title": "RAG Feature Configuration Id",
"description": "The RAG Feature ID to use for grounding this copilot action invocation.",
"const": "",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"citationsEnabled": {
"title": "Citations Enabled",
"description": "Whether or not citations are enabled.",
"const": false,
"lightning:type": "lightning__booleanType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"mode": {
"title": "The mode to run in.",
"description": "The mode to use (Professor/Smart/Basic). Determines which prompt template to use.",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": false
},
"retrieverMode": {
"title": "The retriever mode to use.",
"description": "The retriever mode to use (Simple/Augmented). Determines whether to do query regeneration",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": false
}
},
"lightning:type": "lightning__objectType"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"unevaluatedProperties": false,
"properties": {
"knowledgeSummary": {
"title": "Knowledge Summary",
"description": "A string formatted as rich text that includes a summary of the information retrieved from the knowledge articles and citations to those articles.",
"lightning:type": "lightning__richTextType",
"lightning:isPII": false,
"copilotAction:isDisplayable": true,
"copilotAction:isUsedByPlanner": true
}
},
"lightning:type": "lightning__objectType"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<GenAiFunction xmlns="http://soap.sforce.com/2006/04/metadata">
<description>Answers questions about company policies and procedures, troubleshooting steps, or product information. For example: “What is your return policy?” “How do I fix an issue?” or “What features does a product have?”</description>
<invocationTarget>knowledgeSearch</invocationTarget>
<invocationTargetType>standardInvocableAction</invocationTargetType>
<isConfirmationRequired>false</isConfirmationRequired>
<masterLabel>CustomKnowledgeAction_1738700253695</masterLabel>
</GenAiFunction>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"required": ["query"],
"unevaluatedProperties": false,
"properties": {
"query": {
"title": "Query",
"description": "Required. A string created by generative AI to be used in the knowledge article search.",
"const": "",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"citationsUrl": {
"title": "Citations Url",
"description": "The URL to use for citations for custom Agents.",
"const": "",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"ragFeatureConfigId": {
"title": "RAG Feature Configuration Id",
"description": "The RAG Feature ID to use for grounding this copilot action invocation.",
"const": "",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"citationsEnabled": {
"title": "Citations Enabled",
"description": "Whether or not citations are enabled.",
"const": false,
"lightning:type": "lightning__booleanType",
"lightning:isPII": false,
"copilotAction:isUserInput": true
},
"mode": {
"title": "The mode to run in.",
"description": "The mode to use (Professor/Smart/Basic). Determines which prompt template to use.",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": false
},
"retrieverMode": {
"title": "The retriever mode to use.",
"description": "The retriever mode to use (Simple/Augmented). Determines whether to do query regeneration",
"lightning:type": "lightning__textType",
"lightning:isPII": false,
"copilotAction:isUserInput": false
}
},
"lightning:type": "lightning__objectType"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"unevaluatedProperties": false,
"properties": {
"knowledgeSummary": {
"title": "Knowledge Summary",
"description": "A string formatted as rich text that includes a summary of the information retrieved from the knowledge articles and citations to those articles.",
"lightning:type": "lightning__richTextType",
"lightning:isPII": false,
"copilotAction:isDisplayable": true,
"copilotAction:isUsedByPlanner": true
}
},
"lightning:type": "lightning__objectType"
}
9 changes: 9 additions & 0 deletions test/snapshot/sampleProjects/genAiFunctions/sfdx-project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"packageDirectories": [
{
"default": true,
"path": "force-app"
}
],
"sourceApiVersion": "59.0"
}
52 changes: 52 additions & 0 deletions test/snapshot/sampleProjects/genAiFunctions/snapshot.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright (c) 2023, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import * as fs from 'node:fs';
import * as path from 'node:path';
import {
FORCE_APP,
dirsAreIdentical,
fileSnap,
mdapiToSource,
sourceToMdapi,
MDAPI_OUT,
} from '../../helper/conversions';

// we don't want failing tests outputting over each other
/* eslint-disable no-await-in-loop */

describe('genAiFunctions', () => {
const testDir = path.join('test', 'snapshot', 'sampleProjects', 'genAiFunctions');
let sourceFiles: string[];
let mdFiles: string[];

before(async () => {
await fs.promises.mkdir(path.join(testDir, FORCE_APP), { recursive: true });
sourceFiles = await mdapiToSource(testDir);
mdFiles = await sourceToMdapi(testDir);
});
it('verify source files', async () => {
for (const file of sourceFiles) {
await fileSnap(file, testDir);
}
await dirsAreIdentical(
path.join(testDir, FORCE_APP),
path.join(testDir, '__snapshots__', 'verify-source-files.expected', FORCE_APP)
);
});
it('verify md files', async () => {
for (const file of mdFiles) {
await fileSnap(file, testDir);
}
});

after(async () => {
await Promise.all([
fs.promises.rm(path.join(testDir, FORCE_APP), { recursive: true, force: true }),
fs.promises.rm(path.join(testDir, MDAPI_OUT), { recursive: true, force: true }),
]);
});
});
22 changes: 22 additions & 0 deletions test/utils/filePathGenerator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,24 @@ const testData = {
},
],
},
genAiFunction: {
fullName: 'CustomKnowledgeAction_1738700253695',
typeName: 'genAiFunction',
expectedFilePaths: [
getFilePath(
'genAiFunctions/CustomKnowledgeAction_1738700253695/CustomKnowledgeAction_1738700253695.genAiFunction-meta.xml'
),
],
expectedComponents: [
{
name: 'CustomKnowledgeAction_1738700253695',
type: registryAccess.getTypeByName('GenAiFunction'),
xml: getFilePath(
'genAiFunctions/CustomKnowledgeAction_1738700253695/CustomKnowledgeAction_1738700253695.genAiFunction-meta.xml'
),
},
],
},
};

describe('generating virtual tree from component name/type', () => {
Expand Down Expand Up @@ -310,6 +328,10 @@ describe('generating virtual tree from component name/type', () => {
runTest(testData.bundleLwc);
});

it('genAiFunction', () => {
runTest(testData.genAiFunction);
});

it('aura', () => {
runTest(testData.bundleAura);
});
Expand Down

2 comments on commit bd67cf8

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: bd67cf8 Previous: 932992e Ratio
eda-componentSetCreate-linux 232 ms 222 ms 1.05
eda-sourceToMdapi-linux 2058 ms 2051 ms 1.00
eda-sourceToZip-linux 1883 ms 1866 ms 1.01
eda-mdapiToSource-linux 2639 ms 3585 ms 0.74
lotsOfClasses-componentSetCreate-linux 487 ms 480 ms 1.01
lotsOfClasses-sourceToMdapi-linux 3635 ms 3709 ms 0.98
lotsOfClasses-sourceToZip-linux 2984 ms 2916 ms 1.02
lotsOfClasses-mdapiToSource-linux 3535 ms 3487 ms 1.01
lotsOfClassesOneDir-componentSetCreate-linux 835 ms 819 ms 1.02
lotsOfClassesOneDir-sourceToMdapi-linux 6332 ms 6410 ms 0.99
lotsOfClassesOneDir-sourceToZip-linux 5161 ms 5173 ms 1.00
lotsOfClassesOneDir-mdapiToSource-linux 6403 ms 6281 ms 1.02

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: bd67cf8 Previous: 932992e Ratio
eda-componentSetCreate-win32 733 ms 700 ms 1.05
eda-sourceToMdapi-win32 4230 ms 4167 ms 1.02
eda-sourceToZip-win32 3310 ms 3361 ms 0.98
eda-mdapiToSource-win32 6120 ms 5833 ms 1.05
lotsOfClasses-componentSetCreate-win32 1421 ms 1439 ms 0.99
lotsOfClasses-sourceToMdapi-win32 8499 ms 8248 ms 1.03
lotsOfClasses-sourceToZip-win32 5618 ms 5193 ms 1.08
lotsOfClasses-mdapiToSource-win32 8503 ms 8207 ms 1.04
lotsOfClassesOneDir-componentSetCreate-win32 2634 ms 2484 ms 1.06
lotsOfClassesOneDir-sourceToMdapi-win32 15280 ms 14638 ms 1.04
lotsOfClassesOneDir-sourceToZip-win32 9709 ms 9351 ms 1.04
lotsOfClassesOneDir-mdapiToSource-win32 15004 ms 14997 ms 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.