@mindstudio-ai/agent 0.1.99 → 0.1.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1479,6 +1479,11 @@ interface Db {
1479
1479
  * push, update, remove, removeAll, clear). Compiles them to SQL,
1480
1480
  * sends all in one batch request, and returns typed results.
1481
1481
  *
1482
+ * Only un-awaited Query/Mutation objects can be batched — their SQL is
1483
+ * compiled and bundled. A plain Promise has no SQL to extract, so it is
1484
+ * rejected at the type level (and would throw at runtime): pass
1485
+ * `Table.filter(...)`, not `await`ed results or wrapper functions.
1486
+ *
1482
1487
  * @example
1483
1488
  * ```ts
1484
1489
  * // Mixed reads and writes in one round trip
@@ -1489,13 +1494,20 @@ interface Db {
1489
1494
  * );
1490
1495
  * ```
1491
1496
  */
1492
- batch<A>(q1: PromiseLike<A>): Promise<[A]>;
1493
- batch<A, B>(q1: PromiseLike<A>, q2: PromiseLike<B>): Promise<[A, B]>;
1494
- batch<A, B, C>(q1: PromiseLike<A>, q2: PromiseLike<B>, q3: PromiseLike<C>): Promise<[A, B, C]>;
1495
- batch<A, B, C, D>(q1: PromiseLike<A>, q2: PromiseLike<B>, q3: PromiseLike<C>, q4: PromiseLike<D>): Promise<[A, B, C, D]>;
1496
- batch<A, B, C, D, E>(q1: PromiseLike<A>, q2: PromiseLike<B>, q3: PromiseLike<C>, q4: PromiseLike<D>, q5: PromiseLike<E>): Promise<[A, B, C, D, E]>;
1497
- batch(...queries: PromiseLike<unknown>[]): Promise<unknown[]>;
1497
+ batch<A>(q1: Batchable<A>): Promise<[A]>;
1498
+ batch<A, B>(q1: Batchable<A>, q2: Batchable<B>): Promise<[A, B]>;
1499
+ batch<A, B, C>(q1: Batchable<A>, q2: Batchable<B>, q3: Batchable<C>): Promise<[A, B, C]>;
1500
+ batch<A, B, C, D>(q1: Batchable<A>, q2: Batchable<B>, q3: Batchable<C>, q4: Batchable<D>): Promise<[A, B, C, D]>;
1501
+ batch<A, B, C, D, E>(q1: Batchable<A>, q2: Batchable<B>, q3: Batchable<C>, q4: Batchable<D>, q5: Batchable<E>): Promise<[A, B, C, D, E]>;
1502
+ batch(...queries: Batchable<unknown>[]): Promise<unknown[]>;
1498
1503
  }
1504
+ /**
1505
+ * An operation `db.batch()` can bundle: an un-awaited Query (read) or
1506
+ * Mutation (write). The batch executor compiles these to SQL — a plain
1507
+ * Promise carries no SQL and cannot be batched, which is why this is not
1508
+ * `PromiseLike`.
1509
+ */
1510
+ type Batchable<A> = Query<any, A> | Mutation<A>;
1499
1511
 
1500
1512
  /**
1501
1513
  * The `files` namespace — typed, private-by-default file storage for MindStudio
@@ -1551,6 +1563,311 @@ interface Files {
1551
1563
  defineStore(name: string, options?: DefineStoreOptions): Store;
1552
1564
  }
1553
1565
 
1566
+ /**
1567
+ * Jewels — agentic shadow companions for app methods.
1568
+ *
1569
+ * A jewel lives in `foo.jewel.ts` beside the method `foo.ts` it shadows. It
1570
+ * proposes what a careful teammate would have done — an input for the method
1571
+ * — without ever applying it: the method stays the only door for writes.
1572
+ *
1573
+ * ```ts
1574
+ * // updateIssue.jewel.ts
1575
+ * export default defineJewel(updateIssue, {
1576
+ * subject: ({ issueId }) => ({ issueId }),
1577
+ * propose: async ({ issueId }) => {
1578
+ * // arbitrary TS: reads via plain imports, model calls via runTask
1579
+ * return { input: { issueId, status: 'triaged' }, reasoning: '...' };
1580
+ * },
1581
+ * });
1582
+ * ```
1583
+ *
1584
+ * `defineJewel` returns a CALLABLE — the executor — with the config attached
1585
+ * as properties (the Express-app pattern). That shape is deliberate: the
1586
+ * platform's sandbox worker invokes one exported function per execution
1587
+ * frame (`mod[handlerName](params)`), so a jewel run is an ordinary
1588
+ * method-execution frame with zero worker or protocol changes. Dev tooling
1589
+ * calls the same function, so dev and production share one executor body,
1590
+ * versioned here in the SDK.
1591
+ *
1592
+ * Three run modes, discriminated by which key the caller provides:
1593
+ * - `{ humanInput }` — shadow mode. The subject is derived via the jewel's
1594
+ * projection (the human's decision fields never reach `propose`), and
1595
+ * `humanInput` doubles as ground truth for grading.
1596
+ * - `{ subject }` — eval / arrival mode. No human action exists yet, so the
1597
+ * record is ungraded (an arrival proposal is graded later, when the human
1598
+ * acts — see the grade mode below).
1599
+ * - `{ grade: { proposed, actual } }` — grade-only mode: deferred grading of
1600
+ * an earlier arrival proposal against the human's eventual action. Runs
1601
+ * the jewel's own `grade` (or the default deep-equal) and nothing else.
1602
+ *
1603
+ * The executor NEVER throws: a shadow run must never break anything. Author
1604
+ * code failing (`subject`/`propose`) is captured in the record's `error`;
1605
+ * `grade` failing softens to verdict `'skip'`.
1606
+ */
1607
+ /** Any app method a jewel can shadow: one JSON-serializable input, any result. */
1608
+ type JewelMethod = (input: any) => any;
1609
+ /**
1610
+ * The input type of the shadowed method. Guarded so a zero-parameter method
1611
+ * resolves to `undefined` instead of erroring on `Parameters<M>[0]`.
1612
+ */
1613
+ type JewelMethodInput<M extends JewelMethod> = Parameters<M> extends [] ? undefined : Parameters<M>[0];
1614
+ /**
1615
+ * What `propose` returns. `input: null` is abstention — a first-class,
1616
+ * graded outcome, not an error. Reasoning is most valuable on abstention.
1617
+ */
1618
+ interface JewelProposal<I> {
1619
+ input: I | null;
1620
+ reasoning: string;
1621
+ }
1622
+ interface JewelVerdict {
1623
+ verdict: 'agree' | 'disagree' | 'skip';
1624
+ notes?: string;
1625
+ }
1626
+ /**
1627
+ * Argument to a custom `grade`. `proposed` is null when the jewel abstained;
1628
+ * `actual` is always present — grading only happens in shadow mode, where
1629
+ * the human acted.
1630
+ */
1631
+ interface JewelGradeContext<I> {
1632
+ proposed: I | null;
1633
+ actual: I;
1634
+ }
1635
+ type MaybePromise<T> = T | Promise<T>;
1636
+ /**
1637
+ * Authoring config. Declare `subject` before `propose` — the subject type
1638
+ * is inferred from the projection's return and flows into `propose`'s
1639
+ * parameter.
1640
+ */
1641
+ interface JewelConfig<M extends JewelMethod, S> {
1642
+ /**
1643
+ * Projection: method input → subject. What the human was looking at,
1644
+ * never what they decided — this is what keeps the label out of the exam.
1645
+ */
1646
+ subject: (input: JewelMethodInput<M>) => S;
1647
+ /**
1648
+ * The proposal. Runs on the projection only; arbitrary TS (plain imports
1649
+ * for context, model calls via runTask). Throwing never propagates — it
1650
+ * becomes an `error` on the pair record.
1651
+ */
1652
+ propose: (subject: NoInfer<S>) => MaybePromise<JewelProposal<JewelMethodInput<M>>>;
1653
+ /**
1654
+ * The custom assertion. Omit for deep-equal on the method input. May be
1655
+ * async and call models. Throwing softens to verdict `'skip'`.
1656
+ *
1657
+ * Strict-safe field iteration, when grading only touched fields:
1658
+ * ```ts
1659
+ * grade: ({ proposed, actual }) => {
1660
+ * if (!proposed) return { verdict: 'disagree', notes: 'abstained' };
1661
+ * const keys = Object.keys(actual) as (keyof typeof actual)[];
1662
+ * const misses = keys.filter((k) => proposed[k] !== actual[k]);
1663
+ * return misses.length
1664
+ * ? { verdict: 'disagree', notes: misses.join(', ') }
1665
+ * : { verdict: 'agree' };
1666
+ * }
1667
+ * ```
1668
+ */
1669
+ grade?: (ctx: JewelGradeContext<JewelMethodInput<M>>) => MaybePromise<JewelVerdict>;
1670
+ }
1671
+ /**
1672
+ * Executor params — constructed by the platform (or dev tooling), exactly
1673
+ * one key. `?: never` on the other keys rejects passing more than one.
1674
+ */
1675
+ type JewelRunParams<I, S> = {
1676
+ humanInput: I;
1677
+ subject?: never;
1678
+ grade?: never;
1679
+ } | {
1680
+ subject: S;
1681
+ humanInput?: never;
1682
+ grade?: never;
1683
+ } | {
1684
+ grade: JewelGradeContext<I>;
1685
+ humanInput?: never;
1686
+ subject?: never;
1687
+ };
1688
+ /**
1689
+ * The versioned, JSON-serializable output of one jewel run — the row the
1690
+ * pair ledger stores. Values are kept verbatim, so method inputs must be
1691
+ * JSON-safe (they already crossed the wire as JSON in real use).
1692
+ */
1693
+ interface JewelPairRecord<I = unknown, S = unknown> {
1694
+ v: 1;
1695
+ /** `grade` records are consumed by the platform (verdict extracted from a
1696
+ * grade-only run) and never persisted as pair rows themselves. */
1697
+ mode: 'shadow' | 'eval' | 'grade';
1698
+ /** Absent only when the projection itself threw (shadow mode). */
1699
+ subject?: S;
1700
+ /** null = abstention. Absent when propose failed. */
1701
+ proposed?: I | null;
1702
+ /** Absent when propose failed. */
1703
+ reasoning?: string;
1704
+ /** The human's input — present in shadow mode. */
1705
+ actual?: I;
1706
+ /** Present iff graded (shadow or grade mode, propose succeeded). */
1707
+ verdict?: 'agree' | 'disagree' | 'skip';
1708
+ notes?: string;
1709
+ /** Present iff subject() or propose() threw. Grade errors become verdict 'skip'. */
1710
+ error?: {
1711
+ phase: 'subject' | 'propose';
1712
+ message: string;
1713
+ stack?: string;
1714
+ };
1715
+ /**
1716
+ * Whether this jewel declares a custom `grade`. The platform's deferred
1717
+ * grading dispatches a grade-mode run when true; when false it grades
1718
+ * locally with an equivalent of the default deep-equal (no sandbox trip
1719
+ * to evaluate a pure structural comparison).
1720
+ */
1721
+ customGrade: boolean;
1722
+ startedAt: number;
1723
+ durationMs: number;
1724
+ }
1725
+ /**
1726
+ * The export of a `foo.jewel.ts` file: the executor, callable as an
1727
+ * ordinary handler, with the authored config attached for the compiler and
1728
+ * dev tooling. `method` carries the actual function reference — reference
1729
+ * identity is what lets the compiler verify the manifest's method↔jewel
1730
+ * pairing against the code. `grade` is `undefined` when the default
1731
+ * deep-equal grade applies; presence is the custom-grade signal.
1732
+ */
1733
+ interface Jewel<M extends JewelMethod, S> {
1734
+ (params: JewelRunParams<JewelMethodInput<M>, S>): Promise<JewelPairRecord<JewelMethodInput<M>, S>>;
1735
+ readonly kind: 'jewel';
1736
+ readonly method: M;
1737
+ readonly subject: (input: JewelMethodInput<M>) => S;
1738
+ readonly propose: (subject: S) => MaybePromise<JewelProposal<JewelMethodInput<M>>>;
1739
+ readonly grade: ((ctx: JewelGradeContext<JewelMethodInput<M>>) => MaybePromise<JewelVerdict>) | undefined;
1740
+ }
1741
+ /**
1742
+ * What the platform did with a proposal, routed by the method's autonomy:
1743
+ * - `recorded` — shadow: proposal written to the pair ledger, graded later
1744
+ * against the human's eventual action (within the attribution window).
1745
+ * - `queued` — approve: waiting in the review queue.
1746
+ * - `committed` — auto: the jewel's proposal was applied (the method ran);
1747
+ * `output` carries the method's return value.
1748
+ * - `abstained` — the jewel chose not to act; recorded, still gradeable.
1749
+ * - `disabled` — the method has no jewel or autonomy is `manual`. Returned,
1750
+ * never thrown: dialing a method down must not break the app code that
1751
+ * proposes to it.
1752
+ * - `skipped` — dev session, jewel-descended recursion, or unsampled
1753
+ * (sampleRate).
1754
+ * - `failed` — an auto commit was attempted and the method rejected it
1755
+ * (e.g. the state was consumed concurrently). The moment stays pending.
1756
+ * - `pending` — a concurrent replay: the original propose for this
1757
+ * idempotencyKey is still mid-run. Treat as accepted.
1758
+ */
1759
+ type JewelProposeOutcome = 'recorded' | 'queued' | 'committed' | 'abstained' | 'disabled' | 'skipped' | 'failed' | 'pending';
1760
+ interface JewelProposeResult {
1761
+ outcome: JewelProposeOutcome;
1762
+ /** Present on `committed` — the method's return value. */
1763
+ output?: unknown;
1764
+ /** Present on `queued` — address the item via `jewels.queue.resolve`. */
1765
+ queueItemId?: string;
1766
+ }
1767
+ /** A pending approval-queue item awaiting a reviewer. */
1768
+ interface JewelQueueItem {
1769
+ id: string;
1770
+ methodId: string;
1771
+ subject: Record<string, unknown>;
1772
+ /** The method input the jewel proposes to apply. */
1773
+ proposed: unknown;
1774
+ reasoning: string | null;
1775
+ proposedAt: string;
1776
+ /** Unresolved items expire (verdict `expired`) at the attribution window. */
1777
+ expiresAt: string;
1778
+ }
1779
+ type JewelQueueResolution = 'approved' | 'edited' | 'dismissed';
1780
+ interface JewelQueueResolveResult {
1781
+ resolution: JewelQueueResolution;
1782
+ /** Present on approve — the applied method's return value. */
1783
+ output?: unknown;
1784
+ }
1785
+ interface JewelsApi {
1786
+ /**
1787
+ * Hand a decision moment to a method's jewel — the arrival-shaped trigger.
1788
+ * Place it where the app knows the moment was born (an ingest branch that
1789
+ * lands a row in its pending state). The platform routes by the method's
1790
+ * autonomy; see {@link JewelProposeOutcome}.
1791
+ *
1792
+ * `idempotencyKey` (Stripe semantics — a replayed key returns the ORIGINAL
1793
+ * outcome, so retried webhooks are invisible to this code) defaults to a
1794
+ * hash of the subject. Sibling proposals for one decision moment should
1795
+ * share a key so cross-verb grading can close them together.
1796
+ *
1797
+ * Backend/managed contexts only (rides the execution's hook token). Runs
1798
+ * the jewel synchronously — wrap chains in `mindstudio.waitUntil(...)` so
1799
+ * the calling method returns immediately:
1800
+ *
1801
+ * ```ts
1802
+ * mindstudio.waitUntil((async () => {
1803
+ * const merge = await mindstudio.jewels.propose(
1804
+ * 'merge-issues', { sourceId: issue.id }, { idempotencyKey: issue.id });
1805
+ * if (merge.outcome !== 'committed') {
1806
+ * await mindstudio.jewels.propose(
1807
+ * 'triage-issue', { issueId: issue.id }, { idempotencyKey: issue.id });
1808
+ * }
1809
+ * })());
1810
+ * ```
1811
+ */
1812
+ propose(methodId: string, subject: Record<string, unknown>, opts?: {
1813
+ idempotencyKey?: string;
1814
+ }): Promise<JewelProposeResult>;
1815
+ /**
1816
+ * The app-native approval queue for `approve`-mode methods. Build the
1817
+ * review UI in the app itself: a backend method lists items (gate it with
1818
+ * the app's reviewer role), the frontend renders the inbox, and a resolve
1819
+ * method approves or dismisses.
1820
+ */
1821
+ queue: {
1822
+ /** Pending items, oldest first. */
1823
+ list(opts?: {
1824
+ methodId?: string;
1825
+ limit?: number;
1826
+ }): Promise<{
1827
+ items: JewelQueueItem[];
1828
+ }>;
1829
+ /**
1830
+ * Resolve one item. `approve` APPLIES the target method as the current
1831
+ * session user — the reviewer — so the effect belongs to the human who
1832
+ * clicked, and the target method's own auth checks are the real gate on
1833
+ * who may approve. Pass `input` to apply an edited version of the
1834
+ * proposal (captured as resolution `edited` — proposed/edited/final ride
1835
+ * the pair record; the richest training signal). `dismiss` records the
1836
+ * rejection and closes the item without running anything; other verbs'
1837
+ * proposals for the same moment stay open.
1838
+ */
1839
+ resolve(itemId: string, opts: {
1840
+ action: 'approve' | 'dismiss';
1841
+ input?: Record<string, unknown>;
1842
+ }): Promise<JewelQueueResolveResult>;
1843
+ };
1844
+ }
1845
+ /**
1846
+ * Define a jewel — the agentic shadow companion for an app method.
1847
+ *
1848
+ * @example
1849
+ * ```ts
1850
+ * export default defineJewel(updateIssue, {
1851
+ * subject: ({ issueId }) => ({ issueId }),
1852
+ * propose: async ({ issueId }) => {
1853
+ * const issue = await resolveIssue(issueId);
1854
+ * if (!issue || issue.status !== 'new') {
1855
+ * return { input: null, reasoning: 'Nothing to propose.' };
1856
+ * }
1857
+ * // ...gather context, call a model via runTask + outputSchema...
1858
+ * return { input: { issueId, status: 'triaged' }, reasoning: '...' };
1859
+ * },
1860
+ * grade: async ({ proposed, actual }) => {
1861
+ * if (!proposed) return { verdict: 'disagree', notes: 'abstained' };
1862
+ * return proposed.status === actual.status
1863
+ * ? { verdict: 'agree' }
1864
+ * : { verdict: 'disagree' };
1865
+ * },
1866
+ * });
1867
+ * ```
1868
+ */
1869
+ declare function defineJewel<M extends JewelMethod, S>(method: M, config: JewelConfig<M, S>): Jewel<M, S>;
1870
+
1554
1871
  /** @internal Transport: `POST /_internal/v2/datasources/<op>` with the hook token. */
1555
1872
  type DataSourcesTransport = (op: string, body: unknown) => Promise<any>;
1556
1873
  /** Where a retrieved chunk came from — enough to show the user the source. */
@@ -2034,13 +2351,111 @@ interface Voice {
2034
2351
  }): Promise<VoiceCallResult>;
2035
2352
  }
2036
2353
 
2354
+ /**
2355
+ * JSON Schema support for task-agent structured output.
2356
+ *
2357
+ * The dialect is a deliberately bounded subset of JSON Schema — the shape
2358
+ * used for Anthropic tool `input_schema` / OpenAI function parameters:
2359
+ * `type` (including type arrays for nullability), `properties`, `required`,
2360
+ * `additionalProperties`, `items`, `enum`, `const`. Everything in this file
2361
+ * covers exactly that subset and nothing more, on both levels:
2362
+ *
2363
+ * - {@link FromSchema} maps a schema *value* to the TypeScript type it
2364
+ * describes (compile time).
2365
+ * - {@link validateAgainstSchema} checks a runtime value against the same
2366
+ * constructs (runtime).
2367
+ *
2368
+ * Keeping the two in one module is the point: what the type infers is what
2369
+ * the validator enforces. Schemas using keywords outside the subset are
2370
+ * rejected loudly by {@link assertSupportedSchema} rather than silently
2371
+ * half-enforced.
2372
+ */
2373
+ type JsonSchemaTypeName = 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
2374
+ /**
2375
+ * A schema in the supported dialect. Every position is readonly so inline
2376
+ * literals inferred via `const` type parameters (which produce readonly
2377
+ * tuples/objects) are assignable.
2378
+ */
2379
+ interface JsonSchema {
2380
+ readonly type?: JsonSchemaTypeName | readonly JsonSchemaTypeName[];
2381
+ readonly properties?: Readonly<Record<string, JsonSchema>>;
2382
+ readonly required?: readonly string[];
2383
+ readonly additionalProperties?: boolean;
2384
+ readonly items?: JsonSchema;
2385
+ readonly enum?: readonly (string | number | boolean | null)[];
2386
+ readonly const?: string | number | boolean | null;
2387
+ readonly description?: string;
2388
+ }
2389
+ /**
2390
+ * The root schema for task output must be an object schema. The literal
2391
+ * `type: 'object'` requirement also anchors overload resolution on
2392
+ * `runTask` — without it, nearly any object type would satisfy the schema
2393
+ * overload's constraint (every `JsonSchema` property is optional).
2394
+ */
2395
+ interface JsonObjectSchema extends JsonSchema {
2396
+ readonly type: 'object';
2397
+ readonly properties: Readonly<Record<string, JsonSchema>>;
2398
+ }
2399
+ /**
2400
+ * Infers the TypeScript type described by a schema literal.
2401
+ *
2402
+ * ```ts
2403
+ * const schema = {
2404
+ * type: 'object',
2405
+ * properties: {
2406
+ * action: { enum: ['approve', 'reject'] },
2407
+ * note: { type: ['string', 'null'] },
2408
+ * },
2409
+ * required: ['action'],
2410
+ * } as const satisfies JsonObjectSchema;
2411
+ *
2412
+ * type Out = FromSchema<typeof schema>;
2413
+ * // { action: 'approve' | 'reject'; note?: string | null }
2414
+ * ```
2415
+ */
2416
+ type FromSchema<S> = S extends {
2417
+ const: infer C;
2418
+ } ? C : S extends {
2419
+ enum: readonly (infer E)[];
2420
+ } ? E : S extends {
2421
+ type: readonly (infer TN extends JsonSchemaTypeName)[];
2422
+ } ? FromTypeName<TN, S> : S extends {
2423
+ type: infer TN extends JsonSchemaTypeName;
2424
+ } ? FromTypeName<TN, S> : unknown;
2425
+ /** Distributes over union type names, so `['string','null']` → `string | null`. */
2426
+ type FromTypeName<TN extends JsonSchemaTypeName, S> = (TN extends 'string' ? string : never) | (TN extends 'number' | 'integer' ? number : never) | (TN extends 'boolean' ? boolean : never) | (TN extends 'null' ? null : never) | (TN extends 'array' ? S extends {
2427
+ items: infer I;
2428
+ } ? FromSchema<I>[] : unknown[] : never) | (TN extends 'object' ? FromObjectSchema<S> : never);
2429
+ type RequiredKeys<S> = S extends {
2430
+ required: readonly (infer R extends string)[];
2431
+ } ? R : never;
2432
+ type FromObjectSchema<S> = S extends {
2433
+ properties: infer P;
2434
+ } ? Prettify<{
2435
+ [K in Extract<keyof P, RequiredKeys<S>>]: FromSchema<P[K]>;
2436
+ } & {
2437
+ [K in Exclude<keyof P, RequiredKeys<S>>]?: FromSchema<P[K]>;
2438
+ }> : Record<string, unknown>;
2439
+ /** Collapses the required/optional intersection into one readable object type. */
2440
+ type Prettify<T> = {
2441
+ [K in keyof T]: T[K];
2442
+ } & {};
2443
+ interface SchemaValidationError {
2444
+ /** JSONPath-style location, e.g. `$.items[2].severity`. */
2445
+ path: string;
2446
+ /** Human-readable problem, e.g. `expected one of "low" | "high", got "critical"`. */
2447
+ message: string;
2448
+ }
2449
+
2037
2450
  /**
2038
2451
  * Types for the task agent runtime.
2039
2452
  *
2040
2453
  * A task agent is a multi-step tool-use loop: the model receives a prompt
2041
2454
  * and a set of SDK actions as tools, calls them as needed, and produces
2042
- * structured output matching the developer's example.
2455
+ * structured output — validated against the developer's `outputSchema`, or
2456
+ * shaped by a `structuredOutputExample`.
2043
2457
  */
2458
+
2044
2459
  /**
2045
2460
  * Tool configuration for {@link RunTaskOptions.tools}.
2046
2461
  * - String: SDK method name (e.g. `'searchGoogle'`).
@@ -2065,16 +2480,14 @@ type TaskToolConfig = string | {
2065
2480
  description?: string;
2066
2481
  defaults?: Record<string, unknown>;
2067
2482
  };
2068
- /** Options for {@link MindStudioAgent.runTask}. */
2069
- interface RunTaskOptions {
2483
+ /** Options shared by both output modes of {@link MindStudioAgent.runTask}. */
2484
+ interface RunTaskOptionsBase {
2070
2485
  /** System prompt — defines the agent's behavior and approach. */
2071
2486
  prompt: string;
2072
2487
  /** Structured input for this task instance. Passed as the user message. */
2073
2488
  input: Record<string, unknown>;
2074
2489
  /** SDK actions and/or app methods to make available as tools. */
2075
2490
  tools: TaskToolConfig[];
2076
- /** Expected output shape. Pass a JSON string or an object (will be stringified automatically). */
2077
- structuredOutputExample: string | Record<string, unknown>;
2078
2491
  /** Model ID for the task agent. Must support tool use. */
2079
2492
  model: string;
2080
2493
  /** Max loop iterations before forcing final output. Default 20, max 100. */
@@ -2090,6 +2503,32 @@ interface RunTaskOptions {
2090
2503
  */
2091
2504
  onEvent?: (event: TaskEvent) => void;
2092
2505
  }
2506
+ /**
2507
+ * Example mode: the output shape is suggested by example only. `output` is
2508
+ * whatever `JSON.parse` produced (or the raw string when
2509
+ * `parsedSuccessfully` is false) — callers must validate it themselves.
2510
+ */
2511
+ interface RunTaskOptionsWithExample extends RunTaskOptionsBase {
2512
+ /** Expected output shape. Pass a JSON string or an object (will be stringified automatically). */
2513
+ structuredOutputExample: string | Record<string, unknown>;
2514
+ outputSchema?: never;
2515
+ }
2516
+ /**
2517
+ * Schema mode: the output contract is a plain JSON Schema (the Anthropic
2518
+ * tool `input_schema` dialect subset — type/properties/required/enum/items,
2519
+ * nullability via type arrays like `['string', 'null']`). Output is
2520
+ * validated every turn with automatic repair, `result.output` is typed by
2521
+ * inference from the schema value, and `runTask` either returns conforming
2522
+ * output or throws (`task_output_schema_mismatch`) — it never resolves with
2523
+ * garbage.
2524
+ */
2525
+ interface RunTaskOptionsWithSchema<S extends JsonObjectSchema = JsonObjectSchema> extends RunTaskOptionsBase {
2526
+ /** Plain JSON Schema for the output. Root must be `type: 'object'`. */
2527
+ outputSchema: S;
2528
+ structuredOutputExample?: never;
2529
+ }
2530
+ /** Options for {@link MindStudioAgent.runTask} — one of the two output modes. */
2531
+ type RunTaskOptions = RunTaskOptionsWithExample | RunTaskOptionsWithSchema;
2093
2532
  /** An event from a streaming task agent execution. */
2094
2533
  interface TaskEvent {
2095
2534
  type: 'text' | 'thinking' | 'thinking_complete' | 'tool_use' | 'tool_input_delta' | 'tool_input_args' | 'tool_call_start' | 'tool_call_result' | 'error' | 'done';
@@ -2248,13 +2687,19 @@ declare class MindStudioAgent$1 {
2248
2687
  /**
2249
2688
  * Run a task agent — a multi-step tool-use loop that composes SDK actions
2250
2689
  * to produce structured output. The model receives the prompt and tools,
2251
- * calls actions as needed, and returns JSON matching the output example.
2690
+ * calls actions as needed, and returns structured JSON.
2252
2691
  *
2253
2692
  * Tools can be SDK actions, your own app's methods, or both. App methods run
2254
2693
  * as the user who invoked the method that started the task, with their roles.
2255
2694
  *
2695
+ * Prefer `outputSchema` (plain JSON Schema, tool-definition dialect):
2696
+ * output is validated every turn with automatic repair, `result.output` is
2697
+ * typed by inference from the schema — no generic argument, no manual
2698
+ * validation — and the call either returns conforming output or throws
2699
+ * (`task_output_schema_mismatch`).
2700
+ *
2256
2701
  * ```ts
2257
- * const result = await agent.runTask<{ name: string; url: string }>({
2702
+ * const result = await agent.runTask({
2258
2703
  * prompt: 'Find canonical info for this restaurant, then save it.',
2259
2704
  * input: { restaurantName: 'Tartine Bakery SF' },
2260
2705
  * tools: [
@@ -2262,13 +2707,26 @@ declare class MindStudioAgent$1 {
2262
2707
  * 'fetchUrl',
2263
2708
  * { appMethod: 'saveRestaurant', description: 'Persist the researched restaurant.' },
2264
2709
  * ],
2265
- * structuredOutputExample: JSON.stringify({ name: 'Tartine Bakery', url: 'https://tartinebakery.com' }),
2710
+ * outputSchema: {
2711
+ * type: 'object',
2712
+ * properties: {
2713
+ * name: { type: 'string' },
2714
+ * url: { type: ['string', 'null'] },
2715
+ * kind: { enum: ['bakery', 'cafe', 'restaurant'] },
2716
+ * },
2717
+ * required: ['name', 'kind'],
2718
+ * },
2266
2719
  * model: 'claude-4-6-sonnet',
2267
2720
  * });
2268
- * console.log(result.output.name); // 'Tartine Bakery'
2721
+ * result.output.kind; // typed as 'bakery' | 'cafe' | 'restaurant'
2269
2722
  * ```
2723
+ *
2724
+ * The legacy alternative, `structuredOutputExample`, shapes output by
2725
+ * example only: `output` is typed by the caller's generic argument and
2726
+ * must be validated manually (check `parsedSuccessfully` first).
2270
2727
  */
2271
- runTask<T = unknown>(options: RunTaskOptions): Promise<RunTaskResult<T>>;
2728
+ runTask<const S extends JsonObjectSchema>(options: RunTaskOptionsWithSchema<S>): Promise<RunTaskResult<FromSchema<S>>>;
2729
+ runTask<T = unknown>(options: RunTaskOptionsWithExample): Promise<RunTaskResult<T>>;
2272
2730
  /**
2273
2731
  * Register background work with the platform so the sandbox stays alive
2274
2732
  * until it settles (bounded at ~30 minutes) instead of being reaped as
@@ -2495,6 +2953,17 @@ declare class MindStudioAgent$1 {
2495
2953
  * ```
2496
2954
  */
2497
2955
  get files(): Files;
2956
+ /**
2957
+ * Jewel surfaces: arrival-shaped triggers (`propose`) and the app-native
2958
+ * approval queue (`queue.list` / `queue.resolve`). See {@link JewelsApi}.
2959
+ */
2960
+ get jewels(): JewelsApi;
2961
+ /**
2962
+ * Raw hook-token call shared by the jewels surfaces (mirrors reportIssue).
2963
+ * No retries: propose holds the request for the jewel run and is idempotent
2964
+ * by key anyway; resolve applies a method and must never double-fire.
2965
+ */
2966
+ private _jewelsRequest;
2498
2967
  /**
2499
2968
  * Searchable document corpora.
2500
2969
  *
@@ -5379,10 +5848,10 @@ interface ScrapeUrlStepInput {
5379
5848
  url: string;
5380
5849
  /** Scraping service to use */
5381
5850
  service?: "default" | "firecrawl";
5382
- /** Whether to enable enhanced scraping for social media URLs (e.g. Twitter, LinkedIn) */
5851
+ /** No longer selects a provider — the default service's anti-bot engine decides per request how hard to work. Retained because existing workflows set it and the builder still renders it. */
5383
5852
  autoEnhance?: boolean;
5384
- /** Output format: text returns markdown, html returns raw HTML, json returns structured scraper data */
5385
- outputFormat?: "text" | "json" | "html";
5853
+ /** Output format: text returns markdown, html returns raw HTML, json returns structured scraper data, summary returns a model-written summary (Firecrawl only) */
5854
+ outputFormat?: "text" | "json" | "html" | "summary";
5386
5855
  /** Page-level scraping options (content filtering, screenshots, headers, etc.) */
5387
5856
  pageOptions?: {
5388
5857
  /** Whether to extract only the main content of the page, excluding navigation, footers, etc. */
@@ -5428,6 +5897,12 @@ interface ScrapeUrlStepOutput {
5428
5897
  code: string;
5429
5898
  message: string;
5430
5899
  };
5900
+ /**
5901
+ * What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.
5902
+ *
5903
+ * Includes every attempt made on the caller's behalf, not just the last one.
5904
+ */
5905
+ costUnits?: number;
5431
5906
  } | {
5432
5907
  /** Markdown/plain-text content of the scraped page */
5433
5908
  text: string;
@@ -5453,6 +5928,12 @@ interface ScrapeUrlStepOutput {
5453
5928
  code: string;
5454
5929
  message: string;
5455
5930
  };
5931
+ /**
5932
+ * What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.
5933
+ *
5934
+ * Includes every attempt made on the caller's behalf, not just the last one.
5935
+ */
5936
+ costUnits?: number;
5456
5937
  }[];
5457
5938
  /** Screenshot URL(s), only present when a screenshot was captured */
5458
5939
  screenshot?: string | string[];
@@ -5488,6 +5969,12 @@ interface ScrapeXPostStepOutput {
5488
5969
  code: string;
5489
5970
  message: string;
5490
5971
  };
5972
+ /**
5973
+ * What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.
5974
+ *
5975
+ * Includes every attempt made on the caller's behalf, not just the last one.
5976
+ */
5977
+ costUnits?: number;
5491
5978
  };
5492
5979
  }
5493
5980
  interface ScrapeXProfileStepInput {
@@ -5521,6 +6008,12 @@ interface ScrapeXProfileStepOutput {
5521
6008
  code: string;
5522
6009
  message: string;
5523
6010
  };
6011
+ /**
6012
+ * What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.
6013
+ *
6014
+ * Includes every attempt made on the caller's behalf, not just the last one.
6015
+ */
6016
+ costUnits?: number;
5524
6017
  };
5525
6018
  }
5526
6019
  interface ScreenshotUrlStepInput {
@@ -8764,8 +9257,9 @@ interface StepMethods {
8764
9257
  *
8765
9258
  * @remarks
8766
9259
  * - Accepts a single URL or multiple URLs (as a JSON array, comma-separated, or newline-separated).
8767
- * - Output format controls the result shape: "text" returns markdown, "html" returns raw HTML, "json" returns structured scraper data.
9260
+ * - Output format controls the result shape: "text" returns markdown, "html" returns raw HTML, "json" returns structured scraper data, "summary" returns a model-written summary and requires the "firecrawl" service.
8768
9261
  * - Can optionally capture a screenshot of each page.
9262
+ * - Handles bot protection automatically; no proxy or rendering configuration is needed.
8769
9263
  *
8770
9264
  * @example
8771
9265
  * ```typescript
@@ -8811,8 +9305,11 @@ interface StepMethods {
8811
9305
  * @remarks
8812
9306
  * - Takes a viewport or full-page screenshot of the given URL.
8813
9307
  * - Returns a CDN-hosted PNG image URL.
8814
- * - Viewport mode captures only the visible area; fullPage captures the entire scrollable page.
8815
- * - You can customize viewport width/height, add a delay, or wait for a CSS selector before capturing.
9308
+ * - Viewport mode captures only the visible area; fullPage captures the entire scrollable page, scrolling it first so lazy-loaded content is included.
9309
+ * - Works on sites behind bot protection (Cloudflare and similar).
9310
+ * - Cookie-consent banners and similar overlays are suppressed automatically.
9311
+ * - `width` and `height` are the exact output pixel dimensions.
9312
+ * - You can add a delay or wait for a CSS selector before capturing. A selector that never appears fails the step rather than capturing early.
8816
9313
  *
8817
9314
  * @example
8818
9315
  * ```typescript
@@ -10009,4 +10506,4 @@ declare const prerender: {
10009
10506
  }>;
10010
10507
  };
10011
10508
 
10012
- 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 AuthTableConfig, 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 DefineStoreOptions, 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 FileAccess, type Files, type Generate3dModelStepInput, type Generate3dModelStepOutput, 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 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 ListOptions, type ListRecentGmailEmailsStepInput, type ListRecentGmailEmailsStepOutput, type LogicStepInput, type LogicStepOutput, type MakeDotComRunScenarioStepInput, type MakeDotComRunScenarioStepOutput, type MergeAudioStepInput, type MergeAudioStepOutput, type MergeVideosStepInput, type MergeVideosStepOutput, type MeshyAnimateStepInput, type MeshyAnimateStepOutput, type MeshyImageTo3dStepInput, type MeshyImageTo3dStepOutput, type MeshyRemeshStepInput, type MeshyRemeshStepOutput, type MeshyRigStepInput, type MeshyRigStepOutput, type MeshyTextTo3dStepInput, type MeshyTextTo3dStepOutput, type MeshyTextureStepInput, type MeshyTextureStepOutput, 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 PackagedWorkflow, type PackagedWorkflowInput, type PackagedWorkflowSignature, type ParticlePodcastsFindMentionsStepInput, type ParticlePodcastsFindMentionsStepOutput, type ParticlePodcastsGetEpisodeStepInput, type ParticlePodcastsGetEpisodeStepOutput, type ParticlePodcastsGetEpisodeTranscriptStepInput, type ParticlePodcastsGetEpisodeTranscriptStepOutput, type ParticlePodcastsSearchCompaniesStepInput, type ParticlePodcastsSearchCompaniesStepOutput, type ParticlePodcastsSearchDialogueStepInput, type ParticlePodcastsSearchDialogueStepOutput, type ParticlePodcastsSearchPodcastsStepInput, type ParticlePodcastsSearchPodcastsStepOutput, type PeopleSearchStepInput, type PeopleSearchStepOutput, type PostToLinkedInStepInput, type PostToLinkedInStepOutput, type PostToSlackChannelStepInput, type PostToSlackChannelStepOutput, type PostToXStepInput, type PostToXStepOutput, type PostToZapierStepInput, type PostToZapierStepOutput, type Predicate, type PushInput, type PutOptions, 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 ReportIssueInput, type ReportedIssue, type RequestContext, type ResizeVideoStepInput, type ResizeVideoStepOutput, type ResolvedUser, Roles, type RunAgentOptions, type RunAgentResult, type RunFromConnectorRegistryStepInput, type RunFromConnectorRegistryStepOutput, type RunPackagedWorkflowStepInput, type RunPackagedWorkflowStepOutput, type RunTaskOptions, type RunTaskResult, type ScrapeLinkedInCompanyStepInput, type ScrapeLinkedInCompanyStepOutput, type ScrapeLinkedInProfileStepInput, type ScrapeLinkedInProfileStepOutput, type ScrapeUrlStepInput, type ScrapeUrlStepOutput, type ScrapeXPostStepInput, type ScrapeXPostStepOutput, type ScrapeXProfileStepInput, type ScrapeXProfileStepOutput, type ScreenshotUrlStepInput, type ScreenshotUrlStepOutput, 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 SendSlackDirectMessageStepInput, type SendSlackDirectMessageStepOutput, type SessionContext, type SetGmailReadStatusStepInput, type SetGmailReadStatusStepOutput, type SetRunTitleStepInput, type SetRunTitleStepOutput, type SetVariableStepInput, type SetVariableStepOutput, type StepCostEstimateEntry, type StepExecutionMeta, type StepExecutionOptions, type StepExecutionResult, type StepInputMap, type StepLogEvent, type StepMetadata, type StepMethods, type StepName, type StepOutputMap, Store, type StoredFile, type SystemFields, Table, type TaskEvent, type TaskToolCall, type TaskToolConfig, type TaskUsage, 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 UploadToken, 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 Voice, type VoiceCallResult, type WatermarkImageStepInput, type WatermarkImageStepOutput, type WatermarkVideoStepInput, type WatermarkVideoStepOutput, type YouDotComFinanceResearchStepInput, type YouDotComFinanceResearchStepOutput, type YouDotComGetPageContentStepInput, type YouDotComGetPageContentStepOutput, type YouDotComLiveNewsStepInput, type YouDotComLiveNewsStepOutput, type YouDotComWebResearchStepInput, type YouDotComWebResearchStepOutput, type YouDotComWebSearchStepInput, type YouDotComWebSearchStepOutput, auth, blockTypeAliases, dataSources, db, mindstudio as default, files, getRequestContext, mindstudio, monacoSnippets, prerender, reportIssue, resolveUser, runWithContext, session, stepMetadata, stream, voice, waitUntil };
10509
+ 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 AuthTableConfig, type BatchStepInput, type BatchStepResult, type Batchable, 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 DefineStoreOptions, 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 FileAccess, type Files, type FromSchema, type Generate3dModelStepInput, type Generate3dModelStepOutput, 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 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 Jewel, type JewelConfig, type JewelGradeContext, type JewelMethod, type JewelMethodInput, type JewelPairRecord, type JewelProposal, type JewelProposeOutcome, type JewelProposeResult, type JewelQueueItem, type JewelQueueResolution, type JewelQueueResolveResult, type JewelRunParams, type JewelVerdict, type JewelsApi, type JsonObjectSchema, type JsonSchema, type JsonSchemaTypeName, type ListAgentsResult, type ListDataSourcesStepInput, type ListDataSourcesStepOutput, type ListGmailDraftsStepInput, type ListGmailDraftsStepOutput, type ListGmailLabelsStepInput, type ListGmailLabelsStepOutput, type ListGoogleCalendarEventsStepInput, type ListGoogleCalendarEventsStepOutput, type ListGoogleDriveFilesStepInput, type ListGoogleDriveFilesStepOutput, type ListOptions, type ListRecentGmailEmailsStepInput, type ListRecentGmailEmailsStepOutput, type LogicStepInput, type LogicStepOutput, type MakeDotComRunScenarioStepInput, type MakeDotComRunScenarioStepOutput, type MergeAudioStepInput, type MergeAudioStepOutput, type MergeVideosStepInput, type MergeVideosStepOutput, type MeshyAnimateStepInput, type MeshyAnimateStepOutput, type MeshyImageTo3dStepInput, type MeshyImageTo3dStepOutput, type MeshyRemeshStepInput, type MeshyRemeshStepOutput, type MeshyRigStepInput, type MeshyRigStepOutput, type MeshyTextTo3dStepInput, type MeshyTextTo3dStepOutput, type MeshyTextureStepInput, type MeshyTextureStepOutput, 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 PackagedWorkflow, type PackagedWorkflowInput, type PackagedWorkflowSignature, type ParticlePodcastsFindMentionsStepInput, type ParticlePodcastsFindMentionsStepOutput, type ParticlePodcastsGetEpisodeStepInput, type ParticlePodcastsGetEpisodeStepOutput, type ParticlePodcastsGetEpisodeTranscriptStepInput, type ParticlePodcastsGetEpisodeTranscriptStepOutput, type ParticlePodcastsSearchCompaniesStepInput, type ParticlePodcastsSearchCompaniesStepOutput, type ParticlePodcastsSearchDialogueStepInput, type ParticlePodcastsSearchDialogueStepOutput, type ParticlePodcastsSearchPodcastsStepInput, type ParticlePodcastsSearchPodcastsStepOutput, type PeopleSearchStepInput, type PeopleSearchStepOutput, type PostToLinkedInStepInput, type PostToLinkedInStepOutput, type PostToSlackChannelStepInput, type PostToSlackChannelStepOutput, type PostToXStepInput, type PostToXStepOutput, type PostToZapierStepInput, type PostToZapierStepOutput, type Predicate, type PushInput, type PutOptions, 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 ReportIssueInput, type ReportedIssue, type RequestContext, type ResizeVideoStepInput, type ResizeVideoStepOutput, type ResolvedUser, Roles, type RunAgentOptions, type RunAgentResult, type RunFromConnectorRegistryStepInput, type RunFromConnectorRegistryStepOutput, type RunPackagedWorkflowStepInput, type RunPackagedWorkflowStepOutput, type RunTaskOptions, type RunTaskOptionsWithExample, type RunTaskOptionsWithSchema, type RunTaskResult, type SchemaValidationError, type ScrapeLinkedInCompanyStepInput, type ScrapeLinkedInCompanyStepOutput, type ScrapeLinkedInProfileStepInput, type ScrapeLinkedInProfileStepOutput, type ScrapeUrlStepInput, type ScrapeUrlStepOutput, type ScrapeXPostStepInput, type ScrapeXPostStepOutput, type ScrapeXProfileStepInput, type ScrapeXProfileStepOutput, type ScreenshotUrlStepInput, type ScreenshotUrlStepOutput, 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 SendSlackDirectMessageStepInput, type SendSlackDirectMessageStepOutput, type SessionContext, type SetGmailReadStatusStepInput, type SetGmailReadStatusStepOutput, type SetRunTitleStepInput, type SetRunTitleStepOutput, type SetVariableStepInput, type SetVariableStepOutput, type StepCostEstimateEntry, type StepExecutionMeta, type StepExecutionOptions, type StepExecutionResult, type StepInputMap, type StepLogEvent, type StepMetadata, type StepMethods, type StepName, type StepOutputMap, Store, type StoredFile, type SystemFields, Table, type TaskEvent, type TaskToolCall, type TaskToolConfig, type TaskUsage, 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 UploadToken, 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 Voice, type VoiceCallResult, type WatermarkImageStepInput, type WatermarkImageStepOutput, type WatermarkVideoStepInput, type WatermarkVideoStepOutput, type YouDotComFinanceResearchStepInput, type YouDotComFinanceResearchStepOutput, type YouDotComGetPageContentStepInput, type YouDotComGetPageContentStepOutput, type YouDotComLiveNewsStepInput, type YouDotComLiveNewsStepOutput, type YouDotComWebResearchStepInput, type YouDotComWebResearchStepOutput, type YouDotComWebSearchStepInput, type YouDotComWebSearchStepOutput, auth, blockTypeAliases, dataSources, db, mindstudio as default, defineJewel, files, getRequestContext, mindstudio, monacoSnippets, prerender, reportIssue, resolveUser, runWithContext, session, stepMetadata, stream, voice, waitUntil };