mindoodb-app-sdk 0.0.66 → 0.0.68
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-44S2R2PT.js} +123 -0
- package/dist/index.d.ts +89 -3
- package/dist/index.js +87 -1
- package/dist/testing/index.d.ts +22 -1
- package/dist/testing/index.js +159 -29
- package/dist/{types-Cuw-0Iou.d.ts → types-BYsO5n5-.d.ts} +131 -2
- 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 = {
|
|
@@ -1954,6 +1977,103 @@ var MindooDBAppIncomingApiImpl = class {
|
|
|
1954
1977
|
}
|
|
1955
1978
|
};
|
|
1956
1979
|
|
|
1980
|
+
// src/client/reminders.ts
|
|
1981
|
+
function isReminderOpenedMessage(message) {
|
|
1982
|
+
return message.kind === "reminder-opened";
|
|
1983
|
+
}
|
|
1984
|
+
function isUnknownMethod(error) {
|
|
1985
|
+
const code = error?.code;
|
|
1986
|
+
return code === "method-not-found" || code === "unsupported";
|
|
1987
|
+
}
|
|
1988
|
+
var MindooDBAppRemindersApiImpl = class {
|
|
1989
|
+
constructor(rpc) {
|
|
1990
|
+
this.rpc = rpc;
|
|
1991
|
+
this.stopListening = this.rpc.addMessageListener((message) => {
|
|
1992
|
+
if (!isReminderOpenedMessage(message)) {
|
|
1993
|
+
return;
|
|
1994
|
+
}
|
|
1995
|
+
if (this.handler) {
|
|
1996
|
+
void this.deliver(message.reminder);
|
|
1997
|
+
} else {
|
|
1998
|
+
this.pending.push(message.reminder);
|
|
1999
|
+
}
|
|
2000
|
+
});
|
|
2001
|
+
}
|
|
2002
|
+
rpc;
|
|
2003
|
+
handler = null;
|
|
2004
|
+
pending = [];
|
|
2005
|
+
stopListening;
|
|
2006
|
+
async schedule(request) {
|
|
2007
|
+
const at = request.at instanceof Date ? request.at.getTime() : request.at;
|
|
2008
|
+
try {
|
|
2009
|
+
return await this.rpc.call("reminders.schedule", {
|
|
2010
|
+
id: request.id,
|
|
2011
|
+
title: request.title,
|
|
2012
|
+
body: request.body,
|
|
2013
|
+
at,
|
|
2014
|
+
target: request.target
|
|
2015
|
+
});
|
|
2016
|
+
} catch (error) {
|
|
2017
|
+
if (isUnknownMethod(error)) {
|
|
2018
|
+
return { status: "unsupported" };
|
|
2019
|
+
}
|
|
2020
|
+
throw error;
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
async cancel(id) {
|
|
2024
|
+
try {
|
|
2025
|
+
await this.rpc.call("reminders.cancel", { id });
|
|
2026
|
+
} catch (error) {
|
|
2027
|
+
if (!isUnknownMethod(error)) {
|
|
2028
|
+
throw error;
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
async list() {
|
|
2033
|
+
try {
|
|
2034
|
+
return await this.rpc.call("reminders.list", {});
|
|
2035
|
+
} catch (error) {
|
|
2036
|
+
if (isUnknownMethod(error)) {
|
|
2037
|
+
return [];
|
|
2038
|
+
}
|
|
2039
|
+
throw error;
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
onOpened(handler) {
|
|
2043
|
+
this.handler = handler;
|
|
2044
|
+
void this.rpc.call("reminders.subscribe", {}).catch(() => {
|
|
2045
|
+
});
|
|
2046
|
+
this.pending.splice(0).forEach((opened) => {
|
|
2047
|
+
void this.deliver(opened);
|
|
2048
|
+
});
|
|
2049
|
+
return () => {
|
|
2050
|
+
if (this.handler !== handler) {
|
|
2051
|
+
return;
|
|
2052
|
+
}
|
|
2053
|
+
this.handler = null;
|
|
2054
|
+
void this.rpc.call("reminders.unsubscribe", {}).catch(() => {
|
|
2055
|
+
});
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2058
|
+
dispose() {
|
|
2059
|
+
this.stopListening();
|
|
2060
|
+
this.handler = null;
|
|
2061
|
+
this.pending.length = 0;
|
|
2062
|
+
}
|
|
2063
|
+
async deliver(opened) {
|
|
2064
|
+
const handler = this.handler;
|
|
2065
|
+
if (!handler) {
|
|
2066
|
+
this.pending.push(opened);
|
|
2067
|
+
return;
|
|
2068
|
+
}
|
|
2069
|
+
try {
|
|
2070
|
+
await handler(opened);
|
|
2071
|
+
} catch (error) {
|
|
2072
|
+
console.warn("[mindoodb-app-sdk] A reminder handler failed.", error);
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
};
|
|
2076
|
+
|
|
1957
2077
|
// src/client/portRpcClient.ts
|
|
1958
2078
|
var PROTOCOL = "mindoodb-app-bridge";
|
|
1959
2079
|
function normalizeRpcValue(value, seen = /* @__PURE__ */ new WeakMap()) {
|
|
@@ -3230,6 +3350,7 @@ var MindooDBAppSessionImpl = class {
|
|
|
3230
3350
|
this.drag = new MindooDBAppDragApiImpl(this.rpc);
|
|
3231
3351
|
this.agent = new MindooDBAppAgentApiImpl(this.rpc);
|
|
3232
3352
|
this.incoming = new MindooDBAppIncomingApiImpl(this.rpc);
|
|
3353
|
+
this.reminders = new MindooDBAppRemindersApiImpl(this.rpc);
|
|
3233
3354
|
this.embedsClient = new MindooDBAppEmbedsClient(this.rpc);
|
|
3234
3355
|
this.components = this.embedsClient.components;
|
|
3235
3356
|
this.embeds = this.embedsClient.embeds;
|
|
@@ -3298,6 +3419,7 @@ var MindooDBAppSessionImpl = class {
|
|
|
3298
3419
|
storage;
|
|
3299
3420
|
agent;
|
|
3300
3421
|
incoming;
|
|
3422
|
+
reminders;
|
|
3301
3423
|
embedsClient;
|
|
3302
3424
|
components;
|
|
3303
3425
|
embeds;
|
|
@@ -3480,6 +3602,7 @@ var MindooDBAppSessionImpl = class {
|
|
|
3480
3602
|
this.drag.dispose();
|
|
3481
3603
|
this.agent.dispose();
|
|
3482
3604
|
this.incoming.dispose();
|
|
3605
|
+
this.reminders.dispose();
|
|
3483
3606
|
this.embedsClient.dispose();
|
|
3484
3607
|
try {
|
|
3485
3608
|
await this.rpc.call("session.disconnect", {});
|
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-BYsO5n5-.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 MindooDBAppBridgeReminderOpenedMessage, ae as MindooDBAppBridgeRpcError, af as MindooDBAppBridgeRpcMessage, ag as MindooDBAppBridgeRpcRequest, ah as MindooDBAppBridgeRpcSuccess, ai as MindooDBAppBridgeShortcutInvokedMessage, aj as MindooDBAppBridgeShortcutsChangedMessage, ak as MindooDBAppBridgeStreamAbortRequest, al as MindooDBAppBridgeStreamAck, am as MindooDBAppBridgeStreamCloseRequest, an as MindooDBAppBridgeStreamError, ao as MindooDBAppBridgeStreamMessage, ap as MindooDBAppBridgeStreamOpenResult, aq as MindooDBAppBridgeStreamReadRequest, ar as MindooDBAppBridgeStreamWriteRequest, as as MindooDBAppBridgeThemeChangedMessage, at as MindooDBAppBridgeUiPreferencesChangedMessage, au as MindooDBAppBridgeViewChangedMessage, av as MindooDBAppBridgeViewportChangedMessage, aw as MindooDBAppBridgeWorkspaceFocusRequestedMessage, ax as MindooDBAppBrowserFeatures, ay as MindooDBAppCapability, az as MindooDBAppComponentCategory, aA as MindooDBAppComponentChildren, aB as MindooDBAppComponentContract, aC as MindooDBAppComponentFieldValue, aD as MindooDBAppComponentInfo, aE as MindooDBAppComponentIntent, aF as MindooDBAppComponentQuery, aG as MindooDBAppComponentReference, aH as MindooDBAppComponentSpec, aI as MindooDBAppComponentsApi, aJ as MindooDBAppConfiguredViewCategorizationStyle, aK as MindooDBAppConfiguredViewColumn, aL as MindooDBAppConfiguredViewColumnRole, aM as MindooDBAppConfiguredViewExpressionMode, aN as MindooDBAppConfiguredViewFieldExpression, aO as MindooDBAppConfiguredViewFilterDefinition, aP as MindooDBAppConfiguredViewFilterMode, aQ as MindooDBAppConfiguredViewFilterRule, aR as MindooDBAppConfiguredViewFormulaExpression, aS as MindooDBAppConfiguredViewFormulaFilterDefinition, aT as MindooDBAppConfiguredViewPreviewMode, aU as MindooDBAppConfiguredViewRuleFilterDefinition, aV as MindooDBAppConfiguredViewRuleMatchMode, aW as MindooDBAppConfiguredViewRuleOperator, aX as MindooDBAppConfiguredViewValueExpression, aY as MindooDBAppCreateKeyInfo, aZ as MindooDBAppCreateViewInput, a_ as MindooDBAppCreateViewNavigatorInput, a$ as MindooDBAppDatabaseInfo, b0 as MindooDBAppDefinitionDatabase, b1 as MindooDBAppDefinitionListing, b2 as MindooDBAppDefinitionPermission, b3 as MindooDBAppDefinitionRegistrationPermission, b4 as MindooDBAppDefinitionScreenshot, b5 as MindooDBAppDefinitionValidation, b6 as MindooDBAppDirectoryApi, b7 as MindooDBAppDirectoryEntry, b8 as MindooDBAppDocumentApi, b9 as MindooDBAppDocumentHeadCursorResult, ba as MindooDBAppDocumentHistoryEntry, bb as MindooDBAppDocumentListQuery, bc as MindooDBAppDocumentListResult, bd as MindooDBAppDocumentQuery, be as MindooDBAppDocumentRevisionId, bf as MindooDBAppDocumentScanPreset, bg as MindooDBAppDocumentSummary, bh as MindooDBAppDragApi, bi as MindooDBAppDragCancelReason, bj as MindooDBAppDragDropEvent, bk as MindooDBAppDragEffect, bl as MindooDBAppDragHoverResult, bm as MindooDBAppDragOffer, bn as MindooDBAppDragOverEvent, bo as MindooDBAppDragPointer, bp as MindooDBAppDragProfile, bq as MindooDBAppEmbed, br as MindooDBAppEmbedAccessComponent, bs as MindooDBAppEmbedAccessInput, bt as MindooDBAppEmbedAccessPair, bu as MindooDBAppEmbedAccessResult, bv as MindooDBAppEmbedAgentTools, bw as MindooDBAppEmbedAgentToolsEvent, bx as MindooDBAppEmbedCloseReason, by as MindooDBAppEmbedClosedEvent, bz as MindooDBAppEmbedContext, bA as MindooDBAppEmbedDirtyEvent, bB as MindooDBAppEmbedOpenInput, bC as MindooDBAppEmbedRect, bD as MindooDBAppEmbeddingApi, bE as MindooDBAppEmbeddingLookupOptions, bF as MindooDBAppEmbeddingLookupResult, bG as MindooDBAppEmbedsApi, bH as MindooDBAppEntryAttachmentRef, bI as MindooDBAppEntryProvenance, bJ as MindooDBAppExtractDocumentTextInput, bK as MindooDBAppExtractDocumentTextResult, bL as MindooDBAppExtractTextFormat, bM as MindooDBAppExtractionSetup, bN as MindooDBAppFulltextSetup, bO as MindooDBAppHistoricalDocument, bP as MindooDBAppHistoryQuery, bQ as MindooDBAppHostTheme, bR as MindooDBAppIdentityApi, bS as MindooDBAppInaccessibleDocument, bT as MindooDBAppInaccessibleDocumentListQuery, bU as MindooDBAppInaccessibleDocumentListResult, bV as MindooDBAppIncomingContent, bW as MindooDBAppIncomingContentHandler, bX as MindooDBAppIncomingContentInfo, bY as MindooDBAppIncomingItem, bZ as MindooDBAppIncomingItemInfo, b_ as MindooDBAppIncomingResult, b$ as MindooDBAppIncomingSource, c0 as MindooDBAppJsonCounterIncrementPatch, c1 as MindooDBAppJsonListDeletePatch, c2 as MindooDBAppJsonListInsertPatch, c3 as MindooDBAppJsonPatch, c4 as MindooDBAppJsonSetPatch, c5 as MindooDBAppJsonTextMarkPatch, c6 as MindooDBAppJsonTextSplicePatch, c7 as MindooDBAppJsonTextUnmarkPatch, c8 as MindooDBAppJsonUnsetPatch, c9 as MindooDBAppLaunchContext, ca as MindooDBAppListUsersOptions, cb as MindooDBAppListUsersPage, cc as MindooDBAppLiveQuerySubscription, cd as MindooDBAppLocalizedText, ce as MindooDBAppMenuAnchor, cf as MindooDBAppMenuApi, cg as MindooDBAppMenuCommandItem, ch as MindooDBAppMenuDismissReason, ci as MindooDBAppMenuDismissedResult, cj as MindooDBAppMenuItem, ck as MindooDBAppMenuKind, cl as MindooDBAppMenuPlacement, cm as MindooDBAppMenuPointAnchor, cn as MindooDBAppMenuRect, co as MindooDBAppMenuRectAnchor, cp as MindooDBAppMenuSelectionResult, cq as MindooDBAppMenuSeparatorItem, cr as MindooDBAppNotificationSeverity, cs as MindooDBAppNotifyInput, ct as MindooDBAppNotifyResult, cu as MindooDBAppProposeAppInput, cv as MindooDBAppProposeAppResult, cw as MindooDBAppQueryCoverage, cx as MindooDBAppQueryInclude, cy as MindooDBAppQueryIncludeCardinality, cz as MindooDBAppQueryIncludeSlots, cA as MindooDBAppQueryResult, cB as MindooDBAppQueryRow, cC as MindooDBAppQuerySortKey, cD as MindooDBAppQueryTextClause, cE as MindooDBAppReadableAttachmentStream, cF as MindooDBAppRecipientOptions, cG as MindooDBAppReminder, cH as MindooDBAppReminderOpened, cI as MindooDBAppReminderOpenedHandler, cJ as MindooDBAppReminderRequest, cK as MindooDBAppReminderScheduleResult, cL as MindooDBAppRemindersApi, cM as MindooDBAppResolvedViewDefinition, cN as MindooDBAppResolvedViewSource, cO as MindooDBAppRevisionPhase, cP as MindooDBAppRevisionVerification, cQ as MindooDBAppRichTextBlockSpan, cR as MindooDBAppRichTextGetOptions, cS as MindooDBAppRichTextImmutableString, cT as MindooDBAppRichTextMarkRange, cU as MindooDBAppRichTextMaterializeValue, cV as MindooDBAppRichTextPatch, cW as MindooDBAppRichTextScalar, cX as MindooDBAppRichTextSpliceStep, cY as MindooDBAppRichTextStep, cZ as MindooDBAppRichTextStepPatch, c_ as MindooDBAppRichTextTextSpan, c$ as MindooDBAppRuntime, d0 as MindooDBAppScanAttachmentOptions, d1 as MindooDBAppScanAttachmentResult, d2 as MindooDBAppScopedDocId, d3 as MindooDBAppScopedDocumentSummary, d4 as MindooDBAppSealIntent, d5 as MindooDBAppSealedChannelOpenInput, d6 as MindooDBAppSealedChannelOpenResult, d7 as MindooDBAppSealedChannelRequestInput, d8 as MindooDBAppSession, d9 as MindooDBAppShowMenuInput, da as MindooDBAppShowMenuResult, db as MindooDBAppSignPreview, dc as MindooDBAppSignPreviewScope, dd as MindooDBAppSignStatementInput, de as MindooDBAppSignStatementResult, df as MindooDBAppStorageApi, dg as MindooDBAppSummarySetup, dh as MindooDBAppTextCursorOptions, di as MindooDBAppTextCursorPosition, dj as MindooDBAppTextCursorPositionsResult, dk as MindooDBAppTextCursorsResult, dl as MindooDBAppTextEdit, dm as MindooDBAppTextPatch, dn as MindooDBAppThemeMode, dp as MindooDBAppTimestampApi, dq as MindooDBAppTimestampInput, dr as MindooDBAppTimestampProvider, ds as MindooDBAppTimestampResult, dt as MindooDBAppUiPreferences, du as MindooDBAppUpdateDocumentInput, dv as MindooDBAppViewCursorDocumentListResult, dw as MindooDBAppViewCursorResult, dx as MindooDBAppViewEntry, dy as MindooDBAppViewEntryKind, dz as MindooDBAppViewNavigator, dA as MindooDBAppViewNavigatorExpansionState, dB as MindooDBAppViewNavigatorOpenOptions, dC as MindooDBAppViewNavigatorPageOptions, dD as MindooDBAppViewNavigatorPageResult, dE as MindooDBAppViewNavigatorRangeQuery, dF as MindooDBAppViewNavigatorSelectionState, dG as MindooDBAppViewUpdateStats, dH as MindooDBAppViewport, dI as MindooDBAppWellKnownDragType, dJ as MindooDBAppWritableAttachmentStream, dK as mindooDBAppAcceptMatchesType, dL as mindooDBAppComponentFieldsMatch, dM as resolveMindooDBAppDefinitionUrl, dN as resolveMindooDBAppListingAssetUrl, dO as resolveMindooDBAppLocalizedText, dP as validateMindooDBAppAccepts, dQ as validateMindooDBAppComponents, dR as validateMindooDBAppDefinition } from './types-BYsO5n5-.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-44S2R2PT.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 {
|
|
1
|
+
import { aD as MindooDBAppComponentInfo, bC as MindooDBAppEmbedRect, bv as MindooDBAppEmbedAgentTools, bE as MindooDBAppEmbeddingLookupOptions, bF as MindooDBAppEmbeddingLookupResult, bt as MindooDBAppEmbedAccessPair, J as MindooDBAppAgentToolDescriptor, f as MindooDBAppAgentToolErrorCode, X as MindooDBAppBridgeAgentResultMessage, W as MindooDBAppBridgeAgentInvokeMessage, a_ as MindooDBAppCreateViewNavigatorInput, dz as MindooDBAppViewNavigator, ag as MindooDBAppBridgeRpcRequest, bQ as MindooDBAppHostTheme, ay as MindooDBAppCapability, du as MindooDBAppUpdateDocumentInput, m as MindooDBAppDocument, k as MindooDBAppDefinition, L as MindooDBAppAttachmentApi, e as MindooDBAppBridge, d8 as MindooDBAppSession, cu as MindooDBAppProposeAppInput, dH as MindooDBAppViewport, dt as MindooDBAppUiPreferences, cA as MindooDBAppQueryResult, dG as MindooDBAppViewUpdateStats, ab as MindooDBAppBridgePortMessage, a$ as MindooDBAppDatabaseInfo, bs as MindooDBAppEmbedAccessInput, bx as MindooDBAppEmbedCloseReason, a6 as MindooDBAppBridgeErrorPayload, c9 as MindooDBAppLaunchContext, b8 as MindooDBAppDocumentApi, dB as MindooDBAppViewNavigatorOpenOptions, bR as MindooDBAppIdentityApi, dp as MindooDBAppTimestampApi, b6 as MindooDBAppDirectoryApi, bN as MindooDBAppFulltextSetup, bM as MindooDBAppExtractionSetup, dg as MindooDBAppSummarySetup, cv as MindooDBAppProposeAppResult, b$ as MindooDBAppIncomingSource, c as MindooDBAppDragStartResult, bp as MindooDBAppDragProfile, b_ as MindooDBAppIncomingResult, cG as MindooDBAppReminder } from '../types-BYsO5n5-.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
|
|
@@ -621,8 +631,17 @@ interface MockMindooDBAppSessionController {
|
|
|
621
631
|
* and resolves with the handler's result.
|
|
622
632
|
*/
|
|
623
633
|
emitIncomingContent(input: MockIncomingContentInput): Promise<MindooDBAppIncomingResult>;
|
|
634
|
+
/** Reminders the app scheduled (`session.reminders.schedule`) that were not tapped or cancelled. */
|
|
635
|
+
listReminders(): MindooDBAppReminder[];
|
|
636
|
+
/**
|
|
637
|
+
* As if the user tapped this reminder (`"open"`) or pressed "Done": delivered
|
|
638
|
+
* to `session.reminders.onOpened` (held until registered).
|
|
639
|
+
*/
|
|
640
|
+
emitReminderOpened(id: string, action?: "open" | "done"): Promise<void>;
|
|
624
641
|
/** Embeds the app has open (`session.embeds.open`). */
|
|
625
642
|
listEmbeds(): MockEmbedState[];
|
|
643
|
+
/** Every `session.embeds.requestAccess` input so far, oldest first. */
|
|
644
|
+
getEmbedAccessRequests(): MindooDBAppEmbedAccessInput[];
|
|
626
645
|
/** Closes an embed as Haven does when the component finishes or the user closes it. */
|
|
627
646
|
closeEmbed(embedId: string, reason?: MindooDBAppEmbedCloseReason, result?: unknown): void;
|
|
628
647
|
/** Replaces what `session.components.list` offers. */
|
|
@@ -752,6 +771,8 @@ interface FakeBridgeHostController {
|
|
|
752
771
|
applyRemoteUpdate(databaseId: string, docId: string, input: MindooDBAppUpdateDocumentInput, options?: MockRemoteUpdateOptions): Promise<MindooDBAppDocument>;
|
|
753
772
|
/** Embeds the app has open (`session.embeds.open`). */
|
|
754
773
|
listEmbeds(): MockEmbedState[];
|
|
774
|
+
/** Every `session.embeds.requestAccess` input so far, oldest first. */
|
|
775
|
+
getEmbedAccessRequests(): MindooDBAppEmbedAccessInput[];
|
|
755
776
|
/** Closes an embed and pushes the `embed-event` to the app. */
|
|
756
777
|
closeEmbed(embedId: string, reason?: MindooDBAppEmbedCloseReason, result?: unknown): void;
|
|
757
778
|
/** 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-44S2R2PT.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,15 +5178,22 @@ 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;
|
|
5194
|
+
const mockReminders = /* @__PURE__ */ new Map();
|
|
5195
|
+
let reminderHandler = null;
|
|
5196
|
+
const pendingReminderTaps = [];
|
|
5124
5197
|
const pendingIncoming = [];
|
|
5125
5198
|
let incomingCounter = 0;
|
|
5126
5199
|
const hostFocusListeners = /* @__PURE__ */ new Set();
|
|
@@ -5484,6 +5557,38 @@ function createMockSessionState(options = {}) {
|
|
|
5484
5557
|
}
|
|
5485
5558
|
};
|
|
5486
5559
|
},
|
|
5560
|
+
reminders: {
|
|
5561
|
+
async schedule(request) {
|
|
5562
|
+
const at = request.at instanceof Date ? request.at.getTime() : request.at;
|
|
5563
|
+
if (!request.id || !request.title || !Number.isFinite(at) || at <= Date.now()) {
|
|
5564
|
+
return { status: "invalid", reason: "id, title and a future time are required" };
|
|
5565
|
+
}
|
|
5566
|
+
const reminder = {
|
|
5567
|
+
id: request.id,
|
|
5568
|
+
title: request.title,
|
|
5569
|
+
at,
|
|
5570
|
+
...request.body ? { body: request.body } : {},
|
|
5571
|
+
...request.target ? { target: request.target } : {}
|
|
5572
|
+
};
|
|
5573
|
+
mockReminders.set(request.id, reminder);
|
|
5574
|
+
return { status: "scheduled", reminder: { ...reminder } };
|
|
5575
|
+
},
|
|
5576
|
+
async cancel(id) {
|
|
5577
|
+
mockReminders.delete(id);
|
|
5578
|
+
},
|
|
5579
|
+
async list() {
|
|
5580
|
+
return [...mockReminders.values()].sort((a, b) => a.at - b.at).map((reminder) => ({ ...reminder }));
|
|
5581
|
+
},
|
|
5582
|
+
onOpened(handler) {
|
|
5583
|
+
reminderHandler = handler;
|
|
5584
|
+
pendingReminderTaps.splice(0).forEach((opened) => void handler(opened));
|
|
5585
|
+
return () => {
|
|
5586
|
+
if (reminderHandler === handler) {
|
|
5587
|
+
reminderHandler = null;
|
|
5588
|
+
}
|
|
5589
|
+
};
|
|
5590
|
+
}
|
|
5591
|
+
},
|
|
5487
5592
|
onBeforeClose(listener) {
|
|
5488
5593
|
beforeCloseListeners.add(listener);
|
|
5489
5594
|
return () => {
|
|
@@ -5580,6 +5685,23 @@ function createMockSessionState(options = {}) {
|
|
|
5580
5685
|
deliver();
|
|
5581
5686
|
});
|
|
5582
5687
|
},
|
|
5688
|
+
listReminders() {
|
|
5689
|
+
return [...mockReminders.values()].map((reminder) => ({ ...reminder }));
|
|
5690
|
+
},
|
|
5691
|
+
async emitReminderOpened(id, action = "open") {
|
|
5692
|
+
const reminder = mockReminders.get(id);
|
|
5693
|
+
const opened = {
|
|
5694
|
+
id,
|
|
5695
|
+
action,
|
|
5696
|
+
...reminder?.target ? { target: reminder.target } : {}
|
|
5697
|
+
};
|
|
5698
|
+
mockReminders.delete(id);
|
|
5699
|
+
if (reminderHandler) {
|
|
5700
|
+
await reminderHandler(opened);
|
|
5701
|
+
} else {
|
|
5702
|
+
pendingReminderTaps.push(opened);
|
|
5703
|
+
}
|
|
5704
|
+
},
|
|
5583
5705
|
emitThemeChange(theme) {
|
|
5584
5706
|
launchContext = mergeLaunchContext(launchContext, { theme });
|
|
5585
5707
|
themeListeners.forEach(
|
|
@@ -5768,7 +5890,10 @@ function createMockMindooDBAppSession(options = {}) {
|
|
|
5768
5890
|
resolveDrag: state.resolveDrag,
|
|
5769
5891
|
getDragProfile: state.getDragProfile,
|
|
5770
5892
|
emitIncomingContent: state.emitIncomingContent,
|
|
5893
|
+
listReminders: state.listReminders,
|
|
5894
|
+
emitReminderOpened: state.emitReminderOpened,
|
|
5771
5895
|
listEmbeds: () => state.embedHost.listEmbeds(),
|
|
5896
|
+
getEmbedAccessRequests: () => state.embedHost.getAccessRequests(),
|
|
5772
5897
|
closeEmbed: (embedId, reason, result) => state.embedHost.closeEmbed(embedId, reason, result),
|
|
5773
5898
|
setComponents: (components) => state.embedHost.setComponents(components),
|
|
5774
5899
|
getEmbeddingFinish: () => state.embedHost.getEmbeddingFinish(),
|
|
@@ -6062,6 +6187,10 @@ function createFakeBridgeHost(options = {}) {
|
|
|
6062
6187
|
const embedId = await state.embedHost.openEmbed(input);
|
|
6063
6188
|
return input.placement === "frame" && options.embedFrameUrl ? { embedId, frame: { url: options.embedFrameUrl } } : { embedId };
|
|
6064
6189
|
}
|
|
6190
|
+
case "embeds.requestAccess":
|
|
6191
|
+
return await state.embedHost.embeds.requestAccess(
|
|
6192
|
+
params.input ?? { components: [] }
|
|
6193
|
+
);
|
|
6065
6194
|
case "embeds.setRect":
|
|
6066
6195
|
state.embedHost.setRect(String(params.embedId), params.rect);
|
|
6067
6196
|
return { ok: true };
|
|
@@ -6719,6 +6848,7 @@ function createFakeBridgeHost(options = {}) {
|
|
|
6719
6848
|
getDirectoryUsers: state.getDirectoryUsers,
|
|
6720
6849
|
applyRemoteUpdate: state.applyRemoteUpdate,
|
|
6721
6850
|
listEmbeds: () => state.embedHost.listEmbeds(),
|
|
6851
|
+
getEmbedAccessRequests: () => state.embedHost.getAccessRequests(),
|
|
6722
6852
|
closeEmbed: (embedId, reason, result) => state.embedHost.closeEmbed(embedId, reason, result),
|
|
6723
6853
|
getEmbeddingFinish: () => state.embedHost.getEmbeddingFinish(),
|
|
6724
6854
|
setEmbedDirty: (embedId, dirty) => state.embedHost.setEmbedDirty(embedId, dirty),
|
|
@@ -1638,6 +1638,87 @@ interface MindooDBAppBridgeIncomingContentMessage {
|
|
|
1638
1638
|
kind: "incoming-content";
|
|
1639
1639
|
content: MindooDBAppIncomingContentInfo;
|
|
1640
1640
|
}
|
|
1641
|
+
/**
|
|
1642
|
+
* A reminder an app asks Haven to show as a notification at `at` (native
|
|
1643
|
+
* app only). Haven decides: the user allows reminders per app once, sees
|
|
1644
|
+
* them in Haven's settings and can remove them there.
|
|
1645
|
+
*/
|
|
1646
|
+
interface MindooDBAppReminderRequest {
|
|
1647
|
+
/** The app's own id for the reminder; scheduling the same id again replaces it. Max. 100 characters. */
|
|
1648
|
+
id: string;
|
|
1649
|
+
/** Short title, max. 120 characters. Shown with the app's name; lock screens hide it. */
|
|
1650
|
+
title: string;
|
|
1651
|
+
/** Optional detail, max. 300 characters. */
|
|
1652
|
+
body?: string;
|
|
1653
|
+
/** When to show it: epoch milliseconds or a Date, in the future, at most one year ahead. */
|
|
1654
|
+
at: number | Date;
|
|
1655
|
+
/**
|
|
1656
|
+
* Handed back in {@link MindooDBAppReminderOpened.target} when the user taps
|
|
1657
|
+
* the reminder, e.g. a document id. Max. 500 characters. Do not put secrets
|
|
1658
|
+
* here: Haven keeps it outside the encrypted databases.
|
|
1659
|
+
*/
|
|
1660
|
+
target?: string;
|
|
1661
|
+
}
|
|
1662
|
+
/** A reminder as Haven holds it for this app. */
|
|
1663
|
+
interface MindooDBAppReminder {
|
|
1664
|
+
id: string;
|
|
1665
|
+
title: string;
|
|
1666
|
+
body?: string;
|
|
1667
|
+
/** Epoch milliseconds. */
|
|
1668
|
+
at: number;
|
|
1669
|
+
target?: string;
|
|
1670
|
+
}
|
|
1671
|
+
/**
|
|
1672
|
+
* What became of a request. `denied`: the user (or the system permission)
|
|
1673
|
+
* does not allow reminders for this app; `unsupported`: the host has no
|
|
1674
|
+
* notifications (browser, older app version); `invalid`: the request broke a
|
|
1675
|
+
* limit (`reason` says which).
|
|
1676
|
+
*/
|
|
1677
|
+
type MindooDBAppReminderScheduleResult = {
|
|
1678
|
+
status: "scheduled";
|
|
1679
|
+
reminder: MindooDBAppReminder;
|
|
1680
|
+
} | {
|
|
1681
|
+
status: "denied" | "unsupported" | "invalid";
|
|
1682
|
+
reason?: string;
|
|
1683
|
+
};
|
|
1684
|
+
/** The user tapped one of this app's reminders, or one of its actions. */
|
|
1685
|
+
interface MindooDBAppReminderOpened {
|
|
1686
|
+
id: string;
|
|
1687
|
+
target?: string;
|
|
1688
|
+
/**
|
|
1689
|
+
* `"open"`: the notification itself was tapped (Haven started or focused the
|
|
1690
|
+
* app for it). `"done"`: the user pressed "Done" in the notification; the
|
|
1691
|
+
* app hears about it the next time it runs and should mark the item done
|
|
1692
|
+
* itself, Haven writes nothing on its behalf. ("In 1 hour" is handled by
|
|
1693
|
+
* Haven alone: the reminder simply comes back an hour later.)
|
|
1694
|
+
*/
|
|
1695
|
+
action: "open" | "done";
|
|
1696
|
+
}
|
|
1697
|
+
type MindooDBAppReminderOpenedHandler = (opened: MindooDBAppReminderOpened) => void | Promise<void>;
|
|
1698
|
+
/** `session.reminders`: notifications at a time the app chooses (Haven's native app). */
|
|
1699
|
+
interface MindooDBAppRemindersApi {
|
|
1700
|
+
/**
|
|
1701
|
+
* Asks Haven to show a reminder. The first request of an app asks the user
|
|
1702
|
+
* whether the app may send reminders at all.
|
|
1703
|
+
*/
|
|
1704
|
+
schedule(request: MindooDBAppReminderRequest): Promise<MindooDBAppReminderScheduleResult>;
|
|
1705
|
+
/** Removes a reminder of this app; unknown ids are ignored. */
|
|
1706
|
+
cancel(id: string): Promise<void>;
|
|
1707
|
+
/** This app's reminders that have not fired yet, earliest first. */
|
|
1708
|
+
list(): Promise<MindooDBAppReminder[]>;
|
|
1709
|
+
/**
|
|
1710
|
+
* Called when the user taps one of this app's reminders. Haven starts or
|
|
1711
|
+
* focuses the app and delivers taps once a handler is registered, also
|
|
1712
|
+
* those from before the app was running. Returns an unsubscribe function.
|
|
1713
|
+
*/
|
|
1714
|
+
onOpened(handler: MindooDBAppReminderOpenedHandler): () => void;
|
|
1715
|
+
}
|
|
1716
|
+
/** Push message: a reminder of this app was tapped. */
|
|
1717
|
+
interface MindooDBAppBridgeReminderOpenedMessage {
|
|
1718
|
+
protocol: "mindoodb-app-bridge";
|
|
1719
|
+
kind: "reminder-opened";
|
|
1720
|
+
reminder: MindooDBAppReminderOpened;
|
|
1721
|
+
}
|
|
1641
1722
|
/** A component another app offers, as `session.components.list` returns it. */
|
|
1642
1723
|
interface MindooDBAppComponentInfo {
|
|
1643
1724
|
/** Opaque key for `session.embeds.open`. */
|
|
@@ -1702,6 +1783,36 @@ interface MindooDBAppEmbedOpenInput {
|
|
|
1702
1783
|
/** Default true. */
|
|
1703
1784
|
visible?: boolean;
|
|
1704
1785
|
}
|
|
1786
|
+
/** One component a host app wants to show, for `session.embeds.requestAccess`. */
|
|
1787
|
+
interface MindooDBAppEmbedAccessComponent {
|
|
1788
|
+
componentKey: string;
|
|
1789
|
+
/**
|
|
1790
|
+
* Host databases it will show documents of. Default: every database of this app
|
|
1791
|
+
* that it may update (`edit`) or read (`view`).
|
|
1792
|
+
*/
|
|
1793
|
+
databaseIds?: string[];
|
|
1794
|
+
/** Default `edit`. */
|
|
1795
|
+
intent?: "edit" | "view";
|
|
1796
|
+
}
|
|
1797
|
+
/** Input of `session.embeds.requestAccess`. */
|
|
1798
|
+
interface MindooDBAppEmbedAccessInput {
|
|
1799
|
+
components: MindooDBAppEmbedAccessComponent[];
|
|
1800
|
+
}
|
|
1801
|
+
/** A component in one host database. */
|
|
1802
|
+
interface MindooDBAppEmbedAccessPair {
|
|
1803
|
+
componentKey: string;
|
|
1804
|
+
databaseId: string;
|
|
1805
|
+
}
|
|
1806
|
+
/** What `session.embeds.requestAccess` settled on. */
|
|
1807
|
+
interface MindooDBAppEmbedAccessResult {
|
|
1808
|
+
/** Allowed, now or before: `embeds.open` shows these without asking. */
|
|
1809
|
+
granted: MindooDBAppEmbedAccessPair[];
|
|
1810
|
+
/**
|
|
1811
|
+
* Not allowed (the user unticked them or chose "Not now"): Haven asks again when
|
|
1812
|
+
* `embeds.open` shows one of them, and `requestAccess` does not ask for them again.
|
|
1813
|
+
*/
|
|
1814
|
+
pending: MindooDBAppEmbedAccessPair[];
|
|
1815
|
+
}
|
|
1705
1816
|
/** Why an embedded component went away. */
|
|
1706
1817
|
type MindooDBAppEmbedCloseReason = "completed" | "cancelled" | "closed" | "error";
|
|
1707
1818
|
/** Delivered once when an embedded component closes. */
|
|
@@ -1814,6 +1925,19 @@ interface MindooDBAppEmbedsApi {
|
|
|
1814
1925
|
* update. The first time, Haven asks the user to allow the pairing.
|
|
1815
1926
|
*/
|
|
1816
1927
|
open(input: MindooDBAppEmbedOpenInput): Promise<MindooDBAppEmbed>;
|
|
1928
|
+
/**
|
|
1929
|
+
* Asks the user once for all components this app is going to show, e.g. right
|
|
1930
|
+
* after `components.list`, instead of one prompt per component and database on
|
|
1931
|
+
* `open`. Haven shows a single list of what is not allowed yet (the user may
|
|
1932
|
+
* untick entries) and skips what the user allowed or put off before, so calling
|
|
1933
|
+
* this on every start is fine. Unknown components and databases this app may not
|
|
1934
|
+
* use are left out of the result.
|
|
1935
|
+
*
|
|
1936
|
+
* Havens that predate this answer with `method-not-found`; the SDK then resolves
|
|
1937
|
+
* with nothing granted and the pairs named in `databaseIds` pending, and `open`
|
|
1938
|
+
* asks as before.
|
|
1939
|
+
*/
|
|
1940
|
+
requestAccess(input: MindooDBAppEmbedAccessInput): Promise<MindooDBAppEmbedAccessResult>;
|
|
1817
1941
|
}
|
|
1818
1942
|
/** For an app running as an embedded component (check `launchContext.embed`). */
|
|
1819
1943
|
interface MindooDBAppEmbeddingApi {
|
|
@@ -1880,7 +2004,7 @@ interface MindooDBAppBridgeEmbedEventMessage {
|
|
|
1880
2004
|
type: "agentTools";
|
|
1881
2005
|
} & MindooDBAppEmbedAgentToolsEvent);
|
|
1882
2006
|
}
|
|
1883
|
-
type MindooDBAppBridgePortMessage = MindooDBAppBridgeRpcMessage | MindooDBAppBridgeStreamMessage | MindooDBAppBridgeThemeChangedMessage | MindooDBAppBridgeViewportChangedMessage | MindooDBAppBridgeUiPreferencesChangedMessage | MindooDBAppBridgeLocaleChangedMessage | MindooDBAppBridgeQueryResultMessage | MindooDBAppBridgeViewChangedMessage | MindooDBAppBridgeBeforeCloseMessage | MindooDBAppBridgeBeforeCloseAck | MindooDBAppBridgeShortcutsChangedMessage | MindooDBAppBridgeShortcutInvokedMessage | MindooDBAppBridgeWorkspaceFocusRequestedMessage | MindooDBAppBridgeHostFocusChangedMessage | MindooDBAppBridgeAgentInvokeMessage | MindooDBAppBridgeAgentResultMessage | MindooDBAppBridgeDragOverMessage | MindooDBAppBridgeDragLeaveMessage | MindooDBAppBridgeDragDropMessage | MindooDBAppBridgeIncomingContentMessage | MindooDBAppBridgeEmbedEventMessage | MindooDBAppBridgeEmbeddingRequestMessage;
|
|
2007
|
+
type MindooDBAppBridgePortMessage = MindooDBAppBridgeRpcMessage | MindooDBAppBridgeStreamMessage | MindooDBAppBridgeThemeChangedMessage | MindooDBAppBridgeViewportChangedMessage | MindooDBAppBridgeUiPreferencesChangedMessage | MindooDBAppBridgeLocaleChangedMessage | MindooDBAppBridgeQueryResultMessage | MindooDBAppBridgeViewChangedMessage | MindooDBAppBridgeBeforeCloseMessage | MindooDBAppBridgeBeforeCloseAck | MindooDBAppBridgeShortcutsChangedMessage | MindooDBAppBridgeShortcutInvokedMessage | MindooDBAppBridgeWorkspaceFocusRequestedMessage | MindooDBAppBridgeHostFocusChangedMessage | MindooDBAppBridgeAgentInvokeMessage | MindooDBAppBridgeAgentResultMessage | MindooDBAppBridgeDragOverMessage | MindooDBAppBridgeDragLeaveMessage | MindooDBAppBridgeDragDropMessage | MindooDBAppBridgeIncomingContentMessage | MindooDBAppBridgeReminderOpenedMessage | MindooDBAppBridgeEmbedEventMessage | MindooDBAppBridgeEmbeddingRequestMessage;
|
|
1884
2008
|
/** Placement hint for a host-rendered overlay menu. */
|
|
1885
2009
|
type MindooDBAppMenuPlacement = "auto" | "bottom-start" | "bottom-end" | "top-start" | "top-end" | "right-start" | "left-start";
|
|
1886
2010
|
/** Semantic hint allowing Haven to tune menu behavior or styling. */
|
|
@@ -3522,6 +3646,11 @@ interface MindooDBAppSession {
|
|
|
3522
3646
|
* Returns an unsubscribe function.
|
|
3523
3647
|
*/
|
|
3524
3648
|
onIncomingContent(handler: MindooDBAppIncomingContentHandler): () => void;
|
|
3649
|
+
/**
|
|
3650
|
+
* Reminders as local notifications (Haven's native app; `unsupported`
|
|
3651
|
+
* elsewhere). See {@link MindooDBAppRemindersApi}.
|
|
3652
|
+
*/
|
|
3653
|
+
reminders: MindooDBAppRemindersApi;
|
|
3525
3654
|
/**
|
|
3526
3655
|
* Run work before the host tears this launch down, e.g. flushing buffered writes.
|
|
3527
3656
|
*
|
|
@@ -3584,4 +3713,4 @@ interface MindooDBAppBridge {
|
|
|
3584
3713
|
connect(options?: MindooDBAppBridgeConnectOptions): Promise<MindooDBAppSession>;
|
|
3585
3714
|
}
|
|
3586
3715
|
|
|
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 };
|
|
3716
|
+
export { type MindooDBAppBridgeConnectOptions as $, MINDOODB_APP_LISTING_SUMMARY_MAX as A, MINDOODB_APP_SEAL_SIGNING_DOMAIN as B, MINDOODB_APP_WELL_KNOWN_DRAG_TYPES as C, type MindooDBAppAcceptSpec as D, type MindooDBAppAccessDecision as E, type MindooDBAppAccessTier as F, type MindooDBAppAgentApi as G, type MindooDBAppAgentRegistration as H, type MindooDBAppAgentToolAnnotations as I, type MindooDBAppAgentToolDescriptor as J, type MindooDBAppAgentToolScope as K, type MindooDBAppAttachmentApi as L, type MindooDBAppAttachmentPreviewMode as M, type MindooDBAppAttachmentChunk as N, type MindooDBAppAttachmentInfo as O, type MindooDBAppAttachmentPreviewOptions as P, type MindooDBAppAttachmentPreviewSession as Q, type MindooDBAppAutomergeChangesPatch as R, type MindooDBAppAutomergeChangesSince as S, type MindooDBAppAutomergeGetOptions as T, type MindooDBAppAutomergePatchResult as U, type MindooDBAppAutomergeSnapshot as V, type MindooDBAppBridgeAgentInvokeMessage as W, type MindooDBAppBridgeAgentResultMessage as X, type MindooDBAppBridgeBeforeCloseAck as Y, type MindooDBAppBridgeBeforeCloseMessage as Z, type MindooDBAppBridgeConnectMessage as _, type MindooDBAppDragBindSourceOptions as a, type MindooDBAppDatabaseInfo as a$, type MindooDBAppBridgeConnectedMessage as a0, type MindooDBAppBridgeDragDropMessage as a1, type MindooDBAppBridgeDragLeaveMessage as a2, type MindooDBAppBridgeDragOverMessage as a3, type MindooDBAppBridgeEmbedEventMessage as a4, type MindooDBAppBridgeEmbeddingRequestMessage as a5, type MindooDBAppBridgeErrorPayload as a6, type MindooDBAppBridgeHandshakeErrorMessage as a7, type MindooDBAppBridgeHostFocusChangedMessage as a8, type MindooDBAppBridgeIncomingContentMessage as a9, type MindooDBAppComponentChildren as aA, type MindooDBAppComponentContract as aB, type MindooDBAppComponentFieldValue as aC, type MindooDBAppComponentInfo as aD, type MindooDBAppComponentIntent as aE, type MindooDBAppComponentQuery as aF, type MindooDBAppComponentReference as aG, type MindooDBAppComponentSpec as aH, type MindooDBAppComponentsApi as aI, type MindooDBAppConfiguredViewCategorizationStyle as aJ, type MindooDBAppConfiguredViewColumn as aK, type MindooDBAppConfiguredViewColumnRole as aL, type MindooDBAppConfiguredViewExpressionMode as aM, type MindooDBAppConfiguredViewFieldExpression as aN, type MindooDBAppConfiguredViewFilterDefinition as aO, type MindooDBAppConfiguredViewFilterMode as aP, type MindooDBAppConfiguredViewFilterRule as aQ, type MindooDBAppConfiguredViewFormulaExpression as aR, type MindooDBAppConfiguredViewFormulaFilterDefinition as aS, type MindooDBAppConfiguredViewPreviewMode as aT, type MindooDBAppConfiguredViewRuleFilterDefinition as aU, type MindooDBAppConfiguredViewRuleMatchMode as aV, type MindooDBAppConfiguredViewRuleOperator as aW, type MindooDBAppConfiguredViewValueExpression as aX, type MindooDBAppCreateKeyInfo as aY, type MindooDBAppCreateViewInput as aZ, type MindooDBAppCreateViewNavigatorInput as a_, type MindooDBAppBridgeLocaleChangedMessage as aa, type MindooDBAppBridgePortMessage as ab, type MindooDBAppBridgeQueryResultMessage as ac, type MindooDBAppBridgeReminderOpenedMessage as ad, type MindooDBAppBridgeRpcError as ae, type MindooDBAppBridgeRpcMessage as af, type MindooDBAppBridgeRpcRequest as ag, type MindooDBAppBridgeRpcSuccess as ah, type MindooDBAppBridgeShortcutInvokedMessage as ai, type MindooDBAppBridgeShortcutsChangedMessage as aj, type MindooDBAppBridgeStreamAbortRequest as ak, type MindooDBAppBridgeStreamAck as al, type MindooDBAppBridgeStreamCloseRequest as am, type MindooDBAppBridgeStreamError as an, type MindooDBAppBridgeStreamMessage as ao, type MindooDBAppBridgeStreamOpenResult as ap, type MindooDBAppBridgeStreamReadRequest as aq, type MindooDBAppBridgeStreamWriteRequest as ar, type MindooDBAppBridgeThemeChangedMessage as as, type MindooDBAppBridgeUiPreferencesChangedMessage as at, type MindooDBAppBridgeViewChangedMessage as au, type MindooDBAppBridgeViewportChangedMessage as av, type MindooDBAppBridgeWorkspaceFocusRequestedMessage as aw, type MindooDBAppBrowserFeatures as ax, type MindooDBAppCapability as ay, type MindooDBAppComponentCategory as az, type MindooDBAppDragStartInput as b, type MindooDBAppIncomingSource as b$, type MindooDBAppDefinitionDatabase as b0, type MindooDBAppDefinitionListing as b1, type MindooDBAppDefinitionPermission as b2, type MindooDBAppDefinitionRegistrationPermission as b3, type MindooDBAppDefinitionScreenshot as b4, type MindooDBAppDefinitionValidation as b5, type MindooDBAppDirectoryApi as b6, type MindooDBAppDirectoryEntry as b7, type MindooDBAppDocumentApi as b8, type MindooDBAppDocumentHeadCursorResult as b9, type MindooDBAppEmbedDirtyEvent as bA, type MindooDBAppEmbedOpenInput as bB, type MindooDBAppEmbedRect as bC, type MindooDBAppEmbeddingApi as bD, type MindooDBAppEmbeddingLookupOptions as bE, type MindooDBAppEmbeddingLookupResult as bF, type MindooDBAppEmbedsApi as bG, type MindooDBAppEntryAttachmentRef as bH, type MindooDBAppEntryProvenance as bI, type MindooDBAppExtractDocumentTextInput as bJ, type MindooDBAppExtractDocumentTextResult as bK, type MindooDBAppExtractTextFormat as bL, type MindooDBAppExtractionSetup as bM, type MindooDBAppFulltextSetup as bN, type MindooDBAppHistoricalDocument as bO, type MindooDBAppHistoryQuery as bP, type MindooDBAppHostTheme as bQ, type MindooDBAppIdentityApi as bR, type MindooDBAppInaccessibleDocument as bS, type MindooDBAppInaccessibleDocumentListQuery as bT, type MindooDBAppInaccessibleDocumentListResult as bU, type MindooDBAppIncomingContent as bV, type MindooDBAppIncomingContentHandler as bW, type MindooDBAppIncomingContentInfo as bX, type MindooDBAppIncomingItem as bY, type MindooDBAppIncomingItemInfo as bZ, type MindooDBAppIncomingResult as b_, type MindooDBAppDocumentHistoryEntry as ba, type MindooDBAppDocumentListQuery as bb, type MindooDBAppDocumentListResult as bc, type MindooDBAppDocumentQuery as bd, type MindooDBAppDocumentRevisionId as be, type MindooDBAppDocumentScanPreset as bf, type MindooDBAppDocumentSummary as bg, type MindooDBAppDragApi as bh, type MindooDBAppDragCancelReason as bi, type MindooDBAppDragDropEvent as bj, type MindooDBAppDragEffect as bk, type MindooDBAppDragHoverResult as bl, type MindooDBAppDragOffer as bm, type MindooDBAppDragOverEvent as bn, type MindooDBAppDragPointer as bo, type MindooDBAppDragProfile as bp, type MindooDBAppEmbed as bq, type MindooDBAppEmbedAccessComponent as br, type MindooDBAppEmbedAccessInput as bs, type MindooDBAppEmbedAccessPair as bt, type MindooDBAppEmbedAccessResult as bu, type MindooDBAppEmbedAgentTools as bv, type MindooDBAppEmbedAgentToolsEvent as bw, type MindooDBAppEmbedCloseReason as bx, type MindooDBAppEmbedClosedEvent as by, type MindooDBAppEmbedContext as bz, type MindooDBAppDragStartResult as c, type MindooDBAppRuntime as c$, type MindooDBAppJsonCounterIncrementPatch as c0, type MindooDBAppJsonListDeletePatch as c1, type MindooDBAppJsonListInsertPatch as c2, type MindooDBAppJsonPatch as c3, type MindooDBAppJsonSetPatch as c4, type MindooDBAppJsonTextMarkPatch as c5, type MindooDBAppJsonTextSplicePatch as c6, type MindooDBAppJsonTextUnmarkPatch as c7, type MindooDBAppJsonUnsetPatch as c8, type MindooDBAppLaunchContext as c9, type MindooDBAppQueryResult as cA, type MindooDBAppQueryRow as cB, type MindooDBAppQuerySortKey as cC, type MindooDBAppQueryTextClause as cD, type MindooDBAppReadableAttachmentStream as cE, type MindooDBAppRecipientOptions as cF, type MindooDBAppReminder as cG, type MindooDBAppReminderOpened as cH, type MindooDBAppReminderOpenedHandler as cI, type MindooDBAppReminderRequest as cJ, type MindooDBAppReminderScheduleResult as cK, type MindooDBAppRemindersApi as cL, type MindooDBAppResolvedViewDefinition as cM, type MindooDBAppResolvedViewSource as cN, type MindooDBAppRevisionPhase as cO, type MindooDBAppRevisionVerification as cP, type MindooDBAppRichTextBlockSpan as cQ, type MindooDBAppRichTextGetOptions as cR, type MindooDBAppRichTextImmutableString as cS, type MindooDBAppRichTextMarkRange as cT, type MindooDBAppRichTextMaterializeValue as cU, type MindooDBAppRichTextPatch as cV, type MindooDBAppRichTextScalar as cW, type MindooDBAppRichTextSpliceStep as cX, type MindooDBAppRichTextStep as cY, type MindooDBAppRichTextStepPatch as cZ, type MindooDBAppRichTextTextSpan as c_, type MindooDBAppListUsersOptions as ca, type MindooDBAppListUsersPage as cb, type MindooDBAppLiveQuerySubscription as cc, type MindooDBAppLocalizedText as cd, type MindooDBAppMenuAnchor as ce, type MindooDBAppMenuApi as cf, type MindooDBAppMenuCommandItem as cg, type MindooDBAppMenuDismissReason as ch, type MindooDBAppMenuDismissedResult as ci, type MindooDBAppMenuItem as cj, type MindooDBAppMenuKind as ck, type MindooDBAppMenuPlacement as cl, type MindooDBAppMenuPointAnchor as cm, type MindooDBAppMenuRect as cn, type MindooDBAppMenuRectAnchor as co, type MindooDBAppMenuSelectionResult as cp, type MindooDBAppMenuSeparatorItem as cq, type MindooDBAppNotificationSeverity as cr, type MindooDBAppNotifyInput as cs, type MindooDBAppNotifyResult as ct, type MindooDBAppProposeAppInput as cu, type MindooDBAppProposeAppResult as cv, type MindooDBAppQueryCoverage as cw, type MindooDBAppQueryInclude as cx, type MindooDBAppQueryIncludeCardinality as cy, type MindooDBAppQueryIncludeSlots as cz, type MindooDBAppDragPreview as d, type MindooDBAppScanAttachmentOptions as d0, type MindooDBAppScanAttachmentResult as d1, type MindooDBAppScopedDocId as d2, type MindooDBAppScopedDocumentSummary as d3, type MindooDBAppSealIntent as d4, type MindooDBAppSealedChannelOpenInput as d5, type MindooDBAppSealedChannelOpenResult as d6, type MindooDBAppSealedChannelRequestInput as d7, type MindooDBAppSession as d8, type MindooDBAppShowMenuInput as d9, type MindooDBAppViewNavigatorExpansionState as dA, type MindooDBAppViewNavigatorOpenOptions as dB, type MindooDBAppViewNavigatorPageOptions as dC, type MindooDBAppViewNavigatorPageResult as dD, type MindooDBAppViewNavigatorRangeQuery as dE, type MindooDBAppViewNavigatorSelectionState as dF, type MindooDBAppViewUpdateStats as dG, type MindooDBAppViewport as dH, type MindooDBAppWellKnownDragType as dI, type MindooDBAppWritableAttachmentStream as dJ, mindooDBAppAcceptMatchesType as dK, mindooDBAppComponentFieldsMatch as dL, resolveMindooDBAppDefinitionUrl as dM, resolveMindooDBAppListingAssetUrl as dN, resolveMindooDBAppLocalizedText as dO, validateMindooDBAppAccepts as dP, validateMindooDBAppComponents as dQ, validateMindooDBAppDefinition as dR, type MindooDBAppShowMenuResult as da, type MindooDBAppSignPreview as db, type MindooDBAppSignPreviewScope as dc, type MindooDBAppSignStatementInput as dd, type MindooDBAppSignStatementResult as de, type MindooDBAppStorageApi as df, type MindooDBAppSummarySetup as dg, type MindooDBAppTextCursorOptions as dh, type MindooDBAppTextCursorPosition as di, type MindooDBAppTextCursorPositionsResult as dj, type MindooDBAppTextCursorsResult as dk, type MindooDBAppTextEdit as dl, type MindooDBAppTextPatch as dm, type MindooDBAppThemeMode as dn, type MindooDBAppTimestampApi as dp, type MindooDBAppTimestampInput as dq, type MindooDBAppTimestampProvider as dr, type MindooDBAppTimestampResult as ds, type MindooDBAppUiPreferences as dt, type MindooDBAppUpdateDocumentInput as du, type MindooDBAppViewCursorDocumentListResult as dv, type MindooDBAppViewCursorResult as dw, type MindooDBAppViewEntry as dx, type MindooDBAppViewEntryKind as dy, type MindooDBAppViewNavigator 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.68",
|
|
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",
|