@agentshouse/app-bridge 0.1.0-cfb240c3fb89d → 0.1.0-cfbb2e428ff88
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 +11 -11
- package/dist/index.d.ts +865 -8
- package/dist/mdmodel/definition.d.ts +17 -1
- package/dist/mdmodel/document.d.ts +5 -5
- package/dist/mdmodel/event.d.ts +77 -0
- package/dist/mdmodel/facts.d.ts +14 -0
- package/dist/mdmodel/index.d.ts +23 -9
- package/dist/mdmodel/kinds.d.ts +18 -0
- package/dist/mdmodel/links.d.ts +28 -0
- package/dist/mdmodel/paths.d.ts +9 -1
- package/dist/mdmodel/project.d.ts +1 -0
- package/dist/mdmodel/query/language.d.ts +222 -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 +35 -4
- package/dist/mdmodel/validate.d.ts +29 -4
- package/dist/mdruntime/adapter.d.ts +147 -74
- package/dist/mdruntime/binary.d.ts +0 -5
- package/dist/mdruntime/chain.d.ts +11 -0
- package/dist/mdruntime/change-set.d.ts +9 -16
- package/dist/mdruntime/change.d.ts +31 -1
- package/dist/mdruntime/client.d.ts +27 -11
- package/dist/mdruntime/collection.d.ts +11 -21
- package/dist/mdruntime/compile.d.ts +10 -0
- package/dist/mdruntime/connection.d.ts +41 -14
- package/dist/mdruntime/conversation.d.ts +32 -15
- package/dist/mdruntime/durability.d.ts +10 -1
- package/dist/mdruntime/identity.d.ts +5 -0
- package/dist/mdruntime/media.d.ts +7 -0
- package/dist/mdruntime/messages.d.ts +27 -0
- package/dist/mdruntime/model.d.ts +11 -10
- package/dist/mdruntime/observation.d.ts +17 -2
- package/dist/mdruntime/opened.d.ts +21 -0
- package/dist/mdruntime/outcome.d.ts +45 -7
- package/dist/mdruntime/overlay.d.ts +3 -5
- package/dist/mdruntime/query.d.ts +17 -185
- package/dist/mdruntime/reach.d.ts +18 -6
- package/dist/mdruntime/readiness.d.ts +49 -0
- package/dist/mdruntime/recovery.d.ts +3 -2
- package/dist/mdruntime/replica.d.ts +58 -33
- package/dist/mdruntime/room-draft.d.ts +37 -6
- package/dist/mdruntime/save.d.ts +53 -14
- package/dist/mdruntime/search.d.ts +15 -77
- package/dist/mdruntime/seed.d.ts +15 -0
- package/dist/mdruntime/status.d.ts +5 -0
- package/dist/mdruntime/store.d.ts +93 -94
- package/dist/mdruntime/stored.d.ts +128 -0
- package/dist/mdruntime/tables.d.ts +326 -0
- package/dist/mdruntime/wire.d.ts +173 -32
- package/dist/test-host.d.ts +7 -1
- package/dist/test-host.js +19 -1
- package/docs/families.md +66 -12
- package/package.json +8 -3
- package/dist/calls.d.ts +0 -117
- package/dist/calls.js +0 -1
- package/dist/mdmodel/condition.d.ts +0 -149
- package/dist/mdruntime/file.d.ts +0 -19
- package/dist/mdruntime/rows.d.ts +0 -36
- package/dist/mdruntime/shared.d.ts +0 -10
- package/dist/mdruntime/transfer.d.ts +0 -9
- package/dist/mdruntime/turn.d.ts +0 -6
package/docs/families.md
CHANGED
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
purpose-bound authenticated pages. The shell navigates only to a same-origin
|
|
13
13
|
absolute path, carries its current address as the return target, and the page
|
|
14
14
|
returns there when it completes. An App names an address House gave it in a
|
|
15
|
-
reading and composes
|
|
15
|
+
reading and composes one only for `/bind/<app_ref>`, where the User binds
|
|
16
|
+
its Rooms, with `?slot=<name>` to open at one slot, and `/sign-out`, which
|
|
17
|
+
signs the User out and opens sign-in.
|
|
16
18
|
- **Installation** - `install()` offers the page as a Home-screen app. Where the
|
|
17
19
|
browser has an install prompt ready the shell shows it and the call resolves
|
|
18
20
|
`'accepted'` or `'dismissed'` with the User's choice, spending that prompt;
|
|
@@ -32,6 +34,18 @@
|
|
|
32
34
|
click. `setBadge(unread)` takes the identifiers of the Human Notifications
|
|
33
35
|
unread in this storage and sets the icon's badge to their number, or clears
|
|
34
36
|
it at none, where the browser shows one.
|
|
37
|
+
- **Telegram** - House's own panel alone, refused to an App or a Site the same
|
|
38
|
+
way. `telegram()` answers `{ state, name, username }`: `state` is
|
|
39
|
+
`'available'` where the page runs inside a House bot's Mini App that gave it
|
|
40
|
+
Telegram's launch data naming an account, with that account's `name` and its
|
|
41
|
+
`username` or `null`, and `'unavailable'` with both `null` elsewhere.
|
|
42
|
+
`telegram(true)` links the signed-in User to that account and answers
|
|
43
|
+
`'linked'` with it; where the User's sign-in is
|
|
44
|
+
not recent, the page goes to sign in again, and nothing links until a later
|
|
45
|
+
`telegram(true)`.
|
|
46
|
+
Telegram's refusal rejects with an error coded `linked_elsewhere`,
|
|
47
|
+
`rate_limited` or `refused`, and a failed request with the browser's own
|
|
48
|
+
error name.
|
|
35
49
|
- **Status** - the App reference the runtime client is attached under,
|
|
36
50
|
`preferences`: the `roomRef` and Path of the App's own preferences document,
|
|
37
51
|
or `null` until the runtime holds that Room, sync
|
|
@@ -45,8 +59,21 @@
|
|
|
45
59
|
The App reports the visitor's choice with `analyticsConsent('accept')` or
|
|
46
60
|
`analyticsConsent('decline')`; the shell hands it to House's analytics loader, and
|
|
47
61
|
the choice never reaches House.
|
|
48
|
-
- **
|
|
49
|
-
|
|
62
|
+
- **Releases and builds** - an open App keeps the release it loaded: a newer
|
|
63
|
+
release, or a newer House build, takes effect at the App's next load, offline
|
|
64
|
+
too once the browser stored it. When one tab loads a newer House build, the
|
|
65
|
+
other House tabs reload into it; Room Drafts, chat drafts and unsent changes
|
|
66
|
+
survive the reload.
|
|
67
|
+
- **A runtime that ends** - when the browser ends House's runtime under an open
|
|
68
|
+
App, the App keeps running, its `runtime` client and observations included:
|
|
69
|
+
each observation goes on with the next runtime's values, and the status and
|
|
70
|
+
the address arrive again. A runtime that ended before answering has its reads
|
|
71
|
+
answered by the next one; since it may have applied any other call, an act on
|
|
72
|
+
House is answered the outcome `transport-uncertainty`, and every other call,
|
|
73
|
+
a Save or a draft write among them, fails with the retryable code
|
|
74
|
+
`transport-uncertainty`.
|
|
75
|
+
- **Site image read** - given a Published Room and the Path of one of its
|
|
76
|
+
binary entries, it answers the web copy's path and metadata, or `null` when no
|
|
50
77
|
copy exists. The original bytes never cross this bridge at a Site.
|
|
51
78
|
- **App release code** - `sourceTop(app, release)` answers the top level of
|
|
52
79
|
the latest successful release of an App the User may use: its folders, its
|
|
@@ -58,21 +85,21 @@
|
|
|
58
85
|
refusal is House's `{ error: { code, retryable } }`, `app_release_not_found` for an
|
|
59
86
|
App with no release; a read House does not answer, or one that outlived
|
|
60
87
|
the browser's signed-in User, is `null`.
|
|
61
|
-
- **External calls** - `callExternal({ url, method, headers, body,
|
|
88
|
+
- **External calls** - `callExternal({ url, method, headers, body, room_ref })`
|
|
62
89
|
has House's server send an HTTPS request to one of the release's declared
|
|
63
90
|
external origins and resolves with the service's `status`, `headers` and its
|
|
64
91
|
body as `body` text or `body_base64`, or a refusal as House's
|
|
65
92
|
`{ error: { code, retryable } }`, or `null` when House does not answer. House fills in the
|
|
66
|
-
App and its running release
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
`
|
|
93
|
+
App and its running release. A `room_ref` names a Room the signed-in User binds to the App
|
|
94
|
+
in a `write` slot, and House adds that Room's Service key for the URL's origin, which App
|
|
95
|
+
code never sees; a call naming no Room carries no key, and a Site's call names no Room.
|
|
96
|
+
`body_base64` replaces `body` for bytes.
|
|
70
97
|
- **App messages** - `messages(listener)` hands the listener each message
|
|
71
98
|
another holder of this App sends to this User's running copies, as `from`,
|
|
72
99
|
the sender's User id, and `body`, the JSON value they sent, until the
|
|
73
100
|
function it returns is called. App code sends one through the Runtime's
|
|
74
|
-
`call('
|
|
75
|
-
a body of at most 32
|
|
101
|
+
`call('apps/messages/send', { to, body })` with the recipient's User id and
|
|
102
|
+
a body of at most 32 kB of JSON; House fills in the App and relays it only
|
|
76
103
|
to copies running now, storing nothing. The panel sends none.
|
|
77
104
|
- **App screenshot read** - given an App reference, `readScreenshot(app)`
|
|
78
105
|
answers the image this browser captured of that App's screen the first time
|
|
@@ -84,6 +111,30 @@
|
|
|
84
111
|
after its latest release, as a JPEG `Blob`, or `null` when House holds none
|
|
85
112
|
or does not answer. A Site's own renderer reads none.
|
|
86
113
|
|
|
114
|
+
- **Chat** - `chat.mount(element, options)` places House's Chat, the one chat
|
|
115
|
+
in which the User's Agent conversations show, in `element` over the page's
|
|
116
|
+
`runtime` client, and resolves to a handle: `update(options)` replaces its
|
|
117
|
+
options and `unmount()` removes it. House serves the Chat with the page and
|
|
118
|
+
keeps it current, so the App installs and bundles nothing for it. The
|
|
119
|
+
options: `conversation` opens one, `null` for a new chat, `agent` is the
|
|
120
|
+
Agent a new chat goes to, `showChats` adds its conversation list, `width` is
|
|
121
|
+
`full`, the element, or `3/4`, `1/2` or `1/3` of the window docked at its
|
|
122
|
+
right edge, `onOpen` hears each conversation it opens as
|
|
123
|
+
`{ conversation, agent }`, and `onLink` takes a link without a scheme in
|
|
124
|
+
place of the browser. CSS custom properties named `--chat-*` on the element
|
|
125
|
+
or an ancestor set its look. It shows conversations only to a release that
|
|
126
|
+
declares them. A Site and the House panel have none: their call rejects with
|
|
127
|
+
an error named and coded `NotSupportedError`, with `retryable` false.
|
|
128
|
+
|
|
129
|
+
- **First place** - `cooperate({ placed })` tells House when the page has
|
|
130
|
+
drawn the place it opened on; the function it returns withdraws it. Register
|
|
131
|
+
it in the entry script, before the first draw. `placed()` resolves once the
|
|
132
|
+
page has drawn that place with what it shows: House keeps its
|
|
133
|
+
first-preparation surface over a page registered by its first draw until
|
|
134
|
+
then, and lifts it at the first draw of a page that registered none, so the
|
|
135
|
+
User goes from the surface to a drawn place in one change. House asks the
|
|
136
|
+
page for nothing else.
|
|
137
|
+
|
|
87
138
|
## The test host
|
|
88
139
|
|
|
89
140
|
`createHouseBridgeTestHost(options)` plays House in one page: it installs a
|
|
@@ -104,6 +155,9 @@ records in `tabs` each `setTab`, answers a release code read from the
|
|
|
104
155
|
by App reference and `readSiteScreenshot` from the `siteScreenshots` it was
|
|
105
156
|
given by Site identifier, answers every `install()` `'manual'`, as a browser
|
|
106
157
|
with no install prompt does, answers every `notifications()` `'unavailable'`,
|
|
107
|
-
as a browser without push does, settles every `setBadge`,
|
|
158
|
+
as a browser without push does, settles every `setBadge`, records in `chats`
|
|
159
|
+
each Chat `chat.mount` places, with its `element`, the `options` it was last
|
|
160
|
+
given and whether it is still `mounted`, drawing nothing, delivers each App
|
|
108
161
|
message `message({ from, body })` plays, and hands `bridge.runtime` the MD
|
|
109
|
-
Runtime client `attachRuntime(client)` gives it.
|
|
162
|
+
Runtime client `attachRuntime(client)` gives it. It takes a `cooperate` and
|
|
163
|
+
never calls `placed()`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentshouse/app-bridge",
|
|
3
|
-
"version": "0.1.0-
|
|
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, and
|
|
3
|
+
"version": "0.1.0-cfbb2e428ff88",
|
|
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",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -23,5 +23,10 @@
|
|
|
23
23
|
"docs",
|
|
24
24
|
"README.md",
|
|
25
25
|
"LICENSE"
|
|
26
|
-
]
|
|
26
|
+
],
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/agentshouse/core.git",
|
|
30
|
+
"directory": "client"
|
|
31
|
+
}
|
|
27
32
|
}
|
package/dist/calls.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
export interface HouseCalls {
|
|
2
|
-
readonly 'access.read': {
|
|
3
|
-
readonly room_ref: string;
|
|
4
|
-
};
|
|
5
|
-
readonly 'conversation.answer': {
|
|
6
|
-
readonly answer: {
|
|
7
|
-
readonly interaction_id: string;
|
|
8
|
-
readonly response: unknown;
|
|
9
|
-
};
|
|
10
|
-
readonly conversation: string;
|
|
11
|
-
readonly operation_id?: string;
|
|
12
|
-
};
|
|
13
|
-
readonly 'conversation.create': {
|
|
14
|
-
readonly agent_id: string;
|
|
15
|
-
readonly operation_id?: string;
|
|
16
|
-
};
|
|
17
|
-
readonly 'conversation.delete': {
|
|
18
|
-
readonly conversation: string;
|
|
19
|
-
readonly operation_id?: string;
|
|
20
|
-
};
|
|
21
|
-
readonly 'conversation.history': {
|
|
22
|
-
readonly conversations: readonly {
|
|
23
|
-
readonly after?: string;
|
|
24
|
-
readonly conversation: string;
|
|
25
|
-
}[];
|
|
26
|
-
};
|
|
27
|
-
readonly 'conversation.interrupt': {
|
|
28
|
-
readonly conversation: string;
|
|
29
|
-
readonly operation_id?: string;
|
|
30
|
-
};
|
|
31
|
-
readonly 'conversation.kill': {
|
|
32
|
-
readonly conversation: string;
|
|
33
|
-
readonly operation_id?: string;
|
|
34
|
-
};
|
|
35
|
-
readonly 'conversation.markDone': {
|
|
36
|
-
readonly conversation_id?: string;
|
|
37
|
-
readonly result?: string;
|
|
38
|
-
readonly operation_id: string;
|
|
39
|
-
};
|
|
40
|
-
readonly 'conversation.rename': {
|
|
41
|
-
readonly conversation_id: string;
|
|
42
|
-
readonly operation_id: string;
|
|
43
|
-
readonly name: string;
|
|
44
|
-
};
|
|
45
|
-
readonly 'conversation.send': {
|
|
46
|
-
readonly conversation: string;
|
|
47
|
-
readonly files?: readonly {
|
|
48
|
-
readonly blob: Blob;
|
|
49
|
-
readonly byteLength: number;
|
|
50
|
-
readonly contentHash: string;
|
|
51
|
-
readonly height?: number;
|
|
52
|
-
readonly mediaType: string;
|
|
53
|
-
readonly name: string;
|
|
54
|
-
readonly width?: number;
|
|
55
|
-
}[];
|
|
56
|
-
readonly operation_id: string;
|
|
57
|
-
readonly text?: string;
|
|
58
|
-
};
|
|
59
|
-
readonly 'conversation.setOption': {
|
|
60
|
-
readonly conversation_id: string;
|
|
61
|
-
readonly operation_id: string;
|
|
62
|
-
readonly option: string;
|
|
63
|
-
readonly value: string | boolean;
|
|
64
|
-
};
|
|
65
|
-
readonly 'feature.list': Readonly<Record<string, never>>;
|
|
66
|
-
readonly 'holder.list': Readonly<Record<string, never>>;
|
|
67
|
-
readonly 'holder.ring': {
|
|
68
|
-
readonly to: string;
|
|
69
|
-
};
|
|
70
|
-
readonly 'member.list': {
|
|
71
|
-
readonly room_ref: string;
|
|
72
|
-
readonly history?: boolean;
|
|
73
|
-
readonly limit?: number;
|
|
74
|
-
readonly cursor?: string;
|
|
75
|
-
};
|
|
76
|
-
readonly 'message.send': {
|
|
77
|
-
readonly to: string;
|
|
78
|
-
readonly body: unknown;
|
|
79
|
-
};
|
|
80
|
-
readonly 'processing.read': {
|
|
81
|
-
readonly room_ref: string;
|
|
82
|
-
readonly path: string;
|
|
83
|
-
};
|
|
84
|
-
readonly 'record.list': {
|
|
85
|
-
readonly room_ref: string;
|
|
86
|
-
readonly record?: string;
|
|
87
|
-
readonly cursor?: string;
|
|
88
|
-
readonly limit?: number;
|
|
89
|
-
readonly order?: 'asc' | 'desc';
|
|
90
|
-
};
|
|
91
|
-
readonly 'relay.read': Readonly<Record<string, never>>;
|
|
92
|
-
readonly 'routine.list': {
|
|
93
|
-
readonly room_ref: string;
|
|
94
|
-
};
|
|
95
|
-
readonly 'routineAccess.list': {
|
|
96
|
-
readonly room_ref: string;
|
|
97
|
-
};
|
|
98
|
-
readonly 'routineAllowance.list': {
|
|
99
|
-
readonly room_ref: string;
|
|
100
|
-
readonly access: string;
|
|
101
|
-
};
|
|
102
|
-
readonly 'routineRequest.list': {
|
|
103
|
-
readonly room_ref: string;
|
|
104
|
-
};
|
|
105
|
-
readonly 'storage.read': {
|
|
106
|
-
readonly room_ref?: string;
|
|
107
|
-
};
|
|
108
|
-
readonly submit: {
|
|
109
|
-
readonly content: string;
|
|
110
|
-
};
|
|
111
|
-
readonly 'trigger.list': {
|
|
112
|
-
readonly room_ref: string;
|
|
113
|
-
};
|
|
114
|
-
readonly 'triggerOccurrence.list': {
|
|
115
|
-
readonly room_ref: string;
|
|
116
|
-
};
|
|
117
|
-
}
|
package/dist/calls.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { type ValueFacts } from './definition.js';
|
|
2
|
-
import type { Document, VerifiedModel } from './types.js';
|
|
3
|
-
export type ConditionValue = string | number | boolean | {
|
|
4
|
-
readonly owner: true;
|
|
5
|
-
};
|
|
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
|
-
};
|
|
45
|
-
export type DocumentCondition = (DocumentEventBase & {
|
|
46
|
-
readonly mode: 'starts_matching';
|
|
47
|
-
readonly new_documents: boolean;
|
|
48
|
-
readonly match: ConditionTest;
|
|
49
|
-
}) | (DocumentEventBase & {
|
|
50
|
-
readonly mode: 'field_changes';
|
|
51
|
-
readonly field: string;
|
|
52
|
-
readonly from?: readonly ConditionValue[] | 'new';
|
|
53
|
-
readonly to?: readonly ConditionValue[] | 'deleted';
|
|
54
|
-
readonly match?: ConditionTest;
|
|
55
|
-
});
|
|
56
|
-
export type ItemCondition = {
|
|
57
|
-
readonly on: 'items';
|
|
58
|
-
readonly source?: string;
|
|
59
|
-
readonly address?: string;
|
|
60
|
-
readonly match?: ConditionTest;
|
|
61
|
-
};
|
|
62
|
-
export type CronCondition = {
|
|
63
|
-
readonly on: 'clock';
|
|
64
|
-
readonly cron: string;
|
|
65
|
-
readonly time_zone: string;
|
|
66
|
-
};
|
|
67
|
-
export type DateCondition = {
|
|
68
|
-
readonly on: 'clock';
|
|
69
|
-
readonly scope: {
|
|
70
|
-
readonly type: string;
|
|
71
|
-
};
|
|
72
|
-
readonly date: string;
|
|
73
|
-
readonly days: number;
|
|
74
|
-
readonly at: string;
|
|
75
|
-
readonly time_zone: string;
|
|
76
|
-
readonly match?: ConditionTest;
|
|
77
|
-
};
|
|
78
|
-
export type Condition = DocumentCondition | ItemCondition | CronCondition | DateCondition;
|
|
79
|
-
export type FactKind = 'string' | 'number' | 'boolean' | 'date' | 'time' | 'enum' | 'reference';
|
|
80
|
-
type Scalar = string | number | boolean;
|
|
81
|
-
export type Fact = {
|
|
82
|
-
readonly kind: FactKind;
|
|
83
|
-
readonly value: Scalar;
|
|
84
|
-
readonly member?: string;
|
|
85
|
-
} | {
|
|
86
|
-
readonly kind: 'prose';
|
|
87
|
-
} | {
|
|
88
|
-
readonly kind: 'null';
|
|
89
|
-
} | {
|
|
90
|
-
readonly kind: 'unreadable';
|
|
91
|
-
} | {
|
|
92
|
-
readonly kind: 'list';
|
|
93
|
-
readonly items: readonly Fact[];
|
|
94
|
-
} | {
|
|
95
|
-
readonly kind: 'object';
|
|
96
|
-
readonly fields: Readonly<Record<string, Fact>>;
|
|
97
|
-
};
|
|
98
|
-
export type DocumentFacts = {
|
|
99
|
-
readonly id: string;
|
|
100
|
-
readonly path: string;
|
|
101
|
-
readonly type: string | null;
|
|
102
|
-
readonly fields: Readonly<Record<string, Fact>>;
|
|
103
|
-
readonly sections: readonly string[];
|
|
104
|
-
};
|
|
105
|
-
export declare const WRITE_DOORS: readonly ['browser', 'agent', 'client'];
|
|
106
|
-
export type WriteDoor = (typeof WRITE_DOORS)[number];
|
|
107
|
-
export type Actor = {
|
|
108
|
-
readonly user?: string;
|
|
109
|
-
readonly site?: string;
|
|
110
|
-
readonly door?: WriteDoor;
|
|
111
|
-
};
|
|
112
|
-
export type DocumentEvent = {
|
|
113
|
-
readonly before: DocumentFacts | null;
|
|
114
|
-
readonly after: DocumentFacts | null;
|
|
115
|
-
readonly changed: readonly string[];
|
|
116
|
-
readonly by: Actor;
|
|
117
|
-
};
|
|
118
|
-
export type ItemFacts = {
|
|
119
|
-
readonly delivery: string;
|
|
120
|
-
readonly source: string | null;
|
|
121
|
-
readonly address: string | null;
|
|
122
|
-
readonly has_attachment: boolean;
|
|
123
|
-
readonly provider: string | null;
|
|
124
|
-
readonly container: string | null;
|
|
125
|
-
readonly author: string | null;
|
|
126
|
-
readonly headers: Readonly<Record<string, string>>;
|
|
127
|
-
readonly json: {
|
|
128
|
-
readonly value: unknown;
|
|
129
|
-
} | null;
|
|
130
|
-
};
|
|
131
|
-
export type Resolved = {
|
|
132
|
-
readonly id: string;
|
|
133
|
-
readonly member?: string;
|
|
134
|
-
};
|
|
135
|
-
type Truth = boolean | undefined;
|
|
136
|
-
export declare function factKind(facts: ValueFacts): FactKind | null;
|
|
137
|
-
export declare function facts(document: Document, at: {
|
|
138
|
-
readonly id: string;
|
|
139
|
-
readonly path: string;
|
|
140
|
-
}, model: VerifiedModel, resolve: (target: string) => Resolved | undefined): DocumentFacts;
|
|
141
|
-
export declare function prosePaths(facts: DocumentFacts): string[];
|
|
142
|
-
export declare function datePointers(fields: Readonly<Record<string, ValueFacts>>): string[];
|
|
143
|
-
export declare function dated(value: unknown): value is string;
|
|
144
|
-
export declare function instant(value: unknown): bigint | undefined;
|
|
145
|
-
export declare function pointed(value: unknown, pointer: string): unknown;
|
|
146
|
-
export declare function holds(test: ConditionTest, document: DocumentFacts, owner: string): Truth;
|
|
147
|
-
export declare function fires(condition: DocumentCondition, event: DocumentEvent, owner: string): boolean;
|
|
148
|
-
export declare function itemFires(condition: ItemCondition, item: ItemFacts, owner: string): boolean;
|
|
149
|
-
export {};
|
package/dist/mdruntime/file.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export type ChatDraftFile = {
|
|
2
|
-
name: string;
|
|
3
|
-
blob: Blob;
|
|
4
|
-
};
|
|
5
|
-
export type FileDeclaration = {
|
|
6
|
-
name: string;
|
|
7
|
-
mediaType: string;
|
|
8
|
-
byteLength: number;
|
|
9
|
-
contentHash: string;
|
|
10
|
-
width?: number;
|
|
11
|
-
height?: number;
|
|
12
|
-
};
|
|
13
|
-
export type Extent = {
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
};
|
|
17
|
-
export declare function extentOf(bytes: Uint8Array): Extent | null;
|
|
18
|
-
export declare function hexDigest(digest: ArrayBuffer): string;
|
|
19
|
-
export declare function declaredFile(file: ChatDraftFile): Promise<FileDeclaration>;
|
package/dist/mdruntime/rows.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type Frontmatter } from '../mdmodel/index.js';
|
|
2
|
-
import type { HeadChange } from './adapter.js';
|
|
3
|
-
import type { BinaryFileRecord } from './binary.js';
|
|
4
|
-
import { type Composition } from './collection.js';
|
|
5
|
-
type Fields = Readonly<Record<string, unknown>>;
|
|
6
|
-
export type DocumentRow = {
|
|
7
|
-
key: string;
|
|
8
|
-
kind: 'document';
|
|
9
|
-
room: string;
|
|
10
|
-
path: string;
|
|
11
|
-
type: string | null;
|
|
12
|
-
fields: Fields;
|
|
13
|
-
values: Fields;
|
|
14
|
-
reached: Readonly<Record<string, readonly unknown[]>>;
|
|
15
|
-
directories: readonly string[];
|
|
16
|
-
text: string | null;
|
|
17
|
-
change: HeadChange | null;
|
|
18
|
-
binary: BinaryFileRecord | null;
|
|
19
|
-
};
|
|
20
|
-
export type ReferenceRow = {
|
|
21
|
-
key: string;
|
|
22
|
-
kind: 'reference';
|
|
23
|
-
room: string;
|
|
24
|
-
source: string;
|
|
25
|
-
target: string;
|
|
26
|
-
field: string;
|
|
27
|
-
forms: readonly string[];
|
|
28
|
-
path: string;
|
|
29
|
-
type: string;
|
|
30
|
-
};
|
|
31
|
-
export type Row = DocumentRow | ReferenceRow;
|
|
32
|
-
export declare function documentKey(room: string, path: string): string;
|
|
33
|
-
export declare function roomOfKey(key: string): string;
|
|
34
|
-
export declare function markdownPath(path: string): boolean;
|
|
35
|
-
export declare function rowsOf(room: string, path: string, document: Frontmatter | null, composition: Composition, change: HeadChange | null, binary: BinaryFileRecord | null): readonly Row[];
|
|
36
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type Paths<V> = Readonly<Record<string, V>>;
|
|
2
|
-
type Weigh<V> = (key: string, value: V) => number;
|
|
3
|
-
export declare function shared<V>(map: Paths<V>): Paths<V>;
|
|
4
|
-
export declare function patched<V>(base: Paths<V>, set: Iterable<readonly [string, V]>, removed?: Iterable<string>): Paths<V>;
|
|
5
|
-
export declare function tally<V>(map: Paths<V>, weigh: Weigh<V>): number;
|
|
6
|
-
export declare function sizeOf<V>(map: Paths<V>): number;
|
|
7
|
-
export declare function differing<V>(left: Paths<V>, right: Paths<V>, same?: (left: V, right: V) => boolean): ReadonlySet<string>;
|
|
8
|
-
export declare function drafted<V>(base: Paths<V>): Record<string, V>;
|
|
9
|
-
export declare function settled<V>(draft: Record<string, V>): Paths<V>;
|
|
10
|
-
export {};
|
package/dist/mdruntime/turn.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare function yielded(): Promise<void>;
|
|
2
|
-
export declare const ROW_WEIGHT = 256;
|
|
3
|
-
export type Later<T> = T | Promise<T>;
|
|
4
|
-
export declare function after<T, R>(value: Later<T>, next: (value: T) => R): Later<R>;
|
|
5
|
-
export declare function inUnits<T>(items: Iterable<T>, each: (item: T) => number): Later<void>;
|
|
6
|
-
export declare function inChunks<T>(items: readonly T[], weigh: (item: T) => number, each: (chunk: readonly T[]) => void): Promise<void>;
|