@agentshouse/app-bridge 0.1.0-cf2e2ca943fbc → 0.1.0-cf304386b60e3
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 +21 -16
- package/dist/index.d.ts +1075 -0
- package/dist/index.js +1 -0
- package/dist/mdmodel/blocks.d.ts +10 -0
- package/dist/mdmodel/definition.d.ts +81 -0
- package/dist/mdmodel/divide.d.ts +2 -0
- package/dist/mdmodel/document.d.ts +16 -0
- package/dist/mdmodel/event.d.ts +77 -0
- package/dist/mdmodel/facts.d.ts +14 -0
- package/dist/mdmodel/fields.d.ts +5 -0
- package/dist/mdmodel/index.d.ts +33 -0
- package/dist/mdmodel/kinds.d.ts +18 -0
- package/dist/mdmodel/links.d.ts +28 -0
- package/dist/mdmodel/paths.d.ts +25 -0
- package/dist/mdmodel/pattern.d.ts +9 -0
- package/dist/mdmodel/profile.d.ts +5 -0
- package/dist/mdmodel/project.d.ts +21 -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/references.d.ts +3 -0
- package/dist/mdmodel/reserved.d.ts +4 -0
- package/dist/mdmodel/types.d.ts +178 -0
- package/dist/mdmodel/validate.d.ts +33 -0
- package/dist/mdmodel/version.d.ts +1 -0
- package/dist/mdmodel/yaml.d.ts +55 -0
- package/dist/mdruntime/adapter.d.ts +546 -0
- package/dist/mdruntime/attached-model.d.ts +7 -0
- package/dist/mdruntime/binary.d.ts +17 -0
- package/dist/mdruntime/bootstrap.d.ts +43 -0
- package/dist/mdruntime/chain.d.ts +11 -0
- package/dist/mdruntime/change-set.d.ts +27 -0
- package/dist/mdruntime/change.d.ts +119 -0
- package/dist/mdruntime/client.d.ts +100 -0
- package/dist/mdruntime/collection.d.ts +28 -0
- package/dist/mdruntime/compile.d.ts +15 -0
- package/dist/mdruntime/connection.d.ts +129 -0
- package/dist/mdruntime/conversation-row.d.ts +32 -0
- package/dist/mdruntime/conversation.d.ts +127 -0
- package/dist/mdruntime/durability.d.ts +17 -0
- package/dist/mdruntime/failure.d.ts +12 -0
- package/dist/mdruntime/figures.d.ts +47 -0
- package/dist/mdruntime/identity.d.ts +5 -0
- package/dist/mdruntime/job.d.ts +32 -0
- package/dist/mdruntime/live.d.ts +22 -0
- package/dist/mdruntime/log.d.ts +5 -0
- package/dist/mdruntime/media.d.ts +7 -0
- package/dist/mdruntime/messages.d.ts +51 -0
- package/dist/mdruntime/model.d.ts +55 -0
- package/dist/mdruntime/observation.d.ts +44 -0
- package/dist/mdruntime/open.d.ts +1 -0
- package/dist/mdruntime/opened.d.ts +21 -0
- package/dist/mdruntime/outcome.d.ts +85 -0
- package/dist/mdruntime/overlay.d.ts +25 -0
- package/dist/mdruntime/query.d.ts +88 -0
- package/dist/mdruntime/reach.d.ts +53 -0
- package/dist/mdruntime/readiness.d.ts +49 -0
- package/dist/mdruntime/reads.d.ts +35 -0
- package/dist/mdruntime/recovery.d.ts +25 -0
- package/dist/mdruntime/refresh.d.ts +26 -0
- package/dist/mdruntime/replica.d.ts +67 -0
- package/dist/mdruntime/room-draft.d.ts +174 -0
- package/dist/mdruntime/room-drafts.d.ts +28 -0
- package/dist/mdruntime/save.d.ts +102 -0
- package/dist/mdruntime/saves.d.ts +95 -0
- package/dist/mdruntime/search.d.ts +21 -0
- package/dist/mdruntime/seed.d.ts +29 -0
- package/dist/mdruntime/socket/admission.d.ts +6 -0
- package/dist/mdruntime/socket/answers.d.ts +5 -0
- package/dist/mdruntime/socket.d.ts +42 -0
- package/dist/mdruntime/source.d.ts +60 -0
- package/dist/mdruntime/status.d.ts +25 -0
- package/dist/mdruntime/store/fences.d.ts +15 -0
- package/dist/mdruntime/store/installs.d.ts +29 -0
- package/dist/mdruntime/store/records.d.ts +211 -0
- package/dist/mdruntime/store/room-held.d.ts +7 -0
- package/dist/mdruntime/store/watchers.d.ts +14 -0
- package/dist/mdruntime/store/writes.d.ts +23 -0
- package/dist/mdruntime/store.d.ts +86 -0
- package/dist/mdruntime/stored.d.ts +155 -0
- package/dist/mdruntime/tables.d.ts +406 -0
- 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 +249 -0
- package/dist/{client/src/test-host.d.ts → test-host.d.ts} +10 -8
- package/dist/test-host.js +190 -0
- package/docs/families.md +101 -45
- package/package.json +12 -10
- package/dist/client/src/bridge.d.ts +0 -38
- package/dist/client/src/bridge.js +0 -320
- package/dist/client/src/index.d.ts +0 -3
- package/dist/client/src/index.js +0 -2
- package/dist/client/src/test-host.js +0 -185
- package/dist/client/src/wire.d.ts +0 -215
- package/dist/client/src/wire.js +0 -1
- package/dist/src/apps/remainder.d.ts +0 -2
- package/dist/src/apps/remainder.js +0 -16
- package/dist/src/apps/tab.d.ts +0 -6
- package/dist/src/apps/tab.js +0 -27
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Ordering } from '../kinds.js';
|
|
2
|
+
import type { QueryPlan, Scope } from './language.js';
|
|
3
|
+
import { type HeldValue, type Reach } from './rows.js';
|
|
4
|
+
export type SqlValue = string | number | bigint | Uint8Array | null;
|
|
5
|
+
export type Fragment = {
|
|
6
|
+
readonly sql: string;
|
|
7
|
+
readonly bind: readonly SqlValue[];
|
|
8
|
+
};
|
|
9
|
+
export type Collate = (ordering: Ordering, lists: boolean, total: boolean) => string | null;
|
|
10
|
+
export type Term = {
|
|
11
|
+
readonly ordering: Ordering;
|
|
12
|
+
readonly kind: Fragment;
|
|
13
|
+
readonly value: Fragment;
|
|
14
|
+
readonly instant?: Fragment;
|
|
15
|
+
readonly total?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type Following = {
|
|
18
|
+
readonly beyond: Fragment;
|
|
19
|
+
readonly equal: Fragment;
|
|
20
|
+
};
|
|
21
|
+
export declare const VALUE_TABLE = "CREATE TABLE replica_values (doc INTEGER NOT NULL, keys TEXT NOT NULL, places TEXT NOT NULL, item INTEGER NOT NULL, kind TEXT NOT NULL, value, size INTEGER, instant TEXT, PRIMARY KEY (doc, keys, places, item)) WITHOUT ROWID";
|
|
22
|
+
export declare const HOLDS_PHRASE = "holds_phrase";
|
|
23
|
+
export declare function holdsPhrase(_context: number, text: unknown, phrase: unknown): number;
|
|
24
|
+
export declare function fragment(sql: string, bind?: readonly SqlValue[]): Fragment;
|
|
25
|
+
export declare function joined(parts: readonly Fragment[], separator: string): Fragment;
|
|
26
|
+
export declare function all(parts: readonly Fragment[]): Fragment;
|
|
27
|
+
export declare function any(parts: readonly Fragment[]): Fragment;
|
|
28
|
+
export declare function grouped(part: Fragment): Fragment;
|
|
29
|
+
export declare function listed(values: readonly SqlValue[]): Fragment;
|
|
30
|
+
export declare function exists(part: Fragment): Fragment;
|
|
31
|
+
export declare function insertedValues(doc: number, values: readonly HeldValue[]): Fragment;
|
|
32
|
+
export declare function placed(alias: string, field: string, reach: Reach): Fragment;
|
|
33
|
+
export declare function scoped(alias: string, scope: Scope, byPaths?: boolean): Fragment;
|
|
34
|
+
export declare function tests(alias: string, plan: QueryPlan): Fragment;
|
|
35
|
+
export declare function sortValue(kind: SqlValue | undefined, value: unknown, instant: SqlValue | undefined): unknown;
|
|
36
|
+
export declare function sorted(collate: Collate, term: Term): Fragment;
|
|
37
|
+
export declare function beyond(collate: Collate, term: Term, value: unknown): Following;
|
|
38
|
+
export declare function following(parts: readonly Following[], tie: Fragment): Fragment;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import type { Definition } from './definition.js';
|
|
2
|
+
export type Library = Readonly<Record<string, string>>;
|
|
3
|
+
export type VerifiedModel = {
|
|
4
|
+
readonly types: Readonly<Record<string, Definition>>;
|
|
5
|
+
readonly nameable?: readonly string[];
|
|
6
|
+
};
|
|
7
|
+
export type ModelVerification = {
|
|
8
|
+
readonly verdict: 'accept';
|
|
9
|
+
readonly model: VerifiedModel;
|
|
10
|
+
} | {
|
|
11
|
+
readonly verdict: 'refuse';
|
|
12
|
+
readonly rule: string;
|
|
13
|
+
readonly location?: string;
|
|
14
|
+
};
|
|
15
|
+
export type TypedPath = {
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly type: string;
|
|
18
|
+
readonly named: boolean;
|
|
19
|
+
readonly body: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type ValidationContext = {
|
|
22
|
+
readonly binaryTargets: readonly string[];
|
|
23
|
+
readonly anyRoom?: true;
|
|
24
|
+
readonly typedPaths?: readonly TypedPath[];
|
|
25
|
+
};
|
|
26
|
+
export type ProjectionContext = {
|
|
27
|
+
readonly documentTargets: readonly string[];
|
|
28
|
+
readonly definition?: Definition;
|
|
29
|
+
};
|
|
30
|
+
export type DivisionContext = ProjectionContext & {
|
|
31
|
+
readonly bound: number;
|
|
32
|
+
};
|
|
33
|
+
export type Extent = {
|
|
34
|
+
readonly start: number;
|
|
35
|
+
readonly end: number;
|
|
36
|
+
};
|
|
37
|
+
export type Span = Extent & {
|
|
38
|
+
readonly text: string;
|
|
39
|
+
};
|
|
40
|
+
export type Frontmatter = {
|
|
41
|
+
readonly content: string;
|
|
42
|
+
readonly type: string | undefined;
|
|
43
|
+
readonly fields: Readonly<Record<string, unknown>>;
|
|
44
|
+
};
|
|
45
|
+
export type Document = Frontmatter & {
|
|
46
|
+
readonly preamble: string;
|
|
47
|
+
readonly sections: Readonly<Record<string, string>>;
|
|
48
|
+
};
|
|
49
|
+
export type Refusal = {
|
|
50
|
+
readonly file: string;
|
|
51
|
+
readonly rule: string;
|
|
52
|
+
readonly location?: string;
|
|
53
|
+
readonly referrers?: readonly string[];
|
|
54
|
+
};
|
|
55
|
+
export type Reached = {
|
|
56
|
+
readonly target: string | null;
|
|
57
|
+
readonly to: readonly string[];
|
|
58
|
+
};
|
|
59
|
+
export type DocumentCheck = {
|
|
60
|
+
readonly ok: false;
|
|
61
|
+
} | {
|
|
62
|
+
readonly ok: true;
|
|
63
|
+
readonly type: string;
|
|
64
|
+
readonly typed: boolean;
|
|
65
|
+
readonly references: readonly Reached[];
|
|
66
|
+
};
|
|
67
|
+
export type Validation = {
|
|
68
|
+
readonly verdict: 'accept';
|
|
69
|
+
} | ({
|
|
70
|
+
readonly verdict: 'refuse';
|
|
71
|
+
} & Refusal);
|
|
72
|
+
export type ValidationStep = {
|
|
73
|
+
readonly path: string;
|
|
74
|
+
readonly resolved: number;
|
|
75
|
+
};
|
|
76
|
+
export type Projection = {
|
|
77
|
+
readonly ok: true;
|
|
78
|
+
readonly text: string;
|
|
79
|
+
} | {
|
|
80
|
+
readonly ok: false;
|
|
81
|
+
readonly refusal: Refusal;
|
|
82
|
+
};
|
|
83
|
+
export type Division = {
|
|
84
|
+
readonly ok: true;
|
|
85
|
+
readonly spans: readonly Span[];
|
|
86
|
+
} | {
|
|
87
|
+
readonly ok: false;
|
|
88
|
+
readonly refusal: Refusal;
|
|
89
|
+
};
|
|
90
|
+
export type FrontmatterResult = {
|
|
91
|
+
readonly ok: true;
|
|
92
|
+
readonly frontmatter: Frontmatter;
|
|
93
|
+
} | {
|
|
94
|
+
readonly ok: false;
|
|
95
|
+
readonly refusal: Refusal;
|
|
96
|
+
};
|
|
97
|
+
export type ParseResult = {
|
|
98
|
+
readonly ok: true;
|
|
99
|
+
readonly document: Document;
|
|
100
|
+
} | {
|
|
101
|
+
readonly ok: false;
|
|
102
|
+
readonly refusal: Refusal;
|
|
103
|
+
};
|
|
104
|
+
export type Link = {
|
|
105
|
+
readonly href: string;
|
|
106
|
+
readonly target: string;
|
|
107
|
+
};
|
|
108
|
+
export type Reference = {
|
|
109
|
+
readonly pointer: string;
|
|
110
|
+
readonly value: string;
|
|
111
|
+
readonly to: readonly string[];
|
|
112
|
+
readonly crossRoom?: true;
|
|
113
|
+
};
|
|
114
|
+
export type RoomReference = {
|
|
115
|
+
readonly handle: string;
|
|
116
|
+
readonly path: string;
|
|
117
|
+
} & ({
|
|
118
|
+
readonly kind: 'link';
|
|
119
|
+
readonly href: string;
|
|
120
|
+
} | {
|
|
121
|
+
readonly kind: 'field';
|
|
122
|
+
readonly pointer: string;
|
|
123
|
+
readonly value: string;
|
|
124
|
+
readonly to: readonly string[];
|
|
125
|
+
readonly crossRoom?: true;
|
|
126
|
+
} | {
|
|
127
|
+
readonly kind: 'item';
|
|
128
|
+
readonly section: string;
|
|
129
|
+
readonly href: string;
|
|
130
|
+
readonly to: readonly string[];
|
|
131
|
+
readonly crossRoom?: true;
|
|
132
|
+
});
|
|
133
|
+
export type Change = {
|
|
134
|
+
readonly kind: 'field';
|
|
135
|
+
readonly name: string;
|
|
136
|
+
readonly value: unknown;
|
|
137
|
+
readonly prior: unknown;
|
|
138
|
+
} | {
|
|
139
|
+
readonly kind: 'section';
|
|
140
|
+
readonly name: string;
|
|
141
|
+
readonly value: string;
|
|
142
|
+
readonly prior: string;
|
|
143
|
+
} | {
|
|
144
|
+
readonly kind: 'preamble';
|
|
145
|
+
readonly value: string;
|
|
146
|
+
readonly prior: string;
|
|
147
|
+
} | {
|
|
148
|
+
readonly kind: 'link';
|
|
149
|
+
readonly href: string;
|
|
150
|
+
readonly to: string;
|
|
151
|
+
} | {
|
|
152
|
+
readonly kind: 'reference';
|
|
153
|
+
readonly pointer: string;
|
|
154
|
+
readonly value: string;
|
|
155
|
+
readonly prior: string;
|
|
156
|
+
};
|
|
157
|
+
export type ApplyResult = {
|
|
158
|
+
readonly outcome: 'applied';
|
|
159
|
+
readonly document: Document;
|
|
160
|
+
} | {
|
|
161
|
+
readonly outcome: 'stale';
|
|
162
|
+
readonly document: Document;
|
|
163
|
+
readonly stale: readonly number[];
|
|
164
|
+
} | {
|
|
165
|
+
readonly outcome: 'refuse';
|
|
166
|
+
readonly refusal: Refusal;
|
|
167
|
+
};
|
|
168
|
+
export type BodyResult = {
|
|
169
|
+
readonly outcome: 'applied';
|
|
170
|
+
readonly body: string;
|
|
171
|
+
} | {
|
|
172
|
+
readonly outcome: 'refuse';
|
|
173
|
+
readonly refusal: Refusal;
|
|
174
|
+
};
|
|
175
|
+
export type UnlinkedBody = {
|
|
176
|
+
readonly body: string;
|
|
177
|
+
readonly links: ReadonlyMap<string, string>;
|
|
178
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Definition } from './definition.js';
|
|
2
|
+
import type { Document, DocumentCheck, Library, ModelVerification, ParseResult, Reached, RoomReference, Validation, ValidationContext, ValidationStep, VerifiedModel } from './types.js';
|
|
3
|
+
export declare function resolves(reference: Reached, typeOf: (path: string) => string | undefined, binary: (path: string) => boolean): boolean;
|
|
4
|
+
export declare function verify(schema: string, provided?: VerifiedModel): ModelVerification;
|
|
5
|
+
export declare function readTypes(schema: string, provided?: VerifiedModel): VerifiedModel;
|
|
6
|
+
type Placing = Pick<ValidationContext, 'anyRoom' | 'typedPaths'>;
|
|
7
|
+
export declare function checkDocument(file: string, content: string, model: VerifiedModel, context?: Placing): DocumentCheck;
|
|
8
|
+
export declare function bodyRoomLinks(body: string): RoomReference[];
|
|
9
|
+
export declare function roomReferences(document: Document, definition?: Definition): readonly RoomReference[];
|
|
10
|
+
type Placed = {
|
|
11
|
+
readonly reference: Reached;
|
|
12
|
+
readonly location: string;
|
|
13
|
+
};
|
|
14
|
+
export type Assessment = {
|
|
15
|
+
readonly file: string;
|
|
16
|
+
readonly type: string | undefined;
|
|
17
|
+
readonly targets: readonly string[];
|
|
18
|
+
readonly read: Validation | null;
|
|
19
|
+
readonly structured: Validation | null;
|
|
20
|
+
readonly fields: readonly Placed[];
|
|
21
|
+
readonly linked: boolean;
|
|
22
|
+
readonly sections: readonly Placed[];
|
|
23
|
+
};
|
|
24
|
+
export declare function assess(file: string, parsed: ParseResult, binary: boolean, model?: VerifiedModel, context?: Placing): Assessment;
|
|
25
|
+
export declare function assessReferences(file: string, parsed: ParseResult, changed: ReadonlySet<string>, model?: VerifiedModel, context?: Placing): Assessment;
|
|
26
|
+
export type Verdicts = {
|
|
27
|
+
add(assessment: Assessment, typeOf: (path: string) => string | undefined, binary: (path: string) => boolean): number;
|
|
28
|
+
verdict(): Validation;
|
|
29
|
+
};
|
|
30
|
+
export declare function verdicts(): Verdicts;
|
|
31
|
+
export declare function validating(library: ReadonlyMap<string, string>, context?: ValidationContext, model?: VerifiedModel): Generator<ValidationStep, Validation, void>;
|
|
32
|
+
export declare function validate(library: Library, context?: ValidationContext, model?: VerifiedModel): Validation;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION = "0.1.0-alpha.19";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare class YamlError extends Error {
|
|
2
|
+
readonly offset: number;
|
|
3
|
+
constructor(offset: number);
|
|
4
|
+
}
|
|
5
|
+
export type YamlScalar = {
|
|
6
|
+
readonly kind: 'scalar';
|
|
7
|
+
readonly value: string | number | boolean | null;
|
|
8
|
+
readonly start: number;
|
|
9
|
+
readonly end: number;
|
|
10
|
+
};
|
|
11
|
+
export type YamlSeq = {
|
|
12
|
+
readonly kind: 'seq';
|
|
13
|
+
readonly items: readonly YamlNode[];
|
|
14
|
+
readonly start: number;
|
|
15
|
+
readonly end: number;
|
|
16
|
+
};
|
|
17
|
+
export type YamlEntry = {
|
|
18
|
+
readonly key: string;
|
|
19
|
+
readonly after: number;
|
|
20
|
+
readonly value: YamlNode;
|
|
21
|
+
};
|
|
22
|
+
export type YamlMap = {
|
|
23
|
+
readonly kind: 'map';
|
|
24
|
+
readonly entries: readonly YamlEntry[];
|
|
25
|
+
readonly start: number;
|
|
26
|
+
readonly end: number;
|
|
27
|
+
};
|
|
28
|
+
export type YamlNode = YamlScalar | YamlSeq | YamlMap;
|
|
29
|
+
export declare function interpretPlain(text: string): string | number | boolean | null;
|
|
30
|
+
export declare function parseYamlMapping(text: string, start: number, end: number): YamlMap;
|
|
31
|
+
export declare function jsValue(node: YamlNode): unknown;
|
|
32
|
+
export declare function mapEntry(map: YamlMap, key: string): YamlEntry | undefined;
|
|
33
|
+
export declare function isPlainSafe(text: string): boolean;
|
|
34
|
+
export type FrontmatterValue = string | number | boolean | null | readonly FrontmatterValue[] | {
|
|
35
|
+
readonly [name: string]: FrontmatterValue;
|
|
36
|
+
};
|
|
37
|
+
export declare function plain(value: unknown): value is Record<string, unknown>;
|
|
38
|
+
export declare function frontmatterValue(value: unknown): value is FrontmatterValue;
|
|
39
|
+
export declare function serializeJs(value: FrontmatterValue): string;
|
|
40
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
41
|
+
export declare function serializeKey(name: string): string;
|
|
42
|
+
export declare function bodyStartAfterYaml(content: string, yamlEnd: number): number;
|
|
43
|
+
export declare function bodyStartOf(content: string): number;
|
|
44
|
+
export declare function bodyAfterFrontmatter(content: string): string;
|
|
45
|
+
export declare function extractFrontmatter(content: string): {
|
|
46
|
+
kind: 'none';
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'unclosed';
|
|
49
|
+
} | {
|
|
50
|
+
kind: 'ok';
|
|
51
|
+
yamlStart: number;
|
|
52
|
+
yamlEnd: number;
|
|
53
|
+
};
|
|
54
|
+
export declare function equalValue(left: unknown, right: unknown): boolean;
|
|
55
|
+
export declare function lineEnding(content: string): '\n' | '\r\n';
|