@agentshouse/app-bridge 0.1.0-cc89b63ea2af8 → 0.1.0-cc8d8d8d298f8
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 +2 -2
- package/dist/index.d.ts +85 -16
- package/dist/mdmodel/document.d.ts +2 -1
- package/dist/mdmodel/event.d.ts +2 -2
- package/dist/mdmodel/index.d.ts +4 -4
- package/dist/mdmodel/query/language.d.ts +35 -4
- package/dist/mdmodel/types.d.ts +4 -0
- package/dist/mdruntime/actions.d.ts +19 -0
- package/dist/mdruntime/adapter.d.ts +7 -0
- package/dist/mdruntime/attached-model.d.ts +7 -0
- package/dist/mdruntime/bootstrap.d.ts +43 -0
- package/dist/mdruntime/cell.d.ts +5 -0
- package/dist/mdruntime/change.d.ts +1 -0
- package/dist/mdruntime/client.d.ts +12 -1
- package/dist/mdruntime/compile.d.ts +5 -0
- package/dist/mdruntime/conversation-live.d.ts +135 -0
- package/dist/mdruntime/conversation-row.d.ts +32 -0
- package/dist/mdruntime/conversation.d.ts +29 -34
- package/dist/mdruntime/durability.d.ts +9 -0
- package/dist/mdruntime/figures.d.ts +47 -0
- package/dist/mdruntime/holdings.d.ts +28 -0
- package/dist/mdruntime/install.d.ts +55 -0
- package/dist/mdruntime/job.d.ts +32 -0
- package/dist/mdruntime/listing.d.ts +52 -0
- package/dist/mdruntime/live.d.ts +22 -0
- package/dist/mdruntime/log.d.ts +5 -0
- package/dist/mdruntime/messages.d.ts +25 -1
- package/dist/mdruntime/model.d.ts +0 -2
- package/dist/mdruntime/outcome.d.ts +4 -1
- package/dist/mdruntime/overlay.d.ts +1 -0
- package/dist/mdruntime/preparation.d.ts +19 -0
- package/dist/mdruntime/query.d.ts +10 -0
- package/dist/mdruntime/reach.d.ts +8 -6
- package/dist/mdruntime/reads.d.ts +36 -0
- package/dist/mdruntime/refresh.d.ts +26 -0
- package/dist/mdruntime/replica.d.ts +0 -3
- package/dist/mdruntime/room-drafts.d.ts +23 -0
- package/dist/mdruntime/runtime.d.ts +42 -0
- package/dist/mdruntime/save.d.ts +3 -1
- package/dist/mdruntime/saves.d.ts +69 -0
- package/dist/mdruntime/seed.d.ts +11 -2
- package/dist/mdruntime/socket/admission.d.ts +6 -0
- package/dist/mdruntime/socket/answers.d.ts +5 -0
- package/dist/mdruntime/socket/lanes.d.ts +19 -0
- package/dist/mdruntime/socket/rooms.d.ts +42 -0
- package/dist/mdruntime/socket/session.d.ts +38 -0
- package/dist/mdruntime/socket.d.ts +69 -0
- package/dist/mdruntime/source.d.ts +60 -0
- package/dist/mdruntime/status.d.ts +0 -2
- package/dist/mdruntime/store/fences.d.ts +15 -0
- package/dist/mdruntime/store/installs.d.ts +29 -0
- package/dist/mdruntime/store/readiness.d.ts +9 -0
- package/dist/mdruntime/store/records.d.ts +211 -0
- package/dist/mdruntime/store/room-held.d.ts +7 -0
- package/dist/mdruntime/store/space.d.ts +10 -0
- package/dist/mdruntime/store/watchers.d.ts +16 -0
- package/dist/mdruntime/store/writes.d.ts +23 -0
- package/dist/mdruntime/store.d.ts +115 -154
- package/dist/mdruntime/stored.d.ts +42 -24
- package/dist/mdruntime/surface.d.ts +87 -0
- package/dist/mdruntime/tables.d.ts +104 -13
- package/dist/mdruntime/tallies.d.ts +17 -0
- package/dist/mdruntime/transfer.d.ts +4 -0
- package/dist/mdruntime/turn.d.ts +8 -0
- package/dist/mdruntime/wire.d.ts +8 -1
- package/package.json +1 -1
- package/dist/mdruntime/connection.d.ts +0 -154
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ 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
|
|
13
13
|
the App imports, constructs and bundles neither: `bridge.runtime` resolves to the client.
|
|
14
14
|
|
|
15
|
-
House's guide to building an App is its Guide's `apps/` pages, which `
|
|
15
|
+
House's guide to building an App is its Guide's `apps/` pages, which `guide/open` opens.
|
|
16
16
|
|
|
17
17
|
## Use
|
|
18
18
|
|
|
@@ -42,7 +42,7 @@ async function manageSecurity(securityPath) {
|
|
|
42
42
|
|
|
43
43
|
`bridge.runtime` resolves to the `MdRuntimeClient` of `@agentshouse/mdruntime/client`,
|
|
44
44
|
whose README describes its members. Its `call(method, params)` is a remote procedure call
|
|
45
|
-
to a House act by its name, such as `call('rooms/members', { room_ref })`: `HouseMethods`
|
|
45
|
+
to a House act by its name, such as `call('rooms/members/list', { room_ref })`: `HouseMethods`
|
|
46
46
|
names each with House's own input, `HouseParams<Name>`, and answer, `HouseResult<Name>`.
|
|
47
47
|
|
|
48
48
|
## Test without a House
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MdRuntimeClient, Open } from './mdruntime/client.js';
|
|
2
2
|
export interface HouseMethods {
|
|
3
|
-
readonly "agent-functions/requests": {
|
|
3
|
+
readonly "agent-functions/requests/list": {
|
|
4
4
|
readonly params: {
|
|
5
5
|
readonly room_ref: string;
|
|
6
6
|
};
|
|
@@ -15,7 +15,7 @@ export interface HouseMethods {
|
|
|
15
15
|
}[];
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
readonly "apps/features/
|
|
18
|
+
readonly "apps/features/list": {
|
|
19
19
|
readonly params: {};
|
|
20
20
|
readonly result: {
|
|
21
21
|
readonly features: readonly {
|
|
@@ -24,11 +24,10 @@ export interface HouseMethods {
|
|
|
24
24
|
}[];
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
readonly "apps/holders": {
|
|
27
|
+
readonly "apps/holders/list": {
|
|
28
28
|
readonly params: {};
|
|
29
29
|
readonly result: {
|
|
30
30
|
readonly holders: readonly {
|
|
31
|
-
readonly email: string;
|
|
32
31
|
readonly name: string;
|
|
33
32
|
readonly user: string;
|
|
34
33
|
}[];
|
|
@@ -43,7 +42,7 @@ export interface HouseMethods {
|
|
|
43
42
|
readonly [key: string]: never;
|
|
44
43
|
};
|
|
45
44
|
};
|
|
46
|
-
readonly "apps/relay": {
|
|
45
|
+
readonly "apps/relay/read": {
|
|
47
46
|
readonly params: {
|
|
48
47
|
readonly [key: string]: never;
|
|
49
48
|
};
|
|
@@ -73,6 +72,7 @@ export interface HouseMethods {
|
|
|
73
72
|
} | {
|
|
74
73
|
readonly user: string;
|
|
75
74
|
};
|
|
75
|
+
readonly operation_id: string;
|
|
76
76
|
readonly path: string;
|
|
77
77
|
readonly room_ref: string;
|
|
78
78
|
};
|
|
@@ -146,6 +146,7 @@ export interface HouseMethods {
|
|
|
146
146
|
};
|
|
147
147
|
readonly "chats/take-control": {
|
|
148
148
|
readonly params: {
|
|
149
|
+
readonly operation_id: string;
|
|
149
150
|
readonly path: string;
|
|
150
151
|
readonly room_ref: string;
|
|
151
152
|
};
|
|
@@ -214,7 +215,7 @@ export interface HouseMethods {
|
|
|
214
215
|
readonly url: string;
|
|
215
216
|
};
|
|
216
217
|
};
|
|
217
|
-
readonly "conversations/history": {
|
|
218
|
+
readonly "conversations/history/list": {
|
|
218
219
|
readonly params: {
|
|
219
220
|
readonly conversations: readonly {
|
|
220
221
|
readonly after?: {
|
|
@@ -355,6 +356,12 @@ export interface HouseMethods {
|
|
|
355
356
|
};
|
|
356
357
|
readonly telegram_undelivered?: true;
|
|
357
358
|
readonly text: string;
|
|
359
|
+
readonly tokens?: {
|
|
360
|
+
readonly cache_read: number;
|
|
361
|
+
readonly cache_write: number;
|
|
362
|
+
readonly input: number;
|
|
363
|
+
readonly output: number;
|
|
364
|
+
};
|
|
358
365
|
readonly transcripts?: readonly {
|
|
359
366
|
readonly path: string;
|
|
360
367
|
readonly text: string;
|
|
@@ -418,7 +425,7 @@ export interface HouseMethods {
|
|
|
418
425
|
readonly url: string;
|
|
419
426
|
};
|
|
420
427
|
};
|
|
421
|
-
readonly "conversations/option": {
|
|
428
|
+
readonly "conversations/option/set": {
|
|
422
429
|
readonly params: {
|
|
423
430
|
readonly conversation_id: string;
|
|
424
431
|
readonly operation_id: string;
|
|
@@ -482,7 +489,7 @@ export interface HouseMethods {
|
|
|
482
489
|
readonly url: string;
|
|
483
490
|
};
|
|
484
491
|
};
|
|
485
|
-
readonly "records/
|
|
492
|
+
readonly "records/list": {
|
|
486
493
|
readonly params: {
|
|
487
494
|
readonly order?: "asc" | "desc";
|
|
488
495
|
readonly room_ref: string;
|
|
@@ -497,7 +504,7 @@ export interface HouseMethods {
|
|
|
497
504
|
}[];
|
|
498
505
|
};
|
|
499
506
|
};
|
|
500
|
-
readonly "rooms/access/
|
|
507
|
+
readonly "rooms/access/list": {
|
|
501
508
|
readonly params: {
|
|
502
509
|
readonly room_ref: string;
|
|
503
510
|
};
|
|
@@ -523,6 +530,7 @@ export interface HouseMethods {
|
|
|
523
530
|
}[];
|
|
524
531
|
readonly key: null | string;
|
|
525
532
|
readonly schema_roles: readonly string[];
|
|
533
|
+
readonly through_space?: true;
|
|
526
534
|
readonly user: string;
|
|
527
535
|
readonly user_name: string;
|
|
528
536
|
}[];
|
|
@@ -533,7 +541,7 @@ export interface HouseMethods {
|
|
|
533
541
|
readonly viewer: string;
|
|
534
542
|
};
|
|
535
543
|
};
|
|
536
|
-
readonly "rooms/members": {
|
|
544
|
+
readonly "rooms/members/list": {
|
|
537
545
|
readonly params: {
|
|
538
546
|
readonly history?: boolean;
|
|
539
547
|
readonly room_ref: string;
|
|
@@ -553,6 +561,7 @@ export interface HouseMethods {
|
|
|
553
561
|
readonly owner: boolean;
|
|
554
562
|
readonly schema_roles?: readonly string[];
|
|
555
563
|
readonly since: null | string;
|
|
564
|
+
readonly through_space?: true;
|
|
556
565
|
readonly user: string;
|
|
557
566
|
}[];
|
|
558
567
|
};
|
|
@@ -590,7 +599,7 @@ export interface HouseMethods {
|
|
|
590
599
|
readonly writable: boolean;
|
|
591
600
|
};
|
|
592
601
|
};
|
|
593
|
-
readonly "
|
|
602
|
+
readonly "sites/submissions/create": {
|
|
594
603
|
readonly params: {
|
|
595
604
|
readonly content: string;
|
|
596
605
|
};
|
|
@@ -598,9 +607,10 @@ export interface HouseMethods {
|
|
|
598
607
|
readonly submitted: true;
|
|
599
608
|
};
|
|
600
609
|
};
|
|
601
|
-
readonly "storage/inventory": {
|
|
610
|
+
readonly "storage/inventory/read": {
|
|
602
611
|
readonly params: {
|
|
603
612
|
readonly room_ref?: string;
|
|
613
|
+
readonly rooms?: "owned";
|
|
604
614
|
};
|
|
605
615
|
readonly result: {
|
|
606
616
|
readonly blob: {
|
|
@@ -652,6 +662,35 @@ export interface HouseMethods {
|
|
|
652
662
|
readonly layout: string;
|
|
653
663
|
};
|
|
654
664
|
};
|
|
665
|
+
readonly rooms?: readonly {
|
|
666
|
+
readonly blob: {
|
|
667
|
+
readonly bytes: string;
|
|
668
|
+
readonly gigabytes: string;
|
|
669
|
+
};
|
|
670
|
+
readonly freshness: {
|
|
671
|
+
readonly state: "settled";
|
|
672
|
+
};
|
|
673
|
+
readonly indexed_text: {
|
|
674
|
+
readonly approximate_pages: null | string;
|
|
675
|
+
readonly bytes: string;
|
|
676
|
+
readonly gigabytes: string;
|
|
677
|
+
};
|
|
678
|
+
readonly measurement: {
|
|
679
|
+
readonly page_reference: null | {
|
|
680
|
+
readonly bytes_per_page: string;
|
|
681
|
+
readonly encoding: string;
|
|
682
|
+
readonly font: string;
|
|
683
|
+
readonly font_size_pt: string;
|
|
684
|
+
readonly layout: string;
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
readonly room_ref: string;
|
|
688
|
+
readonly total: {
|
|
689
|
+
readonly bytes: string;
|
|
690
|
+
readonly gigabytes: string;
|
|
691
|
+
};
|
|
692
|
+
readonly url: string;
|
|
693
|
+
}[];
|
|
655
694
|
readonly site_images: {
|
|
656
695
|
readonly bound: string;
|
|
657
696
|
readonly bytes: string;
|
|
@@ -683,26 +722,55 @@ export interface HouseMethods {
|
|
|
683
722
|
readonly layout: string;
|
|
684
723
|
};
|
|
685
724
|
};
|
|
725
|
+
readonly rooms?: readonly {
|
|
726
|
+
readonly blob: {
|
|
727
|
+
readonly bytes: string;
|
|
728
|
+
readonly gigabytes: string;
|
|
729
|
+
};
|
|
730
|
+
readonly freshness: {
|
|
731
|
+
readonly state: "settled";
|
|
732
|
+
};
|
|
733
|
+
readonly indexed_text: {
|
|
734
|
+
readonly approximate_pages: null | string;
|
|
735
|
+
readonly bytes: string;
|
|
736
|
+
readonly gigabytes: string;
|
|
737
|
+
};
|
|
738
|
+
readonly measurement: {
|
|
739
|
+
readonly page_reference: null | {
|
|
740
|
+
readonly bytes_per_page: string;
|
|
741
|
+
readonly encoding: string;
|
|
742
|
+
readonly font: string;
|
|
743
|
+
readonly font_size_pt: string;
|
|
744
|
+
readonly layout: string;
|
|
745
|
+
};
|
|
746
|
+
};
|
|
747
|
+
readonly room_ref: string;
|
|
748
|
+
readonly total: {
|
|
749
|
+
readonly bytes: string;
|
|
750
|
+
readonly gigabytes: string;
|
|
751
|
+
};
|
|
752
|
+
readonly url: string;
|
|
753
|
+
}[];
|
|
686
754
|
readonly total: {
|
|
687
755
|
readonly bytes: string;
|
|
688
756
|
readonly gigabytes: string;
|
|
689
757
|
};
|
|
690
758
|
};
|
|
691
759
|
};
|
|
692
|
-
readonly "triggers/fired": {
|
|
760
|
+
readonly "triggers/fired/list": {
|
|
693
761
|
readonly params: {
|
|
694
|
-
readonly room_ref
|
|
762
|
+
readonly room_ref?: string;
|
|
695
763
|
};
|
|
696
764
|
readonly result: {
|
|
697
765
|
readonly events: readonly {
|
|
698
766
|
readonly actions: readonly ({
|
|
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";
|
|
767
|
+
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_published_bytes" | "site_rooms" | "slot_rooms" | "spaces" | "waiting_web_wizards" | "writes";
|
|
700
768
|
readonly code: "cap_reached";
|
|
701
769
|
readonly outcome: "refused";
|
|
702
770
|
readonly position: number;
|
|
703
771
|
readonly retry_at: string;
|
|
704
772
|
} | {
|
|
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";
|
|
773
|
+
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_published_bytes" | "site_rooms" | "slot_rooms" | "spaces" | "waiting_web_wizards" | "writes";
|
|
706
774
|
readonly code: "cap_reached";
|
|
707
775
|
readonly outcome: "refused";
|
|
708
776
|
readonly position: number;
|
|
@@ -825,6 +893,7 @@ export interface HouseMethods {
|
|
|
825
893
|
readonly missed?: "failed" | "skipped";
|
|
826
894
|
readonly moment?: string;
|
|
827
895
|
readonly path?: string;
|
|
896
|
+
readonly room_ref?: string;
|
|
828
897
|
readonly trigger: string;
|
|
829
898
|
readonly url?: string;
|
|
830
899
|
}[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Definition } from './definition.js';
|
|
2
2
|
import { type LinkInventory } from './links.js';
|
|
3
|
-
import type { ApplyResult, BodyResult, FrontmatterResult, Change, Document, Link, ParseResult } from './types.js';
|
|
3
|
+
import type { ApplyResult, BodyResult, FrontmatterResult, Change, Document, Link, ParseResult, UnlinkedBody } from './types.js';
|
|
4
4
|
import { type YamlMap } from './yaml.js';
|
|
5
5
|
export declare function inventoryOf(document: Document): LinkInventory;
|
|
6
6
|
export declare function parseFrontmatter(content: string, file?: string): FrontmatterResult;
|
|
@@ -8,6 +8,7 @@ export declare function parse(content: string, file?: string): ParseResult;
|
|
|
8
8
|
export declare function relativize(document: Document, file: string, handle: string, definition?: Definition, kept?: ReadonlySet<string>): ApplyResult;
|
|
9
9
|
export declare function relativizeBody(body: string, file: string, handle: string): BodyResult;
|
|
10
10
|
export declare function relinkBody(body: string, file: string, moves: ReadonlyMap<string, string>): BodyResult;
|
|
11
|
+
export declare function unlinkBody(body: string, hrefs: ReadonlySet<string>): UnlinkedBody;
|
|
11
12
|
export declare function links(document: Document, file: string): readonly Link[];
|
|
12
13
|
export declare function bodyLinks(body: string, file: string): readonly Link[];
|
|
13
14
|
export declare function apply(document: Document, changes: readonly Change[]): ApplyResult;
|
package/dist/mdmodel/event.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type Definition } from './definition.js';
|
|
2
|
+
import { type Kind } from './kinds.js';
|
|
2
3
|
import type { Candidate } from './query/match.js';
|
|
3
4
|
import type { Document, VerifiedModel } from './types.js';
|
|
4
|
-
export type FactKind = 'string' | 'number' | 'boolean' | 'date' | 'time' | 'enum' | 'reference';
|
|
5
5
|
type Scalar = string | number | boolean;
|
|
6
6
|
export type Fact = {
|
|
7
|
-
readonly kind:
|
|
7
|
+
readonly kind: Kind;
|
|
8
8
|
readonly value: Scalar;
|
|
9
9
|
readonly member?: string;
|
|
10
10
|
} | {
|
package/dist/mdmodel/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
|
|
2
|
-
export type { Actor, DocumentEvent, DocumentFacts, Fact,
|
|
2
|
+
export type { Actor, DocumentEvent, DocumentFacts, Fact, ItemFacts, MessageFacts, Resolved, WriteDoor, } from './event.js';
|
|
3
3
|
export { byCodePoint, compared, dated, fitsKind, instant, instantKey, KINDS, kindOf, kindWords, } from './kinds.js';
|
|
4
4
|
export type { Kind, Ordering } from './kinds.js';
|
|
5
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';
|
|
6
|
+
export type { Clause, Continuation, Direction, DocumentQuery, DocumentShape, Filter, GroupKey, GroupOrder, GroupQuery, GroupSelect, GroupShape, HeldRooms, Key, KeyPlan, LocalQuery, OrderOptions, Place, Predicate, QueryErrorCode, QueryPlan, Related, RoomFacts, Scope, Select, Test, Value, Where, } from './query/language.js';
|
|
7
7
|
export { heldAt, matches } from './query/match.js';
|
|
8
8
|
export type { Candidate } from './query/match.js';
|
|
9
9
|
export { heldKind, indexed } from './query/rows.js';
|
|
@@ -12,7 +12,7 @@ export * as sql from './query/sql.js';
|
|
|
12
12
|
export { headingLines } from './blocks.js';
|
|
13
13
|
export type { HeadingLine } from './blocks.js';
|
|
14
14
|
export { divide } from './divide.js';
|
|
15
|
-
export { apply, bodyLinks, links, parse, parseFrontmatter, relativize, relativizeBody, relinkBody, serialize, } from './document.js';
|
|
15
|
+
export { apply, bodyLinks, links, parse, parseFrontmatter, relativize, relativizeBody, relinkBody, serialize, unlinkBody, } from './document.js';
|
|
16
16
|
export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
|
|
17
17
|
export type { ReferenceTarget, SavedFacts } from './facts.js';
|
|
18
18
|
export { HOUSE_FIELDS, MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } from './fields.js';
|
|
@@ -25,7 +25,7 @@ export { references } from './references.js';
|
|
|
25
25
|
export { isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION } from './reserved.js';
|
|
26
26
|
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, } from './definition.js';
|
|
27
27
|
export type { Definition, FieldRules, JsonType, PatternFacts, PointerFacts, RuleValue, SectionSpec, Shape, Transition, ValueFacts, } from './definition.js';
|
|
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';
|
|
28
|
+
export type { ApplyResult, BodyResult, Change, Division, DivisionContext, Document, DocumentCheck, Frontmatter, FrontmatterResult, Library, ModelVerification, Link, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, RoomReference, Span, TypedPath, UnlinkedBody, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
|
|
29
29
|
export { assess, assessReferences, bodyRoomLinks, checkDocument, readTypes, resolves, roomReferences, validate, validating, verdicts, verify, } from './validate.js';
|
|
30
30
|
export type { Assessment, Verdicts } from './validate.js';
|
|
31
31
|
export { VERSION } from './version.js';
|
|
@@ -37,6 +37,7 @@ export type Filter = {
|
|
|
37
37
|
types?: readonly string[];
|
|
38
38
|
where?: Where;
|
|
39
39
|
pathPrefix?: string;
|
|
40
|
+
outside?: readonly string[];
|
|
40
41
|
folder?: string;
|
|
41
42
|
paths?: readonly string[];
|
|
42
43
|
fileIds?: readonly string[];
|
|
@@ -48,7 +49,10 @@ export type Filter = {
|
|
|
48
49
|
};
|
|
49
50
|
text?: string;
|
|
50
51
|
};
|
|
51
|
-
export type Key = 'room' | 'path' | 'type' | 'folder' | {
|
|
52
|
+
export type Key = 'room' | 'path' | 'type' | 'folder' | 'size' | 'created' | 'updated' | {
|
|
53
|
+
field: string;
|
|
54
|
+
};
|
|
55
|
+
export type GroupKey = 'room' | 'type' | 'folder' | 'subfolder' | {
|
|
52
56
|
field: string;
|
|
53
57
|
};
|
|
54
58
|
export type Select = 'all' | {
|
|
@@ -60,7 +64,17 @@ export type Select = 'all' | {
|
|
|
60
64
|
change?: true;
|
|
61
65
|
fileId?: true;
|
|
62
66
|
revision?: true;
|
|
67
|
+
size?: true;
|
|
68
|
+
created?: true;
|
|
69
|
+
};
|
|
70
|
+
export type GroupSelect = {
|
|
71
|
+
size?: true;
|
|
72
|
+
updated?: true;
|
|
73
|
+
greatest?: {
|
|
74
|
+
field: string;
|
|
75
|
+
};
|
|
63
76
|
};
|
|
77
|
+
export type GroupOrder = 'count' | 'size' | 'updated' | 'greatest';
|
|
64
78
|
export type OrderOptions = {
|
|
65
79
|
nulls?: 'first' | 'last';
|
|
66
80
|
stringSort?: 'lexical' | 'locale';
|
|
@@ -79,10 +93,12 @@ export type DocumentQuery = Filter & {
|
|
|
79
93
|
total?: true;
|
|
80
94
|
};
|
|
81
95
|
export type GroupQuery = Filter & {
|
|
82
|
-
groupBy: readonly
|
|
96
|
+
groupBy: readonly GroupKey[];
|
|
97
|
+
select?: GroupSelect;
|
|
83
98
|
orderBy?: readonly {
|
|
84
|
-
by:
|
|
99
|
+
by: GroupOrder | GroupKey;
|
|
85
100
|
direction?: Direction;
|
|
101
|
+
nulls?: 'first' | 'last';
|
|
86
102
|
}[];
|
|
87
103
|
limit?: number;
|
|
88
104
|
after?: string;
|
|
@@ -148,6 +164,14 @@ export type KeyPlan = {
|
|
|
148
164
|
of: 'type';
|
|
149
165
|
} | {
|
|
150
166
|
of: 'folder';
|
|
167
|
+
} | {
|
|
168
|
+
of: 'subfolder';
|
|
169
|
+
} | {
|
|
170
|
+
of: 'size';
|
|
171
|
+
} | {
|
|
172
|
+
of: 'created';
|
|
173
|
+
} | {
|
|
174
|
+
of: 'updated';
|
|
151
175
|
} | {
|
|
152
176
|
of: 'field';
|
|
153
177
|
field: string;
|
|
@@ -162,6 +186,8 @@ export type DocumentShape = {
|
|
|
162
186
|
change: boolean;
|
|
163
187
|
fileId: boolean;
|
|
164
188
|
revision: boolean;
|
|
189
|
+
size: boolean;
|
|
190
|
+
created: boolean;
|
|
165
191
|
orderBy: readonly {
|
|
166
192
|
key: KeyPlan;
|
|
167
193
|
options: OrderOptions & {
|
|
@@ -172,9 +198,13 @@ export type DocumentShape = {
|
|
|
172
198
|
export type GroupShape = {
|
|
173
199
|
kind: 'groups';
|
|
174
200
|
groupBy: readonly KeyPlan[];
|
|
201
|
+
size: boolean;
|
|
202
|
+
updated: boolean;
|
|
203
|
+
greatest: string | null;
|
|
175
204
|
orderBy: readonly {
|
|
176
|
-
by:
|
|
205
|
+
by: GroupOrder | number;
|
|
177
206
|
direction: Direction;
|
|
207
|
+
nulls: 'first' | 'last' | null;
|
|
178
208
|
}[];
|
|
179
209
|
};
|
|
180
210
|
export type Continuation = {
|
|
@@ -185,6 +215,7 @@ export type QueryPlan = {
|
|
|
185
215
|
key: string;
|
|
186
216
|
rooms: readonly string[] | null;
|
|
187
217
|
root: Scope;
|
|
218
|
+
outside: readonly string[] | null;
|
|
188
219
|
folder: string | null;
|
|
189
220
|
paths: readonly string[] | null;
|
|
190
221
|
fileIds: readonly string[] | null;
|
package/dist/mdmodel/types.d.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ConversationHistoryRequest } from './adapter.js';
|
|
2
|
+
import { type CallResult, type HistoryAnswer, type Resolution } from './outcome.js';
|
|
3
|
+
import type { Attempted } from './recovery.js';
|
|
4
|
+
import type { Runtime } from './runtime.js';
|
|
5
|
+
export type HistoryQuery = {
|
|
6
|
+
revision?: string;
|
|
7
|
+
pageToken?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function readHistory(runtime: Runtime, locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
|
|
10
|
+
export declare function located(runtime: Runtime, room: string, path: string, destination: string): Promise<{
|
|
11
|
+
room: string;
|
|
12
|
+
path: string;
|
|
13
|
+
} | null>;
|
|
14
|
+
export declare function resolveReference(runtime: Runtime, room: string, path: string, destination: string): Promise<Resolution>;
|
|
15
|
+
export declare function invokeAction(runtime: Runtime, name: string, input: unknown, dispatching?: () => Promise<void>): Promise<CallResult>;
|
|
16
|
+
export declare function readConversationHistory(runtime: Runtime, request: ConversationHistoryRequest): Promise<CallResult>;
|
|
17
|
+
export declare function called(runtime: Runtime, name: string, input: unknown): Promise<CallResult>;
|
|
18
|
+
export declare function resendCalls(runtime: Runtime, signal: AbortSignal): Promise<Attempted>;
|
|
19
|
+
export declare function resendLater(runtime: Runtime): void;
|
|
@@ -310,6 +310,7 @@ export type BootstrapPage = {
|
|
|
310
310
|
facts: Readonly<Record<string, SavedFacts>>;
|
|
311
311
|
revisions: Readonly<Record<string, string>>;
|
|
312
312
|
fileIds?: Readonly<Record<string, string>>;
|
|
313
|
+
created?: Readonly<Record<string, string>>;
|
|
313
314
|
changes: Readonly<Record<string, HeadChange>>;
|
|
314
315
|
binaryFiles: Readonly<Record<string, BinaryFile>>;
|
|
315
316
|
folders?: readonly string[];
|
|
@@ -337,6 +338,7 @@ export type RefreshPage = {
|
|
|
337
338
|
facts: Readonly<Record<string, SavedFacts>>;
|
|
338
339
|
revisions: Readonly<Record<string, string>>;
|
|
339
340
|
fileIds?: Readonly<Record<string, string>>;
|
|
341
|
+
created?: Readonly<Record<string, string>>;
|
|
340
342
|
changes: Readonly<Record<string, HeadChange>>;
|
|
341
343
|
binaryFiles: Readonly<Record<string, BinaryFile>>;
|
|
342
344
|
removals: readonly string[];
|
|
@@ -466,6 +468,7 @@ export type ActionResult = {
|
|
|
466
468
|
at?: RoomVersionAt;
|
|
467
469
|
} | (ProviderRefusal & {
|
|
468
470
|
kind: 'rejected';
|
|
471
|
+
reset?: string;
|
|
469
472
|
}) | AdapterFailure;
|
|
470
473
|
export type SearchHit = {
|
|
471
474
|
room: string;
|
|
@@ -518,11 +521,15 @@ export type RoomStream = {
|
|
|
518
521
|
hold(rooms: readonly HeldRoom[]): void;
|
|
519
522
|
observe(notify: (event: RoomStreamEvent) => void): () => void;
|
|
520
523
|
};
|
|
524
|
+
export type PathRule = (path: string) => boolean;
|
|
521
525
|
export type Adapter = {
|
|
522
526
|
readonly localSaves?: true;
|
|
523
527
|
readonly roomTypes?: string;
|
|
524
528
|
readonly nameableRoomTypes?: readonly string[];
|
|
525
529
|
readonly typedPaths?: readonly TypedPath[];
|
|
530
|
+
readonly pathRule?: PathRule;
|
|
531
|
+
readonly unkeptReads?: readonly string[];
|
|
532
|
+
readonly leadingReads?: readonly string[];
|
|
526
533
|
authorize(): Promise<Authorization>;
|
|
527
534
|
discover?(authorization: Authorization): Promise<DiscoverResult>;
|
|
528
535
|
bootstrap(authorization: Authorization, request: BootstrapRequest): Promise<BootstrapResult>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type VerifiedModel } from '../mdmodel/index.js';
|
|
2
|
+
import type { ModelResult, ModelState } from './model.js';
|
|
3
|
+
export declare const NO_ROOM_TYPES: VerifiedModel;
|
|
4
|
+
export declare function roomTypesOf(schema: string | undefined, nameable?: readonly string[]): VerifiedModel;
|
|
5
|
+
export declare function builtInModel(roomTypes: VerifiedModel): ModelState;
|
|
6
|
+
export declare function schemaTypes(schema: string | null, roomTypes: VerifiedModel): VerifiedModel['types'];
|
|
7
|
+
export declare function attachedModel(answer: ModelResult, roomTypes: VerifiedModel): ModelState;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ModelState } from './model.js';
|
|
2
|
+
import type { Adapter, TypedPath, AdapterFailure, Authorization, BootstrapPart, DiscoveredRoom, NotReady, RetryableRefusal, RoomModels } from './adapter.js';
|
|
3
|
+
import type { Composition } from './collection.js';
|
|
4
|
+
import type { InstallationStep } from './readiness.js';
|
|
5
|
+
import { type Refreshing } from './refresh.js';
|
|
6
|
+
import type { ReplicaRecord } from './replica.js';
|
|
7
|
+
import type { StagedPage, TransferRecord } from './store.js';
|
|
8
|
+
import { type Unconfirmed } from './transfer.js';
|
|
9
|
+
export type Bootstrapped = {
|
|
10
|
+
kind: 'staged';
|
|
11
|
+
record: ReplicaRecord;
|
|
12
|
+
refreshed: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type BootstrapOutcome = Bootstrapped | Unconfirmed | NotReady | RetryableRefusal | AdapterFailure;
|
|
15
|
+
export type HeldModels = {
|
|
16
|
+
collection: ModelState;
|
|
17
|
+
};
|
|
18
|
+
export type Remodel = (models: RoomModels | undefined, held: HeldModels) => HeldModels;
|
|
19
|
+
export type Reads = Pick<Adapter, 'bootstrap' | 'refresh' | 'reached'>;
|
|
20
|
+
export type Arriving = {
|
|
21
|
+
at(bytes: number): void;
|
|
22
|
+
end(): void;
|
|
23
|
+
};
|
|
24
|
+
export type Resumed = {
|
|
25
|
+
readonly record: TransferRecord | null;
|
|
26
|
+
readonly staged: ReadonlySet<string>;
|
|
27
|
+
};
|
|
28
|
+
export type Staging = {
|
|
29
|
+
held(locator: string): TransferRecord | null;
|
|
30
|
+
turn(locator: string, step: InstallationStep): Promise<() => void>;
|
|
31
|
+
unqueued(): Promise<void>;
|
|
32
|
+
queued(text: number): () => void;
|
|
33
|
+
arriving(locator: string): Arriving;
|
|
34
|
+
readonly streamed: boolean;
|
|
35
|
+
stage(record: TransferRecord, page: StagedPage, composition: Composition): Promise<TransferRecord | null>;
|
|
36
|
+
resume(record: TransferRecord, parts: readonly BootstrapPart[], composition: Composition): Promise<Resumed | null>;
|
|
37
|
+
derive(locator: string, key: number, composition: Composition): Promise<boolean>;
|
|
38
|
+
refreshing(locator: string, key: number, composition: Composition): Promise<Refreshing>;
|
|
39
|
+
abandon(locator: string): Promise<void>;
|
|
40
|
+
setAside(locator: string): Promise<void>;
|
|
41
|
+
release(key: number): Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
export declare function bootstrapRoom(adapter: Reads, authorization: Authorization, room: DiscoveredRoom, held: HeldModels, builtIn: ModelState, typedPaths: readonly TypedPath[], remodel: Remodel, continuing: () => boolean, staging: Staging): Promise<BootstrapOutcome>;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import type { DocumentQuery, GroupQuery } from '../mdmodel/index.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { HistoryQuery } from './actions.js';
|
|
3
|
+
import type { AppRoom } from './listing.js';
|
|
4
|
+
import type { ConnectionRefusal } from './socket.js';
|
|
5
|
+
import type { RoomSchemas } from './surface.js';
|
|
6
|
+
import type { SavedParts, SavedRoomDraft, SaveResult } from './saves.js';
|
|
3
7
|
import type { Member, ServiceMode } from './adapter.js';
|
|
4
8
|
import type { UnsentWork } from './durability.js';
|
|
5
9
|
import type { ChatDraft, ConversationAgent, ConversationAnswer, ConversationEntry, ConversationOptions, ConversationRead, ConversationView } from './conversation.js';
|
|
6
10
|
import { type Observation } from './observation.js';
|
|
7
11
|
import type { AttachAnswer, BinaryAnswer, CallResult, DownloadAnswer, HistoryAnswer, Offline, QueueEntry, Resolution } from './outcome.js';
|
|
12
|
+
import type { FiguresResult } from './figures.js';
|
|
13
|
+
import type { Holdings } from './holdings.js';
|
|
8
14
|
import type { DocumentResult, GroupResult, PendingResult } from './query.js';
|
|
9
15
|
import type { RoomDraft, RoomDraftParts, RoomDraftWrite } from './room-draft.js';
|
|
10
16
|
import type { SearchRequest, SearchResult } from './search.js';
|
|
11
17
|
import type { Readiness } from './readiness.js';
|
|
18
|
+
import type { ObservedRead } from './reads.js';
|
|
12
19
|
import type { SyncStatus } from './status.js';
|
|
13
20
|
import { type RuntimePort } from './wire.js';
|
|
14
21
|
export type MdRuntimeClient = {
|
|
@@ -62,6 +69,7 @@ export type MdRuntimeClient = {
|
|
|
62
69
|
cleanUp(): Promise<number>;
|
|
63
70
|
unsent(): Promise<readonly UnsentWork[]>;
|
|
64
71
|
reset(): Promise<void>;
|
|
72
|
+
readAgain(): Promise<void>;
|
|
65
73
|
observe: {
|
|
66
74
|
(topic: 'deployment-facts'): Promise<Observation<unknown>>;
|
|
67
75
|
(topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;
|
|
@@ -80,6 +88,9 @@ export type MdRuntimeClient = {
|
|
|
80
88
|
(topic: 'conversation', conversation: string, options: ConversationOptions): Promise<Observation<ConversationView>>;
|
|
81
89
|
(topic: 'conversations'): Promise<Observation<readonly ConversationEntry[]>>;
|
|
82
90
|
(topic: 'agents'): Promise<Observation<readonly ConversationAgent[]>>;
|
|
91
|
+
(topic: 'figures'): Promise<Observation<FiguresResult>>;
|
|
92
|
+
(topic: 'holdings'): Promise<Observation<Holdings>>;
|
|
93
|
+
(topic: 'read', name: string, input: unknown): Promise<Observation<ObservedRead>>;
|
|
83
94
|
};
|
|
84
95
|
reauthorize(): Promise<void>;
|
|
85
96
|
settled(): Promise<void>;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { sql } from '../mdmodel/index.js';
|
|
1
2
|
import type { Plan, QueryRows } from './query.js';
|
|
2
3
|
import type { Connection } from './tables.js';
|
|
3
4
|
export type QueryRoom = {
|
|
4
5
|
readonly locator: string;
|
|
5
6
|
readonly key: number;
|
|
6
7
|
};
|
|
8
|
+
type Fragment = sql.Fragment;
|
|
9
|
+
export declare const VISIBLE: (alias: string) => string;
|
|
10
|
+
export declare function within(alias: string, path: string): Fragment;
|
|
7
11
|
export type QueryAnswer = QueryRows & {
|
|
8
12
|
readonly more?: string;
|
|
9
13
|
};
|
|
10
14
|
export declare function answerQuery(connection: Connection, plan: Plan, rooms: readonly QueryRoom[], budget?: number | null): QueryAnswer;
|
|
15
|
+
export {};
|