@salesforce/plugin-agent 1.23.4 → 1.23.6

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.
@@ -532,92 +532,6 @@
532
532
  "test-spec:generate:agent"
533
533
  ]
534
534
  },
535
- "agent:test:cancel": {
536
- "aliases": [],
537
- "args": {},
538
- "description": "This command requires a job ID, which the original \"agent test run\" command displays when it completes. You can also use the --use-most-recent flag to see results for the most recently run agent test.",
539
- "examples": [
540
- "Cancel an agent test currently running in your default org using a job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
541
- "Cancel the most recently run agent test in the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ --target-org my-org"
542
- ],
543
- "flags": {
544
- "json": {
545
- "description": "Format output as json.",
546
- "helpGroup": "GLOBAL",
547
- "name": "json",
548
- "allowNo": false,
549
- "type": "boolean"
550
- },
551
- "flags-dir": {
552
- "helpGroup": "GLOBAL",
553
- "name": "flags-dir",
554
- "summary": "Import flag values from a directory.",
555
- "hasDynamicHelp": false,
556
- "multiple": false,
557
- "type": "option"
558
- },
559
- "target-org": {
560
- "char": "o",
561
- "name": "target-org",
562
- "noCacheDefault": true,
563
- "required": true,
564
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
565
- "hasDynamicHelp": true,
566
- "multiple": false,
567
- "type": "option"
568
- },
569
- "api-version": {
570
- "description": "Override the api version used for api requests made by this command",
571
- "name": "api-version",
572
- "hasDynamicHelp": false,
573
- "multiple": false,
574
- "type": "option"
575
- },
576
- "job-id": {
577
- "char": "i",
578
- "name": "job-id",
579
- "summary": "Job ID of the running agent test that you want to cancel.",
580
- "hasDynamicHelp": false,
581
- "multiple": false,
582
- "type": "option"
583
- },
584
- "use-most-recent": {
585
- "char": "r",
586
- "name": "use-most-recent",
587
- "summary": "Use the job ID of the most recently-run agent test.",
588
- "allowNo": false,
589
- "type": "boolean"
590
- }
591
- },
592
- "hasDynamicHelp": true,
593
- "hidden": true,
594
- "hiddenAliases": [],
595
- "id": "agent:test:cancel",
596
- "pluginAlias": "@salesforce/plugin-agent",
597
- "pluginName": "@salesforce/plugin-agent",
598
- "pluginType": "core",
599
- "state": "beta",
600
- "strict": true,
601
- "summary": "Cancel an agent test that's currently running in your org.",
602
- "enableJsonFlag": true,
603
- "isESM": true,
604
- "relativePath": [
605
- "lib",
606
- "commands",
607
- "agent",
608
- "test",
609
- "cancel.js"
610
- ],
611
- "aliasPermutations": [],
612
- "permutations": [
613
- "agent:test:cancel",
614
- "test:agent:cancel",
615
- "test:cancel:agent",
616
- "agent:cancel:test",
617
- "cancel:agent:test",
618
- "cancel:test:agent"
619
- ]
620
- },
621
535
  "agent:test:create": {
622
536
  "aliases": [],
623
537
  "args": {},
@@ -1112,5 +1026,5 @@
1112
1026
  ]
1113
1027
  }
1114
1028
  },
1115
- "version": "1.23.4"
1029
+ "version": "1.23.6"
1116
1030
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-agent",
3
3
  "description": "Commands to interact with Salesforce agents",
4
- "version": "1.23.4",
4
+ "version": "1.23.6",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
@@ -10,10 +10,10 @@
10
10
  "@oclif/core": "^4",
11
11
  "@oclif/multi-stage-output": "^0.8.17",
12
12
  "@salesforce/agents": "0.15.3",
13
- "@salesforce/core": "^8.13.0",
13
+ "@salesforce/core": "^8.18.3",
14
14
  "@salesforce/kit": "^3.2.3",
15
15
  "@salesforce/sf-plugins-core": "^12.2.0",
16
- "@salesforce/source-deploy-retrieve": "^12.19.3",
16
+ "@salesforce/source-deploy-retrieve": "^12.21.4",
17
17
  "@salesforce/types": "^1.3.0",
18
18
  "ansis": "^3.3.2",
19
19
  "fast-xml-parser": "^4.5.1",
@@ -36,6 +36,7 @@
36
36
  "eslint-plugin-react": "^7.34.3",
37
37
  "eslint-plugin-react-hooks": "^4.6.2",
38
38
  "eslint-plugin-sf-plugin": "^1.20.20",
39
+ "esmock": "^2.7.1",
39
40
  "oclif": "^4.17.44",
40
41
  "ts-node": "^10.9.2",
41
42
  "typescript": "^5.5.4"
@@ -229,7 +230,7 @@
229
230
  "exports": "./lib/index.js",
230
231
  "type": "module",
231
232
  "sfdx": {
232
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.23.4.crt",
233
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.23.4.sig"
233
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.23.6.crt",
234
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.23.6.sig"
234
235
  }
235
236
  }
@@ -1,21 +0,0 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- export type AgentTestCancelResult = {
3
- runId: string;
4
- success: boolean;
5
- errorCode?: string;
6
- message?: string;
7
- };
8
- export default class AgentTestCancel extends SfCommand<AgentTestCancelResult> {
9
- static readonly summary: string;
10
- static readonly description: string;
11
- static readonly examples: string[];
12
- static readonly state = "beta";
13
- static readonly hidden = true;
14
- static readonly flags: {
15
- 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
16
- 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
- 'job-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
- 'use-most-recent': import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
- };
20
- run(): Promise<AgentTestCancelResult>;
21
- }
@@ -1,49 +0,0 @@
1
- /*
2
- * Copyright (c) 2024, salesforce.com, inc.
3
- * All rights reserved.
4
- * Licensed under the BSD 3-Clause license.
5
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
- */
7
- import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
8
- import { Messages } from '@salesforce/core';
9
- import { AgentTester } from '@salesforce/agents';
10
- import { AgentTestCache } from '../../../agentTestCache.js';
11
- Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
12
- const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.test.cancel');
13
- export default class AgentTestCancel extends SfCommand {
14
- static summary = messages.getMessage('summary');
15
- static description = messages.getMessage('description');
16
- static examples = messages.getMessages('examples');
17
- static state = 'beta';
18
- static hidden = true;
19
- static flags = {
20
- 'target-org': Flags.requiredOrg(),
21
- 'api-version': Flags.orgApiVersion(),
22
- 'job-id': Flags.string({
23
- char: 'i',
24
- summary: messages.getMessage('flags.job-id.summary'),
25
- exactlyOne: ['use-most-recent', 'job-id'],
26
- }),
27
- 'use-most-recent': Flags.boolean({
28
- char: 'r',
29
- summary: messages.getMessage('flags.use-most-recent.summary'),
30
- exactlyOne: ['use-most-recent', 'job-id'],
31
- }),
32
- };
33
- async run() {
34
- const { flags } = await this.parse(AgentTestCancel);
35
- const agentTestCache = await AgentTestCache.create();
36
- const { runId } = agentTestCache.useIdOrMostRecent(flags['job-id'], flags['use-most-recent']);
37
- this.log(`Canceling tests for AiEvaluation Job: ${runId}`);
38
- const agentTester = new AgentTester(flags['target-org'].getConnection(flags['api-version']));
39
- const result = await agentTester.cancel(runId);
40
- if (result.success) {
41
- await agentTestCache.removeCacheEntry(runId);
42
- }
43
- return {
44
- success: result.success,
45
- runId,
46
- };
47
- }
48
- }
49
- //# sourceMappingURL=cancel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/cancel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,M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AK,CAAC,eAAe,CAAC,CAAC;QAEpD,MAAM,cAAc,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE,CAAC;QACrD,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAE9F,IAAI,CAAC,GAAG,CAAC,yCAAyC,KAAK,EAAE,CAAC,CAAC;QAE3D,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC7F,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE/C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,cAAc,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,KAAK;SACN,CAAC;IACJ,CAAC"}
@@ -1,25 +0,0 @@
1
- # summary
2
-
3
- Cancel an agent test that's currently running in your org.
4
-
5
- # description
6
-
7
- This command requires a job ID, which the original "agent test run" command displays when it completes. You can also use the --use-most-recent flag to see results for the most recently run agent test.
8
-
9
- # flags.job-id.summary
10
-
11
- Job ID of the running agent test that you want to cancel.
12
-
13
- # flags.use-most-recent.summary
14
-
15
- Use the job ID of the most recently-run agent test.
16
-
17
- # examples
18
-
19
- - Cancel an agent test currently running in your default org using a job ID:
20
-
21
- <%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ
22
-
23
- - Cancel the most recently run agent test in the org with alias "my-org":
24
-
25
- <%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ --target-org my-org
@@ -1,25 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$ref": "#/definitions/AgentTestCancelResult",
4
- "definitions": {
5
- "AgentTestCancelResult": {
6
- "type": "object",
7
- "properties": {
8
- "runId": {
9
- "type": "string"
10
- },
11
- "success": {
12
- "type": "boolean"
13
- },
14
- "errorCode": {
15
- "type": "string"
16
- },
17
- "message": {
18
- "type": "string"
19
- }
20
- },
21
- "required": ["runId", "success"],
22
- "additionalProperties": false
23
- }
24
- }
25
- }