@protoyard/blueprint 0.0.0-stage → 1.1.1

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 (168) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1145 -2
  3. package/dist/aggregate.d.ts +83 -0
  4. package/dist/aggregate.js +268 -0
  5. package/dist/app-model.d.ts +76 -0
  6. package/dist/app-model.js +287 -0
  7. package/dist/archetypes/index.d.ts +1 -0
  8. package/dist/archetypes/index.js +1 -0
  9. package/dist/archetypes/schema.d.ts +126 -0
  10. package/dist/archetypes/schema.js +77 -0
  11. package/dist/audit.d.ts +52 -0
  12. package/dist/audit.js +149 -0
  13. package/dist/authoring/deck-lint.d.ts +32 -0
  14. package/dist/authoring/deck-lint.js +567 -0
  15. package/dist/authoring/index.d.ts +1 -0
  16. package/dist/authoring/index.js +1 -0
  17. package/dist/authoring/select-deck-layouts.d.ts +50 -0
  18. package/dist/authoring/select-deck-layouts.js +213 -0
  19. package/dist/authoring-apis.d.ts +13 -0
  20. package/dist/authoring-apis.js +13 -0
  21. package/dist/authoring-validation.d.ts +65 -0
  22. package/dist/authoring-validation.js +267 -0
  23. package/dist/avatar.d.ts +25 -0
  24. package/dist/avatar.js +30 -0
  25. package/dist/brand.d.ts +70 -0
  26. package/dist/brand.js +294 -0
  27. package/dist/brief/archetypes.d.ts +28 -0
  28. package/dist/brief/archetypes.js +798 -0
  29. package/dist/brief/content-synthesize.d.ts +31 -0
  30. package/dist/brief/content-synthesize.js +210 -0
  31. package/dist/brief/deck-outlines.d.ts +96 -0
  32. package/dist/brief/deck-outlines.js +561 -0
  33. package/dist/brief/draft-bodies.d.ts +29 -0
  34. package/dist/brief/draft-bodies.js +224 -0
  35. package/dist/brief/fields.d.ts +19 -0
  36. package/dist/brief/fields.js +229 -0
  37. package/dist/brief/index.d.ts +8 -0
  38. package/dist/brief/index.js +8 -0
  39. package/dist/brief/kind-detection.d.ts +69 -0
  40. package/dist/brief/kind-detection.js +353 -0
  41. package/dist/brief/limits.d.ts +117 -0
  42. package/dist/brief/limits.js +217 -0
  43. package/dist/brief/page-doc-outlines.d.ts +80 -0
  44. package/dist/brief/page-doc-outlines.js +485 -0
  45. package/dist/brief/synthesize.d.ts +59 -0
  46. package/dist/brief/synthesize.js +511 -0
  47. package/dist/brief/text.d.ts +13 -0
  48. package/dist/brief/text.js +59 -0
  49. package/dist/canvas-screen.d.ts +31 -0
  50. package/dist/canvas-screen.js +33 -0
  51. package/dist/canvas-seed.d.ts +58 -0
  52. package/dist/canvas-seed.js +82 -0
  53. package/dist/computed/evaluate.d.ts +11 -0
  54. package/dist/computed/evaluate.js +101 -0
  55. package/dist/computed/index.d.ts +4 -0
  56. package/dist/computed/index.js +3 -0
  57. package/dist/computed/public.d.ts +14 -0
  58. package/dist/computed/public.js +19 -0
  59. package/dist/computed/schema.d.ts +10 -0
  60. package/dist/computed/schema.js +140 -0
  61. package/dist/computed/types.d.ts +70 -0
  62. package/dist/computed/types.js +1 -0
  63. package/dist/computed/validate.d.ts +6 -0
  64. package/dist/computed/validate.js +146 -0
  65. package/dist/csv-guard.d.ts +15 -0
  66. package/dist/csv-guard.js +29 -0
  67. package/dist/csv.d.ts +85 -0
  68. package/dist/csv.js +288 -0
  69. package/dist/files.d.ts +35 -0
  70. package/dist/files.js +246 -0
  71. package/dist/form-schema.d.ts +124 -0
  72. package/dist/form-schema.js +300 -0
  73. package/dist/generator-version.d.ts +11 -0
  74. package/dist/generator-version.js +51 -0
  75. package/dist/generator.d.ts +34 -0
  76. package/dist/generator.js +445 -0
  77. package/dist/identity.d.ts +34 -0
  78. package/dist/identity.js +91 -0
  79. package/dist/import/csv-shape.d.ts +40 -0
  80. package/dist/import/csv-shape.js +265 -0
  81. package/dist/import/json-shape.d.ts +55 -0
  82. package/dist/import/json-shape.js +491 -0
  83. package/dist/import/limits.d.ts +13 -0
  84. package/dist/import/limits.js +14 -0
  85. package/dist/import/sqlite-schema.d.ts +36 -0
  86. package/dist/import/sqlite-schema.js +729 -0
  87. package/dist/index.d.ts +60 -0
  88. package/dist/index.js +58 -0
  89. package/dist/kinds/anchors.d.ts +18 -0
  90. package/dist/kinds/anchors.js +46 -0
  91. package/dist/kinds/bodies.d.ts +6 -0
  92. package/dist/kinds/bodies.js +32 -0
  93. package/dist/kinds/brand-runtime.d.ts +19 -0
  94. package/dist/kinds/brand-runtime.js +35 -0
  95. package/dist/kinds/deck.d.ts +8 -0
  96. package/dist/kinds/deck.js +34 -0
  97. package/dist/kinds/doc.d.ts +19 -0
  98. package/dist/kinds/doc.js +41 -0
  99. package/dist/kinds/embed/index.d.ts +39 -0
  100. package/dist/kinds/embed/index.js +91 -0
  101. package/dist/kinds/envelope.d.ts +159 -0
  102. package/dist/kinds/envelope.js +78 -0
  103. package/dist/kinds/index.d.ts +11 -0
  104. package/dist/kinds/index.js +11 -0
  105. package/dist/kinds/kind.d.ts +36 -0
  106. package/dist/kinds/kind.js +55 -0
  107. package/dist/kinds/limits.d.ts +64 -0
  108. package/dist/kinds/limits.js +190 -0
  109. package/dist/kinds/page-doc-runtime.d.ts +37 -0
  110. package/dist/kinds/page-doc-runtime.js +55 -0
  111. package/dist/kinds/page.d.ts +16 -0
  112. package/dist/kinds/page.js +67 -0
  113. package/dist/kinds/parse.d.ts +18 -0
  114. package/dist/kinds/parse.js +27 -0
  115. package/dist/kinds/runtime.d.ts +128 -0
  116. package/dist/kinds/runtime.js +206 -0
  117. package/dist/kinds/services.d.ts +49 -0
  118. package/dist/kinds/services.js +249 -0
  119. package/dist/kinds/testing.d.ts +9 -0
  120. package/dist/kinds/testing.js +16 -0
  121. package/dist/migrations.d.ts +97 -0
  122. package/dist/migrations.js +351 -0
  123. package/dist/motion.d.ts +50 -0
  124. package/dist/motion.js +52 -0
  125. package/dist/notifications.d.ts +19 -0
  126. package/dist/notifications.js +177 -0
  127. package/dist/patch.d.ts +122 -0
  128. package/dist/patch.js +322 -0
  129. package/dist/policy.d.ts +23 -0
  130. package/dist/policy.js +105 -0
  131. package/dist/runtime-definition.d.ts +39 -0
  132. package/dist/runtime-definition.js +74 -0
  133. package/dist/scenarios.d.ts +9 -0
  134. package/dist/scenarios.js +49 -0
  135. package/dist/schema/blueprint.schema.json +10191 -0
  136. package/dist/schema-json.d.ts +6 -0
  137. package/dist/schema-json.js +36 -0
  138. package/dist/schema.d.ts +6348 -0
  139. package/dist/schema.js +1269 -0
  140. package/dist/search.d.ts +16 -0
  141. package/dist/search.js +96 -0
  142. package/dist/services.d.ts +89 -0
  143. package/dist/services.js +898 -0
  144. package/dist/share.d.ts +78 -0
  145. package/dist/share.js +234 -0
  146. package/dist/sheet-screen.d.ts +49 -0
  147. package/dist/sheet-screen.js +91 -0
  148. package/dist/storage.d.ts +43 -0
  149. package/dist/storage.js +179 -0
  150. package/dist/stream.d.ts +26 -0
  151. package/dist/stream.js +173 -0
  152. package/dist/untrusted.d.ts +63 -0
  153. package/dist/untrusted.js +502 -0
  154. package/dist/validation-tasks.d.ts +178 -0
  155. package/dist/validation-tasks.js +199 -0
  156. package/dist/validation.d.ts +35 -0
  157. package/dist/validation.js +312 -0
  158. package/dist/variants.d.ts +112 -0
  159. package/dist/variants.js +283 -0
  160. package/dist/workflows/index.d.ts +3 -0
  161. package/dist/workflows/index.js +3 -0
  162. package/dist/workflows/schema.d.ts +50 -0
  163. package/dist/workflows/schema.js +34 -0
  164. package/dist/workflows/transition.d.ts +15 -0
  165. package/dist/workflows/transition.js +25 -0
  166. package/dist/workflows/validate.d.ts +17 -0
  167. package/dist/workflows/validate.js +140 -0
  168. package/package.json +120 -3
@@ -0,0 +1,798 @@
1
+ const text = (name, extra = {}) => ({ name, kind: 'text', ...extra });
2
+ const enumOf = (name, values, extra = {}) => ({ name, kind: 'enum', values, default: values[0], required: true, ...extra });
3
+ const of = (name, kind, extra = {}) => ({ name, kind, ...extra });
4
+ /** Ordered: on equal keyword scores the earlier archetype wins. */
5
+ export const ARCHETYPES = [
6
+ {
7
+ id: 'helpdesk',
8
+ label: 'Help Desk',
9
+ keywords: [
10
+ 'help desk',
11
+ 'helpdesk',
12
+ 'support',
13
+ 'ticket',
14
+ 'tickets',
15
+ 'sla',
16
+ 'issue',
17
+ 'issues',
18
+ 'inbox',
19
+ 'complaint',
20
+ 'complaints',
21
+ ],
22
+ entities: [
23
+ {
24
+ name: 'ticket',
25
+ plural: 'tickets',
26
+ fields: [
27
+ text('subject', { required: true, fake: 'lorem.sentence', maxLength: 120 }),
28
+ enumOf('status', ['open', 'pending', 'solved'], { weights: [5, 3, 4] }),
29
+ enumOf('priority', ['low', 'normal', 'high', 'urgent'], { weights: [2, 5, 2, 1] }),
30
+ of('dueAt', 'datetime', { window: 'around' }),
31
+ of('customer', 'relation', { to: 'customer' }),
32
+ of('assignee', 'persona'),
33
+ ],
34
+ titleField: 'subject',
35
+ ownerField: 'assignee',
36
+ },
37
+ {
38
+ name: 'customer',
39
+ plural: 'customers',
40
+ fields: [text('name', { required: true, fake: 'company.name' }), of('email', 'email')],
41
+ titleField: 'name',
42
+ },
43
+ ],
44
+ },
45
+ {
46
+ id: 'crm',
47
+ label: 'CRM',
48
+ keywords: [
49
+ 'crm',
50
+ 'sales',
51
+ 'deal',
52
+ 'deals',
53
+ 'lead',
54
+ 'leads',
55
+ 'pipeline',
56
+ 'prospect',
57
+ 'prospects',
58
+ 'contact',
59
+ 'contacts',
60
+ 'account',
61
+ 'accounts',
62
+ ],
63
+ entities: [
64
+ {
65
+ name: 'deal',
66
+ plural: 'deals',
67
+ fields: [
68
+ text('title', { required: true, fake: 'commerce.productName' }),
69
+ enumOf('stage', ['lead', 'qualified', 'proposal', 'won', 'lost'], {
70
+ weights: [4, 3, 2, 2, 1],
71
+ }),
72
+ of('amount', 'money', { min: 50_000, max: 5_000_000, trend: 'growth' }),
73
+ of('closeOn', 'date', { window: 'around' }),
74
+ of('company', 'relation', { to: 'company' }),
75
+ of('owner', 'persona'),
76
+ ],
77
+ titleField: 'title',
78
+ ownerField: 'owner',
79
+ },
80
+ {
81
+ name: 'company',
82
+ plural: 'companies',
83
+ fields: [
84
+ text('name', { required: true, fake: 'company.name' }),
85
+ of('website', 'url'),
86
+ enumOf('segment', ['smb', 'mid-market', 'enterprise']),
87
+ ],
88
+ titleField: 'name',
89
+ },
90
+ {
91
+ name: 'contact',
92
+ plural: 'contacts',
93
+ fields: [
94
+ text('fullName', { required: true, fake: 'person.fullName' }),
95
+ of('email', 'email'),
96
+ of('company', 'relation', { to: 'company' }),
97
+ ],
98
+ titleField: 'fullName',
99
+ },
100
+ ],
101
+ },
102
+ {
103
+ id: 'booking',
104
+ label: 'Bookings',
105
+ keywords: [
106
+ 'booking',
107
+ 'bookings',
108
+ 'appointment',
109
+ 'appointments',
110
+ 'reservation',
111
+ 'reservations',
112
+ 'salon',
113
+ 'studio',
114
+ 'slot',
115
+ 'slots',
116
+ 'book',
117
+ 'schedule',
118
+ ],
119
+ entities: [
120
+ {
121
+ name: 'appointment',
122
+ plural: 'appointments',
123
+ fields: [
124
+ text('title', { required: true, fake: 'commerce.productName' }),
125
+ enumOf('status', ['requested', 'confirmed', 'done', 'cancelled'], {
126
+ weights: [2, 5, 4, 1],
127
+ }),
128
+ of('startsAt', 'datetime', { window: 'around' }),
129
+ of('endsAt', 'datetime', { window: 'around' }),
130
+ of('price', 'money', { min: 1_000, max: 30_000 }),
131
+ of('client', 'relation', { to: 'client' }),
132
+ of('staff', 'persona'),
133
+ ],
134
+ titleField: 'title',
135
+ ownerField: 'staff',
136
+ },
137
+ {
138
+ name: 'client',
139
+ plural: 'clients',
140
+ fields: [
141
+ text('name', { required: true, fake: 'person.fullName' }),
142
+ of('email', 'email'),
143
+ of('phone', 'phone'),
144
+ ],
145
+ titleField: 'name',
146
+ },
147
+ ],
148
+ },
149
+ {
150
+ id: 'logistics',
151
+ label: 'Dispatch',
152
+ keywords: [
153
+ 'logistics',
154
+ 'shipment',
155
+ 'shipments',
156
+ 'delivery',
157
+ 'deliveries',
158
+ 'dispatch',
159
+ 'freight',
160
+ 'courier',
161
+ 'route',
162
+ 'routes',
163
+ 'warehouse',
164
+ 'truck',
165
+ 'trucks',
166
+ 'parcel',
167
+ 'parcels',
168
+ ],
169
+ entities: [
170
+ {
171
+ name: 'shipment',
172
+ plural: 'shipments',
173
+ fields: [
174
+ text('reference', { required: true, fake: 'word.words', maxLength: 40 }),
175
+ enumOf('status', ['planned', 'in-transit', 'delivered', 'delayed'], {
176
+ weights: [2, 4, 5, 1],
177
+ }),
178
+ of('departsOn', 'date', { window: 'around' }),
179
+ of('arrivesOn', 'date', { window: 'around' }),
180
+ of('destination', 'geo', { region: 'harbor-bay' }),
181
+ of('cost', 'money', { min: 2_000, max: 400_000 }),
182
+ of('driver', 'relation', { to: 'driver' }),
183
+ ],
184
+ titleField: 'reference',
185
+ },
186
+ {
187
+ name: 'driver',
188
+ plural: 'drivers',
189
+ fields: [text('name', { required: true, fake: 'person.fullName' }), of('phone', 'phone')],
190
+ titleField: 'name',
191
+ },
192
+ ],
193
+ },
194
+ {
195
+ id: 'analytics',
196
+ label: 'Analytics',
197
+ strongCues: ['analytics', 'product analytics', 'event analytics'],
198
+ kitArchetype: {
199
+ id: 'analytics',
200
+ kits: [
201
+ '@protoyard/analytics',
202
+ '@protoyard/analytics-ui/grid',
203
+ '@protoyard/analytics-ui/date-range',
204
+ ],
205
+ entities: { events: 'event', metrics: 'metric' },
206
+ screens: [{ kind: 'analytics-dashboard', path: '/analytics-dashboard' }],
207
+ scenarioDefaults: { density: 'dense', activity: 'normal' },
208
+ },
209
+ keywords: [
210
+ 'analytics',
211
+ 'product analytics',
212
+ 'event analytics',
213
+ 'event tracking',
214
+ 'metric',
215
+ 'metrics',
216
+ 'kpi',
217
+ 'kpis',
218
+ 'dashboard',
219
+ 'dashboards',
220
+ 'report',
221
+ 'reports',
222
+ 'insight',
223
+ 'insights',
224
+ 'funnel',
225
+ ],
226
+ entities: [
227
+ {
228
+ name: 'metric',
229
+ plural: 'metrics',
230
+ fields: [
231
+ text('name', { required: true, fake: 'company.buzzPhrase', maxLength: 80 }),
232
+ enumOf('category', ['acquisition', 'activation', 'retention', 'revenue']),
233
+ of('value', 'number', { min: 0, max: 1_000, trend: 'growth' }),
234
+ of('recordedOn', 'date', { window: 'past' }),
235
+ ],
236
+ titleField: 'name',
237
+ },
238
+ {
239
+ name: 'event',
240
+ plural: 'events',
241
+ fields: [
242
+ text('name', { required: true, fake: 'company.buzzPhrase', maxLength: 80 }),
243
+ enumOf('category', ['acquisition', 'activation', 'retention', 'revenue']),
244
+ of('value', 'number', { min: 0, max: 1_000, trend: 'growth' }),
245
+ of('occurredAt', 'datetime', { window: 'past' }),
246
+ ],
247
+ titleField: 'name',
248
+ },
249
+ {
250
+ name: 'report',
251
+ plural: 'reports',
252
+ fields: [
253
+ text('title', { required: true, fake: 'lorem.sentence', maxLength: 120 }),
254
+ enumOf('status', ['draft', 'review', 'published']),
255
+ of('owner', 'persona'),
256
+ ],
257
+ titleField: 'title',
258
+ ownerField: 'owner',
259
+ },
260
+ ],
261
+ },
262
+ {
263
+ id: 'assistant',
264
+ label: 'AI Assistant',
265
+ strongCues: ['ai assistant', 'assistant', 'copilot', 'chatbot'],
266
+ kitArchetype: {
267
+ id: 'assistant',
268
+ kits: ['@protoyard/ai', '@protoyard/ai-ui'],
269
+ entities: { conversations: 'conversation', messages: 'message' },
270
+ screens: [{ kind: 'assistant-workspace', path: '/assistant' }],
271
+ scenarioDefaults: { density: 'normal', activity: 'normal' },
272
+ },
273
+ keywords: [
274
+ 'ai assistant',
275
+ 'assistant',
276
+ 'copilot',
277
+ 'chatbot',
278
+ 'chat bot',
279
+ 'prompt',
280
+ 'prompts',
281
+ 'model response',
282
+ 'conversation',
283
+ 'conversations',
284
+ ],
285
+ entities: [
286
+ {
287
+ name: 'conversation',
288
+ plural: 'conversations',
289
+ fields: [
290
+ text('title', { required: true, fake: 'lorem.sentence' }),
291
+ enumOf('status', ['active', 'archived']),
292
+ of('owner', 'persona'),
293
+ ],
294
+ titleField: 'title',
295
+ ownerField: 'owner',
296
+ },
297
+ {
298
+ name: 'message',
299
+ plural: 'messages',
300
+ fields: [
301
+ text('content', { required: true, fake: 'lorem.sentence', maxLength: 200 }),
302
+ enumOf('role', ['user', 'assistant', 'tool']),
303
+ of('conversation', 'relation', { to: 'conversation', onDelete: 'cascade' }),
304
+ of('sentAt', 'datetime', { window: 'around' }),
305
+ ],
306
+ titleField: 'content',
307
+ },
308
+ ],
309
+ },
310
+ {
311
+ id: 'team-chat',
312
+ label: 'Team Chat',
313
+ strongCues: ['team chat', 'group chat', 'slack'],
314
+ kitArchetype: {
315
+ id: 'team-chat',
316
+ kits: ['@protoyard/ai', '@protoyard/ai-ui'],
317
+ entities: { rooms: 'room', messages: 'message', members: 'team-member' },
318
+ screens: [{ kind: 'team-chat', path: '/team-chat' }],
319
+ scenarioDefaults: { density: 'normal', activity: 'intense' },
320
+ },
321
+ keywords: [
322
+ 'team chat',
323
+ 'group chat',
324
+ 'chat',
325
+ 'slack',
326
+ 'channel',
327
+ 'channels',
328
+ 'messaging',
329
+ 'direct message',
330
+ 'direct messages',
331
+ 'room',
332
+ 'rooms',
333
+ ],
334
+ entities: [
335
+ {
336
+ name: 'room',
337
+ plural: 'rooms',
338
+ fields: [
339
+ text('name', { required: true, fake: 'commerce.department' }),
340
+ text('topic', { maxLength: 200 }),
341
+ enumOf('visibility', ['public', 'private']),
342
+ ],
343
+ titleField: 'name',
344
+ },
345
+ {
346
+ name: 'message',
347
+ plural: 'messages',
348
+ fields: [
349
+ text('body', { required: true, fake: 'lorem.sentence', maxLength: 200 }),
350
+ of('room', 'relation', { to: 'room', onDelete: 'cascade' }),
351
+ of('author', 'relation', { to: 'team-member' }),
352
+ of('sentAt', 'datetime', { window: 'around' }),
353
+ ],
354
+ titleField: 'body',
355
+ },
356
+ {
357
+ name: 'team-member',
358
+ plural: 'team-members',
359
+ fields: [
360
+ text('name', { required: true, fake: 'person.fullName' }),
361
+ of('email', 'email'),
362
+ enumOf('presence', ['online', 'away', 'offline']),
363
+ ],
364
+ titleField: 'name',
365
+ },
366
+ ],
367
+ },
368
+ {
369
+ id: 'saas-onboarding',
370
+ label: 'SaaS Onboarding',
371
+ strongCues: ['saas onboarding', 'product onboarding'],
372
+ kitArchetype: {
373
+ id: 'saas-onboarding',
374
+ kits: ['@protoyard/saas', '@protoyard/saas-ui'],
375
+ entities: { workspaces: 'workspace', members: 'workspace-member' },
376
+ screens: [{ kind: 'saas-onboarding', path: '/onboarding' }],
377
+ scenarioDefaults: { density: 'normal', activity: 'normal' },
378
+ },
379
+ keywords: [
380
+ 'saas onboarding',
381
+ 'product onboarding',
382
+ 'onboarding',
383
+ 'workspace',
384
+ 'workspaces',
385
+ 'invite teammates',
386
+ 'invitations',
387
+ 'free trial',
388
+ 'trial',
389
+ 'subscription',
390
+ 'activation',
391
+ 'plan upgrade',
392
+ ],
393
+ entities: [
394
+ {
395
+ name: 'workspace',
396
+ plural: 'workspaces',
397
+ fields: [
398
+ text('name', { required: true, fake: 'company.name' }),
399
+ enumOf('plan', ['free', 'trial', 'pro']),
400
+ enumOf('setupStatus', ['started', 'invited', 'complete']),
401
+ ],
402
+ titleField: 'name',
403
+ },
404
+ {
405
+ name: 'workspace-member',
406
+ plural: 'workspace-members',
407
+ fields: [
408
+ text('name', { required: true, fake: 'person.fullName' }),
409
+ of('email', 'email'),
410
+ enumOf('role', ['owner', 'admin', 'member']),
411
+ of('workspace', 'relation', { to: 'workspace' }),
412
+ enumOf('status', ['invited', 'active']),
413
+ ],
414
+ titleField: 'name',
415
+ },
416
+ ],
417
+ },
418
+ {
419
+ id: 'pm',
420
+ label: 'Projects',
421
+ keywords: [
422
+ 'project',
423
+ 'projects',
424
+ 'task',
425
+ 'tasks',
426
+ 'sprint',
427
+ 'sprints',
428
+ 'kanban',
429
+ 'roadmap',
430
+ 'milestone',
431
+ 'milestones',
432
+ 'backlog',
433
+ 'todo',
434
+ ],
435
+ entities: [
436
+ {
437
+ name: 'task',
438
+ plural: 'tasks',
439
+ fields: [
440
+ text('title', { required: true, fake: 'lorem.sentence', maxLength: 120 }),
441
+ enumOf('status', ['todo', 'doing', 'review', 'done'], { weights: [4, 3, 1, 4] }),
442
+ enumOf('priority', ['low', 'normal', 'high']),
443
+ of('startOn', 'date', { window: 'around' }),
444
+ of('dueOn', 'date', { window: 'around' }),
445
+ of('estimate', 'integer', { min: 1, max: 13 }),
446
+ of('project', 'relation', { to: 'project' }),
447
+ of('assignee', 'persona'),
448
+ ],
449
+ titleField: 'title',
450
+ ownerField: 'assignee',
451
+ },
452
+ {
453
+ name: 'project',
454
+ plural: 'projects',
455
+ fields: [
456
+ text('name', { required: true, fake: 'company.catchPhrase', maxLength: 80 }),
457
+ enumOf('status', ['active', 'paused', 'done']),
458
+ of('budget', 'money', { min: 100_000, max: 10_000_000 }),
459
+ ],
460
+ titleField: 'name',
461
+ },
462
+ ],
463
+ },
464
+ {
465
+ id: 'lms',
466
+ label: 'Academy',
467
+ keywords: [
468
+ 'course',
469
+ 'courses',
470
+ 'lesson',
471
+ 'lessons',
472
+ 'student',
473
+ 'students',
474
+ 'learning',
475
+ 'lms',
476
+ 'class',
477
+ 'classes',
478
+ 'quiz',
479
+ 'quizzes',
480
+ 'training',
481
+ 'enrollment',
482
+ 'enrollments',
483
+ 'teacher',
484
+ 'teachers',
485
+ ],
486
+ entities: [
487
+ {
488
+ name: 'enrollment',
489
+ plural: 'enrollments',
490
+ fields: [
491
+ text('student', { required: true, fake: 'person.fullName' }),
492
+ enumOf('status', ['enrolled', 'active', 'completed', 'dropped'], {
493
+ weights: [2, 5, 3, 1],
494
+ }),
495
+ of('progress', 'integer', { min: 0, max: 100, trend: 'growth' }),
496
+ of('course', 'relation', { to: 'course' }),
497
+ ],
498
+ titleField: 'student',
499
+ },
500
+ {
501
+ name: 'course',
502
+ plural: 'courses',
503
+ fields: [
504
+ text('title', { required: true, fake: 'company.buzzPhrase', maxLength: 80 }),
505
+ enumOf('level', ['beginner', 'intermediate', 'advanced']),
506
+ of('startsOn', 'date', { window: 'future' }),
507
+ of('price', 'money', { min: 0, max: 50_000 }),
508
+ of('teacher', 'persona'),
509
+ ],
510
+ titleField: 'title',
511
+ ownerField: 'teacher',
512
+ },
513
+ ],
514
+ },
515
+ {
516
+ id: 'clinic',
517
+ label: 'Clinic',
518
+ keywords: [
519
+ 'clinic',
520
+ 'patient',
521
+ 'patients',
522
+ 'doctor',
523
+ 'doctors',
524
+ 'visit',
525
+ 'visits',
526
+ 'health',
527
+ 'medical',
528
+ 'veterinary',
529
+ 'vet',
530
+ 'nurse',
531
+ 'care',
532
+ ],
533
+ entities: [
534
+ {
535
+ name: 'visit',
536
+ plural: 'visits',
537
+ fields: [
538
+ text('reason', { required: true, fake: 'lorem.sentence', maxLength: 120 }),
539
+ enumOf('status', ['scheduled', 'checked-in', 'done', 'no-show'], {
540
+ weights: [5, 1, 5, 1],
541
+ }),
542
+ of('startsAt', 'datetime', { window: 'around' }),
543
+ of('endsAt', 'datetime', { window: 'around' }),
544
+ of('patient', 'relation', { to: 'patient' }),
545
+ of('provider', 'persona'),
546
+ ],
547
+ titleField: 'reason',
548
+ ownerField: 'provider',
549
+ },
550
+ {
551
+ name: 'patient',
552
+ plural: 'patients',
553
+ fields: [
554
+ text('name', { required: true, fake: 'person.fullName' }),
555
+ of('phone', 'phone'),
556
+ of('email', 'email'),
557
+ ],
558
+ titleField: 'name',
559
+ },
560
+ ],
561
+ },
562
+ {
563
+ id: 'fintech',
564
+ label: 'Finance',
565
+ keywords: [
566
+ 'finance',
567
+ 'budget',
568
+ 'budgets',
569
+ 'expense',
570
+ 'expenses',
571
+ 'payment',
572
+ 'payments',
573
+ 'transaction',
574
+ 'transactions',
575
+ 'bank',
576
+ 'wallet',
577
+ 'spending',
578
+ 'cash',
579
+ 'accounting',
580
+ ],
581
+ entities: [
582
+ {
583
+ name: 'transaction',
584
+ plural: 'transactions',
585
+ fields: [
586
+ text('description', { required: true, fake: 'commerce.productName' }),
587
+ enumOf('category', ['income', 'rent', 'payroll', 'software', 'travel', 'other']),
588
+ of('amount', 'money', { min: 500, max: 2_000_000, trend: 'seasonal' }),
589
+ of('bookedOn', 'date', { window: 'past' }),
590
+ of('account', 'relation', { to: 'account' }),
591
+ ],
592
+ titleField: 'description',
593
+ },
594
+ {
595
+ name: 'account',
596
+ plural: 'accounts',
597
+ fields: [
598
+ text('name', { required: true, fake: 'company.name' }),
599
+ enumOf('type', ['checking', 'savings', 'card']),
600
+ of('balance', 'money', { min: 0, max: 50_000_000 }),
601
+ ],
602
+ titleField: 'name',
603
+ },
604
+ ],
605
+ },
606
+ {
607
+ id: 'wiki',
608
+ label: 'Docs',
609
+ keywords: [
610
+ 'wiki',
611
+ 'docs',
612
+ 'documentation',
613
+ 'knowledge',
614
+ 'article',
615
+ 'articles',
616
+ 'page',
617
+ 'pages',
618
+ 'handbook',
619
+ 'notes',
620
+ 'guide',
621
+ 'guides',
622
+ ],
623
+ entities: [
624
+ {
625
+ name: 'page',
626
+ plural: 'pages',
627
+ fields: [
628
+ text('title', { required: true, fake: 'lorem.sentence', maxLength: 120 }),
629
+ enumOf('status', ['draft', 'review', 'published'], { weights: [2, 1, 5] }),
630
+ of('body', 'longText', { fake: 'lorem.paragraph' }),
631
+ of('space', 'relation', { to: 'space' }),
632
+ of('author', 'persona'),
633
+ ],
634
+ titleField: 'title',
635
+ ownerField: 'author',
636
+ },
637
+ {
638
+ name: 'space',
639
+ plural: 'spaces',
640
+ fields: [text('name', { required: true, fake: 'commerce.department' })],
641
+ titleField: 'name',
642
+ },
643
+ ],
644
+ },
645
+ {
646
+ id: 'iot',
647
+ label: 'Monitor',
648
+ keywords: [
649
+ 'iot',
650
+ 'device',
651
+ 'devices',
652
+ 'sensor',
653
+ 'sensors',
654
+ 'telemetry',
655
+ 'monitoring',
656
+ 'alert',
657
+ 'alerts',
658
+ 'uptime',
659
+ 'firmware',
660
+ ],
661
+ entities: [
662
+ {
663
+ name: 'device',
664
+ plural: 'devices',
665
+ fields: [
666
+ text('name', { required: true, fake: 'word.words', maxLength: 60 }),
667
+ enumOf('status', ['online', 'degraded', 'offline'], { weights: [8, 2, 1] }),
668
+ of('location', 'geo', { region: 'metro-grid' }),
669
+ of('battery', 'integer', { min: 0, max: 100, trend: 'decline' }),
670
+ of('lastSeenAt', 'datetime', { window: 'past' }),
671
+ ],
672
+ titleField: 'name',
673
+ },
674
+ {
675
+ name: 'alert',
676
+ plural: 'alerts',
677
+ fields: [
678
+ text('title', { required: true, fake: 'lorem.sentence', maxLength: 120 }),
679
+ enumOf('severity', ['info', 'warning', 'critical'], { weights: [5, 3, 1] }),
680
+ enumOf('status', ['open', 'acknowledged', 'resolved']),
681
+ of('device', 'relation', { to: 'device' }),
682
+ ],
683
+ titleField: 'title',
684
+ },
685
+ ],
686
+ },
687
+ {
688
+ id: 'social',
689
+ label: 'Social',
690
+ keywords: [
691
+ 'social',
692
+ 'feed',
693
+ 'post',
694
+ 'posts',
695
+ 'follower',
696
+ 'followers',
697
+ 'community',
698
+ 'comment',
699
+ 'comments',
700
+ 'like',
701
+ 'likes',
702
+ 'creator',
703
+ 'creators',
704
+ ],
705
+ entities: [
706
+ {
707
+ name: 'post',
708
+ plural: 'posts',
709
+ fields: [
710
+ text('caption', { required: true, fake: 'lorem.sentence', maxLength: 140 }),
711
+ enumOf('status', ['draft', 'published', 'flagged'], { weights: [1, 8, 1] }),
712
+ of('likes', 'integer', { min: 0, max: 5_000, trend: 'growth' }),
713
+ of('publishedAt', 'datetime', { window: 'past' }),
714
+ of('author', 'persona'),
715
+ ],
716
+ titleField: 'caption',
717
+ ownerField: 'author',
718
+ },
719
+ {
720
+ name: 'comment',
721
+ plural: 'comments',
722
+ fields: [
723
+ text('body', { required: true, fake: 'lorem.sentence', maxLength: 140 }),
724
+ of('post', 'relation', { to: 'post', onDelete: 'cascade' }),
725
+ ],
726
+ titleField: 'body',
727
+ },
728
+ ],
729
+ },
730
+ {
731
+ id: 'marketplace',
732
+ label: 'Market',
733
+ keywords: [
734
+ 'marketplace',
735
+ 'listing',
736
+ 'listings',
737
+ 'seller',
738
+ 'sellers',
739
+ 'buyer',
740
+ 'buyers',
741
+ 'order',
742
+ 'orders',
743
+ 'product',
744
+ 'products',
745
+ 'shop',
746
+ 'store',
747
+ 'ecommerce',
748
+ 'catalog',
749
+ ],
750
+ entities: [
751
+ {
752
+ name: 'order',
753
+ plural: 'orders',
754
+ fields: [
755
+ text('reference', { required: true, fake: 'word.words', maxLength: 40 }),
756
+ enumOf('status', ['placed', 'paid', 'shipped', 'delivered'], { weights: [2, 3, 3, 5] }),
757
+ of('total', 'money', { min: 500, max: 500_000, trend: 'growth' }),
758
+ of('placedOn', 'date', { window: 'past' }),
759
+ of('listing', 'relation', { to: 'listing' }),
760
+ ],
761
+ titleField: 'reference',
762
+ },
763
+ {
764
+ name: 'listing',
765
+ plural: 'listings',
766
+ fields: [
767
+ text('title', { required: true, fake: 'commerce.productName' }),
768
+ enumOf('category', ['home', 'outdoors', 'electronics', 'books']),
769
+ of('price', 'money', { min: 500, max: 200_000 }),
770
+ of('seller', 'persona'),
771
+ ],
772
+ titleField: 'title',
773
+ ownerField: 'seller',
774
+ },
775
+ ],
776
+ },
777
+ ];
778
+ /** Used when no keyword matches: a plain tracker the extracted nouns extend. */
779
+ export const GENERIC_ARCHETYPE = {
780
+ id: 'tracker',
781
+ label: 'Tracker',
782
+ keywords: [],
783
+ entities: [
784
+ {
785
+ name: 'item',
786
+ plural: 'items',
787
+ fields: [
788
+ text('name', { required: true, fake: 'commerce.productName' }),
789
+ enumOf('status', ['new', 'active', 'done']),
790
+ of('dueOn', 'date', { window: 'around' }),
791
+ of('owner', 'persona'),
792
+ ],
793
+ titleField: 'name',
794
+ ownerField: 'owner',
795
+ },
796
+ ],
797
+ };
798
+ export const ARCHETYPE_IDS = [...ARCHETYPES.map((a) => a.id), GENERIC_ARCHETYPE.id];