@salesforce/plugin-agent 1.24.14-demo.8 → 1.24.14

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.
Files changed (67) hide show
  1. package/LICENSE.txt +6 -200
  2. package/README.md +24 -132
  3. package/lib/agentActivation.js +4 -13
  4. package/lib/agentActivation.js.map +1 -1
  5. package/lib/agentTestCache.js +4 -13
  6. package/lib/agentTestCache.js.map +1 -1
  7. package/lib/commands/agent/activate.js +4 -13
  8. package/lib/commands/agent/activate.js.map +1 -1
  9. package/lib/commands/agent/create.js +4 -13
  10. package/lib/commands/agent/create.js.map +1 -1
  11. package/lib/commands/agent/deactivate.js +4 -13
  12. package/lib/commands/agent/deactivate.js.map +1 -1
  13. package/lib/commands/agent/generate/agent-spec.js +4 -13
  14. package/lib/commands/agent/generate/agent-spec.js.map +1 -1
  15. package/lib/commands/agent/generate/template.js +4 -13
  16. package/lib/commands/agent/generate/template.js.map +1 -1
  17. package/lib/commands/agent/generate/test-spec.js +4 -13
  18. package/lib/commands/agent/generate/test-spec.js.map +1 -1
  19. package/lib/commands/agent/preview.d.ts +2 -2
  20. package/lib/commands/agent/preview.js +8 -30
  21. package/lib/commands/agent/preview.js.map +1 -1
  22. package/lib/commands/agent/test/create.js +4 -13
  23. package/lib/commands/agent/test/create.js.map +1 -1
  24. package/lib/commands/agent/test/list.js +4 -13
  25. package/lib/commands/agent/test/list.js.map +1 -1
  26. package/lib/commands/agent/test/results.js +4 -13
  27. package/lib/commands/agent/test/results.js.map +1 -1
  28. package/lib/commands/agent/test/resume.js +4 -13
  29. package/lib/commands/agent/test/resume.js.map +1 -1
  30. package/lib/commands/agent/test/run.js +4 -14
  31. package/lib/commands/agent/test/run.js.map +1 -1
  32. package/lib/components/agent-preview-react.js +37 -72
  33. package/lib/components/agent-preview-react.js.map +1 -1
  34. package/lib/flags.d.ts +2 -6
  35. package/lib/flags.js +20 -55
  36. package/lib/flags.js.map +1 -1
  37. package/lib/handleTestResults.js +4 -13
  38. package/lib/handleTestResults.js.map +1 -1
  39. package/lib/index.js +4 -13
  40. package/lib/index.js.map +1 -1
  41. package/lib/inquirer-theme.js +4 -13
  42. package/lib/inquirer-theme.js.map +1 -1
  43. package/lib/testStages.js +4 -13
  44. package/lib/testStages.js.map +1 -1
  45. package/lib/yes-no-cancel.js +4 -13
  46. package/lib/yes-no-cancel.js.map +1 -1
  47. package/messages/agent.preview.md +0 -4
  48. package/messages/agent.test.run.md +0 -4
  49. package/npm-shrinkwrap.json +17924 -0
  50. package/oclif.lock +9492 -0
  51. package/oclif.manifest.json +3 -289
  52. package/package.json +12 -11
  53. package/lib/commands/agent/generate/authoring-bundle.d.ts +0 -22
  54. package/lib/commands/agent/generate/authoring-bundle.js +0 -146
  55. package/lib/commands/agent/generate/authoring-bundle.js.map +0 -1
  56. package/lib/commands/agent/publish/authoring-bundle.d.ts +0 -19
  57. package/lib/commands/agent/publish/authoring-bundle.js +0 -131
  58. package/lib/commands/agent/publish/authoring-bundle.js.map +0 -1
  59. package/lib/commands/agent/validate/authoring-bundle.d.ts +0 -18
  60. package/lib/commands/agent/validate/authoring-bundle.js +0 -123
  61. package/lib/commands/agent/validate/authoring-bundle.js.map +0 -1
  62. package/messages/agent.generate.authoring-bundle.md +0 -47
  63. package/messages/agent.publish.authoring-bundle.md +0 -45
  64. package/messages/agent.validate.authoring-bundle.md +0 -41
  65. package/schemas/agent-generate-authoring__bundle.json +0 -22
  66. package/schemas/agent-publish-authoring__bundle.json +0 -25
  67. package/schemas/agent-validate-authoring__bundle.json +0 -22
@@ -285,6 +285,7 @@
285
285
  "target-org"
286
286
  ],
287
287
  "name": "client-app",
288
+ "required": true,
288
289
  "summary": "Name of the linked client app to use for the agent connection. You must have previously created this link with \"org login web --client-app\". Run \"org display\" to see the available linked client apps.",
289
290
  "hasDynamicHelp": false,
290
291
  "multiple": false,
@@ -298,13 +299,6 @@
298
299
  "multiple": false,
299
300
  "type": "option"
300
301
  },
301
- "authoring-bundle": {
302
- "name": "authoring-bundle",
303
- "summary": "Preview an ephemeral agent by specifying the API name of the Authoring Bundle metadata",
304
- "hasDynamicHelp": false,
305
- "multiple": false,
306
- "type": "option"
307
- },
308
302
  "output-dir": {
309
303
  "char": "d",
310
304
  "name": "output-dir",
@@ -327,6 +321,7 @@
327
321
  "pluginAlias": "@salesforce/plugin-agent",
328
322
  "pluginName": "@salesforce/plugin-agent",
329
323
  "pluginType": "core",
324
+ "state": "beta",
330
325
  "strict": true,
331
326
  "summary": "Interact with an active agent to preview how the agent responds to your statements, questions, and commands (utterances).",
332
327
  "enableJsonFlag": false,
@@ -537,121 +532,6 @@
537
532
  "agent-spec:generate:agent"
538
533
  ]
539
534
  },
540
- "agent:generate:authoring-bundle": {
541
- "aliases": [],
542
- "args": {},
543
- "description": "Generates an authoring bundle containing Agent and its meta.xml file from an agent specification file.",
544
- "examples": [
545
- "Generate an authoring bundle from a specification file:\n<%= config.bin %> <%= command.id %> --spec-file path/to/spec.yaml --name \"My Authoring Bundle\"",
546
- "Generate an authoring bundle with a custom output directory:\n<%= config.bin %> <%= command.id %> --spec-file path/to/spec.yaml --name \"My Authoring Bundle\" --output-dir path/to/output"
547
- ],
548
- "flags": {
549
- "json": {
550
- "description": "Format output as json.",
551
- "helpGroup": "GLOBAL",
552
- "name": "json",
553
- "allowNo": false,
554
- "type": "boolean"
555
- },
556
- "flags-dir": {
557
- "helpGroup": "GLOBAL",
558
- "name": "flags-dir",
559
- "summary": "Import flag values from a directory.",
560
- "hasDynamicHelp": false,
561
- "multiple": false,
562
- "type": "option"
563
- },
564
- "target-org": {
565
- "char": "o",
566
- "name": "target-org",
567
- "noCacheDefault": true,
568
- "required": true,
569
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
570
- "hasDynamicHelp": true,
571
- "multiple": false,
572
- "type": "option"
573
- },
574
- "api-name": {
575
- "name": "api-name",
576
- "summary": "API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name must not exist in the org.",
577
- "hasDynamicHelp": false,
578
- "multiple": false,
579
- "type": "option"
580
- },
581
- "api-version": {
582
- "description": "Override the api version used for api requests made by this command",
583
- "name": "api-version",
584
- "hasDynamicHelp": false,
585
- "multiple": false,
586
- "type": "option"
587
- },
588
- "spec": {
589
- "char": "f",
590
- "name": "spec",
591
- "summary": "Path to the agent specification file.",
592
- "hasDynamicHelp": false,
593
- "multiple": false,
594
- "type": "option"
595
- },
596
- "output-dir": {
597
- "char": "d",
598
- "name": "output-dir",
599
- "summary": "Directory where the authoring bundle files will be generated.",
600
- "hasDynamicHelp": false,
601
- "multiple": false,
602
- "type": "option"
603
- },
604
- "name": {
605
- "char": "n",
606
- "name": "name",
607
- "summary": "Name (label) of the authoring bundle.",
608
- "hasDynamicHelp": false,
609
- "multiple": false,
610
- "type": "option"
611
- }
612
- },
613
- "hasDynamicHelp": true,
614
- "hiddenAliases": [],
615
- "id": "agent:generate:authoring-bundle",
616
- "pluginAlias": "@salesforce/plugin-agent",
617
- "pluginName": "@salesforce/plugin-agent",
618
- "pluginType": "core",
619
- "strict": true,
620
- "summary": "Generate an authoring bundle from an agent specification.",
621
- "enableJsonFlag": true,
622
- "requiresProject": true,
623
- "FLAGGABLE_PROMPTS": {
624
- "name": {
625
- "message": "Name (label) of the authoring bundle.",
626
- "required": true
627
- },
628
- "api-name": {
629
- "message": "API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name must not exist in the org.",
630
- "promptMessage": "API name of the new authoring bundle"
631
- },
632
- "spec": {
633
- "message": "Path to the agent specification file.",
634
- "required": true
635
- }
636
- },
637
- "isESM": true,
638
- "relativePath": [
639
- "lib",
640
- "commands",
641
- "agent",
642
- "generate",
643
- "authoring-bundle.js"
644
- ],
645
- "aliasPermutations": [],
646
- "permutations": [
647
- "agent:generate:authoring-bundle",
648
- "generate:agent:authoring-bundle",
649
- "generate:authoring-bundle:agent",
650
- "agent:authoring-bundle:generate",
651
- "authoring-bundle:agent:generate",
652
- "authoring-bundle:generate:agent"
653
- ]
654
- },
655
535
  "agent:generate:template": {
656
536
  "aliases": [],
657
537
  "args": {},
@@ -796,89 +676,6 @@
796
676
  "test-spec:generate:agent"
797
677
  ]
798
678
  },
799
- "agent:publish:authoring-bundle": {
800
- "aliases": [],
801
- "args": {},
802
- "description": "Publishes an Agent Authoring Bundle by compiling the .agent file and creating a new agent in your org.",
803
- "examples": [
804
- "Publish an Agent Authoring Bundle:\n<%= config.bin %> <%= command.id %> --api-name path/to/bundle --agent-name \"My New Agent\" --target-org myorg@example.com"
805
- ],
806
- "flags": {
807
- "json": {
808
- "description": "Format output as json.",
809
- "helpGroup": "GLOBAL",
810
- "name": "json",
811
- "allowNo": false,
812
- "type": "boolean"
813
- },
814
- "flags-dir": {
815
- "helpGroup": "GLOBAL",
816
- "name": "flags-dir",
817
- "summary": "Import flag values from a directory.",
818
- "hasDynamicHelp": false,
819
- "multiple": false,
820
- "type": "option"
821
- },
822
- "target-org": {
823
- "char": "o",
824
- "name": "target-org",
825
- "noCacheDefault": true,
826
- "required": true,
827
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
828
- "hasDynamicHelp": true,
829
- "multiple": false,
830
- "type": "option"
831
- },
832
- "api-version": {
833
- "description": "Override the api version used for api requests made by this command",
834
- "name": "api-version",
835
- "hasDynamicHelp": false,
836
- "multiple": false,
837
- "type": "option"
838
- },
839
- "api-name": {
840
- "char": "n",
841
- "name": "api-name",
842
- "summary": "API name of the Agent Authoring Bundle to publish.",
843
- "hasDynamicHelp": false,
844
- "multiple": false,
845
- "type": "option"
846
- }
847
- },
848
- "hasDynamicHelp": true,
849
- "hiddenAliases": [],
850
- "id": "agent:publish:authoring-bundle",
851
- "pluginAlias": "@salesforce/plugin-agent",
852
- "pluginName": "@salesforce/plugin-agent",
853
- "pluginType": "core",
854
- "strict": true,
855
- "summary": "Publish an Agent Authoring Bundle as a new agent",
856
- "enableJsonFlag": true,
857
- "requiresProject": true,
858
- "FLAGGABLE_PROMPTS": {
859
- "api-name": {
860
- "message": "API name of the Agent Authoring Bundle to publish.",
861
- "promptMessage": "API name of the authoring bundle to publish"
862
- }
863
- },
864
- "isESM": true,
865
- "relativePath": [
866
- "lib",
867
- "commands",
868
- "agent",
869
- "publish",
870
- "authoring-bundle.js"
871
- ],
872
- "aliasPermutations": [],
873
- "permutations": [
874
- "agent:publish:authoring-bundle",
875
- "publish:agent:authoring-bundle",
876
- "publish:authoring-bundle:agent",
877
- "agent:authoring-bundle:publish",
878
- "authoring-bundle:agent:publish",
879
- "authoring-bundle:publish:agent"
880
- ]
881
- },
882
679
  "agent:test:create": {
883
680
  "aliases": [],
884
681
  "args": {},
@@ -1392,90 +1189,7 @@
1392
1189
  "run:agent:test",
1393
1190
  "run:test:agent"
1394
1191
  ]
1395
- },
1396
- "agent:validate:authoring-bundle": {
1397
- "aliases": [],
1398
- "args": {},
1399
- "description": "Validates an Agent Authoring Bundle by compiling the .agent file and checking for errors.",
1400
- "examples": [
1401
- "Validate an Agent Authoring Bundle:\n<%= config.bin %> <%= command.id %> --api-name path/to/bundle"
1402
- ],
1403
- "flags": {
1404
- "json": {
1405
- "description": "Format output as json.",
1406
- "helpGroup": "GLOBAL",
1407
- "name": "json",
1408
- "allowNo": false,
1409
- "type": "boolean"
1410
- },
1411
- "flags-dir": {
1412
- "helpGroup": "GLOBAL",
1413
- "name": "flags-dir",
1414
- "summary": "Import flag values from a directory.",
1415
- "hasDynamicHelp": false,
1416
- "multiple": false,
1417
- "type": "option"
1418
- },
1419
- "target-org": {
1420
- "char": "o",
1421
- "name": "target-org",
1422
- "noCacheDefault": true,
1423
- "required": true,
1424
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
1425
- "hasDynamicHelp": true,
1426
- "multiple": false,
1427
- "type": "option"
1428
- },
1429
- "api-version": {
1430
- "description": "Override the api version used for api requests made by this command",
1431
- "name": "api-version",
1432
- "hasDynamicHelp": false,
1433
- "multiple": false,
1434
- "type": "option"
1435
- },
1436
- "api-name": {
1437
- "char": "n",
1438
- "name": "api-name",
1439
- "summary": "API name of the Agent Authoring Bundle to validate.",
1440
- "hasDynamicHelp": false,
1441
- "multiple": false,
1442
- "type": "option"
1443
- }
1444
- },
1445
- "hasDynamicHelp": true,
1446
- "hiddenAliases": [],
1447
- "id": "agent:validate:authoring-bundle",
1448
- "pluginAlias": "@salesforce/plugin-agent",
1449
- "pluginName": "@salesforce/plugin-agent",
1450
- "pluginType": "core",
1451
- "strict": true,
1452
- "summary": "Validate an Agent Authoring Bundle",
1453
- "enableJsonFlag": true,
1454
- "requiresProject": true,
1455
- "FLAGGABLE_PROMPTS": {
1456
- "api-name": {
1457
- "message": "API name of the Agent Authoring Bundle to validate.",
1458
- "promptMessage": "API name of the authoring bundle to validate"
1459
- }
1460
- },
1461
- "isESM": true,
1462
- "relativePath": [
1463
- "lib",
1464
- "commands",
1465
- "agent",
1466
- "validate",
1467
- "authoring-bundle.js"
1468
- ],
1469
- "aliasPermutations": [],
1470
- "permutations": [
1471
- "agent:validate:authoring-bundle",
1472
- "validate:agent:authoring-bundle",
1473
- "validate:authoring-bundle:agent",
1474
- "agent:authoring-bundle:validate",
1475
- "authoring-bundle:agent:validate",
1476
- "authoring-bundle:validate:agent"
1477
- ]
1478
1192
  }
1479
1193
  },
1480
- "version": "1.24.14-demo.8"
1194
+ "version": "1.24.14"
1481
1195
  }
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-agent",
3
3
  "description": "Commands to interact with Salesforce agents",
4
- "version": "1.24.14-demo.8",
4
+ "version": "1.24.14",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
8
8
  "@inquirer/core": "^10.2.2",
9
- "@inquirer/prompts": "^7.8.6",
9
+ "@inquirer/prompts": "^7.8.4",
10
10
  "@oclif/core": "^4",
11
- "@oclif/multi-stage-output": "^0.8.23",
12
- "@salesforce/agents": "^0.18.1",
13
- "@salesforce/core": "^8.23.1",
11
+ "@oclif/multi-stage-output": "^0.8.22",
12
+ "@salesforce/agents": "^0.17.9",
13
+ "@salesforce/core": "^8.18.5",
14
14
  "@salesforce/kit": "^3.2.3",
15
15
  "@salesforce/sf-plugins-core": "^12.2.4",
16
- "@salesforce/source-deploy-retrieve": "^12.22.1",
16
+ "@salesforce/source-deploy-retrieve": "^12.24.0",
17
17
  "@salesforce/types": "^1.4.0",
18
18
  "ansis": "^3.3.2",
19
19
  "fast-xml-parser": "^4.5.1",
@@ -27,7 +27,7 @@
27
27
  "@oclif/plugin-command-snapshot": "^5.2.19",
28
28
  "@oclif/test": "^4.1.14",
29
29
  "@salesforce/cli-plugins-testkit": "^5.3.41",
30
- "@salesforce/dev-scripts": "^11.0.4",
30
+ "@salesforce/dev-scripts": "^10.2.12",
31
31
  "@salesforce/plugin-command-reference": "^3.1.72",
32
32
  "@types/inquirer": "^9.0.9",
33
33
  "@types/react": "^18.3.3",
@@ -47,6 +47,8 @@
47
47
  "files": [
48
48
  "/lib",
49
49
  "/messages",
50
+ "/npm-shrinkwrap.json",
51
+ "/oclif.lock",
50
52
  "/oclif.manifest.json",
51
53
  "/schemas"
52
54
  ],
@@ -60,7 +62,7 @@
60
62
  "sfdx",
61
63
  "sfdx-plugin"
62
64
  ],
63
- "license": "Apache-2.0",
65
+ "license": "BSD-3-Clause",
64
66
  "oclif": {
65
67
  "commands": "./lib/commands",
66
68
  "bin": "sf",
@@ -96,7 +98,6 @@
96
98
  "clean-all": "sf-clean all",
97
99
  "compile": "wireit",
98
100
  "docs": "sf-docs",
99
- "fix-license": "eslint src test --fix --rule \"header/header: [2]\"",
100
101
  "format": "wireit",
101
102
  "link-check": "wireit",
102
103
  "lint": "wireit",
@@ -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.24.14-demo.8.crt",
233
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.24.14-demo.8.sig"
233
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.24.14.crt",
234
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.24.14.sig"
234
235
  }
235
236
  }
@@ -1,22 +0,0 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- export type AgentGenerateAuthoringBundleResult = {
3
- agentPath: string;
4
- metaXmlPath: string;
5
- outputDir: string;
6
- };
7
- export default class AgentGenerateAuthoringBundle extends SfCommand<AgentGenerateAuthoringBundleResult> {
8
- static readonly summary: string;
9
- static readonly description: string;
10
- static readonly examples: string[];
11
- static readonly requiresProject = true;
12
- static readonly flags: {
13
- 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
14
- 'api-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
- 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
- 'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
- name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
- };
20
- private static readonly FLAGGABLE_PROMPTS;
21
- run(): Promise<AgentGenerateAuthoringBundleResult>;
22
- }
@@ -1,146 +0,0 @@
1
- /*
2
- * Copyright 2025, 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 { join, resolve } from 'node:path';
17
- import { mkdirSync, writeFileSync, readFileSync, existsSync } from 'node:fs';
18
- import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
19
- import { generateApiName, Messages, SfError } from '@salesforce/core';
20
- import { Agent } from '@salesforce/agents';
21
- import YAML from 'yaml';
22
- import { input as inquirerInput } from '@inquirer/prompts';
23
- import { theme } from '../../../inquirer-theme.js';
24
- import { promptForFlag, promptForYamlFile } from '../../../flags.js';
25
- Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
26
- const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.authoring-bundle');
27
- export default class AgentGenerateAuthoringBundle extends SfCommand {
28
- static summary = messages.getMessage('summary');
29
- static description = messages.getMessage('description');
30
- static examples = messages.getMessages('examples');
31
- static requiresProject = true;
32
- static flags = {
33
- 'target-org': Flags.requiredOrg(),
34
- 'api-name': Flags.string({
35
- summary: messages.getMessage('flags.api-name.summary'),
36
- }),
37
- 'api-version': Flags.orgApiVersion(),
38
- spec: Flags.file({
39
- summary: messages.getMessage('flags.spec.summary'),
40
- char: 'f',
41
- exists: true,
42
- }),
43
- 'output-dir': Flags.directory({
44
- summary: messages.getMessage('flags.output-dir.summary'),
45
- char: 'd',
46
- }),
47
- name: Flags.string({
48
- summary: messages.getMessage('flags.name.summary'),
49
- char: 'n',
50
- }),
51
- };
52
- static FLAGGABLE_PROMPTS = {
53
- name: {
54
- message: messages.getMessage('flags.name.summary'),
55
- validate: (d) => d.trim().length > 0 || 'Name cannot be empty or contain only whitespace',
56
- required: true,
57
- },
58
- 'api-name': {
59
- message: messages.getMessage('flags.api-name.summary'),
60
- promptMessage: messages.getMessage('flags.api-name.prompt'),
61
- validate: (d) => {
62
- if (d.length === 0) {
63
- return true;
64
- }
65
- if (d.length > 80) {
66
- return 'API name cannot be over 80 characters.';
67
- }
68
- const regex = /^[A-Za-z][A-Za-z0-9_]*[A-Za-z0-9]+$/;
69
- if (!regex.test(d)) {
70
- return 'Invalid API name.';
71
- }
72
- return true;
73
- },
74
- },
75
- spec: {
76
- message: messages.getMessage('flags.spec.summary'),
77
- validate: (d) => {
78
- const specPath = resolve(d);
79
- if (!existsSync(specPath)) {
80
- return 'Please enter an existing agent spec (yaml) file';
81
- }
82
- return true;
83
- },
84
- required: true,
85
- },
86
- };
87
- async run() {
88
- const { flags } = await this.parse(AgentGenerateAuthoringBundle);
89
- const { 'output-dir': outputDir, 'target-org': targetOrg } = flags;
90
- // If we don't have a spec yet, prompt for it
91
- const spec = flags.spec ?? (await promptForYamlFile(AgentGenerateAuthoringBundle.FLAGGABLE_PROMPTS['spec']));
92
- // If we don't have a name yet, prompt for it
93
- const name = flags['name'] ?? (await promptForFlag(AgentGenerateAuthoringBundle.FLAGGABLE_PROMPTS['name']));
94
- // If we don't have an api name yet, prompt for it
95
- let bundleApiName = flags['api-name'];
96
- if (!bundleApiName) {
97
- bundleApiName = generateApiName(name);
98
- const promptedValue = await inquirerInput({
99
- message: messages.getMessage('flags.api-name.prompt'),
100
- validate: AgentGenerateAuthoringBundle.FLAGGABLE_PROMPTS['api-name'].validate,
101
- default: bundleApiName,
102
- theme,
103
- });
104
- if (promptedValue?.length) {
105
- bundleApiName = promptedValue;
106
- }
107
- }
108
- try {
109
- // Get default output directory if not specified
110
- const defaultOutputDir = join(this.project.getDefaultPackage().fullPath, 'main', 'default');
111
- const targetOutputDir = join(outputDir ?? defaultOutputDir, 'aiAuthoringBundles', bundleApiName);
112
- // Generate file paths
113
- const agentPath = join(targetOutputDir, `${bundleApiName}.agent`);
114
- const metaXmlPath = join(targetOutputDir, `${bundleApiName}.bundle-meta.xml`);
115
- // Write Agent file
116
- const conn = targetOrg.getConnection(flags['api-version']);
117
- const specContents = YAML.parse(readFileSync(spec, 'utf8'));
118
- const agent = await Agent.createAgent(conn, specContents);
119
- // Create output directory if it doesn't exist
120
- mkdirSync(targetOutputDir, { recursive: true });
121
- writeFileSync(agentPath, agent);
122
- // Write meta.xml file
123
- const metaXml = `<?xml version="1.0" encoding="UTF-8"?>
124
- <aiAuthoringBundle>
125
- <Label>${specContents.role}</Label>
126
- <BundleType>${specContents.agentType}</BundleType>
127
- <VersionTag>Spring2026</VersionTag>
128
- <VersionDescription>Initial release for ${bundleApiName}</VersionDescription>
129
- <SourceBundleVersion></SourceBundleVersion>
130
- <Target></Target>
131
- </aiAuthoringBundle>`;
132
- writeFileSync(metaXmlPath, metaXml);
133
- this.logSuccess(`Successfully generated ${bundleApiName} Authoring Bundle`);
134
- return {
135
- agentPath,
136
- metaXmlPath,
137
- outputDir: targetOutputDir,
138
- };
139
- }
140
- catch (error) {
141
- const err = SfError.wrap(error);
142
- throw new SfError(messages.getMessage('error.failed-to-create-agent'), 'AgentGenerationError', [err.message]);
143
- }
144
- }
145
- }
146
- //# sourceMappingURL=authoring-bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authoring-bundle.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/authoring-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,KAAK,EAAgB,MAAM,oBAAoB,CAAC;AACzD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE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,aAAa,QAAQ,CAAC,CAAC;YAClE,MAAM,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE,GAAG,aAAa,kBAAkB,CAAC,CAAC;YAE9E,mBAAmB;YACnB,MAAM,IAAI,GAAG,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;YAC3D,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAiB,CAAC;YAC5E,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;YAC1D,8CAA8C;YAC9C,SAAS,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAChD,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YAEhC,sBAAsB;YACtB,MAAM,OAAO,GAAG;;WAEX,YAAY,CAAC,IAAI;gBACZ,YAAY,CAAC,SAAS;;4CAEM,aAAa;;;qBAGpC,CAAC;YAChB,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAEpC,IAAI,CAAC,UAAU,CAAC,0BAA0B,aAAa,mBAAmB,CAAC,CAAC;YAE5E,OAAO;gBACL,SAAS;gBACT,WAAW;gBACX,SAAS,EAAE,eAAe;aAC3B,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC,EAAE,sBAAsB,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QAChH,CAAC;IACH,CAAC"}
@@ -1,19 +0,0 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- export type AgentPublishAuthoringBundleResult = {
3
- success: boolean;
4
- botDeveloperName?: string;
5
- errors?: string[];
6
- };
7
- export default class AgentPublishAuthoringBundle extends SfCommand<AgentPublishAuthoringBundleResult> {
8
- static readonly summary: string;
9
- static readonly description: string;
10
- static readonly examples: string[];
11
- static readonly requiresProject = true;
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
- 'api-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- };
17
- private static readonly FLAGGABLE_PROMPTS;
18
- run(): Promise<AgentPublishAuthoringBundleResult>;
19
- }