@agentshouse/mdruntime 0.1.0-c3903a68dcbbf → 0.1.0-c56daf494ecb4

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 (178) hide show
  1. package/AGENTS.md +184 -92
  2. package/README.md +22 -12
  3. package/dist/adapter.d.ts +125 -63
  4. package/dist/adapter.d.ts.map +1 -1
  5. package/dist/adapter.js +1 -9
  6. package/dist/attached-model.d.ts +11 -0
  7. package/dist/attached-model.d.ts.map +1 -0
  8. package/dist/attached-model.js +47 -0
  9. package/dist/attempt.d.ts +16 -0
  10. package/dist/attempt.d.ts.map +1 -0
  11. package/dist/attempt.js +70 -0
  12. package/dist/binary.d.ts +23 -0
  13. package/dist/binary.d.ts.map +1 -0
  14. package/dist/binary.js +8 -0
  15. package/dist/bootstrap.d.ts +20 -6
  16. package/dist/bootstrap.d.ts.map +1 -1
  17. package/dist/bootstrap.js +93 -39
  18. package/dist/change-set.d.ts.map +1 -1
  19. package/dist/change-set.js +20 -17
  20. package/dist/change.d.ts +15 -0
  21. package/dist/change.d.ts.map +1 -1
  22. package/dist/change.js +26 -1
  23. package/dist/chat/acts.d.ts +34 -0
  24. package/dist/chat/acts.d.ts.map +1 -0
  25. package/dist/chat/acts.js +36 -0
  26. package/dist/chat/context.d.ts +3 -0
  27. package/dist/chat/context.d.ts.map +1 -0
  28. package/dist/chat/context.js +10 -0
  29. package/dist/chat/input.d.ts +9 -0
  30. package/dist/chat/input.d.ts.map +1 -0
  31. package/dist/chat/input.js +99 -0
  32. package/dist/chat/kit.d.ts +60 -0
  33. package/dist/chat/kit.d.ts.map +1 -0
  34. package/dist/chat/kit.js +123 -0
  35. package/dist/chat/lasting.d.ts +6 -0
  36. package/dist/chat/lasting.d.ts.map +1 -0
  37. package/dist/chat/lasting.js +19 -0
  38. package/dist/chat/list.d.ts +26 -0
  39. package/dist/chat/list.d.ts.map +1 -0
  40. package/dist/chat/list.js +62 -0
  41. package/dist/chat/markdown.d.ts +20 -0
  42. package/dist/chat/markdown.d.ts.map +1 -0
  43. package/dist/chat/markdown.js +188 -0
  44. package/dist/chat/message.d.ts +6 -0
  45. package/dist/chat/message.d.ts.map +1 -0
  46. package/dist/chat/message.js +192 -0
  47. package/dist/chat/messages.d.ts +21 -0
  48. package/dist/chat/messages.d.ts.map +1 -0
  49. package/dist/chat/messages.js +151 -0
  50. package/dist/chat/name.d.ts +6 -0
  51. package/dist/chat/name.d.ts.map +1 -0
  52. package/dist/chat/name.js +37 -0
  53. package/dist/chat/opened.d.ts +11 -0
  54. package/dist/chat/opened.d.ts.map +1 -0
  55. package/dist/chat/opened.js +17 -0
  56. package/dist/chat/overlay.d.ts +31 -0
  57. package/dist/chat/overlay.d.ts.map +1 -0
  58. package/dist/chat/overlay.js +97 -0
  59. package/dist/chat/parts.d.ts +57 -0
  60. package/dist/chat/parts.d.ts.map +1 -0
  61. package/dist/chat/parts.js +119 -0
  62. package/dist/chat/process.d.ts +20 -0
  63. package/dist/chat/process.d.ts.map +1 -0
  64. package/dist/chat/process.js +32 -0
  65. package/dist/chat/provider.d.ts +63 -0
  66. package/dist/chat/provider.d.ts.map +1 -0
  67. package/dist/chat/provider.js +645 -0
  68. package/dist/chat/question.d.ts +9 -0
  69. package/dist/chat/question.d.ts.map +1 -0
  70. package/dist/chat/question.js +80 -0
  71. package/dist/chat/questions.d.ts +31 -0
  72. package/dist/chat/questions.d.ts.map +1 -0
  73. package/dist/chat/questions.js +111 -0
  74. package/dist/chat/read.d.ts +5 -0
  75. package/dist/chat/read.d.ts.map +1 -0
  76. package/dist/chat/read.js +13 -0
  77. package/dist/chat/ready.d.ts +33 -0
  78. package/dist/chat/ready.d.ts.map +1 -0
  79. package/dist/chat/ready.js +91 -0
  80. package/dist/chat/style.d.ts +4 -0
  81. package/dist/chat/style.d.ts.map +1 -0
  82. package/dist/chat/style.js +302 -0
  83. package/dist/chat.d.ts +14 -0
  84. package/dist/chat.d.ts.map +1 -0
  85. package/dist/chat.js +8 -0
  86. package/dist/client.d.ts +17 -13
  87. package/dist/client.d.ts.map +1 -1
  88. package/dist/client.js +68 -31
  89. package/dist/collection.d.ts +6 -13
  90. package/dist/collection.d.ts.map +1 -1
  91. package/dist/collection.js +56 -29
  92. package/dist/connection.d.ts +28 -33
  93. package/dist/connection.d.ts.map +1 -1
  94. package/dist/connection.js +951 -745
  95. package/dist/conversation.d.ts +32 -13
  96. package/dist/conversation.d.ts.map +1 -1
  97. package/dist/conversation.js +293 -108
  98. package/dist/entry.d.ts +17 -0
  99. package/dist/entry.d.ts.map +1 -0
  100. package/dist/entry.js +156 -0
  101. package/dist/expectation.d.ts +21 -0
  102. package/dist/expectation.d.ts.map +1 -0
  103. package/dist/expectation.js +70 -0
  104. package/dist/failure.d.ts +13 -0
  105. package/dist/failure.d.ts.map +1 -0
  106. package/dist/failure.js +19 -0
  107. package/dist/host.d.ts +9 -3
  108. package/dist/host.d.ts.map +1 -1
  109. package/dist/host.js +49 -68
  110. package/dist/identity.d.ts +3 -0
  111. package/dist/identity.d.ts.map +1 -1
  112. package/dist/identity.js +13 -1
  113. package/dist/index.d.ts +9 -5
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +3 -1
  116. package/dist/memory.d.ts +14 -7
  117. package/dist/memory.d.ts.map +1 -1
  118. package/dist/memory.js +137 -46
  119. package/dist/model.d.ts +13 -12
  120. package/dist/model.d.ts.map +1 -1
  121. package/dist/model.js +6 -3
  122. package/dist/observation.d.ts +2 -0
  123. package/dist/observation.d.ts.map +1 -1
  124. package/dist/observation.js +24 -14
  125. package/dist/open.d.ts +2 -0
  126. package/dist/open.d.ts.map +1 -0
  127. package/dist/open.js +1 -0
  128. package/dist/outcome.d.ts +32 -23
  129. package/dist/outcome.d.ts.map +1 -1
  130. package/dist/outcome.js +41 -1
  131. package/dist/overlay.d.ts +14 -3
  132. package/dist/overlay.d.ts.map +1 -1
  133. package/dist/overlay.js +75 -37
  134. package/dist/paths.d.ts +0 -1
  135. package/dist/paths.d.ts.map +1 -1
  136. package/dist/paths.js +0 -16
  137. package/dist/query.d.ts +12 -3
  138. package/dist/query.d.ts.map +1 -1
  139. package/dist/query.js +78 -36
  140. package/dist/reach.d.ts +42 -0
  141. package/dist/reach.d.ts.map +1 -0
  142. package/dist/reach.js +294 -0
  143. package/dist/react.d.ts +41 -0
  144. package/dist/react.d.ts.map +1 -0
  145. package/dist/react.js +64 -0
  146. package/dist/read-side.d.ts +4 -0
  147. package/dist/read-side.d.ts.map +1 -1
  148. package/dist/read-side.js +125 -56
  149. package/dist/refresh.d.ts +12 -1
  150. package/dist/refresh.d.ts.map +1 -1
  151. package/dist/refresh.js +44 -36
  152. package/dist/replica.d.ts +9 -6
  153. package/dist/replica.d.ts.map +1 -1
  154. package/dist/replica.js +83 -68
  155. package/dist/room-draft.d.ts +29 -9
  156. package/dist/room-draft.d.ts.map +1 -1
  157. package/dist/room-draft.js +137 -26
  158. package/dist/rows.d.ts +7 -2
  159. package/dist/rows.d.ts.map +1 -1
  160. package/dist/rows.js +85 -40
  161. package/dist/save.d.ts +27 -3
  162. package/dist/save.d.ts.map +1 -1
  163. package/dist/save.js +435 -86
  164. package/dist/search.d.ts +3 -2
  165. package/dist/search.d.ts.map +1 -1
  166. package/dist/status.d.ts +2 -2
  167. package/dist/status.d.ts.map +1 -1
  168. package/dist/status.js +0 -8
  169. package/dist/store.d.ts +41 -25
  170. package/dist/store.d.ts.map +1 -1
  171. package/dist/store.js +315 -191
  172. package/dist/wire.d.ts +58 -19
  173. package/dist/wire.d.ts.map +1 -1
  174. package/dist/wire.js +65 -67
  175. package/package.json +31 -7
  176. package/dist/attachment.d.ts +0 -3
  177. package/dist/attachment.d.ts.map +0 -1
  178. package/dist/attachment.js +0 -8
package/dist/client.js CHANGED
@@ -1,5 +1,9 @@
1
1
  import { observed } from './observation.js';
2
- import { answer, AUTHORIZATION_ENDED, carried, envelope, PORT_CLOSED, PROTOCOL_MISMATCH, } from './wire.js';
2
+ import { runtimeError } from './failure.js';
3
+ import { answer, AUTHORIZATION_ENDED, PORT_CLOSED, } from './wire.js';
4
+ function refused(refusal) {
5
+ return runtimeError(refusal.code, refusal.code, refusal.retryable);
6
+ }
3
7
  export function connectMdRuntime(port) {
4
8
  let sequence = 0;
5
9
  let refusal = null;
@@ -7,8 +11,10 @@ export function connectMdRuntime(port) {
7
11
  const calls = new Map();
8
12
  const opening = new Map();
9
13
  const observations = new Map();
14
+ let drawing = null;
15
+ let settling = null;
10
16
  const send = (message) => {
11
- port.postMessage(envelope(message));
17
+ port.postMessage(message);
12
18
  };
13
19
  function begin(id, topic, first) {
14
20
  const handle = observed(first, () => {
@@ -25,7 +31,7 @@ export function connectMdRuntime(port) {
25
31
  if (topic === 'connection-refusal')
26
32
  handle.receive(reported);
27
33
  }
28
- const failure = new Error(reported.reason);
34
+ const failure = refused(reported);
29
35
  for (const [id, waiting] of opening) {
30
36
  if (waiting.topic === 'connection-refusal')
31
37
  waiting.settle(begin(id, waiting.topic, reported));
@@ -36,12 +42,12 @@ export function connectMdRuntime(port) {
36
42
  for (const waiting of calls.values())
37
43
  waiting.fail(failure);
38
44
  calls.clear();
45
+ drawing?.();
39
46
  }
40
- function end(reason) {
47
+ function end(failure) {
41
48
  if (ended !== null)
42
49
  return;
43
- ended = reason;
44
- const failure = new Error(reason);
50
+ ended = failure;
45
51
  for (const waiting of opening.values())
46
52
  waiting.fail(failure);
47
53
  opening.clear();
@@ -51,16 +57,10 @@ export function connectMdRuntime(port) {
51
57
  for (const { handle } of observations.values())
52
58
  handle.end();
53
59
  observations.clear();
60
+ drawing?.();
54
61
  }
55
62
  port.addEventListener('message', (event) => {
56
- const wire = carried(event.data);
57
- if (wire === null)
58
- return;
59
- if (!wire.matching) {
60
- refuse(PROTOCOL_MISMATCH);
61
- return;
62
- }
63
- const message = answer(wire.message);
63
+ const message = answer(event.data);
64
64
  if (message === null)
65
65
  return;
66
66
  if (message.kind === 'refusal') {
@@ -68,7 +68,11 @@ export function connectMdRuntime(port) {
68
68
  return;
69
69
  }
70
70
  if (message.kind === 'ended') {
71
- end(AUTHORIZATION_ENDED);
71
+ for (const { topic, handle } of observations.values()) {
72
+ if (topic === 'member')
73
+ handle.receive(null);
74
+ }
75
+ end(runtimeError('authorization-ended', AUTHORIZATION_ENDED));
72
76
  return;
73
77
  }
74
78
  if (message.kind === 'event') {
@@ -78,31 +82,34 @@ export function connectMdRuntime(port) {
78
82
  const waiting = opening.get(message.id);
79
83
  if (waiting !== undefined) {
80
84
  opening.delete(message.id);
81
- if (message.kind === 'failure')
82
- waiting.fail(new Error(message.message));
85
+ if (message.kind === 'failure') {
86
+ waiting.fail(runtimeError(message.code, message.message, message.retryable));
87
+ }
83
88
  else
84
89
  waiting.settle(begin(message.id, waiting.topic, message.value));
90
+ drawing?.();
85
91
  return;
86
92
  }
87
93
  const called = calls.get(message.id);
88
94
  if (called === undefined)
89
95
  return;
90
96
  calls.delete(message.id);
91
- if (message.kind === 'failure')
92
- called.fail(new Error(message.message));
97
+ if (message.kind === 'failure') {
98
+ called.fail(runtimeError(message.code, message.message, message.retryable));
99
+ }
93
100
  else
94
101
  called.settle(message.value);
95
102
  });
96
103
  port.addEventListener('close', () => {
97
- end(PORT_CLOSED);
104
+ end(runtimeError('port-closed', PORT_CLOSED));
98
105
  });
99
106
  port.start();
100
107
  send({ kind: 'hello' });
101
108
  function ask(member, input) {
102
109
  if (ended !== null)
103
- return Promise.reject(new Error(ended));
110
+ return Promise.reject(ended);
104
111
  if (refusal !== null)
105
- return Promise.reject(new Error(refusal.reason));
112
+ return Promise.reject(refused(refusal));
106
113
  const id = (sequence += 1);
107
114
  return new Promise((settle, fail) => {
108
115
  calls.set(id, { settle: settle, fail });
@@ -111,26 +118,48 @@ export function connectMdRuntime(port) {
111
118
  }
112
119
  function watch(topic, input) {
113
120
  if (ended !== null)
114
- return Promise.reject(new Error(ended));
121
+ return Promise.reject(ended);
115
122
  const id = (sequence += 1);
116
123
  if (refusal !== null) {
117
124
  return topic === 'connection-refusal'
118
125
  ? Promise.resolve(begin(id, topic, refusal))
119
- : Promise.reject(new Error(refusal.reason));
126
+ : Promise.reject(refused(refusal));
120
127
  }
121
128
  return new Promise((settle, fail) => {
122
129
  opening.set(id, { topic, settle, fail });
123
130
  send({ kind: 'observe', id, topic, input });
131
+ drawing?.();
124
132
  });
125
133
  }
134
+ function settled() {
135
+ if (settling !== null)
136
+ return settling;
137
+ settling = new Promise((resolve) => {
138
+ let moved = 0;
139
+ const check = () => {
140
+ moved += 1;
141
+ if (opening.size > 0)
142
+ return;
143
+ const at = moved;
144
+ requestAnimationFrame(() => {
145
+ requestAnimationFrame(() => {
146
+ if (moved !== at || opening.size > 0)
147
+ return;
148
+ drawing = null;
149
+ resolve();
150
+ });
151
+ });
152
+ };
153
+ drawing = check;
154
+ check();
155
+ });
156
+ return settling;
157
+ }
126
158
  return {
127
159
  rooms: () => ask('rooms', []),
128
- slots: () => ask('slots', []),
129
160
  query: ((query) => ask('query', [query])),
130
161
  search: (request) => ask('search', [request]),
131
162
  types: (locator) => ask('types', [locator]),
132
- syncStatus: () => ask('syncStatus', []),
133
- serviceMode: () => ask('serviceMode', []),
134
163
  roomDraft: {
135
164
  list: () => ask('roomDraft.list', []),
136
165
  read: (room, path) => ask('roomDraft.read', [room, path]),
@@ -138,7 +167,6 @@ export function connectMdRuntime(port) {
138
167
  discard: (room, path, revision) => ask('roomDraft.discard', [room, path, revision]),
139
168
  },
140
169
  save: (room, roomDrafts) => ask('save', [room, roomDrafts]),
141
- outcome: (identifier) => ask('outcome', [identifier]),
142
170
  presentation: {
143
171
  read: () => ask('presentation.read', []),
144
172
  write: (value) => ask('presentation.write', [value]),
@@ -155,17 +183,26 @@ export function connectMdRuntime(port) {
155
183
  delete: (conversation) => ask('conversation.delete', [conversation]),
156
184
  },
157
185
  chatDraft: {
158
- write: (conversation, draft) => ask('chatDraft.write', [conversation, draft]),
186
+ write: (conversation, draft, revision) => ask('chatDraft.write', [conversation, draft, revision]),
159
187
  discard: (conversation) => ask('chatDraft.discard', [conversation]),
160
188
  },
161
189
  history: (locator, path, query) => ask('history', [locator, path, query]),
190
+ binaryFile: {
191
+ read: (room, path, revision) => ask('binaryFile.read', [room, path, revision]),
192
+ readReference: (reference) => ask('binaryFile.readReference', [reference]),
193
+ },
162
194
  call: (name, input) => ask('call', [name, input]),
163
195
  reached: (locator, roomVersion, path) => ask('reached', [locator, roomVersion, path]),
164
196
  log: () => ask('log', []),
165
- storageLoss: () => ask('storageLoss', []),
166
197
  persistence: () => ask('persistence', []),
167
- deploymentFacts: () => ask('deploymentFacts', []),
168
198
  observe: ((topic, ...input) => watch(topic, input)),
169
199
  reauthorize: () => ask('reauthorize', []),
200
+ settled,
170
201
  };
171
202
  }
203
+ const turns = new WeakMap();
204
+ export function inTurn(client, work) {
205
+ const next = (turns.get(client) ?? Promise.resolve()).then(work).catch(() => undefined);
206
+ turns.set(client, next);
207
+ return next;
208
+ }
@@ -4,8 +4,9 @@ import type { MdModelIdentity } from './adapter.js';
4
4
  import type { Refused } from './transfer.js';
5
5
  export declare const MD_MODEL: MdModelIdentity;
6
6
  export type Collection = {
7
- documents: Readonly<Record<string, Document>>;
7
+ text: Readonly<Record<string, string>>;
8
8
  composition: Composition;
9
+ document(path: string): Document | undefined;
9
10
  };
10
11
  export type Composition = {
11
12
  model: ModelState;
@@ -13,20 +14,12 @@ export type Composition = {
13
14
  roots: readonly string[];
14
15
  model: ModelState;
15
16
  } | null;
16
- untypedFolders: readonly string[];
17
17
  };
18
- export declare function untyped(roots: readonly string[], path: string): boolean;
19
18
  export declare function governing(composition: Composition, path: string): ModelState;
20
- type Previous = {
21
- text: Readonly<Record<string, string>>;
22
- collection: Collection;
23
- };
24
- export declare function parseCollection(text: Readonly<Record<string, string>>, composition: Composition, previous?: Previous): Collection;
25
- export declare function readCollection(text: Readonly<Record<string, string>>, composition: Composition, previous?: Previous): {
26
- kind: 'read';
27
- collection: Collection;
28
- } | Refused;
19
+ export declare function collectionOf(text: Readonly<Record<string, string>>, composition: Composition, previous?: Collection): Collection;
20
+ export declare function passingDocument(collection: Collection, path: string): Document | undefined;
21
+ export declare function documentsOf(collection: Collection): Generator<readonly [string, Document]>;
22
+ export declare function unreadable(text: Readonly<Record<string, string>>, previous?: Readonly<Record<string, string>>): Refused | null;
29
23
  export declare function validRoot(root: unknown): root is string;
30
24
  export declare function validateCollection(text: Readonly<Record<string, string>>, binaryTargets: readonly string[], composition: Composition): Validation;
31
- export {};
32
25
  //# sourceMappingURL=collection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EAEb,KAAK,UAAU,EAEhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,QAAQ,EAAE,eAAwE,CAAC;AAIhG,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC9C,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE;QAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAE,GAAG,IAAI,CAAC;IAClE,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC,CAAC;AASF,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvE;AAED,wBAAgB,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM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,MAAM,EAAE,EAChC,WAAW,EAAE,WAAW,GACvB,UAAU,CA0BZ"}
@@ -6,42 +6,72 @@ function selected(composition, path) {
6
6
  return (composition.selection !== null &&
7
7
  composition.selection.roots.some((root) => beneath(root, path)));
8
8
  }
9
- export function untyped(roots, path) {
10
- return roots.some((root) => beneath(root, path));
11
- }
12
9
  export function governing(composition, path) {
13
10
  return composition.selection !== null && selected(composition, path)
14
11
  ? composition.selection.model
15
12
  : composition.model;
16
13
  }
17
- function parsedAt(text, path, previous) {
18
- const retained = previous?.collection.documents[path];
19
- return retained !== undefined && previous?.text[path] === text[path]
20
- ? { ok: true, document: retained }
21
- : parse(text[path], path);
14
+ const parsedIn = new WeakMap();
15
+ export function collectionOf(text, composition, previous) {
16
+ const parsed = new Map();
17
+ if (previous !== undefined) {
18
+ for (const [path, held] of parsedIn.get(previous) ?? []) {
19
+ if (previous.text[path] === text[path])
20
+ parsed.set(path, held);
21
+ }
22
+ }
23
+ const collection = {
24
+ text,
25
+ composition,
26
+ document(path) {
27
+ const held = parsed.get(path);
28
+ if (held !== undefined)
29
+ return held ?? undefined;
30
+ const content = text[path];
31
+ if (content === undefined)
32
+ return undefined;
33
+ const read = parse(content, path);
34
+ parsed.set(path, read.ok ? read.document : null);
35
+ return read.ok ? read.document : undefined;
36
+ },
37
+ };
38
+ parsedIn.set(collection, parsed);
39
+ return collection;
22
40
  }
23
- export function parseCollection(text, composition, previous) {
24
- const documents = {};
25
- for (const path of Object.keys(text).sort()) {
26
- if (untyped(composition.untypedFolders, path))
41
+ export function passingDocument(collection, path) {
42
+ const held = parsedIn.get(collection)?.get(path);
43
+ if (held !== undefined)
44
+ return held ?? undefined;
45
+ const content = collection.text[path];
46
+ if (content === undefined)
47
+ return undefined;
48
+ const read = parse(content, path);
49
+ return read.ok ? read.document : undefined;
50
+ }
51
+ export function* documentsOf(collection) {
52
+ const parsed = parsedIn.get(collection);
53
+ for (const path of Object.keys(collection.text).sort()) {
54
+ const held = parsed?.get(path);
55
+ if (held === null)
56
+ continue;
57
+ if (held !== undefined) {
58
+ yield [path, held];
27
59
  continue;
28
- const parsed = parsedAt(text, path, previous);
29
- if (parsed.ok)
30
- documents[path] = parsed.document;
60
+ }
61
+ const read = parse(collection.text[path], path);
62
+ if (read.ok)
63
+ yield [path, read.document];
31
64
  }
32
- return { documents, composition };
33
65
  }
34
- export function readCollection(text, composition, previous) {
35
- const documents = {};
66
+ export function unreadable(text, previous) {
36
67
  for (const path of Object.keys(text).sort()) {
37
- if (untyped(composition.untypedFolders, path))
68
+ if (previous?.[path] === text[path])
38
69
  continue;
39
- const parsed = parsedAt(text, path, previous);
40
- if (!parsed.ok)
41
- return { kind: 'refused', refusal: parsed.refusal };
42
- documents[path] = parsed.document;
70
+ const read = parse(text[path], path);
71
+ if (!read.ok)
72
+ return { kind: 'refused', refusal: read.refusal };
43
73
  }
44
- return { kind: 'read', collection: { documents, composition } };
74
+ return null;
45
75
  }
46
76
  export function validRoot(root) {
47
77
  return typeof root === 'string' && normalize(root) === root;
@@ -61,19 +91,16 @@ export function validateCollection(text, binaryTargets, composition) {
61
91
  const collection = {};
62
92
  const selection = {};
63
93
  for (const [path, content] of Object.entries(text)) {
64
- if (untyped(composition.untypedFolders, path))
65
- continue;
66
94
  if (selected(composition, path))
67
95
  selection[path] = content;
68
96
  else
69
97
  collection[path] = content;
70
98
  }
71
- const linked = binaryTargets.filter((path) => !untyped(composition.untypedFolders, path));
72
99
  const verdicts = [
73
- validateAgainst(collection, linked.filter((path) => !selected(composition, path)), composition.model),
100
+ validateAgainst(collection, binaryTargets.filter((path) => !selected(composition, path)), composition.model),
74
101
  ];
75
102
  if (composition.selection !== null) {
76
- verdicts.push(validateAgainst(selection, linked.filter((path) => selected(composition, path)), composition.selection.model));
103
+ verdicts.push(validateAgainst(selection, binaryTargets.filter((path) => selected(composition, path)), composition.selection.model));
77
104
  }
78
105
  const refusals = verdicts.filter((verdict) => verdict.verdict === 'refuse');
79
106
  if (refusals.length === 0)
@@ -2,58 +2,51 @@ import { type TypesResult } from './model.js';
2
2
  import { type Observation } from './observation.js';
3
3
  import { type DocumentQuery, type DocumentResult, type GroupQuery, type GroupResult } from './query.js';
4
4
  import { type SearchRequest, type SearchResult } from './search.js';
5
- import { type Adapter, type Authorization, type HistoryResult, type RoomAttachment, type ProviderRefusal, type ServiceMode } from './adapter.js';
6
- import { type ChatDraftSurface, type ConversationOptions, type ConversationSurface, type ConversationView } from './conversation.js';
7
- import type { WrittenBy } from './change.js';
8
- import type { CallResult, QueueEntry, SubmissionOutcome } from './outcome.js';
5
+ import { type Adapter, type Authorization, type Member, type ProviderRefusal, type ServiceMode } from './adapter.js';
6
+ import { type ChatDraftSurface, type ConversationAgent, type ConversationEntry, type ConversationOptions, type ConversationSurface, type ConversationView } from './conversation.js';
7
+ import { type WrittenBy } from './change.js';
8
+ import type { Open } from './open.js';
9
+ import { type BinaryReference } from './binary.js';
10
+ import { type BinaryAnswer, type CallResult, type HistoryAnswer, type QueueEntry } from './outcome.js';
9
11
  import { type SaveRefusal } from './save.js';
10
12
  import { type RoomDraft, type RoomDraftWrite } from './room-draft.js';
11
13
  import { type SyncStatus } from './status.js';
12
14
  import { type RuntimeShell } from './durability.js';
15
+ import { type NarrowedView, type PortReach, type RuntimeView } from './reach.js';
13
16
  export type AppTypedSelection = {
14
17
  roots: readonly string[];
15
- attachedModel: import('./model.js').ModelIdentity | null;
16
18
  model: TypesResult;
17
19
  };
18
20
  export type AppRoom = {
19
21
  name: string;
20
22
  locator: string;
23
+ handle: string;
21
24
  operations: import('./adapter.js').OperationScopes;
22
25
  replica: import('./adapter.js').ReplicaAdmission;
23
- attachedModel: import('./model.js').ModelIdentity | null;
24
26
  model: TypesResult;
25
27
  typedSelection: AppTypedSelection | null;
26
- untypedFolders: readonly string[];
27
28
  providerOwnedPaths: readonly string[];
28
29
  roomVersion: string | null;
29
- attachments: readonly RoomAttachment[];
30
+ documents: number;
30
31
  synchronizationAvailable: boolean;
31
32
  refusal: ProviderRefusal | null;
32
33
  };
33
- export type AppSlotEntry = {
34
- room: AppRoom;
35
- segment: string | null;
36
- };
37
- export type AppSlot = {
38
- slot: string;
39
- entries: readonly AppSlotEntry[];
40
- };
41
- export type RoomTypes = {
34
+ export type RoomSchemas = {
42
35
  collection: TypesResult;
43
36
  typedSelection: TypesResult | null;
44
37
  };
45
- export type ConnectionRefusalReason = 'no-matching-version' | 'missing-required-guarantee' | 'md-model-version-mismatch' | 'revoked-authorization' | 'client-host-protocol-mismatch';
38
+ type RefusalReason = 'missing-required-guarantee' | 'revoked-authorization';
39
+ export type ConnectionRefusalCode = Open<RefusalReason>;
46
40
  export type ConnectionRefusal = {
47
- reason: ConnectionRefusalReason;
41
+ code: ConnectionRefusalCode;
42
+ retryable: boolean;
48
43
  reauthorizationOffered: boolean;
49
44
  refusal: ProviderRefusal | null;
50
45
  };
51
46
  export type MdRuntimeOptions = {
52
47
  adapter: Adapter;
53
48
  shell: RuntimeShell;
54
- requiredGuarantees: readonly string[];
55
49
  authorization?: Authorization;
56
- discoveryIntervalMs?: number;
57
50
  signal?: AbortSignal;
58
51
  };
59
52
  export type SaveResult = {
@@ -76,6 +69,10 @@ export type PresentationSurface = {
76
69
  read(app: string): Promise<unknown>;
77
70
  write(app: string, value: unknown): Promise<void>;
78
71
  };
72
+ export type BinaryFileSurface = {
73
+ read(room: string, path: string, revision?: string): Promise<BinaryAnswer>;
74
+ readReference(reference: BinaryReference): Promise<BinaryAnswer>;
75
+ };
79
76
  export type HistoryQuery = {
80
77
  revision?: string;
81
78
  pageToken?: string;
@@ -83,26 +80,22 @@ export type HistoryQuery = {
83
80
  export type MdRuntime = {
84
81
  loaded(): Promise<void>;
85
82
  rooms(): readonly AppRoom[];
86
- slots(): readonly AppSlot[];
87
83
  query: {
88
84
  (query: DocumentQuery): Promise<DocumentResult>;
89
85
  (query: GroupQuery): Promise<GroupResult>;
90
86
  };
91
87
  search(request: SearchRequest): Promise<SearchResult>;
92
- types(locator: string): RoomTypes;
93
- syncStatus(): SyncStatus;
94
- serviceMode(): ServiceMode;
88
+ types(locator: string): RoomSchemas;
95
89
  roomDraft: RoomDraftSurface;
96
90
  conversation: ConversationSurface;
97
91
  chatDraft: ChatDraftSurface;
98
92
  presentation: PresentationSurface;
99
93
  save(room: string, roomDrafts: readonly SavedRoomDraft[], writtenBy?: WrittenBy): Promise<SaveResult>;
100
- outcome(identifier: string): SubmissionOutcome | null;
101
- history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryResult>;
94
+ history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
95
+ binaryFile: BinaryFileSurface;
102
96
  call(name: string, input: unknown): Promise<CallResult>;
103
97
  reached(locator: string, roomVersion: string, path?: string): boolean;
104
98
  log(): string;
105
- storageLoss(): string | null;
106
99
  persistence(): boolean;
107
100
  observe: {
108
101
  (topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;
@@ -110,21 +103,23 @@ export type MdRuntime = {
110
103
  (topic: 'storage-loss'): Promise<Observation<string | null>>;
111
104
  (topic: 'sync-status'): Promise<Observation<SyncStatus>>;
112
105
  (topic: 'service-mode'): Promise<Observation<ServiceMode>>;
106
+ (topic: 'member'): Promise<Observation<Member | null>>;
113
107
  (topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult>>;
114
108
  (topic: 'query', query: GroupQuery): Promise<Observation<GroupResult>>;
115
109
  (topic: 'queue', locator: string): Promise<Observation<readonly QueueEntry[]>>;
116
110
  (topic: 'room-drafts'): Promise<Observation<readonly RoomDraft[]>>;
117
111
  (topic: 'presentation', app: string): Promise<Observation<unknown>>;
118
112
  (topic: 'conversation', conversation: string, options: ConversationOptions): Promise<Observation<ConversationView>>;
113
+ (topic: 'conversations'): Promise<Observation<readonly ConversationEntry[]>>;
114
+ (topic: 'agents'): Promise<Observation<readonly ConversationAgent[]>>;
119
115
  };
120
116
  reauthorize(): Promise<void>;
121
117
  };
122
- export type RuntimeTopic = 'rooms' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation';
123
- export type ComposedRuntime = {
124
- md: MdRuntime;
118
+ export type RuntimeTopic = 'rooms' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents';
119
+ export type ComposedRuntime = RuntimeView & {
125
120
  stop(): Promise<void>;
126
- watch(topic: RuntimeTopic, input: readonly unknown[], deliver: (message: unknown) => void): () => void;
121
+ within(reach: PortReach | null): NarrowedView;
127
122
  };
128
- export declare function createMdRuntime(options: MdRuntimeOptions): MdRuntime;
129
123
  export declare function composeRuntime(options: MdRuntimeOptions): ComposedRuntime;
124
+ export {};
130
125
  //# sourceMappingURL=connection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,WAAW,EAEjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAIL,KAAK,OAAO,EAEZ,KAAK,aAAa,EAIlB,KAAK,aAAa,EAIlB,KAAK,cAAc,EAInB,KAAK,eAAe,EACpB,KAAK,WAAW,EAEjB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EAExB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,aAAa,CAAC;AAG1D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,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