@mindstudio-ai/agent 0.1.138 → 0.1.140

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
@@ -1966,7 +1966,7 @@ interface JewelGradeContext<I> {
1966
1966
  proposed: I | null;
1967
1967
  actual: I;
1968
1968
  }
1969
- type MaybePromise$1<T> = T | Promise<T>;
1969
+ type MaybePromise$2<T> = T | Promise<T>;
1970
1970
  /**
1971
1971
  * Authoring config. Declare `subject` before `propose` — the subject type
1972
1972
  * is inferred from the projection's return and flows into `propose`'s
@@ -1983,7 +1983,7 @@ interface JewelConfig<M extends JewelMethod, S> {
1983
1983
  * for context, model calls via runTask). Throwing never propagates — it
1984
1984
  * becomes an `error` on the pair record.
1985
1985
  */
1986
- propose: (subject: NoInfer<S>) => MaybePromise$1<JewelProposal<JewelMethodInput<M>>>;
1986
+ propose: (subject: NoInfer<S>) => MaybePromise$2<JewelProposal<JewelMethodInput<M>>>;
1987
1987
  /**
1988
1988
  * The custom assertion. Omit for deep-equal on the method input. May be
1989
1989
  * async and call models. Throwing softens to verdict `'skip'`.
@@ -2000,7 +2000,7 @@ interface JewelConfig<M extends JewelMethod, S> {
2000
2000
  * }
2001
2001
  * ```
2002
2002
  */
2003
- grade?: (ctx: JewelGradeContext<JewelMethodInput<M>>) => MaybePromise$1<JewelVerdict>;
2003
+ grade?: (ctx: JewelGradeContext<JewelMethodInput<M>>) => MaybePromise$2<JewelVerdict>;
2004
2004
  }
2005
2005
  /**
2006
2006
  * Executor params — constructed by the platform (or dev tooling), exactly
@@ -2077,8 +2077,8 @@ interface Jewel<M extends JewelMethod, S> {
2077
2077
  readonly kind: 'jewel';
2078
2078
  readonly method: M;
2079
2079
  readonly subject: (input: JewelMethodInput<M>) => S;
2080
- readonly propose: (subject: S) => MaybePromise$1<JewelProposal<JewelMethodInput<M>>>;
2081
- readonly grade: ((ctx: JewelGradeContext<JewelMethodInput<M>>) => MaybePromise$1<JewelVerdict>) | undefined;
2080
+ readonly propose: (subject: S) => MaybePromise$2<JewelProposal<JewelMethodInput<M>>>;
2081
+ readonly grade: ((ctx: JewelGradeContext<JewelMethodInput<M>>) => MaybePromise$2<JewelVerdict>) | undefined;
2082
2082
  }
2083
2083
  /**
2084
2084
  * What the platform did with a proposal, routed by the method's autonomy:
@@ -2297,6 +2297,14 @@ interface SearchFilter {
2297
2297
  filename?: string | string[];
2298
2298
  /** Restrict to specific documents (ids from {@link DataSource.documents}). */
2299
2299
  documentIds?: string[];
2300
+ /**
2301
+ * Passages about any of these entities: the ids their documents assert
2302
+ * ({@link AddOptions.entities}) or their text mentions by a name in the
2303
+ * source's dictionary ({@link DataSource.pushDictionary}). Up to 256; the
2304
+ * usual shape is a neighbourhood your own tables walked out to, then
2305
+ * searched.
2306
+ */
2307
+ entities?: string[];
2300
2308
  /** Page range, inclusive — for paged formats like PDF. */
2301
2309
  pages?: {
2302
2310
  min?: number;
@@ -2324,6 +2332,21 @@ interface SearchExplain {
2324
2332
  lexical: BranchPosition | null;
2325
2333
  matchedVia: 'dense' | 'lexical' | 'both';
2326
2334
  }
2335
+ /** One passage of a listing ({@link DataSource.passages}): a search hit without the ranking. */
2336
+ interface DataSourcePassage {
2337
+ /** The chunk, prefixed with its heading path for context. */
2338
+ text: string;
2339
+ /** The ids the passage carries: its document's, and those its text names from the dictionary. */
2340
+ entities: string[];
2341
+ citation: Citation;
2342
+ }
2343
+ /** A page of {@link DataSource.passages}. */
2344
+ interface DataSourcePassagePage {
2345
+ passages: DataSourcePassage[];
2346
+ /** Pass back for the next page; null after the last. */
2347
+ nextCursor: string | null;
2348
+ latencyMs: number;
2349
+ }
2327
2350
  interface SearchHit {
2328
2351
  /**
2329
2352
  * Relevance of this hit. Comparable within a response, not across them —
@@ -2338,6 +2361,13 @@ interface SearchHit {
2338
2361
  score: number;
2339
2362
  /** The matched chunk, prefixed with its heading path for context. */
2340
2363
  text: string;
2364
+ /**
2365
+ * The entities this passage carries (its document's asserted ids, and the
2366
+ * ids its text names from the source's dictionary), so you can widen from
2367
+ * what you found: walk your own tables out from them, then search again
2368
+ * with {@link SearchFilter.entities}. Empty when none.
2369
+ */
2370
+ entities: string[];
2341
2371
  citation: Citation;
2342
2372
  /**
2343
2373
  * Where retrieval put this hit BEFORE reranking, and what it scored.
@@ -2502,6 +2532,17 @@ interface AddOptions {
2502
2532
  * re-processing; supplying metadata replaces the whole object.
2503
2533
  */
2504
2534
  metadata?: DocumentMetadata;
2535
+ /**
2536
+ * The things this document is about, as your own ids (a tag number, a row
2537
+ * id): up to 256, each 1–128 printable ASCII characters without whitespace
2538
+ * or commas. Every passage of the document carries them, so
2539
+ * {@link SearchFilter.entities} finds passages about an entity and
2540
+ * {@link DataSource.entities} counts them. Metadata is facts about the
2541
+ * document to filter by; entities are what its passages are about.
2542
+ * Re-adding the same bytes with different entities updates them in place;
2543
+ * supplying them replaces the whole set, and `[]` clears it.
2544
+ */
2545
+ entities?: string[];
2505
2546
  }
2506
2547
  /** What {@link DataSource.add} returns. */
2507
2548
  interface AddResult {
@@ -2531,6 +2572,8 @@ interface DataSourceDocument {
2531
2572
  pageCount: number | null;
2532
2573
  /** Tags set at add time. See {@link AddOptions.metadata}. */
2533
2574
  metadata: DocumentMetadata | null;
2575
+ /** Entities the document asserts, sorted. See {@link AddOptions.entities}. */
2576
+ entities: string[];
2534
2577
  createdAt: string;
2535
2578
  ingestedAt: string | null;
2536
2579
  }
@@ -2558,6 +2601,8 @@ interface DataSourceChunk {
2558
2601
  bottomRightX: number;
2559
2602
  bottomRightY: number;
2560
2603
  };
2604
+ /** The entities this chunk carries, as search hits report them. */
2605
+ entities: string[];
2561
2606
  /** base64 of a Float32Array. Only when `vectors: true` was passed. */
2562
2607
  vector?: string;
2563
2608
  }
@@ -2646,6 +2691,8 @@ interface DataSourceJobPlan {
2646
2691
  errorShare: number;
2647
2692
  deleteShare: number;
2648
2693
  secondsPerObject: number;
2694
+ /** What the mapper's own model and step calls billed per sampled object. */
2695
+ creditsPerObject?: number;
2649
2696
  } | null;
2650
2697
  projected: {
2651
2698
  documents: number;
@@ -2655,6 +2702,8 @@ interface DataSourceJobPlan {
2655
2702
  embedding: number;
2656
2703
  extraction: number;
2657
2704
  contextual: number;
2705
+ /** Mapped sources: the mapper's own calls over every object, the sample's included. */
2706
+ mapping?: number;
2658
2707
  total: number;
2659
2708
  };
2660
2709
  };
@@ -2671,7 +2720,8 @@ interface DataSourceJobPlan {
2671
2720
  }
2672
2721
  /**
2673
2722
  * A bulk ingestion job — a sync, a corpus load started from the CLI, a remap
2674
- * of a mapped source's raw copies, or a replay of an earlier job's quarantine.
2723
+ * of a mapped source's raw copies, a replay of an earlier job's quarantine, or
2724
+ * a reread of the source's documents by its reader.
2675
2725
  */
2676
2726
  interface DataSourceJob {
2677
2727
  id: string;
@@ -2697,17 +2747,41 @@ interface DataSourceJob {
2697
2747
  type: 'replay';
2698
2748
  fromJobId: string;
2699
2749
  kind: 'skip' | 'error' | null;
2750
+ } | {
2751
+ type: 'reread';
2752
+ unread: boolean;
2700
2753
  };
2701
- /** Objects the mapper skipped or failed on (mapped sources; zero otherwise). */
2754
+ /**
2755
+ * Objects the mapper skipped or failed on, and documents the reader failed
2756
+ * on; null where the job was read from a list.
2757
+ */
2702
2758
  quarantine: {
2703
2759
  skipped: number;
2704
2760
  errors: number;
2705
- };
2761
+ readErrors: number;
2762
+ } | null;
2706
2763
  plan: DataSourceJobPlan | null;
2707
2764
  /** The ceiling this job pauses at, in dollars; null when none was set. */
2708
2765
  budgetDollars: number | null;
2709
- /** Model spend so far at catalog rates — an estimate, not the ledger. */
2766
+ /**
2767
+ * Spend so far: embedding, extraction and contextual at catalog rates, plus
2768
+ * what the mapper's own calls billed. An estimate, not the ledger; the
2769
+ * budget pauses the job on it.
2770
+ */
2710
2771
  estimatedDollars: number;
2772
+ /**
2773
+ * The mapper's and reader's own calls' part of `estimatedDollars`, the
2774
+ * plan's sample included.
2775
+ */
2776
+ mapperDollars?: number;
2777
+ /**
2778
+ * A running job's read stage on a source with a reader: documents read of
2779
+ * those its builds handed the reader. A reread counts its reads in `counts`.
2780
+ */
2781
+ reading?: {
2782
+ documentsRead: number;
2783
+ documentsTotal: number;
2784
+ } | null;
2711
2785
  counts: {
2712
2786
  objectsSeen: number;
2713
2787
  documentsDone: number;
@@ -2724,14 +2798,81 @@ interface DataSourceJob {
2724
2798
  error: string | null;
2725
2799
  /**
2726
2800
  * Why a running job stopped: the owner, the budget, repeated batch
2727
- * failures, or (mapped sources) a skip share far above the plan's.
2801
+ * failures, (mapped sources) a skip share far above the plan's, or
2802
+ * (sources with a reader) a reader failing on far more documents than it
2803
+ * did at first.
2728
2804
  */
2729
- pauseReason: 'user' | 'budget' | 'errors' | 'skips' | null;
2805
+ pauseReason: 'user' | 'budget' | 'errors' | 'skips' | 'reader' | null;
2730
2806
  stalled: boolean;
2731
2807
  createdAt: string;
2732
2808
  startedAt: string | null;
2733
2809
  finishedAt: string | null;
2734
2810
  }
2811
+ /**
2812
+ * One entry of a source's dictionary: your own id for a thing and the names
2813
+ * it goes by, as your tables have them. A projection of your data, pushed
2814
+ * whole after each load; the platform never reads your database.
2815
+ */
2816
+ interface DictionaryEntry {
2817
+ /** An entity id: 1–128 printable ASCII, no whitespace or commas. */
2818
+ id: string;
2819
+ /**
2820
+ * 1–16 names, each up to 256 characters: a tag number, a model name, an
2821
+ * alias. Matched however a tag's separators and case are written, as whole
2822
+ * words; a name needs three letters or digits (two in Chinese, Japanese or
2823
+ * Korean).
2824
+ */
2825
+ names: string[];
2826
+ }
2827
+ /** A committed dictionary version: what a push reports, and what a source reads back. */
2828
+ interface DictionaryReport {
2829
+ version: number;
2830
+ /** The matching rule its names were keyed under, carried from push to push. */
2831
+ linkerVersion: number;
2832
+ entries: number;
2833
+ names: number;
2834
+ /** Names more than one id claims: a passage naming one is tagged with every claimant. */
2835
+ ambiguousNames: number;
2836
+ /**
2837
+ * The names the most ids claim: `name` as you pushed it (one of them, when
2838
+ * several fold alike), `key` as the linker matches it (folded, separators
2839
+ * dropped), and how many ids claim it.
2840
+ */
2841
+ mostClaimed: {
2842
+ key: string;
2843
+ name?: string;
2844
+ ids: number;
2845
+ }[];
2846
+ /**
2847
+ * Names that can't match their own text as written, since a gap in them
2848
+ * doesn't join (`Line 3, Unit 2`): fix these in your source data.
2849
+ */
2850
+ unmatchable: {
2851
+ count: number;
2852
+ examples: string[];
2853
+ };
2854
+ committedAt: string;
2855
+ }
2856
+ /** What `pushDictionary` returns. */
2857
+ interface DictionaryPushResult extends DictionaryReport {
2858
+ /** The dictionary was the one already committed: no new version, no relink. */
2859
+ unchanged: boolean;
2860
+ }
2861
+ /**
2862
+ * A relink in flight: the source's passages re-tagged against a newer
2863
+ * dictionary version, in place, as a background walk. Searches keep working
2864
+ * throughout; passages not yet reached carry the previous version's ids.
2865
+ */
2866
+ interface DictionaryRelink {
2867
+ version: number;
2868
+ lap: number;
2869
+ /** Documents walked this lap, of `total`. */
2870
+ walked: number;
2871
+ total: number;
2872
+ /** Why it's holding, when it is (the source's dedicated capacity is off). */
2873
+ waiting: string | null;
2874
+ error: string | null;
2875
+ }
2735
2876
  /**
2736
2877
  * A typed handle to one data source. Lazy — nothing executes until a method is
2737
2878
  * awaited, so it's safe to `defineDataSource()` at module scope and import the
@@ -2830,6 +2971,68 @@ declare class DataSource {
2830
2971
  chunks: number;
2831
2972
  latencyMs: number;
2832
2973
  }>;
2974
+ /**
2975
+ * Which entities the passages matching a filter are about, most first.
2976
+ *
2977
+ * Filter on one entity (`{ entities: ['P-101A'] }`) and the answer is what
2978
+ * appears beside it: a co-mention graph for free. Filter on a date range and
2979
+ * it is who or what was written about then. No filter covers the corpus.
2980
+ * `chunks` is how many matching passages carry each id, not documents: a
2981
+ * long document's passages each count. Approximate counts, ordered most
2982
+ * first; `limit` defaults to 20, at most 1,000. One document's entities:
2983
+ * `{ filter: { documentIds: [id] } }`.
2984
+ *
2985
+ * Shares the search rate limit (300/minute per app), and shows the same
2986
+ * `index_warming` / `index_building` as search while a corpus loads.
2987
+ */
2988
+ entities(options?: {
2989
+ filter?: SearchFilter;
2990
+ limit?: number;
2991
+ }): Promise<{
2992
+ entities: {
2993
+ id: string;
2994
+ chunks: number;
2995
+ }[];
2996
+ latencyMs: number;
2997
+ }>;
2998
+ /**
2999
+ * Push this source's dictionary: every entity id you have and the names it
3000
+ * goes by, replacing the dictionary it had. From then on every passage is
3001
+ * tagged with the ids whose names its text mentions, beside the ones its
3002
+ * document asserts, so `filter.entities` and {@link entities} find a tag
3003
+ * wherever it's written. Passages indexed before are re-tagged in the
3004
+ * background (a relink; see {@link dictionary}), and nothing is
3005
+ * re-embedded.
3006
+ *
3007
+ * Push it whole after each load of the tables it comes from: an unchanged
3008
+ * dictionary commits nothing (`unchanged: true`). Takes an array or any
3009
+ * (async) iterable, and sends it in pages, so a register of a quarter of a
3010
+ * million entries is fine. A repeated id merges its names.
3011
+ */
3012
+ pushDictionary(entries: Iterable<DictionaryEntry> | AsyncIterable<DictionaryEntry>, options?: {
3013
+ linkerVersion?: number;
3014
+ }): Promise<DictionaryPushResult>;
3015
+ /**
3016
+ * The source's current dictionary, or null when none was pushed, and the
3017
+ * relink re-tagging its passages while one runs.
3018
+ */
3019
+ dictionary(): Promise<{
3020
+ dictionary: DictionaryReport | null;
3021
+ relink: DictionaryRelink | null;
3022
+ }>;
3023
+ /**
3024
+ * What the current dictionary finds in a piece of text: each mention, in
3025
+ * order, with the ids it tags. How to check a dictionary before relying on
3026
+ * it. `version` is null when the source has none. Shares the search rate
3027
+ * limit.
3028
+ */
3029
+ link(text: string): Promise<{
3030
+ version: number | null;
3031
+ mentions: {
3032
+ ids: string[];
3033
+ text: string;
3034
+ }[];
3035
+ }>;
2833
3036
  /**
2834
3037
  * Every chunk of one document, exactly as it was indexed.
2835
3038
  *
@@ -2893,6 +3096,38 @@ declare class DataSource {
2893
3096
  limit?: number;
2894
3097
  order?: 'oldest' | 'newest';
2895
3098
  }): Promise<DataSourceDocumentPage>;
3099
+ /**
3100
+ * One page of the passages matching a filter, unranked: every page that
3101
+ * mentions an asset (`{ entities: ['P-1004A'] }`), every passage holding a
3102
+ * phrase, every chunk of some documents. Where {@link search} ranks and
3103
+ * stops at its top results and {@link count} gives a number, this lists
3104
+ * them all. Passages come document by document, each document's in order;
3105
+ * pass `nextCursor` back for the next page, which is null after the last.
3106
+ * `limit` defaults to 50, at most 200.
3107
+ *
3108
+ * Shares the search rate limit (300/minute per app), and shows the same
3109
+ * `index_warming` / `index_building` as search while a corpus loads.
3110
+ */
3111
+ passages(options?: {
3112
+ filter?: SearchFilter;
3113
+ cursor?: string | null;
3114
+ limit?: number;
3115
+ }): Promise<DataSourcePassagePage>;
3116
+ /**
3117
+ * Every passage matching a filter, a page at a time behind the scenes: the
3118
+ * walk over {@link passages}. Each page counts against the search rate
3119
+ * limit, so a large walk belongs in a background task.
3120
+ *
3121
+ * ```ts
3122
+ * for await (const passage of Manuals.allPassages({ entities: ['P-1004A'] })) {
3123
+ * mentions.push({ asset: 'P-1004A', ...passage.citation });
3124
+ * }
3125
+ * ```
3126
+ */
3127
+ allPassages(filter?: SearchFilter, options?: {
3128
+ /** Passages per page, at most 200 (the default). */
3129
+ pageSize?: number;
3130
+ }): AsyncGenerator<DataSourcePassage, void, undefined>;
2896
3131
  /**
2897
3132
  * Every document in the corpus, oldest first, a page at a time behind the
2898
3133
  * scenes. This is how an app builds its own view of a large corpus (a
@@ -11423,8 +11658,9 @@ declare function runWithContext<T>(ctx: RequestContext, fn: () => T | Promise<T>
11423
11658
  * One object in, one of four outcomes out:
11424
11659
  * - `documents([...])` — the object becomes these documents (an array is
11425
11660
  * one object → many). Each is `{ externalId, title, markdown, metadata?,
11426
- * replaces? }`; `externalId` is the identity the platform replaces by.
11427
- * - `passthrough({ metadata? })` — ingest the raw object itself through
11661
+ * entities?, replaces? }`; `externalId` is the identity the platform
11662
+ * replaces by.
11663
+ * - `passthrough({ metadata?, entities? })` — ingest the raw object itself through
11428
11664
  * built-in extraction, as an unmapped source would. What lets a mapped
11429
11665
  * source still accept a PDF.
11430
11666
  * - `skip(reason)` — not a document. Quarantined on the job with the reason;
@@ -11466,6 +11702,8 @@ interface MapObject {
11466
11702
  lastModified: string | null;
11467
11703
  /** Metadata the origin supplied (a manifest line's `metadata`), or null. */
11468
11704
  metadata: DocumentMetadata | null;
11705
+ /** Entities the origin supplied (a manifest line's, an `add()`'s), or null. */
11706
+ entities: string[] | null;
11469
11707
  bytes(): Promise<Uint8Array>;
11470
11708
  text(): Promise<string>;
11471
11709
  json<T = unknown>(): Promise<T>;
@@ -11483,6 +11721,12 @@ interface MappedDocument {
11483
11721
  markdown: string;
11484
11722
  /** Scalars only, up to 16 keys — see `AddOptions.metadata`. */
11485
11723
  metadata?: DocumentMetadata;
11724
+ /**
11725
+ * What the document is about, as your own ids — see `AddOptions.entities`.
11726
+ * A record that names its subject (a work order's asset, a story's people)
11727
+ * says so here, whether or not its text does.
11728
+ */
11729
+ entities?: string[];
11486
11730
  /** External ids this document replaces (a writethru's original id). */
11487
11731
  replaces?: string | string[];
11488
11732
  }
@@ -11492,6 +11736,7 @@ type MapOutcome = {
11492
11736
  } | {
11493
11737
  kind: 'passthrough';
11494
11738
  metadata?: DocumentMetadata;
11739
+ entities?: string[];
11495
11740
  } | {
11496
11741
  kind: 'skip';
11497
11742
  reason: string;
@@ -11499,10 +11744,10 @@ type MapOutcome = {
11499
11744
  kind: 'deletes';
11500
11745
  externalIds: string[];
11501
11746
  };
11502
- type MaybePromise<T> = T | Promise<T>;
11747
+ type MaybePromise$1<T> = T | Promise<T>;
11503
11748
  interface MapperConfig {
11504
11749
  /** One raw object in; an outcome out. Throwing is the object's `error` outcome. */
11505
- map: (object: MapObject) => MaybePromise<MapOutcome>;
11750
+ map: (object: MapObject) => MaybePromise$1<MapOutcome>;
11506
11751
  }
11507
11752
  /** One object as the platform hands it to the executor: metadata plus a read URL. */
11508
11753
  interface MapRunObject {
@@ -11512,6 +11757,8 @@ interface MapRunObject {
11512
11757
  etag: string | null;
11513
11758
  lastModified: string | null;
11514
11759
  metadata: DocumentMetadata | null;
11760
+ /** Absent from a platform that predates entities. */
11761
+ entities?: string[] | null;
11515
11762
  /** Short-lived read URL for the object's bytes. */
11516
11763
  url: string;
11517
11764
  /**
@@ -11560,9 +11807,13 @@ interface Mapper {
11560
11807
  }
11561
11808
  /** The object becomes these documents. One document may be passed bare. */
11562
11809
  declare function documents(list: MappedDocument | MappedDocument[]): MapOutcome;
11563
- /** Ingest the raw object itself through built-in extraction. */
11810
+ /**
11811
+ * Ingest the raw object itself through built-in extraction. `metadata` and
11812
+ * `entities`, when given, replace what the origin supplied.
11813
+ */
11564
11814
  declare function passthrough(options?: {
11565
11815
  metadata?: DocumentMetadata;
11816
+ entities?: string[];
11566
11817
  }): MapOutcome;
11567
11818
  /** Not a document. Quarantined with the reason. */
11568
11819
  declare function skip(reason: string): MapOutcome;
@@ -11576,6 +11827,176 @@ declare function defineMapper(source: {
11576
11827
  readonly name: string;
11577
11828
  }, config: MapperConfig): Mapper;
11578
11829
 
11830
+ /**
11831
+ * Readers — customer code run over every document a data source builds.
11832
+ *
11833
+ * A mapper is app code on the way in (a raw object becomes documents) and
11834
+ * must be pure. A READER is app code on the way out: once a document is
11835
+ * built, its reader reads it and writes what it found into the app's own
11836
+ * tables. Writing is its purpose. It is how an app discovers what its
11837
+ * documents say: which equipment a passage names, what relations it states,
11838
+ * which people it quotes, as the app's own domain defines them.
11839
+ *
11840
+ * ```ts
11841
+ * // datasources/manuals.reader.ts
11842
+ * export default defineReader(Manuals, {
11843
+ * read: async (document) => {
11844
+ * const found = await extractRelations(await document.chunks());
11845
+ * await Evidence.removeAll((r, $) => r.documentId === $.id, { id: document.id });
11846
+ * await Evidence.push(found.map((f) => ({ ...f, documentId: document.id, sourceId: document.sourceId })));
11847
+ * },
11848
+ * removed: async (documentId) => {
11849
+ * await Evidence.removeAll((r, $) => r.documentId === $.id, { id: documentId });
11850
+ * },
11851
+ * cleared: async (sourceId) => {
11852
+ * await Evidence.removeAll((r, $) => r.sourceId === $.id, { id: sourceId });
11853
+ * },
11854
+ * });
11855
+ * ```
11856
+ *
11857
+ * The one rule: **a reader may be called more than once for the same
11858
+ * document, so it replaces that document's rows as a set, and deletes them on
11859
+ * `removed`.** Deliveries are level-triggered: the platform says only that a
11860
+ * document changed and reads its state when it delivers, so a document built
11861
+ * and removed before its delivery is one `removed`, and the app's rows always
11862
+ * end on what the corpus holds.
11863
+ *
11864
+ * - `read(document)` — a document arrived: its first build on the source's
11865
+ * active version. Never for index maintenance (a rebuild, a relink, a
11866
+ * re-vectorize) or an in-place metadata change: the reader is about what the
11867
+ * text says, and the app already knows what it asserted.
11868
+ * - `removed(documentId)` — the document is gone. Only the id: removal clears
11869
+ * what named the document.
11870
+ * - `cleared(sourceId)` — the whole source was deleted, once, so the app can
11871
+ * drop that source's rows in one statement. Optional.
11872
+ * - `relinked(document)` — a document already read was re-tagged by a new
11873
+ * dictionary: its passages carry different entities, its text is the same.
11874
+ * For rows derived from the tags. Optional.
11875
+ * A throw fails that delivery; the platform retries it. `document.bytes()`
11876
+ * reads the file the document came from, for a reader that needs the drawing
11877
+ * itself rather than its text.
11878
+ *
11879
+ * A reader runs against the app's LIVE release (or the dev session under
11880
+ * `reader test --dev`), never a pinned one: app databases are per release, so
11881
+ * a reader bound to a superseded release would write where nobody reads. It
11882
+ * is whatever live declares, and activates by publishing.
11883
+ *
11884
+ * Declared in `mindstudio.json`, beside or instead of a mapper:
11885
+ * ```json
11886
+ * "dataSources": [{ "slug": "manuals", "reader": { "path": "dist/datasources/manuals.reader.ts" } }]
11887
+ * ```
11888
+ */
11889
+
11890
+ /** A built document, as `read` receives it. */
11891
+ interface ReaderDocument {
11892
+ id: string;
11893
+ /** The data source it belongs to: key your rows by it for `cleared`. */
11894
+ sourceId: string;
11895
+ filename: string | null;
11896
+ contentType: string | null;
11897
+ /** The identity a mapped source replaces by; null on unmapped sources. */
11898
+ externalId: string | null;
11899
+ metadata: DocumentMetadata | null;
11900
+ /** The entities the document asserts, sorted. */
11901
+ entities: string[];
11902
+ pageCount: number | null;
11903
+ chunkCount: number | null;
11904
+ createdAt: string;
11905
+ /**
11906
+ * A short-lived link to the file the document came from: the uploaded
11907
+ * file, or on a mapped source the raw object the mapper read. Valid for the
11908
+ * delivery; null when the file is no longer kept.
11909
+ */
11910
+ url: string | null;
11911
+ /**
11912
+ * The document's passages as indexed: text, page, heading path, and each
11913
+ * passage's entities (its document's asserted ones and those its text
11914
+ * names from the source's dictionary). Read once, then held.
11915
+ */
11916
+ chunks(): Promise<DataSourceChunk[]>;
11917
+ /** The bytes behind {@link url}: a drawing's image, a PDF's pages. Read once, then held. */
11918
+ bytes(): Promise<Uint8Array>;
11919
+ }
11920
+ type MaybePromise<T> = T | Promise<T>;
11921
+ interface ReaderConfig {
11922
+ read: (document: ReaderDocument) => MaybePromise<void>;
11923
+ removed: (documentId: string) => MaybePromise<void>;
11924
+ cleared?: (sourceId: string) => MaybePromise<void>;
11925
+ /**
11926
+ * A document already read was re-tagged: the source's dictionary changed,
11927
+ * and its passages' entities with it. The document arrives as `read` gets
11928
+ * it, chunks and all, carrying the new entities, so rows derived from the
11929
+ * tags (links from assets to documents) can follow. Nothing about the text
11930
+ * changed, so this is no reason to extract again. Optional: without it a
11931
+ * relink delivers nothing.
11932
+ */
11933
+ relinked?: (document: ReaderDocument) => MaybePromise<void>;
11934
+ }
11935
+ type DocumentDelivery = {
11936
+ document: Omit<ReaderDocument, 'chunks' | 'bytes'>;
11937
+ /** The passages, when the platform carried them inline. */
11938
+ chunks?: DataSourceChunk[];
11939
+ };
11940
+ /** One delivery as the platform hands it to the executor. */
11941
+ type ReadDelivery = ({
11942
+ kind: 'read';
11943
+ } & DocumentDelivery) | ({
11944
+ kind: 'relinked';
11945
+ } & DocumentDelivery) | {
11946
+ kind: 'removed';
11947
+ documentId: string;
11948
+ } | {
11949
+ kind: 'cleared';
11950
+ sourceId: string;
11951
+ };
11952
+ interface ReadRunParams {
11953
+ v: 1;
11954
+ deliveries: ReadDelivery[];
11955
+ /** Per-delivery budget, in milliseconds. */
11956
+ timeoutMs?: number;
11957
+ /** Deliveries run at once inside the frame. */
11958
+ concurrency?: number;
11959
+ }
11960
+ interface ReadRunResult {
11961
+ /** The document id, or the source id for `cleared`. */
11962
+ ref: string;
11963
+ kind: ReadDelivery['kind'];
11964
+ ok: boolean;
11965
+ error?: {
11966
+ message: string;
11967
+ stack?: string;
11968
+ };
11969
+ durationMs: number;
11970
+ }
11971
+ /** What one executor call returns: one result per delivery, in order. */
11972
+ interface ReadRunRecord {
11973
+ v: 1;
11974
+ source: string;
11975
+ outcomes: ReadRunResult[];
11976
+ /** The optional hooks this reader defines, so the platform sends only what one handles. */
11977
+ hooks: {
11978
+ relinked: boolean;
11979
+ };
11980
+ startedAt: number;
11981
+ durationMs: number;
11982
+ }
11983
+ /** The callable executor with its config attached. */
11984
+ interface Reader {
11985
+ (params: ReadRunParams): Promise<ReadRunRecord>;
11986
+ readonly kind: 'reader';
11987
+ /** The data source's slug. */
11988
+ readonly source: string;
11989
+ readonly config: ReaderConfig;
11990
+ }
11991
+ /**
11992
+ * Define a reader — the code that reads every document a data source builds
11993
+ * into the app's own tables. See the module doc for the contract.
11994
+ */
11995
+ declare function defineReader(source: {
11996
+ readonly name: string;
11997
+ chunks(documentId: string): Promise<DataSourceChunk[]>;
11998
+ }, config: ReaderConfig): Reader;
11999
+
11579
12000
  type MonacoSnippetFieldType = 'string' | 'number' | 'boolean' | 'array' | 'object' | string[];
11580
12001
  type MonacoSnippetField = [name: string, type: MonacoSnippetFieldType];
11581
12002
  interface MonacoSnippet {
@@ -11860,4 +12281,4 @@ declare const prerender: {
11860
12281
  }>;
11861
12282
  };
11862
12283
 
11863
- export { type Accessor, type ActiveCampaignAddNoteStepInput, type ActiveCampaignAddNoteStepOutput, type ActiveCampaignCreateContactStepInput, type ActiveCampaignCreateContactStepOutput, type AddSubtitlesToVideoStepInput, type AddSubtitlesToVideoStepOutput, type AgentInfo, type AgentOptions, type AggregateRow, type AggregateSelect, type AggregateTerm, type AiSourceVendor, type AirtableCreateUpdateRecordStepInput, type AirtableCreateUpdateRecordStepOutput, type AirtableDeleteRecordStepInput, type AirtableDeleteRecordStepOutput, type AirtableGetRecordStepInput, type AirtableGetRecordStepOutput, type AirtableGetTableRecordsStepInput, type AirtableGetTableRecordsStepOutput, type Analytics, type AnalyticsDateRange, type AnalyticsDimension, type AnalyticsFilter, type AnalyticsFilterOp, type AnalyticsGranularity, type AnalyticsMetric, type AnalyticsQueryResponse, type AnalyticsQueryResultRow, type AnalyticsQuerySpec, type AnalyticsReadOptions, 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 CrawlerBucket, type CrawlerHit, type CrawlerOverview, type CreateDataSourceStepInput, type CreateDataSourceStepOutput, type CreateGmailDraftStepInput, type CreateGmailDraftStepOutput, type CreateGoogleCalendarEventStepInput, type CreateGoogleCalendarEventStepOutput, type CreateGoogleDocStepInput, type CreateGoogleDocStepOutput, type CreateGoogleSheetStepInput, type CreateGoogleSheetStepOutput, type Db, type DecomposeImageStepInput, type DecomposeImageStepOutput, 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 DownloadVideoStepInput, type DownloadVideoStepOutput, type EnhanceImageGenerationPromptStepInput, type EnhanceImageGenerationPromptStepOutput, type EnhanceVideoGenerationPromptStepInput, type EnhanceVideoGenerationPromptStepOutput, type EnrichPersonStepInput, type EnrichPersonStepOutput, type EventGrantOptions, type EventGrantResult, type Events, 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 GenerateImageStepInput, type GenerateImageStepOutput, type GenerateLipsyncStepInput, type GenerateLipsyncStepOutput, type GenerateMusicStepInput, type GenerateMusicStepOutput, type GeneratePdfStepInput, type GeneratePdfStepOutput, type GenerateSoundStepInput, type GenerateSoundStepOutput, 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 LiveNow, type LogicStepInput, type LogicStepOutput, MAX_EVENT_PAYLOAD_CHARS, type MakeDotComRunScenarioStepInput, type MakeDotComRunScenarioStepOutput, type MapObject, type MapOutcome, type MapPoint, type MapRunObject, type MapRunOutcome, type MapRunParams, type MapRunRecord, type MapRunResult, type MappedDocument, type Mapper, type MapperConfig, 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 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 QueryDataSourceStepInput, type QueryDataSourceStepOutput, type QueryExternalDatabaseStepInput, type QueryExternalDatabaseStepOutput, type QuickbooksApiRequestStepInput, type QuickbooksApiRequestStepOutput, RawQuery, 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 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 TextToSpeechStepInput, type TextToSpeechStepOutput, type TopSource, type TranscribeAudioStepInput, type TranscribeAudioStepOutput, type TrimMediaStepInput, type TrimMediaStepOutput, type TypesafeEvaluateStepInput, type TypesafeEvaluateStepOutput, 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, analytics, auth, blockTypeAliases, dataSources, db, mindstudio as default, defineJewel, defineMapper, deletes, documents, email, events, files, getRequestContext, mindstudio, monacoSnippets, passthrough, prerender, reportIssue, resolveUser, runWithContext, session, skip, stepMetadata, stream, voice, waitUntil };
12284
+ export { type Accessor, type ActiveCampaignAddNoteStepInput, type ActiveCampaignAddNoteStepOutput, type ActiveCampaignCreateContactStepInput, type ActiveCampaignCreateContactStepOutput, type AddSubtitlesToVideoStepInput, type AddSubtitlesToVideoStepOutput, type AgentInfo, type AgentOptions, type AggregateRow, type AggregateSelect, type AggregateTerm, type AiSourceVendor, type AirtableCreateUpdateRecordStepInput, type AirtableCreateUpdateRecordStepOutput, type AirtableDeleteRecordStepInput, type AirtableDeleteRecordStepOutput, type AirtableGetRecordStepInput, type AirtableGetRecordStepOutput, type AirtableGetTableRecordsStepInput, type AirtableGetTableRecordsStepOutput, type Analytics, type AnalyticsDateRange, type AnalyticsDimension, type AnalyticsFilter, type AnalyticsFilterOp, type AnalyticsGranularity, type AnalyticsMetric, type AnalyticsQueryResponse, type AnalyticsQueryResultRow, type AnalyticsQuerySpec, type AnalyticsReadOptions, 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 CrawlerBucket, type CrawlerHit, type CrawlerOverview, type CreateDataSourceStepInput, type CreateDataSourceStepOutput, type CreateGmailDraftStepInput, type CreateGmailDraftStepOutput, type CreateGoogleCalendarEventStepInput, type CreateGoogleCalendarEventStepOutput, type CreateGoogleDocStepInput, type CreateGoogleDocStepOutput, type CreateGoogleSheetStepInput, type CreateGoogleSheetStepOutput, type Db, type DecomposeImageStepInput, type DecomposeImageStepOutput, 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 DownloadVideoStepInput, type DownloadVideoStepOutput, type EnhanceImageGenerationPromptStepInput, type EnhanceImageGenerationPromptStepOutput, type EnhanceVideoGenerationPromptStepInput, type EnhanceVideoGenerationPromptStepOutput, type EnrichPersonStepInput, type EnrichPersonStepOutput, type EventGrantOptions, type EventGrantResult, type Events, 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 GenerateImageStepInput, type GenerateImageStepOutput, type GenerateLipsyncStepInput, type GenerateLipsyncStepOutput, type GenerateMusicStepInput, type GenerateMusicStepOutput, type GeneratePdfStepInput, type GeneratePdfStepOutput, type GenerateSoundStepInput, type GenerateSoundStepOutput, 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 LiveNow, type LogicStepInput, type LogicStepOutput, MAX_EVENT_PAYLOAD_CHARS, type MakeDotComRunScenarioStepInput, type MakeDotComRunScenarioStepOutput, type MapObject, type MapOutcome, type MapPoint, type MapRunObject, type MapRunOutcome, type MapRunParams, type MapRunRecord, type MapRunResult, type MappedDocument, type Mapper, type MapperConfig, 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 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 QueryDataSourceStepInput, type QueryDataSourceStepOutput, type QueryExternalDatabaseStepInput, type QueryExternalDatabaseStepOutput, type QuickbooksApiRequestStepInput, type QuickbooksApiRequestStepOutput, RawQuery, type ReadDelivery, type ReadRunParams, type ReadRunRecord, type ReadRunResult, type Reader, type ReaderConfig, type ReaderDocument, 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 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 TextToSpeechStepInput, type TextToSpeechStepOutput, type TopSource, type TranscribeAudioStepInput, type TranscribeAudioStepOutput, type TrimMediaStepInput, type TrimMediaStepOutput, type TypesafeEvaluateStepInput, type TypesafeEvaluateStepOutput, 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, analytics, auth, blockTypeAliases, dataSources, db, mindstudio as default, defineJewel, defineMapper, defineReader, deletes, documents, email, events, files, getRequestContext, mindstudio, monacoSnippets, passthrough, prerender, reportIssue, resolveUser, runWithContext, session, skip, stepMetadata, stream, voice, waitUntil };