@agentshouse/app-bridge 0.1.0-cfc063517adec → 0.1.0-cfd07287f376a
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 +4 -4
- package/dist/index.d.ts +70 -52
- package/dist/mdmodel/definition.d.ts +1 -1
- package/dist/mdmodel/event.d.ts +77 -0
- package/dist/mdmodel/facts.d.ts +14 -0
- package/dist/mdmodel/index.d.ts +18 -5
- package/dist/mdmodel/kinds.d.ts +18 -0
- package/dist/mdmodel/pattern.d.ts +9 -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 +7 -0
- package/dist/mdmodel/validate.d.ts +7 -5
- package/dist/mdruntime/adapter.d.ts +26 -10
- package/dist/mdruntime/chain.d.ts +2 -1
- package/dist/mdruntime/client.d.ts +7 -3
- package/dist/mdruntime/collection.d.ts +2 -1
- package/dist/mdruntime/compile.d.ts +1 -6
- package/dist/mdruntime/connection.d.ts +6 -5
- package/dist/mdruntime/conversation.d.ts +5 -4
- package/dist/mdruntime/durability.d.ts +6 -0
- package/dist/mdruntime/identity.d.ts +0 -1
- package/dist/mdruntime/messages.d.ts +2 -2
- package/dist/mdruntime/model.d.ts +2 -7
- package/dist/mdruntime/observation.d.ts +2 -2
- package/dist/mdruntime/query.d.ts +3 -208
- package/dist/mdruntime/reach.d.ts +6 -6
- 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/store.d.ts +4 -7
- package/dist/mdruntime/stored.d.ts +3 -4
- package/dist/mdruntime/tables.d.ts +8 -6
- package/dist/mdruntime/wire.d.ts +8 -0
- package/dist/test-host.js +1 -0
- package/docs/families.md +13 -1
- package/package.json +1 -1
- package/dist/mdmodel/condition.d.ts +0 -180
- package/dist/mdruntime/fulltext.d.ts +0 -26
package/README.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
The types of the agents.house App bridge, an accessor and an in-page test host.
|
|
4
4
|
House builds the bridge object in every App it serves and hands it to the page
|
|
5
5
|
before the App's own scripts run; `houseBridge()` returns that object, so an App
|
|
6
|
-
carries no bridge code of its own. It carries
|
|
7
|
-
ceremonies, installation, notifications, status, Site image reads, App
|
|
8
|
-
code, external calls, App messages, App and Site screenshot reads and the
|
|
9
|
-
[docs/families.md](docs/families.md) describes each and the test host.
|
|
6
|
+
carries no bridge code of its own. It carries thirteen families: navigation,
|
|
7
|
+
ceremonies, installation, notifications, Telegram, status, Site image reads, App
|
|
8
|
+
release code, external calls, App messages, App and Site screenshot reads and the
|
|
9
|
+
Chat. [docs/families.md](docs/families.md) describes each and the test host.
|
|
10
10
|
|
|
11
11
|
The bridge carries no credential handling and no Runtime family. House builds
|
|
12
12
|
the MD Runtime client into the page beside the bridge and serves it the Chat, so
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import type { MdRuntimeClient, Open } from './mdruntime/client.js';
|
|
2
2
|
export interface HouseMethods {
|
|
3
|
+
readonly "agent-functions/requests": {
|
|
4
|
+
readonly params: {
|
|
5
|
+
readonly room_ref: string;
|
|
6
|
+
};
|
|
7
|
+
readonly result: {
|
|
8
|
+
readonly current: readonly {
|
|
9
|
+
readonly document: string;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
}[];
|
|
12
|
+
readonly history: readonly {
|
|
13
|
+
readonly document: string;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
3
18
|
readonly "apps/features/read": {
|
|
4
19
|
readonly params: {};
|
|
5
20
|
readonly result: {
|
|
@@ -81,6 +96,29 @@ export interface HouseMethods {
|
|
|
81
96
|
readonly url: string;
|
|
82
97
|
};
|
|
83
98
|
};
|
|
99
|
+
readonly "chats/reply": {
|
|
100
|
+
readonly params: {
|
|
101
|
+
readonly operation_id: string;
|
|
102
|
+
readonly path: string;
|
|
103
|
+
readonly room_ref: string;
|
|
104
|
+
readonly template?: {
|
|
105
|
+
readonly language: string;
|
|
106
|
+
readonly name: string;
|
|
107
|
+
};
|
|
108
|
+
readonly text?: string;
|
|
109
|
+
readonly values?: {
|
|
110
|
+
readonly [key: string]: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly result: {
|
|
114
|
+
readonly authority: string;
|
|
115
|
+
readonly log_epoch: string;
|
|
116
|
+
readonly path: string;
|
|
117
|
+
readonly position: string;
|
|
118
|
+
readonly room_ref: string;
|
|
119
|
+
readonly url: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
84
122
|
readonly "chats/return": {
|
|
85
123
|
readonly params: {
|
|
86
124
|
readonly path: string;
|
|
@@ -135,7 +173,6 @@ export interface HouseMethods {
|
|
|
135
173
|
readonly params: {
|
|
136
174
|
readonly agent_id: string;
|
|
137
175
|
readonly operation_id: string;
|
|
138
|
-
readonly replaces?: string;
|
|
139
176
|
};
|
|
140
177
|
readonly result: {
|
|
141
178
|
readonly agent_id: string;
|
|
@@ -159,16 +196,19 @@ export interface HouseMethods {
|
|
|
159
196
|
readonly position: string;
|
|
160
197
|
};
|
|
161
198
|
};
|
|
162
|
-
readonly "conversations/
|
|
199
|
+
readonly "conversations/end": {
|
|
163
200
|
readonly params: {
|
|
164
|
-
readonly conversation_id
|
|
201
|
+
readonly conversation_id: string;
|
|
165
202
|
readonly operation_id: string;
|
|
166
203
|
};
|
|
167
204
|
readonly result: {
|
|
168
205
|
readonly agent_id: string;
|
|
169
206
|
readonly authority: string;
|
|
170
207
|
readonly conversation_id: string;
|
|
171
|
-
readonly
|
|
208
|
+
readonly jobs: readonly {
|
|
209
|
+
readonly name: string;
|
|
210
|
+
readonly running_since: string;
|
|
211
|
+
}[];
|
|
172
212
|
readonly log_epoch: string;
|
|
173
213
|
readonly position: string;
|
|
174
214
|
readonly url: string;
|
|
@@ -233,7 +273,7 @@ export interface HouseMethods {
|
|
|
233
273
|
readonly type: "text";
|
|
234
274
|
})[];
|
|
235
275
|
readonly role: "assistant" | "house" | "user";
|
|
236
|
-
readonly sender?: "conversation" | "customer" | "owner" | "report" | "requester" | "trigger";
|
|
276
|
+
readonly sender?: "conversation" | "customer" | "owner" | "replier" | "report" | "requester" | "trigger";
|
|
237
277
|
readonly source?: {
|
|
238
278
|
readonly agent: {
|
|
239
279
|
readonly id: string;
|
|
@@ -274,6 +314,11 @@ export interface HouseMethods {
|
|
|
274
314
|
};
|
|
275
315
|
readonly request: string;
|
|
276
316
|
} | {
|
|
317
|
+
readonly agent_function: null | {
|
|
318
|
+
readonly id: string;
|
|
319
|
+
readonly name: string;
|
|
320
|
+
readonly version: number;
|
|
321
|
+
};
|
|
277
322
|
readonly approved_at: null | string;
|
|
278
323
|
readonly kind: "request";
|
|
279
324
|
readonly request: string;
|
|
@@ -291,11 +336,9 @@ export interface HouseMethods {
|
|
|
291
336
|
readonly ref: string;
|
|
292
337
|
readonly url: string;
|
|
293
338
|
};
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
readonly version: number;
|
|
298
|
-
};
|
|
339
|
+
} | {
|
|
340
|
+
readonly kind: "reply";
|
|
341
|
+
readonly name: string;
|
|
299
342
|
} | {
|
|
300
343
|
readonly kind: "trigger";
|
|
301
344
|
readonly path: null | string;
|
|
@@ -441,13 +484,10 @@ export interface HouseMethods {
|
|
|
441
484
|
};
|
|
442
485
|
readonly "records/read": {
|
|
443
486
|
readonly params: {
|
|
444
|
-
readonly cursor?: string;
|
|
445
|
-
readonly limit?: number;
|
|
446
487
|
readonly order?: "asc" | "desc";
|
|
447
488
|
readonly room_ref: string;
|
|
448
489
|
};
|
|
449
490
|
readonly result: {
|
|
450
|
-
readonly next_cursor?: string;
|
|
451
491
|
readonly records: readonly {
|
|
452
492
|
readonly body: null | string;
|
|
453
493
|
readonly claimed: unknown;
|
|
@@ -460,7 +500,6 @@ export interface HouseMethods {
|
|
|
460
500
|
readonly "rooms/access/read": {
|
|
461
501
|
readonly params: {
|
|
462
502
|
readonly room_ref: string;
|
|
463
|
-
readonly statistics?: boolean;
|
|
464
503
|
};
|
|
465
504
|
readonly result: {
|
|
466
505
|
readonly authority: "administrator" | "member" | "owner";
|
|
@@ -469,22 +508,20 @@ export interface HouseMethods {
|
|
|
469
508
|
readonly direct: readonly {
|
|
470
509
|
readonly level: null | "keep" | "open" | "search";
|
|
471
510
|
readonly namespace: string;
|
|
472
|
-
readonly operations: readonly ("
|
|
511
|
+
readonly operations: readonly ("erase" | "export" | "manageAccess" | "write")[];
|
|
473
512
|
}[];
|
|
474
|
-
readonly downloads_per_day?: number;
|
|
475
513
|
readonly entries: readonly {
|
|
476
514
|
readonly level: null | "keep" | "open" | "search";
|
|
477
515
|
readonly namespace: string;
|
|
478
|
-
readonly operations: readonly ("
|
|
516
|
+
readonly operations: readonly ("erase" | "export" | "manageAccess" | "write")[];
|
|
479
517
|
readonly sources: readonly {
|
|
480
518
|
readonly kind: "direct" | "inherited";
|
|
481
519
|
readonly level: null | "keep" | "open" | "search";
|
|
482
520
|
readonly namespace: string;
|
|
483
|
-
readonly operations: readonly ("
|
|
521
|
+
readonly operations: readonly ("erase" | "export" | "manageAccess" | "write")[];
|
|
484
522
|
}[];
|
|
485
523
|
}[];
|
|
486
524
|
readonly key: null | string;
|
|
487
|
-
readonly requests_per_day?: number;
|
|
488
525
|
readonly schema_roles: readonly string[];
|
|
489
526
|
readonly user: string;
|
|
490
527
|
readonly user_name: string;
|
|
@@ -492,22 +529,13 @@ export interface HouseMethods {
|
|
|
492
529
|
readonly namespaces: readonly string[];
|
|
493
530
|
readonly owner: string;
|
|
494
531
|
readonly room_ref: string;
|
|
495
|
-
readonly statistics?: readonly {
|
|
496
|
-
readonly day: string;
|
|
497
|
-
readonly downloads: number;
|
|
498
|
-
readonly requests: number;
|
|
499
|
-
readonly text_bytes: number;
|
|
500
|
-
readonly user: string;
|
|
501
|
-
}[];
|
|
502
532
|
readonly url: string;
|
|
503
533
|
readonly viewer: string;
|
|
504
534
|
};
|
|
505
535
|
};
|
|
506
536
|
readonly "rooms/members": {
|
|
507
537
|
readonly params: {
|
|
508
|
-
readonly cursor?: string;
|
|
509
538
|
readonly history?: boolean;
|
|
510
|
-
readonly limit?: number;
|
|
511
539
|
readonly room_ref: string;
|
|
512
540
|
};
|
|
513
541
|
readonly result: {
|
|
@@ -517,17 +545,16 @@ export interface HouseMethods {
|
|
|
517
545
|
readonly user: string;
|
|
518
546
|
}[];
|
|
519
547
|
readonly members: readonly {
|
|
520
|
-
readonly access?: "
|
|
548
|
+
readonly access?: "manage" | "owner" | "read" | "write";
|
|
549
|
+
readonly copies?: "online_only" | "search_only";
|
|
521
550
|
readonly display_name: string;
|
|
522
551
|
readonly email?: string;
|
|
523
552
|
readonly member_document: null | string;
|
|
524
|
-
readonly only_while_online?: true;
|
|
525
553
|
readonly owner: boolean;
|
|
526
554
|
readonly schema_roles?: readonly string[];
|
|
527
555
|
readonly since: null | string;
|
|
528
556
|
readonly user: string;
|
|
529
557
|
}[];
|
|
530
|
-
readonly next_cursor?: string;
|
|
531
558
|
};
|
|
532
559
|
};
|
|
533
560
|
readonly "rooms/settings/processing/read": {
|
|
@@ -563,21 +590,6 @@ export interface HouseMethods {
|
|
|
563
590
|
readonly writable: boolean;
|
|
564
591
|
};
|
|
565
592
|
};
|
|
566
|
-
readonly "routines/requests": {
|
|
567
|
-
readonly params: {
|
|
568
|
-
readonly room_ref: string;
|
|
569
|
-
};
|
|
570
|
-
readonly result: {
|
|
571
|
-
readonly current: readonly {
|
|
572
|
-
readonly document: string;
|
|
573
|
-
readonly name: string;
|
|
574
|
-
}[];
|
|
575
|
-
readonly history: readonly {
|
|
576
|
-
readonly document: string;
|
|
577
|
-
readonly name: string;
|
|
578
|
-
}[];
|
|
579
|
-
};
|
|
580
|
-
};
|
|
581
593
|
readonly "site/submission": {
|
|
582
594
|
readonly params: {
|
|
583
595
|
readonly content: string;
|
|
@@ -684,13 +696,13 @@ export interface HouseMethods {
|
|
|
684
696
|
readonly result: {
|
|
685
697
|
readonly events: readonly {
|
|
686
698
|
readonly actions: readonly ({
|
|
687
|
-
readonly cap: "address_submissions" | "app_sockets" | "environment_functions" | "export_starts" | "
|
|
699
|
+
readonly cap: "address_submissions" | "app_sockets" | "environment_functions" | "export_starts" | "kit_connections" | "live_shares" | "open_uploads" | "ownership_offers" | "push_addresses" | "push_deliveries" | "room_triggers" | "service_keys" | "share_creations" | "share_room_creations" | "site_rooms" | "slot_rooms" | "spaces" | "waiting_web_wizards" | "writes";
|
|
688
700
|
readonly code: "cap_reached";
|
|
689
701
|
readonly outcome: "refused";
|
|
690
702
|
readonly position: number;
|
|
691
703
|
readonly retry_at: string;
|
|
692
704
|
} | {
|
|
693
|
-
readonly cap: "address_submissions" | "app_sockets" | "environment_functions" | "export_starts" | "
|
|
705
|
+
readonly cap: "address_submissions" | "app_sockets" | "environment_functions" | "export_starts" | "kit_connections" | "live_shares" | "open_uploads" | "ownership_offers" | "push_addresses" | "push_deliveries" | "room_triggers" | "service_keys" | "share_creations" | "share_room_creations" | "site_rooms" | "slot_rooms" | "spaces" | "waiting_web_wizards" | "writes";
|
|
694
706
|
readonly code: "cap_reached";
|
|
695
707
|
readonly outcome: "refused";
|
|
696
708
|
readonly position: number;
|
|
@@ -745,21 +757,21 @@ export interface HouseMethods {
|
|
|
745
757
|
readonly value: string;
|
|
746
758
|
} | {
|
|
747
759
|
readonly code: "limit_reached";
|
|
748
|
-
readonly limit: "custom_domains" | "external_calls" | "
|
|
760
|
+
readonly limit: "custom_domains" | "external_calls" | "publish_data" | "sites";
|
|
749
761
|
readonly outcome: "refused";
|
|
750
762
|
readonly position: number;
|
|
751
763
|
readonly retry_at: string;
|
|
752
764
|
} | {
|
|
753
765
|
readonly code: "limit_reached";
|
|
754
|
-
readonly limit: "custom_domains" | "external_calls" | "
|
|
766
|
+
readonly limit: "custom_domains" | "external_calls" | "publish_data" | "sites";
|
|
755
767
|
readonly outcome: "refused";
|
|
756
768
|
readonly position: number;
|
|
757
769
|
} | {
|
|
758
|
-
readonly code: "
|
|
770
|
+
readonly code: "agent_function_not_found" | "agent_function_retired" | "app_function_not_found" | "app_not_found" | "environment_function_not_found" | "environment_offline" | "no_recipient" | "target_agent_unavailable";
|
|
759
771
|
readonly outcome: "no_target";
|
|
760
772
|
readonly position: number;
|
|
761
773
|
} | {
|
|
762
|
-
readonly code: "
|
|
774
|
+
readonly code: "agent_function_request_not_started" | "internal_error";
|
|
763
775
|
readonly outcome: "failed";
|
|
764
776
|
readonly position: number;
|
|
765
777
|
} | {
|
|
@@ -920,6 +932,11 @@ export interface HouseAppMessage {
|
|
|
920
932
|
}
|
|
921
933
|
export type HouseInstallation = Open<'accepted' | 'dismissed' | 'manual'>;
|
|
922
934
|
export type HouseNotifications = Open<'on' | 'off' | 'blocked' | 'unavailable'>;
|
|
935
|
+
export interface HouseTelegram {
|
|
936
|
+
readonly state: Open<'available' | 'linked' | 'unavailable'>;
|
|
937
|
+
readonly name: string | null;
|
|
938
|
+
readonly username: string | null;
|
|
939
|
+
}
|
|
923
940
|
export interface HouseCeremonyRefused extends Error {
|
|
924
941
|
readonly name: 'HouseCeremonyRefused';
|
|
925
942
|
readonly code: Open<'house_ceremony_refused'>;
|
|
@@ -969,6 +986,7 @@ export interface HouseBridge {
|
|
|
969
986
|
ceremony(path: string): Promise<never>;
|
|
970
987
|
install(): Promise<HouseInstallation>;
|
|
971
988
|
notifications(on?: boolean): Promise<HouseNotifications>;
|
|
989
|
+
telegram(link?: true): Promise<HouseTelegram>;
|
|
972
990
|
setBadge(unread: readonly string[]): Promise<void>;
|
|
973
991
|
setTab(tab: HouseTab): void;
|
|
974
992
|
sourceTop(app: string, release?: string): Promise<HouseSourceTop | HouseRefusal | null>;
|
|
@@ -78,4 +78,4 @@ export type PointerFacts = {
|
|
|
78
78
|
export declare function crossedFacts(facts: ValueFacts): ValueFacts[];
|
|
79
79
|
export declare function fieldFacts(definition: Definition, key: string): ValueFacts | undefined;
|
|
80
80
|
export declare function pointerFacts(definition: Definition, pointer: string): PointerFacts | undefined;
|
|
81
|
-
export declare function readSchema(text: string, provided?: VerifiedModel): VerifiedModel | Failure;
|
|
81
|
+
export declare function readSchema(text: string, provided?: VerifiedModel, checked?: boolean): VerifiedModel | Failure;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type Definition } from './definition.js';
|
|
2
|
+
import type { Candidate } from './query/match.js';
|
|
3
|
+
import type { Document, VerifiedModel } from './types.js';
|
|
4
|
+
export type FactKind = 'string' | 'number' | 'boolean' | 'date' | 'time' | 'enum' | 'reference';
|
|
5
|
+
type Scalar = string | number | boolean;
|
|
6
|
+
export type Fact = {
|
|
7
|
+
readonly kind: FactKind;
|
|
8
|
+
readonly value: Scalar;
|
|
9
|
+
readonly member?: string;
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: 'prose';
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'null';
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: 'unreadable';
|
|
16
|
+
} | {
|
|
17
|
+
readonly kind: 'list';
|
|
18
|
+
readonly items: readonly Fact[];
|
|
19
|
+
} | {
|
|
20
|
+
readonly kind: 'object';
|
|
21
|
+
readonly fields: Readonly<Record<string, Fact>>;
|
|
22
|
+
};
|
|
23
|
+
export type DocumentFacts = {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly path: string;
|
|
26
|
+
readonly type: string | null;
|
|
27
|
+
readonly fields: Readonly<Record<string, Fact>>;
|
|
28
|
+
readonly sections: readonly string[];
|
|
29
|
+
};
|
|
30
|
+
export declare const TEXT_FIELD = "/text";
|
|
31
|
+
export declare const WRITE_DOORS: readonly ['browser', 'agent', 'client', 'function'];
|
|
32
|
+
export type WriteDoor = (typeof WRITE_DOORS)[number];
|
|
33
|
+
export type Actor = {
|
|
34
|
+
readonly user?: string;
|
|
35
|
+
readonly site?: string;
|
|
36
|
+
readonly app?: string;
|
|
37
|
+
readonly door?: WriteDoor;
|
|
38
|
+
};
|
|
39
|
+
export type DocumentEvent = {
|
|
40
|
+
readonly before: DocumentFacts | null;
|
|
41
|
+
readonly after: DocumentFacts | null;
|
|
42
|
+
readonly changed: readonly string[];
|
|
43
|
+
readonly by: Actor;
|
|
44
|
+
readonly moved_between_rooms: boolean;
|
|
45
|
+
};
|
|
46
|
+
export type ItemFacts = {
|
|
47
|
+
readonly delivery: string;
|
|
48
|
+
readonly source: string | null;
|
|
49
|
+
readonly address: string | null;
|
|
50
|
+
readonly container: string | null;
|
|
51
|
+
readonly author: string | null;
|
|
52
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
53
|
+
readonly json: {
|
|
54
|
+
readonly value: unknown;
|
|
55
|
+
} | null;
|
|
56
|
+
};
|
|
57
|
+
export type MessageFacts = {
|
|
58
|
+
readonly sender: string;
|
|
59
|
+
readonly agent_function: string | null;
|
|
60
|
+
readonly path: string | null;
|
|
61
|
+
};
|
|
62
|
+
export type Resolved = {
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly member?: string;
|
|
65
|
+
};
|
|
66
|
+
export declare function facts(document: Pick<Document, 'type' | 'fields' | 'sections'>, at: {
|
|
67
|
+
readonly id: string;
|
|
68
|
+
readonly path: string;
|
|
69
|
+
}, model: VerifiedModel, resolve: (target: string) => Resolved | undefined): DocumentFacts;
|
|
70
|
+
export declare function prosePaths(facts: DocumentFacts): string[];
|
|
71
|
+
export declare function members(document: DocumentFacts, path: string): readonly string[];
|
|
72
|
+
export declare function pointed(value: unknown, pointer: string): unknown;
|
|
73
|
+
export declare function valuedChange(definition: Definition, pointer: string): boolean;
|
|
74
|
+
export declare function datePointers(definition: Definition): string[];
|
|
75
|
+
export declare function memberPointers(definition: Definition, memberType: string): string[];
|
|
76
|
+
export declare function candidateOf(document: DocumentFacts): Candidate;
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Document, ParseResult, VerifiedModel } from './types.js';
|
|
2
|
+
export type SavedFacts = {
|
|
3
|
+
readonly type: string;
|
|
4
|
+
readonly fields: Readonly<Record<string, unknown>>;
|
|
5
|
+
readonly links: readonly string[];
|
|
6
|
+
};
|
|
7
|
+
export type ReferenceTarget = {
|
|
8
|
+
readonly location: string;
|
|
9
|
+
readonly to: readonly string[];
|
|
10
|
+
readonly target: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function referenceTarget(file: string, value: string): string | null;
|
|
13
|
+
export declare function referenceTargets(document: Document, file: string, model: VerifiedModel): readonly ReferenceTarget[];
|
|
14
|
+
export declare function documentFacts(file: string, parsed: ParseResult, model: VerifiedModel): SavedFacts | null;
|
package/dist/mdmodel/index.d.ts
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { Actor,
|
|
1
|
+
export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
|
|
2
|
+
export type { Actor, DocumentEvent, DocumentFacts, Fact, FactKind, ItemFacts, MessageFacts, Resolved, WriteDoor, } from './event.js';
|
|
3
|
+
export { byCodePoint, compared, dated, fitsKind, instant, instantKey, KINDS, kindOf, kindWords, } from './kinds.js';
|
|
4
|
+
export type { Kind, Ordering } from './kinds.js';
|
|
5
|
+
export { bodied, cursorOf, decodedCursor, identityOf, invalid, known, placeText, planOf, QueryError, queryKey, } from './query/language.js';
|
|
6
|
+
export type { Clause, Continuation, Direction, DocumentQuery, DocumentShape, Filter, GroupQuery, GroupShape, HeldRooms, Key, KeyPlan, LocalQuery, OrderOptions, Place, Predicate, QueryErrorCode, QueryPlan, Related, RoomFacts, Scope, Select, Test, Value, Where, } from './query/language.js';
|
|
7
|
+
export { heldAt, matches } from './query/match.js';
|
|
8
|
+
export type { Candidate } from './query/match.js';
|
|
9
|
+
export { heldKind, indexed } from './query/rows.js';
|
|
10
|
+
export type { HeldKind, HeldLink, HeldValue, Indexed, Reach } from './query/rows.js';
|
|
11
|
+
export * as sql from './query/sql.js';
|
|
3
12
|
export { headingLines } from './blocks.js';
|
|
4
13
|
export type { HeadingLine } from './blocks.js';
|
|
5
14
|
export { divide } from './divide.js';
|
|
6
15
|
export { apply, bodyLinks, links, parse, parseFrontmatter, relativize, relativizeBody, relinkBody, serialize, } from './document.js';
|
|
16
|
+
export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
|
|
17
|
+
export type { ReferenceTarget, SavedFacts } from './facts.js';
|
|
7
18
|
export { HOUSE_FIELDS, MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } from './fields.js';
|
|
8
19
|
export { relative, retarget, roomPath, roomTarget, target } from './paths.js';
|
|
20
|
+
export { openPatternBudget } from './pattern.js';
|
|
9
21
|
export type { RoomTarget } from './paths.js';
|
|
10
22
|
export { MARKDOWN_SYNTAX_PROFILE } from './profile.js';
|
|
11
23
|
export { project } from './project.js';
|
|
12
24
|
export { references } from './references.js';
|
|
25
|
+
export { isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION } from './reserved.js';
|
|
13
26
|
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, } from './definition.js';
|
|
14
27
|
export type { Definition, FieldRules, JsonType, PatternFacts, PointerFacts, RuleValue, SectionSpec, Shape, Transition, ValueFacts, } from './definition.js';
|
|
15
|
-
export type { ApplyResult, BodyResult, Change, Division, DivisionContext, Document, DocumentCheck, Frontmatter, FrontmatterResult, Library, ModelVerification, Link, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, RoomReference, Span, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
|
|
16
|
-
export { assess, bodyRoomLinks, checkDocument, resolves, roomReferences,
|
|
28
|
+
export type { ApplyResult, BodyResult, Change, Division, DivisionContext, Document, DocumentCheck, Frontmatter, FrontmatterResult, Library, ModelVerification, Link, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, RoomReference, Span, TypedPath, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
|
|
29
|
+
export { assess, assessReferences, bodyRoomLinks, checkDocument, readTypes, resolves, roomReferences, validate, validating, verdicts, verify, } from './validate.js';
|
|
17
30
|
export type { Assessment, Verdicts } from './validate.js';
|
|
18
31
|
export { VERSION } from './version.js';
|
|
19
|
-
export { bodyAfterFrontmatter, equalValue, frontmatterValue } from './yaml.js';
|
|
32
|
+
export { bodyAfterFrontmatter, equalValue, frontmatterValue, plain } from './yaml.js';
|
|
20
33
|
export type { FrontmatterValue } from './yaml.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ValueFacts } from './definition.js';
|
|
2
|
+
export declare const KINDS: readonly ['string', 'number', 'integer', 'boolean', 'date', 'date-time', 'time', 'enum', 'reference'];
|
|
3
|
+
export type Kind = (typeof KINDS)[number];
|
|
4
|
+
export type Ordering = {
|
|
5
|
+
readonly direction: 'asc' | 'desc';
|
|
6
|
+
readonly nulls: 'first' | 'last';
|
|
7
|
+
readonly stringSort: 'lexical' | 'locale';
|
|
8
|
+
readonly locale: string | undefined;
|
|
9
|
+
readonly localeOptions: Intl.CollatorOptions | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare function kindOf(facts: ValueFacts): Kind | null;
|
|
12
|
+
export declare function fitsKind(kind: Kind, facts: ValueFacts, value: unknown): boolean;
|
|
13
|
+
export declare function kindWords(facts: ValueFacts | undefined): readonly string[];
|
|
14
|
+
export declare function dated(value: unknown): value is string;
|
|
15
|
+
export declare function instant(value: unknown): bigint | undefined;
|
|
16
|
+
export declare function instantKey(value: unknown): string | null;
|
|
17
|
+
export declare function byCodePoint(left: string, right: string): number;
|
|
18
|
+
export declare function compared(left: unknown, right: unknown, ordering: Ordering): number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const PATTERN_STATES = 1000;
|
|
2
|
+
export declare class PatternTooCostly extends Error {
|
|
3
|
+
}
|
|
4
|
+
export type Pattern = {
|
|
5
|
+
readonly test: (text: string) => boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function linearPattern(source: string): Pattern | null;
|
|
8
|
+
export declare function withLinearRegExp<T>(run: () => T): T;
|
|
9
|
+
export declare function openPatternBudget(): () => void;
|