terminator-mcp-agent 0.13.2 → 0.13.4

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 (2) hide show
  1. package/README.md +65 -15
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -119,33 +119,68 @@ Tool call wrapper format (`workflow.json`):
119
119
 
120
120
  **Code Execution in Workflows (engine mode):**
121
121
 
122
- Execute custom JavaScript or Python with access to desktop automation APIs via `run_command`:
122
+ Execute custom JavaScript or Python with access to desktop automation APIs via `run_command`.
123
+
124
+ **Passing Data Between Workflow Steps:**
125
+
126
+ When using `engine` mode, you can pass data between steps using the `set_env` mechanism:
123
127
 
124
128
  ```yaml
125
129
  steps:
130
+ # Step 1: Set environment variables for next step
126
131
  - tool_name: run_command
127
132
  arguments:
128
133
  engine: "javascript"
129
- script: |
130
- // Access desktop automation APIs
134
+ run: |
135
+ // Example: Find files and pass data to next step
136
+ const { execSync } = require('child_process');
137
+
138
+ // Get file info (example)
139
+ const filePath = 'C:\\data\\report.pdf';
140
+ const fileSize = 1024;
141
+
142
+ // Pass data to next step using set_env
143
+ console.log(`Found file: ${filePath}`);
144
+
145
+ // Method 1: Return set_env object (preferred)
146
+ return {
147
+ set_env: {
148
+ file_path: filePath,
149
+ file_size: fileSize.toString()
150
+ },
151
+ status: 'found'
152
+ };
153
+
154
+ // Method 2: GitHub Actions style (alternative)
155
+ // console.log(`::set-env name=file_path::${filePath}`);
156
+
157
+ # Step 2: Access data from previous step
158
+ - tool_name: run_command
159
+ arguments:
160
+ engine: "javascript"
161
+ run: |
162
+ // Access environment variables from previous step
163
+ const filePath = '{{env.file_path}}';
164
+ const fileSize = '{{env.file_size}}';
165
+
166
+ console.log(`Processing: ${filePath} (${fileSize} bytes)`);
167
+
168
+ // Continue with desktop automation
131
169
  const elements = await desktop.locator('role:button').all();
132
170
  log(`Found ${elements.length} buttons`);
133
-
134
- // Conditional logic and bulk operations
135
- for (const element of elements) {
136
- const name = await element.name();
137
- if (name.includes('Submit')) {
138
- await element.click();
139
- break;
140
- }
141
- }
142
-
171
+
143
172
  return {
144
- buttons_found: elements.length,
145
- action: 'clicked_submit'
173
+ file_processed: filePath,
174
+ buttons_found: elements.length
146
175
  };
147
176
  ```
148
177
 
178
+ **Important Notes on Data Passing:**
179
+ - `set_env` only works with `engine` mode (JavaScript/Python), NOT with shell commands
180
+ - Use `{{env.variable_name}}` syntax to access variables in subsequent steps
181
+ - Watch for backslash escaping issues in Windows paths (may need double escaping)
182
+ - Consider combining related operations in a single step if data passing becomes complex
183
+
149
184
  For complete CLI documentation, see [Terminator CLI README](../terminator-cli/README.md).
150
185
 
151
186
  ### Core Workflows: From Interaction to Structured Data
@@ -628,6 +663,21 @@ For additional help, see the [Terminator CLI documentation](../terminator-cli/RE
628
663
  1. Ensure the Terminator MCP agent is running (it will auto-start in supported editors).
629
664
  2. Send the JSON above as the body of an `execute_sequence` tool call from your LLM or test harness.
630
665
  3. Inspect the response: if parsing succeeds you’ll see something like
666
+ ### Realtime events (SSE)
667
+
668
+ When running with the HTTP transport, you can subscribe to realtime workflow events at a separate endpoint outside `/mcp`:
669
+
670
+ - SSE endpoint: `/events`
671
+ - Emits JSON payloads for: `sequence` (start/end), `sequence_progress`, and `sequence_step` (begin/end)
672
+
673
+ Example in Node.js:
674
+
675
+ ```js
676
+ import EventSource from 'eventsource';
677
+ const es = new EventSource('http://127.0.0.1:3000/events');
678
+ es.onmessage = (e) => console.log('event', e.data);
679
+ ```
680
+
631
681
 
632
682
  ```jsonc
633
683
  {
package/package.json CHANGED
@@ -15,10 +15,10 @@
15
15
  ],
16
16
  "name": "terminator-mcp-agent",
17
17
  "optionalDependencies": {
18
- "terminator-mcp-darwin-arm64": "0.13.2",
19
- "terminator-mcp-darwin-x64": "0.13.2",
20
- "terminator-mcp-linux-x64-gnu": "0.13.2",
21
- "terminator-mcp-win32-x64-msvc": "0.13.2"
18
+ "terminator-mcp-darwin-arm64": "0.13.4",
19
+ "terminator-mcp-darwin-x64": "0.13.4",
20
+ "terminator-mcp-linux-x64-gnu": "0.13.4",
21
+ "terminator-mcp-win32-x64-msvc": "0.13.4"
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",
@@ -30,5 +30,5 @@
30
30
  "sync-version": "node ./utils/sync-version.js",
31
31
  "update-badges": "node ./utils/update-badges.js"
32
32
  },
33
- "version": "0.13.2"
33
+ "version": "0.13.4"
34
34
  }