@mindstudio-ai/agent 0.1.0 → 0.1.1
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 +2 -2
- package/dist/cli.js +225 -12
- package/dist/index.d.ts +345 -2
- package/dist/index.js +115 -0
- package/dist/index.js.map +1 -1
- package/llms.txt +130 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Every AI model. Every integration. One SDK.
|
|
|
4
4
|
|
|
5
5
|
[MindStudio](https://mindstudio.ai) gives you direct access to 200+ AI models and [1,000+ integrations](https://github.com/mindstudio-ai/mscr) — no separate API keys, no setup, no friction. This package is the developer toolkit: a TypeScript SDK, CLI, and MCP server that puts the entire platform at your fingertips.
|
|
6
6
|
|
|
7
|
-
Generate text, images, video, and audio. Scrape the web. Search Google. Post to Slack. Read from Airtable. Send emails. Process media.
|
|
7
|
+
Generate text, images, video, and audio. Scrape the web. Search Google. Post to Slack. Read from Airtable. Send emails. Process media. Run any of 850+ connector actions across third-party services. All with one API key, fully typed, and ready to use from code, the command line, or any MCP-compatible AI agent.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -154,7 +154,7 @@ Model types: `llm_chat`, `image_generation`, `video_generation`, `video_analysis
|
|
|
154
154
|
|
|
155
155
|
## 1,000+ integrations
|
|
156
156
|
|
|
157
|
-
850+
|
|
157
|
+
850+ connector actions from the open-source [MindStudio Connector Registry (MSCR)](https://github.com/mindstudio-ai/mscr) — across services like ActiveCampaign, Airtable, Apollo, Canva, ElevenLabs, MailChimp, Notion, and more — alongside 140+ built-in actions for AI, media, web, and data processing.
|
|
158
158
|
|
|
159
159
|
```typescript
|
|
160
160
|
// Browse connectors and their actions
|
package/dist/cli.js
CHANGED
|
@@ -138,6 +138,15 @@ var init_metadata = __esm({
|
|
|
138
138
|
inputSchema: { "type": "object", "properties": { "name": { "type": "string", "description": "Name for the new data source (supports variable interpolation)" } }, "required": ["name"] },
|
|
139
139
|
outputSchema: { "description": "This step does not produce output data." }
|
|
140
140
|
},
|
|
141
|
+
"createGmailDraft": {
|
|
142
|
+
stepType: "createGmailDraft",
|
|
143
|
+
description: "Create a draft email in the connected Gmail account.",
|
|
144
|
+
usageNotes: `- Requires a Google OAuth connection with Gmail compose scope.
|
|
145
|
+
- The draft appears in the user's Gmail Drafts folder but is not sent.
|
|
146
|
+
- messageType controls the body format: "plain" for plain text, "html" for raw HTML, "markdown" for auto-converted markdown.`,
|
|
147
|
+
inputSchema: { "type": "object", "properties": { "to": { "type": "string", "description": "Recipient email address(es), comma-separated for multiple" }, "subject": { "type": "string", "description": "Email subject line" }, "message": { "type": "string", "description": "Email body content" }, "connectionId": { "type": "string", "description": "Google OAuth connection ID" }, "messageType": { "enum": ["plain", "html", "markdown"], "type": "string", "description": 'Body format: "plain", "html", or "markdown"' } }, "required": ["to", "subject", "message", "messageType"] },
|
|
148
|
+
outputSchema: { "type": "object", "properties": { "draftId": { "type": "string", "description": "Gmail draft ID" } }, "required": ["draftId"] }
|
|
149
|
+
},
|
|
141
150
|
"createGoogleCalendarEvent": {
|
|
142
151
|
stepType: "createGoogleCalendarEvent",
|
|
143
152
|
description: "Create a new event on a Google Calendar.",
|
|
@@ -393,6 +402,13 @@ var init_metadata = __esm({
|
|
|
393
402
|
inputSchema: { "type": "object", "properties": { "prompt": { "type": "string", "description": "Text prompt describing the video to generate" }, "skipAssetCreation": { "type": "boolean", "description": "If true, the video will not appear in the user's asset history" }, "videoModelOverride": { "type": "object", "properties": { "model": { "type": "string", "description": "Video generation model identifier" }, "config": { "type": "object", "description": "Additional model-specific configuration" } }, "required": ["model"], "description": "Optional model configuration override. Uses the workflow's default video model if not specified" }, "generateVariants": { "type": "boolean", "description": "Whether to generate multiple video variants in parallel" }, "numVariants": { "type": "number", "description": "Number of variants to generate (max 10)" }, "addWatermark": { "type": "boolean", "description": "Whether to add a MindStudio watermark to the generated video" } }, "required": ["prompt"] },
|
|
394
403
|
outputSchema: { "type": "object", "properties": { "videoUrl": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] } }, "required": ["videoUrl"] }
|
|
395
404
|
},
|
|
405
|
+
"getGmailAttachments": {
|
|
406
|
+
stepType: "getGmailAttachments",
|
|
407
|
+
description: "Download attachments from a Gmail email and re-host them on CDN.",
|
|
408
|
+
usageNotes: "- Requires a Google OAuth connection with Gmail readonly scope.\n- Attachments are uploaded to CDN and returned as URLs.\n- Attachments larger than 25MB are skipped.\n- Use the message ID from Search Gmail Emails, List Recent Gmail Emails, or Get Gmail Email steps.",
|
|
409
|
+
inputSchema: { "type": "object", "properties": { "messageId": { "type": "string", "description": "Gmail message ID" }, "connectionId": { "type": "string", "description": "Google OAuth connection ID" } }, "required": ["messageId"] },
|
|
410
|
+
outputSchema: { "description": "This step does not produce output data." }
|
|
411
|
+
},
|
|
396
412
|
"getGmailDraft": {
|
|
397
413
|
stepType: "getGmailDraft",
|
|
398
414
|
description: "Retrieve a specific draft from Gmail by draft ID.",
|
|
@@ -407,6 +423,13 @@ var init_metadata = __esm({
|
|
|
407
423
|
inputSchema: { "type": "object", "properties": { "messageId": { "type": "string", "description": "Gmail message ID to retrieve" }, "connectionId": { "type": "string", "description": "Google OAuth connection ID" } }, "required": ["messageId"] },
|
|
408
424
|
outputSchema: { "type": "object", "properties": { "messageId": { "type": "string", "description": "Gmail message ID" }, "subject": { "type": "string", "description": "Email subject" }, "from": { "type": "string", "description": "Sender email" }, "to": { "type": "string", "description": "Recipient email" }, "date": { "type": "string", "description": "Email date" }, "body": { "type": "string", "description": "Email body content" }, "labels": { "type": "string", "description": "Comma-separated label IDs" } }, "required": ["messageId", "subject", "from", "to", "date", "body", "labels"] }
|
|
409
425
|
},
|
|
426
|
+
"getGmailUnreadCount": {
|
|
427
|
+
stepType: "getGmailUnreadCount",
|
|
428
|
+
description: "Get the number of unread emails in the connected Gmail inbox.",
|
|
429
|
+
usageNotes: "- Requires a Google OAuth connection with Gmail readonly scope.\n- Returns the unread message count for the inbox label.\n- This is a lightweight call that does not fetch any email content.",
|
|
430
|
+
inputSchema: { "type": "object", "properties": { "connectionId": { "type": "string", "description": "Google OAuth connection ID" } } },
|
|
431
|
+
outputSchema: { "description": "This step does not produce output data." }
|
|
432
|
+
},
|
|
410
433
|
"getGoogleCalendarEvent": {
|
|
411
434
|
stepType: "getGoogleCalendarEvent",
|
|
412
435
|
description: "Retrieve a specific event from a Google Calendar by event ID.",
|
|
@@ -540,6 +563,13 @@ var init_metadata = __esm({
|
|
|
540
563
|
inputSchema: { "type": "object", "properties": { "connectionId": { "type": "string", "description": "Google OAuth connection ID" }, "limit": { "type": "string", "description": "Max drafts to return (default: 10, max: 50)" }, "exportType": { "enum": ["json", "text"], "type": "string", "description": 'Format for the variable output: "json" or "text"' } }, "required": ["exportType"] },
|
|
541
564
|
outputSchema: { "type": "object", "properties": { "drafts": { "type": "array", "items": { "type": "object", "properties": { "draftId": { "type": "string", "description": "Gmail draft ID" }, "messageId": { "type": "string", "description": "Gmail message ID" }, "subject": { "type": "string", "description": "Email subject" }, "to": { "type": "string", "description": "Recipient email" }, "snippet": { "type": "string", "description": "Short preview text" } }, "required": ["draftId", "messageId", "subject", "to", "snippet"] }, "description": "List of draft summaries" } }, "required": ["drafts"] }
|
|
542
565
|
},
|
|
566
|
+
"listGmailLabels": {
|
|
567
|
+
stepType: "listGmailLabels",
|
|
568
|
+
description: "List all labels in the connected Gmail account. Use these label IDs or names with the Update Gmail Labels step.",
|
|
569
|
+
usageNotes: '- Requires a Google OAuth connection with Gmail readonly scope.\n- Returns both system labels (INBOX, SENT, TRASH, etc.) and user-created labels.\n- Label type is "system" for built-in labels or "user" for custom labels.',
|
|
570
|
+
inputSchema: { "type": "object", "properties": { "connectionId": { "type": "string", "description": "Google OAuth connection ID" } } },
|
|
571
|
+
outputSchema: { "description": "This step does not produce output data." }
|
|
572
|
+
},
|
|
543
573
|
"listGoogleCalendarEvents": {
|
|
544
574
|
stepType: "listGoogleCalendarEvents",
|
|
545
575
|
description: "List upcoming events from a Google Calendar, ordered by start time.",
|
|
@@ -554,6 +584,13 @@ var init_metadata = __esm({
|
|
|
554
584
|
inputSchema: { "type": "object", "properties": { "folderId": { "type": "string", "description": "Google Drive folder ID (defaults to root)" }, "limit": { "type": "number", "description": "Max files to return (default: 20)" }, "connectionId": { "type": "string", "description": "Google OAuth connection ID" }, "exportType": { "enum": ["json", "text"], "type": "string", "description": 'Format for the variable output: "json" or "text"' } }, "required": ["exportType"] },
|
|
555
585
|
outputSchema: { "type": "object", "properties": { "files": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "mimeType": { "type": "string" }, "size": { "type": "string" }, "webViewLink": { "type": "string" }, "createdTime": { "type": "string" }, "modifiedTime": { "type": "string" } }, "required": ["id", "name", "mimeType", "size", "webViewLink", "createdTime", "modifiedTime"] }, "description": "List of files in the folder" } }, "required": ["files"] }
|
|
556
586
|
},
|
|
587
|
+
"listRecentGmailEmails": {
|
|
588
|
+
stepType: "listRecentGmailEmails",
|
|
589
|
+
description: "List recent emails from the connected Gmail inbox.",
|
|
590
|
+
usageNotes: '- Requires a Google OAuth connection with Gmail readonly scope.\n- Returns up to 100 emails (default 5), ordered by most recent first.\n- Functionally equivalent to Search Gmail Emails with an "in:inbox" query.',
|
|
591
|
+
inputSchema: { "type": "object", "properties": { "connectionId": { "type": "string", "description": "Google OAuth connection ID" }, "exportType": { "enum": ["json", "text"], "type": "string", "description": 'Format for the variable output: "json" or "text"' }, "limit": { "type": "string", "description": "Maximum number of emails to return (1-100, default: 5)" } }, "required": ["exportType", "limit"] },
|
|
592
|
+
outputSchema: { "description": "This step does not produce output data." }
|
|
593
|
+
},
|
|
557
594
|
"logic": {
|
|
558
595
|
stepType: "logic",
|
|
559
596
|
description: "Route execution to different branches based on AI evaluation, comparison operators, or workflow jumps.",
|
|
@@ -805,6 +842,13 @@ var init_metadata = __esm({
|
|
|
805
842
|
inputSchema: { "type": "object", "properties": { "url": { "type": "string", "description": "Full URL or username for the X profile (e.g. https://x.com/elonmusk)" } }, "required": ["url"] },
|
|
806
843
|
outputSchema: { "type": "object", "properties": { "profile": { "type": "object", "properties": { "text": { "type": "string", "description": "Markdown/plain-text content of the scraped page" }, "html": { "type": "string", "description": "Raw HTML content of the scraped page" }, "json": { "type": "object", "description": "Structured data extracted from the page" }, "screenshotUrl": { "type": "string", "description": "Screenshot URL of the page (if requested)" }, "metadata": { "type": "object", "properties": { "title": { "type": "string", "description": "Page title" }, "description": { "type": "string", "description": "Page meta description" }, "url": { "type": "string", "description": "Canonical URL" }, "image": { "type": "string", "description": "Open Graph image URL" } }, "required": ["title", "description", "url", "image"], "description": "Page metadata (Open Graph / meta tags)" } }, "required": ["text", "html"], "description": "Scraped profile data including text, HTML, and optional structured JSON" } }, "required": ["profile"] }
|
|
807
844
|
},
|
|
845
|
+
"searchGmailEmails": {
|
|
846
|
+
stepType: "searchGmailEmails",
|
|
847
|
+
description: "Search for emails in the connected Gmail account using a Gmail search query. To list recent inbox emails, pass an empty query string.",
|
|
848
|
+
usageNotes: '- Requires a Google OAuth connection with Gmail readonly scope.\n- Uses Gmail search syntax (e.g. "from:user@example.com", "subject:invoice", "is:unread").\n- To list recent inbox emails, use an empty query string or "in:inbox".\n- Returns up to 100 emails (default 5). The variable receives text or JSON depending on exportType.\n- The direct execution output always returns structured email objects.',
|
|
849
|
+
inputSchema: { "type": "object", "properties": { "query": { "type": "string", "description": 'Gmail search query (e.g. "from:user@example.com", "subject:invoice", "is:unread")' }, "connectionId": { "type": "string", "description": "Google OAuth connection ID" }, "exportType": { "enum": ["json", "text"], "type": "string", "description": 'Format for the variable output: "json" or "text"' }, "limit": { "type": "string", "description": "Maximum number of emails to return (1-10, default: 5)" } }, "required": ["query", "exportType", "limit"] },
|
|
850
|
+
outputSchema: { "type": "object", "properties": { "emails": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Gmail message ID" }, "subject": { "type": "string", "description": "Email subject line" }, "from": { "type": "string", "description": "Sender email address" }, "to": { "type": "string", "description": "Recipient email address" }, "date": { "type": "string", "description": "Email date" }, "plainBody": { "type": "string", "description": "Plain text body content" }, "htmlBody": { "type": "string", "description": "HTML body content (if available)" }, "labels": { "type": "string", "description": "Comma-separated label IDs applied to the email" } }, "required": ["id", "subject", "from", "to", "date", "plainBody", "htmlBody", "labels"] }, "description": "List of matching email messages" } }, "required": ["emails"] }
|
|
851
|
+
},
|
|
808
852
|
"searchGoogle": {
|
|
809
853
|
stepType: "searchGoogle",
|
|
810
854
|
description: "Search the web using Google and return structured results.",
|
|
@@ -882,6 +926,20 @@ var init_metadata = __esm({
|
|
|
882
926
|
inputSchema: { "type": "object", "properties": { "subject": { "type": "string", "description": "Email subject line" }, "body": { "type": "string", "description": "Email body content (plain text, markdown, HTML, or a CDN URL to an HTML file)" }, "connectionId": { "type": "string", "description": "OAuth connection ID(s) for the recipient(s), comma-separated for multiple" }, "generateHtml": { "type": "boolean", "description": "When true, auto-convert the body text into a styled HTML email using AI" }, "generateHtmlInstructions": { "type": "string", "description": "Natural language instructions for the HTML generation style" }, "generateHtmlModelOverride": { "type": "object", "properties": { "model": { "type": "string", "description": 'Model identifier (e.g. "gpt-4", "claude-3-opus")' }, "temperature": { "type": "number", "description": "Sampling temperature for the model (0-2)" }, "maxResponseTokens": { "type": "number", "description": "Maximum number of tokens in the model's response" }, "ignorePreamble": { "type": "boolean", "description": "Whether to skip the system preamble/instructions" }, "userMessagePreprocessor": { "type": "object", "properties": { "dataSource": { "type": "string", "description": "Data source identifier for the preprocessor" }, "messageTemplate": { "type": "string", "description": "Template string applied to user messages before sending to the model" }, "maxResults": { "type": "number", "description": "Maximum number of results to include from the data source" }, "enabled": { "type": "boolean", "description": "Whether the preprocessor is active" }, "shouldInherit": { "type": "boolean", "description": "Whether child steps should inherit this preprocessor configuration" } }, "description": "Preprocessor applied to user messages before sending to the model" }, "preamble": { "type": "string", "description": "System preamble/instructions for the model" }, "multiModelEnabled": { "type": "boolean", "description": "Whether multi-model candidate generation is enabled" }, "editResponseEnabled": { "type": "boolean", "description": "Whether the user can edit the model's response" }, "config": { "type": "object", "description": "Additional model-specific configuration" } }, "required": ["model", "temperature", "maxResponseTokens"], "description": "Model settings override for HTML generation" }, "attachments": { "type": "array", "items": { "type": "string" }, "description": "URLs of files to attach to the email" } }, "required": ["subject", "body"] },
|
|
883
927
|
outputSchema: { "type": "object", "properties": { "recipients": { "type": "array", "items": { "type": "string" }, "description": "Email addresses the message was sent to" } }, "required": ["recipients"] }
|
|
884
928
|
},
|
|
929
|
+
"sendGmailDraft": {
|
|
930
|
+
stepType: "sendGmailDraft",
|
|
931
|
+
description: "Send an existing draft from the connected Gmail account.",
|
|
932
|
+
usageNotes: "- Requires a Google OAuth connection with Gmail compose scope.\n- The draft is sent and removed from the Drafts folder.\n- Use the draft ID returned by the Create Gmail Draft or List Gmail Drafts steps.",
|
|
933
|
+
inputSchema: { "type": "object", "properties": { "draftId": { "type": "string", "description": "Gmail draft ID to send" }, "connectionId": { "type": "string", "description": "Google OAuth connection ID" } }, "required": ["draftId"] },
|
|
934
|
+
outputSchema: { "description": "This step does not produce output data." }
|
|
935
|
+
},
|
|
936
|
+
"sendGmailMessage": {
|
|
937
|
+
stepType: "sendGmailMessage",
|
|
938
|
+
description: "Send an email from the connected Gmail account.",
|
|
939
|
+
usageNotes: '- Requires a Google OAuth connection with Gmail compose scope.\n- messageType controls the body format: "plain" for plain text, "html" for raw HTML, "markdown" for auto-converted markdown.',
|
|
940
|
+
inputSchema: { "type": "object", "properties": { "to": { "type": "string", "description": "Recipient email address(es), comma-separated for multiple" }, "subject": { "type": "string", "description": "Email subject line" }, "message": { "type": "string", "description": "Email body content" }, "connectionId": { "type": "string", "description": "Google OAuth connection ID" }, "messageType": { "enum": ["plain", "html", "markdown"], "type": "string", "description": 'Body format: "plain", "html", or "markdown"' } }, "required": ["to", "subject", "message", "messageType"] },
|
|
941
|
+
outputSchema: { "type": "object", "properties": { "messageId": { "type": "string", "description": "Gmail message ID of the sent email" } }, "required": ["messageId"] }
|
|
942
|
+
},
|
|
885
943
|
"sendSMS": {
|
|
886
944
|
stepType: "sendSMS",
|
|
887
945
|
description: "Send an SMS or MMS message to a phone number configured via OAuth connection.",
|
|
@@ -889,6 +947,13 @@ var init_metadata = __esm({
|
|
|
889
947
|
inputSchema: { "type": "object", "properties": { "body": { "type": "string", "description": "SMS message body text" }, "connectionId": { "type": "string", "description": "OAuth connection ID for the recipient phone number" }, "mediaUrls": { "type": "array", "items": { "type": "string" }, "description": "Optional array of media URLs to send as MMS (up to 10, 5MB each)" } }, "required": ["body"] },
|
|
890
948
|
outputSchema: { "description": "This step does not produce output data." }
|
|
891
949
|
},
|
|
950
|
+
"setGmailReadStatus": {
|
|
951
|
+
stepType: "setGmailReadStatus",
|
|
952
|
+
description: "Mark one or more Gmail emails as read or unread.",
|
|
953
|
+
usageNotes: "- Requires a Google OAuth connection with Gmail modify scope.\n- Accepts one or more message IDs as a comma-separated string or array.\n- Set markAsRead to true to mark as read, false to mark as unread.",
|
|
954
|
+
inputSchema: { "type": "object", "properties": { "messageIds": { "type": "string", "description": "Gmail message ID(s), comma-separated" }, "markAsRead": { "type": "boolean", "description": "true = mark as read, false = mark as unread" }, "connectionId": { "type": "string", "description": "Google OAuth connection ID" } }, "required": ["messageIds", "markAsRead"] },
|
|
955
|
+
outputSchema: { "description": "This step does not produce output data." }
|
|
956
|
+
},
|
|
892
957
|
"setRunTitle": {
|
|
893
958
|
stepType: "setRunTitle",
|
|
894
959
|
description: "Set the title of the agent run for the user's history",
|
|
@@ -980,6 +1045,13 @@ var init_metadata = __esm({
|
|
|
980
1045
|
inputSchema: { "type": "object", "properties": { "inputUrl": { "type": "string", "description": "URL of the source audio or video file to trim" }, "start": { "type": ["number", "string"] }, "duration": { "type": ["string", "number"] }, "skipAssetCreation": { "type": "boolean", "description": "When true, the result will not appear in the user's asset history. Useful for intermediate compositing steps." } }, "required": ["inputUrl"] },
|
|
981
1046
|
outputSchema: { "type": "object", "properties": { "mediaUrl": { "type": "string", "description": "URL of the trimmed media file" } }, "required": ["mediaUrl"] }
|
|
982
1047
|
},
|
|
1048
|
+
"updateGmailLabels": {
|
|
1049
|
+
stepType: "updateGmailLabels",
|
|
1050
|
+
description: "Add or remove labels on Gmail messages, identified by message IDs or a search query.",
|
|
1051
|
+
usageNotes: "- Requires a Google OAuth connection with Gmail modify scope.\n- Provide either a query (Gmail search syntax) or explicit messageIds to target messages.\n- Label IDs can be label names or Gmail label IDs \u2014 names are resolved automatically.",
|
|
1052
|
+
inputSchema: { "type": "object", "properties": { "query": { "type": "string", "description": "Gmail search query to find messages (alternative to messageIds)" }, "connectionId": { "type": "string", "description": "Google OAuth connection ID" }, "messageIds": { "type": "string", "description": "Comma-separated message IDs to target (alternative to query)" }, "addLabelIds": { "type": "string", "description": "Comma-separated label names or IDs to add" }, "removeLabelIds": { "type": "string", "description": "Comma-separated label names or IDs to remove" } }, "required": ["query", "messageIds", "addLabelIds", "removeLabelIds"] },
|
|
1053
|
+
outputSchema: { "type": "object", "properties": { "updatedMessageIds": { "type": "array", "items": { "type": "string" }, "description": "Gmail message IDs that were updated" } }, "required": ["updatedMessageIds"] }
|
|
1054
|
+
},
|
|
983
1055
|
"updateGoogleCalendarEvent": {
|
|
984
1056
|
stepType: "updateGoogleCalendarEvent",
|
|
985
1057
|
description: "Update an existing event on a Google Calendar. Only specified fields are changed.",
|
|
@@ -1310,6 +1382,9 @@ function applyStepMethods(AgentClass) {
|
|
|
1310
1382
|
proto.createDataSource = function(step, options) {
|
|
1311
1383
|
return this.executeStep("createDataSource", step, options);
|
|
1312
1384
|
};
|
|
1385
|
+
proto.createGmailDraft = function(step, options) {
|
|
1386
|
+
return this.executeStep("createGmailDraft", step, options);
|
|
1387
|
+
};
|
|
1313
1388
|
proto.createGoogleCalendarEvent = function(step, options) {
|
|
1314
1389
|
return this.executeStep("createGoogleCalendarEvent", step, options);
|
|
1315
1390
|
};
|
|
@@ -1412,12 +1487,18 @@ function applyStepMethods(AgentClass) {
|
|
|
1412
1487
|
proto.generateVideo = function(step, options) {
|
|
1413
1488
|
return this.executeStep("generateVideo", step, options);
|
|
1414
1489
|
};
|
|
1490
|
+
proto.getGmailAttachments = function(step, options) {
|
|
1491
|
+
return this.executeStep("getGmailAttachments", step, options);
|
|
1492
|
+
};
|
|
1415
1493
|
proto.getGmailDraft = function(step, options) {
|
|
1416
1494
|
return this.executeStep("getGmailDraft", step, options);
|
|
1417
1495
|
};
|
|
1418
1496
|
proto.getGmailEmail = function(step, options) {
|
|
1419
1497
|
return this.executeStep("getGmailEmail", step, options);
|
|
1420
1498
|
};
|
|
1499
|
+
proto.getGmailUnreadCount = function(step, options) {
|
|
1500
|
+
return this.executeStep("getGmailUnreadCount", step, options);
|
|
1501
|
+
};
|
|
1421
1502
|
proto.getGoogleCalendarEvent = function(step, options) {
|
|
1422
1503
|
return this.executeStep("getGoogleCalendarEvent", step, options);
|
|
1423
1504
|
};
|
|
@@ -1475,12 +1556,18 @@ function applyStepMethods(AgentClass) {
|
|
|
1475
1556
|
proto.listGmailDrafts = function(step, options) {
|
|
1476
1557
|
return this.executeStep("listGmailDrafts", step, options);
|
|
1477
1558
|
};
|
|
1559
|
+
proto.listGmailLabels = function(step, options) {
|
|
1560
|
+
return this.executeStep("listGmailLabels", step, options);
|
|
1561
|
+
};
|
|
1478
1562
|
proto.listGoogleCalendarEvents = function(step, options) {
|
|
1479
1563
|
return this.executeStep("listGoogleCalendarEvents", step, options);
|
|
1480
1564
|
};
|
|
1481
1565
|
proto.listGoogleDriveFiles = function(step, options) {
|
|
1482
1566
|
return this.executeStep("listGoogleDriveFiles", step, options);
|
|
1483
1567
|
};
|
|
1568
|
+
proto.listRecentGmailEmails = function(step, options) {
|
|
1569
|
+
return this.executeStep("listRecentGmailEmails", step, options);
|
|
1570
|
+
};
|
|
1484
1571
|
proto.logic = function(step, options) {
|
|
1485
1572
|
return this.executeStep("logic", step, options);
|
|
1486
1573
|
};
|
|
@@ -1586,6 +1673,9 @@ function applyStepMethods(AgentClass) {
|
|
|
1586
1673
|
proto.scrapeXProfile = function(step, options) {
|
|
1587
1674
|
return this.executeStep("scrapeXProfile", step, options);
|
|
1588
1675
|
};
|
|
1676
|
+
proto.searchGmailEmails = function(step, options) {
|
|
1677
|
+
return this.executeStep("searchGmailEmails", step, options);
|
|
1678
|
+
};
|
|
1589
1679
|
proto.searchGoogle = function(step, options) {
|
|
1590
1680
|
return this.executeStep("searchGoogle", step, options);
|
|
1591
1681
|
};
|
|
@@ -1619,9 +1709,18 @@ function applyStepMethods(AgentClass) {
|
|
|
1619
1709
|
proto.sendEmail = function(step, options) {
|
|
1620
1710
|
return this.executeStep("sendEmail", step, options);
|
|
1621
1711
|
};
|
|
1712
|
+
proto.sendGmailDraft = function(step, options) {
|
|
1713
|
+
return this.executeStep("sendGmailDraft", step, options);
|
|
1714
|
+
};
|
|
1715
|
+
proto.sendGmailMessage = function(step, options) {
|
|
1716
|
+
return this.executeStep("sendGmailMessage", step, options);
|
|
1717
|
+
};
|
|
1622
1718
|
proto.sendSMS = function(step, options) {
|
|
1623
1719
|
return this.executeStep("sendSMS", step, options);
|
|
1624
1720
|
};
|
|
1721
|
+
proto.setGmailReadStatus = function(step, options) {
|
|
1722
|
+
return this.executeStep("setGmailReadStatus", step, options);
|
|
1723
|
+
};
|
|
1625
1724
|
proto.setRunTitle = function(step, options) {
|
|
1626
1725
|
return this.executeStep("setRunTitle", step, options);
|
|
1627
1726
|
};
|
|
@@ -1661,6 +1760,9 @@ function applyStepMethods(AgentClass) {
|
|
|
1661
1760
|
proto.trimMedia = function(step, options) {
|
|
1662
1761
|
return this.executeStep("trimMedia", step, options);
|
|
1663
1762
|
};
|
|
1763
|
+
proto.updateGmailLabels = function(step, options) {
|
|
1764
|
+
return this.executeStep("updateGmailLabels", step, options);
|
|
1765
|
+
};
|
|
1664
1766
|
proto.updateGoogleCalendarEvent = function(step, options) {
|
|
1665
1767
|
return this.executeStep("updateGoogleCalendarEvent", step, options);
|
|
1666
1768
|
};
|
|
@@ -1735,6 +1837,9 @@ function applyHelperMethods(AgentClass) {
|
|
|
1735
1837
|
proto.listConnections = function() {
|
|
1736
1838
|
return this._request("GET", "/helpers/connections").then((r) => r.data);
|
|
1737
1839
|
};
|
|
1840
|
+
proto.estimateStepCost = function(stepType, step, options) {
|
|
1841
|
+
return this._request("POST", "/helpers/step-cost-estimate", { step: { type: stepType, ...step }, ...options }).then((r) => r.data);
|
|
1842
|
+
};
|
|
1738
1843
|
}
|
|
1739
1844
|
var init_helpers = __esm({
|
|
1740
1845
|
"src/generated/helpers.ts"() {
|
|
@@ -1988,7 +2093,7 @@ async function startMcpServer(options) {
|
|
|
1988
2093
|
capabilities: { tools: {} },
|
|
1989
2094
|
serverInfo: {
|
|
1990
2095
|
name: "mindstudio-agent",
|
|
1991
|
-
version: "0.1.
|
|
2096
|
+
version: "0.1.1"
|
|
1992
2097
|
}
|
|
1993
2098
|
});
|
|
1994
2099
|
break;
|
|
@@ -2002,7 +2107,19 @@ async function startMcpServer(options) {
|
|
|
2002
2107
|
const args = params.arguments ?? {};
|
|
2003
2108
|
try {
|
|
2004
2109
|
let result;
|
|
2005
|
-
if (toolName === "
|
|
2110
|
+
if (toolName === "listSteps") {
|
|
2111
|
+
const meta = await getMetadata();
|
|
2112
|
+
const summary = {};
|
|
2113
|
+
for (const [name, step] of Object.entries(meta)) {
|
|
2114
|
+
summary[name] = step.description;
|
|
2115
|
+
}
|
|
2116
|
+
for (const [name, desc] of Object.entries(
|
|
2117
|
+
HELPER_DESCRIPTIONS
|
|
2118
|
+
)) {
|
|
2119
|
+
summary[name] = desc;
|
|
2120
|
+
}
|
|
2121
|
+
result = summary;
|
|
2122
|
+
} else if (toolName === "listModels") {
|
|
2006
2123
|
result = await getAgent().listModels();
|
|
2007
2124
|
} else if (toolName === "listModelsByType") {
|
|
2008
2125
|
result = await getAgent().listModelsByType(
|
|
@@ -2027,6 +2144,15 @@ async function startMcpServer(options) {
|
|
|
2027
2144
|
);
|
|
2028
2145
|
} else if (toolName === "listConnections") {
|
|
2029
2146
|
result = await getAgent().listConnections();
|
|
2147
|
+
} else if (toolName === "estimateStepCost") {
|
|
2148
|
+
result = await getAgent().estimateStepCost(
|
|
2149
|
+
args.stepType,
|
|
2150
|
+
args.step,
|
|
2151
|
+
{
|
|
2152
|
+
appId: args.appId,
|
|
2153
|
+
workflowId: args.workflowId
|
|
2154
|
+
}
|
|
2155
|
+
);
|
|
2030
2156
|
} else if (toolName === "listAgents") {
|
|
2031
2157
|
result = await getAgent().listAgents();
|
|
2032
2158
|
} else if (toolName === "runAgent") {
|
|
@@ -2081,13 +2207,31 @@ async function startMcpServer(options) {
|
|
|
2081
2207
|
}
|
|
2082
2208
|
}
|
|
2083
2209
|
}
|
|
2084
|
-
var MCP_PROTOCOL_VERSION, HELPER_TOOLS;
|
|
2210
|
+
var MCP_PROTOCOL_VERSION, HELPER_DESCRIPTIONS, HELPER_TOOLS;
|
|
2085
2211
|
var init_mcp = __esm({
|
|
2086
2212
|
"src/mcp.ts"() {
|
|
2087
2213
|
"use strict";
|
|
2088
2214
|
init_client();
|
|
2089
2215
|
MCP_PROTOCOL_VERSION = "2024-11-05";
|
|
2216
|
+
HELPER_DESCRIPTIONS = {
|
|
2217
|
+
listModels: "List all available AI models.",
|
|
2218
|
+
listModelsByType: "List AI models filtered by type.",
|
|
2219
|
+
listModelsSummary: "List all AI models (summary: id, name, type, tags).",
|
|
2220
|
+
listModelsSummaryByType: "List AI models (summary) filtered by type.",
|
|
2221
|
+
listConnectors: "List available connector services and their actions.",
|
|
2222
|
+
getConnector: "Get details for a connector service.",
|
|
2223
|
+
getConnectorAction: "Get full configuration for a connector action.",
|
|
2224
|
+
listConnections: "List OAuth connections for the organization.",
|
|
2225
|
+
estimateStepCost: "Estimate the cost of executing a step before running it.",
|
|
2226
|
+
listAgents: "List all pre-built agents in the organization.",
|
|
2227
|
+
runAgent: "Run a pre-built agent and wait for the result."
|
|
2228
|
+
};
|
|
2090
2229
|
HELPER_TOOLS = [
|
|
2230
|
+
{
|
|
2231
|
+
name: "listSteps",
|
|
2232
|
+
description: "List all available methods with their descriptions. Returns a compact { method: description } map. Use this first to discover what steps and helpers are available, then call a specific method by name.",
|
|
2233
|
+
inputSchema: { type: "object", properties: {} }
|
|
2234
|
+
},
|
|
2091
2235
|
{
|
|
2092
2236
|
name: "listModels",
|
|
2093
2237
|
description: "List all available AI models across all categories.",
|
|
@@ -2179,6 +2323,33 @@ var init_mcp = __esm({
|
|
|
2179
2323
|
description: "List OAuth connections for the organization. Use the returned connection IDs when calling connector actions.",
|
|
2180
2324
|
inputSchema: { type: "object", properties: {} }
|
|
2181
2325
|
},
|
|
2326
|
+
{
|
|
2327
|
+
name: "estimateStepCost",
|
|
2328
|
+
description: "Estimate the cost of executing a step before running it. Pass the same step config you would use for execution.",
|
|
2329
|
+
inputSchema: {
|
|
2330
|
+
type: "object",
|
|
2331
|
+
properties: {
|
|
2332
|
+
stepType: {
|
|
2333
|
+
type: "string",
|
|
2334
|
+
description: 'The step type name (e.g. "generateText").'
|
|
2335
|
+
},
|
|
2336
|
+
step: {
|
|
2337
|
+
type: "object",
|
|
2338
|
+
description: "The step input parameters.",
|
|
2339
|
+
additionalProperties: true
|
|
2340
|
+
},
|
|
2341
|
+
appId: {
|
|
2342
|
+
type: "string",
|
|
2343
|
+
description: "Optional app ID for context-specific pricing."
|
|
2344
|
+
},
|
|
2345
|
+
workflowId: {
|
|
2346
|
+
type: "string",
|
|
2347
|
+
description: "Optional workflow ID for context-specific pricing."
|
|
2348
|
+
}
|
|
2349
|
+
},
|
|
2350
|
+
required: ["stepType"]
|
|
2351
|
+
}
|
|
2352
|
+
},
|
|
2182
2353
|
{
|
|
2183
2354
|
name: "listAgents",
|
|
2184
2355
|
description: "List all pre-built agents in the organization along with org metadata.",
|
|
@@ -2226,7 +2397,7 @@ Commands:
|
|
|
2226
2397
|
whoami Show current authentication status
|
|
2227
2398
|
<method> [json | --flags] Execute a step method (shorthand for exec)
|
|
2228
2399
|
exec <method> [json | --flags] Execute a step method
|
|
2229
|
-
list [--json]
|
|
2400
|
+
list [--json] [--summary] List available methods (--summary for compact JSON)
|
|
2230
2401
|
info <method> Show method details (params, types, output)
|
|
2231
2402
|
agents [--json] List pre-built agents in your organization
|
|
2232
2403
|
run <appId> [json | --flags] Run a pre-built agent and wait for result
|
|
@@ -2323,7 +2494,8 @@ var HELPER_NAMES = /* @__PURE__ */ new Set([
|
|
|
2323
2494
|
"listConnectors",
|
|
2324
2495
|
"getConnector",
|
|
2325
2496
|
"getConnectorAction",
|
|
2326
|
-
"listConnections"
|
|
2497
|
+
"listConnections",
|
|
2498
|
+
"estimateStepCost"
|
|
2327
2499
|
]);
|
|
2328
2500
|
function resolveMethodOrFail(name, metadataKeys) {
|
|
2329
2501
|
if (metadataKeys.has(name)) return name;
|
|
@@ -2348,9 +2520,36 @@ async function getAllMethodKeys() {
|
|
|
2348
2520
|
const { stepMetadata: stepMetadata2 } = await Promise.resolve().then(() => (init_metadata(), metadata_exports));
|
|
2349
2521
|
return /* @__PURE__ */ new Set([...Object.keys(stepMetadata2), ...HELPER_NAMES]);
|
|
2350
2522
|
}
|
|
2351
|
-
|
|
2523
|
+
var HELPER_DESCRIPTIONS2 = {
|
|
2524
|
+
listModels: "List all available AI models.",
|
|
2525
|
+
listModelsByType: "List AI models filtered by type.",
|
|
2526
|
+
listModelsSummary: "List all AI models (summary: id, name, type, tags).",
|
|
2527
|
+
listModelsSummaryByType: "List AI models (summary) filtered by type.",
|
|
2528
|
+
listConnectors: "List available connector services and their actions.",
|
|
2529
|
+
getConnector: "Get details for a connector service.",
|
|
2530
|
+
getConnectorAction: "Get full configuration for a connector action.",
|
|
2531
|
+
listConnections: "List OAuth connections for the organization.",
|
|
2532
|
+
estimateStepCost: "Estimate the cost of executing a step before running it.",
|
|
2533
|
+
listAgents: "List all pre-built agents in the organization.",
|
|
2534
|
+
runAgent: "Run a pre-built agent and wait for the result."
|
|
2535
|
+
};
|
|
2536
|
+
function buildSummary(stepMetadata2) {
|
|
2537
|
+
const summary = {};
|
|
2538
|
+
for (const [name, meta] of Object.entries(stepMetadata2)) {
|
|
2539
|
+
summary[name] = meta.description;
|
|
2540
|
+
}
|
|
2541
|
+
for (const [name, desc] of Object.entries(HELPER_DESCRIPTIONS2)) {
|
|
2542
|
+
summary[name] = desc;
|
|
2543
|
+
}
|
|
2544
|
+
return summary;
|
|
2545
|
+
}
|
|
2546
|
+
async function cmdList(asJson, asSummary) {
|
|
2352
2547
|
const { stepMetadata: stepMetadata2 } = await Promise.resolve().then(() => (init_metadata(), metadata_exports));
|
|
2353
|
-
if (
|
|
2548
|
+
if (asSummary) {
|
|
2549
|
+
process.stdout.write(
|
|
2550
|
+
JSON.stringify(buildSummary(stepMetadata2)) + "\n"
|
|
2551
|
+
);
|
|
2552
|
+
} else if (asJson) {
|
|
2354
2553
|
const entries = Object.entries(stepMetadata2).map(([name, meta]) => ({
|
|
2355
2554
|
method: camelToKebab(name),
|
|
2356
2555
|
description: meta.description,
|
|
@@ -2387,7 +2586,8 @@ async function cmdInfo(rawMethod) {
|
|
|
2387
2586
|
listConnectors: { desc: "List available connector services and their actions.", input: "(none)", output: "{ services: ConnectorService[] }" },
|
|
2388
2587
|
getConnector: { desc: "Get details for a connector service.", input: "serviceId: string (required)", output: "{ service: ConnectorService }" },
|
|
2389
2588
|
getConnectorAction: { desc: "Get full configuration for a connector action.", input: "serviceId: string, actionId: string (both required)", output: "{ action: ConnectorActionDetail }" },
|
|
2390
|
-
listConnections: { desc: "List OAuth connections for the organization.", input: "(none)", output: "{ connections: Connection[] }" }
|
|
2589
|
+
listConnections: { desc: "List OAuth connections for the organization.", input: "(none)", output: "{ connections: Connection[] }" },
|
|
2590
|
+
estimateStepCost: { desc: "Estimate the cost of executing a step before running it.", input: "stepType: string (required), step: object, appId?: string, workflowId?: string", output: "{ costType?: string, estimates?: StepCostEstimateEntry[] }" }
|
|
2391
2591
|
};
|
|
2392
2592
|
const h = helpers[method];
|
|
2393
2593
|
process.stderr.write(`
|
|
@@ -2486,6 +2686,15 @@ async function cmdExec(method, input, options) {
|
|
|
2486
2686
|
);
|
|
2487
2687
|
} else if (method === "listConnections") {
|
|
2488
2688
|
result = await agent.listConnections();
|
|
2689
|
+
} else if (method === "estimateStepCost") {
|
|
2690
|
+
result = await agent.estimateStepCost(
|
|
2691
|
+
input.stepType,
|
|
2692
|
+
input.step,
|
|
2693
|
+
{
|
|
2694
|
+
appId: input.appId,
|
|
2695
|
+
workflowId: input.workflowId
|
|
2696
|
+
}
|
|
2697
|
+
);
|
|
2489
2698
|
} else {
|
|
2490
2699
|
const { stepMetadata: stepMetadata2 } = await Promise.resolve().then(() => (init_metadata(), metadata_exports));
|
|
2491
2700
|
const meta = stepMetadata2[method];
|
|
@@ -2600,7 +2809,7 @@ function isNewerVersion(current, latest) {
|
|
|
2600
2809
|
return false;
|
|
2601
2810
|
}
|
|
2602
2811
|
async function checkForUpdate() {
|
|
2603
|
-
const currentVersion = "0.1.
|
|
2812
|
+
const currentVersion = "0.1.1";
|
|
2604
2813
|
if (!currentVersion) return null;
|
|
2605
2814
|
try {
|
|
2606
2815
|
const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
@@ -2629,7 +2838,7 @@ async function checkForUpdate() {
|
|
|
2629
2838
|
}
|
|
2630
2839
|
}
|
|
2631
2840
|
function printUpdateNotice(latestVersion) {
|
|
2632
|
-
const currentVersion = "0.1.
|
|
2841
|
+
const currentVersion = "0.1.1";
|
|
2633
2842
|
process.stderr.write(
|
|
2634
2843
|
`
|
|
2635
2844
|
${ansi.cyanBright("Update available")} ${ansi.gray(currentVersion + " \u2192")} ${ansi.cyanBold(latestVersion)}
|
|
@@ -2703,7 +2912,7 @@ async function cmdLogin(options) {
|
|
|
2703
2912
|
process.stderr.write("\n");
|
|
2704
2913
|
printLogo();
|
|
2705
2914
|
process.stderr.write("\n");
|
|
2706
|
-
const ver = "0.1.
|
|
2915
|
+
const ver = "0.1.1";
|
|
2707
2916
|
process.stderr.write(
|
|
2708
2917
|
` ${ansi.bold("MindStudio")} ${ansi.gray("CLI")}${ver ? " " + ansi.gray("v" + ver) : ""}
|
|
2709
2918
|
`
|
|
@@ -2936,6 +3145,7 @@ async function main() {
|
|
|
2936
3145
|
workflow: { type: "string" },
|
|
2937
3146
|
version: { type: "string" },
|
|
2938
3147
|
json: { type: "boolean", default: false },
|
|
3148
|
+
summary: { type: "boolean", default: false },
|
|
2939
3149
|
help: { type: "boolean", default: false }
|
|
2940
3150
|
}
|
|
2941
3151
|
});
|
|
@@ -2964,7 +3174,10 @@ async function main() {
|
|
|
2964
3174
|
return;
|
|
2965
3175
|
}
|
|
2966
3176
|
if (command === "list") {
|
|
2967
|
-
await cmdList(
|
|
3177
|
+
await cmdList(
|
|
3178
|
+
values.json,
|
|
3179
|
+
values.summary
|
|
3180
|
+
);
|
|
2968
3181
|
return;
|
|
2969
3182
|
}
|
|
2970
3183
|
if (command === "agents") {
|