@ottolab/shared 0.1.0 → 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 (58) hide show
  1. package/dist/constants/biomarker-ranges.d.ts +20 -0
  2. package/dist/constants/biomarker-ranges.d.ts.map +1 -0
  3. package/dist/constants/biomarker-ranges.js +311 -0
  4. package/dist/constants/biomarker-ranges.js.map +1 -0
  5. package/dist/constants/drug-data.d.ts +5 -0
  6. package/dist/constants/drug-data.d.ts.map +1 -0
  7. package/dist/constants/drug-data.js +3 -0
  8. package/dist/constants/drug-data.js.map +1 -0
  9. package/dist/constants/unit-conversions.d.ts +6 -0
  10. package/dist/constants/unit-conversions.d.ts.map +1 -0
  11. package/dist/constants/unit-conversions.js +15 -0
  12. package/dist/constants/unit-conversions.js.map +1 -0
  13. package/dist/index.d.ts +12 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +5 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/types/biomarkers.d.ts +54 -0
  18. package/dist/types/biomarkers.d.ts.map +1 -0
  19. package/dist/types/biomarkers.js +2 -0
  20. package/dist/types/biomarkers.js.map +1 -0
  21. package/dist/types/lab-report.d.ts +48 -0
  22. package/dist/types/lab-report.d.ts.map +1 -0
  23. package/dist/types/lab-report.js +2 -0
  24. package/dist/types/lab-report.js.map +1 -0
  25. package/dist/types/llm.d.ts +46 -0
  26. package/dist/types/llm.d.ts.map +1 -0
  27. package/dist/types/llm.js +2 -0
  28. package/dist/types/llm.js.map +1 -0
  29. package/dist/types/messaging.d.ts +45 -0
  30. package/dist/types/messaging.d.ts.map +1 -0
  31. package/dist/types/messaging.js +2 -0
  32. package/dist/types/messaging.js.map +1 -0
  33. package/dist/types/recommendation.d.ts +33 -0
  34. package/dist/types/recommendation.d.ts.map +1 -0
  35. package/dist/types/recommendation.js +2 -0
  36. package/dist/types/recommendation.js.map +1 -0
  37. package/dist/types/simulation.d.ts +49 -0
  38. package/dist/types/simulation.d.ts.map +1 -0
  39. package/dist/types/simulation.js +2 -0
  40. package/dist/types/simulation.js.map +1 -0
  41. package/dist/types/user.d.ts +21 -0
  42. package/dist/types/user.d.ts.map +1 -0
  43. package/dist/types/user.js +2 -0
  44. package/dist/types/user.js.map +1 -0
  45. package/package.json +8 -2
  46. package/src/constants/biomarker-ranges.ts +0 -330
  47. package/src/constants/drug-data.ts +0 -2
  48. package/src/constants/unit-conversions.ts +0 -17
  49. package/src/index.ts +0 -52
  50. package/src/types/biomarkers.ts +0 -68
  51. package/src/types/lab-report.ts +0 -54
  52. package/src/types/llm.ts +0 -50
  53. package/src/types/messaging.ts +0 -40
  54. package/src/types/recommendation.ts +0 -42
  55. package/src/types/simulation.ts +0 -62
  56. package/src/types/user.ts +0 -23
  57. package/tsconfig.json +0 -9
  58. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/types/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1C,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACvC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,IAAI,CAAC;IAChB,aAAa,EAAE,IAAI,CAAC;IACpB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,IAAI,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=messaging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/types/messaging.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ export type ProtocolCategory = 'medication' | 'supplement' | 'diet' | 'exercise' | 'lifestyle' | 'monitoring';
2
+ export type EvidenceLevel = 'A' | 'B' | 'C' | 'D' | 'expert_opinion';
3
+ export interface Protocol {
4
+ id: string;
5
+ name: string;
6
+ category: ProtocolCategory;
7
+ description: string;
8
+ dosage?: string;
9
+ frequency?: string;
10
+ duration?: string;
11
+ evidenceLevel: EvidenceLevel;
12
+ guidelineSource: string;
13
+ targetBiomarkers: string[];
14
+ }
15
+ export interface EvidenceReference {
16
+ pmid?: string;
17
+ doi?: string;
18
+ title: string;
19
+ authors: string;
20
+ journal: string;
21
+ year: number;
22
+ summary: string;
23
+ }
24
+ export interface Recommendation {
25
+ id: string;
26
+ labReportId: string;
27
+ userId: string;
28
+ protocols: Protocol[];
29
+ simulationSummary: Record<string, unknown> | null;
30
+ evidenceRefs: EvidenceReference[];
31
+ createdAt: Date;
32
+ }
33
+ //# sourceMappingURL=recommendation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommendation.d.ts","sourceRoot":"","sources":["../../src/types/recommendation.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GACxB,YAAY,GACZ,YAAY,GACZ,MAAM,GACN,UAAU,GACV,WAAW,GACX,YAAY,CAAC;AAEjB,MAAM,MAAM,aAAa,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,gBAAgB,CAAC;AAErE,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAClD,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,SAAS,EAAE,IAAI,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=recommendation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommendation.js","sourceRoot":"","sources":["../../src/types/recommendation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,49 @@
1
+ import type { BiomarkerSet } from './biomarkers.js';
2
+ export interface SimulationInput {
3
+ biomarkers: BiomarkerSet;
4
+ protocols: string[];
5
+ durationDays?: number;
6
+ gender?: 'm' | 'f';
7
+ age?: number;
8
+ }
9
+ export interface DailySnapshot {
10
+ day: number;
11
+ weight?: number;
12
+ fatMass?: number;
13
+ leanMass?: number;
14
+ ldlC?: number;
15
+ hdl?: number;
16
+ triglycerides?: number;
17
+ apoB?: number;
18
+ hba1c?: number;
19
+ fastingGlucose?: number;
20
+ fastingInsulin?: number;
21
+ homaIr?: number;
22
+ hsCrp?: number;
23
+ testosterone?: number;
24
+ cortisol?: number;
25
+ uricAcid?: number;
26
+ }
27
+ export interface ModuleSummary {
28
+ [key: string]: number | string | boolean | null | undefined;
29
+ }
30
+ export interface ModuleResult {
31
+ id: string;
32
+ name: string;
33
+ summary: ModuleSummary;
34
+ finalValues: Record<string, number>;
35
+ }
36
+ export interface BiomarkerDelta {
37
+ start: number;
38
+ end: number;
39
+ change: number;
40
+ changePercent: number;
41
+ }
42
+ export interface SimulationResult {
43
+ timeline: DailySnapshot[];
44
+ moduleResults: ModuleResult[];
45
+ biomarkerDeltas: Record<string, BiomarkerDelta>;
46
+ durationDays: number;
47
+ activeModules: string[];
48
+ }
49
+ //# sourceMappingURL=simulation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simulation.d.ts","sourceRoot":"","sources":["../../src/types/simulation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,YAAY,CAAC;IACzB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAID,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CAC7D;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAID,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=simulation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simulation.js","sourceRoot":"","sources":["../../src/types/simulation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ export type UserStatus = 'active' | 'suspended' | 'deleted';
2
+ export type Channel = 'whatsapp' | 'telegram' | 'line' | 'sms' | 'app';
3
+ export interface User {
4
+ id: string;
5
+ createdAt: Date;
6
+ updatedAt: Date;
7
+ status: UserStatus;
8
+ displayName: string | null;
9
+ timezone: string;
10
+ onboardedAt: Date | null;
11
+ }
12
+ export interface ChannelIdentity {
13
+ id: string;
14
+ userId: string;
15
+ channel: Channel;
16
+ channelUserId: string;
17
+ isPrimary: boolean;
18
+ linkedAt: Date;
19
+ metadata: Record<string, unknown>;
20
+ }
21
+ //# sourceMappingURL=user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAEvE,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,UAAU,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,IAAI,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@ottolab/shared",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "license": "MIT",
5
5
  "repository": "https://github.com/hokev/Otto",
6
- "publishConfig": { "access": "public" },
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
7
9
  "type": "module",
10
+ "files": [
11
+ "dist"
12
+ ],
8
13
  "exports": {
9
14
  ".": {
10
15
  "import": {
@@ -16,6 +21,7 @@
16
21
  },
17
22
  "scripts": {
18
23
  "build": "tsc --build",
24
+ "prepublishOnly": "npm run build",
19
25
  "lint": "eslint src/",
20
26
  "test": "echo 'No tests yet'"
21
27
  }
@@ -1,330 +0,0 @@
1
- export interface BiomarkerRange {
2
- low: number;
3
- high: number;
4
- unit: string;
5
- criticalLow?: number;
6
- criticalHigh?: number;
7
- optimalLow?: number;
8
- optimalHigh?: number;
9
- lowerIsBetter?: boolean;
10
- bidirectional?: boolean;
11
- }
12
-
13
- /**
14
- * Clinical reference ranges for all target biomarkers.
15
- * Sources: AHA/ACC, ADA, AACE, KDIGO guidelines + prototype report thresholds.
16
- *
17
- * Convention: "low"/"high" = normal range. "optimalLow"/"optimalHigh" = tighter optimal range.
18
- * "criticalLow"/"criticalHigh" = red-flag values requiring immediate attention.
19
- */
20
- export const BIOMARKER_RANGES: Record<string, BiomarkerRange> = {
21
- // ── Lipids (mg/dL) ───────────────────────────────────────
22
- total_cholesterol: {
23
- low: 125,
24
- high: 200,
25
- unit: 'mg/dL',
26
- optimalHigh: 200,
27
- criticalHigh: 240,
28
- lowerIsBetter: true,
29
- },
30
- ldl_c: {
31
- low: 0,
32
- high: 100,
33
- unit: 'mg/dL',
34
- optimalHigh: 100,
35
- criticalHigh: 160,
36
- lowerIsBetter: true,
37
- },
38
- hdl: {
39
- low: 40,
40
- high: 100,
41
- unit: 'mg/dL',
42
- optimalLow: 60,
43
- criticalLow: 40,
44
- },
45
- triglycerides: {
46
- low: 0,
47
- high: 150,
48
- unit: 'mg/dL',
49
- optimalHigh: 100,
50
- criticalHigh: 500,
51
- lowerIsBetter: true,
52
- },
53
- apoB: {
54
- low: 0,
55
- high: 90,
56
- unit: 'mg/dL',
57
- optimalHigh: 80,
58
- criticalHigh: 120,
59
- lowerIsBetter: true,
60
- },
61
-
62
- // ── Metabolic ─────────────────────────────────────────────
63
- hba1c: {
64
- low: 4.0,
65
- high: 5.7,
66
- unit: '%',
67
- optimalHigh: 5.4,
68
- criticalHigh: 6.5,
69
- lowerIsBetter: true,
70
- },
71
- fasting_glucose: {
72
- low: 65,
73
- high: 100,
74
- unit: 'mg/dL',
75
- optimalLow: 65,
76
- optimalHigh: 90,
77
- criticalHigh: 126,
78
- lowerIsBetter: true,
79
- },
80
- fasting_insulin: {
81
- low: 2,
82
- high: 25,
83
- unit: 'uIU/mL',
84
- optimalHigh: 6,
85
- criticalHigh: 25,
86
- lowerIsBetter: true,
87
- },
88
- homa_ir: {
89
- low: 0,
90
- high: 1.0,
91
- unit: '',
92
- criticalHigh: 2.5,
93
- lowerIsBetter: true,
94
- },
95
- uric_acid: {
96
- low: 2.5,
97
- high: 7.0,
98
- unit: 'mg/dL',
99
- optimalHigh: 5.0,
100
- criticalHigh: 9.0,
101
- lowerIsBetter: true,
102
- },
103
-
104
- // ── Kidney ────────────────────────────────────────────────
105
- creatinine: {
106
- low: 0.5,
107
- high: 1.1,
108
- unit: 'mg/dL',
109
- criticalHigh: 1.3,
110
- lowerIsBetter: true,
111
- },
112
- bun: {
113
- low: 7,
114
- high: 20,
115
- unit: 'mg/dL',
116
- criticalHigh: 30,
117
- lowerIsBetter: true,
118
- },
119
- egfr: {
120
- low: 90,
121
- high: 120,
122
- unit: 'mL/min/1.73m2',
123
- criticalLow: 60,
124
- },
125
-
126
- // ── Liver ─────────────────────────────────────────────────
127
- alt: {
128
- low: 7,
129
- high: 35,
130
- unit: 'U/L',
131
- optimalHigh: 30,
132
- criticalHigh: 50,
133
- lowerIsBetter: true,
134
- },
135
- ast: {
136
- low: 10,
137
- high: 35,
138
- unit: 'U/L',
139
- optimalHigh: 30,
140
- criticalHigh: 50,
141
- lowerIsBetter: true,
142
- },
143
- alp: {
144
- low: 44,
145
- high: 147,
146
- unit: 'U/L',
147
- criticalHigh: 200,
148
- },
149
- ggt: {
150
- low: 9,
151
- high: 48,
152
- unit: 'U/L',
153
- criticalHigh: 80,
154
- lowerIsBetter: true,
155
- },
156
- bilirubin_total: {
157
- low: 0.1,
158
- high: 1.2,
159
- unit: 'mg/dL',
160
- criticalHigh: 2.0,
161
- },
162
- albumin: {
163
- low: 3.5,
164
- high: 5.5,
165
- unit: 'g/dL',
166
- criticalLow: 3.0,
167
- },
168
-
169
- // ── Inflammatory ──────────────────────────────────────────
170
- hs_crp: {
171
- low: 0,
172
- high: 1.0,
173
- unit: 'mg/L',
174
- optimalHigh: 1.0,
175
- criticalHigh: 3.0,
176
- lowerIsBetter: true,
177
- },
178
- esr: {
179
- low: 0,
180
- high: 20,
181
- unit: 'mm/hr',
182
- criticalHigh: 40,
183
- lowerIsBetter: true,
184
- },
185
-
186
- // ── Hormones ──────────────────────────────────────────────
187
- cortisol: {
188
- low: 6,
189
- high: 18,
190
- unit: 'ug/dL',
191
- criticalHigh: 23,
192
- lowerIsBetter: true,
193
- },
194
- testosterone: {
195
- low: 300,
196
- high: 1000,
197
- unit: 'ng/dL',
198
- optimalLow: 500,
199
- criticalLow: 300,
200
- },
201
- estradiol: {
202
- low: 15,
203
- high: 350,
204
- unit: 'pg/mL',
205
- bidirectional: true,
206
- },
207
- tsh: {
208
- low: 0.5,
209
- high: 4.5,
210
- unit: 'mIU/L',
211
- optimalLow: 0.5,
212
- optimalHigh: 2.5,
213
- criticalLow: 0.3,
214
- criticalHigh: 10,
215
- bidirectional: true,
216
- },
217
-
218
- // ── Hematology ────────────────────────────────────────────
219
- wbc: {
220
- low: 4.5,
221
- high: 11.0,
222
- unit: '10^3/uL',
223
- criticalLow: 3.0,
224
- criticalHigh: 15.0,
225
- bidirectional: true,
226
- },
227
- rbc: {
228
- low: 4.0,
229
- high: 5.5,
230
- unit: '10^6/uL',
231
- criticalLow: 3.5,
232
- criticalHigh: 6.0,
233
- bidirectional: true,
234
- },
235
- hemoglobin: {
236
- low: 12.0,
237
- high: 17.5,
238
- unit: 'g/dL',
239
- criticalLow: 10.0,
240
- bidirectional: true,
241
- },
242
- hematocrit: {
243
- low: 36,
244
- high: 52,
245
- unit: '%',
246
- criticalLow: 30,
247
- bidirectional: true,
248
- },
249
- platelets: {
250
- low: 150,
251
- high: 400,
252
- unit: '10^3/uL',
253
- criticalLow: 100,
254
- criticalHigh: 500,
255
- bidirectional: true,
256
- },
257
- mcv: {
258
- low: 80,
259
- high: 100,
260
- unit: 'fL',
261
- criticalLow: 70,
262
- criticalHigh: 110,
263
- bidirectional: true,
264
- },
265
- rdw: {
266
- low: 11.5,
267
- high: 14.5,
268
- unit: '%',
269
- criticalHigh: 17.0,
270
- lowerIsBetter: true,
271
- },
272
- lymphocyte_percent: {
273
- low: 20,
274
- high: 40,
275
- unit: '%',
276
- criticalLow: 15,
277
- criticalHigh: 50,
278
- bidirectional: true,
279
- },
280
-
281
- // ── Vitamins ──────────────────────────────────────────────
282
- vitamin_d: {
283
- low: 30,
284
- high: 100,
285
- unit: 'ng/mL',
286
- optimalLow: 40,
287
- optimalHigh: 80,
288
- criticalLow: 20,
289
- },
290
-
291
- // ── Vitals ────────────────────────────────────────────────
292
- weight: { low: 40, high: 150, unit: 'kg' },
293
- height: { low: 140, high: 210, unit: 'cm' },
294
- bmi: {
295
- low: 18.5,
296
- high: 24.9,
297
- unit: 'kg/m2',
298
- criticalHigh: 30,
299
- lowerIsBetter: true,
300
- },
301
- body_fat_percent: {
302
- low: 8,
303
- high: 25,
304
- unit: '%',
305
- criticalHigh: 35,
306
- lowerIsBetter: true,
307
- },
308
- systolic_bp: {
309
- low: 90,
310
- high: 120,
311
- unit: 'mmHg',
312
- criticalHigh: 140,
313
- lowerIsBetter: true,
314
- },
315
- diastolic_bp: {
316
- low: 60,
317
- high: 80,
318
- unit: 'mmHg',
319
- criticalHigh: 90,
320
- lowerIsBetter: true,
321
- },
322
- heart_rate: {
323
- low: 50,
324
- high: 100,
325
- unit: 'bpm',
326
- optimalLow: 50,
327
- optimalHigh: 70,
328
- bidirectional: true,
329
- },
330
- };
@@ -1,2 +0,0 @@
1
- // Drug interaction and protocol data — populated in Phase 5
2
- export const DRUG_DATA: Record<string, { name: string; category: string }> = {};
@@ -1,17 +0,0 @@
1
- export const UNIT_CONVERSIONS: Record<
2
- string,
3
- { fromUnit: string; toUnit: string; factor: number }
4
- > = {
5
- total_cholesterol: { fromUnit: 'mmol/L', toUnit: 'mg/dL', factor: 38.67 },
6
- ldl_c: { fromUnit: 'mmol/L', toUnit: 'mg/dL', factor: 38.67 },
7
- hdl: { fromUnit: 'mmol/L', toUnit: 'mg/dL', factor: 38.67 },
8
- triglycerides: { fromUnit: 'mmol/L', toUnit: 'mg/dL', factor: 88.57 },
9
- fasting_glucose: { fromUnit: 'mmol/L', toUnit: 'mg/dL', factor: 18.016 },
10
- creatinine: { fromUnit: 'umol/L', toUnit: 'mg/dL', factor: 1 / 88.401 },
11
- uric_acid: { fromUnit: 'umol/L', toUnit: 'mg/dL', factor: 1 / 59.48 },
12
- albumin: { fromUnit: 'g/L', toUnit: 'g/dL', factor: 0.1 },
13
- hs_crp: { fromUnit: 'mg/dL', toUnit: 'mg/L', factor: 10 },
14
- bilirubin_total: { fromUnit: 'umol/L', toUnit: 'mg/dL', factor: 1 / 17.1 },
15
- bun: { fromUnit: 'mmol/L', toUnit: 'mg/dL', factor: 2.801 },
16
- vitamin_d: { fromUnit: 'nmol/L', toUnit: 'ng/mL', factor: 1 / 2.496 },
17
- };
package/src/index.ts DELETED
@@ -1,52 +0,0 @@
1
- // Types
2
- export type { User, UserStatus, Channel, ChannelIdentity } from './types/user.js';
3
- export type { BiomarkerValue, BiomarkerSet } from './types/biomarkers.js';
4
- export type {
5
- SourceLab,
6
- ExtractionResult,
7
- BioAgeResult,
8
- ReportCard,
9
- ReportHighlight,
10
- FlaggedBiomarker,
11
- LabReport,
12
- } from './types/lab-report.js';
13
- export type {
14
- ProtocolCategory,
15
- EvidenceLevel,
16
- Protocol,
17
- EvidenceReference,
18
- Recommendation,
19
- } from './types/recommendation.js';
20
- export type {
21
- SimulationInput,
22
- DailySnapshot,
23
- ModuleSummary,
24
- ModuleResult,
25
- BiomarkerDelta,
26
- SimulationResult,
27
- } from './types/simulation.js';
28
- export type {
29
- MessageRole,
30
- ConversationStatus,
31
- InboundMessage,
32
- OutboundMessage,
33
- Conversation,
34
- Message,
35
- } from './types/messaging.js';
36
- export type {
37
- ChatMessage,
38
- ContentPart,
39
- LLMOptions,
40
- LLMProvider,
41
- DocumentPart,
42
- ImagePart,
43
- TextPart,
44
- MultimodalPart,
45
- ExtendedLLMProvider,
46
- } from './types/llm.js';
47
-
48
- // Constants
49
- export { UNIT_CONVERSIONS } from './constants/unit-conversions.js';
50
- export { BIOMARKER_RANGES } from './constants/biomarker-ranges.js';
51
- export type { BiomarkerRange } from './constants/biomarker-ranges.js';
52
- export { DRUG_DATA } from './constants/drug-data.js';
@@ -1,68 +0,0 @@
1
- export interface BiomarkerValue {
2
- name: string;
3
- value: number;
4
- unit: string;
5
- referenceRange?: { low: number; high: number };
6
- flag?: 'low' | 'normal' | 'high' | 'critical';
7
- }
8
-
9
- export interface BiomarkerSet {
10
- // Vitals
11
- weight?: BiomarkerValue;
12
- height?: BiomarkerValue;
13
- bmi?: BiomarkerValue;
14
- bodyFatPercent?: BiomarkerValue;
15
- bloodPressureSystolic?: BiomarkerValue;
16
- bloodPressureDiastolic?: BiomarkerValue;
17
- heartRate?: BiomarkerValue;
18
-
19
- // Lipids
20
- totalCholesterol?: BiomarkerValue;
21
- ldlC?: BiomarkerValue;
22
- hdl?: BiomarkerValue;
23
- triglycerides?: BiomarkerValue;
24
- apoB?: BiomarkerValue;
25
-
26
- // Metabolic
27
- hba1c?: BiomarkerValue;
28
- fastingGlucose?: BiomarkerValue;
29
- fastingInsulin?: BiomarkerValue;
30
- homaIr?: BiomarkerValue;
31
- uricAcid?: BiomarkerValue;
32
-
33
- // Kidney
34
- creatinine?: BiomarkerValue;
35
- bun?: BiomarkerValue;
36
- egfr?: BiomarkerValue;
37
-
38
- // Liver
39
- alt?: BiomarkerValue;
40
- ast?: BiomarkerValue;
41
- alp?: BiomarkerValue;
42
- ggt?: BiomarkerValue;
43
- bilirubinTotal?: BiomarkerValue;
44
- albumin?: BiomarkerValue;
45
-
46
- // Inflammatory
47
- hsCrp?: BiomarkerValue;
48
- esr?: BiomarkerValue;
49
-
50
- // Hormones
51
- cortisol?: BiomarkerValue;
52
- testosterone?: BiomarkerValue;
53
- estradiol?: BiomarkerValue;
54
- tsh?: BiomarkerValue;
55
-
56
- // Hematology
57
- wbc?: BiomarkerValue;
58
- rbc?: BiomarkerValue;
59
- hemoglobin?: BiomarkerValue;
60
- hematocrit?: BiomarkerValue;
61
- platelets?: BiomarkerValue;
62
- mcv?: BiomarkerValue;
63
- rdw?: BiomarkerValue;
64
- lymphocytePercent?: BiomarkerValue;
65
-
66
- // Vitamins
67
- vitaminD?: BiomarkerValue;
68
- }