@mindstudio-ai/agent 0.1.78 → 0.1.80
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/dist/cli.js +20 -12
- package/dist/index.d.ts +9 -3
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +20 -12
- package/llms.txt +3 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1431,6 +1431,9 @@ declare class MindStudioAgent$1 {
|
|
|
1431
1431
|
private _db;
|
|
1432
1432
|
/** @internal Auth type — 'internal' for CALLBACK_TOKEN (managed mode), 'apiKey' otherwise. */
|
|
1433
1433
|
private _authType;
|
|
1434
|
+
/** @internal Usage source sent on step executions (from MINDSTUDIO_REQUEST_SOURCE).
|
|
1435
|
+
* Only set for api-key (CLI) auth so in-app/managed runtime is unaffected. */
|
|
1436
|
+
private _requestSource;
|
|
1434
1437
|
/**
|
|
1435
1438
|
* @internal Resolve the current auth token. Checks ALS request context
|
|
1436
1439
|
* first, then CALLBACK_TOKEN env var, then static config token.
|
|
@@ -1979,8 +1982,10 @@ interface AirtableGetTableRecordsStepOutput {
|
|
|
1979
1982
|
interface AnalyzeImageStepInput {
|
|
1980
1983
|
/** Instructions describing what to look for or extract from the image */
|
|
1981
1984
|
prompt: string;
|
|
1982
|
-
/** URL of
|
|
1983
|
-
imageUrl
|
|
1985
|
+
/** URL of a single image to analyze. Kept for backward compatibility; prefer imageUrls. */
|
|
1986
|
+
imageUrl?: string;
|
|
1987
|
+
/** One or more image URLs to analyze together in a single model request */
|
|
1988
|
+
imageUrls?: string[];
|
|
1984
1989
|
/** Optional model configuration override. Uses the workflow's default vision model if not specified */
|
|
1985
1990
|
visionModelOverride?: {
|
|
1986
1991
|
model: string;
|
|
@@ -6043,12 +6048,13 @@ interface StepMethods {
|
|
|
6043
6048
|
* @remarks
|
|
6044
6049
|
* - Uses the configured vision model to generate a text analysis of the image.
|
|
6045
6050
|
* - The prompt should describe what to look for or extract from the image.
|
|
6051
|
+
* - Pass imageUrl for a single image, or imageUrls for multiple images analyzed together in one request.
|
|
6052
|
+
* - Most vision models (OpenAI, Grok, Gemini) accept multiple images in one request. Ideogram describe is single-image only.
|
|
6046
6053
|
*
|
|
6047
6054
|
* @example
|
|
6048
6055
|
* ```typescript
|
|
6049
6056
|
* const result = await agent.analyzeImage({
|
|
6050
6057
|
* prompt: ``,
|
|
6051
|
-
* imageUrl: ``,
|
|
6052
6058
|
* });
|
|
6053
6059
|
* ```
|
|
6054
6060
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1978,8 +1978,8 @@ var stepMetadata = {
|
|
|
1978
1978
|
"analyzeImage": {
|
|
1979
1979
|
stepType: "analyzeImage",
|
|
1980
1980
|
description: "Analyze an image using a vision model based on a text prompt.",
|
|
1981
|
-
usageNotes: "- Uses the configured vision model to generate a text analysis of the image.\n- The prompt should describe what to look for or extract from the image.",
|
|
1982
|
-
inputSchema: { "type": "object", "properties": { "prompt": { "type": "string", "description": "Instructions describing what to look for or extract from the image" }, "imageUrl": { "type": "string", "description": "URL of
|
|
1981
|
+
usageNotes: "- Uses the configured vision model to generate a text analysis of the image.\n- The prompt should describe what to look for or extract from the image.\n- Pass imageUrl for a single image, or imageUrls for multiple images analyzed together in one request.\n- Most vision models (OpenAI, Grok, Gemini) accept multiple images in one request. Ideogram describe is single-image only.",
|
|
1982
|
+
inputSchema: { "type": "object", "properties": { "prompt": { "type": "string", "description": "Instructions describing what to look for or extract from the image" }, "imageUrl": { "type": "string", "description": "URL of a single image to analyze. Kept for backward compatibility; prefer imageUrls." }, "imageUrls": { "type": "array", "items": { "type": "string" }, "description": "One or more image URLs to analyze together in a single model request" }, "visionModelOverride": { "anyOf": [{ "type": "object", "properties": { "model": { "type": "string" }, "config": { "type": "object", "properties": {}, "required": [] } }, "required": ["model"] }, { "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", "properties": {}, "required": [], "description": "Additional model-specific configuration" } }, "required": ["model", "temperature", "maxResponseTokens"] }] } }, "required": ["prompt"] },
|
|
1983
1983
|
outputSchema: { "type": "object", "properties": { "analysis": { "type": "string", "description": "Text analysis of the image generated by the vision model" } }, "required": ["analysis"] }
|
|
1984
1984
|
},
|
|
1985
1985
|
"analyzeVideo": {
|
|
@@ -3928,6 +3928,9 @@ var MindStudioAgent = class {
|
|
|
3928
3928
|
_db;
|
|
3929
3929
|
/** @internal Auth type — 'internal' for CALLBACK_TOKEN (managed mode), 'apiKey' otherwise. */
|
|
3930
3930
|
_authType;
|
|
3931
|
+
/** @internal Usage source sent on step executions (from MINDSTUDIO_REQUEST_SOURCE).
|
|
3932
|
+
* Only set for api-key (CLI) auth so in-app/managed runtime is unaffected. */
|
|
3933
|
+
_requestSource;
|
|
3931
3934
|
/**
|
|
3932
3935
|
* @internal Resolve the current auth token. Checks ALS request context
|
|
3933
3936
|
* first, then CALLBACK_TOKEN env var, then static config token.
|
|
@@ -3983,6 +3986,7 @@ var MindStudioAgent = class {
|
|
|
3983
3986
|
this._reuseThreadId = options.reuseThreadId ?? /^(true|1)$/i.test(process.env.MINDSTUDIO_REUSE_THREAD_ID ?? "");
|
|
3984
3987
|
this._appId = options.appId ?? process.env.MINDSTUDIO_APP_ID ?? void 0;
|
|
3985
3988
|
this._authType = authType;
|
|
3989
|
+
this._requestSource = authType === "apiKey" ? process.env.MINDSTUDIO_REQUEST_SOURCE || void 0 : void 0;
|
|
3986
3990
|
this._httpConfig = {
|
|
3987
3991
|
baseUrl,
|
|
3988
3992
|
token,
|
|
@@ -4016,7 +4020,8 @@ var MindStudioAgent = class {
|
|
|
4016
4020
|
step,
|
|
4017
4021
|
...options?.appId != null && { appId: options.appId },
|
|
4018
4022
|
...threadId != null && { threadId },
|
|
4019
|
-
...this._currentStreamId != null && { streamId: this._currentStreamId }
|
|
4023
|
+
...this._currentStreamId != null && { streamId: this._currentStreamId },
|
|
4024
|
+
...this._requestSource != null && { requestSource: this._requestSource }
|
|
4020
4025
|
});
|
|
4021
4026
|
const remaining = headers.get("x-ratelimit-remaining");
|
|
4022
4027
|
const returnedThreadId = asyncData.threadId ?? "";
|
|
@@ -4099,7 +4104,8 @@ var MindStudioAgent = class {
|
|
|
4099
4104
|
step,
|
|
4100
4105
|
...options.appId != null && { appId: options.appId },
|
|
4101
4106
|
...threadId != null && { threadId },
|
|
4102
|
-
...this._currentStreamId != null && { streamId: this._currentStreamId }
|
|
4107
|
+
...this._currentStreamId != null && { streamId: this._currentStreamId },
|
|
4108
|
+
...this._requestSource != null && { requestSource: this._requestSource }
|
|
4103
4109
|
};
|
|
4104
4110
|
await this._httpConfig.rateLimiter.acquire();
|
|
4105
4111
|
let res;
|
|
@@ -4285,7 +4291,8 @@ var MindStudioAgent = class {
|
|
|
4285
4291
|
stepType: resolveStepType2(s.stepType)
|
|
4286
4292
|
})),
|
|
4287
4293
|
...options?.appId != null && { appId: options.appId },
|
|
4288
|
-
...threadId != null && { threadId }
|
|
4294
|
+
...threadId != null && { threadId },
|
|
4295
|
+
...this._requestSource != null && { requestSource: this._requestSource }
|
|
4289
4296
|
});
|
|
4290
4297
|
const pollUrl = `${this._currentHttpConfig.baseUrl}/developer/v2/steps/execute-batch-async/poll/${asyncData.batchToken}`;
|
|
4291
4298
|
let pollDelay = 300;
|
|
@@ -5212,7 +5219,7 @@ var monacoSnippets = {
|
|
|
5212
5219
|
"airtableDeleteRecord": { fields: [["baseId", "string"], ["tableId", "string"], ["recordId", "string"]], outputKeys: ["deleted"] },
|
|
5213
5220
|
"airtableGetRecord": { fields: [["baseId", "string"], ["tableId", "string"], ["recordId", "string"]], outputKeys: ["record"] },
|
|
5214
5221
|
"airtableGetTableRecords": { fields: [["baseId", "string"], ["tableId", "string"]], outputKeys: ["records"] },
|
|
5215
|
-
"analyzeImage": { fields: [["prompt", "string"]
|
|
5222
|
+
"analyzeImage": { fields: [["prompt", "string"]], outputKeys: ["analysis"] },
|
|
5216
5223
|
"analyzeVideo": { fields: [["prompt", "string"], ["videoUrl", "string"]], outputKeys: ["analysis"] },
|
|
5217
5224
|
"captureThumbnail": { fields: [["videoUrl", "string"], ["at", "string"]], outputKeys: ["thumbnailUrl"] },
|
|
5218
5225
|
"checkAppRole": { fields: [["roleName", "string"]], outputKeys: ["hasRole", "userRoles"] },
|