mindoodb-app-sdk 0.0.66 → 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/README.md +54 -0
- package/TESTING.md +1 -0
- package/dist/{chunk-B3K3I2S2.js → chunk-376SABPG.js} +23 -0
- package/dist/index.d.ts +89 -3
- package/dist/index.js +87 -1
- package/dist/testing/index.d.ts +15 -1
- package/dist/testing/index.js +105 -29
- package/dist/{types-Cuw-0Iou.d.ts → types-BGLXh4JQ.d.ts} +44 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -332,6 +332,41 @@ if (session.agent) {
|
|
|
332
332
|
- **Files** never travel through the agent. `agent.provideFile(blob, { name, mimeType })` hands Haven a file the app produced and returns a `fileRef` (valid ten minutes) for the agent to pass to `haven_files_export`, which saves it into the user's exchange folder. `agent.takeFile(fileRef)` returns a `File` the agent imported for this app with `haven_files_import`.
|
|
333
333
|
- A call that runs longer than two minutes fails with `FAILED`; files are limited to 50 MB.
|
|
334
334
|
|
|
335
|
+
#### An op guide for edit tools
|
|
336
|
+
|
|
337
|
+
Apps with an edit language (`apply_ops` batches, formatting changes) do better with short tool descriptions plus a reference the agent loads when it needs it. `createAgentGuideTool` builds that reference as a read-only tool (`ops_guide` by default): without arguments it returns the group list and one signature line per op; with `groups` it returns field tables, units, JSON examples and common mistakes of those groups.
|
|
338
|
+
|
|
339
|
+
```ts
|
|
340
|
+
import { agentGuideExamples, createAgentGuideTool, type MindooDBAppAgentGuideGroup } from "mindoodb-app-sdk";
|
|
341
|
+
|
|
342
|
+
const GUIDE: MindooDBAppAgentGuideGroup[] = [
|
|
343
|
+
{
|
|
344
|
+
name: "blocks",
|
|
345
|
+
summary: "insert, replace, move and delete blocks",
|
|
346
|
+
intro: "Block indexes come from todo_document_read and refer to the document before the call.",
|
|
347
|
+
ops: [
|
|
348
|
+
{
|
|
349
|
+
name: "insertContent",
|
|
350
|
+
signature: "{after, markdown}",
|
|
351
|
+
fields: [
|
|
352
|
+
{ name: "after", type: "integer | {heading}", required: true, description: "-1 = document start" },
|
|
353
|
+
{ name: "markdown", type: "string", required: true, description: "One or more blocks." },
|
|
354
|
+
],
|
|
355
|
+
examples: [{ op: "insertContent", after: -1, markdown: "# Agenda" }],
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
mistakes: ["Sending indexes from an old read: pass the revision, read again when refused."],
|
|
359
|
+
},
|
|
360
|
+
];
|
|
361
|
+
|
|
362
|
+
const tools = [
|
|
363
|
+
createAgentGuideTool({ documents: "todo_apply_ops", groups: GUIDE }),
|
|
364
|
+
// apply_ops' description: "... Signatures and examples: todo_ops_guide."
|
|
365
|
+
];
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
A group can also bring its reference as ready Markdown in `content` (TeamSlides passes GenOffice's op docs). Test the examples: `agentGuideExamples(GUIDE)` lists them, so a unit test can dry-run each one through the edit tool.
|
|
369
|
+
|
|
335
370
|
#### Agent tools of embedded components
|
|
336
371
|
|
|
337
372
|
Agents work on three levels: Haven's own tools (`haven_*`), the tools of the app the
|
|
@@ -514,6 +549,25 @@ hands its connection to Haven, so the host cannot reach into the component or it
|
|
|
514
549
|
channel. Haven tells the SDK where the container is (for the component's own menus);
|
|
515
550
|
the SDK follows the container's size and position by itself.
|
|
516
551
|
|
|
552
|
+
**Asking once.** The first time a host shows a component in one of its databases,
|
|
553
|
+
Haven asks the user whether that app may see the document. A host that shows several
|
|
554
|
+
components asks for all of them at once instead, e.g. right after `components.list`:
|
|
555
|
+
|
|
556
|
+
```ts
|
|
557
|
+
const { granted, pending } = await session.embeds.requestAccess({
|
|
558
|
+
components: [
|
|
559
|
+
{ componentKey: sheet.key, databaseIds: ["crm"] },
|
|
560
|
+
{ componentKey: person.key, databaseIds: ["contacts"] }, // default: all its databases
|
|
561
|
+
],
|
|
562
|
+
});
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
Haven lists what is not allowed yet in one dialog; the user may untick entries. What the
|
|
566
|
+
user allowed or put off before is not asked again, so call it on every start. `open`
|
|
567
|
+
still asks for a pending pair when it is used, and asks again when a newer version of
|
|
568
|
+
the component wants more access (e.g. new `references`). In tests, `embedAccess` on the
|
|
569
|
+
mock plays the user (default: allow all).
|
|
570
|
+
|
|
517
571
|
**Unsaved changes.** A component reports whether it has changes it has not saved yet,
|
|
518
572
|
and saves when its host asks:
|
|
519
573
|
|
package/TESTING.md
CHANGED
|
@@ -104,6 +104,7 @@ Each database entry can provide:
|
|
|
104
104
|
- `info`
|
|
105
105
|
- `documents` — seed documents into the mock store (used by `list`/`query` and by evaluating VirtualViews). A seed's `decryptionKeyId` is reported back by `documents.get`, like a real host; documents created through the mock report `"default"` unless `create` named a key, and person-encrypted documents (`recipients`) report none.
|
|
106
106
|
- `methods.documents`
|
|
107
|
+
- Document history: every write (create, update, delete, a remote update) is kept as a revision, so `listHistory` (newest first, `isCurrent` on the latest), `getAtRevision` (with `phase: "before"`) and `getAtTimestamp` return the states the document went through. Revision ids are `<docId>@<n>`; timestamps are the write's `updatedAt`, strictly increasing per document.
|
|
107
108
|
- `methods.views` for session-level `createView()` and `openView()` calls (overrides the default evaluating navigator)
|
|
108
109
|
- `methods.attachments`
|
|
109
110
|
- `fulltextSetup` — the initial config returned by `db.getFulltextSetup()`; `db.setFulltextSetup()` overwrites it for the lifetime of the handle. Use this to test your app's full-text bootstrap logic. Note the mock evaluates `text` query clauses regardless of this config.
|
|
@@ -1771,6 +1771,29 @@ var MindooDBAppEmbedsClient = class {
|
|
|
1771
1771
|
this.open.set(embed.embedId, embed);
|
|
1772
1772
|
}
|
|
1773
1773
|
return embed;
|
|
1774
|
+
},
|
|
1775
|
+
requestAccess: async (input) => {
|
|
1776
|
+
const components = (input?.components ?? []).map((entry) => ({
|
|
1777
|
+
componentKey: String(entry.componentKey),
|
|
1778
|
+
...entry.databaseIds ? { databaseIds: entry.databaseIds.map(String) } : {},
|
|
1779
|
+
...entry.intent === "view" ? { intent: "view" } : {}
|
|
1780
|
+
}));
|
|
1781
|
+
try {
|
|
1782
|
+
const response = await this.rpc.call("embeds.requestAccess", {
|
|
1783
|
+
input: { components }
|
|
1784
|
+
});
|
|
1785
|
+
return { granted: response?.granted ?? [], pending: response?.pending ?? [] };
|
|
1786
|
+
} catch (error) {
|
|
1787
|
+
if (!(error instanceof Error && error.name === "method-not-found")) {
|
|
1788
|
+
throw error;
|
|
1789
|
+
}
|
|
1790
|
+
return {
|
|
1791
|
+
granted: [],
|
|
1792
|
+
pending: components.flatMap(
|
|
1793
|
+
(entry) => (entry.databaseIds ?? []).map((databaseId) => ({ componentKey: entry.componentKey, databaseId }))
|
|
1794
|
+
)
|
|
1795
|
+
};
|
|
1796
|
+
}
|
|
1774
1797
|
}
|
|
1775
1798
|
};
|
|
1776
1799
|
this.embedding = {
|
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
|
|
2
|
-
export { p as MINDOODB_APP_ACCEPTS_MAX, q as MINDOODB_APP_COMPONENTS_MAX, r as MINDOODB_APP_COMPONENT_CONTRACT_PATTERN, s as MINDOODB_APP_DEFINITION_FILE_NAME, t as MINDOODB_APP_DEFINITION_FORMAT, u as MINDOODB_APP_DEFINITION_PERMISSIONS, v as MINDOODB_APP_DEFINITION_REGISTRATION_PERMISSIONS, w as MINDOODB_APP_DEFINITION_VERSION, x as MINDOODB_APP_LISTING_DESCRIPTION_MAX, y as MINDOODB_APP_LISTING_MAX_SCREENSHOTS, z as MINDOODB_APP_LISTING_SUMMARY_MAX, A as MINDOODB_APP_SEAL_SIGNING_DOMAIN, B as MINDOODB_APP_WELL_KNOWN_DRAG_TYPES, C as MindooDBAppAcceptSpec, D as MindooDBAppAccessDecision, E as MindooDBAppAccessTier, F as MindooDBAppAgentApi, G as MindooDBAppAgentRegistration, H as MindooDBAppAgentTool, 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 MindooDBAppEmbedAgentTools, br as MindooDBAppEmbedAgentToolsEvent, bs as MindooDBAppEmbedCloseReason, bt as MindooDBAppEmbedClosedEvent, bu as MindooDBAppEmbedContext, bv as MindooDBAppEmbedDirtyEvent, bw as MindooDBAppEmbedOpenInput, bx as MindooDBAppEmbedRect, by as MindooDBAppEmbeddingApi, bz as MindooDBAppEmbeddingLookupOptions, bA as MindooDBAppEmbeddingLookupResult, bB as MindooDBAppEmbedsApi, bC as MindooDBAppEntryAttachmentRef, bD as MindooDBAppEntryProvenance, bE as MindooDBAppExtractDocumentTextInput, bF as MindooDBAppExtractDocumentTextResult, bG as MindooDBAppExtractTextFormat, bH as MindooDBAppExtractionSetup, bI as MindooDBAppFulltextSetup, bJ as MindooDBAppHistoricalDocument, bK as MindooDBAppHistoryQuery, bL as MindooDBAppHostTheme, bM as MindooDBAppIdentityApi, bN as MindooDBAppInaccessibleDocument, bO as MindooDBAppInaccessibleDocumentListQuery, bP as MindooDBAppInaccessibleDocumentListResult, bQ as MindooDBAppIncomingContent, bR as MindooDBAppIncomingContentHandler, bS as MindooDBAppIncomingContentInfo, bT as MindooDBAppIncomingItem, bU as MindooDBAppIncomingItemInfo, bV as MindooDBAppIncomingResult, bW as MindooDBAppIncomingSource, bX as MindooDBAppJsonCounterIncrementPatch, bY as MindooDBAppJsonListDeletePatch, bZ as MindooDBAppJsonListInsertPatch, b_ as MindooDBAppJsonPatch, b$ as MindooDBAppJsonSetPatch, c0 as MindooDBAppJsonTextMarkPatch, c1 as MindooDBAppJsonTextSplicePatch, c2 as MindooDBAppJsonTextUnmarkPatch, c3 as MindooDBAppJsonUnsetPatch, c4 as MindooDBAppLaunchContext, c5 as MindooDBAppListUsersOptions, c6 as MindooDBAppListUsersPage, c7 as MindooDBAppLiveQuerySubscription, c8 as MindooDBAppLocalizedText, c9 as MindooDBAppMenuAnchor, ca as MindooDBAppMenuApi, cb as MindooDBAppMenuCommandItem, cc as MindooDBAppMenuDismissReason, cd as MindooDBAppMenuDismissedResult, ce as MindooDBAppMenuItem, cf as MindooDBAppMenuKind, cg as MindooDBAppMenuPlacement, ch as MindooDBAppMenuPointAnchor, ci as MindooDBAppMenuRect, cj as MindooDBAppMenuRectAnchor, ck as MindooDBAppMenuSelectionResult, cl as MindooDBAppMenuSeparatorItem, cm as MindooDBAppNotificationSeverity, cn as MindooDBAppNotifyInput, co as MindooDBAppNotifyResult, cp as MindooDBAppProposeAppInput, cq as MindooDBAppProposeAppResult, cr as MindooDBAppQueryCoverage, cs as MindooDBAppQueryInclude, ct as MindooDBAppQueryIncludeCardinality, cu as MindooDBAppQueryIncludeSlots, cv as MindooDBAppQueryResult, cw as MindooDBAppQueryRow, cx as MindooDBAppQuerySortKey, cy as MindooDBAppQueryTextClause, cz as MindooDBAppReadableAttachmentStream, cA as MindooDBAppRecipientOptions, cB as MindooDBAppResolvedViewDefinition, cC as MindooDBAppResolvedViewSource, cD as MindooDBAppRevisionPhase, cE as MindooDBAppRevisionVerification, cF as MindooDBAppRichTextBlockSpan, cG as MindooDBAppRichTextGetOptions, cH as MindooDBAppRichTextImmutableString, cI as MindooDBAppRichTextMarkRange, cJ as MindooDBAppRichTextMaterializeValue, cK as MindooDBAppRichTextPatch, cL as MindooDBAppRichTextScalar, cM as MindooDBAppRichTextSpliceStep, cN as MindooDBAppRichTextStep, cO as MindooDBAppRichTextStepPatch, cP as MindooDBAppRichTextTextSpan, cQ as MindooDBAppRuntime, cR as MindooDBAppScanAttachmentOptions, cS as MindooDBAppScanAttachmentResult, cT as MindooDBAppScopedDocId, cU as MindooDBAppScopedDocumentSummary, cV as MindooDBAppSealIntent, cW as MindooDBAppSealedChannelOpenInput, cX as MindooDBAppSealedChannelOpenResult, cY as MindooDBAppSealedChannelRequestInput, cZ as MindooDBAppSession, c_ as MindooDBAppShowMenuInput, c$ as MindooDBAppShowMenuResult, d0 as MindooDBAppSignPreview, d1 as MindooDBAppSignPreviewScope, d2 as MindooDBAppSignStatementInput, d3 as MindooDBAppSignStatementResult, d4 as MindooDBAppStorageApi, d5 as MindooDBAppSummarySetup, d6 as MindooDBAppTextCursorOptions, d7 as MindooDBAppTextCursorPosition, d8 as MindooDBAppTextCursorPositionsResult, d9 as MindooDBAppTextCursorsResult, da as MindooDBAppTextEdit, db as MindooDBAppTextPatch, dc as MindooDBAppThemeMode, dd as MindooDBAppTimestampApi, de as MindooDBAppTimestampInput, df as MindooDBAppTimestampProvider, dg as MindooDBAppTimestampResult, dh as MindooDBAppUiPreferences, di as MindooDBAppUpdateDocumentInput, dj as MindooDBAppViewCursorDocumentListResult, dk as MindooDBAppViewCursorResult, dl as MindooDBAppViewEntry, dm as MindooDBAppViewEntryKind, dn as MindooDBAppViewNavigator, dp as MindooDBAppViewNavigatorExpansionState, dq as MindooDBAppViewNavigatorOpenOptions, dr as MindooDBAppViewNavigatorPageOptions, ds as MindooDBAppViewNavigatorPageResult, dt as MindooDBAppViewNavigatorRangeQuery, du as MindooDBAppViewNavigatorSelectionState, dv as MindooDBAppViewUpdateStats, dw as MindooDBAppViewport, dx as MindooDBAppWellKnownDragType, dy as MindooDBAppWritableAttachmentStream, dz as mindooDBAppAcceptMatchesType, dA as mindooDBAppComponentFieldsMatch, dB as resolveMindooDBAppDefinitionUrl, dC as resolveMindooDBAppListingAssetUrl, dD as resolveMindooDBAppLocalizedText, dE as validateMindooDBAppAccepts, dF as validateMindooDBAppComponents, dG as validateMindooDBAppDefinition } from './types-Cuw-0Iou.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
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
validateMindooDBAppAccepts,
|
|
49
49
|
validateMindooDBAppComponents,
|
|
50
50
|
validateMindooDBAppDefinition
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-376SABPG.js";
|
|
52
52
|
import {
|
|
53
53
|
MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME,
|
|
54
54
|
MINDOODB_APP_BUNDLE_MANIFEST_FILE_NAME,
|
|
@@ -153,6 +153,88 @@ function expandAbbreviatedName(value) {
|
|
|
153
153
|
}).join("/");
|
|
154
154
|
}
|
|
155
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
|
+
|
|
156
238
|
// src/client/hosting.ts
|
|
157
239
|
var MINDOODB_APP_HOSTING_QUERY_PARAM = "mindoodbAppHosting";
|
|
158
240
|
var MINDOODB_APP_LAUNCH_ID_QUERY_PARAM = "mindoodbAppLaunchId";
|
|
@@ -1316,12 +1398,15 @@ export {
|
|
|
1316
1398
|
MindooDBRichTextHandle,
|
|
1317
1399
|
MindooDBTextBuffer,
|
|
1318
1400
|
abbreviateCanonicalName,
|
|
1401
|
+
agentGuideExamples,
|
|
1402
|
+
agentGuideSignatureIndex,
|
|
1319
1403
|
applyHostedDocumentOverscrollContain,
|
|
1320
1404
|
assertValidMindooDBCreateIds,
|
|
1321
1405
|
bindDragSource,
|
|
1322
1406
|
buildHavenAppInstallUrl,
|
|
1323
1407
|
buildMindooDBAppBundleContentHashInput,
|
|
1324
1408
|
canPreviewAttachment,
|
|
1409
|
+
createAgentGuideTool,
|
|
1325
1410
|
createMindooDBAppBridge,
|
|
1326
1411
|
createMindooDBRichTextHandle,
|
|
1327
1412
|
createMindooDBTextBuffer,
|
|
@@ -1350,6 +1435,7 @@ export {
|
|
|
1350
1435
|
readMindooDBAppHostingMode,
|
|
1351
1436
|
readMindooDBAppLaunchId,
|
|
1352
1437
|
releaseMindooDBAppBridgeSessions,
|
|
1438
|
+
renderAgentGuideGroup,
|
|
1353
1439
|
renderHavenAppLandingPage,
|
|
1354
1440
|
resolveCurrentHavenAppUrl,
|
|
1355
1441
|
resolveMindooDBAppDefinitionUrl,
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aC as MindooDBAppComponentInfo,
|
|
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
|
|
|
@@ -35,6 +35,11 @@ interface MockEmbedHostOptions {
|
|
|
35
35
|
* without it.
|
|
36
36
|
*/
|
|
37
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[]>;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
/**
|
|
@@ -561,6 +566,11 @@ interface CreateMockMindooDBAppSessionOptions {
|
|
|
561
566
|
* from the host's database. No results without it.
|
|
562
567
|
*/
|
|
563
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"];
|
|
564
574
|
/**
|
|
565
575
|
* Answer `embeds.open` with a `container` like a current Haven: with this page
|
|
566
576
|
* for the SDK to frame (e.g. `about:blank`). Without it the host behaves like an
|
|
@@ -623,6 +633,8 @@ interface MockMindooDBAppSessionController {
|
|
|
623
633
|
emitIncomingContent(input: MockIncomingContentInput): Promise<MindooDBAppIncomingResult>;
|
|
624
634
|
/** Embeds the app has open (`session.embeds.open`). */
|
|
625
635
|
listEmbeds(): MockEmbedState[];
|
|
636
|
+
/** Every `session.embeds.requestAccess` input so far, oldest first. */
|
|
637
|
+
getEmbedAccessRequests(): MindooDBAppEmbedAccessInput[];
|
|
626
638
|
/** Closes an embed as Haven does when the component finishes or the user closes it. */
|
|
627
639
|
closeEmbed(embedId: string, reason?: MindooDBAppEmbedCloseReason, result?: unknown): void;
|
|
628
640
|
/** Replaces what `session.components.list` offers. */
|
|
@@ -752,6 +764,8 @@ interface FakeBridgeHostController {
|
|
|
752
764
|
applyRemoteUpdate(databaseId: string, docId: string, input: MindooDBAppUpdateDocumentInput, options?: MockRemoteUpdateOptions): Promise<MindooDBAppDocument>;
|
|
753
765
|
/** Embeds the app has open (`session.embeds.open`). */
|
|
754
766
|
listEmbeds(): MockEmbedState[];
|
|
767
|
+
/** Every `session.embeds.requestAccess` input so far, oldest first. */
|
|
768
|
+
getEmbedAccessRequests(): MindooDBAppEmbedAccessInput[];
|
|
755
769
|
/** Closes an embed and pushes the `embed-event` to the app. */
|
|
756
770
|
closeEmbed(embedId: string, reason?: MindooDBAppEmbedCloseReason, result?: unknown): void;
|
|
757
771
|
/** For an app under test that runs as a component: its `session.embedding` call. */
|
package/dist/testing/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
mindooDBAppComponentFieldsMatch,
|
|
5
5
|
pageUsers,
|
|
6
6
|
releaseMindooDBAppBridgeSessions
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-376SABPG.js";
|
|
8
8
|
|
|
9
9
|
// src/testing/index.ts
|
|
10
10
|
import * as Automerge from "@automerge/automerge";
|
|
@@ -458,7 +458,7 @@ async function createEvaluatingViewNavigator(input, documents) {
|
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
// src/testing/mockEmbeds.ts
|
|
461
|
-
function createMockEmbedHost(options, getDatabase) {
|
|
461
|
+
function createMockEmbedHost(options, getDatabase, listDatabaseIds = () => []) {
|
|
462
462
|
let components = [...options.components ?? []];
|
|
463
463
|
const embeds = /* @__PURE__ */ new Map();
|
|
464
464
|
const handles = /* @__PURE__ */ new Map();
|
|
@@ -471,6 +471,27 @@ function createMockEmbedHost(options, getDatabase) {
|
|
|
471
471
|
let saveRequestHandler = null;
|
|
472
472
|
let embedCounter = 0;
|
|
473
473
|
let embeddingFinish = null;
|
|
474
|
+
const accessRequests = [];
|
|
475
|
+
const grantedAccess = /* @__PURE__ */ new Set();
|
|
476
|
+
const pendingAccess = /* @__PURE__ */ new Set();
|
|
477
|
+
async function requestAccess(input) {
|
|
478
|
+
accessRequests.push(structuredClone(input));
|
|
479
|
+
const pairs = (input.components ?? []).flatMap(
|
|
480
|
+
(entry) => components.some((component) => component.key === entry.componentKey) ? (entry.databaseIds ?? listDatabaseIds()).filter((databaseId) => listDatabaseIds().includes(databaseId)).map((databaseId) => ({ componentKey: entry.componentKey, databaseId })) : []
|
|
481
|
+
);
|
|
482
|
+
const pairKey = (pair) => `${pair.componentKey}/${pair.databaseId}`;
|
|
483
|
+
const ask = pairs.filter((pair) => !grantedAccess.has(pairKey(pair)) && !pendingAccess.has(pairKey(pair)));
|
|
484
|
+
if (ask.length) {
|
|
485
|
+
const allowed = new Set((await (options.embedAccess?.(structuredClone(ask)) ?? ask)).map(pairKey));
|
|
486
|
+
for (const pair of ask) {
|
|
487
|
+
(allowed.has(pairKey(pair)) ? grantedAccess : pendingAccess).add(pairKey(pair));
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
return {
|
|
491
|
+
granted: pairs.filter((pair) => grantedAccess.has(pairKey(pair))),
|
|
492
|
+
pending: pairs.filter((pair) => !grantedAccess.has(pairKey(pair)))
|
|
493
|
+
};
|
|
494
|
+
}
|
|
474
495
|
function notifyChange() {
|
|
475
496
|
options.onEmbedChange?.([...embeds.values()].map((entry) => ({ ...entry, rect: { ...entry.rect } })));
|
|
476
497
|
}
|
|
@@ -711,7 +732,8 @@ function createMockEmbedHost(options, getDatabase) {
|
|
|
711
732
|
const handle = new MockEmbed(embedId, input.componentKey, input.databaseId, input.docId);
|
|
712
733
|
handles.set(embedId, handle);
|
|
713
734
|
return handle;
|
|
714
|
-
}
|
|
735
|
+
},
|
|
736
|
+
requestAccess
|
|
715
737
|
},
|
|
716
738
|
embedding: {
|
|
717
739
|
async complete(result) {
|
|
@@ -748,6 +770,12 @@ function createMockEmbedHost(options, getDatabase) {
|
|
|
748
770
|
setComponents(next) {
|
|
749
771
|
components = [...next];
|
|
750
772
|
},
|
|
773
|
+
getAccessRequests() {
|
|
774
|
+
return structuredClone(accessRequests);
|
|
775
|
+
},
|
|
776
|
+
getGrantedAccess() {
|
|
777
|
+
return [...grantedAccess];
|
|
778
|
+
},
|
|
751
779
|
getEmbeddingFinish() {
|
|
752
780
|
return embeddingFinish;
|
|
753
781
|
},
|
|
@@ -4310,6 +4338,13 @@ async function mockSha256Hex(value) {
|
|
|
4310
4338
|
const digest = await subtle.digest("SHA-256", new TextEncoder().encode(value));
|
|
4311
4339
|
return Array.from(new Uint8Array(digest)).map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
4312
4340
|
}
|
|
4341
|
+
function mockRevisionId(docId, index) {
|
|
4342
|
+
return `${docId}@${index}`;
|
|
4343
|
+
}
|
|
4344
|
+
function mockRevisionIndex(docId, revisionId) {
|
|
4345
|
+
const prefix = `${docId}@`;
|
|
4346
|
+
return revisionId.startsWith(prefix) ? Number(revisionId.slice(prefix.length)) : -1;
|
|
4347
|
+
}
|
|
4313
4348
|
function createDatabaseHandle(definition, peers, directoryUsers = () => [], localActor = MOCK_AUTOMERGE_LOCAL_ACTOR) {
|
|
4314
4349
|
let createCounter = 0;
|
|
4315
4350
|
let changeCounter = 0;
|
|
@@ -4318,12 +4353,41 @@ function createDatabaseHandle(definition, peers, directoryUsers = () => [], loca
|
|
|
4318
4353
|
const automergeMode = definition.automerge === true;
|
|
4319
4354
|
let changeSequence = 0;
|
|
4320
4355
|
const changedAt = /* @__PURE__ */ new Map();
|
|
4356
|
+
const revisions = /* @__PURE__ */ new Map();
|
|
4321
4357
|
const storedDocuments = new class extends Map {
|
|
4322
4358
|
set(id, document2) {
|
|
4323
4359
|
changedAt.set(id, ++changeSequence);
|
|
4360
|
+
const timeline = revisions.get(id) ?? [];
|
|
4361
|
+
const updatedAt = document2.updatedAt ? Date.parse(document2.updatedAt) : NaN;
|
|
4362
|
+
const previous = timeline[timeline.length - 1]?.timestamp ?? 0;
|
|
4363
|
+
timeline.push({
|
|
4364
|
+
// Strictly increasing, so a timestamp names one revision.
|
|
4365
|
+
timestamp: Math.max(Number.isFinite(updatedAt) ? updatedAt : Date.now(), previous + 1),
|
|
4366
|
+
data: structuredClone(document2.data),
|
|
4367
|
+
heads: document2.heads ? [...document2.heads] : void 0,
|
|
4368
|
+
isDeleted: document2.isDeleted,
|
|
4369
|
+
authorLabel: document2.authorLabel,
|
|
4370
|
+
attachments: structuredClone(document2.attachments ?? [])
|
|
4371
|
+
});
|
|
4372
|
+
revisions.set(id, timeline);
|
|
4324
4373
|
return super.set(id, document2);
|
|
4325
4374
|
}
|
|
4326
4375
|
}();
|
|
4376
|
+
function historicalDocument(docId, index, timestamp, revisionId) {
|
|
4377
|
+
const revision = index >= 0 ? revisions.get(docId)?.[index] : void 0;
|
|
4378
|
+
if (!revision) {
|
|
4379
|
+
return { id: docId, timestamp, state: "missing", data: null, attachments: [], ...revisionId ? { revisionId } : {} };
|
|
4380
|
+
}
|
|
4381
|
+
return {
|
|
4382
|
+
id: docId,
|
|
4383
|
+
revisionId: revisionId ?? mockRevisionId(docId, index),
|
|
4384
|
+
timestamp: revision.timestamp,
|
|
4385
|
+
heads: revision.heads ? [...revision.heads] : [],
|
|
4386
|
+
state: revision.isDeleted ? "deleted" : "exists",
|
|
4387
|
+
data: revision.isDeleted ? null : structuredClone(revision.data),
|
|
4388
|
+
attachments: structuredClone(revision.attachments)
|
|
4389
|
+
};
|
|
4390
|
+
}
|
|
4327
4391
|
for (const seed of definition.documents ?? []) {
|
|
4328
4392
|
const stored = {
|
|
4329
4393
|
id: seed.id,
|
|
@@ -4889,28 +4953,30 @@ function createDatabaseHandle(definition, peers, directoryUsers = () => [], loca
|
|
|
4889
4953
|
async listCreateKeys() {
|
|
4890
4954
|
return [{ keyId: "default", isDefault: true }];
|
|
4891
4955
|
},
|
|
4892
|
-
async listHistory(
|
|
4893
|
-
|
|
4956
|
+
async listHistory(docId) {
|
|
4957
|
+
const timeline = revisions.get(docId) ?? [];
|
|
4958
|
+
return timeline.map((revision, index) => ({
|
|
4959
|
+
revisionId: mockRevisionId(docId, index),
|
|
4960
|
+
timestamp: revision.timestamp,
|
|
4961
|
+
...revision.heads ? { heads: [...revision.heads] } : {},
|
|
4962
|
+
publicKey: revision.authorLabel ?? "mock-user",
|
|
4963
|
+
...revision.authorLabel ? { identityLabel: revision.authorLabel } : {},
|
|
4964
|
+
isDeleted: revision.isDeleted,
|
|
4965
|
+
isCurrent: index === timeline.length - 1,
|
|
4966
|
+
...index > 0 ? { dependencyIds: [mockRevisionId(docId, index - 1)] } : {}
|
|
4967
|
+
})).reverse();
|
|
4894
4968
|
},
|
|
4895
4969
|
async getAtTimestamp(docId, timestamp) {
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
};
|
|
4970
|
+
const timeline = revisions.get(docId) ?? [];
|
|
4971
|
+
let index = -1;
|
|
4972
|
+
timeline.forEach((revision, position) => {
|
|
4973
|
+
if (revision.timestamp <= timestamp) index = position;
|
|
4974
|
+
});
|
|
4975
|
+
return historicalDocument(docId, index, timestamp);
|
|
4903
4976
|
},
|
|
4904
|
-
async getAtRevision(docId, revisionId) {
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
revisionId,
|
|
4908
|
-
timestamp: Date.now(),
|
|
4909
|
-
heads: [],
|
|
4910
|
-
state: "missing",
|
|
4911
|
-
data: null,
|
|
4912
|
-
attachments: []
|
|
4913
|
-
};
|
|
4977
|
+
async getAtRevision(docId, revisionId, revisionOptions) {
|
|
4978
|
+
const index = mockRevisionIndex(docId, revisionId);
|
|
4979
|
+
return historicalDocument(docId, revisionOptions?.phase === "before" ? index - 1 : index, Date.now(), revisionId);
|
|
4914
4980
|
},
|
|
4915
4981
|
async getAtHeads(docId, _headIds) {
|
|
4916
4982
|
return {
|
|
@@ -5112,13 +5178,17 @@ function createDatabaseHandle(definition, peers, directoryUsers = () => [], loca
|
|
|
5112
5178
|
}
|
|
5113
5179
|
function createMockSessionState(options = {}) {
|
|
5114
5180
|
let launchContext = createDefaultLaunchContext(options.launchContext);
|
|
5115
|
-
const embedHost = createMockEmbedHost(
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5181
|
+
const embedHost = createMockEmbedHost(
|
|
5182
|
+
options,
|
|
5183
|
+
(databaseId) => {
|
|
5184
|
+
const database = databaseHandles.get(databaseId);
|
|
5185
|
+
if (!database) {
|
|
5186
|
+
throw new Error(`Unknown test database: ${databaseId}`);
|
|
5187
|
+
}
|
|
5188
|
+
return database;
|
|
5189
|
+
},
|
|
5190
|
+
() => [...databaseHandles.keys()]
|
|
5191
|
+
);
|
|
5122
5192
|
const themeListeners = /* @__PURE__ */ new Set();
|
|
5123
5193
|
let incomingHandler = null;
|
|
5124
5194
|
const pendingIncoming = [];
|
|
@@ -5769,6 +5839,7 @@ function createMockMindooDBAppSession(options = {}) {
|
|
|
5769
5839
|
getDragProfile: state.getDragProfile,
|
|
5770
5840
|
emitIncomingContent: state.emitIncomingContent,
|
|
5771
5841
|
listEmbeds: () => state.embedHost.listEmbeds(),
|
|
5842
|
+
getEmbedAccessRequests: () => state.embedHost.getAccessRequests(),
|
|
5772
5843
|
closeEmbed: (embedId, reason, result) => state.embedHost.closeEmbed(embedId, reason, result),
|
|
5773
5844
|
setComponents: (components) => state.embedHost.setComponents(components),
|
|
5774
5845
|
getEmbeddingFinish: () => state.embedHost.getEmbeddingFinish(),
|
|
@@ -6062,6 +6133,10 @@ function createFakeBridgeHost(options = {}) {
|
|
|
6062
6133
|
const embedId = await state.embedHost.openEmbed(input);
|
|
6063
6134
|
return input.placement === "frame" && options.embedFrameUrl ? { embedId, frame: { url: options.embedFrameUrl } } : { embedId };
|
|
6064
6135
|
}
|
|
6136
|
+
case "embeds.requestAccess":
|
|
6137
|
+
return await state.embedHost.embeds.requestAccess(
|
|
6138
|
+
params.input ?? { components: [] }
|
|
6139
|
+
);
|
|
6065
6140
|
case "embeds.setRect":
|
|
6066
6141
|
state.embedHost.setRect(String(params.embedId), params.rect);
|
|
6067
6142
|
return { ok: true };
|
|
@@ -6719,6 +6794,7 @@ function createFakeBridgeHost(options = {}) {
|
|
|
6719
6794
|
getDirectoryUsers: state.getDirectoryUsers,
|
|
6720
6795
|
applyRemoteUpdate: state.applyRemoteUpdate,
|
|
6721
6796
|
listEmbeds: () => state.embedHost.listEmbeds(),
|
|
6797
|
+
getEmbedAccessRequests: () => state.embedHost.getAccessRequests(),
|
|
6722
6798
|
closeEmbed: (embedId, reason, result) => state.embedHost.closeEmbed(embedId, reason, result),
|
|
6723
6799
|
getEmbeddingFinish: () => state.embedHost.getEmbeddingFinish(),
|
|
6724
6800
|
setEmbedDirty: (embedId, dirty) => state.embedHost.setEmbedDirty(embedId, dirty),
|
|
@@ -1702,6 +1702,36 @@ interface MindooDBAppEmbedOpenInput {
|
|
|
1702
1702
|
/** Default true. */
|
|
1703
1703
|
visible?: boolean;
|
|
1704
1704
|
}
|
|
1705
|
+
/** One component a host app wants to show, for `session.embeds.requestAccess`. */
|
|
1706
|
+
interface MindooDBAppEmbedAccessComponent {
|
|
1707
|
+
componentKey: string;
|
|
1708
|
+
/**
|
|
1709
|
+
* Host databases it will show documents of. Default: every database of this app
|
|
1710
|
+
* that it may update (`edit`) or read (`view`).
|
|
1711
|
+
*/
|
|
1712
|
+
databaseIds?: string[];
|
|
1713
|
+
/** Default `edit`. */
|
|
1714
|
+
intent?: "edit" | "view";
|
|
1715
|
+
}
|
|
1716
|
+
/** Input of `session.embeds.requestAccess`. */
|
|
1717
|
+
interface MindooDBAppEmbedAccessInput {
|
|
1718
|
+
components: MindooDBAppEmbedAccessComponent[];
|
|
1719
|
+
}
|
|
1720
|
+
/** A component in one host database. */
|
|
1721
|
+
interface MindooDBAppEmbedAccessPair {
|
|
1722
|
+
componentKey: string;
|
|
1723
|
+
databaseId: string;
|
|
1724
|
+
}
|
|
1725
|
+
/** What `session.embeds.requestAccess` settled on. */
|
|
1726
|
+
interface MindooDBAppEmbedAccessResult {
|
|
1727
|
+
/** Allowed, now or before: `embeds.open` shows these without asking. */
|
|
1728
|
+
granted: MindooDBAppEmbedAccessPair[];
|
|
1729
|
+
/**
|
|
1730
|
+
* Not allowed (the user unticked them or chose "Not now"): Haven asks again when
|
|
1731
|
+
* `embeds.open` shows one of them, and `requestAccess` does not ask for them again.
|
|
1732
|
+
*/
|
|
1733
|
+
pending: MindooDBAppEmbedAccessPair[];
|
|
1734
|
+
}
|
|
1705
1735
|
/** Why an embedded component went away. */
|
|
1706
1736
|
type MindooDBAppEmbedCloseReason = "completed" | "cancelled" | "closed" | "error";
|
|
1707
1737
|
/** Delivered once when an embedded component closes. */
|
|
@@ -1814,6 +1844,19 @@ interface MindooDBAppEmbedsApi {
|
|
|
1814
1844
|
* update. The first time, Haven asks the user to allow the pairing.
|
|
1815
1845
|
*/
|
|
1816
1846
|
open(input: MindooDBAppEmbedOpenInput): Promise<MindooDBAppEmbed>;
|
|
1847
|
+
/**
|
|
1848
|
+
* Asks the user once for all components this app is going to show, e.g. right
|
|
1849
|
+
* after `components.list`, instead of one prompt per component and database on
|
|
1850
|
+
* `open`. Haven shows a single list of what is not allowed yet (the user may
|
|
1851
|
+
* untick entries) and skips what the user allowed or put off before, so calling
|
|
1852
|
+
* this on every start is fine. Unknown components and databases this app may not
|
|
1853
|
+
* use are left out of the result.
|
|
1854
|
+
*
|
|
1855
|
+
* Havens that predate this answer with `method-not-found`; the SDK then resolves
|
|
1856
|
+
* with nothing granted and the pairs named in `databaseIds` pending, and `open`
|
|
1857
|
+
* asks as before.
|
|
1858
|
+
*/
|
|
1859
|
+
requestAccess(input: MindooDBAppEmbedAccessInput): Promise<MindooDBAppEmbedAccessResult>;
|
|
1817
1860
|
}
|
|
1818
1861
|
/** For an app running as an embedded component (check `launchContext.embed`). */
|
|
1819
1862
|
interface MindooDBAppEmbeddingApi {
|
|
@@ -3584,4 +3627,4 @@ interface MindooDBAppBridge {
|
|
|
3584
3627
|
connect(options?: MindooDBAppBridgeConnectOptions): Promise<MindooDBAppSession>;
|
|
3585
3628
|
}
|
|
3586
3629
|
|
|
3587
|
-
export { type MindooDBAppBridgeConnectOptions as $, MINDOODB_APP_SEAL_SIGNING_DOMAIN as A, MINDOODB_APP_WELL_KNOWN_DRAG_TYPES as B, type MindooDBAppAcceptSpec as C, type MindooDBAppAccessDecision as D, type MindooDBAppAccessTier as E, type MindooDBAppAgentApi as F, type MindooDBAppAgentRegistration as G, type MindooDBAppAgentTool 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 MindooDBAppDefinitionDatabase 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 MindooDBAppComponentContract as aA, type MindooDBAppComponentFieldValue as aB, type MindooDBAppComponentInfo as aC, type MindooDBAppComponentIntent as aD, type MindooDBAppComponentQuery as aE, type MindooDBAppComponentReference as aF, type MindooDBAppComponentSpec as aG, type MindooDBAppComponentsApi as aH, type MindooDBAppConfiguredViewCategorizationStyle as aI, type MindooDBAppConfiguredViewColumn as aJ, type MindooDBAppConfiguredViewColumnRole as aK, type MindooDBAppConfiguredViewExpressionMode as aL, type MindooDBAppConfiguredViewFieldExpression as aM, type MindooDBAppConfiguredViewFilterDefinition as aN, type MindooDBAppConfiguredViewFilterMode as aO, type MindooDBAppConfiguredViewFilterRule as aP, type MindooDBAppConfiguredViewFormulaExpression as aQ, type MindooDBAppConfiguredViewFormulaFilterDefinition as aR, type MindooDBAppConfiguredViewPreviewMode as aS, type MindooDBAppConfiguredViewRuleFilterDefinition as aT, type MindooDBAppConfiguredViewRuleMatchMode as aU, type MindooDBAppConfiguredViewRuleOperator as aV, type MindooDBAppConfiguredViewValueExpression as aW, type MindooDBAppCreateKeyInfo as aX, type MindooDBAppCreateViewInput as aY, type MindooDBAppCreateViewNavigatorInput as aZ, type MindooDBAppDatabaseInfo as a_, type MindooDBAppBridgeLocaleChangedMessage as aa, type MindooDBAppBridgePortMessage as ab, type MindooDBAppBridgeQueryResultMessage as ac, type MindooDBAppBridgeRpcError as ad, type MindooDBAppBridgeRpcMessage as ae, type MindooDBAppBridgeRpcRequest as af, type MindooDBAppBridgeRpcSuccess as ag, type MindooDBAppBridgeShortcutInvokedMessage as ah, type MindooDBAppBridgeShortcutsChangedMessage as ai, type MindooDBAppBridgeStreamAbortRequest as aj, type MindooDBAppBridgeStreamAck as ak, type MindooDBAppBridgeStreamCloseRequest as al, type MindooDBAppBridgeStreamError as am, type MindooDBAppBridgeStreamMessage as an, type MindooDBAppBridgeStreamOpenResult as ao, type MindooDBAppBridgeStreamReadRequest as ap, type MindooDBAppBridgeStreamWriteRequest as aq, type MindooDBAppBridgeThemeChangedMessage as ar, type MindooDBAppBridgeUiPreferencesChangedMessage as as, type MindooDBAppBridgeViewChangedMessage as at, type MindooDBAppBridgeViewportChangedMessage as au, type MindooDBAppBridgeWorkspaceFocusRequestedMessage as av, type MindooDBAppBrowserFeatures as aw, type MindooDBAppCapability as ax, type MindooDBAppComponentCategory as ay, type MindooDBAppComponentChildren as az, type MindooDBAppDragStartInput as b, type MindooDBAppJsonSetPatch as b$, type MindooDBAppDefinitionListing as b0, type MindooDBAppDefinitionPermission as b1, type MindooDBAppDefinitionRegistrationPermission as b2, type MindooDBAppDefinitionScreenshot as b3, type MindooDBAppDefinitionValidation as b4, type MindooDBAppDirectoryApi as b5, type MindooDBAppDirectoryEntry as b6, type MindooDBAppDocumentApi as b7, type MindooDBAppDocumentHeadCursorResult as b8, type MindooDBAppDocumentHistoryEntry as b9, type MindooDBAppEmbeddingLookupResult as bA, type MindooDBAppEmbedsApi as bB, type MindooDBAppEntryAttachmentRef as bC, type MindooDBAppEntryProvenance as bD, type MindooDBAppExtractDocumentTextInput as bE, type MindooDBAppExtractDocumentTextResult as bF, type MindooDBAppExtractTextFormat as bG, type MindooDBAppExtractionSetup as bH, type MindooDBAppFulltextSetup as bI, type MindooDBAppHistoricalDocument as bJ, type MindooDBAppHistoryQuery as bK, type MindooDBAppHostTheme as bL, type MindooDBAppIdentityApi as bM, type MindooDBAppInaccessibleDocument as bN, type MindooDBAppInaccessibleDocumentListQuery as bO, type MindooDBAppInaccessibleDocumentListResult as bP, type MindooDBAppIncomingContent as bQ, type MindooDBAppIncomingContentHandler as bR, type MindooDBAppIncomingContentInfo as bS, type MindooDBAppIncomingItem as bT, type MindooDBAppIncomingItemInfo as bU, type MindooDBAppIncomingResult as bV, type MindooDBAppIncomingSource as bW, type MindooDBAppJsonCounterIncrementPatch as bX, type MindooDBAppJsonListDeletePatch as bY, type MindooDBAppJsonListInsertPatch as bZ, type MindooDBAppJsonPatch as b_, type MindooDBAppDocumentListQuery as ba, type MindooDBAppDocumentListResult as bb, type MindooDBAppDocumentQuery as bc, type MindooDBAppDocumentRevisionId as bd, type MindooDBAppDocumentScanPreset as be, type MindooDBAppDocumentSummary as bf, type MindooDBAppDragApi as bg, type MindooDBAppDragCancelReason as bh, type MindooDBAppDragDropEvent as bi, type MindooDBAppDragEffect as bj, type MindooDBAppDragHoverResult as bk, type MindooDBAppDragOffer as bl, type MindooDBAppDragOverEvent as bm, type MindooDBAppDragPointer as bn, type MindooDBAppDragProfile as bo, type MindooDBAppEmbed as bp, type MindooDBAppEmbedAgentTools as bq, type MindooDBAppEmbedAgentToolsEvent as br, type MindooDBAppEmbedCloseReason as bs, type MindooDBAppEmbedClosedEvent as bt, type MindooDBAppEmbedContext as bu, type MindooDBAppEmbedDirtyEvent as bv, type MindooDBAppEmbedOpenInput as bw, type MindooDBAppEmbedRect as bx, type MindooDBAppEmbeddingApi as by, type MindooDBAppEmbeddingLookupOptions as bz, type MindooDBAppDragStartResult as c, type MindooDBAppShowMenuResult as c$, type MindooDBAppJsonTextMarkPatch as c0, type MindooDBAppJsonTextSplicePatch as c1, type MindooDBAppJsonTextUnmarkPatch as c2, type MindooDBAppJsonUnsetPatch as c3, type MindooDBAppLaunchContext as c4, type MindooDBAppListUsersOptions as c5, type MindooDBAppListUsersPage as c6, type MindooDBAppLiveQuerySubscription as c7, type MindooDBAppLocalizedText as c8, type MindooDBAppMenuAnchor as c9, type MindooDBAppRecipientOptions as cA, type MindooDBAppResolvedViewDefinition as cB, type MindooDBAppResolvedViewSource as cC, type MindooDBAppRevisionPhase as cD, type MindooDBAppRevisionVerification as cE, type MindooDBAppRichTextBlockSpan as cF, type MindooDBAppRichTextGetOptions as cG, type MindooDBAppRichTextImmutableString as cH, type MindooDBAppRichTextMarkRange as cI, type MindooDBAppRichTextMaterializeValue as cJ, type MindooDBAppRichTextPatch as cK, type MindooDBAppRichTextScalar as cL, type MindooDBAppRichTextSpliceStep as cM, type MindooDBAppRichTextStep as cN, type MindooDBAppRichTextStepPatch as cO, type MindooDBAppRichTextTextSpan as cP, type MindooDBAppRuntime as cQ, type MindooDBAppScanAttachmentOptions as cR, type MindooDBAppScanAttachmentResult as cS, type MindooDBAppScopedDocId as cT, type MindooDBAppScopedDocumentSummary as cU, type MindooDBAppSealIntent as cV, type MindooDBAppSealedChannelOpenInput as cW, type MindooDBAppSealedChannelOpenResult as cX, type MindooDBAppSealedChannelRequestInput as cY, type MindooDBAppSession as cZ, type MindooDBAppShowMenuInput as c_, type MindooDBAppMenuApi as ca, type MindooDBAppMenuCommandItem as cb, type MindooDBAppMenuDismissReason as cc, type MindooDBAppMenuDismissedResult as cd, type MindooDBAppMenuItem as ce, type MindooDBAppMenuKind as cf, type MindooDBAppMenuPlacement as cg, type MindooDBAppMenuPointAnchor as ch, type MindooDBAppMenuRect as ci, type MindooDBAppMenuRectAnchor as cj, type MindooDBAppMenuSelectionResult as ck, type MindooDBAppMenuSeparatorItem as cl, type MindooDBAppNotificationSeverity as cm, type MindooDBAppNotifyInput as cn, type MindooDBAppNotifyResult as co, type MindooDBAppProposeAppInput as cp, type MindooDBAppProposeAppResult as cq, type MindooDBAppQueryCoverage as cr, type MindooDBAppQueryInclude as cs, type MindooDBAppQueryIncludeCardinality as ct, type MindooDBAppQueryIncludeSlots as cu, type MindooDBAppQueryResult as cv, type MindooDBAppQueryRow as cw, type MindooDBAppQuerySortKey as cx, type MindooDBAppQueryTextClause as cy, type MindooDBAppReadableAttachmentStream as cz, type MindooDBAppDragPreview as d, type MindooDBAppSignPreview as d0, type MindooDBAppSignPreviewScope as d1, type MindooDBAppSignStatementInput as d2, type MindooDBAppSignStatementResult as d3, type MindooDBAppStorageApi as d4, type MindooDBAppSummarySetup as d5, type MindooDBAppTextCursorOptions as d6, type MindooDBAppTextCursorPosition as d7, type MindooDBAppTextCursorPositionsResult as d8, type MindooDBAppTextCursorsResult as d9, mindooDBAppComponentFieldsMatch as dA, resolveMindooDBAppDefinitionUrl as dB, resolveMindooDBAppListingAssetUrl as dC, resolveMindooDBAppLocalizedText as dD, validateMindooDBAppAccepts as dE, validateMindooDBAppComponents as dF, validateMindooDBAppDefinition as dG, type MindooDBAppTextEdit as da, type MindooDBAppTextPatch as db, type MindooDBAppThemeMode as dc, type MindooDBAppTimestampApi as dd, type MindooDBAppTimestampInput as de, type MindooDBAppTimestampProvider as df, type MindooDBAppTimestampResult as dg, type MindooDBAppUiPreferences as dh, type MindooDBAppUpdateDocumentInput as di, type MindooDBAppViewCursorDocumentListResult as dj, type MindooDBAppViewCursorResult as dk, type MindooDBAppViewEntry as dl, type MindooDBAppViewEntryKind as dm, type MindooDBAppViewNavigator as dn, type MindooDBAppViewNavigatorExpansionState as dp, type MindooDBAppViewNavigatorOpenOptions as dq, type MindooDBAppViewNavigatorPageOptions as dr, type MindooDBAppViewNavigatorPageResult as ds, type MindooDBAppViewNavigatorRangeQuery as dt, type MindooDBAppViewNavigatorSelectionState as du, type MindooDBAppViewUpdateStats as dv, type MindooDBAppViewport as dw, type MindooDBAppWellKnownDragType as dx, type MindooDBAppWritableAttachmentStream as dy, mindooDBAppAcceptMatchesType as dz, type MindooDBAppBridge as e, type MindooDBAppAgentToolErrorCode as f, type MindooDBAppHostShortcutBinding as g, type MindooDBAppHostShortcutAction as h, type MindooDBAppHostingMode as i, type MindooDBAppDefinition as j, type MindooDBAppDatabase as k, type MindooDBAppDocument as l, type MindooDBAppRichTextSpan as m, type MindooDBAppRichTextSnapshot as n, type MindooDBAppCreateDocumentInput as o, MINDOODB_APP_ACCEPTS_MAX as p, MINDOODB_APP_COMPONENTS_MAX as q, MINDOODB_APP_COMPONENT_CONTRACT_PATTERN as r, MINDOODB_APP_DEFINITION_FILE_NAME as s, MINDOODB_APP_DEFINITION_FORMAT as t, MINDOODB_APP_DEFINITION_PERMISSIONS as u, MINDOODB_APP_DEFINITION_REGISTRATION_PERMISSIONS as v, MINDOODB_APP_DEFINITION_VERSION as w, MINDOODB_APP_LISTING_DESCRIPTION_MAX as x, MINDOODB_APP_LISTING_MAX_SCREENSHOTS as y, MINDOODB_APP_LISTING_SUMMARY_MAX as z };
|
|
3630
|
+
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 MindooDBAppDefinitionDatabase 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 MindooDBAppComponentContract as aA, type MindooDBAppComponentFieldValue as aB, type MindooDBAppComponentInfo as aC, type MindooDBAppComponentIntent as aD, type MindooDBAppComponentQuery as aE, type MindooDBAppComponentReference as aF, type MindooDBAppComponentSpec as aG, type MindooDBAppComponentsApi as aH, type MindooDBAppConfiguredViewCategorizationStyle as aI, type MindooDBAppConfiguredViewColumn as aJ, type MindooDBAppConfiguredViewColumnRole as aK, type MindooDBAppConfiguredViewExpressionMode as aL, type MindooDBAppConfiguredViewFieldExpression as aM, type MindooDBAppConfiguredViewFilterDefinition as aN, type MindooDBAppConfiguredViewFilterMode as aO, type MindooDBAppConfiguredViewFilterRule as aP, type MindooDBAppConfiguredViewFormulaExpression as aQ, type MindooDBAppConfiguredViewFormulaFilterDefinition as aR, type MindooDBAppConfiguredViewPreviewMode as aS, type MindooDBAppConfiguredViewRuleFilterDefinition as aT, type MindooDBAppConfiguredViewRuleMatchMode as aU, type MindooDBAppConfiguredViewRuleOperator as aV, type MindooDBAppConfiguredViewValueExpression as aW, type MindooDBAppCreateKeyInfo as aX, type MindooDBAppCreateViewInput as aY, type MindooDBAppCreateViewNavigatorInput as aZ, type MindooDBAppDatabaseInfo as a_, type MindooDBAppBridgeLocaleChangedMessage as aa, type MindooDBAppBridgePortMessage as ab, type MindooDBAppBridgeQueryResultMessage as ac, type MindooDBAppBridgeRpcError as ad, type MindooDBAppBridgeRpcMessage as ae, type MindooDBAppBridgeRpcRequest as af, type MindooDBAppBridgeRpcSuccess as ag, type MindooDBAppBridgeShortcutInvokedMessage as ah, type MindooDBAppBridgeShortcutsChangedMessage as ai, type MindooDBAppBridgeStreamAbortRequest as aj, type MindooDBAppBridgeStreamAck as ak, type MindooDBAppBridgeStreamCloseRequest as al, type MindooDBAppBridgeStreamError as am, type MindooDBAppBridgeStreamMessage as an, type MindooDBAppBridgeStreamOpenResult as ao, type MindooDBAppBridgeStreamReadRequest as ap, type MindooDBAppBridgeStreamWriteRequest as aq, type MindooDBAppBridgeThemeChangedMessage as ar, type MindooDBAppBridgeUiPreferencesChangedMessage as as, type MindooDBAppBridgeViewChangedMessage as at, type MindooDBAppBridgeViewportChangedMessage as au, type MindooDBAppBridgeWorkspaceFocusRequestedMessage as av, type MindooDBAppBrowserFeatures as aw, type MindooDBAppCapability as ax, type MindooDBAppComponentCategory as ay, type MindooDBAppComponentChildren as az, type MindooDBAppDragStartInput as b, type MindooDBAppJsonCounterIncrementPatch as b$, type MindooDBAppDefinitionListing as b0, type MindooDBAppDefinitionPermission as b1, type MindooDBAppDefinitionRegistrationPermission as b2, type MindooDBAppDefinitionScreenshot as b3, type MindooDBAppDefinitionValidation as b4, type MindooDBAppDirectoryApi as b5, type MindooDBAppDirectoryEntry as b6, type MindooDBAppDocumentApi as b7, type MindooDBAppDocumentHeadCursorResult as b8, type MindooDBAppDocumentHistoryEntry as b9, type MindooDBAppEmbedOpenInput as bA, type MindooDBAppEmbedRect as bB, type MindooDBAppEmbeddingApi as bC, type MindooDBAppEmbeddingLookupOptions as bD, type MindooDBAppEmbeddingLookupResult as bE, type MindooDBAppEmbedsApi as bF, type MindooDBAppEntryAttachmentRef as bG, type MindooDBAppEntryProvenance as bH, type MindooDBAppExtractDocumentTextInput as bI, type MindooDBAppExtractDocumentTextResult as bJ, type MindooDBAppExtractTextFormat as bK, type MindooDBAppExtractionSetup as bL, type MindooDBAppFulltextSetup as bM, type MindooDBAppHistoricalDocument as bN, type MindooDBAppHistoryQuery as bO, type MindooDBAppHostTheme as bP, type MindooDBAppIdentityApi as bQ, type MindooDBAppInaccessibleDocument as bR, type MindooDBAppInaccessibleDocumentListQuery as bS, type MindooDBAppInaccessibleDocumentListResult as bT, type MindooDBAppIncomingContent as bU, type MindooDBAppIncomingContentHandler as bV, type MindooDBAppIncomingContentInfo as bW, type MindooDBAppIncomingItem as bX, type MindooDBAppIncomingItemInfo as bY, type MindooDBAppIncomingResult as bZ, type MindooDBAppIncomingSource as b_, type MindooDBAppDocumentListQuery as ba, type MindooDBAppDocumentListResult as bb, type MindooDBAppDocumentQuery as bc, type MindooDBAppDocumentRevisionId as bd, type MindooDBAppDocumentScanPreset as be, type MindooDBAppDocumentSummary as bf, type MindooDBAppDragApi as bg, type MindooDBAppDragCancelReason as bh, type MindooDBAppDragDropEvent as bi, type MindooDBAppDragEffect as bj, type MindooDBAppDragHoverResult as bk, type MindooDBAppDragOffer as bl, type MindooDBAppDragOverEvent as bm, type MindooDBAppDragPointer as bn, type MindooDBAppDragProfile as bo, type MindooDBAppEmbed as bp, type MindooDBAppEmbedAccessComponent as bq, type MindooDBAppEmbedAccessInput as br, type MindooDBAppEmbedAccessPair as bs, type MindooDBAppEmbedAccessResult as bt, type MindooDBAppEmbedAgentTools as bu, type MindooDBAppEmbedAgentToolsEvent as bv, type MindooDBAppEmbedCloseReason as bw, type MindooDBAppEmbedClosedEvent as bx, type MindooDBAppEmbedContext as by, type MindooDBAppEmbedDirtyEvent as bz, type MindooDBAppDragStartResult as c, type MindooDBAppSealedChannelOpenResult as c$, type MindooDBAppJsonListDeletePatch as c0, type MindooDBAppJsonListInsertPatch as c1, type MindooDBAppJsonPatch as c2, type MindooDBAppJsonSetPatch as c3, type MindooDBAppJsonTextMarkPatch as c4, type MindooDBAppJsonTextSplicePatch as c5, type MindooDBAppJsonTextUnmarkPatch as c6, type MindooDBAppJsonUnsetPatch as c7, type MindooDBAppLaunchContext as c8, type MindooDBAppListUsersOptions as c9, type MindooDBAppQueryRow as cA, type MindooDBAppQuerySortKey as cB, type MindooDBAppQueryTextClause as cC, type MindooDBAppReadableAttachmentStream as cD, type MindooDBAppRecipientOptions as cE, type MindooDBAppResolvedViewDefinition as cF, type MindooDBAppResolvedViewSource as cG, type MindooDBAppRevisionPhase as cH, type MindooDBAppRevisionVerification as cI, type MindooDBAppRichTextBlockSpan as cJ, type MindooDBAppRichTextGetOptions as cK, type MindooDBAppRichTextImmutableString as cL, type MindooDBAppRichTextMarkRange as cM, type MindooDBAppRichTextMaterializeValue as cN, type MindooDBAppRichTextPatch as cO, type MindooDBAppRichTextScalar as cP, type MindooDBAppRichTextSpliceStep as cQ, type MindooDBAppRichTextStep as cR, type MindooDBAppRichTextStepPatch as cS, type MindooDBAppRichTextTextSpan as cT, type MindooDBAppRuntime as cU, type MindooDBAppScanAttachmentOptions as cV, type MindooDBAppScanAttachmentResult as cW, type MindooDBAppScopedDocId as cX, type MindooDBAppScopedDocumentSummary as cY, type MindooDBAppSealIntent as cZ, type MindooDBAppSealedChannelOpenInput as c_, type MindooDBAppListUsersPage as ca, type MindooDBAppLiveQuerySubscription as cb, type MindooDBAppLocalizedText as cc, type MindooDBAppMenuAnchor as cd, type MindooDBAppMenuApi as ce, type MindooDBAppMenuCommandItem as cf, type MindooDBAppMenuDismissReason as cg, type MindooDBAppMenuDismissedResult as ch, type MindooDBAppMenuItem as ci, type MindooDBAppMenuKind as cj, type MindooDBAppMenuPlacement as ck, type MindooDBAppMenuPointAnchor as cl, type MindooDBAppMenuRect as cm, type MindooDBAppMenuRectAnchor as cn, type MindooDBAppMenuSelectionResult as co, type MindooDBAppMenuSeparatorItem as cp, type MindooDBAppNotificationSeverity as cq, type MindooDBAppNotifyInput as cr, type MindooDBAppNotifyResult as cs, type MindooDBAppProposeAppInput as ct, type MindooDBAppProposeAppResult as cu, type MindooDBAppQueryCoverage as cv, type MindooDBAppQueryInclude as cw, type MindooDBAppQueryIncludeCardinality as cx, type MindooDBAppQueryIncludeSlots as cy, type MindooDBAppQueryResult as cz, type MindooDBAppDragPreview as d, type MindooDBAppSealedChannelRequestInput as d0, type MindooDBAppSession as d1, type MindooDBAppShowMenuInput as d2, type MindooDBAppShowMenuResult as d3, type MindooDBAppSignPreview as d4, type MindooDBAppSignPreviewScope as d5, type MindooDBAppSignStatementInput as d6, type MindooDBAppSignStatementResult as d7, type MindooDBAppStorageApi as d8, type MindooDBAppSummarySetup as d9, type MindooDBAppViewport as dA, type MindooDBAppWellKnownDragType as dB, type MindooDBAppWritableAttachmentStream as dC, mindooDBAppAcceptMatchesType as dD, mindooDBAppComponentFieldsMatch as dE, resolveMindooDBAppDefinitionUrl as dF, resolveMindooDBAppListingAssetUrl as dG, resolveMindooDBAppLocalizedText as dH, validateMindooDBAppAccepts as dI, validateMindooDBAppComponents as dJ, validateMindooDBAppDefinition as dK, type MindooDBAppTextCursorOptions as da, type MindooDBAppTextCursorPosition as db, type MindooDBAppTextCursorPositionsResult as dc, type MindooDBAppTextCursorsResult as dd, type MindooDBAppTextEdit as de, type MindooDBAppTextPatch as df, type MindooDBAppThemeMode as dg, type MindooDBAppTimestampApi as dh, type MindooDBAppTimestampInput as di, type MindooDBAppTimestampProvider as dj, type MindooDBAppTimestampResult as dk, type MindooDBAppUiPreferences as dl, type MindooDBAppUpdateDocumentInput as dm, type MindooDBAppViewCursorDocumentListResult as dn, type MindooDBAppViewCursorResult as dp, type MindooDBAppViewEntry as dq, type MindooDBAppViewEntryKind as dr, type MindooDBAppViewNavigator as ds, type MindooDBAppViewNavigatorExpansionState as dt, type MindooDBAppViewNavigatorOpenOptions as du, type MindooDBAppViewNavigatorPageOptions as dv, type MindooDBAppViewNavigatorPageResult as dw, type MindooDBAppViewNavigatorRangeQuery as dx, type MindooDBAppViewNavigatorSelectionState as dy, type MindooDBAppViewUpdateStats 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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mindoodb-app-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.67",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22.13.0"
|
|
6
6
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@automerge/automerge": "^3.3.2",
|
|
48
|
-
"mindoodb": ">=0.0.
|
|
48
|
+
"mindoodb": ">=0.0.75"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"@automerge/automerge": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@automerge/automerge": "^3.5.0",
|
|
60
|
-
"mindoodb": "^0.0.
|
|
60
|
+
"mindoodb": "^0.0.75",
|
|
61
61
|
"@types/node": "25.5.0",
|
|
62
62
|
"jsdom": "^29.0.1",
|
|
63
63
|
"tsup": "^8.5.1",
|