@mindstudio-ai/agent 0.0.16 → 0.0.17
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 +24 -11
- package/dist/cli.js +396 -10
- package/dist/index.d.ts +88 -9
- package/dist/index.js +50 -10
- package/dist/index.js.map +1 -1
- package/llms.txt +63 -10
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -36,10 +36,25 @@ mindstudio info generate-image
|
|
|
36
36
|
npx @mindstudio-ai/agent generate-text --message "Hello"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
Auth: set `MINDSTUDIO_API_KEY` env var or pass `--api-key <key>`.
|
|
39
|
+
Auth: run `mindstudio login`, set `MINDSTUDIO_API_KEY` env var, or pass `--api-key <key>`.
|
|
40
40
|
Method names are kebab-case on the CLI (camelCase also accepted). Flags are kebab-case (`--video-url` for `videoUrl`).
|
|
41
41
|
Use `--output-key <key>` to extract a single field, `--no-meta` to strip $-prefixed metadata.
|
|
42
42
|
|
|
43
|
+
### Authentication
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Interactive login (opens browser, saves key to ~/.mindstudio/config.json)
|
|
47
|
+
mindstudio login
|
|
48
|
+
|
|
49
|
+
# Check current auth status
|
|
50
|
+
mindstudio whoami
|
|
51
|
+
|
|
52
|
+
# Clear stored credentials
|
|
53
|
+
mindstudio logout
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Auth resolution order: `--api-key` flag > `MINDSTUDIO_API_KEY` env > `~/.mindstudio/config.json` > `CALLBACK_TOKEN` env.
|
|
57
|
+
|
|
43
58
|
## MCP server
|
|
44
59
|
|
|
45
60
|
The package includes an MCP server exposing all methods as tools:
|
|
@@ -68,20 +83,39 @@ import { MindStudioAgent } from '@mindstudio-ai/agent';
|
|
|
68
83
|
|
|
69
84
|
// With API key (or set MINDSTUDIO_API_KEY env var)
|
|
70
85
|
const agent = new MindStudioAgent({ apiKey: 'your-key' });
|
|
71
|
-
|
|
72
|
-
// Inside MindStudio custom functions, auth is automatic (CALLBACK_TOKEN + REMOTE_HOSTNAME)
|
|
73
|
-
const agent = new MindStudioAgent();
|
|
74
86
|
```
|
|
75
87
|
|
|
88
|
+
Your MindStudio API key authenticates all requests. MindStudio routes to the correct AI provider (OpenAI, Google, Anthropic, etc.) server-side — you do NOT need separate provider API keys.
|
|
89
|
+
|
|
76
90
|
Constructor options:
|
|
77
91
|
```typescript
|
|
78
92
|
new MindStudioAgent({
|
|
79
|
-
apiKey?: string, // Auth token. Falls back to MINDSTUDIO_API_KEY env
|
|
80
|
-
baseUrl?: string, // API base URL.
|
|
93
|
+
apiKey?: string, // Auth token. Falls back to MINDSTUDIO_API_KEY env var.
|
|
94
|
+
baseUrl?: string, // API base URL. Defaults to "https://v1.mindstudio-api.com".
|
|
81
95
|
maxRetries?: number, // Retries on 429 rate limit (default: 3). Uses Retry-After header for delay.
|
|
82
96
|
})
|
|
83
97
|
```
|
|
84
98
|
|
|
99
|
+
## Models
|
|
100
|
+
|
|
101
|
+
MindStudio provides access to models from many providers (OpenAI, Google, Anthropic, Meta, xAI, DeepSeek, etc.) through a single API key. You do NOT need provider-specific API keys.
|
|
102
|
+
|
|
103
|
+
Use `listModels()` or `listModelsByType("llm_chat")` to discover available models. Pass a model ID to `modelOverride.model` in methods like `generateText` to select a specific model:
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
const { models } = await agent.listModelsByType('llm_chat');
|
|
107
|
+
const model = models.find(m => m.name.includes("Gemini"));
|
|
108
|
+
|
|
109
|
+
const { content } = await agent.generateText({
|
|
110
|
+
message: 'Hello',
|
|
111
|
+
modelOverride: {
|
|
112
|
+
model: model.rawName,
|
|
113
|
+
temperature: 0.7,
|
|
114
|
+
maxResponseTokens: 1024,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
85
119
|
## Calling convention
|
|
86
120
|
|
|
87
121
|
Every method has the signature:
|
|
@@ -138,7 +172,6 @@ try {
|
|
|
138
172
|
```
|
|
139
173
|
|
|
140
174
|
429 rate limit errors are retried automatically (configurable via `maxRetries`).
|
|
141
|
-
Internal tokens (CALLBACK_TOKEN) are capped at 500 calls — exceeding this throws `call_cap_exceeded`.
|
|
142
175
|
|
|
143
176
|
## Low-level access
|
|
144
177
|
|
|
@@ -558,9 +591,12 @@ Send an email to one or more configured recipient addresses.
|
|
|
558
591
|
- Output: `{ recipients: string[] }`
|
|
559
592
|
|
|
560
593
|
#### sendSMS
|
|
561
|
-
Send an SMS
|
|
594
|
+
Send an SMS or MMS message to a phone number configured via OAuth connection.
|
|
562
595
|
- User is responsible for configuring the connection to the number (MindStudio requires double opt-in to prevent spam)
|
|
563
|
-
-
|
|
596
|
+
- If mediaUrls are provided, the message is sent as MMS instead of SMS
|
|
597
|
+
- MMS supports up to 10 media URLs (images, video, audio, PDF) with a 5MB limit per file
|
|
598
|
+
- MMS is only supported on US and Canadian carriers; international numbers will receive SMS only (media silently dropped)
|
|
599
|
+
- Input: `{ body: string, connectionId?: string, mediaUrls?: string[] }`
|
|
564
600
|
- Output: `unknown`
|
|
565
601
|
|
|
566
602
|
#### setRunTitle
|
|
@@ -576,6 +612,22 @@ Explicitly set a variable to a given value.
|
|
|
576
612
|
- Input: `{ value: string | string[] }`
|
|
577
613
|
- Output: `object`
|
|
578
614
|
|
|
615
|
+
#### telegramEditMessage
|
|
616
|
+
Edit a previously sent Telegram message. Use with the message ID returned by Send Telegram Message.
|
|
617
|
+
- Only text messages sent by the bot can be edited.
|
|
618
|
+
- The messageId is returned by the Send Telegram Message step.
|
|
619
|
+
- Common pattern: send a "Processing..." message, do work, then edit it with the result.
|
|
620
|
+
- Input: `{ botToken: string, chatId: string, messageId: string, text: string }`
|
|
621
|
+
- Output: `unknown`
|
|
622
|
+
|
|
623
|
+
#### telegramReplyToMessage
|
|
624
|
+
Send a reply to a specific Telegram message. The reply will be visually threaded in the chat.
|
|
625
|
+
- Use the rawMessage.message_id from the incoming trigger variables to reply to the user's message.
|
|
626
|
+
- Especially useful in group chats where replies provide context.
|
|
627
|
+
- Returns the sent message ID, which can be used with Edit Telegram Message.
|
|
628
|
+
- Input: `{ botToken: string, chatId: string, replyToMessageId: string, text: string }`
|
|
629
|
+
- Output: `{ messageId: number }`
|
|
630
|
+
|
|
579
631
|
#### telegramSendAudio
|
|
580
632
|
Send an audio file to a Telegram chat as music or a voice note via a bot.
|
|
581
633
|
- "audio" mode sends as a standard audio file. "voice" mode sends as a voice message (re-uploads the file for large file support).
|
|
@@ -596,8 +648,9 @@ Send an image to a Telegram chat via a bot.
|
|
|
596
648
|
Send a text message to a Telegram chat via a bot.
|
|
597
649
|
- Messages are sent using MarkdownV2 formatting. Special characters are auto-escaped.
|
|
598
650
|
- botToken format is "botId:token" — both parts are required.
|
|
651
|
+
- Returns the sent message ID, which can be used with Edit Telegram Message to update the message later.
|
|
599
652
|
- Input: `{ botToken: string, chatId: string, text: string }`
|
|
600
|
-
- Output: `
|
|
653
|
+
- Output: `{ messageId: number }`
|
|
601
654
|
|
|
602
655
|
#### telegramSendVideo
|
|
603
656
|
Send a video to a Telegram chat via a bot.
|