@agentshouse/app-bridge 0.1.0-c3aff7d33e077 → 0.1.0-c3ee7fcd01608

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.
Files changed (103) hide show
  1. package/README.md +2 -2
  2. package/dist/index.d.ts +173 -422
  3. package/dist/mdmodel/body.d.ts +84 -0
  4. package/dist/mdmodel/built-in.d.ts +3 -0
  5. package/dist/mdmodel/definition.d.ts +23 -10
  6. package/dist/mdmodel/document.d.ts +14 -8
  7. package/dist/mdmodel/event.d.ts +1 -2
  8. package/dist/mdmodel/fields.d.ts +1 -1
  9. package/dist/mdmodel/house-model.d.ts +869 -0
  10. package/dist/mdmodel/house-references/crockford.d.ts +3 -0
  11. package/dist/mdmodel/house-references/patterns.d.ts +8 -0
  12. package/dist/mdmodel/index.d.ts +31 -15
  13. package/dist/mdmodel/indexed.d.ts +8 -0
  14. package/dist/mdmodel/kinds.d.ts +4 -2
  15. package/dist/mdmodel/markdown.d.ts +74 -0
  16. package/dist/mdmodel/media-type.d.ts +71 -0
  17. package/dist/mdmodel/moment.d.ts +6 -0
  18. package/dist/mdmodel/not-ready.d.ts +1 -0
  19. package/dist/mdmodel/paths.d.ts +15 -1
  20. package/dist/mdmodel/query/language.d.ts +2 -1
  21. package/dist/mdmodel/query/match.d.ts +1 -1
  22. package/dist/mdmodel/query/rows.d.ts +1 -1
  23. package/dist/mdmodel/query/sql.d.ts +5 -1
  24. package/dist/mdmodel/query/walk.d.ts +62 -0
  25. package/dist/mdmodel/references.d.ts +2 -2
  26. package/dist/mdmodel/reserved.d.ts +1 -0
  27. package/dist/mdmodel/room-types.d.ts +6 -0
  28. package/dist/mdmodel/types.d.ts +11 -17
  29. package/dist/mdmodel/validate.d.ts +6 -2
  30. package/dist/mdmodel/yaml.d.ts +4 -4
  31. package/dist/mdruntime/actions.d.ts +8 -2
  32. package/dist/mdruntime/adapter.d.ts +120 -57
  33. package/dist/mdruntime/attached-model.d.ts +0 -1
  34. package/dist/mdruntime/authored.d.ts +87 -0
  35. package/dist/mdruntime/bootstrap.d.ts +1 -1
  36. package/dist/mdruntime/change-set.d.ts +4 -0
  37. package/dist/mdruntime/change.d.ts +4 -0
  38. package/dist/mdruntime/client.d.ts +19 -21
  39. package/dist/mdruntime/collection.d.ts +26 -4
  40. package/dist/mdruntime/compile.d.ts +2 -0
  41. package/dist/mdruntime/conversation-live.d.ts +28 -12
  42. package/dist/mdruntime/conversation-row.d.ts +8 -1
  43. package/dist/mdruntime/conversation.d.ts +37 -12
  44. package/dist/mdruntime/declaration.d.ts +9 -0
  45. package/dist/mdruntime/durability.d.ts +5 -0
  46. package/dist/mdruntime/failure.d.ts +3 -0
  47. package/dist/mdruntime/figures.d.ts +1 -0
  48. package/dist/mdruntime/house-query.d.ts +14 -0
  49. package/dist/mdruntime/install.d.ts +10 -6
  50. package/dist/mdruntime/listing.d.ts +29 -22
  51. package/dist/mdruntime/live.d.ts +5 -3
  52. package/dist/mdruntime/media.d.ts +19 -2
  53. package/dist/mdruntime/messages.d.ts +12 -6
  54. package/dist/mdruntime/modal.d.ts +1 -0
  55. package/dist/mdruntime/model.d.ts +4 -3
  56. package/dist/mdruntime/observation.d.ts +29 -12
  57. package/dist/mdruntime/opened.d.ts +1 -1
  58. package/dist/mdruntime/outcome.d.ts +13 -1
  59. package/dist/mdruntime/overlay.d.ts +6 -2
  60. package/dist/mdruntime/preparation.d.ts +33 -7
  61. package/dist/mdruntime/presence.d.ts +57 -0
  62. package/dist/mdruntime/query.d.ts +0 -1
  63. package/dist/mdruntime/reach.d.ts +15 -6
  64. package/dist/mdruntime/readiness.d.ts +20 -5
  65. package/dist/mdruntime/reads.d.ts +4 -2
  66. package/dist/mdruntime/recovery.d.ts +4 -1
  67. package/dist/mdruntime/replica.d.ts +5 -10
  68. package/dist/mdruntime/retried.d.ts +29 -0
  69. package/dist/mdruntime/room-draft.d.ts +31 -8
  70. package/dist/mdruntime/runtime.d.ts +11 -19
  71. package/dist/mdruntime/save.d.ts +42 -88
  72. package/dist/mdruntime/saves.d.ts +4 -40
  73. package/dist/mdruntime/socket/lanes.d.ts +12 -4
  74. package/dist/mdruntime/socket/session.d.ts +4 -2
  75. package/dist/mdruntime/socket.d.ts +4 -6
  76. package/dist/mdruntime/source.d.ts +5 -7
  77. package/dist/mdruntime/store/installs.d.ts +2 -2
  78. package/dist/mdruntime/store/readiness.d.ts +5 -4
  79. package/dist/mdruntime/store/records.d.ts +23 -8
  80. package/dist/mdruntime/store/rooms-shown.d.ts +7 -0
  81. package/dist/mdruntime/store/space.d.ts +1 -1
  82. package/dist/mdruntime/store.d.ts +26 -16
  83. package/dist/mdruntime/stored.d.ts +33 -15
  84. package/dist/mdruntime/surface.d.ts +12 -6
  85. package/dist/mdruntime/tables.d.ts +19 -58
  86. package/dist/mdruntime/wire.d.ts +66 -7
  87. package/dist/session-content/check.d.ts +17 -0
  88. package/dist/session-content/index.d.ts +6 -0
  89. package/dist/session-content/parts.d.ts +30 -0
  90. package/dist/session-content/state.d.ts +59 -0
  91. package/dist/session-content/turn.d.ts +137 -0
  92. package/dist/test-host.d.ts +8 -1
  93. package/dist/test-host.js +44 -1
  94. package/docs/families.md +61 -33
  95. package/package.json +2 -2
  96. package/dist/mdmodel/blocks.d.ts +0 -10
  97. package/dist/mdmodel/links.d.ts +0 -28
  98. package/dist/mdmodel/profile.d.ts +0 -5
  99. package/dist/mdruntime/job.d.ts +0 -32
  100. package/dist/mdruntime/log.d.ts +0 -5
  101. package/dist/mdruntime/socket/rooms.d.ts +0 -42
  102. package/dist/mdruntime/store/fences.d.ts +0 -15
  103. package/dist/mdruntime/turn.d.ts +0 -8
@@ -0,0 +1,3 @@
1
+ export declare const CROCKFORD_ALPHABET = "0123456789abcdefghjkmnpqrstvwxyz";
2
+ export declare const CROCKFORD_CHARACTER = "[0123456789abcdefghjkmnpqrstvwxyz]";
3
+ export declare const CROCKFORD_LEADING_CHARACTER: string;
@@ -0,0 +1,8 @@
1
+ export declare const ROOM_REFERENCE_PREFIX = "r_";
2
+ export declare const APP_REFERENCE_PREFIX = "a_";
3
+ export declare const SPACE_REFERENCE_PREFIX = "sp_";
4
+ export declare const REVISION_REFERENCE_PREFIX = "fr_";
5
+ export declare const ROOM_REFERENCE_PATTERN: RegExp;
6
+ export declare const APP_REFERENCE_PATTERN: RegExp;
7
+ export declare const SPACE_REFERENCE_PATTERN: RegExp;
8
+ export declare const REVISION_REFERENCE_PATTERN: RegExp;
@@ -1,33 +1,49 @@
1
1
  export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
2
2
  export type { Actor, DocumentEvent, DocumentFacts, Fact, ItemFacts, MessageFacts, Resolved, WriteDoor, } from './event.js';
3
- export { byCodePoint, compared, dated, fitsKind, instant, instantKey, KINDS, kindOf, kindWords, } from './kinds.js';
3
+ export { byCodePoint, compared, dated, fitsKind, indexKey, instant, instantKey, 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
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
+ export { countOf, countShape, pageOrder, walkedValue, walkOf } from './query/walk.js';
8
+ export type { Count, KeyBound, KeyRange, PageOrder, Walk, WalkRun } from './query/walk.js';
9
+ export { verifyIndexBounds } from './indexed.js';
10
+ export type { IndexBounds } from './indexed.js';
7
11
  export { heldAt, matches } from './query/match.js';
8
12
  export type { Candidate } from './query/match.js';
9
13
  export { heldKind, indexed } from './query/rows.js';
10
14
  export type { HeldKind, HeldLink, HeldValue, Indexed, Reach } from './query/rows.js';
11
15
  export * as sql from './query/sql.js';
12
- export { headingLines } from './blocks.js';
13
- export type { HeadingLine } from './blocks.js';
16
+ export { headingLines } from './markdown.js';
17
+ export type { HeadingLine } from './markdown.js';
18
+ export { acceptsType, dataUrl, dataUrlPattern, declaresUtf8, FILE_MEDIA_TYPES, fileExtension, formDataType, gitMediaType, isAudioType, isImageType, isVideoType, MEDIA_TYPES, mediaTypeEssence, SCRIPT_MEDIA_TYPES, servedMediaType, UTF8_TEXT, withCharset, } from './media-type.js';
19
+ export { shownDay, shownMoment } from './moment.js';
20
+ export type { MomentReader } from './moment.js';
21
+ export { labelAt, NAME_FIELD } from './body.js';
22
+ export type { Naming } from './body.js';
14
23
  export { divide } from './divide.js';
15
- export { apply, bodyLinks, links, parse, parseFrontmatter, relativize, relativizeBody, relinkBody, serialize, unlinkBody, } from './document.js';
24
+ export { apply, bodyLinks, create, links, parse, partText, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
16
25
  export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
26
+ export { notReadyWaitMs } from './not-ready.js';
17
27
  export type { ReferenceTarget, SavedFacts } from './facts.js';
18
- export { HOUSE_FIELDS, MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } from './fields.js';
19
- export { relative, retarget, roomPath, roomTarget, target } from './paths.js';
28
+ export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './house-references/crockford.js';
29
+ export { HOUSE_FIELDS, MEMBER_FIELD, SITE_FIELD, SUBMITTED_FIELD, TYPE_FIELD } from './fields.js';
30
+ export { HOUSE_MODEL, HOUSE_ROOM_TYPES } from './built-in.js';
31
+ export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS } from './house-model.js';
32
+ export { APP_REFERENCE_PATTERN, APP_REFERENCE_PREFIX, ROOM_REFERENCE_PATTERN, REVISION_REFERENCE_PATTERN, REVISION_REFERENCE_PREFIX, ROOM_REFERENCE_PREFIX, SPACE_REFERENCE_PATTERN, SPACE_REFERENCE_PREFIX, } from './house-references/patterns.js';
33
+ export type { HouseDocumentFields, HouseModelType } from './house-model.js';
34
+ export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES } from './room-types.js';
35
+ export type { InboxChannelKind } from './room-types.js';
36
+ export { keyedDestination, keyedLink, linkedPath, relative, retarget, roomPath, roomTarget, target, } from './paths.js';
20
37
  export { openPatternBudget } from './pattern.js';
21
- export type { RoomTarget } from './paths.js';
22
- export { MARKDOWN_SYNTAX_PROFILE } from './profile.js';
38
+ export type { LinkedPath, RoomTarget } from './paths.js';
23
39
  export { project } from './project.js';
24
40
  export { references } from './references.js';
25
- export { isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION } from './reserved.js';
26
- export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, } from './definition.js';
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, UnlinkedBody, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
29
- export { assess, assessReferences, bodyRoomLinks, checkDocument, readTypes, resolves, roomReferences, validate, validating, verdicts, verify, } from './validate.js';
41
+ export { CAPTURE_HOME, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
42
+ export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, untitled, } from './definition.js';
43
+ export type { Definition, FieldRules, JsonType, PatternFacts, PointerFacts, RuleValue, Shape, Transition, ValueFacts, } from './definition.js';
44
+ export type { ApplyResult, BodyResult, Change, DefinitionOf, Division, DivisionContext, Document, DocumentCheck, Extent, Library, ModelVerification, Link, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, RoomReference, Span, TypedPath, UnlinkedBody, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
45
+ export { assess, assessReferences, bodyKeyedLinks, bodyRoomLinks, checkDocument, definitionAt, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, } from './validate.js';
30
46
  export type { Assessment, Verdicts } from './validate.js';
31
47
  export { VERSION } from './version.js';
32
- export { bodyAfterFrontmatter, equalValue, frontmatterValue, plain } from './yaml.js';
33
- export type { FrontmatterValue } from './yaml.js';
48
+ export { bodyAfterFrontmatter, documentValue, equalValue, plain } from './yaml.js';
49
+ export type { DocumentValue } from './yaml.js';
@@ -0,0 +1,8 @@
1
+ import { type Failure } from './definition.js';
2
+ import type { ModelVerification, VerifiedModel } from './types.js';
3
+ export type IndexBounds = {
4
+ readonly perType: number;
5
+ readonly longestText: number;
6
+ };
7
+ export declare function indexedFailure(model: VerifiedModel): Failure | undefined;
8
+ export declare function verifyIndexBounds(model: VerifiedModel, bounds: IndexBounds): ModelVerification;
@@ -1,6 +1,5 @@
1
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];
2
+ export type Kind = 'string' | 'number' | 'integer' | 'boolean' | 'date' | 'date-time' | 'time' | 'enum' | 'reference';
4
3
  export type Ordering = {
5
4
  readonly direction: 'asc' | 'desc';
6
5
  readonly nulls: 'first' | 'last';
@@ -14,5 +13,8 @@ export declare function kindWords(facts: ValueFacts | undefined): readonly strin
14
13
  export declare function dated(value: unknown): value is string;
15
14
  export declare function instant(value: unknown): bigint | undefined;
16
15
  export declare function instantKey(value: unknown): string | null;
16
+ export declare function instantOf(facts: ValueFacts | undefined, value: unknown): string | null;
17
+ export declare function indexKey(facts: ValueFacts, value: unknown): Uint8Array;
18
+ export declare function sortedKey(value: unknown): Uint8Array | null;
17
19
  export declare function byCodePoint(left: string, right: string): number;
18
20
  export declare function compared(left: unknown, right: unknown, ordering: Ordering): number;
@@ -0,0 +1,74 @@
1
+ import type { Extent } from './types.js';
2
+ export type HeadingLine = {
3
+ readonly level: number;
4
+ readonly name: string;
5
+ readonly start: number;
6
+ readonly textEnd: number;
7
+ readonly next: number;
8
+ };
9
+ export type HrefOccurrence = {
10
+ readonly href: string;
11
+ readonly start: number;
12
+ readonly end: number;
13
+ readonly bracketed: boolean;
14
+ };
15
+ export type LinkUse = {
16
+ readonly start: number;
17
+ readonly end: number;
18
+ readonly labelStart: number;
19
+ readonly labelEnd: number;
20
+ readonly destination: HrefOccurrence;
21
+ };
22
+ export type DefinitionBlock = {
23
+ readonly start: number;
24
+ readonly end: number;
25
+ readonly destination: HrefOccurrence;
26
+ };
27
+ export type Node = {
28
+ readonly type: string;
29
+ readonly position?: {
30
+ readonly start: {
31
+ readonly offset?: number;
32
+ };
33
+ readonly end: {
34
+ readonly offset?: number;
35
+ };
36
+ };
37
+ readonly children?: readonly Node[];
38
+ readonly depth?: number;
39
+ readonly identifier?: string;
40
+ readonly checked?: boolean | null;
41
+ readonly ordered?: boolean | null;
42
+ readonly lang?: string | null;
43
+ readonly value?: string;
44
+ };
45
+ export type Reading = {
46
+ readonly headings: readonly HeadingLine[];
47
+ readonly blocks: readonly Extent[];
48
+ readonly uses: readonly LinkUse[];
49
+ readonly definitions: readonly DefinitionBlock[];
50
+ readonly tree: readonly Node[];
51
+ readonly base: number;
52
+ };
53
+ export declare function lineBreaks(text: string): readonly number[];
54
+ export declare function lineNumber(breaks: readonly number[], offset: number): number;
55
+ export declare function lineStart(text: string, index: number): number;
56
+ export declare function lineEnd(text: string, index: number): {
57
+ readonly end: number;
58
+ readonly next: number;
59
+ };
60
+ export declare function read(text: string, at?: number): Reading;
61
+ export declare function destinations(reading: Reading): readonly HrefOccurrence[];
62
+ export declare function linkable(text: string, from?: number): boolean;
63
+ export declare function hrefOccurrences(body: string): readonly HrefOccurrence[];
64
+ export declare function headingLines(content: string, from: number, to: number): HeadingLine[];
65
+ export type SectionSpan = {
66
+ readonly name: string;
67
+ readonly headingStart: number;
68
+ readonly bodyStart: number;
69
+ readonly bodyEnd: number;
70
+ };
71
+ export declare function sectionSpans(reading: Reading, end: number): SectionSpan[];
72
+ export declare function sectionsRecord(spans: readonly SectionSpan[], content: string): Record<string, string>;
73
+ export declare function headingsIn(reading: Reading, from: number, to: number): readonly HeadingLine[];
74
+ export declare function blockRanges(reading: Reading, from: number, to: number): Extent[];
@@ -0,0 +1,71 @@
1
+ export declare const MEDIA_TYPES: {
2
+ readonly html: 'text/html';
3
+ readonly css: 'text/css';
4
+ readonly javascript: 'text/javascript';
5
+ readonly plainText: 'text/plain';
6
+ readonly markdown: 'text/markdown';
7
+ readonly csv: 'text/csv';
8
+ readonly json: 'application/json';
9
+ readonly xml: 'application/xml';
10
+ readonly yaml: 'application/yaml';
11
+ readonly ndjson: 'application/x-ndjson';
12
+ readonly webManifest: 'application/manifest+json';
13
+ readonly reports: 'application/reports+json';
14
+ readonly githubJson: 'application/vnd.github+json';
15
+ readonly form: 'application/x-www-form-urlencoded';
16
+ readonly octetStream: 'application/octet-stream';
17
+ readonly gzip: 'application/gzip';
18
+ readonly tar: 'application/x-tar';
19
+ readonly zip: 'application/zip';
20
+ readonly gitBundle: 'application/x-git-bundle';
21
+ readonly wasm: 'application/wasm';
22
+ readonly pdf: 'application/pdf';
23
+ readonly docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
24
+ readonly pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
25
+ readonly xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
26
+ readonly avif: 'image/avif';
27
+ readonly gif: 'image/gif';
28
+ readonly heic: 'image/heic';
29
+ readonly icon: 'image/vnd.microsoft.icon';
30
+ readonly jpeg: 'image/jpeg';
31
+ readonly png: 'image/png';
32
+ readonly svg: 'image/svg+xml';
33
+ readonly webp: 'image/webp';
34
+ readonly aac: 'audio/aac';
35
+ readonly amr: 'audio/amr';
36
+ readonly m4a: 'audio/mp4';
37
+ readonly mp3: 'audio/mpeg';
38
+ readonly ogg: 'audio/ogg';
39
+ readonly wav: 'audio/wav';
40
+ readonly threeGpp: 'video/3gpp';
41
+ readonly mp4: 'video/mp4';
42
+ readonly quickTime: 'video/quicktime';
43
+ readonly webm: 'video/webm';
44
+ readonly otf: 'font/otf';
45
+ readonly ttf: 'font/ttf';
46
+ readonly woff: 'font/woff';
47
+ readonly woff2: 'font/woff2';
48
+ };
49
+ export declare function withCharset(type: string, charset: string): string;
50
+ export declare const UTF8_TEXT: {
51
+ readonly html: string;
52
+ readonly css: string;
53
+ readonly javascript: string;
54
+ readonly plainText: string;
55
+ readonly markdown: string;
56
+ readonly xml: string;
57
+ };
58
+ export declare const SCRIPT_MEDIA_TYPES: readonly string[];
59
+ export declare const FILE_MEDIA_TYPES: Readonly<Record<string, string>>;
60
+ export declare function servedMediaType(path: string): string;
61
+ export declare function fileExtension(type: string): string | null;
62
+ export declare function dataUrl(type: string, base64: string): string;
63
+ export declare function dataUrlPattern(types: readonly string[]): RegExp;
64
+ export declare function formDataType(boundary: string): string;
65
+ export declare function gitMediaType(service: string, part: 'advertisement' | 'request' | 'result'): string;
66
+ export declare function mediaTypeEssence(value: string): string;
67
+ export declare function declaresUtf8(value: string): boolean;
68
+ export declare function acceptsType(accept: string | undefined, type: string): boolean;
69
+ export declare function isImageType(value: string): boolean;
70
+ export declare function isVideoType(value: string): boolean;
71
+ export declare function isAudioType(value: string): boolean;
@@ -0,0 +1,6 @@
1
+ export interface MomentReader {
2
+ readonly language: string;
3
+ readonly zone: string | null;
4
+ }
5
+ export declare function shownMoment(at: Date, reader: MomentReader): string;
6
+ export declare function shownDay(at: Date, reader: MomentReader): string;
@@ -0,0 +1 @@
1
+ export declare function notReadyWaitMs(asked: number): number;
@@ -6,7 +6,7 @@ export type RoomTarget = {
6
6
  readonly handle: string;
7
7
  readonly path: string;
8
8
  };
9
- export declare function classifyHref(from: string, href: string): {
9
+ type Classified = {
10
10
  kind: 'skip';
11
11
  } | {
12
12
  kind: 'path';
@@ -16,10 +16,24 @@ export declare function classifyHref(from: string, href: string): {
16
16
  } & RoomTarget) | {
17
17
  kind: 'invalid';
18
18
  };
19
+ export declare function classifyHref(from: string, href: string): Classified;
19
20
  export declare function roomTarget(href: string): RoomTarget | null;
20
21
  export declare function roomPath(href: string): string | null;
21
22
  export declare function target(from: string, href: string): string | null;
23
+ export interface LinkedPath {
24
+ readonly handle: string | null;
25
+ readonly path: string;
26
+ readonly fragment: string | null;
27
+ }
28
+ export declare function linkedPath(from: string, href: string): LinkedPath | null;
29
+ export interface KeyedLink extends RoomTarget {
30
+ readonly key: string;
31
+ }
32
+ export declare function keyedLink(href: string): KeyedLink | null;
33
+ export declare function keyedDestination(path: string, key: string): string;
22
34
  export declare function retarget(href: string, to: string): string;
23
35
  export declare function relative(from: string, target: string): string;
24
36
  export declare const SHELL_ROOMS = "/rooms/";
25
37
  export declare function shellTarget(href: string, handle: string): string | null;
38
+ export declare function destinationText(to: string, bracketed: boolean): string | null;
39
+ export {};
@@ -1,4 +1,4 @@
1
- import { type Definition } from '../definition.js';
1
+ import { type Definition, type ValueFacts } from '../definition.js';
2
2
  export type Value = string | number | boolean | null;
3
3
  export type Predicate = Value | {
4
4
  $eq: Value;
@@ -245,6 +245,7 @@ export declare function bodied(shape: DocumentShape): boolean;
245
245
  export declare function invalid(at: At, problem: string, accepts?: readonly string[]): never;
246
246
  export declare function placeText(at: Place): string;
247
247
  export declare function known(value: Entries, allowed: readonly string[], at: At): void;
248
+ export declare function textless(facts: ValueFacts): boolean;
248
249
  export declare function planOf(input: unknown, facts: HeldRooms): QueryPlan;
249
250
  export declare function cursorOf(values: readonly unknown[]): string;
250
251
  export declare function decodedCursor(text: string): readonly unknown[] | null;
@@ -6,7 +6,7 @@ export type Candidate = {
6
6
  readonly type: string | null;
7
7
  readonly fileId: string | null;
8
8
  readonly fields: Readonly<Record<string, unknown>>;
9
- readonly definition?: Pick<Definition, 'frontmatter'>;
9
+ readonly definition?: Pick<Definition, 'root'>;
10
10
  readonly text: string | null;
11
11
  };
12
12
  export declare function heldAt(candidate: Candidate, field: string): readonly HeldValue[];
@@ -28,4 +28,4 @@ export type Placed = {
28
28
  };
29
29
  export declare function placedOf(pointer: string, reach: Reach): Placed;
30
30
  export declare function heldKind(value: unknown): HeldKind;
31
- export declare function indexed(path: string, fields: Readonly<Record<string, unknown>>, definition: Pick<Definition, 'frontmatter'> | undefined): Indexed;
31
+ export declare function indexed(path: string, fields: Readonly<Record<string, unknown>>, definition: Pick<Definition, 'root'> | undefined): Indexed;
@@ -28,7 +28,11 @@ export declare function any(parts: readonly Fragment[]): Fragment;
28
28
  export declare function grouped(part: Fragment): Fragment;
29
29
  export declare function listed(values: readonly SqlValue[]): Fragment;
30
30
  export declare function exists(part: Fragment): Fragment;
31
- export declare function insertedValues(doc: number, values: readonly HeldValue[]): Fragment;
31
+ export type HeldValues = {
32
+ readonly doc: number;
33
+ readonly values: readonly HeldValue[];
34
+ };
35
+ export declare function insertedValues(held: readonly HeldValues[]): Fragment;
32
36
  export declare function placed(alias: string, field: string, reach: Reach): Fragment;
33
37
  export declare function scoped(alias: string, scope: Scope, byPaths?: boolean): Fragment;
34
38
  export declare function tests(alias: string, plan: QueryPlan): Fragment;
@@ -0,0 +1,62 @@
1
+ import { type Definition } from '../definition.js';
2
+ import type { VerifiedModel } from '../types.js';
3
+ import { type Direction, type QueryPlan } from './language.js';
4
+ export type KeyBound = {
5
+ readonly key: Uint8Array;
6
+ readonly inclusive: boolean;
7
+ };
8
+ export type KeyRange = {
9
+ readonly lower: KeyBound;
10
+ readonly upper: KeyBound | null;
11
+ };
12
+ export type WalkRun = {
13
+ readonly by: 'key';
14
+ readonly key: Uint8Array;
15
+ readonly after: boolean;
16
+ } | {
17
+ readonly by: 'range';
18
+ readonly range: KeyRange;
19
+ };
20
+ export type PageOrder = {
21
+ readonly by: 'path';
22
+ readonly direction: Direction;
23
+ } | {
24
+ readonly by: 'field';
25
+ readonly field: string;
26
+ readonly direction: Direction;
27
+ readonly nulls: 'first' | 'last';
28
+ readonly lexical: boolean;
29
+ readonly after: {
30
+ readonly key: Uint8Array;
31
+ readonly tie: unknown;
32
+ } | null;
33
+ };
34
+ export type Walk = {
35
+ readonly by: 'path';
36
+ readonly direction: Direction;
37
+ } | {
38
+ readonly by: 'keys';
39
+ readonly field: string;
40
+ readonly direction: Direction;
41
+ readonly types: readonly {
42
+ readonly type: string;
43
+ readonly keys: readonly Uint8Array[];
44
+ }[];
45
+ } | {
46
+ readonly by: 'order';
47
+ readonly field: string;
48
+ readonly direction: Direction;
49
+ readonly types: readonly {
50
+ readonly type: string;
51
+ readonly runs: readonly WalkRun[];
52
+ }[];
53
+ };
54
+ export type Count = {
55
+ readonly walk: Walk;
56
+ readonly fields: readonly string[];
57
+ };
58
+ export declare function pageOrder(plan: QueryPlan): PageOrder;
59
+ export declare function walkOf(plan: QueryPlan, model: VerifiedModel): Walk;
60
+ export declare function countShape(plan: QueryPlan): boolean;
61
+ export declare function countOf(plan: QueryPlan, model: VerifiedModel, where: unknown): Count | null;
62
+ export declare function walkedValue(definition: Definition, field: string, value: unknown): unknown;
@@ -1,3 +1,3 @@
1
1
  import { type Definition } from './definition.js';
2
- import type { Frontmatter, Reference } from './types.js';
3
- export declare function references(document: Pick<Frontmatter, 'fields'>, definition: Definition): readonly Reference[];
2
+ import type { Document, Reference } from './types.js';
3
+ export declare function references(document: Pick<Document, 'fields'>, definition: Definition): readonly Reference[];
@@ -1,4 +1,5 @@
1
1
  export declare const ROOM_DESCRIPTION = "ROOM.md";
2
+ export declare const CAPTURE_HOME = "capture";
2
3
  export declare const RESERVED_NAMES: readonly string[];
3
4
  export declare function isReservedName(name: string): boolean;
4
5
  export declare function isDocumentPath(path: string): boolean;
@@ -0,0 +1,6 @@
1
+ export declare const CHAT_TYPE = "chat";
2
+ export declare const CHAT_MESSAGE_TYPE = "chat-message";
3
+ export declare const INBOX_TYPES: readonly string[];
4
+ export declare const INBOX_CHANNEL_KINDS: readonly ['telegram-bot', 'telegram-business', 'whatsapp', 'messenger', 'instagram', 'tiktok'];
5
+ export type InboxChannelKind = (typeof INBOX_CHANNEL_KINDS)[number];
6
+ export declare const ROOM_TYPES_TEXT: string;
@@ -37,19 +37,22 @@ export type Extent = {
37
37
  export type Span = Extent & {
38
38
  readonly text: string;
39
39
  };
40
- export type Frontmatter = {
40
+ export type Document = {
41
41
  readonly content: string;
42
42
  readonly type: string | undefined;
43
43
  readonly fields: Readonly<Record<string, unknown>>;
44
- };
45
- export type Document = Frontmatter & {
46
44
  readonly preamble: string;
47
45
  readonly sections: Readonly<Record<string, string>>;
46
+ readonly text: string;
47
+ readonly ranges: Readonly<Record<string, Extent>>;
48
+ readonly listEnd: number;
48
49
  };
50
+ export type DefinitionOf = (type: string | undefined) => Definition | undefined;
49
51
  export type Refusal = {
50
52
  readonly file: string;
51
53
  readonly rule: string;
52
54
  readonly location?: string;
55
+ readonly line?: number;
53
56
  readonly referrers?: readonly string[];
54
57
  };
55
58
  export type Reached = {
@@ -87,13 +90,6 @@ export type Division = {
87
90
  readonly ok: false;
88
91
  readonly refusal: Refusal;
89
92
  };
90
- export type FrontmatterResult = {
91
- readonly ok: true;
92
- readonly frontmatter: Frontmatter;
93
- } | {
94
- readonly ok: false;
95
- readonly refusal: Refusal;
96
- };
97
93
  export type ParseResult = {
98
94
  readonly ok: true;
99
95
  readonly document: Document;
@@ -123,12 +119,6 @@ export type RoomReference = {
123
119
  readonly value: string;
124
120
  readonly to: readonly string[];
125
121
  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
122
  });
133
123
  export type Change = {
134
124
  readonly kind: 'field';
@@ -139,11 +129,15 @@ export type Change = {
139
129
  readonly kind: 'section';
140
130
  readonly name: string;
141
131
  readonly value: string;
142
- readonly prior: string;
132
+ readonly prior: string | undefined;
143
133
  } | {
144
134
  readonly kind: 'preamble';
145
135
  readonly value: string;
146
136
  readonly prior: string;
137
+ } | {
138
+ readonly kind: 'text';
139
+ readonly value: string;
140
+ readonly prior: string;
147
141
  } | {
148
142
  readonly kind: 'link';
149
143
  readonly href: string;
@@ -1,15 +1,19 @@
1
1
  import { type Definition } from './definition.js';
2
- import type { Document, DocumentCheck, Library, ModelVerification, ParseResult, Reached, RoomReference, Validation, ValidationContext, ValidationStep, VerifiedModel } from './types.js';
2
+ import { type KeyedLink } from './paths.js';
3
+ import type { DefinitionOf, Document, DocumentCheck, Library, ModelVerification, ParseResult, Reached, RoomReference, TypedPath, Validation, ValidationContext, ValidationStep, VerifiedModel } from './types.js';
4
+ export declare function definitionAt(model: VerifiedModel, file: string, typedPaths?: readonly TypedPath[]): DefinitionOf;
3
5
  export declare function resolves(reference: Reached, typeOf: (path: string) => string | undefined, binary: (path: string) => boolean): boolean;
4
6
  export declare function verify(schema: string, provided?: VerifiedModel): ModelVerification;
5
7
  export declare function readTypes(schema: string, provided?: VerifiedModel): VerifiedModel;
6
8
  type Placing = Pick<ValidationContext, 'anyRoom' | 'typedPaths'>;
7
9
  export declare function checkDocument(file: string, content: string, model: VerifiedModel, context?: Placing): DocumentCheck;
8
10
  export declare function bodyRoomLinks(body: string): RoomReference[];
11
+ export declare function bodyKeyedLinks(body: string): KeyedLink[];
9
12
  export declare function roomReferences(document: Document, definition?: Definition): readonly RoomReference[];
10
13
  type Placed = {
11
14
  readonly reference: Reached;
12
15
  readonly location: string;
16
+ readonly line?: number;
13
17
  };
14
18
  export type Assessment = {
15
19
  readonly file: string;
@@ -19,7 +23,6 @@ export type Assessment = {
19
23
  readonly structured: Validation | null;
20
24
  readonly fields: readonly Placed[];
21
25
  readonly linked: boolean;
22
- readonly sections: readonly Placed[];
23
26
  };
24
27
  export declare function assess(file: string, parsed: ParseResult, binary: boolean, model?: VerifiedModel, context?: Placing): Assessment;
25
28
  export declare function assessReferences(file: string, parsed: ParseResult, changed: ReadonlySet<string>, model?: VerifiedModel, context?: Placing): Assessment;
@@ -30,4 +33,5 @@ export type Verdicts = {
30
33
  export declare function verdicts(): Verdicts;
31
34
  export declare function validating(library: ReadonlyMap<string, string>, context?: ValidationContext, model?: VerifiedModel): Generator<ValidationStep, Validation, void>;
32
35
  export declare function validate(library: Library, context?: ValidationContext, model?: VerifiedModel): Validation;
36
+ export declare function validateParsed(library: ReadonlyMap<string, ParseResult>, context?: ValidationContext, model?: VerifiedModel): Validation;
33
37
  export {};
@@ -31,12 +31,12 @@ export declare function parseYamlMapping(text: string, start: number, end: numbe
31
31
  export declare function jsValue(node: YamlNode): unknown;
32
32
  export declare function mapEntry(map: YamlMap, key: string): YamlEntry | undefined;
33
33
  export declare function isPlainSafe(text: string): boolean;
34
- export type FrontmatterValue = string | number | boolean | null | readonly FrontmatterValue[] | {
35
- readonly [name: string]: FrontmatterValue;
34
+ export type DocumentValue = string | number | boolean | null | readonly DocumentValue[] | {
35
+ readonly [name: string]: DocumentValue;
36
36
  };
37
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;
38
+ export declare function documentValue(value: unknown): value is DocumentValue;
39
+ export declare function serializeJs(value: DocumentValue): string;
40
40
  export declare function isRecord(value: unknown): value is Record<string, unknown>;
41
41
  export declare function serializeKey(name: string): string;
42
42
  export declare function bodyStartAfterYaml(content: string, yamlEnd: number): number;
@@ -1,6 +1,7 @@
1
1
  import type { ConversationHistoryRequest } from './adapter.js';
2
2
  import { type CallResult, type HistoryAnswer, type Resolution } from './outcome.js';
3
3
  import type { Attempted } from './recovery.js';
4
+ import type { Attempt } from './retried.js';
4
5
  import type { Runtime } from './runtime.js';
5
6
  export type HistoryQuery = {
6
7
  revision?: string;
@@ -12,8 +13,13 @@ export declare function located(runtime: Runtime, room: string, path: string, de
12
13
  path: string;
13
14
  } | null>;
14
15
  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 type Invoked = {
17
+ readonly dispatching?: () => Promise<void>;
18
+ readonly attempt?: Attempt;
19
+ };
20
+ export declare function invokeAction(runtime: Runtime, name: string, input: unknown, { dispatching, attempt }?: Invoked): Promise<CallResult>;
16
21
  export declare function readConversationHistory(runtime: Runtime, request: ConversationHistoryRequest): Promise<CallResult>;
17
- export declare function called(runtime: Runtime, name: string, input: unknown): Promise<CallResult>;
22
+ export declare function called(runtime: Runtime, name: string, input: unknown, attempt?: Attempt): Promise<CallResult>;
23
+ export declare function answeredCall(runtime: Runtime, operation: string): Promise<boolean>;
18
24
  export declare function resendCalls(runtime: Runtime, signal: AbortSignal): Promise<Attempted>;
19
25
  export declare function resendLater(runtime: Runtime): void;