mindoodb-app-sdk 0.0.65 → 0.0.67

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
@@ -1,5 +1,5 @@
1
- import { M as MindooDBAppAttachmentPreviewMode, a as MindooDBAppDragBindSourceOptions, b as MindooDBAppDragStartInput, c as MindooDBAppDragStartResult, d as MindooDBAppDragPreview, e as MindooDBAppBridge, f as MindooDBAppAgentToolErrorCode, g as MindooDBAppHostShortcutBinding, h as MindooDBAppHostShortcutAction, i as MindooDBAppHostingMode, j as MindooDBAppDefinition, k as MindooDBAppDatabase, l as MindooDBAppDocument, m as MindooDBAppRichTextSpan, n as MindooDBAppRichTextSnapshot, o as MindooDBAppCreateDocumentInput } from './types-BeRUxGKN.js';
2
- export { p as MINDOODB_APP_ACCEPTS_MAX, q as MINDOODB_APP_COMPONENTS_MAX, r as MINDOODB_APP_DEFINITION_FILE_NAME, s as MINDOODB_APP_DEFINITION_FORMAT, t as MINDOODB_APP_DEFINITION_PERMISSIONS, u as MINDOODB_APP_DEFINITION_REGISTRATION_PERMISSIONS, v as MINDOODB_APP_DEFINITION_VERSION, w as MINDOODB_APP_LISTING_DESCRIPTION_MAX, x as MINDOODB_APP_LISTING_MAX_SCREENSHOTS, y as MINDOODB_APP_LISTING_SUMMARY_MAX, z as MINDOODB_APP_SEAL_SIGNING_DOMAIN, A as MINDOODB_APP_WELL_KNOWN_DRAG_TYPES, B as MindooDBAppAcceptSpec, C as MindooDBAppAccessDecision, D as MindooDBAppAccessTier, E as MindooDBAppAgentApi, F as MindooDBAppAgentRegistration, G as MindooDBAppAgentTool, H as MindooDBAppAgentToolAnnotations, I as MindooDBAppAgentToolDescriptor, J as MindooDBAppAttachmentApi, K as MindooDBAppAttachmentChunk, L as MindooDBAppAttachmentInfo, N as MindooDBAppAttachmentPreviewOptions, O as MindooDBAppAttachmentPreviewSession, P as MindooDBAppAutomergeChangesPatch, Q as MindooDBAppAutomergeChangesSince, R as MindooDBAppAutomergeGetOptions, S as MindooDBAppAutomergePatchResult, T as MindooDBAppAutomergeSnapshot, U as MindooDBAppBridgeAgentInvokeMessage, V as MindooDBAppBridgeAgentResultMessage, W as MindooDBAppBridgeBeforeCloseAck, X as MindooDBAppBridgeBeforeCloseMessage, Y as MindooDBAppBridgeConnectMessage, Z as MindooDBAppBridgeConnectOptions, _ as MindooDBAppBridgeConnectedMessage, $ as MindooDBAppBridgeDragDropMessage, a0 as MindooDBAppBridgeDragLeaveMessage, a1 as MindooDBAppBridgeDragOverMessage, a2 as MindooDBAppBridgeEmbedEventMessage, a3 as MindooDBAppBridgeEmbeddingRequestMessage, a4 as MindooDBAppBridgeErrorPayload, a5 as MindooDBAppBridgeHandshakeErrorMessage, a6 as MindooDBAppBridgeHostFocusChangedMessage, a7 as MindooDBAppBridgeIncomingContentMessage, a8 as MindooDBAppBridgeLocaleChangedMessage, a9 as MindooDBAppBridgePortMessage, aa as MindooDBAppBridgeQueryResultMessage, ab as MindooDBAppBridgeRpcError, ac as MindooDBAppBridgeRpcMessage, ad as MindooDBAppBridgeRpcRequest, ae as MindooDBAppBridgeRpcSuccess, af as MindooDBAppBridgeShortcutInvokedMessage, ag as MindooDBAppBridgeShortcutsChangedMessage, ah as MindooDBAppBridgeStreamAbortRequest, ai as MindooDBAppBridgeStreamAck, aj as MindooDBAppBridgeStreamCloseRequest, ak as MindooDBAppBridgeStreamError, al as MindooDBAppBridgeStreamMessage, am as MindooDBAppBridgeStreamOpenResult, an as MindooDBAppBridgeStreamReadRequest, ao as MindooDBAppBridgeStreamWriteRequest, ap as MindooDBAppBridgeThemeChangedMessage, aq as MindooDBAppBridgeUiPreferencesChangedMessage, ar as MindooDBAppBridgeViewChangedMessage, as as MindooDBAppBridgeViewportChangedMessage, at as MindooDBAppBridgeWorkspaceFocusRequestedMessage, au as MindooDBAppBrowserFeatures, av as MindooDBAppCapability, aw as MindooDBAppComponentChildren, ax as MindooDBAppComponentFieldValue, ay as MindooDBAppComponentInfo, az as MindooDBAppComponentIntent, aA as MindooDBAppComponentQuery, aB as MindooDBAppComponentSpec, aC as MindooDBAppComponentsApi, aD as MindooDBAppConfiguredViewCategorizationStyle, aE as MindooDBAppConfiguredViewColumn, aF as MindooDBAppConfiguredViewColumnRole, aG as MindooDBAppConfiguredViewExpressionMode, aH as MindooDBAppConfiguredViewFieldExpression, aI as MindooDBAppConfiguredViewFilterDefinition, aJ as MindooDBAppConfiguredViewFilterMode, aK as MindooDBAppConfiguredViewFilterRule, aL as MindooDBAppConfiguredViewFormulaExpression, aM as MindooDBAppConfiguredViewFormulaFilterDefinition, aN as MindooDBAppConfiguredViewPreviewMode, aO as MindooDBAppConfiguredViewRuleFilterDefinition, aP as MindooDBAppConfiguredViewRuleMatchMode, aQ as MindooDBAppConfiguredViewRuleOperator, aR as MindooDBAppConfiguredViewValueExpression, aS as MindooDBAppCreateKeyInfo, aT as MindooDBAppCreateViewInput, aU as MindooDBAppCreateViewNavigatorInput, aV as MindooDBAppDatabaseInfo, aW as MindooDBAppDefinitionDatabase, aX as MindooDBAppDefinitionListing, aY as MindooDBAppDefinitionPermission, aZ as MindooDBAppDefinitionRegistrationPermission, a_ as MindooDBAppDefinitionScreenshot, a$ as MindooDBAppDefinitionValidation, b0 as MindooDBAppDirectoryApi, b1 as MindooDBAppDirectoryEntry, b2 as MindooDBAppDocumentApi, b3 as MindooDBAppDocumentHeadCursorResult, b4 as MindooDBAppDocumentHistoryEntry, b5 as MindooDBAppDocumentListQuery, b6 as MindooDBAppDocumentListResult, b7 as MindooDBAppDocumentQuery, b8 as MindooDBAppDocumentRevisionId, b9 as MindooDBAppDocumentScanPreset, ba as MindooDBAppDocumentSummary, bb as MindooDBAppDragApi, bc as MindooDBAppDragCancelReason, bd as MindooDBAppDragDropEvent, be as MindooDBAppDragEffect, bf as MindooDBAppDragHoverResult, bg as MindooDBAppDragOffer, bh as MindooDBAppDragOverEvent, bi as MindooDBAppDragPointer, bj as MindooDBAppDragProfile, bk as MindooDBAppEmbed, bl as MindooDBAppEmbedCloseReason, bm as MindooDBAppEmbedClosedEvent, bn as MindooDBAppEmbedContext, bo as MindooDBAppEmbedDirtyEvent, bp as MindooDBAppEmbedOpenInput, bq as MindooDBAppEmbedRect, br as MindooDBAppEmbeddingApi, bs as MindooDBAppEmbedsApi, bt as MindooDBAppEntryAttachmentRef, bu as MindooDBAppEntryProvenance, bv as MindooDBAppExtractDocumentTextInput, bw as MindooDBAppExtractDocumentTextResult, bx as MindooDBAppExtractTextFormat, by as MindooDBAppExtractionSetup, bz as MindooDBAppFulltextSetup, bA as MindooDBAppHistoricalDocument, bB as MindooDBAppHistoryQuery, bC as MindooDBAppHostTheme, bD as MindooDBAppIdentityApi, bE as MindooDBAppInaccessibleDocument, bF as MindooDBAppInaccessibleDocumentListQuery, bG as MindooDBAppInaccessibleDocumentListResult, bH as MindooDBAppIncomingContent, bI as MindooDBAppIncomingContentHandler, bJ as MindooDBAppIncomingContentInfo, bK as MindooDBAppIncomingItem, bL as MindooDBAppIncomingItemInfo, bM as MindooDBAppIncomingResult, bN as MindooDBAppIncomingSource, bO as MindooDBAppJsonCounterIncrementPatch, bP as MindooDBAppJsonListDeletePatch, bQ as MindooDBAppJsonListInsertPatch, bR as MindooDBAppJsonPatch, bS as MindooDBAppJsonSetPatch, bT as MindooDBAppJsonTextMarkPatch, bU as MindooDBAppJsonTextSplicePatch, bV as MindooDBAppJsonTextUnmarkPatch, bW as MindooDBAppJsonUnsetPatch, bX as MindooDBAppLaunchContext, bY as MindooDBAppListUsersOptions, bZ as MindooDBAppListUsersPage, b_ as MindooDBAppLiveQuerySubscription, b$ as MindooDBAppLocalizedText, c0 as MindooDBAppMenuAnchor, c1 as MindooDBAppMenuApi, c2 as MindooDBAppMenuCommandItem, c3 as MindooDBAppMenuDismissReason, c4 as MindooDBAppMenuDismissedResult, c5 as MindooDBAppMenuItem, c6 as MindooDBAppMenuKind, c7 as MindooDBAppMenuPlacement, c8 as MindooDBAppMenuPointAnchor, c9 as MindooDBAppMenuRect, ca as MindooDBAppMenuRectAnchor, cb as MindooDBAppMenuSelectionResult, cc as MindooDBAppMenuSeparatorItem, cd as MindooDBAppNotificationSeverity, ce as MindooDBAppNotifyInput, cf as MindooDBAppNotifyResult, cg as MindooDBAppProposeAppInput, ch as MindooDBAppProposeAppResult, ci as MindooDBAppQueryCoverage, cj as MindooDBAppQueryInclude, ck as MindooDBAppQueryIncludeCardinality, cl as MindooDBAppQueryIncludeSlots, cm as MindooDBAppQueryResult, cn as MindooDBAppQueryRow, co as MindooDBAppQuerySortKey, cp as MindooDBAppQueryTextClause, cq as MindooDBAppReadableAttachmentStream, cr as MindooDBAppRecipientOptions, cs as MindooDBAppResolvedViewDefinition, ct as MindooDBAppResolvedViewSource, cu as MindooDBAppRevisionPhase, cv as MindooDBAppRevisionVerification, cw as MindooDBAppRichTextBlockSpan, cx as MindooDBAppRichTextGetOptions, cy as MindooDBAppRichTextImmutableString, cz as MindooDBAppRichTextMarkRange, cA as MindooDBAppRichTextMaterializeValue, cB as MindooDBAppRichTextPatch, cC as MindooDBAppRichTextScalar, cD as MindooDBAppRichTextSpliceStep, cE as MindooDBAppRichTextStep, cF as MindooDBAppRichTextStepPatch, cG as MindooDBAppRichTextTextSpan, cH as MindooDBAppRuntime, cI as MindooDBAppScanAttachmentOptions, cJ as MindooDBAppScanAttachmentResult, cK as MindooDBAppScopedDocId, cL as MindooDBAppScopedDocumentSummary, cM as MindooDBAppSealIntent, cN as MindooDBAppSealedChannelOpenInput, cO as MindooDBAppSealedChannelOpenResult, cP as MindooDBAppSealedChannelRequestInput, cQ as MindooDBAppSession, cR as MindooDBAppShowMenuInput, cS as MindooDBAppShowMenuResult, cT as MindooDBAppSignPreview, cU as MindooDBAppSignPreviewScope, cV as MindooDBAppSignStatementInput, cW as MindooDBAppSignStatementResult, cX as MindooDBAppStorageApi, cY as MindooDBAppSummarySetup, cZ as MindooDBAppTextCursorOptions, c_ as MindooDBAppTextCursorPosition, c$ as MindooDBAppTextCursorPositionsResult, d0 as MindooDBAppTextCursorsResult, d1 as MindooDBAppTextEdit, d2 as MindooDBAppTextPatch, d3 as MindooDBAppThemeMode, d4 as MindooDBAppTimestampApi, d5 as MindooDBAppTimestampInput, d6 as MindooDBAppTimestampProvider, d7 as MindooDBAppTimestampResult, d8 as MindooDBAppUiPreferences, d9 as MindooDBAppUpdateDocumentInput, da as MindooDBAppViewCursorDocumentListResult, db as MindooDBAppViewCursorResult, dc as MindooDBAppViewEntry, dd as MindooDBAppViewEntryKind, de as MindooDBAppViewNavigator, df as MindooDBAppViewNavigatorExpansionState, dg as MindooDBAppViewNavigatorOpenOptions, dh as MindooDBAppViewNavigatorPageOptions, di as MindooDBAppViewNavigatorPageResult, dj as MindooDBAppViewNavigatorRangeQuery, dk as MindooDBAppViewNavigatorSelectionState, dl as MindooDBAppViewUpdateStats, dm as MindooDBAppViewport, dn as MindooDBAppWellKnownDragType, dp as MindooDBAppWritableAttachmentStream, dq as mindooDBAppAcceptMatchesType, dr as mindooDBAppComponentFieldsMatch, ds as resolveMindooDBAppDefinitionUrl, dt as resolveMindooDBAppListingAssetUrl, du as resolveMindooDBAppLocalizedText, dv as validateMindooDBAppAccepts, dw as validateMindooDBAppComponents, dx as validateMindooDBAppDefinition } from './types-BeRUxGKN.js';
1
+ import { M as MindooDBAppAttachmentPreviewMode, a as MindooDBAppDragBindSourceOptions, b as MindooDBAppDragStartInput, c as MindooDBAppDragStartResult, d as MindooDBAppDragPreview, e as MindooDBAppBridge, f as MindooDBAppAgentToolErrorCode, g as MindooDBAppAgentTool, h as MindooDBAppHostShortcutBinding, i as MindooDBAppHostShortcutAction, j as MindooDBAppHostingMode, k as MindooDBAppDefinition, l as MindooDBAppDatabase, m as MindooDBAppDocument, n as MindooDBAppRichTextSpan, o as MindooDBAppRichTextSnapshot, p as MindooDBAppCreateDocumentInput } from './types-BGLXh4JQ.js';
2
+ export { q as MINDOODB_APP_ACCEPTS_MAX, r as MINDOODB_APP_COMPONENTS_MAX, s as MINDOODB_APP_COMPONENT_CONTRACT_PATTERN, t as MINDOODB_APP_DEFINITION_FILE_NAME, u as MINDOODB_APP_DEFINITION_FORMAT, v as MINDOODB_APP_DEFINITION_PERMISSIONS, w as MINDOODB_APP_DEFINITION_REGISTRATION_PERMISSIONS, x as MINDOODB_APP_DEFINITION_VERSION, y as MINDOODB_APP_LISTING_DESCRIPTION_MAX, z as MINDOODB_APP_LISTING_MAX_SCREENSHOTS, A as MINDOODB_APP_LISTING_SUMMARY_MAX, B as MINDOODB_APP_SEAL_SIGNING_DOMAIN, C as MINDOODB_APP_WELL_KNOWN_DRAG_TYPES, D as MindooDBAppAcceptSpec, E as MindooDBAppAccessDecision, F as MindooDBAppAccessTier, G as MindooDBAppAgentApi, H as MindooDBAppAgentRegistration, I as MindooDBAppAgentToolAnnotations, J as MindooDBAppAgentToolDescriptor, K as MindooDBAppAgentToolScope, L as MindooDBAppAttachmentApi, N as MindooDBAppAttachmentChunk, O as MindooDBAppAttachmentInfo, P as MindooDBAppAttachmentPreviewOptions, Q as MindooDBAppAttachmentPreviewSession, R as MindooDBAppAutomergeChangesPatch, S as MindooDBAppAutomergeChangesSince, T as MindooDBAppAutomergeGetOptions, U as MindooDBAppAutomergePatchResult, V as MindooDBAppAutomergeSnapshot, W as MindooDBAppBridgeAgentInvokeMessage, X as MindooDBAppBridgeAgentResultMessage, Y as MindooDBAppBridgeBeforeCloseAck, Z as MindooDBAppBridgeBeforeCloseMessage, _ as MindooDBAppBridgeConnectMessage, $ as MindooDBAppBridgeConnectOptions, a0 as MindooDBAppBridgeConnectedMessage, a1 as MindooDBAppBridgeDragDropMessage, a2 as MindooDBAppBridgeDragLeaveMessage, a3 as MindooDBAppBridgeDragOverMessage, a4 as MindooDBAppBridgeEmbedEventMessage, a5 as MindooDBAppBridgeEmbeddingRequestMessage, a6 as MindooDBAppBridgeErrorPayload, a7 as MindooDBAppBridgeHandshakeErrorMessage, a8 as MindooDBAppBridgeHostFocusChangedMessage, a9 as MindooDBAppBridgeIncomingContentMessage, aa as MindooDBAppBridgeLocaleChangedMessage, ab as MindooDBAppBridgePortMessage, ac as MindooDBAppBridgeQueryResultMessage, ad as MindooDBAppBridgeRpcError, ae as MindooDBAppBridgeRpcMessage, af as MindooDBAppBridgeRpcRequest, ag as MindooDBAppBridgeRpcSuccess, ah as MindooDBAppBridgeShortcutInvokedMessage, ai as MindooDBAppBridgeShortcutsChangedMessage, aj as MindooDBAppBridgeStreamAbortRequest, ak as MindooDBAppBridgeStreamAck, al as MindooDBAppBridgeStreamCloseRequest, am as MindooDBAppBridgeStreamError, an as MindooDBAppBridgeStreamMessage, ao as MindooDBAppBridgeStreamOpenResult, ap as MindooDBAppBridgeStreamReadRequest, aq as MindooDBAppBridgeStreamWriteRequest, ar as MindooDBAppBridgeThemeChangedMessage, as as MindooDBAppBridgeUiPreferencesChangedMessage, at as MindooDBAppBridgeViewChangedMessage, au as MindooDBAppBridgeViewportChangedMessage, av as MindooDBAppBridgeWorkspaceFocusRequestedMessage, aw as MindooDBAppBrowserFeatures, ax as MindooDBAppCapability, ay as MindooDBAppComponentCategory, az as MindooDBAppComponentChildren, aA as MindooDBAppComponentContract, aB as MindooDBAppComponentFieldValue, aC as MindooDBAppComponentInfo, aD as MindooDBAppComponentIntent, aE as MindooDBAppComponentQuery, aF as MindooDBAppComponentReference, aG as MindooDBAppComponentSpec, aH as MindooDBAppComponentsApi, aI as MindooDBAppConfiguredViewCategorizationStyle, aJ as MindooDBAppConfiguredViewColumn, aK as MindooDBAppConfiguredViewColumnRole, aL as MindooDBAppConfiguredViewExpressionMode, aM as MindooDBAppConfiguredViewFieldExpression, aN as MindooDBAppConfiguredViewFilterDefinition, aO as MindooDBAppConfiguredViewFilterMode, aP as MindooDBAppConfiguredViewFilterRule, aQ as MindooDBAppConfiguredViewFormulaExpression, aR as MindooDBAppConfiguredViewFormulaFilterDefinition, aS as MindooDBAppConfiguredViewPreviewMode, aT as MindooDBAppConfiguredViewRuleFilterDefinition, aU as MindooDBAppConfiguredViewRuleMatchMode, aV as MindooDBAppConfiguredViewRuleOperator, aW as MindooDBAppConfiguredViewValueExpression, aX as MindooDBAppCreateKeyInfo, aY as MindooDBAppCreateViewInput, aZ as MindooDBAppCreateViewNavigatorInput, a_ as MindooDBAppDatabaseInfo, a$ as MindooDBAppDefinitionDatabase, b0 as MindooDBAppDefinitionListing, b1 as MindooDBAppDefinitionPermission, b2 as MindooDBAppDefinitionRegistrationPermission, b3 as MindooDBAppDefinitionScreenshot, b4 as MindooDBAppDefinitionValidation, b5 as MindooDBAppDirectoryApi, b6 as MindooDBAppDirectoryEntry, b7 as MindooDBAppDocumentApi, b8 as MindooDBAppDocumentHeadCursorResult, b9 as MindooDBAppDocumentHistoryEntry, ba as MindooDBAppDocumentListQuery, bb as MindooDBAppDocumentListResult, bc as MindooDBAppDocumentQuery, bd as MindooDBAppDocumentRevisionId, be as MindooDBAppDocumentScanPreset, bf as MindooDBAppDocumentSummary, bg as MindooDBAppDragApi, bh as MindooDBAppDragCancelReason, bi as MindooDBAppDragDropEvent, bj as MindooDBAppDragEffect, bk as MindooDBAppDragHoverResult, bl as MindooDBAppDragOffer, bm as MindooDBAppDragOverEvent, bn as MindooDBAppDragPointer, bo as MindooDBAppDragProfile, bp as MindooDBAppEmbed, bq as MindooDBAppEmbedAccessComponent, br as MindooDBAppEmbedAccessInput, bs as MindooDBAppEmbedAccessPair, bt as MindooDBAppEmbedAccessResult, bu as MindooDBAppEmbedAgentTools, bv as MindooDBAppEmbedAgentToolsEvent, bw as MindooDBAppEmbedCloseReason, bx as MindooDBAppEmbedClosedEvent, by as MindooDBAppEmbedContext, bz as MindooDBAppEmbedDirtyEvent, bA as MindooDBAppEmbedOpenInput, bB as MindooDBAppEmbedRect, bC as MindooDBAppEmbeddingApi, bD as MindooDBAppEmbeddingLookupOptions, bE as MindooDBAppEmbeddingLookupResult, bF as MindooDBAppEmbedsApi, bG as MindooDBAppEntryAttachmentRef, bH as MindooDBAppEntryProvenance, bI as MindooDBAppExtractDocumentTextInput, bJ as MindooDBAppExtractDocumentTextResult, bK as MindooDBAppExtractTextFormat, bL as MindooDBAppExtractionSetup, bM as MindooDBAppFulltextSetup, bN as MindooDBAppHistoricalDocument, bO as MindooDBAppHistoryQuery, bP as MindooDBAppHostTheme, bQ as MindooDBAppIdentityApi, bR as MindooDBAppInaccessibleDocument, bS as MindooDBAppInaccessibleDocumentListQuery, bT as MindooDBAppInaccessibleDocumentListResult, bU as MindooDBAppIncomingContent, bV as MindooDBAppIncomingContentHandler, bW as MindooDBAppIncomingContentInfo, bX as MindooDBAppIncomingItem, bY as MindooDBAppIncomingItemInfo, bZ as MindooDBAppIncomingResult, b_ as MindooDBAppIncomingSource, b$ as MindooDBAppJsonCounterIncrementPatch, c0 as MindooDBAppJsonListDeletePatch, c1 as MindooDBAppJsonListInsertPatch, c2 as MindooDBAppJsonPatch, c3 as MindooDBAppJsonSetPatch, c4 as MindooDBAppJsonTextMarkPatch, c5 as MindooDBAppJsonTextSplicePatch, c6 as MindooDBAppJsonTextUnmarkPatch, c7 as MindooDBAppJsonUnsetPatch, c8 as MindooDBAppLaunchContext, c9 as MindooDBAppListUsersOptions, ca as MindooDBAppListUsersPage, cb as MindooDBAppLiveQuerySubscription, cc as MindooDBAppLocalizedText, cd as MindooDBAppMenuAnchor, ce as MindooDBAppMenuApi, cf as MindooDBAppMenuCommandItem, cg as MindooDBAppMenuDismissReason, ch as MindooDBAppMenuDismissedResult, ci as MindooDBAppMenuItem, cj as MindooDBAppMenuKind, ck as MindooDBAppMenuPlacement, cl as MindooDBAppMenuPointAnchor, cm as MindooDBAppMenuRect, cn as MindooDBAppMenuRectAnchor, co as MindooDBAppMenuSelectionResult, cp as MindooDBAppMenuSeparatorItem, cq as MindooDBAppNotificationSeverity, cr as MindooDBAppNotifyInput, cs as MindooDBAppNotifyResult, ct as MindooDBAppProposeAppInput, cu as MindooDBAppProposeAppResult, cv as MindooDBAppQueryCoverage, cw as MindooDBAppQueryInclude, cx as MindooDBAppQueryIncludeCardinality, cy as MindooDBAppQueryIncludeSlots, cz as MindooDBAppQueryResult, cA as MindooDBAppQueryRow, cB as MindooDBAppQuerySortKey, cC as MindooDBAppQueryTextClause, cD as MindooDBAppReadableAttachmentStream, cE as MindooDBAppRecipientOptions, cF as MindooDBAppResolvedViewDefinition, cG as MindooDBAppResolvedViewSource, cH as MindooDBAppRevisionPhase, cI as MindooDBAppRevisionVerification, cJ as MindooDBAppRichTextBlockSpan, cK as MindooDBAppRichTextGetOptions, cL as MindooDBAppRichTextImmutableString, cM as MindooDBAppRichTextMarkRange, cN as MindooDBAppRichTextMaterializeValue, cO as MindooDBAppRichTextPatch, cP as MindooDBAppRichTextScalar, cQ as MindooDBAppRichTextSpliceStep, cR as MindooDBAppRichTextStep, cS as MindooDBAppRichTextStepPatch, cT as MindooDBAppRichTextTextSpan, cU as MindooDBAppRuntime, cV as MindooDBAppScanAttachmentOptions, cW as MindooDBAppScanAttachmentResult, cX as MindooDBAppScopedDocId, cY as MindooDBAppScopedDocumentSummary, cZ as MindooDBAppSealIntent, c_ as MindooDBAppSealedChannelOpenInput, c$ as MindooDBAppSealedChannelOpenResult, d0 as MindooDBAppSealedChannelRequestInput, d1 as MindooDBAppSession, d2 as MindooDBAppShowMenuInput, d3 as MindooDBAppShowMenuResult, d4 as MindooDBAppSignPreview, d5 as MindooDBAppSignPreviewScope, d6 as MindooDBAppSignStatementInput, d7 as MindooDBAppSignStatementResult, d8 as MindooDBAppStorageApi, d9 as MindooDBAppSummarySetup, da as MindooDBAppTextCursorOptions, db as MindooDBAppTextCursorPosition, dc as MindooDBAppTextCursorPositionsResult, dd as MindooDBAppTextCursorsResult, de as MindooDBAppTextEdit, df as MindooDBAppTextPatch, dg as MindooDBAppThemeMode, dh as MindooDBAppTimestampApi, di as MindooDBAppTimestampInput, dj as MindooDBAppTimestampProvider, dk as MindooDBAppTimestampResult, dl as MindooDBAppUiPreferences, dm as MindooDBAppUpdateDocumentInput, dn as MindooDBAppViewCursorDocumentListResult, dp as MindooDBAppViewCursorResult, dq as MindooDBAppViewEntry, dr as MindooDBAppViewEntryKind, ds as MindooDBAppViewNavigator, dt as MindooDBAppViewNavigatorExpansionState, du as MindooDBAppViewNavigatorOpenOptions, dv as MindooDBAppViewNavigatorPageOptions, dw as MindooDBAppViewNavigatorPageResult, dx as MindooDBAppViewNavigatorRangeQuery, dy as MindooDBAppViewNavigatorSelectionState, dz as MindooDBAppViewUpdateStats, dA as MindooDBAppViewport, dB as MindooDBAppWellKnownDragType, dC as MindooDBAppWritableAttachmentStream, dD as mindooDBAppAcceptMatchesType, dE as mindooDBAppComponentFieldsMatch, dF as resolveMindooDBAppDefinitionUrl, dG as resolveMindooDBAppListingAssetUrl, dH as resolveMindooDBAppLocalizedText, dI as validateMindooDBAppAccepts, dJ as validateMindooDBAppComponents, dK as validateMindooDBAppDefinition } from './types-BGLXh4JQ.js';
3
3
  export { M as MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME, a as MINDOODB_APP_BUNDLE_MANIFEST_FILE_NAME, b as MINDOODB_APP_BUNDLE_MANIFEST_FORMAT, c as MINDOODB_APP_BUNDLE_MANIFEST_VERSION, d as MindooDBAppBundleArchive, e as MindooDBAppBundleFileEntry, f as MindooDBAppBundleHash, g as MindooDBAppBundleManifest, h as MindooDBAppBundleManifestValidation, i as buildMindooDBAppBundleContentHashInput, j as isMindooDBAppBundleHash, n as normalizeMindooDBAppBundlePath, v as validateMindooDBAppBundleManifest } from './appBundleManifest-B0xfpaXG.js';
4
4
  import { MindooDBAppBooleanExpression } from 'mindoodb-view-language';
5
5
  export { MindooDBAppBooleanExpression, MindooDBAppExpression, MindooDBAppFilterDefinition, MindooDBAppViewCategoryChildrenPageRequest, MindooDBAppViewColumn, MindooDBAppViewColumnRole, MindooDBAppViewDefinition, MindooDBAppViewExpansionState, MindooDBAppViewExpressionBase, MindooDBAppViewExpressionDatePart, MindooDBAppViewExpressionOperation, MindooDBAppViewFieldExpression, MindooDBAppViewIfExpression, MindooDBAppViewLetExpression, MindooDBAppViewLiteralExpression, MindooDBAppViewLookupByPath, MindooDBAppViewOperationExpression, MindooDBAppViewOriginExpression, MindooDBAppViewPageRequest, MindooDBAppViewPageResult, MindooDBAppViewRow, MindooDBAppViewSortDirection, MindooDBAppViewTotalMode, MindooDBAppViewValueExpressionRef, MindooDBAppViewVariableExpression, createViewLanguage } from 'mindoodb-view-language';
@@ -218,6 +218,92 @@ declare class MindooDBAppAgentToolError extends Error {
218
218
  constructor(code: MindooDBAppAgentToolErrorCode, message: string, requiredAction?: string);
219
219
  }
220
220
 
221
+ /**
222
+ * A reference tool for an app's edit language ("ops_guide"), so the edit tools
223
+ * themselves can keep short descriptions.
224
+ *
225
+ * Without arguments the tool answers with the group list and one signature line
226
+ * per op, a few KB that tell an agent what exists. With `groups` it returns the
227
+ * full reference of those groups: field tables, units, runnable JSON examples
228
+ * and common mistakes. Agents load the groups they need before a batch they have
229
+ * not sent before, instead of every request carrying all of it.
230
+ *
231
+ * @module agentGuide
232
+ */
233
+
234
+ /** One field of an op, as a row of the group's field table. */
235
+ interface MindooDBAppAgentGuideField {
236
+ name: string;
237
+ /** Short type: `string`, `number (pt)`, `"left" | "center"`, `{start, end?}`. */
238
+ type: string;
239
+ required?: boolean;
240
+ description: string;
241
+ }
242
+ /** One op (or one kind of entry) of an edit tool. */
243
+ interface MindooDBAppAgentGuideOp {
244
+ /** The op's name as the agent writes it (`insertContent`, `style`). */
245
+ name: string;
246
+ /** Compact usage: the fields, `?` marking optional ones (`{target, markdown}`). */
247
+ signature: string;
248
+ /** One or two sentences: what it does, when to use it. */
249
+ summary?: string;
250
+ fields?: MindooDBAppAgentGuideField[];
251
+ /** JSON values an agent can send as they are; shown as ```json blocks. Test them. */
252
+ examples?: unknown[];
253
+ notes?: string[];
254
+ }
255
+ /** A group of ops, loaded together. */
256
+ interface MindooDBAppAgentGuideGroup {
257
+ /** Id the agent passes in `groups`: lower case, digits, `_` or `-`. */
258
+ name: string;
259
+ /** One line for the group list. */
260
+ summary: string;
261
+ /** Heading of the group's reference; default `name`. */
262
+ title?: string;
263
+ /**
264
+ * The group's whole reference as Markdown, for apps that keep it elsewhere.
265
+ * Replaces what `intro`, `ops` and `mistakes` would render; `ops` still feed
266
+ * the signature index.
267
+ */
268
+ content?: string;
269
+ /** Prose before the ops: units, addressing, what applies to all of them. */
270
+ intro?: string;
271
+ ops?: MindooDBAppAgentGuideOp[];
272
+ mistakes?: string[];
273
+ }
274
+ interface MindooDBAppAgentGuideOptions {
275
+ /** Tool name within the app; default `ops_guide`. */
276
+ name?: string;
277
+ /**
278
+ * Full tool description. Default: names `documents`, explains the two modes and
279
+ * lists the groups.
280
+ */
281
+ description?: string;
282
+ /** The tool(s) the guide documents, as agents see them (`teamedit_markdown_apply_ops`). */
283
+ documents?: string;
284
+ groups: MindooDBAppAgentGuideGroup[];
285
+ /**
286
+ * Signature index returned without `groups`. Default: one `## group` heading per
287
+ * group with an `opName signature` line per op.
288
+ */
289
+ signatures?: string | (() => string);
290
+ }
291
+ /** The group's reference as Markdown, as the guide tool returns it. */
292
+ declare function renderAgentGuideGroup(group: MindooDBAppAgentGuideGroup): string;
293
+ /** `opName signature` lines per group: what exists and how each op is shaped. */
294
+ declare function agentGuideSignatureIndex(groups: MindooDBAppAgentGuideGroup[]): string;
295
+ /** Every example of the guide, for a test that runs each one through the real tool. */
296
+ declare function agentGuideExamples(groups: MindooDBAppAgentGuideGroup[]): Array<{
297
+ group: string;
298
+ op: string;
299
+ example: unknown;
300
+ }>;
301
+ /**
302
+ * Builds the guide tool. Register it next to the edit tools and point their
303
+ * descriptions at it ("signatures and examples: <prefix>_ops_guide").
304
+ */
305
+ declare function createAgentGuideTool(options: MindooDBAppAgentGuideOptions): MindooDBAppAgentTool;
306
+
221
307
  /**
222
308
  * Haven's default host chords. Both sides of the bridge use this table so a
223
309
  * key that Haven handles on its own pages is the same key an iframe reports.
@@ -611,4 +697,4 @@ declare function inheritDocumentEncryption(parent: Pick<MindooDBAppDocument, "de
611
697
  */
612
698
  declare function watchWordChunks(database: MindooDBAppDatabase, parentId: string, listener: (docIds: string[]) => void): Promise<() => Promise<void>>;
613
699
 
614
- export { type CreateMindooDBRichTextHandleOptions, type CreateMindooDBTextBufferOptions, DEFAULT_DRAG_LONG_PRESS_MS, DEFAULT_DRAG_POINTER_THRESHOLD_PX, DEFAULT_HAVEN_HOST_SHORTCUTS, DEFAULT_HAVEN_URL, type HavenAppLandingPage, type HavenStorageShimHandle, type InstallHavenStorageShimOptions, type ListingBlock, type ListingInline, MINDOODB_APP_HOSTING_QUERY_PARAM, MINDOODB_APP_LAUNCH_ID_QUERY_PARAM, MINDOODB_APP_MAX_DRAG_PAYLOAD_BYTES, MINDOODB_APP_MAX_DRAG_PREVIEW_BYTES, MINDOODB_APP_MAX_DRAG_PREVIEW_EDGE, MINDOODB_APP_MAX_DRAG_TYPES, MINDOODB_APP_VALUE_TAG, MINDOODB_CUSTOM_DOCUMENT_ID_PATTERN, MINDOODB_DOCUMENT_ID_PREFIX_PATTERN, MINIMAL_DRAG_PREVIEW_PNG, MindooDBAppAgentToolError, MindooDBAppAgentToolErrorCode, type MindooDBAppAtomicValue, MindooDBAppAttachmentPreviewMode, MindooDBAppBridge, type MindooDBAppCounterValue, MindooDBAppCreateDocumentInput, MindooDBAppDatabase, MindooDBAppDefinition, MindooDBAppDocument, MindooDBAppDragBindSourceOptions, MindooDBAppDragInputError, MindooDBAppDragPreview, MindooDBAppDragStartInput, MindooDBAppDragStartResult, MindooDBAppHostShortcutAction, MindooDBAppHostShortcutBinding, MindooDBAppHostingMode, MindooDBAppRichTextSnapshot, MindooDBAppRichTextSpan, type MindooDBAppTimestampValue, type MindooDBAppTypedValue, MindooDBAppValue, MindooDBRichTextHandle, type MindooDBRichTextHandleChangeListener, type MindooDBRichTextHandleFlushResult, MindooDBTextBuffer, type MindooDBTextBufferFlushResult, type RenderHavenAppLandingPageOptions, abbreviateCanonicalName, applyHostedDocumentOverscrollContain, assertValidMindooDBCreateIds, bindDragSource, buildHavenAppInstallUrl, canPreviewAttachment, createMindooDBAppBridge, createMindooDBRichTextHandle, createMindooDBTextBuffer, expandAbbreviatedName, inheritDocumentEncryption, installHavenStorageShim, installHostShortcutCapture, isHostShortcutAction, isHostedBundleRuntime, isLaunchedByHaven, isMindooDBAppDragType, isValidMindooDBDocumentId, listingMarkdownToPlainText, matchHostShortcut, mindooDBDocumentId, normalizeDragAccepts, normalizeDragPointerInput, normalizeDragStartInput, parseListingMarkdown, queryDocuments, readMindooDBAppHostingMode, readMindooDBAppLaunchId, releaseMindooDBAppBridgeSessions, renderHavenAppLandingPage, resolveCurrentHavenAppUrl, sanitizeHostShortcutBindings, sanitizeListingHref, snapshotElementToPng, watchWordChunks };
700
+ export { type CreateMindooDBRichTextHandleOptions, type CreateMindooDBTextBufferOptions, DEFAULT_DRAG_LONG_PRESS_MS, DEFAULT_DRAG_POINTER_THRESHOLD_PX, DEFAULT_HAVEN_HOST_SHORTCUTS, DEFAULT_HAVEN_URL, type HavenAppLandingPage, type HavenStorageShimHandle, type InstallHavenStorageShimOptions, type ListingBlock, type ListingInline, MINDOODB_APP_HOSTING_QUERY_PARAM, MINDOODB_APP_LAUNCH_ID_QUERY_PARAM, MINDOODB_APP_MAX_DRAG_PAYLOAD_BYTES, MINDOODB_APP_MAX_DRAG_PREVIEW_BYTES, MINDOODB_APP_MAX_DRAG_PREVIEW_EDGE, MINDOODB_APP_MAX_DRAG_TYPES, MINDOODB_APP_VALUE_TAG, MINDOODB_CUSTOM_DOCUMENT_ID_PATTERN, MINDOODB_DOCUMENT_ID_PREFIX_PATTERN, MINIMAL_DRAG_PREVIEW_PNG, type MindooDBAppAgentGuideField, type MindooDBAppAgentGuideGroup, type MindooDBAppAgentGuideOp, type MindooDBAppAgentGuideOptions, MindooDBAppAgentTool, MindooDBAppAgentToolError, MindooDBAppAgentToolErrorCode, type MindooDBAppAtomicValue, MindooDBAppAttachmentPreviewMode, MindooDBAppBridge, type MindooDBAppCounterValue, MindooDBAppCreateDocumentInput, MindooDBAppDatabase, MindooDBAppDefinition, MindooDBAppDocument, MindooDBAppDragBindSourceOptions, MindooDBAppDragInputError, MindooDBAppDragPreview, MindooDBAppDragStartInput, MindooDBAppDragStartResult, MindooDBAppHostShortcutAction, MindooDBAppHostShortcutBinding, MindooDBAppHostingMode, MindooDBAppRichTextSnapshot, MindooDBAppRichTextSpan, type MindooDBAppTimestampValue, type MindooDBAppTypedValue, MindooDBAppValue, MindooDBRichTextHandle, type MindooDBRichTextHandleChangeListener, type MindooDBRichTextHandleFlushResult, MindooDBTextBuffer, type MindooDBTextBufferFlushResult, type RenderHavenAppLandingPageOptions, abbreviateCanonicalName, agentGuideExamples, agentGuideSignatureIndex, applyHostedDocumentOverscrollContain, assertValidMindooDBCreateIds, bindDragSource, buildHavenAppInstallUrl, canPreviewAttachment, createAgentGuideTool, createMindooDBAppBridge, createMindooDBRichTextHandle, createMindooDBTextBuffer, expandAbbreviatedName, inheritDocumentEncryption, installHavenStorageShim, installHostShortcutCapture, isHostShortcutAction, isHostedBundleRuntime, isLaunchedByHaven, isMindooDBAppDragType, isValidMindooDBDocumentId, listingMarkdownToPlainText, matchHostShortcut, mindooDBDocumentId, normalizeDragAccepts, normalizeDragPointerInput, normalizeDragStartInput, parseListingMarkdown, queryDocuments, readMindooDBAppHostingMode, readMindooDBAppLaunchId, releaseMindooDBAppBridgeSessions, renderAgentGuideGroup, renderHavenAppLandingPage, resolveCurrentHavenAppUrl, sanitizeHostShortcutBindings, sanitizeListingHref, snapshotElementToPng, watchWordChunks };
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import {
4
4
  DEFAULT_HAVEN_HOST_SHORTCUTS,
5
5
  MINDOODB_APP_ACCEPTS_MAX,
6
6
  MINDOODB_APP_COMPONENTS_MAX,
7
+ MINDOODB_APP_COMPONENT_CONTRACT_PATTERN,
7
8
  MINDOODB_APP_DEFINITION_FILE_NAME,
8
9
  MINDOODB_APP_DEFINITION_FORMAT,
9
10
  MINDOODB_APP_DEFINITION_PERMISSIONS,
@@ -47,7 +48,7 @@ import {
47
48
  validateMindooDBAppAccepts,
48
49
  validateMindooDBAppComponents,
49
50
  validateMindooDBAppDefinition
50
- } from "./chunk-BE7LLFFE.js";
51
+ } from "./chunk-376SABPG.js";
51
52
  import {
52
53
  MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME,
53
54
  MINDOODB_APP_BUNDLE_MANIFEST_FILE_NAME,
@@ -152,6 +153,88 @@ function expandAbbreviatedName(value) {
152
153
  }).join("/");
153
154
  }
154
155
 
156
+ // src/client/agentGuide.ts
157
+ var GROUP_NAME_PATTERN = /^[a-z][a-z0-9_-]{0,47}$/;
158
+ function renderAgentGuideGroup(group) {
159
+ if (group.content !== void 0) return group.content;
160
+ const parts = [`# ${group.title ?? group.name}`, `> ${group.summary}`];
161
+ if (group.intro) parts.push(group.intro.trim());
162
+ for (const op of group.ops ?? []) {
163
+ const lines = [`### ${op.name}`, `\`${op.signature}\``];
164
+ if (op.summary) lines.push("", op.summary);
165
+ if (op.fields?.length) {
166
+ lines.push("", "| field | type | required | meaning |", "|---|---|---|---|");
167
+ for (const field of op.fields) {
168
+ lines.push(`| ${cell(field.name)} | ${cell(field.type)} | ${field.required ? "yes" : ""} | ${cell(field.description)} |`);
169
+ }
170
+ }
171
+ for (const example of op.examples ?? []) {
172
+ lines.push("", "```json", JSON.stringify(example), "```");
173
+ }
174
+ if (op.notes?.length) lines.push("", ...op.notes.map((note) => `- ${note}`));
175
+ parts.push(lines.join("\n"));
176
+ }
177
+ if (group.mistakes?.length) {
178
+ parts.push(["## Common mistakes", ...group.mistakes.map((mistake) => `- ${mistake}`)].join("\n"));
179
+ }
180
+ return parts.join("\n\n");
181
+ }
182
+ function cell(text) {
183
+ return text.replace(/\|/g, "\\|").replace(/\n/g, " ");
184
+ }
185
+ function agentGuideSignatureIndex(groups) {
186
+ return groups.filter((group) => group.ops?.length).map((group) => `## ${group.name}
187
+ ${group.ops.map((op) => `${op.name} ${op.signature}`).join("\n")}`).join("\n");
188
+ }
189
+ function agentGuideExamples(groups) {
190
+ return groups.flatMap(
191
+ (group) => (group.ops ?? []).flatMap((op) => (op.examples ?? []).map((example) => ({ group: group.name, op: op.name, example })))
192
+ );
193
+ }
194
+ function createAgentGuideTool(options) {
195
+ const groups = /* @__PURE__ */ new Map();
196
+ for (const group of options.groups) {
197
+ if (!GROUP_NAME_PATTERN.test(group.name)) {
198
+ throw new Error(`Invalid guide group name "${group.name}": use lower case, digits, "_" and "-".`);
199
+ }
200
+ if (groups.has(group.name)) throw new Error(`Guide group "${group.name}" is defined twice.`);
201
+ groups.set(group.name, group);
202
+ }
203
+ if (groups.size === 0) throw new Error("A guide needs at least one group.");
204
+ const names = [...groups.keys()];
205
+ const subject = options.documents ? `the op reference for ${options.documents}` : "the op reference";
206
+ const description = options.description ?? `${subject[0].toUpperCase()}${subject.slice(1)}. Without groups: the group list and every op's one-line signature. With groups: field tables, units, runnable JSON examples and common mistakes. Load the groups you need before a batch you have not sent before. Groups: ${names.join(", ")}.`;
207
+ return {
208
+ name: options.name ?? "ops_guide",
209
+ description,
210
+ inputSchema: {
211
+ type: "object",
212
+ properties: {
213
+ groups: { type: "array", items: { type: "string", enum: names } }
214
+ }
215
+ },
216
+ annotations: { readOnlyHint: true },
217
+ async execute(input) {
218
+ const raw = Array.isArray(input.groups) ? input.groups.map(String) : typeof input.groups === "string" && input.groups ? [input.groups] : [];
219
+ if (raw.length === 0) {
220
+ const signatures = typeof options.signatures === "function" ? options.signatures() : options.signatures ?? agentGuideSignatureIndex(options.groups);
221
+ return {
222
+ groups: options.groups.map((group) => `${group.name} \u2014 ${group.summary}`).join("\n"),
223
+ signatures
224
+ };
225
+ }
226
+ const unknown = raw.filter((name) => !groups.has(name));
227
+ if (unknown.length) {
228
+ throw new MindooDBAppAgentToolError(
229
+ "INVALID_INPUT",
230
+ `Unknown group(s): ${unknown.join(", ")}. Available: ${names.join(", ")}.`
231
+ );
232
+ }
233
+ return { guide: [...new Set(raw)].map((name) => renderAgentGuideGroup(groups.get(name))).join("\n\n---\n\n") };
234
+ }
235
+ };
236
+ }
237
+
155
238
  // src/client/hosting.ts
156
239
  var MINDOODB_APP_HOSTING_QUERY_PARAM = "mindoodbAppHosting";
157
240
  var MINDOODB_APP_LAUNCH_ID_QUERY_PARAM = "mindoodbAppLaunchId";
@@ -1288,6 +1371,7 @@ export {
1288
1371
  MINDOODB_APP_BUNDLE_MANIFEST_FORMAT,
1289
1372
  MINDOODB_APP_BUNDLE_MANIFEST_VERSION,
1290
1373
  MINDOODB_APP_COMPONENTS_MAX,
1374
+ MINDOODB_APP_COMPONENT_CONTRACT_PATTERN,
1291
1375
  MINDOODB_APP_DEFINITION_FILE_NAME,
1292
1376
  MINDOODB_APP_DEFINITION_FORMAT,
1293
1377
  MINDOODB_APP_DEFINITION_PERMISSIONS,
@@ -1314,12 +1398,15 @@ export {
1314
1398
  MindooDBRichTextHandle,
1315
1399
  MindooDBTextBuffer,
1316
1400
  abbreviateCanonicalName,
1401
+ agentGuideExamples,
1402
+ agentGuideSignatureIndex,
1317
1403
  applyHostedDocumentOverscrollContain,
1318
1404
  assertValidMindooDBCreateIds,
1319
1405
  bindDragSource,
1320
1406
  buildHavenAppInstallUrl,
1321
1407
  buildMindooDBAppBundleContentHashInput,
1322
1408
  canPreviewAttachment,
1409
+ createAgentGuideTool,
1323
1410
  createMindooDBAppBridge,
1324
1411
  createMindooDBRichTextHandle,
1325
1412
  createMindooDBTextBuffer,
@@ -1348,6 +1435,7 @@ export {
1348
1435
  readMindooDBAppHostingMode,
1349
1436
  readMindooDBAppLaunchId,
1350
1437
  releaseMindooDBAppBridgeSessions,
1438
+ renderAgentGuideGroup,
1351
1439
  renderHavenAppLandingPage,
1352
1440
  resolveCurrentHavenAppUrl,
1353
1441
  resolveMindooDBAppDefinitionUrl,
@@ -1,4 +1,4 @@
1
- import { ay as MindooDBAppComponentInfo, bq as MindooDBAppEmbedRect, I as MindooDBAppAgentToolDescriptor, f as MindooDBAppAgentToolErrorCode, V as MindooDBAppBridgeAgentResultMessage, U as MindooDBAppBridgeAgentInvokeMessage, aU as MindooDBAppCreateViewNavigatorInput, de as MindooDBAppViewNavigator, ad as MindooDBAppBridgeRpcRequest, bC as MindooDBAppHostTheme, av as MindooDBAppCapability, d9 as MindooDBAppUpdateDocumentInput, l as MindooDBAppDocument, j as MindooDBAppDefinition, J as MindooDBAppAttachmentApi, e as MindooDBAppBridge, cQ as MindooDBAppSession, cg as MindooDBAppProposeAppInput, dm as MindooDBAppViewport, d8 as MindooDBAppUiPreferences, cm as MindooDBAppQueryResult, dl as MindooDBAppViewUpdateStats, a9 as MindooDBAppBridgePortMessage, aV as MindooDBAppDatabaseInfo, bl as MindooDBAppEmbedCloseReason, a4 as MindooDBAppBridgeErrorPayload, bX as MindooDBAppLaunchContext, b2 as MindooDBAppDocumentApi, dg as MindooDBAppViewNavigatorOpenOptions, bD as MindooDBAppIdentityApi, d4 as MindooDBAppTimestampApi, b0 as MindooDBAppDirectoryApi, bz as MindooDBAppFulltextSetup, by as MindooDBAppExtractionSetup, cY as MindooDBAppSummarySetup, ch as MindooDBAppProposeAppResult, bN as MindooDBAppIncomingSource, c as MindooDBAppDragStartResult, bj as MindooDBAppDragProfile, bM as MindooDBAppIncomingResult } from '../types-BeRUxGKN.js';
1
+ import { aC as MindooDBAppComponentInfo, bB as MindooDBAppEmbedRect, bu as MindooDBAppEmbedAgentTools, bD as MindooDBAppEmbeddingLookupOptions, bE as MindooDBAppEmbeddingLookupResult, bs as MindooDBAppEmbedAccessPair, J as MindooDBAppAgentToolDescriptor, f as MindooDBAppAgentToolErrorCode, X as MindooDBAppBridgeAgentResultMessage, W as MindooDBAppBridgeAgentInvokeMessage, aZ as MindooDBAppCreateViewNavigatorInput, ds as MindooDBAppViewNavigator, af as MindooDBAppBridgeRpcRequest, bP as MindooDBAppHostTheme, ax as MindooDBAppCapability, dm as MindooDBAppUpdateDocumentInput, m as MindooDBAppDocument, k as MindooDBAppDefinition, L as MindooDBAppAttachmentApi, e as MindooDBAppBridge, d1 as MindooDBAppSession, ct as MindooDBAppProposeAppInput, dA as MindooDBAppViewport, dl as MindooDBAppUiPreferences, cz as MindooDBAppQueryResult, dz as MindooDBAppViewUpdateStats, ab as MindooDBAppBridgePortMessage, a_ as MindooDBAppDatabaseInfo, br as MindooDBAppEmbedAccessInput, bw as MindooDBAppEmbedCloseReason, a6 as MindooDBAppBridgeErrorPayload, c8 as MindooDBAppLaunchContext, b7 as MindooDBAppDocumentApi, du as MindooDBAppViewNavigatorOpenOptions, bQ as MindooDBAppIdentityApi, dh as MindooDBAppTimestampApi, b5 as MindooDBAppDirectoryApi, bM as MindooDBAppFulltextSetup, bL as MindooDBAppExtractionSetup, d9 as MindooDBAppSummarySetup, cu as MindooDBAppProposeAppResult, b_ as MindooDBAppIncomingSource, c as MindooDBAppDragStartResult, bo as MindooDBAppDragProfile, bZ as MindooDBAppIncomingResult } from '../types-BGLXh4JQ.js';
2
2
  import * as mindoodb from 'mindoodb';
3
3
  import 'mindoodb-view-language';
4
4
 
@@ -13,6 +13,10 @@ interface MockEmbedState {
13
13
  visible: boolean;
14
14
  /** What the component last reported (`setEmbedDirty`); `undefined` until then. */
15
15
  dirty?: boolean;
16
+ /** Whether it is the active one of its app's embeds (`embed.setActive`, or the newest). */
17
+ active: boolean;
18
+ /** The agent tools it offers (`setEmbedAgentTools`), as the host app sees them. */
19
+ agentTools: MindooDBAppEmbedAgentTools | null;
16
20
  }
17
21
  /** How an app running as an embedded component finished (`session.embedding`). */
18
22
  interface MockEmbeddingFinish {
@@ -20,6 +24,23 @@ interface MockEmbeddingFinish {
20
24
  result?: unknown;
21
25
  message?: string;
22
26
  }
27
+ interface MockEmbedHostOptions {
28
+ /** What `session.components.list` offers. */
29
+ components?: MindooDBAppComponentInfo[];
30
+ /** Called when the app opens an embed, e.g. to draw a stand-in in the test host page. */
31
+ onEmbedChange?: (embeds: readonly MockEmbedState[]) => void;
32
+ /**
33
+ * For an app under test that runs as a component: answers its
34
+ * `session.embedding.lookup`, as Haven would from the host's database. No results
35
+ * without it.
36
+ */
37
+ embeddingLookup?: (field: string, options: MindooDBAppEmbeddingLookupOptions) => MindooDBAppEmbeddingLookupResult[] | Promise<MindooDBAppEmbeddingLookupResult[]>;
38
+ /**
39
+ * Plays the user for `session.embeds.requestAccess`: gets the pairs Haven would
40
+ * ask for and returns the ones the user allows. Without it every pair is allowed.
41
+ */
42
+ embedAccess?: (pairs: MindooDBAppEmbedAccessPair[]) => MindooDBAppEmbedAccessPair[] | Promise<MindooDBAppEmbedAccessPair[]>;
43
+ }
23
44
 
24
45
  /**
25
46
  * Haven's side of agent tools, for tests: what `session.agent` talks to.
@@ -131,6 +152,8 @@ declare function createMockAgentHost(options: MockAgentHostOptions & {
131
152
  /** Posts to the app's port; `false` when no app is connected. */
132
153
  post(message: MindooDBAppBridgeAgentInvokeMessage): boolean;
133
154
  onChange?(): void;
155
+ /** Whether the app runs as an embedded component: then only its `document` tools count. */
156
+ embedded?(): boolean;
134
157
  }): MockAgentHost;
135
158
 
136
159
  type EvaluatingViewDocument = {
@@ -152,6 +175,33 @@ declare function loadMindoodbForTesting(): Promise<MindoodbVirtualViews | null>;
152
175
  */
153
176
  declare function createEvaluatingViewNavigator(input: MindooDBAppCreateViewNavigatorInput, documents: EvaluatingViewDocument[]): Promise<MindooDBAppViewNavigator | null>;
154
177
 
178
+ interface TestHostUser {
179
+ /** Shown above the user's frame. */
180
+ name: string;
181
+ username: string;
182
+ }
183
+ declare const DEFAULT_TEST_HOST_USERS: readonly [TestHostUser, TestHostUser];
184
+ /** Window handles of the two-user mode, for Playwright. */
185
+ interface TwoUserTestHost {
186
+ hosts: [BrowserTestHost, BrowserTestHost];
187
+ /** Merge the two replicas now; resolves with the number of documents that changed. */
188
+ sync(): Promise<number>;
189
+ setAutoSync(on: boolean): void;
190
+ /** Documents that differ between the replicas. */
191
+ differences(): number;
192
+ }
193
+ declare global {
194
+ interface Window {
195
+ /** Set in two-user mode. */
196
+ __havenTwoUsers?: TwoUserTestHost;
197
+ }
198
+ }
199
+ declare function mountTwoUserTestHost(options: Omit<CreateBrowserTestHostOptions, "frame"> & {
200
+ container?: HTMLElement;
201
+ title?: string;
202
+ users?: readonly [TestHostUser, TestHostUser];
203
+ }, createHost: (options: CreateBrowserTestHostOptions) => BrowserTestHost): TwoUserTestHost;
204
+
155
205
  /**
156
206
  * A stand-in Haven for a real browser: the app runs in an iframe, exactly as Haven frames
157
207
  * it, and talks to the same in-memory mock host the Vitest helpers use.
@@ -323,6 +373,14 @@ interface MountHavenTestHostOptions extends Omit<CreateBrowserTestHostOptions, "
323
373
  * true. URL settings win over the options passed here.
324
374
  */
325
375
  urlSettings?: boolean;
376
+ /**
377
+ * Two app frames side by side, each on its own replica of the databases, merged by
378
+ * "Sync" / auto-sync — for testing concurrent editing by hand. Also `?twoUsers=1`.
379
+ * See {@link mountTwoUserTestHost}.
380
+ */
381
+ twoUsers?: boolean;
382
+ /** Names of the two users in two-user mode (default Anna and Ben). */
383
+ users?: readonly [TestHostUser, TestHostUser];
326
384
  }
327
385
  /** The locales Haven's UI offers; the default of the panel's language switcher. */
328
386
  declare const TEST_HOST_LOCALES: ReadonlyArray<{
@@ -346,6 +404,11 @@ declare function previewJson(value: unknown, maxString?: number, maxItems?: numb
346
404
  * of notifications, previews, scans and requests (click an entry for details).
347
405
  * The returned host is also available as `window.__havenTestHost`.
348
406
  */
407
+ /**
408
+ * "Single user" / "Two users": links to the same test page with or without
409
+ * `twoUsers=1`, keeping the other URL settings (db, enforce, users, locale, …).
410
+ */
411
+ declare function modeSwitch(current: "single" | "two"): HTMLElement;
349
412
  declare function mountHavenTestHost(options: MountHavenTestHostOptions): BrowserTestHost;
350
413
 
351
414
  /**
@@ -487,10 +550,27 @@ interface CreateMockMindooDBAppSessionOptions {
487
550
  * `methods.directory` still wins.
488
551
  */
489
552
  directoryUsers?: readonly string[];
553
+ /**
554
+ * Automerge actor (hex) of the app's writes in `automerge: true` databases. Mocks
555
+ * that are synced with each other (`syncMockReplicas`, the test host's two-user
556
+ * mode) need distinct actors, like two devices.
557
+ */
558
+ automergeActor?: string;
490
559
  /** What `session.components.list` offers; see `closeEmbed` on the controller. */
491
560
  components?: MindooDBAppComponentInfo[];
492
561
  /** Called whenever the app opens, moves or closes an embed. */
493
562
  onEmbedChange?: (embeds: readonly MockEmbedState[]) => void;
563
+ /**
564
+ * For an app under test that runs as a component: answers its
565
+ * `session.embedding.lookup` (documents a reference may point at), as Haven would
566
+ * from the host's database. No results without it.
567
+ */
568
+ embeddingLookup?: MockEmbedHostOptions["embeddingLookup"];
569
+ /**
570
+ * Plays the user for `session.embeds.requestAccess`: returns the pairs allowed of
571
+ * those Haven would ask for. Without it every pair is allowed.
572
+ */
573
+ embedAccess?: MockEmbedHostOptions["embedAccess"];
494
574
  /**
495
575
  * Answer `embeds.open` with a `container` like a current Haven: with this page
496
576
  * for the SDK to frame (e.g. `about:blank`). Without it the host behaves like an
@@ -553,6 +633,8 @@ interface MockMindooDBAppSessionController {
553
633
  emitIncomingContent(input: MockIncomingContentInput): Promise<MindooDBAppIncomingResult>;
554
634
  /** Embeds the app has open (`session.embeds.open`). */
555
635
  listEmbeds(): MockEmbedState[];
636
+ /** Every `session.embeds.requestAccess` input so far, oldest first. */
637
+ getEmbedAccessRequests(): MindooDBAppEmbedAccessInput[];
556
638
  /** Closes an embed as Haven does when the component finishes or the user closes it. */
557
639
  closeEmbed(embedId: string, reason?: MindooDBAppEmbedCloseReason, result?: unknown): void;
558
640
  /** Replaces what `session.components.list` offers. */
@@ -561,6 +643,10 @@ interface MockMindooDBAppSessionController {
561
643
  getEmbeddingFinish(): MockEmbeddingFinish | null;
562
644
  /** As if the embedded component reported (un)saved changes; the app's embed follows. */
563
645
  setEmbedDirty(embedId: string, dirty: boolean): void;
646
+ /** As if the embedded component registered these agent tools (names without prefix). */
647
+ setEmbedAgentTools(embedId: string, names: string[] | null, options?: {
648
+ enabled?: boolean;
649
+ }): void;
564
650
  /** Makes the app's next `embed.save()` fail with this message. */
565
651
  failNextEmbedSave(message: string): void;
566
652
  /** For an app under test that runs as a component: its last `embedding.setDirty`. */
@@ -586,6 +672,20 @@ interface MockIncomingContentInput {
586
672
  }>;
587
673
  }
588
674
 
675
+ type MockReplica = MockMindooDBAppSessionController | FakeBridgeHostController;
676
+ /**
677
+ * How many documents differ between two mocks (missing on one side, other heads, or
678
+ * deleted on one side only): what `syncMockReplicas` would bring over.
679
+ */
680
+ declare function mockReplicaDifferences(a: MockReplica, b: MockReplica): number;
681
+ /**
682
+ * Syncs two mocks like two Haven devices: every document of every database both have
683
+ * is merged both ways (Automerge histories with `automerge: true`, so concurrent edits
684
+ * merge as in Haven; otherwise the newer copy wins), deletions spread, and attachments
685
+ * missing on one side are copied. Give the mocks distinct `automergeActor`s. Returns
686
+ * the number of documents that changed on either side.
687
+ */
688
+ declare function syncMockReplicas(a: MockReplica, b: MockReplica): Promise<number>;
589
689
  declare function createMockMindooDBAppSession(options?: CreateMockMindooDBAppSessionOptions): MockMindooDBAppSessionController;
590
690
  declare function createMockMindooDBAppBridge(options?: CreateMockMindooDBAppSessionOptions): MockMindooDBAppSessionController;
591
691
  type FakeBridgeRequestHandler = (params: unknown, context: {
@@ -664,12 +764,21 @@ interface FakeBridgeHostController {
664
764
  applyRemoteUpdate(databaseId: string, docId: string, input: MindooDBAppUpdateDocumentInput, options?: MockRemoteUpdateOptions): Promise<MindooDBAppDocument>;
665
765
  /** Embeds the app has open (`session.embeds.open`). */
666
766
  listEmbeds(): MockEmbedState[];
767
+ /** Every `session.embeds.requestAccess` input so far, oldest first. */
768
+ getEmbedAccessRequests(): MindooDBAppEmbedAccessInput[];
667
769
  /** Closes an embed and pushes the `embed-event` to the app. */
668
770
  closeEmbed(embedId: string, reason?: MindooDBAppEmbedCloseReason, result?: unknown): void;
669
771
  /** For an app under test that runs as a component: its `session.embedding` call. */
670
772
  getEmbeddingFinish(): MockEmbeddingFinish | null;
671
773
  /** As if the embedded component reported (un)saved changes; pushes the `embed-event`. */
672
774
  setEmbedDirty(embedId: string, dirty: boolean): void;
775
+ /**
776
+ * As if the embedded component registered these agent tools (names without prefix);
777
+ * pushes the `embed-event`. `null` or `[]` withdraws them.
778
+ */
779
+ setEmbedAgentTools(embedId: string, names: string[] | null, options?: {
780
+ enabled?: boolean;
781
+ }): void;
673
782
  /** Makes the app's next `embed.save()` fail with this message. */
674
783
  failNextEmbedSave(message: string): void;
675
784
  /** For an app under test that runs as a component: its last `embedding.setDirty`. */
@@ -687,4 +796,4 @@ interface FakeBridgeHostController {
687
796
  }
688
797
  declare function createFakeBridgeHost(options?: CreateFakeBridgeHostOptions): FakeBridgeHostController;
689
798
 
690
- export { ALL_CAPABILITIES, type BrowserTestHost, type BrowserTestHostLog, type BrowserTestHostScan, type BrowserTestHostScanMode, type CreateBrowserTestHostOptions, type CreateFakeBridgeHostOptions, type CreateMockMindooDBAppSessionOptions, type EvaluatingViewDocument, type FakeBridgeHostController, type FakeBridgePortMessageHandler, type FakeBridgeRequestHandler, type FakeBridgeRpcResponse, type MockAgentCall, type MockAgentCallResult, type MockAgentConsent, type MockAgentFile, type MockAgentHost, type MockAgentHostController, type MockAgentHostOptions, type MockDatabaseOverride, type MockDatabasesFromDefinitionOptions, type MockEmbedState, type MockEmbeddingFinish, MockForbiddenError, type MockIncomingContentInput, type MockMindooDBAppDatabaseDefinition, type MockMindooDBAppSessionController, type MockRemoteUpdateOptions, type MockSealedChannelOptions, type MockSeedDocument, type MountHavenTestHostOptions, TEST_HOST_LOCALES, type TestHostUrlSettings, capabilitiesForDefinitionPermissions, createBrowserTestHost, createEvaluatingViewNavigator, createFakeBridgeHost, createMemoryAttachments, createMockAgentHost, createMockMindooDBAppBridge, createMockMindooDBAppSession, generateDirectoryUsers, loadMindoodbForTesting, mockAgentToolPrefix, mockDatabasesFromDefinition, mountHavenTestHost, previewJson, readTestHostUrlSettings, validateMockAgentTools };
799
+ export { ALL_CAPABILITIES, type BrowserTestHost, type BrowserTestHostLog, type BrowserTestHostScan, type BrowserTestHostScanMode, type CreateBrowserTestHostOptions, type CreateFakeBridgeHostOptions, type CreateMockMindooDBAppSessionOptions, DEFAULT_TEST_HOST_USERS, type EvaluatingViewDocument, type FakeBridgeHostController, type FakeBridgePortMessageHandler, type FakeBridgeRequestHandler, type FakeBridgeRpcResponse, type MockAgentCall, type MockAgentCallResult, type MockAgentConsent, type MockAgentFile, type MockAgentHost, type MockAgentHostController, type MockAgentHostOptions, type MockDatabaseOverride, type MockDatabasesFromDefinitionOptions, type MockEmbedState, type MockEmbeddingFinish, MockForbiddenError, type MockIncomingContentInput, type MockMindooDBAppDatabaseDefinition, type MockMindooDBAppSessionController, type MockRemoteUpdateOptions, type MockSealedChannelOptions, type MockSeedDocument, type MountHavenTestHostOptions, TEST_HOST_LOCALES, type TestHostUrlSettings, type TestHostUser, type TwoUserTestHost, capabilitiesForDefinitionPermissions, createBrowserTestHost, createEvaluatingViewNavigator, createFakeBridgeHost, createMemoryAttachments, createMockAgentHost, createMockMindooDBAppBridge, createMockMindooDBAppSession, generateDirectoryUsers, loadMindoodbForTesting, mockAgentToolPrefix, mockDatabasesFromDefinition, mockReplicaDifferences, modeSwitch, mountHavenTestHost, mountTwoUserTestHost, previewJson, readTestHostUrlSettings, syncMockReplicas, validateMockAgentTools };