@salesforce/plugin-agent 1.11.1 → 1.13.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.
@@ -12,12 +12,11 @@ import YAML from 'yaml';
12
12
  import { Agent } from '@salesforce/agents';
13
13
  import { makeFlags, promptForFlag, validateAgentType, validateMaxTopics } from '../../../flags.js';
14
14
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
15
- const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.spec-v2');
15
+ const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.agent-spec');
16
16
  export const FLAGGABLE_PROMPTS = {
17
17
  type: {
18
18
  message: messages.getMessage('flags.type.summary'),
19
19
  validate: (d) => d.length > 0 || 'Type cannot be empty',
20
- char: 't',
21
20
  options: ['customer', 'internal'],
22
21
  required: true,
23
22
  },
@@ -87,7 +86,7 @@ export const FLAGGABLE_PROMPTS = {
87
86
  // default: 'en_US',
88
87
  // },
89
88
  };
90
- export default class AgentCreateSpecV2 extends SfCommand {
89
+ export default class AgentCreateSpec extends SfCommand {
91
90
  static summary = messages.getMessage('summary');
92
91
  static description = messages.getMessage('description');
93
92
  static examples = messages.getMessages('examples');
@@ -104,7 +103,7 @@ export default class AgentCreateSpecV2 extends SfCommand {
104
103
  }),
105
104
  'output-file': Flags.file({
106
105
  summary: messages.getMessage('flags.output-file.summary'),
107
- default: join('config', 'agentSpec.yaml'),
106
+ default: join('specs', 'agentSpec.yaml'),
108
107
  }),
109
108
  'full-interview': Flags.boolean({
110
109
  summary: messages.getMessage('flags.full-interview.summary'),
@@ -118,11 +117,12 @@ export default class AgentCreateSpecV2 extends SfCommand {
118
117
  }),
119
118
  'no-prompt': Flags.boolean({
120
119
  summary: messages.getMessage('flags.no-prompt.summary'),
120
+ char: 'p',
121
121
  }),
122
122
  };
123
123
  // eslint-disable-next-line complexity
124
124
  async run() {
125
- const { flags } = await this.parse(AgentCreateSpecV2);
125
+ const { flags } = await this.parse(AgentCreateSpec);
126
126
  let outputFile;
127
127
  try {
128
128
  outputFile = await resolveOutputFile(flags['output-file'], flags['no-prompt']);
@@ -233,8 +233,20 @@ const buildSpecFile = (specResponse, extraProps) => {
233
233
  propertyOrder.map((prop) => {
234
234
  // @ts-expect-error need better typing of the array.
235
235
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
236
- const val = specResponse[prop] ?? extraProps[prop];
236
+ let val = specResponse[prop] ?? extraProps[prop];
237
237
  if (val != null || (typeof val === 'string' && val.length > 0)) {
238
+ if (prop === 'topics') {
239
+ // Ensure topics are [{name, description}]
240
+ val = val.map((t) => Object.keys(t)
241
+ .sort()
242
+ .reverse()
243
+ .reduce((acc, key) => ({
244
+ ...acc,
245
+ // @ts-expect-error need better typing of the array.
246
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
247
+ [key]: t[key],
248
+ }), {}));
249
+ }
238
250
  // @ts-expect-error need better typing of the array.
239
251
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
240
252
  specFileContents[prop] = val;
@@ -265,4 +277,4 @@ const resolveOutputFile = async (outputFile, noPrompt = false) => {
265
277
  }
266
278
  return resolvedOutputFile;
267
279
  };
268
- //# sourceMappingURL=spec-v2.js.map
280
+ //# sourceMappingURL=agent-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-spec.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/agent-spec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,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+1,14 @@
1
1
  # summary
2
2
 
3
- Create an agent in your org from a local agent spec file.
3
+ Create an agent in your org using a local agent spec file.
4
4
 
5
5
  # description
6
6
 
7
- To generate an agent spec file, run the "agent generate spec" CLI command, which outputs a JSON file with the list of jobs and descriptions that the new agent can perform. Then specify this generated spec file to the --spec flag of this command, along with the name of the new agent.
7
+ Before you run this command, you must first generate an agent spec file by running the "agent generate spec" CLI command, which outputs a YAML file with the agent properties and list of AI-generated topics. Topics define the range of jobs the agent can handle. Then specify the generated agent spec file to this command using the --spec flag, along with the name (label) of the new agent using the --agent-name flag.
8
8
 
9
- When this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new agent already has a list of topics and actions that were automatically created from the list of jobs in the provided agent spec file. This command also retrieves all the metadata files associated with the new agent to your local DX project.
9
+ When this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new agent's topics are the same as the ones listed in the agent spec file. The agent might also have some AI-generated actions. This command also retrieves all the metadata files associated with the new agent to your local Salesforce DX project.
10
+
11
+ Use the --preview flag to review what the agent looks like without actually saving it in your org. Rather, the command creates a JSON file with all the agent details in the current directory.
10
12
 
11
13
  To open the new agent in your org's Agent Builder UI, run this command: "sf org open agent --name <api-name-of-your-agent>".
12
14
 
@@ -14,12 +16,40 @@ To open the new agent in your org's Agent Builder UI, run this command: "sf org
14
16
 
15
17
  Path to an agent spec file.
16
18
 
17
- # flags.name.summary
19
+ # flags.preview.summary
20
+
21
+ Preview the agent without saving it in your org.
22
+
23
+ # flags.agent-name.summary
24
+
25
+ Name (label) of the new agent.
26
+
27
+ # flags.agent-api-name.summary
28
+
29
+ API name of the new agent; if not specified, the API name is derived from the agent name (label); the API name must not exist in the org.
30
+
31
+ # flags.agent-api-name.prompt
32
+
33
+ API name of the new agent (default = %s)
18
34
 
19
- API name of the new agent.
35
+ # flags.planner-id.summary
36
+
37
+ An existing GenAiPlanner ID to associate with the agent.
38
+
39
+ # error.missingRequiredFlags
40
+
41
+ Missing required flags: %s
42
+
43
+ # error.missingRequiredSpecProperties
44
+
45
+ Missing required spec file properties: %s
20
46
 
21
47
  # examples
22
48
 
23
- - Create an agent called "CustomerSupportAgent" in an org with alias "my-org" using the specified agent spec file:
49
+ - Create an agent called "ResortManager" in an org with alias "my-org" using the specified agent spec file:
50
+
51
+ <%= config.bin %> <%= command.id %> --agent-name ResortManager --spec specs/resortManagerAgent.yaml --target-org my-org
52
+
53
+ - Preview the creation of an agent called "ResortManager" and use your default org:
24
54
 
25
- <%= config.bin %> <%= command.id %> --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
55
+ <%= config.bin %> <%= command.id %> --agent-name ResortManager --spec specs/resortManagerAgent.yaml --preview
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-agent",
3
- "version": "1.11.1",
3
+ "version": "1.13.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/plugin-agent",
9
- "version": "1.11.1",
9
+ "version": "1.13.0",
10
10
  "license": "BSD-3-Clause",
11
11
  "dependencies": {
12
12
  "@inquirer/figures": "^1.0.7",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "commands": {
3
- "agent:create-v2": {
3
+ "agent:create": {
4
4
  "aliases": [],
5
5
  "args": {},
6
6
  "description": "Before you run this command, you must first generate an agent spec file by running the \"agent generate spec\" CLI command, which outputs a YAML file with the agent properties and list of AI-generated topics. Topics define the range of jobs the agent can handle. Then specify the generated agent spec file to this command using the --spec flag, along with the name (label) of the new agent using the --agent-name flag.\n\nWhen this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new agent's topics are the same as the ones listed in the agent spec file. The agent might also have some AI-generated actions. This command also retrieves all the metadata files associated with the new agent to your local Salesforce DX project.\n\nUse the --preview flag to review what the agent looks like without actually saving it in your org. Rather, the command creates a JSON file with all the agent details in the current directory.\n\nTo open the new agent in your org's Agent Builder UI, run this command: \"sf org open agent --name <api-name-of-your-agent>\".",
@@ -48,9 +48,15 @@
48
48
  "multiple": false,
49
49
  "type": "option"
50
50
  },
51
+ "agent-api-name": {
52
+ "name": "agent-api-name",
53
+ "summary": "API name of the new agent; if not specified, the API name is derived from the agent name (label); the API name must not exist in the org.",
54
+ "hasDynamicHelp": false,
55
+ "multiple": false,
56
+ "type": "option"
57
+ },
51
58
  "spec": {
52
59
  "name": "spec",
53
- "required": true,
54
60
  "summary": "Path to an agent spec file.",
55
61
  "hasDynamicHelp": false,
56
62
  "multiple": false,
@@ -62,13 +68,6 @@
62
68
  "allowNo": false,
63
69
  "type": "boolean"
64
70
  },
65
- "agent-api-name": {
66
- "name": "agent-api-name",
67
- "summary": "API name of the new agent; if not specified, the API name is derived from the agent name (label); the API name must not exist in the org.",
68
- "hasDynamicHelp": false,
69
- "multiple": false,
70
- "type": "option"
71
- },
72
71
  "planner-id": {
73
72
  "hidden": true,
74
73
  "name": "planner-id",
@@ -80,96 +79,13 @@
80
79
  },
81
80
  "hasDynamicHelp": true,
82
81
  "hiddenAliases": [],
83
- "id": "agent:create-v2",
84
- "pluginAlias": "@salesforce/plugin-agent",
85
- "pluginName": "@salesforce/plugin-agent",
86
- "pluginType": "core",
87
- "state": "beta",
88
- "strict": true,
89
- "summary": "Create an agent in your org using a local agent spec file.",
90
- "enableJsonFlag": true,
91
- "requiresProject": true,
92
- "isESM": true,
93
- "relativePath": [
94
- "lib",
95
- "commands",
96
- "agent",
97
- "create-v2.js"
98
- ],
99
- "aliasPermutations": [],
100
- "permutations": [
101
- "agent:create-v2",
102
- "create-v2:agent"
103
- ]
104
- },
105
- "agent:create": {
106
- "aliases": [],
107
- "args": {},
108
- "description": "To generate an agent spec file, run the \"agent generate spec\" CLI command, which outputs a JSON file with the list of jobs and descriptions that the new agent can perform. Then specify this generated spec file to the --spec flag of this command, along with the name of the new agent.\n\nWhen this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new agent already has a list of topics and actions that were automatically created from the list of jobs in the provided agent spec file. This command also retrieves all the metadata files associated with the new agent to your local DX project.\n\nTo open the new agent in your org's Agent Builder UI, run this command: \"sf org open agent --name <api-name-of-your-agent>\".",
109
- "examples": [
110
- "Create an agent called \"CustomerSupportAgent\" in an org with alias \"my-org\" using the specified agent spec file:\n<%= config.bin %> <%= command.id %> --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org"
111
- ],
112
- "flags": {
113
- "json": {
114
- "description": "Format output as json.",
115
- "helpGroup": "GLOBAL",
116
- "name": "json",
117
- "allowNo": false,
118
- "type": "boolean"
119
- },
120
- "flags-dir": {
121
- "helpGroup": "GLOBAL",
122
- "name": "flags-dir",
123
- "summary": "Import flag values from a directory.",
124
- "hasDynamicHelp": false,
125
- "multiple": false,
126
- "type": "option"
127
- },
128
- "target-org": {
129
- "char": "o",
130
- "name": "target-org",
131
- "noCacheDefault": true,
132
- "required": true,
133
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
134
- "hasDynamicHelp": true,
135
- "multiple": false,
136
- "type": "option"
137
- },
138
- "api-version": {
139
- "description": "Override the api version used for api requests made by this command",
140
- "name": "api-version",
141
- "hasDynamicHelp": false,
142
- "multiple": false,
143
- "type": "option"
144
- },
145
- "spec": {
146
- "char": "f",
147
- "name": "spec",
148
- "required": true,
149
- "summary": "Path to an agent spec file.",
150
- "hasDynamicHelp": false,
151
- "multiple": false,
152
- "type": "option"
153
- },
154
- "name": {
155
- "char": "n",
156
- "name": "name",
157
- "required": true,
158
- "summary": "API name of the new agent.",
159
- "hasDynamicHelp": false,
160
- "multiple": false,
161
- "type": "option"
162
- }
163
- },
164
- "hasDynamicHelp": true,
165
- "hiddenAliases": [],
166
82
  "id": "agent:create",
167
83
  "pluginAlias": "@salesforce/plugin-agent",
168
84
  "pluginName": "@salesforce/plugin-agent",
169
85
  "pluginType": "core",
170
86
  "state": "beta",
171
87
  "strict": true,
172
- "summary": "Create an agent in your org from a local agent spec file.",
88
+ "summary": "Create an agent in your org using a local agent spec file.",
173
89
  "enableJsonFlag": true,
174
90
  "requiresProject": true,
175
91
  "isESM": true,
@@ -253,7 +169,7 @@
253
169
  "preview:agent"
254
170
  ]
255
171
  },
256
- "agent:generate:spec-v2": {
172
+ "agent:generate:agent-spec": {
257
173
  "aliases": [],
258
174
  "args": {},
259
175
  "description": "Before you use Salesforce CLI to create an agent in your org, you must first generate an agent spec with this command. An agent spec is a YAML-formatted file that contains information about the agent, such as its role and company description, and then an AI-generated list of topics based on this information. Topics define the range of jobs your agent can handle.\n\nUse flags, such as --role and --company-description, to provide details about your company and the role that the agent plays in your company. If you prefer, you can also be prompted for the information. Upon command execution, the large language model (LLM) associated with your org uses the information you provided to generate a list of topics for the agent. Because the LLM uses the company and role information to generate the topics, we recommend that you provide accurate and specific details so the LLM generates the best and most relevant topics. Once generated, you can edit the spec file; for example, you can remove topics that don't apply to your agent or change the description of a particular topic.\n\nYou can iterate the spec generation process by using the --spec flag to pass an existing agent spec file to this command, and then using the --role, --company-description, etc, flags to refine your agent properties. Iteratively improving the description of your agent allows the LLM to generate progressively better topics.\n\nYou can also specify a custom prompt template that the agent uses, and ground the prompt template to add context and personalization to the agent's prompts.\n\nWhen your agent spec is ready, you then create the agent in your org by running the \"agent create\" CLI command and specifying the spec with the --spec flag.",
@@ -296,7 +212,6 @@
296
212
  "type": "option"
297
213
  },
298
214
  "type": {
299
- "char": "t",
300
215
  "name": "type",
301
216
  "summary": "Type of agent to create.",
302
217
  "hasDynamicHelp": false,
@@ -382,7 +297,7 @@
382
297
  "output-file": {
383
298
  "name": "output-file",
384
299
  "summary": "Path for the generated YAML agent spec file; can be an absolute or relative path.",
385
- "default": "config/agentSpec.yaml",
300
+ "default": "specs/agentSpec.yaml",
386
301
  "hasDynamicHelp": false,
387
302
  "multiple": false,
388
303
  "type": "option"
@@ -411,6 +326,7 @@
411
326
  "type": "option"
412
327
  },
413
328
  "no-prompt": {
329
+ "char": "p",
414
330
  "name": "no-prompt",
415
331
  "summary": "Don't prompt the user to confirm spec file overwrite.",
416
332
  "allowNo": false,
@@ -419,7 +335,7 @@
419
335
  },
420
336
  "hasDynamicHelp": true,
421
337
  "hiddenAliases": [],
422
- "id": "agent:generate:spec-v2",
338
+ "id": "agent:generate:agent-spec",
423
339
  "pluginAlias": "@salesforce/plugin-agent",
424
340
  "pluginName": "@salesforce/plugin-agent",
425
341
  "pluginType": "core",
@@ -434,145 +350,16 @@
434
350
  "commands",
435
351
  "agent",
436
352
  "generate",
437
- "spec-v2.js"
438
- ],
439
- "aliasPermutations": [],
440
- "permutations": [
441
- "agent:generate:spec-v2",
442
- "generate:agent:spec-v2",
443
- "generate:spec-v2:agent",
444
- "agent:spec-v2:generate",
445
- "spec-v2:agent:generate",
446
- "spec-v2:generate:agent"
447
- ]
448
- },
449
- "agent:generate:spec": {
450
- "aliases": [],
451
- "args": {},
452
- "description": "When using Salesforce CLI to create an agent in your org, the first step is to generate the local JSON-formatted agent spec file with this command.\n\nAn agent spec is a list of jobs and descriptions that capture what the agent can do. Use flags such as --role and --company-description to provide details about your company and the role that the agent plays in your company; you can also enter the information interactively if you prefer. When you then execute this command, the large language model (LLM) associated with your org uses the information to generate the list of jobs that the agent most likely performs. We recommend that you provide good details for --role, --company-description, etc, so that the LLM can generate the best and most relevant list of jobs and descriptions. Once generated, you can edit the spec file; for example, you can remove jobs that don't apply to your agent.\n\nWhen your agent spec is ready, you then create the agent in your org by specifying the agent spec file to the --job-spec flag of the \"agent create\" CLI command.",
453
- "examples": [
454
- "Create an agent spec for your default org in the default location and use flags to specify the agent's role and your company details:\n<%= config.bin %> <%= command.id %> --type customer --role \"Assist users in navigating and managing bookings\" --company-name \"Coral Cloud\" --company-description \"Resort that manages guests and their reservations and experiences\"",
455
- "Create an agent spec by being prompted for role and company details interactively; write the generated file to the \"specs\" directory and use the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --output-dir specs --target-org my-org"
456
- ],
457
- "flags": {
458
- "json": {
459
- "description": "Format output as json.",
460
- "helpGroup": "GLOBAL",
461
- "name": "json",
462
- "allowNo": false,
463
- "type": "boolean"
464
- },
465
- "flags-dir": {
466
- "helpGroup": "GLOBAL",
467
- "name": "flags-dir",
468
- "summary": "Import flag values from a directory.",
469
- "hasDynamicHelp": false,
470
- "multiple": false,
471
- "type": "option"
472
- },
473
- "target-org": {
474
- "char": "o",
475
- "name": "target-org",
476
- "noCacheDefault": true,
477
- "required": true,
478
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
479
- "hasDynamicHelp": true,
480
- "multiple": false,
481
- "type": "option"
482
- },
483
- "api-version": {
484
- "description": "Override the api version used for api requests made by this command",
485
- "name": "api-version",
486
- "hasDynamicHelp": false,
487
- "multiple": false,
488
- "type": "option"
489
- },
490
- "type": {
491
- "char": "t",
492
- "name": "type",
493
- "summary": "Type of agent to create.",
494
- "hasDynamicHelp": false,
495
- "multiple": false,
496
- "options": [
497
- "customer",
498
- "internal"
499
- ],
500
- "type": "option"
501
- },
502
- "role": {
503
- "name": "role",
504
- "summary": "Role of the agent.",
505
- "hasDynamicHelp": false,
506
- "multiple": false,
507
- "type": "option"
508
- },
509
- "company-name": {
510
- "name": "company-name",
511
- "summary": "Name of your company.",
512
- "hasDynamicHelp": false,
513
- "multiple": false,
514
- "type": "option"
515
- },
516
- "company-description": {
517
- "name": "company-description",
518
- "summary": "Description of your company.",
519
- "hasDynamicHelp": false,
520
- "multiple": false,
521
- "type": "option"
522
- },
523
- "company-website": {
524
- "name": "company-website",
525
- "summary": "Website URL of your company.",
526
- "hasDynamicHelp": false,
527
- "multiple": false,
528
- "type": "option"
529
- },
530
- "output-dir": {
531
- "char": "d",
532
- "name": "output-dir",
533
- "summary": "Directory where the agent spec file is written; can be an absolute or relative path.",
534
- "default": "config",
535
- "hasDynamicHelp": false,
536
- "multiple": false,
537
- "type": "option"
538
- },
539
- "file-name": {
540
- "char": "f",
541
- "name": "file-name",
542
- "summary": "Name of the generated agent spec file.",
543
- "default": "agentSpec.json",
544
- "hasDynamicHelp": false,
545
- "multiple": false,
546
- "type": "option"
547
- }
548
- },
549
- "hasDynamicHelp": true,
550
- "hiddenAliases": [],
551
- "id": "agent:generate:spec",
552
- "pluginAlias": "@salesforce/plugin-agent",
553
- "pluginName": "@salesforce/plugin-agent",
554
- "pluginType": "core",
555
- "state": "beta",
556
- "strict": true,
557
- "summary": "Generate an agent spec, which is the list of jobs that the agent performs.",
558
- "enableJsonFlag": true,
559
- "requiresProject": true,
560
- "isESM": true,
561
- "relativePath": [
562
- "lib",
563
- "commands",
564
- "agent",
565
- "generate",
566
- "spec.js"
353
+ "agent-spec.js"
567
354
  ],
568
355
  "aliasPermutations": [],
569
356
  "permutations": [
570
- "agent:generate:spec",
571
- "generate:agent:spec",
572
- "generate:spec:agent",
573
- "agent:spec:generate",
574
- "spec:agent:generate",
575
- "spec:generate:agent"
357
+ "agent:generate:agent-spec",
358
+ "generate:agent:agent-spec",
359
+ "generate:agent-spec:agent",
360
+ "agent:agent-spec:generate",
361
+ "agent-spec:agent:generate",
362
+ "agent-spec:generate:agent"
576
363
  ]
577
364
  },
578
365
  "agent:generate:test-spec": {
@@ -1198,5 +985,5 @@
1198
985
  ]
1199
986
  }
1200
987
  },
1201
- "version": "1.11.1"
988
+ "version": "1.13.0"
1202
989
  }
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.11.1",
4
+ "version": "1.13.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
@@ -226,7 +226,7 @@
226
226
  "exports": "./lib/index.js",
227
227
  "type": "module",
228
228
  "sfdx": {
229
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.11.1.crt",
230
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.11.1.sig"
229
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.13.0.crt",
230
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.13.0.sig"
231
231
  }
232
232
  }