@salesforce/plugin-agent 1.43.0 → 1.44.4
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 +78 -46
- package/lib/adlUtils.d.ts +2 -0
- package/lib/adlUtils.js +31 -0
- package/lib/adlUtils.js.map +1 -0
- package/lib/commands/agent/adl/create.d.ts +6 -1
- package/lib/commands/agent/adl/create.js +83 -19
- package/lib/commands/agent/adl/create.js.map +1 -1
- package/lib/commands/agent/adl/delete.d.ts +0 -1
- package/lib/commands/agent/adl/delete.js +3 -2
- package/lib/commands/agent/adl/delete.js.map +1 -1
- package/lib/commands/agent/adl/file/add.d.ts +0 -1
- package/lib/commands/agent/adl/file/add.js +3 -2
- package/lib/commands/agent/adl/file/add.js.map +1 -1
- package/lib/commands/agent/adl/file/delete.d.ts +0 -1
- package/lib/commands/agent/adl/file/delete.js +4 -3
- package/lib/commands/agent/adl/file/delete.js.map +1 -1
- package/lib/commands/agent/adl/file/list.d.ts +5 -5
- package/lib/commands/agent/adl/file/list.js +31 -7
- package/lib/commands/agent/adl/file/list.js.map +1 -1
- package/lib/commands/agent/adl/get.d.ts +0 -1
- package/lib/commands/agent/adl/get.js +15 -3
- package/lib/commands/agent/adl/get.js.map +1 -1
- package/lib/commands/agent/adl/list.d.ts +0 -1
- package/lib/commands/agent/adl/list.js +3 -2
- package/lib/commands/agent/adl/list.js.map +1 -1
- package/lib/commands/agent/adl/status.d.ts +1 -1
- package/lib/commands/agent/adl/status.js +21 -4
- package/lib/commands/agent/adl/status.js.map +1 -1
- package/lib/commands/agent/adl/update.d.ts +1 -1
- package/lib/commands/agent/adl/update.js +18 -5
- package/lib/commands/agent/adl/update.js.map +1 -1
- package/lib/commands/agent/adl/upload.d.ts +0 -1
- package/lib/commands/agent/adl/upload.js +3 -2
- package/lib/commands/agent/adl/upload.js.map +1 -1
- package/messages/agent.adl.create.md +22 -0
- package/messages/agent.adl.file.add.md +2 -0
- package/messages/agent.adl.file.delete.md +4 -0
- package/messages/agent.adl.file.list.md +12 -0
- package/messages/agent.adl.status.md +5 -1
- package/messages/agent.adl.update.md +4 -0
- package/messages/agent.adl.upload.md +2 -0
- package/oclif.manifest.json +635 -573
- package/package.json +4 -4
- package/schemas/agent-adl-create.json +63 -3
- package/schemas/agent-adl-delete.json +5 -2
- package/schemas/agent-adl-file-add.json +7 -2
- package/schemas/agent-adl-file-delete.json +5 -2
- package/schemas/agent-adl-file-list.json +26 -3
- package/schemas/agent-adl-get.json +63 -3
- package/schemas/agent-adl-list.json +55 -3
- package/schemas/agent-adl-status.json +44 -4
- package/schemas/agent-adl-update.json +63 -3
- package/schemas/agent-adl-upload.json +5 -2
- package/schemas/agent-preview-end.json +8 -3
- package/schemas/agent-publish-authoring__bundle.json +8 -3
- package/schemas/agent-trace-delete.json +7 -2
- package/schemas/agent-trace-list.json +9 -2
- package/schemas/agent-trace-read.json +131 -21
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
17
17
|
import { Messages, SfError } from '@salesforce/core';
|
|
18
18
|
import { AgentDataLibrary } from '@salesforce/agents';
|
|
19
|
+
import { extractApiError } from '../../../adlUtils.js';
|
|
19
20
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
21
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.adl.status');
|
|
21
22
|
export default class AgentAdlStatus extends SfCommand {
|
|
@@ -23,7 +24,6 @@ export default class AgentAdlStatus extends SfCommand {
|
|
|
23
24
|
static description = messages.getMessage('description');
|
|
24
25
|
static examples = messages.getMessages('examples');
|
|
25
26
|
static enableJsonFlag = true;
|
|
26
|
-
static state = 'preview';
|
|
27
27
|
static flags = {
|
|
28
28
|
'target-org': Flags.requiredOrg(),
|
|
29
29
|
'api-version': Flags.orgApiVersion(),
|
|
@@ -32,23 +32,40 @@ export default class AgentAdlStatus extends SfCommand {
|
|
|
32
32
|
char: 'i',
|
|
33
33
|
required: true,
|
|
34
34
|
}),
|
|
35
|
+
'include-artifacts': Flags.boolean({
|
|
36
|
+
summary: messages.getMessage('flags.include-artifacts.summary'),
|
|
37
|
+
default: false,
|
|
38
|
+
}),
|
|
35
39
|
};
|
|
36
40
|
async run() {
|
|
37
41
|
const { flags } = await this.parse(AgentAdlStatus);
|
|
38
42
|
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
39
43
|
let result;
|
|
40
44
|
try {
|
|
41
|
-
result = await AgentDataLibrary.status(connection, flags['library-id']
|
|
45
|
+
result = await AgentDataLibrary.status(connection, flags['library-id'], {
|
|
46
|
+
includeArtifacts: flags['include-artifacts'],
|
|
47
|
+
});
|
|
42
48
|
}
|
|
43
49
|
catch (error) {
|
|
44
50
|
const wrapped = SfError.wrap(error);
|
|
45
|
-
|
|
51
|
+
const cleanMessage = extractApiError(wrapped) ?? wrapped.message;
|
|
52
|
+
throw new SfError(messages.getMessage('error.statusFailed', [cleanMessage]), 'StatusFailed', [], 4, wrapped);
|
|
46
53
|
}
|
|
47
54
|
const { indexingStatus } = result;
|
|
48
55
|
this.log(`Library ${indexingStatus.libraryId}: ${indexingStatus.status}`);
|
|
49
56
|
if (indexingStatus.stageDetails) {
|
|
50
57
|
for (const stage of indexingStatus.stageDetails) {
|
|
51
|
-
|
|
58
|
+
let line = ` ${stage.name}: ${stage.status}`;
|
|
59
|
+
if (stage.errorCode)
|
|
60
|
+
line += ` [${stage.errorCode}]`;
|
|
61
|
+
if (stage.error)
|
|
62
|
+
line += ` (${stage.error})`;
|
|
63
|
+
this.log(line);
|
|
64
|
+
if (stage.artifacts?.length) {
|
|
65
|
+
for (const artifact of stage.artifacts) {
|
|
66
|
+
this.log(` → ${artifact.assetType}: ${artifact.label} (${artifact.id})`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
52
69
|
}
|
|
53
70
|
}
|
|
54
71
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../src/commands/agent/adl/status.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,EAA+B,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../src/commands/agent/adl/status.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,EAA+B,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;AAIvF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,SAA+B;IAClE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,cAAc,GAAG,IAAI,CAAC;IAEtC,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,KAAK,CAAC,WAAW,EAAE;QACjC,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE;QACpC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC;Y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KAAK,IAAI,cAAc,CAAC,YAAY,EAAE,CAAC;gBAChD,IAAI,IAAI,GAAG,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;gBAC9C,IAAI,KAAK,CAAC,SAAS;oBAAE,IAAI,IAAI,KAAK,KAAK,CAAC,SAAS,GAAG,CAAC;gBACrD,IAAI,KAAK,CAAC,KAAK;oBAAE,IAAI,IAAI,KAAK,KAAK,CAAC,KAAK,GAAG,CAAC;gBAC7C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACf,IAAI,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;oBAC5B,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;wBACvC,IAAI,CAAC,GAAG,CAAC,SAAS,QAAQ,CAAC,SAAS,KAAK,QAAQ,CAAC,KAAK,KAAK,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;oBAC9E,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -6,7 +6,6 @@ export default class AgentAdlUpdate extends SfCommand<AgentAdlUpdateResult> {
|
|
|
6
6
|
static readonly description: string;
|
|
7
7
|
static readonly examples: string[];
|
|
8
8
|
static readonly enableJsonFlag = true;
|
|
9
|
-
static readonly state = "preview";
|
|
10
9
|
static readonly flags: {
|
|
11
10
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
11
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -15,6 +14,7 @@ export default class AgentAdlUpdate extends SfCommand<AgentAdlUpdateResult> {
|
|
|
15
14
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
15
|
'content-fields': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
16
|
'restrict-to-public-articles': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
'data-category-rule': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
18
|
'retriever-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
19
|
};
|
|
20
20
|
run(): Promise<AgentAdlUpdateResult>;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
17
17
|
import { Messages, SfError } from '@salesforce/core';
|
|
18
18
|
import { AgentDataLibrary } from '@salesforce/agents';
|
|
19
|
+
import { extractApiError } from '../../../adlUtils.js';
|
|
19
20
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
21
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.adl.update');
|
|
21
22
|
export default class AgentAdlUpdate extends SfCommand {
|
|
@@ -23,7 +24,6 @@ export default class AgentAdlUpdate extends SfCommand {
|
|
|
23
24
|
static description = messages.getMessage('description');
|
|
24
25
|
static examples = messages.getMessages('examples');
|
|
25
26
|
static enableJsonFlag = true;
|
|
26
|
-
static state = 'preview';
|
|
27
27
|
static flags = {
|
|
28
28
|
'target-org': Flags.requiredOrg(),
|
|
29
29
|
'api-version': Flags.orgApiVersion(),
|
|
@@ -46,6 +46,10 @@ export default class AgentAdlUpdate extends SfCommand {
|
|
|
46
46
|
summary: messages.getMessage('flags.restrict-to-public-articles.summary'),
|
|
47
47
|
allowNo: true,
|
|
48
48
|
}),
|
|
49
|
+
'data-category-rule': Flags.boolean({
|
|
50
|
+
summary: messages.getMessage('flags.data-category-rule.summary'),
|
|
51
|
+
allowNo: true,
|
|
52
|
+
}),
|
|
49
53
|
'retriever-id': Flags.string({
|
|
50
54
|
summary: messages.getMessage('flags.retriever-id.summary'),
|
|
51
55
|
}),
|
|
@@ -58,20 +62,28 @@ export default class AgentAdlUpdate extends SfCommand {
|
|
|
58
62
|
input.masterLabel = flags.name;
|
|
59
63
|
if (flags.description)
|
|
60
64
|
input.description = flags.description;
|
|
61
|
-
const hasKnowledgeFlags = flags['content-fields'] !== undefined ||
|
|
65
|
+
const hasKnowledgeFlags = flags['content-fields'] !== undefined ||
|
|
66
|
+
flags['restrict-to-public-articles'] !== undefined ||
|
|
67
|
+
flags['data-category-rule'] !== undefined;
|
|
62
68
|
if (hasKnowledgeFlags) {
|
|
63
69
|
const detail = await AgentDataLibrary.get(connection, flags['library-id']);
|
|
64
70
|
if (detail.sourceType !== 'KNOWLEDGE') {
|
|
65
|
-
this.warn('--content-fields
|
|
71
|
+
this.warn('--content-fields, --restrict-to-public-articles, and --data-category-rule are only valid for KNOWLEDGE libraries. Ignoring.');
|
|
66
72
|
}
|
|
67
73
|
else {
|
|
68
74
|
const knowledgeConfig = {};
|
|
69
75
|
if (flags['content-fields'] !== undefined) {
|
|
70
|
-
knowledgeConfig.contentFields = flags['content-fields']
|
|
76
|
+
knowledgeConfig.contentFields = flags['content-fields']
|
|
77
|
+
.split(',')
|
|
78
|
+
.map((f) => f.trim())
|
|
79
|
+
.filter(Boolean);
|
|
71
80
|
}
|
|
72
81
|
if (flags['restrict-to-public-articles'] !== undefined) {
|
|
73
82
|
knowledgeConfig.isRestrictToPublicArticle = flags['restrict-to-public-articles'];
|
|
74
83
|
}
|
|
84
|
+
if (flags['data-category-rule'] !== undefined) {
|
|
85
|
+
knowledgeConfig.isDataCategoryRuleEnabled = flags['data-category-rule'];
|
|
86
|
+
}
|
|
75
87
|
input.groundingSource = {
|
|
76
88
|
sourceType: 'KNOWLEDGE',
|
|
77
89
|
knowledgeConfig,
|
|
@@ -93,7 +105,8 @@ export default class AgentAdlUpdate extends SfCommand {
|
|
|
93
105
|
}
|
|
94
106
|
catch (error) {
|
|
95
107
|
const wrapped = SfError.wrap(error);
|
|
96
|
-
|
|
108
|
+
const cleanMessage = extractApiError(wrapped) ?? wrapped.message;
|
|
109
|
+
throw new SfError(messages.getMessage('error.updateFailed', [cleanMessage]), 'UpdateFailed', [], 4, wrapped);
|
|
97
110
|
}
|
|
98
111
|
this.log(`Updated data library "${result.masterLabel}" (${result.libraryId}).`);
|
|
99
112
|
return result;
|
|
@@ -1 +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;
|
|
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;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;AAIvF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,SAA+B;IAClE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,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;
|
|
7
7
|
static readonly examples: string[];
|
|
8
8
|
static readonly enableJsonFlag = true;
|
|
9
|
-
static readonly state = "preview";
|
|
10
9
|
static readonly flags: {
|
|
11
10
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
11
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
17
17
|
import { Messages, SfError } from '@salesforce/core';
|
|
18
18
|
import { AgentDataLibrary } from '@salesforce/agents';
|
|
19
|
+
import { extractApiError } from '../../../adlUtils.js';
|
|
19
20
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
21
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.adl.upload');
|
|
21
22
|
export default class AgentAdlUpload extends SfCommand {
|
|
@@ -23,7 +24,6 @@ export default class AgentAdlUpload extends SfCommand {
|
|
|
23
24
|
static description = messages.getMessage('description');
|
|
24
25
|
static examples = messages.getMessages('examples');
|
|
25
26
|
static enableJsonFlag = true;
|
|
26
|
-
static state = 'preview';
|
|
27
27
|
static flags = {
|
|
28
28
|
'target-org': Flags.requiredOrg(),
|
|
29
29
|
'api-version': Flags.orgApiVersion(),
|
|
@@ -63,7 +63,8 @@ export default class AgentAdlUpload extends SfCommand {
|
|
|
63
63
|
}
|
|
64
64
|
catch (error) {
|
|
65
65
|
const wrapped = SfError.wrap(error);
|
|
66
|
-
|
|
66
|
+
const cleanMessage = extractApiError(wrapped) ?? wrapped.message;
|
|
67
|
+
throw new SfError(cleanMessage, wrapped.name ?? 'UploadFailed', [], 4, wrapped);
|
|
67
68
|
}
|
|
68
69
|
if (result.status === 'READY') {
|
|
69
70
|
this.log('Library ready.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../../src/commands/agent/adl/upload.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,EAAqB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../../src/commands/agent/adl/upload.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,EAAqB,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;AAIvF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,SAA+B;IAClE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,cAAc,GAAG,IAAI,CAAC;IAEtC,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,KAAK,CAAC,WAAW,EAAE;QACjC,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE;QACpC,YAAY,EAAE,KAAK,CAAC,MAAM,C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AC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpC,MAAM,YAAY,GAAG,eAAe,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC;YACjE,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,IAAI,cAAc,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QAClF,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;YAC3B,IAAI,CAAC,GAAG,CAAC,kBAAkB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACzD,IAAI,CAAC,GAAG,CAAC,4BAA4B,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;QAC5E,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,8BAA8B,SAAS,WAAW,CAAC,CAAC;YAC7D,IAAI,CAAC,GAAG,CAAC,mFAAmF,CAAC,CAAC;QAChG,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -6,6 +6,8 @@ Create an Agentforce Data Library.
|
|
|
6
6
|
|
|
7
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
8
|
|
|
9
|
+
For SFDRIVE libraries, creation provisions the full Data Cloud pipeline (DLO → DMO → SearchIndex → Retriever). Upload files with `sf agent adl upload` after creation.
|
|
10
|
+
|
|
9
11
|
# examples
|
|
10
12
|
|
|
11
13
|
- Create an SFDRIVE library:
|
|
@@ -52,6 +54,22 @@ Primary index field 1 for KNOWLEDGE libraries (required, immutable after creatio
|
|
|
52
54
|
|
|
53
55
|
Primary index field 2 for KNOWLEDGE libraries (required, immutable after creation).
|
|
54
56
|
|
|
57
|
+
# flags.content-fields.summary
|
|
58
|
+
|
|
59
|
+
Comma-separated list of content fields for KNOWLEDGE libraries (optional, mutable after creation).
|
|
60
|
+
|
|
61
|
+
# flags.data-category-ids.summary
|
|
62
|
+
|
|
63
|
+
Comma-separated list of data category selection IDs for KNOWLEDGE libraries. Mutually exclusive with --data-category-names (provide one or the other, not both).
|
|
64
|
+
|
|
65
|
+
# flags.data-category-names.summary
|
|
66
|
+
|
|
67
|
+
Comma-separated list of data category names in qualified format (e.g., "Group_API_Name.Category"). Mutually exclusive with --data-category-ids (provide one or the other, not both).
|
|
68
|
+
|
|
69
|
+
# flags.wait.summary
|
|
70
|
+
|
|
71
|
+
Wait N minutes for indexing to complete (KNOWLEDGE libraries). SFDRIVE libraries require upload before indexing; RETRIEVER libraries are ready immediately.
|
|
72
|
+
|
|
55
73
|
# error.createFailed
|
|
56
74
|
|
|
57
75
|
Failed to create data library: %s
|
|
@@ -63,3 +81,7 @@ KNOWLEDGE source type requires --primary-index-field1 and --primary-index-field2
|
|
|
63
81
|
# error.missingRetrieverId
|
|
64
82
|
|
|
65
83
|
RETRIEVER source type requires --retriever-id.
|
|
84
|
+
|
|
85
|
+
# error.dataCategoryMutuallyExclusive
|
|
86
|
+
|
|
87
|
+
--data-category-ids and --data-category-names are mutually exclusive. Provide one or the other, not both.
|
|
@@ -6,6 +6,8 @@ Add files to an existing Agentforce Data Library.
|
|
|
6
6
|
|
|
7
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
8
|
|
|
9
|
+
Adds files to an existing READY library. Unlike `sf agent adl upload`, this does NOT create new downstream Data Cloud assets — it appends files to the existing SearchIndex and triggers re-indexing.
|
|
10
|
+
|
|
9
11
|
Constraints: at least 1 file required, no duplicate file names in a batch, maximum 1000 files per library.
|
|
10
12
|
|
|
11
13
|
# examples
|
|
@@ -20,6 +20,10 @@ Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
|
|
|
20
20
|
|
|
21
21
|
ID of the file to delete (AiGroundingFileRef record ID).
|
|
22
22
|
|
|
23
|
+
# success
|
|
24
|
+
|
|
25
|
+
Deletion initiated for file %s. Use `sf agent adl file list` to check file status.
|
|
26
|
+
|
|
23
27
|
# error.deleteFailed
|
|
24
28
|
|
|
25
29
|
Failed to delete file: %s
|
|
@@ -20,6 +20,18 @@ Returns the list of files in an SFDRIVE library including file name, size, and c
|
|
|
20
20
|
|
|
21
21
|
Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
|
|
22
22
|
|
|
23
|
+
# flags.page-size.summary
|
|
24
|
+
|
|
25
|
+
Number of files to return per page (1-200, default 50).
|
|
26
|
+
|
|
27
|
+
# flags.offset.summary
|
|
28
|
+
|
|
29
|
+
Number of files to skip before returning results (for pagination).
|
|
30
|
+
|
|
31
|
+
# flags.status.summary
|
|
32
|
+
|
|
33
|
+
Filter files by indexing status.
|
|
34
|
+
|
|
23
35
|
# error.listFailed
|
|
24
36
|
|
|
25
37
|
Failed to list files: %s
|
|
@@ -4,7 +4,7 @@ Get indexing status of an Agentforce Data Library.
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Returns the current indexing status including stage details (DATA_LAKE_OBJECT, SEARCH_INDEX, RETRIEVER) and any errors.
|
|
7
|
+
Returns the current indexing status including stage details (DATA_STREAM, DATA_LAKE_OBJECT, DATA_MODEL_OBJECT, SEARCH_INDEX, RETRIEVER) and any errors.
|
|
8
8
|
|
|
9
9
|
# examples
|
|
10
10
|
|
|
@@ -16,6 +16,10 @@ Returns the current indexing status including stage details (DATA_LAKE_OBJECT, S
|
|
|
16
16
|
|
|
17
17
|
Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
|
|
18
18
|
|
|
19
|
+
# flags.include-artifacts.summary
|
|
20
|
+
|
|
21
|
+
Resolve DC asset artifacts (DataStream, DLO, DMO, SearchIndex, Retriever) with entity IDs and names on each stage. Slower — requires additional queries.
|
|
22
|
+
|
|
19
23
|
# error.statusFailed
|
|
20
24
|
|
|
21
25
|
Failed to get data library status: %s
|
|
@@ -44,6 +44,10 @@ Comma-separated list of content fields for KNOWLEDGE libraries (triggers re-inde
|
|
|
44
44
|
|
|
45
45
|
Restrict to public Knowledge articles only (KNOWLEDGE libraries, triggers re-indexing).
|
|
46
46
|
|
|
47
|
+
# flags.data-category-rule.summary
|
|
48
|
+
|
|
49
|
+
Enable or disable data category filtering for KNOWLEDGE libraries. Use --no-data-category-rule to disable.
|
|
50
|
+
|
|
47
51
|
# flags.retriever-id.summary
|
|
48
52
|
|
|
49
53
|
Swap the retriever for a RETRIEVER library (must be an active Custom Retriever ID).
|
|
@@ -6,6 +6,8 @@ Upload a file to an SFDRIVE Agentforce Data Library.
|
|
|
6
6
|
|
|
7
7
|
Performs the multi-step upload workflow: checks upload readiness, obtains a pre-signed S3 URL, uploads the file, triggers indexing, and optionally polls until the library is ready (retrieverId is populated).
|
|
8
8
|
|
|
9
|
+
Upload triggers the full Data Cloud provisioning pipeline, creating all downstream assets (DLO, DMO, SearchIndex, Retriever). Use `sf agent adl status` to monitor progress. For adding files to an already-provisioned library, use `sf agent adl file add` instead.
|
|
10
|
+
|
|
9
11
|
This command only works with SFDRIVE libraries. KNOWLEDGE libraries index automatically after creation, and RETRIEVER libraries require no file upload.
|
|
10
12
|
|
|
11
13
|
# examples
|