@mindstudio-ai/agent 0.1.7 → 0.1.10
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 +43 -2
- package/dist/cli.js +1518 -28
- package/dist/index.d.ts +944 -78
- package/dist/index.js +1506 -24
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +1518 -28
- package/llms.txt +53 -23
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
type AuthType = 'internal' | 'apiKey';
|
|
2
|
-
declare class RateLimiter {
|
|
3
|
-
readonly authType: AuthType;
|
|
4
|
-
private inflight;
|
|
5
|
-
private concurrencyLimit;
|
|
6
|
-
private callCount;
|
|
7
|
-
private callCap;
|
|
8
|
-
private queue;
|
|
9
|
-
constructor(authType: AuthType);
|
|
10
|
-
/** Acquire a slot. Resolves when a concurrent slot is available. */
|
|
11
|
-
acquire(): Promise<void>;
|
|
12
|
-
/** Release a slot and let the next queued request proceed. */
|
|
13
|
-
release(): void;
|
|
14
|
-
/** Update limits from response headers. */
|
|
15
|
-
updateFromHeaders(headers: Headers): void;
|
|
16
|
-
/** Read current rate limit state from response headers. */
|
|
17
|
-
static parseHeaders(headers: Headers): {
|
|
18
|
-
remaining: number | undefined;
|
|
19
|
-
concurrencyRemaining: number | undefined;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface HttpClientConfig {
|
|
24
|
-
baseUrl: string;
|
|
25
|
-
token: string;
|
|
26
|
-
rateLimiter: RateLimiter;
|
|
27
|
-
maxRetries: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
1
|
/** Configuration options for creating a {@link MindStudioAgent}. */
|
|
31
2
|
interface AgentOptions {
|
|
32
3
|
/**
|
|
@@ -53,6 +24,18 @@ interface AgentOptions {
|
|
|
53
24
|
* @default 3
|
|
54
25
|
*/
|
|
55
26
|
maxRetries?: number;
|
|
27
|
+
/**
|
|
28
|
+
* App ID for auth and database context. Required when using `auth` or
|
|
29
|
+
* `db` namespaces outside the MindStudio sandbox.
|
|
30
|
+
*
|
|
31
|
+
* If omitted, the SDK checks:
|
|
32
|
+
* 1. `MINDSTUDIO_APP_ID` environment variable
|
|
33
|
+
* 2. Sandbox globals (when running inside MindStudio)
|
|
34
|
+
* 3. Auto-detected from the first `executeStep` response header
|
|
35
|
+
*
|
|
36
|
+
* Not needed for plain step execution — only for `db` and `auth`.
|
|
37
|
+
*/
|
|
38
|
+
appId?: string;
|
|
56
39
|
/**
|
|
57
40
|
* When true, the thread ID from the first API response is automatically
|
|
58
41
|
* reused for all subsequent calls (unless an explicit `threadId` is passed).
|
|
@@ -152,6 +135,44 @@ interface UserInfoResult {
|
|
|
152
135
|
isAgent: boolean;
|
|
153
136
|
}[];
|
|
154
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* A reference to a MindStudio platform user. Stored as a UUID string.
|
|
140
|
+
*
|
|
141
|
+
* In the database, user values are stored with a `@@user@@` prefix
|
|
142
|
+
* (e.g. `@@user@@550e8400-...`). The SDK handles this automatically —
|
|
143
|
+
* values are clean UUIDs in application code, prefixed/stripped
|
|
144
|
+
* transparently during read/write operations.
|
|
145
|
+
*
|
|
146
|
+
* Use `resolveUser(userId)` when you need display info (name, email, etc.).
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* interface Order {
|
|
151
|
+
* id: string;
|
|
152
|
+
* createdAt: number;
|
|
153
|
+
* updatedAt: number;
|
|
154
|
+
* lastUpdatedBy: string;
|
|
155
|
+
* requestedBy: User;
|
|
156
|
+
* }
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
type User = string & {
|
|
160
|
+
readonly __brand: 'User';
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Resolved display info for a platform user. Returned by `resolveUser()`
|
|
164
|
+
* and `resolveUsers()`.
|
|
165
|
+
*/
|
|
166
|
+
interface ResolvedUser {
|
|
167
|
+
/** User ID. */
|
|
168
|
+
id: string;
|
|
169
|
+
/** Display name. */
|
|
170
|
+
name: string;
|
|
171
|
+
/** Email address, if available. */
|
|
172
|
+
email?: string | null;
|
|
173
|
+
/** Profile picture URL, if set. */
|
|
174
|
+
profilePictureUrl?: string | null;
|
|
175
|
+
}
|
|
155
176
|
/** An AI model available on MindStudio. */
|
|
156
177
|
interface MindStudioModel {
|
|
157
178
|
id?: string;
|
|
@@ -176,6 +197,40 @@ interface MindStudioModelSummary {
|
|
|
176
197
|
}
|
|
177
198
|
/** Supported model type categories for filtering. */
|
|
178
199
|
type ModelType = 'llm_chat' | 'image_generation' | 'video_generation' | 'video_analysis' | 'text_to_speech' | 'vision' | 'transcription';
|
|
200
|
+
/** Role assignment for a user within an app. */
|
|
201
|
+
interface AppRoleAssignment {
|
|
202
|
+
userId: string;
|
|
203
|
+
roleName: string;
|
|
204
|
+
}
|
|
205
|
+
/** Auth context for an app. */
|
|
206
|
+
interface AppAuthContext {
|
|
207
|
+
/** The authenticated user ID. */
|
|
208
|
+
userId: string;
|
|
209
|
+
/** All role assignments for this app (all users, all roles). */
|
|
210
|
+
roleAssignments: AppRoleAssignment[];
|
|
211
|
+
}
|
|
212
|
+
/** Column schema for a managed database table. */
|
|
213
|
+
interface AppDatabaseColumnSchema {
|
|
214
|
+
name: string;
|
|
215
|
+
type: 'text' | 'number' | 'boolean' | 'json' | 'user';
|
|
216
|
+
required: boolean;
|
|
217
|
+
}
|
|
218
|
+
/** Table schema within a managed database. */
|
|
219
|
+
interface AppDatabaseTable {
|
|
220
|
+
name: string;
|
|
221
|
+
schema: AppDatabaseColumnSchema[];
|
|
222
|
+
}
|
|
223
|
+
/** A managed SQLite database for an app. */
|
|
224
|
+
interface AppDatabase {
|
|
225
|
+
id: string;
|
|
226
|
+
name: string;
|
|
227
|
+
tables: AppDatabaseTable[];
|
|
228
|
+
}
|
|
229
|
+
/** Result of {@link MindStudioAgent.getAppContext}. */
|
|
230
|
+
interface AppContextResult {
|
|
231
|
+
auth: AppAuthContext;
|
|
232
|
+
databases: AppDatabase[];
|
|
233
|
+
}
|
|
179
234
|
/** An OAuth connector service with its available actions. Third-party integration from the MindStudio Connector Registry. */
|
|
180
235
|
interface ConnectorService {
|
|
181
236
|
id?: string;
|
|
@@ -317,6 +372,484 @@ interface RunAgentResult {
|
|
|
317
372
|
billingCost?: number;
|
|
318
373
|
}
|
|
319
374
|
|
|
375
|
+
type AuthType = 'internal' | 'apiKey';
|
|
376
|
+
declare class RateLimiter {
|
|
377
|
+
readonly authType: AuthType;
|
|
378
|
+
private inflight;
|
|
379
|
+
private concurrencyLimit;
|
|
380
|
+
private callCount;
|
|
381
|
+
private callCap;
|
|
382
|
+
private queue;
|
|
383
|
+
constructor(authType: AuthType);
|
|
384
|
+
/** Acquire a slot. Resolves when a concurrent slot is available. */
|
|
385
|
+
acquire(): Promise<void>;
|
|
386
|
+
/** Release a slot and let the next queued request proceed. */
|
|
387
|
+
release(): void;
|
|
388
|
+
/** Update limits from response headers. */
|
|
389
|
+
updateFromHeaders(headers: Headers): void;
|
|
390
|
+
/** Read current rate limit state from response headers. */
|
|
391
|
+
static parseHeaders(headers: Headers): {
|
|
392
|
+
remaining: number | undefined;
|
|
393
|
+
concurrencyRemaining: number | undefined;
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
interface HttpClientConfig {
|
|
398
|
+
baseUrl: string;
|
|
399
|
+
token: string;
|
|
400
|
+
rateLimiter: RateLimiter;
|
|
401
|
+
maxRetries: number;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Auth namespace — role-based access control for MindStudio apps.
|
|
406
|
+
*
|
|
407
|
+
* Provides synchronous access to the current user's identity and roles
|
|
408
|
+
* within an app. Hydrated once from app context (either sandbox globals
|
|
409
|
+
* or the `GET /helpers/app-context` endpoint), then all access is sync.
|
|
410
|
+
*
|
|
411
|
+
* ## How it works
|
|
412
|
+
*
|
|
413
|
+
* 1. The platform stores role assignments per app: `{ userId, roleName }[]`
|
|
414
|
+
* 2. On context hydration, the full role map is loaded into memory
|
|
415
|
+
* 3. `auth.hasRole()` / `auth.requireRole()` are simple array lookups
|
|
416
|
+
* 4. `auth.getUsersByRole()` scans the preloaded assignments
|
|
417
|
+
*
|
|
418
|
+
* ## Usage
|
|
419
|
+
*
|
|
420
|
+
* ```ts
|
|
421
|
+
* import { auth, Roles } from '@mindstudio-ai/agent';
|
|
422
|
+
*
|
|
423
|
+
* // Check permissions
|
|
424
|
+
* if (auth.hasRole(Roles.admin, Roles.approver)) {
|
|
425
|
+
* // user has at least one of these roles
|
|
426
|
+
* }
|
|
427
|
+
*
|
|
428
|
+
* // Gate a route — throws 403 if user lacks the role
|
|
429
|
+
* auth.requireRole(Roles.admin);
|
|
430
|
+
*
|
|
431
|
+
* // Look up who has a role
|
|
432
|
+
* const admins = auth.getUsersByRole(Roles.admin);
|
|
433
|
+
* ```
|
|
434
|
+
*
|
|
435
|
+
* ## Roles proxy
|
|
436
|
+
*
|
|
437
|
+
* `Roles` is a convenience proxy: `Roles.admin` === `"admin"`. It provides
|
|
438
|
+
* discoverability and typo prevention. In the future, the compilation
|
|
439
|
+
* pipeline will generate a typed `Roles` object from `app.json`, giving
|
|
440
|
+
* compile-time safety. For now, any string property access works.
|
|
441
|
+
*/
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Auth context for the current execution. Created from the app's role
|
|
445
|
+
* assignments and the current user's identity.
|
|
446
|
+
*
|
|
447
|
+
* All methods are synchronous — the full role map is preloaded at
|
|
448
|
+
* context hydration time.
|
|
449
|
+
*/
|
|
450
|
+
declare class AuthContext {
|
|
451
|
+
/** The current user's ID. */
|
|
452
|
+
readonly userId: string;
|
|
453
|
+
/** The current user's roles in this app. */
|
|
454
|
+
readonly roles: readonly string[];
|
|
455
|
+
/** All role assignments for this app (all users, all roles). */
|
|
456
|
+
private readonly _roleAssignments;
|
|
457
|
+
constructor(ctx: AppAuthContext);
|
|
458
|
+
/**
|
|
459
|
+
* Check if the current user has **any** of the given roles.
|
|
460
|
+
* Returns true if at least one matches.
|
|
461
|
+
*
|
|
462
|
+
* @example
|
|
463
|
+
* ```ts
|
|
464
|
+
* if (auth.hasRole(Roles.admin, Roles.approver)) {
|
|
465
|
+
* // user is an admin OR an approver
|
|
466
|
+
* }
|
|
467
|
+
* ```
|
|
468
|
+
*/
|
|
469
|
+
hasRole(...roles: string[]): boolean;
|
|
470
|
+
/**
|
|
471
|
+
* Require the current user to have at least one of the given roles.
|
|
472
|
+
* Throws a `MindStudioError` with code `'forbidden'` and status 403
|
|
473
|
+
* if the user lacks all of the specified roles.
|
|
474
|
+
*
|
|
475
|
+
* Use this at the top of route handlers to gate access.
|
|
476
|
+
*
|
|
477
|
+
* @example
|
|
478
|
+
* ```ts
|
|
479
|
+
* auth.requireRole(Roles.admin);
|
|
480
|
+
* // code below only runs if user is an admin
|
|
481
|
+
* ```
|
|
482
|
+
*/
|
|
483
|
+
requireRole(...roles: string[]): void;
|
|
484
|
+
/**
|
|
485
|
+
* Get all user IDs that have the given role in this app.
|
|
486
|
+
* Synchronous — scans the preloaded role assignments.
|
|
487
|
+
*
|
|
488
|
+
* @example
|
|
489
|
+
* ```ts
|
|
490
|
+
* const reviewers = auth.getUsersByRole(Roles.reviewer);
|
|
491
|
+
* // ['user-id-1', 'user-id-2', ...]
|
|
492
|
+
* ```
|
|
493
|
+
*/
|
|
494
|
+
getUsersByRole(role: string): string[];
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Convenience proxy for referencing role names. Any property access
|
|
498
|
+
* returns the property name as a string: `Roles.admin === "admin"`.
|
|
499
|
+
*
|
|
500
|
+
* This provides:
|
|
501
|
+
* - Discoverability via autocomplete (in typed environments)
|
|
502
|
+
* - Typo prevention (vs raw string literals)
|
|
503
|
+
* - Forward compatibility with the future typed Roles generation
|
|
504
|
+
*
|
|
505
|
+
* In the future, the compilation pipeline will generate a typed `Roles`
|
|
506
|
+
* object from `app.json` roles, replacing this proxy with compile-time
|
|
507
|
+
* checked constants.
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* ```ts
|
|
511
|
+
* Roles.admin // "admin"
|
|
512
|
+
* Roles.approver // "approver"
|
|
513
|
+
* Roles.anything // "anything" (no runtime error, any string works)
|
|
514
|
+
* ```
|
|
515
|
+
*/
|
|
516
|
+
declare const Roles: Record<string, string>;
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Internal type definitions for the `db` namespace.
|
|
520
|
+
*
|
|
521
|
+
* These types power the chainable collection API over MindStudio's managed
|
|
522
|
+
* SQLite databases. They're used internally by Table, Query, and the
|
|
523
|
+
* predicate compiler — most are also re-exported from the package for
|
|
524
|
+
* consumers who need them in type annotations.
|
|
525
|
+
*
|
|
526
|
+
* Key concepts:
|
|
527
|
+
* - **SystemFields**: columns managed by the platform (id, timestamps, audit).
|
|
528
|
+
* Stripped from write inputs automatically.
|
|
529
|
+
* - **Predicate / Accessor**: callback shapes used in filter(), sortBy(), etc.
|
|
530
|
+
* Predicates are compiled to SQL WHERE clauses when possible, with a JS
|
|
531
|
+
* fallback for complex expressions.
|
|
532
|
+
* - **TableConfig**: runtime binding between a Table instance and the
|
|
533
|
+
* underlying queryAppDatabase step execution.
|
|
534
|
+
*/
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Names of columns that the platform manages automatically.
|
|
538
|
+
*
|
|
539
|
+
* - `id`: UUID primary key, generated on INSERT
|
|
540
|
+
* - `createdAt`: unix timestamp (ms), set on INSERT
|
|
541
|
+
* - `updatedAt`: unix timestamp (ms), set on INSERT and every UPDATE
|
|
542
|
+
* - `lastUpdatedBy`: reference to the run ID that last wrote this row
|
|
543
|
+
*/
|
|
544
|
+
type SystemFields = 'id' | 'createdAt' | 'updatedAt' | 'lastUpdatedBy';
|
|
545
|
+
/**
|
|
546
|
+
* Input type for `Table.push()`. Excludes system-managed fields.
|
|
547
|
+
* Optional fields in T remain optional.
|
|
548
|
+
*
|
|
549
|
+
* @example
|
|
550
|
+
* ```ts
|
|
551
|
+
* // If Order has { id, createdAt, updatedAt, lastUpdatedBy, item, amount }
|
|
552
|
+
* // then PushInput<Order> is { item: string; amount: number }
|
|
553
|
+
* ```
|
|
554
|
+
*/
|
|
555
|
+
type PushInput<T> = Omit<T, SystemFields>;
|
|
556
|
+
/**
|
|
557
|
+
* Input type for `Table.update()`. Excludes system-managed fields,
|
|
558
|
+
* and all remaining fields are optional (partial update).
|
|
559
|
+
*/
|
|
560
|
+
type UpdateInput<T> = Partial<Omit<T, SystemFields>>;
|
|
561
|
+
/**
|
|
562
|
+
* A predicate function for filtering rows. Receives a typed row and
|
|
563
|
+
* returns a boolean.
|
|
564
|
+
*
|
|
565
|
+
* The SDK attempts to compile the predicate to a SQL WHERE clause for
|
|
566
|
+
* performance. Simple expressions (field comparisons, &&/||, .includes())
|
|
567
|
+
* compile to efficient SQL. If the predicate can't be compiled (function
|
|
568
|
+
* calls, regex, computed expressions), the SDK falls back to fetching all
|
|
569
|
+
* rows and evaluating in JS. Both paths produce identical results.
|
|
570
|
+
*/
|
|
571
|
+
type Predicate<T> = (row: T) => boolean;
|
|
572
|
+
/**
|
|
573
|
+
* A field accessor function used by sortBy(), min(), max(), groupBy().
|
|
574
|
+
* Receives a typed row and returns the value to sort/aggregate by.
|
|
575
|
+
*
|
|
576
|
+
* @example
|
|
577
|
+
* ```ts
|
|
578
|
+
* .sortBy(o => o.createdAt) // sort by createdAt
|
|
579
|
+
* .min(o => o.amount) // row with smallest amount
|
|
580
|
+
* .groupBy(o => o.status) // group rows by status
|
|
581
|
+
* ```
|
|
582
|
+
*/
|
|
583
|
+
type Accessor<T, R = unknown> = (row: T) => R;
|
|
584
|
+
/**
|
|
585
|
+
* Runtime configuration for a Table instance. Created by `createDb()` when
|
|
586
|
+
* `defineTable()` is called. Contains everything the Table needs to execute
|
|
587
|
+
* queries against the correct database.
|
|
588
|
+
*/
|
|
589
|
+
interface TableConfig {
|
|
590
|
+
/** The managed database ID (from app context metadata). */
|
|
591
|
+
databaseId: string;
|
|
592
|
+
/** The SQL table name (as declared in defineTable). */
|
|
593
|
+
tableName: string;
|
|
594
|
+
/**
|
|
595
|
+
* Column schema from app context. Used to identify user-type columns
|
|
596
|
+
* (which need @@user@@ prefix handling) and for validation.
|
|
597
|
+
*/
|
|
598
|
+
columns: AppDatabaseColumnSchema[];
|
|
599
|
+
/**
|
|
600
|
+
* Execute one or more SQL queries against the managed database in a
|
|
601
|
+
* single round trip. All queries run on the same SQLite connection,
|
|
602
|
+
* enabling RETURNING clauses and multi-statement batches.
|
|
603
|
+
*
|
|
604
|
+
* Bound to the `POST /_internal/v2/db/query` endpoint at creation time.
|
|
605
|
+
*
|
|
606
|
+
* @param queries - Array of SQL queries with optional bind params
|
|
607
|
+
* @returns Array of results in the same order as the input queries
|
|
608
|
+
*/
|
|
609
|
+
executeBatch: (queries: SqlQuery[]) => Promise<SqlResult[]>;
|
|
610
|
+
}
|
|
611
|
+
/** A single SQL query with optional positional bind params. */
|
|
612
|
+
interface SqlQuery {
|
|
613
|
+
sql: string;
|
|
614
|
+
params?: unknown[];
|
|
615
|
+
}
|
|
616
|
+
/** Result of a single SQL query execution. */
|
|
617
|
+
interface SqlResult {
|
|
618
|
+
rows: unknown[];
|
|
619
|
+
changes: number;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Query chain builder — lazy, immutable query construction for database reads.
|
|
624
|
+
*
|
|
625
|
+
* A Query<T> represents a pending database query. It accumulates operations
|
|
626
|
+
* (filter, sort, limit, skip) without executing anything. Execution happens
|
|
627
|
+
* only when the query is awaited (via PromiseLike) or a terminal method
|
|
628
|
+
* is called (first, last, count, some, every, min, max, groupBy).
|
|
629
|
+
*
|
|
630
|
+
* ## Immutability
|
|
631
|
+
*
|
|
632
|
+
* Every chain method returns a NEW Query instance. This means chains can
|
|
633
|
+
* safely fork:
|
|
634
|
+
*
|
|
635
|
+
* ```ts
|
|
636
|
+
* const base = Orders.filter(o => o.status === 'active');
|
|
637
|
+
* const recent = base.sortBy(o => o.createdAt).reverse().take(10);
|
|
638
|
+
* const count = await base.count(); // doesn't affect `recent`
|
|
639
|
+
* ```
|
|
640
|
+
*
|
|
641
|
+
* ## Execution strategy (SQL fast path vs JS fallback)
|
|
642
|
+
*
|
|
643
|
+
* When a Query is executed, it attempts to compile all predicates to SQL:
|
|
644
|
+
*
|
|
645
|
+
* - **Fast path**: All predicates compile → single SQL query with WHERE,
|
|
646
|
+
* ORDER BY, LIMIT, OFFSET. Efficient, minimal data transfer.
|
|
647
|
+
*
|
|
648
|
+
* - **Fallback path**: Any predicate fails to compile → fetch ALL rows
|
|
649
|
+
* from the table (SELECT *), then apply the entire chain as native JS
|
|
650
|
+
* array operations (Array.filter, Array.sort, Array.slice, etc.).
|
|
651
|
+
* A warning is logged so developers can optimize if needed.
|
|
652
|
+
*
|
|
653
|
+
* Both paths produce identical results. The SQL path is a transparent
|
|
654
|
+
* performance optimization.
|
|
655
|
+
*/
|
|
656
|
+
|
|
657
|
+
declare class Query<T> implements PromiseLike<T[]> {
|
|
658
|
+
private readonly _predicates;
|
|
659
|
+
private readonly _sortAccessor;
|
|
660
|
+
private readonly _reversed;
|
|
661
|
+
private readonly _limit;
|
|
662
|
+
private readonly _offset;
|
|
663
|
+
private readonly _config;
|
|
664
|
+
constructor(config: TableConfig, options?: {
|
|
665
|
+
predicates?: Predicate<T>[];
|
|
666
|
+
sortAccessor?: Accessor<T>;
|
|
667
|
+
reversed?: boolean;
|
|
668
|
+
limit?: number;
|
|
669
|
+
offset?: number;
|
|
670
|
+
});
|
|
671
|
+
private _clone;
|
|
672
|
+
filter(predicate: Predicate<T>): Query<T>;
|
|
673
|
+
sortBy(accessor: Accessor<T>): Query<T>;
|
|
674
|
+
reverse(): Query<T>;
|
|
675
|
+
take(n: number): Query<T>;
|
|
676
|
+
skip(n: number): Query<T>;
|
|
677
|
+
first(): Promise<T | null>;
|
|
678
|
+
last(): Promise<T | null>;
|
|
679
|
+
count(): Promise<number>;
|
|
680
|
+
some(): Promise<boolean>;
|
|
681
|
+
every(): Promise<boolean>;
|
|
682
|
+
min(accessor: Accessor<T, number>): Promise<T | null>;
|
|
683
|
+
max(accessor: Accessor<T, number>): Promise<T | null>;
|
|
684
|
+
groupBy<K extends string | number>(accessor: Accessor<T, K>): Promise<Map<K, T[]>>;
|
|
685
|
+
then<TResult1 = T[], TResult2 = never>(onfulfilled?: ((value: T[]) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
686
|
+
private _execute;
|
|
687
|
+
private _compilePredicates;
|
|
688
|
+
private _fetchAndFilterInJs;
|
|
689
|
+
private _fetchAllRows;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Table<T> — a typed persistent collection backed by SQLite.
|
|
694
|
+
*
|
|
695
|
+
* Created via `db.defineTable<T>(name)`. Every method either returns a
|
|
696
|
+
* chainable Query<T> (for lazy reads) or a Promise (for terminal reads
|
|
697
|
+
* and writes).
|
|
698
|
+
*
|
|
699
|
+
* ## Write operations use RETURNING
|
|
700
|
+
*
|
|
701
|
+
* INSERT and UPDATE use `RETURNING *` to get the created/updated row
|
|
702
|
+
* back in a single round trip — no separate SELECT needed. This is
|
|
703
|
+
* executed via the batch endpoint which runs all queries on a single
|
|
704
|
+
* SQLite connection.
|
|
705
|
+
*/
|
|
706
|
+
|
|
707
|
+
declare class Table<T> {
|
|
708
|
+
/** @internal */
|
|
709
|
+
private readonly _config;
|
|
710
|
+
constructor(config: TableConfig);
|
|
711
|
+
get(id: string): Promise<T | null>;
|
|
712
|
+
findOne(predicate: Predicate<T>): Promise<T | null>;
|
|
713
|
+
count(predicate?: Predicate<T>): Promise<number>;
|
|
714
|
+
some(predicate: Predicate<T>): Promise<boolean>;
|
|
715
|
+
every(predicate: Predicate<T>): Promise<boolean>;
|
|
716
|
+
isEmpty(): Promise<boolean>;
|
|
717
|
+
min(accessor: Accessor<T, number>): Promise<T | null>;
|
|
718
|
+
max(accessor: Accessor<T, number>): Promise<T | null>;
|
|
719
|
+
groupBy<K extends string | number>(accessor: Accessor<T, K>): Promise<Map<K, T[]>>;
|
|
720
|
+
filter(predicate: Predicate<T>): Query<T>;
|
|
721
|
+
sortBy(accessor: Accessor<T>): Query<T>;
|
|
722
|
+
/**
|
|
723
|
+
* Insert one or more rows. Returns the created row(s) with system fields
|
|
724
|
+
* populated (id, createdAt, updatedAt, lastUpdatedBy).
|
|
725
|
+
*
|
|
726
|
+
* Uses `INSERT ... RETURNING *` so the created row comes back in a
|
|
727
|
+
* single round trip — no separate SELECT needed.
|
|
728
|
+
*/
|
|
729
|
+
push(data: PushInput<T>): Promise<T>;
|
|
730
|
+
push(data: PushInput<T>[]): Promise<T[]>;
|
|
731
|
+
/**
|
|
732
|
+
* Update a row by ID. Only the provided fields are changed.
|
|
733
|
+
* Returns the updated row via `UPDATE ... RETURNING *`.
|
|
734
|
+
*/
|
|
735
|
+
update(id: string, data: UpdateInput<T>): Promise<T>;
|
|
736
|
+
remove(id: string): Promise<void>;
|
|
737
|
+
/**
|
|
738
|
+
* Remove all rows matching a predicate. Returns the count removed.
|
|
739
|
+
*/
|
|
740
|
+
removeAll(predicate: Predicate<T>): Promise<number>;
|
|
741
|
+
clear(): Promise<void>;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* The `db` namespace — factory and time helpers for MindStudio managed databases.
|
|
746
|
+
*
|
|
747
|
+
* This module provides `createDb()`, which builds the `Db` object that users
|
|
748
|
+
* interact with. The Db object has:
|
|
749
|
+
*
|
|
750
|
+
* - `defineTable<T>(name)` — creates a typed Table<T> for a given table name
|
|
751
|
+
* - Time helpers: `now()`, `days()`, `hours()`, `minutes()`, `ago()`, `fromNow()`
|
|
752
|
+
*
|
|
753
|
+
* ## How defineTable works
|
|
754
|
+
*
|
|
755
|
+
* `defineTable` is a factory that binds a table name to the correct database
|
|
756
|
+
* and execution context. It:
|
|
757
|
+
*
|
|
758
|
+
* 1. Looks up the table name in the app context database metadata
|
|
759
|
+
* 2. Resolves the databaseId (implicit if only one database exists)
|
|
760
|
+
* 3. Gets the column schema (for user-type handling and JSON parsing)
|
|
761
|
+
* 4. Returns a Table<T> instance bound to the executeQuery function
|
|
762
|
+
*
|
|
763
|
+
* Tables are typically defined at module scope and imported into route handlers:
|
|
764
|
+
*
|
|
765
|
+
* ```ts
|
|
766
|
+
* // tables/orders.ts
|
|
767
|
+
* import { db } from '@mindstudio-ai/agent';
|
|
768
|
+
* export const Orders = db.defineTable<Order>('orders');
|
|
769
|
+
*
|
|
770
|
+
* // routes/getOrders.ts
|
|
771
|
+
* import { Orders } from '../tables/orders';
|
|
772
|
+
* const active = await Orders.filter(o => o.status === 'active').take(10);
|
|
773
|
+
* ```
|
|
774
|
+
*
|
|
775
|
+
* Since `defineTable()` is lazy (no queries execute until you await something
|
|
776
|
+
* on the Table), it's safe to call at module scope. The actual database
|
|
777
|
+
* context resolution happens on first query execution.
|
|
778
|
+
*
|
|
779
|
+
* ## Time helpers
|
|
780
|
+
*
|
|
781
|
+
* All timestamps in MindStudio databases are unix timestamps (milliseconds
|
|
782
|
+
* since epoch). The time helpers make it easy to work with relative times
|
|
783
|
+
* without writing `Date.now() - 48 * 60 * 60 * 1000` everywhere:
|
|
784
|
+
*
|
|
785
|
+
* ```ts
|
|
786
|
+
* const cutoff = db.ago(db.days(2)); // 2 days ago (unix ms)
|
|
787
|
+
* const deadline = db.fromNow(db.hours(48)); // 48 hours from now
|
|
788
|
+
* const window = db.days(7) + db.hours(12); // composable durations
|
|
789
|
+
* ```
|
|
790
|
+
*/
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Options for `db.defineTable()`.
|
|
794
|
+
*/
|
|
795
|
+
interface DefineTableOptions {
|
|
796
|
+
/**
|
|
797
|
+
* Database name or ID to target. Required when the app has multiple
|
|
798
|
+
* databases and the table name alone is ambiguous.
|
|
799
|
+
*
|
|
800
|
+
* Accepts either the database's display name or its ID. The SDK
|
|
801
|
+
* matches against both.
|
|
802
|
+
*
|
|
803
|
+
* If omitted, the SDK resolves the database automatically:
|
|
804
|
+
* - Single database → used implicitly
|
|
805
|
+
* - Multiple databases → searched by table name
|
|
806
|
+
*/
|
|
807
|
+
database?: string;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* The `db` namespace object. Contains `defineTable()` for creating typed
|
|
812
|
+
* collections and time helpers for working with unix timestamps.
|
|
813
|
+
*/
|
|
814
|
+
interface Db {
|
|
815
|
+
/**
|
|
816
|
+
* Define a typed table. Returns a Table<T> bound to the app's managed
|
|
817
|
+
* database. The table name must match a table in the app's database schema.
|
|
818
|
+
*
|
|
819
|
+
* Tables are lazy — nothing executes until you call a method on the Table
|
|
820
|
+
* and await the result. This makes it safe to call `defineTable()` at
|
|
821
|
+
* module scope.
|
|
822
|
+
*
|
|
823
|
+
* Database resolution:
|
|
824
|
+
* - If the app has a single database (common case), it's used automatically.
|
|
825
|
+
* - If the app has multiple databases, pass `{ database }` with the
|
|
826
|
+
* database name or ID to target the right one. If omitted, the SDK
|
|
827
|
+
* searches all databases by table name.
|
|
828
|
+
*
|
|
829
|
+
* @example
|
|
830
|
+
* ```ts
|
|
831
|
+
* // Single database (common) — no need to specify
|
|
832
|
+
* const Orders = db.defineTable<Order>('orders');
|
|
833
|
+
*
|
|
834
|
+
* // Multiple databases — specify which one
|
|
835
|
+
* const Orders = db.defineTable<Order>('orders', { database: 'main' });
|
|
836
|
+
* ```
|
|
837
|
+
*/
|
|
838
|
+
defineTable<T>(name: string, options?: DefineTableOptions): Table<T>;
|
|
839
|
+
/** Returns the current time as a unix timestamp (ms). Equivalent to `Date.now()`. */
|
|
840
|
+
now(): number;
|
|
841
|
+
/** Returns milliseconds for n days. Composable with `+`. */
|
|
842
|
+
days(n: number): number;
|
|
843
|
+
/** Returns milliseconds for n hours. Composable with `+`. */
|
|
844
|
+
hours(n: number): number;
|
|
845
|
+
/** Returns milliseconds for n minutes. Composable with `+`. */
|
|
846
|
+
minutes(n: number): number;
|
|
847
|
+
/** Returns a unix timestamp for (now - duration). Use with days/hours/minutes. */
|
|
848
|
+
ago(ms: number): number;
|
|
849
|
+
/** Returns a unix timestamp for (now + duration). Use with days/hours/minutes. */
|
|
850
|
+
fromNow(ms: number): number;
|
|
851
|
+
}
|
|
852
|
+
|
|
320
853
|
/**
|
|
321
854
|
* Client for the MindStudio direct step execution API.
|
|
322
855
|
*
|
|
@@ -353,6 +886,29 @@ declare class MindStudioAgent$1 {
|
|
|
353
886
|
private _reuseThreadId;
|
|
354
887
|
/** @internal */
|
|
355
888
|
private _threadId;
|
|
889
|
+
/**
|
|
890
|
+
* @internal App ID for context resolution. Resolved from:
|
|
891
|
+
* constructor appId → MINDSTUDIO_APP_ID env → sandbox globals →
|
|
892
|
+
* auto-detected from first executeStep response header.
|
|
893
|
+
*/
|
|
894
|
+
private _appId;
|
|
895
|
+
/**
|
|
896
|
+
* @internal Cached app context (auth + databases). Populated by
|
|
897
|
+
* ensureContext() and cached for the lifetime of the instance.
|
|
898
|
+
*/
|
|
899
|
+
private _context;
|
|
900
|
+
/**
|
|
901
|
+
* @internal Deduplication promise for ensureContext(). Ensures only one
|
|
902
|
+
* context fetch is in-flight at a time, even if multiple db/auth
|
|
903
|
+
* operations trigger it concurrently.
|
|
904
|
+
*/
|
|
905
|
+
private _contextPromise;
|
|
906
|
+
/** @internal Cached AuthContext instance, created during context hydration. */
|
|
907
|
+
private _auth;
|
|
908
|
+
/** @internal Cached Db namespace instance, created during context hydration. */
|
|
909
|
+
private _db;
|
|
910
|
+
/** @internal Auth type — 'internal' for CALLBACK_TOKEN (managed mode), 'apiKey' otherwise. */
|
|
911
|
+
private _authType;
|
|
356
912
|
constructor(options?: AgentOptions);
|
|
357
913
|
/**
|
|
358
914
|
* Execute any step by its type name. This is the low-level method that all
|
|
@@ -462,6 +1018,168 @@ declare class MindStudioAgent$1 {
|
|
|
462
1018
|
costType?: string;
|
|
463
1019
|
estimates?: StepCostEstimateEntry[];
|
|
464
1020
|
}>;
|
|
1021
|
+
/**
|
|
1022
|
+
* The `auth` namespace — synchronous role-based access control.
|
|
1023
|
+
*
|
|
1024
|
+
* Provides the current user's identity and roles. All methods are
|
|
1025
|
+
* synchronous since the role map is preloaded during context hydration.
|
|
1026
|
+
*
|
|
1027
|
+
* **Important**: Context must be hydrated before accessing `auth`.
|
|
1028
|
+
* - Inside the MindStudio sandbox: automatic (populated from globals)
|
|
1029
|
+
* - Outside the sandbox: call `await agent.ensureContext()` first,
|
|
1030
|
+
* or access `auth` after any `db` operation (which auto-hydrates)
|
|
1031
|
+
*
|
|
1032
|
+
* @throws {MindStudioError} if context has not been hydrated yet
|
|
1033
|
+
*
|
|
1034
|
+
* @example
|
|
1035
|
+
* ```ts
|
|
1036
|
+
* await agent.ensureContext();
|
|
1037
|
+
* agent.auth.requireRole(Roles.admin);
|
|
1038
|
+
* const admins = agent.auth.getUsersByRole(Roles.admin);
|
|
1039
|
+
* ```
|
|
1040
|
+
*/
|
|
1041
|
+
get auth(): AuthContext;
|
|
1042
|
+
/**
|
|
1043
|
+
* The `db` namespace — chainable collection API over managed databases.
|
|
1044
|
+
*
|
|
1045
|
+
* Use `db.defineTable<T>(name)` to get a typed Table<T>, then call
|
|
1046
|
+
* collection methods (filter, sortBy, push, update, etc.) on it.
|
|
1047
|
+
*
|
|
1048
|
+
* Context is auto-hydrated on first query execution — you can safely
|
|
1049
|
+
* call `defineTable()` at module scope without triggering any HTTP.
|
|
1050
|
+
*
|
|
1051
|
+
* @example
|
|
1052
|
+
* ```ts
|
|
1053
|
+
* const Orders = agent.db.defineTable<Order>('orders');
|
|
1054
|
+
* const active = await Orders.filter(o => o.status === 'active').take(10);
|
|
1055
|
+
* ```
|
|
1056
|
+
*/
|
|
1057
|
+
get db(): Db;
|
|
1058
|
+
/**
|
|
1059
|
+
* Hydrate the app context (auth + database metadata). This must be
|
|
1060
|
+
* called before using `auth` synchronously. For `db`, hydration happens
|
|
1061
|
+
* automatically on first query.
|
|
1062
|
+
*
|
|
1063
|
+
* Context is fetched once and cached for the instance's lifetime.
|
|
1064
|
+
* Calling `ensureContext()` multiple times is safe (no-op after first).
|
|
1065
|
+
*
|
|
1066
|
+
* Context sources (checked in order):
|
|
1067
|
+
* 1. Sandbox globals (`globalThis.ai.auth`, `globalThis.ai.databases`)
|
|
1068
|
+
* 2. HTTP: `GET /developer/v2/helpers/app-context?appId={appId}`
|
|
1069
|
+
*
|
|
1070
|
+
* @throws {MindStudioError} if no `appId` is available
|
|
1071
|
+
*
|
|
1072
|
+
* @example
|
|
1073
|
+
* ```ts
|
|
1074
|
+
* await agent.ensureContext();
|
|
1075
|
+
* // auth is now available synchronously
|
|
1076
|
+
* agent.auth.requireRole(Roles.admin);
|
|
1077
|
+
* ```
|
|
1078
|
+
*/
|
|
1079
|
+
ensureContext(): Promise<void>;
|
|
1080
|
+
/**
|
|
1081
|
+
* @internal Fetch and cache app context, then create auth + db instances.
|
|
1082
|
+
*
|
|
1083
|
+
* In managed mode (CALLBACK_TOKEN), the platform resolves the app from
|
|
1084
|
+
* the token — no appId needed. With an API key, appId is required.
|
|
1085
|
+
*/
|
|
1086
|
+
private _hydrateContext;
|
|
1087
|
+
/**
|
|
1088
|
+
* @internal Apply a resolved context object — creates AuthContext and Db.
|
|
1089
|
+
* Used by both the HTTP path and sandbox hydration.
|
|
1090
|
+
*/
|
|
1091
|
+
private _applyContext;
|
|
1092
|
+
/**
|
|
1093
|
+
* @internal Try to hydrate context synchronously from sandbox globals.
|
|
1094
|
+
* Called in the constructor when CALLBACK_TOKEN auth is detected.
|
|
1095
|
+
*
|
|
1096
|
+
* The MindStudio sandbox pre-populates `globalThis.ai` with:
|
|
1097
|
+
* - `ai.auth`: { userId, roleAssignments[] }
|
|
1098
|
+
* - `ai.databases`: [{ id, name, tables[] }]
|
|
1099
|
+
*/
|
|
1100
|
+
private _trySandboxHydration;
|
|
1101
|
+
/**
|
|
1102
|
+
* @internal Execute a batch of SQL queries against a managed database.
|
|
1103
|
+
* Used as the `executeBatch` callback for Table/Query instances.
|
|
1104
|
+
*
|
|
1105
|
+
* Calls `POST /_internal/v2/db/query` directly with the hook token
|
|
1106
|
+
* (raw, no Bearer prefix). All queries run on a single SQLite connection,
|
|
1107
|
+
* enabling RETURNING clauses and multi-statement batches.
|
|
1108
|
+
*/
|
|
1109
|
+
private _executeDbBatch;
|
|
1110
|
+
/**
|
|
1111
|
+
* @internal Create a lazy Db proxy that auto-hydrates context.
|
|
1112
|
+
*
|
|
1113
|
+
* defineTable() returns Table instances immediately (no async needed).
|
|
1114
|
+
* But the Table's executeBatch callback is wrapped to call ensureContext()
|
|
1115
|
+
* before the first query, so context is fetched lazily.
|
|
1116
|
+
*/
|
|
1117
|
+
private _createLazyDb;
|
|
1118
|
+
/**
|
|
1119
|
+
* Resolve a single user ID to display info (name, email, profile picture).
|
|
1120
|
+
*
|
|
1121
|
+
* Use this when you have a `User`-typed field value and need the person's
|
|
1122
|
+
* display name, email, or avatar. Returns null if the user ID is not found.
|
|
1123
|
+
*
|
|
1124
|
+
* Also available as a top-level import:
|
|
1125
|
+
* ```ts
|
|
1126
|
+
* import { resolveUser } from '@mindstudio-ai/agent';
|
|
1127
|
+
* ```
|
|
1128
|
+
*
|
|
1129
|
+
* @param userId - The user ID to resolve (a `User` branded string or plain UUID)
|
|
1130
|
+
* @returns Resolved user info, or null if not found
|
|
1131
|
+
*
|
|
1132
|
+
* @example
|
|
1133
|
+
* ```ts
|
|
1134
|
+
* const user = await agent.resolveUser(order.requestedBy);
|
|
1135
|
+
* if (user) {
|
|
1136
|
+
* console.log(user.name); // "Jane Smith"
|
|
1137
|
+
* console.log(user.email); // "jane@example.com"
|
|
1138
|
+
* console.log(user.profilePictureUrl); // "https://..." or null
|
|
1139
|
+
* }
|
|
1140
|
+
* ```
|
|
1141
|
+
*/
|
|
1142
|
+
resolveUser(userId: string): Promise<ResolvedUser | null>;
|
|
1143
|
+
/**
|
|
1144
|
+
* Resolve multiple user IDs to display info in a single request.
|
|
1145
|
+
* Maximum 100 user IDs per request.
|
|
1146
|
+
*
|
|
1147
|
+
* Use this for batch resolution when you have multiple user references
|
|
1148
|
+
* to display (e.g. all approvers on a purchase order, all team members).
|
|
1149
|
+
*
|
|
1150
|
+
* @param userIds - Array of user IDs to resolve (max 100)
|
|
1151
|
+
* @returns Object with `users` array of resolved user info
|
|
1152
|
+
*
|
|
1153
|
+
* @example
|
|
1154
|
+
* ```ts
|
|
1155
|
+
* // Resolve all approvers at once
|
|
1156
|
+
* const approverIds = approvals.map(a => a.assignedTo);
|
|
1157
|
+
* const { users } = await agent.resolveUsers(approverIds);
|
|
1158
|
+
*
|
|
1159
|
+
* for (const u of users) {
|
|
1160
|
+
* console.log(`${u.name} (${u.email})`);
|
|
1161
|
+
* }
|
|
1162
|
+
* ```
|
|
1163
|
+
*/
|
|
1164
|
+
resolveUsers(userIds: string[]): Promise<{
|
|
1165
|
+
users: ResolvedUser[];
|
|
1166
|
+
}>;
|
|
1167
|
+
/**
|
|
1168
|
+
* Get auth and database context for an app.
|
|
1169
|
+
*
|
|
1170
|
+
* Returns role assignments and managed database schemas. Useful for
|
|
1171
|
+
* hydrating `auth` and `db` namespaces when running outside the sandbox.
|
|
1172
|
+
*
|
|
1173
|
+
* When called with a CALLBACK_TOKEN (managed mode), `appId` is optional —
|
|
1174
|
+
* the platform resolves the app from the token. With an API key, `appId`
|
|
1175
|
+
* is required.
|
|
1176
|
+
*
|
|
1177
|
+
* ```ts
|
|
1178
|
+
* const ctx = await agent.getAppContext('your-app-id');
|
|
1179
|
+
* console.log(ctx.auth.roleAssignments, ctx.databases);
|
|
1180
|
+
* ```
|
|
1181
|
+
*/
|
|
1182
|
+
getAppContext(appId?: string): Promise<AppContextResult>;
|
|
465
1183
|
/** Update the display name of the authenticated user/agent. */
|
|
466
1184
|
changeName(displayName: string): Promise<void>;
|
|
467
1185
|
/** Update the profile picture of the authenticated user/agent. */
|
|
@@ -538,8 +1256,8 @@ interface AddSubtitlesToVideoStepInput {
|
|
|
538
1256
|
wordsPerSubtitle: number;
|
|
539
1257
|
/** When true, enables bounce-style entrance animation for subtitles. Default: true. */
|
|
540
1258
|
enableAnimation: boolean;
|
|
541
|
-
/** When true, the
|
|
542
|
-
|
|
1259
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
1260
|
+
intermediateAsset?: boolean;
|
|
543
1261
|
}
|
|
544
1262
|
interface AddSubtitlesToVideoStepOutput {
|
|
545
1263
|
/** URL of the video with subtitles added */
|
|
@@ -723,6 +1441,24 @@ interface CaptureThumbnailStepOutput {
|
|
|
723
1441
|
/** URL of the captured thumbnail image */
|
|
724
1442
|
thumbnailUrl: string;
|
|
725
1443
|
}
|
|
1444
|
+
interface CheckAppRoleStepInput {
|
|
1445
|
+
/** The role name to check (supports {{variables}}) */
|
|
1446
|
+
roleName: string;
|
|
1447
|
+
/** Step to transition to if the user has the role (same workflow) */
|
|
1448
|
+
hasRoleStepId?: string;
|
|
1449
|
+
/** Workflow to jump to if the user has the role (cross workflow) */
|
|
1450
|
+
hasRoleWorkflowId?: string;
|
|
1451
|
+
/** Step to transition to if the user does not have the role (same workflow) */
|
|
1452
|
+
noRoleStepId?: string;
|
|
1453
|
+
/** Workflow to jump to if the user does not have the role (cross workflow) */
|
|
1454
|
+
noRoleWorkflowId?: string;
|
|
1455
|
+
}
|
|
1456
|
+
interface CheckAppRoleStepOutput {
|
|
1457
|
+
/** Whether the current user has the checked role */
|
|
1458
|
+
hasRole: boolean;
|
|
1459
|
+
/** All roles assigned to the current user for this app */
|
|
1460
|
+
userRoles: string[];
|
|
1461
|
+
}
|
|
726
1462
|
interface CodaCreateUpdatePageStepInput {
|
|
727
1463
|
/** Coda OAuth connection ID */
|
|
728
1464
|
connectionId?: string;
|
|
@@ -1668,8 +2404,8 @@ interface GenerateChartStepOutput {
|
|
|
1668
2404
|
interface GenerateImageStepInput {
|
|
1669
2405
|
/** Text prompt describing the image to generate */
|
|
1670
2406
|
prompt: string;
|
|
1671
|
-
/**
|
|
1672
|
-
|
|
2407
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
2408
|
+
intermediateAsset?: boolean;
|
|
1673
2409
|
/** Optional model configuration override. Uses the workflow's default image model if not specified */
|
|
1674
2410
|
imageModelOverride?: {
|
|
1675
2411
|
/** Image generation model identifier */
|
|
@@ -1689,8 +2425,8 @@ interface GenerateImageStepOutput {
|
|
|
1689
2425
|
imageUrl: string | string[];
|
|
1690
2426
|
}
|
|
1691
2427
|
interface GenerateLipsyncStepInput {
|
|
1692
|
-
/**
|
|
1693
|
-
|
|
2428
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
2429
|
+
intermediateAsset?: boolean;
|
|
1694
2430
|
/** Whether to add a MindStudio watermark to the generated video */
|
|
1695
2431
|
addWatermark?: boolean;
|
|
1696
2432
|
/** Optional model configuration override. Uses the workflow's default lipsync model if not specified */
|
|
@@ -1703,8 +2439,8 @@ type GenerateLipsyncStepOutput = unknown;
|
|
|
1703
2439
|
interface GenerateMusicStepInput {
|
|
1704
2440
|
/** The instructions (prompt) for the music generation */
|
|
1705
2441
|
text: string;
|
|
1706
|
-
/**
|
|
1707
|
-
|
|
2442
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
2443
|
+
intermediateAsset?: boolean;
|
|
1708
2444
|
/** Optional model configuration override. Uses the workflow's default music model if not specified */
|
|
1709
2445
|
musicModelOverride?: {
|
|
1710
2446
|
model: string;
|
|
@@ -1793,8 +2529,8 @@ interface GeneratePdfStepInput {
|
|
|
1793
2529
|
shareControl?: "default" | "hidden";
|
|
1794
2530
|
/** URL of a custom Open Graph share image */
|
|
1795
2531
|
shareImageUrl?: string;
|
|
1796
|
-
/**
|
|
1797
|
-
|
|
2532
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
2533
|
+
intermediateAsset?: boolean;
|
|
1798
2534
|
}
|
|
1799
2535
|
interface GeneratePdfStepOutput {
|
|
1800
2536
|
/** CDN URL of the generated asset (PDF, PNG, HTML, or MP4 depending on outputFormat) */
|
|
@@ -1813,8 +2549,8 @@ interface GenerateStaticVideoFromImageStepOutput {
|
|
|
1813
2549
|
interface GenerateVideoStepInput {
|
|
1814
2550
|
/** Text prompt describing the video to generate */
|
|
1815
2551
|
prompt: string;
|
|
1816
|
-
/**
|
|
1817
|
-
|
|
2552
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
2553
|
+
intermediateAsset?: boolean;
|
|
1818
2554
|
/** Optional model configuration override. Uses the workflow's default video model if not specified */
|
|
1819
2555
|
videoModelOverride?: {
|
|
1820
2556
|
/** Video generation model identifier */
|
|
@@ -2307,8 +3043,8 @@ interface ImageRemoveWatermarkStepInput {
|
|
|
2307
3043
|
imageUrl: string;
|
|
2308
3044
|
/** Watermark removal engine to use */
|
|
2309
3045
|
engine: string;
|
|
2310
|
-
/** When true, the
|
|
2311
|
-
|
|
3046
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
3047
|
+
intermediateAsset?: boolean;
|
|
2312
3048
|
}
|
|
2313
3049
|
interface ImageRemoveWatermarkStepOutput {
|
|
2314
3050
|
/** CDN URL of the processed image with watermark removed (PNG) */
|
|
@@ -2330,8 +3066,8 @@ interface InsertVideoClipsStepInput {
|
|
|
2330
3066
|
transitionDuration?: number;
|
|
2331
3067
|
/** When true, uses audio from the overlay clips instead of the base video audio during inserts */
|
|
2332
3068
|
useOverlayAudio?: boolean;
|
|
2333
|
-
/** When true, the
|
|
2334
|
-
|
|
3069
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
3070
|
+
intermediateAsset?: boolean;
|
|
2335
3071
|
}
|
|
2336
3072
|
interface InsertVideoClipsStepOutput {
|
|
2337
3073
|
/** URL of the video with clips inserted */
|
|
@@ -2522,8 +3258,8 @@ interface MergeAudioStepInput {
|
|
|
2522
3258
|
fileMetadata?: Record<string, unknown>;
|
|
2523
3259
|
/** URL of an image to embed as album art in the output file */
|
|
2524
3260
|
albumArtUrl?: string;
|
|
2525
|
-
/** When true, the
|
|
2526
|
-
|
|
3261
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
3262
|
+
intermediateAsset?: boolean;
|
|
2527
3263
|
}
|
|
2528
3264
|
interface MergeAudioStepOutput {
|
|
2529
3265
|
/** URL of the merged audio file */
|
|
@@ -2536,8 +3272,8 @@ interface MergeVideosStepInput {
|
|
|
2536
3272
|
transition?: string;
|
|
2537
3273
|
/** Duration of the transition in seconds */
|
|
2538
3274
|
transitionDuration?: number;
|
|
2539
|
-
/** When true, the
|
|
2540
|
-
|
|
3275
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
3276
|
+
intermediateAsset?: boolean;
|
|
2541
3277
|
}
|
|
2542
3278
|
interface MergeVideosStepOutput {
|
|
2543
3279
|
/** URL of the merged video */
|
|
@@ -2559,8 +3295,8 @@ interface MixAudioIntoVideoStepInput {
|
|
|
2559
3295
|
/** When true, loops the audio track to match the video duration. Defaults to false. */
|
|
2560
3296
|
loopAudio?: boolean;
|
|
2561
3297
|
};
|
|
2562
|
-
/** When true, the
|
|
2563
|
-
|
|
3298
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
3299
|
+
intermediateAsset?: boolean;
|
|
2564
3300
|
}
|
|
2565
3301
|
interface MixAudioIntoVideoStepOutput {
|
|
2566
3302
|
/** URL of the video with the mixed audio track */
|
|
@@ -2569,8 +3305,8 @@ interface MixAudioIntoVideoStepOutput {
|
|
|
2569
3305
|
interface MuteVideoStepInput {
|
|
2570
3306
|
/** URL of the source video to mute */
|
|
2571
3307
|
videoUrl: string;
|
|
2572
|
-
/** When true, the
|
|
2573
|
-
|
|
3308
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
3309
|
+
intermediateAsset?: boolean;
|
|
2574
3310
|
}
|
|
2575
3311
|
interface MuteVideoStepOutput {
|
|
2576
3312
|
/** URL of the muted video */
|
|
@@ -2678,14 +3414,18 @@ interface PostToLinkedInStepInput {
|
|
|
2678
3414
|
message: string;
|
|
2679
3415
|
/** Who can see the post: "PUBLIC" or "CONNECTIONS" */
|
|
2680
3416
|
visibility: "PUBLIC" | "CONNECTIONS";
|
|
3417
|
+
/** URL of an image to attach to the post */
|
|
3418
|
+
imageUrl?: string;
|
|
2681
3419
|
/** URL of a video to attach to the post */
|
|
2682
3420
|
videoUrl?: string;
|
|
2683
|
-
/**
|
|
2684
|
-
|
|
2685
|
-
/**
|
|
3421
|
+
/** URL of a document (PDF, PPT, DOC) to attach to the post */
|
|
3422
|
+
documentUrl?: string;
|
|
3423
|
+
/** URL to share as an article link preview */
|
|
3424
|
+
articleUrl?: string;
|
|
3425
|
+
/** Title text for media or article attachments */
|
|
2686
3426
|
titleText?: string;
|
|
2687
|
-
/**
|
|
2688
|
-
|
|
3427
|
+
/** Description text for article attachments */
|
|
3428
|
+
descriptionText?: string;
|
|
2689
3429
|
/** LinkedIn OAuth connection ID */
|
|
2690
3430
|
connectionId?: string;
|
|
2691
3431
|
}
|
|
@@ -2720,6 +3460,33 @@ interface PostToZapierStepOutput {
|
|
|
2720
3460
|
/** Parsed webhook response from Zapier (JSON object, array, or string) */
|
|
2721
3461
|
data: unknown;
|
|
2722
3462
|
}
|
|
3463
|
+
interface QueryAppDatabaseStepInput {
|
|
3464
|
+
/** Name or ID of the app data database to query */
|
|
3465
|
+
databaseId: string;
|
|
3466
|
+
/**
|
|
3467
|
+
* SQL query to execute. Use {{variables}} directly in the SQL — they are handled according to the `parameterize` setting.
|
|
3468
|
+
*
|
|
3469
|
+
* When parameterize is true (default): {{variables}} are extracted from the SQL, replaced with ? placeholders, resolved via the full MindStudio handlebars pipeline, and passed as safe parameterized values to SQLite. This prevents SQL injection. Example: INSERT INTO contacts (name, email) VALUES ({{name}}, {{email}})
|
|
3470
|
+
*
|
|
3471
|
+
* When parameterize is false: The entire SQL string is resolved via compileString (standard handlebars interpolation) and executed as-is. Use this for dynamic/generated SQL where another step builds the query. The user is responsible for safety. Example: {{generatedInsertQuery}}
|
|
3472
|
+
*
|
|
3473
|
+
* Ask the user for the database schema if they have not already provided it.
|
|
3474
|
+
*/
|
|
3475
|
+
sql: string;
|
|
3476
|
+
/**
|
|
3477
|
+
* Whether to treat {{variables}} as parameterized query values (default: true).
|
|
3478
|
+
*
|
|
3479
|
+
* - true: {{vars}} are extracted, replaced with ?, and passed as bind params. Safe from SQL injection. Use for standard CRUD operations.
|
|
3480
|
+
* - false: {{vars}} are interpolated directly into the SQL string via handlebars. Use when another step generates full or partial SQL (e.g. bulk inserts with precomputed VALUES). The user is responsible for sanitization.
|
|
3481
|
+
*/
|
|
3482
|
+
parameterize?: boolean;
|
|
3483
|
+
}
|
|
3484
|
+
interface QueryAppDatabaseStepOutput {
|
|
3485
|
+
/** Result rows for SELECT queries (empty array for write queries) */
|
|
3486
|
+
rows: unknown[];
|
|
3487
|
+
/** Number of rows affected by INSERT, UPDATE, or DELETE queries (0 for SELECT) */
|
|
3488
|
+
changes: number;
|
|
3489
|
+
}
|
|
2723
3490
|
interface QueryDataSourceStepInput {
|
|
2724
3491
|
/** ID of the vector data source to query */
|
|
2725
3492
|
dataSourceId: string;
|
|
@@ -2801,8 +3568,8 @@ interface ResizeVideoStepInput {
|
|
|
2801
3568
|
height?: number;
|
|
2802
3569
|
/** Strategy for handling aspect ratio mismatch in 'exact' mode */
|
|
2803
3570
|
strategy?: "pad" | "crop";
|
|
2804
|
-
/** When true, the
|
|
2805
|
-
|
|
3571
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
3572
|
+
intermediateAsset?: boolean;
|
|
2806
3573
|
}
|
|
2807
3574
|
interface ResizeVideoStepOutput {
|
|
2808
3575
|
/** URL of the resized video */
|
|
@@ -3564,7 +4331,7 @@ type TelegramSetTypingStepOutput = unknown;
|
|
|
3564
4331
|
interface TextToSpeechStepInput {
|
|
3565
4332
|
/** The text to convert to speech */
|
|
3566
4333
|
text: string;
|
|
3567
|
-
|
|
4334
|
+
intermediateAsset?: boolean;
|
|
3568
4335
|
/** Optional model configuration override. Uses the workflow's default speech model if not specified */
|
|
3569
4336
|
speechModelOverride?: {
|
|
3570
4337
|
/** Speech synthesis model identifier */
|
|
@@ -3601,8 +4368,8 @@ interface TrimMediaStepInput {
|
|
|
3601
4368
|
start?: number | string;
|
|
3602
4369
|
/** Duration of the trimmed segment in seconds. Omit to trim to the end of the clip. */
|
|
3603
4370
|
duration?: string | number;
|
|
3604
|
-
/** When true, the
|
|
3605
|
-
|
|
4371
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
4372
|
+
intermediateAsset?: boolean;
|
|
3606
4373
|
}
|
|
3607
4374
|
interface TrimMediaStepOutput {
|
|
3608
4375
|
/** URL of the trimmed media file */
|
|
@@ -3710,8 +4477,8 @@ interface UpscaleVideoStepInput {
|
|
|
3710
4477
|
targetResolution: "720p" | "1080p" | "2K" | "4K";
|
|
3711
4478
|
/** Upscaling engine to use. Higher tiers produce better quality at higher cost. */
|
|
3712
4479
|
engine: "standard" | "pro" | "ultimate" | "flashvsr" | "seedance" | "seedvr2" | "runwayml/upscale-v1";
|
|
3713
|
-
/** When true, the
|
|
3714
|
-
|
|
4480
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
4481
|
+
intermediateAsset?: boolean;
|
|
3715
4482
|
}
|
|
3716
4483
|
interface UpscaleVideoStepOutput {
|
|
3717
4484
|
/** URL of the upscaled video */
|
|
@@ -3774,8 +4541,8 @@ interface VideoFaceSwapStepInput {
|
|
|
3774
4541
|
targetIndex: number;
|
|
3775
4542
|
/** Face swap engine to use */
|
|
3776
4543
|
engine: string;
|
|
3777
|
-
/** When true, the
|
|
3778
|
-
|
|
4544
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
4545
|
+
intermediateAsset?: boolean;
|
|
3779
4546
|
}
|
|
3780
4547
|
interface VideoFaceSwapStepOutput {
|
|
3781
4548
|
/** URL of the face-swapped video */
|
|
@@ -3790,8 +4557,8 @@ interface VideoRemoveBackgroundStepInput {
|
|
|
3790
4557
|
newBackgroundImageUrl?: string;
|
|
3791
4558
|
/** Background removal engine to use */
|
|
3792
4559
|
engine: string;
|
|
3793
|
-
/** When true, the
|
|
3794
|
-
|
|
4560
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
4561
|
+
intermediateAsset?: boolean;
|
|
3795
4562
|
}
|
|
3796
4563
|
interface VideoRemoveBackgroundStepOutput {
|
|
3797
4564
|
/** URL of the video with background removed or replaced */
|
|
@@ -3802,8 +4569,8 @@ interface VideoRemoveWatermarkStepInput {
|
|
|
3802
4569
|
videoUrl: string;
|
|
3803
4570
|
/** Watermark removal engine to use */
|
|
3804
4571
|
engine: string;
|
|
3805
|
-
/** When true, the
|
|
3806
|
-
|
|
4572
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
4573
|
+
intermediateAsset?: boolean;
|
|
3807
4574
|
}
|
|
3808
4575
|
interface VideoRemoveWatermarkStepOutput {
|
|
3809
4576
|
/** URL of the video with watermark removed */
|
|
@@ -3820,8 +4587,8 @@ interface WatermarkImageStepInput {
|
|
|
3820
4587
|
paddingPx: number;
|
|
3821
4588
|
/** Width of the watermark overlay in pixels */
|
|
3822
4589
|
widthPx: number;
|
|
3823
|
-
/** When true, the
|
|
3824
|
-
|
|
4590
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
4591
|
+
intermediateAsset?: boolean;
|
|
3825
4592
|
}
|
|
3826
4593
|
interface WatermarkImageStepOutput {
|
|
3827
4594
|
/** CDN URL of the watermarked image */
|
|
@@ -3838,8 +4605,8 @@ interface WatermarkVideoStepInput {
|
|
|
3838
4605
|
paddingPx: number;
|
|
3839
4606
|
/** Width of the watermark overlay in pixels */
|
|
3840
4607
|
widthPx: number;
|
|
3841
|
-
/** When true, the
|
|
3842
|
-
|
|
4608
|
+
/** When true, the asset is created but hidden from the user's gallery (tagged as intermediate) */
|
|
4609
|
+
intermediateAsset?: boolean;
|
|
3843
4610
|
}
|
|
3844
4611
|
interface WatermarkVideoStepOutput {
|
|
3845
4612
|
/** URL of the watermarked video */
|
|
@@ -3850,7 +4617,7 @@ type GenerateAssetStepOutput = GeneratePdfStepOutput;
|
|
|
3850
4617
|
type GenerateTextStepInput = UserMessageStepInput;
|
|
3851
4618
|
type GenerateTextStepOutput = UserMessageStepOutput;
|
|
3852
4619
|
/** Union of all available step type names. */
|
|
3853
|
-
type StepName = "activeCampaignAddNote" | "activeCampaignCreateContact" | "addSubtitlesToVideo" | "airtableCreateUpdateRecord" | "airtableDeleteRecord" | "airtableGetRecord" | "airtableGetTableRecords" | "analyzeImage" | "analyzeVideo" | "captureThumbnail" | "codaCreateUpdatePage" | "codaCreateUpdateRow" | "codaFindRow" | "codaGetPage" | "codaGetTableRows" | "convertPdfToImages" | "createDataSource" | "createGmailDraft" | "createGoogleCalendarEvent" | "createGoogleDoc" | "createGoogleSheet" | "deleteDataSource" | "deleteDataSourceDocument" | "deleteGmailEmail" | "deleteGoogleCalendarEvent" | "deleteGoogleSheetRows" | "detectChanges" | "detectPII" | "discordEditMessage" | "discordSendFollowUp" | "discordSendMessage" | "downloadVideo" | "enhanceImageGenerationPrompt" | "enhanceVideoGenerationPrompt" | "enrichPerson" | "extractAudioFromVideo" | "extractText" | "fetchDataSourceDocument" | "fetchGoogleDoc" | "fetchGoogleSheet" | "fetchSlackChannelHistory" | "fetchYoutubeCaptions" | "fetchYoutubeChannel" | "fetchYoutubeComments" | "fetchYoutubeVideo" | "generateChart" | "generateImage" | "generateLipsync" | "generateMusic" | "generatePdf" | "generateStaticVideoFromImage" | "generateVideo" | "getGmailAttachments" | "getGmailDraft" | "getGmailEmail" | "getGmailUnreadCount" | "getGoogleCalendarEvent" | "getGoogleDriveFile" | "getGoogleSheetInfo" | "getMediaMetadata" | "httpRequest" | "hubspotCreateCompany" | "hubspotCreateContact" | "hubspotGetCompany" | "hubspotGetContact" | "hunterApiCompanyEnrichment" | "hunterApiDomainSearch" | "hunterApiEmailFinder" | "hunterApiEmailVerification" | "hunterApiPersonEnrichment" | "imageFaceSwap" | "imageRemoveWatermark" | "insertVideoClips" | "listDataSources" | "listGmailDrafts" | "listGmailLabels" | "listGoogleCalendarEvents" | "listGoogleDriveFiles" | "listRecentGmailEmails" | "logic" | "makeDotComRunScenario" | "mergeAudio" | "mergeVideos" | "mixAudioIntoVideo" | "muteVideo" | "n8nRunNode" | "notionCreatePage" | "notionUpdatePage" | "peopleSearch" | "postToLinkedIn" | "postToSlackChannel" | "postToX" | "postToZapier" | "queryDataSource" | "queryExternalDatabase" | "redactPII" | "removeBackgroundFromImage" | "replyToGmailEmail" | "resizeVideo" | "runFromConnectorRegistry" | "runPackagedWorkflow" | "scrapeFacebookPage" | "scrapeFacebookPosts" | "scrapeInstagramComments" | "scrapeInstagramMentions" | "scrapeInstagramPosts" | "scrapeInstagramProfile" | "scrapeInstagramReels" | "scrapeLinkedInCompany" | "scrapeLinkedInProfile" | "scrapeMetaThreadsProfile" | "scrapeUrl" | "scrapeXPost" | "scrapeXProfile" | "searchGmailEmails" | "searchGoogle" | "searchGoogleCalendarEvents" | "searchGoogleDrive" | "searchGoogleImages" | "searchGoogleNews" | "searchGoogleTrends" | "searchPerplexity" | "searchXPosts" | "searchYoutube" | "searchYoutubeTrends" | "sendEmail" | "sendGmailDraft" | "sendGmailMessage" | "sendSMS" | "setGmailReadStatus" | "setRunTitle" | "setVariable" | "telegramEditMessage" | "telegramReplyToMessage" | "telegramSendAudio" | "telegramSendFile" | "telegramSendImage" | "telegramSendMessage" | "telegramSendVideo" | "telegramSetTyping" | "textToSpeech" | "transcribeAudio" | "trimMedia" | "updateGmailLabels" | "updateGoogleCalendarEvent" | "updateGoogleDoc" | "updateGoogleSheet" | "uploadDataSourceDocument" | "upscaleImage" | "upscaleVideo" | "userMessage" | "videoFaceSwap" | "videoRemoveBackground" | "videoRemoveWatermark" | "watermarkImage" | "watermarkVideo";
|
|
4620
|
+
type StepName = "activeCampaignAddNote" | "activeCampaignCreateContact" | "addSubtitlesToVideo" | "airtableCreateUpdateRecord" | "airtableDeleteRecord" | "airtableGetRecord" | "airtableGetTableRecords" | "analyzeImage" | "analyzeVideo" | "captureThumbnail" | "checkAppRole" | "codaCreateUpdatePage" | "codaCreateUpdateRow" | "codaFindRow" | "codaGetPage" | "codaGetTableRows" | "convertPdfToImages" | "createDataSource" | "createGmailDraft" | "createGoogleCalendarEvent" | "createGoogleDoc" | "createGoogleSheet" | "deleteDataSource" | "deleteDataSourceDocument" | "deleteGmailEmail" | "deleteGoogleCalendarEvent" | "deleteGoogleSheetRows" | "detectChanges" | "detectPII" | "discordEditMessage" | "discordSendFollowUp" | "discordSendMessage" | "downloadVideo" | "enhanceImageGenerationPrompt" | "enhanceVideoGenerationPrompt" | "enrichPerson" | "extractAudioFromVideo" | "extractText" | "fetchDataSourceDocument" | "fetchGoogleDoc" | "fetchGoogleSheet" | "fetchSlackChannelHistory" | "fetchYoutubeCaptions" | "fetchYoutubeChannel" | "fetchYoutubeComments" | "fetchYoutubeVideo" | "generateChart" | "generateImage" | "generateLipsync" | "generateMusic" | "generatePdf" | "generateStaticVideoFromImage" | "generateVideo" | "getGmailAttachments" | "getGmailDraft" | "getGmailEmail" | "getGmailUnreadCount" | "getGoogleCalendarEvent" | "getGoogleDriveFile" | "getGoogleSheetInfo" | "getMediaMetadata" | "httpRequest" | "hubspotCreateCompany" | "hubspotCreateContact" | "hubspotGetCompany" | "hubspotGetContact" | "hunterApiCompanyEnrichment" | "hunterApiDomainSearch" | "hunterApiEmailFinder" | "hunterApiEmailVerification" | "hunterApiPersonEnrichment" | "imageFaceSwap" | "imageRemoveWatermark" | "insertVideoClips" | "listDataSources" | "listGmailDrafts" | "listGmailLabels" | "listGoogleCalendarEvents" | "listGoogleDriveFiles" | "listRecentGmailEmails" | "logic" | "makeDotComRunScenario" | "mergeAudio" | "mergeVideos" | "mixAudioIntoVideo" | "muteVideo" | "n8nRunNode" | "notionCreatePage" | "notionUpdatePage" | "peopleSearch" | "postToLinkedIn" | "postToSlackChannel" | "postToX" | "postToZapier" | "queryAppDatabase" | "queryDataSource" | "queryExternalDatabase" | "redactPII" | "removeBackgroundFromImage" | "replyToGmailEmail" | "resizeVideo" | "runFromConnectorRegistry" | "runPackagedWorkflow" | "scrapeFacebookPage" | "scrapeFacebookPosts" | "scrapeInstagramComments" | "scrapeInstagramMentions" | "scrapeInstagramPosts" | "scrapeInstagramProfile" | "scrapeInstagramReels" | "scrapeLinkedInCompany" | "scrapeLinkedInProfile" | "scrapeMetaThreadsProfile" | "scrapeUrl" | "scrapeXPost" | "scrapeXProfile" | "searchGmailEmails" | "searchGoogle" | "searchGoogleCalendarEvents" | "searchGoogleDrive" | "searchGoogleImages" | "searchGoogleNews" | "searchGoogleTrends" | "searchPerplexity" | "searchXPosts" | "searchYoutube" | "searchYoutubeTrends" | "sendEmail" | "sendGmailDraft" | "sendGmailMessage" | "sendSMS" | "setGmailReadStatus" | "setRunTitle" | "setVariable" | "telegramEditMessage" | "telegramReplyToMessage" | "telegramSendAudio" | "telegramSendFile" | "telegramSendImage" | "telegramSendMessage" | "telegramSendVideo" | "telegramSetTyping" | "textToSpeech" | "transcribeAudio" | "trimMedia" | "updateGmailLabels" | "updateGoogleCalendarEvent" | "updateGoogleDoc" | "updateGoogleSheet" | "uploadDataSourceDocument" | "upscaleImage" | "upscaleVideo" | "userMessage" | "videoFaceSwap" | "videoRemoveBackground" | "videoRemoveWatermark" | "watermarkImage" | "watermarkVideo";
|
|
3854
4621
|
/** Maps step names to their input types. */
|
|
3855
4622
|
interface StepInputMap {
|
|
3856
4623
|
activeCampaignAddNote: ActiveCampaignAddNoteStepInput;
|
|
@@ -3863,6 +4630,7 @@ interface StepInputMap {
|
|
|
3863
4630
|
analyzeImage: AnalyzeImageStepInput;
|
|
3864
4631
|
analyzeVideo: AnalyzeVideoStepInput;
|
|
3865
4632
|
captureThumbnail: CaptureThumbnailStepInput;
|
|
4633
|
+
checkAppRole: CheckAppRoleStepInput;
|
|
3866
4634
|
codaCreateUpdatePage: CodaCreateUpdatePageStepInput;
|
|
3867
4635
|
codaCreateUpdateRow: CodaCreateUpdateRowStepInput;
|
|
3868
4636
|
codaFindRow: CodaFindRowStepInput;
|
|
@@ -3946,6 +4714,7 @@ interface StepInputMap {
|
|
|
3946
4714
|
postToSlackChannel: PostToSlackChannelStepInput;
|
|
3947
4715
|
postToX: PostToXStepInput;
|
|
3948
4716
|
postToZapier: PostToZapierStepInput;
|
|
4717
|
+
queryAppDatabase: QueryAppDatabaseStepInput;
|
|
3949
4718
|
queryDataSource: QueryDataSourceStepInput;
|
|
3950
4719
|
queryExternalDatabase: QueryExternalDatabaseStepInput;
|
|
3951
4720
|
redactPII: RedactPIIStepInput;
|
|
@@ -4022,6 +4791,7 @@ interface StepOutputMap {
|
|
|
4022
4791
|
analyzeImage: AnalyzeImageStepOutput;
|
|
4023
4792
|
analyzeVideo: AnalyzeVideoStepOutput;
|
|
4024
4793
|
captureThumbnail: CaptureThumbnailStepOutput;
|
|
4794
|
+
checkAppRole: CheckAppRoleStepOutput;
|
|
4025
4795
|
codaCreateUpdatePage: CodaCreateUpdatePageStepOutput;
|
|
4026
4796
|
codaCreateUpdateRow: CodaCreateUpdateRowStepOutput;
|
|
4027
4797
|
codaFindRow: CodaFindRowStepOutput;
|
|
@@ -4105,6 +4875,7 @@ interface StepOutputMap {
|
|
|
4105
4875
|
postToSlackChannel: PostToSlackChannelStepOutput;
|
|
4106
4876
|
postToX: PostToXStepOutput;
|
|
4107
4877
|
postToZapier: PostToZapierStepOutput;
|
|
4878
|
+
queryAppDatabase: QueryAppDatabaseStepOutput;
|
|
4108
4879
|
queryDataSource: QueryDataSourceStepOutput;
|
|
4109
4880
|
queryExternalDatabase: QueryExternalDatabaseStepOutput;
|
|
4110
4881
|
redactPII: RedactPIIStepOutput;
|
|
@@ -4350,6 +5121,24 @@ interface StepMethods {
|
|
|
4350
5121
|
* ```
|
|
4351
5122
|
*/
|
|
4352
5123
|
captureThumbnail(step: CaptureThumbnailStepInput, options?: StepExecutionOptions): Promise<StepExecutionResult<CaptureThumbnailStepOutput>>;
|
|
5124
|
+
/**
|
|
5125
|
+
* Check whether the current user has a specific app role and branch accordingly.
|
|
5126
|
+
*
|
|
5127
|
+
* @remarks
|
|
5128
|
+
* - Checks if the current user has been assigned a specific role in this app.
|
|
5129
|
+
* - If the user has the role, transitions to the "has role" path.
|
|
5130
|
+
* - If the user does not have the role, transitions to the "no role" path, or errors if no path is configured.
|
|
5131
|
+
* - Role names are defined by the app creator and assigned to users via the app roles system.
|
|
5132
|
+
* - The roleName field supports {{variables}} for dynamic role checks.
|
|
5133
|
+
*
|
|
5134
|
+
* @example
|
|
5135
|
+
* ```typescript
|
|
5136
|
+
* const result = await agent.checkAppRole({
|
|
5137
|
+
* roleName: ``,
|
|
5138
|
+
* });
|
|
5139
|
+
* ```
|
|
5140
|
+
*/
|
|
5141
|
+
checkAppRole(step: CheckAppRoleStepInput, options?: StepExecutionOptions): Promise<StepExecutionResult<CheckAppRoleStepOutput>>;
|
|
4353
5142
|
/**
|
|
4354
5143
|
* Create a new page or update an existing page in a Coda document.
|
|
4355
5144
|
*
|
|
@@ -5649,7 +6438,10 @@ interface StepMethods {
|
|
|
5649
6438
|
*
|
|
5650
6439
|
* @remarks
|
|
5651
6440
|
* - Requires a LinkedIn OAuth connection (connectionId).
|
|
5652
|
-
* - Supports text posts, image posts, and
|
|
6441
|
+
* - Supports text posts, image posts, video posts, document posts, and article posts.
|
|
6442
|
+
* - Attach one media type per post: image, video, document, or article.
|
|
6443
|
+
* - Documents support PDF, PPT, PPTX, DOC, DOCX (max 100MB, 300 pages). Displays as a slideshow carousel.
|
|
6444
|
+
* - Articles create a link preview with optional custom title, description, and thumbnail.
|
|
5653
6445
|
* - Visibility controls who can see the post.
|
|
5654
6446
|
*
|
|
5655
6447
|
* @example
|
|
@@ -5714,6 +6506,32 @@ interface StepMethods {
|
|
|
5714
6506
|
* ```
|
|
5715
6507
|
*/
|
|
5716
6508
|
postToZapier(step: PostToZapierStepInput, options?: StepExecutionOptions): Promise<StepExecutionResult<PostToZapierStepOutput>>;
|
|
6509
|
+
/**
|
|
6510
|
+
* Execute a SQL query against the app managed database.
|
|
6511
|
+
*
|
|
6512
|
+
* @remarks
|
|
6513
|
+
* - Executes raw SQL against a SQLite database managed by the app.
|
|
6514
|
+
* - For SELECT queries, returns rows as JSON.
|
|
6515
|
+
* - For INSERT/UPDATE/DELETE, returns the number of affected rows.
|
|
6516
|
+
* - Use {{variables}} directly in your SQL. By default they are automatically extracted
|
|
6517
|
+
* and passed as safe parameterized values (preventing SQL injection).
|
|
6518
|
+
* Example: INSERT INTO contacts (name, comment) VALUES ({{name}}, {{comment}})
|
|
6519
|
+
* - Full MindStudio handlebars syntax is supported, including helpers like {{json myVar}},
|
|
6520
|
+
* {{get myVar "$.path"}}, {{global.orgName}}, etc.
|
|
6521
|
+
* - Set parameterize to false for raw/dynamic SQL where variables are interpolated directly
|
|
6522
|
+
* into the query string. Use this when another step generates full or partial SQL, e.g.
|
|
6523
|
+
* a bulk INSERT with a precomputed VALUES list. The user is responsible for sanitization
|
|
6524
|
+
* when parameterize is false.
|
|
6525
|
+
*
|
|
6526
|
+
* @example
|
|
6527
|
+
* ```typescript
|
|
6528
|
+
* const result = await agent.queryAppDatabase({
|
|
6529
|
+
* databaseId: ``,
|
|
6530
|
+
* sql: ``,
|
|
6531
|
+
* });
|
|
6532
|
+
* ```
|
|
6533
|
+
*/
|
|
6534
|
+
queryAppDatabase(step: QueryAppDatabaseStepInput, options?: StepExecutionOptions): Promise<StepExecutionResult<QueryAppDatabaseStepOutput>>;
|
|
5717
6535
|
/**
|
|
5718
6536
|
* Search a vector data source (RAG) and return relevant document chunks.
|
|
5719
6537
|
*
|
|
@@ -6775,4 +7593,52 @@ declare const MindStudioAgent: {
|
|
|
6775
7593
|
new (options?: AgentOptions): MindStudioAgent;
|
|
6776
7594
|
};
|
|
6777
7595
|
|
|
6778
|
-
export { 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 BatchStepInput, type BatchStepResult, type CaptureThumbnailStepInput, type CaptureThumbnailStepOutput, 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 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 QueryDataSourceStepInput, type QueryDataSourceStepOutput, type QueryExternalDatabaseStepInput, type QueryExternalDatabaseStepOutput, type RedactPIIStepInput, type RedactPIIStepOutput, type RemoveBackgroundFromImageStepInput, type RemoveBackgroundFromImageStepOutput, type ReplyToGmailEmailStepInput, type ReplyToGmailEmailStepOutput, type ResizeVideoStepInput, type ResizeVideoStepOutput, 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 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 UploadDataSourceDocumentStepInput, type UploadDataSourceDocumentStepOutput, type UploadFileResult, type UpscaleImageStepInput, type UpscaleImageStepOutput, type UpscaleVideoStepInput, type UpscaleVideoStepOutput, 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, blockTypeAliases, monacoSnippets, stepMetadata };
|
|
7596
|
+
declare const mindstudio: MindStudioAgent;
|
|
7597
|
+
|
|
7598
|
+
/**
|
|
7599
|
+
* Top-level `auth` namespace bound to the default singleton.
|
|
7600
|
+
*
|
|
7601
|
+
* Provides the current user's identity and roles. Requires context
|
|
7602
|
+
* hydration before use — call `await mindstudio.ensureContext()` or
|
|
7603
|
+
* perform any `db` operation first.
|
|
7604
|
+
*
|
|
7605
|
+
* @example
|
|
7606
|
+
* ```ts
|
|
7607
|
+
* import { auth, Roles } from '@mindstudio-ai/agent';
|
|
7608
|
+
*
|
|
7609
|
+
* auth.requireRole(Roles.admin);
|
|
7610
|
+
* const admins = auth.getUsersByRole(Roles.admin);
|
|
7611
|
+
* ```
|
|
7612
|
+
*/
|
|
7613
|
+
declare const auth: AuthContext;
|
|
7614
|
+
/**
|
|
7615
|
+
* Top-level `db` namespace bound to the default singleton.
|
|
7616
|
+
*
|
|
7617
|
+
* Use `db.defineTable<T>(name)` to create typed collections. Table
|
|
7618
|
+
* definitions are lazy — no HTTP until you await a query. Context is
|
|
7619
|
+
* auto-hydrated on first query execution.
|
|
7620
|
+
*
|
|
7621
|
+
* @example
|
|
7622
|
+
* ```ts
|
|
7623
|
+
* import { db } from '@mindstudio-ai/agent';
|
|
7624
|
+
*
|
|
7625
|
+
* const Orders = db.defineTable<Order>('orders');
|
|
7626
|
+
* const active = await Orders.filter(o => o.status === 'active').take(10);
|
|
7627
|
+
* ```
|
|
7628
|
+
*/
|
|
7629
|
+
declare const db: Db;
|
|
7630
|
+
/**
|
|
7631
|
+
* Resolve a user ID to display info (name, email, profile picture).
|
|
7632
|
+
* Bound to the default singleton.
|
|
7633
|
+
*
|
|
7634
|
+
* @example
|
|
7635
|
+
* ```ts
|
|
7636
|
+
* import { resolveUser } from '@mindstudio-ai/agent';
|
|
7637
|
+
*
|
|
7638
|
+
* const user = await resolveUser(order.requestedBy);
|
|
7639
|
+
* if (user) console.log(user.name, user.email);
|
|
7640
|
+
* ```
|
|
7641
|
+
*/
|
|
7642
|
+
declare const resolveUser: (userId: string) => Promise<ResolvedUser | null>;
|
|
7643
|
+
|
|
7644
|
+
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 };
|