@elizaos/plugin-health 2.0.0-beta.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.
- package/README.md +107 -0
- package/dist/actions/index.d.ts +20 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +5 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/anchors/index.d.ts +19 -0
- package/dist/anchors/index.d.ts.map +1 -0
- package/dist/anchors/index.js +9 -0
- package/dist/anchors/index.js.map +1 -0
- package/dist/connectors/contract-stubs.d.ts +112 -0
- package/dist/connectors/contract-stubs.d.ts.map +1 -0
- package/dist/connectors/contract-stubs.js +1 -0
- package/dist/connectors/contract-stubs.js.map +1 -0
- package/dist/connectors/index.d.ts +28 -0
- package/dist/connectors/index.d.ts.map +1 -0
- package/dist/connectors/index.js +202 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/contracts/circadian-default.d.ts +15 -0
- package/dist/contracts/circadian-default.d.ts.map +1 -0
- package/dist/contracts/circadian-default.js +30 -0
- package/dist/contracts/circadian-default.js.map +1 -0
- package/dist/contracts/circadian.d.ts +92 -0
- package/dist/contracts/circadian.d.ts.map +1 -0
- package/dist/contracts/circadian.js +14 -0
- package/dist/contracts/circadian.js.map +1 -0
- package/dist/contracts/health.d.ts +9 -0
- package/dist/contracts/health.d.ts.map +1 -0
- package/dist/contracts/health.js +21 -0
- package/dist/contracts/health.js.map +1 -0
- package/dist/contracts/lifeops-connector-degradation.d.ts +9 -0
- package/dist/contracts/lifeops-connector-degradation.d.ts.map +1 -0
- package/dist/contracts/lifeops-connector-degradation.js +17 -0
- package/dist/contracts/lifeops-connector-degradation.js.map +1 -0
- package/dist/contracts/lifeops.d.ts +3123 -0
- package/dist/contracts/lifeops.d.ts.map +1 -0
- package/dist/contracts/lifeops.js +635 -0
- package/dist/contracts/lifeops.js.map +1 -0
- package/dist/contracts/permissions.d.ts +39 -0
- package/dist/contracts/permissions.d.ts.map +1 -0
- package/dist/contracts/permissions.js +1 -0
- package/dist/contracts/permissions.js.map +1 -0
- package/dist/default-packs/bedtime.d.ts +14 -0
- package/dist/default-packs/bedtime.d.ts.map +1 -0
- package/dist/default-packs/bedtime.js +48 -0
- package/dist/default-packs/bedtime.js.map +1 -0
- package/dist/default-packs/contract-stubs.d.ts +161 -0
- package/dist/default-packs/contract-stubs.d.ts.map +1 -0
- package/dist/default-packs/contract-stubs.js +1 -0
- package/dist/default-packs/contract-stubs.js.map +1 -0
- package/dist/default-packs/index.d.ts +18 -0
- package/dist/default-packs/index.d.ts.map +1 -0
- package/dist/default-packs/index.js +39 -0
- package/dist/default-packs/index.js.map +1 -0
- package/dist/default-packs/sleep-recap.d.ts +14 -0
- package/dist/default-packs/sleep-recap.d.ts.map +1 -0
- package/dist/default-packs/sleep-recap.js +51 -0
- package/dist/default-packs/sleep-recap.js.map +1 -0
- package/dist/default-packs/wake-up.d.ts +14 -0
- package/dist/default-packs/wake-up.d.ts.map +1 -0
- package/dist/default-packs/wake-up.js +61 -0
- package/dist/default-packs/wake-up.js.map +1 -0
- package/dist/health-bridge/health-bridge.d.ts +57 -0
- package/dist/health-bridge/health-bridge.d.ts.map +1 -0
- package/dist/health-bridge/health-bridge.js +558 -0
- package/dist/health-bridge/health-bridge.js.map +1 -0
- package/dist/health-bridge/health-connectors.d.ts +23 -0
- package/dist/health-bridge/health-connectors.d.ts.map +1 -0
- package/dist/health-bridge/health-connectors.js +1018 -0
- package/dist/health-bridge/health-connectors.js.map +1 -0
- package/dist/health-bridge/health-oauth.d.ts +62 -0
- package/dist/health-bridge/health-oauth.d.ts.map +1 -0
- package/dist/health-bridge/health-oauth.js +432 -0
- package/dist/health-bridge/health-oauth.js.map +1 -0
- package/dist/health-bridge/health-provider-registry.d.ts +89 -0
- package/dist/health-bridge/health-provider-registry.d.ts.map +1 -0
- package/dist/health-bridge/health-provider-registry.js +141 -0
- package/dist/health-bridge/health-provider-registry.js.map +1 -0
- package/dist/health-bridge/health-records.d.ts +14 -0
- package/dist/health-bridge/health-records.d.ts.map +1 -0
- package/dist/health-bridge/health-records.js +45 -0
- package/dist/health-bridge/health-records.js.map +1 -0
- package/dist/health-bridge/index.d.ts +22 -0
- package/dist/health-bridge/index.d.ts.map +1 -0
- package/dist/health-bridge/index.js +7 -0
- package/dist/health-bridge/index.js.map +1 -0
- package/dist/health-bridge/service-normalize-health.d.ts +3 -0
- package/dist/health-bridge/service-normalize-health.d.ts.map +1 -0
- package/dist/health-bridge/service-normalize-health.js +96 -0
- package/dist/health-bridge/service-normalize-health.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/screen-time/index.d.ts +23 -0
- package/dist/screen-time/index.d.ts.map +1 -0
- package/dist/screen-time/index.js +1 -0
- package/dist/screen-time/index.js.map +1 -0
- package/dist/sleep/awake-probability.d.ts +11 -0
- package/dist/sleep/awake-probability.d.ts.map +1 -0
- package/dist/sleep/awake-probability.js +163 -0
- package/dist/sleep/awake-probability.js.map +1 -0
- package/dist/sleep/circadian-rules.d.ts +45 -0
- package/dist/sleep/circadian-rules.d.ts.map +1 -0
- package/dist/sleep/circadian-rules.js +258 -0
- package/dist/sleep/circadian-rules.js.map +1 -0
- package/dist/sleep/index.d.ts +21 -0
- package/dist/sleep/index.d.ts.map +1 -0
- package/dist/sleep/index.js +11 -0
- package/dist/sleep/index.js.map +1 -0
- package/dist/sleep/sleep-cycle-dispatch.d.ts +75 -0
- package/dist/sleep/sleep-cycle-dispatch.d.ts.map +1 -0
- package/dist/sleep/sleep-cycle-dispatch.js +102 -0
- package/dist/sleep/sleep-cycle-dispatch.js.map +1 -0
- package/dist/sleep/sleep-cycle.d.ts +38 -0
- package/dist/sleep/sleep-cycle.d.ts.map +1 -0
- package/dist/sleep/sleep-cycle.js +418 -0
- package/dist/sleep/sleep-cycle.js.map +1 -0
- package/dist/sleep/sleep-episode-store.d.ts +25 -0
- package/dist/sleep/sleep-episode-store.d.ts.map +1 -0
- package/dist/sleep/sleep-episode-store.js +69 -0
- package/dist/sleep/sleep-episode-store.js.map +1 -0
- package/dist/sleep/sleep-episode-types.d.ts +38 -0
- package/dist/sleep/sleep-episode-types.d.ts.map +1 -0
- package/dist/sleep/sleep-episode-types.js +14 -0
- package/dist/sleep/sleep-episode-types.js.map +1 -0
- package/dist/sleep/sleep-recap.d.ts +19 -0
- package/dist/sleep/sleep-recap.d.ts.map +1 -0
- package/dist/sleep/sleep-recap.js +1 -0
- package/dist/sleep/sleep-recap.js.map +1 -0
- package/dist/sleep/sleep-regularity.d.ts +19 -0
- package/dist/sleep/sleep-regularity.d.ts.map +1 -0
- package/dist/sleep/sleep-regularity.js +242 -0
- package/dist/sleep/sleep-regularity.js.map +1 -0
- package/dist/sleep/sleep-wake-events.d.ts +58 -0
- package/dist/sleep/sleep-wake-events.d.ts.map +1 -0
- package/dist/sleep/sleep-wake-events.js +135 -0
- package/dist/sleep/sleep-wake-events.js.map +1 -0
- package/dist/sleep/source-reliability.d.ts +38 -0
- package/dist/sleep/source-reliability.d.ts.map +1 -0
- package/dist/sleep/source-reliability.js +62 -0
- package/dist/sleep/source-reliability.js.map +1 -0
- package/dist/util/index.d.ts +10 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/index.js +3 -0
- package/dist/util/index.js.map +1 -0
- package/dist/util/normalize.d.ts +22 -0
- package/dist/util/normalize.d.ts.map +1 -0
- package/dist/util/normalize.js +62 -0
- package/dist/util/normalize.js.map +1 -0
- package/dist/util/time-util.d.ts +10 -0
- package/dist/util/time-util.d.ts.map +1 -0
- package/dist/util/time-util.js +14 -0
- package/dist/util/time-util.js.map +1 -0
- package/dist/util/time.d.ts +17 -0
- package/dist/util/time.d.ts.map +1 -0
- package/dist/util/time.js +152 -0
- package/dist/util/time.js.map +1 -0
- package/dist/util/token-encryption.d.ts +42 -0
- package/dist/util/token-encryption.d.ts.map +1 -0
- package/dist/util/token-encryption.js +96 -0
- package/dist/util/token-encryption.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `CircadianInsightContract` — runtime-registered seam between
|
|
3
|
+
* `app-lifeops` (and other consumers) and the plugin-health circadian +
|
|
4
|
+
* sleep-inference internals.
|
|
5
|
+
*
|
|
6
|
+
* W3-C drift D-4: prior to this contract, `app-lifeops/src/lifeops/
|
|
7
|
+
* schedule-insight.ts` and downstream actions reached directly into
|
|
8
|
+
* `@elizaos/plugin-health/src/sleep/*` for circadian scoring, awake
|
|
9
|
+
* probability, sleep-cycle resolution, regularity scoring, and historical
|
|
10
|
+
* episode reads. Per `post-cleanup-architecture.md` the sleep / circadian
|
|
11
|
+
* / screen-time domain is owned by `plugin-health`. Consumers now read
|
|
12
|
+
* through the contract registered on the runtime; the concrete
|
|
13
|
+
* implementation continues to live inside `plugin-health` (where the
|
|
14
|
+
* domain helpers live), so deep imports stay private to the plugin.
|
|
15
|
+
*
|
|
16
|
+
* The contract is read-only — the only writer of fresh inference is the
|
|
17
|
+
* scheduler tick wired through `LifeOpsService.inspectSchedule`. Consumers
|
|
18
|
+
* that just want "what does the scheduler currently believe" should call
|
|
19
|
+
* `getCurrentSleepWindow` / `inferOptimalSchedulingWindow` instead of
|
|
20
|
+
* driving fresh inspection themselves.
|
|
21
|
+
*/
|
|
22
|
+
import type { IAgentRuntime } from "@elizaos/core";
|
|
23
|
+
import type { LifeOpsCircadianState, LifeOpsScheduleInsight, LifeOpsScheduleMealLabel } from "@elizaos/shared";
|
|
24
|
+
/**
|
|
25
|
+
* The contract's view of "the current sleep window". `state` is null when
|
|
26
|
+
* inference has not produced a high-confidence answer yet.
|
|
27
|
+
*/
|
|
28
|
+
export interface SleepWindow {
|
|
29
|
+
/** Current circadian phase, or null when inference is still calibrating. */
|
|
30
|
+
state: LifeOpsCircadianState | null;
|
|
31
|
+
/** Confidence in `state` on [0, 1]. */
|
|
32
|
+
confidence: number;
|
|
33
|
+
/** ISO-8601 timestamp of the last inferred wake event, when known. */
|
|
34
|
+
lastWakeAtIso: string | null;
|
|
35
|
+
/** ISO-8601 timestamp of the current sleep onset, when the user is asleep. */
|
|
36
|
+
currentSleepStartedAtIso: string | null;
|
|
37
|
+
/** ISO-8601 next bedtime target, when the model has one. */
|
|
38
|
+
bedtimeTargetAtIso: string | null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* "When should I schedule something so it lands in the user's optimal
|
|
42
|
+
* window?" The contract exposes the inference output without committing
|
|
43
|
+
* callers to a particular meal/sleep cycle representation.
|
|
44
|
+
*/
|
|
45
|
+
export interface SchedulingWindow {
|
|
46
|
+
/** Most appropriate ISO-8601 fire time for the next scheduled task. */
|
|
47
|
+
recommendedAtIso: string | null;
|
|
48
|
+
/** Optional meal label when the scheduler is targeting a meal-window. */
|
|
49
|
+
nextMealLabel: LifeOpsScheduleMealLabel | null;
|
|
50
|
+
/** ISO-8601 lower bound of the window. */
|
|
51
|
+
windowStartIso: string | null;
|
|
52
|
+
/** ISO-8601 upper bound of the window. */
|
|
53
|
+
windowEndIso: string | null;
|
|
54
|
+
/** Confidence in the recommendation on [0, 1]. */
|
|
55
|
+
confidence: number;
|
|
56
|
+
/**
|
|
57
|
+
* Free-form reason for the recommendation, e.g. "next meal window
|
|
58
|
+
* (lunch) starts in 12 minutes" or "still calibrating, defer to manual".
|
|
59
|
+
* The string is stable and intended for surfacing to the user.
|
|
60
|
+
*/
|
|
61
|
+
reason: string;
|
|
62
|
+
}
|
|
63
|
+
export interface SleepWindowOptions {
|
|
64
|
+
/** Optional IANA timezone override (defaults to the owner's resolved tz). */
|
|
65
|
+
timezone?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface SchedulingWindowOptions {
|
|
68
|
+
timezone?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Public contract every consumer reads. The implementation lives in
|
|
72
|
+
* `plugin-health`; consumers resolve it via `getCircadianInsightContract`.
|
|
73
|
+
*/
|
|
74
|
+
export interface CircadianInsightContract {
|
|
75
|
+
/** Snapshot of "are they awake / asleep / napping right now?". */
|
|
76
|
+
getCurrentSleepWindow(opts?: SleepWindowOptions): Promise<SleepWindow>;
|
|
77
|
+
/**
|
|
78
|
+
* Snapshot of "when should the next scheduled task fire to land in the
|
|
79
|
+
* owner's optimal window?". Returns recommendedAtIso=null when
|
|
80
|
+
* inference is still calibrating.
|
|
81
|
+
*/
|
|
82
|
+
inferOptimalSchedulingWindow(opts?: SchedulingWindowOptions): Promise<SchedulingWindow>;
|
|
83
|
+
/**
|
|
84
|
+
* Direct accessor for the underlying scheduler-tick insight record.
|
|
85
|
+
* Returned for read-only consumption (UI, debug routes); writers must
|
|
86
|
+
* go through the scheduler tick.
|
|
87
|
+
*/
|
|
88
|
+
getLatestInsight(opts?: SchedulingWindowOptions): Promise<LifeOpsScheduleInsight | null>;
|
|
89
|
+
}
|
|
90
|
+
export declare function registerCircadianInsightContract(runtime: IAgentRuntime, contract: CircadianInsightContract): void;
|
|
91
|
+
export declare function getCircadianInsightContract(runtime: IAgentRuntime): CircadianInsightContract | null;
|
|
92
|
+
//# sourceMappingURL=circadian.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circadian.d.ts","sourceRoot":"","sources":["../../src/contracts/circadian.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACpC,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,8EAA8E;IAC9E,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,4DAA4D;IAC5D,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uEAAuE;IACvE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,yEAAyE;IACzE,aAAa,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC/C,0CAA0C;IAC1C,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,0CAA0C;IAC1C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,qBAAqB,CAAC,IAAI,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEvE;;;;OAIG;IACH,4BAA4B,CAC1B,IAAI,CAAC,EAAE,uBAAuB,GAC7B,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE7B;;;;OAIG;IACH,gBAAgB,CACd,IAAI,CAAC,EAAE,uBAAuB,GAC7B,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAC;CAC3C;AAYD,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,wBAAwB,GACjC,IAAI,CAEN;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,aAAa,GACrB,wBAAwB,GAAG,IAAI,CAIjC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const CIRCADIAN_CONTRACT_KEY = /* @__PURE__ */ Symbol.for(
|
|
2
|
+
"@elizaos/plugin-health:circadian-insight-contract"
|
|
3
|
+
);
|
|
4
|
+
function registerCircadianInsightContract(runtime, contract) {
|
|
5
|
+
runtime[CIRCADIAN_CONTRACT_KEY] = contract;
|
|
6
|
+
}
|
|
7
|
+
function getCircadianInsightContract(runtime) {
|
|
8
|
+
return runtime[CIRCADIAN_CONTRACT_KEY] ?? null;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
getCircadianInsightContract,
|
|
12
|
+
registerCircadianInsightContract
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=circadian.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/contracts/circadian.ts"],"sourcesContent":["/**\n * `CircadianInsightContract` — runtime-registered seam between\n * `app-lifeops` (and other consumers) and the plugin-health circadian +\n * sleep-inference internals.\n *\n * W3-C drift D-4: prior to this contract, `app-lifeops/src/lifeops/\n * schedule-insight.ts` and downstream actions reached directly into\n * `@elizaos/plugin-health/src/sleep/*` for circadian scoring, awake\n * probability, sleep-cycle resolution, regularity scoring, and historical\n * episode reads. Per `post-cleanup-architecture.md` the sleep / circadian\n * / screen-time domain is owned by `plugin-health`. Consumers now read\n * through the contract registered on the runtime; the concrete\n * implementation continues to live inside `plugin-health` (where the\n * domain helpers live), so deep imports stay private to the plugin.\n *\n * The contract is read-only — the only writer of fresh inference is the\n * scheduler tick wired through `LifeOpsService.inspectSchedule`. Consumers\n * that just want \"what does the scheduler currently believe\" should call\n * `getCurrentSleepWindow` / `inferOptimalSchedulingWindow` instead of\n * driving fresh inspection themselves.\n */\n\nimport type { IAgentRuntime } from \"@elizaos/core\";\nimport type {\n LifeOpsCircadianState,\n LifeOpsScheduleInsight,\n LifeOpsScheduleMealLabel,\n} from \"@elizaos/shared\";\n\n/**\n * The contract's view of \"the current sleep window\". `state` is null when\n * inference has not produced a high-confidence answer yet.\n */\nexport interface SleepWindow {\n /** Current circadian phase, or null when inference is still calibrating. */\n state: LifeOpsCircadianState | null;\n /** Confidence in `state` on [0, 1]. */\n confidence: number;\n /** ISO-8601 timestamp of the last inferred wake event, when known. */\n lastWakeAtIso: string | null;\n /** ISO-8601 timestamp of the current sleep onset, when the user is asleep. */\n currentSleepStartedAtIso: string | null;\n /** ISO-8601 next bedtime target, when the model has one. */\n bedtimeTargetAtIso: string | null;\n}\n\n/**\n * \"When should I schedule something so it lands in the user's optimal\n * window?\" The contract exposes the inference output without committing\n * callers to a particular meal/sleep cycle representation.\n */\nexport interface SchedulingWindow {\n /** Most appropriate ISO-8601 fire time for the next scheduled task. */\n recommendedAtIso: string | null;\n /** Optional meal label when the scheduler is targeting a meal-window. */\n nextMealLabel: LifeOpsScheduleMealLabel | null;\n /** ISO-8601 lower bound of the window. */\n windowStartIso: string | null;\n /** ISO-8601 upper bound of the window. */\n windowEndIso: string | null;\n /** Confidence in the recommendation on [0, 1]. */\n confidence: number;\n /**\n * Free-form reason for the recommendation, e.g. \"next meal window\n * (lunch) starts in 12 minutes\" or \"still calibrating, defer to manual\".\n * The string is stable and intended for surfacing to the user.\n */\n reason: string;\n}\n\nexport interface SleepWindowOptions {\n /** Optional IANA timezone override (defaults to the owner's resolved tz). */\n timezone?: string;\n}\n\nexport interface SchedulingWindowOptions {\n timezone?: string;\n}\n\n/**\n * Public contract every consumer reads. The implementation lives in\n * `plugin-health`; consumers resolve it via `getCircadianInsightContract`.\n */\nexport interface CircadianInsightContract {\n /** Snapshot of \"are they awake / asleep / napping right now?\". */\n getCurrentSleepWindow(opts?: SleepWindowOptions): Promise<SleepWindow>;\n\n /**\n * Snapshot of \"when should the next scheduled task fire to land in the\n * owner's optimal window?\". Returns recommendedAtIso=null when\n * inference is still calibrating.\n */\n inferOptimalSchedulingWindow(\n opts?: SchedulingWindowOptions,\n ): Promise<SchedulingWindow>;\n\n /**\n * Direct accessor for the underlying scheduler-tick insight record.\n * Returned for read-only consumption (UI, debug routes); writers must\n * go through the scheduler tick.\n */\n getLatestInsight(\n opts?: SchedulingWindowOptions,\n ): Promise<LifeOpsScheduleInsight | null>;\n}\n\n// --- Runtime registration ---------------------------------------------------\n\nconst CIRCADIAN_CONTRACT_KEY = Symbol.for(\n \"@elizaos/plugin-health:circadian-insight-contract\",\n);\n\ninterface CircadianContractHostRuntime extends IAgentRuntime {\n [CIRCADIAN_CONTRACT_KEY]?: CircadianInsightContract;\n}\n\nexport function registerCircadianInsightContract(\n runtime: IAgentRuntime,\n contract: CircadianInsightContract,\n): void {\n (runtime as CircadianContractHostRuntime)[CIRCADIAN_CONTRACT_KEY] = contract;\n}\n\nexport function getCircadianInsightContract(\n runtime: IAgentRuntime,\n): CircadianInsightContract | null {\n return (\n (runtime as CircadianContractHostRuntime)[CIRCADIAN_CONTRACT_KEY] ?? null\n );\n}\n"],"mappings":"AA4GA,MAAM,yBAAyB,uBAAO;AAAA,EACpC;AACF;AAMO,SAAS,iCACd,SACA,UACM;AACN,EAAC,QAAyC,sBAAsB,IAAI;AACtE;AAEO,SAAS,4BACd,SACiC;AACjC,SACG,QAAyC,sBAAsB,KAAK;AAEzE;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* plugin-health canonical contract surface.
|
|
3
|
+
*
|
|
4
|
+
* Owns the sleep / circadian / health-metric / screen-time types locally so
|
|
5
|
+
* runtime plugins stay decoupled from app/shared packages.
|
|
6
|
+
*/
|
|
7
|
+
export type { DisconnectLifeOpsHealthConnectorRequest, GetLifeOpsHealthSummaryRequest, LifeOpsActivitySignal, LifeOpsActivitySignalSource, LifeOpsAwakeProbability, LifeOpsAwakeProbabilityContributor, LifeOpsAwakeProbabilitySource, LifeOpsBedtimeImminentFilters, LifeOpsCircadianRuleFiring, LifeOpsCircadianState, LifeOpsConnectorDegradation, LifeOpsConnectorExecutionTarget, LifeOpsConnectorGrant, LifeOpsConnectorMode, LifeOpsConnectorSide, LifeOpsConnectorSourceOfTruth, LifeOpsDayBoundary, LifeOpsDayBoundaryAnchor, LifeOpsEventKind, LifeOpsHealthConnectorCapability, LifeOpsHealthConnectorProvider, LifeOpsHealthConnectorReason, LifeOpsHealthConnectorStatus, LifeOpsHealthDailySummary, LifeOpsHealthMetric, LifeOpsHealthMetricSample, LifeOpsHealthSignal, LifeOpsHealthSignalBiometrics, LifeOpsHealthSignalSleepSummary, LifeOpsHealthSignalSource, LifeOpsHealthSleepEpisode, LifeOpsHealthSleepStage, LifeOpsHealthSleepStageSample, LifeOpsHealthSummaryResponse, LifeOpsHealthSyncState, LifeOpsHealthWorkout, LifeOpsMobileHealthPayload, LifeOpsNapDetectedFilters, LifeOpsPersonalBaseline, LifeOpsRegularityChangedFilters, LifeOpsRegularityClass, LifeOpsRelativeTime, LifeOpsRelativeTimeAnchorSource, LifeOpsScheduleInsight, LifeOpsScheduleMealInsight, LifeOpsScheduleMealLabel, LifeOpsScheduleMealSource, LifeOpsScheduleRegularity, LifeOpsScheduleSleepStatus, LifeOpsScreenTimePerAppUsage, LifeOpsScreenTimeSummaryPayload, LifeOpsSleepCycle, LifeOpsSleepCycleEvidence, LifeOpsSleepCycleEvidenceSource, LifeOpsSleepCycleType, LifeOpsSleepDetectedFilters, LifeOpsSleepEndedFilters, LifeOpsSleepOnsetCandidateFilters, LifeOpsUnclearReason, LifeOpsWakeConfirmedFilters, LifeOpsWakeObservedFilters, StartLifeOpsHealthConnectorRequest, StartLifeOpsHealthConnectorResponse, SyncLifeOpsHealthConnectorRequest, } from "./lifeops.js";
|
|
8
|
+
export { LIFEOPS_CIRCADIAN_STATES, LIFEOPS_HEALTH_CONNECTOR_CAPABILITIES, LIFEOPS_HEALTH_CONNECTOR_PROVIDERS, LIFEOPS_HEALTH_CONNECTOR_REASONS, LIFEOPS_HEALTH_METRICS, LIFEOPS_HEALTH_SIGNAL_SOURCES, LIFEOPS_HEALTH_SLEEP_STAGES, LIFEOPS_UNCLEAR_REASONS, } from "./lifeops.js";
|
|
9
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/contracts/health.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,uCAAuC,EAEvC,8BAA8B,EAC9B,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,kCAAkC,EAClC,6BAA6B,EAC7B,6BAA6B,EAC7B,0BAA0B,EAE1B,qBAAqB,EACrB,2BAA2B,EAC3B,+BAA+B,EAC/B,qBAAqB,EAErB,oBAAoB,EACpB,oBAAoB,EACpB,6BAA6B,EAC7B,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,gCAAgC,EAEhC,8BAA8B,EAE9B,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,6BAA6B,EAC7B,+BAA+B,EAE/B,yBAAyB,EACzB,yBAAyB,EAEzB,uBAAuB,EACvB,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,oBAAoB,EAEpB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACvB,+BAA+B,EAC/B,sBAAsB,EACtB,mBAAmB,EACnB,+BAA+B,EAC/B,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAE1B,4BAA4B,EAC5B,+BAA+B,EAC/B,iBAAiB,EACjB,yBAAyB,EACzB,+BAA+B,EAC/B,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EAExB,iCAAiC,EACjC,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,kCAAkC,EAClC,mCAAmC,EACnC,iCAAiC,GAClC,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,wBAAwB,EACxB,qCAAqC,EACrC,kCAAkC,EAClC,gCAAgC,EAChC,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LIFEOPS_CIRCADIAN_STATES,
|
|
3
|
+
LIFEOPS_HEALTH_CONNECTOR_CAPABILITIES,
|
|
4
|
+
LIFEOPS_HEALTH_CONNECTOR_PROVIDERS,
|
|
5
|
+
LIFEOPS_HEALTH_CONNECTOR_REASONS,
|
|
6
|
+
LIFEOPS_HEALTH_METRICS,
|
|
7
|
+
LIFEOPS_HEALTH_SIGNAL_SOURCES,
|
|
8
|
+
LIFEOPS_HEALTH_SLEEP_STAGES,
|
|
9
|
+
LIFEOPS_UNCLEAR_REASONS
|
|
10
|
+
} from "./lifeops.js";
|
|
11
|
+
export {
|
|
12
|
+
LIFEOPS_CIRCADIAN_STATES,
|
|
13
|
+
LIFEOPS_HEALTH_CONNECTOR_CAPABILITIES,
|
|
14
|
+
LIFEOPS_HEALTH_CONNECTOR_PROVIDERS,
|
|
15
|
+
LIFEOPS_HEALTH_CONNECTOR_REASONS,
|
|
16
|
+
LIFEOPS_HEALTH_METRICS,
|
|
17
|
+
LIFEOPS_HEALTH_SIGNAL_SOURCES,
|
|
18
|
+
LIFEOPS_HEALTH_SLEEP_STAGES,
|
|
19
|
+
LIFEOPS_UNCLEAR_REASONS
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/contracts/health.ts"],"sourcesContent":["/**\n * plugin-health canonical contract surface.\n *\n * Owns the sleep / circadian / health-metric / screen-time types locally so\n * runtime plugins stay decoupled from app/shared packages.\n */\n\nexport type {\n DisconnectLifeOpsHealthConnectorRequest,\n // REST request/response surface\n GetLifeOpsHealthSummaryRequest,\n LifeOpsActivitySignal,\n LifeOpsActivitySignalSource,\n LifeOpsAwakeProbability,\n LifeOpsAwakeProbabilityContributor,\n LifeOpsAwakeProbabilitySource,\n LifeOpsBedtimeImminentFilters,\n LifeOpsCircadianRuleFiring,\n // Circadian inference\n LifeOpsCircadianState,\n LifeOpsConnectorDegradation,\n LifeOpsConnectorExecutionTarget,\n LifeOpsConnectorGrant,\n // Auxiliary types referenced by health surface\n LifeOpsConnectorMode,\n LifeOpsConnectorSide,\n LifeOpsConnectorSourceOfTruth,\n LifeOpsDayBoundary,\n LifeOpsDayBoundaryAnchor,\n LifeOpsEventKind,\n LifeOpsHealthConnectorCapability,\n // Connector provider / capability / metric\n LifeOpsHealthConnectorProvider,\n // Connector status / wire envelopes\n LifeOpsHealthConnectorReason,\n LifeOpsHealthConnectorStatus,\n LifeOpsHealthDailySummary,\n LifeOpsHealthMetric,\n LifeOpsHealthMetricSample,\n LifeOpsHealthSignal,\n LifeOpsHealthSignalBiometrics,\n LifeOpsHealthSignalSleepSummary,\n // Health-signal source + signal payload\n LifeOpsHealthSignalSource,\n LifeOpsHealthSleepEpisode,\n // Sleep-stage + sleep-episode model\n LifeOpsHealthSleepStage,\n LifeOpsHealthSleepStageSample,\n LifeOpsHealthSummaryResponse,\n LifeOpsHealthSyncState,\n LifeOpsHealthWorkout,\n // Telemetry mobile-health envelope\n LifeOpsMobileHealthPayload,\n LifeOpsNapDetectedFilters,\n LifeOpsPersonalBaseline,\n LifeOpsRegularityChangedFilters,\n LifeOpsRegularityClass,\n LifeOpsRelativeTime,\n LifeOpsRelativeTimeAnchorSource,\n LifeOpsScheduleInsight,\n LifeOpsScheduleMealInsight,\n LifeOpsScheduleMealLabel,\n LifeOpsScheduleMealSource,\n LifeOpsScheduleRegularity,\n LifeOpsScheduleSleepStatus,\n // Screen-time\n LifeOpsScreenTimePerAppUsage,\n LifeOpsScreenTimeSummaryPayload,\n LifeOpsSleepCycle,\n LifeOpsSleepCycleEvidence,\n LifeOpsSleepCycleEvidenceSource,\n LifeOpsSleepCycleType,\n LifeOpsSleepDetectedFilters,\n LifeOpsSleepEndedFilters,\n // Sleep / wake event filters\n LifeOpsSleepOnsetCandidateFilters,\n LifeOpsUnclearReason,\n LifeOpsWakeConfirmedFilters,\n LifeOpsWakeObservedFilters,\n StartLifeOpsHealthConnectorRequest,\n StartLifeOpsHealthConnectorResponse,\n SyncLifeOpsHealthConnectorRequest,\n} from \"./lifeops.js\";\n\nexport {\n LIFEOPS_CIRCADIAN_STATES,\n LIFEOPS_HEALTH_CONNECTOR_CAPABILITIES,\n LIFEOPS_HEALTH_CONNECTOR_PROVIDERS,\n LIFEOPS_HEALTH_CONNECTOR_REASONS,\n LIFEOPS_HEALTH_METRICS,\n LIFEOPS_HEALTH_SIGNAL_SOURCES,\n LIFEOPS_HEALTH_SLEEP_STAGES,\n LIFEOPS_UNCLEAR_REASONS,\n} from \"./lifeops.js\";\n"],"mappings":"AAoFA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const LIFEOPS_CONNECTOR_DEGRADATION_AXES: readonly ["missing-scope", "rate-limited", "disconnected", "auth-expired", "session-revoked", "delivery-degraded", "helper-disconnected", "retry-idempotent", "hold-expired", "transport-offline", "blocked-resume"];
|
|
2
|
+
export type LifeOpsConnectorDegradationAxis = (typeof LIFEOPS_CONNECTOR_DEGRADATION_AXES)[number];
|
|
3
|
+
export interface LifeOpsConnectorDegradation {
|
|
4
|
+
axis: LifeOpsConnectorDegradationAxis;
|
|
5
|
+
code: string;
|
|
6
|
+
message: string;
|
|
7
|
+
retryable: boolean;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=lifeops-connector-degradation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifeops-connector-degradation.d.ts","sourceRoot":"","sources":["../../src/contracts/lifeops-connector-degradation.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kCAAkC,sNAYrC,CAAC;AAEX,MAAM,MAAM,+BAA+B,GACzC,CAAC,OAAO,kCAAkC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,+BAA+B,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const LIFEOPS_CONNECTOR_DEGRADATION_AXES = [
|
|
2
|
+
"missing-scope",
|
|
3
|
+
"rate-limited",
|
|
4
|
+
"disconnected",
|
|
5
|
+
"auth-expired",
|
|
6
|
+
"session-revoked",
|
|
7
|
+
"delivery-degraded",
|
|
8
|
+
"helper-disconnected",
|
|
9
|
+
"retry-idempotent",
|
|
10
|
+
"hold-expired",
|
|
11
|
+
"transport-offline",
|
|
12
|
+
"blocked-resume"
|
|
13
|
+
];
|
|
14
|
+
export {
|
|
15
|
+
LIFEOPS_CONNECTOR_DEGRADATION_AXES
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=lifeops-connector-degradation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/contracts/lifeops-connector-degradation.ts"],"sourcesContent":["export const LIFEOPS_CONNECTOR_DEGRADATION_AXES = [\n \"missing-scope\",\n \"rate-limited\",\n \"disconnected\",\n \"auth-expired\",\n \"session-revoked\",\n \"delivery-degraded\",\n \"helper-disconnected\",\n \"retry-idempotent\",\n \"hold-expired\",\n \"transport-offline\",\n \"blocked-resume\",\n] as const;\n\nexport type LifeOpsConnectorDegradationAxis =\n (typeof LIFEOPS_CONNECTOR_DEGRADATION_AXES)[number];\n\nexport interface LifeOpsConnectorDegradation {\n axis: LifeOpsConnectorDegradationAxis;\n code: string;\n message: string;\n retryable: boolean;\n}\n"],"mappings":"AAAO,MAAM,qCAAqC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|