@salesforce/plugin-agent 1.41.0 → 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 +415 -23
- 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/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/oclif.manifest.json +2069 -1111
- package/package.json +14 -4
- 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,104 @@
|
|
|
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.create');
|
|
21
|
+
export default class AgentAdlCreate 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
|
+
name: Flags.string({
|
|
31
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
32
|
+
char: 'n',
|
|
33
|
+
required: true,
|
|
34
|
+
}),
|
|
35
|
+
'developer-name': Flags.string({
|
|
36
|
+
summary: messages.getMessage('flags.developer-name.summary'),
|
|
37
|
+
required: true,
|
|
38
|
+
}),
|
|
39
|
+
'source-type': Flags.option({
|
|
40
|
+
summary: messages.getMessage('flags.source-type.summary'),
|
|
41
|
+
options: ['sfdrive', 'knowledge', 'retriever'],
|
|
42
|
+
required: true,
|
|
43
|
+
})(),
|
|
44
|
+
description: Flags.string({
|
|
45
|
+
summary: messages.getMessage('flags.description.summary'),
|
|
46
|
+
}),
|
|
47
|
+
'index-mode': Flags.option({
|
|
48
|
+
summary: messages.getMessage('flags.index-mode.summary'),
|
|
49
|
+
options: ['basic', 'enhanced'],
|
|
50
|
+
})(),
|
|
51
|
+
'retriever-id': Flags.string({
|
|
52
|
+
summary: messages.getMessage('flags.retriever-id.summary'),
|
|
53
|
+
}),
|
|
54
|
+
'primary-index-field1': Flags.string({
|
|
55
|
+
summary: messages.getMessage('flags.primary-index-field1.summary'),
|
|
56
|
+
}),
|
|
57
|
+
'primary-index-field2': Flags.string({
|
|
58
|
+
summary: messages.getMessage('flags.primary-index-field2.summary'),
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
async run() {
|
|
62
|
+
const { flags } = await this.parse(AgentAdlCreate);
|
|
63
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
64
|
+
const sourceType = flags['source-type'].toUpperCase();
|
|
65
|
+
if (sourceType === 'KNOWLEDGE' && (!flags['primary-index-field1'] || !flags['primary-index-field2'])) {
|
|
66
|
+
throw new SfError(messages.getMessage('error.missingKnowledgeFields'), 'MissingKnowledgeFields', [], 1);
|
|
67
|
+
}
|
|
68
|
+
if (sourceType === 'RETRIEVER' && !flags['retriever-id']) {
|
|
69
|
+
throw new SfError(messages.getMessage('error.missingRetrieverId'), 'MissingRetrieverId', [], 1);
|
|
70
|
+
}
|
|
71
|
+
const groundingSource = { sourceType };
|
|
72
|
+
if (sourceType === 'SFDRIVE' && flags['index-mode']) {
|
|
73
|
+
groundingSource.indexMode = flags['index-mode'].toUpperCase();
|
|
74
|
+
}
|
|
75
|
+
if (sourceType === 'RETRIEVER') {
|
|
76
|
+
groundingSource.retrieverId = flags['retriever-id'];
|
|
77
|
+
}
|
|
78
|
+
if (sourceType === 'KNOWLEDGE') {
|
|
79
|
+
groundingSource.knowledgeConfig = {
|
|
80
|
+
primaryIndexField1: flags['primary-index-field1'],
|
|
81
|
+
primaryIndexField2: flags['primary-index-field2'],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const input = {
|
|
85
|
+
masterLabel: flags.name,
|
|
86
|
+
developerName: flags['developer-name'],
|
|
87
|
+
groundingSource,
|
|
88
|
+
};
|
|
89
|
+
if (flags.description) {
|
|
90
|
+
input.description = flags.description;
|
|
91
|
+
}
|
|
92
|
+
let result;
|
|
93
|
+
try {
|
|
94
|
+
result = await AgentDataLibrary.create(connection, input);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
const wrapped = SfError.wrap(error);
|
|
98
|
+
throw new SfError(messages.getMessage('error.createFailed', [wrapped.message]), 'CreateFailed', [], 4, wrapped);
|
|
99
|
+
}
|
|
100
|
+
this.log(`Created data library "${result.masterLabel}" (${result.libraryId}).`);
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../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AM,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
|
+
export type AgentAdlDeleteResult = {
|
|
3
|
+
success: boolean;
|
|
4
|
+
libraryId: string;
|
|
5
|
+
};
|
|
6
|
+
export default class AgentAdlDelete extends SfCommand<AgentAdlDeleteResult> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly enableJsonFlag = true;
|
|
11
|
+
static readonly state = "preview";
|
|
12
|
+
static readonly flags: {
|
|
13
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'library-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<AgentAdlDeleteResult>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.delete');
|
|
21
|
+
export default class AgentAdlDelete 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(AgentAdlDelete);
|
|
38
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
39
|
+
const libraryId = flags['library-id'];
|
|
40
|
+
try {
|
|
41
|
+
await AgentDataLibrary.delete(connection, libraryId);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const wrapped = SfError.wrap(error);
|
|
45
|
+
throw new SfError(messages.getMessage('error.deleteFailed', [wrapped.message]), 'DeleteFailed', [], 4, wrapped);
|
|
46
|
+
}
|
|
47
|
+
this.log(`Deleted data library ${libraryId}.`);
|
|
48
|
+
return { success: true, libraryId };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/agent/adl/delete.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,EAAE,MAAM,oBAAoB,CAAC;AAEtD,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;IACtC,MAAM,CAAU,KAAK,GAAG,SAAS,CAAC;IAElC,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;YACzB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;YACxD,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACnD,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QAC3E,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;QAEtC,IAAI,CAAC;YACH,MAAM,gBAAgB,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QACvD,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,wBAAwB,SAAS,GAAG,CAAC,CAAC;QAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IACtC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type FileAddResult } from '@salesforce/agents';
|
|
3
|
+
export type AgentAdlFileAddResult = FileAddResult;
|
|
4
|
+
export default class AgentAdlFileAdd extends SfCommand<AgentAdlFileAddResult> {
|
|
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
|
+
};
|
|
16
|
+
run(): Promise<AgentAdlFileAddResult>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.file.add');
|
|
21
|
+
export default class AgentAdlFileAdd 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
|
+
};
|
|
42
|
+
async run() {
|
|
43
|
+
const { flags } = await this.parse(AgentAdlFileAdd);
|
|
44
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
45
|
+
const libraryId = flags['library-id'];
|
|
46
|
+
const filePath = flags.file;
|
|
47
|
+
let result;
|
|
48
|
+
try {
|
|
49
|
+
result = await AgentDataLibrary.addFile(connection, libraryId, filePath);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
const wrapped = SfError.wrap(error);
|
|
53
|
+
throw new SfError(messages.getMessage('error.addFailed', [wrapped.message]), 'AddFailed', [], 4, wrapped);
|
|
54
|
+
}
|
|
55
|
+
this.log(`File added to library ${libraryId}.`);
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../../../src/commands/agent/adl/file/add.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,EAAsB,MAAM,oBAAoB,CAAC;AAE1E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG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CAAC;QAE5B,IAAI,MAAqB,CAAC;QAC1B,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC3E,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,iBAAiB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QAC5G,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,yBAAyB,SAAS,GAAG,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type AgentAdlFileDeleteResult = {
|
|
3
|
+
success: boolean;
|
|
4
|
+
fileId: string;
|
|
5
|
+
};
|
|
6
|
+
export default class AgentAdlFileDelete extends SfCommand<AgentAdlFileDeleteResult> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly enableJsonFlag = true;
|
|
11
|
+
static readonly state = "preview";
|
|
12
|
+
static readonly flags: {
|
|
13
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'library-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'file-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<AgentAdlFileDeleteResult>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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.file.delete');
|
|
21
|
+
export default class AgentAdlFileDelete 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-id': Flags.string({
|
|
36
|
+
summary: messages.getMessage('flags.file-id.summary'),
|
|
37
|
+
required: true,
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
async run() {
|
|
41
|
+
const { flags } = await this.parse(AgentAdlFileDelete);
|
|
42
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
43
|
+
const fileId = flags['file-id'];
|
|
44
|
+
try {
|
|
45
|
+
await AgentDataLibrary.deleteFile(connection, flags['library-id'], fileId);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
const wrapped = SfError.wrap(error);
|
|
49
|
+
throw new SfError(messages.getMessage('error.deleteFailed', [wrapped.message]), 'DeleteFailed', [], 4, wrapped);
|
|
50
|
+
}
|
|
51
|
+
this.log(`Deleted file ${fileId}.`);
|
|
52
|
+
return { success: true, fileId };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../../src/commands/agent/adl/file/delete.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,EAAE,MAAM,oBAAoB,CAAC;AAEtD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,uBAAuB,CAAC,CAAC;AAI5F,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,SAAmC;IAC1E,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,GAA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CAAC,GAAG,CAAC,gBAAgB,MAAM,GAAG,CAAC,CAAC;QACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACnC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type GroundingFileRef } from '@salesforce/agents';
|
|
3
|
+
export type AgentAdlFileListResult = {
|
|
4
|
+
files: GroundingFileRef[];
|
|
5
|
+
};
|
|
6
|
+
export default class AgentAdlFileList extends SfCommand<AgentAdlFileListResult> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly enableJsonFlag = true;
|
|
11
|
+
static readonly state = "preview";
|
|
12
|
+
static readonly flags: {
|
|
13
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'library-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<AgentAdlFileListResult>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.file.list');
|
|
21
|
+
export default class AgentAdlFileList 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(AgentAdlFileList);
|
|
38
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
39
|
+
let files;
|
|
40
|
+
try {
|
|
41
|
+
files = await AgentDataLibrary.listFiles(connection, flags['library-id']);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const wrapped = SfError.wrap(error);
|
|
45
|
+
throw new SfError(messages.getMessage('error.listFailed', [wrapped.message]), 'ListFailed', [], 4, wrapped);
|
|
46
|
+
}
|
|
47
|
+
this.log(`Found ${files.length} file(s).`);
|
|
48
|
+
return { files };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/commands/agent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,aAAa,CAAC,CAAC,CAAC;QAE3E,IAAI,KAAyB,CAAC;QAC9B,IAAI,CAAC;YACH,KAAK,GAAG,MAAM,gBAAgB,CAAC,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;QAC5E,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,kBAAkB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QAC9G,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,SAAS,KAAK,CAAC,MAAM,WAAW,CAAC,CAAC;QAC3C,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type DataLibraryDetail } from '@salesforce/agents';
|
|
3
|
+
export type AgentAdlGetResult = DataLibraryDetail;
|
|
4
|
+
export default class AgentAdlGet extends SfCommand<AgentAdlGetResult> {
|
|
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
|
+
};
|
|
15
|
+
run(): Promise<AgentAdlGetResult>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.get');
|
|
21
|
+
export default class AgentAdlGet 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(AgentAdlGet);
|
|
38
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
39
|
+
let result;
|
|
40
|
+
try {
|
|
41
|
+
result = await AgentDataLibrary.get(connection, flags['library-id']);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const wrapped = SfError.wrap(error);
|
|
45
|
+
throw new SfError(messages.getMessage('error.getFailed', [wrapped.message]), 'GetFailed', [], 4, wrapped);
|
|
46
|
+
}
|
|
47
|
+
this.log(`Library: ${result.masterLabel} (${result.libraryId}) — ${result.sourceType} — ${String(result.status)}`);
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/commands/agent/adl/get.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,EAA0B,MAAM,oBAAoB,CAAC;AAE9E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,eAAe,CAAC,CAAC;AAIpF,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,SAA4B;IAC5D,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;IACtC,MAAM,CAAU,KAAK,GAAG,SAAS,CAAC;IAElC,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;YACzB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;YACxD,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QAE3E,IAAI,MAAyB,CAAC;QAC9B,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,gBAAgB,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;QACvE,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,iBAAiB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QAC5G,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,WAAW,KAAK,MAAM,CAAC,SAAS,OAAO,MAAM,CAAC,UAAU,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACnH,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type DataLibrarySummary } from '@salesforce/agents';
|
|
3
|
+
export type AgentAdlListResult = {
|
|
4
|
+
libraries: DataLibrarySummary[];
|
|
5
|
+
};
|
|
6
|
+
export default class AgentAdlList extends SfCommand<AgentAdlListResult> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly enableJsonFlag = true;
|
|
11
|
+
static readonly state = "preview";
|
|
12
|
+
static readonly flags: {
|
|
13
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<AgentAdlListResult>;
|
|
17
|
+
}
|
|
@@ -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.list');
|
|
21
|
+
export default class AgentAdlList 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
|
+
};
|
|
31
|
+
async run() {
|
|
32
|
+
const { flags } = await this.parse(AgentAdlList);
|
|
33
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
34
|
+
let result;
|
|
35
|
+
try {
|
|
36
|
+
result = await AgentDataLibrary.list(connection);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
const wrapped = SfError.wrap(error);
|
|
40
|
+
throw new SfError(messages.getMessage('error.listFailed', [wrapped.message]), 'ListFailed', [], 4, wrapped);
|
|
41
|
+
}
|
|
42
|
+
if (!this.jsonEnabled()) {
|
|
43
|
+
this.table({
|
|
44
|
+
data: result.libraries,
|
|
45
|
+
columns: [
|
|
46
|
+
{ key: 'masterLabel', name: 'Name' },
|
|
47
|
+
{ key: 'libraryId', name: 'Library ID' },
|
|
48
|
+
{ key: 'sourceType', name: 'Source Type' },
|
|
49
|
+
{ key: 'status', name: 'Status' },
|
|
50
|
+
{ key: 'developerName', name: 'Developer Name' },
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/agent/adl/list.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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EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QAC9G,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC;gBACT,IAAI,EAAE,MAAM,CAAC,SAAS;gBACtB,OAAO,EAAE;oBACP,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE;oBACpC,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE;oBACxC,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE;oBAC1C,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACjC,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,gBAAgB,EAAE;iBACjD;aACF,CAAC,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type IndexingStatusResponse } from '@salesforce/agents';
|
|
3
|
+
export type AgentAdlStatusResult = IndexingStatusResponse;
|
|
4
|
+
export default class AgentAdlStatus extends SfCommand<AgentAdlStatusResult> {
|
|
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
|
+
};
|
|
15
|
+
run(): Promise<AgentAdlStatusResult>;
|
|
16
|
+
}
|