mindoodb-app-sdk 0.0.70 → 0.0.72

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.
@@ -135,6 +135,51 @@ interface MindooDBAppDefinition {
135
135
  * Display-only; nothing in here affects what the app is granted.
136
136
  */
137
137
  listing?: MindooDBAppDefinitionListing;
138
+ /**
139
+ * What AI agents learn about the app before they open it: what it is for, what its
140
+ * agent tools can do, example requests and a longer how-to. Haven shows it through
141
+ * `haven_apps_describe`. See {@link MindooDBAppAgentProfile}.
142
+ */
143
+ agent?: MindooDBAppAgentProfile;
144
+ }
145
+ /**
146
+ * Per-locale text: `en` is required and the fallback for every locale it does not
147
+ * name. Unlike {@link MindooDBAppLocalizedText} a plain string is not accepted.
148
+ */
149
+ type MindooDBAppLocaleMap<T> = {
150
+ en: T;
151
+ } & Record<string, T>;
152
+ /** One thing an agent can do with the app, and the tools it takes. */
153
+ interface MindooDBAppAgentCapability {
154
+ /** Stable id, unique within the profile. Lowercase letters, digits, `-` and `_`. */
155
+ id: string;
156
+ /** Short title, e.g. "Find, open and create maps". At most 80 characters. */
157
+ title: MindooDBAppLocaleMap<string>;
158
+ /**
159
+ * The tools behind it, named as in `registerTools` (without the app's prefix):
160
+ * `nodes_add`, not `vega_nodes_add`. Haven's own `haven_*` tools do not belong here.
161
+ */
162
+ tools: string[];
163
+ }
164
+ /**
165
+ * The app as an agent should know it before opening it (`agent` in haven-app.json).
166
+ * Everything here is text the publisher writes for agents; it grants nothing.
167
+ */
168
+ interface MindooDBAppAgentProfile {
169
+ /** Neutral description in 1-3 sentences, at most 400 characters per locale. */
170
+ summary: MindooDBAppLocaleMap<string>;
171
+ /** 1-8 capabilities that together cover the app's agent tools. */
172
+ capabilities: MindooDBAppAgentCapability[];
173
+ /** Example requests a user might give an agent, per locale. */
174
+ examples?: MindooDBAppLocaleMap<string[]>;
175
+ /** What the app deliberately does not do, so an agent does not try. */
176
+ limits?: MindooDBAppLocaleMap<string[]>;
177
+ /**
178
+ * Markdown how-to per locale (`agent/agent.en.md`): typical steps, where ids come
179
+ * from, pitfalls. A path relative to haven-app.json, at most
180
+ * {@link MINDOODB_APP_AGENT_GUIDE_MAX_BYTES} bytes.
181
+ */
182
+ guide?: MindooDBAppLocaleMap<string>;
138
183
  }
139
184
  /** One kind of content an app takes, as a choice in Haven's picker. */
140
185
  interface MindooDBAppAcceptSpec {
@@ -237,6 +282,15 @@ interface MindooDBAppComponentSpec {
237
282
  provides?: MindooDBAppComponentContract[];
238
283
  /** Fields of the root document that point at other root documents. */
239
284
  references?: MindooDBAppComponentReference[];
285
+ /**
286
+ * What the component can do for its hosts beyond showing the document, so a host
287
+ * can pick one that fits (`components.list({ requires })`): `inspect:<contract>`
288
+ * (describes its document, e.g. `inspect:mindoo.inspect.document@1`), `validate`
289
+ * (asks before it saves, `session.embedding.validate`), `issues` (shows a host's
290
+ * findings, `embed.showIssues`), `reveal` (scrolls to an anchor, `embed.reveal`).
291
+ * Changing it does not ask users again: it grants no access.
292
+ */
293
+ supports?: string[];
240
294
  }
241
295
  /**
242
296
  * Text in one language, or a map from locale (`de`, `fr`, …) to text. A map must carry
@@ -274,6 +328,19 @@ interface MindooDBAppDefinitionListing {
274
328
  declare const MINDOODB_APP_LISTING_SUMMARY_MAX = 300;
275
329
  declare const MINDOODB_APP_LISTING_DESCRIPTION_MAX = 4000;
276
330
  declare const MINDOODB_APP_LISTING_MAX_SCREENSHOTS = 8;
331
+ declare const MINDOODB_APP_AGENT_SUMMARY_MAX = 400;
332
+ declare const MINDOODB_APP_AGENT_CAPABILITIES_MAX = 8;
333
+ declare const MINDOODB_APP_AGENT_CAPABILITY_TITLE_MAX = 80;
334
+ /** Most tools one capability lists; an app registers at most 64 tools. */
335
+ declare const MINDOODB_APP_AGENT_CAPABILITY_TOOLS_MAX = 64;
336
+ /** Most examples or limits per locale. */
337
+ declare const MINDOODB_APP_AGENT_LIST_MAX = 8;
338
+ declare const MINDOODB_APP_AGENT_EXAMPLE_MAX = 200;
339
+ declare const MINDOODB_APP_AGENT_LIMIT_MAX = 300;
340
+ /** Largest agent guide a host loads; longer guides are cut. */
341
+ declare const MINDOODB_APP_AGENT_GUIDE_MAX_BYTES: number;
342
+ /** An agent tool name as `registerTools` accepts it, without the app's prefix. */
343
+ declare const MINDOODB_APP_AGENT_TOOL_NAME_PATTERN: RegExp;
277
344
  interface MindooDBAppDefinitionValidation {
278
345
  definition: MindooDBAppDefinition | null;
279
346
  errors: string[];
@@ -302,6 +369,14 @@ declare function validateMindooDBAppComponents(value: unknown): {
302
369
  };
303
370
  /** Whether every field in `match` has exactly that value in `data`. */
304
371
  declare function mindooDBAppComponentFieldsMatch(match: Readonly<Record<string, MindooDBAppComponentFieldValue>>, data: Readonly<Record<string, unknown>> | null | undefined): boolean;
372
+ /**
373
+ * Validates an `agent` block on its own, for hosts that read it from another manifest
374
+ * format (Haven's app store catalog).
375
+ */
376
+ declare function validateMindooDBAppAgentProfile(value: unknown): {
377
+ agent: MindooDBAppAgentProfile | undefined;
378
+ errors: string[];
379
+ };
305
380
  /**
306
381
  * Picks the text for `locale` out of a localized value: the exact locale, then its
307
382
  * language (`de` for `de-CH`), then `en`.
@@ -325,6 +400,351 @@ declare function validateMindooDBAppDefinition(raw: unknown): MindooDBAppDefinit
325
400
  */
326
401
  declare function resolveMindooDBAppDefinitionUrl(baseUrl: string): string;
327
402
 
403
+ /**
404
+ * Typed document values that plain JSON cannot express.
405
+ *
406
+ * Each helper returns a tagged plain object such as
407
+ * `{ $mindoo: "counter", value: 0 }`. Use it anywhere a value is written:
408
+ * `documents.create({ set })`, `documents.update({ set })`, JSON patch `set`
409
+ * and `listInsert` values, also nested inside objects and arrays. Haven turns
410
+ * the tags into the matching collaborative type. Reads return plain JSON:
411
+ * atomic strings as strings, counters as numbers, timestamps as ISO 8601
412
+ * strings.
413
+ *
414
+ * The object key `$mindoo` is reserved; an object carrying it must be one of
415
+ * these values, otherwise the write is rejected.
416
+ */
417
+ /** Reserved object key that marks a typed value. */
418
+ declare const MINDOODB_APP_VALUE_TAG = "$mindoo";
419
+ /** A string that is replaced as a whole on concurrent writes. */
420
+ interface MindooDBAppAtomicValue {
421
+ $mindoo: "atomic";
422
+ value: string;
423
+ }
424
+ /** A number whose concurrent increments are summed on merge. */
425
+ interface MindooDBAppCounterValue {
426
+ $mindoo: "counter";
427
+ value: number;
428
+ }
429
+ /** A point in time: epoch milliseconds or an ISO 8601 date-time string. */
430
+ interface MindooDBAppTimestampValue {
431
+ $mindoo: "timestamp";
432
+ value: number | string;
433
+ }
434
+ type MindooDBAppTypedValue = MindooDBAppAtomicValue | MindooDBAppCounterValue | MindooDBAppTimestampValue;
435
+ declare const MindooDBAppValue: {
436
+ /**
437
+ * An atomic string for identifiers, status and enum values, URLs, hashes
438
+ * and stored text cursors. Plain strings are collaborative text, where two
439
+ * concurrent changes of `"open"` to `"closed"` and `"blocked"` can
440
+ * interleave into a mix of both words.
441
+ */
442
+ readonly atomic: (value: string) => MindooDBAppAtomicValue;
443
+ /**
444
+ * A collaborative counter with an initial value (a safe integer). Create it
445
+ * once, then change it only with `json.counterIncrement`: writing a new
446
+ * counter is an assignment that does not merge with concurrent increments.
447
+ */
448
+ readonly counter: (value?: number) => MindooDBAppCounterValue;
449
+ /** A timestamp from a `Date`, epoch milliseconds or an ISO 8601 string. */
450
+ readonly timestamp: (value: Date | number | string) => MindooDBAppTimestampValue;
451
+ /** Whether `value` is a tagged typed value (any kind). */
452
+ readonly isTyped: (value: unknown) => value is MindooDBAppTypedValue;
453
+ };
454
+
455
+ /**
456
+ * Checking an embedded component's document before it is saved.
457
+ *
458
+ * A component that declares `supports: ["inspect:<contract>"]` describes its
459
+ * document on request in a shape every host can read without knowing the app:
460
+ * a Word or Markdown document as {@link MindooDBAppDocumentInspection}, a
461
+ * workbook as {@link MindooDBAppSpreadsheetInspection}, a deck as
462
+ * {@link MindooDBAppSlidesInspection}. A host asks for that (`embed.inspect`)
463
+ * or checks it before every save (`embed.onBeforeSave`), answering with
464
+ * {@link MindooDBAppIssue}s. The same checks can run on the small summary each
465
+ * component writes to its root document (`inspection` field), so a host can
466
+ * judge documents it does not have open.
467
+ *
468
+ * Rules that work on both: {@link defineDocumentRules}.
469
+ */
470
+
471
+ /** Word and Markdown documents. */
472
+ declare const MINDOODB_INSPECT_DOCUMENT = "mindoo.inspect.document@1";
473
+ /** Workbooks. */
474
+ declare const MINDOODB_INSPECT_SPREADSHEET = "mindoo.inspect.spreadsheet@1";
475
+ /** Presentations. */
476
+ declare const MINDOODB_INSPECT_SLIDES = "mindoo.inspect.slides@1";
477
+ /** Root document field holding the summary a component writes on every save. */
478
+ declare const MINDOODB_APP_INSPECTION_FIELD = "inspection";
479
+ /** Upper bound of the root summary, as JSON. */
480
+ declare const MINDOODB_APP_INSPECTION_SUMMARY_MAX_BYTES: number;
481
+ /** Upper bound of a full inspection Haven passes between apps, as JSON. */
482
+ declare const MINDOODB_APP_INSPECTION_MAX_BYTES: number;
483
+ /** At most this many issues per check. */
484
+ declare const MINDOODB_APP_ISSUES_MAX = 100;
485
+ /**
486
+ * A place in the component's document, for `embed.reveal` and issues: a heading
487
+ * (its id from the outline), a cell (`Sheet1!B3`, or `B3` on the first sheet) or
488
+ * a slide (0-based).
489
+ */
490
+ type MindooDBAppInspectAnchor = {
491
+ kind: "heading";
492
+ id: string;
493
+ } | {
494
+ kind: "cell";
495
+ ref: string;
496
+ } | {
497
+ kind: "slide";
498
+ index: number;
499
+ };
500
+ type MindooDBAppIssueSeverity = "error" | "warning" | "info";
501
+ /**
502
+ * A finding about the document. Before a save, `error` stops it, `warning` asks
503
+ * the user whether to save anyway, `info` is only shown.
504
+ */
505
+ interface MindooDBAppIssue {
506
+ severity: MindooDBAppIssueSeverity;
507
+ /** For the user, in their language. At most 500 characters. */
508
+ message: string;
509
+ /** Where in the document, so the component can show it (`embed.reveal`). */
510
+ anchor?: MindooDBAppInspectAnchor;
511
+ /** Stable id of the rule, e.g. `open-placeholders`. */
512
+ code?: string;
513
+ }
514
+ /** What a host asks a component to describe (`embed.inspect`, `onBeforeSave`). */
515
+ interface MindooDBAppInspectRequest {
516
+ /** One of the component's `inspect:` contracts. Default: its first one. */
517
+ contract?: string;
518
+ /**
519
+ * Optional parts: `text` (plain text of a document, see `maxTextLength`). Other
520
+ * parts of the contracts are always there.
521
+ */
522
+ include?: string[];
523
+ /** Spreadsheets: cells whose values to return, `Sheet1!B3` or `B3` (first sheet). At most 200. */
524
+ cells?: string[];
525
+ /** With `include: ["text"]`: at most this many characters (default 4000, max 50000). */
526
+ maxTextLength?: number;
527
+ }
528
+ /** What every inspection carries. */
529
+ interface MindooDBAppInspectionBase {
530
+ contract: string;
531
+ /** Title of the document (the root's `subject`). */
532
+ subject?: string;
533
+ /** Set when lists or text were shortened, e.g. in the root summary. */
534
+ truncated?: boolean;
535
+ }
536
+ /** `mindoo.inspect.document@1`: a Word or Markdown document. */
537
+ interface MindooDBAppDocumentInspection extends MindooDBAppInspectionBase {
538
+ contract: typeof MINDOODB_INSPECT_DOCUMENT;
539
+ /** Plain text, shortened to `maxTextLength`; only with `include: ["text"]`. */
540
+ text?: string;
541
+ /** Headings in document order. */
542
+ outline: Array<{
543
+ level: number;
544
+ text: string;
545
+ anchor: {
546
+ kind: "heading";
547
+ id: string;
548
+ };
549
+ }>;
550
+ /** Placeholders and Word MERGEFIELDs that were not filled in yet. */
551
+ placeholders: Array<{
552
+ name: string;
553
+ kind: "placeholder" | "mergefield";
554
+ anchor?: MindooDBAppInspectAnchor;
555
+ }>;
556
+ /** Comments that are not resolved. */
557
+ openComments: number;
558
+ /** Tracked changes that were neither accepted nor rejected. */
559
+ openTrackedChanges: number;
560
+ wordCount: number;
561
+ }
562
+ /** A cell value as `mindoo.inspect.spreadsheet@1` reports it. */
563
+ interface MindooDBAppInspectedCell {
564
+ value: string | number | boolean | null;
565
+ formula?: string;
566
+ /** Formula error such as `#REF!` or `#DIV/0!`. */
567
+ error?: string;
568
+ }
569
+ /** `mindoo.inspect.spreadsheet@1`: a workbook. */
570
+ interface MindooDBAppSpreadsheetInspection extends MindooDBAppInspectionBase {
571
+ contract: typeof MINDOODB_INSPECT_SPREADSHEET;
572
+ sheets: Array<{
573
+ name: string;
574
+ rows?: number;
575
+ columns?: number;
576
+ }>;
577
+ namedRanges: Array<{
578
+ name: string;
579
+ ref: string;
580
+ }>;
581
+ /** The requested `cells`, keyed by the ref as requested. */
582
+ cells?: Record<string, MindooDBAppInspectedCell>;
583
+ /** Cells whose formula evaluates to an error. */
584
+ formulaErrors: Array<{
585
+ ref: string;
586
+ error: string;
587
+ formula?: string;
588
+ }>;
589
+ }
590
+ /** `mindoo.inspect.slides@1`: a presentation. */
591
+ interface MindooDBAppSlidesInspection extends MindooDBAppInspectionBase {
592
+ contract: typeof MINDOODB_INSPECT_SLIDES;
593
+ slideCount: number;
594
+ slides: Array<{
595
+ index: number;
596
+ title?: string;
597
+ }>;
598
+ /** Layout placeholders nobody filled, e.g. an empty title. */
599
+ emptyPlaceholders: Array<{
600
+ slide: number;
601
+ placeholder: string;
602
+ anchor: {
603
+ kind: "slide";
604
+ index: number;
605
+ };
606
+ }>;
607
+ }
608
+ type MindooDBAppInspection = MindooDBAppDocumentInspection | MindooDBAppSpreadsheetInspection | MindooDBAppSlidesInspection;
609
+ /** What a component passes to `session.embedding.complete`. */
610
+ interface MindooDBAppEmbeddingResult {
611
+ /** Title of the document after the edit. */
612
+ subject: string;
613
+ /** One or two sentences for the host to show. */
614
+ summary?: string;
615
+ /** Small preview, a `data:image/png` or `data:image/jpeg` URL (the whole result stays below 64 KiB). */
616
+ thumbnail?: string;
617
+ /** Counts such as words, sheets or slides. */
618
+ stats?: Record<string, number>;
619
+ }
620
+ /** The outcome of `session.embedding.validate`. */
621
+ interface MindooDBAppEmbedValidation {
622
+ /** False: do not save (an error, or the user did not confirm a warning). */
623
+ ok: boolean;
624
+ issues: MindooDBAppIssue[];
625
+ /** The host did not answer in time; Haven let the save go ahead. */
626
+ timedOut?: boolean;
627
+ }
628
+ /** Thrown by `session.embedding.save` when the host's checks stopped the save. */
629
+ declare class MindooDBAppEmbedValidationError extends Error {
630
+ readonly issues: MindooDBAppIssue[];
631
+ constructor(issues: MindooDBAppIssue[]);
632
+ }
633
+ /**
634
+ * Whether a component's `supports` list covers `requirement`: `inspect` is met by
635
+ * any `inspect:…` entry, `inspect:mindoo.inspect.document@1` only by that one.
636
+ */
637
+ declare function mindooDBAppComponentSupports(supports: readonly string[] | undefined, requirement: string): boolean;
638
+ /** The contracts of a component's `inspect:` entries, in declared order. */
639
+ declare function mindooDBAppInspectContracts(supports: readonly string[] | undefined): string[];
640
+ /** A valid anchor, or undefined. */
641
+ declare function normalizeMindooDBAppInspectAnchor(raw: unknown): MindooDBAppInspectAnchor | undefined;
642
+ /**
643
+ * Issues as they may cross between apps: known severities, messages and codes
644
+ * shortened, invalid anchors dropped, at most {@link MINDOODB_APP_ISSUES_MAX}.
645
+ * Anything that is not an issue is left out.
646
+ */
647
+ declare function normalizeMindooDBAppIssues(raw: unknown): MindooDBAppIssue[];
648
+ /** An inspect request as it may cross between apps. */
649
+ declare function normalizeMindooDBAppInspectRequest(raw: unknown): MindooDBAppInspectRequest;
650
+ /**
651
+ * An inspection as it may cross between apps: plain JSON with a `contract`, at
652
+ * most {@link MINDOODB_APP_INSPECTION_MAX_BYTES}. Throws otherwise.
653
+ */
654
+ declare function normalizeMindooDBAppInspection(raw: unknown): MindooDBAppInspectionBase & Record<string, unknown>;
655
+ /**
656
+ * The small summary of an inspection a component keeps on its root document:
657
+ * no requested cells, text and lists shortened (`truncated: true` then) until it
658
+ * fits {@link MINDOODB_APP_INSPECTION_SUMMARY_MAX_BYTES}. Counts stay exact, so
659
+ * rules like "no open placeholders" give the same answer on it.
660
+ */
661
+ declare function summarizeMindooDBAppInspection<T extends MindooDBAppInspectionBase>(inspection: T, maxBytes?: number): T;
662
+ /**
663
+ * The summary as a value to write to the root (`set: { inspection: … }`): one
664
+ * atomic string of JSON, so concurrent saves replace it instead of merging text.
665
+ */
666
+ declare function mindooDBAppInspectionSummaryValue(inspection: MindooDBAppInspectionBase): MindooDBAppAtomicValue;
667
+ /** The summary a component wrote to this root document, or null. */
668
+ declare function readMindooDBAppInspectionSummary<T extends MindooDBAppInspectionBase = MindooDBAppInspection>(root: Readonly<Record<string, unknown>> | null | undefined): T | null;
669
+ /** What a rule's `check` may return: a message, issues, or nothing for "fine". */
670
+ type MindooDBAppDocumentRuleOutcome = string | MindooDBAppIssue | MindooDBAppIssue[] | null | undefined | false;
671
+ /** One check on an inspection. */
672
+ interface MindooDBAppDocumentRule<T extends MindooDBAppInspectionBase = MindooDBAppInspection> {
673
+ /** Stable id; becomes the issue's `code`. */
674
+ code: string;
675
+ /** For a message returned as a string. Default `error`. */
676
+ severity?: MindooDBAppIssueSeverity;
677
+ check(inspection: T): MindooDBAppDocumentRuleOutcome;
678
+ }
679
+ /** What {@link defineDocumentRules} returns. */
680
+ interface MindooDBAppDocumentRules {
681
+ /** What to ask the component for (`embed.onBeforeSave(handler, { inspect: rules.request })`). */
682
+ readonly request: MindooDBAppInspectRequest;
683
+ /** Issues of a full inspection; none for an inspection of another contract. */
684
+ check(inspection: MindooDBAppInspectionBase | null | undefined): MindooDBAppIssue[];
685
+ /** The same rules on a root document's summary (`inspection` field); none without one. */
686
+ checkRoot(root: Readonly<Record<string, unknown>> | null | undefined): MindooDBAppIssue[];
687
+ /** A ready `embed.onBeforeSave` handler. */
688
+ beforeSave(input: {
689
+ inspection: MindooDBAppInspectionBase | null;
690
+ }): {
691
+ issues: MindooDBAppIssue[];
692
+ };
693
+ /** Checks every save of this embed; returns the function that stops it. */
694
+ attach(embed: {
695
+ onBeforeSave(handler: (input: {
696
+ inspection: MindooDBAppInspectionBase | null;
697
+ }) => {
698
+ issues: MindooDBAppIssue[];
699
+ }, options?: {
700
+ inspect?: MindooDBAppInspectRequest;
701
+ }): () => void;
702
+ }): () => void;
703
+ }
704
+ /**
705
+ * Rules a host applies to a component's document, before a save (on the full
706
+ * inspection) and when reading (on the root's summary):
707
+ *
708
+ * ```ts
709
+ * const rules = defineDocumentRules<MindooDBAppDocumentInspection>({
710
+ * contract: MINDOODB_INSPECT_DOCUMENT,
711
+ * rules: [mindooDBAppInspectRules.noOpenPlaceholders(), mindooDBAppInspectRules.noOpenTrackedChanges("warning")],
712
+ * });
713
+ * rules.attach(embed);
714
+ * const issues = rules.checkRoot(document.data);
715
+ * ```
716
+ *
717
+ * The summary is shortened, so rules that look at text or long lists may see
718
+ * less on it than on the full inspection; counts are always exact.
719
+ */
720
+ declare function defineDocumentRules<T extends MindooDBAppInspectionBase = MindooDBAppInspection>(definition: {
721
+ /** Only inspections of this contract are checked. */
722
+ contract?: string;
723
+ include?: string[];
724
+ cells?: string[];
725
+ maxTextLength?: number;
726
+ rules: Array<MindooDBAppDocumentRule<T>>;
727
+ }): MindooDBAppDocumentRules;
728
+ /** Common rules for {@link defineDocumentRules}; pass `message` to word them yourself. */
729
+ declare const mindooDBAppInspectRules: {
730
+ /** Documents: no placeholder or MERGEFIELD left open. */
731
+ noOpenPlaceholders(severity?: MindooDBAppIssueSeverity, message?: (names: string[]) => string): MindooDBAppDocumentRule<MindooDBAppDocumentInspection>;
732
+ /** Documents: every comment resolved. */
733
+ noOpenComments(severity?: MindooDBAppIssueSeverity, message?: (count: number) => string): MindooDBAppDocumentRule<MindooDBAppDocumentInspection>;
734
+ /** Documents: every tracked change accepted or rejected. */
735
+ noOpenTrackedChanges(severity?: MindooDBAppIssueSeverity, message?: (count: number) => string): MindooDBAppDocumentRule<MindooDBAppDocumentInspection>;
736
+ /** Spreadsheets: no formula evaluates to an error; one issue per cell. */
737
+ noFormulaErrors(severity?: MindooDBAppIssueSeverity): MindooDBAppDocumentRule<MindooDBAppSpreadsheetInspection>;
738
+ /** Presentations: no layout placeholder left empty; one issue per slide. */
739
+ noEmptySlidePlaceholders(severity?: MindooDBAppIssueSeverity): MindooDBAppDocumentRule<MindooDBAppSlidesInspection>;
740
+ };
741
+ /**
742
+ * How Haven turns a host's answer into the component's `validate` result: an error
743
+ * stops the save, warnings stop it unless the user confirms (`confirm`), or
744
+ * nothing asks (`interactive: false`).
745
+ */
746
+ declare function resolveMindooDBAppEmbedValidation(issues: MindooDBAppIssue[], interactive: boolean, confirm: (warnings: MindooDBAppIssue[]) => boolean | Promise<boolean>): Promise<MindooDBAppEmbedValidation>;
747
+
328
748
  /** Launch target used by the Haven when opening an app. */
329
749
  type MindooDBAppRuntime = "iframe" | "window";
330
750
  /**
@@ -1846,12 +2266,20 @@ interface MindooDBAppComponentInfo {
1846
2266
  provides?: MindooDBAppComponentContract[];
1847
2267
  /** Fields of its root documents that point at other root documents. */
1848
2268
  references?: MindooDBAppComponentReference[];
2269
+ /** What it can do beyond showing the document, e.g. `inspect:mindoo.inspect.document@1`, `validate`. */
2270
+ supports?: string[];
1849
2271
  }
1850
2272
  /** Filter for `session.components.list`. */
1851
2273
  interface MindooDBAppComponentQuery {
1852
2274
  intent?: MindooDBAppComponentIntent;
1853
2275
  /** Only components whose `match` fits these root document fields. */
1854
2276
  document?: Record<string, unknown>;
2277
+ /**
2278
+ * Only components that support all of these (`supports` in their haven-app.json):
2279
+ * `inspect` matches any `inspect:…` entry, `inspect:mindoo.inspect.document@1`
2280
+ * only that contract.
2281
+ */
2282
+ requires?: string[];
1855
2283
  }
1856
2284
  /** Rectangle in the host app's viewport, CSS pixels. */
1857
2285
  type MindooDBAppEmbedRect = MindooDBAppMenuRect;
@@ -1996,6 +2424,55 @@ interface MindooDBAppEmbed {
1996
2424
  * `timeoutMs` (default 10 s) or when the component closes.
1997
2425
  */
1998
2426
  waitForAgentTools(timeoutMs?: number): Promise<MindooDBAppEmbedAgentTools | null>;
2427
+ /** What the component supports (`supports` in its haven-app.json); empty on older Havens. */
2428
+ readonly supports: readonly string[];
2429
+ /**
2430
+ * Asks the component to describe its document (it must support `inspect:<contract>`),
2431
+ * e.g. to show the open placeholders of a letter. Rejects with `unsupported` when it
2432
+ * does not.
2433
+ */
2434
+ inspect<T extends MindooDBAppInspectionBase = MindooDBAppInspectionBase>(request?: MindooDBAppInspectRequest): Promise<T>;
2435
+ /**
2436
+ * Checks every save of the component before it happens (components that support
2437
+ * `validate` ask before they save, `session.embedding.validate`). `handler` gets the
2438
+ * component's inspection, asked for with `options.inspect` (null when the component
2439
+ * cannot describe its document), plus the root document as saved last time, and
2440
+ * answers with issues: an `error` stops the save, a `warning` makes Haven ask the
2441
+ * user. Saves the user, this app (`save()`) or an agent start alike. Without an
2442
+ * answer within about 5 s the component saves and the user is told. One handler at
2443
+ * a time; returns the function that removes it.
2444
+ */
2445
+ onBeforeSave(handler: (input: MindooDBAppEmbedBeforeSaveInput) => MindooDBAppEmbedBeforeSaveResult | Promise<MindooDBAppEmbedBeforeSaveResult>, options?: {
2446
+ inspect?: MindooDBAppInspectRequest;
2447
+ }): () => void;
2448
+ /** Called after the component saved (it reports that through `session.embedding.save`). */
2449
+ onAfterSave(listener: (event: MindooDBAppEmbedSavedEvent) => void): () => void;
2450
+ /** Shows issues in the component (it must support `issues`), e.g. after this app checked it. */
2451
+ showIssues(issues: MindooDBAppIssue[]): Promise<void>;
2452
+ /** Scrolls the component to a place in its document (it must support `reveal`). */
2453
+ reveal(anchor: MindooDBAppInspectAnchor): Promise<void>;
2454
+ /**
2455
+ * Runs one of the component's document agent tools (`scope: "document"`), e.g.
2456
+ * `text_insert`, with or without its prefix. For what the other methods do not
2457
+ * cover; agent tools need not be switched on. Resolves with the tool's result.
2458
+ */
2459
+ callTool(name: string, input?: Record<string, unknown>): Promise<unknown>;
2460
+ }
2461
+ /** What an `embed.onBeforeSave` handler gets. */
2462
+ interface MindooDBAppEmbedBeforeSaveInput {
2463
+ embedId: string;
2464
+ /** The component's description of the document as it is about to be saved; null if it has none. */
2465
+ inspection: MindooDBAppInspectionBase | null;
2466
+ /** The root document's fields as last saved (large fields may be missing). */
2467
+ root: Record<string, unknown> | null;
2468
+ }
2469
+ /** What an `embed.onBeforeSave` handler answers. */
2470
+ interface MindooDBAppEmbedBeforeSaveResult {
2471
+ issues: MindooDBAppIssue[];
2472
+ }
2473
+ /** Pushed after an embedded component saved. */
2474
+ interface MindooDBAppEmbedSavedEvent {
2475
+ embedId: string;
1999
2476
  }
2000
2477
  /** The agent tools of an embedded component, as its host sees them. */
2001
2478
  interface MindooDBAppEmbedAgentTools {
@@ -2069,6 +2546,47 @@ interface MindooDBAppEmbeddingApi {
2069
2546
  * 20, max 100) results.
2070
2547
  */
2071
2548
  lookup(field: string, options?: MindooDBAppEmbeddingLookupOptions): Promise<MindooDBAppEmbeddingLookupResult[]>;
2549
+ /**
2550
+ * Describes the document when the host asks (`embed.inspect`, its save checks),
2551
+ * following one of the contracts in `supports` (`inspect:<contract>`). Also used
2552
+ * by `save` for the root summary. One provider at a time; returns the unregister
2553
+ * function.
2554
+ */
2555
+ provideInspection(provider: (request: MindooDBAppInspectRequest) => MindooDBAppInspectionBase | Promise<MindooDBAppInspectionBase>): () => void;
2556
+ /**
2557
+ * Lets the host check the document before this component saves it: Haven asks the
2558
+ * host's `onBeforeSave` (with this app's inspection) and, for warnings, the user
2559
+ * (unless `interactive: false`, e.g. for an agent's save; then warnings do not
2560
+ * stop it). Resolves `ok: true` right away when not embedded or the host has no
2561
+ * checks. Prefer {@link save}, which also writes the root summary.
2562
+ */
2563
+ validate(options?: {
2564
+ interactive?: boolean;
2565
+ }): Promise<MindooDBAppEmbedValidation>;
2566
+ /**
2567
+ * Saving with the host's checks: `validate`, then `flush` (write the pending
2568
+ * changes; put `context.inspection` into the root's `inspection` field when it is
2569
+ * set), then tells the host it saved. Throws a `MindooDBAppEmbedValidationError`
2570
+ * without calling `flush` when the checks stopped it, after passing the issues to
2571
+ * the `onShowIssues` handler. Works the same standalone, without checks.
2572
+ */
2573
+ save(flush: (context: MindooDBAppEmbeddingSaveContext) => void | Promise<void>, options?: {
2574
+ interactive?: boolean;
2575
+ }): Promise<MindooDBAppEmbedValidation>;
2576
+ /** Shows the host's issues (`embed.showIssues`, and failed saves). Returns the unregister function. */
2577
+ onShowIssues(handler: (issues: MindooDBAppIssue[]) => void | Promise<void>): () => void;
2578
+ /** Scrolls to a place in the document (`embed.reveal`). Returns the unregister function. */
2579
+ onReveal(handler: (anchor: MindooDBAppInspectAnchor) => void | Promise<void>): () => void;
2580
+ }
2581
+ /** What `session.embedding.save` hands to `flush`. */
2582
+ interface MindooDBAppEmbeddingSaveContext {
2583
+ /**
2584
+ * The summary of this app's inspection (see `provideInspection`), ready to write as
2585
+ * the root's `inspection` field; null without a provider.
2586
+ */
2587
+ inspection: MindooDBAppAtomicValue | null;
2588
+ /** What the host's checks found but let pass (warnings the user confirmed, infos). */
2589
+ issues: MindooDBAppIssue[];
2072
2590
  }
2073
2591
  interface MindooDBAppEmbeddingLookupOptions {
2074
2592
  query?: string;
@@ -2081,12 +2599,29 @@ interface MindooDBAppEmbeddingLookupResult {
2081
2599
  /** The reference's `show` fields the document has. */
2082
2600
  fields: Record<string, unknown>;
2083
2601
  }
2084
- /** Haven → component: the host asked for something (`embed.save()`). */
2602
+ /**
2603
+ * Haven → component: the host asked for something (`embed.save()`, `embed.inspect()`,
2604
+ * …). The component answers with `embedding.respond`.
2605
+ */
2085
2606
  interface MindooDBAppBridgeEmbeddingRequestMessage {
2086
2607
  protocol: "mindoodb-app-bridge";
2087
2608
  kind: "embedding-request";
2088
2609
  requestId: string;
2089
- request: "save";
2610
+ request: "save" | "inspect" | "showIssues" | "reveal";
2611
+ /** `inspect`: `{ request }`, `showIssues`: `{ issues }`, `reveal`: `{ anchor }`. */
2612
+ params?: Record<string, unknown>;
2613
+ }
2614
+ /** Haven → host: a question about an embed the host has to answer (`embeds.respond`). */
2615
+ interface MindooDBAppBridgeEmbedRequestMessage {
2616
+ protocol: "mindoodb-app-bridge";
2617
+ kind: "embed-request";
2618
+ requestId: string;
2619
+ embedId: string;
2620
+ request: "beforeSave";
2621
+ params: {
2622
+ inspection: MindooDBAppInspectionBase | null;
2623
+ root: Record<string, unknown> | null;
2624
+ };
2090
2625
  }
2091
2626
  /** The component reported whether it has unsaved changes. */
2092
2627
  interface MindooDBAppEmbedDirtyEvent {
@@ -2103,9 +2638,11 @@ interface MindooDBAppBridgeEmbedEventMessage {
2103
2638
  type: "dirty";
2104
2639
  } & MindooDBAppEmbedDirtyEvent) | ({
2105
2640
  type: "agentTools";
2106
- } & MindooDBAppEmbedAgentToolsEvent);
2641
+ } & MindooDBAppEmbedAgentToolsEvent) | ({
2642
+ type: "saved";
2643
+ } & MindooDBAppEmbedSavedEvent);
2107
2644
  }
2108
- type MindooDBAppBridgePortMessage = MindooDBAppBridgeRpcMessage | MindooDBAppBridgeStreamMessage | MindooDBAppBridgeThemeChangedMessage | MindooDBAppBridgeViewportChangedMessage | MindooDBAppBridgeUiPreferencesChangedMessage | MindooDBAppBridgeLocaleChangedMessage | MindooDBAppBridgeQueryResultMessage | MindooDBAppBridgeViewChangedMessage | MindooDBAppBridgeBeforeCloseMessage | MindooDBAppBridgeBeforeCloseAck | MindooDBAppBridgeShortcutsChangedMessage | MindooDBAppBridgeShortcutInvokedMessage | MindooDBAppBridgeWorkspaceFocusRequestedMessage | MindooDBAppBridgeHostFocusChangedMessage | MindooDBAppBridgeAgentInvokeMessage | MindooDBAppBridgeAgentResultMessage | MindooDBAppBridgeDragOverMessage | MindooDBAppBridgeDragLeaveMessage | MindooDBAppBridgeDragDropMessage | MindooDBAppBridgeIncomingContentMessage | MindooDBAppBridgeReminderOpenedMessage | MindooDBAppBridgeEmbedEventMessage | MindooDBAppBridgeEmbeddingRequestMessage;
2645
+ type MindooDBAppBridgePortMessage = MindooDBAppBridgeRpcMessage | MindooDBAppBridgeStreamMessage | MindooDBAppBridgeThemeChangedMessage | MindooDBAppBridgeViewportChangedMessage | MindooDBAppBridgeUiPreferencesChangedMessage | MindooDBAppBridgeLocaleChangedMessage | MindooDBAppBridgeQueryResultMessage | MindooDBAppBridgeViewChangedMessage | MindooDBAppBridgeBeforeCloseMessage | MindooDBAppBridgeBeforeCloseAck | MindooDBAppBridgeShortcutsChangedMessage | MindooDBAppBridgeShortcutInvokedMessage | MindooDBAppBridgeWorkspaceFocusRequestedMessage | MindooDBAppBridgeHostFocusChangedMessage | MindooDBAppBridgeAgentInvokeMessage | MindooDBAppBridgeAgentResultMessage | MindooDBAppBridgeDragOverMessage | MindooDBAppBridgeDragLeaveMessage | MindooDBAppBridgeDragDropMessage | MindooDBAppBridgeIncomingContentMessage | MindooDBAppBridgeReminderOpenedMessage | MindooDBAppBridgeEmbedEventMessage | MindooDBAppBridgeEmbedRequestMessage | MindooDBAppBridgeEmbeddingRequestMessage;
2109
2646
  /** Placement hint for a host-rendered overlay menu. */
2110
2647
  type MindooDBAppMenuPlacement = "auto" | "bottom-start" | "bottom-end" | "top-start" | "top-end" | "right-start" | "left-start";
2111
2648
  /** Semantic hint allowing Haven to tune menu behavior or styling. */
@@ -3816,4 +4353,4 @@ interface MindooDBAppBridge {
3816
4353
  connect(options?: MindooDBAppBridgeConnectOptions): Promise<MindooDBAppSession>;
3817
4354
  }
3818
4355
 
3819
- export { type MindooDBAppBridgeConnectOptions as $, MINDOODB_APP_LISTING_SUMMARY_MAX as A, MINDOODB_APP_SEAL_SIGNING_DOMAIN as B, MINDOODB_APP_WELL_KNOWN_DRAG_TYPES as C, type MindooDBAppAcceptSpec as D, type MindooDBAppAccessDecision as E, type MindooDBAppAccessTier as F, type MindooDBAppAgentApi as G, type MindooDBAppAgentRegistration as H, type MindooDBAppAgentToolAnnotations as I, type MindooDBAppAgentToolDescriptor as J, type MindooDBAppAgentToolScope as K, type MindooDBAppAttachmentApi as L, type MindooDBAppAttachmentPreviewMode as M, type MindooDBAppAttachmentChunk as N, type MindooDBAppAttachmentInfo as O, type MindooDBAppAttachmentPreviewOptions as P, type MindooDBAppAttachmentPreviewSession as Q, type MindooDBAppAutomergeChangesPatch as R, type MindooDBAppAutomergeChangesSince as S, type MindooDBAppAutomergeGetOptions as T, type MindooDBAppAutomergePatchResult as U, type MindooDBAppAutomergeSnapshot as V, type MindooDBAppBridgeAgentInvokeMessage as W, type MindooDBAppBridgeAgentResultMessage as X, type MindooDBAppBridgeBeforeCloseAck as Y, type MindooDBAppBridgeBeforeCloseMessage as Z, type MindooDBAppBridgeConnectMessage as _, type MindooDBAppDragBindSourceOptions as a, type MindooDBAppDatabaseInfo as a$, type MindooDBAppBridgeConnectedMessage as a0, type MindooDBAppBridgeDragDropMessage as a1, type MindooDBAppBridgeDragLeaveMessage as a2, type MindooDBAppBridgeDragOverMessage as a3, type MindooDBAppBridgeEmbedEventMessage as a4, type MindooDBAppBridgeEmbeddingRequestMessage as a5, type MindooDBAppBridgeErrorPayload as a6, type MindooDBAppBridgeHandshakeErrorMessage as a7, type MindooDBAppBridgeHostFocusChangedMessage as a8, type MindooDBAppBridgeIncomingContentMessage as a9, type MindooDBAppComponentChildren as aA, type MindooDBAppComponentContract as aB, type MindooDBAppComponentFieldValue as aC, type MindooDBAppComponentInfo as aD, type MindooDBAppComponentIntent as aE, type MindooDBAppComponentQuery as aF, type MindooDBAppComponentReference as aG, type MindooDBAppComponentSpec as aH, type MindooDBAppComponentsApi as aI, type MindooDBAppConfiguredViewCategorizationStyle as aJ, type MindooDBAppConfiguredViewColumn as aK, type MindooDBAppConfiguredViewColumnRole as aL, type MindooDBAppConfiguredViewExpressionMode as aM, type MindooDBAppConfiguredViewFieldExpression as aN, type MindooDBAppConfiguredViewFilterDefinition as aO, type MindooDBAppConfiguredViewFilterMode as aP, type MindooDBAppConfiguredViewFilterRule as aQ, type MindooDBAppConfiguredViewFormulaExpression as aR, type MindooDBAppConfiguredViewFormulaFilterDefinition as aS, type MindooDBAppConfiguredViewPreviewMode as aT, type MindooDBAppConfiguredViewRuleFilterDefinition as aU, type MindooDBAppConfiguredViewRuleMatchMode as aV, type MindooDBAppConfiguredViewRuleOperator as aW, type MindooDBAppConfiguredViewValueExpression as aX, type MindooDBAppCreateKeyInfo as aY, type MindooDBAppCreateViewInput as aZ, type MindooDBAppCreateViewNavigatorInput as a_, type MindooDBAppBridgeLocaleChangedMessage as aa, type MindooDBAppBridgePortMessage as ab, type MindooDBAppBridgeQueryResultMessage as ac, type MindooDBAppBridgeReminderOpenedMessage as ad, type MindooDBAppBridgeRpcError as ae, type MindooDBAppBridgeRpcMessage as af, type MindooDBAppBridgeRpcRequest as ag, type MindooDBAppBridgeRpcSuccess as ah, type MindooDBAppBridgeShortcutInvokedMessage as ai, type MindooDBAppBridgeShortcutsChangedMessage as aj, type MindooDBAppBridgeStreamAbortRequest as ak, type MindooDBAppBridgeStreamAck as al, type MindooDBAppBridgeStreamCloseRequest as am, type MindooDBAppBridgeStreamError as an, type MindooDBAppBridgeStreamMessage as ao, type MindooDBAppBridgeStreamOpenResult as ap, type MindooDBAppBridgeStreamReadRequest as aq, type MindooDBAppBridgeStreamWriteRequest as ar, type MindooDBAppBridgeThemeChangedMessage as as, type MindooDBAppBridgeUiPreferencesChangedMessage as at, type MindooDBAppBridgeViewChangedMessage as au, type MindooDBAppBridgeViewportChangedMessage as av, type MindooDBAppBridgeWorkspaceFocusRequestedMessage as aw, type MindooDBAppBrowserFeatures as ax, type MindooDBAppCapability as ay, type MindooDBAppComponentCategory as az, type MindooDBAppDragStartInput as b, type MindooDBAppIncomingSource as b$, type MindooDBAppDefinitionDatabase as b0, type MindooDBAppDefinitionListing as b1, type MindooDBAppDefinitionPermission as b2, type MindooDBAppDefinitionRegistrationPermission as b3, type MindooDBAppDefinitionScreenshot as b4, type MindooDBAppDefinitionValidation as b5, type MindooDBAppDirectoryApi as b6, type MindooDBAppDirectoryEntry as b7, type MindooDBAppDocumentApi as b8, type MindooDBAppDocumentHeadCursorResult as b9, type MindooDBAppEmbedDirtyEvent as bA, type MindooDBAppEmbedOpenInput as bB, type MindooDBAppEmbedRect as bC, type MindooDBAppEmbeddingApi as bD, type MindooDBAppEmbeddingLookupOptions as bE, type MindooDBAppEmbeddingLookupResult as bF, type MindooDBAppEmbedsApi as bG, type MindooDBAppEntryAttachmentRef as bH, type MindooDBAppEntryProvenance as bI, type MindooDBAppExtractDocumentTextInput as bJ, type MindooDBAppExtractDocumentTextResult as bK, type MindooDBAppExtractTextFormat as bL, type MindooDBAppExtractionSetup as bM, type MindooDBAppFulltextSetup as bN, type MindooDBAppHistoricalDocument as bO, type MindooDBAppHistoryQuery as bP, type MindooDBAppHostTheme as bQ, type MindooDBAppIdentityApi as bR, type MindooDBAppInaccessibleDocument as bS, type MindooDBAppInaccessibleDocumentListQuery as bT, type MindooDBAppInaccessibleDocumentListResult as bU, type MindooDBAppIncomingContent as bV, type MindooDBAppIncomingContentHandler as bW, type MindooDBAppIncomingContentInfo as bX, type MindooDBAppIncomingItem as bY, type MindooDBAppIncomingItemInfo as bZ, type MindooDBAppIncomingResult as b_, type MindooDBAppDocumentHistoryEntry as ba, type MindooDBAppDocumentListQuery as bb, type MindooDBAppDocumentListResult as bc, type MindooDBAppDocumentQuery as bd, type MindooDBAppDocumentRevisionId as be, type MindooDBAppDocumentScanPreset as bf, type MindooDBAppDocumentSummary as bg, type MindooDBAppDragApi as bh, type MindooDBAppDragCancelReason as bi, type MindooDBAppDragDropEvent as bj, type MindooDBAppDragEffect as bk, type MindooDBAppDragHoverResult as bl, type MindooDBAppDragOffer as bm, type MindooDBAppDragOverEvent as bn, type MindooDBAppDragPointer as bo, type MindooDBAppDragProfile as bp, type MindooDBAppEmbed as bq, type MindooDBAppEmbedAccessComponent as br, type MindooDBAppEmbedAccessInput as bs, type MindooDBAppEmbedAccessPair as bt, type MindooDBAppEmbedAccessResult as bu, type MindooDBAppEmbedAgentTools as bv, type MindooDBAppEmbedAgentToolsEvent as bw, type MindooDBAppEmbedCloseReason as bx, type MindooDBAppEmbedClosedEvent as by, type MindooDBAppEmbedContext as bz, type MindooDBAppDragStartResult as c, type MindooDBAppRichTextScalar as c$, type MindooDBAppJsonCounterIncrementPatch as c0, type MindooDBAppJsonListDeletePatch as c1, type MindooDBAppJsonListInsertPatch as c2, type MindooDBAppJsonPatch as c3, type MindooDBAppJsonSetPatch as c4, type MindooDBAppJsonTextMarkPatch as c5, type MindooDBAppJsonTextSplicePatch as c6, type MindooDBAppJsonTextUnmarkPatch as c7, type MindooDBAppJsonUnsetPatch as c8, type MindooDBAppLaunchContext as c9, type MindooDBAppProposeAppResult as cA, type MindooDBAppQueryCoverage as cB, type MindooDBAppQueryInclude as cC, type MindooDBAppQueryIncludeCardinality as cD, type MindooDBAppQueryIncludeSlots as cE, type MindooDBAppQueryResult as cF, type MindooDBAppQueryRow as cG, type MindooDBAppQuerySortKey as cH, type MindooDBAppQueryTextClause as cI, type MindooDBAppReadableAttachmentStream as cJ, type MindooDBAppRecipientOptions as cK, type MindooDBAppReminder as cL, type MindooDBAppReminderOpened as cM, type MindooDBAppReminderOpenedHandler as cN, type MindooDBAppReminderRequest as cO, type MindooDBAppReminderScheduleResult as cP, type MindooDBAppRemindersApi as cQ, type MindooDBAppResolvedViewDefinition as cR, type MindooDBAppResolvedViewSource as cS, type MindooDBAppRevisionPhase as cT, type MindooDBAppRevisionVerification as cU, type MindooDBAppRichTextBlockSpan as cV, type MindooDBAppRichTextGetOptions as cW, type MindooDBAppRichTextImmutableString as cX, type MindooDBAppRichTextMarkRange as cY, type MindooDBAppRichTextMaterializeValue as cZ, type MindooDBAppRichTextPatch as c_, type MindooDBAppListUsersOptions as ca, type MindooDBAppListUsersPage as cb, type MindooDBAppLiveQuerySubscription as cc, type MindooDBAppLocalizedText as cd, type MindooDBAppMenuAnchor as ce, type MindooDBAppMenuApi as cf, type MindooDBAppMenuCommandItem as cg, type MindooDBAppMenuDismissReason as ch, type MindooDBAppMenuDismissedResult as ci, type MindooDBAppMenuItem as cj, type MindooDBAppMenuKind as ck, type MindooDBAppMenuPlacement as cl, type MindooDBAppMenuPointAnchor as cm, type MindooDBAppMenuRect as cn, type MindooDBAppMenuRectAnchor as co, type MindooDBAppMenuSelectionResult as cp, type MindooDBAppMenuSeparatorItem as cq, type MindooDBAppNotificationSeverity as cr, type MindooDBAppNotifyInput as cs, type MindooDBAppNotifyResult as ct, type MindooDBAppPdfApi as cu, type MindooDBAppPdfSignInput as cv, type MindooDBAppPdfSignResult as cw, type MindooDBAppPdfSignaturePosition as cx, type MindooDBAppPdfSigner as cy, type MindooDBAppProposeAppInput as cz, type MindooDBAppDragPreview as d, type MindooDBAppRichTextSpliceStep as d0, type MindooDBAppRichTextStep as d1, type MindooDBAppRichTextStepPatch as d2, type MindooDBAppRichTextTextSpan as d3, type MindooDBAppRuntime as d4, type MindooDBAppScanAttachmentOptions as d5, type MindooDBAppScanAttachmentResult as d6, type MindooDBAppScopedDocId as d7, type MindooDBAppScopedDocumentSummary as d8, type MindooDBAppSealIntent as d9, type MindooDBAppViewCursorDocumentListResult as dA, type MindooDBAppViewCursorResult as dB, type MindooDBAppViewEntry as dC, type MindooDBAppViewEntryKind as dD, type MindooDBAppViewNavigator as dE, type MindooDBAppViewNavigatorExpansionState as dF, type MindooDBAppViewNavigatorOpenOptions as dG, type MindooDBAppViewNavigatorPageOptions as dH, type MindooDBAppViewNavigatorPageResult as dI, type MindooDBAppViewNavigatorRangeQuery as dJ, type MindooDBAppViewNavigatorSelectionState as dK, type MindooDBAppViewUpdateStats as dL, type MindooDBAppViewport as dM, type MindooDBAppWellKnownDragType as dN, type MindooDBAppWritableAttachmentStream as dO, mindooDBAppAcceptMatchesType as dP, mindooDBAppComponentFieldsMatch as dQ, resolveMindooDBAppDefinitionUrl as dR, resolveMindooDBAppListingAssetUrl as dS, resolveMindooDBAppLocalizedText as dT, validateMindooDBAppAccepts as dU, validateMindooDBAppComponents as dV, validateMindooDBAppDefinition as dW, type MindooDBAppSealedChannelOpenInput as da, type MindooDBAppSealedChannelOpenResult as db, type MindooDBAppSealedChannelRequestInput as dc, type MindooDBAppSession as dd, type MindooDBAppShowMenuInput as de, type MindooDBAppShowMenuResult as df, type MindooDBAppSignPreview as dg, type MindooDBAppSignPreviewScope as dh, type MindooDBAppSignStatementInput as di, type MindooDBAppSignStatementResult as dj, type MindooDBAppStorageApi as dk, type MindooDBAppSummarySetup as dl, type MindooDBAppTextCursorOptions as dm, type MindooDBAppTextCursorPosition as dn, type MindooDBAppTextCursorPositionsResult as dp, type MindooDBAppTextCursorsResult as dq, type MindooDBAppTextEdit as dr, type MindooDBAppTextPatch as ds, type MindooDBAppThemeMode as dt, type MindooDBAppTimestampApi as du, type MindooDBAppTimestampInput as dv, type MindooDBAppTimestampProvider as dw, type MindooDBAppTimestampResult as dx, type MindooDBAppUiPreferences as dy, type MindooDBAppUpdateDocumentInput as dz, type MindooDBAppBridge as e, type MindooDBAppAgentToolErrorCode as f, type MindooDBAppAgentTool as g, type MindooDBAppHostShortcutBinding as h, type MindooDBAppHostShortcutAction as i, type MindooDBAppHostingMode as j, type MindooDBAppDefinition as k, type MindooDBAppDatabase as l, type MindooDBAppDocument as m, type MindooDBAppRichTextSpan as n, type MindooDBAppRichTextSnapshot as o, type MindooDBAppCreateDocumentInput as p, MINDOODB_APP_ACCEPTS_MAX as q, MINDOODB_APP_COMPONENTS_MAX as r, MINDOODB_APP_COMPONENT_CONTRACT_PATTERN as s, MINDOODB_APP_DEFINITION_FILE_NAME as t, MINDOODB_APP_DEFINITION_FORMAT as u, MINDOODB_APP_DEFINITION_PERMISSIONS as v, MINDOODB_APP_DEFINITION_REGISTRATION_PERMISSIONS as w, MINDOODB_APP_DEFINITION_VERSION as x, MINDOODB_APP_LISTING_DESCRIPTION_MAX as y, MINDOODB_APP_LISTING_MAX_SCREENSHOTS as z };
4356
+ export { type MindooDBAppAgentRegistration as $, MINDOODB_APP_COMPONENTS_MAX as A, MINDOODB_APP_COMPONENT_CONTRACT_PATTERN as B, MINDOODB_APP_DEFINITION_FILE_NAME as C, MINDOODB_APP_DEFINITION_FORMAT as D, MINDOODB_APP_DEFINITION_PERMISSIONS as E, MINDOODB_APP_DEFINITION_REGISTRATION_PERMISSIONS as F, MINDOODB_APP_DEFINITION_VERSION as G, MINDOODB_APP_INSPECTION_FIELD as H, MINDOODB_APP_INSPECTION_MAX_BYTES as I, MINDOODB_APP_INSPECTION_SUMMARY_MAX_BYTES as J, MINDOODB_APP_ISSUES_MAX as K, MINDOODB_APP_LISTING_DESCRIPTION_MAX as L, type MindooDBAppAttachmentPreviewMode as M, MINDOODB_APP_LISTING_MAX_SCREENSHOTS as N, MINDOODB_APP_LISTING_SUMMARY_MAX as O, MINDOODB_APP_SEAL_SIGNING_DOMAIN as P, MINDOODB_APP_VALUE_TAG as Q, MINDOODB_APP_WELL_KNOWN_DRAG_TYPES as R, MINDOODB_INSPECT_DOCUMENT as S, MINDOODB_INSPECT_SLIDES as T, MINDOODB_INSPECT_SPREADSHEET as U, type MindooDBAppAcceptSpec as V, type MindooDBAppAccessDecision as W, type MindooDBAppAccessTier as X, type MindooDBAppAgentApi as Y, type MindooDBAppAgentCapability as Z, type MindooDBAppAgentProfile as _, type MindooDBAppDragBindSourceOptions as a, type MindooDBAppComponentReference as a$, type MindooDBAppAgentToolAnnotations as a0, type MindooDBAppAgentToolDescriptor as a1, type MindooDBAppAgentToolScope as a2, type MindooDBAppAtomicValue as a3, type MindooDBAppAttachmentApi as a4, type MindooDBAppAttachmentChunk as a5, type MindooDBAppAttachmentInfo as a6, type MindooDBAppAttachmentPreviewOptions as a7, type MindooDBAppAttachmentPreviewSession as a8, type MindooDBAppAutomergeChangesPatch as a9, type MindooDBAppBridgeRpcMessage as aA, type MindooDBAppBridgeRpcRequest as aB, type MindooDBAppBridgeRpcSuccess as aC, type MindooDBAppBridgeShortcutInvokedMessage as aD, type MindooDBAppBridgeShortcutsChangedMessage as aE, type MindooDBAppBridgeStreamAbortRequest as aF, type MindooDBAppBridgeStreamAck as aG, type MindooDBAppBridgeStreamCloseRequest as aH, type MindooDBAppBridgeStreamError as aI, type MindooDBAppBridgeStreamMessage as aJ, type MindooDBAppBridgeStreamOpenResult as aK, type MindooDBAppBridgeStreamReadRequest as aL, type MindooDBAppBridgeStreamWriteRequest as aM, type MindooDBAppBridgeThemeChangedMessage as aN, type MindooDBAppBridgeUiPreferencesChangedMessage as aO, type MindooDBAppBridgeViewChangedMessage as aP, type MindooDBAppBridgeViewportChangedMessage as aQ, type MindooDBAppBridgeWorkspaceFocusRequestedMessage as aR, type MindooDBAppBrowserFeatures as aS, type MindooDBAppCapability as aT, type MindooDBAppComponentCategory as aU, type MindooDBAppComponentChildren as aV, type MindooDBAppComponentContract as aW, type MindooDBAppComponentFieldValue as aX, type MindooDBAppComponentInfo as aY, type MindooDBAppComponentIntent as aZ, type MindooDBAppComponentQuery as a_, type MindooDBAppAutomergeChangesSince as aa, type MindooDBAppAutomergeGetOptions as ab, type MindooDBAppAutomergePatchResult as ac, type MindooDBAppAutomergeSnapshot as ad, type MindooDBAppBridgeAgentInvokeMessage as ae, type MindooDBAppBridgeAgentResultMessage as af, type MindooDBAppBridgeBeforeCloseAck as ag, type MindooDBAppBridgeBeforeCloseMessage as ah, type MindooDBAppBridgeConnectMessage as ai, type MindooDBAppBridgeConnectOptions as aj, type MindooDBAppBridgeConnectedMessage as ak, type MindooDBAppBridgeDragDropMessage as al, type MindooDBAppBridgeDragLeaveMessage as am, type MindooDBAppBridgeDragOverMessage as an, type MindooDBAppBridgeEmbedEventMessage as ao, type MindooDBAppBridgeEmbedRequestMessage as ap, type MindooDBAppBridgeEmbeddingRequestMessage as aq, type MindooDBAppBridgeErrorPayload as ar, type MindooDBAppBridgeHandshakeErrorMessage as as, type MindooDBAppBridgeHostFocusChangedMessage as at, type MindooDBAppBridgeIncomingContentMessage as au, type MindooDBAppBridgeLocaleChangedMessage as av, type MindooDBAppBridgePortMessage as aw, type MindooDBAppBridgeQueryResultMessage as ax, type MindooDBAppBridgeReminderOpenedMessage as ay, type MindooDBAppBridgeRpcError as az, type MindooDBAppDragStartInput as b, type MindooDBAppEmbedContext as b$, type MindooDBAppComponentSpec as b0, type MindooDBAppComponentsApi as b1, type MindooDBAppConfiguredViewCategorizationStyle as b2, type MindooDBAppConfiguredViewColumn as b3, type MindooDBAppConfiguredViewColumnRole as b4, type MindooDBAppConfiguredViewExpressionMode as b5, type MindooDBAppConfiguredViewFieldExpression as b6, type MindooDBAppConfiguredViewFilterDefinition as b7, type MindooDBAppConfiguredViewFilterMode as b8, type MindooDBAppConfiguredViewFilterRule as b9, type MindooDBAppDocumentQuery as bA, type MindooDBAppDocumentRevisionId as bB, type MindooDBAppDocumentRule as bC, type MindooDBAppDocumentRuleOutcome as bD, type MindooDBAppDocumentRules as bE, type MindooDBAppDocumentScanPreset as bF, type MindooDBAppDocumentSummary as bG, type MindooDBAppDragApi as bH, type MindooDBAppDragCancelReason as bI, type MindooDBAppDragDropEvent as bJ, type MindooDBAppDragEffect as bK, type MindooDBAppDragHoverResult as bL, type MindooDBAppDragOffer as bM, type MindooDBAppDragOverEvent as bN, type MindooDBAppDragPointer as bO, type MindooDBAppDragProfile as bP, type MindooDBAppEmbed as bQ, type MindooDBAppEmbedAccessComponent as bR, type MindooDBAppEmbedAccessInput as bS, type MindooDBAppEmbedAccessPair as bT, type MindooDBAppEmbedAccessResult as bU, type MindooDBAppEmbedAgentTools as bV, type MindooDBAppEmbedAgentToolsEvent as bW, type MindooDBAppEmbedBeforeSaveInput as bX, type MindooDBAppEmbedBeforeSaveResult as bY, type MindooDBAppEmbedCloseReason as bZ, type MindooDBAppEmbedClosedEvent as b_, type MindooDBAppConfiguredViewFormulaExpression as ba, type MindooDBAppConfiguredViewFormulaFilterDefinition as bb, type MindooDBAppConfiguredViewPreviewMode as bc, type MindooDBAppConfiguredViewRuleFilterDefinition as bd, type MindooDBAppConfiguredViewRuleMatchMode as be, type MindooDBAppConfiguredViewRuleOperator as bf, type MindooDBAppConfiguredViewValueExpression as bg, type MindooDBAppCounterValue as bh, type MindooDBAppCreateKeyInfo as bi, type MindooDBAppCreateViewInput as bj, type MindooDBAppCreateViewNavigatorInput as bk, type MindooDBAppDatabaseInfo as bl, type MindooDBAppDefinitionDatabase as bm, type MindooDBAppDefinitionListing as bn, type MindooDBAppDefinitionPermission as bo, type MindooDBAppDefinitionRegistrationPermission as bp, type MindooDBAppDefinitionScreenshot as bq, type MindooDBAppDefinitionValidation as br, type MindooDBAppDirectoryApi as bs, type MindooDBAppDirectoryEntry as bt, type MindooDBAppDocumentApi as bu, type MindooDBAppDocumentHeadCursorResult as bv, type MindooDBAppDocumentHistoryEntry as bw, type MindooDBAppDocumentInspection as bx, type MindooDBAppDocumentListQuery as by, type MindooDBAppDocumentListResult as bz, type MindooDBAppDragStartResult as c, type MindooDBAppMenuPointAnchor as c$, type MindooDBAppEmbedDirtyEvent as c0, type MindooDBAppEmbedOpenInput as c1, type MindooDBAppEmbedRect as c2, type MindooDBAppEmbedSavedEvent as c3, type MindooDBAppEmbedValidation as c4, MindooDBAppEmbedValidationError as c5, type MindooDBAppEmbeddingApi as c6, type MindooDBAppEmbeddingLookupOptions as c7, type MindooDBAppEmbeddingLookupResult as c8, type MindooDBAppEmbeddingResult as c9, type MindooDBAppInspection as cA, type MindooDBAppInspectionBase as cB, type MindooDBAppIssue as cC, type MindooDBAppIssueSeverity as cD, type MindooDBAppJsonCounterIncrementPatch as cE, type MindooDBAppJsonListDeletePatch as cF, type MindooDBAppJsonListInsertPatch as cG, type MindooDBAppJsonPatch as cH, type MindooDBAppJsonSetPatch as cI, type MindooDBAppJsonTextMarkPatch as cJ, type MindooDBAppJsonTextSplicePatch as cK, type MindooDBAppJsonTextUnmarkPatch as cL, type MindooDBAppJsonUnsetPatch as cM, type MindooDBAppLaunchContext as cN, type MindooDBAppListUsersOptions as cO, type MindooDBAppListUsersPage as cP, type MindooDBAppLiveQuerySubscription as cQ, type MindooDBAppLocaleMap as cR, type MindooDBAppLocalizedText as cS, type MindooDBAppMenuAnchor as cT, type MindooDBAppMenuApi as cU, type MindooDBAppMenuCommandItem as cV, type MindooDBAppMenuDismissReason as cW, type MindooDBAppMenuDismissedResult as cX, type MindooDBAppMenuItem as cY, type MindooDBAppMenuKind as cZ, type MindooDBAppMenuPlacement as c_, type MindooDBAppEmbeddingSaveContext as ca, type MindooDBAppEmbedsApi as cb, type MindooDBAppEntryAttachmentRef as cc, type MindooDBAppEntryProvenance as cd, type MindooDBAppExtractDocumentTextInput as ce, type MindooDBAppExtractDocumentTextResult as cf, type MindooDBAppExtractTextFormat as cg, type MindooDBAppExtractionSetup as ch, type MindooDBAppFulltextSetup as ci, type MindooDBAppHistoricalDocument as cj, type MindooDBAppHistoryQuery as ck, type MindooDBAppHostTheme as cl, type MindooDBAppIdentityApi as cm, type MindooDBAppInaccessibleDocument as cn, type MindooDBAppInaccessibleDocumentListQuery as co, type MindooDBAppInaccessibleDocumentListResult as cp, type MindooDBAppIncomingContent as cq, type MindooDBAppIncomingContentHandler as cr, type MindooDBAppIncomingContentInfo as cs, type MindooDBAppIncomingItem as ct, type MindooDBAppIncomingItemInfo as cu, type MindooDBAppIncomingResult as cv, type MindooDBAppIncomingSource as cw, type MindooDBAppInspectAnchor as cx, type MindooDBAppInspectRequest as cy, type MindooDBAppInspectedCell as cz, type MindooDBAppDragPreview as d, type MindooDBAppSpreadsheetInspection as d$, type MindooDBAppMenuRect as d0, type MindooDBAppMenuRectAnchor as d1, type MindooDBAppMenuSelectionResult as d2, type MindooDBAppMenuSeparatorItem as d3, type MindooDBAppNotificationSeverity as d4, type MindooDBAppNotifyInput as d5, type MindooDBAppNotifyResult as d6, type MindooDBAppPdfApi as d7, type MindooDBAppPdfSignInput as d8, type MindooDBAppPdfSignResult as d9, type MindooDBAppRichTextGetOptions as dA, type MindooDBAppRichTextImmutableString as dB, type MindooDBAppRichTextMarkRange as dC, type MindooDBAppRichTextMaterializeValue as dD, type MindooDBAppRichTextPatch as dE, type MindooDBAppRichTextScalar as dF, type MindooDBAppRichTextSpliceStep as dG, type MindooDBAppRichTextStep as dH, type MindooDBAppRichTextStepPatch as dI, type MindooDBAppRichTextTextSpan as dJ, type MindooDBAppRuntime as dK, type MindooDBAppScanAttachmentOptions as dL, type MindooDBAppScanAttachmentResult as dM, type MindooDBAppScopedDocId as dN, type MindooDBAppScopedDocumentSummary as dO, type MindooDBAppSealIntent as dP, type MindooDBAppSealedChannelOpenInput as dQ, type MindooDBAppSealedChannelOpenResult as dR, type MindooDBAppSealedChannelRequestInput as dS, type MindooDBAppSession as dT, type MindooDBAppShowMenuInput as dU, type MindooDBAppShowMenuResult as dV, type MindooDBAppSignPreview as dW, type MindooDBAppSignPreviewScope as dX, type MindooDBAppSignStatementInput as dY, type MindooDBAppSignStatementResult as dZ, type MindooDBAppSlidesInspection as d_, type MindooDBAppPdfSignaturePosition as da, type MindooDBAppPdfSigner as db, type MindooDBAppProposeAppInput as dc, type MindooDBAppProposeAppResult as dd, type MindooDBAppQueryCoverage as de, type MindooDBAppQueryInclude as df, type MindooDBAppQueryIncludeCardinality as dg, type MindooDBAppQueryIncludeSlots as dh, type MindooDBAppQueryResult as di, type MindooDBAppQueryRow as dj, type MindooDBAppQuerySortKey as dk, type MindooDBAppQueryTextClause as dl, type MindooDBAppReadableAttachmentStream as dm, type MindooDBAppRecipientOptions as dn, type MindooDBAppReminder as dp, type MindooDBAppReminderOpened as dq, type MindooDBAppReminderOpenedHandler as dr, type MindooDBAppReminderRequest as ds, type MindooDBAppReminderScheduleResult as dt, type MindooDBAppRemindersApi as du, type MindooDBAppResolvedViewDefinition as dv, type MindooDBAppResolvedViewSource as dw, type MindooDBAppRevisionPhase as dx, type MindooDBAppRevisionVerification as dy, type MindooDBAppRichTextBlockSpan as dz, type MindooDBAppBridge as e, type MindooDBAppStorageApi as e0, type MindooDBAppSummarySetup as e1, type MindooDBAppTextCursorOptions as e2, type MindooDBAppTextCursorPosition as e3, type MindooDBAppTextCursorPositionsResult as e4, type MindooDBAppTextCursorsResult as e5, type MindooDBAppTextEdit as e6, type MindooDBAppTextPatch as e7, type MindooDBAppThemeMode as e8, type MindooDBAppTimestampApi as e9, mindooDBAppComponentSupports as eA, mindooDBAppInspectContracts as eB, mindooDBAppInspectRules as eC, mindooDBAppInspectionSummaryValue as eD, normalizeMindooDBAppInspectAnchor as eE, normalizeMindooDBAppInspectRequest as eF, normalizeMindooDBAppInspection as eG, normalizeMindooDBAppIssues as eH, readMindooDBAppInspectionSummary as eI, resolveMindooDBAppDefinitionUrl as eJ, resolveMindooDBAppEmbedValidation as eK, resolveMindooDBAppListingAssetUrl as eL, resolveMindooDBAppLocalizedText as eM, summarizeMindooDBAppInspection as eN, validateMindooDBAppAccepts as eO, validateMindooDBAppAgentProfile as eP, validateMindooDBAppComponents as eQ, validateMindooDBAppDefinition as eR, type MindooDBAppTimestampInput as ea, type MindooDBAppTimestampProvider as eb, type MindooDBAppTimestampResult as ec, type MindooDBAppTimestampValue as ed, type MindooDBAppTypedValue as ee, type MindooDBAppUiPreferences as ef, type MindooDBAppUpdateDocumentInput as eg, MindooDBAppValue as eh, type MindooDBAppViewCursorDocumentListResult as ei, type MindooDBAppViewCursorResult as ej, type MindooDBAppViewEntry as ek, type MindooDBAppViewEntryKind as el, type MindooDBAppViewNavigator as em, type MindooDBAppViewNavigatorExpansionState as en, type MindooDBAppViewNavigatorOpenOptions as eo, type MindooDBAppViewNavigatorPageOptions as ep, type MindooDBAppViewNavigatorPageResult as eq, type MindooDBAppViewNavigatorRangeQuery as er, type MindooDBAppViewNavigatorSelectionState as es, type MindooDBAppViewUpdateStats as et, type MindooDBAppViewport as eu, type MindooDBAppWellKnownDragType as ev, type MindooDBAppWritableAttachmentStream as ew, defineDocumentRules as ex, mindooDBAppAcceptMatchesType as ey, mindooDBAppComponentFieldsMatch as ez, type MindooDBAppAgentToolErrorCode as f, type MindooDBAppAgentTool as g, type MindooDBAppHostShortcutBinding as h, type MindooDBAppHostShortcutAction as i, type MindooDBAppHostingMode as j, type MindooDBAppDefinition as k, type MindooDBAppDatabase as l, type MindooDBAppDocument as m, type MindooDBAppRichTextSpan as n, type MindooDBAppRichTextSnapshot as o, type MindooDBAppCreateDocumentInput as p, MINDOODB_APP_ACCEPTS_MAX as q, MINDOODB_APP_AGENT_CAPABILITIES_MAX as r, MINDOODB_APP_AGENT_CAPABILITY_TITLE_MAX as s, MINDOODB_APP_AGENT_CAPABILITY_TOOLS_MAX as t, MINDOODB_APP_AGENT_EXAMPLE_MAX as u, MINDOODB_APP_AGENT_GUIDE_MAX_BYTES as v, MINDOODB_APP_AGENT_LIMIT_MAX as w, MINDOODB_APP_AGENT_LIST_MAX as x, MINDOODB_APP_AGENT_SUMMARY_MAX as y, MINDOODB_APP_AGENT_TOOL_NAME_PATTERN as z };