@salesforce/afv-skills 1.7.3 → 1.7.5
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 +3 -3
- package/package.json +1 -1
- package/skills/developing-agentforce/README.md +4 -4
- package/skills/developing-agentforce/SKILL.md +37 -37
- package/skills/developing-agentforce/assets/README-legacy.md +8 -8
- package/skills/developing-agentforce/assets/agent-spec-template.md +9 -9
- package/skills/developing-agentforce/assets/agents/README.md +4 -4
- package/skills/developing-agentforce/assets/agents/hello-world.agent +3 -3
- package/skills/developing-agentforce/assets/agents/{multi-topic.agent → multi-subagent.agent} +30 -30
- package/skills/developing-agentforce/assets/agents/order-service.agent +25 -25
- package/skills/developing-agentforce/assets/agents/production-faq.agent +12 -12
- package/skills/developing-agentforce/assets/agents/simple-qa.agent +8 -8
- package/skills/developing-agentforce/assets/agents/verification-gate.agent +19 -19
- package/skills/developing-agentforce/assets/components/apex-action.agent +3 -3
- package/skills/developing-agentforce/assets/components/error-handling.agent +7 -7
- package/skills/developing-agentforce/assets/components/escalation-setup.agent +11 -11
- package/skills/developing-agentforce/assets/components/flow-action.agent +5 -5
- package/skills/developing-agentforce/assets/components/n-ary-conditions.agent +11 -11
- package/skills/developing-agentforce/assets/components/{topic-with-actions.agent → subagent-with-actions.agent} +9 -9
- package/skills/developing-agentforce/assets/deterministic-routing.agent +19 -19
- package/skills/developing-agentforce/assets/escalation-pattern.agent +13 -13
- package/skills/developing-agentforce/assets/flow-action-lookup.agent +3 -3
- package/skills/developing-agentforce/assets/hub-and-spoke.agent +18 -18
- package/skills/developing-agentforce/assets/local-info-agent-annotated.agent +37 -37
- package/skills/developing-agentforce/assets/metadata/genai-function-apex.xml +3 -3
- package/skills/developing-agentforce/assets/metadata/genai-function-flow.xml +1 -1
- package/skills/developing-agentforce/assets/metadata/genai-plugin.xml +10 -10
- package/skills/developing-agentforce/assets/minimal-starter.agent +4 -4
- package/skills/developing-agentforce/assets/patterns/README.md +21 -21
- package/skills/developing-agentforce/assets/patterns/action-callbacks.agent +4 -4
- package/skills/developing-agentforce/assets/patterns/advanced-input-bindings.agent +1 -1
- package/skills/developing-agentforce/assets/patterns/bidirectional-routing.agent +25 -25
- package/skills/developing-agentforce/assets/patterns/critical-input-collection.agent +8 -8
- package/skills/developing-agentforce/assets/patterns/delegation-routing.agent +21 -21
- package/skills/developing-agentforce/assets/patterns/lifecycle-events.agent +8 -8
- package/skills/developing-agentforce/assets/patterns/llm-controlled-actions.agent +5 -5
- package/skills/developing-agentforce/assets/patterns/multi-step-workflow.agent +3 -3
- package/skills/developing-agentforce/assets/patterns/open-gate-routing.agent +59 -58
- package/skills/developing-agentforce/assets/patterns/procedural-instructions.agent +15 -15
- package/skills/developing-agentforce/assets/patterns/prompt-template-action.agent +8 -8
- package/skills/developing-agentforce/assets/patterns/system-instruction-overrides.agent +40 -40
- package/skills/developing-agentforce/assets/prompt-rag-search.agent +9 -9
- package/skills/developing-agentforce/assets/{template-multi-topic.agent → template-multi-subagent.agent} +25 -25
- package/skills/developing-agentforce/assets/{template-single-topic.agent → template-single-subagent.agent} +14 -14
- package/skills/developing-agentforce/assets/verification-gate.agent +16 -16
- package/skills/developing-agentforce/references/action-prompt-templates.md +1 -1
- package/skills/developing-agentforce/references/actions-reference.md +4 -4
- package/skills/developing-agentforce/references/agent-design-and-spec-creation.md +107 -107
- package/skills/developing-agentforce/references/agent-metadata-and-lifecycle.md +5 -5
- package/skills/developing-agentforce/references/agent-script-core-language.md +79 -79
- package/skills/developing-agentforce/references/{agent-topic-map-diagrams.md → agent-subagent-map-diagrams.md} +65 -65
- package/skills/developing-agentforce/references/agent-user-setup.md +2 -2
- package/skills/developing-agentforce/references/agent-validation-and-debugging.md +55 -55
- package/skills/developing-agentforce/references/architecture-patterns.md +33 -33
- package/skills/developing-agentforce/references/deploy-reference.md +1 -1
- package/skills/developing-agentforce/references/discover-reference.md +1 -1
- package/skills/developing-agentforce/references/examples.md +32 -32
- package/skills/developing-agentforce/references/feature-validity.md +3 -3
- package/skills/developing-agentforce/references/instruction-resolution.md +29 -29
- package/skills/developing-agentforce/references/known-issues.md +10 -10
- package/skills/developing-agentforce/references/minimal-examples.md +6 -6
- package/skills/developing-agentforce/references/production-gotchas.md +22 -22
- package/skills/developing-agentforce/references/safety-review-reference.md +2 -2
- package/skills/developing-agentforce/references/scoring-rubric.md +3 -3
- package/skills/developing-datacloud-code-extension/SKILL.md +321 -0
- package/skills/developing-datacloud-code-extension/references/README.md +193 -0
- package/skills/developing-datacloud-code-extension/references/quick-reference.md +269 -0
- package/skills/generating-permission-set/SKILL.md +1 -1
- package/skills/getting-datacloud-schema/SKILL.md +380 -0
- package/skills/getting-datacloud-schema/references/README.md +191 -0
- package/skills/getting-datacloud-schema/scripts/get_dlo_schema.py +244 -0
- package/skills/getting-datacloud-schema/scripts/get_dmo_schema.py +233 -0
- package/skills/observing-agentforce/SKILL.md +8 -8
- package/skills/observing-agentforce/apex/AgentforceOptimizeService.cls +2 -2
- package/skills/observing-agentforce/references/improve-reference.md +40 -40
- package/skills/observing-agentforce/references/issue-classification.md +47 -47
- package/skills/observing-agentforce/references/reproduce-reference.md +7 -7
- package/skills/observing-agentforce/references/stdm-queries.md +7 -7
- package/skills/observing-agentforce/references/stdm-schema.md +2 -2
- package/skills/testing-agentforce/SKILL.md +9 -9
- package/skills/testing-agentforce/assets/basic-test-spec.yaml +4 -0
- package/skills/testing-agentforce/assets/guardrail-test-spec.yaml +4 -0
- package/skills/testing-agentforce/assets/standard-test-spec.yaml +8 -4
- package/skills/testing-agentforce/references/batch-testing.md +17 -17
- package/skills/testing-agentforce/references/preview-testing.md +25 -25
- package/skills/testing-agentforce/references/test-report-format.md +6 -6
- package/skills/trigger-refactor-pipeline/SKILL.md +0 -191
- package/skills/trigger-refactor-pipeline/assets/test_template.apex +0 -321
- package/skills/trigger-refactor-pipeline/references/handler_patterns.md +0 -442
- package/skills/trigger-refactor-pipeline/scripts/analyze_trigger.py +0 -258
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# A complex real-world agent for e-commerce customer service featuring:
|
|
5
5
|
# - Verification gate before order access
|
|
6
|
-
# - Multiple specialized
|
|
6
|
+
# - Multiple specialized subagents (order status, tracking, returns)
|
|
7
7
|
# - Two-level action system with Flow targets
|
|
8
8
|
# - after_reasoning for post-action routing
|
|
9
9
|
# - available when guards for conditional action visibility
|
|
@@ -59,30 +59,30 @@ language:
|
|
|
59
59
|
additional_locales: ""
|
|
60
60
|
all_additional_locales: False
|
|
61
61
|
|
|
62
|
-
start_agent
|
|
63
|
-
description: "Route customers through verification then to the right
|
|
62
|
+
start_agent agent_router:
|
|
63
|
+
description: "Route customers through verification then to the right subagent"
|
|
64
64
|
reasoning:
|
|
65
65
|
instructions: |
|
|
66
66
|
You are a router only. Do NOT answer questions or provide help directly.
|
|
67
67
|
Route all users to identity verification first.
|
|
68
|
-
If already verified, route to the appropriate
|
|
68
|
+
If already verified, route to the appropriate subagent:
|
|
69
69
|
- Order questions -> use to_orders
|
|
70
70
|
- Returns -> use to_returns
|
|
71
71
|
- Tracking -> use to_tracking
|
|
72
72
|
actions:
|
|
73
|
-
to_verify: @utils.transition to @
|
|
73
|
+
to_verify: @utils.transition to @subagent.verification
|
|
74
74
|
description: "Begin identity verification"
|
|
75
|
-
to_orders: @utils.transition to @
|
|
75
|
+
to_orders: @utils.transition to @subagent.order_status
|
|
76
76
|
description: "Check order status"
|
|
77
77
|
available when @variables.customer_verified == True
|
|
78
|
-
to_returns: @utils.transition to @
|
|
78
|
+
to_returns: @utils.transition to @subagent.returns
|
|
79
79
|
description: "Process a return"
|
|
80
80
|
available when @variables.customer_verified == True
|
|
81
|
-
to_tracking: @utils.transition to @
|
|
81
|
+
to_tracking: @utils.transition to @subagent.shipment_tracking
|
|
82
82
|
description: "Track a shipment"
|
|
83
83
|
available when @variables.customer_verified == True
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
subagent verification:
|
|
86
86
|
label: "Identity Verification"
|
|
87
87
|
description: "Verify customer identity before accessing order information"
|
|
88
88
|
|
|
@@ -115,14 +115,14 @@ topic verification:
|
|
|
115
115
|
set @variables.customer_verified = @outputs.verified
|
|
116
116
|
set @variables.customer_email = @outputs.customer_name
|
|
117
117
|
|
|
118
|
-
proceed_to_orders: @utils.transition to @
|
|
118
|
+
proceed_to_orders: @utils.transition to @subagent.order_status
|
|
119
119
|
description: "Move to order lookup"
|
|
120
120
|
available when @variables.customer_verified == True
|
|
121
121
|
|
|
122
122
|
escalate_now: @utils.escalate
|
|
123
123
|
description: "Transfer to human agent"
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
subagent order_status:
|
|
126
126
|
label: "Order Status"
|
|
127
127
|
description: "Look up order details and provide status updates"
|
|
128
128
|
|
|
@@ -164,18 +164,18 @@ topic order_status:
|
|
|
164
164
|
set @variables.order_status = @outputs.status
|
|
165
165
|
set @variables.tracking_number = @outputs.tracking_number
|
|
166
166
|
|
|
167
|
-
to_returns: @utils.transition to @
|
|
167
|
+
to_returns: @utils.transition to @subagent.returns
|
|
168
168
|
description: "Start a return"
|
|
169
169
|
available when @variables.order_status != ""
|
|
170
170
|
|
|
171
|
-
to_tracking: @utils.transition to @
|
|
171
|
+
to_tracking: @utils.transition to @subagent.shipment_tracking
|
|
172
172
|
description: "Track shipment"
|
|
173
173
|
available when @variables.tracking_number != ""
|
|
174
174
|
|
|
175
|
-
back: @utils.transition to @
|
|
176
|
-
description: "Route to a different
|
|
175
|
+
back: @utils.transition to @subagent.agent_router
|
|
176
|
+
description: "Route to a different subagent"
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
subagent shipment_tracking:
|
|
179
179
|
label: "Shipment Tracking"
|
|
180
180
|
description: "Track shipment status and estimated delivery"
|
|
181
181
|
|
|
@@ -208,10 +208,10 @@ topic shipment_tracking:
|
|
|
208
208
|
description: "Get tracking details"
|
|
209
209
|
with tracking_number = @variables.tracking_number
|
|
210
210
|
|
|
211
|
-
back: @utils.transition to @
|
|
212
|
-
description: "Route to a different
|
|
211
|
+
back: @utils.transition to @subagent.agent_router
|
|
212
|
+
description: "Route to a different subagent"
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
subagent returns:
|
|
215
215
|
label: "Returns"
|
|
216
216
|
description: "Process return requests and generate return labels"
|
|
217
217
|
|
|
@@ -251,14 +251,14 @@ topic returns:
|
|
|
251
251
|
set @variables.return_initiated = True
|
|
252
252
|
set @variables.return_label_url = @outputs.return_label_url
|
|
253
253
|
|
|
254
|
-
back: @utils.transition to @
|
|
255
|
-
description: "Route to a different
|
|
254
|
+
back: @utils.transition to @subagent.agent_router
|
|
255
|
+
description: "Route to a different subagent"
|
|
256
256
|
|
|
257
257
|
after_reasoning: ->
|
|
258
258
|
if @variables.return_initiated == True:
|
|
259
|
-
transition to @
|
|
259
|
+
transition to @subagent.follow_up
|
|
260
260
|
|
|
261
|
-
|
|
261
|
+
subagent follow_up:
|
|
262
262
|
label: "Follow Up"
|
|
263
263
|
description: "Handle follow-up actions and next steps"
|
|
264
264
|
reasoning:
|
|
@@ -266,7 +266,7 @@ topic follow_up:
|
|
|
266
266
|
The customer's request has been processed.
|
|
267
267
|
Ask if there is anything else you can help with.
|
|
268
268
|
actions:
|
|
269
|
-
new_order: @utils.transition to @
|
|
269
|
+
new_order: @utils.transition to @subagent.order_status
|
|
270
270
|
description: "Look up another order"
|
|
271
|
-
back: @utils.transition to @
|
|
271
|
+
back: @utils.transition to @subagent.agent_router
|
|
272
272
|
description: "Start over"
|
|
@@ -29,7 +29,7 @@ variables:
|
|
|
29
29
|
user_question: mutable string
|
|
30
30
|
description: "The user's current question"
|
|
31
31
|
conversation_topic: mutable string
|
|
32
|
-
description: "The current
|
|
32
|
+
description: "The current subject being discussed"
|
|
33
33
|
question_count: mutable number
|
|
34
34
|
description: "Number of questions answered in this session"
|
|
35
35
|
|
|
@@ -38,20 +38,20 @@ language:
|
|
|
38
38
|
additional_locales: ""
|
|
39
39
|
all_additional_locales: False
|
|
40
40
|
|
|
41
|
-
start_agent
|
|
42
|
-
label: "
|
|
41
|
+
start_agent agent_router:
|
|
42
|
+
label: "Subagent Router"
|
|
43
43
|
description: "Routes incoming questions to the FAQ handler"
|
|
44
44
|
|
|
45
45
|
reasoning:
|
|
46
46
|
instructions: ->
|
|
47
47
|
| Listen to the user's question and determine how to help.
|
|
48
|
-
| If the question is about a specific
|
|
48
|
+
| If the question is about a specific subject, note it.
|
|
49
49
|
| Route to the FAQ handler for processing.
|
|
50
50
|
actions:
|
|
51
|
-
handle_faq: @utils.transition to @
|
|
52
|
-
end_conversation: @utils.transition to @
|
|
51
|
+
handle_faq: @utils.transition to @subagent.faq_handler
|
|
52
|
+
end_conversation: @utils.transition to @subagent.farewell
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
subagent faq_handler:
|
|
55
55
|
label: "FAQ Handler"
|
|
56
56
|
description: "Handles frequently asked questions and provides helpful answers"
|
|
57
57
|
|
|
@@ -74,11 +74,11 @@ topic faq_handler:
|
|
|
74
74
|
| - Suggest contacting customer support
|
|
75
75
|
| - Offer to help with something else
|
|
76
76
|
actions:
|
|
77
|
-
new_question: @utils.transition to @
|
|
78
|
-
end_conversation: @utils.transition to @
|
|
79
|
-
escalate: @utils.transition to @
|
|
77
|
+
new_question: @utils.transition to @subagent.agent_router
|
|
78
|
+
end_conversation: @utils.transition to @subagent.farewell
|
|
79
|
+
escalate: @utils.transition to @subagent.escalation
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
subagent farewell:
|
|
82
82
|
label: "Farewell"
|
|
83
83
|
description: "Ends the conversation politely"
|
|
84
84
|
|
|
@@ -88,7 +88,7 @@ topic farewell:
|
|
|
88
88
|
| Wish them a great day.
|
|
89
89
|
| Let them know they can return anytime for more help.
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
subagent escalation:
|
|
92
92
|
label: "Escalation"
|
|
93
93
|
description: "Handles requests to speak with a human agent"
|
|
94
94
|
|
|
@@ -35,8 +35,8 @@ language:
|
|
|
35
35
|
additional_locales: ""
|
|
36
36
|
all_additional_locales: False
|
|
37
37
|
|
|
38
|
-
start_agent
|
|
39
|
-
label: "
|
|
38
|
+
start_agent agent_router:
|
|
39
|
+
label: "Subagent Router"
|
|
40
40
|
description: "Routes incoming requests to the Q&A handler"
|
|
41
41
|
|
|
42
42
|
reasoning:
|
|
@@ -44,10 +44,10 @@ start_agent topic_selector:
|
|
|
44
44
|
| Listen to the user's question.
|
|
45
45
|
| Route to the Q&A handler for processing.
|
|
46
46
|
actions:
|
|
47
|
-
handle_question: @utils.transition to @
|
|
48
|
-
end_conversation: @utils.transition to @
|
|
47
|
+
handle_question: @utils.transition to @subagent.qa_handler
|
|
48
|
+
end_conversation: @utils.transition to @subagent.farewell
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
subagent qa_handler:
|
|
51
51
|
label: "Q&A Handler"
|
|
52
52
|
description: "Handles questions and provides answers"
|
|
53
53
|
|
|
@@ -58,10 +58,10 @@ topic qa_handler:
|
|
|
58
58
|
| Keep responses clear and easy to understand.
|
|
59
59
|
| If you need more information, ask clarifying questions.
|
|
60
60
|
actions:
|
|
61
|
-
new_question: @utils.transition to @
|
|
62
|
-
end_conversation: @utils.transition to @
|
|
61
|
+
new_question: @utils.transition to @subagent.agent_router
|
|
62
|
+
end_conversation: @utils.transition to @subagent.farewell
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
subagent farewell:
|
|
65
65
|
label: "Farewell"
|
|
66
66
|
description: "Ends the conversation gracefully"
|
|
67
67
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Verification Gate Architecture Template
|
|
2
2
|
# ========================================
|
|
3
3
|
#
|
|
4
|
-
# Users must pass identity verification before accessing protected
|
|
4
|
+
# Users must pass identity verification before accessing protected subagents.
|
|
5
5
|
#
|
|
6
6
|
# Pattern: Security gate before protected functionality.
|
|
7
7
|
# Use when: Handling sensitive data, payments, PII access.
|
|
@@ -58,26 +58,26 @@ language:
|
|
|
58
58
|
additional_locales: ""
|
|
59
59
|
all_additional_locales: False
|
|
60
60
|
|
|
61
|
-
start_agent
|
|
61
|
+
start_agent agent_router:
|
|
62
62
|
description: "Route through identity verification"
|
|
63
63
|
reasoning:
|
|
64
64
|
instructions: |
|
|
65
65
|
You are a router only. Do NOT answer questions or provide help directly.
|
|
66
66
|
Route all users to identity verification first.
|
|
67
|
-
If already verified, route to the appropriate
|
|
67
|
+
If already verified, route to the appropriate subagent:
|
|
68
68
|
- Account questions -> use to_account
|
|
69
69
|
- Refund requests -> use to_refund
|
|
70
70
|
actions:
|
|
71
|
-
to_verify: @utils.transition to @
|
|
71
|
+
to_verify: @utils.transition to @subagent.identity_verification
|
|
72
72
|
description: "Begin identity verification"
|
|
73
|
-
to_account: @utils.transition to @
|
|
73
|
+
to_account: @utils.transition to @subagent.account_management
|
|
74
74
|
description: "Access account settings"
|
|
75
75
|
available when @variables.customer_verified == True
|
|
76
|
-
to_refund: @utils.transition to @
|
|
76
|
+
to_refund: @utils.transition to @subagent.refund_processor
|
|
77
77
|
description: "Process a refund request"
|
|
78
78
|
available when @variables.customer_verified == True
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
subagent identity_verification:
|
|
81
81
|
label: "Identity Verification"
|
|
82
82
|
description: "Verify customer identity before proceeding"
|
|
83
83
|
|
|
@@ -96,7 +96,7 @@ topic identity_verification:
|
|
|
96
96
|
instructions: ->
|
|
97
97
|
if @variables.failed_attempts >= 3:
|
|
98
98
|
| Too many failed attempts. Transferring to a human agent.
|
|
99
|
-
transition to @
|
|
99
|
+
transition to @subagent.escalation
|
|
100
100
|
|
|
101
101
|
if @variables.customer_verified == True:
|
|
102
102
|
| Identity verified! How can I help you today?
|
|
@@ -110,18 +110,18 @@ topic identity_verification:
|
|
|
110
110
|
with email = ...
|
|
111
111
|
set @variables.customer_verified = @outputs.verified
|
|
112
112
|
|
|
113
|
-
go_to_account: @utils.transition to @
|
|
113
|
+
go_to_account: @utils.transition to @subagent.account_management
|
|
114
114
|
description: "Access account settings"
|
|
115
115
|
available when @variables.customer_verified == True
|
|
116
116
|
|
|
117
|
-
go_to_refund: @utils.transition to @
|
|
117
|
+
go_to_refund: @utils.transition to @subagent.refund_processor
|
|
118
118
|
description: "Process a refund request"
|
|
119
119
|
available when @variables.customer_verified == True
|
|
120
120
|
|
|
121
121
|
escalate_now: @utils.escalate
|
|
122
122
|
description: "Transfer to human agent"
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
subagent account_management:
|
|
125
125
|
label: "Account Management"
|
|
126
126
|
description: "Manage customer account settings (requires verification)"
|
|
127
127
|
|
|
@@ -151,7 +151,7 @@ topic account_management:
|
|
|
151
151
|
reasoning:
|
|
152
152
|
instructions: ->
|
|
153
153
|
if @variables.customer_verified == False:
|
|
154
|
-
transition to @
|
|
154
|
+
transition to @subagent.identity_verification
|
|
155
155
|
|
|
156
156
|
| Welcome to account management.
|
|
157
157
|
| What would you like to do with your account?
|
|
@@ -169,10 +169,10 @@ topic account_management:
|
|
|
169
169
|
with pref_value = ...
|
|
170
170
|
available when @variables.customer_verified == True
|
|
171
171
|
|
|
172
|
-
back: @utils.transition to @
|
|
172
|
+
back: @utils.transition to @subagent.agent_router
|
|
173
173
|
description: "Return to main menu"
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
subagent refund_processor:
|
|
176
176
|
label: "Refund Processor"
|
|
177
177
|
description: "Process refund requests (requires verification)"
|
|
178
178
|
|
|
@@ -225,13 +225,13 @@ topic refund_processor:
|
|
|
225
225
|
reasoning:
|
|
226
226
|
instructions: ->
|
|
227
227
|
if @variables.customer_verified == False:
|
|
228
|
-
transition to @
|
|
228
|
+
transition to @subagent.identity_verification
|
|
229
229
|
|
|
230
230
|
if @variables.refund_status == "Approved":
|
|
231
231
|
run @actions.create_crm_case
|
|
232
232
|
with customer_id = @variables.ContactId
|
|
233
233
|
with refund_amount = @variables.refund_amount
|
|
234
|
-
transition to @
|
|
234
|
+
transition to @subagent.success_confirmation
|
|
235
235
|
|
|
236
236
|
run @actions.check_churn_risk
|
|
237
237
|
with customer_id = @variables.ContactId
|
|
@@ -257,7 +257,7 @@ topic refund_processor:
|
|
|
257
257
|
with amount = 10
|
|
258
258
|
set @variables.refund_status = @outputs.status
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
subagent success_confirmation:
|
|
261
261
|
label: "Success Confirmation"
|
|
262
262
|
description: "Confirm successful operation"
|
|
263
263
|
reasoning:
|
|
@@ -265,10 +265,10 @@ topic success_confirmation:
|
|
|
265
265
|
Great news! Your request has been processed successfully.
|
|
266
266
|
Is there anything else I can help you with?
|
|
267
267
|
actions:
|
|
268
|
-
new_request: @utils.transition to @
|
|
268
|
+
new_request: @utils.transition to @subagent.agent_router
|
|
269
269
|
description: "Start a new request"
|
|
270
270
|
|
|
271
|
-
|
|
271
|
+
subagent escalation:
|
|
272
272
|
label: "Escalation"
|
|
273
273
|
description: "Escalate to human agent"
|
|
274
274
|
reasoning:
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Apex-Based Action Template
|
|
2
2
|
# Define an action that calls a Salesforce Apex @InvocableMethod
|
|
3
|
-
# This is a PARTIAL template - define actions inside a
|
|
3
|
+
# This is a PARTIAL template - define actions inside a subagent block
|
|
4
4
|
#
|
|
5
5
|
# Usage: Replace {{placeholders}} with your values
|
|
6
|
-
# Place this inside a
|
|
6
|
+
# Place this inside a subagent's actions: block
|
|
7
7
|
#
|
|
8
8
|
# ⚠️ The target format is apex://ClassName (NOT ClassName.MethodName)
|
|
9
9
|
# The runtime auto-discovers the @InvocableMethod on the class.
|
|
10
10
|
# ⚠️ NO GenAiFunction metadata needed for AiAuthoringBundle (Agent Script).
|
|
11
11
|
|
|
12
|
-
# Action Definition (place inside
|
|
12
|
+
# Action Definition (place inside subagent's actions: block)
|
|
13
13
|
{{action_name}}:
|
|
14
14
|
description: "{{ActionDescription}}"
|
|
15
15
|
inputs:
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# Error Handling
|
|
2
|
-
# A
|
|
1
|
+
# Error Handling Subagent Template
|
|
2
|
+
# A subagent with validation and guard clauses for critical operations
|
|
3
3
|
# This is a PARTIAL template - use within a complete agent file
|
|
4
4
|
#
|
|
5
5
|
# Usage: Replace {{placeholders}} with your values
|
|
6
6
|
# Note: Includes validation patterns and error handling
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
label: "{{
|
|
10
|
-
description: "{{
|
|
8
|
+
subagent {{subagent_name}}:
|
|
9
|
+
label: "{{SubagentLabel}}"
|
|
10
|
+
description: "{{SubagentDescription}} - includes validation and error handling"
|
|
11
11
|
|
|
12
12
|
actions:
|
|
13
13
|
{{action_name}}:
|
|
@@ -52,7 +52,7 @@ topic {{topic_name}}:
|
|
|
52
52
|
available when @variables.validation_passed == True
|
|
53
53
|
|
|
54
54
|
# Handle errors
|
|
55
|
-
retry_operation: @utils.transition to @
|
|
55
|
+
retry_operation: @utils.transition to @subagent.{{subagent_name}}
|
|
56
56
|
available when @variables.operation_success == False
|
|
57
57
|
|
|
58
|
-
back_to_menu: @utils.transition to @
|
|
58
|
+
back_to_menu: @utils.transition to @subagent.agent_router
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
# ★ Key Components:
|
|
10
10
|
# 1. connection messaging: block - defines routing destination
|
|
11
11
|
# 2. @utils.escalate action - triggers the transfer
|
|
12
|
-
# 3. escalation
|
|
12
|
+
# 3. escalation subagent - handles the handoff flow
|
|
13
13
|
#
|
|
14
14
|
# ★ Prerequisites:
|
|
15
15
|
# - Omni-Channel configured in Salesforce
|
|
@@ -46,7 +46,7 @@ variables:
|
|
|
46
46
|
escalation_requested: mutable boolean = False
|
|
47
47
|
description: "Whether customer requested human agent"
|
|
48
48
|
escalation_reason: mutable string
|
|
49
|
-
description: "Reason for escalation"
|
|
49
|
+
description: "Reason for escalation subagent"
|
|
50
50
|
# ⚠️ Use 'number' not 'integer' - integer type is NOT supported in AiAuthoringBundle
|
|
51
51
|
attempts_before_escalation: mutable number = 0
|
|
52
52
|
description: "Number of attempts before escalating"
|
|
@@ -83,9 +83,9 @@ connection messaging:
|
|
|
83
83
|
# adaptive_response_allowed: False
|
|
84
84
|
|
|
85
85
|
# Entry point
|
|
86
|
-
start_agent
|
|
87
|
-
label: "
|
|
88
|
-
description: "Routes users to appropriate
|
|
86
|
+
start_agent agent_router:
|
|
87
|
+
label: "Subagent Router"
|
|
88
|
+
description: "Routes users to appropriate subagents based on intent"
|
|
89
89
|
|
|
90
90
|
reasoning:
|
|
91
91
|
instructions: ->
|
|
@@ -93,11 +93,11 @@ start_agent topic_selector:
|
|
|
93
93
|
| If they ask for a human or live agent, route to escalation.
|
|
94
94
|
| Otherwise, try to help them directly.
|
|
95
95
|
actions:
|
|
96
|
-
go_help: @utils.transition to @
|
|
97
|
-
go_escalation: @utils.transition to @
|
|
96
|
+
go_help: @utils.transition to @subagent.help
|
|
97
|
+
go_escalation: @utils.transition to @subagent.escalation
|
|
98
98
|
available when @variables.escalation_requested == True
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
subagent help:
|
|
101
101
|
label: "Help"
|
|
102
102
|
description: "Provides assistance to customers"
|
|
103
103
|
|
|
@@ -117,11 +117,11 @@ topic help:
|
|
|
117
117
|
| Track escalation reason if provided:
|
|
118
118
|
set @variables.escalation_reason = ...
|
|
119
119
|
actions:
|
|
120
|
-
offer_escalation: @utils.transition to @
|
|
120
|
+
offer_escalation: @utils.transition to @subagent.escalation
|
|
121
121
|
|
|
122
|
-
immediate_escalation: @utils.transition to @
|
|
122
|
+
immediate_escalation: @utils.transition to @subagent.escalation
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
subagent escalation:
|
|
125
125
|
label: "Escalation"
|
|
126
126
|
description: "Transfers conversation to human agent"
|
|
127
127
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Flow-Based Action Template
|
|
2
2
|
# Define an action that calls a Salesforce Flow
|
|
3
|
-
# This is a PARTIAL template - define actions inside a
|
|
3
|
+
# This is a PARTIAL template - define actions inside a subagent block
|
|
4
4
|
#
|
|
5
5
|
# ⚠️ NOTE ON DEPLOYMENT METHODS:
|
|
6
6
|
# - AiAuthoringBundle: `with`/`set` clauses ARE supported (TDD validated v1.7.0+)
|
|
7
7
|
# - GenAiPlannerBundle: Full syntax including `with`/`set` also supported
|
|
8
8
|
#
|
|
9
9
|
# Both deployment methods support the Two-Level Action System:
|
|
10
|
-
# Level 1: Action definition in
|
|
10
|
+
# Level 1: Action definition in subagent `actions:` block (with target/inputs/outputs)
|
|
11
11
|
# Level 2: Action invocation in `reasoning.actions:` block (with `with`/`set` clauses)
|
|
12
12
|
#
|
|
13
13
|
# Usage: Replace {{placeholders}} with your values
|
|
14
|
-
# Place this inside a
|
|
14
|
+
# Place this inside a subagent's actions: block
|
|
15
15
|
|
|
16
|
-
# Action Definition (place inside
|
|
16
|
+
# Action Definition (place inside subagent's actions: block)
|
|
17
17
|
{{action_name}}:
|
|
18
18
|
description: "{{ActionDescription}}"
|
|
19
19
|
inputs:
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
# | Help the user with their request.
|
|
55
55
|
# | Use the available actions when needed.
|
|
56
56
|
# actions:
|
|
57
|
-
# back_to_menu: @utils.transition to @
|
|
57
|
+
# back_to_menu: @utils.transition to @subagent.agent_router
|
|
58
58
|
|
|
59
59
|
# Common Flow Target Patterns:
|
|
60
60
|
# - flow://Get_Account_Details
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
# ═══════════════════════════════════════════════════════════════
|
|
24
24
|
|
|
25
25
|
# Example: Require multiple authentication checks
|
|
26
|
-
|
|
26
|
+
subagent secure_action:
|
|
27
27
|
label: "Secure Action"
|
|
28
28
|
description: "Performs security-sensitive operations"
|
|
29
29
|
|
|
30
30
|
before_reasoning:
|
|
31
31
|
# All three conditions must be true
|
|
32
32
|
if @variables.is_authenticated and @variables.has_permission and @variables.session_valid:
|
|
33
|
-
transition to @
|
|
34
|
-
# Otherwise stay in this
|
|
33
|
+
transition to @subagent.authorized_action
|
|
34
|
+
# Otherwise stay in this subagent
|
|
35
35
|
|
|
36
36
|
reasoning:
|
|
37
37
|
instructions: ->
|
|
@@ -42,22 +42,22 @@ topic secure_action:
|
|
|
42
42
|
# ═══════════════════════════════════════════════════════════════
|
|
43
43
|
|
|
44
44
|
# Example: Any elevated role gets access
|
|
45
|
-
|
|
45
|
+
subagent admin_panel:
|
|
46
46
|
label: "Admin Panel"
|
|
47
47
|
description: "Administrative features"
|
|
48
48
|
|
|
49
49
|
before_reasoning:
|
|
50
50
|
# Any one of these roles grants access
|
|
51
51
|
if @variables.is_admin or @variables.is_moderator or @variables.is_superuser:
|
|
52
|
-
transition to @
|
|
52
|
+
transition to @subagent.admin_features
|
|
53
53
|
# Non-admins redirected
|
|
54
|
-
transition to @
|
|
54
|
+
transition to @subagent.access_denied
|
|
55
55
|
|
|
56
56
|
# ═══════════════════════════════════════════════════════════════
|
|
57
57
|
# PATTERN 3: N-ary conditions in available when
|
|
58
58
|
# ═══════════════════════════════════════════════════════════════
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
subagent order_management:
|
|
61
61
|
label: "Order Management"
|
|
62
62
|
description: "Handles order operations"
|
|
63
63
|
|
|
@@ -84,14 +84,14 @@ topic order_management:
|
|
|
84
84
|
# PATTERN 4: Complex grouped conditions
|
|
85
85
|
# ═══════════════════════════════════════════════════════════════
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
subagent smart_routing:
|
|
88
88
|
label: "Smart Routing"
|
|
89
89
|
description: "Routes based on complex criteria"
|
|
90
90
|
|
|
91
91
|
before_reasoning:
|
|
92
92
|
# Premium with any product type OR standard with warranty
|
|
93
93
|
if (@variables.tier == "premium" and @variables.product_type != None) or (@variables.tier == "standard" and @variables.has_warranty == True):
|
|
94
|
-
transition to @
|
|
94
|
+
transition to @subagent.priority_support
|
|
95
95
|
|
|
96
96
|
# ═══════════════════════════════════════════════════════════════
|
|
97
97
|
# ANTI-PATTERNS - DO NOT USE
|
|
@@ -102,9 +102,9 @@ topic smart_routing:
|
|
|
102
102
|
# if @variables.a == True:
|
|
103
103
|
# if @variables.b == True:
|
|
104
104
|
# if @variables.c == True:
|
|
105
|
-
# transition to @
|
|
105
|
+
# transition to @subagent.x
|
|
106
106
|
|
|
107
107
|
# ✅ CORRECT - Flat N-ary condition
|
|
108
108
|
# before_reasoning:
|
|
109
109
|
# if @variables.a == True and @variables.b == True and @variables.c == True:
|
|
110
|
-
# transition to @
|
|
110
|
+
# transition to @subagent.x
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
#
|
|
2
|
-
# A
|
|
1
|
+
# Subagent with Actions Template
|
|
2
|
+
# A subagent that integrates with external systems via Flow or Apex actions
|
|
3
3
|
# This is a PARTIAL template - use within a complete agent file
|
|
4
4
|
#
|
|
5
5
|
# Two-Level Action System:
|
|
6
|
-
# Level 1:
|
|
6
|
+
# Level 1: subagent.actions block DEFINES actions (with target:, inputs:, outputs:)
|
|
7
7
|
# Level 2: reasoning.actions block INVOKES them (with @actions.name, with/set)
|
|
8
8
|
#
|
|
9
9
|
# Usage: Replace {{placeholders}} with your values
|
|
10
|
-
# Note: Actions defined inside
|
|
10
|
+
# Note: Actions defined inside subagent are local to that subagent
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
description: "{{
|
|
12
|
+
subagent {{subagent_name}}:
|
|
13
|
+
description: "{{SubagentDescription}}"
|
|
14
14
|
|
|
15
|
-
# Level 1: DEFINE actions available to this
|
|
15
|
+
# Level 1: DEFINE actions available to this subagent
|
|
16
16
|
actions:
|
|
17
17
|
{{action_name}}:
|
|
18
18
|
description: "{{ActionDescription}}"
|
|
@@ -26,7 +26,7 @@ topic {{topic_name}}:
|
|
|
26
26
|
|
|
27
27
|
reasoning:
|
|
28
28
|
instructions: ->
|
|
29
|
-
| {{
|
|
29
|
+
| {{SubagentInstructions}}
|
|
30
30
|
| Use the available actions to help the user.
|
|
31
31
|
| Capture and communicate results clearly.
|
|
32
32
|
|
|
@@ -36,5 +36,5 @@ topic {{topic_name}}:
|
|
|
36
36
|
with {{input_name}}=...
|
|
37
37
|
set @variables.{{result_variable}} = @outputs.{{output_name}}
|
|
38
38
|
|
|
39
|
-
back_to_menu: @utils.transition to @
|
|
39
|
+
back_to_menu: @utils.transition to @subagent.agent_router
|
|
40
40
|
description: "Return to main menu"
|