@agentshouse/app-bridge 0.1.0-c895bda3a3f6a → 0.1.0-c8a7dd564e490
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 +6 -6
- package/dist/index.d.ts +91 -59
- package/dist/mdmodel/definition.d.ts +1 -1
- package/dist/mdmodel/document.d.ts +1 -2
- package/dist/mdmodel/event.d.ts +77 -0
- package/dist/mdmodel/facts.d.ts +14 -0
- package/dist/mdmodel/index.d.ts +19 -6
- package/dist/mdmodel/kinds.d.ts +18 -0
- package/dist/mdmodel/pattern.d.ts +9 -0
- package/dist/mdmodel/query/language.d.ts +253 -0
- package/dist/mdmodel/query/match.d.ts +13 -0
- package/dist/mdmodel/query/rows.d.ts +31 -0
- package/dist/mdmodel/query/sql.d.ts +38 -0
- package/dist/mdmodel/reserved.d.ts +4 -0
- package/dist/mdmodel/types.d.ts +7 -5
- package/dist/mdmodel/validate.d.ts +7 -5
- package/dist/mdruntime/adapter.d.ts +37 -25
- package/dist/mdruntime/chain.d.ts +2 -1
- package/dist/mdruntime/change.d.ts +1 -0
- package/dist/mdruntime/client.d.ts +7 -3
- package/dist/mdruntime/collection.d.ts +2 -1
- package/dist/mdruntime/compile.d.ts +2 -7
- package/dist/mdruntime/connection.d.ts +7 -6
- package/dist/mdruntime/conversation-row.d.ts +32 -0
- package/dist/mdruntime/conversation.d.ts +18 -9
- package/dist/mdruntime/durability.d.ts +6 -0
- package/dist/mdruntime/identity.d.ts +0 -1
- package/dist/mdruntime/job.d.ts +32 -0
- package/dist/mdruntime/messages.d.ts +27 -3
- package/dist/mdruntime/model.d.ts +2 -9
- package/dist/mdruntime/observation.d.ts +2 -2
- package/dist/mdruntime/overlay.d.ts +1 -0
- package/dist/mdruntime/query.d.ts +13 -210
- package/dist/mdruntime/reach.d.ts +11 -11
- package/dist/mdruntime/readiness.d.ts +0 -2
- package/dist/mdruntime/replica.d.ts +8 -5
- package/dist/mdruntime/room-draft.d.ts +3 -2
- package/dist/mdruntime/search.d.ts +12 -63
- package/dist/mdruntime/source.d.ts +60 -0
- package/dist/mdruntime/status.d.ts +0 -2
- package/dist/mdruntime/store.d.ts +88 -41
- package/dist/mdruntime/stored.d.ts +58 -65
- package/dist/mdruntime/tables.d.ts +88 -51
- package/dist/mdruntime/wire.d.ts +8 -0
- package/dist/test-host.js +1 -1
- package/docs/families.md +17 -6
- package/package.json +1 -1
- package/dist/mdmodel/condition.d.ts +0 -180
- package/dist/mdruntime/fulltext.d.ts +0 -26
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { type QueryAnswer, type QueryRoom } from './compile.js';
|
|
2
2
|
import type { Composed } from './collection.js';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import type { UnsentWork } from './durability.js';
|
|
4
|
+
import type { JobMarker } from './job.js';
|
|
5
|
+
import { type ConversationWrite, type HeldConversation, type HeldRow, type MessageWindow } from './messages.js';
|
|
5
6
|
import type { Plan } from './query.js';
|
|
6
|
-
import type
|
|
7
|
-
|
|
8
|
-
export type { Committed, CountedRoom, HeldEntry, HeldText, OverlayEntry, ReplicaOpened, Referrer, RoomCommit, StoredEntry, TypedEntry, View, } from './stored.js';
|
|
7
|
+
import { type Committed, type Covering, type HeldEntry, type HeldLocators, type HeldRoomRow, type HeldRoomWork, type ReplicaOpened, type Referrer, type Resumed, type RoomCommit, type StoredEntry, type TypedEntry, type View } from './stored.js';
|
|
8
|
+
export type { Committed, Covering, HeldEntry, HeldLocators, HeldRoomRow, HeldRoomWork, OverlayEntry, ReplicaOpened, Referrer, Resumed, RoomCommit, StoredEntry, TypedEntry, View, } from './stored.js';
|
|
9
9
|
export type { QueryAnswer, QueryRoom } from './compile.js';
|
|
10
|
-
export type {
|
|
11
|
-
export type { ConversationWrite, HeldConversation, MessageWindow } from './messages.js';
|
|
10
|
+
export type { ConversationWrite, HeldConversation, HeldRow, MessageWindow } from './messages.js';
|
|
12
11
|
export type Value = string | number | bigint | Uint8Array | null;
|
|
13
12
|
export type Row = Readonly<Record<string, Value>>;
|
|
14
13
|
export interface Connection {
|
|
@@ -36,6 +35,10 @@ export interface SqliteStatement {
|
|
|
36
35
|
}
|
|
37
36
|
export interface SqliteDatabase {
|
|
38
37
|
readonly pointer: number;
|
|
38
|
+
createFunction(name: string, run: (context: number, ...values: Value[]) => Value, options: {
|
|
39
|
+
readonly arity: number;
|
|
40
|
+
readonly deterministic: true;
|
|
41
|
+
}): unknown;
|
|
39
42
|
exec(options: {
|
|
40
43
|
readonly sql: string;
|
|
41
44
|
readonly bind: readonly Value[];
|
|
@@ -63,6 +66,8 @@ export type KeptPending = {
|
|
|
63
66
|
readonly batch: string;
|
|
64
67
|
readonly state: string;
|
|
65
68
|
readonly files: readonly string[];
|
|
69
|
+
readonly paths: readonly string[];
|
|
70
|
+
readonly moving: boolean;
|
|
66
71
|
};
|
|
67
72
|
export type KeptRecord = {
|
|
68
73
|
readonly record: string;
|
|
@@ -90,6 +95,19 @@ export type HeldQueues = {
|
|
|
90
95
|
readonly state: string;
|
|
91
96
|
}[];
|
|
92
97
|
};
|
|
98
|
+
export type HeldStatus = {
|
|
99
|
+
readonly queued: readonly string[];
|
|
100
|
+
readonly lastCompleted: string | null;
|
|
101
|
+
readonly changes: readonly {
|
|
102
|
+
readonly locator: string;
|
|
103
|
+
readonly path: string;
|
|
104
|
+
}[];
|
|
105
|
+
readonly resets: readonly {
|
|
106
|
+
readonly locator: string;
|
|
107
|
+
readonly reset: string;
|
|
108
|
+
}[];
|
|
109
|
+
readonly returned: readonly string[];
|
|
110
|
+
};
|
|
93
111
|
export type OpenedFile = {
|
|
94
112
|
readonly key: string;
|
|
95
113
|
readonly byteLength: number;
|
|
@@ -107,14 +125,36 @@ export type AuthoredWrite = {
|
|
|
107
125
|
readonly writes: readonly AuthoredRows[];
|
|
108
126
|
readonly files: readonly StoredFile[];
|
|
109
127
|
readonly whole: boolean;
|
|
110
|
-
readonly discards?: readonly string[];
|
|
111
128
|
};
|
|
112
129
|
export interface RuntimeRequests {
|
|
113
|
-
readonly 'authored.
|
|
114
|
-
readonly 'authored.
|
|
130
|
+
readonly 'authored.status': Asked<Nothing, HeldStatus>;
|
|
131
|
+
readonly 'authored.moving': Asked<Nothing, HeldQueues>;
|
|
132
|
+
readonly 'authored.pending': Asked<{
|
|
133
|
+
readonly locator: string;
|
|
134
|
+
readonly id: string;
|
|
135
|
+
}, {
|
|
136
|
+
readonly state: string | null;
|
|
137
|
+
readonly room: boolean;
|
|
138
|
+
}>;
|
|
139
|
+
readonly 'authored.batch': Asked<{
|
|
140
|
+
readonly locator: string;
|
|
141
|
+
readonly id: string;
|
|
142
|
+
}, string | null>;
|
|
143
|
+
readonly 'authored.order': Asked<{
|
|
144
|
+
readonly locator: string;
|
|
145
|
+
}, readonly string[]>;
|
|
146
|
+
readonly 'authored.queued': Asked<Nothing, readonly string[]>;
|
|
147
|
+
readonly 'authored.roomDrafts': Asked<{
|
|
148
|
+
readonly locator: string | null;
|
|
149
|
+
readonly paths: readonly string[] | null;
|
|
150
|
+
}, readonly string[]>;
|
|
151
|
+
readonly 'authored.chatDraft.read': Asked<{
|
|
152
|
+
readonly conversation: string;
|
|
153
|
+
}, string | null>;
|
|
115
154
|
readonly 'authored.chatDrafts': Asked<Nothing, readonly string[]>;
|
|
116
155
|
readonly 'authored.calls': Asked<Nothing, readonly string[]>;
|
|
117
156
|
readonly 'authored.fences': Asked<Nothing, readonly string[]>;
|
|
157
|
+
readonly 'authored.unsent': Asked<Nothing, readonly UnsentWork[]>;
|
|
118
158
|
readonly 'authored.fact': Asked<{
|
|
119
159
|
readonly name: AuthoredFact;
|
|
120
160
|
}, string | null>;
|
|
@@ -156,6 +196,22 @@ export interface RuntimeRequests {
|
|
|
156
196
|
readonly holder: string | null;
|
|
157
197
|
}, boolean>;
|
|
158
198
|
readonly 'replica.open': Asked<Nothing, ReplicaOpened>;
|
|
199
|
+
readonly 'replica.rooms': Asked<{
|
|
200
|
+
readonly locators: readonly string[] | null;
|
|
201
|
+
}, readonly HeldRoomRow[]>;
|
|
202
|
+
readonly 'replica.room': Asked<{
|
|
203
|
+
readonly locator: string;
|
|
204
|
+
}, HeldRoomWork>;
|
|
205
|
+
readonly 'replica.covering': Asked<Nothing, Covering>;
|
|
206
|
+
readonly 'replica.offline': Asked<{
|
|
207
|
+
readonly locator: string;
|
|
208
|
+
}, string | null>;
|
|
209
|
+
readonly 'replica.held': Asked<Nothing, HeldLocators>;
|
|
210
|
+
readonly 'replica.demote': Asked<Nothing, null>;
|
|
211
|
+
readonly 'replica.facts': Asked<Nothing, Readonly<Record<string, string>>>;
|
|
212
|
+
readonly 'replica.presentation': Asked<{
|
|
213
|
+
readonly app: string;
|
|
214
|
+
}, string | null>;
|
|
159
215
|
readonly 'replica.query': Asked<{
|
|
160
216
|
readonly plan: Plan;
|
|
161
217
|
readonly rooms: readonly QueryRoom[];
|
|
@@ -175,17 +231,7 @@ export interface RuntimeRequests {
|
|
|
175
231
|
readonly key: number;
|
|
176
232
|
readonly view: View;
|
|
177
233
|
readonly targets: readonly string[];
|
|
178
|
-
readonly kinds: readonly string[];
|
|
179
234
|
}, readonly Referrer[]>;
|
|
180
|
-
readonly 'replica.files': Asked<{
|
|
181
|
-
readonly key: number;
|
|
182
|
-
readonly view: View;
|
|
183
|
-
readonly after: string | null;
|
|
184
|
-
readonly limit: number;
|
|
185
|
-
}, readonly {
|
|
186
|
-
readonly path: string;
|
|
187
|
-
readonly revision: string;
|
|
188
|
-
}[]>;
|
|
189
235
|
readonly 'replica.folders': Asked<{
|
|
190
236
|
readonly key: number;
|
|
191
237
|
readonly view: View;
|
|
@@ -197,10 +243,6 @@ export interface RuntimeRequests {
|
|
|
197
243
|
readonly roots: readonly string[];
|
|
198
244
|
readonly within: boolean;
|
|
199
245
|
}, boolean>;
|
|
200
|
-
readonly 'replica.counts': Asked<{
|
|
201
|
-
readonly rooms: readonly CountedRoom[];
|
|
202
|
-
}, readonly number[]>;
|
|
203
|
-
readonly 'replica.search': Asked<SearchAsk, SearchWindow>;
|
|
204
246
|
readonly 'replica.stage': Asked<{
|
|
205
247
|
readonly locator: string;
|
|
206
248
|
readonly transfer: string;
|
|
@@ -208,7 +250,15 @@ export interface RuntimeRequests {
|
|
|
208
250
|
readonly fingerprint: string;
|
|
209
251
|
readonly entries: readonly StoredEntry[];
|
|
210
252
|
readonly folders: readonly string[];
|
|
253
|
+
readonly part: string | null;
|
|
211
254
|
}, number | null>;
|
|
255
|
+
readonly 'replica.resume': Asked<{
|
|
256
|
+
readonly locator: string;
|
|
257
|
+
readonly transfer: string;
|
|
258
|
+
readonly fingerprint: string;
|
|
259
|
+
readonly parts: readonly string[];
|
|
260
|
+
readonly published: number | null;
|
|
261
|
+
}, Resumed | null>;
|
|
212
262
|
readonly 'replica.refresh': Asked<{
|
|
213
263
|
readonly key: number;
|
|
214
264
|
readonly composed: Composed;
|
|
@@ -236,6 +286,9 @@ export interface RuntimeRequests {
|
|
|
236
286
|
readonly 'replica.abandon': Asked<{
|
|
237
287
|
readonly locator: string;
|
|
238
288
|
}, null>;
|
|
289
|
+
readonly 'replica.unfence': Asked<{
|
|
290
|
+
readonly locators: readonly string[];
|
|
291
|
+
}, readonly string[]>;
|
|
239
292
|
readonly 'replica.release': Asked<{
|
|
240
293
|
readonly key: number;
|
|
241
294
|
}, null>;
|
|
@@ -249,32 +302,6 @@ export interface RuntimeRequests {
|
|
|
249
302
|
readonly done: boolean;
|
|
250
303
|
readonly text: number;
|
|
251
304
|
}>;
|
|
252
|
-
readonly 'replica.hold': Asked<{
|
|
253
|
-
readonly key: number;
|
|
254
|
-
readonly locator: string;
|
|
255
|
-
readonly composed: Composed;
|
|
256
|
-
readonly texts: readonly HeldText[];
|
|
257
|
-
}, readonly string[]>;
|
|
258
|
-
readonly 'replica.remember': Asked<{
|
|
259
|
-
readonly key: number;
|
|
260
|
-
readonly locator: string;
|
|
261
|
-
readonly paths: readonly string[];
|
|
262
|
-
}, null>;
|
|
263
|
-
readonly 'replica.wanted': Asked<{
|
|
264
|
-
readonly key: number;
|
|
265
|
-
readonly locator: string;
|
|
266
|
-
}, readonly {
|
|
267
|
-
readonly path: string;
|
|
268
|
-
readonly revision: string;
|
|
269
|
-
}[]>;
|
|
270
|
-
readonly 'replica.unhold': Asked<{
|
|
271
|
-
readonly key: number;
|
|
272
|
-
readonly locator: string;
|
|
273
|
-
readonly composed: Composed;
|
|
274
|
-
}, {
|
|
275
|
-
readonly paths: readonly string[];
|
|
276
|
-
readonly bytes: number;
|
|
277
|
-
}>;
|
|
278
305
|
readonly 'replica.fact': Asked<{
|
|
279
306
|
readonly name: string;
|
|
280
307
|
readonly value: string;
|
|
@@ -314,20 +341,30 @@ export interface RuntimeRequests {
|
|
|
314
341
|
readonly key: string;
|
|
315
342
|
readonly part: number;
|
|
316
343
|
}, Uint8Array | null>;
|
|
317
|
-
readonly 'conversation.held': Asked<
|
|
344
|
+
readonly 'conversation.held': Asked<{
|
|
345
|
+
readonly conversations: readonly string[] | null;
|
|
346
|
+
}, readonly HeldConversation[]>;
|
|
318
347
|
readonly 'conversation.keep': Asked<ConversationWrite, null>;
|
|
319
348
|
readonly 'conversation.window': Asked<{
|
|
320
349
|
readonly conversation: string;
|
|
321
350
|
readonly limit: number;
|
|
322
351
|
readonly before: readonly [string, string] | null;
|
|
352
|
+
readonly phrase: string | null;
|
|
323
353
|
}, MessageWindow>;
|
|
324
354
|
readonly 'conversation.count': Asked<{
|
|
325
355
|
readonly conversation: string;
|
|
356
|
+
readonly phrase: string | null;
|
|
326
357
|
}, number>;
|
|
327
358
|
readonly 'conversation.turn': Asked<{
|
|
328
359
|
readonly conversation: string;
|
|
329
360
|
readonly turn: string;
|
|
330
361
|
}, boolean>;
|
|
362
|
+
readonly 'conversation.rows': Asked<{
|
|
363
|
+
readonly conversations: readonly string[];
|
|
364
|
+
}, readonly HeldRow[]>;
|
|
365
|
+
readonly 'conversation.jobs': Asked<{
|
|
366
|
+
readonly conversation: string;
|
|
367
|
+
}, readonly JobMarker[]>;
|
|
331
368
|
readonly 'conversation.drop': Asked<{
|
|
332
369
|
readonly conversations: readonly string[];
|
|
333
370
|
}, null>;
|
package/dist/mdruntime/wire.d.ts
CHANGED
|
@@ -82,6 +82,14 @@ declare const MEMBERS: {
|
|
|
82
82
|
readonly reach: 'whole';
|
|
83
83
|
readonly effect: 'write';
|
|
84
84
|
};
|
|
85
|
+
readonly unsent: {
|
|
86
|
+
readonly reach: 'whole';
|
|
87
|
+
readonly effect: 'read';
|
|
88
|
+
};
|
|
89
|
+
readonly reset: {
|
|
90
|
+
readonly reach: 'whole';
|
|
91
|
+
readonly effect: 'write';
|
|
92
|
+
};
|
|
85
93
|
readonly persistence: {
|
|
86
94
|
readonly reach: 'runtime';
|
|
87
95
|
readonly effect: 'read';
|
package/dist/test-host.js
CHANGED
|
@@ -129,7 +129,7 @@ export function createHouseBridgeTestHost(options = {}) {
|
|
|
129
129
|
},
|
|
130
130
|
install: () => Promise.resolve('manual'),
|
|
131
131
|
notifications: () => Promise.resolve('unavailable'),
|
|
132
|
-
|
|
132
|
+
telegram: () => Promise.resolve({ state: 'unavailable', name: null, username: null }),
|
|
133
133
|
setTab(tab) {
|
|
134
134
|
tabs.push(tab);
|
|
135
135
|
},
|
package/docs/families.md
CHANGED
|
@@ -29,11 +29,22 @@
|
|
|
29
29
|
notifications, or `'unavailable'` where it has no push, as on an iPhone or
|
|
30
30
|
iPad outside a Home-screen app. `notifications(true)` asks the browser's
|
|
31
31
|
permission and subscribes, `notifications(false)` unsubscribes, and each
|
|
32
|
-
answers the state it leaves; a failure of the browser's push service
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
answers the state it leaves; a failure of the browser's push service
|
|
33
|
+
rejects the same way. Call `notifications(true)` from a click. House's
|
|
34
|
+
service worker counts the icon's badge itself, as pushes arrive and as
|
|
35
|
+
read marks reach this storage.
|
|
36
|
+
- **Telegram** - House's own panel alone, refused to an App or a Site the same
|
|
37
|
+
way. `telegram()` answers `{ state, name, username }`: `state` is
|
|
38
|
+
`'available'` where the page runs inside a House bot's Mini App that gave it
|
|
39
|
+
Telegram's launch data naming an account, with that account's `name` and its
|
|
40
|
+
`username` or `null`, and `'unavailable'` with both `null` elsewhere.
|
|
41
|
+
`telegram(true)` links the signed-in User to that account and answers
|
|
42
|
+
`'linked'` with it; where the User's sign-in is
|
|
43
|
+
not recent, the page goes to sign in again, and nothing links until a later
|
|
44
|
+
`telegram(true)`.
|
|
45
|
+
Telegram's refusal rejects with an error coded `linked_elsewhere`,
|
|
46
|
+
`rate_limited` or `refused`, and a failed request with the browser's own
|
|
47
|
+
error name.
|
|
37
48
|
- **Status** - the App reference the runtime client is attached under,
|
|
38
49
|
`preferences`: the `roomRef` and Path of the App's own preferences document,
|
|
39
50
|
or `null` until the runtime holds that Room, sync
|
|
@@ -143,7 +154,7 @@ records in `tabs` each `setTab`, answers a release code read from the
|
|
|
143
154
|
by App reference and `readSiteScreenshot` from the `siteScreenshots` it was
|
|
144
155
|
given by Site identifier, answers every `install()` `'manual'`, as a browser
|
|
145
156
|
with no install prompt does, answers every `notifications()` `'unavailable'`,
|
|
146
|
-
as a browser without push does,
|
|
157
|
+
as a browser without push does, records in `chats`
|
|
147
158
|
each Chat `chat.mount` places, with its `element`, the `options` it was last
|
|
148
159
|
given and whether it is still `mounted`, drawing nothing, delivers each App
|
|
149
160
|
message `message({ from, body })` plays, and hands `bridge.runtime` the MD
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentshouse/app-bridge",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-c8a7dd564e490",
|
|
4
4
|
"description": "Types of the agents.house App bridge House hands every App: navigation, the tab title and icon, ceremonies, installation, notifications and the icon badge, status, Site image reads, App release code, App and Site screenshot reads, App messages and the Chat, with an accessor and an in-page test host.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { type Definition, type ValueFacts } from './definition.js';
|
|
2
|
-
import type { Document, VerifiedModel } from './types.js';
|
|
3
|
-
export type ConditionValue = string | number | boolean;
|
|
4
|
-
export declare const CONDITION_OPERATORS: readonly ['eq', 'in', 'exists', 'contains', 'gt', 'gte', 'lt', 'lte', 'prefix'];
|
|
5
|
-
export type ConditionOperator = (typeof CONDITION_OPERATORS)[number];
|
|
6
|
-
export type ConditionTest = {
|
|
7
|
-
readonly all: readonly ConditionTest[];
|
|
8
|
-
} | {
|
|
9
|
-
readonly any: readonly ConditionTest[];
|
|
10
|
-
} | {
|
|
11
|
-
readonly not: ConditionTest;
|
|
12
|
-
} | ({
|
|
13
|
-
readonly path: string;
|
|
14
|
-
} & ({
|
|
15
|
-
readonly eq: ConditionValue;
|
|
16
|
-
} | {
|
|
17
|
-
readonly in: readonly ConditionValue[];
|
|
18
|
-
} | {
|
|
19
|
-
readonly exists: boolean;
|
|
20
|
-
} | {
|
|
21
|
-
readonly contains: ConditionValue;
|
|
22
|
-
} | {
|
|
23
|
-
readonly gt: number | string;
|
|
24
|
-
} | {
|
|
25
|
-
readonly gte: number | string;
|
|
26
|
-
} | {
|
|
27
|
-
readonly lt: number | string;
|
|
28
|
-
} | {
|
|
29
|
-
readonly lte: number | string;
|
|
30
|
-
} | {
|
|
31
|
-
readonly prefix: string;
|
|
32
|
-
}));
|
|
33
|
-
export type ConditionScope = {
|
|
34
|
-
readonly type: string;
|
|
35
|
-
} | {
|
|
36
|
-
readonly folder: string;
|
|
37
|
-
} | {
|
|
38
|
-
readonly document: string;
|
|
39
|
-
};
|
|
40
|
-
type DocumentEventBase = {
|
|
41
|
-
readonly on: 'documents';
|
|
42
|
-
readonly scope: ConditionScope;
|
|
43
|
-
readonly by?: ConditionTest;
|
|
44
|
-
readonly moved_between_rooms?: boolean;
|
|
45
|
-
};
|
|
46
|
-
export type DocumentCondition = (DocumentEventBase & {
|
|
47
|
-
readonly mode: 'starts_matching';
|
|
48
|
-
readonly new_documents: boolean;
|
|
49
|
-
readonly match: ConditionTest;
|
|
50
|
-
}) | (DocumentEventBase & {
|
|
51
|
-
readonly mode: 'field_changes';
|
|
52
|
-
readonly field: string;
|
|
53
|
-
readonly from?: readonly ConditionValue[] | 'new';
|
|
54
|
-
readonly to?: readonly ConditionValue[] | 'deleted';
|
|
55
|
-
readonly match?: ConditionTest;
|
|
56
|
-
});
|
|
57
|
-
export type ItemCondition = {
|
|
58
|
-
readonly on: 'items';
|
|
59
|
-
readonly source?: string;
|
|
60
|
-
readonly address?: string;
|
|
61
|
-
readonly match?: ConditionTest;
|
|
62
|
-
};
|
|
63
|
-
export type CronCondition = {
|
|
64
|
-
readonly on: 'clock';
|
|
65
|
-
readonly cron: string;
|
|
66
|
-
readonly time_zone: string;
|
|
67
|
-
};
|
|
68
|
-
export type DateCondition = {
|
|
69
|
-
readonly on: 'clock';
|
|
70
|
-
readonly scope: {
|
|
71
|
-
readonly type: string;
|
|
72
|
-
};
|
|
73
|
-
readonly date: string;
|
|
74
|
-
readonly days: number;
|
|
75
|
-
readonly at: string;
|
|
76
|
-
readonly time_zone: string;
|
|
77
|
-
readonly match?: ConditionTest;
|
|
78
|
-
};
|
|
79
|
-
export type NotificationCondition = {
|
|
80
|
-
readonly on: 'notifications';
|
|
81
|
-
readonly match?: ConditionTest;
|
|
82
|
-
};
|
|
83
|
-
export type MessageCondition = {
|
|
84
|
-
readonly on: 'messages';
|
|
85
|
-
readonly match?: ConditionTest;
|
|
86
|
-
};
|
|
87
|
-
export type Condition = DocumentCondition | ItemCondition | CronCondition | DateCondition | NotificationCondition | MessageCondition;
|
|
88
|
-
export type FactKind = 'string' | 'number' | 'boolean' | 'date' | 'time' | 'enum' | 'reference';
|
|
89
|
-
type Scalar = string | number | boolean;
|
|
90
|
-
export type Fact = {
|
|
91
|
-
readonly kind: FactKind;
|
|
92
|
-
readonly value: Scalar;
|
|
93
|
-
readonly member?: string;
|
|
94
|
-
} | {
|
|
95
|
-
readonly kind: 'prose';
|
|
96
|
-
} | {
|
|
97
|
-
readonly kind: 'null';
|
|
98
|
-
} | {
|
|
99
|
-
readonly kind: 'unreadable';
|
|
100
|
-
} | {
|
|
101
|
-
readonly kind: 'list';
|
|
102
|
-
readonly items: readonly Fact[];
|
|
103
|
-
} | {
|
|
104
|
-
readonly kind: 'object';
|
|
105
|
-
readonly fields: Readonly<Record<string, Fact>>;
|
|
106
|
-
};
|
|
107
|
-
export type DocumentFacts = {
|
|
108
|
-
readonly id: string;
|
|
109
|
-
readonly path: string;
|
|
110
|
-
readonly type: string | null;
|
|
111
|
-
readonly fields: Readonly<Record<string, Fact>>;
|
|
112
|
-
readonly sections: readonly string[];
|
|
113
|
-
};
|
|
114
|
-
export declare const TEXT_FIELD = "/text";
|
|
115
|
-
export declare const WRITE_DOORS: readonly ['browser', 'agent', 'client', 'function'];
|
|
116
|
-
export type WriteDoor = (typeof WRITE_DOORS)[number];
|
|
117
|
-
export type Actor = {
|
|
118
|
-
readonly user?: string;
|
|
119
|
-
readonly site?: string;
|
|
120
|
-
readonly app?: string;
|
|
121
|
-
readonly door?: WriteDoor;
|
|
122
|
-
};
|
|
123
|
-
export type DocumentEvent = {
|
|
124
|
-
readonly before: DocumentFacts | null;
|
|
125
|
-
readonly after: DocumentFacts | null;
|
|
126
|
-
readonly changed: readonly string[];
|
|
127
|
-
readonly by: Actor;
|
|
128
|
-
readonly moved_between_rooms: boolean;
|
|
129
|
-
};
|
|
130
|
-
export type ItemFacts = {
|
|
131
|
-
readonly delivery: string;
|
|
132
|
-
readonly source: string | null;
|
|
133
|
-
readonly address: string | null;
|
|
134
|
-
readonly container: string | null;
|
|
135
|
-
readonly author: string | null;
|
|
136
|
-
readonly headers: Readonly<Record<string, string>>;
|
|
137
|
-
readonly json: {
|
|
138
|
-
readonly value: unknown;
|
|
139
|
-
} | null;
|
|
140
|
-
};
|
|
141
|
-
export type MessageFacts = {
|
|
142
|
-
readonly sender: string;
|
|
143
|
-
readonly routine: string | null;
|
|
144
|
-
readonly path: string | null;
|
|
145
|
-
};
|
|
146
|
-
export type Resolved = {
|
|
147
|
-
readonly id: string;
|
|
148
|
-
readonly member?: string;
|
|
149
|
-
};
|
|
150
|
-
type Truth = boolean | undefined;
|
|
151
|
-
export declare function factKind(facts: ValueFacts): FactKind | null;
|
|
152
|
-
export declare function facts(document: Document, at: {
|
|
153
|
-
readonly id: string;
|
|
154
|
-
readonly path: string;
|
|
155
|
-
}, model: VerifiedModel, resolve: (target: string) => Resolved | undefined): DocumentFacts;
|
|
156
|
-
export declare function prosePaths(facts: DocumentFacts): string[];
|
|
157
|
-
export declare function datePointers(fields: Readonly<Record<string, ValueFacts>>): string[];
|
|
158
|
-
export declare function valuedChange(definition: Definition, field: string): boolean;
|
|
159
|
-
export declare function changeFields(definition: Definition): string[];
|
|
160
|
-
export declare function memberPointers(definition: Definition, memberType: string): string[];
|
|
161
|
-
export declare const DOCUMENT_PATHS: readonly string[];
|
|
162
|
-
export declare const ACTOR_PATHS: readonly string[];
|
|
163
|
-
export declare const ITEM_PATHS: readonly string[];
|
|
164
|
-
export declare const MESSAGE_PATHS: readonly string[];
|
|
165
|
-
export declare function testOperators(definitions: readonly Definition[], path: string, memberType: string | null): readonly ConditionOperator[];
|
|
166
|
-
export declare function actorOperators(path: string): readonly ConditionOperator[];
|
|
167
|
-
export declare function itemOperators(path: string): readonly ConditionOperator[];
|
|
168
|
-
export declare function messageOperators(path: string): readonly ConditionOperator[];
|
|
169
|
-
export declare function itemKind(path: string): FactKind | null;
|
|
170
|
-
export declare function dated(value: unknown): value is string;
|
|
171
|
-
export declare function instant(value: unknown): bigint | undefined;
|
|
172
|
-
export declare function pointed(value: unknown, pointer: string): unknown;
|
|
173
|
-
export declare function members(document: DocumentFacts, path: string): readonly string[];
|
|
174
|
-
export declare function holds(test: ConditionTest, document: DocumentFacts): Truth;
|
|
175
|
-
export declare function inScope(scope: ConditionScope, document: Pick<DocumentFacts, 'id' | 'path' | 'type'> | null): boolean;
|
|
176
|
-
export declare function fires(condition: DocumentCondition, event: DocumentEvent): boolean;
|
|
177
|
-
export declare function itemFires(condition: ItemCondition, item: ItemFacts): boolean;
|
|
178
|
-
export declare function notificationFires(condition: NotificationCondition, notification: DocumentFacts): boolean;
|
|
179
|
-
export declare function messageFires(condition: MessageCondition, message: MessageFacts): boolean;
|
|
180
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type QueryRoom } from './compile.js';
|
|
2
|
-
import type { Plan } from './query.js';
|
|
3
|
-
import type { HitCursor, SearchWindow } from './search.js';
|
|
4
|
-
import type { Connection } from './tables.js';
|
|
5
|
-
export declare const SEARCH_TABLES: readonly string[];
|
|
6
|
-
export type SearchAsk = {
|
|
7
|
-
readonly text: string;
|
|
8
|
-
readonly limit: number;
|
|
9
|
-
readonly after: readonly [HitCursor, HitCursor] | null;
|
|
10
|
-
readonly total: boolean;
|
|
11
|
-
readonly documents: {
|
|
12
|
-
readonly plan: Plan;
|
|
13
|
-
readonly rooms: readonly QueryRoom[];
|
|
14
|
-
readonly beneath: readonly {
|
|
15
|
-
readonly key: number;
|
|
16
|
-
readonly roots: readonly string[];
|
|
17
|
-
}[];
|
|
18
|
-
} | null;
|
|
19
|
-
readonly conversations: readonly string[];
|
|
20
|
-
};
|
|
21
|
-
export declare function indexDocument(connection: Connection, id: number, path: string, content: string): void;
|
|
22
|
-
export declare function indexMessage(connection: Connection, id: number, text: string): void;
|
|
23
|
-
export declare function unindexDocuments(connection: Connection, ids: Iterable<number>): void;
|
|
24
|
-
export declare function unindexMessages(connection: Connection, ids: Iterable<number>): void;
|
|
25
|
-
export declare function unindexAll(connection: Connection): void;
|
|
26
|
-
export declare function searched(connection: Connection, ask: SearchAsk): SearchWindow;
|