@agentshouse/mdruntime-adapter 0.1.0-c82b9ec2b727a → 0.1.0-c82ec25e72f2f
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 +4 -59
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +7 -289
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +170 -355
- package/dist/chunks.d.ts +28 -0
- package/dist/chunks.d.ts.map +1 -0
- package/dist/chunks.js +206 -0
- package/dist/discovery.d.ts +20 -8
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +65 -33
- package/dist/history.d.ts +12 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +92 -0
- package/dist/house-model.d.ts +640 -1
- package/dist/house-model.d.ts.map +1 -1
- package/dist/house-model.js +361 -415
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/model.d.ts +5 -4
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +28 -23
- package/dist/part.d.ts +11 -12
- package/dist/part.d.ts.map +1 -1
- package/dist/part.js +63 -55
- package/dist/read.d.ts +21 -58
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +61 -222
- package/dist/refusal.d.ts +0 -3
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +0 -5
- package/dist/room-stream.d.ts +20 -0
- package/dist/room-stream.d.ts.map +1 -0
- package/dist/room-stream.js +57 -0
- package/dist/room-types.d.ts +3 -3
- package/dist/room-types.d.ts.map +1 -1
- package/dist/room-types.js +8 -9
- package/dist/search.d.ts +5 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +47 -0
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +78 -165
- package/dist/space-schema.d.ts +7 -0
- package/dist/space-schema.d.ts.map +1 -0
- package/dist/space-schema.js +18 -0
- package/dist/stream.d.ts +16 -15
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +229 -422
- package/dist/transport.d.ts +50 -36
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +55 -11
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +2 -2
- package/dist/write.d.ts +6 -1
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +18 -25
- package/package.json +2 -2
- package/dist/gather.d.ts +0 -4
- package/dist/gather.d.ts.map +0 -1
- package/dist/gather.js +0 -35
package/dist/house-model.js
CHANGED
|
@@ -1,415 +1,361 @@
|
|
|
1
|
-
export const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
description: "One Site this User owns: its name, its address under this environment's Site suffix, its own App with that App's tab icon as a Site shows it, the running release of that App, which the Site serves, its title and Intake Room, whether an operator disabled it, its mode, and every Room slot of that release in its order. Each slot entry names the slot, one Room its list holds, that entry's address segment and the last compatibility outcome of that entry, in list order, or the slot and \`empty\` for a slot that lists no Room; each finding names its slot, its Room and one exact structural finding of that Room against the slot. An incompatible entry stays listed and blocks nothing. \`release\` is absent until that App's first release. \`disabled\` is \`yes\` while an operator holds the Site disabled, and \`disabled_reason\` carries the reason the operator stated; visitors then find the Site unavailable, this User may still change or delete it, and only an operator enables it again. \`mode\` is \`snapshot\` while visitors see the Published Snapshot \`publication\` names, or \`live\` while they see what its Rooms hold as it changes, which needs Full House; only this User changes it. \`unpublished\` is \`yes\` while this User holds the Site unpublished: visitors then find it unavailable at every address and nothing else changes, and only this User's republication serves it again; an operator's enable never does. \`suspended\` is \`yes\` while visitors find the Site unavailable at every address for the reason \`suspended_reason\` names: \`full_house_required\` while the Site is \`live\` and this User lacks Full House, or \`public_delivery_limit\` while what House's server sent for this User's Sites this UTC month has reached this User's Public delivery limit, unless \`public_overage\` is \`on\` while this User holds Full House. A suspension keeps the publication, the addresses, the Custom domains and every act of this User's, and ends by itself at the next UTC month, when this User gains Full House or when \`public_overage\` turns \`on\` while this User holds Full House; it lifts no Unpublish and no operator's disable. \`public_overage\` is \`on\` while this User keeps the Site serving past the Public delivery limit, which it does only while this User holds Full House; what it sends past the limit is charged as overage. It stays \`on\` when Full House ends and acts again when Full House returns. \`publication\` is the Published Snapshot the Site serves, or serves once republished, absent while it holds none. \`acts\` names the publication acts this User may take now: \`unpublish\` while the Site is published, \`republish\` while it is unpublished and holds a publication to serve; Publish data also serves an unpublished Site again, with what its Rooms hold. A cleared title is absent. \`description\` carries presentation. \`screenshot\` is the address of the image House captured of the Site at its primary address after a release, which a shared link to the Site shows, absent before the first capture. \`google_analytics_id\` is the owner's measurement ID the Site loads its analytics tag with, absent while unset. \`indexing\` is the search-engines-and-agents switch: while it is \`yes\`, the Site serves its documents as Markdown and lists them in its indexes. \`entry_fallback\` names the last time this release's Entry Data Contract could not serve an Entry Page as HTML: why (\`over_bound\`, \`query_refused\` or \`unavailable\`), the route and when; that page then started the App as usual. \`external_origins\` names the declared external origins of that release. \`notify_me\` is \`on\` while the Site's notification Trigger is present and enabled in its Intake Room. \`addresses\` lists every address the Site answers at: its address under the Site suffix and each active Custom domain; every address other than \`primary_address\` redirects to it. Each \`domains\` entry names one Custom domain, its state \`pending\`, \`active\` or \`failed\`, the DNS alias target its hostname must point at, which is this environment's and the same for every domain, and the edge's reason when it gives one."
|
|
363
|
-
properties:
|
|
364
|
-
reflected: { type: string, format: date-time }
|
|
365
|
-
site: { type: string, format: uuid }
|
|
366
|
-
name: { type: string }
|
|
367
|
-
address: { type: string, format: uri }
|
|
368
|
-
addresses: { type: array, items: { type: string, format: uri } }
|
|
369
|
-
primary_address: { type: string, format: uri }
|
|
370
|
-
domains: { type: array, items: { type: string, pattern: '^(?<host>\\S+)\\t(?<state>pending|active|failed)\\t(?<dns_target>\\S+)(?:\\t(?<reason>[\\s\\S]+))?$' } }
|
|
371
|
-
app: { type: string, format: uuid }
|
|
372
|
-
app_ref: { type: string, pattern: '^a_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz])$' }
|
|
373
|
-
tab_icon_light: { type: string, pattern: ^data:image\\/ }
|
|
374
|
-
tab_icon_dark: { type: string, pattern: ^data:image\\/ }
|
|
375
|
-
tab_icon_colours: { type: array, items: { type: string, pattern: '^#[0-9a-f]{6}$' } }
|
|
376
|
-
tab_icon_blend: { enum: [ linear, radial ] }
|
|
377
|
-
tab_icon_angle: { type: integer, minimum: 0, maximum: 359 }
|
|
378
|
-
release: { type: string, pattern: '^(?<release>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\t(?<sequence>\\d+)$' }
|
|
379
|
-
title: { type: string }
|
|
380
|
-
description: { type: string }
|
|
381
|
-
screenshot: { type: string, format: uri }
|
|
382
|
-
google_analytics_id: { type: string, pattern: '^G-[A-Z0-9]{1,32}$' }
|
|
383
|
-
intake_room: { type: string, pattern: '^r_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz])$' }
|
|
384
|
-
external_origins: { type: array, items: { type: string, format: uri } }
|
|
385
|
-
disabled: { enum: [ yes, no ] }
|
|
386
|
-
disabled_reason: { type: string }
|
|
387
|
-
mode: { enum: [ snapshot, live ] }
|
|
388
|
-
unpublished: { enum: [ yes, no ] }
|
|
389
|
-
suspended: { enum: [ yes, no ] }
|
|
390
|
-
suspended_reason: { type: string, enum: [ full_house_required, public_delivery_limit ] }
|
|
391
|
-
public_overage: { enum: [ on, off ] }
|
|
392
|
-
publication: { type: string, format: uuid }
|
|
393
|
-
acts: { type: array, items: { type: string, enum: [ unpublish, republish ] } }
|
|
394
|
-
indexing: { enum: [ yes, no ] }
|
|
395
|
-
entry_fallback: { type: string, pattern: ^(?<cause>over_bound|query_refused|unavailable)\\t(?<route>\\S+)\\t(?<recorded>\\S+)$ }
|
|
396
|
-
created: { type: string, format: date-time }
|
|
397
|
-
new_browsers: { type: integer, minimum: 0 }
|
|
398
|
-
submissions: { type: integer, minimum: 0 }
|
|
399
|
-
notify_me: { enum: [ on, off ] }
|
|
400
|
-
image_copies: { type: integer, minimum: 0 }
|
|
401
|
-
image_copy_bound: { type: integer, minimum: 0 }
|
|
402
|
-
image_copy_limit_reached: { enum: [ yes, no ] }
|
|
403
|
-
slots: { type: array, items: { type: string, pattern: '^(?<slot>[a-z0-9]([a-z0-9-]*[a-z0-9])?)\\t(?:(?<empty>empty)|(?<room>r_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz]))\\t(?<segment>\\S+)\\t(?<compatibility>unchecked|compatible|incompatible))$' } }
|
|
404
|
-
findings: { type: array, items: { type: string, pattern: '^(?<slot>[a-z0-9]([a-z0-9-]*[a-z0-9])?)\\t(?<room>r_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz]))\\t(?<finding>[\\s\\S]+)$' } }
|
|
405
|
-
required: [ reflected, site, name, address, primary_address, app, app_ref, disabled, mode, unpublished, suspended, public_overage, indexing, created, new_browsers, submissions, notify_me, image_copies, image_copy_bound, image_copy_limit_reached ]
|
|
406
|
-
house-web-wizard:
|
|
407
|
-
description: "One Web Wizard an agent made for this User: the \`environment\` it runs on, by that Environment's name, and its \`state\`, \`waiting\` until its owner presses Run, \`running\`, \`finished\` with the script's \`exit_code\`, \`failed\`, \`cancelled\` when its page closed before the script ended, or \`lapsed\` when nobody ran it in its time. Its body is the script, whole, in one fenced code block. The terminal's output is never kept."
|
|
408
|
-
properties:
|
|
409
|
-
reflected: { type: string, format: date-time }
|
|
410
|
-
wizard: { type: string, format: uuid }
|
|
411
|
-
environment: { type: string }
|
|
412
|
-
state: { enum: [ waiting, running, finished, failed, cancelled, lapsed ] }
|
|
413
|
-
exit_code: { type: integer }
|
|
414
|
-
required: [ reflected, wizard, environment, state ]
|
|
415
|
-
`;
|
|
1
|
+
export const HOUSE_MODEL_DECLARATION = {
|
|
2
|
+
$defs: {
|
|
3
|
+
room: {
|
|
4
|
+
description: 'A Room, by its Room reference, under the key `room`.',
|
|
5
|
+
type: 'string',
|
|
6
|
+
pattern: '^r_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz])$',
|
|
7
|
+
},
|
|
8
|
+
app: {
|
|
9
|
+
description: 'An App, by its App reference, under the key `app`.',
|
|
10
|
+
type: 'string',
|
|
11
|
+
pattern: '^a_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz])$',
|
|
12
|
+
},
|
|
13
|
+
document: {
|
|
14
|
+
description: 'A document of a Room, by its file reference, under the key `document`.',
|
|
15
|
+
type: 'string',
|
|
16
|
+
pattern: '^af_([123456789abcdefghjkmnpqrstvwxyz][0123456789abcdefghjkmnpqrstvwxyz]*)\\.([0123456789abcdefghjkmnpqrstvwxyz])$',
|
|
17
|
+
},
|
|
18
|
+
id: {
|
|
19
|
+
description: 'Any other entity, by its identifier, under the key of its kind. An entity a type says more about is an object holding it under that key beside its facts.',
|
|
20
|
+
type: 'string',
|
|
21
|
+
format: 'uuid',
|
|
22
|
+
},
|
|
23
|
+
namespace: {
|
|
24
|
+
description: 'The Namespace a grant entry covers, an App or a Room by its reference with the area of it.',
|
|
25
|
+
type: 'string',
|
|
26
|
+
maxLength: 512,
|
|
27
|
+
pattern: '^(?:a_[A-Za-z0-9._-]+(?:\\/source)?|r_[A-Za-z0-9._-]+(?:\\/(?:settings|settings\\/schema|settings\\/model|settings\\/indexing|content))?)$',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
'house-app-preferences': {
|
|
31
|
+
description: "An App's preferences. Its own vocabulary is in the body.",
|
|
32
|
+
properties: { app: { $ref: '#/$defs/app' } },
|
|
33
|
+
required: ['app'],
|
|
34
|
+
},
|
|
35
|
+
'house-notification': {
|
|
36
|
+
description: "One kept Notification for this User: its kind, when it was sent as `created`, its way in, its email's subject and each fact of its value that is not sealed, named in snake_case. An entity a fact names is an object holding its identifier under the key of its kind, when the notification carries it, and its `name`, `email` and other facts beside it; a fact holding null is absent. `way_in` is either the House `path` it opens or the entity it is about, by its identifier under the key of its kind, a Trigger with its `room`. Its body is its email's words in Markdown. Both were worded once, in the User's language when it was delivered; an App may show them or word it itself from its kind and value. `read` is when the User opened it or marked it read, on any device: the one field House adds after delivery.",
|
|
37
|
+
properties: {
|
|
38
|
+
notification: { $ref: '#/$defs/id' },
|
|
39
|
+
kind: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
enum: [
|
|
42
|
+
'share-offer',
|
|
43
|
+
'join-request',
|
|
44
|
+
'join-request-approved',
|
|
45
|
+
'room-ownership-offer',
|
|
46
|
+
'managed-environment-retention-opened',
|
|
47
|
+
'storage-full',
|
|
48
|
+
'sandbox-budget-spent',
|
|
49
|
+
'trigger-failed',
|
|
50
|
+
'break-glass-owner-disclosure',
|
|
51
|
+
'export-ready',
|
|
52
|
+
'export-failed',
|
|
53
|
+
'custom',
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
created: { type: 'string', format: 'date-time' },
|
|
57
|
+
read: { type: 'string', format: 'date-time' },
|
|
58
|
+
way_in: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
additionalProperties: false,
|
|
61
|
+
properties: {
|
|
62
|
+
path: { type: 'string', pattern: '^\\/' },
|
|
63
|
+
room: { $ref: '#/$defs/room' },
|
|
64
|
+
environment: { $ref: '#/$defs/id' },
|
|
65
|
+
trigger: { $ref: '#/$defs/id' },
|
|
66
|
+
},
|
|
67
|
+
minProperties: 1,
|
|
68
|
+
},
|
|
69
|
+
subject: { type: 'string' },
|
|
70
|
+
share: { $ref: '#/$defs/id' },
|
|
71
|
+
issuer: {
|
|
72
|
+
type: 'object',
|
|
73
|
+
additionalProperties: false,
|
|
74
|
+
properties: { name: { type: 'string' }, email: { type: 'string', format: 'email' } },
|
|
75
|
+
required: ['name', 'email'],
|
|
76
|
+
},
|
|
77
|
+
rooms: {
|
|
78
|
+
type: 'array',
|
|
79
|
+
items: {
|
|
80
|
+
type: 'object',
|
|
81
|
+
additionalProperties: false,
|
|
82
|
+
properties: { name: { type: 'string' } },
|
|
83
|
+
required: ['name'],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
apps: {
|
|
87
|
+
maxItems: 20,
|
|
88
|
+
type: 'array',
|
|
89
|
+
items: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
additionalProperties: false,
|
|
92
|
+
properties: {
|
|
93
|
+
name: { type: 'string', minLength: 1, maxLength: 200 },
|
|
94
|
+
reaches: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 512 } },
|
|
95
|
+
},
|
|
96
|
+
required: ['name', 'reaches'],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
expires_at: { type: 'string', format: 'date-time' },
|
|
100
|
+
join_request: { $ref: '#/$defs/id' },
|
|
101
|
+
user: {
|
|
102
|
+
type: 'object',
|
|
103
|
+
additionalProperties: false,
|
|
104
|
+
properties: { name: { type: 'string' }, email: { type: 'string', format: 'email' } },
|
|
105
|
+
required: ['name', 'email'],
|
|
106
|
+
},
|
|
107
|
+
room: {
|
|
108
|
+
type: 'object',
|
|
109
|
+
additionalProperties: false,
|
|
110
|
+
properties: { room: { $ref: '#/$defs/room' }, name: { type: 'string' } },
|
|
111
|
+
minProperties: 1,
|
|
112
|
+
},
|
|
113
|
+
app: {
|
|
114
|
+
type: 'object',
|
|
115
|
+
additionalProperties: false,
|
|
116
|
+
properties: { app: { $ref: '#/$defs/app' } },
|
|
117
|
+
required: ['app'],
|
|
118
|
+
},
|
|
119
|
+
ownership_offer: { $ref: '#/$defs/id' },
|
|
120
|
+
offerer: {
|
|
121
|
+
type: 'object',
|
|
122
|
+
additionalProperties: false,
|
|
123
|
+
properties: { name: { type: 'string' }, email: { type: 'string', format: 'email' } },
|
|
124
|
+
required: ['name', 'email'],
|
|
125
|
+
},
|
|
126
|
+
environment: {
|
|
127
|
+
type: 'object',
|
|
128
|
+
additionalProperties: false,
|
|
129
|
+
properties: {
|
|
130
|
+
environment: { $ref: '#/$defs/id' },
|
|
131
|
+
name: { type: 'string' },
|
|
132
|
+
kind: { enum: ['vps', 'sandbox'] },
|
|
133
|
+
},
|
|
134
|
+
required: ['environment', 'name'],
|
|
135
|
+
},
|
|
136
|
+
reason: { type: 'string' },
|
|
137
|
+
deadline: { type: 'string', format: 'date-time' },
|
|
138
|
+
free: {
|
|
139
|
+
type: 'object',
|
|
140
|
+
additionalProperties: false,
|
|
141
|
+
properties: {
|
|
142
|
+
held: { type: 'string', pattern: '^\\d+$' },
|
|
143
|
+
limit: { type: 'string', pattern: '^[1-9]\\d*$' },
|
|
144
|
+
measure: { type: 'string', enum: ['content', 'retained'] },
|
|
145
|
+
},
|
|
146
|
+
required: ['held', 'limit', 'measure'],
|
|
147
|
+
},
|
|
148
|
+
budget: { type: 'string', pattern: '^\\d+(?:\\.\\d+)?$' },
|
|
149
|
+
resets_at: { type: 'string', format: 'date-time' },
|
|
150
|
+
grant: { $ref: '#/$defs/id' },
|
|
151
|
+
category: { type: 'string' },
|
|
152
|
+
access_started_at: { type: 'string', format: 'date-time' },
|
|
153
|
+
access_ended_at: { type: 'string', format: 'date-time' },
|
|
154
|
+
systems: { type: 'array', items: { type: 'string' } },
|
|
155
|
+
case_reference: { type: 'string' },
|
|
156
|
+
export: { $ref: '#/$defs/id' },
|
|
157
|
+
size_bytes: { type: 'integer', minimum: 0 },
|
|
158
|
+
title: { type: 'string' },
|
|
159
|
+
body: { type: 'string' },
|
|
160
|
+
authorship: {
|
|
161
|
+
type: 'object',
|
|
162
|
+
additionalProperties: false,
|
|
163
|
+
properties: {
|
|
164
|
+
kind: { type: 'string', const: 'trigger-action' },
|
|
165
|
+
trigger: { $ref: '#/$defs/id' },
|
|
166
|
+
position: { type: 'integer', minimum: 0 },
|
|
167
|
+
},
|
|
168
|
+
required: ['kind', 'trigger', 'position'],
|
|
169
|
+
},
|
|
170
|
+
path: { type: 'string', maxLength: 4096, pattern: '^\\/.*' },
|
|
171
|
+
trigger: {
|
|
172
|
+
type: 'object',
|
|
173
|
+
additionalProperties: false,
|
|
174
|
+
properties: { trigger: { $ref: '#/$defs/id' }, description: { type: 'string' } },
|
|
175
|
+
required: ['trigger', 'description'],
|
|
176
|
+
},
|
|
177
|
+
code: {
|
|
178
|
+
type: 'string',
|
|
179
|
+
enum: [
|
|
180
|
+
'failed',
|
|
181
|
+
'function_failed',
|
|
182
|
+
'function_not_started',
|
|
183
|
+
'agent_function_request_not_started',
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
action: { type: 'integer', minimum: 0 },
|
|
187
|
+
moment: { type: 'string', format: 'date-time' },
|
|
188
|
+
error: { type: 'string' },
|
|
189
|
+
},
|
|
190
|
+
required: ['notification', 'kind', 'created', 'way_in', 'subject'],
|
|
191
|
+
},
|
|
192
|
+
'house-panel-preferences': {
|
|
193
|
+
description: "The panel's preferences at /rooms/private/settings/panel.md. Its own vocabulary is in the body.",
|
|
194
|
+
properties: {},
|
|
195
|
+
},
|
|
196
|
+
'house-agent-function': {
|
|
197
|
+
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.",
|
|
198
|
+
properties: {
|
|
199
|
+
reflected: { type: 'string', format: 'date-time' },
|
|
200
|
+
agent_function: { $ref: '#/$defs/id' },
|
|
201
|
+
description: { type: 'string' },
|
|
202
|
+
input: { type: 'string' },
|
|
203
|
+
agent: {
|
|
204
|
+
type: 'object',
|
|
205
|
+
additionalProperties: false,
|
|
206
|
+
properties: { agent: { $ref: '#/$defs/id' }, name: { type: 'string' } },
|
|
207
|
+
required: ['agent', 'name'],
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
required: ['reflected', 'agent_function', 'description', 'input', 'agent'],
|
|
211
|
+
},
|
|
212
|
+
'house-agent-function-document': {
|
|
213
|
+
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.',
|
|
214
|
+
properties: {
|
|
215
|
+
description: { type: 'string', maxLength: 2000, pattern: '\\S' },
|
|
216
|
+
input: { type: 'string' },
|
|
217
|
+
agent: { $ref: '#/$defs/id' },
|
|
218
|
+
},
|
|
219
|
+
required: ['description', 'input', 'agent'],
|
|
220
|
+
},
|
|
221
|
+
'house-trigger': {
|
|
222
|
+
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.",
|
|
223
|
+
properties: {
|
|
224
|
+
reflected: { type: 'string', format: 'date-time' },
|
|
225
|
+
trigger: { $ref: '#/$defs/id' },
|
|
226
|
+
description: { type: 'string' },
|
|
227
|
+
condition: {
|
|
228
|
+
description: 'When it fires, as the Trigger reference page writes it, a document it names at its current path.',
|
|
229
|
+
type: 'object',
|
|
230
|
+
additionalProperties: true,
|
|
231
|
+
},
|
|
232
|
+
actions: {
|
|
233
|
+
type: 'array',
|
|
234
|
+
items: {
|
|
235
|
+
anyOf: [
|
|
236
|
+
{
|
|
237
|
+
type: 'object',
|
|
238
|
+
additionalProperties: false,
|
|
239
|
+
properties: {
|
|
240
|
+
kind: { const: 'notify' },
|
|
241
|
+
enabled: { type: 'boolean' },
|
|
242
|
+
title: { type: 'string' },
|
|
243
|
+
text: { type: 'string' },
|
|
244
|
+
to: {
|
|
245
|
+
type: 'object',
|
|
246
|
+
additionalProperties: false,
|
|
247
|
+
properties: {
|
|
248
|
+
users: {
|
|
249
|
+
type: 'array',
|
|
250
|
+
items: {
|
|
251
|
+
type: 'object',
|
|
252
|
+
additionalProperties: false,
|
|
253
|
+
properties: { user: { $ref: '#/$defs/id' } },
|
|
254
|
+
required: ['user'],
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
fields: { type: 'array', items: { type: 'string' } },
|
|
258
|
+
roles: { type: 'array', items: { type: 'string' } },
|
|
259
|
+
},
|
|
260
|
+
required: ['users', 'fields', 'roles'],
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
required: ['kind', 'enabled', 'title', 'text', 'to'],
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
type: 'object',
|
|
267
|
+
additionalProperties: false,
|
|
268
|
+
properties: {
|
|
269
|
+
kind: { const: 'agent_function' },
|
|
270
|
+
enabled: { type: 'boolean' },
|
|
271
|
+
card: { type: 'string', minLength: 1 },
|
|
272
|
+
payload: { type: 'string' },
|
|
273
|
+
},
|
|
274
|
+
required: ['kind', 'enabled', 'payload'],
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
type: 'object',
|
|
278
|
+
additionalProperties: false,
|
|
279
|
+
properties: {
|
|
280
|
+
kind: { const: 'message' },
|
|
281
|
+
enabled: { type: 'boolean' },
|
|
282
|
+
card: { type: 'string', minLength: 1 },
|
|
283
|
+
text: { type: 'string' },
|
|
284
|
+
},
|
|
285
|
+
required: ['kind', 'enabled', 'text'],
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
type: 'object',
|
|
289
|
+
additionalProperties: false,
|
|
290
|
+
properties: { kind: { const: 'done' }, enabled: { type: 'boolean' } },
|
|
291
|
+
required: ['kind', 'enabled'],
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
type: 'object',
|
|
295
|
+
additionalProperties: false,
|
|
296
|
+
properties: {
|
|
297
|
+
kind: { const: 'function' },
|
|
298
|
+
enabled: { type: 'boolean' },
|
|
299
|
+
app: { $ref: '#/$defs/app' },
|
|
300
|
+
function: { type: 'string' },
|
|
301
|
+
},
|
|
302
|
+
required: ['kind', 'enabled', 'function'],
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
enabled: { type: 'boolean' },
|
|
308
|
+
paused_by: { enum: ['types'] },
|
|
309
|
+
creator: {
|
|
310
|
+
type: 'object',
|
|
311
|
+
additionalProperties: false,
|
|
312
|
+
properties: { user: { $ref: '#/$defs/id' }, name: { type: 'string' } },
|
|
313
|
+
required: ['user', 'name'],
|
|
314
|
+
},
|
|
315
|
+
created: { type: 'string', format: 'date-time' },
|
|
316
|
+
},
|
|
317
|
+
required: [
|
|
318
|
+
'reflected',
|
|
319
|
+
'trigger',
|
|
320
|
+
'description',
|
|
321
|
+
'condition',
|
|
322
|
+
'actions',
|
|
323
|
+
'enabled',
|
|
324
|
+
'creator',
|
|
325
|
+
'created',
|
|
326
|
+
],
|
|
327
|
+
},
|
|
328
|
+
'house-web-wizard': {
|
|
329
|
+
description: "One Web Wizard an agent made for this User: the `environment` it runs on, with the `name` that Environment had when the Web Wizard was made, and its `state`, `waiting` until its owner presses Run or Keep, `running`, `finished` with the script's `exit_code`, `failed`, `cancelled` when its page closed before the script ended, `lapsed` when nobody ran it in its time, or `kept` when its owner kept the script, without running it, as their Environment function named `function`. Its body is the script, whole, in one fenced code block. The terminal's output is never kept.",
|
|
330
|
+
properties: {
|
|
331
|
+
reflected: { type: 'string', format: 'date-time' },
|
|
332
|
+
web_wizard: { $ref: '#/$defs/id' },
|
|
333
|
+
environment: {
|
|
334
|
+
type: 'object',
|
|
335
|
+
additionalProperties: false,
|
|
336
|
+
properties: { environment: { $ref: '#/$defs/id' }, name: { type: 'string' } },
|
|
337
|
+
required: ['environment', 'name'],
|
|
338
|
+
},
|
|
339
|
+
state: { enum: ['waiting', 'running', 'finished', 'failed', 'cancelled', 'lapsed', 'kept'] },
|
|
340
|
+
exit_code: { type: 'integer' },
|
|
341
|
+
function: { type: 'string' },
|
|
342
|
+
},
|
|
343
|
+
required: ['reflected', 'web_wizard', 'environment', 'state'],
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
function modelText(model) {
|
|
347
|
+
return `${Object.entries(model)
|
|
348
|
+
.map(([name, declared]) => `${name}: ${JSON.stringify(declared)}`)
|
|
349
|
+
.join('\n')}\n`;
|
|
350
|
+
}
|
|
351
|
+
export const HOUSE_MODEL_TYPES = modelText(HOUSE_MODEL_DECLARATION);
|
|
352
|
+
export const HOUSE_TYPED_PATHS = [
|
|
353
|
+
{ path: 'settings/panel.md', type: 'house-panel-preferences', named: true, body: false },
|
|
354
|
+
{ path: 'settings/apps/*.md', type: 'house-app-preferences', named: true, body: false },
|
|
355
|
+
{
|
|
356
|
+
path: 'rooms/*/agent-functions/*.md',
|
|
357
|
+
type: 'house-agent-function-document',
|
|
358
|
+
named: false,
|
|
359
|
+
body: true,
|
|
360
|
+
},
|
|
361
|
+
];
|