@salesforce/plugin-agent 1.40.5 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +443 -34
- package/lib/commands/agent/adl/create.d.ts +23 -0
- package/lib/commands/agent/adl/create.js +104 -0
- package/lib/commands/agent/adl/create.js.map +1 -0
- package/lib/commands/agent/adl/delete.d.ts +18 -0
- package/lib/commands/agent/adl/delete.js +51 -0
- package/lib/commands/agent/adl/delete.js.map +1 -0
- package/lib/commands/agent/adl/file/add.d.ts +17 -0
- package/lib/commands/agent/adl/file/add.js +59 -0
- package/lib/commands/agent/adl/file/add.js.map +1 -0
- package/lib/commands/agent/adl/file/delete.d.ts +19 -0
- package/lib/commands/agent/adl/file/delete.js +55 -0
- package/lib/commands/agent/adl/file/delete.js.map +1 -0
- package/lib/commands/agent/adl/file/list.d.ts +18 -0
- package/lib/commands/agent/adl/file/list.js +51 -0
- package/lib/commands/agent/adl/file/list.js.map +1 -0
- package/lib/commands/agent/adl/get.d.ts +16 -0
- package/lib/commands/agent/adl/get.js +51 -0
- package/lib/commands/agent/adl/get.js.map +1 -0
- package/lib/commands/agent/adl/list.d.ts +17 -0
- package/lib/commands/agent/adl/list.js +57 -0
- package/lib/commands/agent/adl/list.js.map +1 -0
- package/lib/commands/agent/adl/status.d.ts +16 -0
- package/lib/commands/agent/adl/status.js +57 -0
- package/lib/commands/agent/adl/status.js.map +1 -0
- package/lib/commands/agent/adl/update.d.ts +20 -0
- package/lib/commands/agent/adl/update.js +90 -0
- package/lib/commands/agent/adl/update.js.map +1 -0
- package/lib/commands/agent/adl/upload.d.ts +18 -0
- package/lib/commands/agent/adl/upload.js +73 -0
- package/lib/commands/agent/adl/upload.js.map +1 -0
- package/lib/commands/agent/test/create.d.ts +1 -0
- package/lib/commands/agent/test/create.js +13 -8
- package/lib/commands/agent/test/create.js.map +1 -1
- package/messages/agent.adl.create.md +65 -0
- package/messages/agent.adl.delete.md +21 -0
- package/messages/agent.adl.file.add.md +27 -0
- package/messages/agent.adl.file.delete.md +25 -0
- package/messages/agent.adl.file.list.md +25 -0
- package/messages/agent.adl.get.md +21 -0
- package/messages/agent.adl.list.md +21 -0
- package/messages/agent.adl.status.md +21 -0
- package/messages/agent.adl.update.md +49 -0
- package/messages/agent.adl.upload.md +55 -0
- package/messages/agent.test.create.md +7 -3
- package/oclif.manifest.json +2071 -1100
- package/package.json +15 -5
- package/schemas/agent-adl-create.json +83 -0
- package/schemas/agent-adl-delete.json +19 -0
- package/schemas/agent-adl-file-add.json +25 -0
- package/schemas/agent-adl-file-delete.json +19 -0
- package/schemas/agent-adl-file-list.json +44 -0
- package/schemas/agent-adl-get.json +83 -0
- package/schemas/agent-adl-list.json +44 -0
- package/schemas/agent-adl-status.json +63 -0
- package/schemas/agent-adl-update.json +83 -0
- package/schemas/agent-adl-upload.json +28 -0
- package/schemas/agent-preview-end.json +2 -5
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
17
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
18
|
+
import { AgentDataLibrary } from '@salesforce/agents';
|
|
19
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
|
+
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.adl.status');
|
|
21
|
+
export default class AgentAdlStatus extends SfCommand {
|
|
22
|
+
static summary = messages.getMessage('summary');
|
|
23
|
+
static description = messages.getMessage('description');
|
|
24
|
+
static examples = messages.getMessages('examples');
|
|
25
|
+
static enableJsonFlag = true;
|
|
26
|
+
static state = 'preview';
|
|
27
|
+
static flags = {
|
|
28
|
+
'target-org': Flags.requiredOrg(),
|
|
29
|
+
'api-version': Flags.orgApiVersion(),
|
|
30
|
+
'library-id': Flags.string({
|
|
31
|
+
summary: messages.getMessage('flags.library-id.summary'),
|
|
32
|
+
char: 'i',
|
|
33
|
+
required: true,
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
async run() {
|
|
37
|
+
const { flags } = await this.parse(AgentAdlStatus);
|
|
38
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
39
|
+
let result;
|
|
40
|
+
try {
|
|
41
|
+
result = await AgentDataLibrary.status(connection, flags['library-id']);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const wrapped = SfError.wrap(error);
|
|
45
|
+
throw new SfError(messages.getMessage('error.statusFailed', [wrapped.message]), 'StatusFailed', [], 4, wrapped);
|
|
46
|
+
}
|
|
47
|
+
const { indexingStatus } = result;
|
|
48
|
+
this.log(`Library ${indexingStatus.libraryId}: ${indexingStatus.status}`);
|
|
49
|
+
if (indexingStatus.stageDetails) {
|
|
50
|
+
for (const stage of indexingStatus.stageDetails) {
|
|
51
|
+
this.log(` ${stage.name}: ${stage.status}${stage.error ? ` (${stage.error})` : ''}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../src/commands/agent/adl/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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C;QACnC,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;QAC1E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpC,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QAClH,CAAC;QAED,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;QAClC,IAAI,CAAC,GAAG,CAAC,WAAW,cAAc,CAAC,SAAS,KAAK,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1E,IAAI,cAAc,CAAC,YAAY,EAAE,CAAC;YAChC,KAAK,MAAM,KAAK,IAAI,cAAc,CAAC,YAAY,EAAE,CAAC;gBAChD,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACxF,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type DataLibraryDetail } from '@salesforce/agents';
|
|
3
|
+
export type AgentAdlUpdateResult = DataLibraryDetail;
|
|
4
|
+
export default class AgentAdlUpdate extends SfCommand<AgentAdlUpdateResult> {
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly enableJsonFlag = true;
|
|
9
|
+
static readonly state = "preview";
|
|
10
|
+
static readonly flags: {
|
|
11
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'library-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'content-fields': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'restrict-to-public-articles': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<AgentAdlUpdateResult>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
17
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
18
|
+
import { AgentDataLibrary } from '@salesforce/agents';
|
|
19
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
|
+
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.adl.update');
|
|
21
|
+
export default class AgentAdlUpdate extends SfCommand {
|
|
22
|
+
static summary = messages.getMessage('summary');
|
|
23
|
+
static description = messages.getMessage('description');
|
|
24
|
+
static examples = messages.getMessages('examples');
|
|
25
|
+
static enableJsonFlag = true;
|
|
26
|
+
static state = 'preview';
|
|
27
|
+
static flags = {
|
|
28
|
+
'target-org': Flags.requiredOrg(),
|
|
29
|
+
'api-version': Flags.orgApiVersion(),
|
|
30
|
+
'library-id': Flags.string({
|
|
31
|
+
summary: messages.getMessage('flags.library-id.summary'),
|
|
32
|
+
char: 'i',
|
|
33
|
+
required: true,
|
|
34
|
+
}),
|
|
35
|
+
name: Flags.string({
|
|
36
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
37
|
+
char: 'n',
|
|
38
|
+
}),
|
|
39
|
+
description: Flags.string({
|
|
40
|
+
summary: messages.getMessage('flags.description.summary'),
|
|
41
|
+
}),
|
|
42
|
+
'content-fields': Flags.string({
|
|
43
|
+
summary: messages.getMessage('flags.content-fields.summary'),
|
|
44
|
+
}),
|
|
45
|
+
'restrict-to-public-articles': Flags.boolean({
|
|
46
|
+
summary: messages.getMessage('flags.restrict-to-public-articles.summary'),
|
|
47
|
+
allowNo: true,
|
|
48
|
+
}),
|
|
49
|
+
};
|
|
50
|
+
async run() {
|
|
51
|
+
const { flags } = await this.parse(AgentAdlUpdate);
|
|
52
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
53
|
+
const input = {};
|
|
54
|
+
if (flags.name)
|
|
55
|
+
input.masterLabel = flags.name;
|
|
56
|
+
if (flags.description)
|
|
57
|
+
input.description = flags.description;
|
|
58
|
+
const hasKnowledgeFlags = flags['content-fields'] !== undefined || flags['restrict-to-public-articles'] !== undefined;
|
|
59
|
+
if (hasKnowledgeFlags) {
|
|
60
|
+
const detail = await AgentDataLibrary.get(connection, flags['library-id']);
|
|
61
|
+
if (detail.sourceType !== 'KNOWLEDGE') {
|
|
62
|
+
this.warn('--content-fields and --restrict-to-public-articles are only valid for KNOWLEDGE libraries. Ignoring.');
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
const knowledgeConfig = {};
|
|
66
|
+
if (flags['content-fields'] !== undefined) {
|
|
67
|
+
knowledgeConfig.contentFields = flags['content-fields'].split(',').map((f) => f.trim());
|
|
68
|
+
}
|
|
69
|
+
if (flags['restrict-to-public-articles'] !== undefined) {
|
|
70
|
+
knowledgeConfig.isRestrictToPublicArticle = flags['restrict-to-public-articles'];
|
|
71
|
+
}
|
|
72
|
+
input.groundingSource = {
|
|
73
|
+
sourceType: 'KNOWLEDGE',
|
|
74
|
+
knowledgeConfig,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
let result;
|
|
79
|
+
try {
|
|
80
|
+
result = await AgentDataLibrary.update(connection, flags['library-id'], input);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
const wrapped = SfError.wrap(error);
|
|
84
|
+
throw new SfError(messages.getMessage('error.updateFailed', [wrapped.message]), 'UpdateFailed', [], 4, wrapped);
|
|
85
|
+
}
|
|
86
|
+
this.log(`Updated data library "${result.masterLabel}" (${result.libraryId}).`);
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/agent/adl/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,QA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,CAAC,yBAAyB,GAAG,KAAK,CAAC,6BAA6B,CAAC,CAAC;gBACnF,CAAC;gBACD,KAAK,CAAC,eAAe,GAAG;oBACtB,UAAU,EAAE,WAAW;oBACvB,eAAe;iBAChB,CAAC;YACJ,CAAC;QACH,CAAC;QAED,IAAI,MAAyB,CAAC;QAC9B,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC;QACjF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpC,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QAClH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,yBAAyB,MAAM,CAAC,WAAW,MAAM,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC;QAChF,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type UploadResult } from '@salesforce/agents';
|
|
3
|
+
export type AgentAdlUploadResult = UploadResult;
|
|
4
|
+
export default class AgentAdlUpload extends SfCommand<AgentAdlUploadResult> {
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly enableJsonFlag = true;
|
|
9
|
+
static readonly state = "preview";
|
|
10
|
+
static readonly flags: {
|
|
11
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'library-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
file: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
wait: import("@oclif/core/interfaces").OptionFlag<import("@salesforce/kit").Duration, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<AgentAdlUploadResult>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
17
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
18
|
+
import { AgentDataLibrary } from '@salesforce/agents';
|
|
19
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
|
+
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.adl.upload');
|
|
21
|
+
export default class AgentAdlUpload extends SfCommand {
|
|
22
|
+
static summary = messages.getMessage('summary');
|
|
23
|
+
static description = messages.getMessage('description');
|
|
24
|
+
static examples = messages.getMessages('examples');
|
|
25
|
+
static enableJsonFlag = true;
|
|
26
|
+
static state = 'preview';
|
|
27
|
+
static flags = {
|
|
28
|
+
'target-org': Flags.requiredOrg(),
|
|
29
|
+
'api-version': Flags.orgApiVersion(),
|
|
30
|
+
'library-id': Flags.string({
|
|
31
|
+
summary: messages.getMessage('flags.library-id.summary'),
|
|
32
|
+
char: 'i',
|
|
33
|
+
required: true,
|
|
34
|
+
}),
|
|
35
|
+
file: Flags.file({
|
|
36
|
+
summary: messages.getMessage('flags.file.summary'),
|
|
37
|
+
char: 'f',
|
|
38
|
+
required: true,
|
|
39
|
+
exists: true,
|
|
40
|
+
}),
|
|
41
|
+
// eslint-disable-next-line sf-plugin/flag-min-max-default
|
|
42
|
+
wait: Flags.duration({
|
|
43
|
+
char: 'w',
|
|
44
|
+
unit: 'minutes',
|
|
45
|
+
min: 1,
|
|
46
|
+
summary: messages.getMessage('flags.wait.summary'),
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
async run() {
|
|
50
|
+
const { flags } = await this.parse(AgentAdlUpload);
|
|
51
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
52
|
+
const libraryId = flags['library-id'];
|
|
53
|
+
const filePath = flags.file;
|
|
54
|
+
let result;
|
|
55
|
+
try {
|
|
56
|
+
result = await AgentDataLibrary.upload(connection, libraryId, filePath, {
|
|
57
|
+
waitMinutes: flags.wait?.minutes,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
const wrapped = SfError.wrap(error);
|
|
62
|
+
throw new SfError(wrapped.message, wrapped.name ?? 'UploadFailed', [], 4, wrapped);
|
|
63
|
+
}
|
|
64
|
+
if (result.status === 'READY') {
|
|
65
|
+
this.log(`Library ready. retrieverId: ${String(result.retrieverId)}`);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.log('Indexing triggered. Use "sf agent adl get" to check readiness.');
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=upload.js.map
|
|
@@ -0,0 +1 @@
|
|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,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -16,6 +16,7 @@ export default class AgentTestCreate extends SfCommand<AgentTestCreateResult> {
|
|
|
16
16
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
17
|
preview: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
18
|
'force-overwrite': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
'test-runner': import("@oclif/core/interfaces").OptionFlag<"agentforce-studio" | "testing-center" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
20
|
"api-name": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
21
|
spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
22
|
};
|
|
@@ -19,7 +19,7 @@ import { SfCommand, Flags, toHelpSection } from '@salesforce/sf-plugins-core';
|
|
|
19
19
|
import { Lifecycle, Messages, SfError, EnvironmentVariable } from '@salesforce/core';
|
|
20
20
|
import { AgentTest, AgentTestCreateLifecycleStages } from '@salesforce/agents';
|
|
21
21
|
import { MultiStageOutput } from '@oclif/multi-stage-output';
|
|
22
|
-
import { makeFlags, promptForFlag, promptForYamlFile } from '../../../flags.js';
|
|
22
|
+
import { makeFlags, promptForFlag, promptForYamlFile, testRunnerFlag } from '../../../flags.js';
|
|
23
23
|
import yesNoOrCancel from '../../../yes-no-cancel.js';
|
|
24
24
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
25
25
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.test.create');
|
|
@@ -91,6 +91,7 @@ export default class AgentTestCreate extends SfCommand {
|
|
|
91
91
|
'force-overwrite': Flags.boolean({
|
|
92
92
|
summary: messages.getMessage('flags.force-overwrite.summary'),
|
|
93
93
|
}),
|
|
94
|
+
'test-runner': testRunnerFlag,
|
|
94
95
|
};
|
|
95
96
|
mso;
|
|
96
97
|
async run() {
|
|
@@ -142,29 +143,33 @@ export default class AgentTestCreate extends SfCommand {
|
|
|
142
143
|
}
|
|
143
144
|
return Promise.resolve();
|
|
144
145
|
});
|
|
146
|
+
const testRunner = flags['test-runner'];
|
|
147
|
+
const outputDirName = testRunner === 'agentforce-studio' ? 'aiTestingDefinitions' : 'aiEvaluationDefinitions';
|
|
145
148
|
let path;
|
|
146
149
|
let contents;
|
|
147
150
|
try {
|
|
148
151
|
const result = await AgentTest.create(connection, apiName, spec, {
|
|
149
|
-
outputDir: join('force-app', 'main', 'default',
|
|
152
|
+
outputDir: join('force-app', 'main', 'default', outputDirName),
|
|
150
153
|
preview: flags.preview,
|
|
154
|
+
testRunner,
|
|
151
155
|
});
|
|
152
156
|
path = result.path;
|
|
153
157
|
contents = result.contents;
|
|
154
158
|
}
|
|
155
159
|
catch (error) {
|
|
156
160
|
const wrapped = SfError.wrap(error);
|
|
157
|
-
|
|
158
|
-
if (wrapped.message.toLowerCase().includes('not found') ||
|
|
159
|
-
wrapped.message.toLowerCase().includes('enoent') ||
|
|
160
|
-
wrapped.code === 'ENOENT') {
|
|
161
|
+
if (wrapped.code === 'ENOENT' || wrapped.name === 'ENOENT') {
|
|
161
162
|
throw new SfError(`Test spec file not found: ${spec}`, 'SpecFileNotFound', [], 2, wrapped);
|
|
162
163
|
}
|
|
163
|
-
//
|
|
164
|
+
// NGT validateNgtSpec errors are user-fixable spec issues — exit 1, not deploy/network.
|
|
165
|
+
if (wrapped.name?.startsWith('ngt')) {
|
|
166
|
+
throw wrapped;
|
|
167
|
+
}
|
|
168
|
+
// Deploy failures from the lib are bare SfErrors with the componentFailures text as message
|
|
169
|
+
// and no structured code, so message substring is the only available signal.
|
|
164
170
|
if (wrapped.message.toLowerCase().includes('deploy') || wrapped.message.toLowerCase().includes('api')) {
|
|
165
171
|
throw new SfError(`Deployment failed: ${wrapped.message}`, 'DeploymentFailed', [wrapped.message], 4, wrapped);
|
|
166
172
|
}
|
|
167
|
-
// Other errors (validation, format issues) use exit 1
|
|
168
173
|
throw wrapped;
|
|
169
174
|
}
|
|
170
175
|
if (flags.preview) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAc,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAc,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO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AAC;IACJ,CAAC;IAES,KAAK,CAAC,KAAiC;QAC/C,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Create an Agentforce Data Library.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Creates a new data library in the target org. The --source-type flag determines the type of library: SFDRIVE (file upload), KNOWLEDGE (Salesforce Knowledge articles), or RETRIEVER (existing active Custom Retriever).
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- Create an SFDRIVE library:
|
|
12
|
+
|
|
13
|
+
<%= config.bin %> <%= command.id %> --target-org myOrg --name "My Docs" --developer-name My_Docs --source-type sfdrive
|
|
14
|
+
|
|
15
|
+
- Create a KNOWLEDGE library with index fields:
|
|
16
|
+
|
|
17
|
+
<%= config.bin %> <%= command.id %> --target-org myOrg --name "KB Library" --developer-name KB_Library --source-type knowledge --primary-index-field1 Title --primary-index-field2 Summary
|
|
18
|
+
|
|
19
|
+
- Create a RETRIEVER library:
|
|
20
|
+
|
|
21
|
+
<%= config.bin %> <%= command.id %> --target-org myOrg --name "Existing Retriever" --developer-name Existing_Retriever --source-type retriever --retriever-id 0ppXX0000000001
|
|
22
|
+
|
|
23
|
+
# flags.name.summary
|
|
24
|
+
|
|
25
|
+
Display name for the data library (max 80 characters).
|
|
26
|
+
|
|
27
|
+
# flags.developer-name.summary
|
|
28
|
+
|
|
29
|
+
API name for the data library (max 80 characters, alphanumeric and underscores only, must start with a letter).
|
|
30
|
+
|
|
31
|
+
# flags.source-type.summary
|
|
32
|
+
|
|
33
|
+
Type of grounding source: sfdrive (file upload), knowledge (Salesforce Knowledge articles), or retriever (existing active Custom Retriever).
|
|
34
|
+
|
|
35
|
+
# flags.description.summary
|
|
36
|
+
|
|
37
|
+
Description of the data library (max 255 characters).
|
|
38
|
+
|
|
39
|
+
# flags.index-mode.summary
|
|
40
|
+
|
|
41
|
+
Index mode for SFDRIVE libraries: basic or enhanced.
|
|
42
|
+
|
|
43
|
+
# flags.retriever-id.summary
|
|
44
|
+
|
|
45
|
+
ID of an active Custom Retriever (required for RETRIEVER source type; retriever must be active).
|
|
46
|
+
|
|
47
|
+
# flags.primary-index-field1.summary
|
|
48
|
+
|
|
49
|
+
Primary index field 1 for KNOWLEDGE libraries (required, immutable after creation).
|
|
50
|
+
|
|
51
|
+
# flags.primary-index-field2.summary
|
|
52
|
+
|
|
53
|
+
Primary index field 2 for KNOWLEDGE libraries (required, immutable after creation).
|
|
54
|
+
|
|
55
|
+
# error.createFailed
|
|
56
|
+
|
|
57
|
+
Failed to create data library: %s
|
|
58
|
+
|
|
59
|
+
# error.missingKnowledgeFields
|
|
60
|
+
|
|
61
|
+
KNOWLEDGE source type requires --primary-index-field1 and --primary-index-field2.
|
|
62
|
+
|
|
63
|
+
# error.missingRetrieverId
|
|
64
|
+
|
|
65
|
+
RETRIEVER source type requires --retriever-id.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Delete an Agentforce Data Library.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Permanently deletes a data library and all associated files and indexing data.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- Delete a data library:
|
|
12
|
+
|
|
13
|
+
<%= config.bin %> <%= command.id %> --library-id 1JDSG000007IbWX4A0 --target-org myOrg
|
|
14
|
+
|
|
15
|
+
# flags.library-id.summary
|
|
16
|
+
|
|
17
|
+
Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
|
|
18
|
+
|
|
19
|
+
# error.deleteFailed
|
|
20
|
+
|
|
21
|
+
Failed to delete data library: %s
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Add files to an existing Agentforce Data Library.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Adds one or more files to an existing SFDRIVE data library and triggers SearchIndex re-hydration. This is the day-2 operation for adding files to an already-provisioned library.
|
|
8
|
+
|
|
9
|
+
Constraints: at least 1 file required, no duplicate file names in a batch, maximum 1000 files per library.
|
|
10
|
+
|
|
11
|
+
# examples
|
|
12
|
+
|
|
13
|
+
- Add a file to an existing library:
|
|
14
|
+
|
|
15
|
+
<%= config.bin %> <%= command.id %> --library-id 1JDSG000007IbWX4A0 --file ./docs/new-guide.pdf --target-org myOrg
|
|
16
|
+
|
|
17
|
+
# flags.library-id.summary
|
|
18
|
+
|
|
19
|
+
Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
|
|
20
|
+
|
|
21
|
+
# flags.file.summary
|
|
22
|
+
|
|
23
|
+
Path to the file to add to the library.
|
|
24
|
+
|
|
25
|
+
# error.addFailed
|
|
26
|
+
|
|
27
|
+
Failed to add file: %s
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Delete a file from an Agentforce Data Library.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Permanently removes a file from an SFDRIVE data library and triggers re-indexing of the search index.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- Delete a file from a data library:
|
|
12
|
+
|
|
13
|
+
<%= config.bin %> <%= command.id %> --library-id 1JDSG000007IbWX4A0 --file-id a1B2C3D4E5F6G7H8I9 --target-org myOrg
|
|
14
|
+
|
|
15
|
+
# flags.library-id.summary
|
|
16
|
+
|
|
17
|
+
Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
|
|
18
|
+
|
|
19
|
+
# flags.file-id.summary
|
|
20
|
+
|
|
21
|
+
ID of the file to delete (AiGroundingFileRef record ID).
|
|
22
|
+
|
|
23
|
+
# error.deleteFailed
|
|
24
|
+
|
|
25
|
+
Failed to delete file: %s
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
List files in an Agentforce Data Library.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Returns the list of files in an SFDRIVE library including file name, size, and creation date.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- List files in a data library:
|
|
12
|
+
|
|
13
|
+
<%= config.bin %> <%= command.id %> --library-id 1JDSG000007IbWX4A0 --target-org myOrg
|
|
14
|
+
|
|
15
|
+
- List files and output as JSON:
|
|
16
|
+
|
|
17
|
+
<%= config.bin %> <%= command.id %> --library-id 1JDSG000007IbWX4A0 --target-org myOrg --json
|
|
18
|
+
|
|
19
|
+
# flags.library-id.summary
|
|
20
|
+
|
|
21
|
+
Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
|
|
22
|
+
|
|
23
|
+
# error.listFailed
|
|
24
|
+
|
|
25
|
+
Failed to list files: %s
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Get details of an Agentforce Data Library.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Returns the full detail of a data library including its grounding source configuration, status, and retriever ID.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- Get details of a data library:
|
|
12
|
+
|
|
13
|
+
<%= config.bin %> <%= command.id %> --library-id 1JDSG000007IbWX4A0 --target-org myOrg
|
|
14
|
+
|
|
15
|
+
# flags.library-id.summary
|
|
16
|
+
|
|
17
|
+
Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
|
|
18
|
+
|
|
19
|
+
# error.getFailed
|
|
20
|
+
|
|
21
|
+
Failed to get data library: %s
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
List Agentforce Data Libraries in an org.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Returns all data libraries in the target org, including their source type, status, and library ID.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- List all data libraries in the default target org:
|
|
12
|
+
|
|
13
|
+
<%= config.bin %> <%= command.id %> --target-org myOrg
|
|
14
|
+
|
|
15
|
+
- List data libraries and output as JSON:
|
|
16
|
+
|
|
17
|
+
<%= config.bin %> <%= command.id %> --target-org myOrg --json
|
|
18
|
+
|
|
19
|
+
# error.listFailed
|
|
20
|
+
|
|
21
|
+
Failed to list data libraries: %s
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Get indexing status of an Agentforce Data Library.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Returns the current indexing status including stage details (DATA_LAKE_OBJECT, SEARCH_INDEX, RETRIEVER) and any errors.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- Get status of a data library:
|
|
12
|
+
|
|
13
|
+
<%= config.bin %> <%= command.id %> --library-id 1JDSG000007IbWX4A0 --target-org myOrg
|
|
14
|
+
|
|
15
|
+
# flags.library-id.summary
|
|
16
|
+
|
|
17
|
+
Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
|
|
18
|
+
|
|
19
|
+
# error.statusFailed
|
|
20
|
+
|
|
21
|
+
Failed to get data library status: %s
|