@murphai/contracts 0.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 (89) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +24 -0
  3. package/dist/bank-entities.d.ts +35 -0
  4. package/dist/bank-entities.d.ts.map +1 -0
  5. package/dist/bank-entities.js +164 -0
  6. package/dist/bank-entities.js.map +1 -0
  7. package/dist/command-capabilities.d.ts +50 -0
  8. package/dist/command-capabilities.d.ts.map +1 -0
  9. package/dist/command-capabilities.js +149 -0
  10. package/dist/command-capabilities.js.map +1 -0
  11. package/dist/constants.d.ts +149 -0
  12. package/dist/constants.d.ts.map +1 -0
  13. package/dist/constants.js +232 -0
  14. package/dist/constants.js.map +1 -0
  15. package/dist/examples.d.ts +31 -0
  16. package/dist/examples.d.ts.map +1 -0
  17. package/dist/examples.js +943 -0
  18. package/dist/examples.js.map +1 -0
  19. package/dist/frontmatter.d.ts +28 -0
  20. package/dist/frontmatter.d.ts.map +1 -0
  21. package/dist/frontmatter.js +272 -0
  22. package/dist/frontmatter.js.map +1 -0
  23. package/dist/health-entities.d.ts +87 -0
  24. package/dist/health-entities.d.ts.map +1 -0
  25. package/dist/health-entities.js +349 -0
  26. package/dist/health-entities.js.map +1 -0
  27. package/dist/ids.d.ts +10 -0
  28. package/dist/ids.d.ts.map +1 -0
  29. package/dist/ids.js +27 -0
  30. package/dist/ids.js.map +1 -0
  31. package/dist/index.d.ts +16 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +16 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/registry-helpers.d.ts +31 -0
  36. package/dist/registry-helpers.d.ts.map +1 -0
  37. package/dist/registry-helpers.js +53 -0
  38. package/dist/registry-helpers.js.map +1 -0
  39. package/dist/schemas.d.ts +47 -0
  40. package/dist/schemas.d.ts.map +1 -0
  41. package/dist/schemas.js +50 -0
  42. package/dist/schemas.js.map +1 -0
  43. package/dist/scripts/generate-json-schema.js +13 -0
  44. package/dist/scripts/generate-json-schema.js.map +1 -0
  45. package/dist/scripts/verify.js +230 -0
  46. package/dist/scripts/verify.js.map +1 -0
  47. package/dist/shares.d.ts +715 -0
  48. package/dist/shares.d.ts.map +1 -0
  49. package/dist/shares.js +469 -0
  50. package/dist/shares.js.map +1 -0
  51. package/dist/time.d.ts +25 -0
  52. package/dist/time.d.ts.map +1 -0
  53. package/dist/time.js +241 -0
  54. package/dist/time.js.map +1 -0
  55. package/dist/tsconfig.build.tsbuildinfo +1 -0
  56. package/dist/types.d.ts +34 -0
  57. package/dist/types.d.ts.map +1 -0
  58. package/dist/types.js +2 -0
  59. package/dist/types.js.map +1 -0
  60. package/dist/validate.d.ts +18 -0
  61. package/dist/validate.d.ts.map +1 -0
  62. package/dist/validate.js +129 -0
  63. package/dist/validate.js.map +1 -0
  64. package/dist/zod.d.ts +1626 -0
  65. package/dist/zod.d.ts.map +1 -0
  66. package/dist/zod.js +834 -0
  67. package/dist/zod.js.map +1 -0
  68. package/generated/assessment-response.schema.json +101 -0
  69. package/generated/audit-record.schema.json +141 -0
  70. package/generated/event-record.schema.json +2708 -0
  71. package/generated/frontmatter-allergy.schema.json +82 -0
  72. package/generated/frontmatter-condition.schema.json +101 -0
  73. package/generated/frontmatter-core.schema.json +51 -0
  74. package/generated/frontmatter-experiment.schema.json +70 -0
  75. package/generated/frontmatter-family-member.schema.json +68 -0
  76. package/generated/frontmatter-food.schema.json +128 -0
  77. package/generated/frontmatter-genetic-variant.schema.json +81 -0
  78. package/generated/frontmatter-goal.schema.json +116 -0
  79. package/generated/frontmatter-journal-day.schema.json +52 -0
  80. package/generated/frontmatter-profile-current.schema.json +55 -0
  81. package/generated/frontmatter-protocol.schema.json +153 -0
  82. package/generated/frontmatter-provider.schema.json +81 -0
  83. package/generated/frontmatter-recipe.schema.json +124 -0
  84. package/generated/frontmatter-workout-format.schema.json +163 -0
  85. package/generated/inbox-capture-record.schema.json +332 -0
  86. package/generated/profile-snapshot.schema.json +131 -0
  87. package/generated/sample-record.schema.json +726 -0
  88. package/generated/vault-metadata.schema.json +324 -0
  89. package/package.json +69 -0
@@ -0,0 +1,324 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "schemaVersion": {
6
+ "type": "string",
7
+ "const": "murph.vault.v1"
8
+ },
9
+ "vaultId": {
10
+ "type": "string",
11
+ "pattern": "^vault_[0-9A-HJKMNP-TV-Z]{26}$"
12
+ },
13
+ "createdAt": {
14
+ "type": "string",
15
+ "format": "date-time"
16
+ },
17
+ "title": {
18
+ "type": "string",
19
+ "minLength": 1,
20
+ "maxLength": 120
21
+ },
22
+ "timezone": {
23
+ "type": "string",
24
+ "minLength": 3,
25
+ "maxLength": 64
26
+ },
27
+ "idPolicy": {
28
+ "type": "object",
29
+ "properties": {
30
+ "format": {
31
+ "type": "string",
32
+ "const": "prefix_ulid"
33
+ },
34
+ "prefixes": {
35
+ "type": "object",
36
+ "properties": {
37
+ "allergy": {
38
+ "type": "string",
39
+ "const": "alg"
40
+ },
41
+ "assessment": {
42
+ "type": "string",
43
+ "const": "asmt"
44
+ },
45
+ "audit": {
46
+ "type": "string",
47
+ "const": "aud"
48
+ },
49
+ "condition": {
50
+ "type": "string",
51
+ "const": "cond"
52
+ },
53
+ "document": {
54
+ "type": "string",
55
+ "const": "doc"
56
+ },
57
+ "event": {
58
+ "type": "string",
59
+ "const": "evt"
60
+ },
61
+ "experiment": {
62
+ "type": "string",
63
+ "const": "exp"
64
+ },
65
+ "family": {
66
+ "type": "string",
67
+ "const": "fam"
68
+ },
69
+ "food": {
70
+ "type": "string",
71
+ "const": "food"
72
+ },
73
+ "goal": {
74
+ "type": "string",
75
+ "const": "goal"
76
+ },
77
+ "meal": {
78
+ "type": "string",
79
+ "const": "meal"
80
+ },
81
+ "pack": {
82
+ "type": "string",
83
+ "const": "pack"
84
+ },
85
+ "profileSnapshot": {
86
+ "type": "string",
87
+ "const": "psnap"
88
+ },
89
+ "provider": {
90
+ "type": "string",
91
+ "const": "prov"
92
+ },
93
+ "recipe": {
94
+ "type": "string",
95
+ "const": "rcp"
96
+ },
97
+ "protocol": {
98
+ "type": "string",
99
+ "const": "prot"
100
+ },
101
+ "sample": {
102
+ "type": "string",
103
+ "const": "smp"
104
+ },
105
+ "transform": {
106
+ "type": "string",
107
+ "const": "xfm"
108
+ },
109
+ "variant": {
110
+ "type": "string",
111
+ "const": "var"
112
+ },
113
+ "vault": {
114
+ "type": "string",
115
+ "const": "vault"
116
+ },
117
+ "workoutFormat": {
118
+ "type": "string",
119
+ "const": "wfmt"
120
+ }
121
+ },
122
+ "required": [
123
+ "allergy",
124
+ "assessment",
125
+ "audit",
126
+ "condition",
127
+ "document",
128
+ "event",
129
+ "experiment",
130
+ "family",
131
+ "food",
132
+ "goal",
133
+ "meal",
134
+ "pack",
135
+ "profileSnapshot",
136
+ "provider",
137
+ "recipe",
138
+ "protocol",
139
+ "sample",
140
+ "transform",
141
+ "variant",
142
+ "vault",
143
+ "workoutFormat"
144
+ ],
145
+ "additionalProperties": false
146
+ }
147
+ },
148
+ "required": [
149
+ "format",
150
+ "prefixes"
151
+ ],
152
+ "additionalProperties": false
153
+ },
154
+ "paths": {
155
+ "type": "object",
156
+ "properties": {
157
+ "allergiesRoot": {
158
+ "type": "string",
159
+ "const": "bank/allergies"
160
+ },
161
+ "assessmentLedgerRoot": {
162
+ "type": "string",
163
+ "const": "ledger/assessments"
164
+ },
165
+ "conditionsRoot": {
166
+ "type": "string",
167
+ "const": "bank/conditions"
168
+ },
169
+ "coreDocument": {
170
+ "type": "string",
171
+ "const": "CORE.md"
172
+ },
173
+ "familyRoot": {
174
+ "type": "string",
175
+ "const": "bank/family"
176
+ },
177
+ "foodsRoot": {
178
+ "type": "string",
179
+ "const": "bank/foods"
180
+ },
181
+ "geneticsRoot": {
182
+ "type": "string",
183
+ "const": "bank/genetics"
184
+ },
185
+ "goalsRoot": {
186
+ "type": "string",
187
+ "const": "bank/goals"
188
+ },
189
+ "journalRoot": {
190
+ "type": "string",
191
+ "const": "journal"
192
+ },
193
+ "experimentsRoot": {
194
+ "type": "string",
195
+ "const": "bank/experiments"
196
+ },
197
+ "profileCurrentDocument": {
198
+ "type": "string",
199
+ "const": "bank/profile/current.md"
200
+ },
201
+ "profileRoot": {
202
+ "type": "string",
203
+ "const": "bank/profile"
204
+ },
205
+ "profileSnapshotsRoot": {
206
+ "type": "string",
207
+ "const": "ledger/profile-snapshots"
208
+ },
209
+ "providersRoot": {
210
+ "type": "string",
211
+ "const": "bank/providers"
212
+ },
213
+ "recipesRoot": {
214
+ "type": "string",
215
+ "const": "bank/recipes"
216
+ },
217
+ "workoutFormatsRoot": {
218
+ "type": "string",
219
+ "const": "bank/workout-formats"
220
+ },
221
+ "rawAssessmentsRoot": {
222
+ "type": "string",
223
+ "const": "raw/assessments"
224
+ },
225
+ "rawRoot": {
226
+ "type": "string",
227
+ "const": "raw"
228
+ },
229
+ "eventsRoot": {
230
+ "type": "string",
231
+ "const": "ledger/events"
232
+ },
233
+ "protocolsRoot": {
234
+ "type": "string",
235
+ "const": "bank/protocols"
236
+ },
237
+ "samplesRoot": {
238
+ "type": "string",
239
+ "const": "ledger/samples"
240
+ },
241
+ "auditRoot": {
242
+ "type": "string",
243
+ "const": "audit"
244
+ },
245
+ "exportsRoot": {
246
+ "type": "string",
247
+ "const": "exports"
248
+ }
249
+ },
250
+ "required": [
251
+ "allergiesRoot",
252
+ "assessmentLedgerRoot",
253
+ "conditionsRoot",
254
+ "coreDocument",
255
+ "familyRoot",
256
+ "foodsRoot",
257
+ "geneticsRoot",
258
+ "goalsRoot",
259
+ "journalRoot",
260
+ "experimentsRoot",
261
+ "profileCurrentDocument",
262
+ "profileRoot",
263
+ "profileSnapshotsRoot",
264
+ "providersRoot",
265
+ "recipesRoot",
266
+ "workoutFormatsRoot",
267
+ "rawAssessmentsRoot",
268
+ "rawRoot",
269
+ "eventsRoot",
270
+ "protocolsRoot",
271
+ "samplesRoot",
272
+ "auditRoot",
273
+ "exportsRoot"
274
+ ],
275
+ "additionalProperties": false
276
+ },
277
+ "shards": {
278
+ "type": "object",
279
+ "properties": {
280
+ "assessments": {
281
+ "type": "string",
282
+ "const": "ledger/assessments/YYYY/YYYY-MM.jsonl"
283
+ },
284
+ "events": {
285
+ "type": "string",
286
+ "const": "ledger/events/YYYY/YYYY-MM.jsonl"
287
+ },
288
+ "profileSnapshots": {
289
+ "type": "string",
290
+ "const": "ledger/profile-snapshots/YYYY/YYYY-MM.jsonl"
291
+ },
292
+ "samples": {
293
+ "type": "string",
294
+ "const": "ledger/samples/<stream>/YYYY/YYYY-MM.jsonl"
295
+ },
296
+ "audit": {
297
+ "type": "string",
298
+ "const": "audit/YYYY/YYYY-MM.jsonl"
299
+ }
300
+ },
301
+ "required": [
302
+ "assessments",
303
+ "events",
304
+ "profileSnapshots",
305
+ "samples",
306
+ "audit"
307
+ ],
308
+ "additionalProperties": false
309
+ }
310
+ },
311
+ "required": [
312
+ "schemaVersion",
313
+ "vaultId",
314
+ "createdAt",
315
+ "title",
316
+ "timezone",
317
+ "idPolicy",
318
+ "paths",
319
+ "shards"
320
+ ],
321
+ "additionalProperties": false,
322
+ "$id": "@murphai/contracts/vault-metadata.schema.json",
323
+ "title": "Murph Vault Metadata"
324
+ }
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@murphai/contracts",
3
+ "version": "0.1.1",
4
+ "private": false,
5
+ "type": "module",
6
+ "license": "GPL-3.0-only",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/cobuildwithus/murph"
13
+ },
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "files": [
17
+ "README.md",
18
+ "generated",
19
+ "dist"
20
+ ],
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js",
25
+ "default": "./dist/index.js"
26
+ },
27
+ "./constants": {
28
+ "types": "./dist/constants.d.ts",
29
+ "import": "./dist/constants.js",
30
+ "default": "./dist/constants.js"
31
+ },
32
+ "./examples": {
33
+ "types": "./dist/examples.d.ts",
34
+ "import": "./dist/examples.js",
35
+ "default": "./dist/examples.js"
36
+ },
37
+ "./health-entities": {
38
+ "types": "./dist/health-entities.d.ts",
39
+ "import": "./dist/health-entities.js",
40
+ "default": "./dist/health-entities.js"
41
+ },
42
+ "./ids": {
43
+ "types": "./dist/ids.d.ts",
44
+ "import": "./dist/ids.js",
45
+ "default": "./dist/ids.js"
46
+ },
47
+ "./schemas": {
48
+ "types": "./dist/schemas.d.ts",
49
+ "import": "./dist/schemas.js",
50
+ "default": "./dist/schemas.js"
51
+ },
52
+ "./validate": {
53
+ "types": "./dist/validate.d.ts",
54
+ "import": "./dist/validate.js",
55
+ "default": "./dist/validate.js"
56
+ },
57
+ "./generated/*": "./generated/*"
58
+ },
59
+ "dependencies": {
60
+ "zod": "^4.3.6"
61
+ },
62
+ "scripts": {
63
+ "build": "node ../../scripts/rm-paths.mjs dist && tsc -b tsconfig.build.json --force --pretty false && tsc -p tsconfig.scripts.json --pretty false",
64
+ "typecheck": "tsc -p tsconfig.json --pretty false",
65
+ "generate": "pnpm build && node ./dist/scripts/generate-json-schema.js",
66
+ "test": "pnpm build && node ./dist/scripts/verify.js",
67
+ "verify": "pnpm test"
68
+ }
69
+ }