@mindstudio-ai/agent 0.1.164 → 0.1.166
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/CHANGELOG.md +12 -0
- package/dist/cli.js +56 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +56 -7
- package/llms.txt +1 -1
- package/package.json +3 -3
package/dist/postinstall.js
CHANGED
|
@@ -9,6 +9,31 @@ var __export = (target, all) => {
|
|
|
9
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
// src/usageLog.ts
|
|
13
|
+
import { appendFileSync } from "fs";
|
|
14
|
+
function logUsage(entry) {
|
|
15
|
+
const file = process.env.MINDSTUDIO_USAGE_LOG;
|
|
16
|
+
if (!file || typeof entry.billingCost !== "number") {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const line = {
|
|
20
|
+
ts: Date.now(),
|
|
21
|
+
action: entry.action,
|
|
22
|
+
billingCost: entry.billingCost,
|
|
23
|
+
...entry.billingEvents?.length && { billingEvents: entry.billingEvents },
|
|
24
|
+
durationMs: Date.now() - entry.startedAt
|
|
25
|
+
};
|
|
26
|
+
try {
|
|
27
|
+
appendFileSync(file, JSON.stringify(line) + "\n");
|
|
28
|
+
} catch {
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
var init_usageLog = __esm({
|
|
32
|
+
"src/usageLog.ts"() {
|
|
33
|
+
"use strict";
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
12
37
|
// src/generated/metadata.ts
|
|
13
38
|
var metadata_exports = {};
|
|
14
39
|
__export(metadata_exports, {
|
|
@@ -795,7 +820,7 @@ var init_metadata = __esm({
|
|
|
795
820
|
"renderVideoFromHtmlComposition": {
|
|
796
821
|
stepType: "renderVideoFromHtmlComposition",
|
|
797
822
|
description: "Render an HTML composition (HTML, CSS, media and seekable animation on a timeline) to a video file",
|
|
798
|
-
usageNotes: "- Renders an HTML composition in HyperFrames' format (https://hyperframes.heygen.com) with HyperFrames 0.8.
|
|
823
|
+
usageNotes: "- Renders an HTML composition in HyperFrames' format (https://hyperframes.heygen.com) with HyperFrames 0.8.148, in Chrome off the app's own sandbox; author for that version\n- Pass the composition as `html`, the page itself (up to 10 MB), or as `project`, the URL of a zip of a project's folder (`index.html` at its root, or the file `entryFile` names) or of one HTML file, up to 2 GiB: an app file or any public URL\n- `variables` overrides the composition's `data-composition-variables` defaults, which it reads with `window.__hyperframes.getVariables()`\n- Whatever the composition loads itself (fonts, scripts, images, video) is fetched as it renders, so each is in the project or at a public URL; a private app file needs a signed URL\n- fps 24, 30 or 60 (default 30); quality draft, standard or high (default standard); format mp4 (default), webm or mov (both keep transparency), or gif\n- An mp4, webm or mov renders in chunks of about 10 seconds side by side, so a long video takes little longer than a short one; a call finishes within about 30 minutes, and reports its progress as it goes. A gif renders whole, within 15 minutes\n- A composition HyperFrames can't render fails with HyperFrames' own reason",
|
|
799
824
|
inputSchema: { "type": "object", "properties": { "html": { "type": "string", "description": "The composition's HTML, up to 10 MB; give this or project" }, "project": { "type": "string", "description": "URL of a zip of the project's folder, or of one self-contained HTML file; give this or html" }, "entryFile": { "type": "string", "description": "The entry HTML inside the zip, relative to its root; index.html when omitted" }, "variables": { "type": "object", "properties": {}, "required": [], "description": "Values over the composition's declared variables" }, "fps": { "enum": [24, 30, 60], "type": "number", "description": "Frames per second: 24, 30 (default) or 60" }, "quality": { "enum": ["draft", "standard", "high"], "type": "string", "description": "Encode quality: draft, standard (default) or high" }, "format": { "enum": ["mp4", "webm", "mov", "gif"], "type": "string", "description": "mp4 (default), webm or mov (both keep transparency), or gif" }, "intermediateAsset": { "type": "boolean", "description": "When true, the asset is created but hidden from the user's gallery (tagged as intermediate)" } } },
|
|
800
825
|
outputSchema: { "type": "object", "properties": { "videoUrl": { "type": "string", "description": "URL of the rendered video" }, "durationSec": { "type": "number", "description": "Its length in seconds" }, "frames": { "type": "number", "description": "How many frames it has" } }, "required": ["videoUrl", "durationSec", "frames"] }
|
|
801
826
|
},
|
|
@@ -9307,6 +9332,7 @@ function summarizeInput(input) {
|
|
|
9307
9332
|
async function cmdAsk(question, options) {
|
|
9308
9333
|
try {
|
|
9309
9334
|
let lineBuffer = "";
|
|
9335
|
+
const startedAt = Date.now();
|
|
9310
9336
|
const result = await runAsk(question, options, (event) => {
|
|
9311
9337
|
switch (event.type) {
|
|
9312
9338
|
case "text":
|
|
@@ -9336,6 +9362,12 @@ async function cmdAsk(question, options) {
|
|
|
9336
9362
|
if (lineBuffer) {
|
|
9337
9363
|
process.stderr.write(lineBuffer);
|
|
9338
9364
|
}
|
|
9365
|
+
logUsage({
|
|
9366
|
+
action: "ask",
|
|
9367
|
+
billingCost: result.billingCost,
|
|
9368
|
+
billingEvents: result.billingEvents,
|
|
9369
|
+
startedAt
|
|
9370
|
+
});
|
|
9339
9371
|
if (options.json) {
|
|
9340
9372
|
process.stdout.write(
|
|
9341
9373
|
JSON.stringify({
|
|
@@ -9360,6 +9392,7 @@ var init_ask = __esm({
|
|
|
9360
9392
|
async "src/ask/index.ts"() {
|
|
9361
9393
|
"use strict";
|
|
9362
9394
|
await init_client();
|
|
9395
|
+
init_usageLog();
|
|
9363
9396
|
init_context2();
|
|
9364
9397
|
init_sse();
|
|
9365
9398
|
init_tools();
|
|
@@ -9434,7 +9467,7 @@ async function startMcpServer(options) {
|
|
|
9434
9467
|
capabilities: { tools: {} },
|
|
9435
9468
|
serverInfo: {
|
|
9436
9469
|
name: "mindstudio-agent",
|
|
9437
|
-
version: "0.1.
|
|
9470
|
+
version: "0.1.166"
|
|
9438
9471
|
},
|
|
9439
9472
|
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, pass its public image URL to `changeProfilePicture`.\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.'
|
|
9440
9473
|
});
|
|
@@ -10134,11 +10167,18 @@ async function cmdExec(method, input, options) {
|
|
|
10134
10167
|
`);
|
|
10135
10168
|
};
|
|
10136
10169
|
}
|
|
10170
|
+
const startedAt = Date.now();
|
|
10137
10171
|
const result = await agent.executeStep(meta.stepType, input, {
|
|
10138
10172
|
appId: options.appId,
|
|
10139
10173
|
threadId: options.threadId,
|
|
10140
10174
|
onLog
|
|
10141
10175
|
});
|
|
10176
|
+
logUsage({
|
|
10177
|
+
action: camelToKebab(method),
|
|
10178
|
+
billingCost: result.$billingCost,
|
|
10179
|
+
billingEvents: result.$billingEvents,
|
|
10180
|
+
startedAt
|
|
10181
|
+
});
|
|
10142
10182
|
if (options.outputKey) {
|
|
10143
10183
|
const val = result[options.outputKey];
|
|
10144
10184
|
if (typeof val === "string") {
|
|
@@ -10314,10 +10354,18 @@ Example: mindstudio batch '[{"stepType":"generateImage","step":{"prompt":"a cat"
|
|
|
10314
10354
|
return { stepType: item.stepType, step: item.step };
|
|
10315
10355
|
});
|
|
10316
10356
|
const agent = await createAgent(options);
|
|
10357
|
+
const startedAt = Date.now();
|
|
10317
10358
|
const result = await agent.executeStepBatch(steps, {
|
|
10318
10359
|
appId: options.appId,
|
|
10319
10360
|
threadId: options.threadId
|
|
10320
10361
|
});
|
|
10362
|
+
for (const step of result.results) {
|
|
10363
|
+
logUsage({
|
|
10364
|
+
action: `batch:${step.stepType}`,
|
|
10365
|
+
billingCost: step.billingCost,
|
|
10366
|
+
startedAt
|
|
10367
|
+
});
|
|
10368
|
+
}
|
|
10321
10369
|
if (options.noMeta) {
|
|
10322
10370
|
process.stdout.write(JSON.stringify(result.results, null, 2) + "\n");
|
|
10323
10371
|
} else {
|
|
@@ -10361,7 +10409,7 @@ function isNewerVersion(current, latest) {
|
|
|
10361
10409
|
return false;
|
|
10362
10410
|
}
|
|
10363
10411
|
async function checkForUpdate() {
|
|
10364
|
-
const currentVersion = "0.1.
|
|
10412
|
+
const currentVersion = "0.1.166";
|
|
10365
10413
|
if (!currentVersion || process.env.MINDSTUDIO_NO_UPDATE_CHECK) {
|
|
10366
10414
|
return null;
|
|
10367
10415
|
}
|
|
@@ -10396,7 +10444,7 @@ async function checkForUpdate() {
|
|
|
10396
10444
|
}
|
|
10397
10445
|
}
|
|
10398
10446
|
function printUpdateNotice(latestVersion) {
|
|
10399
|
-
const currentVersion = "0.1.
|
|
10447
|
+
const currentVersion = "0.1.166";
|
|
10400
10448
|
process.stderr.write(
|
|
10401
10449
|
`
|
|
10402
10450
|
${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
|
|
@@ -10409,7 +10457,7 @@ function isStandaloneBinary() {
|
|
|
10409
10457
|
return !argv1.includes("node_modules");
|
|
10410
10458
|
}
|
|
10411
10459
|
async function cmdUpdate() {
|
|
10412
|
-
const currentVersion = "0.1.
|
|
10460
|
+
const currentVersion = "0.1.166";
|
|
10413
10461
|
process.stderr.write(
|
|
10414
10462
|
` ${ansi2.gray("Current version:")} ${currentVersion}
|
|
10415
10463
|
`
|
|
@@ -10530,7 +10578,7 @@ async function cmdLogin(options) {
|
|
|
10530
10578
|
process.stderr.write("\n");
|
|
10531
10579
|
printLogo();
|
|
10532
10580
|
process.stderr.write("\n");
|
|
10533
|
-
const ver = "0.1.
|
|
10581
|
+
const ver = "0.1.166";
|
|
10534
10582
|
process.stderr.write(
|
|
10535
10583
|
` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
|
|
10536
10584
|
`
|
|
@@ -10842,7 +10890,7 @@ async function main() {
|
|
|
10842
10890
|
const updatePromise = command !== "mcp" && command !== "login" && command !== "update" ? checkForUpdate() : Promise.resolve(null);
|
|
10843
10891
|
try {
|
|
10844
10892
|
if (command === "version" || command === "-v") {
|
|
10845
|
-
process.stdout.write("0.1.
|
|
10893
|
+
process.stdout.write("0.1.166\n");
|
|
10846
10894
|
return;
|
|
10847
10895
|
}
|
|
10848
10896
|
if (command === "login") {
|
|
@@ -11302,6 +11350,7 @@ var HELP, MIME_TYPES2, ansi2, UPDATE_CHECK_INTERVAL, LOGO, DEFAULT_BASE_URL2, SP
|
|
|
11302
11350
|
var init_cli = __esm({
|
|
11303
11351
|
"src/cli.ts"() {
|
|
11304
11352
|
"use strict";
|
|
11353
|
+
init_usageLog();
|
|
11305
11354
|
HELP = `Usage: mindstudio <command> [options]
|
|
11306
11355
|
|
|
11307
11356
|
Ask:
|
package/llms.txt
CHANGED
|
@@ -718,7 +718,7 @@ Remove the background from an image using AI, producing a transparent PNG.
|
|
|
718
718
|
|
|
719
719
|
#### renderVideoFromHtmlComposition
|
|
720
720
|
Render an HTML composition (HTML, CSS, media and seekable animation on a timeline) to a video file
|
|
721
|
-
- Renders an HTML composition in HyperFrames' format (https://hyperframes.heygen.com) with HyperFrames 0.8.
|
|
721
|
+
- Renders an HTML composition in HyperFrames' format (https://hyperframes.heygen.com) with HyperFrames 0.8.148, in Chrome off the app's own sandbox; author for that version
|
|
722
722
|
- Pass the composition as `html`, the page itself (up to 10 MB), or as `project`, the URL of a zip of a project's folder (`index.html` at its root, or the file `entryFile` names) or of one HTML file, up to 2 GiB: an app file or any public URL
|
|
723
723
|
- `variables` overrides the composition's `data-composition-variables` defaults, which it reads with `window.__hyperframes.getVariables()`
|
|
724
724
|
- Whatever the composition loads itself (fonts, scripts, images, video) is fetched as it renders, so each is in the project or at a public URL; a private app file needs a signed URL
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindstudio-ai/agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.166",
|
|
4
4
|
"description": "TypeScript SDK for MindStudio direct step execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
"sideEffects": false,
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@fast-check/vitest": "^0.5.0",
|
|
68
|
-
"@types/node": "^26.6.
|
|
68
|
+
"@types/node": "^26.6.5",
|
|
69
69
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
70
70
|
"esbuild": "^0.28.2",
|
|
71
71
|
"fast-check": "^4.10.2",
|
|
72
72
|
"tsup": "^8",
|
|
73
73
|
"tsx": "^4.23.15",
|
|
74
74
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
75
|
-
"vitest": "^
|
|
75
|
+
"vitest": "^5.0.3"
|
|
76
76
|
}
|
|
77
77
|
}
|