@mindstudio-ai/agent 0.1.15 → 0.1.16
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 +1 -1
- package/dist/cli.js +44 -4
- package/dist/index.d.ts +53 -25
- package/dist/index.js +43 -1
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +44 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,7 +165,7 @@ mindstudio whoami # Check current auth status
|
|
|
165
165
|
mindstudio logout # Clear stored credentials
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
Resolution order: constructor `apiKey` > `MINDSTUDIO_API_KEY` env > `~/.mindstudio/config.json
|
|
168
|
+
Resolution order: `CALLBACK_TOKEN` env (always takes priority in managed mode) > constructor `apiKey` > `MINDSTUDIO_API_KEY` env > `~/.mindstudio/config.json`.
|
|
169
169
|
|
|
170
170
|
## 200+ AI models
|
|
171
171
|
|
package/dist/cli.js
CHANGED
|
@@ -3469,6 +3469,46 @@ var init_client = __esm({
|
|
|
3469
3469
|
return data;
|
|
3470
3470
|
}
|
|
3471
3471
|
// -------------------------------------------------------------------------
|
|
3472
|
+
// Streaming
|
|
3473
|
+
// -------------------------------------------------------------------------
|
|
3474
|
+
/**
|
|
3475
|
+
* Send a stream chunk to the caller via SSE.
|
|
3476
|
+
*
|
|
3477
|
+
* When invoked from a method that was called with `stream: true`, chunks
|
|
3478
|
+
* are delivered in real-time as Server-Sent Events. When there is no active
|
|
3479
|
+
* stream (no `STREAM_ID`), calls are silently ignored — so it's safe to
|
|
3480
|
+
* call unconditionally.
|
|
3481
|
+
*
|
|
3482
|
+
* Accepts strings (sent as `type: 'token'`) or structured data (sent as
|
|
3483
|
+
* `type: 'data'`). The caller receives each chunk as an SSE event.
|
|
3484
|
+
*
|
|
3485
|
+
* @example
|
|
3486
|
+
* ```ts
|
|
3487
|
+
* // Stream text tokens
|
|
3488
|
+
* await agent.stream('Processing item 1...');
|
|
3489
|
+
*
|
|
3490
|
+
* // Stream structured data
|
|
3491
|
+
* await agent.stream({ progress: 50, currentItem: 'abc' });
|
|
3492
|
+
* ```
|
|
3493
|
+
*/
|
|
3494
|
+
stream = async (data) => {
|
|
3495
|
+
if (!this._streamId) return;
|
|
3496
|
+
const url = `${this._httpConfig.baseUrl}/_internal/v2/stream-chunk`;
|
|
3497
|
+
const body = typeof data === "string" ? { streamId: this._streamId, type: "token", text: data } : { streamId: this._streamId, type: "data", data };
|
|
3498
|
+
const res = await fetch(url, {
|
|
3499
|
+
method: "POST",
|
|
3500
|
+
headers: {
|
|
3501
|
+
"Content-Type": "application/json",
|
|
3502
|
+
Authorization: this._httpConfig.token
|
|
3503
|
+
},
|
|
3504
|
+
body: JSON.stringify(body)
|
|
3505
|
+
});
|
|
3506
|
+
if (!res.ok) {
|
|
3507
|
+
const text = await res.text().catch(() => "");
|
|
3508
|
+
console.warn(`[mindstudio] stream chunk failed: ${res.status} ${text}`);
|
|
3509
|
+
}
|
|
3510
|
+
};
|
|
3511
|
+
// -------------------------------------------------------------------------
|
|
3472
3512
|
// db + auth namespaces
|
|
3473
3513
|
// -------------------------------------------------------------------------
|
|
3474
3514
|
/**
|
|
@@ -3896,7 +3936,7 @@ async function startMcpServer(options) {
|
|
|
3896
3936
|
capabilities: { tools: {} },
|
|
3897
3937
|
serverInfo: {
|
|
3898
3938
|
name: "mindstudio-agent",
|
|
3899
|
-
version: "0.1.
|
|
3939
|
+
version: "0.1.16"
|
|
3900
3940
|
},
|
|
3901
3941
|
instructions: "Welcome to MindStudio \u2014 a platform with 200+ AI models, 850+ third-party integrations, and pre-built agents.\n\nGetting started:\n1. Call `listAgents` to verify your connection and see available agents.\n2. Call `changeName` to set your display name \u2014 use your name or whatever your user calls you. This is how you'll appear in MindStudio request logs.\n3. 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.\n4. Call `listActions` to discover all available actions.\n\nThen use the tools to generate text, images, video, audio, search the web, work with data sources, run agents, and more.\n\nImportant:\n- AI-powered actions (text generation, image generation, video, audio, etc.) cost money. Before running these, call `estimateActionCost` and confirm with the user before proceeding \u2014 unless they've explicitly told you to go ahead.\n- Not all agents from `listAgents` are configured for API use. Do not try to run an agent just because it appears in the list \u2014 it will likely fail. Only run agents the user specifically asks you to run."
|
|
3902
3942
|
});
|
|
@@ -4804,7 +4844,7 @@ function isNewerVersion(current, latest) {
|
|
|
4804
4844
|
return false;
|
|
4805
4845
|
}
|
|
4806
4846
|
async function checkForUpdate() {
|
|
4807
|
-
const currentVersion = "0.1.
|
|
4847
|
+
const currentVersion = "0.1.16";
|
|
4808
4848
|
if (!currentVersion) return null;
|
|
4809
4849
|
try {
|
|
4810
4850
|
const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
@@ -4833,7 +4873,7 @@ async function checkForUpdate() {
|
|
|
4833
4873
|
}
|
|
4834
4874
|
}
|
|
4835
4875
|
function printUpdateNotice(latestVersion) {
|
|
4836
|
-
const currentVersion = "0.1.
|
|
4876
|
+
const currentVersion = "0.1.16";
|
|
4837
4877
|
process.stderr.write(
|
|
4838
4878
|
`
|
|
4839
4879
|
${ansi.cyanBright("Update available")} ${ansi.gray(currentVersion + " \u2192")} ${ansi.cyanBold(latestVersion)}
|
|
@@ -4908,7 +4948,7 @@ async function cmdLogin(options) {
|
|
|
4908
4948
|
process.stderr.write("\n");
|
|
4909
4949
|
printLogo();
|
|
4910
4950
|
process.stderr.write("\n");
|
|
4911
|
-
const ver = "0.1.
|
|
4951
|
+
const ver = "0.1.16";
|
|
4912
4952
|
process.stderr.write(
|
|
4913
4953
|
` ${ansi.bold("MindStudio Agent")} ${ver ? " " + ansi.gray("v" + ver) : ""}
|
|
4914
4954
|
`
|
package/dist/index.d.ts
CHANGED
|
@@ -557,15 +557,6 @@ interface SystemColumns {
|
|
|
557
557
|
updated_at: number;
|
|
558
558
|
last_updated_by: string;
|
|
559
559
|
}
|
|
560
|
-
/**
|
|
561
|
-
* A row as returned from the database. Merges the user-defined type T
|
|
562
|
-
* with system columns. If T already includes system columns (e.g., the
|
|
563
|
-
* user declared `id: string`), the intersection is harmless — same type.
|
|
564
|
-
*
|
|
565
|
-
* This ensures TypeScript knows about `id`, `created_at`, etc. on read
|
|
566
|
-
* results even if the user's interface only declares their own fields.
|
|
567
|
-
*/
|
|
568
|
-
type Row<T> = T & SystemColumns;
|
|
569
560
|
/**
|
|
570
561
|
* Input type for `Table.push()`. Excludes system-managed fields.
|
|
571
562
|
* Optional fields in T remain optional.
|
|
@@ -772,17 +763,17 @@ declare class Table<T> {
|
|
|
772
763
|
/** @internal */
|
|
773
764
|
private readonly _config;
|
|
774
765
|
constructor(config: TableConfig);
|
|
775
|
-
get(id: string): Promise<
|
|
776
|
-
findOne(predicate: Predicate<
|
|
777
|
-
count(predicate?: Predicate<
|
|
778
|
-
some(predicate: Predicate<
|
|
779
|
-
every(predicate: Predicate<
|
|
766
|
+
get(id: string): Promise<T | null>;
|
|
767
|
+
findOne(predicate: Predicate<T>): Promise<T | null>;
|
|
768
|
+
count(predicate?: Predicate<T>): Promise<number>;
|
|
769
|
+
some(predicate: Predicate<T>): Promise<boolean>;
|
|
770
|
+
every(predicate: Predicate<T>): Promise<boolean>;
|
|
780
771
|
isEmpty(): Promise<boolean>;
|
|
781
|
-
min(accessor: Accessor<
|
|
782
|
-
max(accessor: Accessor<
|
|
783
|
-
groupBy<K extends string | number>(accessor: Accessor<
|
|
784
|
-
filter(predicate: Predicate<
|
|
785
|
-
sortBy(accessor: Accessor<
|
|
772
|
+
min(accessor: Accessor<T, number>): Promise<T | null>;
|
|
773
|
+
max(accessor: Accessor<T, number>): Promise<T | null>;
|
|
774
|
+
groupBy<K extends string | number>(accessor: Accessor<T, K>): Promise<Map<K, T[]>>;
|
|
775
|
+
filter(predicate: Predicate<T>): Query<T>;
|
|
776
|
+
sortBy(accessor: Accessor<T>): Query<T>;
|
|
786
777
|
/**
|
|
787
778
|
* Insert one or more rows. Returns the created row(s) with system fields
|
|
788
779
|
* populated (id, createdAt, updatedAt, lastUpdatedBy).
|
|
@@ -790,18 +781,18 @@ declare class Table<T> {
|
|
|
790
781
|
* Uses `INSERT ... RETURNING *` so the created row comes back in a
|
|
791
782
|
* single round trip — no separate SELECT needed.
|
|
792
783
|
*/
|
|
793
|
-
push(data: PushInput<T>): Promise<
|
|
794
|
-
push(data: PushInput<T>[]): Promise<
|
|
784
|
+
push(data: PushInput<T>): Promise<T>;
|
|
785
|
+
push(data: PushInput<T>[]): Promise<T[]>;
|
|
795
786
|
/**
|
|
796
787
|
* Update a row by ID. Only the provided fields are changed.
|
|
797
788
|
* Returns the updated row via `UPDATE ... RETURNING *`.
|
|
798
789
|
*/
|
|
799
|
-
update(id: string, data: UpdateInput<T>): Promise<
|
|
790
|
+
update(id: string, data: UpdateInput<T>): Promise<T>;
|
|
800
791
|
remove(id: string): Promise<void>;
|
|
801
792
|
/**
|
|
802
793
|
* Remove all rows matching a predicate. Returns the count removed.
|
|
803
794
|
*/
|
|
804
|
-
removeAll(predicate: Predicate<
|
|
795
|
+
removeAll(predicate: Predicate<T>): Promise<number>;
|
|
805
796
|
clear(): Promise<void>;
|
|
806
797
|
}
|
|
807
798
|
|
|
@@ -899,7 +890,7 @@ interface Db {
|
|
|
899
890
|
* const Orders = db.defineTable<Order>('orders', { database: 'main' });
|
|
900
891
|
* ```
|
|
901
892
|
*/
|
|
902
|
-
defineTable<T>(name: string, options?: DefineTableOptions): Table<T>;
|
|
893
|
+
defineTable<T>(name: string, options?: DefineTableOptions): Table<T & SystemColumns>;
|
|
903
894
|
/** Returns the current time as a unix timestamp (ms). Equivalent to `Date.now()`. */
|
|
904
895
|
now(): number;
|
|
905
896
|
/** Returns milliseconds for n days. Composable with `+`. */
|
|
@@ -1106,6 +1097,27 @@ declare class MindStudioAgent$1 {
|
|
|
1106
1097
|
costType?: string;
|
|
1107
1098
|
estimates?: StepCostEstimateEntry[];
|
|
1108
1099
|
}>;
|
|
1100
|
+
/**
|
|
1101
|
+
* Send a stream chunk to the caller via SSE.
|
|
1102
|
+
*
|
|
1103
|
+
* When invoked from a method that was called with `stream: true`, chunks
|
|
1104
|
+
* are delivered in real-time as Server-Sent Events. When there is no active
|
|
1105
|
+
* stream (no `STREAM_ID`), calls are silently ignored — so it's safe to
|
|
1106
|
+
* call unconditionally.
|
|
1107
|
+
*
|
|
1108
|
+
* Accepts strings (sent as `type: 'token'`) or structured data (sent as
|
|
1109
|
+
* `type: 'data'`). The caller receives each chunk as an SSE event.
|
|
1110
|
+
*
|
|
1111
|
+
* @example
|
|
1112
|
+
* ```ts
|
|
1113
|
+
* // Stream text tokens
|
|
1114
|
+
* await agent.stream('Processing item 1...');
|
|
1115
|
+
*
|
|
1116
|
+
* // Stream structured data
|
|
1117
|
+
* await agent.stream({ progress: 50, currentItem: 'abc' });
|
|
1118
|
+
* ```
|
|
1119
|
+
*/
|
|
1120
|
+
stream: (data: string | Record<string, unknown>) => Promise<void>;
|
|
1109
1121
|
/**
|
|
1110
1122
|
* The `auth` namespace — synchronous role-based access control.
|
|
1111
1123
|
*
|
|
@@ -7715,6 +7727,22 @@ declare const auth: AuthContext;
|
|
|
7715
7727
|
* ```
|
|
7716
7728
|
*/
|
|
7717
7729
|
declare const db: Db;
|
|
7730
|
+
/**
|
|
7731
|
+
* Top-level `stream` function bound to the default singleton.
|
|
7732
|
+
*
|
|
7733
|
+
* Send a stream chunk to the caller via SSE. When the method was called
|
|
7734
|
+
* with `stream: true`, chunks arrive in real-time. When there is no active
|
|
7735
|
+
* stream, calls are silently ignored.
|
|
7736
|
+
*
|
|
7737
|
+
* @example
|
|
7738
|
+
* ```ts
|
|
7739
|
+
* import { stream } from '@mindstudio-ai/agent';
|
|
7740
|
+
*
|
|
7741
|
+
* await stream('Processing...');
|
|
7742
|
+
* await stream({ progress: 50 });
|
|
7743
|
+
* ```
|
|
7744
|
+
*/
|
|
7745
|
+
declare const stream: (data: string | Record<string, unknown>) => Promise<void>;
|
|
7718
7746
|
/**
|
|
7719
7747
|
* Resolve a user ID to display info (name, email, profile picture).
|
|
7720
7748
|
* Bound to the default singleton.
|
|
@@ -7729,4 +7757,4 @@ declare const db: Db;
|
|
|
7729
7757
|
*/
|
|
7730
7758
|
declare const resolveUser: (userId: string) => Promise<ResolvedUser | null>;
|
|
7731
7759
|
|
|
7732
|
-
export { type Accessor, type ActiveCampaignAddNoteStepInput, type ActiveCampaignAddNoteStepOutput, type ActiveCampaignCreateContactStepInput, type ActiveCampaignCreateContactStepOutput, type AddSubtitlesToVideoStepInput, type AddSubtitlesToVideoStepOutput, type AgentInfo, type AgentOptions, type AirtableCreateUpdateRecordStepInput, type AirtableCreateUpdateRecordStepOutput, type AirtableDeleteRecordStepInput, type AirtableDeleteRecordStepOutput, type AirtableGetRecordStepInput, type AirtableGetRecordStepOutput, type AirtableGetTableRecordsStepInput, type AirtableGetTableRecordsStepOutput, type AnalyzeImageStepInput, type AnalyzeImageStepOutput, type AnalyzeVideoStepInput, type AnalyzeVideoStepOutput, type AppAuthContext, type AppContextResult, type AppDatabase, type AppDatabaseColumnSchema, type AppDatabaseTable, type AppRoleAssignment, AuthContext, type BatchStepInput, type BatchStepResult, type CaptureThumbnailStepInput, type CaptureThumbnailStepOutput, type CheckAppRoleStepInput, type CheckAppRoleStepOutput, type CodaCreateUpdatePageStepInput, type CodaCreateUpdatePageStepOutput, type CodaCreateUpdateRowStepInput, type CodaCreateUpdateRowStepOutput, type CodaFindRowStepInput, type CodaFindRowStepOutput, type CodaGetPageStepInput, type CodaGetPageStepOutput, type CodaGetTableRowsStepInput, type CodaGetTableRowsStepOutput, type Connection, type ConnectorActionDetail, type ConnectorService, type ConvertPdfToImagesStepInput, type ConvertPdfToImagesStepOutput, type CreateDataSourceStepInput, type CreateDataSourceStepOutput, type CreateGmailDraftStepInput, type CreateGmailDraftStepOutput, type CreateGoogleCalendarEventStepInput, type CreateGoogleCalendarEventStepOutput, type CreateGoogleDocStepInput, type CreateGoogleDocStepOutput, type CreateGoogleSheetStepInput, type CreateGoogleSheetStepOutput, type Db, type DefineTableOptions, type DeleteDataSourceDocumentStepInput, type DeleteDataSourceDocumentStepOutput, type DeleteDataSourceStepInput, type DeleteDataSourceStepOutput, type DeleteGmailEmailStepInput, type DeleteGmailEmailStepOutput, type DeleteGoogleCalendarEventStepInput, type DeleteGoogleCalendarEventStepOutput, type DeleteGoogleSheetRowsStepInput, type DeleteGoogleSheetRowsStepOutput, type DetectChangesStepInput, type DetectChangesStepOutput, type DetectPIIStepInput, type DetectPIIStepOutput, type DiscordEditMessageStepInput, type DiscordEditMessageStepOutput, type DiscordSendFollowUpStepInput, type DiscordSendFollowUpStepOutput, type DiscordSendMessageStepInput, type DiscordSendMessageStepOutput, type DownloadVideoStepInput, type DownloadVideoStepOutput, type EnhanceImageGenerationPromptStepInput, type EnhanceImageGenerationPromptStepOutput, type EnhanceVideoGenerationPromptStepInput, type EnhanceVideoGenerationPromptStepOutput, type EnrichPersonStepInput, type EnrichPersonStepOutput, type ExecuteStepBatchOptions, type ExecuteStepBatchResult, type ExtractAudioFromVideoStepInput, type ExtractAudioFromVideoStepOutput, type ExtractTextStepInput, type ExtractTextStepOutput, type FetchDataSourceDocumentStepInput, type FetchDataSourceDocumentStepOutput, type FetchGoogleDocStepInput, type FetchGoogleDocStepOutput, type FetchGoogleSheetStepInput, type FetchGoogleSheetStepOutput, type FetchSlackChannelHistoryStepInput, type FetchSlackChannelHistoryStepOutput, type FetchYoutubeCaptionsStepInput, type FetchYoutubeCaptionsStepOutput, type FetchYoutubeChannelStepInput, type FetchYoutubeChannelStepOutput, type FetchYoutubeCommentsStepInput, type FetchYoutubeCommentsStepOutput, type FetchYoutubeVideoStepInput, type FetchYoutubeVideoStepOutput, type GenerateAssetStepInput, type GenerateAssetStepOutput, type GenerateChartStepInput, type GenerateChartStepOutput, type GenerateImageStepInput, type GenerateImageStepOutput, type GenerateLipsyncStepInput, type GenerateLipsyncStepOutput, type GenerateMusicStepInput, type GenerateMusicStepOutput, type GeneratePdfStepInput, type GeneratePdfStepOutput, type GenerateStaticVideoFromImageStepInput, type GenerateStaticVideoFromImageStepOutput, type GenerateTextStepInput, type GenerateTextStepOutput, type GenerateVideoStepInput, type GenerateVideoStepOutput, type GetGmailAttachmentsStepInput, type GetGmailAttachmentsStepOutput, type GetGmailDraftStepInput, type GetGmailDraftStepOutput, type GetGmailEmailStepInput, type GetGmailEmailStepOutput, type GetGmailUnreadCountStepInput, type GetGmailUnreadCountStepOutput, type GetGoogleCalendarEventStepInput, type GetGoogleCalendarEventStepOutput, type GetGoogleDriveFileStepInput, type GetGoogleDriveFileStepOutput, type GetGoogleSheetInfoStepInput, type GetGoogleSheetInfoStepOutput, type GetMediaMetadataStepInput, type GetMediaMetadataStepOutput, type HttpRequestStepInput, type HttpRequestStepOutput, type HubspotCreateCompanyStepInput, type HubspotCreateCompanyStepOutput, type HubspotCreateContactStepInput, type HubspotCreateContactStepOutput, type HubspotGetCompanyStepInput, type HubspotGetCompanyStepOutput, type HubspotGetContactStepInput, type HubspotGetContactStepOutput, type HunterApiCompanyEnrichmentStepInput, type HunterApiCompanyEnrichmentStepOutput, type HunterApiDomainSearchStepInput, type HunterApiDomainSearchStepOutput, type HunterApiEmailFinderStepInput, type HunterApiEmailFinderStepOutput, type HunterApiEmailVerificationStepInput, type HunterApiEmailVerificationStepOutput, type HunterApiPersonEnrichmentStepInput, type HunterApiPersonEnrichmentStepOutput, type ImageFaceSwapStepInput, type ImageFaceSwapStepOutput, type ImageRemoveWatermarkStepInput, type ImageRemoveWatermarkStepOutput, type InsertVideoClipsStepInput, type InsertVideoClipsStepOutput, type ListAgentsResult, type ListDataSourcesStepInput, type ListDataSourcesStepOutput, type ListGmailDraftsStepInput, type ListGmailDraftsStepOutput, type ListGmailLabelsStepInput, type ListGmailLabelsStepOutput, type ListGoogleCalendarEventsStepInput, type ListGoogleCalendarEventsStepOutput, type ListGoogleDriveFilesStepInput, type ListGoogleDriveFilesStepOutput, type ListRecentGmailEmailsStepInput, type ListRecentGmailEmailsStepOutput, type LogicStepInput, type LogicStepOutput, type MakeDotComRunScenarioStepInput, type MakeDotComRunScenarioStepOutput, type MergeAudioStepInput, type MergeAudioStepOutput, type MergeVideosStepInput, type MergeVideosStepOutput, MindStudioAgent, MindStudioError, type MindStudioModel, type MindStudioModelSummary, type MixAudioIntoVideoStepInput, type MixAudioIntoVideoStepOutput, type ModelType, type MonacoSnippet, type MonacoSnippetField, type MonacoSnippetFieldType, type MuteVideoStepInput, type MuteVideoStepOutput, type N8nRunNodeStepInput, type N8nRunNodeStepOutput, type NotionCreatePageStepInput, type NotionCreatePageStepOutput, type NotionUpdatePageStepInput, type NotionUpdatePageStepOutput, type PeopleSearchStepInput, type PeopleSearchStepOutput, type PostToLinkedInStepInput, type PostToLinkedInStepOutput, type PostToSlackChannelStepInput, type PostToSlackChannelStepOutput, type PostToXStepInput, type PostToXStepOutput, type PostToZapierStepInput, type PostToZapierStepOutput, type Predicate, type PushInput, Query, type QueryAppDatabaseStepInput, type QueryAppDatabaseStepOutput, type QueryDataSourceStepInput, type QueryDataSourceStepOutput, type QueryExternalDatabaseStepInput, type QueryExternalDatabaseStepOutput, type RedactPIIStepInput, type RedactPIIStepOutput, type RemoveBackgroundFromImageStepInput, type RemoveBackgroundFromImageStepOutput, type ReplyToGmailEmailStepInput, type ReplyToGmailEmailStepOutput, type ResizeVideoStepInput, type ResizeVideoStepOutput, type ResolvedUser, Roles, type RunAgentOptions, type RunAgentResult, type RunFromConnectorRegistryStepInput, type RunFromConnectorRegistryStepOutput, type RunPackagedWorkflowStepInput, type RunPackagedWorkflowStepOutput, type ScrapeFacebookPageStepInput, type ScrapeFacebookPageStepOutput, type ScrapeFacebookPostsStepInput, type ScrapeFacebookPostsStepOutput, type ScrapeInstagramCommentsStepInput, type ScrapeInstagramCommentsStepOutput, type ScrapeInstagramMentionsStepInput, type ScrapeInstagramMentionsStepOutput, type ScrapeInstagramPostsStepInput, type ScrapeInstagramPostsStepOutput, type ScrapeInstagramProfileStepInput, type ScrapeInstagramProfileStepOutput, type ScrapeInstagramReelsStepInput, type ScrapeInstagramReelsStepOutput, type ScrapeLinkedInCompanyStepInput, type ScrapeLinkedInCompanyStepOutput, type ScrapeLinkedInProfileStepInput, type ScrapeLinkedInProfileStepOutput, type ScrapeMetaThreadsProfileStepInput, type ScrapeMetaThreadsProfileStepOutput, type ScrapeUrlStepInput, type ScrapeUrlStepOutput, type ScrapeXPostStepInput, type ScrapeXPostStepOutput, type ScrapeXProfileStepInput, type ScrapeXProfileStepOutput, type SearchGmailEmailsStepInput, type SearchGmailEmailsStepOutput, type SearchGoogleCalendarEventsStepInput, type SearchGoogleCalendarEventsStepOutput, type SearchGoogleDriveStepInput, type SearchGoogleDriveStepOutput, type SearchGoogleImagesStepInput, type SearchGoogleImagesStepOutput, type SearchGoogleNewsStepInput, type SearchGoogleNewsStepOutput, type SearchGoogleStepInput, type SearchGoogleStepOutput, type SearchGoogleTrendsStepInput, type SearchGoogleTrendsStepOutput, type SearchPerplexityStepInput, type SearchPerplexityStepOutput, type SearchXPostsStepInput, type SearchXPostsStepOutput, type SearchYoutubeStepInput, type SearchYoutubeStepOutput, type SearchYoutubeTrendsStepInput, type SearchYoutubeTrendsStepOutput, type SendEmailStepInput, type SendEmailStepOutput, type SendGmailDraftStepInput, type SendGmailDraftStepOutput, type SendGmailMessageStepInput, type SendGmailMessageStepOutput, type SendSMSStepInput, type SendSMSStepOutput, type SetGmailReadStatusStepInput, type SetGmailReadStatusStepOutput, type SetRunTitleStepInput, type SetRunTitleStepOutput, type SetVariableStepInput, type SetVariableStepOutput, type StepCostEstimateEntry, type StepExecutionMeta, type StepExecutionOptions, type StepExecutionResult, type StepInputMap, type StepMetadata, type StepMethods, type StepName, type StepOutputMap, type SystemFields, Table, type TelegramEditMessageStepInput, type TelegramEditMessageStepOutput, type TelegramReplyToMessageStepInput, type TelegramReplyToMessageStepOutput, type TelegramSendAudioStepInput, type TelegramSendAudioStepOutput, type TelegramSendFileStepInput, type TelegramSendFileStepOutput, type TelegramSendImageStepInput, type TelegramSendImageStepOutput, type TelegramSendMessageStepInput, type TelegramSendMessageStepOutput, type TelegramSendVideoStepInput, type TelegramSendVideoStepOutput, type TelegramSetTypingStepInput, type TelegramSetTypingStepOutput, type TextToSpeechStepInput, type TextToSpeechStepOutput, type TranscribeAudioStepInput, type TranscribeAudioStepOutput, type TrimMediaStepInput, type TrimMediaStepOutput, type UpdateGmailLabelsStepInput, type UpdateGmailLabelsStepOutput, type UpdateGoogleCalendarEventStepInput, type UpdateGoogleCalendarEventStepOutput, type UpdateGoogleDocStepInput, type UpdateGoogleDocStepOutput, type UpdateGoogleSheetStepInput, type UpdateGoogleSheetStepOutput, type UpdateInput, type UploadDataSourceDocumentStepInput, type UploadDataSourceDocumentStepOutput, type UploadFileResult, type UpscaleImageStepInput, type UpscaleImageStepOutput, type UpscaleVideoStepInput, type UpscaleVideoStepOutput, type User, type UserInfoResult, type UserMessageStepInput, type UserMessageStepOutput, type VideoFaceSwapStepInput, type VideoFaceSwapStepOutput, type VideoRemoveBackgroundStepInput, type VideoRemoveBackgroundStepOutput, type VideoRemoveWatermarkStepInput, type VideoRemoveWatermarkStepOutput, type WatermarkImageStepInput, type WatermarkImageStepOutput, type WatermarkVideoStepInput, type WatermarkVideoStepOutput, auth, blockTypeAliases, db, mindstudio as default, mindstudio, monacoSnippets, resolveUser, stepMetadata };
|
|
7760
|
+
export { type Accessor, type ActiveCampaignAddNoteStepInput, type ActiveCampaignAddNoteStepOutput, type ActiveCampaignCreateContactStepInput, type ActiveCampaignCreateContactStepOutput, type AddSubtitlesToVideoStepInput, type AddSubtitlesToVideoStepOutput, type AgentInfo, type AgentOptions, type AirtableCreateUpdateRecordStepInput, type AirtableCreateUpdateRecordStepOutput, type AirtableDeleteRecordStepInput, type AirtableDeleteRecordStepOutput, type AirtableGetRecordStepInput, type AirtableGetRecordStepOutput, type AirtableGetTableRecordsStepInput, type AirtableGetTableRecordsStepOutput, type AnalyzeImageStepInput, type AnalyzeImageStepOutput, type AnalyzeVideoStepInput, type AnalyzeVideoStepOutput, type AppAuthContext, type AppContextResult, type AppDatabase, type AppDatabaseColumnSchema, type AppDatabaseTable, type AppRoleAssignment, AuthContext, type BatchStepInput, type BatchStepResult, type CaptureThumbnailStepInput, type CaptureThumbnailStepOutput, type CheckAppRoleStepInput, type CheckAppRoleStepOutput, type CodaCreateUpdatePageStepInput, type CodaCreateUpdatePageStepOutput, type CodaCreateUpdateRowStepInput, type CodaCreateUpdateRowStepOutput, type CodaFindRowStepInput, type CodaFindRowStepOutput, type CodaGetPageStepInput, type CodaGetPageStepOutput, type CodaGetTableRowsStepInput, type CodaGetTableRowsStepOutput, type Connection, type ConnectorActionDetail, type ConnectorService, type ConvertPdfToImagesStepInput, type ConvertPdfToImagesStepOutput, type CreateDataSourceStepInput, type CreateDataSourceStepOutput, type CreateGmailDraftStepInput, type CreateGmailDraftStepOutput, type CreateGoogleCalendarEventStepInput, type CreateGoogleCalendarEventStepOutput, type CreateGoogleDocStepInput, type CreateGoogleDocStepOutput, type CreateGoogleSheetStepInput, type CreateGoogleSheetStepOutput, type Db, type DefineTableOptions, type DeleteDataSourceDocumentStepInput, type DeleteDataSourceDocumentStepOutput, type DeleteDataSourceStepInput, type DeleteDataSourceStepOutput, type DeleteGmailEmailStepInput, type DeleteGmailEmailStepOutput, type DeleteGoogleCalendarEventStepInput, type DeleteGoogleCalendarEventStepOutput, type DeleteGoogleSheetRowsStepInput, type DeleteGoogleSheetRowsStepOutput, type DetectChangesStepInput, type DetectChangesStepOutput, type DetectPIIStepInput, type DetectPIIStepOutput, type DiscordEditMessageStepInput, type DiscordEditMessageStepOutput, type DiscordSendFollowUpStepInput, type DiscordSendFollowUpStepOutput, type DiscordSendMessageStepInput, type DiscordSendMessageStepOutput, type DownloadVideoStepInput, type DownloadVideoStepOutput, type EnhanceImageGenerationPromptStepInput, type EnhanceImageGenerationPromptStepOutput, type EnhanceVideoGenerationPromptStepInput, type EnhanceVideoGenerationPromptStepOutput, type EnrichPersonStepInput, type EnrichPersonStepOutput, type ExecuteStepBatchOptions, type ExecuteStepBatchResult, type ExtractAudioFromVideoStepInput, type ExtractAudioFromVideoStepOutput, type ExtractTextStepInput, type ExtractTextStepOutput, type FetchDataSourceDocumentStepInput, type FetchDataSourceDocumentStepOutput, type FetchGoogleDocStepInput, type FetchGoogleDocStepOutput, type FetchGoogleSheetStepInput, type FetchGoogleSheetStepOutput, type FetchSlackChannelHistoryStepInput, type FetchSlackChannelHistoryStepOutput, type FetchYoutubeCaptionsStepInput, type FetchYoutubeCaptionsStepOutput, type FetchYoutubeChannelStepInput, type FetchYoutubeChannelStepOutput, type FetchYoutubeCommentsStepInput, type FetchYoutubeCommentsStepOutput, type FetchYoutubeVideoStepInput, type FetchYoutubeVideoStepOutput, type GenerateAssetStepInput, type GenerateAssetStepOutput, type GenerateChartStepInput, type GenerateChartStepOutput, type GenerateImageStepInput, type GenerateImageStepOutput, type GenerateLipsyncStepInput, type GenerateLipsyncStepOutput, type GenerateMusicStepInput, type GenerateMusicStepOutput, type GeneratePdfStepInput, type GeneratePdfStepOutput, type GenerateStaticVideoFromImageStepInput, type GenerateStaticVideoFromImageStepOutput, type GenerateTextStepInput, type GenerateTextStepOutput, type GenerateVideoStepInput, type GenerateVideoStepOutput, type GetGmailAttachmentsStepInput, type GetGmailAttachmentsStepOutput, type GetGmailDraftStepInput, type GetGmailDraftStepOutput, type GetGmailEmailStepInput, type GetGmailEmailStepOutput, type GetGmailUnreadCountStepInput, type GetGmailUnreadCountStepOutput, type GetGoogleCalendarEventStepInput, type GetGoogleCalendarEventStepOutput, type GetGoogleDriveFileStepInput, type GetGoogleDriveFileStepOutput, type GetGoogleSheetInfoStepInput, type GetGoogleSheetInfoStepOutput, type GetMediaMetadataStepInput, type GetMediaMetadataStepOutput, type HttpRequestStepInput, type HttpRequestStepOutput, type HubspotCreateCompanyStepInput, type HubspotCreateCompanyStepOutput, type HubspotCreateContactStepInput, type HubspotCreateContactStepOutput, type HubspotGetCompanyStepInput, type HubspotGetCompanyStepOutput, type HubspotGetContactStepInput, type HubspotGetContactStepOutput, type HunterApiCompanyEnrichmentStepInput, type HunterApiCompanyEnrichmentStepOutput, type HunterApiDomainSearchStepInput, type HunterApiDomainSearchStepOutput, type HunterApiEmailFinderStepInput, type HunterApiEmailFinderStepOutput, type HunterApiEmailVerificationStepInput, type HunterApiEmailVerificationStepOutput, type HunterApiPersonEnrichmentStepInput, type HunterApiPersonEnrichmentStepOutput, type ImageFaceSwapStepInput, type ImageFaceSwapStepOutput, type ImageRemoveWatermarkStepInput, type ImageRemoveWatermarkStepOutput, type InsertVideoClipsStepInput, type InsertVideoClipsStepOutput, type ListAgentsResult, type ListDataSourcesStepInput, type ListDataSourcesStepOutput, type ListGmailDraftsStepInput, type ListGmailDraftsStepOutput, type ListGmailLabelsStepInput, type ListGmailLabelsStepOutput, type ListGoogleCalendarEventsStepInput, type ListGoogleCalendarEventsStepOutput, type ListGoogleDriveFilesStepInput, type ListGoogleDriveFilesStepOutput, type ListRecentGmailEmailsStepInput, type ListRecentGmailEmailsStepOutput, type LogicStepInput, type LogicStepOutput, type MakeDotComRunScenarioStepInput, type MakeDotComRunScenarioStepOutput, type MergeAudioStepInput, type MergeAudioStepOutput, type MergeVideosStepInput, type MergeVideosStepOutput, MindStudioAgent, MindStudioError, type MindStudioModel, type MindStudioModelSummary, type MixAudioIntoVideoStepInput, type MixAudioIntoVideoStepOutput, type ModelType, type MonacoSnippet, type MonacoSnippetField, type MonacoSnippetFieldType, type MuteVideoStepInput, type MuteVideoStepOutput, type N8nRunNodeStepInput, type N8nRunNodeStepOutput, type NotionCreatePageStepInput, type NotionCreatePageStepOutput, type NotionUpdatePageStepInput, type NotionUpdatePageStepOutput, type PeopleSearchStepInput, type PeopleSearchStepOutput, type PostToLinkedInStepInput, type PostToLinkedInStepOutput, type PostToSlackChannelStepInput, type PostToSlackChannelStepOutput, type PostToXStepInput, type PostToXStepOutput, type PostToZapierStepInput, type PostToZapierStepOutput, type Predicate, type PushInput, Query, type QueryAppDatabaseStepInput, type QueryAppDatabaseStepOutput, type QueryDataSourceStepInput, type QueryDataSourceStepOutput, type QueryExternalDatabaseStepInput, type QueryExternalDatabaseStepOutput, type RedactPIIStepInput, type RedactPIIStepOutput, type RemoveBackgroundFromImageStepInput, type RemoveBackgroundFromImageStepOutput, type ReplyToGmailEmailStepInput, type ReplyToGmailEmailStepOutput, type ResizeVideoStepInput, type ResizeVideoStepOutput, type ResolvedUser, Roles, type RunAgentOptions, type RunAgentResult, type RunFromConnectorRegistryStepInput, type RunFromConnectorRegistryStepOutput, type RunPackagedWorkflowStepInput, type RunPackagedWorkflowStepOutput, type ScrapeFacebookPageStepInput, type ScrapeFacebookPageStepOutput, type ScrapeFacebookPostsStepInput, type ScrapeFacebookPostsStepOutput, type ScrapeInstagramCommentsStepInput, type ScrapeInstagramCommentsStepOutput, type ScrapeInstagramMentionsStepInput, type ScrapeInstagramMentionsStepOutput, type ScrapeInstagramPostsStepInput, type ScrapeInstagramPostsStepOutput, type ScrapeInstagramProfileStepInput, type ScrapeInstagramProfileStepOutput, type ScrapeInstagramReelsStepInput, type ScrapeInstagramReelsStepOutput, type ScrapeLinkedInCompanyStepInput, type ScrapeLinkedInCompanyStepOutput, type ScrapeLinkedInProfileStepInput, type ScrapeLinkedInProfileStepOutput, type ScrapeMetaThreadsProfileStepInput, type ScrapeMetaThreadsProfileStepOutput, type ScrapeUrlStepInput, type ScrapeUrlStepOutput, type ScrapeXPostStepInput, type ScrapeXPostStepOutput, type ScrapeXProfileStepInput, type ScrapeXProfileStepOutput, type SearchGmailEmailsStepInput, type SearchGmailEmailsStepOutput, type SearchGoogleCalendarEventsStepInput, type SearchGoogleCalendarEventsStepOutput, type SearchGoogleDriveStepInput, type SearchGoogleDriveStepOutput, type SearchGoogleImagesStepInput, type SearchGoogleImagesStepOutput, type SearchGoogleNewsStepInput, type SearchGoogleNewsStepOutput, type SearchGoogleStepInput, type SearchGoogleStepOutput, type SearchGoogleTrendsStepInput, type SearchGoogleTrendsStepOutput, type SearchPerplexityStepInput, type SearchPerplexityStepOutput, type SearchXPostsStepInput, type SearchXPostsStepOutput, type SearchYoutubeStepInput, type SearchYoutubeStepOutput, type SearchYoutubeTrendsStepInput, type SearchYoutubeTrendsStepOutput, type SendEmailStepInput, type SendEmailStepOutput, type SendGmailDraftStepInput, type SendGmailDraftStepOutput, type SendGmailMessageStepInput, type SendGmailMessageStepOutput, type SendSMSStepInput, type SendSMSStepOutput, type SetGmailReadStatusStepInput, type SetGmailReadStatusStepOutput, type SetRunTitleStepInput, type SetRunTitleStepOutput, type SetVariableStepInput, type SetVariableStepOutput, type StepCostEstimateEntry, type StepExecutionMeta, type StepExecutionOptions, type StepExecutionResult, type StepInputMap, type StepMetadata, type StepMethods, type StepName, type StepOutputMap, type SystemFields, Table, type TelegramEditMessageStepInput, type TelegramEditMessageStepOutput, type TelegramReplyToMessageStepInput, type TelegramReplyToMessageStepOutput, type TelegramSendAudioStepInput, type TelegramSendAudioStepOutput, type TelegramSendFileStepInput, type TelegramSendFileStepOutput, type TelegramSendImageStepInput, type TelegramSendImageStepOutput, type TelegramSendMessageStepInput, type TelegramSendMessageStepOutput, type TelegramSendVideoStepInput, type TelegramSendVideoStepOutput, type TelegramSetTypingStepInput, type TelegramSetTypingStepOutput, type TextToSpeechStepInput, type TextToSpeechStepOutput, type TranscribeAudioStepInput, type TranscribeAudioStepOutput, type TrimMediaStepInput, type TrimMediaStepOutput, type UpdateGmailLabelsStepInput, type UpdateGmailLabelsStepOutput, type UpdateGoogleCalendarEventStepInput, type UpdateGoogleCalendarEventStepOutput, type UpdateGoogleDocStepInput, type UpdateGoogleDocStepOutput, type UpdateGoogleSheetStepInput, type UpdateGoogleSheetStepOutput, type UpdateInput, type UploadDataSourceDocumentStepInput, type UploadDataSourceDocumentStepOutput, type UploadFileResult, type UpscaleImageStepInput, type UpscaleImageStepOutput, type UpscaleVideoStepInput, type UpscaleVideoStepOutput, type User, type UserInfoResult, type UserMessageStepInput, type UserMessageStepOutput, type VideoFaceSwapStepInput, type VideoFaceSwapStepOutput, type VideoRemoveBackgroundStepInput, type VideoRemoveBackgroundStepOutput, type VideoRemoveWatermarkStepInput, type VideoRemoveWatermarkStepOutput, type WatermarkImageStepInput, type WatermarkImageStepOutput, type WatermarkVideoStepInput, type WatermarkVideoStepOutput, auth, blockTypeAliases, db, mindstudio as default, mindstudio, monacoSnippets, resolveUser, stepMetadata, stream };
|
package/dist/index.js
CHANGED
|
@@ -2181,6 +2181,46 @@ var MindStudioAgent = class {
|
|
|
2181
2181
|
return data;
|
|
2182
2182
|
}
|
|
2183
2183
|
// -------------------------------------------------------------------------
|
|
2184
|
+
// Streaming
|
|
2185
|
+
// -------------------------------------------------------------------------
|
|
2186
|
+
/**
|
|
2187
|
+
* Send a stream chunk to the caller via SSE.
|
|
2188
|
+
*
|
|
2189
|
+
* When invoked from a method that was called with `stream: true`, chunks
|
|
2190
|
+
* are delivered in real-time as Server-Sent Events. When there is no active
|
|
2191
|
+
* stream (no `STREAM_ID`), calls are silently ignored — so it's safe to
|
|
2192
|
+
* call unconditionally.
|
|
2193
|
+
*
|
|
2194
|
+
* Accepts strings (sent as `type: 'token'`) or structured data (sent as
|
|
2195
|
+
* `type: 'data'`). The caller receives each chunk as an SSE event.
|
|
2196
|
+
*
|
|
2197
|
+
* @example
|
|
2198
|
+
* ```ts
|
|
2199
|
+
* // Stream text tokens
|
|
2200
|
+
* await agent.stream('Processing item 1...');
|
|
2201
|
+
*
|
|
2202
|
+
* // Stream structured data
|
|
2203
|
+
* await agent.stream({ progress: 50, currentItem: 'abc' });
|
|
2204
|
+
* ```
|
|
2205
|
+
*/
|
|
2206
|
+
stream = async (data) => {
|
|
2207
|
+
if (!this._streamId) return;
|
|
2208
|
+
const url = `${this._httpConfig.baseUrl}/_internal/v2/stream-chunk`;
|
|
2209
|
+
const body = typeof data === "string" ? { streamId: this._streamId, type: "token", text: data } : { streamId: this._streamId, type: "data", data };
|
|
2210
|
+
const res = await fetch(url, {
|
|
2211
|
+
method: "POST",
|
|
2212
|
+
headers: {
|
|
2213
|
+
"Content-Type": "application/json",
|
|
2214
|
+
Authorization: this._httpConfig.token
|
|
2215
|
+
},
|
|
2216
|
+
body: JSON.stringify(body)
|
|
2217
|
+
});
|
|
2218
|
+
if (!res.ok) {
|
|
2219
|
+
const text = await res.text().catch(() => "");
|
|
2220
|
+
console.warn(`[mindstudio] stream chunk failed: ${res.status} ${text}`);
|
|
2221
|
+
}
|
|
2222
|
+
};
|
|
2223
|
+
// -------------------------------------------------------------------------
|
|
2184
2224
|
// db + auth namespaces
|
|
2185
2225
|
// -------------------------------------------------------------------------
|
|
2186
2226
|
/**
|
|
@@ -3903,6 +3943,7 @@ var db = new Proxy(
|
|
|
3903
3943
|
}
|
|
3904
3944
|
}
|
|
3905
3945
|
);
|
|
3946
|
+
var stream = (data) => mindstudio.stream(data);
|
|
3906
3947
|
var resolveUser = (userId) => mindstudio.resolveUser(userId);
|
|
3907
3948
|
export {
|
|
3908
3949
|
AuthContext,
|
|
@@ -3916,6 +3957,7 @@ export {
|
|
|
3916
3957
|
mindstudio,
|
|
3917
3958
|
monacoSnippets,
|
|
3918
3959
|
resolveUser,
|
|
3919
|
-
stepMetadata
|
|
3960
|
+
stepMetadata,
|
|
3961
|
+
stream
|
|
3920
3962
|
};
|
|
3921
3963
|
//# sourceMappingURL=index.js.map
|