sf-builder-agent 0.9.4 → 0.9.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.
package/dist/ai.js CHANGED
@@ -11,7 +11,7 @@
11
11
  */
12
12
  // ─── OpenRouter Client ───────────────────────────────────────────────
13
13
  const OPENROUTER_URL = "https://openrouter.ai/api/v1/chat/completions";
14
- const MODEL = "anthropic/claude-sonnet-4.6";
14
+ const MODEL = "anthropic/claude-opus-4.6";
15
15
  /** Check if an API key is available (OpenRouter or Anthropic). */
16
16
  export function hasApiKey() {
17
17
  return !!(process.env.OPENROUTER_API_KEY || process.env.ANTHROPIC_API_KEY);
@@ -57,29 +57,43 @@ Use this knowledge to navigate Salesforce efficiently:
57
57
 
58
58
  ### Key Setup URLs (UAT Sandbox)
59
59
  - Setup Home: /lightning/setup/SetupOneHome/home
60
- - Agentforce Studio: /lightning/setup/EinsteinCopilot/home (legacy URL slug)
60
+ - Agentforce Agents (LEGACY — avoid): /lightning/setup/EinsteinCopilot/home
61
+ - Agentforce Studio (NEW — use this): /lightning/n/standard-AgentforceStudio?c__nav=agents
62
+ - New Agent Builder (direct): /AgentAuthoring/agentAuthoringBuilder.app#/new
61
63
  - Flows: /lightning/setup/Flows/home
62
64
  - Prompt Builder: /lightning/setup/PromptTemplateSetup/home
63
65
  - Custom Objects: /lightning/setup/ObjectManager/home
64
66
  - Apex Classes: /lightning/setup/ApexClasses/home
65
67
 
66
- ### Agentforce Agent Builder Creating a New Agent
67
- The "New Agent" flow has multiple screens you MUST progress through:
68
- 1. Click "+ New Agent" button on the Agentforce Agents list page
69
- 2. **Template Selection screen** appears: "Select an agent" with two tabs: "Create from a Template" and "Create with Gen AI"
70
- - You MUST click one of the template cards (e.g., "Agentforce Employee Agent", "Agentforce Service Agent", "Sales Agent") to proceed
71
- - After clicking a template, a "Next" or "Continue" button appears — click it
72
- - If the objective mentions a specific agent type, pick the matching template
73
- - If unsure which template, use "ask_user" to ask the human which template to select
74
- 3. **Agent Details screen**: Fill in Name, API Name, Description
75
- 4. **Agent Builder** opens with tabs: Details, Topics, Actions, Instructions
68
+ ### CRITICAL: Legacy vs New Agentforce Builder
69
+ - The OLD page at /lightning/setup/EinsteinCopilot/home has a "New Agent" button that is BROKEN (throws a hidden Aura CSS error). Do NOT use it.
70
+ - If you land on the legacy page, look for the "Let's Go" link/banner that says "Try the new Agentforce Builder!" but it opens a new tab which you cannot control.
71
+ - INSTEAD: Navigate DIRECTLY to /AgentAuthoring/agentAuthoringBuilder.app#/new to create a new agent.
72
+ - To view existing agents, navigate to /lightning/n/standard-AgentforceStudio?c__nav=agents
76
73
 
77
- ### Agentforce Agent Builder — Editing an Existing Agent
74
+ ### Agentforce Builder — Creating a New Agent
75
+ Navigate directly to: /AgentAuthoring/agentAuthoringBuilder.app#/new
76
+ This opens the NEW Agentforce Builder with these elements:
77
+
78
+ 1. **"What do you want your agent to do?"** — A text area at the top where you can describe the agent's purpose. Type a description and click the "Send" button (purple arrow icon).
79
+ 2. **"Explore ready-made templates:"** — Template cards below the text area. Each card has:
80
+ - A template name (e.g., "Agentforce Service Agent", "Agentforce Employee Agent")
81
+ - A description
82
+ - A "Select" button (for available templates) OR a "Coming Soon" button (disabled/grayed out)
83
+ - Only "Agentforce Service Agent" and "Agentforce Employee Agent" currently have active "Select" buttons
84
+ 3. **To select a template**: Click the "Select" button on the template card — do NOT click the card title or description, click the actual "Select" button text.
85
+ 4. **"Name your agent" modal** appears after selecting a template OR after sending a description:
86
+ - "Agent Name" field (required) — type the agent's name
87
+ - "Developer Name" field (required) — auto-generated from Agent Name
88
+ - User assignment: "New User" radio (default) or "Select User" radio
89
+ - Click "Let's Go" button to proceed (button is disabled until Agent Name is filled)
90
+ 5. **Agent Builder** opens — this is where you configure topics, actions, and instructions.
91
+
92
+ ### Agentforce Builder — Editing an Existing Agent
78
93
  When editing an agent that already exists:
79
- - **Details tab**: Set Name, API Name, Description
80
- - **Topics tab**: Add topics (each topic = a capability domain the agent handles)
81
- - **Actions tab** (within a topic): Link Flows, Apex classes, or Prompt Templates as actions
82
- - **Instructions**: Write natural language instructions for the agent's behavior
94
+ - Navigate to /lightning/n/standard-AgentforceStudio?c__nav=agents to see the agents list
95
+ - Click the agent name link to open it in the Agent Builder
96
+ - The builder has sections for configuring topics, actions, and instructions
83
97
 
84
98
  ### Creating a Topic
85
99
  1. In Agent Builder > Topics tab > click "New Topic" or "New"
@@ -111,10 +125,12 @@ When editing an agent that already exists:
111
125
  - **Quick Find**: The search box at top of the left Setup nav tree — use it instead of clicking through menus
112
126
  - **Toast messages**: Green bar at top = success, Red bar = error
113
127
  - **Setup content**: Main content area is center-right; left panel is the navigation tree
114
- - **Modals/dialogs**: May overlay the page — look for them before clicking background elements
128
+ - **Modals/dialogs**: May overlay the page — look for them before clicking background elements. Check for modals with "X" close buttons, "Cancel" and action buttons.
115
129
  - **Lightning loading**: Pages are slow — always "wait" 2-3s after navigation or clicks that load new content
116
130
  - **Tabs in builders**: Agent Builder, Flow Builder, etc. have tab navigation at the top of the edit panel
117
131
  - **Save buttons**: Usually top-right corner. In Flow Builder, also look for "Save As" dropdown
132
+ - **New tab traps**: Some Salesforce buttons open NEW browser tabs instead of navigating. If clicking a button doesn't change the page, try using "navigate" to go directly to the target URL instead.
133
+ - **Agentforce Builder**: The new builder at /AgentAuthoring/agentAuthoringBuilder.app is a SEPARATE app from Setup — it has its own layout with no left nav tree. Use the back arrow "Go back to Agentforce Studio" link to return.
118
134
 
119
135
  ## Rules
120
136
  1. ONE action per response
@@ -131,9 +147,12 @@ When editing an agent that already exists:
131
147
  12. When a "user_hint" appears in action history, prioritize following the human's guidance — they can see the screen and know what to do
132
148
  13. Use Quick Find (search box at top-left of Setup) to navigate instead of clicking through menu trees — it's faster and more reliable
133
149
  14. IMPORTANT: Salesforce uses multi-step wizards. If clicking a button brought you to a new screen (template picker, configuration form, etc.), do NOT click the same button again. Instead, look at what the NEW screen is asking you to do and interact with it (select a template, fill a form, click Next/Continue)
134
- 15. If you see a selection grid (cards/tiles to choose from), you must CLICK one of them to proceed. Look for the option that best matches the objective
150
+ 15. If you see template cards with "Select" buttons, click the "Select" button on the card that matches the objective. Do NOT click the card title click the "Select" button text specifically.
135
151
  16. NEVER use "wait" more than 2 times in a row. If you have already waited, the page IS loaded — look at the screenshot and take an action. Describe what you see and interact with it
136
- 17. If you see content on the screen (text, buttons, forms, cards), the page IS loaded. Do NOT wait — take action immediately`;
152
+ 17. If you see content on the screen (text, buttons, forms, cards), the page IS loaded. Do NOT wait — take action immediately
153
+ 18. If clicking a button does NOT change the page after waiting, the button may be broken or opening a new tab you can't see. Use "navigate" to go directly to the target URL instead. For creating new agents, navigate to /AgentAuthoring/agentAuthoringBuilder.app#/new
154
+ 19. When you see the "Name your agent" modal, click the "Agent Name" field first, then fill it on the next turn. After filling the name, click "Let's Go" to proceed.
155
+ 20. NEVER click the legacy "+ New Agent" button on /lightning/setup/EinsteinCopilot/home — it is broken. Navigate directly to /AgentAuthoring/agentAuthoringBuilder.app#/new instead.`;
137
156
  // ─── Main Function ───────────────────────────────────────────────────
138
157
  /**
139
158
  * Analyze a screenshot and decide the next action to accomplish the objective.
package/dist/ai.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ai.js","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAyBH,wEAAwE;AAExE,MAAM,cAAc,GAAG,+CAA+C,CAAC;AACvE,MAAM,KAAK,GAAG,6BAA6B,CAAC;AAE5C,kEAAkE;AAClE,MAAM,UAAU,SAAS;IACvB,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,SAAS;IAChB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAC5E,IAAI,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CAAC,gDAAgD,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IACxF,OAAO;QACL,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;QAChC,MAAM,EAAE,IAAI;KACb,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sf-builder-agent",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "description": "Desktop agent for SalesForce Agent Creator — executes browser automation commands",
5
5
  "type": "module",
6
6
  "bin": {
package/src/ai.ts CHANGED
@@ -36,7 +36,7 @@ export interface ActionEntry {
36
36
  // ─── OpenRouter Client ───────────────────────────────────────────────
37
37
 
38
38
  const OPENROUTER_URL = "https://openrouter.ai/api/v1/chat/completions";
39
- const MODEL = "anthropic/claude-sonnet-4.6";
39
+ const MODEL = "anthropic/claude-opus-4.6";
40
40
 
41
41
  /** Check if an API key is available (OpenRouter or Anthropic). */
42
42
  export function hasApiKey(): boolean {
@@ -85,29 +85,43 @@ Use this knowledge to navigate Salesforce efficiently:
85
85
 
86
86
  ### Key Setup URLs (UAT Sandbox)
87
87
  - Setup Home: /lightning/setup/SetupOneHome/home
88
- - Agentforce Studio: /lightning/setup/EinsteinCopilot/home (legacy URL slug)
88
+ - Agentforce Agents (LEGACY — avoid): /lightning/setup/EinsteinCopilot/home
89
+ - Agentforce Studio (NEW — use this): /lightning/n/standard-AgentforceStudio?c__nav=agents
90
+ - New Agent Builder (direct): /AgentAuthoring/agentAuthoringBuilder.app#/new
89
91
  - Flows: /lightning/setup/Flows/home
90
92
  - Prompt Builder: /lightning/setup/PromptTemplateSetup/home
91
93
  - Custom Objects: /lightning/setup/ObjectManager/home
92
94
  - Apex Classes: /lightning/setup/ApexClasses/home
93
95
 
94
- ### Agentforce Agent Builder Creating a New Agent
95
- The "New Agent" flow has multiple screens you MUST progress through:
96
- 1. Click "+ New Agent" button on the Agentforce Agents list page
97
- 2. **Template Selection screen** appears: "Select an agent" with two tabs: "Create from a Template" and "Create with Gen AI"
98
- - You MUST click one of the template cards (e.g., "Agentforce Employee Agent", "Agentforce Service Agent", "Sales Agent") to proceed
99
- - After clicking a template, a "Next" or "Continue" button appears — click it
100
- - If the objective mentions a specific agent type, pick the matching template
101
- - If unsure which template, use "ask_user" to ask the human which template to select
102
- 3. **Agent Details screen**: Fill in Name, API Name, Description
103
- 4. **Agent Builder** opens with tabs: Details, Topics, Actions, Instructions
104
-
105
- ### Agentforce Agent BuilderEditing an Existing Agent
96
+ ### CRITICAL: Legacy vs New Agentforce Builder
97
+ - The OLD page at /lightning/setup/EinsteinCopilot/home has a "New Agent" button that is BROKEN (throws a hidden Aura CSS error). Do NOT use it.
98
+ - If you land on the legacy page, look for the "Let's Go" link/banner that says "Try the new Agentforce Builder!" but it opens a new tab which you cannot control.
99
+ - INSTEAD: Navigate DIRECTLY to /AgentAuthoring/agentAuthoringBuilder.app#/new to create a new agent.
100
+ - To view existing agents, navigate to /lightning/n/standard-AgentforceStudio?c__nav=agents
101
+
102
+ ### Agentforce Builder Creating a New Agent
103
+ Navigate directly to: /AgentAuthoring/agentAuthoringBuilder.app#/new
104
+ This opens the NEW Agentforce Builder with these elements:
105
+
106
+ 1. **"What do you want your agent to do?"** — A text area at the top where you can describe the agent's purpose. Type a description and click the "Send" button (purple arrow icon).
107
+ 2. **"Explore ready-made templates:"**Template cards below the text area. Each card has:
108
+ - A template name (e.g., "Agentforce Service Agent", "Agentforce Employee Agent")
109
+ - A description
110
+ - A "Select" button (for available templates) OR a "Coming Soon" button (disabled/grayed out)
111
+ - Only "Agentforce Service Agent" and "Agentforce Employee Agent" currently have active "Select" buttons
112
+ 3. **To select a template**: Click the "Select" button on the template card — do NOT click the card title or description, click the actual "Select" button text.
113
+ 4. **"Name your agent" modal** appears after selecting a template OR after sending a description:
114
+ - "Agent Name" field (required) — type the agent's name
115
+ - "Developer Name" field (required) — auto-generated from Agent Name
116
+ - User assignment: "New User" radio (default) or "Select User" radio
117
+ - Click "Let's Go" button to proceed (button is disabled until Agent Name is filled)
118
+ 5. **Agent Builder** opens — this is where you configure topics, actions, and instructions.
119
+
120
+ ### Agentforce Builder — Editing an Existing Agent
106
121
  When editing an agent that already exists:
107
- - **Details tab**: Set Name, API Name, Description
108
- - **Topics tab**: Add topics (each topic = a capability domain the agent handles)
109
- - **Actions tab** (within a topic): Link Flows, Apex classes, or Prompt Templates as actions
110
- - **Instructions**: Write natural language instructions for the agent's behavior
122
+ - Navigate to /lightning/n/standard-AgentforceStudio?c__nav=agents to see the agents list
123
+ - Click the agent name link to open it in the Agent Builder
124
+ - The builder has sections for configuring topics, actions, and instructions
111
125
 
112
126
  ### Creating a Topic
113
127
  1. In Agent Builder > Topics tab > click "New Topic" or "New"
@@ -139,10 +153,12 @@ When editing an agent that already exists:
139
153
  - **Quick Find**: The search box at top of the left Setup nav tree — use it instead of clicking through menus
140
154
  - **Toast messages**: Green bar at top = success, Red bar = error
141
155
  - **Setup content**: Main content area is center-right; left panel is the navigation tree
142
- - **Modals/dialogs**: May overlay the page — look for them before clicking background elements
156
+ - **Modals/dialogs**: May overlay the page — look for them before clicking background elements. Check for modals with "X" close buttons, "Cancel" and action buttons.
143
157
  - **Lightning loading**: Pages are slow — always "wait" 2-3s after navigation or clicks that load new content
144
158
  - **Tabs in builders**: Agent Builder, Flow Builder, etc. have tab navigation at the top of the edit panel
145
159
  - **Save buttons**: Usually top-right corner. In Flow Builder, also look for "Save As" dropdown
160
+ - **New tab traps**: Some Salesforce buttons open NEW browser tabs instead of navigating. If clicking a button doesn't change the page, try using "navigate" to go directly to the target URL instead.
161
+ - **Agentforce Builder**: The new builder at /AgentAuthoring/agentAuthoringBuilder.app is a SEPARATE app from Setup — it has its own layout with no left nav tree. Use the back arrow "Go back to Agentforce Studio" link to return.
146
162
 
147
163
  ## Rules
148
164
  1. ONE action per response
@@ -159,9 +175,12 @@ When editing an agent that already exists:
159
175
  12. When a "user_hint" appears in action history, prioritize following the human's guidance — they can see the screen and know what to do
160
176
  13. Use Quick Find (search box at top-left of Setup) to navigate instead of clicking through menu trees — it's faster and more reliable
161
177
  14. IMPORTANT: Salesforce uses multi-step wizards. If clicking a button brought you to a new screen (template picker, configuration form, etc.), do NOT click the same button again. Instead, look at what the NEW screen is asking you to do and interact with it (select a template, fill a form, click Next/Continue)
162
- 15. If you see a selection grid (cards/tiles to choose from), you must CLICK one of them to proceed. Look for the option that best matches the objective
178
+ 15. If you see template cards with "Select" buttons, click the "Select" button on the card that matches the objective. Do NOT click the card title click the "Select" button text specifically.
163
179
  16. NEVER use "wait" more than 2 times in a row. If you have already waited, the page IS loaded — look at the screenshot and take an action. Describe what you see and interact with it
164
- 17. If you see content on the screen (text, buttons, forms, cards), the page IS loaded. Do NOT wait — take action immediately`;
180
+ 17. If you see content on the screen (text, buttons, forms, cards), the page IS loaded. Do NOT wait — take action immediately
181
+ 18. If clicking a button does NOT change the page after waiting, the button may be broken or opening a new tab you can't see. Use "navigate" to go directly to the target URL instead. For creating new agents, navigate to /AgentAuthoring/agentAuthoringBuilder.app#/new
182
+ 19. When you see the "Name your agent" modal, click the "Agent Name" field first, then fill it on the next turn. After filling the name, click "Let's Go" to proceed.
183
+ 20. NEVER click the legacy "+ New Agent" button on /lightning/setup/EinsteinCopilot/home — it is broken. Navigate directly to /AgentAuthoring/agentAuthoringBuilder.app#/new instead.`;
165
184
 
166
185
  // ─── Main Function ───────────────────────────────────────────────────
167
186