@agentshouse/app-bridge 0.1.0-c1bc683ed8f4e → 0.1.0-c1ccced28150f
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 +9 -9
- package/dist/index.d.ts +826 -18
- package/dist/mdmodel/condition.d.ts +41 -11
- package/dist/mdmodel/definition.d.ts +17 -1
- package/dist/mdmodel/document.d.ts +5 -5
- package/dist/mdmodel/index.d.ts +11 -9
- 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/types.d.ts +28 -4
- package/dist/mdmodel/validate.d.ts +27 -3
- package/dist/mdruntime/adapter.d.ts +121 -66
- package/dist/mdruntime/binary.d.ts +0 -5
- package/dist/mdruntime/chain.d.ts +10 -0
- package/dist/mdruntime/change-set.d.ts +9 -16
- package/dist/mdruntime/change.d.ts +31 -1
- package/dist/mdruntime/client.d.ts +15 -8
- package/dist/mdruntime/collection.d.ts +10 -21
- package/dist/mdruntime/compile.d.ts +15 -0
- package/dist/mdruntime/connection.d.ts +28 -14
- package/dist/mdruntime/conversation.d.ts +26 -11
- package/dist/mdruntime/durability.d.ts +2 -5
- package/dist/mdruntime/fulltext.d.ts +26 -0
- package/dist/mdruntime/identity.d.ts +6 -0
- package/dist/mdruntime/media.d.ts +7 -0
- package/dist/mdruntime/messages.d.ts +27 -0
- package/dist/mdruntime/model.d.ts +6 -1
- package/dist/mdruntime/observation.d.ts +15 -0
- 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 +38 -2
- package/dist/mdruntime/reach.d.ts +14 -6
- package/dist/mdruntime/readiness.d.ts +14 -15
- package/dist/mdruntime/recovery.d.ts +3 -2
- package/dist/mdruntime/replica.d.ts +55 -33
- package/dist/mdruntime/room-draft.d.ts +33 -3
- package/dist/mdruntime/save.d.ts +53 -14
- package/dist/mdruntime/search.d.ts +32 -43
- package/dist/mdruntime/seed.d.ts +15 -0
- package/dist/mdruntime/status.d.ts +4 -3
- package/dist/mdruntime/store.d.ts +93 -98
- package/dist/mdruntime/stored.d.ts +129 -0
- package/dist/mdruntime/tables.d.ts +324 -0
- package/dist/mdruntime/wire.d.ts +33 -5
- package/dist/test-host.d.ts +7 -4
- package/dist/test-host.js +18 -28
- package/docs/families.md +52 -47
- package/package.json +8 -3
- package/dist/calls.d.ts +0 -117
- package/dist/calls.js +0 -1
- package/dist/mdruntime/acquisition.d.ts +0 -13
- 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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type ValueFacts } from './definition.js';
|
|
1
|
+
import { type Definition, type ValueFacts } from './definition.js';
|
|
2
2
|
import type { Document, VerifiedModel } from './types.js';
|
|
3
|
-
export type ConditionValue = string | number | boolean
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export type ConditionValue = string | number | boolean;
|
|
4
|
+
export declare const CONDITION_OPERATORS: readonly ['eq', 'in', 'exists', 'contains', 'gt', 'gte', 'lt', 'lte', 'prefix'];
|
|
5
|
+
export type ConditionOperator = (typeof CONDITION_OPERATORS)[number];
|
|
6
6
|
export type ConditionTest = {
|
|
7
7
|
readonly all: readonly ConditionTest[];
|
|
8
8
|
} | {
|
|
@@ -41,6 +41,7 @@ type DocumentEventBase = {
|
|
|
41
41
|
readonly on: 'documents';
|
|
42
42
|
readonly scope: ConditionScope;
|
|
43
43
|
readonly by?: ConditionTest;
|
|
44
|
+
readonly moved_between_rooms?: boolean;
|
|
44
45
|
};
|
|
45
46
|
export type DocumentCondition = (DocumentEventBase & {
|
|
46
47
|
readonly mode: 'starts_matching';
|
|
@@ -75,7 +76,15 @@ export type DateCondition = {
|
|
|
75
76
|
readonly time_zone: string;
|
|
76
77
|
readonly match?: ConditionTest;
|
|
77
78
|
};
|
|
78
|
-
export type
|
|
79
|
+
export type NotificationCondition = {
|
|
80
|
+
readonly on: 'notifications';
|
|
81
|
+
readonly match?: ConditionTest;
|
|
82
|
+
};
|
|
83
|
+
export type MessageCondition = {
|
|
84
|
+
readonly on: 'messages';
|
|
85
|
+
readonly match?: ConditionTest;
|
|
86
|
+
};
|
|
87
|
+
export type Condition = DocumentCondition | ItemCondition | CronCondition | DateCondition | NotificationCondition | MessageCondition;
|
|
79
88
|
export type FactKind = 'string' | 'number' | 'boolean' | 'date' | 'time' | 'enum' | 'reference';
|
|
80
89
|
type Scalar = string | number | boolean;
|
|
81
90
|
export type Fact = {
|
|
@@ -102,11 +111,13 @@ export type DocumentFacts = {
|
|
|
102
111
|
readonly fields: Readonly<Record<string, Fact>>;
|
|
103
112
|
readonly sections: readonly string[];
|
|
104
113
|
};
|
|
105
|
-
export declare const
|
|
114
|
+
export declare const TEXT_FIELD = "/text";
|
|
115
|
+
export declare const WRITE_DOORS: readonly ['browser', 'agent', 'client', 'function'];
|
|
106
116
|
export type WriteDoor = (typeof WRITE_DOORS)[number];
|
|
107
117
|
export type Actor = {
|
|
108
118
|
readonly user?: string;
|
|
109
119
|
readonly site?: string;
|
|
120
|
+
readonly app?: string;
|
|
110
121
|
readonly door?: WriteDoor;
|
|
111
122
|
};
|
|
112
123
|
export type DocumentEvent = {
|
|
@@ -114,13 +125,12 @@ export type DocumentEvent = {
|
|
|
114
125
|
readonly after: DocumentFacts | null;
|
|
115
126
|
readonly changed: readonly string[];
|
|
116
127
|
readonly by: Actor;
|
|
128
|
+
readonly moved_between_rooms: boolean;
|
|
117
129
|
};
|
|
118
130
|
export type ItemFacts = {
|
|
119
131
|
readonly delivery: string;
|
|
120
132
|
readonly source: string | null;
|
|
121
133
|
readonly address: string | null;
|
|
122
|
-
readonly has_attachment: boolean;
|
|
123
|
-
readonly provider: string | null;
|
|
124
134
|
readonly container: string | null;
|
|
125
135
|
readonly author: string | null;
|
|
126
136
|
readonly headers: Readonly<Record<string, string>>;
|
|
@@ -128,6 +138,11 @@ export type ItemFacts = {
|
|
|
128
138
|
readonly value: unknown;
|
|
129
139
|
} | null;
|
|
130
140
|
};
|
|
141
|
+
export type MessageFacts = {
|
|
142
|
+
readonly sender: string;
|
|
143
|
+
readonly routine: string | null;
|
|
144
|
+
readonly path: string | null;
|
|
145
|
+
};
|
|
131
146
|
export type Resolved = {
|
|
132
147
|
readonly id: string;
|
|
133
148
|
readonly member?: string;
|
|
@@ -140,10 +155,25 @@ export declare function facts(document: Document, at: {
|
|
|
140
155
|
}, model: VerifiedModel, resolve: (target: string) => Resolved | undefined): DocumentFacts;
|
|
141
156
|
export declare function prosePaths(facts: DocumentFacts): string[];
|
|
142
157
|
export declare function datePointers(fields: Readonly<Record<string, ValueFacts>>): string[];
|
|
158
|
+
export declare function valuedChange(definition: Definition, field: string): boolean;
|
|
159
|
+
export declare function changeFields(definition: Definition): string[];
|
|
160
|
+
export declare function memberPointers(definition: Definition, memberType: string): string[];
|
|
161
|
+
export declare const DOCUMENT_PATHS: readonly string[];
|
|
162
|
+
export declare const ACTOR_PATHS: readonly string[];
|
|
163
|
+
export declare const ITEM_PATHS: readonly string[];
|
|
164
|
+
export declare const MESSAGE_PATHS: readonly string[];
|
|
165
|
+
export declare function testOperators(definitions: readonly Definition[], path: string, memberType: string | null): readonly ConditionOperator[];
|
|
166
|
+
export declare function actorOperators(path: string): readonly ConditionOperator[];
|
|
167
|
+
export declare function itemOperators(path: string): readonly ConditionOperator[];
|
|
168
|
+
export declare function messageOperators(path: string): readonly ConditionOperator[];
|
|
169
|
+
export declare function itemKind(path: string): FactKind | null;
|
|
143
170
|
export declare function dated(value: unknown): value is string;
|
|
144
171
|
export declare function instant(value: unknown): bigint | undefined;
|
|
145
172
|
export declare function pointed(value: unknown, pointer: string): unknown;
|
|
146
|
-
export declare function
|
|
147
|
-
export declare function
|
|
148
|
-
export declare function
|
|
173
|
+
export declare function members(document: DocumentFacts, path: string): readonly string[];
|
|
174
|
+
export declare function holds(test: ConditionTest, document: DocumentFacts): Truth;
|
|
175
|
+
export declare function fires(condition: DocumentCondition, event: DocumentEvent): boolean;
|
|
176
|
+
export declare function itemFires(condition: ItemCondition, item: ItemFacts): boolean;
|
|
177
|
+
export declare function notificationFires(condition: NotificationCondition, notification: DocumentFacts): boolean;
|
|
178
|
+
export declare function messageFires(condition: MessageCondition, message: MessageFacts): boolean;
|
|
149
179
|
export {};
|
|
@@ -5,6 +5,7 @@ export type ValueFacts = {
|
|
|
5
5
|
readonly format?: string;
|
|
6
6
|
readonly values?: readonly unknown[];
|
|
7
7
|
readonly reference?: readonly string[];
|
|
8
|
+
readonly crossRoom?: true;
|
|
8
9
|
readonly prose: boolean;
|
|
9
10
|
readonly conditional?: true;
|
|
10
11
|
readonly prefix?: readonly ValueFacts[];
|
|
@@ -29,12 +30,26 @@ export type Shape = {
|
|
|
29
30
|
readonly schema: Readonly<Record<string, unknown>>;
|
|
30
31
|
readonly defs: Readonly<Record<string, unknown>>;
|
|
31
32
|
};
|
|
33
|
+
export type RuleValue = string | number | boolean | null;
|
|
34
|
+
export type Transition = {
|
|
35
|
+
readonly from: RuleValue;
|
|
36
|
+
readonly to: RuleValue;
|
|
37
|
+
readonly roles?: readonly string[];
|
|
38
|
+
};
|
|
39
|
+
export type FieldRules = {
|
|
40
|
+
readonly changeRoles?: readonly string[];
|
|
41
|
+
readonly initialRoles?: readonly string[];
|
|
42
|
+
readonly transitions?: readonly Transition[];
|
|
43
|
+
};
|
|
32
44
|
export type Definition = {
|
|
33
45
|
readonly name: string;
|
|
34
46
|
readonly memberDocument: boolean;
|
|
35
47
|
readonly frontmatter: ValueFacts;
|
|
36
48
|
readonly fields: Readonly<Record<string, ValueFacts>>;
|
|
37
49
|
readonly sections: Readonly<Record<string, SectionSpec>>;
|
|
50
|
+
readonly rules: Readonly<Record<string, FieldRules>>;
|
|
51
|
+
readonly createRoles?: readonly string[];
|
|
52
|
+
readonly deleteRoles?: readonly string[];
|
|
38
53
|
readonly shape: Shape;
|
|
39
54
|
};
|
|
40
55
|
export type Failure = {
|
|
@@ -45,6 +60,7 @@ export declare const JSON_TYPES: readonly JsonType[];
|
|
|
45
60
|
export declare const BUILT_IN_TYPE = "any";
|
|
46
61
|
export declare const ATTACHMENT = "attachment";
|
|
47
62
|
export declare const ARRAY_INDEX: RegExp;
|
|
63
|
+
export declare const JSON_POINTER: RegExp;
|
|
48
64
|
export declare function escapePointer(key: string): string;
|
|
49
65
|
export declare function pointerSegments(pointer: string): string[];
|
|
50
66
|
export declare function refTarget(reference: string, defs: Readonly<Record<string, unknown>>): {
|
|
@@ -62,4 +78,4 @@ export type PointerFacts = {
|
|
|
62
78
|
export declare function crossedFacts(facts: ValueFacts): ValueFacts[];
|
|
63
79
|
export declare function fieldFacts(definition: Definition, key: string): ValueFacts | undefined;
|
|
64
80
|
export declare function pointerFacts(definition: Definition, pointer: string): PointerFacts | undefined;
|
|
65
|
-
export declare function readSchema(text: string): VerifiedModel | Failure;
|
|
81
|
+
export declare function readSchema(text: string, provided?: VerifiedModel): VerifiedModel | Failure;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type Definition } from './definition.js';
|
|
2
|
-
import
|
|
2
|
+
import { type LinkInventory } from './links.js';
|
|
3
|
+
import type { ApplyResult, BodyResult, FrontmatterResult, Change, Document, Link, ParseResult } from './types.js';
|
|
3
4
|
import { type YamlMap } from './yaml.js';
|
|
5
|
+
export declare function inventoryOf(document: Document): LinkInventory;
|
|
4
6
|
export declare function parseFrontmatter(content: string, file?: string): FrontmatterResult;
|
|
5
7
|
export declare function parse(content: string, file?: string): ParseResult;
|
|
6
|
-
export declare function relativize(document: Document, file: string, handle: string, definition?: Definition): ApplyResult;
|
|
8
|
+
export declare function relativize(document: Document, file: string, handle: string, definition?: Definition, kept?: ReadonlySet<string>): ApplyResult;
|
|
7
9
|
export declare function relativizeBody(body: string, file: string, handle: string): BodyResult;
|
|
8
10
|
export declare function relinkBody(body: string, file: string, moves: ReadonlyMap<string, string>): BodyResult;
|
|
9
11
|
export declare function links(document: Document, file: string): readonly Link[];
|
|
10
|
-
export declare function linkOccurrences(document: Document, file: string): readonly LinkOccurrence[];
|
|
11
12
|
export declare function bodyLinks(body: string, file: string): readonly Link[];
|
|
12
|
-
export declare function apply(document: Document,
|
|
13
|
+
export declare function apply(document: Document, changes: readonly Change[]): ApplyResult;
|
|
13
14
|
export declare function serialize(document: Document): string;
|
|
14
|
-
export declare function fieldStart(document: Document, pointer: string): number | undefined;
|
|
15
15
|
export declare function frontmatter(document: Document): YamlMap | null;
|
package/dist/mdmodel/index.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
export { dated, datePointers, factKind, facts, fires, holds, instant, itemFires, pointed, prosePaths, WRITE_DOORS, } from './condition.js';
|
|
2
|
-
export type { Actor, Condition, ConditionScope, ConditionTest, ConditionValue, CronCondition, DateCondition, DocumentCondition, DocumentEvent, DocumentFacts, Fact, FactKind, ItemCondition, ItemFacts, Resolved, WriteDoor, } from './condition.js';
|
|
1
|
+
export { ACTOR_PATHS, actorOperators, changeFields, CONDITION_OPERATORS, dated, datePointers, DOCUMENT_PATHS, factKind, facts, fires, holds, instant, ITEM_PATHS, itemFires, itemKind, itemOperators, memberPointers, members, MESSAGE_PATHS, messageFires, messageOperators, notificationFires, pointed, prosePaths, testOperators, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './condition.js';
|
|
2
|
+
export type { Actor, Condition, ConditionOperator, ConditionScope, ConditionTest, ConditionValue, CronCondition, DateCondition, DocumentCondition, DocumentEvent, DocumentFacts, Fact, FactKind, ItemCondition, ItemFacts, MessageCondition, MessageFacts, NotificationCondition, Resolved, WriteDoor, } from './condition.js';
|
|
3
3
|
export { headingLines } from './blocks.js';
|
|
4
4
|
export type { HeadingLine } from './blocks.js';
|
|
5
5
|
export { divide } from './divide.js';
|
|
6
|
-
export { apply, bodyLinks,
|
|
6
|
+
export { apply, bodyLinks, links, parse, parseFrontmatter, relativize, relativizeBody, relinkBody, serialize, } from './document.js';
|
|
7
7
|
export { HOUSE_FIELDS, MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } from './fields.js';
|
|
8
|
-
export { relative, retarget, target } from './paths.js';
|
|
8
|
+
export { relative, retarget, roomPath, roomTarget, target } from './paths.js';
|
|
9
|
+
export type { RoomTarget } from './paths.js';
|
|
9
10
|
export { MARKDOWN_SYNTAX_PROFILE } from './profile.js';
|
|
10
11
|
export { project } from './project.js';
|
|
11
12
|
export { references } from './references.js';
|
|
12
|
-
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, memberFacts, pointerFacts, pointerSegments, } from './definition.js';
|
|
13
|
-
export type { Definition, JsonType, PatternFacts, PointerFacts, SectionSpec, Shape, ValueFacts, } from './definition.js';
|
|
14
|
-
export type { ApplyResult, BodyResult, Change, Division, DivisionContext, Document, DocumentCheck, Frontmatter, FrontmatterResult, Library, ModelVerification, Link,
|
|
15
|
-
export { checkDocument, resolves, sectionReferences, validate, verify } from './validate.js';
|
|
13
|
+
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, } from './definition.js';
|
|
14
|
+
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, sectionReferences, validate, validating, verdicts, verify, } from './validate.js';
|
|
17
|
+
export type { Assessment, Verdicts } from './validate.js';
|
|
16
18
|
export { VERSION } from './version.js';
|
|
17
|
-
export { equalValue, frontmatterValue } from './yaml.js';
|
|
19
|
+
export { bodyAfterFrontmatter, equalValue, frontmatterValue } from './yaml.js';
|
|
18
20
|
export type { FrontmatterValue } from './yaml.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare function escapes(text: string, index: number): boolean;
|
|
2
|
+
export declare function spanCursor(spans: readonly (readonly [number, number])[]): (index: number) => number | undefined;
|
|
3
|
+
export type HrefOccurrence = {
|
|
4
|
+
readonly href: string;
|
|
5
|
+
readonly start: number;
|
|
6
|
+
readonly end: number;
|
|
7
|
+
readonly bracketed: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type LinkUse = {
|
|
10
|
+
readonly start: number;
|
|
11
|
+
readonly end: number;
|
|
12
|
+
readonly labelStart: number;
|
|
13
|
+
readonly labelEnd: number;
|
|
14
|
+
readonly destination: HrefOccurrence;
|
|
15
|
+
};
|
|
16
|
+
export type DefinitionBlock = {
|
|
17
|
+
readonly start: number;
|
|
18
|
+
readonly end: number;
|
|
19
|
+
readonly destination: HrefOccurrence;
|
|
20
|
+
};
|
|
21
|
+
export type LinkInventory = {
|
|
22
|
+
readonly uses: readonly LinkUse[];
|
|
23
|
+
readonly blocks: readonly DefinitionBlock[];
|
|
24
|
+
};
|
|
25
|
+
export declare function fenceSpans(text: string): readonly (readonly [number, number])[];
|
|
26
|
+
export declare function linkInventory(body: string): LinkInventory;
|
|
27
|
+
export declare function destinations(inventory: LinkInventory): readonly HrefOccurrence[];
|
|
28
|
+
export declare function hrefOccurrences(body: string): readonly HrefOccurrence[];
|
package/dist/mdmodel/paths.d.ts
CHANGED
|
@@ -2,14 +2,22 @@ export declare function dirname(path: string): string;
|
|
|
2
2
|
export declare function join(base: string, relative: string): string;
|
|
3
3
|
export declare function normalize(path: string): string | null;
|
|
4
4
|
export declare function destinationPath(href: string): string | null;
|
|
5
|
+
export type RoomTarget = {
|
|
6
|
+
readonly handle: string;
|
|
7
|
+
readonly path: string;
|
|
8
|
+
};
|
|
5
9
|
export declare function classifyHref(from: string, href: string): {
|
|
6
10
|
kind: 'skip';
|
|
7
11
|
} | {
|
|
8
12
|
kind: 'path';
|
|
9
13
|
path: string;
|
|
10
|
-
} | {
|
|
14
|
+
} | ({
|
|
15
|
+
kind: 'room';
|
|
16
|
+
} & RoomTarget) | {
|
|
11
17
|
kind: 'invalid';
|
|
12
18
|
};
|
|
19
|
+
export declare function roomTarget(href: string): RoomTarget | null;
|
|
20
|
+
export declare function roomPath(href: string): string | null;
|
|
13
21
|
export declare function target(from: string, href: string): string | null;
|
|
14
22
|
export declare function retarget(href: string, to: string): string;
|
|
15
23
|
export declare function relative(from: string, target: string): string;
|
|
@@ -15,6 +15,7 @@ export type InputResult = {
|
|
|
15
15
|
readonly ok: false;
|
|
16
16
|
readonly refusal: Refusal;
|
|
17
17
|
};
|
|
18
|
+
export declare function firstEditFrom(edits: readonly Edit[], start: number): number;
|
|
18
19
|
export declare function rangeText(content: string, range: Extent, edits: readonly Edit[]): string;
|
|
19
20
|
export declare function projectionInput(document: Document, file: string, context: ProjectionContext): InputResult;
|
|
20
21
|
export declare function project(document: Document, file: string, context?: ProjectionContext): Projection;
|
package/dist/mdmodel/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Definition } from './definition.js';
|
|
|
2
2
|
export type Library = Readonly<Record<string, string>>;
|
|
3
3
|
export type VerifiedModel = {
|
|
4
4
|
readonly types: Readonly<Record<string, Definition>>;
|
|
5
|
+
readonly nameable?: readonly string[];
|
|
5
6
|
};
|
|
6
7
|
export type ModelVerification = {
|
|
7
8
|
readonly verdict: 'accept';
|
|
@@ -13,13 +14,14 @@ export type ModelVerification = {
|
|
|
13
14
|
};
|
|
14
15
|
export type ValidationContext = {
|
|
15
16
|
readonly binaryTargets: readonly string[];
|
|
17
|
+
readonly anyRoom?: true;
|
|
16
18
|
};
|
|
17
19
|
export type ProjectionContext = {
|
|
18
20
|
readonly documentTargets: readonly string[];
|
|
19
21
|
readonly definition?: Definition;
|
|
20
22
|
};
|
|
21
23
|
export type DivisionContext = ProjectionContext & {
|
|
22
|
-
readonly
|
|
24
|
+
readonly bound: number;
|
|
23
25
|
};
|
|
24
26
|
export type Extent = {
|
|
25
27
|
readonly start: number;
|
|
@@ -60,6 +62,10 @@ export type Validation = {
|
|
|
60
62
|
} | ({
|
|
61
63
|
readonly verdict: 'refuse';
|
|
62
64
|
} & Refusal);
|
|
65
|
+
export type ValidationStep = {
|
|
66
|
+
readonly path: string;
|
|
67
|
+
readonly resolved: number;
|
|
68
|
+
};
|
|
63
69
|
export type Projection = {
|
|
64
70
|
readonly ok: true;
|
|
65
71
|
readonly text: string;
|
|
@@ -92,14 +98,31 @@ export type Link = {
|
|
|
92
98
|
readonly href: string;
|
|
93
99
|
readonly target: string;
|
|
94
100
|
};
|
|
95
|
-
export type LinkOccurrence = Link & {
|
|
96
|
-
readonly start: number;
|
|
97
|
-
};
|
|
98
101
|
export type Reference = {
|
|
99
102
|
readonly pointer: string;
|
|
100
103
|
readonly value: string;
|
|
101
104
|
readonly to: readonly string[];
|
|
105
|
+
readonly crossRoom?: true;
|
|
102
106
|
};
|
|
107
|
+
export type RoomReference = {
|
|
108
|
+
readonly handle: string;
|
|
109
|
+
readonly path: string;
|
|
110
|
+
} & ({
|
|
111
|
+
readonly kind: 'link';
|
|
112
|
+
readonly href: string;
|
|
113
|
+
} | {
|
|
114
|
+
readonly kind: 'field';
|
|
115
|
+
readonly pointer: string;
|
|
116
|
+
readonly value: string;
|
|
117
|
+
readonly to: readonly string[];
|
|
118
|
+
readonly crossRoom?: true;
|
|
119
|
+
} | {
|
|
120
|
+
readonly kind: 'item';
|
|
121
|
+
readonly section: string;
|
|
122
|
+
readonly href: string;
|
|
123
|
+
readonly to: readonly string[];
|
|
124
|
+
readonly crossRoom?: true;
|
|
125
|
+
});
|
|
103
126
|
export type Change = {
|
|
104
127
|
readonly kind: 'field';
|
|
105
128
|
readonly name: string;
|
|
@@ -130,6 +153,7 @@ export type ApplyResult = {
|
|
|
130
153
|
} | {
|
|
131
154
|
readonly outcome: 'stale';
|
|
132
155
|
readonly document: Document;
|
|
156
|
+
readonly stale: readonly number[];
|
|
133
157
|
} | {
|
|
134
158
|
readonly outcome: 'refuse';
|
|
135
159
|
readonly refusal: Refusal;
|
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
import { type Definition } from './definition.js';
|
|
2
|
-
import type { DocumentCheck, Library, ModelVerification, Reached, Validation, ValidationContext, VerifiedModel } from './types.js';
|
|
2
|
+
import type { DocumentCheck, Library, ModelVerification, Reached, RoomReference, Validation, ValidationContext, ValidationStep, VerifiedModel } from './types.js';
|
|
3
3
|
export declare function resolves(reference: Reached, typeOf: (path: string) => string | undefined, binary: (path: string) => boolean): boolean;
|
|
4
|
-
export declare function verify(schema: string): ModelVerification;
|
|
5
|
-
export declare function checkDocument(file: string, content: string, model: VerifiedModel): DocumentCheck;
|
|
4
|
+
export declare function verify(schema: string, provided?: VerifiedModel): ModelVerification;
|
|
5
|
+
export declare function checkDocument(file: string, content: string, model: VerifiedModel, context?: Pick<ValidationContext, 'anyRoom'>): DocumentCheck;
|
|
6
6
|
export declare function sectionReferences(file: string, content: string, definition: Definition): readonly Reached[];
|
|
7
|
+
export declare function bodyRoomLinks(body: string): RoomReference[];
|
|
8
|
+
export declare function roomReferences(file: string, content: string, definition?: Definition): readonly RoomReference[];
|
|
9
|
+
type Placed = {
|
|
10
|
+
readonly reference: Reached;
|
|
11
|
+
readonly location: string;
|
|
12
|
+
};
|
|
13
|
+
export type Assessment = {
|
|
14
|
+
readonly file: string;
|
|
15
|
+
readonly type: string | undefined;
|
|
16
|
+
readonly targets: readonly string[];
|
|
17
|
+
readonly read: Validation | null;
|
|
18
|
+
readonly structured: Validation | null;
|
|
19
|
+
readonly fields: readonly Placed[];
|
|
20
|
+
readonly linked: boolean;
|
|
21
|
+
readonly sections: readonly Placed[];
|
|
22
|
+
};
|
|
23
|
+
export declare function assess(file: string, content: string, binary: boolean, model?: VerifiedModel, context?: Pick<ValidationContext, 'anyRoom'>): Assessment;
|
|
24
|
+
export type Verdicts = {
|
|
25
|
+
add(assessment: Assessment, typeOf: (path: string) => string | undefined, binary: (path: string) => boolean): number;
|
|
26
|
+
verdict(): Validation;
|
|
27
|
+
};
|
|
28
|
+
export declare function verdicts(): Verdicts;
|
|
29
|
+
export declare function validating(library: ReadonlyMap<string, string>, context?: ValidationContext, model?: VerifiedModel): Generator<ValidationStep, Validation, void>;
|
|
7
30
|
export declare function validate(library: Library, context?: ValidationContext, model?: VerifiedModel): Validation;
|
|
31
|
+
export {};
|