@mindstudio-ai/agent 0.1.40 → 0.1.42
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 +40 -26
- package/dist/cli.js +102 -33
- package/dist/index.d.ts +110 -5
- package/dist/index.js +93 -25
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +102 -33
- package/llms.txt +10 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,12 +13,14 @@ Generate text, images, video, and audio. Scrape the web. Search Google. Post to
|
|
|
13
13
|
No dependencies required — downloads a standalone binary:
|
|
14
14
|
|
|
15
15
|
**macOS / Linux:**
|
|
16
|
+
|
|
16
17
|
```bash
|
|
17
18
|
curl -fsSL https://msagent.ai/install.sh | bash
|
|
18
19
|
mindstudio login
|
|
19
20
|
```
|
|
20
21
|
|
|
21
22
|
**Windows (PowerShell):**
|
|
23
|
+
|
|
22
24
|
```
|
|
23
25
|
irm https://msagent.ai/install.ps1 | iex
|
|
24
26
|
mindstudio login
|
|
@@ -114,6 +116,7 @@ npx @mindstudio-ai/agent generate-text --message "Hello"
|
|
|
114
116
|
### MCP server
|
|
115
117
|
|
|
116
118
|
**Claude Code** (one-time setup):
|
|
119
|
+
|
|
117
120
|
```bash
|
|
118
121
|
claude mcp add mindstudio -- mindstudio mcp
|
|
119
122
|
```
|
|
@@ -137,6 +140,7 @@ That's it — Claude Code will discover the MCP server on next launch. Auth is p
|
|
|
137
140
|
```
|
|
138
141
|
|
|
139
142
|
**With npx** (no install needed):
|
|
143
|
+
|
|
140
144
|
```json
|
|
141
145
|
{
|
|
142
146
|
"mcpServers": {
|
|
@@ -175,6 +179,7 @@ echo "I need to connect to HubSpot and create a contact" | mindstudio ask
|
|
|
175
179
|
**For AI agents:** Shell out to `mindstudio ask "..."` from any agent (Remy, Claude Code, custom agents) to get SDK expertise on demand. The response is clean markdown on stdout, ready to parse. Or use the `ask` MCP tool directly if connected via MCP.
|
|
176
180
|
|
|
177
181
|
**Example questions:**
|
|
182
|
+
|
|
178
183
|
- `"what actions are available for image generation?"` — discovery
|
|
179
184
|
- `"give me TypeScript code to generate an image with DALL-E 3"` — resolution with real model IDs and config
|
|
180
185
|
- `"what connectors could I configure?"` — OAuth service discovery
|
|
@@ -222,18 +227,19 @@ Direct access to models from every major provider — all through a single API k
|
|
|
222
227
|
const { models } = await agent.listModelsSummary();
|
|
223
228
|
|
|
224
229
|
// Filter by type
|
|
225
|
-
const { models: imageModels } =
|
|
230
|
+
const { models: imageModels } =
|
|
231
|
+
await agent.listModelsSummaryByType('image_generation');
|
|
226
232
|
|
|
227
233
|
// Use a specific model
|
|
228
234
|
const { models: chatModels } = await agent.listModelsByType('llm_chat');
|
|
229
|
-
const gemini = chatModels.find(m => m.name.includes('Gemini'));
|
|
235
|
+
const gemini = chatModels.find((m) => m.name.includes('Gemini'));
|
|
230
236
|
|
|
231
237
|
const { content } = await agent.generateText({
|
|
232
238
|
message: 'Hello',
|
|
233
239
|
modelOverride: {
|
|
234
240
|
model: gemini.id,
|
|
235
241
|
temperature: 0.7,
|
|
236
|
-
maxResponseTokens:
|
|
242
|
+
maxResponseTokens: 16000,
|
|
237
243
|
},
|
|
238
244
|
});
|
|
239
245
|
```
|
|
@@ -247,7 +253,10 @@ Model types: `llm_chat`, `image_generation`, `video_generation`, `video_analysis
|
|
|
247
253
|
```typescript
|
|
248
254
|
// Browse connectors and their actions
|
|
249
255
|
const { services } = await agent.listConnectors();
|
|
250
|
-
const { action } = await agent.getConnectorAction(
|
|
256
|
+
const { action } = await agent.getConnectorAction(
|
|
257
|
+
'slack',
|
|
258
|
+
'slack/send-message',
|
|
259
|
+
);
|
|
251
260
|
|
|
252
261
|
// Check which services are connected in your org
|
|
253
262
|
const { connections } = await agent.listConnections();
|
|
@@ -267,21 +276,21 @@ Connectors require the user to connect to the third-party service in MindStudio
|
|
|
267
276
|
|
|
268
277
|
Every action has a dedicated typed method. A few highlights:
|
|
269
278
|
|
|
270
|
-
| Method
|
|
271
|
-
|
|
|
272
|
-
| `generateText()`
|
|
273
|
-
| `generateImage()`
|
|
274
|
-
| `generateVideo()`
|
|
275
|
-
| `generateAsset()`
|
|
276
|
-
| `analyzeImage()`
|
|
277
|
-
| `textToSpeech()`
|
|
278
|
-
| `transcribeAudio()`
|
|
279
|
-
| `scrapeUrl()`
|
|
280
|
-
| `searchGoogle()`
|
|
281
|
-
| `httpRequest()`
|
|
282
|
-
| `sendEmail()`
|
|
283
|
-
| `postToSlackChannel()`
|
|
284
|
-
| `runPackagedWorkflow()` | Run another MindStudio workflow
|
|
279
|
+
| Method | Description |
|
|
280
|
+
| ----------------------- | ------------------------------------ |
|
|
281
|
+
| `generateText()` | Send a message to any AI model |
|
|
282
|
+
| `generateImage()` | Generate an image from a prompt |
|
|
283
|
+
| `generateVideo()` | Generate a video from a prompt |
|
|
284
|
+
| `generateAsset()` | Generate an HTML/PDF/PNG/video asset |
|
|
285
|
+
| `analyzeImage()` | Analyze an image with a vision model |
|
|
286
|
+
| `textToSpeech()` | Convert text to speech |
|
|
287
|
+
| `transcribeAudio()` | Transcribe audio to text |
|
|
288
|
+
| `scrapeUrl()` | Scrape a web page |
|
|
289
|
+
| `searchGoogle()` | Search Google |
|
|
290
|
+
| `httpRequest()` | Make an HTTP request |
|
|
291
|
+
| `sendEmail()` | Send an email |
|
|
292
|
+
| `postToSlackChannel()` | Post to a Slack channel |
|
|
293
|
+
| `runPackagedWorkflow()` | Run another MindStudio workflow |
|
|
285
294
|
|
|
286
295
|
...and 130+ more for Google Docs/Sheets/Calendar, YouTube, LinkedIn, HubSpot, Airtable, Notion, Coda, Telegram, media processing, PII detection, and more.
|
|
287
296
|
|
|
@@ -397,14 +406,17 @@ import { db, auth, Roles, resolveUser, User } from '@mindstudio-ai/agent';
|
|
|
397
406
|
const Orders = db.defineTable<Order>('orders');
|
|
398
407
|
|
|
399
408
|
// Query with a chainable API
|
|
400
|
-
const pending = await Orders
|
|
401
|
-
.
|
|
402
|
-
.sortBy(o => o.createdAt)
|
|
409
|
+
const pending = await Orders.filter((o) => o.status === 'pending')
|
|
410
|
+
.sortBy((o) => o.createdAt)
|
|
403
411
|
.reverse()
|
|
404
412
|
.take(20);
|
|
405
413
|
|
|
406
414
|
// Write
|
|
407
|
-
const order = await Orders.push({
|
|
415
|
+
const order = await Orders.push({
|
|
416
|
+
item: 'Laptop',
|
|
417
|
+
amount: 999,
|
|
418
|
+
status: 'pending',
|
|
419
|
+
});
|
|
408
420
|
await Orders.update(order.id, { status: 'approved' });
|
|
409
421
|
|
|
410
422
|
// Role-based access control
|
|
@@ -457,7 +469,7 @@ Every result includes optional billing metadata:
|
|
|
457
469
|
|
|
458
470
|
```typescript
|
|
459
471
|
const result = await agent.generateImage({ prompt: 'A sunset' });
|
|
460
|
-
console.log(result.$billingCost);
|
|
472
|
+
console.log(result.$billingCost); // cost in credits for this call
|
|
461
473
|
console.log(result.$billingEvents); // itemized billing events
|
|
462
474
|
```
|
|
463
475
|
|
|
@@ -471,8 +483,8 @@ try {
|
|
|
471
483
|
} catch (err) {
|
|
472
484
|
if (err instanceof MindStudioError) {
|
|
473
485
|
console.error(err.message); // Human-readable message
|
|
474
|
-
console.error(err.code);
|
|
475
|
-
console.error(err.status);
|
|
486
|
+
console.error(err.code); // "invalid_step_config", "api_error", "call_cap_exceeded", etc.
|
|
487
|
+
console.error(err.status); // HTTP status (400, 401, 429, etc.)
|
|
476
488
|
console.error(err.details); // Raw API error body
|
|
477
489
|
}
|
|
478
490
|
}
|
|
@@ -567,6 +579,7 @@ Options:
|
|
|
567
579
|
Method names use kebab-case on the CLI (`generate-image`), though camelCase (`generateImage`) is also accepted. Typos get a "did you mean?" suggestion. Parameter flags are also kebab-case (`--video-url` for `videoUrl`).
|
|
568
580
|
|
|
569
581
|
Input can be provided as:
|
|
582
|
+
|
|
570
583
|
- **Named flags**: `--prompt "a sunset" --mode "background"`
|
|
571
584
|
- **JSON argument**: `'{"prompt": "a sunset"}'` (JSON5-tolerant: unquoted keys, single quotes, trailing commas)
|
|
572
585
|
- **Piped stdin**: `echo '{"prompt": "a sunset"}' | mindstudio generate-image`
|
|
@@ -641,6 +654,7 @@ Or configure your MCP client (standalone binary or npx):
|
|
|
641
654
|
```
|
|
642
655
|
|
|
643
656
|
The MCP server:
|
|
657
|
+
|
|
644
658
|
- Uses stdio transport (JSON-RPC 2.0)
|
|
645
659
|
- Creates one agent per session with automatic thread reuse
|
|
646
660
|
- Returns structured JSON results for each tool call
|