@mindstudio-ai/agent 0.1.55 → 0.1.57
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 +182 -31
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +182 -31
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4245,7 +4245,7 @@ var init_client = __esm({
|
|
|
4245
4245
|
*/
|
|
4246
4246
|
async getUserInfo() {
|
|
4247
4247
|
const { data } = await request(
|
|
4248
|
-
this.
|
|
4248
|
+
this._currentHttpConfig,
|
|
4249
4249
|
"GET",
|
|
4250
4250
|
"/account/userinfo"
|
|
4251
4251
|
);
|
|
@@ -4261,7 +4261,7 @@ var init_client = __esm({
|
|
|
4261
4261
|
*/
|
|
4262
4262
|
async listAgents() {
|
|
4263
4263
|
const { data } = await request(
|
|
4264
|
-
this.
|
|
4264
|
+
this._currentHttpConfig,
|
|
4265
4265
|
"GET",
|
|
4266
4266
|
"/agents/load"
|
|
4267
4267
|
);
|
|
@@ -4283,7 +4283,7 @@ var init_client = __esm({
|
|
|
4283
4283
|
*/
|
|
4284
4284
|
async runAgent(options) {
|
|
4285
4285
|
const pollInterval = options.pollIntervalMs ?? 1e3;
|
|
4286
|
-
const { data } = await request(this.
|
|
4286
|
+
const { data } = await request(this._currentHttpConfig, "POST", "/agents/run", {
|
|
4287
4287
|
appId: options.appId,
|
|
4288
4288
|
async: true,
|
|
4289
4289
|
...options.variables != null && { variables: options.variables },
|
|
@@ -4332,7 +4332,7 @@ var init_client = __esm({
|
|
|
4332
4332
|
}
|
|
4333
4333
|
/** @internal Used by generated action methods. */
|
|
4334
4334
|
_request(method, path, body) {
|
|
4335
|
-
return request(this.
|
|
4335
|
+
return request(this._currentHttpConfig, method, path, body);
|
|
4336
4336
|
}
|
|
4337
4337
|
// -------------------------------------------------------------------------
|
|
4338
4338
|
// Helper methods — models
|
|
@@ -4340,7 +4340,7 @@ var init_client = __esm({
|
|
|
4340
4340
|
/** List all available AI models. */
|
|
4341
4341
|
async listModels() {
|
|
4342
4342
|
const { data } = await request(
|
|
4343
|
-
this.
|
|
4343
|
+
this._currentHttpConfig,
|
|
4344
4344
|
"GET",
|
|
4345
4345
|
"/helpers/models"
|
|
4346
4346
|
);
|
|
@@ -4349,7 +4349,7 @@ var init_client = __esm({
|
|
|
4349
4349
|
/** List AI models filtered by type. */
|
|
4350
4350
|
async listModelsByType(modelType) {
|
|
4351
4351
|
const { data } = await request(
|
|
4352
|
-
this.
|
|
4352
|
+
this._currentHttpConfig,
|
|
4353
4353
|
"GET",
|
|
4354
4354
|
`/helpers/models/${modelType}`
|
|
4355
4355
|
);
|
|
@@ -4358,7 +4358,7 @@ var init_client = __esm({
|
|
|
4358
4358
|
/** List all available AI models (summary). Returns only id, name, type, and tags. */
|
|
4359
4359
|
async listModelsSummary() {
|
|
4360
4360
|
const { data } = await request(
|
|
4361
|
-
this.
|
|
4361
|
+
this._currentHttpConfig,
|
|
4362
4362
|
"GET",
|
|
4363
4363
|
"/helpers/models-summary"
|
|
4364
4364
|
);
|
|
@@ -4367,7 +4367,7 @@ var init_client = __esm({
|
|
|
4367
4367
|
/** List AI models (summary) filtered by type. */
|
|
4368
4368
|
async listModelsSummaryByType(modelType) {
|
|
4369
4369
|
const { data } = await request(
|
|
4370
|
-
this.
|
|
4370
|
+
this._currentHttpConfig,
|
|
4371
4371
|
"GET",
|
|
4372
4372
|
`/helpers/models-summary/${modelType}`
|
|
4373
4373
|
);
|
|
@@ -4384,7 +4384,7 @@ var init_client = __esm({
|
|
|
4384
4384
|
*/
|
|
4385
4385
|
async listConnectors() {
|
|
4386
4386
|
const { data } = await request(
|
|
4387
|
-
this.
|
|
4387
|
+
this._currentHttpConfig,
|
|
4388
4388
|
"GET",
|
|
4389
4389
|
"/helpers/connectors"
|
|
4390
4390
|
);
|
|
@@ -4393,7 +4393,7 @@ var init_client = __esm({
|
|
|
4393
4393
|
/** Get details for a single OAuth connector service. */
|
|
4394
4394
|
async getConnector(serviceId) {
|
|
4395
4395
|
const { data } = await request(
|
|
4396
|
-
this.
|
|
4396
|
+
this._currentHttpConfig,
|
|
4397
4397
|
"GET",
|
|
4398
4398
|
`/helpers/connectors/${serviceId}`
|
|
4399
4399
|
);
|
|
@@ -4402,7 +4402,7 @@ var init_client = __esm({
|
|
|
4402
4402
|
/** Get the full configuration for an OAuth connector action, including input fields. */
|
|
4403
4403
|
async getConnectorAction(serviceId, actionId) {
|
|
4404
4404
|
const { data } = await request(
|
|
4405
|
-
this.
|
|
4405
|
+
this._currentHttpConfig,
|
|
4406
4406
|
"GET",
|
|
4407
4407
|
`/helpers/connectors/${serviceId}/${actionId}`
|
|
4408
4408
|
);
|
|
@@ -4411,7 +4411,7 @@ var init_client = __esm({
|
|
|
4411
4411
|
/** List OAuth connections for the organization. These are authenticated third-party service links. */
|
|
4412
4412
|
async listConnections() {
|
|
4413
4413
|
const { data } = await request(
|
|
4414
|
-
this.
|
|
4414
|
+
this._currentHttpConfig,
|
|
4415
4415
|
"GET",
|
|
4416
4416
|
"/helpers/connections"
|
|
4417
4417
|
);
|
|
@@ -4422,7 +4422,7 @@ var init_client = __esm({
|
|
|
4422
4422
|
// -------------------------------------------------------------------------
|
|
4423
4423
|
/** Estimate the cost of executing an action before running it. */
|
|
4424
4424
|
async estimateStepCost(stepType, step, options) {
|
|
4425
|
-
const { data } = await request(this.
|
|
4425
|
+
const { data } = await request(this._currentHttpConfig, "POST", "/helpers/step-cost-estimate", {
|
|
4426
4426
|
step: { type: resolveStepType2(stepType), ...step },
|
|
4427
4427
|
...options
|
|
4428
4428
|
});
|
|
@@ -4823,7 +4823,7 @@ var init_client = __esm({
|
|
|
4823
4823
|
*/
|
|
4824
4824
|
async resolveUsers(userIds) {
|
|
4825
4825
|
const { data } = await request(
|
|
4826
|
-
this.
|
|
4826
|
+
this._currentHttpConfig,
|
|
4827
4827
|
"POST",
|
|
4828
4828
|
"/helpers/resolve-users",
|
|
4829
4829
|
{ userIds }
|
|
@@ -4851,7 +4851,7 @@ var init_client = __esm({
|
|
|
4851
4851
|
async getAppContext(appId) {
|
|
4852
4852
|
const query = appId ? `?appId=${encodeURIComponent(appId)}` : "";
|
|
4853
4853
|
const { data } = await request(
|
|
4854
|
-
this.
|
|
4854
|
+
this._currentHttpConfig,
|
|
4855
4855
|
"GET",
|
|
4856
4856
|
`/helpers/app-context${query}`
|
|
4857
4857
|
);
|
|
@@ -4880,7 +4880,7 @@ var init_client = __esm({
|
|
|
4880
4880
|
*/
|
|
4881
4881
|
async uploadFile(content, options) {
|
|
4882
4882
|
const { data } = await request(
|
|
4883
|
-
this.
|
|
4883
|
+
this._currentHttpConfig,
|
|
4884
4884
|
"POST",
|
|
4885
4885
|
"/account/upload",
|
|
4886
4886
|
{
|
|
@@ -5326,6 +5326,162 @@ var init_instructions = __esm({
|
|
|
5326
5326
|
}
|
|
5327
5327
|
});
|
|
5328
5328
|
|
|
5329
|
+
// src/ask/prompt/playbook.ts
|
|
5330
|
+
var playbook;
|
|
5331
|
+
var init_playbook = __esm({
|
|
5332
|
+
"src/ask/prompt/playbook.ts"() {
|
|
5333
|
+
"use strict";
|
|
5334
|
+
playbook = `<prompt_engineering_playbook>
|
|
5335
|
+
|
|
5336
|
+
You are not just a technical assistant \u2014 you are a prompt engineering expert. When developers ask you to build something with generateText, generateImage, task agents, or multi-step workflows, you should proactively share opinions on HOW to write the prompts, not just which actions to call. Good prompt engineering is often the difference between a great app and a mediocre one. Be opinionated. Explain the techniques you're using and why.
|
|
5337
|
+
|
|
5338
|
+
## Core principles
|
|
5339
|
+
|
|
5340
|
+
1. **Role assignment beats generic instructions.** Start prompts by telling the model WHO it is acting as, not just what to do. "Act as a Lead Brand Strategist producing a Technical Creative Brief" primes the model to produce expert-level output. "Write a description of this image" does not.
|
|
5341
|
+
|
|
5342
|
+
2. **Structure beats prose.** Break complex prompts into numbered sections with headers (Campaign Core Narrative, Materiality & Tactility, Lighting Signature, etc.). Models follow structure better than they follow paragraphs.
|
|
5343
|
+
|
|
5344
|
+
3. **Explicit operational rules prevent drift.** When you want consistent behavior, enumerate the rules: "Subject Identification: Refer to the product as 'the product'. No Physical Descriptions. Product Integrity: Do not add props." Without these, models invent things.
|
|
5345
|
+
|
|
5346
|
+
4. **AI-optimized technical language.** Use precise domain terminology the model has seen in training. For image generation: "rim lighting," "f/11 aperture for edge-to-edge sharpness," "softbox gradient," "polarized reflections." For text: named frameworks, industry terms, specific examples. Avoid vague emotive words.
|
|
5347
|
+
|
|
5348
|
+
5. **Tagged context variables.** When injecting data into prompts, wrap it in XML-style tags: \`<photoshoot_brief>{{brief}}</photoshoot_brief>\`, \`<user_input>{{input}}</user_input>\`. This helps the model distinguish instructions from content.
|
|
5349
|
+
|
|
5350
|
+
6. **Output format specification at the end.** Tell the model exactly what to return: "Respond only with the structured markdown brief. Do not include introductory or concluding remarks." Or for JSON: "Respond only with a JSON array and absolutely no other text." Models default to being chatty \u2014 you have to tell them not to be.
|
|
5351
|
+
|
|
5352
|
+
## The analyze \u2192 brief \u2192 generate pattern (THE killer pattern for generation consistency)
|
|
5353
|
+
|
|
5354
|
+
This is the most important pattern in MindStudio. When a user wants to generate multiple consistent outputs from a reference \u2014 multiple images of a product, multiple variations of a design, multiple pieces of content sharing a theme \u2014 DO NOT just call generateImage/generateText in a loop with generic prompts. Instead, chain actions:
|
|
5355
|
+
|
|
5356
|
+
**Step 1: Analyze the reference.** Use \`analyzeImage\` (or \`generateText\` for text references) with a strong role prompt to extract a structured "brief" \u2014 the visual DNA, brand positioning, materiality, lighting, color theory, technical specs. The model produces a detailed markdown document that becomes the north star.
|
|
5357
|
+
|
|
5358
|
+
**Step 2: Generate a shot list / content list.** Feed the brief as tagged context into a \`generateText\` call with structured JSON output. Ask for N distinct items that maintain the brief's consistency. Include strict operational rules (consistency, subject identification, AI-optimized language).
|
|
5359
|
+
|
|
5360
|
+
**Step 3: Execute each item.** For each entry in the list, call \`generateImage\` (or \`generateText\`, etc.) passing the reference AND the specific item's prompt. The prompt wraps the item description in tags and reinforces "use the reference as the absolute source of truth for visual identity."
|
|
5361
|
+
|
|
5362
|
+
### Why this works vs a naive single call
|
|
5363
|
+
|
|
5364
|
+
- A naive "generate 8 product photos" call gives you 8 random photos with no consistency.
|
|
5365
|
+
- The analyze\u2192brief\u2192generate pattern produces a cohesive brand asset pack where every output shares the same visual DNA.
|
|
5366
|
+
- The model has MUCH more context on the second and third steps because steps 1 and 2 packed the reference's visual identity into structured text.
|
|
5367
|
+
|
|
5368
|
+
### Example prompt snippets (use these as templates)
|
|
5369
|
+
|
|
5370
|
+
**Analyze prompt (Step 1):**
|
|
5371
|
+
\`\`\`
|
|
5372
|
+
The provided reference image represents the "Hero Asset" of a high-end industrial design product line. Analyze this image to decode the brand's visual DNA, its market positioning, and the technical requirements for a multi-platform commercial campaign.
|
|
5373
|
+
|
|
5374
|
+
Act as a Lead Brand Strategist. Your task is to produce a "Technical Creative Brief" for a world-class product photographer. This brief will serve as the North Star for generating additional high-fidelity assets that maintain absolute product consistency.
|
|
5375
|
+
|
|
5376
|
+
Analyze the reference image and structure the brief as follows:
|
|
5377
|
+
|
|
5378
|
+
1. **Campaign Core Narrative:** Define the product's "vibe"...
|
|
5379
|
+
2. **Materiality & Tactility:** Identify the specific materials shown...
|
|
5380
|
+
3. **Lighting Signature:** Deconstruct the light source, quality, direction...
|
|
5381
|
+
4. **Color Theory & Environment:** Analyze the color palette and the "set"...
|
|
5382
|
+
5. **Technical Specs for Photography:** Specify focal lengths, depth of field...
|
|
5383
|
+
6. **Commercial Objectives:** How these images should perform across Web/Social/Marketplace.
|
|
5384
|
+
|
|
5385
|
+
Respond only with the structured markdown brief. Do not include introductory or concluding remarks.
|
|
5386
|
+
\`\`\`
|
|
5387
|
+
|
|
5388
|
+
**Shot list prompt (Step 2):**
|
|
5389
|
+
\`\`\`
|
|
5390
|
+
<photoshoot_brief>
|
|
5391
|
+
{{brief}}
|
|
5392
|
+
</photoshoot_brief>
|
|
5393
|
+
|
|
5394
|
+
Using the provided <photoshoot_brief>, generate a technical shot list of eight distinct, high-end commercial images. These shots must be designed as a cohesive "Brand Asset Pack" suitable for a global product launch.
|
|
5395
|
+
|
|
5396
|
+
Each description must be a masterclass in technical AI prompting, focusing on how light interacts with the product's specific industrial materials while maintaining a minimalist, luxury tech aesthetic.
|
|
5397
|
+
|
|
5398
|
+
## Shot List Requirements
|
|
5399
|
+
1. **The Hero Centerpiece:** Front-facing, iconic shot for a website header.
|
|
5400
|
+
2. **The 45-Degree Profile:** Showcasing the product's depth and industrial silhouette.
|
|
5401
|
+
3. **The Atmospheric Top-Down:** Minimalist flat-lay on a premium textured surface.
|
|
5402
|
+
4. **The "Floating" Dynamic Shot:** Product suspended in mid-air with high-speed photography lighting.
|
|
5403
|
+
... (and so on)
|
|
5404
|
+
|
|
5405
|
+
## Strict Operational Rules
|
|
5406
|
+
- **Subject Identification:** Refer to the product as "the product"...
|
|
5407
|
+
- **No Physical Descriptions:** Do not describe appearance/clothing of people...
|
|
5408
|
+
- **Product Integrity:** Do not add subjects or props that distract...
|
|
5409
|
+
- **AI-Optimized Language:** Use technical photography terms...
|
|
5410
|
+
- **Consistency:** Lighting temperature, background palette, and material rendering must remain identical across all shots.
|
|
5411
|
+
|
|
5412
|
+
Respond only with the full shot descriptions as a JSON array and absolutely no other text.
|
|
5413
|
+
\`\`\`
|
|
5414
|
+
|
|
5415
|
+
**Generation prompt (Step 3, per item):**
|
|
5416
|
+
\`\`\`
|
|
5417
|
+
<new_shot_instruction>
|
|
5418
|
+
{{shotPrompt}}
|
|
5419
|
+
</new_shot_instruction>
|
|
5420
|
+
|
|
5421
|
+
**Objective:** Using the provided reference image as the absolute source of truth for the product's industrial design, colors, and textures, generate a new, high-fidelity commercial photograph.
|
|
5422
|
+
|
|
5423
|
+
**Execution Guidelines:**
|
|
5424
|
+
1. **Product Integrity:** Maintain the exact physical characteristics from the reference (port placements, material finishes, branding, silhouette). The product must remain "as is."
|
|
5425
|
+
2. **Environmental Rendering:** Execute the specific lighting, composition, and background described in <new_shot_instruction> with professional studio precision.
|
|
5426
|
+
3. **Commercial Fidelity:** The output must be a "market-ready" asset. Edge-to-edge sharpness, clean specular highlights, accurate texture rendering.
|
|
5427
|
+
4. **Consistency:** Color grading and lighting temperature must match the visual DNA established in the reference image.
|
|
5428
|
+
|
|
5429
|
+
The goal is a seamless addition to the professional photoshoot that looks indistinguishable from a high-end agency production.
|
|
5430
|
+
\`\`\`
|
|
5431
|
+
|
|
5432
|
+
## When to apply this pattern
|
|
5433
|
+
|
|
5434
|
+
- **User wants multiple consistent images from a reference** (product photos, character variations, style-matched illustrations) \u2192 analyze \u2192 shot list \u2192 generate
|
|
5435
|
+
- **User wants content in multiple formats sharing a theme** (blog + social + email from a single brief) \u2192 analyze \u2192 content plan \u2192 generate per format
|
|
5436
|
+
- **User wants to transform a reference into a different style/context while preserving identity** \u2192 analyze identity \u2192 generate with strong reference guidance
|
|
5437
|
+
- **User mentions "consistent," "cohesive," "branded," "matching," "on-brand"** \u2014 these are signals the analyze\u2192brief\u2192generate pattern applies
|
|
5438
|
+
|
|
5439
|
+
## When NOT to apply this pattern
|
|
5440
|
+
|
|
5441
|
+
- User wants a single one-off generation (just use the action directly with a good prompt)
|
|
5442
|
+
- User wants truly random variations (no brief needed)
|
|
5443
|
+
- User has already written their prompts (don't override their intent)
|
|
5444
|
+
|
|
5445
|
+
## General prompt writing template
|
|
5446
|
+
|
|
5447
|
+
For any generateText or analyzeImage call that produces non-trivial output:
|
|
5448
|
+
|
|
5449
|
+
\`\`\`
|
|
5450
|
+
[Role assignment: "Act as a [specific expert role]"]
|
|
5451
|
+
|
|
5452
|
+
[Context: what's happening, who's consuming the output]
|
|
5453
|
+
|
|
5454
|
+
[Primary task: one clear sentence]
|
|
5455
|
+
|
|
5456
|
+
[Input reference: wrapped in XML tags]
|
|
5457
|
+
<user_input>{{input}}</user_input>
|
|
5458
|
+
|
|
5459
|
+
[Structured sections or numbered requirements]
|
|
5460
|
+
1. **Section Name:** Specific instruction
|
|
5461
|
+
2. **Section Name:** Specific instruction
|
|
5462
|
+
...
|
|
5463
|
+
|
|
5464
|
+
[Operational rules / constraints]
|
|
5465
|
+
- **Rule name:** constraint
|
|
5466
|
+
- **Rule name:** constraint
|
|
5467
|
+
...
|
|
5468
|
+
|
|
5469
|
+
[Output format specification]
|
|
5470
|
+
Respond only with [exact format]. Do not include [unwanted content].
|
|
5471
|
+
\`\`\`
|
|
5472
|
+
|
|
5473
|
+
## Voice and tone in prompts
|
|
5474
|
+
|
|
5475
|
+
When the output is user-facing text (not internal analysis), ALWAYS include voice and tone constraints in the prompt. Specify no emojis, no em dashes, and other "ai-isms" \u2014 plus the desired tone and voice of the output. Without this, models default to emoji-laden corporate speak.
|
|
5476
|
+
|
|
5477
|
+
## Share opinions proactively
|
|
5478
|
+
|
|
5479
|
+
When responding to prompt-related questions, be opinionated. Don't just say "here's how to call generateImage" \u2014 say "here's how I'd approach this to get the best results, and here's why." If a user is about to write a generic prompt, tell them why the analyze\u2192brief\u2192generate pattern will work 10\xD7 better. Explain the technique. Be the expert in the room.
|
|
5480
|
+
|
|
5481
|
+
</prompt_engineering_playbook>`;
|
|
5482
|
+
}
|
|
5483
|
+
});
|
|
5484
|
+
|
|
5329
5485
|
// src/generated/llms-content.ts
|
|
5330
5486
|
var llms_content_exports = {};
|
|
5331
5487
|
__export(llms_content_exports, {
|
|
@@ -5365,6 +5521,8 @@ async function buildSystemPrompt(agent) {
|
|
|
5365
5521
|
|
|
5366
5522
|
${referenceDocs}
|
|
5367
5523
|
|
|
5524
|
+
${playbook}
|
|
5525
|
+
|
|
5368
5526
|
${instructions}
|
|
5369
5527
|
|
|
5370
5528
|
<!-- cache_breakpoint -->`;
|
|
@@ -5375,14 +5533,7 @@ var init_prompt = __esm({
|
|
|
5375
5533
|
init_identity();
|
|
5376
5534
|
init_reference();
|
|
5377
5535
|
init_instructions();
|
|
5378
|
-
|
|
5379
|
-
});
|
|
5380
|
-
|
|
5381
|
-
// src/ask/prompt.ts
|
|
5382
|
-
var init_prompt2 = __esm({
|
|
5383
|
-
"src/ask/prompt.ts"() {
|
|
5384
|
-
"use strict";
|
|
5385
|
-
init_prompt();
|
|
5536
|
+
init_playbook();
|
|
5386
5537
|
}
|
|
5387
5538
|
});
|
|
5388
5539
|
|
|
@@ -5525,7 +5676,7 @@ var init_ask = __esm({
|
|
|
5525
5676
|
await init_client();
|
|
5526
5677
|
init_sse();
|
|
5527
5678
|
init_tools();
|
|
5528
|
-
|
|
5679
|
+
init_prompt();
|
|
5529
5680
|
DEFAULT_BASE_URL2 = "https://v1.mindstudio-api.com";
|
|
5530
5681
|
ansi = {
|
|
5531
5682
|
dim: (s) => `\x1B[2m${s}\x1B[0m`,
|
|
@@ -5597,7 +5748,7 @@ async function startMcpServer(options) {
|
|
|
5597
5748
|
capabilities: { tools: {} },
|
|
5598
5749
|
serverInfo: {
|
|
5599
5750
|
name: "mindstudio-agent",
|
|
5600
|
-
version: "0.1.
|
|
5751
|
+
version: "0.1.57"
|
|
5601
5752
|
},
|
|
5602
5753
|
instructions: 'Welcome to MindStudio \u2014 a platform with 200+ AI models, 850+ third-party integrations, and pre-built agents.\n\nGetting started:\n1. Call `ask` with any question about the SDK \u2014 it knows every action, model, and connector and returns working code with real model IDs and config options. Examples: ask("generate an image with FLUX"), ask("what models support vision?"), ask("how do I send a Slack message?").\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.\n4. For manual browsing, 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.'
|
|
5603
5754
|
});
|
|
@@ -6554,7 +6705,7 @@ function isNewerVersion(current, latest) {
|
|
|
6554
6705
|
return false;
|
|
6555
6706
|
}
|
|
6556
6707
|
async function checkForUpdate() {
|
|
6557
|
-
const currentVersion = "0.1.
|
|
6708
|
+
const currentVersion = "0.1.57";
|
|
6558
6709
|
if (!currentVersion) return null;
|
|
6559
6710
|
try {
|
|
6560
6711
|
const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
@@ -6583,7 +6734,7 @@ async function checkForUpdate() {
|
|
|
6583
6734
|
}
|
|
6584
6735
|
}
|
|
6585
6736
|
function printUpdateNotice(latestVersion) {
|
|
6586
|
-
const currentVersion = "0.1.
|
|
6737
|
+
const currentVersion = "0.1.57";
|
|
6587
6738
|
process.stderr.write(
|
|
6588
6739
|
`
|
|
6589
6740
|
${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
|
|
@@ -6596,7 +6747,7 @@ function isStandaloneBinary() {
|
|
|
6596
6747
|
return !argv1.includes("node_modules");
|
|
6597
6748
|
}
|
|
6598
6749
|
async function cmdUpdate() {
|
|
6599
|
-
const currentVersion = "0.1.
|
|
6750
|
+
const currentVersion = "0.1.57";
|
|
6600
6751
|
process.stderr.write(
|
|
6601
6752
|
` ${ansi2.gray("Current version:")} ${currentVersion}
|
|
6602
6753
|
`
|
|
@@ -6731,7 +6882,7 @@ async function cmdLogin(options) {
|
|
|
6731
6882
|
process.stderr.write("\n");
|
|
6732
6883
|
printLogo();
|
|
6733
6884
|
process.stderr.write("\n");
|
|
6734
|
-
const ver = "0.1.
|
|
6885
|
+
const ver = "0.1.57";
|
|
6735
6886
|
process.stderr.write(
|
|
6736
6887
|
` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
|
|
6737
6888
|
`
|
|
@@ -7058,7 +7209,7 @@ async function main() {
|
|
|
7058
7209
|
try {
|
|
7059
7210
|
if (command === "version" || command === "-v") {
|
|
7060
7211
|
process.stdout.write(
|
|
7061
|
-
"0.1.
|
|
7212
|
+
"0.1.57\n"
|
|
7062
7213
|
);
|
|
7063
7214
|
return;
|
|
7064
7215
|
}
|
package/dist/index.js
CHANGED
|
@@ -4063,7 +4063,7 @@ var MindStudioAgent = class {
|
|
|
4063
4063
|
*/
|
|
4064
4064
|
async getUserInfo() {
|
|
4065
4065
|
const { data } = await request(
|
|
4066
|
-
this.
|
|
4066
|
+
this._currentHttpConfig,
|
|
4067
4067
|
"GET",
|
|
4068
4068
|
"/account/userinfo"
|
|
4069
4069
|
);
|
|
@@ -4079,7 +4079,7 @@ var MindStudioAgent = class {
|
|
|
4079
4079
|
*/
|
|
4080
4080
|
async listAgents() {
|
|
4081
4081
|
const { data } = await request(
|
|
4082
|
-
this.
|
|
4082
|
+
this._currentHttpConfig,
|
|
4083
4083
|
"GET",
|
|
4084
4084
|
"/agents/load"
|
|
4085
4085
|
);
|
|
@@ -4101,7 +4101,7 @@ var MindStudioAgent = class {
|
|
|
4101
4101
|
*/
|
|
4102
4102
|
async runAgent(options) {
|
|
4103
4103
|
const pollInterval = options.pollIntervalMs ?? 1e3;
|
|
4104
|
-
const { data } = await request(this.
|
|
4104
|
+
const { data } = await request(this._currentHttpConfig, "POST", "/agents/run", {
|
|
4105
4105
|
appId: options.appId,
|
|
4106
4106
|
async: true,
|
|
4107
4107
|
...options.variables != null && { variables: options.variables },
|
|
@@ -4150,7 +4150,7 @@ var MindStudioAgent = class {
|
|
|
4150
4150
|
}
|
|
4151
4151
|
/** @internal Used by generated action methods. */
|
|
4152
4152
|
_request(method, path, body) {
|
|
4153
|
-
return request(this.
|
|
4153
|
+
return request(this._currentHttpConfig, method, path, body);
|
|
4154
4154
|
}
|
|
4155
4155
|
// -------------------------------------------------------------------------
|
|
4156
4156
|
// Helper methods — models
|
|
@@ -4158,7 +4158,7 @@ var MindStudioAgent = class {
|
|
|
4158
4158
|
/** List all available AI models. */
|
|
4159
4159
|
async listModels() {
|
|
4160
4160
|
const { data } = await request(
|
|
4161
|
-
this.
|
|
4161
|
+
this._currentHttpConfig,
|
|
4162
4162
|
"GET",
|
|
4163
4163
|
"/helpers/models"
|
|
4164
4164
|
);
|
|
@@ -4167,7 +4167,7 @@ var MindStudioAgent = class {
|
|
|
4167
4167
|
/** List AI models filtered by type. */
|
|
4168
4168
|
async listModelsByType(modelType) {
|
|
4169
4169
|
const { data } = await request(
|
|
4170
|
-
this.
|
|
4170
|
+
this._currentHttpConfig,
|
|
4171
4171
|
"GET",
|
|
4172
4172
|
`/helpers/models/${modelType}`
|
|
4173
4173
|
);
|
|
@@ -4176,7 +4176,7 @@ var MindStudioAgent = class {
|
|
|
4176
4176
|
/** List all available AI models (summary). Returns only id, name, type, and tags. */
|
|
4177
4177
|
async listModelsSummary() {
|
|
4178
4178
|
const { data } = await request(
|
|
4179
|
-
this.
|
|
4179
|
+
this._currentHttpConfig,
|
|
4180
4180
|
"GET",
|
|
4181
4181
|
"/helpers/models-summary"
|
|
4182
4182
|
);
|
|
@@ -4185,7 +4185,7 @@ var MindStudioAgent = class {
|
|
|
4185
4185
|
/** List AI models (summary) filtered by type. */
|
|
4186
4186
|
async listModelsSummaryByType(modelType) {
|
|
4187
4187
|
const { data } = await request(
|
|
4188
|
-
this.
|
|
4188
|
+
this._currentHttpConfig,
|
|
4189
4189
|
"GET",
|
|
4190
4190
|
`/helpers/models-summary/${modelType}`
|
|
4191
4191
|
);
|
|
@@ -4202,7 +4202,7 @@ var MindStudioAgent = class {
|
|
|
4202
4202
|
*/
|
|
4203
4203
|
async listConnectors() {
|
|
4204
4204
|
const { data } = await request(
|
|
4205
|
-
this.
|
|
4205
|
+
this._currentHttpConfig,
|
|
4206
4206
|
"GET",
|
|
4207
4207
|
"/helpers/connectors"
|
|
4208
4208
|
);
|
|
@@ -4211,7 +4211,7 @@ var MindStudioAgent = class {
|
|
|
4211
4211
|
/** Get details for a single OAuth connector service. */
|
|
4212
4212
|
async getConnector(serviceId) {
|
|
4213
4213
|
const { data } = await request(
|
|
4214
|
-
this.
|
|
4214
|
+
this._currentHttpConfig,
|
|
4215
4215
|
"GET",
|
|
4216
4216
|
`/helpers/connectors/${serviceId}`
|
|
4217
4217
|
);
|
|
@@ -4220,7 +4220,7 @@ var MindStudioAgent = class {
|
|
|
4220
4220
|
/** Get the full configuration for an OAuth connector action, including input fields. */
|
|
4221
4221
|
async getConnectorAction(serviceId, actionId) {
|
|
4222
4222
|
const { data } = await request(
|
|
4223
|
-
this.
|
|
4223
|
+
this._currentHttpConfig,
|
|
4224
4224
|
"GET",
|
|
4225
4225
|
`/helpers/connectors/${serviceId}/${actionId}`
|
|
4226
4226
|
);
|
|
@@ -4229,7 +4229,7 @@ var MindStudioAgent = class {
|
|
|
4229
4229
|
/** List OAuth connections for the organization. These are authenticated third-party service links. */
|
|
4230
4230
|
async listConnections() {
|
|
4231
4231
|
const { data } = await request(
|
|
4232
|
-
this.
|
|
4232
|
+
this._currentHttpConfig,
|
|
4233
4233
|
"GET",
|
|
4234
4234
|
"/helpers/connections"
|
|
4235
4235
|
);
|
|
@@ -4240,7 +4240,7 @@ var MindStudioAgent = class {
|
|
|
4240
4240
|
// -------------------------------------------------------------------------
|
|
4241
4241
|
/** Estimate the cost of executing an action before running it. */
|
|
4242
4242
|
async estimateStepCost(stepType, step, options) {
|
|
4243
|
-
const { data } = await request(this.
|
|
4243
|
+
const { data } = await request(this._currentHttpConfig, "POST", "/helpers/step-cost-estimate", {
|
|
4244
4244
|
step: { type: resolveStepType2(stepType), ...step },
|
|
4245
4245
|
...options
|
|
4246
4246
|
});
|
|
@@ -4641,7 +4641,7 @@ var MindStudioAgent = class {
|
|
|
4641
4641
|
*/
|
|
4642
4642
|
async resolveUsers(userIds) {
|
|
4643
4643
|
const { data } = await request(
|
|
4644
|
-
this.
|
|
4644
|
+
this._currentHttpConfig,
|
|
4645
4645
|
"POST",
|
|
4646
4646
|
"/helpers/resolve-users",
|
|
4647
4647
|
{ userIds }
|
|
@@ -4669,7 +4669,7 @@ var MindStudioAgent = class {
|
|
|
4669
4669
|
async getAppContext(appId) {
|
|
4670
4670
|
const query = appId ? `?appId=${encodeURIComponent(appId)}` : "";
|
|
4671
4671
|
const { data } = await request(
|
|
4672
|
-
this.
|
|
4672
|
+
this._currentHttpConfig,
|
|
4673
4673
|
"GET",
|
|
4674
4674
|
`/helpers/app-context${query}`
|
|
4675
4675
|
);
|
|
@@ -4698,7 +4698,7 @@ var MindStudioAgent = class {
|
|
|
4698
4698
|
*/
|
|
4699
4699
|
async uploadFile(content, options) {
|
|
4700
4700
|
const { data } = await request(
|
|
4701
|
-
this.
|
|
4701
|
+
this._currentHttpConfig,
|
|
4702
4702
|
"POST",
|
|
4703
4703
|
"/account/upload",
|
|
4704
4704
|
{
|