wellness-cycle-coach 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.3.0] - 2026-05-11
6
+
7
+ ### Added
8
+
9
+ - **Shared wellness profile support** — vendored canonical `profile-store` (Delx Wellness `ab83d1a`) at `src/services/profile-store.ts`. Reads/writes `~/.delx-wellness/profile.json` (the same file every Delx Wellness MCP can read).
10
+ - `cycle_profile_get` MCP tool — returns the user's shared profile, one-line summary, and missing critical fields. Read-only.
11
+ - `cycle_profile_update` MCP tool — persist a partial patch with `explicit_user_intent: true`. Rejects secret-like fields (oauth/token/secret/password/cookie/refresh/api_key/session).
12
+ - `cycle_onboarding` MCP tool — returns the 11-question onboarding flow + the current profile + a cross-connector hint that `profile.profile.sex_or_gender_context` activates phase-aware coaching (pair with wellness-nourish phase-emphasis meals + whoop-mcp recovery for late-luteal load adjustments).
13
+ - `wellness-cycle-coach onboarding [pt-BR|en]` CLI command — emits the flow as JSON on stdout plus a TTY-gated Markdown walkthrough on stderr ("the agent will ask these 11 questions next — non-secret data only, stored at ~/.delx-wellness/profile.json").
14
+
15
+ ### Changed
16
+
17
+ - Tool count: 13 → 16.
18
+ - `recommended_first_calls` now leads with `cycle_profile_get` so agents fetch the user's `sex_or_gender_context` before activating phase-aware coaching.
19
+
20
+ ## [0.2.0] - 2026-05-10
21
+
22
+ ### Added
23
+
24
+ - `cycle_quickstart` tool — returns a personalized 3-step walkthrough for using the coach (gather history → call full_report → cross-reference with rest of the wellness stack).
25
+ - `cycle_demo` tool — returns a sample `cycle_full_report` payload with synthetic data so agents see the contract before integrating real period dates.
26
+ - `cycle_full_report` now returns a one-line `tldr` string for quick agent rendering ("Phase: luteal (cycle day 22). Eat: complex carbs, B vitamins. Train: endurance + technique (moderate). Hydrate: 2600 ml. Next period: ~2026-05-27.")
27
+ - `doctor` CLI now returns a `recommendations[]` array suggesting next-step tools.
28
+
29
+ ### Changed
30
+
31
+ - `recommended_first_calls` on the agent manifest now leads with `cycle_quickstart`.
32
+ - Tool count: 11 → 13.
33
+
5
34
  ## [0.1.0] - 2026-05-10
6
35
 
7
36
  ### Added
@@ -1,7 +1,8 @@
1
1
  import { NPM_PACKAGE_NAME, SERVER_VERSION } from "../constants.js";
2
2
  import { buildCapabilities } from "../services/capabilities.js";
3
3
  import { buildPrivacyAudit } from "../services/privacy-audit.js";
4
- const COMMANDS = new Set(["status", "doctor", "setup"]);
4
+ import { getOnboardingFlow, getProfile, getProfilePath, missingCriticalFields, } from "../services/profile-store.js";
5
+ const COMMANDS = new Set(["status", "doctor", "setup", "onboarding"]);
5
6
  function printCommunityCTA() {
6
7
  if (process.env.WELLNESS_CYCLE_COACH_QUIET === "1")
7
8
  return;
@@ -18,7 +19,7 @@ export function isCliCommand(args) {
18
19
  return command !== undefined && COMMANDS.has(command);
19
20
  }
20
21
  export async function runCliCommand(args) {
21
- const [command] = args;
22
+ const [command, ...rest] = args;
22
23
  switch (command) {
23
24
  case "status":
24
25
  console.log(JSON.stringify({ name: NPM_PACKAGE_NAME, version: SERVER_VERSION, stateless: true }, null, 2));
@@ -32,6 +33,11 @@ export async function runCliCommand(args) {
32
33
  stateless: true,
33
34
  capabilities: buildCapabilities(),
34
35
  privacy: buildPrivacyAudit(),
36
+ recommendations: [
37
+ "Try cycle_demo to see a sample output before integrating real data.",
38
+ "Try cycle_quickstart to get a 3-step setup tailored to your client.",
39
+ "Pass period start dates via tool args; this MCP is stateless by design.",
40
+ ],
35
41
  }, null, 2));
36
42
  printCommunityCTA();
37
43
  return 0;
@@ -51,6 +57,28 @@ export async function runCliCommand(args) {
51
57
  }, null, 2));
52
58
  printCommunityCTA();
53
59
  return 0;
60
+ case "onboarding": {
61
+ const locale = rest[0] === "pt-BR" ? "pt-BR" : "en";
62
+ const flow = getOnboardingFlow(locale);
63
+ const profile = await getProfile();
64
+ const missing = missingCriticalFields(profile);
65
+ console.log(JSON.stringify({
66
+ ...flow,
67
+ current_profile: profile,
68
+ missing_critical: missing,
69
+ }, null, 2));
70
+ if (process.stderr.isTTY && process.env.WELLNESS_CYCLE_COACH_QUIET !== "1") {
71
+ process.stderr.write(`\n## Delx Wellness shared onboarding (${locale})\n` +
72
+ `\nThe agent will ask these 11 questions next so wellness-cycle-coach (and the rest\n` +
73
+ `of the wellness stack) can personalize responses — non-secret data only, stored at\n` +
74
+ `${getProfilePath()}.\n\n` +
75
+ flow.questions
76
+ .map((q, i) => `${i + 1}. (${q.required ? "required" : "optional"}) ${q.prompt}`)
77
+ .join("\n") +
78
+ `\n\nPrivacy: ${flow.privacy_note}\n\n`);
79
+ }
80
+ return 0;
81
+ }
54
82
  default:
55
83
  return -1;
56
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAExD,SAAS,iBAAiB;IACxB,IAAI,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,GAAG;QAAE,OAAO;IAC3D,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK;QAAE,OAAO;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,6BAA6B,cAAc,0GAA0G;QACnJ,6DAA6D;QAC7D,qEAAqE;QACrE,gCAAgC;QAChC,oDAAoD,CACvD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAc;IACzC,MAAM,OAAO,GAAG,IA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AG,IAAI;gBACP,eAAe,EAAE,OAAO;gBACxB,gBAAgB,EAAE,OAAO;aAC1B,EACD,IAAI,EACJ,CAAC,CACF,CACF,CAAC;YACF,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,GAAG,EAAE,CAAC;gBAC3E,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,yCAAyC,MAAM,KAAK;oBAClD,sFAAsF;oBACtF,sFAAsF;oBACtF,GAAG,cAAc,EAAE,OAAO;oBAC1B,IAAI,CAAC,SAAS;yBACX,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;yBAChF,IAAI,CAAC,IAAI,CAAC;oBACb,gBAAgB,IAAI,CAAC,YAAY,MAAM,CAC1C,CAAC;YACJ,CAAC;YACD,OAAO,CAAC,CAAC;QACX,CAAC;QACD;YACE,OAAO,CAAC,CAAC,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -1,7 +1,7 @@
1
1
  export declare const SERVER_NAME = "wellness-cycle-coach-mcp";
2
- export declare const SERVER_VERSION = "0.1.0";
2
+ export declare const SERVER_VERSION = "0.3.0";
3
3
  export declare const NPM_PACKAGE_NAME = "wellness-cycle-coach";
4
- export declare const PINNED_NPM_PACKAGE = "wellness-cycle-coach@0.1.0";
4
+ export declare const PINNED_NPM_PACKAGE = "wellness-cycle-coach@0.3.0";
5
5
  export declare const DEFAULT_HOST = "127.0.0.1";
6
6
  export declare const DEFAULT_PORT = 3011;
7
7
  export declare const LOCAL_DIR_NAME = ".wellness-cycle-coach";
package/dist/constants.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const SERVER_NAME = "wellness-cycle-coach-mcp";
2
- export const SERVER_VERSION = "0.1.0";
2
+ export const SERVER_VERSION = "0.3.0";
3
3
  export const NPM_PACKAGE_NAME = "wellness-cycle-coach";
4
4
  export const PINNED_NPM_PACKAGE = `${NPM_PACKAGE_NAME}@${SERVER_VERSION}`;
5
5
  export const DEFAULT_HOST = "127.0.0.1";
@@ -14,19 +14,24 @@ const TOOLS = [
14
14
  "cycle_agent_manifest",
15
15
  "cycle_capabilities",
16
16
  "cycle_connection_status",
17
- "cycle_privacy_audit",
18
17
  "cycle_data_inventory",
18
+ "cycle_demo",
19
19
  "cycle_estimate_phase",
20
- "cycle_predict_next_period",
20
+ "cycle_full_report",
21
+ "cycle_onboarding",
21
22
  "cycle_phase_guidance",
23
+ "cycle_predict_next_period",
24
+ "cycle_privacy_audit",
25
+ "cycle_profile_get",
26
+ "cycle_profile_update",
27
+ "cycle_quickstart",
22
28
  "cycle_recommend_nutrition",
23
29
  "cycle_recommend_training",
24
- "cycle_full_report",
25
30
  ];
26
31
  const RECOMMENDED_FIRST_CALLS = [
27
- "cycle_connection_status",
28
- "cycle_capabilities",
29
- "cycle_estimate_phase",
32
+ "cycle_profile_get",
33
+ "cycle_quickstart",
34
+ "cycle_full_report",
30
35
  ];
31
36
  export function buildAgentManifest(client = "generic") {
32
37
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"agent-manifest.js","sourceRoot":"","sources":["../../src/services/agent-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,kBAAkB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD,MAAM,iBAAiB,GAAuB;IAC5C,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,UAAU;IACV,SAAS;CACV,CAAC;AAEF,MAAM,KAAK,GAAG;IACZ,sBAAsB;IACtB,oBAAoB;IACpB,yBAAyB;IACzB,qBAAqB;IACrB,sBAAsB;IACtB,sBAAsB;IACtB,2BAA2B;IAC3B,sBAAsB;IACtB,2BAA2B;IAC3B,0BAA0B;IAC1B,mBAAmB;CACX,CAAC;AAEX,MAAM,uBAAuB,GAAG;IAC9B,yBAAyB;IACzB,oBAAoB;IACpB,sBAAsB;CACvB,CAAC;AAiBF,MAAM,UAAU,kBAAkB,CAAC,SAA2B,SAAS;IACrE,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,cAAc;QACvB,MAAM;QACN,iBAAiB,EAAE,iBAAiB;QACpC,OAAO,EAAE;YACP,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,IAAI,EAAE,kBAAkB,CAAC;YAChC,YAAY,EAAE,CAAC,gCAAgC,CAAC;SACjD;QACD,uBAAuB,EAAE,uBAAuB;QAChD,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE;YACT,uCAAuC;YACvC,qCAAqC;YACrC,sCAAsC;SACvC;QACD,WAAW,EAAE;YACX,8FAA8F;YAC9F,wGAAwG;YACxG,6EAA6E;YAC7E,mFAAmF;YACnF,+GAA+G;SAChH;QACD,SAAS,EAAE;YACT,IAAI,EAAE,qDAAqD;YAC3D,MAAM,EAAE,4DAA4D;YACpE,OAAO,EAAE,uBAAuB;YAChC,IAAI,EAAE,2CAA2C;YACjD,MAAM,EACJ,mJAAmJ;SACtJ;QACD,YAAY,EAAE,iBAAiB,EAAE;QACjC,OAAO,EAAE,iBAAiB,EAAE;KAC7B,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"agent-manifest.js","sourceRoot":"","sources":["../../src/services/agent-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,kBAAkB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD,MAAM,iBAAiB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Wellness shared profile store — canonical source.
3
+ *
4
+ * Single source of truth for user wellness context across the 14+ MCP
5
+ * connectors in the Delx Wellness ecosystem. Stored at:
6
+ *
7
+ * ~/.delx-wellness/profile.json
8
+ *
9
+ * Every connector that wants to read/write user profile data vendors a
10
+ * COPY of this file into `src/services/profile-store.ts` (keeps each
11
+ * connector self-contained, no extra npm dep). When the schema changes,
12
+ * bump v1 → v2 here AND copy the same change into every connector.
13
+ *
14
+ * Schema is intentionally identical to
15
+ * `delx-wellness-hermes/src/wellness-profile.ts` (v1) so the Hermes /
16
+ * OpenClaw profile packs can hand off seamlessly via the migration
17
+ * helper below.
18
+ *
19
+ * PRIVACY CONTRACT (enforced at validation time):
20
+ * ✘ NEVER stores OAuth tokens, API keys, refresh tokens, cookies,
21
+ * session ids, raw provider secrets.
22
+ * ✘ NEVER stores diagnostic biomarkers (HRV, glucose, BP) — those live
23
+ * in the connector's own data flow.
24
+ * ✓ Stores only what the user explicitly typed into onboarding:
25
+ * preferred name, body basics, goals, devices, training context,
26
+ * nutrition context, exercise preferences, agent preferences,
27
+ * safety flags.
28
+ */
29
+ export type WellnessLanguage = "en" | "pt-BR";
30
+ export type WellnessUnits = "metric" | "imperial";
31
+ export type WellnessReplyStyle = "concise" | "detailed";
32
+ export interface WellnessProfile {
33
+ preferred_name: string;
34
+ language: WellnessLanguage;
35
+ timezone: string;
36
+ units: WellnessUnits;
37
+ /** Either an integer year (e.g. "1985") or a stated age (e.g. "39"). Optional. */
38
+ age_or_birth_year: string;
39
+ /** Free-form, e.g. "178 cm" or "5'10\"". */
40
+ height: string;
41
+ /** Free-form, e.g. "72 kg" or "158 lb". */
42
+ weight: string;
43
+ /** Free-form context for cycle-aware coaching, e.g. "female (menstruating)". Optional. */
44
+ sex_or_gender_context: string;
45
+ }
46
+ export interface WellnessGoals {
47
+ primary: string;
48
+ secondary: string[];
49
+ training_focus: string;
50
+ recovery_focus: string;
51
+ nutrition_focus: string;
52
+ sleep_focus: string;
53
+ biggest_friction: string;
54
+ }
55
+ export interface WellnessDevices {
56
+ connected: string[];
57
+ desired: string[];
58
+ primary_recovery_source: string;
59
+ primary_activity_source: string;
60
+ primary_nutrition_source: string;
61
+ }
62
+ export interface WellnessTraining {
63
+ sports: string[];
64
+ weekly_schedule: string;
65
+ equipment: string[];
66
+ location: string[];
67
+ preferred_duration_minutes: string;
68
+ exercises_to_avoid: string[];
69
+ limitations: string[];
70
+ }
71
+ export interface WellnessNutrition {
72
+ dietary_preferences: string[];
73
+ restrictions_or_allergies: string[];
74
+ protein_target_g: string;
75
+ hydration_target_ml: string;
76
+ calorie_target: string;
77
+ }
78
+ export interface WellnessPreferences {
79
+ language_priority: WellnessLanguage[];
80
+ reply_style: WellnessReplyStyle;
81
+ telegram_style: WellnessReplyStyle;
82
+ ask_before_logging: boolean;
83
+ include_exercise_videos_when_available: boolean;
84
+ }
85
+ export interface WellnessSafety {
86
+ injuries_or_pain: string[];
87
+ medical_constraints: string[];
88
+ conservative_flags: string[];
89
+ }
90
+ export interface WellnessProfileDocument {
91
+ schema: "delx-wellness-profile/v1";
92
+ generated_by: string;
93
+ version: 1;
94
+ profile: WellnessProfile;
95
+ goals: WellnessGoals;
96
+ devices: WellnessDevices;
97
+ training: WellnessTraining;
98
+ nutrition: WellnessNutrition;
99
+ preferences: WellnessPreferences;
100
+ safety: WellnessSafety;
101
+ notes: string;
102
+ updated_at?: string;
103
+ }
104
+ export interface OnboardingQuestion {
105
+ id: string;
106
+ prompt: string;
107
+ category: "profile" | "goals" | "devices" | "training" | "nutrition" | "exercise" | "preferences" | "safety";
108
+ required: boolean;
109
+ }
110
+ export interface OnboardingFlow {
111
+ locale: WellnessLanguage;
112
+ questions: OnboardingQuestion[];
113
+ storage_path: string;
114
+ privacy_note: string;
115
+ }
116
+ export declare const DEFAULT_PROFILE: WellnessProfileDocument;
117
+ /** Returns the absolute storage path. Useful in privacy_audit responses. */
118
+ export declare function getProfilePath(): string;
119
+ /**
120
+ * Read the canonical profile. Returns a fresh DEFAULT_PROFILE if no file
121
+ * exists (and does not create the file — call updateProfile to persist).
122
+ *
123
+ * Auto-migrates from Hermes / OpenClaw profile if found and the canonical
124
+ * file is missing.
125
+ */
126
+ export declare function getProfile(): Promise<WellnessProfileDocument>;
127
+ /**
128
+ * Persist a partial patch to the canonical profile. Validates the patch
129
+ * against the schema before writing, rejecting unknown top-level keys and
130
+ * any field that smells like a secret (oauth, token, secret, password,
131
+ * cookie, refresh).
132
+ */
133
+ export declare function updateProfile(patch: Partial<WellnessProfileDocument>): Promise<WellnessProfileDocument>;
134
+ /**
135
+ * One-time migration from the Hermes or OpenClaw profile pack location.
136
+ * Only runs if the canonical file does NOT exist. Idempotent.
137
+ */
138
+ export declare function migrateFromLegacy(): Promise<{
139
+ migrated: boolean;
140
+ from?: string;
141
+ }>;
142
+ /** Return the 11-question onboarding flow in the requested locale. */
143
+ export declare function getOnboardingQuestions(locale?: WellnessLanguage): OnboardingQuestion[];
144
+ export declare function getOnboardingFlow(locale?: WellnessLanguage): OnboardingFlow;
145
+ /** One-line summary for agent context handoff. */
146
+ export declare function buildProfileSummary(profile: WellnessProfileDocument): string;
147
+ export declare function missingCriticalFields(profile: WellnessProfileDocument): string[];
@@ -0,0 +1,299 @@
1
+ /**
2
+ * Delx Wellness shared profile store — canonical source.
3
+ *
4
+ * Single source of truth for user wellness context across the 14+ MCP
5
+ * connectors in the Delx Wellness ecosystem. Stored at:
6
+ *
7
+ * ~/.delx-wellness/profile.json
8
+ *
9
+ * Every connector that wants to read/write user profile data vendors a
10
+ * COPY of this file into `src/services/profile-store.ts` (keeps each
11
+ * connector self-contained, no extra npm dep). When the schema changes,
12
+ * bump v1 → v2 here AND copy the same change into every connector.
13
+ *
14
+ * Schema is intentionally identical to
15
+ * `delx-wellness-hermes/src/wellness-profile.ts` (v1) so the Hermes /
16
+ * OpenClaw profile packs can hand off seamlessly via the migration
17
+ * helper below.
18
+ *
19
+ * PRIVACY CONTRACT (enforced at validation time):
20
+ * ✘ NEVER stores OAuth tokens, API keys, refresh tokens, cookies,
21
+ * session ids, raw provider secrets.
22
+ * ✘ NEVER stores diagnostic biomarkers (HRV, glucose, BP) — those live
23
+ * in the connector's own data flow.
24
+ * ✓ Stores only what the user explicitly typed into onboarding:
25
+ * preferred name, body basics, goals, devices, training context,
26
+ * nutrition context, exercise preferences, agent preferences,
27
+ * safety flags.
28
+ */
29
+ /// <reference types="node" />
30
+ import { promises as fs } from "node:fs";
31
+ import { homedir } from "node:os";
32
+ import { join, dirname } from "node:path";
33
+ const PROFILE_DIR = join(homedir(), ".delx-wellness");
34
+ const PROFILE_PATH = join(PROFILE_DIR, "profile.json");
35
+ const LEGACY_PATHS = [
36
+ join(homedir(), ".hermes/profiles/delx-wellness/wellness-profile.json"),
37
+ join(homedir(), ".openclaw-delx-wellness/workspace/wellness-profile.json"),
38
+ ];
39
+ export const DEFAULT_PROFILE = {
40
+ schema: "delx-wellness-profile/v1",
41
+ generated_by: "wellness-cycle-coach",
42
+ version: 1,
43
+ profile: {
44
+ preferred_name: "",
45
+ language: "en",
46
+ timezone: "",
47
+ units: "metric",
48
+ age_or_birth_year: "",
49
+ height: "",
50
+ weight: "",
51
+ sex_or_gender_context: "",
52
+ },
53
+ goals: {
54
+ primary: "",
55
+ secondary: [],
56
+ training_focus: "",
57
+ recovery_focus: "",
58
+ nutrition_focus: "",
59
+ sleep_focus: "",
60
+ biggest_friction: "",
61
+ },
62
+ devices: {
63
+ connected: [],
64
+ desired: [],
65
+ primary_recovery_source: "",
66
+ primary_activity_source: "",
67
+ primary_nutrition_source: "nourish",
68
+ },
69
+ training: {
70
+ sports: [],
71
+ weekly_schedule: "",
72
+ equipment: [],
73
+ location: [],
74
+ preferred_duration_minutes: "",
75
+ exercises_to_avoid: [],
76
+ limitations: [],
77
+ },
78
+ nutrition: {
79
+ dietary_preferences: [],
80
+ restrictions_or_allergies: [],
81
+ protein_target_g: "",
82
+ hydration_target_ml: "",
83
+ calorie_target: "",
84
+ },
85
+ preferences: {
86
+ language_priority: ["en", "pt-BR"],
87
+ reply_style: "concise",
88
+ telegram_style: "concise",
89
+ ask_before_logging: true,
90
+ include_exercise_videos_when_available: true,
91
+ },
92
+ safety: {
93
+ injuries_or_pain: [],
94
+ medical_constraints: [],
95
+ conservative_flags: [],
96
+ },
97
+ notes: "",
98
+ };
99
+ /** Returns the absolute storage path. Useful in privacy_audit responses. */
100
+ export function getProfilePath() {
101
+ return PROFILE_PATH;
102
+ }
103
+ function clone(value) {
104
+ return JSON.parse(JSON.stringify(value));
105
+ }
106
+ async function fileExists(path) {
107
+ try {
108
+ await fs.access(path);
109
+ return true;
110
+ }
111
+ catch {
112
+ return false;
113
+ }
114
+ }
115
+ async function readProfileFile(path) {
116
+ try {
117
+ const raw = await fs.readFile(path, "utf8");
118
+ const parsed = JSON.parse(raw);
119
+ if (parsed.schema !== "delx-wellness-profile/v1")
120
+ return null;
121
+ return parsed;
122
+ }
123
+ catch {
124
+ return null;
125
+ }
126
+ }
127
+ async function writeProfileFile(path, profile) {
128
+ await fs.mkdir(dirname(path), { recursive: true });
129
+ const tmp = `${path}.tmp.${process.pid}.${Date.now()}`;
130
+ await fs.writeFile(tmp, JSON.stringify(profile, null, 2) + "\n", { encoding: "utf8", mode: 0o600 });
131
+ await fs.rename(tmp, path);
132
+ }
133
+ /**
134
+ * Read the canonical profile. Returns a fresh DEFAULT_PROFILE if no file
135
+ * exists (and does not create the file — call updateProfile to persist).
136
+ *
137
+ * Auto-migrates from Hermes / OpenClaw profile if found and the canonical
138
+ * file is missing.
139
+ */
140
+ export async function getProfile() {
141
+ if (!(await fileExists(PROFILE_PATH))) {
142
+ const migration = await migrateFromLegacy();
143
+ if (migration.migrated) {
144
+ const migrated = await readProfileFile(PROFILE_PATH);
145
+ if (migrated)
146
+ return migrated;
147
+ }
148
+ return clone(DEFAULT_PROFILE);
149
+ }
150
+ const existing = await readProfileFile(PROFILE_PATH);
151
+ return existing ?? clone(DEFAULT_PROFILE);
152
+ }
153
+ /**
154
+ * Persist a partial patch to the canonical profile. Validates the patch
155
+ * against the schema before writing, rejecting unknown top-level keys and
156
+ * any field that smells like a secret (oauth, token, secret, password,
157
+ * cookie, refresh).
158
+ */
159
+ export async function updateProfile(patch) {
160
+ rejectSecretsInPatch(patch);
161
+ const current = await getProfile();
162
+ const merged = {
163
+ schema: "delx-wellness-profile/v1",
164
+ generated_by: current.generated_by || DEFAULT_PROFILE.generated_by,
165
+ version: 1,
166
+ profile: { ...current.profile, ...(patch.profile ?? {}) },
167
+ goals: { ...current.goals, ...(patch.goals ?? {}) },
168
+ devices: { ...current.devices, ...(patch.devices ?? {}) },
169
+ training: { ...current.training, ...(patch.training ?? {}) },
170
+ nutrition: { ...current.nutrition, ...(patch.nutrition ?? {}) },
171
+ preferences: { ...current.preferences, ...(patch.preferences ?? {}) },
172
+ safety: { ...current.safety, ...(patch.safety ?? {}) },
173
+ notes: patch.notes ?? current.notes,
174
+ updated_at: new Date().toISOString(),
175
+ };
176
+ await writeProfileFile(PROFILE_PATH, merged);
177
+ return merged;
178
+ }
179
+ const SECRET_PATTERNS = /(oauth|token|secret|password|cookie|refresh|api[_-]?key|session)/i;
180
+ function rejectSecretsInPatch(patch) {
181
+ function scan(value, path = []) {
182
+ if (value === null || value === undefined)
183
+ return;
184
+ if (typeof value === "string") {
185
+ const flat = path.join(".");
186
+ if (SECRET_PATTERNS.test(flat) || SECRET_PATTERNS.test(value)) {
187
+ throw new Error(`Refusing to store secret-like value at '${flat}'. ` +
188
+ `Profile is for non-secret wellness context only.`);
189
+ }
190
+ return;
191
+ }
192
+ if (Array.isArray(value)) {
193
+ value.forEach((entry, i) => scan(entry, [...path, String(i)]));
194
+ return;
195
+ }
196
+ if (typeof value === "object") {
197
+ for (const [k, v] of Object.entries(value)) {
198
+ if (SECRET_PATTERNS.test(k)) {
199
+ throw new Error(`Refusing to store secret-like field '${k}'. ` +
200
+ `Profile is for non-secret wellness context only.`);
201
+ }
202
+ scan(v, [...path, k]);
203
+ }
204
+ }
205
+ }
206
+ scan(patch);
207
+ }
208
+ /**
209
+ * One-time migration from the Hermes or OpenClaw profile pack location.
210
+ * Only runs if the canonical file does NOT exist. Idempotent.
211
+ */
212
+ export async function migrateFromLegacy() {
213
+ if (await fileExists(PROFILE_PATH))
214
+ return { migrated: false };
215
+ for (const candidate of LEGACY_PATHS) {
216
+ if (await fileExists(candidate)) {
217
+ const legacy = await readProfileFile(candidate);
218
+ if (legacy) {
219
+ await writeProfileFile(PROFILE_PATH, { ...legacy, updated_at: new Date().toISOString() });
220
+ return { migrated: true, from: candidate };
221
+ }
222
+ }
223
+ }
224
+ return { migrated: false };
225
+ }
226
+ const QUESTIONS_EN = [
227
+ { id: "preferred_name", category: "profile", required: false, prompt: "What should the agent call you?" },
228
+ { id: "locale_timezone_units", category: "profile", required: true, prompt: "What are your language, timezone, and units?" },
229
+ { id: "body_basics", category: "profile", required: false, prompt: "Share age or birth year, height, weight, and gender/sex only if you want the agent to use that context." },
230
+ { id: "primary_goal", category: "goals", required: true, prompt: "What is your primary wellness goal right now?" },
231
+ { id: "secondary_goals", category: "goals", required: false, prompt: "What secondary goals matter: fat loss, muscle, endurance, sleep, recovery, longevity, stress, consistency?" },
232
+ { id: "devices", category: "devices", required: true, prompt: "Which sources do you use: WHOOP, Garmin, Oura, Strava, Fitbit, Google Health, Withings, Apple Health, Samsung Health, Polar, Nourish, Air, CGM, Cycle Coach?" },
233
+ { id: "training_context", category: "training", required: true, prompt: "What sports do you train, how often, and what does a normal week look like?" },
234
+ { id: "nutrition_context", category: "nutrition", required: false, prompt: "What nutrition context should the agent know: meals, calories, macros, restrictions, allergies, or food preferences?" },
235
+ { id: "exercise_preferences", category: "exercise", required: false, prompt: "What equipment, location, duration, exercises to avoid, or limitations should workouts respect?" },
236
+ { id: "agent_preferences", category: "preferences", required: false, prompt: "Do you prefer concise replies, detailed explanations, pt-BR, English, or logging confirmations?" },
237
+ { id: "safety_context", category: "safety", required: false, prompt: "Any injuries, pain, medical constraints, or symptoms the agent should treat as a reason to be conservative?" },
238
+ ];
239
+ const QUESTIONS_PT_BR = [
240
+ { id: "preferred_name", category: "profile", required: false, prompt: "Como o agente deve te chamar?" },
241
+ { id: "locale_timezone_units", category: "profile", required: true, prompt: "Qual idioma, fuso horário e sistema de medidas você prefere?" },
242
+ { id: "body_basics", category: "profile", required: false, prompt: "Compartilhe idade ou ano de nascimento, altura, peso e gênero/sexo apenas se quiser que o agente use esse contexto." },
243
+ { id: "primary_goal", category: "goals", required: true, prompt: "Qual é seu principal objetivo de wellness agora?" },
244
+ { id: "secondary_goals", category: "goals", required: false, prompt: "Quais objetivos secundários importam: perda de gordura, massa, endurance, sono, recuperação, longevidade, estresse ou consistência?" },
245
+ { id: "devices", category: "devices", required: true, prompt: "Quais fontes você usa: WHOOP, Garmin, Oura, Strava, Fitbit, Google Health, Withings, Apple Health, Samsung Health, Polar, Nourish, Air, CGM, Cycle Coach?" },
246
+ { id: "training_context", category: "training", required: true, prompt: "Quais esportes você treina, com que frequência, e como é uma semana normal?" },
247
+ { id: "nutrition_context", category: "nutrition", required: false, prompt: "Que contexto nutricional o agente deve saber: refeições, calorias, macros, restrições, alergias ou preferências alimentares?" },
248
+ { id: "exercise_preferences", category: "exercise", required: false, prompt: "Quais equipamentos, local, duração, exercícios a evitar ou limitações os treinos devem respeitar?" },
249
+ { id: "agent_preferences", category: "preferences", required: false, prompt: "Você prefere respostas concisas, explicações detalhadas, pt-BR, inglês ou confirmações antes de registrar dados?" },
250
+ { id: "safety_context", category: "safety", required: false, prompt: "Há lesões, dor, restrições médicas ou sintomas que o agente deve tratar como motivo para ser conservador?" },
251
+ ];
252
+ /** Return the 11-question onboarding flow in the requested locale. */
253
+ export function getOnboardingQuestions(locale = "en") {
254
+ return locale === "pt-BR" ? clone(QUESTIONS_PT_BR) : clone(QUESTIONS_EN);
255
+ }
256
+ export function getOnboardingFlow(locale = "en") {
257
+ return {
258
+ locale,
259
+ questions: getOnboardingQuestions(locale),
260
+ storage_path: PROFILE_PATH,
261
+ privacy_note: "Profile NEVER stores OAuth tokens, API keys, refresh tokens, cookies, or raw provider secrets. " +
262
+ "Tokens stay in each connector's own local-config (e.g. ~/.whoop-mcp/tokens.json).",
263
+ };
264
+ }
265
+ /** One-line summary for agent context handoff. */
266
+ export function buildProfileSummary(profile) {
267
+ const parts = [];
268
+ const p = profile.profile;
269
+ if (p.preferred_name)
270
+ parts.push(p.preferred_name);
271
+ if (p.age_or_birth_year || p.sex_or_gender_context) {
272
+ const bits = [p.age_or_birth_year, p.sex_or_gender_context].filter(Boolean).join(", ");
273
+ parts.push(bits);
274
+ }
275
+ if (p.height && p.weight)
276
+ parts.push(`${p.height} / ${p.weight}`);
277
+ if (profile.goals.primary)
278
+ parts.push(`goal: ${profile.goals.primary}`);
279
+ if (profile.devices.connected.length > 0)
280
+ parts.push(`devices: ${profile.devices.connected.join(", ")}`);
281
+ if (profile.preferences.language_priority[0])
282
+ parts.push(`lang: ${profile.preferences.language_priority[0]}`);
283
+ return parts.length > 0 ? parts.join(" · ") : "Empty profile — run onboarding to populate.";
284
+ }
285
+ export function missingCriticalFields(profile) {
286
+ const missing = [];
287
+ if (!profile.profile.preferred_name)
288
+ missing.push("preferred_name");
289
+ if (!profile.profile.timezone)
290
+ missing.push("timezone");
291
+ if (!profile.goals.primary)
292
+ missing.push("primary_goal");
293
+ if (profile.devices.connected.length === 0)
294
+ missing.push("connected_devices");
295
+ if (!profile.training.weekly_schedule)
296
+ missing.push("training_weekly_schedule");
297
+ return missing;
298
+ }
299
+ //# sourceMappingURL=profile-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-store.js","sourceRoot":"","sources":["../../src/services/profile-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,8BAA8B;AAE9B,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE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B,CAAC,CAAC;IACpE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ;QAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACxD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACzD,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC9E,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe;QAAE,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IAChF,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -3,6 +3,7 @@ import { estimatePhase, guidanceForPhase, estimateAverageCycleLength, } from "..
3
3
  import { buildAgentManifest } from "../services/agent-manifest.js";
4
4
  import { buildCapabilities } from "../services/capabilities.js";
5
5
  import { buildPrivacyAudit } from "../services/privacy-audit.js";
6
+ import { buildProfileSummary, getOnboardingFlow, getProfile, getProfilePath, missingCriticalFields, updateProfile, } from "../services/profile-store.js";
6
7
  import { CYCLE_PHASES, UPSTREAM_CONNECTORS } from "../constants.js";
7
8
  function jsonResponse(payload) {
8
9
  return {
@@ -131,7 +132,7 @@ export function registerCycleTools(server) {
131
132
  });
132
133
  server.registerTool("cycle_full_report", {
133
134
  title: "Cycle full report",
134
- description: "Single-call report: phase + nutrition + training + hydration + next-period estimate.",
135
+ description: "Single-call report: phase + nutrition + training + hydration + next-period estimate. Includes a TL;DR string for quick agent rendering.",
135
136
  inputSchema: {
136
137
  history: HistorySchema,
137
138
  today: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
@@ -140,7 +141,13 @@ export function registerCycleTools(server) {
140
141
  const reference = today ? new Date(today + "T12:00:00Z") : new Date();
141
142
  const estimate = estimatePhase(history, reference);
142
143
  const guidance = guidanceForPhase(estimate.phase);
144
+ const tldr = `Phase: ${estimate.phase} (cycle day ${estimate.cycle_day} of ~${estimate.cycle_length_days}). ` +
145
+ `Eat: ${guidance.nutrition.emphasize.slice(0, 2).join(", ")}. ` +
146
+ `Train: ${guidance.training.style} (${guidance.training.intensity}). ` +
147
+ `Hydrate: ${guidance.nutrition.hydration_ml_target} ml. ` +
148
+ `Next period: ~${estimate.next_period_estimate}.`;
143
149
  return jsonResponse({
150
+ tldr,
144
151
  estimate,
145
152
  guidance,
146
153
  cross_connector_hints: [
@@ -150,5 +157,133 @@ export function registerCycleTools(server) {
150
157
  ],
151
158
  });
152
159
  });
160
+ server.registerTool("cycle_quickstart", {
161
+ title: "Cycle quickstart",
162
+ description: "Returns a personalized 3-step walkthrough for using wellness-cycle-coach. Call this first when the user asks 'how do I use this?'",
163
+ inputSchema: {
164
+ client: z
165
+ .enum(["claude", "codex", "cursor", "windsurf", "hermes", "openclaw", "generic"])
166
+ .optional(),
167
+ },
168
+ }, async ({ client }) => {
169
+ return jsonResponse({
170
+ ok: true,
171
+ client: client ?? "generic",
172
+ stateless_reminder: "wellness-cycle-coach NEVER stores cycle data. Every call requires period start dates passed in tool args.",
173
+ steps: [
174
+ {
175
+ step: 1,
176
+ title: "Gather period start dates",
177
+ action: "Pull period history from apple-health-mcp (Apple Health Cycle), garminmcp (women's health), or fitbitmcp (female health) — all three are in the davidmosiah ecosystem. Or ask the user directly.",
178
+ example: "history: [{ start_date: '2026-04-01' }, { start_date: '2026-04-29' }]",
179
+ },
180
+ {
181
+ step: 2,
182
+ title: "Call cycle_full_report",
183
+ action: "Pass the history array (and optionally `today` for testing). Get back current phase + nutrition + training + hydration + next-period date + a TL;DR string.",
184
+ example: "cycle_full_report({ history: [...] }) → { tldr: 'Phase: luteal...', estimate, guidance }",
185
+ },
186
+ {
187
+ step: 3,
188
+ title: "Cross-reference with the rest of the wellness stack",
189
+ action: "Use the phase to inform wellness-nourish meal planning, WHOOP/Oura/Garmin recovery to adjust training intensity in luteal, and nourish hydration to set the daily ml target.",
190
+ example: "Late luteal + WHOOP recovery 65 → 'expected; pre-period normal. Endurance + magnesium-rich meal.'",
191
+ },
192
+ ],
193
+ next_call: "cycle_full_report",
194
+ });
195
+ });
196
+ server.registerTool("cycle_profile_get", {
197
+ title: "Cycle profile get",
198
+ description: "Returns the shared Delx Wellness profile (~/.delx-wellness/profile.json). Read-only. Surfaces the user's sex_or_gender_context so wellness-cycle-coach knows whether to activate phase-aware coaching at all.",
199
+ inputSchema: {},
200
+ }, async () => {
201
+ const profile = await getProfile();
202
+ return jsonResponse({
203
+ ok: true,
204
+ profile,
205
+ summary: buildProfileSummary(profile),
206
+ missing_critical: missingCriticalFields(profile),
207
+ storage_path: getProfilePath(),
208
+ });
209
+ });
210
+ server.registerTool("cycle_profile_update", {
211
+ title: "Cycle profile update",
212
+ description: "Persist a partial patch to the shared Delx Wellness profile. Requires explicit_user_intent: true. Rejects any field containing oauth/token/secret/password/cookie/refresh/api_key/session — the profile is for non-secret wellness context only.",
213
+ inputSchema: {
214
+ patch: z
215
+ .record(z.string(), z.unknown())
216
+ .describe("Partial WellnessProfileDocument patch. Top-level keys: profile, goals, devices, training, nutrition, preferences, safety, notes."),
217
+ explicit_user_intent: z
218
+ .boolean()
219
+ .optional()
220
+ .describe("Must be true. Pass only after the user explicitly asked to save/update profile data."),
221
+ },
222
+ }, async ({ patch, explicit_user_intent }) => {
223
+ if (explicit_user_intent !== true) {
224
+ return jsonResponse({
225
+ ok: false,
226
+ error: "USER_ACTION_REQUIRED",
227
+ message: "explicit_user_intent must be true to update the shared wellness profile. Confirm with the user, then retry.",
228
+ });
229
+ }
230
+ try {
231
+ const profile = await updateProfile(patch);
232
+ return jsonResponse({
233
+ ok: true,
234
+ profile,
235
+ summary: buildProfileSummary(profile),
236
+ storage_path: getProfilePath(),
237
+ });
238
+ }
239
+ catch (err) {
240
+ return jsonResponse({ ok: false, error: "update_failed", message: err.message });
241
+ }
242
+ });
243
+ server.registerTool("cycle_onboarding", {
244
+ title: "Cycle onboarding",
245
+ description: "Returns the 11-question onboarding flow for the shared Delx Wellness profile. Read-only. The agent should ask these questions next so wellness-cycle-coach (and the rest of the wellness stack) can personalize responses — non-secret data only, stored at ~/.delx-wellness/profile.json.",
246
+ inputSchema: {
247
+ locale: z.enum(["en", "pt-BR"]).optional().describe("Onboarding locale. Defaults to en."),
248
+ },
249
+ }, async ({ locale }) => {
250
+ const flow = getOnboardingFlow(locale ?? "en");
251
+ const profile = await getProfile();
252
+ return jsonResponse({
253
+ ok: true,
254
+ ...flow,
255
+ current_profile: profile,
256
+ missing_critical: missingCriticalFields(profile),
257
+ cross_connector_hint: "wellness-cycle-coach reads profile.profile.sex_or_gender_context to activate phase-aware coaching. Pair with wellness-nourish (phase-emphasis meals) and whoop-mcp recovery (late-luteal load adjustments).",
258
+ });
259
+ });
260
+ server.registerTool("cycle_demo", {
261
+ title: "Cycle demo",
262
+ description: "Returns a realistic example payload showing what cycle_full_report looks like with sample data. Use to help agents understand the contract before a real call.",
263
+ inputSchema: {},
264
+ }, async () => {
265
+ const sampleHistory = [
266
+ { start_date: "2026-03-04" },
267
+ { start_date: "2026-04-01" },
268
+ { start_date: "2026-04-29" },
269
+ ];
270
+ const estimate = estimatePhase(sampleHistory, new Date("2026-05-15T12:00:00Z"));
271
+ const guidance = guidanceForPhase(estimate.phase);
272
+ const tldr = `Phase: ${estimate.phase} (cycle day ${estimate.cycle_day} of ~${estimate.cycle_length_days}). ` +
273
+ `Eat: ${guidance.nutrition.emphasize.slice(0, 2).join(", ")}. ` +
274
+ `Train: ${guidance.training.style} (${guidance.training.intensity}). ` +
275
+ `Hydrate: ${guidance.nutrition.hydration_ml_target} ml.`;
276
+ return jsonResponse({
277
+ ok: true,
278
+ is_demo: true,
279
+ sample_input: { history: sampleHistory, today: "2026-05-15" },
280
+ sample_output: { tldr, estimate, guidance },
281
+ notes: [
282
+ "This is synthetic data showing the shape of cycle_full_report output.",
283
+ "In real use, the agent passes the user's actual period start dates.",
284
+ "Confidence rises as more history accumulates (3+ periods = medium, 6+ = high).",
285
+ ],
286
+ });
287
+ });
153
288
  }
154
289
  //# sourceMappingURL=cycle-tools.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cycle-tools.js","sourceRoot":"","sources":["../../src/tools/cycle-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,0BAA0B,GAE3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,SAAS,YAAY,CAAC,OAAgB;IACpC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;QAC5E,iBAAiB,EAAE,OAAkC;KACtD,CAAC;AACJ,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAC3B,CAAC,CAAC,MAAM,CAAC;IACP,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC;IACnD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACpD,CAAC,CACH,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,MAAM,CAAC,YAAY,CACjB,sBAAsB,EACtB;QACE,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EACT,uKAAuK;QACzK,WAAW,EAAE;YACX,MAAM,EAAE,CAAC;iBACN,IAAI,CAAC,CAAC,QA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YACb,YAAY,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE;YAC7D,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE;YAC3C,KAAK,EAAE;gBACL,uEAAuE;gBACvE,qEAAqE;gBACrE,gFAAgF;aACjF;SACF,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wellness-cycle-coach",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Local-first menstrual cycle coach MCP for AI agents — orchestrates Apple Health Cycle, Garmin women's health, and Fitbit female health into phase-aware nutrition and recovery context.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/davidmosiah/wellness-cycle-coach",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.1.0",
9
+ "version": "0.3.0",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "wellness-cycle-coach",
14
- "version": "0.1.0",
14
+ "version": "0.3.0",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  }