@agentshouse/mdruntime-adapter 0.1.0-cf863e7a50d6e → 0.1.0-cfcea2fad4cce

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 (79) hide show
  1. package/README.md +2 -2
  2. package/dist/actions.d.ts +3 -2
  3. package/dist/actions.d.ts.map +1 -1
  4. package/dist/actions.js +26 -9
  5. package/dist/adapter.d.ts +0 -1
  6. package/dist/adapter.d.ts.map +1 -1
  7. package/dist/adapter.js +120 -109
  8. package/dist/app-reference.d.ts +0 -1
  9. package/dist/authored-path.d.ts +10 -0
  10. package/dist/authored-path.d.ts.map +1 -0
  11. package/dist/authored-path.js +35 -0
  12. package/dist/chunks.d.ts +37 -0
  13. package/dist/chunks.d.ts.map +1 -0
  14. package/dist/chunks.js +254 -0
  15. package/dist/crockford.d.ts +0 -1
  16. package/dist/digest.d.ts +0 -1
  17. package/dist/discovery.d.ts +11 -6
  18. package/dist/discovery.d.ts.map +1 -1
  19. package/dist/discovery.js +39 -13
  20. package/dist/history.d.ts +1 -7
  21. package/dist/history.d.ts.map +1 -1
  22. package/dist/history.js +24 -30
  23. package/dist/house-model.d.ts +239 -368
  24. package/dist/house-model.d.ts.map +1 -1
  25. package/dist/house-model.js +231 -288
  26. package/dist/index.d.ts +6 -4
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +5 -2
  29. package/dist/map.d.ts +0 -1
  30. package/dist/model.d.ts +5 -8
  31. package/dist/model.d.ts.map +1 -1
  32. package/dist/model.js +30 -18
  33. package/dist/read.d.ts +19 -10
  34. package/dist/read.d.ts.map +1 -1
  35. package/dist/read.js +46 -143
  36. package/dist/refusal.d.ts +3 -2
  37. package/dist/refusal.d.ts.map +1 -1
  38. package/dist/refusal.js +17 -7
  39. package/dist/room-types.d.ts +0 -3
  40. package/dist/room-types.d.ts.map +1 -1
  41. package/dist/room-types.js +68 -57
  42. package/dist/search.d.ts +4 -0
  43. package/dist/search.d.ts.map +1 -0
  44. package/dist/search.js +47 -0
  45. package/dist/session-content/bounds.d.ts +7 -0
  46. package/dist/session-content/check.d.ts +18 -0
  47. package/dist/session-content/index.d.ts +7 -0
  48. package/dist/session-content/parts.d.ts +102 -0
  49. package/dist/session-content/state.d.ts +61 -0
  50. package/dist/session-content/turn.d.ts +328 -0
  51. package/dist/site.d.ts +0 -1
  52. package/dist/site.d.ts.map +1 -1
  53. package/dist/site.js +47 -49
  54. package/dist/space-schema.d.ts +6 -0
  55. package/dist/space-schema.d.ts.map +1 -0
  56. package/dist/space-schema.js +18 -0
  57. package/dist/stream.d.ts +6 -5
  58. package/dist/stream.d.ts.map +1 -1
  59. package/dist/stream.js +133 -38
  60. package/dist/transport.d.ts +26 -23
  61. package/dist/transport.d.ts.map +1 -1
  62. package/dist/transport.js +13 -12
  63. package/dist/uncertain.d.ts +5 -0
  64. package/dist/uncertain.d.ts.map +1 -0
  65. package/dist/uncertain.js +11 -0
  66. package/dist/upload.d.ts +3 -2
  67. package/dist/upload.d.ts.map +1 -1
  68. package/dist/upload.js +8 -6
  69. package/dist/version.d.ts +0 -1
  70. package/dist/write.d.ts +0 -2
  71. package/dist/write.d.ts.map +1 -1
  72. package/dist/write.js +24 -38
  73. package/package.json +2 -2
  74. package/dist/part.d.ts +0 -14
  75. package/dist/part.d.ts.map +0 -1
  76. package/dist/part.js +0 -90
  77. package/dist/room-stream.d.ts +0 -19
  78. package/dist/room-stream.d.ts.map +0 -1
  79. package/dist/room-stream.js +0 -57
@@ -1,3 +1,4 @@
1
+ import { APP_PREFERENCES_HOME } from './authored-path.js';
1
2
  export const HOUSE_MODEL_DECLARATION = {
2
3
  $defs: {
3
4
  room: {
@@ -10,274 +11,261 @@ export const HOUSE_MODEL_DECLARATION = {
10
11
  type: 'string',
11
12
  pattern: '^a_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz])$',
12
13
  },
13
- document: {
14
- description: 'A document of a Room, by its file reference, under the key `document`.',
14
+ space: {
15
+ description: 'A Space, by its Space reference, under the key `space`.',
15
16
  type: 'string',
16
- pattern: '^af_([123456789abcdefghjkmnpqrstvwxyz][0123456789abcdefghjkmnpqrstvwxyz]*)\\.([0123456789abcdefghjkmnpqrstvwxyz])$',
17
+ pattern: '^sp_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz])$',
17
18
  },
18
19
  id: {
19
20
  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
21
  type: 'string',
21
22
  format: 'uuid',
22
23
  },
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
- 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
24
  },
51
25
  'house-app-preferences': {
52
26
  description: "An App's preferences. Its own vocabulary is in the body.",
53
- properties: { app: { $ref: '#/$defs/app' } },
27
+ properties: { app: { title: 'App', $ref: '#/$defs/app' } },
54
28
  required: ['app'],
55
29
  },
56
30
  'house-notification': {
57
- description: "One kept Human 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 state belongs to each browser.",
31
+ 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.",
58
32
  properties: {
59
- notification: { $ref: '#/$defs/id' },
33
+ notification: { title: 'Notification', $ref: '#/$defs/id' },
60
34
  kind: {
35
+ title: 'Kind',
61
36
  type: 'string',
62
37
  enum: [
63
38
  'share-offer',
64
39
  'join-request',
65
40
  'join-request-approved',
66
- 'app-room-binding-incompatible',
67
- 'app-deleted',
68
- 'app-call',
69
41
  'room-ownership-offer',
70
42
  'managed-environment-retention-opened',
71
- 'managed-environment-placement-intervention',
72
43
  'storage-full',
73
44
  'sandbox-budget-spent',
45
+ 'trigger-failed',
46
+ 'room-telegram-chat-paused',
74
47
  'break-glass-owner-disclosure',
75
- 'routine-start-approval-request',
76
- 'routine-request-declined',
77
- 'routine-request-started',
78
- 'routine-request-finished',
79
- 'routine-request-not-started',
80
48
  'export-ready',
81
49
  'export-failed',
82
- 'site-disabled',
83
- 'site-binding-incompatible',
84
- 'site-room-left',
85
- 'site-images-full',
86
50
  'custom',
87
- 'trigger-did-nothing',
88
- 'function-failed',
51
+ 'agent-function-request-finished',
89
52
  ],
90
53
  },
91
- created: { type: 'string', format: 'date-time' },
54
+ created: { title: 'Created', type: 'string', format: 'date-time' },
55
+ read: { title: 'Read', type: 'string', format: 'date-time' },
92
56
  way_in: {
57
+ title: 'Way in',
93
58
  type: 'object',
94
59
  additionalProperties: false,
95
60
  properties: {
96
- path: { type: 'string', pattern: '^\\/' },
97
- room: { $ref: '#/$defs/room' },
98
- app: { $ref: '#/$defs/app' },
99
- agent: { $ref: '#/$defs/id' },
100
- environment: { $ref: '#/$defs/id' },
101
- routine: { $ref: '#/$defs/id' },
102
- routine_request: { $ref: '#/$defs/id' },
103
- trigger: { $ref: '#/$defs/id' },
104
- site: { $ref: '#/$defs/id' },
61
+ path: { title: 'Path', type: 'string', pattern: '^\\/' },
62
+ room: { title: 'Room', $ref: '#/$defs/room' },
63
+ environment: { title: 'Environment', $ref: '#/$defs/id' },
64
+ trigger: { title: 'Trigger', $ref: '#/$defs/id' },
105
65
  },
106
66
  minProperties: 1,
107
67
  },
108
- subject: { type: 'string' },
109
- share: { $ref: '#/$defs/id' },
68
+ subject: { title: 'Subject', type: 'string' },
69
+ share: { title: 'Share', $ref: '#/$defs/id' },
110
70
  issuer: {
71
+ title: 'Issuer',
111
72
  type: 'object',
112
73
  additionalProperties: false,
113
- properties: { name: { type: 'string' }, email: { type: 'string', format: 'email' } },
74
+ properties: {
75
+ name: { title: 'Name', type: 'string' },
76
+ email: { title: 'Email', type: 'string', format: 'email' },
77
+ },
114
78
  required: ['name', 'email'],
115
79
  },
116
80
  rooms: {
81
+ title: 'Rooms',
117
82
  type: 'array',
118
83
  items: {
119
84
  type: 'object',
120
85
  additionalProperties: false,
121
- properties: { name: { type: 'string' } },
86
+ properties: { name: { title: 'Name', type: 'string' } },
122
87
  required: ['name'],
123
88
  },
124
89
  },
125
90
  apps: {
126
- maxItems: 20,
91
+ title: 'Apps',
127
92
  type: 'array',
128
93
  items: {
129
94
  type: 'object',
130
95
  additionalProperties: false,
131
96
  properties: {
132
- name: { type: 'string', minLength: 1, maxLength: 200 },
133
- reaches: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 512 } },
97
+ name: { title: 'Name', type: 'string', minLength: 1, maxLength: 200 },
98
+ reaches: {
99
+ title: 'Reaches',
100
+ type: 'array',
101
+ items: { type: 'string', minLength: 1, maxLength: 512 },
102
+ },
134
103
  },
135
104
  required: ['name', 'reaches'],
136
105
  },
137
106
  },
138
- expires_at: { type: 'string', format: 'date-time' },
139
- join_request: { $ref: '#/$defs/id' },
107
+ spaces: {
108
+ title: 'Spaces',
109
+ type: 'array',
110
+ items: {
111
+ type: 'object',
112
+ additionalProperties: false,
113
+ properties: { name: { title: 'Name', type: 'string' } },
114
+ required: ['name'],
115
+ },
116
+ },
117
+ expires_at: { title: 'Expires at', type: 'string', format: 'date-time' },
118
+ join_request: { title: 'Join request', $ref: '#/$defs/id' },
140
119
  user: {
120
+ title: 'User',
141
121
  type: 'object',
142
122
  additionalProperties: false,
143
- properties: { name: { type: 'string' }, email: { type: 'string', format: 'email' } },
144
- required: ['name', 'email'],
123
+ properties: {
124
+ name: { title: 'Name', type: 'string' },
125
+ email: { title: 'Email', type: 'string', format: 'email' },
126
+ },
127
+ required: ['name'],
145
128
  },
146
129
  room: {
130
+ title: 'Room',
147
131
  type: 'object',
148
132
  additionalProperties: false,
149
- properties: { room: { $ref: '#/$defs/room' }, name: { type: 'string' } },
133
+ properties: {
134
+ room: { title: 'Room', $ref: '#/$defs/room' },
135
+ name: { title: 'Name', type: 'string' },
136
+ },
150
137
  minProperties: 1,
151
138
  },
152
139
  app: {
140
+ title: 'App',
153
141
  type: 'object',
154
142
  additionalProperties: false,
155
- properties: { app: { $ref: '#/$defs/app' }, name: { type: 'string' } },
156
- minProperties: 1,
143
+ properties: { app: { title: 'App', $ref: '#/$defs/app' } },
144
+ required: ['app'],
157
145
  },
158
- binding: { $ref: '#/$defs/id' },
159
- slot: { type: 'string' },
160
- findings: { type: 'array', items: { type: 'string' } },
161
- owner: {
146
+ space: {
147
+ title: 'Space',
162
148
  type: 'object',
163
149
  additionalProperties: false,
164
- properties: { name: { type: 'string' } },
165
- required: ['name'],
150
+ properties: { space: { title: 'Space', $ref: '#/$defs/space' } },
151
+ required: ['space'],
166
152
  },
167
- caller: {
168
- type: 'object',
169
- additionalProperties: false,
170
- properties: { user: { $ref: '#/$defs/id' }, name: { type: 'string' } },
171
- required: ['user', 'name'],
172
- },
173
- ownership_offer: { $ref: '#/$defs/id' },
153
+ ownership_offer: { title: 'Ownership offer', $ref: '#/$defs/id' },
174
154
  offerer: {
155
+ title: 'Offerer',
175
156
  type: 'object',
176
157
  additionalProperties: false,
177
- properties: { name: { type: 'string' }, email: { type: 'string', format: 'email' } },
158
+ properties: {
159
+ name: { title: 'Name', type: 'string' },
160
+ email: { title: 'Email', type: 'string', format: 'email' },
161
+ },
178
162
  required: ['name', 'email'],
179
163
  },
180
164
  environment: {
165
+ title: 'Environment',
181
166
  type: 'object',
182
167
  additionalProperties: false,
183
168
  properties: {
184
- environment: { $ref: '#/$defs/id' },
185
- name: { type: 'string' },
186
- kind: { enum: ['vps', 'sandbox'] },
169
+ environment: { title: 'Environment', $ref: '#/$defs/id' },
170
+ name: { title: 'Name', type: 'string' },
171
+ kind: { title: 'Kind', enum: ['vps', 'sandbox'] },
187
172
  },
188
173
  required: ['environment', 'name'],
189
174
  },
190
- reason: { type: 'string' },
191
- deadline: { type: 'string', format: 'date-time' },
192
- operation_kind: { type: 'string' },
175
+ reason: { title: 'Reason', type: 'string' },
176
+ deadline: { title: 'Deadline', type: 'string', format: 'date-time' },
193
177
  free: {
178
+ title: 'Free',
194
179
  type: 'object',
195
180
  additionalProperties: false,
196
181
  properties: {
197
- held: { type: 'string', pattern: '^\\d+$' },
198
- limit: { type: 'string', pattern: '^[1-9]\\d*$' },
199
- measure: { type: 'string', enum: ['content', 'retained'] },
182
+ held: { title: 'Held', type: 'string', pattern: '^\\d+$' },
183
+ limit: { title: 'Limit', type: 'string', pattern: '^[1-9]\\d*$' },
184
+ measure: { title: 'Measure', type: 'string', enum: ['content', 'retained'] },
200
185
  },
201
186
  required: ['held', 'limit', 'measure'],
202
187
  },
203
- budget: { type: 'string', pattern: '^\\d+(?:\\.\\d+)?$' },
204
- resets_at: { type: 'string', format: 'date-time' },
205
- grant: { $ref: '#/$defs/id' },
206
- category: { type: 'string' },
207
- access_started_at: { type: 'string', format: 'date-time' },
208
- access_ended_at: { type: 'string', format: 'date-time' },
209
- systems: { type: 'array', items: { type: 'string' } },
210
- case_reference: { type: 'string' },
211
- routine_request: { $ref: '#/$defs/id' },
212
- requester: {
213
- type: 'object',
214
- additionalProperties: false,
215
- properties: { name: { type: 'string' } },
216
- required: ['name'],
217
- },
218
- agent: {
219
- type: 'object',
220
- additionalProperties: false,
221
- properties: { agent: { $ref: '#/$defs/id' }, name: { type: 'string' } },
222
- required: ['name'],
188
+ chat: { title: 'Chat', type: 'string' },
189
+ missing: {
190
+ title: 'Missing',
191
+ type: 'array',
192
+ items: {
193
+ type: 'string',
194
+ enum: [
195
+ 'private',
196
+ 'topics',
197
+ 'ban_users',
198
+ 'invite_users',
199
+ 'manage_topics',
200
+ 'post_messages',
201
+ 'edit_messages',
202
+ 'inbox_manage_topics',
203
+ 'inbox_delete_messages',
204
+ ],
205
+ },
223
206
  },
224
- conversation: { $ref: '#/$defs/id' },
225
- routine: {
207
+ budget: { title: 'Budget', type: 'string', pattern: '^\\d+(?:\\.\\d+)?$' },
208
+ resets_at: { title: 'Resets at', type: 'string', format: 'date-time' },
209
+ grant: { title: 'Grant', $ref: '#/$defs/id' },
210
+ category: { title: 'Category', type: 'string' },
211
+ access_started_at: { title: 'Access started at', type: 'string', format: 'date-time' },
212
+ access_ended_at: { title: 'Access ended at', type: 'string', format: 'date-time' },
213
+ systems: { title: 'Systems', type: 'array', items: { type: 'string' } },
214
+ case_reference: { title: 'Case reference', type: 'string' },
215
+ export: { title: 'Export', $ref: '#/$defs/id' },
216
+ size_bytes: { title: 'Size in bytes', type: 'integer', minimum: 0 },
217
+ name: { title: 'Name', type: 'string' },
218
+ authorship: {
219
+ title: 'Authorship',
226
220
  type: 'object',
227
221
  additionalProperties: false,
228
222
  properties: {
229
- routine: { $ref: '#/$defs/id' },
230
- name: { type: 'string' },
231
- version: { type: 'integer', minimum: 1 },
223
+ kind: { title: 'Kind', type: 'string', const: 'trigger-action' },
224
+ trigger: { title: 'Trigger', $ref: '#/$defs/id' },
225
+ position: { title: 'Position', type: 'integer', minimum: 0 },
232
226
  },
233
- required: ['name'],
227
+ required: ['kind', 'trigger', 'position'],
234
228
  },
235
- decliner: {
229
+ path: { title: 'Path', type: 'string', maxLength: 4096, pattern: '^\\/.*' },
230
+ trigger: {
231
+ title: 'Trigger',
236
232
  type: 'object',
237
233
  additionalProperties: false,
238
- properties: { name: { type: 'string' } },
239
- required: ['name'],
234
+ properties: {
235
+ trigger: { title: 'Trigger', $ref: '#/$defs/id' },
236
+ description: { title: 'Description', type: 'string' },
237
+ },
238
+ required: ['trigger', 'description'],
240
239
  },
241
- input: { type: 'string' },
242
- export: { $ref: '#/$defs/id' },
243
- size_bytes: { type: 'integer', minimum: 0 },
244
- site: {
245
- type: 'object',
246
- additionalProperties: false,
247
- properties: { site: { $ref: '#/$defs/id' }, name: { type: 'string' } },
248
- required: ['site', 'name'],
240
+ code: {
241
+ title: 'Code',
242
+ type: 'string',
243
+ enum: [
244
+ 'failed',
245
+ 'function_failed',
246
+ 'function_not_started',
247
+ 'agent_function_request_not_started',
248
+ ],
249
249
  },
250
- address: { type: 'string', maxLength: 300, format: 'uri' },
251
- to: {
250
+ action: { title: 'Action', type: 'integer', minimum: 0 },
251
+ moment: { title: 'Moment', type: 'string', format: 'date-time' },
252
+ error: { title: 'Error', type: 'string' },
253
+ agent_function: {
254
+ title: 'Agent function',
252
255
  type: 'object',
253
256
  additionalProperties: false,
254
- properties: { name: { type: 'string' } },
257
+ properties: { name: { title: 'Name', type: 'string' } },
255
258
  required: ['name'],
256
259
  },
257
- copies: { type: 'integer', minimum: 0 },
258
- bound: { type: 'integer', minimum: 0 },
259
- title: { type: 'string' },
260
- body: { type: 'string' },
261
- authorship: {
262
- type: 'object',
263
- additionalProperties: false,
264
- properties: {
265
- kind: { type: 'string', const: 'trigger-action' },
266
- trigger: { $ref: '#/$defs/id' },
267
- position: { type: 'integer', minimum: 0 },
268
- },
269
- required: ['kind', 'trigger', 'position'],
270
- },
271
- path: { type: 'string', maxLength: 4096, pattern: '^\\/.*' },
272
- trigger: {
260
+ agent: {
261
+ title: 'Agent',
273
262
  type: 'object',
274
263
  additionalProperties: false,
275
- properties: { trigger: { $ref: '#/$defs/id' }, name: { type: 'string' } },
276
- required: ['trigger', 'name'],
264
+ properties: { name: { title: 'Name', type: 'string' } },
265
+ required: ['name'],
277
266
  },
278
- cause: { type: 'string' },
279
- function: { type: 'string' },
280
- error: { type: 'string' },
267
+ ended: { title: 'Ended', type: 'string', enum: ['finished', 'failed'] },
268
+ duration: { title: 'Duration', type: 'integer', minimum: 1 },
281
269
  },
282
270
  required: ['notification', 'kind', 'created', 'way_in', 'subject'],
283
271
  },
@@ -285,121 +273,50 @@ export const HOUSE_MODEL_DECLARATION = {
285
273
  description: "The panel's preferences at /rooms/private/settings/panel.md. Its own vocabulary is in the body.",
286
274
  properties: {},
287
275
  },
288
- 'house-routine': {
289
- description: "One Routine that serves this Room, which House alone writes from its owner's document in their Private Room: the `routine` 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 Routine's instruction is never written here.",
276
+ 'house-agent-function': {
277
+ 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.",
290
278
  properties: {
291
- reflected: { type: 'string', format: 'date-time' },
292
- routine: { $ref: '#/$defs/id' },
293
- description: { type: 'string' },
294
- input: { type: 'string' },
279
+ reflected: { title: 'Reflected', type: 'string', format: 'date-time' },
280
+ agent_function: { title: 'Agent function', $ref: '#/$defs/id' },
281
+ description: { title: 'Description', type: 'string' },
282
+ input: { title: 'Input', type: 'string' },
295
283
  agent: {
284
+ title: 'Agent',
296
285
  type: 'object',
297
286
  additionalProperties: false,
298
- properties: { agent: { $ref: '#/$defs/id' }, name: { type: 'string' } },
287
+ properties: {
288
+ agent: { title: 'Agent', $ref: '#/$defs/id' },
289
+ name: { title: 'Name', type: 'string' },
290
+ },
299
291
  required: ['agent', 'name'],
300
292
  },
301
293
  },
302
- required: ['reflected', 'routine', 'description', 'input', 'agent'],
294
+ required: ['reflected', 'agent_function', 'description', 'input', 'agent'],
295
+ },
296
+ 'house-agent-function-document': {
297
+ 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, the `agent` it starts, by identifier, and `afk`, true for a run nobody watches, off when absent. Its body is the instruction that Agent follows.',
298
+ properties: {
299
+ description: { title: 'Description', type: 'string', maxLength: 2000, pattern: '\\S' },
300
+ input: { title: 'Input', type: 'string' },
301
+ agent: { title: 'Agent', $ref: '#/$defs/id' },
302
+ afk: { title: 'AFK', type: 'boolean' },
303
+ },
304
+ required: ['description', 'input', 'agent'],
303
305
  },
304
306
  'house-trigger': {
305
- 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`; a `routine` action sends its `payload` to the Routine whose card under this Room's `house/routines/` its `card` names, absent while this Room holds no card of that Routine; a `message` action puts its `text` into the active conversation that Routine started for what the Event is about, or starts that Routine when none is active; a `done` action marks Done every active conversation a Routine 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 Routine's card, the App's latest release and the owner's functions.",
307
+ 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.",
306
308
  properties: {
307
- reflected: { type: 'string', format: 'date-time' },
308
- trigger: { $ref: '#/$defs/id' },
309
- description: { type: 'string' },
309
+ reflected: { title: 'Reflected', type: 'string', format: 'date-time' },
310
+ trigger: { title: 'Trigger', $ref: '#/$defs/id' },
311
+ description: { title: 'Description', type: 'string' },
310
312
  condition: {
311
- anyOf: [
312
- {
313
- type: 'object',
314
- additionalProperties: false,
315
- properties: {
316
- on: { const: 'documents' },
317
- scope: { $ref: '#/$defs/trigger_scope' },
318
- mode: { const: 'starts_matching' },
319
- new_documents: { type: 'boolean' },
320
- match: { $ref: '#/$defs/trigger_test' },
321
- by: { $ref: '#/$defs/trigger_test' },
322
- moved_between_rooms: { type: 'boolean' },
323
- },
324
- required: ['on', 'scope', 'mode', 'new_documents', 'match'],
325
- },
326
- {
327
- type: 'object',
328
- additionalProperties: false,
329
- properties: {
330
- on: { const: 'documents' },
331
- scope: { $ref: '#/$defs/trigger_scope' },
332
- mode: { const: 'field_changes' },
333
- field: { type: 'string' },
334
- from: { anyOf: [{ $ref: '#/$defs/trigger_values' }, { const: 'new' }] },
335
- to: { anyOf: [{ $ref: '#/$defs/trigger_values' }, { const: 'deleted' }] },
336
- match: { $ref: '#/$defs/trigger_test' },
337
- by: { $ref: '#/$defs/trigger_test' },
338
- moved_between_rooms: { type: 'boolean' },
339
- },
340
- required: ['on', 'scope', 'mode', 'field'],
341
- },
342
- {
343
- type: 'object',
344
- additionalProperties: false,
345
- properties: {
346
- on: { const: 'items' },
347
- source: { type: 'string' },
348
- address: { type: 'string' },
349
- match: { $ref: '#/$defs/trigger_test' },
350
- },
351
- required: ['on'],
352
- },
353
- {
354
- type: 'object',
355
- additionalProperties: false,
356
- properties: {
357
- on: { const: 'notifications' },
358
- match: { $ref: '#/$defs/trigger_test' },
359
- },
360
- required: ['on'],
361
- },
362
- {
363
- type: 'object',
364
- additionalProperties: false,
365
- properties: {
366
- on: { const: 'messages' },
367
- match: { $ref: '#/$defs/trigger_test' },
368
- },
369
- required: ['on'],
370
- },
371
- {
372
- type: 'object',
373
- additionalProperties: false,
374
- properties: {
375
- on: { const: 'clock' },
376
- cron: { type: 'string' },
377
- time_zone: { type: 'string' },
378
- },
379
- required: ['on', 'cron', 'time_zone'],
380
- },
381
- {
382
- type: 'object',
383
- additionalProperties: false,
384
- properties: {
385
- on: { const: 'clock' },
386
- scope: {
387
- type: 'object',
388
- additionalProperties: false,
389
- properties: { type: { type: 'string' } },
390
- required: ['type'],
391
- },
392
- date: { type: 'string' },
393
- days: { type: 'integer' },
394
- at: { type: 'string' },
395
- time_zone: { type: 'string' },
396
- match: { $ref: '#/$defs/trigger_test' },
397
- },
398
- required: ['on', 'scope', 'date', 'days', 'at', 'time_zone'],
399
- },
400
- ],
313
+ title: 'Condition',
314
+ description: 'When it fires, as the Trigger reference page writes it, a document it names at its current path.',
315
+ type: 'object',
316
+ additionalProperties: true,
401
317
  },
402
318
  actions: {
319
+ title: 'Actions',
403
320
  type: 'array',
404
321
  items: {
405
322
  anyOf: [
@@ -407,25 +324,27 @@ export const HOUSE_MODEL_DECLARATION = {
407
324
  type: 'object',
408
325
  additionalProperties: false,
409
326
  properties: {
410
- kind: { const: 'notify' },
411
- enabled: { type: 'boolean' },
412
- title: { type: 'string' },
413
- text: { type: 'string' },
327
+ kind: { title: 'Kind', const: 'notify' },
328
+ enabled: { title: 'Enabled', type: 'boolean' },
329
+ title: { title: 'Title', type: 'string' },
330
+ text: { title: 'Text', type: 'string' },
414
331
  to: {
332
+ title: 'To',
415
333
  type: 'object',
416
334
  additionalProperties: false,
417
335
  properties: {
418
336
  users: {
337
+ title: 'Users',
419
338
  type: 'array',
420
339
  items: {
421
340
  type: 'object',
422
341
  additionalProperties: false,
423
- properties: { user: { $ref: '#/$defs/id' } },
342
+ properties: { user: { title: 'User', $ref: '#/$defs/id' } },
424
343
  required: ['user'],
425
344
  },
426
345
  },
427
- fields: { type: 'array', items: { type: 'string' } },
428
- roles: { type: 'array', items: { type: 'string' } },
346
+ fields: { title: 'Fields', type: 'array', items: { type: 'string' } },
347
+ roles: { title: 'Roles', type: 'array', items: { type: 'string' } },
429
348
  },
430
349
  required: ['users', 'fields', 'roles'],
431
350
  },
@@ -436,10 +355,10 @@ export const HOUSE_MODEL_DECLARATION = {
436
355
  type: 'object',
437
356
  additionalProperties: false,
438
357
  properties: {
439
- kind: { const: 'routine' },
440
- enabled: { type: 'boolean' },
441
- card: { type: 'string', minLength: 1 },
442
- payload: { type: 'string' },
358
+ kind: { title: 'Kind', const: 'agent_function' },
359
+ enabled: { title: 'Enabled', type: 'boolean' },
360
+ card: { title: 'Card', type: 'string', minLength: 1 },
361
+ payload: { title: 'Payload', type: 'string' },
443
362
  },
444
363
  required: ['kind', 'enabled', 'payload'],
445
364
  },
@@ -447,42 +366,49 @@ export const HOUSE_MODEL_DECLARATION = {
447
366
  type: 'object',
448
367
  additionalProperties: false,
449
368
  properties: {
450
- kind: { const: 'message' },
451
- enabled: { type: 'boolean' },
452
- card: { type: 'string', minLength: 1 },
453
- text: { type: 'string' },
369
+ kind: { title: 'Kind', const: 'message' },
370
+ enabled: { title: 'Enabled', type: 'boolean' },
371
+ card: { title: 'Card', type: 'string', minLength: 1 },
372
+ text: { title: 'Text', type: 'string' },
454
373
  },
455
374
  required: ['kind', 'enabled', 'text'],
456
375
  },
457
376
  {
458
377
  type: 'object',
459
378
  additionalProperties: false,
460
- properties: { kind: { const: 'done' }, enabled: { type: 'boolean' } },
379
+ properties: {
380
+ kind: { title: 'Kind', const: 'done' },
381
+ enabled: { title: 'Enabled', type: 'boolean' },
382
+ },
461
383
  required: ['kind', 'enabled'],
462
384
  },
463
385
  {
464
386
  type: 'object',
465
387
  additionalProperties: false,
466
388
  properties: {
467
- kind: { const: 'function' },
468
- enabled: { type: 'boolean' },
469
- app: { $ref: '#/$defs/app' },
470
- function: { type: 'string' },
389
+ kind: { title: 'Kind', const: 'function' },
390
+ enabled: { title: 'Enabled', type: 'boolean' },
391
+ app: { title: 'App', $ref: '#/$defs/app' },
392
+ function: { title: 'Function', type: 'string' },
471
393
  },
472
394
  required: ['kind', 'enabled', 'function'],
473
395
  },
474
396
  ],
475
397
  },
476
398
  },
477
- enabled: { type: 'boolean' },
478
- paused_by: { enum: ['types'] },
399
+ enabled: { title: 'Enabled', type: 'boolean' },
400
+ paused_by: { title: 'Paused by', enum: ['types'] },
479
401
  creator: {
402
+ title: 'Creator',
480
403
  type: 'object',
481
404
  additionalProperties: false,
482
- properties: { user: { $ref: '#/$defs/id' }, name: { type: 'string' } },
405
+ properties: {
406
+ user: { title: 'User', $ref: '#/$defs/id' },
407
+ name: { title: 'Name', type: 'string' },
408
+ },
483
409
  required: ['user', 'name'],
484
410
  },
485
- created: { type: 'string', format: 'date-time' },
411
+ created: { title: 'Created', type: 'string', format: 'date-time' },
486
412
  },
487
413
  required: [
488
414
  'reflected',
@@ -498,17 +424,24 @@ export const HOUSE_MODEL_DECLARATION = {
498
424
  'house-web-wizard': {
499
425
  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.",
500
426
  properties: {
501
- reflected: { type: 'string', format: 'date-time' },
502
- web_wizard: { $ref: '#/$defs/id' },
427
+ reflected: { title: 'Reflected', type: 'string', format: 'date-time' },
428
+ web_wizard: { title: 'Web Wizard', $ref: '#/$defs/id' },
503
429
  environment: {
430
+ title: 'Environment',
504
431
  type: 'object',
505
432
  additionalProperties: false,
506
- properties: { environment: { $ref: '#/$defs/id' }, name: { type: 'string' } },
433
+ properties: {
434
+ environment: { title: 'Environment', $ref: '#/$defs/id' },
435
+ name: { title: 'Name', type: 'string' },
436
+ },
507
437
  required: ['environment', 'name'],
508
438
  },
509
- state: { enum: ['waiting', 'running', 'finished', 'failed', 'cancelled', 'lapsed', 'kept'] },
510
- exit_code: { type: 'integer' },
511
- function: { type: 'string' },
439
+ state: {
440
+ title: 'State',
441
+ enum: ['waiting', 'running', 'finished', 'failed', 'cancelled', 'lapsed', 'kept'],
442
+ },
443
+ exit_code: { title: 'Exit code', type: 'integer' },
444
+ function: { title: 'Function', type: 'string' },
512
445
  },
513
446
  required: ['reflected', 'web_wizard', 'environment', 'state'],
514
447
  },
@@ -519,3 +452,13 @@ function modelText(model) {
519
452
  .join('\n')}\n`;
520
453
  }
521
454
  export const HOUSE_MODEL_TYPES = modelText(HOUSE_MODEL_DECLARATION);
455
+ export const HOUSE_TYPED_PATHS = [
456
+ { path: 'settings/panel.md', type: 'house-panel-preferences', named: true, body: false },
457
+ { path: `${APP_PREFERENCES_HOME}/*.md`, type: 'house-app-preferences', named: true, body: false },
458
+ {
459
+ path: 'rooms/*/agent-functions/*.md',
460
+ type: 'house-agent-function-document',
461
+ named: false,
462
+ body: true,
463
+ },
464
+ ];