@mindstudio-ai/agent 0.1.176 → 0.1.178

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/analytics/index.d.ts +384 -0
  3. package/dist/auth/index.d.ts +113 -0
  4. package/dist/browser/index.d.ts +332 -0
  5. package/dist/cli.js +29 -29
  6. package/dist/client.d.ts +767 -0
  7. package/dist/config.d.ts +13 -0
  8. package/dist/context.d.ts +125 -0
  9. package/dist/datasources/index.d.ts +52 -0
  10. package/dist/datasources/source.d.ts +1074 -0
  11. package/dist/db/aggregate.d.ts +101 -0
  12. package/dist/db/index.d.ts +280 -0
  13. package/dist/db/mutation.d.ts +65 -0
  14. package/dist/db/predicate.d.ts +85 -0
  15. package/dist/db/query.d.ts +233 -0
  16. package/dist/db/raw.d.ts +36 -0
  17. package/dist/db/readBatching.d.ts +36 -0
  18. package/dist/db/scanHints.d.ts +8 -0
  19. package/dist/db/sql.d.ts +136 -0
  20. package/dist/db/table.d.ts +146 -0
  21. package/dist/db/time.d.ts +17 -0
  22. package/dist/db/types.d.ts +237 -0
  23. package/dist/db-ws.d.ts +35 -0
  24. package/dist/email/index.d.ts +396 -0
  25. package/dist/errors.d.ts +34 -0
  26. package/dist/events/index.d.ts +127 -0
  27. package/dist/files/index.d.ts +62 -0
  28. package/dist/files/store.d.ts +244 -0
  29. package/dist/generated/metadata.d.ts +8 -0
  30. package/dist/generated/snippets.d.ts +8 -0
  31. package/dist/generated/steps.d.ts +2745 -0
  32. package/dist/generated/types.d.ts +4234 -0
  33. package/dist/http.d.ts +22 -0
  34. package/dist/index.d.ts +59 -13329
  35. package/dist/index.js +17 -17
  36. package/dist/index.js.map +7 -1
  37. package/dist/jewel/index.d.ts +325 -0
  38. package/dist/mapper/index.d.ts +229 -0
  39. package/dist/rate-limit.d.ts +25 -0
  40. package/dist/reader/index.d.ts +170 -0
  41. package/dist/respond.d.ts +68 -0
  42. package/dist/task/index.d.ts +18 -0
  43. package/dist/task/local.d.ts +48 -0
  44. package/dist/task/schema.d.ts +120 -0
  45. package/dist/task/types.d.ts +203 -0
  46. package/dist/types.d.ts +591 -0
  47. package/dist/voice/index.d.ts +87 -0
  48. package/llms.txt +2 -2
  49. package/package.json +6 -12
  50. package/dist/postinstall.js +0 -12115
@@ -0,0 +1,332 @@
1
+ /**
2
+ * The `browser` namespace — a real Chrome your app drives.
3
+ *
4
+ * `browser.open()` starts a session: one browser with one page, which stays
5
+ * open while you use it. It closes itself after `idleTimeoutSeconds` with no
6
+ * action (5 minutes by default), and at most an hour after it opens. Every
7
+ * action answers with the page as it is afterward: its URL, its title, and a
8
+ * snapshot, a compact outline of the page in which everything you can act on
9
+ * carries a ref (`[ref=e12]`) to name it by next.
10
+ *
11
+ * ```ts
12
+ * import { browser } from '@mindstudio-ai/agent';
13
+ * import { Shots } from './files/shots';
14
+ *
15
+ * export async function captureDashboard() {
16
+ * const session = await browser.open({ url: 'https://app.example.com/login' });
17
+ * await session.type({ label: 'Email' }, process.env.DEMO_EMAIL!);
18
+ * await session.type({ label: 'Password' }, process.env.DEMO_PASSWORD!, { submit: true });
19
+ * await session.waitFor('Dashboard');
20
+ * const shot = await session.screenshot();
21
+ * const file = await Shots.put(shot.data, { contentType: shot.contentType });
22
+ * await session.close();
23
+ * return { url: file.url };
24
+ * }
25
+ * ```
26
+ *
27
+ * To let a model drive instead, hand a task agent the session's tools:
28
+ * `mindstudio.runTask({ ..., tools: session.tools() })`.
29
+ *
30
+ * Elements are named by a ref from the latest snapshot, or by how a person
31
+ * would describe them: `{ text: 'Sign in' }`, `{ role: 'button', text: 'Save' }`,
32
+ * `{ label: 'Email' }`, or a CSS `{ selector }`. A ref is only good until the
33
+ * next snapshot; every action takes one, so use the refs from the latest.
34
+ *
35
+ * Clicks, taps and typing are the browser's own input events, as a person's
36
+ * would be. A password field's value never appears in a snapshot.
37
+ */
38
+ import type { Store, StoredFile } from '../files/store.js';
39
+ import type { TaskToolConfig } from '../task/types.js';
40
+ /** @internal Transport provided by the client (POST /_internal/v2/browser/<op>). */
41
+ export type BrowserTransport = (op: string, body: unknown) => Promise<any>;
42
+ /** @internal The client's `executeStep`, for the screenshot tool's description (`analyzeImage`). */
43
+ export type BrowserStepRunner = (stepType: string, step: Record<string, unknown>) => Promise<any>;
44
+ /**
45
+ * Which element an action is about: a ref from the latest snapshot (`'e12'`),
46
+ * or a description of it.
47
+ */
48
+ export type BrowserTarget = string | {
49
+ /** A ref from the latest snapshot. */
50
+ ref?: string;
51
+ /** The element's accessible name or visible text. */
52
+ text?: string;
53
+ /** With `text`, only elements of this role (`button`, `link`, `textbox`…). */
54
+ role?: string;
55
+ /** A form control, by its label. */
56
+ label?: string;
57
+ /** A CSS selector, for when nothing else names it. */
58
+ selector?: string;
59
+ };
60
+ export interface BrowserViewport {
61
+ width: number;
62
+ height: number;
63
+ deviceScaleFactor: number;
64
+ mobile: boolean;
65
+ }
66
+ export interface BrowserOpenOptions {
67
+ /** A page to open straight away, as `goto(url)` would. */
68
+ url?: string;
69
+ /**
70
+ * `'desktop'` (1280×800, the default), `'mobile'` (390×844 at 2×, with a
71
+ * phone's user agent, touch, and taps for clicks), or an exact size in
72
+ * pixels.
73
+ */
74
+ viewport?: 'desktop' | 'mobile' | {
75
+ width: number;
76
+ height: number;
77
+ };
78
+ /**
79
+ * How long the session waits for its next action before closing itself.
80
+ * 5 minutes by default; at least 30 seconds, at most 30 minutes.
81
+ */
82
+ idleTimeoutSeconds?: number;
83
+ }
84
+ /** The page after an action. */
85
+ export interface BrowserPage {
86
+ url: string;
87
+ title: string;
88
+ /**
89
+ * The page as a compact outline: one line per element worth knowing about
90
+ * (`button "Sign in" [ref=e4]`), indented by nesting, with a ref on
91
+ * everything that can be acted on.
92
+ */
93
+ snapshot: string;
94
+ /** Alerts and confirms the page opened since the last action. Each was accepted. */
95
+ dialogs?: {
96
+ type: string;
97
+ message: string;
98
+ }[];
99
+ }
100
+ /** Where an element is, in CSS pixels: of the viewport for an action, of the shot for a screenshot's `boxes`. */
101
+ export interface BrowserBox {
102
+ x: number;
103
+ y: number;
104
+ width: number;
105
+ height: number;
106
+ }
107
+ /** The page after an action on an element, and which element it was. */
108
+ export interface BrowserElementResult extends BrowserPage {
109
+ /** The element as the snapshot names it (`button "Sign in" [ref=e4]`). */
110
+ matched: string;
111
+ /**
112
+ * Where it was in the viewport when the action landed. A page can move after
113
+ * (a banner arriving pushes everything down), so to highlight an element on
114
+ * a screenshot, ask the screenshot where it is (`boxes`).
115
+ */
116
+ box: BrowserBox;
117
+ }
118
+ export interface BrowserScreenshot {
119
+ data: Buffer;
120
+ contentType: 'image/png';
121
+ /** In CSS pixels. The image is `deviceScaleFactor` times this. */
122
+ width: number;
123
+ height: number;
124
+ deviceScaleFactor: number;
125
+ /**
126
+ * With `boxes`, where each element named is in the shot, in its CSS pixels,
127
+ * in the order named: `null` for one the page didn't have. Absent on older
128
+ * platform versions.
129
+ */
130
+ boxes?: (BrowserBox | null)[];
131
+ }
132
+ /** A screenshot saved straight into a store: the stored file, and the page's size it was taken at. */
133
+ export type BrowserStoredScreenshot = StoredFile & {
134
+ /** In CSS pixels. The image is `deviceScaleFactor` times this. */
135
+ width: number;
136
+ height: number;
137
+ deviceScaleFactor: number;
138
+ /**
139
+ * With `boxes`, where each element named is in the shot, in its CSS pixels,
140
+ * in the order named: `null` for one the page didn't have. Absent on older
141
+ * platform versions.
142
+ */
143
+ boxes?: (BrowserBox | null)[];
144
+ };
145
+ export interface BrowserToolsOptions {
146
+ /**
147
+ * Values the model may type without ever seeing them, by name:
148
+ * `{ password: process.env.APP_PASSWORD! }` lets a `type` step name
149
+ * "password" for a field it chooses, in place of the text.
150
+ */
151
+ secrets?: Record<string, string>;
152
+ /**
153
+ * A store for the screenshots the model takes. With one, the model also
154
+ * gets `browser_screenshot`, which saves a screenshot here and answers with
155
+ * a written description of it (an `analyzeImage` call), so it can see what
156
+ * the page's outline doesn't say. Every shot is kept, and its key is in the
157
+ * answer.
158
+ */
159
+ screenshots?: Store;
160
+ }
161
+ interface SessionInfo {
162
+ id: string;
163
+ viewport: BrowserViewport;
164
+ expiresAt: number;
165
+ }
166
+ /** One open browser session. Get one from `browser.open()` or `browser.session(id)`. */
167
+ export declare class BrowserSession {
168
+ private readonly call;
169
+ private readonly steps;
170
+ /** Pass to `browser.session(id)` from a later call to pick this session up again. */
171
+ readonly id: string;
172
+ readonly viewport: BrowserViewport;
173
+ /** When the session closes, however busy it is. Milliseconds since epoch. */
174
+ readonly expiresAt: number;
175
+ /** @internal Use `browser.open()`. */
176
+ constructor(info: SessionInfo, call: BrowserTransport, steps: BrowserStepRunner);
177
+ /** Every action so far, chained: see `run`. */
178
+ private queue;
179
+ /**
180
+ * One action at a time, in the order they were called. A session has one
181
+ * page, so actions started together (a `Promise.all`, or a task agent's
182
+ * tools from one turn, which run concurrently) would otherwise reach it in
183
+ * whatever order their requests landed: a click on Submit before the field
184
+ * it submits was typed.
185
+ */
186
+ private run;
187
+ /**
188
+ * One action's request, asked again under the same id when the answer
189
+ * didn't get back (a dropped connection, an api pod rolling). The platform
190
+ * runs an id once, so asking again waits on the action already under way
191
+ * rather than clicking twice.
192
+ */
193
+ private send;
194
+ /** Open a URL and wait for it to load. */
195
+ goto(url: string): Promise<BrowserPage>;
196
+ /** The page as it is now. */
197
+ snapshot(): Promise<BrowserPage>;
198
+ /** Click an element (tap, on a mobile viewport), and wait for what it started to settle. */
199
+ click(target: BrowserTarget): Promise<BrowserElementResult>;
200
+ /**
201
+ * Click into a field and type. `clear` replaces what's there; `submit`
202
+ * presses Enter after.
203
+ */
204
+ type(target: BrowserTarget, text: string, options?: {
205
+ clear?: boolean;
206
+ submit?: boolean;
207
+ }): Promise<BrowserElementResult>;
208
+ /** Choose an option of a `<select>`, by its text, value or label. */
209
+ select(target: BrowserTarget, option: string): Promise<BrowserElementResult>;
210
+ /**
211
+ * Press a key on whatever has focus: `Enter`, `Tab`, `Escape`, `Backspace`,
212
+ * `Delete`, the arrows, `PageUp`, `PageDown`, `Home`, `End`, `' '`, or any
213
+ * single character.
214
+ */
215
+ press(key: string): Promise<BrowserPage>;
216
+ /** Scroll an element into view, or the page by `by` pixels (most of a screen, by default). */
217
+ scroll(options?: {
218
+ to?: BrowserTarget;
219
+ by?: number;
220
+ }): Promise<BrowserPage>;
221
+ /** Wait for text to appear on the page. Throws once `timeoutSeconds` (15 by default) pass without it. */
222
+ waitFor(text: string, options?: {
223
+ timeoutSeconds?: number;
224
+ }): Promise<BrowserPage>;
225
+ /**
226
+ * A PNG of the viewport, or of the whole page with `fullPage`. With a
227
+ * `store` it goes straight into that store, under `key` or a new one, and
228
+ * you get the stored file back; without, you get the bytes, which a full
229
+ * page past a few megabytes is too large for. The cursor is left out unless
230
+ * `cursor` keeps it in, for a shot that shows where the last action landed.
231
+ * `boxes` names elements, as an action does, and the shot says where each
232
+ * one is in it, measured as it's taken, for drawing highlights on it.
233
+ *
234
+ * ```ts
235
+ * const shot = await session.screenshot({ store: Shots, boxes: ['e12'] });
236
+ * await Steps.push({ screenshot: shot.key, highlight: shot.boxes?.[0] });
237
+ * await session.click('e12');
238
+ * ```
239
+ */
240
+ screenshot(options?: {
241
+ fullPage?: boolean;
242
+ cursor?: boolean;
243
+ boxes?: BrowserTarget[];
244
+ }): Promise<BrowserScreenshot>;
245
+ screenshot(options: {
246
+ fullPage?: boolean;
247
+ cursor?: boolean;
248
+ boxes?: BrowserTarget[];
249
+ store: Store;
250
+ key?: string;
251
+ }): Promise<BrowserStoredScreenshot>;
252
+ /**
253
+ * Run a function in the page and get back what it returns (as JSON). The
254
+ * function is sent as source, so it can't use variables from your code:
255
+ * pass what it needs as `arg`.
256
+ *
257
+ * ```ts
258
+ * const prices = await session.evaluate(
259
+ * (selector) => [...document.querySelectorAll(selector)].map((el) => el.textContent),
260
+ * '.price',
261
+ * );
262
+ * ```
263
+ */
264
+ evaluate<R, A = undefined>(fn: (arg: A) => R, arg?: A): Promise<Awaited<R>>;
265
+ /**
266
+ * A tool for `mindstudio.runTask()` that drives this session, so a model can
267
+ * browse. It takes a list of steps (open a URL, read the page, click, type,
268
+ * choose an option, press a key, scroll, wait for text), runs them in order,
269
+ * stops at the first that fails, and answers with each step's outcome and
270
+ * the page after the last one. A model plans "fill the form and submit it"
271
+ * as one call rather than one turn a field. Only the latest page stays in
272
+ * the task's transcript (`supersedes`), so a long walk doesn't fill it.
273
+ *
274
+ * With `screenshots`, a second tool, `browser_screenshot`, lets the model
275
+ * see the page: each shot goes into that store and the model reads a
276
+ * description of it. Those answers all stay in the transcript, since each
277
+ * names a kept file.
278
+ */
279
+ tools(options?: BrowserToolsOptions): TaskToolConfig[];
280
+ /**
281
+ * The screenshot tool: the shot into the store, then a vision model's
282
+ * description of it. A description that fails still answers with the kept
283
+ * shot's key, so the model can name it.
284
+ */
285
+ private describeScreen;
286
+ /** The tool's steps, in order, stopping at the first that fails. */
287
+ private runSteps;
288
+ private runStep;
289
+ /**
290
+ * A grant to watch this session live, for your frontend: return it from a
291
+ * method and hand its `token` to `browser.view()` in
292
+ * `@mindstudio-ai/interface`. Whoever holds it sees the page until it
293
+ * expires, so check your own access first, as for `events.grant()`.
294
+ * `ttlSeconds` is clamped to 60 through 3600 (900 by default); the frontend
295
+ * asks again through your method when it runs out.
296
+ *
297
+ * ```ts
298
+ * export async function watchRun({ runId }: { runId: string }) {
299
+ * auth.requireRole('admin');
300
+ * const run = await Runs.get(runId);
301
+ * const session = await browser.session(run.browserSessionId);
302
+ * return session.grantView();
303
+ * }
304
+ * ```
305
+ */
306
+ grantView(options?: {
307
+ ttlSeconds?: number;
308
+ }): Promise<{
309
+ token: string;
310
+ expiresAt: number;
311
+ ttlSeconds: number;
312
+ }>;
313
+ /** Close the session and its browser. */
314
+ close(): Promise<void>;
315
+ }
316
+ /** The `browser` namespace object. */
317
+ export interface Browser {
318
+ /**
319
+ * Start a browser session, and wait for its browser to be ready: seconds
320
+ * when one starts on a warm host, longer when it's the first in a while.
321
+ */
322
+ open(options?: BrowserOpenOptions): Promise<BrowserSession>;
323
+ /**
324
+ * Pick up a session an earlier call opened, by its `id`: a run that spans
325
+ * several calls, or a cron that resumes where the last one stopped. Throws
326
+ * `browser_session_not_found` once it has closed.
327
+ */
328
+ session(id: string): Promise<BrowserSession>;
329
+ }
330
+ /** @internal Factory used by the client; import the `browser` singleton instead. */
331
+ export declare function createBrowser(call: BrowserTransport, steps: BrowserStepRunner): Browser;
332
+ export {};
package/dist/cli.js CHANGED
@@ -15,7 +15,7 @@ var __export = (target, all) => {
15
15
  };
16
16
 
17
17
  // src/usageLog.ts
18
- import { appendFileSync } from "fs";
18
+ import { appendFileSync } from "node:fs";
19
19
  function logUsage(entry) {
20
20
  const file = process.env.MINDSTUDIO_USAGE_LOG;
21
21
  if (!file || typeof entry.billingCost !== "number") {
@@ -376,7 +376,7 @@ var init_metadata = __esm({
376
376
  "generate3dModel": {
377
377
  stepType: "generate3dModel",
378
378
  description: "Generate a 3D model using a 3D generation model.",
379
- usageNotes: "- The default model is wavespeed-tripo3d-h3.1 (Tripo v3.1), which makes a model from the prompt, from one `image`, or from `images`: 2\u20134 views of the same object, in order front, left, back, right.\n- Models and what they take, set in `threeDModelOverride.config`:\n - From text or an image: wavespeed-tripo3d-h3.1, wavespeed-meshy7.1 (also `images`, 1\u20134 views), wavespeed-hunyuan3d-v3 (an `image`, plus optional `back_image_url`, `left_image_url`, `right_image_url`), wavespeed-hunyuan-3d-v3.1-rapid, wavespeed-tripo3d-p2, wavespeed-rodin-v2.5 (`images`, 1\u20135).\n - From an image only: trellis-2, wavespeed-meshy7 (or `images`, 1\u20134 views), wavespeed-tripo3d-v2.5, seed3d-2.0, wavespeed-sam-3d-objects (with optional `mask_images`).\n - From views: wavespeed-hi3d-v3.0 (`front_image`, and optional `back_image`, `left_image`, `right_image`).\n- `$mode` in the config picks a model's mode (`text-to-3d`, `image-to-3d`, or its multi-view mode). Left out, `images` picks the multi-view mode and `image` picks image-to-3d; with neither, the model's default mode. A text mode needs the prompt; in the others the prompt is optional guidance.\n- The output is standardized as a GLB URL plus optional FBX/OBJ/USDZ, thumbnail, texture maps, and provider task ID.",
379
+ usageNotes: "- The default model is wavespeed-tripo3d-h3.1 (Tripo v3.1), which makes a model from the prompt, from one `image`, or from `images`: 2\u20134 views of the same object, in order front, left, back, right.\n- Models and what they take, set in `threeDModelOverride.config`:\n - From text or an image: wavespeed-tripo3d-h3.1, wavespeed-meshy7.1 (also `images`, 1\u20134 views), wavespeed-hunyuan3d-v3 (an `image`, plus optional `back_image_url`, `left_image_url`, `right_image_url`), wavespeed-hunyuan-3d-v3.1-rapid, wavespeed-tripo3d-p2, wavespeed-rodin-v2.5 (`images`, 1\u20135).\n - From an image only: trellis-2, wavespeed-meshy7 (or `images`, 1\u20134 views), seed3d-2.0.\n - From views: wavespeed-hi3d-v3.0 (`front_image`, and optional `back_image`, `left_image`, `right_image`).\n- `$mode` in the config picks a model's mode (`text-to-3d`, `image-to-3d`, or its multi-view mode). Left out, `images` picks the multi-view mode and `image` picks image-to-3d; with neither, the model's default mode. A text mode needs the prompt; in the others the prompt is optional guidance.\n- The output is standardized as a GLB URL plus optional FBX/OBJ/USDZ, thumbnail, texture maps, and provider task ID.",
380
380
  inputSchema: { "type": "object", "properties": { "prompt": { "type": "string", "description": "Text prompt for text-to-3D models, or optional guidance for image-to-3D models" }, "intermediateAsset": { "type": "boolean", "description": "When true, the asset is created but hidden from the user's gallery (tagged as intermediate)" }, "threeDModelOverride": { "type": "object", "properties": { "model": { "type": "string", "description": "3D generation model identifier" }, "config": { "type": "object", "properties": {}, "required": [], "description": "Additional model-specific configuration" } }, "required": ["model"], "description": "Optional model configuration override. Uses the workflow's default 3D model if not specified" } } },
381
381
  outputSchema: { "type": "object", "properties": { "prompt": { "type": "string" }, "glbUrl": { "type": "string" }, "fbxUrl": { "type": "string" }, "objUrl": { "type": "string" }, "usdzUrl": { "type": "string" }, "thumbnailUrl": { "type": "string" }, "textureUrls": { "type": "array", "items": { "type": "object", "properties": {}, "required": [] } }, "providerTaskId": { "type": "string" }, "resolvedConfig": { "type": "object", "properties": {}, "required": [] } }, "required": ["glbUrl"] }
382
382
  },
@@ -418,7 +418,7 @@ var init_metadata = __esm({
418
418
  "generateSound": {
419
419
  stepType: "generateSound",
420
420
  description: "Generate a sound effect from a text description using a sound model.",
421
- usageNotes: "- `text` describes the sound effect to generate.\n- The default model is elevenlabs-sound_v2. Options go in `soundModelOverride.config`:\n - `durationSeconds` \u2014 the length, from 0.5 to 30. Left out, the model picks one from the text, and the effect is billed as 5 seconds whatever its length.\n - `loop: true` \u2014 a sound that repeats with no audible start or end, for ambience and backgrounds.\n - `promptInfluence` \u2014 how literally the text is followed, from 0 to 1 (default 0.3).\n - `outputFormat` \u2014 MP3 (`mp3_44100_128` by default, up to `mp3_44100_192`) or Opus (`opus_48000_32` to `opus_48000_192`).\n- In foreground mode, the audio is displayed to the user. In background mode, the URL is saved to a variable.",
421
+ usageNotes: "- `text` describes the sound effect to generate.\n- The default model is elevenlabs-sound_v3. Options go in `soundModelOverride.config`:\n - `durationSeconds` \u2014 the length, from 0.5 to 30. Left out, the model picks one from the text, and the effect is billed as 5 seconds whatever its length.\n - `loop: true` \u2014 a sound that repeats with no audible start or end, for ambience and backgrounds.\n - `promptInfluence` \u2014 how literally the text is followed, from 0 to 1 (default 0.3).\n - `outputFormat` \u2014 MP3 (`mp3_44100_128` by default, up to `mp3_44100_192`) or Opus (`opus_48000_32` to `opus_48000_192`).\n- In foreground mode, the audio is displayed to the user. In background mode, the URL is saved to a variable.",
422
422
  inputSchema: { "type": "object", "properties": { "text": { "type": "string", "description": "The description of the sound effect to generate" }, "intermediateAsset": { "type": "boolean", "description": "When true, the asset is created but hidden from the user's gallery (tagged as intermediate)" }, "soundModelOverride": { "type": "object", "properties": { "model": { "type": "string" }, "config": { "type": "object", "properties": {}, "required": [] } }, "required": ["model"], "description": "Optional model configuration override. Uses the workflow's default sound model if not specified" } }, "required": ["text"] },
423
423
  outputSchema: { "type": "object", "properties": { "audioUrl": { "type": "string", "description": "URL of the generated audio file" } }, "required": ["audioUrl"] }
424
424
  },
@@ -1360,7 +1360,7 @@ var init_context = __esm({
1360
1360
  als = noopAls;
1361
1361
  try {
1362
1362
  if (typeof process !== "undefined" && process.versions?.node) {
1363
- const mod = await import("async_hooks");
1363
+ const mod = await import("node:async_hooks");
1364
1364
  als = new mod.AsyncLocalStorage();
1365
1365
  }
1366
1366
  } catch {
@@ -1746,9 +1746,9 @@ __export(config_exports, {
1746
1746
  loadConfig: () => loadConfig,
1747
1747
  saveConfig: () => saveConfig
1748
1748
  });
1749
- import { readFileSync, writeFileSync, mkdirSync } from "fs";
1750
- import { join } from "path";
1751
- import { homedir } from "os";
1749
+ import { readFileSync, writeFileSync, mkdirSync } from "node:fs";
1750
+ import { join } from "node:path";
1751
+ import { homedir } from "node:os";
1752
1752
  function configPaths() {
1753
1753
  const dir = join(homedir(), ".mindstudio");
1754
1754
  return { dir, file: join(dir, "config.json") };
@@ -4492,12 +4492,12 @@ var init_readBatching = __esm({
4492
4492
  });
4493
4493
 
4494
4494
  // src/files/store.ts
4495
- import { createHash, randomUUID } from "crypto";
4496
- import { createReadStream, createWriteStream } from "fs";
4497
- import { readFile, stat, writeFile } from "fs/promises";
4498
- import { basename } from "path";
4499
- import { Readable } from "stream";
4500
- import { pipeline } from "stream/promises";
4495
+ import { createHash, randomUUID } from "node:crypto";
4496
+ import { createReadStream, createWriteStream } from "node:fs";
4497
+ import { readFile, stat, writeFile } from "node:fs/promises";
4498
+ import { basename } from "node:path";
4499
+ import { Readable } from "node:stream";
4500
+ import { pipeline } from "node:stream/promises";
4501
4501
  function fileUrl(access, store, key) {
4502
4502
  const path = key.split("/").map(encodeURIComponent).join("/");
4503
4503
  return `/_/files/${access}/${store}/${path}`;
@@ -5058,7 +5058,7 @@ var init_files = __esm({
5058
5058
  });
5059
5059
 
5060
5060
  // src/datasources/source.ts
5061
- import { createHash as createHash2 } from "crypto";
5061
+ import { createHash as createHash2 } from "node:crypto";
5062
5062
  var DICTIONARY_PAGE_ENTRIES, DICTIONARY_PAGE_BYTES, REMOVE_WHERE_MAX_PAGES, DataSource;
5063
5063
  var init_source = __esm({
5064
5064
  "src/datasources/source.ts"() {
@@ -5770,7 +5770,7 @@ var init_events = __esm({
5770
5770
  });
5771
5771
 
5772
5772
  // src/browser/index.ts
5773
- import { randomUUID as randomUUID2 } from "crypto";
5773
+ import { randomUUID as randomUUID2 } from "node:crypto";
5774
5774
  function createBrowser(call, steps) {
5775
5775
  return {
5776
5776
  async open(options = {}) {
@@ -6495,7 +6495,7 @@ var init_schema = __esm({
6495
6495
  });
6496
6496
 
6497
6497
  // src/task/local.ts
6498
- import { randomUUID as randomUUID3 } from "crypto";
6498
+ import { randomUUID as randomUUID3 } from "node:crypto";
6499
6499
  function isPlainObject(value) {
6500
6500
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
6501
6501
  return false;
@@ -10031,9 +10031,9 @@ var mcp_exports = {};
10031
10031
  __export(mcp_exports, {
10032
10032
  startMcpServer: () => startMcpServer
10033
10033
  });
10034
- import { createInterface } from "readline";
10035
- import { readFileSync as readFileSync2 } from "fs";
10036
- import { basename as basename2, extname } from "path";
10034
+ import { createInterface } from "node:readline";
10035
+ import { readFileSync as readFileSync2 } from "node:fs";
10036
+ import { basename as basename2, extname } from "node:path";
10037
10037
  function send(message) {
10038
10038
  process.stdout.write(JSON.stringify(message) + "\n");
10039
10039
  }
@@ -10086,7 +10086,7 @@ async function startMcpServer(options) {
10086
10086
  capabilities: { tools: {} },
10087
10087
  serverInfo: {
10088
10088
  name: "mindstudio-agent",
10089
- version: "0.1.176"
10089
+ version: "0.1.178"
10090
10090
  },
10091
10091
  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.'
10092
10092
  });
@@ -10538,10 +10538,10 @@ var init_mcp = __esm({
10538
10538
 
10539
10539
  // src/cli.ts
10540
10540
  init_usageLog();
10541
- import { parseArgs } from "util";
10542
- import { execSync } from "child_process";
10543
- import { readFileSync as readFileSync3 } from "fs";
10544
- import { basename as basename3, extname as extname2 } from "path";
10541
+ import { parseArgs } from "node:util";
10542
+ import { execSync } from "node:child_process";
10543
+ import { readFileSync as readFileSync3 } from "node:fs";
10544
+ import { basename as basename3, extname as extname2 } from "node:path";
10545
10545
  var HELP = `Usage: mindstudio <command> [options]
10546
10546
 
10547
10547
  Ask:
@@ -11126,7 +11126,7 @@ function isNewerVersion(current, latest) {
11126
11126
  return false;
11127
11127
  }
11128
11128
  async function checkForUpdate() {
11129
- const currentVersion = "0.1.176";
11129
+ const currentVersion = "0.1.178";
11130
11130
  if (!currentVersion || process.env.MINDSTUDIO_NO_UPDATE_CHECK) {
11131
11131
  return null;
11132
11132
  }
@@ -11161,7 +11161,7 @@ async function checkForUpdate() {
11161
11161
  }
11162
11162
  }
11163
11163
  function printUpdateNotice(latestVersion) {
11164
- const currentVersion = "0.1.176";
11164
+ const currentVersion = "0.1.178";
11165
11165
  process.stderr.write(
11166
11166
  `
11167
11167
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -11174,7 +11174,7 @@ function isStandaloneBinary() {
11174
11174
  return !argv1.includes("node_modules");
11175
11175
  }
11176
11176
  async function cmdUpdate() {
11177
- const currentVersion = "0.1.176";
11177
+ const currentVersion = "0.1.178";
11178
11178
  process.stderr.write(
11179
11179
  ` ${ansi2.gray("Current version:")} ${currentVersion}
11180
11180
  `
@@ -11315,7 +11315,7 @@ async function cmdLogin(options) {
11315
11315
  process.stderr.write("\n");
11316
11316
  printLogo();
11317
11317
  process.stderr.write("\n");
11318
- const ver = "0.1.176";
11318
+ const ver = "0.1.178";
11319
11319
  process.stderr.write(
11320
11320
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
11321
11321
  `
@@ -11643,7 +11643,7 @@ async function main() {
11643
11643
  const updatePromise = command !== "mcp" && command !== "login" && command !== "update" ? checkForUpdate() : Promise.resolve(null);
11644
11644
  try {
11645
11645
  if (command === "version" || command === "-v") {
11646
- process.stdout.write("0.1.176\n");
11646
+ process.stdout.write("0.1.178\n");
11647
11647
  return;
11648
11648
  }
11649
11649
  if (command === "login") {