@agentshouse/app-bridge 0.1.0-ccf413b4e709d → 0.1.0-ccf6bf7d473e2

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 (110) hide show
  1. package/README.md +11 -9
  2. package/dist/index.d.ts +588 -7
  3. package/dist/mdmodel/body.d.ts +84 -0
  4. package/dist/mdmodel/built-in.d.ts +3 -0
  5. package/dist/mdmodel/crockford.d.ts +3 -0
  6. package/dist/mdmodel/definition.d.ts +90 -0
  7. package/dist/mdmodel/divide.d.ts +2 -0
  8. package/dist/mdmodel/document.d.ts +22 -0
  9. package/dist/mdmodel/event.d.ts +76 -0
  10. package/dist/mdmodel/facts.d.ts +14 -0
  11. package/dist/mdmodel/fields.d.ts +5 -0
  12. package/dist/mdmodel/house-model.d.ts +826 -0
  13. package/dist/mdmodel/house-references.d.ts +3 -0
  14. package/dist/mdmodel/index.d.ts +42 -0
  15. package/dist/mdmodel/kinds.d.ts +17 -0
  16. package/dist/mdmodel/markdown.d.ts +74 -0
  17. package/dist/mdmodel/media-type.d.ts +71 -0
  18. package/dist/mdmodel/paths.d.ts +34 -0
  19. package/dist/mdmodel/pattern.d.ts +9 -0
  20. package/dist/mdmodel/project.d.ts +21 -0
  21. package/dist/mdmodel/query/language.d.ts +253 -0
  22. package/dist/mdmodel/query/match.d.ts +13 -0
  23. package/dist/mdmodel/query/rows.d.ts +31 -0
  24. package/dist/mdmodel/query/sql.d.ts +38 -0
  25. package/dist/mdmodel/references.d.ts +3 -0
  26. package/dist/mdmodel/reserved.d.ts +5 -0
  27. package/dist/mdmodel/room-types.d.ts +6 -0
  28. package/dist/mdmodel/types.d.ts +181 -0
  29. package/dist/mdmodel/validate.d.ts +35 -0
  30. package/dist/mdmodel/version.d.ts +1 -0
  31. package/dist/mdmodel/yaml.d.ts +55 -0
  32. package/dist/mdruntime/actions.d.ts +25 -0
  33. package/dist/mdruntime/adapter.d.ts +540 -0
  34. package/dist/mdruntime/attached-model.d.ts +6 -0
  35. package/dist/mdruntime/binary.d.ts +17 -0
  36. package/dist/mdruntime/bootstrap.d.ts +43 -0
  37. package/dist/mdruntime/cell.d.ts +5 -0
  38. package/dist/mdruntime/chain.d.ts +11 -0
  39. package/dist/mdruntime/change-set.d.ts +31 -0
  40. package/dist/mdruntime/change.d.ts +119 -0
  41. package/dist/mdruntime/client.d.ts +97 -0
  42. package/dist/mdruntime/collection.d.ts +46 -0
  43. package/dist/mdruntime/compile.d.ts +17 -0
  44. package/dist/mdruntime/conversation-live.d.ts +146 -0
  45. package/dist/mdruntime/conversation-row.d.ts +32 -0
  46. package/dist/mdruntime/conversation.d.ts +135 -0
  47. package/dist/mdruntime/declaration.d.ts +9 -0
  48. package/dist/mdruntime/durability.d.ts +30 -0
  49. package/dist/mdruntime/failure.d.ts +15 -0
  50. package/dist/mdruntime/figures.d.ts +48 -0
  51. package/dist/mdruntime/holdings.d.ts +28 -0
  52. package/dist/mdruntime/identity.d.ts +5 -0
  53. package/dist/mdruntime/listing.d.ts +47 -0
  54. package/dist/mdruntime/live.d.ts +22 -0
  55. package/dist/mdruntime/media.d.ts +7 -0
  56. package/dist/mdruntime/messages.d.ts +55 -0
  57. package/dist/mdruntime/model.d.ts +54 -0
  58. package/dist/mdruntime/observation.d.ts +45 -0
  59. package/dist/mdruntime/open.d.ts +1 -0
  60. package/dist/mdruntime/opened.d.ts +21 -0
  61. package/dist/mdruntime/outcome.d.ts +94 -0
  62. package/dist/mdruntime/overlay.d.ts +29 -0
  63. package/dist/mdruntime/preparation.d.ts +19 -0
  64. package/dist/mdruntime/presence.d.ts +51 -0
  65. package/dist/mdruntime/query.d.ts +87 -0
  66. package/dist/mdruntime/reach.d.ts +55 -0
  67. package/dist/mdruntime/readiness.d.ts +48 -0
  68. package/dist/mdruntime/reads.d.ts +38 -0
  69. package/dist/mdruntime/recovery.d.ts +27 -0
  70. package/dist/mdruntime/refresh.d.ts +26 -0
  71. package/dist/mdruntime/replica.d.ts +62 -0
  72. package/dist/mdruntime/retried.d.ts +29 -0
  73. package/dist/mdruntime/room-draft.d.ts +172 -0
  74. package/dist/mdruntime/room-drafts.d.ts +23 -0
  75. package/dist/mdruntime/runtime.d.ts +33 -0
  76. package/dist/mdruntime/save.d.ts +58 -0
  77. package/dist/mdruntime/saves.d.ts +31 -0
  78. package/dist/mdruntime/search.d.ts +21 -0
  79. package/dist/mdruntime/seed.d.ts +24 -0
  80. package/dist/mdruntime/socket/admission.d.ts +6 -0
  81. package/dist/mdruntime/socket/answers.d.ts +5 -0
  82. package/dist/mdruntime/socket/lanes.d.ts +27 -0
  83. package/dist/mdruntime/socket/session.d.ts +37 -0
  84. package/dist/mdruntime/socket.d.ts +66 -0
  85. package/dist/mdruntime/source.d.ts +53 -0
  86. package/dist/mdruntime/status.d.ts +25 -0
  87. package/dist/mdruntime/store/installs.d.ts +29 -0
  88. package/dist/mdruntime/store/readiness.d.ts +9 -0
  89. package/dist/mdruntime/store/records.d.ts +214 -0
  90. package/dist/mdruntime/store/room-held.d.ts +7 -0
  91. package/dist/mdruntime/store/space.d.ts +10 -0
  92. package/dist/mdruntime/store/watchers.d.ts +16 -0
  93. package/dist/mdruntime/store/writes.d.ts +23 -0
  94. package/dist/mdruntime/store.d.ts +121 -0
  95. package/dist/mdruntime/stored.d.ts +156 -0
  96. package/dist/mdruntime/surface.d.ts +88 -0
  97. package/dist/mdruntime/tables.d.ts +414 -0
  98. package/dist/mdruntime/tallies.d.ts +17 -0
  99. package/dist/mdruntime/transfer.d.ts +4 -0
  100. package/dist/mdruntime/wire.d.ts +295 -0
  101. package/dist/session-content/bounds.d.ts +7 -0
  102. package/dist/session-content/check.d.ts +18 -0
  103. package/dist/session-content/index.d.ts +7 -0
  104. package/dist/session-content/parts.d.ts +103 -0
  105. package/dist/session-content/state.d.ts +61 -0
  106. package/dist/session-content/turn.d.ts +328 -0
  107. package/dist/test-host.d.ts +8 -2
  108. package/dist/test-host.js +48 -12
  109. package/docs/families.md +70 -20
  110. package/package.json +8 -6
@@ -0,0 +1,181 @@
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
+ readonly text: string;
49
+ readonly ranges: Readonly<Record<string, Extent>>;
50
+ readonly listEnd: number;
51
+ };
52
+ export type DefinitionOf = (type: string | undefined) => Definition | undefined;
53
+ export type Refusal = {
54
+ readonly file: string;
55
+ readonly rule: string;
56
+ readonly location?: string;
57
+ readonly line?: number;
58
+ readonly referrers?: readonly string[];
59
+ };
60
+ export type Reached = {
61
+ readonly target: string | null;
62
+ readonly to: readonly string[];
63
+ };
64
+ export type DocumentCheck = {
65
+ readonly ok: false;
66
+ } | {
67
+ readonly ok: true;
68
+ readonly type: string;
69
+ readonly typed: boolean;
70
+ readonly references: readonly Reached[];
71
+ };
72
+ export type Validation = {
73
+ readonly verdict: 'accept';
74
+ } | ({
75
+ readonly verdict: 'refuse';
76
+ } & Refusal);
77
+ export type ValidationStep = {
78
+ readonly path: string;
79
+ readonly resolved: number;
80
+ };
81
+ export type Projection = {
82
+ readonly ok: true;
83
+ readonly text: string;
84
+ } | {
85
+ readonly ok: false;
86
+ readonly refusal: Refusal;
87
+ };
88
+ export type Division = {
89
+ readonly ok: true;
90
+ readonly spans: readonly Span[];
91
+ } | {
92
+ readonly ok: false;
93
+ readonly refusal: Refusal;
94
+ };
95
+ export type FrontmatterResult = {
96
+ readonly ok: true;
97
+ readonly frontmatter: Frontmatter;
98
+ } | {
99
+ readonly ok: false;
100
+ readonly refusal: Refusal;
101
+ };
102
+ export type ParseResult = {
103
+ readonly ok: true;
104
+ readonly document: Document;
105
+ } | {
106
+ readonly ok: false;
107
+ readonly refusal: Refusal;
108
+ };
109
+ export type Link = {
110
+ readonly href: string;
111
+ readonly target: string;
112
+ };
113
+ export type Reference = {
114
+ readonly pointer: string;
115
+ readonly value: string;
116
+ readonly to: readonly string[];
117
+ readonly crossRoom?: true;
118
+ };
119
+ export type RoomReference = {
120
+ readonly handle: string;
121
+ readonly path: string;
122
+ } & ({
123
+ readonly kind: 'link';
124
+ readonly href: string;
125
+ } | {
126
+ readonly kind: 'field';
127
+ readonly pointer: string;
128
+ readonly value: string;
129
+ readonly to: readonly string[];
130
+ readonly crossRoom?: true;
131
+ });
132
+ export type Change = {
133
+ readonly kind: 'field';
134
+ readonly name: string;
135
+ readonly value: unknown;
136
+ readonly prior: unknown;
137
+ } | {
138
+ readonly kind: 'section';
139
+ readonly name: string;
140
+ readonly value: string;
141
+ readonly prior: string | undefined;
142
+ } | {
143
+ readonly kind: 'preamble';
144
+ readonly value: string;
145
+ readonly prior: string;
146
+ } | {
147
+ readonly kind: 'text';
148
+ readonly value: string;
149
+ readonly prior: string;
150
+ } | {
151
+ readonly kind: 'link';
152
+ readonly href: string;
153
+ readonly to: string;
154
+ } | {
155
+ readonly kind: 'reference';
156
+ readonly pointer: string;
157
+ readonly value: string;
158
+ readonly prior: string;
159
+ };
160
+ export type ApplyResult = {
161
+ readonly outcome: 'applied';
162
+ readonly document: Document;
163
+ } | {
164
+ readonly outcome: 'stale';
165
+ readonly document: Document;
166
+ readonly stale: readonly number[];
167
+ } | {
168
+ readonly outcome: 'refuse';
169
+ readonly refusal: Refusal;
170
+ };
171
+ export type BodyResult = {
172
+ readonly outcome: 'applied';
173
+ readonly body: string;
174
+ } | {
175
+ readonly outcome: 'refuse';
176
+ readonly refusal: Refusal;
177
+ };
178
+ export type UnlinkedBody = {
179
+ readonly body: string;
180
+ readonly links: ReadonlyMap<string, string>;
181
+ };
@@ -0,0 +1,35 @@
1
+ import { type Definition } from './definition.js';
2
+ import type { DefinitionOf, Document, DocumentCheck, Library, ModelVerification, ParseResult, Reached, RoomReference, TypedPath, Validation, ValidationContext, ValidationStep, VerifiedModel } from './types.js';
3
+ export declare function definitionAt(model: VerifiedModel, file: string, typedPaths?: readonly TypedPath[]): DefinitionOf;
4
+ export declare function resolves(reference: Reached, typeOf: (path: string) => string | undefined, binary: (path: string) => boolean): boolean;
5
+ export declare function verify(schema: string, provided?: VerifiedModel): ModelVerification;
6
+ export declare function readTypes(schema: string, provided?: VerifiedModel): VerifiedModel;
7
+ type Placing = Pick<ValidationContext, 'anyRoom' | 'typedPaths'>;
8
+ export declare function checkDocument(file: string, content: string, model: VerifiedModel, context?: Placing): DocumentCheck;
9
+ export declare function bodyRoomLinks(body: string): RoomReference[];
10
+ export declare function roomReferences(document: Document, definition?: Definition): readonly RoomReference[];
11
+ type Placed = {
12
+ readonly reference: Reached;
13
+ readonly location: string;
14
+ readonly line?: number;
15
+ };
16
+ export type Assessment = {
17
+ readonly file: string;
18
+ readonly type: string | undefined;
19
+ readonly targets: readonly string[];
20
+ readonly read: Validation | null;
21
+ readonly structured: Validation | null;
22
+ readonly fields: readonly Placed[];
23
+ readonly linked: boolean;
24
+ };
25
+ export declare function assess(file: string, parsed: ParseResult, binary: boolean, model?: VerifiedModel, context?: Placing): Assessment;
26
+ export declare function assessReferences(file: string, parsed: ParseResult, changed: ReadonlySet<string>, model?: VerifiedModel, context?: Placing): Assessment;
27
+ export type Verdicts = {
28
+ add(assessment: Assessment, typeOf: (path: string) => string | undefined, binary: (path: string) => boolean): number;
29
+ verdict(): Validation;
30
+ };
31
+ export declare function verdicts(): Verdicts;
32
+ export declare function validating(library: ReadonlyMap<string, string>, context?: ValidationContext, model?: VerifiedModel): Generator<ValidationStep, Validation, void>;
33
+ export declare function validate(library: Library, context?: ValidationContext, model?: VerifiedModel): Validation;
34
+ export declare function validateParsed(library: ReadonlyMap<string, ParseResult>, context?: ValidationContext, model?: VerifiedModel): Validation;
35
+ 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';
@@ -0,0 +1,25 @@
1
+ import type { ConversationHistoryRequest } from './adapter.js';
2
+ import { type CallResult, type HistoryAnswer, type Resolution } from './outcome.js';
3
+ import type { Attempted } from './recovery.js';
4
+ import type { Attempt } from './retried.js';
5
+ import type { Runtime } from './runtime.js';
6
+ export type HistoryQuery = {
7
+ revision?: string;
8
+ pageToken?: string;
9
+ };
10
+ export declare function readHistory(runtime: Runtime, locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
11
+ export declare function located(runtime: Runtime, room: string, path: string, destination: string): Promise<{
12
+ room: string;
13
+ path: string;
14
+ } | null>;
15
+ export declare function resolveReference(runtime: Runtime, room: string, path: string, destination: string): Promise<Resolution>;
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>;
21
+ export declare function readConversationHistory(runtime: Runtime, request: ConversationHistoryRequest): 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>;
24
+ export declare function resendCalls(runtime: Runtime, signal: AbortSignal): Promise<Attempted>;
25
+ export declare function resendLater(runtime: Runtime): void;