@mindstudio-ai/agent 0.1.4 → 0.1.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/README.md +46 -0
- package/dist/cli.js +756 -288
- package/dist/index.d.ts +240 -214
- package/dist/index.js +225 -56
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +757 -289
- package/llms.txt +47 -16
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -6,19 +6,19 @@ This file is the complete API reference. No other documentation is needed to use
|
|
|
6
6
|
|
|
7
7
|
## Recommended workflow
|
|
8
8
|
|
|
9
|
-
There are 150+
|
|
9
|
+
There are 150+ actions available. Do NOT try to read or load them all at once. Follow this discovery flow:
|
|
10
10
|
|
|
11
11
|
1. **Identify yourself** — Call `changeName` to set your display name (use your name or whatever your user calls you). If you have a profile picture or icon, call `uploadFile` to upload it, then `changeProfilePicture` with the returned URL. This helps users identify your requests in their logs.
|
|
12
|
-
2. **Discover** — Call `
|
|
13
|
-
3. **Drill in** — Once you identify the right
|
|
14
|
-
4. **Call it** — Invoke the
|
|
12
|
+
2. **Discover** — Call `listActions` (MCP tool) or `mindstudio list-actions --summary` (CLI) to get a compact `{ action: description }` map of everything available (~3k tokens).
|
|
13
|
+
3. **Drill in** — Once you identify the right action, look up its full signature in the reference below, or call `mindstudio info <action>` (CLI) for parameter details.
|
|
14
|
+
4. **Call it** — Invoke the action with the required parameters. All actions share the same calling convention (see below).
|
|
15
15
|
|
|
16
16
|
For specific use cases:
|
|
17
17
|
|
|
18
|
-
- **
|
|
18
|
+
- **OAuth third-party integrations** (Slack, Google, HubSpot, etc.): These are optional OAuth connectors from the MindStudio Connector Registry — for most tasks, use actions directly instead. If you need a third-party integration: call `listConnectors()` to browse services → `getConnectorAction(serviceId, actionId)` for input fields → execute via `runFromConnectorRegistry`. Requires an OAuth connection set up in MindStudio first — call `listConnections()` to check available connections.
|
|
19
19
|
- **Pre-built agents**: Call `listAgents()` to see what's available → `runAgent({ appId })` to execute one. **Important:** Not all agents are configured for API use. Do not try to run an agent just because it appears in the list — only run agents the user specifically asks you to run.
|
|
20
|
-
- **Model selection**: Call `listModelsSummary()` or `listModelsSummaryByType("llm_chat")` to browse models, then pass the model ID as `modelOverride.model` to
|
|
21
|
-
- **Cost estimation**: AI-powered
|
|
20
|
+
- **Model selection**: Call `listModelsSummary()` or `listModelsSummaryByType("llm_chat")` to browse models, then pass the model ID as `modelOverride.model` to actions like `generateText`. Use the summary endpoints (not `listModels`) to keep token usage low.
|
|
21
|
+
- **Cost estimation**: AI-powered actions (text generation, image generation, video, audio, etc.) cost money. Call `estimateStepCost(stepType, stepInput)` before running these and confirm with the user before proceeding — unless they've explicitly given permission to go ahead. Non-AI actions (data lookups, OAuth connectors, etc.) are generally free.
|
|
22
22
|
|
|
23
23
|
## Install
|
|
24
24
|
|
|
@@ -200,11 +200,39 @@ try {
|
|
|
200
200
|
|
|
201
201
|
## Low-level access
|
|
202
202
|
|
|
203
|
-
For
|
|
203
|
+
For action types not covered by generated methods:
|
|
204
204
|
```typescript
|
|
205
205
|
const result = await agent.executeStep('stepType', { ...params });
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
+
## Batch execution
|
|
209
|
+
|
|
210
|
+
Execute multiple steps in parallel in a single request. Maximum 50 steps per batch.
|
|
211
|
+
Individual step failures do not affect other steps — partial success is possible.
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
const result = await agent.executeStepBatch([
|
|
215
|
+
{ stepType: 'generateImage', step: { prompt: 'a sunset' } },
|
|
216
|
+
{ stepType: 'textToSpeech', step: { text: 'hello world' } },
|
|
217
|
+
], { appId?, threadId? });
|
|
218
|
+
|
|
219
|
+
// Result:
|
|
220
|
+
result.results; // BatchStepResult[] — same order as input
|
|
221
|
+
result.results[0].stepType; // string
|
|
222
|
+
result.results[0].output; // object | undefined (step output on success)
|
|
223
|
+
result.results[0].error; // string | undefined (error message on failure)
|
|
224
|
+
result.results[0].billingCost; // number | undefined (cost on success)
|
|
225
|
+
result.totalBillingCost; // number | undefined
|
|
226
|
+
result.appId; // string
|
|
227
|
+
result.threadId; // string
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
CLI:
|
|
231
|
+
```bash
|
|
232
|
+
mindstudio batch '[{"stepType":"generateImage","step":{"prompt":"a cat"}}]'
|
|
233
|
+
cat steps.json | mindstudio batch
|
|
234
|
+
```
|
|
235
|
+
|
|
208
236
|
## Methods
|
|
209
237
|
|
|
210
238
|
All methods below are called on a `MindStudioAgent` instance (`agent.methodName(...)`).
|
|
@@ -1320,8 +1348,11 @@ Update the content of an existing Notion page.
|
|
|
1320
1348
|
#### postToX
|
|
1321
1349
|
Create a post on X (Twitter) from the connected account.
|
|
1322
1350
|
- Requires an X OAuth connection (connectionId).
|
|
1323
|
-
-
|
|
1324
|
-
-
|
|
1351
|
+
- Maximum 280 characters of text.
|
|
1352
|
+
- Optionally attach up to 4 media items (images, GIFs, or videos) via mediaUrls.
|
|
1353
|
+
- Media URLs must be publicly accessible. The service fetches and uploads them to X.
|
|
1354
|
+
- Supported formats: JPEG, PNG, GIF, WEBP, MP4. Images up to 5MB, videos up to 512MB.
|
|
1355
|
+
- Input: `{ text: string, connectionId?: string, mediaUrls?: string[] }`
|
|
1325
1356
|
- Output: `unknown`
|
|
1326
1357
|
|
|
1327
1358
|
#### searchXPosts
|
|
@@ -1443,7 +1474,7 @@ List AI models (summary) filtered by type.
|
|
|
1443
1474
|
- Output: same as `listModelsSummary()`
|
|
1444
1475
|
|
|
1445
1476
|
#### `listConnectors()`
|
|
1446
|
-
List available connector services (Slack, Google, HubSpot, etc.) and their actions.
|
|
1477
|
+
List available OAuth connector services (Slack, Google, HubSpot, etc.) and their actions. These are third-party integrations — for most tasks, use actions directly instead.
|
|
1447
1478
|
|
|
1448
1479
|
Output:
|
|
1449
1480
|
```typescript
|
|
@@ -1458,7 +1489,7 @@ Output:
|
|
|
1458
1489
|
```
|
|
1459
1490
|
|
|
1460
1491
|
#### `getConnector(serviceId)`
|
|
1461
|
-
Get details for a single connector service by ID.
|
|
1492
|
+
Get details for a single OAuth connector service by ID.
|
|
1462
1493
|
|
|
1463
1494
|
Output:
|
|
1464
1495
|
```typescript
|
|
@@ -1473,7 +1504,7 @@ Output:
|
|
|
1473
1504
|
```
|
|
1474
1505
|
|
|
1475
1506
|
#### `getConnectorAction(serviceId, actionId)`
|
|
1476
|
-
Get the full configuration for
|
|
1507
|
+
Get the full configuration for an OAuth connector action, including all input fields needed to call it via `runFromConnectorRegistry`. OAuth connectors are sourced from the open-source MindStudio Connector Registry (MSCR) with 850+ actions across third-party services.
|
|
1477
1508
|
|
|
1478
1509
|
Output:
|
|
1479
1510
|
```typescript
|
|
@@ -1489,7 +1520,7 @@ Output:
|
|
|
1489
1520
|
```
|
|
1490
1521
|
|
|
1491
1522
|
#### `listConnections()`
|
|
1492
|
-
List OAuth connections for the organization. Use the returned connection IDs when calling connector actions. Connectors require the user to connect to the third-party service in MindStudio before they can be used.
|
|
1523
|
+
List OAuth connections for the organization (authenticated third-party service links). Use the returned connection IDs when calling OAuth connector actions. Connectors require the user to connect to the third-party service in MindStudio before they can be used.
|
|
1493
1524
|
|
|
1494
1525
|
Output:
|
|
1495
1526
|
```typescript
|
|
@@ -1509,8 +1540,8 @@ Estimate the cost of executing a step before running it. Pass the same step conf
|
|
|
1509
1540
|
const estimate = await agent.estimateStepCost('generateText', { message: 'Hello' });
|
|
1510
1541
|
```
|
|
1511
1542
|
|
|
1512
|
-
- `stepType`: string — The
|
|
1513
|
-
- `step`: object — Optional
|
|
1543
|
+
- `stepType`: string — The action name (e.g. `"generateText"`).
|
|
1544
|
+
- `step`: object — Optional action input parameters for more accurate estimates.
|
|
1514
1545
|
- `options`: `{ appId?: string, workflowId?: string }` — Optional context for pricing.
|
|
1515
1546
|
|
|
1516
1547
|
Output:
|