terminator-mcp-agent 0.7.3 → 0.7.7
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 +140 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -115,3 +115,143 @@ Now, when your MCP client runs `terminator-mcp-agent`, it will use your local bu
|
|
|
115
115
|
- For VS Code/Insiders, ensure the CLI (`code` or `code-insiders`) is available in your PATH.
|
|
116
116
|
- If you encounter issues, try running with elevated permissions.
|
|
117
117
|
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 📚 Full `execute_sequence` Reference & Sample Workflow
|
|
121
|
+
|
|
122
|
+
> **Why another example?** The quick start above shows the concept, but many users asked for a fully-annotated workflow schema. The example below automates the Windows **Calculator** app—so it is 100% safe to share and does **not** reveal any private customer data. Feel free to copy-paste and adapt it to your own application.
|
|
123
|
+
|
|
124
|
+
### 1. Anatomy of an `execute_sequence` Call
|
|
125
|
+
|
|
126
|
+
```jsonc
|
|
127
|
+
{
|
|
128
|
+
"tool_name": "execute_sequence",
|
|
129
|
+
"arguments": {
|
|
130
|
+
"variables": { // 1️⃣ Re-usable inputs with type metadata
|
|
131
|
+
"app_path": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"label": "Calculator EXE Path",
|
|
134
|
+
"default": "calc.exe"
|
|
135
|
+
},
|
|
136
|
+
"first_number": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"label": "First Number",
|
|
139
|
+
"default": "42"
|
|
140
|
+
},
|
|
141
|
+
"second_number": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"label": "Second Number",
|
|
144
|
+
"default": "8"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"inputs": { // 2️⃣ Concrete values for *this run*
|
|
148
|
+
"app_path": "calc.exe",
|
|
149
|
+
"first_number": "42",
|
|
150
|
+
"second_number": "8"
|
|
151
|
+
},
|
|
152
|
+
"selectors": { // 3️⃣ Human-readable element shortcuts
|
|
153
|
+
"calc_window": "role:Window|name:Calculator",
|
|
154
|
+
"btn_clear": "role:Button|name:Clear",
|
|
155
|
+
"btn_plus": "role:Button|name:Plus",
|
|
156
|
+
"btn_equals": "role:Button|name:Equals"
|
|
157
|
+
},
|
|
158
|
+
"steps": [ // 4️⃣ Ordered actions & control flow
|
|
159
|
+
{
|
|
160
|
+
"tool_name": "open_application",
|
|
161
|
+
"arguments": { "path": "{{app_path}}" }
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"tool_name": "click_element", // 4a. Make sure the UI is reset
|
|
165
|
+
"arguments": { "selector": "{{selectors.btn_clear}}" },
|
|
166
|
+
"continue_on_error": true
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"group_name": "Enter First Number", // 4b. Groups improve logs
|
|
170
|
+
"steps": [
|
|
171
|
+
{
|
|
172
|
+
"tool_name": "type_into_element",
|
|
173
|
+
"arguments": {
|
|
174
|
+
"selector": "{{selectors.calc_window}}",
|
|
175
|
+
"text_to_type": "{{first_number}}"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"tool_name": "click_element",
|
|
182
|
+
"arguments": { "selector": "{{selectors.btn_plus}}" }
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"group_name": "Enter Second Number",
|
|
186
|
+
"steps": [
|
|
187
|
+
{
|
|
188
|
+
"tool_name": "type_into_element",
|
|
189
|
+
"arguments": {
|
|
190
|
+
"selector": "{{selectors.calc_window}}",
|
|
191
|
+
"text_to_type": "{{second_number}}"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"tool_name": "click_element",
|
|
198
|
+
"arguments": { "selector": "{{selectors.btn_equals}}" }
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"tool_name": "wait_for_element", // 4c. Capture final UI tree
|
|
202
|
+
"arguments": {
|
|
203
|
+
"selector": "{{selectors.calc_window}}",
|
|
204
|
+
"condition": "exists",
|
|
205
|
+
"include_tree": true,
|
|
206
|
+
"timeout_ms": 2000
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"output_parser": { // 5️⃣ Turn the tree into clean JSON
|
|
211
|
+
"uiTreeJsonPath": "$.results[-1].result.ui_tree",
|
|
212
|
+
"fieldsToExtract": {
|
|
213
|
+
"displayValue": {
|
|
214
|
+
"fromChild": {
|
|
215
|
+
"conditions": [
|
|
216
|
+
{ "property": "role", "op": "equals", "value": "Text" }
|
|
217
|
+
],
|
|
218
|
+
"extractProperty": "name"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### 2. Key Concepts at a Glance
|
|
228
|
+
|
|
229
|
+
1. **Variables vs. Inputs** – Declare once, override per-run. This is perfect for parameterizing CI pipelines or A/B test data.
|
|
230
|
+
2. **Selectors** – Give every important UI element a *nickname*. It makes long workflows readable and easy to maintain.
|
|
231
|
+
3. **Templating** – `{{ ... }}` lets you reference **any** key inside `variables`, `inputs`, or `selectors`. The engine uses Mustache-style rendering.
|
|
232
|
+
4. **Groups & Control Flow** – Add `group_name`, `skippable`, `if`, or `continue_on_error` to any step for advanced branching.
|
|
233
|
+
5. **Output Parsing** – Always end with a step that includes the UI tree, then use the declarative JSON DSL to mine the data you need.
|
|
234
|
+
|
|
235
|
+
### 3. Running the Workflow
|
|
236
|
+
|
|
237
|
+
1. Ensure the Terminator MCP agent is running (it will auto-start in supported editors).
|
|
238
|
+
2. Send the JSON above as the body of an `execute_sequence` tool call from your LLM or test harness.
|
|
239
|
+
3. Inspect the response: if parsing succeeds you’ll see something like
|
|
240
|
+
|
|
241
|
+
```jsonc
|
|
242
|
+
{
|
|
243
|
+
"parsed_output": {
|
|
244
|
+
"displayValue": "50" // 42 + 8
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### 4. Tips for Production Workflows
|
|
250
|
+
|
|
251
|
+
- **Never hard-code credentials** – use environment variables or your secret manager.
|
|
252
|
+
- **Keep workflows short** – <100 steps is ideal. Break large tasks into multiple sequences.
|
|
253
|
+
- **Capture errors** – `continue_on_error` is useful, but also log `result.status` codes to catch silent failures.
|
|
254
|
+
- **Version control** – Store workflow JSON in a repo and use PR reviews just like regular code.
|
|
255
|
+
|
|
256
|
+
> Need more help? Browse the examples under `examples/` in this repo or open a discussion on GitHub.
|
|
257
|
+
|
package/package.json
CHANGED
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
],
|
|
13
13
|
"name": "terminator-mcp-agent",
|
|
14
14
|
"optionalDependencies": {
|
|
15
|
-
"terminator-mcp-darwin-arm64": "0.7.
|
|
16
|
-
"terminator-mcp-darwin-x64": "0.7.
|
|
17
|
-
"terminator-mcp-linux-x64-gnu": "0.7.
|
|
18
|
-
"terminator-mcp-win32-x64-msvc": "0.7.
|
|
15
|
+
"terminator-mcp-darwin-arm64": "0.7.7",
|
|
16
|
+
"terminator-mcp-darwin-x64": "0.7.7",
|
|
17
|
+
"terminator-mcp-linux-x64-gnu": "0.7.7",
|
|
18
|
+
"terminator-mcp-win32-x64-msvc": "0.7.7"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"sync-version": "node ./utils/sync-version.js",
|
|
28
28
|
"update-badges": "node ./utils/update-badges.js"
|
|
29
29
|
},
|
|
30
|
-
"version": "0.7.
|
|
30
|
+
"version": "0.7.7"
|
|
31
31
|
}
|