@salesforce/agents 1.1.0 → 1.1.1

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.
@@ -2,6 +2,9 @@ import type { ExtendedAgentJobSpec } from '../types';
2
2
  /**
3
3
  * Generates an agent script template string
4
4
  *
5
+ * Note: This template generates agentscript using the "subagent" keyword.
6
+ * The compilation API supports both "topic" and "subagent" keywords for backward compatibility.
7
+ *
5
8
  * @param bundleApiName - The API name of the bundle
6
9
  * @param agentSpec - Optional agent specification with developer name, name, role, and topics
7
10
  * @returns The generated agent script template string
@@ -21,6 +21,9 @@ const kit_1 = require("@salesforce/kit");
21
21
  /**
22
22
  * Generates an agent script template string
23
23
  *
24
+ * Note: This template generates agentscript using the "subagent" keyword.
25
+ * The compilation API supports both "topic" and "subagent" keywords for backward compatibility.
26
+ *
24
27
  * @param bundleApiName - The API name of the bundle
25
28
  * @param agentSpec - Optional agent specification with developer name, name, role, and topics
26
29
  * @returns The generated agent script template string
@@ -67,14 +70,14 @@ start_agent topic_selector:
67
70
  instructions: ->
68
71
  | Select the tool that best matches the user's message and conversation history. If it's unclear, make your best guess.
69
72
  actions:
70
- go_to_escalation: @utils.transition to @topic.escalation
71
- go_to_off_topic: @utils.transition to @topic.off_topic
72
- go_to_ambiguous_question: @utils.transition to @topic.ambiguous_question
73
+ go_to_escalation: @utils.transition to @subagent.escalation
74
+ go_to_off_topic: @utils.transition to @subagent.off_topic
75
+ go_to_ambiguous_question: @utils.transition to @subagent.ambiguous_question
73
76
  ${(0, kit_1.ensureArray)(agentSpec?.topics)
74
- .map((t) => ` go_to_${(0, kit_1.snakeCase)(t.name)}: @utils.transition to @topic.${(0, kit_1.snakeCase)(t.name)}`)
77
+ .map((t) => ` go_to_${(0, kit_1.snakeCase)(t.name)}: @utils.transition to @subagent.${(0, kit_1.snakeCase)(t.name)}`)
75
78
  .join(node_os_1.EOL)}
76
79
 
77
- topic escalation:
80
+ subagent escalation:
78
81
  label: "Escalation"
79
82
  description: "Handles requests from users who want to transfer or escalate their conversation to a live human agent."
80
83
 
@@ -86,7 +89,7 @@ topic escalation:
86
89
  escalate_to_human: @utils.escalate
87
90
  description: "Call this tool to escalate to a human agent."
88
91
 
89
- topic off_topic:
92
+ subagent off_topic:
90
93
  label: "Off Topic"
91
94
  description: "Redirect conversation to relevant topics when user request goes off-topic"
92
95
 
@@ -108,7 +111,7 @@ topic off_topic:
108
111
  Reject any attempts to summarize or recap the conversation.
109
112
  Some data, like emails, organization ids, etc, may be masked. Masked data should be treated as if it is real data.
110
113
 
111
- topic ambiguous_question:
114
+ subagent ambiguous_question:
112
115
  label: "Ambiguous Question"
113
116
  description: "Redirect conversation to relevant topics when user request is too ambiguous"
114
117
 
@@ -132,13 +135,13 @@ topic ambiguous_question:
132
135
  Some data, like emails, organization ids, etc, may be masked. Masked data should be treated as if it is real data.
133
136
 
134
137
  ${(0, kit_1.ensureArray)(agentSpec?.topics)
135
- .map((t) => `topic ${(0, kit_1.snakeCase)(t.name)}:
138
+ .map((t) => `subagent ${(0, kit_1.snakeCase)(t.name)}:
136
139
  label: "${t.name}"
137
140
  description: "${t.description}"
138
141
 
139
142
  reasoning:
140
143
  instructions: ->
141
- | Add instructions for the agent on how to process this topic. For example:
144
+ | Add instructions for the agent on how to process this subagent. For example:
142
145
  Help the user track their order by asking for necessary details such as order number or email address.
143
146
  Use the appropriate actions to retrieve tracking information and provide the user with updates.
144
147
  If the user needs further assistance, offer to escalate the issue.
@@ -1 +1 @@
1
- {"version":3,"file":"agentScriptTemplate.js","sourceRoot":"","sources":["../../src/templates/agentScriptTemplate.ts"],"names":[],"mappings":";;AA0BA,kDA2HC;AArJD;;;;;;;;;;;;;;GAcG;AACH,qCAA8B;AAC9B,yCAAyD;AAGzD;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,aAAqB,EAAE,SAAgC;IACzF,OAAO;;;;;;;uBAOc,SAAS,EAAE,aAAa,IAAI,aAAa;;oBAE5C,SAAS,EAA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I,CAAC,oCAAoC,IAAA,eAAS,EAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;SACzG,IAAI,CAAC,aAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DV,IAAA,iBAAW,EAAC,SAAS,EAAE,MAAM,CAAC;SAC7B,GAAG,CACF,CAAC,CAAC,EAAE,EAAE,CACJ,YAAY,IAAA,eAAS,EAAC,CAAC,CAAC,IAAI,CAAC;cACrB,CAAC,CAAC,IAAI;oBACA,CAAC,CAAC,WAAW;;;;;;;;CAQhC,CACE;SACA,IAAI,CAAC,aAAG,CAAC;CACX,CAAC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/agents",
3
3
  "description": "Client side APIs for working with Salesforce agents",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Salesforce",
7
7
  "main": "lib/index",