@agentshouse/app-bridge 0.1.0-alpha.9 → 0.1.0-c094380be07ea

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 (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -79
  3. package/dist/calls.d.ts +117 -0
  4. package/dist/calls.js +1 -0
  5. package/dist/index.d.ts +152 -0
  6. package/dist/index.js +1 -0
  7. package/dist/mdmodel/blocks.d.ts +10 -0
  8. package/dist/mdmodel/condition.d.ts +149 -0
  9. package/dist/mdmodel/definition.d.ts +65 -0
  10. package/dist/mdmodel/divide.d.ts +2 -0
  11. package/dist/mdmodel/document.d.ts +15 -0
  12. package/dist/mdmodel/fields.d.ts +5 -0
  13. package/dist/mdmodel/index.d.ts +18 -0
  14. package/dist/mdmodel/paths.d.ts +17 -0
  15. package/dist/mdmodel/profile.d.ts +5 -0
  16. package/dist/mdmodel/project.d.ts +20 -0
  17. package/dist/mdmodel/references.d.ts +3 -0
  18. package/dist/mdmodel/types.d.ts +143 -0
  19. package/dist/mdmodel/validate.d.ts +7 -0
  20. package/dist/mdmodel/version.d.ts +1 -0
  21. package/dist/mdmodel/yaml.d.ts +55 -0
  22. package/dist/mdruntime/acquisition.d.ts +13 -0
  23. package/dist/mdruntime/adapter.d.ts +477 -0
  24. package/dist/mdruntime/binary.d.ts +22 -0
  25. package/dist/mdruntime/change-set.d.ts +34 -0
  26. package/dist/mdruntime/change.d.ts +88 -0
  27. package/dist/mdruntime/client.d.ts +81 -0
  28. package/dist/mdruntime/collection.d.ts +38 -0
  29. package/dist/mdruntime/connection.d.ts +138 -0
  30. package/dist/mdruntime/conversation.d.ts +103 -0
  31. package/dist/mdruntime/durability.d.ts +14 -0
  32. package/dist/mdruntime/failure.d.ts +12 -0
  33. package/dist/mdruntime/file.d.ts +19 -0
  34. package/dist/mdruntime/model.d.ts +56 -0
  35. package/dist/mdruntime/observation.d.ts +29 -0
  36. package/dist/mdruntime/open.d.ts +1 -0
  37. package/dist/mdruntime/outcome.d.ts +46 -0
  38. package/dist/mdruntime/overlay.d.ts +26 -0
  39. package/dist/mdruntime/query.d.ts +246 -0
  40. package/dist/mdruntime/reach.d.ts +45 -0
  41. package/dist/mdruntime/readiness.d.ts +52 -0
  42. package/dist/mdruntime/recovery.d.ts +24 -0
  43. package/dist/mdruntime/replica.d.ts +45 -0
  44. package/dist/mdruntime/room-draft.d.ts +143 -0
  45. package/dist/mdruntime/rows.d.ts +36 -0
  46. package/dist/mdruntime/save.d.ts +63 -0
  47. package/dist/mdruntime/search.d.ts +83 -0
  48. package/dist/mdruntime/shared.d.ts +10 -0
  49. package/dist/mdruntime/status.d.ts +26 -0
  50. package/dist/mdruntime/store.d.ts +159 -0
  51. package/dist/mdruntime/transfer.d.ts +9 -0
  52. package/dist/mdruntime/turn.d.ts +6 -0
  53. package/dist/mdruntime/wire.d.ts +104 -0
  54. package/dist/test-host.d.ts +33 -0
  55. package/dist/test-host.js +200 -0
  56. package/docs/families.md +136 -0
  57. package/package.json +11 -14
  58. package/client/src/bridge.d.ts +0 -35
  59. package/client/src/bridge.js +0 -229
  60. package/client/src/index.d.ts +0 -3
  61. package/client/src/index.js +0 -2
  62. package/client/src/test-host.d.ts +0 -30
  63. package/client/src/test-host.js +0 -159
  64. package/client/src/wire.d.ts +0 -69
  65. package/client/src/wire.js +0 -1
  66. package/src/apps/remainder.d.ts +0 -2
  67. package/src/apps/remainder.js +0 -16
  68. package/src/apps/tab.d.ts +0 -6
  69. package/src/apps/tab.js +0 -27
@@ -0,0 +1,5 @@
1
+ export declare const TYPE_FIELD = "type";
2
+ export declare const MEMBER_FIELD = "member";
3
+ export declare const SITE_FIELD = "site";
4
+ export declare const RECEIVED_FIELD = "received";
5
+ export declare const HOUSE_FIELDS: readonly string[];
@@ -0,0 +1,18 @@
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';
3
+ export { headingLines } from './blocks.js';
4
+ export type { HeadingLine } from './blocks.js';
5
+ export { divide } from './divide.js';
6
+ export { apply, bodyLinks, fieldStart, linkOccurrences, links, parse, parseFrontmatter, relativize, relativizeBody, relinkBody, serialize, } from './document.js';
7
+ export { HOUSE_FIELDS, MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } from './fields.js';
8
+ export { relative, retarget, target } from './paths.js';
9
+ export { MARKDOWN_SYNTAX_PROFILE } from './profile.js';
10
+ export { project } from './project.js';
11
+ 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, LinkOccurrence, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, Span, Validation, ValidationContext, VerifiedModel, } from './types.js';
15
+ export { checkDocument, resolves, sectionReferences, validate, verify } from './validate.js';
16
+ export { VERSION } from './version.js';
17
+ export { equalValue, frontmatterValue } from './yaml.js';
18
+ export type { FrontmatterValue } from './yaml.js';
@@ -0,0 +1,17 @@
1
+ export declare function dirname(path: string): string;
2
+ export declare function join(base: string, relative: string): string;
3
+ export declare function normalize(path: string): string | null;
4
+ export declare function destinationPath(href: string): string | null;
5
+ export declare function classifyHref(from: string, href: string): {
6
+ kind: 'skip';
7
+ } | {
8
+ kind: 'path';
9
+ path: string;
10
+ } | {
11
+ kind: 'invalid';
12
+ };
13
+ export declare function target(from: string, href: string): string | null;
14
+ export declare function retarget(href: string, to: string): string;
15
+ export declare function relative(from: string, target: string): string;
16
+ export declare const SHELL_ROOMS = "/rooms/";
17
+ export declare function shellTarget(href: string, handle: string): string | null;
@@ -0,0 +1,5 @@
1
+ export declare const MARKDOWN_SYNTAX_PROFILE: {
2
+ readonly name: 'GitHub Flavored Markdown';
3
+ readonly spec: '0.29';
4
+ readonly url: 'https://github.github.com/gfm/';
5
+ };
@@ -0,0 +1,20 @@
1
+ import type { Document, Extent, Projection, ProjectionContext, Refusal } from './types.js';
2
+ export type Piece = Extent & {
3
+ readonly text: string;
4
+ };
5
+ export type Edit = Piece;
6
+ export type Input = {
7
+ readonly values: readonly Piece[];
8
+ readonly ranges: readonly Extent[];
9
+ readonly edits: readonly Edit[];
10
+ };
11
+ export type InputResult = {
12
+ readonly ok: true;
13
+ readonly input: Input;
14
+ } | {
15
+ readonly ok: false;
16
+ readonly refusal: Refusal;
17
+ };
18
+ export declare function rangeText(content: string, range: Extent, edits: readonly Edit[]): string;
19
+ export declare function projectionInput(document: Document, file: string, context: ProjectionContext): InputResult;
20
+ export declare function project(document: Document, file: string, context?: ProjectionContext): Projection;
@@ -0,0 +1,3 @@
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[];
@@ -0,0 +1,143 @@
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
+ };
6
+ export type ModelVerification = {
7
+ readonly verdict: 'accept';
8
+ readonly model: VerifiedModel;
9
+ } | {
10
+ readonly verdict: 'refuse';
11
+ readonly rule: string;
12
+ readonly location?: string;
13
+ };
14
+ export type ValidationContext = {
15
+ readonly binaryTargets: readonly string[];
16
+ };
17
+ export type ProjectionContext = {
18
+ readonly documentTargets: readonly string[];
19
+ readonly definition?: Definition;
20
+ };
21
+ export type DivisionContext = ProjectionContext & {
22
+ readonly budget: number;
23
+ };
24
+ export type Extent = {
25
+ readonly start: number;
26
+ readonly end: number;
27
+ };
28
+ export type Span = Extent & {
29
+ readonly text: string;
30
+ };
31
+ export type Frontmatter = {
32
+ readonly content: string;
33
+ readonly type: string | undefined;
34
+ readonly fields: Readonly<Record<string, unknown>>;
35
+ };
36
+ export type Document = Frontmatter & {
37
+ readonly preamble: string;
38
+ readonly sections: Readonly<Record<string, string>>;
39
+ };
40
+ export type Refusal = {
41
+ readonly file: string;
42
+ readonly rule: string;
43
+ readonly location?: string;
44
+ readonly referrers?: readonly string[];
45
+ };
46
+ export type Reached = {
47
+ readonly target: string | null;
48
+ readonly to: readonly string[];
49
+ };
50
+ export type DocumentCheck = {
51
+ readonly ok: false;
52
+ } | {
53
+ readonly ok: true;
54
+ readonly type: string;
55
+ readonly typed: boolean;
56
+ readonly references: readonly Reached[];
57
+ };
58
+ export type Validation = {
59
+ readonly verdict: 'accept';
60
+ } | ({
61
+ readonly verdict: 'refuse';
62
+ } & Refusal);
63
+ export type Projection = {
64
+ readonly ok: true;
65
+ readonly text: string;
66
+ } | {
67
+ readonly ok: false;
68
+ readonly refusal: Refusal;
69
+ };
70
+ export type Division = {
71
+ readonly ok: true;
72
+ readonly spans: readonly Span[];
73
+ } | {
74
+ readonly ok: false;
75
+ readonly refusal: Refusal;
76
+ };
77
+ export type FrontmatterResult = {
78
+ readonly ok: true;
79
+ readonly frontmatter: Frontmatter;
80
+ } | {
81
+ readonly ok: false;
82
+ readonly refusal: Refusal;
83
+ };
84
+ export type ParseResult = {
85
+ readonly ok: true;
86
+ readonly document: Document;
87
+ } | {
88
+ readonly ok: false;
89
+ readonly refusal: Refusal;
90
+ };
91
+ export type Link = {
92
+ readonly href: string;
93
+ readonly target: string;
94
+ };
95
+ export type LinkOccurrence = Link & {
96
+ readonly start: number;
97
+ };
98
+ export type Reference = {
99
+ readonly pointer: string;
100
+ readonly value: string;
101
+ readonly to: readonly string[];
102
+ };
103
+ export type Change = {
104
+ readonly kind: 'field';
105
+ readonly name: string;
106
+ readonly value: unknown;
107
+ readonly prior: unknown;
108
+ } | {
109
+ readonly kind: 'section';
110
+ readonly name: string;
111
+ readonly value: string;
112
+ readonly prior: string;
113
+ } | {
114
+ readonly kind: 'preamble';
115
+ readonly value: string;
116
+ readonly prior: string;
117
+ } | {
118
+ readonly kind: 'link';
119
+ readonly href: string;
120
+ readonly to: string;
121
+ } | {
122
+ readonly kind: 'reference';
123
+ readonly pointer: string;
124
+ readonly value: string;
125
+ readonly prior: string;
126
+ };
127
+ export type ApplyResult = {
128
+ readonly outcome: 'applied';
129
+ readonly document: Document;
130
+ } | {
131
+ readonly outcome: 'stale';
132
+ readonly document: Document;
133
+ } | {
134
+ readonly outcome: 'refuse';
135
+ readonly refusal: Refusal;
136
+ };
137
+ export type BodyResult = {
138
+ readonly outcome: 'applied';
139
+ readonly body: string;
140
+ } | {
141
+ readonly outcome: 'refuse';
142
+ readonly refusal: Refusal;
143
+ };
@@ -0,0 +1,7 @@
1
+ import { type Definition } from './definition.js';
2
+ import type { DocumentCheck, Library, ModelVerification, Reached, Validation, ValidationContext, 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): ModelVerification;
5
+ export declare function checkDocument(file: string, content: string, model: VerifiedModel): DocumentCheck;
6
+ export declare function sectionReferences(file: string, content: string, definition: Definition): readonly Reached[];
7
+ export declare function validate(library: Library, context?: ValidationContext, model?: VerifiedModel): Validation;
@@ -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';
@@ -0,0 +1,13 @@
1
+ export type RuntimeDemand = {
2
+ readonly whole: boolean;
3
+ readonly rooms: readonly string[];
4
+ readonly handles: readonly string[];
5
+ readonly conversations: boolean;
6
+ };
7
+ export declare const WHOLE_DEMAND: RuntimeDemand;
8
+ export declare function demanded(demand: RuntimeDemand, room: {
9
+ readonly locator: string;
10
+ readonly handle: string;
11
+ }): boolean;
12
+ export declare function wider(next: RuntimeDemand, current: RuntimeDemand): boolean;
13
+ export declare function narrower(next: RuntimeDemand, current: RuntimeDemand): boolean;