@mindstudio-ai/agent 0.1.54 → 0.1.55

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/llms.txt CHANGED
@@ -156,6 +156,18 @@ await mindstudio.generateImage({ prompt: '...' }, {
156
156
  // event: { value: string, tag: string, ts: number }
157
157
  ```
158
158
 
159
+ **`stream()` — push real-time updates to the frontend:**
160
+ ```typescript
161
+ import { mindstudio, stream } from '@mindstudio-ai/agent';
162
+
163
+ // String → 'token' event (frontend receives via onToken, accumulated text)
164
+ await stream('Processing...');
165
+
166
+ // Object → 'data' event (frontend receives via onStreamData, NOT onToken)
167
+ await stream({ status: 'generating', progress: 50 });
168
+ ```
169
+ These are different event types — do not mix them up. `stream()` is silently ignored when no SSE connection is active (safe to include unconditionally). For long-running steps, combine `onLog` with `stream()` to push progress to the frontend.
170
+
159
171
  **Results are returned flat** — output fields are spread at the top level alongside metadata:
160
172
 
161
173
  ```typescript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/agent",
3
- "version": "0.1.54",
3
+ "version": "0.1.55",
4
4
  "description": "TypeScript SDK for MindStudio direct step execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",