@agentshouse/mdruntime-adapter 0.1.0-ccdfb41af2abb → 0.1.0-cd0511bd2d033
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions.d.ts +1 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +7 -3
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +3 -26
- package/dist/discovery.d.ts +9 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +30 -3
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +2 -1
- package/dist/house-model.d.ts +31 -204
- package/dist/house-model.d.ts.map +1 -1
- package/dist/house-model.js +31 -120
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/read.d.ts +9 -5
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +11 -25
- package/dist/room-types.d.ts +2 -2
- package/dist/room-types.d.ts.map +1 -1
- package/dist/room-types.js +6 -6
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +3 -1
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +7 -9
- package/dist/transport.d.ts +6 -4
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +0 -1
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +1 -6
- package/package.json +2 -2
package/dist/house-model.js
CHANGED
|
@@ -26,27 +26,6 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
26
26
|
maxLength: 512,
|
|
27
27
|
pattern: '^(?:a_[A-Za-z0-9._-]+(?:\\/source)?|r_[A-Za-z0-9._-]+(?:\\/(?:settings|settings\\/schema|settings\\/model|settings\\/indexing|content))?)$',
|
|
28
28
|
},
|
|
29
|
-
trigger_test: {
|
|
30
|
-
description: 'One test of a Trigger condition as the Trigger reference page writes one, a value compared at a `path` or `all`, `any` or `not` of tests.',
|
|
31
|
-
type: 'object',
|
|
32
|
-
additionalProperties: true,
|
|
33
|
-
},
|
|
34
|
-
trigger_values: {
|
|
35
|
-
type: 'array',
|
|
36
|
-
items: { anyOf: [{ type: 'string' }, { type: 'number' }, { type: 'boolean' }] },
|
|
37
|
-
},
|
|
38
|
-
trigger_scope: {
|
|
39
|
-
description: 'The documents a Trigger condition watches, by `type`, by `folder` or one document at its `path`, which `create_trigger` takes as `document`.',
|
|
40
|
-
type: 'object',
|
|
41
|
-
additionalProperties: false,
|
|
42
|
-
properties: {
|
|
43
|
-
type: { type: 'string' },
|
|
44
|
-
folder: { type: 'string' },
|
|
45
|
-
path: { type: 'string' },
|
|
46
|
-
},
|
|
47
|
-
minProperties: 1,
|
|
48
|
-
maxProperties: 1,
|
|
49
|
-
},
|
|
50
29
|
},
|
|
51
30
|
'house-app-preferences': {
|
|
52
31
|
description: "An App's preferences. Its own vocabulary is in the body.",
|
|
@@ -71,7 +50,7 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
71
50
|
'storage-full',
|
|
72
51
|
'sandbox-budget-spent',
|
|
73
52
|
'break-glass-owner-disclosure',
|
|
74
|
-
'
|
|
53
|
+
'agent-function-start-approval-request',
|
|
75
54
|
'export-ready',
|
|
76
55
|
'export-failed',
|
|
77
56
|
'site-disabled',
|
|
@@ -192,7 +171,7 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
192
171
|
access_ended_at: { type: 'string', format: 'date-time' },
|
|
193
172
|
systems: { type: 'array', items: { type: 'string' } },
|
|
194
173
|
case_reference: { type: 'string' },
|
|
195
|
-
|
|
174
|
+
agent_function_request: { $ref: '#/$defs/id' },
|
|
196
175
|
requester: {
|
|
197
176
|
type: 'object',
|
|
198
177
|
additionalProperties: false,
|
|
@@ -206,7 +185,7 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
206
185
|
required: ['name'],
|
|
207
186
|
},
|
|
208
187
|
conversation: { $ref: '#/$defs/id' },
|
|
209
|
-
|
|
188
|
+
agent_function: {
|
|
210
189
|
type: 'object',
|
|
211
190
|
additionalProperties: false,
|
|
212
191
|
properties: {
|
|
@@ -246,11 +225,11 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
246
225
|
description: "The panel's preferences at /rooms/private/settings/panel.md. Its own vocabulary is in the body.",
|
|
247
226
|
properties: {},
|
|
248
227
|
},
|
|
249
|
-
'house-
|
|
250
|
-
description: "One
|
|
228
|
+
'house-agent-function': {
|
|
229
|
+
description: "One Agent function that serves this Room, which House alone writes from its owner's document in their Private Room: the `agent_function` by identifier, its `description`, the `input` a caller sends, empty when it takes nothing, and the `agent` it starts, by `agent` and the `name` that Agent had when this card was last written. The Agent function's instruction is never written here.",
|
|
251
230
|
properties: {
|
|
252
231
|
reflected: { type: 'string', format: 'date-time' },
|
|
253
|
-
|
|
232
|
+
agent_function: { $ref: '#/$defs/id' },
|
|
254
233
|
description: { type: 'string' },
|
|
255
234
|
input: { type: 'string' },
|
|
256
235
|
agent: {
|
|
@@ -260,105 +239,27 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
260
239
|
required: ['agent', 'name'],
|
|
261
240
|
},
|
|
262
241
|
},
|
|
263
|
-
required: ['reflected', '
|
|
242
|
+
required: ['reflected', 'agent_function', 'description', 'input', 'agent'],
|
|
243
|
+
},
|
|
244
|
+
'house-agent-function-document': {
|
|
245
|
+
description: 'One Agent function as its owner writes it in their Private Room at rooms/<room-handle>/agent-functions/<name>.md, a path that binds this type and a document that names no type: what it does as `description`, what a caller sends as `input`, empty when it takes nothing, and the `agent` it starts, by identifier. Its body is the instruction that Agent follows.',
|
|
246
|
+
properties: {
|
|
247
|
+
description: { type: 'string', maxLength: 2000, pattern: '\\S' },
|
|
248
|
+
input: { type: 'string' },
|
|
249
|
+
agent: { $ref: '#/$defs/id' },
|
|
250
|
+
},
|
|
251
|
+
required: ['description', 'input', 'agent'],
|
|
264
252
|
},
|
|
265
253
|
'house-trigger': {
|
|
266
|
-
description: "One Trigger of this Room as its acts wrote it, which House alone writes: its `description`, the `condition` it fires on, its `actions` in order, whether each action and the Trigger are `enabled`, `paused_by` `types` while a change of the Room's types paused it, its `creator` by `user` and the `name` they had then, and when it was `created`. A `notify` action reaches the `users` its `to` names, the members its `fields` name in the matched document and the holders of its `roles`;
|
|
254
|
+
description: "One Trigger of this Room as its acts wrote it, which House alone writes: its `description`, the `condition` it fires on, its `actions` in order, whether each action and the Trigger are `enabled`, `paused_by` `types` while a change of the Room's types paused it, its `creator` by `user` and the `name` they had then, and when it was `created`. A `notify` action reaches the `users` its `to` names, the members its `fields` name in the matched document and the holders of its `roles`; an `agent_function` action sends its `payload` to the Agent function whose card under this Room's `house/agent-functions/` its `card` names, absent while this Room holds no card of that Agent function; a `message` action puts its `text` into the active conversation that Agent function started for what the Event is about, or starts that Agent function when none is active; a `done` action marks Done every active conversation an Agent function request of this Room started for the Event's document; a `function` action runs the `function` its `app`'s latest release declares, on House's servers, or, naming no `app`, the Room owner's Environment function of that name on its Environment, which only a Trigger of their Private Room holds. Whether an action's target holds is not written: it follows from the Room's members, the Agent function's card, the App's latest release and the owner's functions.",
|
|
267
255
|
properties: {
|
|
268
256
|
reflected: { type: 'string', format: 'date-time' },
|
|
269
257
|
trigger: { $ref: '#/$defs/id' },
|
|
270
258
|
description: { type: 'string' },
|
|
271
259
|
condition: {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
additionalProperties: false,
|
|
276
|
-
properties: {
|
|
277
|
-
on: { const: 'documents' },
|
|
278
|
-
scope: { $ref: '#/$defs/trigger_scope' },
|
|
279
|
-
mode: { const: 'starts_matching' },
|
|
280
|
-
new_documents: { type: 'boolean' },
|
|
281
|
-
match: { $ref: '#/$defs/trigger_test' },
|
|
282
|
-
by: { $ref: '#/$defs/trigger_test' },
|
|
283
|
-
moved_between_rooms: { type: 'boolean' },
|
|
284
|
-
},
|
|
285
|
-
required: ['on', 'scope', 'mode', 'new_documents', 'match'],
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
type: 'object',
|
|
289
|
-
additionalProperties: false,
|
|
290
|
-
properties: {
|
|
291
|
-
on: { const: 'documents' },
|
|
292
|
-
scope: { $ref: '#/$defs/trigger_scope' },
|
|
293
|
-
mode: { const: 'field_changes' },
|
|
294
|
-
field: { type: 'string' },
|
|
295
|
-
from: { anyOf: [{ $ref: '#/$defs/trigger_values' }, { const: 'new' }] },
|
|
296
|
-
to: { anyOf: [{ $ref: '#/$defs/trigger_values' }, { const: 'deleted' }] },
|
|
297
|
-
match: { $ref: '#/$defs/trigger_test' },
|
|
298
|
-
by: { $ref: '#/$defs/trigger_test' },
|
|
299
|
-
moved_between_rooms: { type: 'boolean' },
|
|
300
|
-
},
|
|
301
|
-
required: ['on', 'scope', 'mode', 'field'],
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
type: 'object',
|
|
305
|
-
additionalProperties: false,
|
|
306
|
-
properties: {
|
|
307
|
-
on: { const: 'items' },
|
|
308
|
-
source: { type: 'string' },
|
|
309
|
-
address: { type: 'string' },
|
|
310
|
-
match: { $ref: '#/$defs/trigger_test' },
|
|
311
|
-
},
|
|
312
|
-
required: ['on'],
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
type: 'object',
|
|
316
|
-
additionalProperties: false,
|
|
317
|
-
properties: {
|
|
318
|
-
on: { const: 'notifications' },
|
|
319
|
-
match: { $ref: '#/$defs/trigger_test' },
|
|
320
|
-
},
|
|
321
|
-
required: ['on'],
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
type: 'object',
|
|
325
|
-
additionalProperties: false,
|
|
326
|
-
properties: {
|
|
327
|
-
on: { const: 'messages' },
|
|
328
|
-
match: { $ref: '#/$defs/trigger_test' },
|
|
329
|
-
},
|
|
330
|
-
required: ['on'],
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
type: 'object',
|
|
334
|
-
additionalProperties: false,
|
|
335
|
-
properties: {
|
|
336
|
-
on: { const: 'clock' },
|
|
337
|
-
cron: { type: 'string' },
|
|
338
|
-
time_zone: { type: 'string' },
|
|
339
|
-
},
|
|
340
|
-
required: ['on', 'cron', 'time_zone'],
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
type: 'object',
|
|
344
|
-
additionalProperties: false,
|
|
345
|
-
properties: {
|
|
346
|
-
on: { const: 'clock' },
|
|
347
|
-
scope: {
|
|
348
|
-
type: 'object',
|
|
349
|
-
additionalProperties: false,
|
|
350
|
-
properties: { type: { type: 'string' } },
|
|
351
|
-
required: ['type'],
|
|
352
|
-
},
|
|
353
|
-
date: { type: 'string' },
|
|
354
|
-
days: { type: 'integer' },
|
|
355
|
-
at: { type: 'string' },
|
|
356
|
-
time_zone: { type: 'string' },
|
|
357
|
-
match: { $ref: '#/$defs/trigger_test' },
|
|
358
|
-
},
|
|
359
|
-
required: ['on', 'scope', 'date', 'days', 'at', 'time_zone'],
|
|
360
|
-
},
|
|
361
|
-
],
|
|
260
|
+
description: 'When it fires, as the Trigger reference page writes it, a document it names at its current path.',
|
|
261
|
+
type: 'object',
|
|
262
|
+
additionalProperties: true,
|
|
362
263
|
},
|
|
363
264
|
actions: {
|
|
364
265
|
type: 'array',
|
|
@@ -397,7 +298,7 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
397
298
|
type: 'object',
|
|
398
299
|
additionalProperties: false,
|
|
399
300
|
properties: {
|
|
400
|
-
kind: { const: '
|
|
301
|
+
kind: { const: 'agent_function' },
|
|
401
302
|
enabled: { type: 'boolean' },
|
|
402
303
|
card: { type: 'string', minLength: 1 },
|
|
403
304
|
payload: { type: 'string' },
|
|
@@ -480,3 +381,13 @@ function modelText(model) {
|
|
|
480
381
|
.join('\n')}\n`;
|
|
481
382
|
}
|
|
482
383
|
export const HOUSE_MODEL_TYPES = modelText(HOUSE_MODEL_DECLARATION);
|
|
384
|
+
export const HOUSE_TYPED_PATHS = [
|
|
385
|
+
{ path: 'settings/panel.md', type: 'house-panel-preferences', named: true, body: false },
|
|
386
|
+
{ path: 'settings/apps/*.md', type: 'house-app-preferences', named: true, body: false },
|
|
387
|
+
{
|
|
388
|
+
path: 'rooms/*/agent-functions/*.md',
|
|
389
|
+
type: 'house-agent-function-document',
|
|
390
|
+
named: false,
|
|
391
|
+
body: true,
|
|
392
|
+
},
|
|
393
|
+
];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export { createAgentsHouseAdapter, type AgentsHouseAdapterOptions } from './adapter.js';
|
|
2
|
+
export { foldedAuthorities } from './discovery.js';
|
|
2
3
|
export { finishedUpload, houseUpload, type HouseUpload } from './upload.js';
|
|
3
4
|
export { houseAction, type HouseActDoor } from './actions.js';
|
|
4
5
|
export { HISTORY_PAGE } from './history.js';
|
|
5
6
|
export { houseParts, type ChangeMapping } from './write.js';
|
|
6
7
|
export { APP_REFERENCE_PATTERN } from './app-reference.js';
|
|
7
|
-
export { HOUSE_MODEL_DECLARATION, HOUSE_MODEL_TYPES, type HouseDocumentFields, type HouseModelType, } from './house-model.js';
|
|
8
|
+
export { HOUSE_MODEL_DECLARATION, HOUSE_MODEL_TYPES, HOUSE_TYPED_PATHS, type HouseDocumentFields, type HouseModelType, } from './house-model.js';
|
|
8
9
|
export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './crockford.js';
|
|
9
|
-
export {
|
|
10
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES, INBOX_CHANNEL_KINDS, type InboxChannelKind, } from './room-types.js';
|
|
10
11
|
export { HOUSE_RUNTIME_READS, houseDoorRoute, houseSiteRoute, type HouseRuntimeAct, type HouseRuntimeFrame, } from './transport.js';
|
|
11
12
|
export type { HouseByteAct, HouseByteTransfer, HouseBytesAnswer, HouseClosing, HouseDoorAnswer, HouseHeldRoom, HouseOpening, HouseStream, HouseStreamed, HouseStreamEntry, HouseStreamFrame, HouseSiteTransport, HouseTransport, } from './transport.js';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { createAgentsHouseAdapter } from './adapter.js';
|
|
2
|
+
export { foldedAuthorities } from './discovery.js';
|
|
2
3
|
export { finishedUpload, houseUpload } from './upload.js';
|
|
3
4
|
export { houseAction } from './actions.js';
|
|
4
5
|
export { HISTORY_PAGE } from './history.js';
|
|
5
6
|
export { houseParts } from './write.js';
|
|
6
7
|
export { APP_REFERENCE_PATTERN } from './app-reference.js';
|
|
7
|
-
export { HOUSE_MODEL_DECLARATION, HOUSE_MODEL_TYPES, } from './house-model.js';
|
|
8
|
+
export { HOUSE_MODEL_DECLARATION, HOUSE_MODEL_TYPES, HOUSE_TYPED_PATHS, } from './house-model.js';
|
|
8
9
|
export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './crockford.js';
|
|
9
|
-
export {
|
|
10
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES, INBOX_CHANNEL_KINDS, } from './room-types.js';
|
|
10
11
|
export { HOUSE_RUNTIME_READS, houseDoorRoute, houseSiteRoute, } from './transport.js';
|
package/dist/read.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type BinaryFile, type BootstrapPage, type
|
|
1
|
+
import { type BinaryFile, type BootstrapPage, type SavedFacts, type RoomModels, type TransportUncertainty } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { HouseMode } from './transport.js';
|
|
3
3
|
import { type LogPosition } from './version.js';
|
|
4
4
|
export type HeadChange = BootstrapPage['changes'][string];
|
|
5
5
|
export type Answered = {
|
|
6
6
|
readonly documents: Map<string, string>;
|
|
7
|
-
readonly
|
|
7
|
+
readonly facts: Map<string, SavedFacts>;
|
|
8
8
|
readonly revisions: Map<string, string>;
|
|
9
9
|
readonly fileIds: Map<string, string>;
|
|
10
10
|
readonly changes: Map<string, HeadChange>;
|
|
@@ -19,7 +19,7 @@ export declare function forgotten(answer: Answered, path: string): void;
|
|
|
19
19
|
export declare function folded(answer: Answered, path: string, removed: boolean): void;
|
|
20
20
|
export declare function answered(answer: Answered): Generator<number, {
|
|
21
21
|
documents: Readonly<Record<string, string>>;
|
|
22
|
-
|
|
22
|
+
facts: Readonly<Record<string, SavedFacts>>;
|
|
23
23
|
revisions: Readonly<Record<string, string>>;
|
|
24
24
|
fileIds?: Readonly<Record<string, string>>;
|
|
25
25
|
changes: Readonly<Record<string, HeadChange>>;
|
|
@@ -35,7 +35,7 @@ export type HouseManifestFile = {
|
|
|
35
35
|
sha256?: string;
|
|
36
36
|
head?: HeadChange;
|
|
37
37
|
binary?: BinaryFile;
|
|
38
|
-
|
|
38
|
+
facts?: SavedFacts;
|
|
39
39
|
};
|
|
40
40
|
export type HouseContent = {
|
|
41
41
|
path: string;
|
|
@@ -74,7 +74,11 @@ export declare function headChange(held: {
|
|
|
74
74
|
readonly created_at?: unknown;
|
|
75
75
|
}): HeadChange | undefined | null;
|
|
76
76
|
export declare function binaryFileOf(held: Readonly<Record<string, unknown>>): BinaryFile | undefined | null;
|
|
77
|
-
export declare function
|
|
77
|
+
export declare function carriedFacts(held: Readonly<Record<string, unknown>>): {
|
|
78
|
+
facts?: undefined;
|
|
79
|
+
} | {
|
|
80
|
+
facts: SavedFacts;
|
|
81
|
+
};
|
|
78
82
|
export declare function roomHead(payload: Uint8Array<ArrayBuffer>, mode: HouseMode): Promise<HouseRoomHead | null>;
|
|
79
83
|
export declare function manifested(room: HouseRoomHead, pageToken: string, models: RoomModels | undefined): BootstrapPage;
|
|
80
84
|
export declare function modelScope(room: HouseRoomHead): HouseScope;
|
package/dist/read.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,aAAa,EAElB,KAAK,
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,aAAa,EAElB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3E,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAQ1D,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAA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UAAU,GAAG,SAAS,GAC7B,aAAa,CAYf;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,UAAU,CAE1D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,UAAU,CAQ1D;AAsED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,EAChC,IAAI,EAAE,SAAS,GACd,OAAO,CAAC;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,oBAAoB,CAAC,CAKvE;AAED,wBAAiB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,CAoBxF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAO9E"}
|
package/dist/read.js
CHANGED
|
@@ -8,7 +8,7 @@ function fileOf(revision) {
|
|
|
8
8
|
export function answering() {
|
|
9
9
|
return {
|
|
10
10
|
documents: new Map(),
|
|
11
|
-
|
|
11
|
+
facts: new Map(),
|
|
12
12
|
revisions: new Map(),
|
|
13
13
|
fileIds: new Map(),
|
|
14
14
|
changes: new Map(),
|
|
@@ -26,7 +26,7 @@ export function revised(answer, path, revision) {
|
|
|
26
26
|
}
|
|
27
27
|
export function forgotten(answer, path) {
|
|
28
28
|
answer.documents.delete(path);
|
|
29
|
-
answer.
|
|
29
|
+
answer.facts.delete(path);
|
|
30
30
|
answer.revisions.delete(path);
|
|
31
31
|
answer.fileIds.delete(path);
|
|
32
32
|
answer.changes.delete(path);
|
|
@@ -55,7 +55,7 @@ export function* answered(answer) {
|
|
|
55
55
|
const removals = yield* pathsOf(answer.removals);
|
|
56
56
|
return {
|
|
57
57
|
documents: yield* patching({}, answer.documents),
|
|
58
|
-
|
|
58
|
+
facts: yield* patching({}, answer.facts),
|
|
59
59
|
revisions: yield* patching({}, answer.revisions),
|
|
60
60
|
...(answer.fileIds.size === 0 ? {} : { fileIds: yield* patching({}, answer.fileIds) }),
|
|
61
61
|
changes: yield* patching({}, answer.changes),
|
|
@@ -141,23 +141,8 @@ export function binaryFileOf(held) {
|
|
|
141
141
|
function binaried(binary) {
|
|
142
142
|
return binary === undefined ? {} : { binary };
|
|
143
143
|
}
|
|
144
|
-
export function
|
|
145
|
-
|
|
146
|
-
return undefined;
|
|
147
|
-
if (typeof value !== 'object' || value === null)
|
|
148
|
-
return null;
|
|
149
|
-
const { type, fields, links } = value;
|
|
150
|
-
if (type !== null && typeof type !== 'string')
|
|
151
|
-
return null;
|
|
152
|
-
if (fields !== null && (typeof fields !== 'object' || Array.isArray(fields)))
|
|
153
|
-
return null;
|
|
154
|
-
if (!Array.isArray(links) || links.some((link) => typeof link !== 'string'))
|
|
155
|
-
return null;
|
|
156
|
-
return {
|
|
157
|
-
type: type,
|
|
158
|
-
fields: fields,
|
|
159
|
-
links: links,
|
|
160
|
-
};
|
|
144
|
+
export function carriedFacts(held) {
|
|
145
|
+
return held.facts === undefined ? {} : { facts: held.facts };
|
|
161
146
|
}
|
|
162
147
|
function parseFile(value, mode) {
|
|
163
148
|
if (typeof value !== 'object' || value === null)
|
|
@@ -178,10 +163,10 @@ function parseFile(value, mode) {
|
|
|
178
163
|
version: file.sha256,
|
|
179
164
|
...headed(head),
|
|
180
165
|
...binaried(binary),
|
|
166
|
+
...carriedFacts(file),
|
|
181
167
|
};
|
|
182
168
|
}
|
|
183
|
-
|
|
184
|
-
if (typeof file.revision !== 'string' || outline === null)
|
|
169
|
+
if (typeof file.revision !== 'string')
|
|
185
170
|
return null;
|
|
186
171
|
return {
|
|
187
172
|
path: file.path,
|
|
@@ -190,7 +175,7 @@ function parseFile(value, mode) {
|
|
|
190
175
|
...(typeof file.sha256 === 'string' ? { sha256: file.sha256 } : {}),
|
|
191
176
|
...headed(head),
|
|
192
177
|
...binaried(binary),
|
|
193
|
-
...(
|
|
178
|
+
...carriedFacts(file),
|
|
194
179
|
};
|
|
195
180
|
}
|
|
196
181
|
function parseModels(value, mode) {
|
|
@@ -245,6 +230,7 @@ export function manifested(room, pageToken, models) {
|
|
|
245
230
|
kind: 'bootstrap',
|
|
246
231
|
roomVersion: roomVersion(room),
|
|
247
232
|
documents: {},
|
|
233
|
+
facts: {},
|
|
248
234
|
revisions: {},
|
|
249
235
|
changes: {},
|
|
250
236
|
binaryFiles: {},
|
|
@@ -350,8 +336,8 @@ export function* bootstrapping(scope) {
|
|
|
350
336
|
answer.binaryFiles.set(file.path, file.binary);
|
|
351
337
|
else if (content !== undefined)
|
|
352
338
|
answer.documents.set(file.path, content);
|
|
353
|
-
|
|
354
|
-
answer.
|
|
339
|
+
if (file.binary === undefined && file.facts !== undefined)
|
|
340
|
+
answer.facts.set(file.path, file.facts);
|
|
355
341
|
if (file.revision !== undefined)
|
|
356
342
|
revised(answer, file.path, file.revision);
|
|
357
343
|
}
|
package/dist/room-types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const INBOX_CHANNEL_KINDS: readonly ['telegram-bot', 'telegram-business', 'whatsapp', 'messenger', 'instagram', 'viber', 'tiktok'];
|
|
2
2
|
export type InboxChannelKind = (typeof INBOX_CHANNEL_KINDS)[number];
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
3
|
+
export declare const CHAT_TYPE = "chat";
|
|
4
|
+
export declare const CHAT_MESSAGE_TYPE = "chat-message";
|
|
5
5
|
export declare const HOUSE_NAMEABLE_ROOM_TYPES: string[];
|
|
6
6
|
export declare const HOUSE_ROOM_TYPES: string;
|
|
7
7
|
//# sourceMappingURL=room-types.d.ts.map
|
package/dist/room-types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room-types.d.ts","sourceRoot":"","sources":["../src/room-types.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,YAC9B,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,WAAW,EACX,OAAO,EACP,QAAQ,CACA,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"room-types.d.ts","sourceRoot":"","sources":["../src/room-types.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,YAC9B,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,WAAW,EACX,OAAO,EACP,QAAQ,CACA,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,SAAS,SAAS,CAAC;AAEhC,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,eAAO,MAAM,yBAAyB,UAAiC,CAAC;AAyBxE,eAAO,MAAM,gBAAgB,QA6FjB,CAAC"}
|
package/dist/room-types.js
CHANGED
|
@@ -9,9 +9,9 @@ export const INBOX_CHANNEL_KINDS = [
|
|
|
9
9
|
'viber',
|
|
10
10
|
'tiktok',
|
|
11
11
|
];
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export const HOUSE_NAMEABLE_ROOM_TYPES = [
|
|
12
|
+
export const CHAT_TYPE = 'chat';
|
|
13
|
+
export const CHAT_MESSAGE_TYPE = 'chat-message';
|
|
14
|
+
export const HOUSE_NAMEABLE_ROOM_TYPES = [CHAT_TYPE, CHAT_MESSAGE_TYPE];
|
|
15
15
|
const WAYFINDING_MAP_TYPE = 'wayfinding-map';
|
|
16
16
|
const WAYFINDING_TICKET_TYPE = 'wayfinding-ticket';
|
|
17
17
|
const WAYFINDING_MAP_SECTIONS = [
|
|
@@ -30,7 +30,7 @@ const ASSIGNEE = [
|
|
|
30
30
|
...AGENT,
|
|
31
31
|
];
|
|
32
32
|
export const HOUSE_ROOM_TYPES = [
|
|
33
|
-
`${
|
|
33
|
+
`${CHAT_TYPE}:`,
|
|
34
34
|
' properties:',
|
|
35
35
|
' inbox: { type: string, format: uuid }',
|
|
36
36
|
` channel: { enum: [${INBOX_CHANNEL_KINDS.join(', ')}] }`,
|
|
@@ -47,8 +47,8 @@ export const HOUSE_ROOM_TYPES = [
|
|
|
47
47
|
' type: object',
|
|
48
48
|
' properties:',
|
|
49
49
|
...AGENT,
|
|
50
|
-
' required: [
|
|
51
|
-
`${
|
|
50
|
+
' required: [chat, customer]',
|
|
51
|
+
`${CHAT_MESSAGE_TYPE}:`,
|
|
52
52
|
' properties:',
|
|
53
53
|
' direction: { enum: [in, out] }',
|
|
54
54
|
' sender:',
|
package/dist/site.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAQR,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAQR,MAAM,wBAAwB,CAAC;AAgBhC,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAuBxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAuK1F"}
|
package/dist/site.js
CHANGED
|
@@ -4,6 +4,7 @@ import { mapDiscovery, parseSiteDiscovery, siteCapabilities, siteTracked, } from
|
|
|
4
4
|
import { bootstrapping } from './read.js';
|
|
5
5
|
import { roomStreams } from './room-stream.js';
|
|
6
6
|
import { classifyDoor, discoveryFailure } from './refusal.js';
|
|
7
|
+
import { HOUSE_TYPED_PATHS } from './house-model.js';
|
|
7
8
|
import { HOUSE_NAMEABLE_ROOM_TYPES, HOUSE_ROOM_TYPES } from './room-types.js';
|
|
8
9
|
import { houseNotifications } from './stream.js';
|
|
9
10
|
import { houseSiteRoute, SITE_DOOR_SUBMIT, SITE_FILES, SITE_SUBMISSION, } from './transport.js';
|
|
@@ -82,6 +83,7 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
82
83
|
localSaves: true,
|
|
83
84
|
roomTypes: HOUSE_ROOM_TYPES,
|
|
84
85
|
nameableRoomTypes: HOUSE_NAMEABLE_ROOM_TYPES,
|
|
86
|
+
typedPaths: HOUSE_TYPED_PATHS,
|
|
85
87
|
async authorize() {
|
|
86
88
|
return {};
|
|
87
89
|
},
|
|
@@ -155,7 +157,7 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
155
157
|
}
|
|
156
158
|
if (!transport.online())
|
|
157
159
|
return UNCERTAIN;
|
|
158
|
-
return actionOutcome(await transport.door(SITE_DOOR_SUBMIT, request.input), SITE_SUBMISSION);
|
|
160
|
+
return actionOutcome(await transport.door(SITE_DOOR_SUBMIT, request.input), SITE_SUBMISSION, request.input);
|
|
159
161
|
},
|
|
160
162
|
roomStream: snapshot
|
|
161
163
|
? undefined
|
package/dist/stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EAEpB,KAAK,SAAS,EACd,KAAK,kBAAkB,EAIvB,KAAK,eAAe,EAEpB,KAAK,iBAAiB,EAEvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings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B"}
|
package/dist/stream.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ROW_WEIGHT, stepped, } from '@agentshouse/mdruntime';
|
|
2
2
|
import { acceptedMessage, cursorPosition, houseHistory } from './history.js';
|
|
3
3
|
import { streamedModels } from './model.js';
|
|
4
|
-
import { answered, answering, binaryFileOf, folded, forgotten, headChange,
|
|
4
|
+
import { answered, answering, binaryFileOf, folded, forgotten, headChange, revised, } from './read.js';
|
|
5
5
|
import { houseDoorRoute, } from './transport.js';
|
|
6
6
|
import { DECIMAL, roomVersion } from './version.js';
|
|
7
7
|
function turnOperation(frame) {
|
|
@@ -32,6 +32,7 @@ function listedConversation(listed) {
|
|
|
32
32
|
outcome: listed.outcome,
|
|
33
33
|
waiting: listed.waiting,
|
|
34
34
|
newest: listed.newest === null ? null : cursorPosition(listed.newest),
|
|
35
|
+
processEnded: listed.process_ended_at,
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
function position(value) {
|
|
@@ -55,15 +56,12 @@ function* changed(tracked, entries, version, schemas) {
|
|
|
55
56
|
continue;
|
|
56
57
|
}
|
|
57
58
|
const binary = binaryFileOf(entry);
|
|
58
|
-
|
|
59
|
-
if (binary !== undefined) {
|
|
60
|
-
if (binary !== null)
|
|
61
|
-
answer.binaryFiles.set(entry.path, binary);
|
|
62
|
-
}
|
|
63
|
-
else if (outline !== undefined && outline !== null)
|
|
64
|
-
answer.outlines.set(entry.path, outline);
|
|
65
|
-
else
|
|
59
|
+
if (binary === undefined)
|
|
66
60
|
answer.documents.set(entry.path, entry.text ?? '');
|
|
61
|
+
else if (binary !== null)
|
|
62
|
+
answer.binaryFiles.set(entry.path, binary);
|
|
63
|
+
if (binary === undefined && entry.facts !== undefined)
|
|
64
|
+
answer.facts.set(entry.path, entry.facts);
|
|
67
65
|
const revision = entry.revision ?? binary?.sha256;
|
|
68
66
|
if (revision !== undefined)
|
|
69
67
|
revised(answer, entry.path, revision);
|
package/dist/transport.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ConversationEvent, TurnOperation } from '@agentshouse/mdruntime';
|
|
1
|
+
import type { ConversationEvent, SavedFacts, TurnOperation } from '@agentshouse/mdruntime';
|
|
2
2
|
export declare const HOUSE_RUNTIME_READS: {
|
|
3
3
|
readonly acts: readonly ['account/push', 'agents/read', 'apps/features/set', 'apps/source/download', 'apps/source/top', 'batch', 'batch-upload', 'bootstrap', 'conversations/history', 'discover', 'files/attach', 'files/finish', 'files/get', 'revisions', 'search', 'sites/screenshot/read'];
|
|
4
|
-
readonly frames: readonly ['app-message', '
|
|
4
|
+
readonly frames: readonly ['app-message', 'authority_changed', 'carried', 'caught_up', 'commands', 'conversation', 'conversation_deleted', 'conversations', 'deliveries', 'deployment', 'held', 'interactions', 'link', 'message', 'opening', 'options', 'part', 'process', 'received', 'signal', 'site', 'starting', 'subagents', 'tab-icon', 'turn'];
|
|
5
5
|
};
|
|
6
6
|
export type HouseRuntimeAct = (typeof HOUSE_RUNTIME_READS.acts)[number];
|
|
7
7
|
export type HouseRuntimeFrame = (typeof HOUSE_RUNTIME_READS.frames)[number];
|
|
@@ -33,7 +33,6 @@ export type HouseStreamEntry = {
|
|
|
33
33
|
revision?: string;
|
|
34
34
|
sha256?: string;
|
|
35
35
|
text?: string;
|
|
36
|
-
outline?: unknown;
|
|
37
36
|
bytes?: number;
|
|
38
37
|
media_type?: string;
|
|
39
38
|
author?: {
|
|
@@ -44,6 +43,7 @@ export type HouseStreamEntry = {
|
|
|
44
43
|
name: string;
|
|
45
44
|
};
|
|
46
45
|
created_at?: string;
|
|
46
|
+
facts?: SavedFacts;
|
|
47
47
|
};
|
|
48
48
|
type LiveFact<K extends ConversationEvent['kind']> = Extract<ConversationEvent, {
|
|
49
49
|
kind: K;
|
|
@@ -62,6 +62,7 @@ export type HouseListedConversation = {
|
|
|
62
62
|
accepted_at: string;
|
|
63
63
|
message_id: string;
|
|
64
64
|
} | null;
|
|
65
|
+
process_ended_at: string | null;
|
|
65
66
|
};
|
|
66
67
|
type Listed<Frame extends {
|
|
67
68
|
readonly type: HouseRuntimeFrame;
|
|
@@ -85,7 +86,8 @@ export type HouseStreamFrame = Listed<{
|
|
|
85
86
|
member: unknown;
|
|
86
87
|
bounds: unknown;
|
|
87
88
|
actions: readonly unknown[];
|
|
88
|
-
|
|
89
|
+
shapes: readonly unknown[];
|
|
90
|
+
rooms: readonly unknown[];
|
|
89
91
|
} | {
|
|
90
92
|
type: 'caught_up';
|
|
91
93
|
expired: readonly string[];
|
package/dist/transport.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE3F,eAAO,MAAM,mBAAmB;aAC9B,IAAI,YACF,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,OAAO,EACP,cAAc,EACd,WAAW,EACX,uBAAuB,EACvB,UAAU,EACV,cAAc,EACd,cAAc,EACd,WAAW,EACX,WAAW,EACX,QAAQ,EACR,uBAAuB;aAEzB,MAAM,YACJ,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,cAAc,EACd,MAAM,EACN,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,UAAU,EACV,WAAW,EACX,UAAU,EACV,MAAM;CAEA,CAAC;AAEX,MAAM,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